{"version":3,"file":"core.umd.min.js","sources":["../../../../packages/core/src/view/services.ts","../../../../packages/core/src/view/entrypoint.ts","../../../../packages/core/src/view/refs.ts","../../../../packages/core/src/view/view.ts","../../../../packages/core/src/linker/view_container_ref.ts","../../../../packages/core/src/debug/debug_node.ts","../../../../packages/core/src/change_detection/change_detection_util.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/i18n/tokens.ts","../../../../packages/core/src/application_module.ts","../../../../packages/core/src/security.ts","../../../../packages/core/src/view/types.ts","../../../../packages/core/src/view/errors.ts","../../../../packages/core/src/view/util.ts","../../../../packages/core/src/render/api.ts","../../../../packages/core/src/linker/query_list.ts","../../../../packages/core/src/linker/system_js_ng_module_factory_loader.ts","../../../../packages/core/src/linker/compiler.ts","../../../../packages/core/src/profile/wtf_impl.ts","../../../../packages/core/src/linker/component_factory_resolver.ts","../../../../packages/core/src/event_emitter.ts","../../../../packages/core/src/zone/ng_zone.ts","../../../../packages/core/src/testability/testability.ts","../../../../packages/core/src/application_ref.ts","../../../../packages/core/src/console.ts","../../../../packages/core/src/error_handler.ts","../../../../packages/core/src/di/reflective_key.ts","../../../../packages/core/src/reflection/reflection_capabilities.ts","../../../../packages/core/src/reflection/reflector.ts","../../../../packages/core/src/di/reflective_provider.ts","../../../../packages/core/src/di/reflective_injector.ts","../../../../packages/core/src/application_init.ts","../../../../packages/core/src/metadata/view.ts","../../../../packages/core/src/metadata.ts","../../../../packages/core/src/version.ts","../../../../node_modules/tslib/tslib.es6.js","../../../../packages/core/src/di/injection_token.ts","../../../../packages/core/src/util.ts","../../../../packages/core/src/util/decorators.ts","../../../../packages/core/src/change_detection/constants.ts","../../../../packages/core/src/metadata/directives.ts","../../../../packages/core/src/view/text.ts","../../../../packages/core/src/view/pure_expression.ts","../../../../packages/core/src/view/ng_content.ts","../../../../packages/core/src/view/query.ts","../../../../packages/core/src/view/view_attach.ts","../../../../packages/core/src/view/provider.ts","../../../../packages/core/src/view/element.ts","../../../../packages/core/src/view/ng_module.ts","../../../../packages/core/src/platform_core_providers.ts","../../../../packages/core/src/linker/ng_module_factory_loader.ts","../../../../packages/core/src/di/reflective_errors.ts","../../../../packages/core/src/di/injector.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source 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 {isDevMode} from '../application_ref';\nimport {DebugElement, DebugNode, EventListener, getDebugNode, indexDebugNode, removeDebugNodeFromIndex} from '../debug/debug_node';\nimport {Injector} from '../di';\nimport {ErrorHandler} from '../error_handler';\nimport {NgModuleRef} from '../linker/ng_module_factory';\nimport {Renderer2, RendererFactory2, RendererStyleFlags2, RendererType2} from '../render/api';\nimport {Sanitizer} from '../security';\nimport {Type} from '../type';\n\nimport {isViewDebugError, viewDestroyedError, viewWrappedDebugError} from './errors';\nimport {resolveDep} from './provider';\nimport {dirtyParentQueries, getQueryValue} from './query';\nimport {createInjector, createNgModuleRef} from './refs';\nimport {ArgumentType, BindingFlags, CheckType, DebugContext, DepDef, ElementData, NgModuleDefinition, NgModuleProviderDef, NodeDef, NodeFlags, NodeLogger, ProviderOverride, RootData, Services, ViewData, ViewDefinition, ViewState, asElementData, asPureExpressionData} from './types';\nimport {NOOP, isComponentView, renderNode, splitDepsDsl, viewParentEl} from './util';\nimport {checkAndUpdateNode, checkAndUpdateView, checkNoChangesNode, checkNoChangesView, createComponentView, createEmbeddedView, createRootView, destroyView} from './view';\n\n\nlet /** @type {?} */ initialized = false;\n/**\n * @return {?}\n */\nexport function initServicesIfNeeded() {\n if (initialized) {\n return;\n }\n initialized = true;\n const /** @type {?} */ 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.clearProviderOverrides = services.clearProviderOverrides;\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/**\n * @return {?}\n */\nfunction createProdServices() {\n return {\n setCurrentNode: () => {},\n createRootView: createProdRootView,\n createEmbeddedView: createEmbeddedView,\n createComponentView: createComponentView,\n createNgModuleRef: createNgModuleRef,\n overrideProvider: NOOP,\n clearProviderOverrides: 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/**\n * @return {?}\n */\nfunction createDebugServices() {\n return {\n setCurrentNode: debugSetCurrentNode,\n createRootView: debugCreateRootView,\n createEmbeddedView: debugCreateEmbeddedView,\n createComponentView: debugCreateComponentView,\n createNgModuleRef: debugCreateNgModuleRef,\n overrideProvider: debugOverrideProvider,\n clearProviderOverrides: debugClearProviderOverrides,\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/**\n * @param {?} elInjector\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @param {?} def\n * @param {?} ngModule\n * @param {?=} context\n * @return {?}\n */\nfunction createProdRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef, context?: any): ViewData {\n const /** @type {?} */ rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n return createRootView(\n createRootData(elInjector, ngModule, rendererFactory, projectableNodes, rootSelectorOrNode),\n def, context);\n}\n/**\n * @param {?} elInjector\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @param {?} def\n * @param {?} ngModule\n * @param {?=} context\n * @return {?}\n */\nfunction debugCreateRootView(\n elInjector: Injector, projectableNodes: any[][], rootSelectorOrNode: string | any,\n def: ViewDefinition, ngModule: NgModuleRef, context?: any): ViewData {\n const /** @type {?} */ rendererFactory: RendererFactory2 = ngModule.injector.get(RendererFactory2);\n const /** @type {?} */ root = createRootData(\n elInjector, ngModule, new DebugRendererFactory2(rendererFactory), projectableNodes,\n rootSelectorOrNode);\n const /** @type {?} */ defWithOverride = applyProviderOverridesToView(def);\n return callWithDebugContext(\n DebugAction.create, createRootView, null, [root, defWithOverride, context]);\n}\n/**\n * @param {?} elInjector\n * @param {?} ngModule\n * @param {?} rendererFactory\n * @param {?} projectableNodes\n * @param {?} rootSelectorOrNode\n * @return {?}\n */\nfunction createRootData(\n elInjector: Injector, ngModule: NgModuleRef, rendererFactory: RendererFactory2,\n projectableNodes: any[][], rootSelectorOrNode: any): RootData {\n const /** @type {?} */ sanitizer = ngModule.injector.get(Sanitizer);\n const /** @type {?} */ errorHandler = ngModule.injector.get(ErrorHandler);\n const /** @type {?} */ renderer = rendererFactory.createRenderer(null, null);\n return {\n ngModule,\n injector: elInjector, projectableNodes,\n selectorOrNode: rootSelectorOrNode, sanitizer, rendererFactory, renderer, errorHandler\n };\n}\n/**\n * @param {?} parentView\n * @param {?} anchorDef\n * @param {?} viewDef\n * @param {?=} context\n * @return {?}\n */\nfunction debugCreateEmbeddedView(\n parentView: ViewData, anchorDef: NodeDef, viewDef: ViewDefinition, context?: any): ViewData {\n const /** @type {?} */ defWithOverride = applyProviderOverridesToView(viewDef);\n return callWithDebugContext(\n DebugAction.create, createEmbeddedView, null,\n [parentView, anchorDef, defWithOverride, context]);\n}\n/**\n * @param {?} parentView\n * @param {?} nodeDef\n * @param {?} viewDef\n * @param {?} hostElement\n * @return {?}\n */\nfunction debugCreateComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const /** @type {?} */ defWithOverride = applyProviderOverridesToView(viewDef);\n return callWithDebugContext(\n DebugAction.create, createComponentView, null,\n [parentView, nodeDef, defWithOverride, hostElement]);\n}\n/**\n * @param {?} moduleType\n * @param {?} parentInjector\n * @param {?} bootstrapComponents\n * @param {?} def\n * @return {?}\n */\nfunction debugCreateNgModuleRef(\n moduleType: Type, parentInjector: Injector, bootstrapComponents: Type[],\n def: NgModuleDefinition): NgModuleRef {\n const /** @type {?} */ defWithOverride = applyProviderOverridesToNgModule(def);\n return createNgModuleRef(moduleType, parentInjector, bootstrapComponents, defWithOverride);\n}\n\nconst /** @type {?} */ providerOverrides = new Map();\n/**\n * @param {?} override\n * @return {?}\n */\nfunction debugOverrideProvider(override: ProviderOverride) {\n providerOverrides.set(override.token, override);\n}\n/**\n * @return {?}\n */\nfunction debugClearProviderOverrides() {\n providerOverrides.clear();\n}\n/**\n * @param {?} def\n * @return {?}\n */\nfunction applyProviderOverridesToView(def: ViewDefinition): ViewDefinition {\n if (providerOverrides.size === 0) {\n return def;\n }\n const /** @type {?} */ 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 = /** @type {?} */(( def.factory))(() => NOOP);\n for (let /** @type {?} */ i = 0; i < elementIndicesWithOverwrittenProviders.length; i++) {\n applyProviderOverridesToElement(def, elementIndicesWithOverwrittenProviders[i]);\n }\n return def;\n/**\n * @param {?} def\n * @return {?}\n */\nfunction findElementIndicesWithOverwrittenProviders(def: ViewDefinition): number[] {\n const /** @type {?} */ elIndicesWithOverwrittenProviders: number[] = [];\n let /** @type {?} */ lastElementDef: NodeDef|null = null;\n for (let /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n const /** @type {?} */ nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.TypeElement) {\n lastElementDef = nodeDef;\n }\n if (lastElementDef && nodeDef.flags & NodeFlags.CatProviderNoDirective &&\n providerOverrides.has( /** @type {?} */((nodeDef.provider)).token)) {\n elIndicesWithOverwrittenProviders.push( /** @type {?} */((lastElementDef)).nodeIndex);\n lastElementDef = null;\n }\n }\n return elIndicesWithOverwrittenProviders;\n }\n/**\n * @param {?} viewDef\n * @param {?} elIndex\n * @return {?}\n */\nfunction applyProviderOverridesToElement(viewDef: ViewDefinition, elIndex: number) {\n for (let /** @type {?} */ i = elIndex + 1; i < viewDef.nodes.length; i++) {\n const /** @type {?} */ 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 /** @type {?} */ provider = /** @type {?} */(( nodeDef.provider));\n const /** @type {?} */ 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 * @param {?} def\n * @return {?}\n */\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 = /** @type {?} */(( def.factory))(() => NOOP);\n applyProviderOverrides(def);\n return def;\n/**\n * @param {?} def\n * @return {?}\n */\nfunction calcHasOverrides(def: NgModuleDefinition):\n {hasOverrides: boolean, hasDeprecatedOverrides: boolean} {\n let /** @type {?} */ hasOverrides = false;\n let /** @type {?} */ hasDeprecatedOverrides = false;\n if (providerOverrides.size === 0) {\n return {hasOverrides, hasDeprecatedOverrides};\n }\n def.providers.forEach(node => {\n const /** @type {?} */ override = providerOverrides.get(node.token);\n if ((node.flags & NodeFlags.CatProviderNoDirective) && override) {\n hasOverrides = true;\n hasDeprecatedOverrides = hasDeprecatedOverrides || override.deprecatedBehavior;\n }\n });\n return {hasOverrides, hasDeprecatedOverrides};\n }\n/**\n * @param {?} def\n * @return {?}\n */\nfunction applyProviderOverrides(def: NgModuleDefinition) {\n for (let /** @type {?} */ i = 0; i < def.providers.length; i++) {\n const /** @type {?} */ 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 /** @type {?} */ 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 }\n}\n/**\n * @param {?} view\n * @param {?} checkIndex\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\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 /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} checkIndex\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\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 /** @type {?} */ 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/**\n * @param {?} view\n * @return {?}\n */\nfunction debugCheckAndUpdateView(view: ViewData) {\n return callWithDebugContext(DebugAction.detectChanges, checkAndUpdateView, null, [view]);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction debugCheckNoChangesView(view: ViewData) {\n return callWithDebugContext(DebugAction.checkNoChanges, checkNoChangesView, null, [view]);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction debugDestroyView(view: ViewData) {\n return callWithDebugContext(DebugAction.destroy, destroyView, null, [view]);\n}\ntype DebugAction = number;\nlet DebugAction: any = {};\nDebugAction.create = 0;\nDebugAction.detectChanges = 1;\nDebugAction.checkNoChanges = 2;\nDebugAction.destroy = 3;\nDebugAction.handleEvent = 4;\nDebugAction[DebugAction.create] = \"create\";\nDebugAction[DebugAction.detectChanges] = \"detectChanges\";\nDebugAction[DebugAction.checkNoChanges] = \"checkNoChanges\";\nDebugAction[DebugAction.destroy] = \"destroy\";\nDebugAction[DebugAction.handleEvent] = \"handleEvent\";\n\n\nlet /** @type {?} */ _currentAction: DebugAction;\nlet /** @type {?} */ _currentView: ViewData;\nlet /** @type {?} */ _currentNodeIndex: number|null;\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction debugSetCurrentNode(view: ViewData, nodeIndex: number | null) {\n _currentView = view;\n _currentNodeIndex = nodeIndex;\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} eventName\n * @param {?} event\n * @return {?}\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/**\n * @param {?} view\n * @param {?} checkType\n * @return {?}\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 * @param {?} view\n * @param {?} nodeIndex\n * @param {?} argStyle\n * @param {...?} values\n * @return {?}\n */\nfunction debugCheckDirectivesFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} checkType\n * @return {?}\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 * @param {?} view\n * @param {?} nodeIndex\n * @param {?} argStyle\n * @param {...?} values\n * @return {?}\n */\nfunction debugCheckRenderNodeFn(\n view: ViewData, nodeIndex: number, argStyle: ArgumentType, ...values: any[]) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?} givenValues\n * @return {?}\n */\nfunction debugCheckAndUpdateNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, givenValues: any[]): void {\n const /** @type {?} */ changed = ( /** @type {?} */((checkAndUpdateNode)))(view, nodeDef, argStyle, ...givenValues);\n if (changed) {\n const /** @type {?} */ values = argStyle === ArgumentType.Dynamic ? givenValues[0] : givenValues;\n if (nodeDef.flags & NodeFlags.TypeDirective) {\n const /** @type {?} */ bindingValues: {[key: string]: string} = {};\n for (let /** @type {?} */ i = 0; i < nodeDef.bindings.length; i++) {\n const /** @type {?} */ binding = nodeDef.bindings[i];\n const /** @type {?} */ value = values[i];\n if (binding.flags & BindingFlags.TypeProperty) {\n bindingValues[normalizeDebugBindingName( /** @type {?} */((binding.nonMinifiedName)))] =\n normalizeDebugBindingValue(value);\n }\n }\n const /** @type {?} */ elDef = /** @type {?} */(( nodeDef.parent));\n const /** @type {?} */ el = asElementData(view, elDef.nodeIndex).renderElement;\n if (! /** @type {?} */((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 /** @type {?} */ attr in bindingValues) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?} values\n * @return {?}\n */\nfunction debugCheckNoChangesNode(\n view: ViewData, nodeDef: NodeDef, argStyle: ArgumentType, values: any[]): void {\n ( /** @type {?} */((checkNoChangesNode)))(view, nodeDef, argStyle, ...values);\n}\n/**\n * @param {?} name\n * @return {?}\n */\nfunction 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 /** @type {?} */ CAMEL_CASE_REGEXP = /([A-Z])/g;\n/**\n * @param {?} input\n * @return {?}\n */\nfunction camelCaseToDashCase(input: string): string {\n return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());\n}\n/**\n * @param {?} value\n * @return {?}\n */\nfunction 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 ( /** @type {?} */e) {\n return '[ERROR] Exception while trying to serialize the value';\n }\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction nextDirectiveWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction nextRenderNodeWithBinding(view: ViewData, nodeIndex: number): number|null {\n for (let /** @type {?} */ i = nodeIndex; i < view.def.nodes.length; i++) {\n const /** @type {?} */ 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}\nclass DebugContext_ implements DebugContext {\nprivate nodeDef: NodeDef;\nprivate elView: ViewData;\nprivate elDef: NodeDef;\n/**\n * @param {?} view\n * @param {?} nodeIndex\n */\nconstructor(public view: ViewData,\npublic 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 * @return {?}\n */\nprivate 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 * @return {?}\n */\nget injector(): Injector { return createInjector(this.elView, this.elDef); }\n/**\n * @return {?}\n */\nget component(): any { return this.elOrCompView.component; }\n/**\n * @return {?}\n */\nget context(): any { return this.elOrCompView.context; }\n/**\n * @return {?}\n */\nget providerTokens(): any[] {\n const /** @type {?} */ tokens: any[] = [];\n if (this.elDef) {\n for (let /** @type {?} */ i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const /** @type {?} */ childDef = this.elView.def.nodes[i];\n if (childDef.flags & NodeFlags.CatProvider) {\n tokens.push( /** @type {?} */((childDef.provider)).token);\n }\n i += childDef.childCount;\n }\n }\n return tokens;\n }\n/**\n * @return {?}\n */\nget references(): {[key: string]: any} {\n const /** @type {?} */ references: {[key: string]: any} = {};\n if (this.elDef) {\n collectReferences(this.elView, this.elDef, references);\n\n for (let /** @type {?} */ i = this.elDef.nodeIndex + 1; i <= this.elDef.nodeIndex + this.elDef.childCount;\n i++) {\n const /** @type {?} */ 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 * @return {?}\n */\nget componentRenderElement() {\n const /** @type {?} */ elData = findHostElement(this.elOrCompView);\n return elData ? elData.renderElement : undefined;\n }\n/**\n * @return {?}\n */\nget renderNode(): any {\n return this.nodeDef.flags & NodeFlags.TypeText ? renderNode(this.view, this.nodeDef) :\n renderNode(this.elView, this.elDef);\n }\n/**\n * @param {?} console\n * @param {...?} values\n * @return {?}\n */\nlogError(console: Console, ...values: any[]) {\n let /** @type {?} */ logViewDef: ViewDefinition;\n let /** @type {?} */ 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 /** @type {?} */ renderNodeIndex = getRenderNodeIndex(logViewDef, logNodeIndex);\n let /** @type {?} */ currRenderNodeIndex = -1;\n let /** @type {?} */ nodeLogger: NodeLogger = () => {\n currRenderNodeIndex++;\n if (currRenderNodeIndex === renderNodeIndex) {\n return console.error.bind(console, ...values);\n } else {\n return NOOP;\n }\n }; /** @type {?} */((\n logViewDef.factory))(nodeLogger);\n if (currRenderNodeIndex < renderNodeIndex) {\n console.error('Illegal state: the ViewDefinitionFactory did not call the logger!');\n ( /** @type {?} */((console.error)))(...values);\n }\n }\n}\n\nfunction DebugContext__tsickle_Closure_declarations() {\n/** @type {?} */\nDebugContext_.prototype.nodeDef;\n/** @type {?} */\nDebugContext_.prototype.elView;\n/** @type {?} */\nDebugContext_.prototype.elDef;\n/** @type {?} */\nDebugContext_.prototype.view;\n/** @type {?} */\nDebugContext_.prototype.nodeIndex;\n}\n\n/**\n * @param {?} viewDef\n * @param {?} nodeIndex\n * @return {?}\n */\nfunction getRenderNodeIndex(viewDef: ViewDefinition, nodeIndex: number): number {\n let /** @type {?} */ renderNodeIndex = -1;\n for (let /** @type {?} */ i = 0; i <= nodeIndex; i++) {\n const /** @type {?} */ nodeDef = viewDef.nodes[i];\n if (nodeDef.flags & NodeFlags.CatRenderNode) {\n renderNodeIndex++;\n }\n }\n return renderNodeIndex;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction findHostElement(view: ViewData): ElementData|null {\n while (view && !isComponentView(view)) {\n view = /** @type {?} */(( view.parent));\n }\n if (view.parent) {\n return asElementData(view.parent, /** @type {?} */(( viewParentEl(view))).nodeIndex);\n }\n return null;\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} references\n * @return {?}\n */\nfunction collectReferences(view: ViewData, nodeDef: NodeDef, references: {[key: string]: any}) {\n for (let /** @type {?} */ refName in nodeDef.references) {\n references[refName] = getQueryValue(view, nodeDef, nodeDef.references[refName]);\n }\n}\n/**\n * @param {?} action\n * @param {?} fn\n * @param {?} self\n * @param {?} args\n * @return {?}\n */\nfunction callWithDebugContext(action: DebugAction, fn: any, self: any, args: any[]) {\n const /** @type {?} */ oldAction = _currentAction;\n const /** @type {?} */ oldView = _currentView;\n const /** @type {?} */ oldNodeIndex = _currentNodeIndex;\n try {\n _currentAction = action;\n const /** @type {?} */ result = fn.apply(self, args);\n _currentView = oldView;\n _currentNodeIndex = oldNodeIndex;\n _currentAction = oldAction;\n return result;\n } catch ( /** @type {?} */e) {\n if (isViewDebugError(e) || !_currentView) {\n throw e;\n }\n throw viewWrappedDebugError(e, /** @type {?} */(( getCurrentDebugContext())));\n }\n}\n/**\n * @return {?}\n */\nexport function getCurrentDebugContext(): DebugContext|null {\n return _currentView ? new DebugContext_(_currentView, _currentNodeIndex) : null;\n}\nclass DebugRendererFactory2 implements RendererFactory2 {\n/**\n * @param {?} delegate\n */\nconstructor(private delegate: RendererFactory2) {}\n/**\n * @param {?} element\n * @param {?} renderData\n * @return {?}\n */\ncreateRenderer(element: any, renderData: RendererType2|null): Renderer2 {\n return new DebugRenderer2(this.delegate.createRenderer(element, renderData));\n }\n/**\n * @return {?}\n */\nbegin() {\n if (this.delegate.begin) {\n this.delegate.begin();\n }\n }\n/**\n * @return {?}\n */\nend() {\n if (this.delegate.end) {\n this.delegate.end();\n }\n }\n/**\n * @return {?}\n */\nwhenRenderingDone(): Promise {\n if (this.delegate.whenRenderingDone) {\n return this.delegate.whenRenderingDone();\n }\n return Promise.resolve(null);\n }\n}\n\nfunction DebugRendererFactory2_tsickle_Closure_declarations() {\n/** @type {?} */\nDebugRendererFactory2.prototype.delegate;\n}\n\nclass DebugRenderer2 implements Renderer2 {\n/**\n * @param {?} delegate\n */\nconstructor(private delegate: Renderer2) {}\n/**\n * @return {?}\n */\nget data() { return this.delegate.data; }\n/**\n * @param {?} node\n * @return {?}\n */\ndestroyNode(node: any) {\n removeDebugNodeFromIndex( /** @type {?} */((getDebugNode(node))));\n if (this.delegate.destroyNode) {\n this.delegate.destroyNode(node);\n }\n }\n/**\n * @return {?}\n */\ndestroy() { this.delegate.destroy(); }\n/**\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\ncreateElement(name: string, namespace?: string): any {\n const /** @type {?} */ el = this.delegate.createElement(name, namespace);\n const /** @type {?} */ debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n const /** @type {?} */ debugEl = new DebugElement(el, null, debugCtx);\n debugEl.name = name;\n indexDebugNode(debugEl);\n }\n return el;\n }\n/**\n * @param {?} value\n * @return {?}\n */\ncreateComment(value: string): any {\n const /** @type {?} */ comment = this.delegate.createComment(value);\n const /** @type {?} */ debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugNode(comment, null, debugCtx));\n }\n return comment;\n }\n/**\n * @param {?} value\n * @return {?}\n */\ncreateText(value: string): any {\n const /** @type {?} */ text = this.delegate.createText(value);\n const /** @type {?} */ debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugNode(text, null, debugCtx));\n }\n return text;\n }\n/**\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\nappendChild(parent: any, newChild: any): void {\n const /** @type {?} */ debugEl = getDebugNode(parent);\n const /** @type {?} */ debugChildEl = getDebugNode(newChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.addChild(debugChildEl);\n }\n this.delegate.appendChild(parent, newChild);\n }\n/**\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\ninsertBefore(parent: any, newChild: any, refChild: any): void {\n const /** @type {?} */ debugEl = getDebugNode(parent);\n const /** @type {?} */ debugChildEl = getDebugNode(newChild);\n const /** @type {?} */ debugRefEl = /** @type {?} */(( getDebugNode(refChild)));\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.insertBefore(debugRefEl, debugChildEl);\n }\n\n this.delegate.insertBefore(parent, newChild, refChild);\n }\n/**\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\nremoveChild(parent: any, oldChild: any): void {\n const /** @type {?} */ debugEl = getDebugNode(parent);\n const /** @type {?} */ debugChildEl = getDebugNode(oldChild);\n if (debugEl && debugChildEl && debugEl instanceof DebugElement) {\n debugEl.removeChild(debugChildEl);\n }\n this.delegate.removeChild(parent, oldChild);\n }\n/**\n * @param {?} selectorOrNode\n * @return {?}\n */\nselectRootElement(selectorOrNode: string|any): any {\n const /** @type {?} */ el = this.delegate.selectRootElement(selectorOrNode);\n const /** @type {?} */ debugCtx = getCurrentDebugContext();\n if (debugCtx) {\n indexDebugNode(new DebugElement(el, null, debugCtx));\n }\n return el;\n }\n/**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\nsetAttribute(el: any, name: string, value: string, namespace?: string): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n const /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = value;\n }\n this.delegate.setAttribute(el, name, value, namespace);\n }\n/**\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\nremoveAttribute(el: any, name: string, namespace?: string): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n const /** @type {?} */ fullName = namespace ? namespace + ':' + name : name;\n debugEl.attributes[fullName] = null;\n }\n this.delegate.removeAttribute(el, name, namespace);\n }\n/**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\naddClass(el: any, name: string): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.classes[name] = true;\n }\n this.delegate.addClass(el, name);\n }\n/**\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\nremoveClass(el: any, name: string): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.classes[name] = false;\n }\n this.delegate.removeClass(el, name);\n }\n/**\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?} flags\n * @return {?}\n */\nsetStyle(el: any, style: string, value: any, flags: RendererStyleFlags2): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.styles[style] = value;\n }\n this.delegate.setStyle(el, style, value, flags);\n }\n/**\n * @param {?} el\n * @param {?} style\n * @param {?} flags\n * @return {?}\n */\nremoveStyle(el: any, style: string, flags: RendererStyleFlags2): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.styles[style] = null;\n }\n this.delegate.removeStyle(el, style, flags);\n }\n/**\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nsetProperty(el: any, name: string, value: any): void {\n const /** @type {?} */ debugEl = getDebugNode(el);\n if (debugEl && debugEl instanceof DebugElement) {\n debugEl.properties[name] = value;\n }\n this.delegate.setProperty(el, name, value);\n }\n/**\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\nlisten(\n target: 'document'|'windows'|'body'|any, eventName: string,\n callback: (event: any) => boolean): () => void {\n if (typeof target !== 'string') {\n const /** @type {?} */ 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 * @param {?} node\n * @return {?}\n */\nparentNode(node: any): any { return this.delegate.parentNode(node); }\n/**\n * @param {?} node\n * @return {?}\n */\nnextSibling(node: any): any { return this.delegate.nextSibling(node); }\n/**\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\nsetValue(node: any, value: string): void { return this.delegate.setValue(node, value); }\n}\n\nfunction DebugRenderer2_tsickle_Closure_declarations() {\n/** @type {?} */\nDebugRenderer2.prototype.delegate;\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 {Injector} from '../di/injector';\nimport {NgModuleFactory, NgModuleRef} from '../linker/ng_module_factory';\nimport {Type} from '../type';\n\nimport {initServicesIfNeeded} from './services';\nimport {NgModuleDefinitionFactory, ProviderOverride, Services} from './types';\nimport {resolveDefinition} from './util';\n/**\n * @param {?} override\n * @return {?}\n */\nexport function overrideProvider(override: ProviderOverride) {\n initServicesIfNeeded();\n return Services.overrideProvider(override);\n}\n/**\n * @return {?}\n */\nexport function clearProviderOverrides() {\n initServicesIfNeeded();\n return Services.clearProviderOverrides();\n}\n/**\n * @param {?} ngModuleType\n * @param {?} bootstrapComponents\n * @param {?} defFactory\n * @return {?}\n */\nexport function createNgModuleFactory(\n ngModuleType: Type, bootstrapComponents: Type[],\n defFactory: NgModuleDefinitionFactory): NgModuleFactory {\n return new NgModuleFactory_(ngModuleType, bootstrapComponents, defFactory);\n}\nclass NgModuleFactory_ extends NgModuleFactory {\n/**\n * @param {?} moduleType\n * @param {?} _bootstrapComponents\n * @param {?} _ngModuleDefFactory\n */\nconstructor(\npublic readonly moduleType: Type,\nprivate _bootstrapComponents: Type[],\nprivate _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 * @param {?} parentInjector\n * @return {?}\n */\ncreate(parentInjector: Injector|null): NgModuleRef {\n initServicesIfNeeded();\n const /** @type {?} */ def = resolveDefinition(this._ngModuleDefFactory);\n return Services.createNgModuleRef(\n this.moduleType, parentInjector || Injector.NULL, this._bootstrapComponents, def);\n }\n}\n\nfunction NgModuleFactory__tsickle_Closure_declarations() {\n/** @type {?} */\nNgModuleFactory_.prototype.moduleType;\n/** @type {?} */\nNgModuleFactory_.prototype._bootstrapComponents;\n/** @type {?} */\nNgModuleFactory_.prototype._ngModuleDefFactory;\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 {ApplicationRef} from '../application_ref';\nimport {ChangeDetectorRef} from '../change_detection/change_detection';\nimport {Injector} from '../di/injector';\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 /** @type {?} */ EMPTY_CONTEXT = new Object();\n/**\n * @param {?} selector\n * @param {?} componentType\n * @param {?} viewDefFactory\n * @param {?} inputs\n * @param {?} outputs\n * @param {?} ngContentSelectors\n * @return {?}\n */\nexport function createComponentFactory(\n selector: string, componentType: Type, viewDefFactory: ViewDefinitionFactory,\n inputs: {[propName: string]: string} | null, outputs: {[propName: string]: string},\n ngContentSelectors: string[]): ComponentFactory {\n return new ComponentFactory_(\n selector, componentType, viewDefFactory, inputs, outputs, ngContentSelectors);\n}\n/**\n * @param {?} componentFactory\n * @return {?}\n */\nexport function getComponentViewDefinitionFactory(componentFactory: ComponentFactory):\n ViewDefinitionFactory {\n return ( /** @type {?} */((componentFactory as ComponentFactory_))).viewDefFactory;\n}\nclass ComponentFactory_ extends ComponentFactory {\n/**\n * \\@internal\n */\nviewDefFactory: ViewDefinitionFactory;\n/**\n * @param {?} selector\n * @param {?} componentType\n * @param {?} viewDefFactory\n * @param {?} _inputs\n * @param {?} _outputs\n * @param {?} ngContentSelectors\n */\nconstructor(\npublic selector: string,\npublic componentType: Type,\n viewDefFactory: ViewDefinitionFactory,\nprivate _inputs: {[propName: string]: string}|null,\nprivate _outputs: {[propName: string]: string},\npublic 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 * @return {?}\n */\nget inputs() {\n const /** @type {?} */ inputsArr: {propName: string, templateName: string}[] = [];\n const /** @type {?} */ inputs = /** @type {?} */(( this._inputs));\n for (let /** @type {?} */ propName in inputs) {\n const /** @type {?} */ templateName = inputs[propName];\n inputsArr.push({propName, templateName});\n }\n return inputsArr;\n }\n/**\n * @return {?}\n */\nget outputs() {\n const /** @type {?} */ outputsArr: {propName: string, templateName: string}[] = [];\n for (let /** @type {?} */ propName in this._outputs) {\n const /** @type {?} */ templateName = this._outputs[propName];\n outputsArr.push({propName, templateName});\n }\n return outputsArr;\n }\n/**\n * Creates a new component.\n * @param {?} injector\n * @param {?=} projectableNodes\n * @param {?=} rootSelectorOrNode\n * @param {?=} ngModule\n * @return {?}\n */\ncreate(\n injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string|any,\n ngModule?: NgModuleRef): ComponentRef {\n if (!ngModule) {\n throw new Error('ngModule should be provided');\n }\n const /** @type {?} */ viewDef = resolveDefinition(this.viewDefFactory);\n const /** @type {?} */ componentNodeIndex = /** @type {?} */(( /** @type {?} */(( viewDef.nodes[0].element)).componentProvider)).nodeIndex;\n const /** @type {?} */ view = Services.createRootView(\n injector, projectableNodes || [], rootSelectorOrNode, viewDef, ngModule, EMPTY_CONTEXT);\n const /** @type {?} */ 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\nfunction ComponentFactory__tsickle_Closure_declarations() {\n/**\n * \\@internal\n * @type {?}\n */\nComponentFactory_.prototype.viewDefFactory;\n/** @type {?} */\nComponentFactory_.prototype.selector;\n/** @type {?} */\nComponentFactory_.prototype.componentType;\n/** @type {?} */\nComponentFactory_.prototype._inputs;\n/** @type {?} */\nComponentFactory_.prototype._outputs;\n/** @type {?} */\nComponentFactory_.prototype.ngContentSelectors;\n}\n\nclass ComponentRef_ extends ComponentRef {\nprivate _elDef: NodeDef;\n/**\n * @param {?} _view\n * @param {?} _viewRef\n * @param {?} _component\n */\nconstructor(private _view: ViewData,\nprivate _viewRef: ViewRef,\nprivate _component: any) {\n super();\n this._elDef = this._view.def.nodes[0];\n }\n/**\n * @return {?}\n */\nget location(): ElementRef {\n return new ElementRef(asElementData(this._view, this._elDef.nodeIndex).renderElement);\n }\n/**\n * @return {?}\n */\nget injector(): Injector { return new Injector_(this._view, this._elDef); }\n/**\n * @return {?}\n */\nget instance(): any { return this._component; }\n/**\n * @return {?}\n */\nget hostView(): ViewRef { return this._viewRef; }\n/**\n * @return {?}\n */\nget changeDetectorRef(): ChangeDetectorRef { return this._viewRef; }\n/**\n * @return {?}\n */\nget componentType(): Type { return /** @type {?} */(( this._component.constructor)); }\n/**\n * @return {?}\n */\ndestroy(): void { this._viewRef.destroy(); }\n/**\n * @param {?} callback\n * @return {?}\n */\nonDestroy(callback: Function): void { this._viewRef.onDestroy(callback); }\n}\n\nfunction ComponentRef__tsickle_Closure_declarations() {\n/** @type {?} */\nComponentRef_.prototype._elDef;\n/** @type {?} */\nComponentRef_.prototype._view;\n/** @type {?} */\nComponentRef_.prototype._viewRef;\n/** @type {?} */\nComponentRef_.prototype._component;\n}\n\n/**\n * @param {?} view\n * @param {?} elDef\n * @param {?} elData\n * @return {?}\n */\nexport function createViewContainerData(\n view: ViewData, elDef: NodeDef, elData: ElementData): ViewContainerData {\n return new ViewContainerRef_(view, elDef, elData);\n}\nclass ViewContainerRef_ implements ViewContainerData {\n/**\n * \\@internal\n */\n_embeddedViews: ViewData[] = [];\n/**\n * @param {?} _view\n * @param {?} _elDef\n * @param {?} _data\n */\nconstructor(private _view: ViewData,\nprivate _elDef: NodeDef,\nprivate _data: ElementData) {}\n/**\n * @return {?}\n */\nget element(): ElementRef { return new ElementRef(this._data.renderElement); }\n/**\n * @return {?}\n */\nget injector(): Injector { return new Injector_(this._view, this._elDef); }\n/**\n * @return {?}\n */\nget parentInjector(): Injector {\n let /** @type {?} */ view = this._view;\n let /** @type {?} */ elDef = this._elDef.parent;\n while (!elDef && view) {\n elDef = viewParentEl(view);\n view = /** @type {?} */(( view.parent));\n }\n\n return view ? new Injector_(view, elDef) : new Injector_(this._view, null);\n }\n/**\n * @return {?}\n */\nclear(): void {\n const /** @type {?} */ len = this._embeddedViews.length;\n for (let /** @type {?} */ i = len - 1; i >= 0; i--) {\n const /** @type {?} */ view = /** @type {?} */(( detachEmbeddedView(this._data, i)));\n Services.destroyView(view);\n }\n }\n/**\n * @param {?} index\n * @return {?}\n */\nget(index: number): ViewRef|null {\n const /** @type {?} */ view = this._embeddedViews[index];\n if (view) {\n const /** @type {?} */ ref = new ViewRef_(view);\n ref.attachToViewContainerRef(this);\n return ref;\n }\n return null;\n }\n/**\n * @return {?}\n */\nget length(): number { return this._embeddedViews.length; }\n/**\n * @template C\n * @param {?} templateRef\n * @param {?=} context\n * @param {?=} index\n * @return {?}\n */\ncreateEmbeddedView(templateRef: TemplateRef, context?: C, index?: number):\n EmbeddedViewRef {\n const /** @type {?} */ viewRef = templateRef.createEmbeddedView(context || /** @type {?} */(( {})));\n this.insert(viewRef, index);\n return viewRef;\n }\n/**\n * @template C\n * @param {?} componentFactory\n * @param {?=} index\n * @param {?=} injector\n * @param {?=} projectableNodes\n * @param {?=} ngModuleRef\n * @return {?}\n */\ncreateComponent(\n componentFactory: ComponentFactory, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModuleRef?: NgModuleRef): ComponentRef {\n const /** @type {?} */ contextInjector = injector || this.parentInjector;\n if (!ngModuleRef && !(componentFactory instanceof ComponentFactoryBoundToModule)) {\n ngModuleRef = contextInjector.get(NgModuleRef);\n }\n const /** @type {?} */ componentRef =\n componentFactory.create(contextInjector, projectableNodes, undefined, ngModuleRef);\n this.insert(componentRef.hostView, index);\n return componentRef;\n }\n/**\n * @param {?} viewRef\n * @param {?=} index\n * @return {?}\n */\ninsert(viewRef: ViewRef, index?: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot insert a destroyed View in a ViewContainer!');\n }\n const /** @type {?} */ viewRef_ = /** @type {?} */(( viewRef));\n const /** @type {?} */ viewData = viewRef_._view;\n attachEmbeddedView(this._view, this._data, index, viewData);\n viewRef_.attachToViewContainerRef(this);\n return viewRef;\n }\n/**\n * @param {?} viewRef\n * @param {?} currentIndex\n * @return {?}\n */\nmove(viewRef: ViewRef_, currentIndex: number): ViewRef {\n if (viewRef.destroyed) {\n throw new Error('Cannot move a destroyed View in a ViewContainer!');\n }\n const /** @type {?} */ previousIndex = this._embeddedViews.indexOf(viewRef._view);\n moveEmbeddedView(this._data, previousIndex, currentIndex);\n return viewRef;\n }\n/**\n * @param {?} viewRef\n * @return {?}\n */\nindexOf(viewRef: ViewRef): number {\n return this._embeddedViews.indexOf(( /** @type {?} */((viewRef)))._view);\n }\n/**\n * @param {?=} index\n * @return {?}\n */\nremove(index?: number): void {\n const /** @type {?} */ viewData = detachEmbeddedView(this._data, index);\n if (viewData) {\n Services.destroyView(viewData);\n }\n }\n/**\n * @param {?=} index\n * @return {?}\n */\ndetach(index?: number): ViewRef|null {\n const /** @type {?} */ view = detachEmbeddedView(this._data, index);\n return view ? new ViewRef_(view) : null;\n }\n}\n\nfunction ViewContainerRef__tsickle_Closure_declarations() {\n/**\n * \\@internal\n * @type {?}\n */\nViewContainerRef_.prototype._embeddedViews;\n/** @type {?} */\nViewContainerRef_.prototype._view;\n/** @type {?} */\nViewContainerRef_.prototype._elDef;\n/** @type {?} */\nViewContainerRef_.prototype._data;\n}\n\n/**\n * @param {?} view\n * @return {?}\n */\nexport function createChangeDetectorRef(view: ViewData): ChangeDetectorRef {\n return new ViewRef_(view);\n}\nexport class ViewRef_ implements EmbeddedViewRef, InternalViewRef {\n/**\n * \\@internal\n */\n_view: ViewData;\nprivate _viewContainerRef: ViewContainerRef|null;\nprivate _appRef: ApplicationRef|null;\n/**\n * @param {?} _view\n */\nconstructor(_view: ViewData) {\n this._view = _view;\n this._viewContainerRef = null;\n this._appRef = null;\n }\n/**\n * @return {?}\n */\nget rootNodes(): any[] { return rootRenderNodes(this._view); }\n/**\n * @return {?}\n */\nget context() { return this._view.context; }\n/**\n * @return {?}\n */\nget destroyed(): boolean { return (this._view.state & ViewState.Destroyed) !== 0; }\n/**\n * @return {?}\n */\nmarkForCheck(): void { markParentViewsForCheck(this._view); }\n/**\n * @return {?}\n */\ndetach(): void { this._view.state &= ~ViewState.Attached; }\n/**\n * @return {?}\n */\ndetectChanges(): void {\n const /** @type {?} */ fs = this._view.root.rendererFactory;\n if (fs.begin) {\n fs.begin();\n }\n Services.checkAndUpdateView(this._view);\n if (fs.end) {\n fs.end();\n }\n }\n/**\n * @return {?}\n */\ncheckNoChanges(): void { Services.checkNoChangesView(this._view); }\n/**\n * @return {?}\n */\nreattach(): void { this._view.state |= ViewState.Attached; }\n/**\n * @param {?} callback\n * @return {?}\n */\nonDestroy(callback: Function) {\n if (!this._view.disposables) {\n this._view.disposables = [];\n }\n this._view.disposables.push( /** @type {?} */((callback)));\n }\n/**\n * @return {?}\n */\ndestroy() {\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 * @return {?}\n */\ndetachFromAppRef() {\n this._appRef = null;\n renderDetachView(this._view);\n Services.dirtyParentQueries(this._view);\n }\n/**\n * @param {?} appRef\n * @return {?}\n */\nattachToAppRef(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 * @param {?} vcRef\n * @return {?}\n */\nattachToViewContainerRef(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\nfunction ViewRef__tsickle_Closure_declarations() {\n/**\n * \\@internal\n * @type {?}\n */\nViewRef_.prototype._view;\n/** @type {?} */\nViewRef_.prototype._viewContainerRef;\n/** @type {?} */\nViewRef_.prototype._appRef;\n}\n\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\n */\nexport function createTemplateData(view: ViewData, def: NodeDef): TemplateData {\n return new TemplateRef_(view, def);\n}\nclass TemplateRef_ extends TemplateRef implements TemplateData {\n/**\n * \\@internal\n */\n_projectedViews: ViewData[];\n/**\n * @param {?} _parentView\n * @param {?} _def\n */\nconstructor(private _parentView: ViewData,\nprivate _def: NodeDef) { super(); }\n/**\n * @param {?} context\n * @return {?}\n */\ncreateEmbeddedView(context: any): EmbeddedViewRef {\n return new ViewRef_(Services.createEmbeddedView(\n this._parentView, this._def, /** @type {?} */(( /** @type {?} */(( this._def.element)).template)), context));\n }\n/**\n * @return {?}\n */\nget elementRef(): ElementRef {\n return new ElementRef(asElementData(this._parentView, this._def.nodeIndex).renderElement);\n }\n}\n\nfunction TemplateRef__tsickle_Closure_declarations() {\n/**\n * \\@internal\n * @type {?}\n */\nTemplateRef_.prototype._projectedViews;\n/** @type {?} */\nTemplateRef_.prototype._parentView;\n/** @type {?} */\nTemplateRef_.prototype._def;\n}\n\n/**\n * @param {?} view\n * @param {?} elDef\n * @return {?}\n */\nexport function createInjector(view: ViewData, elDef: NodeDef): Injector {\n return new Injector_(view, elDef);\n}\nclass Injector_ implements Injector {\n/**\n * @param {?} view\n * @param {?} elDef\n */\nconstructor(private view: ViewData,\nprivate elDef: NodeDef|null) {}\n/**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\nget(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n const /** @type {?} */ 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\nfunction Injector__tsickle_Closure_declarations() {\n/** @type {?} */\nInjector_.prototype.view;\n/** @type {?} */\nInjector_.prototype.elDef;\n}\n\n/**\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function nodeValue(view: ViewData, index: number): any {\n const /** @type {?} */ def = view.def.nodes[index];\n if (def.flags & NodeFlags.TypeElement) {\n const /** @type {?} */ elData = asElementData(view, def.nodeIndex);\n return /** @type {?} */(( 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/**\n * @param {?} view\n * @return {?}\n */\nexport function createRendererV1(view: ViewData): RendererV1 {\n return new RendererAdapter(view.renderer);\n}\nclass RendererAdapter implements RendererV1 {\n/**\n * @param {?} delegate\n */\nconstructor(private delegate: Renderer2) {}\n/**\n * @param {?} selectorOrNode\n * @return {?}\n */\nselectRootElement(selectorOrNode: string|Element): Element {\n return this.delegate.selectRootElement(selectorOrNode);\n }\n/**\n * @param {?} parent\n * @param {?} namespaceAndName\n * @return {?}\n */\ncreateElement(parent: Element|DocumentFragment, namespaceAndName: string): Element {\n const [ns, name] = splitNamespace(namespaceAndName);\n const /** @type {?} */ el = this.delegate.createElement(name, ns);\n if (parent) {\n this.delegate.appendChild(parent, el);\n }\n return el;\n }\n/**\n * @param {?} hostElement\n * @return {?}\n */\ncreateViewRoot(hostElement: Element): Element|DocumentFragment { return hostElement; }\n/**\n * @param {?} parentElement\n * @return {?}\n */\ncreateTemplateAnchor(parentElement: Element|DocumentFragment): Comment {\n const /** @type {?} */ comment = this.delegate.createComment('');\n if (parentElement) {\n this.delegate.appendChild(parentElement, comment);\n }\n return comment;\n }\n/**\n * @param {?} parentElement\n * @param {?} value\n * @return {?}\n */\ncreateText(parentElement: Element|DocumentFragment, value: string): any {\n const /** @type {?} */ node = this.delegate.createText(value);\n if (parentElement) {\n this.delegate.appendChild(parentElement, node);\n }\n return node;\n }\n/**\n * @param {?} parentElement\n * @param {?} nodes\n * @return {?}\n */\nprojectNodes(parentElement: Element|DocumentFragment, nodes: Node[]) {\n for (let /** @type {?} */ i = 0; i < nodes.length; i++) {\n this.delegate.appendChild(parentElement, nodes[i]);\n }\n }\n/**\n * @param {?} node\n * @param {?} viewRootNodes\n * @return {?}\n */\nattachViewAfter(node: Node, viewRootNodes: Node[]) {\n const /** @type {?} */ parentElement = this.delegate.parentNode(node);\n const /** @type {?} */ nextSibling = this.delegate.nextSibling(node);\n for (let /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {\n this.delegate.insertBefore(parentElement, viewRootNodes[i], nextSibling);\n }\n }\n/**\n * @param {?} viewRootNodes\n * @return {?}\n */\ndetachView(viewRootNodes: (Element|Text|Comment)[]) {\n for (let /** @type {?} */ i = 0; i < viewRootNodes.length; i++) {\n const /** @type {?} */ node = viewRootNodes[i];\n const /** @type {?} */ parentElement = this.delegate.parentNode(node);\n this.delegate.removeChild(parentElement, node);\n }\n }\n/**\n * @param {?} hostElement\n * @param {?} viewAllNodes\n * @return {?}\n */\ndestroyView(hostElement: Element|DocumentFragment, viewAllNodes: Node[]) {\n for (let /** @type {?} */ i = 0; i < viewAllNodes.length; i++) { /** @type {?} */((\n this.delegate.destroyNode))(viewAllNodes[i]);\n }\n }\n/**\n * @param {?} renderElement\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\nlisten(renderElement: any, name: string, callback: Function): Function {\n return this.delegate.listen(renderElement, name, /** @type {?} */(( callback)));\n }\n/**\n * @param {?} target\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\nlistenGlobal(target: string, name: string, callback: Function): Function {\n return this.delegate.listen(target, name, /** @type {?} */(( callback)));\n }\n/**\n * @param {?} renderElement\n * @param {?} propertyName\n * @param {?} propertyValue\n * @return {?}\n */\nsetElementProperty(\n renderElement: Element|DocumentFragment, propertyName: string, propertyValue: any): void {\n this.delegate.setProperty(renderElement, propertyName, propertyValue);\n }\n/**\n * @param {?} renderElement\n * @param {?} namespaceAndName\n * @param {?} attributeValue\n * @return {?}\n */\nsetElementAttribute(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 * @param {?} renderElement\n * @param {?} propertyName\n * @param {?} propertyValue\n * @return {?}\n */\nsetBindingDebugInfo(renderElement: Element, propertyName: string, propertyValue: string): void {}\n/**\n * @param {?} renderElement\n * @param {?} className\n * @param {?} isAdd\n * @return {?}\n */\nsetElementClass(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 * @param {?} renderElement\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\nsetElementStyle(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 * @param {?} renderElement\n * @param {?} methodName\n * @param {?} args\n * @return {?}\n */\ninvokeElementMethod(renderElement: Element, methodName: string, args: any[]): void {\n ( /** @type {?} */((renderElement as any)))[methodName].apply(renderElement, args);\n }\n/**\n * @param {?} renderNode\n * @param {?} text\n * @return {?}\n */\nsetText(renderNode: Text, text: string): void { this.delegate.setValue(renderNode, text); }\n/**\n * @return {?}\n */\nanimate(): any { throw new Error('Renderer.animate is no longer supported!'); }\n}\n\nfunction RendererAdapter_tsickle_Closure_declarations() {\n/** @type {?} */\nRendererAdapter.prototype.delegate;\n}\n\n/**\n * @param {?} moduleType\n * @param {?} parent\n * @param {?} bootstrapComponents\n * @param {?} def\n * @return {?}\n */\nexport function createNgModuleRef(\n moduleType: Type, parent: Injector, bootstrapComponents: Type[],\n def: NgModuleDefinition): NgModuleRef {\n return new NgModuleRef_(moduleType, parent, bootstrapComponents, def);\n}\nclass NgModuleRef_ implements NgModuleData, InternalNgModuleRef {\nprivate _destroyListeners: (() => void)[] = [];\nprivate _destroyed: boolean = false;\npublic _providers: any[];\n/**\n * @param {?} _moduleType\n * @param {?} _parent\n * @param {?} _bootstrapComponents\n * @param {?} _def\n */\nconstructor(\nprivate _moduleType: Type,\npublic _parent: Injector,\npublic _bootstrapComponents: Type[],\npublic _def: NgModuleDefinition) {\n initNgModule(this);\n }\n/**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\nget(token: any, notFoundValue: any = Injector.THROW_IF_NOT_FOUND): any {\n return resolveNgModuleDep(\n this, {token: token, tokenKey: tokenKey(token), flags: DepFlags.None}, notFoundValue);\n }\n/**\n * @return {?}\n */\nget instance() { return this.get(this._moduleType); }\n/**\n * @return {?}\n */\nget componentFactoryResolver() { return this.get(ComponentFactoryResolver); }\n/**\n * @return {?}\n */\nget injector(): Injector { return this; }\n/**\n * @return {?}\n */\ndestroy(): 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 * @param {?} callback\n * @return {?}\n */\nonDestroy(callback: () => void): void { this._destroyListeners.push(callback); }\n}\n\nfunction NgModuleRef__tsickle_Closure_declarations() {\n/** @type {?} */\nNgModuleRef_.prototype._destroyListeners;\n/** @type {?} */\nNgModuleRef_.prototype._destroyed;\n/** @type {?} */\nNgModuleRef_.prototype._providers;\n/** @type {?} */\nNgModuleRef_.prototype._moduleType;\n/** @type {?} */\nNgModuleRef_.prototype._parent;\n/** @type {?} */\nNgModuleRef_.prototype._bootstrapComponents;\n/** @type {?} */\nNgModuleRef_.prototype._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\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} from './types';\nimport {NOOP, checkBindingNoChanges, isComponentView, markParentViewsForCheckProjectedViews, resolveDefinition, tokenKey} from './util';\nimport {detachProjectedView} from './view_attach';\n/**\n * @param {?} flags\n * @param {?} nodes\n * @param {?=} updateDirectives\n * @param {?=} updateRenderer\n * @return {?}\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 /** @type {?} */ viewBindingCount = 0;\n let /** @type {?} */ viewDisposableCount = 0;\n let /** @type {?} */ viewNodeFlags = 0;\n let /** @type {?} */ viewRootNodeFlags = 0;\n let /** @type {?} */ viewMatchedQueries = 0;\n let /** @type {?} */ currentParent: NodeDef|null = null;\n let /** @type {?} */ currentRenderParent: NodeDef|null = null;\n let /** @type {?} */ currentElementHasPublicProviders = false;\n let /** @type {?} */ currentElementHasPrivateProviders = false;\n let /** @type {?} */ lastRenderRootNode: NodeDef|null = null;\n for (let /** @type {?} */ i = 0; i < nodes.length; i++) {\n const /** @type {?} */ 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 /** @type {?} */ elDef = node.element;\n elDef.publicProviders =\n currentParent ? /** @type {?} */(( 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; /** @type {?} */(( /** @type {?} */((\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent)).element)).publicProviders =\n Object.create( /** @type {?} */(( /** @type {?} */((currentParent)).element)).publicProviders); /** @type {?} */(( /** @type {?} */((\n currentParent)).element)).allProviders = /** @type {?} */(( /** @type {?} */(( currentParent)).element)).publicProviders;\n }\n const /** @type {?} */ isPrivateService = (node.flags & NodeFlags.PrivateProvider) !== 0;\n const /** @type {?} */ isComponent = (node.flags & NodeFlags.Component) !== 0;\n if (!isPrivateService || isComponent) { /** @type {?} */(( /** @type {?} */(( /** @type {?} */((\n currentParent)).element)).publicProviders))[tokenKey( /** @type {?} */((node.provider)).token)] = node;\n } else {\n if (!currentElementHasPrivateProviders) {\n currentElementHasPrivateProviders = true; /** @type {?} */(( /** @type {?} */((\n // Use prototypical inheritance to not get O(n^2) complexity...\n currentParent)).element)).allProviders =\n Object.create( /** @type {?} */(( /** @type {?} */((currentParent)).element)).publicProviders);\n } /** @type {?} */(( /** @type {?} */(( /** @type {?} */((\n currentParent)).element)).allProviders))[tokenKey( /** @type {?} */((node.provider)).token)] = node;\n }\n if (isComponent) { /** @type {?} */(( /** @type {?} */((\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 /** @type {?} */ 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 /** @type {?} */ handleEvent: ViewHandleEventFn = (view, nodeIndex, eventName, event) => /** @type {?} */(( /** @type {?} */((\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/**\n * @param {?} node\n * @return {?}\n */\nfunction isNgContainer(node: NodeDef): boolean {\n return (node.flags & NodeFlags.TypeElement) !== 0 && /** @type {?} */(( node.element)).name === null;\n}\n/**\n * @param {?} parent\n * @param {?} node\n * @param {?} nodeCount\n * @return {?}\n */\nfunction validateNode(parent: NodeDef | null, node: NodeDef, nodeCount: number) {\n const /** @type {?} */ 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 /** @type {?} */ 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 /** @type {?} */ 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/**\n * @param {?} parent\n * @param {?} anchorDef\n * @param {?} viewDef\n * @param {?=} context\n * @return {?}\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 /** @type {?} */ view = createView(parent.root, parent.renderer, parent, anchorDef, viewDef);\n initView(view, parent.component, context);\n createViewNodes(view);\n return view;\n}\n/**\n * @param {?} root\n * @param {?} def\n * @param {?=} context\n * @return {?}\n */\nexport function createRootView(root: RootData, def: ViewDefinition, context?: any): ViewData {\n const /** @type {?} */ view = createView(root, root.renderer, null, null, def);\n initView(view, context, context);\n createViewNodes(view);\n return view;\n}\n/**\n * @param {?} parentView\n * @param {?} nodeDef\n * @param {?} viewDef\n * @param {?} hostElement\n * @return {?}\n */\nexport function createComponentView(\n parentView: ViewData, nodeDef: NodeDef, viewDef: ViewDefinition, hostElement: any): ViewData {\n const /** @type {?} */ rendererType = /** @type {?} */(( nodeDef.element)).componentRendererType;\n let /** @type {?} */ 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, /** @type {?} */(( nodeDef.element)).componentProvider, viewDef);\n}\n/**\n * @param {?} root\n * @param {?} renderer\n * @param {?} parent\n * @param {?} parentNodeDef\n * @param {?} def\n * @return {?}\n */\nfunction createView(\n root: RootData, renderer: Renderer2, parent: ViewData | null, parentNodeDef: NodeDef | null,\n def: ViewDefinition): ViewData {\n const /** @type {?} */ nodes: NodeData[] = new Array(def.nodes.length);\n const /** @type {?} */ disposables = def.outputCount ? new Array(def.outputCount) : null;\n const /** @type {?} */ 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 };\n return view;\n}\n/**\n * @param {?} view\n * @param {?} component\n * @param {?} context\n * @return {?}\n */\nfunction initView(view: ViewData, component: any, context: any) {\n view.component = component;\n view.context = context;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nfunction createViewNodes(view: ViewData) {\n let /** @type {?} */ renderHost: any;\n if (isComponentView(view)) {\n const /** @type {?} */ hostDef = view.parentNodeDef;\n renderHost = asElementData( /** @type {?} */((view.parent)), /** @type {?} */(( /** @type {?} */(( hostDef)).parent)).nodeIndex).renderElement;\n }\n const /** @type {?} */ def = view.def;\n const /** @type {?} */ nodes = view.nodes;\n for (let /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n const /** @type {?} */ nodeDef = def.nodes[i];\n Services.setCurrentNode(view, i);\n let /** @type {?} */ nodeData: any;\n switch (nodeDef.flags & NodeFlags.Types) {\n case NodeFlags.TypeElement:\n const /** @type {?} */ el = /** @type {?} */(( createElement(view, renderHost, nodeDef) as any));\n let /** @type {?} */ componentView: ViewData = /** @type {?} */(( undefined));\n if (nodeDef.flags & NodeFlags.ComponentView) {\n const /** @type {?} */ compViewDef = resolveDefinition( /** @type {?} */(( /** @type {?} */((nodeDef.element)).componentView)));\n componentView = Services.createComponentView(view, nodeDef, compViewDef, el);\n }\n listenToElementOutputs(view, componentView, nodeDef, el);\n nodeData = /** @type {?} */(( {\n renderElement: el,\n componentView,\n viewContainer: null,\n template: /** @type {?} */(( 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 = /** @type {?} */(( 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 /** @type {?} */ instance = createProviderInstance(view, nodeDef);\n nodeData = /** @type {?} */(( {instance}));\n }\n break;\n }\n case NodeFlags.TypePipe: {\n const /** @type {?} */ instance = createPipeInstance(view, nodeDef);\n nodeData = /** @type {?} */(( {instance}));\n break;\n }\n case NodeFlags.TypeDirective: {\n nodeData = nodes[i];\n if (!nodeData) {\n const /** @type {?} */ instance = createDirectiveInstance(view, nodeDef);\n nodeData = /** @type {?} */(( {instance}));\n }\n if (nodeDef.flags & NodeFlags.Component) {\n const /** @type {?} */ compView = asElementData(view, /** @type {?} */(( 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 = /** @type {?} */(( createPureExpression(view, nodeDef) as any));\n break;\n case NodeFlags.TypeContentQuery:\n case NodeFlags.TypeViewQuery:\n nodeData = /** @type {?} */(( 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/**\n * @param {?} view\n * @return {?}\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/**\n * @param {?} view\n * @return {?}\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 markProjectedViewsForCheck(view);\n Services.updateDirectives(view, CheckType.CheckAndUpdate);\n execEmbeddedViewsAction(view, ViewAction.CheckAndUpdate);\n execQueriesAction(\n view, NodeFlags.TypeContentQuery, NodeFlags.DynamicQuery, CheckType.CheckAndUpdate);\n\n callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterContentChecked |\n (view.state & ViewState.FirstCheck ? 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 callLifecycleHooksChildrenFirst(\n view, NodeFlags.AfterViewChecked |\n (view.state & ViewState.FirstCheck ? 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}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\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/**\n * @param {?} view\n * @return {?}\n */\nfunction markProjectedViewsForCheck(view: ViewData) {\n const /** @type {?} */ def = view.def;\n if (!(def.nodeFlags & NodeFlags.ProjectedTemplate)) {\n return;\n }\n for (let /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n const /** @type {?} */ nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.ProjectedTemplate) {\n const /** @type {?} */ projectedViews = asElementData(view, i).template._projectedViews;\n if (projectedViews) {\n for (let /** @type {?} */ i = 0; i < projectedViews.length; i++) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} values\n * @return {?}\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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} argStyle\n * @param {?=} v0\n * @param {?=} v1\n * @param {?=} v2\n * @param {?=} v3\n * @param {?=} v4\n * @param {?=} v5\n * @param {?=} v6\n * @param {?=} v7\n * @param {?=} v8\n * @param {?=} v9\n * @return {?}\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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} v0\n * @param {?} v1\n * @param {?} v2\n * @param {?} v3\n * @param {?} v4\n * @param {?} v5\n * @param {?} v6\n * @param {?} v7\n * @param {?} v8\n * @param {?} v9\n * @return {?}\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 /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} values\n * @return {?}\n */\nfunction checkNoChangesNodeDynamic(view: ViewData, nodeDef: NodeDef, values: any[]): void {\n for (let /** @type {?} */ i = 0; i < values.length; i++) {\n checkBindingNoChanges(view, nodeDef, i, values[i]);\n }\n}\n/**\n * Workaround https://github.com/angular/tsickle/issues/497\n * @suppress {misplacedTypeAnnotation}\n * @param {?} view\n * @param {?} nodeDef\n * @return {?}\n */\nfunction checkNoChangesQuery(view: ViewData, nodeDef: NodeDef) {\n const /** @type {?} */ queryList = asQueryList(view, nodeDef.nodeIndex);\n if (queryList.dirty) {\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, nodeDef.nodeIndex),\n `Query ${ /** @type {?} */((nodeDef.query)).id} not dirty`, `Query ${ /** @type {?} */((nodeDef.query)).id} dirty`,\n (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n/**\n * @param {?} view\n * @return {?}\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 /** @type {?} */ 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/**\n * @param {?} view\n * @return {?}\n */\nfunction destroyViewNodes(view: ViewData) {\n const /** @type {?} */ len = view.def.nodes.length;\n for (let /** @type {?} */ i = 0; i < len; i++) {\n const /** @type {?} */ def = view.def.nodes[i];\n if (def.flags & NodeFlags.TypeElement) { /** @type {?} */((\n view.renderer.destroyNode))(asElementData(view, i).renderElement);\n } else if (def.flags & NodeFlags.TypeText) { /** @type {?} */((\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}\ntype ViewAction = number;\nlet ViewAction: any = {};\nViewAction.CreateViewNodes = 0;\nViewAction.CheckNoChanges = 1;\nViewAction.CheckNoChangesProjectedViews = 2;\nViewAction.CheckAndUpdate = 3;\nViewAction.CheckAndUpdateProjectedViews = 4;\nViewAction.Destroy = 5;\nViewAction[ViewAction.CreateViewNodes] = \"CreateViewNodes\";\nViewAction[ViewAction.CheckNoChanges] = \"CheckNoChanges\";\nViewAction[ViewAction.CheckNoChangesProjectedViews] = \"CheckNoChangesProjectedViews\";\nViewAction[ViewAction.CheckAndUpdate] = \"CheckAndUpdate\";\nViewAction[ViewAction.CheckAndUpdateProjectedViews] = \"CheckAndUpdateProjectedViews\";\nViewAction[ViewAction.Destroy] = \"Destroy\";\n\n/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execComponentViewsAction(view: ViewData, action: ViewAction) {\n const /** @type {?} */ def = view.def;\n if (!(def.nodeFlags & NodeFlags.ComponentView)) {\n return;\n }\n for (let /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execEmbeddedViewsAction(view: ViewData, action: ViewAction) {\n const /** @type {?} */ def = view.def;\n if (!(def.nodeFlags & NodeFlags.EmbeddedViews)) {\n return;\n }\n for (let /** @type {?} */ i = 0; i < def.nodes.length; i++) {\n const /** @type {?} */ nodeDef = def.nodes[i];\n if (nodeDef.flags & NodeFlags.EmbeddedViews) {\n // a leaf\n const /** @type {?} */ embeddedViews = /** @type {?} */(( asElementData(view, i).viewContainer))._embeddedViews;\n for (let /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction callViewAction(view: ViewData, action: ViewAction) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} action\n * @return {?}\n */\nfunction execProjectedViewsAction(view: ViewData, action: ViewAction) {\n execEmbeddedViewsAction(view, action);\n execComponentViewsAction(view, action);\n}\n/**\n * @param {?} view\n * @param {?} queryFlags\n * @param {?} staticDynamicQueryFlag\n * @param {?} checkType\n * @return {?}\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 /** @type {?} */ nodeCount = view.def.nodes.length;\n for (let /** @type {?} */ i = 0; i < nodeCount; i++) {\n const /** @type {?} */ 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\n\nimport {Injector} from '../di/injector';\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 * Represents a container where one or more Views can be attached.\n * \n * The container can contain two kinds of Views. Host Views, created by instantiating a\n * {\\@link Component} via {\\@link #createComponent}, and Embedded Views, created by instantiating an\n * {\\@link TemplateRef Embedded Template} via {\\@link #createEmbeddedView}.\n * \n * The location of the View Container within the containing View is specified by the Anchor\n * `element`. Each View Container can have only one Anchor Element and each Anchor Element can only\n * have 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 * To access a `ViewContainerRef` of an Element, you can either place a {\\@link Directive} injected\n * with `ViewContainerRef` on the Element, or you obtain it via a {\\@link ViewChild} query.\n * \\@stable\n * @abstract\n */\nexport abstract class ViewContainerRef {\n/**\n * Anchor element that specifies the location of this container in the containing View.\n * \n * @abstract\n * @return {?}\n */\nelement() {}\n/**\n * @abstract\n * @return {?}\n */\ninjector() {}\n/**\n * @abstract\n * @return {?}\n */\nparentInjector() {}\n/**\n * Destroys all Views in this container.\n * @abstract\n * @return {?}\n */\nclear() {}\n/**\n * Returns the {\\@link ViewRef} for the View located in this container at the specified index.\n * @abstract\n * @param {?} index\n * @return {?}\n */\nget(index: number) {}\n/**\n * Returns the number of Views currently attached to this container.\n * @abstract\n * @return {?}\n */\nlength() {}\n/**\n * Instantiates an Embedded View based on the {\\@link TemplateRef `templateRef`} and inserts it\n * into this container at the specified `index`.\n * \n * If `index` is not specified, the new View will be inserted as the last View in the container.\n * \n * Returns the {\\@link ViewRef} for the newly created View.\n * @abstract\n * @template C\n * @param {?} templateRef\n * @param {?=} context\n * @param {?=} index\n * @return {?}\n */\ncreateEmbeddedView(templateRef: TemplateRef, context?: C, index?: number) {}\n/**\n * Instantiates a single {\\@link Component} and inserts its Host View into this container at the\n * specified `index`.\n * \n * The component is instantiated using its {\\@link ComponentFactory} which can be\n * obtained via {\\@link ComponentFactoryResolver#resolveComponentFactory}.\n * \n * If `index` is not specified, the new View will be inserted as the last View in the container.\n * \n * You can optionally specify the {\\@link Injector} that will be used as parent for the Component.\n * \n * Returns the {\\@link ComponentRef} of the Host View created for the newly instantiated Component.\n * @abstract\n * @template C\n * @param {?} componentFactory\n * @param {?=} index\n * @param {?=} injector\n * @param {?=} projectableNodes\n * @param {?=} ngModule\n * @return {?}\n */\ncreateComponent(\n componentFactory: ComponentFactory, index?: number, injector?: Injector,\n projectableNodes?: any[][], ngModule?: NgModuleRef) {}\n/**\n * Inserts a View identified by a {\\@link ViewRef} into the container at the specified `index`.\n * \n * If `index` is not specified, the new View will be inserted as the last View in the container.\n * \n * Returns the inserted {\\@link ViewRef}.\n * @abstract\n * @param {?} viewRef\n * @param {?=} index\n * @return {?}\n */\ninsert(viewRef: ViewRef, index?: number) {}\n/**\n * Moves a View identified by a {\\@link ViewRef} into the container at the specified `index`.\n * \n * Returns the inserted {\\@link ViewRef}.\n * @abstract\n * @param {?} viewRef\n * @param {?} currentIndex\n * @return {?}\n */\nmove(viewRef: ViewRef, currentIndex: number) {}\n/**\n * Returns the index of the View, specified via {\\@link ViewRef}, within the current container or\n * `-1` if this container doesn't contain the View.\n * @abstract\n * @param {?} viewRef\n * @return {?}\n */\nindexOf(viewRef: ViewRef) {}\n/**\n * Destroys a View attached to this container at the specified `index`.\n * \n * If `index` is not specified, the last View in the container will be removed.\n * @abstract\n * @param {?=} index\n * @return {?}\n */\nremove(index?: number) {}\n/**\n * Use along with {\\@link #insert} to move a View within the current container.\n * \n * If the `index` param is omitted, the last {\\@link ViewRef} is detached.\n * @abstract\n * @param {?=} index\n * @return {?}\n */\ndetach(index?: number) {}\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 {Injector} from '../di';\nimport {DebugContext} from '../view/index';\nexport class EventListener {\n/**\n * @param {?} name\n * @param {?} callback\n */\nconstructor(public name: string,\npublic callback: Function) {}\n}\n\nfunction EventListener_tsickle_Closure_declarations() {\n/** @type {?} */\nEventListener.prototype.name;\n/** @type {?} */\nEventListener.prototype.callback;\n}\n\n/**\n * \\@experimental All debugging apis are currently experimental.\n */\nexport class DebugNode {\n nativeNode: any;\n listeners: EventListener[];\n parent: DebugElement|null;\n/**\n * @param {?} nativeNode\n * @param {?} parent\n * @param {?} _debugContext\n */\nconstructor(nativeNode: any, parent: DebugNode|null,\nprivate _debugContext: DebugContext) {\n this.nativeNode = nativeNode;\n if (parent && parent instanceof DebugElement) {\n parent.addChild(this);\n } else {\n this.parent = null;\n }\n this.listeners = [];\n }\n/**\n * @return {?}\n */\nget injector(): Injector { return this._debugContext.injector; }\n/**\n * @return {?}\n */\nget componentInstance(): any { return this._debugContext.component; }\n/**\n * @return {?}\n */\nget context(): any { return this._debugContext.context; }\n/**\n * @return {?}\n */\nget references(): {[key: string]: any} { return this._debugContext.references; }\n/**\n * @return {?}\n */\nget providerTokens(): any[] { return this._debugContext.providerTokens; }\n/**\n * @deprecated since v4\n * @return {?}\n */\nget source(): string { return 'Deprecated since v4'; }\n}\n\nfunction DebugNode_tsickle_Closure_declarations() {\n/** @type {?} */\nDebugNode.prototype.nativeNode;\n/** @type {?} */\nDebugNode.prototype.listeners;\n/** @type {?} */\nDebugNode.prototype.parent;\n/** @type {?} */\nDebugNode.prototype._debugContext;\n}\n\n/**\n * \\@experimental All debugging apis are currently experimental.\n */\nexport class DebugElement extends DebugNode {\n name: string;\n properties: {[key: string]: any};\n attributes: {[key: string]: string | null};\n classes: {[key: string]: boolean};\n styles: {[key: string]: string | null};\n childNodes: DebugNode[];\n nativeElement: any;\n/**\n * @param {?} nativeNode\n * @param {?} parent\n * @param {?} _debugContext\n */\nconstructor(nativeNode: any, parent: any, _debugContext: DebugContext) {\n super(nativeNode, parent, _debugContext);\n this.properties = {};\n this.attributes = {};\n this.classes = {};\n this.styles = {};\n this.childNodes = [];\n this.nativeElement = nativeNode;\n }\n/**\n * @param {?} child\n * @return {?}\n */\naddChild(child: DebugNode) {\n if (child) {\n this.childNodes.push(child);\n child.parent = this;\n }\n }\n/**\n * @param {?} child\n * @return {?}\n */\nremoveChild(child: DebugNode) {\n const /** @type {?} */ childIndex = this.childNodes.indexOf(child);\n if (childIndex !== -1) {\n child.parent = null;\n this.childNodes.splice(childIndex, 1);\n }\n }\n/**\n * @param {?} child\n * @param {?} newChildren\n * @return {?}\n */\ninsertChildrenAfter(child: DebugNode, newChildren: DebugNode[]) {\n const /** @type {?} */ 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.removeChild(c);\n }\n c.parent = this;\n });\n }\n }\n/**\n * @param {?} refChild\n * @param {?} newChild\n * @return {?}\n */\ninsertBefore(refChild: DebugNode, newChild: DebugNode): void {\n const /** @type {?} */ refIndex = this.childNodes.indexOf(refChild);\n if (refIndex === -1) {\n this.addChild(newChild);\n } else {\n if (newChild.parent) {\n newChild.parent.removeChild(newChild);\n }\n newChild.parent = this;\n this.childNodes.splice(refIndex, 0, newChild);\n }\n }\n/**\n * @param {?} predicate\n * @return {?}\n */\nquery(predicate: Predicate): DebugElement {\n const /** @type {?} */ results = this.queryAll(predicate);\n return results[0] || null;\n }\n/**\n * @param {?} predicate\n * @return {?}\n */\nqueryAll(predicate: Predicate): DebugElement[] {\n const /** @type {?} */ matches: DebugElement[] = [];\n _queryElementChildren(this, predicate, matches);\n return matches;\n }\n/**\n * @param {?} predicate\n * @return {?}\n */\nqueryAllNodes(predicate: Predicate): DebugNode[] {\n const /** @type {?} */ matches: DebugNode[] = [];\n _queryNodeChildren(this, predicate, matches);\n return matches;\n }\n/**\n * @return {?}\n */\nget children(): DebugElement[] {\n return /** @type {?} */(( this.childNodes.filter((node) => node instanceof DebugElement) as DebugElement[]));\n }\n/**\n * @param {?} eventName\n * @param {?} eventObj\n * @return {?}\n */\ntriggerEventHandler(eventName: string, eventObj: any) {\n this.listeners.forEach((listener) => {\n if (listener.name == eventName) {\n listener.callback(eventObj);\n }\n });\n }\n}\n\nfunction DebugElement_tsickle_Closure_declarations() {\n/** @type {?} */\nDebugElement.prototype.name;\n/** @type {?} */\nDebugElement.prototype.properties;\n/** @type {?} */\nDebugElement.prototype.attributes;\n/** @type {?} */\nDebugElement.prototype.classes;\n/** @type {?} */\nDebugElement.prototype.styles;\n/** @type {?} */\nDebugElement.prototype.childNodes;\n/** @type {?} */\nDebugElement.prototype.nativeElement;\n}\n\n/**\n * \\@experimental\n * @param {?} debugEls\n * @return {?}\n */\nexport function asNativeElements(debugEls: DebugElement[]): any {\n return debugEls.map((el) => el.nativeElement);\n}\n/**\n * @param {?} element\n * @param {?} predicate\n * @param {?} matches\n * @return {?}\n */\nfunction _queryElementChildren(\n element: DebugElement, predicate: Predicate, matches: DebugElement[]) {\n element.childNodes.forEach(node => {\n if (node instanceof DebugElement) {\n if (predicate(node)) {\n matches.push(node);\n }\n _queryElementChildren(node, predicate, matches);\n }\n });\n}\n/**\n * @param {?} parentNode\n * @param {?} predicate\n * @param {?} matches\n * @return {?}\n */\nfunction _queryNodeChildren(\n parentNode: DebugNode, predicate: Predicate, matches: DebugNode[]) {\n if (parentNode instanceof DebugElement) {\n parentNode.childNodes.forEach(node => {\n if (predicate(node)) {\n matches.push(node);\n }\n if (node instanceof DebugElement) {\n _queryNodeChildren(node, predicate, matches);\n }\n });\n }\n}\n\n// Need to keep the nodes in a global Map so that multiple angular apps are supported.\nconst /** @type {?} */ _nativeNodeToDebugNode = new Map();\n/**\n * \\@experimental\n * @param {?} nativeNode\n * @return {?}\n */\nexport function getDebugNode(nativeNode: any): DebugNode|null {\n return _nativeNodeToDebugNode.get(nativeNode) || null;\n}\n/**\n * @return {?}\n */\nexport function getAllDebugNodes(): DebugNode[] {\n return Array.from(_nativeNodeToDebugNode.values());\n}\n/**\n * @param {?} node\n * @return {?}\n */\nexport function indexDebugNode(node: DebugNode) {\n _nativeNodeToDebugNode.set(node.nativeNode, node);\n}\n/**\n * @param {?} node\n * @return {?}\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 * @experimental All debugging apis are currently experimental.\n */\nexport interface Predicate { (value: T): boolean; }\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source 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 {getSymbolIterator, looseIdentical} from '../util';\n/**\n * @param {?} a\n * @param {?} b\n * @return {?}\n */\nexport function devModeEqual(a: any, b: any): boolean {\n const /** @type {?} */ isListLikeIterableA = isListLikeIterable(a);\n const /** @type {?} */ isListLikeIterableB = isListLikeIterable(b);\n if (isListLikeIterableA && isListLikeIterableB) {\n return areIterablesEqual(a, b, devModeEqual);\n } else {\n const /** @type {?} */ isAObject = a && (typeof a === 'object' || typeof a === 'function');\n const /** @type {?} */ 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 * Indicates that the result of a {\\@link Pipe} transformation has changed even though the\n * reference\n * has not changed.\n * \n * The wrapped value will be unwrapped by change detection, and the unwrapped value will be 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 * \\@stable\n */\nexport class WrappedValue {\n/**\n * @param {?} wrapped\n */\nconstructor(public wrapped: any) {}\n/**\n * @param {?} value\n * @return {?}\n */\nstatic wrap(value: any): WrappedValue { return new WrappedValue(value); }\n}\n\nfunction WrappedValue_tsickle_Closure_declarations() {\n/** @type {?} */\nWrappedValue.prototype.wrapped;\n}\n\n/**\n * Helper class for unwrapping WrappedValue s\n */\nexport class ValueUnwrapper {\npublic hasWrappedValue = false;\n/**\n * @param {?} value\n * @return {?}\n */\nunwrap(value: any): any {\n if (value instanceof WrappedValue) {\n this.hasWrappedValue = true;\n return value.wrapped;\n }\n return value;\n }\n/**\n * @return {?}\n */\nreset() { this.hasWrappedValue = false; }\n}\n\nfunction ValueUnwrapper_tsickle_Closure_declarations() {\n/** @type {?} */\nValueUnwrapper.prototype.hasWrappedValue;\n}\n\n/**\n * Represents a basic change from a previous to a new value.\n * \\@stable\n */\nexport class SimpleChange {\n/**\n * @param {?} previousValue\n * @param {?} currentValue\n * @param {?} firstChange\n */\nconstructor(public previousValue: any,\npublic currentValue: any,\npublic firstChange: boolean) {}\n/**\n * Check whether the new value is the first value assigned.\n * @return {?}\n */\nisFirstChange(): boolean { return this.firstChange; }\n}\n\nfunction SimpleChange_tsickle_Closure_declarations() {\n/** @type {?} */\nSimpleChange.prototype.previousValue;\n/** @type {?} */\nSimpleChange.prototype.currentValue;\n/** @type {?} */\nSimpleChange.prototype.firstChange;\n}\n\n/**\n * @param {?} obj\n * @return {?}\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/**\n * @param {?} a\n * @param {?} b\n * @param {?} comparator\n * @return {?}\n */\nexport function areIterablesEqual(\n a: any, b: any, comparator: (a: any, b: any) => boolean): boolean {\n const /** @type {?} */ iterator1 = a[getSymbolIterator()]();\n const /** @type {?} */ iterator2 = b[getSymbolIterator()]();\n\n while (true) {\n const /** @type {?} */ item1 = iterator1.next();\n const /** @type {?} */ 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/**\n * @param {?} obj\n * @param {?} fn\n * @return {?}\n */\nexport function iterateListLike(obj: any, fn: (p: any) => any) {\n if (Array.isArray(obj)) {\n for (let /** @type {?} */ i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n } else {\n const /** @type {?} */ iterator = obj[getSymbolIterator()]();\n let /** @type {?} */ item: any;\n while (!((item = iterator.next()).done)) {\n fn(item.value);\n }\n }\n}\n/**\n * @param {?} o\n * @return {?}\n */\nexport function isJsObject(o: any): boolean {\n return o !== null && (typeof o === 'function' || typeof o === '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\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isListLikeIterable, iterateListLike} from '../change_detection_util';\nimport {ChangeDetectorRef} from '../change_detector_ref';\n\nimport {IterableChangeRecord, IterableChanges, IterableDiffer, IterableDifferFactory, NgIterable, TrackByFunction} from './iterable_differs';\nexport class DefaultIterableDifferFactory implements IterableDifferFactory {\nconstructor() {}\n/**\n * @param {?} obj\n * @return {?}\n */\nsupports(obj: Object|null|undefined): boolean { return isListLikeIterable(obj); }\n\n create(trackByFn?: TrackByFunction): DefaultIterableDiffer;\n/**\n * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n * @template V\n * @param {?=} cdRefOrTrackBy\n * @param {?=} trackByFn\n * @return {?}\n */\ncreate(cdRefOrTrackBy?: ChangeDetectorRef|TrackByFunction, trackByFn?: TrackByFunction):\n DefaultIterableDiffer {\n return new DefaultIterableDiffer(trackByFn || /** @type {?} */(( >cdRefOrTrackBy)));\n }\n}\n\nconst /** @type {?} */ trackByIdentity = (index: number, item: any) => item;\n/**\n * @deprecated v4.0.0 - Should not be part of public API.\n */\nexport class DefaultIterableDiffer implements IterableDiffer, IterableChanges {\nprivate _length: number = 0;\nprivate _collection: NgIterable|null = null;\nprivate _linkedRecords: _DuplicateMap|null = null;\nprivate _unlinkedRecords: _DuplicateMap|null = null;\nprivate _previousItHead: IterableChangeRecord_|null = null;\nprivate _itHead: IterableChangeRecord_|null = null;\nprivate _itTail: IterableChangeRecord_|null = null;\nprivate _additionsHead: IterableChangeRecord_|null = null;\nprivate _additionsTail: IterableChangeRecord_|null = null;\nprivate _movesHead: IterableChangeRecord_|null = null;\nprivate _movesTail: IterableChangeRecord_|null = null;\nprivate _removalsHead: IterableChangeRecord_|null = null;\nprivate _removalsTail: IterableChangeRecord_|null = null;\nprivate _identityChangesHead: IterableChangeRecord_|null = null;\nprivate _identityChangesTail: IterableChangeRecord_|null = null;\nprivate _trackByFn: TrackByFunction;\n/**\n * @param {?=} trackByFn\n */\nconstructor(trackByFn?: TrackByFunction) { this._trackByFn = trackByFn || trackByIdentity; }\n/**\n * @return {?}\n */\nget collection() { return this._collection; }\n/**\n * @return {?}\n */\nget length(): number { return this._length; }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachItem(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._itHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachOperation(\n fn: (item: IterableChangeRecord, previousIndex: number|null, currentIndex: number|null) =>\n void) {\n let /** @type {?} */ nextIt = this._itHead;\n let /** @type {?} */ nextRemove = this._removalsHead;\n let /** @type {?} */ addRemoveOffset = 0;\n let /** @type {?} */ 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 /** @type {?} */ record: IterableChangeRecord = !nextRemove ||\n nextIt && /** @type {?} */((\n nextIt.currentIndex)) <\n getPreviousIndex(nextRemove, addRemoveOffset, moveOffsets) ? /** @type {?} */((\n nextIt)) :\n nextRemove;\n const /** @type {?} */ adjPreviousIndex = getPreviousIndex(record, addRemoveOffset, moveOffsets);\n const /** @type {?} */ 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 = /** @type {?} */(( nextIt))._next;\n if (record.previousIndex == null) {\n addRemoveOffset++;\n } else {\n // INVARIANT: currentIndex < previousIndex\n if (!moveOffsets) moveOffsets = [];\n const /** @type {?} */ localMovePreviousIndex = adjPreviousIndex - addRemoveOffset;\n const /** @type {?} */ localCurrentIndex = /** @type {?} */(( currentIndex)) - addRemoveOffset;\n if (localMovePreviousIndex != localCurrentIndex) {\n for (let /** @type {?} */ i = 0; i < localMovePreviousIndex; i++) {\n const /** @type {?} */ offset = i < moveOffsets.length ? moveOffsets[i] : (moveOffsets[i] = 0);\n const /** @type {?} */ index = offset + i;\n if (localCurrentIndex <= index && index < localMovePreviousIndex) {\n moveOffsets[i] = offset + 1;\n }\n }\n const /** @type {?} */ 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 * @param {?} fn\n * @return {?}\n */\nforEachPreviousItem(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._previousItHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachAddedItem(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachMovedItem(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._movesHead; record !== null; record = record._nextMoved) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachRemovedItem(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachIdentityChange(fn: (record: IterableChangeRecord_) => void) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._identityChangesHead; record !== null; record = record._nextIdentityChange) {\n fn(record);\n }\n }\n/**\n * @param {?} collection\n * @return {?}\n */\ndiff(collection: NgIterable): DefaultIterableDiffer|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 * @return {?}\n */\nonDestroy() {}\n/**\n * @param {?} collection\n * @return {?}\n */\ncheck(collection: NgIterable): boolean {\n this._reset();\n\n let /** @type {?} */ record: IterableChangeRecord_|null = this._itHead;\n let /** @type {?} */ mayBeDirty: boolean = false;\n let /** @type {?} */ index: number;\n let /** @type {?} */ item: V;\n let /** @type {?} */ itemTrackBy: any;\n if (Array.isArray(collection)) {\n this._length = collection.length;\n\n for (let /** @type {?} */ 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._length = index;\n }\n\n this._truncate(record);\n this._collection = collection;\n return this.isDirty;\n }\n/**\n * @return {?}\n */\nget isDirty(): boolean {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\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 * @return {?}\n */\n_reset() {\n if (this.isDirty) {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n let /** @type {?} */ nextRecord: IterableChangeRecord_|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 * 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 * @param {?} record\n * @param {?} item\n * @param {?} itemTrackBy\n * @param {?} index\n * @return {?}\n */\n_mismatch(record: IterableChangeRecord_|null, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_ {\n // The previous record after which we will append the current one.\n let /** @type {?} */ previousRecord: IterableChangeRecord_|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_(item, itemTrackBy), previousRecord, index);\n }\n }\n return record;\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 * @param {?} record\n * @param {?} item\n * @param {?} itemTrackBy\n * @param {?} index\n * @return {?}\n */\n_verifyReinsertion(record: IterableChangeRecord_, item: V, itemTrackBy: any, index: number):\n IterableChangeRecord_ {\n let /** @type {?} */ reinsertRecord: IterableChangeRecord_|null =\n this._unlinkedRecords === null ? null : this._unlinkedRecords.get(itemTrackBy, null);\n if (reinsertRecord !== null) {\n record = this._reinsertAfter(reinsertRecord, /** @type {?} */(( 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 * Get rid of any excess {\\@link IterableChangeRecord_}s from the previous collection\n * \n * - `record` The first excess {\\@link IterableChangeRecord_}.\n * \n * \\@internal\n * @param {?} record\n * @return {?}\n */\n_truncate(record: IterableChangeRecord_|null) {\n // Anything after that needs to be removed;\n while (record !== null) {\n const /** @type {?} */ nextRecord: IterableChangeRecord_|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 * @param {?} record\n * @param {?} prevRecord\n * @param {?} index\n * @return {?}\n */\n_reinsertAfter(\n record: IterableChangeRecord_, prevRecord: IterableChangeRecord_|null,\n index: number): IterableChangeRecord_ {\n if (this._unlinkedRecords !== null) {\n this._unlinkedRecords.remove(record);\n }\n const /** @type {?} */ prev = record._prevRemoved;\n const /** @type {?} */ 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 * @param {?} record\n * @param {?} prevRecord\n * @param {?} index\n * @return {?}\n */\n_moveAfter(\n record: IterableChangeRecord_, prevRecord: IterableChangeRecord_|null,\n index: number): IterableChangeRecord_ {\n this._unlink(record);\n this._insertAfter(record, prevRecord, index);\n this._addToMoves(record, index);\n return record;\n }\n/**\n * \\@internal\n * @param {?} record\n * @param {?} prevRecord\n * @param {?} index\n * @return {?}\n */\n_addAfter(\n record: IterableChangeRecord_, prevRecord: IterableChangeRecord_|null,\n index: number): IterableChangeRecord_ {\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 * @param {?} record\n * @param {?} prevRecord\n * @param {?} index\n * @return {?}\n */\n_insertAfter(\n record: IterableChangeRecord_, prevRecord: IterableChangeRecord_|null,\n index: number): IterableChangeRecord_ {\n // todo(vicb)\n // assert(record != prevRecord);\n // assert(record._next === null);\n // assert(record._prev === null);\n\n const /** @type {?} */ next: IterableChangeRecord_|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();\n }\n this._linkedRecords.put(record);\n\n record.currentIndex = index;\n return record;\n }\n/**\n * \\@internal\n * @param {?} record\n * @return {?}\n */\n_remove(record: IterableChangeRecord_): IterableChangeRecord_ {\n return this._addToRemovals(this._unlink(record));\n }\n/**\n * \\@internal\n * @param {?} record\n * @return {?}\n */\n_unlink(record: IterableChangeRecord_): IterableChangeRecord_ {\n if (this._linkedRecords !== null) {\n this._linkedRecords.remove(record);\n }\n\n const /** @type {?} */ prev = record._prev;\n const /** @type {?} */ 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 * @param {?} record\n * @param {?} toIndex\n * @return {?}\n */\n_addToMoves(record: IterableChangeRecord_, toIndex: number): IterableChangeRecord_ {\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 * @param {?} record\n * @return {?}\n */\nprivate _addToRemovals(record: IterableChangeRecord_): IterableChangeRecord_ {\n if (this._unlinkedRecords === null) {\n this._unlinkedRecords = new _DuplicateMap();\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 * @param {?} record\n * @param {?} item\n * @return {?}\n */\n_addIdentityChange(record: IterableChangeRecord_, 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 * @return {?}\n */\ntoString(): string {\n const /** @type {?} */ list: IterableChangeRecord_[] = [];\n this.forEachItem((record: IterableChangeRecord_) => list.push(record));\n\n const /** @type {?} */ previous: IterableChangeRecord_[] = [];\n this.forEachPreviousItem((record: IterableChangeRecord_) => previous.push(record));\n\n const /** @type {?} */ additions: IterableChangeRecord_[] = [];\n this.forEachAddedItem((record: IterableChangeRecord_) => additions.push(record));\n\n const /** @type {?} */ moves: IterableChangeRecord_[] = [];\n this.forEachMovedItem((record: IterableChangeRecord_) => moves.push(record));\n\n const /** @type {?} */ removals: IterableChangeRecord_[] = [];\n this.forEachRemovedItem((record: IterableChangeRecord_) => removals.push(record));\n\n const /** @type {?} */ identityChanges: IterableChangeRecord_[] = [];\n this.forEachIdentityChange((record: IterableChangeRecord_) => identityChanges.push(record));\n\n return 'collection: ' + list.join(', ') + '\\n' +\n 'previous: ' + previous.join(', ') + '\\n' +\n 'additions: ' + additions.join(', ') + '\\n' +\n 'moves: ' + moves.join(', ') + '\\n' +\n 'removals: ' + removals.join(', ') + '\\n' +\n 'identityChanges: ' + identityChanges.join(', ') + '\\n';\n }\n}\n\nfunction DefaultIterableDiffer_tsickle_Closure_declarations() {\n/** @type {?} */\nDefaultIterableDiffer.prototype._length;\n/** @type {?} */\nDefaultIterableDiffer.prototype._collection;\n/** @type {?} */\nDefaultIterableDiffer.prototype._linkedRecords;\n/** @type {?} */\nDefaultIterableDiffer.prototype._unlinkedRecords;\n/** @type {?} */\nDefaultIterableDiffer.prototype._previousItHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._itHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._itTail;\n/** @type {?} */\nDefaultIterableDiffer.prototype._additionsHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._additionsTail;\n/** @type {?} */\nDefaultIterableDiffer.prototype._movesHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._movesTail;\n/** @type {?} */\nDefaultIterableDiffer.prototype._removalsHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._removalsTail;\n/** @type {?} */\nDefaultIterableDiffer.prototype._identityChangesHead;\n/** @type {?} */\nDefaultIterableDiffer.prototype._identityChangesTail;\n/** @type {?} */\nDefaultIterableDiffer.prototype._trackByFn;\n}\n\n/**\n * \\@stable\n */\nexport class IterableChangeRecord_ implements IterableChangeRecord {\n currentIndex: number|null = null;\n previousIndex: number|null = null;\n/**\n * \\@internal\n */\n_nextPrevious: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_prev: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_next: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_prevDup: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextDup: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_prevRemoved: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextRemoved: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextAdded: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextMoved: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextIdentityChange: IterableChangeRecord_|null = null;\n/**\n * @param {?} item\n * @param {?} trackById\n */\nconstructor(public item: V,\npublic trackById: any) {}\n/**\n * @return {?}\n */\ntoString(): string {\n return this.previousIndex === this.currentIndex ? stringify(this.item) :\n stringify(this.item) + '[' +\n stringify(this.previousIndex) + '->' + stringify(this.currentIndex) + ']';\n }\n}\n\nfunction IterableChangeRecord__tsickle_Closure_declarations() {\n/** @type {?} */\nIterableChangeRecord_.prototype.currentIndex;\n/** @type {?} */\nIterableChangeRecord_.prototype.previousIndex;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextPrevious;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._prev;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._next;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._prevDup;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextDup;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._prevRemoved;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextRemoved;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextAdded;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextMoved;\n/**\n * \\@internal\n * @type {?}\n */\nIterableChangeRecord_.prototype._nextIdentityChange;\n/** @type {?} */\nIterableChangeRecord_.prototype.item;\n/** @type {?} */\nIterableChangeRecord_.prototype.trackById;\n}\n\nclass _DuplicateItemRecordList {\n/**\n * \\@internal\n */\n_head: IterableChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_tail: IterableChangeRecord_|null = null;\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 * @param {?} record\n * @return {?}\n */\nadd(record: IterableChangeRecord_): void {\n if (this._head === null) {\n this._head = this._tail = record;\n record._nextDup = null;\n record._prevDup = null;\n } else { /** @type {?} */((\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 * @param {?} trackById\n * @param {?} atOrAfterIndex\n * @return {?}\n */\nget(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_|null {\n let /** @type {?} */ record: IterableChangeRecord_|null;\n for (record = this._head; record !== null; record = record._nextDup) {\n if ((atOrAfterIndex === null || atOrAfterIndex <= /** @type {?} */(( record.currentIndex))) &&\n looseIdentical(record.trackById, trackById)) {\n return record;\n }\n }\n return null;\n }\n/**\n * Remove one {\\@link IterableChangeRecord_} from the list of duplicates.\n * \n * Returns whether the list of duplicates is empty.\n * @param {?} record\n * @return {?}\n */\nremove(record: IterableChangeRecord_): 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 /** @type {?} */ prev: IterableChangeRecord_|null = record._prevDup;\n const /** @type {?} */ next: IterableChangeRecord_|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\nfunction _DuplicateItemRecordList_tsickle_Closure_declarations() {\n/**\n * \\@internal\n * @type {?}\n */\n_DuplicateItemRecordList.prototype._head;\n/**\n * \\@internal\n * @type {?}\n */\n_DuplicateItemRecordList.prototype._tail;\n}\n\nclass _DuplicateMap {\n map = new Map>();\n/**\n * @param {?} record\n * @return {?}\n */\nput(record: IterableChangeRecord_) {\n const /** @type {?} */ key = record.trackById;\n\n let /** @type {?} */ duplicates = this.map.get(key);\n if (!duplicates) {\n duplicates = new _DuplicateItemRecordList();\n this.map.set(key, duplicates);\n }\n duplicates.add(record);\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 * @param {?} trackById\n * @param {?} atOrAfterIndex\n * @return {?}\n */\nget(trackById: any, atOrAfterIndex: number|null): IterableChangeRecord_|null {\n const /** @type {?} */ key = trackById;\n const /** @type {?} */ recordList = this.map.get(key);\n return recordList ? recordList.get(trackById, atOrAfterIndex) : null;\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 * @param {?} record\n * @return {?}\n */\nremove(record: IterableChangeRecord_): IterableChangeRecord_ {\n const /** @type {?} */ key = record.trackById;\n const /** @type {?} */ recordList: _DuplicateItemRecordList = /** @type {?} */(( 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 * @return {?}\n */\nget isEmpty(): boolean { return this.map.size === 0; }\n/**\n * @return {?}\n */\nclear() { this.map.clear(); }\n/**\n * @return {?}\n */\ntoString(): string { return '_DuplicateMap(' + stringify(this.map) + ')'; }\n}\n\nfunction _DuplicateMap_tsickle_Closure_declarations() {\n/** @type {?} */\n_DuplicateMap.prototype.map;\n}\n\n/**\n * @param {?} item\n * @param {?} addRemoveOffset\n * @param {?} moveOffsets\n * @return {?}\n */\nfunction getPreviousIndex(\n item: any, addRemoveOffset: number, moveOffsets: number[] | null): number {\n const /** @type {?} */ previousIndex = item.previousIndex;\n if (previousIndex === null) return previousIndex;\n let /** @type {?} */ 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\n\nimport {looseIdentical, stringify} from '../../util';\nimport {isJsObject} from '../change_detection_util';\nimport {ChangeDetectorRef} from '../change_detector_ref';\nimport {KeyValueChangeRecord, KeyValueChanges, KeyValueDiffer, KeyValueDifferFactory} from './keyvalue_differs';\nexport class DefaultKeyValueDifferFactory implements KeyValueDifferFactory {\nconstructor() {}\n/**\n * @param {?} obj\n * @return {?}\n */\nsupports(obj: any): boolean { return obj instanceof Map || isJsObject(obj); }\n\n create(): DefaultKeyValueDiffer;\n/**\n * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n * @template K, V\n * @param {?=} cd\n * @return {?}\n */\ncreate(cd?: ChangeDetectorRef): KeyValueDiffer {\n return new DefaultKeyValueDiffer();\n }\n}\nexport class DefaultKeyValueDiffer implements KeyValueDiffer, KeyValueChanges {\nprivate _records = new Map>();\nprivate _mapHead: KeyValueChangeRecord_|null = null;\nprivate _appendAfter: KeyValueChangeRecord_|null = null;\nprivate _previousMapHead: KeyValueChangeRecord_|null = null;\nprivate _changesHead: KeyValueChangeRecord_|null = null;\nprivate _changesTail: KeyValueChangeRecord_|null = null;\nprivate _additionsHead: KeyValueChangeRecord_|null = null;\nprivate _additionsTail: KeyValueChangeRecord_|null = null;\nprivate _removalsHead: KeyValueChangeRecord_|null = null;\nprivate _removalsTail: KeyValueChangeRecord_|null = null;\n/**\n * @return {?}\n */\nget isDirty(): boolean {\n return this._additionsHead !== null || this._changesHead !== null ||\n this._removalsHead !== null;\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachItem(fn: (r: KeyValueChangeRecord) => void) {\n let /** @type {?} */ record: KeyValueChangeRecord_|null;\n for (record = this._mapHead; record !== null; record = record._next) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachPreviousItem(fn: (r: KeyValueChangeRecord) => void) {\n let /** @type {?} */ record: KeyValueChangeRecord_|null;\n for (record = this._previousMapHead; record !== null; record = record._nextPrevious) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachChangedItem(fn: (r: KeyValueChangeRecord) => void) {\n let /** @type {?} */ record: KeyValueChangeRecord_|null;\n for (record = this._changesHead; record !== null; record = record._nextChanged) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachAddedItem(fn: (r: KeyValueChangeRecord) => void) {\n let /** @type {?} */ record: KeyValueChangeRecord_|null;\n for (record = this._additionsHead; record !== null; record = record._nextAdded) {\n fn(record);\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nforEachRemovedItem(fn: (r: KeyValueChangeRecord) => void) {\n let /** @type {?} */ record: KeyValueChangeRecord_|null;\n for (record = this._removalsHead; record !== null; record = record._nextRemoved) {\n fn(record);\n }\n }\n/**\n * @param {?=} map\n * @return {?}\n */\ndiff(map?: Map|{[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 * @return {?}\n */\nonDestroy() {}\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 * @param {?} map\n * @return {?}\n */\ncheck(map: Map|{[k: string]: any}): boolean {\n this._reset();\n\n let /** @type {?} */ 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 /** @type {?} */ 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 /** @type {?} */ record: KeyValueChangeRecord_|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 * 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 * @param {?} before\n * @param {?} record\n * @return {?}\n */\nprivate _insertBeforeOrAppend(\n before: KeyValueChangeRecord_|null,\n record: KeyValueChangeRecord_): KeyValueChangeRecord_|null {\n if (before) {\n const /** @type {?} */ 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 * @param {?} key\n * @param {?} value\n * @return {?}\n */\nprivate _getOrCreateRecordForKey(key: K, value: V): KeyValueChangeRecord_ {\n if (this._records.has(key)) {\n const /** @type {?} */ record = /** @type {?} */(( this._records.get(key)));\n this._maybeAddToChanges(record, value);\n const /** @type {?} */ prev = record._prev;\n const /** @type {?} */ 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 /** @type {?} */ record = new KeyValueChangeRecord_(key);\n this._records.set(key, record);\n record.currentValue = value;\n this._addToAdditions(record);\n return record;\n }\n/**\n * \\@internal\n * @return {?}\n */\n_reset() {\n if (this.isDirty) {\n let /** @type {?} */ record: KeyValueChangeRecord_|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 * @param {?} record\n * @param {?} newValue\n * @return {?}\n */\nprivate _maybeAddToChanges(record: KeyValueChangeRecord_, 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 * @param {?} record\n * @return {?}\n */\nprivate _addToAdditions(record: KeyValueChangeRecord_) {\n if (this._additionsHead === null) {\n this._additionsHead = this._additionsTail = record;\n } else { /** @type {?} */((\n this._additionsTail))._nextAdded = record;\n this._additionsTail = record;\n }\n }\n/**\n * @param {?} record\n * @return {?}\n */\nprivate _addToChanges(record: KeyValueChangeRecord_) {\n if (this._changesHead === null) {\n this._changesHead = this._changesTail = record;\n } else { /** @type {?} */((\n this._changesTail))._nextChanged = record;\n this._changesTail = record;\n }\n }\n/**\n * \\@internal\n * @template K, V\n * @param {?} obj\n * @param {?} fn\n * @return {?}\n */\nprivate _forEach(obj: Map|{[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\nfunction DefaultKeyValueDiffer_tsickle_Closure_declarations() {\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._records;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._mapHead;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._appendAfter;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._previousMapHead;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._changesHead;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._changesTail;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._additionsHead;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._additionsTail;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._removalsHead;\n/** @type {?} */\nDefaultKeyValueDiffer.prototype._removalsTail;\n}\n\n/**\n * \\@stable\n */\nclass KeyValueChangeRecord_ implements KeyValueChangeRecord {\n previousValue: V|null = null;\n currentValue: V|null = null;\n/**\n * \\@internal\n */\n_nextPrevious: KeyValueChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_next: KeyValueChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_prev: KeyValueChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextAdded: KeyValueChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextRemoved: KeyValueChangeRecord_|null = null;\n/**\n * \\@internal\n */\n_nextChanged: KeyValueChangeRecord_|null = null;\n/**\n * @param {?} key\n */\nconstructor(public key: K) {}\n}\n\nfunction KeyValueChangeRecord__tsickle_Closure_declarations() {\n/** @type {?} */\nKeyValueChangeRecord_.prototype.previousValue;\n/** @type {?} */\nKeyValueChangeRecord_.prototype.currentValue;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._nextPrevious;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._next;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._prev;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._nextAdded;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._nextRemoved;\n/**\n * \\@internal\n * @type {?}\n */\nKeyValueChangeRecord_.prototype._nextChanged;\n/** @type {?} */\nKeyValueChangeRecord_.prototype.key;\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 {Optional, Provider, SkipSelf} from '../../di';\nimport {ChangeDetectorRef} from '../change_detector_ref';\n\n/**\n * A type describing supported iterable types.\n *\n * @stable\n */\nexport type NgIterable = Array| Iterable;\n\n/**\n * A strategy for tracking changes over time to an iterable. Used by {@link NgFor} to\n * respond to changes in an iterable by effecting equivalent changes in the DOM.\n *\n * @stable\n */\nexport interface IterableDiffer {\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): IterableChanges|null;\n}\n\n/**\n * An object describing the changes in the `Iterable` collection since last time\n * `IterableDiffer#diff()` was invoked.\n *\n * @stable\n */\nexport interface IterableChanges {\n /**\n * Iterate over all changes. `IterableChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (record: IterableChangeRecord) => 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: (record: IterableChangeRecord, previousIndex: number, currentIndex: number) => void):\n 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) => void): void;\n\n /** Iterate over all added items. */\n forEachAddedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all moved items. */\n forEachMovedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all removed items. */\n forEachRemovedItem(fn: (record: IterableChangeRecord) => void): void;\n\n /** Iterate over all items which had their identity (as computed by the `trackByFn`) changed. */\n forEachIdentityChange(fn: (record: IterableChangeRecord) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @stable\n */\nexport interface IterableChangeRecord {\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 `trackByFn`. */\n readonly trackById: any;\n}\n\n/**\n * @deprecated v4.0.0 - Use IterableChangeRecord instead.\n */\nexport interface CollectionChangeRecord extends IterableChangeRecord {}\n\n\n/**\n * Nolonger used.\n *\n * @deprecated v4.0.0 - Use TrackByFunction instead\n */\nexport interface TrackByFn { (index: number, item: any): any; }\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 * @stable\n */\nexport interface TrackByFunction { (index: number, item: T): any; }\n\n/**\n * Provides a factory for {@link IterableDiffer}.\n *\n * @stable\n */\nexport interface IterableDifferFactory {\n supports(objects: any): boolean;\n create(trackByFn?: TrackByFunction): IterableDiffer;\n\n /**\n * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n */\n create(_cdr?: ChangeDetectorRef|TrackByFunction, trackByFn?: TrackByFunction):\n IterableDiffer;\n}\n/**\n * A repository of different iterable diffing strategies used by NgFor, NgClass, and others.\n * \\@stable\n */\nexport class IterableDiffers {\n/**\n * @deprecated v4.0.0 - Should be private\n */\nfactories: IterableDifferFactory[];\n/**\n * @param {?} factories\n */\nconstructor(factories: IterableDifferFactory[]) { this.factories = factories; }\n/**\n * @param {?} factories\n * @param {?=} parent\n * @return {?}\n */\nstatic create(factories: IterableDifferFactory[], parent?: IterableDiffers): IterableDiffers {\n if (parent != null) {\n const /** @type {?} */ copied = parent.factories.slice();\n factories = factories.concat(copied);\n return new IterableDiffers(factories);\n } else {\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 * 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 * ### Example\n * \n * ```\n * \\@Component({ \n * viewProviders: [\n * IterableDiffers.extend([new ImmutableListDiffer()])\n * ]\n * })\n * ```\n * @param {?} factories\n * @return {?}\n */\nstatic extend(factories: IterableDifferFactory[]): Provider {\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 * @param {?} iterable\n * @return {?}\n */\nfind(iterable: any): IterableDifferFactory {\n const /** @type {?} */ 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\nfunction IterableDiffers_tsickle_Closure_declarations() {\n/**\n * @deprecated v4.0.0 - Should be private\n * @type {?}\n */\nIterableDiffers.prototype.factories;\n}\n\n/**\n * @param {?} type\n * @return {?}\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\n\nimport {Optional, Provider, SkipSelf} from '../../di';\nimport {ChangeDetectorRef} from '../change_detector_ref';\n\n\n\n/**\n * A differ that tracks changes made to an object over time.\n *\n * @stable\n */\nexport interface KeyValueDiffer {\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): KeyValueChanges;\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;\n // TODO(TS2.1): diff(this: KeyValueDiffer, object: Record):\n // KeyValueDiffer;\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 * @stable\n */\nexport interface KeyValueChanges {\n /**\n * Iterate over all changes. `KeyValueChangeRecord` will contain information about changes\n * to each item.\n */\n forEachItem(fn: (r: KeyValueChangeRecord) => 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) => void): void;\n\n /**\n * Iterate over all keys for which values have changed.\n */\n forEachChangedItem(fn: (r: KeyValueChangeRecord) => void): void;\n\n /**\n * Iterate over all added items.\n */\n forEachAddedItem(fn: (r: KeyValueChangeRecord) => void): void;\n\n /**\n * Iterate over all removed items.\n */\n forEachRemovedItem(fn: (r: KeyValueChangeRecord) => void): void;\n}\n\n/**\n * Record representing the item change information.\n *\n * @stable\n */\nexport interface KeyValueChangeRecord {\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 * @stable\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(): KeyValueDiffer;\n\n /**\n * @deprecated v4.0.0 - ChangeDetectorRef is not used and is no longer a parameter\n */\n create(_cdr?: ChangeDetectorRef): KeyValueDiffer;\n}\n/**\n * A repository of different Map diffing strategies used by NgClass, NgStyle, and others.\n * \\@stable\n */\nexport class KeyValueDiffers {\n/**\n * @deprecated v4.0.0 - Should be private.\n */\nfactories: KeyValueDifferFactory[];\n/**\n * @param {?} factories\n */\nconstructor(factories: KeyValueDifferFactory[]) { this.factories = factories; }\n/**\n * @template S\n * @param {?} factories\n * @param {?=} parent\n * @return {?}\n */\nstatic create(factories: KeyValueDifferFactory[], parent?: KeyValueDiffers): KeyValueDiffers {\n if (parent) {\n const /** @type {?} */ copied = parent.factories.slice();\n factories = factories.concat(copied);\n }\n return new KeyValueDiffers(factories);\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 * 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 * ### Example\n * \n * ```\n * \\@Component({ \n * viewProviders: [\n * KeyValueDiffers.extend([new ImmutableMapDiffer()])\n * ]\n * })\n * ```\n * @template S\n * @param {?} factories\n * @return {?}\n */\nstatic extend(factories: KeyValueDifferFactory[]): Provider {\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 * @param {?} kv\n * @return {?}\n */\nfind(kv: any): KeyValueDifferFactory {\n const /** @type {?} */ 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\nfunction KeyValueDiffers_tsickle_Closure_declarations() {\n/**\n * @deprecated v4.0.0 - Should be private.\n * @type {?}\n */\nKeyValueDiffers.prototype.factories;\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 {InjectionToken} from '../di/injection_token';\n/**\n * \\@experimental i18n support is experimental.\n */\nexport const LOCALE_ID = new InjectionToken('LocaleId');\n/**\n * \\@experimental i18n support is experimental.\n */\nexport const TRANSLATIONS = new InjectionToken('Translations');\n/**\n * \\@experimental i18n support is experimental.\n */\nexport const TRANSLATIONS_FORMAT = new InjectionToken('TranslationsFormat');\nexport type MissingTranslationStrategy = number;\nexport let MissingTranslationStrategy: any = {};\nMissingTranslationStrategy.Error = 0;\nMissingTranslationStrategy.Warning = 1;\nMissingTranslationStrategy.Ignore = 2;\nMissingTranslationStrategy[MissingTranslationStrategy.Error] = \"Error\";\nMissingTranslationStrategy[MissingTranslationStrategy.Warning] = \"Warning\";\nMissingTranslationStrategy[MissingTranslationStrategy.Ignore] = \"Ignore\";\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 {ApplicationInitStatus} from './application_init';\nimport {ApplicationRef, ApplicationRef_} from './application_ref';\nimport {APP_ID_RANDOM_PROVIDER} from './application_tokens';\nimport {IterableDiffers, KeyValueDiffers, defaultIterableDiffers, defaultKeyValueDiffers} from './change_detection/change_detection';\nimport {Inject, Optional, SkipSelf} from './di/metadata';\nimport {LOCALE_ID} from './i18n/tokens';\nimport {Compiler} from './linker/compiler';\nimport {NgModule} from './metadata';\n/**\n * @return {?}\n */\nexport function _iterableDiffersFactory() {\n return defaultIterableDiffers;\n}\n/**\n * @return {?}\n */\nexport function _keyValueDiffersFactory() {\n return defaultKeyValueDiffers;\n}\n/**\n * @param {?=} locale\n * @return {?}\n */\nexport function _localeFactory(locale?: string): string {\n return locale || 'en-US';\n}\n/**\n * This module includes the providers of \\@angular/core that are needed\n * to bootstrap components via `ApplicationRef`.\n * \n * \\@experimental\n */\nexport class ApplicationModule {\n/**\n * @param {?} appRef\n */\nconstructor(appRef: ApplicationRef) {}\nstatic decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n providers: [\n ApplicationRef_,\n {provide: ApplicationRef, useExisting: ApplicationRef_},\n ApplicationInitStatus,\n Compiler,\n APP_ID_RANDOM_PROVIDER,\n {provide: IterableDiffers, useFactory: _iterableDiffersFactory},\n {provide: KeyValueDiffers, useFactory: _keyValueDiffersFactory},\n {\n provide: LOCALE_ID,\n useFactory: _localeFactory,\n deps: [[new Inject(LOCALE_ID), new Optional(), new SkipSelf()]]\n },\n ]\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ApplicationRef, },\n];\n}\n\nfunction ApplicationModule_tsickle_Closure_declarations() {\n/** @type {?} */\nApplicationModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nApplicationModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","\nexport type SecurityContext = number;\nexport let SecurityContext: any = {};\nSecurityContext.NONE = 0;\nSecurityContext.HTML = 1;\nSecurityContext.STYLE = 2;\nSecurityContext.SCRIPT = 3;\nSecurityContext.URL = 4;\nSecurityContext.RESOURCE_URL = 5;\nSecurityContext[SecurityContext.NONE] = \"NONE\";\nSecurityContext[SecurityContext.HTML] = \"HTML\";\nSecurityContext[SecurityContext.STYLE] = \"STYLE\";\nSecurityContext[SecurityContext.SCRIPT] = \"SCRIPT\";\nSecurityContext[SecurityContext.URL] = \"URL\";\nSecurityContext[SecurityContext.RESOURCE_URL] = \"RESOURCE_URL\";\n\n/**\n * Sanitizer is used by the views to sanitize potentially dangerous values.\n * \n * \\@stable\n * @abstract\n */\nexport abstract class Sanitizer {\n/**\n * @abstract\n * @param {?} context\n * @param {?} value\n * @return {?}\n */\nsanitize(context: SecurityContext, value: {}|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\nimport {Injector} from '../di';\nimport {ErrorHandler} from '../error_handler';\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 '../security';\nimport {Type} from '../type';\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> { (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> { factory: DF|null; }\n\nexport interface NgModuleDefinition extends Definition {\n providers: NgModuleProviderDef[];\n providersByKey: {[tokenKey: string]: NgModuleProviderDef};\n}\n\nexport interface NgModuleDefinitionFactory extends DefinitionFactory {}\n\nexport interface ViewDefinition extends Definition {\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 {}\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, Dynamic}\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 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,\n RenderElement,\n TemplateRef,\n ViewContainerRef,\n Provider\n}\n\nexport interface ElementDef {\n // set to null for ``\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 Value = 2 << 2,\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, All}\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 {\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}\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 CatDetectChanges = Attached | ChecksEnabled,\n CatInit = BeforeFirstCheck | CatDetectChanges\n}\n\nexport interface DisposableFn { (): void; }\n/**\n * Node instance data.\n * \n * We have a separate type per NodeType to save memory\n * (TextData | ElementData | ProviderData | PureExpressionData | QueryList)\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 {\nprivate __brand: any; }\n\nfunction NodeData_tsickle_Closure_declarations() {\n/** @type {?} */\nNodeData.prototype.__brand;\n}\n\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 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function asTextData(view: ViewData, index: number): TextData {\n return /** @type {?} */(( 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 {\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 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function asElementData(view: ViewData, index: number): ElementData {\n return /** @type {?} */(( 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 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function asProviderData(view: ViewData, index: number): ProviderData {\n return /** @type {?} */(( 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 * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function asPureExpressionData(view: ViewData, index: number): PureExpressionData {\n return /** @type {?} */(( view.nodes[index]));\n}\n/**\n * Accessor for view.nodes, enforcing that every usage site stays monomorphic.\n * @param {?} view\n * @param {?} index\n * @return {?}\n */\nexport function asQueryList(view: ViewData, index: number): QueryList {\n return /** @type {?} */(( view.nodes[index]));\n}\n\nexport interface RootData {\n injector: Injector;\n ngModule: NgModuleRef;\n projectableNodes: any[][];\n selectorOrNode: any;\n renderer: Renderer2;\n rendererFactory: RendererFactory2;\n errorHandler: ErrorHandler;\n sanitizer: Sanitizer;\n}\n/**\n * @abstract\n */\nexport abstract class DebugContext {\n/**\n * @abstract\n * @return {?}\n */\nview() {}\n/**\n * @abstract\n * @return {?}\n */\nnodeIndex() {}\n/**\n * @abstract\n * @return {?}\n */\ninjector() {}\n/**\n * @abstract\n * @return {?}\n */\ncomponent() {}\n/**\n * @abstract\n * @return {?}\n */\nproviderTokens() {}\n/**\n * @abstract\n * @return {?}\n */\nreferences() {}\n/**\n * @abstract\n * @return {?}\n */\ncontext() {}\n/**\n * @abstract\n * @return {?}\n */\ncomponentRenderElement() {}\n/**\n * @abstract\n * @return {?}\n */\nrenderNode() {}\n/**\n * @abstract\n * @param {?} console\n * @param {...?} values\n * @return {?}\n */\nlogError(console: Console, ...values: any[]) {}\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, 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, parent: Injector, bootstrapComponents: Type[],\n def: NgModuleDefinition): NgModuleRef;\n overrideProvider(override: ProviderOverride): void;\n clearProviderOverrides(): 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 * 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 clearProviderOverrides: 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\n\nimport {ERROR_DEBUG_CONTEXT, ERROR_LOGGER, getDebugContext} from '../errors';\nimport {DebugContext, ViewState} from './types';\n/**\n * @param {?} context\n * @param {?} oldValue\n * @param {?} currValue\n * @param {?} isFirstCheck\n * @return {?}\n */\nexport function expressionChangedAfterItHasBeenCheckedError(\n context: DebugContext, oldValue: any, currValue: any, isFirstCheck: boolean): Error {\n let /** @type {?} */ 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/**\n * @param {?} err\n * @param {?} context\n * @return {?}\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/**\n * @param {?} msg\n * @param {?} context\n * @return {?}\n */\nexport function viewDebugError(msg: string, context: DebugContext): Error {\n const /** @type {?} */ err = new Error(msg);\n _addDebugContext(err, context);\n return err;\n}\n/**\n * @param {?} err\n * @param {?} context\n * @return {?}\n */\nfunction _addDebugContext(err: Error, context: DebugContext) {\n ( /** @type {?} */((err as any)))[ERROR_DEBUG_CONTEXT] = context;\n ( /** @type {?} */((err as any)))[ERROR_LOGGER] = context.logError.bind(context);\n}\n/**\n * @param {?} err\n * @return {?}\n */\nexport function isViewDebugError(err: Error): boolean {\n return !!getDebugContext(err);\n}\n/**\n * @param {?} action\n * @return {?}\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\n\nimport {WrappedValue, devModeEqual} from '../change_detection/change_detection';\nimport {ViewEncapsulation} from '../metadata/view';\nimport {RendererType2} from '../render/api';\nimport {looseIdentical, stringify} from '../util';\n\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 /** @type {?} */ NOOP: any = () => {};\n\nconst /** @type {?} */ _tokenKeyCache = new Map();\n/**\n * @param {?} token\n * @return {?}\n */\nexport function tokenKey(token: any): string {\n let /** @type {?} */ key = _tokenKeyCache.get(token);\n if (!key) {\n key = stringify(token) + '_' + _tokenKeyCache.size;\n _tokenKeyCache.set(token, key);\n }\n return key;\n}\n/**\n * @param {?} view\n * @param {?} nodeIdx\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nexport function unwrapValue(view: ViewData, nodeIdx: number, bindingIdx: number, value: any): any {\n if (value instanceof WrappedValue) {\n value = value.wrapped;\n let /** @type {?} */ globalBindingIdx = view.def.nodes[nodeIdx].bindingIndex + bindingIdx;\n let /** @type {?} */ oldValue = view.oldValues[globalBindingIdx];\n if (oldValue instanceof WrappedValue) {\n oldValue = oldValue.wrapped;\n }\n view.oldValues[globalBindingIdx] = new WrappedValue(oldValue);\n }\n return value;\n}\n\nconst /** @type {?} */ UNDEFINED_RENDERER_TYPE_ID = '$$undefined';\nconst /** @type {?} */ EMPTY_RENDERER_TYPE_ID = '$$empty';\n/**\n * @param {?} values\n * @return {?}\n */\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 /** @type {?} */ _renderCompCount = 0;\n/**\n * @param {?=} type\n * @return {?}\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 /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nexport function checkBinding(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any): boolean {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\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/**\n * @param {?} view\n * @param {?} def\n * @param {?} bindingIdx\n * @param {?} value\n * @return {?}\n */\nexport function checkBindingNoChanges(\n view: ViewData, def: NodeDef, bindingIdx: number, value: any) {\n const /** @type {?} */ oldValue = view.oldValues[def.bindingIndex + bindingIdx];\n if ((view.state & ViewState.BeforeFirstCheck) || !devModeEqual(oldValue, value)) {\n throw expressionChangedAfterItHasBeenCheckedError(\n Services.createDebugContext(view, def.nodeIndex), oldValue, value,\n (view.state & ViewState.BeforeFirstCheck) !== 0);\n }\n}\n/**\n * @param {?} view\n * @return {?}\n */\nexport function markParentViewsForCheck(view: ViewData) {\n let /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} endView\n * @return {?}\n */\nexport function markParentViewsForCheckProjectedViews(view: ViewData, endView: ViewData) {\n let /** @type {?} */ currView: ViewData|null = view;\n while (currView && currView !== endView) {\n currView.state |= ViewState.CheckProjectedViews;\n currView = currView.viewContainerParent || currView.parent;\n }\n}\n/**\n * @param {?} view\n * @param {?} nodeIndex\n * @param {?} eventName\n * @param {?} event\n * @return {?}\n */\nexport function dispatchEvent(\n view: ViewData, nodeIndex: number, eventName: string, event: any): boolean {\n const /** @type {?} */ nodeDef = view.def.nodes[nodeIndex];\n const /** @type {?} */ startView =\n nodeDef.flags & NodeFlags.ComponentView ? asElementData(view, nodeIndex).componentView : view;\n markParentViewsForCheck(startView);\n return Services.handleEvent(view, nodeIndex, eventName, event);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nexport function declaredViewContainer(view: ViewData): ElementData|null {\n if (view.parent) {\n const /** @type {?} */ parentView = view.parent;\n return asElementData(parentView, /** @type {?} */(( view.parentNodeDef)).nodeIndex);\n }\n return null;\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 * @param {?} view\n * @return {?}\n */\nexport function viewParentEl(view: ViewData): NodeDef|null {\n const /** @type {?} */ parentView = view.parent;\n if (parentView) {\n return /** @type {?} */(( view.parentNodeDef)).parent;\n } else {\n return null;\n }\n}\n/**\n * @param {?} view\n * @param {?} def\n * @return {?}\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/**\n * @param {?} target\n * @param {?} name\n * @return {?}\n */\nexport function elementEventFullName(target: string | null, name: string): string {\n return target ? `${target}:${name}` : name;\n}\n/**\n * @param {?} view\n * @return {?}\n */\nexport function isComponentView(view: ViewData): boolean {\n return !!view.parent && !!( /** @type {?} */((view.parentNodeDef)).flags & NodeFlags.Component);\n}\n/**\n * @param {?} view\n * @return {?}\n */\nexport function isEmbeddedView(view: ViewData): boolean {\n return !!view.parent && !( /** @type {?} */((view.parentNodeDef)).flags & NodeFlags.Component);\n}\n/**\n * @param {?} queryId\n * @return {?}\n */\nexport function filterQueryId(queryId: number): number {\n return 1 << (queryId % 32);\n}\n/**\n * @param {?} matchedQueriesDsl\n * @return {?}\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 /** @type {?} */ matchedQueries: {[queryId: string]: QueryValueType} = {};\n let /** @type {?} */ matchedQueryIds = 0;\n const /** @type {?} */ 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/**\n * @param {?} deps\n * @return {?}\n */\nexport function splitDepsDsl(deps: ([DepFlags, any] | any)[]): DepDef[] {\n return deps.map(value => {\n let /** @type {?} */ token: any;\n let /** @type {?} */ flags: DepFlags;\n if (Array.isArray(value)) {\n [flags, token] = value;\n } else {\n flags = DepFlags.None;\n token = value;\n }\n return {flags, token, tokenKey: tokenKey(token)};\n });\n}\n/**\n * @param {?} view\n * @param {?} renderHost\n * @param {?} def\n * @return {?}\n */\nexport function getParentRenderElement(view: ViewData, renderHost: any, def: NodeDef): any {\n let /** @type {?} */ renderParent = def.renderParent;\n if (renderParent) {\n if ((renderParent.flags & NodeFlags.TypeElement) === 0 ||\n (renderParent.flags & NodeFlags.ComponentView) === 0 ||\n ( /** @type {?} */((renderParent.element)).componentRendererType && /** @type {?} */(( /** @type {?} */((\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, /** @type {?} */(( def.renderParent)).nodeIndex).renderElement;\n }\n } else {\n return renderHost;\n }\n}\n\nconst /** @type {?} */ DEFINITION_CACHE = new WeakMap>();\n/**\n * @template D\n * @param {?} factory\n * @return {?}\n */\nexport function resolveDefinition>(factory: DefinitionFactory): D {\n let /** @type {?} */ value = /** @type {?} */(( /** @type {?} */(( 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/**\n * @param {?} view\n * @return {?}\n */\nexport function rootRenderNodes(view: ViewData): any[] {\n const /** @type {?} */ renderNodes: any[] = [];\n visitRootRenderNodes(view, RenderNodeAction.Collect, undefined, undefined, renderNodes);\n return renderNodes;\n}\n\nexport const enum RenderNodeAction {Collect, AppendChild, InsertBefore, RemoveChild}\n/**\n * @param {?} view\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\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, /** @type {?} */(( view.def.lastRenderRootNode))));\n }\n visitSiblingRenderNodes(\n view, action, 0, view.def.nodes.length - 1, parentNode, nextSibling, target);\n}\n/**\n * @param {?} view\n * @param {?} action\n * @param {?} startIndex\n * @param {?} endIndex\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nexport function visitSiblingRenderNodes(\n view: ViewData, action: RenderNodeAction, startIndex: number, endIndex: number, parentNode: any,\n nextSibling: any, target?: any[]) {\n for (let /** @type {?} */ i = startIndex; i <= endIndex; i++) {\n const /** @type {?} */ 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/**\n * @param {?} view\n * @param {?} ngContentIndex\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nexport function visitProjectedRenderNodes(\n view: ViewData, ngContentIndex: number, action: RenderNodeAction, parentNode: any,\n nextSibling: any, target?: any[]) {\n let /** @type {?} */ compView: ViewData|null = view;\n while (compView && !isComponentView(compView)) {\n compView = compView.parent;\n }\n const /** @type {?} */ hostView = /** @type {?} */(( compView)).parent;\n const /** @type {?} */ hostElDef = viewParentEl( /** @type {?} */((compView)));\n const /** @type {?} */ startIndex = /** @type {?} */(( hostElDef)).nodeIndex + 1;\n const /** @type {?} */ endIndex = /** @type {?} */(( hostElDef)).nodeIndex + /** @type {?} */(( hostElDef)).childCount;\n for (let /** @type {?} */ i = startIndex; i <= endIndex; i++) {\n const /** @type {?} */ nodeDef = /** @type {?} */(( hostView)).def.nodes[i];\n if (nodeDef.ngContentIndex === ngContentIndex) {\n visitRenderNode( /** @type {?} */((hostView)), nodeDef, action, parentNode, nextSibling, target);\n }\n // jump to next sibling\n i += nodeDef.childCount;\n }\n if (! /** @type {?} */((hostView)).parent) {\n // a root view\n const /** @type {?} */ projectedNodes = view.root.projectableNodes[ngContentIndex];\n if (projectedNodes) {\n for (let /** @type {?} */ i = 0; i < projectedNodes.length; i++) {\n execRenderNodeAction(view, projectedNodes[i], action, parentNode, nextSibling, target);\n }\n }\n }\n}\n/**\n * @param {?} view\n * @param {?} nodeDef\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\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, /** @type {?} */(( nodeDef.ngContent)).index, action, parentNode, nextSibling, target);\n } else {\n const /** @type {?} */ 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 /** @type {?} */ 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 /** @type {?} */ embeddedViews = /** @type {?} */(( asElementData(view, nodeDef.nodeIndex).viewContainer))._embeddedViews;\n for (let /** @type {?} */ k = 0; k < embeddedViews.length; k++) {\n visitRootRenderNodes(embeddedViews[k], action, parentNode, nextSibling, target);\n }\n }\n if (nodeDef.flags & NodeFlags.TypeElement && ! /** @type {?} */((nodeDef.element)).name) {\n visitSiblingRenderNodes(\n view, action, nodeDef.nodeIndex + 1, nodeDef.nodeIndex + nodeDef.childCount, parentNode,\n nextSibling, target);\n }\n }\n}\n/**\n * @param {?} view\n * @param {?} renderNode\n * @param {?} action\n * @param {?} parentNode\n * @param {?} nextSibling\n * @param {?=} target\n * @return {?}\n */\nfunction execRenderNodeAction(\n view: ViewData, renderNode: any, action: RenderNodeAction, parentNode: any, nextSibling: any,\n target?: any[]) {\n const /** @type {?} */ 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: /** @type {?} */((\n target)).push(renderNode);\n break;\n }\n}\n\nconst /** @type {?} */ NS_PREFIX_RE = /^:([^:]+):(.+)$/;\n/**\n * @param {?} name\n * @return {?}\n */\nexport function splitNamespace(name: string): string[] {\n if (name[0] === ':') {\n const /** @type {?} */ match = /** @type {?} */(( name.match(NS_PREFIX_RE)));\n return [match[1], match[2]];\n }\n return ['', name];\n}\n/**\n * @param {?} bindings\n * @return {?}\n */\nexport function calcBindingFlags(bindings: BindingDef[]): BindingFlags {\n let /** @type {?} */ flags = 0;\n for (let /** @type {?} */ i = 0; i < bindings.length; i++) {\n flags |= bindings[i].flags;\n }\n return flags;\n}\n/**\n * @param {?} valueCount\n * @param {?} constAndInterp\n * @return {?}\n */\nexport function interpolate(valueCount: number, constAndInterp: string[]): string {\n let /** @type {?} */ result = '';\n for (let /** @type {?} */ 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/**\n * @param {?} valueCount\n * @param {?} c0\n * @param {?} a1\n * @param {?} c1\n * @param {?=} a2\n * @param {?=} c2\n * @param {?=} a3\n * @param {?=} c3\n * @param {?=} a4\n * @param {?=} c4\n * @param {?=} a5\n * @param {?=} c5\n * @param {?=} a6\n * @param {?=} c6\n * @param {?=} a7\n * @param {?=} c7\n * @param {?=} a8\n * @param {?=} c8\n * @param {?=} a9\n * @param {?=} c9\n * @return {?}\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/**\n * @param {?} v\n * @return {?}\n */\nfunction _toStringWithNull(v: any): string {\n return v != null ? v.toString() : '';\n}\n\nexport const /** @type {?} */ EMPTY_ARRAY: any[] = [];\nexport const /** @type {?} */ 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\n\nimport {InjectionToken, Injector} from '../di';\nimport {ViewEncapsulation} from '../metadata/view';\n/**\n * @deprecated Use `RendererType2` (and `Renderer2`) instead.\n */\nexport class RenderComponentType {\n/**\n * @param {?} id\n * @param {?} templateUrl\n * @param {?} slotCount\n * @param {?} encapsulation\n * @param {?} styles\n * @param {?} animations\n */\nconstructor(\npublic id: string,\npublic templateUrl: string,\npublic slotCount: number,\npublic encapsulation: ViewEncapsulation,\npublic styles: Array,\npublic animations: any) {}\n}\n\nfunction RenderComponentType_tsickle_Closure_declarations() {\n/** @type {?} */\nRenderComponentType.prototype.id;\n/** @type {?} */\nRenderComponentType.prototype.templateUrl;\n/** @type {?} */\nRenderComponentType.prototype.slotCount;\n/** @type {?} */\nRenderComponentType.prototype.encapsulation;\n/** @type {?} */\nRenderComponentType.prototype.styles;\n/** @type {?} */\nRenderComponentType.prototype.animations;\n}\n\n/**\n * @deprecated Debug info is handeled internally in the view engine now.\n * @abstract\n */\nexport abstract class RenderDebugInfo {\n/**\n * @abstract\n * @return {?}\n */\ninjector() {}\n/**\n * @abstract\n * @return {?}\n */\ncomponent() {}\n/**\n * @abstract\n * @return {?}\n */\nproviderTokens() {}\n/**\n * @abstract\n * @return {?}\n */\nreferences() {}\n/**\n * @abstract\n * @return {?}\n */\ncontext() {}\n/**\n * @abstract\n * @return {?}\n */\nsource() {}\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 * @deprecated Use the `Renderer2` instead.\n * @abstract\n */\nexport abstract class Renderer {\n/**\n * @abstract\n * @param {?} selectorOrNode\n * @param {?=} debugInfo\n * @return {?}\n */\nselectRootElement(selectorOrNode: string|any, debugInfo?: RenderDebugInfo) {}\n/**\n * @abstract\n * @param {?} parentElement\n * @param {?} name\n * @param {?=} debugInfo\n * @return {?}\n */\ncreateElement(parentElement: any, name: string, debugInfo?: RenderDebugInfo) {}\n/**\n * @abstract\n * @param {?} hostElement\n * @return {?}\n */\ncreateViewRoot(hostElement: any) {}\n/**\n * @abstract\n * @param {?} parentElement\n * @param {?=} debugInfo\n * @return {?}\n */\ncreateTemplateAnchor(parentElement: any, debugInfo?: RenderDebugInfo) {}\n/**\n * @abstract\n * @param {?} parentElement\n * @param {?} value\n * @param {?=} debugInfo\n * @return {?}\n */\ncreateText(parentElement: any, value: string, debugInfo?: RenderDebugInfo) {}\n/**\n * @abstract\n * @param {?} parentElement\n * @param {?} nodes\n * @return {?}\n */\nprojectNodes(parentElement: any, nodes: any[]) {}\n/**\n * @abstract\n * @param {?} node\n * @param {?} viewRootNodes\n * @return {?}\n */\nattachViewAfter(node: any, viewRootNodes: any[]) {}\n/**\n * @abstract\n * @param {?} viewRootNodes\n * @return {?}\n */\ndetachView(viewRootNodes: any[]) {}\n/**\n * @abstract\n * @param {?} hostElement\n * @param {?} viewAllNodes\n * @return {?}\n */\ndestroyView(hostElement: any, viewAllNodes: any[]) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\nlisten(renderElement: any, name: string, callback: Function) {}\n/**\n * @abstract\n * @param {?} target\n * @param {?} name\n * @param {?} callback\n * @return {?}\n */\nlistenGlobal(target: string, name: string, callback: Function) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} propertyName\n * @param {?} propertyValue\n * @return {?}\n */\nsetElementProperty(renderElement: any, propertyName: string, propertyValue: any) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} attributeName\n * @param {?} attributeValue\n * @return {?}\n */\nsetElementAttribute(renderElement: any, attributeName: string, attributeValue: string) {}\n/**\n * Used only in debug mode to serialize property changes to dom nodes as attributes.\n * @abstract\n * @param {?} renderElement\n * @param {?} propertyName\n * @param {?} propertyValue\n * @return {?}\n */\nsetBindingDebugInfo(renderElement: any, propertyName: string, propertyValue: string) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} className\n * @param {?} isAdd\n * @return {?}\n */\nsetElementClass(renderElement: any, className: string, isAdd: boolean) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} styleName\n * @param {?} styleValue\n * @return {?}\n */\nsetElementStyle(renderElement: any, styleName: string, styleValue: string) {}\n/**\n * @abstract\n * @param {?} renderElement\n * @param {?} methodName\n * @param {?=} args\n * @return {?}\n */\ninvokeElementMethod(renderElement: any, methodName: string, args?: any[]) {}\n/**\n * @abstract\n * @param {?} renderNode\n * @param {?} text\n * @return {?}\n */\nsetText(renderNode: any, text: string) {}\n/**\n * @abstract\n * @param {?} element\n * @param {?} startingStyles\n * @param {?} keyframes\n * @param {?} duration\n * @param {?} delay\n * @param {?} easing\n * @param {?=} previousPlayers\n * @return {?}\n */\nanimate(\n element: any, startingStyles: any, keyframes: any[], duration: number, delay: number,\n easing: string, previousPlayers?: any[]) {}\n}\n\nexport const /** @type {?} */ Renderer2Interceptor = new InjectionToken('Renderer2Interceptor');\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} or {\\@link\n * Renderer#setElementAttribute}\n * 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 * @abstract\n */\nexport abstract class RootRenderer {\n/**\n * @abstract\n * @param {?} componentType\n * @return {?}\n */\nrenderComponent(componentType: RenderComponentType) {}\n}\n\n/**\n * @experimental\n */\nexport interface RendererType2 {\n id: string;\n encapsulation: ViewEncapsulation;\n styles: (string|any[])[];\n data: {[kind: string]: any};\n}\n/**\n * \\@experimental\n * @abstract\n */\nexport abstract class RendererFactory2 {\n/**\n * @abstract\n * @param {?} hostElement\n * @param {?} type\n * @return {?}\n */\ncreateRenderer(hostElement: any, type: RendererType2|null) {}\n/**\n * @abstract\n * @return {?}\n */\nbegin?() {}\n/**\n * @abstract\n * @return {?}\n */\nend?() {}\n/**\n * @abstract\n * @return {?}\n */\nwhenRenderingDone?() {}\n}\nexport type RendererStyleFlags2 = number;\nexport let RendererStyleFlags2: any = {};\nRendererStyleFlags2.Important = 1;\nRendererStyleFlags2.DashCase = 2;\nRendererStyleFlags2[RendererStyleFlags2.Important] = \"Important\";\nRendererStyleFlags2[RendererStyleFlags2.DashCase] = \"DashCase\";\n\n/**\n * \\@experimental\n * @abstract\n */\nexport abstract class Renderer2 {\n/**\n * This field can be used to store arbitrary data on this renderer instance.\n * This is useful for renderers that delegate to other renderers.\n * @abstract\n * @return {?}\n */\ndata() {}\n/**\n * @abstract\n * @return {?}\n */\ndestroy() {}\n/**\n * @abstract\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\ncreateElement(name: string, namespace?: string|null) {}\n/**\n * @abstract\n * @param {?} value\n * @return {?}\n */\ncreateComment(value: string) {}\n/**\n * @abstract\n * @param {?} value\n * @return {?}\n */\ncreateText(value: string) {}\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 */\ndestroyNode: ((node: any) => void)|null;\n/**\n * @abstract\n * @param {?} parent\n * @param {?} newChild\n * @return {?}\n */\nappendChild(parent: any, newChild: any) {}\n/**\n * @abstract\n * @param {?} parent\n * @param {?} newChild\n * @param {?} refChild\n * @return {?}\n */\ninsertBefore(parent: any, newChild: any, refChild: any) {}\n/**\n * @abstract\n * @param {?} parent\n * @param {?} oldChild\n * @return {?}\n */\nremoveChild(parent: any, oldChild: any) {}\n/**\n * @abstract\n * @param {?} selectorOrNode\n * @return {?}\n */\nselectRootElement(selectorOrNode: string|any) {}\n/**\n * Attention: On WebWorkers, this will always return a value,\n * as we are asking for a result synchronously. I.e.\n * the caller can't rely on checking whether this is null or not.\n * @abstract\n * @param {?} node\n * @return {?}\n */\nparentNode(node: any) {}\n/**\n * Attention: On WebWorkers, this will always return a value,\n * as we are asking for a result synchronously. I.e.\n * the caller can't rely on checking whether this is null or not.\n * @abstract\n * @param {?} node\n * @return {?}\n */\nnextSibling(node: any) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @param {?=} namespace\n * @return {?}\n */\nsetAttribute(el: any, name: string, value: string, namespace?: string|null) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} name\n * @param {?=} namespace\n * @return {?}\n */\nremoveAttribute(el: any, name: string, namespace?: string|null) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\naddClass(el: any, name: string) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} name\n * @return {?}\n */\nremoveClass(el: any, name: string) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} style\n * @param {?} value\n * @param {?=} flags\n * @return {?}\n */\nsetStyle(el: any, style: string, value: any, flags?: RendererStyleFlags2) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} style\n * @param {?=} flags\n * @return {?}\n */\nremoveStyle(el: any, style: string, flags?: RendererStyleFlags2) {}\n/**\n * @abstract\n * @param {?} el\n * @param {?} name\n * @param {?} value\n * @return {?}\n */\nsetProperty(el: any, name: string, value: any) {}\n/**\n * @abstract\n * @param {?} node\n * @param {?} value\n * @return {?}\n */\nsetValue(node: any, value: string) {}\n/**\n * @abstract\n * @param {?} target\n * @param {?} eventName\n * @param {?} callback\n * @return {?}\n */\nlisten(\n target: 'window'|'document'|'body'|any, eventName: string,\n callback: (event: any) => boolean | void) {}\n}\n\nfunction Renderer2_tsickle_Closure_declarations() {\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 * @type {?}\n */\nRenderer2.prototype.destroyNode;\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 {Observable} from 'rxjs/Observable';\n\nimport {EventEmitter} from '../event_emitter';\nimport {getSymbolIterator} from '../util';\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 * ### Example ([live demo](http://plnkr.co/edit/RX8sJnQYl9FWuSCWme5z?p=preview))\n * ```typescript\n * \\@Component({...}) \n * class Container {\n * \\@ViewChildren(Item) items:QueryList;\n * }\n * ```\n * \\@stable\n */\nexport class QueryList/* implements Iterable */ {\nprivate _dirty = true;\nprivate _results: Array = [];\nprivate _emitter = new EventEmitter();\n/**\n * @return {?}\n */\nget changes(): Observable { return this._emitter; }\n/**\n * @return {?}\n */\nget length(): number { return this._results.length; }\n/**\n * @return {?}\n */\nget first(): T { return this._results[0]; }\n/**\n * @return {?}\n */\nget last(): T { return this._results[this.length - 1]; }\n/**\n * See\n * [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)\n * @template U\n * @param {?} fn\n * @return {?}\n */\nmap(fn: (item: T, index: number, array: T[]) => U): U[] { return this._results.map(fn); }\n/**\n * See\n * [Array.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)\n * @param {?} fn\n * @return {?}\n */\nfilter(fn: (item: T, index: number, array: T[]) => boolean): T[] {\n return this._results.filter(fn);\n }\n/**\n * See\n * [Array.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)\n * @param {?} fn\n * @return {?}\n */\nfind(fn: (item: T, index: number, array: T[]) => boolean): T|undefined {\n return this._results.find(fn);\n }\n/**\n * See\n * [Array.reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce)\n * @template U\n * @param {?} fn\n * @param {?} init\n * @return {?}\n */\nreduce(fn: (prevValue: U, curValue: T, curIndex: number, array: T[]) => U, init: U): U {\n return this._results.reduce(fn, init);\n }\n/**\n * See\n * [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach)\n * @param {?} fn\n * @return {?}\n */\nforEach(fn: (item: T, index: number, array: T[]) => void): void { this._results.forEach(fn); }\n/**\n * See\n * [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some)\n * @param {?} fn\n * @return {?}\n */\nsome(fn: (value: T, index: number, array: T[]) => boolean): boolean {\n return this._results.some(fn);\n }\n/**\n * @return {?}\n */\ntoArray(): T[] { return this._results.slice(); }\n/**\n * @return {?}\n */\n[getSymbolIterator()](): Iterator { return ( /** @type {?} */((this._results as any)))[getSymbolIterator()](); }\n/**\n * @return {?}\n */\ntoString(): string { return this._results.toString(); }\n/**\n * @param {?} res\n * @return {?}\n */\nreset(res: Array): void {\n this._results = flatten(res);\n this._dirty = false;\n }\n/**\n * @return {?}\n */\nnotifyOnChanges(): void { this._emitter.emit(this); }\n/**\n * internal\n * @return {?}\n */\nsetDirty() { this._dirty = true; }\n/**\n * internal\n * @return {?}\n */\nget dirty() { return this._dirty; }\n/**\n * internal\n * @return {?}\n */\ndestroy(): void {\n this._emitter.complete();\n this._emitter.unsubscribe();\n }\n}\n\nfunction QueryList_tsickle_Closure_declarations() {\n/** @type {?} */\nQueryList.prototype._dirty;\n/** @type {?} */\nQueryList.prototype._results;\n/** @type {?} */\nQueryList.prototype._emitter;\n}\n\n/**\n * @template T\n * @param {?} list\n * @return {?}\n */\nfunction flatten(list: Array): T[] {\n return list.reduce((flat: any[], item: T | T[]): T[] => {\n const /** @type {?} */ flatItem = Array.isArray(item) ? flatten(item) : item;\n return ( /** @type {?} */((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\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 /** @type {?} */ _SEPARATOR = '#';\n\nconst /** @type {?} */ FACTORY_CLASS_SUFFIX = 'NgFactory';\ndeclare var System: any;\n/**\n * Configuration for SystemJsNgModuleLoader.\n * token.\n * \n * \\@experimental\n * @abstract\n */\nexport abstract class SystemJsNgModuleLoaderConfig {\n/**\n * Prefix to add when computing the name of the factory module for a given module name.\n */\nfactoryPathPrefix: string;\n/**\n * Suffix to add when computing the name of the factory module for a given module name.\n */\nfactoryPathSuffix: string;\n}\n\nfunction SystemJsNgModuleLoaderConfig_tsickle_Closure_declarations() {\n/**\n * Prefix to add when computing the name of the factory module for a given module name.\n * @type {?}\n */\nSystemJsNgModuleLoaderConfig.prototype.factoryPathPrefix;\n/**\n * Suffix to add when computing the name of the factory module for a given module name.\n * @type {?}\n */\nSystemJsNgModuleLoaderConfig.prototype.factoryPathSuffix;\n}\n\n\nconst /** @type {?} */ DEFAULT_CONFIG: SystemJsNgModuleLoaderConfig = {\n factoryPathPrefix: '',\n factoryPathSuffix: '.ngfactory',\n};\n/**\n * NgModuleFactoryLoader that uses SystemJS to load NgModuleFactory\n * \\@experimental\n */\nexport class SystemJsNgModuleLoader implements NgModuleFactoryLoader {\nprivate _config: SystemJsNgModuleLoaderConfig;\n/**\n * @param {?} _compiler\n * @param {?=} config\n */\nconstructor(private _compiler: Compiler, config?: SystemJsNgModuleLoaderConfig) {\n this._config = config || DEFAULT_CONFIG;\n }\n/**\n * @param {?} path\n * @return {?}\n */\nload(path: string): Promise> {\n const /** @type {?} */ offlineMode = this._compiler instanceof Compiler;\n return offlineMode ? this.loadFactory(path) : this.loadAndCompile(path);\n }\n/**\n * @param {?} path\n * @return {?}\n */\nprivate loadAndCompile(path: string): Promise> {\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 * @param {?} path\n * @return {?}\n */\nprivate loadFactory(path: string): Promise> {\n let [module, exportName] = path.split(_SEPARATOR);\n let /** @type {?} */ 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 }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: Compiler, },\n{type: SystemJsNgModuleLoaderConfig, decorators: [{ type: Optional }, ]},\n];\n}\n\nfunction SystemJsNgModuleLoader_tsickle_Closure_declarations() {\n/** @type {?} */\nSystemJsNgModuleLoader.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nSystemJsNgModuleLoader.ctorParameters;\n/** @type {?} */\nSystemJsNgModuleLoader.prototype._config;\n/** @type {?} */\nSystemJsNgModuleLoader.prototype._compiler;\n}\n\n/**\n * @param {?} value\n * @param {?} modulePath\n * @param {?} exportName\n * @return {?}\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\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\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, InjectionToken} from '../di';\nimport {MissingTranslationStrategy} from '../i18n/tokens';\nimport {ViewEncapsulation} from '../metadata';\nimport {Type} from '../type';\n\nimport {ComponentFactory} from './component_factory';\nimport {NgModuleFactory} from './ng_module_factory';\n/**\n * Combination of NgModuleFactory and ComponentFactorys.\n * \n * \\@experimental\n */\nexport class ModuleWithComponentFactories {\n/**\n * @param {?} ngModuleFactory\n * @param {?} componentFactories\n */\nconstructor(\npublic ngModuleFactory: NgModuleFactory,\npublic componentFactories: ComponentFactory[]) {}\n}\n\nfunction ModuleWithComponentFactories_tsickle_Closure_declarations() {\n/** @type {?} */\nModuleWithComponentFactories.prototype.ngModuleFactory;\n/** @type {?} */\nModuleWithComponentFactories.prototype.componentFactories;\n}\n\n/**\n * @return {?}\n */\nfunction _throwError() {\n throw new Error(`Runtime compiler is not loaded`);\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 * \\@stable\n */\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 * @template T\n * @param {?} moduleType\n * @return {?}\n */\ncompileModuleSync(moduleType: Type): NgModuleFactory { throw _throwError(); }\n/**\n * Compiles the given NgModule and all of its components\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\ncompileModuleAsync(moduleType: Type): Promise> { throw _throwError(); }\n/**\n * Same as {\\@link #compileModuleSync} but also creates ComponentFactories for all components.\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\ncompileModuleAndAllComponentsSync(moduleType: Type): ModuleWithComponentFactories {\n throw _throwError();\n }\n/**\n * Same as {\\@link #compileModuleAsync} but also creates ComponentFactories for all components.\n * @template T\n * @param {?} moduleType\n * @return {?}\n */\ncompileModuleAndAllComponentsAsync(moduleType: Type):\n Promise> {\n throw _throwError();\n }\n/**\n * Exposes the CSS-style selectors that have been used in `ngContent` directives within\n * the template of the given component.\n * This is used by the `upgrade` library to compile the appropriate transclude content\n * in the AngularJS wrapper component.\n * \n * @deprecated since v4. Use ComponentFactory.ngContentSelectors instead.\n * @param {?} component\n * @return {?}\n */\ngetNgContentSelectors(component: Type): string[] { throw _throwError(); }\n/**\n * Clears all caches.\n * @return {?}\n */\nclearCache(): void {}\n/**\n * Clears the cache for the given component/ngModule.\n * @param {?} type\n * @return {?}\n */\nclearCacheFor(type: Type) {}\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction Compiler_tsickle_Closure_declarations() {\n/** @type {?} */\nCompiler.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nCompiler.ctorParameters;\n}\n\n\n/**\n * Options for creating a compiler\n *\n * @experimental\n */\nexport type CompilerOptions = {\n /**\n * @deprecated since v4 this option has no effect anymore.\n */\n useDebug?: boolean,\n useJit?: boolean,\n defaultEncapsulation?: ViewEncapsulation,\n providers?: any[],\n missingTranslation?: MissingTranslationStrategy,\n // Whether to support the `