@@ -1 +1 @@
-{"version":3,"file":"core.umd.js","sources":["../../../../../../../../../../external/ngdeps/node_modules/tslib/tslib.es6.js","../../../../../packages/core/src/util/property.ts","../../../../../packages/core/src/render3/fields.ts","../../../../../packages/core/src/di/defs.ts","../../../../../packages/core/src/di/injection_token.ts","../../../../../packages/core/src/util/decorators.ts","../../../../../packages/core/src/metadata/di.ts","../../../../../packages/core/src/change_detection/constants.ts","../../../../../packages/core/src/util.ts","../../../../../packages/core/src/di/forward_ref.ts","../../../../../packages/core/src/metadata/resource_loading.ts","../../../../../packages/core/src/metadata/view.ts","../../../../../packages/core/src/render3/ng_dev_mode.ts","../../../../../packages/core/src/render3/empty.ts","../../../../../packages/core/src/render3/definition.ts","../../../../../packages/core/src/render3/assert.ts","../../../../../packages/core/src/render3/interfaces/view.ts","../../../../../packages/core/src/render3/interfaces/container.ts","../../../../../packages/core/src/render3/interfaces/context.ts","../../../../../packages/core/src/render3/interfaces/injector.ts","../../../../../packages/core/src/render3/util.ts","../../../../../packages/core/src/render3/jit/compiler_facade_interface.ts","../../../../../packages/core/src/render3/jit/compiler_facade.ts","../../../../../packages/core/src/di/metadata.ts","../../../../../packages/core/src/di/injector_compatibility.ts","../../../../../packages/core/src/render3/node_assert.ts","../../../../../packages/core/src/render3/hooks.ts","../../../../../packages/core/src/render3/state.ts","../../../../../packages/core/src/render3/di.ts","../../../../../packages/core/src/render3/context_discovery.ts","../../../../../packages/core/src/render3/discovery_utils.ts","../../../../../packages/core/src/util/ng_reflect.ts","../../../../../packages/core/src/change_detection/change_detection_util.ts","../../../../../packages/core/src/render3/errors.ts","../../../../../packages/core/src/render3/tokens.ts","../../../../../packages/core/src/render3/bindings.ts","../../../../../packages/core/src/render3/interfaces/projection.ts","../../../../../packages/core/src/render3/interfaces/renderer.ts","../../../../../packages/core/src/render3/interfaces/node.ts","../../../../../packages/core/src/render3/node_manipulation.ts","../../../../../packages/core/src/render3/node_selector_matcher.ts","../../../../../packages/core/src/render3/styling/player_factory.ts","../../../../../packages/core/src/render3/styling/core_player_handler.ts","../../../../../packages/core/src/render3/styling/util.ts","../../../../../packages/core/src/render3/styling/class_and_style_bindings.ts","../../../../../packages/core/src/render3/instructions.ts","../../../../../packages/core/src/render3/players.ts","../../../../../packages/core/src/render3/global_utils_api.ts","../../../../../packages/core/src/render3/global_utils.ts","../../../../../packages/core/src/render3/component.ts","../../../../../packages/core/src/render3/features/inherit_definition_feature.ts","../../../../../packages/core/src/render3/features/ng_onchanges_feature.ts","../../../../../packages/core/src/util/noop.ts","../../../../../packages/core/src/di/injector.ts","../../../../../packages/core/src/di/scope.ts","../../../../../packages/core/src/di/r3_injector.ts","../../../../../packages/core/src/render3/di_setup.ts","../../../../../packages/core/src/render3/features/providers_feature.ts","../../../../../packages/core/src/linker/component_factory.ts","../../../../../packages/core/src/linker/component_factory_resolver.ts","../../../../../packages/core/src/linker/ng_module_factory.ts","../../../../../packages/core/src/render3/view_ref.ts","../../../../../packages/core/src/render3/view_engine_compatibility.ts","../../../../../packages/core/src/linker/element_ref.ts","../../../../../packages/core/src/render/api.ts","../../../../../packages/core/src/sanitization/security.ts","../../../../../packages/core/src/version.ts","../../../../../packages/core/src/render3/component_ref.ts","../../../../../packages/core/src/is_dev_mode.ts","../../../../../packages/core/src/sanitization/inert_body.ts","../../../../../packages/core/src/sanitization/url_sanitizer.ts","../../../../../packages/core/src/sanitization/html_sanitizer.ts","../../../../../packages/core/src/render3/interfaces/i18n.ts","../../../../../packages/core/src/render3/i18n.ts","../../../../../packages/core/src/render3/ng_module_ref.ts","../../../../../packages/core/src/render3/metadata.ts","../../../../../packages/core/src/render3/pure_function.ts","../../../../../packages/core/src/render3/pipe.ts","../../../../../packages/core/src/event_emitter.ts","../../../../../packages/core/src/linker/template_ref.ts","../../../../../packages/core/src/render3/interfaces/definition.ts","../../../../../packages/core/src/render3/interfaces/query.ts","../../../../../packages/core/src/render3/query.ts","../../../../../packages/core/src/render3/view_engine_compatibility_prebound.ts","../../../../../packages/core/src/render3/index.ts","../../../../../packages/core/src/sanitization/bypass.ts","../../../../../packages/core/src/sanitization/style_sanitizer.ts","../../../../../packages/core/src/sanitization/sanitization.ts","../../../../../packages/core/src/render3/jit/environment.ts","../../../../../packages/core/src/linker/ng_module_factory_loader.ts","../../../../../packages/core/src/type.ts","../../../../../packages/core/src/reflection/reflection_capabilities.ts","../../../../../packages/core/src/render3/jit/util.ts","../../../../../packages/core/src/render3/jit/module.ts","../../../../../packages/core/src/render3/jit/directive.ts","../../../../../packages/core/src/render3/jit/pipe.ts","../../../../../packages/core/src/metadata/directives.ts","../../../../../packages/core/src/di/util.ts","../../../../../packages/core/src/metadata/ng_module.ts","../../../../../packages/core/src/metadata.ts","../../../../../packages/core/src/render3/jit/injectable.ts","../../../../../packages/core/src/di/injectable.ts","../../../../../packages/core/src/errors.ts","../../../../../packages/core/src/error_handler.ts","../../../../../packages/core/src/di/reflective_errors.ts","../../../../../packages/core/src/di/reflective_key.ts","../../../../../packages/core/src/reflection/reflector.ts","../../../../../packages/core/src/reflection/reflection.ts","../../../../../packages/core/src/di/reflective_provider.ts","../../../../../packages/core/src/di/reflective_injector.ts","../../../../../packages/core/src/di.ts","../../../../../packages/core/src/util/lang.ts","../../../../../packages/core/src/application_init.ts","../../../../../packages/core/src/application_tokens.ts","../../../../../packages/core/src/console.ts","../../../../../packages/core/src/linker/compiler.ts","../../../../../packages/core/src/profile/wtf_impl.ts","../../../../../packages/core/src/profile/profile.ts","../../../../../packages/core/src/zone/ng_zone.ts","../../../../../packages/core/src/testability/testability.ts","../../../../../packages/core/src/application_ref.ts","../../../../../packages/core/src/zone.ts","../../../../../packages/core/src/render.ts","../../../../../packages/core/src/linker/query_list.ts","../../../../../packages/core/src/linker/system_js_ng_module_factory_loader.ts","../../../../../packages/core/src/linker/view_container_ref.ts","../../../../../packages/core/src/change_detection/change_detector_ref.ts","../../../../../packages/core/src/linker/view_ref.ts","../../../../../packages/core/src/linker.ts","../../../../../packages/core/src/debug/debug_node.ts","../../../../../packages/core/src/change_detection/differs/default_iterable_differ.ts","../../../../../packages/core/src/change_detection/differs/default_keyvalue_differ.ts","../../../../../packages/core/src/change_detection/differs/iterable_differs.ts","../../../../../packages/core/src/change_detection/differs/keyvalue_differs.ts","../../../../../packages/core/src/change_detection/change_detection.ts","../../../../../packages/core/src/change_detection.ts","../../../../../packages/core/src/platform_core_providers.ts","../../../../../packages/core/src/i18n/tokens.ts","../../../../../packages/core/src/application_module.ts","../../../../../packages/core/src/ivy_switch.ts","../../../../../packages/core/src/view/types.ts","../../../../../packages/core/src/view/errors.ts","../../../../../packages/core/src/view/util.ts","../../../../../packages/core/src/view/element.ts","../../../../../packages/core/src/view/ng_module.ts","../../../../../packages/core/src/view/view_attach.ts","../../../../../packages/core/src/view/refs.ts","../../../../../packages/core/src/view/provider.ts","../../../../../packages/core/src/view/query.ts","../../../../../packages/core/src/view/ng_content.ts","../../../../../packages/core/src/view/pure_expression.ts","../../../../../packages/core/src/view/text.ts","../../../../../packages/core/src/view/view.ts","../../../../../packages/core/src/view/services.ts","../../../../../packages/core/src/view/entrypoint.ts","../../../../../packages/core/src/view/index.ts","../../../../../packages/core/src/core_private_export.ts","../../../../../packages/core/src/core_render3_private_export.ts","../../../../../packages/core/src/codegen_private_exports.ts","../../../../../packages/core/src/core.ts","../../../../../packages/core/public_api.ts","../../../../../packages/core/index.ts","../../../../../packages/core/core.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nexport function fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getClosureSafeProperty} from '../util/property';\n\nexport const NG_COMPONENT_DEF = getClosureSafeProperty({ngComponentDef: getClosureSafeProperty});\nexport const NG_DIRECTIVE_DEF = getClosureSafeProperty({ngDirectiveDef: getClosureSafeProperty});\nexport const NG_INJECTABLE_DEF = getClosureSafeProperty({ngInjectableDef: getClosureSafeProperty});\nexport const NG_INJECTOR_DEF = getClosureSafeProperty({ngInjectorDef: getClosureSafeProperty});\nexport const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: getClosureSafeProperty});\nexport const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: getClosureSafeProperty});\nexport const NG_BASE_DEF = getClosureSafeProperty({ngBaseDef: getClosureSafeProperty});\n\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\nexport const NG_ELEMENT_ID = getClosureSafeProperty({__NG_ELEMENT_ID__: getClosureSafeProperty});\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NG_INJECTABLE_DEF, NG_INJECTOR_DEF} from '../render3/fields';\nimport {Type} from '../type';\n\nimport {ClassProvider, ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\n/**\n * Information about how a type or `InjectionToken` interfaces with the DI system.\n *\n * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly\n * requesting injection of other types if necessary.\n *\n * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular\n * `InjectorDef`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates\n * that the injectable does not belong to any scope.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectableDef<T> {\n /**\n * Specifies that the given type belongs to a particular injector:\n * - `InjectorType` such as `NgModule`,\n * - `'root'` the root injector\n * - `'any'` all injectors.\n * - `null`, does not belong to any injector. Must be explicitly listed in the injector\n * `providers`.\n */\n providedIn: InjectorType<any>|'root'|'any'|null;\n\n /**\n * Factory method to execute to create an instance of the injectable.\n */\n factory: () => T;\n\n /**\n * In a case of no explicit injector, a location where the instance of the injectable is stored.\n */\n value: T|undefined;\n}\n\n/**\n * Information about the providers to be included in an `Injector` as well as how the given type\n * which carries the information should be created by the DI system.\n *\n * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested\n * structure of providers with a defined priority (identically to how `NgModule`s also have\n * an import/dependency structure).\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorDef<T> {\n factory: () => T;\n\n // TODO(alxhub): Narrow down the type here once decorators properly change the return type of the\n // class they are decorating (to add the ngInjectableDef property for example).\n providers: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n\n imports: (InjectorType<any>|InjectorTypeWithProviders<any>)[];\n}\n\n/**\n * A `Type` which has an `InjectableDef` static field.\n *\n * `InjectableDefType`s contain their own Dependency Injection metadata and are usable in an\n * `InjectorDef`-based `StaticInjector.\n *\n * @publicApi\n */\nexport interface InjectableType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectableDef: never;\n}\n\n/**\n * A type which has an `InjectorDef` static field.\n *\n * `InjectorDefTypes` can be used to configure a `StaticInjector`.\n *\n * @publicApi\n */\nexport interface InjectorType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectorDef: never;\n}\n\n/**\n * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorDefType` with an\n * associated array of providers.\n *\n * Objects of this type can be listed in the imports section of an `InjectorDef`.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorTypeWithProviders<T> {\n ngModule: InjectorType<T>;\n providers?: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n}\n\n\n/**\n * Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and\n * in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ngInjectableDef` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call `inject` to access the `Injector` and request injection of dependencies.\n *\n * @publicApi\n */\nexport function defineInjectable<T>(opts: {\n providedIn?: Type<any>| 'root' | 'any' | null,\n factory: () => T,\n}): never {\n return ({\n providedIn: opts.providedIn as any || null, factory: opts.factory, value: undefined,\n } as InjectableDef<T>) as never;\n}\n\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static `ngInjectorDef` field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to\n * create the type must be provided. If that factory function needs to inject arguments, it can\n * use the `inject` function.\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has an `ngInjectableDef` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @publicApi\n */\nexport function defineInjector(options: {factory: () => any, providers?: any[], imports?: any[]}):\n never {\n return ({\n factory: options.factory, providers: options.providers || [], imports: options.imports || [],\n } as InjectorDef<any>) as never;\n}\n\n/**\n * Read the `ngInjectableDef` type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have `ngInjectableDef`\n */\nexport function getInjectableDef<T>(type: any): InjectableDef<T>|null {\n return type && type.hasOwnProperty(NG_INJECTABLE_DEF) ? (type as any)[NG_INJECTABLE_DEF] : null;\n}\n\n/**\n * Read the `ngInjectorDef` type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have `ngInjectorDef`\n */\nexport function getInjectorDef<T>(type: any): InjectorDef<T>|null {\n return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? (type as any)[NG_INJECTOR_DEF] : null;\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\nimport {defineInjectable} from './defs';\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides additional level of type safety.\n *\n * ```\n * interface MyInterface {...}\n * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n * // myInterface is inferred to be MyInterface.\n * ```\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the `inject` function. See below for an example.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As\n * mentioned above, `'root'` is the default value for `providedIn`.\n *\n * @usageNotes\n * ### Basic Example\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n *\n * @publicApi\n */\nexport class InjectionToken<T> {\n /** @internal */\n readonly ngMetadataName = 'InjectionToken';\n\n readonly ngInjectableDef: never|undefined;\n\n constructor(protected _desc: string, options?: {\n providedIn?: Type<any>| 'root' | null,\n factory: () => T\n }) {\n if (options !== undefined) {\n this.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn || 'root',\n factory: options.factory,\n });\n } else {\n this.ngInjectableDef = undefined;\n }\n }\n\n toString(): string { return `InjectionToken ${this._desc}`; }\n}\n\nexport interface InjectableDefToken<T> extends InjectionToken<T> { ngInjectableDef: never; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\n/**\n * An interface implemented by all Angular type decorators, which allows them to be used as ES7\n * decorators as well as\n * Angular DSL syntax.\n *\n * ES7 syntax:\n *\n * ```\n * @ng.Component({...})\n * class MyClass {...}\n * ```\n *\n * @publicApi\n */\nexport interface TypeDecorator {\n /**\n * Invoke as ES7 decorator.\n */\n <T extends Type<any>>(type: T): T;\n\n // Make TypeDecorator assignable to built-in ParameterDecorator type.\n // ParameterDecorator is declared in lib.d.ts as a `declare type`\n // so we cannot declare this interface as a subtype.\n // see https://github.com/angular/angular/issues/3379#issuecomment-126169417\n (target: Object, propertyKey?: string|symbol, parameterIndex?: number): void;\n}\n\nexport const ANNOTATIONS = '__annotations__';\nexport const PARAMETERS = '__parameters__';\nexport const PROP_METADATA = '__prop__metadata__';\n\n/**\n * @suppress {globalThis}\n */\nexport function makeDecorator<T>(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (type: Type<T>) => void,\n typeFn?: (type: Type<T>, ...args: any[]) => void):\n {new (...args: any[]): any; (...args: any[]): any; (...args: any[]): (cls: any) => any;} {\n const metaCtor = makeMetadataCtor(props);\n\n function DecoratorFactory(...args: any[]): (cls: Type<T>) => any {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n\n const annotationInstance = new (DecoratorFactory as any)(...args);\n return function TypeDecorator(cls: Type<T>) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ?\n (cls as any)[ANNOTATIONS] :\n Object.defineProperty(cls, ANNOTATIONS, {value: []})[ANNOTATIONS];\n annotations.push(annotationInstance);\n\n\n if (additionalProcessing) additionalProcessing(cls);\n\n return cls;\n };\n }\n\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n DecoratorFactory.prototype.ngMetadataName = name;\n (DecoratorFactory as any).annotationCls = DecoratorFactory;\n return DecoratorFactory as any;\n}\n\nfunction makeMetadataCtor(props?: (...args: any[]) => any): any {\n return function ctor(...args: any[]) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\n\nexport function makeParamDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any): any {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args: any[]): any {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new (<any>ParamDecoratorFactory)(...args);\n\n (<any>ParamDecorator).annotation = annotationInstance;\n return ParamDecorator;\n\n function ParamDecorator(cls: any, unusedKey: any, index: number): any {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ?\n (cls as any)[PARAMETERS] :\n Object.defineProperty(cls, PARAMETERS, {value: []})[PARAMETERS];\n\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n (<any>ParamDecoratorFactory).annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n}\n\nexport function makePropDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (target: any, name: string, ...args: any[]) => void): any {\n const metaCtor = makeMetadataCtor(props);\n\n function PropDecoratorFactory(...args: any[]): any {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n\n const decoratorInstance = new (<any>PropDecoratorFactory)(...args);\n\n function PropDecorator(target: any, name: string) {\n const constructor = target.constructor;\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ?\n (constructor as any)[PROP_METADATA] :\n Object.defineProperty(constructor, PROP_METADATA, {value: {}})[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n\n return PropDecorator;\n }\n\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n PropDecoratorFactory.prototype.ngMetadataName = name;\n (<any>PropDecoratorFactory).annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {Type} from '../type';\nimport {makeParamDecorator, makePropDecorator} from '../util/decorators';\n\n/**\n * A DI token that you can use to create a virtual [provider](guide/glossary#provider)\n * that will populate the `entryComponents` field of components and NgModules\n * based on its `useValue` property value.\n * All components that are referenced in the `useValue` value (either directly\n * or in a nested array or map) are added to the `entryComponents` property.\n *\n * @usageNotes\n *\n * The following example shows how the router can populate the `entryComponents`\n * field of an NgModule based on a router configuration that refers\n * to components.\n *\n * ```typescript\n * // helper function inside the router\n * function provideRoutes(routes) {\n * return [\n * {provide: ROUTES, useValue: routes},\n * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n * ];\n * }\n *\n * // user code\n * let routes = [\n * {path: '/root', component: RootComp},\n * {path: '/teams', component: TeamsComp}\n * ];\n *\n * @NgModule({\n * providers: [provideRoutes(routes)]\n * })\n * class ModuleWithRoutes {}\n * ```\n *\n * @publicApi\n */\nexport const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken<any>('AnalyzeForEntryComponents');\n\n/**\n * Type of the `Attribute` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface AttributeDecorator {\n /**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * @usageNotes\n * ### Example\n *\n * Suppose we have an `<input>` element and want to know its `type`.\n *\n * ```html\n * <input type=\"text\">\n * ```\n *\n * A decorator can inject string literal `text` as in the following example.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * @publicApi\n */\n (name: string): any;\n new (name: string): Attribute;\n}\n\n\n/**\n * Type of the Attribute metadata.\n *\n * @publicApi\n */\nexport interface Attribute {\n /**\n * The name of the attribute to be injected into the constructor.\n */\n attributeName?: string;\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Attribute: AttributeDecorator =\n makeParamDecorator('Attribute', (attributeName?: string) => ({attributeName}));\n\n/**\n * Type of the Query metadata.\n *\n * @publicApi\n */\nexport interface Query {\n descendants: boolean;\n first: boolean;\n read: any;\n isViewQuery: boolean;\n selector: any;\n}\n\n/**\n * Base class for query metadata.\n *\n * @see `ContentChildren`.\n * @see `ContentChild`.\n * @see `ViewChildren`.\n * @see `ViewChild`.\n *\n * @publicApi\n */\nexport abstract class Query {}\n\n/**\n * Type of the ContentChildren decorator / constructor function.\n *\n * @see `ContentChildren`.\n * @publicApi\n */\nexport interface ContentChildrenDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChildren to get the `QueryList` of elements or directives from the\n * content DOM. Any time a child element is added, removed, or moved, the query list will be\n * updated, and the changes observable of the query list will emit a new value.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **descendants** - include only direct children or all descendants.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n * ### Basic Example\n *\n * Here is a simple demonstration of how the `ContentChildren` decorator can be used.\n *\n * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}\n *\n * ### Tab-pane Example\n *\n * Here is a slightly more realistic example that shows how `ContentChildren` decorators\n * can be used to implement a tab pane component.\n *\n * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): Query;\n}\n\n/**\n * Type of the ContentChildren metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport type ContentChildren = Query;\n\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport const ContentChildren: ContentChildrenDecorator = makePropDecorator(\n 'ContentChildren',\n (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: false, descendants: false, ...data}),\n Query);\n\n/**\n * Type of the ContentChild decorator / constructor function.\n *\n * @publicApi\n */\nexport interface ContentChildDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChild to get the first element or the directive matching the selector from\n * the content DOM. If the content DOM changes, and a new child matches the selector,\n * the property will be updated.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried element.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ContentChild;\n}\n\n/**\n * Type of the ContentChild metadata.\n *\n * @publicApi\n */\nexport type ContentChild = Query;\n\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nexport const ContentChild: ContentChildDecorator = makePropDecorator(\n 'ContentChild', (selector?: any, data: any = {}) =>\n ({selector, first: true, isViewQuery: false, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChildren decorator / constructor function.\n *\n * @see `ViewChildren`.\n *\n * @publicApi\n */\nexport interface ViewChildrenDecorator {\n /**\n * Configures a view query.\n *\n * You can use ViewChildren to get the `QueryList` of elements or directives from the\n * view DOM. Any time a child element is added, removed, or moved, the query list will be updated,\n * and the changes observable of the query list will emit a new value.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChildren;\n}\n\n/**\n * Type of the ViewChildren metadata.\n *\n * @publicApi\n */\nexport type ViewChildren = Query;\n\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChildren: ViewChildrenDecorator = makePropDecorator(\n 'ViewChildren', (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: true, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChild decorator / constructor function.\n *\n * @see `ViewChild`.\n * @publicApi\n */\nexport interface ViewChildDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n * The change detector looks for the first element or the directive matching the selector\n * in the view DOM. If the view DOM changes, and a new child matches the selector,\n * the property is updated.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * Supported selectors include:\n * * any class with the `@Component` or `@Directive` decorator\n * * a template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ViewChild('cmp')`)\n * * any provider defined in the child component tree of the current component (e.g.\n * `@ViewChild(SomeService) someService: SomeService`)\n * * any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:\n * any`)\n * * a `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)\n * template;`)\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChild;\n}\n\n/**\n * Type of the ViewChild metadata.\n *\n * @publicApi\n */\nexport type ViewChild = Query;\n\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChild: ViewChildDecorator = makePropDecorator(\n 'ViewChild', (selector: any, data: any) =>\n ({selector, first: true, isViewQuery: true, descendants: true, ...data}),\n Query);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @publicApi\n */\nexport enum ChangeDetectionStrategy {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n */\n OnPush = 0,\n\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n Default = 1,\n}\n\n/**\n * Defines the possible states of the default change detector.\n * @see `ChangeDetectorRef`\n */\nexport enum ChangeDetectorStatus {\n /**\n * A state in which, after calling `detectChanges()`, the change detector\n * state becomes `Checked`, and must be explicitly invoked or reactivated.\n */\n CheckOnce,\n\n /**\n * A state in which change detection is skipped until the change detector mode\n * becomes `CheckOnce`.\n */\n Checked,\n\n /**\n * A state in which change detection continues automatically until explicitly\n * deactivated.\n */\n CheckAlways,\n\n /**\n * A state in which a change detector sub tree is not a part of the main tree and\n * should be skipped.\n */\n Detached,\n\n /**\n * Indicates that the change detector encountered an error checking a binding\n * or calling a directive lifecycle method and is now in an inconsistent state. Change\n * detectors in this state do not detect changes.\n */\n Errored,\n\n /**\n * Indicates that the change detector has been destroyed.\n */\n Destroyed,\n}\n\n/**\n * Reports whether a given strategy is currently the default for change detection.\n * @param changeDetectionStrategy The strategy to check.\n * @returns True if the given strategy is the current default, false otherwise.\n * @see `ChangeDetectorStatus`\n * @see `ChangeDetectorRef`\n */\nexport function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):\n boolean {\n return changeDetectionStrategy == null ||\n changeDetectionStrategy === ChangeDetectionStrategy.Default;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492\ndeclare var WorkerGlobalScope: any /** TODO #9100 */;\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\ndeclare var global: any /** TODO #9100 */;\nconst __window = typeof window !== 'undefined' && window;\nconst __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nconst __global = typeof global !== 'undefined' && global;\n\n// Check __global first, because in Node tests both __global and __window may be defined and _global\n// should be __global in that case.\nconst _global: {[name: string]: any} = __global || __window || __self;\n\nconst promise: Promise<any> = Promise.resolve(0);\n/**\n * Attention: whenever providing a new value, be sure to add an\n * entry into the corresponding `....externs.js` file,\n * so that closure won't use that global for its purposes.\n */\nexport {_global as global};\n\n// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim\ndeclare const Symbol: any;\nlet _symbolIterator: any = null;\nexport function getSymbolIterator(): string|symbol {\n if (!_symbolIterator) {\n const Symbol = _global['Symbol'];\n if (Symbol && Symbol.iterator) {\n _symbolIterator = Symbol.iterator;\n } else {\n // es6-shim specific logic\n const keys = Object.getOwnPropertyNames(Map.prototype);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (key !== 'entries' && key !== 'size' &&\n (Map as any).prototype[key] === Map.prototype['entries']) {\n _symbolIterator = key;\n }\n }\n }\n }\n return _symbolIterator;\n}\n\nexport function scheduleMicroTask(fn: Function) {\n if (typeof Zone === 'undefined') {\n // use promise to schedule microTask instead of use Zone\n promise.then(() => { fn && fn.apply(null, null); });\n } else {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n }\n}\n\n// JS has NaN !== NaN\nexport function looseIdentical(a: any, b: any): boolean {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}\n\nexport function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (token instanceof Array) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n\n if (token == null) {\n return '' + token;\n }\n\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n\n if (token.name) {\n return `${token.name}`;\n }\n\n const res = token.toString();\n\n if (res == null) {\n return '' + res;\n }\n\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nexport function noSideEffects(fn: () => void): string {\n return '' + {toString: fn};\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {getClosureSafeProperty} from '../util/property';\n\n\n\n/**\n * An interface that a function passed into {@link forwardRef} has to implement.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}\n * @publicApi\n */\nexport interface ForwardRefFn { (): any; }\n\nconst __forward_ref__ = getClosureSafeProperty({__forward_ref__: getClosureSafeProperty});\n\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * @usageNotes\n * ### Example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n * @publicApi\n */\nexport function forwardRef(forwardRefFn: ForwardRefFn): Type<any> {\n (<any>forwardRefFn).__forward_ref__ = forwardRef;\n (<any>forwardRefFn).toString = function() { return stringify(this()); };\n return (<Type<any>><any>forwardRefFn);\n}\n\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see `forwardRef`\n * @publicApi\n */\nexport function resolveForwardRef<T>(type: T): T {\n const fn: any = type;\n if (typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) &&\n fn.__forward_ref__ === forwardRef) {\n return fn();\n } else {\n return type;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component} from './directives';\n\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponnent{\n * }\n *\n * // Calling `renderComponent` will fail because `MyComponent`'s `@Compenent.templateUrl`\n * // needs to be resolved because `renderComponent` is synchronous process.\n * // renderComponent(MyComponent);\n *\n * // Calling `resolveComponentResources` will resolve `@Compenent.templateUrl` into\n * // `@Compenent.template`, which would allow `renderComponent` to proceed in synchronous manner.\n * // Use browser's `fetch` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible to returning a `Promise` of the resolved\n * URL. Browser's `fetch` method is a good default implementation.\n */\nexport function resolveComponentResources(\n resourceResolver: (url: string) => (Promise<string|{text(): Promise<string>}>)): Promise<null> {\n // Store all promises which are fetching the resources.\n const urlFetches: Promise<string>[] = [];\n\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map<string, Promise<string>>();\n function cachedResourceResolve(url: string): Promise<string> {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n urlFetches.push(promise);\n }\n return promise;\n }\n\n componentResourceResolutionQueue.forEach((component: Component) => {\n if (component.templateUrl) {\n cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n component.templateUrl = undefined;\n });\n }\n const styleUrls = component.styleUrls;\n const styles = component.styles || (component.styles = []);\n const styleOffset = component.styles.length;\n styleUrls && styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n });\n });\n });\n componentResourceResolutionQueue.clear();\n return Promise.all(urlFetches).then(() => null);\n}\n\nconst componentResourceResolutionQueue: Set<Component> = new Set();\n\nexport function maybeQueueResolutionOfComponentResources(metadata: Component) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.add(metadata);\n }\n}\n\nexport function componentNeedsResolution(component: Component) {\n return component.templateUrl || component.styleUrls && component.styleUrls.length;\n}\nexport function clearResolutionOfComponentResourcesQueue() {\n componentResourceResolutionQueue.clear();\n}\n\nfunction unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {\n return typeof response == 'string' ? response : response.text();\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nexport enum ViewEncapsulation {\n /**\n * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host\n * Element and pre-processing the style rules provided via {@link Component#styles styles} or\n * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all\n * selectors.\n *\n * This is the default option.\n */\n Emulated = 0,\n /**\n * @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead.\n * Use the native encapsulation mechanism of the renderer.\n *\n * For the DOM this means using the deprecated [Shadow DOM\n * v0](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n Native = 1,\n /**\n * Don't provide any template or style encapsulation.\n */\n None = 2,\n\n /**\n * Use Shadow DOM to encapsulate styles.\n *\n * For the DOM this means using modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n ShadowDom = 3\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\ndeclare global {\n const ngDevMode: null|NgDevModePerfCounters;\n interface NgDevModePerfCounters {\n firstTemplatePass: number;\n tNode: number;\n tView: number;\n rendererCreateTextNode: number;\n rendererSetText: number;\n rendererCreateElement: number;\n rendererAddEventListener: number;\n rendererSetAttribute: number;\n rendererRemoveAttribute: number;\n rendererSetProperty: number;\n rendererSetClassName: number;\n rendererAddClass: number;\n rendererRemoveClass: number;\n rendererSetStyle: number;\n rendererRemoveStyle: number;\n rendererDestroy: number;\n rendererDestroyNode: number;\n rendererMoveNode: number;\n rendererRemoveNode: number;\n rendererCreateComment: number;\n }\n}\n\ndeclare let global: any;\n\nexport function ngDevModeResetPerfCounters(): NgDevModePerfCounters {\n const newCounters: NgDevModePerfCounters = {\n firstTemplatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererCreateComment: 0,\n };\n // NOTE: Under Ivy we may have both window & global defined in the Node\n // environment since ensureDocument() in render3.ts sets global.window.\n if (typeof window != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (window as any)['ngDevMode'] = newCounters;\n }\n if (typeof global != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (global as any)['ngDevMode'] = newCounters;\n }\n if (typeof self != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (self as any)['ngDevMode'] = newCounters;\n }\n return newCounters;\n}\n\n/**\n * This checks to see if the `ngDevMode` has been set. If yes,\n * than we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n */\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngDevModeResetPerfCounters();\n}\n","/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n*/\nimport './ng_dev_mode';\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\n\nexport const EMPTY_OBJ: {} = {};\nexport const EMPTY_ARRAY: any[] = [];\n\n// freezing the values prevents any code from accidentally inserting new values in\nif (typeof ngDevMode !== 'undefined' && ngDevMode) {\n Object.freeze(EMPTY_OBJ);\n Object.freeze(EMPTY_ARRAY);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {NgModuleDef} from '../metadata/ng_module';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {Mutable, Type} from '../type';\nimport {noSideEffects, stringify} from '../util';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from './empty';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from './fields';\nimport {BaseDef, ComponentDef, ComponentDefFeature, ComponentQuery, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory} from './interfaces/definition';\nimport {CssSelectorList} from './interfaces/projection';\n\nlet _renderCompCount = 0;\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngComponentDef = defineComponent({\n * ...\n * });\n * }\n * ```\n */\nexport function defineComponent<T>(componentDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this component. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: (t: Type<T>| null) => T;\n\n /**\n * The number of nodes, local refs, and pipes in this component template.\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the binding start index.\n */\n // TODO(kara): remove queries from this count\n consts: number;\n\n /**\n * The number of bindings in this component template (including pure fn bindings).\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n vars: number;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['public', 'declared']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ((dirIndex: number) => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n\n /**\n * Template function use for rendering DOM.\n *\n * This function has following structure.\n *\n * ```\n * function Template<T>(ctx:T, creationMode: boolean) {\n * if (creationMode) {\n * // Contains creation mode instructions.\n * }\n * // Contains binding update instructions\n * }\n * ```\n *\n * Common instructions are:\n * Creation mode instructions:\n * - `elementStart`, `elementEnd`\n * - `text`\n * - `container`\n * - `listener`\n *\n * Binding update instructions:\n * - `bind`\n * - `elementAttribute`\n * - `elementProperty`\n * - `elementClass`\n * - `elementStyle`\n *\n */\n template: ComponentTemplate<T>;\n\n /**\n * Additional set of instructions specific to view query processing. This could be seen as a\n * set of instruction to be inserted into the template function.\n *\n * Query-related instructions need to be pulled out to a specific function as a timing of\n * execution is different as compared to all other instructions (after change detection hooks but\n * before view hooks).\n */\n viewQuery?: ComponentQuery<T>| null;\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}\n */\n features?: ComponentDefFeature[];\n\n /**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n *\n * see: animation\n */\n data?: {[kind: string]: any};\n\n /**\n * A set of styles that the component needs to be present for component to render correctly.\n */\n styles?: string[];\n\n /**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Registry of directives and components that may be found in this component's view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directives?: DirectiveTypesOrFactory | null;\n\n /**\n * Registry of pipes that may be found in this component's view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipes?: PipeTypesOrFactory | null;\n}): never {\n const type = componentDefinition.type;\n const typePrototype = type.prototype;\n const declaredInputs: {[key: string]: string} = {} as any;\n const def: Mutable<ComponentDef<any>, keyof ComponentDef<any>> = {\n type: type,\n providersResolver: null,\n consts: componentDefinition.consts,\n vars: componentDefinition.vars,\n factory: componentDefinition.factory,\n template: componentDefinition.template || null !,\n hostBindings: componentDefinition.hostBindings || null,\n contentQueries: componentDefinition.contentQueries || null,\n contentQueriesRefresh: componentDefinition.contentQueriesRefresh || null,\n attributes: componentDefinition.attributes || null,\n declaredInputs: declaredInputs,\n inputs: null !, // assigned in noSideEffects\n outputs: null !, // assigned in noSideEffects\n exportAs: componentDefinition.exportAs || null,\n onInit: typePrototype.ngOnInit || null,\n doCheck: typePrototype.ngDoCheck || null,\n afterContentInit: typePrototype.ngAfterContentInit || null,\n afterContentChecked: typePrototype.ngAfterContentChecked || null,\n afterViewInit: typePrototype.ngAfterViewInit || null,\n afterViewChecked: typePrototype.ngAfterViewChecked || null,\n onDestroy: typePrototype.ngOnDestroy || null,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null !, // assigned in noSideEffects\n pipeDefs: null !, // assigned in noSideEffects\n selectors: componentDefinition.selectors,\n viewQuery: componentDefinition.viewQuery || null,\n features: componentDefinition.features || null,\n data: componentDefinition.data || {},\n // TODO(misko): convert ViewEncapsulation into const enum so that it can be used directly in the\n // next line. Also `None` should be 0 not 2.\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,\n id: 'c',\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null as never,\n };\n def._ = noSideEffects(() => {\n const directiveTypes = componentDefinition.directives !;\n const feature = componentDefinition.features;\n const pipeTypes = componentDefinition.pipes !;\n def.id += _renderCompCount++;\n def.inputs = invertObject(componentDefinition.inputs, declaredInputs),\n def.outputs = invertObject(componentDefinition.outputs),\n feature && feature.forEach((fn) => fn(def));\n def.directiveDefs = directiveTypes ?\n () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)\n .map(extractDirectiveDef) :\n null;\n def.pipeDefs = pipeTypes ?\n () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) :\n null;\n }) as never;\n return def as never;\n}\n\nexport function extractDirectiveDef(type: DirectiveType<any>& ComponentType<any>):\n DirectiveDef<any>|ComponentDef<any> {\n const def = getComponentDef(type) || getDirectiveDef(type);\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`);\n }\n return def !;\n}\n\nexport function extractPipeDef(type: PipeType<any>): PipeDef<any> {\n const def = getPipeDef(type);\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is not a 'PipeType'.`);\n }\n return def !;\n}\n\nexport function defineNgModule<T>(def: {type: T} & Partial<NgModuleDef<T>>): never {\n const res: NgModuleDef<T> = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n };\n return res as never;\n}\n\n/**\n * Inverts an inputs or outputs lookup such that the keys, which were the\n * minified keys, are part of the values, and the values are parsed so that\n * the publicName of the property is the new key\n *\n * e.g. for\n *\n * ```\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName2')\n * declaredPropName2: number;\n * }\n * ```\n *\n * will be serialized as\n *\n * ```\n * {\n * propName1: 'propName1',\n * declaredPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * which is than translated by the minifier as:\n *\n * ```\n * {\n * minifiedPropName1: 'propName1',\n * minifiedPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * becomes: (public name => minifiedName)\n *\n * ```\n * {\n * 'propName1': 'minifiedPropName1',\n * 'publicName2': 'minifiedPropName2',\n * }\n * ```\n *\n * Optionally the function can take `secondary` which will result in: (public name => declared name)\n *\n * ```\n * {\n * 'propName1': 'propName1',\n * 'publicName2': 'declaredPropName2',\n * }\n * ```\n *\n\n */\nfunction invertObject(obj: any, secondary?: any): any {\n if (obj == null) return EMPTY_OBJ;\n const newLookup: any = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n let publicName: string = obj[minifiedKey];\n let declaredName = publicName;\n if (Array.isArray(publicName)) {\n declaredName = publicName[1];\n publicName = publicName[0];\n }\n newLookup[publicName] = minifiedKey;\n if (secondary) {\n (secondary[publicName] = declaredName);\n }\n }\n }\n return newLookup;\n}\n\n/**\n * Create a base definition\n *\n * # Example\n * ```\n * class ShouldBeInherited {\n * static ngBaseDef = defineBase({\n * ...\n * })\n * }\n * @param baseDefinition The base definition parameters\n */\nexport function defineBase<T>(baseDefinition: {\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `outputs`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n}): BaseDef<T> {\n const declaredInputs: {[P in keyof T]: P} = {} as any;\n return {\n inputs: invertObject(baseDefinition.inputs, declaredInputs),\n declaredInputs: declaredInputs,\n outputs: invertObject(baseDefinition.outputs),\n };\n}\n\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngDirectiveDef = defineDirective({\n * ...\n * });\n * }\n * ```\n */\nexport const defineDirective = defineComponent as any as<T>(directiveDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this directive. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: (t: Type<T>| null) => T;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}\n */\n features?: DirectiveDefFeature[];\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ((directiveIndex: number) => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n}) => never;\n\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ngPipeDef = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n */\nexport function definePipe<T>(pipeDef: {\n /** Name of the pipe. Used for matching pipes in template to pipe defs. */\n name: string,\n\n /** Pipe class reference. Needed to extract pipe lifecycle hooks. */\n type: Type<T>,\n\n /** A factory for creating a pipe instance. */\n factory: (t: Type<T>| null) => T,\n\n /** Whether the pipe is pure. */\n pure?: boolean\n}): never {\n return (<PipeDef<T>>{\n name: pipeDef.name,\n factory: pipeDef.factory,\n pure: pipeDef.pure !== false,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n }) as never;\n}\n\n/**\n * The following getter methods retrieve the definition form the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\n\nexport function getComponentDef<T>(type: any): ComponentDef<T>|null {\n return (type as any)[NG_COMPONENT_DEF] || null;\n}\n\nexport function getDirectiveDef<T>(type: any): DirectiveDef<T>|null {\n return (type as any)[NG_DIRECTIVE_DEF] || null;\n}\n\nexport function getPipeDef<T>(type: any): PipeDef<T>|null {\n return (type as any)[NG_PIPE_DEF] || null;\n}\n\nexport function getNgModuleDef<T>(type: any, throwNotFound: true): NgModuleDef<T>;\nexport function getNgModuleDef<T>(type: any): NgModuleDef<T>|null;\nexport function getNgModuleDef<T>(type: any, throwNotFound?: boolean): NgModuleDef<T>|null {\n const ngModuleDef = (type as any)[NG_MODULE_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ngModuleDef' property.`);\n }\n return ngModuleDef;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getComponentDef, getNgModuleDef} from './definition';\nimport {TNode} from './interfaces/node';\nimport {LView} from './interfaces/view';\n\n// The functions in this file verify that the assumptions we are making\n// about state in an instruction are correct before implementing any logic.\n// They are meant only to be called in dev mode as sanity checks.\n\nexport function assertNumber(actual: any, msg: string) {\n if (typeof actual != 'number') {\n throwError(msg);\n }\n}\n\nexport function assertEqual<T>(actual: T, expected: T, msg: string) {\n if (actual != expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotEqual<T>(actual: T, expected: T, msg: string) {\n if (actual == expected) {\n throwError(msg);\n }\n}\n\nexport function assertSame<T>(actual: T, expected: T, msg: string) {\n if (actual !== expected) {\n throwError(msg);\n }\n}\n\nexport function assertLessThan<T>(actual: T, expected: T, msg: string) {\n if (actual >= expected) {\n throwError(msg);\n }\n}\n\nexport function assertGreaterThan<T>(actual: T, expected: T, msg: string) {\n if (actual <= expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotDefined<T>(actual: T, msg: string) {\n if (actual != null) {\n throwError(msg);\n }\n}\n\nexport function assertDefined<T>(actual: T, msg: string) {\n if (actual == null) {\n throwError(msg);\n }\n}\n\nexport function assertComponentType(\n actual: any,\n msg: string =\n 'Type passed in is not ComponentType, it does not have \\'ngComponentDef\\' property.') {\n if (!getComponentDef(actual)) {\n throwError(msg);\n }\n}\n\nexport function assertNgModuleType(\n actual: any,\n msg: string =\n 'Type passed in is not NgModuleType, it does not have \\'ngModuleDef\\' property.') {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\n\nfunction throwError(msg: string): never {\n // tslint:disable-next-line\n debugger; // Left intentionally for better debugger experience.\n throw new Error(`ASSERTION ERROR: ${msg}`);\n}\n\nexport function assertDomNode(node: any) {\n assertEqual(node instanceof Node, true, 'The provided value must be an instance of a DOM Node');\n}\n\n\nexport function assertPreviousIsParent(isParent: boolean) {\n assertEqual(isParent, true, 'previousOrParentTNode should be a parent');\n}\n\nexport function assertHasParent(tNode: TNode) {\n assertDefined(tNode.parent, 'previousOrParentTNode should have a parent');\n}\n\nexport function assertDataNext(lView: LView, index: number, arr?: any[]) {\n if (arr == null) arr = lView;\n assertEqual(\n arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);\n}\n\nexport function assertDataInRange(arr: any[], index: number) {\n assertLessThan(index, arr ? arr.length : 0, 'index expected to be a valid data index');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../../di/injection_token';\nimport {Injector} from '../../di/injector';\nimport {QueryList} from '../../linker';\nimport {Sanitizer} from '../../sanitization/security';\nimport {Type} from '../../type';\nimport {LContainer} from './container';\nimport {ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList} from './definition';\nimport {I18nUpdateOpCodes, TI18n} from './i18n';\nimport {TElementNode, TNode, TViewNode} from './node';\nimport {PlayerHandler} from './player';\nimport {LQueries} from './query';\nimport {RElement, Renderer3, RendererFactory3} from './renderer';\nimport {StylingContext} from './styling';\n\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nexport const TVIEW = 0;\nexport const FLAGS = 1;\nexport const PARENT = 2;\nexport const NEXT = 3;\nexport const QUERIES = 4;\nexport const HOST = 5;\nexport const HOST_NODE = 6; // Rename to `T_HOST`?\nexport const BINDING_INDEX = 7;\nexport const CLEANUP = 8;\nexport const CONTEXT = 9;\nexport const INJECTOR = 10;\nexport const RENDERER_FACTORY = 11;\nexport const RENDERER = 12;\nexport const SANITIZER = 13;\nexport const TAIL = 14;\nexport const CONTAINER_INDEX = 15;\nexport const CONTENT_QUERIES = 16;\nexport const DECLARATION_VIEW = 17;\n/** Size of LView's header. Necessary to adjust for it when setting slots. */\nexport const HEADER_OFFSET = 18;\n\n\n// This interface replaces the real LView interface if it is an arg or a\n// return value of a public instruction. This ensures we don't need to expose\n// the actual interface, which should be kept private.\nexport interface OpaqueViewState {\n '__brand__': 'Brand for OpaqueViewState that nothing will match';\n}\n\n\n/**\n * `LView` stores all of the information needed to process the instructions as\n * they are invoked from the template. Each embedded view and component view has its\n * own `LView`. When processing a particular view, we set the `viewData` to that\n * `LView`. When that view is done processing, the `viewData` is set back to\n * whatever the original `viewData` was before (the parent `LView`).\n *\n * Keeping separate state for each view facilities view insertion / deletion, so we\n * don't have to edit the data array based on which views are present.\n */\nexport interface LView extends Array<any> {\n /**\n * The static data for this view. We need a reference to this so we can easily walk up the\n * node tree in DI and get the TView.data array associated with a node (where the\n * directive defs are stored).\n */\n readonly[TVIEW]: TView;\n\n /** Flags for this view. See LViewFlags for more info. */\n [FLAGS]: LViewFlags;\n\n /**\n * The parent view is needed when we exit the view and must restore the previous\n * `LView`. Without this, the render method would have to keep a stack of\n * views as it is recursively rendering templates.\n *\n * This is the \"insertion\" view for embedded views. This allows us to properly\n * destroy embedded views.\n */\n [PARENT]: LView|null;\n\n /**\n *\n * The next sibling LView or LContainer.\n *\n * Allows us to propagate between sibling view states that aren't in the same\n * container. Embedded views already have a node.next, but it is only set for\n * views in the same container. We need a way to link component views and views\n * across containers as well.\n */\n [NEXT]: LView|LContainer|null;\n\n /** Queries active for this view - nodes from a view are reported to those queries. */\n [QUERIES]: LQueries|null;\n\n /**\n * The host node for this LView instance, if this is a component view.\n *\n * If this is an embedded view, HOST will be null.\n */\n [HOST]: RElement|StylingContext|null;\n\n /**\n * Pointer to the `TViewNode` or `TElementNode` which represents the root of the view.\n *\n * If `TViewNode`, this is an embedded view of a container. We need this to be able to\n * efficiently find the `LViewNode` when inserting the view into an anchor.\n *\n * If `TElementNode`, this is the LView of a component.\n *\n * If null, this is the root view of an application (root component is in this view).\n */\n [HOST_NODE]: TViewNode|TElementNode|null;\n\n /**\n * The binding index we should access next.\n *\n * This is stored so that bindings can continue where they left off\n * if a view is left midway through processing bindings (e.g. if there is\n * a setter that creates an embedded view, like in ngIf).\n */\n [BINDING_INDEX]: number;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This context array stores both listener functions wrapped with\n * their context and output subscription instances for a particular view.\n *\n * These change per LView instance, so they cannot be stored on TView. Instead,\n * TView.cleanup saves an index to the necessary context in this array.\n */\n // TODO: flatten into LView[]\n [CLEANUP]: any[]|null;\n\n /**\n * - For dynamic views, this is the context with which to render the template (e.g.\n * `NgForContext`), or `{}` if not defined explicitly.\n * - For root view of the root component the context contains change detection data.\n * - For non-root components, the context is the component instance,\n * - For inline views, the context is null.\n */\n [CONTEXT]: {}|RootContext|null;\n\n /** An optional Module Injector to be used as fall back after Element Injectors are consulted. */\n readonly[INJECTOR]: Injector|null;\n\n /** Renderer to be used for this view. */\n [RENDERER_FACTORY]: RendererFactory3;\n\n /** Renderer to be used for this view. */\n [RENDERER]: Renderer3;\n\n /** An optional custom sanitizer. */\n [SANITIZER]: Sanitizer|null;\n\n /**\n * The last LView or LContainer beneath this LView in the hierarchy.\n *\n * The tail allows us to quickly add a new state to the end of the view list\n * without having to propagate starting from the first child.\n */\n [TAIL]: LView|LContainer|null;\n\n /**\n * The index of the parent container's host node. Applicable only to embedded views that\n * have been inserted dynamically. Will be -1 for component views and inline views.\n *\n * This is necessary to jump from dynamically created embedded views to their parent\n * containers because their parent cannot be stored on the TViewNode (views may be inserted\n * in multiple containers, so the parent cannot be shared between view instances).\n */\n [CONTAINER_INDEX]: number;\n\n /**\n * Stores QueryLists associated with content queries of a directive. This data structure is\n * filled-in as part of a directive creation process and is later used to retrieve a QueryList to\n * be refreshed.\n */\n [CONTENT_QUERIES]: QueryList<any>[]|null;\n\n /**\n * View where this view's template was declared.\n *\n * Only applicable for dynamically created views. Will be null for inline/component views.\n *\n * The template for a dynamically created view may be declared in a different view than\n * it is inserted. We already track the \"insertion view\" (view where the template was\n * inserted) in LView[PARENT], but we also need access to the \"declaration view\"\n * (view where the template was declared). Otherwise, we wouldn't be able to call the\n * view's template function with the proper contexts. Context should be inherited from\n * the declaration view tree, not the insertion view tree.\n *\n * Example (AppComponent template):\n *\n * <ng-template #foo></ng-template> <-- declared here -->\n * <some-comp [tpl]=\"foo\"></some-comp> <-- inserted inside this component -->\n *\n * The <ng-template> above is declared in the AppComponent template, but it will be passed into\n * SomeComp and inserted there. In this case, the declaration view would be the AppComponent,\n * but the insertion view would be SomeComp. When we are removing views, we would want to\n * traverse through the insertion view to clean up listeners. When we are calling the\n * template function during change detection, we need the declaration view to get inherited\n * context.\n */\n [DECLARATION_VIEW]: LView|null;\n}\n\n/** Flags associated with an LView (saved in LView[FLAGS]) */\nexport const enum LViewFlags {\n /**\n * Whether or not the view is in creationMode.\n *\n * This must be stored in the view rather than using `data` as a marker so that\n * we can properly support embedded views. Otherwise, when exiting a child view\n * back into the parent view, `data` will be defined and `creationMode` will be\n * improperly reported as false.\n */\n CreationMode = 0b000000001,\n\n /**\n * Whether or not this LView instance is on its first processing pass.\n *\n * An LView instance is considered to be on its \"first pass\" until it\n * has completed one creation mode run and one update mode run. At this\n * time, the flag is turned off.\n */\n FirstLViewPass = 0b000000010,\n\n /** Whether this view has default change detection strategy (checks always) or onPush */\n CheckAlways = 0b000000100,\n\n /** Whether or not this view is currently dirty (needing check) */\n Dirty = 0b000001000,\n\n /** Whether or not this view is currently attached to change detection tree. */\n Attached = 0b000010000,\n\n /**\n * Whether or not the init hooks have run.\n *\n * If on, the init hooks haven't yet been run and should be executed by the first component that\n * runs OR the first cR() instruction that runs (so inits are run for the top level view before\n * any embedded views).\n */\n RunInit = 0b000100000,\n\n /** Whether or not this view is destroyed. */\n Destroyed = 0b001000000,\n\n /** Whether or not this view is the root view */\n IsRoot = 0b010000000,\n}\n\n/**\n * The static data for an LView (shared between all templates of a\n * given type).\n *\n * Stored on the template function as ngPrivateData.\n */\nexport interface TView {\n /**\n * ID for inline views to determine whether a view is the same as the previous view\n * in a certain position. If it's not, we know the new view needs to be inserted\n * and the one that exists needs to be removed (e.g. if/else statements)\n *\n * If this is -1, then this is a component view or a dynamically created view.\n */\n readonly id: number;\n\n /**\n * This is a blueprint used to generate LView instances for this TView. Copying this\n * blueprint is faster than creating a new LView from scratch.\n */\n blueprint: LView;\n\n /**\n * The template function used to refresh the view of dynamically created views\n * and components. Will be null for inline views.\n */\n template: ComponentTemplate<{}>|null;\n\n /**\n * A function containing query-related instructions.\n */\n viewQuery: ComponentQuery<{}>|null;\n\n /**\n * Pointer to the `TNode` that represents the root of the view.\n *\n * If this is a `TViewNode` for an `LViewNode`, this is an embedded view of a container.\n * We need this pointer to be able to efficiently find this node when inserting the view\n * into an anchor.\n *\n * If this is a `TElementNode`, this is the view of a root component. It has exactly one\n * root TNode.\n *\n * If this is null, this is the view of a component that is not at root. We do not store\n * the host TNodes for child component views because they can potentially have several\n * different host TNodes, depending on where the component is being used. These host\n * TNodes cannot be shared (due to different indices, etc).\n */\n node: TViewNode|TElementNode|null;\n\n /** Whether or not this template has been processed. */\n firstTemplatePass: boolean;\n\n /** Static data equivalent of LView.data[]. Contains TNodes, PipeDefInternal or TI18n. */\n data: TData;\n\n /**\n * The binding start index is the index at which the data array\n * starts to store bindings only. Saving this value ensures that we\n * will begin reading bindings at the correct point in the array when\n * we are in update mode.\n */\n bindingStartIndex: number;\n\n /**\n * The index where the \"expando\" section of `LView` begins. The expando\n * section contains injectors, directive instances, and host binding values.\n * Unlike the \"consts\" and \"vars\" sections of `LView`, the length of this\n * section cannot be calculated at compile-time because directives are matched\n * at runtime to preserve locality.\n *\n * We store this start index so we know where to start checking host bindings\n * in `setHostBindings`.\n */\n expandoStartIndex: number;\n\n /**\n * Index of the host node of the first LView or LContainer beneath this LView in\n * the hierarchy.\n *\n * Necessary to store this so views can traverse through their nested views\n * to remove listeners and call onDestroy callbacks.\n *\n * For embedded views, we store the index of an LContainer's host rather than the first\n * LView to avoid managing splicing when views are added/removed.\n */\n childIndex: number;\n\n /**\n * A reference to the first child node located in the view.\n */\n firstChild: TNode|null;\n\n /**\n * Set of instructions used to process host bindings efficiently.\n *\n * See VIEW_DATA.md for more information.\n */\n expandoInstructions: (number|HostBindingsFunction<any>|null)[]|null;\n\n /**\n * Full registry of directives and components that may be found in this view.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n directiveRegistry: DirectiveDefList|null;\n\n /**\n * Full registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n pipeRegistry: PipeDefList|null;\n\n /**\n * Array of ngOnInit and ngDoCheck hooks that should be executed for this view in\n * creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n initHooks: HookData|null;\n\n /**\n * Array of ngDoCheck hooks that should be executed for this view in update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n checkHooks: HookData|null;\n\n /**\n * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed\n * for this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentHooks: HookData|null;\n\n /**\n * Array of ngAfterContentChecked hooks that should be executed for this view in update\n * mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentCheckHooks: HookData|null;\n\n /**\n * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for\n * this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewHooks: HookData|null;\n\n /**\n * Array of ngAfterViewChecked hooks that should be executed for this view in\n * update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewCheckHooks: HookData|null;\n\n /**\n * Array of ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n destroyHooks: HookData|null;\n\n /**\n * Array of pipe ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Index of pipe in data\n * Odd indices: Hook function\n *\n * These must be stored separately from directive destroy hooks because their contexts\n * are stored in data.\n */\n pipeDestroyHooks: HookData|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This cleanup array stores both listener data (in chunks of 4)\n * and output data (in chunks of 2) for a particular view. Combining the arrays\n * saves on memory (70 bytes per array) and on a few bytes of code size (for two\n * separate for loops).\n *\n * If it's a native DOM listener or output subscription being stored:\n * 1st index is: event name `name = tView.cleanup[i+0]`\n * 2nd index is: index of native element `element = lView[tView.cleanup[i+1]]`\n * 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`\n * 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`\n * `typeof useCaptureOrIndx == 'boolean' : useCapture boolean\n * `typeof useCaptureOrIndx == 'number':\n * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`\n * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`\n *\n * If it's a renderer2 style listener or ViewRef destroy hook being stored:\n * 1st index is: index of the cleanup function in LView.cleanupInstances[]\n * 2nd index is: `null`\n * `lView[CLEANUP][tView.cleanup[i+0]]()`\n *\n * If it's an output subscription or query list destroy hook:\n * 1st index is: output unsubscribe function / query list destroy function\n * 2nd index is: index of function context in LView.cleanupInstances[]\n * `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`\n */\n cleanup: any[]|null;\n\n /**\n * A list of element indices for child components that will need to be\n * refreshed when the current view has finished its check. These indices have\n * already been adjusted for the HEADER_OFFSET.\n *\n */\n components: number[]|null;\n\n /**\n * A list of indices for child directives that have content queries.\n *\n * Even indices: Directive indices\n * Odd indices: Starting index of content queries (stored in CONTENT_QUERIES) for this directive\n */\n contentQueries: number[]|null;\n}\n\nexport const enum RootContextFlags {Empty = 0b00, DetectChanges = 0b01, FlushPlayers = 0b10}\n\n\n/**\n * RootContext contains information which is shared for all components which\n * were bootstrapped with {@link renderComponent}.\n */\nexport interface RootContext {\n /**\n * A function used for scheduling change detection in the future. Usually\n * this is `requestAnimationFrame`.\n */\n scheduler: (workFn: () => void) => void;\n\n /**\n * A promise which is resolved when all components are considered clean (not dirty).\n *\n * This promise is overwritten every time a first call to {@link markDirty} is invoked.\n */\n clean: Promise<null>;\n\n /**\n * RootComponents - The components that were instantiated by the call to\n * {@link renderComponent}.\n */\n components: {}[];\n\n /**\n * The player flushing handler to kick off all animations\n */\n playerHandler: PlayerHandler|null;\n\n /**\n * What render-related operations to run once a scheduler has been set\n */\n flags: RootContextFlags;\n}\n\n/**\n * Array of hooks that should be executed for a view and their directive indices.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\nexport type HookData = (number | (() => void))[];\n\n/**\n * Static data that corresponds to the instance-specific data array on an LView.\n *\n * Each node's static data is stored in tData at the same index that it's stored\n * in the data array. Any nodes that do not have static data store a null value in\n * tData to avoid a sparse array.\n *\n * Each pipe's definition is stored here at the same index as its pipe instance in\n * the data array.\n *\n * Injector bloom filters are also stored here.\n */\nexport type TData =\n (TNode | PipeDef<any>| DirectiveDef<any>| ComponentDef<any>| number | Type<any>|\n InjectionToken<any>| TI18n | I18nUpdateOpCodes | null)[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LQueries} from './query';\nimport {RComment, RElement} from './renderer';\nimport {StylingContext} from './styling';\nimport {HOST, LView, NEXT, PARENT, QUERIES} from './view';\n\n\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\nexport const ACTIVE_INDEX = 0;\nexport const VIEWS = 1;\n// PARENT, NEXT, QUERIES, and HOST are indices 2, 3, 4, and 5.\n// As we already have these constants in LView, we don't need to re-create them.\nexport const NATIVE = 6;\nexport const RENDER_PARENT = 7;\n// Because interfaces in TS/JS cannot be instanceof-checked this means that we\n// need to rely on predictable characteristics of data-structures to check if they\n// are what we expect for them to be. The `LContainer` interface code below has a\n// fixed length and the constant value below references that. Using the length value\n// below we can predictably gaurantee that we are dealing with an `LContainer` array.\n// This value MUST be kept up to date with the length of the `LContainer` array\n// interface below so that runtime type checking can work.\nexport const LCONTAINER_LENGTH = 8;\n\n/**\n * The state associated with a container.\n *\n * This is an array so that its structure is closer to LView. This helps\n * when traversing the view tree (which is a mix of containers and component\n * views), so we can jump to viewOrContainer[NEXT] in the same way regardless\n * of type.\n */\nexport interface LContainer extends Array<any> {\n /**\n * The next active index in the views array to read or write to. This helps us\n * keep track of where we are in the views array.\n * In the case the LContainer is created for a ViewContainerRef,\n * it is set to null to identify this scenario, as indices are \"absolute\" in that case,\n * i.e. provided directly by the user of the ViewContainerRef API.\n */\n [ACTIVE_INDEX]: number;\n\n /**\n * A list of the container's currently active child views. Views will be inserted\n * here as they are added and spliced from here when they are removed. We need\n * to keep a record of current views so we know which views are already in the DOM\n * (and don't need to be re-added) and so we can remove views from the DOM when they\n * are no longer required.\n */\n [VIEWS]: LView[];\n\n /**\n * Access to the parent view is necessary so we can propagate back\n * up from inside a container to parent[NEXT].\n */\n [PARENT]: LView|null;\n\n /**\n * This allows us to jump from a container to a sibling container or component\n * view with the same parent, so we can remove listeners efficiently.\n */\n [NEXT]: LView|LContainer|null;\n\n /**\n * Queries active for this container - all the views inserted to / removed from\n * this container are reported to queries referenced here.\n */\n [QUERIES]: LQueries|null;\n\n /**\n * The host element of this LContainer.\n *\n * The host could be an LView if this container is on a component node.\n * In that case, the component LView is its HOST.\n *\n * It could also be a styling context if this is a node with a style/class\n * binding.\n */\n [HOST]: RElement|RComment|StylingContext|LView;\n\n /** The comment element that serves as an anchor for this LContainer. */\n [NATIVE]: RComment;\n\n /**\n * Parent Element which will contain the location where all of the views will be\n * inserted into to.\n *\n * If `renderParent` is `null` it is headless. This means that it is contained\n * in another view which in turn is contained in another container and\n * therefore it does not yet have its own parent.\n *\n * If `renderParent` is not `null` then it may be:\n * - same as `tContainerNode.parent` in which case it is just a normal container.\n * - different from `tContainerNode.parent` in which case it has been re-projected.\n * In other words `tContainerNode.parent` is logical parent where as\n * `tContainerNode.projectedParent` is render parent.\n *\n * When views are inserted into `LContainer` then `renderParent` is:\n * - `null`, we are in a view, keep going up a hierarchy until actual\n * `renderParent` is found.\n * - not `null`, then use the `projectedParent.native` as the `RElement` to insert\n * views into.\n */\n [RENDER_PARENT]: RElement|null;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {RElement} from './renderer';\nimport {LView} from './view';\n\n/**\n * This property will be monkey-patched on elements, components and directives\n */\nexport const MONKEY_PATCH_KEY_NAME = '__ngContext__';\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nexport interface LContext {\n /**\n * The component's parent view data.\n */\n lView: LView;\n\n /**\n * The index instance of the node.\n */\n nodeIndex: number;\n\n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native: RElement;\n\n /**\n * The instance of the Component node.\n */\n component: {}|null|undefined;\n\n /**\n * The list of active directives that exist on this element.\n */\n directives: any[]|null|undefined;\n\n /**\n * The map of local references (local reference name => element or directive instance) that exist\n * on this element.\n */\n localRefs: {[key: string]: any}|null|undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../../di/injection_token';\nimport {InjectFlags} from '../../di/injector_compatibility';\nimport {Type} from '../../type';\nimport {TElementNode} from './node';\nimport {LView, TData} from './view';\n\nexport const TNODE = 8;\nexport const PARENT_INJECTOR = 8;\nexport const INJECTOR_BLOOM_PARENT_SIZE = 9;\n\n/**\n * Represents a relative location of parent injector.\n *\n * The interfaces encodes number of parents `LView`s to traverse and index in the `LView`\n * pointing to the parent injector.\n */\nexport interface RelativeInjectorLocation { __brand__: 'RelativeInjectorLocationFlags'; }\n\nexport const enum RelativeInjectorLocationFlags {\n InjectorIndexMask = 0b111111111111111,\n ViewOffsetShift = 16,\n NO_PARENT = -1,\n}\n\nexport const NO_PARENT_INJECTOR: RelativeInjectorLocation = -1 as any;\n\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n\n/**\n* Factory for creating instances of injectors in the NodeInjector.\n*\n* This factory is complicated by the fact that it can resolve `multi` factories as well.\n*\n* NOTE: Some of the fields are optional which means that this class has two hidden classes.\n* - One without `multi` support (most common)\n* - One with `multi` values, (rare).\n*\n* Since VMs can cache up to 4 inline hidden classes this is OK.\n*\n* - Single factory: Only `resolving` and `factory` is defined.\n* - `providers` factory: `componentProviders` is a number and `index = -1`.\n* - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n*/\nexport class NodeInjectorFactory {\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T);\n\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders: boolean;\n\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi?: Array<() => any>;\n\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```\n * component:\n * provides: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProvides: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * provides: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders?: number;\n\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index?: number;\n\n /**\n * Because the same `multi` provider can be declared in `provides` and `viewProvides` it is\n * possible for `viewProvides` to shadow the `provides`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```\n * provides: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProvides: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProvides`\n * `Factory` has a pointer to the shadowed `provides` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory?: NodeInjectorFactory|null;\n\n\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n public factory:\n (this: NodeInjectorFactory, _: null,\n /**\n * array where injectables tokens are stored. This is used in\n * case of an error reporting to produce friendlier errors.\n */\n tData: TData,\n /**\n * array where existing instances of injectables are stored. This is used in case\n * of multi shadow is needed. See `multi` field documentation.\n */\n lView: LView,\n /**\n * The TNode of the same element injector.\n */\n tNode: TElementNode) => any,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider: boolean,\n injectImplementation: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T)) {\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\nconst FactoryPrototype = NodeInjectorFactory.prototype;\nexport function isFactory(obj: any): obj is NodeInjectorFactory {\n // See: https://jsperf.com/instanceof-vs-getprototypeof\n return obj != null && typeof obj == 'object' && Object.getPrototypeOf(obj) == FactoryPrototype;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {global} from '../util';\n\nimport {assertDataInRange, assertDefined, assertGreaterThan, assertLessThan} from './assert';\nimport {ACTIVE_INDEX, LCONTAINER_LENGTH, LContainer} from './interfaces/container';\nimport {LContext, MONKEY_PATCH_KEY_NAME} from './interfaces/context';\nimport {ComponentDef, DirectiveDef} from './interfaces/definition';\nimport {NO_PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags} from './interfaces/injector';\nimport {TContainerNode, TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {RComment, RElement, RText} from './interfaces/renderer';\nimport {StylingContext} from './interfaces/styling';\nimport {CONTEXT, DECLARATION_VIEW, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, LView, LViewFlags, PARENT, RootContext, TData, TVIEW, TView} from './interfaces/view';\n\n/**\n * Returns whether the values are different from a change detection stand point.\n *\n * Constraints are relaxed in checkNoChanges mode. See `devModeEqual` for details.\n */\nexport function isDifferent(a: any, b: any): boolean {\n // NaN is the only value that is not equal to itself so the first\n // test checks if both a and b are not NaN\n return !(a !== a && b !== b) && a !== b;\n}\n\nexport function stringify(value: any): string {\n if (typeof value == 'function') return value.name || value;\n if (typeof value == 'string') return value;\n if (value == null) return '';\n if (typeof value == 'object' && typeof value.type == 'function')\n return value.type.name || value.type;\n return '' + value;\n}\n\n/**\n * Flattens an array in non-recursive way. Input arrays are not modified.\n */\nexport function flatten(list: any[]): any[] {\n const result: any[] = [];\n let i = 0;\n\n while (i < list.length) {\n const item = list[i];\n if (Array.isArray(item)) {\n if (item.length > 0) {\n list = item.concat(list.slice(i + 1));\n i = 0;\n } else {\n i++;\n }\n } else {\n result.push(item);\n i++;\n }\n }\n\n return result;\n}\n\n/** Retrieves a value from any `LView` or `TData`. */\nexport function loadInternal<T>(view: LView | TData, index: number): T {\n ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);\n return view[index + HEADER_OFFSET];\n}\n\n/**\n * Takes the value of a slot in `LView` and returns the element node.\n *\n * Normally, element nodes are stored flat, but if the node has styles/classes on it,\n * it might be wrapped in a styling context. Or if that node has a directive that injects\n * ViewContainerRef, it may be wrapped in an LContainer. Or if that node is a component,\n * it will be wrapped in LView. It could even have all three, so we keep looping\n * until we find something that isn't an array.\n *\n * @param value The initial value in `LView`\n */\nexport function readElementValue(value: RElement | StylingContext | LContainer | LView): RElement {\n while (Array.isArray(value)) {\n value = value[HOST] as any;\n }\n return value;\n}\n\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nexport function getNativeByIndex(index: number, lView: LView): RElement {\n return readElementValue(lView[index + HEADER_OFFSET]);\n}\n\nexport function getNativeByTNode(tNode: TNode, hostView: LView): RElement|RText|RComment {\n return readElementValue(hostView[tNode.index]);\n}\n\nexport function getTNode(index: number, view: LView): TNode {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, view[TVIEW].data.length, 'wrong index for TNode');\n return view[TVIEW].data[index + HEADER_OFFSET] as TNode;\n}\n\nexport function getComponentViewByIndex(nodeIndex: number, hostView: LView): LView {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n const slotValue = hostView[nodeIndex];\n return slotValue.length >= HEADER_OFFSET ? slotValue : slotValue[HOST];\n}\n\nexport function isContentQueryHost(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.hasContentQuery) !== 0;\n}\n\nexport function isComponent(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent;\n}\n\nexport function isComponentDef<T>(def: DirectiveDef<T>): def is ComponentDef<T> {\n return (def as ComponentDef<T>).template !== null;\n}\n\nexport function isLContainer(value: RElement | RComment | LContainer | StylingContext): boolean {\n // Styling contexts are also arrays, but their first index contains an element node\n return Array.isArray(value) && value.length === LCONTAINER_LENGTH;\n}\n\nexport function isRootView(target: LView): boolean {\n return (target[FLAGS] & LViewFlags.IsRoot) !== 0;\n}\n\n/**\n * Retrieve the root view from any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param component any component\n */\nexport function getRootView(target: LView | {}): LView {\n ngDevMode && assertDefined(target, 'component');\n let lView = Array.isArray(target) ? (target as LView) : readPatchedLView(target) !;\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView = lView[PARENT] !;\n }\n return lView;\n}\n\nexport function getRootContext(viewOrComponent: LView | {}): RootContext {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT] as RootContext;\n}\n\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nexport function readPatchedData(target: any): LView|LContext|null {\n ngDevMode && assertDefined(target, 'Target expected');\n return target[MONKEY_PATCH_KEY_NAME];\n}\n\nexport function readPatchedLView(target: any): LView|null {\n const value = readPatchedData(target);\n if (value) {\n return Array.isArray(value) ? value : (value as LContext).lView;\n }\n return null;\n}\n\nexport function hasParentInjector(parentLocation: RelativeInjectorLocation): boolean {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\n\nexport function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number {\n return (parentLocation as any as number) & RelativeInjectorLocationFlags.InjectorIndexMask;\n}\n\nexport function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number {\n return (parentLocation as any as number) >> RelativeInjectorLocationFlags.ViewOffsetShift;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nexport function getParentInjectorView(location: RelativeInjectorLocation, startView: LView): LView {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW] !;\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the TNode of the parent injector is found.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @param startTNode The TNode instance of the starting element\n * @returns The TNode of the parent injector\n */\nexport function getParentInjectorTNode(\n location: RelativeInjectorLocation, startView: LView, startTNode: TNode): TElementNode|\n TContainerNode|null {\n if (startTNode.parent && startTNode.parent.injectorIndex !== -1) {\n // view offset is 0\n const injectorIndex = startTNode.parent.injectorIndex;\n let parentTNode = startTNode.parent;\n while (parentTNode.parent != null && injectorIndex == parentTNode.injectorIndex) {\n parentTNode = parentTNode.parent;\n }\n return parentTNode;\n }\n\n let viewOffset = getParentInjectorViewOffset(location);\n // view offset is 1\n let parentView = startView;\n let parentTNode = startView[HOST_NODE] as TElementNode;\n\n // view offset is superior to 1\n while (viewOffset > 1) {\n parentView = parentView[DECLARATION_VIEW] !;\n parentTNode = parentView[HOST_NODE] as TElementNode;\n viewOffset--;\n }\n return parentTNode;\n}\n\nexport const defaultScheduler =\n (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame || // browser only\n setTimeout // everything else\n ).bind(global);\n\n/**\n * Equivalent to ES6 spread, add each item to an array.\n *\n * @param items The items to add\n * @param arr The array to which you want to add the items\n */\nexport function addAllToArray(items: any[], arr: any[]) {\n for (let i = 0; i < items.length; i++) {\n arr.push(items[i]);\n }\n}\n\n/**\n * Given a current view, finds the nearest component's host (LElement).\n *\n * @param lView LView for which we want a host element node\n * @returns The host node\n */\nexport function findComponentView(lView: LView): LView {\n let rootTNode = lView[HOST_NODE];\n\n while (rootTNode && rootTNode.type === TNodeType.View) {\n ngDevMode && assertDefined(lView[DECLARATION_VIEW], 'lView[DECLARATION_VIEW]');\n lView = lView[DECLARATION_VIEW] !;\n rootTNode = lView[HOST_NODE];\n }\n\n return lView;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * A set of interfaces which are shared between `@angular/core` and `@angular/compiler` to allow\n * for late binding of `@angular/compiler` for JIT purposes.\n *\n * This file has two copies. Please ensure that they are in sync:\n * - packages/compiler/src/compiler_facade_interface.ts (master)\n * - packages/core/src/render3/jit/compiler_facade_interface.ts (copy)\n *\n * Please ensure that the two files are in sync using this command:\n * ```\n * cp packages/compiler/src/compiler_facade_interface.ts \\\n * packages/core/src/render3/jit/compiler_facade_interface.ts\n * ```\n */\n\nexport interface ExportedCompilerFacade { ɵcompilerFacade: CompilerFacade; }\n\nexport interface CompilerFacade {\n compilePipe(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3PipeMetadataFacade):\n any;\n compileInjectable(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectableMetadataFacade): any;\n compileInjector(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectorMetadataFacade): any;\n compileNgModule(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3NgModuleMetadataFacade): any;\n compileDirective(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3DirectiveMetadataFacade): any;\n compileComponent(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3ComponentMetadataFacade): any;\n\n R3ResolvedDependencyType: typeof R3ResolvedDependencyType;\n}\n\nexport interface CoreEnvironment { [name: string]: Function; }\n\nexport type StringMap = {\n [key: string]: string;\n};\n\nexport type StringMapWithRename = {\n [key: string]: string | [string, string];\n};\n\nexport type Provider = any;\n\nexport enum R3ResolvedDependencyType {\n Token = 0,\n Attribute = 1,\n}\n\nexport interface R3DependencyMetadataFacade {\n token: any;\n resolved: R3ResolvedDependencyType;\n host: boolean;\n optional: boolean;\n self: boolean;\n skipSelf: boolean;\n}\n\nexport interface R3PipeMetadataFacade {\n name: string;\n type: any;\n pipeName: string;\n deps: R3DependencyMetadataFacade[]|null;\n pure: boolean;\n}\n\nexport interface R3InjectableMetadataFacade {\n name: string;\n type: any;\n typeArgumentCount: number;\n ctorDeps: R3DependencyMetadataFacade[]|null;\n providedIn: any;\n useClass?: any;\n useFactory?: any;\n useExisting?: any;\n useValue?: any;\n userDeps?: R3DependencyMetadataFacade[];\n}\n\nexport interface R3NgModuleMetadataFacade {\n type: any;\n bootstrap: Function[];\n declarations: Function[];\n imports: Function[];\n exports: Function[];\n emitInline: boolean;\n}\n\nexport interface R3InjectorMetadataFacade {\n name: string;\n type: any;\n deps: R3DependencyMetadataFacade[]|null;\n providers: any[];\n imports: any[];\n}\n\nexport interface R3DirectiveMetadataFacade {\n name: string;\n type: any;\n typeArgumentCount: number;\n typeSourceSpan: null;\n deps: R3DependencyMetadataFacade[]|null;\n selector: string|null;\n queries: R3QueryMetadataFacade[];\n host: {[key: string]: string};\n propMetadata: {[key: string]: any[]};\n lifecycle: {usesOnChanges: boolean;};\n inputs: string[];\n outputs: string[];\n usesInheritance: boolean;\n exportAs: string|null;\n providers: Provider[]|null;\n}\n\nexport interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {\n template: string;\n preserveWhitespaces: boolean;\n animations: any[]|undefined;\n viewQueries: R3QueryMetadataFacade[];\n pipes: Map<string, any>;\n directives: {selector: string, expression: any}[];\n styles: string[];\n encapsulation: ViewEncapsulation;\n viewProviders: Provider[]|null;\n interpolation?: [string, string];\n changeDetection?: ChangeDetectionStrategy;\n}\n\nexport type ViewEncapsulation = number;\n\nexport type ChangeDetectionStrategy = number;\n\nexport interface R3QueryMetadataFacade {\n propertyName: string;\n first: boolean;\n predicate: any|string[];\n descendants: boolean;\n read: any|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {global} from '../../util';\nimport {CompilerFacade, ExportedCompilerFacade} from './compiler_facade_interface';\nexport * from './compiler_facade_interface';\n\nexport function getCompilerFacade(): CompilerFacade {\n const globalNg: ExportedCompilerFacade = global.ng;\n if (!globalNg || !globalNg.ɵcompilerFacade) {\n throw new Error(\n `Angular JIT compilation failed: '@angular/compiler' not loaded!\\n` +\n ` - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\\n` +\n ` - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\\n` +\n ` - Alternatively provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`);\n }\n return globalNg.ɵcompilerFacade;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from '../di/provider';\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {makeDecorator, makeParamDecorator} from '../util/decorators';\nimport {EMPTY_ARRAY} from '../view/util';\n\n\n/**\n * Type of the Inject decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectDecorator {\n /**\n * A parameter decorator on a dependency parameter of a class constructor\n * that specifies a custom provider of the dependency.\n *\n * Learn more in the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * The following example shows a class constructor that specifies a\n * custom provider of a dependency using the parameter decorator.\n *\n * {@example core/di/ts/metadata_spec.ts region='Inject'}\n *\n * When `@Inject()` is not present, the injector uses the type annotation of the\n * parameter as the provider.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}\n */\n (token: any): any;\n new (token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n *\n * @publicApi\n */\nexport interface Inject {\n /**\n * A [DI token](guide/glossary#di-token) that maps to the dependency to be injected.\n */\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Inject: InjectDecorator = makeParamDecorator('Inject', (token: any) => ({token}));\n\n\n/**\n * Type of the Optional decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OptionalDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which marks the parameter as being an optional dependency.\n * The DI framework provides null if the dependency is not found.\n *\n * Can be used together with other parameter decorators\n * that modify how dependency injection operates.\n *\n * Learn more in the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * The following code allows the possibility of a null result:\n *\n * {@example core/di/ts/metadata_spec.ts region='Optional'}\n *\n */\n (): any;\n new (): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n *\n * @publicApi\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Optional: OptionalDecorator = makeParamDecorator('Optional');\n\n/**\n * Type of the Self decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SelfDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the local injector.\n *\n * Resolution works upward through the injector hierarchy, so the children\n * of this class must configure their own providers or be prepared for a null result.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved\n * by the local injector when instantiating the class itself, but not\n * when instantiating a child.\n *\n * {@example core/di/ts/metadata_spec.ts region='Self'}\n *\n * @see `SkipSelf`\n * @see `Optional`\n *\n */\n (): any;\n new (): Self;\n}\n\n/**\n * Type of the Self metadata.\n *\n * @publicApi\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Self: SelfDecorator = makeParamDecorator('Self');\n\n\n/**\n * Type of the SkipSelf decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SkipSelfDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the parent injector.\n * Resolution works upward through the injector hierarchy, so the local injector\n * is not checked for a provider.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved when\n * instantiating a child, but not when instantiating the class itself.\n *\n * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}\n *\n * Learn more in the\n * [Dependency Injection guide](guide/dependency-injection-in-action#skip).\n *\n * @see `Self`\n * @see `Optional`\n *\n */\n (): any;\n new (): SkipSelf;\n}\n\n/**\n * Type of the SkipSelf metadata.\n *\n * @publicApi\n */\nexport interface SkipSelf {}\n\n/**\n * SkipSelf decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const SkipSelf: SkipSelfDecorator = makeParamDecorator('SkipSelf');\n\n/**\n * Type of the Host decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostDecorator {\n /**\n * A parameter decorator on a view-provider parameter of a class constructor\n * that tells the DI framework to resolve the view by checking injectors of child\n * elements, and stop when reaching the host element of the current component.\n *\n * For an extended example, see\n * [\"Dependency Injection Guide\"](guide/dependency-injection-in-action#optional).\n *\n * @usageNotes\n *\n * The following shows use with the `@Optional` decorator, and allows for a null result.\n *\n * {@example core/di/ts/metadata_spec.ts region='Host'}\n */\n (): any;\n new (): Host;\n}\n\n/**\n * Type of the Host metadata.\n *\n * @publicApi\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Host: HostDecorator = makeParamDecorator('Host');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, getInjectableDef} from './defs';\nimport {InjectionToken} from './injection_token';\nimport {Injector} from './injector';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n */\nexport enum InjectFlags {\n // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files.\n\n Default = 0b0000,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 0b0001,\n /** Don't descend into ancestors of the node requesting injection. */\n Self = 0b0010,\n /** Skip the node that is requesting injection. */\n SkipSelf = 0b0100,\n /** Inject `defaultValue` instead if token not found. */\n Optional = 0b1000,\n}\n\n\n\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector: Injector|undefined|null = undefined;\n\nexport function setCurrentInjector(injector: Injector | null | undefined): Injector|undefined|null {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\n\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation: (<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags) => T | null)|\n undefined;\n\n/**\n * Sets the current inject implementation.\n */\nexport function setInjectImplementation(\n impl: (<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags) => T | null) | undefined):\n (<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags) => T | null)|undefined {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n\nexport function injectInjectorOnly<T>(token: Type<T>| InjectionToken<T>): T;\nexport function injectInjectorOnly<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|\n null;\nexport function injectInjectorOnly<T>(\n token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n if (_currentInjector === undefined) {\n throw new Error(`inject() must be called from an injection context`);\n } else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n }\n}\n\n/**\n * Injects a token from the currently active injector.\n *\n * This function must be used in the context of a factory function such as one defined for an\n * `InjectionToken`, and will throw an error if not called from such a context.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}\n *\n * Within such a factory function `inject` is utilized to request injection of a dependency, instead\n * of providing an additional array of dependencies as was common to do with `useFactory` providers.\n * `inject` is faster and more type-safe.\n *\n * @publicApi\n */\nexport function inject<T>(token: Type<T>| InjectionToken<T>): T;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|null;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n return (_injectImplementation || injectInjectorOnly)(token, flags);\n}\n\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * `InjectableDef`.\n */\nexport function injectRootLimpMode<T>(\n token: Type<T>| InjectionToken<T>, notFoundValue: T | undefined, flags: InjectFlags): T|null {\n const injectableDef: InjectableDef<T>|null = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :\n injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throw new Error(`Injector: NOT_FOUND [${stringify(token)}]`);\n}\n\nexport function injectArgs(types: (Type<any>| InjectionToken<any>| any[])[]): any[] {\n const args: any[] = [];\n for (let i = 0; i < types.length; i++) {\n const arg = types[i];\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new Error('Arguments array must have arguments.');\n }\n let type: Type<any>|undefined = undefined;\n let flags: InjectFlags = InjectFlags.Default;\n\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n if (meta instanceof Optional || meta.ngMetadataName === 'Optional') {\n flags |= InjectFlags.Optional;\n } else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf') {\n flags |= InjectFlags.SkipSelf;\n } else if (meta instanceof Self || meta.ngMetadataName === 'Self') {\n flags |= InjectFlags.Self;\n } else if (meta instanceof Inject) {\n type = meta.token;\n } else {\n type = meta;\n }\n }\n\n args.push(inject(type !, flags));\n } else {\n args.push(inject(arg));\n }\n }\n return args;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined, assertEqual} from './assert';\nimport {TNode, TNodeType} from './interfaces/node';\n\nexport function assertNodeType(tNode: TNode, type: TNodeType) {\n assertDefined(tNode, 'should be called with a TNode');\n assertEqual(tNode.type, type, `should be a ${typeName(type)}`);\n}\n\nexport function assertNodeOfPossibleTypes(tNode: TNode, ...types: TNodeType[]) {\n assertDefined(tNode, 'should be called with a TNode');\n const found = types.some(type => tNode.type === type);\n assertEqual(\n found, true,\n `Should be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`);\n}\n\nfunction typeName(type: TNodeType): string {\n if (type == TNodeType.Projection) return 'Projection';\n if (type == TNodeType.Container) return 'Container';\n if (type == TNodeType.View) return 'View';\n if (type == TNodeType.Element) return 'Element';\n if (type == TNodeType.ElementContainer) return 'ElementContainer';\n return '<unknown>';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual} from './assert';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TNode} from './interfaces/node';\nimport {FLAGS, HookData, LView, LViewFlags, TView} from './interfaces/view';\n\n\n\n/**\n * If this is the first template pass, any ngOnInit or ngDoCheck hooks will be queued into\n * TView.initHooks during directiveCreate.\n *\n * The directive index and hook type are encoded into one number (1st bit: type, remaining bits:\n * directive index), then saved in the even indices of the initHooks array. The odd indices\n * hold the hook functions themselves.\n *\n * @param index The index of the directive in LView\n * @param hooks The static hooks map on the directive def\n * @param tView The current TView\n */\nexport function queueInitHooks(\n index: number, onInit: (() => void) | null, doCheck: (() => void) | null, tView: TView): void {\n ngDevMode &&\n assertEqual(tView.firstTemplatePass, true, 'Should only be called on first template pass');\n if (onInit) {\n (tView.initHooks || (tView.initHooks = [])).push(index, onInit);\n }\n\n if (doCheck) {\n (tView.initHooks || (tView.initHooks = [])).push(index, doCheck);\n (tView.checkHooks || (tView.checkHooks = [])).push(index, doCheck);\n }\n}\n\n/**\n * Loops through the directives on a node and queues all their hooks except ngOnInit\n * and ngDoCheck, which are queued separately in directiveCreate.\n */\nexport function queueLifecycleHooks(tView: TView, tNode: TNode): void {\n if (tView.firstTemplatePass) {\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n queueContentHooks(def, tView, i);\n queueViewHooks(def, tView, i);\n queueDestroyHooks(def, tView, i);\n }\n }\n}\n\n/** Queues afterContentInit and afterContentChecked hooks on TView */\nfunction queueContentHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}\n\n/** Queues afterViewInit and afterViewChecked hooks on TView */\nfunction queueViewHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.afterViewInit) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);\n }\n\n if (def.afterViewChecked) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);\n (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, def.afterViewChecked);\n }\n}\n\n/** Queues onDestroy hooks on TView */\nfunction queueDestroyHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.onDestroy != null) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);\n }\n}\n\n/**\n * Calls onInit and doCheck calls if they haven't already been called.\n *\n * @param currentView The current view\n */\nexport function executeInitHooks(\n currentView: LView, tView: TView, checkNoChangesMode: boolean): void {\n if (!checkNoChangesMode && currentView[FLAGS] & LViewFlags.RunInit) {\n executeHooks(currentView, tView.initHooks, tView.checkHooks, checkNoChangesMode);\n currentView[FLAGS] &= ~LViewFlags.RunInit;\n }\n}\n\n/**\n * Iterates over afterViewInit and afterViewChecked functions and calls them.\n *\n * @param currentView The current view\n */\nexport function executeHooks(\n currentView: LView, allHooks: HookData | null, checkHooks: HookData | null,\n checkNoChangesMode: boolean): void {\n if (checkNoChangesMode) return;\n\n const hooksToCall = currentView[FLAGS] & LViewFlags.FirstLViewPass ? allHooks : checkHooks;\n if (hooksToCall) {\n callHooks(currentView, hooksToCall);\n }\n}\n\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass.\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n */\nexport function callHooks(currentView: any[], arr: HookData): void {\n for (let i = 0; i < arr.length; i += 2) {\n (arr[i + 1] as() => void).call(currentView[arr[i] as number]);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from './assert';\nimport {executeHooks} from './hooks';\nimport {ComponentDef, DirectiveDef} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeFlags, TViewNode} from './interfaces/node';\nimport {LQueries} from './interfaces/query';\nimport {BINDING_INDEX, CONTEXT, DECLARATION_VIEW, FLAGS, HOST_NODE, LView, LViewFlags, OpaqueViewState, QUERIES, TVIEW} from './interfaces/view';\nimport {isContentQueryHost} from './util';\n\n\n\n/**\n * Store the element depth count. This is used to identify the root elements of the template\n * so that we can than attach `LView` to only those elements.\n */\nlet elementDepthCount !: number;\n\nexport function getElementDepthCount() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return elementDepthCount;\n}\n\nexport function increaseElementDepthCount() {\n elementDepthCount++;\n}\n\nexport function decreaseElementDepthCount() {\n elementDepthCount--;\n}\n\nlet currentDirectiveDef: DirectiveDef<any>|ComponentDef<any>|null = null;\n\nexport function getCurrentDirectiveDef(): DirectiveDef<any>|ComponentDef<any>|null {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return currentDirectiveDef;\n}\n\nexport function setCurrentDirectiveDef(def: DirectiveDef<any>| ComponentDef<any>| null): void {\n currentDirectiveDef = def;\n}\n\n/**\n * Stores whether directives should be matched to elements.\n *\n * When template contains `ngNonBindable` than we need to prevent the runtime form matching\n * directives on children of that element.\n *\n * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * </div>\n * ```\n */\nlet bindingsEnabled !: boolean;\n\nexport function getBindingsEnabled(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return bindingsEnabled;\n}\n\n\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- disabledBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- enableBindings() -->\n * </div>\n * ```\n */\nexport function enableBindings(): void {\n bindingsEnabled = true;\n}\n\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- disabledBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- enableBindings() -->\n * </div>\n * ```\n */\nexport function disableBindings(): void {\n bindingsEnabled = false;\n}\n\nexport function getLView(): LView {\n return lView;\n}\n\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n */\nexport function restoreView(viewToRestore: OpaqueViewState) {\n contextLView = viewToRestore as any as LView;\n}\n\n/** Used to set the parent property when nodes are created and track query results. */\nlet previousOrParentTNode: TNode;\n\nexport function getPreviousOrParentTNode(): TNode {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return previousOrParentTNode;\n}\n\nexport function setPreviousOrParentTNode(tNode: TNode) {\n previousOrParentTNode = tNode;\n}\n\nexport function setTNodeAndViewData(tNode: TNode, view: LView) {\n previousOrParentTNode = tNode;\n lView = view;\n}\n\n/**\n * If `isParent` is:\n * - `true`: then `previousOrParentTNode` points to a parent node.\n * - `false`: then `previousOrParentTNode` points to previous node (sibling).\n */\nlet isParent: boolean;\n\nexport function getIsParent(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return isParent;\n}\n\nexport function setIsParent(value: boolean): void {\n isParent = value;\n}\n\n/**\n * Query instructions can ask for \"current queries\" in 2 different cases:\n * - when creating view queries (at the root of a component view, before any node is created - in\n * this case currentQueries points to view queries)\n * - when creating content queries (i.e. this previousOrParentTNode points to a node on which we\n * create content queries).\n */\nexport function getOrCreateCurrentQueries(\n QueryType: {new (parent: null, shallow: null, deep: null): LQueries}): LQueries {\n const lView = getLView();\n let currentQueries = lView[QUERIES];\n // if this is the first content query on a node, any existing LQueries needs to be cloned\n // in subsequent template passes, the cloning occurs before directive instantiation.\n if (previousOrParentTNode && previousOrParentTNode !== lView[HOST_NODE] &&\n !isContentQueryHost(previousOrParentTNode)) {\n currentQueries && (currentQueries = lView[QUERIES] = currentQueries.clone());\n previousOrParentTNode.flags |= TNodeFlags.hasContentQuery;\n }\n\n return currentQueries || (lView[QUERIES] = new QueryType(null, null, null));\n}\n\n/** Checks whether a given view is in creation mode */\nexport function isCreationMode(view: LView = lView): boolean {\n return (view[FLAGS] & LViewFlags.CreationMode) === LViewFlags.CreationMode;\n}\n\n/**\n * State of the current view being processed.\n *\n * An array of nodes (text, element, container, etc), pipes, their bindings, and\n * any local variables that need to be stored between invocations.\n */\nlet lView: LView;\n\n/**\n * The last viewData retrieved by nextContext().\n * Allows building nextContext() and reference() calls.\n *\n * e.g. const inner = x().$implicit; const outer = x().$implicit;\n */\nlet contextLView: LView = null !;\n\nexport function getContextLView(): LView {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return contextLView;\n}\n\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n */\nlet checkNoChangesMode = false;\n\nexport function getCheckNoChangesMode(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return checkNoChangesMode;\n}\n\nexport function setCheckNoChangesMode(mode: boolean): void {\n checkNoChangesMode = mode;\n}\n\n/** Whether or not this is the first time the current view has been processed. */\nlet firstTemplatePass = true;\n\nexport function getFirstTemplatePass(): boolean {\n return firstTemplatePass;\n}\n\nexport function setFirstTemplatePass(value: boolean): void {\n firstTemplatePass = value;\n}\n\n/**\n * The root index from which pure function instructions should calculate their binding\n * indices. In component views, this is TView.bindingStartIndex. In a host binding\n * context, this is the TView.expandoStartIndex + any dirs/hostVars before the given dir.\n */\nlet bindingRootIndex: number = -1;\n\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nexport function getBindingRoot() {\n return bindingRootIndex;\n}\n\nexport function setBindingRoot(value: number) {\n bindingRootIndex = value;\n}\n\n/**\n * Swap the current state with a new state.\n *\n * For performance reasons we store the state in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the state for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New state to become active\n * @param host Element to which the View is a child of\n * @returns the previous state;\n */\nexport function enterView(newView: LView, hostTNode: TElementNode | TViewNode | null): LView {\n const oldView = lView;\n if (newView) {\n const tView = newView[TVIEW];\n firstTemplatePass = tView.firstTemplatePass;\n bindingRootIndex = tView.bindingStartIndex;\n }\n\n previousOrParentTNode = hostTNode !;\n isParent = true;\n\n lView = contextLView = newView;\n return oldView;\n}\n\nexport function nextContextImpl<T = any>(level: number = 1): T {\n contextLView = walkUpViews(level, contextLView !);\n return contextLView[CONTEXT] as T;\n}\n\nfunction walkUpViews(nestingLevel: number, currentView: LView): LView {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(\n currentView[DECLARATION_VIEW],\n 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW] !;\n nestingLevel--;\n }\n return currentView;\n}\n\n/**\n * Resets the application state.\n */\nexport function resetComponentState() {\n isParent = false;\n previousOrParentTNode = null !;\n elementDepthCount = 0;\n bindingsEnabled = true;\n}\n\n/**\n * Used in lieu of enterView to make it clear when we are exiting a child view. This makes\n * the direction of traversal (up or down the view tree) a bit clearer.\n *\n * @param newView New state to become active\n */\nexport function leaveView(newView: LView): void {\n const tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~LViewFlags.CreationMode;\n } else {\n executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode);\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(LViewFlags.Dirty | LViewFlags.FirstLViewPass);\n lView[FLAGS] |= LViewFlags.RunInit;\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n enterView(newView, null);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getInjectableDef, getInjectorDef} from '../di/defs';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {InjectFlags, injectRootLimpMode, setInjectImplementation} from '../di/injector_compatibility';\nimport {Type} from '../type';\n\nimport {assertDefined, assertEqual} from './assert';\nimport {getComponentDef, getDirectiveDef, getPipeDef} from './definition';\nimport {NG_ELEMENT_ID} from './fields';\nimport {DirectiveDef} from './interfaces/definition';\nimport {NO_PARENT_INJECTOR, NodeInjectorFactory, PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags, TNODE, isFactory} from './interfaces/injector';\nimport {AttributeMarker, TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeProviderIndexes, TNodeType} from './interfaces/node';\nimport {DECLARATION_VIEW, HOST_NODE, INJECTOR, LView, TData, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes} from './node_assert';\nimport {getLView, getPreviousOrParentTNode, setTNodeAndViewData} from './state';\nimport {findComponentView, getParentInjectorIndex, getParentInjectorView, hasParentInjector, isComponent, isComponentDef, stringify} from './util';\n\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\n\nfunction setIncludeViewProviders(v: boolean): boolean {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nexport function bloomAdd(\n injectorIndex: number, tView: TView, type: Type<any>| InjectionToken<any>| string): void {\n ngDevMode && assertEqual(tView.firstTemplatePass, true, 'expected firstTemplatePass to be true');\n let id: number|undefined =\n typeof type !== 'string' ? (type as any)[NG_ELEMENT_ID] : type.charCodeAt(0) || 0;\n\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = (type as any)[NG_ELEMENT_ID] = nextNgElementId++;\n }\n\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomBit = id & BLOOM_MASK;\n\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomBit;\n\n // Use the raw bloomBit number to determine which bloom filter bucket we should check\n // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc\n const b7 = bloomBit & 0x80;\n const b6 = bloomBit & 0x40;\n const b5 = bloomBit & 0x20;\n const tData = tView.data as number[];\n\n if (b7) {\n b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :\n (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));\n } else {\n b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) :\n (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask));\n }\n}\n\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param hostView View where the node is stored\n * @returns Node injector\n */\nexport function getOrCreateNodeInjectorForNode(\n tNode: TElementNode | TContainerNode | TElementContainerNode, hostView: LView): number {\n const existingInjectorIndex = getInjectorIndex(tNode, hostView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n\n const tView = hostView[TVIEW];\n if (tView.firstTemplatePass) {\n tNode.injectorIndex = hostView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(hostView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n\n ngDevMode && assertEqual(\n tNode.flags === 0 || tNode.flags === TNodeFlags.isComponent, true,\n 'expected tNode.flags to not be initialized');\n }\n\n const parentLoc = getParentInjectorLocation(tNode, hostView);\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, hostView);\n\n const injectorIndex = tNode.injectorIndex;\n\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentData = parentLView[TVIEW].data as any;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8; i++) {\n hostView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n\n hostView[injectorIndex + PARENT_INJECTOR] = parentLoc;\n return injectorIndex;\n}\n\nfunction insertBloom(arr: any[], footer: TNode | null): void {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\n\n\nexport function getInjectorIndex(tNode: TNode, hostView: LView): number {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n hostView[tNode.injectorIndex + PARENT_INJECTOR] == null) {\n return -1;\n } else {\n return tNode.injectorIndex;\n }\n}\n\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata`\n */\nexport function getParentInjectorLocation(tNode: TNode, view: LView): RelativeInjectorLocation {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n return tNode.parent.injectorIndex as any; // ViewOffset is 0\n }\n\n // For most cases, the parent injector index can be found on the host node (e.g. for component\n // or container), so this loop will be skipped, but we must keep the loop here to support\n // the rarer case of deeply nested <ng-template> tags or inline views.\n let hostTNode = view[HOST_NODE];\n let viewOffset = 1;\n while (hostTNode && hostTNode.injectorIndex === -1) {\n view = view[DECLARATION_VIEW] !;\n hostTNode = view ? view[HOST_NODE] : null;\n viewOffset++;\n }\n\n return hostTNode ?\n hostTNode.injectorIndex | (viewOffset << RelativeInjectorLocationFlags.ViewOffsetShift) :\n -1 as any;\n}\n\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nexport function diPublicInInjector(\n injectorIndex: number, view: LView, token: InjectionToken<any>| Type<any>): void {\n bloomAdd(injectorIndex, view[TVIEW], token);\n}\n\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ngComponentDef = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nexport function injectAttributeImpl(tNode: TNode, attrNameToInject: string): string|null {\n ngDevMode && assertNodeOfPossibleTypes(\n tNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n const attrs = tNode.attrs;\n if (attrs) {\n for (let i = 0; i < attrs.length; i = i + 2) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName == attrNameToInject) {\n return attrs[i + 1] as string;\n }\n }\n }\n return null;\n}\n\n\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nexport function getOrCreateInjectable<T>(\n tNode: TElementNode | TContainerNode | TElementContainerNode | null, lView: LView,\n token: Type<T>| InjectionToken<T>, flags: InjectFlags = InjectFlags.Default,\n notFoundValue?: any): T|null {\n if (tNode) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n const savePreviousOrParentTNode = getPreviousOrParentTNode();\n const saveLView = getLView();\n setTNodeAndViewData(tNode, lView);\n try {\n const value = bloomHash();\n if (value == null && !(flags & InjectFlags.Optional)) {\n throw new Error(`No provider for ${stringify(token)}!`);\n } else {\n return value;\n }\n } finally {\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n } else if (typeof bloomHash == 'number') {\n // If the token has a bloom hash, then it is a token which could be in NodeInjector.\n\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView: TView|null = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation: RelativeInjectorLocation = NO_PARENT_INJECTOR;\n let hostTElementNode: TNode|null =\n flags & InjectFlags.Host ? findComponentView(lView)[HOST_NODE] : null;\n\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching\n // the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :\n lView[injectorIndex + PARENT_INJECTOR];\n\n if (!shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n parentLocation = lView[injectorIndex + PARENT_INJECTOR];\n\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance: T|null = searchTokensOnInjector<T>(\n injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n if (shouldSearchParent(\n flags, lView[TVIEW].data[injectorIndex + TNODE] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n }\n\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n }\n if (flags & InjectFlags.Optional) {\n return notFoundValue;\n } else {\n throw new Error(`NodeInjector: NOT_FOUND [${stringify(token)}]`);\n }\n}\n\nconst NOT_FOUND = {};\n\nfunction searchTokensOnInjector<T>(\n injectorIndex: number, lView: LView, token: Type<T>| InjectionToken<T>,\n previousTView: TView | null, flags: InjectFlags, hostTElementNode: TNode | null) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + TNODE] as TNode;\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n (isComponent(tNode) && includeViewProviders) :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n (previousTView != currentTView && (tNode.type === TNodeType.Element));\n\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;\n\n const injectableIdx =\n locateDirectiveOrProvider(tNode, lView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(currentTView.data, lView, injectableIdx, tNode as TElementNode);\n } else {\n return NOT_FOUND;\n }\n}\n\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param lView The view we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nexport function locateDirectiveOrProvider<T>(\n tNode: TNode, lView: LView, token: Type<T>| InjectionToken<T>, canAccessViewProviders: boolean,\n isHostSpecialCase: boolean | number): number|null {\n const tView = lView[TVIEW];\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n\n const injectablesStart = nodeProviderIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount =\n nodeProviderIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n const startingIndex =\n canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i] as InjectionToken<any>| Type<any>| DirectiveDef<any>;\n if (i < directivesStart && token === providerTokenOrDef ||\n i >= directivesStart && (providerTokenOrDef as DirectiveDef<any>).type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart] as DirectiveDef<any>;\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n\n/**\n* Retrieve or instantiate the injectable from the `lData` at particular `index`.\n*\n* This function checks to see if the value has already been instantiated and if so returns the\n* cached `injectable`. Otherwise if it detects that the value is still a factory it\n* instantiates the `injectable` and caches the value.\n*/\nexport function getNodeInjectable(\n tData: TData, lData: LView, index: number, tNode: TElementNode): any {\n let value = lData[index];\n if (isFactory(value)) {\n const factory: NodeInjectorFactory = value;\n if (factory.resolving) {\n throw new Error(`Circular dep for ${stringify(tData[index])}`);\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n let previousInjectImplementation;\n if (factory.injectImpl) {\n previousInjectImplementation = setInjectImplementation(factory.injectImpl);\n }\n const savePreviousOrParentTNode = getPreviousOrParentTNode();\n const saveLView = getLView();\n setTNodeAndViewData(tNode, lData);\n try {\n value = lData[index] = factory.factory(null, tData, lData, tNode);\n } finally {\n if (factory.injectImpl) setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n }\n return value;\n}\n\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n */\nexport function bloomHashBitOrFactory(token: Type<any>| InjectionToken<any>| string): number|\n Function|undefined {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId: number|undefined = (token as any)[NG_ELEMENT_ID];\n return typeof tokenId === 'number' ? tokenId & BLOOM_MASK : tokenId;\n}\n\nexport function bloomHasToken(\n bloomHash: number, injectorIndex: number, injectorView: LView | TData) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n const b7 = bloomHash & 0x80;\n const b6 = bloomHash & 0x40;\n const b5 = bloomHash & 0x20;\n\n // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:\n // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.\n // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.\n let value: number;\n\n if (b7) {\n value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) :\n (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]);\n } else {\n value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) :\n (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]);\n }\n\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags: InjectFlags, isFirstHostTNode: boolean): boolean|number {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\n\nexport function injectInjector() {\n const tNode = getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode;\n return new NodeInjector(tNode, getLView());\n}\n\nexport class NodeInjector implements Injector {\n constructor(\n private _tNode: TElementNode|TContainerNode|TElementContainerNode|null,\n private _lView: LView) {}\n\n get(token: any, notFoundValue?: any): any {\n return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);\n }\n}\n\nexport function getFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {\n const typeAny = type as any;\n const def = getComponentDef<T>(typeAny) || getDirectiveDef<T>(typeAny) ||\n getPipeDef<T>(typeAny) || getInjectableDef<T>(typeAny) || getInjectorDef<T>(typeAny);\n if (!def || def.factory === undefined) {\n return null;\n }\n return def.factory;\n}\n\nexport function getInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {\n const proto = Object.getPrototypeOf(type.prototype).constructor as Type<any>;\n const factory = getFactoryOf<T>(proto);\n if (factory !== null) {\n return factory;\n } else {\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return (t) => new t();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport './ng_dev_mode';\nimport {assertDomNode} from './assert';\nimport {EMPTY_ARRAY} from './empty';\nimport {LContext, MONKEY_PATCH_KEY_NAME} from './interfaces/context';\nimport {TNode, TNodeFlags} from './interfaces/node';\nimport {RElement} from './interfaces/renderer';\nimport {CONTEXT, HEADER_OFFSET, HOST, LView, TVIEW} from './interfaces/view';\nimport {getComponentViewByIndex, getNativeByTNode, readElementValue, readPatchedData} from './util';\n\n\n\n/** Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nexport function getLContext(target: any): LContext|null {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (Array.isArray(mpValue)) {\n const lView: LView = mpValue !;\n let nodeIndex: number;\n let component: any = undefined;\n let directives: any[]|null|undefined = undefined;\n\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);\n } else {\n nodeIndex = findViaNativeElement(lView, target as RElement);\n if (nodeIndex == -1) {\n return null;\n }\n }\n\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = readElementValue(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context: LContext = (existingCtx && !Array.isArray(existingCtx)) ?\n existingCtx :\n createLContext(lView, nodeIndex, native);\n\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target as RElement;\n ngDevMode && assertDomNode(rElement);\n\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement as any;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n let lView: LView|null;\n if (Array.isArray(parentContext)) {\n lView = parentContext as LView;\n } else {\n lView = parentContext.lView;\n }\n\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = readElementValue(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return (mpValue as LContext) || null;\n}\n\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView: LView, nodeIndex: number, native: RElement): LContext {\n return {\n lView,\n nodeIndex,\n native,\n component: undefined,\n directives: undefined,\n localRefs: undefined,\n };\n}\n\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nexport function getComponentViewByInstance(componentInstance: {}): LView {\n let lView = readPatchedData(componentInstance);\n let view: LView;\n\n if (Array.isArray(lView)) {\n const nodeIndex = findViaComponent(lView, componentInstance);\n view = getComponentViewByIndex(nodeIndex, lView);\n const context = createLContext(lView, nodeIndex, view[HOST] as RElement);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = lView as any as LContext;\n view = getComponentViewByIndex(context.nodeIndex, context.lView);\n }\n return view;\n}\n\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nexport function attachPatchData(target: any, data: LView | LContext) {\n target[MONKEY_PATCH_KEY_NAME] = data;\n}\n\nexport function isComponentInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ngComponentDef;\n}\n\nexport function isDirectiveInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ngDirectiveDef;\n}\n\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView: LView, target: RElement): number {\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const native = getNativeByTNode(tNode, lView) !;\n if (native === target) {\n return tNode.index;\n }\n tNode = traverseNextElement(tNode);\n }\n\n return -1;\n}\n\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode: TNode): TNode|null {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView: LView, componentInstance: {}): number {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView: LView, directiveInstance: {}): number {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n\n/**\n * Returns a list of directives extracted from the given view based on the\n * provided list of directive index values.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n * @param includeComponents Whether or not to include components in returned directives\n */\nexport function getDirectivesAtNodeIndex(\n nodeIndex: number, lView: LView, includeComponents: boolean): any[]|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n let directiveStartIndex = tNode.directiveStart;\n if (directiveStartIndex == 0) return EMPTY_ARRAY;\n const directiveEndIndex = tNode.directiveEnd;\n if (!includeComponents && tNode.flags & TNodeFlags.isComponent) directiveStartIndex++;\n return lView.slice(directiveStartIndex, directiveEndIndex);\n}\n\nexport function getComponentAtNodeIndex(nodeIndex: number, lView: LView): {}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n let directiveStartIndex = tNode.directiveStart;\n return tNode.flags & TNodeFlags.isComponent ? lView[directiveStartIndex] : null;\n}\n\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nexport function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: string]: any}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode && tNode.localNames) {\n const result: {[key: string]: any} = {};\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n const localRefName = tNode.localNames[i];\n const directiveIndex = tNode.localNames[i + 1] as number;\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) ! : lView[directiveIndex];\n }\n return result;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\n\nimport {assertDefined} from './assert';\nimport {discoverLocalRefs, getComponentAtNodeIndex, getDirectivesAtNodeIndex, getLContext} from './context_discovery';\nimport {NodeInjector} from './di';\nimport {LContext} from './interfaces/context';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeProviderIndexes} from './interfaces/node';\nimport {CLEANUP, CONTEXT, FLAGS, HOST, LView, LViewFlags, PARENT, RootContext, TVIEW} from './interfaces/view';\nimport {readElementValue, readPatchedLView, stringify} from './util';\n\n\n\n/**\n * Returns the component instance associated with a given DOM host element.\n * Elements which don't represent components return `null`.\n *\n * @param element Host DOM element from which the component should be retrieved.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getComponent(<child-comp>) instanceof ChildComponent).toBeTruthy();\n * expect(getComponent(<my-app>) instanceof MyApp).toBeTruthy();\n * ```\n *\n * @publicApi\n */\nexport function getComponent<T = {}>(element: Element): T|null {\n const context = loadLContextFromNode(element);\n\n if (context.component === undefined) {\n context.component = getComponentAtNodeIndex(context.nodeIndex, context.lView);\n }\n\n return context.component as T;\n}\n\n/**\n * Returns the component instance associated with a given DOM host element.\n * Elements which don't represent components return `null`.\n *\n * @param element Host DOM element from which the component should be retrieved.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getComponent(<child-comp>) instanceof ChildComponent).toBeTruthy();\n * expect(getComponent(<my-app>) instanceof MyApp).toBeTruthy();\n * ```\n *\n * @publicApi\n */\nexport function getContext<T = {}>(element: Element): T|null {\n const context = loadLContextFromNode(element) !;\n return context.lView[CONTEXT] as T;\n}\n\n/**\n * Returns the component instance associated with view which owns the DOM element (`null`\n * otherwise).\n *\n * @param element DOM element which is owned by an existing component's view.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getViewComponent(<child-comp>) instanceof MyApp).toBeTruthy();\n * expect(getViewComponent(<my-app>)).toEqual(null);\n * ```\n *\n * @publicApi\n */\nexport function getViewComponent<T = {}>(element: Element | {}): T|null {\n const context = loadLContext(element) !;\n let lView: LView = context.lView;\n while (lView[PARENT] && lView[HOST] === null) {\n // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\n lView = lView[PARENT] !;\n }\n\n return lView[FLAGS] & LViewFlags.IsRoot ? null : lView[CONTEXT] as T;\n}\n\n\n\n/**\n * Returns the `RootContext` instance that is associated with\n * the application where the target is situated.\n *\n */\nexport function getRootContext(target: LView | {}): RootContext {\n const lViewData = Array.isArray(target) ? target : loadLContext(target) !.lView;\n const rootLView = getRootView(lViewData);\n return rootLView[CONTEXT] as RootContext;\n}\n\n/**\n * Retrieve all root components.\n *\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getRootComponents(target: {}): any[] {\n return [...getRootContext(target).components];\n}\n\n/**\n * Retrieves an `Injector` associated with the element, component or directive.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getInjector(target: {}): Injector {\n const context = loadLContext(target);\n const tNode = context.lView[TVIEW].data[context.nodeIndex] as TElementNode;\n return new NodeInjector(tNode, context.lView);\n}\n\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n * @publicApi\n */\nexport function getInjectionTokens(element: Element): any[] {\n const context = loadLContext(element, false);\n if (!context) return [];\n const lView = context.lView;\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex] as TNode;\n const providerTokens: any[] = [];\n const startIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n\n/**\n * Retrieves directives associated with a given DOM host element.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getDirectives(target: {}): Array<{}> {\n const context = loadLContext(target) !;\n\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n\n return context.directives || [];\n}\n\n/**\n * Returns LContext associated with a target passed as an argument.\n * Throws if a given target doesn't have associated LContext.\n *\n */\nexport function loadLContext(target: {}): LContext;\nexport function loadLContext(target: {}, throwOnNotFound: false): LContext|null;\nexport function loadLContext(target: {}, throwOnNotFound: boolean = true): LContext|null {\n const context = getLContext(target);\n if (!context && throwOnNotFound) {\n throw new Error(\n ngDevMode ? `Unable to find context associated with ${stringify(target)}` :\n 'Invalid ng target');\n }\n return context;\n}\n\n/**\n * Retrieve the root view from any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrView any component or view\n *\n */\nexport function getRootView(componentOrView: LView | {}): LView {\n let lView: LView;\n if (Array.isArray(componentOrView)) {\n ngDevMode && assertDefined(componentOrView, 'lView');\n lView = componentOrView as LView;\n } else {\n ngDevMode && assertDefined(componentOrView, 'component');\n lView = readPatchedLView(componentOrView) !;\n }\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView = lView[PARENT] !;\n }\n return lView;\n}\n\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getLocalRefs(target: {}): {[key: string]: any} {\n const context = loadLContext(target) !;\n\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n\n return context.localRefs || {};\n}\n\n/**\n * Retrieve the host element of the component.\n *\n * Use this function to retrieve the host element of the component. The host\n * element is the element which the component is associated with.\n *\n * @param directive Component or Directive for which the host element should be retrieved.\n *\n * @publicApi\n */\nexport function getHostElement<T>(directive: T): Element {\n return getLContext(directive) !.native as never as Element;\n}\n\n/**\n * Retrieves the rendered text for a given component.\n *\n * This function retrieves the host element of a component and\n * and then returns the `textContent` for that element. This implies\n * that the text returned will include re-projected content of\n * the component as well.\n *\n * @param component The component to return the content text for.\n */\nexport function getRenderedText(component: any): string {\n const hostElement = getHostElement(component);\n return hostElement.textContent || '';\n}\n\nexport function loadLContextFromNode(node: Node): LContext {\n if (!(node instanceof Node)) throw new Error('Expecting instance of DOM Node');\n return loadLContext(node) !;\n}\n\nexport interface Listener {\n name: string;\n element: Element;\n callback: (value: any) => any;\n useCapture: boolean|null;\n}\n\nexport function isBrowserEvents(listener: Listener): boolean {\n // Browser events are those which don't have `useCapture` as boolean.\n return typeof listener.useCapture === 'boolean';\n}\n\n\n/**\n * Retrieves a list of DOM listeners.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div (click)=\"doSomething()\">\n * </div>\n * </mp-app>\n *\n * expect(getListeners(<div>)).toEqual({\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * });\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @publicApi\n */\nexport function getListeners(element: Element): Listener[] {\n const lContext = loadLContextFromNode(element);\n const lView = lContext.lView;\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners: Listener[] = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name: string = firstParam;\n const listenerElement = readElementValue(lView[secondParam]) as any as Element;\n const callback: (value: any) => any = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const useCapture = typeof useCaptureOrIndx === 'boolean' ?\n useCaptureOrIndx :\n (useCaptureOrIndx >= 0 ? false : null);\n if (element == listenerElement) {\n listeners.push({element, name, callback, useCapture});\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\n\nfunction sortListeners(a: Listener, b: Listener) {\n if (a.name == b.name) return 0;\n return a.name < b.name ? -1 : 1;\n}\n\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj: any): obj is DirectiveDef<any> {\n return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function normalizeDebugBindingName(name: string) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\n\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\n\nfunction camelCaseToDashCase(input: string): string {\n return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());\n}\n\nexport function normalizeDebugBindingValue(value: any): string {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getSymbolIterator, looseIdentical} from '../util';\n\nexport function devModeEqual(a: any, b: any): boolean {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return looseIdentical(a, b);\n }\n }\n}\n\n/**\n * Indicates that the result of a {@link Pipe} transformation has changed even though the\n * reference has not changed.\n *\n * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value\n * is stored.\n *\n * Example:\n *\n * ```\n * if (this._latestValue === this._latestReturnedValue) {\n * return this._latestReturnedValue;\n * } else {\n * this._latestReturnedValue = this._latestValue;\n * return WrappedValue.wrap(this._latestValue); // this will force update\n * }\n * ```\n *\n * @publicApi\n */\nexport class WrappedValue {\n /** @deprecated from 5.3, use `unwrap()` instead - will switch to protected */\n wrapped: any;\n\n constructor(value: any) { this.wrapped = value; }\n\n /** Creates a wrapped value. */\n static wrap(value: any): WrappedValue { return new WrappedValue(value); }\n\n /**\n * Returns the underlying value of a wrapped value.\n * Returns the given `value` when it is not wrapped.\n **/\n static unwrap(value: any): any { return WrappedValue.isWrapped(value) ? value.wrapped : value; }\n\n /** Returns true if `value` is a wrapped value. */\n static isWrapped(value: any): value is WrappedValue { return value instanceof WrappedValue; }\n}\n\n/**\n * Represents a basic change from a previous to a new value.\n *\n * @publicApi\n */\nexport class SimpleChange {\n constructor(public previousValue: any, public currentValue: any, public firstChange: boolean) {}\n\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange(): boolean { return this.firstChange; }\n}\n\nexport function isListLikeIterable(obj: any): boolean {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop\n}\n\nexport function areIterablesEqual(\n a: any, b: any, comparator: (a: any, b: any) => boolean): boolean {\n const iterator1 = a[getSymbolIterator()]();\n const iterator2 = b[getSymbolIterator()]();\n\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\n\nexport function iterateListLike(obj: any, fn: (p: any) => any) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[getSymbolIterator()]();\n let item: any;\n while (!((item = iterator.next()).done)) {\n fn(item.value);\n }\n }\n}\n\nexport function isJsObject(o: any): boolean {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {TNode} from './interfaces/node';\n\n/** Called when directives inject each other (creating a circular dependency) */\nexport function throwCyclicDependencyError(token: any): never {\n throw new Error(`Cannot instantiate cyclic dependency! ${token}`);\n}\n\n/** Called when there are multiple component selectors that match a given node */\nexport function throwMultipleComponentError(tNode: TNode): never {\n throw new Error(`Multiple components match node with tagname ${tNode.tagName}`);\n}\n\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nexport function throwErrorIfNoChangesMode(\n creationMode: boolean, oldValue: any, currValue: any): never|void {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (creationMode) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n // TODO: include debug context\n throw new Error(msg);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport interface NO_CHANGE {\n // This is a brand that ensures that this type can never match anything else\n brand: 'NO_CHANGE';\n}\n\n/** A special value which designates that a value has not changed. */\nexport const NO_CHANGE = {} as NO_CHANGE;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {devModeEqual} from '../change_detection/change_detection_util';\n\nimport {assertDataInRange, assertLessThan, assertNotEqual} from './assert';\nimport {throwErrorIfNoChangesMode} from './errors';\nimport {BINDING_INDEX, LView} from './interfaces/view';\nimport {getCheckNoChangesMode, isCreationMode} from './state';\nimport {NO_CHANGE} from './tokens';\nimport {isDifferent} from './util';\n\n\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nexport function updateBinding(lView: LView, bindingIndex: number, value: any): any {\n return lView[bindingIndex] = value;\n}\n\n\n/** Gets the current binding value. */\nexport function getBinding(lView: LView, bindingIndex: number): any {\n ngDevMode && assertDataInRange(lView, lView[bindingIndex]);\n ngDevMode &&\n assertNotEqual(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n\n/** Updates binding if changed, then returns whether it was updated. */\nexport function bindingUpdated(lView: LView, bindingIndex: number, value: any): boolean {\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n\n if (lView[bindingIndex] === NO_CHANGE) {\n // initial pass\n lView[bindingIndex] = value;\n } else if (isDifferent(lView[bindingIndex], value)) {\n if (ngDevMode && getCheckNoChangesMode()) {\n if (!devModeEqual(lView[bindingIndex], value)) {\n throwErrorIfNoChangesMode(isCreationMode(lView), lView[bindingIndex], value);\n }\n }\n lView[bindingIndex] = value;\n } else {\n return false;\n }\n return true;\n}\n\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nexport function bindingUpdated2(lView: LView, bindingIndex: number, exp1: any, exp2: any): boolean {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated3(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated4(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any, exp4: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * Expresses a single CSS Selector.\n *\n * Beginning of array\n * - First index: element name\n * - Subsequent odd indices: attr keys\n * - Subsequent even indices: attr values\n *\n * After SelectorFlags.CLASS flag\n * - Class name values\n *\n * SelectorFlags.NOT flag\n * - Changes the mode to NOT\n * - Can be combined with other flags to set the element / attr / class mode\n *\n * e.g. SelectorFlags.NOT | SelectorFlags.ELEMENT\n *\n * Example:\n * Original: `div.foo.bar[attr1=val1][attr2]`\n * Parsed: ['div', 'attr1', 'val1', 'attr2', '', SelectorFlags.CLASS, 'foo', 'bar']\n *\n * Original: 'div[attr1]:not(.foo[attr2])\n * Parsed: [\n * 'div', 'attr1', '',\n * SelectorFlags.NOT | SelectorFlags.ATTRIBUTE 'attr2', '', SelectorFlags.CLASS, 'foo'\n * ]\n *\n * See more examples in node_selector_matcher_spec.ts\n */\nexport type CssSelector = (string | SelectorFlags)[];\n\n/**\n * A list of CssSelectors.\n *\n * A directive or component can have multiple selectors. This type is used for\n * directive defs so any of the selectors in the list will match that directive.\n *\n * Original: 'form, [ngForm]'\n * Parsed: [['form'], ['', 'ngForm', '']]\n */\nexport type CssSelectorList = CssSelector[];\n\n/** Flags used to build up CssSelectors */\nexport const enum SelectorFlags {\n /** Indicates this is the beginning of a new negative selector */\n NOT = 0b0001,\n\n /** Mode for matching attributes */\n ATTRIBUTE = 0b0010,\n\n /** Mode for matching tag names */\n ELEMENT = 0b0100,\n\n /** Mode for matching class names */\n CLASS = 0b1000,\n}\n\nexport const NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The goal here is to make sure that the browser DOM API is the Renderer.\n * We do this by defining a subset of DOM API to be the renderer and than\n * use that time for rendering.\n *\n * At runtime we can than use the DOM api directly, in server or web-worker\n * it will be easy to implement such API.\n */\n\nimport {RendererStyleFlags2, RendererType2} from '../../render/api';\n\n\n// TODO: cleanup once the code is merged in angular/angular\nexport enum RendererStyleFlags3 {\n Important = 1 << 0,\n DashCase = 1 << 1\n}\n\nexport type Renderer3 = ObjectOrientedRenderer3 | ProceduralRenderer3;\n\n/**\n * Object Oriented style of API needed to create elements and text nodes.\n *\n * This is the native browser API style, e.g. operations are methods on individual objects\n * like HTMLElement. With this style, no additional code is needed as a facade\n * (reducing payload size).\n * */\nexport interface ObjectOrientedRenderer3 {\n createComment(data: string): RComment;\n createElement(tagName: string): RElement;\n createElementNS(namespace: string, tagName: string): RElement;\n createTextNode(data: string): RText;\n\n querySelector(selectors: string): RElement|null;\n}\n\n/** Returns whether the `renderer` is a `ProceduralRenderer3` */\nexport function isProceduralRenderer(renderer: ProceduralRenderer3 | ObjectOrientedRenderer3):\n renderer is ProceduralRenderer3 {\n return !!((renderer as any).listen);\n}\n\n/**\n * Procedural style of API needed to create elements and text nodes.\n *\n * In non-native browser environments (e.g. platforms such as web-workers), this is the\n * facade that enables element manipulation. This also facilitates backwards compatibility\n * with Renderer2.\n */\nexport interface ProceduralRenderer3 {\n destroy(): void;\n createComment(value: string): RComment;\n createElement(name: string, namespace?: string|null): RElement;\n createText(value: string): RText;\n /**\n * This property is allowed to be null / undefined,\n * in which case the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n destroyNode?: ((node: RNode) => void)|null;\n appendChild(parent: RElement, newChild: RNode): void;\n insertBefore(parent: RNode, newChild: RNode, refChild: RNode|null): void;\n removeChild(parent: RElement, oldChild: RNode): void;\n selectRootElement(selectorOrNode: string|any): RElement;\n\n parentNode(node: RNode): RElement|null;\n nextSibling(node: RNode): RNode|null;\n\n setAttribute(el: RElement, name: string, value: string, namespace?: string|null): void;\n removeAttribute(el: RElement, name: string, namespace?: string|null): void;\n addClass(el: RElement, name: string): void;\n removeClass(el: RElement, name: string): void;\n setStyle(\n el: RElement, style: string, value: any,\n flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n setProperty(el: RElement, name: string, value: any): void;\n setValue(node: RText|RComment, value: string): void;\n\n // TODO(misko): Deprecate in favor of addEventListener/removeEventListener\n listen(target: RNode, eventName: string, callback: (event: any) => boolean | void): () => void;\n}\n\nexport interface RendererFactory3 {\n createRenderer(hostElement: RElement|null, rendererType: RendererType2|null): Renderer3;\n begin?(): void;\n end?(): void;\n}\n\nexport const domRendererFactory3: RendererFactory3 = {\n createRenderer: (hostElement: RElement | null, rendererType: RendererType2 | null):\n Renderer3 => { return document;}\n};\n\n/** Subset of API needed for appending elements and text nodes. */\nexport interface RNode {\n parentNode: RNode|null;\n\n nextSibling: RNode|null;\n\n removeChild(oldChild: RNode): void;\n\n /**\n * Insert a child node.\n *\n * Used exclusively for adding View root nodes into ViewAnchor location.\n */\n insertBefore(newChild: RNode, refChild: RNode|null, isViewRoot: boolean): void;\n\n /**\n * Append a child node.\n *\n * Used exclusively for building up DOM which are static (ie not View roots)\n */\n appendChild(newChild: RNode): RNode;\n}\n\n/**\n * Subset of API needed for writing attributes, properties, and setting up\n * listeners on Element.\n */\nexport interface RElement extends RNode {\n style: RCssStyleDeclaration;\n classList: RDomTokenList;\n className: string;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n addEventListener(type: string, listener: EventListener, useCapture?: boolean): void;\n removeEventListener(type: string, listener?: EventListener, options?: boolean): void;\n\n setProperty?(name: string, value: any): void;\n}\n\nexport interface RCssStyleDeclaration {\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string|null, priority?: string): void;\n}\n\nexport interface RDomTokenList {\n add(token: string): void;\n remove(token: string): void;\n}\n\nexport interface RText extends RNode { textContent: string|null; }\n\nexport interface RComment extends RNode { textContent: string|null; }\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {StylingContext} from './styling';\nimport {LView, TView} from './view';\n\n\n/**\n * TNodeType corresponds to the TNode.type property. It contains information\n * on how to map a particular set of bits in TNode.flags to the node type.\n */\nexport const enum TNodeType {\n Container = 0b000,\n Projection = 0b001,\n View = 0b010,\n Element = 0b011,\n ViewOrElement = 0b010,\n ElementContainer = 0b100,\n IcuContainer = 0b101,\n}\n\n/**\n * Corresponds to the TNode.flags property.\n */\nexport const enum TNodeFlags {\n /** This bit is set if the node is a component */\n isComponent = 0b0001,\n\n /** This bit is set if the node has been projected */\n isProjected = 0b0010,\n\n /** This bit is set if the node has any content queries */\n hasContentQuery = 0b0100,\n\n /** This bit is set if the node has any directives that contain [class properties */\n hasClassInput = 0b1000,\n}\n\n/**\n * Corresponds to the TNode.providerIndexes property.\n */\nexport const enum TNodeProviderIndexes {\n /** The index of the first provider on this node is encoded on the least significant bits */\n ProvidersStartIndexMask = 0b00000000000000001111111111111111,\n\n /** The count of view providers from the component on this node is encoded on the 16 most\n significant bits */\n CptViewProvidersCountShift = 16,\n CptViewProvidersCountShifter = 0b00000000000000010000000000000000,\n}\n/**\n * A set of marker values to be used in the attributes arrays. These markers indicate that some\n * items are not regular attributes and the processing should be adapted accordingly.\n */\nexport const enum AttributeMarker {\n /**\n * Marker indicates that the following 3 values in the attributes array are:\n * namespaceUri, attributeName, attributeValue\n * in that order.\n */\n NamespaceURI = 0,\n\n /**\n * Signals class declaration.\n *\n * Each value following `Classes` designates a class name to include on the element.\n * ## Example:\n *\n * Given:\n * ```\n * <div class=\"foo bar baz\">...<d/vi>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];\n * ```\n */\n Classes = 1,\n\n /**\n * Signals style declaration.\n *\n * Each pair of values following `Styles` designates a style name and value to include on the\n * element.\n * ## Example:\n *\n * Given:\n * ```\n * <div style=\"width:100px; height:200px; color:red\">...</div>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];\n * ```\n */\n Styles = 2,\n\n /**\n * This marker indicates that the following attribute names were extracted from bindings (ex.:\n * [foo]=\"exp\") and / or event handlers (ex. (bar)=\"doSth()\").\n * Taking the above bindings and outputs as an example an attributes array could look as follows:\n * ['class', 'fade in', AttributeMarker.SelectOnly, 'foo', 'bar']\n */\n SelectOnly = 3,\n}\n\n/**\n * A combination of:\n * - attribute names and values\n * - special markers acting as flags to alter attributes processing.\n */\nexport type TAttributes = (string | AttributeMarker)[];\n\n/**\n * Binding data (flyweight) for a particular node that is shared between all templates\n * of a specific type.\n *\n * If a property is:\n * - PropertyAliases: that property's data was generated and this is it\n * - Null: that property's data was already generated and nothing was found.\n * - Undefined: that property's data has not yet been generated\n *\n * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern\n */\nexport interface TNode {\n /** The type of the TNode. See TNodeType. */\n type: TNodeType;\n\n /**\n * Index of the TNode in TView.data and corresponding native element in LView.\n *\n * This is necessary to get from any TNode to its corresponding native element when\n * traversing the node tree.\n *\n * If index is -1, this is a dynamically created container node or embedded view node.\n */\n index: number;\n\n /**\n * The index of the closest injector in this node's LView.\n *\n * If the index === -1, there is no injector on this node or any ancestor node in this view.\n *\n * If the index !== -1, it is the index of this node's injector OR the index of a parent injector\n * in the same view. We pass the parent injector index down the node tree of a view so it's\n * possible to find the parent injector without walking a potentially deep node tree. Injector\n * indices are not set across view boundaries because there could be multiple component hosts.\n *\n * If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent\n * injector.\n */\n injectorIndex: number;\n\n /**\n * Stores starting index of the directives.\n */\n directiveStart: number;\n\n /**\n * Stores final exclusive index of the directives.\n */\n directiveEnd: number;\n\n /**\n * Stores if Node isComponent, isProjected, hasContentQuery and hasClassInput\n */\n flags: TNodeFlags;\n\n /**\n * This number stores two values using its bits:\n *\n * - the index of the first provider on that node (first 16 bits)\n * - the count of view providers from the component on this node (last 16 bits)\n */\n // TODO(misko): break this into actual vars.\n providerIndexes: TNodeProviderIndexes;\n\n /** The tag name associated with this node. */\n tagName: string|null;\n\n /**\n * Attributes associated with an element. We need to store attributes to support various use-cases\n * (attribute injection, content projection with selectors, directives matching).\n * Attributes are stored statically because reading them from the DOM would be way too slow for\n * content projection and queries.\n *\n * Since attrs will always be calculated first, they will never need to be marked undefined by\n * other instructions.\n *\n * For regular attributes a name of an attribute and its value alternate in the array.\n * e.g. ['role', 'checkbox']\n * This array can contain flags that will indicate \"special attributes\" (attributes with\n * namespaces, attributes extracted from bindings and outputs).\n */\n attrs: TAttributes|null;\n\n /**\n * A set of local names under which a given element is exported in a template and\n * visible to queries. An entry in this array can be created for different reasons:\n * - an element itself is referenced, ex.: `<div #foo>`\n * - a component is referenced, ex.: `<my-cmpt #foo>`\n * - a directive is referenced, ex.: `<my-cmpt #foo=\"directiveExportAs\">`.\n *\n * A given element might have different local names and those names can be associated\n * with a directive. We store local names at even indexes while odd indexes are reserved\n * for directive index in a view (or `-1` if there is no associated directive).\n *\n * Some examples:\n * - `<div #foo>` => `[\"foo\", -1]`\n * - `<my-cmpt #foo>` => `[\"foo\", myCmptIdx]`\n * - `<my-cmpt #foo #bar=\"directiveExportAs\">` => `[\"foo\", myCmptIdx, \"bar\", directiveIdx]`\n * - `<div #foo #bar=\"directiveExportAs\">` => `[\"foo\", -1, \"bar\", directiveIdx]`\n */\n localNames: (string|number)[]|null;\n\n /** Information about input properties that need to be set once from attribute data. */\n initialInputs: InitialInputData|null|undefined;\n\n /**\n * Input data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no inputs have been found.\n */\n inputs: PropertyAliases|null|undefined;\n\n /**\n * Output data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no outputs have been found.\n */\n outputs: PropertyAliases|null|undefined;\n\n /**\n * The TView or TViews attached to this node.\n *\n * If this TNode corresponds to an LContainer with inline views, the container will\n * need to store separate static data for each of its view blocks (TView[]). Otherwise,\n * nodes in inline views with the same index as nodes in their parent views will overwrite\n * each other, as they are in the same template.\n *\n * Each index in this array corresponds to the static data for a certain\n * view. So if you had V(0) and V(1) in a container, you might have:\n *\n * [\n * [{tagName: 'div', attrs: ...}, null], // V(0) TView\n * [{tagName: 'button', attrs ...}, null] // V(1) TView\n *\n * If this TNode corresponds to an LContainer with a template (e.g. structural\n * directive), the template's TView will be stored here.\n *\n * If this TNode corresponds to an element, tViews will be null .\n */\n tViews: TView|TView[]|null;\n\n /**\n * The next sibling node. Necessary so we can propagate through the root nodes of a view\n * to insert them or remove them from the DOM.\n */\n next: TNode|null;\n\n /**\n * First child of the current node.\n *\n * For component nodes, the child will always be a ContentChild (in same view).\n * For embedded view nodes, the child will be in their child view.\n */\n child: TNode|null;\n\n /**\n * Parent node (in the same view only).\n *\n * We need a reference to a node's parent so we can append the node to its parent's native\n * element at the appropriate time.\n *\n * If the parent would be in a different view (e.g. component host), this property will be null.\n * It's important that we don't try to cross component boundaries when retrieving the parent\n * because the parent will change (e.g. index, attrs) depending on where the component was\n * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through\n * LView.node instead (which will be instance-specific).\n *\n * If this is an inline view node (V), the parent will be its container.\n */\n parent: TElementNode|TContainerNode|null;\n\n /**\n * If this node is part of an i18n block, it indicates whether this node is part of the DOM.\n * If this node is not part of an i18n block, this field is null.\n */\n detached: boolean|null;\n\n stylingTemplate: StylingContext|null;\n /**\n * List of projected TNodes for a given component host element OR index into the said nodes.\n *\n * For easier discussion assume this example:\n * `<parent>`'s view definition:\n * ```\n * <child id=\"c1\">content1</child>\n * <child id=\"c2\"><span>content2</span></child>\n * ```\n * `<child>`'s view definition:\n * ```\n * <ng-content id=\"cont1\"></ng-content>\n * ```\n *\n * If `Array.isArray(projection)` then `TNode` is a host element:\n * - `projection` stores the content nodes which are to be projected.\n * - The nodes represent categories defined by the selector: For example:\n * `<ng-content/><ng-content select=\"abc\"/>` would represent the heads for `<ng-content/>`\n * and `<ng-content select=\"abc\"/>` respectively.\n * - The nodes we store in `projection` are heads only, we used `.next` to get their\n * siblings.\n * - The nodes `.next` is sorted/rewritten as part of the projection setup.\n * - `projection` size is equal to the number of projections `<ng-content>`. The size of\n * `c1` will be `1` because `<child>` has only one `<ng-content>`.\n * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)\n * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and as\n * a result have different set of nodes to project.\n * - without `projection` it would be difficult to efficiently traverse nodes to be projected.\n *\n * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:\n * - `projection` is an index of the host's `projection`Nodes.\n * - This would return the first head node to project:\n * `getHost(currentTNode).projection[currentTNode.projection]`.\n * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case\n * the process is recursive in nature (not implementation).\n */\n projection: (TNode|null)[]|number|null;\n}\n\n/** Static data for an element */\nexport interface TElementNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: TElementNode|TTextNode|TElementContainerNode|TContainerNode|TProjectionNode|null;\n /**\n * Element nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using viewData[HOST_NODE]).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n\n /**\n * If this is a component TNode with projection, this will be an array of projected\n * TNodes (see TNode.projection for more info). If it's a regular element node or a\n * component without projection, it will be null.\n */\n projection: (TNode|null)[]|null;\n}\n\n/** Static data for a text node */\nexport interface TTextNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: null;\n /**\n * Text nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LContainer */\nexport interface TContainerNode extends TNode {\n /**\n * Index in the data[] array.\n *\n * If it's -1, this is a dynamically created container node that isn't stored in\n * data[] (e.g. when you inject ViewContainerRef) .\n */\n index: number;\n child: null;\n\n /**\n * Container nodes will have parents unless:\n *\n * - They are the first node of a component or embedded view\n * - They are dynamically created\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: TView|TView[]|null;\n projection: null;\n}\n\n/** Static data for an <ng-container> */\nexport interface TElementContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode|TTextNode|TContainerNode|TElementContainerNode|TProjectionNode|null;\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an ICU expression */\nexport interface TIcuContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode|TTextNode|null;\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n /**\n * Indicates the current active case for an ICU expression.\n * It is null when there is no active case.\n */\n activeCaseIndex: number|null;\n}\n\n/** Static data for a view */\nexport interface TViewNode extends TNode {\n /** If -1, it's a dynamically created view. Otherwise, it is the view block ID. */\n index: number;\n child: TElementNode|TTextNode|TElementContainerNode|TContainerNode|TProjectionNode|null;\n parent: TContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LProjectionNode */\nexport interface TProjectionNode extends TNode {\n /** Index in the data[] array */\n child: null;\n /**\n * Projection nodes will have parents unless they are the first node of a component\n * or embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n\n /** Index of the projection node. (See TNode.projection for more info.) */\n projection: number;\n}\n\n/**\n * This mapping is necessary so we can set input properties and output listeners\n * properly at runtime when property names are minified or aliased.\n *\n * Key: unminified / public input or output name\n * Value: array containing minified / internal name and related directive index\n *\n * The value must be an array to support inputs and outputs with the same name\n * on the same node.\n */\nexport type PropertyAliases = {\n // This uses an object map because using the Map type would be too slow\n [key: string]: PropertyAliasValue\n};\n\n/**\n * Store the runtime input or output names for all the directives.\n *\n * - Even indices: directive index\n * - Odd indices: minified / internal name\n *\n * e.g. [0, 'change-minified']\n */\nexport type PropertyAliasValue = (number | string)[];\n\n\n/**\n * This array contains information about input properties that\n * need to be set once from attribute data. It's ordered by\n * directive index (relative to element) so it's simple to\n * look up a specific directive's initial input data.\n *\n * Within each sub-array:\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * If a directive on a node does not have any input properties\n * that should be set from attributes, its index is set to null\n * to avoid a sparse array.\n *\n * e.g. [null, ['role-min', 'button']]\n */\nexport type InitialInputData = (InitialInputs | null)[];\n\n/**\n * Used by InitialInputData to store input properties\n * that should be set once from attributes.\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * e.g. ['role-min', 'button']\n */\nexport type InitialInputs = string[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n\n/**\n * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.\n */\nexport type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;\n\n/**\n * Type for a function that extracts a value for a local refs.\n * Example:\n * - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;\n * - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;\n */\nexport type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {callHooks} from './hooks';\nimport {LContainer, NATIVE, RENDER_PARENT, VIEWS, unusedValueExportToPlacateAjd as unused1} from './interfaces/container';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeType, TViewNode, unusedValueExportToPlacateAjd as unused2} from './interfaces/node';\nimport {unusedValueExportToPlacateAjd as unused3} from './interfaces/projection';\nimport {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, isProceduralRenderer, unusedValueExportToPlacateAjd as unused4} from './interfaces/renderer';\nimport {CLEANUP, CONTAINER_INDEX, FLAGS, HEADER_OFFSET, HOST_NODE, HookData, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, TVIEW, unusedValueExportToPlacateAjd as unused5} from './interfaces/view';\nimport {assertNodeType} from './node_assert';\nimport {findComponentView, getNativeByTNode, isLContainer, isRootView, readElementValue, stringify} from './util';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4 + unused5;\n\n/** Retrieves the parent element of a given node. */\nexport function getParentNative(tNode: TNode, currentView: LView): RElement|RComment|null {\n if (tNode.parent == null) {\n return getHostNative(currentView);\n } else {\n const parentTNode = getFirstParentNative(tNode);\n return getNativeByTNode(parentTNode, currentView);\n }\n}\n\n/**\n * Get the first parent of a node that isn't an IcuContainer TNode\n */\nfunction getFirstParentNative(tNode: TNode): TNode {\n let parent = tNode.parent;\n while (parent && parent.type === TNodeType.IcuContainer) {\n parent = parent.parent;\n }\n return parent !;\n}\n\n/**\n * Gets the host element given a view. Will return null if the current view is an embedded view,\n * which does not have a host element.\n */\nexport function getHostNative(currentView: LView): RElement|null {\n const hostTNode = currentView[HOST_NODE] as TElementNode;\n return hostTNode && hostTNode.type !== TNodeType.View ?\n (getNativeByTNode(hostTNode, currentView[PARENT] !) as RElement) :\n null;\n}\n\nexport function getLContainer(tNode: TViewNode, embeddedView: LView): LContainer|null {\n if (tNode.index === -1) {\n // This is a dynamically created view inside a dynamic container.\n // If the host index is -1, the view has not yet been inserted, so it has no parent.\n const containerHostIndex = embeddedView[CONTAINER_INDEX];\n return containerHostIndex > -1 ? embeddedView[PARENT] ![containerHostIndex] : null;\n } else {\n // This is a inline view node (e.g. embeddedViewStart)\n return embeddedView[PARENT] ![tNode.parent !.index] as LContainer;\n }\n}\n\n\n/**\n * Retrieves render parent for a given view.\n * Might be null if a view is not yet attached to any container.\n */\nexport function getContainerRenderParent(tViewNode: TViewNode, view: LView): RElement|null {\n const container = getLContainer(tViewNode, view);\n return container ? container[RENDER_PARENT] : null;\n}\n\nconst enum WalkTNodeTreeAction {\n /** node insert in the native environment */\n Insert = 0,\n\n /** node detach from the native environment */\n Detach = 1,\n\n /** node destruction using the renderer's API */\n Destroy = 2,\n}\n\n\n/**\n * Stack used to keep track of projection nodes in walkTNodeTree.\n *\n * This is deliberately created outside of walkTNodeTree to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: (LView | TNode)[] = [];\n\n/**\n * Walks a tree of TNodes, applying a transformation on the element nodes, either only on the first\n * one found, or on all of them.\n *\n * @param viewToWalk the view to walk\n * @param action identifies the action to be performed on the elements\n * @param renderer the current renderer.\n * @param renderParent Optional the render parent node to be set in all LContainers found,\n * required for action modes Insert and Destroy.\n * @param beforeNode Optional the node before which elements should be added, required for action\n * Insert.\n */\nfunction walkTNodeTree(\n viewToWalk: LView, action: WalkTNodeTreeAction, renderer: Renderer3,\n renderParent: RElement | null, beforeNode?: RNode | null) {\n const rootTNode = viewToWalk[TVIEW].node as TViewNode;\n let projectionNodeIndex = -1;\n let currentView = viewToWalk;\n let tNode: TNode|null = rootTNode.child as TNode;\n while (tNode) {\n let nextTNode: TNode|null = null;\n if (tNode.type === TNodeType.Element) {\n executeNodeAction(\n action, renderer, renderParent, getNativeByTNode(tNode, currentView), beforeNode);\n const nodeOrContainer = currentView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n // This element has an LContainer, and its comment needs to be handled\n executeNodeAction(action, renderer, renderParent, nodeOrContainer[NATIVE], beforeNode);\n }\n } else if (tNode.type === TNodeType.Container) {\n const lContainer = currentView ![tNode.index] as LContainer;\n executeNodeAction(action, renderer, renderParent, lContainer[NATIVE], beforeNode);\n\n if (renderParent) lContainer[RENDER_PARENT] = renderParent;\n\n if (lContainer[VIEWS].length) {\n currentView = lContainer[VIEWS][0];\n nextTNode = currentView[TVIEW].node;\n\n // When the walker enters a container, then the beforeNode has to become the local native\n // comment node.\n beforeNode = lContainer[NATIVE];\n }\n } else if (tNode.type === TNodeType.Projection) {\n const componentView = findComponentView(currentView !);\n const componentHost = componentView[HOST_NODE] as TElementNode;\n const head: TNode|null =\n (componentHost.projection as(TNode | null)[])[tNode.projection as number];\n\n // Must store both the TNode and the view because this projection node could be nested\n // deeply inside embedded views, and we need to get back down to this particular nested view.\n projectionNodeStack[++projectionNodeIndex] = tNode;\n projectionNodeStack[++projectionNodeIndex] = currentView !;\n if (head) {\n currentView = componentView[PARENT] !;\n nextTNode = currentView[TVIEW].data[head.index] as TNode;\n }\n } else {\n // Otherwise, this is a View or an ElementContainer\n nextTNode = tNode.child;\n }\n\n if (nextTNode === null) {\n // this last node was projected, we need to get back down to its projection node\n if (tNode.next === null && (tNode.flags & TNodeFlags.isProjected)) {\n currentView = projectionNodeStack[projectionNodeIndex--] as LView;\n tNode = projectionNodeStack[projectionNodeIndex--] as TNode;\n }\n nextTNode = tNode.next;\n\n /**\n * Find the next node in the TNode tree, taking into account the place where a node is\n * projected (in the shadow DOM) rather than where it comes from (in the light DOM).\n *\n * If there is no sibling node, then it goes to the next sibling of the parent node...\n * until it reaches rootNode (at which point null is returned).\n */\n while (!nextTNode) {\n // If parent is null, we're crossing the view boundary, so we should get the host TNode.\n tNode = tNode.parent || currentView[TVIEW].node;\n\n if (tNode === null || tNode === rootTNode) return null;\n\n // When exiting a container, the beforeNode must be restored to the previous value\n if (tNode.type === TNodeType.Container) {\n currentView = currentView[PARENT] !;\n beforeNode = currentView[tNode.index][NATIVE];\n }\n\n if (tNode.type === TNodeType.View && currentView[NEXT]) {\n currentView = currentView[NEXT] as LView;\n nextTNode = currentView[TVIEW].node;\n } else {\n nextTNode = tNode.next;\n }\n }\n }\n tNode = nextTNode;\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction executeNodeAction(\n action: WalkTNodeTreeAction, renderer: Renderer3, parent: RElement | null,\n node: RComment | RElement | RText, beforeNode?: RNode | null) {\n if (action === WalkTNodeTreeAction.Insert) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).insertBefore(parent !, node, beforeNode as RNode | null) :\n parent !.insertBefore(node, beforeNode as RNode | null, true);\n } else if (action === WalkTNodeTreeAction.Detach) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).removeChild(parent !, node) :\n parent !.removeChild(node);\n } else if (action === WalkTNodeTreeAction.Destroy) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n (renderer as ProceduralRenderer3).destroyNode !(node);\n }\n}\n\nexport function createTextNode(value: any, renderer: Renderer3): RText {\n return isProceduralRenderer(renderer) ? renderer.createText(stringify(value)) :\n renderer.createTextNode(stringify(value));\n}\n\n/**\n * Adds or removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param viewToWalk The view from which elements should be added or removed\n * @param insertMode Whether or not elements should be added (if false, removing)\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nexport function addRemoveViewFromContainer(\n viewToWalk: LView, insertMode: true, beforeNode: RNode | null): void;\nexport function addRemoveViewFromContainer(viewToWalk: LView, insertMode: false): void;\nexport function addRemoveViewFromContainer(\n viewToWalk: LView, insertMode: boolean, beforeNode?: RNode | null): void {\n const renderParent = getContainerRenderParent(viewToWalk[TVIEW].node as TViewNode, viewToWalk);\n ngDevMode && assertNodeType(viewToWalk[TVIEW].node as TNode, TNodeType.View);\n if (renderParent) {\n const renderer = viewToWalk[RENDERER];\n walkTNodeTree(\n viewToWalk, insertMode ? WalkTNodeTreeAction.Insert : WalkTNodeTreeAction.Detach, renderer,\n renderParent, beforeNode);\n }\n}\n\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nexport function destroyViewTree(rootView: LView): void {\n // If the view has no children, we can clean it up and return early.\n if (rootView[TVIEW].childIndex === -1) {\n return cleanUpView(rootView);\n }\n let viewOrContainer: LView|LContainer|null = getLViewChild(rootView);\n\n while (viewOrContainer) {\n let next: LView|LContainer|null = null;\n\n if (viewOrContainer.length >= HEADER_OFFSET) {\n // If LView, traverse down to child.\n const view = viewOrContainer as LView;\n if (view[TVIEW].childIndex > -1) next = getLViewChild(view);\n } else {\n // If container, traverse down to its first LView.\n const container = viewOrContainer as LContainer;\n if (container[VIEWS].length) next = container[VIEWS][0];\n }\n\n if (next == null) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (viewOrContainer && !viewOrContainer ![NEXT] && viewOrContainer !== rootView) {\n cleanUpView(viewOrContainer);\n viewOrContainer = getParentState(viewOrContainer, rootView);\n }\n cleanUpView(viewOrContainer || rootView);\n next = viewOrContainer && viewOrContainer ![NEXT];\n }\n viewOrContainer = next;\n }\n}\n\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param parentView The new parent of the inserted view\n * @param index The index at which to insert the view\n * @param containerIndex The index of the container node, if dynamic\n */\nexport function insertView(\n lView: LView, lContainer: LContainer, parentView: LView, index: number,\n containerIndex: number) {\n const views = lContainer[VIEWS];\n\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n views[index - 1][NEXT] = lView;\n }\n\n if (index < views.length) {\n lView[NEXT] = views[index];\n views.splice(index, 0, lView);\n } else {\n views.push(lView);\n lView[NEXT] = null;\n }\n\n // Dynamically inserted views need a reference to their parent container's host so it's\n // possible to jump from a view to its container's next when walking the node tree.\n if (containerIndex > -1) {\n lView[CONTAINER_INDEX] = containerIndex;\n lView[PARENT] = parentView;\n }\n\n // Notify query that a new view has been added\n if (lView[QUERIES]) {\n lView[QUERIES] !.insertView(index);\n }\n\n // Sets the attached flag\n lView[FLAGS] |= LViewFlags.Attached;\n}\n\n/**\n * Detaches a view from a container.\n *\n * This method splices the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @param detached Whether or not this view is already detached.\n * @returns Detached LView instance.\n */\nexport function detachView(lContainer: LContainer, removeIndex: number, detached: boolean): LView {\n const views = lContainer[VIEWS];\n const viewToDetach = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1][NEXT] = viewToDetach[NEXT] as LView;\n }\n views.splice(removeIndex, 1);\n if (!detached) {\n addRemoveViewFromContainer(viewToDetach, false);\n }\n\n if (viewToDetach[QUERIES]) {\n viewToDetach[QUERIES] !.removeView();\n }\n viewToDetach[CONTAINER_INDEX] = -1;\n viewToDetach[PARENT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~LViewFlags.Attached;\n return viewToDetach;\n}\n\n/**\n * Removes a view from a container, i.e. detaches it and then destroys the underlying LView.\n *\n * @param lContainer The container from which to remove a view\n * @param tContainer The TContainer node associated with the LContainer\n * @param removeIndex The index of the view to remove\n */\nexport function removeView(\n lContainer: LContainer, containerHost: TElementNode | TContainerNode | TElementContainerNode,\n removeIndex: number) {\n const view = lContainer[VIEWS][removeIndex];\n detachView(lContainer, removeIndex, !!containerHost.detached);\n destroyLView(view);\n}\n\n/** Gets the child of the given LView */\nexport function getLViewChild(lView: LView): LView|LContainer|null {\n const childIndex = lView[TVIEW].childIndex;\n return childIndex === -1 ? null : lView[childIndex];\n}\n\n/**\n * A standalone function which destroys an LView,\n * conducting cleanup (e.g. removing listeners, calling onDestroys).\n *\n * @param view The view to be destroyed.\n */\nexport function destroyLView(view: LView) {\n const renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkTNodeTree(view, WalkTNodeTreeAction.Destroy, renderer, null);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= LViewFlags.Destroyed;\n}\n\n/**\n * Determines which LViewOrLContainer to jump to when traversing back up the\n * tree in destroyViewTree.\n *\n * Normally, the view's parent LView should be checked, but in the case of\n * embedded views, the container (which is the view node's parent, but not the\n * LView's parent) needs to be checked for a possible next property.\n *\n * @param state The LViewOrLContainer for which we need a parent state\n * @param rootView The rootView, so we don't propagate too far up the view tree\n * @returns The correct parent LViewOrLContainer\n */\nexport function getParentState(state: LView | LContainer, rootView: LView): LView|LContainer|null {\n let tNode;\n if (state.length >= HEADER_OFFSET && (tNode = (state as LView) ![HOST_NODE]) &&\n tNode.type === TNodeType.View) {\n // if it's an embedded view, the state needs to go up to the container, in case the\n // container has a next\n return getLContainer(tNode as TViewNode, state as LView) as LContainer;\n } else {\n // otherwise, use parent view for containers or component views\n return state[PARENT] === rootView ? null : state[PARENT];\n }\n}\n\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param view The LView to clean up\n */\nfunction cleanUpView(viewOrContainer: LView | LContainer): void {\n if ((viewOrContainer as LView).length >= HEADER_OFFSET) {\n const view = viewOrContainer as LView;\n executeOnDestroys(view);\n executePipeOnDestroys(view);\n removeListeners(view);\n const hostTNode = view[HOST_NODE];\n // For component views only, the local renderer is destroyed as clean up time.\n if (hostTNode && hostTNode.type === TNodeType.Element && isProceduralRenderer(view[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n (view[RENDERER] as ProceduralRenderer3).destroy();\n }\n }\n}\n\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction removeListeners(lView: LView): void {\n const tCleanup = lView[TVIEW].cleanup !;\n if (tCleanup != null) {\n const lCleanup = lView[CLEANUP] !;\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a listener with the native renderer\n const idx = tCleanup[i + 1];\n const listener = lCleanup[tCleanup[i + 2]];\n const native = readElementValue(lView[idx]);\n const useCaptureOrSubIdx = tCleanup[i + 3];\n if (typeof useCaptureOrSubIdx === 'boolean') {\n // DOM listener\n native.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);\n } else {\n if (useCaptureOrSubIdx >= 0) {\n // unregister\n lCleanup[useCaptureOrSubIdx]();\n } else {\n // Subscription\n lCleanup[-useCaptureOrSubIdx].unsubscribe();\n }\n }\n i += 2;\n } else if (typeof tCleanup[i] === 'number') {\n // This is a listener with renderer2 (cleanup fn can be found by index)\n const cleanupFn = lCleanup[tCleanup[i]];\n cleanupFn();\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n lView[CLEANUP] = null;\n }\n}\n\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(view: LView): void {\n const tView = view[TVIEW];\n let destroyHooks: HookData|null;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n callHooks(view, destroyHooks);\n }\n}\n\n/** Calls pipe destroy hooks for this view */\nfunction executePipeOnDestroys(lView: LView): void {\n const pipeDestroyHooks = lView[TVIEW] && lView[TVIEW].pipeDestroyHooks;\n if (pipeDestroyHooks) {\n callHooks(lView !, pipeDestroyHooks);\n }\n}\n\nexport function getRenderParent(tNode: TNode, currentView: LView): RElement|null {\n if (canInsertNativeNode(tNode, currentView)) {\n // If we are asked for a render parent of the root component we need to do low-level DOM\n // operation as LTree doesn't exist above the topmost host node. We might need to find a render\n // parent of the topmost host node if the root component injects ViewContainerRef.\n if (isRootView(currentView)) {\n return nativeParentNode(currentView[RENDERER], getNativeByTNode(tNode, currentView));\n }\n\n const hostTNode = currentView[HOST_NODE];\n\n const tNodeParent = tNode.parent;\n if (tNodeParent != null && tNodeParent.type === TNodeType.ElementContainer) {\n tNode = getHighestElementContainer(tNodeParent);\n }\n\n return tNode.parent == null && hostTNode !.type === TNodeType.View ?\n getContainerRenderParent(hostTNode as TViewNode, currentView) :\n getParentNative(tNode, currentView) as RElement;\n }\n return null;\n}\n\nfunction canInsertNativeChildOfElement(tNode: TNode): boolean {\n // If the parent is null, then we are inserting across views. This happens when we\n // insert a root element of the component view into the component host element and it\n // should always be eager.\n if (tNode.parent == null ||\n // We should also eagerly insert if the parent is a regular, non-component element\n // since we know that this relationship will never be broken.\n tNode.parent.type === TNodeType.Element && !(tNode.parent.flags & TNodeFlags.isComponent)) {\n return true;\n }\n\n // Parent is a Component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would than move it to its final destination.\n return false;\n}\n\n/**\n * We might delay insertion of children for a given view if it is disconnected.\n * This might happen for 2 main reasons:\n * - view is not inserted into any container (view was created but not inserted yet)\n * - view is inserted into a container but the container itself is not inserted into the DOM\n * (container might be part of projection or child of a view that is not inserted yet).\n *\n * In other words we can insert children of a given view if this view was inserted into a container\n * and\n * the container itself has its render parent determined.\n */\nfunction canInsertNativeChildOfView(viewTNode: TViewNode, view: LView): boolean {\n // Because we are inserting into a `View` the `View` may be disconnected.\n const container = getLContainer(viewTNode, view) !;\n if (container == null || container[RENDER_PARENT] == null) {\n // The `View` is not inserted into a `Container` or the parent `Container`\n // itself is disconnected. So we have to delay.\n return false;\n }\n\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n}\n\n/**\n * Returns whether a native element can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is mare for projection but has not been inserted\n * into destination.\n *\n\n *\n * @param tNode The tNode of the node that we want to insert.\n * @param currentView Current LView being processed.\n * @return boolean Whether the node should be inserted now (or delayed until later).\n */\nexport function canInsertNativeNode(tNode: TNode, currentView: LView): boolean {\n let currentNode = tNode;\n let parent: TNode|null = tNode.parent;\n\n if (tNode.parent) {\n if (tNode.parent.type === TNodeType.ElementContainer) {\n currentNode = getHighestElementContainer(tNode);\n parent = currentNode.parent;\n } else if (tNode.parent.type === TNodeType.IcuContainer) {\n currentNode = getFirstParentNative(currentNode);\n parent = currentNode.parent;\n }\n }\n if (parent === null) parent = currentView[HOST_NODE];\n\n if (parent && parent.type === TNodeType.View) {\n return canInsertNativeChildOfView(parent as TViewNode, currentView);\n } else {\n // Parent is a regular element or a component\n return canInsertNativeChildOfElement(currentNode);\n }\n}\n\n/**\n * Inserts a native node before another native node for a given parent using {@link Renderer3}.\n * This is a utility function that can be used when native nodes were determined - it abstracts an\n * actual renderer being used.\n */\nexport function nativeInsertBefore(\n renderer: Renderer3, parent: RElement, child: RNode, beforeNode: RNode | null): void {\n if (isProceduralRenderer(renderer)) {\n renderer.insertBefore(parent, child, beforeNode);\n } else {\n parent.insertBefore(child, beforeNode, true);\n }\n}\n\n/**\n * Returns a native parent of a given native node.\n */\nexport function nativeParentNode(renderer: Renderer3, node: RNode): RElement|null {\n return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode) as RElement;\n}\n\n/**\n * Returns a native sibling of a given native node.\n */\nexport function nativeNextSibling(renderer: Renderer3, node: RNode): RNode|null {\n return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;\n}\n\n/**\n * Appends the `child` element to the `parent`.\n *\n * The element insertion might be delayed {@link canInsertNativeNode}.\n *\n * @param childEl The child that should be appended\n * @param childTNode The TNode of the child element\n * @param currentView The current LView\n * @returns Whether or not the child was appended\n */\nexport function appendChild(\n childEl: RNode | null = null, childTNode: TNode, currentView: LView): boolean {\n if (childEl !== null && canInsertNativeNode(childTNode, currentView)) {\n const renderer = currentView[RENDERER];\n const parentEl = getParentNative(childTNode, currentView);\n const parentTNode: TNode = childTNode.parent || currentView[HOST_NODE] !;\n\n if (parentTNode.type === TNodeType.View) {\n const lContainer = getLContainer(parentTNode as TViewNode, currentView) as LContainer;\n const views = lContainer[VIEWS];\n const index = views.indexOf(currentView);\n nativeInsertBefore(\n renderer, lContainer[RENDER_PARENT] !, childEl,\n getBeforeNodeForView(index, views, lContainer[NATIVE]));\n } else if (parentTNode.type === TNodeType.ElementContainer) {\n const renderParent = getRenderParent(childTNode, currentView) !;\n nativeInsertBefore(renderer, renderParent, childEl, parentEl);\n } else if (parentTNode.type === TNodeType.IcuContainer) {\n const icuAnchorNode = getNativeByTNode(childTNode.parent !, currentView) !as RElement;\n nativeInsertBefore(renderer, parentEl as RElement, childEl, icuAnchorNode);\n } else {\n isProceduralRenderer(renderer) ? renderer.appendChild(parentEl !as RElement, childEl) :\n parentEl !.appendChild(childEl);\n }\n return true;\n }\n return false;\n}\n\n/**\n * Gets the top-level ng-container if ng-containers are nested.\n *\n * @param ngContainer The TNode of the starting ng-container\n * @returns tNode The TNode of the highest level ng-container\n */\nfunction getHighestElementContainer(ngContainer: TNode): TNode {\n while (ngContainer.parent != null && ngContainer.parent.type === TNodeType.ElementContainer) {\n ngContainer = ngContainer.parent;\n }\n return ngContainer;\n}\n\nexport function getBeforeNodeForView(index: number, views: LView[], containerNative: RComment) {\n if (index + 1 < views.length) {\n const view = views[index + 1] as LView;\n const viewTNode = view[HOST_NODE] as TViewNode;\n return viewTNode.child ? getNativeByTNode(viewTNode.child, view) : containerNative;\n } else {\n return containerNative;\n }\n}\n\n/**\n * Removes the `child` element from the DOM if not in view and not projected.\n *\n * @param childTNode The TNode of the child to remove\n * @param childEl The child that should be removed\n * @param currentView The current LView\n * @returns Whether or not the child was removed\n */\nexport function removeChild(childTNode: TNode, childEl: RNode | null, currentView: LView): boolean {\n // We only remove the element if not in View or not projected.\n if (childEl !== null && canInsertNativeNode(childTNode, currentView)) {\n const parentNative = getParentNative(childTNode, currentView) !as RElement;\n const renderer = currentView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.removeChild(parentNative as RElement, childEl) :\n parentNative !.removeChild(childEl);\n return true;\n }\n return false;\n}\n\n/**\n * Appends a projected node to the DOM, or in the case of a projected container,\n * appends the nodes from all of the container's active views to the DOM.\n *\n * @param projectedTNode The TNode to be projected\n * @param tProjectionNode The projection (ng-content) TNode\n * @param currentView Current LView\n * @param projectionView Projection view (view above current)\n */\nexport function appendProjectedNode(\n projectedTNode: TNode, tProjectionNode: TNode, currentView: LView,\n projectionView: LView): void {\n const native = getNativeByTNode(projectedTNode, projectionView);\n appendChild(native, tProjectionNode, currentView);\n\n // the projected contents are processed while in the shadow view (which is the currentView)\n // therefore we need to extract the view where the host element lives since it's the\n // logical container of the content projected views\n attachPatchData(native, projectionView);\n\n const renderParent = getRenderParent(tProjectionNode, currentView);\n\n const nodeOrContainer = projectionView[projectedTNode.index];\n if (projectedTNode.type === TNodeType.Container) {\n // The node we are adding is a container and we are adding it to an element which\n // is not a component (no more re-projection).\n // Alternatively a container is projected at the root of a component's template\n // and can't be re-projected (as not content of any component).\n // Assign the final projection location in those cases.\n nodeOrContainer[RENDER_PARENT] = renderParent;\n const views = nodeOrContainer[VIEWS];\n for (let i = 0; i < views.length; i++) {\n addRemoveViewFromContainer(views[i], true, nodeOrContainer[NATIVE]);\n }\n } else {\n if (projectedTNode.type === TNodeType.ElementContainer) {\n let ngContainerChildTNode: TNode|null = projectedTNode.child as TNode;\n while (ngContainerChildTNode) {\n appendProjectedNode(ngContainerChildTNode, tProjectionNode, currentView, projectionView);\n ngContainerChildTNode = ngContainerChildTNode.next;\n }\n }\n\n if (isLContainer(nodeOrContainer)) {\n nodeOrContainer[RENDER_PARENT] = renderParent;\n appendChild(nodeOrContainer[NATIVE], tProjectionNode, currentView);\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {assertDefined, assertNotEqual} from './assert';\nimport {AttributeMarker, TAttributes, TNode, TNodeType, unusedValueExportToPlacateAjd as unused1} from './interfaces/node';\nimport {CssSelector, CssSelectorList, NG_PROJECT_AS_ATTR_NAME, SelectorFlags, unusedValueExportToPlacateAjd as unused2} from './interfaces/projection';\n\nconst unusedValueToPlacateAjd = unused1 + unused2;\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n\nfunction isCssClassMatching(nodeClassAttrVal: string, cssClassToMatch: string): boolean {\n const nodeClassesLen = nodeClassAttrVal.length;\n const matchIndex = nodeClassAttrVal !.indexOf(cssClassToMatch);\n const matchEndIdx = matchIndex + cssClassToMatch.length;\n if (matchIndex === -1 // no match\n || (matchIndex > 0 && nodeClassAttrVal ![matchIndex - 1] !== ' ') // no space before\n ||\n (matchEndIdx < nodeClassesLen && nodeClassAttrVal ![matchEndIdx] !== ' ')) // no space after\n {\n return false;\n }\n return true;\n}\n\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be perfomed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode. In \"projection\" mode, we do not need to check types, so if tag name\n * matches selector, we declare a match. In \"directive matching\" mode, we also check whether tNode\n * is of expected type:\n * - whether tNode has either Element or ElementContainer type\n * - or if we want to match \"ng-template\" tag, we check for Container type\n */\nfunction hasTagAndTypeMatch(\n tNode: TNode, currentSelector: string, isProjectionMode: boolean): boolean {\n return currentSelector === tNode.tagName &&\n (isProjectionMode ||\n (tNode.type === TNodeType.Element || tNode.type === TNodeType.ElementContainer) ||\n (tNode.type === TNodeType.Container && currentSelector === NG_TEMPLATE_SELECTOR));\n}\n\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param node static data to match\n * @param selector\n * @returns true if node matches the selector.\n */\nexport function isNodeMatchingSelector(\n tNode: TNode, selector: CssSelector, isProjectionMode: boolean): boolean {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n\n let mode: SelectorFlags = SelectorFlags.ELEMENT;\n const nodeAttrs = tNode.attrs !;\n const selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(AttributeMarker.SelectOnly) : -1;\n\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current as number)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = (current as number) | (mode & SelectorFlags.NOT);\n continue;\n }\n\n if (skipToNextSelector) continue;\n\n if (mode & SelectorFlags.ELEMENT) {\n mode = SelectorFlags.ATTRIBUTE | mode & SelectorFlags.NOT;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||\n current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const attrName = mode & SelectorFlags.CLASS ? 'class' : current;\n const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);\n\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n\n const selectorAttrValue = mode & SelectorFlags.CLASS ? current : selector[++i];\n if (selectorAttrValue !== '') {\n let nodeAttrValue: string;\n const maybeAttrName = nodeAttrs[attrIndexInNode];\n if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(\n maybeAttrName, AttributeMarker.NamespaceURI,\n 'We do not match directives on namespaced attributes');\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1] as string;\n }\n if (mode & SelectorFlags.CLASS &&\n !isCssClassMatching(nodeAttrValue as string, selectorAttrValue as string) ||\n mode & SelectorFlags.ATTRIBUTE && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n\n return isPositive(mode) || skipToNextSelector;\n}\n\nfunction isPositive(mode: SelectorFlags): boolean {\n return (mode & SelectorFlags.NOT) === 0;\n}\n\n/**\n * Examines an attributes definition array from a node to find the index of the\n * attribute with the specified name.\n *\n * NOTE: Will not find namespaced attributes.\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n */\nfunction findAttrIndexInNode(name: string, attrs: TAttributes | null): number {\n if (attrs === null) return -1;\n let selectOnlyMode = false;\n let i = 0;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === AttributeMarker.NamespaceURI) {\n // NOTE(benlesh): will not find namespaced attributes. This is by design.\n i += 4;\n } else {\n if (maybeAttrName === AttributeMarker.SelectOnly) {\n selectOnlyMode = true;\n }\n i += selectOnlyMode ? 1 : 2;\n }\n }\n\n return -1;\n}\n\nexport function isNodeMatchingSelectorList(\n tNode: TNode, selector: CssSelectorList, isProjectionMode: boolean = false): boolean {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getProjectAsAttrValue(tNode: TNode): string|null {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(NG_PROJECT_AS_ATTR_NAME);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1] as string;\n }\n }\n return null;\n}\n\n/**\n * Checks a given node against matching selectors and returns\n * selector index (or 0 if none matched).\n *\n * This function takes into account the ngProjectAs attribute: if present its value will be compared\n * to the raw (un-parsed) CSS selector instead of using standard selector matching logic.\n */\nexport function matchingSelectorIndex(\n tNode: TNode, selectors: CssSelectorList[], textSelectors: string[]): number {\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null &&\n isNodeMatchingSelectorList(tNode, selectors[i], /* isProjectionMode */ true)) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {PlayerFactory, PlayerFactoryBuildFn} from '../interfaces/player';\n\n/**\n * Combines the binding value and a factory for an animation player.\n *\n * Used to bind a player to an element template binding (currently only\n * `[style]`, `[style.prop]`, `[class]` and `[class.name]` bindings\n * supported). The provided `factoryFn` function will be run once all\n * the associated bindings have been evaluated on the element and is\n * designed to return a player which will then be placed on the element.\n *\n * @param factoryFn The function that is used to create a player\n * once all the rendering-related (styling values) have been\n * processed for the element binding.\n * @param value The raw value that will be exposed to the binding\n * so that the binding can update its internal values when\n * any changes are evaluated.\n */\nexport function bindPlayerFactory<T>(factoryFn: PlayerFactoryBuildFn, value: T): PlayerFactory {\n return new BoundPlayerFactory(factoryFn, value) as any;\n}\n\nexport class BoundPlayerFactory<T> {\n '__brand__': 'Brand for PlayerFactory that nothing will match';\n constructor(public fn: PlayerFactoryBuildFn, public value: T) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {PlayState, Player, PlayerHandler} from '../interfaces/player';\n\nexport class CorePlayerHandler implements PlayerHandler {\n private _players: Player[] = [];\n\n flushPlayers() {\n for (let i = 0; i < this._players.length; i++) {\n const player = this._players[i];\n if (!player.parent && player.state === PlayState.Pending) {\n player.play();\n }\n }\n this._players.length = 0;\n }\n\n queuePlayer(player: Player) { this._players.push(player); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport '../ng_dev_mode';\n\nimport {StyleSanitizeFn} from '../../sanitization/style_sanitizer';\nimport {getLContext} from '../context_discovery';\nimport {LContainer} from '../interfaces/container';\nimport {LContext} from '../interfaces/context';\nimport {AttributeMarker, TAttributes, TNode, TNodeFlags} from '../interfaces/node';\nimport {PlayState, Player, PlayerContext, PlayerIndex} from '../interfaces/player';\nimport {RElement} from '../interfaces/renderer';\nimport {InitialStylingValues, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling';\nimport {HEADER_OFFSET, HOST, LView, RootContext} from '../interfaces/view';\nimport {getTNode} from '../util';\n\nimport {CorePlayerHandler} from './core_player_handler';\n\nconst ANIMATION_PROP_PREFIX = '@';\n\nexport function createEmptyStylingContext(\n element?: RElement | null, sanitizer?: StyleSanitizeFn | null,\n initialStyles?: InitialStylingValues | null,\n initialClasses?: InitialStylingValues | null): StylingContext {\n return [\n 0, // MasterFlags\n [null, -1, false, sanitizer || null], // DirectiveRefs\n initialStyles || [null], // InitialStyles\n initialClasses || [null], // InitialClasses\n [0, 0], // SinglePropOffsets\n element || null, // Element\n null, // PreviousMultiClassValue\n null, // PreviousMultiStyleValue\n null, // PlayerContext\n ];\n}\n\n/**\n * Used clone a copy of a pre-computed template of a styling context.\n *\n * A pre-computed template is designed to be computed once for a given element\n * (instructions.ts has logic for caching this).\n */\nexport function allocStylingContext(\n element: RElement | null, templateStyleContext: StylingContext): StylingContext {\n // each instance gets a copy\n const context = templateStyleContext.slice() as any as StylingContext;\n context[StylingIndex.ElementPosition] = element;\n\n // this will prevent any other directives from extending the context\n context[StylingIndex.MasterFlagPosition] |= StylingFlags.BindingAllocationLocked;\n return context;\n}\n\n/**\n * Retrieve the `StylingContext` at a given index.\n *\n * This method lazily creates the `StylingContext`. This is because in most cases\n * we have styling without any bindings. Creating `StylingContext` eagerly would mean that\n * every style declaration such as `<div style=\"color: red\">` would result `StyleContext`\n * which would create unnecessary memory pressure.\n *\n * @param index Index of the style allocation. See: `elementStyling`.\n * @param viewData The view to search for the styling context\n */\nexport function getStylingContext(index: number, viewData: LView): StylingContext {\n let storageIndex = index;\n let slotValue: LContainer|LView|StylingContext|RElement = viewData[storageIndex];\n let wrapper: LContainer|LView|StylingContext = viewData;\n\n while (Array.isArray(slotValue)) {\n wrapper = slotValue;\n slotValue = slotValue[HOST] as LView | StylingContext | RElement;\n }\n\n if (isStylingContext(wrapper)) {\n return wrapper as StylingContext;\n } else {\n // This is an LView or an LContainer\n const stylingTemplate = getTNode(index - HEADER_OFFSET, viewData).stylingTemplate;\n\n if (wrapper !== viewData) {\n storageIndex = HOST;\n }\n\n return wrapper[storageIndex] = stylingTemplate ?\n allocStylingContext(slotValue, stylingTemplate) :\n createEmptyStylingContext(slotValue);\n }\n}\n\nexport function isStylingContext(value: any): value is StylingContext {\n // Not an LView or an LContainer\n return Array.isArray(value) && typeof value[StylingIndex.MasterFlagPosition] === 'number' &&\n Array.isArray(value[StylingIndex.InitialStyleValuesPosition]);\n}\n\nexport function isAnimationProp(name: string): boolean {\n return name[0] === ANIMATION_PROP_PREFIX;\n}\n\nexport function addPlayerInternal(\n playerContext: PlayerContext, rootContext: RootContext, element: HTMLElement,\n player: Player | null, playerContextIndex: number, ref?: any): boolean {\n ref = ref || element;\n if (playerContextIndex) {\n playerContext[playerContextIndex] = player;\n } else {\n playerContext.push(player);\n }\n\n if (player) {\n player.addEventListener(PlayState.Destroyed, () => {\n const index = playerContext.indexOf(player);\n const nonFactoryPlayerIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n\n // if the player is being removed from the factory side of the context\n // (which is where the [style] and [class] bindings do their thing) then\n // that side of the array cannot be resized since the respective bindings\n // have pointer index values that point to the associated factory instance\n if (index) {\n if (index < nonFactoryPlayerIndex) {\n playerContext[index] = null;\n } else {\n playerContext.splice(index, 1);\n }\n }\n player.destroy();\n });\n\n const playerHandler =\n rootContext.playerHandler || (rootContext.playerHandler = new CorePlayerHandler());\n playerHandler.queuePlayer(player, ref);\n return true;\n }\n\n return false;\n}\n\nexport function getPlayersInternal(playerContext: PlayerContext): Player[] {\n const players: Player[] = [];\n const nonFactoryPlayersStart = playerContext[PlayerIndex.NonBuilderPlayersStart];\n\n // add all factory-based players (which are apart of [style] and [class] bindings)\n for (let i = PlayerIndex.PlayerBuildersStartPosition + PlayerIndex.PlayerOffsetPosition;\n i < nonFactoryPlayersStart; i += PlayerIndex.PlayerAndPlayerBuildersTupleSize) {\n const player = playerContext[i] as Player | null;\n if (player) {\n players.push(player);\n }\n }\n\n // add all custom players (not apart of [style] and [class] bindings)\n for (let i = nonFactoryPlayersStart; i < playerContext.length; i++) {\n players.push(playerContext[i] as Player);\n }\n\n return players;\n}\n\n\nexport function getOrCreatePlayerContext(target: {}, context?: LContext | null): PlayerContext|\n null {\n context = context || getLContext(target) !;\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return null;\n }\n\n const {lView, nodeIndex} = context;\n const stylingContext = getStylingContext(nodeIndex, lView);\n return getPlayerContext(stylingContext) || allocPlayerContext(stylingContext);\n}\n\nexport function getPlayerContext(stylingContext: StylingContext): PlayerContext|null {\n return stylingContext[StylingIndex.PlayerContext];\n}\n\nexport function allocPlayerContext(data: StylingContext): PlayerContext {\n return data[StylingIndex.PlayerContext] =\n [PlayerIndex.SinglePlayerBuildersStartPosition, null, null, null, null];\n}\n\nexport function throwInvalidRefError() {\n throw new Error('Only elements that exist in an Angular application can be used for animations');\n}\n\nexport function hasStyling(attrs: TAttributes): boolean {\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr == AttributeMarker.Classes || attr == AttributeMarker.Styles) return true;\n }\n return false;\n}\n\nexport function hasClassInput(tNode: TNode) {\n return tNode.flags & TNodeFlags.hasClassInput ? true : false;\n}\n","/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n*/\nimport {StyleSanitizeFn} from '../../sanitization/style_sanitizer';\nimport {assertNotEqual} from '../assert';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {AttributeMarker, TAttributes} from '../interfaces/node';\nimport {BindingStore, BindingType, Player, PlayerBuilder, PlayerFactory, PlayerIndex} from '../interfaces/player';\nimport {RElement, Renderer3, RendererStyleFlags3, isProceduralRenderer} from '../interfaces/renderer';\nimport {DirectiveOwnerAndPlayerBuilderIndex, DirectiveRegistryValues, DirectiveRegistryValuesIndex, InitialStylingValues, InitialStylingValuesIndex, SinglePropOffsetValues, SinglePropOffsetValuesIndex, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling';\nimport {LView, RootContext} from '../interfaces/view';\nimport {NO_CHANGE} from '../tokens';\nimport {getRootContext} from '../util';\n\nimport {BoundPlayerFactory} from './player_factory';\nimport {addPlayerInternal, allocPlayerContext, createEmptyStylingContext, getPlayerContext} from './util';\n\n\n/**\n * This file includes the code to power all styling-binding operations in Angular.\n *\n * These include:\n * [style]=\"myStyleObj\"\n * [class]=\"myClassObj\"\n * [style.prop]=\"myPropValue\"\n * [class.name]=\"myClassValue\"\n *\n * There are many different ways in which these functions below are called. Please see\n * `interfaces/styles.ts` to get a better idea of how the styling algorithm works.\n */\n\n\n\n/**\n * Creates a new StylingContext an fills it with the provided static styling attribute values.\n */\nexport function initializeStaticContext(attrs: TAttributes) {\n const context = createEmptyStylingContext();\n const initialClasses: InitialStylingValues = context[StylingIndex.InitialClassValuesPosition] =\n [null];\n const initialStyles: InitialStylingValues = context[StylingIndex.InitialStyleValuesPosition] =\n [null];\n\n // The attributes array has marker values (numbers) indicating what the subsequent\n // values represent. When we encounter a number, we set the mode to that type of attribute.\n let mode = -1;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (typeof attr == 'number') {\n mode = attr;\n } else if (mode === AttributeMarker.Styles) {\n initialStyles.push(attr as string, attrs[++i] as string);\n } else if (mode === AttributeMarker.Classes) {\n initialClasses.push(attr as string, true);\n } else if (mode === AttributeMarker.SelectOnly) {\n break;\n }\n }\n\n return context;\n}\n\n/**\n * Designed to update an existing styling context with new static styling\n * data (classes and styles).\n *\n * @param context the existing styling context\n * @param attrs an array of new static styling attributes that will be\n * assigned to the context\n * @param directive the directive instance with which static data is associated with.\n */\nexport function patchContextWithStaticAttrs(\n context: StylingContext, attrs: TAttributes, directive: any): void {\n // If the styling context has already been patched with the given directive's bindings,\n // then there is no point in doing it again. The reason why this may happen (the directive\n // styling being patched twice) is because the `stylingBinding` function is called each time\n // an element is created (both within a template function and within directive host bindings).\n const directives = context[StylingIndex.DirectiveRegistryPosition];\n if (getDirectiveRegistryValuesIndexOf(directives, directive) == -1) {\n // this is a new directive which we have not seen yet.\n directives.push(directive, -1, false, null);\n\n let initialClasses: InitialStylingValues|null = null;\n let initialStyles: InitialStylingValues|null = null;\n\n let mode = -1;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (typeof attr == 'number') {\n mode = attr;\n } else if (mode == AttributeMarker.Classes) {\n initialClasses = initialClasses || context[StylingIndex.InitialClassValuesPosition];\n patchInitialStylingValue(initialClasses, attr, true);\n } else if (mode == AttributeMarker.Styles) {\n initialStyles = initialStyles || context[StylingIndex.InitialStyleValuesPosition];\n patchInitialStylingValue(initialStyles, attr, attrs[++i]);\n }\n }\n }\n}\n\n/**\n * Designed to add a style or class value into the existing set of initial styles.\n *\n * The function will search and figure out if a style/class value is already present\n * within the provided initial styling array. If and when a style/class value is not\n * present (or if it's value is falsy) then it will be inserted/updated in the list\n * of initial styling values.\n */\nfunction patchInitialStylingValue(\n initialStyling: InitialStylingValues, prop: string, value: any): void {\n // Even values are keys; Odd numbers are values; Search keys only\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialStyling.length;) {\n const key = initialStyling[i];\n if (key === prop) {\n const existingValue = initialStyling[i + InitialStylingValuesIndex.ValueOffset];\n\n // If there is no previous style value (when `null`) or no previous class\n // applied (when `false`) then we update the the newly given value.\n if (existingValue == null || existingValue == false) {\n initialStyling[i + InitialStylingValuesIndex.ValueOffset] = value;\n }\n return;\n }\n i = i + InitialStylingValuesIndex.Size;\n }\n // We did not find existing key, add a new one.\n initialStyling.push(prop, value);\n}\n\n/**\n * Runs through the initial styling data present in the context and renders\n * them via the renderer on the element.\n */\nexport function renderInitialStylesAndClasses(\n element: RElement, context: StylingContext, renderer: Renderer3) {\n const initialClasses = context[StylingIndex.InitialClassValuesPosition];\n renderInitialStylingValues(element, renderer, initialClasses, true);\n\n const initialStyles = context[StylingIndex.InitialStyleValuesPosition];\n renderInitialStylingValues(element, renderer, initialStyles, false);\n}\n\n/**\n * This is a helper function designed to render each entry present within the\n * provided list of initialStylingValues.\n */\nfunction renderInitialStylingValues(\n element: RElement, renderer: Renderer3, initialStylingValues: InitialStylingValues,\n isEntryClassBased: boolean) {\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialStylingValues.length;\n i += InitialStylingValuesIndex.Size) {\n const value = initialStylingValues[i + InitialStylingValuesIndex.ValueOffset];\n if (value) {\n if (isEntryClassBased) {\n setClass(\n element, initialStylingValues[i + InitialStylingValuesIndex.PropOffset] as string, true,\n renderer, null);\n } else {\n setStyle(\n element, initialStylingValues[i + InitialStylingValuesIndex.PropOffset] as string,\n value as string, renderer, null);\n }\n }\n }\n}\n\nexport function allowNewBindingsForStylingContext(context: StylingContext): boolean {\n return (context[StylingIndex.MasterFlagPosition] & StylingFlags.BindingAllocationLocked) === 0;\n}\n\n/**\n * Adds in new binding values to a styling context.\n *\n * If a directive value is provided then all provided class/style binding names will\n * reference the provided directive.\n *\n * @param context the existing styling context\n * @param directiveRef the directive that the new bindings will reference\n * @param classBindingNames an array of class binding names that will be added to the context\n * @param styleBindingNames an array of style binding names that will be added to the context\n * @param styleSanitizer an optional sanitizer that handle all sanitization on for each of\n * the bindings added to the context. Note that if a directive is provided then the sanitizer\n * instance will only be active if and when the directive updates the bindings that it owns.\n */\nexport function updateContextWithBindings(\n context: StylingContext, directiveRef: any | null, classBindingNames?: string[] | null,\n styleBindingNames?: string[] | null, styleSanitizer?: StyleSanitizeFn | null,\n onlyProcessSingleClasses?: boolean) {\n if (context[StylingIndex.MasterFlagPosition] & StylingFlags.BindingAllocationLocked) return;\n\n // this means the context has already been patched with the directive's bindings\n const directiveIndex = findOrPatchDirectiveIntoRegistry(context, directiveRef, styleSanitizer);\n if (directiveIndex === -1) {\n // this means the directive has already been patched in ... No point in doing anything\n return;\n }\n\n // there are alot of variables being used below to track where in the context the new\n // binding values will be placed. Because the context consists of multiple types of\n // entries (single classes/styles and multi classes/styles) alot of the index positions\n // need to be computed ahead of time and the context needs to be extended before the values\n // are inserted in.\n const singlePropOffsetValues = context[StylingIndex.SinglePropOffsetPositions];\n const totalCurrentClassBindings =\n singlePropOffsetValues[SinglePropOffsetValuesIndex.ClassesCountPosition];\n const totalCurrentStyleBindings =\n singlePropOffsetValues[SinglePropOffsetValuesIndex.StylesCountPosition];\n\n const classesOffset = totalCurrentClassBindings * StylingIndex.Size;\n const stylesOffset = totalCurrentStyleBindings * StylingIndex.Size;\n\n const singleStylesStartIndex = StylingIndex.SingleStylesStartPosition;\n let singleClassesStartIndex = singleStylesStartIndex + stylesOffset;\n let multiStylesStartIndex = singleClassesStartIndex + classesOffset;\n let multiClassesStartIndex = multiStylesStartIndex + stylesOffset;\n\n // because we're inserting more bindings into the context, this means that the\n // binding values need to be referenced the singlePropOffsetValues array so that\n // the template/directive can easily find them inside of the `elementStyleProp`\n // and the `elementClassProp` functions without iterating through the entire context.\n // The first step to setting up these reference points is to mark how many bindings\n // are being added. Even if these bindings already exist in the context, the directive\n // or template code will still call them unknowingly. Therefore the total values need\n // to be registered so that we know how many bindings are assigned to each directive.\n const currentSinglePropsLength = singlePropOffsetValues.length;\n singlePropOffsetValues.push(\n styleBindingNames ? styleBindingNames.length : 0,\n classBindingNames ? classBindingNames.length : 0);\n\n // the code below will check to see if a new style binding already exists in the context\n // if so then there is no point in inserting it into the context again. Whether or not it\n // exists the styling offset code will now know exactly where it is\n let insertionOffset = 0;\n const filteredStyleBindingNames: string[] = [];\n if (styleBindingNames && styleBindingNames.length) {\n for (let i = 0; i < styleBindingNames.length; i++) {\n const name = styleBindingNames[i];\n let singlePropIndex =\n getMatchingBindingIndex(context, name, singleStylesStartIndex, singleClassesStartIndex);\n if (singlePropIndex == -1) {\n singlePropIndex = singleClassesStartIndex + insertionOffset;\n insertionOffset += StylingIndex.Size;\n filteredStyleBindingNames.push(name);\n }\n singlePropOffsetValues.push(singlePropIndex);\n }\n }\n\n // just like with the style binding loop above, the new class bindings get the same treatment...\n const filteredClassBindingNames: string[] = [];\n if (classBindingNames && classBindingNames.length) {\n for (let i = 0; i < classBindingNames.length; i++) {\n const name = classBindingNames[i];\n let singlePropIndex =\n getMatchingBindingIndex(context, name, singleClassesStartIndex, multiStylesStartIndex);\n if (singlePropIndex == -1) {\n singlePropIndex = multiStylesStartIndex + insertionOffset;\n insertionOffset += StylingIndex.Size;\n filteredClassBindingNames.push(name);\n } else {\n singlePropIndex += filteredStyleBindingNames.length * StylingIndex.Size;\n }\n singlePropOffsetValues.push(singlePropIndex);\n }\n }\n\n // because new styles are being inserted, this means the existing collection of style offset\n // index values are incorrect (they point to the wrong values). The code below will run through\n // the entire offset array and update the existing set of index values to point to their new\n // locations while taking the new binding values into consideration.\n let i = SinglePropOffsetValuesIndex.ValueStartPosition;\n if (filteredStyleBindingNames.length) {\n while (i < currentSinglePropsLength) {\n const totalStyles =\n singlePropOffsetValues[i + SinglePropOffsetValuesIndex.StylesCountPosition];\n const totalClasses =\n singlePropOffsetValues[i + SinglePropOffsetValuesIndex.ClassesCountPosition];\n if (totalClasses) {\n const start = i + SinglePropOffsetValuesIndex.ValueStartPosition + totalStyles;\n for (let j = start; j < start + totalClasses; j++) {\n singlePropOffsetValues[j] += filteredStyleBindingNames.length * StylingIndex.Size;\n }\n }\n\n const total = totalStyles + totalClasses;\n i += SinglePropOffsetValuesIndex.ValueStartPosition + total;\n }\n }\n\n const totalNewEntries = filteredClassBindingNames.length + filteredStyleBindingNames.length;\n\n // in the event that there are new style values being inserted, all existing class and style\n // bindings need to have their pointer values offsetted with the new amount of space that is\n // used for the new style/class bindings.\n for (let i = singleStylesStartIndex; i < context.length; i += StylingIndex.Size) {\n const isMultiBased = i >= multiStylesStartIndex;\n const isClassBased = i >= (isMultiBased ? multiClassesStartIndex : singleClassesStartIndex);\n const flag = getPointers(context, i);\n const staticIndex = getInitialIndex(flag);\n let singleOrMultiIndex = getMultiOrSingleIndex(flag);\n if (isMultiBased) {\n singleOrMultiIndex +=\n isClassBased ? (filteredStyleBindingNames.length * StylingIndex.Size) : 0;\n } else {\n singleOrMultiIndex += (totalNewEntries * StylingIndex.Size) +\n ((isClassBased ? filteredStyleBindingNames.length : 0) * StylingIndex.Size);\n }\n setFlag(context, i, pointers(flag, staticIndex, singleOrMultiIndex));\n }\n\n // this is where we make space in the context for the new style bindings\n for (let i = 0; i < filteredStyleBindingNames.length * StylingIndex.Size; i++) {\n context.splice(multiClassesStartIndex, 0, null);\n context.splice(singleClassesStartIndex, 0, null);\n singleClassesStartIndex++;\n multiStylesStartIndex++;\n multiClassesStartIndex += 2; // both single + multi slots were inserted\n }\n\n // this is where we make space in the context for the new class bindings\n for (let i = 0; i < filteredClassBindingNames.length * StylingIndex.Size; i++) {\n context.splice(multiStylesStartIndex, 0, null);\n context.push(null);\n multiStylesStartIndex++;\n multiClassesStartIndex++;\n }\n\n const initialClasses = context[StylingIndex.InitialClassValuesPosition];\n const initialStyles = context[StylingIndex.InitialStyleValuesPosition];\n\n // the code below will insert each new entry into the context and assign the appropriate\n // flags and index values to them. It's important this runs at the end of this function\n // because the context, property offset and index values have all been computed just before.\n for (let i = 0; i < totalNewEntries; i++) {\n const entryIsClassBased = i >= filteredStyleBindingNames.length;\n const adjustedIndex = entryIsClassBased ? (i - filteredStyleBindingNames.length) : i;\n const propName = entryIsClassBased ? filteredClassBindingNames[adjustedIndex] :\n filteredStyleBindingNames[adjustedIndex];\n\n let multiIndex, singleIndex;\n if (entryIsClassBased) {\n multiIndex = multiClassesStartIndex +\n ((totalCurrentClassBindings + adjustedIndex) * StylingIndex.Size);\n singleIndex = singleClassesStartIndex +\n ((totalCurrentClassBindings + adjustedIndex) * StylingIndex.Size);\n } else {\n multiIndex =\n multiStylesStartIndex + ((totalCurrentStyleBindings + adjustedIndex) * StylingIndex.Size);\n singleIndex = singleStylesStartIndex +\n ((totalCurrentStyleBindings + adjustedIndex) * StylingIndex.Size);\n }\n\n // if a property is not found in the initial style values list then it\n // is ALWAYS added incase a follow-up directive introduces the same initial\n // style/class value later on.\n let initialValuesToLookup = entryIsClassBased ? initialClasses : initialStyles;\n let indexForInitial = getInitialStylingValuesIndexOf(initialValuesToLookup, propName);\n if (indexForInitial === -1) {\n indexForInitial = initialValuesToLookup.length + InitialStylingValuesIndex.ValueOffset;\n initialValuesToLookup.push(propName, entryIsClassBased ? false : null);\n } else {\n indexForInitial += InitialStylingValuesIndex.ValueOffset;\n }\n\n const initialFlag =\n prepareInitialFlag(context, propName, entryIsClassBased, styleSanitizer || null);\n\n setFlag(context, singleIndex, pointers(initialFlag, indexForInitial, multiIndex));\n setProp(context, singleIndex, propName);\n setValue(context, singleIndex, null);\n setPlayerBuilderIndex(context, singleIndex, 0, directiveIndex);\n\n setFlag(context, multiIndex, pointers(initialFlag, indexForInitial, singleIndex));\n setProp(context, multiIndex, propName);\n setValue(context, multiIndex, null);\n setPlayerBuilderIndex(context, multiIndex, 0, directiveIndex);\n }\n\n // the total classes/style values are updated so the next time the context is patched\n // additional style/class bindings from another directive then it knows exactly where\n // to insert them in the context\n singlePropOffsetValues[SinglePropOffsetValuesIndex.ClassesCountPosition] =\n totalCurrentClassBindings + filteredClassBindingNames.length;\n singlePropOffsetValues[SinglePropOffsetValuesIndex.StylesCountPosition] =\n totalCurrentStyleBindings + filteredStyleBindingNames.length;\n\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n const masterFlag = pointers(0, 0, multiStylesStartIndex) |\n (onlyProcessSingleClasses ? StylingFlags.OnlyProcessSingleClasses : 0);\n setFlag(context, StylingIndex.MasterFlagPosition, masterFlag);\n}\n\n/**\n * Searches through the existing registry of directives\n */\nfunction findOrPatchDirectiveIntoRegistry(\n context: StylingContext, directiveRef: any, styleSanitizer?: StyleSanitizeFn | null) {\n const directiveRefs = context[StylingIndex.DirectiveRegistryPosition];\n const nextOffsetInsertionIndex = context[StylingIndex.SinglePropOffsetPositions].length;\n\n let directiveIndex: number;\n const detectedIndex = getDirectiveRegistryValuesIndexOf(directiveRefs, directiveRef);\n\n if (detectedIndex === -1) {\n directiveIndex = directiveRefs.length / DirectiveRegistryValuesIndex.Size;\n directiveRefs.push(directiveRef, nextOffsetInsertionIndex, false, styleSanitizer || null);\n } else {\n const singlePropStartPosition =\n detectedIndex + DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset;\n if (directiveRefs[singlePropStartPosition] ! >= 0) {\n // the directive has already been patched into the context\n return -1;\n }\n\n directiveIndex = detectedIndex / DirectiveRegistryValuesIndex.Size;\n\n // because the directive already existed this means that it was set during elementHostAttrs or\n // elementStart which means that the binding values were not here. Therefore, the values below\n // need to be applied so that single class and style properties can be assigned later.\n const singlePropPositionIndex =\n detectedIndex + DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset;\n directiveRefs[singlePropPositionIndex] = nextOffsetInsertionIndex;\n\n // the sanitizer is also apart of the binding process and will be used when bindings are\n // applied.\n const styleSanitizerIndex = detectedIndex + DirectiveRegistryValuesIndex.StyleSanitizerOffset;\n directiveRefs[styleSanitizerIndex] = styleSanitizer || null;\n }\n\n return directiveIndex;\n}\n\nfunction getMatchingBindingIndex(\n context: StylingContext, bindingName: string, start: number, end: number) {\n for (let j = start; j < end; j += StylingIndex.Size) {\n if (getProp(context, j) === bindingName) return j;\n }\n return -1;\n}\n\n/**\n * Sets and resolves all `multi` styling on an `StylingContext` so that they can be\n * applied to the element once `renderStyling` is called.\n *\n * All missing styles/class (any values that are not provided in the new `styles`\n * or `classes` params) will resolve to `null` within their respective positions\n * in the context.\n *\n * @param context The styling context that will be updated with the\n * newly provided style values.\n * @param classesInput The key/value map of CSS class names that will be used for the update.\n * @param stylesInput The key/value map of CSS styles that will be used for the update.\n */\nexport function updateStylingMap(\n context: StylingContext, classesInput: {[key: string]: any} | string |\n BoundPlayerFactory<null|string|{[key: string]: any}>| NO_CHANGE | null,\n stylesInput?: {[key: string]: any} | BoundPlayerFactory<null|{[key: string]: any}>| NO_CHANGE |\n null,\n directiveRef?: any): void {\n stylesInput = stylesInput || null;\n\n const directiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n const element = context[StylingIndex.ElementPosition] !as HTMLElement;\n const classesPlayerBuilder = classesInput instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(classesInput as any, element, BindingType.Class) :\n null;\n const stylesPlayerBuilder = stylesInput instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(stylesInput as any, element, BindingType.Style) :\n null;\n\n const classesValue = classesPlayerBuilder ?\n (classesInput as BoundPlayerFactory<{[key: string]: any}|string>) !.value :\n classesInput;\n const stylesValue = stylesPlayerBuilder ? stylesInput !.value : stylesInput;\n // early exit (this is what's done to avoid using ctx.bind() to cache the value)\n const ignoreAllClassUpdates = limitToSingleClasses(context) || classesValue === NO_CHANGE ||\n classesValue === context[StylingIndex.CachedClassValueOrInitialClassString];\n const ignoreAllStyleUpdates =\n stylesValue === NO_CHANGE || stylesValue === context[StylingIndex.CachedStyleValue];\n if (ignoreAllClassUpdates && ignoreAllStyleUpdates) return;\n\n context[StylingIndex.CachedClassValueOrInitialClassString] = classesValue;\n context[StylingIndex.CachedStyleValue] = stylesValue;\n\n let classNames: string[] = EMPTY_ARRAY;\n let applyAllClasses = false;\n let playerBuildersAreDirty = false;\n\n const classesPlayerBuilderIndex =\n classesPlayerBuilder ? PlayerIndex.ClassMapPlayerBuilderPosition : 0;\n if (hasPlayerBuilderChanged(\n context, classesPlayerBuilder, PlayerIndex.ClassMapPlayerBuilderPosition)) {\n setPlayerBuilder(context, classesPlayerBuilder, PlayerIndex.ClassMapPlayerBuilderPosition);\n playerBuildersAreDirty = true;\n }\n\n const stylesPlayerBuilderIndex =\n stylesPlayerBuilder ? PlayerIndex.StyleMapPlayerBuilderPosition : 0;\n if (hasPlayerBuilderChanged(\n context, stylesPlayerBuilder, PlayerIndex.StyleMapPlayerBuilderPosition)) {\n setPlayerBuilder(context, stylesPlayerBuilder, PlayerIndex.StyleMapPlayerBuilderPosition);\n playerBuildersAreDirty = true;\n }\n\n // each time a string-based value pops up then it shouldn't require a deep\n // check of what's changed.\n if (!ignoreAllClassUpdates) {\n if (typeof classesValue == 'string') {\n classNames = classesValue.split(/\\s+/);\n // this boolean is used to avoid having to create a key/value map of `true` values\n // since a classname string implies that all those classes are added\n applyAllClasses = true;\n } else {\n classNames = classesValue ? Object.keys(classesValue) : EMPTY_ARRAY;\n }\n }\n\n const classes = (classesValue || EMPTY_OBJ) as{[key: string]: any};\n const styleProps = stylesValue ? Object.keys(stylesValue) : EMPTY_ARRAY;\n const styles = stylesValue || EMPTY_OBJ;\n\n const classesStartIndex = styleProps.length;\n let multiStartIndex = getMultiStartIndex(context);\n\n let dirty = false;\n let ctxIndex = multiStartIndex;\n\n let propIndex = 0;\n const propLimit = styleProps.length + classNames.length;\n\n // the main loop here will try and figure out how the shape of the provided\n // styles differ with respect to the context. Later if the context/styles/classes\n // are off-balance then they will be dealt in another loop after this one\n while (ctxIndex < context.length && propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n\n // when there is a cache-hit for a string-based class then we should\n // avoid doing any work diffing any of the changes\n if (processValue) {\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const newProp: string =\n isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const newValue: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[newProp]) : styles[newProp];\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n\n const prop = getProp(context, ctxIndex);\n if (prop === newProp) {\n const value = getValue(context, ctxIndex);\n const flag = getPointers(context, ctxIndex);\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n\n if (hasValueChanged(flag, value, newValue)) {\n setValue(context, ctxIndex, newValue);\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n\n const initialValue = getInitialValue(context, flag);\n\n // SKIP IF INITIAL CHECK\n // If the former `value` is `null` then it means that an initial value\n // could be being rendered on screen. If that is the case then there is\n // no point in updating the value incase it matches. In other words if the\n // new value is the exact same as the previously rendered value (which\n // happens to be the initial value) then do nothing.\n if (value != null || hasValueChanged(flag, initialValue, newValue)) {\n setDirty(context, ctxIndex, true);\n dirty = true;\n }\n }\n } else {\n const indexOfEntry = findEntryPositionByProp(context, newProp, ctxIndex);\n if (indexOfEntry > 0) {\n // it was found at a later point ... just swap the values\n const valueToCompare = getValue(context, indexOfEntry);\n const flagToCompare = getPointers(context, indexOfEntry);\n swapMultiContextEntries(context, ctxIndex, indexOfEntry);\n if (hasValueChanged(flagToCompare, valueToCompare, newValue)) {\n const initialValue = getInitialValue(context, flagToCompare);\n setValue(context, ctxIndex, newValue);\n\n // same if statement logic as above (look for SKIP IF INITIAL CHECK).\n if (valueToCompare != null || hasValueChanged(flagToCompare, initialValue, newValue)) {\n setDirty(context, ctxIndex, true);\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n dirty = true;\n }\n }\n } else {\n // we only care to do this if the insertion is in the middle\n const newFlag = prepareInitialFlag(\n context, newProp, isClassBased, getStyleSanitizer(context, directiveIndex));\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n insertNewMultiProperty(\n context, ctxIndex, isClassBased, newProp, newFlag, newValue, directiveIndex,\n playerBuilderIndex);\n dirty = true;\n }\n }\n }\n\n ctxIndex += StylingIndex.Size;\n propIndex++;\n }\n\n // this means that there are left-over values in the context that\n // were not included in the provided styles/classes and in this\n // case the goal is to \"remove\" them from the context (by nullifying)\n while (ctxIndex < context.length) {\n const flag = getPointers(context, ctxIndex);\n const isClassBased = (flag & StylingFlags.Class) === StylingFlags.Class;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n if (processValue) {\n const value = getValue(context, ctxIndex);\n const doRemoveValue = valueExists(value, isClassBased);\n if (doRemoveValue) {\n setDirty(context, ctxIndex, true);\n setValue(context, ctxIndex, null);\n\n // we keep the player factory the same so that the `nulled` value can\n // be instructed into the player because removing a style and/or a class\n // is a valid animation player instruction.\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n dirty = true;\n }\n }\n ctxIndex += StylingIndex.Size;\n }\n\n // this means that there are left-over properties in the context that\n // were not detected in the context during the loop above. In that\n // case we want to add the new entries into the list\n const sanitizer = getStyleSanitizer(context, directiveIndex);\n while (propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n if (processValue) {\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const prop = isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const value: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[prop]) : styles[prop];\n const flag = prepareInitialFlag(context, prop, isClassBased, sanitizer) | StylingFlags.Dirty;\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n const ctxIndex = context.length;\n context.push(flag, prop, value, 0);\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n dirty = true;\n }\n propIndex++;\n }\n\n if (dirty) {\n setContextDirty(context, true);\n setDirectiveDirty(context, directiveIndex, true);\n }\n\n if (playerBuildersAreDirty) {\n setContextPlayersDirty(context, true);\n }\n}\n\n/**\n * This method will toggle the referenced CSS class (by the provided index)\n * within the given context.\n *\n * @param context The styling context that will be updated with the\n * newly provided class value.\n * @param offset The index of the CSS class which is being updated.\n * @param addOrRemove Whether or not to add or remove the CSS class\n */\nexport function updateClassProp(\n context: StylingContext, offset: number, addOrRemove: boolean | BoundPlayerFactory<boolean>,\n directiveRef?: any): void {\n _updateSingleStylingValue(context, offset, addOrRemove, true, directiveRef);\n}\n\n/**\n * Sets and resolves a single style value on the provided `StylingContext` so\n * that they can be applied to the element once `renderStyling` is called.\n *\n * Note that prop-level styling values are considered higher priority than any styling that\n * has been applied using `updateStylingMap`, therefore, when styling values are rendered\n * then any styles/classes that have been applied using this function will be considered first\n * (then multi values second and then initial values as a backup).\n *\n * @param context The styling context that will be updated with the\n * newly provided style value.\n * @param offset The index of the property which is being updated.\n * @param value The CSS style value that will be assigned\n * @param directiveRef an optional reference to the directive responsible\n * for this binding change. If present then style binding will only\n * actualize if the directive has ownership over this binding\n * (see styling.ts#directives for more information about the algorithm).\n */\nexport function updateStyleProp(\n context: StylingContext, offset: number,\n input: string | boolean | null | BoundPlayerFactory<string|boolean|null>,\n directiveRef?: any): void {\n _updateSingleStylingValue(context, offset, input, false, directiveRef);\n}\n\nfunction _updateSingleStylingValue(\n context: StylingContext, offset: number,\n input: string | boolean | null | BoundPlayerFactory<string|boolean|null>, isClassBased: boolean,\n directiveRef: any): void {\n const directiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n const singleIndex = getSinglePropIndexValue(context, directiveIndex, offset, isClassBased);\n const currValue = getValue(context, singleIndex);\n const currFlag = getPointers(context, singleIndex);\n const currDirective = getDirectiveIndexFromEntry(context, singleIndex);\n const value: string|boolean|null = (input instanceof BoundPlayerFactory) ? input.value : input;\n\n if (hasValueChanged(currFlag, currValue, value) &&\n allowValueChange(currValue, value, currDirective, directiveIndex)) {\n const isClassBased = (currFlag & StylingFlags.Class) === StylingFlags.Class;\n const element = context[StylingIndex.ElementPosition] !as HTMLElement;\n const playerBuilder = input instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(\n input as any, element, isClassBased ? BindingType.Class : BindingType.Style) :\n null;\n const value = (playerBuilder ? (input as BoundPlayerFactory<any>).value : input) as string |\n boolean | null;\n const currPlayerIndex = getPlayerBuilderIndex(context, singleIndex);\n\n let playerBuildersAreDirty = false;\n let playerBuilderIndex = playerBuilder ? currPlayerIndex : 0;\n if (hasPlayerBuilderChanged(context, playerBuilder, currPlayerIndex)) {\n const newIndex = setPlayerBuilder(context, playerBuilder, currPlayerIndex);\n playerBuilderIndex = playerBuilder ? newIndex : 0;\n playerBuildersAreDirty = true;\n }\n\n if (playerBuildersAreDirty || currDirective !== directiveIndex) {\n setPlayerBuilderIndex(context, singleIndex, playerBuilderIndex, directiveIndex);\n }\n\n if (currDirective !== directiveIndex) {\n const prop = getProp(context, singleIndex);\n const sanitizer = getStyleSanitizer(context, directiveIndex);\n setSanitizeFlag(context, singleIndex, (sanitizer && sanitizer(prop)) ? true : false);\n }\n\n // the value will always get updated (even if the dirty flag is skipped)\n setValue(context, singleIndex, value);\n const indexForMulti = getMultiOrSingleIndex(currFlag);\n\n // if the value is the same in the multi-area then there's no point in re-assembling\n const valueForMulti = getValue(context, indexForMulti);\n if (!valueForMulti || hasValueChanged(currFlag, valueForMulti, value)) {\n let multiDirty = false;\n let singleDirty = true;\n\n // only when the value is set to `null` should the multi-value get flagged\n if (!valueExists(value, isClassBased) && valueExists(valueForMulti, isClassBased)) {\n multiDirty = true;\n singleDirty = false;\n }\n\n setDirty(context, indexForMulti, multiDirty);\n setDirty(context, singleIndex, singleDirty);\n setDirectiveDirty(context, directiveIndex, true);\n setContextDirty(context, true);\n }\n\n if (playerBuildersAreDirty) {\n setContextPlayersDirty(context, true);\n }\n }\n}\n\n\n/**\n * Renders all queued styling using a renderer onto the given element.\n *\n * This function works by rendering any styles (that have been applied\n * using `updateStylingMap`) and any classes (that have been applied using\n * `updateStyleProp`) onto the provided element using the provided renderer.\n * Just before the styles/classes are rendered a final key/value style map\n * will be assembled (if `styleStore` or `classStore` are provided).\n *\n * @param lElement the element that the styles will be rendered on\n * @param context The styling context that will be used to determine\n * what styles will be rendered\n * @param renderer the renderer that will be used to apply the styling\n * @param classesStore if provided, the updated class values will be applied\n * to this key/value map instead of being renderered via the renderer.\n * @param stylesStore if provided, the updated style values will be applied\n * to this key/value map instead of being renderered via the renderer.\n * @param directiveRef an optional directive that will be used to target which\n * styling values are rendered. If left empty, only the bindings that are\n * registered on the template will be rendered.\n * @returns number the total amount of players that got queued for animation (if any)\n */\nexport function renderStyling(\n context: StylingContext, renderer: Renderer3, rootOrView: RootContext | LView,\n isFirstRender: boolean, classesStore?: BindingStore | null, stylesStore?: BindingStore | null,\n directiveRef?: any): number {\n let totalPlayersQueued = 0;\n const targetDirectiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n\n if (isContextDirty(context) && isDirectiveDirty(context, targetDirectiveIndex)) {\n const flushPlayerBuilders: any =\n context[StylingIndex.MasterFlagPosition] & StylingFlags.PlayerBuildersDirty;\n const native = context[StylingIndex.ElementPosition] !;\n const multiStartIndex = getMultiStartIndex(context);\n const onlySingleClasses = limitToSingleClasses(context);\n\n let stillDirty = false;\n for (let i = StylingIndex.SingleStylesStartPosition; i < context.length;\n i += StylingIndex.Size) {\n // there is no point in rendering styles that have not changed on screen\n if (isDirty(context, i)) {\n const flag = getPointers(context, i);\n const directiveIndex = getDirectiveIndexFromEntry(context, i);\n if (targetDirectiveIndex !== directiveIndex) {\n stillDirty = true;\n continue;\n }\n\n const prop = getProp(context, i);\n const value = getValue(context, i);\n const styleSanitizer =\n (flag & StylingFlags.Sanitize) ? getStyleSanitizer(context, directiveIndex) : null;\n const playerBuilder = getPlayerBuilder(context, i);\n const isClassBased = flag & StylingFlags.Class ? true : false;\n const isInSingleRegion = i < multiStartIndex;\n const readInitialValue = !isClassBased || !onlySingleClasses;\n\n let valueToApply: string|boolean|null = value;\n\n // VALUE DEFER CASE 1: Use a multi value instead of a null single value\n // this check implies that a single value was removed and we\n // should now defer to a multi value and use that (if set).\n if (isInSingleRegion && !valueExists(valueToApply, isClassBased)) {\n // single values ALWAYS have a reference to a multi index\n const multiIndex = getMultiOrSingleIndex(flag);\n valueToApply = getValue(context, multiIndex);\n }\n\n // VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy)\n // the initial value will always be a string or null,\n // therefore we can safely adopt it incase there's nothing else\n // note that this should always be a falsy check since `false` is used\n // for both class and style comparisons (styles can't be false and false\n // classes are turned off and should therefore defer to their initial values)\n // Note that we ignore class-based deferals because otherwise a class can never\n // be removed in the case that it exists as true in the initial classes list...\n if (!isClassBased && !valueExists(valueToApply, isClassBased) && readInitialValue) {\n valueToApply = getInitialValue(context, flag);\n }\n\n // if the first render is true then we do not want to start applying falsy\n // values to the DOM element's styling. Otherwise then we know there has\n // been a change and even if it's falsy then it's removing something that\n // was truthy before.\n const doApplyValue = isFirstRender ? valueToApply : true;\n if (doApplyValue) {\n if (isClassBased) {\n setClass(\n native, prop, valueToApply ? true : false, renderer, classesStore, playerBuilder);\n } else {\n setStyle(\n native, prop, valueToApply as string | null, renderer, styleSanitizer, stylesStore,\n playerBuilder);\n }\n }\n\n setDirty(context, i, false);\n }\n }\n\n if (flushPlayerBuilders) {\n const rootContext =\n Array.isArray(rootOrView) ? getRootContext(rootOrView) : rootOrView as RootContext;\n const playerContext = getPlayerContext(context) !;\n const playersStartIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n for (let i = PlayerIndex.PlayerBuildersStartPosition; i < playersStartIndex;\n i += PlayerIndex.PlayerAndPlayerBuildersTupleSize) {\n const builder = playerContext[i] as ClassAndStylePlayerBuilder<any>| null;\n const playerInsertionIndex = i + PlayerIndex.PlayerOffsetPosition;\n const oldPlayer = playerContext[playerInsertionIndex] as Player | null;\n if (builder) {\n const player = builder.buildPlayer(oldPlayer, isFirstRender);\n if (player !== undefined) {\n if (player != null) {\n const wasQueued = addPlayerInternal(\n playerContext, rootContext, native as HTMLElement, player, playerInsertionIndex);\n wasQueued && totalPlayersQueued++;\n }\n if (oldPlayer) {\n oldPlayer.destroy();\n }\n }\n } else if (oldPlayer) {\n // the player builder has been removed ... therefore we should delete the associated\n // player\n oldPlayer.destroy();\n }\n }\n setContextPlayersDirty(context, false);\n }\n\n setDirectiveDirty(context, targetDirectiveIndex, false);\n setContextDirty(context, stillDirty);\n }\n\n return totalPlayersQueued;\n}\n\n/**\n * This function renders a given CSS prop/value entry using the\n * provided renderer. If a `store` value is provided then\n * that will be used a render context instead of the provided\n * renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nexport function setStyle(\n native: any, prop: string, value: string | null, renderer: Renderer3,\n sanitizer: StyleSanitizeFn | null, store?: BindingStore | null,\n playerBuilder?: ClassAndStylePlayerBuilder<any>| null) {\n value = sanitizer && value ? sanitizer(prop, value) : value;\n if (store || playerBuilder) {\n if (store) {\n store.setValue(prop, value);\n }\n if (playerBuilder) {\n playerBuilder.setValue(prop, value);\n }\n } else if (value) {\n value = value.toString(); // opacity, z-index and flexbox all have number values which may not\n // assign as numbers\n ngDevMode && ngDevMode.rendererSetStyle++;\n isProceduralRenderer(renderer) ?\n renderer.setStyle(native, prop, value, RendererStyleFlags3.DashCase) :\n native['style'].setProperty(prop, value);\n } else {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n isProceduralRenderer(renderer) ?\n renderer.removeStyle(native, prop, RendererStyleFlags3.DashCase) :\n native['style'].removeProperty(prop);\n }\n}\n\n/**\n * This function renders a given CSS class value using the provided\n * renderer (by adding or removing it from the provided element).\n * If a `store` value is provided then that will be used a render\n * context instead of the provided renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nfunction setClass(\n native: any, className: string, add: boolean, renderer: Renderer3, store?: BindingStore | null,\n playerBuilder?: ClassAndStylePlayerBuilder<any>| null) {\n if (store || playerBuilder) {\n if (store) {\n store.setValue(className, add);\n }\n if (playerBuilder) {\n playerBuilder.setValue(className, add);\n }\n } else if (add) {\n ngDevMode && ngDevMode.rendererAddClass++;\n isProceduralRenderer(renderer) ? renderer.addClass(native, className) :\n native['classList'].add(className);\n } else {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n isProceduralRenderer(renderer) ? renderer.removeClass(native, className) :\n native['classList'].remove(className);\n }\n}\n\nfunction setSanitizeFlag(context: StylingContext, index: number, sanitizeYes: boolean) {\n if (sanitizeYes) {\n (context[index] as number) |= StylingFlags.Sanitize;\n } else {\n (context[index] as number) &= ~StylingFlags.Sanitize;\n }\n}\n\nfunction setDirty(context: StylingContext, index: number, isDirtyYes: boolean) {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n if (isDirtyYes) {\n (context[adjustedIndex] as number) |= StylingFlags.Dirty;\n } else {\n (context[adjustedIndex] as number) &= ~StylingFlags.Dirty;\n }\n}\n\nfunction isDirty(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Dirty) == StylingFlags.Dirty;\n}\n\nexport function isClassBasedValue(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Class) == StylingFlags.Class;\n}\n\nfunction isSanitizable(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Sanitize) == StylingFlags.Sanitize;\n}\n\nfunction pointers(configFlag: number, staticIndex: number, dynamicIndex: number) {\n return (configFlag & StylingFlags.BitMask) | (staticIndex << StylingFlags.BitCountSize) |\n (dynamicIndex << (StylingIndex.BitCountSize + StylingFlags.BitCountSize));\n}\n\nfunction getInitialValue(context: StylingContext, flag: number): string|boolean|null {\n const index = getInitialIndex(flag);\n const entryIsClassBased = flag & StylingFlags.Class;\n const initialValues = entryIsClassBased ? context[StylingIndex.InitialClassValuesPosition] :\n context[StylingIndex.InitialStyleValuesPosition];\n return initialValues[index];\n}\n\nfunction getInitialIndex(flag: number): number {\n return (flag >> StylingFlags.BitCountSize) & StylingIndex.BitMask;\n}\n\nfunction getMultiOrSingleIndex(flag: number): number {\n const index =\n (flag >> (StylingIndex.BitCountSize + StylingFlags.BitCountSize)) & StylingIndex.BitMask;\n return index >= StylingIndex.SingleStylesStartPosition ? index : -1;\n}\n\nfunction getMultiStartIndex(context: StylingContext): number {\n return getMultiOrSingleIndex(context[StylingIndex.MasterFlagPosition]) as number;\n}\n\nfunction setProp(context: StylingContext, index: number, prop: string) {\n context[index + StylingIndex.PropertyOffset] = prop;\n}\n\nfunction setValue(context: StylingContext, index: number, value: string | null | boolean) {\n context[index + StylingIndex.ValueOffset] = value;\n}\n\nfunction hasPlayerBuilderChanged(\n context: StylingContext, builder: ClassAndStylePlayerBuilder<any>| null, index: number) {\n const playerContext = context[StylingIndex.PlayerContext] !;\n if (builder) {\n if (!playerContext || index === 0) {\n return true;\n }\n } else if (!playerContext) {\n return false;\n }\n return playerContext[index] !== builder;\n}\n\nfunction setPlayerBuilder(\n context: StylingContext, builder: ClassAndStylePlayerBuilder<any>| null,\n insertionIndex: number): number {\n let playerContext = context[StylingIndex.PlayerContext] || allocPlayerContext(context);\n if (insertionIndex > 0) {\n playerContext[insertionIndex] = builder;\n } else {\n insertionIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n playerContext.splice(insertionIndex, 0, builder, null);\n playerContext[PlayerIndex.NonBuilderPlayersStart] +=\n PlayerIndex.PlayerAndPlayerBuildersTupleSize;\n }\n return insertionIndex;\n}\n\nexport function directiveOwnerPointers(directiveIndex: number, playerIndex: number) {\n return (playerIndex << DirectiveOwnerAndPlayerBuilderIndex.BitCountSize) | directiveIndex;\n}\n\nfunction setPlayerBuilderIndex(\n context: StylingContext, index: number, playerBuilderIndex: number, directiveIndex: number) {\n const value = directiveOwnerPointers(directiveIndex, playerBuilderIndex);\n context[index + StylingIndex.PlayerBuilderIndexOffset] = value;\n}\n\nfunction getPlayerBuilderIndex(context: StylingContext, index: number): number {\n const flag = context[index + StylingIndex.PlayerBuilderIndexOffset] as number;\n const playerBuilderIndex = (flag >> DirectiveOwnerAndPlayerBuilderIndex.BitCountSize) &\n DirectiveOwnerAndPlayerBuilderIndex.BitMask;\n return playerBuilderIndex;\n}\n\nfunction getPlayerBuilder(context: StylingContext, index: number): ClassAndStylePlayerBuilder<any>|\n null {\n const playerBuilderIndex = getPlayerBuilderIndex(context, index);\n if (playerBuilderIndex) {\n const playerContext = context[StylingIndex.PlayerContext];\n if (playerContext) {\n return playerContext[playerBuilderIndex] as ClassAndStylePlayerBuilder<any>| null;\n }\n }\n return null;\n}\n\nfunction setFlag(context: StylingContext, index: number, flag: number) {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n context[adjustedIndex] = flag;\n}\n\nfunction getPointers(context: StylingContext, index: number): number {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n return context[adjustedIndex] as number;\n}\n\nexport function getValue(context: StylingContext, index: number): string|boolean|null {\n return context[index + StylingIndex.ValueOffset] as string | boolean | null;\n}\n\nexport function getProp(context: StylingContext, index: number): string {\n return context[index + StylingIndex.PropertyOffset] as string;\n}\n\nexport function isContextDirty(context: StylingContext): boolean {\n return isDirty(context, StylingIndex.MasterFlagPosition);\n}\n\nexport function limitToSingleClasses(context: StylingContext) {\n return context[StylingIndex.MasterFlagPosition] & StylingFlags.OnlyProcessSingleClasses;\n}\n\nexport function setContextDirty(context: StylingContext, isDirtyYes: boolean): void {\n setDirty(context, StylingIndex.MasterFlagPosition, isDirtyYes);\n}\n\nexport function setContextPlayersDirty(context: StylingContext, isDirtyYes: boolean): void {\n if (isDirtyYes) {\n (context[StylingIndex.MasterFlagPosition] as number) |= StylingFlags.PlayerBuildersDirty;\n } else {\n (context[StylingIndex.MasterFlagPosition] as number) &= ~StylingFlags.PlayerBuildersDirty;\n }\n}\n\nfunction findEntryPositionByProp(\n context: StylingContext, prop: string, startIndex?: number): number {\n for (let i = (startIndex || 0) + StylingIndex.PropertyOffset; i < context.length;\n i += StylingIndex.Size) {\n const thisProp = context[i];\n if (thisProp == prop) {\n return i - StylingIndex.PropertyOffset;\n }\n }\n return -1;\n}\n\nfunction swapMultiContextEntries(context: StylingContext, indexA: number, indexB: number) {\n const tmpValue = getValue(context, indexA);\n const tmpProp = getProp(context, indexA);\n const tmpFlag = getPointers(context, indexA);\n const tmpPlayerBuilderIndex = getPlayerBuilderIndex(context, indexA);\n\n let flagA = tmpFlag;\n let flagB = getPointers(context, indexB);\n\n const singleIndexA = getMultiOrSingleIndex(flagA);\n if (singleIndexA >= 0) {\n const _flag = getPointers(context, singleIndexA);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexA, pointers(_flag, _initial, indexB));\n }\n\n const singleIndexB = getMultiOrSingleIndex(flagB);\n if (singleIndexB >= 0) {\n const _flag = getPointers(context, singleIndexB);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexB, pointers(_flag, _initial, indexA));\n }\n\n setValue(context, indexA, getValue(context, indexB));\n setProp(context, indexA, getProp(context, indexB));\n setFlag(context, indexA, getPointers(context, indexB));\n const playerIndexA = getPlayerBuilderIndex(context, indexB);\n const directiveIndexA = 0;\n setPlayerBuilderIndex(context, indexA, playerIndexA, directiveIndexA);\n\n setValue(context, indexB, tmpValue);\n setProp(context, indexB, tmpProp);\n setFlag(context, indexB, tmpFlag);\n setPlayerBuilderIndex(context, indexB, tmpPlayerBuilderIndex, directiveIndexA);\n}\n\nfunction updateSinglePointerValues(context: StylingContext, indexStartPosition: number) {\n for (let i = indexStartPosition; i < context.length; i += StylingIndex.Size) {\n const multiFlag = getPointers(context, i);\n const singleIndex = getMultiOrSingleIndex(multiFlag);\n if (singleIndex > 0) {\n const singleFlag = getPointers(context, singleIndex);\n const initialIndexForSingle = getInitialIndex(singleFlag);\n const flagValue = (isDirty(context, singleIndex) ? StylingFlags.Dirty : StylingFlags.None) |\n (isClassBasedValue(context, singleIndex) ? StylingFlags.Class : StylingFlags.None) |\n (isSanitizable(context, singleIndex) ? StylingFlags.Sanitize : StylingFlags.None);\n const updatedFlag = pointers(flagValue, initialIndexForSingle, i);\n setFlag(context, singleIndex, updatedFlag);\n }\n }\n}\n\nfunction insertNewMultiProperty(\n context: StylingContext, index: number, classBased: boolean, name: string, flag: number,\n value: string | boolean, directiveIndex: number, playerIndex: number): void {\n const doShift = index < context.length;\n\n // prop does not exist in the list, add it in\n context.splice(\n index, 0, flag | StylingFlags.Dirty | (classBased ? StylingFlags.Class : StylingFlags.None),\n name, value, 0);\n setPlayerBuilderIndex(context, index, playerIndex, directiveIndex);\n\n if (doShift) {\n // because the value was inserted midway into the array then we\n // need to update all the shifted multi values' single value\n // pointers to point to the newly shifted location\n updateSinglePointerValues(context, index + StylingIndex.Size);\n }\n}\n\nfunction valueExists(value: string | null | boolean, isClassBased?: boolean) {\n if (isClassBased) {\n return value ? true : false;\n }\n return value !== null;\n}\n\nfunction prepareInitialFlag(\n context: StylingContext, prop: string, entryIsClassBased: boolean,\n sanitizer?: StyleSanitizeFn | null) {\n let flag = (sanitizer && sanitizer(prop)) ? StylingFlags.Sanitize : StylingFlags.None;\n\n let initialIndex: number;\n if (entryIsClassBased) {\n flag |= StylingFlags.Class;\n initialIndex =\n getInitialStylingValuesIndexOf(context[StylingIndex.InitialClassValuesPosition], prop);\n } else {\n initialIndex =\n getInitialStylingValuesIndexOf(context[StylingIndex.InitialStyleValuesPosition], prop);\n }\n\n initialIndex = initialIndex > 0 ? (initialIndex + InitialStylingValuesIndex.ValueOffset) : 0;\n return pointers(flag, initialIndex, 0);\n}\n\nfunction hasValueChanged(\n flag: number, a: string | boolean | null, b: string | boolean | null): boolean {\n const isClassBased = flag & StylingFlags.Class;\n const hasValues = a && b;\n const usesSanitizer = flag & StylingFlags.Sanitize;\n // the toString() comparison ensures that a value is checked\n // ... otherwise (during sanitization bypassing) the === comparsion\n // would fail since a new String() instance is created\n if (!isClassBased && hasValues && usesSanitizer) {\n // we know for sure we're dealing with strings at this point\n return (a as string).toString() !== (b as string).toString();\n }\n\n // everything else is safe to check with a normal equality check\n return a !== b;\n}\n\nexport class ClassAndStylePlayerBuilder<T> implements PlayerBuilder {\n private _values: {[key: string]: string | null} = {};\n private _dirty = false;\n private _factory: BoundPlayerFactory<T>;\n\n constructor(factory: PlayerFactory, private _element: HTMLElement, private _type: BindingType) {\n this._factory = factory as any;\n }\n\n setValue(prop: string, value: any) {\n if (this._values[prop] !== value) {\n this._values[prop] = value;\n this._dirty = true;\n }\n }\n\n buildPlayer(currentPlayer: Player|null, isFirstRender: boolean): Player|undefined|null {\n // if no values have been set here then this means the binding didn't\n // change and therefore the binding values were not updated through\n // `setValue` which means no new player will be provided.\n if (this._dirty) {\n const player = this._factory.fn(\n this._element, this._type, this._values !, isFirstRender, currentPlayer || null);\n this._values = {};\n this._dirty = false;\n return player;\n }\n\n return undefined;\n }\n}\n\n/**\n * Used to provide a summary of the state of the styling context.\n *\n * This is an internal interface that is only used inside of test tooling to\n * help summarize what's going on within the styling context. None of this code\n * is designed to be exported publicly and will, therefore, be tree-shaken away\n * during runtime.\n */\nexport interface LogSummary {\n name: string; //\n staticIndex: number; //\n dynamicIndex: number; //\n value: number; //\n flags: {\n dirty: boolean; //\n class: boolean; //\n sanitize: boolean; //\n playerBuildersDirty: boolean; //\n onlyProcessSingleClasses: boolean; //\n bindingAllocationLocked: boolean; //\n };\n}\n\n/**\n * This function is not designed to be used in production.\n * It is a utility tool for debugging and testing and it\n * will automatically be tree-shaken away during production.\n */\nexport function generateConfigSummary(source: number): LogSummary;\nexport function generateConfigSummary(source: StylingContext): LogSummary;\nexport function generateConfigSummary(source: StylingContext, index: number): LogSummary;\nexport function generateConfigSummary(source: number | StylingContext, index?: number): LogSummary {\n let flag, name = 'config value for ';\n if (Array.isArray(source)) {\n if (index) {\n name += 'index: ' + index;\n } else {\n name += 'master config';\n }\n index = index || StylingIndex.MasterFlagPosition;\n flag = source[index] as number;\n } else {\n flag = source;\n name += 'index: ' + flag;\n }\n const dynamicIndex = getMultiOrSingleIndex(flag);\n const staticIndex = getInitialIndex(flag);\n return {\n name,\n staticIndex,\n dynamicIndex,\n value: flag,\n flags: {\n dirty: flag & StylingFlags.Dirty ? true : false,\n class: flag & StylingFlags.Class ? true : false,\n sanitize: flag & StylingFlags.Sanitize ? true : false,\n playerBuildersDirty: flag & StylingFlags.PlayerBuildersDirty ? true : false,\n onlyProcessSingleClasses: flag & StylingFlags.OnlyProcessSingleClasses ? true : false,\n bindingAllocationLocked: flag & StylingFlags.BindingAllocationLocked ? true : false,\n }\n };\n}\n\nexport function getDirectiveIndexFromEntry(context: StylingContext, index: number) {\n const value = context[index + StylingIndex.PlayerBuilderIndexOffset] as number;\n return value & DirectiveOwnerAndPlayerBuilderIndex.BitMask;\n}\n\nfunction getDirectiveIndexFromRegistry(context: StylingContext, directive: any) {\n const index =\n getDirectiveRegistryValuesIndexOf(context[StylingIndex.DirectiveRegistryPosition], directive);\n ngDevMode &&\n assertNotEqual(\n index, -1,\n `The provided directive ${directive} has not been allocated to the element\\'s style/class bindings`);\n return index > 0 ? index / DirectiveRegistryValuesIndex.Size : 0;\n // return index / DirectiveRegistryValuesIndex.Size;\n}\n\nfunction getDirectiveRegistryValuesIndexOf(\n directives: DirectiveRegistryValues, directive: {}): number {\n for (let i = 0; i < directives.length; i += DirectiveRegistryValuesIndex.Size) {\n if (directives[i] === directive) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getInitialStylingValuesIndexOf(keyValues: InitialStylingValues, key: string): number {\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < keyValues.length;\n i += InitialStylingValuesIndex.Size) {\n if (keyValues[i] === key) return i;\n }\n return -1;\n}\n\nexport function compareLogSummaries(a: LogSummary, b: LogSummary) {\n const log: string[] = [];\n const diffs: [string, any, any][] = [];\n diffSummaryValues(diffs, 'staticIndex', 'staticIndex', a, b);\n diffSummaryValues(diffs, 'dynamicIndex', 'dynamicIndex', a, b);\n Object.keys(a.flags).forEach(\n name => { diffSummaryValues(diffs, 'flags.' + name, name, a.flags, b.flags); });\n\n if (diffs.length) {\n log.push('Log Summaries for:');\n log.push(' A: ' + a.name);\n log.push(' B: ' + b.name);\n log.push('\\n Differ in the following way (A !== B):');\n diffs.forEach(result => {\n const [name, aVal, bVal] = result;\n log.push(' => ' + name);\n log.push(' => ' + aVal + ' !== ' + bVal + '\\n');\n });\n }\n\n return log;\n}\n\nfunction diffSummaryValues(result: any[], name: string, prop: string, a: any, b: any) {\n const aVal = a[prop];\n const bVal = b[prop];\n if (aVal !== bVal) {\n result.push([name, aVal, bVal]);\n }\n}\n\nfunction getSinglePropIndexValue(\n context: StylingContext, directiveIndex: number, offset: number, isClassBased: boolean) {\n const singlePropOffsetRegistryIndex =\n context[StylingIndex.DirectiveRegistryPosition]\n [(directiveIndex * DirectiveRegistryValuesIndex.Size) +\n DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset] as number;\n const offsets = context[StylingIndex.SinglePropOffsetPositions];\n const indexForOffset = singlePropOffsetRegistryIndex +\n SinglePropOffsetValuesIndex.ValueStartPosition +\n (isClassBased ?\n offsets\n [singlePropOffsetRegistryIndex + SinglePropOffsetValuesIndex.StylesCountPosition] :\n 0) +\n offset;\n return offsets[indexForOffset];\n}\n\nfunction getStyleSanitizer(context: StylingContext, directiveIndex: number): StyleSanitizeFn|null {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n const value = dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.StyleSanitizerOffset] ||\n dirs[DirectiveRegistryValuesIndex.StyleSanitizerOffset] || null;\n return value as StyleSanitizeFn | null;\n}\n\nfunction isDirectiveDirty(context: StylingContext, directiveIndex: number): boolean {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n return dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.DirtyFlagOffset] as boolean;\n}\n\nfunction setDirectiveDirty(\n context: StylingContext, directiveIndex: number, dirtyYes: boolean): void {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.DirtyFlagOffset] = dirtyYes;\n}\n\nfunction allowValueChange(\n currentValue: string | boolean | null, newValue: string | boolean | null,\n currentDirectiveOwner: number, newDirectiveOwner: number) {\n // the code below relies the importance of directive's being tied to their\n // index value. The index values for each directive are derived from being\n // registered into the styling context directive registry. The most important\n // directive is the parent component directive (the template) and each directive\n // that is added after is considered less important than the previous entry. This\n // prioritization of directives enables the styling algorithm to decide if a style\n // or class should be allowed to be updated/replaced incase an earlier directive\n // already wrote to the exact same style-property or className value. In other words\n // ... this decides what to do if and when there is a collision.\n if (currentValue) {\n if (newValue) {\n // if a directive index is lower than it always has priority over the\n // previous directive's value...\n return newDirectiveOwner <= currentDirectiveOwner;\n } else {\n // only write a null value incase it's the same owner writing it.\n // this avoids having a higher-priority directive write to null\n // only to have a lesser-priority directive change right to a\n // non-null value immediately afterwards.\n return currentDirectiveOwner === newDirectiveOwner;\n }\n }\n return true;\n}\n\n/**\n * This function is only designed to be called for `[class]` bindings when\n * `[ngClass]` (or something that uses `class` as an input) is present. Once\n * directive host bindings fully work for `[class]` and `[style]` inputs\n * then this can be deleted.\n */\nexport function getInitialClassNameValue(context: StylingContext): string {\n let className = context[StylingIndex.CachedClassValueOrInitialClassString] as string;\n if (className == null) {\n className = '';\n const initialClassValues = context[StylingIndex.InitialClassValuesPosition];\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialClassValues.length;\n i += InitialStylingValuesIndex.Size) {\n const isPresent = initialClassValues[i + 1];\n if (isPresent) {\n className += (className.length ? ' ' : '') + initialClassValues[i];\n }\n }\n context[StylingIndex.CachedClassValueOrInitialClassString] = className;\n }\n return className;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {QueryList} from '../linker';\nimport {Sanitizer} from '../sanitization/security';\nimport {StyleSanitizeFn} from '../sanitization/style_sanitizer';\nimport {Type} from '../type';\nimport {normalizeDebugBindingName, normalizeDebugBindingValue} from '../util/ng_reflect';\n\nimport {assertDataInRange, assertDefined, assertEqual, assertHasParent, assertLessThan, assertNotEqual, assertPreviousIsParent} from './assert';\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4} from './bindings';\nimport {attachPatchData, getComponentViewByInstance} from './context_discovery';\nimport {diPublicInInjector, getNodeInjectable, getOrCreateInjectable, getOrCreateNodeInjectorForNode, injectAttributeImpl} from './di';\nimport {throwMultipleComponentError} from './errors';\nimport {executeHooks, executeInitHooks, queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {ACTIVE_INDEX, LContainer, VIEWS} from './interfaces/container';\nimport {ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefListOrFactory, PipeDefListOrFactory, RenderFlags} from './interfaces/definition';\nimport {INJECTOR_BLOOM_PARENT_SIZE, NodeInjectorFactory} from './interfaces/injector';\nimport {AttributeMarker, InitialInputData, InitialInputs, LocalRefExtractor, PropertyAliasValue, PropertyAliases, TAttributes, TContainerNode, TElementContainerNode, TElementNode, TIcuContainerNode, TNode, TNodeFlags, TNodeProviderIndexes, TNodeType, TProjectionNode, TViewNode} from './interfaces/node';\nimport {PlayerFactory} from './interfaces/player';\nimport {CssSelectorList, NG_PROJECT_AS_ATTR_NAME} from './interfaces/projection';\nimport {LQueries} from './interfaces/query';\nimport {ProceduralRenderer3, RComment, RElement, RText, Renderer3, RendererFactory3, isProceduralRenderer} from './interfaces/renderer';\nimport {SanitizerFn} from './interfaces/sanitization';\nimport {BINDING_INDEX, CLEANUP, CONTAINER_INDEX, CONTENT_QUERIES, CONTEXT, DECLARATION_VIEW, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, INJECTOR, LView, LViewFlags, NEXT, OpaqueViewState, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, RootContext, RootContextFlags, SANITIZER, TAIL, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';\nimport {appendChild, appendProjectedNode, createTextNode, getLViewChild, getRenderParent, insertView, removeView} from './node_manipulation';\nimport {isNodeMatchingSelectorList, matchingSelectorIndex} from './node_selector_matcher';\nimport {decreaseElementDepthCount, enterView, getBindingsEnabled, getCheckNoChangesMode, getContextLView, getCurrentDirectiveDef, getElementDepthCount, getFirstTemplatePass, getIsParent, getLView, getPreviousOrParentTNode, increaseElementDepthCount, isCreationMode, leaveView, nextContextImpl, resetComponentState, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setFirstTemplatePass, setIsParent, setPreviousOrParentTNode} from './state';\nimport {getInitialClassNameValue, initializeStaticContext as initializeStaticStylingContext, patchContextWithStaticAttrs, renderInitialStylesAndClasses, renderStyling, updateClassProp as updateElementClassProp, updateContextWithBindings, updateStyleProp as updateElementStyleProp, updateStylingMap} from './styling/class_and_style_bindings';\nimport {BoundPlayerFactory} from './styling/player_factory';\nimport {createEmptyStylingContext, getStylingContext, hasClassInput, hasStyling, isAnimationProp} from './styling/util';\nimport {NO_CHANGE} from './tokens';\nimport {findComponentView, getComponentViewByIndex, getNativeByIndex, getNativeByTNode, getRootContext, getRootView, getTNode, isComponent, isComponentDef, loadInternal, readElementValue, readPatchedLView, stringify} from './util';\n\n\n\n/**\n * A permanent marker promise which signifies that the current CD tree is\n * clean.\n */\nconst _CLEAN_PROMISE = Promise.resolve(null);\n\nconst enum BindingDirection {\n Input,\n Output,\n}\n\n/**\n * Refreshes the view, executing the following steps in that order:\n * triggers init hooks, refreshes dynamic embedded views, triggers content hooks, sets host\n * bindings, refreshes child components.\n * Note: view hooks are triggered later when leaving the view.\n */\nexport function refreshDescendantViews(lView: LView) {\n const tView = lView[TVIEW];\n // This needs to be set before children are processed to support recursive components\n tView.firstTemplatePass = false;\n setFirstTemplatePass(false);\n\n // If this is a creation pass, we should not call lifecycle hooks or evaluate bindings.\n // This will be done in the update pass.\n if (!isCreationMode(lView)) {\n const checkNoChangesMode = getCheckNoChangesMode();\n\n executeInitHooks(lView, tView, checkNoChangesMode);\n\n refreshDynamicEmbeddedViews(lView);\n\n // Content query results must be refreshed before content hooks are called.\n refreshContentQueries(tView);\n\n executeHooks(lView, tView.contentHooks, tView.contentCheckHooks, checkNoChangesMode);\n\n setHostBindings(tView, lView);\n }\n\n refreshChildComponents(tView.components);\n}\n\n\n/** Sets the host bindings for the current view. */\nexport function setHostBindings(tView: TView, viewData: LView): void {\n if (tView.expandoInstructions) {\n let bindingRootIndex = viewData[BINDING_INDEX] = tView.expandoStartIndex;\n setBindingRoot(bindingRootIndex);\n let currentDirectiveIndex = -1;\n let currentElementIndex = -1;\n for (let i = 0; i < tView.expandoInstructions.length; i++) {\n const instruction = tView.expandoInstructions[i];\n if (typeof instruction === 'number') {\n if (instruction <= 0) {\n // Negative numbers mean that we are starting new EXPANDO block and need to update\n // the current element and directive index.\n currentElementIndex = -instruction;\n // Injector block and providers are taken into account.\n const providerCount = (tView.expandoInstructions[++i] as number);\n bindingRootIndex += INJECTOR_BLOOM_PARENT_SIZE + providerCount;\n\n currentDirectiveIndex = bindingRootIndex;\n } else {\n // This is either the injector size (so the binding root can skip over directives\n // and get to the first set of host bindings on this node) or the host var count\n // (to get to the next set of host bindings on this node).\n bindingRootIndex += instruction;\n }\n setBindingRoot(bindingRootIndex);\n } else {\n // If it's not a number, it's a host binding function that needs to be executed.\n if (instruction !== null) {\n viewData[BINDING_INDEX] = bindingRootIndex;\n instruction(\n RenderFlags.Update, readElementValue(viewData[currentDirectiveIndex]),\n currentElementIndex);\n }\n currentDirectiveIndex++;\n }\n }\n }\n}\n\n/** Refreshes content queries for all directives in the given view. */\nfunction refreshContentQueries(tView: TView): void {\n if (tView.contentQueries != null) {\n for (let i = 0; i < tView.contentQueries.length; i += 2) {\n const directiveDefIdx = tView.contentQueries[i];\n const directiveDef = tView.data[directiveDefIdx] as DirectiveDef<any>;\n\n directiveDef.contentQueriesRefresh !(\n directiveDefIdx - HEADER_OFFSET, tView.contentQueries[i + 1]);\n }\n }\n}\n\n/** Refreshes child components in the current view. */\nfunction refreshChildComponents(components: number[] | null): void {\n if (components != null) {\n for (let i = 0; i < components.length; i++) {\n componentRefresh(components[i]);\n }\n }\n}\n\nexport function createLView<T>(\n parentLView: LView | null, tView: TView, context: T | null, flags: LViewFlags,\n rendererFactory?: RendererFactory3 | null, renderer?: Renderer3 | null,\n sanitizer?: Sanitizer | null, injector?: Injector | null): LView {\n const lView = tView.blueprint.slice() as LView;\n lView[FLAGS] = flags | LViewFlags.CreationMode | LViewFlags.Attached | LViewFlags.RunInit |\n LViewFlags.FirstLViewPass;\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]) !;\n ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');\n lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]) !;\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null !;\n lView[INJECTOR as any] = injector || parentLView && parentLView[INJECTOR] || null;\n return lView;\n}\n\n/**\n * Create and stores the TNode, and hooks it up to the tree.\n *\n * @param index The index at which the TNode should be saved (null if view, since they are not\n * saved).\n * @param type The type of TNode to create\n * @param native The native element for this node, if applicable\n * @param name The tag name of the associated native element, if applicable\n * @param attrs Any attrs for the native element, if applicable\n */\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Element, native: RElement | RText | null, name: string | null,\n attrs: TAttributes | null): TElementNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Container, native: RComment, name: string | null,\n attrs: TAttributes | null): TContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Projection, native: null, name: null,\n attrs: TAttributes | null): TProjectionNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.ElementContainer, native: RComment, name: string | null,\n attrs: TAttributes | null): TElementContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.IcuContainer, native: RComment, name: null,\n attrs: TAttributes | null): TElementContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType, native: RText | RElement | RComment | null, name: string | null,\n attrs: TAttributes | null): TElementNode&TContainerNode&TElementContainerNode&TProjectionNode&\n TIcuContainerNode {\n const lView = getLView();\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode &&\n assertLessThan(adjustedIndex, lView.length, `Slot should have been initialized with null`);\n lView[adjustedIndex] = native;\n\n let tNode = tView.data[adjustedIndex] as TNode;\n if (tNode == null) {\n // TODO(misko): Refactor createTNode so that it does not depend on LView.\n tNode = tView.data[adjustedIndex] = createTNode(lView, type, adjustedIndex, name, attrs, null);\n }\n\n // Now link ourselves into the tree.\n // We need this even if tNode exists, otherwise we might end up pointing to unexisting tNodes when\n // we use i18n (especially with ICU expressions that update the DOM during the update phase).\n const previousOrParentTNode = getPreviousOrParentTNode();\n const isParent = getIsParent();\n if (previousOrParentTNode) {\n if (isParent && previousOrParentTNode.child == null &&\n (tNode.parent !== null || previousOrParentTNode.type === TNodeType.View)) {\n // We are in the same view, which means we are adding content node to the parent view.\n previousOrParentTNode.child = tNode;\n } else if (!isParent) {\n previousOrParentTNode.next = tNode;\n }\n }\n\n if (tView.firstChild == null) {\n tView.firstChild = tNode;\n }\n\n setPreviousOrParentTNode(tNode);\n setIsParent(true);\n return tNode as TElementNode & TViewNode & TContainerNode & TElementContainerNode &\n TProjectionNode & TIcuContainerNode;\n}\n\nexport function createViewNode(index: number, view: LView) {\n // View nodes are not stored in data because they can be added / removed at runtime (which\n // would cause indices to change). Their TNodes are instead stored in tView.node.\n if (view[TVIEW].node == null) {\n view[TVIEW].node = createTNode(view, TNodeType.View, index, null, null, null) as TViewNode;\n }\n\n return view[HOST_NODE] = view[TVIEW].node as TViewNode;\n}\n\n\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply() or ComponentFactory.create), we need to adjust the blueprint for future\n * template passes.\n */\nexport function allocExpando(view: LView) {\n const tView = view[TVIEW];\n if (tView.firstTemplatePass) {\n tView.expandoStartIndex++;\n tView.blueprint.push(null);\n tView.data.push(null);\n view.push(null);\n }\n}\n\n\n//////////////////////////\n//// Render\n//////////////////////////\n\n/**\n *\n * @param hostNode Existing node to render into.\n * @param templateFn Template function with the instructions.\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param context to pass into the template.\n * @param providedRendererFactory renderer factory to use\n * @param host The host element node to use\n * @param directives Directive defs that should be used for matching\n * @param pipes Pipe defs that should be used for matching\n */\nexport function renderTemplate<T>(\n hostNode: RElement, templateFn: ComponentTemplate<T>, consts: number, vars: number, context: T,\n providedRendererFactory: RendererFactory3, hostView: LView | null,\n directives?: DirectiveDefListOrFactory | null, pipes?: PipeDefListOrFactory | null,\n sanitizer?: Sanitizer | null): LView {\n if (hostView == null) {\n resetComponentState();\n const renderer = providedRendererFactory.createRenderer(null, null);\n\n // We need to create a root view so it's possible to look up the host element through its index\n const hostLView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), {},\n LViewFlags.CheckAlways | LViewFlags.IsRoot, providedRendererFactory, renderer);\n enterView(hostLView, null); // SUSPECT! why do we need to enter the View?\n\n const componentTView =\n getOrCreateTView(templateFn, consts, vars, directives || null, pipes || null, null);\n hostView = createLView(\n hostLView, componentTView, context, LViewFlags.CheckAlways, providedRendererFactory,\n renderer, sanitizer);\n hostView[HOST_NODE] = createNodeAtIndex(0, TNodeType.Element, hostNode, null, null);\n }\n renderComponentOrTemplate(hostView, context, templateFn);\n return hostView;\n}\n\n/**\n * Used for creating the LViewNode of a dynamic embedded view,\n * either through ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().\n * Such lViewNode will then be renderer with renderEmbeddedTemplate() (see below).\n */\nexport function createEmbeddedViewAndNode<T>(\n tView: TView, context: T, declarationView: LView, renderer: Renderer3, queries: LQueries | null,\n injectorIndex: number): LView {\n const _isParent = getIsParent();\n const _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n\n const lView = createLView(declarationView, tView, context, LViewFlags.CheckAlways);\n lView[DECLARATION_VIEW] = declarationView;\n\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n\n if (tView.firstTemplatePass) {\n tView.node !.injectorIndex = injectorIndex;\n }\n\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}\n\n/**\n * Used for rendering embedded views (e.g. dynamically created views)\n *\n * Dynamically created views must store/retrieve their TViews differently from component views\n * because their template functions are nested in the template functions of their hosts, creating\n * closures. If their host template happens to be an embedded template in a loop (e.g. ngFor inside\n * an ngFor), the nesting would mean we'd have multiple instances of the template function, so we\n * can't store TViews in the template function itself (as we do for comps). Instead, we store the\n * TView for dynamically created views on their host TNode, which only has one instance.\n */\nexport function renderEmbeddedTemplate<T>(viewToRender: LView, tView: TView, context: T) {\n const _isParent = getIsParent();\n const _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n let oldView: LView;\n if (viewToRender[FLAGS] & LViewFlags.IsRoot) {\n // This is a root view inside the view tree\n tickRootContext(getRootContext(viewToRender));\n } else {\n try {\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n\n oldView = enterView(viewToRender, viewToRender[HOST_NODE]);\n namespaceHTML();\n tView.template !(getRenderFlags(viewToRender), context);\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstTemplatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n viewToRender[TVIEW].firstTemplatePass = false;\n setFirstTemplatePass(false);\n\n refreshDescendantViews(viewToRender);\n } finally {\n leaveView(oldView !);\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n }\n }\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n */\nexport function nextContext<T = any>(level: number = 1): T {\n return nextContextImpl(level);\n}\n\nfunction renderComponentOrTemplate<T>(\n hostView: LView, context: T, templateFn?: ComponentTemplate<T>) {\n const rendererFactory = hostView[RENDERER_FACTORY];\n const oldView = enterView(hostView, hostView[HOST_NODE]);\n const normalExecutionPath = !getCheckNoChangesMode();\n try {\n if (normalExecutionPath && rendererFactory.begin) {\n rendererFactory.begin();\n }\n\n if (isCreationMode(hostView)) {\n // creation mode pass\n if (templateFn) {\n namespaceHTML();\n templateFn(RenderFlags.Create, context !);\n }\n\n refreshDescendantViews(hostView);\n hostView[FLAGS] &= ~LViewFlags.CreationMode;\n }\n\n // update mode pass\n templateFn && templateFn(RenderFlags.Update, context !);\n refreshDescendantViews(hostView);\n } finally {\n if (normalExecutionPath && rendererFactory.end) {\n rendererFactory.end();\n }\n leaveView(oldView);\n }\n}\n\n/**\n * This function returns the default configuration of rendering flags depending on when the\n * template is in creation mode or update mode. Update block and create block are\n * always run separately.\n */\nfunction getRenderFlags(view: LView): RenderFlags {\n return isCreationMode(view) ? RenderFlags.Create : RenderFlags.Update;\n}\n\n//////////////////////////\n//// Namespace\n//////////////////////////\n\nlet _currentNamespace: string|null = null;\n\nexport function namespaceSVG() {\n _currentNamespace = 'http://www.w3.org/2000/svg';\n}\n\nexport function namespaceMathML() {\n _currentNamespace = 'http://www.w3.org/1998/MathML/';\n}\n\nexport function namespaceHTML() {\n _currentNamespace = null;\n}\n\n//////////////////////////\n//// Element\n//////////////////////////\n\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM\n * element on creation. Use [AttributeMarker] to denote the meaning of this array.\n * @param localRefs A set of local reference bindings on the element.\n */\nexport function element(\n index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n elementStart(index, name, attrs, localRefs);\n elementEnd();\n}\n\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrs Set of attributes to be used when matching directives.\n * @param localRefs A set of local reference bindings on the element.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n */\nexport function elementContainerStart(\n index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n const renderer = lView[RENDERER];\n const tagName = 'ng-container';\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], tView.bindingStartIndex,\n 'element containers should be created before any bindings');\n\n ngDevMode && ngDevMode.rendererCreateComment++;\n const native = renderer.createComment(ngDevMode ? tagName : '');\n\n ngDevMode && assertDataInRange(lView, index - 1);\n const tNode =\n createNodeAtIndex(index, TNodeType.ElementContainer, native, tagName, attrs || null);\n\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n attachPatchData(native, lView);\n}\n\n/** Mark the end of the <ng-container>. */\nexport function elementContainerEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n const lView = getLView();\n const tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.ElementContainer);\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TElementContainerNode);\n }\n\n queueLifecycleHooks(tView, previousOrParentTNode);\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM\n * element on creation. Use [AttributeMarker] to denote the meaning of this array.\n * @param localRefs A set of local reference bindings on the element.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n */\nexport function elementStart(\n index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], tView.bindingStartIndex,\n 'elements should be created before any bindings ');\n\n ngDevMode && ngDevMode.rendererCreateElement++;\n\n const native = elementCreate(name);\n\n ngDevMode && assertDataInRange(lView, index - 1);\n\n const tNode = createNodeAtIndex(index, TNodeType.Element, native !, name, attrs || null);\n\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticStylingContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n const inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= TNodeFlags.hasClassInput;\n }\n }\n\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & TNodeFlags.hasClassInput) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}\n\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param name the tag name\n * @param overriddenRenderer Optional A renderer to override the default one\n * @returns the element created\n */\nexport function elementCreate(name: string, overriddenRenderer?: Renderer3): RElement {\n let native: RElement;\n const rendererToUse = overriddenRenderer || getLView()[RENDERER];\n\n if (isProceduralRenderer(rendererToUse)) {\n native = rendererToUse.createElement(name, _currentNamespace);\n } else {\n if (_currentNamespace === null) {\n native = rendererToUse.createElement(name);\n } else {\n native = rendererToUse.createElementNS(_currentNamespace, name);\n }\n }\n return native;\n}\n\n/**\n * Creates directive instances and populates local refs.\n *\n * @param localRefs Local refs of the node in question\n * @param localRefExtractor mapping function that extracts local ref value from TNode\n */\nfunction createDirectivesAndLocals(\n tView: TView, viewData: LView, localRefs: string[] | null | undefined,\n localRefExtractor: LocalRefExtractor = getNativeByTNode) {\n if (!getBindingsEnabled()) return;\n const previousOrParentTNode = getPreviousOrParentTNode();\n if (getFirstTemplatePass()) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n\n resolveDirectives(\n tView, viewData, findDirectiveMatches(tView, viewData, previousOrParentTNode),\n previousOrParentTNode, localRefs || null);\n }\n instantiateAllDirectives(tView, viewData, previousOrParentTNode);\n invokeDirectivesHostBindings(tView, viewData, previousOrParentTNode);\n saveResolvedLocalsInData(viewData, previousOrParentTNode, localRefExtractor);\n}\n\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(\n viewData: LView, tNode: TNode, localRefExtractor: LocalRefExtractor): void {\n const localNames = tNode.localNames;\n if (localNames) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1] as number;\n const value = index === -1 ?\n localRefExtractor(\n tNode as TElementNode | TContainerNode | TElementContainerNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param templateFn The template from which to get static data\n * @param consts The number of nodes, local refs, and pipes in this view\n * @param vars The number of bindings and pure function bindings in this view\n * @param directives Directive defs that should be saved on TView\n * @param pipes Pipe defs that should be saved on TView\n * @returns TView\n */\nexport function getOrCreateTView(\n templateFn: ComponentTemplate<any>, consts: number, vars: number,\n directives: DirectiveDefListOrFactory | null, pipes: PipeDefListOrFactory | null,\n viewQuery: ComponentQuery<any>| null): TView {\n // TODO(misko): reading `ngPrivateData` here is problematic for two reasons\n // 1. It is a megamorphic call on each invocation.\n // 2. For nested embedded views (ngFor inside ngFor) the template instance is per\n // outer template invocation, which means that no such property will exist\n // Correct solution is to only put `ngPrivateData` on the Component template\n // and not on embedded templates.\n\n return templateFn.ngPrivateData ||\n (templateFn.ngPrivateData =\n createTView(-1, templateFn, consts, vars, directives, pipes, viewQuery) as never);\n}\n\n/**\n * Creates a TView instance\n *\n * @param viewIndex The viewBlockId for inline views, or -1 if it's a component/dynamic\n * @param templateFn Template function\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n */\nexport function createTView(\n viewIndex: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,\n directives: DirectiveDefListOrFactory | null, pipes: PipeDefListOrFactory | null,\n viewQuery: ComponentQuery<any>| null): TView {\n ngDevMode && ngDevMode.tView++;\n const bindingStartIndex = HEADER_OFFSET + consts;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n return blueprint[TVIEW as any] = {\n id: viewIndex,\n blueprint: blueprint,\n template: templateFn,\n viewQuery: viewQuery,\n node: null !,\n data: blueprint.slice(), // Fill in to match HEADER_OFFSET in LView\n childIndex: -1, // Children set in addToViewTree(), if any\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n expandoInstructions: null,\n firstTemplatePass: true,\n initHooks: null,\n checkHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n pipeDestroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n };\n}\n\nfunction createViewBlueprint(bindingStartIndex: number, initialViewLength: number): LView {\n const blueprint = new Array(initialViewLength)\n .fill(null, 0, bindingStartIndex)\n .fill(NO_CHANGE, bindingStartIndex) as LView;\n blueprint[CONTAINER_INDEX] = -1;\n blueprint[BINDING_INDEX] = bindingStartIndex;\n return blueprint;\n}\n\nfunction setUpAttributes(native: RElement, attrs: TAttributes): void {\n const renderer = getLView()[RENDERER];\n const isProc = isProceduralRenderer(renderer);\n let i = 0;\n\n while (i < attrs.length) {\n const attrName = attrs[i++];\n if (typeof attrName == 'number') {\n if (attrName === AttributeMarker.NamespaceURI) {\n // Namespaced attributes\n const namespaceURI = attrs[i++] as string;\n const attrName = attrs[i++] as string;\n const attrVal = attrs[i++] as string;\n ngDevMode && ngDevMode.rendererSetAttribute++;\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName, attrVal, namespaceURI) :\n native.setAttributeNS(namespaceURI, attrName, attrVal);\n } else {\n // All other `AttributeMarker`s are ignored here.\n break;\n }\n } else {\n /// attrName is string;\n const attrVal = attrs[i++];\n if (attrName !== NG_PROJECT_AS_ATTR_NAME) {\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n if (isProc) {\n (renderer as ProceduralRenderer3).setProperty(native, attrName, attrVal);\n }\n } else {\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName as string, attrVal as string) :\n native.setAttribute(attrName as string, attrVal as string);\n }\n }\n }\n }\n}\n\nexport function createError(text: string, token: any) {\n return new Error(`Renderer: ${text} [${stringify(token)}]`);\n}\n\n\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param elementOrSelector Render element or CSS selector to locate the element.\n */\nexport function locateHostElement(\n factory: RendererFactory3, elementOrSelector: RElement | string): RElement|null {\n const defaultRenderer = factory.createRenderer(null, null);\n const rNode = typeof elementOrSelector === 'string' ?\n (isProceduralRenderer(defaultRenderer) ?\n defaultRenderer.selectRootElement(elementOrSelector) :\n defaultRenderer.querySelector(elementOrSelector)) :\n elementOrSelector;\n if (ngDevMode && !rNode) {\n if (typeof elementOrSelector === 'string') {\n throw createError('Host node with selector not found:', elementOrSelector);\n } else {\n throw createError('Host node is required:', elementOrSelector);\n }\n }\n return rNode;\n}\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener.\n */\nexport function listener(\n eventName: string, listenerFn: (e?: any) => any, useCapture = false): void {\n const lView = getLView();\n const tNode = getPreviousOrParentTNode();\n const tView = lView[TVIEW];\n const firstTemplatePass = tView.firstTemplatePass;\n const tCleanup: false|any[] = firstTemplatePass && (tView.cleanup || (tView.cleanup = []));\n ngDevMode && assertNodeOfPossibleTypes(\n tNode, TNodeType.Element, TNodeType.Container, TNodeType.ElementContainer);\n\n // add native event listener - applicable to elements only\n if (tNode.type === TNodeType.Element) {\n const native = getNativeByTNode(tNode, lView) as RElement;\n ngDevMode && ngDevMode.rendererAddEventListener++;\n const renderer = lView[RENDERER];\n const lCleanup = getCleanup(lView);\n const lCleanupIndex = lCleanup.length;\n let useCaptureOrSubIdx: boolean|number = useCapture;\n\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n const cleanupFn = renderer.listen(native, eventName, listenerFn);\n lCleanup.push(listenerFn, cleanupFn);\n useCaptureOrSubIdx = lCleanupIndex + 1;\n } else {\n const wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n lCleanup.push(wrappedListener);\n }\n tCleanup && tCleanup.push(eventName, tNode.index, lCleanupIndex, useCaptureOrSubIdx);\n }\n\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode, BindingDirection.Output);\n }\n\n const outputs = tNode.outputs;\n let props: PropertyAliasValue|undefined;\n if (outputs && (props = outputs[eventName])) {\n const propsLength = props.length;\n if (propsLength) {\n const lCleanup = getCleanup(lView);\n for (let i = 0; i < propsLength; i += 2) {\n ngDevMode && assertDataInRange(lView, props[i] as number);\n const subscription = lView[props[i] as number][props[i + 1]].subscribe(listenerFn);\n const idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}\n\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n */\nexport function storeCleanupWithContext(lView: LView, context: any, cleanupFn: Function): void {\n const lCleanup = getCleanup(lView);\n lCleanup.push(context);\n\n if (lView[TVIEW].firstTemplatePass) {\n getTViewCleanup(lView).push(cleanupFn, lCleanup.length - 1);\n }\n}\n\n/**\n * Saves the cleanup function itself in LView.cleanupInstances.\n *\n * This is necessary for functions that are wrapped with their contexts, like in renderer2\n * listeners.\n *\n * On the first template pass, the index of the cleanup function is saved in TView.\n */\nexport function storeCleanupFn(view: LView, cleanupFn: Function): void {\n getCleanup(view).push(cleanupFn);\n\n if (view[TVIEW].firstTemplatePass) {\n getTViewCleanup(view).push(view[CLEANUP] !.length - 1, null);\n }\n}\n\n/** Mark the end of the element. */\nexport function elementEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Element);\n const lView = getLView();\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TElementNode);\n }\n\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n const stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(\n lView, previousOrParentTNode.inputs !['class'] !, getInitialClassNameValue(stylingContext));\n }\n}\n\n/**\n * Updates the value of removes an attribute on an Element.\n *\n * @param number index The index of the element in the data array\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n */\nexport function elementAttribute(\n index: number, name: string, value: any, sanitizer?: SanitizerFn | null): void {\n if (value !== NO_CHANGE) {\n const lView = getLView();\n const renderer = lView[RENDERER];\n const element = getNativeByIndex(index, lView);\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name) :\n element.removeAttribute(name);\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue = sanitizer == null ? stringify(value) : sanitizer(value);\n isProceduralRenderer(renderer) ? renderer.setAttribute(element, name, strValue) :\n element.setAttribute(name, strValue);\n }\n }\n}\n\n/**\n * Update a property on an element.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new @Inputs don't have to be re-compiled.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @param nativeOnly Whether or not we should only set native properties and skip input check\n * (this is necessary for host property bindings)\n */\nexport function elementProperty<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean): void {\n elementPropertyInternal(index, propName, value, sanitizer, nativeOnly);\n}\n\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub components renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @param nativeOnly Whether or not we should only set native properties and skip input check\n * (this is necessary for host property bindings)\n */\nexport function componentHostSyntheticProperty<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean) {\n elementPropertyInternal(index, propName, value, sanitizer, nativeOnly, loadComponentRenderer);\n}\n\nfunction loadComponentRenderer(tNode: TNode, lView: LView): Renderer3 {\n const componentLView = lView[tNode.index] as LView;\n return componentLView[RENDERER];\n}\n\nfunction elementPropertyInternal<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean,\n loadRendererFn?: ((tNode: TNode, lView: LView) => Renderer3) | null): void {\n if (value === NO_CHANGE) return;\n const lView = getLView();\n const element = getNativeByIndex(index, lView) as RElement | RComment;\n const tNode = getTNode(index, lView);\n let inputData: PropertyAliases|null|undefined;\n let dataValue: PropertyAliasValue|undefined;\n if (!nativeOnly && (inputData = initializeTNodeInputs(tNode)) &&\n (dataValue = inputData[propName])) {\n setInputsForProperty(lView, dataValue, value);\n if (isComponent(tNode)) markDirtyIfOnPush(lView, index + HEADER_OFFSET);\n if (ngDevMode) {\n if (tNode.type === TNodeType.Element || tNode.type === TNodeType.Container) {\n setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n }\n }\n } else if (tNode.type === TNodeType.Element) {\n const renderer = loadRendererFn ? loadRendererFn(tNode, lView) : lView[RENDERER];\n // It is assumed that the sanitizer is only added when the compiler determines that the property\n // is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? (sanitizer(value) as any) : value;\n ngDevMode && ngDevMode.rendererSetProperty++;\n if (isProceduralRenderer(renderer)) {\n renderer.setProperty(element as RElement, propName, value);\n } else if (!isAnimationProp(propName)) {\n (element as RElement).setProperty ? (element as any).setProperty(propName, value) :\n (element as any)[propName] = value;\n }\n }\n}\n\n/**\n * Constructs a TNode object from the arguments.\n *\n * @param type The type of the node\n * @param adjustedIndex The index of the TNode in TView.data, adjusted for HEADER_OFFSET\n * @param tagName The tag name of the node\n * @param attrs The attributes defined on this node\n * @param tViews Any TViews attached to this node\n * @returns the TNode object\n */\nexport function createTNode(\n lView: LView, type: TNodeType, adjustedIndex: number, tagName: string | null,\n attrs: TAttributes | null, tViews: TView[] | null): TNode {\n const previousOrParentTNode = getPreviousOrParentTNode();\n ngDevMode && ngDevMode.tNode++;\n const parent =\n getIsParent() ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent;\n\n // Parents cannot cross component boundaries because components will be used in multiple places,\n // so it's only set if the view is the same.\n const parentInSameView = parent && lView && parent !== lView[HOST_NODE];\n const tParent = parentInSameView ? parent as TElementNode | TContainerNode : null;\n\n return {\n type: type,\n index: adjustedIndex,\n injectorIndex: tParent ? tParent.injectorIndex : -1,\n directiveStart: -1,\n directiveEnd: -1,\n flags: 0,\n providerIndexes: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: tParent,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}\n\n/**\n * Given a list of directive indices and minified input names, sets the\n * input properties on the corresponding directives.\n */\nfunction setInputsForProperty(lView: LView, inputs: PropertyAliasValue, value: any): void {\n for (let i = 0; i < inputs.length; i += 2) {\n ngDevMode && assertDataInRange(lView, inputs[i] as number);\n lView[inputs[i] as number][inputs[i + 1]] = value;\n }\n}\n\nfunction setNgReflectProperties(\n lView: LView, element: RElement | RComment, type: TNodeType, inputs: PropertyAliasValue,\n value: any) {\n for (let i = 0; i < inputs.length; i += 2) {\n const renderer = lView[RENDERER];\n const attrName = normalizeDebugBindingName(inputs[i + 1] as string);\n const debugValue = normalizeDebugBindingValue(value);\n if (type === TNodeType.Element) {\n isProceduralRenderer(renderer) ?\n renderer.setAttribute((element as RElement), attrName, debugValue) :\n (element as RElement).setAttribute(attrName, debugValue);\n } else if (value !== undefined) {\n const value = `bindings=${JSON.stringify({[attrName]: debugValue}, null, 2)}`;\n if (isProceduralRenderer(renderer)) {\n renderer.setValue((element as RComment), value);\n } else {\n (element as RComment).textContent = value;\n }\n }\n }\n}\n\n/**\n * Consolidates all inputs or outputs of all directives on this logical node.\n *\n * @param tNodeFlags node flags\n * @param direction whether to consider inputs or outputs\n * @returns PropertyAliases|null aggregate of all properties if any, `null` otherwise\n */\nfunction generatePropertyAliases(tNode: TNode, direction: BindingDirection): PropertyAliases|null {\n const tView = getLView()[TVIEW];\n let propStore: PropertyAliases|null = null;\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n\n if (end > start) {\n const isInput = direction === BindingDirection.Input;\n const defs = tView.data;\n\n for (let i = start; i < end; i++) {\n const directiveDef = defs[i] as DirectiveDef<any>;\n const propertyAliasMap: {[publicName: string]: string} =\n isInput ? directiveDef.inputs : directiveDef.outputs;\n for (let publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n const internalName = propertyAliasMap[publicName];\n const hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}\n\n/**\n * Assign any inline style values to the element during creation mode.\n *\n * This instruction is meant to be called during creation mode to register all\n * dynamic style and class bindings on the element. Note for static values (no binding)\n * see `elementStart` and `elementHostAttrs`.\n *\n * @param classBindingNames An array containing bindable class names.\n * The `elementClassProp` refers to the class name by index in this array.\n * (i.e. `['foo', 'bar']` means `foo=0` and `bar=1`).\n * @param styleBindingNames An array containing bindable style properties.\n * The `elementStyleProp` refers to the class name by index in this array.\n * (i.e. `['width', 'height']` means `width=0` and `height=1`).\n * @param styleSanitizer An optional sanitizer function that will be used to sanitize any CSS\n * property values that are applied to the element (during rendering).\n * Note that the sanitizer instance itself is tied to the `directive` (if provided).\n * @param directive A directive instance the styling is associated with. If not provided\n * current view's controller instance is assumed.\n *\n * @publicApi\n */\nexport function elementStyling(\n classBindingNames?: string[] | null, styleBindingNames?: string[] | null,\n styleSanitizer?: StyleSanitizeFn | null, directive?: {}): void {\n const tNode = getPreviousOrParentTNode();\n if (!tNode.stylingTemplate) {\n tNode.stylingTemplate = createEmptyStylingContext();\n }\n updateContextWithBindings(\n tNode.stylingTemplate !, directive || null, classBindingNames, styleBindingNames,\n styleSanitizer, hasClassInput(tNode));\n}\n\n/**\n * Assign static styling values to a host element.\n *\n * NOTE: This instruction is meant to used from `hostBindings` function only.\n *\n * @param directive A directive instance the styling is associated with.\n * @param attrs An array containing class and styling information. The values must be marked with\n * `AttributeMarker`.\n *\n * ```\n * var attrs = [AttributeMarker.Classes, 'foo', 'bar',\n * AttributeMarker.Styles, 'width', '100px', 'height, '200px']\n * elementHostAttrs(directive, attrs);\n * ```\n *\n * @publicApi\n */\nexport function elementHostAttrs(directive: any, attrs: TAttributes) {\n const tNode = getPreviousOrParentTNode();\n if (!tNode.stylingTemplate) {\n tNode.stylingTemplate = initializeStaticStylingContext(attrs);\n }\n patchContextWithStaticAttrs(tNode.stylingTemplate, attrs, directive);\n}\n\n/**\n * Apply styling binding to the element.\n *\n * This instruction is meant to be run after `elementStyle` and/or `elementStyleProp`.\n * if any styling bindings have changed then the changes are flushed to the element.\n *\n *\n * @param index Index of the element's with which styling is associated.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementStylingApply(index: number, directive?: any): void {\n const lView = getLView();\n const isFirstRender = (lView[FLAGS] & LViewFlags.FirstLViewPass) !== 0;\n const totalPlayersQueued = renderStyling(\n getStylingContext(index + HEADER_OFFSET, lView), lView[RENDERER], lView, isFirstRender, null,\n null, directive);\n if (totalPlayersQueued > 0) {\n const rootContext = getRootContext(lView);\n scheduleTick(rootContext, RootContextFlags.FlushPlayers);\n }\n}\n\n/**\n * Update a style bindings value on an element.\n *\n * If the style value is `null` then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `elementStyle` or any styles that are present\n * from when the element was created (with `elementStyling`).\n *\n * (Note that the styling element is updated as part of `elementStylingApply`.)\n *\n * @param index Index of the element's with which styling is associated.\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `elementStlyingBindings`.\n * @param value New value to write (null to remove). Note that if a directive also\n * attempts to write to the same binding value then it will only be able to\n * do so if the template binding value is `null` (or doesn't exist at all).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n * Note that when a suffix is provided then the underlying sanitizer will\n * be ignored.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementStyleProp(\n index: number, styleIndex: number, value: string | number | String | PlayerFactory | null,\n suffix?: string | null, directive?: {}): void {\n let valueToAdd: string|null = null;\n if (value !== null) {\n if (suffix) {\n // when a suffix is applied then it will bypass\n // sanitization entirely (b/c a new string is created)\n valueToAdd = stringify(value) + suffix;\n } else {\n // sanitization happens by dealing with a String value\n // this means that the string value will be passed through\n // into the style rendering later (which is where the value\n // will be sanitized before it is applied)\n valueToAdd = value as any as string;\n }\n }\n updateElementStyleProp(\n getStylingContext(index + HEADER_OFFSET, getLView()), styleIndex, valueToAdd, directive);\n}\n\n/**\n * Add or remove a class via a class binding on a DOM element.\n *\n * This instruction is meant to handle the [class.foo]=\"exp\" case and, therefore,\n * the class itself must already be applied using `elementStyling` within\n * the creation block.\n *\n * @param index Index of the element's with which styling is associated.\n * @param classIndex Index of class to toggle. This index value refers to the\n * index of the class in the class bindings array that was passed into\n * `elementStlyingBindings` (which is meant to be called before this\n * function is).\n * @param value A true/false value which will turn the class on or off.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementClassProp(\n index: number, classIndex: number, value: boolean | PlayerFactory, directive?: {}): void {\n const onOrOffClassValue =\n (value instanceof BoundPlayerFactory) ? (value as BoundPlayerFactory<boolean>) : (!!value);\n updateElementClassProp(\n getStylingContext(index + HEADER_OFFSET, getLView()), classIndex, onOrOffClassValue,\n directive);\n}\n\n/**\n * Update style and/or class bindings using object literal.\n *\n * This instruction is meant apply styling via the `[style]=\"exp\"` and `[class]=\"exp\"` template\n * bindings. When styles are applied to the Element they will then be placed with respect to\n * any styles set with `elementStyleProp`. If any styles are set to `null` then they will be\n * removed from the element.\n *\n * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)\n *\n * @param index Index of the element's with which styling is associated.\n * @param classes A key/value style map of CSS classes that will be added to the given element.\n * Any missing classes (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's list of CSS classes.\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\n *\n * @publicApi\n */\nexport function elementStylingMap<T>(\n index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,\n styles?: {[styleName: string]: any} | NO_CHANGE | null, directive?: {}): void {\n if (directive != undefined)\n return hackImplementationOfElementStylingMap(\n index, classes, styles, directive); // supported in next PR\n const lView = getLView();\n const tNode = getTNode(index, lView);\n const stylingContext = getStylingContext(index + HEADER_OFFSET, lView);\n if (hasClassInput(tNode) && classes !== NO_CHANGE) {\n const initialClasses = getInitialClassNameValue(stylingContext);\n const classInputVal =\n (initialClasses.length ? (initialClasses + ' ') : '') + (classes as string);\n setInputsForProperty(lView, tNode.inputs !['class'] !, classInputVal);\n } else {\n updateStylingMap(stylingContext, classes, styles);\n }\n}\n\n/* START OF HACK BLOCK */\nfunction hackImplementationOfElementStylingMap<T>(\n index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,\n styles?: {[styleName: string]: any} | NO_CHANGE | null, directive?: {}): void {\n throw new Error('unimplemented. Should not be needed by ViewEngine compatibility');\n}\n/* END OF HACK BLOCK */\n\n//////////////////////////\n//// Text\n//////////////////////////\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Value to write. This value will be stringified.\n */\nexport function text(index: number, value?: any): void {\n const lView = getLView();\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n const textNative = createTextNode(value, lView[RENDERER]);\n const tNode = createNodeAtIndex(index, TNodeType.Element, textNative, null, null);\n\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}\n\n/**\n * Create text node with binding\n * Bindings should be handled externally with the proper interpolation(1-8) method\n *\n * @param index Index of the node in the data array.\n * @param value Stringified value to write.\n */\nexport function textBinding<T>(index: number, value: T | NO_CHANGE): void {\n if (value !== NO_CHANGE) {\n const lView = getLView();\n ngDevMode && assertDataInRange(lView, index + HEADER_OFFSET);\n const element = getNativeByIndex(index, lView) as any as RText;\n ngDevMode && assertDefined(element, 'native element should exist');\n ngDevMode && ngDevMode.rendererSetText++;\n const renderer = lView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.setValue(element, stringify(value)) :\n element.textContent = stringify(value);\n }\n}\n\n//////////////////////////\n//// Directive\n//////////////////////////\n\n/**\n * Instantiate a root component.\n */\nexport function instantiateRootComponent<T>(\n tView: TView, viewData: LView, def: ComponentDef<T>): T {\n const rootTNode = getPreviousOrParentTNode();\n if (tView.firstTemplatePass) {\n if (def.providersResolver) def.providersResolver(def);\n generateExpandoInstructionBlock(tView, rootTNode, 1);\n baseResolveDirective(tView, viewData, def, def.factory);\n }\n const directive =\n getNodeInjectable(tView.data, viewData, viewData.length - 1, rootTNode as TElementNode);\n postProcessBaseDirective(viewData, rootTNode, directive, def as DirectiveDef<T>);\n return directive;\n}\n\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(\n tView: TView, viewData: LView, directives: DirectiveDef<any>[] | null, tNode: TNode,\n localRefs: string[] | null): void {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'should run on first template pass only');\n const exportsMap: ({[key: string]: number} | null) = localRefs ? {'': -1} : null;\n if (directives) {\n initNodeFlags(tNode, tView.data.length, directives.length);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i] as DirectiveDef<any>;\n if (def.providersResolver) def.providersResolver(def);\n }\n generateExpandoInstructionBlock(tView, tNode, directives.length);\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i] as DirectiveDef<any>;\n\n const directiveDefIdx = tView.data.length;\n baseResolveDirective(tView, viewData, def, def.factory);\n\n saveNameToExportMap(tView.data !.length - 1, def, exportsMap);\n\n // Init hooks are queued now so ngOnInit is called in host components before\n // any projected components.\n queueInitHooks(directiveDefIdx, def.onInit, def.doCheck, tView);\n }\n }\n if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}\n\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView: TView, lView: LView, tNode: TNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n if (!getFirstTemplatePass() && start < end) {\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView);\n }\n for (let i = start; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n if (isComponentDef(def)) {\n addComponentLogic(lView, tNode, def as ComponentDef<any>);\n }\n const directive = getNodeInjectable(tView.data, lView !, i, tNode as TElementNode);\n postProcessDirective(lView, directive, def, i);\n }\n}\n\nfunction invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const expando = tView.expandoInstructions !;\n const firstTemplatePass = getFirstTemplatePass();\n for (let i = start; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n const directive = viewData[i];\n if (def.hostBindings) {\n const previousExpandoLength = expando.length;\n setCurrentDirectiveDef(def);\n def.hostBindings !(RenderFlags.Create, directive, tNode.index - HEADER_OFFSET);\n setCurrentDirectiveDef(null);\n // `hostBindings` function may or may not contain `allocHostVars` call\n // (e.g. it may not if it only contains host listeners), so we need to check whether\n // `expandoInstructions` has changed and if not - we still push `hostBindings` to\n // expando block, to make sure we execute it for DI cycle\n if (previousExpandoLength === expando.length && firstTemplatePass) {\n expando.push(def.hostBindings);\n }\n } else if (firstTemplatePass) {\n expando.push(null);\n }\n }\n}\n\n/**\n* Generates a new block in TView.expandoInstructions for this node.\n*\n* Each expando block starts with the element index (turned negative so we can distinguish\n* it from the hostVar count) and the directive count. See more in VIEW_DATA.md.\n*/\nexport function generateExpandoInstructionBlock(\n tView: TView, tNode: TNode, directiveCount: number): void {\n ngDevMode && assertEqual(\n tView.firstTemplatePass, true,\n 'Expando block should only be generated on first template pass.');\n\n const elementIndex = -(tNode.index - HEADER_OFFSET);\n const providerStartIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const providerCount = tView.data.length - providerStartIndex;\n (tView.expandoInstructions || (tView.expandoInstructions = [\n ])).push(elementIndex, providerCount, directiveCount);\n}\n\n/**\n* On the first template pass, we need to reserve space for host binding values\n* after directives are matched (so all directives are saved, then bindings).\n* Because we are updating the blueprint, we only need to do this once.\n*/\nfunction prefillHostVars(tView: TView, lView: LView, totalHostVars: number): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n for (let i = 0; i < totalHostVars; i++) {\n lView.push(NO_CHANGE);\n tView.blueprint.push(NO_CHANGE);\n tView.data.push(null);\n }\n}\n\n/**\n * Process a directive on the current node after its creation.\n */\nfunction postProcessDirective<T>(\n viewData: LView, directive: T, def: DirectiveDef<T>, directiveDefIdx: number): void {\n const previousOrParentTNode = getPreviousOrParentTNode();\n postProcessBaseDirective(viewData, previousOrParentTNode, directive, def);\n ngDevMode && assertDefined(previousOrParentTNode, 'previousOrParentTNode');\n if (previousOrParentTNode && previousOrParentTNode.attrs) {\n setInputsFromAttrs(directiveDefIdx, directive, def.inputs, previousOrParentTNode);\n }\n\n if (def.contentQueries) {\n def.contentQueries(directiveDefIdx);\n }\n\n if (isComponentDef(def)) {\n const componentView = getComponentViewByIndex(previousOrParentTNode.index, viewData);\n componentView[CONTEXT] = directive;\n }\n}\n\n/**\n * A lighter version of postProcessDirective() that is used for the root component.\n */\nfunction postProcessBaseDirective<T>(\n lView: LView, previousOrParentTNode: TNode, directive: T, def: DirectiveDef<T>): void {\n const native = getNativeByTNode(previousOrParentTNode, lView);\n\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent(getIsParent());\n\n attachPatchData(directive, lView);\n if (native) {\n attachPatchData(native, lView);\n }\n\n // TODO(misko): setUpAttributes should be a feature for better treeshakability.\n if (def.attributes != null && previousOrParentTNode.type == TNodeType.Element) {\n setUpAttributes(native as RElement, def.attributes as string[]);\n }\n}\n\n\n\n/**\n* Matches the current node against all available selectors.\n* If a component is matched (at most one), it is returned in first position in the array.\n*/\nfunction findDirectiveMatches(tView: TView, viewData: LView, tNode: TNode): DirectiveDef<any>[]|\n null {\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'should run on first template pass only');\n const registry = tView.directiveRegistry;\n let matches: any[]|null = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i] as ComponentDef<any>| DirectiveDef<any>;\n if (isNodeMatchingSelectorList(tNode, def.selectors !, /* isProjectionMode */ false)) {\n matches || (matches = []);\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode,\n viewData),\n viewData, def.type);\n\n if (isComponentDef(def)) {\n if (tNode.flags & TNodeFlags.isComponent) throwMultipleComponentError(tNode);\n tNode.flags = TNodeFlags.isComponent;\n\n // The component is always stored first with directives after.\n matches.unshift(def);\n } else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}\n\n/** Stores index of component's host element so it will be queued for view refresh during CD. */\nexport function queueComponentIndexForCheck(previousOrParentTNode: TNode): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n const tView = getLView()[TVIEW];\n (tView.components || (tView.components = [])).push(previousOrParentTNode.index);\n}\n\n/**\n * Stores host binding fn and number of host vars so it will be queued for binding refresh during\n * CD.\n*/\nfunction queueHostBindingForCheck(\n tView: TView, def: DirectiveDef<any>| ComponentDef<any>, hostVars: number): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n const expando = tView.expandoInstructions !;\n const length = expando.length;\n // Check whether a given `hostBindings` function already exists in expandoInstructions,\n // which can happen in case directive definition was extended from base definition (as a part of\n // the `InheritDefinitionFeature` logic). If we found the same `hostBindings` function in the\n // list, we just increase the number of host vars associated with that function, but do not add it\n // into the list again.\n if (length >= 2 && expando[length - 2] === def.hostBindings) {\n expando[length - 1] = (expando[length - 1] as number) + hostVars;\n } else {\n expando.push(def.hostBindings !, hostVars);\n }\n}\n\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(\n tNode: TNode, localRefs: string[] | null, exportsMap: {[key: string]: number}): void {\n if (localRefs) {\n const localNames: (string | number)[] = tNode.localNames = [];\n\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new Error(`Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n\n/**\n* Builds up an export map as directives are created, so local refs can be quickly mapped\n* to their directive instances.\n*/\nfunction saveNameToExportMap(\n index: number, def: DirectiveDef<any>| ComponentDef<any>,\n exportsMap: {[key: string]: number} | null) {\n if (exportsMap) {\n if (def.exportAs) exportsMap[def.exportAs] = index;\n if ((def as ComponentDef<any>).template) exportsMap[''] = index;\n }\n}\n\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nexport function initNodeFlags(tNode: TNode, index: number, numberOfDirectives: number) {\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'expected firstTemplatePass to be true');\n const flags = tNode.flags;\n ngDevMode && assertEqual(\n flags === 0 || flags === TNodeFlags.isComponent, true,\n 'expected node flags to not be initialized');\n\n ngDevMode && assertNotEqual(\n numberOfDirectives, tNode.directiveEnd - tNode.directiveStart,\n 'Reached the max number of directives');\n // When the first directive is created on a node, save the index\n tNode.flags = flags & TNodeFlags.isComponent;\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\n\nfunction baseResolveDirective<T>(\n tView: TView, viewData: LView, def: DirectiveDef<T>,\n directiveFactory: (t: Type<T>| null) => any) {\n tView.data.push(def);\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), null);\n tView.blueprint.push(nodeInjectorFactory);\n viewData.push(nodeInjectorFactory);\n}\n\nfunction addComponentLogic<T>(\n lView: LView, previousOrParentTNode: TNode, def: ComponentDef<T>): void {\n const native = getNativeByTNode(previousOrParentTNode, lView);\n\n const tView = getOrCreateTView(\n def.template, def.consts, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery);\n\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[RENDERER_FACTORY];\n const componentView = addToViewTree(\n lView, previousOrParentTNode.index as number,\n createLView(\n lView, tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways,\n rendererFactory, lView[RENDERER_FACTORY].createRenderer(native as RElement, def)));\n\n componentView[HOST_NODE] = previousOrParentTNode as TElementNode;\n\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n componentView[HOST] = lView[previousOrParentTNode.index];\n lView[previousOrParentTNode.index] = componentView;\n\n if (getFirstTemplatePass()) {\n queueComponentIndexForCheck(previousOrParentTNode);\n }\n}\n\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs<T>(\n directiveIndex: number, instance: T, inputs: {[P in keyof T]: string;}, tNode: TNode): void {\n let initialInputData = tNode.initialInputs as InitialInputData | undefined;\n if (initialInputData === undefined || directiveIndex >= initialInputData.length) {\n initialInputData = generateInitialInputs(directiveIndex, inputs, tNode);\n }\n\n const initialInputs: InitialInputs|null = initialInputData[directiveIndex];\n if (initialInputs) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n (instance as any)[initialInputs[i]] = initialInputs[i + 1];\n }\n }\n}\n\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param directiveIndex Index to store the initial input data\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data on this node\n */\nfunction generateInitialInputs(\n directiveIndex: number, inputs: {[key: string]: string}, tNode: TNode): InitialInputData {\n const initialInputData: InitialInputData = tNode.initialInputs || (tNode.initialInputs = []);\n initialInputData[directiveIndex] = null;\n\n const attrs = tNode.attrs !;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName === AttributeMarker.NamespaceURI) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n }\n const minifiedInputName = inputs[attrName];\n const attrValue = attrs[i + 1];\n\n if (minifiedInputName !== undefined) {\n const inputsToStore: InitialInputs =\n initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []);\n inputsToStore.push(minifiedInputName, attrValue as string);\n }\n\n i += 2;\n }\n return initialInputData;\n}\n\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nexport function createLContainer(\n hostNative: RElement | RComment,\n hostTNode: TElementNode | TContainerNode | TElementContainerNode, currentView: LView,\n native: RComment, isForViewContainerRef?: boolean): LContainer {\n return [\n isForViewContainerRef ? -1 : 0, // active index\n [], // views\n currentView, // parent\n null, // next\n null, // queries\n hostNative, // host native\n native, // native\n getRenderParent(hostTNode, currentView) // renderParent\n ];\n}\n\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param consts The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrs The attrs attached to the container, if applicable\n * @param localRefs A set of local reference bindings on the element.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nexport function template(\n index: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,\n tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null,\n localRefExtractor?: LocalRefExtractor) {\n const lView = getLView();\n const tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n const tNode = containerInternal(index, tagName || null, attrs || null);\n\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(\n -1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n const currentQueries = lView[QUERIES];\n const previousOrParentTNode = getPreviousOrParentTNode();\n const native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TContainerNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}\n\n/**\n * Creates an LContainer for inline views, e.g.\n *\n * % if (showing) {\n * <div></div>\n * % }\n *\n * @param index The index of the container in the data array\n */\nexport function container(index: number): void {\n const tNode = containerInternal(index, null, null);\n getFirstTemplatePass() && (tNode.tViews = []);\n setIsParent(false);\n}\n\nfunction containerInternal(\n index: number, tagName: string | null, attrs: TAttributes | null): TNode {\n const lView = getLView();\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'container nodes should be created before any bindings');\n\n const adjustedIndex = index + HEADER_OFFSET;\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n ngDevMode && ngDevMode.rendererCreateComment++;\n const tNode = createNodeAtIndex(index, TNodeType.Container, comment, tagName, attrs);\n const lContainer = lView[adjustedIndex] =\n createLContainer(lView[adjustedIndex], tNode, lView, comment);\n\n appendChild(comment, tNode, lView);\n\n // Containers are added to the current view tree instead of their embedded views\n // because views can be removed and re-inserted.\n addToViewTree(lView, index + HEADER_OFFSET, lContainer);\n\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n // prepare place for matching nodes from views inserted into a given container\n lContainer[QUERIES] = currentQueries.container();\n }\n\n ngDevMode && assertNodeType(getPreviousOrParentTNode(), TNodeType.Container);\n return tNode;\n}\n\n/**\n * Sets a container up to receive views.\n *\n * @param index The index of the container in the data array\n */\nexport function containerRefreshStart(index: number): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n let previousOrParentTNode = loadInternal(tView.data, index) as TNode;\n setPreviousOrParentTNode(previousOrParentTNode);\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Container);\n setIsParent(true);\n\n lView[index + HEADER_OFFSET][ACTIVE_INDEX] = 0;\n\n // We need to execute init hooks here so ngOnInit hooks are called in top level views\n // before they are called in embedded views (for backwards compatibility).\n executeInitHooks(lView, tView, getCheckNoChangesMode());\n}\n\n/**\n * Marks the end of the LContainer.\n *\n * Marking the end of LContainer is the time when to child views get inserted or removed.\n */\nexport function containerRefreshEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.View);\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Container);\n\n const lContainer = getLView()[previousOrParentTNode.index];\n const nextIndex = lContainer[ACTIVE_INDEX];\n\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode as TContainerNode, nextIndex);\n }\n}\n\n/**\n * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes them\n * by executing an associated template function.\n */\nfunction refreshDynamicEmbeddedViews(lView: LView) {\n for (let current = getLViewChild(lView); current !== null; current = current[NEXT]) {\n // Note: current can be an LView or an LContainer instance, but here we are only interested\n // in LContainer. We can tell it's an LContainer because its length is less than the LView\n // header.\n if (current.length < HEADER_OFFSET && current[ACTIVE_INDEX] === -1) {\n const container = current as LContainer;\n for (let i = 0; i < container[VIEWS].length; i++) {\n const dynamicViewData = container[VIEWS][i];\n // The directives and pipes are not needed here as an existing view is only being refreshed.\n ngDevMode && assertDefined(dynamicViewData[TVIEW], 'TView must be allocated');\n renderEmbeddedTemplate(dynamicViewData, dynamicViewData[TVIEW], dynamicViewData[CONTEXT] !);\n }\n }\n }\n}\n\n\n/**\n * Looks for a view with a given view block id inside a provided LContainer.\n * Removes views that need to be deleted in the process.\n *\n * @param lContainer to search for views\n * @param tContainerNode to search for views\n * @param startIdx starting index in the views array to search from\n * @param viewBlockId exact view block id to look for\n * @returns index of a found view or -1 if not found\n */\nfunction scanForView(\n lContainer: LContainer, tContainerNode: TContainerNode, startIdx: number,\n viewBlockId: number): LView|null {\n const views = lContainer[VIEWS];\n for (let i = startIdx; i < views.length; i++) {\n const viewAtPositionId = views[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n } else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, tContainerNode, i);\n } else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the searchdef.cont here\n break;\n }\n }\n return null;\n}\n\n/**\n * Marks the start of an embedded view.\n *\n * @param viewBlockId The ID of this view\n * @return boolean Whether or not this view is in creation mode\n */\nexport function embeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {\n const lView = getLView();\n const previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n const containerTNode = previousOrParentTNode.type === TNodeType.View ?\n previousOrParentTNode.parent ! :\n previousOrParentTNode;\n const lContainer = lView[containerTNode.index] as LContainer;\n\n ngDevMode && assertNodeType(containerTNode, TNodeType.Container);\n let viewToRender = scanForView(\n lContainer, containerTNode as TContainerNode, lContainer[ACTIVE_INDEX] !, viewBlockId);\n\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n } else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(\n lView,\n getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode as TContainerNode), null,\n LViewFlags.CheckAlways);\n\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES] !.createView();\n }\n\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX] !, -1);\n }\n lContainer[ACTIVE_INDEX] !++;\n }\n return isCreationMode(viewToRender) ? RenderFlags.Create | RenderFlags.Update :\n RenderFlags.Update;\n}\n\n/**\n * Initialize the TView (e.g. static data) for the active embedded view.\n *\n * Each embedded view block must create or retrieve its own TView. Otherwise, the embedded view's\n * static data for a particular node would overwrite the static data for a node in the view above\n * it with the same index (since it's in the same template).\n *\n * @param viewIndex The index of the TView in TNode.tViews\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param vars The number of bindings and pure function bindings in this template\n * @param container The parent container in which to look for the view's static data\n * @returns TView\n */\nfunction getOrCreateEmbeddedTView(\n viewIndex: number, consts: number, vars: number, parent: TContainerNode): TView {\n const tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, TNodeType.Container);\n const containerTViews = parent.tViews as TView[];\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(\n viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}\n\n/** Marks the end of an embedded view. */\nexport function embeddedViewEnd(): void {\n const lView = getLView();\n const viewHost = lView[HOST_NODE];\n\n if (isCreationMode(lView)) {\n refreshDescendantViews(lView); // creation mode pass\n lView[FLAGS] &= ~LViewFlags.CreationMode;\n }\n refreshDescendantViews(lView); // update mode pass\n leaveView(lView[PARENT] !);\n setPreviousOrParentTNode(viewHost !);\n setIsParent(false);\n}\n\n/////////////\n\n/**\n * Refreshes components by entering the component view and processing its bindings, queries, etc.\n *\n * @param adjustedElementIndex Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nexport function componentRefresh<T>(adjustedElementIndex: number): void {\n const lView = getLView();\n ngDevMode && assertDataInRange(lView, adjustedElementIndex);\n const hostView = getComponentViewByIndex(adjustedElementIndex, lView);\n ngDevMode && assertNodeType(lView[TVIEW].data[adjustedElementIndex] as TNode, TNodeType.Element);\n\n // Only attached CheckAlways components or attached, dirty OnPush components should be checked\n if (viewAttached(hostView) && hostView[FLAGS] & (LViewFlags.CheckAlways | LViewFlags.Dirty)) {\n syncViewWithBlueprint(hostView);\n checkView(hostView, hostView[CONTEXT]);\n }\n}\n\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param componentView The view to sync\n */\nfunction syncViewWithBlueprint(componentView: LView) {\n const componentTView = componentView[TVIEW];\n for (let i = componentView.length; i < componentTView.blueprint.length; i++) {\n componentView[i] = componentTView.blueprint[i];\n }\n}\n\n/** Returns a boolean for whether the view is attached */\nexport function viewAttached(view: LView): boolean {\n return (view[FLAGS] & LViewFlags.Attached) === LViewFlags.Attached;\n}\n\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param selectors A collection of parsed CSS selectors\n * @param rawSelectors A collection of CSS selectors in the raw, un-parsed form\n */\nexport function projectionDef(selectors?: CssSelectorList[], textSelectors?: string[]): void {\n const componentNode = findComponentView(getLView())[HOST_NODE] as TElementNode;\n\n if (!componentNode.projection) {\n const noOfNodeBuckets = selectors ? selectors.length + 1 : 1;\n const pData: (TNode | null)[] = componentNode.projection =\n new Array(noOfNodeBuckets).fill(null);\n const tails: (TNode | null)[] = pData.slice();\n\n let componentChild: TNode|null = componentNode.child;\n\n while (componentChild !== null) {\n const bucketIndex =\n selectors ? matchingSelectorIndex(componentChild, selectors, textSelectors !) : 0;\n const nextNode = componentChild.next;\n\n if (tails[bucketIndex]) {\n tails[bucketIndex] !.next = componentChild;\n } else {\n pData[bucketIndex] = componentChild;\n componentChild.next = null;\n }\n tails[bucketIndex] = componentChild;\n\n componentChild = nextNode;\n }\n }\n}\n\n/**\n * Stack used to keep track of projection nodes in projection() instruction.\n *\n * This is deliberately created outside of projection() to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: (LView | TNode)[] = [];\n\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex\n * @param selectorIndex:\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n */\nexport function projection(nodeIndex: number, selectorIndex: number = 0, attrs?: string[]): void {\n const lView = getLView();\n const tProjectionNode =\n createNodeAtIndex(nodeIndex, TNodeType.Projection, null, null, attrs || null);\n\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) tProjectionNode.projection = selectorIndex;\n\n // `<ng-content>` has no content\n setIsParent(false);\n\n // re-distribution of projectable nodes is stored on a component's view level\n const componentView = findComponentView(lView);\n const componentNode = componentView[HOST_NODE] as TElementNode;\n let nodeToProject = (componentNode.projection as(TNode | null)[])[selectorIndex];\n let projectedView = componentView[PARENT] !;\n let projectionNodeIndex = -1;\n\n while (nodeToProject) {\n if (nodeToProject.type === TNodeType.Projection) {\n // This node is re-projected, so we must go up the tree to get its projected nodes.\n const currentComponentView = findComponentView(projectedView);\n const currentComponentHost = currentComponentView[HOST_NODE] as TElementNode;\n const firstProjectedNode =\n (currentComponentHost.projection as(TNode | null)[])[nodeToProject.projection as number];\n\n if (firstProjectedNode) {\n projectionNodeStack[++projectionNodeIndex] = nodeToProject;\n projectionNodeStack[++projectionNodeIndex] = projectedView;\n\n nodeToProject = firstProjectedNode;\n projectedView = currentComponentView[PARENT] !;\n continue;\n }\n } else {\n // This flag must be set now or we won't know that this node is projected\n // if the nodes are inserted into a container later.\n nodeToProject.flags |= TNodeFlags.isProjected;\n appendProjectedNode(nodeToProject, tProjectionNode, lView, projectedView);\n }\n\n // If we are finished with a list of re-projected nodes, we need to get\n // back to the root projection node that was re-projected.\n if (nodeToProject.next === null && projectedView !== componentView[PARENT] !) {\n projectedView = projectionNodeStack[projectionNodeIndex--] as LView;\n nodeToProject = projectionNodeStack[projectionNodeIndex--] as TNode;\n }\n nodeToProject = nodeToProject.next;\n }\n}\n\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param state The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nexport function addToViewTree<T extends LView|LContainer>(\n lView: LView, adjustedHostIndex: number, state: T): T {\n const tView = lView[TVIEW];\n const firstTemplatePass = getFirstTemplatePass();\n if (lView[TAIL]) {\n lView[TAIL] ![NEXT] = state;\n } else if (firstTemplatePass) {\n tView.childIndex = adjustedHostIndex;\n }\n lView[TAIL] = state;\n return state;\n}\n\n///////////////////////////////\n//// Change detection\n///////////////////////////////\n\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView: LView, viewIndex: number): void {\n const childComponentLView = getComponentViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & LViewFlags.CheckAlways)) {\n childComponentLView[FLAGS] |= LViewFlags.Dirty;\n }\n}\n\n/** Wraps an event listener with preventDefault behavior. */\nfunction wrapListenerWithPreventDefault(listenerFn: (e?: any) => any): EventListener {\n return function wrapListenerIn_preventDefault(e: Event) {\n if (listenerFn(e) === false) {\n e.preventDefault();\n // Necessary for legacy browsers that don't support preventDefault (e.g. IE)\n e.returnValue = false;\n }\n };\n}\n\n/** Marks current view and all ancestors dirty */\nexport function markViewDirty(lView: LView): void {\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView[FLAGS] |= LViewFlags.Dirty;\n lView = lView[PARENT] !;\n }\n lView[FLAGS] |= LViewFlags.Dirty;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n\n const rootContext = lView[CONTEXT] as RootContext;\n scheduleTick(rootContext, RootContextFlags.DetectChanges);\n}\n\n/**\n * Used to schedule change detection on the whole application.\n *\n * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.\n * It is usually called indirectly by calling `markDirty` when the view needs to be\n * re-rendered.\n *\n * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple\n * `scheduleTick` requests. The scheduling function can be overridden in\n * `renderComponent`'s `scheduler` option.\n */\nexport function scheduleTick<T>(rootContext: RootContext, flags: RootContextFlags) {\n const nothingScheduled = rootContext.flags === RootContextFlags.Empty;\n rootContext.flags |= flags;\n\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n let res: null|((val: null) => void);\n rootContext.clean = new Promise<null>((r) => res = r);\n rootContext.scheduler(() => {\n if (rootContext.flags & RootContextFlags.DetectChanges) {\n rootContext.flags &= ~RootContextFlags.DetectChanges;\n tickRootContext(rootContext);\n }\n\n if (rootContext.flags & RootContextFlags.FlushPlayers) {\n rootContext.flags &= ~RootContextFlags.FlushPlayers;\n const playerHandler = rootContext.playerHandler;\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n\n rootContext.clean = _CLEAN_PROMISE;\n res !(null);\n });\n }\n}\n\n/**\n * Used to perform change detection on the whole application.\n *\n * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`\n * executes lifecycle hooks and conditionally checks components based on their\n * `ChangeDetectionStrategy` and dirtiness.\n *\n * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally\n * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a\n * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can\n * be changed when calling `renderComponent` and providing the `scheduler` option.\n */\nexport function tick<T>(component: T): void {\n const rootView = getRootView(component);\n const rootContext = rootView[CONTEXT] as RootContext;\n tickRootContext(rootContext);\n}\n\nfunction tickRootContext(rootContext: RootContext) {\n for (let i = 0; i < rootContext.components.length; i++) {\n const rootComponent = rootContext.components[i];\n renderComponentOrTemplate(readPatchedLView(rootComponent) !, rootComponent);\n }\n}\n\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component. There should\n * be very little reason to call this function directly since a preferred way to do change\n * detection is to {@link markDirty} the component and wait for the scheduler to call this method\n * at some future point in time. This is because a single user action often results in many\n * components being invalidated and calling change detection on each component synchronously\n * would be inefficient. It is better to wait until all components are marked as dirty and\n * then perform single change detection across all of the components\n *\n * @param component The component which the change detection should be performed on.\n */\nexport function detectChanges<T>(component: T): void {\n const view = getComponentViewByInstance(component) !;\n detectChangesInternal<T>(view, component);\n}\n\nexport function detectChangesInternal<T>(view: LView, context: T) {\n const rendererFactory = view[RENDERER_FACTORY];\n\n if (rendererFactory.begin) rendererFactory.begin();\n\n if (isCreationMode(view)) {\n checkView(view, context); // creation mode pass\n }\n checkView(view, context); // update mode pass\n\n if (rendererFactory.end) rendererFactory.end();\n}\n\n/**\n * Synchronously perform change detection on a root view and its components.\n *\n * @param lView The view which the change detection should be performed on.\n */\nexport function detectChangesInRootView(lView: LView): void {\n tickRootContext(lView[CONTEXT] as RootContext);\n}\n\n\n/**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\nexport function checkNoChanges<T>(component: T): void {\n setCheckNoChangesMode(true);\n try {\n detectChanges(component);\n } finally {\n setCheckNoChangesMode(false);\n }\n}\n\n/**\n * Checks the change detector on a root view and its components, and throws if any changes are\n * detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n *\n * @param lView The view which the change detection should be checked on.\n */\nexport function checkNoChangesInRootView(lView: LView): void {\n setCheckNoChangesMode(true);\n try {\n detectChangesInRootView(lView);\n } finally {\n setCheckNoChangesMode(false);\n }\n}\n\n/** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */\nexport function checkView<T>(hostView: LView, component: T) {\n const hostTView = hostView[TVIEW];\n const oldView = enterView(hostView, hostView[HOST_NODE]);\n const templateFn = hostTView.template !;\n const viewQuery = hostTView.viewQuery;\n\n try {\n namespaceHTML();\n createViewQuery(viewQuery, hostView, component);\n templateFn(getRenderFlags(hostView), component);\n refreshDescendantViews(hostView);\n updateViewQuery(viewQuery, hostView, component);\n } finally {\n leaveView(oldView);\n }\n}\n\nfunction createViewQuery<T>(viewQuery: ComponentQuery<{}>| null, view: LView, component: T): void {\n if (viewQuery && isCreationMode(view)) {\n viewQuery(RenderFlags.Create, component);\n }\n}\n\nfunction updateViewQuery<T>(viewQuery: ComponentQuery<{}>| null, view: LView, component: T): void {\n if (viewQuery && !isCreationMode(view)) {\n viewQuery(RenderFlags.Update, component);\n }\n}\n\n\n/**\n * Mark the component as dirty (needing change detection).\n *\n * Marking a component dirty will schedule a change detection on this\n * component at some point in the future. Marking an already dirty\n * component as dirty is a noop. Only one outstanding change detection\n * can be scheduled per component tree. (Two components bootstrapped with\n * separate `renderComponent` will have separate schedulers)\n *\n * When the root component is bootstrapped with `renderComponent`, a scheduler\n * can be provided.\n *\n * @param component Component to mark as dirty.\n *\n * @publicApi\n */\nexport function markDirty<T>(component: T) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component));\n}\n\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n\n/**\n * Creates a single value binding.\n *\n * @param value Value to diff\n */\nexport function bind<T>(value: T): T|NO_CHANGE {\n const lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}\n\n/**\n * Allocates the necessary amount of slots for host vars.\n *\n * @param count Amount of vars to be allocated\n */\nexport function allocHostVars(count: number): void {\n if (!getFirstTemplatePass()) return;\n const lView = getLView();\n const tView = lView[TVIEW];\n queueHostBindingForCheck(tView, getCurrentDirectiveDef() !, count);\n prefillHostVars(tView, lView, count);\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function interpolationV(values: any[]): string|NO_CHANGE {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n let different = false;\n const lView = getLView();\n\n let bindingIndex = lView[BINDING_INDEX];\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n bindingUpdated(lView, bindingIndex++, values[i]) && (different = true);\n }\n lView[BINDING_INDEX] = bindingIndex;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += stringify(values[i]) + values[i + 1];\n }\n\n return content;\n}\n\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nexport function interpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated(lView, lView[BINDING_INDEX], v0);\n lView[BINDING_INDEX] += 1;\n return different ? prefix + stringify(v0) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 2 expressions. */\nexport function interpolation2(\n prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated2(lView, lView[BINDING_INDEX], v0, v1);\n lView[BINDING_INDEX] += 2;\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 3 expressions. */\nexport function interpolation3(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string|\n NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated3(lView, lView[BINDING_INDEX], v0, v1, v2);\n lView[BINDING_INDEX] += 3;\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + suffix :\n NO_CHANGE;\n}\n\n/** Create an interpolation binding with 4 expressions. */\nexport function interpolation4(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated4(lView, lView[BINDING_INDEX], v0, v1, v2, v3);\n lView[BINDING_INDEX] += 4;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) +\n suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 5 expressions. */\nexport function interpolation5(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n lView[BINDING_INDEX] += 5;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 6 expressions. */\nexport function interpolation6(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n lView[BINDING_INDEX] += 6;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 7 expressions. */\nexport function interpolation7(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|\n NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n lView[BINDING_INDEX] += 7;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 8 expressions. */\nexport function interpolation8(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n lView[BINDING_INDEX] += 8;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + i6 + stringify(v7) + suffix :\n NO_CHANGE;\n}\n\n/** Store a value in the `data` at a given `index`. */\nexport function store<T>(index: number, value: T): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n const adjustedIndex = index + HEADER_OFFSET;\n if (adjustedIndex >= tView.data.length) {\n tView.data[adjustedIndex] = null;\n }\n lView[adjustedIndex] = value;\n}\n\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n */\nexport function reference<T>(index: number) {\n const contextLView = getContextLView();\n return loadInternal<T>(contextLView, index);\n}\n\nexport function loadQueryList<T>(queryListIdx: number): QueryList<T> {\n const lView = getLView();\n ngDevMode &&\n assertDefined(\n lView[CONTENT_QUERIES], 'Content QueryList array should be defined if reading a query.');\n ngDevMode && assertDataInRange(lView[CONTENT_QUERIES] !, queryListIdx);\n\n return lView[CONTENT_QUERIES] ![queryListIdx];\n}\n\n/** Retrieves a value from current `viewData`. */\nexport function load<T>(index: number): T {\n return loadInternal<T>(getLView(), index);\n}\n\n\n\n///////////////////////////////\n//// DI\n///////////////////////////////\n\n/**\n * Returns the value associated to the given token from the injectors.\n *\n * `directiveInject` is intended to be used for directive, component and pipe factories.\n * All other injection use `inject` which does not walk the node injector tree.\n *\n * Usage example (in factory function):\n *\n * class SomeDirective {\n * constructor(directive: DirectiveA) {}\n *\n * static ngDirectiveDef = defineDirective({\n * type: SomeDirective,\n * factory: () => new SomeDirective(directiveInject(DirectiveA))\n * });\n * }\n *\n * @param token the type or token to inject\n * @param flags Injection flags\n * @returns the value from the injector or `null` when not found\n */\nexport function directiveInject<T>(token: Type<T>| InjectionToken<T>): T;\nexport function directiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;\nexport function directiveInject<T>(\n token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n token = resolveForwardRef(token);\n return getOrCreateInjectable<T>(\n getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode,\n getLView(), token, flags);\n}\n\n/**\n * Facade for the attribute injection from DI.\n */\nexport function injectAttribute(attrNameToInject: string): string|null {\n return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n */\nexport function registerContentQuery<Q>(\n queryList: QueryList<Q>, currentDirectiveIndex: number): void {\n const viewData = getLView();\n const tView = viewData[TVIEW];\n const savedContentQueriesLength =\n (viewData[CONTENT_QUERIES] || (viewData[CONTENT_QUERIES] = [])).push(queryList);\n if (getFirstTemplatePass()) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex =\n tView.contentQueries.length ? tView.contentQueries[tView.contentQueries.length - 2] : -1;\n if (currentDirectiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(currentDirectiveIndex, savedContentQueriesLength - 1);\n }\n }\n}\n\nexport const CLEAN_PROMISE = _CLEAN_PROMISE;\n\nfunction initializeTNodeInputs(tNode: TNode | null) {\n // If tNode.inputs is undefined, a listener has created outputs, but inputs haven't\n // yet been checked.\n if (tNode) {\n if (tNode.inputs === undefined) {\n // mark inputs as checked\n tNode.inputs = generatePropertyAliases(tNode, BindingDirection.Input);\n }\n return tNode.inputs;\n }\n return null;\n}\n\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n */\nexport function getCurrentView(): OpaqueViewState {\n return getLView() as any as OpaqueViewState;\n}\n\nfunction getCleanup(view: LView): any[] {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return view[CLEANUP] || (view[CLEANUP] = []);\n}\n\nfunction getTViewCleanup(view: LView): any[] {\n return view[TVIEW].cleanup || (view[TVIEW].cleanup = []);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport './ng_dev_mode';\n\nimport {getLContext} from './context_discovery';\nimport {getRootContext} from './discovery_utils';\nimport {scheduleTick} from './instructions';\nimport {ComponentInstance, DirectiveInstance, Player} from './interfaces/player';\nimport {HEADER_OFFSET, RootContextFlags} from './interfaces/view';\nimport {addPlayerInternal, getOrCreatePlayerContext, getPlayerContext, getPlayersInternal, getStylingContext, throwInvalidRefError} from './styling/util';\n\n/**\n * Adds a player to an element, directive or component instance that will later be\n * animated once change detection has passed.\n *\n * When a player is added to a reference it will stay active until `player.destroy()`\n * is called. Once called then the player will be removed from the active players\n * present on the associated ref instance.\n *\n * To get a list of all the active players on an element see [getPlayers].\n *\n * @param ref The element, directive or component that the player will be placed on.\n * @param player The player that will be triggered to play once change detection has run.\n */\nexport function addPlayer(\n ref: ComponentInstance | DirectiveInstance | HTMLElement, player: Player): void {\n const context = getLContext(ref);\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return;\n }\n\n const element = context.native as HTMLElement;\n const lView = context.lView;\n const playerContext = getOrCreatePlayerContext(element, context) !;\n const rootContext = getRootContext(lView);\n addPlayerInternal(playerContext, rootContext, element, player, 0, ref);\n scheduleTick(rootContext, RootContextFlags.FlushPlayers);\n}\n\n/**\n * Returns a list of all the active players present on the provided ref instance (which can\n * be an instance of a directive, component or element).\n *\n * This function will only return players that have been added to the ref instance using\n * `addPlayer` or any players that are active through any template styling bindings\n * (`[style]`, `[style.prop]`, `[class]` and `[class.name]`).\n *\n * @publicApi\n */\nexport function getPlayers(ref: ComponentInstance | DirectiveInstance | HTMLElement): Player[] {\n const context = getLContext(ref);\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return [];\n }\n\n const stylingContext = getStylingContext(context.nodeIndex, context.lView);\n const playerContext = stylingContext ? getPlayerContext(stylingContext) : null;\n return playerContext ? getPlayersInternal(playerContext) : [];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview\n * This file is the index file collecting all of the symbols published on the global.ng namespace.\n *\n * The reason why this file/module is separate global_utils.ts file is that we use this file\n * to generate a d.ts file containing all the published symbols that is then compared to the golden\n * file in the public_api_guard test.\n */\n\nexport {getComponent, getContext, getDirectives, getHostElement, getInjector, getListeners, getRootComponents, getViewComponent} from './discovery_utils';\nexport {markDirty} from './instructions';\nexport {getPlayers} from './players';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {global} from '../util';\n\nimport {assertDefined} from './assert';\nimport {getComponent, getContext, getDirectives, getHostElement, getInjector, getListeners, getPlayers, getRootComponents, getViewComponent, markDirty} from './global_utils_api';\n\n\n\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run --define=compile=aot\n * //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nexport const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\n\n/*\n * Publishes a collection of default debug tools onto `window._ng_`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nlet _published = false;\nexport function publishDefaultGlobalUtils() {\n if (!_published) {\n _published = true;\n publishGlobalUtil('getComponent', getComponent);\n publishGlobalUtil('getContext', getContext);\n publishGlobalUtil('getListeners', getListeners);\n publishGlobalUtil('getViewComponent', getViewComponent);\n publishGlobalUtil('getHostElement', getHostElement);\n publishGlobalUtil('getInjector', getInjector);\n publishGlobalUtil('getRootComponents', getRootComponents);\n publishGlobalUtil('getDirectives', getDirectives);\n publishGlobalUtil('getPlayers', getPlayers);\n publishGlobalUtil('markDirty', markDirty);\n }\n}\n\nexport declare type GlobalDevModeContainer = {\n [GLOBAL_PUBLISH_EXPANDO_KEY]: {[fnName: string]: Function};\n};\n\n/**\n * Publishes the given function to `window.ngDevMode` so that it can be\n * used from the browser console when an application is not in production.\n */\nexport function publishGlobalUtil(name: string, fn: Function): void {\n const w = global as any as GlobalDevModeContainer;\n ngDevMode && assertDefined(fn, 'function not defined');\n if (w) {\n let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];\n if (!container) {\n container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};\n }\n container[name] = fn;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Type} from '../core';\nimport {Injector} from '../di/injector';\nimport {Sanitizer} from '../sanitization/security';\n\nimport {assertComponentType, assertDefined} from './assert';\nimport {getComponentDef} from './definition';\nimport {diPublicInInjector, getOrCreateNodeInjectorForNode} from './di';\nimport {publishDefaultGlobalUtils} from './global_utils';\nimport {queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {CLEAN_PROMISE, createLView, createNodeAtIndex, createTNode, createTView, getOrCreateTView, initNodeFlags, instantiateRootComponent, locateHostElement, queueComponentIndexForCheck, refreshDescendantViews} from './instructions';\nimport {ComponentDef, ComponentType, RenderFlags} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {PlayerHandler} from './interfaces/player';\nimport {RElement, Renderer3, RendererFactory3, domRendererFactory3} from './interfaces/renderer';\nimport {CONTEXT, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, LView, LViewFlags, RootContext, RootContextFlags, TVIEW} from './interfaces/view';\nimport {enterView, getPreviousOrParentTNode, leaveView, resetComponentState, setCurrentDirectiveDef} from './state';\nimport {defaultScheduler, getRootView, readPatchedLView, stringify} from './util';\n\n\n\n/** Options that control how the component should be bootstrapped. */\nexport interface CreateComponentOptions {\n /** Which renderer factory to use. */\n rendererFactory?: RendererFactory3;\n\n /** A custom sanitizer instance */\n sanitizer?: Sanitizer;\n\n /** A custom animation player handler */\n playerHandler?: PlayerHandler;\n\n /**\n * Host element on which the component will be bootstrapped. If not specified,\n * the component definition's `tag` is used to query the existing DOM for the\n * element to bootstrap.\n */\n host?: RElement|string;\n\n /** Module injector for the component. If unspecified, the injector will be NULL_INJECTOR. */\n injector?: Injector;\n\n /**\n * List of features to be applied to the created component. Features are simply\n * functions that decorate a component with a certain behavior.\n *\n * Typically, the features in this list are features that cannot be added to the\n * other features list in the component definition because they rely on other factors.\n *\n * Example: `RootLifecycleHooks` is a function that adds lifecycle hook capabilities\n * to root components in a tree-shakable way. It cannot be added to the component\n * features list because there's no way of knowing when the component will be used as\n * a root component.\n */\n hostFeatures?: HostFeature[];\n\n /**\n * A function which is used to schedule change detection work in the future.\n *\n * When marking components as dirty, it is necessary to schedule the work of\n * change detection in the future. This is done to coalesce multiple\n * {@link markDirty} calls into a single changed detection processing.\n *\n * The default value of the scheduler is the `requestAnimationFrame` function.\n *\n * It is also useful to override this function for testing purposes.\n */\n scheduler?: (work: () => void) => void;\n}\n\n/** See CreateComponentOptions.hostFeatures */\ntype HostFeature = (<T>(component: T, componentDef: ComponentDef<T>) => void);\n\n// TODO: A hack to not pull in the NullInjector from @angular/core.\nexport const NULL_INJECTOR: Injector = {\n get: (token: any, notFoundValue?: any) => {\n throw new Error('NullInjector: Not found: ' + stringify(token));\n }\n};\n\n/**\n * Bootstraps a Component into an existing host element and returns an instance\n * of the component.\n *\n * Use this function to bootstrap a component into the DOM tree. Each invocation\n * of this function will create a separate tree of components, injectors and\n * change detection cycles and lifetimes. To dynamically insert a new component\n * into an existing tree such that it shares the same injection, change detection\n * and object lifetime, use {@link ViewContainer#createComponent}.\n *\n * @param componentType Component to bootstrap\n * @param options Optional parameters which control bootstrapping\n */\nexport function renderComponent<T>(\n componentType: ComponentType<T>|\n Type<T>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */\n ,\n opts: CreateComponentOptions = {}): T {\n ngDevMode && publishDefaultGlobalUtils();\n ngDevMode && assertComponentType(componentType);\n const rendererFactory = opts.rendererFactory || domRendererFactory3;\n const sanitizer = opts.sanitizer || null;\n const componentDef = getComponentDef<T>(componentType) !;\n if (componentDef.type != componentType) componentDef.type = componentType;\n\n // The first index of the first selector is the tag name.\n const componentTag = componentDef.selectors ![0] ![0] as string;\n const hostRNode = locateHostElement(rendererFactory, opts.host || componentTag);\n const rootFlags = componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :\n LViewFlags.CheckAlways | LViewFlags.IsRoot;\n const rootContext = createRootContext(opts.scheduler, opts.playerHandler);\n\n const renderer = rendererFactory.createRenderer(hostRNode, componentDef);\n const rootView: LView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), rootContext, rootFlags, rendererFactory,\n renderer, undefined, opts.injector || null);\n\n const oldView = enterView(rootView, null);\n let component: T;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n const componentView = createRootComponentView(\n hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);\n component = createRootComponent(\n componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);\n\n refreshDescendantViews(rootView); // creation mode pass\n rootView[FLAGS] &= ~LViewFlags.CreationMode;\n refreshDescendantViews(rootView); // update mode pass\n } finally {\n leaveView(oldView);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n return component;\n}\n\n/**\n * Creates the root component view and the root component node.\n *\n * @param rNode Render host element.\n * @param def ComponentDef\n * @param rootView The parent view where the host node is stored\n * @param renderer The current renderer\n * @param sanitizer The sanitizer, if provided\n *\n * @returns Component view created\n */\nexport function createRootComponentView(\n rNode: RElement | null, def: ComponentDef<any>, rootView: LView,\n rendererFactory: RendererFactory3, renderer: Renderer3, sanitizer?: Sanitizer | null): LView {\n resetComponentState();\n const tView = rootView[TVIEW];\n const componentView = createLView(\n rootView,\n getOrCreateTView(\n def.template, def.consts, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery),\n null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, rendererFactory, renderer,\n sanitizer);\n const tNode = createNodeAtIndex(0, TNodeType.Element, rNode, null, null);\n\n if (tView.firstTemplatePass) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), rootView, def.type);\n tNode.flags = TNodeFlags.isComponent;\n initNodeFlags(tNode, rootView.length, 1);\n queueComponentIndexForCheck(tNode);\n }\n\n // Store component view at node index, with node as the HOST\n componentView[HOST] = rootView[HEADER_OFFSET];\n componentView[HOST_NODE] = tNode as TElementNode;\n return rootView[HEADER_OFFSET] = componentView;\n}\n\n/**\n * Creates a root component and sets it up with features and host bindings. Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */\nexport function createRootComponent<T>(\n componentView: LView, componentDef: ComponentDef<T>, rootView: LView, rootContext: RootContext,\n hostFeatures: HostFeature[] | null): any {\n const tView = rootView[TVIEW];\n // Create directive instance with factory() and store at next index in viewData\n const component = instantiateRootComponent(tView, rootView, componentDef);\n\n rootContext.components.push(component);\n componentView[CONTEXT] = component;\n\n hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef));\n\n if (tView.firstTemplatePass && componentDef.hostBindings) {\n const rootTNode = getPreviousOrParentTNode();\n setCurrentDirectiveDef(componentDef);\n componentDef.hostBindings(RenderFlags.Create, component, rootTNode.index - HEADER_OFFSET);\n setCurrentDirectiveDef(null);\n }\n\n return component;\n}\n\n\nexport function createRootContext(\n scheduler?: (workFn: () => void) => void, playerHandler?: PlayerHandler|null): RootContext {\n return {\n components: [],\n scheduler: scheduler || defaultScheduler,\n clean: CLEAN_PROMISE,\n playerHandler: playerHandler || null,\n flags: RootContextFlags.Empty\n };\n}\n\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {features: [RootLifecycleHooks]});\n * ```\n */\nexport function LifecycleHooksFeature(component: any, def: ComponentDef<any>): void {\n const rootTView = readPatchedLView(component) ![TVIEW];\n const dirIndex = rootTView.data.length - 1;\n\n queueInitHooks(dirIndex, def.onInit, def.doCheck, rootTView);\n // TODO(misko): replace `as TNode` with createTNode call. (needs refactoring to lose dep on\n // LNode).\n queueLifecycleHooks(rootTView, { directiveStart: dirIndex, directiveEnd: dirIndex + 1 } as TNode);\n}\n\n/**\n * Retrieve the root context for any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param component any component\n */\nfunction getRootContext(component: any): RootContext {\n const rootContext = getRootView(component)[CONTEXT] as RootContext;\n ngDevMode && assertDefined(rootContext, 'rootContext');\n return rootContext;\n}\n\n\n/**\n * Wait on component until it is rendered.\n *\n * This function returns a `Promise` which is resolved when the component's\n * change detection is executed. This is determined by finding the scheduler\n * associated with the `component`'s render tree and waiting until the scheduler\n * flushes. If nothing is scheduled, the function returns a resolved promise.\n *\n * Example:\n * ```\n * await whenRendered(myComponent);\n * ```\n *\n * @param component Component to wait upon\n * @returns Promise which resolves when the component is rendered.\n */\nexport function whenRendered(component: any): Promise<null> {\n return getRootContext(component).clean;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../../type';\nimport {fillProperties} from '../../util/property';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';\n\n\n\n/**\n * Determines if a definition is a {@link ComponentDef} or a {@link DirectiveDef}\n * @param definition The definition to examine\n */\nfunction isComponentDef<T>(definition: ComponentDef<T>| DirectiveDef<T>):\n definition is ComponentDef<T> {\n const def = definition as ComponentDef<T>;\n return typeof def.template === 'function';\n}\n\nfunction getSuperType(type: Type<any>): Type<any>&\n {ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n */\nexport function InheritDefinitionFeature(definition: DirectiveDef<any>| ComponentDef<any>): void {\n let superType = getSuperType(definition.type);\n\n while (superType) {\n let superDef: DirectiveDef<any>|ComponentDef<any>|undefined = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ngComponentDef || superType.ngDirectiveDef;\n } else {\n if (superType.ngComponentDef) {\n throw new Error('Directives cannot inherit Components');\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ngDirectiveDef;\n }\n\n const baseDef = (superType as any).ngBaseDef;\n\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n if (baseDef || superDef) {\n const writeableDef = definition as any;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n }\n\n if (baseDef) {\n // Merge inputs and outputs\n fillProperties(definition.inputs, baseDef.inputs);\n fillProperties(definition.declaredInputs, baseDef.declaredInputs);\n fillProperties(definition.outputs, baseDef.outputs);\n }\n\n if (superDef) {\n // Merge hostBindings\n const prevHostBindings = definition.hostBindings;\n const superHostBindings = superDef.hostBindings;\n if (superHostBindings) {\n if (prevHostBindings) {\n definition.hostBindings = (rf: RenderFlags, ctx: any, elementIndex: number) => {\n superHostBindings(rf, ctx, elementIndex);\n prevHostBindings(rf, ctx, elementIndex);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n }\n\n // Merge View Queries\n if (isComponentDef(definition) && isComponentDef(superDef)) {\n const prevViewQuery = definition.viewQuery;\n const superViewQuery = superDef.viewQuery;\n if (superViewQuery) {\n if (prevViewQuery) {\n definition.viewQuery = <T>(rf: RenderFlags, ctx: T): void => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n } else {\n definition.viewQuery = superViewQuery;\n }\n }\n }\n\n // Merge Content Queries\n const prevContentQueries = definition.contentQueries;\n const superContentQueries = superDef.contentQueries;\n if (superContentQueries) {\n if (prevContentQueries) {\n definition.contentQueries = (dirIndex: number) => {\n superContentQueries(dirIndex);\n prevContentQueries(dirIndex);\n };\n } else {\n definition.contentQueries = superContentQueries;\n }\n }\n\n // Merge Content Queries Refresh\n const prevContentQueriesRefresh = definition.contentQueriesRefresh;\n const superContentQueriesRefresh = superDef.contentQueriesRefresh;\n if (superContentQueriesRefresh) {\n if (prevContentQueriesRefresh) {\n definition.contentQueriesRefresh = (directiveIndex: number, queryIndex: number) => {\n superContentQueriesRefresh(directiveIndex, queryIndex);\n prevContentQueriesRefresh(directiveIndex, queryIndex);\n };\n } else {\n definition.contentQueriesRefresh = superContentQueriesRefresh;\n }\n }\n\n\n // Merge inputs and outputs\n fillProperties(definition.inputs, superDef.inputs);\n fillProperties(definition.declaredInputs, superDef.declaredInputs);\n fillProperties(definition.outputs, superDef.outputs);\n\n // Inherit hooks\n // Assume super class inheritance feature has already run.\n definition.afterContentChecked =\n definition.afterContentChecked || superDef.afterContentChecked;\n definition.afterContentInit = definition.afterContentInit || superDef.afterContentInit;\n definition.afterViewChecked = definition.afterViewChecked || superDef.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superDef.afterViewInit;\n definition.doCheck = definition.doCheck || superDef.doCheck;\n definition.onDestroy = definition.onDestroy || superDef.onDestroy;\n definition.onInit = definition.onInit || superDef.onInit;\n\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (const feature of features) {\n if (feature && feature.ngInherit) {\n (feature as DirectiveDefFeature)(definition);\n }\n }\n }\n\n break;\n } else {\n // Even if we don't have a definition, check the type for the hooks and use those if need be\n const superPrototype = superType.prototype;\n\n if (superPrototype) {\n definition.afterContentChecked =\n definition.afterContentChecked || superPrototype.afterContentChecked;\n definition.afterContentInit =\n definition.afterContentInit || superPrototype.afterContentInit;\n definition.afterViewChecked =\n definition.afterViewChecked || superPrototype.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superPrototype.afterViewInit;\n definition.doCheck = definition.doCheck || superPrototype.doCheck;\n definition.onDestroy = definition.onDestroy || superPrototype.onDestroy;\n definition.onInit = definition.onInit || superPrototype.onInit;\n }\n }\n\n superType = Object.getPrototypeOf(superType);\n }\n}\n\nfunction maybeUnwrapEmpty<T>(value: T[]): T[];\nfunction maybeUnwrapEmpty<T>(value: T): T;\nfunction maybeUnwrapEmpty(value: any): any {\n if (value === EMPTY_OBJ) {\n return {};\n } else if (value === EMPTY_ARRAY) {\n return [];\n } else {\n return value;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SimpleChange} from '../../change_detection/change_detection_util';\nimport {OnChanges, SimpleChanges} from '../../metadata/lifecycle_hooks';\nimport {DirectiveDef, DirectiveDefFeature} from '../interfaces/definition';\n\nconst PRIVATE_PREFIX = '__ngOnChanges_';\n\ntype OnChangesExpando = OnChanges & {\n __ngOnChanges_: SimpleChanges|null|undefined;\n // tslint:disable-next-line:no-any Can hold any value\n [key: string]: any;\n};\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ngComponentDef = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n */\nexport function NgOnChangesFeature<T>(definition: DirectiveDef<T>): void {\n const publicToDeclaredInputs = definition.declaredInputs;\n const publicToMinifiedInputs = definition.inputs;\n const proto = definition.type.prototype;\n for (const publicName in publicToDeclaredInputs) {\n if (publicToDeclaredInputs.hasOwnProperty(publicName)) {\n const minifiedKey = publicToMinifiedInputs[publicName];\n const declaredKey = publicToDeclaredInputs[publicName];\n const privateMinKey = PRIVATE_PREFIX + minifiedKey;\n\n // Walk the prototype chain to see if we find a property descriptor\n // That way we can honor setters and getters that were inherited.\n let originalProperty: PropertyDescriptor|undefined = undefined;\n let checkProto = proto;\n while (!originalProperty && checkProto &&\n Object.getPrototypeOf(checkProto) !== Object.getPrototypeOf(Object.prototype)) {\n originalProperty = Object.getOwnPropertyDescriptor(checkProto, minifiedKey);\n checkProto = Object.getPrototypeOf(checkProto);\n }\n\n const getter = originalProperty && originalProperty.get;\n const setter = originalProperty && originalProperty.set;\n\n // create a getter and setter for property\n Object.defineProperty(proto, minifiedKey, {\n get: getter ||\n (setter ? undefined : function(this: OnChangesExpando) { return this[privateMinKey]; }),\n set<T>(this: OnChangesExpando, value: T) {\n let simpleChanges = this[PRIVATE_PREFIX];\n if (!simpleChanges) {\n simpleChanges = {};\n // Place where we will store SimpleChanges if there is a change\n Object.defineProperty(this, PRIVATE_PREFIX, {value: simpleChanges, writable: true});\n }\n\n const isFirstChange = !this.hasOwnProperty(privateMinKey);\n const currentChange = simpleChanges[declaredKey];\n\n if (currentChange) {\n currentChange.currentValue = value;\n } else {\n simpleChanges[declaredKey] =\n new SimpleChange(this[privateMinKey], value, isFirstChange);\n }\n\n if (isFirstChange) {\n // Create a place where the actual value will be stored and make it non-enumerable\n Object.defineProperty(this, privateMinKey, {value, writable: true});\n } else {\n this[privateMinKey] = value;\n }\n\n if (setter) setter.call(this, value);\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n }\n }\n\n // If an onInit hook is defined, it will need to wrap the ngOnChanges call\n // so the call order is changes-init-check in creation mode. In subsequent\n // change detection runs, only the check wrapper will be called.\n if (definition.onInit != null) {\n definition.onInit = onChangesWrapper(definition.onInit);\n }\n\n definition.doCheck = onChangesWrapper(definition.doCheck);\n}\n\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n(NgOnChangesFeature as DirectiveDefFeature).ngInherit = true;\n\nfunction onChangesWrapper(delegateHook: (() => void) | null) {\n return function(this: OnChangesExpando) {\n const simpleChanges = this[PRIVATE_PREFIX];\n if (simpleChanges != null) {\n this.ngOnChanges(simpleChanges);\n this[PRIVATE_PREFIX] = null;\n }\n if (delegateHook) delegateHook.apply(this);\n };\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function noop(...args: any[]): any {\n // Do nothing.\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectInjector} from '../render3/di';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {noop} from '../util/noop';\nimport {getClosureSafeProperty} from '../util/property';\n\nimport {defineInjectable} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {InjectFlags, inject} from './injector_compatibility';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, ValueProvider} from './provider';\n\nexport const SOURCE = '__source';\nconst _THROW_IF_NOT_FOUND = new Object();\nexport const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nexport const INJECTOR = new InjectionToken<Injector>('INJECTOR');\n\nexport class NullInjector implements Injector {\n get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any {\n if (notFoundValue === _THROW_IF_NOT_FOUND) {\n // Intentionally left behind: With dev tools open the debugger will stop here. There is no\n // reason why correctly written application should cause this exception.\n // TODO(misko): uncomment the next line once `ngDevMode` works with closure.\n // if(ngDevMode) debugger;\n throw new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n }\n return notFoundValue;\n }\n}\n\n/**\n * Concrete injectors implement this interface.\n *\n * For more details, see the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nexport abstract class Injector {\n static THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n static NULL: Injector = new NullInjector();\n\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n /**\n * @deprecated from v4.0.0 use Type<T> or InjectionToken<T>\n * @suppress {duplicate}\n */\n abstract get(token: any, notFoundValue?: any): any;\n\n /**\n * @deprecated from v5 use the new signature Injector.create(options)\n */\n static create(providers: StaticProvider[], parent?: Injector): Injector;\n\n static create(options: {providers: StaticProvider[], parent?: Injector, name?: string}): Injector;\n\n /**\n * Create a new Injector which is configure using `StaticProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n */\n static create(\n options: StaticProvider[]|{providers: StaticProvider[], parent?: Injector, name?: string},\n parent?: Injector): Injector {\n if (Array.isArray(options)) {\n return new StaticInjector(options, parent);\n } else {\n return new StaticInjector(options.providers, options.parent, options.name || null);\n }\n }\n\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'any' as any,\n factory: () => inject(INJECTOR),\n });\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => Injector = () => SWITCH_INJECTOR_FACTORY();\n}\n\nexport const SWITCH_INJECTOR_FACTORY__POST_R3__ = function() {\n return injectInjector();\n};\nconst SWITCH_INJECTOR_FACTORY__PRE_R3__ = noop;\nconst SWITCH_INJECTOR_FACTORY: typeof injectInjector = SWITCH_INJECTOR_FACTORY__PRE_R3__;\n\n\nconst IDENT = function<T>(value: T): T {\n return value;\n};\nconst EMPTY = <any[]>[];\nconst CIRCULAR = IDENT;\nconst MULTI_PROVIDER_FN = function(): any[] {\n return Array.prototype.slice.call(arguments);\n};\nexport const USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst enum OptionFlags {\n Optional = 1 << 0,\n CheckSelf = 1 << 1,\n CheckParent = 1 << 2,\n Default = CheckSelf | CheckParent\n}\nconst NULL_INJECTOR = Injector.NULL;\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\n\nexport class StaticInjector implements Injector {\n readonly parent: Injector;\n readonly source: string|null;\n\n private _records: Map<any, Record>;\n\n constructor(\n providers: StaticProvider[], parent: Injector = NULL_INJECTOR, source: string|null = null) {\n this.parent = parent;\n this.source = source;\n const records = this._records = new Map<any, Record>();\n records.set(\n Injector, <Record>{token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n records.set(\n INJECTOR, <Record>{token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n recursivelyProcessProviders(records, providers);\n }\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n get(token: any, notFoundValue?: any): any;\n get(token: any, notFoundValue?: any, flags: InjectFlags = InjectFlags.Default): any {\n const record = this._records.get(token);\n try {\n return tryResolveToken(token, record, this._records, this.parent, notFoundValue, flags);\n } catch (e) {\n const tokenPath: any[] = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, this.source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n }\n }\n\n toString() {\n const tokens = <string[]>[], records = this._records;\n records.forEach((v, token) => tokens.push(stringify(token)));\n return `StaticInjector[${tokens.join(', ')}]`;\n }\n}\n\ntype SupportedProvider =\n ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider;\n\ninterface Record {\n fn: Function;\n useNew: boolean;\n deps: DependencyRecord[];\n value: any;\n}\n\ninterface DependencyRecord {\n token: any;\n options: number;\n}\n\ntype TokenPath = Array<any>;\n\nfunction resolveProvider(provider: SupportedProvider): Record {\n const deps = computeDeps(provider);\n let fn: Function = IDENT;\n let value: any = EMPTY;\n let useNew: boolean = false;\n let provide = resolveForwardRef(provider.provide);\n if (USE_VALUE in provider) {\n // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.\n value = (provider as ValueProvider).useValue;\n } else if ((provider as FactoryProvider).useFactory) {\n fn = (provider as FactoryProvider).useFactory;\n } else if ((provider as ExistingProvider).useExisting) {\n // Just use IDENT\n } else if ((provider as StaticClassProvider).useClass) {\n useNew = true;\n fn = resolveForwardRef((provider as StaticClassProvider).useClass);\n } else if (typeof provide == 'function') {\n useNew = true;\n fn = provide;\n } else {\n throw staticError(\n 'StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable',\n provider);\n }\n return {deps, fn, useNew, value};\n}\n\nfunction multiProviderMixError(token: any) {\n return staticError('Cannot mix multi providers and regular providers', token);\n}\n\nfunction recursivelyProcessProviders(records: Map<any, Record>, provider: StaticProvider) {\n if (provider) {\n provider = resolveForwardRef(provider);\n if (provider instanceof Array) {\n // if we have an array recurse into the array\n for (let i = 0; i < provider.length; i++) {\n recursivelyProcessProviders(records, provider[i]);\n }\n } else if (typeof provider === 'function') {\n // Functions were supported in ReflectiveInjector, but are not here. For safety give useful\n // error messages\n throw staticError('Function/Class not supported', provider);\n } else if (provider && typeof provider === 'object' && provider.provide) {\n // At this point we have what looks like a provider: {provide: ?, ....}\n let token = resolveForwardRef(provider.provide);\n const resolvedProvider = resolveProvider(provider);\n if (provider.multi === true) {\n // This is a multi provider.\n let multiProvider: Record|undefined = records.get(token);\n if (multiProvider) {\n if (multiProvider.fn !== MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n } else {\n // Create a placeholder factory which will look up the constituents of the multi provider.\n records.set(token, multiProvider = <Record>{\n token: provider.provide,\n deps: [],\n useNew: false,\n fn: MULTI_PROVIDER_FN,\n value: EMPTY\n });\n }\n // Treat the provider as the token.\n token = provider;\n multiProvider.deps.push({token, options: OptionFlags.Default});\n }\n const record = records.get(token);\n if (record && record.fn == MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n records.set(token, resolvedProvider);\n } else {\n throw staticError('Unexpected provider', provider);\n }\n }\n}\n\nfunction tryResolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n try {\n return resolveToken(token, record, records, parent, notFoundValue, flags);\n } catch (e) {\n // ensure that 'e' is of type Error.\n if (!(e instanceof Error)) {\n e = new Error(e);\n }\n const path: any[] = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(token);\n if (record && record.value == CIRCULAR) {\n // Reset the Circular flag.\n record.value = EMPTY;\n }\n throw e;\n }\n}\n\nfunction resolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n let value;\n if (record && !(flags & InjectFlags.SkipSelf)) {\n // If we don't have a record, this implies that we don't own the provider hence don't know how\n // to resolve it.\n value = record.value;\n if (value == CIRCULAR) {\n throw Error(NO_NEW_LINE + 'Circular dependency');\n } else if (value === EMPTY) {\n record.value = CIRCULAR;\n let obj = undefined;\n let useNew = record.useNew;\n let fn = record.fn;\n let depRecords = record.deps;\n let deps = EMPTY;\n if (depRecords.length) {\n deps = [];\n for (let i = 0; i < depRecords.length; i++) {\n const depRecord: DependencyRecord = depRecords[i];\n const options = depRecord.options;\n const childRecord =\n options & OptionFlags.CheckSelf ? records.get(depRecord.token) : undefined;\n deps.push(tryResolveToken(\n // Current Token to resolve\n depRecord.token,\n // A record which describes how to resolve the token.\n // If undefined, this means we don't have such a record\n childRecord,\n // Other records we know about.\n records,\n // If we don't know how to resolve dependency and we should not check parent for it,\n // than pass in Null injector.\n !childRecord && !(options & OptionFlags.CheckParent) ? NULL_INJECTOR : parent,\n options & OptionFlags.Optional ? null : Injector.THROW_IF_NOT_FOUND,\n InjectFlags.Default));\n }\n }\n record.value = value = useNew ? new (fn as any)(...deps) : fn.apply(obj, deps);\n }\n } else if (!(flags & InjectFlags.Self)) {\n value = parent.get(token, notFoundValue, InjectFlags.Default);\n }\n return value;\n}\n\nfunction computeDeps(provider: StaticProvider): DependencyRecord[] {\n let deps: DependencyRecord[] = EMPTY;\n const providerDeps: any[] =\n (provider as ExistingProvider & StaticClassProvider & ConstructorProvider).deps;\n if (providerDeps && providerDeps.length) {\n deps = [];\n for (let i = 0; i < providerDeps.length; i++) {\n let options = OptionFlags.Default;\n let token = resolveForwardRef(providerDeps[i]);\n if (token instanceof Array) {\n for (let j = 0, annotations = token; j < annotations.length; j++) {\n const annotation = annotations[j];\n if (annotation instanceof Optional || annotation == Optional) {\n options = options | OptionFlags.Optional;\n } else if (annotation instanceof SkipSelf || annotation == SkipSelf) {\n options = options & ~OptionFlags.CheckSelf;\n } else if (annotation instanceof Self || annotation == Self) {\n options = options & ~OptionFlags.CheckParent;\n } else if (annotation instanceof Inject) {\n token = (annotation as Inject).token;\n } else {\n token = resolveForwardRef(annotation);\n }\n }\n }\n deps.push({token, options});\n }\n } else if ((provider as ExistingProvider).useExisting) {\n const token = resolveForwardRef((provider as ExistingProvider).useExisting);\n deps = [{token, options: OptionFlags.Default}];\n } else if (!providerDeps && !(USE_VALUE in provider)) {\n // useValue & useExisting are the only ones which are exempt from deps all others need it.\n throw staticError('\\'deps\\' required', provider);\n }\n return deps;\n}\n\nfunction formatError(text: string, obj: any, source: string | null = null): string {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;\n let context = stringify(obj);\n if (obj instanceof Array) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = <string[]>[];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(\n key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `StaticInjectorError${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\nfunction staticError(text: string, obj: any): Error {\n return new Error(formatError(text, obj));\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {InjectionToken} from './injection_token';\n\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nexport const APP_ROOT = new InjectionToken<boolean>(\n 'The presence of this token marks an injector as being the root injector.');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OnDestroy} from '../metadata/lifecycle_hooks';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {INJECTOR, Injector, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE} from './injector';\nimport {InjectFlags, inject, injectArgs, setCurrentInjector} from './injector_compatibility';\nimport {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, Provider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider} from './provider';\nimport {APP_ROOT} from './scope';\n\n\n\n/**\n * Internal type for a single provider in a deep provider array.\n */\ntype SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider |\n ExistingProvider | FactoryProvider | StaticClassProvider;\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n\nconst EMPTY_ARRAY = [] as any[];\n\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR: Injector|undefined = undefined;\n\nfunction getNullInjector(): Injector {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n\n/**\n * An entry in the injector which tracks information about the given token, including a possible\n * current value.\n */\ninterface Record<T> {\n factory: (() => T)|undefined;\n value: T|{};\n multi: any[]|undefined;\n}\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n *\n * @publicApi\n */\nexport function createInjector(\n defType: /* InjectorType<any> */ any, parent: Injector | null = null,\n additionalProviders: StaticProvider[] | null = null): Injector {\n parent = parent || getNullInjector();\n return new R3Injector(defType, additionalProviders, parent);\n}\n\nexport class R3Injector {\n /**\n * Map of tokens to records which contain the instances of those tokens.\n */\n private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();\n\n /**\n * The transitive set of `InjectorType`s which define this injector.\n */\n private injectorDefTypes = new Set<InjectorType<any>>();\n\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n private onDestroy = new Set<OnDestroy>();\n\n /**\n * Flag indicating this injector provides the APP_ROOT_SCOPE token, and thus counts as the\n * root scope.\n */\n private readonly isRootInjector: boolean;\n\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n private destroyed = false;\n\n constructor(\n def: InjectorType<any>, additionalProviders: StaticProvider[]|null,\n readonly parent: Injector) {\n // Start off by creating Records for every provider declared in every InjectorType\n // included transitively in `def`.\n const dedupStack: InjectorType<any>[] = [];\n deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack));\n\n additionalProviders && deepForEach(\n additionalProviders, provider => this.processProvider(\n provider, def, additionalProviders));\n\n\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR, makeRecord(undefined, this));\n\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n this.isRootInjector = this.records.has(APP_ROOT);\n\n // Eagerly instantiate the InjectorType classes themselves.\n this.injectorDefTypes.forEach(defType => this.get(defType));\n }\n\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy(): void {\n this.assertNotDestroyed();\n\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this.destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n } finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }\n\n get<T>(\n token: Type<T>|InjectionToken<T>, notFoundValue: any = THROW_IF_NOT_FOUND,\n flags = InjectFlags.Default): T {\n this.assertNotDestroyed();\n // Set the injection context.\n const previousInjector = setCurrentInjector(this);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record: Record<T>|undefined = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an ngInjectableDef\n // with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an ngInjectableDef and it's scoped to this injector. Pretend as if it was here\n // all along.\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n this.records.set(token, record);\n }\n }\n // If a record was found, get the instance for it and return it.\n if (record !== undefined) {\n return this.hydrate(token, record);\n }\n }\n\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n return nextInjector.get(token, notFoundValue);\n } finally {\n // Lastly, clean up the state by restoring the previous injector.\n setCurrentInjector(previousInjector);\n }\n }\n\n private assertNotDestroyed(): void {\n if (this.destroyed) {\n throw new Error('Injector has already been destroyed.');\n }\n }\n\n /**\n * Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers\n * to this injector.\n */\n private processInjectorType(\n defOrWrappedDef: InjectorType<any>|InjectorTypeWithProviders<any>,\n parents: InjectorType<any>[], dedupStack: InjectorType<any>[]) {\n defOrWrappedDef = resolveForwardRef(defOrWrappedDef);\n if (!defOrWrappedDef) return;\n\n // Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an\n // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic\n // read, so care is taken to only do the read once.\n\n // First attempt to read the ngInjectorDef.\n let def = getInjectorDef(defOrWrappedDef);\n\n // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.\n const ngModule =\n (def == null) && (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule || undefined;\n\n // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,\n // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type\n // is the `ngModule`.\n const defType: InjectorType<any> =\n (ngModule === undefined) ? (defOrWrappedDef as InjectorType<any>) : ngModule;\n\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n throw new Error(\n `Circular dependency in DI detected for type ${defName}. Dependency path: ${parents.map(defType => stringify(defType)).join(' > ')} > ${defName}.`);\n }\n\n // Check for multiple imports of the same module\n const isDuplicate = dedupStack.indexOf(defType) !== -1;\n\n // If defOrWrappedType was an InjectorDefTypeWithProviders, then .providers may hold some\n // extra providers.\n const providers =\n (ngModule !== undefined) && (defOrWrappedDef as InjectorTypeWithProviders<any>).providers ||\n EMPTY_ARRAY;\n\n // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual\n // `InjectorDef` is on its `ngModule`.\n if (ngModule !== undefined) {\n def = getInjectorDef(ngModule);\n }\n\n // If no definition was found, it might be from exports. Remove it.\n if (def == null) {\n return;\n }\n\n // Track the InjectorType and add a provider for it.\n this.injectorDefTypes.add(defType);\n this.records.set(defType, makeRecord(def.factory, NOT_YET));\n\n // Add providers in the same way that @NgModule resolution did:\n\n // First, include providers from any imports.\n if (def.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedupStack.push(defType);\n\n try {\n deepForEach(\n def.imports, imported => this.processInjectorType(imported, parents, dedupStack));\n } finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n }\n\n // Next, include providers listed on the definition itself.\n const defProviders = def.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = defOrWrappedDef as InjectorType<any>;\n deepForEach(\n defProviders, provider => this.processProvider(provider, injectorType, defProviders));\n }\n\n // Finally, include providers from an InjectorDefTypeWithProviders if there was one.\n const ngModuleType = (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule;\n deepForEach(providers, provider => this.processProvider(provider, ngModuleType, providers));\n }\n\n /**\n * Process a `SingleProvider` and add it.\n */\n private processProvider(\n provider: SingleProvider, ngModuleType: InjectorType<any>, providers: any[]): void {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token: any =\n isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (multiRecord.multi === undefined) {\n throw new Error(`Mixed multi-provider for ${token}.`);\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord !.multi !);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi !.push(provider);\n } else {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throw new Error(`Mixed multi-provider for ${stringify(token)}`);\n }\n }\n this.records.set(token, record);\n }\n\n private hydrate<T>(token: Type<T>|InjectionToken<T>, record: Record<T>): T {\n if (record.value === CIRCULAR) {\n throw new Error(`Cannot instantiate cyclic dependency! ${stringify(token)}`);\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n record.value = record.factory !();\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this.onDestroy.add(record.value);\n }\n return record.value as T;\n }\n\n private injectableDefInScope(def: InjectableDef<any>): boolean {\n if (!def.providedIn) {\n return false;\n } else if (typeof def.providedIn === 'string') {\n return def.providedIn === 'any' || (def.providedIn === 'root' && this.isRootInjector);\n } else {\n return this.injectorDefTypes.has(def.providedIn);\n }\n }\n}\n\nfunction injectableDefOrInjectorDefFactory(token: Type<any>| InjectionToken<any>): () => any {\n const injectableDef = getInjectableDef(token as InjectableType<any>);\n if (injectableDef === null) {\n const injectorDef = getInjectorDef(token as InjectorType<any>);\n if (injectorDef !== null) {\n return injectorDef.factory;\n } else if (token instanceof InjectionToken) {\n throw new Error(`Token ${stringify(token)} is missing an ngInjectableDef definition.`);\n } else if (token instanceof Function) {\n const paramLength = token.length;\n if (paramLength > 0) {\n const args: string[] = new Array(paramLength).fill('?');\n throw new Error(\n `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);\n }\n return () => new (token as Type<any>)();\n }\n throw new Error('unreachable');\n }\n return injectableDef.factory;\n}\n\nfunction providerToRecord(\n provider: SingleProvider, ngModuleType: InjectorType<any>, providers: any[]): Record<any> {\n let factory: (() => any)|undefined = providerToFactory(provider, ngModuleType, providers);\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n return makeRecord(factory, NOT_YET);\n }\n}\n\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nexport function providerToFactory(\n provider: SingleProvider, ngModuleType?: InjectorType<any>, providers?: any[]): () => any {\n let factory: (() => any)|undefined = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isExistingProvider(provider)) {\n factory = () => inject(resolveForwardRef(provider.useExisting));\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else {\n const classRef = resolveForwardRef(\n provider &&\n ((provider as StaticClassProvider | ClassProvider).useClass || provider.provide));\n if (!classRef) {\n let ngModuleDetail = '';\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n ngModuleDetail =\n ` - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`;\n }\n throw new Error(\n `Invalid provider for the NgModule '${stringify(ngModuleType)}'` + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n } else {\n return injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\n\nfunction makeRecord<T>(\n factory: (() => T) | undefined, value: T | {}, multi: boolean = false): Record<T> {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined,\n };\n}\n\nfunction deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\n\nfunction isValueProvider(value: SingleProvider): value is ValueProvider {\n return value && typeof value == 'object' && USE_VALUE in value;\n}\n\nfunction isExistingProvider(value: SingleProvider): value is ExistingProvider {\n return !!(value && (value as ExistingProvider).useExisting);\n}\n\nfunction isFactoryProvider(value: SingleProvider): value is FactoryProvider {\n return !!(value && (value as FactoryProvider).useFactory);\n}\n\nexport function isTypeProvider(value: SingleProvider): value is TypeProvider {\n return typeof value === 'function';\n}\n\nfunction hasDeps(value: ClassProvider | ConstructorProvider | StaticClassProvider):\n value is ClassProvider&{deps: any[]} {\n return !!(value as any).deps;\n}\n\nfunction hasOnDestroy(value: any): value is OnDestroy {\n return typeof value === 'object' && value != null && (value as OnDestroy).ngOnDestroy &&\n typeof(value as OnDestroy).ngOnDestroy === 'function';\n}\n\nfunction couldBeInjectableType(value: any): value is Type<any>|InjectionToken<any> {\n return (typeof value === 'function') ||\n (typeof value === 'object' && value instanceof InjectionToken);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {Provider} from '../di/provider';\nimport {isTypeProvider, providerToFactory} from '../di/r3_injector';\n\nimport {DirectiveDef} from '.';\nimport {diPublicInInjector, getNodeInjectable, getOrCreateNodeInjectorForNode} from './di';\nimport {directiveInject} from './instructions';\nimport {NodeInjectorFactory} from './interfaces/injector';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNodeFlags, TNodeProviderIndexes} from './interfaces/node';\nimport {LView, TData, TVIEW, TView} from './interfaces/view';\nimport {getLView, getPreviousOrParentTNode} from './state';\nimport {isComponentDef} from './util';\n\n\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nexport function providersResolver<T>(\n def: DirectiveDef<T>, providers: Provider[], viewProviders: Provider[]): void {\n const lView = getLView();\n const tView: TView = lView[TVIEW];\n if (tView.firstTemplatePass) {\n const isComponent = isComponentDef(def);\n\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(\n provider: Provider, tInjectables: TData, lInjectablesBlueprint: NodeInjectorFactory[],\n isComponent: boolean, isViewProvider: boolean): void {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(\n provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n } else {\n const lView = getLView();\n let token: any = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n let providerFactory: () => any = providerToFactory(provider);\n\n const tNode = getPreviousOrParentTNode();\n const beginIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount =\n tNode.providerIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n const existingFactoryIndex = indexOf(\n token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount,\n endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n } else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n\n const existingProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n lView, token);\n const factory = multiFactory(\n isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver,\n lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n // Cases 1.b and 2.b\n multiFactoryAdd(\n lInjectablesBlueprint ![isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex],\n providerFactory, !isViewProvider && isComponent);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders !++;\n }\n }\n }\n}\n\n/**\n * Add a factory in a multi factory.\n */\nfunction multiFactoryAdd(\n multiFactory: NodeInjectorFactory, factory: () => any, isComponentProvider: boolean): void {\n multiFactory.multi !.push(factory);\n if (isComponentProvider) {\n multiFactory.componentProviders !++;\n }\n}\n\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item: any, arr: any[], begin: number, end: number) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n}\n\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode): any[] {\n return multiResolve(this.multi !, []);\n}\n\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode): any[] {\n const factories = this.multi !;\n let result: any[];\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders !;\n const multiProviders = getNodeInjectable(tData, lData, this.providerFactory !.index !, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories: Array<() => any>, result: any[]): any[] {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i] !as() => null;\n result.push(factory());\n }\n return result;\n}\n\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(\n factoryFn: (\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode) => any,\n index: number, isViewProvider: boolean, isComponent: boolean,\n f: () => any): NodeInjectorFactory {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, directiveInject);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Provider} from '../../di/provider';\nimport {providersResolver} from '../di_setup';\nimport {DirectiveDef} from '../interfaces/definition';\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ngComponentDef = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * consts: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * text(0);\n * }\n * if (fs & RenderFlags.Update) {\n * textBinding(0, bind(ctx.greeter.greet()));\n * }\n * },\n * features: [ProvidersFeature([GreeterDE])]\n * });\n * }\n *\n * @param definition\n */\nexport function ProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {\n return (definition: DirectiveDef<T>) => {\n definition.providersResolver = (def: DirectiveDef<T>) =>\n providersResolver(def, providers, viewProviders);\n };\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {ViewRef} from './view_ref';\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nexport abstract class ComponentRef<C> {\n /**\n * The host or anchor [element](guide/glossary#element) for this component instance.\n */\n abstract get location(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this component instance.\n */\n abstract get injector(): Injector;\n\n /**\n * This component instance.\n */\n abstract get instance(): C;\n\n /**\n * The [host view](guide/glossary#view-tree) defined by the template\n * for this component instance.\n */\n abstract get hostView(): ViewRef;\n\n /**\n * The change detector for this component instance.\n */\n abstract get changeDetectorRef(): ChangeDetectorRef;\n\n /**\n * The component type.\n */\n abstract get componentType(): Type<any>;\n\n /**\n * Destroys the component instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for the component.\n * @param callback A handler function that cleans up developer-defined data\n * associated with this component. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): void;\n}\n\n/**\n * @publicApi\n */\nexport abstract class ComponentFactory<C> {\n /**\n * The component's HTML selector.\n */\n abstract get selector(): string;\n /**\n * The component's type\n */\n abstract get componentType(): Type<any>;\n /**\n * Selector for all <ng-content> elements in the component.\n */\n abstract get ngContentSelectors(): string[];\n /**\n * The inputs of the component.\n */\n abstract get inputs(): {propName: string, templateName: string}[];\n /**\n * The outputs of the component.\n */\n abstract get outputs(): {propName: string, templateName: string}[];\n /**\n * Creates a new component.\n */\n abstract create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {NgModuleRef} from './ng_module_factory';\n\nexport function noComponentFactoryError(component: Function) {\n const error = Error(\n `No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);\n (error as any)[ERROR_COMPONENT] = component;\n return error;\n}\n\nconst ERROR_COMPONENT = 'ngComponent';\n\nexport function getComponent(error: Error): Type<any> {\n return (error as any)[ERROR_COMPONENT];\n}\n\n\nclass _NullComponentFactoryResolver implements ComponentFactoryResolver {\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n throw noComponentFactoryError(component);\n }\n}\n\n/**\n * @publicApi\n */\nexport abstract class ComponentFactoryResolver {\n static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();\n abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;\n}\n\nexport class CodegenComponentFactoryResolver implements ComponentFactoryResolver {\n private _factories = new Map<any, ComponentFactory<any>>();\n\n constructor(\n factories: ComponentFactory<any>[], private _parent: ComponentFactoryResolver,\n private _ngModule: NgModuleRef<any>) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n this._factories.set(factory.componentType, factory);\n }\n }\n\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n let factory = this._factories.get(component);\n if (!factory && this._parent) {\n factory = this._parent.resolveComponentFactory(component);\n }\n if (!factory) {\n throw noComponentFactoryError(component);\n }\n return new ComponentFactoryBoundToModule(factory, this._ngModule);\n }\n}\n\nexport class ComponentFactoryBoundToModule<C> extends ComponentFactory<C> {\n readonly selector: string;\n readonly componentType: Type<any>;\n readonly ngContentSelectors: string[];\n readonly inputs: {propName: string, templateName: string}[];\n readonly outputs: {propName: string, templateName: string}[];\n\n constructor(private factory: ComponentFactory<C>, private ngModule: NgModuleRef<any>) {\n super();\n this.selector = factory.selector;\n this.componentType = factory.componentType;\n this.ngContentSelectors = factory.ngContentSelectors;\n this.inputs = factory.inputs;\n this.outputs = factory.outputs;\n }\n\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C> {\n return this.factory.create(\n injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ComponentFactoryResolver} from './component_factory_resolver';\n\n\n/**\n * Represents an instance of an NgModule created via a {@link NgModuleFactory}.\n *\n * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n * NgModule Instance.\n *\n * @publicApi\n */\nexport abstract class NgModuleRef<T> {\n /**\n * The injector that contains all of the providers of the NgModule.\n */\n abstract get injector(): Injector;\n\n /**\n * The ComponentFactoryResolver to get hold of the ComponentFactories\n * declared in the `entryComponents` property of the module.\n */\n abstract get componentFactoryResolver(): ComponentFactoryResolver;\n\n /**\n * The NgModule instance.\n */\n abstract get instance(): T;\n\n /**\n * Destroys the module instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Allows to register a callback that will be called when the module is destroyed.\n */\n abstract onDestroy(callback: () => void): void;\n}\n\nexport interface InternalNgModuleRef<T> extends NgModuleRef<T> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _bootstrapComponents: Type<any>[];\n}\n\n/**\n * @publicApi\n */\nexport abstract class NgModuleFactory<T> {\n abstract get moduleType(): Type<T>;\n abstract create(parentInjector: Injector|null): NgModuleRef<T>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef as viewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {ViewContainerRef as viewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, InternalViewRef as viewEngine_InternalViewRef} from '../linker/view_ref';\n\nimport {checkNoChanges, checkNoChangesInRootView, checkView, detectChangesInRootView, detectChangesInternal, markViewDirty, storeCleanupFn, viewAttached} from './instructions';\nimport {TNode, TNodeType, TViewNode} from './interfaces/node';\nimport {FLAGS, HOST, HOST_NODE, LView, LViewFlags, PARENT, RENDERER_FACTORY} from './interfaces/view';\nimport {destroyLView} from './node_manipulation';\nimport {getNativeByTNode} from './util';\n\n\n\n// Needed due to tsickle downleveling where multiple `implements` with classes creates\n// multiple @extends in Closure annotations, which is illegal. This workaround fixes\n// the multiple @extends by making the annotation @implements instead\nexport interface viewEngine_ChangeDetectorRef_interface extends viewEngine_ChangeDetectorRef {}\n\nexport class ViewRef<T> implements viewEngine_EmbeddedViewRef<T>, viewEngine_InternalViewRef,\n viewEngine_ChangeDetectorRef_interface {\n private _appRef: ApplicationRef|null = null;\n private _viewContainerRef: viewEngine_ViewContainerRef|null = null;\n\n /**\n * @internal\n */\n public _tViewNode: TViewNode|null = null;\n\n /**\n * @internal\n */\n public _lView: LView;\n\n get rootNodes(): any[] {\n if (this._lView[HOST] == null) {\n const tView = this._lView[HOST_NODE] as TViewNode;\n return collectNativeNodes(this._lView, tView, []);\n }\n return [];\n }\n\n constructor(_lView: LView, private _context: T|null, private _componentIndex: number) {\n this._lView = _lView;\n }\n\n get context(): T { return this._context ? this._context : this._lookUpContext(); }\n\n get destroyed(): boolean {\n return (this._lView[FLAGS] & LViewFlags.Destroyed) === LViewFlags.Destroyed;\n }\n\n destroy(): void {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._viewContainerRef) {\n const index = this._viewContainerRef.indexOf(this);\n\n if (index > -1) {\n this._viewContainerRef.detach(index);\n }\n\n this._viewContainerRef = null;\n }\n destroyLView(this._lView);\n }\n\n onDestroy(callback: Function) { storeCleanupFn(this._lView, callback); }\n\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * It also triggers change detection by calling `scheduleTick` internally, which coalesces\n * multiple `markForCheck` calls to into one change detection run.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'my-app',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck(): void { markViewDirty(this._lView); }\n\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach(): void { this._lView[FLAGS] &= ~LViewFlags.Attached; }\n\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'my-app',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach(): void { this._lView[FLAGS] |= LViewFlags.Attached; }\n\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach detach} for more information.\n */\n detectChanges(): void { detectChangesInternal(this._lView, this.context); }\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges(): void { checkNoChanges(this.context); }\n\n attachToViewContainerRef(vcRef: viewEngine_ViewContainerRef) {\n if (this._appRef) {\n throw new Error('This view is already attached directly to the ApplicationRef!');\n }\n this._viewContainerRef = vcRef;\n }\n\n detachFromAppRef() { this._appRef = null; }\n\n attachToAppRef(appRef: ApplicationRef) {\n if (this._viewContainerRef) {\n throw new Error('This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n\n private _lookUpContext(): T {\n return this._context = this._lView[PARENT] ![this._componentIndex] as T;\n }\n}\n\n/** @internal */\nexport class RootViewRef<T> extends ViewRef<T> {\n constructor(public _view: LView) { super(_view, null, -1); }\n\n detectChanges(): void { detectChangesInRootView(this._view); }\n\n checkNoChanges(): void { checkNoChangesInRootView(this._view); }\n\n get context(): T { return null !; }\n}\n\nfunction collectNativeNodes(lView: LView, parentTNode: TNode, result: any[]): any[] {\n let tNodeChild = parentTNode.child;\n\n while (tNodeChild) {\n result.push(getNativeByTNode(tNodeChild, lView));\n if (tNodeChild.type === TNodeType.ElementContainer) {\n collectNativeNodes(lView, tNodeChild, result);\n }\n tNodeChild = tNodeChild.next;\n }\n\n return result;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef as ViewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {Injector, NullInjector} from '../di/injector';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef as ViewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, ViewRef as viewEngine_ViewRef} from '../linker/view_ref';\nimport {Renderer2} from '../render/api';\nimport {assertDefined, assertGreaterThan, assertLessThan} from './assert';\nimport {NodeInjector, getParentInjectorLocation} from './di';\nimport {addToViewTree, createEmbeddedViewAndNode, createLContainer, renderEmbeddedTemplate} from './instructions';\nimport {ACTIVE_INDEX, LContainer, NATIVE, VIEWS} from './interfaces/container';\nimport {RenderFlags} from './interfaces/definition';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, TViewNode} from './interfaces/node';\nimport {LQueries} from './interfaces/query';\nimport {RComment, RElement, Renderer3, isProceduralRenderer} from './interfaces/renderer';\nimport {CONTAINER_INDEX, CONTEXT, HOST_NODE, LView, QUERIES, RENDERER, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes} from './node_assert';\nimport {addRemoveViewFromContainer, appendChild, detachView, getBeforeNodeForView, insertView, nativeInsertBefore, nativeNextSibling, nativeParentNode, removeView} from './node_manipulation';\nimport {getLView, getPreviousOrParentTNode} from './state';\nimport {findComponentView, getComponentViewByIndex, getNativeByTNode, getParentInjectorTNode, getParentInjectorView, hasParentInjector, isComponent, isLContainer, isRootView} from './util';\nimport {ViewRef} from './view_ref';\n\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nexport function injectElementRef(ElementRefToken: typeof ViewEngine_ElementRef):\n ViewEngine_ElementRef {\n return createElementRef(ElementRefToken, getPreviousOrParentTNode(), getLView());\n}\n\nlet R3ElementRef: {new (native: RElement | RComment): ViewEngine_ElementRef};\n\n/**\n * Creates an ElementRef given a node.\n *\n * @param ElementRefToken The ElementRef type\n * @param tNode The node for which you'd like an ElementRef\n * @param view The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nexport function createElementRef(\n ElementRefToken: typeof ViewEngine_ElementRef, tNode: TNode,\n view: LView): ViewEngine_ElementRef {\n if (!R3ElementRef) {\n // TODO: Fix class name, should be ElementRef, but there appears to be a rollup bug\n R3ElementRef = class ElementRef_ extends ElementRefToken {};\n }\n return new R3ElementRef(getNativeByTNode(tNode, view));\n}\n\nlet R3TemplateRef: {\n new (\n _declarationParentView: LView, elementRef: ViewEngine_ElementRef, _tView: TView,\n _renderer: Renderer3, _queries: LQueries | null, _injectorIndex: number):\n ViewEngine_TemplateRef<any>\n};\n\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nexport function injectTemplateRef<T>(\n TemplateRefToken: typeof ViewEngine_TemplateRef,\n ElementRefToken: typeof ViewEngine_ElementRef): ViewEngine_TemplateRef<T>|null {\n return createTemplateRef<T>(\n TemplateRefToken, ElementRefToken, getPreviousOrParentTNode(), getLView());\n}\n\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param TemplateRefToken The TemplateRef type\n * @param ElementRefToken The ElementRef type\n * @param hostTNode The node that is requesting a TemplateRef\n * @param hostView The view to which the node belongs\n * @returns The TemplateRef instance to use\n */\nexport function createTemplateRef<T>(\n TemplateRefToken: typeof ViewEngine_TemplateRef, ElementRefToken: typeof ViewEngine_ElementRef,\n hostTNode: TNode, hostView: LView): ViewEngine_TemplateRef<T>|null {\n if (!R3TemplateRef) {\n // TODO: Fix class name, should be TemplateRef, but there appears to be a rollup bug\n R3TemplateRef = class TemplateRef_<T> extends TemplateRefToken<T> {\n constructor(\n private _declarationParentView: LView, readonly elementRef: ViewEngine_ElementRef,\n private _tView: TView, private _renderer: Renderer3, private _queries: LQueries|null,\n private _injectorIndex: number) {\n super();\n }\n\n createEmbeddedView(\n context: T, container?: LContainer,\n hostTNode?: TElementNode|TContainerNode|TElementContainerNode, hostView?: LView,\n index?: number): viewEngine_EmbeddedViewRef<T> {\n const lView = createEmbeddedViewAndNode(\n this._tView, context, this._declarationParentView, this._renderer, this._queries,\n this._injectorIndex);\n if (container) {\n insertView(lView, container, hostView !, index !, hostTNode !.index);\n }\n renderEmbeddedTemplate(lView, this._tView, context);\n const viewRef = new ViewRef(lView, context, -1);\n viewRef._tViewNode = lView[HOST_NODE] as TViewNode;\n return viewRef;\n }\n };\n }\n\n if (hostTNode.type === TNodeType.Container) {\n const hostContainer: LContainer = hostView[hostTNode.index];\n ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');\n return new R3TemplateRef(\n hostView, createElementRef(ElementRefToken, hostTNode, hostView), hostTNode.tViews as TView,\n getLView()[RENDERER], hostContainer[QUERIES], hostTNode.injectorIndex);\n } else {\n return null;\n }\n}\n\nlet R3ViewContainerRef: {\n new (\n lContainer: LContainer, hostTNode: TElementNode | TContainerNode | TElementContainerNode,\n hostView: LView): ViewEngine_ViewContainerRef\n};\n\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nexport function injectViewContainerRef(\n ViewContainerRefToken: typeof ViewEngine_ViewContainerRef,\n ElementRefToken: typeof ViewEngine_ElementRef): ViewEngine_ViewContainerRef {\n const previousTNode =\n getPreviousOrParentTNode() as TElementNode | TElementContainerNode | TContainerNode;\n return createContainerRef(ViewContainerRefToken, ElementRefToken, previousTNode, getLView());\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param ViewContainerRefToken The ViewContainerRef type\n * @param ElementRefToken The ElementRef type\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nexport function createContainerRef(\n ViewContainerRefToken: typeof ViewEngine_ViewContainerRef,\n ElementRefToken: typeof ViewEngine_ElementRef,\n hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n hostView: LView): ViewEngine_ViewContainerRef {\n if (!R3ViewContainerRef) {\n // TODO: Fix class name, should be ViewContainerRef, but there appears to be a rollup bug\n R3ViewContainerRef = class ViewContainerRef_ extends ViewContainerRefToken {\n private _viewRefs: viewEngine_ViewRef[] = [];\n\n constructor(\n private _lContainer: LContainer,\n private _hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n private _hostView: LView) {\n super();\n }\n\n get element(): ViewEngine_ElementRef {\n return createElementRef(ElementRefToken, this._hostTNode, this._hostView);\n }\n\n get injector(): Injector { return new NodeInjector(this._hostTNode, this._hostView); }\n\n /** @deprecated No replacement */\n get parentInjector(): Injector {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostView);\n const parentView = getParentInjectorView(parentLocation, this._hostView);\n const parentTNode = getParentInjectorTNode(parentLocation, this._hostView, this._hostTNode);\n\n return !hasParentInjector(parentLocation) || parentTNode == null ?\n new NodeInjector(null, this._hostView) :\n new NodeInjector(parentTNode, parentView);\n }\n\n clear(): void {\n while (this._lContainer[VIEWS].length) {\n this.remove(0);\n }\n }\n\n get(index: number): viewEngine_ViewRef|null { return this._viewRefs[index] || null; }\n\n get length(): number { return this._lContainer[VIEWS].length; }\n\n createEmbeddedView<C>(templateRef: ViewEngine_TemplateRef<C>, context?: C, index?: number):\n viewEngine_EmbeddedViewRef<C> {\n const adjustedIdx = this._adjustIndex(index);\n const viewRef = (templateRef as any)\n .createEmbeddedView(\n context || <any>{}, this._lContainer, this._hostTNode,\n this._hostView, adjustedIdx);\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: viewEngine_ComponentFactory<C>, index?: number|undefined,\n injector?: Injector|undefined, projectableNodes?: any[][]|undefined,\n ngModuleRef?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && (componentFactory as any).ngModule == null && contextInjector) {\n ngModuleRef = contextInjector.get(viewEngine_NgModuleRef, null);\n }\n\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: viewEngine_ViewRef, index?: number): viewEngine_ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const lView = (viewRef as ViewRef<any>)._lView !;\n const adjustedIdx = this._adjustIndex(index);\n\n insertView(lView, this._lContainer, this._hostView, adjustedIdx, this._hostTNode.index);\n\n const beforeNode =\n getBeforeNodeForView(adjustedIdx, this._lContainer[VIEWS], this._lContainer[NATIVE]);\n addRemoveViewFromContainer(lView, true, beforeNode);\n\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n\n return viewRef;\n }\n\n move(viewRef: viewEngine_ViewRef, newIndex: number): viewEngine_ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const index = this.indexOf(viewRef);\n this.detach(index);\n this.insert(viewRef, this._adjustIndex(newIndex));\n return viewRef;\n }\n\n indexOf(viewRef: viewEngine_ViewRef): number { return this._viewRefs.indexOf(viewRef); }\n\n remove(index?: number): void {\n const adjustedIdx = this._adjustIndex(index, -1);\n removeView(this._lContainer, this._hostTNode, adjustedIdx);\n this._viewRefs.splice(adjustedIdx, 1);\n }\n\n detach(index?: number): viewEngine_ViewRef|null {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx, !!this._hostTNode.detached);\n const wasDetached = this._viewRefs.splice(adjustedIdx, 1)[0] != null;\n return wasDetached ? new ViewRef(view, view[CONTEXT], view[CONTAINER_INDEX]) : null;\n }\n\n private _adjustIndex(index?: number, shift: number = 0) {\n if (index == null) {\n return this._lContainer[VIEWS].length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, 'index must be positive');\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this._lContainer[VIEWS].length + 1 + shift, 'index');\n }\n return index;\n }\n };\n }\n\n ngDevMode && assertNodeOfPossibleTypes(\n hostTNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer);\n\n let lContainer: LContainer;\n const slotValue = hostView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n lContainer[ACTIVE_INDEX] = -1;\n } else {\n const commentNode = hostView[RENDERER].createComment(ngDevMode ? 'container' : '');\n ngDevMode && ngDevMode.rendererCreateComment++;\n\n // A container can be created on the root (topmost / bootstrapped) component and in this case we\n // can't use LTree to insert container's marker node (both parent of a comment node and the\n // commend node itself is located outside of elements hold by LTree). In this specific case we\n // use low-level DOM manipulation to insert container's marker (comment) node.\n if (isRootView(hostView)) {\n const renderer = hostView[RENDERER];\n const hostNative = getNativeByTNode(hostTNode, hostView) !;\n const parentOfHostNative = nativeParentNode(renderer, hostNative);\n nativeInsertBefore(\n renderer, parentOfHostNative !, commentNode, nativeNextSibling(renderer, hostNative));\n } else {\n appendChild(commentNode, hostTNode, hostView);\n }\n\n hostView[hostTNode.index] = lContainer =\n createLContainer(slotValue, hostTNode, hostView, commentNode, true);\n\n addToViewTree(hostView, hostTNode.index as number, lContainer);\n }\n\n return new R3ViewContainerRef(lContainer, hostTNode, hostView);\n}\n\n\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nexport function injectChangeDetectorRef(): ViewEngine_ChangeDetectorRef {\n return createViewRef(getPreviousOrParentTNode(), getLView(), null);\n}\n\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param hostTNode The node that is requesting a ChangeDetectorRef\n * @param hostView The view to which the node belongs\n * @param context The context for this change detector ref\n * @returns The ChangeDetectorRef to use\n */\nexport function createViewRef(\n hostTNode: TNode, hostView: LView, context: any): ViewEngine_ChangeDetectorRef {\n if (isComponent(hostTNode)) {\n const componentIndex = hostTNode.directiveStart;\n const componentView = getComponentViewByIndex(hostTNode.index, hostView);\n return new ViewRef(componentView, context, componentIndex);\n } else if (hostTNode.type === TNodeType.Element) {\n const hostComponentView = findComponentView(hostView);\n return new ViewRef(hostComponentView, hostComponentView[CONTEXT], -1);\n }\n return null !;\n}\n\nfunction getOrCreateRenderer2(view: LView): Renderer2 {\n const renderer = view[RENDERER];\n if (isProceduralRenderer(renderer)) {\n return renderer as Renderer2;\n } else {\n throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');\n }\n}\n\n/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */\nexport function injectRenderer2(): Renderer2 {\n return getOrCreateRenderer2(getLView());\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectElementRef as render3InjectElementRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](http://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nexport class ElementRef<T = any> {\n /**\n * The underlying native element or `null` if direct access to native elements is not supported\n * (e.g. when the application runs in a web worker).\n *\n * <div class=\"callout is-critical\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. Alternatively you can take a look at {@link\n * Renderer2}\n * which provides API that can safely be used even when direct access to native elements is not\n * supported.\n * </p>\n * <p>\n * Relying on direct DOM access creates tight coupling between your application and rendering\n * layers which will make it impossible to separate the two and deploy your application into a\n * web worker.\n * </p>\n * </div>\n *\n */\n public nativeElement: T;\n\n constructor(nativeElement: T) { this.nativeElement = nativeElement; }\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => ElementRef = () => SWITCH_ELEMENT_REF_FACTORY(ElementRef);\n}\n\nexport const SWITCH_ELEMENT_REF_FACTORY__POST_R3__ = render3InjectElementRef;\nconst SWITCH_ELEMENT_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_ELEMENT_REF_FACTORY: typeof render3InjectElementRef =\n SWITCH_ELEMENT_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {injectRenderer2 as render3InjectRenderer2} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\n\n/**\n * @deprecated Use `RendererType2` (and `Renderer2`) instead.\n * @publicApi\n */\nexport class RenderComponentType {\n constructor(\n public id: string, public templateUrl: string, public slotCount: number,\n public encapsulation: ViewEncapsulation, public styles: Array<string|any[]>,\n public animations: any) {}\n}\n\n/**\n * @deprecated Debug info is handled internally in the view engine now.\n */\nexport abstract class RenderDebugInfo {\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get source(): string;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n */\nexport interface DirectRenderer {\n remove(node: any): void;\n appendChild(node: any, parent: any): void;\n insertBefore(node: any, refNode: any): void;\n nextSibling(node: any): any;\n parentElement(node: any): any;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n * @publicApi\n */\nexport abstract class Renderer {\n abstract selectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo): any;\n\n abstract createElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo): any;\n\n abstract createViewRoot(hostElement: any): any;\n\n abstract createTemplateAnchor(parentElement: any, debugInfo?: RenderDebugInfo): any;\n\n abstract createText(parentElement: any, value: string, debugInfo?: RenderDebugInfo): any;\n\n abstract projectNodes(parentElement: any, nodes: any[]): void;\n\n abstract attachViewAfter(node: any, viewRootNodes: any[]): void;\n\n abstract detachView(viewRootNodes: any[]): void;\n\n abstract destroyView(hostElement: any, viewAllNodes: any[]): void;\n\n abstract listen(renderElement: any, name: string, callback: Function): Function;\n\n abstract listenGlobal(target: string, name: string, callback: Function): Function;\n\n abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void;\n\n abstract setElementAttribute(renderElement: any, attributeName: string, attributeValue?: string):\n void;\n\n /**\n * Used only in debug mode to serialize property changes to dom nodes as attributes.\n */\n abstract setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string):\n void;\n\n abstract setElementClass(renderElement: any, className: string, isAdd: boolean): void;\n\n abstract setElementStyle(renderElement: any, styleName: string, styleValue?: string): void;\n\n abstract invokeElementMethod(renderElement: any, methodName: string, args?: any[]): void;\n\n abstract setText(renderNode: any, text: string): void;\n\n abstract animate(\n element: any, startingStyles: any, keyframes: any[], duration: number, delay: number,\n easing: string, previousPlayers?: any[]): any;\n}\n\nexport const Renderer2Interceptor = new InjectionToken<Renderer2[]>('Renderer2Interceptor');\n\n/**\n * Injectable service that provides a low-level interface for modifying the UI.\n *\n * Use this service to bypass Angular's templating and make custom UI changes that can't be\n * expressed declaratively. For example if you need to set a property or an attribute whose name is\n * not statically known, use {@link Renderer#setElementProperty setElementProperty} or\n * {@link Renderer#setElementAttribute setElementAttribute} respectively.\n *\n * If you are implementing a custom renderer, you must implement this interface.\n *\n * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.\n *\n * @deprecated Use `RendererFactory2` instead.\n * @publicApi\n */\nexport abstract class RootRenderer {\n abstract renderComponent(componentType: RenderComponentType): Renderer;\n}\n\n/**\n * Used by `RendererFactory2` to associate custom rendering data and styles\n * with a rendering implementation.\n * @publicApi\n */\nexport interface RendererType2 {\n /**\n * A unique identifying string for the new renderer, used when creating\n * unique styles for encapsulation.\n */\n id: string;\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n encapsulation: ViewEncapsulation;\n /**\n * Defines CSS styles to be stored on a renderer instance.\n */\n styles: (string|any[])[];\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n data: {[kind: string]: any};\n}\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nexport abstract class RendererFactory2 {\n /**\n * Creates and initializes a custom renderer for a host DOM element.\n * @param hostElement The element to render.\n * @param type The base class to implement.\n * @returns The new custom renderer instance.\n */\n abstract createRenderer(hostElement: any, type: RendererType2|null): Renderer2;\n /**\n * A callback invoked when rendering has begun.\n */\n abstract begin?(): void;\n /**\n * A callback invoked when rendering has completed.\n */\n abstract end?(): void;\n /**\n * Use with animations test-only mode. Notifies the test when rendering has completed.\n * @returns The asynchronous result of the developer-defined function.\n */\n abstract whenRenderingDone?(): Promise<any>;\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nexport enum RendererStyleFlags2 {\n /**\n * Marks a style as important.\n */\n Important = 1 << 0,\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n DashCase = 1 << 1\n}\n\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nexport abstract class Renderer2 {\n /**\n * Use to store arbitrary developer-defined data on a renderer instance,\n * as an object containing key-value pairs.\n * This is useful for renderers that delegate to other renderers.\n */\n abstract get data(): {[key: string]: any};\n\n /**\n * Implement this callback to destroy the renderer or the host element.\n */\n abstract destroy(): void;\n /**\n * Implement this callback to create an instance of the host element.\n * @param name An identifying name for the new element, unique within the namespace.\n * @param namespace The namespace for the new element.\n * @returns The new element.\n */\n abstract createElement(name: string, namespace?: string|null): any;\n /**\n * Implement this callback to add a comment to the DOM of the host element.\n * @param value The comment text.\n * @returns The modified element.\n */\n abstract createComment(value: string): any;\n\n /**\n * Implement this callback to add text to the DOM of the host element.\n * @param value The text string.\n * @returns The modified element.\n */\n abstract createText(value: string): any;\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n // TODO(issue/24571): remove '!'.\n destroyNode !: ((node: any) => void) | null;\n /**\n * Appends a child to a given parent node in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child node.\n */\n abstract appendChild(parent: any, newChild: any): void;\n /**\n * Implement this callback to insert a child node at a given position in a parent node\n * in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child nodes.\n * @param refChild The existing child node that should precede the new node.\n */\n abstract insertBefore(parent: any, newChild: any, refChild: any): void;\n /**\n * Implement this callback to remove a child node from the host element's DOM.\n * @param parent The parent node.\n * @param oldChild The child node to remove.\n */\n abstract removeChild(parent: any, oldChild: any): void;\n /**\n * Implement this callback to prepare an element to be bootstrapped\n * as a root element, and return the element instance.\n * @param selectorOrNode The DOM element.\n * @param preserveContent Whether the contents of the root element\n * should be preserved, or cleared upon bootstrap (default behavior).\n * Use with `ViewEncapsulation.ShadowDom` to allow simple native\n * content projection via `<slot>` elements.\n * @returns The root element.\n */\n abstract selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any;\n /**\n * Implement this callback to get the parent of a given node\n * in the host element's DOM.\n * @param node The child node to query.\n * @returns The parent node, or null if there is no parent.\n * For WebWorkers, always returns true.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract parentNode(node: any): any;\n /**\n * Implement this callback to get the next sibling node of a given node\n * in the host element's DOM.\n * @returns The sibling node, or null if there is no sibling.\n * For WebWorkers, always returns a value.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract nextSibling(node: any): any;\n /**\n * Implement this callback to set an attribute value for an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param value The new value.\n * @param namespace The namespace.\n */\n abstract setAttribute(el: any, name: string, value: string, namespace?: string|null): void;\n\n /**\n * Implement this callback to remove an attribute from an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param namespace The namespace.\n */\n abstract removeAttribute(el: any, name: string, namespace?: string|null): void;\n /**\n * Implement this callback to add a class to an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract addClass(el: any, name: string): void;\n\n /**\n * Implement this callback to remove a class from an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract removeClass(el: any, name: string): void;\n\n /**\n * Implement this callback to set a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param value The new value.\n * @param flags Flags for style variations. No flags are set by default.\n */\n abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to remove the value from a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param flags Flags for style variations to remove, if set. ???\n */\n abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to set the value of a property of an element in the DOM.\n * @param el The element.\n * @param name The property name.\n * @param value The new value.\n */\n abstract setProperty(el: any, name: string, value: any): void;\n\n /**\n * Implement this callback to set the value of a node in the host element.\n * @param node The node.\n * @param value The new value.\n */\n abstract setValue(node: any, value: string): void;\n\n /**\n * Implement this callback to start an event listener.\n * @param target The context in which to listen for events. Can be\n * the entire window or document, the body of the document, or a specific\n * DOM element.\n * @param eventName The event to listen for.\n * @param callback A handler function to invoke when the event occurs.\n * @returns An \"unlisten\" function for disposing of this handler.\n */\n abstract listen(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => boolean | void): () => void;\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => Renderer2 = () => SWITCH_RENDERER2_FACTORY();\n}\n\n\nexport const SWITCH_RENDERER2_FACTORY__POST_R3__ = render3InjectRenderer2;\nconst SWITCH_RENDERER2_FACTORY__PRE_R3__ = noop;\nconst SWITCH_RENDERER2_FACTORY: typeof render3InjectRenderer2 = SWITCH_RENDERER2_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nexport abstract class Sanitizer {\n abstract sanitize(context: SecurityContext, value: {}|string|null): string|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n this.major = full.split('.')[0];\n this.minor = full.split('.')[1];\n this.patch = full.split('.').slice(2).join('.');\n }\n}\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('7.2.7');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef as ViewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {inject} from '../di/injector_compatibility';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef as viewEngine_ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {RendererFactory2} from '../render/api';\nimport {Sanitizer} from '../sanitization/security';\nimport {Type} from '../type';\nimport {VERSION} from '../version';\nimport {assertComponentType, assertDefined} from './assert';\nimport {LifecycleHooksFeature, createRootComponent, createRootComponentView, createRootContext} from './component';\nimport {getComponentDef} from './definition';\nimport {NodeInjector} from './di';\nimport {addToViewTree, createLView, createNodeAtIndex, createTView, createViewNode, elementCreate, locateHostElement, refreshDescendantViews} from './instructions';\nimport {ComponentDef, RenderFlags} from './interfaces/definition';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType} from './interfaces/node';\nimport {RElement, RendererFactory3, domRendererFactory3, isProceduralRenderer} from './interfaces/renderer';\nimport {HEADER_OFFSET, LView, LViewFlags, RootContext, TVIEW} from './interfaces/view';\nimport {enterView, leaveView} from './state';\nimport {defaultScheduler, getTNode} from './util';\nimport {createElementRef} from './view_engine_compatibility';\nimport {RootViewRef, ViewRef} from './view_ref';\n\nexport class ComponentFactoryResolver extends viewEngine_ComponentFactoryResolver {\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(private ngModule?: viewEngine_NgModuleRef<any>) { super(); }\n\n resolveComponentFactory<T>(component: Type<T>): viewEngine_ComponentFactory<T> {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component) !;\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\n\nfunction toRefArray(map: {[key: string]: string}): {propName: string; templateName: string;}[] {\n const array: {propName: string; templateName: string;}[] = [];\n for (let nonMinified in map) {\n if (map.hasOwnProperty(nonMinified)) {\n const minified = map[nonMinified];\n array.push({propName: minified, templateName: nonMinified});\n }\n }\n return array;\n}\n\n/**\n * Default {@link RootContext} for all components rendered with {@link renderComponent}.\n */\nexport const ROOT_CONTEXT = new InjectionToken<RootContext>(\n 'ROOT_CONTEXT_TOKEN',\n {providedIn: 'root', factory: () => createRootContext(inject(SCHEDULER))});\n\n/**\n * A change detection scheduler token for {@link RootContext}. This token is the default value used\n * for the default `RootContext` found in the {@link ROOT_CONTEXT} token.\n */\nexport const SCHEDULER = new InjectionToken<((fn: () => void) => void)>('SCHEDULER_TOKEN', {\n providedIn: 'root',\n factory: () => defaultScheduler,\n});\n\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nfunction createChainedInjector(rootViewInjector: Injector, moduleInjector: Injector): Injector {\n return {\n get: <T>(token: Type<T>| InjectionToken<T>, notFoundValue?: T): T => {\n const value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n\n return moduleInjector.get(token, notFoundValue);\n }\n };\n}\n\n/**\n * Render3 implementation of {@link viewEngine_ComponentFactory}.\n */\nexport class ComponentFactory<T> extends viewEngine_ComponentFactory<T> {\n selector: string;\n componentType: Type<any>;\n ngContentSelectors: string[];\n\n get inputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.inputs);\n }\n\n get outputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.outputs);\n }\n\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(\n private componentDef: ComponentDef<any>, private ngModule?: viewEngine_NgModuleRef<any>) {\n super();\n this.componentType = componentDef.type;\n this.selector = componentDef.selectors[0][0] as string;\n this.ngContentSelectors = [];\n }\n\n create(\n injector: Injector, projectableNodes?: any[][]|undefined, rootSelectorOrNode?: any,\n ngModule?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<T> {\n const isInternalRootView = rootSelectorOrNode === undefined;\n ngModule = ngModule || this.ngModule;\n\n const rootViewInjector =\n ngModule ? createChainedInjector(injector, ngModule.injector) : injector;\n\n const rendererFactory =\n rootViewInjector.get(RendererFactory2, domRendererFactory3) as RendererFactory3;\n const sanitizer = rootViewInjector.get(Sanitizer, null);\n\n const hostRNode = isInternalRootView ?\n elementCreate(this.selector, rendererFactory.createRenderer(null, this.componentDef)) :\n locateHostElement(rendererFactory, rootSelectorOrNode);\n\n const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :\n LViewFlags.CheckAlways | LViewFlags.IsRoot;\n const rootContext: RootContext =\n !isInternalRootView ? rootViewInjector.get(ROOT_CONTEXT) : createRootContext();\n\n const renderer = rendererFactory.createRenderer(hostRNode, this.componentDef);\n\n if (rootSelectorOrNode && hostRNode) {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n isProceduralRenderer(renderer) ?\n renderer.setAttribute(hostRNode, 'ng-version', VERSION.full) :\n hostRNode.setAttribute('ng-version', VERSION.full);\n }\n\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootLView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), rootContext, rootFlags,\n rendererFactory, renderer, sanitizer, rootViewInjector);\n\n // rootView is the parent when bootstrapping\n const oldLView = enterView(rootLView, null);\n\n let component: T;\n let tElementNode: TElementNode;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n\n const componentView = createRootComponentView(\n hostRNode, this.componentDef, rootLView, rendererFactory, renderer);\n\n tElementNode = getTNode(0, rootLView) as TElementNode;\n\n // Transform the arrays of native nodes into a structure that can be consumed by the\n // projection instruction. This is needed to support the reprojection of these nodes.\n if (projectableNodes) {\n let index = 0;\n const tView = rootLView[TVIEW];\n const projection: TNode[] = tElementNode.projection = [];\n for (let i = 0; i < projectableNodes.length; i++) {\n const nodeList = projectableNodes[i];\n let firstTNode: TNode|null = null;\n let previousTNode: TNode|null = null;\n for (let j = 0; j < nodeList.length; j++) {\n if (tView.firstTemplatePass) {\n // For dynamically created components such as ComponentRef, we create a new TView for\n // each insert. This is not ideal since we should be sharing the TViews.\n // Also the logic here should be shared with `component.ts`'s `renderComponent`\n // method.\n tView.expandoStartIndex++;\n tView.blueprint.splice(++index + HEADER_OFFSET, 0, null);\n tView.data.splice(index + HEADER_OFFSET, 0, null);\n rootLView.splice(index + HEADER_OFFSET, 0, null);\n }\n const tNode =\n createNodeAtIndex(index, TNodeType.Element, nodeList[j] as RElement, null, null);\n previousTNode ? (previousTNode.next = tNode) : (firstTNode = tNode);\n previousTNode = tNode;\n }\n projection.push(firstTNode !);\n }\n }\n\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and\n // executed here?\n // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n component = createRootComponent(\n componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);\n\n addToViewTree(rootLView, HEADER_OFFSET, componentView);\n refreshDescendantViews(rootLView);\n } finally {\n leaveView(oldLView);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n const componentRef = new ComponentRef(\n this.componentType, component,\n createElementRef(viewEngine_ElementRef, tElementNode, rootLView), rootLView, tElementNode);\n\n if (isInternalRootView) {\n // The host element of the internal root view is attached to the component's host view node\n componentRef.hostView._tViewNode !.child = tElementNode;\n }\n return componentRef;\n }\n}\n\nconst componentFactoryResolver: ComponentFactoryResolver = new ComponentFactoryResolver();\n\n/**\n * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the\n * ComponentFactoryResolver\n * already exists, retrieves the existing ComponentFactoryResolver.\n *\n * @returns The ComponentFactoryResolver instance to use\n */\nexport function injectComponentFactoryResolver(): viewEngine_ComponentFactoryResolver {\n return componentFactoryResolver;\n}\n\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nexport class ComponentRef<T> extends viewEngine_ComponentRef<T> {\n destroyCbs: (() => void)[]|null = [];\n instance: T;\n hostView: ViewRef<T>;\n changeDetectorRef: ViewEngine_ChangeDetectorRef;\n componentType: Type<T>;\n\n constructor(\n componentType: Type<T>, instance: T, public location: viewEngine_ElementRef,\n private _rootLView: LView,\n private _tNode: TElementNode|TContainerNode|TElementContainerNode) {\n super();\n this.instance = instance;\n this.hostView = this.changeDetectorRef = new RootViewRef<T>(_rootLView);\n this.hostView._tViewNode = createViewNode(-1, _rootLView);\n this.componentType = componentType;\n }\n\n get injector(): Injector { return new NodeInjector(this._tNode, this._rootLView); }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n this.hostView.destroy();\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.\n *\n * For more information on how to run and debug tests with either Ivy or View Engine (legacy),\n * please see [BAZEL.md](./docs/BAZEL.md).\n */\n\nlet _devMode: boolean = true;\nlet _runModeLocked: boolean = false;\n\n\n/**\n * Returns whether Angular is in development mode. After called once,\n * the value is locked and won't change any more.\n *\n * By default, this is true, unless a user calls `enableProdMode` before calling this.\n *\n * @publicApi\n */\nexport function isDevMode(): boolean {\n _runModeLocked = true;\n return _devMode;\n}\n\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * @publicApi\n */\nexport function enableProdMode(): void {\n if (_runModeLocked) {\n throw new Error('Cannot enable prod mode after platform setup.');\n }\n _devMode = false;\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we must use one of three strategies for doing this.\n * Support: Safari 10.x -> XHR strategy\n * Support: Firefox -> DomParser strategy\n * Default: InertDocument strategy\n */\nexport class InertBodyHelper {\n private inertBodyElement: HTMLElement;\n private inertDocument: Document;\n\n constructor(private defaultDoc: Document) {\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n this.inertBodyElement = this.inertDocument.body;\n\n if (this.inertBodyElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so\n // we need to create one.\n const inertHtml = this.inertDocument.createElement('html');\n this.inertDocument.appendChild(inertHtml);\n this.inertBodyElement = this.inertDocument.createElement('body');\n inertHtml.appendChild(this.inertBodyElement);\n }\n\n this.inertBodyElement.innerHTML = '<svg><g onload=\"this.parentNode.remove()\"></g></svg>';\n if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {\n // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element\n // so use the XHR strategy.\n this.getInertBodyElement = this.getInertBodyElement_XHR;\n return;\n }\n\n this.inertBodyElement.innerHTML =\n '<svg><p><style><img src=\"</style><img src=x onerror=alert(1)//\">';\n if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) {\n // We just hit the Firefox bug - which prevents the inner img JS from being sanitized\n // so use the DOMParser strategy, if it is available.\n // If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we\n // fall through to the default strategy below.\n if (isDOMParserAvailable()) {\n this.getInertBodyElement = this.getInertBodyElement_DOMParser;\n return;\n }\n }\n\n // None of the bugs were hit so it is safe for us to use the default InertDocument strategy\n this.getInertBodyElement = this.getInertBodyElement_InertDocument;\n }\n\n /**\n * Get an inert DOM element containing DOM created from the dirty HTML string provided.\n * The implementation of this is determined in the constructor, when the class is instantiated.\n */\n getInertBodyElement: (html: string) => HTMLElement | null;\n\n /**\n * Use XHR to create and fill an inert body element (on Safari 10.1)\n * See\n * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449\n */\n private getInertBodyElement_XHR(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n html = encodeURI(html);\n } catch {\n return null;\n }\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'document';\n xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);\n xhr.send(undefined);\n const body: HTMLBodyElement = xhr.response.body;\n body.removeChild(body.firstChild !);\n return body;\n }\n\n /**\n * Use DOMParser to create and fill an inert body element (on Firefox)\n * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7\n *\n */\n private getInertBodyElement_DOMParser(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n const body = new (window as any)\n .DOMParser()\n .parseFromString(html, 'text/html')\n .body as HTMLBodyElement;\n body.removeChild(body.firstChild !);\n return body;\n } catch {\n return null;\n }\n }\n\n /**\n * Use an HTML5 `template` element, if supported, or an inert body element created via\n * `createHtmlDocument` to create and fill an inert DOM element.\n * This is the default sane strategy to use if the browser does not require one of the specialised\n * strategies above.\n */\n private getInertBodyElement_InertDocument(html: string) {\n // Prefer using <template> element if supported.\n const templateEl = this.inertDocument.createElement('template');\n if ('content' in templateEl) {\n templateEl.innerHTML = html;\n return templateEl;\n }\n\n this.inertBodyElement.innerHTML = html;\n\n // Support: IE 9-11 only\n // strip custom-namespaced attributes on IE<=11\n if ((this.defaultDoc as any).documentMode) {\n this.stripCustomNsAttrs(this.inertBodyElement);\n }\n\n return this.inertBodyElement;\n }\n\n /**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.\n * 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n */\n private stripCustomNsAttrs(el: Element) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib !.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild as Node | null;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE) this.stripCustomNsAttrs(childNode as Element);\n childNode = childNode.nextSibling;\n }\n }\n}\n\n/**\n * We need to determine whether the DOMParser exists in the global context.\n * The try-catch is because, on some browsers, trying to access this property\n * on window can actually throw an error.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!(window as any).DOMParser;\n } catch {\n return false;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"http\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo<bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript:...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/* A pattern that matches safe srcset values */\nconst SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/** A pattern that matches safe data URLs. Only matches image, video and audio types. */\nconst DATA_URL_PATTERN =\n /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n\nexport function _sanitizeUrl(url: string): string {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) return url;\n\n if (isDevMode()) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see http://g.co/ng/security#xss)`);\n }\n\n return 'unsafe:' + url;\n}\n\nexport function sanitizeSrcset(srcset: string): string {\n srcset = String(srcset);\n return srcset.split(',').map((srcset) => _sanitizeUrl(srcset.trim())).join(', ');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\nimport {InertBodyHelper} from './inert_body';\nimport {_sanitizeUrl, sanitizeSrcset} from './url_sanitizer';\n\nfunction tagSet(tags: string): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\n\nfunction merge(...sets: {[k: string]: boolean}[]): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS =\n merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(\n OPTIONAL_END_TAG_BLOCK_ELEMENTS,\n tagSet(\n 'address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(\n OPTIONAL_END_TAG_INLINE_ELEMENTS,\n tagSet(\n 'a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\n\nexport const VALID_ELEMENTS =\n merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n\n// Attributes that have href and hence need to be sanitized\nexport const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n\n// Attributes that have special href set hence need to be sanitized\nexport const SRCSET_ATTRS = tagSet('srcset');\n\nconst HTML_ATTRS = tagSet(\n 'abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\n\nexport const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n public sanitizedSomething = false;\n private buf: string[] = [];\n\n sanitizeChildren(el: Element): string {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current: Node = el.firstChild !;\n let traverseContent = true;\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current as Element);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue !);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n current = current.firstChild !;\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current as Element);\n }\n\n let next = this.checkClobberedElement(current, current.nextSibling !);\n\n if (next) {\n current = next;\n break;\n }\n\n current = this.checkClobberedElement(current, current.parentNode !);\n }\n }\n return this.buf.join('');\n }\n\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n private startElement(element: Element): boolean {\n const tagName = element.nodeName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr !.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr !.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n\n private endElement(current: Element) {\n const tagName = current.nodeName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n\n private chars(chars: string) { this.buf.push(encodeEntities(chars)); }\n\n checkClobberedElement(node: Node, nextNode: Node): Node {\n if (nextNode &&\n (node.compareDocumentPosition(nextNode) &\n Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {\n throw new Error(\n `Failed to sanitize html because the element is clobbered: ${(node as Element).outerHTML}`);\n }\n return nextNode;\n }\n}\n\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value: string) {\n return value.replace(/&/g, '&')\n .replace(\n SURROGATE_PAIR_REGEXP,\n function(match: string) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(\n NON_ALPHANUMERIC_REGEXP,\n function(match: string) { return '&#' + match.charCodeAt(0) + ';'; })\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nlet inertBodyHelper: InertBodyHelper;\n\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nexport function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): string {\n let inertBodyElement: HTMLElement|null = null;\n try {\n inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement !.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(\n getTemplateContent(inertBodyElement !) as Element || inertBodyElement);\n if (isDevMode() && sanitizer.sanitizedSomething) {\n console.warn(\n 'WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss');\n }\n\n return safeHtml;\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }\n }\n}\n\nexport function getTemplateContent(el: Node): Node|null {\n return 'content' in (el as any /** Microsoft/TypeScript#21517 */) && isTemplateElement(el) ?\n el.content :\n null;\n}\nfunction isTemplateElement(el: Node): el is HTMLTemplateElement {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * `I18nMutateOpCode` defines OpCodes for `I18nMutateOpCodes` array.\n *\n * OpCodes contain three parts:\n * 1) Parent node index offset.\n * 2) Reference node index offset.\n * 3) The OpCode to execute.\n *\n * See: `I18nCreateOpCodes` for example of usage.\n */\nimport {SanitizerFn} from './sanitization';\n\nexport const enum I18nMutateOpCode {\n /// Stores shift amount for bits 17-3 that contain reference index.\n SHIFT_REF = 3,\n /// Stores shift amount for bits 31-17 that contain parent index.\n SHIFT_PARENT = 17,\n /// Mask for OpCode\n MASK_OPCODE = 0b111,\n /// Mask for reference index.\n MASK_REF = ((2 ^ 16) - 1) << SHIFT_REF,\n\n /// OpCode to select a node. (next OpCode will contain the operation.)\n Select = 0b000,\n /// OpCode to append the current node to `PARENT`.\n AppendChild = 0b001,\n /// OpCode to insert the current node to `PARENT` before `REF`.\n InsertBefore = 0b010,\n /// OpCode to remove the `REF` node from `PARENT`.\n Remove = 0b011,\n /// OpCode to set the attribute of a node.\n Attr = 0b100,\n /// OpCode to simulate elementEnd()\n ElementEnd = 0b101,\n /// OpCode to read the remove OpCodes for the nested ICU\n RemoveNestedIcu = 0b110,\n}\n\n/**\n * Marks that the next string is for element.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nexport const ELEMENT_MARKER: ELEMENT_MARKER = {\n marker: 'element'\n};\nexport interface ELEMENT_MARKER { marker: 'element'; }\n\n/**\n * Marks that the next string is for comment.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nexport const COMMENT_MARKER: COMMENT_MARKER = {\n marker: 'comment'\n};\n\nexport interface COMMENT_MARKER { marker: 'comment'; }\n\n/**\n * Array storing OpCode for dynamically creating `i18n` blocks.\n *\n * Example:\n * ```\n * <I18nCreateOpCode>[\n * // For adding text nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createTextNode('abc');\n * // lView[1].insertBefore(node, lView[2]);\n * 'abc', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createTextNode('xyz');\n * // lView[1].appendChild(node);\n * 'xyz', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For adding element nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createElement('div');\n * // lView[1].insertBefore(node, lView[2]);\n * ELEMENT_MARKER, 'div', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createElement('div');\n * // lView[1].appendChild(node);\n * ELEMENT_MARKER, 'div', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For adding comment nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createComment('');\n * // lView[1].insertBefore(node, lView[2]);\n * COMMENT_MARKER, '', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createComment('');\n * // lView[1].appendChild(node);\n * COMMENT_MARKER, '', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For moving existing nodes to a different location\n * // --------------------------------------------------\n * // Equivalent to:\n * // const node = lView[1];\n * // lView[2].insertBefore(node, lView[3]);\n * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | 3 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[1];\n * // lView[2].appendChild(node);\n * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | AppendChild,\n *\n * // For removing existing nodes\n * // --------------------------------------------------\n * // const node = lView[1];\n * // removeChild(tView.data(1), node, lView);\n * 1 << SHIFT_REF | Remove,\n *\n * // For writing attributes\n * // --------------------------------------------------\n * // const node = lView[1];\n * // node.setAttribute('attr', 'value');\n * 1 << SHIFT_REF | Select, 'attr', 'value'\n * // NOTE: Select followed by two string (vs select followed by OpCode)\n * ];\n * ```\n * NOTE:\n * - `index` is initial location where the extra nodes should be stored in the EXPANDO section of\n * `LVIewData`.\n *\n * See: `applyI18nCreateOpCodes`;\n */\nexport interface I18nMutateOpCodes extends Array<number|string|ELEMENT_MARKER|COMMENT_MARKER|null> {\n}\n\nexport const enum I18nUpdateOpCode {\n /// Stores shift amount for bits 17-2 that contain reference index.\n SHIFT_REF = 2,\n /// Stores shift amount for bits 31-17 that contain which ICU in i18n block are we referring to.\n SHIFT_ICU = 17,\n /// Mask for OpCode\n MASK_OPCODE = 0b11,\n /// Mask for reference index.\n MASK_REF = ((2 ^ 16) - 1) << SHIFT_REF,\n\n /// OpCode to update a text node.\n Text = 0b00,\n /// OpCode to update a attribute of a node.\n Attr = 0b01,\n /// OpCode to switch the current ICU case.\n IcuSwitch = 0b10,\n /// OpCode to update the current ICU case.\n IcuUpdate = 0b11,\n}\n\n/**\n * Stores DOM operations which need to be applied to update DOM render tree due to changes in\n * expressions.\n *\n * The basic idea is that `i18nExp` OpCodes capture expression changes and update a change\n * mask bit. (Bit 1 for expression 1, bit 2 for expression 2 etc..., bit 32 for expression 32 and\n * higher.) The OpCodes then compare its own change mask against the expression change mask to\n * determine if the OpCodes should execute.\n *\n * These OpCodes can be used by both the i18n block as well as ICU sub-block.\n *\n * ## Example\n *\n * Assume\n * ```\n * if (rf & RenderFlags.Update) {\n * i18nExp(bind(ctx.exp1)); // If changed set mask bit 1\n * i18nExp(bind(ctx.exp2)); // If changed set mask bit 2\n * i18nExp(bind(ctx.exp3)); // If changed set mask bit 3\n * i18nExp(bind(ctx.exp4)); // If changed set mask bit 4\n * i18nApply(0); // Apply all changes by executing the OpCodes.\n * }\n * ```\n * We can assume that each call to `i18nExp` sets an internal `changeMask` bit depending on the\n * index of `i18nExp`.\n *\n * OpCodes\n * ```\n * <I18nUpdateOpCodes>[\n * // The following OpCodes represent: `<div i18n-title=\"pre{{exp1}}in{{exp2}}post\">`\n * // If `changeMask & 0b11`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `7` values and start processing next OpCodes.\n * 0b11, 7,\n * // Concatenate `newValue = 'pre'+lView[bindIndex-4]+'in'+lView[bindIndex-3]+'post';`.\n * 'pre', -4, 'in', -3, 'post',\n * // Update attribute: `elementAttribute(1, 'title', sanitizerFn(newValue));`\n * 1 << SHIFT_REF | Attr, 'title', sanitizerFn,\n *\n * // The following OpCodes represent: `<div i18n>Hello {{exp3}}!\">`\n * // If `changeMask & 0b100`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `4` values and start processing next OpCodes.\n * 0b100, 4,\n * // Concatenate `newValue = 'Hello ' + lView[bindIndex -2] + '!';`.\n * 'Hello ', -2, '!',\n * // Update text: `lView[1].textContent = newValue;`\n * 1 << SHIFT_REF | Text,\n *\n * // The following OpCodes represent: `<div i18n>{exp4, plural, ... }\">`\n * // If `changeMask & 0b1000`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `4` values and start processing next OpCodes.\n * 0b1000, 4,\n * // Concatenate `newValue = lView[bindIndex -1];`.\n * -1,\n * // Switch ICU: `icuSwitchCase(lView[1], 0, newValue);`\n * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuSwitch,\n *\n * // Note `changeMask & -1` is always true, so the IcuUpdate will always execute.\n * -1, 1,\n * // Update ICU: `icuUpdateCase(lView[1], 0);`\n * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuUpdate,\n *\n * ];\n * ```\n *\n */\nexport interface I18nUpdateOpCodes extends Array<string|number|SanitizerFn|null> {}\n\n/**\n * Store information for the i18n translation block.\n */\nexport interface TI18n {\n /**\n * Number of slots to allocate in expando.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number;\n\n /**\n * Index in EXPANDO where the i18n stores its DOM nodes.\n *\n * When the bindings are processed by the `i18nEnd` instruction it is necessary to know where the\n * newly created DOM nodes will be inserted.\n */\n expandoStartIndex: number;\n\n /**\n * A set of OpCodes which will create the Text Nodes and ICU anchors for the translation blocks.\n *\n * NOTE: The ICU anchors are filled in with ICU Update OpCode.\n */\n create: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes which will be executed on each change detection to determine if any changes to\n * DOM are required.\n */\n update: I18nUpdateOpCodes;\n\n /**\n * A list of ICUs in a translation block (or `null` if block has no ICUs).\n *\n * Example:\n * Given: `<div i18n>You have {count, plural, ...} and {state, switch, ...}</div>`\n * There would be 2 ICUs in this array.\n * 1. `{count, plural, ...}`\n * 2. `{state, switch, ...}`\n */\n icus: TIcu[]|null;\n}\n\n/**\n * Defines the ICU type of `select` or `plural`\n */\nexport const enum IcuType {\n select = 0,\n plural = 1,\n}\n\nexport interface TIcu {\n /**\n * Defines the ICU type of `select` or `plural`\n */\n type: IcuType;\n\n /**\n * Number of slots to allocate in expando for each case.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number[];\n\n /**\n * An optional array of child/sub ICUs.\n *\n * In case of nested ICUs such as:\n * ```\n * {�0�, plural,\n * =0 {zero}\n * other {�0� {�1�, select,\n * cat {cats}\n * dog {dogs}\n * other {animals}\n * }!\n * }\n * }\n * ```\n * When the parent ICU is changing it must clean up child ICUs as well. For this reason it needs\n * to know which child ICUs to run clean up for as well.\n *\n * In the above example this would be:\n * ```\n * [\n * [], // `=0` has no sub ICUs\n * [1], // `other` has one subICU at `1`st index.\n * ]\n * ```\n *\n * The reason why it is Array of Arrays is because first array represents the case, and second\n * represents the child ICUs to clean up. There may be more than one child ICUs per case.\n */\n childIcus: number[][];\n\n /**\n * Index in EXPANDO where the i18n stores its DOM nodes.\n *\n * When the bindings are processed by the `i18nEnd` instruction it is necessary to know where the\n * newly created DOM nodes will be inserted.\n */\n expandoStartIndex: number;\n\n /**\n * A list of case values which the current ICU will try to match.\n *\n * The last value is `other`\n */\n cases: any[];\n\n /**\n * A set of OpCodes to apply in order to build up the DOM render tree for the ICU\n */\n create: I18nMutateOpCodes[];\n\n /**\n * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.\n */\n remove: I18nMutateOpCodes[];\n\n /**\n * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.\n */\n update: I18nUpdateOpCodes[];\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SRCSET_ATTRS, URI_ATTRS, VALID_ATTRS, VALID_ELEMENTS, getTemplateContent} from '../sanitization/html_sanitizer';\nimport {InertBodyHelper} from '../sanitization/inert_body';\nimport {_sanitizeUrl, sanitizeSrcset} from '../sanitization/url_sanitizer';\nimport {assertDefined, assertEqual, assertGreaterThan} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {allocExpando, createNodeAtIndex, elementAttribute, load, textBinding} from './instructions';\nimport {LContainer, NATIVE, RENDER_PARENT} from './interfaces/container';\nimport {COMMENT_MARKER, ELEMENT_MARKER, I18nMutateOpCode, I18nMutateOpCodes, I18nUpdateOpCode, I18nUpdateOpCodes, IcuType, TI18n, TIcu} from './interfaces/i18n';\nimport {TElementNode, TIcuContainerNode, TNode, TNodeType} from './interfaces/node';\nimport {RComment, RElement} from './interfaces/renderer';\nimport {SanitizerFn} from './interfaces/sanitization';\nimport {StylingContext} from './interfaces/styling';\nimport {BINDING_INDEX, HEADER_OFFSET, HOST_NODE, LView, RENDERER, TVIEW, TView} from './interfaces/view';\nimport {appendChild, createTextNode, removeChild} from './node_manipulation';\nimport {getIsParent, getLView, getPreviousOrParentTNode, setIsParent, setPreviousOrParentTNode} from './state';\nimport {NO_CHANGE} from './tokens';\nimport {addAllToArray, getNativeByIndex, getNativeByTNode, getTNode, isLContainer, stringify} from './util';\n\nconst MARKER = `�`;\nconst ICU_BLOCK_REGEX = /^\\s*(�\\d+:?\\d*�)\\s*,\\s*(select|plural)\\s*,/;\nconst SUBTEMPLATE_REGEXP = /�\\/?\\*(\\d+:\\d+)�/gi;\nconst PH_REGEXP = /�(\\/?[#*]\\d+):?\\d*�/gi;\nconst BINDING_REGEXP = /�(\\d+):?\\d*�/gi;\nconst ICU_REGEXP = /({\\s*�\\d+:?\\d*�\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\n\n// i18nPostproocess regexps\nconst PP_PLACEHOLDERS = /\\[(�.+?�?)\\]/g;\nconst PP_ICU_VARS = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICUS = /�I18N_EXP_(ICU(_\\d+)?)�/g;\n\ninterface IcuExpression {\n type: IcuType;\n mainBinding: number;\n cases: string[];\n values: (string|IcuExpression)[][];\n}\n\ninterface IcuCase {\n /**\n * Number of slots to allocate in expando for this case.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number;\n\n /**\n * An optional array of child/sub ICUs.\n */\n childIcus: number[];\n\n /**\n * A set of OpCodes to apply in order to build up the DOM render tree for the ICU\n */\n create: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.\n */\n remove: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.\n */\n update: I18nUpdateOpCodes;\n}\n\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression into\n * keys and cases.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n *\n */\nfunction extractParts(pattern: string): (string | IcuExpression)[] {\n if (!pattern) {\n return [];\n }\n\n let prevPos = 0;\n const braceStack = [];\n const results: (string | IcuExpression)[] = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n\n let match;\n while (match = braces.exec(pattern)) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEX.test(block)) {\n results.push(parseICUBlock(block));\n } else if (block) { // Don't push empty strings\n results.push(block);\n }\n\n prevPos = pos + 1;\n }\n } else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n\n const substring = pattern.substring(prevPos);\n if (substring != '') {\n results.push(substring);\n }\n\n return results;\n}\n\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern: string): IcuExpression {\n const cases = [];\n const values: (string | IcuExpression)[][] = [];\n let icuType = IcuType.plural;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEX, function(str: string, binding: string, type: string) {\n if (type === 'select') {\n icuType = IcuType.select;\n } else {\n icuType = IcuType.plural;\n }\n mainBinding = parseInt(binding.substr(1), 10);\n return '';\n });\n\n const parts = extractParts(pattern) as string[];\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === IcuType.plural) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n\n const blocks = extractParts(parts[pos++]) as string[];\n if (blocks.length) {\n values.push(blocks);\n }\n }\n\n assertGreaterThan(cases.indexOf('other'), -1, 'Missing key \"other\" in ICU statement.');\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return {type: icuType, mainBinding: mainBinding, cases, values};\n}\n\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message: string): string {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n } else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n\n ngDevMode &&\n assertEqual(\n inTemplate, false,\n `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n\n res += message.substr(index);\n return res;\n}\n\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A translated\n * message can span multiple templates.\n *\n * Example:\n * ```\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nexport function getTranslationForTemplate(message: string, subTemplateIndex?: number) {\n if (typeof subTemplateIndex !== 'number') {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n } else {\n // We want a specific sub-template\n const start =\n message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n */\nfunction generateBindingUpdateOpCodes(\n str: string, destinationNode: number, attrName?: string,\n sanitizeFn: SanitizerFn | null = null): I18nUpdateOpCodes {\n const updateOpCodes: I18nUpdateOpCodes = [null, null]; // Alloc space for mask and size\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n } else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n\n updateOpCodes.push(\n destinationNode << I18nUpdateOpCode.SHIFT_REF |\n (attrName ? I18nUpdateOpCode.Attr : I18nUpdateOpCode.Text));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[0] = mask;\n updateOpCodes[1] = updateOpCodes.length - 2;\n return updateOpCodes;\n}\n\nfunction getBindingMask(icuExpression: IcuExpression, mask = 0): number {\n mask = mask | toMaskBit(icuExpression.mainBinding);\n let match;\n for (let i = 0; i < icuExpression.values.length; i++) {\n const valueArr = icuExpression.values[i];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value === 'string') {\n while (match = BINDING_REGEXP.exec(value)) {\n mask = mask | toMaskBit(parseInt(match[1], 10));\n }\n } else {\n mask = getBindingMask(value as IcuExpression, mask);\n }\n }\n }\n return mask;\n}\n\nconst i18nIndexStack: number[] = [];\nlet i18nIndexStackPointer = -1;\n\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to have\n * more than 32 bindings this will be hit very rarely. The downside of hitting this corner case is\n * that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex: number): number {\n return 1 << Math.min(bindingIndex, 31);\n}\n\nconst parentIndexStack: number[] = [];\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param message The translation message.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n */\nexport function i18nStart(index: number, message: string, subTemplateIndex?: number): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n i18nIndexStack[++i18nIndexStackPointer] = index;\n if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {\n i18nStartFirstPass(tView, index, message, subTemplateIndex);\n }\n}\n\n/**\n * See `i18nStart` above.\n */\nfunction i18nStartFirstPass(\n tView: TView, index: number, message: string, subTemplateIndex?: number) {\n const viewData = getLView();\n const expandoStartIndex = tView.blueprint.length - HEADER_OFFSET;\n const previousOrParentTNode = getPreviousOrParentTNode();\n const parentTNode = getIsParent() ? getPreviousOrParentTNode() :\n previousOrParentTNode && previousOrParentTNode.parent;\n let parentIndex = parentTNode && parentTNode !== viewData[HOST_NODE] ?\n parentTNode.index - HEADER_OFFSET :\n index;\n let parentIndexPointer = 0;\n parentIndexStack[parentIndexPointer] = parentIndex;\n const createOpCodes: I18nMutateOpCodes = [];\n // If the previous node wasn't the direct parent then we have a translation without top level\n // element and we need to keep a reference of the previous element if there is one\n if (index > 0 && previousOrParentTNode !== parentTNode) {\n // Create an OpCode to select the previous TNode\n createOpCodes.push(\n previousOrParentTNode.index << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Select);\n }\n const updateOpCodes: I18nUpdateOpCodes = [];\n const icuExpressions: TIcu[] = [];\n\n const templateTranslation = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = templateTranslation.split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if (i & 1) {\n // Odd indexes are placeholders (elements and sub-templates)\n if (value.charAt(0) === '/') {\n // It is a closing tag\n if (value.charAt(1) === '#') {\n const phIndex = parseInt(value.substr(2), 10);\n parentIndex = parentIndexStack[--parentIndexPointer];\n createOpCodes.push(phIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.ElementEnd);\n }\n } else {\n const phIndex = parseInt(value.substr(1), 10);\n // The value represents a placeholder that we move to the designated index\n createOpCodes.push(\n phIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Select,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n if (value.charAt(0) === '#') {\n parentIndexStack[++parentIndexPointer] = parentIndex = phIndex;\n }\n }\n } else {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = value.split(ICU_REGEXP);\n for (let j = 0; j < parts.length; j++) {\n value = parts[j];\n\n if (j & 1) {\n // Odd indexes are ICU expressions\n // Create the comment node that will anchor the ICU expression\n allocExpando(viewData);\n const icuNodeIndex = tView.blueprint.length - 1 - HEADER_OFFSET;\n createOpCodes.push(\n COMMENT_MARKER, ngDevMode ? `ICU ${icuNodeIndex}` : '',\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n // Update codes for the ICU expression\n const icuExpression = parseICUBlock(value.substr(1, value.length - 2));\n const mask = getBindingMask(icuExpression);\n icuStart(icuExpressions, icuExpression, icuNodeIndex, icuNodeIndex);\n // Since this is recursive, the last TIcu that was pushed is the one we want\n const tIcuIndex = icuExpressions.length - 1;\n updateOpCodes.push(\n toMaskBit(icuExpression.mainBinding), // mask of the main binding\n 3, // skip 3 opCodes if not changed\n -1 - icuExpression.mainBinding,\n icuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuSwitch, tIcuIndex,\n mask, // mask of all the bindings of this ICU expression\n 2, // skip 2 opCodes if not changed\n icuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuUpdate, tIcuIndex);\n } else if (value !== '') {\n // Even indexes are text (including bindings)\n const hasBinding = value.match(BINDING_REGEXP);\n // Create text nodes\n allocExpando(viewData);\n createOpCodes.push(\n // If there is a binding, the value will be set during update\n hasBinding ? '' : value,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n if (hasBinding) {\n addAllToArray(\n generateBindingUpdateOpCodes(value, tView.blueprint.length - 1 - HEADER_OFFSET),\n updateOpCodes);\n }\n }\n }\n }\n }\n\n // NOTE: local var needed to properly assert the type of `TI18n`.\n const tI18n: TI18n = {\n vars: tView.blueprint.length - HEADER_OFFSET - expandoStartIndex,\n expandoStartIndex,\n create: createOpCodes,\n update: updateOpCodes,\n icus: icuExpressions.length ? icuExpressions : null,\n };\n tView.data[index + HEADER_OFFSET] = tI18n;\n}\n\nfunction appendI18nNode(tNode: TNode, parentTNode: TNode, previousTNode: TNode | null): TNode {\n ngDevMode && ngDevMode.rendererMoveNode++;\n const viewData = getLView();\n if (!previousTNode) {\n previousTNode = parentTNode;\n }\n // re-organize node tree to put this node in the correct position.\n if (previousTNode === parentTNode && tNode !== parentTNode.child) {\n tNode.next = parentTNode.child;\n parentTNode.child = tNode;\n } else if (previousTNode !== parentTNode && tNode !== previousTNode.next) {\n tNode.next = previousTNode.next;\n previousTNode.next = tNode;\n } else {\n tNode.next = null;\n }\n\n if (parentTNode !== viewData[HOST_NODE]) {\n tNode.parent = parentTNode as TElementNode;\n }\n\n appendChild(getNativeByTNode(tNode, viewData), tNode, viewData);\n\n const slotValue = viewData[tNode.index];\n if (tNode.type !== TNodeType.Container && isLContainer(slotValue)) {\n // Nodes that inject ViewContainerRef also have a comment node that should be moved\n appendChild(slotValue[NATIVE], tNode, viewData);\n }\n return tNode;\n}\n\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @publicAPI\n */\nexport function i18nPostprocess(\n message: string, replacements: {[key: string]: (string | string[])}): string {\n //\n // Step 1: resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n //\n const matches: {[key: string]: string[]} = {};\n let result = message.replace(PP_PLACEHOLDERS, (_match, content: string): string => {\n if (!matches[content]) {\n matches[content] = content.split('|');\n }\n if (!matches[content].length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n return matches[content].shift() !;\n });\n\n // verify that we injected all values\n const hasUnmatchedValues = Object.keys(matches).some(key => !!matches[key].length);\n if (hasUnmatchedValues) {\n throw new Error(`i18n postprocess: unmatched values - ${JSON.stringify(matches)}`);\n }\n\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n\n //\n // Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n //\n result = result.replace(PP_ICU_VARS, (match, start, key, _type, _idx, end): string => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n\n //\n // Step 3: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n // in case multiple ICUs have the same placeholder name\n //\n result = result.replace(PP_ICUS, (match, key): string => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key] as string[];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift() !;\n }\n return match;\n });\n\n return result;\n}\n\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n */\nexport function i18nEnd(): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n i18nEndFirstPass(tView);\n}\n\n/**\n * See `i18nEnd` above.\n */\nfunction i18nEndFirstPass(tView: TView) {\n const viewData = getLView();\n ngDevMode && assertEqual(\n viewData[BINDING_INDEX], viewData[TVIEW].bindingStartIndex,\n 'i18nEnd should be called before any binding');\n\n const rootIndex = i18nIndexStack[i18nIndexStackPointer--];\n const tI18n = tView.data[rootIndex + HEADER_OFFSET] as TI18n;\n ngDevMode && assertDefined(tI18n, `You should call i18nStart before i18nEnd`);\n\n // The last placeholder that was added before `i18nEnd`\n const previousOrParentTNode = getPreviousOrParentTNode();\n const visitedPlaceholders =\n readCreateOpCodes(rootIndex, tI18n.create, tI18n.expandoStartIndex, viewData);\n\n // Remove deleted placeholders\n // The last placeholder that was added before `i18nEnd` is `previousOrParentTNode`\n for (let i = rootIndex + 1; i <= previousOrParentTNode.index - HEADER_OFFSET; i++) {\n if (visitedPlaceholders.indexOf(i) === -1) {\n removeNode(i, viewData);\n }\n }\n}\n\nfunction readCreateOpCodes(\n index: number, createOpCodes: I18nMutateOpCodes, expandoStartIndex: number,\n viewData: LView): number[] {\n const renderer = getLView()[RENDERER];\n let currentTNode: TNode|null = null;\n let previousTNode: TNode|null = null;\n const visitedPlaceholders: number[] = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i];\n if (typeof opCode == 'string') {\n const textRNode = createTextNode(opCode, renderer);\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n previousTNode = currentTNode;\n currentTNode =\n createNodeAtIndex(expandoStartIndex++, TNodeType.Element, textRNode, null, null);\n setIsParent(false);\n } else if (typeof opCode == 'number') {\n switch (opCode & I18nMutateOpCode.MASK_OPCODE) {\n case I18nMutateOpCode.AppendChild:\n const destinationNodeIndex = opCode >>> I18nMutateOpCode.SHIFT_PARENT;\n let destinationTNode: TNode;\n if (destinationNodeIndex === index) {\n // If the destination node is `i18nStart`, we don't have a\n // top-level node and we should use the host node instead\n destinationTNode = viewData[HOST_NODE] !;\n } else {\n destinationTNode = getTNode(destinationNodeIndex, viewData);\n }\n ngDevMode &&\n assertDefined(\n currentTNode !,\n `You need to create or select a node before you can insert it into the DOM`);\n previousTNode = appendI18nNode(currentTNode !, destinationTNode, previousTNode);\n destinationTNode.next = null;\n break;\n case I18nMutateOpCode.Select:\n const nodeIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n visitedPlaceholders.push(nodeIndex);\n previousTNode = currentTNode;\n currentTNode = getTNode(nodeIndex, viewData);\n if (currentTNode) {\n setPreviousOrParentTNode(currentTNode);\n if (currentTNode.type === TNodeType.Element) {\n setIsParent(true);\n }\n }\n break;\n case I18nMutateOpCode.ElementEnd:\n const elementIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n previousTNode = currentTNode = getTNode(elementIndex, viewData);\n setPreviousOrParentTNode(currentTNode);\n setIsParent(false);\n break;\n case I18nMutateOpCode.Attr:\n const elementNodeIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n const attrName = createOpCodes[++i] as string;\n const attrValue = createOpCodes[++i] as string;\n elementAttribute(elementNodeIndex, attrName, attrValue);\n break;\n default:\n throw new Error(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n } else {\n switch (opCode) {\n case COMMENT_MARKER:\n const commentValue = createOpCodes[++i] as string;\n ngDevMode && assertEqual(\n typeof commentValue, 'string',\n `Expected \"${commentValue}\" to be a comment node value`);\n const commentRNode = renderer.createComment(commentValue);\n ngDevMode && ngDevMode.rendererCreateComment++;\n previousTNode = currentTNode;\n currentTNode = createNodeAtIndex(\n expandoStartIndex++, TNodeType.IcuContainer, commentRNode, null, null);\n attachPatchData(commentRNode, viewData);\n (currentTNode as TIcuContainerNode).activeCaseIndex = null;\n // We will add the case nodes later, during the update phase\n setIsParent(false);\n break;\n case ELEMENT_MARKER:\n const tagNameValue = createOpCodes[++i] as string;\n ngDevMode && assertEqual(\n typeof tagNameValue, 'string',\n `Expected \"${tagNameValue}\" to be an element node tag name`);\n const elementRNode = renderer.createElement(tagNameValue);\n ngDevMode && ngDevMode.rendererCreateElement++;\n previousTNode = currentTNode;\n currentTNode = createNodeAtIndex(\n expandoStartIndex++, TNodeType.Element, elementRNode, tagNameValue, null);\n break;\n default:\n throw new Error(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n\n setIsParent(false);\n\n return visitedPlaceholders;\n}\n\nfunction readUpdateOpCodes(\n updateOpCodes: I18nUpdateOpCodes, icus: TIcu[] | null, bindingsStartIndex: number,\n changeMask: number, viewData: LView, bypassCheckBit = false) {\n let caseCreated = false;\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i] as number;\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i] as number;\n if (bypassCheckBit || (checkBit & changeMask)) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= (i + skipCodes); j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n } else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // It's a binding index whose value is negative\n value += stringify(viewData[bindingsStartIndex - opCode]);\n } else {\n const nodeIndex = opCode >>> I18nUpdateOpCode.SHIFT_REF;\n let tIcuIndex: number;\n let tIcu: TIcu;\n let icuTNode: TIcuContainerNode;\n switch (opCode & I18nUpdateOpCode.MASK_OPCODE) {\n case I18nUpdateOpCode.Attr:\n const attrName = updateOpCodes[++j] as string;\n const sanitizeFn = updateOpCodes[++j] as SanitizerFn | null;\n elementAttribute(nodeIndex, attrName, value, sanitizeFn);\n break;\n case I18nUpdateOpCode.Text:\n textBinding(nodeIndex, value);\n break;\n case I18nUpdateOpCode.IcuSwitch:\n tIcuIndex = updateOpCodes[++j] as number;\n tIcu = icus ![tIcuIndex];\n icuTNode = getTNode(nodeIndex, viewData) as TIcuContainerNode;\n // If there is an active case, delete the old nodes\n if (icuTNode.activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[icuTNode.activeCaseIndex];\n for (let k = 0; k < removeCodes.length; k++) {\n const removeOpCode = removeCodes[k] as number;\n switch (removeOpCode & I18nMutateOpCode.MASK_OPCODE) {\n case I18nMutateOpCode.Remove:\n const nodeIndex = removeOpCode >>> I18nMutateOpCode.SHIFT_REF;\n removeNode(nodeIndex, viewData);\n break;\n case I18nMutateOpCode.RemoveNestedIcu:\n const nestedIcuNodeIndex =\n removeCodes[k + 1] as number >>> I18nMutateOpCode.SHIFT_REF;\n const nestedIcuTNode =\n getTNode(nestedIcuNodeIndex, viewData) as TIcuContainerNode;\n const activeIndex = nestedIcuTNode.activeCaseIndex;\n if (activeIndex !== null) {\n const nestedIcuTIndex = removeOpCode >>> I18nMutateOpCode.SHIFT_REF;\n const nestedTIcu = icus ![nestedIcuTIndex];\n addAllToArray(nestedTIcu.remove[activeIndex], removeCodes);\n }\n break;\n }\n }\n }\n\n // Update the active caseIndex\n const caseIndex = getCaseIndex(tIcu, value);\n icuTNode.activeCaseIndex = caseIndex !== -1 ? caseIndex : null;\n\n // Add the nodes for the new case\n readCreateOpCodes(-1, tIcu.create[caseIndex], tIcu.expandoStartIndex, viewData);\n caseCreated = true;\n break;\n case I18nUpdateOpCode.IcuUpdate:\n tIcuIndex = updateOpCodes[++j] as number;\n tIcu = icus ![tIcuIndex];\n icuTNode = getTNode(nodeIndex, viewData) as TIcuContainerNode;\n readUpdateOpCodes(\n tIcu.update[icuTNode.activeCaseIndex !], icus, bindingsStartIndex, changeMask,\n viewData, caseCreated);\n break;\n }\n }\n }\n }\n }\n i += skipCodes;\n }\n}\n\nfunction removeNode(index: number, viewData: LView) {\n const removedPhTNode = getTNode(index, viewData);\n const removedPhRNode = getNativeByIndex(index, viewData);\n removeChild(removedPhTNode, removedPhRNode || null, viewData);\n removedPhTNode.detached = true;\n ngDevMode && ngDevMode.rendererRemoveNode++;\n\n const slotValue = load(index) as RElement | RComment | LContainer | StylingContext;\n if (isLContainer(slotValue)) {\n const lContainer = slotValue as LContainer;\n if (removedPhTNode.type !== TNodeType.Container) {\n removeChild(removedPhTNode, lContainer[NATIVE] || null, viewData);\n }\n lContainer[RENDER_PARENT] = null;\n }\n}\n\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param message The translation message.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n */\nexport function i18n(index: number, message: string, subTemplateIndex?: number): void {\n i18nStart(index, message, subTemplateIndex);\n i18nEnd();\n}\n\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n */\nexport function i18nAttributes(index: number, values: string[]): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n ngDevMode &&\n assertEqual(\n tView.firstTemplatePass, true, `You should only call i18nEnd on first template pass`);\n if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {\n i18nAttributesFirstPass(tView, index, values);\n }\n}\n\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView: TView, index: number, values: string[]) {\n const previousElement = getPreviousOrParentTNode();\n const previousElementIndex = previousElement.index - HEADER_OFFSET;\n const updateOpCodes: I18nUpdateOpCodes = [];\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n const parts = message.split(ICU_REGEXP);\n for (let j = 0; j < parts.length; j++) {\n const value = parts[j];\n\n if (j & 1) {\n // Odd indexes are ICU expressions\n // TODO(ocombe): support ICU expressions in attributes\n } else if (value !== '') {\n // Even indexes are text (including bindings)\n const hasBinding = !!value.match(BINDING_REGEXP);\n if (hasBinding) {\n addAllToArray(\n generateBindingUpdateOpCodes(value, previousElementIndex, attrName), updateOpCodes);\n } else {\n elementAttribute(previousElementIndex, attrName, value);\n }\n }\n }\n }\n\n tView.data[index + HEADER_OFFSET] = updateOpCodes;\n}\n\nlet changeMask = 0b0;\nlet shiftsCounter = 0;\n\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param expression The binding's new value or NO_CHANGE\n */\nexport function i18nExp<T>(expression: T | NO_CHANGE): void {\n if (expression !== NO_CHANGE) {\n changeMask = changeMask | (1 << shiftsCounter);\n }\n shiftsCounter++;\n}\n\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n */\nexport function i18nApply(index: number) {\n if (shiftsCounter) {\n const lView = getLView();\n const tView = lView[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index + HEADER_OFFSET];\n let updateOpCodes: I18nUpdateOpCodes;\n let icus: TIcu[]|null = null;\n if (Array.isArray(tI18n)) {\n updateOpCodes = tI18n as I18nUpdateOpCodes;\n } else {\n updateOpCodes = (tI18n as TI18n).update;\n icus = (tI18n as TI18n).icus;\n }\n const bindingsStartIndex = lView[BINDING_INDEX] - shiftsCounter - 1;\n readUpdateOpCodes(updateOpCodes, icus, bindingsStartIndex, changeMask, lView);\n\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n shiftsCounter = 0;\n }\n}\n\nenum Plural {\n Zero = 0,\n One = 1,\n Two = 2,\n Few = 3,\n Many = 4,\n Other = 5,\n}\n\n/**\n * Returns the plural case based on the locale.\n * This is a copy of the deprecated function that we used in Angular v4.\n * // TODO(ocombe): remove this once we can the real getPluralCase function\n *\n * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts\n */\nfunction getPluralCase(locale: string, nLike: number | string): Plural {\n if (typeof nLike === 'string') {\n nLike = parseInt(<string>nLike, 10);\n }\n const n: number = nLike as number;\n const nDecimal = n.toString().replace(/^[^.]*\\.?/, '');\n const i = Math.floor(Math.abs(n));\n const v = nDecimal.length;\n const f = parseInt(nDecimal, 10);\n const t = parseInt(n.toString().replace(/^[^.]*\\.?|0+$/g, ''), 10) || 0;\n\n const lang = locale.split('-')[0].toLowerCase();\n\n switch (lang) {\n case 'af':\n case 'asa':\n case 'az':\n case 'bem':\n case 'bez':\n case 'bg':\n case 'brx':\n case 'ce':\n case 'cgg':\n case 'chr':\n case 'ckb':\n case 'ee':\n case 'el':\n case 'eo':\n case 'es':\n case 'eu':\n case 'fo':\n case 'fur':\n case 'gsw':\n case 'ha':\n case 'haw':\n case 'hu':\n case 'jgo':\n case 'jmc':\n case 'ka':\n case 'kk':\n case 'kkj':\n case 'kl':\n case 'ks':\n case 'ksb':\n case 'ky':\n case 'lb':\n case 'lg':\n case 'mas':\n case 'mgo':\n case 'ml':\n case 'mn':\n case 'nb':\n case 'nd':\n case 'ne':\n case 'nn':\n case 'nnh':\n case 'nyn':\n case 'om':\n case 'or':\n case 'os':\n case 'ps':\n case 'rm':\n case 'rof':\n case 'rwk':\n case 'saq':\n case 'seh':\n case 'sn':\n case 'so':\n case 'sq':\n case 'ta':\n case 'te':\n case 'teo':\n case 'tk':\n case 'tr':\n case 'ug':\n case 'uz':\n case 'vo':\n case 'vun':\n case 'wae':\n case 'xog':\n if (n === 1) return Plural.One;\n return Plural.Other;\n case 'ak':\n case 'ln':\n case 'mg':\n case 'pa':\n case 'ti':\n if (n === Math.floor(n) && n >= 0 && n <= 1) return Plural.One;\n return Plural.Other;\n case 'am':\n case 'as':\n case 'bn':\n case 'fa':\n case 'gu':\n case 'hi':\n case 'kn':\n case 'mr':\n case 'zu':\n if (i === 0 || n === 1) return Plural.One;\n return Plural.Other;\n case 'ar':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10) return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99) return Plural.Many;\n return Plural.Other;\n case 'ast':\n case 'ca':\n case 'de':\n case 'en':\n case 'et':\n case 'fi':\n case 'fy':\n case 'gl':\n case 'it':\n case 'nl':\n case 'sv':\n case 'sw':\n case 'ur':\n case 'yi':\n if (i === 1 && v === 0) return Plural.One;\n return Plural.Other;\n case 'be':\n if (n % 10 === 1 && !(n % 100 === 11)) return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&\n !(n % 100 >= 12 && n % 100 <= 14))\n return Plural.Few;\n if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||\n n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'br':\n if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91)) return Plural.One;\n if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92)) return Plural.Two;\n if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&\n !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||\n n % 100 >= 90 && n % 100 <= 99))\n return Plural.Few;\n if (!(n === 0) && n % 1e6 === 0) return Plural.Many;\n return Plural.Other;\n case 'bs':\n case 'hr':\n case 'sr':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14) ||\n f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&\n !(f % 100 >= 12 && f % 100 <= 14))\n return Plural.Few;\n return Plural.Other;\n case 'cs':\n case 'sk':\n if (i === 1 && v === 0) return Plural.One;\n if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0) return Plural.Few;\n if (!(v === 0)) return Plural.Many;\n return Plural.Other;\n case 'cy':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n === 3) return Plural.Few;\n if (n === 6) return Plural.Many;\n return Plural.Other;\n case 'da':\n if (n === 1 || !(t === 0) && (i === 0 || i === 1)) return Plural.One;\n return Plural.Other;\n case 'dsb':\n case 'hsb':\n if (v === 0 && i % 100 === 1 || f % 100 === 1) return Plural.One;\n if (v === 0 && i % 100 === 2 || f % 100 === 2) return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||\n f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)\n return Plural.Few;\n return Plural.Other;\n case 'ff':\n case 'fr':\n case 'hy':\n case 'kab':\n if (i === 0 || i === 1) return Plural.One;\n return Plural.Other;\n case 'fil':\n if (v === 0 && (i === 1 || i === 2 || i === 3) ||\n v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||\n !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))\n return Plural.One;\n return Plural.Other;\n case 'ga':\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n === Math.floor(n) && n >= 3 && n <= 6) return Plural.Few;\n if (n === Math.floor(n) && n >= 7 && n <= 10) return Plural.Many;\n return Plural.Other;\n case 'gd':\n if (n === 1 || n === 11) return Plural.One;\n if (n === 2 || n === 12) return Plural.Two;\n if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19)) return Plural.Few;\n return Plural.Other;\n case 'gv':\n if (v === 0 && i % 10 === 1) return Plural.One;\n if (v === 0 && i % 10 === 2) return Plural.Two;\n if (v === 0 &&\n (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))\n return Plural.Few;\n if (!(v === 0)) return Plural.Many;\n return Plural.Other;\n case 'he':\n if (i === 1 && v === 0) return Plural.One;\n if (i === 2 && v === 0) return Plural.Two;\n if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0) return Plural.Many;\n return Plural.Other;\n case 'is':\n if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0)) return Plural.One;\n return Plural.Other;\n case 'ksh':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n return Plural.Other;\n case 'kw':\n case 'naq':\n case 'se':\n case 'smn':\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n return Plural.Other;\n case 'lag':\n if (n === 0) return Plural.Zero;\n if ((i === 0 || i === 1) && !(n === 0)) return Plural.One;\n return Plural.Other;\n case 'lt':\n if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19)) return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&\n !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.Few;\n if (!(f === 0)) return Plural.Many;\n return Plural.Other;\n case 'lv':\n case 'prg':\n if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||\n v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)\n return Plural.Zero;\n if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||\n !(v === 2) && f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mk':\n if (v === 0 && i % 10 === 1 || f % 10 === 1) return Plural.One;\n return Plural.Other;\n case 'mt':\n if (n === 1) return Plural.One;\n if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19) return Plural.Many;\n return Plural.Other;\n case 'pl':\n if (i === 1 && v === 0) return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'pt':\n if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2)) return Plural.One;\n return Plural.Other;\n case 'ro':\n if (i === 1 && v === 0) return Plural.One;\n if (!(v === 0) || n === 0 ||\n !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)\n return Plural.Few;\n return Plural.Other;\n case 'ru':\n case 'uk':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11)) return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && i % 10 === 0 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'shi':\n if (i === 0 || n === 1) return Plural.One;\n if (n === Math.floor(n) && n >= 2 && n <= 10) return Plural.Few;\n return Plural.Other;\n case 'si':\n if (n === 0 || n === 1 || i === 0 && f === 1) return Plural.One;\n return Plural.Other;\n case 'sl':\n if (v === 0 && i % 100 === 1) return Plural.One;\n if (v === 0 && i % 100 === 2) return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))\n return Plural.Few;\n return Plural.Other;\n case 'tzm':\n if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)\n return Plural.One;\n return Plural.Other;\n // When there is no specification, the default is always \"other\"\n // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules\n // > other (requiredâgeneral plural form â also used if the language only has a single form)\n default:\n return Plural.Other;\n }\n}\n\nfunction getPluralCategory(value: any, locale: string): string {\n const plural = getPluralCase(locale, value);\n\n switch (plural) {\n case Plural.Zero:\n return 'zero';\n case Plural.One:\n return 'one';\n case Plural.Two:\n return 'two';\n case Plural.Few:\n return 'few';\n case Plural.Many:\n return 'many';\n default:\n return 'other';\n }\n}\n\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression: TIcu, bindingValue: string): number {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case IcuType.plural: {\n // TODO(ocombe): replace this hard-coded value by the real LOCALE_ID value\n const locale = 'en-US';\n const resolvedCase = getPluralCategory(bindingValue, locale);\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case IcuType.select: {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index;\n}\n\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param tIcus\n * @param icuExpression\n * @param startIndex\n * @param expandoStartIndex\n */\nfunction icuStart(\n tIcus: TIcu[], icuExpression: IcuExpression, startIndex: number,\n expandoStartIndex: number): void {\n const createCodes = [];\n const removeCodes = [];\n const updateCodes = [];\n const vars = [];\n const childIcus: number[][] = [];\n for (let i = 0; i < icuExpression.values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = icuExpression.values[i];\n const nestedIcus: IcuExpression[] = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value as IcuExpression) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--�${icuIndex}�-->`;\n }\n }\n const icuCase: IcuCase =\n parseIcuCase(valueArr.join(''), startIndex, nestedIcus, tIcus, expandoStartIndex);\n createCodes.push(icuCase.create);\n removeCodes.push(icuCase.remove);\n updateCodes.push(icuCase.update);\n vars.push(icuCase.vars);\n childIcus.push(icuCase.childIcus);\n }\n const tIcu: TIcu = {\n type: icuExpression.type,\n vars,\n expandoStartIndex: expandoStartIndex + 1, childIcus,\n cases: icuExpression.cases,\n create: createCodes,\n remove: removeCodes,\n update: updateCodes\n };\n tIcus.push(tIcu);\n const lView = getLView();\n const worstCaseSize = Math.max(...vars);\n for (let i = 0; i < worstCaseSize; i++) {\n allocExpando(lView);\n }\n}\n\n/**\n * Transforms a string template into an HTML template and a list of instructions used to update\n * attributes or nodes that contain bindings.\n *\n * @param unsafeHtml The string to parse\n * @param parentIndex\n * @param nestedIcus\n * @param tIcus\n * @param expandoStartIndex\n */\nfunction parseIcuCase(\n unsafeHtml: string, parentIndex: number, nestedIcus: IcuExpression[], tIcus: TIcu[],\n expandoStartIndex: number): IcuCase {\n const inertBodyHelper = new InertBodyHelper(document);\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n if (!inertBodyElement) {\n throw new Error('Unable to generate inert body element');\n }\n const wrapper = getTemplateContent(inertBodyElement !) as Element || inertBodyElement;\n const opCodes: IcuCase = {vars: 0, childIcus: [], create: [], remove: [], update: []};\n parseNodes(wrapper.firstChild, opCodes, parentIndex, nestedIcus, tIcus, expandoStartIndex);\n return opCodes;\n}\n\nconst NESTED_ICU = /�(\\d+)�/;\n\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n * @param currentNode The first node to parse\n * @param icuCase The data for the ICU expression case that contains those nodes\n * @param parentIndex Index of the current node's parent\n * @param nestedIcus Data for the nested ICU expressions that this case contains\n * @param tIcus Data for all ICU expressions of the current message\n * @param expandoStartIndex Expando start index for the current ICU expression\n */\nfunction parseNodes(\n currentNode: Node | null, icuCase: IcuCase, parentIndex: number, nestedIcus: IcuExpression[],\n tIcus: TIcu[], expandoStartIndex: number) {\n if (currentNode) {\n const nestedIcusToCreate: [IcuExpression, number][] = [];\n while (currentNode) {\n const nextNode: Node|null = currentNode.nextSibling;\n const newIndex = expandoStartIndex + ++icuCase.vars;\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode as Element;\n const tagName = element.tagName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n // This isn't a valid element, we won't create an element for it\n icuCase.vars--;\n } else {\n icuCase.create.push(\n ELEMENT_MARKER, tagName,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i) !;\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n addAllToArray(\n generateBindingUpdateOpCodes(attr.value, newIndex, attr.name, _sanitizeUrl),\n icuCase.update);\n } else if (SRCSET_ATTRS[lowerAttrName]) {\n addAllToArray(\n generateBindingUpdateOpCodes(\n attr.value, newIndex, attr.name, sanitizeSrcset),\n icuCase.update);\n } else {\n addAllToArray(\n generateBindingUpdateOpCodes(attr.value, newIndex, attr.name),\n icuCase.update);\n }\n } else {\n ngDevMode &&\n console.warn(\n `WARNING: ignoring unsafe attribute value ${lowerAttrName} on element ${tagName} (see http://g.co/ng/security#xss)`);\n }\n } else {\n icuCase.create.push(\n newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Attr, attr.name,\n attr.value);\n }\n }\n // Parse the children of this node (if any)\n parseNodes(\n currentNode.firstChild, icuCase, newIndex, nestedIcus, tIcus, expandoStartIndex);\n // Remove the parent node after the children\n icuCase.remove.push(newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n icuCase.create.push(\n hasBinding ? '' : value,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n icuCase.remove.push(newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n if (hasBinding) {\n addAllToArray(generateBindingUpdateOpCodes(value, newIndex), icuCase.update);\n }\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const match = NESTED_ICU.exec(currentNode.textContent || '');\n if (match) {\n const nestedIcuIndex = parseInt(match[1], 10);\n const newLocal = ngDevMode ? `nested ICU ${nestedIcuIndex}` : '';\n // Create the comment node that will anchor the ICU expression\n icuCase.create.push(\n COMMENT_MARKER, newLocal,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n const nestedIcu = nestedIcus[nestedIcuIndex];\n nestedIcusToCreate.push([nestedIcu, newIndex]);\n } else {\n // We do not handle any other type of comment\n icuCase.vars--;\n }\n break;\n default:\n // We do not handle any other type of element\n icuCase.vars--;\n }\n currentNode = nextNode !;\n }\n\n for (let i = 0; i < nestedIcusToCreate.length; i++) {\n const nestedIcu = nestedIcusToCreate[i][0];\n const nestedIcuNodeIndex = nestedIcusToCreate[i][1];\n icuStart(tIcus, nestedIcu, nestedIcuNodeIndex, expandoStartIndex + icuCase.vars);\n // Since this is recursive, the last TIcu that was pushed is the one we want\n const nestTIcuIndex = tIcus.length - 1;\n icuCase.vars += Math.max(...tIcus[nestTIcuIndex].vars);\n icuCase.childIcus.push(nestTIcuIndex);\n const mask = getBindingMask(nestedIcu);\n icuCase.update.push(\n toMaskBit(nestedIcu.mainBinding), // mask of the main binding\n 3, // skip 3 opCodes if not changed\n -1 - nestedIcu.mainBinding,\n nestedIcuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuSwitch,\n nestTIcuIndex,\n mask, // mask of all the bindings of this ICU expression\n 2, // skip 2 opCodes if not changed\n nestedIcuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuUpdate,\n nestTIcuIndex);\n icuCase.remove.push(\n nestTIcuIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.RemoveNestedIcu,\n nestedIcuNodeIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {INJECTOR, Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {StaticProvider} from '../di/provider';\nimport {createInjector} from '../di/r3_injector';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory as viewEngine_NgModuleFactory, NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {NgModuleDef} from '../metadata/ng_module';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {assertDefined} from './assert';\nimport {ComponentFactoryResolver} from './component_ref';\nimport {getNgModuleDef} from './definition';\n\nexport interface NgModuleType<T = any> extends Type<T> { ngModuleDef: NgModuleDef<T>; }\n\nconst COMPONENT_FACTORY_RESOLVER: StaticProvider = {\n provide: viewEngine_ComponentFactoryResolver,\n useClass: ComponentFactoryResolver,\n deps: [viewEngine_NgModuleRef],\n};\n\nexport class NgModuleRef<T> extends viewEngine_NgModuleRef<T> implements InternalNgModuleRef<T> {\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents: Type<any>[] = [];\n // tslint:disable-next-line:require-internal-with-underscore\n _r3Injector: Injector;\n injector: Injector = this;\n instance: T;\n destroyCbs: (() => void)[]|null = [];\n\n constructor(ngModuleType: Type<T>, public _parent: Injector|null) {\n super();\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode && assertDefined(\n ngModuleDef,\n `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n\n this._bootstrapComponents = ngModuleDef !.bootstrap;\n const additionalProviders: StaticProvider[] = [\n {\n provide: viewEngine_NgModuleRef,\n useValue: this,\n },\n COMPONENT_FACTORY_RESOLVER\n ];\n this._r3Injector = createInjector(ngModuleType, _parent, additionalProviders);\n this.instance = this.get(ngModuleType);\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n injectFlags: InjectFlags = InjectFlags.Default): any {\n if (token === Injector || token === viewEngine_NgModuleRef || token === INJECTOR) {\n return this;\n }\n return this._r3Injector.get(token, notFoundValue, injectFlags);\n }\n\n get componentFactoryResolver(): viewEngine_ComponentFactoryResolver {\n return this.get(viewEngine_ComponentFactoryResolver);\n }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n\nexport class NgModuleFactory<T> extends viewEngine_NgModuleFactory<T> {\n constructor(public moduleType: Type<T>) { super(); }\n\n create(parentInjector: Injector|null): viewEngine_NgModuleRef<T> {\n return new NgModuleRef(this.moduleType, parentInjector);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\ninterface TypeWithMetadata extends Type<any> {\n decorators?: any[];\n ctorParameters?: () => any[];\n propDecorators?: {[field: string]: any};\n}\n\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be marked as pure, resulting in the metadata assignments being\n * tree-shaken away during production builds.\n */\nexport function setClassMetadata(\n type: Type<any>, decorators: any[] | null, ctorParameters: (() => any[]) | null,\n propDecorators: {[field: string]: any} | null): void {\n const clazz = type as TypeWithMetadata;\n if (decorators !== null) {\n if (clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n } else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which use\n // tsickle-style annotations and reflect over them in the same way, this could cause issues,\n // but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have different\n // decorator types. Decorators on individual fields are not merged, as it's also incredibly\n // unlikely that a field will be decorated both with an Angular decorator and a non-Angular\n // decorator that's also been downleveled.\n if (clazz.propDecorators !== undefined) {\n clazz.propDecorators = {...clazz.propDecorators, ...propDecorators};\n } else {\n clazz.propDecorators = propDecorators;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4, getBinding, updateBinding} from './bindings';\nimport {getBindingRoot, getLView, isCreationMode} from './state';\n\n\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |------consts------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n */\nexport function pureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return isCreationMode() ?\n updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) :\n getBinding(lView, bindingIndex);\n}\n\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction1(\n slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const lView = getLView();\n const bindingIndex = getBindingRoot() + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp) ?\n updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :\n getBinding(lView, bindingIndex + 1);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction2(\n slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?\n updateBinding(\n lView, bindingIndex + 2,\n thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :\n getBinding(lView, bindingIndex + 2);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction3(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(\n lView, bindingIndex + 3,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getBinding(lView, bindingIndex + 3);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction4(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any,\n exp3: any, exp4: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?\n updateBinding(\n lView, bindingIndex + 4,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :\n getBinding(lView, bindingIndex + 4);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction5(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different ?\n updateBinding(\n lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :\n pureFn(exp1, exp2, exp3, exp4, exp5)) :\n getBinding(lView, bindingIndex + 5);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction6(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(\n lView, bindingIndex + 6, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction7(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ?\n updateBinding(\n lView, bindingIndex + 7, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :\n getBinding(lView, bindingIndex + 7);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction8(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ?\n updateBinding(\n lView, bindingIndex + 8, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :\n getBinding(lView, bindingIndex + 8);\n}\n\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunctionV(\n slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n let bindingIndex = getBindingRoot() + slotOffset;\n let different = false;\n const lView = getLView();\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :\n getBinding(lView, bindingIndex);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WrappedValue} from '../change_detection/change_detection_util';\nimport {PipeTransform} from '../change_detection/pipe_transform';\n\nimport {load, store} from './instructions';\nimport {PipeDef, PipeDefList} from './interfaces/definition';\nimport {HEADER_OFFSET, TVIEW} from './interfaces/view';\nimport {pureFunction1, pureFunction2, pureFunction3, pureFunction4, pureFunctionV} from './pure_function';\nimport {getBindingRoot, getLView} from './state';\nimport {NO_CHANGE} from './tokens';\n\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n */\nexport function pipe(index: number, pipeName: string): any {\n const tView = getLView()[TVIEW];\n let pipeDef: PipeDef<any>;\n const adjustedIndex = index + HEADER_OFFSET;\n\n if (tView.firstTemplatePass) {\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.pipeDestroyHooks || (tView.pipeDestroyHooks = [\n ])).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex] as PipeDef<any>;\n }\n\n const pipeInstance = pipeDef.factory(null);\n store(index, pipeInstance);\n return pipeInstance;\n}\n\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name: string, registry: PipeDefList | null): PipeDef<any> {\n if (registry) {\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n throw new Error(`The pipe '${name}' could not be found!`);\n}\n\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind1(index: number, slotOffset: number, v1: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction1(slotOffset, pipeInstance.transform, v1, pipeInstance) :\n pipeInstance.transform(v1));\n}\n\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction2(slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :\n pipeInstance.transform(v1, v2));\n}\n\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction3(slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :\n pipeInstance.transform(v1, v2, v3));\n}\n\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind4(\n index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ?\n pureFunction4(slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :\n pipeInstance.transform(v1, v2, v3, v4));\n}\n\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n */\nexport function pipeBindV(index: number, slotOffset: number, values: any[]): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunctionV(slotOffset, pipeInstance.transform, values, pipeInstance) :\n pipeInstance.transform.apply(pipeInstance, values));\n}\n\nfunction isPure(index: number): boolean {\n return (<PipeDef<any>>getLView()[TVIEW].data[index + HEADER_OFFSET]).pure;\n}\n\n/**\n * Unwrap the output of a pipe transformation.\n * In order to trick change detection into considering that the new value is always different from\n * the old one, the old value is overwritten by NO_CHANGE.\n *\n * @param newValue the pipe transformation output.\n */\nfunction unwrapValue(newValue: any): any {\n if (WrappedValue.isWrapped(newValue)) {\n newValue = WrappedValue.unwrap(newValue);\n getLView()[getBindingRoot()] = NO_CHANGE;\n }\n return newValue;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"rxjs\" />\n\nimport {Subject, Subscription} from 'rxjs';\n\n/**\n * Use in directives and components to emit custom events synchronously\n * or asynchronously, and register handlers for those events by subscribing\n * to an instance.\n *\n * @usageNotes\n *\n * In the following example, a component defines two output properties\n * that create event emitters. When the title is clicked, the emitter\n * emits an open or close event to toggle the current visibility state.\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * Access the event object with the `$event` argument passed to the output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * ### Notes\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n *\n * @publicApi\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n /**\n * Internal\n */\n __isAsync: boolean; // tslint:disable-line\n\n /**\n * Creates an instance of this class that can\n * deliver events synchronously or asynchronously.\n *\n * @param isAsync When true, deliver events asynchronously.\n *\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n /**\n * Emits an event containing a given value.\n * @param value The value to emit.\n */\n emit(value?: T) { super.next(value); }\n\n /**\n * Registers handlers for events emitted by this instance.\n * @param generatorOrNext When supplied, a custom handler for emitted events.\n * @param error When supplied, a custom handler for an error notification\n * from this emitter.\n * @param complete When supplied, a custom handler for a completion\n * notification from this emitter.\n */\n subscribe(generatorOrNext?: any, error?: any, complete?: any): Subscription {\n let schedulerFn: (t: any) => any;\n let errorFn = (err: any): any => null;\n let completeFn = (): any => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any) => { setTimeout(() => generatorOrNext(value)); } :\n (value: any) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n const sink = super.subscribe(schedulerFn, errorFn, completeFn);\n\n if (generatorOrNext instanceof Subscription) {\n generatorOrNext.add(sink);\n }\n\n return sink;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectTemplateRef as render3InjectTemplateRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\nimport {ElementRef} from './element_ref';\nimport {EmbeddedViewRef} from './view_ref';\n\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see `ViewContainerRef`\n * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)\n *\n * @publicApi\n */\nexport abstract class TemplateRef<C> {\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and injection contexts of embedded views created from this `TemplateRef`\n * inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n // TODO(i): rename to anchor or location\n abstract get elementRef(): ElementRef;\n\n /**\n * Instantiates an embedded view based on this template,\n * and attaches it to the view container.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @returns The new embedded view object.\n */\n abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;\n\n /** @internal */\n static __NG_ELEMENT_ID__:\n () => TemplateRef<any>| null = () => SWITCH_TEMPLATE_REF_FACTORY(TemplateRef, ElementRef)\n}\n\nexport const SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = render3InjectTemplateRef;\nconst SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_TEMPLATE_REF_FACTORY: typeof render3InjectTemplateRef =\n SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../../core';\nimport {Type} from '../../type';\nimport {CssSelectorList} from './projection';\n\n\n/**\n * Definition of what a template rendering function should look like for a component.\n */\nexport type ComponentTemplate<T> = {\n (rf: RenderFlags, ctx: T): void; ngPrivateData?: never;\n};\n\n/**\n * Definition of what a query function should look like.\n */\nexport type ComponentQuery<T> = ComponentTemplate<T>;\n\n/**\n * Flags passed into template functions to determine which blocks (i.e. creation, update)\n * should be executed.\n *\n * Typically, a template runs both the creation block and the update block on initialization and\n * subsequent runs only execute the update block. However, dynamically created views require that\n * the creation block be executed separately from the update block (for backwards compat).\n */\nexport const enum RenderFlags {\n /* Whether to run the creation block (e.g. create elements and directives) */\n Create = 0b01,\n\n /* Whether to run the update block (e.g. refresh bindings) */\n Update = 0b10\n}\n\n/**\n * A subclass of `Type` which has a static `ngComponentDef`:`ComponentDef` field making it\n * consumable for rendering.\n */\nexport interface ComponentType<T> extends Type<T> { ngComponentDef: never; }\n\n/**\n * A subclass of `Type` which has a static `ngDirectiveDef`:`DirectiveDef` field making it\n * consumable for rendering.\n */\nexport interface DirectiveType<T> extends Type<T> { ngDirectiveDef: never; }\n\nexport const enum DirectiveDefFlags {ContentQuery = 0b10}\n\n/**\n * A subclass of `Type` which has a static `ngPipeDef`:`PipeDef` field making it\n * consumable for rendering.\n */\nexport interface PipeType<T> extends Type<T> { ngPipeDef: never; }\n\nexport type DirectiveDefWithMeta<\n T, Selector extends string, ExportAs extends string, InputMap extends{[key: string]: string},\n OutputMap extends{[key: string]: string}, QueryFields extends string[]> = DirectiveDef<T>;\n\n/**\n * Runtime information for classes that are inherited by components or directives\n * that aren't defined as components or directives.\n *\n * This is an internal data structure used by the render to determine what inputs\n * and outputs should be inherited.\n *\n * See: {@link defineBase}\n */\nexport interface BaseDef<T> {\n /**\n * A dictionary mapping the inputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Input('alias') propertyName: any;`).\n */\n readonly inputs: {[P in keyof T]: string};\n\n /**\n * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of\n * public or minified name.\n */\n readonly declaredInputs: {[P in keyof T]: P};\n\n /**\n * A dictionary mapping the outputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Output('alias') propertyName: any;`).\n */\n readonly outputs: {[P in keyof T]: P};\n}\n\n/**\n * Runtime link information for Directives.\n *\n * This is internal data structure used by the render to link\n * directives into templates.\n *\n * NOTE: Always use `defineDirective` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * @param Selector type metadata specifying the selector of the directive or component\n *\n * See: {@link defineDirective}\n */\nexport interface DirectiveDef<T> extends BaseDef<T> {\n /** Token representing the directive. Used by DI. */\n type: Type<T>;\n\n /** Function that resolves providers and publishes them into the DI system. */\n providersResolver: ((def: DirectiveDef<T>) => void)|null;\n\n /** The selectors that will be used to match nodes to this directive. */\n readonly selectors: CssSelectorList;\n\n /**\n * Name under which the directive is exported (for use with local references in template)\n */\n readonly exportAs: string|null;\n\n /**\n * Factory function used to create a new directive instance.\n */\n factory: (t: Type<T>|null) => T;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries: ((directiveIndex: number) => void)|null;\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh: ((directiveIndex: number, queryIndex: number) => void)|null;\n\n /** Refreshes host bindings on the associated directive. */\n hostBindings: HostBindingsFunction<T>|null;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n readonly attributes: string[]|null;\n\n /* The following are lifecycle hooks for this component */\n onInit: (() => void)|null;\n doCheck: (() => void)|null;\n afterContentInit: (() => void)|null;\n afterContentChecked: (() => void)|null;\n afterViewInit: (() => void)|null;\n afterViewChecked: (() => void)|null;\n onDestroy: (() => void)|null;\n\n /**\n * The features applied to this directive\n */\n readonly features: DirectiveDefFeature[]|null;\n}\n\nexport type ComponentDefWithMeta<\n T, Selector extends String, ExportAs extends string, InputMap extends{[key: string]: string},\n OutputMap extends{[key: string]: string}, QueryFields extends string[]> = ComponentDef<T>;\n\n/**\n * Runtime link information for Components.\n *\n * This is internal data structure used by the render to link\n * components into templates.\n *\n * NOTE: Always use `defineComponent` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link defineComponent}\n */\nexport interface ComponentDef<T> extends DirectiveDef<T> {\n /**\n * Runtime unique component ID.\n */\n readonly id: string;\n\n /**\n * The View template of the component.\n */\n readonly template: ComponentTemplate<T>;\n\n /**\n * A set of styles that the component needs to be present for component to render correctly.\n */\n readonly styles: string[];\n\n /**\n * The number of nodes, local refs, and pipes in this component template.\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the binding start index.\n */\n // TODO(kara): remove queries from this count\n readonly consts: number;\n\n /**\n * The number of bindings in this component template (including pure fn bindings).\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n readonly vars: number;\n\n /**\n * Query-related instructions for a component.\n */\n viewQuery: ComponentQuery<T>|null;\n\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [ShadowDOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n readonly encapsulation: ViewEncapsulation;\n\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n readonly data: {[kind: string]: any};\n\n /** Whether or not this component's ChangeDetectionStrategy is OnPush */\n readonly onPush: boolean;\n\n /**\n\n * Registry of directives and components that may be found in this view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directiveDefs: DirectiveDefListOrFactory|null;\n\n /**\n * Registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipeDefs: PipeDefListOrFactory|null;\n\n /**\n * Used to store the result of `noSideEffects` function so that it is not removed by closure\n * compiler. The property should never be read.\n */\n readonly _?: never;\n}\n\n/**\n * Runtime link information for Pipes.\n *\n * This is internal data structure used by the renderer to link\n * pipes into templates.\n *\n * NOTE: Always use `definePipe` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link definePipe}\n */\nexport interface PipeDef<T> {\n /**\n * Pipe name.\n *\n * Used to resolve pipe in templates.\n */\n readonly name: string;\n\n /**\n * Factory function used to create a new pipe instance.\n */\n factory: (t: Type<T>|null) => T;\n\n /**\n * Whether or not the pipe is pure.\n *\n * Pure pipes result only depends on the pipe input and not on internal\n * state of the pipe.\n */\n readonly pure: boolean;\n\n /* The following are lifecycle hooks for this pipe */\n onDestroy: (() => void)|null;\n}\n\nexport type PipeDefWithMeta<T, Name extends string> = PipeDef<T>;\n\nexport interface DirectiveDefFeature {\n <T>(directiveDef: DirectiveDef<T>): void;\n ngInherit?: true;\n}\n\nexport interface ComponentDefFeature {\n <T>(componentDef: ComponentDef<T>): void;\n ngInherit?: true;\n}\n\n\n/**\n * Type used for directiveDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;\n\nexport type DirectiveDefList = (DirectiveDef<any>| ComponentDef<any>)[];\n\nexport type DirectiveTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type DirectiveTypeList =\n (DirectiveDef<any>| ComponentDef<any>|\n Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\nexport type HostBindingsFunction<T> = (rf: RenderFlags, ctx: T, elementIndex: number) => void;\n\n/**\n * Type used for PipeDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;\n\nexport type PipeDefList = PipeDef<any>[];\n\nexport type PipeTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type PipeTypeList =\n (PipeDef<any>| Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {QueryList} from '../../linker';\nimport {Type} from '../../type';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode} from './node';\n\n/** Used for tracking queries (e.g. ViewChild, ContentChild). */\nexport interface LQueries {\n /**\n * The parent LQueries instance.\n *\n * When there is a content query, a new LQueries instance is created to avoid mutating any\n * existing LQueries. After we are done searching content children, the parent property allows\n * us to traverse back up to the original LQueries instance to continue to search for matches\n * in the main view.\n */\n parent: LQueries|null;\n\n /**\n * Ask queries to prepare copy of itself. This assures that tracking new queries on content nodes\n * doesn't mutate list of queries tracked on a parent node. We will clone LQueries before\n * constructing content queries.\n */\n clone(): LQueries;\n\n /**\n * Notify `LQueries` that a new `TNode` has been created and needs to be added to query results\n * if matching query predicate.\n */\n addNode(tNode: TElementNode|TContainerNode|TElementContainerNode): LQueries|null;\n\n /**\n * Notify `LQueries` that a new LContainer was added to ivy data structures. As a result we need\n * to prepare room for views that might be inserted into this container.\n */\n container(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been created. As a result we need to prepare room\n * and collect nodes that match query predicate.\n */\n createView(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been added to `LContainer`. As a result all\n * the matching nodes from this view should be added to container's queries.\n */\n insertView(newViewIndex: number): void;\n\n /**\n * Notify `LQueries` that an `LView` has been removed from `LContainer`. As a result all\n * the matching nodes from this view should be removed from container's queries.\n */\n removeView(): void;\n\n /**\n * Add additional `QueryList` to track.\n *\n * @param queryList `QueryList` to update with changes.\n * @param predicate Either `Type` or selector array of [key, value] predicates.\n * @param descend If true the query will recursively apply to the children.\n * @param read Indicates which token should be read from DI for this query.\n */\n track<T>(\n queryList: QueryList<T>, predicate: Type<any>|string[], descend?: boolean,\n read?: Type<T>): void;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine_from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {QueryList as viewEngine_QueryList} from '../linker/query_list';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\nimport {Type} from '../type';\nimport {getSymbolIterator} from '../util';\n\nimport {assertDefined, assertEqual, assertPreviousIsParent} from './assert';\nimport {getNodeInjectable, locateDirectiveOrProvider} from './di';\nimport {NG_ELEMENT_ID} from './fields';\nimport {store, storeCleanupWithContext} from './instructions';\nimport {unusedValueExportToPlacateAjd as unused1} from './interfaces/definition';\nimport {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, unusedValueExportToPlacateAjd as unused3} from './interfaces/node';\nimport {LQueries, unusedValueExportToPlacateAjd as unused4} from './interfaces/query';\nimport {LView, TVIEW} from './interfaces/view';\nimport {getIsParent, getLView, getOrCreateCurrentQueries} from './state';\nimport {flatten, isContentQueryHost} from './util';\nimport {createElementRef, createTemplateRef} from './view_engine_compatibility';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4;\n\n/**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\nexport interface QueryPredicate<T> {\n /**\n * If looking for directives then it contains the directive type.\n */\n type: Type<T>|null;\n\n /**\n * If selector then contains local names to query for.\n */\n selector: string[]|null;\n\n /**\n * Indicates which token should be read from DI for this query.\n */\n read: Type<T>|null;\n}\n\n/**\n * An object representing a query, which is a combination of:\n * - query predicate to determines if a given element/directive should be included in the query\n * - values collected based on a predicate\n * - `QueryList` to which collected values should be reported\n */\nexport interface LQuery<T> {\n /**\n * Next query. Used when queries are stored as a linked list in `LQueries`.\n */\n next: LQuery<any>|null;\n\n /**\n * Destination to which the value should be added.\n */\n list: QueryList<T>;\n\n /**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\n predicate: QueryPredicate<T>;\n\n /**\n * Values which have been located.\n *\n * This is what builds up the `QueryList._valuesTree`.\n */\n values: any[];\n\n /**\n * A pointer to an array that stores collected values from views. This is necessary so we know a\n * container into which to insert nodes collected from views.\n */\n containerValues: any[]|null;\n}\n\nexport class LQueries_ implements LQueries {\n constructor(\n public parent: LQueries_|null, private shallow: LQuery<any>|null,\n private deep: LQuery<any>|null) {}\n\n track<T>(\n queryList: viewEngine_QueryList<T>, predicate: Type<T>|string[], descend?: boolean,\n read?: Type<T>): void {\n if (descend) {\n this.deep = createQuery(this.deep, queryList, predicate, read != null ? read : null);\n } else {\n this.shallow = createQuery(this.shallow, queryList, predicate, read != null ? read : null);\n }\n }\n\n clone(): LQueries { return new LQueries_(this, null, this.deep); }\n\n container(): LQueries|null {\n const shallowResults = copyQueriesToContainer(this.shallow);\n const deepResults = copyQueriesToContainer(this.deep);\n\n return shallowResults || deepResults ? new LQueries_(this, shallowResults, deepResults) : null;\n }\n\n createView(): LQueries|null {\n const shallowResults = copyQueriesToView(this.shallow);\n const deepResults = copyQueriesToView(this.deep);\n\n return shallowResults || deepResults ? new LQueries_(this, shallowResults, deepResults) : null;\n }\n\n insertView(index: number): void {\n insertView(index, this.shallow);\n insertView(index, this.deep);\n }\n\n addNode(tNode: TElementNode|TContainerNode|TElementContainerNode): LQueries|null {\n add(this.deep, tNode);\n\n if (isContentQueryHost(tNode)) {\n add(this.shallow, tNode);\n\n if (tNode.parent && isContentQueryHost(tNode.parent)) {\n // if node has a content query and parent also has a content query\n // both queries need to check this node for shallow matches\n add(this.parent !.shallow, tNode);\n }\n return this.parent;\n }\n\n isRootNodeOfQuery(tNode) && add(this.shallow, tNode);\n return this;\n }\n\n removeView(): void {\n removeView(this.shallow);\n removeView(this.deep);\n }\n}\n\nfunction isRootNodeOfQuery(tNode: TNode) {\n return tNode.parent === null || isContentQueryHost(tNode.parent);\n}\n\nfunction copyQueriesToContainer(query: LQuery<any>| null): LQuery<any>|null {\n let result: LQuery<any>|null = null;\n\n while (query) {\n const containerValues: any[] = []; // prepare room for views\n query.values.push(containerValues);\n const clonedQuery: LQuery<any> = {\n next: result,\n list: query.list,\n predicate: query.predicate,\n values: containerValues,\n containerValues: null\n };\n result = clonedQuery;\n query = query.next;\n }\n\n return result;\n}\n\nfunction copyQueriesToView(query: LQuery<any>| null): LQuery<any>|null {\n let result: LQuery<any>|null = null;\n\n while (query) {\n const clonedQuery: LQuery<any> = {\n next: result,\n list: query.list,\n predicate: query.predicate,\n values: [],\n containerValues: query.values\n };\n result = clonedQuery;\n query = query.next;\n }\n\n return result;\n}\n\nfunction insertView(index: number, query: LQuery<any>| null) {\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n query.containerValues !.splice(index, 0, query.values);\n query = query.next;\n }\n}\n\nfunction removeView(query: LQuery<any>| null) {\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n\n const containerValues = query.containerValues !;\n const viewValuesIdx = containerValues.indexOf(query.values);\n const removed = containerValues.splice(viewValuesIdx, 1);\n\n // mark a query as dirty only when removed view had matching modes\n ngDevMode && assertEqual(removed.length, 1, 'removed.length');\n if (removed[0].length) {\n query.list.setDirty();\n }\n\n query = query.next;\n }\n}\n\n\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode: TNode, selector: string): number|null {\n const localNames = tNode.localNames;\n if (localNames) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1] as number;\n }\n }\n }\n return null;\n}\n\n\n// TODO: \"read\" should be an AbstractType (FW-486)\nfunction queryByReadToken(read: any, tNode: TNode, currentView: LView): any {\n const factoryFn = (read as any)[NG_ELEMENT_ID];\n if (typeof factoryFn === 'function') {\n return factoryFn();\n } else {\n const matchingIdx =\n locateDirectiveOrProvider(tNode, currentView, read as Type<any>, false, false);\n if (matchingIdx !== null) {\n return getNodeInjectable(\n currentView[TVIEW].data, currentView, matchingIdx, tNode as TElementNode);\n }\n }\n return null;\n}\n\nfunction queryByTNodeType(tNode: TNode, currentView: LView): any {\n if (tNode.type === TNodeType.Element || tNode.type === TNodeType.ElementContainer) {\n return createElementRef(ViewEngine_ElementRef, tNode, currentView);\n }\n if (tNode.type === TNodeType.Container) {\n return createTemplateRef(ViewEngine_TemplateRef, ViewEngine_ElementRef, tNode, currentView);\n }\n return null;\n}\n\nfunction queryByTemplateRef(\n templateRefToken: ViewEngine_TemplateRef<any>, tNode: TNode, currentView: LView,\n read: any): any {\n const templateRefResult = (templateRefToken as any)[NG_ELEMENT_ID]();\n if (read) {\n return templateRefResult ? queryByReadToken(read, tNode, currentView) : null;\n }\n return templateRefResult;\n}\n\nfunction queryRead(tNode: TNode, currentView: LView, read: any, matchingIdx: number): any {\n if (read) {\n return queryByReadToken(read, tNode, currentView);\n }\n if (matchingIdx > -1) {\n return getNodeInjectable(\n currentView[TVIEW].data, currentView, matchingIdx, tNode as TElementNode);\n }\n // if read token and / or strategy is not specified,\n // detect it using appropriate tNode type\n return queryByTNodeType(tNode, currentView);\n}\n\nfunction add(\n query: LQuery<any>| null, tNode: TElementNode | TContainerNode | TElementContainerNode) {\n const currentView = getLView();\n\n while (query) {\n const predicate = query.predicate;\n const type = predicate.type as any;\n if (type) {\n let result = null;\n if (type === ViewEngine_TemplateRef) {\n result = queryByTemplateRef(type, tNode, currentView, predicate.read);\n } else {\n const matchingIdx = locateDirectiveOrProvider(tNode, currentView, type, false, false);\n if (matchingIdx !== null) {\n result = queryRead(tNode, currentView, predicate.read, matchingIdx);\n }\n }\n if (result !== null) {\n addMatch(query, result);\n }\n } else {\n const selector = predicate.selector !;\n for (let i = 0; i < selector.length; i++) {\n const matchingIdx = getIdxOfMatchingSelector(tNode, selector[i]);\n if (matchingIdx !== null) {\n const result = queryRead(tNode, currentView, predicate.read, matchingIdx);\n if (result !== null) {\n addMatch(query, result);\n }\n }\n }\n }\n query = query.next;\n }\n}\n\nfunction addMatch(query: LQuery<any>, matchingValue: any): void {\n query.values.push(matchingValue);\n query.list.setDirty();\n}\n\nfunction createPredicate<T>(predicate: Type<T>| string[], read: Type<T>| null): QueryPredicate<T> {\n const isArray = Array.isArray(predicate);\n return {\n type: isArray ? null : predicate as Type<T>,\n selector: isArray ? predicate as string[] : null,\n read: read\n };\n}\n\nfunction createQuery<T>(\n previous: LQuery<any>| null, queryList: QueryList<T>, predicate: Type<T>| string[],\n read: Type<T>| null): LQuery<T> {\n return {\n next: previous,\n list: queryList,\n predicate: createPredicate(predicate, read),\n values: (queryList as any as QueryList_<T>)._valuesTree,\n containerValues: null\n };\n}\n\nclass QueryList_<T>/* implements viewEngine_QueryList<T> */ {\n readonly dirty = true;\n readonly changes: Observable<T> = new EventEmitter();\n private _values: T[] = [];\n /** @internal */\n _valuesTree: any[] = [];\n\n get length(): number { return this._values.length; }\n\n get first(): T|null {\n let values = this._values;\n return values.length ? values[0] : null;\n }\n\n get last(): T|null {\n let values = this._values;\n return values.length ? values[values.length - 1] : null;\n }\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._values.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._values.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._values.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._values.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._values.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._values.some(fn);\n }\n\n toArray(): T[] { return this._values.slice(0); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._values as any)[getSymbolIterator()](); }\n\n toString(): string { return this._values.toString(); }\n\n reset(res: (any[]|T)[]): void {\n this._values = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n setDirty(): void { (this as{dirty: boolean}).dirty = true; }\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\n// NOTE: this hack is here because IQueryList has private members and therefore\n// it can't be implemented only extended.\nexport type QueryList<T> = viewEngine_QueryList<T>;\nexport const QueryList: typeof viewEngine_QueryList = QueryList_ as any;\n\n/**\n * Creates and returns a QueryList.\n *\n * @param memoryIndex The index in memory where the QueryList should be saved. If null,\n * this is is a content query and the QueryList will be saved later through directiveCreate.\n * @param predicate The type for which the query will search\n * @param descend Whether or not to descend into children\n * @param read What to save in the query\n * @returns QueryList<T>\n */\nexport function query<T>(\n memoryIndex: number | null, predicate: Type<any>| string[], descend?: boolean,\n // TODO: \"read\" should be an AbstractType (FW-486)\n read?: any): QueryList<T> {\n ngDevMode && assertPreviousIsParent(getIsParent());\n const queryList = new QueryList<T>();\n const queries = getOrCreateCurrentQueries(LQueries_);\n queries.track(queryList, predicate, descend, read);\n storeCleanupWithContext(getLView(), queryList, queryList.destroy);\n if (memoryIndex != null) {\n store(memoryIndex, queryList);\n }\n return queryList;\n}\n\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n * Returns true if a query got dirty during change detection, false otherwise.\n */\nexport function queryRefresh(queryList: QueryList<any>): boolean {\n const queryListImpl = (queryList as any as QueryList_<any>);\n if (queryList.dirty) {\n queryList.reset(queryListImpl._valuesTree);\n queryList.notifyOnChanges();\n return true;\n }\n return false;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\n\nimport {TNode} from './interfaces/node';\nimport {LView} from './interfaces/view';\nimport {createTemplateRef} from './view_engine_compatibility';\n\n\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n */\nexport function templateRefExtractor(tNode: TNode, currentView: LView) {\n return createTemplateRef(ViewEngine_TemplateRef, ViewEngine_ElementRef, tNode, currentView);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {LifecycleHooksFeature, renderComponent, whenRendered} from './component';\nimport {defineBase, defineComponent, defineDirective, defineNgModule, definePipe} from './definition';\nimport {getComponent, getHostElement, getRenderedText} from './discovery_utils';\nimport {InheritDefinitionFeature} from './features/inherit_definition_feature';\nimport {NgOnChangesFeature} from './features/ng_onchanges_feature';\nimport {ProvidersFeature} from './features/providers_feature';\nimport {BaseDef, ComponentDef, ComponentDefWithMeta, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefWithMeta, DirectiveType, PipeDef, PipeDefWithMeta} from './interfaces/definition';\n\nexport {ComponentFactory, ComponentFactoryResolver, ComponentRef, injectComponentFactoryResolver} from './component_ref';\nexport {getFactoryOf, getInheritedFactory} from './di';\nexport {RenderFlags} from './interfaces/definition';\nexport {CssSelectorList} from './interfaces/projection';\n\n\n// clang-format off\nexport {\n allocHostVars,\n bind,\n interpolation1,\n interpolation2,\n interpolation3,\n interpolation4,\n interpolation5,\n interpolation6,\n interpolation7,\n interpolation8,\n interpolationV,\n\n container,\n containerRefreshStart,\n containerRefreshEnd,\n\n nextContext,\n\n element,\n elementAttribute,\n elementClassProp,\n elementEnd,\n elementProperty,\n componentHostSyntheticProperty,\n elementStart,\n\n elementContainerStart,\n elementContainerEnd,\n elementStyling,\n elementHostAttrs,\n elementStylingMap,\n elementStyleProp,\n elementStylingApply,\n\n listener,\n store,\n load,\n\n namespaceHTML,\n namespaceMathML,\n namespaceSVG,\n\n projection,\n projectionDef,\n\n text,\n textBinding,\n template,\n\n reference,\n\n embeddedViewStart,\n embeddedViewEnd,\n detectChanges,\n markDirty,\n tick,\n\n directiveInject,\n injectAttribute,\n\n getCurrentView\n} from './instructions';\n\nexport {\n restoreView,\n\n enableBindings,\n disableBindings,\n} from './state';\n\nexport {\n i18n,\n i18nAttributes,\n i18nExp,\n i18nStart,\n i18nEnd,\n i18nApply,\n i18nPostprocess\n} from './i18n';\n\nexport {NgModuleFactory, NgModuleRef, NgModuleType} from './ng_module_ref';\n\nexport {\n AttributeMarker\n} from './interfaces/node';\n\nexport {\n setClassMetadata,\n} from './metadata';\n\nexport {\n pipe,\n pipeBind1,\n pipeBind2,\n pipeBind3,\n pipeBind4,\n pipeBindV,\n} from './pipe';\n\nexport {\n QueryList,\n query,\n queryRefresh,\n} from './query';\nexport {\n registerContentQuery,\n loadQueryList,\n} from './instructions';\n\nexport {\n pureFunction0,\n pureFunction1,\n pureFunction2,\n pureFunction3,\n pureFunction4,\n pureFunction5,\n pureFunction6,\n pureFunction7,\n pureFunction8,\n pureFunctionV,\n} from './pure_function';\n\nexport {templateRefExtractor} from './view_engine_compatibility_prebound';\n\n\n// clang-format on\n\nexport {\n BaseDef,\n ComponentDef,\n ComponentDefWithMeta,\n ComponentTemplate,\n ComponentType,\n DirectiveDef,\n DirectiveDefFlags,\n DirectiveDefWithMeta,\n DirectiveType,\n NgOnChangesFeature,\n InheritDefinitionFeature,\n ProvidersFeature,\n PipeDef,\n PipeDefWithMeta,\n LifecycleHooksFeature,\n defineComponent,\n defineDirective,\n defineNgModule,\n defineBase,\n definePipe,\n getHostElement,\n getComponent,\n getRenderedText,\n renderComponent,\n whenRendered,\n};\n\nexport {NO_CHANGE} from './tokens';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst BRAND = '__SANITIZER_TRUSTED_BRAND__';\n\nexport const enum BypassType {\n Url = 'Url',\n Html = 'Html',\n ResourceUrl = 'ResourceUrl',\n Script = 'Script',\n Style = 'Style',\n}\n\n/**\n * A branded trusted string used with sanitization.\n *\n * See: {@link TrustedHtmlString}, {@link TrustedResourceUrlString}, {@link TrustedScriptString},\n * {@link TrustedStyleString}, {@link TrustedUrlString}\n */\nexport interface TrustedString extends String { [BRAND]: BypassType; }\n\n/**\n * A branded trusted string used with sanitization of `html` strings.\n *\n * See: {@link bypassSanitizationTrustHtml} and {@link htmlSanitizer}.\n */\nexport interface TrustedHtmlString extends TrustedString { [BRAND]: BypassType.Html; }\n\n/**\n * A branded trusted string used with sanitization of `style` strings.\n *\n * See: {@link bypassSanitizationTrustStyle} and {@link styleSanitizer}.\n */\nexport interface TrustedStyleString extends TrustedString { [BRAND]: BypassType.Style; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustScript} and {@link scriptSanitizer}.\n */\nexport interface TrustedScriptString extends TrustedString { [BRAND]: BypassType.Script; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustUrl} and {@link urlSanitizer}.\n */\nexport interface TrustedUrlString extends TrustedString { [BRAND]: BypassType.Url; }\n\n/**\n * A branded trusted string used with sanitization of `resourceUrl` strings.\n *\n * See: {@link bypassSanitizationTrustResourceUrl} and {@link resourceUrlSanitizer}.\n */\nexport interface TrustedResourceUrlString extends TrustedString { [BRAND]: BypassType.ResourceUrl; }\n\nexport function allowSanitizationBypass(value: any, type: BypassType): boolean {\n return (value instanceof String && (value as TrustedStyleString)[BRAND] === type);\n}\n\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustHtml(trustedHtml: string): TrustedHtmlString {\n return bypassSanitizationTrustString(trustedHtml, BypassType.Html);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustStyle(trustedStyle: string): TrustedStyleString {\n return bypassSanitizationTrustString(trustedStyle, BypassType.Style);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustScript(trustedScript: string): TrustedScriptString {\n return bypassSanitizationTrustString(trustedScript, BypassType.Script);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustUrl(trustedUrl: string): TrustedUrlString {\n return bypassSanitizationTrustString(trustedUrl, BypassType.Url);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string):\n TrustedResourceUrlString {\n return bypassSanitizationTrustString(trustedResourceUrl, BypassType.ResourceUrl);\n}\n\n\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Html): TrustedHtmlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Style): TrustedStyleString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Script): TrustedScriptString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Url): TrustedUrlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.ResourceUrl): TrustedResourceUrlString;\nfunction bypassSanitizationTrustString(trustedString: string, mode: BypassType): TrustedString {\n const trusted = new String(trustedString) as TrustedString;\n trusted[BRAND] = mode;\n return trusted;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\nimport {_sanitizeUrl} from './url_sanitizer';\n\n\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nconst VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nconst TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nconst COLOR_FNS = '(?:rgb|hsl)a?';\nconst GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nconst CSS3_FNS = '(?:calc|attr)';\nconst FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nconst SAFE_STYLE_VALUE = new RegExp(\n `^(${VALUES}|` +\n `(?:${TRANSFORMATION_FNS}|${COLOR_FNS}|${GRADIENTS}|${CSS3_FNS})` +\n `${FN_ARGS})$`,\n 'g');\n\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nconst URL_RE = /^url\\(([^)]+)\\)$/;\n\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n */\nfunction hasBalancedQuotes(value: string) {\n let outsideSingle = true;\n let outsideDouble = true;\n for (let i = 0; i < value.length; i++) {\n const c = value.charAt(i);\n if (c === '\\'' && outsideDouble) {\n outsideSingle = !outsideSingle;\n } else if (c === '\"' && outsideSingle) {\n outsideDouble = !outsideDouble;\n }\n }\n return outsideSingle && outsideDouble;\n}\n\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n */\nexport function _sanitizeStyle(value: string): string {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value) return '';\n\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n const urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n\n if (isDevMode()) {\n console.warn(\n `WARNING: sanitizing unsafe style value ${value} (see http://g.co/ng/security#xss).`);\n }\n\n return 'unsafe';\n}\n\n\n/**\n * Used to intercept and sanitize style values before they are written to the renderer.\n *\n * This function is designed to be called in two modes. When a value is not provided\n * then the function will return a boolean whether a property will be sanitized later.\n * If a value is provided then the sanitized version of that will be returned.\n */\nexport interface StyleSanitizeFn {\n /** This mode is designed to instruct whether the property will be used for sanitization\n * at a later point */\n (prop: string): boolean;\n /** This mode is designed to sanitize the provided value */\n (prop: string, value: string): string;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SANITIZER} from '../render3/interfaces/view';\nimport {getLView} from '../render3/state';\nimport {stringify} from '../render3/util';\n\nimport {BypassType, allowSanitizationBypass} from './bypass';\nimport {_sanitizeHtml as _sanitizeHtml} from './html_sanitizer';\nimport {Sanitizer, SecurityContext} from './security';\nimport {StyleSanitizeFn, _sanitizeStyle as _sanitizeStyle} from './style_sanitizer';\nimport {_sanitizeUrl as _sanitizeUrl} from './url_sanitizer';\n\n\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n */\nexport function sanitizeHtml(unsafeHtml: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '';\n }\n if (allowSanitizationBypass(unsafeHtml, BypassType.Html)) {\n return unsafeHtml.toString();\n }\n return _sanitizeHtml(document, stringify(unsafeHtml));\n}\n\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `style` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties, because all of the\n * dangerous javascript and urls have been removed.\n */\nexport function sanitizeStyle(unsafeStyle: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypass(unsafeStyle, BypassType.Style)) {\n return unsafeStyle.toString();\n }\n return _sanitizeStyle(stringify(unsafeStyle));\n}\n\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n */\nexport function sanitizeUrl(unsafeUrl: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypass(unsafeUrl, BypassType.Url)) {\n return unsafeUrl.toString();\n }\n return _sanitizeUrl(stringify(unsafeUrl));\n}\n\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n */\nexport function sanitizeResourceUrl(unsafeResourceUrl: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '';\n }\n if (allowSanitizationBypass(unsafeResourceUrl, BypassType.ResourceUrl)) {\n return unsafeResourceUrl.toString();\n }\n throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n}\n\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n */\nexport function sanitizeScript(unsafeScript: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '';\n }\n if (allowSanitizationBypass(unsafeScript, BypassType.Script)) {\n return unsafeScript.toString();\n }\n throw new Error('unsafe value used in a script context');\n}\n\n/**\n * The default style sanitizer will handle sanitization for style properties by\n * sanitizing any CSS property that can include a `url` value (usually image-based properties)\n */\nexport const defaultStyleSanitizer = (function(prop: string, value?: string): string | boolean {\n if (value === undefined) {\n return prop === 'background-image' || prop === 'background' || prop === 'border-image' ||\n prop === 'filter' || prop === 'list-style' || prop === 'list-style-image';\n }\n\n return sanitizeStyle(value);\n} as StyleSanitizeFn);\n\nfunction getSanitizer(): Sanitizer|null {\n const lView = getLView();\n return lView && lView[SANITIZER];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {defineInjectable, defineInjector,} from '../../di/defs';\nimport {inject} from '../../di/injector_compatibility';\nimport * as r3 from '../index';\nimport * as sanitization from '../../sanitization/sanitization';\n\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nexport const angularCoreEnv: {[name: string]: Function} = {\n 'ɵdefineBase': r3.defineBase,\n 'ɵdefineComponent': r3.defineComponent,\n 'ɵdefineDirective': r3.defineDirective,\n 'defineInjectable': defineInjectable,\n 'defineInjector': defineInjector,\n 'ɵdefineNgModule': r3.defineNgModule,\n 'ɵdefinePipe': r3.definePipe,\n 'ɵdirectiveInject': r3.directiveInject,\n 'ɵgetFactoryOf': r3.getFactoryOf,\n 'ɵgetInheritedFactory': r3.getInheritedFactory,\n 'inject': inject,\n 'ɵinjectAttribute': r3.injectAttribute,\n 'ɵtemplateRefExtractor': r3.templateRefExtractor,\n 'ɵNgOnChangesFeature': r3.NgOnChangesFeature,\n 'ɵProvidersFeature': r3.ProvidersFeature,\n 'ɵInheritDefinitionFeature': r3.InheritDefinitionFeature,\n 'ɵelementAttribute': r3.elementAttribute,\n 'ɵbind': r3.bind,\n 'ɵcontainer': r3.container,\n 'ɵnextContext': r3.nextContext,\n 'ɵcontainerRefreshStart': r3.containerRefreshStart,\n 'ɵcontainerRefreshEnd': r3.containerRefreshEnd,\n 'ɵloadQueryList': r3.loadQueryList,\n 'ɵnamespaceHTML': r3.namespaceHTML,\n 'ɵnamespaceMathML': r3.namespaceMathML,\n 'ɵnamespaceSVG': r3.namespaceSVG,\n 'ɵenableBindings': r3.enableBindings,\n 'ɵdisableBindings': r3.disableBindings,\n 'ɵallocHostVars': r3.allocHostVars,\n 'ɵelementStart': r3.elementStart,\n 'ɵelementEnd': r3.elementEnd,\n 'ɵelement': r3.element,\n 'ɵelementContainerStart': r3.elementContainerStart,\n 'ɵelementContainerEnd': r3.elementContainerEnd,\n 'ɵpureFunction0': r3.pureFunction0,\n 'ɵpureFunction1': r3.pureFunction1,\n 'ɵpureFunction2': r3.pureFunction2,\n 'ɵpureFunction3': r3.pureFunction3,\n 'ɵpureFunction4': r3.pureFunction4,\n 'ɵpureFunction5': r3.pureFunction5,\n 'ɵpureFunction6': r3.pureFunction6,\n 'ɵpureFunction7': r3.pureFunction7,\n 'ɵpureFunction8': r3.pureFunction8,\n 'ɵpureFunctionV': r3.pureFunctionV,\n 'ɵgetCurrentView': r3.getCurrentView,\n 'ɵrestoreView': r3.restoreView,\n 'ɵinterpolation1': r3.interpolation1,\n 'ɵinterpolation2': r3.interpolation2,\n 'ɵinterpolation3': r3.interpolation3,\n 'ɵinterpolation4': r3.interpolation4,\n 'ɵinterpolation5': r3.interpolation5,\n 'ɵinterpolation6': r3.interpolation6,\n 'ɵinterpolation7': r3.interpolation7,\n 'ɵinterpolation8': r3.interpolation8,\n 'ɵinterpolationV': r3.interpolationV,\n 'ɵelementClassProp': r3.elementClassProp,\n 'ɵlistener': r3.listener,\n 'ɵload': r3.load,\n 'ɵprojection': r3.projection,\n 'ɵelementProperty': r3.elementProperty,\n 'ɵcomponentHostSyntheticProperty': r3.componentHostSyntheticProperty,\n 'ɵpipeBind1': r3.pipeBind1,\n 'ɵpipeBind2': r3.pipeBind2,\n 'ɵpipeBind3': r3.pipeBind3,\n 'ɵpipeBind4': r3.pipeBind4,\n 'ɵpipeBindV': r3.pipeBindV,\n 'ɵprojectionDef': r3.projectionDef,\n 'ɵpipe': r3.pipe,\n 'ɵquery': r3.query,\n 'ɵqueryRefresh': r3.queryRefresh,\n 'ɵregisterContentQuery': r3.registerContentQuery,\n 'ɵreference': r3.reference,\n 'ɵelementStyling': r3.elementStyling,\n 'ɵelementHostAttrs': r3.elementHostAttrs,\n 'ɵelementStylingMap': r3.elementStylingMap,\n 'ɵelementStyleProp': r3.elementStyleProp,\n 'ɵelementStylingApply': r3.elementStylingApply,\n 'ɵtemplate': r3.template,\n 'ɵtext': r3.text,\n 'ɵtextBinding': r3.textBinding,\n 'ɵembeddedViewStart': r3.embeddedViewStart,\n 'ɵembeddedViewEnd': r3.embeddedViewEnd,\n 'ɵi18n': r3.i18n,\n 'ɵi18nAttributes': r3.i18nAttributes,\n 'ɵi18nExp': r3.i18nExp,\n 'ɵi18nStart': r3.i18nStart,\n 'ɵi18nEnd': r3.i18nEnd,\n 'ɵi18nApply': r3.i18nApply,\n 'ɵi18nPostprocess': r3.i18nPostprocess,\n\n 'ɵsanitizeHtml': sanitization.sanitizeHtml,\n 'ɵsanitizeStyle': sanitization.sanitizeStyle,\n 'ɵdefaultStyleSanitizer': sanitization.defaultStyleSanitizer,\n 'ɵsanitizeResourceUrl': sanitization.sanitizeResourceUrl,\n 'ɵsanitizeScript': sanitization.sanitizeScript,\n 'ɵsanitizeUrl': sanitization.sanitizeUrl\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModuleFactory as R3NgModuleFactory, NgModuleType} from '../render3/ng_module_ref';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {NgModuleFactory} from './ng_module_factory';\n\n/**\n * Used to load ng module factories.\n *\n * @publicApi\n */\nexport abstract class NgModuleFactoryLoader {\n abstract load(path: string): Promise<NgModuleFactory<any>>;\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n * - In pre Ivy we track NgModuleFactory,\n * - In post Ivy we track the NgModuleType\n */\nconst modules = new Map<string, NgModuleFactory<any>|NgModuleType>();\n\n/**\n * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n * @publicApi\n */\nexport function registerModuleFactory(id: string, factory: NgModuleFactory<any>) {\n const existing = modules.get(id) as NgModuleFactory<any>;\n assertNotExisting(id, existing && existing.moduleType);\n modules.set(id, factory);\n}\n\nfunction assertNotExisting(id: string, type: Type<any>| null): void {\n if (type) {\n throw new Error(\n `Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n\nexport function registerNgModuleType(id: string, ngModuleType: NgModuleType) {\n const existing = modules.get(id) as NgModuleType | null;\n assertNotExisting(id, existing);\n modules.set(id, ngModuleType);\n}\n\nexport function clearModulesForTest(): void {\n modules.clear();\n}\n\nexport function getModuleFactory__PRE_R3__(id: string): NgModuleFactory<any> {\n const factory = modules.get(id) as NgModuleFactory<any>| null;\n if (!factory) throw noModuleError(id);\n return factory;\n}\n\nexport function getModuleFactory__POST_R3__(id: string): NgModuleFactory<any> {\n const type = modules.get(id) as NgModuleType | null;\n if (!type) throw noModuleError(id);\n return new R3NgModuleFactory(type);\n}\n\n/**\n * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n * cannot be found.\n * @publicApi\n */\nexport const getModuleFactory: (id: string) => NgModuleFactory<any> = getModuleFactory__PRE_R3__;\n\nfunction noModuleError(id: string, ): Error {\n return new Error(`No module with ID ${id} loaded`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nexport const Type = Function;\n\nexport function isType(v: any): v is Type<any> {\n return typeof v === 'function';\n}\n\nexport interface Type<T> extends Function { new (...args: any[]): T; }\n\nexport type Mutable<T extends{[x: string]: any}, K extends string> = {\n [P in K]: T[P];\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type, isType} from '../type';\nimport {global, stringify} from '../util';\nimport {ANNOTATIONS, PARAMETERS, PROP_METADATA} from '../util/decorators';\n\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\n\n/**\n * Attention: These regex has to hold even if the code is minified!\n */\nexport const DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*arguments\\)/;\nexport const INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\nexport const INHERITED_CLASS_WITH_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n\nexport class ReflectionCapabilities implements PlatformReflectionCapabilities {\n private _reflect: any;\n\n constructor(reflect?: any) { this._reflect = reflect || global['Reflect']; }\n\n isReflectionEnabled(): boolean { return true; }\n\n factory<T>(t: Type<T>): (args: any[]) => T { return (...args: any[]) => new t(...args); }\n\n /** @internal */\n _zipTypesAndAnnotations(paramTypes: any[], paramAnnotations: any[]): any[][] {\n let result: any[][];\n\n if (typeof paramTypes === 'undefined') {\n result = new Array(paramAnnotations.length);\n } else {\n result = new Array(paramTypes.length);\n }\n\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n\n private _ownParameters(type: Type<any>, parentCtor: any): any[][]|null {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (DELEGATE_CTOR.exec(typeStr) ||\n (INHERITED_CLASS.exec(typeStr) && !INHERITED_CLASS_WITH_CTOR.exec(typeStr))) {\n return null;\n }\n\n // Prefer the direct API.\n if ((<any>type).parameters && (<any>type).parameters !== parentCtor.parameters) {\n return (<any>type).parameters;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = (<any>type).ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters =\n typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(\n (ctorParam: any) =>\n ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && (type as any)[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return new Array((<any>type.length)).fill(undefined);\n }\n\n parameters(type: Type<any>): any[][] {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n\n private _ownAnnotations(typeOrFunc: Type<any>, parentCtor: any): any[]|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).annotations && (<any>typeOrFunc).annotations !== parentCtor.annotations) {\n let annotations = (<any>typeOrFunc).annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).decorators && (<any>typeOrFunc).decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata((<any>typeOrFunc).decorators);\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return (typeOrFunc as any)[ANNOTATIONS];\n }\n return null;\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n\n private _ownPropMetadata(typeOrFunc: any, parentCtor: any): {[key: string]: any[]}|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).propMetadata &&\n (<any>typeOrFunc).propMetadata !== parentCtor.propMetadata) {\n let propMetadata = (<any>typeOrFunc).propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).propDecorators &&\n (<any>typeOrFunc).propDecorators !== parentCtor.propDecorators) {\n const propDecorators = (<any>typeOrFunc).propDecorators;\n const propMetadata = <{[key: string]: any[]}>{};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return (typeOrFunc as any)[PROP_METADATA];\n }\n return null;\n }\n\n propMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata: {[key: string]: any[]} = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators: any[] = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return type instanceof Type && lcProperty in type.prototype;\n }\n\n guards(type: any): {[key: string]: any} { return {}; }\n\n getter(name: string): GetterFn { return <GetterFn>new Function('o', 'return o.' + name + ';'); }\n\n setter(name: string): SetterFn {\n return <SetterFn>new Function('o', 'v', 'return o.' + name + ' = v;');\n }\n\n method(name: string): MethodFn {\n const functionBody = `if (!o.${name}) throw new Error('\"${name}\" is undefined');\n return o.${name}.apply(o, args);`;\n return <MethodFn>new Function('o', 'args', functionBody);\n }\n\n // There is not a concept of import uri in Js, but this is useful in developing Dart applications.\n importUri(type: any): string {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }\n\n resourceUri(type: any): string { return `./${stringify(type)}`; }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return runtime;\n }\n resolveEnum(enumIdentifier: any, name: string): any { return enumIdentifier[name]; }\n}\n\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\n\nfunction getParentCtor(ctor: Function): Type<any> {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Host, Inject, Optional, Self, SkipSelf} from '../../di/metadata';\nimport {Attribute} from '../../metadata/di';\nimport {ReflectionCapabilities} from '../../reflection/reflection_capabilities';\nimport {Type} from '../../type';\n\nimport {CompilerFacade, R3DependencyMetadataFacade, getCompilerFacade} from './compiler_facade';\n\nlet _reflect: ReflectionCapabilities|null = null;\n\nexport function getReflect(): ReflectionCapabilities {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\n\nexport function reflectDependencies(type: Type<any>): R3DependencyMetadataFacade[] {\n return convertDependencies(getReflect().parameters(type));\n}\n\nexport function convertDependencies(deps: any[]): R3DependencyMetadataFacade[] {\n const compiler = getCompilerFacade();\n return deps.map(dep => reflectDependency(compiler, dep));\n}\n\nfunction reflectDependency(compiler: CompilerFacade, dep: any | any[]): R3DependencyMetadataFacade {\n const meta: R3DependencyMetadataFacade = {\n token: null,\n host: false,\n optional: false,\n resolved: compiler.R3ResolvedDependencyType.Token,\n self: false,\n skipSelf: false,\n };\n\n function setTokenAndResolvedType(token: any): void {\n meta.resolved = compiler.R3ResolvedDependencyType.Token;\n meta.token = token;\n }\n\n if (Array.isArray(dep)) {\n if (dep.length === 0) {\n throw new Error('Dependency array must have arguments.');\n }\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n } else if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || param.__proto__.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || param.__proto__.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || param.__proto__.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new Error(`Attribute name must be defined.`);\n }\n meta.token = param.attributeName;\n meta.resolved = compiler.R3ResolvedDependencyType.Attribute;\n } else {\n setTokenAndResolvedType(param);\n }\n }\n } else {\n setTokenAndResolvedType(dep);\n }\n return meta;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {resolveForwardRef} from '../../di/forward_ref';\nimport {registerNgModuleType} from '../../linker/ng_module_factory_loader';\nimport {Component} from '../../metadata';\nimport {ModuleWithProviders, NgModule, NgModuleDef, NgModuleTransitiveScopes} from '../../metadata/ng_module';\nimport {Type} from '../../type';\nimport {assertDefined} from '../assert';\nimport {getComponentDef, getDirectiveDef, getNgModuleDef, getPipeDef} from '../definition';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_INJECTOR_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from '../fields';\nimport {ComponentDef} from '../interfaces/definition';\nimport {NgModuleType} from '../ng_module_ref';\nimport {stringify} from '../util';\n\nimport {R3InjectorMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {reflectDependencies} from './util';\n\nconst EMPTY_ARRAY: Type<any>[] = [];\n\ninterface ModuleQueueItem {\n moduleType: Type<any>;\n ngModule: NgModule;\n}\n\nconst moduleQueue: ModuleQueueItem[] = [];\n\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType: Type<any>, ngModule: NgModule) {\n moduleQueue.push({moduleType, ngModule});\n}\n\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nexport function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const {moduleType, ngModule} = moduleQueue[i];\n\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n}\n\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration: any[] | Type<any>): boolean {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nexport function compileNgModule(moduleType: Type<any>, ngModule: NgModule = {}): void {\n compileNgModuleDefs(moduleType as NgModuleType, ngModule);\n\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n\n/**\n * Compiles and adds the `ngModuleDef` and `ngInjectorDef` properties to the module class.\n */\nexport function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule): void {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations: Type<any>[] = flatten(ngModule.declarations || EMPTY_ARRAY);\n\n let ngModuleDef: any = null;\n Object.defineProperty(moduleType, NG_MODULE_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n ngModuleDef = getCompilerFacade().compileNgModule(\n angularCoreEnv, `ng://${moduleType.name}/ngModuleDef.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY, resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY, resolveForwardRef)\n .map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY, resolveForwardRef)\n .map(expandModuleWithProviders),\n emitInline: true,\n });\n }\n return ngModuleDef;\n }\n });\n if (ngModule.id) {\n registerNgModuleType(ngModule.id, moduleType);\n }\n\n let ngInjectorDef: any = null;\n Object.defineProperty(moduleType, NG_INJECTOR_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType as any as NgModuleType);\n const meta: R3InjectorMetadataFacade = {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [\n (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),\n (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),\n ],\n };\n ngInjectorDef = getCompilerFacade().compileInjector(\n angularCoreEnv, `ng://${moduleType.name}/ngInjectorDef.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nfunction verifySemanticsOfNgModuleDef(moduleType: NgModuleType): void {\n if (verifiedNgModule.get(moduleType)) return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n const ngModuleDef = getNgModuleDef(moduleType, true);\n const errors: string[] = [];\n ngModuleDef.declarations.forEach(verifyDeclarationsHaveDefinitions);\n const combinedDeclarations: Type<any>[] = [\n ...ngModuleDef.declarations.map(resolveForwardRef), //\n ...flatten(ngModuleDef.imports.map(computeCombinedExports), resolveForwardRef),\n ];\n ngModuleDef.exports.forEach(verifyExportsAreDeclaredOrReExported);\n ngModuleDef.declarations.forEach(verifyDeclarationIsUnique);\n ngModuleDef.declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);\n\n const ngModule = getAnnotation<NgModule>(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports &&\n flatten(ngModule.imports, unwrapModuleWithProvidersImports)\n .forEach(verifySemanticsOfNgModuleDef);\n ngModule.bootstrap && ngModule.bootstrap.forEach(verifyComponentIsPartOfNgModule);\n ngModule.entryComponents && ngModule.entryComponents.forEach(verifyComponentIsPartOfNgModule);\n }\n\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type: Type<any>): void {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);\n if (!def) {\n errors.push(\n `Unexpected value '${stringify(type)}' declared by the module '${stringify(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n\n function verifyExportsAreDeclaredOrReExported(type: Type<any>) {\n type = resolveForwardRef(type);\n const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' ||\n getPipeDef(type) && 'pipe';\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(\n `Can't export ${kind} ${stringify(type)} from ${stringify(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n\n function verifyDeclarationIsUnique(type: Type<any>) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n const modules = [existingModule, moduleType].map(stringify).sort();\n errors.push(\n `Type ${stringify(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` +\n `Please consider moving ${stringify(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` +\n `You can also create a new NgModule that exports and includes ${stringify(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n } else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n\n function verifyComponentIsPartOfNgModule(type: Type<any>) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule) {\n errors.push(\n `Component ${stringify(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n\n function verifyComponentEntryComponentsIsPartOfNgModule(type: Type<any>) {\n type = resolveForwardRef(type);\n if (getComponentDef(type)) {\n // We know we are component\n const component = getAnnotation<Component>(type, 'Component');\n if (component && component.entryComponents) {\n component.entryComponents.forEach(verifyComponentIsPartOfNgModule);\n }\n }\n }\n}\n\nfunction unwrapModuleWithProvidersImports(\n typeOrWithProviders: NgModuleType<any>| {ngModule: NgModuleType<any>}): NgModuleType<any> {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return (typeOrWithProviders as any).ngModule || typeOrWithProviders;\n}\n\nfunction getAnnotation<T>(type: any, name: string): T|null {\n let annotation: T|null = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n\n function collect(annotations: any[] | null) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n\n function readAnnotation(\n decorator: {type: {prototype: {ngMetadataName: string}, args: any[]}, args: any}): void {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator as any;\n } else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new Map<Type<any>, NgModuleType<any>>();\nlet verifiedNgModule = new Map<NgModuleType<any>, boolean>();\n\nexport function resetCompiledComponents(): void {\n ownerNgModule = new Map<Type<any>, NgModuleType<any>>();\n verifiedNgModule = new Map<NgModuleType<any>, boolean>();\n moduleQueue.length = 0;\n}\n\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited\n * by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type: Type<any>): Type<any>[] {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type, true);\n return [...flatten(ngModuleDef.exports.map((type) => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type as any as NgModuleType);\n return computeCombinedExports(type);\n } else {\n return type;\n }\n }))];\n}\n\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ngComponentDef set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType: Type<any>, ngModule: NgModule) {\n const declarations: Type<any>[] = flatten(ngModule.declarations || EMPTY_ARRAY);\n\n const transitiveScopes = transitiveScopesFor(moduleType);\n\n declarations.forEach(declaration => {\n if (declaration.hasOwnProperty(NG_COMPONENT_DEF)) {\n // An `ngComponentDef` field exists - go ahead and patch the component directly.\n const component = declaration as Type<any>& {ngComponentDef: ComponentDef<any>};\n const componentDef = getComponentDef(component) !;\n patchComponentDefWithScope(componentDef, transitiveScopes);\n } else if (\n !declaration.hasOwnProperty(NG_DIRECTIVE_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n (declaration as Type<any>& {ngSelectorScope?: any}).ngSelectorScope = moduleType;\n }\n });\n}\n\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nexport function patchComponentDefWithScope<C>(\n componentDef: ComponentDef<C>, transitiveScopes: NgModuleTransitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives)\n .map(dir => getDirectiveDef(dir) || getComponentDef(dir) !)\n .filter(def => !!def);\n componentDef.pipeDefs = () =>\n Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef(pipe) !);\n}\n\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.\n *\n * This operation is memoized and the result is cached on the module's definition. It can be called\n * on modules with components that have not fully compiled yet, but the result should not be used\n * until they have.\n */\nexport function transitiveScopesFor<T>(moduleType: Type<T>): NgModuleTransitiveScopes {\n if (!isNgModule(moduleType)) {\n throw new Error(`${moduleType.name} does not have an ngModuleDef`);\n }\n const def = getNgModuleDef(moduleType) !;\n\n if (def.transitiveCompileScopes !== null) {\n return def.transitiveCompileScopes;\n }\n\n const scopes: NgModuleTransitiveScopes = {\n compilation: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n exported: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n };\n\n def.declarations.forEach(declared => {\n const declaredWithDefs = declared as Type<any>& { ngPipeDef?: any; };\n\n if (getPipeDef(declaredWithDefs)) {\n scopes.compilation.pipes.add(declared);\n } else {\n // Either declared has an ngComponentDef or ngDirectiveDef, or it's a component which hasn't\n // had its template compiled yet. In either case, it gets added to the compilation's\n // directives.\n scopes.compilation.directives.add(declared);\n }\n });\n\n def.imports.forEach(<I>(imported: Type<I>) => {\n const importedTyped = imported as Type<I>& {\n // If imported is an @NgModule:\n ngModuleDef?: NgModuleDef<I>;\n };\n\n if (!isNgModule<I>(importedTyped)) {\n throw new Error(`Importing ${importedTyped.name} which does not have an ngModuleDef`);\n }\n\n // When this module imports another, the imported module's exported directives and pipes are\n // added to the compilation scope of this module.\n const importedScope = transitiveScopesFor(importedTyped);\n importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));\n importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));\n });\n\n def.exports.forEach(<E>(exported: Type<E>) => {\n const exportedTyped = exported as Type<E>& {\n // Components, Directives, NgModules, and Pipes can all be exported.\n ngComponentDef?: any;\n ngDirectiveDef?: any;\n ngModuleDef?: NgModuleDef<E>;\n ngPipeDef?: any;\n };\n\n // Either the type is a module, a pipe, or a component/directive (which may not have an\n // ngComponentDef as it might be compiled asynchronously).\n if (isNgModule(exportedTyped)) {\n // When this module exports another, the exported module's exported directives and pipes are\n // added to both the compilation and exported scopes of this module.\n const exportedScope = transitiveScopesFor(exportedTyped);\n exportedScope.exported.directives.forEach(entry => {\n scopes.compilation.directives.add(entry);\n scopes.exported.directives.add(entry);\n });\n exportedScope.exported.pipes.forEach(entry => {\n scopes.compilation.pipes.add(entry);\n scopes.exported.pipes.add(entry);\n });\n } else if (getPipeDef(exportedTyped)) {\n scopes.exported.pipes.add(exportedTyped);\n } else {\n scopes.exported.directives.add(exportedTyped);\n }\n });\n\n def.transitiveCompileScopes = scopes;\n return scopes;\n}\n\nfunction flatten<T>(values: any[], mapFn?: (value: T) => any): Type<T>[] {\n const out: Type<T>[] = [];\n values.forEach(value => {\n if (Array.isArray(value)) {\n out.push(...flatten<T>(value, mapFn));\n } else {\n out.push(mapFn ? mapFn(value) : value);\n }\n });\n return out;\n}\n\nfunction expandModuleWithProviders(value: Type<any>| ModuleWithProviders<{}>): Type<any> {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\nfunction isModuleWithProviders(value: any): value is ModuleWithProviders<{}> {\n return (value as{ngModule?: any}).ngModule !== undefined;\n}\n\nfunction isNgModule<T>(value: Type<T>): value is Type<T>&{ngModuleDef: NgModuleDef<T>} {\n return !!getNgModuleDef(value);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentType} from '..';\nimport {resolveForwardRef} from '../../di/forward_ref';\nimport {Query} from '../../metadata/di';\nimport {Component, Directive} from '../../metadata/directives';\nimport {componentNeedsResolution, maybeQueueResolutionOfComponentResources} from '../../metadata/resource_loading';\nimport {ViewEncapsulation} from '../../metadata/view';\nimport {Type} from '../../type';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF} from '../fields';\nimport {stringify} from '../util';\n\nimport {R3DirectiveMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {R3ComponentMetadataFacade, R3QueryMetadataFacade} from './compiler_facade_interface';\nimport {angularCoreEnv} from './environment';\nimport {flushModuleScopingQueueAsMuchAsPossible, patchComponentDefWithScope, transitiveScopesFor} from './module';\nimport {getReflect, reflectDependencies} from './util';\n\n\n\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * ngComponentDef onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ngComponentDef`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nexport function compileComponent(type: Type<any>, metadata: Component): void {\n let ngComponentDef: any = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(metadata);\n Object.defineProperty(type, NG_COMPONENT_DEF, {\n get: () => {\n const compiler = getCompilerFacade();\n if (ngComponentDef === null) {\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${stringify(type)}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${stringify(metadata.templateUrl)}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n\n const meta: R3ComponentMetadataFacade = {\n ...directiveMetadata(type, metadata),\n template: metadata.template || '',\n preserveWhitespaces: metadata.preserveWhitespaces || false,\n styles: metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n viewQueries: extractQueriesMetadata(type, getReflect().propMetadata(type), isViewQuery),\n directives: [],\n changeDetection: metadata.changeDetection,\n pipes: new Map(),\n encapsulation: metadata.encapsulation || ViewEncapsulation.Emulated,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null,\n };\n ngComponentDef = compiler.compileComponent(\n angularCoreEnv, `ng://${stringify(type)}/template.html`, meta);\n\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n }\n return ngComponentDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nfunction hasSelectorScope<T>(component: Type<T>): component is Type<T>&\n {ngSelectorScope: Type<any>} {\n return (component as{ngSelectorScope?: any}).ngSelectorScope !== undefined;\n}\n\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * ngDirectiveDef onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nexport function compileDirective(type: Type<any>, directive: Directive): void {\n let ngDirectiveDef: any = null;\n Object.defineProperty(type, NG_DIRECTIVE_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n const facade = directiveMetadata(type as ComponentType<any>, directive);\n ngDirectiveDef = getCompilerFacade().compileDirective(\n angularCoreEnv, `ng://${type && type.name}/ngDirectiveDef.js`, facade);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nexport function extendsDirectlyFromObject(type: Type<any>): boolean {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMetadataFacade {\n // Reflect inputs and outputs.\n const propMetadata = getReflect().propMetadata(type);\n\n return {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n selector: metadata.selector !,\n deps: reflectDependencies(type),\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: {\n usesOnChanges: type.prototype.ngOnChanges !== undefined,\n },\n typeSourceSpan: null !,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: metadata.exportAs || null,\n providers: metadata.providers || null,\n };\n}\n\nfunction convertToR3QueryPredicate(selector: any): any|string[] {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\n\nexport function convertToR3QueryMetadata(propertyName: string, ann: Query): R3QueryMetadataFacade {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null\n };\n}\nfunction extractQueriesMetadata(\n type: Type<any>, propMetadata: {[key: string]: any[]},\n isQueryAnn: (ann: any) => ann is Query): R3QueryMetadataFacade[] {\n const queriesMeta: R3QueryMetadataFacade[] = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n propMetadata[field].forEach(ann => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(\n `Can't construct a query for the property \"${field}\" of ` +\n `\"${stringify(type)}\" since the query selector wasn't defined.`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\n\nfunction isContentQuery(value: any): value is Query {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\n\nfunction isViewQuery(value: any): value is Query {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\n\nfunction splitByComma(value: string): string[] {\n return value.split(',').map(piece => piece.trim());\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Pipe} from '../../metadata/directives';\nimport {Type} from '../../type';\nimport {NG_PIPE_DEF} from '../fields';\nimport {stringify} from '../util';\n\nimport {getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {reflectDependencies} from './util';\n\nexport function compilePipe(type: Type<any>, meta: Pipe): void {\n let ngPipeDef: any = null;\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n ngPipeDef = getCompilerFacade().compilePipe(\n angularCoreEnv, `ng://${stringify(type)}/ngPipeDef.js`, {\n type: type,\n name: type.name,\n deps: reflectDependencies(type),\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true\n });\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {Provider} from '../di';\nimport {NG_BASE_DEF} from '../render3/fields';\nimport {compileComponent as render3CompileComponent, compileDirective as render3CompileDirective} from '../render3/jit/directive';\nimport {compilePipe as render3CompilePipe} from '../render3/jit/pipe';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator, makePropDecorator} from '../util/decorators';\nimport {noop} from '../util/noop';\nimport {fillProperties} from '../util/property';\n\nimport {ViewEncapsulation} from './view';\n\n\n\n/**\n * Type of the Directive decorator / constructor function.\n * @publicApi\n */\nexport interface DirectiveDecorator {\n /**\n * Marks a class as an Angular directive. You can define your own\n * directives to attach custom behavior to elements in the DOM.\n * The options provide configuration metadata that determines\n * how the directive should be processed, instantiated and used at\n * runtime.\n *\n * Directive classes, like component classes, can implement\n * [life-cycle hooks](guide/lifecycle-hooks) to influence their configuration and behavior.\n *\n *\n * @usageNotes\n * To define a directive, mark the class with the decorator and provide metadata.\n *\n * ```\n * import {Directive} from '@angular/core';\n *\n * @Directive({\n * selector: 'my-directive',\n * })\n * export class MyDirective {\n * ...\n * }\n * ```\n *\n * ### Declaring directives\n *\n * Directives are [declarables](guide/glossary#declarable).\n * They must be declared by an NgModule\n * in order to be usable in an app.\n *\n * A directive must belong to exactly one NgModule. Do not re-declare\n * a directive imported from another module.\n * List the directive class in the `declarations` field of an NgModule.\n *\n * ```\n * declarations: [\n * AppComponent,\n * MyDirective\n * ],\n * ```\n *\n * @Annotation\n */\n (obj: Directive): TypeDecorator;\n\n /**\n * See the `Directive` decorator.\n */\n new (obj: Directive): Directive;\n}\n\n/**\n * Directive decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport interface Directive {\n /**\n * The CSS selector that identifies this directive in a template\n * and triggers instantiation of the directive.\n *\n * Declare as one of the following:\n *\n * - `element-name`: Select by element name.\n * - `.class`: Select by class name.\n * - `[attribute]`: Select by attribute name.\n * - `[attribute=value]`: Select by attribute name and value.\n * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: Select if either `selector1` or `selector2` matches.\n *\n * Angular only allows directives to apply on CSS selectors that do not cross\n * element boundaries.\n *\n * For the following template HTML, a directive with an `input[type=text]` selector,\n * would be instantiated only on the `<input type=\"text\">` element.\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n */\n selector?: string;\n\n /**\n * Enumerates the set of data-bound input properties for a directive\n *\n * Angular automatically updates input properties during change detection.\n * The `inputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property where the value is written.\n * - `bindingProperty` specifies the DOM property where the value is read from.\n *\n * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.\n * @usageNotes\n *\n * ### Example\n *\n * The following example creates a component with two data-bound properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * inputs: ['bankName', 'id: account-id'],\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * bankName: string;\n * id: string;\n *\n * ```\n *\n */\n inputs?: string[];\n\n /**\n * Enumerates the set of event-bound output properties.\n *\n * When an output property emits an event, an event handler attached to that event\n * in the template is invoked.\n *\n * The `outputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the DOM property the event handler is attached to.\n *\n * @usageNotes\n *\n * ### Example\n *\n * ```typescript\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n *\n */\n outputs?: string[];\n\n /**\n * Configures the [injector](guide/glossary#injector) of this\n * directive or component with a [token](guide/glossary#di-token)\n * that maps to a [provider](guide/glossary#provider) of a dependency.\n */\n providers?: Provider[];\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * @usageNotes\n *\n * ### Simple Example\n *\n * ```\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n *\n */\n exportAs?: string;\n\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * @usageNotes\n *\n * ### Example\n *\n * The following example shows how queries are defined\n * and when their results are available in lifecycle hooks:\n *\n * ```\n * @Component({\n * selector: 'someDir',\n * queries: {\n * contentChildren: new ContentChildren(ChildDirective),\n * viewChildren: new ViewChildren(ChildDirective)\n * },\n * template: '<child-directive></child-directive>'\n * })\n * class SomeDir {\n * contentChildren: QueryList<ChildDirective>,\n * viewChildren: QueryList<ChildDirective>\n *\n * ngAfterContentInit() {\n * // contentChildren is set\n * }\n *\n * ngAfterViewInit() {\n * // viewChildren is set\n * }\n * }\n * ```\n *\n * @Annotation\n */\n queries?: {[key: string]: any};\n\n /**\n * Maps class properties to host element bindings for properties,\n * attributes, and events, using a set of key-value pairs.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, Angular updates the directive's host element.\n *\n * When the key is a property of the host element, the property value is\n * the propagated to the specified DOM property.\n *\n * When the key is a static attribute in the DOM, the attribute value\n * is propagated to the specified property in the host element.\n *\n * For event handling:\n * - The key is the DOM event that the directive listens to.\n * To listen to global events, add the target to the event name.\n * The target can be `window`, `document` or `body`.\n * - The value is the statement to execute when the event occurs. If the\n * statement evalueates to `false`, then `preventDefault` is applied on the DOM\n * event. A handler method can refer to the `$event` local variable.\n *\n */\n host?: {[key: string]: string};\n\n /**\n * If true, this directive/component will be skipped by the AOT compiler and so will always be\n * compiled using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nexport const Directive: DirectiveDecorator = makeDecorator(\n 'Directive', (dir: Directive = {}) => dir, undefined, undefined,\n (type: Type<any>, meta: Directive) => SWITCH_COMPILE_DIRECTIVE(type, meta));\n\n/**\n * Component decorator interface\n *\n * @publicApi\n */\nexport interface ComponentDecorator {\n /**\n * Decorator that marks a class as an Angular component and provides configuration\n * metadata that determines how the component should be processed,\n * instantiated, and used at runtime.\n *\n * Components are the most basic UI building block of an Angular app.\n * An Angular app contains a tree of Angular components.\n *\n * Angular components are a subset of directives, always associated with a template.\n * Unlike other directives, only one component can be instantiated per an element in a template.\n *\n * A component must belong to an NgModule in order for it to be available\n * to another component or application. To make it a member of an NgModule,\n * list it in the `declarations` field of the `@NgModule` metadata.\n *\n * Note that, in addition to these options for configuring a directive,\n * you can control a component's runtime behavior by implementing\n * life-cycle hooks. For more information, see the\n * [Lifecycle Hooks](guide/lifecycle-hooks) guide.\n *\n * @usageNotes\n *\n * ### Setting component inputs\n *\n * The following example creates a component with two data-bound properties,\n * specified by the `inputs` value.\n *\n * <code-example path=\"core/ts/metadata/directives.ts\" region=\"component-input\">\n * </code-example>\n *\n *\n * ### Setting component outputs\n *\n * The following example shows two event emitters that emit on an interval. One\n * emits an output every second, while the other emits every five seconds.\n *\n * {@example core/ts/metadata/directives.ts region='component-output-interval'}\n *\n * ### Injecting a class with a view provider\n *\n * The following simple example injects a class into a component\n * using the view provider specified in component metadata:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'needs-greeter'\n * })\n * class NeedsGreeter {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n *\n * @Component({\n * selector: 'greet',\n * viewProviders: [\n * Greeter\n * ],\n * template: `<needs-greeter></needs-greeter>`\n * })\n * class HelloWorld {\n * }\n *\n * ```\n *\n * ### Preserving whitespace\n *\n * Removing whitespace can greatly reduce AOT-generated code size and speed up view creation.\n * As of Angular 6, the default for `preserveWhitespaces` is false (whitespace is removed).\n * To change the default setting for all components in your application, set\n * the `preserveWhitespaces` option of the AOT compiler.\n *\n * By default, the AOT compiler removes whitespace characters as follows:\n * * Trims all whitespaces at the beginning and the end of a template.\n * * Removes whitespace-only text nodes. For example,\n *\n * ```\n * <button>Action 1</button> <button>Action 2</button>\n * ```\n *\n * becomes:\n *\n * ```\n * <button>Action 1</button><button>Action 2</button>\n * ```\n *\n * * Replaces a series of whitespace characters in text nodes with a single space.\n * For example, `<span>\\n some text\\n</span>` becomes `<span> some text </span>`.\n * * Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,\n * where whitespace characters are significant.\n *\n * Note that these transformations can influence DOM nodes layout, although impact\n * should be minimal.\n *\n * You can override the default behavior to preserve whitespace characters\n * in certain fragments of a template. For example, you can exclude an entire\n * DOM sub-tree by using the `ngPreserveWhitespaces` attribute:\n *\n * ```html\n * <div ngPreserveWhitespaces>\n * whitespaces are preserved here\n * <span> and here </span>\n * </div>\n * ```\n *\n * You can force a single space to be preserved in a text node by using `&ngsp;`,\n * which is replaced with a space character by Angular's template\n * compiler:\n *\n * ```html\n * <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * Note that sequences of `&ngsp;` are still collapsed to just one space character when\n * the `preserveWhitespaces` option is set to `false`.\n *\n * ```html\n * <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * To preserve sequences of whitespace characters, use the\n * `ngPreserveWhitespaces` attribute.\n *\n * @Annotation\n */\n (obj: Component): TypeDecorator;\n /**\n * See the `@Component` decorator.\n */\n new (obj: Component): Component;\n}\n\n/**\n * Supplies configuration metadata for an Angular component.\n *\n * @publicApi\n */\nexport interface Component extends Directive {\n /**\n * The change-detection strategy to use for this component.\n *\n * When a component is instantiated, Angular creates a change detector,\n * which is responsible for propagating the component's bindings.\n * The strategy is one of:\n * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).\n * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n * See [example](#injecting-a-class-with-a-view-provider).\n *\n */\n viewProviders?: Provider[];\n\n /**\n * The module ID of the module that contains the component.\n * The component must be able to resolve relative URLs for templates and styles.\n * SystemJS exposes the `__moduleName` variable within each module.\n * In CommonJS, this can be set to `module.id`.\n *\n */\n moduleId?: string;\n\n /**\n * The relative path or absolute URL of a template file for an Angular component.\n * If provided, do not supply an inline template using `template`.\n *\n */\n templateUrl?: string;\n\n /**\n * An inline template for an Angular component. If provided,\n * do not supply a template file using `templateUrl`.\n *\n */\n template?: string;\n\n /**\n * One or more relative paths or absolute URLs for files containing CSS stylesheets to use\n * in this component.\n */\n styleUrls?: string[];\n\n /**\n * One or more inline CSS stylesheets to use\n * in this component.\n */\n styles?: string[];\n\n /**\n * One or more animation `trigger()` calls, containing\n * `state()` and `transition()` definitions.\n * See the [Animations guide](/guide/animations) and animations API documentation.\n *\n */\n animations?: any[];\n\n /**\n * An encapsulation policy for the template and CSS styles. One of:\n * - `ViewEncapsulation.Native`: Use shadow roots. This works\n * only if natively available on the platform.\n * - `ViewEncapsulation.Emulated`: Use shimmed CSS that\n * emulates the native behavior.\n * - `ViewEncapsulation.None`: Use global CSS without any\n * encapsulation.\n *\n * If not supplied, the value is taken from `CompilerOptions`. The default compiler option is\n * `ViewEncapsulation.Emulated`.\n *\n * If the policy is set to `ViewEncapsulation.Emulated` and the component has no `styles`\n * or `styleUrls` specified, the policy is automatically switched to `ViewEncapsulation.None`.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Overrides the default encapsulation start and end delimiters (`{{` and `}}`)\n */\n interpolation?: [string, string];\n\n /**\n * A set of components that should be compiled along with\n * this component. For each component listed here,\n * Angular creates a {@link ComponentFactory} and stores it in the\n * {@link ComponentFactoryResolver}.\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * True to preserve or false to remove potentially superfluous whitespace characters\n * from the compiled template. Whitespace characters are those matching the `\\s`\n * character class in JavaScript regular expressions. Default is false, unless\n * overridden in compiler options.\n */\n preserveWhitespaces?: boolean;\n}\n\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Component: ComponentDecorator = makeDecorator(\n 'Component', (c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Default, ...c}),\n Directive, undefined,\n (type: Type<any>, meta: Component) => SWITCH_COMPILE_COMPONENT(type, meta));\n\n/**\n * Type of the Pipe decorator / constructor function.\n *\n * @publicApi\n */\nexport interface PipeDecorator {\n /**\n * Declares a reusable pipe function, and supplies configuration metadata.\n *\n */\n (obj: Pipe): TypeDecorator;\n\n /**\n * See the `Pipe` decorator.\n */\n new (obj: Pipe): Pipe;\n}\n\n/**\n * Type of the Pipe metadata.\n *\n * @publicApi\n */\nexport interface Pipe {\n /**\n * The pipe name to use in template bindings.\n *\n */\n name: string;\n\n /**\n * When true, the pipe is pure, meaning that the\n * `transform()` method is invoked only when its input arguments\n * change. Pipes are pure by default.\n *\n * If the pipe has internal state (that is, the result\n * depends on state other than its arguments), set `pure` to false.\n * In this case, the pipe is invoked on each change-detection cycle,\n * even if the arguments have not changed.\n */\n pure?: boolean;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Pipe: PipeDecorator = makeDecorator(\n 'Pipe', (p: Pipe) => ({pure: true, ...p}), undefined, undefined,\n (type: Type<any>, meta: Pipe) => SWITCH_COMPILE_PIPE(type, meta));\n\n\n/**\n * @publicApi\n */\nexport interface InputDecorator {\n /**\n * Decorator that marks a class as pipe and supplies configuration metadata.\n *\n * A pipe class must implement the `PipeTransform` interface.\n * For example, if the name is \"myPipe\", use a template binding expression\n * such as the following:\n *\n * ```\n * {{ exp | myPipe }}\n * ```\n *\n * The result of the expression is passed to the pipe's `transform()` method.\n *\n * A pipe must belong to an NgModule in order for it to be available\n * to a template. To make it a member of an NgModule,\n * list it in the `declarations` field of the `@NgModule` metadata.\n *\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of metadata for an `Input` property.\n *\n * @publicApi\n */\nexport interface Input {\n /**\n * Decorator that marks a class field as an input property and supplies configuration metadata.\n * Declares a data-bound input property, which Angular automatically updates\n * during change detection.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for input binding.\n *\n * The following example creates a component with two input properties,\n * one of which is given a special binding name.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * // This property is bound using its original name.\n * @Input() bankName: string;\n * // this property value is bound to a different property name\n * // when this component is instantiated in a template.\n * @Input('account-id') id: string;\n *\n * // this property is not bound, and is not automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bankName=\"RBC\" account-id=\"4747\"></bank-account>\n * `\n * })\n *\n * class App {}\n * ```\n *\n */\n bindingPropertyName?: string;\n}\n\nconst initializeBaseDef = (target: any): void => {\n const constructor = target.constructor;\n const inheritedBaseDef = constructor.ngBaseDef;\n\n const baseDef = constructor.ngBaseDef = {\n inputs: {},\n outputs: {},\n declaredInputs: {},\n };\n\n if (inheritedBaseDef) {\n fillProperties(baseDef.inputs, inheritedBaseDef.inputs);\n fillProperties(baseDef.outputs, inheritedBaseDef.outputs);\n fillProperties(baseDef.declaredInputs, inheritedBaseDef.declaredInputs);\n }\n};\n\n/**\n * Does the work of creating the `ngBaseDef` property for the @Input and @Output decorators.\n * @param key \"inputs\" or \"outputs\"\n */\nconst updateBaseDefFromIOProp = (getProp: (baseDef: {inputs?: any, outputs?: any}) => any) =>\n (target: any, name: string, ...args: any[]) => {\n const constructor = target.constructor;\n\n if (!constructor.hasOwnProperty(NG_BASE_DEF)) {\n initializeBaseDef(target);\n }\n\n const baseDef = constructor.ngBaseDef;\n const defProp = getProp(baseDef);\n defProp[name] = args[0];\n };\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Input: InputDecorator = makePropDecorator(\n 'Input', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined,\n updateBaseDefFromIOProp(baseDef => baseDef.inputs || {}));\n\n/**\n * Type of the Output decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OutputDecorator {\n /**\n * Decorator that marks a class field as an output property and supplies configuration metadata.\n * Declares a data-bound output property, which Angular automatically updates\n * during change detection.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for output binding.\n *\n * See `@Input` decorator for an example of providing a binding name.\n *\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of the Output metadata.\n *\n * @publicApi\n */\nexport interface Output { bindingPropertyName?: string; }\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Output: OutputDecorator = makePropDecorator(\n 'Output', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined,\n updateBaseDefFromIOProp(baseDef => baseDef.outputs || {}));\n\n\n\n/**\n * Type of the HostBinding decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostBindingDecorator {\n /**\n * Decorator that marks a DOM property as a host-binding property and supplies configuration\n * metadata.\n * Angular automatically checks host property bindings during change detection, and\n * if a binding changes it updates the host element of the directive.\n *\n * @usageNotes\n *\n * The following example creates a directive that sets the `valid` and `invalid`\n * properties on the DOM element that has an `ngModel` directive on it.\n *\n * ```typescript\n * @Directive({selector: '[ngModel]'})\n * class NgModelStatus {\n * constructor(public control: NgModel) {}\n * @HostBinding('class.valid') get valid() { return this.control.valid; }\n * @HostBinding('class.invalid') get invalid() { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * })\n * class App {\n * prop;\n * }\n * ```\n *\n */\n (hostPropertyName?: string): any;\n new (hostPropertyName?: string): any;\n}\n\n/**\n * Type of the HostBinding metadata.\n *\n * @publicApi\n */\nexport interface HostBinding { hostPropertyName?: string; }\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const HostBinding: HostBindingDecorator =\n makePropDecorator('HostBinding', (hostPropertyName?: string) => ({hostPropertyName}));\n\n\n/**\n * Type of the HostListener decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostListenerDecorator {\n (eventName: string, args?: string[]): any;\n new (eventName: string, args?: string[]): any;\n}\n\n/**\n * Type of the HostListener metadata.\n *\n * @publicApi\n */\nexport interface HostListener {\n /**\n * The CSS event to listen for.\n */\n eventName?: string;\n /**\n * A set of arguments to pass to the handler method when the event occurs.\n */\n args?: string[];\n}\n\n/**\n * Binds a CSS event to a host listener and supplies configuration metadata.\n * Angular invokes the supplied handler method when the host element emits the specified event,\n * and updates the bound element with the result.\n * If the handler method returns false, applies `preventDefault` on the bound element.\n *\n * @usageNotes\n *\n * The following example declares a directive\n * that attaches a click listener to a button and counts clicks.\n *\n * ```\n * @Directive({selector: 'button[counting]'})\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * @HostListener('click', ['$event.target'])\n * onClick(btn) {\n * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: '<button counting>Increment</button>',\n * })\n * class App {}\n * ```\n *\n * @Annotation\n * @publicApi\n */\nexport const HostListener: HostListenerDecorator =\n makePropDecorator('HostListener', (eventName?: string, args?: string[]) => ({eventName, args}));\n\n\n\nexport const SWITCH_COMPILE_COMPONENT__POST_R3__ = render3CompileComponent;\nexport const SWITCH_COMPILE_DIRECTIVE__POST_R3__ = render3CompileDirective;\nexport const SWITCH_COMPILE_PIPE__POST_R3__ = render3CompilePipe;\n\nconst SWITCH_COMPILE_COMPONENT__PRE_R3__ = noop;\nconst SWITCH_COMPILE_DIRECTIVE__PRE_R3__ = noop;\nconst SWITCH_COMPILE_PIPE__PRE_R3__ = noop;\n\nconst SWITCH_COMPILE_COMPONENT: typeof render3CompileComponent = SWITCH_COMPILE_COMPONENT__PRE_R3__;\nconst SWITCH_COMPILE_DIRECTIVE: typeof render3CompileDirective = SWITCH_COMPILE_DIRECTIVE__PRE_R3__;\nconst SWITCH_COMPILE_PIPE: typeof render3CompilePipe = SWITCH_COMPILE_PIPE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {getClosureSafeProperty} from '../util/property';\n\nimport {inject, injectArgs} from './injector_compatibility';\nimport {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\nconst USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\nconst EMPTY_ARRAY: any[] = [];\n\nexport function convertInjectableProviderToFactory(\n type: Type<any>, provider?: ValueSansProvider | ExistingSansProvider | StaticClassSansProvider |\n ConstructorSansProvider | FactorySansProvider | ClassSansProvider): () => any {\n if (!provider) {\n const reflectionCapabilities = new ReflectionCapabilities();\n const deps = reflectionCapabilities.parameters(type);\n // TODO - convert to flags.\n return () => new type(...injectArgs(deps as any[]));\n }\n\n if (USE_VALUE in provider) {\n const valueProvider = (provider as ValueSansProvider);\n return () => valueProvider.useValue;\n } else if ((provider as ExistingSansProvider).useExisting) {\n const existingProvider = (provider as ExistingSansProvider);\n return () => inject(existingProvider.useExisting);\n } else if ((provider as FactorySansProvider).useFactory) {\n const factoryProvider = (provider as FactorySansProvider);\n return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY));\n } else if ((provider as StaticClassSansProvider | ClassSansProvider).useClass) {\n const classProvider = (provider as StaticClassSansProvider | ClassSansProvider);\n let deps = (provider as StaticClassSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new classProvider.useClass(...injectArgs(deps));\n } else {\n let deps = (provider as ConstructorSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new type(...injectArgs(deps !));\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {InjectorType, defineInjector} from '../di/defs';\nimport {Provider} from '../di/provider';\nimport {convertInjectableProviderToFactory} from '../di/util';\nimport {NgModuleType} from '../render3';\nimport {compileNgModule as render3CompileNgModule} from '../render3/jit/module';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator} from '../util/decorators';\n\n/**\n * Represents the expansion of an `NgModule` into its scopes.\n *\n * A scope is a set of directives and pipes that are visible in a particular context. Each\n * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will\n * be recognized in the templates of components declared by the module. The `exported` scope is the\n * set of directives and pipes exported by a module (that is, module B's exported scope gets added\n * to module A's compilation scope when module A imports B).\n */\nexport interface NgModuleTransitiveScopes {\n compilation: {directives: Set<any>; pipes: Set<any>;};\n exported: {directives: Set<any>; pipes: Set<any>;};\n}\n\nexport type NgModuleDefWithMeta<T, Declarations, Imports, Exports> = NgModuleDef<T>;\n\n/**\n * Runtime link information for NgModules.\n *\n * This is the internal data structure used by the runtime to assemble components, directives,\n * pipes, and injectors.\n *\n * NOTE: Always use `defineNgModule` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n */\nexport interface NgModuleDef<T> {\n /** Token representing the module. Used by DI. */\n type: T;\n\n /** List of components to bootstrap. */\n bootstrap: Type<any>[];\n\n /** List of components, directives, and pipes declared by this module. */\n declarations: Type<any>[];\n\n /** List of modules or `ModuleWithProviders` imported by this module. */\n imports: Type<any>[];\n\n /**\n * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this\n * module.\n */\n exports: Type<any>[];\n\n /**\n * Cached value of computed `transitiveCompileScopes` for this module.\n *\n * This should never be read directly, but accessed via `transitiveScopesFor`.\n */\n transitiveCompileScopes: NgModuleTransitiveScopes|null;\n}\n\n/**\n * A wrapper around an NgModule that associates it with the providers.\n *\n * @param T the module type. In Ivy applications, this must be explicitly\n * provided.\n *\n * @publicApi\n */\nexport interface ModuleWithProviders<\n T = any /** TODO(alxhub): remove default when callers pass explicit type param */> {\n ngModule: Type<T>;\n providers?: Provider[];\n}\n\n/**\n * A schema definition associated with an NgModule.\n *\n * @see `@NgModule`, `CUSTOM_ELEMENTS_SCHEMA`, `NO_ERRORS_SCHEMA`\n *\n * @param name The name of a defined schema.\n *\n * @publicApi\n */\nexport interface SchemaMetadata { name: string; }\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nexport const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata = {\n name: 'custom-elements'\n};\n\n/**\n * Defines a schema that allows any property on any element.\n *\n * @publicApi\n */\nexport const NO_ERRORS_SCHEMA: SchemaMetadata = {\n name: 'no-errors-schema'\n};\n\n\n/**\n * Type of the NgModule decorator / constructor function.\n */\nexport interface NgModuleDecorator {\n /**\n * Marks a class as an NgModule and supplies configuration metadata.\n */\n (obj?: NgModule): TypeDecorator;\n new (obj?: NgModule): NgModule;\n}\n\n/**\n * Type of the NgModule metadata.\n *\n * @publicApi\n */\nexport interface NgModule {\n /**\n * The set of injectable objects that are available in the injector\n * of this module.\n *\n * @see [Dependency Injection guide](guide/dependency-injection)\n * @see [NgModule guide](guide/providers)\n *\n * @usageNotes\n *\n * Dependencies whose providers are listed here become available for injection\n * into any component, directive, pipe or service that is a child of this injector.\n * The NgModule used for bootstrapping uses the root injector, and can provide dependencies\n * to any part of the app.\n *\n * A lazy-loaded module has its own injector, typically a child of the app root injector.\n * Lazy-loaded services are scoped to the lazy-loaded module's injector.\n * If a lazy-loaded module also provides the `UserService`, any component created\n * within that module's context (such as by router navigation) gets the local instance\n * of the service, not the instance in the root injector.\n * Components in external modules continue to receive the instance provided by their injectors.\n *\n * ### Example\n *\n * The following example defines a class that is injected in\n * the HelloWorld NgModule:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @NgModule({\n * providers: [\n * Greeter\n * ]\n * })\n * class HelloWorld {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n * ```\n */\n providers?: Provider[];\n\n /**\n * The set of components, directives, and pipes ([declarables](guide/glossary#declarable))\n * that belong to this module.\n *\n * @usageNotes\n *\n * The set of selectors that are available to a template include those declared here, and\n * those that are exported from imported NgModules.\n *\n * Declarables must belong to exactly one module.\n * The compiler emits an error if you try to declare the same class in more than one module.\n * Be careful not to declare a class that is imported from another module.\n *\n * ### Example\n *\n * The following example allows the CommonModule to use the `NgFor`\n * directive.\n *\n * ```javascript\n * @NgModule({\n * declarations: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n declarations?: Array<Type<any>|any[]>;\n\n /**\n * The set of NgModules whose exported [declarables](guide/glossary#declarable)\n * are available to templates in this module.\n *\n * @usageNotes\n *\n * A template can use exported declarables from any\n * imported module, including those from modules that are imported indirectly\n * and re-exported.\n * For example, `ModuleA` imports `ModuleB`, and also exports\n * it, which makes the declarables from `ModuleB` available\n * wherever `ModuleA` is imported.\n *\n * ### Example\n *\n * The following example allows MainModule to use anthing exported by\n * `CommonModule`:\n *\n * ```javascript\n * @NgModule({\n * imports: [CommonModule]\n * })\n * class MainModule {\n * }\n * ```\n *\n */\n imports?: Array<Type<any>|ModuleWithProviders<{}>|any[]>;\n\n /**\n * The set of components, directives, and pipes declared in this\n * NgModule that can be used in the template of any component that is part of an\n * NgModule that imports this NgModule. Exported declarations are the module's public API.\n *\n * A declarable belongs to one and only one NgModule.\n * A module can list another module among its exports, in which case all of that module's\n * public declaration are exported.\n *\n * @usageNotes\n *\n * Declarations are private by default.\n * If this ModuleA does not export UserComponent, then only the components within this\n * ModuleA can use UserComponent.\n *\n * ModuleA can import ModuleB and also export it, making exports from ModuleB\n * available to an NgModule that imports ModuleA.\n *\n * ### Example\n *\n * The following example exports the `NgFor` directive from CommonModule.\n *\n * ```javascript\n * @NgModule({\n * exports: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n exports?: Array<Type<any>|any[]>;\n\n /**\n * The set of components to compile when this NgModule is defined,\n * so that they can be dynamically loaded into the view.\n *\n * For each component listed here, Angular creates a `ComponentFactory`\n * and stores it in the `ComponentFactoryResolver`.\n *\n * Angular automatically adds components in the module's bootstrap\n * and route definitions into the `entryComponents` list. Use this\n * option to add components that are bootstrapped\n * using one of the imperative techniques, such as `ViewContainerRef.createComponent()`.\n *\n * @see [Entry Components](guide/entry-components)\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * The set of components that are bootstrapped when\n * this module is bootstrapped. The components listed here\n * are automatically added to `entryComponents`.\n */\n bootstrap?: Array<Type<any>|any[]>;\n\n /**\n * The set of schemas that declare elements to be allowed in the NgModule.\n * Elements and properties that are neither Angular components nor directives\n * must be declared in a schema.\n *\n * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.\n *\n * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`\n * you must ensure that allowed elements and properties securely escape inputs.\n */\n schemas?: Array<SchemaMetadata|any[]>;\n\n /**\n * A name or path that uniquely identifies this NgModule in `getModuleFactory`.\n * If left `undefined`, the NgModule is not registered with\n * `getModuleFactory`.\n */\n id?: string;\n\n /**\n * If true, this module will be skipped by the AOT compiler and so will always be compiled\n * using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const NgModule: NgModuleDecorator = makeDecorator(\n 'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined,\n /**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` and `entryComponents` options configure the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n (type: NgModuleType, meta: NgModule) => SWITCH_COMPILE_NGMODULE(type, meta));\n\n/**\n * @description\n * Hook for manual bootstrapping of the application instead of using bootstrap array in @NgModule\n * annotation.\n *\n * Reference to the current application is provided as a parameter.\n *\n * See [\"Bootstrapping\"](guide/bootstrapping) and [\"Entry components\"](guide/entry-components).\n *\n * @usageNotes\n * ```typescript\n * class AppModule implements DoBootstrap {\n * ngDoBootstrap(appRef: ApplicationRef) {\n * appRef.bootstrap(AppComponent); // Or some other component\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport interface DoBootstrap { ngDoBootstrap(appRef: ApplicationRef): void; }\n\nfunction preR3NgModuleCompile(moduleType: InjectorType<any>, metadata: NgModule): void {\n let imports = (metadata && metadata.imports) || [];\n if (metadata && metadata.exports) {\n imports = [...imports, metadata.exports];\n }\n\n moduleType.ngInjectorDef = defineInjector({\n factory: convertInjectableProviderToFactory(moduleType, {useClass: moduleType}),\n providers: metadata && metadata.providers,\n imports: imports,\n });\n}\n\n\nexport const SWITCH_COMPILE_NGMODULE__POST_R3__ = render3CompileNgModule;\nconst SWITCH_COMPILE_NGMODULE__PRE_R3__ = preR3NgModuleCompile;\nconst SWITCH_COMPILE_NGMODULE: typeof render3CompileNgModule = SWITCH_COMPILE_NGMODULE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This indirection is needed to free up Component, etc symbols in the public API\n * to be used by the decorator versions of these annotations.\n */\n\nimport {Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren} from './metadata/di';\nimport {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';\nimport {DoBootstrap, ModuleWithProviders, NgModule, SchemaMetadata} from './metadata/ng_module';\nimport {ViewEncapsulation} from './metadata/view';\n\nexport {ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildDecorator, ContentChildren, ContentChildrenDecorator, Query, ViewChild, ViewChildDecorator, ViewChildren, ViewChildrenDecorator} from './metadata/di';\nexport {Component, ComponentDecorator, Directive, DirectiveDecorator, HostBinding, HostBindingDecorator, HostListener, HostListenerDecorator, Input, InputDecorator, Output, OutputDecorator, Pipe, PipeDecorator} from './metadata/directives';\nexport {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from './metadata/lifecycle_hooks';\nexport {CUSTOM_ELEMENTS_SCHEMA, DoBootstrap, ModuleWithProviders, NO_ERRORS_SCHEMA, NgModule, SchemaMetadata} from './metadata/ng_module';\nexport {ViewEncapsulation} from './metadata/view';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../../di/injectable';\nimport {ClassSansProvider, ExistingSansProvider, FactorySansProvider, ValueProvider, ValueSansProvider} from '../../di/provider';\nimport {Type} from '../../type';\nimport {getClosureSafeProperty} from '../../util/property';\nimport {NG_INJECTABLE_DEF} from '../fields';\n\nimport {R3InjectableMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {convertDependencies, reflectDependencies} from './util';\n\n\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * `ngInjectableDef` onto the injectable type.\n */\nexport function compileInjectable(type: Type<any>, srcMeta?: Injectable): void {\n let def: any = null;\n\n // if NG_INJECTABLE_DEF is already defined on this class then don't overwrite it\n if (type.hasOwnProperty(NG_INJECTABLE_DEF)) return;\n\n Object.defineProperty(type, NG_INJECTABLE_DEF, {\n get: () => {\n if (def === null) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta: Injectable = srcMeta || {providedIn: null};\n const hasAProvider = isUseClassProvider(meta) || isUseFactoryProvider(meta) ||\n isUseValueProvider(meta) || isUseExistingProvider(meta);\n\n\n const compilerMeta: R3InjectableMetadataFacade = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn,\n ctorDeps: reflectDependencies(type),\n userDeps: undefined\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.userDeps = convertDependencies(meta.deps);\n }\n if (!hasAProvider) {\n // In the case the user specifies a type provider, treat it as {provide: X, useClass: X}.\n // The deps will have been reflected above, causing the factory to create the class by\n // calling\n // its constructor with injected deps.\n compilerMeta.useClass = type;\n } else if (isUseClassProvider(meta)) {\n // The user explicitly specified useClass, and may or may not have provided deps.\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n // The user explicitly specified useValue.\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n // The user explicitly specified useFactory.\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n // The user explicitly specified useExisting.\n compilerMeta.useExisting = meta.useExisting;\n } else {\n // Can't happen - either hasAProvider will be false, or one of the providers will be set.\n throw new Error(`Unreachable state.`);\n }\n def = getCompilerFacade().compileInjectable(\n angularCoreEnv, `ng://${type.name}/ngInjectableDef.js`, compilerMeta);\n }\n return def;\n },\n });\n}\n\ntype UseClassProvider = Injectable & ClassSansProvider & {deps?: any[]};\n\nconst USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\n\nfunction isUseClassProvider(meta: Injectable): meta is UseClassProvider {\n return (meta as UseClassProvider).useClass !== undefined;\n}\n\nfunction isUseValueProvider(meta: Injectable): meta is Injectable&ValueSansProvider {\n return USE_VALUE in meta;\n}\n\nfunction isUseFactoryProvider(meta: Injectable): meta is Injectable&FactorySansProvider {\n return (meta as FactorySansProvider).useFactory !== undefined;\n}\n\nfunction isUseExistingProvider(meta: Injectable): meta is Injectable&ExistingSansProvider {\n return (meta as ExistingSansProvider).useExisting !== undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {compileInjectable as render3CompileInjectable} from '../render3/jit/injectable';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator} from '../util/decorators';\n\nimport {InjectableDef, InjectableType, defineInjectable, getInjectableDef} from './defs';\nimport {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueSansProvider} from './provider';\nimport {convertInjectableProviderToFactory} from './util';\n\n\n/**\n * Injectable providers used in `@Injectable` decorator.\n *\n * @publicApi\n */\nexport type InjectableProvider = ValueSansProvider | ExistingSansProvider |\n StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;\n\n/**\n * Type of the Injectable decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectableDecorator {\n /**\n * Marks a class as available to `Injector` for creation.\n *\n * @see [Introduction to Services and DI](guide/architecture-services)\n * @see [Dependency Injection Guide](guide/dependency-injection)\n *\n * @usageNotes\n *\n * The following example shows how service classes are properly marked as\n * injectable.\n *\n * {@example core/di/ts/metadata_spec.ts region='Injectable'}\n *\n * `Injector` throws an error if it tries to instantiate a class that\n * is not decorated with `@Injectable`, as shown in the following example.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}\n *\n */\n (): TypeDecorator;\n (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): TypeDecorator;\n new (): Injectable;\n new (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): Injectable;\n}\n\n/**\n * Type of the Injectable metadata.\n *\n * @publicApi\n */\nexport interface Injectable {\n /**\n * Determines which injectors will provide the injectable,\n * by either associating it with an @NgModule or other `InjectorType`,\n * or by specifying that this injectable should be provided in the\n * 'root' injector, which will be the application-level injector in most apps.\n */\n providedIn?: Type<any>|'root'|null;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Injectable: InjectableDecorator = makeDecorator(\n 'Injectable', undefined, undefined, undefined,\n (type: Type<any>, meta: Injectable) => SWITCH_COMPILE_INJECTABLE(type as any, meta));\n\n/**\n * Type representing injectable service.\n *\n * @publicApi\n */\nexport interface InjectableType<T> extends Type<T> { ngInjectableDef: InjectableDef<T>; }\n\n/**\n * Supports @Injectable() in JIT mode for Render2.\n */\nfunction render2CompileInjectable(\n injectableType: InjectableType<any>,\n options: {providedIn?: Type<any>| 'root' | null} & InjectableProvider): void {\n if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) {\n injectableType.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn,\n factory: convertInjectableProviderToFactory(injectableType, options),\n });\n }\n}\n\nexport const SWITCH_COMPILE_INJECTABLE__POST_R3__ = render3CompileInjectable;\nconst SWITCH_COMPILE_INJECTABLE__PRE_R3__ = render2CompileInjectable;\nconst SWITCH_COMPILE_INJECTABLE: typeof render3CompileInjectable =\n SWITCH_COMPILE_INJECTABLE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DebugContext} from './view';\n\nexport const ERROR_TYPE = 'ngType';\nexport const ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nexport const ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nexport const ERROR_LOGGER = 'ngErrorLogger';\n\n\nexport function getType(error: Error): Function {\n return (error as any)[ERROR_TYPE];\n}\n\nexport function getDebugContext(error: Error): DebugContext {\n return (error as any)[ERROR_DEBUG_CONTEXT];\n}\n\nexport function getOriginalError(error: Error): Error {\n return (error as any)[ERROR_ORIGINAL_ERROR];\n}\n\nexport function getErrorLogger(error: Error): (console: Console, ...values: any[]) => void {\n return (error as any)[ERROR_LOGGER] || defaultErrorLogger;\n}\n\n\nfunction defaultErrorLogger(console: Console, ...values: any[]) {\n (<any>console.error)(...values);\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_ORIGINAL_ERROR, getDebugContext, getErrorLogger, getOriginalError} from './errors';\n\n\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nexport class ErrorHandler {\n /**\n * @internal\n */\n _console: Console = console;\n\n handleError(error: any): void {\n const originalError = this._findOriginalError(error);\n const context = this._findContext(error);\n // Note: Browser consoles show the place from where console.error was called.\n // We can use this to give users additional information about the error.\n const errorLogger = getErrorLogger(error);\n\n errorLogger(this._console, `ERROR`, error);\n if (originalError) {\n errorLogger(this._console, `ORIGINAL ERROR`, originalError);\n }\n if (context) {\n errorLogger(this._console, 'ERROR CONTEXT', context);\n }\n }\n\n /** @internal */\n _findContext(error: any): any {\n if (error) {\n return getDebugContext(error) ? getDebugContext(error) :\n this._findContext(getOriginalError(error));\n }\n\n return null;\n }\n\n /** @internal */\n _findOriginalError(error: Error): any {\n let e = getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n\n return e;\n }\n}\n\nexport function wrappedError(message: string, originalError: any): Error {\n const msg =\n `${message} caused by: ${originalError instanceof Error ? originalError.message: originalError }`;\n const error = Error(msg);\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {wrappedError} from '../error_handler';\nimport {ERROR_ORIGINAL_ERROR, getOriginalError} from '../errors';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ReflectiveInjector} from './reflective_injector';\nimport {ReflectiveKey} from './reflective_key';\n\nfunction findFirstClosedCycle(keys: any[]): any[] {\n const res: any[] = [];\n for (let i = 0; i < keys.length; ++i) {\n if (res.indexOf(keys[i]) > -1) {\n res.push(keys[i]);\n return res;\n }\n res.push(keys[i]);\n }\n return res;\n}\n\nfunction constructResolvingPath(keys: any[]): string {\n if (keys.length > 1) {\n const reversed = findFirstClosedCycle(keys.slice().reverse());\n const tokenStrs = reversed.map(k => stringify(k.token));\n return ' (' + tokenStrs.join(' -> ') + ')';\n }\n\n return '';\n}\n\nexport interface InjectionError extends Error {\n keys: ReflectiveKey[];\n injectors: ReflectiveInjector[];\n constructResolvingMessage: (keys: ReflectiveKey[]) => string;\n addKey(injector: ReflectiveInjector, key: ReflectiveKey): void;\n}\n\nfunction injectionError(\n injector: ReflectiveInjector, key: ReflectiveKey,\n constructResolvingMessage: (keys: ReflectiveKey[]) => string,\n originalError?: Error): InjectionError {\n const keys = [key];\n const errMsg = constructResolvingMessage(keys);\n const error =\n (originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;\n error.addKey = addKey;\n error.keys = keys;\n error.injectors = [injector];\n error.constructResolvingMessage = constructResolvingMessage;\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n\nfunction addKey(this: InjectionError, injector: ReflectiveInjector, key: ReflectiveKey): void {\n this.injectors.push(injector);\n this.keys.push(key);\n // Note: This updated message won't be reflected in the `.stack` property\n this.message = this.constructResolvingMessage(this.keys);\n}\n\n/**\n * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the\n * {@link Injector} does not have a {@link Provider} for the given key.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b:B) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n */\nexport function noProviderError(injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `No provider for ${first}!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when dependencies form a cycle.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * var injector = Injector.resolveAndCreate([\n * {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n * {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n * ]);\n *\n * expect(() => injector.get(\"one\")).toThrowError();\n * ```\n *\n * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n */\nexport function cyclicDependencyError(\n injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when a constructing type returns with an Error.\n *\n * The `InstantiationError` class contains the original error plus the dependency graph which caused\n * this object to be instantiated.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor() {\n * throw new Error('message');\n * }\n * }\n *\n * var injector = Injector.resolveAndCreate([A]);\n\n * try {\n * injector.get(A);\n * } catch (e) {\n * expect(e instanceof InstantiationError).toBe(true);\n * expect(e.originalException.message).toEqual(\"message\");\n * expect(e.originalStack).toBeDefined();\n * }\n * ```\n */\nexport function instantiationError(\n injector: ReflectiveInjector, originalException: any, originalStack: any,\n key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `${originalException.message}: Error during instantiation of ${first}!${constructResolvingPath(keys)}.`;\n }, originalException);\n}\n\n/**\n * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}\n * creation.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n * ```\n */\nexport function invalidProviderError(provider: any) {\n return Error(\n `Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`);\n}\n\n/**\n * Thrown when the class has no annotation information.\n *\n * Lack of annotation information prevents the {@link Injector} from determining which dependencies\n * need to be injected into the constructor.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n *\n * This error is also thrown when the class not marked with {@link Injectable} has parameter types.\n *\n * ```typescript\n * class B {}\n *\n * class A {\n * constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n * }\n *\n * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n * ```\n *\n */\nexport function noAnnotationError(typeOrFunc: Type<any>| Function, params: any[][]): Error {\n const signature: string[] = [];\n for (let i = 0, ii = params.length; i < ii; i++) {\n const parameter = params[i];\n if (!parameter || parameter.length == 0) {\n signature.push('?');\n } else {\n signature.push(parameter.map(stringify).join(' '));\n }\n }\n return Error(\n 'Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n signature.join(', ') + '). ' +\n 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n}\n\n/**\n * Thrown when getting an object by index.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {}\n *\n * var injector = Injector.resolveAndCreate([A]);\n *\n * expect(() => injector.getAt(100)).toThrowError();\n * ```\n *\n */\nexport function outOfBoundsError(index: number) {\n return Error(`Index ${index} is out-of-bounds.`);\n}\n\n// TODO: add a working example after alpha38 is released\n/**\n * Thrown when a multi provider and a regular provider are bound to the same token.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\n * { provide: \"Strings\", useValue: \"string1\", multi: true},\n * { provide: \"Strings\", useValue: \"string2\", multi: false}\n * ])).toThrowError();\n * ```\n */\nexport function mixingMultiProvidersWithRegularProvidersError(\n provider1: any, provider2: any): Error {\n return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {stringify} from '../util';\nimport {resolveForwardRef} from './forward_ref';\n\n\n/**\n * A unique object used for retrieving items from the {@link ReflectiveInjector}.\n *\n * Keys have:\n * - a system-wide unique `id`.\n * - a `token`.\n *\n * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows\n * the\n * injector to store created objects in a more efficient way.\n *\n * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when\n * resolving\n * providers.\n *\n * @deprecated No replacement\n * @publicApi\n */\nexport class ReflectiveKey {\n public readonly displayName: string;\n /**\n * Private\n */\n constructor(public token: Object, public id: number) {\n if (!token) {\n throw new Error('Token must be defined!');\n }\n this.displayName = stringify(this.token);\n }\n\n /**\n * Retrieves a `Key` for a token.\n */\n static get(token: Object): ReflectiveKey {\n return _globalKeyRegistry.get(resolveForwardRef(token));\n }\n\n /**\n * @returns the number of keys registered in the system.\n */\n static get numberOfKeys(): number { return _globalKeyRegistry.numberOfKeys; }\n}\n\nexport class KeyRegistry {\n private _allKeys = new Map<Object, ReflectiveKey>();\n\n get(token: Object): ReflectiveKey {\n if (token instanceof ReflectiveKey) return token;\n\n if (this._allKeys.has(token)) {\n return this._allKeys.get(token) !;\n }\n\n const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n this._allKeys.set(token, newKey);\n return newKey;\n }\n\n get numberOfKeys(): number { return this._allKeys.size; }\n}\n\nconst _globalKeyRegistry = new KeyRegistry();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\nexport {PlatformReflectionCapabilities};\nexport {GetterFn, MethodFn, SetterFn};\n\n/**\n * Provides access to reflection data about symbols. Used internally by Angular\n * to power dependency injection and compilation.\n */\nexport class Reflector {\n constructor(public reflectionCapabilities: PlatformReflectionCapabilities) {}\n\n updateCapabilities(caps: PlatformReflectionCapabilities) { this.reflectionCapabilities = caps; }\n\n factory(type: Type<any>): Function { return this.reflectionCapabilities.factory(type); }\n\n parameters(typeOrFunc: Type<any>): any[][] {\n return this.reflectionCapabilities.parameters(typeOrFunc);\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n return this.reflectionCapabilities.annotations(typeOrFunc);\n }\n\n propMetadata(typeOrFunc: Type<any>): {[key: string]: any[]} {\n return this.reflectionCapabilities.propMetadata(typeOrFunc);\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n }\n\n getter(name: string): GetterFn { return this.reflectionCapabilities.getter(name); }\n\n setter(name: string): SetterFn { return this.reflectionCapabilities.setter(name); }\n\n method(name: string): MethodFn { return this.reflectionCapabilities.method(name); }\n\n importUri(type: any): string { return this.reflectionCapabilities.importUri(type); }\n\n resourceUri(type: any): string { return this.reflectionCapabilities.resourceUri(type); }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);\n }\n\n resolveEnum(identifier: any, name: string): any {\n return this.reflectionCapabilities.resolveEnum(identifier, name);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ReflectionCapabilities} from './reflection_capabilities';\nimport {Reflector} from './reflector';\n\nexport {Reflector} from './reflector';\n\n/**\n * The {@link Reflector} used internally in Angular to access metadata\n * about symbols.\n */\nexport const reflector = new Reflector(new ReflectionCapabilities());\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {reflector} from '../reflection/reflection';\nimport {Type} from '../type';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './provider';\nimport {invalidProviderError, mixingMultiProvidersWithRegularProvidersError, noAnnotationError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\n\n\ninterface NormalizedProvider extends TypeProvider, ValueProvider, ClassProvider, ExistingProvider,\n FactoryProvider {}\n\n/**\n * `Dependency` is used by the framework to extend DI.\n * This is internal to Angular and should not be used directly.\n */\nexport class ReflectiveDependency {\n constructor(\n public key: ReflectiveKey, public optional: boolean, public visibility: Self|SkipSelf|null) {}\n\n static fromKey(key: ReflectiveKey): ReflectiveDependency {\n return new ReflectiveDependency(key, false, null);\n }\n}\n\nconst _EMPTY_LIST: any[] = [];\n\n/**\n * An internal resolved representation of a `Provider` used by the `Injector`.\n *\n * @usageNotes\n * This is usually created automatically by `Injector.resolveAndCreate`.\n *\n * It can be created manually, as follows:\n *\n * ### Example\n *\n * ```typescript\n * var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);\n * var injector = Injector.fromResolvedProviders(resolvedProviders);\n *\n * expect(injector.get('message')).toEqual('Hello');\n * ```\n *\n * @publicApi\n */\nexport interface ResolvedReflectiveProvider {\n /**\n * A key, usually a `Type<any>`.\n */\n key: ReflectiveKey;\n\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n resolvedFactories: ResolvedReflectiveFactory[];\n\n /**\n * Indicates if the provider is a multi-provider or a regular provider.\n */\n multiProvider: boolean;\n}\n\nexport class ResolvedReflectiveProvider_ implements ResolvedReflectiveProvider {\n readonly resolvedFactory: ResolvedReflectiveFactory;\n\n constructor(\n public key: ReflectiveKey, public resolvedFactories: ResolvedReflectiveFactory[],\n public multiProvider: boolean) {\n this.resolvedFactory = this.resolvedFactories[0];\n }\n}\n\n/**\n * An internal resolved representation of a factory function created by resolving `Provider`.\n * @publicApi\n */\nexport class ResolvedReflectiveFactory {\n constructor(\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n public factory: Function,\n\n /**\n * Arguments (dependencies) to the `factory` function.\n */\n public dependencies: ReflectiveDependency[]) {}\n}\n\n\n/**\n * Resolve a single provider.\n */\nfunction resolveReflectiveFactory(provider: NormalizedProvider): ResolvedReflectiveFactory {\n let factoryFn: Function;\n let resolvedDeps: ReflectiveDependency[];\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n } else if (provider.useExisting) {\n factoryFn = (aliasInstance: any) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n } else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n } else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}\n\n/**\n * Converts the `Provider` into `ResolvedProvider`.\n *\n * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider\n * syntax.\n */\nfunction resolveReflectiveProvider(provider: NormalizedProvider): ResolvedReflectiveProvider {\n return new ResolvedReflectiveProvider_(\n ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)],\n provider.multi || false);\n}\n\n/**\n * Resolve a list of Providers.\n */\nexport function resolveReflectiveProviders(providers: Provider[]): ResolvedReflectiveProvider[] {\n const normalized = _normalizeProviders(providers, []);\n const resolved = normalized.map(resolveReflectiveProvider);\n const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}\n\n/**\n * Merges a list of ResolvedProviders into a list where each key is contained exactly once and\n * multi providers have been merged.\n */\nexport function mergeResolvedReflectiveProviders(\n providers: ResolvedReflectiveProvider[],\n normalizedProvidersMap: Map<number, ResolvedReflectiveProvider>):\n Map<number, ResolvedReflectiveProvider> {\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const existing = normalizedProvidersMap.get(provider.key.id);\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n if (provider.multiProvider) {\n for (let j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n let resolvedProvider: ResolvedReflectiveProvider;\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(\n provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n return normalizedProvidersMap;\n}\n\nfunction _normalizeProviders(providers: Provider[], res: Provider[]): Provider[] {\n providers.forEach(b => {\n if (b instanceof Type) {\n res.push({provide: b, useClass: b});\n\n } else if (b && typeof b == 'object' && (b as any).provide !== undefined) {\n res.push(b as NormalizedProvider);\n\n } else if (b instanceof Array) {\n _normalizeProviders(b, res);\n\n } else {\n throw invalidProviderError(b);\n }\n });\n\n return res;\n}\n\nexport function constructDependencies(\n typeOrFunc: any, dependencies?: any[]): ReflectiveDependency[] {\n if (!dependencies) {\n return _dependenciesFor(typeOrFunc);\n } else {\n const params: any[][] = dependencies.map(t => [t]);\n return dependencies.map(t => _extractToken(typeOrFunc, t, params));\n }\n}\n\nfunction _dependenciesFor(typeOrFunc: any): ReflectiveDependency[] {\n const params = reflector.parameters(typeOrFunc);\n\n if (!params) return [];\n if (params.some(p => p == null)) {\n throw noAnnotationError(typeOrFunc, params);\n }\n return params.map(p => _extractToken(typeOrFunc, p, params));\n}\n\nfunction _extractToken(\n typeOrFunc: any, metadata: any[] | any, params: any[][]): ReflectiveDependency {\n let token: any = null;\n let optional = false;\n\n if (!Array.isArray(metadata)) {\n if (metadata instanceof Inject) {\n return _createDependency(metadata.token, optional, null);\n } else {\n return _createDependency(metadata, optional, null);\n }\n }\n\n let visibility: Self|SkipSelf|null = null;\n\n for (let i = 0; i < metadata.length; ++i) {\n const paramMetadata = metadata[i];\n\n if (paramMetadata instanceof Type) {\n token = paramMetadata;\n\n } else if (paramMetadata instanceof Inject) {\n token = paramMetadata.token;\n\n } else if (paramMetadata instanceof Optional) {\n optional = true;\n\n } else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n visibility = paramMetadata;\n } else if (paramMetadata instanceof InjectionToken) {\n token = paramMetadata;\n }\n }\n\n token = resolveForwardRef(token);\n\n if (token != null) {\n return _createDependency(token, optional, visibility);\n } else {\n throw noAnnotationError(typeOrFunc, params);\n }\n}\n\nfunction _createDependency(\n token: any, optional: boolean, visibility: Self | SkipSelf | null): ReflectiveDependency {\n return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, THROW_IF_NOT_FOUND} from './injector';\nimport {Self, SkipSelf} from './metadata';\nimport {Provider} from './provider';\nimport {cyclicDependencyError, instantiationError, noProviderError, outOfBoundsError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\nimport {ReflectiveDependency, ResolvedReflectiveFactory, ResolvedReflectiveProvider, resolveReflectiveProviders} from './reflective_provider';\n\n// Threshold for the dynamic version\nconst UNDEFINED = new Object();\n\n/**\n * A ReflectiveDependency injection container used for instantiating objects and resolving\n * dependencies.\n *\n * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n * constructor dependencies.\n *\n * In typical use, application code asks for the dependencies in the constructor and they are\n * resolved by the `Injector`.\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates an `Injector` configured to create `Engine` and `Car`.\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * var car = injector.get(Car);\n * expect(car instanceof Car).toBe(true);\n * expect(car.engine instanceof Engine).toBe(true);\n * ```\n *\n * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n * resolve all of the object's dependencies automatically.\n *\n * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.\n * @publicApi\n */\nexport abstract class ReflectiveInjector implements Injector {\n /**\n * Turns an array of provider definitions into an array of resolved providers.\n *\n * A resolution is a process of flattening multiple nested arrays and converting individual\n * providers into an array of `ResolvedReflectiveProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n *\n * expect(providers.length).toEqual(2);\n *\n * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n * expect(providers[0].key.displayName).toBe(\"Car\");\n * expect(providers[0].dependencies.length).toEqual(1);\n * expect(providers[0].factory).toBeDefined();\n *\n * expect(providers[1].key.displayName).toBe(\"Engine\");\n * });\n * ```\n *\n */\n static resolve(providers: Provider[]): ResolvedReflectiveProvider[] {\n return resolveReflectiveProviders(providers);\n }\n\n /**\n * Resolves an array of providers and creates an injector from those providers.\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n }\n\n /**\n * Creates an injector from previously resolved providers.\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, Engine]);\n * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector):\n ReflectiveInjector {\n return new ReflectiveInjector_(providers, parent);\n }\n\n\n /**\n * Parent of this injector.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n */\n abstract get parent(): Injector|null;\n\n /**\n * Resolves an array of providers and creates a child injector from those providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parent = ReflectiveInjector.resolveAndCreate([ParentProvider]);\n * var child = parent.resolveAndCreateChild([ChildProvider]);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;\n\n /**\n * Creates a child injector from previously resolved providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parentProviders = ReflectiveInjector.resolve([ParentProvider]);\n * var childProviders = ReflectiveInjector.resolve([ChildProvider]);\n *\n * var parent = ReflectiveInjector.fromResolvedProviders(parentProviders);\n * var child = parent.createChildFromResolved(childProviders);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;\n\n /**\n * Resolves a provider and instantiates an object in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n *\n * var car = injector.resolveAndInstantiate(Car);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.resolveAndInstantiate(Car));\n * ```\n */\n abstract resolveAndInstantiate(provider: Provider): any;\n\n /**\n * Instantiates an object using a resolved provider in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n * var carProvider = ReflectiveInjector.resolve([Car])[0];\n * var car = injector.instantiateResolved(carProvider);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.instantiateResolved(carProvider));\n * ```\n */\n abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;\n\n abstract get(token: any, notFoundValue?: any): any;\n}\n\nexport class ReflectiveInjector_ implements ReflectiveInjector {\n private static INJECTOR_KEY = ReflectiveKey.get(Injector);\n /** @internal */\n _constructionCounter: number = 0;\n /** @internal */\n public _providers: ResolvedReflectiveProvider[];\n public readonly parent: Injector|null;\n\n keyIds: number[];\n objs: any[];\n /**\n * Private\n */\n constructor(_providers: ResolvedReflectiveProvider[], _parent?: Injector) {\n this._providers = _providers;\n this.parent = _parent || null;\n\n const len = _providers.length;\n\n this.keyIds = new Array(len);\n this.objs = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.keyIds[i] = _providers[i].key.id;\n this.objs[i] = UNDEFINED;\n }\n }\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n }\n\n resolveAndCreateChild(providers: Provider[]): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return this.createChildFromResolved(ResolvedReflectiveProviders);\n }\n\n createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector {\n const inj = new ReflectiveInjector_(providers);\n (inj as{parent: Injector | null}).parent = this;\n return inj;\n }\n\n resolveAndInstantiate(provider: Provider): any {\n return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n }\n\n instantiateResolved(provider: ResolvedReflectiveProvider): any {\n return this._instantiateProvider(provider);\n }\n\n getProviderAtIndex(index: number): ResolvedReflectiveProvider {\n if (index < 0 || index >= this._providers.length) {\n throw outOfBoundsError(index);\n }\n return this._providers[index];\n }\n\n /** @internal */\n _new(provider: ResolvedReflectiveProvider): any {\n if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n throw cyclicDependencyError(this, provider.key);\n }\n return this._instantiateProvider(provider);\n }\n\n private _getMaxNumberOfObjects(): number { return this.objs.length; }\n\n private _instantiateProvider(provider: ResolvedReflectiveProvider): any {\n if (provider.multiProvider) {\n const res = new Array(provider.resolvedFactories.length);\n for (let i = 0; i < provider.resolvedFactories.length; ++i) {\n res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n }\n return res;\n } else {\n return this._instantiate(provider, provider.resolvedFactories[0]);\n }\n }\n\n private _instantiate(\n provider: ResolvedReflectiveProvider,\n ResolvedReflectiveFactory: ResolvedReflectiveFactory): any {\n const factory = ResolvedReflectiveFactory.factory;\n\n let deps: any[];\n try {\n deps =\n ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep));\n } catch (e) {\n if (e.addKey) {\n e.addKey(this, provider.key);\n }\n throw e;\n }\n\n let obj: any;\n try {\n obj = factory(...deps);\n } catch (e) {\n throw instantiationError(this, e, e.stack, provider.key);\n }\n\n return obj;\n }\n\n private _getByReflectiveDependency(dep: ReflectiveDependency): any {\n return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n }\n\n private _getByKey(key: ReflectiveKey, visibility: Self|SkipSelf|null, notFoundValue: any): any {\n if (key === ReflectiveInjector_.INJECTOR_KEY) {\n return this;\n }\n\n if (visibility instanceof Self) {\n return this._getByKeySelf(key, notFoundValue);\n\n } else {\n return this._getByKeyDefault(key, notFoundValue, visibility);\n }\n }\n\n private _getObjByKeyId(keyId: number): any {\n for (let i = 0; i < this.keyIds.length; i++) {\n if (this.keyIds[i] === keyId) {\n if (this.objs[i] === UNDEFINED) {\n this.objs[i] = this._new(this._providers[i]);\n }\n\n return this.objs[i];\n }\n }\n\n return UNDEFINED;\n }\n\n /** @internal */\n _throwOrNull(key: ReflectiveKey, notFoundValue: any): any {\n if (notFoundValue !== THROW_IF_NOT_FOUND) {\n return notFoundValue;\n } else {\n throw noProviderError(this, key);\n }\n }\n\n /** @internal */\n _getByKeySelf(key: ReflectiveKey, notFoundValue: any): any {\n const obj = this._getObjByKeyId(key.id);\n return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n }\n\n /** @internal */\n _getByKeyDefault(key: ReflectiveKey, notFoundValue: any, visibility: Self|SkipSelf|null): any {\n let inj: Injector|null;\n\n if (visibility instanceof SkipSelf) {\n inj = this.parent;\n } else {\n inj = this;\n }\n\n while (inj instanceof ReflectiveInjector_) {\n const inj_ = <ReflectiveInjector_>inj;\n const obj = inj_._getObjByKeyId(key.id);\n if (obj !== UNDEFINED) return obj;\n inj = inj_.parent;\n }\n if (inj !== null) {\n return inj.get(key.token, notFoundValue);\n } else {\n return this._throwOrNull(key, notFoundValue);\n }\n }\n\n get displayName(): string {\n const providers =\n _mapProviders(this, (b: ResolvedReflectiveProvider) => ' \"' + b.key.displayName + '\" ')\n .join(', ');\n return `ReflectiveInjector(providers: [${providers}])`;\n }\n\n toString(): string { return this.displayName; }\n}\n\nfunction _mapProviders(injector: ReflectiveInjector_, fn: Function): any[] {\n const res: any[] = new Array(injector._providers.length);\n for (let i = 0; i < injector._providers.length; ++i) {\n res[i] = fn(injector.getProviderAtIndex(i));\n }\n return res;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\nexport * from './di/metadata';\nexport {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/defs';\nexport {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';\nexport {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable';\nexport {INJECTOR, Injector} from './di/injector';\nexport {inject, InjectFlags} from './di/injector_compatibility';\nexport {ReflectiveInjector} from './di/reflective_injector';\nexport {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './di/provider';\nexport {createInjector} from './di/r3_injector';\nexport {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './di/reflective_provider';\nexport {ReflectiveKey} from './di/reflective_key';\nexport {InjectionToken} from './di/injection_token';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nexport function isPromise(obj: any): obj is Promise<any> {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n\n/**\n * Determine if the argument is an Observable\n */\nexport function isObservable(obj: any | Observable<any>): obj is Observable<any> {\n // TODO: use isObservable once we update pass rxjs 6.1\n // https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\n return !!obj && typeof obj.subscribe === 'function';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isPromise} from '../src/util/lang';\n\nimport {Inject, Injectable, InjectionToken, Optional} from './di';\n\n\n/**\n * A function that will be executed when an application is initialized.\n *\n * @publicApi\n */\nexport const APP_INITIALIZER = new InjectionToken<Array<() => void>>('Application Initializer');\n\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER}s.\n *\n * @publicApi\n */\n@Injectable()\nexport class ApplicationInitStatus {\n // TODO(issue/24571): remove '!'.\n private resolve !: Function;\n // TODO(issue/24571): remove '!'.\n private reject !: Function;\n private initialized = false;\n public readonly donePromise: Promise<any>;\n public readonly done = false;\n\n constructor(@Inject(APP_INITIALIZER) @Optional() private appInits: (() => any)[]) {\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n\n const asyncInitPromises: Promise<any>[] = [];\n\n const complete = () => {\n (this as{done: boolean}).done = true;\n this.resolve();\n };\n\n if (this.appInits) {\n for (let i = 0; i < this.appInits.length; i++) {\n const initResult = this.appInits[i]();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n }\n }\n }\n\n Promise.all(asyncInitPromises).then(() => { complete(); }).catch(e => { this.reject(e); });\n\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './di';\nimport {ComponentRef} from './linker/component_factory';\n\n\n/**\n * A DI Token representing a unique string id assigned to the application by Angular and used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.\n *\n * If you need to avoid randomly generated value to be used as an application id, you can provide\n * a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}\n * using this token.\n * @publicApi\n */\nexport const APP_ID = new InjectionToken<string>('AppId');\n\nexport function _appIdRandomProviderFactory() {\n return `${_randomChar()}${_randomChar()}${_randomChar()}`;\n}\n\n/**\n * Providers that will generate a random APP_ID_TOKEN.\n * @publicApi\n */\nexport const APP_ID_RANDOM_PROVIDER = {\n provide: APP_ID,\n useFactory: _appIdRandomProviderFactory,\n deps: <any[]>[],\n};\n\nfunction _randomChar(): string {\n return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n}\n\n/**\n * A function that will be executed when a platform is initialized.\n * @publicApi\n */\nexport const PLATFORM_INITIALIZER = new InjectionToken<Array<() => void>>('Platform Initializer');\n\n/**\n * A token that indicates an opaque platform id.\n * @publicApi\n */\nexport const PLATFORM_ID = new InjectionToken<Object>('Platform ID');\n\n/**\n * All callbacks provided via this token will be called for every component that is bootstrapped.\n * Signature of the callback:\n *\n * `(componentRef: ComponentRef) => void`.\n *\n * @publicApi\n */\nexport const APP_BOOTSTRAP_LISTENER =\n new InjectionToken<Array<(compRef: ComponentRef<any>) => void>>('appBootstrapListener');\n\n/**\n * A token which indicates the root directory of the application\n * @publicApi\n */\nexport const PACKAGE_ROOT_URL = new InjectionToken<string>('Application Packages Root URL');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from './di';\n\n@Injectable()\nexport class Console {\n log(message: string): void {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message: string): void {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di/injectable';\nimport {InjectionToken} from '../di/injection_token';\nimport {StaticProvider} from '../di/provider';\nimport {MissingTranslationStrategy} from '../i18n/tokens';\nimport {ViewEncapsulation} from '../metadata';\nimport {NgModuleFactory as NgModuleFactoryR3} from '../render3/ng_module_ref';\nimport {Type} from '../type';\n\nimport {ComponentFactory} from './component_factory';\nimport {NgModuleFactory} from './ng_module_factory';\n\n\n\n/**\n * Combination of NgModuleFactory and ComponentFactorys.\n *\n * @publicApi\n */\nexport class ModuleWithComponentFactories<T> {\n constructor(\n public ngModuleFactory: NgModuleFactory<T>,\n public componentFactories: ComponentFactory<any>[]) {}\n}\n\n\nfunction _throwError() {\n throw new Error(`Runtime compiler is not loaded`);\n}\n\nconst Compiler_compileModuleSync__PRE_R3__: <T>(moduleType: Type<T>) => NgModuleFactory<T> =\n _throwError as any;\nexport const Compiler_compileModuleSync__POST_R3__: <T>(moduleType: Type<T>) =>\n NgModuleFactory<T> = function<T>(moduleType: Type<T>): NgModuleFactory<T> {\n return new NgModuleFactoryR3(moduleType);\n};\nconst Compiler_compileModuleSync = Compiler_compileModuleSync__PRE_R3__;\n\nconst Compiler_compileModuleAsync__PRE_R3__: <T>(moduleType: Type<T>) =>\n Promise<NgModuleFactory<T>> = _throwError as any;\nexport const Compiler_compileModuleAsync__POST_R3__: <T>(moduleType: Type<T>) =>\n Promise<NgModuleFactory<T>> = function<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>> {\n return Promise.resolve(Compiler_compileModuleSync__POST_R3__(moduleType));\n};\nconst Compiler_compileModuleAsync = Compiler_compileModuleAsync__PRE_R3__;\n\nconst Compiler_compileModuleAndAllComponentsSync__PRE_R3__: <T>(moduleType: Type<T>) =>\n ModuleWithComponentFactories<T> = _throwError as any;\nexport const Compiler_compileModuleAndAllComponentsSync__POST_R3__: <T>(moduleType: Type<T>) =>\n ModuleWithComponentFactories<T> = function<T>(moduleType: Type<T>):\n ModuleWithComponentFactories<T> {\n return new ModuleWithComponentFactories(Compiler_compileModuleSync__POST_R3__(moduleType), []);\n};\nconst Compiler_compileModuleAndAllComponentsSync =\n Compiler_compileModuleAndAllComponentsSync__PRE_R3__;\n\nconst Compiler_compileModuleAndAllComponentsAsync__PRE_R3__: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = _throwError as any;\nexport const Compiler_compileModuleAndAllComponentsAsync__POST_R3__: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = function<T>(moduleType: Type<T>):\n Promise<ModuleWithComponentFactories<T>> {\n return Promise.resolve(Compiler_compileModuleAndAllComponentsSync__POST_R3__(moduleType));\n};\nconst Compiler_compileModuleAndAllComponentsAsync =\n Compiler_compileModuleAndAllComponentsAsync__PRE_R3__;\n\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n */\n@Injectable()\nexport class Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components listed\n * in `entryComponents` have to be inlined.\n */\n compileModuleSync: <T>(moduleType: Type<T>) => NgModuleFactory<T> = Compiler_compileModuleSync;\n\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync:\n <T>(moduleType: Type<T>) => Promise<NgModuleFactory<T>> = Compiler_compileModuleAsync;\n\n /**\n * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync: <T>(moduleType: Type<T>) => ModuleWithComponentFactories<T> =\n Compiler_compileModuleAndAllComponentsSync;\n\n /**\n * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = Compiler_compileModuleAndAllComponentsAsync;\n\n /**\n * Clears all caches.\n */\n clearCache(): void {}\n\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type: Type<any>) {}\n\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType: Type<any>): string|undefined { return undefined; }\n}\n\n/**\n * Options for creating a compiler\n *\n * @publicApi\n */\nexport type CompilerOptions = {\n useJit?: boolean,\n defaultEncapsulation?: ViewEncapsulation,\n providers?: StaticProvider[],\n missingTranslation?: MissingTranslationStrategy,\n preserveWhitespaces?: boolean,\n};\n\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nexport const COMPILER_OPTIONS = new InjectionToken<CompilerOptions[]>('compilerOptions');\n\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n */\nexport abstract class CompilerFactory {\n abstract createCompiler(options?: CompilerOptions[]): Compiler;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {global} from '../util';\n\n/**\n * A scope function for the Web Tracing Framework (WTF).\n *\n * @publicApi\n */\nexport interface WtfScopeFn { (arg0?: any, arg1?: any): any; }\n\ninterface WTF {\n trace: Trace;\n}\n\ninterface Trace {\n events: Events;\n leaveScope(scope: Scope, returnValue: any): any /** TODO #9100 */;\n beginTimeRange(rangeType: string, action: string): Range;\n endTimeRange(range: Range): any /** TODO #9100 */;\n}\n\nexport interface Range {}\n\ninterface Events {\n createScope(signature: string, flags: any): Scope;\n}\n\nexport interface Scope { (...args: any[] /** TODO #9100 */): any; }\n\nlet trace: Trace;\nlet events: Events;\n\nexport function detectWTF(): boolean {\n const wtf: WTF = (global as any /** TODO #9100 */)['wtf'];\n if (wtf) {\n trace = wtf['trace'];\n if (trace) {\n events = trace['events'];\n return true;\n }\n }\n return false;\n}\n\nexport function createScope(signature: string, flags: any = null): any {\n return events.createScope(signature, flags);\n}\n\nexport function leave<T>(scope: Scope): void;\nexport function leave<T>(scope: Scope, returnValue?: T): T;\nexport function leave<T>(scope: Scope, returnValue?: any): any {\n trace.leaveScope(scope, returnValue);\n return returnValue;\n}\n\nexport function startTimeRange(rangeType: string, action: string): Range {\n return trace.beginTimeRange(rangeType, action);\n}\n\nexport function endTimeRange(range: Range): void {\n trace.endTimeRange(range);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange} from './wtf_impl';\n\nexport {WtfScopeFn} from './wtf_impl';\n\n\n/**\n * True if WTF is enabled.\n */\nexport const wtfEnabled = detectWTF();\n\nfunction noopScope(arg0?: any, arg1?: any): any {\n return null;\n}\n\n/**\n * Create trace scope.\n *\n * Scopes must be strictly nested and are analogous to stack frames, but\n * do not have to follow the stack frames. Instead it is recommended that they follow logical\n * nesting. You may want to use\n * [Event\n * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)\n * as they are defined in WTF.\n *\n * Used to mark scope entry. The return value is used to leave the scope.\n *\n * var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');\n *\n * someMethod() {\n * var s = myScope('Foo'); // 'Foo' gets stored in tracing UI\n * // DO SOME WORK HERE\n * return wtfLeave(s, 123); // Return value 123\n * }\n *\n * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can\n * negatively impact the performance of your application. For this reason we recommend that\n * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and\n * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to\n * exception, will produce incorrect trace, but presence of exception signifies logic error which\n * needs to be fixed before the app should be profiled. Add try-finally only when you expect that\n * an exception is expected during normal execution while profiling.\n *\n * @publicApi\n */\nexport const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =\n wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;\n\n/**\n * Used to mark end of Scope.\n *\n * - `scope` to end.\n * - `returnValue` (optional) to be passed to the WTF.\n *\n * Returns the `returnValue for easy chaining.\n * @publicApi\n */\nexport const wtfLeave: <T>(scope: any, returnValue?: T) => T =\n wtfEnabled ? leave : (s: any, r?: any) => r;\n\n/**\n * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.\n * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been\n * enabled.\n *\n * someMethod() {\n * var s = wtfStartTimeRange('HTTP:GET', 'some.url');\n * var future = new Future.delay(5).then((_) {\n * wtfEndTimeRange(s);\n * });\n * }\n * @publicApi\n */\nexport const wtfStartTimeRange: (rangeType: string, action: string) => any =\n wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;\n\n/**\n * Ends a async time range operation.\n * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been\n * enabled.\n * @publicApi\n */\nexport const wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter} from '../event_emitter';\n\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n readonly isStable: boolean = true;\n\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n readonly onUnstable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n readonly onStable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies that an error has been delivered.\n */\n readonly onError: EventEmitter<any> = new EventEmitter(false);\n\n constructor({enableLongStackTrace = false}) {\n if (typeof Zone == 'undefined') {\n throw new Error(`In this configuration Angular requires Zone.js`);\n }\n\n Zone.assertZonePatched();\n const self = this as any as NgZonePrivate;\n self._nesting = 0;\n\n self._outer = self._inner = Zone.current;\n\n if ((Zone as any)['wtfZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['wtfZoneSpec']);\n }\n\n if ((Zone as any)['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));\n }\n\n if (enableLongStackTrace && (Zone as any)['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['longStackTraceZoneSpec']);\n }\n\n forkInnerZoneWithAngularBehavior(self);\n }\n\n static isInAngularZone(): boolean { return Zone.current.get('isAngularZone') === true; }\n\n static assertInAngularZone(): void {\n if (!NgZone.isInAngularZone()) {\n throw new Error('Expected to be in Angular Zone, but it is not!');\n }\n }\n\n static assertNotInAngularZone(): void {\n if (NgZone.isInAngularZone()) {\n throw new Error('Expected to not be in Angular Zone, but it is!');\n }\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.run(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T {\n const zone = (this as any as NgZonePrivate)._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs) as T;\n } finally {\n zone.cancelTask(task);\n }\n }\n\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.runGuarded(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return (this as any as NgZonePrivate)._outer.run(fn) as T;\n }\n}\n\nfunction noop() {}\nconst EMPTY_PAYLOAD = {};\n\n\ninterface NgZonePrivate extends NgZone {\n _outer: Zone;\n _inner: Zone;\n _nesting: number;\n\n hasPendingMicrotasks: boolean;\n hasPendingMacrotasks: boolean;\n isStable: boolean;\n}\n\nfunction checkStable(zone: NgZonePrivate) {\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\n\nfunction forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) {\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: <any>{'isAngularZone': true},\n onInvokeTask: (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task, applyThis: any,\n applyArgs: any): any => {\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n onLeave(zone);\n }\n },\n\n\n onInvoke: (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function,\n applyThis: any, applyArgs: any[], source: string): any => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n onLeave(zone);\n }\n },\n\n onHasTask:\n (delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone.hasPendingMicrotasks = hasTaskState.microTask;\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n\n onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\n\nfunction onEnter(zone: NgZonePrivate) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\n\nfunction onLeave(zone: NgZonePrivate) {\n zone._nesting--;\n checkStable(zone);\n}\n\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nexport class NoopNgZone implements NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n readonly isStable: boolean = true;\n readonly onUnstable: EventEmitter<any> = new EventEmitter();\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter();\n readonly onStable: EventEmitter<any> = new EventEmitter();\n readonly onError: EventEmitter<any> = new EventEmitter();\n\n run(fn: () => any): any { return fn(); }\n\n runGuarded(fn: () => any): any { return fn(); }\n\n runOutsideAngular(fn: () => any): any { return fn(); }\n\n runTask<T>(fn: () => any): any { return fn(); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di';\nimport {scheduleMicroTask} from '../util';\nimport {NgZone} from '../zone/ng_zone';\n\n/**\n * Testability API.\n * `declare` keyword causes tsickle to generate externs, so these methods are\n * not renamed by Closure Compiler.\n * @publicApi\n */\nexport declare interface PublicTestability {\n isStable(): boolean;\n whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;\n findProviders(using: any, provider: string, exactMatch: boolean): any[];\n}\n\n// Angular internal, not intended for public API.\nexport interface PendingMacrotask {\n source: string;\n creationLocation: Error;\n runCount?: number;\n data: TaskData;\n}\n\nexport interface TaskData {\n target?: XMLHttpRequest;\n delay?: number;\n isPeriodic?: boolean;\n}\n\n// Angular internal, not intended for public API.\nexport type DoneCallback = (didWork: boolean, tasks?: PendingMacrotask[]) => void;\nexport type UpdateCallback = (tasks: PendingMacrotask[]) => boolean;\n\ninterface WaitCallback {\n // Needs to be 'any' - setTimeout returns a number according to ES6, but\n // on NodeJS it returns a Timer.\n timeoutId: any;\n doneCb: DoneCallback;\n updateCb?: UpdateCallback;\n}\n\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser and by services such as Protractor. Each bootstrapped Angular\n * application on the page will have an instance of Testability.\n * @publicApi\n */\n@Injectable()\nexport class Testability implements PublicTestability {\n private _pendingCount: number = 0;\n private _isZoneStable: boolean = true;\n /**\n * Whether any work was done since the last 'whenStable' callback. This is\n * useful to detect if this could have potentially destabilized another\n * component while it is stabilizing.\n * @internal\n */\n private _didWork: boolean = false;\n private _callbacks: WaitCallback[] = [];\n\n private taskTrackingZone: {macroTasks: Task[]}|null = null;\n\n constructor(private _ngZone: NgZone) {\n this._watchAngularEvents();\n _ngZone.run(() => {\n this.taskTrackingZone =\n typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n\n private _watchAngularEvents(): void {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._didWork = true;\n this._isZoneStable = false;\n }\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n scheduleMicroTask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n });\n });\n }\n\n /**\n * Increases the number of pending request\n * @deprecated pending requests are now tracked with zones.\n */\n increasePendingRequestCount(): number {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }\n\n /**\n * Decreases the number of pending request\n * @deprecated pending requests are now tracked with zones\n */\n decreasePendingRequestCount(): number {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }\n\n /**\n * Whether an associated application is stable\n */\n isStable(): boolean {\n return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;\n }\n\n private _runCallbacksIfReady(): void {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n scheduleMicroTask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop() !;\n clearTimeout(cb.timeoutId);\n cb.doneCb(this._didWork);\n }\n this._didWork = false;\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n\n return true;\n });\n\n this._didWork = true;\n }\n }\n\n private getPendingTasks(): PendingMacrotask[] {\n if (!this.taskTrackingZone) {\n return [];\n }\n\n // Copy the tasks data so that we don't leak tasks.\n return this.taskTrackingZone.macroTasks.map((t: Task) => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: (t as any).creationLocation as Error,\n data: t.data\n };\n });\n }\n\n private addCallback(cb: DoneCallback, timeout?: number, updateCb?: UpdateCallback) {\n let timeoutId: any = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb(this._didWork, this.getPendingTasks());\n }, timeout);\n }\n this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});\n }\n\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error(\n 'Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/dist/task-tracking.js\" loaded?');\n }\n // These arguments are 'Function' above to keep the public API simple.\n this.addCallback(doneCb as DoneCallback, timeout, updateCb as UpdateCallback);\n this._runCallbacksIfReady();\n }\n\n /**\n * Get the number of pending requests\n * @deprecated pending requests are now tracked with zones\n */\n getPendingRequestCount(): number { return this._pendingCount; }\n\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using: any, provider: string, exactMatch: boolean): any[] {\n // TODO(juliemr): implement.\n return [];\n }\n}\n\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\n@Injectable()\nexport class TestabilityRegistry {\n /** @internal */\n _applications = new Map<any, Testability>();\n\n constructor() { _testabilityGetter.addToWindow(this); }\n\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token: any, testability: Testability) {\n this._applications.set(token, testability);\n }\n\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token: any) { this._applications.delete(token); }\n\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() { this._applications.clear(); }\n\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem: any): Testability|null { return this._applications.get(elem) || null; }\n\n /**\n * Get all registered testabilities\n */\n getAllTestabilities(): Testability[] { return Array.from(this._applications.values()); }\n\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements(): any[] { return Array.from(this._applications.keys()); }\n\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability|null {\n return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n }\n}\n\n/**\n * Adapter interface for retrieving the `Testability` service associated for a\n * particular context.\n *\n * @publicApi\n */\nexport interface GetTestability {\n addToWindow(registry: TestabilityRegistry): void;\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null;\n}\n\nclass _NoopGetTestability implements GetTestability {\n addToWindow(registry: TestabilityRegistry): void {}\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null {\n return null;\n }\n}\n\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nexport function setTestabilityGetter(getter: GetTestability): void {\n _testabilityGetter = getter;\n}\n\nlet _testabilityGetter: GetTestability = new _NoopGetTestability();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable, Observer, Subscription, merge} from 'rxjs';\nimport {share} from 'rxjs/operators';\n\nimport {ApplicationInitStatus} from './application_init';\nimport {APP_BOOTSTRAP_LISTENER, PLATFORM_INITIALIZER} from './application_tokens';\nimport {Console} from './console';\nimport {Injectable, InjectionToken, Injector, StaticProvider} from './di';\nimport {ErrorHandler} from './error_handler';\nimport {isDevMode} from './is_dev_mode';\nimport {CompilerFactory, CompilerOptions} from './linker/compiler';\nimport {ComponentFactory, ComponentRef} from './linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from './linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nimport {InternalViewRef, ViewRef} from './linker/view_ref';\nimport {WtfScopeFn, wtfCreateScope, wtfLeave} from './profile/profile';\nimport {assertNgModuleType} from './render3/assert';\nimport {NgModuleFactory as R3NgModuleFactory} from './render3/ng_module_ref';\nimport {Testability, TestabilityRegistry} from './testability/testability';\nimport {Type} from './type';\nimport {scheduleMicroTask, stringify} from './util';\nimport {isPromise} from './util/lang';\nimport {NgZone, NoopNgZone} from './zone/ng_zone';\n\nlet _platform: PlatformRef;\n\nlet compileNgModuleFactory:\n <M>(injector: Injector, options: CompilerOptions, moduleType: Type<M>) =>\n Promise<NgModuleFactory<M>> = compileNgModuleFactory__PRE_R3__;\n\nfunction compileNgModuleFactory__PRE_R3__<M>(\n injector: Injector, options: CompilerOptions,\n moduleType: Type<M>): Promise<NgModuleFactory<M>> {\n const compilerFactory: CompilerFactory = injector.get(CompilerFactory);\n const compiler = compilerFactory.createCompiler([options]);\n return compiler.compileModuleAsync(moduleType);\n}\n\nexport function compileNgModuleFactory__POST_R3__<M>(\n injector: Injector, options: CompilerOptions,\n moduleType: Type<M>): Promise<NgModuleFactory<M>> {\n ngDevMode && assertNgModuleType(moduleType);\n return Promise.resolve(new R3NgModuleFactory(moduleType));\n}\n\nexport const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken<boolean>('AllowMultipleToken');\n\n\n\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @publicApi\n */\nexport class NgProbeToken {\n constructor(public name: string, public token: any) {}\n}\n\n/**\n * Creates a platform.\n * Platforms have to be eagerly created via this function.\n *\n * @publicApi\n */\nexport function createPlatform(injector: Injector): PlatformRef {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error(\n 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits) inits.forEach((init: any) => init());\n return _platform;\n}\n\n/**\n * Creates a factory for a platform\n *\n * @publicApi\n */\nexport function createPlatformFactory(\n parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null,\n name: string, providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) =>\n PlatformRef {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders: StaticProvider[] = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(\n providers.concat(extraProviders).concat({provide: marker, useValue: true}));\n } else {\n const injectedProviders: StaticProvider[] =\n providers.concat(extraProviders).concat({provide: marker, useValue: true});\n createPlatform(Injector.create({providers: injectedProviders, name: desc}));\n }\n }\n return assertPlatform(marker);\n };\n}\n\n/**\n * Checks that there currently is a platform which contains the given token as a provider.\n *\n * @publicApi\n */\nexport function assertPlatform(requiredToken: any): PlatformRef {\n const platform = getPlatform();\n\n if (!platform) {\n throw new Error('No platform exists!');\n }\n\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error(\n 'A platform with a different configuration has been created. Please destroy it first.');\n }\n\n return platform;\n}\n\n/**\n * Destroy the existing platform.\n *\n * @publicApi\n */\nexport function destroyPlatform(): void {\n if (_platform && !_platform.destroyed) {\n _platform.destroy();\n }\n}\n\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nexport function getPlatform(): PlatformRef|null {\n return _platform && !_platform.destroyed ? _platform : null;\n}\n\n/**\n * Provides additional options to the bootstraping process.\n *\n *\n */\nexport interface BootstrapOptions {\n /**\n * Optionally specify which `NgZone` should be used.\n *\n * - Provide your own `NgZone` instance.\n * - `zone.js` - Use default `NgZone` which requires `Zone.js`.\n * - `noop` - Use `NoopNgZone` which does nothing.\n */\n ngZone?: NgZone|'zone.js'|'noop';\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page. Each page\n * has exactly one platform, and services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n *\n * A page's platform is initialized implicitly when a platform is created via a platform factory\n * (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.\n *\n * @publicApi\n */\n@Injectable()\nexport class PlatformRef {\n private _modules: NgModuleRef<any>[] = [];\n private _destroyListeners: Function[] = [];\n private _destroyed: boolean = false;\n\n /** @internal */\n constructor(private _injector: Injector) {}\n\n /**\n * Creates an instance of an `@NgModule` for the given platform\n * for offline compilation.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * my_module.ts:\n *\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * main.ts:\n * import {MyModuleNgFactory} from './my_module.ngfactory';\n * import {platformBrowser} from '@angular/platform-browser';\n *\n * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n * ```\n */\n bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, options?: BootstrapOptions):\n Promise<NgModuleRef<M>> {\n // Note: We need to create the NgZone _before_ we instantiate the module,\n // as instantiating the module creates some providers eagerly.\n // So we create a mini parent injector that just contains the new NgZone and\n // pass that as parent to the NgModuleFactory.\n const ngZoneOption = options ? options.ngZone : undefined;\n const ngZone = getNgZone(ngZoneOption);\n const providers: StaticProvider[] = [{provide: NgZone, useValue: ngZone}];\n // Attention: Don't use ApplicationRef.run here,\n // as we want to be sure that all possible constructor calls are inside `ngZone.run`!\n return ngZone.run(() => {\n const ngZoneInjector = Injector.create(\n {providers: providers, parent: this.injector, name: moduleFactory.moduleType.name});\n const moduleRef = <InternalNgModuleRef<M>>moduleFactory.create(ngZoneInjector);\n const exceptionHandler: ErrorHandler = moduleRef.injector.get(ErrorHandler, null);\n if (!exceptionHandler) {\n throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n }\n moduleRef.onDestroy(() => remove(this._modules, moduleRef));\n ngZone !.runOutsideAngular(\n () => ngZone !.onError.subscribe(\n {next: (error: any) => { exceptionHandler.handleError(error); }}));\n return _callAndReportToErrorHandler(exceptionHandler, ngZone !, () => {\n const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n this._moduleDoBootstrap(moduleRef);\n return moduleRef;\n });\n });\n });\n }\n\n /**\n * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule<M>(\n moduleType: Type<M>, compilerOptions: (CompilerOptions&BootstrapOptions)|\n Array<CompilerOptions&BootstrapOptions> = []): Promise<NgModuleRef<M>> {\n const options = optionsReducer({}, compilerOptions);\n return compileNgModuleFactory(this.injector, options, moduleType)\n .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));\n }\n\n private _moduleDoBootstrap(moduleRef: InternalNgModuleRef<any>): void {\n const appRef = moduleRef.injector.get(ApplicationRef) as ApplicationRef;\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new Error(\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`);\n }\n this._modules.push(moduleRef);\n }\n\n /**\n * Register a listener to be called when the platform is disposed.\n */\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n\n /**\n * Retrieve the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector(): Injector { return this._injector; }\n\n /**\n * Destroy the Angular platform and all Angular applications on the page.\n */\n destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }\n\n get destroyed() { return this._destroyed; }\n}\n\nfunction getNgZone(ngZoneOption?: NgZone | 'zone.js' | 'noop'): NgZone {\n let ngZone: NgZone;\n\n if (ngZoneOption === 'noop') {\n ngZone = new NoopNgZone();\n } else {\n ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) ||\n new NgZone({enableLongStackTrace: isDevMode()});\n }\n return ngZone;\n}\n\nfunction _callAndReportToErrorHandler(\n errorHandler: ErrorHandler, ngZone: NgZone, callback: () => any): any {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e: any) => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\n\nfunction optionsReducer<T extends Object>(dst: any, objs: T | T[]): T {\n if (Array.isArray(objs)) {\n dst = objs.reduce(optionsReducer, dst);\n } else {\n dst = {...dst, ...(objs as any)};\n }\n return dst;\n}\n\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n *\n * {@a is-stable-examples}\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class ApplicationRef {\n /** @internal */\n static _tickScope: WtfScopeFn = wtfCreateScope('ApplicationRef#tick()');\n private _bootstrapListeners: ((compRef: ComponentRef<any>) => void)[] = [];\n private _views: InternalViewRef[] = [];\n private _runningTick: boolean = false;\n private _enforceNoNewChanges: boolean = false;\n private _stable = true;\n\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n public readonly componentTypes: Type<any>[] = [];\n\n /**\n * Get a list of components registered to this application.\n */\n public readonly components: ComponentRef<any>[] = [];\n\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n *\n * @see [Usage notes](#is-stable-examples) for examples and caveats when using this API.\n */\n // TODO(issue/24571): remove '!'.\n public readonly isStable !: Observable<boolean>;\n\n /** @internal */\n constructor(\n private _zone: NgZone, private _console: Console, private _injector: Injector,\n private _exceptionHandler: ErrorHandler,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _initStatus: ApplicationInitStatus) {\n this._enforceNoNewChanges = isDevMode();\n\n this._zone.onMicrotaskEmpty.subscribe(\n {next: () => { this._zone.run(() => { this.tick(); }); }});\n\n const isCurrentlyStable = new Observable<boolean>((observer: Observer<boolean>) => {\n this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks;\n this._zone.runOutsideAngular(() => {\n observer.next(this._stable);\n observer.complete();\n });\n });\n\n const isStable = new Observable<boolean>((observer: Observer<boolean>) => {\n // Create the subscription to onStable outside the Angular Zone so that\n // the callback is run outside the Angular Zone.\n let stableSub: Subscription;\n this._zone.runOutsideAngular(() => {\n stableSub = this._zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n scheduleMicroTask(() => {\n if (!this._stable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks) {\n this._stable = true;\n observer.next(true);\n }\n });\n });\n });\n\n const unstableSub: Subscription = this._zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n if (this._stable) {\n this._stable = false;\n this._zone.runOutsideAngular(() => { observer.next(false); });\n }\n });\n\n return () => {\n stableSub.unsubscribe();\n unstableSub.unsubscribe();\n };\n });\n\n (this as{isStable: Observable<boolean>}).isStable =\n merge(isCurrentlyStable, isStable.pipe(share()));\n }\n\n /**\n * Bootstrap a new component at the root level of the application.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a new root component into an application, Angular mounts the\n * specified application component onto DOM elements identified by the componentType's\n * selector and kicks off automatic change detection to finish initializing the component.\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * componentType's selector.\n *\n * ### Example\n * {@example core/ts/platform/platform.ts region='longform'}\n */\n bootstrap<C>(componentOrFactory: ComponentFactory<C>|Type<C>, rootSelectorOrNode?: string|any):\n ComponentRef<C> {\n if (!this._initStatus.done) {\n throw new Error(\n 'Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n }\n let componentFactory: ComponentFactory<C>;\n if (componentOrFactory instanceof ComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n componentFactory =\n this._componentFactoryResolver.resolveComponentFactory(componentOrFactory) !;\n }\n this.componentTypes.push(componentFactory.componentType);\n\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?\n null :\n this._injector.get(NgModuleRef);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n\n compRef.onDestroy(() => { this._unloadComponent(compRef); });\n const testability = compRef.injector.get(Testability, null);\n if (testability) {\n compRef.injector.get(TestabilityRegistry)\n .registerApplication(compRef.location.nativeElement, testability);\n }\n\n this._loadComponent(compRef);\n if (isDevMode()) {\n this._console.log(\n `Angular is running in the development mode. Call enableProdMode() to enable the production mode.`);\n }\n return compRef;\n }\n\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick(): void {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n\n const scope = ApplicationRef._tickScope();\n try {\n this._runningTick = true;\n this._views.forEach((view) => view.detectChanges());\n if (this._enforceNoNewChanges) {\n this._views.forEach((view) => view.checkNoChanges());\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n wtfLeave(scope);\n }\n }\n\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n this._views.push(view);\n view.attachToAppRef(this);\n }\n\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n remove(this._views, view);\n view.detachFromAppRef();\n }\n\n private _loadComponent(componentRef: ComponentRef<any>): void {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners =\n this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);\n listeners.forEach((listener) => listener(componentRef));\n }\n\n private _unloadComponent(componentRef: ComponentRef<any>): void {\n this.detachView(componentRef.hostView);\n remove(this.components, componentRef);\n }\n\n /** @internal */\n ngOnDestroy() {\n // TODO(alxhub): Dispose of the NgZone.\n this._views.slice().forEach((view) => view.destroy());\n }\n\n /**\n * Returns the number of attached views.\n */\n get viewCount() { return this._views.length; }\n}\n\nfunction remove<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for Zone\nexport {NgZone, NoopNgZone as ɵNoopNgZone} from './zone/ng_zone';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for render\nexport {RenderComponentType, Renderer, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, RootRenderer} from './render/api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {getSymbolIterator} from '../util';\n\n\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nexport class QueryList<T>/* implements Iterable<T> */ {\n public readonly dirty = true;\n private _results: Array<T> = [];\n public readonly changes: Observable<any> = new EventEmitter();\n\n readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n readonly first !: T;\n // TODO(issue/24571): remove '!'.\n readonly last !: T;\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._results.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._results.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._results.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n\n toArray(): T[] { return this._results.slice(); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._results as any)[getSymbolIterator()](); }\n\n toString(): string { return this._results.toString(); }\n\n reset(res: Array<T|any[]>): void {\n this._results = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n (this as{length: number}).length = this._results.length;\n (this as{last: T}).last = this._results[this.length - 1];\n (this as{first: T}).first = this._results[0];\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n\n /** internal */\n setDirty() { (this as{dirty: boolean}).dirty = true; }\n\n /** internal */\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\nfunction flatten<T>(list: Array<T|T[]>): T[] {\n return list.reduce((flat: any[], item: T | T[]): T[] => {\n const flatItem = Array.isArray(item) ? flatten(item) : item;\n return (<T[]>flat).concat(flatItem);\n }, []);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional} from '../di';\n\nimport {Compiler} from './compiler';\nimport {NgModuleFactory} from './ng_module_factory';\nimport {NgModuleFactoryLoader} from './ng_module_factory_loader';\n\nconst _SEPARATOR = '#';\n\nconst FACTORY_CLASS_SUFFIX = 'NgFactory';\ndeclare var System: any;\n\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n *\n * @publicApi\n */\nexport abstract class SystemJsNgModuleLoaderConfig {\n /**\n * Prefix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathPrefix !: string;\n\n /**\n * Suffix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathSuffix !: string;\n}\n\nconst DEFAULT_CONFIG: SystemJsNgModuleLoaderConfig = {\n factoryPathPrefix: '',\n factoryPathSuffix: '.ngfactory',\n};\n\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * @publicApi\n */\n@Injectable()\nexport class SystemJsNgModuleLoader implements NgModuleFactoryLoader {\n private _config: SystemJsNgModuleLoaderConfig;\n\n constructor(private _compiler: Compiler, @Optional() config?: SystemJsNgModuleLoaderConfig) {\n this._config = config || DEFAULT_CONFIG;\n }\n\n load(path: string): Promise<NgModuleFactory<any>> {\n const offlineMode = this._compiler instanceof Compiler;\n return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n }\n\n private loadAndCompile(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n if (exportName === undefined) {\n exportName = 'default';\n }\n\n return System.import(module)\n .then((module: any) => module[exportName])\n .then((type: any) => checkNotEmpty(type, module, exportName))\n .then((type: any) => this._compiler.compileModuleAsync(type));\n }\n\n private loadFactory(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n let factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n if (exportName === undefined) {\n exportName = 'default';\n factoryClassSuffix = '';\n }\n\n return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n .then((module: any) => module[exportName + factoryClassSuffix])\n .then((factory: any) => checkNotEmpty(factory, module, exportName));\n }\n}\n\nfunction checkNotEmpty(value: any, modulePath: string, exportName: string): any {\n if (!value) {\n throw new Error(`Cannot find '${exportName}' in '${modulePath}'`);\n }\n return value;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {injectViewContainerRef as render3InjectViewContainerRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {TemplateRef} from './template_ref';\nimport {EmbeddedViewRef, ViewRef} from './view_ref';\n\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a [view hierarchy](guide/glossary#view-tree).\n *\n * @see `ComponentRef`\n * @see `EmbeddedViewRef`\n *\n * @publicApi\n */\nexport abstract class ViewContainerRef {\n /**\n * Anchor element that specifies the location of this container in the containing view.\n * Each view container can have only one anchor element, and each anchor element\n * can have only a single view container.\n *\n * Root elements of views attached to this container become siblings of the anchor element in\n * the rendered view.\n *\n * Access the `ViewContainerRef` of an element by placing a `Directive` injected\n * with `ViewContainerRef` on the element, or use a `ViewChild` query.\n *\n * <!-- TODO: rename to anchorElement -->\n */\n abstract get element(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this view container.\n */\n abstract get injector(): Injector;\n\n /** @deprecated No replacement */\n abstract get parentInjector(): Injector;\n\n /**\n * Destroys all views in this container.\n */\n abstract clear(): void;\n\n /**\n * Retrieves a view from this container.\n * @param index The 0-based index of the view to retrieve.\n * @returns The `ViewRef` instance, or null if the index is out of range.\n */\n abstract get(index: number): ViewRef|null;\n\n /**\n * Reports how many views are currently attached to this container.\n * @returns The number of views.\n */\n abstract get length(): number;\n\n /**\n * Instantiates an embedded view and inserts it\n * into this container.\n * @param templateRef The HTML template that defines the view.\n * @param index The 0-based index at which to insert the new view into this container.\n * If not specified, appends the new view as the last entry.\n *\n * @returns The `ViewRef` instance for the newly created view.\n */\n abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C>;\n\n /**\n * Instantiates a single component and inserts its host view into this container.\n *\n * @param componentFactory The factory to use.\n * @param index The index at which to insert the new component's host view into this container.\n * If not specified, appends the new view as the last entry.\n * @param injector The injector to use as the parent for the new component.\n * @param projectableNodes\n * @param ngModule\n *\n * @returns The new component instance, containing the host view.\n *\n */\n abstract createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;\n\n /**\n * Inserts a view into this container.\n * @param viewRef The view to insert.\n * @param index The 0-based index at which to insert the view.\n * If not specified, appends the new view as the last entry.\n * @returns The inserted `ViewRef` instance.\n *\n */\n abstract insert(viewRef: ViewRef, index?: number): ViewRef;\n\n /**\n * Moves a view to a new location in this container.\n * @param viewRef The view to move.\n * @param index The 0-based index of the new location.\n * @returns The moved `ViewRef` instance.\n */\n abstract move(viewRef: ViewRef, currentIndex: number): ViewRef;\n\n /**\n * Returns the index of a view within the current container.\n * @param viewRef The view to query.\n * @returns The 0-based index of the view's position in this container,\n * or `-1` if this container doesn't contain the view.\n */\n abstract indexOf(viewRef: ViewRef): number;\n\n /**\n * Destroys a view attached to this container\n * @param index The 0-based index of the view to destroy.\n * If not specified, the last view in the container is removed.\n */\n abstract remove(index?: number): void;\n\n /**\n * Detaches a view from this container without destroying it.\n * Use along with `insert()` to move a view within the current container.\n * @param index The 0-based index of the view to detach.\n * If not specified, the last view in the container is detached.\n */\n abstract detach(index?: number): ViewRef|null;\n\n /** @internal */\n static __NG_ELEMENT_ID__:\n () => ViewContainerRef = () => SWITCH_VIEW_CONTAINER_REF_FACTORY(ViewContainerRef, ElementRef)\n}\n\nexport const SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = render3InjectViewContainerRef;\nconst SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_VIEW_CONTAINER_REF_FACTORY: typeof render3InjectViewContainerRef =\n SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectChangeDetectorRef as render3InjectChangeDetectorRef} from '../render3/view_engine_compatibility';\n\n/**\n * Base class for Angular Views, provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be rerendered.\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval. See [live demo](http://plnkr.co/edit/GC512b?p=preview).\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n * @publicApi\n */\nexport abstract class ChangeDetectorRef {\n /**\n * When a view uses the {@link ChangeDetectionStrategy#OnPush OnPush} (checkOnce)\n * change detection strategy, explicitly marks the view as changed so that\n * it can be checked again.\n *\n * Components are normally marked as dirty (in need of rerendering) when inputs\n * have changed or events have fired in the view. Call this method to ensure that\n * a component is checked even if these triggers have not occured.\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n */\n abstract markForCheck(): void;\n\n /**\n * Detaches this view from the change-detection tree.\n * A detached view is not checked until it is reattached.\n * Use in combination with `detectChanges()` to implement local change detection checks.\n *\n * Detached views are not checked during change detection runs until they are\n * re-attached, even if they are marked as dirty.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detach(): void;\n\n /**\n * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach\n * detach}\n * to implement local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detectChanges(): void;\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * Use in development mode to verify that running change detection doesn't introduce\n * other changes.\n */\n abstract checkNoChanges(): void;\n\n /**\n * Re-attaches the previously detached view to the change detection tree.\n * Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n */\n abstract reattach(): void;\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => ChangeDetectorRef = () => SWITCH_CHANGE_DETECTOR_REF_FACTORY();\n}\n\n\n\nexport const SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = render3InjectChangeDetectorRef;\nconst SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__ = (...args: any[]): any => {};\nconst SWITCH_CHANGE_DETECTOR_REF_FACTORY: typeof render3InjectChangeDetectorRef =\n SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\n\n/**\n * Represents an Angular [view](guide/glossary#view),\n * specifically the [host view](guide/glossary#view-tree) that is defined by a component.\n * Also serves as the base class\n * that adds destroy methods for [embedded views](guide/glossary#view-tree).\n *\n * @see `EmbeddedViewRef`\n *\n * @publicApi\n */\nexport abstract class ViewRef extends ChangeDetectorRef {\n /**\n * Destroys this view and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Reports whether this view has been destroyed.\n * @returns True after the `destroy()` method has been called, false otherwise.\n */\n abstract get destroyed(): boolean;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for views.\n * @param callback A handler function that cleans up developer-defined data\n * associated with a view. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): any /** TODO #9100 */;\n}\n\n/**\n * Represents an Angular [view](guide/glossary#view) in a view container.\n * An [embedded view](guide/glossary#view-tree) can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see `ViewContainerRef`\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```\n * <li>{{item}}</li>\n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n * <ng-template view-container-ref></ng-template>\n * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * @publicApi\n */\nexport abstract class EmbeddedViewRef<C> extends ViewRef {\n /**\n * The context for this view, inherited from the anchor element.\n */\n abstract get context(): C;\n\n /**\n * The root nodes for this embedded view.\n */\n abstract get rootNodes(): any[];\n}\n\nexport interface InternalViewRef extends ViewRef {\n detachFromAppRef(): void;\n attachToAppRef(appRef: ApplicationRef): void;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for compiler\nexport {COMPILER_OPTIONS, Compiler, CompilerFactory, CompilerOptions, ModuleWithComponentFactories} from './linker/compiler';\nexport {ComponentFactory, ComponentRef} from './linker/component_factory';\nexport {ComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {ElementRef} from './linker/element_ref';\nexport {NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nexport {NgModuleFactoryLoader, getModuleFactory} from './linker/ng_module_factory_loader';\nexport {QueryList} from './linker/query_list';\nexport {SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig} from './linker/system_js_ng_module_factory_loader';\nexport {TemplateRef} from './linker/template_ref';\nexport {ViewContainerRef} from './linker/view_container_ref';\nexport {EmbeddedViewRef, ViewRef} from './linker/view_ref';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {assertDomNode} from '../render3/assert';\nimport {getComponent, getContext, getInjectionTokens, getInjector, getListeners, getLocalRefs, isBrowserEvents, loadLContext, loadLContextFromNode} from '../render3/discovery_utils';\nimport {TNode} from '../render3/interfaces/node';\nimport {StylingIndex} from '../render3/interfaces/styling';\nimport {TVIEW} from '../render3/interfaces/view';\nimport {getProp, getValue, isClassBasedValue} from '../render3/styling/class_and_style_bindings';\nimport {getStylingContext} from '../render3/styling/util';\nimport {DebugContext} from '../view/index';\n\nexport class EventListener {\n constructor(public name: string, public callback: Function) {}\n}\n\n/**\n * @publicApi\n */\nexport interface DebugNode {\n readonly listeners: EventListener[];\n readonly parent: DebugElement|null;\n readonly nativeNode: any;\n readonly injector: Injector;\n readonly componentInstance: any;\n readonly context: any;\n readonly references: {[key: string]: any};\n readonly providerTokens: any[];\n}\nexport class DebugNode__PRE_R3__ {\n readonly listeners: EventListener[] = [];\n readonly parent: DebugElement|null = null;\n readonly nativeNode: any;\n private readonly _debugContext: DebugContext;\n\n constructor(nativeNode: any, parent: DebugNode|null, _debugContext: DebugContext) {\n this._debugContext = _debugContext;\n this.nativeNode = nativeNode;\n if (parent && parent instanceof DebugElement__PRE_R3__) {\n parent.addChild(this);\n }\n }\n\n get injector(): Injector { return this._debugContext.injector; }\n\n get componentInstance(): any { return this._debugContext.component; }\n\n get context(): any { return this._debugContext.context; }\n\n get references(): {[key: string]: any} { return this._debugContext.references; }\n\n get providerTokens(): any[] { return this._debugContext.providerTokens; }\n}\n\n/**\n * @publicApi\n */\nexport interface DebugElement extends DebugNode {\n readonly name: string;\n readonly properties: {[key: string]: any};\n readonly attributes: {[key: string]: string | null};\n readonly classes: {[key: string]: boolean};\n readonly styles: {[key: string]: string | null};\n readonly childNodes: DebugNode[];\n readonly nativeElement: any;\n readonly children: DebugElement[];\n\n query(predicate: Predicate<DebugElement>): DebugElement;\n queryAll(predicate: Predicate<DebugElement>): DebugElement[];\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[];\n triggerEventHandler(eventName: string, eventObj: any): void;\n}\nexport class DebugElement__PRE_R3__ extends DebugNode__PRE_R3__ implements DebugElement {\n readonly name !: string;\n readonly properties: {[key: string]: any} = {};\n readonly attributes: {[key: string]: string | null} = {};\n readonly classes: {[key: string]: boolean} = {};\n readonly styles: {[key: string]: string | null} = {};\n readonly childNodes: DebugNode[] = [];\n readonly nativeElement: any;\n\n constructor(nativeNode: any, parent: any, _debugContext: DebugContext) {\n super(nativeNode, parent, _debugContext);\n this.nativeElement = nativeNode;\n }\n\n addChild(child: DebugNode) {\n if (child) {\n this.childNodes.push(child);\n (child as{parent: DebugNode}).parent = this;\n }\n }\n\n removeChild(child: DebugNode) {\n const childIndex = this.childNodes.indexOf(child);\n if (childIndex !== -1) {\n (child as{parent: DebugNode | null}).parent = null;\n this.childNodes.splice(childIndex, 1);\n }\n }\n\n insertChildrenAfter(child: DebugNode, newChildren: DebugNode[]) {\n const siblingIndex = this.childNodes.indexOf(child);\n if (siblingIndex !== -1) {\n this.childNodes.splice(siblingIndex + 1, 0, ...newChildren);\n newChildren.forEach(c => {\n if (c.parent) {\n (c.parent as DebugElement__PRE_R3__).removeChild(c);\n }\n (child as{parent: DebugNode}).parent = this;\n });\n }\n }\n\n insertBefore(refChild: DebugNode, newChild: DebugNode): void {\n const refIndex = this.childNodes.indexOf(refChild);\n if (refIndex === -1) {\n this.addChild(newChild);\n } else {\n if (newChild.parent) {\n (newChild.parent as DebugElement__PRE_R3__).removeChild(newChild);\n }\n (newChild as{parent: DebugNode}).parent = this;\n this.childNodes.splice(refIndex, 0, newChild);\n }\n }\n\n query(predicate: Predicate<DebugElement>): DebugElement {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n\n queryAll(predicate: Predicate<DebugElement>): DebugElement[] {\n const matches: DebugElement[] = [];\n _queryElementChildren(this, predicate, matches);\n return matches;\n }\n\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] {\n const matches: DebugNode[] = [];\n _queryNodeChildren(this, predicate, matches);\n return matches;\n }\n\n get children(): DebugElement[] {\n return this\n .childNodes //\n .filter((node) => node instanceof DebugElement__PRE_R3__) as DebugElement[];\n }\n\n triggerEventHandler(eventName: string, eventObj: any) {\n this.listeners.forEach((listener) => {\n if (listener.name == eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\n/**\n * @publicApi\n */\nexport function asNativeElements(debugEls: DebugElement[]): any {\n return debugEls.map((el) => el.nativeElement);\n}\n\nfunction _queryElementChildren(\n element: DebugElement, predicate: Predicate<DebugElement>, matches: DebugElement[]) {\n element.childNodes.forEach(node => {\n if (node instanceof DebugElement__PRE_R3__) {\n if (predicate(node)) {\n matches.push(node);\n }\n _queryElementChildren(node, predicate, matches);\n }\n });\n}\n\nfunction _queryNodeChildren(\n parentNode: DebugNode, predicate: Predicate<DebugNode>, matches: DebugNode[]) {\n if (parentNode instanceof DebugElement__PRE_R3__) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement__PRE_R3__) {\n _queryNodeChildren(node, predicate, matches);\n }\n });\n }\n}\n\nfunction notImplemented(): Error {\n throw new Error('Missing proper ivy implementation.');\n}\n\nclass DebugNode__POST_R3__ implements DebugNode {\n readonly nativeNode: Node;\n\n constructor(nativeNode: Node) { this.nativeNode = nativeNode; }\n\n get parent(): DebugElement|null {\n const parent = this.nativeNode.parentNode as Element;\n return parent ? new DebugElement__POST_R3__(parent) : null;\n }\n\n get injector(): Injector { return getInjector(this.nativeNode); }\n\n get componentInstance(): any {\n const nativeElement = this.nativeNode;\n return nativeElement && getComponent(nativeElement as Element);\n }\n get context(): any { return getContext(this.nativeNode as Element); }\n\n get listeners(): EventListener[] {\n return getListeners(this.nativeNode as Element).filter(isBrowserEvents);\n }\n\n get references(): {[key: string]: any;} { return getLocalRefs(this.nativeNode); }\n\n get providerTokens(): any[] { return getInjectionTokens(this.nativeNode as Element); }\n}\n\nclass DebugElement__POST_R3__ extends DebugNode__POST_R3__ implements DebugElement {\n constructor(nativeNode: Element) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n\n get nativeElement(): Element|null {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode as Element : null;\n }\n\n get name(): string { return this.nativeElement !.nodeName; }\n\n get properties(): {[key: string]: any;} {\n const context = loadLContext(this.nativeNode) !;\n const lView = context.lView;\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex] as TNode;\n const properties = {};\n // TODO: https://angular-team.atlassian.net/browse/FW-681\n // Missing implementation here...\n return properties;\n }\n\n get attributes(): {[key: string]: string | null;} {\n const attributes: {[key: string]: string | null;} = {};\n const element = this.nativeElement;\n if (element) {\n const eAttrs = element.attributes;\n for (let i = 0; i < eAttrs.length; i++) {\n const attr = eAttrs[i];\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n\n get classes(): {[key: string]: boolean;} {\n const classes: {[key: string]: boolean;} = {};\n const element = this.nativeElement;\n if (element) {\n const lContext = loadLContextFromNode(element);\n const lNode = lContext.lView[lContext.nodeIndex];\n const stylingContext = getStylingContext(lContext.nodeIndex, lContext.lView);\n if (stylingContext) {\n for (let i = StylingIndex.SingleStylesStartPosition; i < lNode.length;\n i += StylingIndex.Size) {\n if (isClassBasedValue(lNode, i)) {\n const className = getProp(lNode, i);\n const value = getValue(lNode, i);\n if (typeof value == 'boolean') {\n // we want to ignore `null` since those don't overwrite the values.\n classes[className] = value;\n }\n }\n }\n } else {\n // Fallback, just read DOM.\n const eClasses = element.classList;\n for (let i = 0; i < eClasses.length; i++) {\n classes[eClasses[i]] = true;\n }\n }\n }\n return classes;\n }\n\n get styles(): {[key: string]: string | null;} {\n const styles: {[key: string]: string | null;} = {};\n const element = this.nativeElement;\n if (element) {\n const lContext = loadLContextFromNode(element);\n const lNode = lContext.lView[lContext.nodeIndex];\n const stylingContext = getStylingContext(lContext.nodeIndex, lContext.lView);\n if (stylingContext) {\n for (let i = StylingIndex.SingleStylesStartPosition; i < lNode.length;\n i += StylingIndex.Size) {\n if (!isClassBasedValue(lNode, i)) {\n const styleName = getProp(lNode, i);\n const value = getValue(lNode, i) as string | null;\n if (value !== null) {\n // we want to ignore `null` since those don't overwrite the values.\n styles[styleName] = value;\n }\n }\n }\n } else {\n // Fallback, just read DOM.\n const eStyles = (element as HTMLElement).style;\n for (let i = 0; i < eStyles.length; i++) {\n const name = eStyles.item(i);\n styles[name] = eStyles.getPropertyValue(name);\n }\n }\n }\n return styles;\n }\n\n get childNodes(): DebugNode[] {\n const childNodes = this.nativeNode.childNodes;\n const children: DebugNode[] = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode__POST_R3__(element));\n }\n return children;\n }\n\n get children(): DebugElement[] {\n const nativeElement = this.nativeElement;\n if (!nativeElement) return [];\n const childNodes = nativeElement.children;\n const children: DebugElement[] = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode__POST_R3__(element));\n }\n return children;\n }\n\n query(predicate: Predicate<DebugElement>): DebugElement {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n\n queryAll(predicate: Predicate<DebugElement>): DebugElement[] {\n const matches: DebugElement[] = [];\n _queryNodeChildrenR3(this, predicate, matches, true);\n return matches;\n }\n\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] {\n const matches: DebugNode[] = [];\n _queryNodeChildrenR3(this, predicate, matches, false);\n return matches;\n }\n\n triggerEventHandler(eventName: string, eventObj: any): void {\n this.listeners.forEach((listener) => {\n if (listener.name === eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\nfunction _queryNodeChildrenR3(\n parentNode: DebugNode, predicate: Predicate<DebugNode>, matches: DebugNode[],\n elementsOnly: boolean) {\n if (parentNode instanceof DebugElement__POST_R3__) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement__POST_R3__) {\n if (elementsOnly ? node.nativeElement : true) {\n _queryNodeChildrenR3(node, predicate, matches, elementsOnly);\n }\n }\n });\n }\n}\n\n\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst _nativeNodeToDebugNode = new Map<any, DebugNode>();\n\nfunction getDebugNode__PRE_R3__(nativeNode: any): DebugNode|null {\n return _nativeNodeToDebugNode.get(nativeNode) || null;\n}\n\nexport function getDebugNode__POST_R3__(nativeNode: Element): DebugElement__POST_R3__;\nexport function getDebugNode__POST_R3__(nativeNode: Node): DebugNode__POST_R3__;\nexport function getDebugNode__POST_R3__(nativeNode: null): null;\nexport function getDebugNode__POST_R3__(nativeNode: any): DebugNode|null {\n if (nativeNode instanceof Node) {\n return nativeNode.nodeType == Node.ELEMENT_NODE ?\n new DebugElement__POST_R3__(nativeNode as Element) :\n new DebugNode__POST_R3__(nativeNode);\n }\n return null;\n}\n\n/**\n * @publicApi\n */\nexport const getDebugNode: (nativeNode: any) => DebugNode | null = getDebugNode__PRE_R3__;\n\nexport function getAllDebugNodes(): DebugNode[] {\n return Array.from(_nativeNodeToDebugNode.values());\n}\n\nexport function indexDebugNode(node: DebugNode) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\n\nexport function removeDebugNodeFromIndex(node: DebugNode) {\n _nativeNodeToDebugNode.delete(node.nativeNode);\n}\n\n/**\n * A boolean-valued function over a value, possibly including context information\n * regarding that value's position in an array.\n *\n * @publicApi\n */\nexport interface Predicate<T> { (value: T): boolean; }\n\n/**\n * @publicApi\n */\nexport const DebugNode: {new (...args: any[]): DebugNode} = DebugNode__PRE_R3__ as any;\n\n/**\n * @publicApi\n */\nexport const DebugElement: {new (...args: any[]): DebugElement} = DebugElement__PRE_R3__ as any;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isListLikeIterable, iterateListLike} from '../change_detection_util';\nimport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, NgIterable, TrackByFunction} from './iterable_differs';\n\n\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\n constructor() {}\n supports(obj: Object|null|undefined): boolean { return isListLikeIterable(obj); }\n\n create<V>(trackByFn?: TrackByFunction<V>): DefaultIterableDiffer<V> {\n return new DefaultIterableDiffer<V>(trackByFn);\n }\n}\n\nconst trackByIdentity = (index: number, item: any) => item;\n\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nexport class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {\n public readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n public readonly collection !: V[] | Iterable<V>| null;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n private _linkedRecords: _DuplicateMap<V>|null = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n private _unlinkedRecords: _DuplicateMap<V>|null = null;\n private _previousItHead: IterableChangeRecord_<V>|null = null;\n private _itHead: IterableChangeRecord_<V>|null = null;\n private _itTail: IterableChangeRecord_<V>|null = null;\n private _additionsHead: IterableChangeRecord_<V>|null = null;\n private _additionsTail: IterableChangeRecord_<V>|null = null;\n private _movesHead: IterableChangeRecord_<V>|null = null;\n private _movesTail: IterableChangeRecord_<V>|null = null;\n private _removalsHead: IterableChangeRecord_<V>|null = null;\n private _removalsTail: IterableChangeRecord_<V>|null = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n private _identityChangesHead: IterableChangeRecord_<V>|null = null;\n private _identityChangesTail: IterableChangeRecord_<V>|null = null;\n private _trackByFn: TrackByFunction<V>;\n\n constructor(trackByFn?: TrackByFunction<V>) { this._trackByFn = trackByFn || trackByIdentity; }\n\n forEachItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachOperation(\n fn: (item: IterableChangeRecord<V>, previousIndex: number|null, currentIndex: number|null) =>\n void) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets: number[]|null = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record: IterableChangeRecord<V> = !nextRemove ||\n nextIt &&\n nextIt.currentIndex ! <\n getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?\n nextIt ! :\n nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt !._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex ! - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n\n forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n\n diff(collection: NgIterable<V>): DefaultIterableDiffer<V>|null {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new Error(\n `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n\n onDestroy() {}\n\n check(collection: NgIterable<V>): boolean {\n this._reset();\n\n let record: IterableChangeRecord_<V>|null = this._itHead;\n let mayBeDirty: boolean = false;\n let index: number;\n let item: V;\n let itemTrackBy: any;\n if (Array.isArray(collection)) {\n (this as{length: number}).length = collection.length;\n\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, (item: V) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n (this as{length: number}).length = index;\n }\n\n this._truncate(record);\n (this as{collection: V[] | Iterable<V>}).collection = collection;\n return this.isDirty;\n }\n\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty(): boolean {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }\n\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record: IterableChangeRecord_<V>|null;\n let nextRecord: IterableChangeRecord_<V>|null;\n\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n\n for (record = this._movesHead; record !== null; record = nextRecord) {\n record.previousIndex = record.currentIndex;\n nextRecord = record._nextMoved;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record: IterableChangeRecord_<V>|null, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n // The previous record after which we will append the current one.\n let previousRecord: IterableChangeRecord_<V>|null;\n\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n\n // Attempt to see if we have seen the item before.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have seen this before, we need to move it forward in the collection.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._moveAfter(record, previousRecord, index);\n } else {\n // Never seen it, check evicted list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record =\n this._addAfter(new IterableChangeRecord_<V>(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record: IterableChangeRecord_<V>, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n let reinsertRecord: IterableChangeRecord_<V>|null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev !, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record: IterableChangeRecord_<V>|null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord: IterableChangeRecord_<V>|null = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n\n /** @internal */\n _reinsertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _moveAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _addAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._insertAfter(record, prevRecord, index);\n\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n\n /** @internal */\n _insertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const next: IterableChangeRecord_<V>|null =\n prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap<V>();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n\n /** @internal */\n _remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n return this._addToRemovals(this._unlink(record));\n }\n\n /** @internal */\n _unlink(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const prev = record._prev;\n const next = record._next;\n\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n\n return record;\n }\n\n /** @internal */\n _addToMoves(record: IterableChangeRecord_<V>, toIndex: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n\n if (record.previousIndex === toIndex) {\n return record;\n }\n\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n\n return record;\n }\n\n private _addToRemovals(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap<V>();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n\n /** @internal */\n _addIdentityChange(record: IterableChangeRecord_<V>, item: V) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\n\nexport class IterableChangeRecord_<V> implements IterableChangeRecord<V> {\n currentIndex: number|null = null;\n previousIndex: number|null = null;\n\n /** @internal */\n _nextPrevious: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prev: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _next: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextAdded: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextMoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextIdentityChange: IterableChangeRecord_<V>|null = null;\n\n\n constructor(public item: V, public trackById: any) {}\n}\n\n// A linked list of CollectionChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList<V> {\n /** @internal */\n _head: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _tail: IterableChangeRecord_<V>|null = null;\n\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record: IterableChangeRecord_<V>): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail !._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex !) &&\n looseIdentical(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record: IterableChangeRecord_<V>): boolean {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n\n const prev: IterableChangeRecord_<V>|null = record._prevDup;\n const next: IterableChangeRecord_<V>|null = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\n\nclass _DuplicateMap<V> {\n map = new Map<any, _DuplicateItemRecordList<V>>();\n\n put(record: IterableChangeRecord_<V>) {\n const key = record.trackById;\n\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList<V>();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n const key = record.trackById;\n const recordList: _DuplicateItemRecordList<V> = this.map.get(key) !;\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n\n get isEmpty(): boolean { return this.map.size === 0; }\n\n clear() { this.map.clear(); }\n}\n\nfunction getPreviousIndex(\n item: any, addRemoveOffset: number, moveOffsets: number[] | null): number {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isJsObject} from '../change_detection_util';\nimport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory} from './keyvalue_differs';\n\n\nexport class DefaultKeyValueDifferFactory<K, V> implements KeyValueDifferFactory {\n constructor() {}\n supports(obj: any): boolean { return obj instanceof Map || isJsObject(obj); }\n\n create<K, V>(): KeyValueDiffer<K, V> { return new DefaultKeyValueDiffer<K, V>(); }\n}\n\nexport class DefaultKeyValueDiffer<K, V> implements KeyValueDiffer<K, V>, KeyValueChanges<K, V> {\n private _records = new Map<K, KeyValueChangeRecord_<K, V>>();\n private _mapHead: KeyValueChangeRecord_<K, V>|null = null;\n // _appendAfter is used in the check loop\n private _appendAfter: KeyValueChangeRecord_<K, V>|null = null;\n private _previousMapHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesTail: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsTail: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsTail: KeyValueChangeRecord_<K, V>|null = null;\n\n get isDirty(): boolean {\n return this._additionsHead !== null || this._changesHead !== null ||\n this._removalsHead !== null;\n }\n\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n diff(map?: Map<any, any>|{[k: string]: any}|null): any {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new Error(\n `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n\n return this.check(map) ? this : null;\n }\n\n onDestroy() {}\n\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map: Map<any, any>|{[k: string]: any}): boolean {\n this._reset();\n\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n\n this._forEach(map, (value: any, key: any) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n\n this._removalsHead = insertBefore;\n\n for (let record: KeyValueChangeRecord_<K, V>|null = insertBefore; record !== null;\n record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n\n return this.isDirty;\n }\n\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n private _insertBeforeOrAppend(\n before: KeyValueChangeRecord_<K, V>|null,\n record: KeyValueChangeRecord_<K, V>): KeyValueChangeRecord_<K, V>|null {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n\n this._appendAfter = before;\n return before;\n }\n\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n\n this._appendAfter = record;\n return null;\n }\n\n private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_<K, V> {\n if (this._records.has(key)) {\n const record = this._records.get(key) !;\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n\n return record;\n }\n\n const record = new KeyValueChangeRecord_<K, V>(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record: KeyValueChangeRecord_<K, V>|null;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n\n // Add the record or a given key to the list of changes only when the value has actually changed\n private _maybeAddToChanges(record: KeyValueChangeRecord_<K, V>, newValue: any): void {\n if (!looseIdentical(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n\n private _addToAdditions(record: KeyValueChangeRecord_<K, V>) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail !._nextAdded = record;\n this._additionsTail = record;\n }\n }\n\n private _addToChanges(record: KeyValueChangeRecord_<K, V>) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail !._nextChanged = record;\n this._changesTail = record;\n }\n }\n\n /** @internal */\n private _forEach<K, V>(obj: Map<K, V>|{[k: string]: V}, fn: (v: V, k: any) => void) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach(k => fn(obj[k], k));\n }\n }\n}\n\nclass KeyValueChangeRecord_<K, V> implements KeyValueChangeRecord<K, V> {\n previousValue: V|null = null;\n currentValue: V|null = null;\n\n /** @internal */\n _nextPrevious: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _next: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _prev: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextAdded: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextRemoved: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextChanged: KeyValueChangeRecord_<K, V>|null = null;\n\n constructor(public key: K) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {defineInjectable} from '../../di/defs';\nimport {Optional, SkipSelf} from '../../di/metadata';\nimport {StaticProvider} from '../../di/provider';\nimport {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';\n\n\n/**\n * A type describing supported iterable types.\n *\n * @publicApi\n */\nexport type NgIterable<T> = Array<T>| Iterable<T>;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link NgForOf} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n * @publicApi\n */\nexport interface IterableDiffer<V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: NgIterable<V>): IterableChanges<V>|null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface IterableChanges<V> {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /**\n * Iterate over a set of operations which when applied to the original `Iterable` will produce the\n * new `Iterable`.\n *\n * NOTE: These are not necessarily the actual operations which were applied to the original\n * `Iterable`, rather these are a set of computed operations which may not be the same as the\n * ones applied.\n *\n * @param record A change which needs to be applied\n * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the\n * original `Iterable` location, where as `previousIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the\n * original `Iterable` location, where as `currentIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n */\n forEachOperation(\n fn:\n (record: IterableChangeRecord<V>, previousIndex: number|null,\n currentIndex: number|null) => void): void;\n\n /**\n * Iterate over changes in the order of original `Iterable` showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all items which had their identity (as computed by the `TrackByFunction`)\n * changed. */\n forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface IterableChangeRecord<V> {\n /** Current index of the item in `Iterable` or null if removed. */\n readonly currentIndex: number|null;\n\n /** Previous index of the item in `Iterable` or null if added. */\n readonly previousIndex: number|null;\n\n /** The item. */\n readonly item: V;\n\n /** Track by identity as computed by the `TrackByFunction`. */\n readonly trackById: any;\n}\n\n/**\n * @deprecated v4.0.0 - Use IterableChangeRecord instead.\n * @publicApi\n */\nexport interface CollectionChangeRecord<V> extends IterableChangeRecord<V> {}\n\n/**\n * An optional function passed into {@link NgForOf} that defines how to track\n * items in an iterable (e.g. fby index or id)\n *\n * @publicApi\n */\nexport interface TrackByFunction<T> { (index: number, item: T): any; }\n\n/**\n * Provides a factory for {@link IterableDiffer}.\n *\n * @publicApi\n */\nexport interface IterableDifferFactory {\n supports(objects: any): boolean;\n create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;\n}\n\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n * @publicApi\n */\nexport class IterableDiffers {\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'root',\n factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])\n });\n\n /**\n * @deprecated v4.0.0 - Should be private\n */\n factories: IterableDifferFactory[];\n constructor(factories: IterableDifferFactory[]) { this.factories = factories; }\n\n static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n\n return new IterableDiffers(factories);\n }\n\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories: IterableDifferFactory[]): StaticProvider {\n return {\n provide: IterableDiffers,\n useFactory: (parent: IterableDiffers) => {\n if (!parent) {\n // Typically would occur when calling IterableDiffers.extend inside of dependencies passed\n // to\n // bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend IterableDiffers without a parent injector');\n }\n return IterableDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(iterable: any): IterableDifferFactory {\n const factory = this.factories.find(f => f.supports(iterable));\n if (factory != null) {\n return factory;\n } else {\n throw new Error(\n `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\n\nexport function getTypeNameForDebugging(type: any): string {\n return type['name'] || typeof type;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Optional, SkipSelf, StaticProvider, defineInjectable} from '../../di';\nimport {DefaultKeyValueDifferFactory} from './default_keyvalue_differ';\n\n\n/**\n * A differ that tracks changes made to an object over time.\n *\n * @publicApi\n */\nexport interface KeyValueDiffer<K, V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: Map<K, V>): KeyValueChanges<K, V>|null;\n\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: {[key: string]: V}): KeyValueChanges<string, V>|null;\n // TODO(TS2.1): diff<KP extends string>(this: KeyValueDiffer<KP, V>, object: Record<KP, V>):\n // KeyValueDiffer<KP, V>;\n}\n\n/**\n * An object describing the changes in the `Map` or `{[k:string]: string}` since last time\n * `KeyValueDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface KeyValueChanges<K, V> {\n /**\n * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over changes in the order of original Map showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all keys for which values have changed.\n */\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all added items.\n */\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all removed items.\n */\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface KeyValueChangeRecord<K, V> {\n /**\n * Current key in the Map.\n */\n readonly key: K;\n\n /**\n * Current value for the key or `null` if removed.\n */\n readonly currentValue: V|null;\n\n /**\n * Previous value for the key or `null` if added.\n */\n readonly previousValue: V|null;\n}\n\n/**\n * Provides a factory for {@link KeyValueDiffer}.\n *\n * @publicApi\n */\nexport interface KeyValueDifferFactory {\n /**\n * Test to see if the differ knows how to diff this kind of object.\n */\n supports(objects: any): boolean;\n\n /**\n * Create a `KeyValueDiffer`.\n */\n create<K, V>(): KeyValueDiffer<K, V>;\n}\n\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n * @publicApi\n */\nexport class KeyValueDiffers {\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'root',\n factory: () => new KeyValueDiffers([new DefaultKeyValueDifferFactory()])\n });\n\n /**\n * @deprecated v4.0.0 - Should be private.\n */\n factories: KeyValueDifferFactory[];\n\n constructor(factories: KeyValueDifferFactory[]) { this.factories = factories; }\n\n static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider {\n return {\n provide: KeyValueDiffers,\n useFactory: (parent: KeyValueDiffers) => {\n if (!parent) {\n // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed\n // to bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend KeyValueDiffers without a parent injector');\n }\n return KeyValueDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(kv: any): KeyValueDifferFactory {\n const factory = this.factories.find(f => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new Error(`Cannot find a differ supporting object '${kv}'`);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nimport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nimport {IterableDifferFactory, IterableDiffers} from './differs/iterable_differs';\nimport {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\n\nexport {SimpleChanges} from '../metadata/lifecycle_hooks';\nexport {SimpleChange, WrappedValue, devModeEqual} from './change_detection_util';\nexport {ChangeDetectorRef} from './change_detector_ref';\nexport {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';\nexport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nexport {DefaultIterableDiffer} from './differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nexport {CollectionChangeRecord, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';\nexport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\nexport {PipeTransform} from './pipe_transform';\n\n\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];\n\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff: IterableDifferFactory[] = [new DefaultIterableDifferFactory()];\n\nexport const defaultIterableDiffers = new IterableDiffers(iterableDiff);\n\nexport const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n\nexport {ChangeDetectionStrategy, ChangeDetectorRef, CollectionChangeRecord, DefaultIterableDiffer, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers, NgIterable, PipeTransform, SimpleChange, SimpleChanges, TrackByFunction, WrappedValue} from './change_detection/change_detection';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformRef, createPlatformFactory} from './application_ref';\nimport {PLATFORM_ID} from './application_tokens';\nimport {Console} from './console';\nimport {Injector, StaticProvider} from './di';\nimport {TestabilityRegistry} from './testability/testability';\n\nconst _CORE_PLATFORM_PROVIDERS: StaticProvider[] = [\n // Set a default platform name for platforms that don't set it explicitly.\n {provide: PLATFORM_ID, useValue: 'unknown'},\n {provide: PlatformRef, deps: [Injector]},\n {provide: TestabilityRegistry, deps: []},\n {provide: Console, deps: []},\n];\n\n/**\n * This platform has to be included in any other platform\n *\n * @publicApi\n */\nexport const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\n\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n#setting-up-locale) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const LOCALE_ID = new InjectionToken<string>('LocaleId');\n\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS = new InjectionToken<string>('Translations');\n\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS_FORMAT = new InjectionToken<string>('TranslationsFormat');\n\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n#missing-translation) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nexport enum MissingTranslationStrategy {\n Error = 0,\n Warning = 1,\n Ignore = 2,\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nimport {ApplicationRef} from './application_ref';\nimport {APP_ID_RANDOM_PROVIDER} from './application_tokens';\nimport {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';\nimport {Console} from './console';\nimport {InjectionToken, Injector, StaticProvider} from './di';\nimport {Inject, Optional, SkipSelf} from './di/metadata';\nimport {ErrorHandler} from './error_handler';\nimport {LOCALE_ID} from './i18n/tokens';\nimport {ComponentFactoryResolver} from './linker';\nimport {Compiler} from './linker/compiler';\nimport {NgModule} from './metadata';\nimport {NgZone} from './zone';\n\nexport function _iterableDiffersFactory() {\n return defaultIterableDiffers;\n}\n\nexport function _keyValueDiffersFactory() {\n return defaultKeyValueDiffers;\n}\n\nexport function _localeFactory(locale?: string): string {\n return locale || 'en-US';\n}\n\n/**\n * A built-in [dependency injection token](guide/glossary#di-token)\n * that is used to configure the root injector for bootstrapping.\n */\nexport const APPLICATION_MODULE_PROVIDERS: StaticProvider[] = [\n {\n provide: ApplicationRef,\n useClass: ApplicationRef,\n deps:\n [NgZone, Console, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus]\n },\n {\n provide: ApplicationInitStatus,\n useClass: ApplicationInitStatus,\n deps: [[new Optional(), APP_INITIALIZER]]\n },\n {provide: Compiler, useClass: Compiler, deps: []},\n APP_ID_RANDOM_PROVIDER,\n {provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: []},\n {provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: []},\n {\n provide: LOCALE_ID,\n useFactory: _localeFactory,\n deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]\n },\n];\n\n/**\n * Configures the root injector for an app with\n * providers of `@angular/core` dependencies that `ApplicationRef` needs\n * to bootstrap components.\n *\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command.\n *\n * @publicApi\n */\n@NgModule({providers: APPLICATION_MODULE_PROVIDERS})\nexport class ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef: ApplicationRef) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const SWITCH_IVY_ENABLED__POST_R3__ = true;\nconst SWITCH_IVY_ENABLED__PRE_R3__ = false;\nexport const ivyEnabled = SWITCH_IVY_ENABLED__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {ErrorHandler} from '../error_handler';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {QueryList} from '../linker/query_list';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer2, RendererFactory2, RendererType2} from '../render/api';\nimport {Sanitizer, SecurityContext} from '../sanitization/security';\nimport {Type} from '../type';\n\n\n// -------------------------------------\n// Defs\n// -------------------------------------\n\n/**\n * Factory for ViewDefinitions/NgModuleDefinitions.\n * We use a function so we can reexeute it in case an error happens and use the given logger\n * function to log the error from the definition of the node, which is shown in all browser\n * logs.\n */\nexport interface DefinitionFactory<D extends Definition<any>> { (logger: NodeLogger): D; }\n\n/**\n * Function to call console.error at the right source location. This is an indirection\n * via another function as browser will log the location that actually called\n * `console.error`.\n */\nexport interface NodeLogger { (): () => void; }\n\nexport interface Definition<DF extends DefinitionFactory<any>> { factory: DF|null; }\n\nexport interface NgModuleDefinition extends Definition<NgModuleDefinitionFactory> {\n providers: NgModuleProviderDef[];\n providersByKey: {[tokenKey: string]: NgModuleProviderDef};\n modules: any[];\n isRoot: boolean;\n}\n\nexport interface NgModuleDefinitionFactory extends DefinitionFactory<NgModuleDefinition> {}\n\nexport interface ViewDefinition extends Definition<ViewDefinitionFactory> {\n flags: ViewFlags;\n updateDirectives: ViewUpdateFn;\n updateRenderer: ViewUpdateFn;\n handleEvent: ViewHandleEventFn;\n /**\n * Order: Depth first.\n * Especially providers are before elements / anchors.\n */\n nodes: NodeDef[];\n /** aggregated NodeFlags for all nodes **/\n nodeFlags: NodeFlags;\n rootNodeFlags: NodeFlags;\n lastRenderRootNode: NodeDef|null;\n bindingCount: number;\n outputCount: number;\n /**\n * Binary or of all query ids that are matched by one of the nodes.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n nodeMatchedQueries: number;\n}\n\nexport interface ViewDefinitionFactory extends DefinitionFactory<ViewDefinition> {}\n\n\nexport interface ViewUpdateFn { (check: NodeCheckFn, view: ViewData): void; }\n\n// helper functions to create an overloaded function type.\nexport interface NodeCheckFn {\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Dynamic, values: any[]): any;\n\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Inline, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any;\n}\n\nexport const enum ArgumentType {Inline = 0, Dynamic = 1}\n\nexport interface ViewHandleEventFn {\n (view: ViewData, nodeIndex: number, eventName: string, event: any): boolean;\n}\n\n/**\n * Bitmask for ViewDefinition.flags.\n */\nexport const enum ViewFlags {\n None = 0,\n OnPush = 1 << 1,\n}\n\n/**\n * A node definition in the view.\n *\n * Note: We use one type for all nodes so that loops that loop over all nodes\n * of a ViewDefinition stay monomorphic!\n */\nexport interface NodeDef {\n flags: NodeFlags;\n // Index of the node in view data and view definition (those are the same)\n nodeIndex: number;\n // Index of the node in the check functions\n // Differ from nodeIndex when nodes are added or removed at runtime (ie after compilation)\n checkIndex: number;\n parent: NodeDef|null;\n renderParent: NodeDef|null;\n /** this is checked against NgContentDef.index to find matched nodes */\n ngContentIndex: number|null;\n /** number of transitive children */\n childCount: number;\n /** aggregated NodeFlags for all transitive children (does not include self) **/\n childFlags: NodeFlags;\n /** aggregated NodeFlags for all direct children (does not include self) **/\n directChildFlags: NodeFlags;\n\n bindingIndex: number;\n bindings: BindingDef[];\n bindingFlags: BindingFlags;\n outputIndex: number;\n outputs: OutputDef[];\n /**\n * references that the user placed on the element\n */\n references: {[refId: string]: QueryValueType};\n /**\n * ids and value types of all queries that are matched by this node.\n */\n matchedQueries: {[queryId: number]: QueryValueType};\n /** Binary or of all matched query ids of this node. */\n matchedQueryIds: number;\n /**\n * Binary or of all query ids that are matched by one of the children.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n childMatchedQueries: number;\n element: ElementDef|null;\n provider: ProviderDef|null;\n text: TextDef|null;\n query: QueryDef|null;\n ngContent: NgContentDef|null;\n}\n\n/**\n * Bitmask for NodeDef.flags.\n * Naming convention:\n * - `Type...`: flags that are mutually exclusive\n * - `Cat...`: union of multiple `Type...` (short for category).\n */\nexport const enum NodeFlags {\n None = 0,\n TypeElement = 1 << 0,\n TypeText = 1 << 1,\n ProjectedTemplate = 1 << 2,\n CatRenderNode = TypeElement | TypeText,\n TypeNgContent = 1 << 3,\n TypePipe = 1 << 4,\n TypePureArray = 1 << 5,\n TypePureObject = 1 << 6,\n TypePurePipe = 1 << 7,\n CatPureExpression = TypePureArray | TypePureObject | TypePurePipe,\n TypeValueProvider = 1 << 8,\n TypeClassProvider = 1 << 9,\n TypeFactoryProvider = 1 << 10,\n TypeUseExistingProvider = 1 << 11,\n LazyProvider = 1 << 12,\n PrivateProvider = 1 << 13,\n TypeDirective = 1 << 14,\n Component = 1 << 15,\n CatProviderNoDirective =\n TypeValueProvider | TypeClassProvider | TypeFactoryProvider | TypeUseExistingProvider,\n CatProvider = CatProviderNoDirective | TypeDirective,\n OnInit = 1 << 16,\n OnDestroy = 1 << 17,\n DoCheck = 1 << 18,\n OnChanges = 1 << 19,\n AfterContentInit = 1 << 20,\n AfterContentChecked = 1 << 21,\n AfterViewInit = 1 << 22,\n AfterViewChecked = 1 << 23,\n EmbeddedViews = 1 << 24,\n ComponentView = 1 << 25,\n TypeContentQuery = 1 << 26,\n TypeViewQuery = 1 << 27,\n StaticQuery = 1 << 28,\n DynamicQuery = 1 << 29,\n TypeNgModule = 1 << 30,\n CatQuery = TypeContentQuery | TypeViewQuery,\n\n // mutually exclusive values...\n Types = CatRenderNode | TypeNgContent | TypePipe | CatPureExpression | CatProvider | CatQuery\n}\n\nexport interface BindingDef {\n flags: BindingFlags;\n ns: string|null;\n name: string|null;\n nonMinifiedName: string|null;\n securityContext: SecurityContext|null;\n suffix: string|null;\n}\n\nexport const enum BindingFlags {\n TypeElementAttribute = 1 << 0,\n TypeElementClass = 1 << 1,\n TypeElementStyle = 1 << 2,\n TypeProperty = 1 << 3,\n SyntheticProperty = 1 << 4,\n SyntheticHostProperty = 1 << 5,\n CatSyntheticProperty = SyntheticProperty | SyntheticHostProperty,\n\n // mutually exclusive values...\n Types = TypeElementAttribute | TypeElementClass | TypeElementStyle | TypeProperty\n}\n\nexport interface OutputDef {\n type: OutputType;\n target: 'window'|'document'|'body'|'component'|null;\n eventName: string;\n propName: string|null;\n}\n\nexport const enum OutputType {ElementOutput, DirectiveOutput}\n\nexport const enum QueryValueType {\n ElementRef = 0,\n RenderElement = 1,\n TemplateRef = 2,\n ViewContainerRef = 3,\n Provider = 4\n}\n\nexport interface ElementDef {\n // set to null for `<ng-container>`\n name: string|null;\n ns: string|null;\n /** ns, name, value */\n attrs: [string, string, string][]|null;\n template: ViewDefinition|null;\n componentProvider: NodeDef|null;\n componentRendererType: RendererType2|null;\n // closure to allow recursive components\n componentView: ViewDefinitionFactory|null;\n /**\n * visible public providers for DI in the view,\n * as see from this element. This does not include private providers.\n */\n publicProviders: {[tokenKey: string]: NodeDef}|null;\n /**\n * same as visiblePublicProviders, but also includes private providers\n * that are located on this element.\n */\n allProviders: {[tokenKey: string]: NodeDef}|null;\n handleEvent: ElementHandleEventFn|null;\n}\n\nexport interface ElementHandleEventFn { (view: ViewData, eventName: string, event: any): boolean; }\n\nexport interface ProviderDef {\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface NgModuleProviderDef {\n flags: NodeFlags;\n index: number;\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface DepDef {\n flags: DepFlags;\n token: any;\n tokenKey: string;\n}\n\n/**\n * Bitmask for DI flags\n */\nexport const enum DepFlags {\n None = 0,\n SkipSelf = 1 << 0,\n Optional = 1 << 1,\n Self = 1 << 2,\n Value = 1 << 3,\n}\n\nexport interface TextDef { prefix: string; }\n\nexport interface QueryDef {\n id: number;\n // variant of the id that can be used to check against NodeDef.matchedQueryIds, ...\n filterId: number;\n bindings: QueryBindingDef[];\n}\n\nexport interface QueryBindingDef {\n propName: string;\n bindingType: QueryBindingType;\n}\n\nexport const enum QueryBindingType {First = 0, All = 1}\n\nexport interface NgContentDef {\n /**\n * this index is checked against NodeDef.ngContentIndex to find the nodes\n * that are matched by this ng-content.\n * Note that a NodeDef with an ng-content can be reprojected, i.e.\n * have a ngContentIndex on its own.\n */\n index: number;\n}\n\n// -------------------------------------\n// Data\n// -------------------------------------\n\nexport interface NgModuleData extends Injector, NgModuleRef<any> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _def: NgModuleDefinition;\n _parent: Injector;\n _providers: any[];\n}\n\n/**\n * View instance data.\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ViewData {\n def: ViewDefinition;\n root: RootData;\n renderer: Renderer2;\n // index of component provider / anchor.\n parentNodeDef: NodeDef|null;\n parent: ViewData|null;\n viewContainerParent: ViewData|null;\n component: any;\n context: any;\n // Attention: Never loop over this, as this will\n // create a polymorphic usage site.\n // Instead: Always loop over ViewDefinition.nodes,\n // and call the right accessor (e.g. `elementData`) based on\n // the NodeType.\n nodes: {[key: number]: NodeData};\n state: ViewState;\n oldValues: any[];\n disposables: DisposableFn[]|null;\n initIndex: number;\n}\n\n/**\n * Bitmask of states\n */\nexport const enum ViewState {\n BeforeFirstCheck = 1 << 0,\n FirstCheck = 1 << 1,\n Attached = 1 << 2,\n ChecksEnabled = 1 << 3,\n IsProjectedView = 1 << 4,\n CheckProjectedView = 1 << 5,\n CheckProjectedViews = 1 << 6,\n Destroyed = 1 << 7,\n\n // InitState Uses 3 bits\n InitState_Mask = 7 << 8,\n InitState_BeforeInit = 0 << 8,\n InitState_CallingOnInit = 1 << 8,\n InitState_CallingAfterContentInit = 2 << 8,\n InitState_CallingAfterViewInit = 3 << 8,\n InitState_AfterInit = 4 << 8,\n\n CatDetectChanges = Attached | ChecksEnabled,\n CatInit = BeforeFirstCheck | CatDetectChanges | InitState_BeforeInit\n}\n\n// Called before each cycle of a view's check to detect whether this is in the\n// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit\n// lifecycle methods. Returns true if this check cycle should call lifecycle\n// methods.\nexport function shiftInitState(\n view: ViewData, priorInitState: ViewState, newInitState: ViewState): boolean {\n // Only update the InitState if we are currently in the prior state.\n // For example, only move into CallingInit if we are in BeforeInit. Only\n // move into CallingContentInit if we are in CallingInit. Normally this will\n // always be true because of how checkCycle is called in checkAndUpdateView.\n // However, if checkAndUpdateView is called recursively or if an exception is\n // thrown while checkAndUpdateView is running, checkAndUpdateView starts over\n // from the beginning. This ensures the state is monotonically increasing,\n // terminating in the AfterInit state, which ensures the Init methods are called\n // at least once and only once.\n const state = view.state;\n const initState = state & ViewState.InitState_Mask;\n if (initState === priorInitState) {\n view.state = (state & ~ViewState.InitState_Mask) | newInitState;\n view.initIndex = -1;\n return true;\n }\n return initState === newInitState;\n}\n\n// Returns true if the lifecycle init method should be called for the node with\n// the given init index.\nexport function shouldCallLifecycleInitHook(\n view: ViewData, initState: ViewState, index: number): boolean {\n if ((view.state & ViewState.InitState_Mask) === initState && view.initIndex <= index) {\n view.initIndex = index + 1;\n return true;\n }\n return false;\n}\n\nexport interface DisposableFn { (): void; }\n\n/**\n * Node instance data.\n *\n * We have a separate type per NodeType to save memory\n * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)\n *\n * To keep our code monomorphic,\n * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).\n * This way, no usage site can get a `NodeData` from view.nodes and then use it for different\n * purposes.\n */\nexport class NodeData { private __brand: any; }\n\n/**\n * Data for an instantiated NodeType.Text.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface TextData { renderText: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asTextData(view: ViewData, index: number): TextData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Element.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ElementData {\n renderElement: any;\n componentView: ViewData;\n viewContainer: ViewContainerData|null;\n template: TemplateData;\n}\n\nexport interface ViewContainerData extends ViewContainerRef {\n // Note: we are using the prefix _ as ViewContainerData is a ViewContainerRef and therefore\n // directly\n // exposed to the user.\n _embeddedViews: ViewData[];\n}\n\nexport interface TemplateData extends TemplateRef<any> {\n // views that have been created from the template\n // of this element,\n // but inserted into the embeddedViews of another element.\n // By default, this is undefined.\n // Note: we are using the prefix _ as TemplateData is a TemplateRef and therefore directly\n // exposed to the user.\n _projectedViews: ViewData[];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asElementData(view: ViewData, index: number): ElementData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Provider.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ProviderData { instance: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asProviderData(view: ViewData, index: number): ProviderData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.PureExpression.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface PureExpressionData { value: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asPureExpressionData(view: ViewData, index: number): PureExpressionData {\n return <any>view.nodes[index];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asQueryList(view: ViewData, index: number): QueryList<any> {\n return <any>view.nodes[index];\n}\n\nexport interface RootData {\n injector: Injector;\n ngModule: NgModuleRef<any>;\n projectableNodes: any[][];\n selectorOrNode: any;\n renderer: Renderer2;\n rendererFactory: RendererFactory2;\n errorHandler: ErrorHandler;\n sanitizer: Sanitizer;\n}\n\nexport abstract class DebugContext {\n abstract get view(): ViewData;\n abstract get nodeIndex(): number|null;\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get componentRenderElement(): any;\n abstract get renderNode(): any;\n abstract logError(console: Console, ...values: any[]): void;\n}\n\n// -------------------------------------\n// Other\n// -------------------------------------\n\nexport const enum CheckType {CheckAndUpdate, CheckNoChanges}\n\nexport interface ProviderOverride {\n token: any;\n flags: NodeFlags;\n value: any;\n deps: ([DepFlags, any]|any)[];\n deprecatedBehavior: boolean;\n}\n\nexport interface Services {\n setCurrentNode(view: ViewData, nodeIndex: number): void;\n createRootView(\n injector: Injector, projectableNodes: any[][], rootSelectorOrNode: string|any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData;\n createEmbeddedView(parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any):\n ViewData;\n createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData;\n createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any>;\n overrideProvider(override: ProviderOverride): void;\n overrideComponentView(compType: Type<any>, compFactory: ComponentFactory<any>): void;\n clearOverrides(): void;\n checkAndUpdateView(view: ViewData): void;\n checkNoChangesView(view: ViewData): void;\n destroyView(view: ViewData): void;\n resolveDep(\n view: ViewData, elDef: NodeDef|null, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue?: any): any;\n createDebugContext(view: ViewData, nodeIndex: number): DebugContext;\n handleEvent: ViewHandleEventFn;\n updateDirectives: (view: ViewData, checkType: CheckType) => void;\n updateRenderer: (view: ViewData, checkType: CheckType) => void;\n dirtyParentQueries: (view: ViewData) => void;\n}\n\n/**\n * This object is used to prevent cycles in the source files and to have a place where\n * debug mode can hook it. It is lazily filled when `isDevMode` is known.\n */\nexport const Services: Services = {\n setCurrentNode: undefined !,\n createRootView: undefined !,\n createEmbeddedView: undefined !,\n createComponentView: undefined !,\n createNgModuleRef: undefined !,\n overrideProvider: undefined !,\n overrideComponentView: undefined !,\n clearOverrides: undefined !,\n checkAndUpdateView: undefined !,\n checkNoChangesView: undefined !,\n destroyView: undefined !,\n resolveDep: undefined !,\n createDebugContext: undefined !,\n handleEvent: undefined !,\n updateDirectives: undefined !,\n updateRenderer: undefined !,\n dirtyParentQueries: undefined !,\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_DEBUG_CONTEXT, ERROR_LOGGER, getDebugContext} from '../errors';\nimport {DebugContext, ViewState} from './types';\n\nexport function expressionChangedAfterItHasBeenCheckedError(\n context: DebugContext, oldValue: any, currValue: any, isFirstCheck: boolean): Error {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (isFirstCheck) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n return viewDebugError(msg, context);\n}\n\nexport function viewWrappedDebugError(err: any, context: DebugContext): Error {\n if (!(err instanceof Error)) {\n // errors that are not Error instances don't have a stack,\n // so it is ok to wrap them into a new Error object...\n err = new Error(err.toString());\n }\n _addDebugContext(err, context);\n return err;\n}\n\nexport function viewDebugError(msg: string, context: DebugContext): Error {\n const err = new Error(msg);\n _addDebugContext(err, context);\n return err;\n}\n\nfunction _addDebugContext(err: Error, context: DebugContext) {\n (err as any)[ERROR_DEBUG_CONTEXT] = context;\n (err as any)[ERROR_LOGGER] = context.logError.bind(context);\n}\n\nexport function isViewDebugError(err: Error): boolean {\n return !!getDebugContext(err);\n}\n\nexport function viewDestroyedError(action: string): Error {\n return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${action}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WrappedValue, devModeEqual} from '../change_detection/change_detection';\nimport {SOURCE} from '../di/injector';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {looseIdentical, stringify} from '../util';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {BindingDef, BindingFlags, Definition, DefinitionFactory, DepDef, DepFlags, ElementData, NodeDef, NodeFlags, QueryValueType, Services, ViewData, ViewDefinition, ViewDefinitionFactory, ViewFlags, ViewState, asElementData, asTextData} from './types';\n\nexport const NOOP: any = () => {};\n\nconst _tokenKeyCache = new Map<any, string>();\n\nexport function tokenKey(token: any): string {\n let key = _tokenKeyCache.get(token);\n if (!key) {\n key = stringify(token) + '_' + _tokenKeyCache.size;\n _tokenKeyCache.set(token, key);\n }\n return key;\n}\n\nexport function unwrapValue(view: ViewData, nodeIdx: number, bindingIdx: number, value: any): any {\n if (WrappedValue.isWrapped(value)) {\n value = WrappedValue.unwrap(value);\n const globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n const oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);\n view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n }\n return value;\n}\n\nconst UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\nconst EMPTY_RENDERER_TYPE_ID = '$$empty';\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createRendererType2(values: {\n styles: (string | any[])[],\n encapsulation: ViewEncapsulation,\n data: {[kind: string]: any[]}\n}): RendererType2 {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}\n\nlet _renderCompCount = 0;\n\nexport function resolveRendererType2(type?: RendererType2 | null): RendererType2|null {\n if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {\n // first time we see this RendererType2. Initialize it...\n const isFilled =\n ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||\n type.styles.length || Object.keys(type.data).length);\n if (isFilled) {\n type.id = `c${_renderCompCount++}`;\n } else {\n type.id = EMPTY_RENDERER_TYPE_ID;\n }\n }\n if (type && type.id === EMPTY_RENDERER_TYPE_ID) {\n type = null;\n }\n return type || null;\n}\n\nexport function checkBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n const oldValues = view.oldValues;\n if ((view.state & ViewState.FirstCheck) ||\n !looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {\n return true;\n }\n return false;\n}\n\nexport function checkAndUpdateBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n if (checkBinding(view, def, bindingIdx, value)) {\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return true;\n }\n return false;\n}\n\nexport function checkBindingNoChanges(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n const oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n if ((view.state & ViewState.BeforeFirstCheck) || !devModeEqual(oldValue, value)) {\n const bindingName = def.bindings[bindingIdx].name;\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`,\n `${bindingName}: ${value}`, (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function markParentViewsForCheck(view: ViewData) {\n let currView: ViewData|null = view;\n while (currView) {\n if (currView.def.flags & ViewFlags.OnPush) {\n currView.state |= ViewState.ChecksEnabled;\n }\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function markParentViewsForCheckProjectedViews(view: ViewData, endView: ViewData) {\n let currView: ViewData|null = view;\n while (currView && currView !== endView) {\n currView.state |= ViewState.CheckProjectedViews;\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function dispatchEvent(\n view: ViewData, nodeIndex: number, eventName: string, event: any): boolean|undefined {\n try {\n const nodeDef = view.def.nodes[nodeIndex];\n const startView = nodeDef.flags & NodeFlags.ComponentView ?\n asElementData(view, nodeIndex).componentView :\n view;\n markParentViewsForCheck(startView);\n return Services.handleEvent(view, nodeIndex, eventName, event);\n } catch (e) {\n // Attention: Don't rethrow, as it would cancel Observable subscriptions!\n view.root.errorHandler.handleError(e);\n }\n}\n\nexport function declaredViewContainer(view: ViewData): ElementData|null {\n if (view.parent) {\n const parentView = view.parent;\n return asElementData(parentView, view.parentNodeDef !.nodeIndex);\n }\n return null;\n}\n\n/**\n * for component views, this is the host element.\n * for embedded views, this is the index of the parent node\n * that contains the view container.\n */\nexport function viewParentEl(view: ViewData): NodeDef|null {\n const parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef !.parent;\n } else {\n return null;\n }\n}\n\nexport function renderNode(view: ViewData, def: NodeDef): any {\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return asElementData(view, def.nodeIndex).renderElement;\n case NodeFlags.TypeText:\n return asTextData(view, def.nodeIndex).renderText;\n }\n}\n\nexport function elementEventFullName(target: string | null, name: string): string {\n return target ? `${target}:${name}` : name;\n}\n\nexport function isComponentView(view: ViewData): boolean {\n return !!view.parent && !!(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function isEmbeddedView(view: ViewData): boolean {\n return !!view.parent && !(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function filterQueryId(queryId: number): number {\n return 1 << (queryId % 32);\n}\n\nexport function splitMatchedQueriesDsl(\n matchedQueriesDsl: [string | number, QueryValueType][] | null): {\n matchedQueries: {[queryId: string]: QueryValueType},\n references: {[refId: string]: QueryValueType},\n matchedQueryIds: number\n} {\n const matchedQueries: {[queryId: string]: QueryValueType} = {};\n let matchedQueryIds = 0;\n const references: {[refId: string]: QueryValueType} = {};\n if (matchedQueriesDsl) {\n matchedQueriesDsl.forEach(([queryId, valueType]) => {\n if (typeof queryId === 'number') {\n matchedQueries[queryId] = valueType;\n matchedQueryIds |= filterQueryId(queryId);\n } else {\n references[queryId] = valueType;\n }\n });\n }\n return {matchedQueries, references, matchedQueryIds};\n}\n\nexport function splitDepsDsl(deps: ([DepFlags, any] | any)[], sourceName?: string): DepDef[] {\n return deps.map(value => {\n let token: any;\n let flags: DepFlags;\n if (Array.isArray(value)) {\n [flags, token] = value;\n } else {\n flags = DepFlags.None;\n token = value;\n }\n if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {\n Object.defineProperty(token, SOURCE, {value: sourceName, configurable: true});\n }\n return {flags, token, tokenKey: tokenKey(token)};\n });\n}\n\nexport function getParentRenderElement(view: ViewData, renderHost: any, def: NodeDef): any {\n let renderParent = def.renderParent;\n if (renderParent) {\n if ((renderParent.flags & NodeFlags.TypeElement) === 0 ||\n (renderParent.flags & NodeFlags.ComponentView) === 0 ||\n (renderParent.element !.componentRendererType &&\n renderParent.element !.componentRendererType !.encapsulation ===\n ViewEncapsulation.Native)) {\n // only children of non components, or children of components with native encapsulation should\n // be attached.\n return asElementData(view, def.renderParent !.nodeIndex).renderElement;\n }\n } else {\n return renderHost;\n }\n}\n\nconst DEFINITION_CACHE = new WeakMap<any, Definition<any>>();\n\nexport function resolveDefinition<D extends Definition<any>>(factory: DefinitionFactory<D>): D {\n let value = DEFINITION_CACHE.get(factory) !as D;\n if (!value) {\n value = factory(() => NOOP);\n value.factory = factory;\n DEFINITION_CACHE.set(factory, value);\n }\n return value;\n}\n\nexport function rootRenderNodes(view: ViewData): any[] {\n const renderNodes: any[] = [];\n visitRootRenderNodes(view, RenderNodeAction.Collect, undefined, undefined, renderNodes);\n return renderNodes;\n}\n\nexport const enum RenderNodeAction {Collect, AppendChild, InsertBefore, RemoveChild}\n\nexport function visitRootRenderNodes(\n view: ViewData, action: RenderNodeAction, parentNode: any, nextSibling: any, target?: any[]) {\n // We need to re-compute the parent node in case the nodes have been moved around manually\n if (action === RenderNodeAction.RemoveChild) {\n parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode !));\n }\n visitSiblingRenderNodes(\n view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n}\n\nexport function visitSiblingRenderNodes(\n view: ViewData, action: RenderNodeAction, startIndex: number, endIndex: number, parentNode: any,\n nextSibling: any, target?: any[]) {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & (NodeFlags.TypeElement | NodeFlags.TypeText | NodeFlags.TypeNgContent)) {\n visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n}\n\nexport function visitProjectedRenderNodes(\n view: ViewData, ngContentIndex: number, action: RenderNodeAction, parentNode: any,\n nextSibling: any, target?: any[]) {\n let compView: ViewData|null = view;\n while (compView && !isComponentView(compView)) {\n compView = compView.parent;\n }\n const hostView = compView !.parent;\n const hostElDef = viewParentEl(compView !);\n const startIndex = hostElDef !.nodeIndex + 1;\n const endIndex = hostElDef !.nodeIndex + hostElDef !.childCount;\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = hostView !.def.nodes[i];\n if (nodeDef.ngContentIndex === ngContentIndex) {\n visitRenderNode(hostView !, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n if (!hostView !.parent) {\n // a root view\n const projectedNodes = view.root.projectableNodes[ngContentIndex];\n if (projectedNodes) {\n for (let i = 0; i < projectedNodes.length; i++) {\n execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n }\n }\n }\n}\n\nfunction visitRenderNode(\n view: ViewData, nodeDef: NodeDef, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n if (nodeDef.flags & NodeFlags.TypeNgContent) {\n visitProjectedRenderNodes(\n view, nodeDef.ngContent !.index, action, parentNode, nextSibling, target);\n } else {\n const rn = renderNode(view, nodeDef);\n if (action === RenderNodeAction.RemoveChild && (nodeDef.flags & NodeFlags.ComponentView) &&\n (nodeDef.bindingFlags & BindingFlags.CatSyntheticProperty)) {\n // Note: we might need to do both actions.\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticProperty)) {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticHostProperty)) {\n const compView = asElementData(view, nodeDef.nodeIndex).componentView;\n execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);\n }\n } else {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n }\n }\n if (nodeDef.flags & NodeFlags.TypeElement && !nodeDef.element !.name) {\n visitSiblingRenderNodes(\n view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode,\n nextSibling, target);\n }\n }\n}\n\nfunction execRenderNodeAction(\n view: ViewData, renderNode: any, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n const renderer = view.renderer;\n switch (action) {\n case RenderNodeAction.AppendChild:\n renderer.appendChild(parentNode, renderNode);\n break;\n case RenderNodeAction.InsertBefore:\n renderer.insertBefore(parentNode, renderNode, nextSibling);\n break;\n case RenderNodeAction.RemoveChild:\n renderer.removeChild(parentNode, renderNode);\n break;\n case RenderNodeAction.Collect:\n target !.push(renderNode);\n break;\n }\n}\n\nconst NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n\nexport function splitNamespace(name: string): string[] {\n if (name[0] === ':') {\n const match = name.match(NS_PREFIX_RE) !;\n return [match[1], match[2]];\n }\n return ['', name];\n}\n\nexport function calcBindingFlags(bindings: BindingDef[]): BindingFlags {\n let flags = 0;\n for (let i = 0; i < bindings.length; i++) {\n flags |= bindings[i].flags;\n }\n return flags;\n}\n\nexport function interpolate(valueCount: number, constAndInterp: string[]): string {\n let result = '';\n for (let i = 0; i < valueCount * 2; i = i + 2) {\n result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);\n }\n return result + constAndInterp[valueCount * 2];\n}\n\nexport function inlineInterpolate(\n valueCount: number, c0: string, a1: any, c1: string, a2?: any, c2?: string, a3?: any,\n c3?: string, a4?: any, c4?: string, a5?: any, c5?: string, a6?: any, c6?: string, a7?: any,\n c7?: string, a8?: any, c8?: string, a9?: any, c9?: string): string {\n switch (valueCount) {\n case 1:\n return c0 + _toStringWithNull(a1) + c1;\n case 2:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;\n case 3:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3;\n case 4:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4;\n case 5:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;\n case 6:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;\n case 7:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7;\n case 8:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;\n case 9:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;\n default:\n throw new Error(`Does not support more than 9 expressions`);\n }\n}\n\nfunction _toStringWithNull(v: any): string {\n return v != null ? v.toString() : '';\n}\n\nexport const EMPTY_ARRAY: any[] = [];\nexport const EMPTY_MAP: {[key: string]: any} = {};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {SecurityContext} from '../sanitization/security';\n\nimport {BindingDef, BindingFlags, ElementData, ElementHandleEventFn, NodeDef, NodeFlags, OutputDef, OutputType, QueryValueType, ViewData, ViewDefinitionFactory, asElementData} from './types';\nimport {NOOP, calcBindingFlags, checkAndUpdateBinding, dispatchEvent, elementEventFullName, getParentRenderElement, resolveDefinition, resolveRendererType2, splitMatchedQueriesDsl, splitNamespace} from './util';\n\nexport function anchorDef(\n flags: NodeFlags, matchedQueriesDsl: null | [string | number, QueryValueType][],\n ngContentIndex: null | number, childCount: number, handleEvent?: null | ElementHandleEventFn,\n templateFactory?: ViewDefinitionFactory): NodeDef {\n flags |= NodeFlags.TypeElement;\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n const template = templateFactory ? resolveDefinition(templateFactory) : null;\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n flags,\n checkIndex: -1,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: {\n ns: null,\n name: null,\n attrs: null, template,\n componentProvider: null,\n componentView: null,\n componentRendererType: null,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function elementDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: null | [string | number, QueryValueType][], ngContentIndex: null | number,\n childCount: number, namespaceAndName: string | null, fixedAttrs: null | [string, string][] = [],\n bindings?: null | [BindingFlags, string, string | SecurityContext | null][],\n outputs?: null | ([string, string])[], handleEvent?: null | ElementHandleEventFn,\n componentView?: null | ViewDefinitionFactory,\n componentRendererType?: RendererType2 | null): NodeDef {\n if (!handleEvent) {\n handleEvent = NOOP;\n }\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n let ns: string = null !;\n let name: string = null !;\n if (namespaceAndName) {\n [ns, name] = splitNamespace(namespaceAndName);\n }\n bindings = bindings || [];\n const bindingDefs: BindingDef[] = new Array(bindings.length);\n for (let i = 0; i < bindings.length; i++) {\n const [bindingFlags, namespaceAndName, suffixOrSecurityContext] = bindings[i];\n\n const [ns, name] = splitNamespace(namespaceAndName);\n let securityContext: SecurityContext = undefined !;\n let suffix: string = undefined !;\n switch (bindingFlags & BindingFlags.Types) {\n case BindingFlags.TypeElementStyle:\n suffix = <string>suffixOrSecurityContext;\n break;\n case BindingFlags.TypeElementAttribute:\n case BindingFlags.TypeProperty:\n securityContext = <SecurityContext>suffixOrSecurityContext;\n break;\n }\n bindingDefs[i] =\n {flags: bindingFlags, ns, name, nonMinifiedName: name, securityContext, suffix};\n }\n outputs = outputs || [];\n const outputDefs: OutputDef[] = new Array(outputs.length);\n for (let i = 0; i < outputs.length; i++) {\n const [target, eventName] = outputs[i];\n outputDefs[i] = {\n type: OutputType.ElementOutput,\n target: <any>target, eventName,\n propName: null\n };\n }\n fixedAttrs = fixedAttrs || [];\n const attrs = <[string, string, string][]>fixedAttrs.map(([namespaceAndName, value]) => {\n const [ns, name] = splitNamespace(namespaceAndName);\n return [ns, name, value];\n });\n componentRendererType = resolveRendererType2(componentRendererType);\n if (componentView) {\n flags |= NodeFlags.ComponentView;\n }\n flags |= NodeFlags.TypeElement;\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: bindingDefs,\n bindingFlags: calcBindingFlags(bindingDefs),\n outputs: outputDefs,\n element: {\n ns,\n name,\n attrs,\n template: null,\n // will bet set by the view definition\n componentProvider: null,\n componentView: componentView || null,\n componentRendererType: componentRendererType,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP,\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createElement(view: ViewData, renderHost: any, def: NodeDef): ElementData {\n const elDef = def.element !;\n const rootSelectorOrNode = view.root.selectorOrNode;\n const renderer = view.renderer;\n let el: any;\n if (view.parent || !rootSelectorOrNode) {\n if (elDef.name) {\n el = renderer.createElement(elDef.name, elDef.ns);\n } else {\n el = renderer.createComment('');\n }\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, el);\n }\n } else {\n // when using native Shadow DOM, do not clear the root element contents to allow slot projection\n const preserveContent =\n (!!elDef.componentRendererType &&\n elDef.componentRendererType.encapsulation === ViewEncapsulation.ShadowDom);\n el = renderer.selectRootElement(rootSelectorOrNode, preserveContent);\n }\n if (elDef.attrs) {\n for (let i = 0; i < elDef.attrs.length; i++) {\n const [ns, name, value] = elDef.attrs[i];\n renderer.setAttribute(el, name, value, ns);\n }\n }\n return el;\n}\n\nexport function listenToElementOutputs(view: ViewData, compView: ViewData, def: NodeDef, el: any) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const handleEventClosure = renderEventHandlerClosure(\n view, def.nodeIndex, elementEventFullName(output.target, output.eventName));\n let listenTarget: 'window'|'document'|'body'|'component'|null = output.target;\n let listenerView = view;\n if (output.target === 'component') {\n listenTarget = null;\n listenerView = compView;\n }\n const disposable =\n <any>listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);\n view.disposables ![def.outputIndex + i] = disposable;\n }\n}\n\nfunction renderEventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\n\nexport function checkAndUpdateElementInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindLen = def.bindings.length;\n let changed = false;\n if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9)) changed = true;\n return changed;\n}\n\nexport function checkAndUpdateElementDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n if (checkAndUpdateElementValue(view, def, i, values[i])) changed = true;\n }\n return changed;\n}\n\nfunction checkAndUpdateElementValue(view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {\n return false;\n }\n const binding = def.bindings[bindingIdx];\n const elData = asElementData(view, def.nodeIndex);\n const renderNode = elData.renderElement;\n const name = binding.name !;\n switch (binding.flags & BindingFlags.Types) {\n case BindingFlags.TypeElementAttribute:\n setElementAttribute(view, binding, renderNode, binding.ns, name, value);\n break;\n case BindingFlags.TypeElementClass:\n setElementClass(view, renderNode, name, value);\n break;\n case BindingFlags.TypeElementStyle:\n setElementStyle(view, binding, renderNode, name, value);\n break;\n case BindingFlags.TypeProperty:\n const bindView = (def.flags & NodeFlags.ComponentView &&\n binding.flags & BindingFlags.SyntheticHostProperty) ?\n elData.componentView :\n view;\n setElementProperty(bindView, binding, renderNode, name, value);\n break;\n }\n return true;\n}\n\nfunction setElementAttribute(\n view: ViewData, binding: BindingDef, renderNode: any, ns: string | null, name: string,\n value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n renderValue = renderValue != null ? renderValue.toString() : null;\n const renderer = view.renderer;\n if (value != null) {\n renderer.setAttribute(renderNode, name, renderValue, ns);\n } else {\n renderer.removeAttribute(renderNode, name, ns);\n }\n}\n\nfunction setElementClass(view: ViewData, renderNode: any, name: string, value: boolean) {\n const renderer = view.renderer;\n if (value) {\n renderer.addClass(renderNode, name);\n } else {\n renderer.removeClass(renderNode, name);\n }\n}\n\nfunction setElementStyle(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n let renderValue: string|null =\n view.root.sanitizer.sanitize(SecurityContext.STYLE, value as{} | string);\n if (renderValue != null) {\n renderValue = renderValue.toString();\n const unit = binding.suffix;\n if (unit != null) {\n renderValue = renderValue + unit;\n }\n } else {\n renderValue = null;\n }\n const renderer = view.renderer;\n if (renderValue != null) {\n renderer.setStyle(renderNode, name, renderValue);\n } else {\n renderer.removeStyle(renderNode, name);\n }\n}\n\nfunction setElementProperty(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n view.renderer.setProperty(renderNode, name, renderValue);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectableDef, getInjectableDef} from '../di/defs';\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {INJECTOR, Injector} from '../di/injector';\nimport {setCurrentInjector} from '../di/injector_compatibility';\nimport {APP_ROOT} from '../di/scope';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {stringify} from '../util';\n\nimport {DepDef, DepFlags, NgModuleData, NgModuleDefinition, NgModuleProviderDef, NodeFlags} from './types';\nimport {splitDepsDsl, tokenKey} from './util';\n\nconst UNDEFINED_VALUE = new Object();\n\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\nconst NgModuleRefTokenKey = tokenKey(NgModuleRef);\n\nexport function moduleProvideDef(\n flags: NodeFlags, token: any, value: any,\n deps: ([DepFlags, any] | any)[]): NgModuleProviderDef {\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n const depDefs = splitDepsDsl(deps, stringify(token));\n return {\n // will bet set by the module definition\n index: -1,\n deps: depDefs, flags, token, value\n };\n}\n\nexport function moduleDef(providers: NgModuleProviderDef[]): NgModuleDefinition {\n const providersByKey: {[key: string]: NgModuleProviderDef} = {};\n const modules = [];\n let isRoot: boolean = false;\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n if (provider.token === APP_ROOT && provider.value === true) {\n isRoot = true;\n }\n if (provider.flags & NodeFlags.TypeNgModule) {\n modules.push(provider.token);\n }\n provider.index = i;\n providersByKey[tokenKey(provider.token)] = provider;\n }\n return {\n // Will be filled later...\n factory: null,\n providersByKey,\n providers,\n modules,\n isRoot,\n };\n}\n\nexport function initNgModule(data: NgModuleData) {\n const def = data._def;\n const providers = data._providers = new Array(def.providers.length);\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (!(provDef.flags & NodeFlags.LazyProvider)) {\n // Make sure the provider has not been already initialized outside this loop.\n if (providers[i] === undefined) {\n providers[i] = _createProviderInstance(data, provDef);\n }\n }\n }\n}\n\nexport function resolveNgModuleDep(\n data: NgModuleData, depDef: DepDef, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const former = setCurrentInjector(data);\n try {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n if (depDef.flags & DepFlags.SkipSelf) {\n return data._parent.get(depDef.token, notFoundValue);\n }\n const tokenKey = depDef.tokenKey;\n switch (tokenKey) {\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n case NgModuleRefTokenKey:\n return data;\n }\n const providerDef = data._def.providersByKey[tokenKey];\n let injectableDef: InjectableDef<any>|null;\n if (providerDef) {\n let providerInstance = data._providers[providerDef.index];\n if (providerInstance === undefined) {\n providerInstance = data._providers[providerDef.index] =\n _createProviderInstance(data, providerDef);\n }\n return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;\n } else if (\n (injectableDef = getInjectableDef(depDef.token)) && targetsModule(data, injectableDef)) {\n const index = data._providers.length;\n data._def.providersByKey[depDef.tokenKey] = {\n flags: NodeFlags.TypeFactoryProvider | NodeFlags.LazyProvider,\n value: injectableDef.factory,\n deps: [], index,\n token: depDef.token,\n };\n data._providers[index] = UNDEFINED_VALUE;\n return (\n data._providers[index] =\n _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));\n } else if (depDef.flags & DepFlags.Self) {\n return notFoundValue;\n }\n return data._parent.get(depDef.token, notFoundValue);\n } finally {\n setCurrentInjector(former);\n }\n}\n\nfunction moduleTransitivelyPresent(ngModule: NgModuleData, scope: any): boolean {\n return ngModule._def.modules.indexOf(scope) > -1;\n}\n\nfunction targetsModule(ngModule: NgModuleData, def: InjectableDef<any>): boolean {\n return def.providedIn != null && (moduleTransitivelyPresent(ngModule, def.providedIn) ||\n def.providedIn === 'root' && ngModule._def.isRoot);\n}\n\nfunction _createProviderInstance(ngModule: NgModuleData, providerDef: NgModuleProviderDef): any {\n let injectable: any;\n switch (providerDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n injectable = _createClass(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeFactoryProvider:\n injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeUseExistingProvider:\n injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);\n break;\n case NodeFlags.TypeValueProvider:\n injectable = providerDef.value;\n break;\n }\n\n // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be\n // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be\n // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already\n // set (ngOnDestroy was detected statically).\n if (injectable !== UNDEFINED_VALUE && injectable != null && typeof injectable === 'object' &&\n !(providerDef.flags & NodeFlags.OnDestroy) && typeof injectable.ngOnDestroy === 'function') {\n providerDef.flags |= NodeFlags.OnDestroy;\n }\n return injectable === undefined ? UNDEFINED_VALUE : injectable;\n}\n\nfunction _createClass(ngModule: NgModuleData, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return new ctor(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction _callFactory(ngModule: NgModuleData, factory: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return factory(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\nexport function callNgModuleLifecycle(ngModule: NgModuleData, lifecycles: NodeFlags) {\n const def = ngModule._def;\n const destroyed = new Set<any>();\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (provDef.flags & NodeFlags.OnDestroy) {\n const instance = ngModule._providers[i];\n if (instance && instance !== UNDEFINED_VALUE) {\n const onDestroy: Function|undefined = instance.ngOnDestroy;\n if (typeof onDestroy === 'function' && !destroyed.has(instance)) {\n onDestroy.apply(instance);\n destroyed.add(instance);\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementData, NodeDef, NodeFlags, Services, ViewData, ViewDefinition, ViewState} from './types';\nimport {RenderNodeAction, declaredViewContainer, isComponentView, renderNode, visitRootRenderNodes} from './util';\n\nexport function attachEmbeddedView(\n parentView: ViewData, elementData: ElementData, viewIndex: number | undefined | null,\n view: ViewData) {\n let embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex === null || viewIndex === undefined) {\n viewIndex = embeddedViews.length;\n }\n view.viewContainerParent = parentView;\n addToArray(embeddedViews, viewIndex !, view);\n attachProjectedView(elementData, view);\n\n Services.dirtyParentQueries(view);\n\n const prevView = viewIndex ! > 0 ? embeddedViews[viewIndex ! - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n}\n\nfunction attachProjectedView(vcElementData: ElementData, view: ViewData) {\n const dvcElementData = declaredViewContainer(view);\n if (!dvcElementData || dvcElementData === vcElementData ||\n view.state & ViewState.IsProjectedView) {\n return;\n }\n // Note: For performance reasons, we\n // - add a view to template._projectedViews only 1x throughout its lifetime,\n // and remove it not until the view is destroyed.\n // (hard, as when a parent view is attached/detached we would need to attach/detach all\n // nested projected views as well, even across component boundaries).\n // - don't track the insertion order of views in the projected views array\n // (hard, as when the views of the same template are inserted different view containers)\n view.state |= ViewState.IsProjectedView;\n let projectedViews = dvcElementData.template._projectedViews;\n if (!projectedViews) {\n projectedViews = dvcElementData.template._projectedViews = [];\n }\n projectedViews.push(view);\n // Note: we are changing the NodeDef here as we cannot calculate\n // the fact whether a template is used for projection during compilation.\n markNodeAsProjectedTemplate(view.parent !.def, view.parentNodeDef !);\n}\n\nfunction markNodeAsProjectedTemplate(viewDef: ViewDefinition, nodeDef: NodeDef) {\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n return;\n }\n viewDef.nodeFlags |= NodeFlags.ProjectedTemplate;\n nodeDef.flags |= NodeFlags.ProjectedTemplate;\n let parentNodeDef = nodeDef.parent;\n while (parentNodeDef) {\n parentNodeDef.childFlags |= NodeFlags.ProjectedTemplate;\n parentNodeDef = parentNodeDef.parent;\n }\n}\n\nexport function detachEmbeddedView(elementData: ElementData, viewIndex?: number): ViewData|null {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex == null || viewIndex >= embeddedViews.length) {\n viewIndex = embeddedViews.length - 1;\n }\n if (viewIndex < 0) {\n return null;\n }\n const view = embeddedViews[viewIndex];\n view.viewContainerParent = null;\n removeFromArray(embeddedViews, viewIndex);\n\n // See attachProjectedView for why we don't update projectedViews here.\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n\n return view;\n}\n\nexport function detachProjectedView(view: ViewData) {\n if (!(view.state & ViewState.IsProjectedView)) {\n return;\n }\n const dvcElementData = declaredViewContainer(view);\n if (dvcElementData) {\n const projectedViews = dvcElementData.template._projectedViews;\n if (projectedViews) {\n removeFromArray(projectedViews, projectedViews.indexOf(view));\n Services.dirtyParentQueries(view);\n }\n }\n}\n\nexport function moveEmbeddedView(\n elementData: ElementData, oldViewIndex: number, newViewIndex: number): ViewData {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n const view = embeddedViews[oldViewIndex];\n removeFromArray(embeddedViews, oldViewIndex);\n if (newViewIndex == null) {\n newViewIndex = embeddedViews.length;\n }\n addToArray(embeddedViews, newViewIndex, view);\n\n // Note: Don't need to change projectedViews as the order in there\n // as always invalid...\n\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n const prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n\n return view;\n}\n\nfunction renderAttachEmbeddedView(\n elementData: ElementData, prevView: ViewData | null, view: ViewData) {\n const prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode !) :\n elementData.renderElement;\n const parentNode = view.renderer.parentNode(prevRenderNode);\n const nextSibling = view.renderer.nextSibling(prevRenderNode);\n // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!\n // However, browsers automatically do `appendChild` when there is no `nextSibling`.\n visitRootRenderNodes(view, RenderNodeAction.InsertBefore, parentNode, nextSibling, undefined);\n}\n\nexport function renderDetachView(view: ViewData) {\n visitRootRenderNodes(view, RenderNodeAction.RemoveChild, null, null, undefined);\n}\n\nfunction addToArray(arr: any[], index: number, value: any) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\n\nfunction removeFromArray(arr: any[], index: number) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n arr.pop();\n } else {\n arr.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {ComponentFactory, ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef} from '../linker/element_ref';\nimport {InternalNgModuleRef, NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef, InternalViewRef, ViewRef} from '../linker/view_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {VERSION} from '../version';\n\nimport {callNgModuleLifecycle, initNgModule, resolveNgModuleDep} from './ng_module';\nimport {DepFlags, ElementData, NgModuleData, NgModuleDefinition, NodeDef, NodeFlags, Services, TemplateData, ViewContainerData, ViewData, ViewDefinitionFactory, ViewState, asElementData, asProviderData, asTextData} from './types';\nimport {markParentViewsForCheck, resolveDefinition, rootRenderNodes, splitNamespace, tokenKey, viewParentEl} from './util';\nimport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView, renderDetachView} from './view_attach';\n\nconst EMPTY_CONTEXT = new Object();\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createComponentFactory(\n selector: string, componentType: Type<any>, viewDefFactory: ViewDefinitionFactory,\n inputs: {[propName: string]: string} | null, outputs: {[propName: string]: string},\n ngContentSelectors: string[]): ComponentFactory<any> {\n return new ComponentFactory_(\n selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n}\n\nexport function getComponentViewDefinitionFactory(componentFactory: ComponentFactory<any>):\n ViewDefinitionFactory {\n return (componentFactory as ComponentFactory_).viewDefFactory;\n}\n\nclass ComponentFactory_ extends ComponentFactory<any> {\n /**\n * @internal\n */\n viewDefFactory: ViewDefinitionFactory;\n\n constructor(\n public selector: string, public componentType: Type<any>,\n viewDefFactory: ViewDefinitionFactory, private _inputs: {[propName: string]: string}|null,\n private _outputs: {[propName: string]: string}, public ngContentSelectors: string[]) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n this.viewDefFactory = viewDefFactory;\n }\n\n get inputs() {\n const inputsArr: {propName: string, templateName: string}[] = [];\n const inputs = this._inputs !;\n for (let propName in inputs) {\n const templateName = inputs[propName];\n inputsArr.push({propName, templateName});\n }\n return inputsArr;\n }\n\n get outputs() {\n const outputsArr: {propName: string, templateName: string}[] = [];\n for (let propName in this._outputs) {\n const templateName = this._outputs[propName];\n outputsArr.push({propName, templateName});\n }\n return outputsArr;\n }\n\n /**\n * Creates a new component.\n */\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<any> {\n if (!ngModule) {\n throw new Error('ngModule should be provided');\n }\n const viewDef = resolveDefinition(this.viewDefFactory);\n const componentNodeIndex = viewDef.nodes[0].element !.componentProvider !.nodeIndex;\n const view = Services.createRootView(\n injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n const component = asProviderData(view, componentNodeIndex).instance;\n if (rootSelectorOrNode) {\n view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);\n }\n\n return new ComponentRef_(view, new ViewRef_(view), component);\n }\n}\n\nclass ComponentRef_ extends ComponentRef<any> {\n public readonly hostView: ViewRef;\n public readonly instance: any;\n public readonly changeDetectorRef: ChangeDetectorRef;\n private _elDef: NodeDef;\n constructor(private _view: ViewData, private _viewRef: ViewRef, private _component: any) {\n super();\n this._elDef = this._view.def.nodes[0];\n this.hostView = _viewRef;\n this.changeDetectorRef = _viewRef;\n this.instance = _component;\n }\n get location(): ElementRef {\n return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);\n }\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n get componentType(): Type<any> { return <any>this._component.constructor; }\n\n destroy(): void { this._viewRef.destroy(); }\n onDestroy(callback: Function): void { this._viewRef.onDestroy(callback); }\n}\n\nexport function createViewContainerData(\n view: ViewData, elDef: NodeDef, elData: ElementData): ViewContainerData {\n return new ViewContainerRef_(view, elDef, elData);\n}\n\nclass ViewContainerRef_ implements ViewContainerData {\n /**\n * @internal\n */\n _embeddedViews: ViewData[] = [];\n constructor(private _view: ViewData, private _elDef: NodeDef, private _data: ElementData) {}\n\n get element(): ElementRef { return new ElementRef(this._data.renderElement); }\n\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n\n /** @deprecated No replacement */\n get parentInjector(): Injector {\n let view = this._view;\n let elDef = this._elDef.parent;\n while (!elDef && view) {\n elDef = viewParentEl(view);\n view = view.parent !;\n }\n\n return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n }\n\n clear(): void {\n const len = this._embeddedViews.length;\n for (let i = len - 1; i >= 0; i--) {\n const view = detachEmbeddedView(this._data, i) !;\n Services.destroyView(view);\n }\n }\n\n get(index: number): ViewRef|null {\n const view = this._embeddedViews[index];\n if (view) {\n const ref = new ViewRef_(view);\n ref.attachToViewContainerRef(this);\n return ref;\n }\n return null;\n }\n\n get length(): number { return this._embeddedViews.length; }\n\n createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C> {\n const viewRef = templateRef.createEmbeddedView(context || <any>{});\n this.insert(viewRef, index);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModuleRef?: NgModuleRef<any>): ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n ngModuleRef = contextInjector.get(NgModuleRef);\n }\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: ViewRef, index?: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const viewRef_ = <ViewRef_>viewRef;\n const viewData = viewRef_._view;\n attachEmbeddedView(this._view, this._data, index, viewData);\n viewRef_.attachToViewContainerRef(this);\n return viewRef;\n }\n\n move(viewRef: ViewRef_, currentIndex: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const previousIndex = this._embeddedViews.indexOf(viewRef._view);\n moveEmbeddedView(this._data, previousIndex, currentIndex);\n return viewRef;\n }\n\n indexOf(viewRef: ViewRef): number {\n return this._embeddedViews.indexOf((<ViewRef_>viewRef)._view);\n }\n\n remove(index?: number): void {\n const viewData = detachEmbeddedView(this._data, index);\n if (viewData) {\n Services.destroyView(viewData);\n }\n }\n\n detach(index?: number): ViewRef|null {\n const view = detachEmbeddedView(this._data, index);\n return view ? new ViewRef_(view) : null;\n }\n}\n\nexport function createChangeDetectorRef(view: ViewData): ChangeDetectorRef {\n return new ViewRef_(view);\n}\n\nexport class ViewRef_ implements EmbeddedViewRef<any>, InternalViewRef {\n /** @internal */\n _view: ViewData;\n private _viewContainerRef: ViewContainerRef|null;\n private _appRef: ApplicationRef|null;\n\n constructor(_view: ViewData) {\n this._view = _view;\n this._viewContainerRef = null;\n this._appRef = null;\n }\n\n get rootNodes(): any[] { return rootRenderNodes(this._view); }\n\n get context() { return this._view.context; }\n\n get destroyed(): boolean { return (this._view.state & ViewState.Destroyed) !== 0; }\n\n markForCheck(): void { markParentViewsForCheck(this._view); }\n detach(): void { this._view.state &= ~ViewState.Attached; }\n detectChanges(): void {\n const fs = this._view.root.rendererFactory;\n if (fs.begin) {\n fs.begin();\n }\n try {\n Services.checkAndUpdateView(this._view);\n } finally {\n if (fs.end) {\n fs.end();\n }\n }\n }\n checkNoChanges(): void { Services.checkNoChangesView(this._view); }\n\n reattach(): void { this._view.state |= ViewState.Attached; }\n onDestroy(callback: Function) {\n if (!this._view.disposables) {\n this._view.disposables = [];\n }\n this._view.disposables.push(<any>callback);\n }\n\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._viewContainerRef) {\n this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n }\n Services.destroyView(this._view);\n }\n\n detachFromAppRef() {\n this._appRef = null;\n renderDetachView(this._view);\n Services.dirtyParentQueries(this._view);\n }\n\n attachToAppRef(appRef: ApplicationRef) {\n if (this._viewContainerRef) {\n throw new Error('This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n\n attachToViewContainerRef(vcRef: ViewContainerRef) {\n if (this._appRef) {\n throw new Error('This view is already attached directly to the ApplicationRef!');\n }\n this._viewContainerRef = vcRef;\n }\n}\n\nexport function createTemplateData(view: ViewData, def: NodeDef): TemplateData {\n return new TemplateRef_(view, def);\n}\n\nclass TemplateRef_ extends TemplateRef<any> implements TemplateData {\n /**\n * @internal\n */\n // TODO(issue/24571): remove '!'.\n _projectedViews !: ViewData[];\n\n constructor(private _parentView: ViewData, private _def: NodeDef) { super(); }\n\n createEmbeddedView(context: any): EmbeddedViewRef<any> {\n return new ViewRef_(Services.createEmbeddedView(\n this._parentView, this._def, this._def.element !.template !, context));\n }\n\n get elementRef(): ElementRef {\n return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);\n }\n}\n\nexport function createInjector(view: ViewData, elDef: NodeDef): Injector {\n return new Injector_(view, elDef);\n}\n\nclass Injector_ implements Injector {\n constructor(private view: ViewData, private elDef: NodeDef|null) {}\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const allowPrivateServices =\n this.elDef ? (this.elDef.flags & NodeFlags.ComponentView) !== 0 : false;\n return Services.resolveDep(\n this.view, this.elDef, allowPrivateServices,\n {flags: DepFlags.None, token, tokenKey: tokenKey(token)}, notFoundValue);\n }\n}\n\nexport function nodeValue(view: ViewData, index: number): any {\n const def = view.def.nodes[index];\n if (def.flags & NodeFlags.TypeElement) {\n const elData = asElementData(view, def.nodeIndex);\n return def.element !.template ? elData.template : elData.renderElement;\n } else if (def.flags & NodeFlags.TypeText) {\n return asTextData(view, def.nodeIndex).renderText;\n } else if (def.flags & (NodeFlags.CatProvider | NodeFlags.TypePipe)) {\n return asProviderData(view, def.nodeIndex).instance;\n }\n throw new Error(`Illegal state: read nodeValue for node index ${index}`);\n}\n\nexport function createRendererV1(view: ViewData): RendererV1 {\n return new RendererAdapter(view.renderer);\n}\n\nclass RendererAdapter implements RendererV1 {\n constructor(private delegate: Renderer2) {}\n selectRootElement(selectorOrNode: string|Element): Element {\n return this.delegate.selectRootElement(selectorOrNode);\n }\n\n createElement(parent: Element|DocumentFragment, namespaceAndName: string): Element {\n const [ns, name] = splitNamespace(namespaceAndName);\n const el = this.delegate.createElement(name, ns);\n if (parent) {\n this.delegate.appendChild(parent, el);\n }\n return el;\n }\n\n createViewRoot(hostElement: Element): Element|DocumentFragment { return hostElement; }\n\n createTemplateAnchor(parentElement: Element|DocumentFragment): Comment {\n const comment = this.delegate.createComment('');\n if (parentElement) {\n this.delegate.appendChild(parentElement, comment);\n }\n return comment;\n }\n\n createText(parentElement: Element|DocumentFragment, value: string): any {\n const node = this.delegate.createText(value);\n if (parentElement) {\n this.delegate.appendChild(parentElement, node);\n }\n return node;\n }\n\n projectNodes(parentElement: Element|DocumentFragment, nodes: Node[]) {\n for (let i = 0; i < nodes.length; i++) {\n this.delegate.appendChild(parentElement, nodes[i]);\n }\n }\n\n attachViewAfter(node: Node, viewRootNodes: Node[]) {\n const parentElement = this.delegate.parentNode(node);\n const nextSibling = this.delegate.nextSibling(node);\n for (let i = 0; i < viewRootNodes.length; i++) {\n this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);\n }\n }\n\n detachView(viewRootNodes: (Element|Text|Comment)[]) {\n for (let i = 0; i < viewRootNodes.length; i++) {\n const node = viewRootNodes[i];\n const parentElement = this.delegate.parentNode(node);\n this.delegate.removeChild(parentElement, node);\n }\n }\n\n destroyView(hostElement: Element|DocumentFragment, viewAllNodes: Node[]) {\n for (let i = 0; i < viewAllNodes.length; i++) {\n this.delegate.destroyNode !(viewAllNodes[i]);\n }\n }\n\n listen(renderElement: any, name: string, callback: Function): Function {\n return this.delegate.listen(renderElement, name, <any>callback);\n }\n\n listenGlobal(target: string, name: string, callback: Function): Function {\n return this.delegate.listen(target, name, <any>callback);\n }\n\n setElementProperty(\n renderElement: Element|DocumentFragment, propertyName: string, propertyValue: any): void {\n this.delegate.setProperty(renderElement, propertyName, propertyValue);\n }\n\n setElementAttribute(renderElement: Element, namespaceAndName: string, attributeValue?: string):\n void {\n const [ns, name] = splitNamespace(namespaceAndName);\n if (attributeValue != null) {\n this.delegate.setAttribute(renderElement, name, attributeValue, ns);\n } else {\n this.delegate.removeAttribute(renderElement, name, ns);\n }\n }\n\n setBindingDebugInfo(renderElement: Element, propertyName: string, propertyValue: string): void {}\n\n setElementClass(renderElement: Element, className: string, isAdd: boolean): void {\n if (isAdd) {\n this.delegate.addClass(renderElement, className);\n } else {\n this.delegate.removeClass(renderElement, className);\n }\n }\n\n setElementStyle(renderElement: HTMLElement, styleName: string, styleValue?: string): void {\n if (styleValue != null) {\n this.delegate.setStyle(renderElement, styleName, styleValue);\n } else {\n this.delegate.removeStyle(renderElement, styleName);\n }\n }\n\n invokeElementMethod(renderElement: Element, methodName: string, args: any[]): void {\n (renderElement as any)[methodName].apply(renderElement, args);\n }\n\n setText(renderNode: Text, text: string): void { this.delegate.setValue(renderNode, text); }\n\n animate(): any { throw new Error('Renderer.animate is no longer supported!'); }\n}\n\n\nexport function createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n}\n\nclass NgModuleRef_ implements NgModuleData, InternalNgModuleRef<any> {\n private _destroyListeners: (() => void)[] = [];\n private _destroyed: boolean = false;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _providers !: any[];\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _modules !: any[];\n\n readonly injector: Injector = this;\n\n constructor(\n private _moduleType: Type<any>, public _parent: Injector,\n public _bootstrapComponents: Type<any>[], public _def: NgModuleDefinition) {\n initNgModule(this);\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n injectFlags: InjectFlags = InjectFlags.Default): any {\n let flags = DepFlags.None;\n if (injectFlags & InjectFlags.SkipSelf) {\n flags |= DepFlags.SkipSelf;\n } else if (injectFlags & InjectFlags.Self) {\n flags |= DepFlags.Self;\n }\n return resolveNgModuleDep(\n this, {token: token, tokenKey: tokenKey(token), flags: flags}, notFoundValue);\n }\n\n get instance() { return this.get(this._moduleType); }\n\n get componentFactoryResolver() { return this.get(ComponentFactoryResolver); }\n\n destroy(): void {\n if (this._destroyed) {\n throw new Error(\n `The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);\n }\n this._destroyed = true;\n callNgModuleLifecycle(this, NodeFlags.OnDestroy);\n this._destroyListeners.forEach((listener) => listener());\n }\n\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, SimpleChange, SimpleChanges, WrappedValue} from '../change_detection/change_detection';\nimport {INJECTOR, Injector, resolveForwardRef} from '../di';\nimport {ElementRef} from '../linker/element_ref';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {stringify} from '../util';\nimport {isObservable} from '../util/lang';\n\nimport {createChangeDetectorRef, createInjector, createRendererV1} from './refs';\nimport {BindingDef, BindingFlags, DepDef, DepFlags, NodeDef, NodeFlags, OutputDef, OutputType, ProviderData, QueryValueType, Services, ViewData, ViewFlags, ViewState, asElementData, asProviderData, shouldCallLifecycleInitHook} from './types';\nimport {calcBindingFlags, checkBinding, dispatchEvent, isComponentView, splitDepsDsl, splitMatchedQueriesDsl, tokenKey, viewParentEl} from './util';\n\nconst RendererV1TokenKey = tokenKey(RendererV1);\nconst Renderer2TokenKey = tokenKey(Renderer2);\nconst ElementRefTokenKey = tokenKey(ElementRef);\nconst ViewContainerRefTokenKey = tokenKey(ViewContainerRef);\nconst TemplateRefTokenKey = tokenKey(TemplateRef);\nconst ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\n\nexport function directiveDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueries: null | [string | number, QueryValueType][], childCount: number, ctor: any,\n deps: ([DepFlags, any] | any)[], props?: null | {[name: string]: [number, string]},\n outputs?: null | {[name: string]: string}): NodeDef {\n const bindings: BindingDef[] = [];\n if (props) {\n for (let prop in props) {\n const [bindingIndex, nonMinifiedName] = props[prop];\n bindings[bindingIndex] = {\n flags: BindingFlags.TypeProperty,\n name: prop, nonMinifiedName,\n ns: null,\n securityContext: null,\n suffix: null\n };\n }\n }\n const outputDefs: OutputDef[] = [];\n if (outputs) {\n for (let propName in outputs) {\n outputDefs.push(\n {type: OutputType.DirectiveOutput, propName, target: null, eventName: outputs[propName]});\n }\n }\n flags |= NodeFlags.TypeDirective;\n return _def(\n checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);\n}\n\nexport function pipeDef(flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n flags |= NodeFlags.TypePipe;\n return _def(-1, flags, null, 0, ctor, ctor, deps);\n}\n\nexport function providerDef(\n flags: NodeFlags, matchedQueries: null | [string | number, QueryValueType][], token: any,\n value: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n return _def(-1, flags, matchedQueries, 0, token, value, deps);\n}\n\nexport function _def(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: [string | number, QueryValueType][] | null, childCount: number, token: any,\n value: any, deps: ([DepFlags, any] | any)[], bindings?: BindingDef[],\n outputs?: OutputDef[]): NodeDef {\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n if (!outputs) {\n outputs = [];\n }\n if (!bindings) {\n bindings = [];\n }\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n\n const depDefs = splitDepsDsl(deps, stringify(token));\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references,\n ngContentIndex: -1, childCount, bindings,\n bindingFlags: calcBindingFlags(bindings), outputs,\n element: null,\n provider: {token, value, deps: depDefs},\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createProviderInstance(view: ViewData, def: NodeDef): any {\n return _createProviderInstance(view, def);\n}\n\nexport function createPipeInstance(view: ViewData, def: NodeDef): any {\n // deps are looked up from component.\n let compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n // pipes can see the private services of the component\n const allowPrivateServices = true;\n // pipes are always eager and classes!\n return createClass(\n compView.parent !, viewParentEl(compView) !, allowPrivateServices, def.provider !.value,\n def.provider !.deps);\n}\n\nexport function createDirectiveInstance(view: ViewData, def: NodeDef): any {\n // components can see other private services, other directives can't.\n const allowPrivateServices = (def.flags & NodeFlags.Component) > 0;\n // directives are always eager and classes!\n const instance = createClass(\n view, def.parent !, allowPrivateServices, def.provider !.value, def.provider !.deps);\n if (def.outputs.length) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const outputObservable = instance[output.propName !];\n if (isObservable(outputObservable)) {\n const subscription = outputObservable.subscribe(\n eventHandlerClosure(view, def.parent !.nodeIndex, output.eventName));\n view.disposables ![def.outputIndex + i] = subscription.unsubscribe.bind(subscription);\n } else {\n throw new Error(\n `@Output ${output.propName} not initialized in '${instance.constructor.name}'.`);\n }\n }\n }\n return instance;\n}\n\nfunction eventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\nexport function checkAndUpdateDirectiveInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n const bindLen = def.bindings.length;\n if (bindLen > 0 && checkBinding(view, def, 0, v0)) {\n changed = true;\n changes = updateProp(view, providerData, def, 0, v0, changes);\n }\n if (bindLen > 1 && checkBinding(view, def, 1, v1)) {\n changed = true;\n changes = updateProp(view, providerData, def, 1, v1, changes);\n }\n if (bindLen > 2 && checkBinding(view, def, 2, v2)) {\n changed = true;\n changes = updateProp(view, providerData, def, 2, v2, changes);\n }\n if (bindLen > 3 && checkBinding(view, def, 3, v3)) {\n changed = true;\n changes = updateProp(view, providerData, def, 3, v3, changes);\n }\n if (bindLen > 4 && checkBinding(view, def, 4, v4)) {\n changed = true;\n changes = updateProp(view, providerData, def, 4, v4, changes);\n }\n if (bindLen > 5 && checkBinding(view, def, 5, v5)) {\n changed = true;\n changes = updateProp(view, providerData, def, 5, v5, changes);\n }\n if (bindLen > 6 && checkBinding(view, def, 6, v6)) {\n changed = true;\n changes = updateProp(view, providerData, def, 6, v6, changes);\n }\n if (bindLen > 7 && checkBinding(view, def, 7, v7)) {\n changed = true;\n changes = updateProp(view, providerData, def, 7, v7, changes);\n }\n if (bindLen > 8 && checkBinding(view, def, 8, v8)) {\n changed = true;\n changes = updateProp(view, providerData, def, 8, v8, changes);\n }\n if (bindLen > 9 && checkBinding(view, def, 9, v9)) {\n changed = true;\n changes = updateProp(view, providerData, def, 9, v9, changes);\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nexport function checkAndUpdateDirectiveDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n for (let i = 0; i < values.length; i++) {\n if (checkBinding(view, def, i, values[i])) {\n changed = true;\n changes = updateProp(view, providerData, def, i, values[i], changes);\n }\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nfunction _createProviderInstance(view: ViewData, def: NodeDef): any {\n // private services can see other private services\n const allowPrivateServices = (def.flags & NodeFlags.PrivateProvider) > 0;\n const providerDef = def.provider;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n return createClass(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeFactoryProvider:\n return callFactory(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeUseExistingProvider:\n return resolveDep(view, def.parent !, allowPrivateServices, providerDef !.deps[0]);\n case NodeFlags.TypeValueProvider:\n return providerDef !.value;\n }\n}\n\nfunction createClass(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction callFactory(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, factory: any,\n deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nexport const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nexport function resolveDep(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n const startView = view;\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n const tokenKey = depDef.tokenKey;\n\n if (tokenKey === ChangeDetectorRefTokenKey) {\n // directives on the same element as a component should be able to control the change detector\n // of that component as well.\n allowPrivateServices = !!(elDef && elDef.element !.componentView);\n }\n\n if (elDef && (depDef.flags & DepFlags.SkipSelf)) {\n allowPrivateServices = false;\n elDef = elDef.parent !;\n }\n\n let searchView: ViewData|null = view;\n while (searchView) {\n if (elDef) {\n switch (tokenKey) {\n case RendererV1TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return createRendererV1(compView);\n }\n case Renderer2TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return compView.renderer;\n }\n case ElementRefTokenKey:\n return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);\n case ViewContainerRefTokenKey:\n return asElementData(searchView, elDef.nodeIndex).viewContainer;\n case TemplateRefTokenKey: {\n if (elDef.element !.template) {\n return asElementData(searchView, elDef.nodeIndex).template;\n }\n break;\n }\n case ChangeDetectorRefTokenKey: {\n let cdView = findCompView(searchView, elDef, allowPrivateServices);\n return createChangeDetectorRef(cdView);\n }\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n return createInjector(searchView, elDef);\n default:\n const providerDef =\n (allowPrivateServices ? elDef.element !.allProviders :\n elDef.element !.publicProviders) ![tokenKey];\n if (providerDef) {\n let providerData = asProviderData(searchView, providerDef.nodeIndex);\n if (!providerData) {\n providerData = {instance: _createProviderInstance(searchView, providerDef)};\n searchView.nodes[providerDef.nodeIndex] = providerData as any;\n }\n return providerData.instance;\n }\n }\n }\n\n allowPrivateServices = isComponentView(searchView);\n elDef = viewParentEl(searchView) !;\n searchView = searchView.parent !;\n\n if (depDef.flags & DepFlags.Self) {\n searchView = null;\n }\n }\n\n const value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n\n return startView.root.ngModule.injector.get(depDef.token, notFoundValue);\n}\n\nfunction findCompView(view: ViewData, elDef: NodeDef, allowPrivateServices: boolean) {\n let compView: ViewData;\n if (allowPrivateServices) {\n compView = asElementData(view, elDef.nodeIndex).componentView;\n } else {\n compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n }\n return compView;\n}\n\nfunction updateProp(\n view: ViewData, providerData: ProviderData, def: NodeDef, bindingIdx: number, value: any,\n changes: SimpleChanges): SimpleChanges {\n if (def.flags & NodeFlags.Component) {\n const compView = asElementData(view, def.parent !.nodeIndex).componentView;\n if (compView.def.flags & ViewFlags.OnPush) {\n compView.state |= ViewState.ChecksEnabled;\n }\n }\n const binding = def.bindings[bindingIdx];\n const propName = binding.name !;\n // Note: This is still safe with Closure Compiler as\n // the user passed in the property name as an object has to `providerDef`,\n // so Closure Compiler will have renamed the property correctly already.\n providerData.instance[propName] = value;\n if (def.flags & NodeFlags.OnChanges) {\n changes = changes || {};\n const oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);\n const binding = def.bindings[bindingIdx];\n changes[binding.nonMinifiedName !] =\n new SimpleChange(oldValue, value, (view.state & ViewState.FirstCheck) !== 0);\n }\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return changes;\n}\n\n// This function calls the ngAfterContentCheck, ngAfterContentInit,\n// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node\n// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are\n// called during a pre-order traversal of the view tree (that is calling the\n// parent hooks before the child hooks) these events are sent in using a\n// post-order traversal of the tree (children before parents). This changes the\n// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the\n// expected nodeIndex which a ngOnInit should be called. When sending\n// ngAfterContentInit and ngAfterViewInit it is the expected count of\n// ngAfterContentInit or ngAfterViewInit methods that have been called. This\n// ensure that despite being called recursively or after picking up after an\n// exception, the ngAfterContentInit or ngAfterViewInit will be called on the\n// correct nodes. Consider for example, the following (where E is an element\n// and D is a directive)\n// Tree: pre-order index post-order index\n// E1 0 6\n// E2 1 1\n// D3 2 0\n// E4 3 5\n// E5 4 4\n// E6 5 2\n// E7 6 3\n// As can be seen, the post-order index has an unclear relationship to the\n// pre-order index (postOrderIndex === preOrderIndex - parentCount +\n// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit\n// are stable (will be the same for the same view regardless of exceptions or\n// recursion) we just need to count them which will roughly correspond to the\n// post-order index (it skips elements and directives that do not have\n// lifecycle hooks).\n//\n// For example, if an exception is raised in the E6.onAfterViewInit() the\n// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to\n// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will\n// not have their ngAfterViewInit() called but, starting with E7, the rest of\n// the view will begin getting ngAfterViewInit() called until a check and\n// pass is complete.\n//\n// This algorthim also handles recursion. Consider if E4's ngAfterViewInit()\n// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected\n// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.\n// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.\n// When the recursion returns the initIndex will be 7 so E1 is skipped as it\n// has already been called in the recursively called checkAnUpdateView().\nexport function callLifecycleHooksChildrenFirst(view: ViewData, lifecycles: NodeFlags) {\n if (!(view.def.nodeFlags & lifecycles)) {\n return;\n }\n const nodes = view.def.nodes;\n let initIndex = 0;\n for (let i = 0; i < nodes.length; i++) {\n const nodeDef = nodes[i];\n let parent = nodeDef.parent;\n if (!parent && nodeDef.flags & lifecycles) {\n // matching root node (e.g. a pipe)\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n if ((nodeDef.childFlags & lifecycles) === 0) {\n // no child matches one of the lifecycles\n i += nodeDef.childCount;\n }\n while (parent && (parent.flags & NodeFlags.TypeElement) &&\n i === parent.nodeIndex + parent.childCount) {\n // last child of an element\n if (parent.directChildFlags & lifecycles) {\n initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex);\n }\n parent = parent.parent;\n }\n }\n}\n\nfunction callElementProvidersLifecycles(\n view: ViewData, elDef: NodeDef, lifecycles: NodeFlags, initIndex: number): number {\n for (let i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & lifecycles) {\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n // only visit direct children\n i += nodeDef.childCount;\n }\n return initIndex;\n}\n\nfunction callProviderLifecycles(\n view: ViewData, index: number, lifecycles: NodeFlags, initIndex: number) {\n const providerData = asProviderData(view, index);\n if (!providerData) {\n return;\n }\n const provider = providerData.instance;\n if (!provider) {\n return;\n }\n Services.setCurrentNode(view, index);\n if (lifecycles & NodeFlags.AfterContentInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterContentInit, initIndex)) {\n provider.ngAfterContentInit();\n }\n if (lifecycles & NodeFlags.AfterContentChecked) {\n provider.ngAfterContentChecked();\n }\n if (lifecycles & NodeFlags.AfterViewInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterViewInit, initIndex)) {\n provider.ngAfterViewInit();\n }\n if (lifecycles & NodeFlags.AfterViewChecked) {\n provider.ngAfterViewChecked();\n }\n if (lifecycles & NodeFlags.OnDestroy) {\n provider.ngOnDestroy();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '../linker/element_ref';\nimport {QueryList} from '../linker/query_list';\n\nimport {NodeDef, NodeFlags, QueryBindingDef, QueryBindingType, QueryDef, QueryValueType, ViewData, asElementData, asProviderData, asQueryList} from './types';\nimport {declaredViewContainer, filterQueryId, isEmbeddedView} from './util';\n\nexport function queryDef(\n flags: NodeFlags, id: number, bindings: {[propName: string]: QueryBindingType}): NodeDef {\n let bindingDefs: QueryBindingDef[] = [];\n for (let propName in bindings) {\n const bindingType = bindings[propName];\n bindingDefs.push({propName, bindingType});\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n // TODO(vicb): check\n checkIndex: -1, flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n ngContentIndex: -1,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: {id, filterId: filterQueryId(id), bindings: bindingDefs},\n ngContent: null\n };\n}\n\nexport function createQuery(): QueryList<any> {\n return new QueryList();\n}\n\nexport function dirtyParentQueries(view: ViewData) {\n const queryIds = view.def.nodeMatchedQueries;\n while (view.parent && isEmbeddedView(view)) {\n let tplDef = view.parentNodeDef !;\n view = view.parent;\n // content queries\n const end = tplDef.nodeIndex + tplDef.childCount;\n for (let i = 0; i <= end; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeContentQuery) &&\n (nodeDef.flags & NodeFlags.DynamicQuery) &&\n (nodeDef.query !.filterId & queryIds) === nodeDef.query !.filterId) {\n asQueryList(view, i).setDirty();\n }\n if ((nodeDef.flags & NodeFlags.TypeElement && i + nodeDef.childCount < tplDef.nodeIndex) ||\n !(nodeDef.childFlags & NodeFlags.TypeContentQuery) ||\n !(nodeDef.childFlags & NodeFlags.DynamicQuery)) {\n // skip elements that don't contain the template element or no query.\n i += nodeDef.childCount;\n }\n }\n }\n\n // view queries\n if (view.def.nodeFlags & NodeFlags.TypeViewQuery) {\n for (let i = 0; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeViewQuery) && (nodeDef.flags & NodeFlags.DynamicQuery)) {\n asQueryList(view, i).setDirty();\n }\n // only visit the root nodes\n i += nodeDef.childCount;\n }\n }\n}\n\nexport function checkAndUpdateQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (!queryList.dirty) {\n return;\n }\n let directiveInstance: any;\n let newValues: any[] = undefined !;\n if (nodeDef.flags & NodeFlags.TypeContentQuery) {\n const elementDef = nodeDef.parent !.parent !;\n newValues = calcQueryValues(\n view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query !,\n []);\n directiveInstance = asProviderData(view, nodeDef.parent !.nodeIndex).instance;\n } else if (nodeDef.flags & NodeFlags.TypeViewQuery) {\n newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query !, []);\n directiveInstance = view.component;\n }\n queryList.reset(newValues);\n const bindings = nodeDef.query !.bindings;\n let notify = false;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n let boundValue: any;\n switch (binding.bindingType) {\n case QueryBindingType.First:\n boundValue = queryList.first;\n break;\n case QueryBindingType.All:\n boundValue = queryList;\n notify = true;\n break;\n }\n directiveInstance[binding.propName] = boundValue;\n }\n if (notify) {\n queryList.notifyOnChanges();\n }\n}\n\nfunction calcQueryValues(\n view: ViewData, startIndex: number, endIndex: number, queryDef: QueryDef,\n values: any[]): any[] {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n const valueType = nodeDef.matchedQueries[queryDef.id];\n if (valueType != null) {\n values.push(getQueryValue(view, nodeDef, valueType));\n }\n if (nodeDef.flags & NodeFlags.TypeElement && nodeDef.element !.template &&\n (nodeDef.element !.template !.nodeMatchedQueries & queryDef.filterId) ===\n queryDef.filterId) {\n const elementData = asElementData(view, i);\n // check embedded views that were attached at the place of their template,\n // but process child nodes first if some match the query (see issue #16568)\n if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {\n calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);\n i += nodeDef.childCount;\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n const embeddedView = embeddedViews[k];\n const dvc = declaredViewContainer(embeddedView);\n if (dvc && dvc === elementData) {\n calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n const projectedViews = elementData.template._projectedViews;\n if (projectedViews) {\n for (let k = 0; k < projectedViews.length; k++) {\n const projectedView = projectedViews[k];\n calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {\n // if no child matches the query, skip the children.\n i += nodeDef.childCount;\n }\n }\n return values;\n}\n\nexport function getQueryValue(\n view: ViewData, nodeDef: NodeDef, queryValueType: QueryValueType): any {\n if (queryValueType != null) {\n // a match\n switch (queryValueType) {\n case QueryValueType.RenderElement:\n return asElementData(view, nodeDef.nodeIndex).renderElement;\n case QueryValueType.ElementRef:\n return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);\n case QueryValueType.TemplateRef:\n return asElementData(view, nodeDef.nodeIndex).template;\n case QueryValueType.ViewContainerRef:\n return asElementData(view, nodeDef.nodeIndex).viewContainer;\n case QueryValueType.Provider:\n return asProviderData(view, nodeDef.nodeIndex).instance;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NodeDef, NodeFlags, ViewData} from './types';\nimport {RenderNodeAction, getParentRenderElement, visitProjectedRenderNodes} from './util';\n\nexport function ngContentDef(ngContentIndex: null | number, index: number): NodeDef {\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex: -1,\n flags: NodeFlags.TypeNgContent,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: {index}\n };\n}\n\nexport function appendNgContent(view: ViewData, renderHost: any, def: NodeDef) {\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (!parentEl) {\n // Nothing to do if there is no parent element.\n return;\n }\n const ngContentIndex = def.ngContent !.index;\n visitProjectedRenderNodes(\n view, ngContentIndex, RenderNodeAction.AppendChild, parentEl, null, undefined);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, PureExpressionData, ViewData, asPureExpressionData} from './types';\nimport {calcBindingFlags, checkAndUpdateBinding} from './util';\n\nexport function purePipeDef(checkIndex: number, argCount: number): NodeDef {\n // argCount + 1 to include the pipe as first arg\n return _pureExpressionDef(NodeFlags.TypePurePipe, checkIndex, new Array(argCount + 1));\n}\n\nexport function pureArrayDef(checkIndex: number, argCount: number): NodeDef {\n return _pureExpressionDef(NodeFlags.TypePureArray, checkIndex, new Array(argCount));\n}\n\nexport function pureObjectDef(checkIndex: number, propToIndex: {[p: string]: number}): NodeDef {\n const keys = Object.keys(propToIndex);\n const nbKeys = keys.length;\n const propertyNames = new Array(nbKeys);\n for (let i = 0; i < nbKeys; i++) {\n const key = keys[i];\n const index = propToIndex[key];\n propertyNames[index] = key;\n }\n\n return _pureExpressionDef(NodeFlags.TypePureObject, checkIndex, propertyNames);\n}\n\nfunction _pureExpressionDef(\n flags: NodeFlags, checkIndex: number, propertyNames: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(propertyNames.length);\n for (let i = 0; i < propertyNames.length; i++) {\n const prop = propertyNames[i];\n bindings[i] = {\n flags: BindingFlags.TypeProperty,\n name: prop,\n ns: null,\n nonMinifiedName: prop,\n securityContext: null,\n suffix: null\n };\n }\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n ngContentIndex: -1,\n childCount: 0, bindings,\n bindingFlags: calcBindingFlags(bindings),\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createPureExpression(view: ViewData, def: NodeDef): PureExpressionData {\n return {value: undefined};\n}\n\nexport function checkAndUpdatePureExpressionInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindings = def.bindings;\n let changed = false;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = new Array(bindings.length);\n if (bindLen > 0) value[0] = v0;\n if (bindLen > 1) value[1] = v1;\n if (bindLen > 2) value[2] = v2;\n if (bindLen > 3) value[3] = v3;\n if (bindLen > 4) value[4] = v4;\n if (bindLen > 5) value[5] = v5;\n if (bindLen > 6) value[6] = v6;\n if (bindLen > 7) value[7] = v7;\n if (bindLen > 8) value[8] = v8;\n if (bindLen > 9) value[9] = v9;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n if (bindLen > 0) value[bindings[0].name !] = v0;\n if (bindLen > 1) value[bindings[1].name !] = v1;\n if (bindLen > 2) value[bindings[2].name !] = v2;\n if (bindLen > 3) value[bindings[3].name !] = v3;\n if (bindLen > 4) value[bindings[4].name !] = v4;\n if (bindLen > 5) value[bindings[5].name !] = v5;\n if (bindLen > 6) value[bindings[6].name !] = v6;\n if (bindLen > 7) value[bindings[7].name !] = v7;\n if (bindLen > 8) value[bindings[8].name !] = v8;\n if (bindLen > 9) value[bindings[9].name !] = v9;\n break;\n case NodeFlags.TypePurePipe:\n const pipe = v0;\n switch (bindLen) {\n case 1:\n value = pipe.transform(v0);\n break;\n case 2:\n value = pipe.transform(v1);\n break;\n case 3:\n value = pipe.transform(v1, v2);\n break;\n case 4:\n value = pipe.transform(v1, v2, v3);\n break;\n case 5:\n value = pipe.transform(v1, v2, v3, v4);\n break;\n case 6:\n value = pipe.transform(v1, v2, v3, v4, v5);\n break;\n case 7:\n value = pipe.transform(v1, v2, v3, v4, v5, v6);\n break;\n case 8:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);\n break;\n case 9:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);\n break;\n case 10:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);\n break;\n }\n break;\n }\n data.value = value;\n }\n return changed;\n}\n\nexport function checkAndUpdatePureExpressionDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = values;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n for (let i = 0; i < values.length; i++) {\n value[bindings[i].name !] = values[i];\n }\n break;\n case NodeFlags.TypePurePipe:\n const pipe = values[0];\n const params = values.slice(1);\n value = (<any>pipe.transform)(...params);\n break;\n }\n data.value = value;\n }\n return changed;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, TextData, ViewData, asTextData} from './types';\nimport {checkAndUpdateBinding, getParentRenderElement} from './util';\n\nexport function textDef(\n checkIndex: number, ngContentIndex: number | null, staticText: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(staticText.length - 1);\n for (let i = 1; i < staticText.length; i++) {\n bindings[i - 1] = {\n flags: BindingFlags.TypeProperty,\n name: null,\n ns: null,\n nonMinifiedName: null,\n securityContext: null,\n suffix: staticText[i],\n };\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags: NodeFlags.TypeText,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0, bindings,\n bindingFlags: BindingFlags.TypeProperty,\n outputs: [],\n element: null,\n provider: null,\n text: {prefix: staticText[0]},\n query: null,\n ngContent: null,\n };\n}\n\nexport function createText(view: ViewData, renderHost: any, def: NodeDef): TextData {\n let renderNode: any;\n const renderer = view.renderer;\n renderNode = renderer.createText(def.text !.prefix);\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, renderNode);\n }\n return {renderText: renderNode};\n}\n\nexport function checkAndUpdateTextInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n let changed = false;\n const bindings = def.bindings;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n let value = def.text !.prefix;\n if (bindLen > 0) value += _addInterpolationPart(v0, bindings[0]);\n if (bindLen > 1) value += _addInterpolationPart(v1, bindings[1]);\n if (bindLen > 2) value += _addInterpolationPart(v2, bindings[2]);\n if (bindLen > 3) value += _addInterpolationPart(v3, bindings[3]);\n if (bindLen > 4) value += _addInterpolationPart(v4, bindings[4]);\n if (bindLen > 5) value += _addInterpolationPart(v5, bindings[5]);\n if (bindLen > 6) value += _addInterpolationPart(v6, bindings[6]);\n if (bindLen > 7) value += _addInterpolationPart(v7, bindings[7]);\n if (bindLen > 8) value += _addInterpolationPart(v8, bindings[8]);\n if (bindLen > 9) value += _addInterpolationPart(v9, bindings[9]);\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nexport function checkAndUpdateTextDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n let value = '';\n for (let i = 0; i < values.length; i++) {\n value = value + _addInterpolationPart(values[i], bindings[i]);\n }\n value = def.text !.prefix + value;\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nfunction _addInterpolationPart(value: any, binding: BindingDef): string {\n const valueStr = value != null ? value.toString() : '';\n return valueStr + binding.suffix;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Renderer2} from '../render/api';\n\nimport {checkAndUpdateElementDynamic, checkAndUpdateElementInline, createElement, listenToElementOutputs} from './element';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {appendNgContent} from './ng_content';\nimport {callLifecycleHooksChildrenFirst, checkAndUpdateDirectiveDynamic, checkAndUpdateDirectiveInline, createDirectiveInstance, createPipeInstance, createProviderInstance} from './provider';\nimport {checkAndUpdatePureExpressionDynamic, checkAndUpdatePureExpressionInline, createPureExpression} from './pure_expression';\nimport {checkAndUpdateQuery, createQuery} from './query';\nimport {createTemplateData, createViewContainerData} from './refs';\nimport {checkAndUpdateTextDynamic, checkAndUpdateTextInline, createText} from './text';\nimport {ArgumentType, CheckType, ElementData, NodeData, NodeDef, NodeFlags, ProviderData, RootData, Services, ViewData, ViewDefinition, ViewFlags, ViewHandleEventFn, ViewState, ViewUpdateFn, asElementData, asQueryList, asTextData, shiftInitState} from './types';\nimport {NOOP, checkBindingNoChanges, isComponentView, markParentViewsForCheckProjectedViews, resolveDefinition, tokenKey} from './util';\nimport {detachProjectedView} from './view_attach';\n\nexport function viewDef(\n flags: ViewFlags, nodes: NodeDef[], updateDirectives?: null | ViewUpdateFn,\n updateRenderer?: null | ViewUpdateFn): ViewDefinition {\n // clone nodes and set auto calculated values\n let viewBindingCount = 0;\n let viewDisposableCount = 0;\n let viewNodeFlags = 0;\n let viewRootNodeFlags = 0;\n let viewMatchedQueries = 0;\n let currentParent: NodeDef|null = null;\n let currentRenderParent: NodeDef|null = null;\n let currentElementHasPublicProviders = false;\n let currentElementHasPrivateProviders = false;\n let lastRenderRootNode: NodeDef|null = null;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n node.nodeIndex = i;\n node.parent = currentParent;\n node.bindingIndex = viewBindingCount;\n node.outputIndex = viewDisposableCount;\n node.renderParent = currentRenderParent;\n\n viewNodeFlags |= node.flags;\n viewMatchedQueries |= node.matchedQueryIds;\n\n if (node.element) {\n const elDef = node.element;\n elDef.publicProviders =\n currentParent ? currentParent.element !.publicProviders : Object.create(null);\n elDef.allProviders = elDef.publicProviders;\n // Note: We assume that all providers of an element are before any child element!\n currentElementHasPublicProviders = false;\n currentElementHasPrivateProviders = false;\n\n if (node.element.template) {\n viewMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n }\n validateNode(currentParent, node, nodes.length);\n\n\n viewBindingCount += node.bindings.length;\n viewDisposableCount += node.outputs.length;\n\n if (!currentRenderParent && (node.flags & NodeFlags.CatRenderNode)) {\n lastRenderRootNode = node;\n }\n\n if (node.flags & NodeFlags.CatProvider) {\n if (!currentElementHasPublicProviders) {\n currentElementHasPublicProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.publicProviders =\n Object.create(currentParent !.element !.publicProviders);\n currentParent !.element !.allProviders = currentParent !.element !.publicProviders;\n }\n const isPrivateService = (node.flags & NodeFlags.PrivateProvider) !== 0;\n const isComponent = (node.flags & NodeFlags.Component) !== 0;\n if (!isPrivateService || isComponent) {\n currentParent !.element !.publicProviders ![tokenKey(node.provider !.token)] = node;\n } else {\n if (!currentElementHasPrivateProviders) {\n currentElementHasPrivateProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.allProviders =\n Object.create(currentParent !.element !.publicProviders);\n }\n currentParent !.element !.allProviders ![tokenKey(node.provider !.token)] = node;\n }\n if (isComponent) {\n currentParent !.element !.componentProvider = node;\n }\n }\n\n if (currentParent) {\n currentParent.childFlags |= node.flags;\n currentParent.directChildFlags |= node.flags;\n currentParent.childMatchedQueries |= node.matchedQueryIds;\n if (node.element && node.element.template) {\n currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n } else {\n viewRootNodeFlags |= node.flags;\n }\n\n if (node.childCount > 0) {\n currentParent = node;\n\n if (!isNgContainer(node)) {\n currentRenderParent = node;\n }\n } else {\n // When the current node has no children, check if it is the last children of its parent.\n // When it is, propagate the flags up.\n // The loop is required because an element could be the last transitive children of several\n // elements. We loop to either the root or the highest opened element (= with remaining\n // children)\n while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {\n const newParent: NodeDef|null = currentParent.parent;\n if (newParent) {\n newParent.childFlags |= currentParent.childFlags;\n newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n }\n currentParent = newParent;\n // We also need to update the render parent & account for ng-container\n if (currentParent && isNgContainer(currentParent)) {\n currentRenderParent = currentParent.renderParent;\n } else {\n currentRenderParent = currentParent;\n }\n }\n }\n }\n\n const handleEvent: ViewHandleEventFn = (view, nodeIndex, eventName, event) =>\n nodes[nodeIndex].element !.handleEvent !(view, eventName, event);\n\n return {\n // Will be filled later...\n factory: null,\n nodeFlags: viewNodeFlags,\n rootNodeFlags: viewRootNodeFlags,\n nodeMatchedQueries: viewMatchedQueries, flags,\n nodes: nodes,\n updateDirectives: updateDirectives || NOOP,\n updateRenderer: updateRenderer || NOOP, handleEvent,\n bindingCount: viewBindingCount,\n outputCount: viewDisposableCount, lastRenderRootNode\n };\n}\n\nfunction isNgContainer(node: NodeDef): boolean {\n return (node.flags & NodeFlags.TypeElement) !== 0 && node.element !.name === null;\n}\n\nfunction validateNode(parent: NodeDef | null, node: NodeDef, nodeCount: number) {\n const template = node.element && node.element.template;\n if (template) {\n if (!template.lastRenderRootNode) {\n throw new Error(`Illegal State: Embedded templates without nodes are not allowed!`);\n }\n if (template.lastRenderRootNode &&\n template.lastRenderRootNode.flags & NodeFlags.EmbeddedViews) {\n throw new Error(\n `Illegal State: Last root node of a template can't have embedded views, at index ${node.nodeIndex}!`);\n }\n }\n if (node.flags & NodeFlags.CatProvider) {\n const parentFlags = parent ? parent.flags : 0;\n if ((parentFlags & NodeFlags.TypeElement) === 0) {\n throw new Error(\n `Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${node.nodeIndex}!`);\n }\n }\n if (node.query) {\n if (node.flags & NodeFlags.TypeContentQuery &&\n (!parent || (parent.flags & NodeFlags.TypeDirective) === 0)) {\n throw new Error(\n `Illegal State: Content Query nodes need to be children of directives, at index ${node.nodeIndex}!`);\n }\n if (node.flags & NodeFlags.TypeViewQuery && parent) {\n throw new Error(\n `Illegal State: View Query nodes have to be top level nodes, at index ${node.nodeIndex}!`);\n }\n }\n if (node.childCount) {\n const parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;\n if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {\n throw new Error(\n `Illegal State: childCount of node leads outside of parent, at index ${node.nodeIndex}!`);\n }\n }\n}\n\nexport function createEmbeddedView(\n parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n // embedded views are seen as siblings to the anchor, so we need\n // to get the parent of the anchor and use it as parentIndex.\n const view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);\n initView(view, parent.component, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createRootView(root: RootData, def: ViewDefinition, context?: any): ViewData {\n const view = createView(root, root.renderer, null, null, def);\n initView(view, context, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const rendererType = nodeDef.element !.componentRendererType;\n let compRenderer: Renderer2;\n if (!rendererType) {\n compRenderer = parentView.root.renderer;\n } else {\n compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);\n }\n return createView(\n parentView.root, compRenderer, parentView, nodeDef.element !.componentProvider, viewDef);\n}\n\nfunction createView(\n root: RootData, renderer: Renderer2, parent: ViewData | null, parentNodeDef: NodeDef | null,\n def: ViewDefinition): ViewData {\n const nodes: NodeData[] = new Array(def.nodes.length);\n const disposables = def.outputCount ? new Array(def.outputCount) : null;\n const view: ViewData = {\n def,\n parent,\n viewContainerParent: null, parentNodeDef,\n context: null,\n component: null, nodes,\n state: ViewState.CatInit, root, renderer,\n oldValues: new Array(def.bindingCount), disposables,\n initIndex: -1\n };\n return view;\n}\n\nfunction initView(view: ViewData, component: any, context: any) {\n view.component = component;\n view.context = context;\n}\n\nfunction createViewNodes(view: ViewData) {\n let renderHost: any;\n if (isComponentView(view)) {\n const hostDef = view.parentNodeDef;\n renderHost = asElementData(view.parent !, hostDef !.parent !.nodeIndex).renderElement;\n }\n const def = view.def;\n const nodes = view.nodes;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n Services.setCurrentNode(view, i);\n let nodeData: any;\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n const el = createElement(view, renderHost, nodeDef) as any;\n let componentView: ViewData = undefined !;\n if (nodeDef.flags & NodeFlags.ComponentView) {\n const compViewDef = resolveDefinition(nodeDef.element !.componentView !);\n componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n }\n listenToElementOutputs(view, componentView, nodeDef, el);\n nodeData = <ElementData>{\n renderElement: el,\n componentView,\n viewContainer: null,\n template: nodeDef.element !.template ? createTemplateData(view, nodeDef) : undefined\n };\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);\n }\n break;\n case NodeFlags.TypeText:\n nodeData = createText(view, renderHost, nodeDef) as any;\n break;\n case NodeFlags.TypeClassProvider:\n case NodeFlags.TypeFactoryProvider:\n case NodeFlags.TypeUseExistingProvider:\n case NodeFlags.TypeValueProvider: {\n nodeData = nodes[i];\n if (!nodeData && !(nodeDef.flags & NodeFlags.LazyProvider)) {\n const instance = createProviderInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n break;\n }\n case NodeFlags.TypePipe: {\n const instance = createPipeInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n break;\n }\n case NodeFlags.TypeDirective: {\n nodeData = nodes[i];\n if (!nodeData) {\n const instance = createDirectiveInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n if (nodeDef.flags & NodeFlags.Component) {\n const compView = asElementData(view, nodeDef.parent !.nodeIndex).componentView;\n initView(compView, nodeData.instance, nodeData.instance);\n }\n break;\n }\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n nodeData = createPureExpression(view, nodeDef) as any;\n break;\n case NodeFlags.TypeContentQuery:\n case NodeFlags.TypeViewQuery:\n nodeData = createQuery() as any;\n break;\n case NodeFlags.TypeNgContent:\n appendNgContent(view, renderHost, nodeDef);\n // no runtime data needed for NgContent...\n nodeData = undefined;\n break;\n }\n nodes[i] = nodeData;\n }\n // Create the ViewData.nodes of component views after we created everything else,\n // so that e.g. ng-content works\n execComponentViewsAction(view, ViewAction.CreateViewNodes);\n\n // fill static content and view queries\n execQueriesAction(\n view, NodeFlags.TypeContentQuery | NodeFlags.TypeViewQuery, NodeFlags.StaticQuery,\n CheckType.CheckAndUpdate);\n}\n\nexport function checkNoChangesView(view: ViewData) {\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckNoChanges);\n execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);\n Services.updateRenderer(view, CheckType.CheckNoChanges);\n execComponentViewsAction(view, ViewAction.CheckNoChanges);\n // Note: We don't check queries for changes as we didn't do this in v2.x.\n // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n}\n\nexport function checkAndUpdateView(view: ViewData) {\n if (view.state & ViewState.BeforeFirstCheck) {\n view.state &= ~ViewState.BeforeFirstCheck;\n view.state |= ViewState.FirstCheck;\n } else {\n view.state &= ~ViewState.FirstCheck;\n }\n shiftInitState(view, ViewState.InitState_BeforeInit, ViewState.InitState_CallingOnInit);\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckAndUpdate);\n execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeContentQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n let callInit = shiftInitState(\n view, ViewState.InitState_CallingOnInit, ViewState.InitState_CallingAfterContentInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterContentChecked | (callInit ? NodeFlags.AfterContentInit : 0));\n\n Services.updateRenderer(view, CheckType.CheckAndUpdate);\n\n execComponentViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeViewQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n callInit = shiftInitState(\n view, ViewState.InitState_CallingAfterContentInit, ViewState.InitState_CallingAfterViewInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterViewChecked | (callInit ? NodeFlags.AfterViewInit : 0));\n\n if (view.def.flags & ViewFlags.OnPush) {\n view.state &= ~ViewState.ChecksEnabled;\n }\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n shiftInitState(view, ViewState.InitState_CallingAfterViewInit, ViewState.InitState_AfterInit);\n}\n\nexport function checkAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n if (argStyle === ArgumentType.Inline) {\n return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n return checkAndUpdateNodeDynamic(view, nodeDef, v0);\n }\n}\n\nfunction markProjectedViewsForCheck(view: ViewData) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ProjectedTemplate)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n const projectedViews = asElementData(view, i).template._projectedViews;\n if (projectedViews) {\n for (let i = 0; i < projectedViews.length; i++) {\n const projectedView = projectedViews[i];\n projectedView.state |= ViewState.CheckProjectedView;\n markParentViewsForCheckProjectedViews(projectedView, view);\n }\n }\n } else if ((nodeDef.childFlags & NodeFlags.ProjectedTemplate) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction checkAndUpdateNodeInline(\n view: ViewData, nodeDef: NodeDef, v0?: any, v1?: any, v2?: any, v3?: any, v4?: any, v5?: any,\n v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeText:\n return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionInline(\n view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n default:\n throw 'unreachable';\n }\n}\n\nfunction checkAndUpdateNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementDynamic(view, nodeDef, values);\n case NodeFlags.TypeText:\n return checkAndUpdateTextDynamic(view, nodeDef, values);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveDynamic(view, nodeDef, values);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);\n default:\n throw 'unreachable';\n }\n}\n\nexport function checkNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n if (argStyle === ArgumentType.Inline) {\n checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n checkNoChangesNodeDynamic(view, nodeDef, v0);\n }\n // Returning false is ok here as we would have thrown in case of a change.\n return false;\n}\n\nfunction checkNoChangesNodeInline(\n view: ViewData, nodeDef: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): void {\n const bindLen = nodeDef.bindings.length;\n if (bindLen > 0) checkBindingNoChanges(view, nodeDef, 0, v0);\n if (bindLen > 1) checkBindingNoChanges(view, nodeDef, 1, v1);\n if (bindLen > 2) checkBindingNoChanges(view, nodeDef, 2, v2);\n if (bindLen > 3) checkBindingNoChanges(view, nodeDef, 3, v3);\n if (bindLen > 4) checkBindingNoChanges(view, nodeDef, 4, v4);\n if (bindLen > 5) checkBindingNoChanges(view, nodeDef, 5, v5);\n if (bindLen > 6) checkBindingNoChanges(view, nodeDef, 6, v6);\n if (bindLen > 7) checkBindingNoChanges(view, nodeDef, 7, v7);\n if (bindLen > 8) checkBindingNoChanges(view, nodeDef, 8, v8);\n if (bindLen > 9) checkBindingNoChanges(view, nodeDef, 9, v9);\n}\n\nfunction checkNoChangesNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): void {\n for (let i = 0; i < values.length; i++) {\n checkBindingNoChanges(view, nodeDef, i, values[i]);\n }\n}\n\n/**\n * Workaround https://github.com/angular/tsickle/issues/497\n * @suppress {misplacedTypeAnnotation}\n */\nfunction checkNoChangesQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (queryList.dirty) {\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, nodeDef.nodeIndex),\n `Query ${nodeDef.query!.id} not dirty`, `Query ${nodeDef.query!.id} dirty`,\n (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function destroyView(view: ViewData) {\n if (view.state & ViewState.Destroyed) {\n return;\n }\n execEmbeddedViewsAction(view, ViewAction.Destroy);\n execComponentViewsAction(view, ViewAction.Destroy);\n callLifecycleHooksChildrenFirst(view, NodeFlags.OnDestroy);\n if (view.disposables) {\n for (let i = 0; i < view.disposables.length; i++) {\n view.disposables[i]();\n }\n }\n detachProjectedView(view);\n if (view.renderer.destroyNode) {\n destroyViewNodes(view);\n }\n if (isComponentView(view)) {\n view.renderer.destroy();\n }\n view.state |= ViewState.Destroyed;\n}\n\nfunction destroyViewNodes(view: ViewData) {\n const len = view.def.nodes.length;\n for (let i = 0; i < len; i++) {\n const def = view.def.nodes[i];\n if (def.flags & NodeFlags.TypeElement) {\n view.renderer.destroyNode !(asElementData(view, i).renderElement);\n } else if (def.flags & NodeFlags.TypeText) {\n view.renderer.destroyNode !(asTextData(view, i).renderText);\n } else if (def.flags & NodeFlags.TypeContentQuery || def.flags & NodeFlags.TypeViewQuery) {\n asQueryList(view, i).destroy();\n }\n }\n}\n\nenum ViewAction {\n CreateViewNodes,\n CheckNoChanges,\n CheckNoChangesProjectedViews,\n CheckAndUpdate,\n CheckAndUpdateProjectedViews,\n Destroy\n}\n\nfunction execComponentViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ComponentView)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ComponentView) {\n // a leaf\n callViewAction(asElementData(view, i).componentView, action);\n } else if ((nodeDef.childFlags & NodeFlags.ComponentView) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction execEmbeddedViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.EmbeddedViews)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n // a leaf\n const embeddedViews = asElementData(view, i).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n callViewAction(embeddedViews[k], action);\n }\n } else if ((nodeDef.childFlags & NodeFlags.EmbeddedViews) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction callViewAction(view: ViewData, action: ViewAction) {\n const viewState = view.state;\n switch (action) {\n case ViewAction.CheckNoChanges:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);\n }\n }\n break;\n case ViewAction.CheckNoChangesProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.CheckAndUpdate:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);\n }\n }\n break;\n case ViewAction.CheckAndUpdateProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.Destroy:\n // Note: destroyView recurses over all views,\n // so we don't need to special case projected views here.\n destroyView(view);\n break;\n case ViewAction.CreateViewNodes:\n createViewNodes(view);\n break;\n }\n}\n\nfunction execProjectedViewsAction(view: ViewData, action: ViewAction) {\n execEmbeddedViewsAction(view, action);\n execComponentViewsAction(view, action);\n}\n\nfunction execQueriesAction(\n view: ViewData, queryFlags: NodeFlags, staticDynamicQueryFlag: NodeFlags,\n checkType: CheckType) {\n if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {\n return;\n }\n const nodeCount = view.def.nodes.length;\n for (let i = 0; i < nodeCount; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {\n Services.setCurrentNode(view, nodeDef.nodeIndex);\n switch (checkType) {\n case CheckType.CheckAndUpdate:\n checkAndUpdateQuery(view, nodeDef);\n break;\n case CheckType.CheckNoChanges:\n checkNoChangesQuery(view, nodeDef);\n break;\n }\n }\n if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {\n // no child has a matching query\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DebugElement__PRE_R3__, DebugNode__PRE_R3__, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from '../debug/debug_node';\nimport {Injector} from '../di';\nimport {InjectableDef, getInjectableDef} from '../di/defs';\nimport {InjectableType} from '../di/injectable';\nimport {ErrorHandler} from '../error_handler';\nimport {isDevMode} from '../is_dev_mode';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '../render/api';\nimport {Sanitizer} from '../sanitization/security';\nimport {Type} from '../type';\nimport {normalizeDebugBindingName, normalizeDebugBindingValue} from '../util/ng_reflect';\nimport {isViewDebugError, viewDestroyedError, viewWrappedDebugError} from './errors';\nimport {resolveDep} from './provider';\nimport {dirtyParentQueries, getQueryValue} from './query';\nimport {createInjector, createNgModuleRef, getComponentViewDefinitionFactory} from './refs';\nimport {ArgumentType, BindingFlags, CheckType, DebugContext, ElementData, NgModuleDefinition, NodeDef, NodeFlags, NodeLogger, ProviderOverride, RootData, Services, ViewData, ViewDefinition, ViewState, asElementData, asPureExpressionData} from './types';\nimport {NOOP, isComponentView, renderNode, resolveDefinition, splitDepsDsl, tokenKey, viewParentEl} from './util';\nimport {checkAndUpdateNode, checkAndUpdateView, checkNoChangesNode, checkNoChangesView, createComponentView, createEmbeddedView, createRootView, destroyView} from './view';\n\n\nlet initialized = false;\n\nexport function initServicesIfNeeded() {\n if (initialized) {\n return;\n }\n initialized = true;\n const services = isDevMode() ? createDebugServices() : createProdServices();\n Services.setCurrentNode = services.setCurrentNode;\n Services.createRootView = services.createRootView;\n Services.createEmbeddedView = services.createEmbeddedView;\n Services.createComponentView = services.createComponentView;\n Services.createNgModuleRef = services.createNgModuleRef;\n Services.overrideProvider = services.overrideProvider;\n Services.overrideComponentView = services.overrideComponentView;\n Services.clearOverrides = services.clearOverrides;\n Services.checkAndUpdateView = services.checkAndUpdateView;\n Services.checkNoChangesView = services.checkNoChangesView;\n Services.destroyView = services.destroyView;\n Services.resolveDep = resolveDep;\n Services.createDebugContext = services.createDebugContext;\n Services.handleEvent = services.handleEvent;\n Services.updateDirectives = services.updateDirectives;\n Services.updateRenderer = services.updateRenderer;\n Services.dirtyParentQueries = dirtyParentQueries;\n}\n\nfunction createProdServices() {\n return {\n setCurrentNode: () => {},\n createRootView: createProdRootView,\n createEmbeddedView: createEmbeddedView,\n createComponentView: createComponentView,\n createNgModuleRef: createNgModuleRef,\n overrideProvider: NOOP,\n overrideComponentView: NOOP,\n clearOverrides: NOOP,\n checkAndUpdateView: checkAndUpdateView,\n checkNoChangesView: checkNoChangesView,\n destroyView: destroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: (view: ViewData, nodeIndex: number, eventName: string, event: any) =>\n view.def.handleEvent(view, nodeIndex, eventName, event),\n updateDirectives: (view: ViewData, checkType: CheckType) => view.def.updateDirectives(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n updateRenderer: (view: ViewData, checkType: CheckType) => view.def.updateRenderer(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n };\n}\n\nfunction createDebugServices() {\n return {\n setCurrentNode: debugSetCurrentNode,\n createRootView: debugCreateRootView,\n createEmbeddedView: debugCreateEmbeddedView,\n createComponentView: debugCreateComponentView,\n createNgModuleRef: debugCreateNgModuleRef,\n overrideProvider: debugOverrideProvider,\n overrideComponentView: debugOverrideComponentView,\n clearOverrides: debugClearOverrides,\n checkAndUpdateView: debugCheckAndUpdateView,\n checkNoChangesView: debugCheckNoChangesView,\n destroyView: debugDestroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: debugHandleEvent,\n updateDirectives: debugUpdateDirectives,\n updateRenderer: debugUpdateRenderer,\n };\n}\n\nfunction createProdRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n return createRootView(\n createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode),\n def, context);\n}\n\nfunction debugCreateRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n const root = createRootData(\n elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes,\n rootSelectorOrNode);\n const defWithOverride = applyProviderOverridesToView(def);\n return callWithDebugContext(\n DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n}\n\nfunction createRootData(\n elInjector: Injector, ngModule: NgModuleRef<any>, rendererFactory: RendererFactory2,\n projectableNodes: any[][], rootSelectorOrNode: any): RootData {\n const sanitizer = ngModule.injector.get(Sanitizer);\n const errorHandler = ngModule.injector.get(ErrorHandler);\n const renderer = rendererFactory.createRenderer(null, null);\n return {\n ngModule,\n injector: elInjector, projectableNodes,\n selectorOrNode: rootSelectorOrNode, sanitizer, rendererFactory, renderer, errorHandler\n };\n}\n\nfunction debugCreateEmbeddedView(\n parentView: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n const defWithOverride = applyProviderOverridesToView(viewDef);\n return callWithDebugContext(\n DebugAction.create, createEmbeddedView, null,\n [parentView, anchorDef, defWithOverride, context]);\n}\n\nfunction debugCreateComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const overrideComponentView =\n viewDefOverrides.get(nodeDef.element !.componentProvider !.provider !.token);\n if (overrideComponentView) {\n viewDef = overrideComponentView;\n } else {\n viewDef = applyProviderOverridesToView(viewDef);\n }\n return callWithDebugContext(\n DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);\n}\n\nfunction debugCreateNgModuleRef(\n moduleType: Type<any>, parentInjector: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n const defWithOverride = applyProviderOverridesToNgModule(def);\n return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n}\n\nconst providerOverrides = new Map<any, ProviderOverride>();\nconst providerOverridesWithScope = new Map<InjectableType<any>, ProviderOverride>();\nconst viewDefOverrides = new Map<any, ViewDefinition>();\n\nfunction debugOverrideProvider(override: ProviderOverride) {\n providerOverrides.set(override.token, override);\n let injectableDef: InjectableDef<any>|null;\n if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&\n typeof injectableDef.providedIn === 'function') {\n providerOverridesWithScope.set(override.token as InjectableType<any>, override);\n }\n}\n\nfunction debugOverrideComponentView(comp: any, compFactory: ComponentFactory<any>) {\n const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));\n const compViewDef = resolveDefinition(hostViewDef.nodes[0].element !.componentView !);\n viewDefOverrides.set(comp, compViewDef);\n}\n\nfunction debugClearOverrides() {\n providerOverrides.clear();\n providerOverridesWithScope.clear();\n viewDefOverrides.clear();\n}\n\n// Notes about the algorithm:\n// 1) Locate the providers of an element and check if one of them was overwritten\n// 2) Change the providers of that element\n//\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToView(def: ViewDefinition): ViewDefinition {\n if (providerOverrides.size === 0) {\n return def;\n }\n const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);\n if (elementIndicesWithOverwrittenProviders.length === 0) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n }\n return def;\n\n function findElementIndicesWithOverwrittenProviders(def: ViewDefinition): number[] {\n const elIndicesWithOverwrittenProviders: number[] = [];\n let lastElementDef: NodeDef|null = null;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n lastElementDef = nodeDef;\n }\n if (lastElementDef && nodeDef.flags & NodeFlags.CatProviderNoDirective &&\n providerOverrides.has(nodeDef.provider !.token)) {\n elIndicesWithOverwrittenProviders.push(lastElementDef !.nodeIndex);\n lastElementDef = null;\n }\n }\n return elIndicesWithOverwrittenProviders;\n }\n\n function applyProviderOverridesToElement(viewDef: ViewDefinition, elIndex: number) {\n for (let i = elIndex + 1; i < viewDef.nodes.length; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n // stop at the next element\n return;\n }\n if (nodeDef.flags & NodeFlags.CatProviderNoDirective) {\n const provider = nodeDef.provider !;\n const override = providerOverrides.get(provider.token);\n if (override) {\n nodeDef.flags = (nodeDef.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n }\n }\n}\n\n// Notes about the algorithm:\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToNgModule(def: NgModuleDefinition): NgModuleDefinition {\n const {hasOverrides, hasDeprecatedOverrides} = calcHasOverrides(def);\n if (!hasOverrides) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n applyProviderOverrides(def);\n return def;\n\n function calcHasOverrides(def: NgModuleDefinition):\n {hasOverrides: boolean, hasDeprecatedOverrides: boolean} {\n let hasOverrides = false;\n let hasDeprecatedOverrides = false;\n if (providerOverrides.size === 0) {\n return {hasOverrides, hasDeprecatedOverrides};\n }\n def.providers.forEach(node => {\n const override = providerOverrides.get(node.token);\n if ((node.flags & NodeFlags.CatProviderNoDirective) && override) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n def.modules.forEach(module => {\n providerOverridesWithScope.forEach((override, token) => {\n if (getInjectableDef(token) !.providedIn === module) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n });\n return {hasOverrides, hasDeprecatedOverrides};\n }\n\n function applyProviderOverrides(def: NgModuleDefinition) {\n for (let i = 0; i < def.providers.length; i++) {\n const provider = def.providers[i];\n if (hasDeprecatedOverrides) {\n // We had a bug where me made\n // all providers lazy. Keep this logic behind a flag\n // for migrating existing users.\n provider.flags |= NodeFlags.LazyProvider;\n }\n const override = providerOverrides.get(provider.token);\n if (override) {\n provider.flags = (provider.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n if (providerOverridesWithScope.size > 0) {\n let moduleSet = new Set<any>(def.modules);\n providerOverridesWithScope.forEach((override, token) => {\n if (moduleSet.has(getInjectableDef(token) !.providedIn)) {\n let provider = {\n token: token,\n flags:\n override.flags | (hasDeprecatedOverrides ? NodeFlags.LazyProvider : NodeFlags.None),\n deps: splitDepsDsl(override.deps),\n value: override.value,\n index: def.providers.length,\n };\n def.providers.push(provider);\n def.providersByKey[tokenKey(token)] = provider;\n }\n });\n }\n }\n}\n\nfunction prodCheckAndUpdateNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction prodCheckNoChangesNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction debugCheckAndUpdateView(view: ViewData) {\n return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n}\n\nfunction debugCheckNoChangesView(view: ViewData) {\n return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n}\n\nfunction debugDestroyView(view: ViewData) {\n return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n}\n\nenum DebugAction {\n create,\n detectChanges,\n checkNoChanges,\n destroy,\n handleEvent\n}\n\nlet _currentAction: DebugAction;\nlet _currentView: ViewData;\nlet _currentNodeIndex: number|null;\n\nfunction debugSetCurrentNode(view: ViewData, nodeIndex: number | null) {\n _currentView = view;\n _currentNodeIndex = nodeIndex;\n}\n\nfunction debugHandleEvent(view: ViewData, nodeIndex: number, eventName: string, event: any) {\n debugSetCurrentNode(view, nodeIndex);\n return callWithDebugContext(\n DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);\n}\n\nfunction debugUpdateDirectives(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));\n return view.def.updateDirectives(debugCheckDirectivesFn, view);\n\n function debugCheckDirectivesFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugUpdateRenderer(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));\n return view.def.updateRenderer(debugCheckRenderNodeFn, view);\n\n function debugCheckRenderNodeFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugCheckAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, givenValues: any[]): void {\n const changed = (<any>checkAndUpdateNode)(view, nodeDef, argStyle, ...givenValues);\n if (changed) {\n const values = argStyle === ArgumentType.Dynamic ? givenValues[0] : givenValues;\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n const bindingValues: {[key: string]: string} = {};\n for (let i = 0; i < nodeDef.bindings.length; i++) {\n const binding = nodeDef.bindings[i];\n const value = values[i];\n if (binding.flags & BindingFlags.TypeProperty) {\n bindingValues[normalizeDebugBindingName(binding.nonMinifiedName !)] =\n normalizeDebugBindingValue(value);\n }\n }\n const elDef = nodeDef.parent !;\n const el = asElementData(view, elDef.nodeIndex).renderElement;\n if (!elDef.element !.name) {\n // a comment.\n view.renderer.setValue(el, `bindings=${JSON.stringify(bindingValues, null, 2)}`);\n } else {\n // a regular element.\n for (let attr in bindingValues) {\n const value = bindingValues[attr];\n if (value != null) {\n view.renderer.setAttribute(el, attr, value);\n } else {\n view.renderer.removeAttribute(el, attr);\n }\n }\n }\n }\n }\n}\n\nfunction debugCheckNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, values: any[]): void {\n (<any>checkNoChangesNode)(view, nodeDef, argStyle, ...values);\n}\n\nfunction nextDirectiveWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeDirective && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nfunction nextRenderNodeWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.CatRenderNode) && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nclass DebugContext_ implements DebugContext {\n private nodeDef: NodeDef;\n private elView: ViewData;\n private elDef: NodeDef;\n\n constructor(public view: ViewData, public nodeIndex: number|null) {\n if (nodeIndex == null) {\n this.nodeIndex = nodeIndex = 0;\n }\n this.nodeDef = view.def.nodes[nodeIndex];\n let elDef = this.nodeDef;\n let elView = view;\n while (elDef && (elDef.flags & NodeFlags.TypeElement) === 0) {\n elDef = elDef.parent !;\n }\n if (!elDef) {\n while (!elDef && elView) {\n elDef = viewParentEl(elView) !;\n elView = elView.parent !;\n }\n }\n this.elDef = elDef;\n this.elView = elView;\n }\n\n private get elOrCompView() {\n // Has to be done lazily as we use the DebugContext also during creation of elements...\n return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;\n }\n\n get injector(): Injector { return createInjector(this.elView, this.elDef); }\n\n get component(): any { return this.elOrCompView.component; }\n\n get context(): any { return this.elOrCompView.context; }\n\n get providerTokens(): any[] {\n const tokens: any[] = [];\n if (this.elDef) {\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n tokens.push(childDef.provider !.token);\n }\n i += childDef.childCount;\n }\n }\n return tokens;\n }\n\n get references(): {[key: string]: any} {\n const references: {[key: string]: any} = {};\n if (this.elDef) {\n collectReferences(this.elView, this.elDef, references);\n\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n collectReferences(this.elView, childDef, references);\n }\n i += childDef.childCount;\n }\n }\n return references;\n }\n\n get componentRenderElement() {\n const elData = findHostElement(this.elOrCompView);\n return elData ? elData.renderElement : undefined;\n }\n\n get renderNode(): any {\n return this.nodeDef.flags & NodeFlags.TypeText ? renderNode(this.view, this.nodeDef) :\n renderNode(this.elView, this.elDef);\n }\n\n logError(console: Console, ...values: any[]) {\n let logViewDef: ViewDefinition;\n let logNodeIndex: number;\n if (this.nodeDef.flags & NodeFlags.TypeText) {\n logViewDef = this.view.def;\n logNodeIndex = this.nodeDef.nodeIndex;\n } else {\n logViewDef = this.elView.def;\n logNodeIndex = this.elDef.nodeIndex;\n }\n // Note: we only generate a log function for text and element nodes\n // to make the generated code as small as possible.\n const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n let currRenderNodeIndex = -1;\n let nodeLogger: NodeLogger = () => {\n currRenderNodeIndex++;\n if (currRenderNodeIndex === renderNodeIndex) {\n return console.error.bind(console, ...values);\n } else {\n return NOOP;\n }\n };\n logViewDef.factory !(nodeLogger);\n if (currRenderNodeIndex < renderNodeIndex) {\n console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n (<any>console.error)(...values);\n }\n }\n}\n\nfunction getRenderNodeIndex(viewDef: ViewDefinition, nodeIndex: number): number {\n let renderNodeIndex = -1;\n for (let i = 0; i <= nodeIndex; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n renderNodeIndex++;\n }\n }\n return renderNodeIndex;\n}\n\nfunction findHostElement(view: ViewData): ElementData|null {\n while (view && !isComponentView(view)) {\n view = view.parent !;\n }\n if (view.parent) {\n return asElementData(view.parent, viewParentEl(view) !.nodeIndex);\n }\n return null;\n}\n\nfunction collectReferences(view: ViewData, nodeDef: NodeDef, references: {[key: string]: any}) {\n for (let refName in nodeDef.references) {\n references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n }\n}\n\nfunction callWithDebugContext(action: DebugAction, fn: any, self: any, args: any[]) {\n const oldAction = _currentAction;\n const oldView = _currentView;\n const oldNodeIndex = _currentNodeIndex;\n try {\n _currentAction = action;\n const result = fn.apply(self, args);\n _currentView = oldView;\n _currentNodeIndex = oldNodeIndex;\n _currentAction = oldAction;\n return result;\n } catch (e) {\n if (isViewDebugError(e) || !_currentView) {\n throw e;\n }\n throw viewWrappedDebugError(e, getCurrentDebugContext() !);\n }\n}\n\nexport function getCurrentDebugContext(): DebugContext|null {\n return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n}\n\nexport class DebugRendererFactory2 implements RendererFactory2 {\n constructor(private delegate: RendererFactory2) {}\n\n createRenderer(element: any, renderData: RendererType2|null): Renderer2 {\n return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n }\n\n begin() {\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n end() {\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n\n whenRenderingDone(): Promise<any> {\n if (this.delegate.whenRenderingDone) {\n return this.delegate.whenRenderingDone();\n }\n return Promise.resolve(null);\n }\n}\n\nexport class DebugRenderer2 implements Renderer2 {\n readonly data: {[key: string]: any};\n\n private createDebugContext(nativeElement: any) { return this.debugContextFactory(nativeElement); }\n\n /**\n * Factory function used to create a `DebugContext` when a node is created.\n *\n * The `DebugContext` allows to retrieve information about the nodes that are useful in tests.\n *\n * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine\n * or a Render context.\n */\n debugContextFactory: (nativeElement?: any) => DebugContext | null = getCurrentDebugContext;\n\n constructor(private delegate: Renderer2) { this.data = this.delegate.data; }\n\n destroyNode(node: any) {\n removeDebugNodeFromIndex(getDebugNode(node) !);\n if (this.delegate.destroyNode) {\n this.delegate.destroyNode(node);\n }\n }\n\n destroy() { this.delegate.destroy(); }\n\n createElement(name: string, namespace?: string): any {\n const el = this.delegate.createElement(name, namespace);\n const debugCtx = this.createDebugContext(el);\n if (debugCtx) {\n const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);\n (debugEl as{name: string}).name = name;\n indexDebugNode(debugEl);\n }\n return el;\n }\n\n createComment(value: string): any {\n const comment = this.delegate.createComment(value);\n const debugCtx = this.createDebugContext(comment);\n if (debugCtx) {\n indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));\n }\n return comment;\n }\n\n createText(value: string): any {\n const text = this.delegate.createText(value);\n const debugCtx = this.createDebugContext(text);\n if (debugCtx) {\n indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));\n }\n return text;\n }\n\n appendChild(parent: any, newChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.addChild(debugChildEl);\n }\n this.delegate.appendChild(parent, newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n const debugRefEl = getDebugNode(refChild) !;\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.insertBefore(debugRefEl, debugChildEl);\n }\n\n this.delegate.insertBefore(parent, newChild, refChild);\n }\n\n removeChild(parent: any, oldChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(oldChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.removeChild(debugChildEl);\n }\n this.delegate.removeChild(parent, oldChild);\n }\n\n selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any {\n const el = this.delegate.selectRootElement(selectorOrNode, preserveContent);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));\n }\n return el;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = value;\n }\n this.delegate.setAttribute(el, name, value, namespace);\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = null;\n }\n this.delegate.removeAttribute(el, name, namespace);\n }\n\n addClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.classes[name] = true;\n }\n this.delegate.addClass(el, name);\n }\n\n removeClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.classes[name] = false;\n }\n this.delegate.removeClass(el, name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.styles[style] = value;\n }\n this.delegate.setStyle(el, style, value, flags);\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.styles[style] = null;\n }\n this.delegate.removeStyle(el, style, flags);\n }\n\n setProperty(el: any, name: string, value: any): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.properties[name] = value;\n }\n this.delegate.setProperty(el, name, value);\n }\n\n listen(\n target: 'document'|'windows'|'body'|any, eventName: string,\n callback: (event: any) => boolean): () => void {\n if (typeof target !== 'string') {\n const debugEl = getDebugNode(target);\n if (debugEl) {\n debugEl.listeners.push(new EventListener(eventName, callback));\n }\n }\n\n return this.delegate.listen(target, eventName, callback);\n }\n\n parentNode(node: any): any { return this.delegate.parentNode(node); }\n nextSibling(node: any): any { return this.delegate.nextSibling(node); }\n setValue(node: any, value: string): void { return this.delegate.setValue(node, value); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';\nimport {Type} from '../type';\n\nimport {initServicesIfNeeded} from './services';\nimport {NgModuleDefinition, NgModuleDefinitionFactory, NgModuleProviderDef, ProviderOverride, Services, ViewDefinition} from './types';\nimport {resolveDefinition} from './util';\n\nexport function overrideProvider(override: ProviderOverride) {\n initServicesIfNeeded();\n return Services.overrideProvider(override);\n}\n\nexport function overrideComponentView(comp: Type<any>, componentFactory: ComponentFactory<any>) {\n initServicesIfNeeded();\n return Services.overrideComponentView(comp, componentFactory);\n}\n\nexport function clearOverrides() {\n initServicesIfNeeded();\n return Services.clearOverrides();\n}\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createNgModuleFactory(\n ngModuleType: Type<any>, bootstrapComponents: Type<any>[],\n defFactory: NgModuleDefinitionFactory): NgModuleFactory<any> {\n return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n}\n\nfunction cloneNgModuleDefinition(def: NgModuleDefinition): NgModuleDefinition {\n const providers = Array.from(def.providers);\n const modules = Array.from(def.modules);\n const providersByKey: {[tokenKey: string]: NgModuleProviderDef} = {};\n for (const key in def.providersByKey) {\n providersByKey[key] = def.providersByKey[key];\n }\n\n return {\n factory: def.factory,\n isRoot: def.isRoot, providers, modules, providersByKey,\n };\n}\n\nclass NgModuleFactory_ extends NgModuleFactory<any> {\n constructor(\n public readonly moduleType: Type<any>, private _bootstrapComponents: Type<any>[],\n private _ngModuleDefFactory: NgModuleDefinitionFactory) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n }\n\n create(parentInjector: Injector|null): NgModuleRef<any> {\n initServicesIfNeeded();\n // Clone the NgModuleDefinition so that any tree shakeable provider definition\n // added to this instance of the NgModuleRef doesn't affect the cached copy.\n // See https://github.com/angular/angular/issues/25018.\n const def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory));\n return Services.createNgModuleRef(\n this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {anchorDef, elementDef} from './element';\nexport {clearOverrides, createNgModuleFactory, overrideComponentView, overrideProvider} from './entrypoint';\nexport {ngContentDef} from './ng_content';\nexport {moduleDef, moduleProvideDef} from './ng_module';\nexport {directiveDef, pipeDef, providerDef} from './provider';\nexport {pureArrayDef, pureObjectDef, purePipeDef} from './pure_expression';\nexport {queryDef} from './query';\nexport {ViewRef_, createComponentFactory, getComponentViewDefinitionFactory, nodeValue} from './refs';\nexport {initServicesIfNeeded} from './services';\nexport {textDef} from './text';\nexport {EMPTY_ARRAY, EMPTY_MAP, createRendererType2, elementEventFullName, inlineInterpolate, interpolate, rootRenderNodes, tokenKey, unwrapValue} from './util';\nexport {viewDef} from './view';\nexport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView} from './view_attach';\n\nexport * from './types';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS} from './application_ref';\nexport {APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER} from './application_tokens';\nexport {defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers} from './change_detection/change_detection';\nexport {devModeEqual as ɵdevModeEqual} from './change_detection/change_detection_util';\nexport {isListLikeIterable as ɵisListLikeIterable} from './change_detection/change_detection_util';\nexport {ChangeDetectorStatus as ɵChangeDetectorStatus, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy} from './change_detection/constants';\nexport {Console as ɵConsole} from './console';\nexport {InjectableDef as ɵInjectableDef, InjectorDef as ɵInjectorDef, getInjectableDef as ɵgetInjectableDef} from './di/defs';\nexport {inject as ɵinject, setCurrentInjector as ɵsetCurrentInjector} from './di/injector_compatibility';\nexport {APP_ROOT as ɵAPP_ROOT} from './di/scope';\nexport {ivyEnabled as ɵivyEnabled} from './ivy_switch';\nexport {ComponentFactory as ɵComponentFactory} from './linker/component_factory';\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {resolveComponentResources as ɵresolveComponentResources} from './metadata/resource_loading';\nexport {ReflectionCapabilities as ɵReflectionCapabilities} from './reflection/reflection_capabilities';\nexport {GetterFn as ɵGetterFn, MethodFn as ɵMethodFn, SetterFn as ɵSetterFn} from './reflection/types';\nexport {DirectRenderer as ɵDirectRenderer, RenderDebugInfo as ɵRenderDebugInfo} from './render/api';\nexport {_sanitizeHtml as ɵ_sanitizeHtml} from './sanitization/html_sanitizer';\nexport {_sanitizeStyle as ɵ_sanitizeStyle} from './sanitization/style_sanitizer';\nexport {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer';\nexport {global as ɵglobal, looseIdentical as ɵlooseIdentical, stringify as ɵstringify} from './util';\nexport {makeDecorator as ɵmakeDecorator} from './util/decorators';\nexport {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang';\nexport {clearOverrides as ɵclearOverrides, initServicesIfNeeded as ɵinitServicesIfNeeded, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index';\nexport {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from './view/provider';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// clang-format off\nexport {\n defineBase as ɵdefineBase,\n defineComponent as ɵdefineComponent,\n defineDirective as ɵdefineDirective,\n definePipe as ɵdefinePipe,\n defineNgModule as ɵdefineNgModule,\n detectChanges as ɵdetectChanges,\n renderComponent as ɵrenderComponent,\n AttributeMarker as ɵAttributeMarker,\n ComponentType as ɵComponentType,\n ComponentFactory as ɵRender3ComponentFactory,\n ComponentRef as ɵRender3ComponentRef,\n DirectiveType as ɵDirectiveType,\n RenderFlags as ɵRenderFlags,\n directiveInject as ɵdirectiveInject,\n injectAttribute as ɵinjectAttribute,\n getFactoryOf as ɵgetFactoryOf,\n getInheritedFactory as ɵgetInheritedFactory,\n templateRefExtractor as ɵtemplateRefExtractor,\n ProvidersFeature as ɵProvidersFeature,\n InheritDefinitionFeature as ɵInheritDefinitionFeature,\n NgOnChangesFeature as ɵNgOnChangesFeature,\n LifecycleHooksFeature as ɵLifecycleHooksFeature,\n NgModuleType as ɵNgModuleType,\n NgModuleRef as ɵRender3NgModuleRef,\n CssSelectorList as ɵCssSelectorList,\n markDirty as ɵmarkDirty,\n NgModuleFactory as ɵNgModuleFactory,\n NO_CHANGE as ɵNO_CHANGE,\n container as ɵcontainer,\n nextContext as ɵnextContext,\n elementStart as ɵelementStart,\n namespaceHTML as ɵnamespaceHTML,\n namespaceMathML as ɵnamespaceMathML,\n namespaceSVG as ɵnamespaceSVG,\n element as ɵelement,\n listener as ɵlistener,\n text as ɵtext,\n embeddedViewStart as ɵembeddedViewStart,\n query as ɵquery,\n registerContentQuery as ɵregisterContentQuery,\n projection as ɵprojection,\n bind as ɵbind,\n interpolation1 as ɵinterpolation1,\n interpolation2 as ɵinterpolation2,\n interpolation3 as ɵinterpolation3,\n interpolation4 as ɵinterpolation4,\n interpolation5 as ɵinterpolation5,\n interpolation6 as ɵinterpolation6,\n interpolation7 as ɵinterpolation7,\n interpolation8 as ɵinterpolation8,\n interpolationV as ɵinterpolationV,\n pipeBind1 as ɵpipeBind1,\n pipeBind2 as ɵpipeBind2,\n pipeBind3 as ɵpipeBind3,\n pipeBind4 as ɵpipeBind4,\n pipeBindV as ɵpipeBindV,\n pureFunction0 as ɵpureFunction0,\n pureFunction1 as ɵpureFunction1,\n pureFunction2 as ɵpureFunction2,\n pureFunction3 as ɵpureFunction3,\n pureFunction4 as ɵpureFunction4,\n pureFunction5 as ɵpureFunction5,\n pureFunction6 as ɵpureFunction6,\n pureFunction7 as ɵpureFunction7,\n pureFunction8 as ɵpureFunction8,\n pureFunctionV as ɵpureFunctionV,\n getCurrentView as ɵgetCurrentView,\n getHostElement as ɵgetHostElement,\n restoreView as ɵrestoreView,\n containerRefreshStart as ɵcontainerRefreshStart,\n containerRefreshEnd as ɵcontainerRefreshEnd,\n queryRefresh as ɵqueryRefresh,\n loadQueryList as ɵloadQueryList,\n elementEnd as ɵelementEnd,\n elementProperty as ɵelementProperty,\n componentHostSyntheticProperty as ɵcomponentHostSyntheticProperty,\n projectionDef as ɵprojectionDef,\n reference as ɵreference,\n enableBindings as ɵenableBindings,\n disableBindings as ɵdisableBindings,\n allocHostVars as ɵallocHostVars,\n elementAttribute as ɵelementAttribute,\n elementContainerStart as ɵelementContainerStart,\n elementContainerEnd as ɵelementContainerEnd,\n elementStyling as ɵelementStyling,\n elementHostAttrs as ɵelementHostAttrs,\n elementStylingMap as ɵelementStylingMap,\n elementStyleProp as ɵelementStyleProp,\n elementStylingApply as ɵelementStylingApply,\n elementClassProp as ɵelementClassProp,\n textBinding as ɵtextBinding,\n template as ɵtemplate,\n embeddedViewEnd as ɵembeddedViewEnd,\n store as ɵstore,\n load as ɵload,\n pipe as ɵpipe,\n BaseDef as ɵBaseDef,\n ComponentDef as ɵComponentDef,\n ComponentDefWithMeta as ɵComponentDefWithMeta,\n DirectiveDef as ɵDirectiveDef,\n DirectiveDefWithMeta as ɵDirectiveDefWithMeta,\n PipeDef as ɵPipeDef,\n PipeDefWithMeta as ɵPipeDefWithMeta,\n whenRendered as ɵwhenRendered,\n i18n as ɵi18n,\n i18nAttributes as ɵi18nAttributes,\n i18nExp as ɵi18nExp,\n i18nStart as ɵi18nStart,\n i18nEnd as ɵi18nEnd,\n i18nApply as ɵi18nApply,\n i18nPostprocess as ɵi18nPostprocess,\n setClassMetadata as ɵsetClassMetadata,\n} from './render3/index';\n\n\nexport {\n compileComponent as ɵcompileComponent,\n compileDirective as ɵcompileDirective,\n} from './render3/jit/directive';\nexport {\n compileNgModule as ɵcompileNgModule,\n compileNgModuleDefs as ɵcompileNgModuleDefs,\n patchComponentDefWithScope as ɵpatchComponentDefWithScope,\n resetCompiledComponents as ɵresetCompiledComponents,\n} from './render3/jit/module';\nexport {\n compilePipe as ɵcompilePipe,\n} from './render3/jit/pipe';\n\nexport {\n NgModuleDef as ɵNgModuleDef,\n NgModuleDefWithMeta as ɵNgModuleDefWithMeta,\n NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes,\n} from './metadata/ng_module';\n\nexport {\n sanitizeHtml as ɵsanitizeHtml,\n sanitizeStyle as ɵsanitizeStyle,\n defaultStyleSanitizer as ɵdefaultStyleSanitizer,\n sanitizeScript as ɵsanitizeScript,\n sanitizeUrl as ɵsanitizeUrl,\n sanitizeResourceUrl as ɵsanitizeResourceUrl,\n} from './sanitization/sanitization';\n\nexport {\n bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml,\n bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle,\n bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript,\n bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl,\n bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl,\n} from './sanitization/bypass';\n\nexport {\n getLContext as ɵgetLContext\n} from './render3/context_discovery';\n\nexport {\n Player as ɵPlayer,\n PlayerFactory as ɵPlayerFactory,\n PlayState as ɵPlayState,\n PlayerHandler as ɵPlayerHandler,\n} from './render3/interfaces/player';\n\nexport {\n LContext as ɵLContext,\n} from './render3/interfaces/context';\n\nexport {\n bindPlayerFactory as ɵbindPlayerFactory,\n} from './render3/styling/player_factory';\n\nexport {\n addPlayer as ɵaddPlayer,\n getPlayers as ɵgetPlayers,\n} from './render3/players';\n\n// we reexport these symbols just so that they are retained during the dead code elimination\n// performed by rollup while it's creating fesm files.\n//\n// no code actually imports these symbols from the @angular/core entry point\nexport {\n compileNgModuleFactory__POST_R3__ as ɵcompileNgModuleFactory__POST_R3__\n} from './application_ref';\nexport {\n SWITCH_COMPILE_COMPONENT__POST_R3__ as ɵSWITCH_COMPILE_COMPONENT__POST_R3__,\n SWITCH_COMPILE_DIRECTIVE__POST_R3__ as ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__,\n SWITCH_COMPILE_PIPE__POST_R3__ as ɵSWITCH_COMPILE_PIPE__POST_R3__,\n} from './metadata/directives';\nexport {\n SWITCH_COMPILE_NGMODULE__POST_R3__ as ɵSWITCH_COMPILE_NGMODULE__POST_R3__,\n} from './metadata/ng_module';\nexport {\n getDebugNode__POST_R3__ as ɵgetDebugNode__POST_R3__,\n} from './debug/debug_node';\nexport {\n SWITCH_COMPILE_INJECTABLE__POST_R3__ as ɵSWITCH_COMPILE_INJECTABLE__POST_R3__,\n} from './di/injectable';\nexport {\n SWITCH_IVY_ENABLED__POST_R3__ as ɵSWITCH_IVY_ENABLED__POST_R3__,\n} from './ivy_switch';\nexport {\n SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ as ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__,\n} from './change_detection/change_detector_ref';\nexport {\n Compiler_compileModuleSync__POST_R3__ as ɵCompiler_compileModuleSync__POST_R3__,\n Compiler_compileModuleAsync__POST_R3__ as ɵCompiler_compileModuleAsync__POST_R3__,\n Compiler_compileModuleAndAllComponentsSync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__,\n Compiler_compileModuleAndAllComponentsAsync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__,\n} from './linker/compiler';\nexport {\n SWITCH_ELEMENT_REF_FACTORY__POST_R3__ as ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__,\n} from './linker/element_ref';\nexport {\n SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ as ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__,\n} from './linker/template_ref';\nexport {\n SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ as ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__,\n} from './linker/view_container_ref';\nexport {\n SWITCH_RENDERER2_FACTORY__POST_R3__ as ɵSWITCH_RENDERER2_FACTORY__POST_R3__,\n} from './render/api';\n\nexport {getModuleFactory__POST_R3__ as ɵgetModuleFactory__POST_R3__} from './linker/ng_module_factory_loader';\n\nexport {\n publishGlobalUtil as ɵpublishGlobalUtil,\n publishDefaultGlobalUtils as ɵpublishDefaultGlobalUtils\n} from './render3/global_utils';\nexport {\n SWITCH_INJECTOR_FACTORY__POST_R3__ as ɵSWITCH_INJECTOR_FACTORY__POST_R3__,\n} from './di/injector';\n\n// clang-format on\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {registerModuleFactory as ɵregisterModuleFactory} from './linker/ng_module_factory_loader';\nexport {ArgumentType as ɵArgumentType, BindingFlags as ɵBindingFlags, DepFlags as ɵDepFlags, EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, NodeFlags as ɵNodeFlags, QueryBindingType as ɵQueryBindingType, QueryValueType as ɵQueryValueType, ViewDefinition as ɵViewDefinition, ViewFlags as ɵViewFlags, anchorDef as ɵand, createComponentFactory as ɵccf, createNgModuleFactory as ɵcmf, createRendererType2 as ɵcrt, directiveDef as ɵdid, elementDef as ɵeld, elementEventFullName as ɵelementEventFullName, getComponentViewDefinitionFactory as ɵgetComponentViewDefinitionFactory, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, moduleDef as ɵmod, moduleProvideDef as ɵmpd, ngContentDef as ɵncd, nodeValue as ɵnov, pipeDef as ɵpid, providerDef as ɵprd, pureArrayDef as ɵpad, pureObjectDef as ɵpod, purePipeDef as ɵppd, queryDef as ɵqud, textDef as ɵted, unwrapValue as ɵunv, viewDef as ɵvid} from './view/index';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point from which you should import all public core APIs.\n */\nexport * from './metadata';\nexport * from './version';\nexport {TypeDecorator} from './util/decorators';\nexport * from './di';\nexport {createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, createPlatformFactory, NgProbeToken} from './application_ref';\nexport {enableProdMode, isDevMode} from './is_dev_mode';\nexport {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, PLATFORM_ID, APP_BOOTSTRAP_LISTENER} from './application_tokens';\nexport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nexport * from './zone';\nexport * from './render';\nexport * from './linker';\nexport {DebugElement, DebugNode, asNativeElements, getDebugNode, Predicate} from './debug/debug_node';\nexport {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './testability/testability';\nexport * from './change_detection';\nexport * from './platform_core_providers';\nexport {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy} from './i18n/tokens';\nexport {ApplicationModule} from './application_module';\nexport {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './profile/profile';\nexport {Type} from './type';\nexport {EventEmitter} from './event_emitter';\nexport {ErrorHandler} from './error_handler';\nexport * from './core_private_export';\nexport * from './core_render3_private_export';\nexport {Sanitizer, SecurityContext} from './sanitization/security';\nexport * from './codegen_private_exports';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/core';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {APPLICATION_MODULE_PROVIDERS as ɵangular_packages_core_core_t,_iterableDiffersFactory as ɵangular_packages_core_core_q,_keyValueDiffersFactory as ɵangular_packages_core_core_r,_localeFactory as ɵangular_packages_core_core_s} from './src/application_module';\nexport {_appIdRandomProviderFactory as ɵangular_packages_core_core_h} from './src/application_tokens';\nexport {DefaultIterableDifferFactory as ɵangular_packages_core_core_o} from './src/change_detection/differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory as ɵangular_packages_core_core_p} from './src/change_detection/differs/default_keyvalue_differ';\nexport {DebugElement__PRE_R3__ as ɵangular_packages_core_core_n,DebugNode__PRE_R3__ as ɵangular_packages_core_core_m} from './src/debug/debug_node';\nexport {NullInjector as ɵangular_packages_core_core_c} from './src/di/injector';\nexport {injectInjectorOnly as ɵangular_packages_core_core_d} from './src/di/injector_compatibility';\nexport {ReflectiveInjector_ as ɵangular_packages_core_core_e} from './src/di/reflective_injector';\nexport {ReflectiveDependency as ɵangular_packages_core_core_f,resolveReflectiveProviders as ɵangular_packages_core_core_g} from './src/di/reflective_provider';\nexport {getModuleFactory__PRE_R3__ as ɵangular_packages_core_core_l} from './src/linker/ng_module_factory_loader';\nexport {wtfEnabled as ɵangular_packages_core_core_u} from './src/profile/profile';\nexport {createScope as ɵangular_packages_core_core_w,detectWTF as ɵangular_packages_core_core_v,endTimeRange as ɵangular_packages_core_core_z,leave as ɵangular_packages_core_core_x,startTimeRange as ɵangular_packages_core_core_y} from './src/profile/wtf_impl';\nexport {injectAttributeImpl as ɵangular_packages_core_core_bc} from './src/render3/di';\nexport {NG_INJECTABLE_DEF as ɵangular_packages_core_core_bj} from './src/render3/fields';\nexport {TElementNode as ɵangular_packages_core_core_bg} from './src/render3/interfaces/node';\nexport {PlayerFactoryBuildFn as ɵangular_packages_core_core_bh} from './src/render3/interfaces/player';\nexport {LView as ɵangular_packages_core_core_bl} from './src/render3/interfaces/view';\nexport {getLView as ɵangular_packages_core_core_bd,getPreviousOrParentTNode as ɵangular_packages_core_core_be,nextContextImpl as ɵangular_packages_core_core_bf} from './src/render3/state';\nexport {BoundPlayerFactory as ɵangular_packages_core_core_bi} from './src/render3/styling/player_factory';\nexport {loadInternal as ɵangular_packages_core_core_bm} from './src/render3/util';\nexport {createElementRef as ɵangular_packages_core_core_i,createTemplateRef as ɵangular_packages_core_core_j,createViewRef as ɵangular_packages_core_core_k} from './src/render3/view_engine_compatibility';\nexport {makeParamDecorator as ɵangular_packages_core_core_a,makePropDecorator as ɵangular_packages_core_core_b} from './src/util/decorators';\nexport {getClosureSafeProperty as ɵangular_packages_core_core_bk} from './src/util/property';\nexport {_def as ɵangular_packages_core_core_ba} from './src/view/provider';\nexport {DebugContext as ɵangular_packages_core_core_bb} from './src/view/types';"],"names":["ChangeDetectionStrategy","ChangeDetectorStatus","ViewEncapsulation","stringify","global","InjectFlags","getRootContext","getRootView","initializeStaticStylingContext","updateElementStyleProp","updateElementClassProp","projectionNodeStack","element","isComponentDef","tslib_1.__values","INJECTOR","NULL_INJECTOR","CIRCULAR","EMPTY_ARRAY","isComponent","resolveProvider","tslib_1.__extends","container","viewEngine_NgModuleRef","render3InjectElementRef","RendererStyleFlags2","render3InjectRenderer2","SecurityContext","ComponentFactoryResolver","ComponentFactory","viewEngine_ComponentFactoryResolver","projection","ComponentRef","viewEngine_ElementRef","viewEngine_ComponentFactory","viewEngine_ComponentRef","NgModuleRef","NgModuleFactory","viewEngine_NgModuleFactory","getPipeDef","Subscription","Subject","render3InjectTemplateRef","insertView","removeView","ViewEngine_ElementRef","ViewEngine_TemplateRef","r3.defineBase","r3.defineComponent","r3.defineDirective","r3.defineNgModule","r3.definePipe","r3.directiveInject","r3.getFactoryOf","r3.getInheritedFactory","r3.injectAttribute","r3.templateRefExtractor","r3.NgOnChangesFeature","r3.ProvidersFeature","r3.InheritDefinitionFeature","r3.elementAttribute","r3.bind","r3.container","r3.nextContext","r3.containerRefreshStart","r3.containerRefreshEnd","r3.loadQueryList","r3.namespaceHTML","r3.namespaceMathML","r3.namespaceSVG","r3.enableBindings","r3.disableBindings","r3.allocHostVars","r3.elementStart","r3.elementEnd","r3.element","r3.elementContainerStart","r3.elementContainerEnd","r3.pureFunction0","r3.pureFunction1","r3.pureFunction2","r3.pureFunction3","r3.pureFunction4","r3.pureFunction5","r3.pureFunction6","r3.pureFunction7","r3.pureFunction8","r3.pureFunctionV","r3.getCurrentView","r3.restoreView","r3.interpolation1","r3.interpolation2","r3.interpolation3","r3.interpolation4","r3.interpolation5","r3.interpolation6","r3.interpolation7","r3.interpolation8","r3.interpolationV","r3.elementClassProp","r3.listener","r3.load","r3.projection","r3.elementProperty","r3.componentHostSyntheticProperty","r3.pipeBind1","r3.pipeBind2","r3.pipeBind3","r3.pipeBind4","r3.pipeBindV","r3.projectionDef","r3.pipe","r3.query","r3.queryRefresh","r3.registerContentQuery","r3.reference","r3.elementStyling","r3.elementHostAttrs","r3.elementStylingMap","r3.elementStyleProp","r3.elementStylingApply","r3.template","r3.text","r3.textBinding","r3.embeddedViewStart","r3.embeddedViewEnd","r3.i18n","r3.i18nAttributes","r3.i18nExp","r3.i18nStart","r3.i18nEnd","r3.i18nApply","r3.i18nPostprocess","sanitization.sanitizeHtml","sanitization.sanitizeStyle","sanitization.defaultStyleSanitizer","sanitization.sanitizeResourceUrl","sanitization.sanitizeScript","sanitization.sanitizeUrl","R3NgModuleFactory","flatten","render3CompileComponent","render3CompileDirective","render3CompilePipe","USE_VALUE","render3CompileNgModule","render3CompileInjectable","ResolvedReflectiveFactory","tslib_1.__param","NgModuleFactoryR3","noop","Observable","merge","share","render3InjectViewContainerRef","render3InjectChangeDetectorRef","ViewRef","MissingTranslationStrategy","unwrapValue","_renderCompCount","renderNode","createInjector","RendererV1","InjectorRefTokenKey","INJECTORRefTokenKey","_createProviderInstance","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","tokenKey","createQuery","QueryList","anchorDef","viewDef"],"mappings":";;;;;;;;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;;AAEF,IAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IAC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AED,iCAAM,GAAN,UAAO,cAA6B;YAClC,oBAAoB,EAAE,CAAC;;;;YAIvB,IAAM,GAAG,GAAG,uBAAuB,CAAC,iBAAiB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;YACjF,OAAO,QAAQ,CAAC,iBAAiB,CAC7B,IAAI,CAAC,UAAU,EAAE,cAAc,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;SACvF;QACH,uBAAC;IAAD,CAlBA,CAA+B,eAAe,GAkB7C;;ICxED;;;;;;OAMG;;ICNH;;;;;;OAMG;;ICNH;;;;;;;AAQA,IA0OA,kBAAkB;;IClPlB;;;;;;OAMG;;ICNH;;;;;;OAMG;;ICNH;;;;;;;AAQA,IAOA,0EAA0E;;ICf1E;;;;;;OAMG;;ICNH;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
\ No newline at end of file
+{"version":3,"file":"core.umd.js","sources":["../../../../../../../../../../external/ngdeps/node_modules/tslib/tslib.es6.js","../../../../../packages/core/src/util/property.ts","../../../../../packages/core/src/render3/fields.ts","../../../../../packages/core/src/di/defs.ts","../../../../../packages/core/src/di/injection_token.ts","../../../../../packages/core/src/util/decorators.ts","../../../../../packages/core/src/metadata/di.ts","../../../../../packages/core/src/change_detection/constants.ts","../../../../../packages/core/src/util.ts","../../../../../packages/core/src/di/forward_ref.ts","../../../../../packages/core/src/metadata/resource_loading.ts","../../../../../packages/core/src/metadata/view.ts","../../../../../packages/core/src/render3/ng_dev_mode.ts","../../../../../packages/core/src/render3/empty.ts","../../../../../packages/core/src/render3/definition.ts","../../../../../packages/core/src/render3/assert.ts","../../../../../packages/core/src/render3/interfaces/view.ts","../../../../../packages/core/src/render3/interfaces/container.ts","../../../../../packages/core/src/render3/interfaces/context.ts","../../../../../packages/core/src/render3/interfaces/injector.ts","../../../../../packages/core/src/render3/util.ts","../../../../../packages/core/src/render3/jit/compiler_facade_interface.ts","../../../../../packages/core/src/render3/jit/compiler_facade.ts","../../../../../packages/core/src/di/metadata.ts","../../../../../packages/core/src/di/injector_compatibility.ts","../../../../../packages/core/src/render3/node_assert.ts","../../../../../packages/core/src/render3/hooks.ts","../../../../../packages/core/src/render3/state.ts","../../../../../packages/core/src/render3/di.ts","../../../../../packages/core/src/render3/context_discovery.ts","../../../../../packages/core/src/render3/discovery_utils.ts","../../../../../packages/core/src/util/ng_reflect.ts","../../../../../packages/core/src/change_detection/change_detection_util.ts","../../../../../packages/core/src/render3/errors.ts","../../../../../packages/core/src/render3/tokens.ts","../../../../../packages/core/src/render3/bindings.ts","../../../../../packages/core/src/render3/interfaces/projection.ts","../../../../../packages/core/src/render3/interfaces/renderer.ts","../../../../../packages/core/src/render3/interfaces/node.ts","../../../../../packages/core/src/render3/node_manipulation.ts","../../../../../packages/core/src/render3/node_selector_matcher.ts","../../../../../packages/core/src/render3/styling/player_factory.ts","../../../../../packages/core/src/render3/styling/core_player_handler.ts","../../../../../packages/core/src/render3/styling/util.ts","../../../../../packages/core/src/render3/styling/class_and_style_bindings.ts","../../../../../packages/core/src/render3/instructions.ts","../../../../../packages/core/src/render3/players.ts","../../../../../packages/core/src/render3/global_utils_api.ts","../../../../../packages/core/src/render3/global_utils.ts","../../../../../packages/core/src/render3/component.ts","../../../../../packages/core/src/render3/features/inherit_definition_feature.ts","../../../../../packages/core/src/render3/features/ng_onchanges_feature.ts","../../../../../packages/core/src/util/noop.ts","../../../../../packages/core/src/di/injector.ts","../../../../../packages/core/src/di/scope.ts","../../../../../packages/core/src/di/r3_injector.ts","../../../../../packages/core/src/render3/di_setup.ts","../../../../../packages/core/src/render3/features/providers_feature.ts","../../../../../packages/core/src/linker/component_factory.ts","../../../../../packages/core/src/linker/component_factory_resolver.ts","../../../../../packages/core/src/linker/ng_module_factory.ts","../../../../../packages/core/src/render3/view_ref.ts","../../../../../packages/core/src/render3/view_engine_compatibility.ts","../../../../../packages/core/src/linker/element_ref.ts","../../../../../packages/core/src/render/api.ts","../../../../../packages/core/src/sanitization/security.ts","../../../../../packages/core/src/version.ts","../../../../../packages/core/src/render3/component_ref.ts","../../../../../packages/core/src/is_dev_mode.ts","../../../../../packages/core/src/sanitization/inert_body.ts","../../../../../packages/core/src/sanitization/url_sanitizer.ts","../../../../../packages/core/src/sanitization/html_sanitizer.ts","../../../../../packages/core/src/render3/interfaces/i18n.ts","../../../../../packages/core/src/render3/i18n.ts","../../../../../packages/core/src/render3/ng_module_ref.ts","../../../../../packages/core/src/render3/metadata.ts","../../../../../packages/core/src/render3/pure_function.ts","../../../../../packages/core/src/render3/pipe.ts","../../../../../packages/core/src/event_emitter.ts","../../../../../packages/core/src/linker/template_ref.ts","../../../../../packages/core/src/render3/interfaces/definition.ts","../../../../../packages/core/src/render3/interfaces/query.ts","../../../../../packages/core/src/render3/query.ts","../../../../../packages/core/src/render3/view_engine_compatibility_prebound.ts","../../../../../packages/core/src/render3/index.ts","../../../../../packages/core/src/sanitization/bypass.ts","../../../../../packages/core/src/sanitization/style_sanitizer.ts","../../../../../packages/core/src/sanitization/sanitization.ts","../../../../../packages/core/src/render3/jit/environment.ts","../../../../../packages/core/src/linker/ng_module_factory_loader.ts","../../../../../packages/core/src/type.ts","../../../../../packages/core/src/reflection/reflection_capabilities.ts","../../../../../packages/core/src/render3/jit/util.ts","../../../../../packages/core/src/render3/jit/module.ts","../../../../../packages/core/src/render3/jit/directive.ts","../../../../../packages/core/src/render3/jit/pipe.ts","../../../../../packages/core/src/metadata/directives.ts","../../../../../packages/core/src/di/util.ts","../../../../../packages/core/src/metadata/ng_module.ts","../../../../../packages/core/src/metadata.ts","../../../../../packages/core/src/render3/jit/injectable.ts","../../../../../packages/core/src/di/injectable.ts","../../../../../packages/core/src/errors.ts","../../../../../packages/core/src/error_handler.ts","../../../../../packages/core/src/di/reflective_errors.ts","../../../../../packages/core/src/di/reflective_key.ts","../../../../../packages/core/src/reflection/reflector.ts","../../../../../packages/core/src/reflection/reflection.ts","../../../../../packages/core/src/di/reflective_provider.ts","../../../../../packages/core/src/di/reflective_injector.ts","../../../../../packages/core/src/di.ts","../../../../../packages/core/src/util/lang.ts","../../../../../packages/core/src/application_init.ts","../../../../../packages/core/src/application_tokens.ts","../../../../../packages/core/src/console.ts","../../../../../packages/core/src/linker/compiler.ts","../../../../../packages/core/src/profile/wtf_impl.ts","../../../../../packages/core/src/profile/profile.ts","../../../../../packages/core/src/zone/ng_zone.ts","../../../../../packages/core/src/testability/testability.ts","../../../../../packages/core/src/application_ref.ts","../../../../../packages/core/src/zone.ts","../../../../../packages/core/src/render.ts","../../../../../packages/core/src/linker/query_list.ts","../../../../../packages/core/src/linker/system_js_ng_module_factory_loader.ts","../../../../../packages/core/src/linker/view_container_ref.ts","../../../../../packages/core/src/change_detection/change_detector_ref.ts","../../../../../packages/core/src/linker/view_ref.ts","../../../../../packages/core/src/linker.ts","../../../../../packages/core/src/debug/debug_node.ts","../../../../../packages/core/src/change_detection/differs/default_iterable_differ.ts","../../../../../packages/core/src/change_detection/differs/default_keyvalue_differ.ts","../../../../../packages/core/src/change_detection/differs/iterable_differs.ts","../../../../../packages/core/src/change_detection/differs/keyvalue_differs.ts","../../../../../packages/core/src/change_detection/change_detection.ts","../../../../../packages/core/src/change_detection.ts","../../../../../packages/core/src/platform_core_providers.ts","../../../../../packages/core/src/i18n/tokens.ts","../../../../../packages/core/src/application_module.ts","../../../../../packages/core/src/ivy_switch.ts","../../../../../packages/core/src/view/types.ts","../../../../../packages/core/src/view/errors.ts","../../../../../packages/core/src/view/util.ts","../../../../../packages/core/src/view/element.ts","../../../../../packages/core/src/view/ng_module.ts","../../../../../packages/core/src/view/view_attach.ts","../../../../../packages/core/src/view/refs.ts","../../../../../packages/core/src/view/provider.ts","../../../../../packages/core/src/view/query.ts","../../../../../packages/core/src/view/ng_content.ts","../../../../../packages/core/src/view/pure_expression.ts","../../../../../packages/core/src/view/text.ts","../../../../../packages/core/src/view/view.ts","../../../../../packages/core/src/view/services.ts","../../../../../packages/core/src/view/entrypoint.ts","../../../../../packages/core/src/view/index.ts","../../../../../packages/core/src/core_private_export.ts","../../../../../packages/core/src/core_render3_private_export.ts","../../../../../packages/core/src/codegen_private_exports.ts","../../../../../packages/core/src/core.ts","../../../../../packages/core/public_api.ts","../../../../../packages/core/index.ts","../../../../../packages/core/core.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function getClosureSafeProperty<T>(objWithPropertyToExtract: T): string {\n for (let key in objWithPropertyToExtract) {\n if (objWithPropertyToExtract[key] === getClosureSafeProperty as any) {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.');\n}\n\n/**\n * Sets properties on a target object from a source object, but only if\n * the property doesn't already exist on the target object.\n * @param target The target to set properties on\n * @param source The source of the property keys and values to set\n */\nexport function fillProperties(target: {[key: string]: string}, source: {[key: string]: string}) {\n for (const key in source) {\n if (source.hasOwnProperty(key) && !target.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getClosureSafeProperty} from '../util/property';\n\nexport const NG_COMPONENT_DEF = getClosureSafeProperty({ngComponentDef: getClosureSafeProperty});\nexport const NG_DIRECTIVE_DEF = getClosureSafeProperty({ngDirectiveDef: getClosureSafeProperty});\nexport const NG_INJECTABLE_DEF = getClosureSafeProperty({ngInjectableDef: getClosureSafeProperty});\nexport const NG_INJECTOR_DEF = getClosureSafeProperty({ngInjectorDef: getClosureSafeProperty});\nexport const NG_PIPE_DEF = getClosureSafeProperty({ngPipeDef: getClosureSafeProperty});\nexport const NG_MODULE_DEF = getClosureSafeProperty({ngModuleDef: getClosureSafeProperty});\nexport const NG_BASE_DEF = getClosureSafeProperty({ngBaseDef: getClosureSafeProperty});\n\n/**\n * If a directive is diPublic, bloomAdd sets a property on the type with this constant as\n * the key and the directive's unique ID as the value. This allows us to map directives to their\n * bloom filter bit for DI.\n */\nexport const NG_ELEMENT_ID = getClosureSafeProperty({__NG_ELEMENT_ID__: getClosureSafeProperty});\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NG_INJECTABLE_DEF, NG_INJECTOR_DEF} from '../render3/fields';\nimport {Type} from '../type';\n\nimport {ClassProvider, ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\n/**\n * Information about how a type or `InjectionToken` interfaces with the DI system.\n *\n * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly\n * requesting injection of other types if necessary.\n *\n * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular\n * `InjectorDef`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates\n * that the injectable does not belong to any scope.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectableDef<T> {\n /**\n * Specifies that the given type belongs to a particular injector:\n * - `InjectorType` such as `NgModule`,\n * - `'root'` the root injector\n * - `'any'` all injectors.\n * - `null`, does not belong to any injector. Must be explicitly listed in the injector\n * `providers`.\n */\n providedIn: InjectorType<any>|'root'|'any'|null;\n\n /**\n * Factory method to execute to create an instance of the injectable.\n */\n factory: () => T;\n\n /**\n * In a case of no explicit injector, a location where the instance of the injectable is stored.\n */\n value: T|undefined;\n}\n\n/**\n * Information about the providers to be included in an `Injector` as well as how the given type\n * which carries the information should be created by the DI system.\n *\n * An `InjectorDef` can import other types which have `InjectorDefs`, forming a deep nested\n * structure of providers with a defined priority (identically to how `NgModule`s also have\n * an import/dependency structure).\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorDef<T> {\n factory: () => T;\n\n // TODO(alxhub): Narrow down the type here once decorators properly change the return type of the\n // class they are decorating (to add the ngInjectableDef property for example).\n providers: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n\n imports: (InjectorType<any>|InjectorTypeWithProviders<any>)[];\n}\n\n/**\n * A `Type` which has an `InjectableDef` static field.\n *\n * `InjectableDefType`s contain their own Dependency Injection metadata and are usable in an\n * `InjectorDef`-based `StaticInjector.\n *\n * @publicApi\n */\nexport interface InjectableType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectableDef: never;\n}\n\n/**\n * A type which has an `InjectorDef` static field.\n *\n * `InjectorDefTypes` can be used to configure a `StaticInjector`.\n *\n * @publicApi\n */\nexport interface InjectorType<T> extends Type<T> {\n /**\n * Opaque type whose structure is highly version dependent. Do not rely on any properties.\n */\n ngInjectorDef: never;\n}\n\n/**\n * Describes the `InjectorDef` equivalent of a `ModuleWithProviders`, an `InjectorDefType` with an\n * associated array of providers.\n *\n * Objects of this type can be listed in the imports section of an `InjectorDef`.\n *\n * NOTE: This is a private type and should not be exported\n */\nexport interface InjectorTypeWithProviders<T> {\n ngModule: InjectorType<T>;\n providers?: (Type<any>|ValueProvider|ExistingProvider|FactoryProvider|ConstructorProvider|\n StaticClassProvider|ClassProvider|any[])[];\n}\n\n\n/**\n * Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and\n * in which injectors (if any) it will be available.\n *\n * This should be assigned to a static `ngInjectableDef` field on a type, which will then be an\n * `InjectableType`.\n *\n * Options:\n * * `providedIn` determines which injectors will include the injectable, by either associating it\n * with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be\n * provided in the `'root'` injector, which will be the application-level injector in most apps.\n * * `factory` gives the zero argument function which will create an instance of the injectable.\n * The factory can call `inject` to access the `Injector` and request injection of dependencies.\n *\n * @publicApi\n */\nexport function defineInjectable<T>(opts: {\n providedIn?: Type<any>| 'root' | 'any' | null,\n factory: () => T,\n}): never {\n return ({\n providedIn: opts.providedIn as any || null, factory: opts.factory, value: undefined,\n } as InjectableDef<T>) as never;\n}\n\n/**\n * Construct an `InjectorDef` which configures an injector.\n *\n * This should be assigned to a static `ngInjectorDef` field on a type, which will then be an\n * `InjectorType`.\n *\n * Options:\n *\n * * `factory`: an `InjectorType` is an instantiable type, so a zero argument `factory` function to\n * create the type must be provided. If that factory function needs to inject arguments, it can\n * use the `inject` function.\n * * `providers`: an optional array of providers to add to the injector. Each provider must\n * either have a factory or point to a type which has an `ngInjectableDef` static property (the\n * type must be an `InjectableType`).\n * * `imports`: an optional array of imports of other `InjectorType`s or `InjectorTypeWithModule`s\n * whose providers will also be added to the injector. Locally provided types will override\n * providers from imports.\n *\n * @publicApi\n */\nexport function defineInjector(options: {factory: () => any, providers?: any[], imports?: any[]}):\n never {\n return ({\n factory: options.factory, providers: options.providers || [], imports: options.imports || [],\n } as InjectorDef<any>) as never;\n}\n\n/**\n * Read the `ngInjectableDef` type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have `ngInjectableDef`\n */\nexport function getInjectableDef<T>(type: any): InjectableDef<T>|null {\n return type && type.hasOwnProperty(NG_INJECTABLE_DEF) ? (type as any)[NG_INJECTABLE_DEF] : null;\n}\n\n/**\n * Read the `ngInjectorDef` type in a way which is immune to accidentally reading inherited value.\n *\n * @param type type which may have `ngInjectorDef`\n */\nexport function getInjectorDef<T>(type: any): InjectorDef<T>|null {\n return type && type.hasOwnProperty(NG_INJECTOR_DEF) ? (type as any)[NG_INJECTOR_DEF] : null;\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\nimport {defineInjectable} from './defs';\n\n/**\n * Creates a token that can be used in a DI Provider.\n *\n * Use an `InjectionToken` whenever the type you are injecting is not reified (does not have a\n * runtime representation) such as when injecting an interface, callable type, array or\n * parameterized type.\n *\n * `InjectionToken` is parameterized on `T` which is the type of object which will be returned by\n * the `Injector`. This provides additional level of type safety.\n *\n * ```\n * interface MyInterface {...}\n * var myInterface = injector.get(new InjectionToken<MyInterface>('SomeToken'));\n * // myInterface is inferred to be MyInterface.\n * ```\n *\n * When creating an `InjectionToken`, you can optionally specify a factory function which returns\n * (possibly by creating) a default value of the parameterized type `T`. This sets up the\n * `InjectionToken` using this factory as a provider as if it was defined explicitly in the\n * application's root injector. If the factory function, which takes zero arguments, needs to inject\n * dependencies, it can do so using the `inject` function. See below for an example.\n *\n * Additionally, if a `factory` is specified you can also specify the `providedIn` option, which\n * overrides the above behavior and marks the token as belonging to a particular `@NgModule`. As\n * mentioned above, `'root'` is the default value for `providedIn`.\n *\n * @usageNotes\n * ### Basic Example\n *\n * ### Plain InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='InjectionToken'}\n *\n * ### Tree-shakable InjectionToken\n *\n * {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}\n *\n *\n * @publicApi\n */\nexport class InjectionToken<T> {\n /** @internal */\n readonly ngMetadataName = 'InjectionToken';\n\n readonly ngInjectableDef: never|undefined;\n\n constructor(protected _desc: string, options?: {\n providedIn?: Type<any>| 'root' | null,\n factory: () => T\n }) {\n if (options !== undefined) {\n this.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn || 'root',\n factory: options.factory,\n });\n } else {\n this.ngInjectableDef = undefined;\n }\n }\n\n toString(): string { return `InjectionToken ${this._desc}`; }\n}\n\nexport interface InjectableDefToken<T> extends InjectionToken<T> { ngInjectableDef: never; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\n/**\n * An interface implemented by all Angular type decorators, which allows them to be used as ES7\n * decorators as well as\n * Angular DSL syntax.\n *\n * ES7 syntax:\n *\n * ```\n * @ng.Component({...})\n * class MyClass {...}\n * ```\n *\n * @publicApi\n */\nexport interface TypeDecorator {\n /**\n * Invoke as ES7 decorator.\n */\n <T extends Type<any>>(type: T): T;\n\n // Make TypeDecorator assignable to built-in ParameterDecorator type.\n // ParameterDecorator is declared in lib.d.ts as a `declare type`\n // so we cannot declare this interface as a subtype.\n // see https://github.com/angular/angular/issues/3379#issuecomment-126169417\n (target: Object, propertyKey?: string|symbol, parameterIndex?: number): void;\n}\n\nexport const ANNOTATIONS = '__annotations__';\nexport const PARAMETERS = '__parameters__';\nexport const PROP_METADATA = '__prop__metadata__';\n\n/**\n * @suppress {globalThis}\n */\nexport function makeDecorator<T>(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (type: Type<T>) => void,\n typeFn?: (type: Type<T>, ...args: any[]) => void):\n {new (...args: any[]): any; (...args: any[]): any; (...args: any[]): (cls: any) => any;} {\n const metaCtor = makeMetadataCtor(props);\n\n function DecoratorFactory(...args: any[]): (cls: Type<T>) => any {\n if (this instanceof DecoratorFactory) {\n metaCtor.call(this, ...args);\n return this;\n }\n\n const annotationInstance = new (DecoratorFactory as any)(...args);\n return function TypeDecorator(cls: Type<T>) {\n if (typeFn) typeFn(cls, ...args);\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const annotations = cls.hasOwnProperty(ANNOTATIONS) ?\n (cls as any)[ANNOTATIONS] :\n Object.defineProperty(cls, ANNOTATIONS, {value: []})[ANNOTATIONS];\n annotations.push(annotationInstance);\n\n\n if (additionalProcessing) additionalProcessing(cls);\n\n return cls;\n };\n }\n\n if (parentClass) {\n DecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n DecoratorFactory.prototype.ngMetadataName = name;\n (DecoratorFactory as any).annotationCls = DecoratorFactory;\n return DecoratorFactory as any;\n}\n\nfunction makeMetadataCtor(props?: (...args: any[]) => any): any {\n return function ctor(...args: any[]) {\n if (props) {\n const values = props(...args);\n for (const propName in values) {\n this[propName] = values[propName];\n }\n }\n };\n}\n\nexport function makeParamDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any): any {\n const metaCtor = makeMetadataCtor(props);\n function ParamDecoratorFactory(...args: any[]): any {\n if (this instanceof ParamDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n const annotationInstance = new (<any>ParamDecoratorFactory)(...args);\n\n (<any>ParamDecorator).annotation = annotationInstance;\n return ParamDecorator;\n\n function ParamDecorator(cls: any, unusedKey: any, index: number): any {\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const parameters = cls.hasOwnProperty(PARAMETERS) ?\n (cls as any)[PARAMETERS] :\n Object.defineProperty(cls, PARAMETERS, {value: []})[PARAMETERS];\n\n // there might be gaps if some in between parameters do not have annotations.\n // we pad with nulls.\n while (parameters.length <= index) {\n parameters.push(null);\n }\n\n (parameters[index] = parameters[index] || []).push(annotationInstance);\n return cls;\n }\n }\n if (parentClass) {\n ParamDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n ParamDecoratorFactory.prototype.ngMetadataName = name;\n (<any>ParamDecoratorFactory).annotationCls = ParamDecoratorFactory;\n return ParamDecoratorFactory;\n}\n\nexport function makePropDecorator(\n name: string, props?: (...args: any[]) => any, parentClass?: any,\n additionalProcessing?: (target: any, name: string, ...args: any[]) => void): any {\n const metaCtor = makeMetadataCtor(props);\n\n function PropDecoratorFactory(...args: any[]): any {\n if (this instanceof PropDecoratorFactory) {\n metaCtor.apply(this, args);\n return this;\n }\n\n const decoratorInstance = new (<any>PropDecoratorFactory)(...args);\n\n function PropDecorator(target: any, name: string) {\n const constructor = target.constructor;\n // Use of Object.defineProperty is important since it creates non-enumerable property which\n // prevents the property is copied during subclassing.\n const meta = constructor.hasOwnProperty(PROP_METADATA) ?\n (constructor as any)[PROP_METADATA] :\n Object.defineProperty(constructor, PROP_METADATA, {value: {}})[PROP_METADATA];\n meta[name] = meta.hasOwnProperty(name) && meta[name] || [];\n meta[name].unshift(decoratorInstance);\n\n if (additionalProcessing) additionalProcessing(target, name, ...args);\n }\n\n return PropDecorator;\n }\n\n if (parentClass) {\n PropDecoratorFactory.prototype = Object.create(parentClass.prototype);\n }\n\n PropDecoratorFactory.prototype.ngMetadataName = name;\n (<any>PropDecoratorFactory).annotationCls = PropDecoratorFactory;\n return PropDecoratorFactory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {Type} from '../type';\nimport {makeParamDecorator, makePropDecorator} from '../util/decorators';\n\n/**\n * A DI token that you can use to create a virtual [provider](guide/glossary#provider)\n * that will populate the `entryComponents` field of components and NgModules\n * based on its `useValue` property value.\n * All components that are referenced in the `useValue` value (either directly\n * or in a nested array or map) are added to the `entryComponents` property.\n *\n * @usageNotes\n *\n * The following example shows how the router can populate the `entryComponents`\n * field of an NgModule based on a router configuration that refers\n * to components.\n *\n * ```typescript\n * // helper function inside the router\n * function provideRoutes(routes) {\n * return [\n * {provide: ROUTES, useValue: routes},\n * {provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: routes, multi: true}\n * ];\n * }\n *\n * // user code\n * let routes = [\n * {path: '/root', component: RootComp},\n * {path: '/teams', component: TeamsComp}\n * ];\n *\n * @NgModule({\n * providers: [provideRoutes(routes)]\n * })\n * class ModuleWithRoutes {}\n * ```\n *\n * @publicApi\n */\nexport const ANALYZE_FOR_ENTRY_COMPONENTS = new InjectionToken<any>('AnalyzeForEntryComponents');\n\n/**\n * Type of the `Attribute` decorator / constructor function.\n *\n * @publicApi\n */\nexport interface AttributeDecorator {\n /**\n * Specifies that a constant attribute value should be injected.\n *\n * The directive can inject constant string literals of host element attributes.\n *\n * @usageNotes\n * ### Example\n *\n * Suppose we have an `<input>` element and want to know its `type`.\n *\n * ```html\n * <input type=\"text\">\n * ```\n *\n * A decorator can inject string literal `text` as in the following example.\n *\n * {@example core/ts/metadata/metadata.ts region='attributeMetadata'}\n *\n * @publicApi\n */\n (name: string): any;\n new (name: string): Attribute;\n}\n\n\n/**\n * Type of the Attribute metadata.\n *\n * @publicApi\n */\nexport interface Attribute {\n /**\n * The name of the attribute to be injected into the constructor.\n */\n attributeName?: string;\n}\n\n/**\n * Attribute decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Attribute: AttributeDecorator =\n makeParamDecorator('Attribute', (attributeName?: string) => ({attributeName}));\n\n/**\n * Type of the Query metadata.\n *\n * @publicApi\n */\nexport interface Query {\n descendants: boolean;\n first: boolean;\n read: any;\n isViewQuery: boolean;\n selector: any;\n}\n\n/**\n * Base class for query metadata.\n *\n * @see `ContentChildren`.\n * @see `ContentChild`.\n * @see `ViewChildren`.\n * @see `ViewChild`.\n *\n * @publicApi\n */\nexport abstract class Query {}\n\n/**\n * Type of the ContentChildren decorator / constructor function.\n *\n * @see `ContentChildren`.\n * @publicApi\n */\nexport interface ContentChildrenDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChildren to get the `QueryList` of elements or directives from the\n * content DOM. Any time a child element is added, removed, or moved, the query list will be\n * updated, and the changes observable of the query list will emit a new value.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **descendants** - include only direct children or all descendants.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n * ### Basic Example\n *\n * Here is a simple demonstration of how the `ContentChildren` decorator can be used.\n *\n * {@example core/di/ts/contentChildren/content_children_howto.ts region='HowTo'}\n *\n * ### Tab-pane Example\n *\n * Here is a slightly more realistic example that shows how `ContentChildren` decorators\n * can be used to implement a tab pane component.\n *\n * {@example core/di/ts/contentChildren/content_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {descendants?: boolean, read?: any}): Query;\n}\n\n/**\n * Type of the ContentChildren metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport type ContentChildren = Query;\n\n/**\n * ContentChildren decorator and metadata.\n *\n *\n * @Annotation\n * @publicApi\n */\nexport const ContentChildren: ContentChildrenDecorator = makePropDecorator(\n 'ContentChildren',\n (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: false, descendants: false, ...data}),\n Query);\n\n/**\n * Type of the ContentChild decorator / constructor function.\n *\n * @publicApi\n */\nexport interface ContentChildDecorator {\n /**\n * Configures a content query.\n *\n * You can use ContentChild to get the first element or the directive matching the selector from\n * the content DOM. If the content DOM changes, and a new child matches the selector,\n * the property will be updated.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried element.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/contentChild/content_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ContentChild;\n}\n\n/**\n * Type of the ContentChild metadata.\n *\n * @publicApi\n */\nexport type ContentChild = Query;\n\n/**\n * ContentChild decorator and metadata.\n *\n *\n * @Annotation\n *\n * @publicApi\n */\nexport const ContentChild: ContentChildDecorator = makePropDecorator(\n 'ContentChild', (selector?: any, data: any = {}) =>\n ({selector, first: true, isViewQuery: false, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChildren decorator / constructor function.\n *\n * @see `ViewChildren`.\n *\n * @publicApi\n */\nexport interface ViewChildrenDecorator {\n /**\n * Configures a view query.\n *\n * You can use ViewChildren to get the `QueryList` of elements or directives from the\n * view DOM. Any time a child element is added, removed, or moved, the query list will be updated,\n * and the changes observable of the query list will emit a new value.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * @usageNotes\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChildren/view_children_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChildren;\n}\n\n/**\n * Type of the ViewChildren metadata.\n *\n * @publicApi\n */\nexport type ViewChildren = Query;\n\n/**\n * ViewChildren decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChildren: ViewChildrenDecorator = makePropDecorator(\n 'ViewChildren', (selector?: any, data: any = {}) =>\n ({selector, first: false, isViewQuery: true, descendants: true, ...data}),\n Query);\n\n/**\n * Type of the ViewChild decorator / constructor function.\n *\n * @see `ViewChild`.\n * @publicApi\n */\nexport interface ViewChildDecorator {\n /**\n * @description\n * Property decorator that configures a view query.\n * The change detector looks for the first element or the directive matching the selector\n * in the view DOM. If the view DOM changes, and a new child matches the selector,\n * the property is updated.\n *\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * **Metadata Properties**:\n *\n * * **selector** - the directive type or the name used for querying.\n * * **read** - read a different token from the queried elements.\n *\n * Supported selectors include:\n * * any class with the `@Component` or `@Directive` decorator\n * * a template reference variable as a string (e.g. query `<my-component #cmp></my-component>`\n * with `@ViewChild('cmp')`)\n * * any provider defined in the child component tree of the current component (e.g.\n * `@ViewChild(SomeService) someService: SomeService`)\n * * any provider defined through a string token (e.g. `@ViewChild('someToken') someTokenVal:\n * any`)\n * * a `TemplateRef` (e.g. query `<ng-template></ng-template>` with `@ViewChild(TemplateRef)\n * template;`)\n *\n * @usageNotes\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_howto.ts region='HowTo'}\n *\n * ### Example\n *\n * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}\n *\n * @Annotation\n */\n (selector: Type<any>|Function|string, opts?: {read?: any}): any;\n new (selector: Type<any>|Function|string, opts?: {read?: any}): ViewChild;\n}\n\n/**\n * Type of the ViewChild metadata.\n *\n * @publicApi\n */\nexport type ViewChild = Query;\n\n/**\n * ViewChild decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const ViewChild: ViewChildDecorator = makePropDecorator(\n 'ViewChild', (selector: any, data: any) =>\n ({selector, first: true, isViewQuery: true, descendants: true, ...data}),\n Query);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n *\n * @publicApi\n */\nexport enum ChangeDetectionStrategy {\n /**\n * Use the `CheckOnce` strategy, meaning that automatic change detection is deactivated\n * until reactivated by setting the strategy to `Default` (`CheckAlways`).\n * Change detection can still be explicitly invoked.\n */\n OnPush = 0,\n\n /**\n * Use the default `CheckAlways` strategy, in which change detection is automatic until\n * explicitly deactivated.\n */\n Default = 1,\n}\n\n/**\n * Defines the possible states of the default change detector.\n * @see `ChangeDetectorRef`\n */\nexport enum ChangeDetectorStatus {\n /**\n * A state in which, after calling `detectChanges()`, the change detector\n * state becomes `Checked`, and must be explicitly invoked or reactivated.\n */\n CheckOnce,\n\n /**\n * A state in which change detection is skipped until the change detector mode\n * becomes `CheckOnce`.\n */\n Checked,\n\n /**\n * A state in which change detection continues automatically until explicitly\n * deactivated.\n */\n CheckAlways,\n\n /**\n * A state in which a change detector sub tree is not a part of the main tree and\n * should be skipped.\n */\n Detached,\n\n /**\n * Indicates that the change detector encountered an error checking a binding\n * or calling a directive lifecycle method and is now in an inconsistent state. Change\n * detectors in this state do not detect changes.\n */\n Errored,\n\n /**\n * Indicates that the change detector has been destroyed.\n */\n Destroyed,\n}\n\n/**\n * Reports whether a given strategy is currently the default for change detection.\n * @param changeDetectionStrategy The strategy to check.\n * @returns True if the given strategy is the current default, false otherwise.\n * @see `ChangeDetectorStatus`\n * @see `ChangeDetectorRef`\n */\nexport function isDefaultChangeDetectionStrategy(changeDetectionStrategy: ChangeDetectionStrategy):\n boolean {\n return changeDetectionStrategy == null ||\n changeDetectionStrategy === ChangeDetectionStrategy.Default;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// TODO(jteplitz602): Load WorkerGlobalScope from lib.webworker.d.ts file #3492\ndeclare var WorkerGlobalScope: any /** TODO #9100 */;\n// CommonJS / Node have global context exposed as \"global\" variable.\n// We don't want to include the whole node.d.ts this this compilation unit so we'll just fake\n// the global \"global\" var for now.\ndeclare var global: any /** TODO #9100 */;\nconst __window = typeof window !== 'undefined' && window;\nconst __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&\n self instanceof WorkerGlobalScope && self;\nconst __global = typeof global !== 'undefined' && global;\n\n// Check __global first, because in Node tests both __global and __window may be defined and _global\n// should be __global in that case.\nconst _global: {[name: string]: any} = __global || __window || __self;\n\nconst promise: Promise<any> = Promise.resolve(0);\n/**\n * Attention: whenever providing a new value, be sure to add an\n * entry into the corresponding `....externs.js` file,\n * so that closure won't use that global for its purposes.\n */\nexport {_global as global};\n\n// When Symbol.iterator doesn't exist, retrieves the key used in es6-shim\ndeclare const Symbol: any;\nlet _symbolIterator: any = null;\nexport function getSymbolIterator(): string|symbol {\n if (!_symbolIterator) {\n const Symbol = _global['Symbol'];\n if (Symbol && Symbol.iterator) {\n _symbolIterator = Symbol.iterator;\n } else {\n // es6-shim specific logic\n const keys = Object.getOwnPropertyNames(Map.prototype);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (key !== 'entries' && key !== 'size' &&\n (Map as any).prototype[key] === Map.prototype['entries']) {\n _symbolIterator = key;\n }\n }\n }\n }\n return _symbolIterator;\n}\n\nexport function scheduleMicroTask(fn: Function) {\n if (typeof Zone === 'undefined') {\n // use promise to schedule microTask instead of use Zone\n promise.then(() => { fn && fn.apply(null, null); });\n } else {\n Zone.current.scheduleMicroTask('scheduleMicrotask', fn);\n }\n}\n\n// JS has NaN !== NaN\nexport function looseIdentical(a: any, b: any): boolean {\n return a === b || typeof a === 'number' && typeof b === 'number' && isNaN(a) && isNaN(b);\n}\n\nexport function stringify(token: any): string {\n if (typeof token === 'string') {\n return token;\n }\n\n if (token instanceof Array) {\n return '[' + token.map(stringify).join(', ') + ']';\n }\n\n if (token == null) {\n return '' + token;\n }\n\n if (token.overriddenName) {\n return `${token.overriddenName}`;\n }\n\n if (token.name) {\n return `${token.name}`;\n }\n\n const res = token.toString();\n\n if (res == null) {\n return '' + res;\n }\n\n const newLineIndex = res.indexOf('\\n');\n return newLineIndex === -1 ? res : res.substring(0, newLineIndex);\n}\n\n/**\n * Convince closure compiler that the wrapped function has no side-effects.\n *\n * Closure compiler always assumes that `toString` has no side-effects. We use this quirk to\n * allow us to execute a function but have closure compiler mark the call as no-side-effects.\n * It is important that the return value for the `noSideEffects` function be assigned\n * to something which is retained otherwise the call to `noSideEffects` will be removed by closure\n * compiler.\n */\nexport function noSideEffects(fn: () => void): string {\n return '' + {toString: fn};\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {getClosureSafeProperty} from '../util/property';\n\n\n\n/**\n * An interface that a function passed into {@link forwardRef} has to implement.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref_fn'}\n * @publicApi\n */\nexport interface ForwardRefFn { (): any; }\n\nconst __forward_ref__ = getClosureSafeProperty({__forward_ref__: getClosureSafeProperty});\n\n/**\n * Allows to refer to references which are not yet defined.\n *\n * For instance, `forwardRef` is used when the `token` which we need to refer to for the purposes of\n * DI is declared, but not yet defined. It is also used when the `token` which we use when creating\n * a query is not yet defined.\n *\n * @usageNotes\n * ### Example\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='forward_ref'}\n * @publicApi\n */\nexport function forwardRef(forwardRefFn: ForwardRefFn): Type<any> {\n (<any>forwardRefFn).__forward_ref__ = forwardRef;\n (<any>forwardRefFn).toString = function() { return stringify(this()); };\n return (<Type<any>><any>forwardRefFn);\n}\n\n/**\n * Lazily retrieves the reference value from a forwardRef.\n *\n * Acts as the identity function when given a non-forward-ref value.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/forward_ref/forward_ref_spec.ts region='resolve_forward_ref'}\n *\n * @see `forwardRef`\n * @publicApi\n */\nexport function resolveForwardRef<T>(type: T): T {\n const fn: any = type;\n if (typeof fn === 'function' && fn.hasOwnProperty(__forward_ref__) &&\n fn.__forward_ref__ === forwardRef) {\n return fn();\n } else {\n return type;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Component} from './directives';\n\n\n/**\n * Used to resolve resource URLs on `@Component` when used with JIT compilation.\n *\n * Example:\n * ```\n * @Component({\n * selector: 'my-comp',\n * templateUrl: 'my-comp.html', // This requires asynchronous resolution\n * })\n * class MyComponent{\n * }\n *\n * // Calling `renderComponent` will fail because `renderComponent` is a synchronous process\n * // and `MyComponent`'s `@Component.templateUrl` needs to be resolved asynchronously.\n *\n * // Calling `resolveComponentResources()` will resolve `@Component.templateUrl` into\n * // `@Component.template`, which allows `renderComponent` to proceed in a synchronous manner.\n *\n * // Use browser's `fetch()` function as the default resource resolution strategy.\n * resolveComponentResources(fetch).then(() => {\n * // After resolution all URLs have been converted into `template` strings.\n * renderComponent(MyComponent);\n * });\n *\n * ```\n *\n * NOTE: In AOT the resolution happens during compilation, and so there should be no need\n * to call this method outside JIT mode.\n *\n * @param resourceResolver a function which is responsible for returning a `Promise` to the\n * contents of the resolved URL. Browser's `fetch()` method is a good default implementation.\n */\nexport function resolveComponentResources(\n resourceResolver: (url: string) => (Promise<string|{text(): Promise<string>}>)): Promise<null> {\n // Store all promises which are fetching the resources.\n const urlFetches: Promise<string>[] = [];\n\n // Cache so that we don't fetch the same resource more than once.\n const urlMap = new Map<string, Promise<string>>();\n function cachedResourceResolve(url: string): Promise<string> {\n let promise = urlMap.get(url);\n if (!promise) {\n const resp = resourceResolver(url);\n urlMap.set(url, promise = resp.then(unwrapResponse));\n urlFetches.push(promise);\n }\n return promise;\n }\n\n componentResourceResolutionQueue.forEach((component: Component) => {\n if (component.templateUrl) {\n cachedResourceResolve(component.templateUrl).then((template) => {\n component.template = template;\n component.templateUrl = undefined;\n });\n }\n const styleUrls = component.styleUrls;\n const styles = component.styles || (component.styles = []);\n const styleOffset = component.styles.length;\n styleUrls && styleUrls.forEach((styleUrl, index) => {\n styles.push(''); // pre-allocate array.\n cachedResourceResolve(styleUrl).then((style) => {\n styles[styleOffset + index] = style;\n styleUrls.splice(styleUrls.indexOf(styleUrl), 1);\n if (styleUrls.length == 0) {\n component.styleUrls = undefined;\n }\n });\n });\n });\n componentResourceResolutionQueue.clear();\n return Promise.all(urlFetches).then(() => null);\n}\n\nconst componentResourceResolutionQueue: Set<Component> = new Set();\n\nexport function maybeQueueResolutionOfComponentResources(metadata: Component) {\n if (componentNeedsResolution(metadata)) {\n componentResourceResolutionQueue.add(metadata);\n }\n}\n\nexport function componentNeedsResolution(component: Component) {\n return component.templateUrl || component.styleUrls && component.styleUrls.length;\n}\nexport function clearResolutionOfComponentResourcesQueue() {\n componentResourceResolutionQueue.clear();\n}\n\nfunction unwrapResponse(response: string | {text(): Promise<string>}): string|Promise<string> {\n return typeof response == 'string' ? response : response.text();\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n *\n * See {@link Component#encapsulation encapsulation}.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/ts/metadata/encapsulation.ts region='longform'}\n *\n * @publicApi\n */\nexport enum ViewEncapsulation {\n /**\n * Emulate `Native` scoping of styles by adding an attribute containing surrogate id to the Host\n * Element and pre-processing the style rules provided via {@link Component#styles styles} or\n * {@link Component#styleUrls styleUrls}, and adding the new Host Element attribute to all\n * selectors.\n *\n * This is the default option.\n */\n Emulated = 0,\n /**\n * @deprecated v6.1.0 - use {ViewEncapsulation.ShadowDom} instead.\n * Use the native encapsulation mechanism of the renderer.\n *\n * For the DOM this means using the deprecated [Shadow DOM\n * v0](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n Native = 1,\n /**\n * Don't provide any template or style encapsulation.\n */\n None = 2,\n\n /**\n * Use Shadow DOM to encapsulate styles.\n *\n * For the DOM this means using modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * creating a ShadowRoot for Component's Host Element.\n */\n ShadowDom = 3\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\ndeclare global {\n const ngDevMode: null|NgDevModePerfCounters;\n interface NgDevModePerfCounters {\n firstTemplatePass: number;\n tNode: number;\n tView: number;\n rendererCreateTextNode: number;\n rendererSetText: number;\n rendererCreateElement: number;\n rendererAddEventListener: number;\n rendererSetAttribute: number;\n rendererRemoveAttribute: number;\n rendererSetProperty: number;\n rendererSetClassName: number;\n rendererAddClass: number;\n rendererRemoveClass: number;\n rendererSetStyle: number;\n rendererRemoveStyle: number;\n rendererDestroy: number;\n rendererDestroyNode: number;\n rendererMoveNode: number;\n rendererRemoveNode: number;\n rendererCreateComment: number;\n }\n}\n\ndeclare let global: any;\n\nexport function ngDevModeResetPerfCounters(): NgDevModePerfCounters {\n const newCounters: NgDevModePerfCounters = {\n firstTemplatePass: 0,\n tNode: 0,\n tView: 0,\n rendererCreateTextNode: 0,\n rendererSetText: 0,\n rendererCreateElement: 0,\n rendererAddEventListener: 0,\n rendererSetAttribute: 0,\n rendererRemoveAttribute: 0,\n rendererSetProperty: 0,\n rendererSetClassName: 0,\n rendererAddClass: 0,\n rendererRemoveClass: 0,\n rendererSetStyle: 0,\n rendererRemoveStyle: 0,\n rendererDestroy: 0,\n rendererDestroyNode: 0,\n rendererMoveNode: 0,\n rendererRemoveNode: 0,\n rendererCreateComment: 0,\n };\n // NOTE: Under Ivy we may have both window & global defined in the Node\n // environment since ensureDocument() in render3.ts sets global.window.\n if (typeof window != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (window as any)['ngDevMode'] = newCounters;\n }\n if (typeof global != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (global as any)['ngDevMode'] = newCounters;\n }\n if (typeof self != 'undefined') {\n // Make sure to refer to ngDevMode as ['ngDevMode'] for closure.\n (self as any)['ngDevMode'] = newCounters;\n }\n return newCounters;\n}\n\n/**\n * This checks to see if the `ngDevMode` has been set. If yes,\n * than we honor it, otherwise we default to dev mode with additional checks.\n *\n * The idea is that unless we are doing production build where we explicitly\n * set `ngDevMode == false` we should be helping the developer by providing\n * as much early warning and errors as possible.\n */\nif (typeof ngDevMode === 'undefined' || ngDevMode) {\n ngDevModeResetPerfCounters();\n}\n","/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n*/\nimport './ng_dev_mode';\n\n/**\n * This file contains reuseable \"empty\" symbols that can be used as default return values\n * in different parts of the rendering code. Because the same symbols are returned, this\n * allows for identity checks against these values to be consistently used by the framework\n * code.\n */\n\nexport const EMPTY_OBJ: {} = {};\nexport const EMPTY_ARRAY: any[] = [];\n\n// freezing the values prevents any code from accidentally inserting new values in\nif (typeof ngDevMode !== 'undefined' && ngDevMode) {\n Object.freeze(EMPTY_OBJ);\n Object.freeze(EMPTY_ARRAY);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {NgModuleDef} from '../metadata/ng_module';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {Mutable, Type} from '../type';\nimport {noSideEffects, stringify} from '../util';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from './empty';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from './fields';\nimport {BaseDef, ComponentDef, ComponentDefFeature, ComponentQuery, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFeature, DirectiveType, DirectiveTypesOrFactory, HostBindingsFunction, PipeDef, PipeType, PipeTypesOrFactory} from './interfaces/definition';\nimport {CssSelectorList} from './interfaces/projection';\n\nlet _renderCompCount = 0;\n\n/**\n * Create a component definition object.\n *\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngComponentDef = defineComponent({\n * ...\n * });\n * }\n * ```\n */\nexport function defineComponent<T>(componentDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this component. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: (t: Type<T>| null) => T;\n\n /**\n * The number of nodes, local refs, and pipes in this component template.\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the binding start index.\n */\n // TODO(kara): remove queries from this count\n consts: number;\n\n /**\n * The number of bindings in this component template (including pure fn bindings).\n *\n * Used to calculate the length of this component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n vars: number;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: ['publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['public', 'declared']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ((dirIndex: number) => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n\n /**\n * Template function use for rendering DOM.\n *\n * This function has following structure.\n *\n * ```\n * function Template<T>(ctx:T, creationMode: boolean) {\n * if (creationMode) {\n * // Contains creation mode instructions.\n * }\n * // Contains binding update instructions\n * }\n * ```\n *\n * Common instructions are:\n * Creation mode instructions:\n * - `elementStart`, `elementEnd`\n * - `text`\n * - `container`\n * - `listener`\n *\n * Binding update instructions:\n * - `bind`\n * - `elementAttribute`\n * - `elementProperty`\n * - `elementClass`\n * - `elementStyle`\n *\n */\n template: ComponentTemplate<T>;\n\n /**\n * Additional set of instructions specific to view query processing. This could be seen as a\n * set of instruction to be inserted into the template function.\n *\n * Query-related instructions need to be pulled out to a specific function as a timing of\n * execution is different as compared to all other instructions (after change detection hooks but\n * before view hooks).\n */\n viewQuery?: ComponentQuery<T>| null;\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}\n */\n features?: ComponentDefFeature[];\n\n /**\n * Defines template and style encapsulation options available for Component's {@link Component}.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n *\n * see: animation\n */\n data?: {[kind: string]: any};\n\n /**\n * A set of styles that the component needs to be present for component to render correctly.\n */\n styles?: string[];\n\n /**\n * The strategy that the default change detector uses to detect changes.\n * When set, takes effect the next time change detection is triggered.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Registry of directives and components that may be found in this component's view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directives?: DirectiveTypesOrFactory | null;\n\n /**\n * Registry of pipes that may be found in this component's view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipes?: PipeTypesOrFactory | null;\n}): never {\n const type = componentDefinition.type;\n const typePrototype = type.prototype;\n const declaredInputs: {[key: string]: string} = {} as any;\n const def: Mutable<ComponentDef<any>, keyof ComponentDef<any>> = {\n type: type,\n providersResolver: null,\n consts: componentDefinition.consts,\n vars: componentDefinition.vars,\n factory: componentDefinition.factory,\n template: componentDefinition.template || null !,\n hostBindings: componentDefinition.hostBindings || null,\n contentQueries: componentDefinition.contentQueries || null,\n contentQueriesRefresh: componentDefinition.contentQueriesRefresh || null,\n attributes: componentDefinition.attributes || null,\n declaredInputs: declaredInputs,\n inputs: null !, // assigned in noSideEffects\n outputs: null !, // assigned in noSideEffects\n exportAs: componentDefinition.exportAs || null,\n onInit: typePrototype.ngOnInit || null,\n doCheck: typePrototype.ngDoCheck || null,\n afterContentInit: typePrototype.ngAfterContentInit || null,\n afterContentChecked: typePrototype.ngAfterContentChecked || null,\n afterViewInit: typePrototype.ngAfterViewInit || null,\n afterViewChecked: typePrototype.ngAfterViewChecked || null,\n onDestroy: typePrototype.ngOnDestroy || null,\n onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush,\n directiveDefs: null !, // assigned in noSideEffects\n pipeDefs: null !, // assigned in noSideEffects\n selectors: componentDefinition.selectors,\n viewQuery: componentDefinition.viewQuery || null,\n features: componentDefinition.features || null,\n data: componentDefinition.data || {},\n // TODO(misko): convert ViewEncapsulation into const enum so that it can be used directly in the\n // next line. Also `None` should be 0 not 2.\n encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated,\n id: 'c',\n styles: componentDefinition.styles || EMPTY_ARRAY,\n _: null as never,\n };\n def._ = noSideEffects(() => {\n const directiveTypes = componentDefinition.directives !;\n const feature = componentDefinition.features;\n const pipeTypes = componentDefinition.pipes !;\n def.id += _renderCompCount++;\n def.inputs = invertObject(componentDefinition.inputs, declaredInputs),\n def.outputs = invertObject(componentDefinition.outputs),\n feature && feature.forEach((fn) => fn(def));\n def.directiveDefs = directiveTypes ?\n () => (typeof directiveTypes === 'function' ? directiveTypes() : directiveTypes)\n .map(extractDirectiveDef) :\n null;\n def.pipeDefs = pipeTypes ?\n () => (typeof pipeTypes === 'function' ? pipeTypes() : pipeTypes).map(extractPipeDef) :\n null;\n }) as never;\n return def as never;\n}\n\nexport function extractDirectiveDef(type: DirectiveType<any>& ComponentType<any>):\n DirectiveDef<any>|ComponentDef<any> {\n const def = getComponentDef(type) || getDirectiveDef(type);\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is neither 'ComponentType' or 'DirectiveType'.`);\n }\n return def !;\n}\n\nexport function extractPipeDef(type: PipeType<any>): PipeDef<any> {\n const def = getPipeDef(type);\n if (ngDevMode && !def) {\n throw new Error(`'${type.name}' is not a 'PipeType'.`);\n }\n return def !;\n}\n\nexport function defineNgModule<T>(def: {type: T} & Partial<NgModuleDef<T>>): never {\n const res: NgModuleDef<T> = {\n type: def.type,\n bootstrap: def.bootstrap || EMPTY_ARRAY,\n declarations: def.declarations || EMPTY_ARRAY,\n imports: def.imports || EMPTY_ARRAY,\n exports: def.exports || EMPTY_ARRAY,\n transitiveCompileScopes: null,\n };\n return res as never;\n}\n\n/**\n * Inverts an inputs or outputs lookup such that the keys, which were the\n * minified keys, are part of the values, and the values are parsed so that\n * the publicName of the property is the new key\n *\n * e.g. for\n *\n * ```\n * class Comp {\n * @Input()\n * propName1: string;\n *\n * @Input('publicName2')\n * declaredPropName2: number;\n * }\n * ```\n *\n * will be serialized as\n *\n * ```\n * {\n * propName1: 'propName1',\n * declaredPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * which is than translated by the minifier as:\n *\n * ```\n * {\n * minifiedPropName1: 'propName1',\n * minifiedPropName2: ['publicName2', 'declaredPropName2'],\n * }\n * ```\n *\n * becomes: (public name => minifiedName)\n *\n * ```\n * {\n * 'propName1': 'minifiedPropName1',\n * 'publicName2': 'minifiedPropName2',\n * }\n * ```\n *\n * Optionally the function can take `secondary` which will result in: (public name => declared name)\n *\n * ```\n * {\n * 'propName1': 'propName1',\n * 'publicName2': 'declaredPropName2',\n * }\n * ```\n *\n\n */\nfunction invertObject(obj: any, secondary?: any): any {\n if (obj == null) return EMPTY_OBJ;\n const newLookup: any = {};\n for (const minifiedKey in obj) {\n if (obj.hasOwnProperty(minifiedKey)) {\n let publicName: string = obj[minifiedKey];\n let declaredName = publicName;\n if (Array.isArray(publicName)) {\n declaredName = publicName[1];\n publicName = publicName[0];\n }\n newLookup[publicName] = minifiedKey;\n if (secondary) {\n (secondary[publicName] = declaredName);\n }\n }\n }\n return newLookup;\n}\n\n/**\n * Create a base definition\n *\n * # Example\n * ```\n * class ShouldBeInherited {\n * static ngBaseDef = defineBase({\n * ...\n * })\n * }\n * @param baseDefinition The base definition parameters\n */\nexport function defineBase<T>(baseDefinition: {\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `outputs`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n}): BaseDef<T> {\n const declaredInputs: {[P in keyof T]: P} = {} as any;\n return {\n inputs: invertObject(baseDefinition.inputs, declaredInputs),\n declaredInputs: declaredInputs,\n outputs: invertObject(baseDefinition.outputs),\n };\n}\n\n/**\n * Create a directive definition object.\n *\n * # Example\n * ```\n * class MyDirective {\n * // Generated by Angular Template Compiler\n * // [Symbol] syntax will not be supported by TypeScript until v2.7\n * static ngDirectiveDef = defineDirective({\n * ...\n * });\n * }\n * ```\n */\nexport const defineDirective = defineComponent as any as<T>(directiveDefinition: {\n /**\n * Directive type, needed to configure the injector.\n */\n type: Type<T>;\n\n /** The selectors that will be used to match nodes to this directive. */\n selectors: CssSelectorList;\n\n /**\n * Factory method used to create an instance of directive.\n */\n factory: (t: Type<T>| null) => T;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n attributes?: string[];\n\n /**\n * A map of input names.\n *\n * The format is in: `{[actualPropertyName: string]:(string|[string, string])}`.\n *\n * Given:\n * ```\n * class MyComponent {\n * @Input()\n * publicInput1: string;\n *\n * @Input('publicInput2')\n * declaredInput2: string;\n * }\n * ```\n *\n * is described as:\n * ```\n * {\n * publicInput1: 'publicInput1',\n * declaredInput2: ['declaredInput2', 'publicInput2'],\n * }\n * ```\n *\n * Which the minifier may translate to:\n * ```\n * {\n * minifiedPublicInput1: 'publicInput1',\n * minifiedDeclaredInput2: [ 'publicInput2', 'declaredInput2'],\n * }\n * ```\n *\n * This allows the render to re-construct the minified, public, and declared names\n * of properties.\n *\n * NOTE:\n * - Because declared and public name are usually same we only generate the array\n * `['declared', 'public']` format when they differ.\n * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has\n * inconsistent behavior in that it uses declared names rather than minified or public. For\n * this reason `NgOnChanges` will be deprecated and removed in future version and this\n * API will be simplified to be consistent with `output`.\n */\n inputs?: {[P in keyof T]?: string | [string, string]};\n\n /**\n * A map of output names.\n *\n * The format is in: `{[actualPropertyName: string]:string}`.\n *\n * Which the minifier may translate to: `{[minifiedPropertyName: string]:string}`.\n *\n * This allows the render to re-construct the minified and non-minified names\n * of properties.\n */\n outputs?: {[P in keyof T]?: string};\n\n /**\n * A list of optional features to apply.\n *\n * See: {@link NgOnChangesFeature}, {@link ProvidersFeature}, {@link InheritDefinitionFeature}\n */\n features?: DirectiveDefFeature[];\n\n /**\n * Function executed by the parent template to allow child directive to apply host bindings.\n */\n hostBindings?: HostBindingsFunction<T>;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries?: ((directiveIndex: number) => void);\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh?: ((directiveIndex: number, queryIndex: number) => void);\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * See: {@link Directive.exportAs}\n */\n exportAs?: string;\n}) => never;\n\n/**\n * Create a pipe definition object.\n *\n * # Example\n * ```\n * class MyPipe implements PipeTransform {\n * // Generated by Angular Template Compiler\n * static ngPipeDef = definePipe({\n * ...\n * });\n * }\n * ```\n * @param pipeDef Pipe definition generated by the compiler\n */\nexport function definePipe<T>(pipeDef: {\n /** Name of the pipe. Used for matching pipes in template to pipe defs. */\n name: string,\n\n /** Pipe class reference. Needed to extract pipe lifecycle hooks. */\n type: Type<T>,\n\n /** A factory for creating a pipe instance. */\n factory: (t: Type<T>| null) => T,\n\n /** Whether the pipe is pure. */\n pure?: boolean\n}): never {\n return (<PipeDef<T>>{\n name: pipeDef.name,\n factory: pipeDef.factory,\n pure: pipeDef.pure !== false,\n onDestroy: pipeDef.type.prototype.ngOnDestroy || null\n }) as never;\n}\n\n/**\n * The following getter methods retrieve the definition form the type. Currently the retrieval\n * honors inheritance, but in the future we may change the rule to require that definitions are\n * explicit. This would require some sort of migration strategy.\n */\n\nexport function getComponentDef<T>(type: any): ComponentDef<T>|null {\n return (type as any)[NG_COMPONENT_DEF] || null;\n}\n\nexport function getDirectiveDef<T>(type: any): DirectiveDef<T>|null {\n return (type as any)[NG_DIRECTIVE_DEF] || null;\n}\n\nexport function getPipeDef<T>(type: any): PipeDef<T>|null {\n return (type as any)[NG_PIPE_DEF] || null;\n}\n\nexport function getNgModuleDef<T>(type: any, throwNotFound: true): NgModuleDef<T>;\nexport function getNgModuleDef<T>(type: any): NgModuleDef<T>|null;\nexport function getNgModuleDef<T>(type: any, throwNotFound?: boolean): NgModuleDef<T>|null {\n const ngModuleDef = (type as any)[NG_MODULE_DEF] || null;\n if (!ngModuleDef && throwNotFound === true) {\n throw new Error(`Type ${stringify(type)} does not have 'ngModuleDef' property.`);\n }\n return ngModuleDef;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getComponentDef, getNgModuleDef} from './definition';\nimport {TNode} from './interfaces/node';\nimport {LView} from './interfaces/view';\n\n// The functions in this file verify that the assumptions we are making\n// about state in an instruction are correct before implementing any logic.\n// They are meant only to be called in dev mode as sanity checks.\n\nexport function assertNumber(actual: any, msg: string) {\n if (typeof actual != 'number') {\n throwError(msg);\n }\n}\n\nexport function assertEqual<T>(actual: T, expected: T, msg: string) {\n if (actual != expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotEqual<T>(actual: T, expected: T, msg: string) {\n if (actual == expected) {\n throwError(msg);\n }\n}\n\nexport function assertSame<T>(actual: T, expected: T, msg: string) {\n if (actual !== expected) {\n throwError(msg);\n }\n}\n\nexport function assertLessThan<T>(actual: T, expected: T, msg: string) {\n if (actual >= expected) {\n throwError(msg);\n }\n}\n\nexport function assertGreaterThan<T>(actual: T, expected: T, msg: string) {\n if (actual <= expected) {\n throwError(msg);\n }\n}\n\nexport function assertNotDefined<T>(actual: T, msg: string) {\n if (actual != null) {\n throwError(msg);\n }\n}\n\nexport function assertDefined<T>(actual: T, msg: string) {\n if (actual == null) {\n throwError(msg);\n }\n}\n\nexport function assertComponentType(\n actual: any,\n msg: string =\n 'Type passed in is not ComponentType, it does not have \\'ngComponentDef\\' property.') {\n if (!getComponentDef(actual)) {\n throwError(msg);\n }\n}\n\nexport function assertNgModuleType(\n actual: any,\n msg: string =\n 'Type passed in is not NgModuleType, it does not have \\'ngModuleDef\\' property.') {\n if (!getNgModuleDef(actual)) {\n throwError(msg);\n }\n}\n\nfunction throwError(msg: string): never {\n // tslint:disable-next-line\n debugger; // Left intentionally for better debugger experience.\n throw new Error(`ASSERTION ERROR: ${msg}`);\n}\n\nexport function assertDomNode(node: any) {\n assertEqual(node instanceof Node, true, 'The provided value must be an instance of a DOM Node');\n}\n\n\nexport function assertPreviousIsParent(isParent: boolean) {\n assertEqual(isParent, true, 'previousOrParentTNode should be a parent');\n}\n\nexport function assertHasParent(tNode: TNode) {\n assertDefined(tNode.parent, 'previousOrParentTNode should have a parent');\n}\n\nexport function assertDataNext(lView: LView, index: number, arr?: any[]) {\n if (arr == null) arr = lView;\n assertEqual(\n arr.length, index, `index ${index} expected to be at the end of arr (length ${arr.length})`);\n}\n\nexport function assertDataInRange(arr: any[], index: number) {\n assertLessThan(index, arr ? arr.length : 0, 'index expected to be a valid data index');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../../di/injection_token';\nimport {Injector} from '../../di/injector';\nimport {QueryList} from '../../linker';\nimport {Sanitizer} from '../../sanitization/security';\nimport {Type} from '../../type';\nimport {LContainer} from './container';\nimport {ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefList, HostBindingsFunction, PipeDef, PipeDefList} from './definition';\nimport {I18nUpdateOpCodes, TI18n} from './i18n';\nimport {TElementNode, TNode, TViewNode} from './node';\nimport {PlayerHandler} from './player';\nimport {LQueries} from './query';\nimport {RElement, Renderer3, RendererFactory3} from './renderer';\nimport {StylingContext} from './styling';\n\n\n// Below are constants for LView indices to help us look up LView members\n// without having to remember the specific indices.\n// Uglify will inline these when minifying so there shouldn't be a cost.\nexport const TVIEW = 0;\nexport const FLAGS = 1;\nexport const PARENT = 2;\nexport const NEXT = 3;\nexport const QUERIES = 4;\nexport const HOST = 5;\nexport const HOST_NODE = 6; // Rename to `T_HOST`?\nexport const BINDING_INDEX = 7;\nexport const CLEANUP = 8;\nexport const CONTEXT = 9;\nexport const INJECTOR = 10;\nexport const RENDERER_FACTORY = 11;\nexport const RENDERER = 12;\nexport const SANITIZER = 13;\nexport const TAIL = 14;\nexport const CONTAINER_INDEX = 15;\nexport const CONTENT_QUERIES = 16;\nexport const DECLARATION_VIEW = 17;\n/** Size of LView's header. Necessary to adjust for it when setting slots. */\nexport const HEADER_OFFSET = 18;\n\n\n// This interface replaces the real LView interface if it is an arg or a\n// return value of a public instruction. This ensures we don't need to expose\n// the actual interface, which should be kept private.\nexport interface OpaqueViewState {\n '__brand__': 'Brand for OpaqueViewState that nothing will match';\n}\n\n\n/**\n * `LView` stores all of the information needed to process the instructions as\n * they are invoked from the template. Each embedded view and component view has its\n * own `LView`. When processing a particular view, we set the `viewData` to that\n * `LView`. When that view is done processing, the `viewData` is set back to\n * whatever the original `viewData` was before (the parent `LView`).\n *\n * Keeping separate state for each view facilities view insertion / deletion, so we\n * don't have to edit the data array based on which views are present.\n */\nexport interface LView extends Array<any> {\n /**\n * The static data for this view. We need a reference to this so we can easily walk up the\n * node tree in DI and get the TView.data array associated with a node (where the\n * directive defs are stored).\n */\n readonly[TVIEW]: TView;\n\n /** Flags for this view. See LViewFlags for more info. */\n [FLAGS]: LViewFlags;\n\n /**\n * The parent view is needed when we exit the view and must restore the previous\n * `LView`. Without this, the render method would have to keep a stack of\n * views as it is recursively rendering templates.\n *\n * This is the \"insertion\" view for embedded views. This allows us to properly\n * destroy embedded views.\n */\n [PARENT]: LView|null;\n\n /**\n *\n * The next sibling LView or LContainer.\n *\n * Allows us to propagate between sibling view states that aren't in the same\n * container. Embedded views already have a node.next, but it is only set for\n * views in the same container. We need a way to link component views and views\n * across containers as well.\n */\n [NEXT]: LView|LContainer|null;\n\n /** Queries active for this view - nodes from a view are reported to those queries. */\n [QUERIES]: LQueries|null;\n\n /**\n * The host node for this LView instance, if this is a component view.\n *\n * If this is an embedded view, HOST will be null.\n */\n [HOST]: RElement|StylingContext|null;\n\n /**\n * Pointer to the `TViewNode` or `TElementNode` which represents the root of the view.\n *\n * If `TViewNode`, this is an embedded view of a container. We need this to be able to\n * efficiently find the `LViewNode` when inserting the view into an anchor.\n *\n * If `TElementNode`, this is the LView of a component.\n *\n * If null, this is the root view of an application (root component is in this view).\n */\n [HOST_NODE]: TViewNode|TElementNode|null;\n\n /**\n * The binding index we should access next.\n *\n * This is stored so that bindings can continue where they left off\n * if a view is left midway through processing bindings (e.g. if there is\n * a setter that creates an embedded view, like in ngIf).\n */\n [BINDING_INDEX]: number;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This context array stores both listener functions wrapped with\n * their context and output subscription instances for a particular view.\n *\n * These change per LView instance, so they cannot be stored on TView. Instead,\n * TView.cleanup saves an index to the necessary context in this array.\n */\n // TODO: flatten into LView[]\n [CLEANUP]: any[]|null;\n\n /**\n * - For dynamic views, this is the context with which to render the template (e.g.\n * `NgForContext`), or `{}` if not defined explicitly.\n * - For root view of the root component the context contains change detection data.\n * - For non-root components, the context is the component instance,\n * - For inline views, the context is null.\n */\n [CONTEXT]: {}|RootContext|null;\n\n /** An optional Module Injector to be used as fall back after Element Injectors are consulted. */\n readonly[INJECTOR]: Injector|null;\n\n /** Renderer to be used for this view. */\n [RENDERER_FACTORY]: RendererFactory3;\n\n /** Renderer to be used for this view. */\n [RENDERER]: Renderer3;\n\n /** An optional custom sanitizer. */\n [SANITIZER]: Sanitizer|null;\n\n /**\n * The last LView or LContainer beneath this LView in the hierarchy.\n *\n * The tail allows us to quickly add a new state to the end of the view list\n * without having to propagate starting from the first child.\n */\n [TAIL]: LView|LContainer|null;\n\n /**\n * The index of the parent container's host node. Applicable only to embedded views that\n * have been inserted dynamically. Will be -1 for component views and inline views.\n *\n * This is necessary to jump from dynamically created embedded views to their parent\n * containers because their parent cannot be stored on the TViewNode (views may be inserted\n * in multiple containers, so the parent cannot be shared between view instances).\n */\n [CONTAINER_INDEX]: number;\n\n /**\n * Stores QueryLists associated with content queries of a directive. This data structure is\n * filled-in as part of a directive creation process and is later used to retrieve a QueryList to\n * be refreshed.\n */\n [CONTENT_QUERIES]: QueryList<any>[]|null;\n\n /**\n * View where this view's template was declared.\n *\n * Only applicable for dynamically created views. Will be null for inline/component views.\n *\n * The template for a dynamically created view may be declared in a different view than\n * it is inserted. We already track the \"insertion view\" (view where the template was\n * inserted) in LView[PARENT], but we also need access to the \"declaration view\"\n * (view where the template was declared). Otherwise, we wouldn't be able to call the\n * view's template function with the proper contexts. Context should be inherited from\n * the declaration view tree, not the insertion view tree.\n *\n * Example (AppComponent template):\n *\n * <ng-template #foo></ng-template> <-- declared here -->\n * <some-comp [tpl]=\"foo\"></some-comp> <-- inserted inside this component -->\n *\n * The <ng-template> above is declared in the AppComponent template, but it will be passed into\n * SomeComp and inserted there. In this case, the declaration view would be the AppComponent,\n * but the insertion view would be SomeComp. When we are removing views, we would want to\n * traverse through the insertion view to clean up listeners. When we are calling the\n * template function during change detection, we need the declaration view to get inherited\n * context.\n */\n [DECLARATION_VIEW]: LView|null;\n}\n\n/** Flags associated with an LView (saved in LView[FLAGS]) */\nexport const enum LViewFlags {\n /**\n * Whether or not the view is in creationMode.\n *\n * This must be stored in the view rather than using `data` as a marker so that\n * we can properly support embedded views. Otherwise, when exiting a child view\n * back into the parent view, `data` will be defined and `creationMode` will be\n * improperly reported as false.\n */\n CreationMode = 0b000000001,\n\n /**\n * Whether or not this LView instance is on its first processing pass.\n *\n * An LView instance is considered to be on its \"first pass\" until it\n * has completed one creation mode run and one update mode run. At this\n * time, the flag is turned off.\n */\n FirstLViewPass = 0b000000010,\n\n /** Whether this view has default change detection strategy (checks always) or onPush */\n CheckAlways = 0b000000100,\n\n /** Whether or not this view is currently dirty (needing check) */\n Dirty = 0b000001000,\n\n /** Whether or not this view is currently attached to change detection tree. */\n Attached = 0b000010000,\n\n /**\n * Whether or not the init hooks have run.\n *\n * If on, the init hooks haven't yet been run and should be executed by the first component that\n * runs OR the first cR() instruction that runs (so inits are run for the top level view before\n * any embedded views).\n */\n RunInit = 0b000100000,\n\n /** Whether or not this view is destroyed. */\n Destroyed = 0b001000000,\n\n /** Whether or not this view is the root view */\n IsRoot = 0b010000000,\n}\n\n/**\n * The static data for an LView (shared between all templates of a\n * given type).\n *\n * Stored on the template function as ngPrivateData.\n */\nexport interface TView {\n /**\n * ID for inline views to determine whether a view is the same as the previous view\n * in a certain position. If it's not, we know the new view needs to be inserted\n * and the one that exists needs to be removed (e.g. if/else statements)\n *\n * If this is -1, then this is a component view or a dynamically created view.\n */\n readonly id: number;\n\n /**\n * This is a blueprint used to generate LView instances for this TView. Copying this\n * blueprint is faster than creating a new LView from scratch.\n */\n blueprint: LView;\n\n /**\n * The template function used to refresh the view of dynamically created views\n * and components. Will be null for inline views.\n */\n template: ComponentTemplate<{}>|null;\n\n /**\n * A function containing query-related instructions.\n */\n viewQuery: ComponentQuery<{}>|null;\n\n /**\n * Pointer to the `TNode` that represents the root of the view.\n *\n * If this is a `TViewNode` for an `LViewNode`, this is an embedded view of a container.\n * We need this pointer to be able to efficiently find this node when inserting the view\n * into an anchor.\n *\n * If this is a `TElementNode`, this is the view of a root component. It has exactly one\n * root TNode.\n *\n * If this is null, this is the view of a component that is not at root. We do not store\n * the host TNodes for child component views because they can potentially have several\n * different host TNodes, depending on where the component is being used. These host\n * TNodes cannot be shared (due to different indices, etc).\n */\n node: TViewNode|TElementNode|null;\n\n /** Whether or not this template has been processed. */\n firstTemplatePass: boolean;\n\n /** Static data equivalent of LView.data[]. Contains TNodes, PipeDefInternal or TI18n. */\n data: TData;\n\n /**\n * The binding start index is the index at which the data array\n * starts to store bindings only. Saving this value ensures that we\n * will begin reading bindings at the correct point in the array when\n * we are in update mode.\n */\n bindingStartIndex: number;\n\n /**\n * The index where the \"expando\" section of `LView` begins. The expando\n * section contains injectors, directive instances, and host binding values.\n * Unlike the \"consts\" and \"vars\" sections of `LView`, the length of this\n * section cannot be calculated at compile-time because directives are matched\n * at runtime to preserve locality.\n *\n * We store this start index so we know where to start checking host bindings\n * in `setHostBindings`.\n */\n expandoStartIndex: number;\n\n /**\n * Index of the host node of the first LView or LContainer beneath this LView in\n * the hierarchy.\n *\n * Necessary to store this so views can traverse through their nested views\n * to remove listeners and call onDestroy callbacks.\n *\n * For embedded views, we store the index of an LContainer's host rather than the first\n * LView to avoid managing splicing when views are added/removed.\n */\n childIndex: number;\n\n /**\n * A reference to the first child node located in the view.\n */\n firstChild: TNode|null;\n\n /**\n * Set of instructions used to process host bindings efficiently.\n *\n * See VIEW_DATA.md for more information.\n */\n expandoInstructions: (number|HostBindingsFunction<any>|null)[]|null;\n\n /**\n * Full registry of directives and components that may be found in this view.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n directiveRegistry: DirectiveDefList|null;\n\n /**\n * Full registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n *\n * It's necessary to keep a copy of the full def list on the TView so it's possible\n * to render template functions without a host component.\n */\n pipeRegistry: PipeDefList|null;\n\n /**\n * Array of ngOnInit and ngDoCheck hooks that should be executed for this view in\n * creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n initHooks: HookData|null;\n\n /**\n * Array of ngDoCheck hooks that should be executed for this view in update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n checkHooks: HookData|null;\n\n /**\n * Array of ngAfterContentInit and ngAfterContentChecked hooks that should be executed\n * for this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentHooks: HookData|null;\n\n /**\n * Array of ngAfterContentChecked hooks that should be executed for this view in update\n * mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n contentCheckHooks: HookData|null;\n\n /**\n * Array of ngAfterViewInit and ngAfterViewChecked hooks that should be executed for\n * this view in creation mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewHooks: HookData|null;\n\n /**\n * Array of ngAfterViewChecked hooks that should be executed for this view in\n * update mode.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n viewCheckHooks: HookData|null;\n\n /**\n * Array of ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\n destroyHooks: HookData|null;\n\n /**\n * Array of pipe ngOnDestroy hooks that should be executed when this view is destroyed.\n *\n * Even indices: Index of pipe in data\n * Odd indices: Hook function\n *\n * These must be stored separately from directive destroy hooks because their contexts\n * are stored in data.\n */\n pipeDestroyHooks: HookData|null;\n\n /**\n * When a view is destroyed, listeners need to be released and outputs need to be\n * unsubscribed. This cleanup array stores both listener data (in chunks of 4)\n * and output data (in chunks of 2) for a particular view. Combining the arrays\n * saves on memory (70 bytes per array) and on a few bytes of code size (for two\n * separate for loops).\n *\n * If it's a native DOM listener or output subscription being stored:\n * 1st index is: event name `name = tView.cleanup[i+0]`\n * 2nd index is: index of native element `element = lView[tView.cleanup[i+1]]`\n * 3rd index is: index of listener function `listener = lView[CLEANUP][tView.cleanup[i+2]]`\n * 4th index is: `useCaptureOrIndx = tView.cleanup[i+3]`\n * `typeof useCaptureOrIndx == 'boolean' : useCapture boolean\n * `typeof useCaptureOrIndx == 'number':\n * `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`\n * `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`\n *\n * If it's a renderer2 style listener or ViewRef destroy hook being stored:\n * 1st index is: index of the cleanup function in LView.cleanupInstances[]\n * 2nd index is: `null`\n * `lView[CLEANUP][tView.cleanup[i+0]]()`\n *\n * If it's an output subscription or query list destroy hook:\n * 1st index is: output unsubscribe function / query list destroy function\n * 2nd index is: index of function context in LView.cleanupInstances[]\n * `tView.cleanup[i+0].call(lView[CLEANUP][tView.cleanup[i+1]])`\n */\n cleanup: any[]|null;\n\n /**\n * A list of element indices for child components that will need to be\n * refreshed when the current view has finished its check. These indices have\n * already been adjusted for the HEADER_OFFSET.\n *\n */\n components: number[]|null;\n\n /**\n * A list of indices for child directives that have content queries.\n *\n * Even indices: Directive indices\n * Odd indices: Starting index of content queries (stored in CONTENT_QUERIES) for this directive\n */\n contentQueries: number[]|null;\n}\n\nexport const enum RootContextFlags {Empty = 0b00, DetectChanges = 0b01, FlushPlayers = 0b10}\n\n\n/**\n * RootContext contains information which is shared for all components which\n * were bootstrapped with {@link renderComponent}.\n */\nexport interface RootContext {\n /**\n * A function used for scheduling change detection in the future. Usually\n * this is `requestAnimationFrame`.\n */\n scheduler: (workFn: () => void) => void;\n\n /**\n * A promise which is resolved when all components are considered clean (not dirty).\n *\n * This promise is overwritten every time a first call to {@link markDirty} is invoked.\n */\n clean: Promise<null>;\n\n /**\n * RootComponents - The components that were instantiated by the call to\n * {@link renderComponent}.\n */\n components: {}[];\n\n /**\n * The player flushing handler to kick off all animations\n */\n playerHandler: PlayerHandler|null;\n\n /**\n * What render-related operations to run once a scheduler has been set\n */\n flags: RootContextFlags;\n}\n\n/**\n * Array of hooks that should be executed for a view and their directive indices.\n *\n * Even indices: Directive index\n * Odd indices: Hook function\n */\nexport type HookData = (number | (() => void))[];\n\n/**\n * Static data that corresponds to the instance-specific data array on an LView.\n *\n * Each node's static data is stored in tData at the same index that it's stored\n * in the data array. Any nodes that do not have static data store a null value in\n * tData to avoid a sparse array.\n *\n * Each pipe's definition is stored here at the same index as its pipe instance in\n * the data array.\n *\n * Injector bloom filters are also stored here.\n */\nexport type TData =\n (TNode | PipeDef<any>| DirectiveDef<any>| ComponentDef<any>| number | Type<any>|\n InjectionToken<any>| TI18n | I18nUpdateOpCodes | null)[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {LQueries} from './query';\nimport {RComment, RElement} from './renderer';\nimport {StylingContext} from './styling';\nimport {HOST, LView, NEXT, PARENT, QUERIES} from './view';\n\n\n/**\n * Below are constants for LContainer indices to help us look up LContainer members\n * without having to remember the specific indices.\n * Uglify will inline these when minifying so there shouldn't be a cost.\n */\nexport const ACTIVE_INDEX = 0;\nexport const VIEWS = 1;\n// PARENT, NEXT, QUERIES, and HOST are indices 2, 3, 4, and 5.\n// As we already have these constants in LView, we don't need to re-create them.\nexport const NATIVE = 6;\nexport const RENDER_PARENT = 7;\n// Because interfaces in TS/JS cannot be instanceof-checked this means that we\n// need to rely on predictable characteristics of data-structures to check if they\n// are what we expect for them to be. The `LContainer` interface code below has a\n// fixed length and the constant value below references that. Using the length value\n// below we can predictably gaurantee that we are dealing with an `LContainer` array.\n// This value MUST be kept up to date with the length of the `LContainer` array\n// interface below so that runtime type checking can work.\nexport const LCONTAINER_LENGTH = 8;\n\n/**\n * The state associated with a container.\n *\n * This is an array so that its structure is closer to LView. This helps\n * when traversing the view tree (which is a mix of containers and component\n * views), so we can jump to viewOrContainer[NEXT] in the same way regardless\n * of type.\n */\nexport interface LContainer extends Array<any> {\n /**\n * The next active index in the views array to read or write to. This helps us\n * keep track of where we are in the views array.\n * In the case the LContainer is created for a ViewContainerRef,\n * it is set to null to identify this scenario, as indices are \"absolute\" in that case,\n * i.e. provided directly by the user of the ViewContainerRef API.\n */\n [ACTIVE_INDEX]: number;\n\n /**\n * A list of the container's currently active child views. Views will be inserted\n * here as they are added and spliced from here when they are removed. We need\n * to keep a record of current views so we know which views are already in the DOM\n * (and don't need to be re-added) and so we can remove views from the DOM when they\n * are no longer required.\n */\n [VIEWS]: LView[];\n\n /**\n * Access to the parent view is necessary so we can propagate back\n * up from inside a container to parent[NEXT].\n */\n [PARENT]: LView|null;\n\n /**\n * This allows us to jump from a container to a sibling container or component\n * view with the same parent, so we can remove listeners efficiently.\n */\n [NEXT]: LView|LContainer|null;\n\n /**\n * Queries active for this container - all the views inserted to / removed from\n * this container are reported to queries referenced here.\n */\n [QUERIES]: LQueries|null;\n\n /**\n * The host element of this LContainer.\n *\n * The host could be an LView if this container is on a component node.\n * In that case, the component LView is its HOST.\n *\n * It could also be a styling context if this is a node with a style/class\n * binding.\n */\n [HOST]: RElement|RComment|StylingContext|LView;\n\n /** The comment element that serves as an anchor for this LContainer. */\n [NATIVE]: RComment;\n\n /**\n * Parent Element which will contain the location where all of the views will be\n * inserted into to.\n *\n * If `renderParent` is `null` it is headless. This means that it is contained\n * in another view which in turn is contained in another container and\n * therefore it does not yet have its own parent.\n *\n * If `renderParent` is not `null` then it may be:\n * - same as `tContainerNode.parent` in which case it is just a normal container.\n * - different from `tContainerNode.parent` in which case it has been re-projected.\n * In other words `tContainerNode.parent` is logical parent where as\n * `tContainerNode.projectedParent` is render parent.\n *\n * When views are inserted into `LContainer` then `renderParent` is:\n * - `null`, we are in a view, keep going up a hierarchy until actual\n * `renderParent` is found.\n * - not `null`, then use the `projectedParent.native` as the `RElement` to insert\n * views into.\n */\n [RENDER_PARENT]: RElement|null;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {RElement} from './renderer';\nimport {LView} from './view';\n\n/**\n * This property will be monkey-patched on elements, components and directives\n */\nexport const MONKEY_PATCH_KEY_NAME = '__ngContext__';\n\n/**\n * The internal view context which is specific to a given DOM element, directive or\n * component instance. Each value in here (besides the LView and element node details)\n * can be present, null or undefined. If undefined then it implies the value has not been\n * looked up yet, otherwise, if null, then a lookup was executed and nothing was found.\n *\n * Each value will get filled when the respective value is examined within the getContext\n * function. The component, element and each directive instance will share the same instance\n * of the context.\n */\nexport interface LContext {\n /**\n * The component's parent view data.\n */\n lView: LView;\n\n /**\n * The index instance of the node.\n */\n nodeIndex: number;\n\n /**\n * The instance of the DOM node that is attached to the lNode.\n */\n native: RElement;\n\n /**\n * The instance of the Component node.\n */\n component: {}|null|undefined;\n\n /**\n * The list of active directives that exist on this element.\n */\n directives: any[]|null|undefined;\n\n /**\n * The map of local references (local reference name => element or directive instance) that exist\n * on this element.\n */\n localRefs: {[key: string]: any}|null|undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../../di/injection_token';\nimport {InjectFlags} from '../../di/injector_compatibility';\nimport {Type} from '../../type';\nimport {TElementNode} from './node';\nimport {LView, TData} from './view';\n\nexport const TNODE = 8;\nexport const PARENT_INJECTOR = 8;\nexport const INJECTOR_BLOOM_PARENT_SIZE = 9;\n\n/**\n * Represents a relative location of parent injector.\n *\n * The interfaces encodes number of parents `LView`s to traverse and index in the `LView`\n * pointing to the parent injector.\n */\nexport interface RelativeInjectorLocation { __brand__: 'RelativeInjectorLocationFlags'; }\n\nexport const enum RelativeInjectorLocationFlags {\n InjectorIndexMask = 0b111111111111111,\n ViewOffsetShift = 16,\n NO_PARENT = -1,\n}\n\nexport const NO_PARENT_INJECTOR: RelativeInjectorLocation = -1 as any;\n\n/**\n * Each injector is saved in 9 contiguous slots in `LView` and 9 contiguous slots in\n * `TView.data`. This allows us to store information about the current node's tokens (which\n * can be shared in `TView`) as well as the tokens of its ancestor nodes (which cannot be\n * shared, so they live in `LView`).\n *\n * Each of these slots (aside from the last slot) contains a bloom filter. This bloom filter\n * determines whether a directive is available on the associated node or not. This prevents us\n * from searching the directives array at this level unless it's probable the directive is in it.\n *\n * See: https://en.wikipedia.org/wiki/Bloom_filter for more about bloom filters.\n *\n * Because all injectors have been flattened into `LView` and `TViewData`, they cannot typed\n * using interfaces as they were previously. The start index of each `LInjector` and `TInjector`\n * will differ based on where it is flattened into the main array, so it's not possible to know\n * the indices ahead of time and save their types here. The interfaces are still included here\n * for documentation purposes.\n *\n * export interface LInjector extends Array<any> {\n *\n * // Cumulative bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Cumulative bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Cumulative bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Cumulative bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Cumulative bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Cumulative bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Cumulative bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Cumulative bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // We need to store a reference to the injector's parent so DI can keep looking up\n * // the injector tree until it finds the dependency it's looking for.\n * [PARENT_INJECTOR]: number;\n * }\n *\n * export interface TInjector extends Array<any> {\n *\n * // Shared node bloom for directive IDs 0-31 (IDs are % BLOOM_SIZE)\n * [0]: number;\n *\n * // Shared node bloom for directive IDs 32-63\n * [1]: number;\n *\n * // Shared node bloom for directive IDs 64-95\n * [2]: number;\n *\n * // Shared node bloom for directive IDs 96-127\n * [3]: number;\n *\n * // Shared node bloom for directive IDs 128-159\n * [4]: number;\n *\n * // Shared node bloom for directive IDs 160 - 191\n * [5]: number;\n *\n * // Shared node bloom for directive IDs 192 - 223\n * [6]: number;\n *\n * // Shared node bloom for directive IDs 224 - 255\n * [7]: number;\n *\n * // Necessary to find directive indices for a particular node.\n * [TNODE]: TElementNode|TElementContainerNode|TContainerNode;\n * }\n */\n\n/**\n* Factory for creating instances of injectors in the NodeInjector.\n*\n* This factory is complicated by the fact that it can resolve `multi` factories as well.\n*\n* NOTE: Some of the fields are optional which means that this class has two hidden classes.\n* - One without `multi` support (most common)\n* - One with `multi` values, (rare).\n*\n* Since VMs can cache up to 4 inline hidden classes this is OK.\n*\n* - Single factory: Only `resolving` and `factory` is defined.\n* - `providers` factory: `componentProviders` is a number and `index = -1`.\n* - `viewProviders` factory: `componentProviders` is a number and `index` points to `providers`.\n*/\nexport class NodeInjectorFactory {\n /**\n * The inject implementation to be activated when using the factory.\n */\n injectImpl: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T);\n\n /**\n * Marker set to true during factory invocation to see if we get into recursive loop.\n * Recursive loop causes an error to be displayed.\n */\n resolving = false;\n\n /**\n * Marks that the token can see other Tokens declared in `viewProviders` on the same node.\n */\n canSeeViewProviders: boolean;\n\n /**\n * An array of factories to use in case of `multi` provider.\n */\n multi?: Array<() => any>;\n\n /**\n * Number of `multi`-providers which belong to the component.\n *\n * This is needed because when multiple components and directives declare the `multi` provider\n * they have to be concatenated in the correct order.\n *\n * Example:\n *\n * If we have a component and directive active an a single element as declared here\n * ```\n * component:\n * provides: [ {provide: String, useValue: 'component', multi: true} ],\n * viewProvides: [ {provide: String, useValue: 'componentView', multi: true} ],\n *\n * directive:\n * provides: [ {provide: String, useValue: 'directive', multi: true} ],\n * ```\n *\n * Then the expected results are:\n *\n * ```\n * providers: ['component', 'directive']\n * viewProviders: ['component', 'componentView', 'directive']\n * ```\n *\n * The way to think about it is that the `viewProviders` have been inserted after the component\n * but before the directives, which is why we need to know how many `multi`s have been declared by\n * the component.\n */\n componentProviders?: number;\n\n /**\n * Current index of the Factory in the `data`. Needed for `viewProviders` and `providers` merging.\n * See `providerFactory`.\n */\n index?: number;\n\n /**\n * Because the same `multi` provider can be declared in `provides` and `viewProvides` it is\n * possible for `viewProvides` to shadow the `provides`. For this reason we store the\n * `provideFactory` of the `providers` so that `providers` can be extended with `viewProviders`.\n *\n * Example:\n *\n * Given:\n * ```\n * provides: [ {provide: String, useValue: 'all', multi: true} ],\n * viewProvides: [ {provide: String, useValue: 'viewOnly', multi: true} ],\n * ```\n *\n * We have to return `['all']` in case of content injection, but `['all', 'viewOnly']` in case\n * of view injection. We further have to make sure that the shared instances (in our case\n * `all`) are the exact same instance in both the content as well as the view injection. (We\n * have to make sure that we don't double instantiate.) For this reason the `viewProvides`\n * `Factory` has a pointer to the shadowed `provides` factory so that it can instantiate the\n * `providers` (`['all']`) and then extend it with `viewProviders` (`['all'] + ['viewOnly'] =\n * ['all', 'viewOnly']`).\n */\n providerFactory?: NodeInjectorFactory|null;\n\n\n constructor(\n /**\n * Factory to invoke in order to create a new instance.\n */\n public factory:\n (this: NodeInjectorFactory, _: null,\n /**\n * array where injectables tokens are stored. This is used in\n * case of an error reporting to produce friendlier errors.\n */\n tData: TData,\n /**\n * array where existing instances of injectables are stored. This is used in case\n * of multi shadow is needed. See `multi` field documentation.\n */\n lView: LView,\n /**\n * The TNode of the same element injector.\n */\n tNode: TElementNode) => any,\n /**\n * Set to `true` if the token is declared in `viewProviders` (or if it is component).\n */\n isViewProvider: boolean,\n injectImplementation: null|(<T>(token: Type<T>|InjectionToken<T>, flags: InjectFlags) => T)) {\n this.canSeeViewProviders = isViewProvider;\n this.injectImpl = injectImplementation;\n }\n}\n\nconst FactoryPrototype = NodeInjectorFactory.prototype;\nexport function isFactory(obj: any): obj is NodeInjectorFactory {\n // See: https://jsperf.com/instanceof-vs-getprototypeof\n return obj != null && typeof obj == 'object' && Object.getPrototypeOf(obj) == FactoryPrototype;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {global} from '../util';\n\nimport {assertDataInRange, assertDefined, assertGreaterThan, assertLessThan} from './assert';\nimport {ACTIVE_INDEX, LCONTAINER_LENGTH, LContainer} from './interfaces/container';\nimport {LContext, MONKEY_PATCH_KEY_NAME} from './interfaces/context';\nimport {ComponentDef, DirectiveDef} from './interfaces/definition';\nimport {NO_PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags} from './interfaces/injector';\nimport {TContainerNode, TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {RComment, RElement, RText} from './interfaces/renderer';\nimport {StylingContext} from './interfaces/styling';\nimport {CONTEXT, DECLARATION_VIEW, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, LView, LViewFlags, PARENT, RootContext, TData, TVIEW, TView} from './interfaces/view';\n\n/**\n * Returns whether the values are different from a change detection stand point.\n *\n * Constraints are relaxed in checkNoChanges mode. See `devModeEqual` for details.\n */\nexport function isDifferent(a: any, b: any): boolean {\n // NaN is the only value that is not equal to itself so the first\n // test checks if both a and b are not NaN\n return !(a !== a && b !== b) && a !== b;\n}\n\nexport function stringify(value: any): string {\n if (typeof value == 'function') return value.name || value;\n if (typeof value == 'string') return value;\n if (value == null) return '';\n if (typeof value == 'object' && typeof value.type == 'function')\n return value.type.name || value.type;\n return '' + value;\n}\n\n/**\n * Flattens an array in non-recursive way. Input arrays are not modified.\n */\nexport function flatten(list: any[]): any[] {\n const result: any[] = [];\n let i = 0;\n\n while (i < list.length) {\n const item = list[i];\n if (Array.isArray(item)) {\n if (item.length > 0) {\n list = item.concat(list.slice(i + 1));\n i = 0;\n } else {\n i++;\n }\n } else {\n result.push(item);\n i++;\n }\n }\n\n return result;\n}\n\n/** Retrieves a value from any `LView` or `TData`. */\nexport function loadInternal<T>(view: LView | TData, index: number): T {\n ngDevMode && assertDataInRange(view, index + HEADER_OFFSET);\n return view[index + HEADER_OFFSET];\n}\n\n/**\n * Takes the value of a slot in `LView` and returns the element node.\n *\n * Normally, element nodes are stored flat, but if the node has styles/classes on it,\n * it might be wrapped in a styling context. Or if that node has a directive that injects\n * ViewContainerRef, it may be wrapped in an LContainer. Or if that node is a component,\n * it will be wrapped in LView. It could even have all three, so we keep looping\n * until we find something that isn't an array.\n *\n * @param value The initial value in `LView`\n */\nexport function readElementValue(value: RElement | StylingContext | LContainer | LView): RElement {\n while (Array.isArray(value)) {\n value = value[HOST] as any;\n }\n return value;\n}\n\n/**\n * Retrieves an element value from the provided `viewData`, by unwrapping\n * from any containers, component views, or style contexts.\n */\nexport function getNativeByIndex(index: number, lView: LView): RElement {\n return readElementValue(lView[index + HEADER_OFFSET]);\n}\n\nexport function getNativeByTNode(tNode: TNode, hostView: LView): RElement|RText|RComment {\n return readElementValue(hostView[tNode.index]);\n}\n\nexport function getTNode(index: number, view: LView): TNode {\n ngDevMode && assertGreaterThan(index, -1, 'wrong index for TNode');\n ngDevMode && assertLessThan(index, view[TVIEW].data.length, 'wrong index for TNode');\n return view[TVIEW].data[index + HEADER_OFFSET] as TNode;\n}\n\nexport function getComponentViewByIndex(nodeIndex: number, hostView: LView): LView {\n // Could be an LView or an LContainer. If LContainer, unwrap to find LView.\n const slotValue = hostView[nodeIndex];\n return slotValue.length >= HEADER_OFFSET ? slotValue : slotValue[HOST];\n}\n\nexport function isContentQueryHost(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.hasContentQuery) !== 0;\n}\n\nexport function isComponent(tNode: TNode): boolean {\n return (tNode.flags & TNodeFlags.isComponent) === TNodeFlags.isComponent;\n}\n\nexport function isComponentDef<T>(def: DirectiveDef<T>): def is ComponentDef<T> {\n return (def as ComponentDef<T>).template !== null;\n}\n\nexport function isLContainer(value: RElement | RComment | LContainer | StylingContext): boolean {\n // Styling contexts are also arrays, but their first index contains an element node\n return Array.isArray(value) && value.length === LCONTAINER_LENGTH;\n}\n\nexport function isRootView(target: LView): boolean {\n return (target[FLAGS] & LViewFlags.IsRoot) !== 0;\n}\n\n/**\n * Retrieve the root view from any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param component any component\n */\nexport function getRootView(target: LView | {}): LView {\n ngDevMode && assertDefined(target, 'component');\n let lView = Array.isArray(target) ? (target as LView) : readPatchedLView(target) !;\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView = lView[PARENT] !;\n }\n return lView;\n}\n\nexport function getRootContext(viewOrComponent: LView | {}): RootContext {\n const rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT] as RootContext;\n}\n\n/**\n * Returns the monkey-patch value data present on the target (which could be\n * a component, directive or a DOM node).\n */\nexport function readPatchedData(target: any): LView|LContext|null {\n ngDevMode && assertDefined(target, 'Target expected');\n return target[MONKEY_PATCH_KEY_NAME];\n}\n\nexport function readPatchedLView(target: any): LView|null {\n const value = readPatchedData(target);\n if (value) {\n return Array.isArray(value) ? value : (value as LContext).lView;\n }\n return null;\n}\n\nexport function hasParentInjector(parentLocation: RelativeInjectorLocation): boolean {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\n\nexport function getParentInjectorIndex(parentLocation: RelativeInjectorLocation): number {\n return (parentLocation as any as number) & RelativeInjectorLocationFlags.InjectorIndexMask;\n}\n\nexport function getParentInjectorViewOffset(parentLocation: RelativeInjectorLocation): number {\n return (parentLocation as any as number) >> RelativeInjectorLocationFlags.ViewOffsetShift;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nexport function getParentInjectorView(location: RelativeInjectorLocation, startView: LView): LView {\n let viewOffset = getParentInjectorViewOffset(location);\n let parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n // <ng-template> tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW] !;\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the TNode of the parent injector is found.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @param startTNode The TNode instance of the starting element\n * @returns The TNode of the parent injector\n */\nexport function getParentInjectorTNode(\n location: RelativeInjectorLocation, startView: LView, startTNode: TNode): TElementNode|\n TContainerNode|null {\n if (startTNode.parent && startTNode.parent.injectorIndex !== -1) {\n // view offset is 0\n const injectorIndex = startTNode.parent.injectorIndex;\n let parentTNode = startTNode.parent;\n while (parentTNode.parent != null && injectorIndex == parentTNode.injectorIndex) {\n parentTNode = parentTNode.parent;\n }\n return parentTNode;\n }\n\n let viewOffset = getParentInjectorViewOffset(location);\n // view offset is 1\n let parentView = startView;\n let parentTNode = startView[HOST_NODE] as TElementNode;\n\n // view offset is superior to 1\n while (viewOffset > 1) {\n parentView = parentView[DECLARATION_VIEW] !;\n parentTNode = parentView[HOST_NODE] as TElementNode;\n viewOffset--;\n }\n return parentTNode;\n}\n\nexport const defaultScheduler =\n (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame || // browser only\n setTimeout // everything else\n ).bind(global);\n\n/**\n * Equivalent to ES6 spread, add each item to an array.\n *\n * @param items The items to add\n * @param arr The array to which you want to add the items\n */\nexport function addAllToArray(items: any[], arr: any[]) {\n for (let i = 0; i < items.length; i++) {\n arr.push(items[i]);\n }\n}\n\n/**\n * Given a current view, finds the nearest component's host (LElement).\n *\n * @param lView LView for which we want a host element node\n * @returns The host node\n */\nexport function findComponentView(lView: LView): LView {\n let rootTNode = lView[HOST_NODE];\n\n while (rootTNode && rootTNode.type === TNodeType.View) {\n ngDevMode && assertDefined(lView[DECLARATION_VIEW], 'lView[DECLARATION_VIEW]');\n lView = lView[DECLARATION_VIEW] !;\n rootTNode = lView[HOST_NODE];\n }\n\n return lView;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * A set of interfaces which are shared between `@angular/core` and `@angular/compiler` to allow\n * for late binding of `@angular/compiler` for JIT purposes.\n *\n * This file has two copies. Please ensure that they are in sync:\n * - packages/compiler/src/compiler_facade_interface.ts (master)\n * - packages/core/src/render3/jit/compiler_facade_interface.ts (copy)\n *\n * Please ensure that the two files are in sync using this command:\n * ```\n * cp packages/compiler/src/compiler_facade_interface.ts \\\n * packages/core/src/render3/jit/compiler_facade_interface.ts\n * ```\n */\n\nexport interface ExportedCompilerFacade { ɵcompilerFacade: CompilerFacade; }\n\nexport interface CompilerFacade {\n compilePipe(angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3PipeMetadataFacade):\n any;\n compileInjectable(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectableMetadataFacade): any;\n compileInjector(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3InjectorMetadataFacade): any;\n compileNgModule(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3NgModuleMetadataFacade): any;\n compileDirective(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3DirectiveMetadataFacade): any;\n compileComponent(\n angularCoreEnv: CoreEnvironment, sourceMapUrl: string, meta: R3ComponentMetadataFacade): any;\n\n R3ResolvedDependencyType: typeof R3ResolvedDependencyType;\n}\n\nexport interface CoreEnvironment { [name: string]: Function; }\n\nexport type StringMap = {\n [key: string]: string;\n};\n\nexport type StringMapWithRename = {\n [key: string]: string | [string, string];\n};\n\nexport type Provider = any;\n\nexport enum R3ResolvedDependencyType {\n Token = 0,\n Attribute = 1,\n}\n\nexport interface R3DependencyMetadataFacade {\n token: any;\n resolved: R3ResolvedDependencyType;\n host: boolean;\n optional: boolean;\n self: boolean;\n skipSelf: boolean;\n}\n\nexport interface R3PipeMetadataFacade {\n name: string;\n type: any;\n pipeName: string;\n deps: R3DependencyMetadataFacade[]|null;\n pure: boolean;\n}\n\nexport interface R3InjectableMetadataFacade {\n name: string;\n type: any;\n typeArgumentCount: number;\n ctorDeps: R3DependencyMetadataFacade[]|null;\n providedIn: any;\n useClass?: any;\n useFactory?: any;\n useExisting?: any;\n useValue?: any;\n userDeps?: R3DependencyMetadataFacade[];\n}\n\nexport interface R3NgModuleMetadataFacade {\n type: any;\n bootstrap: Function[];\n declarations: Function[];\n imports: Function[];\n exports: Function[];\n emitInline: boolean;\n}\n\nexport interface R3InjectorMetadataFacade {\n name: string;\n type: any;\n deps: R3DependencyMetadataFacade[]|null;\n providers: any[];\n imports: any[];\n}\n\nexport interface R3DirectiveMetadataFacade {\n name: string;\n type: any;\n typeArgumentCount: number;\n typeSourceSpan: null;\n deps: R3DependencyMetadataFacade[]|null;\n selector: string|null;\n queries: R3QueryMetadataFacade[];\n host: {[key: string]: string};\n propMetadata: {[key: string]: any[]};\n lifecycle: {usesOnChanges: boolean;};\n inputs: string[];\n outputs: string[];\n usesInheritance: boolean;\n exportAs: string|null;\n providers: Provider[]|null;\n}\n\nexport interface R3ComponentMetadataFacade extends R3DirectiveMetadataFacade {\n template: string;\n preserveWhitespaces: boolean;\n animations: any[]|undefined;\n viewQueries: R3QueryMetadataFacade[];\n pipes: Map<string, any>;\n directives: {selector: string, expression: any}[];\n styles: string[];\n encapsulation: ViewEncapsulation;\n viewProviders: Provider[]|null;\n interpolation?: [string, string];\n changeDetection?: ChangeDetectionStrategy;\n}\n\nexport type ViewEncapsulation = number;\n\nexport type ChangeDetectionStrategy = number;\n\nexport interface R3QueryMetadataFacade {\n propertyName: string;\n first: boolean;\n predicate: any|string[];\n descendants: boolean;\n read: any|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {global} from '../../util';\nimport {CompilerFacade, ExportedCompilerFacade} from './compiler_facade_interface';\nexport * from './compiler_facade_interface';\n\nexport function getCompilerFacade(): CompilerFacade {\n const globalNg: ExportedCompilerFacade = global['ng'];\n if (!globalNg || !globalNg.ɵcompilerFacade) {\n throw new Error(\n `Angular JIT compilation failed: '@angular/compiler' not loaded!\\n` +\n ` - JIT compilation is discouraged for production use-cases! Consider AOT mode instead.\\n` +\n ` - Did you bootstrap using '@angular/platform-browser-dynamic' or '@angular/platform-server'?\\n` +\n ` - Alternatively provide the compiler with 'import \"@angular/compiler\";' before bootstrapping.`);\n }\n return globalNg.ɵcompilerFacade;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ClassSansProvider, ConstructorProvider, ConstructorSansProvider, ExistingProvider, ExistingSansProvider, FactoryProvider, FactorySansProvider, StaticClassProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from '../di/provider';\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {makeDecorator, makeParamDecorator} from '../util/decorators';\nimport {EMPTY_ARRAY} from '../view/util';\n\n\n/**\n * Type of the Inject decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectDecorator {\n /**\n * A parameter decorator on a dependency parameter of a class constructor\n * that specifies a custom provider of the dependency.\n *\n * Learn more in the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * The following example shows a class constructor that specifies a\n * custom provider of a dependency using the parameter decorator.\n *\n * {@example core/di/ts/metadata_spec.ts region='Inject'}\n *\n * When `@Inject()` is not present, the injector uses the type annotation of the\n * parameter as the provider.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectWithoutDecorator'}\n */\n (token: any): any;\n new (token: any): Inject;\n}\n\n/**\n * Type of the Inject metadata.\n *\n * @publicApi\n */\nexport interface Inject {\n /**\n * A [DI token](guide/glossary#di-token) that maps to the dependency to be injected.\n */\n token: any;\n}\n\n/**\n * Inject decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Inject: InjectDecorator = makeParamDecorator('Inject', (token: any) => ({token}));\n\n\n/**\n * Type of the Optional decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OptionalDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which marks the parameter as being an optional dependency.\n * The DI framework provides null if the dependency is not found.\n *\n * Can be used together with other parameter decorators\n * that modify how dependency injection operates.\n *\n * Learn more in the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n *\n * The following code allows the possibility of a null result:\n *\n * {@example core/di/ts/metadata_spec.ts region='Optional'}\n *\n */\n (): any;\n new (): Optional;\n}\n\n/**\n * Type of the Optional metadata.\n *\n * @publicApi\n */\nexport interface Optional {}\n\n/**\n * Optional decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Optional: OptionalDecorator = makeParamDecorator('Optional');\n\n/**\n * Type of the Self decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SelfDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the local injector.\n *\n * Resolution works upward through the injector hierarchy, so the children\n * of this class must configure their own providers or be prepared for a null result.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved\n * by the local injector when instantiating the class itself, but not\n * when instantiating a child.\n *\n * {@example core/di/ts/metadata_spec.ts region='Self'}\n *\n * @see `SkipSelf`\n * @see `Optional`\n *\n */\n (): any;\n new (): Self;\n}\n\n/**\n * Type of the Self metadata.\n *\n * @publicApi\n */\nexport interface Self {}\n\n/**\n * Self decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Self: SelfDecorator = makeParamDecorator('Self');\n\n\n/**\n * Type of the SkipSelf decorator / constructor function.\n *\n * @publicApi\n */\nexport interface SkipSelfDecorator {\n /**\n * A parameter decorator to be used on constructor parameters,\n * which tells the DI framework to start dependency resolution from the parent injector.\n * Resolution works upward through the injector hierarchy, so the local injector\n * is not checked for a provider.\n *\n * @usageNotes\n *\n * In the following example, the dependency can be resolved when\n * instantiating a child, but not when instantiating the class itself.\n *\n * {@example core/di/ts/metadata_spec.ts region='SkipSelf'}\n *\n * Learn more in the\n * [Dependency Injection guide](guide/dependency-injection-in-action#skip).\n *\n * @see `Self`\n * @see `Optional`\n *\n */\n (): any;\n new (): SkipSelf;\n}\n\n/**\n * Type of the SkipSelf metadata.\n *\n * @publicApi\n */\nexport interface SkipSelf {}\n\n/**\n * SkipSelf decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const SkipSelf: SkipSelfDecorator = makeParamDecorator('SkipSelf');\n\n/**\n * Type of the Host decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostDecorator {\n /**\n * A parameter decorator on a view-provider parameter of a class constructor\n * that tells the DI framework to resolve the view by checking injectors of child\n * elements, and stop when reaching the host element of the current component.\n *\n * For an extended example, see\n * [\"Dependency Injection Guide\"](guide/dependency-injection-in-action#optional).\n *\n * @usageNotes\n *\n * The following shows use with the `@Optional` decorator, and allows for a null result.\n *\n * {@example core/di/ts/metadata_spec.ts region='Host'}\n */\n (): any;\n new (): Host;\n}\n\n/**\n * Type of the Host metadata.\n *\n * @publicApi\n */\nexport interface Host {}\n\n/**\n * Host decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Host: HostDecorator = makeParamDecorator('Host');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, getInjectableDef} from './defs';\nimport {InjectionToken} from './injection_token';\nimport {Injector} from './injector';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\n\n/**\n * Injection flags for DI.\n *\n * @publicApi\n */\nexport enum InjectFlags {\n // TODO(alxhub): make this 'const' when ngc no longer writes exports of it into ngfactory files.\n\n Default = 0b0000,\n\n /**\n * Specifies that an injector should retrieve a dependency from any injector until reaching the\n * host element of the current component. (Only used with Element Injector)\n */\n Host = 0b0001,\n /** Don't descend into ancestors of the node requesting injection. */\n Self = 0b0010,\n /** Skip the node that is requesting injection. */\n SkipSelf = 0b0100,\n /** Inject `defaultValue` instead if token not found. */\n Optional = 0b1000,\n}\n\n\n\n/**\n * Current injector value used by `inject`.\n * - `undefined`: it is an error to call `inject`\n * - `null`: `inject` can be called but there is no injector (limp-mode).\n * - Injector instance: Use the injector for resolution.\n */\nlet _currentInjector: Injector|undefined|null = undefined;\n\nexport function setCurrentInjector(injector: Injector | null | undefined): Injector|undefined|null {\n const former = _currentInjector;\n _currentInjector = injector;\n return former;\n}\n\n/**\n * Current implementation of inject.\n *\n * By default, it is `injectInjectorOnly`, which makes it `Injector`-only aware. It can be changed\n * to `directiveInject`, which brings in the `NodeInjector` system of ivy. It is designed this\n * way for two reasons:\n * 1. `Injector` should not depend on ivy logic.\n * 2. To maintain tree shake-ability we don't want to bring in unnecessary code.\n */\nlet _injectImplementation: (<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags) => T | null)|\n undefined;\n\n/**\n * Sets the current inject implementation.\n */\nexport function setInjectImplementation(\n impl: (<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags) => T | null) | undefined):\n (<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags) => T | null)|undefined {\n const previous = _injectImplementation;\n _injectImplementation = impl;\n return previous;\n}\n\nexport function injectInjectorOnly<T>(token: Type<T>| InjectionToken<T>): T;\nexport function injectInjectorOnly<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|\n null;\nexport function injectInjectorOnly<T>(\n token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n if (_currentInjector === undefined) {\n throw new Error(`inject() must be called from an injection context`);\n } else if (_currentInjector === null) {\n return injectRootLimpMode(token, undefined, flags);\n } else {\n return _currentInjector.get(token, flags & InjectFlags.Optional ? null : undefined, flags);\n }\n}\n\n/**\n * Injects a token from the currently active injector.\n *\n * This function must be used in the context of a factory function such as one defined for an\n * `InjectionToken`, and will throw an error if not called from such a context.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}\n *\n * Within such a factory function `inject` is utilized to request injection of a dependency, instead\n * of providing an additional array of dependencies as was common to do with `useFactory` providers.\n * `inject` is faster and more type-safe.\n *\n * @publicApi\n */\nexport function inject<T>(token: Type<T>| InjectionToken<T>): T;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags?: InjectFlags): T|null;\nexport function inject<T>(token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n return (_injectImplementation || injectInjectorOnly)(token, flags);\n}\n\n/**\n * Injects `root` tokens in limp mode.\n *\n * If no injector exists, we can still inject tree-shakable providers which have `providedIn` set to\n * `\"root\"`. This is known as the limp mode injection. In such case the value is stored in the\n * `InjectableDef`.\n */\nexport function injectRootLimpMode<T>(\n token: Type<T>| InjectionToken<T>, notFoundValue: T | undefined, flags: InjectFlags): T|null {\n const injectableDef: InjectableDef<T>|null = getInjectableDef(token);\n if (injectableDef && injectableDef.providedIn == 'root') {\n return injectableDef.value === undefined ? injectableDef.value = injectableDef.factory() :\n injectableDef.value;\n }\n if (flags & InjectFlags.Optional) return null;\n if (notFoundValue !== undefined) return notFoundValue;\n throw new Error(`Injector: NOT_FOUND [${stringify(token)}]`);\n}\n\nexport function injectArgs(types: (Type<any>| InjectionToken<any>| any[])[]): any[] {\n const args: any[] = [];\n for (let i = 0; i < types.length; i++) {\n const arg = types[i];\n if (Array.isArray(arg)) {\n if (arg.length === 0) {\n throw new Error('Arguments array must have arguments.');\n }\n let type: Type<any>|undefined = undefined;\n let flags: InjectFlags = InjectFlags.Default;\n\n for (let j = 0; j < arg.length; j++) {\n const meta = arg[j];\n if (meta instanceof Optional || meta.ngMetadataName === 'Optional') {\n flags |= InjectFlags.Optional;\n } else if (meta instanceof SkipSelf || meta.ngMetadataName === 'SkipSelf') {\n flags |= InjectFlags.SkipSelf;\n } else if (meta instanceof Self || meta.ngMetadataName === 'Self') {\n flags |= InjectFlags.Self;\n } else if (meta instanceof Inject) {\n type = meta.token;\n } else {\n type = meta;\n }\n }\n\n args.push(inject(type !, flags));\n } else {\n args.push(inject(arg));\n }\n }\n return args;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined, assertEqual} from './assert';\nimport {TNode, TNodeType} from './interfaces/node';\n\nexport function assertNodeType(tNode: TNode, type: TNodeType) {\n assertDefined(tNode, 'should be called with a TNode');\n assertEqual(tNode.type, type, `should be a ${typeName(type)}`);\n}\n\nexport function assertNodeOfPossibleTypes(tNode: TNode, ...types: TNodeType[]) {\n assertDefined(tNode, 'should be called with a TNode');\n const found = types.some(type => tNode.type === type);\n assertEqual(\n found, true,\n `Should be one of ${types.map(typeName).join(', ')} but got ${typeName(tNode.type)}`);\n}\n\nfunction typeName(type: TNodeType): string {\n if (type == TNodeType.Projection) return 'Projection';\n if (type == TNodeType.Container) return 'Container';\n if (type == TNodeType.View) return 'View';\n if (type == TNodeType.Element) return 'Element';\n if (type == TNodeType.ElementContainer) return 'ElementContainer';\n return '<unknown>';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertEqual} from './assert';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TNode} from './interfaces/node';\nimport {FLAGS, HookData, LView, LViewFlags, TView} from './interfaces/view';\n\n\n\n/**\n * If this is the first template pass, any ngOnInit or ngDoCheck hooks will be queued into\n * TView.initHooks during directiveCreate.\n *\n * The directive index and hook type are encoded into one number (1st bit: type, remaining bits:\n * directive index), then saved in the even indices of the initHooks array. The odd indices\n * hold the hook functions themselves.\n *\n * @param index The index of the directive in LView\n * @param hooks The static hooks map on the directive def\n * @param tView The current TView\n */\nexport function queueInitHooks(\n index: number, onInit: (() => void) | null, doCheck: (() => void) | null, tView: TView): void {\n ngDevMode &&\n assertEqual(tView.firstTemplatePass, true, 'Should only be called on first template pass');\n if (onInit) {\n (tView.initHooks || (tView.initHooks = [])).push(index, onInit);\n }\n\n if (doCheck) {\n (tView.initHooks || (tView.initHooks = [])).push(index, doCheck);\n (tView.checkHooks || (tView.checkHooks = [])).push(index, doCheck);\n }\n}\n\n/**\n * Loops through the directives on a node and queues all their hooks except ngOnInit\n * and ngDoCheck, which are queued separately in directiveCreate.\n */\nexport function queueLifecycleHooks(tView: TView, tNode: TNode): void {\n if (tView.firstTemplatePass) {\n // It's necessary to loop through the directives at elementEnd() (rather than processing in\n // directiveCreate) so we can preserve the current hook order. Content, view, and destroy\n // hooks for projected components and directives must be called *before* their hosts.\n for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n queueContentHooks(def, tView, i);\n queueViewHooks(def, tView, i);\n queueDestroyHooks(def, tView, i);\n }\n }\n}\n\n/** Queues afterContentInit and afterContentChecked hooks on TView */\nfunction queueContentHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.afterContentInit) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentInit);\n }\n\n if (def.afterContentChecked) {\n (tView.contentHooks || (tView.contentHooks = [])).push(i, def.afterContentChecked);\n (tView.contentCheckHooks || (tView.contentCheckHooks = [])).push(i, def.afterContentChecked);\n }\n}\n\n/** Queues afterViewInit and afterViewChecked hooks on TView */\nfunction queueViewHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.afterViewInit) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewInit);\n }\n\n if (def.afterViewChecked) {\n (tView.viewHooks || (tView.viewHooks = [])).push(i, def.afterViewChecked);\n (tView.viewCheckHooks || (tView.viewCheckHooks = [])).push(i, def.afterViewChecked);\n }\n}\n\n/** Queues onDestroy hooks on TView */\nfunction queueDestroyHooks(def: DirectiveDef<any>, tView: TView, i: number): void {\n if (def.onDestroy != null) {\n (tView.destroyHooks || (tView.destroyHooks = [])).push(i, def.onDestroy);\n }\n}\n\n/**\n * Calls onInit and doCheck calls if they haven't already been called.\n *\n * @param currentView The current view\n */\nexport function executeInitHooks(\n currentView: LView, tView: TView, checkNoChangesMode: boolean): void {\n if (!checkNoChangesMode && currentView[FLAGS] & LViewFlags.RunInit) {\n executeHooks(currentView, tView.initHooks, tView.checkHooks, checkNoChangesMode);\n currentView[FLAGS] &= ~LViewFlags.RunInit;\n }\n}\n\n/**\n * Iterates over afterViewInit and afterViewChecked functions and calls them.\n *\n * @param currentView The current view\n */\nexport function executeHooks(\n currentView: LView, allHooks: HookData | null, checkHooks: HookData | null,\n checkNoChangesMode: boolean): void {\n if (checkNoChangesMode) return;\n\n const hooksToCall = currentView[FLAGS] & LViewFlags.FirstLViewPass ? allHooks : checkHooks;\n if (hooksToCall) {\n callHooks(currentView, hooksToCall);\n }\n}\n\n/**\n * Calls lifecycle hooks with their contexts, skipping init hooks if it's not\n * the first LView pass.\n *\n * @param currentView The current view\n * @param arr The array in which the hooks are found\n */\nexport function callHooks(currentView: any[], arr: HookData): void {\n for (let i = 0; i < arr.length; i += 2) {\n (arr[i + 1] as() => void).call(currentView[arr[i] as number]);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from './assert';\nimport {executeHooks} from './hooks';\nimport {ComponentDef, DirectiveDef} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeFlags, TViewNode} from './interfaces/node';\nimport {LQueries} from './interfaces/query';\nimport {BINDING_INDEX, CONTEXT, DECLARATION_VIEW, FLAGS, HOST_NODE, LView, LViewFlags, OpaqueViewState, QUERIES, TVIEW} from './interfaces/view';\nimport {isContentQueryHost} from './util';\n\n\n\n/**\n * Store the element depth count. This is used to identify the root elements of the template\n * so that we can than attach `LView` to only those elements.\n */\nlet elementDepthCount !: number;\n\nexport function getElementDepthCount() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return elementDepthCount;\n}\n\nexport function increaseElementDepthCount() {\n elementDepthCount++;\n}\n\nexport function decreaseElementDepthCount() {\n elementDepthCount--;\n}\n\nlet currentDirectiveDef: DirectiveDef<any>|ComponentDef<any>|null = null;\n\nexport function getCurrentDirectiveDef(): DirectiveDef<any>|ComponentDef<any>|null {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return currentDirectiveDef;\n}\n\nexport function setCurrentDirectiveDef(def: DirectiveDef<any>| ComponentDef<any>| null): void {\n currentDirectiveDef = def;\n}\n\n/**\n * Stores whether directives should be matched to elements.\n *\n * When template contains `ngNonBindable` than we need to prevent the runtime form matching\n * directives on children of that element.\n *\n * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * </div>\n * ```\n */\nlet bindingsEnabled !: boolean;\n\nexport function getBindingsEnabled(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return bindingsEnabled;\n}\n\n\n/**\n * Enables directive matching on elements.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- disabledBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- enableBindings() -->\n * </div>\n * ```\n */\nexport function enableBindings(): void {\n bindingsEnabled = true;\n}\n\n/**\n * Disables directive matching on element.\n *\n * * Example:\n * ```\n * <my-comp my-directive>\n * Should match component / directive.\n * </my-comp>\n * <div ngNonBindable>\n * <!-- disabledBindings() -->\n * <my-comp my-directive>\n * Should not match component / directive because we are in ngNonBindable.\n * </my-comp>\n * <!-- enableBindings() -->\n * </div>\n * ```\n */\nexport function disableBindings(): void {\n bindingsEnabled = false;\n}\n\nexport function getLView(): LView {\n return lView;\n}\n\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n */\nexport function restoreView(viewToRestore: OpaqueViewState) {\n contextLView = viewToRestore as any as LView;\n}\n\n/** Used to set the parent property when nodes are created and track query results. */\nlet previousOrParentTNode: TNode;\n\nexport function getPreviousOrParentTNode(): TNode {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return previousOrParentTNode;\n}\n\nexport function setPreviousOrParentTNode(tNode: TNode) {\n previousOrParentTNode = tNode;\n}\n\nexport function setTNodeAndViewData(tNode: TNode, view: LView) {\n previousOrParentTNode = tNode;\n lView = view;\n}\n\n/**\n * If `isParent` is:\n * - `true`: then `previousOrParentTNode` points to a parent node.\n * - `false`: then `previousOrParentTNode` points to previous node (sibling).\n */\nlet isParent: boolean;\n\nexport function getIsParent(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return isParent;\n}\n\nexport function setIsParent(value: boolean): void {\n isParent = value;\n}\n\n/**\n * Query instructions can ask for \"current queries\" in 2 different cases:\n * - when creating view queries (at the root of a component view, before any node is created - in\n * this case currentQueries points to view queries)\n * - when creating content queries (i.e. this previousOrParentTNode points to a node on which we\n * create content queries).\n */\nexport function getOrCreateCurrentQueries(\n QueryType: {new (parent: null, shallow: null, deep: null): LQueries}): LQueries {\n const lView = getLView();\n let currentQueries = lView[QUERIES];\n // if this is the first content query on a node, any existing LQueries needs to be cloned\n // in subsequent template passes, the cloning occurs before directive instantiation.\n if (previousOrParentTNode && previousOrParentTNode !== lView[HOST_NODE] &&\n !isContentQueryHost(previousOrParentTNode)) {\n currentQueries && (currentQueries = lView[QUERIES] = currentQueries.clone());\n previousOrParentTNode.flags |= TNodeFlags.hasContentQuery;\n }\n\n return currentQueries || (lView[QUERIES] = new QueryType(null, null, null));\n}\n\n/** Checks whether a given view is in creation mode */\nexport function isCreationMode(view: LView = lView): boolean {\n return (view[FLAGS] & LViewFlags.CreationMode) === LViewFlags.CreationMode;\n}\n\n/**\n * State of the current view being processed.\n *\n * An array of nodes (text, element, container, etc), pipes, their bindings, and\n * any local variables that need to be stored between invocations.\n */\nlet lView: LView;\n\n/**\n * The last viewData retrieved by nextContext().\n * Allows building nextContext() and reference() calls.\n *\n * e.g. const inner = x().$implicit; const outer = x().$implicit;\n */\nlet contextLView: LView = null !;\n\nexport function getContextLView(): LView {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return contextLView;\n}\n\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n */\nlet checkNoChangesMode = false;\n\nexport function getCheckNoChangesMode(): boolean {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return checkNoChangesMode;\n}\n\nexport function setCheckNoChangesMode(mode: boolean): void {\n checkNoChangesMode = mode;\n}\n\n/** Whether or not this is the first time the current view has been processed. */\nlet firstTemplatePass = true;\n\nexport function getFirstTemplatePass(): boolean {\n return firstTemplatePass;\n}\n\nexport function setFirstTemplatePass(value: boolean): void {\n firstTemplatePass = value;\n}\n\n/**\n * The root index from which pure function instructions should calculate their binding\n * indices. In component views, this is TView.bindingStartIndex. In a host binding\n * context, this is the TView.expandoStartIndex + any dirs/hostVars before the given dir.\n */\nlet bindingRootIndex: number = -1;\n\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nexport function getBindingRoot() {\n return bindingRootIndex;\n}\n\nexport function setBindingRoot(value: number) {\n bindingRootIndex = value;\n}\n\n/**\n * Swap the current state with a new state.\n *\n * For performance reasons we store the state in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the state for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New state to become active\n * @param host Element to which the View is a child of\n * @returns the previous state;\n */\nexport function enterView(newView: LView, hostTNode: TElementNode | TViewNode | null): LView {\n const oldView = lView;\n if (newView) {\n const tView = newView[TVIEW];\n firstTemplatePass = tView.firstTemplatePass;\n bindingRootIndex = tView.bindingStartIndex;\n }\n\n previousOrParentTNode = hostTNode !;\n isParent = true;\n\n lView = contextLView = newView;\n return oldView;\n}\n\nexport function nextContextImpl<T = any>(level: number = 1): T {\n contextLView = walkUpViews(level, contextLView !);\n return contextLView[CONTEXT] as T;\n}\n\nfunction walkUpViews(nestingLevel: number, currentView: LView): LView {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(\n currentView[DECLARATION_VIEW],\n 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW] !;\n nestingLevel--;\n }\n return currentView;\n}\n\n/**\n * Resets the application state.\n */\nexport function resetComponentState() {\n isParent = false;\n previousOrParentTNode = null !;\n elementDepthCount = 0;\n bindingsEnabled = true;\n}\n\n/**\n * Used in lieu of enterView to make it clear when we are exiting a child view. This makes\n * the direction of traversal (up or down the view tree) a bit clearer.\n *\n * @param newView New state to become active\n */\nexport function leaveView(newView: LView): void {\n const tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~LViewFlags.CreationMode;\n } else {\n executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode);\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(LViewFlags.Dirty | LViewFlags.FirstLViewPass);\n lView[FLAGS] |= LViewFlags.RunInit;\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n enterView(newView, null);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getInjectableDef, getInjectorDef} from '../di/defs';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {InjectFlags, injectRootLimpMode, setInjectImplementation} from '../di/injector_compatibility';\nimport {Type} from '../type';\n\nimport {assertDefined, assertEqual} from './assert';\nimport {getComponentDef, getDirectiveDef, getPipeDef} from './definition';\nimport {NG_ELEMENT_ID} from './fields';\nimport {DirectiveDef} from './interfaces/definition';\nimport {NO_PARENT_INJECTOR, NodeInjectorFactory, PARENT_INJECTOR, RelativeInjectorLocation, RelativeInjectorLocationFlags, TNODE, isFactory} from './interfaces/injector';\nimport {AttributeMarker, TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeProviderIndexes, TNodeType} from './interfaces/node';\nimport {DECLARATION_VIEW, HOST_NODE, INJECTOR, LView, TData, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes} from './node_assert';\nimport {getLView, getPreviousOrParentTNode, setTNodeAndViewData} from './state';\nimport {findComponentView, getParentInjectorIndex, getParentInjectorView, hasParentInjector, isComponent, isComponentDef, stringify} from './util';\n\n\n/**\n * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nlet includeViewProviders = true;\n\nfunction setIncludeViewProviders(v: boolean): boolean {\n const oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nconst BLOOM_SIZE = 256;\nconst BLOOM_MASK = BLOOM_SIZE - 1;\n\n/** Counter used to generate unique IDs for directives. */\nlet nextNgElementId = 0;\n\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nexport function bloomAdd(\n injectorIndex: number, tView: TView, type: Type<any>| InjectionToken<any>| string): void {\n ngDevMode && assertEqual(tView.firstTemplatePass, true, 'expected firstTemplatePass to be true');\n let id: number|undefined =\n typeof type !== 'string' ? (type as any)[NG_ELEMENT_ID] : type.charCodeAt(0) || 0;\n\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = (type as any)[NG_ELEMENT_ID] = nextNgElementId++;\n }\n\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n const bloomBit = id & BLOOM_MASK;\n\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomBit;\n\n // Use the raw bloomBit number to determine which bloom filter bucket we should check\n // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc\n const b7 = bloomBit & 0x80;\n const b6 = bloomBit & 0x40;\n const b5 = bloomBit & 0x20;\n const tData = tView.data as number[];\n\n if (b7) {\n b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :\n (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));\n } else {\n b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) :\n (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask));\n }\n}\n\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param hostView View where the node is stored\n * @returns Node injector\n */\nexport function getOrCreateNodeInjectorForNode(\n tNode: TElementNode | TContainerNode | TElementContainerNode, hostView: LView): number {\n const existingInjectorIndex = getInjectorIndex(tNode, hostView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n\n const tView = hostView[TVIEW];\n if (tView.firstTemplatePass) {\n tNode.injectorIndex = hostView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(hostView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n\n ngDevMode && assertEqual(\n tNode.flags === 0 || tNode.flags === TNodeFlags.isComponent, true,\n 'expected tNode.flags to not be initialized');\n }\n\n const parentLoc = getParentInjectorLocation(tNode, hostView);\n const parentIndex = getParentInjectorIndex(parentLoc);\n const parentLView = getParentInjectorView(parentLoc, hostView);\n\n const injectorIndex = tNode.injectorIndex;\n\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n const parentData = parentLView[TVIEW].data as any;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (let i = 0; i < 8; i++) {\n hostView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n\n hostView[injectorIndex + PARENT_INJECTOR] = parentLoc;\n return injectorIndex;\n}\n\nfunction insertBloom(arr: any[], footer: TNode | null): void {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\n\n\nexport function getInjectorIndex(tNode: TNode, hostView: LView): number {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n hostView[tNode.injectorIndex + PARENT_INJECTOR] == null) {\n return -1;\n } else {\n return tNode.injectorIndex;\n }\n}\n\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata`\n */\nexport function getParentInjectorLocation(tNode: TNode, view: LView): RelativeInjectorLocation {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n return tNode.parent.injectorIndex as any; // ViewOffset is 0\n }\n\n // For most cases, the parent injector index can be found on the host node (e.g. for component\n // or container), so this loop will be skipped, but we must keep the loop here to support\n // the rarer case of deeply nested <ng-template> tags or inline views.\n let hostTNode = view[HOST_NODE];\n let viewOffset = 1;\n while (hostTNode && hostTNode.injectorIndex === -1) {\n view = view[DECLARATION_VIEW] !;\n hostTNode = view ? view[HOST_NODE] : null;\n viewOffset++;\n }\n\n return hostTNode ?\n hostTNode.injectorIndex | (viewOffset << RelativeInjectorLocationFlags.ViewOffsetShift) :\n -1 as any;\n}\n\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nexport function diPublicInInjector(\n injectorIndex: number, view: LView, token: InjectionToken<any>| Type<any>): void {\n bloomAdd(injectorIndex, view[TVIEW], token);\n}\n\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * <my-component title=\"Hello\"></my-component>\n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ngComponentDef = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nexport function injectAttributeImpl(tNode: TNode, attrNameToInject: string): string|null {\n ngDevMode && assertNodeOfPossibleTypes(\n tNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n const attrs = tNode.attrs;\n if (attrs) {\n for (let i = 0; i < attrs.length; i = i + 2) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName == attrNameToInject) {\n return attrs[i + 1] as string;\n }\n }\n }\n return null;\n}\n\n\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nexport function getOrCreateInjectable<T>(\n tNode: TElementNode | TContainerNode | TElementContainerNode | null, lView: LView,\n token: Type<T>| InjectionToken<T>, flags: InjectFlags = InjectFlags.Default,\n notFoundValue?: any): T|null {\n if (tNode) {\n const bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n const savePreviousOrParentTNode = getPreviousOrParentTNode();\n const saveLView = getLView();\n setTNodeAndViewData(tNode, lView);\n try {\n const value = bloomHash();\n if (value == null && !(flags & InjectFlags.Optional)) {\n throw new Error(`No provider for ${stringify(token)}!`);\n } else {\n return value;\n }\n } finally {\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n } else if (typeof bloomHash == 'number') {\n // If the token has a bloom hash, then it is a token which could be in NodeInjector.\n\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n let previousTView: TView|null = null;\n let injectorIndex = getInjectorIndex(tNode, lView);\n let parentLocation: RelativeInjectorLocation = NO_PARENT_INJECTOR;\n let hostTElementNode: TNode|null =\n flags & InjectFlags.Host ? findComponentView(lView)[HOST_NODE] : null;\n\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching\n // the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :\n lView[injectorIndex + PARENT_INJECTOR];\n\n if (!shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n } else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n parentLocation = lView[injectorIndex + PARENT_INJECTOR];\n\n // Check the current injector. If it matches, see if it contains token.\n const tView = lView[TVIEW];\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n const instance: T|null = searchTokensOnInjector<T>(\n injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n if (shouldSearchParent(\n flags, lView[TVIEW].data[injectorIndex + TNODE] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n } else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n }\n\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n const moduleInjector = lView[INJECTOR];\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n } else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n }\n if (flags & InjectFlags.Optional) {\n return notFoundValue;\n } else {\n throw new Error(`NodeInjector: NOT_FOUND [${stringify(token)}]`);\n }\n}\n\nconst NOT_FOUND = {};\n\nfunction searchTokensOnInjector<T>(\n injectorIndex: number, lView: LView, token: Type<T>| InjectionToken<T>,\n previousTView: TView | null, flags: InjectFlags, hostTElementNode: TNode | null) {\n const currentTView = lView[TVIEW];\n const tNode = currentTView.data[injectorIndex + TNODE] as TNode;\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibities\n const canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n (isComponent(tNode) && includeViewProviders) :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n (previousTView != currentTView && (tNode.type === TNodeType.Element));\n\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n const isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;\n\n const injectableIdx =\n locateDirectiveOrProvider(tNode, lView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(currentTView.data, lView, injectableIdx, tNode as TElementNode);\n } else {\n return NOT_FOUND;\n }\n}\n\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param lView The view we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nexport function locateDirectiveOrProvider<T>(\n tNode: TNode, lView: LView, token: Type<T>| InjectionToken<T>, canAccessViewProviders: boolean,\n isHostSpecialCase: boolean | number): number|null {\n const tView = lView[TVIEW];\n const nodeProviderIndexes = tNode.providerIndexes;\n const tInjectables = tView.data;\n\n const injectablesStart = nodeProviderIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const directivesStart = tNode.directiveStart;\n const directiveEnd = tNode.directiveEnd;\n const cptViewProvidersCount =\n nodeProviderIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n const startingIndex =\n canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (let i = startingIndex; i < endIndex; i++) {\n const providerTokenOrDef = tInjectables[i] as InjectionToken<any>| Type<any>| DirectiveDef<any>;\n if (i < directivesStart && token === providerTokenOrDef ||\n i >= directivesStart && (providerTokenOrDef as DirectiveDef<any>).type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n const dirDef = tInjectables[directivesStart] as DirectiveDef<any>;\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n\n/**\n* Retrieve or instantiate the injectable from the `lData` at particular `index`.\n*\n* This function checks to see if the value has already been instantiated and if so returns the\n* cached `injectable`. Otherwise if it detects that the value is still a factory it\n* instantiates the `injectable` and caches the value.\n*/\nexport function getNodeInjectable(\n tData: TData, lData: LView, index: number, tNode: TElementNode): any {\n let value = lData[index];\n if (isFactory(value)) {\n const factory: NodeInjectorFactory = value;\n if (factory.resolving) {\n throw new Error(`Circular dep for ${stringify(tData[index])}`);\n }\n const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n let previousInjectImplementation;\n if (factory.injectImpl) {\n previousInjectImplementation = setInjectImplementation(factory.injectImpl);\n }\n const savePreviousOrParentTNode = getPreviousOrParentTNode();\n const saveLView = getLView();\n setTNodeAndViewData(tNode, lData);\n try {\n value = lData[index] = factory.factory(null, tData, lData, tNode);\n } finally {\n if (factory.injectImpl) setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n }\n return value;\n}\n\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n */\nexport function bloomHashBitOrFactory(token: Type<any>| InjectionToken<any>| string): number|\n Function|undefined {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n const tokenId: number|undefined = (token as any)[NG_ELEMENT_ID];\n return typeof tokenId === 'number' ? tokenId & BLOOM_MASK : tokenId;\n}\n\nexport function bloomHasToken(\n bloomHash: number, injectorIndex: number, injectorView: LView | TData) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n const mask = 1 << bloomHash;\n const b7 = bloomHash & 0x80;\n const b6 = bloomHash & 0x40;\n const b5 = bloomHash & 0x20;\n\n // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:\n // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.\n // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.\n let value: number;\n\n if (b7) {\n value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) :\n (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]);\n } else {\n value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) :\n (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]);\n }\n\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags: InjectFlags, isFirstHostTNode: boolean): boolean|number {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\n\nexport function injectInjector() {\n const tNode = getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode;\n return new NodeInjector(tNode, getLView());\n}\n\nexport class NodeInjector implements Injector {\n constructor(\n private _tNode: TElementNode|TContainerNode|TElementContainerNode|null,\n private _lView: LView) {}\n\n get(token: any, notFoundValue?: any): any {\n return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);\n }\n}\n\nexport function getFactoryOf<T>(type: Type<any>): ((type: Type<T>| null) => T)|null {\n const typeAny = type as any;\n const def = getComponentDef<T>(typeAny) || getDirectiveDef<T>(typeAny) ||\n getPipeDef<T>(typeAny) || getInjectableDef<T>(typeAny) || getInjectorDef<T>(typeAny);\n if (!def || def.factory === undefined) {\n return null;\n }\n return def.factory;\n}\n\nexport function getInheritedFactory<T>(type: Type<any>): (type: Type<T>) => T {\n const proto = Object.getPrototypeOf(type.prototype).constructor as Type<any>;\n const factory = getFactoryOf<T>(proto);\n if (factory !== null) {\n return factory;\n } else {\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return (t) => new t();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport './ng_dev_mode';\nimport {assertDomNode} from './assert';\nimport {EMPTY_ARRAY} from './empty';\nimport {LContext, MONKEY_PATCH_KEY_NAME} from './interfaces/context';\nimport {TNode, TNodeFlags} from './interfaces/node';\nimport {RElement} from './interfaces/renderer';\nimport {CONTEXT, HEADER_OFFSET, HOST, LView, TVIEW} from './interfaces/view';\nimport {getComponentViewByIndex, getNativeByTNode, readElementValue, readPatchedData} from './util';\n\n\n\n/** Returns the matching `LContext` data for a given DOM node, directive or component instance.\n *\n * This function will examine the provided DOM element, component, or directive instance\\'s\n * monkey-patched property to derive the `LContext` data. Once called then the monkey-patched\n * value will be that of the newly created `LContext`.\n *\n * If the monkey-patched value is the `LView` instance then the context value for that\n * target will be created and the monkey-patch reference will be updated. Therefore when this\n * function is called it may mutate the provided element\\'s, component\\'s or any of the associated\n * directive\\'s monkey-patch values.\n *\n * If the monkey-patch value is not detected then the code will walk up the DOM until an element\n * is found which contains a monkey-patch reference. When that occurs then the provided element\n * will be updated with a new context (which is then returned). If the monkey-patch value is not\n * detected for a component/directive instance then it will throw an error (all components and\n * directives should be automatically monkey-patched by ivy).\n *\n * @param target Component, Directive or DOM Node.\n */\nexport function getLContext(target: any): LContext|null {\n let mpValue = readPatchedData(target);\n if (mpValue) {\n // only when it's an array is it considered an LView instance\n // ... otherwise it's an already constructed LContext instance\n if (Array.isArray(mpValue)) {\n const lView: LView = mpValue !;\n let nodeIndex: number;\n let component: any = undefined;\n let directives: any[]|null|undefined = undefined;\n\n if (isComponentInstance(target)) {\n nodeIndex = findViaComponent(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided component was not found in the application');\n }\n component = target;\n } else if (isDirectiveInstance(target)) {\n nodeIndex = findViaDirective(lView, target);\n if (nodeIndex == -1) {\n throw new Error('The provided directive was not found in the application');\n }\n directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);\n } else {\n nodeIndex = findViaNativeElement(lView, target as RElement);\n if (nodeIndex == -1) {\n return null;\n }\n }\n\n // the goal is not to fill the entire context full of data because the lookups\n // are expensive. Instead, only the target data (the element, component, container, ICU\n // expression or directive details) are filled into the context. If called multiple times\n // with different target values then the missing target data will be filled in.\n const native = readElementValue(lView[nodeIndex]);\n const existingCtx = readPatchedData(native);\n const context: LContext = (existingCtx && !Array.isArray(existingCtx)) ?\n existingCtx :\n createLContext(lView, nodeIndex, native);\n\n // only when the component has been discovered then update the monkey-patch\n if (component && context.component === undefined) {\n context.component = component;\n attachPatchData(context.component, context);\n }\n\n // only when the directives have been discovered then update the monkey-patch\n if (directives && context.directives === undefined) {\n context.directives = directives;\n for (let i = 0; i < directives.length; i++) {\n attachPatchData(directives[i], context);\n }\n }\n\n attachPatchData(context.native, context);\n mpValue = context;\n }\n } else {\n const rElement = target as RElement;\n ngDevMode && assertDomNode(rElement);\n\n // if the context is not found then we need to traverse upwards up the DOM\n // to find the nearest element that has already been monkey patched with data\n let parent = rElement as any;\n while (parent = parent.parentNode) {\n const parentContext = readPatchedData(parent);\n if (parentContext) {\n let lView: LView|null;\n if (Array.isArray(parentContext)) {\n lView = parentContext as LView;\n } else {\n lView = parentContext.lView;\n }\n\n // the edge of the app was also reached here through another means\n // (maybe because the DOM was changed manually).\n if (!lView) {\n return null;\n }\n\n const index = findViaNativeElement(lView, rElement);\n if (index >= 0) {\n const native = readElementValue(lView[index]);\n const context = createLContext(lView, index, native);\n attachPatchData(native, context);\n mpValue = context;\n break;\n }\n }\n }\n }\n return (mpValue as LContext) || null;\n}\n\n/**\n * Creates an empty instance of a `LContext` context\n */\nfunction createLContext(lView: LView, nodeIndex: number, native: RElement): LContext {\n return {\n lView,\n nodeIndex,\n native,\n component: undefined,\n directives: undefined,\n localRefs: undefined,\n };\n}\n\n/**\n * Takes a component instance and returns the view for that component.\n *\n * @param componentInstance\n * @returns The component's view\n */\nexport function getComponentViewByInstance(componentInstance: {}): LView {\n let lView = readPatchedData(componentInstance);\n let view: LView;\n\n if (Array.isArray(lView)) {\n const nodeIndex = findViaComponent(lView, componentInstance);\n view = getComponentViewByIndex(nodeIndex, lView);\n const context = createLContext(lView, nodeIndex, view[HOST] as RElement);\n context.component = componentInstance;\n attachPatchData(componentInstance, context);\n attachPatchData(context.native, context);\n } else {\n const context = lView as any as LContext;\n view = getComponentViewByIndex(context.nodeIndex, context.lView);\n }\n return view;\n}\n\n/**\n * Assigns the given data to the given target (which could be a component,\n * directive or DOM node instance) using monkey-patching.\n */\nexport function attachPatchData(target: any, data: LView | LContext) {\n target[MONKEY_PATCH_KEY_NAME] = data;\n}\n\nexport function isComponentInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ngComponentDef;\n}\n\nexport function isDirectiveInstance(instance: any): boolean {\n return instance && instance.constructor && instance.constructor.ngDirectiveDef;\n}\n\n/**\n * Locates the element within the given LView and returns the matching index\n */\nfunction findViaNativeElement(lView: LView, target: RElement): number {\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const native = getNativeByTNode(tNode, lView) !;\n if (native === target) {\n return tNode.index;\n }\n tNode = traverseNextElement(tNode);\n }\n\n return -1;\n}\n\n/**\n * Locates the next tNode (child, sibling or parent).\n */\nfunction traverseNextElement(tNode: TNode): TNode|null {\n if (tNode.child) {\n return tNode.child;\n } else if (tNode.next) {\n return tNode.next;\n } else {\n // Let's take the following template: <div><span>text</span></div><component/>\n // After checking the text node, we need to find the next parent that has a \"next\" TNode,\n // in this case the parent `div`, so that we can find the component.\n while (tNode.parent && !tNode.parent.next) {\n tNode = tNode.parent;\n }\n return tNode.parent && tNode.parent.next;\n }\n}\n\n/**\n * Locates the component within the given LView and returns the matching index\n */\nfunction findViaComponent(lView: LView, componentInstance: {}): number {\n const componentIndices = lView[TVIEW].components;\n if (componentIndices) {\n for (let i = 0; i < componentIndices.length; i++) {\n const elementComponentIndex = componentIndices[i];\n const componentView = getComponentViewByIndex(elementComponentIndex, lView);\n if (componentView[CONTEXT] === componentInstance) {\n return elementComponentIndex;\n }\n }\n } else {\n const rootComponentView = getComponentViewByIndex(HEADER_OFFSET, lView);\n const rootComponent = rootComponentView[CONTEXT];\n if (rootComponent === componentInstance) {\n // we are dealing with the root element here therefore we know that the\n // element is the very first element after the HEADER data in the lView\n return HEADER_OFFSET;\n }\n }\n return -1;\n}\n\n/**\n * Locates the directive within the given LView and returns the matching index\n */\nfunction findViaDirective(lView: LView, directiveInstance: {}): number {\n // if a directive is monkey patched then it will (by default)\n // have a reference to the LView of the current view. The\n // element bound to the directive being search lives somewhere\n // in the view data. We loop through the nodes and check their\n // list of directives for the instance.\n let tNode = lView[TVIEW].firstChild;\n while (tNode) {\n const directiveIndexStart = tNode.directiveStart;\n const directiveIndexEnd = tNode.directiveEnd;\n for (let i = directiveIndexStart; i < directiveIndexEnd; i++) {\n if (lView[i] === directiveInstance) {\n return tNode.index;\n }\n }\n tNode = traverseNextElement(tNode);\n }\n return -1;\n}\n\n/**\n * Returns a list of directives extracted from the given view based on the\n * provided list of directive index values.\n *\n * @param nodeIndex The node index\n * @param lView The target view data\n * @param includeComponents Whether or not to include components in returned directives\n */\nexport function getDirectivesAtNodeIndex(\n nodeIndex: number, lView: LView, includeComponents: boolean): any[]|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n let directiveStartIndex = tNode.directiveStart;\n if (directiveStartIndex == 0) return EMPTY_ARRAY;\n const directiveEndIndex = tNode.directiveEnd;\n if (!includeComponents && tNode.flags & TNodeFlags.isComponent) directiveStartIndex++;\n return lView.slice(directiveStartIndex, directiveEndIndex);\n}\n\nexport function getComponentAtNodeIndex(nodeIndex: number, lView: LView): {}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n let directiveStartIndex = tNode.directiveStart;\n return tNode.flags & TNodeFlags.isComponent ? lView[directiveStartIndex] : null;\n}\n\n/**\n * Returns a map of local references (local reference name => element or directive instance) that\n * exist on a given element.\n */\nexport function discoverLocalRefs(lView: LView, nodeIndex: number): {[key: string]: any}|null {\n const tNode = lView[TVIEW].data[nodeIndex] as TNode;\n if (tNode && tNode.localNames) {\n const result: {[key: string]: any} = {};\n for (let i = 0; i < tNode.localNames.length; i += 2) {\n const localRefName = tNode.localNames[i];\n const directiveIndex = tNode.localNames[i + 1] as number;\n result[localRefName] =\n directiveIndex === -1 ? getNativeByTNode(tNode, lView) ! : lView[directiveIndex];\n }\n return result;\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\n\nimport {assertDefined} from './assert';\nimport {discoverLocalRefs, getComponentAtNodeIndex, getDirectivesAtNodeIndex, getLContext} from './context_discovery';\nimport {NodeInjector} from './di';\nimport {LContext} from './interfaces/context';\nimport {DirectiveDef} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeProviderIndexes} from './interfaces/node';\nimport {CLEANUP, CONTEXT, FLAGS, HOST, LView, LViewFlags, PARENT, RootContext, TVIEW} from './interfaces/view';\nimport {readElementValue, readPatchedLView, stringify} from './util';\n\n\n\n/**\n * Returns the component instance associated with a given DOM host element.\n * Elements which don't represent components return `null`.\n *\n * @param element Host DOM element from which the component should be retrieved.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getComponent(<child-comp>) instanceof ChildComponent).toBeTruthy();\n * expect(getComponent(<my-app>) instanceof MyApp).toBeTruthy();\n * ```\n *\n * @publicApi\n */\nexport function getComponent<T = {}>(element: Element): T|null {\n const context = loadLContextFromNode(element);\n\n if (context.component === undefined) {\n context.component = getComponentAtNodeIndex(context.nodeIndex, context.lView);\n }\n\n return context.component as T;\n}\n\n/**\n * Returns the component instance associated with a given DOM host element.\n * Elements which don't represent components return `null`.\n *\n * @param element Host DOM element from which the component should be retrieved.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getComponent(<child-comp>) instanceof ChildComponent).toBeTruthy();\n * expect(getComponent(<my-app>) instanceof MyApp).toBeTruthy();\n * ```\n *\n * @publicApi\n */\nexport function getContext<T = {}>(element: Element): T|null {\n const context = loadLContextFromNode(element) !;\n return context.lView[CONTEXT] as T;\n}\n\n/**\n * Returns the component instance associated with view which owns the DOM element (`null`\n * otherwise).\n *\n * @param element DOM element which is owned by an existing component's view.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div>\n * <child-comp></child-comp>\n * </div>\n * </mp-app>\n *\n * expect(getViewComponent(<child-comp>) instanceof MyApp).toBeTruthy();\n * expect(getViewComponent(<my-app>)).toEqual(null);\n * ```\n *\n * @publicApi\n */\nexport function getViewComponent<T = {}>(element: Element | {}): T|null {\n const context = loadLContext(element) !;\n let lView: LView = context.lView;\n while (lView[PARENT] && lView[HOST] === null) {\n // As long as lView[HOST] is null we know we are part of sub-template such as `*ngIf`\n lView = lView[PARENT] !;\n }\n\n return lView[FLAGS] & LViewFlags.IsRoot ? null : lView[CONTEXT] as T;\n}\n\n\n\n/**\n * Returns the `RootContext` instance that is associated with\n * the application where the target is situated.\n *\n */\nexport function getRootContext(target: LView | {}): RootContext {\n const lViewData = Array.isArray(target) ? target : loadLContext(target) !.lView;\n const rootLView = getRootView(lViewData);\n return rootLView[CONTEXT] as RootContext;\n}\n\n/**\n * Retrieve all root components.\n *\n * Root components are those which have been bootstrapped by Angular.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getRootComponents(target: {}): any[] {\n return [...getRootContext(target).components];\n}\n\n/**\n * Retrieves an `Injector` associated with the element, component or directive.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getInjector(target: {}): Injector {\n const context = loadLContext(target);\n const tNode = context.lView[TVIEW].data[context.nodeIndex] as TElementNode;\n return new NodeInjector(tNode, context.lView);\n}\n\n/**\n * Retrieve a set of injection tokens at a given DOM node.\n *\n * @param element Element for which the injection tokens should be retrieved.\n * @publicApi\n */\nexport function getInjectionTokens(element: Element): any[] {\n const context = loadLContext(element, false);\n if (!context) return [];\n const lView = context.lView;\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex] as TNode;\n const providerTokens: any[] = [];\n const startIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveEnd;\n for (let i = startIndex; i < endIndex; i++) {\n let value = tView.data[i];\n if (isDirectiveDefHack(value)) {\n // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a\n // design flaw. We should always store same type so that we can be monomorphic. The issue\n // is that for Components/Directives we store the def instead the type. The correct behavior\n // is that we should always be storing injectable type in this location.\n value = value.type;\n }\n providerTokens.push(value);\n }\n return providerTokens;\n}\n\n/**\n * Retrieves directives associated with a given DOM host element.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getDirectives(target: {}): Array<{}> {\n const context = loadLContext(target) !;\n\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n\n return context.directives || [];\n}\n\n/**\n * Returns LContext associated with a target passed as an argument.\n * Throws if a given target doesn't have associated LContext.\n *\n */\nexport function loadLContext(target: {}): LContext;\nexport function loadLContext(target: {}, throwOnNotFound: false): LContext|null;\nexport function loadLContext(target: {}, throwOnNotFound: boolean = true): LContext|null {\n const context = getLContext(target);\n if (!context && throwOnNotFound) {\n throw new Error(\n ngDevMode ? `Unable to find context associated with ${stringify(target)}` :\n 'Invalid ng target');\n }\n return context;\n}\n\n/**\n * Retrieve the root view from any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrView any component or view\n *\n */\nexport function getRootView(componentOrView: LView | {}): LView {\n let lView: LView;\n if (Array.isArray(componentOrView)) {\n ngDevMode && assertDefined(componentOrView, 'lView');\n lView = componentOrView as LView;\n } else {\n ngDevMode && assertDefined(componentOrView, 'component');\n lView = readPatchedLView(componentOrView) !;\n }\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView = lView[PARENT] !;\n }\n return lView;\n}\n\n/**\n * Retrieve map of local references.\n *\n * The references are retrieved as a map of local reference name to element or directive instance.\n *\n * @param target A DOM element, component or directive instance.\n *\n * @publicApi\n */\nexport function getLocalRefs(target: {}): {[key: string]: any} {\n const context = loadLContext(target) !;\n\n if (context.localRefs === undefined) {\n context.localRefs = discoverLocalRefs(context.lView, context.nodeIndex);\n }\n\n return context.localRefs || {};\n}\n\n/**\n * Retrieve the host element of the component.\n *\n * Use this function to retrieve the host element of the component. The host\n * element is the element which the component is associated with.\n *\n * @param directive Component or Directive for which the host element should be retrieved.\n *\n * @publicApi\n */\nexport function getHostElement<T>(directive: T): Element {\n return getLContext(directive) !.native as never as Element;\n}\n\n/**\n * Retrieves the rendered text for a given component.\n *\n * This function retrieves the host element of a component and\n * and then returns the `textContent` for that element. This implies\n * that the text returned will include re-projected content of\n * the component as well.\n *\n * @param component The component to return the content text for.\n */\nexport function getRenderedText(component: any): string {\n const hostElement = getHostElement(component);\n return hostElement.textContent || '';\n}\n\nexport function loadLContextFromNode(node: Node): LContext {\n if (!(node instanceof Node)) throw new Error('Expecting instance of DOM Node');\n return loadLContext(node) !;\n}\n\nexport interface Listener {\n name: string;\n element: Element;\n callback: (value: any) => any;\n useCapture: boolean|null;\n}\n\nexport function isBrowserEvents(listener: Listener): boolean {\n // Browser events are those which don't have `useCapture` as boolean.\n return typeof listener.useCapture === 'boolean';\n}\n\n\n/**\n * Retrieves a list of DOM listeners.\n *\n * ```\n * <my-app>\n * #VIEW\n * <div (click)=\"doSomething()\">\n * </div>\n * </mp-app>\n *\n * expect(getListeners(<div>)).toEqual({\n * name: 'click',\n * element: <div>,\n * callback: () => doSomething(),\n * useCapture: false\n * });\n * ```\n *\n * @param element Element for which the DOM listeners should be retrieved.\n * @publicApi\n */\nexport function getListeners(element: Element): Listener[] {\n const lContext = loadLContextFromNode(element);\n const lView = lContext.lView;\n const tView = lView[TVIEW];\n const lCleanup = lView[CLEANUP];\n const tCleanup = tView.cleanup;\n const listeners: Listener[] = [];\n if (tCleanup && lCleanup) {\n for (let i = 0; i < tCleanup.length;) {\n const firstParam = tCleanup[i++];\n const secondParam = tCleanup[i++];\n if (typeof firstParam === 'string') {\n const name: string = firstParam;\n const listenerElement = readElementValue(lView[secondParam]) as any as Element;\n const callback: (value: any) => any = lCleanup[tCleanup[i++]];\n const useCaptureOrIndx = tCleanup[i++];\n // if useCaptureOrIndx is boolean then report it as is.\n // if useCaptureOrIndx is positive number then it in unsubscribe method\n // if useCaptureOrIndx is negative number then it is a Subscription\n const useCapture = typeof useCaptureOrIndx === 'boolean' ?\n useCaptureOrIndx :\n (useCaptureOrIndx >= 0 ? false : null);\n if (element == listenerElement) {\n listeners.push({element, name, callback, useCapture});\n }\n }\n }\n }\n listeners.sort(sortListeners);\n return listeners;\n}\n\nfunction sortListeners(a: Listener, b: Listener) {\n if (a.name == b.name) return 0;\n return a.name < b.name ? -1 : 1;\n}\n\n/**\n * This function should not exist because it is megamorphic and only mostly correct.\n *\n * See call site for more info.\n */\nfunction isDirectiveDefHack(obj: any): obj is DirectiveDef<any> {\n return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function normalizeDebugBindingName(name: string) {\n // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers\n name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));\n return `ng-reflect-${name}`;\n}\n\nconst CAMEL_CASE_REGEXP = /([A-Z])/g;\n\nfunction camelCaseToDashCase(input: string): string {\n return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());\n}\n\nexport function normalizeDebugBindingValue(value: any): string {\n try {\n // Limit the size of the value as otherwise the DOM just gets polluted.\n return value != null ? value.toString().slice(0, 30) : value;\n } catch (e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {getSymbolIterator, looseIdentical} from '../util';\n\nexport function devModeEqual(a: any, b: any): boolean {\n const isListLikeIterableA = isListLikeIterable(a);\n const isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const isBObject = b && (typeof b === 'object' || typeof b === 'function');\n if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {\n return true;\n } else {\n return looseIdentical(a, b);\n }\n }\n}\n\n/**\n * Indicates that the result of a {@link Pipe} transformation has changed even though the\n * reference has not changed.\n *\n * Wrapped values are unwrapped automatically during the change detection, and the unwrapped value\n * is stored.\n *\n * Example:\n *\n * ```\n * if (this._latestValue === this._latestReturnedValue) {\n * return this._latestReturnedValue;\n * } else {\n * this._latestReturnedValue = this._latestValue;\n * return WrappedValue.wrap(this._latestValue); // this will force update\n * }\n * ```\n *\n * @publicApi\n */\nexport class WrappedValue {\n /** @deprecated from 5.3, use `unwrap()` instead - will switch to protected */\n wrapped: any;\n\n constructor(value: any) { this.wrapped = value; }\n\n /** Creates a wrapped value. */\n static wrap(value: any): WrappedValue { return new WrappedValue(value); }\n\n /**\n * Returns the underlying value of a wrapped value.\n * Returns the given `value` when it is not wrapped.\n **/\n static unwrap(value: any): any { return WrappedValue.isWrapped(value) ? value.wrapped : value; }\n\n /** Returns true if `value` is a wrapped value. */\n static isWrapped(value: any): value is WrappedValue { return value instanceof WrappedValue; }\n}\n\n/**\n * Represents a basic change from a previous to a new value.\n *\n * @publicApi\n */\nexport class SimpleChange {\n constructor(public previousValue: any, public currentValue: any, public firstChange: boolean) {}\n\n /**\n * Check whether the new value is the first value assigned.\n */\n isFirstChange(): boolean { return this.firstChange; }\n}\n\nexport function isListLikeIterable(obj: any): boolean {\n if (!isJsObject(obj)) return false;\n return Array.isArray(obj) ||\n (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]\n getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop\n}\n\nexport function areIterablesEqual(\n a: any, b: any, comparator: (a: any, b: any) => boolean): boolean {\n const iterator1 = a[getSymbolIterator()]();\n const iterator2 = b[getSymbolIterator()]();\n\n while (true) {\n const item1 = iterator1.next();\n const item2 = iterator2.next();\n if (item1.done && item2.done) return true;\n if (item1.done || item2.done) return false;\n if (!comparator(item1.value, item2.value)) return false;\n }\n}\n\nexport function iterateListLike(obj: any, fn: (p: any) => any) {\n if (Array.isArray(obj)) {\n for (let i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const iterator = obj[getSymbolIterator()]();\n let item: any;\n while (!((item = iterator.next()).done)) {\n fn(item.value);\n }\n }\n}\n\nexport function isJsObject(o: any): boolean {\n return o !== null && (typeof o === 'function' || typeof o === 'object');\n}\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {TNode} from './interfaces/node';\n\n/** Called when directives inject each other (creating a circular dependency) */\nexport function throwCyclicDependencyError(token: any): never {\n throw new Error(`Cannot instantiate cyclic dependency! ${token}`);\n}\n\n/** Called when there are multiple component selectors that match a given node */\nexport function throwMultipleComponentError(tNode: TNode): never {\n throw new Error(`Multiple components match node with tagname ${tNode.tagName}`);\n}\n\n/** Throws an ExpressionChangedAfterChecked error if checkNoChanges mode is on. */\nexport function throwErrorIfNoChangesMode(\n creationMode: boolean, oldValue: any, currValue: any): never|void {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (creationMode) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n // TODO: include debug context\n throw new Error(msg);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport interface NO_CHANGE {\n // This is a brand that ensures that this type can never match anything else\n brand: 'NO_CHANGE';\n}\n\n/** A special value which designates that a value has not changed. */\nexport const NO_CHANGE = {} as NO_CHANGE;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {devModeEqual} from '../change_detection/change_detection_util';\n\nimport {assertDataInRange, assertLessThan, assertNotEqual} from './assert';\nimport {throwErrorIfNoChangesMode} from './errors';\nimport {BINDING_INDEX, LView} from './interfaces/view';\nimport {getCheckNoChangesMode, isCreationMode} from './state';\nimport {NO_CHANGE} from './tokens';\nimport {isDifferent} from './util';\n\n\n\n// TODO(misko): consider inlining\n/** Updates binding and returns the value. */\nexport function updateBinding(lView: LView, bindingIndex: number, value: any): any {\n return lView[bindingIndex] = value;\n}\n\n\n/** Gets the current binding value. */\nexport function getBinding(lView: LView, bindingIndex: number): any {\n ngDevMode && assertDataInRange(lView, lView[bindingIndex]);\n ngDevMode &&\n assertNotEqual(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');\n return lView[bindingIndex];\n}\n\n/** Updates binding if changed, then returns whether it was updated. */\nexport function bindingUpdated(lView: LView, bindingIndex: number, value: any): boolean {\n ngDevMode && assertNotEqual(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');\n ngDevMode &&\n assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);\n\n if (lView[bindingIndex] === NO_CHANGE) {\n // initial pass\n lView[bindingIndex] = value;\n } else if (isDifferent(lView[bindingIndex], value)) {\n if (ngDevMode && getCheckNoChangesMode()) {\n if (!devModeEqual(lView[bindingIndex], value)) {\n throwErrorIfNoChangesMode(isCreationMode(lView), lView[bindingIndex], value);\n }\n }\n lView[bindingIndex] = value;\n } else {\n return false;\n }\n return true;\n}\n\n/** Updates 2 bindings if changed, then returns whether either was updated. */\nexport function bindingUpdated2(lView: LView, bindingIndex: number, exp1: any, exp2: any): boolean {\n const different = bindingUpdated(lView, bindingIndex, exp1);\n return bindingUpdated(lView, bindingIndex + 1, exp2) || different;\n}\n\n/** Updates 3 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated3(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated(lView, bindingIndex + 2, exp3) || different;\n}\n\n/** Updates 4 bindings if changed, then returns whether any was updated. */\nexport function bindingUpdated4(\n lView: LView, bindingIndex: number, exp1: any, exp2: any, exp3: any, exp4: any): boolean {\n const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);\n return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;\n}\n","\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\n/**\n * Expresses a single CSS Selector.\n *\n * Beginning of array\n * - First index: element name\n * - Subsequent odd indices: attr keys\n * - Subsequent even indices: attr values\n *\n * After SelectorFlags.CLASS flag\n * - Class name values\n *\n * SelectorFlags.NOT flag\n * - Changes the mode to NOT\n * - Can be combined with other flags to set the element / attr / class mode\n *\n * e.g. SelectorFlags.NOT | SelectorFlags.ELEMENT\n *\n * Example:\n * Original: `div.foo.bar[attr1=val1][attr2]`\n * Parsed: ['div', 'attr1', 'val1', 'attr2', '', SelectorFlags.CLASS, 'foo', 'bar']\n *\n * Original: 'div[attr1]:not(.foo[attr2])\n * Parsed: [\n * 'div', 'attr1', '',\n * SelectorFlags.NOT | SelectorFlags.ATTRIBUTE 'attr2', '', SelectorFlags.CLASS, 'foo'\n * ]\n *\n * See more examples in node_selector_matcher_spec.ts\n */\nexport type CssSelector = (string | SelectorFlags)[];\n\n/**\n * A list of CssSelectors.\n *\n * A directive or component can have multiple selectors. This type is used for\n * directive defs so any of the selectors in the list will match that directive.\n *\n * Original: 'form, [ngForm]'\n * Parsed: [['form'], ['', 'ngForm', '']]\n */\nexport type CssSelectorList = CssSelector[];\n\n/** Flags used to build up CssSelectors */\nexport const enum SelectorFlags {\n /** Indicates this is the beginning of a new negative selector */\n NOT = 0b0001,\n\n /** Mode for matching attributes */\n ATTRIBUTE = 0b0010,\n\n /** Mode for matching tag names */\n ELEMENT = 0b0100,\n\n /** Mode for matching class names */\n CLASS = 0b1000,\n}\n\nexport const NG_PROJECT_AS_ATTR_NAME = 'ngProjectAs';\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * The goal here is to make sure that the browser DOM API is the Renderer.\n * We do this by defining a subset of DOM API to be the renderer and than\n * use that time for rendering.\n *\n * At runtime we can than use the DOM api directly, in server or web-worker\n * it will be easy to implement such API.\n */\n\nimport {RendererStyleFlags2, RendererType2} from '../../render/api';\n\n\n// TODO: cleanup once the code is merged in angular/angular\nexport enum RendererStyleFlags3 {\n Important = 1 << 0,\n DashCase = 1 << 1\n}\n\nexport type Renderer3 = ObjectOrientedRenderer3 | ProceduralRenderer3;\n\n/**\n * Object Oriented style of API needed to create elements and text nodes.\n *\n * This is the native browser API style, e.g. operations are methods on individual objects\n * like HTMLElement. With this style, no additional code is needed as a facade\n * (reducing payload size).\n * */\nexport interface ObjectOrientedRenderer3 {\n createComment(data: string): RComment;\n createElement(tagName: string): RElement;\n createElementNS(namespace: string, tagName: string): RElement;\n createTextNode(data: string): RText;\n\n querySelector(selectors: string): RElement|null;\n}\n\n/** Returns whether the `renderer` is a `ProceduralRenderer3` */\nexport function isProceduralRenderer(renderer: ProceduralRenderer3 | ObjectOrientedRenderer3):\n renderer is ProceduralRenderer3 {\n return !!((renderer as any).listen);\n}\n\n/**\n * Procedural style of API needed to create elements and text nodes.\n *\n * In non-native browser environments (e.g. platforms such as web-workers), this is the\n * facade that enables element manipulation. This also facilitates backwards compatibility\n * with Renderer2.\n */\nexport interface ProceduralRenderer3 {\n destroy(): void;\n createComment(value: string): RComment;\n createElement(name: string, namespace?: string|null): RElement;\n createText(value: string): RText;\n /**\n * This property is allowed to be null / undefined,\n * in which case the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n destroyNode?: ((node: RNode) => void)|null;\n appendChild(parent: RElement, newChild: RNode): void;\n insertBefore(parent: RNode, newChild: RNode, refChild: RNode|null): void;\n removeChild(parent: RElement, oldChild: RNode): void;\n selectRootElement(selectorOrNode: string|any): RElement;\n\n parentNode(node: RNode): RElement|null;\n nextSibling(node: RNode): RNode|null;\n\n setAttribute(el: RElement, name: string, value: string, namespace?: string|null): void;\n removeAttribute(el: RElement, name: string, namespace?: string|null): void;\n addClass(el: RElement, name: string): void;\n removeClass(el: RElement, name: string): void;\n setStyle(\n el: RElement, style: string, value: any,\n flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2|RendererStyleFlags3): void;\n setProperty(el: RElement, name: string, value: any): void;\n setValue(node: RText|RComment, value: string): void;\n\n // TODO(misko): Deprecate in favor of addEventListener/removeEventListener\n listen(target: RNode, eventName: string, callback: (event: any) => boolean | void): () => void;\n}\n\nexport interface RendererFactory3 {\n createRenderer(hostElement: RElement|null, rendererType: RendererType2|null): Renderer3;\n begin?(): void;\n end?(): void;\n}\n\nexport const domRendererFactory3: RendererFactory3 = {\n createRenderer: (hostElement: RElement | null, rendererType: RendererType2 | null):\n Renderer3 => { return document;}\n};\n\n/** Subset of API needed for appending elements and text nodes. */\nexport interface RNode {\n parentNode: RNode|null;\n\n nextSibling: RNode|null;\n\n removeChild(oldChild: RNode): void;\n\n /**\n * Insert a child node.\n *\n * Used exclusively for adding View root nodes into ViewAnchor location.\n */\n insertBefore(newChild: RNode, refChild: RNode|null, isViewRoot: boolean): void;\n\n /**\n * Append a child node.\n *\n * Used exclusively for building up DOM which are static (ie not View roots)\n */\n appendChild(newChild: RNode): RNode;\n}\n\n/**\n * Subset of API needed for writing attributes, properties, and setting up\n * listeners on Element.\n */\nexport interface RElement extends RNode {\n style: RCssStyleDeclaration;\n classList: RDomTokenList;\n className: string;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n addEventListener(type: string, listener: EventListener, useCapture?: boolean): void;\n removeEventListener(type: string, listener?: EventListener, options?: boolean): void;\n\n setProperty?(name: string, value: any): void;\n}\n\nexport interface RCssStyleDeclaration {\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string|null, priority?: string): void;\n}\n\nexport interface RDomTokenList {\n add(token: string): void;\n remove(token: string): void;\n}\n\nexport interface RText extends RNode { textContent: string|null; }\n\nexport interface RComment extends RNode { textContent: string|null; }\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {StylingContext} from './styling';\nimport {LView, TView} from './view';\n\n\n/**\n * TNodeType corresponds to the TNode.type property. It contains information\n * on how to map a particular set of bits in TNode.flags to the node type.\n */\nexport const enum TNodeType {\n Container = 0b000,\n Projection = 0b001,\n View = 0b010,\n Element = 0b011,\n ViewOrElement = 0b010,\n ElementContainer = 0b100,\n IcuContainer = 0b101,\n}\n\n/**\n * Corresponds to the TNode.flags property.\n */\nexport const enum TNodeFlags {\n /** This bit is set if the node is a component */\n isComponent = 0b0001,\n\n /** This bit is set if the node has been projected */\n isProjected = 0b0010,\n\n /** This bit is set if the node has any content queries */\n hasContentQuery = 0b0100,\n\n /** This bit is set if the node has any directives that contain [class properties */\n hasClassInput = 0b1000,\n}\n\n/**\n * Corresponds to the TNode.providerIndexes property.\n */\nexport const enum TNodeProviderIndexes {\n /** The index of the first provider on this node is encoded on the least significant bits */\n ProvidersStartIndexMask = 0b00000000000000001111111111111111,\n\n /** The count of view providers from the component on this node is encoded on the 16 most\n significant bits */\n CptViewProvidersCountShift = 16,\n CptViewProvidersCountShifter = 0b00000000000000010000000000000000,\n}\n/**\n * A set of marker values to be used in the attributes arrays. These markers indicate that some\n * items are not regular attributes and the processing should be adapted accordingly.\n */\nexport const enum AttributeMarker {\n /**\n * Marker indicates that the following 3 values in the attributes array are:\n * namespaceUri, attributeName, attributeValue\n * in that order.\n */\n NamespaceURI = 0,\n\n /**\n * Signals class declaration.\n *\n * Each value following `Classes` designates a class name to include on the element.\n * ## Example:\n *\n * Given:\n * ```\n * <div class=\"foo bar baz\">...<d/vi>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Classes, 'foo', 'bar', 'baz'];\n * ```\n */\n Classes = 1,\n\n /**\n * Signals style declaration.\n *\n * Each pair of values following `Styles` designates a style name and value to include on the\n * element.\n * ## Example:\n *\n * Given:\n * ```\n * <div style=\"width:100px; height:200px; color:red\">...</div>\n * ```\n *\n * the generated code is:\n * ```\n * var _c1 = [AttributeMarker.Styles, 'width', '100px', 'height'. '200px', 'color', 'red'];\n * ```\n */\n Styles = 2,\n\n /**\n * This marker indicates that the following attribute names were extracted from bindings (ex.:\n * [foo]=\"exp\") and / or event handlers (ex. (bar)=\"doSth()\").\n * Taking the above bindings and outputs as an example an attributes array could look as follows:\n * ['class', 'fade in', AttributeMarker.SelectOnly, 'foo', 'bar']\n */\n SelectOnly = 3,\n}\n\n/**\n * A combination of:\n * - attribute names and values\n * - special markers acting as flags to alter attributes processing.\n */\nexport type TAttributes = (string | AttributeMarker)[];\n\n/**\n * Binding data (flyweight) for a particular node that is shared between all templates\n * of a specific type.\n *\n * If a property is:\n * - PropertyAliases: that property's data was generated and this is it\n * - Null: that property's data was already generated and nothing was found.\n * - Undefined: that property's data has not yet been generated\n *\n * see: https://en.wikipedia.org/wiki/Flyweight_pattern for more on the Flyweight pattern\n */\nexport interface TNode {\n /** The type of the TNode. See TNodeType. */\n type: TNodeType;\n\n /**\n * Index of the TNode in TView.data and corresponding native element in LView.\n *\n * This is necessary to get from any TNode to its corresponding native element when\n * traversing the node tree.\n *\n * If index is -1, this is a dynamically created container node or embedded view node.\n */\n index: number;\n\n /**\n * The index of the closest injector in this node's LView.\n *\n * If the index === -1, there is no injector on this node or any ancestor node in this view.\n *\n * If the index !== -1, it is the index of this node's injector OR the index of a parent injector\n * in the same view. We pass the parent injector index down the node tree of a view so it's\n * possible to find the parent injector without walking a potentially deep node tree. Injector\n * indices are not set across view boundaries because there could be multiple component hosts.\n *\n * If tNode.injectorIndex === tNode.parent.injectorIndex, then the index belongs to a parent\n * injector.\n */\n injectorIndex: number;\n\n /**\n * Stores starting index of the directives.\n */\n directiveStart: number;\n\n /**\n * Stores final exclusive index of the directives.\n */\n directiveEnd: number;\n\n /**\n * Stores if Node isComponent, isProjected, hasContentQuery and hasClassInput\n */\n flags: TNodeFlags;\n\n /**\n * This number stores two values using its bits:\n *\n * - the index of the first provider on that node (first 16 bits)\n * - the count of view providers from the component on this node (last 16 bits)\n */\n // TODO(misko): break this into actual vars.\n providerIndexes: TNodeProviderIndexes;\n\n /** The tag name associated with this node. */\n tagName: string|null;\n\n /**\n * Attributes associated with an element. We need to store attributes to support various use-cases\n * (attribute injection, content projection with selectors, directives matching).\n * Attributes are stored statically because reading them from the DOM would be way too slow for\n * content projection and queries.\n *\n * Since attrs will always be calculated first, they will never need to be marked undefined by\n * other instructions.\n *\n * For regular attributes a name of an attribute and its value alternate in the array.\n * e.g. ['role', 'checkbox']\n * This array can contain flags that will indicate \"special attributes\" (attributes with\n * namespaces, attributes extracted from bindings and outputs).\n */\n attrs: TAttributes|null;\n\n /**\n * A set of local names under which a given element is exported in a template and\n * visible to queries. An entry in this array can be created for different reasons:\n * - an element itself is referenced, ex.: `<div #foo>`\n * - a component is referenced, ex.: `<my-cmpt #foo>`\n * - a directive is referenced, ex.: `<my-cmpt #foo=\"directiveExportAs\">`.\n *\n * A given element might have different local names and those names can be associated\n * with a directive. We store local names at even indexes while odd indexes are reserved\n * for directive index in a view (or `-1` if there is no associated directive).\n *\n * Some examples:\n * - `<div #foo>` => `[\"foo\", -1]`\n * - `<my-cmpt #foo>` => `[\"foo\", myCmptIdx]`\n * - `<my-cmpt #foo #bar=\"directiveExportAs\">` => `[\"foo\", myCmptIdx, \"bar\", directiveIdx]`\n * - `<div #foo #bar=\"directiveExportAs\">` => `[\"foo\", -1, \"bar\", directiveIdx]`\n */\n localNames: (string|number)[]|null;\n\n /** Information about input properties that need to be set once from attribute data. */\n initialInputs: InitialInputData|null|undefined;\n\n /**\n * Input data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no inputs have been found.\n */\n inputs: PropertyAliases|null|undefined;\n\n /**\n * Output data for all directives on this node.\n *\n * - `undefined` means that the prop has not been initialized yet,\n * - `null` means that the prop has been initialized but no outputs have been found.\n */\n outputs: PropertyAliases|null|undefined;\n\n /**\n * The TView or TViews attached to this node.\n *\n * If this TNode corresponds to an LContainer with inline views, the container will\n * need to store separate static data for each of its view blocks (TView[]). Otherwise,\n * nodes in inline views with the same index as nodes in their parent views will overwrite\n * each other, as they are in the same template.\n *\n * Each index in this array corresponds to the static data for a certain\n * view. So if you had V(0) and V(1) in a container, you might have:\n *\n * [\n * [{tagName: 'div', attrs: ...}, null], // V(0) TView\n * [{tagName: 'button', attrs ...}, null] // V(1) TView\n *\n * If this TNode corresponds to an LContainer with a template (e.g. structural\n * directive), the template's TView will be stored here.\n *\n * If this TNode corresponds to an element, tViews will be null .\n */\n tViews: TView|TView[]|null;\n\n /**\n * The next sibling node. Necessary so we can propagate through the root nodes of a view\n * to insert them or remove them from the DOM.\n */\n next: TNode|null;\n\n /**\n * First child of the current node.\n *\n * For component nodes, the child will always be a ContentChild (in same view).\n * For embedded view nodes, the child will be in their child view.\n */\n child: TNode|null;\n\n /**\n * Parent node (in the same view only).\n *\n * We need a reference to a node's parent so we can append the node to its parent's native\n * element at the appropriate time.\n *\n * If the parent would be in a different view (e.g. component host), this property will be null.\n * It's important that we don't try to cross component boundaries when retrieving the parent\n * because the parent will change (e.g. index, attrs) depending on where the component was\n * used (and thus shouldn't be stored on TNode). In these cases, we retrieve the parent through\n * LView.node instead (which will be instance-specific).\n *\n * If this is an inline view node (V), the parent will be its container.\n */\n parent: TElementNode|TContainerNode|null;\n\n /**\n * If this node is part of an i18n block, it indicates whether this node is part of the DOM.\n * If this node is not part of an i18n block, this field is null.\n */\n detached: boolean|null;\n\n stylingTemplate: StylingContext|null;\n /**\n * List of projected TNodes for a given component host element OR index into the said nodes.\n *\n * For easier discussion assume this example:\n * `<parent>`'s view definition:\n * ```\n * <child id=\"c1\">content1</child>\n * <child id=\"c2\"><span>content2</span></child>\n * ```\n * `<child>`'s view definition:\n * ```\n * <ng-content id=\"cont1\"></ng-content>\n * ```\n *\n * If `Array.isArray(projection)` then `TNode` is a host element:\n * - `projection` stores the content nodes which are to be projected.\n * - The nodes represent categories defined by the selector: For example:\n * `<ng-content/><ng-content select=\"abc\"/>` would represent the heads for `<ng-content/>`\n * and `<ng-content select=\"abc\"/>` respectively.\n * - The nodes we store in `projection` are heads only, we used `.next` to get their\n * siblings.\n * - The nodes `.next` is sorted/rewritten as part of the projection setup.\n * - `projection` size is equal to the number of projections `<ng-content>`. The size of\n * `c1` will be `1` because `<child>` has only one `<ng-content>`.\n * - we store `projection` with the host (`c1`, `c2`) rather than the `<ng-content>` (`cont1`)\n * because the same component (`<child>`) can be used in multiple locations (`c1`, `c2`) and as\n * a result have different set of nodes to project.\n * - without `projection` it would be difficult to efficiently traverse nodes to be projected.\n *\n * If `typeof projection == 'number'` then `TNode` is a `<ng-content>` element:\n * - `projection` is an index of the host's `projection`Nodes.\n * - This would return the first head node to project:\n * `getHost(currentTNode).projection[currentTNode.projection]`.\n * - When projecting nodes the parent node retrieved may be a `<ng-content>` node, in which case\n * the process is recursive in nature (not implementation).\n */\n projection: (TNode|null)[]|number|null;\n}\n\n/** Static data for an element */\nexport interface TElementNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: TElementNode|TTextNode|TElementContainerNode|TContainerNode|TProjectionNode|null;\n /**\n * Element nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using viewData[HOST_NODE]).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n\n /**\n * If this is a component TNode with projection, this will be an array of projected\n * TNodes (see TNode.projection for more info). If it's a regular element node or a\n * component without projection, it will be null.\n */\n projection: (TNode|null)[]|null;\n}\n\n/** Static data for a text node */\nexport interface TTextNode extends TNode {\n /** Index in the data[] array */\n index: number;\n child: null;\n /**\n * Text nodes will have parents unless they are the first node of a component or\n * embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LContainer */\nexport interface TContainerNode extends TNode {\n /**\n * Index in the data[] array.\n *\n * If it's -1, this is a dynamically created container node that isn't stored in\n * data[] (e.g. when you inject ViewContainerRef) .\n */\n index: number;\n child: null;\n\n /**\n * Container nodes will have parents unless:\n *\n * - They are the first node of a component or embedded view\n * - They are dynamically created\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: TView|TView[]|null;\n projection: null;\n}\n\n/** Static data for an <ng-container> */\nexport interface TElementContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode|TTextNode|TContainerNode|TElementContainerNode|TProjectionNode|null;\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an ICU expression */\nexport interface TIcuContainerNode extends TNode {\n /** Index in the LView[] array. */\n index: number;\n child: TElementNode|TTextNode|null;\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n projection: null;\n /**\n * Indicates the current active case for an ICU expression.\n * It is null when there is no active case.\n */\n activeCaseIndex: number|null;\n}\n\n/** Static data for a view */\nexport interface TViewNode extends TNode {\n /** If -1, it's a dynamically created view. Otherwise, it is the view block ID. */\n index: number;\n child: TElementNode|TTextNode|TElementContainerNode|TContainerNode|TProjectionNode|null;\n parent: TContainerNode|null;\n tViews: null;\n projection: null;\n}\n\n/** Static data for an LProjectionNode */\nexport interface TProjectionNode extends TNode {\n /** Index in the data[] array */\n child: null;\n /**\n * Projection nodes will have parents unless they are the first node of a component\n * or embedded view (which means their parent is in a different view and must be\n * retrieved using LView.node).\n */\n parent: TElementNode|TElementContainerNode|null;\n tViews: null;\n\n /** Index of the projection node. (See TNode.projection for more info.) */\n projection: number;\n}\n\n/**\n * This mapping is necessary so we can set input properties and output listeners\n * properly at runtime when property names are minified or aliased.\n *\n * Key: unminified / public input or output name\n * Value: array containing minified / internal name and related directive index\n *\n * The value must be an array to support inputs and outputs with the same name\n * on the same node.\n */\nexport type PropertyAliases = {\n // This uses an object map because using the Map type would be too slow\n [key: string]: PropertyAliasValue\n};\n\n/**\n * Store the runtime input or output names for all the directives.\n *\n * - Even indices: directive index\n * - Odd indices: minified / internal name\n *\n * e.g. [0, 'change-minified']\n */\nexport type PropertyAliasValue = (number | string)[];\n\n\n/**\n * This array contains information about input properties that\n * need to be set once from attribute data. It's ordered by\n * directive index (relative to element) so it's simple to\n * look up a specific directive's initial input data.\n *\n * Within each sub-array:\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * If a directive on a node does not have any input properties\n * that should be set from attributes, its index is set to null\n * to avoid a sparse array.\n *\n * e.g. [null, ['role-min', 'button']]\n */\nexport type InitialInputData = (InitialInputs | null)[];\n\n/**\n * Used by InitialInputData to store input properties\n * that should be set once from attributes.\n *\n * Even indices: minified/internal input name\n * Odd indices: initial value\n *\n * e.g. ['role-min', 'button']\n */\nexport type InitialInputs = string[];\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n\n/**\n * Type representing a set of TNodes that can have local refs (`#foo`) placed on them.\n */\nexport type TNodeWithLocalRefs = TContainerNode | TElementNode | TElementContainerNode;\n\n/**\n * Type for a function that extracts a value for a local refs.\n * Example:\n * - `<div #nativeDivEl>` - `nativeDivEl` should point to the native `<div>` element;\n * - `<ng-template #tplRef>` - `tplRef` should point to the `TemplateRef` instance;\n */\nexport type LocalRefExtractor = (tNode: TNodeWithLocalRefs, currentView: LView) => any;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {assertDefined} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {callHooks} from './hooks';\nimport {LContainer, NATIVE, RENDER_PARENT, VIEWS, unusedValueExportToPlacateAjd as unused1} from './interfaces/container';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeFlags, TNodeType, TViewNode, unusedValueExportToPlacateAjd as unused2} from './interfaces/node';\nimport {unusedValueExportToPlacateAjd as unused3} from './interfaces/projection';\nimport {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, isProceduralRenderer, unusedValueExportToPlacateAjd as unused4} from './interfaces/renderer';\nimport {CLEANUP, CONTAINER_INDEX, FLAGS, HEADER_OFFSET, HOST_NODE, HookData, LView, LViewFlags, NEXT, PARENT, QUERIES, RENDERER, TVIEW, unusedValueExportToPlacateAjd as unused5} from './interfaces/view';\nimport {assertNodeType} from './node_assert';\nimport {findComponentView, getNativeByTNode, isLContainer, isRootView, readElementValue, stringify} from './util';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4 + unused5;\n\n/** Retrieves the parent element of a given node. */\nexport function getParentNative(tNode: TNode, currentView: LView): RElement|RComment|null {\n if (tNode.parent == null) {\n return getHostNative(currentView);\n } else {\n const parentTNode = getFirstParentNative(tNode);\n return getNativeByTNode(parentTNode, currentView);\n }\n}\n\n/**\n * Get the first parent of a node that isn't an IcuContainer TNode\n */\nfunction getFirstParentNative(tNode: TNode): TNode {\n let parent = tNode.parent;\n while (parent && parent.type === TNodeType.IcuContainer) {\n parent = parent.parent;\n }\n return parent !;\n}\n\n/**\n * Gets the host element given a view. Will return null if the current view is an embedded view,\n * which does not have a host element.\n */\nexport function getHostNative(currentView: LView): RElement|null {\n const hostTNode = currentView[HOST_NODE] as TElementNode;\n return hostTNode && hostTNode.type !== TNodeType.View ?\n (getNativeByTNode(hostTNode, currentView[PARENT] !) as RElement) :\n null;\n}\n\nexport function getLContainer(tNode: TViewNode, embeddedView: LView): LContainer|null {\n if (tNode.index === -1) {\n // This is a dynamically created view inside a dynamic container.\n // If the host index is -1, the view has not yet been inserted, so it has no parent.\n const containerHostIndex = embeddedView[CONTAINER_INDEX];\n return containerHostIndex > -1 ? embeddedView[PARENT] ![containerHostIndex] : null;\n } else {\n // This is a inline view node (e.g. embeddedViewStart)\n return embeddedView[PARENT] ![tNode.parent !.index] as LContainer;\n }\n}\n\n\n/**\n * Retrieves render parent for a given view.\n * Might be null if a view is not yet attached to any container.\n */\nexport function getContainerRenderParent(tViewNode: TViewNode, view: LView): RElement|null {\n const container = getLContainer(tViewNode, view);\n return container ? container[RENDER_PARENT] : null;\n}\n\nconst enum WalkTNodeTreeAction {\n /** node insert in the native environment */\n Insert = 0,\n\n /** node detach from the native environment */\n Detach = 1,\n\n /** node destruction using the renderer's API */\n Destroy = 2,\n}\n\n\n/**\n * Stack used to keep track of projection nodes in walkTNodeTree.\n *\n * This is deliberately created outside of walkTNodeTree to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: (LView | TNode)[] = [];\n\n/**\n * Walks a tree of TNodes, applying a transformation on the element nodes, either only on the first\n * one found, or on all of them.\n *\n * @param viewToWalk the view to walk\n * @param action identifies the action to be performed on the elements\n * @param renderer the current renderer.\n * @param renderParent Optional the render parent node to be set in all LContainers found,\n * required for action modes Insert and Destroy.\n * @param beforeNode Optional the node before which elements should be added, required for action\n * Insert.\n */\nfunction walkTNodeTree(\n viewToWalk: LView, action: WalkTNodeTreeAction, renderer: Renderer3,\n renderParent: RElement | null, beforeNode?: RNode | null) {\n const rootTNode = viewToWalk[TVIEW].node as TViewNode;\n let projectionNodeIndex = -1;\n let currentView = viewToWalk;\n let tNode: TNode|null = rootTNode.child as TNode;\n while (tNode) {\n let nextTNode: TNode|null = null;\n if (tNode.type === TNodeType.Element) {\n executeNodeAction(\n action, renderer, renderParent, getNativeByTNode(tNode, currentView), beforeNode);\n const nodeOrContainer = currentView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n // This element has an LContainer, and its comment needs to be handled\n executeNodeAction(action, renderer, renderParent, nodeOrContainer[NATIVE], beforeNode);\n }\n } else if (tNode.type === TNodeType.Container) {\n const lContainer = currentView ![tNode.index] as LContainer;\n executeNodeAction(action, renderer, renderParent, lContainer[NATIVE], beforeNode);\n\n if (renderParent) lContainer[RENDER_PARENT] = renderParent;\n\n if (lContainer[VIEWS].length) {\n currentView = lContainer[VIEWS][0];\n nextTNode = currentView[TVIEW].node;\n\n // When the walker enters a container, then the beforeNode has to become the local native\n // comment node.\n beforeNode = lContainer[NATIVE];\n }\n } else if (tNode.type === TNodeType.Projection) {\n const componentView = findComponentView(currentView !);\n const componentHost = componentView[HOST_NODE] as TElementNode;\n const head: TNode|null =\n (componentHost.projection as(TNode | null)[])[tNode.projection as number];\n\n // Must store both the TNode and the view because this projection node could be nested\n // deeply inside embedded views, and we need to get back down to this particular nested view.\n projectionNodeStack[++projectionNodeIndex] = tNode;\n projectionNodeStack[++projectionNodeIndex] = currentView !;\n if (head) {\n currentView = componentView[PARENT] !;\n nextTNode = currentView[TVIEW].data[head.index] as TNode;\n }\n } else {\n // Otherwise, this is a View or an ElementContainer\n nextTNode = tNode.child;\n }\n\n if (nextTNode === null) {\n // this last node was projected, we need to get back down to its projection node\n if (tNode.next === null && (tNode.flags & TNodeFlags.isProjected)) {\n currentView = projectionNodeStack[projectionNodeIndex--] as LView;\n tNode = projectionNodeStack[projectionNodeIndex--] as TNode;\n }\n nextTNode = tNode.next;\n\n /**\n * Find the next node in the TNode tree, taking into account the place where a node is\n * projected (in the shadow DOM) rather than where it comes from (in the light DOM).\n *\n * If there is no sibling node, then it goes to the next sibling of the parent node...\n * until it reaches rootNode (at which point null is returned).\n */\n while (!nextTNode) {\n // If parent is null, we're crossing the view boundary, so we should get the host TNode.\n tNode = tNode.parent || currentView[TVIEW].node;\n\n if (tNode === null || tNode === rootTNode) return null;\n\n // When exiting a container, the beforeNode must be restored to the previous value\n if (tNode.type === TNodeType.Container) {\n currentView = currentView[PARENT] !;\n beforeNode = currentView[tNode.index][NATIVE];\n }\n\n if (tNode.type === TNodeType.View && currentView[NEXT]) {\n currentView = currentView[NEXT] as LView;\n nextTNode = currentView[TVIEW].node;\n } else {\n nextTNode = tNode.next;\n }\n }\n }\n tNode = nextTNode;\n }\n}\n\n/**\n * NOTE: for performance reasons, the possible actions are inlined within the function instead of\n * being passed as an argument.\n */\nfunction executeNodeAction(\n action: WalkTNodeTreeAction, renderer: Renderer3, parent: RElement | null,\n node: RComment | RElement | RText, beforeNode?: RNode | null) {\n if (action === WalkTNodeTreeAction.Insert) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).insertBefore(parent !, node, beforeNode as RNode | null) :\n parent !.insertBefore(node, beforeNode as RNode | null, true);\n } else if (action === WalkTNodeTreeAction.Detach) {\n isProceduralRenderer(renderer !) ?\n (renderer as ProceduralRenderer3).removeChild(parent !, node) :\n parent !.removeChild(node);\n } else if (action === WalkTNodeTreeAction.Destroy) {\n ngDevMode && ngDevMode.rendererDestroyNode++;\n (renderer as ProceduralRenderer3).destroyNode !(node);\n }\n}\n\nexport function createTextNode(value: any, renderer: Renderer3): RText {\n return isProceduralRenderer(renderer) ? renderer.createText(stringify(value)) :\n renderer.createTextNode(stringify(value));\n}\n\n/**\n * Adds or removes all DOM elements associated with a view.\n *\n * Because some root nodes of the view may be containers, we sometimes need\n * to propagate deeply into the nested containers to remove all elements in the\n * views beneath it.\n *\n * @param viewToWalk The view from which elements should be added or removed\n * @param insertMode Whether or not elements should be added (if false, removing)\n * @param beforeNode The node before which elements should be added, if insert mode\n */\nexport function addRemoveViewFromContainer(\n viewToWalk: LView, insertMode: true, beforeNode: RNode | null): void;\nexport function addRemoveViewFromContainer(viewToWalk: LView, insertMode: false): void;\nexport function addRemoveViewFromContainer(\n viewToWalk: LView, insertMode: boolean, beforeNode?: RNode | null): void {\n const renderParent = getContainerRenderParent(viewToWalk[TVIEW].node as TViewNode, viewToWalk);\n ngDevMode && assertNodeType(viewToWalk[TVIEW].node as TNode, TNodeType.View);\n if (renderParent) {\n const renderer = viewToWalk[RENDERER];\n walkTNodeTree(\n viewToWalk, insertMode ? WalkTNodeTreeAction.Insert : WalkTNodeTreeAction.Detach, renderer,\n renderParent, beforeNode);\n }\n}\n\n/**\n * Traverses down and up the tree of views and containers to remove listeners and\n * call onDestroy callbacks.\n *\n * Notes:\n * - Because it's used for onDestroy calls, it needs to be bottom-up.\n * - Must process containers instead of their views to avoid splicing\n * when views are destroyed and re-added.\n * - Using a while loop because it's faster than recursion\n * - Destroy only called on movement to sibling or movement to parent (laterally or up)\n *\n * @param rootView The view to destroy\n */\nexport function destroyViewTree(rootView: LView): void {\n // If the view has no children, we can clean it up and return early.\n if (rootView[TVIEW].childIndex === -1) {\n return cleanUpView(rootView);\n }\n let viewOrContainer: LView|LContainer|null = getLViewChild(rootView);\n\n while (viewOrContainer) {\n let next: LView|LContainer|null = null;\n\n if (viewOrContainer.length >= HEADER_OFFSET) {\n // If LView, traverse down to child.\n const view = viewOrContainer as LView;\n if (view[TVIEW].childIndex > -1) next = getLViewChild(view);\n } else {\n // If container, traverse down to its first LView.\n const container = viewOrContainer as LContainer;\n if (container[VIEWS].length) next = container[VIEWS][0];\n }\n\n if (next == null) {\n // Only clean up view when moving to the side or up, as destroy hooks\n // should be called in order from the bottom up.\n while (viewOrContainer && !viewOrContainer ![NEXT] && viewOrContainer !== rootView) {\n cleanUpView(viewOrContainer);\n viewOrContainer = getParentState(viewOrContainer, rootView);\n }\n cleanUpView(viewOrContainer || rootView);\n next = viewOrContainer && viewOrContainer ![NEXT];\n }\n viewOrContainer = next;\n }\n}\n\n/**\n * Inserts a view into a container.\n *\n * This adds the view to the container's array of active views in the correct\n * position. It also adds the view's elements to the DOM if the container isn't a\n * root node of another view (in that case, the view's elements will be added when\n * the container's parent view is added later).\n *\n * @param lView The view to insert\n * @param lContainer The container into which the view should be inserted\n * @param parentView The new parent of the inserted view\n * @param index The index at which to insert the view\n * @param containerIndex The index of the container node, if dynamic\n */\nexport function insertView(\n lView: LView, lContainer: LContainer, parentView: LView, index: number,\n containerIndex: number) {\n const views = lContainer[VIEWS];\n\n if (index > 0) {\n // This is a new view, we need to add it to the children.\n views[index - 1][NEXT] = lView;\n }\n\n if (index < views.length) {\n lView[NEXT] = views[index];\n views.splice(index, 0, lView);\n } else {\n views.push(lView);\n lView[NEXT] = null;\n }\n\n // Dynamically inserted views need a reference to their parent container's host so it's\n // possible to jump from a view to its container's next when walking the node tree.\n if (containerIndex > -1) {\n lView[CONTAINER_INDEX] = containerIndex;\n lView[PARENT] = parentView;\n }\n\n // Notify query that a new view has been added\n if (lView[QUERIES]) {\n lView[QUERIES] !.insertView(index);\n }\n\n // Sets the attached flag\n lView[FLAGS] |= LViewFlags.Attached;\n}\n\n/**\n * Detaches a view from a container.\n *\n * This method splices the view from the container's array of active views. It also\n * removes the view's elements from the DOM.\n *\n * @param lContainer The container from which to detach a view\n * @param removeIndex The index of the view to detach\n * @param detached Whether or not this view is already detached.\n * @returns Detached LView instance.\n */\nexport function detachView(lContainer: LContainer, removeIndex: number, detached: boolean): LView {\n const views = lContainer[VIEWS];\n const viewToDetach = views[removeIndex];\n if (removeIndex > 0) {\n views[removeIndex - 1][NEXT] = viewToDetach[NEXT] as LView;\n }\n views.splice(removeIndex, 1);\n if (!detached) {\n addRemoveViewFromContainer(viewToDetach, false);\n }\n\n if (viewToDetach[QUERIES]) {\n viewToDetach[QUERIES] !.removeView();\n }\n viewToDetach[CONTAINER_INDEX] = -1;\n viewToDetach[PARENT] = null;\n // Unsets the attached flag\n viewToDetach[FLAGS] &= ~LViewFlags.Attached;\n return viewToDetach;\n}\n\n/**\n * Removes a view from a container, i.e. detaches it and then destroys the underlying LView.\n *\n * @param lContainer The container from which to remove a view\n * @param tContainer The TContainer node associated with the LContainer\n * @param removeIndex The index of the view to remove\n */\nexport function removeView(\n lContainer: LContainer, containerHost: TElementNode | TContainerNode | TElementContainerNode,\n removeIndex: number) {\n const view = lContainer[VIEWS][removeIndex];\n detachView(lContainer, removeIndex, !!containerHost.detached);\n destroyLView(view);\n}\n\n/** Gets the child of the given LView */\nexport function getLViewChild(lView: LView): LView|LContainer|null {\n const childIndex = lView[TVIEW].childIndex;\n return childIndex === -1 ? null : lView[childIndex];\n}\n\n/**\n * A standalone function which destroys an LView,\n * conducting cleanup (e.g. removing listeners, calling onDestroys).\n *\n * @param view The view to be destroyed.\n */\nexport function destroyLView(view: LView) {\n const renderer = view[RENDERER];\n if (isProceduralRenderer(renderer) && renderer.destroyNode) {\n walkTNodeTree(view, WalkTNodeTreeAction.Destroy, renderer, null);\n }\n destroyViewTree(view);\n // Sets the destroyed flag\n view[FLAGS] |= LViewFlags.Destroyed;\n}\n\n/**\n * Determines which LViewOrLContainer to jump to when traversing back up the\n * tree in destroyViewTree.\n *\n * Normally, the view's parent LView should be checked, but in the case of\n * embedded views, the container (which is the view node's parent, but not the\n * LView's parent) needs to be checked for a possible next property.\n *\n * @param state The LViewOrLContainer for which we need a parent state\n * @param rootView The rootView, so we don't propagate too far up the view tree\n * @returns The correct parent LViewOrLContainer\n */\nexport function getParentState(state: LView | LContainer, rootView: LView): LView|LContainer|null {\n let tNode;\n if (state.length >= HEADER_OFFSET && (tNode = (state as LView) ![HOST_NODE]) &&\n tNode.type === TNodeType.View) {\n // if it's an embedded view, the state needs to go up to the container, in case the\n // container has a next\n return getLContainer(tNode as TViewNode, state as LView) as LContainer;\n } else {\n // otherwise, use parent view for containers or component views\n return state[PARENT] === rootView ? null : state[PARENT];\n }\n}\n\n/**\n * Calls onDestroys hooks for all directives and pipes in a given view and then removes all\n * listeners. Listeners are removed as the last step so events delivered in the onDestroys hooks\n * can be propagated to @Output listeners.\n *\n * @param view The LView to clean up\n */\nfunction cleanUpView(viewOrContainer: LView | LContainer): void {\n if ((viewOrContainer as LView).length >= HEADER_OFFSET) {\n const view = viewOrContainer as LView;\n executeOnDestroys(view);\n executePipeOnDestroys(view);\n removeListeners(view);\n const hostTNode = view[HOST_NODE];\n // For component views only, the local renderer is destroyed as clean up time.\n if (hostTNode && hostTNode.type === TNodeType.Element && isProceduralRenderer(view[RENDERER])) {\n ngDevMode && ngDevMode.rendererDestroy++;\n (view[RENDERER] as ProceduralRenderer3).destroy();\n }\n }\n}\n\n/** Removes listeners and unsubscribes from output subscriptions */\nfunction removeListeners(lView: LView): void {\n const tCleanup = lView[TVIEW].cleanup !;\n if (tCleanup != null) {\n const lCleanup = lView[CLEANUP] !;\n for (let i = 0; i < tCleanup.length - 1; i += 2) {\n if (typeof tCleanup[i] === 'string') {\n // This is a listener with the native renderer\n const idx = tCleanup[i + 1];\n const listener = lCleanup[tCleanup[i + 2]];\n const native = readElementValue(lView[idx]);\n const useCaptureOrSubIdx = tCleanup[i + 3];\n if (typeof useCaptureOrSubIdx === 'boolean') {\n // DOM listener\n native.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);\n } else {\n if (useCaptureOrSubIdx >= 0) {\n // unregister\n lCleanup[useCaptureOrSubIdx]();\n } else {\n // Subscription\n lCleanup[-useCaptureOrSubIdx].unsubscribe();\n }\n }\n i += 2;\n } else if (typeof tCleanup[i] === 'number') {\n // This is a listener with renderer2 (cleanup fn can be found by index)\n const cleanupFn = lCleanup[tCleanup[i]];\n cleanupFn();\n } else {\n // This is a cleanup function that is grouped with the index of its context\n const context = lCleanup[tCleanup[i + 1]];\n tCleanup[i].call(context);\n }\n }\n lView[CLEANUP] = null;\n }\n}\n\n/** Calls onDestroy hooks for this view */\nfunction executeOnDestroys(view: LView): void {\n const tView = view[TVIEW];\n let destroyHooks: HookData|null;\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n callHooks(view, destroyHooks);\n }\n}\n\n/** Calls pipe destroy hooks for this view */\nfunction executePipeOnDestroys(lView: LView): void {\n const pipeDestroyHooks = lView[TVIEW] && lView[TVIEW].pipeDestroyHooks;\n if (pipeDestroyHooks) {\n callHooks(lView !, pipeDestroyHooks);\n }\n}\n\nexport function getRenderParent(tNode: TNode, currentView: LView): RElement|null {\n if (canInsertNativeNode(tNode, currentView)) {\n // If we are asked for a render parent of the root component we need to do low-level DOM\n // operation as LTree doesn't exist above the topmost host node. We might need to find a render\n // parent of the topmost host node if the root component injects ViewContainerRef.\n if (isRootView(currentView)) {\n return nativeParentNode(currentView[RENDERER], getNativeByTNode(tNode, currentView));\n }\n\n const hostTNode = currentView[HOST_NODE];\n\n const tNodeParent = tNode.parent;\n if (tNodeParent != null && tNodeParent.type === TNodeType.ElementContainer) {\n tNode = getHighestElementContainer(tNodeParent);\n }\n\n return tNode.parent == null && hostTNode !.type === TNodeType.View ?\n getContainerRenderParent(hostTNode as TViewNode, currentView) :\n getParentNative(tNode, currentView) as RElement;\n }\n return null;\n}\n\nfunction canInsertNativeChildOfElement(tNode: TNode): boolean {\n // If the parent is null, then we are inserting across views. This happens when we\n // insert a root element of the component view into the component host element and it\n // should always be eager.\n if (tNode.parent == null ||\n // We should also eagerly insert if the parent is a regular, non-component element\n // since we know that this relationship will never be broken.\n tNode.parent.type === TNodeType.Element && !(tNode.parent.flags & TNodeFlags.isComponent)) {\n return true;\n }\n\n // Parent is a Component. Component's content nodes are not inserted immediately\n // because they will be projected, and so doing insert at this point would be wasteful.\n // Since the projection would than move it to its final destination.\n return false;\n}\n\n/**\n * We might delay insertion of children for a given view if it is disconnected.\n * This might happen for 2 main reasons:\n * - view is not inserted into any container (view was created but not inserted yet)\n * - view is inserted into a container but the container itself is not inserted into the DOM\n * (container might be part of projection or child of a view that is not inserted yet).\n *\n * In other words we can insert children of a given view if this view was inserted into a container\n * and\n * the container itself has its render parent determined.\n */\nfunction canInsertNativeChildOfView(viewTNode: TViewNode, view: LView): boolean {\n // Because we are inserting into a `View` the `View` may be disconnected.\n const container = getLContainer(viewTNode, view) !;\n if (container == null || container[RENDER_PARENT] == null) {\n // The `View` is not inserted into a `Container` or the parent `Container`\n // itself is disconnected. So we have to delay.\n return false;\n }\n\n // The parent `Container` is in inserted state, so we can eagerly insert into\n // this location.\n return true;\n}\n\n/**\n * Returns whether a native element can be inserted into the given parent.\n *\n * There are two reasons why we may not be able to insert a element immediately.\n * - Projection: When creating a child content element of a component, we have to skip the\n * insertion because the content of a component will be projected.\n * `<component><content>delayed due to projection</content></component>`\n * - Parent container is disconnected: This can happen when we are inserting a view into\n * parent container, which itself is disconnected. For example the parent container is part\n * of a View which has not be inserted or is mare for projection but has not been inserted\n * into destination.\n *\n\n *\n * @param tNode The tNode of the node that we want to insert.\n * @param currentView Current LView being processed.\n * @return boolean Whether the node should be inserted now (or delayed until later).\n */\nexport function canInsertNativeNode(tNode: TNode, currentView: LView): boolean {\n let currentNode = tNode;\n let parent: TNode|null = tNode.parent;\n\n if (tNode.parent) {\n if (tNode.parent.type === TNodeType.ElementContainer) {\n currentNode = getHighestElementContainer(tNode);\n parent = currentNode.parent;\n } else if (tNode.parent.type === TNodeType.IcuContainer) {\n currentNode = getFirstParentNative(currentNode);\n parent = currentNode.parent;\n }\n }\n if (parent === null) parent = currentView[HOST_NODE];\n\n if (parent && parent.type === TNodeType.View) {\n return canInsertNativeChildOfView(parent as TViewNode, currentView);\n } else {\n // Parent is a regular element or a component\n return canInsertNativeChildOfElement(currentNode);\n }\n}\n\n/**\n * Inserts a native node before another native node for a given parent using {@link Renderer3}.\n * This is a utility function that can be used when native nodes were determined - it abstracts an\n * actual renderer being used.\n */\nexport function nativeInsertBefore(\n renderer: Renderer3, parent: RElement, child: RNode, beforeNode: RNode | null): void {\n if (isProceduralRenderer(renderer)) {\n renderer.insertBefore(parent, child, beforeNode);\n } else {\n parent.insertBefore(child, beforeNode, true);\n }\n}\n\n/**\n * Returns a native parent of a given native node.\n */\nexport function nativeParentNode(renderer: Renderer3, node: RNode): RElement|null {\n return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode) as RElement;\n}\n\n/**\n * Returns a native sibling of a given native node.\n */\nexport function nativeNextSibling(renderer: Renderer3, node: RNode): RNode|null {\n return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;\n}\n\n/**\n * Appends the `child` element to the `parent`.\n *\n * The element insertion might be delayed {@link canInsertNativeNode}.\n *\n * @param childEl The child that should be appended\n * @param childTNode The TNode of the child element\n * @param currentView The current LView\n * @returns Whether or not the child was appended\n */\nexport function appendChild(\n childEl: RNode | null = null, childTNode: TNode, currentView: LView): boolean {\n if (childEl !== null && canInsertNativeNode(childTNode, currentView)) {\n const renderer = currentView[RENDERER];\n const parentEl = getParentNative(childTNode, currentView);\n const parentTNode: TNode = childTNode.parent || currentView[HOST_NODE] !;\n\n if (parentTNode.type === TNodeType.View) {\n const lContainer = getLContainer(parentTNode as TViewNode, currentView) as LContainer;\n const views = lContainer[VIEWS];\n const index = views.indexOf(currentView);\n nativeInsertBefore(\n renderer, lContainer[RENDER_PARENT] !, childEl,\n getBeforeNodeForView(index, views, lContainer[NATIVE]));\n } else if (parentTNode.type === TNodeType.ElementContainer) {\n const renderParent = getRenderParent(childTNode, currentView) !;\n nativeInsertBefore(renderer, renderParent, childEl, parentEl);\n } else if (parentTNode.type === TNodeType.IcuContainer) {\n const icuAnchorNode = getNativeByTNode(childTNode.parent !, currentView) !as RElement;\n nativeInsertBefore(renderer, parentEl as RElement, childEl, icuAnchorNode);\n } else {\n isProceduralRenderer(renderer) ? renderer.appendChild(parentEl !as RElement, childEl) :\n parentEl !.appendChild(childEl);\n }\n return true;\n }\n return false;\n}\n\n/**\n * Gets the top-level ng-container if ng-containers are nested.\n *\n * @param ngContainer The TNode of the starting ng-container\n * @returns tNode The TNode of the highest level ng-container\n */\nfunction getHighestElementContainer(ngContainer: TNode): TNode {\n while (ngContainer.parent != null && ngContainer.parent.type === TNodeType.ElementContainer) {\n ngContainer = ngContainer.parent;\n }\n return ngContainer;\n}\n\nexport function getBeforeNodeForView(index: number, views: LView[], containerNative: RComment) {\n if (index + 1 < views.length) {\n const view = views[index + 1] as LView;\n const viewTNode = view[HOST_NODE] as TViewNode;\n return viewTNode.child ? getNativeByTNode(viewTNode.child, view) : containerNative;\n } else {\n return containerNative;\n }\n}\n\n/**\n * Removes the `child` element from the DOM if not in view and not projected.\n *\n * @param childTNode The TNode of the child to remove\n * @param childEl The child that should be removed\n * @param currentView The current LView\n * @returns Whether or not the child was removed\n */\nexport function removeChild(childTNode: TNode, childEl: RNode | null, currentView: LView): boolean {\n // We only remove the element if not in View or not projected.\n if (childEl !== null && canInsertNativeNode(childTNode, currentView)) {\n const parentNative = getParentNative(childTNode, currentView) !as RElement;\n const renderer = currentView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.removeChild(parentNative as RElement, childEl) :\n parentNative !.removeChild(childEl);\n return true;\n }\n return false;\n}\n\n/**\n * Appends a projected node to the DOM, or in the case of a projected container,\n * appends the nodes from all of the container's active views to the DOM.\n *\n * @param projectedTNode The TNode to be projected\n * @param tProjectionNode The projection (ng-content) TNode\n * @param currentView Current LView\n * @param projectionView Projection view (view above current)\n */\nexport function appendProjectedNode(\n projectedTNode: TNode, tProjectionNode: TNode, currentView: LView,\n projectionView: LView): void {\n const native = getNativeByTNode(projectedTNode, projectionView);\n appendChild(native, tProjectionNode, currentView);\n\n // the projected contents are processed while in the shadow view (which is the currentView)\n // therefore we need to extract the view where the host element lives since it's the\n // logical container of the content projected views\n attachPatchData(native, projectionView);\n\n const renderParent = getRenderParent(tProjectionNode, currentView);\n\n const nodeOrContainer = projectionView[projectedTNode.index];\n if (projectedTNode.type === TNodeType.Container) {\n // The node we are adding is a container and we are adding it to an element which\n // is not a component (no more re-projection).\n // Alternatively a container is projected at the root of a component's template\n // and can't be re-projected (as not content of any component).\n // Assign the final projection location in those cases.\n nodeOrContainer[RENDER_PARENT] = renderParent;\n const views = nodeOrContainer[VIEWS];\n for (let i = 0; i < views.length; i++) {\n addRemoveViewFromContainer(views[i], true, nodeOrContainer[NATIVE]);\n }\n } else {\n if (projectedTNode.type === TNodeType.ElementContainer) {\n let ngContainerChildTNode: TNode|null = projectedTNode.child as TNode;\n while (ngContainerChildTNode) {\n appendProjectedNode(ngContainerChildTNode, tProjectionNode, currentView, projectionView);\n ngContainerChildTNode = ngContainerChildTNode.next;\n }\n }\n\n if (isLContainer(nodeOrContainer)) {\n nodeOrContainer[RENDER_PARENT] = renderParent;\n appendChild(nodeOrContainer[NATIVE], tProjectionNode, currentView);\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport './ng_dev_mode';\n\nimport {assertDefined, assertNotEqual} from './assert';\nimport {AttributeMarker, TAttributes, TNode, TNodeType, unusedValueExportToPlacateAjd as unused1} from './interfaces/node';\nimport {CssSelector, CssSelectorList, NG_PROJECT_AS_ATTR_NAME, SelectorFlags, unusedValueExportToPlacateAjd as unused2} from './interfaces/projection';\n\nconst unusedValueToPlacateAjd = unused1 + unused2;\n\nconst NG_TEMPLATE_SELECTOR = 'ng-template';\n\nfunction isCssClassMatching(nodeClassAttrVal: string, cssClassToMatch: string): boolean {\n const nodeClassesLen = nodeClassAttrVal.length;\n const matchIndex = nodeClassAttrVal !.indexOf(cssClassToMatch);\n const matchEndIdx = matchIndex + cssClassToMatch.length;\n if (matchIndex === -1 // no match\n || (matchIndex > 0 && nodeClassAttrVal ![matchIndex - 1] !== ' ') // no space before\n ||\n (matchEndIdx < nodeClassesLen && nodeClassAttrVal ![matchEndIdx] !== ' ')) // no space after\n {\n return false;\n }\n return true;\n}\n\n/**\n * Function that checks whether a given tNode matches tag-based selector and has a valid type.\n *\n * Matching can be perfomed in 2 modes: projection mode (when we project nodes) and regular\n * directive matching mode. In \"projection\" mode, we do not need to check types, so if tag name\n * matches selector, we declare a match. In \"directive matching\" mode, we also check whether tNode\n * is of expected type:\n * - whether tNode has either Element or ElementContainer type\n * - or if we want to match \"ng-template\" tag, we check for Container type\n */\nfunction hasTagAndTypeMatch(\n tNode: TNode, currentSelector: string, isProjectionMode: boolean): boolean {\n return currentSelector === tNode.tagName &&\n (isProjectionMode ||\n (tNode.type === TNodeType.Element || tNode.type === TNodeType.ElementContainer) ||\n (tNode.type === TNodeType.Container && currentSelector === NG_TEMPLATE_SELECTOR));\n}\n\n/**\n * A utility function to match an Ivy node static data against a simple CSS selector\n *\n * @param node static data to match\n * @param selector\n * @returns true if node matches the selector.\n */\nexport function isNodeMatchingSelector(\n tNode: TNode, selector: CssSelector, isProjectionMode: boolean): boolean {\n ngDevMode && assertDefined(selector[0], 'Selector should have a tag name');\n\n let mode: SelectorFlags = SelectorFlags.ELEMENT;\n const nodeAttrs = tNode.attrs !;\n const selectOnlyMarkerIdx = nodeAttrs ? nodeAttrs.indexOf(AttributeMarker.SelectOnly) : -1;\n\n // When processing \":not\" selectors, we skip to the next \":not\" if the\n // current one doesn't match\n let skipToNextSelector = false;\n\n for (let i = 0; i < selector.length; i++) {\n const current = selector[i];\n if (typeof current === 'number') {\n // If we finish processing a :not selector and it hasn't failed, return false\n if (!skipToNextSelector && !isPositive(mode) && !isPositive(current as number)) {\n return false;\n }\n // If we are skipping to the next :not() and this mode flag is positive,\n // it's a part of the current :not() selector, and we should keep skipping\n if (skipToNextSelector && isPositive(current)) continue;\n skipToNextSelector = false;\n mode = (current as number) | (mode & SelectorFlags.NOT);\n continue;\n }\n\n if (skipToNextSelector) continue;\n\n if (mode & SelectorFlags.ELEMENT) {\n mode = SelectorFlags.ATTRIBUTE | mode & SelectorFlags.NOT;\n if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) ||\n current === '' && selector.length === 1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n } else {\n const attrName = mode & SelectorFlags.CLASS ? 'class' : current;\n const attrIndexInNode = findAttrIndexInNode(attrName, nodeAttrs);\n\n if (attrIndexInNode === -1) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n continue;\n }\n\n const selectorAttrValue = mode & SelectorFlags.CLASS ? current : selector[++i];\n if (selectorAttrValue !== '') {\n let nodeAttrValue: string;\n const maybeAttrName = nodeAttrs[attrIndexInNode];\n if (selectOnlyMarkerIdx > -1 && attrIndexInNode > selectOnlyMarkerIdx) {\n nodeAttrValue = '';\n } else {\n ngDevMode && assertNotEqual(\n maybeAttrName, AttributeMarker.NamespaceURI,\n 'We do not match directives on namespaced attributes');\n nodeAttrValue = nodeAttrs[attrIndexInNode + 1] as string;\n }\n if (mode & SelectorFlags.CLASS &&\n !isCssClassMatching(nodeAttrValue as string, selectorAttrValue as string) ||\n mode & SelectorFlags.ATTRIBUTE && selectorAttrValue !== nodeAttrValue) {\n if (isPositive(mode)) return false;\n skipToNextSelector = true;\n }\n }\n }\n }\n\n return isPositive(mode) || skipToNextSelector;\n}\n\nfunction isPositive(mode: SelectorFlags): boolean {\n return (mode & SelectorFlags.NOT) === 0;\n}\n\n/**\n * Examines an attributes definition array from a node to find the index of the\n * attribute with the specified name.\n *\n * NOTE: Will not find namespaced attributes.\n *\n * @param name the name of the attribute to find\n * @param attrs the attribute array to examine\n */\nfunction findAttrIndexInNode(name: string, attrs: TAttributes | null): number {\n if (attrs === null) return -1;\n let selectOnlyMode = false;\n let i = 0;\n while (i < attrs.length) {\n const maybeAttrName = attrs[i];\n if (maybeAttrName === name) {\n return i;\n } else if (maybeAttrName === AttributeMarker.NamespaceURI) {\n // NOTE(benlesh): will not find namespaced attributes. This is by design.\n i += 4;\n } else {\n if (maybeAttrName === AttributeMarker.SelectOnly) {\n selectOnlyMode = true;\n }\n i += selectOnlyMode ? 1 : 2;\n }\n }\n\n return -1;\n}\n\nexport function isNodeMatchingSelectorList(\n tNode: TNode, selector: CssSelectorList, isProjectionMode: boolean = false): boolean {\n for (let i = 0; i < selector.length; i++) {\n if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getProjectAsAttrValue(tNode: TNode): string|null {\n const nodeAttrs = tNode.attrs;\n if (nodeAttrs != null) {\n const ngProjectAsAttrIdx = nodeAttrs.indexOf(NG_PROJECT_AS_ATTR_NAME);\n // only check for ngProjectAs in attribute names, don't accidentally match attribute's value\n // (attribute names are stored at even indexes)\n if ((ngProjectAsAttrIdx & 1) === 0) {\n return nodeAttrs[ngProjectAsAttrIdx + 1] as string;\n }\n }\n return null;\n}\n\n/**\n * Checks a given node against matching selectors and returns\n * selector index (or 0 if none matched).\n *\n * This function takes into account the ngProjectAs attribute: if present its value will be compared\n * to the raw (un-parsed) CSS selector instead of using standard selector matching logic.\n */\nexport function matchingSelectorIndex(\n tNode: TNode, selectors: CssSelectorList[], textSelectors: string[]): number {\n const ngProjectAsAttrVal = getProjectAsAttrValue(tNode);\n for (let i = 0; i < selectors.length; i++) {\n // if a node has the ngProjectAs attribute match it against unparsed selector\n // match a node against a parsed selector only if ngProjectAs attribute is not present\n if (ngProjectAsAttrVal === textSelectors[i] ||\n ngProjectAsAttrVal === null &&\n isNodeMatchingSelectorList(tNode, selectors[i], /* isProjectionMode */ true)) {\n return i + 1; // first matching selector \"captures\" a given node\n }\n }\n return 0;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {PlayerFactory, PlayerFactoryBuildFn} from '../interfaces/player';\n\n/**\n * Combines the binding value and a factory for an animation player.\n *\n * Used to bind a player to an element template binding (currently only\n * `[style]`, `[style.prop]`, `[class]` and `[class.name]` bindings\n * supported). The provided `factoryFn` function will be run once all\n * the associated bindings have been evaluated on the element and is\n * designed to return a player which will then be placed on the element.\n *\n * @param factoryFn The function that is used to create a player\n * once all the rendering-related (styling values) have been\n * processed for the element binding.\n * @param value The raw value that will be exposed to the binding\n * so that the binding can update its internal values when\n * any changes are evaluated.\n */\nexport function bindPlayerFactory<T>(factoryFn: PlayerFactoryBuildFn, value: T): PlayerFactory {\n return new BoundPlayerFactory(factoryFn, value) as any;\n}\n\nexport class BoundPlayerFactory<T> {\n '__brand__': 'Brand for PlayerFactory that nothing will match';\n constructor(public fn: PlayerFactoryBuildFn, public value: T) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {PlayState, Player, PlayerHandler} from '../interfaces/player';\n\nexport class CorePlayerHandler implements PlayerHandler {\n private _players: Player[] = [];\n\n flushPlayers() {\n for (let i = 0; i < this._players.length; i++) {\n const player = this._players[i];\n if (!player.parent && player.state === PlayState.Pending) {\n player.play();\n }\n }\n this._players.length = 0;\n }\n\n queuePlayer(player: Player) { this._players.push(player); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport '../ng_dev_mode';\n\nimport {StyleSanitizeFn} from '../../sanitization/style_sanitizer';\nimport {getLContext} from '../context_discovery';\nimport {LContainer} from '../interfaces/container';\nimport {LContext} from '../interfaces/context';\nimport {AttributeMarker, TAttributes, TNode, TNodeFlags} from '../interfaces/node';\nimport {PlayState, Player, PlayerContext, PlayerIndex} from '../interfaces/player';\nimport {RElement} from '../interfaces/renderer';\nimport {InitialStylingValues, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling';\nimport {HEADER_OFFSET, HOST, LView, RootContext} from '../interfaces/view';\nimport {getTNode} from '../util';\n\nimport {CorePlayerHandler} from './core_player_handler';\n\nconst ANIMATION_PROP_PREFIX = '@';\n\nexport function createEmptyStylingContext(\n element?: RElement | null, sanitizer?: StyleSanitizeFn | null,\n initialStyles?: InitialStylingValues | null,\n initialClasses?: InitialStylingValues | null): StylingContext {\n return [\n 0, // MasterFlags\n [null, -1, false, sanitizer || null], // DirectiveRefs\n initialStyles || [null], // InitialStyles\n initialClasses || [null], // InitialClasses\n [0, 0], // SinglePropOffsets\n element || null, // Element\n null, // PreviousMultiClassValue\n null, // PreviousMultiStyleValue\n null, // PlayerContext\n ];\n}\n\n/**\n * Used clone a copy of a pre-computed template of a styling context.\n *\n * A pre-computed template is designed to be computed once for a given element\n * (instructions.ts has logic for caching this).\n */\nexport function allocStylingContext(\n element: RElement | null, templateStyleContext: StylingContext): StylingContext {\n // each instance gets a copy\n const context = templateStyleContext.slice() as any as StylingContext;\n context[StylingIndex.ElementPosition] = element;\n\n // this will prevent any other directives from extending the context\n context[StylingIndex.MasterFlagPosition] |= StylingFlags.BindingAllocationLocked;\n return context;\n}\n\n/**\n * Retrieve the `StylingContext` at a given index.\n *\n * This method lazily creates the `StylingContext`. This is because in most cases\n * we have styling without any bindings. Creating `StylingContext` eagerly would mean that\n * every style declaration such as `<div style=\"color: red\">` would result `StyleContext`\n * which would create unnecessary memory pressure.\n *\n * @param index Index of the style allocation. See: `elementStyling`.\n * @param viewData The view to search for the styling context\n */\nexport function getStylingContext(index: number, viewData: LView): StylingContext {\n let storageIndex = index;\n let slotValue: LContainer|LView|StylingContext|RElement = viewData[storageIndex];\n let wrapper: LContainer|LView|StylingContext = viewData;\n\n while (Array.isArray(slotValue)) {\n wrapper = slotValue;\n slotValue = slotValue[HOST] as LView | StylingContext | RElement;\n }\n\n if (isStylingContext(wrapper)) {\n return wrapper as StylingContext;\n } else {\n // This is an LView or an LContainer\n const stylingTemplate = getTNode(index - HEADER_OFFSET, viewData).stylingTemplate;\n\n if (wrapper !== viewData) {\n storageIndex = HOST;\n }\n\n return wrapper[storageIndex] = stylingTemplate ?\n allocStylingContext(slotValue, stylingTemplate) :\n createEmptyStylingContext(slotValue);\n }\n}\n\nexport function isStylingContext(value: any): value is StylingContext {\n // Not an LView or an LContainer\n return Array.isArray(value) && typeof value[StylingIndex.MasterFlagPosition] === 'number' &&\n Array.isArray(value[StylingIndex.InitialStyleValuesPosition]);\n}\n\nexport function isAnimationProp(name: string): boolean {\n return name[0] === ANIMATION_PROP_PREFIX;\n}\n\nexport function addPlayerInternal(\n playerContext: PlayerContext, rootContext: RootContext, element: HTMLElement,\n player: Player | null, playerContextIndex: number, ref?: any): boolean {\n ref = ref || element;\n if (playerContextIndex) {\n playerContext[playerContextIndex] = player;\n } else {\n playerContext.push(player);\n }\n\n if (player) {\n player.addEventListener(PlayState.Destroyed, () => {\n const index = playerContext.indexOf(player);\n const nonFactoryPlayerIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n\n // if the player is being removed from the factory side of the context\n // (which is where the [style] and [class] bindings do their thing) then\n // that side of the array cannot be resized since the respective bindings\n // have pointer index values that point to the associated factory instance\n if (index) {\n if (index < nonFactoryPlayerIndex) {\n playerContext[index] = null;\n } else {\n playerContext.splice(index, 1);\n }\n }\n player.destroy();\n });\n\n const playerHandler =\n rootContext.playerHandler || (rootContext.playerHandler = new CorePlayerHandler());\n playerHandler.queuePlayer(player, ref);\n return true;\n }\n\n return false;\n}\n\nexport function getPlayersInternal(playerContext: PlayerContext): Player[] {\n const players: Player[] = [];\n const nonFactoryPlayersStart = playerContext[PlayerIndex.NonBuilderPlayersStart];\n\n // add all factory-based players (which are apart of [style] and [class] bindings)\n for (let i = PlayerIndex.PlayerBuildersStartPosition + PlayerIndex.PlayerOffsetPosition;\n i < nonFactoryPlayersStart; i += PlayerIndex.PlayerAndPlayerBuildersTupleSize) {\n const player = playerContext[i] as Player | null;\n if (player) {\n players.push(player);\n }\n }\n\n // add all custom players (not apart of [style] and [class] bindings)\n for (let i = nonFactoryPlayersStart; i < playerContext.length; i++) {\n players.push(playerContext[i] as Player);\n }\n\n return players;\n}\n\n\nexport function getOrCreatePlayerContext(target: {}, context?: LContext | null): PlayerContext|\n null {\n context = context || getLContext(target) !;\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return null;\n }\n\n const {lView, nodeIndex} = context;\n const stylingContext = getStylingContext(nodeIndex, lView);\n return getPlayerContext(stylingContext) || allocPlayerContext(stylingContext);\n}\n\nexport function getPlayerContext(stylingContext: StylingContext): PlayerContext|null {\n return stylingContext[StylingIndex.PlayerContext];\n}\n\nexport function allocPlayerContext(data: StylingContext): PlayerContext {\n return data[StylingIndex.PlayerContext] =\n [PlayerIndex.SinglePlayerBuildersStartPosition, null, null, null, null];\n}\n\nexport function throwInvalidRefError() {\n throw new Error('Only elements that exist in an Angular application can be used for animations');\n}\n\nexport function hasStyling(attrs: TAttributes): boolean {\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (attr == AttributeMarker.Classes || attr == AttributeMarker.Styles) return true;\n }\n return false;\n}\n\nexport function hasClassInput(tNode: TNode) {\n return tNode.flags & TNodeFlags.hasClassInput ? true : false;\n}\n","/**\n* @license\n* Copyright Google Inc. All Rights Reserved.\n*\n* Use of this source code is governed by an MIT-style license that can be\n* found in the LICENSE file at https://angular.io/license\n*/\nimport {StyleSanitizeFn} from '../../sanitization/style_sanitizer';\nimport {assertNotEqual} from '../assert';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {AttributeMarker, TAttributes} from '../interfaces/node';\nimport {BindingStore, BindingType, Player, PlayerBuilder, PlayerFactory, PlayerIndex} from '../interfaces/player';\nimport {RElement, Renderer3, RendererStyleFlags3, isProceduralRenderer} from '../interfaces/renderer';\nimport {DirectiveOwnerAndPlayerBuilderIndex, DirectiveRegistryValues, DirectiveRegistryValuesIndex, InitialStylingValues, InitialStylingValuesIndex, SinglePropOffsetValues, SinglePropOffsetValuesIndex, StylingContext, StylingFlags, StylingIndex} from '../interfaces/styling';\nimport {LView, RootContext} from '../interfaces/view';\nimport {NO_CHANGE} from '../tokens';\nimport {getRootContext} from '../util';\n\nimport {BoundPlayerFactory} from './player_factory';\nimport {addPlayerInternal, allocPlayerContext, createEmptyStylingContext, getPlayerContext} from './util';\n\n\n/**\n * This file includes the code to power all styling-binding operations in Angular.\n *\n * These include:\n * [style]=\"myStyleObj\"\n * [class]=\"myClassObj\"\n * [style.prop]=\"myPropValue\"\n * [class.name]=\"myClassValue\"\n *\n * There are many different ways in which these functions below are called. Please see\n * `interfaces/styles.ts` to get a better idea of how the styling algorithm works.\n */\n\n\n\n/**\n * Creates a new StylingContext an fills it with the provided static styling attribute values.\n */\nexport function initializeStaticContext(attrs: TAttributes) {\n const context = createEmptyStylingContext();\n const initialClasses: InitialStylingValues = context[StylingIndex.InitialClassValuesPosition] =\n [null];\n const initialStyles: InitialStylingValues = context[StylingIndex.InitialStyleValuesPosition] =\n [null];\n\n // The attributes array has marker values (numbers) indicating what the subsequent\n // values represent. When we encounter a number, we set the mode to that type of attribute.\n let mode = -1;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (typeof attr == 'number') {\n mode = attr;\n } else if (mode === AttributeMarker.Styles) {\n initialStyles.push(attr as string, attrs[++i] as string);\n } else if (mode === AttributeMarker.Classes) {\n initialClasses.push(attr as string, true);\n } else if (mode === AttributeMarker.SelectOnly) {\n break;\n }\n }\n\n return context;\n}\n\n/**\n * Designed to update an existing styling context with new static styling\n * data (classes and styles).\n *\n * @param context the existing styling context\n * @param attrs an array of new static styling attributes that will be\n * assigned to the context\n * @param directive the directive instance with which static data is associated with.\n */\nexport function patchContextWithStaticAttrs(\n context: StylingContext, attrs: TAttributes, directive: any): void {\n // If the styling context has already been patched with the given directive's bindings,\n // then there is no point in doing it again. The reason why this may happen (the directive\n // styling being patched twice) is because the `stylingBinding` function is called each time\n // an element is created (both within a template function and within directive host bindings).\n const directives = context[StylingIndex.DirectiveRegistryPosition];\n if (getDirectiveRegistryValuesIndexOf(directives, directive) == -1) {\n // this is a new directive which we have not seen yet.\n directives.push(directive, -1, false, null);\n\n let initialClasses: InitialStylingValues|null = null;\n let initialStyles: InitialStylingValues|null = null;\n\n let mode = -1;\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n if (typeof attr == 'number') {\n mode = attr;\n } else if (mode == AttributeMarker.Classes) {\n initialClasses = initialClasses || context[StylingIndex.InitialClassValuesPosition];\n patchInitialStylingValue(initialClasses, attr, true);\n } else if (mode == AttributeMarker.Styles) {\n initialStyles = initialStyles || context[StylingIndex.InitialStyleValuesPosition];\n patchInitialStylingValue(initialStyles, attr, attrs[++i]);\n }\n }\n }\n}\n\n/**\n * Designed to add a style or class value into the existing set of initial styles.\n *\n * The function will search and figure out if a style/class value is already present\n * within the provided initial styling array. If and when a style/class value is not\n * present (or if it's value is falsy) then it will be inserted/updated in the list\n * of initial styling values.\n */\nfunction patchInitialStylingValue(\n initialStyling: InitialStylingValues, prop: string, value: any): void {\n // Even values are keys; Odd numbers are values; Search keys only\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialStyling.length;) {\n const key = initialStyling[i];\n if (key === prop) {\n const existingValue = initialStyling[i + InitialStylingValuesIndex.ValueOffset];\n\n // If there is no previous style value (when `null`) or no previous class\n // applied (when `false`) then we update the the newly given value.\n if (existingValue == null || existingValue == false) {\n initialStyling[i + InitialStylingValuesIndex.ValueOffset] = value;\n }\n return;\n }\n i = i + InitialStylingValuesIndex.Size;\n }\n // We did not find existing key, add a new one.\n initialStyling.push(prop, value);\n}\n\n/**\n * Runs through the initial styling data present in the context and renders\n * them via the renderer on the element.\n */\nexport function renderInitialStylesAndClasses(\n element: RElement, context: StylingContext, renderer: Renderer3) {\n const initialClasses = context[StylingIndex.InitialClassValuesPosition];\n renderInitialStylingValues(element, renderer, initialClasses, true);\n\n const initialStyles = context[StylingIndex.InitialStyleValuesPosition];\n renderInitialStylingValues(element, renderer, initialStyles, false);\n}\n\n/**\n * This is a helper function designed to render each entry present within the\n * provided list of initialStylingValues.\n */\nfunction renderInitialStylingValues(\n element: RElement, renderer: Renderer3, initialStylingValues: InitialStylingValues,\n isEntryClassBased: boolean) {\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialStylingValues.length;\n i += InitialStylingValuesIndex.Size) {\n const value = initialStylingValues[i + InitialStylingValuesIndex.ValueOffset];\n if (value) {\n if (isEntryClassBased) {\n setClass(\n element, initialStylingValues[i + InitialStylingValuesIndex.PropOffset] as string, true,\n renderer, null);\n } else {\n setStyle(\n element, initialStylingValues[i + InitialStylingValuesIndex.PropOffset] as string,\n value as string, renderer, null);\n }\n }\n }\n}\n\nexport function allowNewBindingsForStylingContext(context: StylingContext): boolean {\n return (context[StylingIndex.MasterFlagPosition] & StylingFlags.BindingAllocationLocked) === 0;\n}\n\n/**\n * Adds in new binding values to a styling context.\n *\n * If a directive value is provided then all provided class/style binding names will\n * reference the provided directive.\n *\n * @param context the existing styling context\n * @param directiveRef the directive that the new bindings will reference\n * @param classBindingNames an array of class binding names that will be added to the context\n * @param styleBindingNames an array of style binding names that will be added to the context\n * @param styleSanitizer an optional sanitizer that handle all sanitization on for each of\n * the bindings added to the context. Note that if a directive is provided then the sanitizer\n * instance will only be active if and when the directive updates the bindings that it owns.\n */\nexport function updateContextWithBindings(\n context: StylingContext, directiveRef: any | null, classBindingNames?: string[] | null,\n styleBindingNames?: string[] | null, styleSanitizer?: StyleSanitizeFn | null,\n onlyProcessSingleClasses?: boolean) {\n if (context[StylingIndex.MasterFlagPosition] & StylingFlags.BindingAllocationLocked) return;\n\n // this means the context has already been patched with the directive's bindings\n const directiveIndex = findOrPatchDirectiveIntoRegistry(context, directiveRef, styleSanitizer);\n if (directiveIndex === -1) {\n // this means the directive has already been patched in ... No point in doing anything\n return;\n }\n\n // there are alot of variables being used below to track where in the context the new\n // binding values will be placed. Because the context consists of multiple types of\n // entries (single classes/styles and multi classes/styles) alot of the index positions\n // need to be computed ahead of time and the context needs to be extended before the values\n // are inserted in.\n const singlePropOffsetValues = context[StylingIndex.SinglePropOffsetPositions];\n const totalCurrentClassBindings =\n singlePropOffsetValues[SinglePropOffsetValuesIndex.ClassesCountPosition];\n const totalCurrentStyleBindings =\n singlePropOffsetValues[SinglePropOffsetValuesIndex.StylesCountPosition];\n\n const classesOffset = totalCurrentClassBindings * StylingIndex.Size;\n const stylesOffset = totalCurrentStyleBindings * StylingIndex.Size;\n\n const singleStylesStartIndex = StylingIndex.SingleStylesStartPosition;\n let singleClassesStartIndex = singleStylesStartIndex + stylesOffset;\n let multiStylesStartIndex = singleClassesStartIndex + classesOffset;\n let multiClassesStartIndex = multiStylesStartIndex + stylesOffset;\n\n // because we're inserting more bindings into the context, this means that the\n // binding values need to be referenced the singlePropOffsetValues array so that\n // the template/directive can easily find them inside of the `elementStyleProp`\n // and the `elementClassProp` functions without iterating through the entire context.\n // The first step to setting up these reference points is to mark how many bindings\n // are being added. Even if these bindings already exist in the context, the directive\n // or template code will still call them unknowingly. Therefore the total values need\n // to be registered so that we know how many bindings are assigned to each directive.\n const currentSinglePropsLength = singlePropOffsetValues.length;\n singlePropOffsetValues.push(\n styleBindingNames ? styleBindingNames.length : 0,\n classBindingNames ? classBindingNames.length : 0);\n\n // the code below will check to see if a new style binding already exists in the context\n // if so then there is no point in inserting it into the context again. Whether or not it\n // exists the styling offset code will now know exactly where it is\n let insertionOffset = 0;\n const filteredStyleBindingNames: string[] = [];\n if (styleBindingNames && styleBindingNames.length) {\n for (let i = 0; i < styleBindingNames.length; i++) {\n const name = styleBindingNames[i];\n let singlePropIndex =\n getMatchingBindingIndex(context, name, singleStylesStartIndex, singleClassesStartIndex);\n if (singlePropIndex == -1) {\n singlePropIndex = singleClassesStartIndex + insertionOffset;\n insertionOffset += StylingIndex.Size;\n filteredStyleBindingNames.push(name);\n }\n singlePropOffsetValues.push(singlePropIndex);\n }\n }\n\n // just like with the style binding loop above, the new class bindings get the same treatment...\n const filteredClassBindingNames: string[] = [];\n if (classBindingNames && classBindingNames.length) {\n for (let i = 0; i < classBindingNames.length; i++) {\n const name = classBindingNames[i];\n let singlePropIndex =\n getMatchingBindingIndex(context, name, singleClassesStartIndex, multiStylesStartIndex);\n if (singlePropIndex == -1) {\n singlePropIndex = multiStylesStartIndex + insertionOffset;\n insertionOffset += StylingIndex.Size;\n filteredClassBindingNames.push(name);\n } else {\n singlePropIndex += filteredStyleBindingNames.length * StylingIndex.Size;\n }\n singlePropOffsetValues.push(singlePropIndex);\n }\n }\n\n // because new styles are being inserted, this means the existing collection of style offset\n // index values are incorrect (they point to the wrong values). The code below will run through\n // the entire offset array and update the existing set of index values to point to their new\n // locations while taking the new binding values into consideration.\n let i = SinglePropOffsetValuesIndex.ValueStartPosition;\n if (filteredStyleBindingNames.length) {\n while (i < currentSinglePropsLength) {\n const totalStyles =\n singlePropOffsetValues[i + SinglePropOffsetValuesIndex.StylesCountPosition];\n const totalClasses =\n singlePropOffsetValues[i + SinglePropOffsetValuesIndex.ClassesCountPosition];\n if (totalClasses) {\n const start = i + SinglePropOffsetValuesIndex.ValueStartPosition + totalStyles;\n for (let j = start; j < start + totalClasses; j++) {\n singlePropOffsetValues[j] += filteredStyleBindingNames.length * StylingIndex.Size;\n }\n }\n\n const total = totalStyles + totalClasses;\n i += SinglePropOffsetValuesIndex.ValueStartPosition + total;\n }\n }\n\n const totalNewEntries = filteredClassBindingNames.length + filteredStyleBindingNames.length;\n\n // in the event that there are new style values being inserted, all existing class and style\n // bindings need to have their pointer values offsetted with the new amount of space that is\n // used for the new style/class bindings.\n for (let i = singleStylesStartIndex; i < context.length; i += StylingIndex.Size) {\n const isMultiBased = i >= multiStylesStartIndex;\n const isClassBased = i >= (isMultiBased ? multiClassesStartIndex : singleClassesStartIndex);\n const flag = getPointers(context, i);\n const staticIndex = getInitialIndex(flag);\n let singleOrMultiIndex = getMultiOrSingleIndex(flag);\n if (isMultiBased) {\n singleOrMultiIndex +=\n isClassBased ? (filteredStyleBindingNames.length * StylingIndex.Size) : 0;\n } else {\n singleOrMultiIndex += (totalNewEntries * StylingIndex.Size) +\n ((isClassBased ? filteredStyleBindingNames.length : 0) * StylingIndex.Size);\n }\n setFlag(context, i, pointers(flag, staticIndex, singleOrMultiIndex));\n }\n\n // this is where we make space in the context for the new style bindings\n for (let i = 0; i < filteredStyleBindingNames.length * StylingIndex.Size; i++) {\n context.splice(multiClassesStartIndex, 0, null);\n context.splice(singleClassesStartIndex, 0, null);\n singleClassesStartIndex++;\n multiStylesStartIndex++;\n multiClassesStartIndex += 2; // both single + multi slots were inserted\n }\n\n // this is where we make space in the context for the new class bindings\n for (let i = 0; i < filteredClassBindingNames.length * StylingIndex.Size; i++) {\n context.splice(multiStylesStartIndex, 0, null);\n context.push(null);\n multiStylesStartIndex++;\n multiClassesStartIndex++;\n }\n\n const initialClasses = context[StylingIndex.InitialClassValuesPosition];\n const initialStyles = context[StylingIndex.InitialStyleValuesPosition];\n\n // the code below will insert each new entry into the context and assign the appropriate\n // flags and index values to them. It's important this runs at the end of this function\n // because the context, property offset and index values have all been computed just before.\n for (let i = 0; i < totalNewEntries; i++) {\n const entryIsClassBased = i >= filteredStyleBindingNames.length;\n const adjustedIndex = entryIsClassBased ? (i - filteredStyleBindingNames.length) : i;\n const propName = entryIsClassBased ? filteredClassBindingNames[adjustedIndex] :\n filteredStyleBindingNames[adjustedIndex];\n\n let multiIndex, singleIndex;\n if (entryIsClassBased) {\n multiIndex = multiClassesStartIndex +\n ((totalCurrentClassBindings + adjustedIndex) * StylingIndex.Size);\n singleIndex = singleClassesStartIndex +\n ((totalCurrentClassBindings + adjustedIndex) * StylingIndex.Size);\n } else {\n multiIndex =\n multiStylesStartIndex + ((totalCurrentStyleBindings + adjustedIndex) * StylingIndex.Size);\n singleIndex = singleStylesStartIndex +\n ((totalCurrentStyleBindings + adjustedIndex) * StylingIndex.Size);\n }\n\n // if a property is not found in the initial style values list then it\n // is ALWAYS added incase a follow-up directive introduces the same initial\n // style/class value later on.\n let initialValuesToLookup = entryIsClassBased ? initialClasses : initialStyles;\n let indexForInitial = getInitialStylingValuesIndexOf(initialValuesToLookup, propName);\n if (indexForInitial === -1) {\n indexForInitial = initialValuesToLookup.length + InitialStylingValuesIndex.ValueOffset;\n initialValuesToLookup.push(propName, entryIsClassBased ? false : null);\n } else {\n indexForInitial += InitialStylingValuesIndex.ValueOffset;\n }\n\n const initialFlag =\n prepareInitialFlag(context, propName, entryIsClassBased, styleSanitizer || null);\n\n setFlag(context, singleIndex, pointers(initialFlag, indexForInitial, multiIndex));\n setProp(context, singleIndex, propName);\n setValue(context, singleIndex, null);\n setPlayerBuilderIndex(context, singleIndex, 0, directiveIndex);\n\n setFlag(context, multiIndex, pointers(initialFlag, indexForInitial, singleIndex));\n setProp(context, multiIndex, propName);\n setValue(context, multiIndex, null);\n setPlayerBuilderIndex(context, multiIndex, 0, directiveIndex);\n }\n\n // the total classes/style values are updated so the next time the context is patched\n // additional style/class bindings from another directive then it knows exactly where\n // to insert them in the context\n singlePropOffsetValues[SinglePropOffsetValuesIndex.ClassesCountPosition] =\n totalCurrentClassBindings + filteredClassBindingNames.length;\n singlePropOffsetValues[SinglePropOffsetValuesIndex.StylesCountPosition] =\n totalCurrentStyleBindings + filteredStyleBindingNames.length;\n\n // there is no initial value flag for the master index since it doesn't\n // reference an initial style value\n const masterFlag = pointers(0, 0, multiStylesStartIndex) |\n (onlyProcessSingleClasses ? StylingFlags.OnlyProcessSingleClasses : 0);\n setFlag(context, StylingIndex.MasterFlagPosition, masterFlag);\n}\n\n/**\n * Searches through the existing registry of directives\n */\nfunction findOrPatchDirectiveIntoRegistry(\n context: StylingContext, directiveRef: any, styleSanitizer?: StyleSanitizeFn | null) {\n const directiveRefs = context[StylingIndex.DirectiveRegistryPosition];\n const nextOffsetInsertionIndex = context[StylingIndex.SinglePropOffsetPositions].length;\n\n let directiveIndex: number;\n const detectedIndex = getDirectiveRegistryValuesIndexOf(directiveRefs, directiveRef);\n\n if (detectedIndex === -1) {\n directiveIndex = directiveRefs.length / DirectiveRegistryValuesIndex.Size;\n directiveRefs.push(directiveRef, nextOffsetInsertionIndex, false, styleSanitizer || null);\n } else {\n const singlePropStartPosition =\n detectedIndex + DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset;\n if (directiveRefs[singlePropStartPosition] ! >= 0) {\n // the directive has already been patched into the context\n return -1;\n }\n\n directiveIndex = detectedIndex / DirectiveRegistryValuesIndex.Size;\n\n // because the directive already existed this means that it was set during elementHostAttrs or\n // elementStart which means that the binding values were not here. Therefore, the values below\n // need to be applied so that single class and style properties can be assigned later.\n const singlePropPositionIndex =\n detectedIndex + DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset;\n directiveRefs[singlePropPositionIndex] = nextOffsetInsertionIndex;\n\n // the sanitizer is also apart of the binding process and will be used when bindings are\n // applied.\n const styleSanitizerIndex = detectedIndex + DirectiveRegistryValuesIndex.StyleSanitizerOffset;\n directiveRefs[styleSanitizerIndex] = styleSanitizer || null;\n }\n\n return directiveIndex;\n}\n\nfunction getMatchingBindingIndex(\n context: StylingContext, bindingName: string, start: number, end: number) {\n for (let j = start; j < end; j += StylingIndex.Size) {\n if (getProp(context, j) === bindingName) return j;\n }\n return -1;\n}\n\n/**\n * Sets and resolves all `multi` styling on an `StylingContext` so that they can be\n * applied to the element once `renderStyling` is called.\n *\n * All missing styles/class (any values that are not provided in the new `styles`\n * or `classes` params) will resolve to `null` within their respective positions\n * in the context.\n *\n * @param context The styling context that will be updated with the\n * newly provided style values.\n * @param classesInput The key/value map of CSS class names that will be used for the update.\n * @param stylesInput The key/value map of CSS styles that will be used for the update.\n */\nexport function updateStylingMap(\n context: StylingContext, classesInput: {[key: string]: any} | string |\n BoundPlayerFactory<null|string|{[key: string]: any}>| NO_CHANGE | null,\n stylesInput?: {[key: string]: any} | BoundPlayerFactory<null|{[key: string]: any}>| NO_CHANGE |\n null,\n directiveRef?: any): void {\n stylesInput = stylesInput || null;\n\n const directiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n const element = context[StylingIndex.ElementPosition] !as HTMLElement;\n const classesPlayerBuilder = classesInput instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(classesInput as any, element, BindingType.Class) :\n null;\n const stylesPlayerBuilder = stylesInput instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(stylesInput as any, element, BindingType.Style) :\n null;\n\n const classesValue = classesPlayerBuilder ?\n (classesInput as BoundPlayerFactory<{[key: string]: any}|string>) !.value :\n classesInput;\n const stylesValue = stylesPlayerBuilder ? stylesInput !['value'] : stylesInput;\n // early exit (this is what's done to avoid using ctx.bind() to cache the value)\n const ignoreAllClassUpdates = limitToSingleClasses(context) || classesValue === NO_CHANGE ||\n classesValue === context[StylingIndex.CachedClassValueOrInitialClassString];\n const ignoreAllStyleUpdates =\n stylesValue === NO_CHANGE || stylesValue === context[StylingIndex.CachedStyleValue];\n if (ignoreAllClassUpdates && ignoreAllStyleUpdates) return;\n\n context[StylingIndex.CachedClassValueOrInitialClassString] = classesValue;\n context[StylingIndex.CachedStyleValue] = stylesValue;\n\n let classNames: string[] = EMPTY_ARRAY;\n let applyAllClasses = false;\n let playerBuildersAreDirty = false;\n\n const classesPlayerBuilderIndex =\n classesPlayerBuilder ? PlayerIndex.ClassMapPlayerBuilderPosition : 0;\n if (hasPlayerBuilderChanged(\n context, classesPlayerBuilder, PlayerIndex.ClassMapPlayerBuilderPosition)) {\n setPlayerBuilder(context, classesPlayerBuilder, PlayerIndex.ClassMapPlayerBuilderPosition);\n playerBuildersAreDirty = true;\n }\n\n const stylesPlayerBuilderIndex =\n stylesPlayerBuilder ? PlayerIndex.StyleMapPlayerBuilderPosition : 0;\n if (hasPlayerBuilderChanged(\n context, stylesPlayerBuilder, PlayerIndex.StyleMapPlayerBuilderPosition)) {\n setPlayerBuilder(context, stylesPlayerBuilder, PlayerIndex.StyleMapPlayerBuilderPosition);\n playerBuildersAreDirty = true;\n }\n\n // each time a string-based value pops up then it shouldn't require a deep\n // check of what's changed.\n if (!ignoreAllClassUpdates) {\n if (typeof classesValue == 'string') {\n classNames = classesValue.split(/\\s+/);\n // this boolean is used to avoid having to create a key/value map of `true` values\n // since a classname string implies that all those classes are added\n applyAllClasses = true;\n } else {\n classNames = classesValue ? Object.keys(classesValue) : EMPTY_ARRAY;\n }\n }\n\n const classes = (classesValue || EMPTY_OBJ) as{[key: string]: any};\n const styleProps = stylesValue ? Object.keys(stylesValue) : EMPTY_ARRAY;\n const styles = stylesValue || EMPTY_OBJ;\n\n const classesStartIndex = styleProps.length;\n let multiStartIndex = getMultiStartIndex(context);\n\n let dirty = false;\n let ctxIndex = multiStartIndex;\n\n let propIndex = 0;\n const propLimit = styleProps.length + classNames.length;\n\n // the main loop here will try and figure out how the shape of the provided\n // styles differ with respect to the context. Later if the context/styles/classes\n // are off-balance then they will be dealt in another loop after this one\n while (ctxIndex < context.length && propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n\n // when there is a cache-hit for a string-based class then we should\n // avoid doing any work diffing any of the changes\n if (processValue) {\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const newProp: string =\n isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const newValue: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[newProp]) : styles[newProp];\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n\n const prop = getProp(context, ctxIndex);\n if (prop === newProp) {\n const value = getValue(context, ctxIndex);\n const flag = getPointers(context, ctxIndex);\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n\n if (hasValueChanged(flag, value, newValue)) {\n setValue(context, ctxIndex, newValue);\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n\n const initialValue = getInitialValue(context, flag);\n\n // SKIP IF INITIAL CHECK\n // If the former `value` is `null` then it means that an initial value\n // could be being rendered on screen. If that is the case then there is\n // no point in updating the value incase it matches. In other words if the\n // new value is the exact same as the previously rendered value (which\n // happens to be the initial value) then do nothing.\n if (value != null || hasValueChanged(flag, initialValue, newValue)) {\n setDirty(context, ctxIndex, true);\n dirty = true;\n }\n }\n } else {\n const indexOfEntry = findEntryPositionByProp(context, newProp, ctxIndex);\n if (indexOfEntry > 0) {\n // it was found at a later point ... just swap the values\n const valueToCompare = getValue(context, indexOfEntry);\n const flagToCompare = getPointers(context, indexOfEntry);\n swapMultiContextEntries(context, ctxIndex, indexOfEntry);\n if (hasValueChanged(flagToCompare, valueToCompare, newValue)) {\n const initialValue = getInitialValue(context, flagToCompare);\n setValue(context, ctxIndex, newValue);\n\n // same if statement logic as above (look for SKIP IF INITIAL CHECK).\n if (valueToCompare != null || hasValueChanged(flagToCompare, initialValue, newValue)) {\n setDirty(context, ctxIndex, true);\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n dirty = true;\n }\n }\n } else {\n // we only care to do this if the insertion is in the middle\n const newFlag = prepareInitialFlag(\n context, newProp, isClassBased, getStyleSanitizer(context, directiveIndex));\n playerBuildersAreDirty = playerBuildersAreDirty || !!playerBuilderIndex;\n insertNewMultiProperty(\n context, ctxIndex, isClassBased, newProp, newFlag, newValue, directiveIndex,\n playerBuilderIndex);\n dirty = true;\n }\n }\n }\n\n ctxIndex += StylingIndex.Size;\n propIndex++;\n }\n\n // this means that there are left-over values in the context that\n // were not included in the provided styles/classes and in this\n // case the goal is to \"remove\" them from the context (by nullifying)\n while (ctxIndex < context.length) {\n const flag = getPointers(context, ctxIndex);\n const isClassBased = (flag & StylingFlags.Class) === StylingFlags.Class;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n if (processValue) {\n const value = getValue(context, ctxIndex);\n const doRemoveValue = valueExists(value, isClassBased);\n if (doRemoveValue) {\n setDirty(context, ctxIndex, true);\n setValue(context, ctxIndex, null);\n\n // we keep the player factory the same so that the `nulled` value can\n // be instructed into the player because removing a style and/or a class\n // is a valid animation player instruction.\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n dirty = true;\n }\n }\n ctxIndex += StylingIndex.Size;\n }\n\n // this means that there are left-over properties in the context that\n // were not detected in the context during the loop above. In that\n // case we want to add the new entries into the list\n const sanitizer = getStyleSanitizer(context, directiveIndex);\n while (propIndex < propLimit) {\n const isClassBased = propIndex >= classesStartIndex;\n const processValue =\n (!isClassBased && !ignoreAllStyleUpdates) || (isClassBased && !ignoreAllClassUpdates);\n if (processValue) {\n const adjustedPropIndex = isClassBased ? propIndex - classesStartIndex : propIndex;\n const prop = isClassBased ? classNames[adjustedPropIndex] : styleProps[adjustedPropIndex];\n const value: string|boolean =\n isClassBased ? (applyAllClasses ? true : classes[prop]) : styles[prop];\n const flag = prepareInitialFlag(context, prop, isClassBased, sanitizer) | StylingFlags.Dirty;\n const playerBuilderIndex =\n isClassBased ? classesPlayerBuilderIndex : stylesPlayerBuilderIndex;\n const ctxIndex = context.length;\n context.push(flag, prop, value, 0);\n setPlayerBuilderIndex(context, ctxIndex, playerBuilderIndex, directiveIndex);\n dirty = true;\n }\n propIndex++;\n }\n\n if (dirty) {\n setContextDirty(context, true);\n setDirectiveDirty(context, directiveIndex, true);\n }\n\n if (playerBuildersAreDirty) {\n setContextPlayersDirty(context, true);\n }\n}\n\n/**\n * This method will toggle the referenced CSS class (by the provided index)\n * within the given context.\n *\n * @param context The styling context that will be updated with the\n * newly provided class value.\n * @param offset The index of the CSS class which is being updated.\n * @param addOrRemove Whether or not to add or remove the CSS class\n */\nexport function updateClassProp(\n context: StylingContext, offset: number, addOrRemove: boolean | BoundPlayerFactory<boolean>,\n directiveRef?: any): void {\n _updateSingleStylingValue(context, offset, addOrRemove, true, directiveRef);\n}\n\n/**\n * Sets and resolves a single style value on the provided `StylingContext` so\n * that they can be applied to the element once `renderStyling` is called.\n *\n * Note that prop-level styling values are considered higher priority than any styling that\n * has been applied using `updateStylingMap`, therefore, when styling values are rendered\n * then any styles/classes that have been applied using this function will be considered first\n * (then multi values second and then initial values as a backup).\n *\n * @param context The styling context that will be updated with the\n * newly provided style value.\n * @param offset The index of the property which is being updated.\n * @param value The CSS style value that will be assigned\n * @param directiveRef an optional reference to the directive responsible\n * for this binding change. If present then style binding will only\n * actualize if the directive has ownership over this binding\n * (see styling.ts#directives for more information about the algorithm).\n */\nexport function updateStyleProp(\n context: StylingContext, offset: number,\n input: string | boolean | null | BoundPlayerFactory<string|boolean|null>,\n directiveRef?: any): void {\n _updateSingleStylingValue(context, offset, input, false, directiveRef);\n}\n\nfunction _updateSingleStylingValue(\n context: StylingContext, offset: number,\n input: string | boolean | null | BoundPlayerFactory<string|boolean|null>, isClassBased: boolean,\n directiveRef: any): void {\n const directiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n const singleIndex = getSinglePropIndexValue(context, directiveIndex, offset, isClassBased);\n const currValue = getValue(context, singleIndex);\n const currFlag = getPointers(context, singleIndex);\n const currDirective = getDirectiveIndexFromEntry(context, singleIndex);\n const value: string|boolean|null = (input instanceof BoundPlayerFactory) ? input.value : input;\n\n if (hasValueChanged(currFlag, currValue, value) &&\n allowValueChange(currValue, value, currDirective, directiveIndex)) {\n const isClassBased = (currFlag & StylingFlags.Class) === StylingFlags.Class;\n const element = context[StylingIndex.ElementPosition] !as HTMLElement;\n const playerBuilder = input instanceof BoundPlayerFactory ?\n new ClassAndStylePlayerBuilder(\n input as any, element, isClassBased ? BindingType.Class : BindingType.Style) :\n null;\n const value = (playerBuilder ? (input as BoundPlayerFactory<any>).value : input) as string |\n boolean | null;\n const currPlayerIndex = getPlayerBuilderIndex(context, singleIndex);\n\n let playerBuildersAreDirty = false;\n let playerBuilderIndex = playerBuilder ? currPlayerIndex : 0;\n if (hasPlayerBuilderChanged(context, playerBuilder, currPlayerIndex)) {\n const newIndex = setPlayerBuilder(context, playerBuilder, currPlayerIndex);\n playerBuilderIndex = playerBuilder ? newIndex : 0;\n playerBuildersAreDirty = true;\n }\n\n if (playerBuildersAreDirty || currDirective !== directiveIndex) {\n setPlayerBuilderIndex(context, singleIndex, playerBuilderIndex, directiveIndex);\n }\n\n if (currDirective !== directiveIndex) {\n const prop = getProp(context, singleIndex);\n const sanitizer = getStyleSanitizer(context, directiveIndex);\n setSanitizeFlag(context, singleIndex, (sanitizer && sanitizer(prop)) ? true : false);\n }\n\n // the value will always get updated (even if the dirty flag is skipped)\n setValue(context, singleIndex, value);\n const indexForMulti = getMultiOrSingleIndex(currFlag);\n\n // if the value is the same in the multi-area then there's no point in re-assembling\n const valueForMulti = getValue(context, indexForMulti);\n if (!valueForMulti || hasValueChanged(currFlag, valueForMulti, value)) {\n let multiDirty = false;\n let singleDirty = true;\n\n // only when the value is set to `null` should the multi-value get flagged\n if (!valueExists(value, isClassBased) && valueExists(valueForMulti, isClassBased)) {\n multiDirty = true;\n singleDirty = false;\n }\n\n setDirty(context, indexForMulti, multiDirty);\n setDirty(context, singleIndex, singleDirty);\n setDirectiveDirty(context, directiveIndex, true);\n setContextDirty(context, true);\n }\n\n if (playerBuildersAreDirty) {\n setContextPlayersDirty(context, true);\n }\n }\n}\n\n\n/**\n * Renders all queued styling using a renderer onto the given element.\n *\n * This function works by rendering any styles (that have been applied\n * using `updateStylingMap`) and any classes (that have been applied using\n * `updateStyleProp`) onto the provided element using the provided renderer.\n * Just before the styles/classes are rendered a final key/value style map\n * will be assembled (if `styleStore` or `classStore` are provided).\n *\n * @param lElement the element that the styles will be rendered on\n * @param context The styling context that will be used to determine\n * what styles will be rendered\n * @param renderer the renderer that will be used to apply the styling\n * @param classesStore if provided, the updated class values will be applied\n * to this key/value map instead of being renderered via the renderer.\n * @param stylesStore if provided, the updated style values will be applied\n * to this key/value map instead of being renderered via the renderer.\n * @param directiveRef an optional directive that will be used to target which\n * styling values are rendered. If left empty, only the bindings that are\n * registered on the template will be rendered.\n * @returns number the total amount of players that got queued for animation (if any)\n */\nexport function renderStyling(\n context: StylingContext, renderer: Renderer3, rootOrView: RootContext | LView,\n isFirstRender: boolean, classesStore?: BindingStore | null, stylesStore?: BindingStore | null,\n directiveRef?: any): number {\n let totalPlayersQueued = 0;\n const targetDirectiveIndex = getDirectiveIndexFromRegistry(context, directiveRef || null);\n\n if (isContextDirty(context) && isDirectiveDirty(context, targetDirectiveIndex)) {\n const flushPlayerBuilders: any =\n context[StylingIndex.MasterFlagPosition] & StylingFlags.PlayerBuildersDirty;\n const native = context[StylingIndex.ElementPosition] !;\n const multiStartIndex = getMultiStartIndex(context);\n const onlySingleClasses = limitToSingleClasses(context);\n\n let stillDirty = false;\n for (let i = StylingIndex.SingleStylesStartPosition; i < context.length;\n i += StylingIndex.Size) {\n // there is no point in rendering styles that have not changed on screen\n if (isDirty(context, i)) {\n const flag = getPointers(context, i);\n const directiveIndex = getDirectiveIndexFromEntry(context, i);\n if (targetDirectiveIndex !== directiveIndex) {\n stillDirty = true;\n continue;\n }\n\n const prop = getProp(context, i);\n const value = getValue(context, i);\n const styleSanitizer =\n (flag & StylingFlags.Sanitize) ? getStyleSanitizer(context, directiveIndex) : null;\n const playerBuilder = getPlayerBuilder(context, i);\n const isClassBased = flag & StylingFlags.Class ? true : false;\n const isInSingleRegion = i < multiStartIndex;\n const readInitialValue = !isClassBased || !onlySingleClasses;\n\n let valueToApply: string|boolean|null = value;\n\n // VALUE DEFER CASE 1: Use a multi value instead of a null single value\n // this check implies that a single value was removed and we\n // should now defer to a multi value and use that (if set).\n if (isInSingleRegion && !valueExists(valueToApply, isClassBased)) {\n // single values ALWAYS have a reference to a multi index\n const multiIndex = getMultiOrSingleIndex(flag);\n valueToApply = getValue(context, multiIndex);\n }\n\n // VALUE DEFER CASE 2: Use the initial value if all else fails (is falsy)\n // the initial value will always be a string or null,\n // therefore we can safely adopt it incase there's nothing else\n // note that this should always be a falsy check since `false` is used\n // for both class and style comparisons (styles can't be false and false\n // classes are turned off and should therefore defer to their initial values)\n // Note that we ignore class-based deferals because otherwise a class can never\n // be removed in the case that it exists as true in the initial classes list...\n if (!isClassBased && !valueExists(valueToApply, isClassBased) && readInitialValue) {\n valueToApply = getInitialValue(context, flag);\n }\n\n // if the first render is true then we do not want to start applying falsy\n // values to the DOM element's styling. Otherwise then we know there has\n // been a change and even if it's falsy then it's removing something that\n // was truthy before.\n const doApplyValue = isFirstRender ? valueToApply : true;\n if (doApplyValue) {\n if (isClassBased) {\n setClass(\n native, prop, valueToApply ? true : false, renderer, classesStore, playerBuilder);\n } else {\n setStyle(\n native, prop, valueToApply as string | null, renderer, styleSanitizer, stylesStore,\n playerBuilder);\n }\n }\n\n setDirty(context, i, false);\n }\n }\n\n if (flushPlayerBuilders) {\n const rootContext =\n Array.isArray(rootOrView) ? getRootContext(rootOrView) : rootOrView as RootContext;\n const playerContext = getPlayerContext(context) !;\n const playersStartIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n for (let i = PlayerIndex.PlayerBuildersStartPosition; i < playersStartIndex;\n i += PlayerIndex.PlayerAndPlayerBuildersTupleSize) {\n const builder = playerContext[i] as ClassAndStylePlayerBuilder<any>| null;\n const playerInsertionIndex = i + PlayerIndex.PlayerOffsetPosition;\n const oldPlayer = playerContext[playerInsertionIndex] as Player | null;\n if (builder) {\n const player = builder.buildPlayer(oldPlayer, isFirstRender);\n if (player !== undefined) {\n if (player != null) {\n const wasQueued = addPlayerInternal(\n playerContext, rootContext, native as HTMLElement, player, playerInsertionIndex);\n wasQueued && totalPlayersQueued++;\n }\n if (oldPlayer) {\n oldPlayer.destroy();\n }\n }\n } else if (oldPlayer) {\n // the player builder has been removed ... therefore we should delete the associated\n // player\n oldPlayer.destroy();\n }\n }\n setContextPlayersDirty(context, false);\n }\n\n setDirectiveDirty(context, targetDirectiveIndex, false);\n setContextDirty(context, stillDirty);\n }\n\n return totalPlayersQueued;\n}\n\n/**\n * This function renders a given CSS prop/value entry using the\n * provided renderer. If a `store` value is provided then\n * that will be used a render context instead of the provided\n * renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nexport function setStyle(\n native: any, prop: string, value: string | null, renderer: Renderer3,\n sanitizer: StyleSanitizeFn | null, store?: BindingStore | null,\n playerBuilder?: ClassAndStylePlayerBuilder<any>| null) {\n value = sanitizer && value ? sanitizer(prop, value) : value;\n if (store || playerBuilder) {\n if (store) {\n store.setValue(prop, value);\n }\n if (playerBuilder) {\n playerBuilder.setValue(prop, value);\n }\n } else if (value) {\n value = value.toString(); // opacity, z-index and flexbox all have number values which may not\n // assign as numbers\n ngDevMode && ngDevMode.rendererSetStyle++;\n isProceduralRenderer(renderer) ?\n renderer.setStyle(native, prop, value, RendererStyleFlags3.DashCase) :\n native['style'].setProperty(prop, value);\n } else {\n ngDevMode && ngDevMode.rendererRemoveStyle++;\n isProceduralRenderer(renderer) ?\n renderer.removeStyle(native, prop, RendererStyleFlags3.DashCase) :\n native['style'].removeProperty(prop);\n }\n}\n\n/**\n * This function renders a given CSS class value using the provided\n * renderer (by adding or removing it from the provided element).\n * If a `store` value is provided then that will be used a render\n * context instead of the provided renderer.\n *\n * @param native the DOM Element\n * @param prop the CSS style property that will be rendered\n * @param value the CSS style value that will be rendered\n * @param renderer\n * @param store an optional key/value map that will be used as a context to render styles on\n */\nfunction setClass(\n native: any, className: string, add: boolean, renderer: Renderer3, store?: BindingStore | null,\n playerBuilder?: ClassAndStylePlayerBuilder<any>| null) {\n if (store || playerBuilder) {\n if (store) {\n store.setValue(className, add);\n }\n if (playerBuilder) {\n playerBuilder.setValue(className, add);\n }\n } else if (add) {\n ngDevMode && ngDevMode.rendererAddClass++;\n isProceduralRenderer(renderer) ? renderer.addClass(native, className) :\n native['classList'].add(className);\n } else {\n ngDevMode && ngDevMode.rendererRemoveClass++;\n isProceduralRenderer(renderer) ? renderer.removeClass(native, className) :\n native['classList'].remove(className);\n }\n}\n\nfunction setSanitizeFlag(context: StylingContext, index: number, sanitizeYes: boolean) {\n if (sanitizeYes) {\n (context[index] as number) |= StylingFlags.Sanitize;\n } else {\n (context[index] as number) &= ~StylingFlags.Sanitize;\n }\n}\n\nfunction setDirty(context: StylingContext, index: number, isDirtyYes: boolean) {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n if (isDirtyYes) {\n (context[adjustedIndex] as number) |= StylingFlags.Dirty;\n } else {\n (context[adjustedIndex] as number) &= ~StylingFlags.Dirty;\n }\n}\n\nfunction isDirty(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Dirty) == StylingFlags.Dirty;\n}\n\nexport function isClassBasedValue(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Class) == StylingFlags.Class;\n}\n\nfunction isSanitizable(context: StylingContext, index: number): boolean {\n const adjustedIndex =\n index >= StylingIndex.SingleStylesStartPosition ? (index + StylingIndex.FlagsOffset) : index;\n return ((context[adjustedIndex] as number) & StylingFlags.Sanitize) == StylingFlags.Sanitize;\n}\n\nfunction pointers(configFlag: number, staticIndex: number, dynamicIndex: number) {\n return (configFlag & StylingFlags.BitMask) | (staticIndex << StylingFlags.BitCountSize) |\n (dynamicIndex << (StylingIndex.BitCountSize + StylingFlags.BitCountSize));\n}\n\nfunction getInitialValue(context: StylingContext, flag: number): string|boolean|null {\n const index = getInitialIndex(flag);\n const entryIsClassBased = flag & StylingFlags.Class;\n const initialValues = entryIsClassBased ? context[StylingIndex.InitialClassValuesPosition] :\n context[StylingIndex.InitialStyleValuesPosition];\n return initialValues[index];\n}\n\nfunction getInitialIndex(flag: number): number {\n return (flag >> StylingFlags.BitCountSize) & StylingIndex.BitMask;\n}\n\nfunction getMultiOrSingleIndex(flag: number): number {\n const index =\n (flag >> (StylingIndex.BitCountSize + StylingFlags.BitCountSize)) & StylingIndex.BitMask;\n return index >= StylingIndex.SingleStylesStartPosition ? index : -1;\n}\n\nfunction getMultiStartIndex(context: StylingContext): number {\n return getMultiOrSingleIndex(context[StylingIndex.MasterFlagPosition]) as number;\n}\n\nfunction setProp(context: StylingContext, index: number, prop: string) {\n context[index + StylingIndex.PropertyOffset] = prop;\n}\n\nfunction setValue(context: StylingContext, index: number, value: string | null | boolean) {\n context[index + StylingIndex.ValueOffset] = value;\n}\n\nfunction hasPlayerBuilderChanged(\n context: StylingContext, builder: ClassAndStylePlayerBuilder<any>| null, index: number) {\n const playerContext = context[StylingIndex.PlayerContext] !;\n if (builder) {\n if (!playerContext || index === 0) {\n return true;\n }\n } else if (!playerContext) {\n return false;\n }\n return playerContext[index] !== builder;\n}\n\nfunction setPlayerBuilder(\n context: StylingContext, builder: ClassAndStylePlayerBuilder<any>| null,\n insertionIndex: number): number {\n let playerContext = context[StylingIndex.PlayerContext] || allocPlayerContext(context);\n if (insertionIndex > 0) {\n playerContext[insertionIndex] = builder;\n } else {\n insertionIndex = playerContext[PlayerIndex.NonBuilderPlayersStart];\n playerContext.splice(insertionIndex, 0, builder, null);\n playerContext[PlayerIndex.NonBuilderPlayersStart] +=\n PlayerIndex.PlayerAndPlayerBuildersTupleSize;\n }\n return insertionIndex;\n}\n\nexport function directiveOwnerPointers(directiveIndex: number, playerIndex: number) {\n return (playerIndex << DirectiveOwnerAndPlayerBuilderIndex.BitCountSize) | directiveIndex;\n}\n\nfunction setPlayerBuilderIndex(\n context: StylingContext, index: number, playerBuilderIndex: number, directiveIndex: number) {\n const value = directiveOwnerPointers(directiveIndex, playerBuilderIndex);\n context[index + StylingIndex.PlayerBuilderIndexOffset] = value;\n}\n\nfunction getPlayerBuilderIndex(context: StylingContext, index: number): number {\n const flag = context[index + StylingIndex.PlayerBuilderIndexOffset] as number;\n const playerBuilderIndex = (flag >> DirectiveOwnerAndPlayerBuilderIndex.BitCountSize) &\n DirectiveOwnerAndPlayerBuilderIndex.BitMask;\n return playerBuilderIndex;\n}\n\nfunction getPlayerBuilder(context: StylingContext, index: number): ClassAndStylePlayerBuilder<any>|\n null {\n const playerBuilderIndex = getPlayerBuilderIndex(context, index);\n if (playerBuilderIndex) {\n const playerContext = context[StylingIndex.PlayerContext];\n if (playerContext) {\n return playerContext[playerBuilderIndex] as ClassAndStylePlayerBuilder<any>| null;\n }\n }\n return null;\n}\n\nfunction setFlag(context: StylingContext, index: number, flag: number) {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n context[adjustedIndex] = flag;\n}\n\nfunction getPointers(context: StylingContext, index: number): number {\n const adjustedIndex =\n index === StylingIndex.MasterFlagPosition ? index : (index + StylingIndex.FlagsOffset);\n return context[adjustedIndex] as number;\n}\n\nexport function getValue(context: StylingContext, index: number): string|boolean|null {\n return context[index + StylingIndex.ValueOffset] as string | boolean | null;\n}\n\nexport function getProp(context: StylingContext, index: number): string {\n return context[index + StylingIndex.PropertyOffset] as string;\n}\n\nexport function isContextDirty(context: StylingContext): boolean {\n return isDirty(context, StylingIndex.MasterFlagPosition);\n}\n\nexport function limitToSingleClasses(context: StylingContext) {\n return context[StylingIndex.MasterFlagPosition] & StylingFlags.OnlyProcessSingleClasses;\n}\n\nexport function setContextDirty(context: StylingContext, isDirtyYes: boolean): void {\n setDirty(context, StylingIndex.MasterFlagPosition, isDirtyYes);\n}\n\nexport function setContextPlayersDirty(context: StylingContext, isDirtyYes: boolean): void {\n if (isDirtyYes) {\n (context[StylingIndex.MasterFlagPosition] as number) |= StylingFlags.PlayerBuildersDirty;\n } else {\n (context[StylingIndex.MasterFlagPosition] as number) &= ~StylingFlags.PlayerBuildersDirty;\n }\n}\n\nfunction findEntryPositionByProp(\n context: StylingContext, prop: string, startIndex?: number): number {\n for (let i = (startIndex || 0) + StylingIndex.PropertyOffset; i < context.length;\n i += StylingIndex.Size) {\n const thisProp = context[i];\n if (thisProp == prop) {\n return i - StylingIndex.PropertyOffset;\n }\n }\n return -1;\n}\n\nfunction swapMultiContextEntries(context: StylingContext, indexA: number, indexB: number) {\n const tmpValue = getValue(context, indexA);\n const tmpProp = getProp(context, indexA);\n const tmpFlag = getPointers(context, indexA);\n const tmpPlayerBuilderIndex = getPlayerBuilderIndex(context, indexA);\n\n let flagA = tmpFlag;\n let flagB = getPointers(context, indexB);\n\n const singleIndexA = getMultiOrSingleIndex(flagA);\n if (singleIndexA >= 0) {\n const _flag = getPointers(context, singleIndexA);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexA, pointers(_flag, _initial, indexB));\n }\n\n const singleIndexB = getMultiOrSingleIndex(flagB);\n if (singleIndexB >= 0) {\n const _flag = getPointers(context, singleIndexB);\n const _initial = getInitialIndex(_flag);\n setFlag(context, singleIndexB, pointers(_flag, _initial, indexA));\n }\n\n setValue(context, indexA, getValue(context, indexB));\n setProp(context, indexA, getProp(context, indexB));\n setFlag(context, indexA, getPointers(context, indexB));\n const playerIndexA = getPlayerBuilderIndex(context, indexB);\n const directiveIndexA = 0;\n setPlayerBuilderIndex(context, indexA, playerIndexA, directiveIndexA);\n\n setValue(context, indexB, tmpValue);\n setProp(context, indexB, tmpProp);\n setFlag(context, indexB, tmpFlag);\n setPlayerBuilderIndex(context, indexB, tmpPlayerBuilderIndex, directiveIndexA);\n}\n\nfunction updateSinglePointerValues(context: StylingContext, indexStartPosition: number) {\n for (let i = indexStartPosition; i < context.length; i += StylingIndex.Size) {\n const multiFlag = getPointers(context, i);\n const singleIndex = getMultiOrSingleIndex(multiFlag);\n if (singleIndex > 0) {\n const singleFlag = getPointers(context, singleIndex);\n const initialIndexForSingle = getInitialIndex(singleFlag);\n const flagValue = (isDirty(context, singleIndex) ? StylingFlags.Dirty : StylingFlags.None) |\n (isClassBasedValue(context, singleIndex) ? StylingFlags.Class : StylingFlags.None) |\n (isSanitizable(context, singleIndex) ? StylingFlags.Sanitize : StylingFlags.None);\n const updatedFlag = pointers(flagValue, initialIndexForSingle, i);\n setFlag(context, singleIndex, updatedFlag);\n }\n }\n}\n\nfunction insertNewMultiProperty(\n context: StylingContext, index: number, classBased: boolean, name: string, flag: number,\n value: string | boolean, directiveIndex: number, playerIndex: number): void {\n const doShift = index < context.length;\n\n // prop does not exist in the list, add it in\n context.splice(\n index, 0, flag | StylingFlags.Dirty | (classBased ? StylingFlags.Class : StylingFlags.None),\n name, value, 0);\n setPlayerBuilderIndex(context, index, playerIndex, directiveIndex);\n\n if (doShift) {\n // because the value was inserted midway into the array then we\n // need to update all the shifted multi values' single value\n // pointers to point to the newly shifted location\n updateSinglePointerValues(context, index + StylingIndex.Size);\n }\n}\n\nfunction valueExists(value: string | null | boolean, isClassBased?: boolean) {\n if (isClassBased) {\n return value ? true : false;\n }\n return value !== null;\n}\n\nfunction prepareInitialFlag(\n context: StylingContext, prop: string, entryIsClassBased: boolean,\n sanitizer?: StyleSanitizeFn | null) {\n let flag = (sanitizer && sanitizer(prop)) ? StylingFlags.Sanitize : StylingFlags.None;\n\n let initialIndex: number;\n if (entryIsClassBased) {\n flag |= StylingFlags.Class;\n initialIndex =\n getInitialStylingValuesIndexOf(context[StylingIndex.InitialClassValuesPosition], prop);\n } else {\n initialIndex =\n getInitialStylingValuesIndexOf(context[StylingIndex.InitialStyleValuesPosition], prop);\n }\n\n initialIndex = initialIndex > 0 ? (initialIndex + InitialStylingValuesIndex.ValueOffset) : 0;\n return pointers(flag, initialIndex, 0);\n}\n\nfunction hasValueChanged(\n flag: number, a: string | boolean | null, b: string | boolean | null): boolean {\n const isClassBased = flag & StylingFlags.Class;\n const hasValues = a && b;\n const usesSanitizer = flag & StylingFlags.Sanitize;\n // the toString() comparison ensures that a value is checked\n // ... otherwise (during sanitization bypassing) the === comparsion\n // would fail since a new String() instance is created\n if (!isClassBased && hasValues && usesSanitizer) {\n // we know for sure we're dealing with strings at this point\n return (a as string).toString() !== (b as string).toString();\n }\n\n // everything else is safe to check with a normal equality check\n return a !== b;\n}\n\nexport class ClassAndStylePlayerBuilder<T> implements PlayerBuilder {\n private _values: {[key: string]: string | null} = {};\n private _dirty = false;\n private _factory: BoundPlayerFactory<T>;\n\n constructor(factory: PlayerFactory, private _element: HTMLElement, private _type: BindingType) {\n this._factory = factory as any;\n }\n\n setValue(prop: string, value: any) {\n if (this._values[prop] !== value) {\n this._values[prop] = value;\n this._dirty = true;\n }\n }\n\n buildPlayer(currentPlayer: Player|null, isFirstRender: boolean): Player|undefined|null {\n // if no values have been set here then this means the binding didn't\n // change and therefore the binding values were not updated through\n // `setValue` which means no new player will be provided.\n if (this._dirty) {\n const player = this._factory.fn(\n this._element, this._type, this._values !, isFirstRender, currentPlayer || null);\n this._values = {};\n this._dirty = false;\n return player;\n }\n\n return undefined;\n }\n}\n\n/**\n * Used to provide a summary of the state of the styling context.\n *\n * This is an internal interface that is only used inside of test tooling to\n * help summarize what's going on within the styling context. None of this code\n * is designed to be exported publicly and will, therefore, be tree-shaken away\n * during runtime.\n */\nexport interface LogSummary {\n name: string; //\n staticIndex: number; //\n dynamicIndex: number; //\n value: number; //\n flags: {\n dirty: boolean; //\n class: boolean; //\n sanitize: boolean; //\n playerBuildersDirty: boolean; //\n onlyProcessSingleClasses: boolean; //\n bindingAllocationLocked: boolean; //\n };\n}\n\n/**\n * This function is not designed to be used in production.\n * It is a utility tool for debugging and testing and it\n * will automatically be tree-shaken away during production.\n */\nexport function generateConfigSummary(source: number): LogSummary;\nexport function generateConfigSummary(source: StylingContext): LogSummary;\nexport function generateConfigSummary(source: StylingContext, index: number): LogSummary;\nexport function generateConfigSummary(source: number | StylingContext, index?: number): LogSummary {\n let flag, name = 'config value for ';\n if (Array.isArray(source)) {\n if (index) {\n name += 'index: ' + index;\n } else {\n name += 'master config';\n }\n index = index || StylingIndex.MasterFlagPosition;\n flag = source[index] as number;\n } else {\n flag = source;\n name += 'index: ' + flag;\n }\n const dynamicIndex = getMultiOrSingleIndex(flag);\n const staticIndex = getInitialIndex(flag);\n return {\n name,\n staticIndex,\n dynamicIndex,\n value: flag,\n flags: {\n dirty: flag & StylingFlags.Dirty ? true : false,\n class: flag & StylingFlags.Class ? true : false,\n sanitize: flag & StylingFlags.Sanitize ? true : false,\n playerBuildersDirty: flag & StylingFlags.PlayerBuildersDirty ? true : false,\n onlyProcessSingleClasses: flag & StylingFlags.OnlyProcessSingleClasses ? true : false,\n bindingAllocationLocked: flag & StylingFlags.BindingAllocationLocked ? true : false,\n }\n };\n}\n\nexport function getDirectiveIndexFromEntry(context: StylingContext, index: number) {\n const value = context[index + StylingIndex.PlayerBuilderIndexOffset] as number;\n return value & DirectiveOwnerAndPlayerBuilderIndex.BitMask;\n}\n\nfunction getDirectiveIndexFromRegistry(context: StylingContext, directive: any) {\n const index =\n getDirectiveRegistryValuesIndexOf(context[StylingIndex.DirectiveRegistryPosition], directive);\n ngDevMode &&\n assertNotEqual(\n index, -1,\n `The provided directive ${directive} has not been allocated to the element\\'s style/class bindings`);\n return index > 0 ? index / DirectiveRegistryValuesIndex.Size : 0;\n // return index / DirectiveRegistryValuesIndex.Size;\n}\n\nfunction getDirectiveRegistryValuesIndexOf(\n directives: DirectiveRegistryValues, directive: {}): number {\n for (let i = 0; i < directives.length; i += DirectiveRegistryValuesIndex.Size) {\n if (directives[i] === directive) {\n return i;\n }\n }\n return -1;\n}\n\nfunction getInitialStylingValuesIndexOf(keyValues: InitialStylingValues, key: string): number {\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < keyValues.length;\n i += InitialStylingValuesIndex.Size) {\n if (keyValues[i] === key) return i;\n }\n return -1;\n}\n\nexport function compareLogSummaries(a: LogSummary, b: LogSummary) {\n const log: string[] = [];\n const diffs: [string, any, any][] = [];\n diffSummaryValues(diffs, 'staticIndex', 'staticIndex', a, b);\n diffSummaryValues(diffs, 'dynamicIndex', 'dynamicIndex', a, b);\n Object.keys(a.flags).forEach(\n name => { diffSummaryValues(diffs, 'flags.' + name, name, a.flags, b.flags); });\n\n if (diffs.length) {\n log.push('Log Summaries for:');\n log.push(' A: ' + a.name);\n log.push(' B: ' + b.name);\n log.push('\\n Differ in the following way (A !== B):');\n diffs.forEach(result => {\n const [name, aVal, bVal] = result;\n log.push(' => ' + name);\n log.push(' => ' + aVal + ' !== ' + bVal + '\\n');\n });\n }\n\n return log;\n}\n\nfunction diffSummaryValues(result: any[], name: string, prop: string, a: any, b: any) {\n const aVal = a[prop];\n const bVal = b[prop];\n if (aVal !== bVal) {\n result.push([name, aVal, bVal]);\n }\n}\n\nfunction getSinglePropIndexValue(\n context: StylingContext, directiveIndex: number, offset: number, isClassBased: boolean) {\n const singlePropOffsetRegistryIndex =\n context[StylingIndex.DirectiveRegistryPosition]\n [(directiveIndex * DirectiveRegistryValuesIndex.Size) +\n DirectiveRegistryValuesIndex.SinglePropValuesIndexOffset] as number;\n const offsets = context[StylingIndex.SinglePropOffsetPositions];\n const indexForOffset = singlePropOffsetRegistryIndex +\n SinglePropOffsetValuesIndex.ValueStartPosition +\n (isClassBased ?\n offsets\n [singlePropOffsetRegistryIndex + SinglePropOffsetValuesIndex.StylesCountPosition] :\n 0) +\n offset;\n return offsets[indexForOffset];\n}\n\nfunction getStyleSanitizer(context: StylingContext, directiveIndex: number): StyleSanitizeFn|null {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n const value = dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.StyleSanitizerOffset] ||\n dirs[DirectiveRegistryValuesIndex.StyleSanitizerOffset] || null;\n return value as StyleSanitizeFn | null;\n}\n\nfunction isDirectiveDirty(context: StylingContext, directiveIndex: number): boolean {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n return dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.DirtyFlagOffset] as boolean;\n}\n\nfunction setDirectiveDirty(\n context: StylingContext, directiveIndex: number, dirtyYes: boolean): void {\n const dirs = context[StylingIndex.DirectiveRegistryPosition];\n dirs\n [directiveIndex * DirectiveRegistryValuesIndex.Size +\n DirectiveRegistryValuesIndex.DirtyFlagOffset] = dirtyYes;\n}\n\nfunction allowValueChange(\n currentValue: string | boolean | null, newValue: string | boolean | null,\n currentDirectiveOwner: number, newDirectiveOwner: number) {\n // the code below relies the importance of directive's being tied to their\n // index value. The index values for each directive are derived from being\n // registered into the styling context directive registry. The most important\n // directive is the parent component directive (the template) and each directive\n // that is added after is considered less important than the previous entry. This\n // prioritization of directives enables the styling algorithm to decide if a style\n // or class should be allowed to be updated/replaced incase an earlier directive\n // already wrote to the exact same style-property or className value. In other words\n // ... this decides what to do if and when there is a collision.\n if (currentValue) {\n if (newValue) {\n // if a directive index is lower than it always has priority over the\n // previous directive's value...\n return newDirectiveOwner <= currentDirectiveOwner;\n } else {\n // only write a null value incase it's the same owner writing it.\n // this avoids having a higher-priority directive write to null\n // only to have a lesser-priority directive change right to a\n // non-null value immediately afterwards.\n return currentDirectiveOwner === newDirectiveOwner;\n }\n }\n return true;\n}\n\n/**\n * This function is only designed to be called for `[class]` bindings when\n * `[ngClass]` (or something that uses `class` as an input) is present. Once\n * directive host bindings fully work for `[class]` and `[style]` inputs\n * then this can be deleted.\n */\nexport function getInitialClassNameValue(context: StylingContext): string {\n let className = context[StylingIndex.CachedClassValueOrInitialClassString] as string;\n if (className == null) {\n className = '';\n const initialClassValues = context[StylingIndex.InitialClassValuesPosition];\n for (let i = InitialStylingValuesIndex.KeyValueStartPosition; i < initialClassValues.length;\n i += InitialStylingValuesIndex.Size) {\n const isPresent = initialClassValues[i + 1];\n if (isPresent) {\n className += (className.length ? ' ' : '') + initialClassValues[i];\n }\n }\n context[StylingIndex.CachedClassValueOrInitialClassString] = className;\n }\n return className;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {QueryList} from '../linker';\nimport {Sanitizer} from '../sanitization/security';\nimport {StyleSanitizeFn} from '../sanitization/style_sanitizer';\nimport {Type} from '../type';\nimport {normalizeDebugBindingName, normalizeDebugBindingValue} from '../util/ng_reflect';\n\nimport {assertDataInRange, assertDefined, assertEqual, assertHasParent, assertLessThan, assertNotEqual, assertPreviousIsParent} from './assert';\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4} from './bindings';\nimport {attachPatchData, getComponentViewByInstance} from './context_discovery';\nimport {diPublicInInjector, getNodeInjectable, getOrCreateInjectable, getOrCreateNodeInjectorForNode, injectAttributeImpl} from './di';\nimport {throwMultipleComponentError} from './errors';\nimport {executeHooks, executeInitHooks, queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {ACTIVE_INDEX, LContainer, VIEWS} from './interfaces/container';\nimport {ComponentDef, ComponentQuery, ComponentTemplate, DirectiveDef, DirectiveDefListOrFactory, PipeDefListOrFactory, RenderFlags} from './interfaces/definition';\nimport {INJECTOR_BLOOM_PARENT_SIZE, NodeInjectorFactory} from './interfaces/injector';\nimport {AttributeMarker, InitialInputData, InitialInputs, LocalRefExtractor, PropertyAliasValue, PropertyAliases, TAttributes, TContainerNode, TElementContainerNode, TElementNode, TIcuContainerNode, TNode, TNodeFlags, TNodeProviderIndexes, TNodeType, TProjectionNode, TViewNode} from './interfaces/node';\nimport {PlayerFactory} from './interfaces/player';\nimport {CssSelectorList, NG_PROJECT_AS_ATTR_NAME} from './interfaces/projection';\nimport {LQueries} from './interfaces/query';\nimport {ProceduralRenderer3, RComment, RElement, RText, Renderer3, RendererFactory3, isProceduralRenderer} from './interfaces/renderer';\nimport {SanitizerFn} from './interfaces/sanitization';\nimport {BINDING_INDEX, CLEANUP, CONTAINER_INDEX, CONTENT_QUERIES, CONTEXT, DECLARATION_VIEW, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, INJECTOR, LView, LViewFlags, NEXT, OpaqueViewState, PARENT, QUERIES, RENDERER, RENDERER_FACTORY, RootContext, RootContextFlags, SANITIZER, TAIL, TVIEW, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes, assertNodeType} from './node_assert';\nimport {appendChild, appendProjectedNode, createTextNode, getLViewChild, getRenderParent, insertView, removeView} from './node_manipulation';\nimport {isNodeMatchingSelectorList, matchingSelectorIndex} from './node_selector_matcher';\nimport {decreaseElementDepthCount, enterView, getBindingsEnabled, getCheckNoChangesMode, getContextLView, getCurrentDirectiveDef, getElementDepthCount, getFirstTemplatePass, getIsParent, getLView, getPreviousOrParentTNode, increaseElementDepthCount, isCreationMode, leaveView, nextContextImpl, resetComponentState, setBindingRoot, setCheckNoChangesMode, setCurrentDirectiveDef, setFirstTemplatePass, setIsParent, setPreviousOrParentTNode} from './state';\nimport {getInitialClassNameValue, initializeStaticContext as initializeStaticStylingContext, patchContextWithStaticAttrs, renderInitialStylesAndClasses, renderStyling, updateClassProp as updateElementClassProp, updateContextWithBindings, updateStyleProp as updateElementStyleProp, updateStylingMap} from './styling/class_and_style_bindings';\nimport {BoundPlayerFactory} from './styling/player_factory';\nimport {createEmptyStylingContext, getStylingContext, hasClassInput, hasStyling, isAnimationProp} from './styling/util';\nimport {NO_CHANGE} from './tokens';\nimport {findComponentView, getComponentViewByIndex, getNativeByIndex, getNativeByTNode, getRootContext, getRootView, getTNode, isComponent, isComponentDef, loadInternal, readElementValue, readPatchedLView, stringify} from './util';\n\n\n\n/**\n * A permanent marker promise which signifies that the current CD tree is\n * clean.\n */\nconst _CLEAN_PROMISE = Promise.resolve(null);\n\nconst enum BindingDirection {\n Input,\n Output,\n}\n\n/**\n * Refreshes the view, executing the following steps in that order:\n * triggers init hooks, refreshes dynamic embedded views, triggers content hooks, sets host\n * bindings, refreshes child components.\n * Note: view hooks are triggered later when leaving the view.\n */\nexport function refreshDescendantViews(lView: LView) {\n const tView = lView[TVIEW];\n // This needs to be set before children are processed to support recursive components\n tView.firstTemplatePass = false;\n setFirstTemplatePass(false);\n\n // If this is a creation pass, we should not call lifecycle hooks or evaluate bindings.\n // This will be done in the update pass.\n if (!isCreationMode(lView)) {\n const checkNoChangesMode = getCheckNoChangesMode();\n\n executeInitHooks(lView, tView, checkNoChangesMode);\n\n refreshDynamicEmbeddedViews(lView);\n\n // Content query results must be refreshed before content hooks are called.\n refreshContentQueries(tView);\n\n executeHooks(lView, tView.contentHooks, tView.contentCheckHooks, checkNoChangesMode);\n\n setHostBindings(tView, lView);\n }\n\n refreshChildComponents(tView.components);\n}\n\n\n/** Sets the host bindings for the current view. */\nexport function setHostBindings(tView: TView, viewData: LView): void {\n if (tView.expandoInstructions) {\n let bindingRootIndex = viewData[BINDING_INDEX] = tView.expandoStartIndex;\n setBindingRoot(bindingRootIndex);\n let currentDirectiveIndex = -1;\n let currentElementIndex = -1;\n for (let i = 0; i < tView.expandoInstructions.length; i++) {\n const instruction = tView.expandoInstructions[i];\n if (typeof instruction === 'number') {\n if (instruction <= 0) {\n // Negative numbers mean that we are starting new EXPANDO block and need to update\n // the current element and directive index.\n currentElementIndex = -instruction;\n // Injector block and providers are taken into account.\n const providerCount = (tView.expandoInstructions[++i] as number);\n bindingRootIndex += INJECTOR_BLOOM_PARENT_SIZE + providerCount;\n\n currentDirectiveIndex = bindingRootIndex;\n } else {\n // This is either the injector size (so the binding root can skip over directives\n // and get to the first set of host bindings on this node) or the host var count\n // (to get to the next set of host bindings on this node).\n bindingRootIndex += instruction;\n }\n setBindingRoot(bindingRootIndex);\n } else {\n // If it's not a number, it's a host binding function that needs to be executed.\n if (instruction !== null) {\n viewData[BINDING_INDEX] = bindingRootIndex;\n instruction(\n RenderFlags.Update, readElementValue(viewData[currentDirectiveIndex]),\n currentElementIndex);\n }\n currentDirectiveIndex++;\n }\n }\n }\n}\n\n/** Refreshes content queries for all directives in the given view. */\nfunction refreshContentQueries(tView: TView): void {\n if (tView.contentQueries != null) {\n for (let i = 0; i < tView.contentQueries.length; i += 2) {\n const directiveDefIdx = tView.contentQueries[i];\n const directiveDef = tView.data[directiveDefIdx] as DirectiveDef<any>;\n\n directiveDef.contentQueriesRefresh !(\n directiveDefIdx - HEADER_OFFSET, tView.contentQueries[i + 1]);\n }\n }\n}\n\n/** Refreshes child components in the current view. */\nfunction refreshChildComponents(components: number[] | null): void {\n if (components != null) {\n for (let i = 0; i < components.length; i++) {\n componentRefresh(components[i]);\n }\n }\n}\n\nexport function createLView<T>(\n parentLView: LView | null, tView: TView, context: T | null, flags: LViewFlags,\n rendererFactory?: RendererFactory3 | null, renderer?: Renderer3 | null,\n sanitizer?: Sanitizer | null, injector?: Injector | null): LView {\n const lView = tView.blueprint.slice() as LView;\n lView[FLAGS] = flags | LViewFlags.CreationMode | LViewFlags.Attached | LViewFlags.RunInit |\n LViewFlags.FirstLViewPass;\n lView[PARENT] = lView[DECLARATION_VIEW] = parentLView;\n lView[CONTEXT] = context;\n lView[RENDERER_FACTORY] = (rendererFactory || parentLView && parentLView[RENDERER_FACTORY]) !;\n ngDevMode && assertDefined(lView[RENDERER_FACTORY], 'RendererFactory is required');\n lView[RENDERER] = (renderer || parentLView && parentLView[RENDERER]) !;\n ngDevMode && assertDefined(lView[RENDERER], 'Renderer is required');\n lView[SANITIZER] = sanitizer || parentLView && parentLView[SANITIZER] || null !;\n lView[INJECTOR as any] = injector || parentLView && parentLView[INJECTOR] || null;\n return lView;\n}\n\n/**\n * Create and stores the TNode, and hooks it up to the tree.\n *\n * @param index The index at which the TNode should be saved (null if view, since they are not\n * saved).\n * @param type The type of TNode to create\n * @param native The native element for this node, if applicable\n * @param name The tag name of the associated native element, if applicable\n * @param attrs Any attrs for the native element, if applicable\n */\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Element, native: RElement | RText | null, name: string | null,\n attrs: TAttributes | null): TElementNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Container, native: RComment, name: string | null,\n attrs: TAttributes | null): TContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.Projection, native: null, name: null,\n attrs: TAttributes | null): TProjectionNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.ElementContainer, native: RComment, name: string | null,\n attrs: TAttributes | null): TElementContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType.IcuContainer, native: RComment, name: null,\n attrs: TAttributes | null): TElementContainerNode;\nexport function createNodeAtIndex(\n index: number, type: TNodeType, native: RText | RElement | RComment | null, name: string | null,\n attrs: TAttributes | null): TElementNode&TContainerNode&TElementContainerNode&TProjectionNode&\n TIcuContainerNode {\n const lView = getLView();\n const tView = lView[TVIEW];\n const adjustedIndex = index + HEADER_OFFSET;\n ngDevMode &&\n assertLessThan(adjustedIndex, lView.length, `Slot should have been initialized with null`);\n lView[adjustedIndex] = native;\n\n let tNode = tView.data[adjustedIndex] as TNode;\n if (tNode == null) {\n // TODO(misko): Refactor createTNode so that it does not depend on LView.\n tNode = tView.data[adjustedIndex] = createTNode(lView, type, adjustedIndex, name, attrs, null);\n }\n\n // Now link ourselves into the tree.\n // We need this even if tNode exists, otherwise we might end up pointing to unexisting tNodes when\n // we use i18n (especially with ICU expressions that update the DOM during the update phase).\n const previousOrParentTNode = getPreviousOrParentTNode();\n const isParent = getIsParent();\n if (previousOrParentTNode) {\n if (isParent && previousOrParentTNode.child == null &&\n (tNode.parent !== null || previousOrParentTNode.type === TNodeType.View)) {\n // We are in the same view, which means we are adding content node to the parent view.\n previousOrParentTNode.child = tNode;\n } else if (!isParent) {\n previousOrParentTNode.next = tNode;\n }\n }\n\n if (tView.firstChild == null) {\n tView.firstChild = tNode;\n }\n\n setPreviousOrParentTNode(tNode);\n setIsParent(true);\n return tNode as TElementNode & TViewNode & TContainerNode & TElementContainerNode &\n TProjectionNode & TIcuContainerNode;\n}\n\nexport function createViewNode(index: number, view: LView) {\n // View nodes are not stored in data because they can be added / removed at runtime (which\n // would cause indices to change). Their TNodes are instead stored in tView.node.\n if (view[TVIEW].node == null) {\n view[TVIEW].node = createTNode(view, TNodeType.View, index, null, null, null) as TViewNode;\n }\n\n return view[HOST_NODE] = view[TVIEW].node as TViewNode;\n}\n\n\n/**\n * When elements are created dynamically after a view blueprint is created (e.g. through\n * i18nApply() or ComponentFactory.create), we need to adjust the blueprint for future\n * template passes.\n */\nexport function allocExpando(view: LView) {\n const tView = view[TVIEW];\n if (tView.firstTemplatePass) {\n tView.expandoStartIndex++;\n tView.blueprint.push(null);\n tView.data.push(null);\n view.push(null);\n }\n}\n\n\n//////////////////////////\n//// Render\n//////////////////////////\n\n/**\n *\n * @param hostNode Existing node to render into.\n * @param templateFn Template function with the instructions.\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param context to pass into the template.\n * @param providedRendererFactory renderer factory to use\n * @param host The host element node to use\n * @param directives Directive defs that should be used for matching\n * @param pipes Pipe defs that should be used for matching\n */\nexport function renderTemplate<T>(\n hostNode: RElement, templateFn: ComponentTemplate<T>, consts: number, vars: number, context: T,\n providedRendererFactory: RendererFactory3, hostView: LView | null,\n directives?: DirectiveDefListOrFactory | null, pipes?: PipeDefListOrFactory | null,\n sanitizer?: Sanitizer | null): LView {\n if (hostView == null) {\n resetComponentState();\n const renderer = providedRendererFactory.createRenderer(null, null);\n\n // We need to create a root view so it's possible to look up the host element through its index\n const hostLView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), {},\n LViewFlags.CheckAlways | LViewFlags.IsRoot, providedRendererFactory, renderer);\n enterView(hostLView, null); // SUSPECT! why do we need to enter the View?\n\n const componentTView =\n getOrCreateTView(templateFn, consts, vars, directives || null, pipes || null, null);\n hostView = createLView(\n hostLView, componentTView, context, LViewFlags.CheckAlways, providedRendererFactory,\n renderer, sanitizer);\n hostView[HOST_NODE] = createNodeAtIndex(0, TNodeType.Element, hostNode, null, null);\n }\n renderComponentOrTemplate(hostView, context, templateFn);\n return hostView;\n}\n\n/**\n * Used for creating the LViewNode of a dynamic embedded view,\n * either through ViewContainerRef.createEmbeddedView() or TemplateRef.createEmbeddedView().\n * Such lViewNode will then be renderer with renderEmbeddedTemplate() (see below).\n */\nexport function createEmbeddedViewAndNode<T>(\n tView: TView, context: T, declarationView: LView, renderer: Renderer3, queries: LQueries | null,\n injectorIndex: number): LView {\n const _isParent = getIsParent();\n const _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n\n const lView = createLView(declarationView, tView, context, LViewFlags.CheckAlways);\n lView[DECLARATION_VIEW] = declarationView;\n\n if (queries) {\n lView[QUERIES] = queries.createView();\n }\n createViewNode(-1, lView);\n\n if (tView.firstTemplatePass) {\n tView.node !.injectorIndex = injectorIndex;\n }\n\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n return lView;\n}\n\n/**\n * Used for rendering embedded views (e.g. dynamically created views)\n *\n * Dynamically created views must store/retrieve their TViews differently from component views\n * because their template functions are nested in the template functions of their hosts, creating\n * closures. If their host template happens to be an embedded template in a loop (e.g. ngFor inside\n * an ngFor), the nesting would mean we'd have multiple instances of the template function, so we\n * can't store TViews in the template function itself (as we do for comps). Instead, we store the\n * TView for dynamically created views on their host TNode, which only has one instance.\n */\nexport function renderEmbeddedTemplate<T>(viewToRender: LView, tView: TView, context: T) {\n const _isParent = getIsParent();\n const _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n let oldView: LView;\n if (viewToRender[FLAGS] & LViewFlags.IsRoot) {\n // This is a root view inside the view tree\n tickRootContext(getRootContext(viewToRender));\n } else {\n try {\n setIsParent(true);\n setPreviousOrParentTNode(null !);\n\n oldView = enterView(viewToRender, viewToRender[HOST_NODE]);\n namespaceHTML();\n tView.template !(getRenderFlags(viewToRender), context);\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstTemplatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n viewToRender[TVIEW].firstTemplatePass = false;\n setFirstTemplatePass(false);\n\n refreshDescendantViews(viewToRender);\n } finally {\n leaveView(oldView !);\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n }\n }\n}\n\n/**\n * Retrieves a context at the level specified and saves it as the global, contextViewData.\n * Will get the next level up if level is not specified.\n *\n * This is used to save contexts of parent views so they can be bound in embedded views, or\n * in conjunction with reference() to bind a ref from a parent view.\n *\n * @param level The relative level of the view from which to grab context compared to contextVewData\n * @returns context\n */\nexport function nextContext<T = any>(level: number = 1): T {\n return nextContextImpl(level);\n}\n\nfunction renderComponentOrTemplate<T>(\n hostView: LView, context: T, templateFn?: ComponentTemplate<T>) {\n const rendererFactory = hostView[RENDERER_FACTORY];\n const oldView = enterView(hostView, hostView[HOST_NODE]);\n const normalExecutionPath = !getCheckNoChangesMode();\n try {\n if (normalExecutionPath && rendererFactory.begin) {\n rendererFactory.begin();\n }\n\n if (isCreationMode(hostView)) {\n // creation mode pass\n if (templateFn) {\n namespaceHTML();\n templateFn(RenderFlags.Create, context !);\n }\n\n refreshDescendantViews(hostView);\n hostView[FLAGS] &= ~LViewFlags.CreationMode;\n }\n\n // update mode pass\n templateFn && templateFn(RenderFlags.Update, context !);\n refreshDescendantViews(hostView);\n } finally {\n if (normalExecutionPath && rendererFactory.end) {\n rendererFactory.end();\n }\n leaveView(oldView);\n }\n}\n\n/**\n * This function returns the default configuration of rendering flags depending on when the\n * template is in creation mode or update mode. Update block and create block are\n * always run separately.\n */\nfunction getRenderFlags(view: LView): RenderFlags {\n return isCreationMode(view) ? RenderFlags.Create : RenderFlags.Update;\n}\n\n//////////////////////////\n//// Namespace\n//////////////////////////\n\nlet _currentNamespace: string|null = null;\n\nexport function namespaceSVG() {\n _currentNamespace = 'http://www.w3.org/2000/svg';\n}\n\nexport function namespaceMathML() {\n _currentNamespace = 'http://www.w3.org/1998/MathML/';\n}\n\nexport function namespaceHTML() {\n _currentNamespace = null;\n}\n\n//////////////////////////\n//// Element\n//////////////////////////\n\n/**\n * Creates an empty element using {@link elementStart} and {@link elementEnd}\n *\n * @param index Index of the element in the data array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM\n * element on creation. Use [AttributeMarker] to denote the meaning of this array.\n * @param localRefs A set of local reference bindings on the element.\n */\nexport function element(\n index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n elementStart(index, name, attrs, localRefs);\n elementEnd();\n}\n\n/**\n * Creates a logical container for other nodes (<ng-container>) backed by a comment node in the DOM.\n * The instruction must later be followed by `elementContainerEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param attrs Set of attributes to be used when matching directives.\n * @param localRefs A set of local reference bindings on the element.\n *\n * Even if this instruction accepts a set of attributes no actual attribute values are propagated to\n * the DOM (as a comment node can't have attributes). Attributes are here only for directive\n * matching purposes and setting initial inputs of directives.\n */\nexport function elementContainerStart(\n index: number, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n const renderer = lView[RENDERER];\n const tagName = 'ng-container';\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], tView.bindingStartIndex,\n 'element containers should be created before any bindings');\n\n ngDevMode && ngDevMode.rendererCreateComment++;\n const native = renderer.createComment(ngDevMode ? tagName : '');\n\n ngDevMode && assertDataInRange(lView, index - 1);\n const tNode =\n createNodeAtIndex(index, TNodeType.ElementContainer, native, tagName, attrs || null);\n\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n attachPatchData(native, lView);\n}\n\n/** Mark the end of the <ng-container>. */\nexport function elementContainerEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n const lView = getLView();\n const tView = lView[TVIEW];\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.ElementContainer);\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TElementContainerNode);\n }\n\n queueLifecycleHooks(tView, previousOrParentTNode);\n}\n\n/**\n * Create DOM element. The instruction must later be followed by `elementEnd()` call.\n *\n * @param index Index of the element in the LView array\n * @param name Name of the DOM Node\n * @param attrs Statically bound set of attributes, classes, and styles to be written into the DOM\n * element on creation. Use [AttributeMarker] to denote the meaning of this array.\n * @param localRefs A set of local reference bindings on the element.\n *\n * Attributes and localRefs are passed as an array of strings where elements with an even index\n * hold an attribute name and elements with an odd index hold an attribute value, ex.:\n * ['id', 'warning5', 'class', 'alert']\n */\nexport function elementStart(\n index: number, name: string, attrs?: TAttributes | null, localRefs?: string[] | null): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], tView.bindingStartIndex,\n 'elements should be created before any bindings ');\n\n ngDevMode && ngDevMode.rendererCreateElement++;\n\n const native = elementCreate(name);\n\n ngDevMode && assertDataInRange(lView, index - 1);\n\n const tNode = createNodeAtIndex(index, TNodeType.Element, native !, name, attrs || null);\n\n if (attrs) {\n // it's important to only prepare styling-related datastructures once for a given\n // tNode and not each time an element is created. Also, the styling code is designed\n // to be patched and constructed at various points, but only up until the first element\n // is created. Then the styling context is locked and can only be instantiated for each\n // successive element that is created.\n if (tView.firstTemplatePass && !tNode.stylingTemplate && hasStyling(attrs)) {\n tNode.stylingTemplate = initializeStaticStylingContext(attrs);\n }\n setUpAttributes(native, attrs);\n }\n\n appendChild(native, tNode, lView);\n createDirectivesAndLocals(tView, lView, localRefs);\n\n // any immediate children of a component or template container must be pre-emptively\n // monkey-patched with the component view data so that the element can be inspected\n // later on using any element discovery utility methods (see `element_discovery.ts`)\n if (getElementDepthCount() === 0) {\n attachPatchData(native, lView);\n }\n increaseElementDepthCount();\n\n // if a directive contains a host binding for \"class\" then all class-based data will\n // flow through that (except for `[class.prop]` bindings). This also includes initial\n // static class values as well. (Note that this will be fixed once map-based `[style]`\n // and `[class]` bindings work for multiple directives.)\n if (tView.firstTemplatePass) {\n const inputData = initializeTNodeInputs(tNode);\n if (inputData && inputData.hasOwnProperty('class')) {\n tNode.flags |= TNodeFlags.hasClassInput;\n }\n }\n\n // There is no point in rendering styles when a class directive is present since\n // it will take that over for us (this will be removed once #FW-882 is in).\n if (tNode.stylingTemplate && (tNode.flags & TNodeFlags.hasClassInput) === 0) {\n renderInitialStylesAndClasses(native, tNode.stylingTemplate, lView[RENDERER]);\n }\n}\n\n/**\n * Creates a native element from a tag name, using a renderer.\n * @param name the tag name\n * @param overriddenRenderer Optional A renderer to override the default one\n * @returns the element created\n */\nexport function elementCreate(name: string, overriddenRenderer?: Renderer3): RElement {\n let native: RElement;\n const rendererToUse = overriddenRenderer || getLView()[RENDERER];\n\n if (isProceduralRenderer(rendererToUse)) {\n native = rendererToUse.createElement(name, _currentNamespace);\n } else {\n if (_currentNamespace === null) {\n native = rendererToUse.createElement(name);\n } else {\n native = rendererToUse.createElementNS(_currentNamespace, name);\n }\n }\n return native;\n}\n\n/**\n * Creates directive instances and populates local refs.\n *\n * @param localRefs Local refs of the node in question\n * @param localRefExtractor mapping function that extracts local ref value from TNode\n */\nfunction createDirectivesAndLocals(\n tView: TView, viewData: LView, localRefs: string[] | null | undefined,\n localRefExtractor: LocalRefExtractor = getNativeByTNode) {\n if (!getBindingsEnabled()) return;\n const previousOrParentTNode = getPreviousOrParentTNode();\n if (getFirstTemplatePass()) {\n ngDevMode && ngDevMode.firstTemplatePass++;\n\n resolveDirectives(\n tView, viewData, findDirectiveMatches(tView, viewData, previousOrParentTNode),\n previousOrParentTNode, localRefs || null);\n }\n instantiateAllDirectives(tView, viewData, previousOrParentTNode);\n invokeDirectivesHostBindings(tView, viewData, previousOrParentTNode);\n saveResolvedLocalsInData(viewData, previousOrParentTNode, localRefExtractor);\n}\n\n/**\n * Takes a list of local names and indices and pushes the resolved local variable values\n * to LView in the same order as they are loaded in the template with load().\n */\nfunction saveResolvedLocalsInData(\n viewData: LView, tNode: TNode, localRefExtractor: LocalRefExtractor): void {\n const localNames = tNode.localNames;\n if (localNames) {\n let localIndex = tNode.index + 1;\n for (let i = 0; i < localNames.length; i += 2) {\n const index = localNames[i + 1] as number;\n const value = index === -1 ?\n localRefExtractor(\n tNode as TElementNode | TContainerNode | TElementContainerNode, viewData) :\n viewData[index];\n viewData[localIndex++] = value;\n }\n }\n}\n\n/**\n * Gets TView from a template function or creates a new TView\n * if it doesn't already exist.\n *\n * @param templateFn The template from which to get static data\n * @param consts The number of nodes, local refs, and pipes in this view\n * @param vars The number of bindings and pure function bindings in this view\n * @param directives Directive defs that should be saved on TView\n * @param pipes Pipe defs that should be saved on TView\n * @returns TView\n */\nexport function getOrCreateTView(\n templateFn: ComponentTemplate<any>, consts: number, vars: number,\n directives: DirectiveDefListOrFactory | null, pipes: PipeDefListOrFactory | null,\n viewQuery: ComponentQuery<any>| null): TView {\n // TODO(misko): reading `ngPrivateData` here is problematic for two reasons\n // 1. It is a megamorphic call on each invocation.\n // 2. For nested embedded views (ngFor inside ngFor) the template instance is per\n // outer template invocation, which means that no such property will exist\n // Correct solution is to only put `ngPrivateData` on the Component template\n // and not on embedded templates.\n\n return templateFn.ngPrivateData ||\n (templateFn.ngPrivateData =\n createTView(-1, templateFn, consts, vars, directives, pipes, viewQuery) as never);\n}\n\n/**\n * Creates a TView instance\n *\n * @param viewIndex The viewBlockId for inline views, or -1 if it's a component/dynamic\n * @param templateFn Template function\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param directives Registry of directives for this view\n * @param pipes Registry of pipes for this view\n */\nexport function createTView(\n viewIndex: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,\n directives: DirectiveDefListOrFactory | null, pipes: PipeDefListOrFactory | null,\n viewQuery: ComponentQuery<any>| null): TView {\n ngDevMode && ngDevMode.tView++;\n const bindingStartIndex = HEADER_OFFSET + consts;\n // This length does not yet contain host bindings from child directives because at this point,\n // we don't know which directives are active on this template. As soon as a directive is matched\n // that has a host binding, we will update the blueprint with that def's hostVars count.\n const initialViewLength = bindingStartIndex + vars;\n const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength);\n return blueprint[TVIEW as any] = {\n id: viewIndex,\n blueprint: blueprint,\n template: templateFn,\n viewQuery: viewQuery,\n node: null !,\n data: blueprint.slice(), // Fill in to match HEADER_OFFSET in LView\n childIndex: -1, // Children set in addToViewTree(), if any\n bindingStartIndex: bindingStartIndex,\n expandoStartIndex: initialViewLength,\n expandoInstructions: null,\n firstTemplatePass: true,\n initHooks: null,\n checkHooks: null,\n contentHooks: null,\n contentCheckHooks: null,\n viewHooks: null,\n viewCheckHooks: null,\n destroyHooks: null,\n pipeDestroyHooks: null,\n cleanup: null,\n contentQueries: null,\n components: null,\n directiveRegistry: typeof directives === 'function' ? directives() : directives,\n pipeRegistry: typeof pipes === 'function' ? pipes() : pipes,\n firstChild: null,\n };\n}\n\nfunction createViewBlueprint(bindingStartIndex: number, initialViewLength: number): LView {\n const blueprint = new Array(initialViewLength)\n .fill(null, 0, bindingStartIndex)\n .fill(NO_CHANGE, bindingStartIndex) as LView;\n blueprint[CONTAINER_INDEX] = -1;\n blueprint[BINDING_INDEX] = bindingStartIndex;\n return blueprint;\n}\n\nfunction setUpAttributes(native: RElement, attrs: TAttributes): void {\n const renderer = getLView()[RENDERER];\n const isProc = isProceduralRenderer(renderer);\n let i = 0;\n\n while (i < attrs.length) {\n const attrName = attrs[i++];\n if (typeof attrName == 'number') {\n if (attrName === AttributeMarker.NamespaceURI) {\n // Namespaced attributes\n const namespaceURI = attrs[i++] as string;\n const attrName = attrs[i++] as string;\n const attrVal = attrs[i++] as string;\n ngDevMode && ngDevMode.rendererSetAttribute++;\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName, attrVal, namespaceURI) :\n native.setAttributeNS(namespaceURI, attrName, attrVal);\n } else {\n // All other `AttributeMarker`s are ignored here.\n break;\n }\n } else {\n /// attrName is string;\n const attrVal = attrs[i++];\n if (attrName !== NG_PROJECT_AS_ATTR_NAME) {\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n if (isProc) {\n (renderer as ProceduralRenderer3).setProperty(native, attrName, attrVal);\n }\n } else {\n isProc ?\n (renderer as ProceduralRenderer3)\n .setAttribute(native, attrName as string, attrVal as string) :\n native.setAttribute(attrName as string, attrVal as string);\n }\n }\n }\n }\n}\n\nexport function createError(text: string, token: any) {\n return new Error(`Renderer: ${text} [${stringify(token)}]`);\n}\n\n\n/**\n * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.\n *\n * @param elementOrSelector Render element or CSS selector to locate the element.\n */\nexport function locateHostElement(\n factory: RendererFactory3, elementOrSelector: RElement | string): RElement|null {\n const defaultRenderer = factory.createRenderer(null, null);\n const rNode = typeof elementOrSelector === 'string' ?\n (isProceduralRenderer(defaultRenderer) ?\n defaultRenderer.selectRootElement(elementOrSelector) :\n defaultRenderer.querySelector(elementOrSelector)) :\n elementOrSelector;\n if (ngDevMode && !rNode) {\n if (typeof elementOrSelector === 'string') {\n throw createError('Host node with selector not found:', elementOrSelector);\n } else {\n throw createError('Host node is required:', elementOrSelector);\n }\n }\n return rNode;\n}\n\n/**\n * Adds an event listener to the current node.\n *\n * If an output exists on one of the node's directives, it also subscribes to the output\n * and saves the subscription for later cleanup.\n *\n * @param eventName Name of the event\n * @param listenerFn The function to be called when event emits\n * @param useCapture Whether or not to use capture in event listener.\n */\nexport function listener(\n eventName: string, listenerFn: (e?: any) => any, useCapture = false): void {\n const lView = getLView();\n const tNode = getPreviousOrParentTNode();\n const tView = lView[TVIEW];\n const firstTemplatePass = tView.firstTemplatePass;\n const tCleanup: false|any[] = firstTemplatePass && (tView.cleanup || (tView.cleanup = []));\n ngDevMode && assertNodeOfPossibleTypes(\n tNode, TNodeType.Element, TNodeType.Container, TNodeType.ElementContainer);\n\n // add native event listener - applicable to elements only\n if (tNode.type === TNodeType.Element) {\n const native = getNativeByTNode(tNode, lView) as RElement;\n ngDevMode && ngDevMode.rendererAddEventListener++;\n const renderer = lView[RENDERER];\n const lCleanup = getCleanup(lView);\n const lCleanupIndex = lCleanup.length;\n let useCaptureOrSubIdx: boolean|number = useCapture;\n\n // In order to match current behavior, native DOM event listeners must be added for all\n // events (including outputs).\n if (isProceduralRenderer(renderer)) {\n const cleanupFn = renderer.listen(native, eventName, listenerFn);\n lCleanup.push(listenerFn, cleanupFn);\n useCaptureOrSubIdx = lCleanupIndex + 1;\n } else {\n const wrappedListener = wrapListenerWithPreventDefault(listenerFn);\n native.addEventListener(eventName, wrappedListener, useCapture);\n lCleanup.push(wrappedListener);\n }\n tCleanup && tCleanup.push(eventName, tNode.index, lCleanupIndex, useCaptureOrSubIdx);\n }\n\n // subscribe to directive outputs\n if (tNode.outputs === undefined) {\n // if we create TNode here, inputs must be undefined so we know they still need to be\n // checked\n tNode.outputs = generatePropertyAliases(tNode, BindingDirection.Output);\n }\n\n const outputs = tNode.outputs;\n let props: PropertyAliasValue|undefined;\n if (outputs && (props = outputs[eventName])) {\n const propsLength = props.length;\n if (propsLength) {\n const lCleanup = getCleanup(lView);\n for (let i = 0; i < propsLength; i += 2) {\n ngDevMode && assertDataInRange(lView, props[i] as number);\n const subscription = lView[props[i] as number][props[i + 1]].subscribe(listenerFn);\n const idx = lCleanup.length;\n lCleanup.push(listenerFn, subscription);\n tCleanup && tCleanup.push(eventName, tNode.index, idx, -(idx + 1));\n }\n }\n }\n}\n\n/**\n * Saves context for this cleanup function in LView.cleanupInstances.\n *\n * On the first template pass, saves in TView:\n * - Cleanup function\n * - Index of context we just saved in LView.cleanupInstances\n */\nexport function storeCleanupWithContext(lView: LView, context: any, cleanupFn: Function): void {\n const lCleanup = getCleanup(lView);\n lCleanup.push(context);\n\n if (lView[TVIEW].firstTemplatePass) {\n getTViewCleanup(lView).push(cleanupFn, lCleanup.length - 1);\n }\n}\n\n/**\n * Saves the cleanup function itself in LView.cleanupInstances.\n *\n * This is necessary for functions that are wrapped with their contexts, like in renderer2\n * listeners.\n *\n * On the first template pass, the index of the cleanup function is saved in TView.\n */\nexport function storeCleanupFn(view: LView, cleanupFn: Function): void {\n getCleanup(view).push(cleanupFn);\n\n if (view[TVIEW].firstTemplatePass) {\n getTViewCleanup(view).push(view[CLEANUP] !.length - 1, null);\n }\n}\n\n/** Mark the end of the element. */\nexport function elementEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertHasParent(getPreviousOrParentTNode());\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Element);\n const lView = getLView();\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TElementNode);\n }\n\n queueLifecycleHooks(getLView()[TVIEW], previousOrParentTNode);\n decreaseElementDepthCount();\n\n // this is fired at the end of elementEnd because ALL of the stylingBindings code\n // (for directives and the template) have now executed which means the styling\n // context can be instantiated properly.\n if (hasClassInput(previousOrParentTNode)) {\n const stylingContext = getStylingContext(previousOrParentTNode.index, lView);\n setInputsForProperty(\n lView, previousOrParentTNode.inputs !['class'] !, getInitialClassNameValue(stylingContext));\n }\n}\n\n/**\n * Updates the value of removes an attribute on an Element.\n *\n * @param number index The index of the element in the data array\n * @param name name The name of the attribute.\n * @param value value The attribute is removed when value is `null` or `undefined`.\n * Otherwise the attribute value is set to the stringified value.\n * @param sanitizer An optional function used to sanitize the value.\n */\nexport function elementAttribute(\n index: number, name: string, value: any, sanitizer?: SanitizerFn | null): void {\n if (value !== NO_CHANGE) {\n const lView = getLView();\n const renderer = lView[RENDERER];\n const element = getNativeByIndex(index, lView);\n if (value == null) {\n ngDevMode && ngDevMode.rendererRemoveAttribute++;\n isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name) :\n element.removeAttribute(name);\n } else {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n const strValue = sanitizer == null ? stringify(value) : sanitizer(value);\n isProceduralRenderer(renderer) ? renderer.setAttribute(element, name, strValue) :\n element.setAttribute(name, strValue);\n }\n }\n}\n\n/**\n * Update a property on an element.\n *\n * If the property name also exists as an input property on one of the element's directives,\n * the component property will be set instead of the element property. This check must\n * be conducted at runtime so child components that add new @Inputs don't have to be re-compiled.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @param nativeOnly Whether or not we should only set native properties and skip input check\n * (this is necessary for host property bindings)\n */\nexport function elementProperty<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean): void {\n elementPropertyInternal(index, propName, value, sanitizer, nativeOnly);\n}\n\n/**\n * Updates a synthetic host binding (e.g. `[@foo]`) on a component.\n *\n * This instruction is for compatibility purposes and is designed to ensure that a\n * synthetic host binding (e.g. `@HostBinding('@foo')`) properly gets rendered in\n * the component's renderer. Normally all host bindings are evaluated with the parent\n * component's renderer, but, in the case of animation @triggers, they need to be\n * evaluated with the sub components renderer (because that's where the animation\n * triggers are defined).\n *\n * Do not use this instruction as a replacement for `elementProperty`. This instruction\n * only exists to ensure compatibility with the ViewEngine's host binding behavior.\n *\n * @param index The index of the element to update in the data array\n * @param propName Name of property. Because it is going to DOM, this is not subject to\n * renaming as part of minification.\n * @param value New value to write.\n * @param sanitizer An optional function used to sanitize the value.\n * @param nativeOnly Whether or not we should only set native properties and skip input check\n * (this is necessary for host property bindings)\n */\nexport function componentHostSyntheticProperty<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean) {\n elementPropertyInternal(index, propName, value, sanitizer, nativeOnly, loadComponentRenderer);\n}\n\nfunction loadComponentRenderer(tNode: TNode, lView: LView): Renderer3 {\n const componentLView = lView[tNode.index] as LView;\n return componentLView[RENDERER];\n}\n\nfunction elementPropertyInternal<T>(\n index: number, propName: string, value: T | NO_CHANGE, sanitizer?: SanitizerFn | null,\n nativeOnly?: boolean,\n loadRendererFn?: ((tNode: TNode, lView: LView) => Renderer3) | null): void {\n if (value === NO_CHANGE) return;\n const lView = getLView();\n const element = getNativeByIndex(index, lView) as RElement | RComment;\n const tNode = getTNode(index, lView);\n let inputData: PropertyAliases|null|undefined;\n let dataValue: PropertyAliasValue|undefined;\n if (!nativeOnly && (inputData = initializeTNodeInputs(tNode)) &&\n (dataValue = inputData[propName])) {\n setInputsForProperty(lView, dataValue, value);\n if (isComponent(tNode)) markDirtyIfOnPush(lView, index + HEADER_OFFSET);\n if (ngDevMode) {\n if (tNode.type === TNodeType.Element || tNode.type === TNodeType.Container) {\n setNgReflectProperties(lView, element, tNode.type, dataValue, value);\n }\n }\n } else if (tNode.type === TNodeType.Element) {\n const renderer = loadRendererFn ? loadRendererFn(tNode, lView) : lView[RENDERER];\n // It is assumed that the sanitizer is only added when the compiler determines that the property\n // is risky, so sanitization can be done without further checks.\n value = sanitizer != null ? (sanitizer(value) as any) : value;\n ngDevMode && ngDevMode.rendererSetProperty++;\n if (isProceduralRenderer(renderer)) {\n renderer.setProperty(element as RElement, propName, value);\n } else if (!isAnimationProp(propName)) {\n (element as RElement).setProperty ? (element as any).setProperty(propName, value) :\n (element as any)[propName] = value;\n }\n }\n}\n\n/**\n * Constructs a TNode object from the arguments.\n *\n * @param type The type of the node\n * @param adjustedIndex The index of the TNode in TView.data, adjusted for HEADER_OFFSET\n * @param tagName The tag name of the node\n * @param attrs The attributes defined on this node\n * @param tViews Any TViews attached to this node\n * @returns the TNode object\n */\nexport function createTNode(\n lView: LView, type: TNodeType, adjustedIndex: number, tagName: string | null,\n attrs: TAttributes | null, tViews: TView[] | null): TNode {\n const previousOrParentTNode = getPreviousOrParentTNode();\n ngDevMode && ngDevMode.tNode++;\n const parent =\n getIsParent() ? previousOrParentTNode : previousOrParentTNode && previousOrParentTNode.parent;\n\n // Parents cannot cross component boundaries because components will be used in multiple places,\n // so it's only set if the view is the same.\n const parentInSameView = parent && lView && parent !== lView[HOST_NODE];\n const tParent = parentInSameView ? parent as TElementNode | TContainerNode : null;\n\n return {\n type: type,\n index: adjustedIndex,\n injectorIndex: tParent ? tParent.injectorIndex : -1,\n directiveStart: -1,\n directiveEnd: -1,\n flags: 0,\n providerIndexes: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n tViews: tViews,\n next: null,\n child: null,\n parent: tParent,\n detached: null,\n stylingTemplate: null,\n projection: null\n };\n}\n\n/**\n * Given a list of directive indices and minified input names, sets the\n * input properties on the corresponding directives.\n */\nfunction setInputsForProperty(lView: LView, inputs: PropertyAliasValue, value: any): void {\n for (let i = 0; i < inputs.length; i += 2) {\n ngDevMode && assertDataInRange(lView, inputs[i] as number);\n lView[inputs[i] as number][inputs[i + 1]] = value;\n }\n}\n\nfunction setNgReflectProperties(\n lView: LView, element: RElement | RComment, type: TNodeType, inputs: PropertyAliasValue,\n value: any) {\n for (let i = 0; i < inputs.length; i += 2) {\n const renderer = lView[RENDERER];\n const attrName = normalizeDebugBindingName(inputs[i + 1] as string);\n const debugValue = normalizeDebugBindingValue(value);\n if (type === TNodeType.Element) {\n isProceduralRenderer(renderer) ?\n renderer.setAttribute((element as RElement), attrName, debugValue) :\n (element as RElement).setAttribute(attrName, debugValue);\n } else if (value !== undefined) {\n const value = `bindings=${JSON.stringify({[attrName]: debugValue}, null, 2)}`;\n if (isProceduralRenderer(renderer)) {\n renderer.setValue((element as RComment), value);\n } else {\n (element as RComment).textContent = value;\n }\n }\n }\n}\n\n/**\n * Consolidates all inputs or outputs of all directives on this logical node.\n *\n * @param tNodeFlags node flags\n * @param direction whether to consider inputs or outputs\n * @returns PropertyAliases|null aggregate of all properties if any, `null` otherwise\n */\nfunction generatePropertyAliases(tNode: TNode, direction: BindingDirection): PropertyAliases|null {\n const tView = getLView()[TVIEW];\n let propStore: PropertyAliases|null = null;\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n\n if (end > start) {\n const isInput = direction === BindingDirection.Input;\n const defs = tView.data;\n\n for (let i = start; i < end; i++) {\n const directiveDef = defs[i] as DirectiveDef<any>;\n const propertyAliasMap: {[publicName: string]: string} =\n isInput ? directiveDef.inputs : directiveDef.outputs;\n for (let publicName in propertyAliasMap) {\n if (propertyAliasMap.hasOwnProperty(publicName)) {\n propStore = propStore || {};\n const internalName = propertyAliasMap[publicName];\n const hasProperty = propStore.hasOwnProperty(publicName);\n hasProperty ? propStore[publicName].push(i, internalName) :\n (propStore[publicName] = [i, internalName]);\n }\n }\n }\n }\n return propStore;\n}\n\n/**\n * Assign any inline style values to the element during creation mode.\n *\n * This instruction is meant to be called during creation mode to register all\n * dynamic style and class bindings on the element. Note for static values (no binding)\n * see `elementStart` and `elementHostAttrs`.\n *\n * @param classBindingNames An array containing bindable class names.\n * The `elementClassProp` refers to the class name by index in this array.\n * (i.e. `['foo', 'bar']` means `foo=0` and `bar=1`).\n * @param styleBindingNames An array containing bindable style properties.\n * The `elementStyleProp` refers to the class name by index in this array.\n * (i.e. `['width', 'height']` means `width=0` and `height=1`).\n * @param styleSanitizer An optional sanitizer function that will be used to sanitize any CSS\n * property values that are applied to the element (during rendering).\n * Note that the sanitizer instance itself is tied to the `directive` (if provided).\n * @param directive A directive instance the styling is associated with. If not provided\n * current view's controller instance is assumed.\n *\n * @publicApi\n */\nexport function elementStyling(\n classBindingNames?: string[] | null, styleBindingNames?: string[] | null,\n styleSanitizer?: StyleSanitizeFn | null, directive?: {}): void {\n const tNode = getPreviousOrParentTNode();\n if (!tNode.stylingTemplate) {\n tNode.stylingTemplate = createEmptyStylingContext();\n }\n updateContextWithBindings(\n tNode.stylingTemplate !, directive || null, classBindingNames, styleBindingNames,\n styleSanitizer, hasClassInput(tNode));\n}\n\n/**\n * Assign static styling values to a host element.\n *\n * NOTE: This instruction is meant to used from `hostBindings` function only.\n *\n * @param directive A directive instance the styling is associated with.\n * @param attrs An array containing class and styling information. The values must be marked with\n * `AttributeMarker`.\n *\n * ```\n * var attrs = [AttributeMarker.Classes, 'foo', 'bar',\n * AttributeMarker.Styles, 'width', '100px', 'height, '200px']\n * elementHostAttrs(directive, attrs);\n * ```\n *\n * @publicApi\n */\nexport function elementHostAttrs(directive: any, attrs: TAttributes) {\n const tNode = getPreviousOrParentTNode();\n if (!tNode.stylingTemplate) {\n tNode.stylingTemplate = initializeStaticStylingContext(attrs);\n }\n patchContextWithStaticAttrs(tNode.stylingTemplate, attrs, directive);\n}\n\n/**\n * Apply styling binding to the element.\n *\n * This instruction is meant to be run after `elementStyle` and/or `elementStyleProp`.\n * if any styling bindings have changed then the changes are flushed to the element.\n *\n *\n * @param index Index of the element's with which styling is associated.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementStylingApply(index: number, directive?: any): void {\n const lView = getLView();\n const isFirstRender = (lView[FLAGS] & LViewFlags.FirstLViewPass) !== 0;\n const totalPlayersQueued = renderStyling(\n getStylingContext(index + HEADER_OFFSET, lView), lView[RENDERER], lView, isFirstRender, null,\n null, directive);\n if (totalPlayersQueued > 0) {\n const rootContext = getRootContext(lView);\n scheduleTick(rootContext, RootContextFlags.FlushPlayers);\n }\n}\n\n/**\n * Update a style bindings value on an element.\n *\n * If the style value is `null` then it will be removed from the element\n * (or assigned a different value depending if there are any styles placed\n * on the element with `elementStyle` or any styles that are present\n * from when the element was created (with `elementStyling`).\n *\n * (Note that the styling element is updated as part of `elementStylingApply`.)\n *\n * @param index Index of the element's with which styling is associated.\n * @param styleIndex Index of style to update. This index value refers to the\n * index of the style in the style bindings array that was passed into\n * `elementStlyingBindings`.\n * @param value New value to write (null to remove). Note that if a directive also\n * attempts to write to the same binding value then it will only be able to\n * do so if the template binding value is `null` (or doesn't exist at all).\n * @param suffix Optional suffix. Used with scalar values to add unit such as `px`.\n * Note that when a suffix is provided then the underlying sanitizer will\n * be ignored.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementStyleProp(\n index: number, styleIndex: number, value: string | number | String | PlayerFactory | null,\n suffix?: string | null, directive?: {}): void {\n let valueToAdd: string|null = null;\n if (value !== null) {\n if (suffix) {\n // when a suffix is applied then it will bypass\n // sanitization entirely (b/c a new string is created)\n valueToAdd = stringify(value) + suffix;\n } else {\n // sanitization happens by dealing with a String value\n // this means that the string value will be passed through\n // into the style rendering later (which is where the value\n // will be sanitized before it is applied)\n valueToAdd = value as any as string;\n }\n }\n updateElementStyleProp(\n getStylingContext(index + HEADER_OFFSET, getLView()), styleIndex, valueToAdd, directive);\n}\n\n/**\n * Add or remove a class via a class binding on a DOM element.\n *\n * This instruction is meant to handle the [class.foo]=\"exp\" case and, therefore,\n * the class itself must already be applied using `elementStyling` within\n * the creation block.\n *\n * @param index Index of the element's with which styling is associated.\n * @param classIndex Index of class to toggle. This index value refers to the\n * index of the class in the class bindings array that was passed into\n * `elementStlyingBindings` (which is meant to be called before this\n * function is).\n * @param value A true/false value which will turn the class on or off.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\ncomponents\n *\n * @publicApi\n */\nexport function elementClassProp(\n index: number, classIndex: number, value: boolean | PlayerFactory, directive?: {}): void {\n const onOrOffClassValue =\n (value instanceof BoundPlayerFactory) ? (value as BoundPlayerFactory<boolean>) : (!!value);\n updateElementClassProp(\n getStylingContext(index + HEADER_OFFSET, getLView()), classIndex, onOrOffClassValue,\n directive);\n}\n\n/**\n * Update style and/or class bindings using object literal.\n *\n * This instruction is meant apply styling via the `[style]=\"exp\"` and `[class]=\"exp\"` template\n * bindings. When styles are applied to the Element they will then be placed with respect to\n * any styles set with `elementStyleProp`. If any styles are set to `null` then they will be\n * removed from the element.\n *\n * (Note that the styling instruction will not be applied until `elementStylingApply` is called.)\n *\n * @param index Index of the element's with which styling is associated.\n * @param classes A key/value style map of CSS classes that will be added to the given element.\n * Any missing classes (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's list of CSS classes.\n * @param styles A key/value style map of the styles that will be applied to the given element.\n * Any missing styles (that have already been applied to the element beforehand) will be\n * removed (unset) from the element's styling.\n * @param directive Directive instance that is attempting to change styling. (Defaults to the\n * component of the current view).\n *\n * @publicApi\n */\nexport function elementStylingMap<T>(\n index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,\n styles?: {[styleName: string]: any} | NO_CHANGE | null, directive?: {}): void {\n if (directive != undefined)\n return hackImplementationOfElementStylingMap(\n index, classes, styles, directive); // supported in next PR\n const lView = getLView();\n const tNode = getTNode(index, lView);\n const stylingContext = getStylingContext(index + HEADER_OFFSET, lView);\n if (hasClassInput(tNode) && classes !== NO_CHANGE) {\n const initialClasses = getInitialClassNameValue(stylingContext);\n const classInputVal =\n (initialClasses.length ? (initialClasses + ' ') : '') + (classes as string);\n setInputsForProperty(lView, tNode.inputs !['class'] !, classInputVal);\n } else {\n updateStylingMap(stylingContext, classes, styles);\n }\n}\n\n/* START OF HACK BLOCK */\nfunction hackImplementationOfElementStylingMap<T>(\n index: number, classes: {[key: string]: any} | string | NO_CHANGE | null,\n styles?: {[styleName: string]: any} | NO_CHANGE | null, directive?: {}): void {\n throw new Error('unimplemented. Should not be needed by ViewEngine compatibility');\n}\n/* END OF HACK BLOCK */\n\n//////////////////////////\n//// Text\n//////////////////////////\n\n/**\n * Create static text node\n *\n * @param index Index of the node in the data array\n * @param value Value to write. This value will be stringified.\n */\nexport function text(index: number, value?: any): void {\n const lView = getLView();\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'text nodes should be created before any bindings');\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n const textNative = createTextNode(value, lView[RENDERER]);\n const tNode = createNodeAtIndex(index, TNodeType.Element, textNative, null, null);\n\n // Text nodes are self closing.\n setIsParent(false);\n appendChild(textNative, tNode, lView);\n}\n\n/**\n * Create text node with binding\n * Bindings should be handled externally with the proper interpolation(1-8) method\n *\n * @param index Index of the node in the data array.\n * @param value Stringified value to write.\n */\nexport function textBinding<T>(index: number, value: T | NO_CHANGE): void {\n if (value !== NO_CHANGE) {\n const lView = getLView();\n ngDevMode && assertDataInRange(lView, index + HEADER_OFFSET);\n const element = getNativeByIndex(index, lView) as any as RText;\n ngDevMode && assertDefined(element, 'native element should exist');\n ngDevMode && ngDevMode.rendererSetText++;\n const renderer = lView[RENDERER];\n isProceduralRenderer(renderer) ? renderer.setValue(element, stringify(value)) :\n element.textContent = stringify(value);\n }\n}\n\n//////////////////////////\n//// Directive\n//////////////////////////\n\n/**\n * Instantiate a root component.\n */\nexport function instantiateRootComponent<T>(\n tView: TView, viewData: LView, def: ComponentDef<T>): T {\n const rootTNode = getPreviousOrParentTNode();\n if (tView.firstTemplatePass) {\n if (def.providersResolver) def.providersResolver(def);\n generateExpandoInstructionBlock(tView, rootTNode, 1);\n baseResolveDirective(tView, viewData, def, def.factory);\n }\n const directive =\n getNodeInjectable(tView.data, viewData, viewData.length - 1, rootTNode as TElementNode);\n postProcessBaseDirective(viewData, rootTNode, directive, def as DirectiveDef<T>);\n return directive;\n}\n\n/**\n * Resolve the matched directives on a node.\n */\nfunction resolveDirectives(\n tView: TView, viewData: LView, directives: DirectiveDef<any>[] | null, tNode: TNode,\n localRefs: string[] | null): void {\n // Please make sure to have explicit type for `exportsMap`. Inferred type triggers bug in tsickle.\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'should run on first template pass only');\n const exportsMap: ({[key: string]: number} | null) = localRefs ? {'': -1} : null;\n if (directives) {\n initNodeFlags(tNode, tView.data.length, directives.length);\n // When the same token is provided by several directives on the same node, some rules apply in\n // the viewEngine:\n // - viewProviders have priority over providers\n // - the last directive in NgModule.declarations has priority over the previous one\n // So to match these rules, the order in which providers are added in the arrays is very\n // important.\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i] as DirectiveDef<any>;\n if (def.providersResolver) def.providersResolver(def);\n }\n generateExpandoInstructionBlock(tView, tNode, directives.length);\n for (let i = 0; i < directives.length; i++) {\n const def = directives[i] as DirectiveDef<any>;\n\n const directiveDefIdx = tView.data.length;\n baseResolveDirective(tView, viewData, def, def.factory);\n\n saveNameToExportMap(tView.data !.length - 1, def, exportsMap);\n\n // Init hooks are queued now so ngOnInit is called in host components before\n // any projected components.\n queueInitHooks(directiveDefIdx, def.onInit, def.doCheck, tView);\n }\n }\n if (exportsMap) cacheMatchingLocalNames(tNode, localRefs, exportsMap);\n}\n\n/**\n * Instantiate all the directives that were previously resolved on the current node.\n */\nfunction instantiateAllDirectives(tView: TView, lView: LView, tNode: TNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n if (!getFirstTemplatePass() && start < end) {\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView);\n }\n for (let i = start; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n if (isComponentDef(def)) {\n addComponentLogic(lView, tNode, def as ComponentDef<any>);\n }\n const directive = getNodeInjectable(tView.data, lView !, i, tNode as TElementNode);\n postProcessDirective(lView, directive, def, i);\n }\n}\n\nfunction invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNode) {\n const start = tNode.directiveStart;\n const end = tNode.directiveEnd;\n const expando = tView.expandoInstructions !;\n const firstTemplatePass = getFirstTemplatePass();\n for (let i = start; i < end; i++) {\n const def = tView.data[i] as DirectiveDef<any>;\n const directive = viewData[i];\n if (def.hostBindings) {\n const previousExpandoLength = expando.length;\n setCurrentDirectiveDef(def);\n def.hostBindings !(RenderFlags.Create, directive, tNode.index - HEADER_OFFSET);\n setCurrentDirectiveDef(null);\n // `hostBindings` function may or may not contain `allocHostVars` call\n // (e.g. it may not if it only contains host listeners), so we need to check whether\n // `expandoInstructions` has changed and if not - we still push `hostBindings` to\n // expando block, to make sure we execute it for DI cycle\n if (previousExpandoLength === expando.length && firstTemplatePass) {\n expando.push(def.hostBindings);\n }\n } else if (firstTemplatePass) {\n expando.push(null);\n }\n }\n}\n\n/**\n* Generates a new block in TView.expandoInstructions for this node.\n*\n* Each expando block starts with the element index (turned negative so we can distinguish\n* it from the hostVar count) and the directive count. See more in VIEW_DATA.md.\n*/\nexport function generateExpandoInstructionBlock(\n tView: TView, tNode: TNode, directiveCount: number): void {\n ngDevMode && assertEqual(\n tView.firstTemplatePass, true,\n 'Expando block should only be generated on first template pass.');\n\n const elementIndex = -(tNode.index - HEADER_OFFSET);\n const providerStartIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const providerCount = tView.data.length - providerStartIndex;\n (tView.expandoInstructions || (tView.expandoInstructions = [\n ])).push(elementIndex, providerCount, directiveCount);\n}\n\n/**\n* On the first template pass, we need to reserve space for host binding values\n* after directives are matched (so all directives are saved, then bindings).\n* Because we are updating the blueprint, we only need to do this once.\n*/\nfunction prefillHostVars(tView: TView, lView: LView, totalHostVars: number): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n for (let i = 0; i < totalHostVars; i++) {\n lView.push(NO_CHANGE);\n tView.blueprint.push(NO_CHANGE);\n tView.data.push(null);\n }\n}\n\n/**\n * Process a directive on the current node after its creation.\n */\nfunction postProcessDirective<T>(\n viewData: LView, directive: T, def: DirectiveDef<T>, directiveDefIdx: number): void {\n const previousOrParentTNode = getPreviousOrParentTNode();\n postProcessBaseDirective(viewData, previousOrParentTNode, directive, def);\n ngDevMode && assertDefined(previousOrParentTNode, 'previousOrParentTNode');\n if (previousOrParentTNode && previousOrParentTNode.attrs) {\n setInputsFromAttrs(directiveDefIdx, directive, def.inputs, previousOrParentTNode);\n }\n\n if (def.contentQueries) {\n def.contentQueries(directiveDefIdx);\n }\n\n if (isComponentDef(def)) {\n const componentView = getComponentViewByIndex(previousOrParentTNode.index, viewData);\n componentView[CONTEXT] = directive;\n }\n}\n\n/**\n * A lighter version of postProcessDirective() that is used for the root component.\n */\nfunction postProcessBaseDirective<T>(\n lView: LView, previousOrParentTNode: TNode, directive: T, def: DirectiveDef<T>): void {\n const native = getNativeByTNode(previousOrParentTNode, lView);\n\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'directives should be created before any bindings');\n ngDevMode && assertPreviousIsParent(getIsParent());\n\n attachPatchData(directive, lView);\n if (native) {\n attachPatchData(native, lView);\n }\n\n // TODO(misko): setUpAttributes should be a feature for better treeshakability.\n if (def.attributes != null && previousOrParentTNode.type == TNodeType.Element) {\n setUpAttributes(native as RElement, def.attributes as string[]);\n }\n}\n\n\n\n/**\n* Matches the current node against all available selectors.\n* If a component is matched (at most one), it is returned in first position in the array.\n*/\nfunction findDirectiveMatches(tView: TView, viewData: LView, tNode: TNode): DirectiveDef<any>[]|\n null {\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'should run on first template pass only');\n const registry = tView.directiveRegistry;\n let matches: any[]|null = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i] as ComponentDef<any>| DirectiveDef<any>;\n if (isNodeMatchingSelectorList(tNode, def.selectors !, /* isProjectionMode */ false)) {\n matches || (matches = []);\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode,\n viewData),\n viewData, def.type);\n\n if (isComponentDef(def)) {\n if (tNode.flags & TNodeFlags.isComponent) throwMultipleComponentError(tNode);\n tNode.flags = TNodeFlags.isComponent;\n\n // The component is always stored first with directives after.\n matches.unshift(def);\n } else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}\n\n/** Stores index of component's host element so it will be queued for view refresh during CD. */\nexport function queueComponentIndexForCheck(previousOrParentTNode: TNode): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n const tView = getLView()[TVIEW];\n (tView.components || (tView.components = [])).push(previousOrParentTNode.index);\n}\n\n/**\n * Stores host binding fn and number of host vars so it will be queued for binding refresh during\n * CD.\n*/\nfunction queueHostBindingForCheck(\n tView: TView, def: DirectiveDef<any>| ComponentDef<any>, hostVars: number): void {\n ngDevMode &&\n assertEqual(getFirstTemplatePass(), true, 'Should only be called in first template pass.');\n const expando = tView.expandoInstructions !;\n const length = expando.length;\n // Check whether a given `hostBindings` function already exists in expandoInstructions,\n // which can happen in case directive definition was extended from base definition (as a part of\n // the `InheritDefinitionFeature` logic). If we found the same `hostBindings` function in the\n // list, we just increase the number of host vars associated with that function, but do not add it\n // into the list again.\n if (length >= 2 && expando[length - 2] === def.hostBindings) {\n expando[length - 1] = (expando[length - 1] as number) + hostVars;\n } else {\n expando.push(def.hostBindings !, hostVars);\n }\n}\n\n/** Caches local names and their matching directive indices for query and template lookups. */\nfunction cacheMatchingLocalNames(\n tNode: TNode, localRefs: string[] | null, exportsMap: {[key: string]: number}): void {\n if (localRefs) {\n const localNames: (string | number)[] = tNode.localNames = [];\n\n // Local names must be stored in tNode in the same order that localRefs are defined\n // in the template to ensure the data is loaded in the same slots as their refs\n // in the template (for template queries).\n for (let i = 0; i < localRefs.length; i += 2) {\n const index = exportsMap[localRefs[i + 1]];\n if (index == null) throw new Error(`Export of name '${localRefs[i + 1]}' not found!`);\n localNames.push(localRefs[i], index);\n }\n }\n}\n\n/**\n* Builds up an export map as directives are created, so local refs can be quickly mapped\n* to their directive instances.\n*/\nfunction saveNameToExportMap(\n index: number, def: DirectiveDef<any>| ComponentDef<any>,\n exportsMap: {[key: string]: number} | null) {\n if (exportsMap) {\n if (def.exportAs) exportsMap[def.exportAs] = index;\n if ((def as ComponentDef<any>).template) exportsMap[''] = index;\n }\n}\n\n/**\n * Initializes the flags on the current node, setting all indices to the initial index,\n * the directive count to 0, and adding the isComponent flag.\n * @param index the initial index\n */\nexport function initNodeFlags(tNode: TNode, index: number, numberOfDirectives: number) {\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'expected firstTemplatePass to be true');\n const flags = tNode.flags;\n ngDevMode && assertEqual(\n flags === 0 || flags === TNodeFlags.isComponent, true,\n 'expected node flags to not be initialized');\n\n ngDevMode && assertNotEqual(\n numberOfDirectives, tNode.directiveEnd - tNode.directiveStart,\n 'Reached the max number of directives');\n // When the first directive is created on a node, save the index\n tNode.flags = flags & TNodeFlags.isComponent;\n tNode.directiveStart = index;\n tNode.directiveEnd = index + numberOfDirectives;\n tNode.providerIndexes = index;\n}\n\nfunction baseResolveDirective<T>(\n tView: TView, viewData: LView, def: DirectiveDef<T>,\n directiveFactory: (t: Type<T>| null) => any) {\n tView.data.push(def);\n const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, isComponentDef(def), null);\n tView.blueprint.push(nodeInjectorFactory);\n viewData.push(nodeInjectorFactory);\n}\n\nfunction addComponentLogic<T>(\n lView: LView, previousOrParentTNode: TNode, def: ComponentDef<T>): void {\n const native = getNativeByTNode(previousOrParentTNode, lView);\n\n const tView = getOrCreateTView(\n def.template, def.consts, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery);\n\n // Only component views should be added to the view tree directly. Embedded views are\n // accessed through their containers because they may be removed / re-added later.\n const rendererFactory = lView[RENDERER_FACTORY];\n const componentView = addToViewTree(\n lView, previousOrParentTNode.index as number,\n createLView(\n lView, tView, null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways,\n rendererFactory, lView[RENDERER_FACTORY].createRenderer(native as RElement, def)));\n\n componentView[HOST_NODE] = previousOrParentTNode as TElementNode;\n\n // Component view will always be created before any injected LContainers,\n // so this is a regular element, wrap it with the component view\n componentView[HOST] = lView[previousOrParentTNode.index];\n lView[previousOrParentTNode.index] = componentView;\n\n if (getFirstTemplatePass()) {\n queueComponentIndexForCheck(previousOrParentTNode);\n }\n}\n\n/**\n * Sets initial input properties on directive instances from attribute data\n *\n * @param directiveIndex Index of the directive in directives array\n * @param instance Instance of the directive on which to set the initial inputs\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data for this node\n */\nfunction setInputsFromAttrs<T>(\n directiveIndex: number, instance: T, inputs: {[P in keyof T]: string;}, tNode: TNode): void {\n let initialInputData = tNode.initialInputs as InitialInputData | undefined;\n if (initialInputData === undefined || directiveIndex >= initialInputData.length) {\n initialInputData = generateInitialInputs(directiveIndex, inputs, tNode);\n }\n\n const initialInputs: InitialInputs|null = initialInputData[directiveIndex];\n if (initialInputs) {\n for (let i = 0; i < initialInputs.length; i += 2) {\n (instance as any)[initialInputs[i]] = initialInputs[i + 1];\n }\n }\n}\n\n/**\n * Generates initialInputData for a node and stores it in the template's static storage\n * so subsequent template invocations don't have to recalculate it.\n *\n * initialInputData is an array containing values that need to be set as input properties\n * for directives on this node, but only once on creation. We need this array to support\n * the case where you set an @Input property of a directive using attribute-like syntax.\n * e.g. if you have a `name` @Input, you can set it once like this:\n *\n * <my-component name=\"Bess\"></my-component>\n *\n * @param directiveIndex Index to store the initial input data\n * @param inputs The list of inputs from the directive def\n * @param tNode The static data on this node\n */\nfunction generateInitialInputs(\n directiveIndex: number, inputs: {[key: string]: string}, tNode: TNode): InitialInputData {\n const initialInputData: InitialInputData = tNode.initialInputs || (tNode.initialInputs = []);\n initialInputData[directiveIndex] = null;\n\n const attrs = tNode.attrs !;\n let i = 0;\n while (i < attrs.length) {\n const attrName = attrs[i];\n if (attrName === AttributeMarker.SelectOnly) break;\n if (attrName === AttributeMarker.NamespaceURI) {\n // We do not allow inputs on namespaced attributes.\n i += 4;\n continue;\n }\n const minifiedInputName = inputs[attrName];\n const attrValue = attrs[i + 1];\n\n if (minifiedInputName !== undefined) {\n const inputsToStore: InitialInputs =\n initialInputData[directiveIndex] || (initialInputData[directiveIndex] = []);\n inputsToStore.push(minifiedInputName, attrValue as string);\n }\n\n i += 2;\n }\n return initialInputData;\n}\n\n//////////////////////////\n//// ViewContainer & View\n//////////////////////////\n\n/**\n * Creates a LContainer, either from a container instruction, or for a ViewContainerRef.\n *\n * @param hostNative The host element for the LContainer\n * @param hostTNode The host TNode for the LContainer\n * @param currentView The parent view of the LContainer\n * @param native The native comment element\n * @param isForViewContainerRef Optional a flag indicating the ViewContainerRef case\n * @returns LContainer\n */\nexport function createLContainer(\n hostNative: RElement | RComment,\n hostTNode: TElementNode | TContainerNode | TElementContainerNode, currentView: LView,\n native: RComment, isForViewContainerRef?: boolean): LContainer {\n return [\n isForViewContainerRef ? -1 : 0, // active index\n [], // views\n currentView, // parent\n null, // next\n null, // queries\n hostNative, // host native\n native, // native\n getRenderParent(hostTNode, currentView) // renderParent\n ];\n}\n\n/**\n * Creates an LContainer for an ng-template (dynamically-inserted view), e.g.\n *\n * <ng-template #foo>\n * <div></div>\n * </ng-template>\n *\n * @param index The index of the container in the data array\n * @param templateFn Inline template\n * @param consts The number of nodes, local refs, and pipes for this template\n * @param vars The number of bindings for this template\n * @param tagName The name of the container element, if applicable\n * @param attrs The attrs attached to the container, if applicable\n * @param localRefs A set of local reference bindings on the element.\n * @param localRefExtractor A function which extracts local-refs values from the template.\n * Defaults to the current element associated with the local-ref.\n */\nexport function template(\n index: number, templateFn: ComponentTemplate<any>| null, consts: number, vars: number,\n tagName?: string | null, attrs?: TAttributes | null, localRefs?: string[] | null,\n localRefExtractor?: LocalRefExtractor) {\n const lView = getLView();\n const tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n const tNode = containerInternal(index, tagName || null, attrs || null);\n\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(\n -1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n const currentQueries = lView[QUERIES];\n const previousOrParentTNode = getPreviousOrParentTNode();\n const native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode as TContainerNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}\n\n/**\n * Creates an LContainer for inline views, e.g.\n *\n * % if (showing) {\n * <div></div>\n * % }\n *\n * @param index The index of the container in the data array\n */\nexport function container(index: number): void {\n const tNode = containerInternal(index, null, null);\n getFirstTemplatePass() && (tNode.tViews = []);\n setIsParent(false);\n}\n\nfunction containerInternal(\n index: number, tagName: string | null, attrs: TAttributes | null): TNode {\n const lView = getLView();\n ngDevMode && assertEqual(\n lView[BINDING_INDEX], lView[TVIEW].bindingStartIndex,\n 'container nodes should be created before any bindings');\n\n const adjustedIndex = index + HEADER_OFFSET;\n const comment = lView[RENDERER].createComment(ngDevMode ? 'container' : '');\n ngDevMode && ngDevMode.rendererCreateComment++;\n const tNode = createNodeAtIndex(index, TNodeType.Container, comment, tagName, attrs);\n const lContainer = lView[adjustedIndex] =\n createLContainer(lView[adjustedIndex], tNode, lView, comment);\n\n appendChild(comment, tNode, lView);\n\n // Containers are added to the current view tree instead of their embedded views\n // because views can be removed and re-inserted.\n addToViewTree(lView, index + HEADER_OFFSET, lContainer);\n\n const currentQueries = lView[QUERIES];\n if (currentQueries) {\n // prepare place for matching nodes from views inserted into a given container\n lContainer[QUERIES] = currentQueries.container();\n }\n\n ngDevMode && assertNodeType(getPreviousOrParentTNode(), TNodeType.Container);\n return tNode;\n}\n\n/**\n * Sets a container up to receive views.\n *\n * @param index The index of the container in the data array\n */\nexport function containerRefreshStart(index: number): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n let previousOrParentTNode = loadInternal(tView.data, index) as TNode;\n setPreviousOrParentTNode(previousOrParentTNode);\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Container);\n setIsParent(true);\n\n lView[index + HEADER_OFFSET][ACTIVE_INDEX] = 0;\n\n // We need to execute init hooks here so ngOnInit hooks are called in top level views\n // before they are called in embedded views (for backwards compatibility).\n executeInitHooks(lView, tView, getCheckNoChangesMode());\n}\n\n/**\n * Marks the end of the LContainer.\n *\n * Marking the end of LContainer is the time when to child views get inserted or removed.\n */\nexport function containerRefreshEnd(): void {\n let previousOrParentTNode = getPreviousOrParentTNode();\n if (getIsParent()) {\n setIsParent(false);\n } else {\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.View);\n ngDevMode && assertHasParent(previousOrParentTNode);\n previousOrParentTNode = previousOrParentTNode.parent !;\n setPreviousOrParentTNode(previousOrParentTNode);\n }\n\n ngDevMode && assertNodeType(previousOrParentTNode, TNodeType.Container);\n\n const lContainer = getLView()[previousOrParentTNode.index];\n const nextIndex = lContainer[ACTIVE_INDEX];\n\n // remove extra views at the end of the container\n while (nextIndex < lContainer[VIEWS].length) {\n removeView(lContainer, previousOrParentTNode as TContainerNode, nextIndex);\n }\n}\n\n/**\n * Goes over dynamic embedded views (ones created through ViewContainerRef APIs) and refreshes them\n * by executing an associated template function.\n */\nfunction refreshDynamicEmbeddedViews(lView: LView) {\n for (let current = getLViewChild(lView); current !== null; current = current[NEXT]) {\n // Note: current can be an LView or an LContainer instance, but here we are only interested\n // in LContainer. We can tell it's an LContainer because its length is less than the LView\n // header.\n if (current.length < HEADER_OFFSET && current[ACTIVE_INDEX] === -1) {\n const container = current as LContainer;\n for (let i = 0; i < container[VIEWS].length; i++) {\n const dynamicViewData = container[VIEWS][i];\n // The directives and pipes are not needed here as an existing view is only being refreshed.\n ngDevMode && assertDefined(dynamicViewData[TVIEW], 'TView must be allocated');\n renderEmbeddedTemplate(dynamicViewData, dynamicViewData[TVIEW], dynamicViewData[CONTEXT] !);\n }\n }\n }\n}\n\n\n/**\n * Looks for a view with a given view block id inside a provided LContainer.\n * Removes views that need to be deleted in the process.\n *\n * @param lContainer to search for views\n * @param tContainerNode to search for views\n * @param startIdx starting index in the views array to search from\n * @param viewBlockId exact view block id to look for\n * @returns index of a found view or -1 if not found\n */\nfunction scanForView(\n lContainer: LContainer, tContainerNode: TContainerNode, startIdx: number,\n viewBlockId: number): LView|null {\n const views = lContainer[VIEWS];\n for (let i = startIdx; i < views.length; i++) {\n const viewAtPositionId = views[i][TVIEW].id;\n if (viewAtPositionId === viewBlockId) {\n return views[i];\n } else if (viewAtPositionId < viewBlockId) {\n // found a view that should not be at this position - remove\n removeView(lContainer, tContainerNode, i);\n } else {\n // found a view with id greater than the one we are searching for\n // which means that required view doesn't exist and can't be found at\n // later positions in the views array - stop the searchdef.cont here\n break;\n }\n }\n return null;\n}\n\n/**\n * Marks the start of an embedded view.\n *\n * @param viewBlockId The ID of this view\n * @return boolean Whether or not this view is in creation mode\n */\nexport function embeddedViewStart(viewBlockId: number, consts: number, vars: number): RenderFlags {\n const lView = getLView();\n const previousOrParentTNode = getPreviousOrParentTNode();\n // The previous node can be a view node if we are processing an inline for loop\n const containerTNode = previousOrParentTNode.type === TNodeType.View ?\n previousOrParentTNode.parent ! :\n previousOrParentTNode;\n const lContainer = lView[containerTNode.index] as LContainer;\n\n ngDevMode && assertNodeType(containerTNode, TNodeType.Container);\n let viewToRender = scanForView(\n lContainer, containerTNode as TContainerNode, lContainer[ACTIVE_INDEX] !, viewBlockId);\n\n if (viewToRender) {\n setIsParent(true);\n enterView(viewToRender, viewToRender[TVIEW].node);\n } else {\n // When we create a new LView, we always reset the state of the instructions.\n viewToRender = createLView(\n lView,\n getOrCreateEmbeddedTView(viewBlockId, consts, vars, containerTNode as TContainerNode), null,\n LViewFlags.CheckAlways);\n\n if (lContainer[QUERIES]) {\n viewToRender[QUERIES] = lContainer[QUERIES] !.createView();\n }\n\n createViewNode(viewBlockId, viewToRender);\n enterView(viewToRender, viewToRender[TVIEW].node);\n }\n if (lContainer) {\n if (isCreationMode(viewToRender)) {\n // it is a new view, insert it into collection of views for a given container\n insertView(viewToRender, lContainer, lView, lContainer[ACTIVE_INDEX] !, -1);\n }\n lContainer[ACTIVE_INDEX] !++;\n }\n return isCreationMode(viewToRender) ? RenderFlags.Create | RenderFlags.Update :\n RenderFlags.Update;\n}\n\n/**\n * Initialize the TView (e.g. static data) for the active embedded view.\n *\n * Each embedded view block must create or retrieve its own TView. Otherwise, the embedded view's\n * static data for a particular node would overwrite the static data for a node in the view above\n * it with the same index (since it's in the same template).\n *\n * @param viewIndex The index of the TView in TNode.tViews\n * @param consts The number of nodes, local refs, and pipes in this template\n * @param vars The number of bindings and pure function bindings in this template\n * @param container The parent container in which to look for the view's static data\n * @returns TView\n */\nfunction getOrCreateEmbeddedTView(\n viewIndex: number, consts: number, vars: number, parent: TContainerNode): TView {\n const tView = getLView()[TVIEW];\n ngDevMode && assertNodeType(parent, TNodeType.Container);\n const containerTViews = parent.tViews as TView[];\n ngDevMode && assertDefined(containerTViews, 'TView expected');\n ngDevMode && assertEqual(Array.isArray(containerTViews), true, 'TViews should be in an array');\n if (viewIndex >= containerTViews.length || containerTViews[viewIndex] == null) {\n containerTViews[viewIndex] = createTView(\n viewIndex, null, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n return containerTViews[viewIndex];\n}\n\n/** Marks the end of an embedded view. */\nexport function embeddedViewEnd(): void {\n const lView = getLView();\n const viewHost = lView[HOST_NODE];\n\n if (isCreationMode(lView)) {\n refreshDescendantViews(lView); // creation mode pass\n lView[FLAGS] &= ~LViewFlags.CreationMode;\n }\n refreshDescendantViews(lView); // update mode pass\n leaveView(lView[PARENT] !);\n setPreviousOrParentTNode(viewHost !);\n setIsParent(false);\n}\n\n/////////////\n\n/**\n * Refreshes components by entering the component view and processing its bindings, queries, etc.\n *\n * @param adjustedElementIndex Element index in LView[] (adjusted for HEADER_OFFSET)\n */\nexport function componentRefresh<T>(adjustedElementIndex: number): void {\n const lView = getLView();\n ngDevMode && assertDataInRange(lView, adjustedElementIndex);\n const hostView = getComponentViewByIndex(adjustedElementIndex, lView);\n ngDevMode && assertNodeType(lView[TVIEW].data[adjustedElementIndex] as TNode, TNodeType.Element);\n\n // Only attached CheckAlways components or attached, dirty OnPush components should be checked\n if (viewAttached(hostView) && hostView[FLAGS] & (LViewFlags.CheckAlways | LViewFlags.Dirty)) {\n syncViewWithBlueprint(hostView);\n checkView(hostView, hostView[CONTEXT]);\n }\n}\n\n/**\n * Syncs an LView instance with its blueprint if they have gotten out of sync.\n *\n * Typically, blueprints and their view instances should always be in sync, so the loop here\n * will be skipped. However, consider this case of two components side-by-side:\n *\n * App template:\n * ```\n * <comp></comp>\n * <comp></comp>\n * ```\n *\n * The following will happen:\n * 1. App template begins processing.\n * 2. First <comp> is matched as a component and its LView is created.\n * 3. Second <comp> is matched as a component and its LView is created.\n * 4. App template completes processing, so it's time to check child templates.\n * 5. First <comp> template is checked. It has a directive, so its def is pushed to blueprint.\n * 6. Second <comp> template is checked. Its blueprint has been updated by the first\n * <comp> template, but its LView was created before this update, so it is out of sync.\n *\n * Note that embedded views inside ngFor loops will never be out of sync because these views\n * are processed as soon as they are created.\n *\n * @param componentView The view to sync\n */\nfunction syncViewWithBlueprint(componentView: LView) {\n const componentTView = componentView[TVIEW];\n for (let i = componentView.length; i < componentTView.blueprint.length; i++) {\n componentView[i] = componentTView.blueprint[i];\n }\n}\n\n/** Returns a boolean for whether the view is attached */\nexport function viewAttached(view: LView): boolean {\n return (view[FLAGS] & LViewFlags.Attached) === LViewFlags.Attached;\n}\n\n/**\n * Instruction to distribute projectable nodes among <ng-content> occurrences in a given template.\n * It takes all the selectors from the entire component's template and decides where\n * each projected node belongs (it re-distributes nodes among \"buckets\" where each \"bucket\" is\n * backed by a selector).\n *\n * This function requires CSS selectors to be provided in 2 forms: parsed (by a compiler) and text,\n * un-parsed form.\n *\n * The parsed form is needed for efficient matching of a node against a given CSS selector.\n * The un-parsed, textual form is needed for support of the ngProjectAs attribute.\n *\n * Having a CSS selector in 2 different formats is not ideal, but alternatives have even more\n * drawbacks:\n * - having only a textual form would require runtime parsing of CSS selectors;\n * - we can't have only a parsed as we can't re-construct textual form from it (as entered by a\n * template author).\n *\n * @param selectors A collection of parsed CSS selectors\n * @param rawSelectors A collection of CSS selectors in the raw, un-parsed form\n */\nexport function projectionDef(selectors?: CssSelectorList[], textSelectors?: string[]): void {\n const componentNode = findComponentView(getLView())[HOST_NODE] as TElementNode;\n\n if (!componentNode.projection) {\n const noOfNodeBuckets = selectors ? selectors.length + 1 : 1;\n const pData: (TNode | null)[] = componentNode.projection =\n new Array(noOfNodeBuckets).fill(null);\n const tails: (TNode | null)[] = pData.slice();\n\n let componentChild: TNode|null = componentNode.child;\n\n while (componentChild !== null) {\n const bucketIndex =\n selectors ? matchingSelectorIndex(componentChild, selectors, textSelectors !) : 0;\n const nextNode = componentChild.next;\n\n if (tails[bucketIndex]) {\n tails[bucketIndex] !.next = componentChild;\n } else {\n pData[bucketIndex] = componentChild;\n componentChild.next = null;\n }\n tails[bucketIndex] = componentChild;\n\n componentChild = nextNode;\n }\n }\n}\n\n/**\n * Stack used to keep track of projection nodes in projection() instruction.\n *\n * This is deliberately created outside of projection() to avoid allocating\n * a new array each time the function is called. Instead the array will be\n * re-used by each invocation. This works because the function is not reentrant.\n */\nconst projectionNodeStack: (LView | TNode)[] = [];\n\n/**\n * Inserts previously re-distributed projected nodes. This instruction must be preceded by a call\n * to the projectionDef instruction.\n *\n * @param nodeIndex\n * @param selectorIndex:\n * - 0 when the selector is `*` (or unspecified as this is the default value),\n * - 1 based index of the selector from the {@link projectionDef}\n */\nexport function projection(nodeIndex: number, selectorIndex: number = 0, attrs?: string[]): void {\n const lView = getLView();\n const tProjectionNode =\n createNodeAtIndex(nodeIndex, TNodeType.Projection, null, null, attrs || null);\n\n // We can't use viewData[HOST_NODE] because projection nodes can be nested in embedded views.\n if (tProjectionNode.projection === null) tProjectionNode.projection = selectorIndex;\n\n // `<ng-content>` has no content\n setIsParent(false);\n\n // re-distribution of projectable nodes is stored on a component's view level\n const componentView = findComponentView(lView);\n const componentNode = componentView[HOST_NODE] as TElementNode;\n let nodeToProject = (componentNode.projection as(TNode | null)[])[selectorIndex];\n let projectedView = componentView[PARENT] !;\n let projectionNodeIndex = -1;\n\n while (nodeToProject) {\n if (nodeToProject.type === TNodeType.Projection) {\n // This node is re-projected, so we must go up the tree to get its projected nodes.\n const currentComponentView = findComponentView(projectedView);\n const currentComponentHost = currentComponentView[HOST_NODE] as TElementNode;\n const firstProjectedNode =\n (currentComponentHost.projection as(TNode | null)[])[nodeToProject.projection as number];\n\n if (firstProjectedNode) {\n projectionNodeStack[++projectionNodeIndex] = nodeToProject;\n projectionNodeStack[++projectionNodeIndex] = projectedView;\n\n nodeToProject = firstProjectedNode;\n projectedView = currentComponentView[PARENT] !;\n continue;\n }\n } else {\n // This flag must be set now or we won't know that this node is projected\n // if the nodes are inserted into a container later.\n nodeToProject.flags |= TNodeFlags.isProjected;\n appendProjectedNode(nodeToProject, tProjectionNode, lView, projectedView);\n }\n\n // If we are finished with a list of re-projected nodes, we need to get\n // back to the root projection node that was re-projected.\n if (nodeToProject.next === null && projectedView !== componentView[PARENT] !) {\n projectedView = projectionNodeStack[projectionNodeIndex--] as LView;\n nodeToProject = projectionNodeStack[projectionNodeIndex--] as TNode;\n }\n nodeToProject = nodeToProject.next;\n }\n}\n\n/**\n * Adds LView or LContainer to the end of the current view tree.\n *\n * This structure will be used to traverse through nested views to remove listeners\n * and call onDestroy callbacks.\n *\n * @param lView The view where LView or LContainer should be added\n * @param adjustedHostIndex Index of the view's host node in LView[], adjusted for header\n * @param state The LView or LContainer to add to the view tree\n * @returns The state passed in\n */\nexport function addToViewTree<T extends LView|LContainer>(\n lView: LView, adjustedHostIndex: number, state: T): T {\n const tView = lView[TVIEW];\n const firstTemplatePass = getFirstTemplatePass();\n if (lView[TAIL]) {\n lView[TAIL] ![NEXT] = state;\n } else if (firstTemplatePass) {\n tView.childIndex = adjustedHostIndex;\n }\n lView[TAIL] = state;\n return state;\n}\n\n///////////////////////////////\n//// Change detection\n///////////////////////////////\n\n/** If node is an OnPush component, marks its LView dirty. */\nfunction markDirtyIfOnPush(lView: LView, viewIndex: number): void {\n const childComponentLView = getComponentViewByIndex(viewIndex, lView);\n if (!(childComponentLView[FLAGS] & LViewFlags.CheckAlways)) {\n childComponentLView[FLAGS] |= LViewFlags.Dirty;\n }\n}\n\n/** Wraps an event listener with preventDefault behavior. */\nfunction wrapListenerWithPreventDefault(listenerFn: (e?: any) => any): EventListener {\n return function wrapListenerIn_preventDefault(e: Event) {\n if (listenerFn(e) === false) {\n e.preventDefault();\n // Necessary for legacy browsers that don't support preventDefault (e.g. IE)\n e.returnValue = false;\n }\n };\n}\n\n/** Marks current view and all ancestors dirty */\nexport function markViewDirty(lView: LView): void {\n while (lView && !(lView[FLAGS] & LViewFlags.IsRoot)) {\n lView[FLAGS] |= LViewFlags.Dirty;\n lView = lView[PARENT] !;\n }\n lView[FLAGS] |= LViewFlags.Dirty;\n ngDevMode && assertDefined(lView[CONTEXT], 'rootContext should be defined');\n\n const rootContext = lView[CONTEXT] as RootContext;\n scheduleTick(rootContext, RootContextFlags.DetectChanges);\n}\n\n/**\n * Used to schedule change detection on the whole application.\n *\n * Unlike `tick`, `scheduleTick` coalesces multiple calls into one change detection run.\n * It is usually called indirectly by calling `markDirty` when the view needs to be\n * re-rendered.\n *\n * Typically `scheduleTick` uses `requestAnimationFrame` to coalesce multiple\n * `scheduleTick` requests. The scheduling function can be overridden in\n * `renderComponent`'s `scheduler` option.\n */\nexport function scheduleTick<T>(rootContext: RootContext, flags: RootContextFlags) {\n const nothingScheduled = rootContext.flags === RootContextFlags.Empty;\n rootContext.flags |= flags;\n\n if (nothingScheduled && rootContext.clean == _CLEAN_PROMISE) {\n let res: null|((val: null) => void);\n rootContext.clean = new Promise<null>((r) => res = r);\n rootContext.scheduler(() => {\n if (rootContext.flags & RootContextFlags.DetectChanges) {\n rootContext.flags &= ~RootContextFlags.DetectChanges;\n tickRootContext(rootContext);\n }\n\n if (rootContext.flags & RootContextFlags.FlushPlayers) {\n rootContext.flags &= ~RootContextFlags.FlushPlayers;\n const playerHandler = rootContext.playerHandler;\n if (playerHandler) {\n playerHandler.flushPlayers();\n }\n }\n\n rootContext.clean = _CLEAN_PROMISE;\n res !(null);\n });\n }\n}\n\n/**\n * Used to perform change detection on the whole application.\n *\n * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`\n * executes lifecycle hooks and conditionally checks components based on their\n * `ChangeDetectionStrategy` and dirtiness.\n *\n * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally\n * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a\n * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can\n * be changed when calling `renderComponent` and providing the `scheduler` option.\n */\nexport function tick<T>(component: T): void {\n const rootView = getRootView(component);\n const rootContext = rootView[CONTEXT] as RootContext;\n tickRootContext(rootContext);\n}\n\nfunction tickRootContext(rootContext: RootContext) {\n for (let i = 0; i < rootContext.components.length; i++) {\n const rootComponent = rootContext.components[i];\n renderComponentOrTemplate(readPatchedLView(rootComponent) !, rootComponent);\n }\n}\n\n/**\n * Synchronously perform change detection on a component (and possibly its sub-components).\n *\n * This function triggers change detection in a synchronous way on a component. There should\n * be very little reason to call this function directly since a preferred way to do change\n * detection is to {@link markDirty} the component and wait for the scheduler to call this method\n * at some future point in time. This is because a single user action often results in many\n * components being invalidated and calling change detection on each component synchronously\n * would be inefficient. It is better to wait until all components are marked as dirty and\n * then perform single change detection across all of the components\n *\n * @param component The component which the change detection should be performed on.\n */\nexport function detectChanges<T>(component: T): void {\n const view = getComponentViewByInstance(component) !;\n detectChangesInternal<T>(view, component);\n}\n\nexport function detectChangesInternal<T>(view: LView, context: T) {\n const rendererFactory = view[RENDERER_FACTORY];\n\n if (rendererFactory.begin) rendererFactory.begin();\n\n if (isCreationMode(view)) {\n checkView(view, context); // creation mode pass\n }\n checkView(view, context); // update mode pass\n\n if (rendererFactory.end) rendererFactory.end();\n}\n\n/**\n * Synchronously perform change detection on a root view and its components.\n *\n * @param lView The view which the change detection should be performed on.\n */\nexport function detectChangesInRootView(lView: LView): void {\n tickRootContext(lView[CONTEXT] as RootContext);\n}\n\n\n/**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\nexport function checkNoChanges<T>(component: T): void {\n setCheckNoChangesMode(true);\n try {\n detectChanges(component);\n } finally {\n setCheckNoChangesMode(false);\n }\n}\n\n/**\n * Checks the change detector on a root view and its components, and throws if any changes are\n * detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n *\n * @param lView The view which the change detection should be checked on.\n */\nexport function checkNoChangesInRootView(lView: LView): void {\n setCheckNoChangesMode(true);\n try {\n detectChangesInRootView(lView);\n } finally {\n setCheckNoChangesMode(false);\n }\n}\n\n/** Checks the view of the component provided. Does not gate on dirty checks or execute doCheck. */\nexport function checkView<T>(hostView: LView, component: T) {\n const hostTView = hostView[TVIEW];\n const oldView = enterView(hostView, hostView[HOST_NODE]);\n const templateFn = hostTView.template !;\n const viewQuery = hostTView.viewQuery;\n\n try {\n namespaceHTML();\n createViewQuery(viewQuery, hostView, component);\n templateFn(getRenderFlags(hostView), component);\n refreshDescendantViews(hostView);\n updateViewQuery(viewQuery, hostView, component);\n } finally {\n leaveView(oldView);\n }\n}\n\nfunction createViewQuery<T>(viewQuery: ComponentQuery<{}>| null, view: LView, component: T): void {\n if (viewQuery && isCreationMode(view)) {\n viewQuery(RenderFlags.Create, component);\n }\n}\n\nfunction updateViewQuery<T>(viewQuery: ComponentQuery<{}>| null, view: LView, component: T): void {\n if (viewQuery && !isCreationMode(view)) {\n viewQuery(RenderFlags.Update, component);\n }\n}\n\n\n/**\n * Mark the component as dirty (needing change detection).\n *\n * Marking a component dirty will schedule a change detection on this\n * component at some point in the future. Marking an already dirty\n * component as dirty is a noop. Only one outstanding change detection\n * can be scheduled per component tree. (Two components bootstrapped with\n * separate `renderComponent` will have separate schedulers)\n *\n * When the root component is bootstrapped with `renderComponent`, a scheduler\n * can be provided.\n *\n * @param component Component to mark as dirty.\n *\n * @publicApi\n */\nexport function markDirty<T>(component: T) {\n ngDevMode && assertDefined(component, 'component');\n markViewDirty(getComponentViewByInstance(component));\n}\n\n///////////////////////////////\n//// Bindings & interpolations\n///////////////////////////////\n\n/**\n * Creates a single value binding.\n *\n * @param value Value to diff\n */\nexport function bind<T>(value: T): T|NO_CHANGE {\n const lView = getLView();\n return bindingUpdated(lView, lView[BINDING_INDEX]++, value) ? value : NO_CHANGE;\n}\n\n/**\n * Allocates the necessary amount of slots for host vars.\n *\n * @param count Amount of vars to be allocated\n */\nexport function allocHostVars(count: number): void {\n if (!getFirstTemplatePass()) return;\n const lView = getLView();\n const tView = lView[TVIEW];\n queueHostBindingForCheck(tView, getCurrentDirectiveDef() !, count);\n prefillHostVars(tView, lView, count);\n}\n\n/**\n * Create interpolation bindings with a variable number of expressions.\n *\n * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.\n * Those are faster because there is no need to create an array of expressions and iterate over it.\n *\n * `values`:\n * - has static text at even indexes,\n * - has evaluated expressions at odd indexes.\n *\n * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.\n */\nexport function interpolationV(values: any[]): string|NO_CHANGE {\n ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');\n ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');\n let different = false;\n const lView = getLView();\n\n let bindingIndex = lView[BINDING_INDEX];\n for (let i = 1; i < values.length; i += 2) {\n // Check if bindings (odd indexes) have changed\n bindingUpdated(lView, bindingIndex++, values[i]) && (different = true);\n }\n lView[BINDING_INDEX] = bindingIndex;\n\n if (!different) {\n return NO_CHANGE;\n }\n\n // Build the updated content\n let content = values[0];\n for (let i = 1; i < values.length; i += 2) {\n content += stringify(values[i]) + values[i + 1];\n }\n\n return content;\n}\n\n/**\n * Creates an interpolation binding with 1 expression.\n *\n * @param prefix static value used for concatenation only.\n * @param v0 value checked for change.\n * @param suffix static value used for concatenation only.\n */\nexport function interpolation1(prefix: string, v0: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated(lView, lView[BINDING_INDEX], v0);\n lView[BINDING_INDEX] += 1;\n return different ? prefix + stringify(v0) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 2 expressions. */\nexport function interpolation2(\n prefix: string, v0: any, i0: string, v1: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated2(lView, lView[BINDING_INDEX], v0, v1);\n lView[BINDING_INDEX] += 2;\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + suffix : NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 3 expressions. */\nexport function interpolation3(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, suffix: string): string|\n NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated3(lView, lView[BINDING_INDEX], v0, v1, v2);\n lView[BINDING_INDEX] += 3;\n\n return different ? prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + suffix :\n NO_CHANGE;\n}\n\n/** Create an interpolation binding with 4 expressions. */\nexport function interpolation4(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const different = bindingUpdated4(lView, lView[BINDING_INDEX], v0, v1, v2, v3);\n lView[BINDING_INDEX] += 4;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) +\n suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 5 expressions. */\nexport function interpolation5(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated(lView, bindingIndex + 4, v4) || different;\n lView[BINDING_INDEX] += 5;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 6 expressions. */\nexport function interpolation6(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;\n lView[BINDING_INDEX] += 6;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 7 expressions. */\nexport function interpolation7(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, suffix: string): string|\n NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;\n lView[BINDING_INDEX] += 7;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + suffix :\n NO_CHANGE;\n}\n\n/** Creates an interpolation binding with 8 expressions. */\nexport function interpolation8(\n prefix: string, v0: any, i0: string, v1: any, i1: string, v2: any, i2: string, v3: any,\n i3: string, v4: any, i4: string, v5: any, i5: string, v6: any, i6: string, v7: any,\n suffix: string): string|NO_CHANGE {\n const lView = getLView();\n const bindingIndex = lView[BINDING_INDEX];\n let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);\n different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;\n lView[BINDING_INDEX] += 8;\n\n return different ?\n prefix + stringify(v0) + i0 + stringify(v1) + i1 + stringify(v2) + i2 + stringify(v3) + i3 +\n stringify(v4) + i4 + stringify(v5) + i5 + stringify(v6) + i6 + stringify(v7) + suffix :\n NO_CHANGE;\n}\n\n/** Store a value in the `data` at a given `index`. */\nexport function store<T>(index: number, value: T): void {\n const lView = getLView();\n const tView = lView[TVIEW];\n // We don't store any static data for local variables, so the first time\n // we see the template, we should store as null to avoid a sparse array\n const adjustedIndex = index + HEADER_OFFSET;\n if (adjustedIndex >= tView.data.length) {\n tView.data[adjustedIndex] = null;\n }\n lView[adjustedIndex] = value;\n}\n\n/**\n * Retrieves a local reference from the current contextViewData.\n *\n * If the reference to retrieve is in a parent view, this instruction is used in conjunction\n * with a nextContext() call, which walks up the tree and updates the contextViewData instance.\n *\n * @param index The index of the local ref in contextViewData.\n */\nexport function reference<T>(index: number) {\n const contextLView = getContextLView();\n return loadInternal<T>(contextLView, index);\n}\n\nexport function loadQueryList<T>(queryListIdx: number): QueryList<T> {\n const lView = getLView();\n ngDevMode &&\n assertDefined(\n lView[CONTENT_QUERIES], 'Content QueryList array should be defined if reading a query.');\n ngDevMode && assertDataInRange(lView[CONTENT_QUERIES] !, queryListIdx);\n\n return lView[CONTENT_QUERIES] ![queryListIdx];\n}\n\n/** Retrieves a value from current `viewData`. */\nexport function load<T>(index: number): T {\n return loadInternal<T>(getLView(), index);\n}\n\n\n\n///////////////////////////////\n//// DI\n///////////////////////////////\n\n/**\n * Returns the value associated to the given token from the injectors.\n *\n * `directiveInject` is intended to be used for directive, component and pipe factories.\n * All other injection use `inject` which does not walk the node injector tree.\n *\n * Usage example (in factory function):\n *\n * class SomeDirective {\n * constructor(directive: DirectiveA) {}\n *\n * static ngDirectiveDef = defineDirective({\n * type: SomeDirective,\n * factory: () => new SomeDirective(directiveInject(DirectiveA))\n * });\n * }\n *\n * @param token the type or token to inject\n * @param flags Injection flags\n * @returns the value from the injector or `null` when not found\n */\nexport function directiveInject<T>(token: Type<T>| InjectionToken<T>): T;\nexport function directiveInject<T>(token: Type<T>| InjectionToken<T>, flags: InjectFlags): T;\nexport function directiveInject<T>(\n token: Type<T>| InjectionToken<T>, flags = InjectFlags.Default): T|null {\n token = resolveForwardRef(token);\n return getOrCreateInjectable<T>(\n getPreviousOrParentTNode() as TElementNode | TContainerNode | TElementContainerNode,\n getLView(), token, flags);\n}\n\n/**\n * Facade for the attribute injection from DI.\n */\nexport function injectAttribute(attrNameToInject: string): string|null {\n return injectAttributeImpl(getPreviousOrParentTNode(), attrNameToInject);\n}\n\n/**\n * Registers a QueryList, associated with a content query, for later refresh (part of a view\n * refresh).\n */\nexport function registerContentQuery<Q>(\n queryList: QueryList<Q>, currentDirectiveIndex: number): void {\n const viewData = getLView();\n const tView = viewData[TVIEW];\n const savedContentQueriesLength =\n (viewData[CONTENT_QUERIES] || (viewData[CONTENT_QUERIES] = [])).push(queryList);\n if (getFirstTemplatePass()) {\n const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []);\n const lastSavedDirectiveIndex =\n tView.contentQueries.length ? tView.contentQueries[tView.contentQueries.length - 2] : -1;\n if (currentDirectiveIndex !== lastSavedDirectiveIndex) {\n tViewContentQueries.push(currentDirectiveIndex, savedContentQueriesLength - 1);\n }\n }\n}\n\nexport const CLEAN_PROMISE = _CLEAN_PROMISE;\n\nfunction initializeTNodeInputs(tNode: TNode | null) {\n // If tNode.inputs is undefined, a listener has created outputs, but inputs haven't\n // yet been checked.\n if (tNode) {\n if (tNode.inputs === undefined) {\n // mark inputs as checked\n tNode.inputs = generatePropertyAliases(tNode, BindingDirection.Input);\n }\n return tNode.inputs;\n }\n return null;\n}\n\n\n/**\n * Returns the current OpaqueViewState instance.\n *\n * Used in conjunction with the restoreView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n */\nexport function getCurrentView(): OpaqueViewState {\n return getLView() as any as OpaqueViewState;\n}\n\nfunction getCleanup(view: LView): any[] {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return view[CLEANUP] || (view[CLEANUP] = []);\n}\n\nfunction getTViewCleanup(view: LView): any[] {\n return view[TVIEW].cleanup || (view[TVIEW].cleanup = []);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport './ng_dev_mode';\n\nimport {getLContext} from './context_discovery';\nimport {getRootContext} from './discovery_utils';\nimport {scheduleTick} from './instructions';\nimport {ComponentInstance, DirectiveInstance, Player} from './interfaces/player';\nimport {HEADER_OFFSET, RootContextFlags} from './interfaces/view';\nimport {addPlayerInternal, getOrCreatePlayerContext, getPlayerContext, getPlayersInternal, getStylingContext, throwInvalidRefError} from './styling/util';\n\n/**\n * Adds a player to an element, directive or component instance that will later be\n * animated once change detection has passed.\n *\n * When a player is added to a reference it will stay active until `player.destroy()`\n * is called. Once called then the player will be removed from the active players\n * present on the associated ref instance.\n *\n * To get a list of all the active players on an element see [getPlayers].\n *\n * @param ref The element, directive or component that the player will be placed on.\n * @param player The player that will be triggered to play once change detection has run.\n */\nexport function addPlayer(\n ref: ComponentInstance | DirectiveInstance | HTMLElement, player: Player): void {\n const context = getLContext(ref);\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return;\n }\n\n const element = context.native as HTMLElement;\n const lView = context.lView;\n const playerContext = getOrCreatePlayerContext(element, context) !;\n const rootContext = getRootContext(lView);\n addPlayerInternal(playerContext, rootContext, element, player, 0, ref);\n scheduleTick(rootContext, RootContextFlags.FlushPlayers);\n}\n\n/**\n * Returns a list of all the active players present on the provided ref instance (which can\n * be an instance of a directive, component or element).\n *\n * This function will only return players that have been added to the ref instance using\n * `addPlayer` or any players that are active through any template styling bindings\n * (`[style]`, `[style.prop]`, `[class]` and `[class.name]`).\n *\n * @publicApi\n */\nexport function getPlayers(ref: ComponentInstance | DirectiveInstance | HTMLElement): Player[] {\n const context = getLContext(ref);\n if (!context) {\n ngDevMode && throwInvalidRefError();\n return [];\n }\n\n const stylingContext = getStylingContext(context.nodeIndex, context.lView);\n const playerContext = stylingContext ? getPlayerContext(stylingContext) : null;\n return playerContext ? getPlayersInternal(playerContext) : [];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @fileoverview\n * This file is the index file collecting all of the symbols published on the global.ng namespace.\n *\n * The reason why this file/module is separate global_utils.ts file is that we use this file\n * to generate a d.ts file containing all the published symbols that is then compared to the golden\n * file in the public_api_guard test.\n */\n\nexport {getComponent, getContext, getDirectives, getHostElement, getInjector, getListeners, getRootComponents, getViewComponent} from './discovery_utils';\nexport {markDirty} from './instructions';\nexport {getPlayers} from './players';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {global} from '../util';\n\nimport {assertDefined} from './assert';\nimport {getComponent, getContext, getDirectives, getHostElement, getInjector, getListeners, getPlayers, getRootComponents, getViewComponent, markDirty} from './global_utils_api';\n\n\n\n/**\n * This file introduces series of globally accessible debug tools\n * to allow for the Angular debugging story to function.\n *\n * To see this in action run the following command:\n *\n * bazel run --define=compile=aot\n * //packages/core/test/bundling/todo:devserver\n *\n * Then load `localhost:5432` and start using the console tools.\n */\n\n/**\n * This value reflects the property on the window where the dev\n * tools are patched (window.ng).\n * */\nexport const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';\n\n/*\n * Publishes a collection of default debug tools onto `window._ng_`.\n *\n * These functions are available globally when Angular is in development\n * mode and are automatically stripped away from prod mode is on.\n */\nlet _published = false;\nexport function publishDefaultGlobalUtils() {\n if (!_published) {\n _published = true;\n publishGlobalUtil('getComponent', getComponent);\n publishGlobalUtil('getContext', getContext);\n publishGlobalUtil('getListeners', getListeners);\n publishGlobalUtil('getViewComponent', getViewComponent);\n publishGlobalUtil('getHostElement', getHostElement);\n publishGlobalUtil('getInjector', getInjector);\n publishGlobalUtil('getRootComponents', getRootComponents);\n publishGlobalUtil('getDirectives', getDirectives);\n publishGlobalUtil('getPlayers', getPlayers);\n publishGlobalUtil('markDirty', markDirty);\n }\n}\n\nexport declare type GlobalDevModeContainer = {\n [GLOBAL_PUBLISH_EXPANDO_KEY]: {[fnName: string]: Function};\n};\n\n/**\n * Publishes the given function to `window.ngDevMode` so that it can be\n * used from the browser console when an application is not in production.\n */\nexport function publishGlobalUtil(name: string, fn: Function): void {\n const w = global as any as GlobalDevModeContainer;\n ngDevMode && assertDefined(fn, 'function not defined');\n if (w) {\n let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];\n if (!container) {\n container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};\n }\n container[name] = fn;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Type} from '../core';\nimport {Injector} from '../di/injector';\nimport {Sanitizer} from '../sanitization/security';\n\nimport {assertComponentType, assertDefined} from './assert';\nimport {getComponentDef} from './definition';\nimport {diPublicInInjector, getOrCreateNodeInjectorForNode} from './di';\nimport {publishDefaultGlobalUtils} from './global_utils';\nimport {queueInitHooks, queueLifecycleHooks} from './hooks';\nimport {CLEAN_PROMISE, createLView, createNodeAtIndex, createTNode, createTView, getOrCreateTView, initNodeFlags, instantiateRootComponent, locateHostElement, queueComponentIndexForCheck, refreshDescendantViews} from './instructions';\nimport {ComponentDef, ComponentType, RenderFlags} from './interfaces/definition';\nimport {TElementNode, TNode, TNodeFlags, TNodeType} from './interfaces/node';\nimport {PlayerHandler} from './interfaces/player';\nimport {RElement, Renderer3, RendererFactory3, domRendererFactory3} from './interfaces/renderer';\nimport {CONTEXT, FLAGS, HEADER_OFFSET, HOST, HOST_NODE, LView, LViewFlags, RootContext, RootContextFlags, TVIEW} from './interfaces/view';\nimport {enterView, getPreviousOrParentTNode, leaveView, resetComponentState, setCurrentDirectiveDef} from './state';\nimport {defaultScheduler, getRootView, readPatchedLView, stringify} from './util';\n\n\n\n/** Options that control how the component should be bootstrapped. */\nexport interface CreateComponentOptions {\n /** Which renderer factory to use. */\n rendererFactory?: RendererFactory3;\n\n /** A custom sanitizer instance */\n sanitizer?: Sanitizer;\n\n /** A custom animation player handler */\n playerHandler?: PlayerHandler;\n\n /**\n * Host element on which the component will be bootstrapped. If not specified,\n * the component definition's `tag` is used to query the existing DOM for the\n * element to bootstrap.\n */\n host?: RElement|string;\n\n /** Module injector for the component. If unspecified, the injector will be NULL_INJECTOR. */\n injector?: Injector;\n\n /**\n * List of features to be applied to the created component. Features are simply\n * functions that decorate a component with a certain behavior.\n *\n * Typically, the features in this list are features that cannot be added to the\n * other features list in the component definition because they rely on other factors.\n *\n * Example: `RootLifecycleHooks` is a function that adds lifecycle hook capabilities\n * to root components in a tree-shakable way. It cannot be added to the component\n * features list because there's no way of knowing when the component will be used as\n * a root component.\n */\n hostFeatures?: HostFeature[];\n\n /**\n * A function which is used to schedule change detection work in the future.\n *\n * When marking components as dirty, it is necessary to schedule the work of\n * change detection in the future. This is done to coalesce multiple\n * {@link markDirty} calls into a single changed detection processing.\n *\n * The default value of the scheduler is the `requestAnimationFrame` function.\n *\n * It is also useful to override this function for testing purposes.\n */\n scheduler?: (work: () => void) => void;\n}\n\n/** See CreateComponentOptions.hostFeatures */\ntype HostFeature = (<T>(component: T, componentDef: ComponentDef<T>) => void);\n\n// TODO: A hack to not pull in the NullInjector from @angular/core.\nexport const NULL_INJECTOR: Injector = {\n get: (token: any, notFoundValue?: any) => {\n throw new Error('NullInjector: Not found: ' + stringify(token));\n }\n};\n\n/**\n * Bootstraps a Component into an existing host element and returns an instance\n * of the component.\n *\n * Use this function to bootstrap a component into the DOM tree. Each invocation\n * of this function will create a separate tree of components, injectors and\n * change detection cycles and lifetimes. To dynamically insert a new component\n * into an existing tree such that it shares the same injection, change detection\n * and object lifetime, use {@link ViewContainer#createComponent}.\n *\n * @param componentType Component to bootstrap\n * @param options Optional parameters which control bootstrapping\n */\nexport function renderComponent<T>(\n componentType: ComponentType<T>|\n Type<T>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */\n ,\n opts: CreateComponentOptions = {}): T {\n ngDevMode && publishDefaultGlobalUtils();\n ngDevMode && assertComponentType(componentType);\n const rendererFactory = opts.rendererFactory || domRendererFactory3;\n const sanitizer = opts.sanitizer || null;\n const componentDef = getComponentDef<T>(componentType) !;\n if (componentDef.type != componentType) componentDef.type = componentType;\n\n // The first index of the first selector is the tag name.\n const componentTag = componentDef.selectors ![0] ![0] as string;\n const hostRNode = locateHostElement(rendererFactory, opts.host || componentTag);\n const rootFlags = componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :\n LViewFlags.CheckAlways | LViewFlags.IsRoot;\n const rootContext = createRootContext(opts.scheduler, opts.playerHandler);\n\n const renderer = rendererFactory.createRenderer(hostRNode, componentDef);\n const rootView: LView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), rootContext, rootFlags, rendererFactory,\n renderer, undefined, opts.injector || null);\n\n const oldView = enterView(rootView, null);\n let component: T;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n const componentView = createRootComponentView(\n hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);\n component = createRootComponent(\n componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);\n\n refreshDescendantViews(rootView); // creation mode pass\n rootView[FLAGS] &= ~LViewFlags.CreationMode;\n refreshDescendantViews(rootView); // update mode pass\n } finally {\n leaveView(oldView);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n return component;\n}\n\n/**\n * Creates the root component view and the root component node.\n *\n * @param rNode Render host element.\n * @param def ComponentDef\n * @param rootView The parent view where the host node is stored\n * @param renderer The current renderer\n * @param sanitizer The sanitizer, if provided\n *\n * @returns Component view created\n */\nexport function createRootComponentView(\n rNode: RElement | null, def: ComponentDef<any>, rootView: LView,\n rendererFactory: RendererFactory3, renderer: Renderer3, sanitizer?: Sanitizer | null): LView {\n resetComponentState();\n const tView = rootView[TVIEW];\n const componentView = createLView(\n rootView,\n getOrCreateTView(\n def.template, def.consts, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery),\n null, def.onPush ? LViewFlags.Dirty : LViewFlags.CheckAlways, rendererFactory, renderer,\n sanitizer);\n const tNode = createNodeAtIndex(0, TNodeType.Element, rNode, null, null);\n\n if (tView.firstTemplatePass) {\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), rootView, def.type);\n tNode.flags = TNodeFlags.isComponent;\n initNodeFlags(tNode, rootView.length, 1);\n queueComponentIndexForCheck(tNode);\n }\n\n // Store component view at node index, with node as the HOST\n componentView[HOST] = rootView[HEADER_OFFSET];\n componentView[HOST_NODE] = tNode as TElementNode;\n return rootView[HEADER_OFFSET] = componentView;\n}\n\n/**\n * Creates a root component and sets it up with features and host bindings. Shared by\n * renderComponent() and ViewContainerRef.createComponent().\n */\nexport function createRootComponent<T>(\n componentView: LView, componentDef: ComponentDef<T>, rootView: LView, rootContext: RootContext,\n hostFeatures: HostFeature[] | null): any {\n const tView = rootView[TVIEW];\n // Create directive instance with factory() and store at next index in viewData\n const component = instantiateRootComponent(tView, rootView, componentDef);\n\n rootContext.components.push(component);\n componentView[CONTEXT] = component;\n\n hostFeatures && hostFeatures.forEach((feature) => feature(component, componentDef));\n\n if (tView.firstTemplatePass && componentDef.hostBindings) {\n const rootTNode = getPreviousOrParentTNode();\n setCurrentDirectiveDef(componentDef);\n componentDef.hostBindings(RenderFlags.Create, component, rootTNode.index - HEADER_OFFSET);\n setCurrentDirectiveDef(null);\n }\n\n return component;\n}\n\n\nexport function createRootContext(\n scheduler?: (workFn: () => void) => void, playerHandler?: PlayerHandler|null): RootContext {\n return {\n components: [],\n scheduler: scheduler || defaultScheduler,\n clean: CLEAN_PROMISE,\n playerHandler: playerHandler || null,\n flags: RootContextFlags.Empty\n };\n}\n\n/**\n * Used to enable lifecycle hooks on the root component.\n *\n * Include this feature when calling `renderComponent` if the root component\n * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't\n * be called properly.\n *\n * Example:\n *\n * ```\n * renderComponent(AppComponent, {features: [RootLifecycleHooks]});\n * ```\n */\nexport function LifecycleHooksFeature(component: any, def: ComponentDef<any>): void {\n const rootTView = readPatchedLView(component) ![TVIEW];\n const dirIndex = rootTView.data.length - 1;\n\n queueInitHooks(dirIndex, def.onInit, def.doCheck, rootTView);\n // TODO(misko): replace `as TNode` with createTNode call. (needs refactoring to lose dep on\n // LNode).\n queueLifecycleHooks(rootTView, { directiveStart: dirIndex, directiveEnd: dirIndex + 1 } as TNode);\n}\n\n/**\n * Retrieve the root context for any component by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param component any component\n */\nfunction getRootContext(component: any): RootContext {\n const rootContext = getRootView(component)[CONTEXT] as RootContext;\n ngDevMode && assertDefined(rootContext, 'rootContext');\n return rootContext;\n}\n\n\n/**\n * Wait on component until it is rendered.\n *\n * This function returns a `Promise` which is resolved when the component's\n * change detection is executed. This is determined by finding the scheduler\n * associated with the `component`'s render tree and waiting until the scheduler\n * flushes. If nothing is scheduled, the function returns a resolved promise.\n *\n * Example:\n * ```\n * await whenRendered(myComponent);\n * ```\n *\n * @param component Component to wait upon\n * @returns Promise which resolves when the component is rendered.\n */\nexport function whenRendered(component: any): Promise<null> {\n return getRootContext(component).clean;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../../type';\nimport {fillProperties} from '../../util/property';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {ComponentDef, DirectiveDef, DirectiveDefFeature, RenderFlags} from '../interfaces/definition';\n\n\n\n/**\n * Determines if a definition is a {@link ComponentDef} or a {@link DirectiveDef}\n * @param definition The definition to examine\n */\nfunction isComponentDef<T>(definition: ComponentDef<T>| DirectiveDef<T>):\n definition is ComponentDef<T> {\n const def = definition as ComponentDef<T>;\n return typeof def.template === 'function';\n}\n\nfunction getSuperType(type: Type<any>): Type<any>&\n {ngComponentDef?: ComponentDef<any>, ngDirectiveDef?: DirectiveDef<any>} {\n return Object.getPrototypeOf(type.prototype).constructor;\n}\n\n/**\n * Merges the definition from a super class to a sub class.\n * @param definition The definition that is a SubClass of another directive of component\n */\nexport function InheritDefinitionFeature(definition: DirectiveDef<any>| ComponentDef<any>): void {\n let superType = getSuperType(definition.type);\n\n while (superType) {\n let superDef: DirectiveDef<any>|ComponentDef<any>|undefined = undefined;\n if (isComponentDef(definition)) {\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ngComponentDef || superType.ngDirectiveDef;\n } else {\n if (superType.ngComponentDef) {\n throw new Error('Directives cannot inherit Components');\n }\n // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.\n superDef = superType.ngDirectiveDef;\n }\n\n const baseDef = (superType as any).ngBaseDef;\n\n // Some fields in the definition may be empty, if there were no values to put in them that\n // would've justified object creation. Unwrap them if necessary.\n if (baseDef || superDef) {\n const writeableDef = definition as any;\n writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);\n writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);\n writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);\n }\n\n if (baseDef) {\n // Merge inputs and outputs\n fillProperties(definition.inputs, baseDef.inputs);\n fillProperties(definition.declaredInputs, baseDef.declaredInputs);\n fillProperties(definition.outputs, baseDef.outputs);\n }\n\n if (superDef) {\n // Merge hostBindings\n const prevHostBindings = definition.hostBindings;\n const superHostBindings = superDef.hostBindings;\n if (superHostBindings) {\n if (prevHostBindings) {\n definition.hostBindings = (rf: RenderFlags, ctx: any, elementIndex: number) => {\n superHostBindings(rf, ctx, elementIndex);\n prevHostBindings(rf, ctx, elementIndex);\n };\n } else {\n definition.hostBindings = superHostBindings;\n }\n }\n\n // Merge View Queries\n if (isComponentDef(definition) && isComponentDef(superDef)) {\n const prevViewQuery = definition.viewQuery;\n const superViewQuery = superDef.viewQuery;\n if (superViewQuery) {\n if (prevViewQuery) {\n definition.viewQuery = <T>(rf: RenderFlags, ctx: T): void => {\n superViewQuery(rf, ctx);\n prevViewQuery(rf, ctx);\n };\n } else {\n definition.viewQuery = superViewQuery;\n }\n }\n }\n\n // Merge Content Queries\n const prevContentQueries = definition.contentQueries;\n const superContentQueries = superDef.contentQueries;\n if (superContentQueries) {\n if (prevContentQueries) {\n definition.contentQueries = (dirIndex: number) => {\n superContentQueries(dirIndex);\n prevContentQueries(dirIndex);\n };\n } else {\n definition.contentQueries = superContentQueries;\n }\n }\n\n // Merge Content Queries Refresh\n const prevContentQueriesRefresh = definition.contentQueriesRefresh;\n const superContentQueriesRefresh = superDef.contentQueriesRefresh;\n if (superContentQueriesRefresh) {\n if (prevContentQueriesRefresh) {\n definition.contentQueriesRefresh = (directiveIndex: number, queryIndex: number) => {\n superContentQueriesRefresh(directiveIndex, queryIndex);\n prevContentQueriesRefresh(directiveIndex, queryIndex);\n };\n } else {\n definition.contentQueriesRefresh = superContentQueriesRefresh;\n }\n }\n\n\n // Merge inputs and outputs\n fillProperties(definition.inputs, superDef.inputs);\n fillProperties(definition.declaredInputs, superDef.declaredInputs);\n fillProperties(definition.outputs, superDef.outputs);\n\n // Inherit hooks\n // Assume super class inheritance feature has already run.\n definition.afterContentChecked =\n definition.afterContentChecked || superDef.afterContentChecked;\n definition.afterContentInit = definition.afterContentInit || superDef.afterContentInit;\n definition.afterViewChecked = definition.afterViewChecked || superDef.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superDef.afterViewInit;\n definition.doCheck = definition.doCheck || superDef.doCheck;\n definition.onDestroy = definition.onDestroy || superDef.onDestroy;\n definition.onInit = definition.onInit || superDef.onInit;\n\n // Run parent features\n const features = superDef.features;\n if (features) {\n for (const feature of features) {\n if (feature && feature.ngInherit) {\n (feature as DirectiveDefFeature)(definition);\n }\n }\n }\n\n break;\n } else {\n // Even if we don't have a definition, check the type for the hooks and use those if need be\n const superPrototype = superType.prototype;\n\n if (superPrototype) {\n definition.afterContentChecked =\n definition.afterContentChecked || superPrototype.afterContentChecked;\n definition.afterContentInit =\n definition.afterContentInit || superPrototype.afterContentInit;\n definition.afterViewChecked =\n definition.afterViewChecked || superPrototype.afterViewChecked;\n definition.afterViewInit = definition.afterViewInit || superPrototype.afterViewInit;\n definition.doCheck = definition.doCheck || superPrototype.doCheck;\n definition.onDestroy = definition.onDestroy || superPrototype.onDestroy;\n definition.onInit = definition.onInit || superPrototype.onInit;\n }\n }\n\n superType = Object.getPrototypeOf(superType);\n }\n}\n\nfunction maybeUnwrapEmpty<T>(value: T[]): T[];\nfunction maybeUnwrapEmpty<T>(value: T): T;\nfunction maybeUnwrapEmpty(value: any): any {\n if (value === EMPTY_OBJ) {\n return {};\n } else if (value === EMPTY_ARRAY) {\n return [];\n } else {\n return value;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SimpleChange} from '../../change_detection/change_detection_util';\nimport {OnChanges, SimpleChanges} from '../../metadata/lifecycle_hooks';\nimport {DirectiveDef, DirectiveDefFeature} from '../interfaces/definition';\n\nconst PRIVATE_PREFIX = '__ngOnChanges_';\n\ntype OnChangesExpando = OnChanges & {\n __ngOnChanges_: SimpleChanges|null|undefined;\n // tslint:disable-next-line:no-any Can hold any value\n [key: string]: any;\n};\n\n/**\n * The NgOnChangesFeature decorates a component with support for the ngOnChanges\n * lifecycle hook, so it should be included in any component that implements\n * that hook.\n *\n * If the component or directive uses inheritance, the NgOnChangesFeature MUST\n * be included as a feature AFTER {@link InheritDefinitionFeature}, otherwise\n * inherited properties will not be propagated to the ngOnChanges lifecycle\n * hook.\n *\n * Example usage:\n *\n * ```\n * static ngComponentDef = defineComponent({\n * ...\n * inputs: {name: 'publicName'},\n * features: [NgOnChangesFeature]\n * });\n * ```\n */\nexport function NgOnChangesFeature<T>(definition: DirectiveDef<T>): void {\n const publicToDeclaredInputs = definition.declaredInputs;\n const publicToMinifiedInputs = definition.inputs;\n const proto = definition.type.prototype;\n for (const publicName in publicToDeclaredInputs) {\n if (publicToDeclaredInputs.hasOwnProperty(publicName)) {\n const minifiedKey = publicToMinifiedInputs[publicName];\n const declaredKey = publicToDeclaredInputs[publicName];\n const privateMinKey = PRIVATE_PREFIX + minifiedKey;\n\n // Walk the prototype chain to see if we find a property descriptor\n // That way we can honor setters and getters that were inherited.\n let originalProperty: PropertyDescriptor|undefined = undefined;\n let checkProto = proto;\n while (!originalProperty && checkProto &&\n Object.getPrototypeOf(checkProto) !== Object.getPrototypeOf(Object.prototype)) {\n originalProperty = Object.getOwnPropertyDescriptor(checkProto, minifiedKey);\n checkProto = Object.getPrototypeOf(checkProto);\n }\n\n const getter = originalProperty && originalProperty.get;\n const setter = originalProperty && originalProperty.set;\n\n // create a getter and setter for property\n Object.defineProperty(proto, minifiedKey, {\n get: getter ||\n (setter ? undefined : function(this: OnChangesExpando) { return this[privateMinKey]; }),\n set<T>(this: OnChangesExpando, value: T) {\n let simpleChanges = this[PRIVATE_PREFIX];\n if (!simpleChanges) {\n simpleChanges = {};\n // Place where we will store SimpleChanges if there is a change\n Object.defineProperty(this, PRIVATE_PREFIX, {value: simpleChanges, writable: true});\n }\n\n const isFirstChange = !this.hasOwnProperty(privateMinKey);\n const currentChange = simpleChanges[declaredKey];\n\n if (currentChange) {\n currentChange.currentValue = value;\n } else {\n simpleChanges[declaredKey] =\n new SimpleChange(this[privateMinKey], value, isFirstChange);\n }\n\n if (isFirstChange) {\n // Create a place where the actual value will be stored and make it non-enumerable\n Object.defineProperty(this, privateMinKey, {value, writable: true});\n } else {\n this[privateMinKey] = value;\n }\n\n if (setter) setter.call(this, value);\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode\n });\n }\n }\n\n // If an onInit hook is defined, it will need to wrap the ngOnChanges call\n // so the call order is changes-init-check in creation mode. In subsequent\n // change detection runs, only the check wrapper will be called.\n if (definition.onInit != null) {\n definition.onInit = onChangesWrapper(definition.onInit);\n }\n\n definition.doCheck = onChangesWrapper(definition.doCheck);\n}\n\n// This option ensures that the ngOnChanges lifecycle hook will be inherited\n// from superclasses (in InheritDefinitionFeature).\n(NgOnChangesFeature as DirectiveDefFeature).ngInherit = true;\n\nfunction onChangesWrapper(delegateHook: (() => void) | null) {\n return function(this: OnChangesExpando) {\n const simpleChanges = this[PRIVATE_PREFIX];\n if (simpleChanges != null) {\n this.ngOnChanges(simpleChanges);\n this[PRIVATE_PREFIX] = null;\n }\n if (delegateHook) delegateHook.apply(this);\n };\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport function noop(...args: any[]): any {\n // Do nothing.\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectInjector} from '../render3/di';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {noop} from '../util/noop';\nimport {getClosureSafeProperty} from '../util/property';\n\nimport {defineInjectable} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {InjectFlags, inject} from './injector_compatibility';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ConstructorProvider, ExistingProvider, FactoryProvider, StaticClassProvider, StaticProvider, ValueProvider} from './provider';\n\nexport const SOURCE = '__source';\nconst _THROW_IF_NOT_FOUND = new Object();\nexport const THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n\n/**\n * An InjectionToken that gets the current `Injector` for `createInjector()`-style injectors.\n *\n * Requesting this token instead of `Injector` allows `StaticInjector` to be tree-shaken from a\n * project.\n *\n * @publicApi\n */\nexport const INJECTOR = new InjectionToken<Injector>('INJECTOR');\n\nexport class NullInjector implements Injector {\n get(token: any, notFoundValue: any = _THROW_IF_NOT_FOUND): any {\n if (notFoundValue === _THROW_IF_NOT_FOUND) {\n // Intentionally left behind: With dev tools open the debugger will stop here. There is no\n // reason why correctly written application should cause this exception.\n // TODO(misko): uncomment the next line once `ngDevMode` works with closure.\n // if(ngDevMode) debugger;\n throw new Error(`NullInjectorError: No provider for ${stringify(token)}!`);\n }\n return notFoundValue;\n }\n}\n\n/**\n * Concrete injectors implement this interface.\n *\n * For more details, see the [\"Dependency Injection Guide\"](guide/dependency-injection).\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/injector_spec.ts region='Injector'}\n *\n * `Injector` returns itself when given `Injector` as a token:\n *\n * {@example core/di/ts/injector_spec.ts region='injectInjector'}\n *\n * @publicApi\n */\nexport abstract class Injector {\n static THROW_IF_NOT_FOUND = _THROW_IF_NOT_FOUND;\n static NULL: Injector = new NullInjector();\n\n /**\n * Retrieves an instance from the injector based on the provided token.\n * @returns The instance from the injector if defined, otherwise the `notFoundValue`.\n * @throws When the `notFoundValue` is `undefined` or `Injector.THROW_IF_NOT_FOUND`.\n */\n abstract get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n /**\n * @deprecated from v4.0.0 use Type<T> or InjectionToken<T>\n * @suppress {duplicate}\n */\n abstract get(token: any, notFoundValue?: any): any;\n\n /**\n * @deprecated from v5 use the new signature Injector.create(options)\n */\n static create(providers: StaticProvider[], parent?: Injector): Injector;\n\n static create(options: {providers: StaticProvider[], parent?: Injector, name?: string}): Injector;\n\n /**\n * Create a new Injector which is configure using `StaticProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * {@example core/di/ts/provider_spec.ts region='ConstructorProvider'}\n */\n static create(\n options: StaticProvider[]|{providers: StaticProvider[], parent?: Injector, name?: string},\n parent?: Injector): Injector {\n if (Array.isArray(options)) {\n return new StaticInjector(options, parent);\n } else {\n return new StaticInjector(options.providers, options.parent, options.name || null);\n }\n }\n\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'any' as any,\n factory: () => inject(INJECTOR),\n });\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => Injector = () => SWITCH_INJECTOR_FACTORY();\n}\n\nexport const SWITCH_INJECTOR_FACTORY__POST_R3__ = function() {\n return injectInjector();\n};\nconst SWITCH_INJECTOR_FACTORY__PRE_R3__ = noop;\nconst SWITCH_INJECTOR_FACTORY: typeof injectInjector = SWITCH_INJECTOR_FACTORY__PRE_R3__;\n\n\nconst IDENT = function<T>(value: T): T {\n return value;\n};\nconst EMPTY = <any[]>[];\nconst CIRCULAR = IDENT;\nconst MULTI_PROVIDER_FN = function(): any[] {\n return Array.prototype.slice.call(arguments);\n};\nexport const USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\nconst NG_TOKEN_PATH = 'ngTokenPath';\nconst NG_TEMP_TOKEN_PATH = 'ngTempTokenPath';\nconst enum OptionFlags {\n Optional = 1 << 0,\n CheckSelf = 1 << 1,\n CheckParent = 1 << 2,\n Default = CheckSelf | CheckParent\n}\nconst NULL_INJECTOR = Injector.NULL;\nconst NEW_LINE = /\\n/gm;\nconst NO_NEW_LINE = 'ɵ';\n\nexport class StaticInjector implements Injector {\n readonly parent: Injector;\n readonly source: string|null;\n\n private _records: Map<any, Record>;\n\n constructor(\n providers: StaticProvider[], parent: Injector = NULL_INJECTOR, source: string|null = null) {\n this.parent = parent;\n this.source = source;\n const records = this._records = new Map<any, Record>();\n records.set(\n Injector, <Record>{token: Injector, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n records.set(\n INJECTOR, <Record>{token: INJECTOR, fn: IDENT, deps: EMPTY, value: this, useNew: false});\n recursivelyProcessProviders(records, providers);\n }\n\n get<T>(token: Type<T>|InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): T;\n get(token: any, notFoundValue?: any): any;\n get(token: any, notFoundValue?: any, flags: InjectFlags = InjectFlags.Default): any {\n const record = this._records.get(token);\n try {\n return tryResolveToken(token, record, this._records, this.parent, notFoundValue, flags);\n } catch (e) {\n const tokenPath: any[] = e[NG_TEMP_TOKEN_PATH];\n if (token[SOURCE]) {\n tokenPath.unshift(token[SOURCE]);\n }\n e.message = formatError('\\n' + e.message, tokenPath, this.source);\n e[NG_TOKEN_PATH] = tokenPath;\n e[NG_TEMP_TOKEN_PATH] = null;\n throw e;\n }\n }\n\n toString() {\n const tokens = <string[]>[], records = this._records;\n records.forEach((v, token) => tokens.push(stringify(token)));\n return `StaticInjector[${tokens.join(', ')}]`;\n }\n}\n\ntype SupportedProvider =\n ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider;\n\ninterface Record {\n fn: Function;\n useNew: boolean;\n deps: DependencyRecord[];\n value: any;\n}\n\ninterface DependencyRecord {\n token: any;\n options: number;\n}\n\ntype TokenPath = Array<any>;\n\nfunction resolveProvider(provider: SupportedProvider): Record {\n const deps = computeDeps(provider);\n let fn: Function = IDENT;\n let value: any = EMPTY;\n let useNew: boolean = false;\n let provide = resolveForwardRef(provider.provide);\n if (USE_VALUE in provider) {\n // We need to use USE_VALUE in provider since provider.useValue could be defined as undefined.\n value = (provider as ValueProvider).useValue;\n } else if ((provider as FactoryProvider).useFactory) {\n fn = (provider as FactoryProvider).useFactory;\n } else if ((provider as ExistingProvider).useExisting) {\n // Just use IDENT\n } else if ((provider as StaticClassProvider).useClass) {\n useNew = true;\n fn = resolveForwardRef((provider as StaticClassProvider).useClass);\n } else if (typeof provide == 'function') {\n useNew = true;\n fn = provide;\n } else {\n throw staticError(\n 'StaticProvider does not have [useValue|useFactory|useExisting|useClass] or [provide] is not newable',\n provider);\n }\n return {deps, fn, useNew, value};\n}\n\nfunction multiProviderMixError(token: any) {\n return staticError('Cannot mix multi providers and regular providers', token);\n}\n\nfunction recursivelyProcessProviders(records: Map<any, Record>, provider: StaticProvider) {\n if (provider) {\n provider = resolveForwardRef(provider);\n if (provider instanceof Array) {\n // if we have an array recurse into the array\n for (let i = 0; i < provider.length; i++) {\n recursivelyProcessProviders(records, provider[i]);\n }\n } else if (typeof provider === 'function') {\n // Functions were supported in ReflectiveInjector, but are not here. For safety give useful\n // error messages\n throw staticError('Function/Class not supported', provider);\n } else if (provider && typeof provider === 'object' && provider.provide) {\n // At this point we have what looks like a provider: {provide: ?, ....}\n let token = resolveForwardRef(provider.provide);\n const resolvedProvider = resolveProvider(provider);\n if (provider.multi === true) {\n // This is a multi provider.\n let multiProvider: Record|undefined = records.get(token);\n if (multiProvider) {\n if (multiProvider.fn !== MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n } else {\n // Create a placeholder factory which will look up the constituents of the multi provider.\n records.set(token, multiProvider = <Record>{\n token: provider.provide,\n deps: [],\n useNew: false,\n fn: MULTI_PROVIDER_FN,\n value: EMPTY\n });\n }\n // Treat the provider as the token.\n token = provider;\n multiProvider.deps.push({token, options: OptionFlags.Default});\n }\n const record = records.get(token);\n if (record && record.fn == MULTI_PROVIDER_FN) {\n throw multiProviderMixError(token);\n }\n records.set(token, resolvedProvider);\n } else {\n throw staticError('Unexpected provider', provider);\n }\n }\n}\n\nfunction tryResolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n try {\n return resolveToken(token, record, records, parent, notFoundValue, flags);\n } catch (e) {\n // ensure that 'e' is of type Error.\n if (!(e instanceof Error)) {\n e = new Error(e);\n }\n const path: any[] = e[NG_TEMP_TOKEN_PATH] = e[NG_TEMP_TOKEN_PATH] || [];\n path.unshift(token);\n if (record && record.value == CIRCULAR) {\n // Reset the Circular flag.\n record.value = EMPTY;\n }\n throw e;\n }\n}\n\nfunction resolveToken(\n token: any, record: Record | undefined, records: Map<any, Record>, parent: Injector,\n notFoundValue: any, flags: InjectFlags): any {\n let value;\n if (record && !(flags & InjectFlags.SkipSelf)) {\n // If we don't have a record, this implies that we don't own the provider hence don't know how\n // to resolve it.\n value = record.value;\n if (value == CIRCULAR) {\n throw Error(NO_NEW_LINE + 'Circular dependency');\n } else if (value === EMPTY) {\n record.value = CIRCULAR;\n let obj = undefined;\n let useNew = record.useNew;\n let fn = record.fn;\n let depRecords = record.deps;\n let deps = EMPTY;\n if (depRecords.length) {\n deps = [];\n for (let i = 0; i < depRecords.length; i++) {\n const depRecord: DependencyRecord = depRecords[i];\n const options = depRecord.options;\n const childRecord =\n options & OptionFlags.CheckSelf ? records.get(depRecord.token) : undefined;\n deps.push(tryResolveToken(\n // Current Token to resolve\n depRecord.token,\n // A record which describes how to resolve the token.\n // If undefined, this means we don't have such a record\n childRecord,\n // Other records we know about.\n records,\n // If we don't know how to resolve dependency and we should not check parent for it,\n // than pass in Null injector.\n !childRecord && !(options & OptionFlags.CheckParent) ? NULL_INJECTOR : parent,\n options & OptionFlags.Optional ? null : Injector.THROW_IF_NOT_FOUND,\n InjectFlags.Default));\n }\n }\n record.value = value = useNew ? new (fn as any)(...deps) : fn.apply(obj, deps);\n }\n } else if (!(flags & InjectFlags.Self)) {\n value = parent.get(token, notFoundValue, InjectFlags.Default);\n }\n return value;\n}\n\nfunction computeDeps(provider: StaticProvider): DependencyRecord[] {\n let deps: DependencyRecord[] = EMPTY;\n const providerDeps: any[] =\n (provider as ExistingProvider & StaticClassProvider & ConstructorProvider).deps;\n if (providerDeps && providerDeps.length) {\n deps = [];\n for (let i = 0; i < providerDeps.length; i++) {\n let options = OptionFlags.Default;\n let token = resolveForwardRef(providerDeps[i]);\n if (token instanceof Array) {\n for (let j = 0, annotations = token; j < annotations.length; j++) {\n const annotation = annotations[j];\n if (annotation instanceof Optional || annotation == Optional) {\n options = options | OptionFlags.Optional;\n } else if (annotation instanceof SkipSelf || annotation == SkipSelf) {\n options = options & ~OptionFlags.CheckSelf;\n } else if (annotation instanceof Self || annotation == Self) {\n options = options & ~OptionFlags.CheckParent;\n } else if (annotation instanceof Inject) {\n token = (annotation as Inject).token;\n } else {\n token = resolveForwardRef(annotation);\n }\n }\n }\n deps.push({token, options});\n }\n } else if ((provider as ExistingProvider).useExisting) {\n const token = resolveForwardRef((provider as ExistingProvider).useExisting);\n deps = [{token, options: OptionFlags.Default}];\n } else if (!providerDeps && !(USE_VALUE in provider)) {\n // useValue & useExisting are the only ones which are exempt from deps all others need it.\n throw staticError('\\'deps\\' required', provider);\n }\n return deps;\n}\n\nfunction formatError(text: string, obj: any, source: string | null = null): string {\n text = text && text.charAt(0) === '\\n' && text.charAt(1) == NO_NEW_LINE ? text.substr(2) : text;\n let context = stringify(obj);\n if (obj instanceof Array) {\n context = obj.map(stringify).join(' -> ');\n } else if (typeof obj === 'object') {\n let parts = <string[]>[];\n for (let key in obj) {\n if (obj.hasOwnProperty(key)) {\n let value = obj[key];\n parts.push(\n key + ':' + (typeof value === 'string' ? JSON.stringify(value) : stringify(value)));\n }\n }\n context = `{${parts.join(', ')}}`;\n }\n return `StaticInjectorError${source ? '(' + source + ')' : ''}[${context}]: ${text.replace(NEW_LINE, '\\n ')}`;\n}\n\nfunction staticError(text: string, obj: any): Error {\n return new Error(formatError(text, obj));\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {InjectionToken} from './injection_token';\n\n\n/**\n * An internal token whose presence in an injector indicates that the injector should treat itself\n * as a root scoped injector when processing requests for unknown tokens which may indicate\n * they are provided in the root scope.\n */\nexport const APP_ROOT = new InjectionToken<boolean>(\n 'The presence of this token marks an injector as being the root injector.');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OnDestroy} from '../metadata/lifecycle_hooks';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {InjectableDef, InjectableType, InjectorType, InjectorTypeWithProviders, getInjectableDef, getInjectorDef} from './defs';\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {INJECTOR, Injector, NullInjector, THROW_IF_NOT_FOUND, USE_VALUE} from './injector';\nimport {InjectFlags, inject, injectArgs, setCurrentInjector} from './injector_compatibility';\nimport {ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, Provider, StaticClassProvider, StaticProvider, TypeProvider, ValueProvider} from './provider';\nimport {APP_ROOT} from './scope';\n\n\n\n/**\n * Internal type for a single provider in a deep provider array.\n */\ntype SingleProvider = TypeProvider | ValueProvider | ClassProvider | ConstructorProvider |\n ExistingProvider | FactoryProvider | StaticClassProvider;\n\n/**\n * Marker which indicates that a value has not yet been created from the factory function.\n */\nconst NOT_YET = {};\n\n/**\n * Marker which indicates that the factory function for a token is in the process of being called.\n *\n * If the injector is asked to inject a token with its value set to CIRCULAR, that indicates\n * injection of a dependency has recursively attempted to inject the original token, and there is\n * a circular dependency among the providers.\n */\nconst CIRCULAR = {};\n\nconst EMPTY_ARRAY = [] as any[];\n\n/**\n * A lazily initialized NullInjector.\n */\nlet NULL_INJECTOR: Injector|undefined = undefined;\n\nfunction getNullInjector(): Injector {\n if (NULL_INJECTOR === undefined) {\n NULL_INJECTOR = new NullInjector();\n }\n return NULL_INJECTOR;\n}\n\n/**\n * An entry in the injector which tracks information about the given token, including a possible\n * current value.\n */\ninterface Record<T> {\n factory: (() => T)|undefined;\n value: T|{};\n multi: any[]|undefined;\n}\n\n/**\n * Create a new `Injector` which is configured using a `defType` of `InjectorType<any>`s.\n *\n * @publicApi\n */\nexport function createInjector(\n defType: /* InjectorType<any> */ any, parent: Injector | null = null,\n additionalProviders: StaticProvider[] | null = null): Injector {\n parent = parent || getNullInjector();\n return new R3Injector(defType, additionalProviders, parent);\n}\n\nexport class R3Injector {\n /**\n * Map of tokens to records which contain the instances of those tokens.\n */\n private records = new Map<Type<any>|InjectionToken<any>, Record<any>>();\n\n /**\n * The transitive set of `InjectorType`s which define this injector.\n */\n private injectorDefTypes = new Set<InjectorType<any>>();\n\n /**\n * Set of values instantiated by this injector which contain `ngOnDestroy` lifecycle hooks.\n */\n private onDestroy = new Set<OnDestroy>();\n\n /**\n * Flag indicating this injector provides the APP_ROOT_SCOPE token, and thus counts as the\n * root scope.\n */\n private readonly isRootInjector: boolean;\n\n /**\n * Flag indicating that this injector was previously destroyed.\n */\n private destroyed = false;\n\n constructor(\n def: InjectorType<any>, additionalProviders: StaticProvider[]|null,\n readonly parent: Injector) {\n // Start off by creating Records for every provider declared in every InjectorType\n // included transitively in `def`.\n const dedupStack: InjectorType<any>[] = [];\n deepForEach([def], injectorDef => this.processInjectorType(injectorDef, [], dedupStack));\n\n additionalProviders && deepForEach(\n additionalProviders, provider => this.processProvider(\n provider, def, additionalProviders));\n\n\n // Make sure the INJECTOR token provides this injector.\n this.records.set(INJECTOR, makeRecord(undefined, this));\n\n // Detect whether this injector has the APP_ROOT_SCOPE token and thus should provide\n // any injectable scoped to APP_ROOT_SCOPE.\n this.isRootInjector = this.records.has(APP_ROOT);\n\n // Eagerly instantiate the InjectorType classes themselves.\n this.injectorDefTypes.forEach(defType => this.get(defType));\n }\n\n /**\n * Destroy the injector and release references to every instance or provider associated with it.\n *\n * Also calls the `OnDestroy` lifecycle hooks of every instance that was created for which a\n * hook was found.\n */\n destroy(): void {\n this.assertNotDestroyed();\n\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this.destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n } finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }\n\n get<T>(\n token: Type<T>|InjectionToken<T>, notFoundValue: any = THROW_IF_NOT_FOUND,\n flags = InjectFlags.Default): T {\n this.assertNotDestroyed();\n // Set the injection context.\n const previousInjector = setCurrentInjector(this);\n try {\n // Check for the SkipSelf flag.\n if (!(flags & InjectFlags.SkipSelf)) {\n // SkipSelf isn't set, check if the record belongs to this injector.\n let record: Record<T>|undefined = this.records.get(token);\n if (record === undefined) {\n // No record, but maybe the token is scoped to this injector. Look for an ngInjectableDef\n // with a scope matching this injector.\n const def = couldBeInjectableType(token) && getInjectableDef(token);\n if (def && this.injectableDefInScope(def)) {\n // Found an ngInjectableDef and it's scoped to this injector. Pretend as if it was here\n // all along.\n record = makeRecord(injectableDefOrInjectorDefFactory(token), NOT_YET);\n this.records.set(token, record);\n }\n }\n // If a record was found, get the instance for it and return it.\n if (record !== undefined) {\n return this.hydrate(token, record);\n }\n }\n\n // Select the next injector based on the Self flag - if self is set, the next injector is\n // the NullInjector, otherwise it's the parent.\n const nextInjector = !(flags & InjectFlags.Self) ? this.parent : getNullInjector();\n return nextInjector.get(token, notFoundValue);\n } finally {\n // Lastly, clean up the state by restoring the previous injector.\n setCurrentInjector(previousInjector);\n }\n }\n\n private assertNotDestroyed(): void {\n if (this.destroyed) {\n throw new Error('Injector has already been destroyed.');\n }\n }\n\n /**\n * Add an `InjectorType` or `InjectorDefTypeWithProviders` and all of its transitive providers\n * to this injector.\n */\n private processInjectorType(\n defOrWrappedDef: InjectorType<any>|InjectorTypeWithProviders<any>,\n parents: InjectorType<any>[], dedupStack: InjectorType<any>[]) {\n defOrWrappedDef = resolveForwardRef(defOrWrappedDef);\n if (!defOrWrappedDef) return;\n\n // Either the defOrWrappedDef is an InjectorType (with ngInjectorDef) or an\n // InjectorDefTypeWithProviders (aka ModuleWithProviders). Detecting either is a megamorphic\n // read, so care is taken to only do the read once.\n\n // First attempt to read the ngInjectorDef.\n let def = getInjectorDef(defOrWrappedDef);\n\n // If that's not present, then attempt to read ngModule from the InjectorDefTypeWithProviders.\n const ngModule =\n (def == null) && (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule || undefined;\n\n // Determine the InjectorType. In the case where `defOrWrappedDef` is an `InjectorType`,\n // then this is easy. In the case of an InjectorDefTypeWithProviders, then the definition type\n // is the `ngModule`.\n const defType: InjectorType<any> =\n (ngModule === undefined) ? (defOrWrappedDef as InjectorType<any>) : ngModule;\n\n // Check for circular dependencies.\n if (ngDevMode && parents.indexOf(defType) !== -1) {\n const defName = stringify(defType);\n throw new Error(\n `Circular dependency in DI detected for type ${defName}. Dependency path: ${parents.map(defType => stringify(defType)).join(' > ')} > ${defName}.`);\n }\n\n // Check for multiple imports of the same module\n const isDuplicate = dedupStack.indexOf(defType) !== -1;\n\n // If defOrWrappedType was an InjectorDefTypeWithProviders, then .providers may hold some\n // extra providers.\n const providers =\n (ngModule !== undefined) && (defOrWrappedDef as InjectorTypeWithProviders<any>).providers ||\n EMPTY_ARRAY;\n\n // Finally, if defOrWrappedType was an `InjectorDefTypeWithProviders`, then the actual\n // `InjectorDef` is on its `ngModule`.\n if (ngModule !== undefined) {\n def = getInjectorDef(ngModule);\n }\n\n // If no definition was found, it might be from exports. Remove it.\n if (def == null) {\n return;\n }\n\n // Track the InjectorType and add a provider for it.\n this.injectorDefTypes.add(defType);\n this.records.set(defType, makeRecord(def.factory, NOT_YET));\n\n // Add providers in the same way that @NgModule resolution did:\n\n // First, include providers from any imports.\n if (def.imports != null && !isDuplicate) {\n // Before processing defType's imports, add it to the set of parents. This way, if it ends\n // up deeply importing itself, this can be detected.\n ngDevMode && parents.push(defType);\n // Add it to the set of dedups. This way we can detect multiple imports of the same module\n dedupStack.push(defType);\n\n try {\n deepForEach(\n def.imports, imported => this.processInjectorType(imported, parents, dedupStack));\n } finally {\n // Remove it from the parents set when finished.\n ngDevMode && parents.pop();\n }\n }\n\n // Next, include providers listed on the definition itself.\n const defProviders = def.providers;\n if (defProviders != null && !isDuplicate) {\n const injectorType = defOrWrappedDef as InjectorType<any>;\n deepForEach(\n defProviders, provider => this.processProvider(provider, injectorType, defProviders));\n }\n\n // Finally, include providers from an InjectorDefTypeWithProviders if there was one.\n const ngModuleType = (defOrWrappedDef as InjectorTypeWithProviders<any>).ngModule;\n deepForEach(providers, provider => this.processProvider(provider, ngModuleType, providers));\n }\n\n /**\n * Process a `SingleProvider` and add it.\n */\n private processProvider(\n provider: SingleProvider, ngModuleType: InjectorType<any>, providers: any[]): void {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token: any =\n isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (multiRecord.multi === undefined) {\n throw new Error(`Mixed multi-provider for ${token}.`);\n }\n } else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord !.multi !);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi !.push(provider);\n } else {\n const existing = this.records.get(token);\n if (existing && existing.multi !== undefined) {\n throw new Error(`Mixed multi-provider for ${stringify(token)}`);\n }\n }\n this.records.set(token, record);\n }\n\n private hydrate<T>(token: Type<T>|InjectionToken<T>, record: Record<T>): T {\n if (record.value === CIRCULAR) {\n throw new Error(`Cannot instantiate cyclic dependency! ${stringify(token)}`);\n } else if (record.value === NOT_YET) {\n record.value = CIRCULAR;\n record.value = record.factory !();\n }\n if (typeof record.value === 'object' && record.value && hasOnDestroy(record.value)) {\n this.onDestroy.add(record.value);\n }\n return record.value as T;\n }\n\n private injectableDefInScope(def: InjectableDef<any>): boolean {\n if (!def.providedIn) {\n return false;\n } else if (typeof def.providedIn === 'string') {\n return def.providedIn === 'any' || (def.providedIn === 'root' && this.isRootInjector);\n } else {\n return this.injectorDefTypes.has(def.providedIn);\n }\n }\n}\n\nfunction injectableDefOrInjectorDefFactory(token: Type<any>| InjectionToken<any>): () => any {\n const injectableDef = getInjectableDef(token as InjectableType<any>);\n if (injectableDef === null) {\n const injectorDef = getInjectorDef(token as InjectorType<any>);\n if (injectorDef !== null) {\n return injectorDef.factory;\n } else if (token instanceof InjectionToken) {\n throw new Error(`Token ${stringify(token)} is missing an ngInjectableDef definition.`);\n } else if (token instanceof Function) {\n const paramLength = token.length;\n if (paramLength > 0) {\n const args: string[] = new Array(paramLength).fill('?');\n throw new Error(\n `Can't resolve all parameters for ${stringify(token)}: (${args.join(', ')}).`);\n }\n return () => new (token as Type<any>)();\n }\n throw new Error('unreachable');\n }\n return injectableDef.factory;\n}\n\nfunction providerToRecord(\n provider: SingleProvider, ngModuleType: InjectorType<any>, providers: any[]): Record<any> {\n let factory: (() => any)|undefined = providerToFactory(provider, ngModuleType, providers);\n if (isValueProvider(provider)) {\n return makeRecord(undefined, provider.useValue);\n } else {\n return makeRecord(factory, NOT_YET);\n }\n}\n\n/**\n * Converts a `SingleProvider` into a factory function.\n *\n * @param provider provider to convert to factory\n */\nexport function providerToFactory(\n provider: SingleProvider, ngModuleType?: InjectorType<any>, providers?: any[]): () => any {\n let factory: (() => any)|undefined = undefined;\n if (isTypeProvider(provider)) {\n return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));\n } else {\n if (isValueProvider(provider)) {\n factory = () => resolveForwardRef(provider.useValue);\n } else if (isExistingProvider(provider)) {\n factory = () => inject(resolveForwardRef(provider.useExisting));\n } else if (isFactoryProvider(provider)) {\n factory = () => provider.useFactory(...injectArgs(provider.deps || []));\n } else {\n const classRef = resolveForwardRef(\n provider &&\n ((provider as StaticClassProvider | ClassProvider).useClass || provider.provide));\n if (!classRef) {\n let ngModuleDetail = '';\n if (ngModuleType && providers) {\n const providerDetail = providers.map(v => v == provider ? '?' + provider + '?' : '...');\n ngModuleDetail =\n ` - only instances of Provider and Type are allowed, got: [${providerDetail.join(', ')}]`;\n }\n throw new Error(\n `Invalid provider for the NgModule '${stringify(ngModuleType)}'` + ngModuleDetail);\n }\n if (hasDeps(provider)) {\n factory = () => new (classRef)(...injectArgs(provider.deps));\n } else {\n return injectableDefOrInjectorDefFactory(classRef);\n }\n }\n }\n return factory;\n}\n\nfunction makeRecord<T>(\n factory: (() => T) | undefined, value: T | {}, multi: boolean = false): Record<T> {\n return {\n factory: factory,\n value: value,\n multi: multi ? [] : undefined,\n };\n}\n\nfunction deepForEach<T>(input: (T | any[])[], fn: (value: T) => void): void {\n input.forEach(value => Array.isArray(value) ? deepForEach(value, fn) : fn(value));\n}\n\nfunction isValueProvider(value: SingleProvider): value is ValueProvider {\n return value && typeof value == 'object' && USE_VALUE in value;\n}\n\nfunction isExistingProvider(value: SingleProvider): value is ExistingProvider {\n return !!(value && (value as ExistingProvider).useExisting);\n}\n\nfunction isFactoryProvider(value: SingleProvider): value is FactoryProvider {\n return !!(value && (value as FactoryProvider).useFactory);\n}\n\nexport function isTypeProvider(value: SingleProvider): value is TypeProvider {\n return typeof value === 'function';\n}\n\nfunction hasDeps(value: ClassProvider | ConstructorProvider | StaticClassProvider):\n value is ClassProvider&{deps: any[]} {\n return !!(value as any).deps;\n}\n\nfunction hasOnDestroy(value: any): value is OnDestroy {\n return typeof value === 'object' && value != null && (value as OnDestroy).ngOnDestroy &&\n typeof(value as OnDestroy).ngOnDestroy === 'function';\n}\n\nfunction couldBeInjectableType(value: any): value is Type<any>|InjectionToken<any> {\n return (typeof value === 'function') ||\n (typeof value === 'object' && value instanceof InjectionToken);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {Provider} from '../di/provider';\nimport {isTypeProvider, providerToFactory} from '../di/r3_injector';\n\nimport {DirectiveDef} from '.';\nimport {diPublicInInjector, getNodeInjectable, getOrCreateNodeInjectorForNode} from './di';\nimport {directiveInject} from './instructions';\nimport {NodeInjectorFactory} from './interfaces/injector';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNodeFlags, TNodeProviderIndexes} from './interfaces/node';\nimport {LView, TData, TVIEW, TView} from './interfaces/view';\nimport {getLView, getPreviousOrParentTNode} from './state';\nimport {isComponentDef} from './util';\n\n\n\n/**\n * Resolves the providers which are defined in the DirectiveDef.\n *\n * When inserting the tokens and the factories in their respective arrays, we can assume that\n * this method is called first for the component (if any), and then for other directives on the same\n * node.\n * As a consequence,the providers are always processed in that order:\n * 1) The view providers of the component\n * 2) The providers of the component\n * 3) The providers of the other directives\n * This matches the structure of the injectables arrays of a view (for each node).\n * So the tokens and the factories can be pushed at the end of the arrays, except\n * in one case for multi providers.\n *\n * @param def the directive definition\n * @param providers: Array of `providers`.\n * @param viewProviders: Array of `viewProviders`.\n */\nexport function providersResolver<T>(\n def: DirectiveDef<T>, providers: Provider[], viewProviders: Provider[]): void {\n const lView = getLView();\n const tView: TView = lView[TVIEW];\n if (tView.firstTemplatePass) {\n const isComponent = isComponentDef(def);\n\n // The list of view providers is processed first, and the flags are updated\n resolveProvider(viewProviders, tView.data, tView.blueprint, isComponent, true);\n\n // Then, the list of providers is processed, and the flags are updated\n resolveProvider(providers, tView.data, tView.blueprint, isComponent, false);\n }\n}\n\n/**\n * Resolves a provider and publishes it to the DI system.\n */\nfunction resolveProvider(\n provider: Provider, tInjectables: TData, lInjectablesBlueprint: NodeInjectorFactory[],\n isComponent: boolean, isViewProvider: boolean): void {\n provider = resolveForwardRef(provider);\n if (Array.isArray(provider)) {\n // Recursively call `resolveProvider`\n // Recursion is OK in this case because this code will not be in hot-path once we implement\n // cloning of the initial state.\n for (let i = 0; i < provider.length; i++) {\n resolveProvider(\n provider[i], tInjectables, lInjectablesBlueprint, isComponent, isViewProvider);\n }\n } else {\n const lView = getLView();\n let token: any = isTypeProvider(provider) ? provider : resolveForwardRef(provider.provide);\n let providerFactory: () => any = providerToFactory(provider);\n\n const tNode = getPreviousOrParentTNode();\n const beginIndex = tNode.providerIndexes & TNodeProviderIndexes.ProvidersStartIndexMask;\n const endIndex = tNode.directiveStart;\n const cptViewProvidersCount =\n tNode.providerIndexes >> TNodeProviderIndexes.CptViewProvidersCountShift;\n\n if (isTypeProvider(provider) || !provider.multi) {\n // Single provider case: the factory is created and pushed immediately\n const factory = new NodeInjectorFactory(providerFactory, isViewProvider, directiveInject);\n const existingFactoryIndex = indexOf(\n token, tInjectables, isViewProvider ? beginIndex : beginIndex + cptViewProvidersCount,\n endIndex);\n if (existingFactoryIndex == -1) {\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n lView, token);\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n lInjectablesBlueprint[existingFactoryIndex] = factory;\n lView[existingFactoryIndex] = factory;\n }\n } else {\n // Multi provider case:\n // We create a multi factory which is going to aggregate all the values.\n // Since the output of such a factory depends on content or view injection,\n // we create two of them, which are linked together.\n //\n // The first one (for view providers) is always in the first block of the injectables array,\n // and the second one (for providers) is always in the second block.\n // This is important because view providers have higher priority. When a multi token\n // is being looked up, the view providers should be found first.\n // Note that it is not possible to have a multi factory in the third block (directive block).\n //\n // The algorithm to process multi providers is as follows:\n // 1) If the multi provider comes from the `viewProviders` of the component:\n // a) If the special view providers factory doesn't exist, it is created and pushed.\n // b) Else, the multi provider is added to the existing multi factory.\n // 2) If the multi provider comes from the `providers` of the component or of another\n // directive:\n // a) If the multi factory doesn't exist, it is created and provider pushed into it.\n // It is also linked to the multi factory for view providers, if it exists.\n // b) Else, the multi provider is added to the existing multi factory.\n\n const existingProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex + cptViewProvidersCount, endIndex);\n const existingViewProvidersFactoryIndex =\n indexOf(token, tInjectables, beginIndex, beginIndex + cptViewProvidersCount);\n const doesProvidersFactoryExist = existingProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingProvidersFactoryIndex];\n const doesViewProvidersFactoryExist = existingViewProvidersFactoryIndex >= 0 &&\n lInjectablesBlueprint[existingViewProvidersFactoryIndex];\n\n if (isViewProvider && !doesViewProvidersFactoryExist ||\n !isViewProvider && !doesProvidersFactoryExist) {\n // Cases 1.a and 2.a\n diPublicInInjector(\n getOrCreateNodeInjectorForNode(\n tNode as TElementNode | TContainerNode | TElementContainerNode, lView),\n lView, token);\n const factory = multiFactory(\n isViewProvider ? multiViewProvidersFactoryResolver : multiProvidersFactoryResolver,\n lInjectablesBlueprint.length, isViewProvider, isComponent, providerFactory);\n if (!isViewProvider && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory = factory;\n }\n tInjectables.push(token);\n tNode.directiveStart++;\n tNode.directiveEnd++;\n if (isViewProvider) {\n tNode.providerIndexes += TNodeProviderIndexes.CptViewProvidersCountShifter;\n }\n lInjectablesBlueprint.push(factory);\n lView.push(factory);\n } else {\n // Cases 1.b and 2.b\n multiFactoryAdd(\n lInjectablesBlueprint ![isViewProvider ? existingViewProvidersFactoryIndex : existingProvidersFactoryIndex],\n providerFactory, !isViewProvider && isComponent);\n }\n if (!isViewProvider && isComponent && doesViewProvidersFactoryExist) {\n lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders !++;\n }\n }\n }\n}\n\n/**\n * Add a factory in a multi factory.\n */\nfunction multiFactoryAdd(\n multiFactory: NodeInjectorFactory, factory: () => any, isComponentProvider: boolean): void {\n multiFactory.multi !.push(factory);\n if (isComponentProvider) {\n multiFactory.componentProviders !++;\n }\n}\n\n/**\n * Returns the index of item in the array, but only in the begin to end range.\n */\nfunction indexOf(item: any, arr: any[], begin: number, end: number) {\n for (let i = begin; i < end; i++) {\n if (arr[i] === item) return i;\n }\n return -1;\n}\n\n/**\n * Use this with `multi` `providers`.\n */\nfunction multiProvidersFactoryResolver(\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode): any[] {\n return multiResolve(this.multi !, []);\n}\n\n/**\n * Use this with `multi` `viewProviders`.\n *\n * This factory knows how to concatenate itself with the existing `multi` `providers`.\n */\nfunction multiViewProvidersFactoryResolver(\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode): any[] {\n const factories = this.multi !;\n let result: any[];\n if (this.providerFactory) {\n const componentCount = this.providerFactory.componentProviders !;\n const multiProviders = getNodeInjectable(tData, lData, this.providerFactory !.index !, tNode);\n // Copy the section of the array which contains `multi` `providers` from the component\n result = multiProviders.slice(0, componentCount);\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n // Copy the section of the array which contains `multi` `providers` from other directives\n for (let i = componentCount; i < multiProviders.length; i++) {\n result.push(multiProviders[i]);\n }\n } else {\n result = [];\n // Insert the `viewProvider` instances.\n multiResolve(factories, result);\n }\n return result;\n}\n\n/**\n * Maps an array of factories into an array of values.\n */\nfunction multiResolve(factories: Array<() => any>, result: any[]): any[] {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i] !as() => null;\n result.push(factory());\n }\n return result;\n}\n\n/**\n * Creates a multi factory.\n */\nfunction multiFactory(\n factoryFn: (\n this: NodeInjectorFactory, _: null, tData: TData, lData: LView, tNode: TElementNode) => any,\n index: number, isViewProvider: boolean, isComponent: boolean,\n f: () => any): NodeInjectorFactory {\n const factory = new NodeInjectorFactory(factoryFn, isViewProvider, directiveInject);\n factory.multi = [];\n factory.index = index;\n factory.componentProviders = 0;\n multiFactoryAdd(factory, f, isComponent && !isViewProvider);\n return factory;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {Provider} from '../../di/provider';\nimport {providersResolver} from '../di_setup';\nimport {DirectiveDef} from '../interfaces/definition';\n\n/**\n * This feature resolves the providers of a directive (or component),\n * and publish them into the DI system, making it visible to others for injection.\n *\n * For example:\n * class ComponentWithProviders {\n * constructor(private greeter: GreeterDE) {}\n *\n * static ngComponentDef = defineComponent({\n * type: ComponentWithProviders,\n * selectors: [['component-with-providers']],\n * factory: () => new ComponentWithProviders(directiveInject(GreeterDE as any)),\n * consts: 1,\n * vars: 1,\n * template: function(fs: RenderFlags, ctx: ComponentWithProviders) {\n * if (fs & RenderFlags.Create) {\n * text(0);\n * }\n * if (fs & RenderFlags.Update) {\n * textBinding(0, bind(ctx.greeter.greet()));\n * }\n * },\n * features: [ProvidersFeature([GreeterDE])]\n * });\n * }\n *\n * @param definition\n */\nexport function ProvidersFeature<T>(providers: Provider[], viewProviders: Provider[] = []) {\n return (definition: DirectiveDef<T>) => {\n definition.providersResolver = (def: DirectiveDef<T>) =>\n providersResolver(def, providers, viewProviders);\n };\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {ViewRef} from './view_ref';\n\n/**\n * Represents a component created by a `ComponentFactory`.\n * Provides access to the component instance and related objects,\n * and provides the means of destroying the instance.\n *\n * @publicApi\n */\nexport abstract class ComponentRef<C> {\n /**\n * The host or anchor [element](guide/glossary#element) for this component instance.\n */\n abstract get location(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this component instance.\n */\n abstract get injector(): Injector;\n\n /**\n * This component instance.\n */\n abstract get instance(): C;\n\n /**\n * The [host view](guide/glossary#view-tree) defined by the template\n * for this component instance.\n */\n abstract get hostView(): ViewRef;\n\n /**\n * The change detector for this component instance.\n */\n abstract get changeDetectorRef(): ChangeDetectorRef;\n\n /**\n * The component type.\n */\n abstract get componentType(): Type<any>;\n\n /**\n * Destroys the component instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for the component.\n * @param callback A handler function that cleans up developer-defined data\n * associated with this component. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): void;\n}\n\n/**\n * @publicApi\n */\nexport abstract class ComponentFactory<C> {\n /**\n * The component's HTML selector.\n */\n abstract get selector(): string;\n /**\n * The component's type\n */\n abstract get componentType(): Type<any>;\n /**\n * Selector for all <ng-content> elements in the component.\n */\n abstract get ngContentSelectors(): string[];\n /**\n * The inputs of the component.\n */\n abstract get inputs(): {propName: string, templateName: string}[];\n /**\n * The outputs of the component.\n */\n abstract get outputs(): {propName: string, templateName: string}[];\n /**\n * Creates a new component.\n */\n abstract create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {NgModuleRef} from './ng_module_factory';\n\nexport function noComponentFactoryError(component: Function) {\n const error = Error(\n `No component factory found for ${stringify(component)}. Did you add it to @NgModule.entryComponents?`);\n (error as any)[ERROR_COMPONENT] = component;\n return error;\n}\n\nconst ERROR_COMPONENT = 'ngComponent';\n\nexport function getComponent(error: Error): Type<any> {\n return (error as any)[ERROR_COMPONENT];\n}\n\n\nclass _NullComponentFactoryResolver implements ComponentFactoryResolver {\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n throw noComponentFactoryError(component);\n }\n}\n\n/**\n * @publicApi\n */\nexport abstract class ComponentFactoryResolver {\n static NULL: ComponentFactoryResolver = new _NullComponentFactoryResolver();\n abstract resolveComponentFactory<T>(component: Type<T>): ComponentFactory<T>;\n}\n\nexport class CodegenComponentFactoryResolver implements ComponentFactoryResolver {\n private _factories = new Map<any, ComponentFactory<any>>();\n\n constructor(\n factories: ComponentFactory<any>[], private _parent: ComponentFactoryResolver,\n private _ngModule: NgModuleRef<any>) {\n for (let i = 0; i < factories.length; i++) {\n const factory = factories[i];\n this._factories.set(factory.componentType, factory);\n }\n }\n\n resolveComponentFactory<T>(component: {new (...args: any[]): T}): ComponentFactory<T> {\n let factory = this._factories.get(component);\n if (!factory && this._parent) {\n factory = this._parent.resolveComponentFactory(component);\n }\n if (!factory) {\n throw noComponentFactoryError(component);\n }\n return new ComponentFactoryBoundToModule(factory, this._ngModule);\n }\n}\n\nexport class ComponentFactoryBoundToModule<C> extends ComponentFactory<C> {\n readonly selector: string;\n readonly componentType: Type<any>;\n readonly ngContentSelectors: string[];\n readonly inputs: {propName: string, templateName: string}[];\n readonly outputs: {propName: string, templateName: string}[];\n\n constructor(private factory: ComponentFactory<C>, private ngModule: NgModuleRef<any>) {\n super();\n this.selector = factory.selector;\n this.componentType = factory.componentType;\n this.ngContentSelectors = factory.ngContentSelectors;\n this.inputs = factory.inputs;\n this.outputs = factory.outputs;\n }\n\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<C> {\n return this.factory.create(\n injector, projectableNodes, rootSelectorOrNode, ngModule || this.ngModule);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {Type} from '../type';\n\nimport {ComponentFactoryResolver} from './component_factory_resolver';\n\n\n/**\n * Represents an instance of an NgModule created via a {@link NgModuleFactory}.\n *\n * `NgModuleRef` provides access to the NgModule Instance as well other objects related to this\n * NgModule Instance.\n *\n * @publicApi\n */\nexport abstract class NgModuleRef<T> {\n /**\n * The injector that contains all of the providers of the NgModule.\n */\n abstract get injector(): Injector;\n\n /**\n * The ComponentFactoryResolver to get hold of the ComponentFactories\n * declared in the `entryComponents` property of the module.\n */\n abstract get componentFactoryResolver(): ComponentFactoryResolver;\n\n /**\n * The NgModule instance.\n */\n abstract get instance(): T;\n\n /**\n * Destroys the module instance and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Allows to register a callback that will be called when the module is destroyed.\n */\n abstract onDestroy(callback: () => void): void;\n}\n\nexport interface InternalNgModuleRef<T> extends NgModuleRef<T> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _bootstrapComponents: Type<any>[];\n}\n\n/**\n * @publicApi\n */\nexport abstract class NgModuleFactory<T> {\n abstract get moduleType(): Type<T>;\n abstract create(parentInjector: Injector|null): NgModuleRef<T>;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef as viewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {ViewContainerRef as viewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, InternalViewRef as viewEngine_InternalViewRef} from '../linker/view_ref';\n\nimport {checkNoChanges, checkNoChangesInRootView, checkView, detectChangesInRootView, detectChangesInternal, markViewDirty, storeCleanupFn, viewAttached} from './instructions';\nimport {TNode, TNodeType, TViewNode} from './interfaces/node';\nimport {FLAGS, HOST, HOST_NODE, LView, LViewFlags, PARENT, RENDERER_FACTORY} from './interfaces/view';\nimport {destroyLView} from './node_manipulation';\nimport {getNativeByTNode} from './util';\n\n\n\n// Needed due to tsickle downleveling where multiple `implements` with classes creates\n// multiple @extends in Closure annotations, which is illegal. This workaround fixes\n// the multiple @extends by making the annotation @implements instead\nexport interface viewEngine_ChangeDetectorRef_interface extends viewEngine_ChangeDetectorRef {}\n\nexport class ViewRef<T> implements viewEngine_EmbeddedViewRef<T>, viewEngine_InternalViewRef,\n viewEngine_ChangeDetectorRef_interface {\n private _appRef: ApplicationRef|null = null;\n private _viewContainerRef: viewEngine_ViewContainerRef|null = null;\n\n /**\n * @internal\n */\n public _tViewNode: TViewNode|null = null;\n\n /**\n * @internal\n */\n public _lView: LView;\n\n get rootNodes(): any[] {\n if (this._lView[HOST] == null) {\n const tView = this._lView[HOST_NODE] as TViewNode;\n return collectNativeNodes(this._lView, tView, []);\n }\n return [];\n }\n\n constructor(_lView: LView, private _context: T|null, private _componentIndex: number) {\n this._lView = _lView;\n }\n\n get context(): T { return this._context ? this._context : this._lookUpContext(); }\n\n get destroyed(): boolean {\n return (this._lView[FLAGS] & LViewFlags.Destroyed) === LViewFlags.Destroyed;\n }\n\n destroy(): void {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._viewContainerRef) {\n const index = this._viewContainerRef.indexOf(this);\n\n if (index > -1) {\n this._viewContainerRef.detach(index);\n }\n\n this._viewContainerRef = null;\n }\n destroyLView(this._lView);\n }\n\n onDestroy(callback: Function) { storeCleanupFn(this._lView, callback); }\n\n /**\n * Marks a view and all of its ancestors dirty.\n *\n * It also triggers change detection by calling `scheduleTick` internally, which coalesces\n * multiple `markForCheck` calls to into one change detection run.\n *\n * This can be used to ensure an {@link ChangeDetectionStrategy#OnPush OnPush} component is\n * checked when it needs to be re-rendered but the two normal triggers haven't marked it\n * dirty (i.e. inputs haven't changed and events haven't fired in the view).\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Component({\n * selector: 'my-app',\n * template: `Number of ticks: {{numberOfTicks}}`\n * changeDetection: ChangeDetectionStrategy.OnPush,\n * })\n * class AppComponent {\n * numberOfTicks = 0;\n *\n * constructor(private ref: ChangeDetectorRef) {\n * setInterval(() => {\n * this.numberOfTicks++;\n * // the following is required, otherwise the view will not be updated\n * this.ref.markForCheck();\n * }, 1000);\n * }\n * }\n * ```\n */\n markForCheck(): void { markViewDirty(this._lView); }\n\n /**\n * Detaches the view from the change detection tree.\n *\n * Detached views will not be checked during change detection runs until they are\n * re-attached, even if they are dirty. `detach` can be used in combination with\n * {@link ChangeDetectorRef#detectChanges detectChanges} to implement local change\n * detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds. We can do that by detaching\n * the component's change detector and doing a local check every five seconds.\n *\n * ```typescript\n * class DataProvider {\n * // in a real application the returned data will be different every time\n * get data() {\n * return [1,2,3,4,5];\n * }\n * }\n *\n * @Component({\n * selector: 'giant-list',\n * template: `\n * <li *ngFor=\"let d of dataProvider.data\">Data {{d}}</li>\n * `,\n * })\n * class GiantList {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {\n * ref.detach();\n * setInterval(() => {\n * this.ref.detectChanges();\n * }, 5000);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * providers: [DataProvider],\n * template: `\n * <giant-list><giant-list>\n * `,\n * })\n * class App {\n * }\n * ```\n */\n detach(): void { this._lView[FLAGS] &= ~LViewFlags.Attached; }\n\n /**\n * Re-attaches a view to the change detection tree.\n *\n * This can be used to re-attach views that were previously detached from the tree\n * using {@link ChangeDetectorRef#detach detach}. Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates a component displaying `live` data. The component will detach\n * its change detector from the main change detector tree when the component's live property\n * is set to false.\n *\n * ```typescript\n * class DataProvider {\n * data = 1;\n *\n * constructor() {\n * setInterval(() => {\n * this.data = this.data * 2;\n * }, 500);\n * }\n * }\n *\n * @Component({\n * selector: 'live-data',\n * inputs: ['live'],\n * template: 'Data: {{dataProvider.data}}'\n * })\n * class LiveData {\n * constructor(private ref: ChangeDetectorRef, private dataProvider: DataProvider) {}\n *\n * set live(value) {\n * if (value) {\n * this.ref.reattach();\n * } else {\n * this.ref.detach();\n * }\n * }\n * }\n *\n * @Component({\n * selector: 'my-app',\n * providers: [DataProvider],\n * template: `\n * Live Update: <input type=\"checkbox\" [(ngModel)]=\"live\">\n * <live-data [live]=\"live\"><live-data>\n * `,\n * })\n * class AppComponent {\n * live = true;\n * }\n * ```\n */\n reattach(): void { this._lView[FLAGS] |= LViewFlags.Attached; }\n\n /**\n * Checks the view and its children.\n *\n * This can also be used in combination with {@link ChangeDetectorRef#detach detach} to implement\n * local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n * @usageNotes\n * ### Example\n *\n * The following example defines a component with a large list of readonly data.\n * Imagine, the data changes constantly, many times per second. For performance reasons,\n * we want to check and update the list every five seconds.\n *\n * We can do that by detaching the component's change detector and doing a local change detection\n * check every five seconds.\n *\n * See {@link ChangeDetectorRef#detach detach} for more information.\n */\n detectChanges(): void { detectChangesInternal(this._lView, this.context); }\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * This is used in development mode to verify that running change detection doesn't\n * introduce other changes.\n */\n checkNoChanges(): void { checkNoChanges(this.context); }\n\n attachToViewContainerRef(vcRef: viewEngine_ViewContainerRef) {\n if (this._appRef) {\n throw new Error('This view is already attached directly to the ApplicationRef!');\n }\n this._viewContainerRef = vcRef;\n }\n\n detachFromAppRef() { this._appRef = null; }\n\n attachToAppRef(appRef: ApplicationRef) {\n if (this._viewContainerRef) {\n throw new Error('This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n\n private _lookUpContext(): T {\n return this._context = this._lView[PARENT] ![this._componentIndex] as T;\n }\n}\n\n/** @internal */\nexport class RootViewRef<T> extends ViewRef<T> {\n constructor(public _view: LView) { super(_view, null, -1); }\n\n detectChanges(): void { detectChangesInRootView(this._view); }\n\n checkNoChanges(): void { checkNoChangesInRootView(this._view); }\n\n get context(): T { return null !; }\n}\n\nfunction collectNativeNodes(lView: LView, parentTNode: TNode, result: any[]): any[] {\n let tNodeChild = parentTNode.child;\n\n while (tNodeChild) {\n result.push(getNativeByTNode(tNodeChild, lView));\n if (tNodeChild.type === TNodeType.ElementContainer) {\n collectNativeNodes(lView, tNodeChild, result);\n }\n tNodeChild = tNodeChild.next;\n }\n\n return result;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef as ViewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {Injector, NullInjector} from '../di/injector';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef as ViewEngine_ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef as viewEngine_EmbeddedViewRef, ViewRef as viewEngine_ViewRef} from '../linker/view_ref';\nimport {Renderer2} from '../render/api';\nimport {assertDefined, assertGreaterThan, assertLessThan} from './assert';\nimport {NodeInjector, getParentInjectorLocation} from './di';\nimport {addToViewTree, createEmbeddedViewAndNode, createLContainer, renderEmbeddedTemplate} from './instructions';\nimport {ACTIVE_INDEX, LContainer, NATIVE, VIEWS} from './interfaces/container';\nimport {RenderFlags} from './interfaces/definition';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, TViewNode} from './interfaces/node';\nimport {LQueries} from './interfaces/query';\nimport {RComment, RElement, Renderer3, isProceduralRenderer} from './interfaces/renderer';\nimport {CONTAINER_INDEX, CONTEXT, HOST_NODE, LView, QUERIES, RENDERER, TView} from './interfaces/view';\nimport {assertNodeOfPossibleTypes} from './node_assert';\nimport {addRemoveViewFromContainer, appendChild, detachView, getBeforeNodeForView, insertView, nativeInsertBefore, nativeNextSibling, nativeParentNode, removeView} from './node_manipulation';\nimport {getLView, getPreviousOrParentTNode} from './state';\nimport {findComponentView, getComponentViewByIndex, getNativeByTNode, getParentInjectorTNode, getParentInjectorView, hasParentInjector, isComponent, isLContainer, isRootView} from './util';\nimport {ViewRef} from './view_ref';\n\n\n/**\n * Creates an ElementRef from the most recent node.\n *\n * @returns The ElementRef instance to use\n */\nexport function injectElementRef(ElementRefToken: typeof ViewEngine_ElementRef):\n ViewEngine_ElementRef {\n return createElementRef(ElementRefToken, getPreviousOrParentTNode(), getLView());\n}\n\nlet R3ElementRef: {new (native: RElement | RComment): ViewEngine_ElementRef};\n\n/**\n * Creates an ElementRef given a node.\n *\n * @param ElementRefToken The ElementRef type\n * @param tNode The node for which you'd like an ElementRef\n * @param view The view to which the node belongs\n * @returns The ElementRef instance to use\n */\nexport function createElementRef(\n ElementRefToken: typeof ViewEngine_ElementRef, tNode: TNode,\n view: LView): ViewEngine_ElementRef {\n if (!R3ElementRef) {\n // TODO: Fix class name, should be ElementRef, but there appears to be a rollup bug\n R3ElementRef = class ElementRef_ extends ElementRefToken {};\n }\n return new R3ElementRef(getNativeByTNode(tNode, view));\n}\n\nlet R3TemplateRef: {\n new (\n _declarationParentView: LView, elementRef: ViewEngine_ElementRef, _tView: TView,\n _renderer: Renderer3, _queries: LQueries | null, _injectorIndex: number):\n ViewEngine_TemplateRef<any>\n};\n\n/**\n * Creates a TemplateRef given a node.\n *\n * @returns The TemplateRef instance to use\n */\nexport function injectTemplateRef<T>(\n TemplateRefToken: typeof ViewEngine_TemplateRef,\n ElementRefToken: typeof ViewEngine_ElementRef): ViewEngine_TemplateRef<T>|null {\n return createTemplateRef<T>(\n TemplateRefToken, ElementRefToken, getPreviousOrParentTNode(), getLView());\n}\n\n/**\n * Creates a TemplateRef and stores it on the injector.\n *\n * @param TemplateRefToken The TemplateRef type\n * @param ElementRefToken The ElementRef type\n * @param hostTNode The node that is requesting a TemplateRef\n * @param hostView The view to which the node belongs\n * @returns The TemplateRef instance to use\n */\nexport function createTemplateRef<T>(\n TemplateRefToken: typeof ViewEngine_TemplateRef, ElementRefToken: typeof ViewEngine_ElementRef,\n hostTNode: TNode, hostView: LView): ViewEngine_TemplateRef<T>|null {\n if (!R3TemplateRef) {\n // TODO: Fix class name, should be TemplateRef, but there appears to be a rollup bug\n R3TemplateRef = class TemplateRef_<T> extends TemplateRefToken<T> {\n constructor(\n private _declarationParentView: LView, readonly elementRef: ViewEngine_ElementRef,\n private _tView: TView, private _renderer: Renderer3, private _queries: LQueries|null,\n private _injectorIndex: number) {\n super();\n }\n\n createEmbeddedView(\n context: T, container?: LContainer,\n hostTNode?: TElementNode|TContainerNode|TElementContainerNode, hostView?: LView,\n index?: number): viewEngine_EmbeddedViewRef<T> {\n const lView = createEmbeddedViewAndNode(\n this._tView, context, this._declarationParentView, this._renderer, this._queries,\n this._injectorIndex);\n if (container) {\n insertView(lView, container, hostView !, index !, hostTNode !.index);\n }\n renderEmbeddedTemplate(lView, this._tView, context);\n const viewRef = new ViewRef(lView, context, -1);\n viewRef._tViewNode = lView[HOST_NODE] as TViewNode;\n return viewRef;\n }\n };\n }\n\n if (hostTNode.type === TNodeType.Container) {\n const hostContainer: LContainer = hostView[hostTNode.index];\n ngDevMode && assertDefined(hostTNode.tViews, 'TView must be allocated');\n return new R3TemplateRef(\n hostView, createElementRef(ElementRefToken, hostTNode, hostView), hostTNode.tViews as TView,\n getLView()[RENDERER], hostContainer[QUERIES], hostTNode.injectorIndex);\n } else {\n return null;\n }\n}\n\nlet R3ViewContainerRef: {\n new (\n lContainer: LContainer, hostTNode: TElementNode | TContainerNode | TElementContainerNode,\n hostView: LView): ViewEngine_ViewContainerRef\n};\n\n/**\n * Creates a ViewContainerRef and stores it on the injector. Or, if the ViewContainerRef\n * already exists, retrieves the existing ViewContainerRef.\n *\n * @returns The ViewContainerRef instance to use\n */\nexport function injectViewContainerRef(\n ViewContainerRefToken: typeof ViewEngine_ViewContainerRef,\n ElementRefToken: typeof ViewEngine_ElementRef): ViewEngine_ViewContainerRef {\n const previousTNode =\n getPreviousOrParentTNode() as TElementNode | TElementContainerNode | TContainerNode;\n return createContainerRef(ViewContainerRefToken, ElementRefToken, previousTNode, getLView());\n}\n\n/**\n * Creates a ViewContainerRef and stores it on the injector.\n *\n * @param ViewContainerRefToken The ViewContainerRef type\n * @param ElementRefToken The ElementRef type\n * @param hostTNode The node that is requesting a ViewContainerRef\n * @param hostView The view to which the node belongs\n * @returns The ViewContainerRef instance to use\n */\nexport function createContainerRef(\n ViewContainerRefToken: typeof ViewEngine_ViewContainerRef,\n ElementRefToken: typeof ViewEngine_ElementRef,\n hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n hostView: LView): ViewEngine_ViewContainerRef {\n if (!R3ViewContainerRef) {\n // TODO: Fix class name, should be ViewContainerRef, but there appears to be a rollup bug\n R3ViewContainerRef = class ViewContainerRef_ extends ViewContainerRefToken {\n private _viewRefs: viewEngine_ViewRef[] = [];\n\n constructor(\n private _lContainer: LContainer,\n private _hostTNode: TElementNode|TContainerNode|TElementContainerNode,\n private _hostView: LView) {\n super();\n }\n\n get element(): ViewEngine_ElementRef {\n return createElementRef(ElementRefToken, this._hostTNode, this._hostView);\n }\n\n get injector(): Injector { return new NodeInjector(this._hostTNode, this._hostView); }\n\n /** @deprecated No replacement */\n get parentInjector(): Injector {\n const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostView);\n const parentView = getParentInjectorView(parentLocation, this._hostView);\n const parentTNode = getParentInjectorTNode(parentLocation, this._hostView, this._hostTNode);\n\n return !hasParentInjector(parentLocation) || parentTNode == null ?\n new NodeInjector(null, this._hostView) :\n new NodeInjector(parentTNode, parentView);\n }\n\n clear(): void {\n while (this._lContainer[VIEWS].length) {\n this.remove(0);\n }\n }\n\n get(index: number): viewEngine_ViewRef|null { return this._viewRefs[index] || null; }\n\n get length(): number { return this._lContainer[VIEWS].length; }\n\n createEmbeddedView<C>(templateRef: ViewEngine_TemplateRef<C>, context?: C, index?: number):\n viewEngine_EmbeddedViewRef<C> {\n const adjustedIdx = this._adjustIndex(index);\n const viewRef = (templateRef as any)\n .createEmbeddedView(\n context || <any>{}, this._lContainer, this._hostTNode,\n this._hostView, adjustedIdx);\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: viewEngine_ComponentFactory<C>, index?: number|undefined,\n injector?: Injector|undefined, projectableNodes?: any[][]|undefined,\n ngModuleRef?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && (componentFactory as any).ngModule == null && contextInjector) {\n ngModuleRef = contextInjector.get(viewEngine_NgModuleRef, null);\n }\n\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: viewEngine_ViewRef, index?: number): viewEngine_ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const lView = (viewRef as ViewRef<any>)._lView !;\n const adjustedIdx = this._adjustIndex(index);\n\n insertView(lView, this._lContainer, this._hostView, adjustedIdx, this._hostTNode.index);\n\n const beforeNode =\n getBeforeNodeForView(adjustedIdx, this._lContainer[VIEWS], this._lContainer[NATIVE]);\n addRemoveViewFromContainer(lView, true, beforeNode);\n\n (viewRef as ViewRef<any>).attachToViewContainerRef(this);\n this._viewRefs.splice(adjustedIdx, 0, viewRef);\n\n return viewRef;\n }\n\n move(viewRef: viewEngine_ViewRef, newIndex: number): viewEngine_ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const index = this.indexOf(viewRef);\n this.detach(index);\n this.insert(viewRef, this._adjustIndex(newIndex));\n return viewRef;\n }\n\n indexOf(viewRef: viewEngine_ViewRef): number { return this._viewRefs.indexOf(viewRef); }\n\n remove(index?: number): void {\n const adjustedIdx = this._adjustIndex(index, -1);\n removeView(this._lContainer, this._hostTNode, adjustedIdx);\n this._viewRefs.splice(adjustedIdx, 1);\n }\n\n detach(index?: number): viewEngine_ViewRef|null {\n const adjustedIdx = this._adjustIndex(index, -1);\n const view = detachView(this._lContainer, adjustedIdx, !!this._hostTNode.detached);\n const wasDetached = this._viewRefs.splice(adjustedIdx, 1)[0] != null;\n return wasDetached ? new ViewRef(view, view[CONTEXT], view[CONTAINER_INDEX]) : null;\n }\n\n private _adjustIndex(index?: number, shift: number = 0) {\n if (index == null) {\n return this._lContainer[VIEWS].length + shift;\n }\n if (ngDevMode) {\n assertGreaterThan(index, -1, 'index must be positive');\n // +1 because it's legal to insert at the end.\n assertLessThan(index, this._lContainer[VIEWS].length + 1 + shift, 'index');\n }\n return index;\n }\n };\n }\n\n ngDevMode && assertNodeOfPossibleTypes(\n hostTNode, TNodeType.Container, TNodeType.Element, TNodeType.ElementContainer);\n\n let lContainer: LContainer;\n const slotValue = hostView[hostTNode.index];\n if (isLContainer(slotValue)) {\n // If the host is a container, we don't need to create a new LContainer\n lContainer = slotValue;\n lContainer[ACTIVE_INDEX] = -1;\n } else {\n const commentNode = hostView[RENDERER].createComment(ngDevMode ? 'container' : '');\n ngDevMode && ngDevMode.rendererCreateComment++;\n\n // A container can be created on the root (topmost / bootstrapped) component and in this case we\n // can't use LTree to insert container's marker node (both parent of a comment node and the\n // commend node itself is located outside of elements hold by LTree). In this specific case we\n // use low-level DOM manipulation to insert container's marker (comment) node.\n if (isRootView(hostView)) {\n const renderer = hostView[RENDERER];\n const hostNative = getNativeByTNode(hostTNode, hostView) !;\n const parentOfHostNative = nativeParentNode(renderer, hostNative);\n nativeInsertBefore(\n renderer, parentOfHostNative !, commentNode, nativeNextSibling(renderer, hostNative));\n } else {\n appendChild(commentNode, hostTNode, hostView);\n }\n\n hostView[hostTNode.index] = lContainer =\n createLContainer(slotValue, hostTNode, hostView, commentNode, true);\n\n addToViewTree(hostView, hostTNode.index as number, lContainer);\n }\n\n return new R3ViewContainerRef(lContainer, hostTNode, hostView);\n}\n\n\n/** Returns a ChangeDetectorRef (a.k.a. a ViewRef) */\nexport function injectChangeDetectorRef(): ViewEngine_ChangeDetectorRef {\n return createViewRef(getPreviousOrParentTNode(), getLView(), null);\n}\n\n/**\n * Creates a ViewRef and stores it on the injector as ChangeDetectorRef (public alias).\n *\n * @param hostTNode The node that is requesting a ChangeDetectorRef\n * @param hostView The view to which the node belongs\n * @param context The context for this change detector ref\n * @returns The ChangeDetectorRef to use\n */\nexport function createViewRef(\n hostTNode: TNode, hostView: LView, context: any): ViewEngine_ChangeDetectorRef {\n if (isComponent(hostTNode)) {\n const componentIndex = hostTNode.directiveStart;\n const componentView = getComponentViewByIndex(hostTNode.index, hostView);\n return new ViewRef(componentView, context, componentIndex);\n } else if (hostTNode.type === TNodeType.Element) {\n const hostComponentView = findComponentView(hostView);\n return new ViewRef(hostComponentView, hostComponentView[CONTEXT], -1);\n }\n return null !;\n}\n\nfunction getOrCreateRenderer2(view: LView): Renderer2 {\n const renderer = view[RENDERER];\n if (isProceduralRenderer(renderer)) {\n return renderer as Renderer2;\n } else {\n throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');\n }\n}\n\n/** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */\nexport function injectRenderer2(): Renderer2 {\n return getOrCreateRenderer2(getLView());\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectElementRef as render3InjectElementRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\n/**\n * A wrapper around a native element inside of a View.\n *\n * An `ElementRef` is backed by a render-specific element. In the browser, this is usually a DOM\n * element.\n *\n * @security Permitting direct access to the DOM can make your application more vulnerable to\n * XSS attacks. Carefully review any use of `ElementRef` in your code. For more detail, see the\n * [Security Guide](http://g.co/ng/security).\n *\n * @publicApi\n */\n// Note: We don't expose things like `Injector`, `ViewContainer`, ... here,\n// i.e. users have to ask for what they need. With that, we can build better analysis tools\n// and could do better codegen in the future.\nexport class ElementRef<T = any> {\n /**\n * The underlying native element or `null` if direct access to native elements is not supported\n * (e.g. when the application runs in a web worker).\n *\n * <div class=\"callout is-critical\">\n * <header>Use with caution</header>\n * <p>\n * Use this API as the last resort when direct access to DOM is needed. Use templating and\n * data-binding provided by Angular instead. Alternatively you can take a look at {@link\n * Renderer2}\n * which provides API that can safely be used even when direct access to native elements is not\n * supported.\n * </p>\n * <p>\n * Relying on direct DOM access creates tight coupling between your application and rendering\n * layers which will make it impossible to separate the two and deploy your application into a\n * web worker.\n * </p>\n * </div>\n *\n */\n public nativeElement: T;\n\n constructor(nativeElement: T) { this.nativeElement = nativeElement; }\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => ElementRef = () => SWITCH_ELEMENT_REF_FACTORY(ElementRef);\n}\n\nexport const SWITCH_ELEMENT_REF_FACTORY__POST_R3__ = render3InjectElementRef;\nconst SWITCH_ELEMENT_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_ELEMENT_REF_FACTORY: typeof render3InjectElementRef =\n SWITCH_ELEMENT_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {injectRenderer2 as render3InjectRenderer2} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\n\n/**\n * @deprecated Use `RendererType2` (and `Renderer2`) instead.\n * @publicApi\n */\nexport class RenderComponentType {\n constructor(\n public id: string, public templateUrl: string, public slotCount: number,\n public encapsulation: ViewEncapsulation, public styles: Array<string|any[]>,\n public animations: any) {}\n}\n\n/**\n * @deprecated Debug info is handled internally in the view engine now.\n */\nexport abstract class RenderDebugInfo {\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get source(): string;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n */\nexport interface DirectRenderer {\n remove(node: any): void;\n appendChild(node: any, parent: any): void;\n insertBefore(node: any, refNode: any): void;\n nextSibling(node: any): any;\n parentElement(node: any): any;\n}\n\n/**\n * @deprecated Use the `Renderer2` instead.\n * @publicApi\n */\nexport abstract class Renderer {\n abstract selectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo): any;\n\n abstract createElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo): any;\n\n abstract createViewRoot(hostElement: any): any;\n\n abstract createTemplateAnchor(parentElement: any, debugInfo?: RenderDebugInfo): any;\n\n abstract createText(parentElement: any, value: string, debugInfo?: RenderDebugInfo): any;\n\n abstract projectNodes(parentElement: any, nodes: any[]): void;\n\n abstract attachViewAfter(node: any, viewRootNodes: any[]): void;\n\n abstract detachView(viewRootNodes: any[]): void;\n\n abstract destroyView(hostElement: any, viewAllNodes: any[]): void;\n\n abstract listen(renderElement: any, name: string, callback: Function): Function;\n\n abstract listenGlobal(target: string, name: string, callback: Function): Function;\n\n abstract setElementProperty(renderElement: any, propertyName: string, propertyValue: any): void;\n\n abstract setElementAttribute(renderElement: any, attributeName: string, attributeValue?: string):\n void;\n\n /**\n * Used only in debug mode to serialize property changes to dom nodes as attributes.\n */\n abstract setBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string):\n void;\n\n abstract setElementClass(renderElement: any, className: string, isAdd: boolean): void;\n\n abstract setElementStyle(renderElement: any, styleName: string, styleValue?: string): void;\n\n abstract invokeElementMethod(renderElement: any, methodName: string, args?: any[]): void;\n\n abstract setText(renderNode: any, text: string): void;\n\n abstract animate(\n element: any, startingStyles: any, keyframes: any[], duration: number, delay: number,\n easing: string, previousPlayers?: any[]): any;\n}\n\nexport const Renderer2Interceptor = new InjectionToken<Renderer2[]>('Renderer2Interceptor');\n\n/**\n * Injectable service that provides a low-level interface for modifying the UI.\n *\n * Use this service to bypass Angular's templating and make custom UI changes that can't be\n * expressed declaratively. For example if you need to set a property or an attribute whose name is\n * not statically known, use {@link Renderer#setElementProperty setElementProperty} or\n * {@link Renderer#setElementAttribute setElementAttribute} respectively.\n *\n * If you are implementing a custom renderer, you must implement this interface.\n *\n * The default Renderer implementation is `DomRenderer`. Also available is `WebWorkerRenderer`.\n *\n * @deprecated Use `RendererFactory2` instead.\n * @publicApi\n */\nexport abstract class RootRenderer {\n abstract renderComponent(componentType: RenderComponentType): Renderer;\n}\n\n/**\n * Used by `RendererFactory2` to associate custom rendering data and styles\n * with a rendering implementation.\n * @publicApi\n */\nexport interface RendererType2 {\n /**\n * A unique identifying string for the new renderer, used when creating\n * unique styles for encapsulation.\n */\n id: string;\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [Shadow\n * DOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n encapsulation: ViewEncapsulation;\n /**\n * Defines CSS styles to be stored on a renderer instance.\n */\n styles: (string|any[])[];\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n data: {[kind: string]: any};\n}\n\n/**\n * Creates and initializes a custom renderer that implements the `Renderer2` base class.\n *\n * @publicApi\n */\nexport abstract class RendererFactory2 {\n /**\n * Creates and initializes a custom renderer for a host DOM element.\n * @param hostElement The element to render.\n * @param type The base class to implement.\n * @returns The new custom renderer instance.\n */\n abstract createRenderer(hostElement: any, type: RendererType2|null): Renderer2;\n /**\n * A callback invoked when rendering has begun.\n */\n abstract begin?(): void;\n /**\n * A callback invoked when rendering has completed.\n */\n abstract end?(): void;\n /**\n * Use with animations test-only mode. Notifies the test when rendering has completed.\n * @returns The asynchronous result of the developer-defined function.\n */\n abstract whenRenderingDone?(): Promise<any>;\n}\n\n/**\n * Flags for renderer-specific style modifiers.\n * @publicApi\n */\nexport enum RendererStyleFlags2 {\n /**\n * Marks a style as important.\n */\n Important = 1 << 0,\n /**\n * Marks a style as using dash case naming (this-is-dash-case).\n */\n DashCase = 1 << 1\n}\n\n/**\n * Extend this base class to implement custom rendering. By default, Angular\n * renders a template into DOM. You can use custom rendering to intercept\n * rendering calls, or to render to something other than DOM.\n *\n * Create your custom renderer using `RendererFactory2`.\n *\n * Use a custom renderer to bypass Angular's templating and\n * make custom UI changes that can't be expressed declaratively.\n * For example if you need to set a property or an attribute whose name is\n * not statically known, use the `setProperty()` or\n * `setAttribute()` method.\n *\n * @publicApi\n */\nexport abstract class Renderer2 {\n /**\n * Use to store arbitrary developer-defined data on a renderer instance,\n * as an object containing key-value pairs.\n * This is useful for renderers that delegate to other renderers.\n */\n abstract get data(): {[key: string]: any};\n\n /**\n * Implement this callback to destroy the renderer or the host element.\n */\n abstract destroy(): void;\n /**\n * Implement this callback to create an instance of the host element.\n * @param name An identifying name for the new element, unique within the namespace.\n * @param namespace The namespace for the new element.\n * @returns The new element.\n */\n abstract createElement(name: string, namespace?: string|null): any;\n /**\n * Implement this callback to add a comment to the DOM of the host element.\n * @param value The comment text.\n * @returns The modified element.\n */\n abstract createComment(value: string): any;\n\n /**\n * Implement this callback to add text to the DOM of the host element.\n * @param value The text string.\n * @returns The modified element.\n */\n abstract createText(value: string): any;\n /**\n * If null or undefined, the view engine won't call it.\n * This is used as a performance optimization for production mode.\n */\n // TODO(issue/24571): remove '!'.\n destroyNode !: ((node: any) => void) | null;\n /**\n * Appends a child to a given parent node in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child node.\n */\n abstract appendChild(parent: any, newChild: any): void;\n /**\n * Implement this callback to insert a child node at a given position in a parent node\n * in the host element DOM.\n * @param parent The parent node.\n * @param newChild The new child nodes.\n * @param refChild The existing child node that should precede the new node.\n */\n abstract insertBefore(parent: any, newChild: any, refChild: any): void;\n /**\n * Implement this callback to remove a child node from the host element's DOM.\n * @param parent The parent node.\n * @param oldChild The child node to remove.\n */\n abstract removeChild(parent: any, oldChild: any): void;\n /**\n * Implement this callback to prepare an element to be bootstrapped\n * as a root element, and return the element instance.\n * @param selectorOrNode The DOM element.\n * @param preserveContent Whether the contents of the root element\n * should be preserved, or cleared upon bootstrap (default behavior).\n * Use with `ViewEncapsulation.ShadowDom` to allow simple native\n * content projection via `<slot>` elements.\n * @returns The root element.\n */\n abstract selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any;\n /**\n * Implement this callback to get the parent of a given node\n * in the host element's DOM.\n * @param node The child node to query.\n * @returns The parent node, or null if there is no parent.\n * For WebWorkers, always returns true.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract parentNode(node: any): any;\n /**\n * Implement this callback to get the next sibling node of a given node\n * in the host element's DOM.\n * @returns The sibling node, or null if there is no sibling.\n * For WebWorkers, always returns a value.\n * This is because the check is synchronous,\n * and the caller can't rely on checking for null.\n */\n abstract nextSibling(node: any): any;\n /**\n * Implement this callback to set an attribute value for an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param value The new value.\n * @param namespace The namespace.\n */\n abstract setAttribute(el: any, name: string, value: string, namespace?: string|null): void;\n\n /**\n * Implement this callback to remove an attribute from an element in the DOM.\n * @param el The element.\n * @param name The attribute name.\n * @param namespace The namespace.\n */\n abstract removeAttribute(el: any, name: string, namespace?: string|null): void;\n /**\n * Implement this callback to add a class to an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract addClass(el: any, name: string): void;\n\n /**\n * Implement this callback to remove a class from an element in the DOM.\n * @param el The element.\n * @param name The class name.\n */\n abstract removeClass(el: any, name: string): void;\n\n /**\n * Implement this callback to set a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param value The new value.\n * @param flags Flags for style variations. No flags are set by default.\n */\n abstract setStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to remove the value from a CSS style for an element in the DOM.\n * @param el The element.\n * @param style The name of the style.\n * @param flags Flags for style variations to remove, if set. ???\n */\n abstract removeStyle(el: any, style: string, flags?: RendererStyleFlags2): void;\n\n /**\n * Implement this callback to set the value of a property of an element in the DOM.\n * @param el The element.\n * @param name The property name.\n * @param value The new value.\n */\n abstract setProperty(el: any, name: string, value: any): void;\n\n /**\n * Implement this callback to set the value of a node in the host element.\n * @param node The node.\n * @param value The new value.\n */\n abstract setValue(node: any, value: string): void;\n\n /**\n * Implement this callback to start an event listener.\n * @param target The context in which to listen for events. Can be\n * the entire window or document, the body of the document, or a specific\n * DOM element.\n * @param eventName The event to listen for.\n * @param callback A handler function to invoke when the event occurs.\n * @returns An \"unlisten\" function for disposing of this handler.\n */\n abstract listen(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => boolean | void): () => void;\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => Renderer2 = () => SWITCH_RENDERER2_FACTORY();\n}\n\n\nexport const SWITCH_RENDERER2_FACTORY__POST_R3__ = render3InjectRenderer2;\nconst SWITCH_RENDERER2_FACTORY__PRE_R3__ = noop;\nconst SWITCH_RENDERER2_FACTORY: typeof render3InjectRenderer2 = SWITCH_RENDERER2_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * A SecurityContext marks a location that has dangerous security implications, e.g. a DOM property\n * like `innerHTML` that could cause Cross Site Scripting (XSS) security bugs when improperly\n * handled.\n *\n * See DomSanitizer for more details on security in Angular applications.\n *\n * @publicApi\n */\nexport enum SecurityContext {\n NONE = 0,\n HTML = 1,\n STYLE = 2,\n SCRIPT = 3,\n URL = 4,\n RESOURCE_URL = 5,\n}\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n *\n * @publicApi\n */\nexport abstract class Sanitizer {\n abstract sanitize(context: SecurityContext, value: {}|string|null): string|null;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description Represents the version of Angular\n *\n * @publicApi\n */\nexport class Version {\n public readonly major: string;\n public readonly minor: string;\n public readonly patch: string;\n\n constructor(public full: string) {\n this.major = full.split('.')[0];\n this.minor = full.split('.')[1];\n this.patch = full.split('.').slice(2).join('.');\n }\n}\n\n/**\n * @publicApi\n */\nexport const VERSION = new Version('7.2.8');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef as ViewEngine_ChangeDetectorRef} from '../change_detection/change_detector_ref';\nimport {InjectionToken} from '../di/injection_token';\nimport {Injector} from '../di/injector';\nimport {inject} from '../di/injector_compatibility';\nimport {ComponentFactory as viewEngine_ComponentFactory, ComponentRef as viewEngine_ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef as viewEngine_ElementRef} from '../linker/element_ref';\nimport {NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {RendererFactory2} from '../render/api';\nimport {Sanitizer} from '../sanitization/security';\nimport {Type} from '../type';\nimport {VERSION} from '../version';\nimport {assertComponentType, assertDefined} from './assert';\nimport {LifecycleHooksFeature, createRootComponent, createRootComponentView, createRootContext} from './component';\nimport {getComponentDef} from './definition';\nimport {NodeInjector} from './di';\nimport {addToViewTree, createLView, createNodeAtIndex, createTView, createViewNode, elementCreate, locateHostElement, refreshDescendantViews} from './instructions';\nimport {ComponentDef, RenderFlags} from './interfaces/definition';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType} from './interfaces/node';\nimport {RElement, RendererFactory3, domRendererFactory3, isProceduralRenderer} from './interfaces/renderer';\nimport {HEADER_OFFSET, LView, LViewFlags, RootContext, TVIEW} from './interfaces/view';\nimport {enterView, leaveView} from './state';\nimport {defaultScheduler, getTNode} from './util';\nimport {createElementRef} from './view_engine_compatibility';\nimport {RootViewRef, ViewRef} from './view_ref';\n\nexport class ComponentFactoryResolver extends viewEngine_ComponentFactoryResolver {\n /**\n * @param ngModule The NgModuleRef to which all resolved factories are bound.\n */\n constructor(private ngModule?: viewEngine_NgModuleRef<any>) { super(); }\n\n resolveComponentFactory<T>(component: Type<T>): viewEngine_ComponentFactory<T> {\n ngDevMode && assertComponentType(component);\n const componentDef = getComponentDef(component) !;\n return new ComponentFactory(componentDef, this.ngModule);\n }\n}\n\nfunction toRefArray(map: {[key: string]: string}): {propName: string; templateName: string;}[] {\n const array: {propName: string; templateName: string;}[] = [];\n for (let nonMinified in map) {\n if (map.hasOwnProperty(nonMinified)) {\n const minified = map[nonMinified];\n array.push({propName: minified, templateName: nonMinified});\n }\n }\n return array;\n}\n\n/**\n * Default {@link RootContext} for all components rendered with {@link renderComponent}.\n */\nexport const ROOT_CONTEXT = new InjectionToken<RootContext>(\n 'ROOT_CONTEXT_TOKEN',\n {providedIn: 'root', factory: () => createRootContext(inject(SCHEDULER))});\n\n/**\n * A change detection scheduler token for {@link RootContext}. This token is the default value used\n * for the default `RootContext` found in the {@link ROOT_CONTEXT} token.\n */\nexport const SCHEDULER = new InjectionToken<((fn: () => void) => void)>('SCHEDULER_TOKEN', {\n providedIn: 'root',\n factory: () => defaultScheduler,\n});\n\nconst NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nfunction createChainedInjector(rootViewInjector: Injector, moduleInjector: Injector): Injector {\n return {\n get: <T>(token: Type<T>| InjectionToken<T>, notFoundValue?: T): T => {\n const value = rootViewInjector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n\n return moduleInjector.get(token, notFoundValue);\n }\n };\n}\n\n/**\n * Render3 implementation of {@link viewEngine_ComponentFactory}.\n */\nexport class ComponentFactory<T> extends viewEngine_ComponentFactory<T> {\n selector: string;\n componentType: Type<any>;\n ngContentSelectors: string[];\n\n get inputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.inputs);\n }\n\n get outputs(): {propName: string; templateName: string;}[] {\n return toRefArray(this.componentDef.outputs);\n }\n\n /**\n * @param componentDef The component definition.\n * @param ngModule The NgModuleRef to which the factory is bound.\n */\n constructor(\n private componentDef: ComponentDef<any>, private ngModule?: viewEngine_NgModuleRef<any>) {\n super();\n this.componentType = componentDef.type;\n this.selector = componentDef.selectors[0][0] as string;\n this.ngContentSelectors = [];\n }\n\n create(\n injector: Injector, projectableNodes?: any[][]|undefined, rootSelectorOrNode?: any,\n ngModule?: viewEngine_NgModuleRef<any>|undefined): viewEngine_ComponentRef<T> {\n const isInternalRootView = rootSelectorOrNode === undefined;\n ngModule = ngModule || this.ngModule;\n\n const rootViewInjector =\n ngModule ? createChainedInjector(injector, ngModule.injector) : injector;\n\n const rendererFactory =\n rootViewInjector.get(RendererFactory2, domRendererFactory3) as RendererFactory3;\n const sanitizer = rootViewInjector.get(Sanitizer, null);\n\n const hostRNode = isInternalRootView ?\n elementCreate(this.selector, rendererFactory.createRenderer(null, this.componentDef)) :\n locateHostElement(rendererFactory, rootSelectorOrNode);\n\n const rootFlags = this.componentDef.onPush ? LViewFlags.Dirty | LViewFlags.IsRoot :\n LViewFlags.CheckAlways | LViewFlags.IsRoot;\n const rootContext: RootContext =\n !isInternalRootView ? rootViewInjector.get(ROOT_CONTEXT) : createRootContext();\n\n const renderer = rendererFactory.createRenderer(hostRNode, this.componentDef);\n\n if (rootSelectorOrNode && hostRNode) {\n ngDevMode && ngDevMode.rendererSetAttribute++;\n isProceduralRenderer(renderer) ?\n renderer.setAttribute(hostRNode, 'ng-version', VERSION.full) :\n hostRNode.setAttribute('ng-version', VERSION.full);\n }\n\n // Create the root view. Uses empty TView and ContentTemplate.\n const rootLView = createLView(\n null, createTView(-1, null, 1, 0, null, null, null), rootContext, rootFlags,\n rendererFactory, renderer, sanitizer, rootViewInjector);\n\n // rootView is the parent when bootstrapping\n const oldLView = enterView(rootLView, null);\n\n let component: T;\n let tElementNode: TElementNode;\n try {\n if (rendererFactory.begin) rendererFactory.begin();\n\n const componentView = createRootComponentView(\n hostRNode, this.componentDef, rootLView, rendererFactory, renderer);\n\n tElementNode = getTNode(0, rootLView) as TElementNode;\n\n // Transform the arrays of native nodes into a structure that can be consumed by the\n // projection instruction. This is needed to support the reprojection of these nodes.\n if (projectableNodes) {\n let index = 0;\n const tView = rootLView[TVIEW];\n const projection: TNode[] = tElementNode.projection = [];\n for (let i = 0; i < projectableNodes.length; i++) {\n const nodeList = projectableNodes[i];\n let firstTNode: TNode|null = null;\n let previousTNode: TNode|null = null;\n for (let j = 0; j < nodeList.length; j++) {\n if (tView.firstTemplatePass) {\n // For dynamically created components such as ComponentRef, we create a new TView for\n // each insert. This is not ideal since we should be sharing the TViews.\n // Also the logic here should be shared with `component.ts`'s `renderComponent`\n // method.\n tView.expandoStartIndex++;\n tView.blueprint.splice(++index + HEADER_OFFSET, 0, null);\n tView.data.splice(index + HEADER_OFFSET, 0, null);\n rootLView.splice(index + HEADER_OFFSET, 0, null);\n }\n const tNode =\n createNodeAtIndex(index, TNodeType.Element, nodeList[j] as RElement, null, null);\n previousTNode ? (previousTNode.next = tNode) : (firstTNode = tNode);\n previousTNode = tNode;\n }\n projection.push(firstTNode !);\n }\n }\n\n // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and\n // executed here?\n // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref\n component = createRootComponent(\n componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);\n\n addToViewTree(rootLView, HEADER_OFFSET, componentView);\n refreshDescendantViews(rootLView);\n } finally {\n leaveView(oldLView);\n if (rendererFactory.end) rendererFactory.end();\n }\n\n const componentRef = new ComponentRef(\n this.componentType, component,\n createElementRef(viewEngine_ElementRef, tElementNode, rootLView), rootLView, tElementNode);\n\n if (isInternalRootView) {\n // The host element of the internal root view is attached to the component's host view node\n componentRef.hostView._tViewNode !.child = tElementNode;\n }\n return componentRef;\n }\n}\n\nconst componentFactoryResolver: ComponentFactoryResolver = new ComponentFactoryResolver();\n\n/**\n * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the\n * ComponentFactoryResolver\n * already exists, retrieves the existing ComponentFactoryResolver.\n *\n * @returns The ComponentFactoryResolver instance to use\n */\nexport function injectComponentFactoryResolver(): viewEngine_ComponentFactoryResolver {\n return componentFactoryResolver;\n}\n\n/**\n * Represents an instance of a Component created via a {@link ComponentFactory}.\n *\n * `ComponentRef` provides access to the Component Instance as well other objects related to this\n * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}\n * method.\n *\n */\nexport class ComponentRef<T> extends viewEngine_ComponentRef<T> {\n destroyCbs: (() => void)[]|null = [];\n instance: T;\n hostView: ViewRef<T>;\n changeDetectorRef: ViewEngine_ChangeDetectorRef;\n componentType: Type<T>;\n\n constructor(\n componentType: Type<T>, instance: T, public location: viewEngine_ElementRef,\n private _rootLView: LView,\n private _tNode: TElementNode|TContainerNode|TElementContainerNode) {\n super();\n this.instance = instance;\n this.hostView = this.changeDetectorRef = new RootViewRef<T>(_rootLView);\n this.hostView._tViewNode = createViewNode(-1, _rootLView);\n this.componentType = componentType;\n }\n\n get injector(): Injector { return new NodeInjector(this._tNode, this._rootLView); }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n this.hostView.destroy();\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.\n *\n * For more information on how to run and debug tests with either Ivy or View Engine (legacy),\n * please see [BAZEL.md](./docs/BAZEL.md).\n */\n\nlet _devMode: boolean = true;\nlet _runModeLocked: boolean = false;\n\n\n/**\n * Returns whether Angular is in development mode. After called once,\n * the value is locked and won't change any more.\n *\n * By default, this is true, unless a user calls `enableProdMode` before calling this.\n *\n * @publicApi\n */\nexport function isDevMode(): boolean {\n _runModeLocked = true;\n return _devMode;\n}\n\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * @publicApi\n */\nexport function enableProdMode(): void {\n if (_runModeLocked) {\n throw new Error('Cannot enable prod mode after platform setup.');\n }\n _devMode = false;\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we must use one of three strategies for doing this.\n * Support: Safari 10.x -> XHR strategy\n * Support: Firefox -> DomParser strategy\n * Default: InertDocument strategy\n */\nexport class InertBodyHelper {\n private inertBodyElement: HTMLElement;\n private inertDocument: Document;\n\n constructor(private defaultDoc: Document) {\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n this.inertBodyElement = this.inertDocument.body;\n\n if (this.inertBodyElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so\n // we need to create one.\n const inertHtml = this.inertDocument.createElement('html');\n this.inertDocument.appendChild(inertHtml);\n this.inertBodyElement = this.inertDocument.createElement('body');\n inertHtml.appendChild(this.inertBodyElement);\n }\n\n this.inertBodyElement.innerHTML = '<svg><g onload=\"this.parentNode.remove()\"></g></svg>';\n if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {\n // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element\n // so use the XHR strategy.\n this.getInertBodyElement = this.getInertBodyElement_XHR;\n return;\n }\n\n this.inertBodyElement.innerHTML =\n '<svg><p><style><img src=\"</style><img src=x onerror=alert(1)//\">';\n if (this.inertBodyElement.querySelector && this.inertBodyElement.querySelector('svg img')) {\n // We just hit the Firefox bug - which prevents the inner img JS from being sanitized\n // so use the DOMParser strategy, if it is available.\n // If the DOMParser is not available then we are not in Firefox (Server/WebWorker?) so we\n // fall through to the default strategy below.\n if (isDOMParserAvailable()) {\n this.getInertBodyElement = this.getInertBodyElement_DOMParser;\n return;\n }\n }\n\n // None of the bugs were hit so it is safe for us to use the default InertDocument strategy\n this.getInertBodyElement = this.getInertBodyElement_InertDocument;\n }\n\n /**\n * Get an inert DOM element containing DOM created from the dirty HTML string provided.\n * The implementation of this is determined in the constructor, when the class is instantiated.\n */\n getInertBodyElement: (html: string) => HTMLElement | null;\n\n /**\n * Use XHR to create and fill an inert body element (on Safari 10.1)\n * See\n * https://github.com/cure53/DOMPurify/blob/a992d3a75031cb8bb032e5ea8399ba972bdf9a65/src/purify.js#L439-L449\n */\n private getInertBodyElement_XHR(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n html = encodeURI(html);\n } catch {\n return null;\n }\n const xhr = new XMLHttpRequest();\n xhr.responseType = 'document';\n xhr.open('GET', 'data:text/html;charset=utf-8,' + html, false);\n xhr.send(undefined);\n const body: HTMLBodyElement = xhr.response.body;\n body.removeChild(body.firstChild !);\n return body;\n }\n\n /**\n * Use DOMParser to create and fill an inert body element (on Firefox)\n * See https://github.com/cure53/DOMPurify/releases/tag/0.6.7\n *\n */\n private getInertBodyElement_DOMParser(html: string) {\n // We add these extra elements to ensure that the rest of the content is parsed as expected\n // e.g. leading whitespace is maintained and tags like `<meta>` do not get hoisted to the\n // `<head>` tag.\n html = '<body><remove></remove>' + html + '</body>';\n try {\n const body = new (window as any)\n .DOMParser()\n .parseFromString(html, 'text/html')\n .body as HTMLBodyElement;\n body.removeChild(body.firstChild !);\n return body;\n } catch {\n return null;\n }\n }\n\n /**\n * Use an HTML5 `template` element, if supported, or an inert body element created via\n * `createHtmlDocument` to create and fill an inert DOM element.\n * This is the default sane strategy to use if the browser does not require one of the specialised\n * strategies above.\n */\n private getInertBodyElement_InertDocument(html: string) {\n // Prefer using <template> element if supported.\n const templateEl = this.inertDocument.createElement('template');\n if ('content' in templateEl) {\n templateEl.innerHTML = html;\n return templateEl;\n }\n\n this.inertBodyElement.innerHTML = html;\n\n // Support: IE 9-11 only\n // strip custom-namespaced attributes on IE<=11\n if ((this.defaultDoc as any).documentMode) {\n this.stripCustomNsAttrs(this.inertBodyElement);\n }\n\n return this.inertBodyElement;\n }\n\n /**\n * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1'\n * attribute to declare ns1 namespace and prefixes the attribute with 'ns1' (e.g.\n * 'ns1:xlink:foo').\n *\n * This is undesirable since we don't want to allow any of these custom attributes. This method\n * strips them all.\n */\n private stripCustomNsAttrs(el: Element) {\n const elAttrs = el.attributes;\n // loop backwards so that we can support removals.\n for (let i = elAttrs.length - 1; 0 < i; i--) {\n const attrib = elAttrs.item(i);\n const attrName = attrib !.name;\n if (attrName === 'xmlns:ns1' || attrName.indexOf('ns1:') === 0) {\n el.removeAttribute(attrName);\n }\n }\n let childNode = el.firstChild as Node | null;\n while (childNode) {\n if (childNode.nodeType === Node.ELEMENT_NODE) this.stripCustomNsAttrs(childNode as Element);\n childNode = childNode.nextSibling;\n }\n }\n}\n\n/**\n * We need to determine whether the DOMParser exists in the global context.\n * The try-catch is because, on some browsers, trying to access this property\n * on window can actually throw an error.\n *\n * @suppress {uselessCode}\n */\nfunction isDOMParserAvailable() {\n try {\n return !!(window as any).DOMParser;\n } catch {\n return false;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * This regular expression matches a subset of URLs that will not cause script\n * execution if used in URL context within a HTML document. Specifically, this\n * regular expression matches if (comment from here on and regex copied from\n * Soy's EscapingConventions):\n * (1) Either a protocol in a whitelist (http, https, mailto or ftp).\n * (2) or no protocol. A protocol must be followed by a colon. The below\n * allows that by allowing colons only after one of the characters [/?#].\n * A colon after a hash (#) must be in the fragment.\n * Otherwise, a colon after a (?) must be in a query.\n * Otherwise, a colon after a single solidus (/) must be in a path.\n * Otherwise, a colon after a double solidus (//) must be in the authority\n * (before port).\n *\n * The pattern disallows &, used in HTML entity declarations before\n * one of the characters in [/?#]. This disallows HTML entities used in the\n * protocol name, which should never happen, e.g. \"http\" for \"http\".\n * It also disallows HTML entities in the first path part of a relative path,\n * e.g. \"foo<bar/baz\". Our existing escaping functions should not produce\n * that. More importantly, it disallows masking of a colon,\n * e.g. \"javascript:...\".\n *\n * This regular expression was taken from the Closure sanitization library.\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/* A pattern that matches safe srcset values */\nconst SAFE_SRCSET_PATTERN = /^(?:(?:https?|file):|[^&:/?#]*(?:[/?#]|$))/gi;\n\n/** A pattern that matches safe data URLs. Only matches image, video and audio types. */\nconst DATA_URL_PATTERN =\n /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\\/]+=*$/i;\n\nexport function _sanitizeUrl(url: string): string {\n url = String(url);\n if (url.match(SAFE_URL_PATTERN) || url.match(DATA_URL_PATTERN)) return url;\n\n if (isDevMode()) {\n console.warn(`WARNING: sanitizing unsafe URL value ${url} (see http://g.co/ng/security#xss)`);\n }\n\n return 'unsafe:' + url;\n}\n\nexport function sanitizeSrcset(srcset: string): string {\n srcset = String(srcset);\n return srcset.split(',').map((srcset) => _sanitizeUrl(srcset.trim())).join(', ');\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\nimport {InertBodyHelper} from './inert_body';\nimport {_sanitizeUrl, sanitizeSrcset} from './url_sanitizer';\n\nfunction tagSet(tags: string): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const t of tags.split(',')) res[t] = true;\n return res;\n}\n\nfunction merge(...sets: {[k: string]: boolean}[]): {[k: string]: boolean} {\n const res: {[k: string]: boolean} = {};\n for (const s of sets) {\n for (const v in s) {\n if (s.hasOwnProperty(v)) res[v] = true;\n }\n }\n return res;\n}\n\n// Good source of info about elements and attributes\n// http://dev.w3.org/html5/spec/Overview.html#semantics\n// http://simon.html5.org/html-elements\n\n// Safe Void Elements - HTML5\n// http://dev.w3.org/html5/spec/Overview.html#void-elements\nconst VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr');\n\n// Elements that you can, intentionally, leave open (and which close themselves)\n// http://dev.w3.org/html5/spec/Overview.html#optional-tags\nconst OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr');\nconst OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt');\nconst OPTIONAL_END_TAG_ELEMENTS =\n merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS);\n\n// Safe Block Elements - HTML5\nconst BLOCK_ELEMENTS = merge(\n OPTIONAL_END_TAG_BLOCK_ELEMENTS,\n tagSet(\n 'address,article,' +\n 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' +\n 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul'));\n\n// Inline Elements - HTML5\nconst INLINE_ELEMENTS = merge(\n OPTIONAL_END_TAG_INLINE_ELEMENTS,\n tagSet(\n 'a,abbr,acronym,audio,b,' +\n 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' +\n 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video'));\n\nexport const VALID_ELEMENTS =\n merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS);\n\n// Attributes that have href and hence need to be sanitized\nexport const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href');\n\n// Attributes that have special href set hence need to be sanitized\nexport const SRCSET_ATTRS = tagSet('srcset');\n\nconst HTML_ATTRS = tagSet(\n 'abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' +\n 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' +\n 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' +\n 'scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,' +\n 'valign,value,vspace,width');\n\n// NB: This currently consciously doesn't support SVG. SVG sanitization has had several security\n// issues in the past, so it seems safer to leave it out if possible. If support for binding SVG via\n// innerHTML is required, SVG attributes should be added here.\n\n// NB: Sanitization does not allow <form> elements or other active elements (<button> etc). Those\n// can be sanitized, but they increase security surface area without a legitimate use case, so they\n// are left out here.\n\nexport const VALID_ATTRS = merge(URI_ATTRS, SRCSET_ATTRS, HTML_ATTRS);\n\n// Elements whose content should not be traversed/preserved, if the elements themselves are invalid.\n//\n// Typically, `<invalid>Some content</invalid>` would traverse (and in this case preserve)\n// `Some content`, but strip `invalid-element` opening/closing tags. For some elements, though, we\n// don't want to preserve the content, if the elements themselves are going to be removed.\nconst SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template');\n\n/**\n * SanitizingHtmlSerializer serializes a DOM fragment, stripping out any unsafe elements and unsafe\n * attributes.\n */\nclass SanitizingHtmlSerializer {\n // Explicitly track if something was stripped, to avoid accidentally warning of sanitization just\n // because characters were re-encoded.\n public sanitizedSomething = false;\n private buf: string[] = [];\n\n sanitizeChildren(el: Element): string {\n // This cannot use a TreeWalker, as it has to run on Angular's various DOM adapters.\n // However this code never accesses properties off of `document` before deleting its contents\n // again, so it shouldn't be vulnerable to DOM clobbering.\n let current: Node = el.firstChild !;\n let traverseContent = true;\n while (current) {\n if (current.nodeType === Node.ELEMENT_NODE) {\n traverseContent = this.startElement(current as Element);\n } else if (current.nodeType === Node.TEXT_NODE) {\n this.chars(current.nodeValue !);\n } else {\n // Strip non-element, non-text nodes.\n this.sanitizedSomething = true;\n }\n if (traverseContent && current.firstChild) {\n current = current.firstChild !;\n continue;\n }\n while (current) {\n // Leaving the element. Walk up and to the right, closing tags as we go.\n if (current.nodeType === Node.ELEMENT_NODE) {\n this.endElement(current as Element);\n }\n\n let next = this.checkClobberedElement(current, current.nextSibling !);\n\n if (next) {\n current = next;\n break;\n }\n\n current = this.checkClobberedElement(current, current.parentNode !);\n }\n }\n return this.buf.join('');\n }\n\n /**\n * Sanitizes an opening element tag (if valid) and returns whether the element's contents should\n * be traversed. Element content must always be traversed (even if the element itself is not\n * valid/safe), unless the element is one of `SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS`.\n *\n * @param element The element to sanitize.\n * @return True if the element's contents should be traversed.\n */\n private startElement(element: Element): boolean {\n const tagName = element.nodeName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n this.sanitizedSomething = true;\n return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName);\n }\n this.buf.push('<');\n this.buf.push(tagName);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const elAttr = elAttrs.item(i);\n const attrName = elAttr !.name;\n const lower = attrName.toLowerCase();\n if (!VALID_ATTRS.hasOwnProperty(lower)) {\n this.sanitizedSomething = true;\n continue;\n }\n let value = elAttr !.value;\n // TODO(martinprobst): Special case image URIs for data:image/...\n if (URI_ATTRS[lower]) value = _sanitizeUrl(value);\n if (SRCSET_ATTRS[lower]) value = sanitizeSrcset(value);\n this.buf.push(' ', attrName, '=\"', encodeEntities(value), '\"');\n }\n this.buf.push('>');\n return true;\n }\n\n private endElement(current: Element) {\n const tagName = current.nodeName.toLowerCase();\n if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) {\n this.buf.push('</');\n this.buf.push(tagName);\n this.buf.push('>');\n }\n }\n\n private chars(chars: string) { this.buf.push(encodeEntities(chars)); }\n\n checkClobberedElement(node: Node, nextNode: Node): Node {\n if (nextNode &&\n (node.compareDocumentPosition(nextNode) &\n Node.DOCUMENT_POSITION_CONTAINED_BY) === Node.DOCUMENT_POSITION_CONTAINED_BY) {\n throw new Error(\n `Failed to sanitize html because the element is clobbered: ${(node as Element).outerHTML}`);\n }\n return nextNode;\n }\n}\n\n// Regular Expressions for parsing tags and attributes\nconst SURROGATE_PAIR_REGEXP = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n// ! to ~ is the ASCII range.\nconst NON_ALPHANUMERIC_REGEXP = /([^\\#-~ |!])/g;\n\n/**\n * Escapes all potentially dangerous characters, so that the\n * resulting string can be safely inserted into attribute or\n * element text.\n * @param value\n */\nfunction encodeEntities(value: string) {\n return value.replace(/&/g, '&')\n .replace(\n SURROGATE_PAIR_REGEXP,\n function(match: string) {\n const hi = match.charCodeAt(0);\n const low = match.charCodeAt(1);\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';';\n })\n .replace(\n NON_ALPHANUMERIC_REGEXP,\n function(match: string) { return '&#' + match.charCodeAt(0) + ';'; })\n .replace(/</g, '<')\n .replace(/>/g, '>');\n}\n\nlet inertBodyHelper: InertBodyHelper;\n\n/**\n * Sanitizes the given unsafe, untrusted HTML fragment, and returns HTML text that is safe to add to\n * the DOM in a browser environment.\n */\nexport function _sanitizeHtml(defaultDoc: any, unsafeHtmlInput: string): string {\n let inertBodyElement: HTMLElement|null = null;\n try {\n inertBodyHelper = inertBodyHelper || new InertBodyHelper(defaultDoc);\n // Make sure unsafeHtml is actually a string (TypeScript types are not enforced at runtime).\n let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : '';\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n\n // mXSS protection. Repeatedly parse the document to make sure it stabilizes, so that a browser\n // trying to auto-correct incorrect HTML cannot cause formerly inert HTML to become dangerous.\n let mXSSAttempts = 5;\n let parsedHtml = unsafeHtml;\n\n do {\n if (mXSSAttempts === 0) {\n throw new Error('Failed to sanitize html because the input is unstable');\n }\n mXSSAttempts--;\n\n unsafeHtml = parsedHtml;\n parsedHtml = inertBodyElement !.innerHTML;\n inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n } while (unsafeHtml !== parsedHtml);\n\n const sanitizer = new SanitizingHtmlSerializer();\n const safeHtml = sanitizer.sanitizeChildren(\n getTemplateContent(inertBodyElement !) as Element || inertBodyElement);\n if (isDevMode() && sanitizer.sanitizedSomething) {\n console.warn(\n 'WARNING: sanitizing HTML stripped some content, see http://g.co/ng/security#xss');\n }\n\n return safeHtml;\n } finally {\n // In case anything goes wrong, clear out inertElement to reset the entire DOM structure.\n if (inertBodyElement) {\n const parent = getTemplateContent(inertBodyElement) || inertBodyElement;\n while (parent.firstChild) {\n parent.removeChild(parent.firstChild);\n }\n }\n }\n}\n\nexport function getTemplateContent(el: Node): Node|null {\n return 'content' in (el as any /** Microsoft/TypeScript#21517 */) && isTemplateElement(el) ?\n el.content :\n null;\n}\nfunction isTemplateElement(el: Node): el is HTMLTemplateElement {\n return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * `I18nMutateOpCode` defines OpCodes for `I18nMutateOpCodes` array.\n *\n * OpCodes contain three parts:\n * 1) Parent node index offset.\n * 2) Reference node index offset.\n * 3) The OpCode to execute.\n *\n * See: `I18nCreateOpCodes` for example of usage.\n */\nimport {SanitizerFn} from './sanitization';\n\nexport const enum I18nMutateOpCode {\n /// Stores shift amount for bits 17-3 that contain reference index.\n SHIFT_REF = 3,\n /// Stores shift amount for bits 31-17 that contain parent index.\n SHIFT_PARENT = 17,\n /// Mask for OpCode\n MASK_OPCODE = 0b111,\n /// Mask for reference index.\n MASK_REF = ((2 ^ 16) - 1) << SHIFT_REF,\n\n /// OpCode to select a node. (next OpCode will contain the operation.)\n Select = 0b000,\n /// OpCode to append the current node to `PARENT`.\n AppendChild = 0b001,\n /// OpCode to insert the current node to `PARENT` before `REF`.\n InsertBefore = 0b010,\n /// OpCode to remove the `REF` node from `PARENT`.\n Remove = 0b011,\n /// OpCode to set the attribute of a node.\n Attr = 0b100,\n /// OpCode to simulate elementEnd()\n ElementEnd = 0b101,\n /// OpCode to read the remove OpCodes for the nested ICU\n RemoveNestedIcu = 0b110,\n}\n\n/**\n * Marks that the next string is for element.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nexport const ELEMENT_MARKER: ELEMENT_MARKER = {\n marker: 'element'\n};\nexport interface ELEMENT_MARKER { marker: 'element'; }\n\n/**\n * Marks that the next string is for comment.\n *\n * See `I18nMutateOpCodes` documentation.\n */\nexport const COMMENT_MARKER: COMMENT_MARKER = {\n marker: 'comment'\n};\n\nexport interface COMMENT_MARKER { marker: 'comment'; }\n\n/**\n * Array storing OpCode for dynamically creating `i18n` blocks.\n *\n * Example:\n * ```\n * <I18nCreateOpCode>[\n * // For adding text nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createTextNode('abc');\n * // lView[1].insertBefore(node, lView[2]);\n * 'abc', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createTextNode('xyz');\n * // lView[1].appendChild(node);\n * 'xyz', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For adding element nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createElement('div');\n * // lView[1].insertBefore(node, lView[2]);\n * ELEMENT_MARKER, 'div', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createElement('div');\n * // lView[1].appendChild(node);\n * ELEMENT_MARKER, 'div', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For adding comment nodes\n * // ---------------------\n * // Equivalent to:\n * // const node = lView[index++] = document.createComment('');\n * // lView[1].insertBefore(node, lView[2]);\n * COMMENT_MARKER, '', 1 << SHIFT_PARENT | 2 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[index++] = document.createComment('');\n * // lView[1].appendChild(node);\n * COMMENT_MARKER, '', 1 << SHIFT_PARENT | AppendChild,\n *\n * // For moving existing nodes to a different location\n * // --------------------------------------------------\n * // Equivalent to:\n * // const node = lView[1];\n * // lView[2].insertBefore(node, lView[3]);\n * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | 3 << SHIFT_REF | InsertBefore,\n *\n * // Equivalent to:\n * // const node = lView[1];\n * // lView[2].appendChild(node);\n * 1 << SHIFT_REF | Select, 2 << SHIFT_PARENT | AppendChild,\n *\n * // For removing existing nodes\n * // --------------------------------------------------\n * // const node = lView[1];\n * // removeChild(tView.data(1), node, lView);\n * 1 << SHIFT_REF | Remove,\n *\n * // For writing attributes\n * // --------------------------------------------------\n * // const node = lView[1];\n * // node.setAttribute('attr', 'value');\n * 1 << SHIFT_REF | Select, 'attr', 'value'\n * // NOTE: Select followed by two string (vs select followed by OpCode)\n * ];\n * ```\n * NOTE:\n * - `index` is initial location where the extra nodes should be stored in the EXPANDO section of\n * `LVIewData`.\n *\n * See: `applyI18nCreateOpCodes`;\n */\nexport interface I18nMutateOpCodes extends Array<number|string|ELEMENT_MARKER|COMMENT_MARKER|null> {\n}\n\nexport const enum I18nUpdateOpCode {\n /// Stores shift amount for bits 17-2 that contain reference index.\n SHIFT_REF = 2,\n /// Stores shift amount for bits 31-17 that contain which ICU in i18n block are we referring to.\n SHIFT_ICU = 17,\n /// Mask for OpCode\n MASK_OPCODE = 0b11,\n /// Mask for reference index.\n MASK_REF = ((2 ^ 16) - 1) << SHIFT_REF,\n\n /// OpCode to update a text node.\n Text = 0b00,\n /// OpCode to update a attribute of a node.\n Attr = 0b01,\n /// OpCode to switch the current ICU case.\n IcuSwitch = 0b10,\n /// OpCode to update the current ICU case.\n IcuUpdate = 0b11,\n}\n\n/**\n * Stores DOM operations which need to be applied to update DOM render tree due to changes in\n * expressions.\n *\n * The basic idea is that `i18nExp` OpCodes capture expression changes and update a change\n * mask bit. (Bit 1 for expression 1, bit 2 for expression 2 etc..., bit 32 for expression 32 and\n * higher.) The OpCodes then compare its own change mask against the expression change mask to\n * determine if the OpCodes should execute.\n *\n * These OpCodes can be used by both the i18n block as well as ICU sub-block.\n *\n * ## Example\n *\n * Assume\n * ```\n * if (rf & RenderFlags.Update) {\n * i18nExp(bind(ctx.exp1)); // If changed set mask bit 1\n * i18nExp(bind(ctx.exp2)); // If changed set mask bit 2\n * i18nExp(bind(ctx.exp3)); // If changed set mask bit 3\n * i18nExp(bind(ctx.exp4)); // If changed set mask bit 4\n * i18nApply(0); // Apply all changes by executing the OpCodes.\n * }\n * ```\n * We can assume that each call to `i18nExp` sets an internal `changeMask` bit depending on the\n * index of `i18nExp`.\n *\n * OpCodes\n * ```\n * <I18nUpdateOpCodes>[\n * // The following OpCodes represent: `<div i18n-title=\"pre{{exp1}}in{{exp2}}post\">`\n * // If `changeMask & 0b11`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `7` values and start processing next OpCodes.\n * 0b11, 7,\n * // Concatenate `newValue = 'pre'+lView[bindIndex-4]+'in'+lView[bindIndex-3]+'post';`.\n * 'pre', -4, 'in', -3, 'post',\n * // Update attribute: `elementAttribute(1, 'title', sanitizerFn(newValue));`\n * 1 << SHIFT_REF | Attr, 'title', sanitizerFn,\n *\n * // The following OpCodes represent: `<div i18n>Hello {{exp3}}!\">`\n * // If `changeMask & 0b100`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `4` values and start processing next OpCodes.\n * 0b100, 4,\n * // Concatenate `newValue = 'Hello ' + lView[bindIndex -2] + '!';`.\n * 'Hello ', -2, '!',\n * // Update text: `lView[1].textContent = newValue;`\n * 1 << SHIFT_REF | Text,\n *\n * // The following OpCodes represent: `<div i18n>{exp4, plural, ... }\">`\n * // If `changeMask & 0b1000`\n * // has changed then execute update OpCodes.\n * // has NOT changed then skip `4` values and start processing next OpCodes.\n * 0b1000, 4,\n * // Concatenate `newValue = lView[bindIndex -1];`.\n * -1,\n * // Switch ICU: `icuSwitchCase(lView[1], 0, newValue);`\n * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuSwitch,\n *\n * // Note `changeMask & -1` is always true, so the IcuUpdate will always execute.\n * -1, 1,\n * // Update ICU: `icuUpdateCase(lView[1], 0);`\n * 0 << SHIFT_ICU | 1 << SHIFT_REF | IcuUpdate,\n *\n * ];\n * ```\n *\n */\nexport interface I18nUpdateOpCodes extends Array<string|number|SanitizerFn|null> {}\n\n/**\n * Store information for the i18n translation block.\n */\nexport interface TI18n {\n /**\n * Number of slots to allocate in expando.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number;\n\n /**\n * Index in EXPANDO where the i18n stores its DOM nodes.\n *\n * When the bindings are processed by the `i18nEnd` instruction it is necessary to know where the\n * newly created DOM nodes will be inserted.\n */\n expandoStartIndex: number;\n\n /**\n * A set of OpCodes which will create the Text Nodes and ICU anchors for the translation blocks.\n *\n * NOTE: The ICU anchors are filled in with ICU Update OpCode.\n */\n create: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes which will be executed on each change detection to determine if any changes to\n * DOM are required.\n */\n update: I18nUpdateOpCodes;\n\n /**\n * A list of ICUs in a translation block (or `null` if block has no ICUs).\n *\n * Example:\n * Given: `<div i18n>You have {count, plural, ...} and {state, switch, ...}</div>`\n * There would be 2 ICUs in this array.\n * 1. `{count, plural, ...}`\n * 2. `{state, switch, ...}`\n */\n icus: TIcu[]|null;\n}\n\n/**\n * Defines the ICU type of `select` or `plural`\n */\nexport const enum IcuType {\n select = 0,\n plural = 1,\n}\n\nexport interface TIcu {\n /**\n * Defines the ICU type of `select` or `plural`\n */\n type: IcuType;\n\n /**\n * Number of slots to allocate in expando for each case.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number[];\n\n /**\n * An optional array of child/sub ICUs.\n *\n * In case of nested ICUs such as:\n * ```\n * {�0�, plural,\n * =0 {zero}\n * other {�0� {�1�, select,\n * cat {cats}\n * dog {dogs}\n * other {animals}\n * }!\n * }\n * }\n * ```\n * When the parent ICU is changing it must clean up child ICUs as well. For this reason it needs\n * to know which child ICUs to run clean up for as well.\n *\n * In the above example this would be:\n * ```\n * [\n * [], // `=0` has no sub ICUs\n * [1], // `other` has one subICU at `1`st index.\n * ]\n * ```\n *\n * The reason why it is Array of Arrays is because first array represents the case, and second\n * represents the child ICUs to clean up. There may be more than one child ICUs per case.\n */\n childIcus: number[][];\n\n /**\n * Index in EXPANDO where the i18n stores its DOM nodes.\n *\n * When the bindings are processed by the `i18nEnd` instruction it is necessary to know where the\n * newly created DOM nodes will be inserted.\n */\n expandoStartIndex: number;\n\n /**\n * A list of case values which the current ICU will try to match.\n *\n * The last value is `other`\n */\n cases: any[];\n\n /**\n * A set of OpCodes to apply in order to build up the DOM render tree for the ICU\n */\n create: I18nMutateOpCodes[];\n\n /**\n * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.\n */\n remove: I18nMutateOpCodes[];\n\n /**\n * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.\n */\n update: I18nUpdateOpCodes[];\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SRCSET_ATTRS, URI_ATTRS, VALID_ATTRS, VALID_ELEMENTS, getTemplateContent} from '../sanitization/html_sanitizer';\nimport {InertBodyHelper} from '../sanitization/inert_body';\nimport {_sanitizeUrl, sanitizeSrcset} from '../sanitization/url_sanitizer';\nimport {assertDefined, assertEqual, assertGreaterThan} from './assert';\nimport {attachPatchData} from './context_discovery';\nimport {allocExpando, createNodeAtIndex, elementAttribute, load, textBinding} from './instructions';\nimport {LContainer, NATIVE, RENDER_PARENT} from './interfaces/container';\nimport {COMMENT_MARKER, ELEMENT_MARKER, I18nMutateOpCode, I18nMutateOpCodes, I18nUpdateOpCode, I18nUpdateOpCodes, IcuType, TI18n, TIcu} from './interfaces/i18n';\nimport {TElementNode, TIcuContainerNode, TNode, TNodeType} from './interfaces/node';\nimport {RComment, RElement} from './interfaces/renderer';\nimport {SanitizerFn} from './interfaces/sanitization';\nimport {StylingContext} from './interfaces/styling';\nimport {BINDING_INDEX, HEADER_OFFSET, HOST_NODE, LView, RENDERER, TVIEW, TView} from './interfaces/view';\nimport {appendChild, createTextNode, removeChild} from './node_manipulation';\nimport {getIsParent, getLView, getPreviousOrParentTNode, setIsParent, setPreviousOrParentTNode} from './state';\nimport {NO_CHANGE} from './tokens';\nimport {addAllToArray, getNativeByIndex, getNativeByTNode, getTNode, isLContainer, stringify} from './util';\n\nconst MARKER = `�`;\nconst ICU_BLOCK_REGEX = /^\\s*(�\\d+:?\\d*�)\\s*,\\s*(select|plural)\\s*,/;\nconst SUBTEMPLATE_REGEXP = /�\\/?\\*(\\d+:\\d+)�/gi;\nconst PH_REGEXP = /�(\\/?[#*]\\d+):?\\d*�/gi;\nconst BINDING_REGEXP = /�(\\d+):?\\d*�/gi;\nconst ICU_REGEXP = /({\\s*�\\d+:?\\d*�\\s*,\\s*\\S{6}\\s*,[\\s\\S]*})/gi;\n\n// i18nPostproocess regexps\nconst PP_PLACEHOLDERS = /\\[(�.+?�?)\\]/g;\nconst PP_ICU_VARS = /({\\s*)(VAR_(PLURAL|SELECT)(_\\d+)?)(\\s*,)/g;\nconst PP_ICUS = /�I18N_EXP_(ICU(_\\d+)?)�/g;\n\ninterface IcuExpression {\n type: IcuType;\n mainBinding: number;\n cases: string[];\n values: (string|IcuExpression)[][];\n}\n\ninterface IcuCase {\n /**\n * Number of slots to allocate in expando for this case.\n *\n * This is the max number of DOM elements which will be created by this i18n + ICU blocks. When\n * the DOM elements are being created they are stored in the EXPANDO, so that update OpCodes can\n * write into them.\n */\n vars: number;\n\n /**\n * An optional array of child/sub ICUs.\n */\n childIcus: number[];\n\n /**\n * A set of OpCodes to apply in order to build up the DOM render tree for the ICU\n */\n create: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes to apply in order to destroy the DOM render tree for the ICU.\n */\n remove: I18nMutateOpCodes;\n\n /**\n * A set of OpCodes to apply in order to update the DOM render tree for the ICU bindings.\n */\n update: I18nUpdateOpCodes;\n}\n\n/**\n * Breaks pattern into strings and top level {...} blocks.\n * Can be used to break a message into text and ICU expressions, or to break an ICU expression into\n * keys and cases.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern (sub)Pattern to be broken.\n *\n */\nfunction extractParts(pattern: string): (string | IcuExpression)[] {\n if (!pattern) {\n return [];\n }\n\n let prevPos = 0;\n const braceStack = [];\n const results: (string | IcuExpression)[] = [];\n const braces = /[{}]/g;\n // lastIndex doesn't get set to 0 so we have to.\n braces.lastIndex = 0;\n\n let match;\n while (match = braces.exec(pattern)) {\n const pos = match.index;\n if (match[0] == '}') {\n braceStack.pop();\n\n if (braceStack.length == 0) {\n // End of the block.\n const block = pattern.substring(prevPos, pos);\n if (ICU_BLOCK_REGEX.test(block)) {\n results.push(parseICUBlock(block));\n } else if (block) { // Don't push empty strings\n results.push(block);\n }\n\n prevPos = pos + 1;\n }\n } else {\n if (braceStack.length == 0) {\n const substring = pattern.substring(prevPos, pos);\n results.push(substring);\n prevPos = pos + 1;\n }\n braceStack.push('{');\n }\n }\n\n const substring = pattern.substring(prevPos);\n if (substring != '') {\n results.push(substring);\n }\n\n return results;\n}\n\n/**\n * Parses text containing an ICU expression and produces a JSON object for it.\n * Original code from closure library, modified for Angular.\n *\n * @param pattern Text containing an ICU expression that needs to be parsed.\n *\n */\nfunction parseICUBlock(pattern: string): IcuExpression {\n const cases = [];\n const values: (string | IcuExpression)[][] = [];\n let icuType = IcuType.plural;\n let mainBinding = 0;\n pattern = pattern.replace(ICU_BLOCK_REGEX, function(str: string, binding: string, type: string) {\n if (type === 'select') {\n icuType = IcuType.select;\n } else {\n icuType = IcuType.plural;\n }\n mainBinding = parseInt(binding.substr(1), 10);\n return '';\n });\n\n const parts = extractParts(pattern) as string[];\n // Looking for (key block)+ sequence. One of the keys has to be \"other\".\n for (let pos = 0; pos < parts.length;) {\n let key = parts[pos++].trim();\n if (icuType === IcuType.plural) {\n // Key can be \"=x\", we just want \"x\"\n key = key.replace(/\\s*(?:=)?(\\w+)\\s*/, '$1');\n }\n if (key.length) {\n cases.push(key);\n }\n\n const blocks = extractParts(parts[pos++]) as string[];\n if (blocks.length) {\n values.push(blocks);\n }\n }\n\n assertGreaterThan(cases.indexOf('other'), -1, 'Missing key \"other\" in ICU statement.');\n // TODO(ocombe): support ICU expressions in attributes, see #21615\n return {type: icuType, mainBinding: mainBinding, cases, values};\n}\n\n/**\n * Removes everything inside the sub-templates of a message.\n */\nfunction removeInnerTemplateTranslation(message: string): string {\n let match;\n let res = '';\n let index = 0;\n let inTemplate = false;\n let tagMatched;\n\n while ((match = SUBTEMPLATE_REGEXP.exec(message)) !== null) {\n if (!inTemplate) {\n res += message.substring(index, match.index + match[0].length);\n tagMatched = match[1];\n inTemplate = true;\n } else {\n if (match[0] === `${MARKER}/*${tagMatched}${MARKER}`) {\n index = match.index;\n inTemplate = false;\n }\n }\n }\n\n ngDevMode &&\n assertEqual(\n inTemplate, false,\n `Tag mismatch: unable to find the end of the sub-template in the translation \"${message}\"`);\n\n res += message.substr(index);\n return res;\n}\n\n/**\n * Extracts a part of a message and removes the rest.\n *\n * This method is used for extracting a part of the message associated with a template. A translated\n * message can span multiple templates.\n *\n * Example:\n * ```\n * <div i18n>Translate <span *ngIf>me</span>!</div>\n * ```\n *\n * @param message The message to crop\n * @param subTemplateIndex Index of the sub-template to extract. If undefined it returns the\n * external template and removes all sub-templates.\n */\nexport function getTranslationForTemplate(message: string, subTemplateIndex?: number) {\n if (typeof subTemplateIndex !== 'number') {\n // We want the root template message, ignore all sub-templates\n return removeInnerTemplateTranslation(message);\n } else {\n // We want a specific sub-template\n const start =\n message.indexOf(`:${subTemplateIndex}${MARKER}`) + 2 + subTemplateIndex.toString().length;\n const end = message.search(new RegExp(`${MARKER}\\\\/\\\\*\\\\d+:${subTemplateIndex}${MARKER}`));\n return removeInnerTemplateTranslation(message.substring(start, end));\n }\n}\n\n/**\n * Generate the OpCodes to update the bindings of a string.\n *\n * @param str The string containing the bindings.\n * @param destinationNode Index of the destination node which will receive the binding.\n * @param attrName Name of the attribute, if the string belongs to an attribute.\n * @param sanitizeFn Sanitization function used to sanitize the string after update, if necessary.\n */\nfunction generateBindingUpdateOpCodes(\n str: string, destinationNode: number, attrName?: string,\n sanitizeFn: SanitizerFn | null = null): I18nUpdateOpCodes {\n const updateOpCodes: I18nUpdateOpCodes = [null, null]; // Alloc space for mask and size\n const textParts = str.split(BINDING_REGEXP);\n let mask = 0;\n\n for (let j = 0; j < textParts.length; j++) {\n const textValue = textParts[j];\n\n if (j & 1) {\n // Odd indexes are bindings\n const bindingIndex = parseInt(textValue, 10);\n updateOpCodes.push(-1 - bindingIndex);\n mask = mask | toMaskBit(bindingIndex);\n } else if (textValue !== '') {\n // Even indexes are text\n updateOpCodes.push(textValue);\n }\n }\n\n updateOpCodes.push(\n destinationNode << I18nUpdateOpCode.SHIFT_REF |\n (attrName ? I18nUpdateOpCode.Attr : I18nUpdateOpCode.Text));\n if (attrName) {\n updateOpCodes.push(attrName, sanitizeFn);\n }\n updateOpCodes[0] = mask;\n updateOpCodes[1] = updateOpCodes.length - 2;\n return updateOpCodes;\n}\n\nfunction getBindingMask(icuExpression: IcuExpression, mask = 0): number {\n mask = mask | toMaskBit(icuExpression.mainBinding);\n let match;\n for (let i = 0; i < icuExpression.values.length; i++) {\n const valueArr = icuExpression.values[i];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value === 'string') {\n while (match = BINDING_REGEXP.exec(value)) {\n mask = mask | toMaskBit(parseInt(match[1], 10));\n }\n } else {\n mask = getBindingMask(value as IcuExpression, mask);\n }\n }\n }\n return mask;\n}\n\nconst i18nIndexStack: number[] = [];\nlet i18nIndexStackPointer = -1;\n\n/**\n * Convert binding index to mask bit.\n *\n * Each index represents a single bit on the bit-mask. Because bit-mask only has 32 bits, we make\n * the 32nd bit share all masks for all bindings higher than 32. Since it is extremely rare to have\n * more than 32 bindings this will be hit very rarely. The downside of hitting this corner case is\n * that we will execute binding code more often than necessary. (penalty of performance)\n */\nfunction toMaskBit(bindingIndex: number): number {\n return 1 << Math.min(bindingIndex, 31);\n}\n\nconst parentIndexStack: number[] = [];\n\n/**\n * Marks a block of text as translatable.\n *\n * The instructions `i18nStart` and `i18nEnd` mark the translation block in the template.\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param message The translation message.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n */\nexport function i18nStart(index: number, message: string, subTemplateIndex?: number): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n i18nIndexStack[++i18nIndexStackPointer] = index;\n if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {\n i18nStartFirstPass(tView, index, message, subTemplateIndex);\n }\n}\n\n/**\n * See `i18nStart` above.\n */\nfunction i18nStartFirstPass(\n tView: TView, index: number, message: string, subTemplateIndex?: number) {\n const viewData = getLView();\n const expandoStartIndex = tView.blueprint.length - HEADER_OFFSET;\n const previousOrParentTNode = getPreviousOrParentTNode();\n const parentTNode = getIsParent() ? getPreviousOrParentTNode() :\n previousOrParentTNode && previousOrParentTNode.parent;\n let parentIndex = parentTNode && parentTNode !== viewData[HOST_NODE] ?\n parentTNode.index - HEADER_OFFSET :\n index;\n let parentIndexPointer = 0;\n parentIndexStack[parentIndexPointer] = parentIndex;\n const createOpCodes: I18nMutateOpCodes = [];\n // If the previous node wasn't the direct parent then we have a translation without top level\n // element and we need to keep a reference of the previous element if there is one\n if (index > 0 && previousOrParentTNode !== parentTNode) {\n // Create an OpCode to select the previous TNode\n createOpCodes.push(\n previousOrParentTNode.index << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Select);\n }\n const updateOpCodes: I18nUpdateOpCodes = [];\n const icuExpressions: TIcu[] = [];\n\n const templateTranslation = getTranslationForTemplate(message, subTemplateIndex);\n const msgParts = templateTranslation.split(PH_REGEXP);\n for (let i = 0; i < msgParts.length; i++) {\n let value = msgParts[i];\n if (i & 1) {\n // Odd indexes are placeholders (elements and sub-templates)\n if (value.charAt(0) === '/') {\n // It is a closing tag\n if (value.charAt(1) === '#') {\n const phIndex = parseInt(value.substr(2), 10);\n parentIndex = parentIndexStack[--parentIndexPointer];\n createOpCodes.push(phIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.ElementEnd);\n }\n } else {\n const phIndex = parseInt(value.substr(1), 10);\n // The value represents a placeholder that we move to the designated index\n createOpCodes.push(\n phIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Select,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n if (value.charAt(0) === '#') {\n parentIndexStack[++parentIndexPointer] = parentIndex = phIndex;\n }\n }\n } else {\n // Even indexes are text (including bindings & ICU expressions)\n const parts = value.split(ICU_REGEXP);\n for (let j = 0; j < parts.length; j++) {\n value = parts[j];\n\n if (j & 1) {\n // Odd indexes are ICU expressions\n // Create the comment node that will anchor the ICU expression\n allocExpando(viewData);\n const icuNodeIndex = tView.blueprint.length - 1 - HEADER_OFFSET;\n createOpCodes.push(\n COMMENT_MARKER, ngDevMode ? `ICU ${icuNodeIndex}` : '',\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n // Update codes for the ICU expression\n const icuExpression = parseICUBlock(value.substr(1, value.length - 2));\n const mask = getBindingMask(icuExpression);\n icuStart(icuExpressions, icuExpression, icuNodeIndex, icuNodeIndex);\n // Since this is recursive, the last TIcu that was pushed is the one we want\n const tIcuIndex = icuExpressions.length - 1;\n updateOpCodes.push(\n toMaskBit(icuExpression.mainBinding), // mask of the main binding\n 3, // skip 3 opCodes if not changed\n -1 - icuExpression.mainBinding,\n icuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuSwitch, tIcuIndex,\n mask, // mask of all the bindings of this ICU expression\n 2, // skip 2 opCodes if not changed\n icuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuUpdate, tIcuIndex);\n } else if (value !== '') {\n // Even indexes are text (including bindings)\n const hasBinding = value.match(BINDING_REGEXP);\n // Create text nodes\n allocExpando(viewData);\n createOpCodes.push(\n // If there is a binding, the value will be set during update\n hasBinding ? '' : value,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n\n if (hasBinding) {\n addAllToArray(\n generateBindingUpdateOpCodes(value, tView.blueprint.length - 1 - HEADER_OFFSET),\n updateOpCodes);\n }\n }\n }\n }\n }\n\n // NOTE: local var needed to properly assert the type of `TI18n`.\n const tI18n: TI18n = {\n vars: tView.blueprint.length - HEADER_OFFSET - expandoStartIndex,\n expandoStartIndex,\n create: createOpCodes,\n update: updateOpCodes,\n icus: icuExpressions.length ? icuExpressions : null,\n };\n tView.data[index + HEADER_OFFSET] = tI18n;\n}\n\nfunction appendI18nNode(tNode: TNode, parentTNode: TNode, previousTNode: TNode | null): TNode {\n ngDevMode && ngDevMode.rendererMoveNode++;\n const viewData = getLView();\n if (!previousTNode) {\n previousTNode = parentTNode;\n }\n // re-organize node tree to put this node in the correct position.\n if (previousTNode === parentTNode && tNode !== parentTNode.child) {\n tNode.next = parentTNode.child;\n parentTNode.child = tNode;\n } else if (previousTNode !== parentTNode && tNode !== previousTNode.next) {\n tNode.next = previousTNode.next;\n previousTNode.next = tNode;\n } else {\n tNode.next = null;\n }\n\n if (parentTNode !== viewData[HOST_NODE]) {\n tNode.parent = parentTNode as TElementNode;\n }\n\n appendChild(getNativeByTNode(tNode, viewData), tNode, viewData);\n\n const slotValue = viewData[tNode.index];\n if (tNode.type !== TNodeType.Container && isLContainer(slotValue)) {\n // Nodes that inject ViewContainerRef also have a comment node that should be moved\n appendChild(slotValue[NATIVE], tNode, viewData);\n }\n return tNode;\n}\n\n/**\n * Handles message string post-processing for internationalization.\n *\n * Handles message string post-processing by transforming it from intermediate\n * format (that might contain some markers that we need to replace) to the final\n * form, consumable by i18nStart instruction. Post processing steps include:\n *\n * 1. Resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n * 2. Replace all ICU vars (like \"VAR_PLURAL\")\n * 3. Replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n * in case multiple ICUs have the same placeholder name\n *\n * @param message Raw translation string for post processing\n * @param replacements Set of replacements that should be applied\n *\n * @returns Transformed string that can be consumed by i18nStart instruction\n *\n * @publicAPI\n */\nexport function i18nPostprocess(\n message: string, replacements: {[key: string]: (string | string[])}): string {\n //\n // Step 1: resolve all multi-value cases (like [�*1:1��#2:1�|�#4:1�|�5�])\n //\n const matches: {[key: string]: string[]} = {};\n let result = message.replace(PP_PLACEHOLDERS, (_match, content: string): string => {\n if (!matches[content]) {\n matches[content] = content.split('|');\n }\n if (!matches[content].length) {\n throw new Error(`i18n postprocess: unmatched placeholder - ${content}`);\n }\n return matches[content].shift() !;\n });\n\n // verify that we injected all values\n const hasUnmatchedValues = Object.keys(matches).some(key => !!matches[key].length);\n if (hasUnmatchedValues) {\n throw new Error(`i18n postprocess: unmatched values - ${JSON.stringify(matches)}`);\n }\n\n // return current result if no replacements specified\n if (!Object.keys(replacements).length) {\n return result;\n }\n\n //\n // Step 2: replace all ICU vars (like \"VAR_PLURAL\")\n //\n result = result.replace(PP_ICU_VARS, (match, start, key, _type, _idx, end): string => {\n return replacements.hasOwnProperty(key) ? `${start}${replacements[key]}${end}` : match;\n });\n\n //\n // Step 3: replace all ICU references with corresponding values (like �ICU_EXP_ICU_1�)\n // in case multiple ICUs have the same placeholder name\n //\n result = result.replace(PP_ICUS, (match, key): string => {\n if (replacements.hasOwnProperty(key)) {\n const list = replacements[key] as string[];\n if (!list.length) {\n throw new Error(`i18n postprocess: unmatched ICU - ${match} with key: ${key}`);\n }\n return list.shift() !;\n }\n return match;\n });\n\n return result;\n}\n\n/**\n * Translates a translation block marked by `i18nStart` and `i18nEnd`. It inserts the text/ICU nodes\n * into the render tree, moves the placeholder nodes and removes the deleted nodes.\n */\nexport function i18nEnd(): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n i18nEndFirstPass(tView);\n}\n\n/**\n * See `i18nEnd` above.\n */\nfunction i18nEndFirstPass(tView: TView) {\n const viewData = getLView();\n ngDevMode && assertEqual(\n viewData[BINDING_INDEX], viewData[TVIEW].bindingStartIndex,\n 'i18nEnd should be called before any binding');\n\n const rootIndex = i18nIndexStack[i18nIndexStackPointer--];\n const tI18n = tView.data[rootIndex + HEADER_OFFSET] as TI18n;\n ngDevMode && assertDefined(tI18n, `You should call i18nStart before i18nEnd`);\n\n // The last placeholder that was added before `i18nEnd`\n const previousOrParentTNode = getPreviousOrParentTNode();\n const visitedPlaceholders =\n readCreateOpCodes(rootIndex, tI18n.create, tI18n.expandoStartIndex, viewData);\n\n // Remove deleted placeholders\n // The last placeholder that was added before `i18nEnd` is `previousOrParentTNode`\n for (let i = rootIndex + 1; i <= previousOrParentTNode.index - HEADER_OFFSET; i++) {\n if (visitedPlaceholders.indexOf(i) === -1) {\n removeNode(i, viewData);\n }\n }\n}\n\nfunction readCreateOpCodes(\n index: number, createOpCodes: I18nMutateOpCodes, expandoStartIndex: number,\n viewData: LView): number[] {\n const renderer = getLView()[RENDERER];\n let currentTNode: TNode|null = null;\n let previousTNode: TNode|null = null;\n const visitedPlaceholders: number[] = [];\n for (let i = 0; i < createOpCodes.length; i++) {\n const opCode = createOpCodes[i];\n if (typeof opCode == 'string') {\n const textRNode = createTextNode(opCode, renderer);\n ngDevMode && ngDevMode.rendererCreateTextNode++;\n previousTNode = currentTNode;\n currentTNode =\n createNodeAtIndex(expandoStartIndex++, TNodeType.Element, textRNode, null, null);\n setIsParent(false);\n } else if (typeof opCode == 'number') {\n switch (opCode & I18nMutateOpCode.MASK_OPCODE) {\n case I18nMutateOpCode.AppendChild:\n const destinationNodeIndex = opCode >>> I18nMutateOpCode.SHIFT_PARENT;\n let destinationTNode: TNode;\n if (destinationNodeIndex === index) {\n // If the destination node is `i18nStart`, we don't have a\n // top-level node and we should use the host node instead\n destinationTNode = viewData[HOST_NODE] !;\n } else {\n destinationTNode = getTNode(destinationNodeIndex, viewData);\n }\n ngDevMode &&\n assertDefined(\n currentTNode !,\n `You need to create or select a node before you can insert it into the DOM`);\n previousTNode = appendI18nNode(currentTNode !, destinationTNode, previousTNode);\n destinationTNode.next = null;\n break;\n case I18nMutateOpCode.Select:\n const nodeIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n visitedPlaceholders.push(nodeIndex);\n previousTNode = currentTNode;\n currentTNode = getTNode(nodeIndex, viewData);\n if (currentTNode) {\n setPreviousOrParentTNode(currentTNode);\n if (currentTNode.type === TNodeType.Element) {\n setIsParent(true);\n }\n }\n break;\n case I18nMutateOpCode.ElementEnd:\n const elementIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n previousTNode = currentTNode = getTNode(elementIndex, viewData);\n setPreviousOrParentTNode(currentTNode);\n setIsParent(false);\n break;\n case I18nMutateOpCode.Attr:\n const elementNodeIndex = opCode >>> I18nMutateOpCode.SHIFT_REF;\n const attrName = createOpCodes[++i] as string;\n const attrValue = createOpCodes[++i] as string;\n elementAttribute(elementNodeIndex, attrName, attrValue);\n break;\n default:\n throw new Error(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n } else {\n switch (opCode) {\n case COMMENT_MARKER:\n const commentValue = createOpCodes[++i] as string;\n ngDevMode && assertEqual(\n typeof commentValue, 'string',\n `Expected \"${commentValue}\" to be a comment node value`);\n const commentRNode = renderer.createComment(commentValue);\n ngDevMode && ngDevMode.rendererCreateComment++;\n previousTNode = currentTNode;\n currentTNode = createNodeAtIndex(\n expandoStartIndex++, TNodeType.IcuContainer, commentRNode, null, null);\n attachPatchData(commentRNode, viewData);\n (currentTNode as TIcuContainerNode).activeCaseIndex = null;\n // We will add the case nodes later, during the update phase\n setIsParent(false);\n break;\n case ELEMENT_MARKER:\n const tagNameValue = createOpCodes[++i] as string;\n ngDevMode && assertEqual(\n typeof tagNameValue, 'string',\n `Expected \"${tagNameValue}\" to be an element node tag name`);\n const elementRNode = renderer.createElement(tagNameValue);\n ngDevMode && ngDevMode.rendererCreateElement++;\n previousTNode = currentTNode;\n currentTNode = createNodeAtIndex(\n expandoStartIndex++, TNodeType.Element, elementRNode, tagNameValue, null);\n break;\n default:\n throw new Error(`Unable to determine the type of mutate operation for \"${opCode}\"`);\n }\n }\n }\n\n setIsParent(false);\n\n return visitedPlaceholders;\n}\n\nfunction readUpdateOpCodes(\n updateOpCodes: I18nUpdateOpCodes, icus: TIcu[] | null, bindingsStartIndex: number,\n changeMask: number, viewData: LView, bypassCheckBit = false) {\n let caseCreated = false;\n for (let i = 0; i < updateOpCodes.length; i++) {\n // bit code to check if we should apply the next update\n const checkBit = updateOpCodes[i] as number;\n // Number of opCodes to skip until next set of update codes\n const skipCodes = updateOpCodes[++i] as number;\n if (bypassCheckBit || (checkBit & changeMask)) {\n // The value has been updated since last checked\n let value = '';\n for (let j = i + 1; j <= (i + skipCodes); j++) {\n const opCode = updateOpCodes[j];\n if (typeof opCode == 'string') {\n value += opCode;\n } else if (typeof opCode == 'number') {\n if (opCode < 0) {\n // It's a binding index whose value is negative\n value += stringify(viewData[bindingsStartIndex - opCode]);\n } else {\n const nodeIndex = opCode >>> I18nUpdateOpCode.SHIFT_REF;\n let tIcuIndex: number;\n let tIcu: TIcu;\n let icuTNode: TIcuContainerNode;\n switch (opCode & I18nUpdateOpCode.MASK_OPCODE) {\n case I18nUpdateOpCode.Attr:\n const attrName = updateOpCodes[++j] as string;\n const sanitizeFn = updateOpCodes[++j] as SanitizerFn | null;\n elementAttribute(nodeIndex, attrName, value, sanitizeFn);\n break;\n case I18nUpdateOpCode.Text:\n textBinding(nodeIndex, value);\n break;\n case I18nUpdateOpCode.IcuSwitch:\n tIcuIndex = updateOpCodes[++j] as number;\n tIcu = icus ![tIcuIndex];\n icuTNode = getTNode(nodeIndex, viewData) as TIcuContainerNode;\n // If there is an active case, delete the old nodes\n if (icuTNode.activeCaseIndex !== null) {\n const removeCodes = tIcu.remove[icuTNode.activeCaseIndex];\n for (let k = 0; k < removeCodes.length; k++) {\n const removeOpCode = removeCodes[k] as number;\n switch (removeOpCode & I18nMutateOpCode.MASK_OPCODE) {\n case I18nMutateOpCode.Remove:\n const nodeIndex = removeOpCode >>> I18nMutateOpCode.SHIFT_REF;\n removeNode(nodeIndex, viewData);\n break;\n case I18nMutateOpCode.RemoveNestedIcu:\n const nestedIcuNodeIndex =\n removeCodes[k + 1] as number >>> I18nMutateOpCode.SHIFT_REF;\n const nestedIcuTNode =\n getTNode(nestedIcuNodeIndex, viewData) as TIcuContainerNode;\n const activeIndex = nestedIcuTNode.activeCaseIndex;\n if (activeIndex !== null) {\n const nestedIcuTIndex = removeOpCode >>> I18nMutateOpCode.SHIFT_REF;\n const nestedTIcu = icus ![nestedIcuTIndex];\n addAllToArray(nestedTIcu.remove[activeIndex], removeCodes);\n }\n break;\n }\n }\n }\n\n // Update the active caseIndex\n const caseIndex = getCaseIndex(tIcu, value);\n icuTNode.activeCaseIndex = caseIndex !== -1 ? caseIndex : null;\n\n // Add the nodes for the new case\n readCreateOpCodes(-1, tIcu.create[caseIndex], tIcu.expandoStartIndex, viewData);\n caseCreated = true;\n break;\n case I18nUpdateOpCode.IcuUpdate:\n tIcuIndex = updateOpCodes[++j] as number;\n tIcu = icus ![tIcuIndex];\n icuTNode = getTNode(nodeIndex, viewData) as TIcuContainerNode;\n readUpdateOpCodes(\n tIcu.update[icuTNode.activeCaseIndex !], icus, bindingsStartIndex, changeMask,\n viewData, caseCreated);\n break;\n }\n }\n }\n }\n }\n i += skipCodes;\n }\n}\n\nfunction removeNode(index: number, viewData: LView) {\n const removedPhTNode = getTNode(index, viewData);\n const removedPhRNode = getNativeByIndex(index, viewData);\n removeChild(removedPhTNode, removedPhRNode || null, viewData);\n removedPhTNode.detached = true;\n ngDevMode && ngDevMode.rendererRemoveNode++;\n\n const slotValue = load(index) as RElement | RComment | LContainer | StylingContext;\n if (isLContainer(slotValue)) {\n const lContainer = slotValue as LContainer;\n if (removedPhTNode.type !== TNodeType.Container) {\n removeChild(removedPhTNode, lContainer[NATIVE] || null, viewData);\n }\n lContainer[RENDER_PARENT] = null;\n }\n}\n\n/**\n *\n * Use this instruction to create a translation block that doesn't contain any placeholder.\n * It calls both {@link i18nStart} and {@link i18nEnd} in one instruction.\n *\n * The translation `message` is the value which is locale specific. The translation string may\n * contain placeholders which associate inner elements and sub-templates within the translation.\n *\n * The translation `message` placeholders are:\n * - `�{index}(:{block})�`: *Binding Placeholder*: Marks a location where an expression will be\n * interpolated into. The placeholder `index` points to the expression binding index. An optional\n * `block` that matches the sub-template in which it was declared.\n * - `�#{index}(:{block})�`/`�/#{index}(:{block})�`: *Element Placeholder*: Marks the beginning\n * and end of DOM element that were embedded in the original translation block. The placeholder\n * `index` points to the element index in the template instructions set. An optional `block` that\n * matches the sub-template in which it was declared.\n * - `�*{index}:{block}�`/`�/*{index}:{block}�`: *Sub-template Placeholder*: Sub-templates must be\n * split up and translated separately in each angular template function. The `index` points to the\n * `template` instruction index. A `block` that matches the sub-template in which it was declared.\n *\n * @param index A unique index of the translation in the static block.\n * @param message The translation message.\n * @param subTemplateIndex Optional sub-template index in the `message`.\n */\nexport function i18n(index: number, message: string, subTemplateIndex?: number): void {\n i18nStart(index, message, subTemplateIndex);\n i18nEnd();\n}\n\n/**\n * Marks a list of attributes as translatable.\n *\n * @param index A unique index in the static block\n * @param values\n */\nexport function i18nAttributes(index: number, values: string[]): void {\n const tView = getLView()[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n ngDevMode &&\n assertEqual(\n tView.firstTemplatePass, true, `You should only call i18nEnd on first template pass`);\n if (tView.firstTemplatePass && tView.data[index + HEADER_OFFSET] === null) {\n i18nAttributesFirstPass(tView, index, values);\n }\n}\n\n/**\n * See `i18nAttributes` above.\n */\nfunction i18nAttributesFirstPass(tView: TView, index: number, values: string[]) {\n const previousElement = getPreviousOrParentTNode();\n const previousElementIndex = previousElement.index - HEADER_OFFSET;\n const updateOpCodes: I18nUpdateOpCodes = [];\n for (let i = 0; i < values.length; i += 2) {\n const attrName = values[i];\n const message = values[i + 1];\n const parts = message.split(ICU_REGEXP);\n for (let j = 0; j < parts.length; j++) {\n const value = parts[j];\n\n if (j & 1) {\n // Odd indexes are ICU expressions\n // TODO(ocombe): support ICU expressions in attributes\n } else if (value !== '') {\n // Even indexes are text (including bindings)\n const hasBinding = !!value.match(BINDING_REGEXP);\n if (hasBinding) {\n addAllToArray(\n generateBindingUpdateOpCodes(value, previousElementIndex, attrName), updateOpCodes);\n } else {\n elementAttribute(previousElementIndex, attrName, value);\n }\n }\n }\n }\n\n tView.data[index + HEADER_OFFSET] = updateOpCodes;\n}\n\nlet changeMask = 0b0;\nlet shiftsCounter = 0;\n\n/**\n * Stores the values of the bindings during each update cycle in order to determine if we need to\n * update the translated nodes.\n *\n * @param expression The binding's new value or NO_CHANGE\n */\nexport function i18nExp<T>(expression: T | NO_CHANGE): void {\n if (expression !== NO_CHANGE) {\n changeMask = changeMask | (1 << shiftsCounter);\n }\n shiftsCounter++;\n}\n\n/**\n * Updates a translation block or an i18n attribute when the bindings have changed.\n *\n * @param index Index of either {@link i18nStart} (translation block) or {@link i18nAttributes}\n * (i18n attribute) on which it should update the content.\n */\nexport function i18nApply(index: number) {\n if (shiftsCounter) {\n const lView = getLView();\n const tView = lView[TVIEW];\n ngDevMode && assertDefined(tView, `tView should be defined`);\n const tI18n = tView.data[index + HEADER_OFFSET];\n let updateOpCodes: I18nUpdateOpCodes;\n let icus: TIcu[]|null = null;\n if (Array.isArray(tI18n)) {\n updateOpCodes = tI18n as I18nUpdateOpCodes;\n } else {\n updateOpCodes = (tI18n as TI18n).update;\n icus = (tI18n as TI18n).icus;\n }\n const bindingsStartIndex = lView[BINDING_INDEX] - shiftsCounter - 1;\n readUpdateOpCodes(updateOpCodes, icus, bindingsStartIndex, changeMask, lView);\n\n // Reset changeMask & maskBit to default for the next update cycle\n changeMask = 0b0;\n shiftsCounter = 0;\n }\n}\n\nenum Plural {\n Zero = 0,\n One = 1,\n Two = 2,\n Few = 3,\n Many = 4,\n Other = 5,\n}\n\n/**\n * Returns the plural case based on the locale.\n * This is a copy of the deprecated function that we used in Angular v4.\n * // TODO(ocombe): remove this once we can the real getPluralCase function\n *\n * @deprecated from v5 the plural case function is in locale data files common/locales/*.ts\n */\nfunction getPluralCase(locale: string, nLike: number | string): Plural {\n if (typeof nLike === 'string') {\n nLike = parseInt(<string>nLike, 10);\n }\n const n: number = nLike as number;\n const nDecimal = n.toString().replace(/^[^.]*\\.?/, '');\n const i = Math.floor(Math.abs(n));\n const v = nDecimal.length;\n const f = parseInt(nDecimal, 10);\n const t = parseInt(n.toString().replace(/^[^.]*\\.?|0+$/g, ''), 10) || 0;\n\n const lang = locale.split('-')[0].toLowerCase();\n\n switch (lang) {\n case 'af':\n case 'asa':\n case 'az':\n case 'bem':\n case 'bez':\n case 'bg':\n case 'brx':\n case 'ce':\n case 'cgg':\n case 'chr':\n case 'ckb':\n case 'ee':\n case 'el':\n case 'eo':\n case 'es':\n case 'eu':\n case 'fo':\n case 'fur':\n case 'gsw':\n case 'ha':\n case 'haw':\n case 'hu':\n case 'jgo':\n case 'jmc':\n case 'ka':\n case 'kk':\n case 'kkj':\n case 'kl':\n case 'ks':\n case 'ksb':\n case 'ky':\n case 'lb':\n case 'lg':\n case 'mas':\n case 'mgo':\n case 'ml':\n case 'mn':\n case 'nb':\n case 'nd':\n case 'ne':\n case 'nn':\n case 'nnh':\n case 'nyn':\n case 'om':\n case 'or':\n case 'os':\n case 'ps':\n case 'rm':\n case 'rof':\n case 'rwk':\n case 'saq':\n case 'seh':\n case 'sn':\n case 'so':\n case 'sq':\n case 'ta':\n case 'te':\n case 'teo':\n case 'tk':\n case 'tr':\n case 'ug':\n case 'uz':\n case 'vo':\n case 'vun':\n case 'wae':\n case 'xog':\n if (n === 1) return Plural.One;\n return Plural.Other;\n case 'ak':\n case 'ln':\n case 'mg':\n case 'pa':\n case 'ti':\n if (n === Math.floor(n) && n >= 0 && n <= 1) return Plural.One;\n return Plural.Other;\n case 'am':\n case 'as':\n case 'bn':\n case 'fa':\n case 'gu':\n case 'hi':\n case 'kn':\n case 'mr':\n case 'zu':\n if (i === 0 || n === 1) return Plural.One;\n return Plural.Other;\n case 'ar':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 3 && n % 100 <= 10) return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 99) return Plural.Many;\n return Plural.Other;\n case 'ast':\n case 'ca':\n case 'de':\n case 'en':\n case 'et':\n case 'fi':\n case 'fy':\n case 'gl':\n case 'it':\n case 'nl':\n case 'sv':\n case 'sw':\n case 'ur':\n case 'yi':\n if (i === 1 && v === 0) return Plural.One;\n return Plural.Other;\n case 'be':\n if (n % 10 === 1 && !(n % 100 === 11)) return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 4 &&\n !(n % 100 >= 12 && n % 100 <= 14))\n return Plural.Few;\n if (n % 10 === 0 || n % 10 === Math.floor(n % 10) && n % 10 >= 5 && n % 10 <= 9 ||\n n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'br':\n if (n % 10 === 1 && !(n % 100 === 11 || n % 100 === 71 || n % 100 === 91)) return Plural.One;\n if (n % 10 === 2 && !(n % 100 === 12 || n % 100 === 72 || n % 100 === 92)) return Plural.Two;\n if (n % 10 === Math.floor(n % 10) && (n % 10 >= 3 && n % 10 <= 4 || n % 10 === 9) &&\n !(n % 100 >= 10 && n % 100 <= 19 || n % 100 >= 70 && n % 100 <= 79 ||\n n % 100 >= 90 && n % 100 <= 99))\n return Plural.Few;\n if (!(n === 0) && n % 1e6 === 0) return Plural.Many;\n return Plural.Other;\n case 'bs':\n case 'hr':\n case 'sr':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11) || f % 10 === 1 && !(f % 100 === 11))\n return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14) ||\n f % 10 === Math.floor(f % 10) && f % 10 >= 2 && f % 10 <= 4 &&\n !(f % 100 >= 12 && f % 100 <= 14))\n return Plural.Few;\n return Plural.Other;\n case 'cs':\n case 'sk':\n if (i === 1 && v === 0) return Plural.One;\n if (i === Math.floor(i) && i >= 2 && i <= 4 && v === 0) return Plural.Few;\n if (!(v === 0)) return Plural.Many;\n return Plural.Other;\n case 'cy':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n === 3) return Plural.Few;\n if (n === 6) return Plural.Many;\n return Plural.Other;\n case 'da':\n if (n === 1 || !(t === 0) && (i === 0 || i === 1)) return Plural.One;\n return Plural.Other;\n case 'dsb':\n case 'hsb':\n if (v === 0 && i % 100 === 1 || f % 100 === 1) return Plural.One;\n if (v === 0 && i % 100 === 2 || f % 100 === 2) return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 ||\n f % 100 === Math.floor(f % 100) && f % 100 >= 3 && f % 100 <= 4)\n return Plural.Few;\n return Plural.Other;\n case 'ff':\n case 'fr':\n case 'hy':\n case 'kab':\n if (i === 0 || i === 1) return Plural.One;\n return Plural.Other;\n case 'fil':\n if (v === 0 && (i === 1 || i === 2 || i === 3) ||\n v === 0 && !(i % 10 === 4 || i % 10 === 6 || i % 10 === 9) ||\n !(v === 0) && !(f % 10 === 4 || f % 10 === 6 || f % 10 === 9))\n return Plural.One;\n return Plural.Other;\n case 'ga':\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n if (n === Math.floor(n) && n >= 3 && n <= 6) return Plural.Few;\n if (n === Math.floor(n) && n >= 7 && n <= 10) return Plural.Many;\n return Plural.Other;\n case 'gd':\n if (n === 1 || n === 11) return Plural.One;\n if (n === 2 || n === 12) return Plural.Two;\n if (n === Math.floor(n) && (n >= 3 && n <= 10 || n >= 13 && n <= 19)) return Plural.Few;\n return Plural.Other;\n case 'gv':\n if (v === 0 && i % 10 === 1) return Plural.One;\n if (v === 0 && i % 10 === 2) return Plural.Two;\n if (v === 0 &&\n (i % 100 === 0 || i % 100 === 20 || i % 100 === 40 || i % 100 === 60 || i % 100 === 80))\n return Plural.Few;\n if (!(v === 0)) return Plural.Many;\n return Plural.Other;\n case 'he':\n if (i === 1 && v === 0) return Plural.One;\n if (i === 2 && v === 0) return Plural.Two;\n if (v === 0 && !(n >= 0 && n <= 10) && n % 10 === 0) return Plural.Many;\n return Plural.Other;\n case 'is':\n if (t === 0 && i % 10 === 1 && !(i % 100 === 11) || !(t === 0)) return Plural.One;\n return Plural.Other;\n case 'ksh':\n if (n === 0) return Plural.Zero;\n if (n === 1) return Plural.One;\n return Plural.Other;\n case 'kw':\n case 'naq':\n case 'se':\n case 'smn':\n if (n === 1) return Plural.One;\n if (n === 2) return Plural.Two;\n return Plural.Other;\n case 'lag':\n if (n === 0) return Plural.Zero;\n if ((i === 0 || i === 1) && !(n === 0)) return Plural.One;\n return Plural.Other;\n case 'lt':\n if (n % 10 === 1 && !(n % 100 >= 11 && n % 100 <= 19)) return Plural.One;\n if (n % 10 === Math.floor(n % 10) && n % 10 >= 2 && n % 10 <= 9 &&\n !(n % 100 >= 11 && n % 100 <= 19))\n return Plural.Few;\n if (!(f === 0)) return Plural.Many;\n return Plural.Other;\n case 'lv':\n case 'prg':\n if (n % 10 === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19 ||\n v === 2 && f % 100 === Math.floor(f % 100) && f % 100 >= 11 && f % 100 <= 19)\n return Plural.Zero;\n if (n % 10 === 1 && !(n % 100 === 11) || v === 2 && f % 10 === 1 && !(f % 100 === 11) ||\n !(v === 2) && f % 10 === 1)\n return Plural.One;\n return Plural.Other;\n case 'mk':\n if (v === 0 && i % 10 === 1 || f % 10 === 1) return Plural.One;\n return Plural.Other;\n case 'mt':\n if (n === 1) return Plural.One;\n if (n === 0 || n % 100 === Math.floor(n % 100) && n % 100 >= 2 && n % 100 <= 10)\n return Plural.Few;\n if (n % 100 === Math.floor(n % 100) && n % 100 >= 11 && n % 100 <= 19) return Plural.Many;\n return Plural.Other;\n case 'pl':\n if (i === 1 && v === 0) return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && !(i === 1) && i % 10 === Math.floor(i % 10) && i % 10 >= 0 && i % 10 <= 1 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 12 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'pt':\n if (n === Math.floor(n) && n >= 0 && n <= 2 && !(n === 2)) return Plural.One;\n return Plural.Other;\n case 'ro':\n if (i === 1 && v === 0) return Plural.One;\n if (!(v === 0) || n === 0 ||\n !(n === 1) && n % 100 === Math.floor(n % 100) && n % 100 >= 1 && n % 100 <= 19)\n return Plural.Few;\n return Plural.Other;\n case 'ru':\n case 'uk':\n if (v === 0 && i % 10 === 1 && !(i % 100 === 11)) return Plural.One;\n if (v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 2 && i % 10 <= 4 &&\n !(i % 100 >= 12 && i % 100 <= 14))\n return Plural.Few;\n if (v === 0 && i % 10 === 0 ||\n v === 0 && i % 10 === Math.floor(i % 10) && i % 10 >= 5 && i % 10 <= 9 ||\n v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 11 && i % 100 <= 14)\n return Plural.Many;\n return Plural.Other;\n case 'shi':\n if (i === 0 || n === 1) return Plural.One;\n if (n === Math.floor(n) && n >= 2 && n <= 10) return Plural.Few;\n return Plural.Other;\n case 'si':\n if (n === 0 || n === 1 || i === 0 && f === 1) return Plural.One;\n return Plural.Other;\n case 'sl':\n if (v === 0 && i % 100 === 1) return Plural.One;\n if (v === 0 && i % 100 === 2) return Plural.Two;\n if (v === 0 && i % 100 === Math.floor(i % 100) && i % 100 >= 3 && i % 100 <= 4 || !(v === 0))\n return Plural.Few;\n return Plural.Other;\n case 'tzm':\n if (n === Math.floor(n) && n >= 0 && n <= 1 || n === Math.floor(n) && n >= 11 && n <= 99)\n return Plural.One;\n return Plural.Other;\n // When there is no specification, the default is always \"other\"\n // Spec: http://cldr.unicode.org/index/cldr-spec/plural-rules\n // > other (requiredâgeneral plural form â also used if the language only has a single form)\n default:\n return Plural.Other;\n }\n}\n\nfunction getPluralCategory(value: any, locale: string): string {\n const plural = getPluralCase(locale, value);\n\n switch (plural) {\n case Plural.Zero:\n return 'zero';\n case Plural.One:\n return 'one';\n case Plural.Two:\n return 'two';\n case Plural.Few:\n return 'few';\n case Plural.Many:\n return 'many';\n default:\n return 'other';\n }\n}\n\n/**\n * Returns the index of the current case of an ICU expression depending on the main binding value\n *\n * @param icuExpression\n * @param bindingValue The value of the main binding used by this ICU expression\n */\nfunction getCaseIndex(icuExpression: TIcu, bindingValue: string): number {\n let index = icuExpression.cases.indexOf(bindingValue);\n if (index === -1) {\n switch (icuExpression.type) {\n case IcuType.plural: {\n // TODO(ocombe): replace this hard-coded value by the real LOCALE_ID value\n const locale = 'en-US';\n const resolvedCase = getPluralCategory(bindingValue, locale);\n index = icuExpression.cases.indexOf(resolvedCase);\n if (index === -1 && resolvedCase !== 'other') {\n index = icuExpression.cases.indexOf('other');\n }\n break;\n }\n case IcuType.select: {\n index = icuExpression.cases.indexOf('other');\n break;\n }\n }\n }\n return index;\n}\n\n/**\n * Generate the OpCodes for ICU expressions.\n *\n * @param tIcus\n * @param icuExpression\n * @param startIndex\n * @param expandoStartIndex\n */\nfunction icuStart(\n tIcus: TIcu[], icuExpression: IcuExpression, startIndex: number,\n expandoStartIndex: number): void {\n const createCodes = [];\n const removeCodes = [];\n const updateCodes = [];\n const vars = [];\n const childIcus: number[][] = [];\n for (let i = 0; i < icuExpression.values.length; i++) {\n // Each value is an array of strings & other ICU expressions\n const valueArr = icuExpression.values[i];\n const nestedIcus: IcuExpression[] = [];\n for (let j = 0; j < valueArr.length; j++) {\n const value = valueArr[j];\n if (typeof value !== 'string') {\n // It is an nested ICU expression\n const icuIndex = nestedIcus.push(value as IcuExpression) - 1;\n // Replace nested ICU expression by a comment node\n valueArr[j] = `<!--�${icuIndex}�-->`;\n }\n }\n const icuCase: IcuCase =\n parseIcuCase(valueArr.join(''), startIndex, nestedIcus, tIcus, expandoStartIndex);\n createCodes.push(icuCase.create);\n removeCodes.push(icuCase.remove);\n updateCodes.push(icuCase.update);\n vars.push(icuCase.vars);\n childIcus.push(icuCase.childIcus);\n }\n const tIcu: TIcu = {\n type: icuExpression.type,\n vars,\n expandoStartIndex: expandoStartIndex + 1, childIcus,\n cases: icuExpression.cases,\n create: createCodes,\n remove: removeCodes,\n update: updateCodes\n };\n tIcus.push(tIcu);\n const lView = getLView();\n const worstCaseSize = Math.max(...vars);\n for (let i = 0; i < worstCaseSize; i++) {\n allocExpando(lView);\n }\n}\n\n/**\n * Transforms a string template into an HTML template and a list of instructions used to update\n * attributes or nodes that contain bindings.\n *\n * @param unsafeHtml The string to parse\n * @param parentIndex\n * @param nestedIcus\n * @param tIcus\n * @param expandoStartIndex\n */\nfunction parseIcuCase(\n unsafeHtml: string, parentIndex: number, nestedIcus: IcuExpression[], tIcus: TIcu[],\n expandoStartIndex: number): IcuCase {\n const inertBodyHelper = new InertBodyHelper(document);\n const inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml);\n if (!inertBodyElement) {\n throw new Error('Unable to generate inert body element');\n }\n const wrapper = getTemplateContent(inertBodyElement !) as Element || inertBodyElement;\n const opCodes: IcuCase = {vars: 0, childIcus: [], create: [], remove: [], update: []};\n parseNodes(wrapper.firstChild, opCodes, parentIndex, nestedIcus, tIcus, expandoStartIndex);\n return opCodes;\n}\n\nconst NESTED_ICU = /�(\\d+)�/;\n\n/**\n * Parses a node, its children and its siblings, and generates the mutate & update OpCodes.\n *\n * @param currentNode The first node to parse\n * @param icuCase The data for the ICU expression case that contains those nodes\n * @param parentIndex Index of the current node's parent\n * @param nestedIcus Data for the nested ICU expressions that this case contains\n * @param tIcus Data for all ICU expressions of the current message\n * @param expandoStartIndex Expando start index for the current ICU expression\n */\nfunction parseNodes(\n currentNode: Node | null, icuCase: IcuCase, parentIndex: number, nestedIcus: IcuExpression[],\n tIcus: TIcu[], expandoStartIndex: number) {\n if (currentNode) {\n const nestedIcusToCreate: [IcuExpression, number][] = [];\n while (currentNode) {\n const nextNode: Node|null = currentNode.nextSibling;\n const newIndex = expandoStartIndex + ++icuCase.vars;\n switch (currentNode.nodeType) {\n case Node.ELEMENT_NODE:\n const element = currentNode as Element;\n const tagName = element.tagName.toLowerCase();\n if (!VALID_ELEMENTS.hasOwnProperty(tagName)) {\n // This isn't a valid element, we won't create an element for it\n icuCase.vars--;\n } else {\n icuCase.create.push(\n ELEMENT_MARKER, tagName,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n const elAttrs = element.attributes;\n for (let i = 0; i < elAttrs.length; i++) {\n const attr = elAttrs.item(i) !;\n const lowerAttrName = attr.name.toLowerCase();\n const hasBinding = !!attr.value.match(BINDING_REGEXP);\n // we assume the input string is safe, unless it's using a binding\n if (hasBinding) {\n if (VALID_ATTRS.hasOwnProperty(lowerAttrName)) {\n if (URI_ATTRS[lowerAttrName]) {\n addAllToArray(\n generateBindingUpdateOpCodes(attr.value, newIndex, attr.name, _sanitizeUrl),\n icuCase.update);\n } else if (SRCSET_ATTRS[lowerAttrName]) {\n addAllToArray(\n generateBindingUpdateOpCodes(\n attr.value, newIndex, attr.name, sanitizeSrcset),\n icuCase.update);\n } else {\n addAllToArray(\n generateBindingUpdateOpCodes(attr.value, newIndex, attr.name),\n icuCase.update);\n }\n } else {\n ngDevMode &&\n console.warn(\n `WARNING: ignoring unsafe attribute value ${lowerAttrName} on element ${tagName} (see http://g.co/ng/security#xss)`);\n }\n } else {\n icuCase.create.push(\n newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Attr, attr.name,\n attr.value);\n }\n }\n // Parse the children of this node (if any)\n parseNodes(\n currentNode.firstChild, icuCase, newIndex, nestedIcus, tIcus, expandoStartIndex);\n // Remove the parent node after the children\n icuCase.remove.push(newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n }\n break;\n case Node.TEXT_NODE:\n const value = currentNode.textContent || '';\n const hasBinding = value.match(BINDING_REGEXP);\n icuCase.create.push(\n hasBinding ? '' : value,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n icuCase.remove.push(newIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n if (hasBinding) {\n addAllToArray(generateBindingUpdateOpCodes(value, newIndex), icuCase.update);\n }\n break;\n case Node.COMMENT_NODE:\n // Check if the comment node is a placeholder for a nested ICU\n const match = NESTED_ICU.exec(currentNode.textContent || '');\n if (match) {\n const nestedIcuIndex = parseInt(match[1], 10);\n const newLocal = ngDevMode ? `nested ICU ${nestedIcuIndex}` : '';\n // Create the comment node that will anchor the ICU expression\n icuCase.create.push(\n COMMENT_MARKER, newLocal,\n parentIndex << I18nMutateOpCode.SHIFT_PARENT | I18nMutateOpCode.AppendChild);\n const nestedIcu = nestedIcus[nestedIcuIndex];\n nestedIcusToCreate.push([nestedIcu, newIndex]);\n } else {\n // We do not handle any other type of comment\n icuCase.vars--;\n }\n break;\n default:\n // We do not handle any other type of element\n icuCase.vars--;\n }\n currentNode = nextNode !;\n }\n\n for (let i = 0; i < nestedIcusToCreate.length; i++) {\n const nestedIcu = nestedIcusToCreate[i][0];\n const nestedIcuNodeIndex = nestedIcusToCreate[i][1];\n icuStart(tIcus, nestedIcu, nestedIcuNodeIndex, expandoStartIndex + icuCase.vars);\n // Since this is recursive, the last TIcu that was pushed is the one we want\n const nestTIcuIndex = tIcus.length - 1;\n icuCase.vars += Math.max(...tIcus[nestTIcuIndex].vars);\n icuCase.childIcus.push(nestTIcuIndex);\n const mask = getBindingMask(nestedIcu);\n icuCase.update.push(\n toMaskBit(nestedIcu.mainBinding), // mask of the main binding\n 3, // skip 3 opCodes if not changed\n -1 - nestedIcu.mainBinding,\n nestedIcuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuSwitch,\n nestTIcuIndex,\n mask, // mask of all the bindings of this ICU expression\n 2, // skip 2 opCodes if not changed\n nestedIcuNodeIndex << I18nUpdateOpCode.SHIFT_REF | I18nUpdateOpCode.IcuUpdate,\n nestTIcuIndex);\n icuCase.remove.push(\n nestTIcuIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.RemoveNestedIcu,\n nestedIcuNodeIndex << I18nMutateOpCode.SHIFT_REF | I18nMutateOpCode.Remove);\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {INJECTOR, Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {StaticProvider} from '../di/provider';\nimport {createInjector} from '../di/r3_injector';\nimport {ComponentFactoryResolver as viewEngine_ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory as viewEngine_NgModuleFactory, NgModuleRef as viewEngine_NgModuleRef} from '../linker/ng_module_factory';\nimport {NgModuleDef} from '../metadata/ng_module';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {assertDefined} from './assert';\nimport {ComponentFactoryResolver} from './component_ref';\nimport {getNgModuleDef} from './definition';\n\nexport interface NgModuleType<T = any> extends Type<T> { ngModuleDef: NgModuleDef<T>; }\n\nconst COMPONENT_FACTORY_RESOLVER: StaticProvider = {\n provide: viewEngine_ComponentFactoryResolver,\n useClass: ComponentFactoryResolver,\n deps: [viewEngine_NgModuleRef],\n};\n\nexport class NgModuleRef<T> extends viewEngine_NgModuleRef<T> implements InternalNgModuleRef<T> {\n // tslint:disable-next-line:require-internal-with-underscore\n _bootstrapComponents: Type<any>[] = [];\n // tslint:disable-next-line:require-internal-with-underscore\n _r3Injector: Injector;\n injector: Injector = this;\n instance: T;\n destroyCbs: (() => void)[]|null = [];\n\n constructor(ngModuleType: Type<T>, public _parent: Injector|null) {\n super();\n const ngModuleDef = getNgModuleDef(ngModuleType);\n ngDevMode && assertDefined(\n ngModuleDef,\n `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);\n\n this._bootstrapComponents = ngModuleDef !.bootstrap;\n const additionalProviders: StaticProvider[] = [\n {\n provide: viewEngine_NgModuleRef,\n useValue: this,\n },\n COMPONENT_FACTORY_RESOLVER\n ];\n this._r3Injector = createInjector(ngModuleType, _parent, additionalProviders);\n this.instance = this.get(ngModuleType);\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n injectFlags: InjectFlags = InjectFlags.Default): any {\n if (token === Injector || token === viewEngine_NgModuleRef || token === INJECTOR) {\n return this;\n }\n return this._r3Injector.get(token, notFoundValue, injectFlags);\n }\n\n get componentFactoryResolver(): viewEngine_ComponentFactoryResolver {\n return this.get(viewEngine_ComponentFactoryResolver);\n }\n\n destroy(): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.forEach(fn => fn());\n this.destroyCbs = null;\n }\n onDestroy(callback: () => void): void {\n ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');\n this.destroyCbs !.push(callback);\n }\n}\n\nexport class NgModuleFactory<T> extends viewEngine_NgModuleFactory<T> {\n constructor(public moduleType: Type<T>) { super(); }\n\n create(parentInjector: Injector|null): viewEngine_NgModuleRef<T> {\n return new NgModuleRef(this.moduleType, parentInjector);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\n\ninterface TypeWithMetadata extends Type<any> {\n decorators?: any[];\n ctorParameters?: () => any[];\n propDecorators?: {[field: string]: any};\n}\n\n/**\n * Adds decorator, constructor, and property metadata to a given type via static metadata fields\n * on the type.\n *\n * These metadata fields can later be read with Angular's `ReflectionCapabilities` API.\n *\n * Calls to `setClassMetadata` can be marked as pure, resulting in the metadata assignments being\n * tree-shaken away during production builds.\n */\nexport function setClassMetadata(\n type: Type<any>, decorators: any[] | null, ctorParameters: (() => any[]) | null,\n propDecorators: {[field: string]: any} | null): void {\n const clazz = type as TypeWithMetadata;\n if (decorators !== null) {\n if (clazz.decorators !== undefined) {\n clazz.decorators.push(...decorators);\n } else {\n clazz.decorators = decorators;\n }\n }\n if (ctorParameters !== null) {\n // Rather than merging, clobber the existing parameters. If other projects exist which use\n // tsickle-style annotations and reflect over them in the same way, this could cause issues,\n // but that is vanishingly unlikely.\n clazz.ctorParameters = ctorParameters;\n }\n if (propDecorators !== null) {\n // The property decorator objects are merged as it is possible different fields have different\n // decorator types. Decorators on individual fields are not merged, as it's also incredibly\n // unlikely that a field will be decorated both with an Angular decorator and a non-Angular\n // decorator that's also been downleveled.\n if (clazz.propDecorators !== undefined) {\n clazz.propDecorators = {...clazz.propDecorators, ...propDecorators};\n } else {\n clazz.propDecorators = propDecorators;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {bindingUpdated, bindingUpdated2, bindingUpdated3, bindingUpdated4, getBinding, updateBinding} from './bindings';\nimport {getBindingRoot, getLView, isCreationMode} from './state';\n\n\n\n/**\n * Bindings for pure functions are stored after regular bindings.\n *\n * |------consts------|---------vars---------| |----- hostVars (dir1) ------|\n * ------------------------------------------------------------------------------------------\n * | nodes/refs/pipes | bindings | fn slots | injector | dir1 | host bindings | host slots |\n * ------------------------------------------------------------------------------------------\n * ^ ^\n * TView.bindingStartIndex TView.expandoStartIndex\n *\n * Pure function instructions are given an offset from the binding root. Adding the offset to the\n * binding root gives the first index where the bindings are stored. In component views, the binding\n * root is the bindingStartIndex. In host bindings, the binding root is the expandoStartIndex +\n * any directive instances + any hostVars in directives evaluated before it.\n *\n * See VIEW_DATA.md for more information about host binding resolution.\n */\n\n/**\n * If the value hasn't been saved, calls the pure function to store and return the\n * value. If it has been saved, returns the saved value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns a value\n * @param thisArg Optional calling context of pureFn\n * @returns value\n */\nexport function pureFunction0<T>(slotOffset: number, pureFn: () => T, thisArg?: any): T {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return isCreationMode() ?\n updateBinding(lView, bindingIndex, thisArg ? pureFn.call(thisArg) : pureFn()) :\n getBinding(lView, bindingIndex);\n}\n\n/**\n * If the value of the provided exp has changed, calls the pure function to return\n * an updated value. Or if the value has not changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn Function that returns an updated value\n * @param exp Updated expression value\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction1(\n slotOffset: number, pureFn: (v: any) => any, exp: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const lView = getLView();\n const bindingIndex = getBindingRoot() + slotOffset;\n return bindingUpdated(lView, bindingIndex, exp) ?\n updateBinding(lView, bindingIndex + 1, thisArg ? pureFn.call(thisArg, exp) : pureFn(exp)) :\n getBinding(lView, bindingIndex + 1);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction2(\n slotOffset: number, pureFn: (v1: any, v2: any) => any, exp1: any, exp2: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated2(lView, bindingIndex, exp1, exp2) ?\n updateBinding(\n lView, bindingIndex + 2,\n thisArg ? pureFn.call(thisArg, exp1, exp2) : pureFn(exp1, exp2)) :\n getBinding(lView, bindingIndex + 2);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction3(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any) => any, exp1: any, exp2: any, exp3: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(\n lView, bindingIndex + 3,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getBinding(lView, bindingIndex + 3);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction4(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any) => any, exp1: any, exp2: any,\n exp3: any, exp4: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n return bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) ?\n updateBinding(\n lView, bindingIndex + 4,\n thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4) : pureFn(exp1, exp2, exp3, exp4)) :\n getBinding(lView, bindingIndex + 4);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction5(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated(lView, bindingIndex + 4, exp5) || different ?\n updateBinding(\n lView, bindingIndex + 5, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5) :\n pureFn(exp1, exp2, exp3, exp4, exp5)) :\n getBinding(lView, bindingIndex + 5);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction6(\n slotOffset: number, pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated2(lView, bindingIndex + 4, exp5, exp6) || different ?\n updateBinding(\n lView, bindingIndex + 6, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6)) :\n getBinding(lView, bindingIndex + 6);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction7(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any) => any, exp1: any,\n exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n let different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated3(lView, bindingIndex + 4, exp5, exp6, exp7) || different ?\n updateBinding(\n lView, bindingIndex + 7, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7)) :\n getBinding(lView, bindingIndex + 7);\n}\n\n/**\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn\n * @param exp1\n * @param exp2\n * @param exp3\n * @param exp4\n * @param exp5\n * @param exp6\n * @param exp7\n * @param exp8\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunction8(\n slotOffset: number,\n pureFn: (v1: any, v2: any, v3: any, v4: any, v5: any, v6: any, v7: any, v8: any) => any,\n exp1: any, exp2: any, exp3: any, exp4: any, exp5: any, exp6: any, exp7: any, exp8: any,\n thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n const bindingIndex = getBindingRoot() + slotOffset;\n const lView = getLView();\n const different = bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4);\n return bindingUpdated4(lView, bindingIndex + 4, exp5, exp6, exp7, exp8) || different ?\n updateBinding(\n lView, bindingIndex + 8, thisArg ?\n pureFn.call(thisArg, exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8) :\n pureFn(exp1, exp2, exp3, exp4, exp5, exp6, exp7, exp8)) :\n getBinding(lView, bindingIndex + 8);\n}\n\n/**\n * pureFunction instruction that can support any number of bindings.\n *\n * If the value of any provided exp has changed, calls the pure function to return\n * an updated value. Or if no values have changed, returns cached value.\n *\n * @param slotOffset the offset from binding root to the reserved slot\n * @param pureFn A pure function that takes binding values and builds an object or array\n * containing those values.\n * @param exps An array of binding values\n * @param thisArg Optional calling context of pureFn\n * @returns Updated or cached value\n */\nexport function pureFunctionV(\n slotOffset: number, pureFn: (...v: any[]) => any, exps: any[], thisArg?: any): any {\n // TODO(kara): use bindingRoot instead of bindingStartIndex when implementing host bindings\n let bindingIndex = getBindingRoot() + slotOffset;\n let different = false;\n const lView = getLView();\n for (let i = 0; i < exps.length; i++) {\n bindingUpdated(lView, bindingIndex++, exps[i]) && (different = true);\n }\n return different ? updateBinding(lView, bindingIndex, pureFn.apply(thisArg, exps)) :\n getBinding(lView, bindingIndex);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WrappedValue} from '../change_detection/change_detection_util';\nimport {PipeTransform} from '../change_detection/pipe_transform';\n\nimport {load, store} from './instructions';\nimport {PipeDef, PipeDefList} from './interfaces/definition';\nimport {HEADER_OFFSET, TVIEW} from './interfaces/view';\nimport {pureFunction1, pureFunction2, pureFunction3, pureFunction4, pureFunctionV} from './pure_function';\nimport {getBindingRoot, getLView} from './state';\nimport {NO_CHANGE} from './tokens';\n\n\n/**\n * Create a pipe.\n *\n * @param index Pipe index where the pipe will be stored.\n * @param pipeName The name of the pipe\n * @returns T the instance of the pipe.\n */\nexport function pipe(index: number, pipeName: string): any {\n const tView = getLView()[TVIEW];\n let pipeDef: PipeDef<any>;\n const adjustedIndex = index + HEADER_OFFSET;\n\n if (tView.firstTemplatePass) {\n pipeDef = getPipeDef(pipeName, tView.pipeRegistry);\n tView.data[adjustedIndex] = pipeDef;\n if (pipeDef.onDestroy) {\n (tView.pipeDestroyHooks || (tView.pipeDestroyHooks = [\n ])).push(adjustedIndex, pipeDef.onDestroy);\n }\n } else {\n pipeDef = tView.data[adjustedIndex] as PipeDef<any>;\n }\n\n const pipeInstance = pipeDef.factory(null);\n store(index, pipeInstance);\n return pipeInstance;\n}\n\n/**\n * Searches the pipe registry for a pipe with the given name. If one is found,\n * returns the pipe. Otherwise, an error is thrown because the pipe cannot be resolved.\n *\n * @param name Name of pipe to resolve\n * @param registry Full list of available pipes\n * @returns Matching PipeDef\n */\nfunction getPipeDef(name: string, registry: PipeDefList | null): PipeDef<any> {\n if (registry) {\n for (let i = registry.length - 1; i >= 0; i--) {\n const pipeDef = registry[i];\n if (name === pipeDef.name) {\n return pipeDef;\n }\n }\n }\n throw new Error(`The pipe '${name}' could not be found!`);\n}\n\n/**\n * Invokes a pipe with 1 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind1(index: number, slotOffset: number, v1: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction1(slotOffset, pipeInstance.transform, v1, pipeInstance) :\n pipeInstance.transform(v1));\n}\n\n/**\n * Invokes a pipe with 2 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind2(index: number, slotOffset: number, v1: any, v2: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction2(slotOffset, pipeInstance.transform, v1, v2, pipeInstance) :\n pipeInstance.transform(v1, v2));\n}\n\n/**\n * Invokes a pipe with 3 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 4rd argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind3(index: number, slotOffset: number, v1: any, v2: any, v3: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunction3(slotOffset, pipeInstance.transform, v1, v2, v3, pipeInstance) :\n pipeInstance.transform(v1, v2, v3));\n}\n\n/**\n * Invokes a pipe with 4 arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param v1 1st argument to {@link PipeTransform#transform}.\n * @param v2 2nd argument to {@link PipeTransform#transform}.\n * @param v3 3rd argument to {@link PipeTransform#transform}.\n * @param v4 4th argument to {@link PipeTransform#transform}.\n */\nexport function pipeBind4(\n index: number, slotOffset: number, v1: any, v2: any, v3: any, v4: any): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ?\n pureFunction4(slotOffset, pipeInstance.transform, v1, v2, v3, v4, pipeInstance) :\n pipeInstance.transform(v1, v2, v3, v4));\n}\n\n/**\n * Invokes a pipe with variable number of arguments.\n *\n * This instruction acts as a guard to {@link PipeTransform#transform} invoking\n * the pipe only when an input to the pipe changes.\n *\n * @param index Pipe index where the pipe was stored on creation.\n * @param slotOffset the offset in the reserved slot space\n * @param values Array of arguments to pass to {@link PipeTransform#transform} method.\n */\nexport function pipeBindV(index: number, slotOffset: number, values: any[]): any {\n const pipeInstance = load<PipeTransform>(index);\n return unwrapValue(\n isPure(index) ? pureFunctionV(slotOffset, pipeInstance.transform, values, pipeInstance) :\n pipeInstance.transform.apply(pipeInstance, values));\n}\n\nfunction isPure(index: number): boolean {\n return (<PipeDef<any>>getLView()[TVIEW].data[index + HEADER_OFFSET]).pure;\n}\n\n/**\n * Unwrap the output of a pipe transformation.\n * In order to trick change detection into considering that the new value is always different from\n * the old one, the old value is overwritten by NO_CHANGE.\n *\n * @param newValue the pipe transformation output.\n */\nfunction unwrapValue(newValue: any): any {\n if (WrappedValue.isWrapped(newValue)) {\n newValue = WrappedValue.unwrap(newValue);\n getLView()[getBindingRoot()] = NO_CHANGE;\n }\n return newValue;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/// <reference types=\"rxjs\" />\n\nimport {Subject, Subscription} from 'rxjs';\n\n/**\n * Use in directives and components to emit custom events synchronously\n * or asynchronously, and register handlers for those events by subscribing\n * to an instance.\n *\n * @usageNotes\n *\n * In the following example, a component defines two output properties\n * that create event emitters. When the title is clicked, the emitter\n * emits an open or close event to toggle the current visibility state.\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * Access the event object with the `$event` argument passed to the output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * ### Notes\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n *\n * @publicApi\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n /**\n * Internal\n */\n __isAsync: boolean; // tslint:disable-line\n\n /**\n * Creates an instance of this class that can\n * deliver events synchronously or asynchronously.\n *\n * @param isAsync When true, deliver events asynchronously.\n *\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n /**\n * Emits an event containing a given value.\n * @param value The value to emit.\n */\n emit(value?: T) { super.next(value); }\n\n /**\n * Registers handlers for events emitted by this instance.\n * @param generatorOrNext When supplied, a custom handler for emitted events.\n * @param error When supplied, a custom handler for an error notification\n * from this emitter.\n * @param complete When supplied, a custom handler for a completion\n * notification from this emitter.\n */\n subscribe(generatorOrNext?: any, error?: any, complete?: any): Subscription {\n let schedulerFn: (t: any) => any;\n let errorFn = (err: any): any => null;\n let completeFn = (): any => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any) => { setTimeout(() => generatorOrNext(value)); } :\n (value: any) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n const sink = super.subscribe(schedulerFn, errorFn, completeFn);\n\n if (generatorOrNext instanceof Subscription) {\n generatorOrNext.add(sink);\n }\n\n return sink;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectTemplateRef as render3InjectTemplateRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\nimport {ElementRef} from './element_ref';\nimport {EmbeddedViewRef} from './view_ref';\n\n\n/**\n * Represents an embedded template that can be used to instantiate embedded views.\n * To instantiate embedded views based on a template, use the `ViewContainerRef`\n * method `createEmbeddedView()`.\n *\n * Access a `TemplateRef` instance by placing a directive on an `<ng-template>`\n * element (or directive prefixed with `*`). The `TemplateRef` for the embedded view\n * is injected into the constructor of the directive,\n * using the `TemplateRef` token.\n *\n * You can also use a `Query` to find a `TemplateRef` associated with\n * a component or a directive.\n *\n * @see `ViewContainerRef`\n * @see [Navigate the Component Tree with DI](guide/dependency-injection-navtree)\n *\n * @publicApi\n */\nexport abstract class TemplateRef<C> {\n /**\n * The anchor element in the parent view for this embedded view.\n *\n * The data-binding and injection contexts of embedded views created from this `TemplateRef`\n * inherit from the contexts of this location.\n *\n * Typically new embedded views are attached to the view container of this location, but in\n * advanced use-cases, the view can be attached to a different container while keeping the\n * data-binding and injection context from the original location.\n *\n */\n // TODO(i): rename to anchor or location\n abstract get elementRef(): ElementRef;\n\n /**\n * Instantiates an embedded view based on this template,\n * and attaches it to the view container.\n * @param context The data-binding context of the embedded view, as declared\n * in the `<ng-template>` usage.\n * @returns The new embedded view object.\n */\n abstract createEmbeddedView(context: C): EmbeddedViewRef<C>;\n\n /** @internal */\n static __NG_ELEMENT_ID__:\n () => TemplateRef<any>| null = () => SWITCH_TEMPLATE_REF_FACTORY(TemplateRef, ElementRef)\n}\n\nexport const SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ = render3InjectTemplateRef;\nconst SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_TEMPLATE_REF_FACTORY: typeof render3InjectTemplateRef =\n SWITCH_TEMPLATE_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../../core';\nimport {Type} from '../../type';\nimport {CssSelectorList} from './projection';\n\n\n/**\n * Definition of what a template rendering function should look like for a component.\n */\nexport type ComponentTemplate<T> = {\n (rf: RenderFlags, ctx: T): void; ngPrivateData?: never;\n};\n\n/**\n * Definition of what a query function should look like.\n */\nexport type ComponentQuery<T> = ComponentTemplate<T>;\n\n/**\n * Flags passed into template functions to determine which blocks (i.e. creation, update)\n * should be executed.\n *\n * Typically, a template runs both the creation block and the update block on initialization and\n * subsequent runs only execute the update block. However, dynamically created views require that\n * the creation block be executed separately from the update block (for backwards compat).\n */\nexport const enum RenderFlags {\n /* Whether to run the creation block (e.g. create elements and directives) */\n Create = 0b01,\n\n /* Whether to run the update block (e.g. refresh bindings) */\n Update = 0b10\n}\n\n/**\n * A subclass of `Type` which has a static `ngComponentDef`:`ComponentDef` field making it\n * consumable for rendering.\n */\nexport interface ComponentType<T> extends Type<T> { ngComponentDef: never; }\n\n/**\n * A subclass of `Type` which has a static `ngDirectiveDef`:`DirectiveDef` field making it\n * consumable for rendering.\n */\nexport interface DirectiveType<T> extends Type<T> { ngDirectiveDef: never; }\n\nexport const enum DirectiveDefFlags {ContentQuery = 0b10}\n\n/**\n * A subclass of `Type` which has a static `ngPipeDef`:`PipeDef` field making it\n * consumable for rendering.\n */\nexport interface PipeType<T> extends Type<T> { ngPipeDef: never; }\n\nexport type DirectiveDefWithMeta<\n T, Selector extends string, ExportAs extends string, InputMap extends{[key: string]: string},\n OutputMap extends{[key: string]: string}, QueryFields extends string[]> = DirectiveDef<T>;\n\n/**\n * Runtime information for classes that are inherited by components or directives\n * that aren't defined as components or directives.\n *\n * This is an internal data structure used by the render to determine what inputs\n * and outputs should be inherited.\n *\n * See: {@link defineBase}\n */\nexport interface BaseDef<T> {\n /**\n * A dictionary mapping the inputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Input('alias') propertyName: any;`).\n */\n readonly inputs: {[P in keyof T]: string};\n\n /**\n * @deprecated This is only here because `NgOnChanges` incorrectly uses declared name instead of\n * public or minified name.\n */\n readonly declaredInputs: {[P in keyof T]: P};\n\n /**\n * A dictionary mapping the outputs' minified property names to their public API names, which\n * are their aliases if any, or their original unminified property names\n * (as in `@Output('alias') propertyName: any;`).\n */\n readonly outputs: {[P in keyof T]: P};\n}\n\n/**\n * Runtime link information for Directives.\n *\n * This is internal data structure used by the render to link\n * directives into templates.\n *\n * NOTE: Always use `defineDirective` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * @param Selector type metadata specifying the selector of the directive or component\n *\n * See: {@link defineDirective}\n */\nexport interface DirectiveDef<T> extends BaseDef<T> {\n /** Token representing the directive. Used by DI. */\n type: Type<T>;\n\n /** Function that resolves providers and publishes them into the DI system. */\n providersResolver: ((def: DirectiveDef<T>) => void)|null;\n\n /** The selectors that will be used to match nodes to this directive. */\n readonly selectors: CssSelectorList;\n\n /**\n * Name under which the directive is exported (for use with local references in template)\n */\n readonly exportAs: string|null;\n\n /**\n * Factory function used to create a new directive instance.\n */\n factory: (t: Type<T>|null) => T;\n\n /**\n * Function to create instances of content queries associated with a given directive.\n */\n contentQueries: ((directiveIndex: number) => void)|null;\n\n /** Refreshes content queries associated with directives in a given view */\n contentQueriesRefresh: ((directiveIndex: number, queryIndex: number) => void)|null;\n\n /** Refreshes host bindings on the associated directive. */\n hostBindings: HostBindingsFunction<T>|null;\n\n /**\n * Static attributes to set on host element.\n *\n * Even indices: attribute name\n * Odd indices: attribute value\n */\n readonly attributes: string[]|null;\n\n /* The following are lifecycle hooks for this component */\n onInit: (() => void)|null;\n doCheck: (() => void)|null;\n afterContentInit: (() => void)|null;\n afterContentChecked: (() => void)|null;\n afterViewInit: (() => void)|null;\n afterViewChecked: (() => void)|null;\n onDestroy: (() => void)|null;\n\n /**\n * The features applied to this directive\n */\n readonly features: DirectiveDefFeature[]|null;\n}\n\nexport type ComponentDefWithMeta<\n T, Selector extends String, ExportAs extends string, InputMap extends{[key: string]: string},\n OutputMap extends{[key: string]: string}, QueryFields extends string[]> = ComponentDef<T>;\n\n/**\n * Runtime link information for Components.\n *\n * This is internal data structure used by the render to link\n * components into templates.\n *\n * NOTE: Always use `defineComponent` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link defineComponent}\n */\nexport interface ComponentDef<T> extends DirectiveDef<T> {\n /**\n * Runtime unique component ID.\n */\n readonly id: string;\n\n /**\n * The View template of the component.\n */\n readonly template: ComponentTemplate<T>;\n\n /**\n * A set of styles that the component needs to be present for component to render correctly.\n */\n readonly styles: string[];\n\n /**\n * The number of nodes, local refs, and pipes in this component template.\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the binding start index.\n */\n // TODO(kara): remove queries from this count\n readonly consts: number;\n\n /**\n * The number of bindings in this component template (including pure fn bindings).\n *\n * Used to calculate the length of the component's LView array, so we\n * can pre-fill the array and set the host binding start index.\n */\n readonly vars: number;\n\n /**\n * Query-related instructions for a component.\n */\n viewQuery: ComponentQuery<T>|null;\n\n /**\n * The view encapsulation type, which determines how styles are applied to\n * DOM elements. One of\n * - `Emulated` (default): Emulate native scoping of styles.\n * - `Native`: Use the native encapsulation mechanism of the renderer.\n * - `ShadowDom`: Use modern [ShadowDOM](https://w3c.github.io/webcomponents/spec/shadow/) and\n * create a ShadowRoot for component's host element.\n * - `None`: Do not provide any template or style encapsulation.\n */\n readonly encapsulation: ViewEncapsulation;\n\n /**\n * Defines arbitrary developer-defined data to be stored on a renderer instance.\n * This is useful for renderers that delegate to other renderers.\n */\n readonly data: {[kind: string]: any};\n\n /** Whether or not this component's ChangeDetectionStrategy is OnPush */\n readonly onPush: boolean;\n\n /**\n\n * Registry of directives and components that may be found in this view.\n *\n * The property is either an array of `DirectiveDef`s or a function which returns the array of\n * `DirectiveDef`s. The function is necessary to be able to support forward declarations.\n */\n directiveDefs: DirectiveDefListOrFactory|null;\n\n /**\n * Registry of pipes that may be found in this view.\n *\n * The property is either an array of `PipeDefs`s or a function which returns the array of\n * `PipeDefs`s. The function is necessary to be able to support forward declarations.\n */\n pipeDefs: PipeDefListOrFactory|null;\n\n /**\n * Used to store the result of `noSideEffects` function so that it is not removed by closure\n * compiler. The property should never be read.\n */\n readonly _?: never;\n}\n\n/**\n * Runtime link information for Pipes.\n *\n * This is internal data structure used by the renderer to link\n * pipes into templates.\n *\n * NOTE: Always use `definePipe` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n *\n * See: {@link definePipe}\n */\nexport interface PipeDef<T> {\n /**\n * Pipe name.\n *\n * Used to resolve pipe in templates.\n */\n readonly name: string;\n\n /**\n * Factory function used to create a new pipe instance.\n */\n factory: (t: Type<T>|null) => T;\n\n /**\n * Whether or not the pipe is pure.\n *\n * Pure pipes result only depends on the pipe input and not on internal\n * state of the pipe.\n */\n readonly pure: boolean;\n\n /* The following are lifecycle hooks for this pipe */\n onDestroy: (() => void)|null;\n}\n\nexport type PipeDefWithMeta<T, Name extends string> = PipeDef<T>;\n\nexport interface DirectiveDefFeature {\n <T>(directiveDef: DirectiveDef<T>): void;\n ngInherit?: true;\n}\n\nexport interface ComponentDefFeature {\n <T>(componentDef: ComponentDef<T>): void;\n ngInherit?: true;\n}\n\n\n/**\n * Type used for directiveDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;\n\nexport type DirectiveDefList = (DirectiveDef<any>| ComponentDef<any>)[];\n\nexport type DirectiveTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type DirectiveTypeList =\n (DirectiveDef<any>| ComponentDef<any>|\n Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\nexport type HostBindingsFunction<T> = (rf: RenderFlags, ctx: T, elementIndex: number) => void;\n\n/**\n * Type used for PipeDefs on component definition.\n *\n * The function is necessary to be able to support forward declarations.\n */\nexport type PipeDefListOrFactory = (() => PipeDefList) | PipeDefList;\n\nexport type PipeDefList = PipeDef<any>[];\n\nexport type PipeTypesOrFactory = (() => DirectiveTypeList) | DirectiveTypeList;\n\nexport type PipeTypeList =\n (PipeDef<any>| Type<any>/* Type as workaround for: Microsoft/TypeScript/issues/4881 */)[];\n\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {QueryList} from '../../linker';\nimport {Type} from '../../type';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode} from './node';\n\n/** Used for tracking queries (e.g. ViewChild, ContentChild). */\nexport interface LQueries {\n /**\n * The parent LQueries instance.\n *\n * When there is a content query, a new LQueries instance is created to avoid mutating any\n * existing LQueries. After we are done searching content children, the parent property allows\n * us to traverse back up to the original LQueries instance to continue to search for matches\n * in the main view.\n */\n parent: LQueries|null;\n\n /**\n * Ask queries to prepare copy of itself. This assures that tracking new queries on content nodes\n * doesn't mutate list of queries tracked on a parent node. We will clone LQueries before\n * constructing content queries.\n */\n clone(): LQueries;\n\n /**\n * Notify `LQueries` that a new `TNode` has been created and needs to be added to query results\n * if matching query predicate.\n */\n addNode(tNode: TElementNode|TContainerNode|TElementContainerNode): LQueries|null;\n\n /**\n * Notify `LQueries` that a new LContainer was added to ivy data structures. As a result we need\n * to prepare room for views that might be inserted into this container.\n */\n container(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been created. As a result we need to prepare room\n * and collect nodes that match query predicate.\n */\n createView(): LQueries|null;\n\n /**\n * Notify `LQueries` that a new `LView` has been added to `LContainer`. As a result all\n * the matching nodes from this view should be added to container's queries.\n */\n insertView(newViewIndex: number): void;\n\n /**\n * Notify `LQueries` that an `LView` has been removed from `LContainer`. As a result all\n * the matching nodes from this view should be removed from container's queries.\n */\n removeView(): void;\n\n /**\n * Add additional `QueryList` to track.\n *\n * @param queryList `QueryList` to update with changes.\n * @param predicate Either `Type` or selector array of [key, value] predicates.\n * @param descend If true the query will recursively apply to the children.\n * @param read Indicates which token should be read from DI for this query.\n */\n track<T>(\n queryList: QueryList<T>, predicate: Type<any>|string[], descend?: boolean,\n read?: Type<T>): void;\n}\n\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nexport const unusedValueExportToPlacateAjd = 1;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// We are temporarily importing the existing viewEngine_from core so we can be sure we are\n// correctly implementing its interfaces for backwards compatibility.\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {QueryList as viewEngine_QueryList} from '../linker/query_list';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\nimport {Type} from '../type';\nimport {getSymbolIterator} from '../util';\n\nimport {assertDefined, assertEqual, assertPreviousIsParent} from './assert';\nimport {getNodeInjectable, locateDirectiveOrProvider} from './di';\nimport {NG_ELEMENT_ID} from './fields';\nimport {store, storeCleanupWithContext} from './instructions';\nimport {unusedValueExportToPlacateAjd as unused1} from './interfaces/definition';\nimport {unusedValueExportToPlacateAjd as unused2} from './interfaces/injector';\nimport {TContainerNode, TElementContainerNode, TElementNode, TNode, TNodeType, unusedValueExportToPlacateAjd as unused3} from './interfaces/node';\nimport {LQueries, unusedValueExportToPlacateAjd as unused4} from './interfaces/query';\nimport {LView, TVIEW} from './interfaces/view';\nimport {getIsParent, getLView, getOrCreateCurrentQueries} from './state';\nimport {flatten, isContentQueryHost} from './util';\nimport {createElementRef, createTemplateRef} from './view_engine_compatibility';\n\nconst unusedValueToPlacateAjd = unused1 + unused2 + unused3 + unused4;\n\n/**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\nexport interface QueryPredicate<T> {\n /**\n * If looking for directives then it contains the directive type.\n */\n type: Type<T>|null;\n\n /**\n * If selector then contains local names to query for.\n */\n selector: string[]|null;\n\n /**\n * Indicates which token should be read from DI for this query.\n */\n read: Type<T>|null;\n}\n\n/**\n * An object representing a query, which is a combination of:\n * - query predicate to determines if a given element/directive should be included in the query\n * - values collected based on a predicate\n * - `QueryList` to which collected values should be reported\n */\nexport interface LQuery<T> {\n /**\n * Next query. Used when queries are stored as a linked list in `LQueries`.\n */\n next: LQuery<any>|null;\n\n /**\n * Destination to which the value should be added.\n */\n list: QueryList<T>;\n\n /**\n * A predicate which determines if a given element/directive should be included in the query\n * results.\n */\n predicate: QueryPredicate<T>;\n\n /**\n * Values which have been located.\n *\n * This is what builds up the `QueryList._valuesTree`.\n */\n values: any[];\n\n /**\n * A pointer to an array that stores collected values from views. This is necessary so we know a\n * container into which to insert nodes collected from views.\n */\n containerValues: any[]|null;\n}\n\nexport class LQueries_ implements LQueries {\n constructor(\n public parent: LQueries_|null, private shallow: LQuery<any>|null,\n private deep: LQuery<any>|null) {}\n\n track<T>(\n queryList: viewEngine_QueryList<T>, predicate: Type<T>|string[], descend?: boolean,\n read?: Type<T>): void {\n if (descend) {\n this.deep = createQuery(this.deep, queryList, predicate, read != null ? read : null);\n } else {\n this.shallow = createQuery(this.shallow, queryList, predicate, read != null ? read : null);\n }\n }\n\n clone(): LQueries { return new LQueries_(this, null, this.deep); }\n\n container(): LQueries|null {\n const shallowResults = copyQueriesToContainer(this.shallow);\n const deepResults = copyQueriesToContainer(this.deep);\n\n return shallowResults || deepResults ? new LQueries_(this, shallowResults, deepResults) : null;\n }\n\n createView(): LQueries|null {\n const shallowResults = copyQueriesToView(this.shallow);\n const deepResults = copyQueriesToView(this.deep);\n\n return shallowResults || deepResults ? new LQueries_(this, shallowResults, deepResults) : null;\n }\n\n insertView(index: number): void {\n insertView(index, this.shallow);\n insertView(index, this.deep);\n }\n\n addNode(tNode: TElementNode|TContainerNode|TElementContainerNode): LQueries|null {\n add(this.deep, tNode);\n\n if (isContentQueryHost(tNode)) {\n add(this.shallow, tNode);\n\n if (tNode.parent && isContentQueryHost(tNode.parent)) {\n // if node has a content query and parent also has a content query\n // both queries need to check this node for shallow matches\n add(this.parent !.shallow, tNode);\n }\n return this.parent;\n }\n\n isRootNodeOfQuery(tNode) && add(this.shallow, tNode);\n return this;\n }\n\n removeView(): void {\n removeView(this.shallow);\n removeView(this.deep);\n }\n}\n\nfunction isRootNodeOfQuery(tNode: TNode) {\n return tNode.parent === null || isContentQueryHost(tNode.parent);\n}\n\nfunction copyQueriesToContainer(query: LQuery<any>| null): LQuery<any>|null {\n let result: LQuery<any>|null = null;\n\n while (query) {\n const containerValues: any[] = []; // prepare room for views\n query.values.push(containerValues);\n const clonedQuery: LQuery<any> = {\n next: result,\n list: query.list,\n predicate: query.predicate,\n values: containerValues,\n containerValues: null\n };\n result = clonedQuery;\n query = query.next;\n }\n\n return result;\n}\n\nfunction copyQueriesToView(query: LQuery<any>| null): LQuery<any>|null {\n let result: LQuery<any>|null = null;\n\n while (query) {\n const clonedQuery: LQuery<any> = {\n next: result,\n list: query.list,\n predicate: query.predicate,\n values: [],\n containerValues: query.values\n };\n result = clonedQuery;\n query = query.next;\n }\n\n return result;\n}\n\nfunction insertView(index: number, query: LQuery<any>| null) {\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n query.containerValues !.splice(index, 0, query.values);\n query = query.next;\n }\n}\n\nfunction removeView(query: LQuery<any>| null) {\n while (query) {\n ngDevMode &&\n assertDefined(\n query.containerValues, 'View queries need to have a pointer to container values.');\n\n const containerValues = query.containerValues !;\n const viewValuesIdx = containerValues.indexOf(query.values);\n const removed = containerValues.splice(viewValuesIdx, 1);\n\n // mark a query as dirty only when removed view had matching modes\n ngDevMode && assertEqual(removed.length, 1, 'removed.length');\n if (removed[0].length) {\n query.list.setDirty();\n }\n\n query = query.next;\n }\n}\n\n\n/**\n * Iterates over local names for a given node and returns directive index\n * (or -1 if a local name points to an element).\n *\n * @param tNode static data of a node to check\n * @param selector selector to match\n * @returns directive index, -1 or null if a selector didn't match any of the local names\n */\nfunction getIdxOfMatchingSelector(tNode: TNode, selector: string): number|null {\n const localNames = tNode.localNames;\n if (localNames) {\n for (let i = 0; i < localNames.length; i += 2) {\n if (localNames[i] === selector) {\n return localNames[i + 1] as number;\n }\n }\n }\n return null;\n}\n\n\n// TODO: \"read\" should be an AbstractType (FW-486)\nfunction queryByReadToken(read: any, tNode: TNode, currentView: LView): any {\n const factoryFn = (read as any)[NG_ELEMENT_ID];\n if (typeof factoryFn === 'function') {\n return factoryFn();\n } else {\n const matchingIdx =\n locateDirectiveOrProvider(tNode, currentView, read as Type<any>, false, false);\n if (matchingIdx !== null) {\n return getNodeInjectable(\n currentView[TVIEW].data, currentView, matchingIdx, tNode as TElementNode);\n }\n }\n return null;\n}\n\nfunction queryByTNodeType(tNode: TNode, currentView: LView): any {\n if (tNode.type === TNodeType.Element || tNode.type === TNodeType.ElementContainer) {\n return createElementRef(ViewEngine_ElementRef, tNode, currentView);\n }\n if (tNode.type === TNodeType.Container) {\n return createTemplateRef(ViewEngine_TemplateRef, ViewEngine_ElementRef, tNode, currentView);\n }\n return null;\n}\n\nfunction queryByTemplateRef(\n templateRefToken: ViewEngine_TemplateRef<any>, tNode: TNode, currentView: LView,\n read: any): any {\n const templateRefResult = (templateRefToken as any)[NG_ELEMENT_ID]();\n if (read) {\n return templateRefResult ? queryByReadToken(read, tNode, currentView) : null;\n }\n return templateRefResult;\n}\n\nfunction queryRead(tNode: TNode, currentView: LView, read: any, matchingIdx: number): any {\n if (read) {\n return queryByReadToken(read, tNode, currentView);\n }\n if (matchingIdx > -1) {\n return getNodeInjectable(\n currentView[TVIEW].data, currentView, matchingIdx, tNode as TElementNode);\n }\n // if read token and / or strategy is not specified,\n // detect it using appropriate tNode type\n return queryByTNodeType(tNode, currentView);\n}\n\nfunction add(\n query: LQuery<any>| null, tNode: TElementNode | TContainerNode | TElementContainerNode) {\n const currentView = getLView();\n\n while (query) {\n const predicate = query.predicate;\n const type = predicate.type as any;\n if (type) {\n let result = null;\n if (type === ViewEngine_TemplateRef) {\n result = queryByTemplateRef(type, tNode, currentView, predicate.read);\n } else {\n const matchingIdx = locateDirectiveOrProvider(tNode, currentView, type, false, false);\n if (matchingIdx !== null) {\n result = queryRead(tNode, currentView, predicate.read, matchingIdx);\n }\n }\n if (result !== null) {\n addMatch(query, result);\n }\n } else {\n const selector = predicate.selector !;\n for (let i = 0; i < selector.length; i++) {\n const matchingIdx = getIdxOfMatchingSelector(tNode, selector[i]);\n if (matchingIdx !== null) {\n const result = queryRead(tNode, currentView, predicate.read, matchingIdx);\n if (result !== null) {\n addMatch(query, result);\n }\n }\n }\n }\n query = query.next;\n }\n}\n\nfunction addMatch(query: LQuery<any>, matchingValue: any): void {\n query.values.push(matchingValue);\n query.list.setDirty();\n}\n\nfunction createPredicate<T>(predicate: Type<T>| string[], read: Type<T>| null): QueryPredicate<T> {\n const isArray = Array.isArray(predicate);\n return {\n type: isArray ? null : predicate as Type<T>,\n selector: isArray ? predicate as string[] : null,\n read: read\n };\n}\n\nfunction createQuery<T>(\n previous: LQuery<any>| null, queryList: QueryList<T>, predicate: Type<T>| string[],\n read: Type<T>| null): LQuery<T> {\n return {\n next: previous,\n list: queryList,\n predicate: createPredicate(predicate, read),\n values: (queryList as any as QueryList_<T>)._valuesTree,\n containerValues: null\n };\n}\n\nclass QueryList_<T>/* implements viewEngine_QueryList<T> */ {\n readonly dirty = true;\n readonly changes: Observable<T> = new EventEmitter();\n private _values: T[] = [];\n /** @internal */\n _valuesTree: any[] = [];\n\n get length(): number { return this._values.length; }\n\n get first(): T|null {\n let values = this._values;\n return values.length ? values[0] : null;\n }\n\n get last(): T|null {\n let values = this._values;\n return values.length ? values[values.length - 1] : null;\n }\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._values.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._values.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._values.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._values.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._values.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._values.some(fn);\n }\n\n toArray(): T[] { return this._values.slice(0); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._values as any)[getSymbolIterator()](); }\n\n toString(): string { return this._values.toString(); }\n\n reset(res: (any[]|T)[]): void {\n this._values = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n setDirty(): void { (this as{dirty: boolean}).dirty = true; }\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\n// NOTE: this hack is here because IQueryList has private members and therefore\n// it can't be implemented only extended.\nexport type QueryList<T> = viewEngine_QueryList<T>;\nexport const QueryList: typeof viewEngine_QueryList = QueryList_ as any;\n\n/**\n * Creates and returns a QueryList.\n *\n * @param memoryIndex The index in memory where the QueryList should be saved. If null,\n * this is is a content query and the QueryList will be saved later through directiveCreate.\n * @param predicate The type for which the query will search\n * @param descend Whether or not to descend into children\n * @param read What to save in the query\n * @returns QueryList<T>\n */\nexport function query<T>(\n memoryIndex: number | null, predicate: Type<any>| string[], descend?: boolean,\n // TODO: \"read\" should be an AbstractType (FW-486)\n read?: any): QueryList<T> {\n ngDevMode && assertPreviousIsParent(getIsParent());\n const queryList = new QueryList<T>();\n const queries = getOrCreateCurrentQueries(LQueries_);\n queries.track(queryList, predicate, descend, read);\n storeCleanupWithContext(getLView(), queryList, queryList.destroy);\n if (memoryIndex != null) {\n store(memoryIndex, queryList);\n }\n return queryList;\n}\n\n/**\n * Refreshes a query by combining matches from all active views and removing matches from deleted\n * views.\n * Returns true if a query got dirty during change detection, false otherwise.\n */\nexport function queryRefresh(queryList: QueryList<any>): boolean {\n const queryListImpl = (queryList as any as QueryList_<any>);\n if (queryList.dirty) {\n queryList.reset(queryListImpl._valuesTree);\n queryList.notifyOnChanges();\n return true;\n }\n return false;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {ElementRef as ViewEngine_ElementRef} from '../linker/element_ref';\nimport {TemplateRef as ViewEngine_TemplateRef} from '../linker/template_ref';\n\nimport {TNode} from './interfaces/node';\nimport {LView} from './interfaces/view';\nimport {createTemplateRef} from './view_engine_compatibility';\n\n\n\n/**\n * Retrieves `TemplateRef` instance from `Injector` when a local reference is placed on the\n * `<ng-template>` element.\n */\nexport function templateRefExtractor(tNode: TNode, currentView: LView) {\n return createTemplateRef(ViewEngine_TemplateRef, ViewEngine_ElementRef, tNode, currentView);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport {LifecycleHooksFeature, renderComponent, whenRendered} from './component';\nimport {defineBase, defineComponent, defineDirective, defineNgModule, definePipe} from './definition';\nimport {getComponent, getHostElement, getRenderedText} from './discovery_utils';\nimport {InheritDefinitionFeature} from './features/inherit_definition_feature';\nimport {NgOnChangesFeature} from './features/ng_onchanges_feature';\nimport {ProvidersFeature} from './features/providers_feature';\nimport {BaseDef, ComponentDef, ComponentDefWithMeta, ComponentTemplate, ComponentType, DirectiveDef, DirectiveDefFlags, DirectiveDefWithMeta, DirectiveType, PipeDef, PipeDefWithMeta} from './interfaces/definition';\n\nexport {ComponentFactory, ComponentFactoryResolver, ComponentRef, injectComponentFactoryResolver} from './component_ref';\nexport {getFactoryOf, getInheritedFactory} from './di';\nexport {RenderFlags} from './interfaces/definition';\nexport {CssSelectorList} from './interfaces/projection';\n\n\n// clang-format off\nexport {\n allocHostVars,\n bind,\n interpolation1,\n interpolation2,\n interpolation3,\n interpolation4,\n interpolation5,\n interpolation6,\n interpolation7,\n interpolation8,\n interpolationV,\n\n container,\n containerRefreshStart,\n containerRefreshEnd,\n\n nextContext,\n\n element,\n elementAttribute,\n elementClassProp,\n elementEnd,\n elementProperty,\n componentHostSyntheticProperty,\n elementStart,\n\n elementContainerStart,\n elementContainerEnd,\n elementStyling,\n elementHostAttrs,\n elementStylingMap,\n elementStyleProp,\n elementStylingApply,\n\n listener,\n store,\n load,\n\n namespaceHTML,\n namespaceMathML,\n namespaceSVG,\n\n projection,\n projectionDef,\n\n text,\n textBinding,\n template,\n\n reference,\n\n embeddedViewStart,\n embeddedViewEnd,\n detectChanges,\n markDirty,\n tick,\n\n directiveInject,\n injectAttribute,\n\n getCurrentView\n} from './instructions';\n\nexport {\n restoreView,\n\n enableBindings,\n disableBindings,\n} from './state';\n\nexport {\n i18n,\n i18nAttributes,\n i18nExp,\n i18nStart,\n i18nEnd,\n i18nApply,\n i18nPostprocess\n} from './i18n';\n\nexport {NgModuleFactory, NgModuleRef, NgModuleType} from './ng_module_ref';\n\nexport {\n AttributeMarker\n} from './interfaces/node';\n\nexport {\n setClassMetadata,\n} from './metadata';\n\nexport {\n pipe,\n pipeBind1,\n pipeBind2,\n pipeBind3,\n pipeBind4,\n pipeBindV,\n} from './pipe';\n\nexport {\n QueryList,\n query,\n queryRefresh,\n} from './query';\nexport {\n registerContentQuery,\n loadQueryList,\n} from './instructions';\n\nexport {\n pureFunction0,\n pureFunction1,\n pureFunction2,\n pureFunction3,\n pureFunction4,\n pureFunction5,\n pureFunction6,\n pureFunction7,\n pureFunction8,\n pureFunctionV,\n} from './pure_function';\n\nexport {templateRefExtractor} from './view_engine_compatibility_prebound';\n\n\n// clang-format on\n\nexport {\n BaseDef,\n ComponentDef,\n ComponentDefWithMeta,\n ComponentTemplate,\n ComponentType,\n DirectiveDef,\n DirectiveDefFlags,\n DirectiveDefWithMeta,\n DirectiveType,\n NgOnChangesFeature,\n InheritDefinitionFeature,\n ProvidersFeature,\n PipeDef,\n PipeDefWithMeta,\n LifecycleHooksFeature,\n defineComponent,\n defineDirective,\n defineNgModule,\n defineBase,\n definePipe,\n getHostElement,\n getComponent,\n getRenderedText,\n renderComponent,\n whenRendered,\n};\n\nexport {NO_CHANGE} from './tokens';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nconst BRAND = '__SANITIZER_TRUSTED_BRAND__';\n\nexport const enum BypassType {\n Url = 'Url',\n Html = 'Html',\n ResourceUrl = 'ResourceUrl',\n Script = 'Script',\n Style = 'Style',\n}\n\n/**\n * A branded trusted string used with sanitization.\n *\n * See: {@link TrustedHtmlString}, {@link TrustedResourceUrlString}, {@link TrustedScriptString},\n * {@link TrustedStyleString}, {@link TrustedUrlString}\n */\nexport interface TrustedString extends String { [BRAND]: BypassType; }\n\n/**\n * A branded trusted string used with sanitization of `html` strings.\n *\n * See: {@link bypassSanitizationTrustHtml} and {@link htmlSanitizer}.\n */\nexport interface TrustedHtmlString extends TrustedString { [BRAND]: BypassType.Html; }\n\n/**\n * A branded trusted string used with sanitization of `style` strings.\n *\n * See: {@link bypassSanitizationTrustStyle} and {@link styleSanitizer}.\n */\nexport interface TrustedStyleString extends TrustedString { [BRAND]: BypassType.Style; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustScript} and {@link scriptSanitizer}.\n */\nexport interface TrustedScriptString extends TrustedString { [BRAND]: BypassType.Script; }\n\n/**\n * A branded trusted string used with sanitization of `url` strings.\n *\n * See: {@link bypassSanitizationTrustUrl} and {@link urlSanitizer}.\n */\nexport interface TrustedUrlString extends TrustedString { [BRAND]: BypassType.Url; }\n\n/**\n * A branded trusted string used with sanitization of `resourceUrl` strings.\n *\n * See: {@link bypassSanitizationTrustResourceUrl} and {@link resourceUrlSanitizer}.\n */\nexport interface TrustedResourceUrlString extends TrustedString { [BRAND]: BypassType.ResourceUrl; }\n\nexport function allowSanitizationBypass(value: any, type: BypassType): boolean {\n return (value instanceof String && (value as TrustedStyleString)[BRAND] === type);\n}\n\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustHtml(trustedHtml: string): TrustedHtmlString {\n return bypassSanitizationTrustString(trustedHtml, BypassType.Html);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustStyle(trustedStyle: string): TrustedStyleString {\n return bypassSanitizationTrustString(trustedStyle, BypassType.Style);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustScript(trustedScript: string): TrustedScriptString {\n return bypassSanitizationTrustString(trustedScript, BypassType.Script);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustUrl(trustedUrl: string): TrustedUrlString {\n return bypassSanitizationTrustString(trustedUrl, BypassType.Url);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nexport function bypassSanitizationTrustResourceUrl(trustedResourceUrl: string):\n TrustedResourceUrlString {\n return bypassSanitizationTrustString(trustedResourceUrl, BypassType.ResourceUrl);\n}\n\n\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Html): TrustedHtmlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Style): TrustedStyleString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Script): TrustedScriptString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.Url): TrustedUrlString;\nfunction bypassSanitizationTrustString(\n trustedString: string, mode: BypassType.ResourceUrl): TrustedResourceUrlString;\nfunction bypassSanitizationTrustString(trustedString: string, mode: BypassType): TrustedString {\n const trusted = new String(trustedString) as TrustedString;\n trusted[BRAND] = mode;\n return trusted;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isDevMode} from '../is_dev_mode';\nimport {_sanitizeUrl} from './url_sanitizer';\n\n\n/**\n * Regular expression for safe style values.\n *\n * Quotes (\" and ') are allowed, but a check must be done elsewhere to ensure they're balanced.\n *\n * ',' allows multiple values to be assigned to the same property (e.g. background-attachment or\n * font-family) and hence could allow multiple values to get injected, but that should pose no risk\n * of XSS.\n *\n * The function expression checks only for XSS safety, not for CSS validity.\n *\n * This regular expression was taken from the Closure sanitization library, and augmented for\n * transformation values.\n */\nconst VALUES = '[-,.\"\\'%_!# a-zA-Z0-9]+';\nconst TRANSFORMATION_FNS = '(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?';\nconst COLOR_FNS = '(?:rgb|hsl)a?';\nconst GRADIENTS = '(?:repeating-)?(?:linear|radial)-gradient';\nconst CSS3_FNS = '(?:calc|attr)';\nconst FN_ARGS = '\\\\([-0-9.%, #a-zA-Z]+\\\\)';\nconst SAFE_STYLE_VALUE = new RegExp(\n `^(${VALUES}|` +\n `(?:${TRANSFORMATION_FNS}|${COLOR_FNS}|${GRADIENTS}|${CSS3_FNS})` +\n `${FN_ARGS})$`,\n 'g');\n\n/**\n * Matches a `url(...)` value with an arbitrary argument as long as it does\n * not contain parentheses.\n *\n * The URL value still needs to be sanitized separately.\n *\n * `url(...)` values are a very common use case, e.g. for `background-image`. With carefully crafted\n * CSS style rules, it is possible to construct an information leak with `url` values in CSS, e.g.\n * by observing whether scroll bars are displayed, or character ranges used by a font face\n * definition.\n *\n * Angular only allows binding CSS values (as opposed to entire CSS rules), so it is unlikely that\n * binding a URL value without further cooperation from the page will cause an information leak, and\n * if so, it is just a leak, not a full blown XSS vulnerability.\n *\n * Given the common use case, low likelihood of attack vector, and low impact of an attack, this\n * code is permissive and allows URLs that sanitize otherwise.\n */\nconst URL_RE = /^url\\(([^)]+)\\)$/;\n\n/**\n * Checks that quotes (\" and ') are properly balanced inside a string. Assumes\n * that neither escape (\\) nor any other character that could result in\n * breaking out of a string parsing context are allowed;\n * see http://www.w3.org/TR/css3-syntax/#string-token-diagram.\n *\n * This code was taken from the Closure sanitization library.\n */\nfunction hasBalancedQuotes(value: string) {\n let outsideSingle = true;\n let outsideDouble = true;\n for (let i = 0; i < value.length; i++) {\n const c = value.charAt(i);\n if (c === '\\'' && outsideDouble) {\n outsideSingle = !outsideSingle;\n } else if (c === '\"' && outsideSingle) {\n outsideDouble = !outsideDouble;\n }\n }\n return outsideSingle && outsideDouble;\n}\n\n/**\n * Sanitizes the given untrusted CSS style property value (i.e. not an entire object, just a single\n * value) and returns a value that is safe to use in a browser environment.\n */\nexport function _sanitizeStyle(value: string): string {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value) return '';\n\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n const urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n\n if (isDevMode()) {\n console.warn(\n `WARNING: sanitizing unsafe style value ${value} (see http://g.co/ng/security#xss).`);\n }\n\n return 'unsafe';\n}\n\n\n/**\n * Used to intercept and sanitize style values before they are written to the renderer.\n *\n * This function is designed to be called in two modes. When a value is not provided\n * then the function will return a boolean whether a property will be sanitized later.\n * If a value is provided then the sanitized version of that will be returned.\n */\nexport interface StyleSanitizeFn {\n /** This mode is designed to instruct whether the property will be used for sanitization\n * at a later point */\n (prop: string): boolean;\n /** This mode is designed to sanitize the provided value */\n (prop: string, value: string): string;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {SANITIZER} from '../render3/interfaces/view';\nimport {getLView} from '../render3/state';\nimport {stringify} from '../render3/util';\n\nimport {BypassType, allowSanitizationBypass} from './bypass';\nimport {_sanitizeHtml as _sanitizeHtml} from './html_sanitizer';\nimport {Sanitizer, SecurityContext} from './security';\nimport {StyleSanitizeFn, _sanitizeStyle as _sanitizeStyle} from './style_sanitizer';\nimport {_sanitizeUrl as _sanitizeUrl} from './url_sanitizer';\n\n\n\n/**\n * An `html` sanitizer which converts untrusted `html` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `html` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustHtml}.\n *\n * @param unsafeHtml untrusted `html`, typically from the user.\n * @returns `html` string which is safe to display to user, because all of the dangerous javascript\n * and urls have been removed.\n */\nexport function sanitizeHtml(unsafeHtml: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '';\n }\n if (allowSanitizationBypass(unsafeHtml, BypassType.Html)) {\n return unsafeHtml.toString();\n }\n return _sanitizeHtml(document, stringify(unsafeHtml));\n}\n\n/**\n * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing\n * dangerous content.\n *\n * This method parses the `style` and locates potentially dangerous content (such as urls and\n * javascript) and removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustStyle}.\n *\n * @param unsafeStyle untrusted `style`, typically from the user.\n * @returns `style` string which is safe to bind to the `style` properties, because all of the\n * dangerous javascript and urls have been removed.\n */\nexport function sanitizeStyle(unsafeStyle: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || '';\n }\n if (allowSanitizationBypass(unsafeStyle, BypassType.Style)) {\n return unsafeStyle.toString();\n }\n return _sanitizeStyle(stringify(unsafeStyle));\n}\n\n/**\n * A `url` sanitizer which converts untrusted `url` **string** into trusted string by removing\n * dangerous\n * content.\n *\n * This method parses the `url` and locates potentially dangerous content (such as javascript) and\n * removes it.\n *\n * It is possible to mark a string as trusted by calling {@link bypassSanitizationTrustUrl}.\n *\n * @param unsafeUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * all of the dangerous javascript has been removed.\n */\nexport function sanitizeUrl(unsafeUrl: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || '';\n }\n if (allowSanitizationBypass(unsafeUrl, BypassType.Url)) {\n return unsafeUrl.toString();\n }\n return _sanitizeUrl(stringify(unsafeUrl));\n}\n\n/**\n * A `url` sanitizer which only lets trusted `url`s through.\n *\n * This passes only `url`s marked trusted by calling {@link bypassSanitizationTrustResourceUrl}.\n *\n * @param unsafeResourceUrl untrusted `url`, typically from the user.\n * @returns `url` string which is safe to bind to the `src` properties such as `<img src>`, because\n * only trusted `url`s have been allowed to pass.\n */\nexport function sanitizeResourceUrl(unsafeResourceUrl: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || '';\n }\n if (allowSanitizationBypass(unsafeResourceUrl, BypassType.ResourceUrl)) {\n return unsafeResourceUrl.toString();\n }\n throw new Error('unsafe value used in a resource URL context (see http://g.co/ng/security#xss)');\n}\n\n/**\n * A `script` sanitizer which only lets trusted javascript through.\n *\n * This passes only `script`s marked trusted by calling {@link\n * bypassSanitizationTrustScript}.\n *\n * @param unsafeScript untrusted `script`, typically from the user.\n * @returns `url` string which is safe to bind to the `<script>` element such as `<img src>`,\n * because only trusted `scripts` have been allowed to pass.\n */\nexport function sanitizeScript(unsafeScript: any): string {\n const sanitizer = getSanitizer();\n if (sanitizer) {\n return sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || '';\n }\n if (allowSanitizationBypass(unsafeScript, BypassType.Script)) {\n return unsafeScript.toString();\n }\n throw new Error('unsafe value used in a script context');\n}\n\n/**\n * The default style sanitizer will handle sanitization for style properties by\n * sanitizing any CSS property that can include a `url` value (usually image-based properties)\n */\nexport const defaultStyleSanitizer = (function(prop: string, value?: string): string | boolean {\n if (value === undefined) {\n return prop === 'background-image' || prop === 'background' || prop === 'border-image' ||\n prop === 'filter' || prop === 'list-style' || prop === 'list-style-image';\n }\n\n return sanitizeStyle(value);\n} as StyleSanitizeFn);\n\nfunction getSanitizer(): Sanitizer|null {\n const lView = getLView();\n return lView && lView[SANITIZER];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {defineInjectable, defineInjector,} from '../../di/defs';\nimport {inject} from '../../di/injector_compatibility';\nimport * as r3 from '../index';\nimport * as sanitization from '../../sanitization/sanitization';\n\n\n/**\n * A mapping of the @angular/core API surface used in generated expressions to the actual symbols.\n *\n * This should be kept up to date with the public exports of @angular/core.\n */\nexport const angularCoreEnv: {[name: string]: Function} = {\n 'ɵdefineBase': r3.defineBase,\n 'ɵdefineComponent': r3.defineComponent,\n 'ɵdefineDirective': r3.defineDirective,\n 'defineInjectable': defineInjectable,\n 'defineInjector': defineInjector,\n 'ɵdefineNgModule': r3.defineNgModule,\n 'ɵdefinePipe': r3.definePipe,\n 'ɵdirectiveInject': r3.directiveInject,\n 'ɵgetFactoryOf': r3.getFactoryOf,\n 'ɵgetInheritedFactory': r3.getInheritedFactory,\n 'inject': inject,\n 'ɵinjectAttribute': r3.injectAttribute,\n 'ɵtemplateRefExtractor': r3.templateRefExtractor,\n 'ɵNgOnChangesFeature': r3.NgOnChangesFeature,\n 'ɵProvidersFeature': r3.ProvidersFeature,\n 'ɵInheritDefinitionFeature': r3.InheritDefinitionFeature,\n 'ɵelementAttribute': r3.elementAttribute,\n 'ɵbind': r3.bind,\n 'ɵcontainer': r3.container,\n 'ɵnextContext': r3.nextContext,\n 'ɵcontainerRefreshStart': r3.containerRefreshStart,\n 'ɵcontainerRefreshEnd': r3.containerRefreshEnd,\n 'ɵloadQueryList': r3.loadQueryList,\n 'ɵnamespaceHTML': r3.namespaceHTML,\n 'ɵnamespaceMathML': r3.namespaceMathML,\n 'ɵnamespaceSVG': r3.namespaceSVG,\n 'ɵenableBindings': r3.enableBindings,\n 'ɵdisableBindings': r3.disableBindings,\n 'ɵallocHostVars': r3.allocHostVars,\n 'ɵelementStart': r3.elementStart,\n 'ɵelementEnd': r3.elementEnd,\n 'ɵelement': r3.element,\n 'ɵelementContainerStart': r3.elementContainerStart,\n 'ɵelementContainerEnd': r3.elementContainerEnd,\n 'ɵpureFunction0': r3.pureFunction0,\n 'ɵpureFunction1': r3.pureFunction1,\n 'ɵpureFunction2': r3.pureFunction2,\n 'ɵpureFunction3': r3.pureFunction3,\n 'ɵpureFunction4': r3.pureFunction4,\n 'ɵpureFunction5': r3.pureFunction5,\n 'ɵpureFunction6': r3.pureFunction6,\n 'ɵpureFunction7': r3.pureFunction7,\n 'ɵpureFunction8': r3.pureFunction8,\n 'ɵpureFunctionV': r3.pureFunctionV,\n 'ɵgetCurrentView': r3.getCurrentView,\n 'ɵrestoreView': r3.restoreView,\n 'ɵinterpolation1': r3.interpolation1,\n 'ɵinterpolation2': r3.interpolation2,\n 'ɵinterpolation3': r3.interpolation3,\n 'ɵinterpolation4': r3.interpolation4,\n 'ɵinterpolation5': r3.interpolation5,\n 'ɵinterpolation6': r3.interpolation6,\n 'ɵinterpolation7': r3.interpolation7,\n 'ɵinterpolation8': r3.interpolation8,\n 'ɵinterpolationV': r3.interpolationV,\n 'ɵelementClassProp': r3.elementClassProp,\n 'ɵlistener': r3.listener,\n 'ɵload': r3.load,\n 'ɵprojection': r3.projection,\n 'ɵelementProperty': r3.elementProperty,\n 'ɵcomponentHostSyntheticProperty': r3.componentHostSyntheticProperty,\n 'ɵpipeBind1': r3.pipeBind1,\n 'ɵpipeBind2': r3.pipeBind2,\n 'ɵpipeBind3': r3.pipeBind3,\n 'ɵpipeBind4': r3.pipeBind4,\n 'ɵpipeBindV': r3.pipeBindV,\n 'ɵprojectionDef': r3.projectionDef,\n 'ɵpipe': r3.pipe,\n 'ɵquery': r3.query,\n 'ɵqueryRefresh': r3.queryRefresh,\n 'ɵregisterContentQuery': r3.registerContentQuery,\n 'ɵreference': r3.reference,\n 'ɵelementStyling': r3.elementStyling,\n 'ɵelementHostAttrs': r3.elementHostAttrs,\n 'ɵelementStylingMap': r3.elementStylingMap,\n 'ɵelementStyleProp': r3.elementStyleProp,\n 'ɵelementStylingApply': r3.elementStylingApply,\n 'ɵtemplate': r3.template,\n 'ɵtext': r3.text,\n 'ɵtextBinding': r3.textBinding,\n 'ɵembeddedViewStart': r3.embeddedViewStart,\n 'ɵembeddedViewEnd': r3.embeddedViewEnd,\n 'ɵi18n': r3.i18n,\n 'ɵi18nAttributes': r3.i18nAttributes,\n 'ɵi18nExp': r3.i18nExp,\n 'ɵi18nStart': r3.i18nStart,\n 'ɵi18nEnd': r3.i18nEnd,\n 'ɵi18nApply': r3.i18nApply,\n 'ɵi18nPostprocess': r3.i18nPostprocess,\n\n 'ɵsanitizeHtml': sanitization.sanitizeHtml,\n 'ɵsanitizeStyle': sanitization.sanitizeStyle,\n 'ɵdefaultStyleSanitizer': sanitization.defaultStyleSanitizer,\n 'ɵsanitizeResourceUrl': sanitization.sanitizeResourceUrl,\n 'ɵsanitizeScript': sanitization.sanitizeScript,\n 'ɵsanitizeUrl': sanitization.sanitizeUrl\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModuleFactory as R3NgModuleFactory, NgModuleType} from '../render3/ng_module_ref';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {NgModuleFactory} from './ng_module_factory';\n\n/**\n * Used to load ng module factories.\n *\n * @publicApi\n */\nexport abstract class NgModuleFactoryLoader {\n abstract load(path: string): Promise<NgModuleFactory<any>>;\n}\n\n/**\n * Map of module-id to the corresponding NgModule.\n * - In pre Ivy we track NgModuleFactory,\n * - In post Ivy we track the NgModuleType\n */\nconst modules = new Map<string, NgModuleFactory<any>|NgModuleType>();\n\n/**\n * Registers a loaded module. Should only be called from generated NgModuleFactory code.\n * @publicApi\n */\nexport function registerModuleFactory(id: string, factory: NgModuleFactory<any>) {\n const existing = modules.get(id) as NgModuleFactory<any>;\n assertNotExisting(id, existing && existing.moduleType);\n modules.set(id, factory);\n}\n\nfunction assertNotExisting(id: string, type: Type<any>| null): void {\n if (type) {\n throw new Error(\n `Duplicate module registered for ${id} - ${stringify(type)} vs ${stringify(type.name)}`);\n }\n}\n\nexport function registerNgModuleType(id: string, ngModuleType: NgModuleType) {\n const existing = modules.get(id) as NgModuleType | null;\n assertNotExisting(id, existing);\n modules.set(id, ngModuleType);\n}\n\nexport function clearModulesForTest(): void {\n modules.clear();\n}\n\nexport function getModuleFactory__PRE_R3__(id: string): NgModuleFactory<any> {\n const factory = modules.get(id) as NgModuleFactory<any>| null;\n if (!factory) throw noModuleError(id);\n return factory;\n}\n\nexport function getModuleFactory__POST_R3__(id: string): NgModuleFactory<any> {\n const type = modules.get(id) as NgModuleType | null;\n if (!type) throw noModuleError(id);\n return new R3NgModuleFactory(type);\n}\n\n/**\n * Returns the NgModuleFactory with the given id, if it exists and has been loaded.\n * Factories for modules that do not specify an `id` cannot be retrieved. Throws if the module\n * cannot be found.\n * @publicApi\n */\nexport const getModuleFactory: (id: string) => NgModuleFactory<any> = getModuleFactory__PRE_R3__;\n\nfunction noModuleError(id: string, ): Error {\n return new Error(`No module with ID ${id} loaded`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @description\n *\n * Represents a type that a Component or other object is instances of.\n *\n * An example of a `Type` is `MyCustomComponent` class, which in JavaScript is be represented by\n * the `MyCustomComponent` constructor function.\n *\n * @publicApi\n */\nexport const Type = Function;\n\nexport function isType(v: any): v is Type<any> {\n return typeof v === 'function';\n}\n\nexport interface Type<T> extends Function { new (...args: any[]): T; }\n\nexport type Mutable<T extends{[x: string]: any}, K extends string> = {\n [P in K]: T[P];\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type, isType} from '../type';\nimport {global, stringify} from '../util';\nimport {ANNOTATIONS, PARAMETERS, PROP_METADATA} from '../util/decorators';\n\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\n\n/**\n * Attention: These regex has to hold even if the code is minified!\n */\nexport const DELEGATE_CTOR = /^function\\s+\\S+\\(\\)\\s*{[\\s\\S]+\\.apply\\(this,\\s*arguments\\)/;\nexport const INHERITED_CLASS = /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{/;\nexport const INHERITED_CLASS_WITH_CTOR =\n /^class\\s+[A-Za-z\\d$_]*\\s*extends\\s+[^{]+{[\\s\\S]*constructor\\s*\\(/;\n\nexport class ReflectionCapabilities implements PlatformReflectionCapabilities {\n private _reflect: any;\n\n constructor(reflect?: any) { this._reflect = reflect || global['Reflect']; }\n\n isReflectionEnabled(): boolean { return true; }\n\n factory<T>(t: Type<T>): (args: any[]) => T { return (...args: any[]) => new t(...args); }\n\n /** @internal */\n _zipTypesAndAnnotations(paramTypes: any[], paramAnnotations: any[]): any[][] {\n let result: any[][];\n\n if (typeof paramTypes === 'undefined') {\n result = new Array(paramAnnotations.length);\n } else {\n result = new Array(paramTypes.length);\n }\n\n for (let i = 0; i < result.length; i++) {\n // TS outputs Object for parameters without types, while Traceur omits\n // the annotations. For now we preserve the Traceur behavior to aid\n // migration, but this can be revisited.\n if (typeof paramTypes === 'undefined') {\n result[i] = [];\n } else if (paramTypes[i] != Object) {\n result[i] = [paramTypes[i]];\n } else {\n result[i] = [];\n }\n if (paramAnnotations && paramAnnotations[i] != null) {\n result[i] = result[i].concat(paramAnnotations[i]);\n }\n }\n return result;\n }\n\n private _ownParameters(type: Type<any>, parentCtor: any): any[][]|null {\n const typeStr = type.toString();\n // If we have no decorators, we only have function.length as metadata.\n // In that case, to detect whether a child class declared an own constructor or not,\n // we need to look inside of that constructor to check whether it is\n // just calling the parent.\n // This also helps to work around for https://github.com/Microsoft/TypeScript/issues/12439\n // that sets 'design:paramtypes' to []\n // if a class inherits from another class but has no ctor declared itself.\n if (DELEGATE_CTOR.exec(typeStr) ||\n (INHERITED_CLASS.exec(typeStr) && !INHERITED_CLASS_WITH_CTOR.exec(typeStr))) {\n return null;\n }\n\n // Prefer the direct API.\n if ((<any>type).parameters && (<any>type).parameters !== parentCtor.parameters) {\n return (<any>type).parameters;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n const tsickleCtorParams = (<any>type).ctorParameters;\n if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) {\n // Newer tsickle uses a function closure\n // Retain the non-function case for compatibility with older tsickle\n const ctorParameters =\n typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;\n const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);\n const paramAnnotations = ctorParameters.map(\n (ctorParam: any) =>\n ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // API for metadata created by invoking the decorators.\n const paramAnnotations = type.hasOwnProperty(PARAMETERS) && (type as any)[PARAMETERS];\n const paramTypes = this._reflect && this._reflect.getOwnMetadata &&\n this._reflect.getOwnMetadata('design:paramtypes', type);\n if (paramTypes || paramAnnotations) {\n return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);\n }\n\n // If a class has no decorators, at least create metadata\n // based on function.length.\n // Note: We know that this is a real constructor as we checked\n // the content of the constructor above.\n return new Array((<any>type.length)).fill(undefined);\n }\n\n parameters(type: Type<any>): any[][] {\n // Note: only report metadata if we have at least one class decorator\n // to stay in sync with the static reflector.\n if (!isType(type)) {\n return [];\n }\n const parentCtor = getParentCtor(type);\n let parameters = this._ownParameters(type, parentCtor);\n if (!parameters && parentCtor !== Object) {\n parameters = this.parameters(parentCtor);\n }\n return parameters || [];\n }\n\n private _ownAnnotations(typeOrFunc: Type<any>, parentCtor: any): any[]|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).annotations && (<any>typeOrFunc).annotations !== parentCtor.annotations) {\n let annotations = (<any>typeOrFunc).annotations;\n if (typeof annotations === 'function' && annotations.annotations) {\n annotations = annotations.annotations;\n }\n return annotations;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).decorators && (<any>typeOrFunc).decorators !== parentCtor.decorators) {\n return convertTsickleDecoratorIntoMetadata((<any>typeOrFunc).decorators);\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) {\n return (typeOrFunc as any)[ANNOTATIONS];\n }\n return null;\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n if (!isType(typeOrFunc)) {\n return [];\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || [];\n const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : [];\n return parentAnnotations.concat(ownAnnotations);\n }\n\n private _ownPropMetadata(typeOrFunc: any, parentCtor: any): {[key: string]: any[]}|null {\n // Prefer the direct API.\n if ((<any>typeOrFunc).propMetadata &&\n (<any>typeOrFunc).propMetadata !== parentCtor.propMetadata) {\n let propMetadata = (<any>typeOrFunc).propMetadata;\n if (typeof propMetadata === 'function' && propMetadata.propMetadata) {\n propMetadata = propMetadata.propMetadata;\n }\n return propMetadata;\n }\n\n // API of tsickle for lowering decorators to properties on the class.\n if ((<any>typeOrFunc).propDecorators &&\n (<any>typeOrFunc).propDecorators !== parentCtor.propDecorators) {\n const propDecorators = (<any>typeOrFunc).propDecorators;\n const propMetadata = <{[key: string]: any[]}>{};\n Object.keys(propDecorators).forEach(prop => {\n propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);\n });\n return propMetadata;\n }\n\n // API for metadata created by invoking the decorators.\n if (typeOrFunc.hasOwnProperty(PROP_METADATA)) {\n return (typeOrFunc as any)[PROP_METADATA];\n }\n return null;\n }\n\n propMetadata(typeOrFunc: any): {[key: string]: any[]} {\n if (!isType(typeOrFunc)) {\n return {};\n }\n const parentCtor = getParentCtor(typeOrFunc);\n const propMetadata: {[key: string]: any[]} = {};\n if (parentCtor !== Object) {\n const parentPropMetadata = this.propMetadata(parentCtor);\n Object.keys(parentPropMetadata).forEach((propName) => {\n propMetadata[propName] = parentPropMetadata[propName];\n });\n }\n const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor);\n if (ownPropMetadata) {\n Object.keys(ownPropMetadata).forEach((propName) => {\n const decorators: any[] = [];\n if (propMetadata.hasOwnProperty(propName)) {\n decorators.push(...propMetadata[propName]);\n }\n decorators.push(...ownPropMetadata[propName]);\n propMetadata[propName] = decorators;\n });\n }\n return propMetadata;\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return type instanceof Type && lcProperty in type.prototype;\n }\n\n guards(type: any): {[key: string]: any} { return {}; }\n\n getter(name: string): GetterFn { return <GetterFn>new Function('o', 'return o.' + name + ';'); }\n\n setter(name: string): SetterFn {\n return <SetterFn>new Function('o', 'v', 'return o.' + name + ' = v;');\n }\n\n method(name: string): MethodFn {\n const functionBody = `if (!o.${name}) throw new Error('\"${name}\" is undefined');\n return o.${name}.apply(o, args);`;\n return <MethodFn>new Function('o', 'args', functionBody);\n }\n\n // There is not a concept of import uri in Js, but this is useful in developing Dart applications.\n importUri(type: any): string {\n // StaticSymbol\n if (typeof type === 'object' && type['filePath']) {\n return type['filePath'];\n }\n // Runtime type\n return `./${stringify(type)}`;\n }\n\n resourceUri(type: any): string { return `./${stringify(type)}`; }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return runtime;\n }\n resolveEnum(enumIdentifier: any, name: string): any { return enumIdentifier[name]; }\n}\n\nfunction convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[] {\n if (!decoratorInvocations) {\n return [];\n }\n return decoratorInvocations.map(decoratorInvocation => {\n const decoratorType = decoratorInvocation.type;\n const annotationCls = decoratorType.annotationCls;\n const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];\n return new annotationCls(...annotationArgs);\n });\n}\n\nfunction getParentCtor(ctor: Function): Type<any> {\n const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;\n const parentCtor = parentProto ? parentProto.constructor : null;\n // Note: We always use `Object` as the null value\n // to simplify checking later on.\n return parentCtor || Object;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Host, Inject, Optional, Self, SkipSelf} from '../../di/metadata';\nimport {Attribute} from '../../metadata/di';\nimport {ReflectionCapabilities} from '../../reflection/reflection_capabilities';\nimport {Type} from '../../type';\n\nimport {CompilerFacade, R3DependencyMetadataFacade, getCompilerFacade} from './compiler_facade';\n\nlet _reflect: ReflectionCapabilities|null = null;\n\nexport function getReflect(): ReflectionCapabilities {\n return (_reflect = _reflect || new ReflectionCapabilities());\n}\n\nexport function reflectDependencies(type: Type<any>): R3DependencyMetadataFacade[] {\n return convertDependencies(getReflect().parameters(type));\n}\n\nexport function convertDependencies(deps: any[]): R3DependencyMetadataFacade[] {\n const compiler = getCompilerFacade();\n return deps.map(dep => reflectDependency(compiler, dep));\n}\n\nfunction reflectDependency(compiler: CompilerFacade, dep: any | any[]): R3DependencyMetadataFacade {\n const meta: R3DependencyMetadataFacade = {\n token: null,\n host: false,\n optional: false,\n resolved: compiler.R3ResolvedDependencyType.Token,\n self: false,\n skipSelf: false,\n };\n\n function setTokenAndResolvedType(token: any): void {\n meta.resolved = compiler.R3ResolvedDependencyType.Token;\n meta.token = token;\n }\n\n if (Array.isArray(dep)) {\n if (dep.length === 0) {\n throw new Error('Dependency array must have arguments.');\n }\n for (let j = 0; j < dep.length; j++) {\n const param = dep[j];\n if (param === undefined) {\n // param may be undefined if type of dep is not set by ngtsc\n continue;\n } else if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') {\n meta.optional = true;\n } else if (param instanceof SkipSelf || param.__proto__.ngMetadataName === 'SkipSelf') {\n meta.skipSelf = true;\n } else if (param instanceof Self || param.__proto__.ngMetadataName === 'Self') {\n meta.self = true;\n } else if (param instanceof Host || param.__proto__.ngMetadataName === 'Host') {\n meta.host = true;\n } else if (param instanceof Inject) {\n meta.token = param.token;\n } else if (param instanceof Attribute) {\n if (param.attributeName === undefined) {\n throw new Error(`Attribute name must be defined.`);\n }\n meta.token = param.attributeName;\n meta.resolved = compiler.R3ResolvedDependencyType.Attribute;\n } else {\n setTokenAndResolvedType(param);\n }\n }\n } else {\n setTokenAndResolvedType(dep);\n }\n return meta;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {resolveForwardRef} from '../../di/forward_ref';\nimport {registerNgModuleType} from '../../linker/ng_module_factory_loader';\nimport {Component} from '../../metadata';\nimport {ModuleWithProviders, NgModule, NgModuleDef, NgModuleTransitiveScopes} from '../../metadata/ng_module';\nimport {Type} from '../../type';\nimport {assertDefined} from '../assert';\nimport {getComponentDef, getDirectiveDef, getNgModuleDef, getPipeDef} from '../definition';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF, NG_INJECTOR_DEF, NG_MODULE_DEF, NG_PIPE_DEF} from '../fields';\nimport {ComponentDef} from '../interfaces/definition';\nimport {NgModuleType} from '../ng_module_ref';\nimport {stringify} from '../util';\n\nimport {R3InjectorMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {reflectDependencies} from './util';\n\nconst EMPTY_ARRAY: Type<any>[] = [];\n\ninterface ModuleQueueItem {\n moduleType: Type<any>;\n ngModule: NgModule;\n}\n\nconst moduleQueue: ModuleQueueItem[] = [];\n\n/**\n * Enqueues moduleDef to be checked later to see if scope can be set on its\n * component declarations.\n */\nfunction enqueueModuleForDelayedScoping(moduleType: Type<any>, ngModule: NgModule) {\n moduleQueue.push({moduleType, ngModule});\n}\n\nlet flushingModuleQueue = false;\n/**\n * Loops over queued module definitions, if a given module definition has all of its\n * declarations resolved, it dequeues that module definition and sets the scope on\n * its declarations.\n */\nexport function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n try {\n for (let i = moduleQueue.length - 1; i >= 0; i--) {\n const {moduleType, ngModule} = moduleQueue[i];\n\n if (ngModule.declarations && ngModule.declarations.every(isResolvedDeclaration)) {\n // dequeue\n moduleQueue.splice(i, 1);\n setScopeOnDeclaredComponents(moduleType, ngModule);\n }\n }\n } finally {\n flushingModuleQueue = false;\n }\n }\n}\n\n/**\n * Returns truthy if a declaration has resolved. If the declaration happens to be\n * an array of declarations, it will recurse to check each declaration in that array\n * (which may also be arrays).\n */\nfunction isResolvedDeclaration(declaration: any[] | Type<any>): boolean {\n if (Array.isArray(declaration)) {\n return declaration.every(isResolvedDeclaration);\n }\n return !!resolveForwardRef(declaration);\n}\n\n/**\n * Compiles a module in JIT mode.\n *\n * This function automatically gets called when a class has a `@NgModule` decorator.\n */\nexport function compileNgModule(moduleType: Type<any>, ngModule: NgModule = {}): void {\n compileNgModuleDefs(moduleType as NgModuleType, ngModule);\n\n // Because we don't know if all declarations have resolved yet at the moment the\n // NgModule decorator is executing, we're enqueueing the setting of module scope\n // on its declarations to be run at a later time when all declarations for the module,\n // including forward refs, have resolved.\n enqueueModuleForDelayedScoping(moduleType, ngModule);\n}\n\n/**\n * Compiles and adds the `ngModuleDef` and `ngInjectorDef` properties to the module class.\n */\nexport function compileNgModuleDefs(moduleType: NgModuleType, ngModule: NgModule): void {\n ngDevMode && assertDefined(moduleType, 'Required value moduleType');\n ngDevMode && assertDefined(ngModule, 'Required value ngModule');\n const declarations: Type<any>[] = flatten(ngModule.declarations || EMPTY_ARRAY);\n\n let ngModuleDef: any = null;\n Object.defineProperty(moduleType, NG_MODULE_DEF, {\n configurable: true,\n get: () => {\n if (ngModuleDef === null) {\n ngModuleDef = getCompilerFacade().compileNgModule(\n angularCoreEnv, `ng://${moduleType.name}/ngModuleDef.js`, {\n type: moduleType,\n bootstrap: flatten(ngModule.bootstrap || EMPTY_ARRAY, resolveForwardRef),\n declarations: declarations.map(resolveForwardRef),\n imports: flatten(ngModule.imports || EMPTY_ARRAY, resolveForwardRef)\n .map(expandModuleWithProviders),\n exports: flatten(ngModule.exports || EMPTY_ARRAY, resolveForwardRef)\n .map(expandModuleWithProviders),\n emitInline: true,\n });\n }\n return ngModuleDef;\n }\n });\n if (ngModule.id) {\n registerNgModuleType(ngModule.id, moduleType);\n }\n\n let ngInjectorDef: any = null;\n Object.defineProperty(moduleType, NG_INJECTOR_DEF, {\n get: () => {\n if (ngInjectorDef === null) {\n ngDevMode && verifySemanticsOfNgModuleDef(moduleType as any as NgModuleType);\n const meta: R3InjectorMetadataFacade = {\n name: moduleType.name,\n type: moduleType,\n deps: reflectDependencies(moduleType),\n providers: ngModule.providers || EMPTY_ARRAY,\n imports: [\n (ngModule.imports || EMPTY_ARRAY).map(resolveForwardRef),\n (ngModule.exports || EMPTY_ARRAY).map(resolveForwardRef),\n ],\n };\n ngInjectorDef = getCompilerFacade().compileInjector(\n angularCoreEnv, `ng://${moduleType.name}/ngInjectorDef.js`, meta);\n }\n return ngInjectorDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nfunction verifySemanticsOfNgModuleDef(moduleType: NgModuleType): void {\n if (verifiedNgModule.get(moduleType)) return;\n verifiedNgModule.set(moduleType, true);\n moduleType = resolveForwardRef(moduleType);\n const ngModuleDef = getNgModuleDef(moduleType, true);\n const errors: string[] = [];\n ngModuleDef.declarations.forEach(verifyDeclarationsHaveDefinitions);\n const combinedDeclarations: Type<any>[] = [\n ...ngModuleDef.declarations.map(resolveForwardRef), //\n ...flatten(ngModuleDef.imports.map(computeCombinedExports), resolveForwardRef),\n ];\n ngModuleDef.exports.forEach(verifyExportsAreDeclaredOrReExported);\n ngModuleDef.declarations.forEach(verifyDeclarationIsUnique);\n ngModuleDef.declarations.forEach(verifyComponentEntryComponentsIsPartOfNgModule);\n\n const ngModule = getAnnotation<NgModule>(moduleType, 'NgModule');\n if (ngModule) {\n ngModule.imports &&\n flatten(ngModule.imports, unwrapModuleWithProvidersImports)\n .forEach(verifySemanticsOfNgModuleDef);\n ngModule.bootstrap && ngModule.bootstrap.forEach(verifyComponentIsPartOfNgModule);\n ngModule.entryComponents && ngModule.entryComponents.forEach(verifyComponentIsPartOfNgModule);\n }\n\n // Throw Error if any errors were detected.\n if (errors.length) {\n throw new Error(errors.join('\\n'));\n }\n ////////////////////////////////////////////////////////////////////////////////////////////////\n function verifyDeclarationsHaveDefinitions(type: Type<any>): void {\n type = resolveForwardRef(type);\n const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef(type);\n if (!def) {\n errors.push(\n `Unexpected value '${stringify(type)}' declared by the module '${stringify(moduleType)}'. Please add a @Pipe/@Directive/@Component annotation.`);\n }\n }\n\n function verifyExportsAreDeclaredOrReExported(type: Type<any>) {\n type = resolveForwardRef(type);\n const kind = getComponentDef(type) && 'component' || getDirectiveDef(type) && 'directive' ||\n getPipeDef(type) && 'pipe';\n if (kind) {\n // only checked if we are declared as Component, Directive, or Pipe\n // Modules don't need to be declared or imported.\n if (combinedDeclarations.lastIndexOf(type) === -1) {\n // We are exporting something which we don't explicitly declare or import.\n errors.push(\n `Can't export ${kind} ${stringify(type)} from ${stringify(moduleType)} as it was neither declared nor imported!`);\n }\n }\n }\n\n function verifyDeclarationIsUnique(type: Type<any>) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (existingModule && existingModule !== moduleType) {\n const modules = [existingModule, moduleType].map(stringify).sort();\n errors.push(\n `Type ${stringify(type)} is part of the declarations of 2 modules: ${modules[0]} and ${modules[1]}! ` +\n `Please consider moving ${stringify(type)} to a higher module that imports ${modules[0]} and ${modules[1]}. ` +\n `You can also create a new NgModule that exports and includes ${stringify(type)} then import that NgModule in ${modules[0]} and ${modules[1]}.`);\n } else {\n // Mark type as having owner.\n ownerNgModule.set(type, moduleType);\n }\n }\n\n function verifyComponentIsPartOfNgModule(type: Type<any>) {\n type = resolveForwardRef(type);\n const existingModule = ownerNgModule.get(type);\n if (!existingModule) {\n errors.push(\n `Component ${stringify(type)} is not part of any NgModule or the module has not been imported into your module.`);\n }\n }\n\n function verifyComponentEntryComponentsIsPartOfNgModule(type: Type<any>) {\n type = resolveForwardRef(type);\n if (getComponentDef(type)) {\n // We know we are component\n const component = getAnnotation<Component>(type, 'Component');\n if (component && component.entryComponents) {\n component.entryComponents.forEach(verifyComponentIsPartOfNgModule);\n }\n }\n }\n}\n\nfunction unwrapModuleWithProvidersImports(\n typeOrWithProviders: NgModuleType<any>| {ngModule: NgModuleType<any>}): NgModuleType<any> {\n typeOrWithProviders = resolveForwardRef(typeOrWithProviders);\n return (typeOrWithProviders as any).ngModule || typeOrWithProviders;\n}\n\nfunction getAnnotation<T>(type: any, name: string): T|null {\n let annotation: T|null = null;\n collect(type.__annotations__);\n collect(type.decorators);\n return annotation;\n\n function collect(annotations: any[] | null) {\n if (annotations) {\n annotations.forEach(readAnnotation);\n }\n }\n\n function readAnnotation(\n decorator: {type: {prototype: {ngMetadataName: string}, args: any[]}, args: any}): void {\n if (!annotation) {\n const proto = Object.getPrototypeOf(decorator);\n if (proto.ngMetadataName == name) {\n annotation = decorator as any;\n } else if (decorator.type) {\n const proto = Object.getPrototypeOf(decorator.type);\n if (proto.ngMetadataName == name) {\n annotation = decorator.args[0];\n }\n }\n }\n }\n}\n\n/**\n * Keep track of compiled components. This is needed because in tests we often want to compile the\n * same component with more than one NgModule. This would cause an error unless we reset which\n * NgModule the component belongs to. We keep the list of compiled components here so that the\n * TestBed can reset it later.\n */\nlet ownerNgModule = new Map<Type<any>, NgModuleType<any>>();\nlet verifiedNgModule = new Map<NgModuleType<any>, boolean>();\n\nexport function resetCompiledComponents(): void {\n ownerNgModule = new Map<Type<any>, NgModuleType<any>>();\n verifiedNgModule = new Map<NgModuleType<any>, boolean>();\n moduleQueue.length = 0;\n}\n\n/**\n * Computes the combined declarations of explicit declarations, as well as declarations inherited\n * by\n * traversing the exports of imported modules.\n * @param type\n */\nfunction computeCombinedExports(type: Type<any>): Type<any>[] {\n type = resolveForwardRef(type);\n const ngModuleDef = getNgModuleDef(type, true);\n return [...flatten(ngModuleDef.exports.map((type) => {\n const ngModuleDef = getNgModuleDef(type);\n if (ngModuleDef) {\n verifySemanticsOfNgModuleDef(type as any as NgModuleType);\n return computeCombinedExports(type);\n } else {\n return type;\n }\n }))];\n}\n\n/**\n * Some declared components may be compiled asynchronously, and thus may not have their\n * ngComponentDef set yet. If this is the case, then a reference to the module is written into\n * the `ngSelectorScope` property of the declared type.\n */\nfunction setScopeOnDeclaredComponents(moduleType: Type<any>, ngModule: NgModule) {\n const declarations: Type<any>[] = flatten(ngModule.declarations || EMPTY_ARRAY);\n\n const transitiveScopes = transitiveScopesFor(moduleType);\n\n declarations.forEach(declaration => {\n if (declaration.hasOwnProperty(NG_COMPONENT_DEF)) {\n // An `ngComponentDef` field exists - go ahead and patch the component directly.\n const component = declaration as Type<any>& {ngComponentDef: ComponentDef<any>};\n const componentDef = getComponentDef(component) !;\n patchComponentDefWithScope(componentDef, transitiveScopes);\n } else if (\n !declaration.hasOwnProperty(NG_DIRECTIVE_DEF) && !declaration.hasOwnProperty(NG_PIPE_DEF)) {\n // Set `ngSelectorScope` for future reference when the component compilation finishes.\n (declaration as Type<any>& {ngSelectorScope?: any}).ngSelectorScope = moduleType;\n }\n });\n}\n\n/**\n * Patch the definition of a component with directives and pipes from the compilation scope of\n * a given module.\n */\nexport function patchComponentDefWithScope<C>(\n componentDef: ComponentDef<C>, transitiveScopes: NgModuleTransitiveScopes) {\n componentDef.directiveDefs = () => Array.from(transitiveScopes.compilation.directives)\n .map(dir => getDirectiveDef(dir) || getComponentDef(dir) !)\n .filter(def => !!def);\n componentDef.pipeDefs = () =>\n Array.from(transitiveScopes.compilation.pipes).map(pipe => getPipeDef(pipe) !);\n}\n\n/**\n * Compute the pair of transitive scopes (compilation scope and exported scope) for a given module.\n *\n * This operation is memoized and the result is cached on the module's definition. It can be called\n * on modules with components that have not fully compiled yet, but the result should not be used\n * until they have.\n */\nexport function transitiveScopesFor<T>(moduleType: Type<T>): NgModuleTransitiveScopes {\n if (!isNgModule(moduleType)) {\n throw new Error(`${moduleType.name} does not have an ngModuleDef`);\n }\n const def = getNgModuleDef(moduleType) !;\n\n if (def.transitiveCompileScopes !== null) {\n return def.transitiveCompileScopes;\n }\n\n const scopes: NgModuleTransitiveScopes = {\n compilation: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n exported: {\n directives: new Set<any>(),\n pipes: new Set<any>(),\n },\n };\n\n def.declarations.forEach(declared => {\n const declaredWithDefs = declared as Type<any>& { ngPipeDef?: any; };\n\n if (getPipeDef(declaredWithDefs)) {\n scopes.compilation.pipes.add(declared);\n } else {\n // Either declared has an ngComponentDef or ngDirectiveDef, or it's a component which hasn't\n // had its template compiled yet. In either case, it gets added to the compilation's\n // directives.\n scopes.compilation.directives.add(declared);\n }\n });\n\n def.imports.forEach(<I>(imported: Type<I>) => {\n const importedTyped = imported as Type<I>& {\n // If imported is an @NgModule:\n ngModuleDef?: NgModuleDef<I>;\n };\n\n if (!isNgModule<I>(importedTyped)) {\n throw new Error(`Importing ${importedTyped.name} which does not have an ngModuleDef`);\n }\n\n // When this module imports another, the imported module's exported directives and pipes are\n // added to the compilation scope of this module.\n const importedScope = transitiveScopesFor(importedTyped);\n importedScope.exported.directives.forEach(entry => scopes.compilation.directives.add(entry));\n importedScope.exported.pipes.forEach(entry => scopes.compilation.pipes.add(entry));\n });\n\n def.exports.forEach(<E>(exported: Type<E>) => {\n const exportedTyped = exported as Type<E>& {\n // Components, Directives, NgModules, and Pipes can all be exported.\n ngComponentDef?: any;\n ngDirectiveDef?: any;\n ngModuleDef?: NgModuleDef<E>;\n ngPipeDef?: any;\n };\n\n // Either the type is a module, a pipe, or a component/directive (which may not have an\n // ngComponentDef as it might be compiled asynchronously).\n if (isNgModule(exportedTyped)) {\n // When this module exports another, the exported module's exported directives and pipes are\n // added to both the compilation and exported scopes of this module.\n const exportedScope = transitiveScopesFor(exportedTyped);\n exportedScope.exported.directives.forEach(entry => {\n scopes.compilation.directives.add(entry);\n scopes.exported.directives.add(entry);\n });\n exportedScope.exported.pipes.forEach(entry => {\n scopes.compilation.pipes.add(entry);\n scopes.exported.pipes.add(entry);\n });\n } else if (getPipeDef(exportedTyped)) {\n scopes.exported.pipes.add(exportedTyped);\n } else {\n scopes.exported.directives.add(exportedTyped);\n }\n });\n\n def.transitiveCompileScopes = scopes;\n return scopes;\n}\n\nfunction flatten<T>(values: any[], mapFn?: (value: T) => any): Type<T>[] {\n const out: Type<T>[] = [];\n values.forEach(value => {\n if (Array.isArray(value)) {\n out.push(...flatten<T>(value, mapFn));\n } else {\n out.push(mapFn ? mapFn(value) : value);\n }\n });\n return out;\n}\n\nfunction expandModuleWithProviders(value: Type<any>| ModuleWithProviders<{}>): Type<any> {\n if (isModuleWithProviders(value)) {\n return value.ngModule;\n }\n return value;\n}\n\nfunction isModuleWithProviders(value: any): value is ModuleWithProviders<{}> {\n return (value as{ngModule?: any}).ngModule !== undefined;\n}\n\nfunction isNgModule<T>(value: Type<T>): value is Type<T>&{ngModuleDef: NgModuleDef<T>} {\n return !!getNgModuleDef(value);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ComponentType} from '..';\nimport {resolveForwardRef} from '../../di/forward_ref';\nimport {Query} from '../../metadata/di';\nimport {Component, Directive} from '../../metadata/directives';\nimport {componentNeedsResolution, maybeQueueResolutionOfComponentResources} from '../../metadata/resource_loading';\nimport {ViewEncapsulation} from '../../metadata/view';\nimport {Type} from '../../type';\nimport {EMPTY_ARRAY, EMPTY_OBJ} from '../empty';\nimport {NG_COMPONENT_DEF, NG_DIRECTIVE_DEF} from '../fields';\nimport {stringify} from '../util';\n\nimport {R3DirectiveMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {R3ComponentMetadataFacade, R3QueryMetadataFacade} from './compiler_facade_interface';\nimport {angularCoreEnv} from './environment';\nimport {flushModuleScopingQueueAsMuchAsPossible, patchComponentDefWithScope, transitiveScopesFor} from './module';\nimport {getReflect, reflectDependencies} from './util';\n\n\n\n/**\n * Compile an Angular component according to its decorator metadata, and patch the resulting\n * ngComponentDef onto the component type.\n *\n * Compilation may be asynchronous (due to the need to resolve URLs for the component template or\n * other resources, for example). In the event that compilation is not immediate, `compileComponent`\n * will enqueue resource resolution into a global queue and will fail to return the `ngComponentDef`\n * until the global queue has been resolved with a call to `resolveComponentResources`.\n */\nexport function compileComponent(type: Type<any>, metadata: Component): void {\n let ngComponentDef: any = null;\n // Metadata may have resources which need to be resolved.\n maybeQueueResolutionOfComponentResources(metadata);\n Object.defineProperty(type, NG_COMPONENT_DEF, {\n get: () => {\n const compiler = getCompilerFacade();\n if (ngComponentDef === null) {\n if (componentNeedsResolution(metadata)) {\n const error = [`Component '${stringify(type)}' is not resolved:`];\n if (metadata.templateUrl) {\n error.push(` - templateUrl: ${stringify(metadata.templateUrl)}`);\n }\n if (metadata.styleUrls && metadata.styleUrls.length) {\n error.push(` - styleUrls: ${JSON.stringify(metadata.styleUrls)}`);\n }\n error.push(`Did you run and wait for 'resolveComponentResources()'?`);\n throw new Error(error.join('\\n'));\n }\n\n const meta: R3ComponentMetadataFacade = {\n ...directiveMetadata(type, metadata),\n template: metadata.template || '',\n preserveWhitespaces: metadata.preserveWhitespaces || false,\n styles: metadata.styles || EMPTY_ARRAY,\n animations: metadata.animations,\n viewQueries: extractQueriesMetadata(type, getReflect().propMetadata(type), isViewQuery),\n directives: [],\n changeDetection: metadata.changeDetection,\n pipes: new Map(),\n encapsulation: metadata.encapsulation || ViewEncapsulation.Emulated,\n interpolation: metadata.interpolation,\n viewProviders: metadata.viewProviders || null,\n };\n ngComponentDef = compiler.compileComponent(\n angularCoreEnv, `ng://${stringify(type)}/template.html`, meta);\n\n // When NgModule decorator executed, we enqueued the module definition such that\n // it would only dequeue and add itself as module scope to all of its declarations,\n // but only if if all of its declarations had resolved. This call runs the check\n // to see if any modules that are in the queue can be dequeued and add scope to\n // their declarations.\n flushModuleScopingQueueAsMuchAsPossible();\n\n // If component compilation is async, then the @NgModule annotation which declares the\n // component may execute and set an ngSelectorScope property on the component type. This\n // allows the component to patch itself with directiveDefs from the module after it\n // finishes compiling.\n if (hasSelectorScope(type)) {\n const scopes = transitiveScopesFor(type.ngSelectorScope);\n patchComponentDefWithScope(ngComponentDef, scopes);\n }\n }\n return ngComponentDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nfunction hasSelectorScope<T>(component: Type<T>): component is Type<T>&\n {ngSelectorScope: Type<any>} {\n return (component as{ngSelectorScope?: any}).ngSelectorScope !== undefined;\n}\n\n/**\n * Compile an Angular directive according to its decorator metadata, and patch the resulting\n * ngDirectiveDef onto the component type.\n *\n * In the event that compilation is not immediate, `compileDirective` will return a `Promise` which\n * will resolve when compilation completes and the directive becomes usable.\n */\nexport function compileDirective(type: Type<any>, directive: Directive): void {\n let ngDirectiveDef: any = null;\n Object.defineProperty(type, NG_DIRECTIVE_DEF, {\n get: () => {\n if (ngDirectiveDef === null) {\n const facade = directiveMetadata(type as ComponentType<any>, directive);\n ngDirectiveDef = getCompilerFacade().compileDirective(\n angularCoreEnv, `ng://${type && type.name}/ngDirectiveDef.js`, facade);\n }\n return ngDirectiveDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n\nexport function extendsDirectlyFromObject(type: Type<any>): boolean {\n return Object.getPrototypeOf(type.prototype) === Object.prototype;\n}\n\n/**\n * Extract the `R3DirectiveMetadata` for a particular directive (either a `Directive` or a\n * `Component`).\n */\nfunction directiveMetadata(type: Type<any>, metadata: Directive): R3DirectiveMetadataFacade {\n // Reflect inputs and outputs.\n const propMetadata = getReflect().propMetadata(type);\n\n return {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n selector: metadata.selector !,\n deps: reflectDependencies(type),\n host: metadata.host || EMPTY_OBJ,\n propMetadata: propMetadata,\n inputs: metadata.inputs || EMPTY_ARRAY,\n outputs: metadata.outputs || EMPTY_ARRAY,\n queries: extractQueriesMetadata(type, propMetadata, isContentQuery),\n lifecycle: {\n usesOnChanges: type.prototype.ngOnChanges !== undefined,\n },\n typeSourceSpan: null !,\n usesInheritance: !extendsDirectlyFromObject(type),\n exportAs: metadata.exportAs || null,\n providers: metadata.providers || null,\n };\n}\n\nfunction convertToR3QueryPredicate(selector: any): any|string[] {\n return typeof selector === 'string' ? splitByComma(selector) : resolveForwardRef(selector);\n}\n\nexport function convertToR3QueryMetadata(propertyName: string, ann: Query): R3QueryMetadataFacade {\n return {\n propertyName: propertyName,\n predicate: convertToR3QueryPredicate(ann.selector),\n descendants: ann.descendants,\n first: ann.first,\n read: ann.read ? ann.read : null\n };\n}\nfunction extractQueriesMetadata(\n type: Type<any>, propMetadata: {[key: string]: any[]},\n isQueryAnn: (ann: any) => ann is Query): R3QueryMetadataFacade[] {\n const queriesMeta: R3QueryMetadataFacade[] = [];\n for (const field in propMetadata) {\n if (propMetadata.hasOwnProperty(field)) {\n propMetadata[field].forEach(ann => {\n if (isQueryAnn(ann)) {\n if (!ann.selector) {\n throw new Error(\n `Can't construct a query for the property \"${field}\" of ` +\n `\"${stringify(type)}\" since the query selector wasn't defined.`);\n }\n queriesMeta.push(convertToR3QueryMetadata(field, ann));\n }\n });\n }\n }\n return queriesMeta;\n}\n\nfunction isContentQuery(value: any): value is Query {\n const name = value.ngMetadataName;\n return name === 'ContentChild' || name === 'ContentChildren';\n}\n\nfunction isViewQuery(value: any): value is Query {\n const name = value.ngMetadataName;\n return name === 'ViewChild' || name === 'ViewChildren';\n}\n\nfunction splitByComma(value: string): string[] {\n return value.split(',').map(piece => piece.trim());\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Pipe} from '../../metadata/directives';\nimport {Type} from '../../type';\nimport {NG_PIPE_DEF} from '../fields';\nimport {stringify} from '../util';\n\nimport {getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {reflectDependencies} from './util';\n\nexport function compilePipe(type: Type<any>, meta: Pipe): void {\n let ngPipeDef: any = null;\n Object.defineProperty(type, NG_PIPE_DEF, {\n get: () => {\n if (ngPipeDef === null) {\n ngPipeDef = getCompilerFacade().compilePipe(\n angularCoreEnv, `ng://${stringify(type)}/ngPipeDef.js`, {\n type: type,\n name: type.name,\n deps: reflectDependencies(type),\n pipeName: meta.name,\n pure: meta.pure !== undefined ? meta.pure : true\n });\n }\n return ngPipeDef;\n },\n // Make the property configurable in dev mode to allow overriding in tests\n configurable: !!ngDevMode,\n });\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectionStrategy} from '../change_detection/constants';\nimport {Provider} from '../di';\nimport {NG_BASE_DEF} from '../render3/fields';\nimport {compileComponent as render3CompileComponent, compileDirective as render3CompileDirective} from '../render3/jit/directive';\nimport {compilePipe as render3CompilePipe} from '../render3/jit/pipe';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator, makePropDecorator} from '../util/decorators';\nimport {noop} from '../util/noop';\nimport {fillProperties} from '../util/property';\n\nimport {ViewEncapsulation} from './view';\n\n\n\n/**\n * Type of the Directive decorator / constructor function.\n * @publicApi\n */\nexport interface DirectiveDecorator {\n /**\n * Marks a class as an Angular directive. You can define your own\n * directives to attach custom behavior to elements in the DOM.\n * The options provide configuration metadata that determines\n * how the directive should be processed, instantiated and used at\n * runtime.\n *\n * Directive classes, like component classes, can implement\n * [life-cycle hooks](guide/lifecycle-hooks) to influence their configuration and behavior.\n *\n *\n * @usageNotes\n * To define a directive, mark the class with the decorator and provide metadata.\n *\n * ```\n * import {Directive} from '@angular/core';\n *\n * @Directive({\n * selector: 'my-directive',\n * })\n * export class MyDirective {\n * ...\n * }\n * ```\n *\n * ### Declaring directives\n *\n * Directives are [declarables](guide/glossary#declarable).\n * They must be declared by an NgModule\n * in order to be usable in an app.\n *\n * A directive must belong to exactly one NgModule. Do not re-declare\n * a directive imported from another module.\n * List the directive class in the `declarations` field of an NgModule.\n *\n * ```\n * declarations: [\n * AppComponent,\n * MyDirective\n * ],\n * ```\n *\n * @Annotation\n */\n (obj: Directive): TypeDecorator;\n\n /**\n * See the `Directive` decorator.\n */\n new (obj: Directive): Directive;\n}\n\n/**\n * Directive decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport interface Directive {\n /**\n * The CSS selector that identifies this directive in a template\n * and triggers instantiation of the directive.\n *\n * Declare as one of the following:\n *\n * - `element-name`: Select by element name.\n * - `.class`: Select by class name.\n * - `[attribute]`: Select by attribute name.\n * - `[attribute=value]`: Select by attribute name and value.\n * - `:not(sub_selector)`: Select only if the element does not match the `sub_selector`.\n * - `selector1, selector2`: Select if either `selector1` or `selector2` matches.\n *\n * Angular only allows directives to apply on CSS selectors that do not cross\n * element boundaries.\n *\n * For the following template HTML, a directive with an `input[type=text]` selector,\n * would be instantiated only on the `<input type=\"text\">` element.\n *\n * ```html\n * <form>\n * <input type=\"text\">\n * <input type=\"radio\">\n * <form>\n * ```\n *\n */\n selector?: string;\n\n /**\n * Enumerates the set of data-bound input properties for a directive\n *\n * Angular automatically updates input properties during change detection.\n * The `inputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property where the value is written.\n * - `bindingProperty` specifies the DOM property where the value is read from.\n *\n * When `bindingProperty` is not provided, it is assumed to be equal to `directiveProperty`.\n * @usageNotes\n *\n * ### Example\n *\n * The following example creates a component with two data-bound properties.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * inputs: ['bankName', 'id: account-id'],\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * bankName: string;\n * id: string;\n *\n * ```\n *\n */\n inputs?: string[];\n\n /**\n * Enumerates the set of event-bound output properties.\n *\n * When an output property emits an event, an event handler attached to that event\n * in the template is invoked.\n *\n * The `outputs` property defines a set of `directiveProperty` to `bindingProperty`\n * configuration:\n *\n * - `directiveProperty` specifies the component property that emits events.\n * - `bindingProperty` specifies the DOM property the event handler is attached to.\n *\n * @usageNotes\n *\n * ### Example\n *\n * ```typescript\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n *\n */\n outputs?: string[];\n\n /**\n * Configures the [injector](guide/glossary#injector) of this\n * directive or component with a [token](guide/glossary#di-token)\n * that maps to a [provider](guide/glossary#provider) of a dependency.\n */\n providers?: Provider[];\n\n /**\n * Defines the name that can be used in the template to assign this directive to a variable.\n *\n * @usageNotes\n *\n * ### Simple Example\n *\n * ```\n * @Directive({\n * selector: 'child-dir',\n * exportAs: 'child'\n * })\n * class ChildDir {\n * }\n *\n * @Component({\n * selector: 'main',\n * template: `<child-dir #c=\"child\"></child-dir>`\n * })\n * class MainComponent {\n * }\n * ```\n *\n */\n exportAs?: string;\n\n /**\n * Configures the queries that will be injected into the directive.\n *\n * Content queries are set before the `ngAfterContentInit` callback is called.\n * View queries are set before the `ngAfterViewInit` callback is called.\n *\n * @usageNotes\n *\n * ### Example\n *\n * The following example shows how queries are defined\n * and when their results are available in lifecycle hooks:\n *\n * ```\n * @Component({\n * selector: 'someDir',\n * queries: {\n * contentChildren: new ContentChildren(ChildDirective),\n * viewChildren: new ViewChildren(ChildDirective)\n * },\n * template: '<child-directive></child-directive>'\n * })\n * class SomeDir {\n * contentChildren: QueryList<ChildDirective>,\n * viewChildren: QueryList<ChildDirective>\n *\n * ngAfterContentInit() {\n * // contentChildren is set\n * }\n *\n * ngAfterViewInit() {\n * // viewChildren is set\n * }\n * }\n * ```\n *\n * @Annotation\n */\n queries?: {[key: string]: any};\n\n /**\n * Maps class properties to host element bindings for properties,\n * attributes, and events, using a set of key-value pairs.\n *\n * Angular automatically checks host property bindings during change detection.\n * If a binding changes, Angular updates the directive's host element.\n *\n * When the key is a property of the host element, the property value is\n * the propagated to the specified DOM property.\n *\n * When the key is a static attribute in the DOM, the attribute value\n * is propagated to the specified property in the host element.\n *\n * For event handling:\n * - The key is the DOM event that the directive listens to.\n * To listen to global events, add the target to the event name.\n * The target can be `window`, `document` or `body`.\n * - The value is the statement to execute when the event occurs. If the\n * statement evalueates to `false`, then `preventDefault` is applied on the DOM\n * event. A handler method can refer to the `$event` local variable.\n *\n */\n host?: {[key: string]: string};\n\n /**\n * If true, this directive/component will be skipped by the AOT compiler and so will always be\n * compiled using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\n/**\n * Type of the Directive metadata.\n *\n * @publicApi\n */\nexport const Directive: DirectiveDecorator = makeDecorator(\n 'Directive', (dir: Directive = {}) => dir, undefined, undefined,\n (type: Type<any>, meta: Directive) => SWITCH_COMPILE_DIRECTIVE(type, meta));\n\n/**\n * Component decorator interface\n *\n * @publicApi\n */\nexport interface ComponentDecorator {\n /**\n * Decorator that marks a class as an Angular component and provides configuration\n * metadata that determines how the component should be processed,\n * instantiated, and used at runtime.\n *\n * Components are the most basic UI building block of an Angular app.\n * An Angular app contains a tree of Angular components.\n *\n * Angular components are a subset of directives, always associated with a template.\n * Unlike other directives, only one component can be instantiated per an element in a template.\n *\n * A component must belong to an NgModule in order for it to be available\n * to another component or application. To make it a member of an NgModule,\n * list it in the `declarations` field of the `NgModule` metadata.\n *\n * Note that, in addition to these options for configuring a directive,\n * you can control a component's runtime behavior by implementing\n * life-cycle hooks. For more information, see the\n * [Lifecycle Hooks](guide/lifecycle-hooks) guide.\n *\n * @usageNotes\n *\n * ### Setting component inputs\n *\n * The following example creates a component with two data-bound properties,\n * specified by the `inputs` value.\n *\n * <code-example path=\"core/ts/metadata/directives.ts\" region=\"component-input\">\n * </code-example>\n *\n *\n * ### Setting component outputs\n *\n * The following example shows two event emitters that emit on an interval. One\n * emits an output every second, while the other emits every five seconds.\n *\n * {@example core/ts/metadata/directives.ts region='component-output-interval'}\n *\n * ### Injecting a class with a view provider\n *\n * The following simple example injects a class into a component\n * using the view provider specified in component metadata:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @Directive({\n * selector: 'needs-greeter'\n * })\n * class NeedsGreeter {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n *\n * @Component({\n * selector: 'greet',\n * viewProviders: [\n * Greeter\n * ],\n * template: `<needs-greeter></needs-greeter>`\n * })\n * class HelloWorld {\n * }\n *\n * ```\n *\n * ### Preserving whitespace\n *\n * Removing whitespace can greatly reduce AOT-generated code size and speed up view creation.\n * As of Angular 6, the default for `preserveWhitespaces` is false (whitespace is removed).\n * To change the default setting for all components in your application, set\n * the `preserveWhitespaces` option of the AOT compiler.\n *\n * By default, the AOT compiler removes whitespace characters as follows:\n * * Trims all whitespaces at the beginning and the end of a template.\n * * Removes whitespace-only text nodes. For example,\n *\n * ```\n * <button>Action 1</button> <button>Action 2</button>\n * ```\n *\n * becomes:\n *\n * ```\n * <button>Action 1</button><button>Action 2</button>\n * ```\n *\n * * Replaces a series of whitespace characters in text nodes with a single space.\n * For example, `<span>\\n some text\\n</span>` becomes `<span> some text </span>`.\n * * Does NOT alter text nodes inside HTML tags such as `<pre>` or `<textarea>`,\n * where whitespace characters are significant.\n *\n * Note that these transformations can influence DOM nodes layout, although impact\n * should be minimal.\n *\n * You can override the default behavior to preserve whitespace characters\n * in certain fragments of a template. For example, you can exclude an entire\n * DOM sub-tree by using the `ngPreserveWhitespaces` attribute:\n *\n * ```html\n * <div ngPreserveWhitespaces>\n * whitespaces are preserved here\n * <span> and here </span>\n * </div>\n * ```\n *\n * You can force a single space to be preserved in a text node by using `&ngsp;`,\n * which is replaced with a space character by Angular's template\n * compiler:\n *\n * ```html\n * <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * Note that sequences of `&ngsp;` are still collapsed to just one space character when\n * the `preserveWhitespaces` option is set to `false`.\n *\n * ```html\n * <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>\n * <!-->compiled to be equivalent to:</>\n * <a>Spaces</a> <a>between</a> <a>links.</a>\n * ```\n *\n * To preserve sequences of whitespace characters, use the\n * `ngPreserveWhitespaces` attribute.\n *\n * @Annotation\n */\n (obj: Component): TypeDecorator;\n /**\n * See the `Component` decorator.\n */\n new (obj: Component): Component;\n}\n\n/**\n * Supplies configuration metadata for an Angular component.\n *\n * @publicApi\n */\nexport interface Component extends Directive {\n /**\n * The change-detection strategy to use for this component.\n *\n * When a component is instantiated, Angular creates a change detector,\n * which is responsible for propagating the component's bindings.\n * The strategy is one of:\n * - `ChangeDetectionStrategy#OnPush` sets the strategy to `CheckOnce` (on demand).\n * - `ChangeDetectionStrategy#Default` sets the strategy to `CheckAlways`.\n */\n changeDetection?: ChangeDetectionStrategy;\n\n /**\n * Defines the set of injectable objects that are visible to its view DOM children.\n * See [example](#injecting-a-class-with-a-view-provider).\n *\n */\n viewProviders?: Provider[];\n\n /**\n * The module ID of the module that contains the component.\n * The component must be able to resolve relative URLs for templates and styles.\n * SystemJS exposes the `__moduleName` variable within each module.\n * In CommonJS, this can be set to `module.id`.\n *\n */\n moduleId?: string;\n\n /**\n * The relative path or absolute URL of a template file for an Angular component.\n * If provided, do not supply an inline template using `template`.\n *\n */\n templateUrl?: string;\n\n /**\n * An inline template for an Angular component. If provided,\n * do not supply a template file using `templateUrl`.\n *\n */\n template?: string;\n\n /**\n * One or more relative paths or absolute URLs for files containing CSS stylesheets to use\n * in this component.\n */\n styleUrls?: string[];\n\n /**\n * One or more inline CSS stylesheets to use\n * in this component.\n */\n styles?: string[];\n\n /**\n * One or more animation `trigger()` calls, containing\n * `state()` and `transition()` definitions.\n * See the [Animations guide](/guide/animations) and animations API documentation.\n *\n */\n animations?: any[];\n\n /**\n * An encapsulation policy for the template and CSS styles. One of:\n * - `ViewEncapsulation.Native`: Use shadow roots. This works\n * only if natively available on the platform.\n * - `ViewEncapsulation.Emulated`: Use shimmed CSS that\n * emulates the native behavior.\n * - `ViewEncapsulation.None`: Use global CSS without any\n * encapsulation.\n *\n * If not supplied, the value is taken from `CompilerOptions`. The default compiler option is\n * `ViewEncapsulation.Emulated`.\n *\n * If the policy is set to `ViewEncapsulation.Emulated` and the component has no `styles`\n * or `styleUrls` specified, the policy is automatically switched to `ViewEncapsulation.None`.\n */\n encapsulation?: ViewEncapsulation;\n\n /**\n * Overrides the default encapsulation start and end delimiters (`{{` and `}}`)\n */\n interpolation?: [string, string];\n\n /**\n * A set of components that should be compiled along with\n * this component. For each component listed here,\n * Angular creates a {@link ComponentFactory} and stores it in the\n * {@link ComponentFactoryResolver}.\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * True to preserve or false to remove potentially superfluous whitespace characters\n * from the compiled template. Whitespace characters are those matching the `\\s`\n * character class in JavaScript regular expressions. Default is false, unless\n * overridden in compiler options.\n */\n preserveWhitespaces?: boolean;\n}\n\n/**\n * Component decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Component: ComponentDecorator = makeDecorator(\n 'Component', (c: Component = {}) => ({changeDetection: ChangeDetectionStrategy.Default, ...c}),\n Directive, undefined,\n (type: Type<any>, meta: Component) => SWITCH_COMPILE_COMPONENT(type, meta));\n\n/**\n * Type of the Pipe decorator / constructor function.\n *\n * @publicApi\n */\nexport interface PipeDecorator {\n /**\n *\n * Decorator that marks a class as pipe and supplies configuration metadata.\n *\n * A pipe class must implement the `PipeTransform` interface.\n * For example, if the name is \"myPipe\", use a template binding expression\n * such as the following:\n *\n * ```\n * {{ exp | myPipe }}\n * ```\n *\n * The result of the expression is passed to the pipe's `transform()` method.\n *\n * A pipe must belong to an NgModule in order for it to be available\n * to a template. To make it a member of an NgModule,\n * list it in the `declarations` field of the `NgModule` metadata.\n *\n */\n (obj: Pipe): TypeDecorator;\n\n /**\n * See the `Pipe` decorator.\n */\n new (obj: Pipe): Pipe;\n}\n\n/**\n * Type of the Pipe metadata.\n *\n * @publicApi\n */\nexport interface Pipe {\n /**\n * The pipe name to use in template bindings.\n *\n */\n name: string;\n\n /**\n * When true, the pipe is pure, meaning that the\n * `transform()` method is invoked only when its input arguments\n * change. Pipes are pure by default.\n *\n * If the pipe has internal state (that is, the result\n * depends on state other than its arguments), set `pure` to false.\n * In this case, the pipe is invoked on each change-detection cycle,\n * even if the arguments have not changed.\n */\n pure?: boolean;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Pipe: PipeDecorator = makeDecorator(\n 'Pipe', (p: Pipe) => ({pure: true, ...p}), undefined, undefined,\n (type: Type<any>, meta: Pipe) => SWITCH_COMPILE_PIPE(type, meta));\n\n\n/**\n * @publicApi\n */\nexport interface InputDecorator {\n /**\n * Decorator that marks a class field as an input property and supplies configuration metadata.\n * The input property is bound to a DOM property in the template. During change detection,\n * Angular automatically updates the data property with the DOM property's value.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for input binding.\n *\n * The following example creates a component with two input properties,\n * one of which is given a special binding name.\n *\n * ```typescript\n * @Component({\n * selector: 'bank-account',\n * template: `\n * Bank Name: {{bankName}}\n * Account Id: {{id}}\n * `\n * })\n * class BankAccount {\n * // This property is bound using its original name.\n * @Input() bankName: string;\n * // this property value is bound to a different property name\n * // when this component is instantiated in a template.\n * @Input('account-id') id: string;\n *\n * // this property is not bound, and is not automatically updated by Angular\n * normalizedBankName: string;\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `\n * <bank-account bankName=\"RBC\" account-id=\"4747\"></bank-account>\n * `\n * })\n * class App {}\n * ```\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of metadata for an `Input` property.\n *\n * @publicApi\n */\nexport interface Input {\n /**\n * The name of the DOM property to which the input property is bound.\n */\n bindingPropertyName?: string;\n}\n\nconst initializeBaseDef = (target: any): void => {\n const constructor = target.constructor;\n const inheritedBaseDef = constructor.ngBaseDef;\n\n const baseDef = constructor.ngBaseDef = {\n inputs: {},\n outputs: {},\n declaredInputs: {},\n };\n\n if (inheritedBaseDef) {\n fillProperties(baseDef.inputs, inheritedBaseDef.inputs);\n fillProperties(baseDef.outputs, inheritedBaseDef.outputs);\n fillProperties(baseDef.declaredInputs, inheritedBaseDef.declaredInputs);\n }\n};\n\n/**\n * Does the work of creating the `ngBaseDef` property for the `Input` and `Output` decorators.\n * @param key \"inputs\" or \"outputs\"\n */\nconst updateBaseDefFromIOProp = (getProp: (baseDef: {inputs?: any, outputs?: any}) => any) =>\n (target: any, name: string, ...args: any[]) => {\n const constructor = target.constructor;\n\n if (!constructor.hasOwnProperty(NG_BASE_DEF)) {\n initializeBaseDef(target);\n }\n\n const baseDef = constructor.ngBaseDef;\n const defProp = getProp(baseDef);\n defProp[name] = args[0];\n };\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Input: InputDecorator = makePropDecorator(\n 'Input', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined,\n updateBaseDefFromIOProp(baseDef => baseDef.inputs || {}));\n\n/**\n * Type of the Output decorator / constructor function.\n *\n * @publicApi\n */\nexport interface OutputDecorator {\n /**\n * Decorator that marks a class field as an output property and supplies configuration metadata.\n * The DOM property bound to the output property is automatically updated during change detection.\n *\n * @usageNotes\n *\n * You can supply an optional name to use in templates when the\n * component is instantiated, that maps to the\n * name of the bound property. By default, the original\n * name of the bound property is used for output binding.\n *\n * See `Input` decorator for an example of providing a binding name.\n *\n */\n (bindingPropertyName?: string): any;\n new (bindingPropertyName?: string): any;\n}\n\n/**\n * Type of the Output metadata.\n *\n * @publicApi\n */\nexport interface Output {\n /**\n * The name of the DOM property to which the output property is bound.\n */\n bindingPropertyName?: string;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const Output: OutputDecorator = makePropDecorator(\n 'Output', (bindingPropertyName?: string) => ({bindingPropertyName}), undefined,\n updateBaseDefFromIOProp(baseDef => baseDef.outputs || {}));\n\n\n\n/**\n * Type of the HostBinding decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostBindingDecorator {\n /**\n * Decorator that marks a DOM property as a host-binding property and supplies configuration\n * metadata.\n * Angular automatically checks host property bindings during change detection, and\n * if a binding changes it updates the host element of the directive.\n *\n * @usageNotes\n *\n * The following example creates a directive that sets the `valid` and `invalid`\n * properties on the DOM element that has an `ngModel` directive on it.\n *\n * ```typescript\n * @Directive({selector: '[ngModel]'})\n * class NgModelStatus {\n * constructor(public control: NgModel) {}\n * @HostBinding('class.valid') get valid() { return this.control.valid; }\n * @HostBinding('class.invalid') get invalid() { return this.control.invalid; }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: `<input [(ngModel)]=\"prop\">`,\n * })\n * class App {\n * prop;\n * }\n * ```\n *\n */\n (hostPropertyName?: string): any;\n new (hostPropertyName?: string): any;\n}\n\n/**\n * Type of the HostBinding metadata.\n *\n * @publicApi\n */\nexport interface HostBinding {\n /**\n * The DOM property that is bound to a data property.\n */\n hostPropertyName?: string;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const HostBinding: HostBindingDecorator =\n makePropDecorator('HostBinding', (hostPropertyName?: string) => ({hostPropertyName}));\n\n\n/**\n * Type of the HostListener decorator / constructor function.\n *\n * @publicApi\n */\nexport interface HostListenerDecorator {\n /**\n * Decorator that declares a DOM event to listen for,\n * and provides a handler method to run when that event occurs.\n */\n (eventName: string, args?: string[]): any;\n new (eventName: string, args?: string[]): any;\n}\n\n/**\n * Type of the HostListener metadata.\n *\n * @publicApi\n */\nexport interface HostListener {\n /**\n * The CSS event to listen for.\n */\n eventName?: string;\n /**\n * A set of arguments to pass to the handler method when the event occurs.\n */\n args?: string[];\n}\n\n/**\n * Binds a CSS event to a host listener and supplies configuration metadata.\n * Angular invokes the supplied handler method when the host element emits the specified event,\n * and updates the bound element with the result.\n * If the handler method returns false, applies `preventDefault` on the bound element.\n *\n * @usageNotes\n *\n * The following example declares a directive\n * that attaches a click listener to a button and counts clicks.\n *\n * ```\n * @Directive({selector: 'button[counting]'})\n * class CountClicks {\n * numberOfClicks = 0;\n *\n * @HostListener('click', ['$event.target'])\n * onClick(btn) {\n * console.log('button', btn, 'number of clicks:', this.numberOfClicks++);\n * }\n * }\n *\n * @Component({\n * selector: 'app',\n * template: '<button counting>Increment</button>',\n * })\n * class App {}\n * ```\n *\n * @Annotation\n * @publicApi\n */\nexport const HostListener: HostListenerDecorator =\n makePropDecorator('HostListener', (eventName?: string, args?: string[]) => ({eventName, args}));\n\n\n\nexport const SWITCH_COMPILE_COMPONENT__POST_R3__ = render3CompileComponent;\nexport const SWITCH_COMPILE_DIRECTIVE__POST_R3__ = render3CompileDirective;\nexport const SWITCH_COMPILE_PIPE__POST_R3__ = render3CompilePipe;\n\nconst SWITCH_COMPILE_COMPONENT__PRE_R3__ = noop;\nconst SWITCH_COMPILE_DIRECTIVE__PRE_R3__ = noop;\nconst SWITCH_COMPILE_PIPE__PRE_R3__ = noop;\n\nconst SWITCH_COMPILE_COMPONENT: typeof render3CompileComponent = SWITCH_COMPILE_COMPONENT__PRE_R3__;\nconst SWITCH_COMPILE_DIRECTIVE: typeof render3CompileDirective = SWITCH_COMPILE_DIRECTIVE__PRE_R3__;\nconst SWITCH_COMPILE_PIPE: typeof render3CompilePipe = SWITCH_COMPILE_PIPE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ReflectionCapabilities} from '../reflection/reflection_capabilities';\nimport {Type} from '../type';\nimport {getClosureSafeProperty} from '../util/property';\n\nimport {inject, injectArgs} from './injector_compatibility';\nimport {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueProvider, ValueSansProvider} from './provider';\n\nconst USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\nconst EMPTY_ARRAY: any[] = [];\n\nexport function convertInjectableProviderToFactory(\n type: Type<any>, provider?: ValueSansProvider | ExistingSansProvider | StaticClassSansProvider |\n ConstructorSansProvider | FactorySansProvider | ClassSansProvider): () => any {\n if (!provider) {\n const reflectionCapabilities = new ReflectionCapabilities();\n const deps = reflectionCapabilities.parameters(type);\n // TODO - convert to flags.\n return () => new type(...injectArgs(deps as any[]));\n }\n\n if (USE_VALUE in provider) {\n const valueProvider = (provider as ValueSansProvider);\n return () => valueProvider.useValue;\n } else if ((provider as ExistingSansProvider).useExisting) {\n const existingProvider = (provider as ExistingSansProvider);\n return () => inject(existingProvider.useExisting);\n } else if ((provider as FactorySansProvider).useFactory) {\n const factoryProvider = (provider as FactorySansProvider);\n return () => factoryProvider.useFactory(...injectArgs(factoryProvider.deps || EMPTY_ARRAY));\n } else if ((provider as StaticClassSansProvider | ClassSansProvider).useClass) {\n const classProvider = (provider as StaticClassSansProvider | ClassSansProvider);\n let deps = (provider as StaticClassSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new classProvider.useClass(...injectArgs(deps));\n } else {\n let deps = (provider as ConstructorSansProvider).deps;\n if (!deps) {\n const reflectionCapabilities = new ReflectionCapabilities();\n deps = reflectionCapabilities.parameters(type);\n }\n return () => new type(...injectArgs(deps !));\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {InjectorType, defineInjector} from '../di/defs';\nimport {Provider} from '../di/provider';\nimport {convertInjectableProviderToFactory} from '../di/util';\nimport {NgModuleType} from '../render3';\nimport {compileNgModule as render3CompileNgModule} from '../render3/jit/module';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator} from '../util/decorators';\n\n/**\n * Represents the expansion of an `NgModule` into its scopes.\n *\n * A scope is a set of directives and pipes that are visible in a particular context. Each\n * `NgModule` has two scopes. The `compilation` scope is the set of directives and pipes that will\n * be recognized in the templates of components declared by the module. The `exported` scope is the\n * set of directives and pipes exported by a module (that is, module B's exported scope gets added\n * to module A's compilation scope when module A imports B).\n */\nexport interface NgModuleTransitiveScopes {\n compilation: {directives: Set<any>; pipes: Set<any>;};\n exported: {directives: Set<any>; pipes: Set<any>;};\n}\n\nexport type NgModuleDefWithMeta<T, Declarations, Imports, Exports> = NgModuleDef<T>;\n\n/**\n * Runtime link information for NgModules.\n *\n * This is the internal data structure used by the runtime to assemble components, directives,\n * pipes, and injectors.\n *\n * NOTE: Always use `defineNgModule` function to create this object,\n * never create the object directly since the shape of this object\n * can change between versions.\n */\nexport interface NgModuleDef<T> {\n /** Token representing the module. Used by DI. */\n type: T;\n\n /** List of components to bootstrap. */\n bootstrap: Type<any>[];\n\n /** List of components, directives, and pipes declared by this module. */\n declarations: Type<any>[];\n\n /** List of modules or `ModuleWithProviders` imported by this module. */\n imports: Type<any>[];\n\n /**\n * List of modules, `ModuleWithProviders`, components, directives, or pipes exported by this\n * module.\n */\n exports: Type<any>[];\n\n /**\n * Cached value of computed `transitiveCompileScopes` for this module.\n *\n * This should never be read directly, but accessed via `transitiveScopesFor`.\n */\n transitiveCompileScopes: NgModuleTransitiveScopes|null;\n}\n\n/**\n * A wrapper around an NgModule that associates it with the providers.\n *\n * @param T the module type. In Ivy applications, this must be explicitly\n * provided.\n *\n * @publicApi\n */\nexport interface ModuleWithProviders<\n T = any /** TODO(alxhub): remove default when callers pass explicit type param */> {\n ngModule: Type<T>;\n providers?: Provider[];\n}\n\n/**\n * A schema definition associated with an NgModule.\n *\n * @see `@NgModule`, `CUSTOM_ELEMENTS_SCHEMA`, `NO_ERRORS_SCHEMA`\n *\n * @param name The name of a defined schema.\n *\n * @publicApi\n */\nexport interface SchemaMetadata { name: string; }\n\n/**\n * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nexport const CUSTOM_ELEMENTS_SCHEMA: SchemaMetadata = {\n name: 'custom-elements'\n};\n\n/**\n * Defines a schema that allows any property on any element.\n *\n * @publicApi\n */\nexport const NO_ERRORS_SCHEMA: SchemaMetadata = {\n name: 'no-errors-schema'\n};\n\n\n/**\n * Type of the NgModule decorator / constructor function.\n *\n * @publicApi\n */\nexport interface NgModuleDecorator {\n /**\n * Decorator that marks a class as an NgModule and supplies configuration metadata.\n */\n (obj?: NgModule): TypeDecorator;\n new (obj?: NgModule): NgModule;\n}\n\n/**\n * Type of the NgModule metadata.\n *\n * @publicApi\n */\nexport interface NgModule {\n /**\n * The set of injectable objects that are available in the injector\n * of this module.\n *\n * @see [Dependency Injection guide](guide/dependency-injection)\n * @see [NgModule guide](guide/providers)\n *\n * @usageNotes\n *\n * Dependencies whose providers are listed here become available for injection\n * into any component, directive, pipe or service that is a child of this injector.\n * The NgModule used for bootstrapping uses the root injector, and can provide dependencies\n * to any part of the app.\n *\n * A lazy-loaded module has its own injector, typically a child of the app root injector.\n * Lazy-loaded services are scoped to the lazy-loaded module's injector.\n * If a lazy-loaded module also provides the `UserService`, any component created\n * within that module's context (such as by router navigation) gets the local instance\n * of the service, not the instance in the root injector.\n * Components in external modules continue to receive the instance provided by their injectors.\n *\n * ### Example\n *\n * The following example defines a class that is injected in\n * the HelloWorld NgModule:\n *\n * ```\n * class Greeter {\n * greet(name:string) {\n * return 'Hello ' + name + '!';\n * }\n * }\n *\n * @NgModule({\n * providers: [\n * Greeter\n * ]\n * })\n * class HelloWorld {\n * greeter:Greeter;\n *\n * constructor(greeter:Greeter) {\n * this.greeter = greeter;\n * }\n * }\n * ```\n */\n providers?: Provider[];\n\n /**\n * The set of components, directives, and pipes ([declarables](guide/glossary#declarable))\n * that belong to this module.\n *\n * @usageNotes\n *\n * The set of selectors that are available to a template include those declared here, and\n * those that are exported from imported NgModules.\n *\n * Declarables must belong to exactly one module.\n * The compiler emits an error if you try to declare the same class in more than one module.\n * Be careful not to declare a class that is imported from another module.\n *\n * ### Example\n *\n * The following example allows the CommonModule to use the `NgFor`\n * directive.\n *\n * ```javascript\n * @NgModule({\n * declarations: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n declarations?: Array<Type<any>|any[]>;\n\n /**\n * The set of NgModules whose exported [declarables](guide/glossary#declarable)\n * are available to templates in this module.\n *\n * @usageNotes\n *\n * A template can use exported declarables from any\n * imported module, including those from modules that are imported indirectly\n * and re-exported.\n * For example, `ModuleA` imports `ModuleB`, and also exports\n * it, which makes the declarables from `ModuleB` available\n * wherever `ModuleA` is imported.\n *\n * ### Example\n *\n * The following example allows MainModule to use anthing exported by\n * `CommonModule`:\n *\n * ```javascript\n * @NgModule({\n * imports: [CommonModule]\n * })\n * class MainModule {\n * }\n * ```\n *\n */\n imports?: Array<Type<any>|ModuleWithProviders<{}>|any[]>;\n\n /**\n * The set of components, directives, and pipes declared in this\n * NgModule that can be used in the template of any component that is part of an\n * NgModule that imports this NgModule. Exported declarations are the module's public API.\n *\n * A declarable belongs to one and only one NgModule.\n * A module can list another module among its exports, in which case all of that module's\n * public declaration are exported.\n *\n * @usageNotes\n *\n * Declarations are private by default.\n * If this ModuleA does not export UserComponent, then only the components within this\n * ModuleA can use UserComponent.\n *\n * ModuleA can import ModuleB and also export it, making exports from ModuleB\n * available to an NgModule that imports ModuleA.\n *\n * ### Example\n *\n * The following example exports the `NgFor` directive from CommonModule.\n *\n * ```javascript\n * @NgModule({\n * exports: [NgFor]\n * })\n * class CommonModule {\n * }\n * ```\n */\n exports?: Array<Type<any>|any[]>;\n\n /**\n * The set of components to compile when this NgModule is defined,\n * so that they can be dynamically loaded into the view.\n *\n * For each component listed here, Angular creates a `ComponentFactory`\n * and stores it in the `ComponentFactoryResolver`.\n *\n * Angular automatically adds components in the module's bootstrap\n * and route definitions into the `entryComponents` list. Use this\n * option to add components that are bootstrapped\n * using one of the imperative techniques, such as `ViewContainerRef.createComponent()`.\n *\n * @see [Entry Components](guide/entry-components)\n */\n entryComponents?: Array<Type<any>|any[]>;\n\n /**\n * The set of components that are bootstrapped when\n * this module is bootstrapped. The components listed here\n * are automatically added to `entryComponents`.\n */\n bootstrap?: Array<Type<any>|any[]>;\n\n /**\n * The set of schemas that declare elements to be allowed in the NgModule.\n * Elements and properties that are neither Angular components nor directives\n * must be declared in a schema.\n *\n * Allowed value are `NO_ERRORS_SCHEMA` and `CUSTOM_ELEMENTS_SCHEMA`.\n *\n * @security When using one of `NO_ERRORS_SCHEMA` or `CUSTOM_ELEMENTS_SCHEMA`\n * you must ensure that allowed elements and properties securely escape inputs.\n */\n schemas?: Array<SchemaMetadata|any[]>;\n\n /**\n * A name or path that uniquely identifies this NgModule in `getModuleFactory`.\n * If left `undefined`, the NgModule is not registered with\n * `getModuleFactory`.\n */\n id?: string;\n\n /**\n * If true, this module will be skipped by the AOT compiler and so will always be compiled\n * using JIT.\n *\n * This exists to support future Ivy work and has no effect currently.\n */\n jit?: true;\n}\n\n/**\n * @Annotation\n * @publicApi\n */\nexport const NgModule: NgModuleDecorator = makeDecorator(\n 'NgModule', (ngModule: NgModule) => ngModule, undefined, undefined,\n /**\n * Decorator that marks the following class as an NgModule, and supplies\n * configuration metadata for it.\n *\n * * The `declarations` and `entryComponents` options configure the compiler\n * with information about what belongs to the NgModule.\n * * The `providers` options configures the NgModule's injector to provide\n * dependencies the NgModule members.\n * * The `imports` and `exports` options bring in members from other modules, and make\n * this module's members available to others.\n */\n (type: NgModuleType, meta: NgModule) => SWITCH_COMPILE_NGMODULE(type, meta));\n\n/**\n * @description\n * Hook for manual bootstrapping of the application instead of using bootstrap array in @NgModule\n * annotation.\n *\n * Reference to the current application is provided as a parameter.\n *\n * See [\"Bootstrapping\"](guide/bootstrapping) and [\"Entry components\"](guide/entry-components).\n *\n * @usageNotes\n * ```typescript\n * class AppModule implements DoBootstrap {\n * ngDoBootstrap(appRef: ApplicationRef) {\n * appRef.bootstrap(AppComponent); // Or some other component\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport interface DoBootstrap { ngDoBootstrap(appRef: ApplicationRef): void; }\n\nfunction preR3NgModuleCompile(moduleType: InjectorType<any>, metadata: NgModule): void {\n let imports = (metadata && metadata.imports) || [];\n if (metadata && metadata.exports) {\n imports = [...imports, metadata.exports];\n }\n\n moduleType.ngInjectorDef = defineInjector({\n factory: convertInjectableProviderToFactory(moduleType, {useClass: moduleType}),\n providers: metadata && metadata.providers,\n imports: imports,\n });\n}\n\n\nexport const SWITCH_COMPILE_NGMODULE__POST_R3__ = render3CompileNgModule;\nconst SWITCH_COMPILE_NGMODULE__PRE_R3__ = preR3NgModuleCompile;\nconst SWITCH_COMPILE_NGMODULE: typeof render3CompileNgModule = SWITCH_COMPILE_NGMODULE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * This indirection is needed to free up Component, etc symbols in the public API\n * to be used by the decorator versions of these annotations.\n */\n\nimport {Attribute, ContentChild, ContentChildren, Query, ViewChild, ViewChildren} from './metadata/di';\nimport {Component, Directive, HostBinding, HostListener, Input, Output, Pipe} from './metadata/directives';\nimport {DoBootstrap, ModuleWithProviders, NgModule, SchemaMetadata} from './metadata/ng_module';\nimport {ViewEncapsulation} from './metadata/view';\n\nexport {ANALYZE_FOR_ENTRY_COMPONENTS, Attribute, ContentChild, ContentChildDecorator, ContentChildren, ContentChildrenDecorator, Query, ViewChild, ViewChildDecorator, ViewChildren, ViewChildrenDecorator} from './metadata/di';\nexport {Component, ComponentDecorator, Directive, DirectiveDecorator, HostBinding, HostBindingDecorator, HostListener, HostListenerDecorator, Input, InputDecorator, Output, OutputDecorator, Pipe, PipeDecorator} from './metadata/directives';\nexport {AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, DoCheck, OnChanges, OnDestroy, OnInit} from './metadata/lifecycle_hooks';\nexport {CUSTOM_ELEMENTS_SCHEMA, DoBootstrap, ModuleWithProviders, NO_ERRORS_SCHEMA, NgModule, NgModuleDecorator, SchemaMetadata} from './metadata/ng_module';\nexport {ViewEncapsulation} from './metadata/view';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../../di/injectable';\nimport {ClassSansProvider, ExistingSansProvider, FactorySansProvider, ValueProvider, ValueSansProvider} from '../../di/provider';\nimport {Type} from '../../type';\nimport {getClosureSafeProperty} from '../../util/property';\nimport {NG_INJECTABLE_DEF} from '../fields';\n\nimport {R3InjectableMetadataFacade, getCompilerFacade} from './compiler_facade';\nimport {angularCoreEnv} from './environment';\nimport {convertDependencies, reflectDependencies} from './util';\n\n\n\n/**\n * Compile an Angular injectable according to its `Injectable` metadata, and patch the resulting\n * `ngInjectableDef` onto the injectable type.\n */\nexport function compileInjectable(type: Type<any>, srcMeta?: Injectable): void {\n let def: any = null;\n\n // if NG_INJECTABLE_DEF is already defined on this class then don't overwrite it\n if (type.hasOwnProperty(NG_INJECTABLE_DEF)) return;\n\n Object.defineProperty(type, NG_INJECTABLE_DEF, {\n get: () => {\n if (def === null) {\n // Allow the compilation of a class with a `@Injectable()` decorator without parameters\n const meta: Injectable = srcMeta || {providedIn: null};\n const hasAProvider = isUseClassProvider(meta) || isUseFactoryProvider(meta) ||\n isUseValueProvider(meta) || isUseExistingProvider(meta);\n\n\n const compilerMeta: R3InjectableMetadataFacade = {\n name: type.name,\n type: type,\n typeArgumentCount: 0,\n providedIn: meta.providedIn,\n ctorDeps: reflectDependencies(type),\n userDeps: undefined\n };\n if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) {\n compilerMeta.userDeps = convertDependencies(meta.deps);\n }\n if (!hasAProvider) {\n // In the case the user specifies a type provider, treat it as {provide: X, useClass: X}.\n // The deps will have been reflected above, causing the factory to create the class by\n // calling\n // its constructor with injected deps.\n compilerMeta.useClass = type;\n } else if (isUseClassProvider(meta)) {\n // The user explicitly specified useClass, and may or may not have provided deps.\n compilerMeta.useClass = meta.useClass;\n } else if (isUseValueProvider(meta)) {\n // The user explicitly specified useValue.\n compilerMeta.useValue = meta.useValue;\n } else if (isUseFactoryProvider(meta)) {\n // The user explicitly specified useFactory.\n compilerMeta.useFactory = meta.useFactory;\n } else if (isUseExistingProvider(meta)) {\n // The user explicitly specified useExisting.\n compilerMeta.useExisting = meta.useExisting;\n } else {\n // Can't happen - either hasAProvider will be false, or one of the providers will be set.\n throw new Error(`Unreachable state.`);\n }\n def = getCompilerFacade().compileInjectable(\n angularCoreEnv, `ng://${type.name}/ngInjectableDef.js`, compilerMeta);\n }\n return def;\n },\n });\n}\n\ntype UseClassProvider = Injectable & ClassSansProvider & {deps?: any[]};\n\nconst USE_VALUE =\n getClosureSafeProperty<ValueProvider>({provide: String, useValue: getClosureSafeProperty});\n\nfunction isUseClassProvider(meta: Injectable): meta is UseClassProvider {\n return (meta as UseClassProvider).useClass !== undefined;\n}\n\nfunction isUseValueProvider(meta: Injectable): meta is Injectable&ValueSansProvider {\n return USE_VALUE in meta;\n}\n\nfunction isUseFactoryProvider(meta: Injectable): meta is Injectable&FactorySansProvider {\n return (meta as FactorySansProvider).useFactory !== undefined;\n}\n\nfunction isUseExistingProvider(meta: Injectable): meta is Injectable&ExistingSansProvider {\n return (meta as ExistingSansProvider).useExisting !== undefined;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {compileInjectable as render3CompileInjectable} from '../render3/jit/injectable';\nimport {Type} from '../type';\nimport {TypeDecorator, makeDecorator} from '../util/decorators';\n\nimport {InjectableDef, InjectableType, defineInjectable, getInjectableDef} from './defs';\nimport {ClassSansProvider, ConstructorSansProvider, ExistingSansProvider, FactorySansProvider, StaticClassSansProvider, ValueSansProvider} from './provider';\nimport {convertInjectableProviderToFactory} from './util';\n\n\n/**\n * Injectable providers used in `@Injectable` decorator.\n *\n * @publicApi\n */\nexport type InjectableProvider = ValueSansProvider | ExistingSansProvider |\n StaticClassSansProvider | ConstructorSansProvider | FactorySansProvider | ClassSansProvider;\n\n/**\n * Type of the Injectable decorator / constructor function.\n *\n * @publicApi\n */\nexport interface InjectableDecorator {\n /**\n * Marks a class as available to `Injector` for creation.\n *\n * @see [Introduction to Services and DI](guide/architecture-services)\n * @see [Dependency Injection Guide](guide/dependency-injection)\n *\n * @usageNotes\n *\n * The following example shows how service classes are properly marked as\n * injectable.\n *\n * {@example core/di/ts/metadata_spec.ts region='Injectable'}\n *\n * `Injector` throws an error if it tries to instantiate a class that\n * is not decorated with `@Injectable`, as shown in the following example.\n *\n * {@example core/di/ts/metadata_spec.ts region='InjectableThrows'}\n *\n */\n (): TypeDecorator;\n (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): TypeDecorator;\n new (): Injectable;\n new (options?: {providedIn: Type<any>| 'root' | null}&InjectableProvider): Injectable;\n}\n\n/**\n * Type of the Injectable metadata.\n *\n * @publicApi\n */\nexport interface Injectable {\n /**\n * Determines which injectors will provide the injectable,\n * by either associating it with an @NgModule or other `InjectorType`,\n * or by specifying that this injectable should be provided in the\n * 'root' injector, which will be the application-level injector in most apps.\n */\n providedIn?: Type<any>|'root'|null;\n}\n\n/**\n * Injectable decorator and metadata.\n *\n * @Annotation\n * @publicApi\n */\nexport const Injectable: InjectableDecorator = makeDecorator(\n 'Injectable', undefined, undefined, undefined,\n (type: Type<any>, meta: Injectable) => SWITCH_COMPILE_INJECTABLE(type as any, meta));\n\n/**\n * Type representing injectable service.\n *\n * @publicApi\n */\nexport interface InjectableType<T> extends Type<T> { ngInjectableDef: InjectableDef<T>; }\n\n/**\n * Supports @Injectable() in JIT mode for Render2.\n */\nfunction render2CompileInjectable(\n injectableType: InjectableType<any>,\n options: {providedIn?: Type<any>| 'root' | null} & InjectableProvider): void {\n if (options && options.providedIn !== undefined && !getInjectableDef(injectableType)) {\n injectableType.ngInjectableDef = defineInjectable({\n providedIn: options.providedIn,\n factory: convertInjectableProviderToFactory(injectableType, options),\n });\n }\n}\n\nexport const SWITCH_COMPILE_INJECTABLE__POST_R3__ = render3CompileInjectable;\nconst SWITCH_COMPILE_INJECTABLE__PRE_R3__ = render2CompileInjectable;\nconst SWITCH_COMPILE_INJECTABLE: typeof render3CompileInjectable =\n SWITCH_COMPILE_INJECTABLE__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DebugContext} from './view';\n\nexport const ERROR_TYPE = 'ngType';\nexport const ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nexport const ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nexport const ERROR_LOGGER = 'ngErrorLogger';\n\n\nexport function getType(error: Error): Function {\n return (error as any)[ERROR_TYPE];\n}\n\nexport function getDebugContext(error: Error): DebugContext {\n return (error as any)[ERROR_DEBUG_CONTEXT];\n}\n\nexport function getOriginalError(error: Error): Error {\n return (error as any)[ERROR_ORIGINAL_ERROR];\n}\n\nexport function getErrorLogger(error: Error): (console: Console, ...values: any[]) => void {\n return (error as any)[ERROR_LOGGER] || defaultErrorLogger;\n}\n\n\nfunction defaultErrorLogger(console: Console, ...values: any[]) {\n (<any>console.error)(...values);\n}","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_ORIGINAL_ERROR, getDebugContext, getErrorLogger, getOriginalError} from './errors';\n\n\n\n/**\n * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nexport class ErrorHandler {\n /**\n * @internal\n */\n _console: Console = console;\n\n handleError(error: any): void {\n const originalError = this._findOriginalError(error);\n const context = this._findContext(error);\n // Note: Browser consoles show the place from where console.error was called.\n // We can use this to give users additional information about the error.\n const errorLogger = getErrorLogger(error);\n\n errorLogger(this._console, `ERROR`, error);\n if (originalError) {\n errorLogger(this._console, `ORIGINAL ERROR`, originalError);\n }\n if (context) {\n errorLogger(this._console, 'ERROR CONTEXT', context);\n }\n }\n\n /** @internal */\n _findContext(error: any): any {\n if (error) {\n return getDebugContext(error) ? getDebugContext(error) :\n this._findContext(getOriginalError(error));\n }\n\n return null;\n }\n\n /** @internal */\n _findOriginalError(error: Error): any {\n let e = getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n\n return e;\n }\n}\n\nexport function wrappedError(message: string, originalError: any): Error {\n const msg =\n `${message} caused by: ${originalError instanceof Error ? originalError.message: originalError }`;\n const error = Error(msg);\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {wrappedError} from '../error_handler';\nimport {ERROR_ORIGINAL_ERROR, getOriginalError} from '../errors';\nimport {Type} from '../type';\nimport {stringify} from '../util';\n\nimport {ReflectiveInjector} from './reflective_injector';\nimport {ReflectiveKey} from './reflective_key';\n\nfunction findFirstClosedCycle(keys: any[]): any[] {\n const res: any[] = [];\n for (let i = 0; i < keys.length; ++i) {\n if (res.indexOf(keys[i]) > -1) {\n res.push(keys[i]);\n return res;\n }\n res.push(keys[i]);\n }\n return res;\n}\n\nfunction constructResolvingPath(keys: any[]): string {\n if (keys.length > 1) {\n const reversed = findFirstClosedCycle(keys.slice().reverse());\n const tokenStrs = reversed.map(k => stringify(k.token));\n return ' (' + tokenStrs.join(' -> ') + ')';\n }\n\n return '';\n}\n\nexport interface InjectionError extends Error {\n keys: ReflectiveKey[];\n injectors: ReflectiveInjector[];\n constructResolvingMessage: (keys: ReflectiveKey[]) => string;\n addKey(injector: ReflectiveInjector, key: ReflectiveKey): void;\n}\n\nfunction injectionError(\n injector: ReflectiveInjector, key: ReflectiveKey,\n constructResolvingMessage: (keys: ReflectiveKey[]) => string,\n originalError?: Error): InjectionError {\n const keys = [key];\n const errMsg = constructResolvingMessage(keys);\n const error =\n (originalError ? wrappedError(errMsg, originalError) : Error(errMsg)) as InjectionError;\n error.addKey = addKey;\n error.keys = keys;\n error.injectors = [injector];\n error.constructResolvingMessage = constructResolvingMessage;\n (error as any)[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\n}\n\nfunction addKey(this: InjectionError, injector: ReflectiveInjector, key: ReflectiveKey): void {\n this.injectors.push(injector);\n this.keys.push(key);\n // Note: This updated message won't be reflected in the `.stack` property\n this.message = this.constructResolvingMessage(this.keys);\n}\n\n/**\n * Thrown when trying to retrieve a dependency by key from {@link Injector}, but the\n * {@link Injector} does not have a {@link Provider} for the given key.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b:B) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n */\nexport function noProviderError(injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `No provider for ${first}!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when dependencies form a cycle.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * var injector = Injector.resolveAndCreate([\n * {provide: \"one\", useFactory: (two) => \"two\", deps: [[new Inject(\"two\")]]},\n * {provide: \"two\", useFactory: (one) => \"one\", deps: [[new Inject(\"one\")]]}\n * ]);\n *\n * expect(() => injector.get(\"one\")).toThrowError();\n * ```\n *\n * Retrieving `A` or `B` throws a `CyclicDependencyError` as the graph above cannot be constructed.\n */\nexport function cyclicDependencyError(\n injector: ReflectiveInjector, key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n return `Cannot instantiate cyclic dependency!${constructResolvingPath(keys)}`;\n });\n}\n\n/**\n * Thrown when a constructing type returns with an Error.\n *\n * The `InstantiationError` class contains the original error plus the dependency graph which caused\n * this object to be instantiated.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor() {\n * throw new Error('message');\n * }\n * }\n *\n * var injector = Injector.resolveAndCreate([A]);\n\n * try {\n * injector.get(A);\n * } catch (e) {\n * expect(e instanceof InstantiationError).toBe(true);\n * expect(e.originalException.message).toEqual(\"message\");\n * expect(e.originalStack).toBeDefined();\n * }\n * ```\n */\nexport function instantiationError(\n injector: ReflectiveInjector, originalException: any, originalStack: any,\n key: ReflectiveKey): InjectionError {\n return injectionError(injector, key, function(keys: ReflectiveKey[]) {\n const first = stringify(keys[0].token);\n return `${originalException.message}: Error during instantiation of ${first}!${constructResolvingPath(keys)}.`;\n }, originalException);\n}\n\n/**\n * Thrown when an object other then {@link Provider} (or `Type`) is passed to {@link Injector}\n * creation.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\"not a type\"])).toThrowError();\n * ```\n */\nexport function invalidProviderError(provider: any) {\n return Error(\n `Invalid provider - only instances of Provider and Type are allowed, got: ${provider}`);\n}\n\n/**\n * Thrown when the class has no annotation information.\n *\n * Lack of annotation information prevents the {@link Injector} from determining which dependencies\n * need to be injected into the constructor.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {\n * constructor(b) {}\n * }\n *\n * expect(() => Injector.resolveAndCreate([A])).toThrowError();\n * ```\n *\n * This error is also thrown when the class not marked with {@link Injectable} has parameter types.\n *\n * ```typescript\n * class B {}\n *\n * class A {\n * constructor(b:B) {} // no information about the parameter types of A is available at runtime.\n * }\n *\n * expect(() => Injector.resolveAndCreate([A,B])).toThrowError();\n * ```\n *\n */\nexport function noAnnotationError(typeOrFunc: Type<any>| Function, params: any[][]): Error {\n const signature: string[] = [];\n for (let i = 0, ii = params.length; i < ii; i++) {\n const parameter = params[i];\n if (!parameter || parameter.length == 0) {\n signature.push('?');\n } else {\n signature.push(parameter.map(stringify).join(' '));\n }\n }\n return Error(\n 'Cannot resolve all parameters for \\'' + stringify(typeOrFunc) + '\\'(' +\n signature.join(', ') + '). ' +\n 'Make sure that all the parameters are decorated with Inject or have valid type annotations and that \\'' +\n stringify(typeOrFunc) + '\\' is decorated with Injectable.');\n}\n\n/**\n * Thrown when getting an object by index.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class A {}\n *\n * var injector = Injector.resolveAndCreate([A]);\n *\n * expect(() => injector.getAt(100)).toThrowError();\n * ```\n *\n */\nexport function outOfBoundsError(index: number) {\n return Error(`Index ${index} is out-of-bounds.`);\n}\n\n// TODO: add a working example after alpha38 is released\n/**\n * Thrown when a multi provider and a regular provider are bound to the same token.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * expect(() => Injector.resolveAndCreate([\n * { provide: \"Strings\", useValue: \"string1\", multi: true},\n * { provide: \"Strings\", useValue: \"string2\", multi: false}\n * ])).toThrowError();\n * ```\n */\nexport function mixingMultiProvidersWithRegularProvidersError(\n provider1: any, provider2: any): Error {\n return Error(`Cannot mix multi providers and regular providers, got: ${provider1} ${provider2}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {stringify} from '../util';\nimport {resolveForwardRef} from './forward_ref';\n\n\n/**\n * A unique object used for retrieving items from the {@link ReflectiveInjector}.\n *\n * Keys have:\n * - a system-wide unique `id`.\n * - a `token`.\n *\n * `Key` is used internally by {@link ReflectiveInjector} because its system-wide unique `id` allows\n * the\n * injector to store created objects in a more efficient way.\n *\n * `Key` should not be created directly. {@link ReflectiveInjector} creates keys automatically when\n * resolving\n * providers.\n *\n * @deprecated No replacement\n * @publicApi\n */\nexport class ReflectiveKey {\n public readonly displayName: string;\n /**\n * Private\n */\n constructor(public token: Object, public id: number) {\n if (!token) {\n throw new Error('Token must be defined!');\n }\n this.displayName = stringify(this.token);\n }\n\n /**\n * Retrieves a `Key` for a token.\n */\n static get(token: Object): ReflectiveKey {\n return _globalKeyRegistry.get(resolveForwardRef(token));\n }\n\n /**\n * @returns the number of keys registered in the system.\n */\n static get numberOfKeys(): number { return _globalKeyRegistry.numberOfKeys; }\n}\n\nexport class KeyRegistry {\n private _allKeys = new Map<Object, ReflectiveKey>();\n\n get(token: Object): ReflectiveKey {\n if (token instanceof ReflectiveKey) return token;\n\n if (this._allKeys.has(token)) {\n return this._allKeys.get(token) !;\n }\n\n const newKey = new ReflectiveKey(token, ReflectiveKey.numberOfKeys);\n this._allKeys.set(token, newKey);\n return newKey;\n }\n\n get numberOfKeys(): number { return this._allKeys.size; }\n}\n\nconst _globalKeyRegistry = new KeyRegistry();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Type} from '../type';\nimport {PlatformReflectionCapabilities} from './platform_reflection_capabilities';\nimport {GetterFn, MethodFn, SetterFn} from './types';\n\nexport {PlatformReflectionCapabilities};\nexport {GetterFn, MethodFn, SetterFn};\n\n/**\n * Provides access to reflection data about symbols. Used internally by Angular\n * to power dependency injection and compilation.\n */\nexport class Reflector {\n constructor(public reflectionCapabilities: PlatformReflectionCapabilities) {}\n\n updateCapabilities(caps: PlatformReflectionCapabilities) { this.reflectionCapabilities = caps; }\n\n factory(type: Type<any>): Function { return this.reflectionCapabilities.factory(type); }\n\n parameters(typeOrFunc: Type<any>): any[][] {\n return this.reflectionCapabilities.parameters(typeOrFunc);\n }\n\n annotations(typeOrFunc: Type<any>): any[] {\n return this.reflectionCapabilities.annotations(typeOrFunc);\n }\n\n propMetadata(typeOrFunc: Type<any>): {[key: string]: any[]} {\n return this.reflectionCapabilities.propMetadata(typeOrFunc);\n }\n\n hasLifecycleHook(type: any, lcProperty: string): boolean {\n return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);\n }\n\n getter(name: string): GetterFn { return this.reflectionCapabilities.getter(name); }\n\n setter(name: string): SetterFn { return this.reflectionCapabilities.setter(name); }\n\n method(name: string): MethodFn { return this.reflectionCapabilities.method(name); }\n\n importUri(type: any): string { return this.reflectionCapabilities.importUri(type); }\n\n resourceUri(type: any): string { return this.reflectionCapabilities.resourceUri(type); }\n\n resolveIdentifier(name: string, moduleUrl: string, members: string[], runtime: any): any {\n return this.reflectionCapabilities.resolveIdentifier(name, moduleUrl, members, runtime);\n }\n\n resolveEnum(identifier: any, name: string): any {\n return this.reflectionCapabilities.resolveEnum(identifier, name);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ReflectionCapabilities} from './reflection_capabilities';\nimport {Reflector} from './reflector';\n\nexport {Reflector} from './reflector';\n\n/**\n * The {@link Reflector} used internally in Angular to access metadata\n * about symbols.\n */\nexport const reflector = new Reflector(new ReflectionCapabilities());\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {reflector} from '../reflection/reflection';\nimport {Type} from '../type';\n\nimport {resolveForwardRef} from './forward_ref';\nimport {InjectionToken} from './injection_token';\nimport {Inject, Optional, Self, SkipSelf} from './metadata';\nimport {ClassProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ValueProvider} from './provider';\nimport {invalidProviderError, mixingMultiProvidersWithRegularProvidersError, noAnnotationError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\n\n\ninterface NormalizedProvider extends TypeProvider, ValueProvider, ClassProvider, ExistingProvider,\n FactoryProvider {}\n\n/**\n * `Dependency` is used by the framework to extend DI.\n * This is internal to Angular and should not be used directly.\n */\nexport class ReflectiveDependency {\n constructor(\n public key: ReflectiveKey, public optional: boolean, public visibility: Self|SkipSelf|null) {}\n\n static fromKey(key: ReflectiveKey): ReflectiveDependency {\n return new ReflectiveDependency(key, false, null);\n }\n}\n\nconst _EMPTY_LIST: any[] = [];\n\n/**\n * An internal resolved representation of a `Provider` used by the `Injector`.\n *\n * @usageNotes\n * This is usually created automatically by `Injector.resolveAndCreate`.\n *\n * It can be created manually, as follows:\n *\n * ### Example\n *\n * ```typescript\n * var resolvedProviders = Injector.resolve([{ provide: 'message', useValue: 'Hello' }]);\n * var injector = Injector.fromResolvedProviders(resolvedProviders);\n *\n * expect(injector.get('message')).toEqual('Hello');\n * ```\n *\n * @publicApi\n */\nexport interface ResolvedReflectiveProvider {\n /**\n * A key, usually a `Type<any>`.\n */\n key: ReflectiveKey;\n\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n resolvedFactories: ResolvedReflectiveFactory[];\n\n /**\n * Indicates if the provider is a multi-provider or a regular provider.\n */\n multiProvider: boolean;\n}\n\nexport class ResolvedReflectiveProvider_ implements ResolvedReflectiveProvider {\n readonly resolvedFactory: ResolvedReflectiveFactory;\n\n constructor(\n public key: ReflectiveKey, public resolvedFactories: ResolvedReflectiveFactory[],\n public multiProvider: boolean) {\n this.resolvedFactory = this.resolvedFactories[0];\n }\n}\n\n/**\n * An internal resolved representation of a factory function created by resolving `Provider`.\n * @publicApi\n */\nexport class ResolvedReflectiveFactory {\n constructor(\n /**\n * Factory function which can return an instance of an object represented by a key.\n */\n public factory: Function,\n\n /**\n * Arguments (dependencies) to the `factory` function.\n */\n public dependencies: ReflectiveDependency[]) {}\n}\n\n\n/**\n * Resolve a single provider.\n */\nfunction resolveReflectiveFactory(provider: NormalizedProvider): ResolvedReflectiveFactory {\n let factoryFn: Function;\n let resolvedDeps: ReflectiveDependency[];\n if (provider.useClass) {\n const useClass = resolveForwardRef(provider.useClass);\n factoryFn = reflector.factory(useClass);\n resolvedDeps = _dependenciesFor(useClass);\n } else if (provider.useExisting) {\n factoryFn = (aliasInstance: any) => aliasInstance;\n resolvedDeps = [ReflectiveDependency.fromKey(ReflectiveKey.get(provider.useExisting))];\n } else if (provider.useFactory) {\n factoryFn = provider.useFactory;\n resolvedDeps = constructDependencies(provider.useFactory, provider.deps);\n } else {\n factoryFn = () => provider.useValue;\n resolvedDeps = _EMPTY_LIST;\n }\n return new ResolvedReflectiveFactory(factoryFn, resolvedDeps);\n}\n\n/**\n * Converts the `Provider` into `ResolvedProvider`.\n *\n * `Injector` internally only uses `ResolvedProvider`, `Provider` contains convenience provider\n * syntax.\n */\nfunction resolveReflectiveProvider(provider: NormalizedProvider): ResolvedReflectiveProvider {\n return new ResolvedReflectiveProvider_(\n ReflectiveKey.get(provider.provide), [resolveReflectiveFactory(provider)],\n provider.multi || false);\n}\n\n/**\n * Resolve a list of Providers.\n */\nexport function resolveReflectiveProviders(providers: Provider[]): ResolvedReflectiveProvider[] {\n const normalized = _normalizeProviders(providers, []);\n const resolved = normalized.map(resolveReflectiveProvider);\n const resolvedProviderMap = mergeResolvedReflectiveProviders(resolved, new Map());\n return Array.from(resolvedProviderMap.values());\n}\n\n/**\n * Merges a list of ResolvedProviders into a list where each key is contained exactly once and\n * multi providers have been merged.\n */\nexport function mergeResolvedReflectiveProviders(\n providers: ResolvedReflectiveProvider[],\n normalizedProvidersMap: Map<number, ResolvedReflectiveProvider>):\n Map<number, ResolvedReflectiveProvider> {\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n const existing = normalizedProvidersMap.get(provider.key.id);\n if (existing) {\n if (provider.multiProvider !== existing.multiProvider) {\n throw mixingMultiProvidersWithRegularProvidersError(existing, provider);\n }\n if (provider.multiProvider) {\n for (let j = 0; j < provider.resolvedFactories.length; j++) {\n existing.resolvedFactories.push(provider.resolvedFactories[j]);\n }\n } else {\n normalizedProvidersMap.set(provider.key.id, provider);\n }\n } else {\n let resolvedProvider: ResolvedReflectiveProvider;\n if (provider.multiProvider) {\n resolvedProvider = new ResolvedReflectiveProvider_(\n provider.key, provider.resolvedFactories.slice(), provider.multiProvider);\n } else {\n resolvedProvider = provider;\n }\n normalizedProvidersMap.set(provider.key.id, resolvedProvider);\n }\n }\n return normalizedProvidersMap;\n}\n\nfunction _normalizeProviders(providers: Provider[], res: Provider[]): Provider[] {\n providers.forEach(b => {\n if (b instanceof Type) {\n res.push({provide: b, useClass: b});\n\n } else if (b && typeof b == 'object' && (b as any).provide !== undefined) {\n res.push(b as NormalizedProvider);\n\n } else if (b instanceof Array) {\n _normalizeProviders(b, res);\n\n } else {\n throw invalidProviderError(b);\n }\n });\n\n return res;\n}\n\nexport function constructDependencies(\n typeOrFunc: any, dependencies?: any[]): ReflectiveDependency[] {\n if (!dependencies) {\n return _dependenciesFor(typeOrFunc);\n } else {\n const params: any[][] = dependencies.map(t => [t]);\n return dependencies.map(t => _extractToken(typeOrFunc, t, params));\n }\n}\n\nfunction _dependenciesFor(typeOrFunc: any): ReflectiveDependency[] {\n const params = reflector.parameters(typeOrFunc);\n\n if (!params) return [];\n if (params.some(p => p == null)) {\n throw noAnnotationError(typeOrFunc, params);\n }\n return params.map(p => _extractToken(typeOrFunc, p, params));\n}\n\nfunction _extractToken(\n typeOrFunc: any, metadata: any[] | any, params: any[][]): ReflectiveDependency {\n let token: any = null;\n let optional = false;\n\n if (!Array.isArray(metadata)) {\n if (metadata instanceof Inject) {\n return _createDependency(metadata.token, optional, null);\n } else {\n return _createDependency(metadata, optional, null);\n }\n }\n\n let visibility: Self|SkipSelf|null = null;\n\n for (let i = 0; i < metadata.length; ++i) {\n const paramMetadata = metadata[i];\n\n if (paramMetadata instanceof Type) {\n token = paramMetadata;\n\n } else if (paramMetadata instanceof Inject) {\n token = paramMetadata.token;\n\n } else if (paramMetadata instanceof Optional) {\n optional = true;\n\n } else if (paramMetadata instanceof Self || paramMetadata instanceof SkipSelf) {\n visibility = paramMetadata;\n } else if (paramMetadata instanceof InjectionToken) {\n token = paramMetadata;\n }\n }\n\n token = resolveForwardRef(token);\n\n if (token != null) {\n return _createDependency(token, optional, visibility);\n } else {\n throw noAnnotationError(typeOrFunc, params);\n }\n}\n\nfunction _createDependency(\n token: any, optional: boolean, visibility: Self | SkipSelf | null): ReflectiveDependency {\n return new ReflectiveDependency(ReflectiveKey.get(token), optional, visibility);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector, THROW_IF_NOT_FOUND} from './injector';\nimport {Self, SkipSelf} from './metadata';\nimport {Provider} from './provider';\nimport {cyclicDependencyError, instantiationError, noProviderError, outOfBoundsError} from './reflective_errors';\nimport {ReflectiveKey} from './reflective_key';\nimport {ReflectiveDependency, ResolvedReflectiveFactory, ResolvedReflectiveProvider, resolveReflectiveProviders} from './reflective_provider';\n\n// Threshold for the dynamic version\nconst UNDEFINED = new Object();\n\n/**\n * A ReflectiveDependency injection container used for instantiating objects and resolving\n * dependencies.\n *\n * An `Injector` is a replacement for a `new` operator, which can automatically resolve the\n * constructor dependencies.\n *\n * In typical use, application code asks for the dependencies in the constructor and they are\n * resolved by the `Injector`.\n *\n * @usageNotes\n * ### Example\n *\n * The following example creates an `Injector` configured to create `Engine` and `Car`.\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * var car = injector.get(Car);\n * expect(car instanceof Car).toBe(true);\n * expect(car.engine instanceof Engine).toBe(true);\n * ```\n *\n * Notice, we don't use the `new` operator because we explicitly want to have the `Injector`\n * resolve all of the object's dependencies automatically.\n *\n * @deprecated from v5 - slow and brings in a lot of code, Use `Injector.create` instead.\n * @publicApi\n */\nexport abstract class ReflectiveInjector implements Injector {\n /**\n * Turns an array of provider definitions into an array of resolved providers.\n *\n * A resolution is a process of flattening multiple nested arrays and converting individual\n * providers into an array of `ResolvedReflectiveProvider`s.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, [[Engine]]]);\n *\n * expect(providers.length).toEqual(2);\n *\n * expect(providers[0] instanceof ResolvedReflectiveProvider).toBe(true);\n * expect(providers[0].key.displayName).toBe(\"Car\");\n * expect(providers[0].dependencies.length).toEqual(1);\n * expect(providers[0].factory).toBeDefined();\n *\n * expect(providers[1].key.displayName).toBe(\"Engine\");\n * });\n * ```\n *\n */\n static resolve(providers: Provider[]): ResolvedReflectiveProvider[] {\n return resolveReflectiveProviders(providers);\n }\n\n /**\n * Resolves an array of providers and creates an injector from those providers.\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Car, Engine]);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static resolveAndCreate(providers: Provider[], parent?: Injector): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return ReflectiveInjector.fromResolvedProviders(ResolvedReflectiveProviders, parent);\n }\n\n /**\n * Creates an injector from previously resolved providers.\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var providers = ReflectiveInjector.resolve([Car, Engine]);\n * var injector = ReflectiveInjector.fromResolvedProviders(providers);\n * expect(injector.get(Car) instanceof Car).toBe(true);\n * ```\n */\n static fromResolvedProviders(providers: ResolvedReflectiveProvider[], parent?: Injector):\n ReflectiveInjector {\n return new ReflectiveInjector_(providers, parent);\n }\n\n\n /**\n * Parent of this injector.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n */\n abstract get parent(): Injector|null;\n\n /**\n * Resolves an array of providers and creates a child injector from those providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * The passed-in providers can be an array of `Type`, `Provider`,\n * or a recursive array of more providers.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parent = ReflectiveInjector.resolveAndCreate([ParentProvider]);\n * var child = parent.resolveAndCreateChild([ChildProvider]);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract resolveAndCreateChild(providers: Provider[]): ReflectiveInjector;\n\n /**\n * Creates a child injector from previously resolved providers.\n *\n * <!-- TODO: Add a link to the section of the user guide talking about hierarchical injection.\n * -->\n *\n * This API is the recommended way to construct injectors in performance-sensitive parts.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * class ParentProvider {}\n * class ChildProvider {}\n *\n * var parentProviders = ReflectiveInjector.resolve([ParentProvider]);\n * var childProviders = ReflectiveInjector.resolve([ChildProvider]);\n *\n * var parent = ReflectiveInjector.fromResolvedProviders(parentProviders);\n * var child = parent.createChildFromResolved(childProviders);\n *\n * expect(child.get(ParentProvider) instanceof ParentProvider).toBe(true);\n * expect(child.get(ChildProvider) instanceof ChildProvider).toBe(true);\n * expect(child.get(ParentProvider)).toBe(parent.get(ParentProvider));\n * ```\n */\n abstract createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector;\n\n /**\n * Resolves a provider and instantiates an object in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n *\n * var car = injector.resolveAndInstantiate(Car);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.resolveAndInstantiate(Car));\n * ```\n */\n abstract resolveAndInstantiate(provider: Provider): any;\n\n /**\n * Instantiates an object using a resolved provider in the context of the injector.\n *\n * The created object does not get cached by the injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * @Injectable()\n * class Engine {\n * }\n *\n * @Injectable()\n * class Car {\n * constructor(public engine:Engine) {}\n * }\n *\n * var injector = ReflectiveInjector.resolveAndCreate([Engine]);\n * var carProvider = ReflectiveInjector.resolve([Car])[0];\n * var car = injector.instantiateResolved(carProvider);\n * expect(car.engine).toBe(injector.get(Engine));\n * expect(car).not.toBe(injector.instantiateResolved(carProvider));\n * ```\n */\n abstract instantiateResolved(provider: ResolvedReflectiveProvider): any;\n\n abstract get(token: any, notFoundValue?: any): any;\n}\n\nexport class ReflectiveInjector_ implements ReflectiveInjector {\n private static INJECTOR_KEY = ReflectiveKey.get(Injector);\n /** @internal */\n _constructionCounter: number = 0;\n /** @internal */\n public _providers: ResolvedReflectiveProvider[];\n public readonly parent: Injector|null;\n\n keyIds: number[];\n objs: any[];\n /**\n * Private\n */\n constructor(_providers: ResolvedReflectiveProvider[], _parent?: Injector) {\n this._providers = _providers;\n this.parent = _parent || null;\n\n const len = _providers.length;\n\n this.keyIds = new Array(len);\n this.objs = new Array(len);\n\n for (let i = 0; i < len; i++) {\n this.keyIds[i] = _providers[i].key.id;\n this.objs[i] = UNDEFINED;\n }\n }\n\n get(token: any, notFoundValue: any = THROW_IF_NOT_FOUND): any {\n return this._getByKey(ReflectiveKey.get(token), null, notFoundValue);\n }\n\n resolveAndCreateChild(providers: Provider[]): ReflectiveInjector {\n const ResolvedReflectiveProviders = ReflectiveInjector.resolve(providers);\n return this.createChildFromResolved(ResolvedReflectiveProviders);\n }\n\n createChildFromResolved(providers: ResolvedReflectiveProvider[]): ReflectiveInjector {\n const inj = new ReflectiveInjector_(providers);\n (inj as{parent: Injector | null}).parent = this;\n return inj;\n }\n\n resolveAndInstantiate(provider: Provider): any {\n return this.instantiateResolved(ReflectiveInjector.resolve([provider])[0]);\n }\n\n instantiateResolved(provider: ResolvedReflectiveProvider): any {\n return this._instantiateProvider(provider);\n }\n\n getProviderAtIndex(index: number): ResolvedReflectiveProvider {\n if (index < 0 || index >= this._providers.length) {\n throw outOfBoundsError(index);\n }\n return this._providers[index];\n }\n\n /** @internal */\n _new(provider: ResolvedReflectiveProvider): any {\n if (this._constructionCounter++ > this._getMaxNumberOfObjects()) {\n throw cyclicDependencyError(this, provider.key);\n }\n return this._instantiateProvider(provider);\n }\n\n private _getMaxNumberOfObjects(): number { return this.objs.length; }\n\n private _instantiateProvider(provider: ResolvedReflectiveProvider): any {\n if (provider.multiProvider) {\n const res = new Array(provider.resolvedFactories.length);\n for (let i = 0; i < provider.resolvedFactories.length; ++i) {\n res[i] = this._instantiate(provider, provider.resolvedFactories[i]);\n }\n return res;\n } else {\n return this._instantiate(provider, provider.resolvedFactories[0]);\n }\n }\n\n private _instantiate(\n provider: ResolvedReflectiveProvider,\n ResolvedReflectiveFactory: ResolvedReflectiveFactory): any {\n const factory = ResolvedReflectiveFactory.factory;\n\n let deps: any[];\n try {\n deps =\n ResolvedReflectiveFactory.dependencies.map(dep => this._getByReflectiveDependency(dep));\n } catch (e) {\n if (e.addKey) {\n e.addKey(this, provider.key);\n }\n throw e;\n }\n\n let obj: any;\n try {\n obj = factory(...deps);\n } catch (e) {\n throw instantiationError(this, e, e.stack, provider.key);\n }\n\n return obj;\n }\n\n private _getByReflectiveDependency(dep: ReflectiveDependency): any {\n return this._getByKey(dep.key, dep.visibility, dep.optional ? null : THROW_IF_NOT_FOUND);\n }\n\n private _getByKey(key: ReflectiveKey, visibility: Self|SkipSelf|null, notFoundValue: any): any {\n if (key === ReflectiveInjector_.INJECTOR_KEY) {\n return this;\n }\n\n if (visibility instanceof Self) {\n return this._getByKeySelf(key, notFoundValue);\n\n } else {\n return this._getByKeyDefault(key, notFoundValue, visibility);\n }\n }\n\n private _getObjByKeyId(keyId: number): any {\n for (let i = 0; i < this.keyIds.length; i++) {\n if (this.keyIds[i] === keyId) {\n if (this.objs[i] === UNDEFINED) {\n this.objs[i] = this._new(this._providers[i]);\n }\n\n return this.objs[i];\n }\n }\n\n return UNDEFINED;\n }\n\n /** @internal */\n _throwOrNull(key: ReflectiveKey, notFoundValue: any): any {\n if (notFoundValue !== THROW_IF_NOT_FOUND) {\n return notFoundValue;\n } else {\n throw noProviderError(this, key);\n }\n }\n\n /** @internal */\n _getByKeySelf(key: ReflectiveKey, notFoundValue: any): any {\n const obj = this._getObjByKeyId(key.id);\n return (obj !== UNDEFINED) ? obj : this._throwOrNull(key, notFoundValue);\n }\n\n /** @internal */\n _getByKeyDefault(key: ReflectiveKey, notFoundValue: any, visibility: Self|SkipSelf|null): any {\n let inj: Injector|null;\n\n if (visibility instanceof SkipSelf) {\n inj = this.parent;\n } else {\n inj = this;\n }\n\n while (inj instanceof ReflectiveInjector_) {\n const inj_ = <ReflectiveInjector_>inj;\n const obj = inj_._getObjByKeyId(key.id);\n if (obj !== UNDEFINED) return obj;\n inj = inj_.parent;\n }\n if (inj !== null) {\n return inj.get(key.token, notFoundValue);\n } else {\n return this._throwOrNull(key, notFoundValue);\n }\n }\n\n get displayName(): string {\n const providers =\n _mapProviders(this, (b: ResolvedReflectiveProvider) => ' \"' + b.key.displayName + '\" ')\n .join(', ');\n return `ReflectiveInjector(providers: [${providers}])`;\n }\n\n toString(): string { return this.displayName; }\n}\n\nfunction _mapProviders(injector: ReflectiveInjector_, fn: Function): any[] {\n const res: any[] = new Array(injector._providers.length);\n for (let i = 0; i < injector._providers.length; ++i) {\n res[i] = fn(injector.getProviderAtIndex(i));\n }\n return res;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * The `di` module provides dependency injection container services.\n */\n\nexport * from './di/metadata';\nexport {InjectableType, InjectorType, defineInjectable, defineInjector} from './di/defs';\nexport {forwardRef, resolveForwardRef, ForwardRefFn} from './di/forward_ref';\nexport {Injectable, InjectableDecorator, InjectableProvider} from './di/injectable';\nexport {INJECTOR, Injector} from './di/injector';\nexport {inject, InjectFlags} from './di/injector_compatibility';\nexport {ReflectiveInjector} from './di/reflective_injector';\nexport {StaticProvider, ValueProvider, ConstructorSansProvider, ExistingProvider, FactoryProvider, Provider, TypeProvider, ClassProvider} from './di/provider';\nexport {createInjector} from './di/r3_injector';\nexport {ResolvedReflectiveFactory, ResolvedReflectiveProvider} from './di/reflective_provider';\nexport {ReflectiveKey} from './di/reflective_key';\nexport {InjectionToken} from './di/injection_token';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\n/**\n * Determine if the argument is shaped like a Promise\n */\nexport function isPromise(obj: any): obj is Promise<any> {\n // allow any Promise/A+ compliant thenable.\n // It's up to the caller to ensure that obj.then conforms to the spec\n return !!obj && typeof obj.then === 'function';\n}\n\n/**\n * Determine if the argument is an Observable\n */\nexport function isObservable(obj: any | Observable<any>): obj is Observable<any> {\n // TODO: use isObservable once we update pass rxjs 6.1\n // https://github.com/ReactiveX/rxjs/blob/master/CHANGELOG.md#610-2018-05-03\n return !!obj && typeof obj.subscribe === 'function';\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {isPromise} from '../src/util/lang';\n\nimport {Inject, Injectable, InjectionToken, Optional} from './di';\n\n\n/**\n * A function that will be executed when an application is initialized.\n *\n * @publicApi\n */\nexport const APP_INITIALIZER = new InjectionToken<Array<() => void>>('Application Initializer');\n\n/**\n * A class that reflects the state of running {@link APP_INITIALIZER}s.\n *\n * @publicApi\n */\n@Injectable()\nexport class ApplicationInitStatus {\n // TODO(issue/24571): remove '!'.\n private resolve !: Function;\n // TODO(issue/24571): remove '!'.\n private reject !: Function;\n private initialized = false;\n public readonly donePromise: Promise<any>;\n public readonly done = false;\n\n constructor(@Inject(APP_INITIALIZER) @Optional() private appInits: (() => any)[]) {\n this.donePromise = new Promise((res, rej) => {\n this.resolve = res;\n this.reject = rej;\n });\n }\n\n /** @internal */\n runInitializers() {\n if (this.initialized) {\n return;\n }\n\n const asyncInitPromises: Promise<any>[] = [];\n\n const complete = () => {\n (this as{done: boolean}).done = true;\n this.resolve();\n };\n\n if (this.appInits) {\n for (let i = 0; i < this.appInits.length; i++) {\n const initResult = this.appInits[i]();\n if (isPromise(initResult)) {\n asyncInitPromises.push(initResult);\n }\n }\n }\n\n Promise.all(asyncInitPromises).then(() => { complete(); }).catch(e => { this.reject(e); });\n\n if (asyncInitPromises.length === 0) {\n complete();\n }\n this.initialized = true;\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from './di';\nimport {ComponentRef} from './linker/component_factory';\n\n\n/**\n * A DI Token representing a unique string id assigned to the application by Angular and used\n * primarily for prefixing application attributes and CSS styles when\n * {@link ViewEncapsulation#Emulated ViewEncapsulation.Emulated} is being used.\n *\n * If you need to avoid randomly generated value to be used as an application id, you can provide\n * a custom value via a DI provider <!-- TODO: provider --> configuring the root {@link Injector}\n * using this token.\n * @publicApi\n */\nexport const APP_ID = new InjectionToken<string>('AppId');\n\nexport function _appIdRandomProviderFactory() {\n return `${_randomChar()}${_randomChar()}${_randomChar()}`;\n}\n\n/**\n * Providers that will generate a random APP_ID_TOKEN.\n * @publicApi\n */\nexport const APP_ID_RANDOM_PROVIDER = {\n provide: APP_ID,\n useFactory: _appIdRandomProviderFactory,\n deps: <any[]>[],\n};\n\nfunction _randomChar(): string {\n return String.fromCharCode(97 + Math.floor(Math.random() * 25));\n}\n\n/**\n * A function that will be executed when a platform is initialized.\n * @publicApi\n */\nexport const PLATFORM_INITIALIZER = new InjectionToken<Array<() => void>>('Platform Initializer');\n\n/**\n * A token that indicates an opaque platform id.\n * @publicApi\n */\nexport const PLATFORM_ID = new InjectionToken<Object>('Platform ID');\n\n/**\n * All callbacks provided via this token will be called for every component that is bootstrapped.\n * Signature of the callback:\n *\n * `(componentRef: ComponentRef) => void`.\n *\n * @publicApi\n */\nexport const APP_BOOTSTRAP_LISTENER =\n new InjectionToken<Array<(compRef: ComponentRef<any>) => void>>('appBootstrapListener');\n\n/**\n * A token which indicates the root directory of the application\n * @publicApi\n */\nexport const PACKAGE_ROOT_URL = new InjectionToken<string>('Application Packages Root URL');\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from './di';\n\n@Injectable()\nexport class Console {\n log(message: string): void {\n // tslint:disable-next-line:no-console\n console.log(message);\n }\n // Note: for reporting errors use `DOM.logError()` as it is platform specific\n warn(message: string): void {\n // tslint:disable-next-line:no-console\n console.warn(message);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di/injectable';\nimport {InjectionToken} from '../di/injection_token';\nimport {StaticProvider} from '../di/provider';\nimport {MissingTranslationStrategy} from '../i18n/tokens';\nimport {ViewEncapsulation} from '../metadata';\nimport {NgModuleFactory as NgModuleFactoryR3} from '../render3/ng_module_ref';\nimport {Type} from '../type';\n\nimport {ComponentFactory} from './component_factory';\nimport {NgModuleFactory} from './ng_module_factory';\n\n\n\n/**\n * Combination of NgModuleFactory and ComponentFactorys.\n *\n * @publicApi\n */\nexport class ModuleWithComponentFactories<T> {\n constructor(\n public ngModuleFactory: NgModuleFactory<T>,\n public componentFactories: ComponentFactory<any>[]) {}\n}\n\n\nfunction _throwError() {\n throw new Error(`Runtime compiler is not loaded`);\n}\n\nconst Compiler_compileModuleSync__PRE_R3__: <T>(moduleType: Type<T>) => NgModuleFactory<T> =\n _throwError as any;\nexport const Compiler_compileModuleSync__POST_R3__: <T>(moduleType: Type<T>) =>\n NgModuleFactory<T> = function<T>(moduleType: Type<T>): NgModuleFactory<T> {\n return new NgModuleFactoryR3(moduleType);\n};\nconst Compiler_compileModuleSync = Compiler_compileModuleSync__PRE_R3__;\n\nconst Compiler_compileModuleAsync__PRE_R3__: <T>(moduleType: Type<T>) =>\n Promise<NgModuleFactory<T>> = _throwError as any;\nexport const Compiler_compileModuleAsync__POST_R3__: <T>(moduleType: Type<T>) =>\n Promise<NgModuleFactory<T>> = function<T>(moduleType: Type<T>): Promise<NgModuleFactory<T>> {\n return Promise.resolve(Compiler_compileModuleSync__POST_R3__(moduleType));\n};\nconst Compiler_compileModuleAsync = Compiler_compileModuleAsync__PRE_R3__;\n\nconst Compiler_compileModuleAndAllComponentsSync__PRE_R3__: <T>(moduleType: Type<T>) =>\n ModuleWithComponentFactories<T> = _throwError as any;\nexport const Compiler_compileModuleAndAllComponentsSync__POST_R3__: <T>(moduleType: Type<T>) =>\n ModuleWithComponentFactories<T> = function<T>(moduleType: Type<T>):\n ModuleWithComponentFactories<T> {\n return new ModuleWithComponentFactories(Compiler_compileModuleSync__POST_R3__(moduleType), []);\n};\nconst Compiler_compileModuleAndAllComponentsSync =\n Compiler_compileModuleAndAllComponentsSync__PRE_R3__;\n\nconst Compiler_compileModuleAndAllComponentsAsync__PRE_R3__: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = _throwError as any;\nexport const Compiler_compileModuleAndAllComponentsAsync__POST_R3__: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = function<T>(moduleType: Type<T>):\n Promise<ModuleWithComponentFactories<T>> {\n return Promise.resolve(Compiler_compileModuleAndAllComponentsSync__POST_R3__(moduleType));\n};\nconst Compiler_compileModuleAndAllComponentsAsync =\n Compiler_compileModuleAndAllComponentsAsync__PRE_R3__;\n\n/**\n * Low-level service for running the angular compiler during runtime\n * to create {@link ComponentFactory}s, which\n * can later be used to create and render a Component instance.\n *\n * Each `@NgModule` provides an own `Compiler` to its injector,\n * that will use the directives/pipes of the ng module for compilation\n * of components.\n *\n * @publicApi\n */\n@Injectable()\nexport class Compiler {\n /**\n * Compiles the given NgModule and all of its components. All templates of the components listed\n * in `entryComponents` have to be inlined.\n */\n compileModuleSync: <T>(moduleType: Type<T>) => NgModuleFactory<T> = Compiler_compileModuleSync;\n\n /**\n * Compiles the given NgModule and all of its components\n */\n compileModuleAsync:\n <T>(moduleType: Type<T>) => Promise<NgModuleFactory<T>> = Compiler_compileModuleAsync;\n\n /**\n * Same as {@link #compileModuleSync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsSync: <T>(moduleType: Type<T>) => ModuleWithComponentFactories<T> =\n Compiler_compileModuleAndAllComponentsSync;\n\n /**\n * Same as {@link #compileModuleAsync} but also creates ComponentFactories for all components.\n */\n compileModuleAndAllComponentsAsync: <T>(moduleType: Type<T>) =>\n Promise<ModuleWithComponentFactories<T>> = Compiler_compileModuleAndAllComponentsAsync;\n\n /**\n * Clears all caches.\n */\n clearCache(): void {}\n\n /**\n * Clears the cache for the given component/ngModule.\n */\n clearCacheFor(type: Type<any>) {}\n\n /**\n * Returns the id for a given NgModule, if one is defined and known to the compiler.\n */\n getModuleId(moduleType: Type<any>): string|undefined { return undefined; }\n}\n\n/**\n * Options for creating a compiler\n *\n * @publicApi\n */\nexport type CompilerOptions = {\n useJit?: boolean,\n defaultEncapsulation?: ViewEncapsulation,\n providers?: StaticProvider[],\n missingTranslation?: MissingTranslationStrategy,\n preserveWhitespaces?: boolean,\n};\n\n/**\n * Token to provide CompilerOptions in the platform injector.\n *\n * @publicApi\n */\nexport const COMPILER_OPTIONS = new InjectionToken<CompilerOptions[]>('compilerOptions');\n\n/**\n * A factory for creating a Compiler\n *\n * @publicApi\n */\nexport abstract class CompilerFactory {\n abstract createCompiler(options?: CompilerOptions[]): Compiler;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {global} from '../util';\n\n/**\n * A scope function for the Web Tracing Framework (WTF).\n *\n * @publicApi\n */\nexport interface WtfScopeFn { (arg0?: any, arg1?: any): any; }\n\ninterface WTF {\n trace: Trace;\n}\n\ninterface Trace {\n events: Events;\n leaveScope(scope: Scope, returnValue: any): any /** TODO #9100 */;\n beginTimeRange(rangeType: string, action: string): Range;\n endTimeRange(range: Range): any /** TODO #9100 */;\n}\n\nexport interface Range {}\n\ninterface Events {\n createScope(signature: string, flags: any): Scope;\n}\n\nexport interface Scope { (...args: any[] /** TODO #9100 */): any; }\n\nlet trace: Trace;\nlet events: Events;\n\nexport function detectWTF(): boolean {\n const wtf: WTF = (global as any /** TODO #9100 */)['wtf'];\n if (wtf) {\n trace = wtf['trace'];\n if (trace) {\n events = trace['events'];\n return true;\n }\n }\n return false;\n}\n\nexport function createScope(signature: string, flags: any = null): any {\n return events.createScope(signature, flags);\n}\n\nexport function leave<T>(scope: Scope): void;\nexport function leave<T>(scope: Scope, returnValue?: T): T;\nexport function leave<T>(scope: Scope, returnValue?: any): any {\n trace.leaveScope(scope, returnValue);\n return returnValue;\n}\n\nexport function startTimeRange(rangeType: string, action: string): Range {\n return trace.beginTimeRange(rangeType, action);\n}\n\nexport function endTimeRange(range: Range): void {\n trace.endTimeRange(range);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WtfScopeFn, createScope, detectWTF, endTimeRange, leave, startTimeRange} from './wtf_impl';\n\nexport {WtfScopeFn} from './wtf_impl';\n\n\n/**\n * True if WTF is enabled.\n */\nexport const wtfEnabled = detectWTF();\n\nfunction noopScope(arg0?: any, arg1?: any): any {\n return null;\n}\n\n/**\n * Create trace scope.\n *\n * Scopes must be strictly nested and are analogous to stack frames, but\n * do not have to follow the stack frames. Instead it is recommended that they follow logical\n * nesting. You may want to use\n * [Event\n * Signatures](http://google.github.io/tracing-framework/instrumenting-code.html#custom-events)\n * as they are defined in WTF.\n *\n * Used to mark scope entry. The return value is used to leave the scope.\n *\n * var myScope = wtfCreateScope('MyClass#myMethod(ascii someVal)');\n *\n * someMethod() {\n * var s = myScope('Foo'); // 'Foo' gets stored in tracing UI\n * // DO SOME WORK HERE\n * return wtfLeave(s, 123); // Return value 123\n * }\n *\n * Note, adding try-finally block around the work to ensure that `wtfLeave` gets called can\n * negatively impact the performance of your application. For this reason we recommend that\n * you don't add them to ensure that `wtfLeave` gets called. In production `wtfLeave` is a noop and\n * so try-finally block has no value. When debugging perf issues, skipping `wtfLeave`, do to\n * exception, will produce incorrect trace, but presence of exception signifies logic error which\n * needs to be fixed before the app should be profiled. Add try-finally only when you expect that\n * an exception is expected during normal execution while profiling.\n *\n * @publicApi\n */\nexport const wtfCreateScope: (signature: string, flags?: any) => WtfScopeFn =\n wtfEnabled ? createScope : (signature: string, flags?: any) => noopScope;\n\n/**\n * Used to mark end of Scope.\n *\n * - `scope` to end.\n * - `returnValue` (optional) to be passed to the WTF.\n *\n * Returns the `returnValue for easy chaining.\n * @publicApi\n */\nexport const wtfLeave: <T>(scope: any, returnValue?: T) => T =\n wtfEnabled ? leave : (s: any, r?: any) => r;\n\n/**\n * Used to mark Async start. Async are similar to scope but they don't have to be strictly nested.\n * The return value is used in the call to [endAsync]. Async ranges only work if WTF has been\n * enabled.\n *\n * someMethod() {\n * var s = wtfStartTimeRange('HTTP:GET', 'some.url');\n * var future = new Future.delay(5).then((_) {\n * wtfEndTimeRange(s);\n * });\n * }\n * @publicApi\n */\nexport const wtfStartTimeRange: (rangeType: string, action: string) => any =\n wtfEnabled ? startTimeRange : (rangeType: string, action: string) => null;\n\n/**\n * Ends a async time range operation.\n * [range] is the return value from [wtfStartTimeRange] Async ranges only work if WTF has been\n * enabled.\n * @publicApi\n */\nexport const wtfEndTimeRange: (range: any) => void = wtfEnabled ? endTimeRange : (r: any) => null;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {EventEmitter} from '../event_emitter';\n\n/**\n * An injectable service for executing work inside or outside of the Angular zone.\n *\n * The most common use of this service is to optimize performance when starting a work consisting of\n * one or more asynchronous tasks that don't require UI updates or error handling to be handled by\n * Angular. Such tasks can be kicked off via {@link #runOutsideAngular} and if needed, these tasks\n * can reenter the Angular zone via {@link #run}.\n *\n * <!-- TODO: add/fix links to:\n * - docs explaining zones and the use of zones in Angular and change-detection\n * - link to runOutsideAngular/run (throughout this file!)\n * -->\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * import {Component, NgZone} from '@angular/core';\n * import {NgIf} from '@angular/common';\n *\n * @Component({\n * selector: 'ng-zone-demo',\n * template: `\n * <h2>Demo: NgZone</h2>\n *\n * <p>Progress: {{progress}}%</p>\n * <p *ngIf=\"progress >= 100\">Done processing {{label}} of Angular zone!</p>\n *\n * <button (click)=\"processWithinAngularZone()\">Process within Angular zone</button>\n * <button (click)=\"processOutsideOfAngularZone()\">Process outside of Angular zone</button>\n * `,\n * })\n * export class NgZoneDemo {\n * progress: number = 0;\n * label: string;\n *\n * constructor(private _ngZone: NgZone) {}\n *\n * // Loop inside the Angular zone\n * // so the UI DOES refresh after each setTimeout cycle\n * processWithinAngularZone() {\n * this.label = 'inside';\n * this.progress = 0;\n * this._increaseProgress(() => console.log('Inside Done!'));\n * }\n *\n * // Loop outside of the Angular zone\n * // so the UI DOES NOT refresh after each setTimeout cycle\n * processOutsideOfAngularZone() {\n * this.label = 'outside';\n * this.progress = 0;\n * this._ngZone.runOutsideAngular(() => {\n * this._increaseProgress(() => {\n * // reenter the Angular zone and display done\n * this._ngZone.run(() => { console.log('Outside Done!'); });\n * });\n * });\n * }\n *\n * _increaseProgress(doneCallback: () => void) {\n * this.progress += 1;\n * console.log(`Current progress: ${this.progress}%`);\n *\n * if (this.progress < 100) {\n * window.setTimeout(() => this._increaseProgress(doneCallback), 10);\n * } else {\n * doneCallback();\n * }\n * }\n * }\n * ```\n *\n * @publicApi\n */\nexport class NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n\n /**\n * Whether there are no outstanding microtasks or macrotasks.\n */\n readonly isStable: boolean = true;\n\n /**\n * Notifies when code enters Angular Zone. This gets fired first on VM Turn.\n */\n readonly onUnstable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when there is no more microtasks enqueued in the current VM Turn.\n * This is a hint for Angular to do change detection, which may enqueue more microtasks.\n * For this reason this event can fire multiple times per VM Turn.\n */\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies when the last `onMicrotaskEmpty` has run and there are no more microtasks, which\n * implies we are about to relinquish VM turn.\n * This event gets called just once.\n */\n readonly onStable: EventEmitter<any> = new EventEmitter(false);\n\n /**\n * Notifies that an error has been delivered.\n */\n readonly onError: EventEmitter<any> = new EventEmitter(false);\n\n constructor({enableLongStackTrace = false}) {\n if (typeof Zone == 'undefined') {\n throw new Error(`In this configuration Angular requires Zone.js`);\n }\n\n Zone.assertZonePatched();\n const self = this as any as NgZonePrivate;\n self._nesting = 0;\n\n self._outer = self._inner = Zone.current;\n\n if ((Zone as any)['wtfZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['wtfZoneSpec']);\n }\n\n if ((Zone as any)['TaskTrackingZoneSpec']) {\n self._inner = self._inner.fork(new ((Zone as any)['TaskTrackingZoneSpec'] as any));\n }\n\n if (enableLongStackTrace && (Zone as any)['longStackTraceZoneSpec']) {\n self._inner = self._inner.fork((Zone as any)['longStackTraceZoneSpec']);\n }\n\n forkInnerZoneWithAngularBehavior(self);\n }\n\n static isInAngularZone(): boolean { return Zone.current.get('isAngularZone') === true; }\n\n static assertInAngularZone(): void {\n if (!NgZone.isInAngularZone()) {\n throw new Error('Expected to be in Angular Zone, but it is not!');\n }\n }\n\n static assertNotInAngularZone(): void {\n if (NgZone.isInAngularZone()) {\n throw new Error('Expected to not be in Angular Zone, but it is!');\n }\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone and returns value returned by\n * the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n run<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.run(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously within the Angular zone as a task and returns value\n * returned by the function.\n *\n * Running functions via `run` allows you to reenter Angular zone from a task that was executed\n * outside of the Angular zone (typically started via {@link #runOutsideAngular}).\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * within the Angular zone.\n *\n * If a synchronous error happens it will be rethrown and not reported via `onError`.\n */\n runTask<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[], name?: string): T {\n const zone = (this as any as NgZonePrivate)._inner;\n const task = zone.scheduleEventTask('NgZoneEvent: ' + name, fn, EMPTY_PAYLOAD, noop, noop);\n try {\n return zone.runTask(task, applyThis, applyArgs) as T;\n } finally {\n zone.cancelTask(task);\n }\n }\n\n /**\n * Same as `run`, except that synchronous errors are caught and forwarded via `onError` and not\n * rethrown.\n */\n runGuarded<T>(fn: (...args: any[]) => T, applyThis?: any, applyArgs?: any[]): T {\n return (this as any as NgZonePrivate)._inner.runGuarded(fn, applyThis, applyArgs) as T;\n }\n\n /**\n * Executes the `fn` function synchronously in Angular's parent zone and returns value returned by\n * the function.\n *\n * Running functions via {@link #runOutsideAngular} allows you to escape Angular's zone and do\n * work that\n * doesn't trigger Angular change-detection or is subject to Angular's error handling.\n *\n * Any future tasks or microtasks scheduled from within this function will continue executing from\n * outside of the Angular zone.\n *\n * Use {@link #run} to reenter the Angular zone and do work that updates the application model.\n */\n runOutsideAngular<T>(fn: (...args: any[]) => T): T {\n return (this as any as NgZonePrivate)._outer.run(fn) as T;\n }\n}\n\nfunction noop() {}\nconst EMPTY_PAYLOAD = {};\n\n\ninterface NgZonePrivate extends NgZone {\n _outer: Zone;\n _inner: Zone;\n _nesting: number;\n\n hasPendingMicrotasks: boolean;\n hasPendingMacrotasks: boolean;\n isStable: boolean;\n}\n\nfunction checkStable(zone: NgZonePrivate) {\n if (zone._nesting == 0 && !zone.hasPendingMicrotasks && !zone.isStable) {\n try {\n zone._nesting++;\n zone.onMicrotaskEmpty.emit(null);\n } finally {\n zone._nesting--;\n if (!zone.hasPendingMicrotasks) {\n try {\n zone.runOutsideAngular(() => zone.onStable.emit(null));\n } finally {\n zone.isStable = true;\n }\n }\n }\n }\n}\n\nfunction forkInnerZoneWithAngularBehavior(zone: NgZonePrivate) {\n zone._inner = zone._inner.fork({\n name: 'angular',\n properties: <any>{'isAngularZone': true},\n onInvokeTask: (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task, applyThis: any,\n applyArgs: any): any => {\n try {\n onEnter(zone);\n return delegate.invokeTask(target, task, applyThis, applyArgs);\n } finally {\n onLeave(zone);\n }\n },\n\n\n onInvoke: (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function,\n applyThis: any, applyArgs: any[], source: string): any => {\n try {\n onEnter(zone);\n return delegate.invoke(target, callback, applyThis, applyArgs, source);\n } finally {\n onLeave(zone);\n }\n },\n\n onHasTask:\n (delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {\n delegate.hasTask(target, hasTaskState);\n if (current === target) {\n // We are only interested in hasTask events which originate from our zone\n // (A child hasTask event is not interesting to us)\n if (hasTaskState.change == 'microTask') {\n zone.hasPendingMicrotasks = hasTaskState.microTask;\n checkStable(zone);\n } else if (hasTaskState.change == 'macroTask') {\n zone.hasPendingMacrotasks = hasTaskState.macroTask;\n }\n }\n },\n\n onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {\n delegate.handleError(target, error);\n zone.runOutsideAngular(() => zone.onError.emit(error));\n return false;\n }\n });\n}\n\nfunction onEnter(zone: NgZonePrivate) {\n zone._nesting++;\n if (zone.isStable) {\n zone.isStable = false;\n zone.onUnstable.emit(null);\n }\n}\n\nfunction onLeave(zone: NgZonePrivate) {\n zone._nesting--;\n checkStable(zone);\n}\n\n/**\n * Provides a noop implementation of `NgZone` which does nothing. This zone requires explicit calls\n * to framework to perform rendering.\n */\nexport class NoopNgZone implements NgZone {\n readonly hasPendingMicrotasks: boolean = false;\n readonly hasPendingMacrotasks: boolean = false;\n readonly isStable: boolean = true;\n readonly onUnstable: EventEmitter<any> = new EventEmitter();\n readonly onMicrotaskEmpty: EventEmitter<any> = new EventEmitter();\n readonly onStable: EventEmitter<any> = new EventEmitter();\n readonly onError: EventEmitter<any> = new EventEmitter();\n\n run(fn: () => any): any { return fn(); }\n\n runGuarded(fn: () => any): any { return fn(); }\n\n runOutsideAngular(fn: () => any): any { return fn(); }\n\n runTask<T>(fn: () => any): any { return fn(); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injectable} from '../di';\nimport {scheduleMicroTask} from '../util';\nimport {NgZone} from '../zone/ng_zone';\n\n/**\n * Testability API.\n * `declare` keyword causes tsickle to generate externs, so these methods are\n * not renamed by Closure Compiler.\n * @publicApi\n */\nexport declare interface PublicTestability {\n isStable(): boolean;\n whenStable(callback: Function, timeout?: number, updateCallback?: Function): void;\n findProviders(using: any, provider: string, exactMatch: boolean): any[];\n}\n\n// Angular internal, not intended for public API.\nexport interface PendingMacrotask {\n source: string;\n creationLocation: Error;\n runCount?: number;\n data: TaskData;\n}\n\nexport interface TaskData {\n target?: XMLHttpRequest;\n delay?: number;\n isPeriodic?: boolean;\n}\n\n// Angular internal, not intended for public API.\nexport type DoneCallback = (didWork: boolean, tasks?: PendingMacrotask[]) => void;\nexport type UpdateCallback = (tasks: PendingMacrotask[]) => boolean;\n\ninterface WaitCallback {\n // Needs to be 'any' - setTimeout returns a number according to ES6, but\n // on NodeJS it returns a Timer.\n timeoutId: any;\n doneCb: DoneCallback;\n updateCb?: UpdateCallback;\n}\n\n/**\n * The Testability service provides testing hooks that can be accessed from\n * the browser and by services such as Protractor. Each bootstrapped Angular\n * application on the page will have an instance of Testability.\n * @publicApi\n */\n@Injectable()\nexport class Testability implements PublicTestability {\n private _pendingCount: number = 0;\n private _isZoneStable: boolean = true;\n /**\n * Whether any work was done since the last 'whenStable' callback. This is\n * useful to detect if this could have potentially destabilized another\n * component while it is stabilizing.\n * @internal\n */\n private _didWork: boolean = false;\n private _callbacks: WaitCallback[] = [];\n\n private taskTrackingZone: {macroTasks: Task[]}|null = null;\n\n constructor(private _ngZone: NgZone) {\n this._watchAngularEvents();\n _ngZone.run(() => {\n this.taskTrackingZone =\n typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone');\n });\n }\n\n private _watchAngularEvents(): void {\n this._ngZone.onUnstable.subscribe({\n next: () => {\n this._didWork = true;\n this._isZoneStable = false;\n }\n });\n\n this._ngZone.runOutsideAngular(() => {\n this._ngZone.onStable.subscribe({\n next: () => {\n NgZone.assertNotInAngularZone();\n scheduleMicroTask(() => {\n this._isZoneStable = true;\n this._runCallbacksIfReady();\n });\n }\n });\n });\n }\n\n /**\n * Increases the number of pending request\n * @deprecated pending requests are now tracked with zones.\n */\n increasePendingRequestCount(): number {\n this._pendingCount += 1;\n this._didWork = true;\n return this._pendingCount;\n }\n\n /**\n * Decreases the number of pending request\n * @deprecated pending requests are now tracked with zones\n */\n decreasePendingRequestCount(): number {\n this._pendingCount -= 1;\n if (this._pendingCount < 0) {\n throw new Error('pending async requests below zero');\n }\n this._runCallbacksIfReady();\n return this._pendingCount;\n }\n\n /**\n * Whether an associated application is stable\n */\n isStable(): boolean {\n return this._isZoneStable && this._pendingCount === 0 && !this._ngZone.hasPendingMacrotasks;\n }\n\n private _runCallbacksIfReady(): void {\n if (this.isStable()) {\n // Schedules the call backs in a new frame so that it is always async.\n scheduleMicroTask(() => {\n while (this._callbacks.length !== 0) {\n let cb = this._callbacks.pop() !;\n clearTimeout(cb.timeoutId);\n cb.doneCb(this._didWork);\n }\n this._didWork = false;\n });\n } else {\n // Still not stable, send updates.\n let pending = this.getPendingTasks();\n this._callbacks = this._callbacks.filter((cb) => {\n if (cb.updateCb && cb.updateCb(pending)) {\n clearTimeout(cb.timeoutId);\n return false;\n }\n\n return true;\n });\n\n this._didWork = true;\n }\n }\n\n private getPendingTasks(): PendingMacrotask[] {\n if (!this.taskTrackingZone) {\n return [];\n }\n\n // Copy the tasks data so that we don't leak tasks.\n return this.taskTrackingZone.macroTasks.map((t: Task) => {\n return {\n source: t.source,\n // From TaskTrackingZone:\n // https://github.com/angular/zone.js/blob/master/lib/zone-spec/task-tracking.ts#L40\n creationLocation: (t as any).creationLocation as Error,\n data: t.data\n };\n });\n }\n\n private addCallback(cb: DoneCallback, timeout?: number, updateCb?: UpdateCallback) {\n let timeoutId: any = -1;\n if (timeout && timeout > 0) {\n timeoutId = setTimeout(() => {\n this._callbacks = this._callbacks.filter((cb) => cb.timeoutId !== timeoutId);\n cb(this._didWork, this.getPendingTasks());\n }, timeout);\n }\n this._callbacks.push(<WaitCallback>{doneCb: cb, timeoutId: timeoutId, updateCb: updateCb});\n }\n\n /**\n * Wait for the application to be stable with a timeout. If the timeout is reached before that\n * happens, the callback receives a list of the macro tasks that were pending, otherwise null.\n *\n * @param doneCb The callback to invoke when Angular is stable or the timeout expires\n * whichever comes first.\n * @param timeout Optional. The maximum time to wait for Angular to become stable. If not\n * specified, whenStable() will wait forever.\n * @param updateCb Optional. If specified, this callback will be invoked whenever the set of\n * pending macrotasks changes. If this callback returns true doneCb will not be invoked\n * and no further updates will be issued.\n */\n whenStable(doneCb: Function, timeout?: number, updateCb?: Function): void {\n if (updateCb && !this.taskTrackingZone) {\n throw new Error(\n 'Task tracking zone is required when passing an update callback to ' +\n 'whenStable(). Is \"zone.js/dist/task-tracking.js\" loaded?');\n }\n // These arguments are 'Function' above to keep the public API simple.\n this.addCallback(doneCb as DoneCallback, timeout, updateCb as UpdateCallback);\n this._runCallbacksIfReady();\n }\n\n /**\n * Get the number of pending requests\n * @deprecated pending requests are now tracked with zones\n */\n getPendingRequestCount(): number { return this._pendingCount; }\n\n /**\n * Find providers by name\n * @param using The root element to search from\n * @param provider The name of binding variable\n * @param exactMatch Whether using exactMatch\n */\n findProviders(using: any, provider: string, exactMatch: boolean): any[] {\n // TODO(juliemr): implement.\n return [];\n }\n}\n\n/**\n * A global registry of {@link Testability} instances for specific elements.\n * @publicApi\n */\n@Injectable()\nexport class TestabilityRegistry {\n /** @internal */\n _applications = new Map<any, Testability>();\n\n constructor() { _testabilityGetter.addToWindow(this); }\n\n /**\n * Registers an application with a testability hook so that it can be tracked\n * @param token token of application, root element\n * @param testability Testability hook\n */\n registerApplication(token: any, testability: Testability) {\n this._applications.set(token, testability);\n }\n\n /**\n * Unregisters an application.\n * @param token token of application, root element\n */\n unregisterApplication(token: any) { this._applications.delete(token); }\n\n /**\n * Unregisters all applications\n */\n unregisterAllApplications() { this._applications.clear(); }\n\n /**\n * Get a testability hook associated with the application\n * @param elem root element\n */\n getTestability(elem: any): Testability|null { return this._applications.get(elem) || null; }\n\n /**\n * Get all registered testabilities\n */\n getAllTestabilities(): Testability[] { return Array.from(this._applications.values()); }\n\n /**\n * Get all registered applications(root elements)\n */\n getAllRootElements(): any[] { return Array.from(this._applications.keys()); }\n\n /**\n * Find testability of a node in the Tree\n * @param elem node\n * @param findInAncestors whether finding testability in ancestors if testability was not found in\n * current node\n */\n findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability|null {\n return _testabilityGetter.findTestabilityInTree(this, elem, findInAncestors);\n }\n}\n\n/**\n * Adapter interface for retrieving the `Testability` service associated for a\n * particular context.\n *\n * @publicApi\n */\nexport interface GetTestability {\n addToWindow(registry: TestabilityRegistry): void;\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null;\n}\n\nclass _NoopGetTestability implements GetTestability {\n addToWindow(registry: TestabilityRegistry): void {}\n findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean):\n Testability|null {\n return null;\n }\n}\n\n/**\n * Set the {@link GetTestability} implementation used by the Angular testing framework.\n * @publicApi\n */\nexport function setTestabilityGetter(getter: GetTestability): void {\n _testabilityGetter = getter;\n}\n\nlet _testabilityGetter: GetTestability = new _NoopGetTestability();\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable, Observer, Subscription, merge} from 'rxjs';\nimport {share} from 'rxjs/operators';\n\nimport {ApplicationInitStatus} from './application_init';\nimport {APP_BOOTSTRAP_LISTENER, PLATFORM_INITIALIZER} from './application_tokens';\nimport {Console} from './console';\nimport {Injectable, InjectionToken, Injector, StaticProvider} from './di';\nimport {ErrorHandler} from './error_handler';\nimport {isDevMode} from './is_dev_mode';\nimport {CompilerFactory, CompilerOptions} from './linker/compiler';\nimport {ComponentFactory, ComponentRef} from './linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from './linker/component_factory_resolver';\nimport {InternalNgModuleRef, NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nimport {InternalViewRef, ViewRef} from './linker/view_ref';\nimport {WtfScopeFn, wtfCreateScope, wtfLeave} from './profile/profile';\nimport {assertNgModuleType} from './render3/assert';\nimport {NgModuleFactory as R3NgModuleFactory} from './render3/ng_module_ref';\nimport {Testability, TestabilityRegistry} from './testability/testability';\nimport {Type} from './type';\nimport {scheduleMicroTask, stringify} from './util';\nimport {isPromise} from './util/lang';\nimport {NgZone, NoopNgZone} from './zone/ng_zone';\n\nlet _platform: PlatformRef;\n\nlet compileNgModuleFactory:\n <M>(injector: Injector, options: CompilerOptions, moduleType: Type<M>) =>\n Promise<NgModuleFactory<M>> = compileNgModuleFactory__PRE_R3__;\n\nfunction compileNgModuleFactory__PRE_R3__<M>(\n injector: Injector, options: CompilerOptions,\n moduleType: Type<M>): Promise<NgModuleFactory<M>> {\n const compilerFactory: CompilerFactory = injector.get(CompilerFactory);\n const compiler = compilerFactory.createCompiler([options]);\n return compiler.compileModuleAsync(moduleType);\n}\n\nexport function compileNgModuleFactory__POST_R3__<M>(\n injector: Injector, options: CompilerOptions,\n moduleType: Type<M>): Promise<NgModuleFactory<M>> {\n ngDevMode && assertNgModuleType(moduleType);\n return Promise.resolve(new R3NgModuleFactory(moduleType));\n}\n\nexport const ALLOW_MULTIPLE_PLATFORMS = new InjectionToken<boolean>('AllowMultipleToken');\n\n\n\n/**\n * A token for third-party components that can register themselves with NgProbe.\n *\n * @publicApi\n */\nexport class NgProbeToken {\n constructor(public name: string, public token: any) {}\n}\n\n/**\n * Creates a platform.\n * Platforms have to be eagerly created via this function.\n *\n * @publicApi\n */\nexport function createPlatform(injector: Injector): PlatformRef {\n if (_platform && !_platform.destroyed &&\n !_platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n throw new Error(\n 'There can be only one platform. Destroy the previous one to create a new one.');\n }\n _platform = injector.get(PlatformRef);\n const inits = injector.get(PLATFORM_INITIALIZER, null);\n if (inits) inits.forEach((init: any) => init());\n return _platform;\n}\n\n/**\n * Creates a factory for a platform\n *\n * @publicApi\n */\nexport function createPlatformFactory(\n parentPlatformFactory: ((extraProviders?: StaticProvider[]) => PlatformRef) | null,\n name: string, providers: StaticProvider[] = []): (extraProviders?: StaticProvider[]) =>\n PlatformRef {\n const desc = `Platform: ${name}`;\n const marker = new InjectionToken(desc);\n return (extraProviders: StaticProvider[] = []) => {\n let platform = getPlatform();\n if (!platform || platform.injector.get(ALLOW_MULTIPLE_PLATFORMS, false)) {\n if (parentPlatformFactory) {\n parentPlatformFactory(\n providers.concat(extraProviders).concat({provide: marker, useValue: true}));\n } else {\n const injectedProviders: StaticProvider[] =\n providers.concat(extraProviders).concat({provide: marker, useValue: true});\n createPlatform(Injector.create({providers: injectedProviders, name: desc}));\n }\n }\n return assertPlatform(marker);\n };\n}\n\n/**\n * Checks that there currently is a platform which contains the given token as a provider.\n *\n * @publicApi\n */\nexport function assertPlatform(requiredToken: any): PlatformRef {\n const platform = getPlatform();\n\n if (!platform) {\n throw new Error('No platform exists!');\n }\n\n if (!platform.injector.get(requiredToken, null)) {\n throw new Error(\n 'A platform with a different configuration has been created. Please destroy it first.');\n }\n\n return platform;\n}\n\n/**\n * Destroy the existing platform.\n *\n * @publicApi\n */\nexport function destroyPlatform(): void {\n if (_platform && !_platform.destroyed) {\n _platform.destroy();\n }\n}\n\n/**\n * Returns the current platform.\n *\n * @publicApi\n */\nexport function getPlatform(): PlatformRef|null {\n return _platform && !_platform.destroyed ? _platform : null;\n}\n\n/**\n * Provides additional options to the bootstraping process.\n *\n *\n */\nexport interface BootstrapOptions {\n /**\n * Optionally specify which `NgZone` should be used.\n *\n * - Provide your own `NgZone` instance.\n * - `zone.js` - Use default `NgZone` which requires `Zone.js`.\n * - `noop` - Use `NoopNgZone` which does nothing.\n */\n ngZone?: NgZone|'zone.js'|'noop';\n}\n\n/**\n * The Angular platform is the entry point for Angular on a web page. Each page\n * has exactly one platform, and services (such as reflection) which are common\n * to every Angular application running on the page are bound in its scope.\n *\n * A page's platform is initialized implicitly when a platform is created via a platform factory\n * (e.g. {@link platformBrowser}), or explicitly by calling the {@link createPlatform} function.\n *\n * @publicApi\n */\n@Injectable()\nexport class PlatformRef {\n private _modules: NgModuleRef<any>[] = [];\n private _destroyListeners: Function[] = [];\n private _destroyed: boolean = false;\n\n /** @internal */\n constructor(private _injector: Injector) {}\n\n /**\n * Creates an instance of an `@NgModule` for the given platform\n * for offline compilation.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * my_module.ts:\n *\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * main.ts:\n * import {MyModuleNgFactory} from './my_module.ngfactory';\n * import {platformBrowser} from '@angular/platform-browser';\n *\n * let moduleRef = platformBrowser().bootstrapModuleFactory(MyModuleNgFactory);\n * ```\n */\n bootstrapModuleFactory<M>(moduleFactory: NgModuleFactory<M>, options?: BootstrapOptions):\n Promise<NgModuleRef<M>> {\n // Note: We need to create the NgZone _before_ we instantiate the module,\n // as instantiating the module creates some providers eagerly.\n // So we create a mini parent injector that just contains the new NgZone and\n // pass that as parent to the NgModuleFactory.\n const ngZoneOption = options ? options.ngZone : undefined;\n const ngZone = getNgZone(ngZoneOption);\n const providers: StaticProvider[] = [{provide: NgZone, useValue: ngZone}];\n // Attention: Don't use ApplicationRef.run here,\n // as we want to be sure that all possible constructor calls are inside `ngZone.run`!\n return ngZone.run(() => {\n const ngZoneInjector = Injector.create(\n {providers: providers, parent: this.injector, name: moduleFactory.moduleType.name});\n const moduleRef = <InternalNgModuleRef<M>>moduleFactory.create(ngZoneInjector);\n const exceptionHandler: ErrorHandler = moduleRef.injector.get(ErrorHandler, null);\n if (!exceptionHandler) {\n throw new Error('No ErrorHandler. Is platform module (BrowserModule) included?');\n }\n moduleRef.onDestroy(() => remove(this._modules, moduleRef));\n ngZone !.runOutsideAngular(\n () => ngZone !.onError.subscribe(\n {next: (error: any) => { exceptionHandler.handleError(error); }}));\n return _callAndReportToErrorHandler(exceptionHandler, ngZone !, () => {\n const initStatus: ApplicationInitStatus = moduleRef.injector.get(ApplicationInitStatus);\n initStatus.runInitializers();\n return initStatus.donePromise.then(() => {\n this._moduleDoBootstrap(moduleRef);\n return moduleRef;\n });\n });\n });\n }\n\n /**\n * Creates an instance of an `@NgModule` for a given platform using the given runtime compiler.\n *\n * @usageNotes\n * ### Simple Example\n *\n * ```typescript\n * @NgModule({\n * imports: [BrowserModule]\n * })\n * class MyModule {}\n *\n * let moduleRef = platformBrowser().bootstrapModule(MyModule);\n * ```\n *\n */\n bootstrapModule<M>(\n moduleType: Type<M>, compilerOptions: (CompilerOptions&BootstrapOptions)|\n Array<CompilerOptions&BootstrapOptions> = []): Promise<NgModuleRef<M>> {\n const options = optionsReducer({}, compilerOptions);\n return compileNgModuleFactory(this.injector, options, moduleType)\n .then(moduleFactory => this.bootstrapModuleFactory(moduleFactory, options));\n }\n\n private _moduleDoBootstrap(moduleRef: InternalNgModuleRef<any>): void {\n const appRef = moduleRef.injector.get(ApplicationRef) as ApplicationRef;\n if (moduleRef._bootstrapComponents.length > 0) {\n moduleRef._bootstrapComponents.forEach(f => appRef.bootstrap(f));\n } else if (moduleRef.instance.ngDoBootstrap) {\n moduleRef.instance.ngDoBootstrap(appRef);\n } else {\n throw new Error(\n `The module ${stringify(moduleRef.instance.constructor)} was bootstrapped, but it does not declare \"@NgModule.bootstrap\" components nor a \"ngDoBootstrap\" method. ` +\n `Please define one of these.`);\n }\n this._modules.push(moduleRef);\n }\n\n /**\n * Register a listener to be called when the platform is disposed.\n */\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n\n /**\n * Retrieve the platform {@link Injector}, which is the parent injector for\n * every Angular application on the page and provides singleton providers.\n */\n get injector(): Injector { return this._injector; }\n\n /**\n * Destroy the Angular platform and all Angular applications on the page.\n */\n destroy() {\n if (this._destroyed) {\n throw new Error('The platform has already been destroyed!');\n }\n this._modules.slice().forEach(module => module.destroy());\n this._destroyListeners.forEach(listener => listener());\n this._destroyed = true;\n }\n\n get destroyed() { return this._destroyed; }\n}\n\nfunction getNgZone(ngZoneOption?: NgZone | 'zone.js' | 'noop'): NgZone {\n let ngZone: NgZone;\n\n if (ngZoneOption === 'noop') {\n ngZone = new NoopNgZone();\n } else {\n ngZone = (ngZoneOption === 'zone.js' ? undefined : ngZoneOption) ||\n new NgZone({enableLongStackTrace: isDevMode()});\n }\n return ngZone;\n}\n\nfunction _callAndReportToErrorHandler(\n errorHandler: ErrorHandler, ngZone: NgZone, callback: () => any): any {\n try {\n const result = callback();\n if (isPromise(result)) {\n return result.catch((e: any) => {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n });\n }\n\n return result;\n } catch (e) {\n ngZone.runOutsideAngular(() => errorHandler.handleError(e));\n // rethrow as the exception handler might not do it\n throw e;\n }\n}\n\nfunction optionsReducer<T extends Object>(dst: any, objs: T | T[]): T {\n if (Array.isArray(objs)) {\n dst = objs.reduce(optionsReducer, dst);\n } else {\n dst = {...dst, ...(objs as any)};\n }\n return dst;\n}\n\n/**\n * A reference to an Angular application running on a page.\n *\n * @usageNotes\n *\n * {@a is-stable-examples}\n * ### isStable examples and caveats\n *\n * Note two important points about `isStable`, demonstrated in the examples below:\n * - the application will never be stable if you start any kind\n * of recurrent asynchronous task when the application starts\n * (for example for a polling process, started with a `setInterval`, a `setTimeout`\n * or using RxJS operators like `interval`);\n * - the `isStable` Observable runs outside of the Angular zone.\n *\n * Let's imagine that you start a recurrent task\n * (here incrementing a counter, using RxJS `interval`),\n * and at the same time subscribe to `isStable`.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * filter(stable => stable)\n * ).subscribe(() => console.log('App is stable now');\n * interval(1000).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, `isStable` will never emit `true`,\n * and the trace \"App is stable now\" will never get logged.\n *\n * If you want to execute something when the app is stable,\n * you have to wait for the application to be stable\n * before starting your polling process.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * tap(stable => console.log('App is stable now')),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => console.log(counter));\n * }\n * ```\n * In this example, the trace \"App is stable now\" will be logged\n * and then the counter starts incrementing every second.\n *\n * Note also that this Observable runs outside of the Angular zone,\n * which means that the code in the subscription\n * to this Observable will not trigger the change detection.\n *\n * Let's imagine that instead of logging the counter value,\n * you update a field of your component\n * and display it in its template.\n *\n * ```\n * constructor(appRef: ApplicationRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => this.value = counter);\n * }\n * ```\n * As the `isStable` Observable runs outside the zone,\n * the `value` field will be updated properly,\n * but the template will not be refreshed!\n *\n * You'll have to manually trigger the change detection to update the template.\n *\n * ```\n * constructor(appRef: ApplicationRef, cd: ChangeDetectorRef) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => {\n * this.value = counter;\n * cd.detectChanges();\n * });\n * }\n * ```\n *\n * Or make the subscription callback run inside the zone.\n *\n * ```\n * constructor(appRef: ApplicationRef, zone: NgZone) {\n * appRef.isStable.pipe(\n * first(stable => stable),\n * switchMap(() => interval(1000))\n * ).subscribe(counter => zone.run(() => this.value = counter));\n * }\n * ```\n *\n * @publicApi\n */\n@Injectable()\nexport class ApplicationRef {\n /** @internal */\n static _tickScope: WtfScopeFn = wtfCreateScope('ApplicationRef#tick()');\n private _bootstrapListeners: ((compRef: ComponentRef<any>) => void)[] = [];\n private _views: InternalViewRef[] = [];\n private _runningTick: boolean = false;\n private _enforceNoNewChanges: boolean = false;\n private _stable = true;\n\n /**\n * Get a list of component types registered to this application.\n * This list is populated even before the component is created.\n */\n public readonly componentTypes: Type<any>[] = [];\n\n /**\n * Get a list of components registered to this application.\n */\n public readonly components: ComponentRef<any>[] = [];\n\n /**\n * Returns an Observable that indicates when the application is stable or unstable.\n *\n * @see [Usage notes](#is-stable-examples) for examples and caveats when using this API.\n */\n // TODO(issue/24571): remove '!'.\n public readonly isStable !: Observable<boolean>;\n\n /** @internal */\n constructor(\n private _zone: NgZone, private _console: Console, private _injector: Injector,\n private _exceptionHandler: ErrorHandler,\n private _componentFactoryResolver: ComponentFactoryResolver,\n private _initStatus: ApplicationInitStatus) {\n this._enforceNoNewChanges = isDevMode();\n\n this._zone.onMicrotaskEmpty.subscribe(\n {next: () => { this._zone.run(() => { this.tick(); }); }});\n\n const isCurrentlyStable = new Observable<boolean>((observer: Observer<boolean>) => {\n this._stable = this._zone.isStable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks;\n this._zone.runOutsideAngular(() => {\n observer.next(this._stable);\n observer.complete();\n });\n });\n\n const isStable = new Observable<boolean>((observer: Observer<boolean>) => {\n // Create the subscription to onStable outside the Angular Zone so that\n // the callback is run outside the Angular Zone.\n let stableSub: Subscription;\n this._zone.runOutsideAngular(() => {\n stableSub = this._zone.onStable.subscribe(() => {\n NgZone.assertNotInAngularZone();\n\n // Check whether there are no pending macro/micro tasks in the next tick\n // to allow for NgZone to update the state.\n scheduleMicroTask(() => {\n if (!this._stable && !this._zone.hasPendingMacrotasks &&\n !this._zone.hasPendingMicrotasks) {\n this._stable = true;\n observer.next(true);\n }\n });\n });\n });\n\n const unstableSub: Subscription = this._zone.onUnstable.subscribe(() => {\n NgZone.assertInAngularZone();\n if (this._stable) {\n this._stable = false;\n this._zone.runOutsideAngular(() => { observer.next(false); });\n }\n });\n\n return () => {\n stableSub.unsubscribe();\n unstableSub.unsubscribe();\n };\n });\n\n (this as{isStable: Observable<boolean>}).isStable =\n merge(isCurrentlyStable, isStable.pipe(share()));\n }\n\n /**\n * Bootstrap a new component at the root level of the application.\n *\n * @usageNotes\n * ### Bootstrap process\n *\n * When bootstrapping a new root component into an application, Angular mounts the\n * specified application component onto DOM elements identified by the componentType's\n * selector and kicks off automatic change detection to finish initializing the component.\n *\n * Optionally, a component can be mounted onto a DOM element that does not match the\n * componentType's selector.\n *\n * ### Example\n * {@example core/ts/platform/platform.ts region='longform'}\n */\n bootstrap<C>(componentOrFactory: ComponentFactory<C>|Type<C>, rootSelectorOrNode?: string|any):\n ComponentRef<C> {\n if (!this._initStatus.done) {\n throw new Error(\n 'Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.');\n }\n let componentFactory: ComponentFactory<C>;\n if (componentOrFactory instanceof ComponentFactory) {\n componentFactory = componentOrFactory;\n } else {\n componentFactory =\n this._componentFactoryResolver.resolveComponentFactory(componentOrFactory) !;\n }\n this.componentTypes.push(componentFactory.componentType);\n\n // Create a factory associated with the current module if it's not bound to some other\n const ngModule = componentFactory instanceof ComponentFactoryBoundToModule ?\n null :\n this._injector.get(NgModuleRef);\n const selectorOrNode = rootSelectorOrNode || componentFactory.selector;\n const compRef = componentFactory.create(Injector.NULL, [], selectorOrNode, ngModule);\n\n compRef.onDestroy(() => { this._unloadComponent(compRef); });\n const testability = compRef.injector.get(Testability, null);\n if (testability) {\n compRef.injector.get(TestabilityRegistry)\n .registerApplication(compRef.location.nativeElement, testability);\n }\n\n this._loadComponent(compRef);\n if (isDevMode()) {\n this._console.log(\n `Angular is running in the development mode. Call enableProdMode() to enable the production mode.`);\n }\n return compRef;\n }\n\n /**\n * Invoke this method to explicitly process change detection and its side-effects.\n *\n * In development mode, `tick()` also performs a second change detection cycle to ensure that no\n * further changes are detected. If additional changes are picked up during this second cycle,\n * bindings in the app have side-effects that cannot be resolved in a single change detection\n * pass.\n * In this case, Angular throws an error, since an Angular application can only have one change\n * detection pass during which all change detection must complete.\n */\n tick(): void {\n if (this._runningTick) {\n throw new Error('ApplicationRef.tick is called recursively');\n }\n\n const scope = ApplicationRef._tickScope();\n try {\n this._runningTick = true;\n this._views.forEach((view) => view.detectChanges());\n if (this._enforceNoNewChanges) {\n this._views.forEach((view) => view.checkNoChanges());\n }\n } catch (e) {\n // Attention: Don't rethrow as it could cancel subscriptions to Observables!\n this._zone.runOutsideAngular(() => this._exceptionHandler.handleError(e));\n } finally {\n this._runningTick = false;\n wtfLeave(scope);\n }\n }\n\n /**\n * Attaches a view so that it will be dirty checked.\n * The view will be automatically detached when it is destroyed.\n * This will throw if the view is already attached to a ViewContainer.\n */\n attachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n this._views.push(view);\n view.attachToAppRef(this);\n }\n\n /**\n * Detaches a view from dirty checking again.\n */\n detachView(viewRef: ViewRef): void {\n const view = (viewRef as InternalViewRef);\n remove(this._views, view);\n view.detachFromAppRef();\n }\n\n private _loadComponent(componentRef: ComponentRef<any>): void {\n this.attachView(componentRef.hostView);\n this.tick();\n this.components.push(componentRef);\n // Get the listeners lazily to prevent DI cycles.\n const listeners =\n this._injector.get(APP_BOOTSTRAP_LISTENER, []).concat(this._bootstrapListeners);\n listeners.forEach((listener) => listener(componentRef));\n }\n\n private _unloadComponent(componentRef: ComponentRef<any>): void {\n this.detachView(componentRef.hostView);\n remove(this.components, componentRef);\n }\n\n /** @internal */\n ngOnDestroy() {\n // TODO(alxhub): Dispose of the NgZone.\n this._views.slice().forEach((view) => view.destroy());\n }\n\n /**\n * Returns the number of attached views.\n */\n get viewCount() { return this._views.length; }\n}\n\nfunction remove<T>(list: T[], el: T): void {\n const index = list.indexOf(el);\n if (index > -1) {\n list.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for Zone\nexport {NgZone, NoopNgZone as ɵNoopNgZone} from './zone/ng_zone';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for render\nexport {RenderComponentType, Renderer, Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2, RootRenderer} from './render/api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Observable} from 'rxjs';\n\nimport {EventEmitter} from '../event_emitter';\nimport {getSymbolIterator} from '../util';\n\n\n/**\n * An unmodifiable list of items that Angular keeps up to date when the state\n * of the application changes.\n *\n * The type of object that {@link ViewChildren}, {@link ContentChildren}, and {@link QueryList}\n * provide.\n *\n * Implements an iterable interface, therefore it can be used in both ES6\n * javascript `for (var i of items)` loops as well as in Angular templates with\n * `*ngFor=\"let i of myList\"`.\n *\n * Changes can be observed by subscribing to the changes `Observable`.\n *\n * NOTE: In the future this class will implement an `Observable` interface.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * @Component({...})\n * class Container {\n * @ViewChildren(Item) items:QueryList<Item>;\n * }\n * ```\n *\n * @publicApi\n */\nexport class QueryList<T>/* implements Iterable<T> */ {\n public readonly dirty = true;\n private _results: Array<T> = [];\n public readonly changes: Observable<any> = new EventEmitter();\n\n readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n readonly first !: T;\n // TODO(issue/24571): remove '!'.\n readonly last !: T;\n\n /**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n */\n map<U>(fn: (item: T, index: number, array: T[]) => U): U[] { return this._results.map(fn); }\n\n /**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n */\n filter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n\n /**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n */\n find(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._results.find(fn);\n }\n\n /**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n */\n reduce<U>(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n\n /**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n */\n forEach(fn: (item: T, index: number, array: T[]) => void): void { this._results.forEach(fn); }\n\n /**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n */\n some(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n\n toArray(): T[] { return this._results.slice(); }\n\n [getSymbolIterator()](): Iterator<T> { return (this._results as any)[getSymbolIterator()](); }\n\n toString(): string { return this._results.toString(); }\n\n reset(res: Array<T|any[]>): void {\n this._results = flatten(res);\n (this as{dirty: boolean}).dirty = false;\n (this as{length: number}).length = this._results.length;\n (this as{last: T}).last = this._results[this.length - 1];\n (this as{first: T}).first = this._results[0];\n }\n\n notifyOnChanges(): void { (this.changes as EventEmitter<any>).emit(this); }\n\n /** internal */\n setDirty() { (this as{dirty: boolean}).dirty = true; }\n\n /** internal */\n destroy(): void {\n (this.changes as EventEmitter<any>).complete();\n (this.changes as EventEmitter<any>).unsubscribe();\n }\n}\n\nfunction flatten<T>(list: Array<T|T[]>): T[] {\n return list.reduce((flat: any[], item: T | T[]): T[] => {\n const flatItem = Array.isArray(item) ? flatten(item) : item;\n return (<T[]>flat).concat(flatItem);\n }, []);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional} from '../di';\n\nimport {Compiler} from './compiler';\nimport {NgModuleFactory} from './ng_module_factory';\nimport {NgModuleFactoryLoader} from './ng_module_factory_loader';\n\nconst _SEPARATOR = '#';\n\nconst FACTORY_CLASS_SUFFIX = 'NgFactory';\ndeclare var System: any;\n\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n *\n * @publicApi\n */\nexport abstract class SystemJsNgModuleLoaderConfig {\n /**\n * Prefix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathPrefix !: string;\n\n /**\n * Suffix to add when computing the name of the factory module for a given module name.\n */\n // TODO(issue/24571): remove '!'.\n factoryPathSuffix !: string;\n}\n\nconst DEFAULT_CONFIG: SystemJsNgModuleLoaderConfig = {\n factoryPathPrefix: '',\n factoryPathSuffix: '.ngfactory',\n};\n\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * @publicApi\n */\n@Injectable()\nexport class SystemJsNgModuleLoader implements NgModuleFactoryLoader {\n private _config: SystemJsNgModuleLoaderConfig;\n\n constructor(private _compiler: Compiler, @Optional() config?: SystemJsNgModuleLoaderConfig) {\n this._config = config || DEFAULT_CONFIG;\n }\n\n load(path: string): Promise<NgModuleFactory<any>> {\n const offlineMode = this._compiler instanceof Compiler;\n return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n }\n\n private loadAndCompile(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n if (exportName === undefined) {\n exportName = 'default';\n }\n\n return System.import(module)\n .then((module: any) => module[exportName])\n .then((type: any) => checkNotEmpty(type, module, exportName))\n .then((type: any) => this._compiler.compileModuleAsync(type));\n }\n\n private loadFactory(path: string): Promise<NgModuleFactory<any>> {\n let [module, exportName] = path.split(_SEPARATOR);\n let factoryClassSuffix = FACTORY_CLASS_SUFFIX;\n if (exportName === undefined) {\n exportName = 'default';\n factoryClassSuffix = '';\n }\n\n return System.import(this._config.factoryPathPrefix + module + this._config.factoryPathSuffix)\n .then((module: any) => module[exportName + factoryClassSuffix])\n .then((factory: any) => checkNotEmpty(factory, module, exportName));\n }\n}\n\nfunction checkNotEmpty(value: any, modulePath: string, exportName: string): any {\n if (!value) {\n throw new Error(`Cannot find '${exportName}' in '${modulePath}'`);\n }\n return value;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {injectViewContainerRef as render3InjectViewContainerRef} from '../render3/view_engine_compatibility';\nimport {noop} from '../util/noop';\n\nimport {ComponentFactory, ComponentRef} from './component_factory';\nimport {ElementRef} from './element_ref';\nimport {NgModuleRef} from './ng_module_factory';\nimport {TemplateRef} from './template_ref';\nimport {EmbeddedViewRef, ViewRef} from './view_ref';\n\n\n/**\n * Represents a container where one or more views can be attached to a component.\n *\n * Can contain *host views* (created by instantiating a\n * component with the `createComponent()` method), and *embedded views*\n * (created by instantiating a `TemplateRef` with the `createEmbeddedView()` method).\n *\n * A view container instance can contain other view containers,\n * creating a [view hierarchy](guide/glossary#view-tree).\n *\n * @see `ComponentRef`\n * @see `EmbeddedViewRef`\n *\n * @publicApi\n */\nexport abstract class ViewContainerRef {\n /**\n * Anchor element that specifies the location of this container in the containing view.\n * Each view container can have only one anchor element, and each anchor element\n * can have only a single view container.\n *\n * Root elements of views attached to this container become siblings of the anchor element in\n * the rendered view.\n *\n * Access the `ViewContainerRef` of an element by placing a `Directive` injected\n * with `ViewContainerRef` on the element, or use a `ViewChild` query.\n *\n * <!-- TODO: rename to anchorElement -->\n */\n abstract get element(): ElementRef;\n\n /**\n * The [dependency injector](guide/glossary#injector) for this view container.\n */\n abstract get injector(): Injector;\n\n /** @deprecated No replacement */\n abstract get parentInjector(): Injector;\n\n /**\n * Destroys all views in this container.\n */\n abstract clear(): void;\n\n /**\n * Retrieves a view from this container.\n * @param index The 0-based index of the view to retrieve.\n * @returns The `ViewRef` instance, or null if the index is out of range.\n */\n abstract get(index: number): ViewRef|null;\n\n /**\n * Reports how many views are currently attached to this container.\n * @returns The number of views.\n */\n abstract get length(): number;\n\n /**\n * Instantiates an embedded view and inserts it\n * into this container.\n * @param templateRef The HTML template that defines the view.\n * @param index The 0-based index at which to insert the new view into this container.\n * If not specified, appends the new view as the last entry.\n *\n * @returns The `ViewRef` instance for the newly created view.\n */\n abstract createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C>;\n\n /**\n * Instantiates a single component and inserts its host view into this container.\n *\n * @param componentFactory The factory to use.\n * @param index The index at which to insert the new component's host view into this container.\n * If not specified, appends the new view as the last entry.\n * @param injector The injector to use as the parent for the new component.\n * @param projectableNodes\n * @param ngModule\n *\n * @returns The new component instance, containing the host view.\n *\n */\n abstract createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModule?: NgModuleRef<any>): ComponentRef<C>;\n\n /**\n * Inserts a view into this container.\n * @param viewRef The view to insert.\n * @param index The 0-based index at which to insert the view.\n * If not specified, appends the new view as the last entry.\n * @returns The inserted `ViewRef` instance.\n *\n */\n abstract insert(viewRef: ViewRef, index?: number): ViewRef;\n\n /**\n * Moves a view to a new location in this container.\n * @param viewRef The view to move.\n * @param index The 0-based index of the new location.\n * @returns The moved `ViewRef` instance.\n */\n abstract move(viewRef: ViewRef, currentIndex: number): ViewRef;\n\n /**\n * Returns the index of a view within the current container.\n * @param viewRef The view to query.\n * @returns The 0-based index of the view's position in this container,\n * or `-1` if this container doesn't contain the view.\n */\n abstract indexOf(viewRef: ViewRef): number;\n\n /**\n * Destroys a view attached to this container\n * @param index The 0-based index of the view to destroy.\n * If not specified, the last view in the container is removed.\n */\n abstract remove(index?: number): void;\n\n /**\n * Detaches a view from this container without destroying it.\n * Use along with `insert()` to move a view within the current container.\n * @param index The 0-based index of the view to detach.\n * If not specified, the last view in the container is detached.\n */\n abstract detach(index?: number): ViewRef|null;\n\n /** @internal */\n static __NG_ELEMENT_ID__:\n () => ViewContainerRef = () => SWITCH_VIEW_CONTAINER_REF_FACTORY(ViewContainerRef, ElementRef)\n}\n\nexport const SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ = render3InjectViewContainerRef;\nconst SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__ = noop;\nconst SWITCH_VIEW_CONTAINER_REF_FACTORY: typeof render3InjectViewContainerRef =\n SWITCH_VIEW_CONTAINER_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {injectChangeDetectorRef as render3InjectChangeDetectorRef} from '../render3/view_engine_compatibility';\n\n/**\n * Base class for Angular Views, provides change detection functionality.\n * A change-detection tree collects all views that are to be checked for changes.\n * Use the methods to add and remove views from the tree, initiate change-detection,\n * and explicitly mark views as _dirty_, meaning that they have changed and need to be rerendered.\n *\n * @usageNotes\n *\n * The following examples demonstrate how to modify default change-detection behavior\n * to perform explicit detection when needed.\n *\n * ### Use `markForCheck()` with `CheckOnce` strategy\n *\n * The following example sets the `OnPush` change-detection strategy for a component\n * (`CheckOnce`, rather than the default `CheckAlways`), then forces a second check\n * after an interval. See [live demo](http://plnkr.co/edit/GC512b?p=preview).\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\"\n * region=\"mark-for-check\"></code-example>\n *\n * ### Detach change detector to limit how often check occurs\n *\n * The following example defines a component with a large list of read-only data\n * that is expected to change constantly, many times per second.\n * To improve performance, we want to check and update the list\n * less often than the changes actually occur. To do that, we detach\n * the component's change detector and perform an explicit local check every five seconds.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"detach\"></code-example>\n *\n *\n * ### Reattaching a detached component\n *\n * The following example creates a component displaying live data.\n * The component detaches its change detector from the main change detector tree\n * when the `live` property is set to false, and reattaches it when the property\n * becomes true.\n *\n * <code-example path=\"core/ts/change_detect/change-detection.ts\" region=\"reattach\"></code-example>\n *\n * @publicApi\n */\nexport abstract class ChangeDetectorRef {\n /**\n * When a view uses the {@link ChangeDetectionStrategy#OnPush OnPush} (checkOnce)\n * change detection strategy, explicitly marks the view as changed so that\n * it can be checked again.\n *\n * Components are normally marked as dirty (in need of rerendering) when inputs\n * have changed or events have fired in the view. Call this method to ensure that\n * a component is checked even if these triggers have not occured.\n *\n * <!-- TODO: Add a link to a chapter on OnPush components -->\n *\n */\n abstract markForCheck(): void;\n\n /**\n * Detaches this view from the change-detection tree.\n * A detached view is not checked until it is reattached.\n * Use in combination with `detectChanges()` to implement local change detection checks.\n *\n * Detached views are not checked during change detection runs until they are\n * re-attached, even if they are marked as dirty.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detach(): void;\n\n /**\n * Checks this view and its children. Use in combination with {@link ChangeDetectorRef#detach\n * detach}\n * to implement local change detection checks.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n * <!-- TODO: Add a live demo once ref.detectChanges is merged into master -->\n *\n */\n abstract detectChanges(): void;\n\n /**\n * Checks the change detector and its children, and throws if any changes are detected.\n *\n * Use in development mode to verify that running change detection doesn't introduce\n * other changes.\n */\n abstract checkNoChanges(): void;\n\n /**\n * Re-attaches the previously detached view to the change detection tree.\n * Views are attached to the tree by default.\n *\n * <!-- TODO: Add a link to a chapter on detach/reattach/local digest -->\n *\n */\n abstract reattach(): void;\n\n /** @internal */\n static __NG_ELEMENT_ID__: () => ChangeDetectorRef = () => SWITCH_CHANGE_DETECTOR_REF_FACTORY();\n}\n\n\n\nexport const SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ = render3InjectChangeDetectorRef;\nconst SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__ = (...args: any[]): any => {};\nconst SWITCH_CHANGE_DETECTOR_REF_FACTORY: typeof render3InjectChangeDetectorRef =\n SWITCH_CHANGE_DETECTOR_REF_FACTORY__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detector_ref';\n\n/**\n * Represents an Angular [view](guide/glossary#view),\n * specifically the [host view](guide/glossary#view-tree) that is defined by a component.\n * Also serves as the base class\n * that adds destroy methods for [embedded views](guide/glossary#view-tree).\n *\n * @see `EmbeddedViewRef`\n *\n * @publicApi\n */\nexport abstract class ViewRef extends ChangeDetectorRef {\n /**\n * Destroys this view and all of the data structures associated with it.\n */\n abstract destroy(): void;\n\n /**\n * Reports whether this view has been destroyed.\n * @returns True after the `destroy()` method has been called, false otherwise.\n */\n abstract get destroyed(): boolean;\n\n /**\n * A lifecycle hook that provides additional developer-defined cleanup\n * functionality for views.\n * @param callback A handler function that cleans up developer-defined data\n * associated with a view. Called when the `destroy()` method is invoked.\n */\n abstract onDestroy(callback: Function): any /** TODO #9100 */;\n}\n\n/**\n * Represents an Angular [view](guide/glossary#view) in a view container.\n * An [embedded view](guide/glossary#view-tree) can be referenced from a component\n * other than the hosting component whose template defines it, or it can be defined\n * independently by a `TemplateRef`.\n *\n * Properties of elements in a view can change, but the structure (number and order) of elements in\n * a view cannot. Change the structure of elements by inserting, moving, or\n * removing nested views in a view container.\n *\n * @see `ViewContainerRef`\n *\n * @usageNotes\n *\n * The following template breaks down into two separate `TemplateRef` instances,\n * an outer one and an inner one.\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <li *ngFor=\"let item of items\">{{item}}</li>\n * </ul>\n * ```\n *\n * This is the outer `TemplateRef`:\n *\n * ```\n * Count: {{items.length}}\n * <ul>\n * <ng-template ngFor let-item [ngForOf]=\"items\"></ng-template>\n * </ul>\n * ```\n *\n * This is the inner `TemplateRef`:\n *\n * ```\n * <li>{{item}}</li>\n * ```\n *\n * The outer and inner `TemplateRef` instances are assembled into views as follows:\n *\n * ```\n * <!-- ViewRef: outer-0 -->\n * Count: 2\n * <ul>\n * <ng-template view-container-ref></ng-template>\n * <!-- ViewRef: inner-1 --><li>first</li><!-- /ViewRef: inner-1 -->\n * <!-- ViewRef: inner-2 --><li>second</li><!-- /ViewRef: inner-2 -->\n * </ul>\n * <!-- /ViewRef: outer-0 -->\n * ```\n * @publicApi\n */\nexport abstract class EmbeddedViewRef<C> extends ViewRef {\n /**\n * The context for this view, inherited from the anchor element.\n */\n abstract get context(): C;\n\n /**\n * The root nodes for this embedded view.\n */\n abstract get rootNodes(): any[];\n}\n\nexport interface InternalViewRef extends ViewRef {\n detachFromAppRef(): void;\n attachToAppRef(appRef: ApplicationRef): void;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// Public API for compiler\nexport {COMPILER_OPTIONS, Compiler, CompilerFactory, CompilerOptions, ModuleWithComponentFactories} from './linker/compiler';\nexport {ComponentFactory, ComponentRef} from './linker/component_factory';\nexport {ComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {ElementRef} from './linker/element_ref';\nexport {NgModuleFactory, NgModuleRef} from './linker/ng_module_factory';\nexport {NgModuleFactoryLoader, getModuleFactory} from './linker/ng_module_factory_loader';\nexport {QueryList} from './linker/query_list';\nexport {SystemJsNgModuleLoader, SystemJsNgModuleLoaderConfig} from './linker/system_js_ng_module_factory_loader';\nexport {TemplateRef} from './linker/template_ref';\nexport {ViewContainerRef} from './linker/view_container_ref';\nexport {EmbeddedViewRef, ViewRef} from './linker/view_ref';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {assertDomNode} from '../render3/assert';\nimport {getComponent, getContext, getInjectionTokens, getInjector, getListeners, getLocalRefs, isBrowserEvents, loadLContext, loadLContextFromNode} from '../render3/discovery_utils';\nimport {TNode} from '../render3/interfaces/node';\nimport {StylingIndex} from '../render3/interfaces/styling';\nimport {TVIEW} from '../render3/interfaces/view';\nimport {getProp, getValue, isClassBasedValue} from '../render3/styling/class_and_style_bindings';\nimport {getStylingContext} from '../render3/styling/util';\nimport {DebugContext} from '../view/index';\n\nexport class EventListener {\n constructor(public name: string, public callback: Function) {}\n}\n\n/**\n * @publicApi\n */\nexport interface DebugNode {\n readonly listeners: EventListener[];\n readonly parent: DebugElement|null;\n readonly nativeNode: any;\n readonly injector: Injector;\n readonly componentInstance: any;\n readonly context: any;\n readonly references: {[key: string]: any};\n readonly providerTokens: any[];\n}\nexport class DebugNode__PRE_R3__ {\n readonly listeners: EventListener[] = [];\n readonly parent: DebugElement|null = null;\n readonly nativeNode: any;\n private readonly _debugContext: DebugContext;\n\n constructor(nativeNode: any, parent: DebugNode|null, _debugContext: DebugContext) {\n this._debugContext = _debugContext;\n this.nativeNode = nativeNode;\n if (parent && parent instanceof DebugElement__PRE_R3__) {\n parent.addChild(this);\n }\n }\n\n get injector(): Injector { return this._debugContext.injector; }\n\n get componentInstance(): any { return this._debugContext.component; }\n\n get context(): any { return this._debugContext.context; }\n\n get references(): {[key: string]: any} { return this._debugContext.references; }\n\n get providerTokens(): any[] { return this._debugContext.providerTokens; }\n}\n\n/**\n * @publicApi\n */\nexport interface DebugElement extends DebugNode {\n readonly name: string;\n readonly properties: {[key: string]: any};\n readonly attributes: {[key: string]: string | null};\n readonly classes: {[key: string]: boolean};\n readonly styles: {[key: string]: string | null};\n readonly childNodes: DebugNode[];\n readonly nativeElement: any;\n readonly children: DebugElement[];\n\n query(predicate: Predicate<DebugElement>): DebugElement;\n queryAll(predicate: Predicate<DebugElement>): DebugElement[];\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[];\n triggerEventHandler(eventName: string, eventObj: any): void;\n}\nexport class DebugElement__PRE_R3__ extends DebugNode__PRE_R3__ implements DebugElement {\n readonly name !: string;\n readonly properties: {[key: string]: any} = {};\n readonly attributes: {[key: string]: string | null} = {};\n readonly classes: {[key: string]: boolean} = {};\n readonly styles: {[key: string]: string | null} = {};\n readonly childNodes: DebugNode[] = [];\n readonly nativeElement: any;\n\n constructor(nativeNode: any, parent: any, _debugContext: DebugContext) {\n super(nativeNode, parent, _debugContext);\n this.nativeElement = nativeNode;\n }\n\n addChild(child: DebugNode) {\n if (child) {\n this.childNodes.push(child);\n (child as{parent: DebugNode}).parent = this;\n }\n }\n\n removeChild(child: DebugNode) {\n const childIndex = this.childNodes.indexOf(child);\n if (childIndex !== -1) {\n (child as{parent: DebugNode | null}).parent = null;\n this.childNodes.splice(childIndex, 1);\n }\n }\n\n insertChildrenAfter(child: DebugNode, newChildren: DebugNode[]) {\n const siblingIndex = this.childNodes.indexOf(child);\n if (siblingIndex !== -1) {\n this.childNodes.splice(siblingIndex + 1, 0, ...newChildren);\n newChildren.forEach(c => {\n if (c.parent) {\n (c.parent as DebugElement__PRE_R3__).removeChild(c);\n }\n (child as{parent: DebugNode}).parent = this;\n });\n }\n }\n\n insertBefore(refChild: DebugNode, newChild: DebugNode): void {\n const refIndex = this.childNodes.indexOf(refChild);\n if (refIndex === -1) {\n this.addChild(newChild);\n } else {\n if (newChild.parent) {\n (newChild.parent as DebugElement__PRE_R3__).removeChild(newChild);\n }\n (newChild as{parent: DebugNode}).parent = this;\n this.childNodes.splice(refIndex, 0, newChild);\n }\n }\n\n query(predicate: Predicate<DebugElement>): DebugElement {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n\n queryAll(predicate: Predicate<DebugElement>): DebugElement[] {\n const matches: DebugElement[] = [];\n _queryElementChildren(this, predicate, matches);\n return matches;\n }\n\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] {\n const matches: DebugNode[] = [];\n _queryNodeChildren(this, predicate, matches);\n return matches;\n }\n\n get children(): DebugElement[] {\n return this\n .childNodes //\n .filter((node) => node instanceof DebugElement__PRE_R3__) as DebugElement[];\n }\n\n triggerEventHandler(eventName: string, eventObj: any) {\n this.listeners.forEach((listener) => {\n if (listener.name == eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\n/**\n * @publicApi\n */\nexport function asNativeElements(debugEls: DebugElement[]): any {\n return debugEls.map((el) => el.nativeElement);\n}\n\nfunction _queryElementChildren(\n element: DebugElement, predicate: Predicate<DebugElement>, matches: DebugElement[]) {\n element.childNodes.forEach(node => {\n if (node instanceof DebugElement__PRE_R3__) {\n if (predicate(node)) {\n matches.push(node);\n }\n _queryElementChildren(node, predicate, matches);\n }\n });\n}\n\nfunction _queryNodeChildren(\n parentNode: DebugNode, predicate: Predicate<DebugNode>, matches: DebugNode[]) {\n if (parentNode instanceof DebugElement__PRE_R3__) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement__PRE_R3__) {\n _queryNodeChildren(node, predicate, matches);\n }\n });\n }\n}\n\nfunction notImplemented(): Error {\n throw new Error('Missing proper ivy implementation.');\n}\n\nclass DebugNode__POST_R3__ implements DebugNode {\n readonly nativeNode: Node;\n\n constructor(nativeNode: Node) { this.nativeNode = nativeNode; }\n\n get parent(): DebugElement|null {\n const parent = this.nativeNode.parentNode as Element;\n return parent ? new DebugElement__POST_R3__(parent) : null;\n }\n\n get injector(): Injector { return getInjector(this.nativeNode); }\n\n get componentInstance(): any {\n const nativeElement = this.nativeNode;\n return nativeElement && getComponent(nativeElement as Element);\n }\n get context(): any { return getContext(this.nativeNode as Element); }\n\n get listeners(): EventListener[] {\n return getListeners(this.nativeNode as Element).filter(isBrowserEvents);\n }\n\n get references(): {[key: string]: any;} { return getLocalRefs(this.nativeNode); }\n\n get providerTokens(): any[] { return getInjectionTokens(this.nativeNode as Element); }\n}\n\nclass DebugElement__POST_R3__ extends DebugNode__POST_R3__ implements DebugElement {\n constructor(nativeNode: Element) {\n ngDevMode && assertDomNode(nativeNode);\n super(nativeNode);\n }\n\n get nativeElement(): Element|null {\n return this.nativeNode.nodeType == Node.ELEMENT_NODE ? this.nativeNode as Element : null;\n }\n\n get name(): string { return this.nativeElement !.nodeName; }\n\n get properties(): {[key: string]: any;} {\n const context = loadLContext(this.nativeNode) !;\n const lView = context.lView;\n const tView = lView[TVIEW];\n const tNode = tView.data[context.nodeIndex] as TNode;\n const properties = {};\n // TODO: https://angular-team.atlassian.net/browse/FW-681\n // Missing implementation here...\n return properties;\n }\n\n get attributes(): {[key: string]: string | null;} {\n const attributes: {[key: string]: string | null;} = {};\n const element = this.nativeElement;\n if (element) {\n const eAttrs = element.attributes;\n for (let i = 0; i < eAttrs.length; i++) {\n const attr = eAttrs[i];\n attributes[attr.name] = attr.value;\n }\n }\n return attributes;\n }\n\n get classes(): {[key: string]: boolean;} {\n const classes: {[key: string]: boolean;} = {};\n const element = this.nativeElement;\n if (element) {\n const lContext = loadLContextFromNode(element);\n const lNode = lContext.lView[lContext.nodeIndex];\n const stylingContext = getStylingContext(lContext.nodeIndex, lContext.lView);\n if (stylingContext) {\n for (let i = StylingIndex.SingleStylesStartPosition; i < lNode.length;\n i += StylingIndex.Size) {\n if (isClassBasedValue(lNode, i)) {\n const className = getProp(lNode, i);\n const value = getValue(lNode, i);\n if (typeof value == 'boolean') {\n // we want to ignore `null` since those don't overwrite the values.\n classes[className] = value;\n }\n }\n }\n } else {\n // Fallback, just read DOM.\n const eClasses = element.classList;\n for (let i = 0; i < eClasses.length; i++) {\n classes[eClasses[i]] = true;\n }\n }\n }\n return classes;\n }\n\n get styles(): {[key: string]: string | null;} {\n const styles: {[key: string]: string | null;} = {};\n const element = this.nativeElement;\n if (element) {\n const lContext = loadLContextFromNode(element);\n const lNode = lContext.lView[lContext.nodeIndex];\n const stylingContext = getStylingContext(lContext.nodeIndex, lContext.lView);\n if (stylingContext) {\n for (let i = StylingIndex.SingleStylesStartPosition; i < lNode.length;\n i += StylingIndex.Size) {\n if (!isClassBasedValue(lNode, i)) {\n const styleName = getProp(lNode, i);\n const value = getValue(lNode, i) as string | null;\n if (value !== null) {\n // we want to ignore `null` since those don't overwrite the values.\n styles[styleName] = value;\n }\n }\n }\n } else {\n // Fallback, just read DOM.\n const eStyles = (element as HTMLElement).style;\n for (let i = 0; i < eStyles.length; i++) {\n const name = eStyles.item(i);\n styles[name] = eStyles.getPropertyValue(name);\n }\n }\n }\n return styles;\n }\n\n get childNodes(): DebugNode[] {\n const childNodes = this.nativeNode.childNodes;\n const children: DebugNode[] = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode__POST_R3__(element));\n }\n return children;\n }\n\n get children(): DebugElement[] {\n const nativeElement = this.nativeElement;\n if (!nativeElement) return [];\n const childNodes = nativeElement.children;\n const children: DebugElement[] = [];\n for (let i = 0; i < childNodes.length; i++) {\n const element = childNodes[i];\n children.push(getDebugNode__POST_R3__(element));\n }\n return children;\n }\n\n query(predicate: Predicate<DebugElement>): DebugElement {\n const results = this.queryAll(predicate);\n return results[0] || null;\n }\n\n queryAll(predicate: Predicate<DebugElement>): DebugElement[] {\n const matches: DebugElement[] = [];\n _queryNodeChildrenR3(this, predicate, matches, true);\n return matches;\n }\n\n queryAllNodes(predicate: Predicate<DebugNode>): DebugNode[] {\n const matches: DebugNode[] = [];\n _queryNodeChildrenR3(this, predicate, matches, false);\n return matches;\n }\n\n triggerEventHandler(eventName: string, eventObj: any): void {\n this.listeners.forEach((listener) => {\n if (listener.name === eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\nfunction _queryNodeChildrenR3(\n parentNode: DebugNode, predicate: Predicate<DebugNode>, matches: DebugNode[],\n elementsOnly: boolean) {\n if (parentNode instanceof DebugElement__POST_R3__) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement__POST_R3__) {\n if (elementsOnly ? node.nativeElement : true) {\n _queryNodeChildrenR3(node, predicate, matches, elementsOnly);\n }\n }\n });\n }\n}\n\n\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst _nativeNodeToDebugNode = new Map<any, DebugNode>();\n\nfunction getDebugNode__PRE_R3__(nativeNode: any): DebugNode|null {\n return _nativeNodeToDebugNode.get(nativeNode) || null;\n}\n\nexport function getDebugNode__POST_R3__(nativeNode: Element): DebugElement__POST_R3__;\nexport function getDebugNode__POST_R3__(nativeNode: Node): DebugNode__POST_R3__;\nexport function getDebugNode__POST_R3__(nativeNode: null): null;\nexport function getDebugNode__POST_R3__(nativeNode: any): DebugNode|null {\n if (nativeNode instanceof Node) {\n return nativeNode.nodeType == Node.ELEMENT_NODE ?\n new DebugElement__POST_R3__(nativeNode as Element) :\n new DebugNode__POST_R3__(nativeNode);\n }\n return null;\n}\n\n/**\n * @publicApi\n */\nexport const getDebugNode: (nativeNode: any) => DebugNode | null = getDebugNode__PRE_R3__;\n\nexport function getAllDebugNodes(): DebugNode[] {\n return Array.from(_nativeNodeToDebugNode.values());\n}\n\nexport function indexDebugNode(node: DebugNode) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\n\nexport function removeDebugNodeFromIndex(node: DebugNode) {\n _nativeNodeToDebugNode.delete(node.nativeNode);\n}\n\n/**\n * A boolean-valued function over a value, possibly including context information\n * regarding that value's position in an array.\n *\n * @publicApi\n */\nexport interface Predicate<T> { (value: T): boolean; }\n\n/**\n * @publicApi\n */\nexport const DebugNode: {new (...args: any[]): DebugNode} = DebugNode__PRE_R3__ as any;\n\n/**\n * @publicApi\n */\nexport const DebugElement: {new (...args: any[]): DebugElement} = DebugElement__PRE_R3__ as any;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isListLikeIterable, iterateListLike} from '../change_detection_util';\nimport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, NgIterable, TrackByFunction} from './iterable_differs';\n\n\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\n constructor() {}\n supports(obj: Object|null|undefined): boolean { return isListLikeIterable(obj); }\n\n create<V>(trackByFn?: TrackByFunction<V>): DefaultIterableDiffer<V> {\n return new DefaultIterableDiffer<V>(trackByFn);\n }\n}\n\nconst trackByIdentity = (index: number, item: any) => item;\n\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n * @publicApi\n */\nexport class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChanges<V> {\n public readonly length: number = 0;\n // TODO(issue/24571): remove '!'.\n public readonly collection !: V[] | Iterable<V>| null;\n // Keeps track of the used records at any point in time (during & across `_check()` calls)\n private _linkedRecords: _DuplicateMap<V>|null = null;\n // Keeps track of the removed records at any point in time during `_check()` calls.\n private _unlinkedRecords: _DuplicateMap<V>|null = null;\n private _previousItHead: IterableChangeRecord_<V>|null = null;\n private _itHead: IterableChangeRecord_<V>|null = null;\n private _itTail: IterableChangeRecord_<V>|null = null;\n private _additionsHead: IterableChangeRecord_<V>|null = null;\n private _additionsTail: IterableChangeRecord_<V>|null = null;\n private _movesHead: IterableChangeRecord_<V>|null = null;\n private _movesTail: IterableChangeRecord_<V>|null = null;\n private _removalsHead: IterableChangeRecord_<V>|null = null;\n private _removalsTail: IterableChangeRecord_<V>|null = null;\n // Keeps track of records where custom track by is the same, but item identity has changed\n private _identityChangesHead: IterableChangeRecord_<V>|null = null;\n private _identityChangesTail: IterableChangeRecord_<V>|null = null;\n private _trackByFn: TrackByFunction<V>;\n\n constructor(trackByFn?: TrackByFunction<V>) { this._trackByFn = trackByFn || trackByIdentity; }\n\n forEachItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachOperation(\n fn: (item: IterableChangeRecord<V>, previousIndex: number|null, currentIndex: number|null) =>\n void) {\n let nextIt = this._itHead;\n let nextRemove = this._removalsHead;\n let addRemoveOffset = 0;\n let moveOffsets: number[]|null = null;\n while (nextIt || nextRemove) {\n // Figure out which is the next record to process\n // Order: remove, add, move\n const record: IterableChangeRecord<V> = !nextRemove ||\n nextIt &&\n nextIt.currentIndex ! <\n getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ?\n nextIt ! :\n nextRemove;\n const adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const currentIndex = record.currentIndex;\n\n // consume the item, and adjust the addRemoveOffset and update moveDistance if necessary\n if (record === nextRemove) {\n addRemoveOffset--;\n nextRemove = nextRemove._nextRemoved;\n } else {\n nextIt = nextIt !._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const localCurrentIndex = currentIndex ! - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let i = 0; i < localMovePreviousIndex; i++) {\n const offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const previousIndex = record.previousIndex;\n moveOffsets[previousIndex] = localCurrentIndex - localMovePreviousIndex;\n }\n }\n }\n\n if (adjPreviousIndex !== currentIndex) {\n fn(record, adjPreviousIndex, currentIndex);\n }\n }\n }\n\n forEachPreviousItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachMovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n forEachIdentityChange(fn: (record: IterableChangeRecord_<V>) => void) {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n\n diff(collection: NgIterable<V>): DefaultIterableDiffer<V>|null {\n if (collection == null) collection = [];\n if (!isListLikeIterable(collection)) {\n throw new Error(\n `Error trying to diff '${stringify(collection)}'. Only arrays and iterables are allowed`);\n }\n\n if (this.check(collection)) {\n return this;\n } else {\n return null;\n }\n }\n\n onDestroy() {}\n\n check(collection: NgIterable<V>): boolean {\n this._reset();\n\n let record: IterableChangeRecord_<V>|null = this._itHead;\n let mayBeDirty: boolean = false;\n let index: number;\n let item: V;\n let itemTrackBy: any;\n if (Array.isArray(collection)) {\n (this as{length: number}).length = collection.length;\n\n for (let index = 0; index < this.length; index++) {\n item = collection[index];\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n\n record = record._next;\n }\n } else {\n index = 0;\n iterateListLike(collection, (item: V) => {\n itemTrackBy = this._trackByFn(index, item);\n if (record === null || !looseIdentical(record.trackById, itemTrackBy)) {\n record = this._mismatch(record, item, itemTrackBy, index);\n mayBeDirty = true;\n } else {\n if (mayBeDirty) {\n // TODO(misko): can we limit this to duplicates only?\n record = this._verifyReinsertion(record, item, itemTrackBy, index);\n }\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n }\n record = record._next;\n index++;\n });\n (this as{length: number}).length = index;\n }\n\n this._truncate(record);\n (this as{collection: V[] | Iterable<V>}).collection = collection;\n return this.isDirty;\n }\n\n /* CollectionChanges is considered dirty if it has any additions, moves, removals, or identity\n * changes.\n */\n get isDirty(): boolean {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }\n\n /**\n * Reset the state of the change objects to show no changes. This means set previousKey to\n * currentKey, and clear all of the queues (additions, moves, removals).\n * Set the previousIndexes of moved and added items to their currentIndexes\n * Reset the list of additions, moves and removals\n *\n * @internal\n */\n _reset() {\n if (this.isDirty) {\n let record: IterableChangeRecord_<V>|null;\n let nextRecord: IterableChangeRecord_<V>|null;\n\n for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n record.previousIndex = record.currentIndex;\n }\n this._additionsHead = this._additionsTail = null;\n\n for (record = this._movesHead; record !== null; record = nextRecord) {\n record.previousIndex = record.currentIndex;\n nextRecord = record._nextMoved;\n }\n this._movesHead = this._movesTail = null;\n this._removalsHead = this._removalsTail = null;\n this._identityChangesHead = this._identityChangesTail = null;\n\n // TODO(vicb): when assert gets supported\n // assert(!this.isDirty);\n }\n }\n\n /**\n * This is the core function which handles differences between collections.\n *\n * - `record` is the record which we saw at this position last time. If null then it is a new\n * item.\n * - `item` is the current item in the collection\n * - `index` is the position of the item in the collection\n *\n * @internal\n */\n _mismatch(record: IterableChangeRecord_<V>|null, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n // The previous record after which we will append the current one.\n let previousRecord: IterableChangeRecord_<V>|null;\n\n if (record === null) {\n previousRecord = this._itTail;\n } else {\n previousRecord = record._prev;\n // Remove the record from the collection since we know it does not match the item.\n this._remove(record);\n }\n\n // Attempt to see if we have seen the item before.\n record = this._linkedRecords === null ? null : this._linkedRecords.get(itemTrackBy, index);\n if (record !== null) {\n // We have seen this before, we need to move it forward in the collection.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._moveAfter(record, previousRecord, index);\n } else {\n // Never seen it, check evicted list.\n record = this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (record !== null) {\n // It is an item which we have evicted earlier: reinsert it back into the list.\n // But first we need to check if identity changed, so we can update in view if necessary\n if (!looseIdentical(record.item, item)) this._addIdentityChange(record, item);\n\n this._reinsertAfter(record, previousRecord, index);\n } else {\n // It is a new item: add it.\n record =\n this._addAfter(new IterableChangeRecord_<V>(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\n }\n\n /**\n * This check is only needed if an array contains duplicates. (Short circuit of nothing dirty)\n *\n * Use case: `[a, a]` => `[b, a, a]`\n *\n * If we did not have this check then the insertion of `b` would:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) leave `a` at index `1` as is. <-- this is wrong!\n * 3) reinsert `a` at index 2. <-- this is wrong!\n *\n * The correct behavior is:\n * 1) evict first `a`\n * 2) insert `b` at `0` index.\n * 3) reinsert `a` at index 1.\n * 3) move `a` at from `1` to `2`.\n *\n *\n * Double check that we have not evicted a duplicate item. We need to check if the item type may\n * have already been removed:\n * The insertion of b will evict the first 'a'. If we don't reinsert it now it will be reinserted\n * at the end. Which will show up as the two 'a's switching position. This is incorrect, since a\n * better way to think of it is as insert of 'b' rather then switch 'a' with 'b' and then add 'a'\n * at the end.\n *\n * @internal\n */\n _verifyReinsertion(record: IterableChangeRecord_<V>, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_<V> {\n let reinsertRecord: IterableChangeRecord_<V>|null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, record._prev !, index);\n } else if (record.currentIndex != index) {\n record.currentIndex = index;\n this._addToMoves(record, index);\n }\n return record;\n }\n\n /**\n * Get rid of any excess {@link IterableChangeRecord_}s from the previous collection\n *\n * - `record` The first excess {@link IterableChangeRecord_}.\n *\n * @internal\n */\n _truncate(record: IterableChangeRecord_<V>|null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const nextRecord: IterableChangeRecord_<V>|null = record._next;\n this._addToRemovals(this._unlink(record));\n record = nextRecord;\n }\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.clear();\n }\n\n if (this._additionsTail !== null) {\n this._additionsTail._nextAdded = null;\n }\n if (this._movesTail !== null) {\n this._movesTail._nextMoved = null;\n }\n if (this._itTail !== null) {\n this._itTail._next = null;\n }\n if (this._removalsTail !== null) {\n this._removalsTail._nextRemoved = null;\n }\n if (this._identityChangesTail !== null) {\n this._identityChangesTail._nextIdentityChange = null;\n }\n }\n\n /** @internal */\n _reinsertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const prev = record._prevRemoved;\n const next = record._nextRemoved;\n\n if (prev === null) {\n this._removalsHead = next;\n } else {\n prev._nextRemoved = next;\n }\n if (next === null) {\n this._removalsTail = prev;\n } else {\n next._prevRemoved = prev;\n }\n\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _moveAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n\n /** @internal */\n _addAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n this._insertAfter(record, prevRecord, index);\n\n if (this._additionsTail === null) {\n // TODO(vicb):\n // assert(this._additionsHead === null);\n this._additionsTail = this._additionsHead = record;\n } else {\n // TODO(vicb):\n // assert(_additionsTail._nextAdded === null);\n // assert(record._nextAdded === null);\n this._additionsTail = this._additionsTail._nextAdded = record;\n }\n return record;\n }\n\n /** @internal */\n _insertAfter(\n record: IterableChangeRecord_<V>, prevRecord: IterableChangeRecord_<V>|null,\n index: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const next: IterableChangeRecord_<V>|null =\n prevRecord === null ? this._itHead : prevRecord._next;\n // TODO(vicb):\n // assert(next != record);\n // assert(prevRecord != record);\n record._next = next;\n record._prev = prevRecord;\n if (next === null) {\n this._itTail = record;\n } else {\n next._prev = record;\n }\n if (prevRecord === null) {\n this._itHead = record;\n } else {\n prevRecord._next = record;\n }\n\n if (this._linkedRecords === null) {\n this._linkedRecords = new _DuplicateMap<V>();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n\n /** @internal */\n _remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n return this._addToRemovals(this._unlink(record));\n }\n\n /** @internal */\n _unlink(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const prev = record._prev;\n const next = record._next;\n\n // TODO(vicb):\n // assert((record._prev = null) === null);\n // assert((record._next = null) === null);\n\n if (prev === null) {\n this._itHead = next;\n } else {\n prev._next = next;\n }\n if (next === null) {\n this._itTail = prev;\n } else {\n next._prev = prev;\n }\n\n return record;\n }\n\n /** @internal */\n _addToMoves(record: IterableChangeRecord_<V>, toIndex: number): IterableChangeRecord_<V> {\n // TODO(vicb):\n // assert(record._nextMoved === null);\n\n if (record.previousIndex === toIndex) {\n return record;\n }\n\n if (this._movesTail === null) {\n // TODO(vicb):\n // assert(_movesHead === null);\n this._movesTail = this._movesHead = record;\n } else {\n // TODO(vicb):\n // assert(_movesTail._nextMoved === null);\n this._movesTail = this._movesTail._nextMoved = record;\n }\n\n return record;\n }\n\n private _addToRemovals(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap<V>();\n }\n this._unlinkedRecords.put(record);\n record.currentIndex = null;\n record._nextRemoved = null;\n\n if (this._removalsTail === null) {\n // TODO(vicb):\n // assert(_removalsHead === null);\n this._removalsTail = this._removalsHead = record;\n record._prevRemoved = null;\n } else {\n // TODO(vicb):\n // assert(_removalsTail._nextRemoved === null);\n // assert(record._nextRemoved === null);\n record._prevRemoved = this._removalsTail;\n this._removalsTail = this._removalsTail._nextRemoved = record;\n }\n return record;\n }\n\n /** @internal */\n _addIdentityChange(record: IterableChangeRecord_<V>, item: V) {\n record.item = item;\n if (this._identityChangesTail === null) {\n this._identityChangesTail = this._identityChangesHead = record;\n } else {\n this._identityChangesTail = this._identityChangesTail._nextIdentityChange = record;\n }\n return record;\n }\n}\n\nexport class IterableChangeRecord_<V> implements IterableChangeRecord<V> {\n currentIndex: number|null = null;\n previousIndex: number|null = null;\n\n /** @internal */\n _nextPrevious: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prev: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _next: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextDup: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _prevRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextRemoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextAdded: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextMoved: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _nextIdentityChange: IterableChangeRecord_<V>|null = null;\n\n\n constructor(public item: V, public trackById: any) {}\n}\n\n// A linked list of CollectionChangeRecords with the same IterableChangeRecord_.item\nclass _DuplicateItemRecordList<V> {\n /** @internal */\n _head: IterableChangeRecord_<V>|null = null;\n /** @internal */\n _tail: IterableChangeRecord_<V>|null = null;\n\n /**\n * Append the record to the list of duplicates.\n *\n * Note: by design all records in the list of duplicates hold the same value in record.item.\n */\n add(record: IterableChangeRecord_<V>): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else {\n // TODO(vicb):\n // assert(record.item == _head.item ||\n // record.item is num && record.item.isNaN && _head.item is num && _head.item.isNaN);\n this._tail !._nextDup = record;\n record._prevDup = this._tail;\n record._nextDup = null;\n this._tail = record;\n }\n }\n\n // Returns a IterableChangeRecord_ having IterableChangeRecord_.trackById == trackById and\n // IterableChangeRecord_.currentIndex >= atOrAfterIndex\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n let record: IterableChangeRecord_<V>|null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= record.currentIndex !) &&\n looseIdentical(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n\n /**\n * Remove one {@link IterableChangeRecord_} from the list of duplicates.\n *\n * Returns whether the list of duplicates is empty.\n */\n remove(record: IterableChangeRecord_<V>): boolean {\n // TODO(vicb):\n // assert(() {\n // // verify that the record being removed is in the list.\n // for (IterableChangeRecord_ cursor = _head; cursor != null; cursor = cursor._nextDup) {\n // if (identical(cursor, record)) return true;\n // }\n // return false;\n //});\n\n const prev: IterableChangeRecord_<V>|null = record._prevDup;\n const next: IterableChangeRecord_<V>|null = record._nextDup;\n if (prev === null) {\n this._head = next;\n } else {\n prev._nextDup = next;\n }\n if (next === null) {\n this._tail = prev;\n } else {\n next._prevDup = prev;\n }\n return this._head === null;\n }\n}\n\nclass _DuplicateMap<V> {\n map = new Map<any, _DuplicateItemRecordList<V>>();\n\n put(record: IterableChangeRecord_<V>) {\n const key = record.trackById;\n\n let duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList<V>();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\n }\n\n /**\n * Retrieve the `value` using key. Because the IterableChangeRecord_ value may be one which we\n * have already iterated over, we use the `atOrAfterIndex` to pretend it is not there.\n *\n * Use case: `[a, b, c, a, a]` if we are at index `3` which is the second `a` then asking if we\n * have any more `a`s needs to return the second `a`.\n */\n get(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_<V>|null {\n const key = trackById;\n const recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\n }\n\n /**\n * Removes a {@link IterableChangeRecord_} from the list of duplicates.\n *\n * The list of duplicates also is removed from the map if it gets empty.\n */\n remove(record: IterableChangeRecord_<V>): IterableChangeRecord_<V> {\n const key = record.trackById;\n const recordList: _DuplicateItemRecordList<V> = this.map.get(key) !;\n // Remove the list of duplicates when it gets empty\n if (recordList.remove(record)) {\n this.map.delete(key);\n }\n return record;\n }\n\n get isEmpty(): boolean { return this.map.size === 0; }\n\n clear() { this.map.clear(); }\n}\n\nfunction getPreviousIndex(\n item: any, addRemoveOffset: number, moveOffsets: number[] | null): number {\n const previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let moveOffset = 0;\n if (moveOffsets && previousIndex < moveOffsets.length) {\n moveOffset = moveOffsets[previousIndex];\n }\n return previousIndex + addRemoveOffset + moveOffset;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isJsObject} from '../change_detection_util';\nimport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory} from './keyvalue_differs';\n\n\nexport class DefaultKeyValueDifferFactory<K, V> implements KeyValueDifferFactory {\n constructor() {}\n supports(obj: any): boolean { return obj instanceof Map || isJsObject(obj); }\n\n create<K, V>(): KeyValueDiffer<K, V> { return new DefaultKeyValueDiffer<K, V>(); }\n}\n\nexport class DefaultKeyValueDiffer<K, V> implements KeyValueDiffer<K, V>, KeyValueChanges<K, V> {\n private _records = new Map<K, KeyValueChangeRecord_<K, V>>();\n private _mapHead: KeyValueChangeRecord_<K, V>|null = null;\n // _appendAfter is used in the check loop\n private _appendAfter: KeyValueChangeRecord_<K, V>|null = null;\n private _previousMapHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesHead: KeyValueChangeRecord_<K, V>|null = null;\n private _changesTail: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _additionsTail: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsHead: KeyValueChangeRecord_<K, V>|null = null;\n private _removalsTail: KeyValueChangeRecord_<K, V>|null = null;\n\n get isDirty(): boolean {\n return this._additionsHead !== null || this._changesHead !== null ||\n this._removalsHead !== null;\n }\n\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void) {\n let record: KeyValueChangeRecord_<K, V>|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n\n diff(map?: Map<any, any>|{[k: string]: any}|null): any {\n if (!map) {\n map = new Map();\n } else if (!(map instanceof Map || isJsObject(map))) {\n throw new Error(\n `Error trying to diff '${stringify(map)}'. Only maps and objects are allowed`);\n }\n\n return this.check(map) ? this : null;\n }\n\n onDestroy() {}\n\n /**\n * Check the current state of the map vs the previous.\n * The algorithm is optimised for when the keys do no change.\n */\n check(map: Map<any, any>|{[k: string]: any}): boolean {\n this._reset();\n\n let insertBefore = this._mapHead;\n this._appendAfter = null;\n\n this._forEach(map, (value: any, key: any) => {\n if (insertBefore && insertBefore.key === key) {\n this._maybeAddToChanges(insertBefore, value);\n this._appendAfter = insertBefore;\n insertBefore = insertBefore._next;\n } else {\n const record = this._getOrCreateRecordForKey(key, value);\n insertBefore = this._insertBeforeOrAppend(insertBefore, record);\n }\n });\n\n // Items remaining at the end of the list have been deleted\n if (insertBefore) {\n if (insertBefore._prev) {\n insertBefore._prev._next = null;\n }\n\n this._removalsHead = insertBefore;\n\n for (let record: KeyValueChangeRecord_<K, V>|null = insertBefore; record !== null;\n record = record._nextRemoved) {\n if (record === this._mapHead) {\n this._mapHead = null;\n }\n this._records.delete(record.key);\n record._nextRemoved = record._next;\n record.previousValue = record.currentValue;\n record.currentValue = null;\n record._prev = null;\n record._next = null;\n }\n }\n\n // Make sure tails have no next records from previous runs\n if (this._changesTail) this._changesTail._nextChanged = null;\n if (this._additionsTail) this._additionsTail._nextAdded = null;\n\n return this.isDirty;\n }\n\n /**\n * Inserts a record before `before` or append at the end of the list when `before` is null.\n *\n * Notes:\n * - This method appends at `this._appendAfter`,\n * - This method updates `this._appendAfter`,\n * - The return value is the new value for the insertion pointer.\n */\n private _insertBeforeOrAppend(\n before: KeyValueChangeRecord_<K, V>|null,\n record: KeyValueChangeRecord_<K, V>): KeyValueChangeRecord_<K, V>|null {\n if (before) {\n const prev = before._prev;\n record._next = before;\n record._prev = prev;\n before._prev = record;\n if (prev) {\n prev._next = record;\n }\n if (before === this._mapHead) {\n this._mapHead = record;\n }\n\n this._appendAfter = before;\n return before;\n }\n\n if (this._appendAfter) {\n this._appendAfter._next = record;\n record._prev = this._appendAfter;\n } else {\n this._mapHead = record;\n }\n\n this._appendAfter = record;\n return null;\n }\n\n private _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_<K, V> {\n if (this._records.has(key)) {\n const record = this._records.get(key) !;\n this._maybeAddToChanges(record, value);\n const prev = record._prev;\n const next = record._next;\n if (prev) {\n prev._next = next;\n }\n if (next) {\n next._prev = prev;\n }\n record._next = null;\n record._prev = null;\n\n return record;\n }\n\n const record = new KeyValueChangeRecord_<K, V>(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n\n /** @internal */\n _reset() {\n if (this.isDirty) {\n let record: KeyValueChangeRecord_<K, V>|null;\n // let `_previousMapHead` contain the state of the map before the changes\n this._previousMapHead = this._mapHead;\n for (record = this._previousMapHead; record !== null; record = record._next) {\n record._nextPrevious = record._next;\n }\n\n // Update `record.previousValue` with the value of the item before the changes\n // We need to update all changed items (that's those which have been added and changed)\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n record.previousValue = record.currentValue;\n }\n for (record = this._additionsHead; record != null; record = record._nextAdded) {\n record.previousValue = record.currentValue;\n }\n\n this._changesHead = this._changesTail = null;\n this._additionsHead = this._additionsTail = null;\n this._removalsHead = null;\n }\n }\n\n // Add the record or a given key to the list of changes only when the value has actually changed\n private _maybeAddToChanges(record: KeyValueChangeRecord_<K, V>, newValue: any): void {\n if (!looseIdentical(newValue, record.currentValue)) {\n record.previousValue = record.currentValue;\n record.currentValue = newValue;\n this._addToChanges(record);\n }\n }\n\n private _addToAdditions(record: KeyValueChangeRecord_<K, V>) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else {\n this._additionsTail !._nextAdded = record;\n this._additionsTail = record;\n }\n }\n\n private _addToChanges(record: KeyValueChangeRecord_<K, V>) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else {\n this._changesTail !._nextChanged = record;\n this._changesTail = record;\n }\n }\n\n /** @internal */\n private _forEach<K, V>(obj: Map<K, V>|{[k: string]: V}, fn: (v: V, k: any) => void) {\n if (obj instanceof Map) {\n obj.forEach(fn);\n } else {\n Object.keys(obj).forEach(k => fn(obj[k], k));\n }\n }\n}\n\nclass KeyValueChangeRecord_<K, V> implements KeyValueChangeRecord<K, V> {\n previousValue: V|null = null;\n currentValue: V|null = null;\n\n /** @internal */\n _nextPrevious: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _next: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _prev: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextAdded: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextRemoved: KeyValueChangeRecord_<K, V>|null = null;\n /** @internal */\n _nextChanged: KeyValueChangeRecord_<K, V>|null = null;\n\n constructor(public key: K) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {defineInjectable} from '../../di/defs';\nimport {Optional, SkipSelf} from '../../di/metadata';\nimport {StaticProvider} from '../../di/provider';\nimport {DefaultIterableDifferFactory} from '../differs/default_iterable_differ';\n\n\n/**\n * A type describing supported iterable types.\n *\n * @publicApi\n */\nexport type NgIterable<T> = Array<T>| Iterable<T>;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link NgForOf} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n * @publicApi\n */\nexport interface IterableDiffer<V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: NgIterable<V>): IterableChanges<V>|null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface IterableChanges<V> {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /**\n * Iterate over a set of operations which when applied to the original `Iterable` will produce the\n * new `Iterable`.\n *\n * NOTE: These are not necessarily the actual operations which were applied to the original\n * `Iterable`, rather these are a set of computed operations which may not be the same as the\n * ones applied.\n *\n * @param record A change which needs to be applied\n * @param previousIndex The `IterableChangeRecord#previousIndex` of the `record` refers to the\n * original `Iterable` location, where as `previousIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n * @param currentIndex The `IterableChangeRecord#currentIndex` of the `record` refers to the\n * original `Iterable` location, where as `currentIndex` refers to the transient location\n * of the item, after applying the operations up to this point.\n */\n forEachOperation(\n fn:\n (record: IterableChangeRecord<V>, previousIndex: number|null,\n currentIndex: number|null) => void): void;\n\n /**\n * Iterate over changes in the order of original `Iterable` showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord<V>) => void): void;\n\n /** Iterate over all items which had their identity (as computed by the `TrackByFunction`)\n * changed. */\n forEachIdentityChange(fn: (record: IterableChangeRecord<V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface IterableChangeRecord<V> {\n /** Current index of the item in `Iterable` or null if removed. */\n readonly currentIndex: number|null;\n\n /** Previous index of the item in `Iterable` or null if added. */\n readonly previousIndex: number|null;\n\n /** The item. */\n readonly item: V;\n\n /** Track by identity as computed by the `TrackByFunction`. */\n readonly trackById: any;\n}\n\n/**\n * @deprecated v4.0.0 - Use IterableChangeRecord instead.\n * @publicApi\n */\nexport interface CollectionChangeRecord<V> extends IterableChangeRecord<V> {}\n\n/**\n * An optional function passed into {@link NgForOf} that defines how to track\n * items in an iterable (e.g. fby index or id)\n *\n * @publicApi\n */\nexport interface TrackByFunction<T> { (index: number, item: T): any; }\n\n/**\n * Provides a factory for {@link IterableDiffer}.\n *\n * @publicApi\n */\nexport interface IterableDifferFactory {\n supports(objects: any): boolean;\n create<V>(trackByFn?: TrackByFunction<V>): IterableDiffer<V>;\n}\n\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n *\n * @publicApi\n */\nexport class IterableDiffers {\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'root',\n factory: () => new IterableDiffers([new DefaultIterableDifferFactory()])\n });\n\n /**\n * @deprecated v4.0.0 - Should be private\n */\n factories: IterableDifferFactory[];\n constructor(factories: IterableDifferFactory[]) { this.factories = factories; }\n\n static create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {\n if (parent != null) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n\n return new IterableDiffers(factories);\n }\n\n /**\n * Takes an array of {@link IterableDifferFactory} and returns a provider used to extend the\n * inherited {@link IterableDiffers} instance with the provided factories and return a new\n * {@link IterableDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link IterableDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n */\n static extend(factories: IterableDifferFactory[]): StaticProvider {\n return {\n provide: IterableDiffers,\n useFactory: (parent: IterableDiffers) => {\n if (!parent) {\n // Typically would occur when calling IterableDiffers.extend inside of dependencies passed\n // to\n // bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend IterableDiffers without a parent injector');\n }\n return IterableDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[IterableDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(iterable: any): IterableDifferFactory {\n const factory = this.factories.find(f => f.supports(iterable));\n if (factory != null) {\n return factory;\n } else {\n throw new Error(\n `Cannot find a differ supporting object '${iterable}' of type '${getTypeNameForDebugging(iterable)}'`);\n }\n }\n}\n\nexport function getTypeNameForDebugging(type: any): string {\n return type['name'] || typeof type;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Optional, SkipSelf, StaticProvider, defineInjectable} from '../../di';\nimport {DefaultKeyValueDifferFactory} from './default_keyvalue_differ';\n\n\n/**\n * A differ that tracks changes made to an object over time.\n *\n * @publicApi\n */\nexport interface KeyValueDiffer<K, V> {\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: Map<K, V>): KeyValueChanges<K, V>|null;\n\n /**\n * Compute a difference between the previous state and the new `object` state.\n *\n * @param object containing the new value.\n * @returns an object describing the difference. The return value is only valid until the next\n * `diff()` invocation.\n */\n diff(object: {[key: string]: V}): KeyValueChanges<string, V>|null;\n // TODO(TS2.1): diff<KP extends string>(this: KeyValueDiffer<KP, V>, object: Record<KP, V>):\n // KeyValueDiffer<KP, V>;\n}\n\n/**\n * An object describing the changes in the `Map` or `{[k:string]: string}` since last time\n * `KeyValueDiffer#diff()` was invoked.\n *\n * @publicApi\n */\nexport interface KeyValueChanges<K, V> {\n /**\n * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over changes in the order of original Map showing where the original items\n * have moved.\n */\n forEachPreviousItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all keys for which values have changed.\n */\n forEachChangedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all added items.\n */\n forEachAddedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n\n /**\n * Iterate over all removed items.\n */\n forEachRemovedItem(fn: (r: KeyValueChangeRecord<K, V>) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @publicApi\n */\nexport interface KeyValueChangeRecord<K, V> {\n /**\n * Current key in the Map.\n */\n readonly key: K;\n\n /**\n * Current value for the key or `null` if removed.\n */\n readonly currentValue: V|null;\n\n /**\n * Previous value for the key or `null` if added.\n */\n readonly previousValue: V|null;\n}\n\n/**\n * Provides a factory for {@link KeyValueDiffer}.\n *\n * @publicApi\n */\nexport interface KeyValueDifferFactory {\n /**\n * Test to see if the differ knows how to diff this kind of object.\n */\n supports(objects: any): boolean;\n\n /**\n * Create a `KeyValueDiffer`.\n */\n create<K, V>(): KeyValueDiffer<K, V>;\n}\n\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n *\n * @publicApi\n */\nexport class KeyValueDiffers {\n /** @nocollapse */\n static ngInjectableDef = defineInjectable({\n providedIn: 'root',\n factory: () => new KeyValueDiffers([new DefaultKeyValueDifferFactory()])\n });\n\n /**\n * @deprecated v4.0.0 - Should be private.\n */\n factories: KeyValueDifferFactory[];\n\n constructor(factories: KeyValueDifferFactory[]) { this.factories = factories; }\n\n static create<S>(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {\n if (parent) {\n const copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\n }\n\n /**\n * Takes an array of {@link KeyValueDifferFactory} and returns a provider used to extend the\n * inherited {@link KeyValueDiffers} instance with the provided factories and return a new\n * {@link KeyValueDiffers} instance.\n *\n * @usageNotes\n * ### Example\n *\n * The following example shows how to extend an existing list of factories,\n * which will only be applied to the injector for this component and its children.\n * This step is all that's required to make a new {@link KeyValueDiffer} available.\n *\n * ```\n * @Component({\n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n */\n static extend<S>(factories: KeyValueDifferFactory[]): StaticProvider {\n return {\n provide: KeyValueDiffers,\n useFactory: (parent: KeyValueDiffers) => {\n if (!parent) {\n // Typically would occur when calling KeyValueDiffers.extend inside of dependencies passed\n // to bootstrap(), which would override default pipes instead of extending them.\n throw new Error('Cannot extend KeyValueDiffers without a parent injector');\n }\n return KeyValueDiffers.create(factories, parent);\n },\n // Dependency technically isn't optional, but we can provide a better error message this way.\n deps: [[KeyValueDiffers, new SkipSelf(), new Optional()]]\n };\n }\n\n find(kv: any): KeyValueDifferFactory {\n const factory = this.factories.find(f => f.supports(kv));\n if (factory) {\n return factory;\n }\n throw new Error(`Cannot find a differ supporting object '${kv}'`);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nimport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nimport {IterableDifferFactory, IterableDiffers} from './differs/iterable_differs';\nimport {KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\n\nexport {SimpleChanges} from '../metadata/lifecycle_hooks';\nexport {SimpleChange, WrappedValue, devModeEqual} from './change_detection_util';\nexport {ChangeDetectorRef} from './change_detector_ref';\nexport {ChangeDetectionStrategy, ChangeDetectorStatus, isDefaultChangeDetectionStrategy} from './constants';\nexport {DefaultIterableDifferFactory} from './differs/default_iterable_differ';\nexport {DefaultIterableDiffer} from './differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory} from './differs/default_keyvalue_differ';\nexport {CollectionChangeRecord, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, NgIterable, TrackByFunction} from './differs/iterable_differs';\nexport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers} from './differs/keyvalue_differs';\nexport {PipeTransform} from './pipe_transform';\n\n\n\n/**\n * Structural diffing for `Object`s and `Map`s.\n */\nconst keyValDiff: KeyValueDifferFactory[] = [new DefaultKeyValueDifferFactory()];\n\n/**\n * Structural diffing for `Iterable` types such as `Array`s.\n */\nconst iterableDiff: IterableDifferFactory[] = [new DefaultIterableDifferFactory()];\n\nexport const defaultIterableDiffers = new IterableDiffers(iterableDiff);\n\nexport const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Change detection enables data binding in Angular.\n */\n\nexport {ChangeDetectionStrategy, ChangeDetectorRef, CollectionChangeRecord, DefaultIterableDiffer, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, IterableDiffers, KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory, KeyValueDiffers, NgIterable, PipeTransform, SimpleChange, SimpleChanges, TrackByFunction, WrappedValue} from './change_detection/change_detection';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {PlatformRef, createPlatformFactory} from './application_ref';\nimport {PLATFORM_ID} from './application_tokens';\nimport {Console} from './console';\nimport {Injector, StaticProvider} from './di';\nimport {TestabilityRegistry} from './testability/testability';\n\nconst _CORE_PLATFORM_PROVIDERS: StaticProvider[] = [\n // Set a default platform name for platforms that don't set it explicitly.\n {provide: PLATFORM_ID, useValue: 'unknown'},\n {provide: PlatformRef, deps: [Injector]},\n {provide: TestabilityRegistry, deps: []},\n {provide: Console, deps: []},\n];\n\n/**\n * This platform has to be included in any other platform\n *\n * @publicApi\n */\nexport const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '../di/injection_token';\n\n/**\n * Provide this token to set the locale of your application.\n * It is used for i18n extraction, by i18n pipes (DatePipe, I18nPluralPipe, CurrencyPipe,\n * DecimalPipe and PercentPipe) and by ICU expressions.\n *\n * See the [i18n guide](guide/i18n#setting-up-locale) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { LOCALE_ID } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: LOCALE_ID, useValue: 'en-US' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const LOCALE_ID = new InjectionToken<string>('LocaleId');\n\n/**\n * Use this token at bootstrap to provide the content of your translation file (`xtb`,\n * `xlf` or `xlf2`) when you want to translate your application in another language.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * // content of your translation file\n * const translations = '....';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS, useValue: translations }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS = new InjectionToken<string>('Translations');\n\n/**\n * Provide this token at bootstrap to set the format of your {@link TRANSLATIONS}: `xtb`,\n * `xlf` or `xlf2`.\n *\n * See the [i18n guide](guide/i18n#merge) for more information.\n *\n * @usageNotes\n * ### Example\n *\n * ```typescript\n * import { TRANSLATIONS_FORMAT } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * providers: [{provide: TRANSLATIONS_FORMAT, useValue: 'xlf' }]\n * });\n * ```\n *\n * @publicApi\n */\nexport const TRANSLATIONS_FORMAT = new InjectionToken<string>('TranslationsFormat');\n\n/**\n * Use this enum at bootstrap as an option of `bootstrapModule` to define the strategy\n * that the compiler should use in case of missing translations:\n * - Error: throw if you have missing translations.\n * - Warning (default): show a warning in the console and/or shell.\n * - Ignore: do nothing.\n *\n * See the [i18n guide](guide/i18n#missing-translation) for more information.\n *\n * @usageNotes\n * ### Example\n * ```typescript\n * import { MissingTranslationStrategy } from '@angular/core';\n * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\n * import { AppModule } from './app/app.module';\n *\n * platformBrowserDynamic().bootstrapModule(AppModule, {\n * missingTranslation: MissingTranslationStrategy.Error\n * });\n * ```\n *\n * @publicApi\n */\nexport enum MissingTranslationStrategy {\n Error = 0,\n Warning = 1,\n Ignore = 2,\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nimport {ApplicationRef} from './application_ref';\nimport {APP_ID_RANDOM_PROVIDER} from './application_tokens';\nimport {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';\nimport {Console} from './console';\nimport {InjectionToken, Injector, StaticProvider} from './di';\nimport {Inject, Optional, SkipSelf} from './di/metadata';\nimport {ErrorHandler} from './error_handler';\nimport {LOCALE_ID} from './i18n/tokens';\nimport {ComponentFactoryResolver} from './linker';\nimport {Compiler} from './linker/compiler';\nimport {NgModule} from './metadata';\nimport {NgZone} from './zone';\n\nexport function _iterableDiffersFactory() {\n return defaultIterableDiffers;\n}\n\nexport function _keyValueDiffersFactory() {\n return defaultKeyValueDiffers;\n}\n\nexport function _localeFactory(locale?: string): string {\n return locale || 'en-US';\n}\n\n/**\n * A built-in [dependency injection token](guide/glossary#di-token)\n * that is used to configure the root injector for bootstrapping.\n */\nexport const APPLICATION_MODULE_PROVIDERS: StaticProvider[] = [\n {\n provide: ApplicationRef,\n useClass: ApplicationRef,\n deps:\n [NgZone, Console, Injector, ErrorHandler, ComponentFactoryResolver, ApplicationInitStatus]\n },\n {\n provide: ApplicationInitStatus,\n useClass: ApplicationInitStatus,\n deps: [[new Optional(), APP_INITIALIZER]]\n },\n {provide: Compiler, useClass: Compiler, deps: []},\n APP_ID_RANDOM_PROVIDER,\n {provide: IterableDiffers, useFactory: _iterableDiffersFactory, deps: []},\n {provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory, deps: []},\n {\n provide: LOCALE_ID,\n useFactory: _localeFactory,\n deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]\n },\n];\n\n/**\n * Configures the root injector for an app with\n * providers of `@angular/core` dependencies that `ApplicationRef` needs\n * to bootstrap components.\n *\n * Re-exported by `BrowserModule`, which is included automatically in the root\n * `AppModule` when you create a new app with the CLI `new` command.\n *\n * @publicApi\n */\n@NgModule({providers: APPLICATION_MODULE_PROVIDERS})\nexport class ApplicationModule {\n // Inject ApplicationRef to make it eager...\n constructor(appRef: ApplicationRef) {}\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport const SWITCH_IVY_ENABLED__POST_R3__ = true;\nconst SWITCH_IVY_ENABLED__PRE_R3__ = false;\nexport const ivyEnabled = SWITCH_IVY_ENABLED__PRE_R3__;\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di';\nimport {ErrorHandler} from '../error_handler';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {QueryList} from '../linker/query_list';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer2, RendererFactory2, RendererType2} from '../render/api';\nimport {Sanitizer, SecurityContext} from '../sanitization/security';\nimport {Type} from '../type';\n\n\n// -------------------------------------\n// Defs\n// -------------------------------------\n\n/**\n * Factory for ViewDefinitions/NgModuleDefinitions.\n * We use a function so we can reexeute it in case an error happens and use the given logger\n * function to log the error from the definition of the node, which is shown in all browser\n * logs.\n */\nexport interface DefinitionFactory<D extends Definition<any>> { (logger: NodeLogger): D; }\n\n/**\n * Function to call console.error at the right source location. This is an indirection\n * via another function as browser will log the location that actually called\n * `console.error`.\n */\nexport interface NodeLogger { (): () => void; }\n\nexport interface Definition<DF extends DefinitionFactory<any>> { factory: DF|null; }\n\nexport interface NgModuleDefinition extends Definition<NgModuleDefinitionFactory> {\n providers: NgModuleProviderDef[];\n providersByKey: {[tokenKey: string]: NgModuleProviderDef};\n modules: any[];\n isRoot: boolean;\n}\n\nexport interface NgModuleDefinitionFactory extends DefinitionFactory<NgModuleDefinition> {}\n\nexport interface ViewDefinition extends Definition<ViewDefinitionFactory> {\n flags: ViewFlags;\n updateDirectives: ViewUpdateFn;\n updateRenderer: ViewUpdateFn;\n handleEvent: ViewHandleEventFn;\n /**\n * Order: Depth first.\n * Especially providers are before elements / anchors.\n */\n nodes: NodeDef[];\n /** aggregated NodeFlags for all nodes **/\n nodeFlags: NodeFlags;\n rootNodeFlags: NodeFlags;\n lastRenderRootNode: NodeDef|null;\n bindingCount: number;\n outputCount: number;\n /**\n * Binary or of all query ids that are matched by one of the nodes.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n nodeMatchedQueries: number;\n}\n\nexport interface ViewDefinitionFactory extends DefinitionFactory<ViewDefinition> {}\n\n\nexport interface ViewUpdateFn { (check: NodeCheckFn, view: ViewData): void; }\n\n// helper functions to create an overloaded function type.\nexport interface NodeCheckFn {\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Dynamic, values: any[]): any;\n\n (view: ViewData, nodeIndex: number, argStyle: ArgumentType.Inline, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any;\n}\n\nexport const enum ArgumentType {Inline = 0, Dynamic = 1}\n\nexport interface ViewHandleEventFn {\n (view: ViewData, nodeIndex: number, eventName: string, event: any): boolean;\n}\n\n/**\n * Bitmask for ViewDefinition.flags.\n */\nexport const enum ViewFlags {\n None = 0,\n OnPush = 1 << 1,\n}\n\n/**\n * A node definition in the view.\n *\n * Note: We use one type for all nodes so that loops that loop over all nodes\n * of a ViewDefinition stay monomorphic!\n */\nexport interface NodeDef {\n flags: NodeFlags;\n // Index of the node in view data and view definition (those are the same)\n nodeIndex: number;\n // Index of the node in the check functions\n // Differ from nodeIndex when nodes are added or removed at runtime (ie after compilation)\n checkIndex: number;\n parent: NodeDef|null;\n renderParent: NodeDef|null;\n /** this is checked against NgContentDef.index to find matched nodes */\n ngContentIndex: number|null;\n /** number of transitive children */\n childCount: number;\n /** aggregated NodeFlags for all transitive children (does not include self) **/\n childFlags: NodeFlags;\n /** aggregated NodeFlags for all direct children (does not include self) **/\n directChildFlags: NodeFlags;\n\n bindingIndex: number;\n bindings: BindingDef[];\n bindingFlags: BindingFlags;\n outputIndex: number;\n outputs: OutputDef[];\n /**\n * references that the user placed on the element\n */\n references: {[refId: string]: QueryValueType};\n /**\n * ids and value types of all queries that are matched by this node.\n */\n matchedQueries: {[queryId: number]: QueryValueType};\n /** Binary or of all matched query ids of this node. */\n matchedQueryIds: number;\n /**\n * Binary or of all query ids that are matched by one of the children.\n * This includes query ids from templates as well.\n * Used as a bloom filter.\n */\n childMatchedQueries: number;\n element: ElementDef|null;\n provider: ProviderDef|null;\n text: TextDef|null;\n query: QueryDef|null;\n ngContent: NgContentDef|null;\n}\n\n/**\n * Bitmask for NodeDef.flags.\n * Naming convention:\n * - `Type...`: flags that are mutually exclusive\n * - `Cat...`: union of multiple `Type...` (short for category).\n */\nexport const enum NodeFlags {\n None = 0,\n TypeElement = 1 << 0,\n TypeText = 1 << 1,\n ProjectedTemplate = 1 << 2,\n CatRenderNode = TypeElement | TypeText,\n TypeNgContent = 1 << 3,\n TypePipe = 1 << 4,\n TypePureArray = 1 << 5,\n TypePureObject = 1 << 6,\n TypePurePipe = 1 << 7,\n CatPureExpression = TypePureArray | TypePureObject | TypePurePipe,\n TypeValueProvider = 1 << 8,\n TypeClassProvider = 1 << 9,\n TypeFactoryProvider = 1 << 10,\n TypeUseExistingProvider = 1 << 11,\n LazyProvider = 1 << 12,\n PrivateProvider = 1 << 13,\n TypeDirective = 1 << 14,\n Component = 1 << 15,\n CatProviderNoDirective =\n TypeValueProvider | TypeClassProvider | TypeFactoryProvider | TypeUseExistingProvider,\n CatProvider = CatProviderNoDirective | TypeDirective,\n OnInit = 1 << 16,\n OnDestroy = 1 << 17,\n DoCheck = 1 << 18,\n OnChanges = 1 << 19,\n AfterContentInit = 1 << 20,\n AfterContentChecked = 1 << 21,\n AfterViewInit = 1 << 22,\n AfterViewChecked = 1 << 23,\n EmbeddedViews = 1 << 24,\n ComponentView = 1 << 25,\n TypeContentQuery = 1 << 26,\n TypeViewQuery = 1 << 27,\n StaticQuery = 1 << 28,\n DynamicQuery = 1 << 29,\n TypeNgModule = 1 << 30,\n CatQuery = TypeContentQuery | TypeViewQuery,\n\n // mutually exclusive values...\n Types = CatRenderNode | TypeNgContent | TypePipe | CatPureExpression | CatProvider | CatQuery\n}\n\nexport interface BindingDef {\n flags: BindingFlags;\n ns: string|null;\n name: string|null;\n nonMinifiedName: string|null;\n securityContext: SecurityContext|null;\n suffix: string|null;\n}\n\nexport const enum BindingFlags {\n TypeElementAttribute = 1 << 0,\n TypeElementClass = 1 << 1,\n TypeElementStyle = 1 << 2,\n TypeProperty = 1 << 3,\n SyntheticProperty = 1 << 4,\n SyntheticHostProperty = 1 << 5,\n CatSyntheticProperty = SyntheticProperty | SyntheticHostProperty,\n\n // mutually exclusive values...\n Types = TypeElementAttribute | TypeElementClass | TypeElementStyle | TypeProperty\n}\n\nexport interface OutputDef {\n type: OutputType;\n target: 'window'|'document'|'body'|'component'|null;\n eventName: string;\n propName: string|null;\n}\n\nexport const enum OutputType {ElementOutput, DirectiveOutput}\n\nexport const enum QueryValueType {\n ElementRef = 0,\n RenderElement = 1,\n TemplateRef = 2,\n ViewContainerRef = 3,\n Provider = 4\n}\n\nexport interface ElementDef {\n // set to null for `<ng-container>`\n name: string|null;\n ns: string|null;\n /** ns, name, value */\n attrs: [string, string, string][]|null;\n template: ViewDefinition|null;\n componentProvider: NodeDef|null;\n componentRendererType: RendererType2|null;\n // closure to allow recursive components\n componentView: ViewDefinitionFactory|null;\n /**\n * visible public providers for DI in the view,\n * as see from this element. This does not include private providers.\n */\n publicProviders: {[tokenKey: string]: NodeDef}|null;\n /**\n * same as visiblePublicProviders, but also includes private providers\n * that are located on this element.\n */\n allProviders: {[tokenKey: string]: NodeDef}|null;\n handleEvent: ElementHandleEventFn|null;\n}\n\nexport interface ElementHandleEventFn { (view: ViewData, eventName: string, event: any): boolean; }\n\nexport interface ProviderDef {\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface NgModuleProviderDef {\n flags: NodeFlags;\n index: number;\n token: any;\n value: any;\n deps: DepDef[];\n}\n\nexport interface DepDef {\n flags: DepFlags;\n token: any;\n tokenKey: string;\n}\n\n/**\n * Bitmask for DI flags\n */\nexport const enum DepFlags {\n None = 0,\n SkipSelf = 1 << 0,\n Optional = 1 << 1,\n Self = 1 << 2,\n Value = 1 << 3,\n}\n\nexport interface TextDef { prefix: string; }\n\nexport interface QueryDef {\n id: number;\n // variant of the id that can be used to check against NodeDef.matchedQueryIds, ...\n filterId: number;\n bindings: QueryBindingDef[];\n}\n\nexport interface QueryBindingDef {\n propName: string;\n bindingType: QueryBindingType;\n}\n\nexport const enum QueryBindingType {First = 0, All = 1}\n\nexport interface NgContentDef {\n /**\n * this index is checked against NodeDef.ngContentIndex to find the nodes\n * that are matched by this ng-content.\n * Note that a NodeDef with an ng-content can be reprojected, i.e.\n * have a ngContentIndex on its own.\n */\n index: number;\n}\n\n// -------------------------------------\n// Data\n// -------------------------------------\n\nexport interface NgModuleData extends Injector, NgModuleRef<any> {\n // Note: we are using the prefix _ as NgModuleData is an NgModuleRef and therefore directly\n // exposed to the user.\n _def: NgModuleDefinition;\n _parent: Injector;\n _providers: any[];\n}\n\n/**\n * View instance data.\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ViewData {\n def: ViewDefinition;\n root: RootData;\n renderer: Renderer2;\n // index of component provider / anchor.\n parentNodeDef: NodeDef|null;\n parent: ViewData|null;\n viewContainerParent: ViewData|null;\n component: any;\n context: any;\n // Attention: Never loop over this, as this will\n // create a polymorphic usage site.\n // Instead: Always loop over ViewDefinition.nodes,\n // and call the right accessor (e.g. `elementData`) based on\n // the NodeType.\n nodes: {[key: number]: NodeData};\n state: ViewState;\n oldValues: any[];\n disposables: DisposableFn[]|null;\n initIndex: number;\n}\n\n/**\n * Bitmask of states\n */\nexport const enum ViewState {\n BeforeFirstCheck = 1 << 0,\n FirstCheck = 1 << 1,\n Attached = 1 << 2,\n ChecksEnabled = 1 << 3,\n IsProjectedView = 1 << 4,\n CheckProjectedView = 1 << 5,\n CheckProjectedViews = 1 << 6,\n Destroyed = 1 << 7,\n\n // InitState Uses 3 bits\n InitState_Mask = 7 << 8,\n InitState_BeforeInit = 0 << 8,\n InitState_CallingOnInit = 1 << 8,\n InitState_CallingAfterContentInit = 2 << 8,\n InitState_CallingAfterViewInit = 3 << 8,\n InitState_AfterInit = 4 << 8,\n\n CatDetectChanges = Attached | ChecksEnabled,\n CatInit = BeforeFirstCheck | CatDetectChanges | InitState_BeforeInit\n}\n\n// Called before each cycle of a view's check to detect whether this is in the\n// initState for which we need to call ngOnInit, ngAfterContentInit or ngAfterViewInit\n// lifecycle methods. Returns true if this check cycle should call lifecycle\n// methods.\nexport function shiftInitState(\n view: ViewData, priorInitState: ViewState, newInitState: ViewState): boolean {\n // Only update the InitState if we are currently in the prior state.\n // For example, only move into CallingInit if we are in BeforeInit. Only\n // move into CallingContentInit if we are in CallingInit. Normally this will\n // always be true because of how checkCycle is called in checkAndUpdateView.\n // However, if checkAndUpdateView is called recursively or if an exception is\n // thrown while checkAndUpdateView is running, checkAndUpdateView starts over\n // from the beginning. This ensures the state is monotonically increasing,\n // terminating in the AfterInit state, which ensures the Init methods are called\n // at least once and only once.\n const state = view.state;\n const initState = state & ViewState.InitState_Mask;\n if (initState === priorInitState) {\n view.state = (state & ~ViewState.InitState_Mask) | newInitState;\n view.initIndex = -1;\n return true;\n }\n return initState === newInitState;\n}\n\n// Returns true if the lifecycle init method should be called for the node with\n// the given init index.\nexport function shouldCallLifecycleInitHook(\n view: ViewData, initState: ViewState, index: number): boolean {\n if ((view.state & ViewState.InitState_Mask) === initState && view.initIndex <= index) {\n view.initIndex = index + 1;\n return true;\n }\n return false;\n}\n\nexport interface DisposableFn { (): void; }\n\n/**\n * Node instance data.\n *\n * We have a separate type per NodeType to save memory\n * (TextData | ElementData | ProviderData | PureExpressionData | QueryList<any>)\n *\n * To keep our code monomorphic,\n * we prohibit using `NodeData` directly but enforce the use of accessors (`asElementData`, ...).\n * This way, no usage site can get a `NodeData` from view.nodes and then use it for different\n * purposes.\n */\nexport class NodeData { private __brand: any; }\n\n/**\n * Data for an instantiated NodeType.Text.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface TextData { renderText: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asTextData(view: ViewData, index: number): TextData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Element.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ElementData {\n renderElement: any;\n componentView: ViewData;\n viewContainer: ViewContainerData|null;\n template: TemplateData;\n}\n\nexport interface ViewContainerData extends ViewContainerRef {\n // Note: we are using the prefix _ as ViewContainerData is a ViewContainerRef and therefore\n // directly\n // exposed to the user.\n _embeddedViews: ViewData[];\n}\n\nexport interface TemplateData extends TemplateRef<any> {\n // views that have been created from the template\n // of this element,\n // but inserted into the embeddedViews of another element.\n // By default, this is undefined.\n // Note: we are using the prefix _ as TemplateData is a TemplateRef and therefore directly\n // exposed to the user.\n _projectedViews: ViewData[];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asElementData(view: ViewData, index: number): ElementData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.Provider.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface ProviderData { instance: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asProviderData(view: ViewData, index: number): ProviderData {\n return <any>view.nodes[index];\n}\n\n/**\n * Data for an instantiated NodeType.PureExpression.\n *\n * Attention: Adding fields to this is performance sensitive!\n */\nexport interface PureExpressionData { value: any; }\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asPureExpressionData(view: ViewData, index: number): PureExpressionData {\n return <any>view.nodes[index];\n}\n\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n */\nexport function asQueryList(view: ViewData, index: number): QueryList<any> {\n return <any>view.nodes[index];\n}\n\nexport interface RootData {\n injector: Injector;\n ngModule: NgModuleRef<any>;\n projectableNodes: any[][];\n selectorOrNode: any;\n renderer: Renderer2;\n rendererFactory: RendererFactory2;\n errorHandler: ErrorHandler;\n sanitizer: Sanitizer;\n}\n\nexport abstract class DebugContext {\n abstract get view(): ViewData;\n abstract get nodeIndex(): number|null;\n abstract get injector(): Injector;\n abstract get component(): any;\n abstract get providerTokens(): any[];\n abstract get references(): {[key: string]: any};\n abstract get context(): any;\n abstract get componentRenderElement(): any;\n abstract get renderNode(): any;\n abstract logError(console: Console, ...values: any[]): void;\n}\n\n// -------------------------------------\n// Other\n// -------------------------------------\n\nexport const enum CheckType {CheckAndUpdate, CheckNoChanges}\n\nexport interface ProviderOverride {\n token: any;\n flags: NodeFlags;\n value: any;\n deps: ([DepFlags, any]|any)[];\n deprecatedBehavior: boolean;\n}\n\nexport interface Services {\n setCurrentNode(view: ViewData, nodeIndex: number): void;\n createRootView(\n injector: Injector, projectableNodes: any[][], rootSelectorOrNode: string|any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData;\n createEmbeddedView(parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any):\n ViewData;\n createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData;\n createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any>;\n overrideProvider(override: ProviderOverride): void;\n overrideComponentView(compType: Type<any>, compFactory: ComponentFactory<any>): void;\n clearOverrides(): void;\n checkAndUpdateView(view: ViewData): void;\n checkNoChangesView(view: ViewData): void;\n destroyView(view: ViewData): void;\n resolveDep(\n view: ViewData, elDef: NodeDef|null, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue?: any): any;\n createDebugContext(view: ViewData, nodeIndex: number): DebugContext;\n handleEvent: ViewHandleEventFn;\n updateDirectives: (view: ViewData, checkType: CheckType) => void;\n updateRenderer: (view: ViewData, checkType: CheckType) => void;\n dirtyParentQueries: (view: ViewData) => void;\n}\n\n/**\n * This object is used to prevent cycles in the source files and to have a place where\n * debug mode can hook it. It is lazily filled when `isDevMode` is known.\n */\nexport const Services: Services = {\n setCurrentNode: undefined !,\n createRootView: undefined !,\n createEmbeddedView: undefined !,\n createComponentView: undefined !,\n createNgModuleRef: undefined !,\n overrideProvider: undefined !,\n overrideComponentView: undefined !,\n clearOverrides: undefined !,\n checkAndUpdateView: undefined !,\n checkNoChangesView: undefined !,\n destroyView: undefined !,\n resolveDep: undefined !,\n createDebugContext: undefined !,\n handleEvent: undefined !,\n updateDirectives: undefined !,\n updateRenderer: undefined !,\n dirtyParentQueries: undefined !,\n};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ERROR_DEBUG_CONTEXT, ERROR_LOGGER, getDebugContext} from '../errors';\nimport {DebugContext, ViewState} from './types';\n\nexport function expressionChangedAfterItHasBeenCheckedError(\n context: DebugContext, oldValue: any, currValue: any, isFirstCheck: boolean): Error {\n let msg =\n `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '${oldValue}'. Current value: '${currValue}'.`;\n if (isFirstCheck) {\n msg +=\n ` It seems like the view has been created after its parent and its children have been dirty checked.` +\n ` Has it been created in a change detection hook ?`;\n }\n return viewDebugError(msg, context);\n}\n\nexport function viewWrappedDebugError(err: any, context: DebugContext): Error {\n if (!(err instanceof Error)) {\n // errors that are not Error instances don't have a stack,\n // so it is ok to wrap them into a new Error object...\n err = new Error(err.toString());\n }\n _addDebugContext(err, context);\n return err;\n}\n\nexport function viewDebugError(msg: string, context: DebugContext): Error {\n const err = new Error(msg);\n _addDebugContext(err, context);\n return err;\n}\n\nfunction _addDebugContext(err: Error, context: DebugContext) {\n (err as any)[ERROR_DEBUG_CONTEXT] = context;\n (err as any)[ERROR_LOGGER] = context.logError.bind(context);\n}\n\nexport function isViewDebugError(err: Error): boolean {\n return !!getDebugContext(err);\n}\n\nexport function viewDestroyedError(action: string): Error {\n return new Error(`ViewDestroyedError: Attempt to use a destroyed view: ${action}`);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {WrappedValue, devModeEqual} from '../change_detection/change_detection';\nimport {SOURCE} from '../di/injector';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {looseIdentical, stringify} from '../util';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {BindingDef, BindingFlags, Definition, DefinitionFactory, DepDef, DepFlags, ElementData, NodeDef, NodeFlags, QueryValueType, Services, ViewData, ViewDefinition, ViewDefinitionFactory, ViewFlags, ViewState, asElementData, asTextData} from './types';\n\nexport const NOOP: any = () => {};\n\nconst _tokenKeyCache = new Map<any, string>();\n\nexport function tokenKey(token: any): string {\n let key = _tokenKeyCache.get(token);\n if (!key) {\n key = stringify(token) + '_' + _tokenKeyCache.size;\n _tokenKeyCache.set(token, key);\n }\n return key;\n}\n\nexport function unwrapValue(view: ViewData, nodeIdx: number, bindingIdx: number, value: any): any {\n if (WrappedValue.isWrapped(value)) {\n value = WrappedValue.unwrap(value);\n const globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n const oldValue = WrappedValue.unwrap(view.oldValues[globalBindingIdx]);\n view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n }\n return value;\n}\n\nconst UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\nconst EMPTY_RENDERER_TYPE_ID = '$$empty';\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createRendererType2(values: {\n styles: (string | any[])[],\n encapsulation: ViewEncapsulation,\n data: {[kind: string]: any[]}\n}): RendererType2 {\n return {\n id: UNDEFINED_RENDERER_TYPE_ID,\n styles: values.styles,\n encapsulation: values.encapsulation,\n data: values.data\n };\n}\n\nlet _renderCompCount = 0;\n\nexport function resolveRendererType2(type?: RendererType2 | null): RendererType2|null {\n if (type && type.id === UNDEFINED_RENDERER_TYPE_ID) {\n // first time we see this RendererType2. Initialize it...\n const isFilled =\n ((type.encapsulation != null && type.encapsulation !== ViewEncapsulation.None) ||\n type.styles.length || Object.keys(type.data).length);\n if (isFilled) {\n type.id = `c${_renderCompCount++}`;\n } else {\n type.id = EMPTY_RENDERER_TYPE_ID;\n }\n }\n if (type && type.id === EMPTY_RENDERER_TYPE_ID) {\n type = null;\n }\n return type || null;\n}\n\nexport function checkBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n const oldValues = view.oldValues;\n if ((view.state & ViewState.FirstCheck) ||\n !looseIdentical(oldValues[def.bindingIndex + bindingIdx], value)) {\n return true;\n }\n return false;\n}\n\nexport function checkAndUpdateBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n if (checkBinding(view, def, bindingIdx, value)) {\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return true;\n }\n return false;\n}\n\nexport function checkBindingNoChanges(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n const oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n if ((view.state & ViewState.BeforeFirstCheck) || !devModeEqual(oldValue, value)) {\n const bindingName = def.bindings[bindingIdx].name;\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, def.nodeIndex), `${bindingName}: ${oldValue}`,\n `${bindingName}: ${value}`, (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function markParentViewsForCheck(view: ViewData) {\n let currView: ViewData|null = view;\n while (currView) {\n if (currView.def.flags & ViewFlags.OnPush) {\n currView.state |= ViewState.ChecksEnabled;\n }\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function markParentViewsForCheckProjectedViews(view: ViewData, endView: ViewData) {\n let currView: ViewData|null = view;\n while (currView && currView !== endView) {\n currView.state |= ViewState.CheckProjectedViews;\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n\nexport function dispatchEvent(\n view: ViewData, nodeIndex: number, eventName: string, event: any): boolean|undefined {\n try {\n const nodeDef = view.def.nodes[nodeIndex];\n const startView = nodeDef.flags & NodeFlags.ComponentView ?\n asElementData(view, nodeIndex).componentView :\n view;\n markParentViewsForCheck(startView);\n return Services.handleEvent(view, nodeIndex, eventName, event);\n } catch (e) {\n // Attention: Don't rethrow, as it would cancel Observable subscriptions!\n view.root.errorHandler.handleError(e);\n }\n}\n\nexport function declaredViewContainer(view: ViewData): ElementData|null {\n if (view.parent) {\n const parentView = view.parent;\n return asElementData(parentView, view.parentNodeDef !.nodeIndex);\n }\n return null;\n}\n\n/**\n * for component views, this is the host element.\n * for embedded views, this is the index of the parent node\n * that contains the view container.\n */\nexport function viewParentEl(view: ViewData): NodeDef|null {\n const parentView = view.parent;\n if (parentView) {\n return view.parentNodeDef !.parent;\n } else {\n return null;\n }\n}\n\nexport function renderNode(view: ViewData, def: NodeDef): any {\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return asElementData(view, def.nodeIndex).renderElement;\n case NodeFlags.TypeText:\n return asTextData(view, def.nodeIndex).renderText;\n }\n}\n\nexport function elementEventFullName(target: string | null, name: string): string {\n return target ? `${target}:${name}` : name;\n}\n\nexport function isComponentView(view: ViewData): boolean {\n return !!view.parent && !!(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function isEmbeddedView(view: ViewData): boolean {\n return !!view.parent && !(view.parentNodeDef !.flags & NodeFlags.Component);\n}\n\nexport function filterQueryId(queryId: number): number {\n return 1 << (queryId % 32);\n}\n\nexport function splitMatchedQueriesDsl(\n matchedQueriesDsl: [string | number, QueryValueType][] | null): {\n matchedQueries: {[queryId: string]: QueryValueType},\n references: {[refId: string]: QueryValueType},\n matchedQueryIds: number\n} {\n const matchedQueries: {[queryId: string]: QueryValueType} = {};\n let matchedQueryIds = 0;\n const references: {[refId: string]: QueryValueType} = {};\n if (matchedQueriesDsl) {\n matchedQueriesDsl.forEach(([queryId, valueType]) => {\n if (typeof queryId === 'number') {\n matchedQueries[queryId] = valueType;\n matchedQueryIds |= filterQueryId(queryId);\n } else {\n references[queryId] = valueType;\n }\n });\n }\n return {matchedQueries, references, matchedQueryIds};\n}\n\nexport function splitDepsDsl(deps: ([DepFlags, any] | any)[], sourceName?: string): DepDef[] {\n return deps.map(value => {\n let token: any;\n let flags: DepFlags;\n if (Array.isArray(value)) {\n [flags, token] = value;\n } else {\n flags = DepFlags.None;\n token = value;\n }\n if (token && (typeof token === 'function' || typeof token === 'object') && sourceName) {\n Object.defineProperty(token, SOURCE, {value: sourceName, configurable: true});\n }\n return {flags, token, tokenKey: tokenKey(token)};\n });\n}\n\nexport function getParentRenderElement(view: ViewData, renderHost: any, def: NodeDef): any {\n let renderParent = def.renderParent;\n if (renderParent) {\n if ((renderParent.flags & NodeFlags.TypeElement) === 0 ||\n (renderParent.flags & NodeFlags.ComponentView) === 0 ||\n (renderParent.element !.componentRendererType &&\n renderParent.element !.componentRendererType !.encapsulation ===\n ViewEncapsulation.Native)) {\n // only children of non components, or children of components with native encapsulation should\n // be attached.\n return asElementData(view, def.renderParent !.nodeIndex).renderElement;\n }\n } else {\n return renderHost;\n }\n}\n\nconst DEFINITION_CACHE = new WeakMap<any, Definition<any>>();\n\nexport function resolveDefinition<D extends Definition<any>>(factory: DefinitionFactory<D>): D {\n let value = DEFINITION_CACHE.get(factory) !as D;\n if (!value) {\n value = factory(() => NOOP);\n value.factory = factory;\n DEFINITION_CACHE.set(factory, value);\n }\n return value;\n}\n\nexport function rootRenderNodes(view: ViewData): any[] {\n const renderNodes: any[] = [];\n visitRootRenderNodes(view, RenderNodeAction.Collect, undefined, undefined, renderNodes);\n return renderNodes;\n}\n\nexport const enum RenderNodeAction {Collect, AppendChild, InsertBefore, RemoveChild}\n\nexport function visitRootRenderNodes(\n view: ViewData, action: RenderNodeAction, parentNode: any, nextSibling: any, target?: any[]) {\n // We need to re-compute the parent node in case the nodes have been moved around manually\n if (action === RenderNodeAction.RemoveChild) {\n parentNode = view.renderer.parentNode(renderNode(view, view.def.lastRenderRootNode !));\n }\n visitSiblingRenderNodes(\n view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n}\n\nexport function visitSiblingRenderNodes(\n view: ViewData, action: RenderNodeAction, startIndex: number, endIndex: number, parentNode: any,\n nextSibling: any, target?: any[]) {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & (NodeFlags.TypeElement | NodeFlags.TypeText | NodeFlags.TypeNgContent)) {\n visitRenderNode(view, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n}\n\nexport function visitProjectedRenderNodes(\n view: ViewData, ngContentIndex: number, action: RenderNodeAction, parentNode: any,\n nextSibling: any, target?: any[]) {\n let compView: ViewData|null = view;\n while (compView && !isComponentView(compView)) {\n compView = compView.parent;\n }\n const hostView = compView !.parent;\n const hostElDef = viewParentEl(compView !);\n const startIndex = hostElDef !.nodeIndex + 1;\n const endIndex = hostElDef !.nodeIndex + hostElDef !.childCount;\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = hostView !.def.nodes[i];\n if (nodeDef.ngContentIndex === ngContentIndex) {\n visitRenderNode(hostView !, nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n if (!hostView !.parent) {\n // a root view\n const projectedNodes = view.root.projectableNodes[ngContentIndex];\n if (projectedNodes) {\n for (let i = 0; i < projectedNodes.length; i++) {\n execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n }\n }\n }\n}\n\nfunction visitRenderNode(\n view: ViewData, nodeDef: NodeDef, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n if (nodeDef.flags & NodeFlags.TypeNgContent) {\n visitProjectedRenderNodes(\n view, nodeDef.ngContent !.index, action, parentNode, nextSibling, target);\n } else {\n const rn = renderNode(view, nodeDef);\n if (action === RenderNodeAction.RemoveChild && (nodeDef.flags & NodeFlags.ComponentView) &&\n (nodeDef.bindingFlags & BindingFlags.CatSyntheticProperty)) {\n // Note: we might need to do both actions.\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticProperty)) {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.bindingFlags & (BindingFlags.SyntheticHostProperty)) {\n const compView = asElementData(view, nodeDef.nodeIndex).componentView;\n execRenderNodeAction(compView, rn, action, parentNode, nextSibling, target);\n }\n } else {\n execRenderNodeAction(view, rn, action, parentNode, nextSibling, target);\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = asElementData(view, nodeDef.nodeIndex).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n }\n }\n if (nodeDef.flags & NodeFlags.TypeElement && !nodeDef.element !.name) {\n visitSiblingRenderNodes(\n view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode,\n nextSibling, target);\n }\n }\n}\n\nfunction execRenderNodeAction(\n view: ViewData, renderNode: any, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n const renderer = view.renderer;\n switch (action) {\n case RenderNodeAction.AppendChild:\n renderer.appendChild(parentNode, renderNode);\n break;\n case RenderNodeAction.InsertBefore:\n renderer.insertBefore(parentNode, renderNode, nextSibling);\n break;\n case RenderNodeAction.RemoveChild:\n renderer.removeChild(parentNode, renderNode);\n break;\n case RenderNodeAction.Collect:\n target !.push(renderNode);\n break;\n }\n}\n\nconst NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n\nexport function splitNamespace(name: string): string[] {\n if (name[0] === ':') {\n const match = name.match(NS_PREFIX_RE) !;\n return [match[1], match[2]];\n }\n return ['', name];\n}\n\nexport function calcBindingFlags(bindings: BindingDef[]): BindingFlags {\n let flags = 0;\n for (let i = 0; i < bindings.length; i++) {\n flags |= bindings[i].flags;\n }\n return flags;\n}\n\nexport function interpolate(valueCount: number, constAndInterp: string[]): string {\n let result = '';\n for (let i = 0; i < valueCount * 2; i = i + 2) {\n result = result + constAndInterp[i] + _toStringWithNull(constAndInterp[i + 1]);\n }\n return result + constAndInterp[valueCount * 2];\n}\n\nexport function inlineInterpolate(\n valueCount: number, c0: string, a1: any, c1: string, a2?: any, c2?: string, a3?: any,\n c3?: string, a4?: any, c4?: string, a5?: any, c5?: string, a6?: any, c6?: string, a7?: any,\n c7?: string, a8?: any, c8?: string, a9?: any, c9?: string): string {\n switch (valueCount) {\n case 1:\n return c0 + _toStringWithNull(a1) + c1;\n case 2:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2;\n case 3:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3;\n case 4:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4;\n case 5:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5;\n case 6:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) + c6;\n case 7:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7;\n case 8:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8;\n case 9:\n return c0 + _toStringWithNull(a1) + c1 + _toStringWithNull(a2) + c2 + _toStringWithNull(a3) +\n c3 + _toStringWithNull(a4) + c4 + _toStringWithNull(a5) + c5 + _toStringWithNull(a6) +\n c6 + _toStringWithNull(a7) + c7 + _toStringWithNull(a8) + c8 + _toStringWithNull(a9) + c9;\n default:\n throw new Error(`Does not support more than 9 expressions`);\n }\n}\n\nfunction _toStringWithNull(v: any): string {\n return v != null ? v.toString() : '';\n}\n\nexport const EMPTY_ARRAY: any[] = [];\nexport const EMPTY_MAP: {[key: string]: any} = {};\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {SecurityContext} from '../sanitization/security';\n\nimport {BindingDef, BindingFlags, ElementData, ElementHandleEventFn, NodeDef, NodeFlags, OutputDef, OutputType, QueryValueType, ViewData, ViewDefinitionFactory, asElementData} from './types';\nimport {NOOP, calcBindingFlags, checkAndUpdateBinding, dispatchEvent, elementEventFullName, getParentRenderElement, resolveDefinition, resolveRendererType2, splitMatchedQueriesDsl, splitNamespace} from './util';\n\nexport function anchorDef(\n flags: NodeFlags, matchedQueriesDsl: null | [string | number, QueryValueType][],\n ngContentIndex: null | number, childCount: number, handleEvent?: null | ElementHandleEventFn,\n templateFactory?: ViewDefinitionFactory): NodeDef {\n flags |= NodeFlags.TypeElement;\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n const template = templateFactory ? resolveDefinition(templateFactory) : null;\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n flags,\n checkIndex: -1,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: {\n ns: null,\n name: null,\n attrs: null, template,\n componentProvider: null,\n componentView: null,\n componentRendererType: null,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function elementDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: null | [string | number, QueryValueType][], ngContentIndex: null | number,\n childCount: number, namespaceAndName: string | null, fixedAttrs: null | [string, string][] = [],\n bindings?: null | [BindingFlags, string, string | SecurityContext | null][],\n outputs?: null | ([string, string])[], handleEvent?: null | ElementHandleEventFn,\n componentView?: null | ViewDefinitionFactory,\n componentRendererType?: RendererType2 | null): NodeDef {\n if (!handleEvent) {\n handleEvent = NOOP;\n }\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n let ns: string = null !;\n let name: string = null !;\n if (namespaceAndName) {\n [ns, name] = splitNamespace(namespaceAndName);\n }\n bindings = bindings || [];\n const bindingDefs: BindingDef[] = new Array(bindings.length);\n for (let i = 0; i < bindings.length; i++) {\n const [bindingFlags, namespaceAndName, suffixOrSecurityContext] = bindings[i];\n\n const [ns, name] = splitNamespace(namespaceAndName);\n let securityContext: SecurityContext = undefined !;\n let suffix: string = undefined !;\n switch (bindingFlags & BindingFlags.Types) {\n case BindingFlags.TypeElementStyle:\n suffix = <string>suffixOrSecurityContext;\n break;\n case BindingFlags.TypeElementAttribute:\n case BindingFlags.TypeProperty:\n securityContext = <SecurityContext>suffixOrSecurityContext;\n break;\n }\n bindingDefs[i] =\n {flags: bindingFlags, ns, name, nonMinifiedName: name, securityContext, suffix};\n }\n outputs = outputs || [];\n const outputDefs: OutputDef[] = new Array(outputs.length);\n for (let i = 0; i < outputs.length; i++) {\n const [target, eventName] = outputs[i];\n outputDefs[i] = {\n type: OutputType.ElementOutput,\n target: <any>target, eventName,\n propName: null\n };\n }\n fixedAttrs = fixedAttrs || [];\n const attrs = <[string, string, string][]>fixedAttrs.map(([namespaceAndName, value]) => {\n const [ns, name] = splitNamespace(namespaceAndName);\n return [ns, name, value];\n });\n componentRendererType = resolveRendererType2(componentRendererType);\n if (componentView) {\n flags |= NodeFlags.ComponentView;\n }\n flags |= NodeFlags.TypeElement;\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references, ngContentIndex, childCount,\n bindings: bindingDefs,\n bindingFlags: calcBindingFlags(bindingDefs),\n outputs: outputDefs,\n element: {\n ns,\n name,\n attrs,\n template: null,\n // will bet set by the view definition\n componentProvider: null,\n componentView: componentView || null,\n componentRendererType: componentRendererType,\n publicProviders: null,\n allProviders: null,\n handleEvent: handleEvent || NOOP,\n },\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createElement(view: ViewData, renderHost: any, def: NodeDef): ElementData {\n const elDef = def.element !;\n const rootSelectorOrNode = view.root.selectorOrNode;\n const renderer = view.renderer;\n let el: any;\n if (view.parent || !rootSelectorOrNode) {\n if (elDef.name) {\n el = renderer.createElement(elDef.name, elDef.ns);\n } else {\n el = renderer.createComment('');\n }\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, el);\n }\n } else {\n // when using native Shadow DOM, do not clear the root element contents to allow slot projection\n const preserveContent =\n (!!elDef.componentRendererType &&\n elDef.componentRendererType.encapsulation === ViewEncapsulation.ShadowDom);\n el = renderer.selectRootElement(rootSelectorOrNode, preserveContent);\n }\n if (elDef.attrs) {\n for (let i = 0; i < elDef.attrs.length; i++) {\n const [ns, name, value] = elDef.attrs[i];\n renderer.setAttribute(el, name, value, ns);\n }\n }\n return el;\n}\n\nexport function listenToElementOutputs(view: ViewData, compView: ViewData, def: NodeDef, el: any) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const handleEventClosure = renderEventHandlerClosure(\n view, def.nodeIndex, elementEventFullName(output.target, output.eventName));\n let listenTarget: 'window'|'document'|'body'|'component'|null = output.target;\n let listenerView = view;\n if (output.target === 'component') {\n listenTarget = null;\n listenerView = compView;\n }\n const disposable =\n <any>listenerView.renderer.listen(listenTarget || el, output.eventName, handleEventClosure);\n view.disposables ![def.outputIndex + i] = disposable;\n }\n}\n\nfunction renderEventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\n\nexport function checkAndUpdateElementInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindLen = def.bindings.length;\n let changed = false;\n if (bindLen > 0 && checkAndUpdateElementValue(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateElementValue(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateElementValue(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateElementValue(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateElementValue(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateElementValue(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateElementValue(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateElementValue(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateElementValue(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateElementValue(view, def, 9, v9)) changed = true;\n return changed;\n}\n\nexport function checkAndUpdateElementDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n if (checkAndUpdateElementValue(view, def, i, values[i])) changed = true;\n }\n return changed;\n}\n\nfunction checkAndUpdateElementValue(view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n if (!checkAndUpdateBinding(view, def, bindingIdx, value)) {\n return false;\n }\n const binding = def.bindings[bindingIdx];\n const elData = asElementData(view, def.nodeIndex);\n const renderNode = elData.renderElement;\n const name = binding.name !;\n switch (binding.flags & BindingFlags.Types) {\n case BindingFlags.TypeElementAttribute:\n setElementAttribute(view, binding, renderNode, binding.ns, name, value);\n break;\n case BindingFlags.TypeElementClass:\n setElementClass(view, renderNode, name, value);\n break;\n case BindingFlags.TypeElementStyle:\n setElementStyle(view, binding, renderNode, name, value);\n break;\n case BindingFlags.TypeProperty:\n const bindView = (def.flags & NodeFlags.ComponentView &&\n binding.flags & BindingFlags.SyntheticHostProperty) ?\n elData.componentView :\n view;\n setElementProperty(bindView, binding, renderNode, name, value);\n break;\n }\n return true;\n}\n\nfunction setElementAttribute(\n view: ViewData, binding: BindingDef, renderNode: any, ns: string | null, name: string,\n value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n renderValue = renderValue != null ? renderValue.toString() : null;\n const renderer = view.renderer;\n if (value != null) {\n renderer.setAttribute(renderNode, name, renderValue, ns);\n } else {\n renderer.removeAttribute(renderNode, name, ns);\n }\n}\n\nfunction setElementClass(view: ViewData, renderNode: any, name: string, value: boolean) {\n const renderer = view.renderer;\n if (value) {\n renderer.addClass(renderNode, name);\n } else {\n renderer.removeClass(renderNode, name);\n }\n}\n\nfunction setElementStyle(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n let renderValue: string|null =\n view.root.sanitizer.sanitize(SecurityContext.STYLE, value as{} | string);\n if (renderValue != null) {\n renderValue = renderValue.toString();\n const unit = binding.suffix;\n if (unit != null) {\n renderValue = renderValue + unit;\n }\n } else {\n renderValue = null;\n }\n const renderer = view.renderer;\n if (renderValue != null) {\n renderer.setStyle(renderNode, name, renderValue);\n } else {\n renderer.removeStyle(renderNode, name);\n }\n}\n\nfunction setElementProperty(\n view: ViewData, binding: BindingDef, renderNode: any, name: string, value: any) {\n const securityContext = binding.securityContext;\n let renderValue = securityContext ? view.root.sanitizer.sanitize(securityContext, value) : value;\n view.renderer.setProperty(renderNode, name, renderValue);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectableDef, getInjectableDef} from '../di/defs';\nimport {resolveForwardRef} from '../di/forward_ref';\nimport {INJECTOR, Injector} from '../di/injector';\nimport {setCurrentInjector} from '../di/injector_compatibility';\nimport {APP_ROOT} from '../di/scope';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {stringify} from '../util';\n\nimport {DepDef, DepFlags, NgModuleData, NgModuleDefinition, NgModuleProviderDef, NodeFlags} from './types';\nimport {splitDepsDsl, tokenKey} from './util';\n\nconst UNDEFINED_VALUE = new Object();\n\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\nconst NgModuleRefTokenKey = tokenKey(NgModuleRef);\n\nexport function moduleProvideDef(\n flags: NodeFlags, token: any, value: any,\n deps: ([DepFlags, any] | any)[]): NgModuleProviderDef {\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n const depDefs = splitDepsDsl(deps, stringify(token));\n return {\n // will bet set by the module definition\n index: -1,\n deps: depDefs, flags, token, value\n };\n}\n\nexport function moduleDef(providers: NgModuleProviderDef[]): NgModuleDefinition {\n const providersByKey: {[key: string]: NgModuleProviderDef} = {};\n const modules = [];\n let isRoot: boolean = false;\n for (let i = 0; i < providers.length; i++) {\n const provider = providers[i];\n if (provider.token === APP_ROOT && provider.value === true) {\n isRoot = true;\n }\n if (provider.flags & NodeFlags.TypeNgModule) {\n modules.push(provider.token);\n }\n provider.index = i;\n providersByKey[tokenKey(provider.token)] = provider;\n }\n return {\n // Will be filled later...\n factory: null,\n providersByKey,\n providers,\n modules,\n isRoot,\n };\n}\n\nexport function initNgModule(data: NgModuleData) {\n const def = data._def;\n const providers = data._providers = new Array(def.providers.length);\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (!(provDef.flags & NodeFlags.LazyProvider)) {\n // Make sure the provider has not been already initialized outside this loop.\n if (providers[i] === undefined) {\n providers[i] = _createProviderInstance(data, provDef);\n }\n }\n }\n}\n\nexport function resolveNgModuleDep(\n data: NgModuleData, depDef: DepDef, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const former = setCurrentInjector(data);\n try {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n if (depDef.flags & DepFlags.SkipSelf) {\n return data._parent.get(depDef.token, notFoundValue);\n }\n const tokenKey = depDef.tokenKey;\n switch (tokenKey) {\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n case NgModuleRefTokenKey:\n return data;\n }\n const providerDef = data._def.providersByKey[tokenKey];\n let injectableDef: InjectableDef<any>|null;\n if (providerDef) {\n let providerInstance = data._providers[providerDef.index];\n if (providerInstance === undefined) {\n providerInstance = data._providers[providerDef.index] =\n _createProviderInstance(data, providerDef);\n }\n return providerInstance === UNDEFINED_VALUE ? undefined : providerInstance;\n } else if (\n (injectableDef = getInjectableDef(depDef.token)) && targetsModule(data, injectableDef)) {\n const index = data._providers.length;\n data._def.providersByKey[depDef.tokenKey] = {\n flags: NodeFlags.TypeFactoryProvider | NodeFlags.LazyProvider,\n value: injectableDef.factory,\n deps: [], index,\n token: depDef.token,\n };\n data._providers[index] = UNDEFINED_VALUE;\n return (\n data._providers[index] =\n _createProviderInstance(data, data._def.providersByKey[depDef.tokenKey]));\n } else if (depDef.flags & DepFlags.Self) {\n return notFoundValue;\n }\n return data._parent.get(depDef.token, notFoundValue);\n } finally {\n setCurrentInjector(former);\n }\n}\n\nfunction moduleTransitivelyPresent(ngModule: NgModuleData, scope: any): boolean {\n return ngModule._def.modules.indexOf(scope) > -1;\n}\n\nfunction targetsModule(ngModule: NgModuleData, def: InjectableDef<any>): boolean {\n return def.providedIn != null && (moduleTransitivelyPresent(ngModule, def.providedIn) ||\n def.providedIn === 'root' && ngModule._def.isRoot);\n}\n\nfunction _createProviderInstance(ngModule: NgModuleData, providerDef: NgModuleProviderDef): any {\n let injectable: any;\n switch (providerDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n injectable = _createClass(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeFactoryProvider:\n injectable = _callFactory(ngModule, providerDef.value, providerDef.deps);\n break;\n case NodeFlags.TypeUseExistingProvider:\n injectable = resolveNgModuleDep(ngModule, providerDef.deps[0]);\n break;\n case NodeFlags.TypeValueProvider:\n injectable = providerDef.value;\n break;\n }\n\n // The read of `ngOnDestroy` here is slightly expensive as it's megamorphic, so it should be\n // avoided if possible. The sequence of checks here determines whether ngOnDestroy needs to be\n // checked. It might not if the `injectable` isn't an object or if NodeFlags.OnDestroy is already\n // set (ngOnDestroy was detected statically).\n if (injectable !== UNDEFINED_VALUE && injectable != null && typeof injectable === 'object' &&\n !(providerDef.flags & NodeFlags.OnDestroy) && typeof injectable.ngOnDestroy === 'function') {\n providerDef.flags |= NodeFlags.OnDestroy;\n }\n return injectable === undefined ? UNDEFINED_VALUE : injectable;\n}\n\nfunction _createClass(ngModule: NgModuleData, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return new ctor(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return new ctor(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction _callFactory(ngModule: NgModuleData, factory: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveNgModuleDep(ngModule, deps[0]));\n case 2:\n return factory(resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]));\n case 3:\n return factory(\n resolveNgModuleDep(ngModule, deps[0]), resolveNgModuleDep(ngModule, deps[1]),\n resolveNgModuleDep(ngModule, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveNgModuleDep(ngModule, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\nexport function callNgModuleLifecycle(ngModule: NgModuleData, lifecycles: NodeFlags) {\n const def = ngModule._def;\n const destroyed = new Set<any>();\n for (let i = 0; i < def.providers.length; i++) {\n const provDef = def.providers[i];\n if (provDef.flags & NodeFlags.OnDestroy) {\n const instance = ngModule._providers[i];\n if (instance && instance !== UNDEFINED_VALUE) {\n const onDestroy: Function|undefined = instance.ngOnDestroy;\n if (typeof onDestroy === 'function' && !destroyed.has(instance)) {\n onDestroy.apply(instance);\n destroyed.add(instance);\n }\n }\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementData, NodeDef, NodeFlags, Services, ViewData, ViewDefinition, ViewState} from './types';\nimport {RenderNodeAction, declaredViewContainer, isComponentView, renderNode, visitRootRenderNodes} from './util';\n\nexport function attachEmbeddedView(\n parentView: ViewData, elementData: ElementData, viewIndex: number | undefined | null,\n view: ViewData) {\n let embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex === null || viewIndex === undefined) {\n viewIndex = embeddedViews.length;\n }\n view.viewContainerParent = parentView;\n addToArray(embeddedViews, viewIndex !, view);\n attachProjectedView(elementData, view);\n\n Services.dirtyParentQueries(view);\n\n const prevView = viewIndex ! > 0 ? embeddedViews[viewIndex ! - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n}\n\nfunction attachProjectedView(vcElementData: ElementData, view: ViewData) {\n const dvcElementData = declaredViewContainer(view);\n if (!dvcElementData || dvcElementData === vcElementData ||\n view.state & ViewState.IsProjectedView) {\n return;\n }\n // Note: For performance reasons, we\n // - add a view to template._projectedViews only 1x throughout its lifetime,\n // and remove it not until the view is destroyed.\n // (hard, as when a parent view is attached/detached we would need to attach/detach all\n // nested projected views as well, even across component boundaries).\n // - don't track the insertion order of views in the projected views array\n // (hard, as when the views of the same template are inserted different view containers)\n view.state |= ViewState.IsProjectedView;\n let projectedViews = dvcElementData.template._projectedViews;\n if (!projectedViews) {\n projectedViews = dvcElementData.template._projectedViews = [];\n }\n projectedViews.push(view);\n // Note: we are changing the NodeDef here as we cannot calculate\n // the fact whether a template is used for projection during compilation.\n markNodeAsProjectedTemplate(view.parent !.def, view.parentNodeDef !);\n}\n\nfunction markNodeAsProjectedTemplate(viewDef: ViewDefinition, nodeDef: NodeDef) {\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n return;\n }\n viewDef.nodeFlags |= NodeFlags.ProjectedTemplate;\n nodeDef.flags |= NodeFlags.ProjectedTemplate;\n let parentNodeDef = nodeDef.parent;\n while (parentNodeDef) {\n parentNodeDef.childFlags |= NodeFlags.ProjectedTemplate;\n parentNodeDef = parentNodeDef.parent;\n }\n}\n\nexport function detachEmbeddedView(elementData: ElementData, viewIndex?: number): ViewData|null {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n if (viewIndex == null || viewIndex >= embeddedViews.length) {\n viewIndex = embeddedViews.length - 1;\n }\n if (viewIndex < 0) {\n return null;\n }\n const view = embeddedViews[viewIndex];\n view.viewContainerParent = null;\n removeFromArray(embeddedViews, viewIndex);\n\n // See attachProjectedView for why we don't update projectedViews here.\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n\n return view;\n}\n\nexport function detachProjectedView(view: ViewData) {\n if (!(view.state & ViewState.IsProjectedView)) {\n return;\n }\n const dvcElementData = declaredViewContainer(view);\n if (dvcElementData) {\n const projectedViews = dvcElementData.template._projectedViews;\n if (projectedViews) {\n removeFromArray(projectedViews, projectedViews.indexOf(view));\n Services.dirtyParentQueries(view);\n }\n }\n}\n\nexport function moveEmbeddedView(\n elementData: ElementData, oldViewIndex: number, newViewIndex: number): ViewData {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n const view = embeddedViews[oldViewIndex];\n removeFromArray(embeddedViews, oldViewIndex);\n if (newViewIndex == null) {\n newViewIndex = embeddedViews.length;\n }\n addToArray(embeddedViews, newViewIndex, view);\n\n // Note: Don't need to change projectedViews as the order in there\n // as always invalid...\n\n Services.dirtyParentQueries(view);\n\n renderDetachView(view);\n const prevView = newViewIndex > 0 ? embeddedViews[newViewIndex - 1] : null;\n renderAttachEmbeddedView(elementData, prevView, view);\n\n return view;\n}\n\nfunction renderAttachEmbeddedView(\n elementData: ElementData, prevView: ViewData | null, view: ViewData) {\n const prevRenderNode = prevView ? renderNode(prevView, prevView.def.lastRenderRootNode !) :\n elementData.renderElement;\n const parentNode = view.renderer.parentNode(prevRenderNode);\n const nextSibling = view.renderer.nextSibling(prevRenderNode);\n // Note: We can't check if `nextSibling` is present, as on WebWorkers it will always be!\n // However, browsers automatically do `appendChild` when there is no `nextSibling`.\n visitRootRenderNodes(view, RenderNodeAction.InsertBefore, parentNode, nextSibling, undefined);\n}\n\nexport function renderDetachView(view: ViewData) {\n visitRootRenderNodes(view, RenderNodeAction.RemoveChild, null, null, undefined);\n}\n\nfunction addToArray(arr: any[], index: number, value: any) {\n // perf: array.push is faster than array.splice!\n if (index >= arr.length) {\n arr.push(value);\n } else {\n arr.splice(index, 0, value);\n }\n}\n\nfunction removeFromArray(arr: any[], index: number) {\n // perf: array.pop is faster than array.splice!\n if (index >= arr.length - 1) {\n arr.pop();\n } else {\n arr.splice(index, 1);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\nimport {InjectFlags} from '../di/injector_compatibility';\nimport {ComponentFactory, ComponentRef} from '../linker/component_factory';\nimport {ComponentFactoryBoundToModule, ComponentFactoryResolver} from '../linker/component_factory_resolver';\nimport {ElementRef} from '../linker/element_ref';\nimport {InternalNgModuleRef, NgModuleRef} from '../linker/ng_module_factory';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {EmbeddedViewRef, InternalViewRef, ViewRef} from '../linker/view_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {Type} from '../type';\nimport {stringify} from '../util';\nimport {VERSION} from '../version';\n\nimport {callNgModuleLifecycle, initNgModule, resolveNgModuleDep} from './ng_module';\nimport {DepFlags, ElementData, NgModuleData, NgModuleDefinition, NodeDef, NodeFlags, Services, TemplateData, ViewContainerData, ViewData, ViewDefinitionFactory, ViewState, asElementData, asProviderData, asTextData} from './types';\nimport {markParentViewsForCheck, resolveDefinition, rootRenderNodes, splitNamespace, tokenKey, viewParentEl} from './util';\nimport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView, renderDetachView} from './view_attach';\n\nconst EMPTY_CONTEXT = new Object();\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createComponentFactory(\n selector: string, componentType: Type<any>, viewDefFactory: ViewDefinitionFactory,\n inputs: {[propName: string]: string} | null, outputs: {[propName: string]: string},\n ngContentSelectors: string[]): ComponentFactory<any> {\n return new ComponentFactory_(\n selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n}\n\nexport function getComponentViewDefinitionFactory(componentFactory: ComponentFactory<any>):\n ViewDefinitionFactory {\n return (componentFactory as ComponentFactory_).viewDefFactory;\n}\n\nclass ComponentFactory_ extends ComponentFactory<any> {\n /**\n * @internal\n */\n viewDefFactory: ViewDefinitionFactory;\n\n constructor(\n public selector: string, public componentType: Type<any>,\n viewDefFactory: ViewDefinitionFactory, private _inputs: {[propName: string]: string}|null,\n private _outputs: {[propName: string]: string}, public ngContentSelectors: string[]) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n this.viewDefFactory = viewDefFactory;\n }\n\n get inputs() {\n const inputsArr: {propName: string, templateName: string}[] = [];\n const inputs = this._inputs !;\n for (let propName in inputs) {\n const templateName = inputs[propName];\n inputsArr.push({propName, templateName});\n }\n return inputsArr;\n }\n\n get outputs() {\n const outputsArr: {propName: string, templateName: string}[] = [];\n for (let propName in this._outputs) {\n const templateName = this._outputs[propName];\n outputsArr.push({propName, templateName});\n }\n return outputsArr;\n }\n\n /**\n * Creates a new component.\n */\n create(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef<any>): ComponentRef<any> {\n if (!ngModule) {\n throw new Error('ngModule should be provided');\n }\n const viewDef = resolveDefinition(this.viewDefFactory);\n const componentNodeIndex = viewDef.nodes[0].element !.componentProvider !.nodeIndex;\n const view = Services.createRootView(\n injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n const component = asProviderData(view, componentNodeIndex).instance;\n if (rootSelectorOrNode) {\n view.renderer.setAttribute(asElementData(view, 0).renderElement, 'ng-version', VERSION.full);\n }\n\n return new ComponentRef_(view, new ViewRef_(view), component);\n }\n}\n\nclass ComponentRef_ extends ComponentRef<any> {\n public readonly hostView: ViewRef;\n public readonly instance: any;\n public readonly changeDetectorRef: ChangeDetectorRef;\n private _elDef: NodeDef;\n constructor(private _view: ViewData, private _viewRef: ViewRef, private _component: any) {\n super();\n this._elDef = this._view.def.nodes[0];\n this.hostView = _viewRef;\n this.changeDetectorRef = _viewRef;\n this.instance = _component;\n }\n get location(): ElementRef {\n return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);\n }\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n get componentType(): Type<any> { return <any>this._component.constructor; }\n\n destroy(): void { this._viewRef.destroy(); }\n onDestroy(callback: Function): void { this._viewRef.onDestroy(callback); }\n}\n\nexport function createViewContainerData(\n view: ViewData, elDef: NodeDef, elData: ElementData): ViewContainerData {\n return new ViewContainerRef_(view, elDef, elData);\n}\n\nclass ViewContainerRef_ implements ViewContainerData {\n /**\n * @internal\n */\n _embeddedViews: ViewData[] = [];\n constructor(private _view: ViewData, private _elDef: NodeDef, private _data: ElementData) {}\n\n get element(): ElementRef { return new ElementRef(this._data.renderElement); }\n\n get injector(): Injector { return new Injector_(this._view, this._elDef); }\n\n /** @deprecated No replacement */\n get parentInjector(): Injector {\n let view = this._view;\n let elDef = this._elDef.parent;\n while (!elDef && view) {\n elDef = viewParentEl(view);\n view = view.parent !;\n }\n\n return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n }\n\n clear(): void {\n const len = this._embeddedViews.length;\n for (let i = len - 1; i >= 0; i--) {\n const view = detachEmbeddedView(this._data, i) !;\n Services.destroyView(view);\n }\n }\n\n get(index: number): ViewRef|null {\n const view = this._embeddedViews[index];\n if (view) {\n const ref = new ViewRef_(view);\n ref.attachToViewContainerRef(this);\n return ref;\n }\n return null;\n }\n\n get length(): number { return this._embeddedViews.length; }\n\n createEmbeddedView<C>(templateRef: TemplateRef<C>, context?: C, index?: number):\n EmbeddedViewRef<C> {\n const viewRef = templateRef.createEmbeddedView(context || <any>{});\n this.insert(viewRef, index);\n return viewRef;\n }\n\n createComponent<C>(\n componentFactory: ComponentFactory<C>, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModuleRef?: NgModuleRef<any>): ComponentRef<C> {\n const contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n ngModuleRef = contextInjector.get(NgModuleRef);\n }\n const componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n\n insert(viewRef: ViewRef, index?: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const viewRef_ = <ViewRef_>viewRef;\n const viewData = viewRef_._view;\n attachEmbeddedView(this._view, this._data, index, viewData);\n viewRef_.attachToViewContainerRef(this);\n return viewRef;\n }\n\n move(viewRef: ViewRef_, currentIndex: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const previousIndex = this._embeddedViews.indexOf(viewRef._view);\n moveEmbeddedView(this._data, previousIndex, currentIndex);\n return viewRef;\n }\n\n indexOf(viewRef: ViewRef): number {\n return this._embeddedViews.indexOf((<ViewRef_>viewRef)._view);\n }\n\n remove(index?: number): void {\n const viewData = detachEmbeddedView(this._data, index);\n if (viewData) {\n Services.destroyView(viewData);\n }\n }\n\n detach(index?: number): ViewRef|null {\n const view = detachEmbeddedView(this._data, index);\n return view ? new ViewRef_(view) : null;\n }\n}\n\nexport function createChangeDetectorRef(view: ViewData): ChangeDetectorRef {\n return new ViewRef_(view);\n}\n\nexport class ViewRef_ implements EmbeddedViewRef<any>, InternalViewRef {\n /** @internal */\n _view: ViewData;\n private _viewContainerRef: ViewContainerRef|null;\n private _appRef: ApplicationRef|null;\n\n constructor(_view: ViewData) {\n this._view = _view;\n this._viewContainerRef = null;\n this._appRef = null;\n }\n\n get rootNodes(): any[] { return rootRenderNodes(this._view); }\n\n get context() { return this._view.context; }\n\n get destroyed(): boolean { return (this._view.state & ViewState.Destroyed) !== 0; }\n\n markForCheck(): void { markParentViewsForCheck(this._view); }\n detach(): void { this._view.state &= ~ViewState.Attached; }\n detectChanges(): void {\n const fs = this._view.root.rendererFactory;\n if (fs.begin) {\n fs.begin();\n }\n try {\n Services.checkAndUpdateView(this._view);\n } finally {\n if (fs.end) {\n fs.end();\n }\n }\n }\n checkNoChanges(): void { Services.checkNoChangesView(this._view); }\n\n reattach(): void { this._view.state |= ViewState.Attached; }\n onDestroy(callback: Function) {\n if (!this._view.disposables) {\n this._view.disposables = [];\n }\n this._view.disposables.push(<any>callback);\n }\n\n destroy() {\n if (this._appRef) {\n this._appRef.detachView(this);\n } else if (this._viewContainerRef) {\n this._viewContainerRef.detach(this._viewContainerRef.indexOf(this));\n }\n Services.destroyView(this._view);\n }\n\n detachFromAppRef() {\n this._appRef = null;\n renderDetachView(this._view);\n Services.dirtyParentQueries(this._view);\n }\n\n attachToAppRef(appRef: ApplicationRef) {\n if (this._viewContainerRef) {\n throw new Error('This view is already attached to a ViewContainer!');\n }\n this._appRef = appRef;\n }\n\n attachToViewContainerRef(vcRef: ViewContainerRef) {\n if (this._appRef) {\n throw new Error('This view is already attached directly to the ApplicationRef!');\n }\n this._viewContainerRef = vcRef;\n }\n}\n\nexport function createTemplateData(view: ViewData, def: NodeDef): TemplateData {\n return new TemplateRef_(view, def);\n}\n\nclass TemplateRef_ extends TemplateRef<any> implements TemplateData {\n /**\n * @internal\n */\n // TODO(issue/24571): remove '!'.\n _projectedViews !: ViewData[];\n\n constructor(private _parentView: ViewData, private _def: NodeDef) { super(); }\n\n createEmbeddedView(context: any): EmbeddedViewRef<any> {\n return new ViewRef_(Services.createEmbeddedView(\n this._parentView, this._def, this._def.element !.template !, context));\n }\n\n get elementRef(): ElementRef {\n return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);\n }\n}\n\nexport function createInjector(view: ViewData, elDef: NodeDef): Injector {\n return new Injector_(view, elDef);\n}\n\nclass Injector_ implements Injector {\n constructor(private view: ViewData, private elDef: NodeDef|null) {}\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const allowPrivateServices =\n this.elDef ? (this.elDef.flags & NodeFlags.ComponentView) !== 0 : false;\n return Services.resolveDep(\n this.view, this.elDef, allowPrivateServices,\n {flags: DepFlags.None, token, tokenKey: tokenKey(token)}, notFoundValue);\n }\n}\n\nexport function nodeValue(view: ViewData, index: number): any {\n const def = view.def.nodes[index];\n if (def.flags & NodeFlags.TypeElement) {\n const elData = asElementData(view, def.nodeIndex);\n return def.element !.template ? elData.template : elData.renderElement;\n } else if (def.flags & NodeFlags.TypeText) {\n return asTextData(view, def.nodeIndex).renderText;\n } else if (def.flags & (NodeFlags.CatProvider | NodeFlags.TypePipe)) {\n return asProviderData(view, def.nodeIndex).instance;\n }\n throw new Error(`Illegal state: read nodeValue for node index ${index}`);\n}\n\nexport function createRendererV1(view: ViewData): RendererV1 {\n return new RendererAdapter(view.renderer);\n}\n\nclass RendererAdapter implements RendererV1 {\n constructor(private delegate: Renderer2) {}\n selectRootElement(selectorOrNode: string|Element): Element {\n return this.delegate.selectRootElement(selectorOrNode);\n }\n\n createElement(parent: Element|DocumentFragment, namespaceAndName: string): Element {\n const [ns, name] = splitNamespace(namespaceAndName);\n const el = this.delegate.createElement(name, ns);\n if (parent) {\n this.delegate.appendChild(parent, el);\n }\n return el;\n }\n\n createViewRoot(hostElement: Element): Element|DocumentFragment { return hostElement; }\n\n createTemplateAnchor(parentElement: Element|DocumentFragment): Comment {\n const comment = this.delegate.createComment('');\n if (parentElement) {\n this.delegate.appendChild(parentElement, comment);\n }\n return comment;\n }\n\n createText(parentElement: Element|DocumentFragment, value: string): any {\n const node = this.delegate.createText(value);\n if (parentElement) {\n this.delegate.appendChild(parentElement, node);\n }\n return node;\n }\n\n projectNodes(parentElement: Element|DocumentFragment, nodes: Node[]) {\n for (let i = 0; i < nodes.length; i++) {\n this.delegate.appendChild(parentElement, nodes[i]);\n }\n }\n\n attachViewAfter(node: Node, viewRootNodes: Node[]) {\n const parentElement = this.delegate.parentNode(node);\n const nextSibling = this.delegate.nextSibling(node);\n for (let i = 0; i < viewRootNodes.length; i++) {\n this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);\n }\n }\n\n detachView(viewRootNodes: (Element|Text|Comment)[]) {\n for (let i = 0; i < viewRootNodes.length; i++) {\n const node = viewRootNodes[i];\n const parentElement = this.delegate.parentNode(node);\n this.delegate.removeChild(parentElement, node);\n }\n }\n\n destroyView(hostElement: Element|DocumentFragment, viewAllNodes: Node[]) {\n for (let i = 0; i < viewAllNodes.length; i++) {\n this.delegate.destroyNode !(viewAllNodes[i]);\n }\n }\n\n listen(renderElement: any, name: string, callback: Function): Function {\n return this.delegate.listen(renderElement, name, <any>callback);\n }\n\n listenGlobal(target: string, name: string, callback: Function): Function {\n return this.delegate.listen(target, name, <any>callback);\n }\n\n setElementProperty(\n renderElement: Element|DocumentFragment, propertyName: string, propertyValue: any): void {\n this.delegate.setProperty(renderElement, propertyName, propertyValue);\n }\n\n setElementAttribute(renderElement: Element, namespaceAndName: string, attributeValue?: string):\n void {\n const [ns, name] = splitNamespace(namespaceAndName);\n if (attributeValue != null) {\n this.delegate.setAttribute(renderElement, name, attributeValue, ns);\n } else {\n this.delegate.removeAttribute(renderElement, name, ns);\n }\n }\n\n setBindingDebugInfo(renderElement: Element, propertyName: string, propertyValue: string): void {}\n\n setElementClass(renderElement: Element, className: string, isAdd: boolean): void {\n if (isAdd) {\n this.delegate.addClass(renderElement, className);\n } else {\n this.delegate.removeClass(renderElement, className);\n }\n }\n\n setElementStyle(renderElement: HTMLElement, styleName: string, styleValue?: string): void {\n if (styleValue != null) {\n this.delegate.setStyle(renderElement, styleName, styleValue);\n } else {\n this.delegate.removeStyle(renderElement, styleName);\n }\n }\n\n invokeElementMethod(renderElement: Element, methodName: string, args: any[]): void {\n (renderElement as any)[methodName].apply(renderElement, args);\n }\n\n setText(renderNode: Text, text: string): void { this.delegate.setValue(renderNode, text); }\n\n animate(): any { throw new Error('Renderer.animate is no longer supported!'); }\n}\n\n\nexport function createNgModuleRef(\n moduleType: Type<any>, parent: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n}\n\nclass NgModuleRef_ implements NgModuleData, InternalNgModuleRef<any> {\n private _destroyListeners: (() => void)[] = [];\n private _destroyed: boolean = false;\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _providers !: any[];\n /** @internal */\n // TODO(issue/24571): remove '!'.\n _modules !: any[];\n\n readonly injector: Injector = this;\n\n constructor(\n private _moduleType: Type<any>, public _parent: Injector,\n public _bootstrapComponents: Type<any>[], public _def: NgModuleDefinition) {\n initNgModule(this);\n }\n\n get(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND,\n injectFlags: InjectFlags = InjectFlags.Default): any {\n let flags = DepFlags.None;\n if (injectFlags & InjectFlags.SkipSelf) {\n flags |= DepFlags.SkipSelf;\n } else if (injectFlags & InjectFlags.Self) {\n flags |= DepFlags.Self;\n }\n return resolveNgModuleDep(\n this, {token: token, tokenKey: tokenKey(token), flags: flags}, notFoundValue);\n }\n\n get instance() { return this.get(this._moduleType); }\n\n get componentFactoryResolver() { return this.get(ComponentFactoryResolver); }\n\n destroy(): void {\n if (this._destroyed) {\n throw new Error(\n `The ng module ${stringify(this.instance.constructor)} has already been destroyed.`);\n }\n this._destroyed = true;\n callNgModuleLifecycle(this, NodeFlags.OnDestroy);\n this._destroyListeners.forEach((listener) => listener());\n }\n\n onDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ChangeDetectorRef, SimpleChange, SimpleChanges, WrappedValue} from '../change_detection/change_detection';\nimport {INJECTOR, Injector, resolveForwardRef} from '../di';\nimport {ElementRef} from '../linker/element_ref';\nimport {TemplateRef} from '../linker/template_ref';\nimport {ViewContainerRef} from '../linker/view_container_ref';\nimport {Renderer as RendererV1, Renderer2} from '../render/api';\nimport {stringify} from '../util';\nimport {isObservable} from '../util/lang';\n\nimport {createChangeDetectorRef, createInjector, createRendererV1} from './refs';\nimport {BindingDef, BindingFlags, DepDef, DepFlags, NodeDef, NodeFlags, OutputDef, OutputType, ProviderData, QueryValueType, Services, ViewData, ViewFlags, ViewState, asElementData, asProviderData, shouldCallLifecycleInitHook} from './types';\nimport {calcBindingFlags, checkBinding, dispatchEvent, isComponentView, splitDepsDsl, splitMatchedQueriesDsl, tokenKey, viewParentEl} from './util';\n\nconst RendererV1TokenKey = tokenKey(RendererV1);\nconst Renderer2TokenKey = tokenKey(Renderer2);\nconst ElementRefTokenKey = tokenKey(ElementRef);\nconst ViewContainerRefTokenKey = tokenKey(ViewContainerRef);\nconst TemplateRefTokenKey = tokenKey(TemplateRef);\nconst ChangeDetectorRefTokenKey = tokenKey(ChangeDetectorRef);\nconst InjectorRefTokenKey = tokenKey(Injector);\nconst INJECTORRefTokenKey = tokenKey(INJECTOR);\n\nexport function directiveDef(\n checkIndex: number, flags: NodeFlags,\n matchedQueries: null | [string | number, QueryValueType][], childCount: number, ctor: any,\n deps: ([DepFlags, any] | any)[], props?: null | {[name: string]: [number, string]},\n outputs?: null | {[name: string]: string}): NodeDef {\n const bindings: BindingDef[] = [];\n if (props) {\n for (let prop in props) {\n const [bindingIndex, nonMinifiedName] = props[prop];\n bindings[bindingIndex] = {\n flags: BindingFlags.TypeProperty,\n name: prop, nonMinifiedName,\n ns: null,\n securityContext: null,\n suffix: null\n };\n }\n }\n const outputDefs: OutputDef[] = [];\n if (outputs) {\n for (let propName in outputs) {\n outputDefs.push(\n {type: OutputType.DirectiveOutput, propName, target: null, eventName: outputs[propName]});\n }\n }\n flags |= NodeFlags.TypeDirective;\n return _def(\n checkIndex, flags, matchedQueries, childCount, ctor, ctor, deps, bindings, outputDefs);\n}\n\nexport function pipeDef(flags: NodeFlags, ctor: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n flags |= NodeFlags.TypePipe;\n return _def(-1, flags, null, 0, ctor, ctor, deps);\n}\n\nexport function providerDef(\n flags: NodeFlags, matchedQueries: null | [string | number, QueryValueType][], token: any,\n value: any, deps: ([DepFlags, any] | any)[]): NodeDef {\n return _def(-1, flags, matchedQueries, 0, token, value, deps);\n}\n\nexport function _def(\n checkIndex: number, flags: NodeFlags,\n matchedQueriesDsl: [string | number, QueryValueType][] | null, childCount: number, token: any,\n value: any, deps: ([DepFlags, any] | any)[], bindings?: BindingDef[],\n outputs?: OutputDef[]): NodeDef {\n const {matchedQueries, references, matchedQueryIds} = splitMatchedQueriesDsl(matchedQueriesDsl);\n if (!outputs) {\n outputs = [];\n }\n if (!bindings) {\n bindings = [];\n }\n // Need to resolve forwardRefs as e.g. for `useValue` we\n // lowered the expression and then stopped evaluating it,\n // i.e. also didn't unwrap it.\n value = resolveForwardRef(value);\n\n const depDefs = splitDepsDsl(deps, stringify(token));\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0, matchedQueries, matchedQueryIds, references,\n ngContentIndex: -1, childCount, bindings,\n bindingFlags: calcBindingFlags(bindings), outputs,\n element: null,\n provider: {token, value, deps: depDefs},\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createProviderInstance(view: ViewData, def: NodeDef): any {\n return _createProviderInstance(view, def);\n}\n\nexport function createPipeInstance(view: ViewData, def: NodeDef): any {\n // deps are looked up from component.\n let compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n // pipes can see the private services of the component\n const allowPrivateServices = true;\n // pipes are always eager and classes!\n return createClass(\n compView.parent !, viewParentEl(compView) !, allowPrivateServices, def.provider !.value,\n def.provider !.deps);\n}\n\nexport function createDirectiveInstance(view: ViewData, def: NodeDef): any {\n // components can see other private services, other directives can't.\n const allowPrivateServices = (def.flags & NodeFlags.Component) > 0;\n // directives are always eager and classes!\n const instance = createClass(\n view, def.parent !, allowPrivateServices, def.provider !.value, def.provider !.deps);\n if (def.outputs.length) {\n for (let i = 0; i < def.outputs.length; i++) {\n const output = def.outputs[i];\n const outputObservable = instance[output.propName !];\n if (isObservable(outputObservable)) {\n const subscription = outputObservable.subscribe(\n eventHandlerClosure(view, def.parent !.nodeIndex, output.eventName));\n view.disposables ![def.outputIndex + i] = subscription.unsubscribe.bind(subscription);\n } else {\n throw new Error(\n `@Output ${output.propName} not initialized in '${instance.constructor.name}'.`);\n }\n }\n }\n return instance;\n}\n\nfunction eventHandlerClosure(view: ViewData, index: number, eventName: string) {\n return (event: any) => dispatchEvent(view, index, eventName, event);\n}\n\nexport function checkAndUpdateDirectiveInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n const bindLen = def.bindings.length;\n if (bindLen > 0 && checkBinding(view, def, 0, v0)) {\n changed = true;\n changes = updateProp(view, providerData, def, 0, v0, changes);\n }\n if (bindLen > 1 && checkBinding(view, def, 1, v1)) {\n changed = true;\n changes = updateProp(view, providerData, def, 1, v1, changes);\n }\n if (bindLen > 2 && checkBinding(view, def, 2, v2)) {\n changed = true;\n changes = updateProp(view, providerData, def, 2, v2, changes);\n }\n if (bindLen > 3 && checkBinding(view, def, 3, v3)) {\n changed = true;\n changes = updateProp(view, providerData, def, 3, v3, changes);\n }\n if (bindLen > 4 && checkBinding(view, def, 4, v4)) {\n changed = true;\n changes = updateProp(view, providerData, def, 4, v4, changes);\n }\n if (bindLen > 5 && checkBinding(view, def, 5, v5)) {\n changed = true;\n changes = updateProp(view, providerData, def, 5, v5, changes);\n }\n if (bindLen > 6 && checkBinding(view, def, 6, v6)) {\n changed = true;\n changes = updateProp(view, providerData, def, 6, v6, changes);\n }\n if (bindLen > 7 && checkBinding(view, def, 7, v7)) {\n changed = true;\n changes = updateProp(view, providerData, def, 7, v7, changes);\n }\n if (bindLen > 8 && checkBinding(view, def, 8, v8)) {\n changed = true;\n changes = updateProp(view, providerData, def, 8, v8, changes);\n }\n if (bindLen > 9 && checkBinding(view, def, 9, v9)) {\n changed = true;\n changes = updateProp(view, providerData, def, 9, v9, changes);\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nexport function checkAndUpdateDirectiveDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const providerData = asProviderData(view, def.nodeIndex);\n const directive = providerData.instance;\n let changed = false;\n let changes: SimpleChanges = undefined !;\n for (let i = 0; i < values.length; i++) {\n if (checkBinding(view, def, i, values[i])) {\n changed = true;\n changes = updateProp(view, providerData, def, i, values[i], changes);\n }\n }\n if (changes) {\n directive.ngOnChanges(changes);\n }\n if ((def.flags & NodeFlags.OnInit) &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingOnInit, def.nodeIndex)) {\n directive.ngOnInit();\n }\n if (def.flags & NodeFlags.DoCheck) {\n directive.ngDoCheck();\n }\n return changed;\n}\n\nfunction _createProviderInstance(view: ViewData, def: NodeDef): any {\n // private services can see other private services\n const allowPrivateServices = (def.flags & NodeFlags.PrivateProvider) > 0;\n const providerDef = def.provider;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypeClassProvider:\n return createClass(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeFactoryProvider:\n return callFactory(\n view, def.parent !, allowPrivateServices, providerDef !.value, providerDef !.deps);\n case NodeFlags.TypeUseExistingProvider:\n return resolveDep(view, def.parent !, allowPrivateServices, providerDef !.deps[0]);\n case NodeFlags.TypeValueProvider:\n return providerDef !.value;\n }\n}\n\nfunction createClass(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, ctor: any, deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return new ctor();\n case 1:\n return new ctor(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return new ctor(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = new Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return new ctor(...depValues);\n }\n}\n\nfunction callFactory(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, factory: any,\n deps: DepDef[]): any {\n const len = deps.length;\n switch (len) {\n case 0:\n return factory();\n case 1:\n return factory(resolveDep(view, elDef, allowPrivateServices, deps[0]));\n case 2:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]));\n case 3:\n return factory(\n resolveDep(view, elDef, allowPrivateServices, deps[0]),\n resolveDep(view, elDef, allowPrivateServices, deps[1]),\n resolveDep(view, elDef, allowPrivateServices, deps[2]));\n default:\n const depValues = Array(len);\n for (let i = 0; i < len; i++) {\n depValues[i] = resolveDep(view, elDef, allowPrivateServices, deps[i]);\n }\n return factory(...depValues);\n }\n}\n\n// This default value is when checking the hierarchy for a token.\n//\n// It means both:\n// - the token is not provided by the current injector,\n// - only the element injectors should be checked (ie do not check module injectors\n//\n// mod1\n// /\n// el1 mod2\n// \\ /\n// el2\n//\n// When requesting el2.injector.get(token), we should check in the following order and return the\n// first found value:\n// - el2.injector.get(token, default)\n// - el1.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) -> do not check the module\n// - mod2.injector.get(token, default)\nexport const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {};\n\nexport function resolveDep(\n view: ViewData, elDef: NodeDef, allowPrivateServices: boolean, depDef: DepDef,\n notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n if (depDef.flags & DepFlags.Value) {\n return depDef.token;\n }\n const startView = view;\n if (depDef.flags & DepFlags.Optional) {\n notFoundValue = null;\n }\n const tokenKey = depDef.tokenKey;\n\n if (tokenKey === ChangeDetectorRefTokenKey) {\n // directives on the same element as a component should be able to control the change detector\n // of that component as well.\n allowPrivateServices = !!(elDef && elDef.element !.componentView);\n }\n\n if (elDef && (depDef.flags & DepFlags.SkipSelf)) {\n allowPrivateServices = false;\n elDef = elDef.parent !;\n }\n\n let searchView: ViewData|null = view;\n while (searchView) {\n if (elDef) {\n switch (tokenKey) {\n case RendererV1TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return createRendererV1(compView);\n }\n case Renderer2TokenKey: {\n const compView = findCompView(searchView, elDef, allowPrivateServices);\n return compView.renderer;\n }\n case ElementRefTokenKey:\n return new ElementRef(asElementData(searchView, elDef.nodeIndex).renderElement);\n case ViewContainerRefTokenKey:\n return asElementData(searchView, elDef.nodeIndex).viewContainer;\n case TemplateRefTokenKey: {\n if (elDef.element !.template) {\n return asElementData(searchView, elDef.nodeIndex).template;\n }\n break;\n }\n case ChangeDetectorRefTokenKey: {\n let cdView = findCompView(searchView, elDef, allowPrivateServices);\n return createChangeDetectorRef(cdView);\n }\n case InjectorRefTokenKey:\n case INJECTORRefTokenKey:\n return createInjector(searchView, elDef);\n default:\n const providerDef =\n (allowPrivateServices ? elDef.element !.allProviders :\n elDef.element !.publicProviders) ![tokenKey];\n if (providerDef) {\n let providerData = asProviderData(searchView, providerDef.nodeIndex);\n if (!providerData) {\n providerData = {instance: _createProviderInstance(searchView, providerDef)};\n searchView.nodes[providerDef.nodeIndex] = providerData as any;\n }\n return providerData.instance;\n }\n }\n }\n\n allowPrivateServices = isComponentView(searchView);\n elDef = viewParentEl(searchView) !;\n searchView = searchView.parent !;\n\n if (depDef.flags & DepFlags.Self) {\n searchView = null;\n }\n }\n\n const value = startView.root.injector.get(depDef.token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR);\n\n if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||\n notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {\n // Return the value from the root element injector when\n // - it provides it\n // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n // - the module injector should not be checked\n // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)\n return value;\n }\n\n return startView.root.ngModule.injector.get(depDef.token, notFoundValue);\n}\n\nfunction findCompView(view: ViewData, elDef: NodeDef, allowPrivateServices: boolean) {\n let compView: ViewData;\n if (allowPrivateServices) {\n compView = asElementData(view, elDef.nodeIndex).componentView;\n } else {\n compView = view;\n while (compView.parent && !isComponentView(compView)) {\n compView = compView.parent;\n }\n }\n return compView;\n}\n\nfunction updateProp(\n view: ViewData, providerData: ProviderData, def: NodeDef, bindingIdx: number, value: any,\n changes: SimpleChanges): SimpleChanges {\n if (def.flags & NodeFlags.Component) {\n const compView = asElementData(view, def.parent !.nodeIndex).componentView;\n if (compView.def.flags & ViewFlags.OnPush) {\n compView.state |= ViewState.ChecksEnabled;\n }\n }\n const binding = def.bindings[bindingIdx];\n const propName = binding.name !;\n // Note: This is still safe with Closure Compiler as\n // the user passed in the property name as an object has to `providerDef`,\n // so Closure Compiler will have renamed the property correctly already.\n providerData.instance[propName] = value;\n if (def.flags & NodeFlags.OnChanges) {\n changes = changes || {};\n const oldValue = WrappedValue.unwrap(view.oldValues[def.bindingIndex + bindingIdx]);\n const binding = def.bindings[bindingIdx];\n changes[binding.nonMinifiedName !] =\n new SimpleChange(oldValue, value, (view.state & ViewState.FirstCheck) !== 0);\n }\n view.oldValues[def.bindingIndex + bindingIdx] = value;\n return changes;\n}\n\n// This function calls the ngAfterContentCheck, ngAfterContentInit,\n// ngAfterViewCheck, and ngAfterViewInit lifecycle hooks (depending on the node\n// flags in lifecycle). Unlike ngDoCheck, ngOnChanges and ngOnInit, which are\n// called during a pre-order traversal of the view tree (that is calling the\n// parent hooks before the child hooks) these events are sent in using a\n// post-order traversal of the tree (children before parents). This changes the\n// meaning of initIndex in the view state. For ngOnInit, initIndex tracks the\n// expected nodeIndex which a ngOnInit should be called. When sending\n// ngAfterContentInit and ngAfterViewInit it is the expected count of\n// ngAfterContentInit or ngAfterViewInit methods that have been called. This\n// ensure that despite being called recursively or after picking up after an\n// exception, the ngAfterContentInit or ngAfterViewInit will be called on the\n// correct nodes. Consider for example, the following (where E is an element\n// and D is a directive)\n// Tree: pre-order index post-order index\n// E1 0 6\n// E2 1 1\n// D3 2 0\n// E4 3 5\n// E5 4 4\n// E6 5 2\n// E7 6 3\n// As can be seen, the post-order index has an unclear relationship to the\n// pre-order index (postOrderIndex === preOrderIndex - parentCount +\n// childCount). Since number of calls to ngAfterContentInit and ngAfterViewInit\n// are stable (will be the same for the same view regardless of exceptions or\n// recursion) we just need to count them which will roughly correspond to the\n// post-order index (it skips elements and directives that do not have\n// lifecycle hooks).\n//\n// For example, if an exception is raised in the E6.onAfterViewInit() the\n// initIndex is left at 3 (by shouldCallLifecycleInitHook() which set it to\n// initIndex + 1). When checkAndUpdateView() is called again D3, E2 and E6 will\n// not have their ngAfterViewInit() called but, starting with E7, the rest of\n// the view will begin getting ngAfterViewInit() called until a check and\n// pass is complete.\n//\n// This algorthim also handles recursion. Consider if E4's ngAfterViewInit()\n// indirectly calls E1's ChangeDetectorRef.detectChanges(). The expected\n// initIndex is set to 6, the recusive checkAndUpdateView() starts walk again.\n// D3, E2, E6, E7, E5 and E4 are skipped, ngAfterViewInit() is called on E1.\n// When the recursion returns the initIndex will be 7 so E1 is skipped as it\n// has already been called in the recursively called checkAnUpdateView().\nexport function callLifecycleHooksChildrenFirst(view: ViewData, lifecycles: NodeFlags) {\n if (!(view.def.nodeFlags & lifecycles)) {\n return;\n }\n const nodes = view.def.nodes;\n let initIndex = 0;\n for (let i = 0; i < nodes.length; i++) {\n const nodeDef = nodes[i];\n let parent = nodeDef.parent;\n if (!parent && nodeDef.flags & lifecycles) {\n // matching root node (e.g. a pipe)\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n if ((nodeDef.childFlags & lifecycles) === 0) {\n // no child matches one of the lifecycles\n i += nodeDef.childCount;\n }\n while (parent && (parent.flags & NodeFlags.TypeElement) &&\n i === parent.nodeIndex + parent.childCount) {\n // last child of an element\n if (parent.directChildFlags & lifecycles) {\n initIndex = callElementProvidersLifecycles(view, parent, lifecycles, initIndex);\n }\n parent = parent.parent;\n }\n }\n}\n\nfunction callElementProvidersLifecycles(\n view: ViewData, elDef: NodeDef, lifecycles: NodeFlags, initIndex: number): number {\n for (let i = elDef.nodeIndex + 1; i <= elDef.nodeIndex + elDef.childCount; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & lifecycles) {\n callProviderLifecycles(view, i, nodeDef.flags & lifecycles, initIndex++);\n }\n // only visit direct children\n i += nodeDef.childCount;\n }\n return initIndex;\n}\n\nfunction callProviderLifecycles(\n view: ViewData, index: number, lifecycles: NodeFlags, initIndex: number) {\n const providerData = asProviderData(view, index);\n if (!providerData) {\n return;\n }\n const provider = providerData.instance;\n if (!provider) {\n return;\n }\n Services.setCurrentNode(view, index);\n if (lifecycles & NodeFlags.AfterContentInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterContentInit, initIndex)) {\n provider.ngAfterContentInit();\n }\n if (lifecycles & NodeFlags.AfterContentChecked) {\n provider.ngAfterContentChecked();\n }\n if (lifecycles & NodeFlags.AfterViewInit &&\n shouldCallLifecycleInitHook(view, ViewState.InitState_CallingAfterViewInit, initIndex)) {\n provider.ngAfterViewInit();\n }\n if (lifecycles & NodeFlags.AfterViewChecked) {\n provider.ngAfterViewChecked();\n }\n if (lifecycles & NodeFlags.OnDestroy) {\n provider.ngOnDestroy();\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ElementRef} from '../linker/element_ref';\nimport {QueryList} from '../linker/query_list';\n\nimport {NodeDef, NodeFlags, QueryBindingDef, QueryBindingType, QueryDef, QueryValueType, ViewData, asElementData, asProviderData, asQueryList} from './types';\nimport {declaredViewContainer, filterQueryId, isEmbeddedView} from './util';\n\nexport function queryDef(\n flags: NodeFlags, id: number, bindings: {[propName: string]: QueryBindingType}): NodeDef {\n let bindingDefs: QueryBindingDef[] = [];\n for (let propName in bindings) {\n const bindingType = bindings[propName];\n bindingDefs.push({propName, bindingType});\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n // TODO(vicb): check\n checkIndex: -1, flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n ngContentIndex: -1,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: {id, filterId: filterQueryId(id), bindings: bindingDefs},\n ngContent: null\n };\n}\n\nexport function createQuery(): QueryList<any> {\n return new QueryList();\n}\n\nexport function dirtyParentQueries(view: ViewData) {\n const queryIds = view.def.nodeMatchedQueries;\n while (view.parent && isEmbeddedView(view)) {\n let tplDef = view.parentNodeDef !;\n view = view.parent;\n // content queries\n const end = tplDef.nodeIndex + tplDef.childCount;\n for (let i = 0; i <= end; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeContentQuery) &&\n (nodeDef.flags & NodeFlags.DynamicQuery) &&\n (nodeDef.query !.filterId & queryIds) === nodeDef.query !.filterId) {\n asQueryList(view, i).setDirty();\n }\n if ((nodeDef.flags & NodeFlags.TypeElement && i + nodeDef.childCount < tplDef.nodeIndex) ||\n !(nodeDef.childFlags & NodeFlags.TypeContentQuery) ||\n !(nodeDef.childFlags & NodeFlags.DynamicQuery)) {\n // skip elements that don't contain the template element or no query.\n i += nodeDef.childCount;\n }\n }\n }\n\n // view queries\n if (view.def.nodeFlags & NodeFlags.TypeViewQuery) {\n for (let i = 0; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.TypeViewQuery) && (nodeDef.flags & NodeFlags.DynamicQuery)) {\n asQueryList(view, i).setDirty();\n }\n // only visit the root nodes\n i += nodeDef.childCount;\n }\n }\n}\n\nexport function checkAndUpdateQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (!queryList.dirty) {\n return;\n }\n let directiveInstance: any;\n let newValues: any[] = undefined !;\n if (nodeDef.flags & NodeFlags.TypeContentQuery) {\n const elementDef = nodeDef.parent !.parent !;\n newValues = calcQueryValues(\n view, elementDef.nodeIndex, elementDef.nodeIndex + elementDef.childCount, nodeDef.query !,\n []);\n directiveInstance = asProviderData(view, nodeDef.parent !.nodeIndex).instance;\n } else if (nodeDef.flags & NodeFlags.TypeViewQuery) {\n newValues = calcQueryValues(view, 0, view.def.nodes.length - 1, nodeDef.query !, []);\n directiveInstance = view.component;\n }\n queryList.reset(newValues);\n const bindings = nodeDef.query !.bindings;\n let notify = false;\n for (let i = 0; i < bindings.length; i++) {\n const binding = bindings[i];\n let boundValue: any;\n switch (binding.bindingType) {\n case QueryBindingType.First:\n boundValue = queryList.first;\n break;\n case QueryBindingType.All:\n boundValue = queryList;\n notify = true;\n break;\n }\n directiveInstance[binding.propName] = boundValue;\n }\n if (notify) {\n queryList.notifyOnChanges();\n }\n}\n\nfunction calcQueryValues(\n view: ViewData, startIndex: number, endIndex: number, queryDef: QueryDef,\n values: any[]): any[] {\n for (let i = startIndex; i <= endIndex; i++) {\n const nodeDef = view.def.nodes[i];\n const valueType = nodeDef.matchedQueries[queryDef.id];\n if (valueType != null) {\n values.push(getQueryValue(view, nodeDef, valueType));\n }\n if (nodeDef.flags & NodeFlags.TypeElement && nodeDef.element !.template &&\n (nodeDef.element !.template !.nodeMatchedQueries & queryDef.filterId) ===\n queryDef.filterId) {\n const elementData = asElementData(view, i);\n // check embedded views that were attached at the place of their template,\n // but process child nodes first if some match the query (see issue #16568)\n if ((nodeDef.childMatchedQueries & queryDef.filterId) === queryDef.filterId) {\n calcQueryValues(view, i + 1, i + nodeDef.childCount, queryDef, values);\n i += nodeDef.childCount;\n }\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n const embeddedViews = elementData.viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n const embeddedView = embeddedViews[k];\n const dvc = declaredViewContainer(embeddedView);\n if (dvc && dvc === elementData) {\n calcQueryValues(embeddedView, 0, embeddedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n const projectedViews = elementData.template._projectedViews;\n if (projectedViews) {\n for (let k = 0; k < projectedViews.length; k++) {\n const projectedView = projectedViews[k];\n calcQueryValues(projectedView, 0, projectedView.def.nodes.length - 1, queryDef, values);\n }\n }\n }\n if ((nodeDef.childMatchedQueries & queryDef.filterId) !== queryDef.filterId) {\n // if no child matches the query, skip the children.\n i += nodeDef.childCount;\n }\n }\n return values;\n}\n\nexport function getQueryValue(\n view: ViewData, nodeDef: NodeDef, queryValueType: QueryValueType): any {\n if (queryValueType != null) {\n // a match\n switch (queryValueType) {\n case QueryValueType.RenderElement:\n return asElementData(view, nodeDef.nodeIndex).renderElement;\n case QueryValueType.ElementRef:\n return new ElementRef(asElementData(view, nodeDef.nodeIndex).renderElement);\n case QueryValueType.TemplateRef:\n return asElementData(view, nodeDef.nodeIndex).template;\n case QueryValueType.ViewContainerRef:\n return asElementData(view, nodeDef.nodeIndex).viewContainer;\n case QueryValueType.Provider:\n return asProviderData(view, nodeDef.nodeIndex).instance;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NodeDef, NodeFlags, ViewData} from './types';\nimport {RenderNodeAction, getParentRenderElement, visitProjectedRenderNodes} from './util';\n\nexport function ngContentDef(ngContentIndex: null | number, index: number): NodeDef {\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex: -1,\n flags: NodeFlags.TypeNgContent,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0,\n bindings: [],\n bindingFlags: 0,\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: {index}\n };\n}\n\nexport function appendNgContent(view: ViewData, renderHost: any, def: NodeDef) {\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (!parentEl) {\n // Nothing to do if there is no parent element.\n return;\n }\n const ngContentIndex = def.ngContent !.index;\n visitProjectedRenderNodes(\n view, ngContentIndex, RenderNodeAction.AppendChild, parentEl, null, undefined);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, PureExpressionData, ViewData, asPureExpressionData} from './types';\nimport {calcBindingFlags, checkAndUpdateBinding} from './util';\n\nexport function purePipeDef(checkIndex: number, argCount: number): NodeDef {\n // argCount + 1 to include the pipe as first arg\n return _pureExpressionDef(NodeFlags.TypePurePipe, checkIndex, new Array(argCount + 1));\n}\n\nexport function pureArrayDef(checkIndex: number, argCount: number): NodeDef {\n return _pureExpressionDef(NodeFlags.TypePureArray, checkIndex, new Array(argCount));\n}\n\nexport function pureObjectDef(checkIndex: number, propToIndex: {[p: string]: number}): NodeDef {\n const keys = Object.keys(propToIndex);\n const nbKeys = keys.length;\n const propertyNames = new Array(nbKeys);\n for (let i = 0; i < nbKeys; i++) {\n const key = keys[i];\n const index = propToIndex[key];\n propertyNames[index] = key;\n }\n\n return _pureExpressionDef(NodeFlags.TypePureObject, checkIndex, propertyNames);\n}\n\nfunction _pureExpressionDef(\n flags: NodeFlags, checkIndex: number, propertyNames: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(propertyNames.length);\n for (let i = 0; i < propertyNames.length; i++) {\n const prop = propertyNames[i];\n bindings[i] = {\n flags: BindingFlags.TypeProperty,\n name: prop,\n ns: null,\n nonMinifiedName: prop,\n securityContext: null,\n suffix: null\n };\n }\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {},\n ngContentIndex: -1,\n childCount: 0, bindings,\n bindingFlags: calcBindingFlags(bindings),\n outputs: [],\n element: null,\n provider: null,\n text: null,\n query: null,\n ngContent: null\n };\n}\n\nexport function createPureExpression(view: ViewData, def: NodeDef): PureExpressionData {\n return {value: undefined};\n}\n\nexport function checkAndUpdatePureExpressionInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n const bindings = def.bindings;\n let changed = false;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = new Array(bindings.length);\n if (bindLen > 0) value[0] = v0;\n if (bindLen > 1) value[1] = v1;\n if (bindLen > 2) value[2] = v2;\n if (bindLen > 3) value[3] = v3;\n if (bindLen > 4) value[4] = v4;\n if (bindLen > 5) value[5] = v5;\n if (bindLen > 6) value[6] = v6;\n if (bindLen > 7) value[7] = v7;\n if (bindLen > 8) value[8] = v8;\n if (bindLen > 9) value[9] = v9;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n if (bindLen > 0) value[bindings[0].name !] = v0;\n if (bindLen > 1) value[bindings[1].name !] = v1;\n if (bindLen > 2) value[bindings[2].name !] = v2;\n if (bindLen > 3) value[bindings[3].name !] = v3;\n if (bindLen > 4) value[bindings[4].name !] = v4;\n if (bindLen > 5) value[bindings[5].name !] = v5;\n if (bindLen > 6) value[bindings[6].name !] = v6;\n if (bindLen > 7) value[bindings[7].name !] = v7;\n if (bindLen > 8) value[bindings[8].name !] = v8;\n if (bindLen > 9) value[bindings[9].name !] = v9;\n break;\n case NodeFlags.TypePurePipe:\n const pipe = v0;\n switch (bindLen) {\n case 1:\n value = pipe.transform(v0);\n break;\n case 2:\n value = pipe.transform(v1);\n break;\n case 3:\n value = pipe.transform(v1, v2);\n break;\n case 4:\n value = pipe.transform(v1, v2, v3);\n break;\n case 5:\n value = pipe.transform(v1, v2, v3, v4);\n break;\n case 6:\n value = pipe.transform(v1, v2, v3, v4, v5);\n break;\n case 7:\n value = pipe.transform(v1, v2, v3, v4, v5, v6);\n break;\n case 8:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7);\n break;\n case 9:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8);\n break;\n case 10:\n value = pipe.transform(v1, v2, v3, v4, v5, v6, v7, v8, v9);\n break;\n }\n break;\n }\n data.value = value;\n }\n return changed;\n}\n\nexport function checkAndUpdatePureExpressionDynamic(\n view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n const data = asPureExpressionData(view, def.nodeIndex);\n let value: any;\n switch (def.flags & NodeFlags.Types) {\n case NodeFlags.TypePureArray:\n value = values;\n break;\n case NodeFlags.TypePureObject:\n value = {};\n for (let i = 0; i < values.length; i++) {\n value[bindings[i].name !] = values[i];\n }\n break;\n case NodeFlags.TypePurePipe:\n const pipe = values[0];\n const params = values.slice(1);\n value = (<any>pipe.transform)(...params);\n break;\n }\n data.value = value;\n }\n return changed;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {BindingDef, BindingFlags, NodeDef, NodeFlags, TextData, ViewData, asTextData} from './types';\nimport {checkAndUpdateBinding, getParentRenderElement} from './util';\n\nexport function textDef(\n checkIndex: number, ngContentIndex: number | null, staticText: string[]): NodeDef {\n const bindings: BindingDef[] = new Array(staticText.length - 1);\n for (let i = 1; i < staticText.length; i++) {\n bindings[i - 1] = {\n flags: BindingFlags.TypeProperty,\n name: null,\n ns: null,\n nonMinifiedName: null,\n securityContext: null,\n suffix: staticText[i],\n };\n }\n\n return {\n // will bet set by the view definition\n nodeIndex: -1,\n parent: null,\n renderParent: null,\n bindingIndex: -1,\n outputIndex: -1,\n // regular values\n checkIndex,\n flags: NodeFlags.TypeText,\n childFlags: 0,\n directChildFlags: 0,\n childMatchedQueries: 0,\n matchedQueries: {},\n matchedQueryIds: 0,\n references: {}, ngContentIndex,\n childCount: 0, bindings,\n bindingFlags: BindingFlags.TypeProperty,\n outputs: [],\n element: null,\n provider: null,\n text: {prefix: staticText[0]},\n query: null,\n ngContent: null,\n };\n}\n\nexport function createText(view: ViewData, renderHost: any, def: NodeDef): TextData {\n let renderNode: any;\n const renderer = view.renderer;\n renderNode = renderer.createText(def.text !.prefix);\n const parentEl = getParentRenderElement(view, renderHost, def);\n if (parentEl) {\n renderer.appendChild(parentEl, renderNode);\n }\n return {renderText: renderNode};\n}\n\nexport function checkAndUpdateTextInline(\n view: ViewData, def: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): boolean {\n let changed = false;\n const bindings = def.bindings;\n const bindLen = bindings.length;\n if (bindLen > 0 && checkAndUpdateBinding(view, def, 0, v0)) changed = true;\n if (bindLen > 1 && checkAndUpdateBinding(view, def, 1, v1)) changed = true;\n if (bindLen > 2 && checkAndUpdateBinding(view, def, 2, v2)) changed = true;\n if (bindLen > 3 && checkAndUpdateBinding(view, def, 3, v3)) changed = true;\n if (bindLen > 4 && checkAndUpdateBinding(view, def, 4, v4)) changed = true;\n if (bindLen > 5 && checkAndUpdateBinding(view, def, 5, v5)) changed = true;\n if (bindLen > 6 && checkAndUpdateBinding(view, def, 6, v6)) changed = true;\n if (bindLen > 7 && checkAndUpdateBinding(view, def, 7, v7)) changed = true;\n if (bindLen > 8 && checkAndUpdateBinding(view, def, 8, v8)) changed = true;\n if (bindLen > 9 && checkAndUpdateBinding(view, def, 9, v9)) changed = true;\n\n if (changed) {\n let value = def.text !.prefix;\n if (bindLen > 0) value += _addInterpolationPart(v0, bindings[0]);\n if (bindLen > 1) value += _addInterpolationPart(v1, bindings[1]);\n if (bindLen > 2) value += _addInterpolationPart(v2, bindings[2]);\n if (bindLen > 3) value += _addInterpolationPart(v3, bindings[3]);\n if (bindLen > 4) value += _addInterpolationPart(v4, bindings[4]);\n if (bindLen > 5) value += _addInterpolationPart(v5, bindings[5]);\n if (bindLen > 6) value += _addInterpolationPart(v6, bindings[6]);\n if (bindLen > 7) value += _addInterpolationPart(v7, bindings[7]);\n if (bindLen > 8) value += _addInterpolationPart(v8, bindings[8]);\n if (bindLen > 9) value += _addInterpolationPart(v9, bindings[9]);\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nexport function checkAndUpdateTextDynamic(view: ViewData, def: NodeDef, values: any[]): boolean {\n const bindings = def.bindings;\n let changed = false;\n for (let i = 0; i < values.length; i++) {\n // Note: We need to loop over all values, so that\n // the old values are updates as well!\n if (checkAndUpdateBinding(view, def, i, values[i])) {\n changed = true;\n }\n }\n if (changed) {\n let value = '';\n for (let i = 0; i < values.length; i++) {\n value = value + _addInterpolationPart(values[i], bindings[i]);\n }\n value = def.text !.prefix + value;\n const renderNode = asTextData(view, def.nodeIndex).renderText;\n view.renderer.setValue(renderNode, value);\n }\n return changed;\n}\n\nfunction _addInterpolationPart(value: any, binding: BindingDef): string {\n const valueStr = value != null ? value.toString() : '';\n return valueStr + binding.suffix;\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Renderer2} from '../render/api';\n\nimport {checkAndUpdateElementDynamic, checkAndUpdateElementInline, createElement, listenToElementOutputs} from './element';\nimport {expressionChangedAfterItHasBeenCheckedError} from './errors';\nimport {appendNgContent} from './ng_content';\nimport {callLifecycleHooksChildrenFirst, checkAndUpdateDirectiveDynamic, checkAndUpdateDirectiveInline, createDirectiveInstance, createPipeInstance, createProviderInstance} from './provider';\nimport {checkAndUpdatePureExpressionDynamic, checkAndUpdatePureExpressionInline, createPureExpression} from './pure_expression';\nimport {checkAndUpdateQuery, createQuery} from './query';\nimport {createTemplateData, createViewContainerData} from './refs';\nimport {checkAndUpdateTextDynamic, checkAndUpdateTextInline, createText} from './text';\nimport {ArgumentType, CheckType, ElementData, NodeData, NodeDef, NodeFlags, ProviderData, RootData, Services, ViewData, ViewDefinition, ViewFlags, ViewHandleEventFn, ViewState, ViewUpdateFn, asElementData, asQueryList, asTextData, shiftInitState} from './types';\nimport {NOOP, checkBindingNoChanges, isComponentView, markParentViewsForCheckProjectedViews, resolveDefinition, tokenKey} from './util';\nimport {detachProjectedView} from './view_attach';\n\nexport function viewDef(\n flags: ViewFlags, nodes: NodeDef[], updateDirectives?: null | ViewUpdateFn,\n updateRenderer?: null | ViewUpdateFn): ViewDefinition {\n // clone nodes and set auto calculated values\n let viewBindingCount = 0;\n let viewDisposableCount = 0;\n let viewNodeFlags = 0;\n let viewRootNodeFlags = 0;\n let viewMatchedQueries = 0;\n let currentParent: NodeDef|null = null;\n let currentRenderParent: NodeDef|null = null;\n let currentElementHasPublicProviders = false;\n let currentElementHasPrivateProviders = false;\n let lastRenderRootNode: NodeDef|null = null;\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i];\n node.nodeIndex = i;\n node.parent = currentParent;\n node.bindingIndex = viewBindingCount;\n node.outputIndex = viewDisposableCount;\n node.renderParent = currentRenderParent;\n\n viewNodeFlags |= node.flags;\n viewMatchedQueries |= node.matchedQueryIds;\n\n if (node.element) {\n const elDef = node.element;\n elDef.publicProviders =\n currentParent ? currentParent.element !.publicProviders : Object.create(null);\n elDef.allProviders = elDef.publicProviders;\n // Note: We assume that all providers of an element are before any child element!\n currentElementHasPublicProviders = false;\n currentElementHasPrivateProviders = false;\n\n if (node.element.template) {\n viewMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n }\n validateNode(currentParent, node, nodes.length);\n\n\n viewBindingCount += node.bindings.length;\n viewDisposableCount += node.outputs.length;\n\n if (!currentRenderParent && (node.flags & NodeFlags.CatRenderNode)) {\n lastRenderRootNode = node;\n }\n\n if (node.flags & NodeFlags.CatProvider) {\n if (!currentElementHasPublicProviders) {\n currentElementHasPublicProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.publicProviders =\n Object.create(currentParent !.element !.publicProviders);\n currentParent !.element !.allProviders = currentParent !.element !.publicProviders;\n }\n const isPrivateService = (node.flags & NodeFlags.PrivateProvider) !== 0;\n const isComponent = (node.flags & NodeFlags.Component) !== 0;\n if (!isPrivateService || isComponent) {\n currentParent !.element !.publicProviders ![tokenKey(node.provider !.token)] = node;\n } else {\n if (!currentElementHasPrivateProviders) {\n currentElementHasPrivateProviders = true;\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent !.element !.allProviders =\n Object.create(currentParent !.element !.publicProviders);\n }\n currentParent !.element !.allProviders ![tokenKey(node.provider !.token)] = node;\n }\n if (isComponent) {\n currentParent !.element !.componentProvider = node;\n }\n }\n\n if (currentParent) {\n currentParent.childFlags |= node.flags;\n currentParent.directChildFlags |= node.flags;\n currentParent.childMatchedQueries |= node.matchedQueryIds;\n if (node.element && node.element.template) {\n currentParent.childMatchedQueries |= node.element.template.nodeMatchedQueries;\n }\n } else {\n viewRootNodeFlags |= node.flags;\n }\n\n if (node.childCount > 0) {\n currentParent = node;\n\n if (!isNgContainer(node)) {\n currentRenderParent = node;\n }\n } else {\n // When the current node has no children, check if it is the last children of its parent.\n // When it is, propagate the flags up.\n // The loop is required because an element could be the last transitive children of several\n // elements. We loop to either the root or the highest opened element (= with remaining\n // children)\n while (currentParent && i === currentParent.nodeIndex + currentParent.childCount) {\n const newParent: NodeDef|null = currentParent.parent;\n if (newParent) {\n newParent.childFlags |= currentParent.childFlags;\n newParent.childMatchedQueries |= currentParent.childMatchedQueries;\n }\n currentParent = newParent;\n // We also need to update the render parent & account for ng-container\n if (currentParent && isNgContainer(currentParent)) {\n currentRenderParent = currentParent.renderParent;\n } else {\n currentRenderParent = currentParent;\n }\n }\n }\n }\n\n const handleEvent: ViewHandleEventFn = (view, nodeIndex, eventName, event) =>\n nodes[nodeIndex].element !.handleEvent !(view, eventName, event);\n\n return {\n // Will be filled later...\n factory: null,\n nodeFlags: viewNodeFlags,\n rootNodeFlags: viewRootNodeFlags,\n nodeMatchedQueries: viewMatchedQueries, flags,\n nodes: nodes,\n updateDirectives: updateDirectives || NOOP,\n updateRenderer: updateRenderer || NOOP, handleEvent,\n bindingCount: viewBindingCount,\n outputCount: viewDisposableCount, lastRenderRootNode\n };\n}\n\nfunction isNgContainer(node: NodeDef): boolean {\n return (node.flags & NodeFlags.TypeElement) !== 0 && node.element !.name === null;\n}\n\nfunction validateNode(parent: NodeDef | null, node: NodeDef, nodeCount: number) {\n const template = node.element && node.element.template;\n if (template) {\n if (!template.lastRenderRootNode) {\n throw new Error(`Illegal State: Embedded templates without nodes are not allowed!`);\n }\n if (template.lastRenderRootNode &&\n template.lastRenderRootNode.flags & NodeFlags.EmbeddedViews) {\n throw new Error(\n `Illegal State: Last root node of a template can't have embedded views, at index ${node.nodeIndex}!`);\n }\n }\n if (node.flags & NodeFlags.CatProvider) {\n const parentFlags = parent ? parent.flags : 0;\n if ((parentFlags & NodeFlags.TypeElement) === 0) {\n throw new Error(\n `Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index ${node.nodeIndex}!`);\n }\n }\n if (node.query) {\n if (node.flags & NodeFlags.TypeContentQuery &&\n (!parent || (parent.flags & NodeFlags.TypeDirective) === 0)) {\n throw new Error(\n `Illegal State: Content Query nodes need to be children of directives, at index ${node.nodeIndex}!`);\n }\n if (node.flags & NodeFlags.TypeViewQuery && parent) {\n throw new Error(\n `Illegal State: View Query nodes have to be top level nodes, at index ${node.nodeIndex}!`);\n }\n }\n if (node.childCount) {\n const parentEnd = parent ? parent.nodeIndex + parent.childCount : nodeCount - 1;\n if (node.nodeIndex <= parentEnd && node.nodeIndex + node.childCount > parentEnd) {\n throw new Error(\n `Illegal State: childCount of node leads outside of parent, at index ${node.nodeIndex}!`);\n }\n }\n}\n\nexport function createEmbeddedView(\n parent: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n // embedded views are seen as siblings to the anchor, so we need\n // to get the parent of the anchor and use it as parentIndex.\n const view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);\n initView(view, parent.component, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createRootView(root: RootData, def: ViewDefinition, context?: any): ViewData {\n const view = createView(root, root.renderer, null, null, def);\n initView(view, context, context);\n createViewNodes(view);\n return view;\n}\n\nexport function createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const rendererType = nodeDef.element !.componentRendererType;\n let compRenderer: Renderer2;\n if (!rendererType) {\n compRenderer = parentView.root.renderer;\n } else {\n compRenderer = parentView.root.rendererFactory.createRenderer(hostElement, rendererType);\n }\n return createView(\n parentView.root, compRenderer, parentView, nodeDef.element !.componentProvider, viewDef);\n}\n\nfunction createView(\n root: RootData, renderer: Renderer2, parent: ViewData | null, parentNodeDef: NodeDef | null,\n def: ViewDefinition): ViewData {\n const nodes: NodeData[] = new Array(def.nodes.length);\n const disposables = def.outputCount ? new Array(def.outputCount) : null;\n const view: ViewData = {\n def,\n parent,\n viewContainerParent: null, parentNodeDef,\n context: null,\n component: null, nodes,\n state: ViewState.CatInit, root, renderer,\n oldValues: new Array(def.bindingCount), disposables,\n initIndex: -1\n };\n return view;\n}\n\nfunction initView(view: ViewData, component: any, context: any) {\n view.component = component;\n view.context = context;\n}\n\nfunction createViewNodes(view: ViewData) {\n let renderHost: any;\n if (isComponentView(view)) {\n const hostDef = view.parentNodeDef;\n renderHost = asElementData(view.parent !, hostDef !.parent !.nodeIndex).renderElement;\n }\n const def = view.def;\n const nodes = view.nodes;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n Services.setCurrentNode(view, i);\n let nodeData: any;\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n const el = createElement(view, renderHost, nodeDef) as any;\n let componentView: ViewData = undefined !;\n if (nodeDef.flags & NodeFlags.ComponentView) {\n const compViewDef = resolveDefinition(nodeDef.element !.componentView !);\n componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n }\n listenToElementOutputs(view, componentView, nodeDef, el);\n nodeData = <ElementData>{\n renderElement: el,\n componentView,\n viewContainer: null,\n template: nodeDef.element !.template ? createTemplateData(view, nodeDef) : undefined\n };\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n nodeData.viewContainer = createViewContainerData(view, nodeDef, nodeData);\n }\n break;\n case NodeFlags.TypeText:\n nodeData = createText(view, renderHost, nodeDef) as any;\n break;\n case NodeFlags.TypeClassProvider:\n case NodeFlags.TypeFactoryProvider:\n case NodeFlags.TypeUseExistingProvider:\n case NodeFlags.TypeValueProvider: {\n nodeData = nodes[i];\n if (!nodeData && !(nodeDef.flags & NodeFlags.LazyProvider)) {\n const instance = createProviderInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n break;\n }\n case NodeFlags.TypePipe: {\n const instance = createPipeInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n break;\n }\n case NodeFlags.TypeDirective: {\n nodeData = nodes[i];\n if (!nodeData) {\n const instance = createDirectiveInstance(view, nodeDef);\n nodeData = <ProviderData>{instance};\n }\n if (nodeDef.flags & NodeFlags.Component) {\n const compView = asElementData(view, nodeDef.parent !.nodeIndex).componentView;\n initView(compView, nodeData.instance, nodeData.instance);\n }\n break;\n }\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n nodeData = createPureExpression(view, nodeDef) as any;\n break;\n case NodeFlags.TypeContentQuery:\n case NodeFlags.TypeViewQuery:\n nodeData = createQuery() as any;\n break;\n case NodeFlags.TypeNgContent:\n appendNgContent(view, renderHost, nodeDef);\n // no runtime data needed for NgContent...\n nodeData = undefined;\n break;\n }\n nodes[i] = nodeData;\n }\n // Create the ViewData.nodes of component views after we created everything else,\n // so that e.g. ng-content works\n execComponentViewsAction(view, ViewAction.CreateViewNodes);\n\n // fill static content and view queries\n execQueriesAction(\n view, NodeFlags.TypeContentQuery | NodeFlags.TypeViewQuery, NodeFlags.StaticQuery,\n CheckType.CheckAndUpdate);\n}\n\nexport function checkNoChangesView(view: ViewData) {\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckNoChanges);\n execEmbeddedViewsAction(view, ViewAction.CheckNoChanges);\n Services.updateRenderer(view, CheckType.CheckNoChanges);\n execComponentViewsAction(view, ViewAction.CheckNoChanges);\n // Note: We don't check queries for changes as we didn't do this in v2.x.\n // TODO(tbosch): investigate if we can enable the check again in v5.x with a nicer error message.\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n}\n\nexport function checkAndUpdateView(view: ViewData) {\n if (view.state & ViewState.BeforeFirstCheck) {\n view.state &= ~ViewState.BeforeFirstCheck;\n view.state |= ViewState.FirstCheck;\n } else {\n view.state &= ~ViewState.FirstCheck;\n }\n shiftInitState(view, ViewState.InitState_BeforeInit, ViewState.InitState_CallingOnInit);\n markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckAndUpdate);\n execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeContentQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n let callInit = shiftInitState(\n view, ViewState.InitState_CallingOnInit, ViewState.InitState_CallingAfterContentInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterContentChecked | (callInit ? NodeFlags.AfterContentInit : 0));\n\n Services.updateRenderer(view, CheckType.CheckAndUpdate);\n\n execComponentViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeViewQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n callInit = shiftInitState(\n view, ViewState.InitState_CallingAfterContentInit, ViewState.InitState_CallingAfterViewInit);\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterViewChecked | (callInit ? NodeFlags.AfterViewInit : 0));\n\n if (view.def.flags & ViewFlags.OnPush) {\n view.state &= ~ViewState.ChecksEnabled;\n }\n view.state &= ~(ViewState.CheckProjectedViews | ViewState.CheckProjectedView);\n shiftInitState(view, ViewState.InitState_CallingAfterViewInit, ViewState.InitState_AfterInit);\n}\n\nexport function checkAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n if (argStyle === ArgumentType.Inline) {\n return checkAndUpdateNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n return checkAndUpdateNodeDynamic(view, nodeDef, v0);\n }\n}\n\nfunction markProjectedViewsForCheck(view: ViewData) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ProjectedTemplate)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n const projectedViews = asElementData(view, i).template._projectedViews;\n if (projectedViews) {\n for (let i = 0; i < projectedViews.length; i++) {\n const projectedView = projectedViews[i];\n projectedView.state |= ViewState.CheckProjectedView;\n markParentViewsForCheckProjectedViews(projectedView, view);\n }\n }\n } else if ((nodeDef.childFlags & NodeFlags.ProjectedTemplate) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction checkAndUpdateNodeInline(\n view: ViewData, nodeDef: NodeDef, v0?: any, v1?: any, v2?: any, v3?: any, v4?: any, v5?: any,\n v6?: any, v7?: any, v8?: any, v9?: any): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeText:\n return checkAndUpdateTextInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionInline(\n view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n default:\n throw 'unreachable';\n }\n}\n\nfunction checkAndUpdateNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): boolean {\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n return checkAndUpdateElementDynamic(view, nodeDef, values);\n case NodeFlags.TypeText:\n return checkAndUpdateTextDynamic(view, nodeDef, values);\n case NodeFlags.TypeDirective:\n return checkAndUpdateDirectiveDynamic(view, nodeDef, values);\n case NodeFlags.TypePureArray:\n case NodeFlags.TypePureObject:\n case NodeFlags.TypePurePipe:\n return checkAndUpdatePureExpressionDynamic(view, nodeDef, values);\n default:\n throw 'unreachable';\n }\n}\n\nexport function checkNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n if (argStyle === ArgumentType.Inline) {\n checkNoChangesNodeInline(view, nodeDef, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n } else {\n checkNoChangesNodeDynamic(view, nodeDef, v0);\n }\n // Returning false is ok here as we would have thrown in case of a change.\n return false;\n}\n\nfunction checkNoChangesNodeInline(\n view: ViewData, nodeDef: NodeDef, v0: any, v1: any, v2: any, v3: any, v4: any, v5: any, v6: any,\n v7: any, v8: any, v9: any): void {\n const bindLen = nodeDef.bindings.length;\n if (bindLen > 0) checkBindingNoChanges(view, nodeDef, 0, v0);\n if (bindLen > 1) checkBindingNoChanges(view, nodeDef, 1, v1);\n if (bindLen > 2) checkBindingNoChanges(view, nodeDef, 2, v2);\n if (bindLen > 3) checkBindingNoChanges(view, nodeDef, 3, v3);\n if (bindLen > 4) checkBindingNoChanges(view, nodeDef, 4, v4);\n if (bindLen > 5) checkBindingNoChanges(view, nodeDef, 5, v5);\n if (bindLen > 6) checkBindingNoChanges(view, nodeDef, 6, v6);\n if (bindLen > 7) checkBindingNoChanges(view, nodeDef, 7, v7);\n if (bindLen > 8) checkBindingNoChanges(view, nodeDef, 8, v8);\n if (bindLen > 9) checkBindingNoChanges(view, nodeDef, 9, v9);\n}\n\nfunction checkNoChangesNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): void {\n for (let i = 0; i < values.length; i++) {\n checkBindingNoChanges(view, nodeDef, i, values[i]);\n }\n}\n\n/**\n * Workaround https://github.com/angular/tsickle/issues/497\n * @suppress {misplacedTypeAnnotation}\n */\nfunction checkNoChangesQuery(view: ViewData, nodeDef: NodeDef) {\n const queryList = asQueryList(view, nodeDef.nodeIndex);\n if (queryList.dirty) {\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, nodeDef.nodeIndex),\n `Query ${nodeDef.query!.id} not dirty`, `Query ${nodeDef.query!.id} dirty`,\n (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n\nexport function destroyView(view: ViewData) {\n if (view.state & ViewState.Destroyed) {\n return;\n }\n execEmbeddedViewsAction(view, ViewAction.Destroy);\n execComponentViewsAction(view, ViewAction.Destroy);\n callLifecycleHooksChildrenFirst(view, NodeFlags.OnDestroy);\n if (view.disposables) {\n for (let i = 0; i < view.disposables.length; i++) {\n view.disposables[i]();\n }\n }\n detachProjectedView(view);\n if (view.renderer.destroyNode) {\n destroyViewNodes(view);\n }\n if (isComponentView(view)) {\n view.renderer.destroy();\n }\n view.state |= ViewState.Destroyed;\n}\n\nfunction destroyViewNodes(view: ViewData) {\n const len = view.def.nodes.length;\n for (let i = 0; i < len; i++) {\n const def = view.def.nodes[i];\n if (def.flags & NodeFlags.TypeElement) {\n view.renderer.destroyNode !(asElementData(view, i).renderElement);\n } else if (def.flags & NodeFlags.TypeText) {\n view.renderer.destroyNode !(asTextData(view, i).renderText);\n } else if (def.flags & NodeFlags.TypeContentQuery || def.flags & NodeFlags.TypeViewQuery) {\n asQueryList(view, i).destroy();\n }\n }\n}\n\nenum ViewAction {\n CreateViewNodes,\n CheckNoChanges,\n CheckNoChangesProjectedViews,\n CheckAndUpdate,\n CheckAndUpdateProjectedViews,\n Destroy\n}\n\nfunction execComponentViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.ComponentView)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ComponentView) {\n // a leaf\n callViewAction(asElementData(view, i).componentView, action);\n } else if ((nodeDef.childFlags & NodeFlags.ComponentView) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction execEmbeddedViewsAction(view: ViewData, action: ViewAction) {\n const def = view.def;\n if (!(def.nodeFlags & NodeFlags.EmbeddedViews)) {\n return;\n }\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n // a leaf\n const embeddedViews = asElementData(view, i).viewContainer !._embeddedViews;\n for (let k = 0; k < embeddedViews.length; k++) {\n callViewAction(embeddedViews[k], action);\n }\n } else if ((nodeDef.childFlags & NodeFlags.EmbeddedViews) === 0) {\n // a parent with leafs\n // no child is a component,\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n\nfunction callViewAction(view: ViewData, action: ViewAction) {\n const viewState = view.state;\n switch (action) {\n case ViewAction.CheckNoChanges:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckNoChangesProjectedViews);\n }\n }\n break;\n case ViewAction.CheckNoChangesProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkNoChangesView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.CheckAndUpdate:\n if ((viewState & ViewState.Destroyed) === 0) {\n if ((viewState & ViewState.CatDetectChanges) === ViewState.CatDetectChanges) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, ViewAction.CheckAndUpdateProjectedViews);\n }\n }\n break;\n case ViewAction.CheckAndUpdateProjectedViews:\n if ((viewState & ViewState.Destroyed) === 0) {\n if (viewState & ViewState.CheckProjectedView) {\n checkAndUpdateView(view);\n } else if (viewState & ViewState.CheckProjectedViews) {\n execProjectedViewsAction(view, action);\n }\n }\n break;\n case ViewAction.Destroy:\n // Note: destroyView recurses over all views,\n // so we don't need to special case projected views here.\n destroyView(view);\n break;\n case ViewAction.CreateViewNodes:\n createViewNodes(view);\n break;\n }\n}\n\nfunction execProjectedViewsAction(view: ViewData, action: ViewAction) {\n execEmbeddedViewsAction(view, action);\n execComponentViewsAction(view, action);\n}\n\nfunction execQueriesAction(\n view: ViewData, queryFlags: NodeFlags, staticDynamicQueryFlag: NodeFlags,\n checkType: CheckType) {\n if (!(view.def.nodeFlags & queryFlags) || !(view.def.nodeFlags & staticDynamicQueryFlag)) {\n return;\n }\n const nodeCount = view.def.nodes.length;\n for (let i = 0; i < nodeCount; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & queryFlags) && (nodeDef.flags & staticDynamicQueryFlag)) {\n Services.setCurrentNode(view, nodeDef.nodeIndex);\n switch (checkType) {\n case CheckType.CheckAndUpdate:\n checkAndUpdateQuery(view, nodeDef);\n break;\n case CheckType.CheckNoChanges:\n checkNoChangesQuery(view, nodeDef);\n break;\n }\n }\n if (!(nodeDef.childFlags & queryFlags) || !(nodeDef.childFlags & staticDynamicQueryFlag)) {\n // no child has a matching query\n // then skip the children\n i += nodeDef.childCount;\n }\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {DebugElement__PRE_R3__, DebugNode__PRE_R3__, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from '../debug/debug_node';\nimport {Injector} from '../di';\nimport {InjectableDef, getInjectableDef} from '../di/defs';\nimport {InjectableType} from '../di/injectable';\nimport {ErrorHandler} from '../error_handler';\nimport {isDevMode} from '../is_dev_mode';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '../render/api';\nimport {Sanitizer} from '../sanitization/security';\nimport {Type} from '../type';\nimport {normalizeDebugBindingName, normalizeDebugBindingValue} from '../util/ng_reflect';\nimport {isViewDebugError, viewDestroyedError, viewWrappedDebugError} from './errors';\nimport {resolveDep} from './provider';\nimport {dirtyParentQueries, getQueryValue} from './query';\nimport {createInjector, createNgModuleRef, getComponentViewDefinitionFactory} from './refs';\nimport {ArgumentType, BindingFlags, CheckType, DebugContext, ElementData, NgModuleDefinition, NodeDef, NodeFlags, NodeLogger, ProviderOverride, RootData, Services, ViewData, ViewDefinition, ViewState, asElementData, asPureExpressionData} from './types';\nimport {NOOP, isComponentView, renderNode, resolveDefinition, splitDepsDsl, tokenKey, viewParentEl} from './util';\nimport {checkAndUpdateNode, checkAndUpdateView, checkNoChangesNode, checkNoChangesView, createComponentView, createEmbeddedView, createRootView, destroyView} from './view';\n\n\nlet initialized = false;\n\nexport function initServicesIfNeeded() {\n if (initialized) {\n return;\n }\n initialized = true;\n const services = isDevMode() ? createDebugServices() : createProdServices();\n Services.setCurrentNode = services.setCurrentNode;\n Services.createRootView = services.createRootView;\n Services.createEmbeddedView = services.createEmbeddedView;\n Services.createComponentView = services.createComponentView;\n Services.createNgModuleRef = services.createNgModuleRef;\n Services.overrideProvider = services.overrideProvider;\n Services.overrideComponentView = services.overrideComponentView;\n Services.clearOverrides = services.clearOverrides;\n Services.checkAndUpdateView = services.checkAndUpdateView;\n Services.checkNoChangesView = services.checkNoChangesView;\n Services.destroyView = services.destroyView;\n Services.resolveDep = resolveDep;\n Services.createDebugContext = services.createDebugContext;\n Services.handleEvent = services.handleEvent;\n Services.updateDirectives = services.updateDirectives;\n Services.updateRenderer = services.updateRenderer;\n Services.dirtyParentQueries = dirtyParentQueries;\n}\n\nfunction createProdServices() {\n return {\n setCurrentNode: () => {},\n createRootView: createProdRootView,\n createEmbeddedView: createEmbeddedView,\n createComponentView: createComponentView,\n createNgModuleRef: createNgModuleRef,\n overrideProvider: NOOP,\n overrideComponentView: NOOP,\n clearOverrides: NOOP,\n checkAndUpdateView: checkAndUpdateView,\n checkNoChangesView: checkNoChangesView,\n destroyView: destroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: (view: ViewData, nodeIndex: number, eventName: string, event: any) =>\n view.def.handleEvent(view, nodeIndex, eventName, event),\n updateDirectives: (view: ViewData, checkType: CheckType) => view.def.updateDirectives(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n updateRenderer: (view: ViewData, checkType: CheckType) => view.def.updateRenderer(\n checkType === CheckType.CheckAndUpdate ? prodCheckAndUpdateNode :\n prodCheckNoChangesNode,\n view),\n };\n}\n\nfunction createDebugServices() {\n return {\n setCurrentNode: debugSetCurrentNode,\n createRootView: debugCreateRootView,\n createEmbeddedView: debugCreateEmbeddedView,\n createComponentView: debugCreateComponentView,\n createNgModuleRef: debugCreateNgModuleRef,\n overrideProvider: debugOverrideProvider,\n overrideComponentView: debugOverrideComponentView,\n clearOverrides: debugClearOverrides,\n checkAndUpdateView: debugCheckAndUpdateView,\n checkNoChangesView: debugCheckNoChangesView,\n destroyView: debugDestroyView,\n createDebugContext: (view: ViewData, nodeIndex: number) => new DebugContext_(view, nodeIndex),\n handleEvent: debugHandleEvent,\n updateDirectives: debugUpdateDirectives,\n updateRenderer: debugUpdateRenderer,\n };\n}\n\nfunction createProdRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n return createRootView(\n createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode),\n def, context);\n}\n\nfunction debugCreateRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef<any>, context?: any): ViewData {\n const rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n const root = createRootData(\n elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes,\n rootSelectorOrNode);\n const defWithOverride = applyProviderOverridesToView(def);\n return callWithDebugContext(\n DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n}\n\nfunction createRootData(\n elInjector: Injector, ngModule: NgModuleRef<any>, rendererFactory: RendererFactory2,\n projectableNodes: any[][], rootSelectorOrNode: any): RootData {\n const sanitizer = ngModule.injector.get(Sanitizer);\n const errorHandler = ngModule.injector.get(ErrorHandler);\n const renderer = rendererFactory.createRenderer(null, null);\n return {\n ngModule,\n injector: elInjector, projectableNodes,\n selectorOrNode: rootSelectorOrNode, sanitizer, rendererFactory, renderer, errorHandler\n };\n}\n\nfunction debugCreateEmbeddedView(\n parentView: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n const defWithOverride = applyProviderOverridesToView(viewDef);\n return callWithDebugContext(\n DebugAction.create, createEmbeddedView, null,\n [parentView, anchorDef, defWithOverride, context]);\n}\n\nfunction debugCreateComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const overrideComponentView =\n viewDefOverrides.get(nodeDef.element !.componentProvider !.provider !.token);\n if (overrideComponentView) {\n viewDef = overrideComponentView;\n } else {\n viewDef = applyProviderOverridesToView(viewDef);\n }\n return callWithDebugContext(\n DebugAction.create, createComponentView, null, [parentView, nodeDef, viewDef, hostElement]);\n}\n\nfunction debugCreateNgModuleRef(\n moduleType: Type<any>, parentInjector: Injector, bootstrapComponents: Type<any>[],\n def: NgModuleDefinition): NgModuleRef<any> {\n const defWithOverride = applyProviderOverridesToNgModule(def);\n return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n}\n\nconst providerOverrides = new Map<any, ProviderOverride>();\nconst providerOverridesWithScope = new Map<InjectableType<any>, ProviderOverride>();\nconst viewDefOverrides = new Map<any, ViewDefinition>();\n\nfunction debugOverrideProvider(override: ProviderOverride) {\n providerOverrides.set(override.token, override);\n let injectableDef: InjectableDef<any>|null;\n if (typeof override.token === 'function' && (injectableDef = getInjectableDef(override.token)) &&\n typeof injectableDef.providedIn === 'function') {\n providerOverridesWithScope.set(override.token as InjectableType<any>, override);\n }\n}\n\nfunction debugOverrideComponentView(comp: any, compFactory: ComponentFactory<any>) {\n const hostViewDef = resolveDefinition(getComponentViewDefinitionFactory(compFactory));\n const compViewDef = resolveDefinition(hostViewDef.nodes[0].element !.componentView !);\n viewDefOverrides.set(comp, compViewDef);\n}\n\nfunction debugClearOverrides() {\n providerOverrides.clear();\n providerOverridesWithScope.clear();\n viewDefOverrides.clear();\n}\n\n// Notes about the algorithm:\n// 1) Locate the providers of an element and check if one of them was overwritten\n// 2) Change the providers of that element\n//\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToView(def: ViewDefinition): ViewDefinition {\n if (providerOverrides.size === 0) {\n return def;\n }\n const elementIndicesWithOverwrittenProviders = findElementIndicesWithOverwrittenProviders(def);\n if (elementIndicesWithOverwrittenProviders.length === 0) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n for (let i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n }\n return def;\n\n function findElementIndicesWithOverwrittenProviders(def: ViewDefinition): number[] {\n const elIndicesWithOverwrittenProviders: number[] = [];\n let lastElementDef: NodeDef|null = null;\n for (let i = 0; i < def.nodes.length; i++) {\n const nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n lastElementDef = nodeDef;\n }\n if (lastElementDef && nodeDef.flags & NodeFlags.CatProviderNoDirective &&\n providerOverrides.has(nodeDef.provider !.token)) {\n elIndicesWithOverwrittenProviders.push(lastElementDef !.nodeIndex);\n lastElementDef = null;\n }\n }\n return elIndicesWithOverwrittenProviders;\n }\n\n function applyProviderOverridesToElement(viewDef: ViewDefinition, elIndex: number) {\n for (let i = elIndex + 1; i < viewDef.nodes.length; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n // stop at the next element\n return;\n }\n if (nodeDef.flags & NodeFlags.CatProviderNoDirective) {\n const provider = nodeDef.provider !;\n const override = providerOverrides.get(provider.token);\n if (override) {\n nodeDef.flags = (nodeDef.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n }\n }\n}\n\n// Notes about the algorithm:\n// We only create new datastructures if we need to, to keep perf impact\n// reasonable.\nfunction applyProviderOverridesToNgModule(def: NgModuleDefinition): NgModuleDefinition {\n const {hasOverrides, hasDeprecatedOverrides} = calcHasOverrides(def);\n if (!hasOverrides) {\n return def;\n }\n // clone the whole view definition,\n // as it maintains references between the nodes that are hard to update.\n def = def.factory !(() => NOOP);\n applyProviderOverrides(def);\n return def;\n\n function calcHasOverrides(def: NgModuleDefinition):\n {hasOverrides: boolean, hasDeprecatedOverrides: boolean} {\n let hasOverrides = false;\n let hasDeprecatedOverrides = false;\n if (providerOverrides.size === 0) {\n return {hasOverrides, hasDeprecatedOverrides};\n }\n def.providers.forEach(node => {\n const override = providerOverrides.get(node.token);\n if ((node.flags & NodeFlags.CatProviderNoDirective) && override) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n def.modules.forEach(module => {\n providerOverridesWithScope.forEach((override, token) => {\n if (getInjectableDef(token) !.providedIn === module) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n });\n return {hasOverrides, hasDeprecatedOverrides};\n }\n\n function applyProviderOverrides(def: NgModuleDefinition) {\n for (let i = 0; i < def.providers.length; i++) {\n const provider = def.providers[i];\n if (hasDeprecatedOverrides) {\n // We had a bug where me made\n // all providers lazy. Keep this logic behind a flag\n // for migrating existing users.\n provider.flags |= NodeFlags.LazyProvider;\n }\n const override = providerOverrides.get(provider.token);\n if (override) {\n provider.flags = (provider.flags & ~NodeFlags.CatProviderNoDirective) | override.flags;\n provider.deps = splitDepsDsl(override.deps);\n provider.value = override.value;\n }\n }\n if (providerOverridesWithScope.size > 0) {\n let moduleSet = new Set<any>(def.modules);\n providerOverridesWithScope.forEach((override, token) => {\n if (moduleSet.has(getInjectableDef(token) !.providedIn)) {\n let provider = {\n token: token,\n flags:\n override.flags | (hasDeprecatedOverrides ? NodeFlags.LazyProvider : NodeFlags.None),\n deps: splitDepsDsl(override.deps),\n value: override.value,\n index: def.providers.length,\n };\n def.providers.push(provider);\n def.providersByKey[tokenKey(token)] = provider;\n }\n });\n }\n }\n}\n\nfunction prodCheckAndUpdateNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkAndUpdateNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction prodCheckNoChangesNode(\n view: ViewData, checkIndex: number, argStyle: ArgumentType, v0?: any, v1?: any, v2?: any,\n v3?: any, v4?: any, v5?: any, v6?: any, v7?: any, v8?: any, v9?: any): any {\n const nodeDef = view.def.nodes[checkIndex];\n checkNoChangesNode(view, nodeDef, argStyle, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, checkIndex).value :\n undefined;\n}\n\nfunction debugCheckAndUpdateView(view: ViewData) {\n return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n}\n\nfunction debugCheckNoChangesView(view: ViewData) {\n return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n}\n\nfunction debugDestroyView(view: ViewData) {\n return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n}\n\nenum DebugAction {\n create,\n detectChanges,\n checkNoChanges,\n destroy,\n handleEvent\n}\n\nlet _currentAction: DebugAction;\nlet _currentView: ViewData;\nlet _currentNodeIndex: number|null;\n\nfunction debugSetCurrentNode(view: ViewData, nodeIndex: number | null) {\n _currentView = view;\n _currentNodeIndex = nodeIndex;\n}\n\nfunction debugHandleEvent(view: ViewData, nodeIndex: number, eventName: string, event: any) {\n debugSetCurrentNode(view, nodeIndex);\n return callWithDebugContext(\n DebugAction.handleEvent, view.def.handleEvent, null, [view, nodeIndex, eventName, event]);\n}\n\nfunction debugUpdateDirectives(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, 0));\n return view.def.updateDirectives(debugCheckDirectivesFn, view);\n\n function debugCheckDirectivesFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n debugSetCurrentNode(view, nextDirectiveWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugUpdateRenderer(view: ViewData, checkType: CheckType) {\n if (view.state & ViewState.Destroyed) {\n throw viewDestroyedError(DebugAction[_currentAction]);\n }\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, 0));\n return view.def.updateRenderer(debugCheckRenderNodeFn, view);\n\n function debugCheckRenderNodeFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const nodeDef = view.def.nodes[nodeIndex];\n if (checkType === CheckType.CheckAndUpdate) {\n debugCheckAndUpdateNode(view, nodeDef, argStyle, values);\n } else {\n debugCheckNoChangesNode(view, nodeDef, argStyle, values);\n }\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n debugSetCurrentNode(view, nextRenderNodeWithBinding(view, nodeIndex));\n }\n return (nodeDef.flags & NodeFlags.CatPureExpression) ?\n asPureExpressionData(view, nodeDef.nodeIndex).value :\n undefined;\n }\n}\n\nfunction debugCheckAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, givenValues: any[]): void {\n const changed = (<any>checkAndUpdateNode)(view, nodeDef, argStyle, ...givenValues);\n if (changed) {\n const values = argStyle === ArgumentType.Dynamic ? givenValues[0] : givenValues;\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n const bindingValues: {[key: string]: string} = {};\n for (let i = 0; i < nodeDef.bindings.length; i++) {\n const binding = nodeDef.bindings[i];\n const value = values[i];\n if (binding.flags & BindingFlags.TypeProperty) {\n bindingValues[normalizeDebugBindingName(binding.nonMinifiedName !)] =\n normalizeDebugBindingValue(value);\n }\n }\n const elDef = nodeDef.parent !;\n const el = asElementData(view, elDef.nodeIndex).renderElement;\n if (!elDef.element !.name) {\n // a comment.\n view.renderer.setValue(el, `bindings=${JSON.stringify(bindingValues, null, 2)}`);\n } else {\n // a regular element.\n for (let attr in bindingValues) {\n const value = bindingValues[attr];\n if (value != null) {\n view.renderer.setAttribute(el, attr, value);\n } else {\n view.renderer.removeAttribute(el, attr);\n }\n }\n }\n }\n }\n}\n\nfunction debugCheckNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, values: any[]): void {\n (<any>checkNoChangesNode)(view, nodeDef, argStyle, ...values);\n}\n\nfunction nextDirectiveWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeDirective && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nfunction nextRenderNodeWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let i = nodeIndex; i < view.def.nodes.length; i++) {\n const nodeDef = view.def.nodes[i];\n if ((nodeDef.flags & NodeFlags.CatRenderNode) && nodeDef.bindings && nodeDef.bindings.length) {\n return i;\n }\n }\n return null;\n}\n\nclass DebugContext_ implements DebugContext {\n private nodeDef: NodeDef;\n private elView: ViewData;\n private elDef: NodeDef;\n\n constructor(public view: ViewData, public nodeIndex: number|null) {\n if (nodeIndex == null) {\n this.nodeIndex = nodeIndex = 0;\n }\n this.nodeDef = view.def.nodes[nodeIndex];\n let elDef = this.nodeDef;\n let elView = view;\n while (elDef && (elDef.flags & NodeFlags.TypeElement) === 0) {\n elDef = elDef.parent !;\n }\n if (!elDef) {\n while (!elDef && elView) {\n elDef = viewParentEl(elView) !;\n elView = elView.parent !;\n }\n }\n this.elDef = elDef;\n this.elView = elView;\n }\n\n private get elOrCompView() {\n // Has to be done lazily as we use the DebugContext also during creation of elements...\n return asElementData(this.elView, this.elDef.nodeIndex).componentView || this.view;\n }\n\n get injector(): Injector { return createInjector(this.elView, this.elDef); }\n\n get component(): any { return this.elOrCompView.component; }\n\n get context(): any { return this.elOrCompView.context; }\n\n get providerTokens(): any[] {\n const tokens: any[] = [];\n if (this.elDef) {\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n tokens.push(childDef.provider !.token);\n }\n i += childDef.childCount;\n }\n }\n return tokens;\n }\n\n get references(): {[key: string]: any} {\n const references: {[key: string]: any} = {};\n if (this.elDef) {\n collectReferences(this.elView, this.elDef, references);\n\n for (let i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n collectReferences(this.elView, childDef, references);\n }\n i += childDef.childCount;\n }\n }\n return references;\n }\n\n get componentRenderElement() {\n const elData = findHostElement(this.elOrCompView);\n return elData ? elData.renderElement : undefined;\n }\n\n get renderNode(): any {\n return this.nodeDef.flags & NodeFlags.TypeText ? renderNode(this.view, this.nodeDef) :\n renderNode(this.elView, this.elDef);\n }\n\n logError(console: Console, ...values: any[]) {\n let logViewDef: ViewDefinition;\n let logNodeIndex: number;\n if (this.nodeDef.flags & NodeFlags.TypeText) {\n logViewDef = this.view.def;\n logNodeIndex = this.nodeDef.nodeIndex;\n } else {\n logViewDef = this.elView.def;\n logNodeIndex = this.elDef.nodeIndex;\n }\n // Note: we only generate a log function for text and element nodes\n // to make the generated code as small as possible.\n const renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n let currRenderNodeIndex = -1;\n let nodeLogger: NodeLogger = () => {\n currRenderNodeIndex++;\n if (currRenderNodeIndex === renderNodeIndex) {\n return console.error.bind(console, ...values);\n } else {\n return NOOP;\n }\n };\n logViewDef.factory !(nodeLogger);\n if (currRenderNodeIndex < renderNodeIndex) {\n console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n (<any>console.error)(...values);\n }\n }\n}\n\nfunction getRenderNodeIndex(viewDef: ViewDefinition, nodeIndex: number): number {\n let renderNodeIndex = -1;\n for (let i = 0; i <= nodeIndex; i++) {\n const nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n renderNodeIndex++;\n }\n }\n return renderNodeIndex;\n}\n\nfunction findHostElement(view: ViewData): ElementData|null {\n while (view && !isComponentView(view)) {\n view = view.parent !;\n }\n if (view.parent) {\n return asElementData(view.parent, viewParentEl(view) !.nodeIndex);\n }\n return null;\n}\n\nfunction collectReferences(view: ViewData, nodeDef: NodeDef, references: {[key: string]: any}) {\n for (let refName in nodeDef.references) {\n references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n }\n}\n\nfunction callWithDebugContext(action: DebugAction, fn: any, self: any, args: any[]) {\n const oldAction = _currentAction;\n const oldView = _currentView;\n const oldNodeIndex = _currentNodeIndex;\n try {\n _currentAction = action;\n const result = fn.apply(self, args);\n _currentView = oldView;\n _currentNodeIndex = oldNodeIndex;\n _currentAction = oldAction;\n return result;\n } catch (e) {\n if (isViewDebugError(e) || !_currentView) {\n throw e;\n }\n throw viewWrappedDebugError(e, getCurrentDebugContext() !);\n }\n}\n\nexport function getCurrentDebugContext(): DebugContext|null {\n return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n}\n\nexport class DebugRendererFactory2 implements RendererFactory2 {\n constructor(private delegate: RendererFactory2) {}\n\n createRenderer(element: any, renderData: RendererType2|null): Renderer2 {\n return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n }\n\n begin() {\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n end() {\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n\n whenRenderingDone(): Promise<any> {\n if (this.delegate.whenRenderingDone) {\n return this.delegate.whenRenderingDone();\n }\n return Promise.resolve(null);\n }\n}\n\nexport class DebugRenderer2 implements Renderer2 {\n readonly data: {[key: string]: any};\n\n private createDebugContext(nativeElement: any) { return this.debugContextFactory(nativeElement); }\n\n /**\n * Factory function used to create a `DebugContext` when a node is created.\n *\n * The `DebugContext` allows to retrieve information about the nodes that are useful in tests.\n *\n * The factory is configurable so that the `DebugRenderer2` could instantiate either a View Engine\n * or a Render context.\n */\n debugContextFactory: (nativeElement?: any) => DebugContext | null = getCurrentDebugContext;\n\n constructor(private delegate: Renderer2) { this.data = this.delegate.data; }\n\n destroyNode(node: any) {\n removeDebugNodeFromIndex(getDebugNode(node) !);\n if (this.delegate.destroyNode) {\n this.delegate.destroyNode(node);\n }\n }\n\n destroy() { this.delegate.destroy(); }\n\n createElement(name: string, namespace?: string): any {\n const el = this.delegate.createElement(name, namespace);\n const debugCtx = this.createDebugContext(el);\n if (debugCtx) {\n const debugEl = new DebugElement__PRE_R3__(el, null, debugCtx);\n (debugEl as{name: string}).name = name;\n indexDebugNode(debugEl);\n }\n return el;\n }\n\n createComment(value: string): any {\n const comment = this.delegate.createComment(value);\n const debugCtx = this.createDebugContext(comment);\n if (debugCtx) {\n indexDebugNode(new DebugNode__PRE_R3__(comment, null, debugCtx));\n }\n return comment;\n }\n\n createText(value: string): any {\n const text = this.delegate.createText(value);\n const debugCtx = this.createDebugContext(text);\n if (debugCtx) {\n indexDebugNode(new DebugNode__PRE_R3__(text, null, debugCtx));\n }\n return text;\n }\n\n appendChild(parent: any, newChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.addChild(debugChildEl);\n }\n this.delegate.appendChild(parent, newChild);\n }\n\n insertBefore(parent: any, newChild: any, refChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(newChild);\n const debugRefEl = getDebugNode(refChild) !;\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.insertBefore(debugRefEl, debugChildEl);\n }\n\n this.delegate.insertBefore(parent, newChild, refChild);\n }\n\n removeChild(parent: any, oldChild: any): void {\n const debugEl = getDebugNode(parent);\n const debugChildEl = getDebugNode(oldChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.removeChild(debugChildEl);\n }\n this.delegate.removeChild(parent, oldChild);\n }\n\n selectRootElement(selectorOrNode: string|any, preserveContent?: boolean): any {\n const el = this.delegate.selectRootElement(selectorOrNode, preserveContent);\n const debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugElement__PRE_R3__(el, null, debugCtx));\n }\n return el;\n }\n\n setAttribute(el: any, name: string, value: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = value;\n }\n this.delegate.setAttribute(el, name, value, namespace);\n }\n\n removeAttribute(el: any, name: string, namespace?: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n const fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = null;\n }\n this.delegate.removeAttribute(el, name, namespace);\n }\n\n addClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.classes[name] = true;\n }\n this.delegate.addClass(el, name);\n }\n\n removeClass(el: any, name: string): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.classes[name] = false;\n }\n this.delegate.removeClass(el, name);\n }\n\n setStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.styles[style] = value;\n }\n this.delegate.setStyle(el, style, value, flags);\n }\n\n removeStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.styles[style] = null;\n }\n this.delegate.removeStyle(el, style, flags);\n }\n\n setProperty(el: any, name: string, value: any): void {\n const debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement__PRE_R3__) {\n debugEl.properties[name] = value;\n }\n this.delegate.setProperty(el, name, value);\n }\n\n listen(\n target: 'document'|'windows'|'body'|any, eventName: string,\n callback: (event: any) => boolean): () => void {\n if (typeof target !== 'string') {\n const debugEl = getDebugNode(target);\n if (debugEl) {\n debugEl.listeners.push(new EventListener(eventName, callback));\n }\n }\n\n return this.delegate.listen(target, eventName, callback);\n }\n\n parentNode(node: any): any { return this.delegate.parentNode(node); }\n nextSibling(node: any): any { return this.delegate.nextSibling(node); }\n setValue(node: any, value: string): void { return this.delegate.setValue(node, value); }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Injector} from '../di/injector';\nimport {ComponentFactory} from '../linker/component_factory';\nimport {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';\nimport {Type} from '../type';\n\nimport {initServicesIfNeeded} from './services';\nimport {NgModuleDefinition, NgModuleDefinitionFactory, NgModuleProviderDef, ProviderOverride, Services, ViewDefinition} from './types';\nimport {resolveDefinition} from './util';\n\nexport function overrideProvider(override: ProviderOverride) {\n initServicesIfNeeded();\n return Services.overrideProvider(override);\n}\n\nexport function overrideComponentView(comp: Type<any>, componentFactory: ComponentFactory<any>) {\n initServicesIfNeeded();\n return Services.overrideComponentView(comp, componentFactory);\n}\n\nexport function clearOverrides() {\n initServicesIfNeeded();\n return Services.clearOverrides();\n}\n\n// Attention: this function is called as top level function.\n// Putting any logic in here will destroy closure tree shaking!\nexport function createNgModuleFactory(\n ngModuleType: Type<any>, bootstrapComponents: Type<any>[],\n defFactory: NgModuleDefinitionFactory): NgModuleFactory<any> {\n return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n}\n\nfunction cloneNgModuleDefinition(def: NgModuleDefinition): NgModuleDefinition {\n const providers = Array.from(def.providers);\n const modules = Array.from(def.modules);\n const providersByKey: {[tokenKey: string]: NgModuleProviderDef} = {};\n for (const key in def.providersByKey) {\n providersByKey[key] = def.providersByKey[key];\n }\n\n return {\n factory: def.factory,\n isRoot: def.isRoot, providers, modules, providersByKey,\n };\n}\n\nclass NgModuleFactory_ extends NgModuleFactory<any> {\n constructor(\n public readonly moduleType: Type<any>, private _bootstrapComponents: Type<any>[],\n private _ngModuleDefFactory: NgModuleDefinitionFactory) {\n // Attention: this ctor is called as top level function.\n // Putting any logic in here will destroy closure tree shaking!\n super();\n }\n\n create(parentInjector: Injector|null): NgModuleRef<any> {\n initServicesIfNeeded();\n // Clone the NgModuleDefinition so that any tree shakeable provider definition\n // added to this instance of the NgModuleRef doesn't affect the cached copy.\n // See https://github.com/angular/angular/issues/25018.\n const def = cloneNgModuleDefinition(resolveDefinition(this._ngModuleDefFactory));\n return Services.createNgModuleRef(\n this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n }\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {anchorDef, elementDef} from './element';\nexport {clearOverrides, createNgModuleFactory, overrideComponentView, overrideProvider} from './entrypoint';\nexport {ngContentDef} from './ng_content';\nexport {moduleDef, moduleProvideDef} from './ng_module';\nexport {directiveDef, pipeDef, providerDef} from './provider';\nexport {pureArrayDef, pureObjectDef, purePipeDef} from './pure_expression';\nexport {queryDef} from './query';\nexport {ViewRef_, createComponentFactory, getComponentViewDefinitionFactory, nodeValue} from './refs';\nexport {initServicesIfNeeded} from './services';\nexport {textDef} from './text';\nexport {EMPTY_ARRAY, EMPTY_MAP, createRendererType2, elementEventFullName, inlineInterpolate, interpolate, rootRenderNodes, tokenKey, unwrapValue} from './util';\nexport {viewDef} from './view';\nexport {attachEmbeddedView, detachEmbeddedView, moveEmbeddedView} from './view_attach';\n\nexport * from './types';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS} from './application_ref';\nexport {APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER} from './application_tokens';\nexport {defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers} from './change_detection/change_detection';\nexport {devModeEqual as ɵdevModeEqual} from './change_detection/change_detection_util';\nexport {isListLikeIterable as ɵisListLikeIterable} from './change_detection/change_detection_util';\nexport {ChangeDetectorStatus as ɵChangeDetectorStatus, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy} from './change_detection/constants';\nexport {Console as ɵConsole} from './console';\nexport {InjectableDef as ɵInjectableDef, InjectorDef as ɵInjectorDef, getInjectableDef as ɵgetInjectableDef} from './di/defs';\nexport {inject as ɵinject, setCurrentInjector as ɵsetCurrentInjector} from './di/injector_compatibility';\nexport {APP_ROOT as ɵAPP_ROOT} from './di/scope';\nexport {ivyEnabled as ɵivyEnabled} from './ivy_switch';\nexport {ComponentFactory as ɵComponentFactory} from './linker/component_factory';\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {resolveComponentResources as ɵresolveComponentResources} from './metadata/resource_loading';\nexport {ReflectionCapabilities as ɵReflectionCapabilities} from './reflection/reflection_capabilities';\nexport {GetterFn as ɵGetterFn, MethodFn as ɵMethodFn, SetterFn as ɵSetterFn} from './reflection/types';\nexport {DirectRenderer as ɵDirectRenderer, RenderDebugInfo as ɵRenderDebugInfo} from './render/api';\nexport {_sanitizeHtml as ɵ_sanitizeHtml} from './sanitization/html_sanitizer';\nexport {_sanitizeStyle as ɵ_sanitizeStyle} from './sanitization/style_sanitizer';\nexport {_sanitizeUrl as ɵ_sanitizeUrl} from './sanitization/url_sanitizer';\nexport {global as ɵglobal, looseIdentical as ɵlooseIdentical, stringify as ɵstringify} from './util';\nexport {makeDecorator as ɵmakeDecorator} from './util/decorators';\nexport {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang';\nexport {clearOverrides as ɵclearOverrides, initServicesIfNeeded as ɵinitServicesIfNeeded, overrideComponentView as ɵoverrideComponentView, overrideProvider as ɵoverrideProvider} from './view/index';\nexport {NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR} from './view/provider';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// clang-format off\nexport {\n defineBase as ɵdefineBase,\n defineComponent as ɵdefineComponent,\n defineDirective as ɵdefineDirective,\n definePipe as ɵdefinePipe,\n defineNgModule as ɵdefineNgModule,\n detectChanges as ɵdetectChanges,\n renderComponent as ɵrenderComponent,\n AttributeMarker as ɵAttributeMarker,\n ComponentType as ɵComponentType,\n ComponentFactory as ɵRender3ComponentFactory,\n ComponentRef as ɵRender3ComponentRef,\n DirectiveType as ɵDirectiveType,\n RenderFlags as ɵRenderFlags,\n directiveInject as ɵdirectiveInject,\n injectAttribute as ɵinjectAttribute,\n getFactoryOf as ɵgetFactoryOf,\n getInheritedFactory as ɵgetInheritedFactory,\n templateRefExtractor as ɵtemplateRefExtractor,\n ProvidersFeature as ɵProvidersFeature,\n InheritDefinitionFeature as ɵInheritDefinitionFeature,\n NgOnChangesFeature as ɵNgOnChangesFeature,\n LifecycleHooksFeature as ɵLifecycleHooksFeature,\n NgModuleType as ɵNgModuleType,\n NgModuleRef as ɵRender3NgModuleRef,\n CssSelectorList as ɵCssSelectorList,\n markDirty as ɵmarkDirty,\n NgModuleFactory as ɵNgModuleFactory,\n NO_CHANGE as ɵNO_CHANGE,\n container as ɵcontainer,\n nextContext as ɵnextContext,\n elementStart as ɵelementStart,\n namespaceHTML as ɵnamespaceHTML,\n namespaceMathML as ɵnamespaceMathML,\n namespaceSVG as ɵnamespaceSVG,\n element as ɵelement,\n listener as ɵlistener,\n text as ɵtext,\n embeddedViewStart as ɵembeddedViewStart,\n query as ɵquery,\n registerContentQuery as ɵregisterContentQuery,\n projection as ɵprojection,\n bind as ɵbind,\n interpolation1 as ɵinterpolation1,\n interpolation2 as ɵinterpolation2,\n interpolation3 as ɵinterpolation3,\n interpolation4 as ɵinterpolation4,\n interpolation5 as ɵinterpolation5,\n interpolation6 as ɵinterpolation6,\n interpolation7 as ɵinterpolation7,\n interpolation8 as ɵinterpolation8,\n interpolationV as ɵinterpolationV,\n pipeBind1 as ɵpipeBind1,\n pipeBind2 as ɵpipeBind2,\n pipeBind3 as ɵpipeBind3,\n pipeBind4 as ɵpipeBind4,\n pipeBindV as ɵpipeBindV,\n pureFunction0 as ɵpureFunction0,\n pureFunction1 as ɵpureFunction1,\n pureFunction2 as ɵpureFunction2,\n pureFunction3 as ɵpureFunction3,\n pureFunction4 as ɵpureFunction4,\n pureFunction5 as ɵpureFunction5,\n pureFunction6 as ɵpureFunction6,\n pureFunction7 as ɵpureFunction7,\n pureFunction8 as ɵpureFunction8,\n pureFunctionV as ɵpureFunctionV,\n getCurrentView as ɵgetCurrentView,\n getHostElement as ɵgetHostElement,\n restoreView as ɵrestoreView,\n containerRefreshStart as ɵcontainerRefreshStart,\n containerRefreshEnd as ɵcontainerRefreshEnd,\n queryRefresh as ɵqueryRefresh,\n loadQueryList as ɵloadQueryList,\n elementEnd as ɵelementEnd,\n elementProperty as ɵelementProperty,\n componentHostSyntheticProperty as ɵcomponentHostSyntheticProperty,\n projectionDef as ɵprojectionDef,\n reference as ɵreference,\n enableBindings as ɵenableBindings,\n disableBindings as ɵdisableBindings,\n allocHostVars as ɵallocHostVars,\n elementAttribute as ɵelementAttribute,\n elementContainerStart as ɵelementContainerStart,\n elementContainerEnd as ɵelementContainerEnd,\n elementStyling as ɵelementStyling,\n elementHostAttrs as ɵelementHostAttrs,\n elementStylingMap as ɵelementStylingMap,\n elementStyleProp as ɵelementStyleProp,\n elementStylingApply as ɵelementStylingApply,\n elementClassProp as ɵelementClassProp,\n textBinding as ɵtextBinding,\n template as ɵtemplate,\n embeddedViewEnd as ɵembeddedViewEnd,\n store as ɵstore,\n load as ɵload,\n pipe as ɵpipe,\n BaseDef as ɵBaseDef,\n ComponentDef as ɵComponentDef,\n ComponentDefWithMeta as ɵComponentDefWithMeta,\n DirectiveDef as ɵDirectiveDef,\n DirectiveDefWithMeta as ɵDirectiveDefWithMeta,\n PipeDef as ɵPipeDef,\n PipeDefWithMeta as ɵPipeDefWithMeta,\n whenRendered as ɵwhenRendered,\n i18n as ɵi18n,\n i18nAttributes as ɵi18nAttributes,\n i18nExp as ɵi18nExp,\n i18nStart as ɵi18nStart,\n i18nEnd as ɵi18nEnd,\n i18nApply as ɵi18nApply,\n i18nPostprocess as ɵi18nPostprocess,\n setClassMetadata as ɵsetClassMetadata,\n} from './render3/index';\n\n\nexport {\n compileComponent as ɵcompileComponent,\n compileDirective as ɵcompileDirective,\n} from './render3/jit/directive';\nexport {\n compileNgModule as ɵcompileNgModule,\n compileNgModuleDefs as ɵcompileNgModuleDefs,\n patchComponentDefWithScope as ɵpatchComponentDefWithScope,\n resetCompiledComponents as ɵresetCompiledComponents,\n} from './render3/jit/module';\nexport {\n compilePipe as ɵcompilePipe,\n} from './render3/jit/pipe';\n\nexport {\n NgModuleDef as ɵNgModuleDef,\n NgModuleDefWithMeta as ɵNgModuleDefWithMeta,\n NgModuleTransitiveScopes as ɵNgModuleTransitiveScopes,\n} from './metadata/ng_module';\n\nexport {\n sanitizeHtml as ɵsanitizeHtml,\n sanitizeStyle as ɵsanitizeStyle,\n defaultStyleSanitizer as ɵdefaultStyleSanitizer,\n sanitizeScript as ɵsanitizeScript,\n sanitizeUrl as ɵsanitizeUrl,\n sanitizeResourceUrl as ɵsanitizeResourceUrl,\n} from './sanitization/sanitization';\n\nexport {\n bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml,\n bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle,\n bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript,\n bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl,\n bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl,\n} from './sanitization/bypass';\n\nexport {\n getLContext as ɵgetLContext\n} from './render3/context_discovery';\n\nexport {\n Player as ɵPlayer,\n PlayerFactory as ɵPlayerFactory,\n PlayState as ɵPlayState,\n PlayerHandler as ɵPlayerHandler,\n} from './render3/interfaces/player';\n\nexport {\n LContext as ɵLContext,\n} from './render3/interfaces/context';\n\nexport {\n bindPlayerFactory as ɵbindPlayerFactory,\n} from './render3/styling/player_factory';\n\nexport {\n addPlayer as ɵaddPlayer,\n getPlayers as ɵgetPlayers,\n} from './render3/players';\n\n// we reexport these symbols just so that they are retained during the dead code elimination\n// performed by rollup while it's creating fesm files.\n//\n// no code actually imports these symbols from the @angular/core entry point\nexport {\n compileNgModuleFactory__POST_R3__ as ɵcompileNgModuleFactory__POST_R3__\n} from './application_ref';\nexport {\n SWITCH_COMPILE_COMPONENT__POST_R3__ as ɵSWITCH_COMPILE_COMPONENT__POST_R3__,\n SWITCH_COMPILE_DIRECTIVE__POST_R3__ as ɵSWITCH_COMPILE_DIRECTIVE__POST_R3__,\n SWITCH_COMPILE_PIPE__POST_R3__ as ɵSWITCH_COMPILE_PIPE__POST_R3__,\n} from './metadata/directives';\nexport {\n SWITCH_COMPILE_NGMODULE__POST_R3__ as ɵSWITCH_COMPILE_NGMODULE__POST_R3__,\n} from './metadata/ng_module';\nexport {\n getDebugNode__POST_R3__ as ɵgetDebugNode__POST_R3__,\n} from './debug/debug_node';\nexport {\n SWITCH_COMPILE_INJECTABLE__POST_R3__ as ɵSWITCH_COMPILE_INJECTABLE__POST_R3__,\n} from './di/injectable';\nexport {\n SWITCH_IVY_ENABLED__POST_R3__ as ɵSWITCH_IVY_ENABLED__POST_R3__,\n} from './ivy_switch';\nexport {\n SWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__ as ɵSWITCH_CHANGE_DETECTOR_REF_FACTORY__POST_R3__,\n} from './change_detection/change_detector_ref';\nexport {\n Compiler_compileModuleSync__POST_R3__ as ɵCompiler_compileModuleSync__POST_R3__,\n Compiler_compileModuleAsync__POST_R3__ as ɵCompiler_compileModuleAsync__POST_R3__,\n Compiler_compileModuleAndAllComponentsSync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsSync__POST_R3__,\n Compiler_compileModuleAndAllComponentsAsync__POST_R3__ as ɵCompiler_compileModuleAndAllComponentsAsync__POST_R3__,\n} from './linker/compiler';\nexport {\n SWITCH_ELEMENT_REF_FACTORY__POST_R3__ as ɵSWITCH_ELEMENT_REF_FACTORY__POST_R3__,\n} from './linker/element_ref';\nexport {\n SWITCH_TEMPLATE_REF_FACTORY__POST_R3__ as ɵSWITCH_TEMPLATE_REF_FACTORY__POST_R3__,\n} from './linker/template_ref';\nexport {\n SWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__ as ɵSWITCH_VIEW_CONTAINER_REF_FACTORY__POST_R3__,\n} from './linker/view_container_ref';\nexport {\n SWITCH_RENDERER2_FACTORY__POST_R3__ as ɵSWITCH_RENDERER2_FACTORY__POST_R3__,\n} from './render/api';\n\nexport {getModuleFactory__POST_R3__ as ɵgetModuleFactory__POST_R3__} from './linker/ng_module_factory_loader';\n\nexport {\n publishGlobalUtil as ɵpublishGlobalUtil,\n publishDefaultGlobalUtils as ɵpublishDefaultGlobalUtils\n} from './render3/global_utils';\nexport {\n SWITCH_INJECTOR_FACTORY__POST_R3__ as ɵSWITCH_INJECTOR_FACTORY__POST_R3__,\n} from './di/injector';\n\n// clang-format on\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';\nexport {registerModuleFactory as ɵregisterModuleFactory} from './linker/ng_module_factory_loader';\nexport {ArgumentType as ɵArgumentType, BindingFlags as ɵBindingFlags, DepFlags as ɵDepFlags, EMPTY_ARRAY as ɵEMPTY_ARRAY, EMPTY_MAP as ɵEMPTY_MAP, NodeFlags as ɵNodeFlags, QueryBindingType as ɵQueryBindingType, QueryValueType as ɵQueryValueType, ViewDefinition as ɵViewDefinition, ViewFlags as ɵViewFlags, anchorDef as ɵand, createComponentFactory as ɵccf, createNgModuleFactory as ɵcmf, createRendererType2 as ɵcrt, directiveDef as ɵdid, elementDef as ɵeld, elementEventFullName as ɵelementEventFullName, getComponentViewDefinitionFactory as ɵgetComponentViewDefinitionFactory, inlineInterpolate as ɵinlineInterpolate, interpolate as ɵinterpolate, moduleDef as ɵmod, moduleProvideDef as ɵmpd, ngContentDef as ɵncd, nodeValue as ɵnov, pipeDef as ɵpid, providerDef as ɵprd, pureArrayDef as ɵpad, pureObjectDef as ɵpod, purePipeDef as ɵppd, queryDef as ɵqud, textDef as ɵted, unwrapValue as ɵunv, viewDef as ɵvid} from './view/index';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point from which you should import all public core APIs.\n */\nexport * from './metadata';\nexport * from './version';\nexport {TypeDecorator} from './util/decorators';\nexport * from './di';\nexport {createPlatform, assertPlatform, destroyPlatform, getPlatform, PlatformRef, ApplicationRef, createPlatformFactory, NgProbeToken} from './application_ref';\nexport {enableProdMode, isDevMode} from './is_dev_mode';\nexport {APP_ID, PACKAGE_ROOT_URL, PLATFORM_INITIALIZER, PLATFORM_ID, APP_BOOTSTRAP_LISTENER} from './application_tokens';\nexport {APP_INITIALIZER, ApplicationInitStatus} from './application_init';\nexport * from './zone';\nexport * from './render';\nexport * from './linker';\nexport {DebugElement, DebugNode, asNativeElements, getDebugNode, Predicate} from './debug/debug_node';\nexport {GetTestability, Testability, TestabilityRegistry, setTestabilityGetter} from './testability/testability';\nexport * from './change_detection';\nexport * from './platform_core_providers';\nexport {TRANSLATIONS, TRANSLATIONS_FORMAT, LOCALE_ID, MissingTranslationStrategy} from './i18n/tokens';\nexport {ApplicationModule} from './application_module';\nexport {wtfCreateScope, wtfLeave, wtfStartTimeRange, wtfEndTimeRange, WtfScopeFn} from './profile/profile';\nexport {Type} from './type';\nexport {EventEmitter} from './event_emitter';\nexport {ErrorHandler} from './error_handler';\nexport * from './core_private_export';\nexport * from './core_render3_private_export';\nexport {Sanitizer, SecurityContext} from './sanitization/security';\nexport * from './codegen_private_exports';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/core';\n\n// This file only reexports content of the `src` folder. Keep it that way.\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verification. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n\nexport {APPLICATION_MODULE_PROVIDERS as ɵangular_packages_core_core_t,_iterableDiffersFactory as ɵangular_packages_core_core_q,_keyValueDiffersFactory as ɵangular_packages_core_core_r,_localeFactory as ɵangular_packages_core_core_s} from './src/application_module';\nexport {_appIdRandomProviderFactory as ɵangular_packages_core_core_h} from './src/application_tokens';\nexport {DefaultIterableDifferFactory as ɵangular_packages_core_core_o} from './src/change_detection/differs/default_iterable_differ';\nexport {DefaultKeyValueDifferFactory as ɵangular_packages_core_core_p} from './src/change_detection/differs/default_keyvalue_differ';\nexport {DebugElement__PRE_R3__ as ɵangular_packages_core_core_n,DebugNode__PRE_R3__ as ɵangular_packages_core_core_m} from './src/debug/debug_node';\nexport {NullInjector as ɵangular_packages_core_core_c} from './src/di/injector';\nexport {injectInjectorOnly as ɵangular_packages_core_core_d} from './src/di/injector_compatibility';\nexport {ReflectiveInjector_ as ɵangular_packages_core_core_e} from './src/di/reflective_injector';\nexport {ReflectiveDependency as ɵangular_packages_core_core_f,resolveReflectiveProviders as ɵangular_packages_core_core_g} from './src/di/reflective_provider';\nexport {getModuleFactory__PRE_R3__ as ɵangular_packages_core_core_l} from './src/linker/ng_module_factory_loader';\nexport {wtfEnabled as ɵangular_packages_core_core_u} from './src/profile/profile';\nexport {createScope as ɵangular_packages_core_core_w,detectWTF as ɵangular_packages_core_core_v,endTimeRange as ɵangular_packages_core_core_z,leave as ɵangular_packages_core_core_x,startTimeRange as ɵangular_packages_core_core_y} from './src/profile/wtf_impl';\nexport {injectAttributeImpl as ɵangular_packages_core_core_bc} from './src/render3/di';\nexport {NG_INJECTABLE_DEF as ɵangular_packages_core_core_bj} from './src/render3/fields';\nexport {TElementNode as ɵangular_packages_core_core_bg} from './src/render3/interfaces/node';\nexport {PlayerFactoryBuildFn as ɵangular_packages_core_core_bh} from './src/render3/interfaces/player';\nexport {LView as ɵangular_packages_core_core_bl} from './src/render3/interfaces/view';\nexport {getLView as ɵangular_packages_core_core_bd,getPreviousOrParentTNode as ɵangular_packages_core_core_be,nextContextImpl as ɵangular_packages_core_core_bf} from './src/render3/state';\nexport {BoundPlayerFactory as ɵangular_packages_core_core_bi} from './src/render3/styling/player_factory';\nexport {loadInternal as ɵangular_packages_core_core_bm} from './src/render3/util';\nexport {createElementRef as ɵangular_packages_core_core_i,createTemplateRef as ɵangular_packages_core_core_j,createViewRef as ɵangular_packages_core_core_k} from './src/render3/view_engine_compatibility';\nexport {makeParamDecorator as ɵangular_packages_core_core_a,makePropDecorator as ɵangular_packages_core_core_b} from './src/util/decorators';\nexport {getClosureSafeProperty as ɵangular_packages_core_core_bk} from './src/util/property';\nexport {_def as ɵangular_packages_core_core_ba} from './src/view/provider';\nexport {DebugContext as ɵangular_packages_core_core_bb} from './src/view/types';"],"names":["ChangeDetectionStrategy","ChangeDetectorStatus","ViewEncapsulation","stringify","global","InjectFlags","getRootContext","getRootView","initializeStaticStylingContext","updateElementStyleProp","updateElementClassProp","projectionNodeStack","element","isComponentDef","tslib_1.__values","INJECTOR","NULL_INJECTOR","CIRCULAR","EMPTY_ARRAY","isComponent","resolveProvider","tslib_1.__extends","container","viewEngine_NgModuleRef","render3InjectElementRef","RendererStyleFlags2","render3InjectRenderer2","SecurityContext","ComponentFactoryResolver","ComponentFactory","viewEngine_ComponentFactoryResolver","projection","ComponentRef","viewEngine_ElementRef","viewEngine_ComponentFactory","viewEngine_ComponentRef","NgModuleRef","NgModuleFactory","viewEngine_NgModuleFactory","getPipeDef","Subscription","Subject","render3InjectTemplateRef","insertView","removeView","ViewEngine_ElementRef","ViewEngine_TemplateRef","r3.defineBase","r3.defineComponent","r3.defineDirective","r3.defineNgModule","r3.definePipe","r3.directiveInject","r3.getFactoryOf","r3.getInheritedFactory","r3.injectAttribute","r3.templateRefExtractor","r3.NgOnChangesFeature","r3.ProvidersFeature","r3.InheritDefinitionFeature","r3.elementAttribute","r3.bind","r3.container","r3.nextContext","r3.containerRefreshStart","r3.containerRefreshEnd","r3.loadQueryList","r3.namespaceHTML","r3.namespaceMathML","r3.namespaceSVG","r3.enableBindings","r3.disableBindings","r3.allocHostVars","r3.elementStart","r3.elementEnd","r3.element","r3.elementContainerStart","r3.elementContainerEnd","r3.pureFunction0","r3.pureFunction1","r3.pureFunction2","r3.pureFunction3","r3.pureFunction4","r3.pureFunction5","r3.pureFunction6","r3.pureFunction7","r3.pureFunction8","r3.pureFunctionV","r3.getCurrentView","r3.restoreView","r3.interpolation1","r3.interpolation2","r3.interpolation3","r3.interpolation4","r3.interpolation5","r3.interpolation6","r3.interpolation7","r3.interpolation8","r3.interpolationV","r3.elementClassProp","r3.listener","r3.load","r3.projection","r3.elementProperty","r3.componentHostSyntheticProperty","r3.pipeBind1","r3.pipeBind2","r3.pipeBind3","r3.pipeBind4","r3.pipeBindV","r3.projectionDef","r3.pipe","r3.query","r3.queryRefresh","r3.registerContentQuery","r3.reference","r3.elementStyling","r3.elementHostAttrs","r3.elementStylingMap","r3.elementStyleProp","r3.elementStylingApply","r3.template","r3.text","r3.textBinding","r3.embeddedViewStart","r3.embeddedViewEnd","r3.i18n","r3.i18nAttributes","r3.i18nExp","r3.i18nStart","r3.i18nEnd","r3.i18nApply","r3.i18nPostprocess","sanitization.sanitizeHtml","sanitization.sanitizeStyle","sanitization.defaultStyleSanitizer","sanitization.sanitizeResourceUrl","sanitization.sanitizeScript","sanitization.sanitizeUrl","R3NgModuleFactory","flatten","render3CompileComponent","render3CompileDirective","render3CompilePipe","USE_VALUE","render3CompileNgModule","render3CompileInjectable","ResolvedReflectiveFactory","tslib_1.__param","NgModuleFactoryR3","noop","Observable","merge","share","render3InjectViewContainerRef","render3InjectChangeDetectorRef","ViewRef","MissingTranslationStrategy","unwrapValue","_renderCompCount","renderNode","createInjector","RendererV1","InjectorRefTokenKey","INJECTORRefTokenKey","_createProviderInstance","NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR","tokenKey","createQuery","QueryList","anchorDef","viewDef"],"mappings":";;;;;;;;;;;;IAAA;IACA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA;IACA;IACA;IACA;;IAEA,IAAI,aAAa,GAAG,SAAS,CAAC,EAAE,CAAC,EAAE;IACnC,IAAI,aAAa,GAAG,MAAM,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,EAAE,CAAC;IACpF,QAAQ,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnF,IAAI,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/B,CAAC,CAAC;;AAEF,IAAO,SAAS,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE;IAChC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACxB,IAAI,SAAS,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,EAAE;IAC3C,IAAI,CAAC,CAAC,SAAS,GAAG,CAAC,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzF,CAAC;;AAED,IAAO,IAAI,QAAQ,GAAG,WAAW;IACjC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,QAAQ,CAAC,CAAC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