` is used then the super class height is `0`\n * ```\n */\nfunction getActiveDirectiveSuperClassHeight() {\n return activeDirectiveSuperClassHeight;\n}\n/**\n * Returns the current super class (reverse inheritance) depth for a directive.\n *\n * This is designed to help instruction code distinguish different hostBindings\n * calls from each other when a directive has extended from another directive.\n * Normally using the directive id value is enough, but with the case\n * of parent/sub-class directive inheritance more information is required.\n *\n * Note that this is only active when `hostBinding` functions are being processed.\n */\nfunction getActiveDirectiveSuperClassDepth() {\n return activeDirectiveSuperClassDepthPosition;\n}\n/**\n * Restores `contextViewData` to the given OpaqueViewState instance.\n *\n * Used in conjunction with the getCurrentView() instruction to save a snapshot\n * of the current view and restore it when listeners are invoked. This allows\n * walking the declaration view tree in listeners to get vars from parent views.\n *\n * @param viewToRestore The OpaqueViewState instance to restore.\n *\n * @codeGenApi\n */\nfunction ɵɵrestoreView(viewToRestore) {\n contextLView = viewToRestore;\n}\n/** Used to set the parent property when nodes are created and track query results. */\nvar previousOrParentTNode;\nfunction getPreviousOrParentTNode() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return previousOrParentTNode;\n}\nfunction setPreviousOrParentTNode(tNode, _isParent) {\n previousOrParentTNode = tNode;\n isParent = _isParent;\n}\nfunction setTNodeAndViewData(tNode, view) {\n ngDevMode && assertLViewOrUndefined(view);\n previousOrParentTNode = tNode;\n lView = view;\n}\n/**\n * If `isParent` is:\n * - `true`: then `previousOrParentTNode` points to a parent node.\n * - `false`: then `previousOrParentTNode` points to previous node (sibling).\n */\nvar isParent;\nfunction getIsParent() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return isParent;\n}\nfunction setIsNotParent() {\n isParent = false;\n}\nfunction setIsParent() {\n isParent = true;\n}\n/** Checks whether a given view is in creation mode */\nfunction isCreationMode(view) {\n if (view === void 0) { view = lView; }\n return (view[FLAGS] & 4 /* CreationMode */) === 4 /* CreationMode */;\n}\n/**\n * State of the current view being processed.\n *\n * An array of nodes (text, element, container, etc), pipes, their bindings, and\n * any local variables that need to be stored between invocations.\n */\nvar lView;\n/**\n * The last viewData retrieved by nextContext().\n * Allows building nextContext() and reference() calls.\n *\n * e.g. const inner = x().$implicit; const outer = x().$implicit;\n */\nvar contextLView = null;\nfunction getContextLView() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return contextLView;\n}\n/**\n * In this mode, any changes in bindings will throw an ExpressionChangedAfterChecked error.\n *\n * Necessary to support ChangeDetectorRef.checkNoChanges().\n */\nvar checkNoChangesMode = false;\nfunction getCheckNoChangesMode() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return checkNoChangesMode;\n}\nfunction setCheckNoChangesMode(mode) {\n checkNoChangesMode = mode;\n}\n/**\n * The root index from which pure function instructions should calculate their binding\n * indices. In component views, this is TView.bindingStartIndex. In a host binding\n * context, this is the TView.expandoStartIndex + any dirs/hostVars before the given dir.\n */\nvar bindingRootIndex = -1;\n// top level variables should not be exported for performance reasons (PERF_NOTES.md)\nfunction getBindingRoot() {\n return bindingRootIndex;\n}\nfunction setBindingRoot(value) {\n bindingRootIndex = value;\n}\n/**\n * Current index of a View or Content Query which needs to be processed next.\n * We iterate over the list of Queries and increment current query index at every step.\n */\nvar currentQueryIndex = 0;\nfunction getCurrentQueryIndex() {\n // top level variables should not be exported for performance reasons (PERF_NOTES.md)\n return currentQueryIndex;\n}\nfunction setCurrentQueryIndex(value) {\n currentQueryIndex = value;\n}\n/**\n * Swap the current state with a new state.\n *\n * For performance reasons we store the state in the top level of the module.\n * This way we minimize the number of properties to read. Whenever a new view\n * is entered we have to store the state for later, and when the view is\n * exited the state has to be restored\n *\n * @param newView New state to become active\n * @param host Element to which the View is a child of\n * @returns the previous state;\n */\nfunction enterView(newView, hostTNode) {\n ngDevMode && assertLViewOrUndefined(newView);\n var oldView = lView;\n if (newView) {\n var tView = newView[TVIEW];\n bindingRootIndex = tView.bindingStartIndex;\n }\n previousOrParentTNode = hostTNode;\n isParent = true;\n lView = contextLView = newView;\n return oldView;\n}\nfunction nextContextImpl(level) {\n if (level === void 0) { level = 1; }\n contextLView = walkUpViews(level, contextLView);\n return contextLView[CONTEXT];\n}\nfunction walkUpViews(nestingLevel, currentView) {\n while (nestingLevel > 0) {\n ngDevMode && assertDefined(currentView[DECLARATION_VIEW], 'Declaration view should be defined if nesting level is greater than 0.');\n currentView = currentView[DECLARATION_VIEW];\n nestingLevel--;\n }\n return currentView;\n}\n/**\n * Resets the application state.\n */\nfunction resetComponentState() {\n isParent = false;\n previousOrParentTNode = null;\n elementDepthCount = 0;\n bindingsEnabled = true;\n setCurrentStyleSanitizer(null);\n resetAllStylingState();\n}\n/**\n * Used in lieu of enterView to make it clear when we are exiting a child view. This makes\n * the direction of traversal (up or down the view tree) a bit clearer.\n *\n * @param newView New state to become active\n * @param safeToRunHooks Whether the runtime is in a state where running lifecycle hooks is valid.\n * This is not always the case (for example, the application may have crashed and `leaveView` is\n * being executed while unwinding the call stack).\n */\nfunction leaveView(newView, safeToRunHooks) {\n var tView = lView[TVIEW];\n if (isCreationMode(lView)) {\n lView[FLAGS] &= ~4 /* CreationMode */;\n }\n else {\n try {\n resetPreOrderHookFlags(lView);\n safeToRunHooks && executeHooks(lView, tView.viewHooks, tView.viewCheckHooks, checkNoChangesMode, 2 /* AfterViewInitHooksToBeRun */, undefined);\n }\n finally {\n // Views are clean and in update mode after being checked, so these bits are cleared\n lView[FLAGS] &= ~(64 /* Dirty */ | 8 /* FirstLViewPass */);\n lView[BINDING_INDEX] = tView.bindingStartIndex;\n }\n }\n enterView(newView, null);\n}\nvar _selectedIndex = -1;\n/**\n * Gets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nfunction getSelectedIndex() {\n return _selectedIndex;\n}\n/**\n * Sets the most recent index passed to {@link select}\n *\n * Used with {@link property} instruction (and more in the future) to identify the index in the\n * current `LView` to act on.\n */\nfunction setSelectedIndex(index) {\n _selectedIndex = index;\n // we have now jumped to another element\n // therefore the state is stale\n resetStylingState();\n}\nvar _currentNamespace = null;\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/2000/svg'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceSVG() {\n _currentNamespace = 'http://www.w3.org/2000/svg';\n}\n/**\n * Sets the namespace used to create elements to `'http://www.w3.org/1998/MathML/'` in global state.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceMathML() {\n _currentNamespace = 'http://www.w3.org/1998/MathML/';\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n *\n * @codeGenApi\n */\nfunction ɵɵnamespaceHTML() {\n namespaceHTMLInternal();\n}\n/**\n * Sets the namespace used to create elements to `null`, which forces element creation to use\n * `createElement` rather than `createElementNS`.\n */\nfunction namespaceHTMLInternal() {\n _currentNamespace = null;\n}\nfunction getNamespace() {\n return _currentNamespace;\n}\nvar _currentSanitizer;\nfunction setCurrentStyleSanitizer(sanitizer) {\n _currentSanitizer = sanitizer;\n}\nfunction getCurrentStyleSanitizer() {\n return _currentSanitizer;\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 * Returns whether the values are different from a change detection stand point.\n *\n * Constraints are relaxed in checkNoChanges mode. See `devModeEqual` for details.\n */\nfunction isDifferent(a, b) {\n // NaN is the only value that is not equal to itself so the first\n // test checks if both a and b are not NaN\n return !(a !== a && b !== b) && a !== b;\n}\n/**\n * Used for stringify render output in Ivy.\n * Important! This function is very performance-sensitive and we should\n * be extra careful not to introduce megamorphic reads in it.\n */\nfunction renderStringify(value) {\n if (typeof value === 'string')\n return value;\n if (value == null)\n return '';\n return '' + value;\n}\n/**\n * Used to stringify a value so that it can be displayed in an error message.\n * Important! This function contains a megamorphic read and should only be\n * used for error messages.\n */\nfunction stringifyForError(value) {\n if (typeof value === 'function')\n return value.name || value.toString();\n if (typeof value === 'object' && value != null && typeof value.type === 'function') {\n return value.type.name || value.type.toString();\n }\n return renderStringify(value);\n}\nvar ɵ0$2 = function () {\n return (typeof requestAnimationFrame !== 'undefined' && requestAnimationFrame || // browser only\n setTimeout // everything else\n ).bind(_global);\n};\nvar defaultScheduler = (ɵ0$2)();\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveWindow(element) {\n return { name: 'window', target: element.ownerDocument.defaultView };\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveDocument(element) {\n return { name: 'document', target: element.ownerDocument };\n}\n/**\n *\n * @codeGenApi\n */\nfunction ɵɵresolveBody(element) {\n return { name: 'body', target: element.ownerDocument.body };\n}\n/**\n * The special delimiter we use to separate property names, prefixes, and suffixes\n * in property binding metadata. See storeBindingMetadata().\n *\n * We intentionally use the Unicode \"REPLACEMENT CHARACTER\" (U+FFFD) as a delimiter\n * because it is a very uncommon character that is unlikely to be part of a user's\n * property names or interpolation strings. If it is in fact used in a property\n * binding, DebugElement.properties will not return the correct value for that\n * binding. However, there should be no runtime effect for real applications.\n *\n * This character is typically rendered as a question mark inside of a diamond.\n * See https://en.wikipedia.org/wiki/Specials_(Unicode_block)\n *\n */\nvar INTERPOLATION_DELIMITER = \"\\uFFFD\";\n/**\n * Determines whether or not the given string is a property metadata string.\n * See storeBindingMetadata().\n */\nfunction isPropMetadataString(str) {\n return str.indexOf(INTERPOLATION_DELIMITER) >= 0;\n}\n/**\n * Unwrap a value which might be behind a closure (for forward declaration reasons).\n */\nfunction maybeUnwrapFn(value) {\n if (value instanceof Function) {\n return value();\n }\n else {\n return value;\n }\n}\n\nvar MAP_BASED_ENTRY_PROP_NAME = '--MAP--';\nvar TEMPLATE_DIRECTIVE_INDEX = 0;\n/**\n * Creates a new instance of the `TStylingContext`.\n *\n * The `TStylingContext` is used as a manifest of all style or all class bindings on\n * an element. Because it is a T-level data-structure, it is only created once per\n * tNode for styles and for classes. This function allocates a new instance of a\n * `TStylingContext` with the initial values (see `interfaces.ts` for more info).\n */\nfunction allocTStylingContext(initialStyling) {\n // because map-based bindings deal with a dynamic set of values, there\n // is no way to know ahead of time whether or not sanitization is required.\n // For this reason the configuration will always mark sanitization as active\n // (this means that when map-based values are applied then sanitization will\n // be checked against each property).\n var mapBasedConfig = 1 /* SanitizationRequired */;\n return [\n initialStyling || [''],\n 0 /* Initial */,\n TEMPLATE_DIRECTIVE_INDEX,\n mapBasedConfig,\n 0,\n MAP_BASED_ENTRY_PROP_NAME,\n ];\n}\n/**\n * Sets the provided directive as the last directive index in the provided `TStylingContext`.\n *\n * Styling in Angular can be applied from the template as well as multiple sources of\n * host bindings. This means that each binding function (the template function or the\n * hostBindings functions) will generate styling instructions as well as a styling\n * apply function (i.e. `stylingApply()`). Because host bindings functions and the\n * template function are independent from one another this means that the styling apply\n * function will be called multiple times. By tracking the last directive index (which\n * is what happens in this function) the styling algorithm knows exactly when to flush\n * styling (which is when the last styling apply function is executed).\n */\nfunction updateLastDirectiveIndex(context, lastDirectiveIndex) {\n if (lastDirectiveIndex === TEMPLATE_DIRECTIVE_INDEX) {\n var currentValue = context[2 /* LastDirectiveIndexPosition */];\n if (currentValue > TEMPLATE_DIRECTIVE_INDEX) {\n // This means that a directive or two contained a host bindings function, but\n // now the template function also contains styling. When this combination of sources\n // comes up then we need to tell the context to store the state between updates\n // (because host bindings evaluation happens after template binding evaluation).\n markContextToPersistState(context);\n }\n }\n else {\n context[2 /* LastDirectiveIndexPosition */] = lastDirectiveIndex;\n }\n}\nfunction getConfig(context) {\n return context[1 /* ConfigPosition */];\n}\nfunction setConfig(context, value) {\n context[1 /* ConfigPosition */] = value;\n}\nfunction getProp(context, index) {\n return context[index + 2 /* PropOffset */];\n}\nfunction getPropConfig(context, index) {\n return context[index + 0 /* ConfigAndGuardOffset */] &\n 1 /* Mask */;\n}\nfunction isSanitizationRequired(context, index) {\n return (getPropConfig(context, index) & 1 /* SanitizationRequired */) > 0;\n}\nfunction getGuardMask(context, index) {\n var configGuardValue = context[index + 0 /* ConfigAndGuardOffset */];\n return configGuardValue >> 1 /* TotalBits */;\n}\nfunction setGuardMask(context, index, maskValue) {\n var config = getPropConfig(context, index);\n var guardMask = maskValue << 1 /* TotalBits */;\n context[index + 0 /* ConfigAndGuardOffset */] = config | guardMask;\n}\nfunction getValuesCount(context, index) {\n return context[index + 1 /* ValuesCountOffset */];\n}\nfunction getBindingValue(context, index, offset) {\n return context[index + 3 /* BindingsStartOffset */ + offset];\n}\nfunction getDefaultValue(context, index) {\n var valuesCount = getValuesCount(context, index);\n return context[index + 3 /* BindingsStartOffset */ + valuesCount - 1];\n}\n/**\n * Temporary function which determines whether or not a context is\n * allowed to be flushed based on the provided directive index.\n */\nfunction allowStylingFlush(context, index) {\n return (context && index === context[2 /* LastDirectiveIndexPosition */]) ? true :\n false;\n}\nfunction lockContext(context) {\n setConfig(context, getConfig(context) | 1 /* Locked */);\n}\nfunction isContextLocked(context) {\n return (getConfig(context) & 1 /* Locked */) > 0;\n}\nfunction stateIsPersisted(context) {\n return (getConfig(context) & 2 /* PersistStateValues */) > 0;\n}\nfunction markContextToPersistState(context) {\n setConfig(context, getConfig(context) | 2 /* PersistStateValues */);\n}\nfunction getPropValuesStartPosition(context) {\n return 6 /* MapBindingsBindingsStartPosition */ +\n context[4 /* MapBindingsValuesCountPosition */];\n}\nfunction isMapBased(prop) {\n return prop === MAP_BASED_ENTRY_PROP_NAME;\n}\nfunction hasValueChanged(a, b) {\n var compareValueA = Array.isArray(a) ? a[0 /* RawValuePosition */] : a;\n var compareValueB = Array.isArray(b) ? b[0 /* RawValuePosition */] : b;\n // these are special cases for String based values (which are created as artifacts\n // when sanitization is bypassed on a particular value)\n if (compareValueA instanceof String) {\n compareValueA = compareValueA.toString();\n }\n if (compareValueB instanceof String) {\n compareValueB = compareValueB.toString();\n }\n return isDifferent(compareValueA, compareValueB);\n}\n/**\n * Determines whether the provided styling value is truthy or falsy.\n */\nfunction isStylingValueDefined(value) {\n // the reason why null is compared against is because\n // a CSS class value that is set to `false` must be\n // respected (otherwise it would be treated as falsy).\n // Empty string values are because developers usually\n // set a value to an empty string to remove it.\n return value != null && value !== '';\n}\nfunction concatString(a, b, separator) {\n if (separator === void 0) { separator = ' '; }\n return a + ((b.length && a.length) ? separator : '') + b;\n}\nfunction hyphenate(value) {\n return value.replace(/[a-z][A-Z]/g, function (v) { return v.charAt(0) + '-' + v.charAt(1); }).toLowerCase();\n}\n/**\n * Returns an instance of `StylingMapArray`.\n *\n * This function is designed to find an instance of `StylingMapArray` in case it is stored\n * inside of an instance of `TStylingContext`. When a styling context is created it\n * will copy over an initial styling values from the tNode (which are stored as a\n * `StylingMapArray` on the `tNode.classes` or `tNode.styles` values).\n */\nfunction getStylingMapArray(value) {\n return isStylingContext(value) ?\n value[0 /* InitialStylingValuePosition */] :\n value;\n}\nfunction isStylingContext(value) {\n // the StylingMapArray is in the format of [initial, prop, string, prop, string]\n // and this is the defining value to distinguish between arrays\n return Array.isArray(value) &&\n value.length >= 6 /* MapBindingsBindingsStartPosition */ &&\n typeof value[1] !== 'string';\n}\nfunction getInitialStylingValue(context) {\n var map = getStylingMapArray(context);\n return map && map[0 /* RawValuePosition */] || '';\n}\nfunction hasClassInput(tNode) {\n return (tNode.flags & 8 /* hasClassInput */) !== 0;\n}\nfunction hasStyleInput(tNode) {\n return (tNode.flags & 16 /* hasStyleInput */) !== 0;\n}\nfunction getMapProp(map, index) {\n return map[index + 0 /* PropOffset */];\n}\nfunction setMapValue(map, index, value) {\n map[index + 1 /* ValueOffset */] = value;\n}\nfunction getMapValue(map, index) {\n return map[index + 1 /* ValueOffset */];\n}\nfunction forceClassesAsString(classes) {\n if (classes && typeof classes !== 'string') {\n classes = Object.keys(classes).join(' ');\n }\n return classes || '';\n}\nfunction forceStylesAsString(styles) {\n var str = '';\n if (styles) {\n var props = Object.keys(styles);\n for (var i = 0; i < props.length; i++) {\n var prop = props[i];\n str = concatString(str, prop + \":\" + styles[prop], ';');\n }\n }\n return str;\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// TODO: cleanup once the code is merged in angular/angular\nvar RendererStyleFlags3;\n(function (RendererStyleFlags3) {\n RendererStyleFlags3[RendererStyleFlags3[\"Important\"] = 1] = \"Important\";\n RendererStyleFlags3[RendererStyleFlags3[\"DashCase\"] = 2] = \"DashCase\";\n})(RendererStyleFlags3 || (RendererStyleFlags3 = {}));\n/** Returns whether the `renderer` is a `ProceduralRenderer3` */\nfunction isProceduralRenderer(renderer) {\n return !!(renderer.listen);\n}\nvar ɵ0$3 = function (hostElement, rendererType) { return document; };\nvar domRendererFactory3 = {\n createRenderer: ɵ0$3\n};\n// Note: This hack is necessary so we don't erroneously get a circular dependency\n// failure based on types.\nvar unusedValueExportToPlacateAjd$3 = 1;\n\n/**\n * Assigns all attribute values to the provided element via the inferred renderer.\n *\n * This function accepts two forms of attribute entries:\n *\n * default: (key, value):\n * attrs = [key1, value1, key2, value2]\n *\n * namespaced: (NAMESPACE_MARKER, uri, name, value)\n * attrs = [NAMESPACE_MARKER, uri, name, value, NAMESPACE_MARKER, uri, name, value]\n *\n * The `attrs` array can contain a mix of both the default and namespaced entries.\n * The \"default\" values are set without a marker, but if the function comes across\n * a marker value then it will attempt to set a namespaced value. If the marker is\n * not of a namespaced value then the function will quit and return the index value\n * where it stopped during the iteration of the attrs array.\n *\n * See [AttributeMarker] to understand what the namespace marker value is.\n *\n * Note that this instruction does not support assigning style and class values to\n * an element. See `elementStart` and `elementHostAttrs` to learn how styling values\n * are applied to an element.\n *\n * @param native The element that the attributes will be assigned to\n * @param attrs The attribute array of values that will be assigned to the element\n * @returns the index value that was last accessed in the attributes array\n */\nfunction setUpAttributes(native, attrs) {\n var renderer = getLView()[RENDERER];\n var isProc = isProceduralRenderer(renderer);\n var i = 0;\n while (i < attrs.length) {\n var value = attrs[i];\n if (typeof value === 'number') {\n // only namespaces are supported. Other value types (such as style/class\n // entries) are not supported in this function.\n if (value !== 0 /* NamespaceURI */) {\n break;\n }\n // we just landed on the marker value ... therefore\n // we should skip to the next entry\n i++;\n var namespaceURI = attrs[i++];\n var attrName = attrs[i++];\n var attrVal = attrs[i++];\n ngDevMode && ngDevMode.rendererSetAttribute++;\n isProc ?\n renderer.setAttribute(native, attrName, attrVal, namespaceURI) :\n native.setAttributeNS(namespaceURI, attrName, attrVal);\n }\n else {\n // attrName is string;\n var attrName = value;\n var attrVal = attrs[++i];\n // Standard attributes\n ngDevMode && ngDevMode.rendererSetAttribute++;\n if (isAnimationProp(attrName)) {\n if (isProc) {\n renderer.setProperty(native, attrName, attrVal);\n }\n }\n else {\n isProc ?\n renderer\n .setAttribute(native, attrName, attrVal) :\n native.setAttribute(attrName, attrVal);\n }\n i++;\n }\n }\n // another piece of code may iterate over the same attributes array. Therefore\n // it may be helpful to return the exact spot where the attributes array exited\n // whether by running into an unsupported marker or if all the static values were\n // iterated over.\n return i;\n}\nfunction attrsStylingIndexOf(attrs, startIndex) {\n for (var i = startIndex; i < attrs.length; i++) {\n var val = attrs[i];\n if (val === 1 /* Classes */ || val === 2 /* Styles */) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Test whether the given value is a marker that indicates that the following\n * attribute values in a `TAttributes` array are only the names of attributes,\n * and not name-value pairs.\n * @param marker The attribute marker to test.\n * @returns true if the marker is a \"name-only\" marker (e.g. `Bindings`, `Template` or `I18n`).\n */\nfunction isNameOnlyAttributeMarker(marker) {\n return marker === 3 /* Bindings */ || marker === 4 /* Template */ ||\n marker === 6 /* I18n */;\n}\nvar ANIMATION_PROP_PREFIX = '@';\nfunction isAnimationProp(name) {\n return name[0] === ANIMATION_PROP_PREFIX;\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/// Parent Injector Utils ///////////////////////////////////////////////////////////////\nfunction hasParentInjector(parentLocation) {\n return parentLocation !== NO_PARENT_INJECTOR;\n}\nfunction getParentInjectorIndex(parentLocation) {\n return parentLocation & 32767 /* InjectorIndexMask */;\n}\nfunction getParentInjectorViewOffset(parentLocation) {\n return parentLocation >> 16 /* ViewOffsetShift */;\n}\n/**\n * Unwraps a parent injector location number to find the view offset from the current injector,\n * then walks up the declaration view tree until the view is found that contains the parent\n * injector.\n *\n * @param location The location of the parent injector, which contains the view offset\n * @param startView The LView instance from which to start walking up the view tree\n * @returns The LView instance that contains the parent injector\n */\nfunction getParentInjectorView(location, startView) {\n var viewOffset = getParentInjectorViewOffset(location);\n var parentView = startView;\n // For most cases, the parent injector can be found on the host node (e.g. for component\n // or container), but we must keep the loop here to support the rarer case of deeply nested\n //
tags or inline views, where the parent injector might live many views\n // above the child injector.\n while (viewOffset > 0) {\n parentView = parentView[DECLARATION_VIEW];\n viewOffset--;\n }\n return parentView;\n}\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source 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 * Gets the parent LView of the passed LView, if the PARENT is an LContainer, will get the parent of\n * that LContainer, which is an LView\n * @param lView the lView whose parent to get\n */\nfunction getLViewParent(lView) {\n ngDevMode && assertLView(lView);\n var parent = lView[PARENT];\n return isLContainer(parent) ? parent[PARENT] : parent;\n}\n/**\n * Retrieve the root view from any component or `LView` by walking the parent `LView` until\n * reaching the root `LView`.\n *\n * @param componentOrLView any component or `LView`\n */\nfunction getRootView(componentOrLView) {\n ngDevMode && assertDefined(componentOrLView, 'component');\n var lView = isLView(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView);\n while (lView && !(lView[FLAGS] & 512 /* IsRoot */)) {\n lView = getLViewParent(lView);\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Given an `LView`, find the closest declaration view which is not an embedded view.\n *\n * This method searches for the `LView` associated with the component which declared the `LView`.\n *\n * This function may return itself if the `LView` passed in is not an embedded `LView`. Otherwise\n * it walks the declaration parents until it finds a component view (non-embedded-view.)\n *\n * @param lView LView for which we want a host element node\n * @returns The host node\n */\nfunction findComponentView(lView) {\n var rootTNode = lView[T_HOST];\n while (rootTNode !== null && rootTNode.type === 2 /* View */) {\n ngDevMode && assertDefined(lView[DECLARATION_VIEW], 'lView[DECLARATION_VIEW]');\n lView = lView[DECLARATION_VIEW];\n rootTNode = lView[T_HOST];\n }\n ngDevMode && assertLView(lView);\n return lView;\n}\n/**\n * Returns the `RootContext` instance that is associated with\n * the application where the target is situated. It does this by walking the parent views until it\n * gets to the root view, then getting the context off of that.\n *\n * @param viewOrComponent the `LView` or component to get the root context for.\n */\nfunction getRootContext(viewOrComponent) {\n var rootView = getRootView(viewOrComponent);\n ngDevMode &&\n assertDefined(rootView[CONTEXT], 'RootView has no context. Perhaps it is disconnected?');\n return rootView[CONTEXT];\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 * Defines if the call to `inject` should include `viewProviders` in its resolution.\n *\n * This is set to true when we try to instantiate a component. This value is reset in\n * `getNodeInjectable` to a value which matches the declaration location of the token about to be\n * instantiated. This is done so that if we are injecting a token which was declared outside of\n * `viewProviders` we don't accidentally pull `viewProviders` in.\n *\n * Example:\n *\n * ```\n * @Injectable()\n * class MyService {\n * constructor(public value: String) {}\n * }\n *\n * @Component({\n * providers: [\n * MyService,\n * {provide: String, value: 'providers' }\n * ]\n * viewProviders: [\n * {provide: String, value: 'viewProviders'}\n * ]\n * })\n * class MyComponent {\n * constructor(myService: MyService, value: String) {\n * // We expect that Component can see into `viewProviders`.\n * expect(value).toEqual('viewProviders');\n * // `MyService` was not declared in `viewProviders` hence it can't see it.\n * expect(myService.value).toEqual('providers');\n * }\n * }\n *\n * ```\n */\nvar includeViewProviders = true;\nfunction setIncludeViewProviders(v) {\n var oldValue = includeViewProviders;\n includeViewProviders = v;\n return oldValue;\n}\n/**\n * The number of slots in each bloom filter (used by DI). The larger this number, the fewer\n * directives that will share slots, and thus, the fewer false positives when checking for\n * the existence of a directive.\n */\nvar BLOOM_SIZE = 256;\nvar BLOOM_MASK = BLOOM_SIZE - 1;\n/** Counter used to generate unique IDs for directives. */\nvar nextNgElementId = 0;\n/**\n * Registers this directive as present in its node's injector by flipping the directive's\n * corresponding bit in the injector's bloom filter.\n *\n * @param injectorIndex The index of the node injector where this token should be registered\n * @param tView The TView for the injector's bloom filters\n * @param type The directive token to register\n */\nfunction bloomAdd(injectorIndex, tView, type) {\n ngDevMode && assertEqual(tView.firstTemplatePass, true, 'expected firstTemplatePass to be true');\n var id = typeof type !== 'string' ? type[NG_ELEMENT_ID] : type.charCodeAt(0) || 0;\n // Set a unique ID on the directive type, so if something tries to inject the directive,\n // we can easily retrieve the ID and hash it into the bloom bit that should be checked.\n if (id == null) {\n id = type[NG_ELEMENT_ID] = nextNgElementId++;\n }\n // We only have BLOOM_SIZE (256) slots in our bloom filter (8 buckets * 32 bits each),\n // so all unique IDs must be modulo-ed into a number from 0 - 255 to fit into the filter.\n var bloomBit = id & BLOOM_MASK;\n // Create a mask that targets the specific bit associated with the directive.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n var mask = 1 << bloomBit;\n // Use the raw bloomBit number to determine which bloom filter bucket we should check\n // e.g: bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc\n var b7 = bloomBit & 0x80;\n var b6 = bloomBit & 0x40;\n var b5 = bloomBit & 0x20;\n var tData = tView.data;\n if (b7) {\n b6 ? (b5 ? (tData[injectorIndex + 7] |= mask) : (tData[injectorIndex + 6] |= mask)) :\n (b5 ? (tData[injectorIndex + 5] |= mask) : (tData[injectorIndex + 4] |= mask));\n }\n else {\n b6 ? (b5 ? (tData[injectorIndex + 3] |= mask) : (tData[injectorIndex + 2] |= mask)) :\n (b5 ? (tData[injectorIndex + 1] |= mask) : (tData[injectorIndex] |= mask));\n }\n}\n/**\n * Creates (or gets an existing) injector for a given element or container.\n *\n * @param tNode for which an injector should be retrieved / created.\n * @param hostView View where the node is stored\n * @returns Node injector\n */\nfunction getOrCreateNodeInjectorForNode(tNode, hostView) {\n var existingInjectorIndex = getInjectorIndex(tNode, hostView);\n if (existingInjectorIndex !== -1) {\n return existingInjectorIndex;\n }\n var tView = hostView[TVIEW];\n if (tView.firstTemplatePass) {\n tNode.injectorIndex = hostView.length;\n insertBloom(tView.data, tNode); // foundation for node bloom\n insertBloom(hostView, null); // foundation for cumulative bloom\n insertBloom(tView.blueprint, null);\n ngDevMode && assertEqual(tNode.flags === 0 || tNode.flags === 1 /* isComponent */, true, 'expected tNode.flags to not be initialized');\n }\n var parentLoc = getParentInjectorLocation(tNode, hostView);\n var parentIndex = getParentInjectorIndex(parentLoc);\n var parentLView = getParentInjectorView(parentLoc, hostView);\n var injectorIndex = tNode.injectorIndex;\n // If a parent injector can't be found, its location is set to -1.\n // In that case, we don't need to set up a cumulative bloom\n if (hasParentInjector(parentLoc)) {\n var parentData = parentLView[TVIEW].data;\n // Creates a cumulative bloom filter that merges the parent's bloom filter\n // and its own cumulative bloom (which contains tokens for all ancestors)\n for (var i = 0; i < 8; i++) {\n hostView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i];\n }\n }\n hostView[injectorIndex + PARENT_INJECTOR] = parentLoc;\n return injectorIndex;\n}\nfunction insertBloom(arr, footer) {\n arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer);\n}\nfunction getInjectorIndex(tNode, hostView) {\n if (tNode.injectorIndex === -1 ||\n // If the injector index is the same as its parent's injector index, then the index has been\n // copied down from the parent node. No injector has been created yet on this node.\n (tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex) ||\n // After the first template pass, the injector index might exist but the parent values\n // might not have been calculated yet for this instance\n hostView[tNode.injectorIndex + PARENT_INJECTOR] == null) {\n return -1;\n }\n else {\n return tNode.injectorIndex;\n }\n}\n/**\n * Finds the index of the parent injector, with a view offset if applicable. Used to set the\n * parent injector initially.\n *\n * Returns a combination of number of `ViewData` we have to go up and index in that `Viewdata`\n */\nfunction getParentInjectorLocation(tNode, view) {\n if (tNode.parent && tNode.parent.injectorIndex !== -1) {\n return tNode.parent.injectorIndex; // ViewOffset is 0\n }\n // For most cases, the parent injector index can be found on the host node (e.g. for component\n // or container), so this loop will be skipped, but we must keep the loop here to support\n // the rarer case of deeply nested tags or inline views.\n var hostTNode = view[T_HOST];\n var viewOffset = 1;\n while (hostTNode && hostTNode.injectorIndex === -1) {\n view = view[DECLARATION_VIEW];\n hostTNode = view ? view[T_HOST] : null;\n viewOffset++;\n }\n return hostTNode ?\n hostTNode.injectorIndex | (viewOffset << 16 /* ViewOffsetShift */) :\n -1;\n}\n/**\n * Makes a type or an injection token public to the DI system by adding it to an\n * injector's bloom filter.\n *\n * @param di The node injector in which a directive will be added\n * @param token The type or the injection token to be made public\n */\nfunction diPublicInInjector(injectorIndex, tView, token) {\n bloomAdd(injectorIndex, tView, token);\n}\n/**\n * Inject static attribute value into directive constructor.\n *\n * This method is used with `factory` functions which are generated as part of\n * `defineDirective` or `defineComponent`. The method retrieves the static value\n * of an attribute. (Dynamic attributes are not supported since they are not resolved\n * at the time of injection and can change over time.)\n *\n * # Example\n * Given:\n * ```\n * @Component(...)\n * class MyComponent {\n * constructor(@Attribute('title') title: string) { ... }\n * }\n * ```\n * When instantiated with\n * ```\n * \n * ```\n *\n * Then factory method generated is:\n * ```\n * MyComponent.ngComponentDef = defineComponent({\n * factory: () => new MyComponent(injectAttribute('title'))\n * ...\n * })\n * ```\n *\n * @publicApi\n */\nfunction injectAttributeImpl(tNode, attrNameToInject) {\n ngDevMode && assertNodeOfPossibleTypes(tNode, 0 /* Container */, 3 /* Element */, 4 /* ElementContainer */);\n ngDevMode && assertDefined(tNode, 'expecting tNode');\n if (attrNameToInject === 'class') {\n return getInitialStylingValue(tNode.classes);\n }\n if (attrNameToInject === 'style') {\n return getInitialStylingValue(tNode.styles);\n }\n var attrs = tNode.attrs;\n if (attrs) {\n var attrsLength = attrs.length;\n var i = 0;\n while (i < attrsLength) {\n var value = attrs[i];\n // If we hit a `Bindings` or `Template` marker then we are done.\n if (isNameOnlyAttributeMarker(value))\n break;\n // Skip namespaced attributes\n if (value === 0 /* NamespaceURI */) {\n // we skip the next two values\n // as namespaced attributes looks like\n // [..., AttributeMarker.NamespaceURI, 'http://someuri.com/test', 'test:exist',\n // 'existValue', ...]\n i = i + 2;\n }\n else if (typeof value === 'number') {\n // Skip to the first value of the marked attribute.\n i++;\n while (i < attrsLength && typeof attrs[i] === 'string') {\n i++;\n }\n }\n else if (value === attrNameToInject) {\n return attrs[i + 1];\n }\n else {\n i = i + 2;\n }\n }\n }\n return null;\n}\n/**\n * Returns the value associated to the given token from the NodeInjectors => ModuleInjector.\n *\n * Look for the injector providing the token by walking up the node injector tree and then\n * the module injector tree.\n *\n * This function patches `token` with `__NG_ELEMENT_ID__` which contains the id for the bloom\n * filter. Negative values are reserved for special objects.\n * - `-1` is reserved for injecting `Injector` (implemented by `NodeInjector`)\n *\n * @param tNode The Node where the search for the injector should start\n * @param lView The `LView` that contains the `tNode`\n * @param token The token to look for\n * @param flags Injection flags\n * @param notFoundValue The value to return when the injection flags is `InjectFlags.Optional`\n * @returns the value from the injector, `null` when not found, or `notFoundValue` if provided\n */\nfunction getOrCreateInjectable(tNode, lView, token, flags, notFoundValue) {\n if (flags === void 0) { flags = InjectFlags.Default; }\n if (tNode) {\n var bloomHash = bloomHashBitOrFactory(token);\n // If the ID stored here is a function, this is a special object like ElementRef or TemplateRef\n // so just call the factory function to create it.\n if (typeof bloomHash === 'function') {\n var savePreviousOrParentTNode = getPreviousOrParentTNode();\n var saveLView = getLView();\n setTNodeAndViewData(tNode, lView);\n try {\n var value = bloomHash();\n if (value == null && !(flags & InjectFlags.Optional)) {\n throw new Error(\"No provider for \" + stringifyForError(token) + \"!\");\n }\n else {\n return value;\n }\n }\n finally {\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n }\n else if (typeof bloomHash == 'number') {\n if (bloomHash === -1) {\n // `-1` is a special value used to identify `Injector` types.\n return new NodeInjector(tNode, lView);\n }\n // If the token has a bloom hash, then it is a token which could be in NodeInjector.\n // A reference to the previous injector TView that was found while climbing the element\n // injector tree. This is used to know if viewProviders can be accessed on the current\n // injector.\n var previousTView = null;\n var injectorIndex = getInjectorIndex(tNode, lView);\n var parentLocation = NO_PARENT_INJECTOR;\n var hostTElementNode = flags & InjectFlags.Host ? findComponentView(lView)[T_HOST] : null;\n // If we should skip this injector, or if there is no injector on this node, start by\n // searching\n // the parent injector.\n if (injectorIndex === -1 || flags & InjectFlags.SkipSelf) {\n parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) :\n lView[injectorIndex + PARENT_INJECTOR];\n if (!shouldSearchParent(flags, false)) {\n injectorIndex = -1;\n }\n else {\n previousTView = lView[TVIEW];\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n }\n // Traverse up the injector tree until we find a potential match or until we know there\n // *isn't* a match.\n while (injectorIndex !== -1) {\n parentLocation = lView[injectorIndex + PARENT_INJECTOR];\n // Check the current injector. If it matches, see if it contains token.\n var tView = lView[TVIEW];\n if (bloomHasToken(bloomHash, injectorIndex, tView.data)) {\n // At this point, we have an injector which *may* contain the token, so we step through\n // the providers and directives associated with the injector's corresponding node to get\n // the instance.\n var instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode);\n if (instance !== NOT_FOUND) {\n return instance;\n }\n }\n if (shouldSearchParent(flags, lView[TVIEW].data[injectorIndex + TNODE] === hostTElementNode) &&\n bloomHasToken(bloomHash, injectorIndex, lView)) {\n // The def wasn't found anywhere on this node, so it was a false positive.\n // Traverse up the tree and continue searching.\n previousTView = tView;\n injectorIndex = getParentInjectorIndex(parentLocation);\n lView = getParentInjectorView(parentLocation, lView);\n }\n else {\n // If we should not search parent OR If the ancestor bloom filter value does not have the\n // bit corresponding to the directive we can give up on traversing up to find the specific\n // injector.\n injectorIndex = -1;\n }\n }\n }\n }\n if (flags & InjectFlags.Optional && notFoundValue === undefined) {\n // This must be set or the NullInjector will throw for optional deps\n notFoundValue = null;\n }\n if ((flags & (InjectFlags.Self | InjectFlags.Host)) === 0) {\n var moduleInjector = lView[INJECTOR$1];\n // switch to `injectInjectorOnly` implementation for module injector, since module injector\n // should not have access to Component/Directive DI scope (that may happen through\n // `directiveInject` implementation)\n var previousInjectImplementation = setInjectImplementation(undefined);\n try {\n if (moduleInjector) {\n return moduleInjector.get(token, notFoundValue, flags & InjectFlags.Optional);\n }\n else {\n return injectRootLimpMode(token, notFoundValue, flags & InjectFlags.Optional);\n }\n }\n finally {\n setInjectImplementation(previousInjectImplementation);\n }\n }\n if (flags & InjectFlags.Optional) {\n return notFoundValue;\n }\n else {\n throw new Error(\"NodeInjector: NOT_FOUND [\" + stringifyForError(token) + \"]\");\n }\n}\nvar NOT_FOUND = {};\nfunction searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) {\n var currentTView = lView[TVIEW];\n var tNode = currentTView.data[injectorIndex + TNODE];\n // First, we need to determine if view providers can be accessed by the starting element.\n // There are two possibities\n var canAccessViewProviders = previousTView == null ?\n // 1) This is the first invocation `previousTView == null` which means that we are at the\n // `TNode` of where injector is starting to look. In such a case the only time we are allowed\n // to look into the ViewProviders is if:\n // - we are on a component\n // - AND the injector set `includeViewProviders` to true (implying that the token can see\n // ViewProviders because it is the Component or a Service which itself was declared in\n // ViewProviders)\n (isComponent(tNode) && includeViewProviders) :\n // 2) `previousTView != null` which means that we are now walking across the parent nodes.\n // In such a case we are only allowed to look into the ViewProviders if:\n // - We just crossed from child View to Parent View `previousTView != currentTView`\n // - AND the parent TNode is an Element.\n // This means that we just came from the Component's View and therefore are allowed to see\n // into the ViewProviders.\n (previousTView != currentTView && (tNode.type === 3 /* Element */));\n // This special case happens when there is a @host on the inject and when we are searching\n // on the host element node.\n var isHostSpecialCase = (flags & InjectFlags.Host) && hostTElementNode === tNode;\n var injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase);\n if (injectableIdx !== null) {\n return getNodeInjectable(currentTView.data, lView, injectableIdx, tNode);\n }\n else {\n return NOT_FOUND;\n }\n}\n/**\n * Searches for the given token among the node's directives and providers.\n *\n * @param tNode TNode on which directives are present.\n * @param tView The tView we are currently processing\n * @param token Provider token or type of a directive to look for.\n * @param canAccessViewProviders Whether view providers should be considered.\n * @param isHostSpecialCase Whether the host special case applies.\n * @returns Index of a found directive or provider, or null when none found.\n */\nfunction locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) {\n var nodeProviderIndexes = tNode.providerIndexes;\n var tInjectables = tView.data;\n var injectablesStart = nodeProviderIndexes & 65535 /* ProvidersStartIndexMask */;\n var directivesStart = tNode.directiveStart;\n var directiveEnd = tNode.directiveEnd;\n var cptViewProvidersCount = nodeProviderIndexes >> 16 /* CptViewProvidersCountShift */;\n var startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount;\n // When the host special case applies, only the viewProviders and the component are visible\n var endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd;\n for (var i = startingIndex; i < endIndex; i++) {\n var providerTokenOrDef = tInjectables[i];\n if (i < directivesStart && token === providerTokenOrDef ||\n i >= directivesStart && providerTokenOrDef.type === token) {\n return i;\n }\n }\n if (isHostSpecialCase) {\n var dirDef = tInjectables[directivesStart];\n if (dirDef && isComponentDef(dirDef) && dirDef.type === token) {\n return directivesStart;\n }\n }\n return null;\n}\n/**\n* Retrieve or instantiate the injectable from the `lData` at particular `index`.\n*\n* This function checks to see if the value has already been instantiated and if so returns the\n* cached `injectable`. Otherwise if it detects that the value is still a factory it\n* instantiates the `injectable` and caches the value.\n*/\nfunction getNodeInjectable(tData, lData, index, tNode) {\n var value = lData[index];\n if (isFactory(value)) {\n var factory = value;\n if (factory.resolving) {\n throw new Error(\"Circular dep for \" + stringifyForError(tData[index]));\n }\n var previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders);\n factory.resolving = true;\n var previousInjectImplementation = void 0;\n if (factory.injectImpl) {\n previousInjectImplementation = setInjectImplementation(factory.injectImpl);\n }\n var savePreviousOrParentTNode = getPreviousOrParentTNode();\n var saveLView = getLView();\n setTNodeAndViewData(tNode, lData);\n try {\n value = lData[index] = factory.factory(undefined, tData, lData, tNode);\n }\n finally {\n if (factory.injectImpl)\n setInjectImplementation(previousInjectImplementation);\n setIncludeViewProviders(previousIncludeViewProviders);\n factory.resolving = false;\n setTNodeAndViewData(savePreviousOrParentTNode, saveLView);\n }\n }\n return value;\n}\n/**\n * Returns the bit in an injector's bloom filter that should be used to determine whether or not\n * the directive might be provided by the injector.\n *\n * When a directive is public, it is added to the bloom filter and given a unique ID that can be\n * retrieved on the Type. When the directive isn't public or the token is not a directive `null`\n * is returned as the node injector can not possibly provide that token.\n *\n * @param token the injection token\n * @returns the matching bit to check in the bloom filter or `null` if the token is not known.\n * When the returned value is negative then it represents special values such as `Injector`.\n */\nfunction bloomHashBitOrFactory(token) {\n ngDevMode && assertDefined(token, 'token must be defined');\n if (typeof token === 'string') {\n return token.charCodeAt(0) || 0;\n }\n var tokenId = token[NG_ELEMENT_ID];\n // Negative token IDs are used for special objects such as `Injector`\n return (typeof tokenId === 'number' && tokenId > 0) ? tokenId & BLOOM_MASK : tokenId;\n}\nfunction bloomHasToken(bloomHash, injectorIndex, injectorView) {\n // Create a mask that targets the specific bit associated with the directive we're looking for.\n // JS bit operations are 32 bits, so this will be a number between 2^0 and 2^31, corresponding\n // to bit positions 0 - 31 in a 32 bit integer.\n var mask = 1 << bloomHash;\n var b7 = bloomHash & 0x80;\n var b6 = bloomHash & 0x40;\n var b5 = bloomHash & 0x20;\n // Our bloom filter size is 256 bits, which is eight 32-bit bloom filter buckets:\n // bf0 = [0 - 31], bf1 = [32 - 63], bf2 = [64 - 95], bf3 = [96 - 127], etc.\n // Get the bloom filter value from the appropriate bucket based on the directive's bloomBit.\n var value;\n if (b7) {\n value = b6 ? (b5 ? injectorView[injectorIndex + 7] : injectorView[injectorIndex + 6]) :\n (b5 ? injectorView[injectorIndex + 5] : injectorView[injectorIndex + 4]);\n }\n else {\n value = b6 ? (b5 ? injectorView[injectorIndex + 3] : injectorView[injectorIndex + 2]) :\n (b5 ? injectorView[injectorIndex + 1] : injectorView[injectorIndex]);\n }\n // If the bloom filter value has the bit corresponding to the directive's bloomBit flipped on,\n // this injector is a potential match.\n return !!(value & mask);\n}\n/** Returns true if flags prevent parent injector from being searched for tokens */\nfunction shouldSearchParent(flags, isFirstHostTNode) {\n return !(flags & InjectFlags.Self) && !(flags & InjectFlags.Host && isFirstHostTNode);\n}\nvar NodeInjector = /** @class */ (function () {\n function NodeInjector(_tNode, _lView) {\n this._tNode = _tNode;\n this._lView = _lView;\n }\n NodeInjector.prototype.get = function (token, notFoundValue) {\n return getOrCreateInjectable(this._tNode, this._lView, token, undefined, notFoundValue);\n };\n return NodeInjector;\n}());\n/**\n * @codeGenApi\n */\nfunction ɵɵgetFactoryOf(type) {\n var typeAny = type;\n var def = getComponentDef(typeAny) || getDirectiveDef(typeAny) ||\n getPipeDef(typeAny) || getInjectableDef(typeAny) || getInjectorDef(typeAny);\n if (!def || def.factory === undefined) {\n return null;\n }\n return def.factory;\n}\n/**\n * @codeGenApi\n */\nfunction ɵɵgetInheritedFactory(type) {\n var proto = Object.getPrototypeOf(type.prototype).constructor;\n var factory = ɵɵgetFactoryOf(proto);\n if (factory !== null) {\n return factory;\n }\n else {\n // There is no factory defined. Either this was improper usage of inheritance\n // (no Angular decorator on the superclass) or there is no constructor at all\n // in the inheritance chain. Since the two cases cannot be distinguished, the\n // latter has to be assumed.\n return function (t) { return new t(); };\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 */\nvar ERROR_TYPE = 'ngType';\nvar ERROR_DEBUG_CONTEXT = 'ngDebugContext';\nvar ERROR_ORIGINAL_ERROR = 'ngOriginalError';\nvar ERROR_LOGGER = 'ngErrorLogger';\nfunction wrappedError(message, originalError) {\n var msg = message + \" caused by: \" + (originalError instanceof Error ? originalError.message : originalError);\n var error = Error(msg);\n error[ERROR_ORIGINAL_ERROR] = originalError;\n return error;\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 */\nfunction getType(error) {\n return error[ERROR_TYPE];\n}\nfunction getDebugContext(error) {\n return error[ERROR_DEBUG_CONTEXT];\n}\nfunction getOriginalError(error) {\n return error[ERROR_ORIGINAL_ERROR];\n}\nfunction getErrorLogger(error) {\n return error[ERROR_LOGGER] || defaultErrorLogger;\n}\nfunction defaultErrorLogger(console) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n console.error.apply(console, __spread(values));\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 * Provides a hook for centralized exception handling.\n *\n * The default implementation of `ErrorHandler` prints error messages to the `console`. To\n * intercept error handling, write a custom exception handler that replaces this default as\n * appropriate for your app.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class MyErrorHandler implements ErrorHandler {\n * handleError(error) {\n * // do something with the exception\n * }\n * }\n *\n * @NgModule({\n * providers: [{provide: ErrorHandler, useClass: MyErrorHandler}]\n * })\n * class MyModule {}\n * ```\n *\n * @publicApi\n */\nvar ErrorHandler = /** @class */ (function () {\n function ErrorHandler() {\n /**\n * @internal\n */\n this._console = console;\n }\n ErrorHandler.prototype.handleError = function (error) {\n var originalError = this._findOriginalError(error);\n var context = this._findContext(error);\n // Note: Browser consoles show the place from where console.error was called.\n // We can use this to give users additional information about the error.\n var errorLogger = getErrorLogger(error);\n errorLogger(this._console, \"ERROR\", error);\n if (originalError) {\n errorLogger(this._console, \"ORIGINAL ERROR\", originalError);\n }\n if (context) {\n errorLogger(this._console, 'ERROR CONTEXT', context);\n }\n };\n /** @internal */\n ErrorHandler.prototype._findContext = function (error) {\n if (error) {\n return getDebugContext(error) ? getDebugContext(error) :\n this._findContext(getOriginalError(error));\n }\n return null;\n };\n /** @internal */\n ErrorHandler.prototype._findOriginalError = function (error) {\n var e = getOriginalError(error);\n while (e && getOriginalError(e)) {\n e = getOriginalError(e);\n }\n return e;\n };\n return ErrorHandler;\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 * Defines a schema that allows an NgModule to contain the following:\n * - Non-Angular elements named with dash case (`-`).\n * - Element properties named with dash case (`-`).\n * Dash case is the naming convention for custom elements.\n *\n * @publicApi\n */\nvar CUSTOM_ELEMENTS_SCHEMA = {\n name: 'custom-elements'\n};\n/**\n * Defines a schema that allows any property on any element.\n *\n * @publicApi\n */\nvar NO_ERRORS_SCHEMA = {\n name: 'no-errors-schema'\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 */\nvar BRAND = '__SANITIZER_TRUSTED_BRAND__';\nfunction allowSanitizationBypass(value, type) {\n return (value instanceof String && value[BRAND] === type);\n}\n/**\n * Mark `html` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link htmlSanitizer} to be trusted implicitly.\n *\n * @param trustedHtml `html` string which needs to be implicitly trusted.\n * @returns a `html` `String` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustHtml(trustedHtml) {\n return bypassSanitizationTrustString(trustedHtml, \"Html\" /* Html */);\n}\n/**\n * Mark `style` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link styleSanitizer} to be trusted implicitly.\n *\n * @param trustedStyle `style` string which needs to be implicitly trusted.\n * @returns a `style` `String` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustStyle(trustedStyle) {\n return bypassSanitizationTrustString(trustedStyle, \"Style\" /* Style */);\n}\n/**\n * Mark `script` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link scriptSanitizer} to be trusted implicitly.\n *\n * @param trustedScript `script` string which needs to be implicitly trusted.\n * @returns a `script` `String` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustScript(trustedScript) {\n return bypassSanitizationTrustString(trustedScript, \"Script\" /* Script */);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link urlSanitizer} to be trusted implicitly.\n *\n * @param trustedUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustUrl(trustedUrl) {\n return bypassSanitizationTrustString(trustedUrl, \"Url\" /* Url */);\n}\n/**\n * Mark `url` string as trusted.\n *\n * This function wraps the trusted string in `String` and brands it in a way which makes it\n * recognizable to {@link resourceUrlSanitizer} to be trusted implicitly.\n *\n * @param trustedResourceUrl `url` string which needs to be implicitly trusted.\n * @returns a `url` `String` which has been branded to be implicitly trusted.\n */\nfunction bypassSanitizationTrustResourceUrl(trustedResourceUrl) {\n return bypassSanitizationTrustString(trustedResourceUrl, \"ResourceUrl\" /* ResourceUrl */);\n}\nfunction bypassSanitizationTrustString(trustedString, mode) {\n // tslint:disable-next-line\n var trusted = new String(trustedString);\n trusted[BRAND] = mode;\n return trusted;\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 * This file is used to control if the default rendering pipeline should be `ViewEngine` or `Ivy`.\n *\n * For more information on how to run and debug tests with either Ivy or View Engine (legacy),\n * please see [BAZEL.md](./docs/BAZEL.md).\n */\nvar _devMode = true;\nvar _runModeLocked = false;\n/**\n * Returns whether Angular is in development mode. After called once,\n * the value is locked and won't change any more.\n *\n * By default, this is true, unless a user calls `enableProdMode` before calling this.\n *\n * @publicApi\n */\nfunction isDevMode() {\n _runModeLocked = true;\n return _devMode;\n}\n/**\n * Disable Angular's development mode, which turns off assertions and other\n * checks within the framework.\n *\n * One important assertion this disables verifies that a change detection pass\n * does not result in additional changes to any bindings (also known as\n * unidirectional data flow).\n *\n * @publicApi\n */\nfunction enableProdMode() {\n if (_runModeLocked) {\n throw new Error('Cannot enable prod mode after platform setup.');\n }\n _devMode = false;\n}\n\n/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * This helper class is used to get hold of an inert tree of DOM elements containing dirty HTML\n * that needs sanitizing.\n * Depending upon browser support we must use one of three strategies for doing this.\n * Support: Safari 10.x -> XHR strategy\n * Support: Firefox -> DomParser strategy\n * Default: InertDocument strategy\n */\nvar InertBodyHelper = /** @class */ (function () {\n function InertBodyHelper(defaultDoc) {\n this.defaultDoc = defaultDoc;\n this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert');\n this.inertBodyElement = this.inertDocument.body;\n if (this.inertBodyElement == null) {\n // usually there should be only one body element in the document, but IE doesn't have any, so\n // we need to create one.\n var inertHtml = this.inertDocument.createElement('html');\n this.inertDocument.appendChild(inertHtml);\n this.inertBodyElement = this.inertDocument.createElement('body');\n inertHtml.appendChild(this.inertBodyElement);\n }\n this.inertBodyElement.innerHTML = '';\n if (this.inertBodyElement.querySelector && !this.inertBodyElement.querySelector('svg')) {\n // We just hit the Safari 10.1 bug - which allows JS to run inside the SVG G element\n // so use the XHR strategy.\n this.getInertBodyElement = this.getInertBodyElement_XHR;\n return;\n }\n this.inertBodyElement.innerHTML =\n '