UNPKG

502 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../shadydom/src/shady-data.js"," [synthetic:es6/util/arrayiterator] "," [synthetic:es6/util/makeiterator] "," [synthetic:es6/util/arrayfromiterable] "," [synthetic:es6/util/arrayfromiterator] "," [synthetic:util/global] ","../../shadydom/src/utils.js","../../shadydom/src/patch-native.js","../../shadydom/src/flush.js","../../shadydom/src/observe-changes.js","../../shadydom/src/innerHTML.js","../../shadydom/src/patch-instances.js","../../shadydom/src/patch-events.js","../../shadydom/src/array-splice.js","../../shadydom/src/patches/EventTarget.js","../../shadydom/src/style-scoping.js","../../shadydom/src/patches/Node.js","../../shadydom/src/attach-shadow.js","../../shadydom/src/patches/Slotable.js","../../shadydom/src/selector-parser.js","../../shadydom/src/patches/ParentNode.js","../../shadydom/src/patches/ChildNode.js","../../shadydom/src/patches/Element.js","../../shadydom/src/patches/ElementOrShadowRoot.js","../../shadydom/src/patches/HTMLElement.js","../../shadydom/src/patches/Slot.js","../../shadydom/src/patches/DocumentOrFragment.js","../../shadydom/src/patches/DocumentOrShadowRoot.js","../../shadydom/src/patches/Document.js","../../shadydom/src/patches/Window.js","../../shadydom/src/patch-prototypes.js","../../shadydom/src/link-nodes.js","../../shadydom/src/patches/ShadowRoot.js","../../shadydom/src/patch-shadyRoot.js","../../shadydom/src/wrapper.js","../../shadydom/src/shadydom.js","../../shadycss/src/css-parse.js","../../shadycss/src/style-settings.js","../../shadycss/src/common-regex.js","../../shadycss/src/unscoped-style-handler.js","../../shadycss/src/style-util.js","../../shadycss/src/style-transformer.js","../../shadycss/src/scoping-shim.js","../../shadycss/src/document-watcher.js","../../shadycss/src/style-properties.js","../../shadycss/src/style-info.js","../../shadycss/src/style-placeholder.js","../../shadycss/src/style-cache.js","../../shadycss/src/template-map.js","../../shadycss/src/apply-shim-utils.js","../../shadycss/src/common-utils.js","../../shadycss/entrypoints/scoping-shim.js"],"names":["$jscomp.arrayIteratorImpl","$jscomp.global","$jscomp.getGlobal","ShadyData","toJSON","ensureShadyDataForNode","node","__shady","shadyDataForNode","settings","window","hasNativeShadowDOM","attachShadow","Element","prototype","getRootNode","Node","desc","Object","getOwnPropertyDescriptor","hasDescriptors","configurable","get","inUse","noPatch","preferPerformance","patchOnDemand","userValue","acceptedValues","indexOf","querySelectorImplementation","IS_IE","navigator","userAgent","match","getPropertyName","Document","prefixed","name","isTrackingLogicalChildNodes","nodeData","undefined","firstChild","isShadyRoot","obj","ShadowRoot","hasShadowRootWithSlot","root","_hasInsertionPoint","p","matches","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","twiddle","document","createTextNode","content","queue","MutationObserver","length","shift","e","textContent","observe","characterData","microtask","callback","push","documentContains","contains","doc","documentElement","container","createPolyfilledHTMLCollection","nodes","l","getAttribute","isNaN","item","nodes.item","index","namedItem","nodes.namedItem","$jscomp.makeIterator","nativeChildNodesArray","parent","result","n","childNodesArray","patchProperty","proto","descriptor","value","defineProperty","patchProperties","descriptors","prefix","disallowedPatches","patchExistingProperties","getOwnPropertyDescriptors","getOwnPropertyNames","forEach","assign","target","source","names","i","convertIntoANode","arg","convertNodesIntoANode","args","fragment","createDocumentFragment","appendChild","flat","array","depth","reduce","acc","Array","isArray","$jscomp.arrayFromIterable","deduplicate","results","set","Set","has","add","flushList","scheduled","enqueue","flush","didFlush","constructor","AsyncObserver","_scheduled","addedNodes","removedNodes","callbacks","schedule","mutations","takeRecords","cb","observeChildren","sd","observer","_callback","_observer","_node","unobserveChildren","handle","delete","size","filterMutations","targetRootNode","map","mutation","mutationInScope","slice","call","filter","create","m","escapeAttrRegExp","escapeDataRegExp","escapeReplace","c","makeSet","arr","voidElements","plaintextParents","getInnerHTML","localName","s","c$","childNodes","child","nodeType","ELEMENT_NODE","tagName","attrs","attributes","attr","replace","TEXT_NODE","data","parentNode","COMMENT_NODE","console","error","Error","nativeMethods","querySelector","selector","querySelectorAll","nativeTree","installNativeAccessor","NATIVE_PREFIX","defineNativeAccessors","prop","copyProperties","list","nodeWalker","createTreeWalker","NodeFilter","SHOW_ALL","elementWalker","SHOW_ELEMENT","inertDoc","implementation","createHTMLDocument","clearNode","ParentNodeAccessors","ParentNodeMethods","addNativePrefixedProperties","eventProps","EventTarget","Window","XMLHttpRequest","currentNode","lastChild","previousSibling","nextSibling","parentElement","DOCUMENT_FRAGMENT_NODE","textWalker","SHOW_TEXT","nextNode","nodeValue","HTMLElement","ParentNodeWalkerDescriptors","firstElementChild","lastElementChild","children","childElementCount","previousElementSibling","nextElementSibling","innerHTML","containerName","htmlContainer","namespaceURI","createElementNS","createElement","newContent","className","setAttribute","HTMLTemplateElement","DocumentFragment","InsideDescriptors","shadowRoot","TextContentInnerHTMLDescriptors","OutsideDescriptors","makeNonEnumerable","enumerable","noInstancePatching","patchOutsideElementAccessors","element","__outsideAccessors","patchInsideElementAccessors","__insideAccessors","customElements","eventWrappersName","Date","now","composedGetter","composedProp","Event","ev","supportsEventOptions","listener","supported","eventOptions","capture","addEventListener","removeEventListener","parseEventOptions","optionsOrCapture","once","shadyTarget","__shadyTarget","nativeEventOptions","alwaysComposed","unpatchedEvents","getRootNodeWithFallback","eventTarget","pathComposer","startNode","composed","composedPath","current","startRoot","host","event","__composedPath","retarget","refNode","path","refNodePath","ancestor","lastRoot","rootIdx","EventPatches","__composed","type","isTrusted","currentTarget","relatedTarget","__relatedTarget","__relatedTargetComposedPath","stopPropagation","__propagationStopped","stopImmediatePropagation","__immediatePropagationStopped","eventPhaseDescriptor","AT_TARGET","mixinComposedFlag","Base","klazz","options","__proto__","nonBubblingEventsToRetarget","hasRetargeted","fireHandlers","phase","hs","__handlers","fn","shadyDispatchEventNeedsProxyEvent","hasOwnProperty","shadyDispatchEvent","originalEvent","retargetedPath","bubbles","prevCurrentTargetDesc","eventPhase","CAPTURING_PHASE","prevEventPhaseDesc","atTarget","BUBBLING_PHASE","findListener","wrappers","savedType","savedListener","savedCapture","savedNode","dispatchEvent","patchEvent","fnOrObj","handlerType","handleEvent","wrapperFn","lastCurrentTargetDesc","lastEventPhaseDesc","ret","idx","splice","activateFocusEventOverrides","EventPatchesDescriptors","getPrototypeOf","SHADY_PROTO","patchedProto","SHADY_SOURCE_PROTO","PatchedEvent","PatchedCustomEvent","CustomEvent","PatchedMouseEvent","MouseEvent","patchClick","composedClickFn","cancelable","click","eventPropertyNamesForElement","substring","eventPropertyNamesForHTMLElement","wrappedDescriptorForEventProperty","property","shadyData","eventName","__onCallbackListeners","newSplice","addedCount","removed","calcSplices","currentEnd","old","oldEnd","currentStart","oldStart","prefixCount","suffixCount","minLength","Math","min","currentValue","previousValue","index1","index2","count","equals","rowCount","columnCount","distances","j","north","west","edits","EDIT_ADD","EDIT_DELETE","northWest","EDIT_LEAVE","EDIT_UPDATE","reverse","splices","oldIndex","EventTargetPatches","scopingShim","getScopingShim","scopeClassAttribute","removeShadyScoping","currentScopeName","currentScopeIsCorrect","newScopeName","correctScope","currentScope","currentScopeForNode","treeVisitor","visitorFn","nativeIsConnectedAccessors","nativeIsConnected","removeOwnerShadyRoot","ownerShadyRoot","firstComposedNode","flattened","flattenedNodes","scheduleObserver","addedNode","removedNode","NodePatches","childNodes.item","isConnected","ownerDocument","tc","join","insertBefore","ref_node","refData","slotsAdded","ownerRoot","ownerShadyRootForNode","oldScopeName","skipUnscoping","allowNativeInsert","needsScoping","needsSlotFinding","_ensureSlotData","_pendingSlots","_asyncRender","recordInsertBefore","parentData","adoptNode","removeChild","removingInsertionPoint","_removeContainedSlots","recordRemoveChild","preventNativeRemove","changeSlotContent","replaceChild","cloneNode","deep","ATTRIBUTE_NODE","nc","SlotablePatches","assignedSlot","_render","PARENS","Map","end","matchNestedParens","k","v","findNext","str","start","queryChars","parenInfo","parseSelectorList","endComplexSelector","chunks","pop","compoundSelectors","x","combinators","prevChunk","nextIndex","nextChunk","query","matcher","halter","queryChildNodes","ParentNodePatches","append","prepend","logicalQuerySelectorAll","contextNode","selectorList","matchesCompoundSelector","compoundSelector","complexSelectors","cursors","complexSelectorParts","matchedElement","some","cursor","lastIndex","combinator","sibling","QueryPatches","candidates","candidate","useNative","ParentNodeDocumentOrFragmentPatches","ChildNodePatches","after","before","remove","replaceWith","distributeAttributeChange","_slotList","_validateSlots","oldName","__slotName","_nameForSlot","slots","_slotMap","_sortSlots","ElementPatches","slot","removeAttribute","ElementShadowPatches","_init","recordChildNodes","ShadyRoot","ShadyRootConstructionToken","publicRoot","ElementOrShadowRootPatches","HTMLElementPatches","blur","shadowActive","activeElement","SlotPatches","assignedNodes","flatten","DocumentOrFragmentPatches","getElementById","id","getElInRoot","roots","el","elRoot","getAncestorRoots","docOrRoot","elementsFromPointProperty","DocumentOrShadowRootPatches","active","activeRoot","elementsFromPoint","y","nativeResult","USE_NATIVE_DOCUMENT_EFP","nativeArray","ancestorRoots","rootedResult","r","elementFromPoint","DocumentPatches","importNode","WindowPatches","bind","NonStandardHTMLElement","patchMap","Text","Comment","CDATASection","ProcessingInstruction","HTMLSlotElement","CharacterData","disallowedNativePatches","applyPatchList","disallowed","patch","applyPatches","ctor","PROTO_IS_PATCHED","PATCHED_PROTO","patchElementProto","patchNode","nativeProto","setPrototypeOf","OutsideAccessors","InsideAcccessors","linkNode","containerData","ref_nodeData","psd","nsd","first","adoptedParent","previous","ShadowRootPatches","patchShadyAccessors","isRendering","readyState","rootRendered","ancestorList","ancestors","unshift","token","TypeError","mode","hostData","MODE_CLOSED","rootData","_renderPending","renderRoot","__childSlotCount","_renderSelf","wasRendering","_distribute","slotData","n$","_previouslyAssignedNodes","_prevAssignedSlot","_distributeNodeToSlot","slotParentRoot","slotParentData","_addAssignedToFlattenedNodes","prevAssignedNodes","dirty","_fireSlotChange","_compose","composeList","targetNode","distributedNode","d","next","_hasRendered","forcedSlot","oldSlot","CATCHALL_NAME","assigned","nestedAssigned","slotNamesToSort","slotParent","_mapSlots","sort","a","b","listA","listB","nA","nB","didRemove","patchShadyRoot","SHADY_PREFIX","defineProperties","nodeName","define","connectMap","clear","ManageConnect","base","connected","disconnected","counter","connectFlag","connectedCallback","disconnectedCallback","originalDefine","Wrapper","?.prototype","focus","DOCUMENT_NODE","$jscomp.global.Object.defineProperties","_activeElement","addEventPropertyWrapper","wrapperMap","WeakMap","wrap","wrapper","ShadyDOM","flushInitial","StyleNode","parse","text","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.comments","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.port","OPEN_BRACE","CLOSE_BRACE","parseCss","t","trim","ss","_expandUnicodeEscapes","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.multipleSpaces","lastIndexOf","AT_START","MEDIA_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MEDIA_RULE","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.keyframesRule","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.KEYFRAMES_RULE","split","VAR_START","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.MIXIN_RULE","types$$module$node_modules$$webcomponents$shadycss$src$css_parse.STYLE_RULE","r$","code","repeat","stringify","preserveProperties","cssText","rules","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.customProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinProp","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.mixinApply","RX$$module$node_modules$$webcomponents$shadycss$src$css_parse.varApply","STYLE_RULE","KEYFRAMES_RULE","MEDIA_RULE","MIXIN_RULE","comments","port","customProp","mixinProp","mixinApply","varApply","keyframesRule","multipleSpaces","nativeShadow","nativeCssVariables_","calcCssVariables","shimcssproperties","CSS","supports","cssBuild","ShadyCSS","disableRuntime","nativeCss","nativeCssVariables","VAR_ASSIGN","MIXIN_MATCH","VAR_CONSUMED","ANIMATION_MATCH","MEDIA_MATCH","BRACKETED","styleTextSet","toCssText","forEachRule","rulesForStyle","style","isKeyframesSelector","rule","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","matchMedia","applyCss","moniker","applyStyle","lastHeadApplyNode","applyStylePlaceHolder","placeHolder","createComment","scope","head","position","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","findMatchingParen","level","processVariableAndFallback","inner","suffix","comma","fallback","setElementClassRaw","getIsExtends","typeExtension","is","extends","splitSelectorList","parts","part","getCssBuild","__cssBuild","attrValue","CSS_BUILD_ATTR","buildComment","commentParts","isOptimalCssBuild","StyleTransformer","domAddScope","_transformDom","transformer","_content","shouldRemoveScope","classList","SCOPE_NAME","CLASS","newValue","domReplaceScope","oldScope","newScope","domRemoveScope","elementStyles","styleRules","css","ext","hostScope","_calcHostScope","CSS_CLASS_PREFIX","isScoped","transformedSelector","_transformRuleCss","self","_transformComplexSelector","p$","COMPLEX_SELECTOR_SEP","_twiddleNthPlus","NTH","inside","_preserveMatchesPseudo","MATCHES","input","MATCHES_REPLACEMENT","_replaceMatchesPseudo","cur","stop","isNth","test","isMatches","SLOTTED_START","SIMPLE_SELECTOR_SEP","info","_transformCompoundSelector","DIR_PAREN","dir","slottedIndex","SLOTTED","HOST","_transformHostSelector","_transformSimpleSelector","slotted","SLOTTED_PAREN","paren","output","PSEUDO_PREFIX","HOST_PAREN","SIMPLE_SELECTOR_PREFIX","typeSelector","SELECTOR_NO_MATCH","normalizeRootSelector","ROOT","_transformDocumentSelector","SCOPE_DOC_SELECTOR","$jscompDefaultExport","StyleInfo","ast","placeholder","ownStylePropertyNames","overrideStyleProperties","customStyle","scopeSelector","styleProperties","infoKey","styleInfo","_getStyleRules","method","rootSelector","StyleProperties","decorateStyles","props","keyframes","ruleIndex","decorateRule","exec","onKeyframesRule","_keyframes","propertyInfo","properties","collectProperties","hasProperties","rx","any","valueForProperty","valueForProperties","propertyValue","colon","pp","propertyDataFromStyles","o","selectorToMatch","parseInt","key","whenHostOrRootRule","parsedSelector","isHost","isRoot","hostAndRootPropertiesForScope","hostProps","rootProps","_element","transformStyles","hostSelector","hostRx","RegExp","HOST_PREFIX","rxHostSelector","HOST_SUFFIX","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.get","keyframeTransforms","_elementKeyframeTransforms","hasAnimations","keyframeNamesToTransform","keyframe","transform","keyframesRules","keyframesNameRx","transformedKeyframesName","scopeId","_keyframesRuleTransformer","applyCustomStyle","XSCOPE_NAME","placeholderMap","ce","origDefine","wrappedDefine","clazz","StyleCache","cache","store","tagname","styleElement","typeMax","scopeRegExp","getCurrentScope","getOwnerScope","handler","mxns","mxn","unscopedNodes","unscopedNode","scopeForPreviouslyUnscopedNode","childList","subtree","delayedStart","body","requestAnimationFrame","templateMap","promise","Promise","resolve","invalidate","elementName","template","CURRENT_VERSION","VALIDATING_VERSION","NEXT_VERSION","templateIsValid","startValidatingTemplate","_validating","then","adoptedCssTextMap","styleCache","ScopingShim","_scopeCounter","_documentOwner","_documentOwnerStyleInfo","StyleInfo$$module$node_modules$$webcomponents$shadycss$src$style_info.set","_elementsHaveApplied","_customStyleInterface","_applyShim","watcherFlush","getStyleAst","styleAstToString","prepareTemplate","prepareTemplateDom","prepareTemplateStyles","_prepared","optimalBuild","styleTextParts","styles","hasAttribute","scopingAttribute","newStyle","_ensure","hasMixins","ownPropertyNames","shadowroot","_style","_ownPropertyNames","prepareAdoptedCssText","cssTextArray","_domPrepared","_prepareHost","_ensureCustomStyleInterface","CustomStyleInterface","transformCustomStyleForDocument","flushCustomStyles","_ensureApplyShim","ApplyShim","needsApplyShimUpdate","customStyles","_revalidateCustomStyleApplyShim","_reorderCustomStylesRules","_updateProperties","_applyCustomStyles","styleDocument","DOCUMENT_POSITION_FOLLOWING","overrideProps","styleElementNativeVariables","_isRootOwner","styleElementShimVariables","cacheEntry","entry","pn","cachedStyle","oldScopeSelector","cachedScopeSelector","applyElementStyle","removeProperty","setProperty","_styleOwnerForNode","owner","ownerStyleInfo","ownerProperties","hostAndRootProps","propertiesMatchingHost","propertyData","overrides","reify","styleSubtree","wrappedHost","isRootOwner","descendantRoot","descendantHosts","from","documentRule","_transformRule","getComputedStyleValue","getComputedStyle","getPropertyValue","setElementClass","classString","classes","definitelyString","String","scopeName","classAttr","k$","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J,GACEv+B,MADF,CACSiuB,QADT,CACkBsQ,oBADlB,CACyCA,EADzC,C","file":"webcomponents-sd.js","sourcesContent":["/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport class ShadyData {\n /** @override */\n toJSON() {\n return {};\n }\n}\n\nexport function ensureShadyDataForNode(node) {\n if (!node.__shady) {\n node.__shady = new ShadyData();\n }\n return node.__shady;\n}\n\nexport function shadyDataForNode(node) {\n return node && node.__shady;\n}\n",null,null,null,null,null,"/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport {shadyDataForNode} from './shady-data.js';\n\n/** @type {!Object} */\nexport const settings = window['ShadyDOM'] || {};\n\nsettings.hasNativeShadowDOM = Boolean(\n Element.prototype.attachShadow && Node.prototype.getRootNode\n);\n\n// The user might need to pass the custom elements polyfill a flag by setting an\n// object to `customElements`, so check for `customElements.define` also.\nexport const hasCustomElements = () =>\n Boolean(window.customElements && window.customElements.define);\n// The custom elements polyfill is typically loaded after Shady DOM, so this\n// check isn't reliable during initial evaluation. However, because the\n// polyfills are loaded immediately after one another, it works at runtime.\nexport const hasPolyfilledCustomElements = () =>\n Boolean(\n window.customElements && window.customElements['polyfillWrapFlushCallback']\n );\n\nconst desc = Object.getOwnPropertyDescriptor(Node.prototype, 'firstChild');\n\nsettings.hasDescriptors = Boolean(desc && desc.configurable && desc.get);\nsettings.inUse = settings['force'] || !settings.hasNativeShadowDOM;\nsettings.noPatch = /** @type {string|boolean} */ (settings['noPatch'] || false);\n// eslint-disable-next-line no-self-assign\nsettings.preferPerformance = settings['preferPerformance'];\nsettings.patchOnDemand = settings.noPatch === 'on-demand';\nsettings.querySelectorImplementation = (() => {\n const acceptedValues = ['native', 'selectorEngine'];\n const userValue = settings['querySelectorImplementation'];\n if (acceptedValues.indexOf(userValue) > -1) {\n return userValue;\n }\n return undefined;\n})();\n\nconst IS_IE = navigator.userAgent.match('Trident');\nsettings.IS_IE = IS_IE;\n\n// Helper for prefixed properties.\nexport const getPropertyName = (obj, name) => {\n const prefixed = `ms${name[0].toUpperCase() + name.slice(1)}`;\n return obj[prefixed] ? prefixed : name;\n};\n\nexport const canUpgrade = () => !settings.IS_IE;\n\nexport const isTrackingLogicalChildNodes = (node) => {\n const nodeData = shadyDataForNode(node);\n return nodeData && nodeData.firstChild !== undefined;\n};\n\nexport const isShadyRoot = (obj) => obj instanceof ShadowRoot;\n\nexport const hasShadowRootWithSlot = (node) => {\n const nodeData = shadyDataForNode(node);\n let root = nodeData && nodeData.root;\n return root && root._hasInsertionPoint();\n};\n\nlet p = Element.prototype;\nlet matches =\n p.matches ||\n p.matchesSelector ||\n p.mozMatchesSelector ||\n p.msMatchesSelector ||\n p.oMatchesSelector ||\n p.webkitMatchesSelector;\n\nexport const matchesSelector = (element, selector) => {\n return matches.call(element, selector);\n};\n\nexport const mixin = (target, source) => {\n for (var i in source) {\n target[i] = source[i];\n }\n return target;\n};\n\n// NOTE, prefer MutationObserver over Promise for microtask timing\n// for consistency x-platform.\nlet twiddle = document.createTextNode('');\nlet content = 0;\nlet queue = [];\nnew MutationObserver(() => {\n while (queue.length) {\n // catch errors in user code...\n try {\n queue.shift()();\n } catch (e) {\n // enqueue another record and throw\n twiddle.textContent = content++;\n throw e;\n }\n }\n}).observe(twiddle, {characterData: true});\n\n// use MutationObserver to get microtask async timing.\nexport const microtask = (callback) => {\n queue.push(callback);\n twiddle.textContent = content++;\n};\n\n/** @type {function(!Document, !Node): boolean} */\nexport const documentContains = (() => {\n if (document.contains) {\n return (doc, node) => doc[NATIVE_PREFIX + 'contains'](node);\n } else {\n return (doc, node) =>\n doc === node ||\n (doc.documentElement &&\n doc.documentElement[NATIVE_PREFIX + 'contains'](node));\n }\n})();\n\nexport const contains = (container, node) => {\n while (node) {\n if (node == container) {\n return true;\n }\n node = node[SHADY_PREFIX + 'parentNode'];\n }\n return false;\n};\n\nconst getNodeHTMLCollectionName = (node) =>\n node.getAttribute('id') || node.getAttribute('name');\n\nconst isValidHTMLCollectionName = (name) => name !== 'length' && isNaN(name);\n\nexport const createPolyfilledHTMLCollection = (nodes) => {\n // Note: loop in reverse so that the first named item matches the named property\n for (let l = nodes.length - 1; l >= 0; l--) {\n const node = nodes[l];\n const name = getNodeHTMLCollectionName(node);\n\n if (name && isValidHTMLCollectionName(name)) {\n nodes[name] = node;\n }\n }\n nodes.item = function (index) {\n return nodes[index];\n };\n nodes.namedItem = function (name) {\n if (isValidHTMLCollectionName(name) && nodes[name]) {\n return nodes[name];\n }\n\n for (const node of nodes) {\n const nodeName = getNodeHTMLCollectionName(node);\n\n if (nodeName == name) {\n return node;\n }\n }\n\n return null;\n };\n return nodes;\n};\n\nexport const NATIVE_PREFIX = '__shady_native_';\nexport const SHADY_PREFIX = '__shady_';\n\nexport const nativeChildNodesArray = (parent) => {\n const result = [];\n for (\n let n = parent[NATIVE_PREFIX + 'firstChild'];\n n;\n n = n[NATIVE_PREFIX + 'nextSibling']\n ) {\n result.push(n);\n }\n return result;\n};\n\nexport const childNodesArray = (parent) => {\n const result = [];\n for (\n let n = parent[SHADY_PREFIX + 'firstChild'];\n n;\n n = n[SHADY_PREFIX + 'nextSibling']\n ) {\n result.push(n);\n }\n return result;\n};\n\nconst patchProperty = (proto, name, descriptor) => {\n descriptor.configurable = true;\n // NOTE: we prefer writing directly because some browsers\n // have descriptors that are writable but not configurable (e.g.\n // `appendChild` on older browsers)\n if (descriptor.value) {\n proto[name] = descriptor.value;\n } else {\n try {\n Object.defineProperty(proto, name, descriptor);\n } catch (e) {\n // this error is harmless so we just trap it.\n }\n }\n};\n\n/**\n * Patch a group of accessors on an object. By default this overrides\n * @param {!Object} proto\n * @param {!Object} descriptors\n * @param {string=} prefix\n * @param {Array=} disallowedPatches\n */\nexport const patchProperties = (\n proto,\n descriptors,\n prefix = '',\n disallowedPatches\n) => {\n for (let name in descriptors) {\n if (disallowedPatches && disallowedPatches.indexOf(name) >= 0) {\n continue;\n }\n patchProperty(proto, prefix + name, descriptors[name]);\n }\n};\n\nexport const patchExistingProperties = (proto, descriptors) => {\n for (let name in descriptors) {\n if (name in proto) {\n patchProperty(proto, name, descriptors[name]);\n }\n }\n};\n\n// note, this is not a perfect polyfill since it doesn't include symbols\n/** @return {!Object<!ObjectPropertyDescriptor>} */\nexport const getOwnPropertyDescriptors = (obj) => {\n const descriptors = {};\n Object.getOwnPropertyNames(obj).forEach((name) => {\n descriptors[name] = Object.getOwnPropertyDescriptor(obj, name);\n });\n return descriptors;\n};\n\nexport const assign = (target, source) => {\n const names = Object.getOwnPropertyNames(source);\n for (let i = 0, p; i < names.length; i++) {\n p = names[i];\n target[p] = source[p];\n }\n};\n\nexport const arrayFrom = (object) => {\n return [].slice.call(/** @type {IArrayLike} */ (object));\n};\n\n/**\n * Converts a single value to a node for `convertNodesIntoANode`.\n *\n * @param {*} arg\n * @return {!Node}\n */\nconst convertIntoANode = (arg) => {\n // `\"\" + arg` is used to implicitly coerce the value to a string (coercing a\n // symbol *should* fail here) before passing to `createTextNode`, which has\n // argument type `(number|string)`.\n return !(arg instanceof Node) ? document.createTextNode('' + arg) : arg;\n};\n\n/**\n * Implements 'convert nodes into a node'. The spec text indicates that strings\n * become text nodes, but doesn't describe what should happen if a non-Node,\n * non-string value is found in the arguments list. In practice, browsers coerce\n * these values to strings and convert those to text nodes.\n * https://dom.spec.whatwg.org/#converting-nodes-into-a-node\n *\n * @param {...*} args\n * @return {!Node}\n */\nexport const convertNodesIntoANode = (...args) => {\n if (args.length === 1) {\n return convertIntoANode(args[0]);\n }\n\n const fragment = document.createDocumentFragment();\n for (const arg of args) {\n fragment.appendChild(convertIntoANode(arg));\n }\n return fragment;\n};\n\n/**\n * Equivalent to `Array.prototype.flat`. Closure does not compile out this\n * function, so we need an implementation for browsers that don't natively\n * support it.\n *\n * @template T\n * @param {!Array<!T | !Array<!T>>} array\n * @param {number} depth\n * @return {!Array<!T>}\n */\nexport const flat = (array, depth = 1) => {\n for (; depth > 0; depth--) {\n array = array.reduce((acc, item) => {\n if (Array.isArray(item)) {\n acc.push(...item);\n } else {\n acc.push(item);\n }\n return acc;\n }, []);\n }\n\n return array;\n};\n\n/**\n * Deduplicates items in an array.\n *\n * This function could normally be implemented as merely `Array.from(new\n * Set(...))`. However, in IE 11, `Set` does not support being constructed with\n * an iterable. Further, some polyfills for `Array.from` effectively default to\n * `Array.prototype.slice.call(...)` when they are unable to find\n * `[Symbol.iterator]`; this is incompatible with `Set` which has no `length` or\n * indexable properties.\n *\n * @template T\n * @param {!Array<!T>} array\n * @return {!Array<!T>}\n */\nexport const deduplicate = (array) => {\n const results = [];\n const set = new Set();\n for (const item of array) {\n if (!set.has(item)) {\n results.push(item);\n set.add(item);\n }\n }\n return results;\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport * as utils from './utils.js';\nimport {patchProperties} from './utils.js';\nimport {getInnerHTML} from './innerHTML.js';\n\nconst hasDescriptors = utils.settings.hasDescriptors;\nexport const NATIVE_PREFIX = utils.NATIVE_PREFIX;\n\n// Object on which raw native methods are stored.\n// e.g. `nativeMethods.querySelector.call(node, selector)`\n// same as `node.querySelector(selector)`\nexport const nativeMethods = {\n /** @this {Element} */\n querySelector(selector) {\n return this[NATIVE_PREFIX + 'querySelector'](selector);\n },\n /** @this {Element} */\n querySelectorAll(selector) {\n return this[NATIVE_PREFIX + 'querySelectorAll'](selector);\n },\n};\n// Object on which raw native accessors are available via `accessorName(node)`.\n// e.g. `nativeTree.firstChild(node)`\n// same as `node.firstChild`\nexport const nativeTree = {};\n\nconst installNativeAccessor = (name) => {\n nativeTree[name] = (node) => node[NATIVE_PREFIX + name];\n};\n\nconst installNativeMethod = (name, fn) => {\n if (!nativeMethods[name]) {\n nativeMethods[name] = fn;\n }\n};\n\nconst defineNativeAccessors = (proto, descriptors) => {\n patchProperties(proto, descriptors, NATIVE_PREFIX);\n // make native accessors available to users\n for (let prop in descriptors) {\n installNativeAccessor(prop);\n }\n};\n\nconst copyProperties = (proto, list = []) => {\n for (let i = 0; i < list.length; i++) {\n const name = list[i];\n const descriptor = Object.getOwnPropertyDescriptor(proto, name);\n if (descriptor) {\n Object.defineProperty(proto, NATIVE_PREFIX + name, descriptor);\n // make native methods/accessors available to users\n if (descriptor.value) {\n installNativeMethod(name, descriptor.value);\n } else {\n installNativeAccessor(name);\n }\n }\n }\n};\n\n/** @type {!TreeWalker} */\nconst nodeWalker = document.createTreeWalker(\n document,\n NodeFilter.SHOW_ALL,\n null,\n false\n);\n\n/** @type {!TreeWalker} */\nconst elementWalker = document.createTreeWalker(\n document,\n NodeFilter.SHOW_ELEMENT,\n null,\n false\n);\n\n/** @type {!Document} */\nconst inertDoc = document.implementation.createHTMLDocument('inert');\n\nconst clearNode = (node) => {\n let firstChild;\n while ((firstChild = node[NATIVE_PREFIX + 'firstChild'])) {\n node[NATIVE_PREFIX + 'removeChild'](firstChild);\n }\n};\n\nconst ParentNodeAccessors = [\n 'firstElementChild',\n 'lastElementChild',\n 'children',\n 'childElementCount',\n];\n\nconst ParentNodeMethods = [\n 'querySelector',\n 'querySelectorAll',\n 'append',\n 'prepend',\n 'replaceChildren',\n];\n\nexport const addNativePrefixedProperties = () => {\n // EventTarget\n const eventProps = [\n 'dispatchEvent',\n 'addEventListener',\n 'removeEventListener',\n ];\n if (window.EventTarget) {\n copyProperties(window.EventTarget.prototype, eventProps);\n\n // In Firefox 31, `EventTarget` exists, but `EventTarget.prototype` is not\n // in the prototype chain of `window` and, strangely,\n // `window instanceof EventTarget` still returns true.\n if (window[NATIVE_PREFIX + 'addEventListener'] === undefined) {\n copyProperties(Window.prototype, eventProps);\n }\n } else {\n copyProperties(Node.prototype, eventProps);\n copyProperties(Window.prototype, eventProps);\n copyProperties(XMLHttpRequest.prototype, eventProps);\n }\n\n // Node\n if (hasDescriptors) {\n copyProperties(Node.prototype, [\n 'parentNode',\n 'firstChild',\n 'lastChild',\n 'previousSibling',\n 'nextSibling',\n 'childNodes',\n 'parentElement',\n 'textContent',\n ]);\n } else {\n defineNativeAccessors(Node.prototype, {\n parentNode: {\n /** @this {Node} */\n get() {\n nodeWalker.currentNode = this;\n return nodeWalker.parentNode();\n },\n },\n firstChild: {\n /** @this {Node} */\n get() {\n nodeWalker.currentNode = this;\n return nodeWalker.firstChild();\n },\n },\n lastChild: {\n /** @this {Node} */\n get() {\n nodeWalker.currentNode = this;\n return nodeWalker.lastChild();\n },\n },\n previousSibling: {\n /** @this {Node} */\n get() {\n nodeWalker.currentNode = this;\n return nodeWalker.previousSibling();\n },\n },\n nextSibling: {\n /** @this {Node} */\n get() {\n nodeWalker.currentNode = this;\n return nodeWalker.nextSibling();\n },\n },\n // TODO(sorvell): make this a NodeList or whatever\n childNodes: {\n /** @this {Node} */\n get() {\n const nodes = [];\n nodeWalker.currentNode = this;\n let n = nodeWalker.firstChild();\n while (n) {\n nodes.push(n);\n n = nodeWalker.nextSibling();\n }\n return nodes;\n },\n },\n parentElement: {\n /** @this {Node} */\n get() {\n elementWalker.currentNode = this;\n return elementWalker.parentNode();\n },\n },\n textContent: {\n /** @this {Node} */\n get() {\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.DOCUMENT_FRAGMENT_NODE:\n // TODO(sorvell): This cannot be a single TreeWalker that's reused\n // at least for Safari 9, but it's unclear why.\n // eslint-disable-next-line no-case-declarations\n const textWalker = document.createTreeWalker(\n this,\n NodeFilter.SHOW_TEXT,\n null,\n false\n );\n // eslint-disable-next-line no-case-declarations\n let content = '',\n n;\n while ((n = textWalker.nextNode())) {\n // TODO(sorvell): can't use textContent since we patch it on Node.prototype!\n // However, should probably patch it only on element.\n content += n.nodeValue;\n }\n return content;\n default:\n return this.nodeValue;\n }\n },\n // Needed on browsers that do not proper accessors (e.g. old versions of Chrome)\n /** @this {Node} */\n set(value) {\n if (typeof value === 'undefined' || value === null) {\n value = '';\n }\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.DOCUMENT_FRAGMENT_NODE:\n clearNode(this);\n // Document fragments must have no childnodes if setting a blank string\n if (value.length > 0 || this.nodeType === Node.ELEMENT_NODE) {\n // Note: old Chrome versions require 2nd argument here\n this[NATIVE_PREFIX + 'insertBefore'](\n document.createTextNode(value),\n undefined\n );\n }\n break;\n default:\n // TODO(sorvell): can't do this if patch nodeValue.\n this.nodeValue = value;\n break;\n }\n },\n },\n });\n }\n\n copyProperties(Node.prototype, [\n 'appendChild',\n 'insertBefore',\n 'removeChild',\n 'replaceChild',\n 'cloneNode',\n 'contains',\n ]);\n\n // NOTE, on some browsers IE 11 / Edge 15 some properties are incorrectly on HTMLElement\n copyProperties(HTMLElement.prototype, ['parentElement', 'contains']);\n\n const ParentNodeWalkerDescriptors = {\n firstElementChild: {\n /** @this {ParentNode} */\n get() {\n elementWalker.currentNode = this;\n return elementWalker.firstChild();\n },\n },\n lastElementChild: {\n /** @this {ParentNode} */\n get() {\n elementWalker.currentNode = this;\n return elementWalker.lastChild();\n },\n },\n children: {\n /** @this {ParentNode} */\n get() {\n let nodes = [];\n elementWalker.currentNode = this;\n let n = elementWalker.firstChild();\n while (n) {\n nodes.push(n);\n n = elementWalker.nextSibling();\n }\n return utils.createPolyfilledHTMLCollection(nodes);\n },\n },\n childElementCount: {\n /** @this {ParentNode} */\n get() {\n if (this.children) {\n return this.children.length;\n }\n return 0;\n },\n },\n };\n\n // Element\n if (hasDescriptors) {\n copyProperties(Element.prototype, ParentNodeAccessors);\n\n copyProperties(Element.prototype, [\n 'previousElementSibling',\n 'nextElementSibling',\n 'innerHTML',\n 'className',\n ]);\n\n // NOTE, on some browsers IE 11 / Edge 15 some properties are incorrectly on HTMLElement\n copyProperties(HTMLElement.prototype, [\n 'children',\n 'innerHTML',\n 'className',\n ]);\n } else {\n defineNativeAccessors(Element.prototype, ParentNodeWalkerDescriptors);\n defineNativeAccessors(Element.prototype, {\n previousElementSibling: {\n /** @this {Element} */\n get() {\n elementWalker.currentNode = this;\n return elementWalker.previousSibling();\n },\n },\n nextElementSibling: {\n /** @this {Element} */\n get() {\n elementWalker.currentNode = this;\n return elementWalker.nextSibling();\n },\n },\n innerHTML: {\n /** @this {Element} */\n get() {\n return getInnerHTML(this, utils.nativeChildNodesArray);\n },\n // Needed on browsers that do not proper accessors (e.g. old versions of Chrome)\n /** @this {Element} */\n set(value) {\n const content =\n this.localName === 'template'\n ? /** @type {HTMLTemplateElement} */ (this).content\n : this;\n clearNode(content);\n const containerName = this.localName || 'div';\n let htmlContainer;\n if (\n !this.namespaceURI ||\n this.namespaceURI === inertDoc.namespaceURI\n ) {\n htmlContainer = inertDoc.createElement(containerName);\n } else {\n htmlContainer = inertDoc.createElementNS(\n this.namespaceURI,\n containerName\n );\n }\n htmlContainer.innerHTML = value;\n const newContent =\n this.localName === 'template'\n ? /** @type {HTMLTemplateElement} */ (htmlContainer).content\n : htmlContainer;\n let firstChild;\n while ((firstChild = newContent[NATIVE_PREFIX + 'firstChild'])) {\n // Note: old Chrome versions require 2nd argument here\n content[NATIVE_PREFIX + 'insertBefore'](firstChild, undefined);\n }\n },\n },\n className: {\n /** @this {Element} */\n get() {\n return this.getAttribute('class') || '';\n },\n /** @this {Element} */\n set(value) {\n this.setAttribute('class', value);\n },\n },\n });\n }\n\n copyProperties(Element.prototype, [\n 'setAttribute',\n 'getAttribute',\n 'hasAttribute',\n 'removeAttribute',\n // on older Safari, these are on Element.\n 'focus',\n 'blur',\n ]);\n copyProperties(Element.prototype, ParentNodeMethods);\n\n // HTMLElement\n copyProperties(HTMLElement.prototype, ['focus', 'blur']);\n\n // HTMLTemplateElement\n if (window.HTMLTemplateElement) {\n copyProperties(window.HTMLTemplateElement.prototype, ['innerHTML']);\n }\n\n // DocumentFragment\n if (hasDescriptors) {\n // NOTE, IE 11 does not have on DocumentFragment\n // firstElementChild\n // lastElementChild\n copyProperties(DocumentFragment.prototype, ParentNodeAccessors);\n } else {\n defineNativeAccessors(\n DocumentFragment.prototype,\n ParentNodeWalkerDescriptors\n );\n }\n\n copyProperties(DocumentFragment.prototype, ParentNodeMethods);\n\n // Document\n if (hasDescriptors) {\n copyProperties(Document.prototype, ParentNodeAccessors);\n copyProperties(Document.prototype, ['activeElement']);\n } else {\n defineNativeAccessors(Document.prototype, ParentNodeWalkerDescriptors);\n }\n\n copyProperties(Document.prototype, [\n 'importNode',\n 'getElementById',\n 'elementFromPoint',\n utils.getPropertyName(Document.prototype, 'elementsFromPoint'),\n ]);\n copyProperties(Document.prototype, ParentNodeMethods);\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\n\n// render enqueuer/flusher\nlet flushList = [];\nlet scheduled;\nexport function enqueue(callback) {\n if (!scheduled) {\n scheduled = true;\n utils.microtask(flush);\n }\n flushList.push(callback);\n}\n\nexport function flush() {\n scheduled = false;\n let didFlush = Boolean(flushList.length);\n while (flushList.length) {\n flushList.shift()();\n }\n return didFlush;\n}\n\nflush['list'] = flushList;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {ensureShadyDataForNode} from './shady-data.js';\n\nclass AsyncObserver {\n constructor() {\n this._scheduled = false;\n this.addedNodes = [];\n this.removedNodes = [];\n this.callbacks = new Set();\n }\n\n schedule() {\n if (!this._scheduled) {\n this._scheduled = true;\n utils.microtask(() => {\n this.flush();\n });\n }\n }\n\n flush() {\n if (this._scheduled) {\n this._scheduled = false;\n let mutations = this.takeRecords();\n if (mutations.length) {\n this.callbacks.forEach(function (cb) {\n cb(mutations);\n });\n }\n }\n }\n\n takeRecords() {\n if (this.addedNodes.length || this.removedNodes.length) {\n let mutations = [\n {\n addedNodes: this.addedNodes,\n removedNodes: this.removedNodes,\n },\n ];\n this.addedNodes = [];\n this.removedNodes = [];\n return mutations;\n }\n return [];\n }\n}\n\n// TODO(sorvell): consider instead polyfilling MutationObserver\n// directly so that users do not have to fork their code.\n// Supporting the entire api may be challenging: e.g. filtering out\n// removed nodes in the wrong scope and seeing non-distributing\n// subtree child mutations.\nexport let observeChildren = function (node, callback) {\n const sd = ensureShadyDataForNode(node);\n if (!sd.observer) {\n sd.observer = new AsyncObserver();\n }\n sd.observer.callbacks.add(callback);\n let observer = sd.observer;\n return {\n _callback: callback,\n _observer: observer,\n _node: node,\n takeRecords() {\n return observer.takeRecords();\n },\n };\n};\n\nexport let unobserveChildren = function (handle) {\n let observer = handle && handle._observer;\n if (observer) {\n observer.callbacks.delete(handle._callback);\n if (!observer.callbacks.size) {\n ensureShadyDataForNode(handle._node).observer = null;\n }\n }\n};\n\nexport function filterMutations(mutations, target) {\n /** @const {Node} */\n const targetRootNode = target.getRootNode();\n return mutations\n .map(function (mutation) {\n /** @const {boolean} */\n const mutationInScope = targetRootNode === mutation.target.getRootNode();\n if (mutationInScope && mutation.addedNodes) {\n let nodes = utils.arrayFrom(mutation.addedNodes).filter(function (n) {\n return targetRootNode === n.getRootNode();\n });\n if (nodes.length) {\n mutation = Object.create(mutation);\n Object.defineProperty(mutation, 'addedNodes', {\n value: nodes,\n configurable: true,\n });\n return mutation;\n }\n } else if (mutationInScope) {\n return mutation;\n }\n })\n .filter(function (m) {\n return m;\n });\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n// Cribbed from ShadowDOM polyfill\n// https://github.com/webcomponents/webcomponentsjs/blob/master/src/ShadowDOM/wrappers/HTMLElement.js#L28\n/////////////////////////////////////////////////////////////////////////////\n// innerHTML and outerHTML\n\n// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#escapingString\nlet escapeAttrRegExp = /[&\\u00A0\"]/g;\nlet escapeDataRegExp = /[&\\u00A0<>]/g;\n\nfunction escapeReplace(c) {\n switch (c) {\n case '&':\n return '&amp;';\n case '<':\n return '&lt;';\n case '>':\n return '&gt;';\n case '\"':\n return '&quot;';\n case '\\u00A0':\n return '&nbsp;';\n }\n}\n\nfunction escapeAttr(s) {\n return s.replace(escapeAttrRegExp, escapeReplace);\n}\n\nfunction escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n}\n\nfunction makeSet(arr) {\n let set = {};\n for (let i = 0; i < arr.length; i++) {\n set[arr[i]] = true;\n }\n return set;\n}\n\n// http://www.whatwg.org/specs/web-apps/current-work/#void-elements\nlet voidElements = makeSet([\n 'area',\n 'base',\n 'br',\n 'col',\n 'command',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'keygen',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n]);\n\nlet plaintextParents = makeSet([\n 'style',\n 'script',\n 'xmp',\n 'iframe',\n 'noembed',\n 'noframes',\n 'plaintext',\n 'noscript',\n]);\n\n/**\n * @param {Node} node\n * @param {Node} parentNode\n * @param {Function=} callback\n */\nexport function getOuterHTML(node, parentNode, callback) {\n switch (node.nodeType) {\n case Node.ELEMENT_NODE: {\n let tagName = node.localName;\n let s = '<' + tagName;\n let attrs = node.attributes;\n for (let i = 0, attr; (attr = attrs[i]); i++) {\n s += ' ' + attr.name + '=\"' + escapeAttr(attr.value) + '\"';\n }\n s += '>';\n if (voidElements[tagName]) {\n return s;\n }\n return s + getInnerHTML(node, callback) + '</' + tagName + '>';\n }\n case Node.TEXT_NODE: {\n let data = /** @type {Text} */ (node).data;\n if (parentNode && plaintextParents[parentNode.localName]) {\n return data;\n }\n return escapeData(data);\n }\n case Node.COMMENT_NODE: {\n return '<!--' + /** @type {Comment} */ (node).data + '-->';\n }\n default: {\n window.console.error(node);\n throw new Error('not implemented');\n }\n }\n}\n\n/**\n * @param {Node} node\n * @param {Function=} callback\n */\nexport function getInnerHTML(node, callback) {\n if (node.localName === 'template') {\n node = /** @type {HTMLTemplateElement} */ (node).content;\n }\n let s = '';\n let c$ = callback ? callback(node) : node.childNodes;\n for (let i = 0, l = c$.length, child; i < l && (child = c$[i]); i++) {\n s += getOuterHTML(child, node, callback);\n }\n return s;\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {ensureShadyDataForNode} from './shady-data.js';\n\nexport const InsideDescriptors = utils.getOwnPropertyDescriptors({\n /** @this {Node} */\n get childNodes() {\n return this[utils.SHADY_PREFIX + 'childNodes'];\n },\n\n /** @this {Node} */\n get firstChild() {\n return this[utils.SHADY_PREFIX + 'firstChild'];\n },\n\n /** @this {Node} */\n get lastChild() {\n return this[utils.SHADY_PREFIX + 'lastChild'];\n },\n\n /** @this {Node} */\n get childElementCount() {\n return this[utils.SHADY_PREFIX + 'childElementCount'];\n },\n\n /** @this {Node} */\n get children() {\n return this[utils.SHADY_PREFIX + 'children'];\n },\n\n /** @this {Node} */\n get firstElementChild() {\n return this[utils.SHADY_PREFIX + 'firstElementChild'];\n },\n\n /** @this {Node} */\n get lastElementChild() {\n return this[utils.SHADY_PREFIX + 'lastElementChild'];\n },\n\n /** @this {Node} */\n get shadowRoot() {\n return this[utils.SHADY_PREFIX + 'shadowRoot'];\n },\n});\n\nexport const TextContentInnerHTMLDescriptors = utils.getOwnPropertyDescriptors({\n /** @this {Node} */\n get textContent() {\n return this[utils.SHADY_PREFIX + 'textContent'];\n },\n\n /** @this {Node} */\n set textContent(value) {\n this[utils.SHADY_PREFIX + 'textContent'] = value;\n },\n\n /** @this {Node} */\n get innerHTML() {\n return this[utils.SHADY_PREFIX + 'innerHTML'];\n },\n\n /** @this {Node} */\n set innerHTML(value) {\n this[utils.SHADY_PREFIX + 'innerHTML'] = value;\n },\n});\n\nexport const OutsideDescriptors = utils.getOwnPropertyDescriptors({\n /** @this {Node} */\n get parentElement() {\n return this[utils.SHADY_PREFIX + 'parentElement'];\n },\n\n /** @this {Node} */\n get parentNode() {\n return this[utils.SHADY_PREFIX + 'parentNode'];\n },\n\n /** @this {Node} */\n get nextSibling() {\n return this[utils.SHADY_PREFIX + 'nextSibling'];\n },\n\n /** @this {Node} */\n get previousSibling() {\n return this[utils.SHADY_PREFIX + 'previousSibling'];\n },\n\n /** @this {Node} */\n get nextElementSibling() {\n return this[utils.SHADY_PREFIX + 'nextElementSibling'];\n },\n\n /** @this {Node} */\n get previousElementSibling() {\n return this[utils.SHADY_PREFIX + 'previousElementSibling'];\n },\n\n /** @this {Node} */\n get className() {\n return this[utils.SHADY_PREFIX + 'className'];\n },\n\n /** @this {Node} */\n set className(value) {\n this[utils.SHADY_PREFIX + 'className'] = value;\n },\n});\n\nconst makeNonEnumerable = (descriptors) => {\n for (let prop in descriptors) {\n const descriptor = descriptors[prop];\n // NOTE, the only known reason the descriptor wouldn't exist here is\n // if someone has patched `Object.getOwnPropertyNames`, but we've seen this\n // so this is just to be extra safe.\n if (descriptor) {\n descriptor.enumerable = false;\n }\n }\n};\n\nmakeNonEnumerable(InsideDescriptors);\nmakeNonEnumerable(TextContentInnerHTMLDescriptors);\nmakeNonEnumerable(OutsideDescriptors);\n\nconst noInstancePatching =\n utils.settings.hasDescriptors || utils.settings.noPatch === true;\n\n// ensure an element has patched \"outside\" accessors; no-op when not needed\nexport let patchOutsideElementAccessors = noInstancePatching\n ? function () {}\n : function (element) {\n const sd = ensureShadyDataForNode(element);\n if (!sd.__outsideAccessors) {\n sd.__outsideAccessors = true;\n utils.patchExistingProperties(element, OutsideDescriptors);\n }\n };\n\n// ensure an element has patched \"inside\" accessors; no-op when not needed\nexport let patchInsideElementAccessors = noInstancePatching\n ? function () {}\n : function (element) {\n const sd = ensureShadyDataForNode(element);\n if (!sd.__insideAccessors) {\n sd.__insideAccessors = true;\n utils.patchExistingProperties(element, InsideDescriptors);\n // NOTE: There are compatibility issues with patches for `textContent`\n // and `innerHTML` between CE and SD. Since SD patches are applied\n // via `ShadyDOM.patch` and CE patches are applied as the tree is walked,\n // SD patches overwrite CE patches.\n // * When SD is in patching mode, SD calls through to native\n // methods not patched by CE (since SD is at the bottom) and CE does not\n // upgrade, connect, or disconnect elements. Therefore do *not patch*\n // these accessors in this case.\n // * When SD is in `noPatch` mode, the SD patches call through to\n // \"native\" methods that are patched by CE (since CE is at the bottom).\n // Therefore continue to patch in this case.\n // If the custom elements polyfill is not loaded, then these accessors\n // should be patched so they work correctly.\n if (!utils.hasPolyfilledCustomElements() || utils.settings.noPatch) {\n utils.patchExistingProperties(\n element,\n TextContentInnerHTMLDescriptors\n );\n }\n }\n };\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {flush} from './flush.js';\nimport {shadyDataForNode, ensureShadyDataForNode} from './shady-data.js';\n\n/*\nMake this name unique so it is unlikely to conflict with properties on objects passed to `addEventListener`\nhttps://github.com/webcomponents/shadydom/issues/173\n*/\nconst /** string */ eventWrappersName = `__eventWrappers${Date.now()}`;\n\n/** @type {?function(!Event): boolean} */\nconst composedGetter = (() => {\n const composedProp = Object.getOwnPropertyDescriptor(\n Event.prototype,\n 'composed'\n );\n return composedProp ? (ev) => composedProp.get.call(ev) : null;\n})();\n\nconst supportsEventOptions = (() => {\n let supported = false;\n let eventOptions = {\n get capture() {\n supported = true;\n return false;\n },\n };\n const listener = () => {};\n // NOTE: These will be unpatched at this point.\n window.addEventListener('test', listener, eventOptions);\n window.removeEventListener('test', listener, eventOptions);\n return supported;\n})();\n\nconst parseEventOptions = (optionsOrCapture) => {\n let capture, once, shadyTarget;\n if (\n optionsOrCapture !== null &&\n (typeof optionsOrCapture === 'object' ||\n typeof optionsOrCapture === 'function')\n ) {\n capture = Boolean(optionsOrCapture.capture);\n once = Boolean(optionsOrCapture.once);\n shadyTarget = optionsOrCapture.__shadyTarget;\n } else {\n capture = Boolean(optionsOrCapture);\n once = false;\n }\n return {\n shadyTarget,\n capture,\n once,\n nativeEventOptions: supportsEventOptions ? optionsOrCapture : capture,\n };\n};\n\n// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937\nconst alwaysComposed = {\n 'blur': true,\n 'focus': true,\n 'focusin': true,\n 'focusout': true,\n 'click': true,\n 'dblclick': true,\n 'mousedown': true,\n 'mouseenter': true,\n 'mouseleave': true,\n 'mousemove': true,\n 'mouseout': true,\n 'mouseover': true,\n 'mouseup': true,\n 'wheel': true,\n 'beforeinput': true,\n 'input': true,\n 'keydown': true,\n 'keyup': true,\n 'compositionstart': true,\n 'compositionupdate': true,\n 'compositionend': true,\n 'touchstart': true,\n 'touchend': true,\n 'touchmove': true,\n 'touchcancel': true,\n 'pointerover': true,\n 'pointerenter': true,\n 'pointerdown': true,\n 'pointermove': true,\n 'pointerup': true,\n 'pointercancel': true,\n 'pointerout': true,\n 'pointerleave': true,\n 'gotpointercapture': true,\n 'lostpointercapture': true,\n 'dragstart': true,\n 'drag': true,\n 'dragenter': true,\n 'dragleave': true,\n 'dragover': true,\n 'drop': true,\n 'dragend': true,\n 'DOMActivate': true,\n 'DOMFocusIn': true,\n 'DOMFocusOut': true,\n 'keypress': true,\n};\n\nconst unpatchedEvents = {\n 'DOMAttrModified': true,\n 'DOMAttributeNameChanged': true,\n 'DOMCharacterDataModified': true,\n 'DOMElementNameChanged': true,\n 'DOMNodeInserted': true,\n 'DOMNodeInsertedIntoDocument': true,\n 'DOMNodeRemoved': true,\n 'DOMNodeRemovedFromDocument': true,\n 'DOMSubtreeModified': true,\n};\n\n/**\n * Some EventTarget subclasses are not Node subclasses, and you cannot call\n * `getRootNode()` on them.\n *\n * @param {!(Node|EventTarget)} eventTarget\n * @return {!(Node|EventTarget)}\n */\nfunction getRootNodeWithFallback(eventTarget) {\n if (eventTarget instanceof Node) {\n return eventTarget[utils.SHADY_PREFIX + 'getRootNode']();\n } else {\n return eventTarget;\n }\n}\n\nfunction pathComposer(startNode, composed) {\n let composedPath = [];\n let current = startNode;\n let startRoot = getRootNodeWithFallback(startNode);\n while (current) {\n composedPath.push(current);\n if (current[utils.SHADY_PREFIX + 'assignedSlot']) {\n current = current[utils.SHADY_PREFIX + 'assignedSlot'];\n } else if (\n current.nodeType === Node.DOCUMENT_FRAGMENT_NODE &&\n current.host &&\n (composed || current !== startRoot)\n ) {\n current = current.host;\n } else {\n current = current[utils.SHADY_PREFIX + 'parentNode'];\n }\n }\n // event composedPath includes window when startNode's ownerRoot is document\n if (composedPath[composedPath.length - 1] === document) {\n composedPath.push(window);\n }\n return composedPath;\n}\n\nexport const composedPath = (event) => {\n if (!event.__composedPath) {\n event.__composedPath = pathComposer(event.target, true);\n }\n return event.__composedPath;\n};\n\nfunction retarget(refNode, path) {\n if (!utils.isShadyRoot) {\n return refNode;\n }\n // If ANCESTOR's root is not a shadow root or ANCESTOR's root is BASE's\n // shadow-including inclusive ancestor, return ANCESTOR.\n let refNodePath = pathComposer(refNode, true);\n let p$ = path;\n for (let i = 0, ancestor, lastRoot, root, rootIdx; i < p$.length; i++) {\n ancestor = p$[i];\n root = getRootNodeWithFallback(ancestor);\n if (root !== lastRoot) {\n rootIdx = refNodePath.indexOf(root);\n lastRoot = root;\n }\n if (!utils.isShadyRoot(root) || rootIdx > -1) {\n return ancestor;\n }\n }\n}\n\nlet EventPatches = {\n /**\n * @this {Event}\n */\n get composed() {\n if (this.__composed === undefined) {\n // if there's an original `composed` getter on the Event prototype, use that\n if (composedGetter) {\n // TODO(web-padawan): see https://github.com/webcomponents/shadydom/issues/275\n this.__composed =\n this.type === 'focusin' ||\n this.type === 'focusout' ||\n composedGetter(this);\n // If the event is trusted, or `isTrusted` is not supported, check the list of always composed events\n } else if (this.isTrusted !== false) {\n this.__composed = alwaysComposed[this.type];\n }\n }\n return /** @type {!Event} */ (this).__composed || false;\n },\n\n /**\n * @this {Event}\n */\n composedPath() {\n if (!this.__composedPath) {\n this.__composedPath = pathComposer(this['__target'], this.composed);\n }\n return /** @type {!Event} */ (this).__composedPath;\n },\n\n /**\n * @this {Event}\n */\n get target() {\n return retarget(\n this.currentTarget || this['__previousCurrentTarget'],\n this.composedPath()\n );\n },\n\n // http://w3c.github.io/webcomponents/spec/shadow/#event-relatedtarget-retargeting\n /**\n * @this {Event}\n */\n get relatedTarget() {\n if (!this.__relatedTarget) {\n return null;\n }\n if (!this.__relatedTargetComposedPath) {\n this.__relatedTargetComposedPath = pathComposer(\n this.__relatedTarget,\n true\n );\n }\n // find the deepest node in relatedTarget composed path that is in the same root with the currentTarget\n return retarget(\n this.currentTarget || this['__previousCurrentTarget'],\n /** @type {!Event} */ (this).__relatedTargetComposedPath\n );\n },\n /**\n * @this {Event}\n */\n stopPropagation() {\n Event.prototype.stopPropagation.call(this);\n this.__propagationStopped = true;\n },\n /**\n * @this {Event}\n */\n stopImmediatePropagation() {\n Event.prototype.stopImmediatePropagation.call(this);\n this.__immediatePropagationStopped = true;\n this.__propagationStopped = true;\n },\n};\n\n// Some browsers have missing or broken descriptors. If this is the case\n// eventPhase can't be polyfilled. For example, Chrome 41 does not\n// have prototypical descriptors on DOM objects and Safari 9 has broken ones\n// that cannot be used.\nconst eventPhaseDescriptor =\n utils.settings.hasDescriptors &&\n Object.getOwnPropertyDescriptor(Event.prototype, 'eventPhase');\nif (eventPhaseDescriptor) {\n Object.defineProperty(\n EventPatches,\n 'eventPhase',\n /** @type {!ObjectPropertyDescriptor<!Event>} */ ({\n /**\n * @this {Event}\n */\n get() {\n return this.currentTarget === this.target\n ? Event.AT_TARGET\n : this[utils.NATIVE_PREFIX + 'eventPhase'];\n },\n enumerable: true,\n configurable: true,\n })\n );\n\n Object.defineProperty(\n EventPatches,\n utils.NATIVE_PREFIX + 'eventPhase',\n eventPhaseDescriptor\n );\n}\n\nfunction mixinComposedFlag(Base) {\n // NOTE: avoiding use of `class` here so that transpiled output does not\n // try to do `Base.call` with a dom construtor.\n let klazz = function (type, options) {\n let event = new Base(type, options);\n event.__composed = options && Boolean(options['composed']);\n return event;\n };\n // put constructor properties on subclass\n klazz.__proto__ = Base;\n klazz.prototype = Base.prototype;\n return klazz;\n}\n\nlet nonBubblingEventsToRetarget = {\n 'focus': true,\n 'blur': true,\n};\n\n/**\n * Check if the event has been retargeted by comparing original `target`, and calculated `target`\n * @param {Event} event\n * @return {boolean} True if the original target and calculated target are the same\n */\nfunction hasRetargeted(event) {\n return (\n event['__target'] !== event.target ||\n event.__relatedTarget !== event.relatedTarget\n );\n}\n\n/**\n *\n * @param {Event} event\n * @param {Node} node\n * @param {string} phase\n */\nfunction fireHandlers(event, node, phase) {\n let hs =\n node.__handlers &&\n node.__handlers[event.type] &&\n node.__handlers[event.type][phase];\n if (hs) {\n for (let i = 0, fn; (fn = hs[i]); i++) {\n if (hasRetargeted(event) && event.target === event.relatedTarget) {\n return;\n }\n fn.call(node, event);\n if (event.__immediatePropagationStopped) {\n return;\n }\n }\n }\n}\n\n// In Chrome 41, `currentTarget` is an own property of every `Event` and its\n// descriptor is a _data_ descriptor and not an accessor descriptor (so there is\n// no getter that could be saved and wrapped) but the browser effectively treats\n// this property as if it had a getter and returns different values on getting\n// as necessary. Further, setting a new descriptor for `currentTarget`, as\n// `shadyDispatchEvent` does below, permanently breaks this special descriptor\n// behavior. In this case, `shadyDispatchEvent` creates a new object with the\n// original event as its prototype (via `Object.create`) and modifies that\n// object's `currentTarget` instead, to avoid breaking the descriptor on the\n// original event.\n//\n// In Chrome 104 and Safari 9, some getters on events do not allow `this` to be\n// anything other than exactly the original event object. This means that the\n// above process of using a proxy-like (not a `Proxy`) object for the event\n// fails because any user that attempts to use properties of the original event\n// will be using the proxy as `this`.\n//\n// Fortunately, these two issues seem to be mutually exclusive amongst the\n// browsers that we test on, so we can specifically check if `currentTarget`\n// exists on a new `Event` and switch based off of that.\n// `utils.settings.hasDescriptors` is not sufficient for deciding this behavior\n// because, in Safari 9, `currentTarget` is not an own property of events, but\n// `.hasDescriptors` is still false.\nconst shadyDispatchEventNeedsProxyEvent = new Event('e').hasOwnProperty(\n 'currentTarget'\n);\n\nfunction shadyDispatchEvent(originalEvent) {\n const e = shadyDispatchEventNeedsProxyEvent\n ? Object.create(originalEvent)\n : originalEvent;\n const path = e.composedPath();\n const retargetedPath = path.map((node) => retarget(node, path));\n const bubbles = e.bubbles;\n\n let currentTarget;\n // override `currentTarget` to let patched `target` calculate correctly\n const prevCurrentTargetDesc = Object.getOwnPropertyDescriptor(\n e,\n 'currentTarget'\n );\n Object.defineProperty(e, 'currentTarget', {\n configurable: true,\n enumerable: true,\n get: function () {\n return currentTarget;\n },\n });\n\n let eventPhase = Event.CAPTURING_PHASE;\n const prevEventPhaseDesc = Object.getOwnPropertyDescriptor(e, 'eventPhase');\n Object.defineProperty(e, 'eventPhase', {\n configurable: true,\n enumerable: true,\n get: function () {\n return eventPhase;\n },\n });\n\n try {\n for (let i = path.length - 1; i >= 0; i--) {\n currentTarget = path[i];\n eventPhase =\n currentTarget === retargetedPath[i]\n ? Event.AT_TARGET\n : Event.CAPTURING_PHASE;\n // capture phase fires all capture handlers\n fireHandlers(e, currentTarget, 'capture');\n if (e.__propagationStopped) {\n return;\n }\n }\n\n for (let i = 0; i < path.length; i++) {\n currentTarget = path[i];\n const atTarget = currentTarget === retargetedPath[i];\n if (atTarget || bubbles) {\n eventPhase = atTarget ? Event.AT_TARGET : Event.BUBBLING_PHASE;\n fireHandlers(e, currentTarget, 'bubble');\n if (e.__propagationStopped) {\n return;\n }\n }\n }\n } finally {\n if (!shadyDispatchEventNeedsProxyEvent) {\n // Restore previous currentTarget & eventPhase descriptors when\n // dispatching is complete\n if (prevCurrentTargetDesc) {\n Object.defineProperty(e, 'currentTarget', prevCurrentTargetDesc);\n } else {\n delete e['currentTarget'];\n }\n if (prevEventPhaseDesc) {\n Object.defineProperty(e, 'eventPhase', prevEventPhaseDesc);\n } else {\n delete e['eventPhase'];\n }\n }\n }\n}\n\nfunction listenerSettingsEqual(savedListener, node, type, capture) {\n let {node: savedNode, type: savedType, capture: savedCapture} = savedListener;\n return node === savedNode && type === savedType && capture === savedCapture;\n}\n\nexport function findListener(wrappers, node, type, capture) {\n for (let i = 0; i < wrappers.length; i++) {\n if (listenerSettingsEqual(wrappers[i], node, type, capture)) {\n return i;\n }\n }\n return -1;\n}\n\n/**\n * Firefox can throw on accessing eventWrappers inside of `removeEventListener` during a selenium run\n * Try/Catch accessing eventWrappers to work around\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1353074\n */\nfunction getEventWrappers(eventLike) {\n let wrappers = null;\n try {\n wrappers = eventLike[eventWrappersName];\n } catch (e) {} // eslint-disable-line no-empty\n return wrappers;\n}\n\nfunction targetNeedsPathCheck(node) {\n return utils.isShadyRoot(node) || node.localName === 'slot';\n}\n\n/** @this {Node} */\nexport function dispatchEvent(event) {\n flush();\n // If the target is disconnected from the real document, it might still be\n // connected in the user-facing tree. To allow its path to potentially\n // include both connected and disconnected parts, dispatch it manually.\n if (\n !utils.settings.preferPerformance &&\n this instanceof Node &&\n !utils.documentContains(document, this)\n ) {\n if (!event['__target']) {\n patchEvent(event, this);\n }\n return shadyDispatchEvent(event);\n } else {\n return this[utils.NATIVE_PREFIX + 'dispatchEvent'](event);\n }\n}\n\n/**\n * @this {EventTarget}\n */\nexport function addEventListener(type, fnOrObj, optionsOrCapture) {\n const {capture, once, shadyTarget, nativeEventOptions} = parseEventOptions(\n optionsOrCapture\n );\n if (!fnOrObj) {\n return;\n }\n\n const handlerType = typeof fnOrObj;\n\n // bail if `fnOrObj` is not a function, not an object\n if (handlerType !== 'function' && handlerType !== 'object') {\n return;\n }\n\n // bail if `fnOrObj` is an object without a `handleEvent` method\n if (\n handlerType === 'object' &&\n (!fnOrObj.handleEvent || typeof fnOrObj.handleEvent !== 'function')\n ) {\n return;\n }\n\n if (unpatchedEvents[type]) {\n return this[utils.NATIVE_PREFIX + 'addEventListener'](\n type,\n fnOrObj,\n nativeEventOptions\n );\n }\n\n // hack to let ShadyRoots have event listeners\n // event listener will be on host, but `currentTarget`\n // will be set to shadyroot for event listener\n let target = shadyTarget || this;\n\n let wrappers = fnOrObj[eventWrappersName];\n if (wrappers) {\n // The callback `fn` might be used for multiple nodes/events. Since we generate\n // a wrapper function, we need to keep track of it when we remove the listener.\n // It's more efficient to store the node/type/options information as Array in\n // `fn` itself rather than the node (we assume that the same callback is used\n // for few nodes at most, whereas a node will likely have many event listeners).\n // NOTE(valdrin) invoking external functions is costly, inline has better perf.\n // Stop if the wrapper function has already been created.\n if (findListener(wrappers, target, type, capture) > -1) {\n return;\n }\n } else {\n fnOrObj[eventWrappersName] = [];\n }\n\n /**\n * @this {EventTarget}\n * @param {Event} e\n */\n const wrapperFn = (e) => {\n // Support `once` option.\n if (once) {\n this[utils.SHADY_PREFIX + 'removeEventListener'](\n type,\n fnOrObj,\n optionsOrCapture\n );\n }\n if (!e['__target']) {\n patchEvent(e);\n }\n let lastCurrentTargetDesc;\n let lastEventPhaseDesc;\n if (target !== this) {\n // replace `currentTarget` to make `target` and `relatedTarget` correct for inside the shadowroot\n lastCurrentTargetDesc = Object.getOwnPropertyDescriptor(\n e,\n 'currentTarget'\n );\n Object.defineProperty(e, 'currentTarget', {\n get() {\n return target;\n },\n configurable: true,\n });\n lastEventPhaseDesc = Object.getOwnPropertyDescriptor(e, 'eventPhase');\n Object.defineProperty(e, 'eventPhase', {\n configurable: true,\n enumerable: true,\n get() {\n // Shady DOM doesn't support dispatching to a shadow root as the\n // target, so we don't need to handle Event.AT_TARGET.\n return capture ? Event.CAPTURING_PHASE : Event.BUBBLING_PHASE;\n },\n });\n }\n e['__previousCurrentTarget'] = e['currentTarget'];\n // Always check if a shadowRoot or slot is in the current event path.\n // If it is not, the event was generated on either the host of the shadowRoot\n // or a children of the host.\n if (\n targetNeedsPathCheck(target) &&\n e.composedPath().indexOf(target) == -1\n ) {\n return;\n }\n // There are two critera that should stop events from firing on this node\n // 1. the event is not composed and the current node is not in the same root as the target\n // 2. when bubbling, if after retargeting, relatedTarget and target point to the same node\n if (e.composed || e.composedPath().indexOf(target) > -1) {\n if (hasRetargeted(e) && e.target === e.relatedTarget) {\n if (e.eventPhase === Event.BUBBLING_PHASE) {\n e.stopImmediatePropagation();\n }\n return;\n }\n // prevent non-bubbling events from triggering bubbling handlers on shadowroot, but only if not in capture phase\n if (\n e.eventPhase !== Event.CAPTURING_PHASE &&\n !e.bubbles &&\n e.target !== target &&\n !(target instanceof Window)\n ) {\n return;\n }\n let ret =\n handlerType === 'function'\n ? fnOrObj.call(target, e)\n : fnOrObj.handleEvent && fnOrObj.handleEvent(e);\n if (target !== this) {\n // Replace the original descriptors for `currentTarget` and `eventPhase`.\n if (lastCurrentTargetDesc) {\n Object.defineProperty(e, 'currentTarget', lastCurrentTargetDesc);\n lastCurrentTargetDesc = null;\n } else {\n delete e['currentTarget'];\n }\n if (lastEventPhaseDesc) {\n Object.defineProperty(e, 'eventPhase', lastEventPhaseDesc);\n lastEventPhaseDesc = null;\n } else {\n delete e['eventPhase'];\n }\n }\n return ret;\n }\n };\n\n // Store the wrapper information.\n fnOrObj[eventWrappersName].push({\n // note: use target here which is either a shadowRoot\n // (when the host element is proxy'ing the event) or this element\n node: target,\n type,\n capture,\n wrapperFn,\n });\n\n this.__handlers = this.__handlers || {};\n this.__handlers[type] = this.__handlers[type] || {\n 'capture': [],\n 'bubble': [],\n };\n this.__handlers[type][capture ? 'capture' : 'bubble'].push(wrapperFn);\n\n if (!nonBubblingEventsToRetarget[type]) {\n this[utils.NATIVE_PREFIX + 'addEventListener'](\n type,\n wrapperFn,\n nativeEventOptions\n );\n }\n}\n\n/**\n * @this {EventTarget}\n */\nexport function removeEventListener(type, fnOrObj, optionsOrCapture) {\n if (!fnOrObj) {\n return;\n }\n const {capture, shadyTarget, nativeEventOptions} = parseEventOptions(\n optionsOrCapture\n );\n if (unpatchedEvents[type]) {\n return this[utils.NATIVE_PREFIX + 'removeEventListener'](\n type,\n fnOrObj,\n nativeEventOptions\n );\n }\n let target = shadyTarget || this;\n // Search the wrapped function.\n let wrapperFn = undefined;\n let wrappers = getEventWrappers(fnOrObj);\n if (wrappers) {\n let idx = findListener(wrappers, target, type, capture);\n if (idx > -1) {\n wrapperFn = wrappers.splice(idx, 1)[0].wrapperFn;\n // Cleanup.\n if (!wrappers.length) {\n fnOrObj[eventWrappersName] = undefined;\n }\n }\n }\n this[utils.NATIVE_PREFIX + 'removeEventListener'](\n type,\n wrapperFn || fnOrObj,\n nativeEventOptions\n );\n if (wrapperFn && this.__handlers && this.__handlers[type]) {\n const arr = this.__handlers[type][capture ? 'capture' : 'bubble'];\n const idx = arr.indexOf(wrapperFn);\n if (idx > -1) {\n arr.splice(idx, 1);\n }\n }\n}\n\nfunction activateFocusEventOverrides() {\n for (let ev in nonBubblingEventsToRetarget) {\n window[utils.NATIVE_PREFIX + 'addEventListener'](\n ev,\n function (e) {\n if (!e['__target']) {\n patchEvent(e);\n shadyDispatchEvent(e);\n }\n },\n true\n );\n }\n}\n\nconst EventPatchesDescriptors = utils.getOwnPropertyDescriptors(EventPatches);\n\nconst SHADY_PROTO = '__shady_patchedProto';\nconst SHADY_SOURCE_PROTO = '__shady_sourceProto';\n\nfunction patchEvent(event, target = event.target) {\n event['__target'] = target;\n event.__relatedTarget = event.relatedTarget;\n // attempt to patch prototype (via cache)\n if (utils.settings.hasDescriptors) {\n const proto = Object.getPrototypeOf(event);\n // eslint-disable-next-line no-prototype-builtins\n if (!proto.hasOwnProperty(SHADY_PROTO)) {\n const patchedProto = Object.create(proto);\n patchedProto[SHADY_SOURCE_PROTO] = proto;\n utils.patchProperties(patchedProto, EventPatchesDescriptors);\n proto[SHADY_PROTO] = patchedProto;\n }\n event.__proto__ = proto[SHADY_PROTO];\n // and fallback to patching instance\n } else {\n utils.patchProperties(event, EventPatchesDescriptors);\n }\n}\n\nlet PatchedEvent = mixinComposedFlag(Event);\nlet PatchedCustomEvent = mixinComposedFlag(CustomEvent);\nlet PatchedMouseEvent = mixinComposedFlag(MouseEvent);\n\nexport function patchEvents() {\n activateFocusEventOverrides();\n window.Event = PatchedEvent;\n window.CustomEvent = PatchedCustomEvent;\n window.MouseEvent = PatchedMouseEvent;\n}\n\nexport function patchClick() {\n // Fix up `Element.prototype.click()` if `isTrusted` is supported, but `composed` isn't\n if (\n !composedGetter &&\n Object.getOwnPropertyDescriptor(Event.prototype, 'isTrusted')\n ) {\n /** @this {Element} */\n const composedClickFn = function () {\n const ev = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n composed: true,\n });\n this[utils.SHADY_PREFIX + 'dispatchEvent'](ev);\n };\n if (Element.prototype.click) {\n Element.prototype.click = composedClickFn;\n } else if (HTMLElement.prototype.click) {\n HTMLElement.prototype.click = composedClickFn;\n }\n }\n}\n\nexport const eventPropertyNamesForElement = Object.getOwnPropertyNames(\n Element.prototype\n).filter((name) => name.substring(0, 2) === 'on');\n\nexport const eventPropertyNamesForHTMLElement = Object.getOwnPropertyNames(\n HTMLElement.prototype\n).filter((name) => name.substring(0, 2) === 'on');\n\n/**\n * @param {string} property\n * @return {!ObjectPropertyDescriptor<Element>}\n */\nexport const wrappedDescriptorForEventProperty = (property) => {\n return {\n /** @this {Element} */\n set: function (fn) {\n const shadyData = ensureShadyDataForNode(this);\n const eventName = property.substring(2);\n if (!shadyData.__onCallbackListeners) {\n shadyData.__onCallbackListeners = {};\n }\n shadyData.__onCallbackListeners[property] &&\n this.removeEventListener(\n eventName,\n shadyData.__onCallbackListeners[property]\n );\n this[utils.SHADY_PREFIX + 'addEventListener'](eventName, fn);\n shadyData.__onCallbackListeners[property] = fn;\n },\n /** @this {Element} */\n get() {\n const shadyData = shadyDataForNode(this);\n return (\n shadyData &&\n shadyData.__onCallbackListeners &&\n shadyData.__onCallbackListeners[property]\n );\n },\n configurable: true,\n };\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nfunction newSplice(index, removed, addedCount) {\n return {\n index: index,\n removed: removed,\n addedCount: addedCount,\n };\n}\n\nconst EDIT_LEAVE = 0;\nconst EDIT_UPDATE = 1;\nconst EDIT_ADD = 2;\nconst EDIT_DELETE = 3;\n\n// Note: This function is *based* on the computation of the Levenshtein\n// \"edit\" distance. The one change is that \"updates\" are treated as two\n// edits - not one. With Array splices, an update is really a delete\n// followed by an add. By retaining this, we optimize for \"keeping\" the\n// maximum array items in the original array. For example:\n//\n// 'xxxx123' -> '123yyyy'\n//\n// With 1-edit updates, the shortest path would be just to update all seven\n// characters. With 2-edit updates, we delete 4, leave 3, and add 4. This\n// leaves the substring '123' intact.\nfunction calcEditDistances(\n current,\n currentStart,\n currentEnd,\n old,\n oldStart,\n oldEnd\n) {\n // \"Deletion\" columns\n let rowCount = oldEnd - oldStart + 1;\n let columnCount = currentEnd - currentStart + 1;\n let distances = new Array(rowCount);\n\n // \"Addition\" rows. Initialize null column.\n for (let i = 0; i < rowCount; i++) {\n distances[i] = new Array(columnCount);\n distances[i][0] = i;\n }\n\n // Initialize null row\n for (let j = 0; j < columnCount; j++) {\n distances[0][j] = j;\n }\n\n for (let i = 1; i < rowCount; i++) {\n for (let j = 1; j < columnCount; j++) {\n if (equals(current[currentStart + j - 1], old[oldStart + i - 1])) {\n distances[i][j] = distances[i - 1][j - 1];\n } else {\n let north = distances[i - 1][j] + 1;\n let west = distances[i][j - 1] + 1;\n distances[i][j] = north < west ? north : west;\n }\n }\n }\n\n return distances;\n}\n\n// This starts at the final weight, and walks \"backward\" by finding\n// the minimum previous weight recursively until the origin of the weight\n// matrix.\nfunction spliceOperationsFromEditDistances(distances) {\n let i = distances.length - 1;\n let j = distances[0].length - 1;\n let current = distances[i][j];\n let edits = [];\n while (i > 0 || j > 0) {\n if (i == 0) {\n edits.push(EDIT_ADD);\n j--;\n continue;\n }\n if (j == 0) {\n edits.push(EDIT_DELETE);\n i--;\n continue;\n }\n let northWest = distances[i - 1][j - 1];\n let west = distances[i - 1][j];\n let north = distances[i][j - 1];\n\n let min;\n if (west < north) {\n min = west < northWest ? west : northWest;\n } else {\n min = north < northWest ? north : northWest;\n }\n\n if (min == northWest) {\n if (northWest == current) {\n edits.push(EDIT_LEAVE);\n } else {\n edits.push(EDIT_UPDATE);\n current = northWest;\n }\n i--;\n j--;\n } else if (min == west) {\n edits.push(EDIT_DELETE);\n i--;\n current = west;\n } else {\n edits.push(EDIT_ADD);\n j--;\n current = north;\n }\n }\n\n edits.reverse();\n return edits;\n}\n\n/**\n * Splice Projection functions:\n *\n * A splice map is a representation of how a previous array of items\n * was transformed into a new array of items. Conceptually it is a list of\n * tuples of\n *\n * <index, removed, addedCount>\n *\n * which are kept in ascending index order of. The tuple represents that at\n * the |index|, |removed| sequence of items were removed, and counting forward\n * from |index|, |addedCount| items were added.\n */\n\n/**\n * Lacking individual splice mutation information, the minimal set of\n * splices can be synthesized given the previous state and final state of an\n * array. The basic approach is to calculate the edit distance matrix and\n * choose the shortest path through it.\n *\n * Complexity: O(l * p)\n * l: The length of the current array\n * p: The length of the old array\n */\nfunction calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {\n let prefixCount = 0;\n let suffixCount = 0;\n let splice;\n\n let minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);\n if (currentStart == 0 && oldStart == 0) {\n prefixCount = sharedPrefix(current, old, minLength);\n }\n\n if (currentEnd == current.length && oldEnd == old.length) {\n suffixCount = sharedSuffix(current, old, minLength - prefixCount);\n }\n\n currentStart += prefixCount;\n oldStart += prefixCount;\n currentEnd -= suffixCount;\n oldEnd -= suffixCount;\n\n if (currentEnd - currentStart == 0 && oldEnd - oldStart == 0) {\n return [];\n }\n\n if (currentStart == currentEnd) {\n splice = newSplice(currentStart, [], 0);\n while (oldStart < oldEnd) {\n splice.removed.push(old[oldStart++]);\n }\n\n return [splice];\n } else if (oldStart == oldEnd) {\n return [newSplice(currentStart, [], currentEnd - currentStart)];\n }\n\n let ops = spliceOperationsFromEditDistances(\n calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)\n );\n\n splice = undefined;\n let splices = [];\n let index = currentStart;\n let oldIndex = oldStart;\n for (let i = 0; i < ops.length; i++) {\n switch (ops[i]) {\n case EDIT_LEAVE:\n if (splice) {\n splices.push(splice);\n splice = undefined;\n }\n\n index++;\n oldIndex++;\n break;\n case EDIT_UPDATE:\n if (!splice) {\n splice = newSplice(index, [], 0);\n }\n\n splice.addedCount++;\n index++;\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n case EDIT_ADD:\n if (!splice) {\n splice = newSplice(index, [], 0);\n }\n\n splice.addedCount++;\n index++;\n break;\n case EDIT_DELETE:\n if (!splice) {\n splice = newSplice(index, [], 0);\n }\n\n splice.removed.push(old[oldIndex]);\n oldIndex++;\n break;\n }\n }\n\n if (splice) {\n splices.push(splice);\n }\n return splices;\n}\n\nfunction sharedPrefix(current, old, searchLength) {\n for (let i = 0; i < searchLength; i++) {\n if (!equals(current[i], old[i])) {\n return i;\n }\n }\n return searchLength;\n}\n\nfunction sharedSuffix(current, old, searchLength) {\n let index1 = current.length;\n let index2 = old.length;\n let count = 0;\n while (count < searchLength && equals(current[--index1], old[--index2])) {\n count++;\n }\n\n return count;\n}\n\nfunction equals(currentValue, previousValue) {\n return currentValue === previousValue;\n}\n\nexport function calculateSplices(current, previous) {\n return calcSplices(current, 0, current.length, previous, 0, previous.length);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n// prettier-ignore\nimport {addEventListener, removeEventListener, dispatchEvent} from '../patch-events.js';\n\nexport const EventTargetPatches = utils.getOwnPropertyDescriptors({\n dispatchEvent,\n\n addEventListener,\n\n removeEventListener,\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\n\nlet scopingShim = null;\n\nexport function getScopingShim() {\n if (!scopingShim) {\n scopingShim = window['ShadyCSS'] && window['ShadyCSS']['ScopingShim'];\n }\n return scopingShim || null;\n}\n\n/**\n * @param {!Node} node\n * @param {string} attr\n * @param {string} value\n */\nexport function scopeClassAttribute(node, attr, value) {\n const scopingShim = getScopingShim();\n if (scopingShim && attr === 'class') {\n scopingShim['setElementClass'](node, value);\n return true;\n }\n return false;\n}\n\n/**\n * @param {!Node} node\n * @param {string} newScopeName\n */\nexport function addShadyScoping(node, newScopeName) {\n const scopingShim = getScopingShim();\n if (!scopingShim) {\n return;\n }\n scopingShim['scopeNode'](node, newScopeName);\n}\n\n/**\n * @param {!Node} node\n * @param {string} currentScopeName\n */\nexport function removeShadyScoping(node, currentScopeName) {\n const scopingShim = getScopingShim();\n if (!scopingShim) {\n return;\n }\n scopingShim['unscopeNode'](node, currentScopeName);\n}\n\n/**\n * @param {!Node} node\n * @param {string} newScopeName\n * @param {string} oldScopeName\n */\nexport function replaceShadyScoping(node, newScopeName, oldScopeName) {\n const scopingShim = getScopingShim();\n if (!scopingShim) {\n return;\n }\n if (oldScopeName) {\n removeShadyScoping(node, oldScopeName);\n }\n addShadyScoping(node, newScopeName);\n}\n\n/**\n * @param {!Node} node\n * @param {string} newScopeName\n * @return {boolean}\n */\nexport function currentScopeIsCorrect(node, newScopeName) {\n const scopingShim = getScopingShim();\n if (!scopingShim) {\n return true;\n }\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // NOTE: as an optimization, only check that all the top-level children\n // have the correct scope.\n let correctScope = true;\n for (\n let n = node[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n correctScope = correctScope && currentScopeIsCorrect(n, newScopeName);\n }\n return correctScope;\n }\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return true;\n }\n const currentScope = scopingShim['currentScopeForNode'](node);\n return currentScope === newScopeName;\n}\n\n/**\n * @param {!Node} node\n * @return {string}\n */\nexport function currentScopeForNode(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return '';\n }\n const scopingShim = getScopingShim();\n if (!scopingShim) {\n return '';\n }\n return scopingShim['currentScopeForNode'](node);\n}\n\n/**\n * Walk over a node's tree and apply visitorFn to each element node\n *\n * @param {Node} node\n * @param {function(!Node):void} visitorFn\n */\nexport function treeVisitor(node, visitorFn) {\n if (!node) {\n return;\n }\n // this check is necessary if `node` is a Document Fragment\n if (node.nodeType === Node.ELEMENT_NODE) {\n visitorFn(node);\n }\n for (\n let n = node[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n if (n.nodeType === Node.ELEMENT_NODE) {\n treeVisitor(n, visitorFn);\n }\n }\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n// prettier-ignore\nimport {getScopingShim, removeShadyScoping, replaceShadyScoping, treeVisitor, currentScopeForNode, currentScopeIsCorrect} from '../style-scoping.js';\nimport {shadyDataForNode, ensureShadyDataForNode} from '../shady-data.js';\nimport {recordInsertBefore, recordRemoveChild} from '../link-nodes.js';\nimport {ownerShadyRootForNode} from '../attach-shadow.js';\n\nconst doc = window.document;\n\nconst preferPerformance = utils.settings.preferPerformance;\n\nconst nativeIsConnectedAccessors = /** @type {ObjectPropertyDescriptor} */ (Object.getOwnPropertyDescriptor(\n Node.prototype,\n 'isConnected'\n));\n\nconst nativeIsConnected =\n nativeIsConnectedAccessors && nativeIsConnectedAccessors.get;\n\nexport function clearNode(node) {\n let firstChild;\n while ((firstChild = node[utils.SHADY_PREFIX + 'firstChild'])) {\n node[utils.SHADY_PREFIX + 'removeChild'](firstChild);\n }\n}\n\nfunction removeOwnerShadyRoot(node) {\n // optimization: only reset the tree if node is actually in a root\n if (hasCachedOwnerRoot(node)) {\n for (\n let n = node[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n removeOwnerShadyRoot(n);\n }\n }\n const nodeData = shadyDataForNode(node);\n if (nodeData) {\n nodeData.ownerShadyRoot = undefined;\n }\n}\n\nfunction hasCachedOwnerRoot(node) {\n const nodeData = shadyDataForNode(node);\n return Boolean(nodeData && nodeData.ownerShadyRoot !== undefined);\n}\n\n/**\n * Finds the first flattened node that is composed in the node's parent.\n * If the given node is a slot, then the first flattened node is returned\n * if it exists, otherwise advance to the node's nextSibling.\n * @param {Node} node within which to find first composed node\n * @returns {Node} first composed node\n */\nfunction firstComposedNode(node) {\n let composed = node;\n if (node && node.localName === 'slot') {\n const nodeData = shadyDataForNode(node);\n const flattened = nodeData && nodeData.flattenedNodes;\n // Note, if `flattened` is falsey, it means that the containing shadowRoot\n // has not rendered and therefore the `<slot>` is still in the composed\n // DOM. If that's the case the `<slot>` is the first composed node.\n if (flattened) {\n composed = flattened.length\n ? flattened[0]\n : firstComposedNode(node[utils.SHADY_PREFIX + 'nextSibling']);\n }\n }\n return composed;\n}\n\n/**\n * @param {Node} node\n * @param {Node=} addedNode\n * @param {Node=} removedNode\n */\nfunction scheduleObserver(node, addedNode, removedNode) {\n const nodeData = shadyDataForNode(node);\n const observer = nodeData && nodeData.observer;\n if (observer) {\n if (addedNode) {\n if (addedNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n for (let i = 0, l = addedNode.childNodes.length; i < l; i++) {\n observer.addedNodes.push(addedNode.childNodes[i]);\n }\n } else {\n observer.addedNodes.push(addedNode);\n }\n }\n if (removedNode) {\n observer.removedNodes.push(removedNode);\n }\n observer.schedule();\n }\n}\n\nexport const NodePatches = utils.getOwnPropertyDescriptors({\n /** @this {Node} */\n get parentNode() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.parentNode;\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'parentNode'];\n },\n\n /** @this {Node} */\n get firstChild() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.firstChild;\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'firstChild'];\n },\n\n /** @this {Node} */\n get lastChild() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.lastChild;\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'lastChild'];\n },\n\n /** @this {Node} */\n get nextSibling() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.nextSibling;\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'nextSibling'];\n },\n\n /** @this {Node} */\n get previousSibling() {\n const nodeData = shadyDataForNode(this);\n const l = nodeData && nodeData.previousSibling;\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'previousSibling'];\n },\n\n /** @this {Node} */\n get childNodes() {\n let childNodes;\n if (utils.isTrackingLogicalChildNodes(this)) {\n const nodeData = shadyDataForNode(this);\n if (!nodeData.childNodes) {\n nodeData.childNodes = [];\n for (\n let n = this[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n nodeData.childNodes.push(n);\n }\n }\n childNodes = nodeData.childNodes;\n } else {\n childNodes = this[utils.NATIVE_PREFIX + 'childNodes'];\n }\n childNodes.item = function (index) {\n return childNodes[index];\n };\n return childNodes;\n },\n\n /** @this {Node} */\n get parentElement() {\n const nodeData = shadyDataForNode(this);\n let l = nodeData && nodeData.parentNode;\n if (l && l.nodeType !== Node.ELEMENT_NODE) {\n l = null;\n }\n return l !== undefined ? l : this[utils.NATIVE_PREFIX + 'parentElement'];\n },\n\n /** @this {Node} */\n get isConnected() {\n if (nativeIsConnected && nativeIsConnected.call(this)) {\n return true;\n }\n if (this.nodeType == Node.DOCUMENT_FRAGMENT_NODE) {\n return false;\n }\n // Fast path for distributed nodes.\n const ownerDocument = this.ownerDocument;\n if (ownerDocument === null || utils.documentContains(ownerDocument, this)) {\n return true;\n }\n // Slow path for non-distributed nodes.\n let node = this;\n while (node && !(node instanceof Document)) {\n node =\n node[utils.SHADY_PREFIX + 'parentNode'] ||\n (utils.isShadyRoot(node)\n ? /** @type {ShadowRoot} */ (node).host\n : undefined);\n }\n return !!(node && node instanceof Document);\n },\n\n /** @this {Node} */\n get textContent() {\n if (utils.isTrackingLogicalChildNodes(this)) {\n let tc = [];\n for (\n let n = this[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n if (n.nodeType !== Node.COMMENT_NODE) {\n tc.push(n[utils.SHADY_PREFIX + 'textContent']);\n }\n }\n return tc.join('');\n } else {\n return this[utils.NATIVE_PREFIX + 'textContent'];\n }\n },\n\n /**\n * @this {Node}\n * @param {string} value\n */\n set textContent(value) {\n if (typeof value === 'undefined' || value === null) {\n value = '';\n }\n switch (this.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.DOCUMENT_FRAGMENT_NODE:\n if (\n !utils.isTrackingLogicalChildNodes(this) &&\n utils.settings.hasDescriptors\n ) {\n // may be removing a nested slot but fast path if we know we are not.\n const firstChild = this[utils.SHADY_PREFIX + 'firstChild'];\n if (\n firstChild != this[utils.SHADY_PREFIX + 'lastChild'] ||\n (firstChild && firstChild.nodeType != Node.TEXT_NODE)\n ) {\n clearNode(this);\n }\n this[utils.NATIVE_PREFIX + 'textContent'] = value;\n } else {\n clearNode(this);\n // Document fragments must have no childNodes if setting a blank string\n if (value.length > 0 || this.nodeType === Node.ELEMENT_NODE) {\n this[utils.SHADY_PREFIX + 'insertBefore'](\n document.createTextNode(value)\n );\n }\n }\n break;\n default:\n // Note, be wary of patching `nodeValue`.\n this.nodeValue = value;\n break;\n }\n },\n\n // Patched `insertBefore`. Note that all mutations that add nodes are routed\n // here. When a <slot> is added or a node is added to a host with a shadowRoot\n // with a slot, a standard dom `insert` call is aborted and `_asyncRender`\n // is called on the relevant shadowRoot. In all other cases, a standard dom\n // `insert` can be made, but the location and ref_node may need to be changed.\n /**\n * @this {Node}\n * @param {Node} node\n * @param {Node=} ref_node\n */\n insertBefore(node, ref_node) {\n // optimization: assume native insertBefore is ok if the nodes are not in the document.\n if (this.ownerDocument !== doc && node.ownerDocument !== doc) {\n this[utils.NATIVE_PREFIX + 'insertBefore'](node, ref_node);\n return node;\n }\n if (node === this) {\n throw Error(\n `Failed to execute 'appendChild' on 'Node': The new child element contains the parent.`\n );\n }\n if (ref_node) {\n const refData = shadyDataForNode(ref_node);\n const p = refData && refData.parentNode;\n if (\n (p !== undefined && p !== this) ||\n (p === undefined &&\n ref_node[utils.NATIVE_PREFIX + 'parentNode'] !== this)\n ) {\n throw Error(\n `Failed to execute 'insertBefore' on 'Node': The node ` +\n `before which the new node is to be inserted is not a child of this node.`\n );\n }\n }\n if (ref_node === node) {\n return node;\n }\n scheduleObserver(this, node);\n /** @type {!Array<!HTMLSlotElement>} */\n const slotsAdded = [];\n const ownerRoot = ownerShadyRootForNode(this);\n /** @type {string} */\n const newScopeName = ownerRoot\n ? ownerRoot.host.localName\n : currentScopeForNode(this);\n /** @type {string} */\n let oldScopeName;\n // remove from existing location\n const parentNode = node[utils.SHADY_PREFIX + 'parentNode'];\n if (parentNode) {\n oldScopeName = currentScopeForNode(node);\n const skipUnscoping =\n // Don't remove scoping if we're inserting into another shadowRoot;\n // this would be unnecessary since it will be re-scoped below\n Boolean(ownerRoot) ||\n // Don't remove scoping if we're being moved between non-shadowRoot\n // locations (the likely case is when moving pre-scoped nodes in a template)\n !ownerShadyRootForNode(node) ||\n // Under preferPerformance, don't remove scoping when moving back into\n // a document fragment that was previously scoped; the assumption is\n // that the user should only move correctly-scoped DOM back into it\n (preferPerformance && this['__noInsertionPoint'] !== undefined);\n parentNode[utils.SHADY_PREFIX + 'removeChild'](node, skipUnscoping);\n }\n // add to new parent\n let allowNativeInsert = true;\n const needsScoping =\n (!preferPerformance ||\n // Under preferPerformance, only re-scope if we're not coming from a\n // pre-scoped doc fragment or back into a pre-scoped doc fragment\n (node['__noInsertionPoint'] === undefined &&\n this['__noInsertionPoint'] === undefined)) &&\n !currentScopeIsCorrect(node, newScopeName);\n const needsSlotFinding =\n ownerRoot &&\n !node['__noInsertionPoint'] &&\n (!preferPerformance || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE);\n if (needsSlotFinding || needsScoping) {\n // NOTE: avoid node.removeChild as this *can* trigger another patched\n // method (e.g. custom elements) and we want only the shady method to run.\n // The following table describes what style scoping actions should happen as a result of this insertion.\n // document -> shadowRoot: replace\n // shadowRoot -> shadowRoot: replace\n // shadowRoot -> shadowRoot of same type: do nothing\n // shadowRoot -> document: allow unscoping\n // document -> document: do nothing\n // The \"same type of shadowRoot\" and \"document to document cases rely on `currentScopeIsCorrect` returning true\n if (needsScoping) {\n // in a document or disconnected tree, replace scoping if necessary\n oldScopeName = oldScopeName || currentScopeForNode(node);\n }\n treeVisitor(node, (node) => {\n if (needsSlotFinding && node.localName === 'slot') {\n slotsAdded.push(/** @type {!HTMLSlotElement} */ (node));\n }\n if (needsScoping) {\n replaceShadyScoping(node, newScopeName, oldScopeName);\n }\n });\n }\n // if a slot is added, must render containing root.\n if (slotsAdded.length) {\n ownerRoot._addSlots(slotsAdded);\n ownerRoot._asyncRender();\n }\n if (utils.isTrackingLogicalChildNodes(this)) {\n recordInsertBefore(node, this, ref_node);\n const parentData = shadyDataForNode(this);\n // if the node being inserted into has a shadowRoot, do not perform\n // a native insertion\n if (parentData.root) {\n allowNativeInsert = false;\n // when inserting into a host with a shadowRoot with slot, use\n // `shadowRoot._asyncRender()` via `attach-shadow` module\n // when inserting into a host with shadowRoot with NO slot, do nothing\n // as the node should not be added to composed DOM anywhere.\n if (utils.hasShadowRootWithSlot(this)) {\n parentData.root._asyncRender();\n }\n }\n // when inserting into a slot inside a shadowRoot, render the\n // containing shadowRoot to update fallback content.\n else if (ownerRoot && this.localName === 'slot') {\n allowNativeInsert = false;\n ownerRoot._asyncRender();\n }\n }\n if (allowNativeInsert) {\n // if adding to a shadyRoot, add to host instead\n let container = utils.isShadyRoot(this)\n ? /** @type {ShadowRoot} */ (this).host\n : this;\n // if ref_node, get the ref_node that's actually in composed dom.\n if (ref_node) {\n ref_node = firstComposedNode(ref_node);\n container[utils.NATIVE_PREFIX + 'insertBefore'](node, ref_node);\n } else {\n container[utils.NATIVE_PREFIX + 'appendChild'](node);\n }\n }\n // Since ownerDocument is not patched, it can be incorrect after this call\n // if the node is physically appended via distribution. This can result\n // in the custom elements polyfill not upgrading the node if it's in an inert doc.\n // We correct this by calling `adoptNode`.\n else if (node.ownerDocument !== this.ownerDocument) {\n this.ownerDocument.adoptNode(node);\n }\n return node;\n },\n\n /**\n * @this {Node}\n * @param {Node} node\n */\n appendChild(node) {\n // if this is a shadowRoot and the shadowRoot is passed as `node`\n // then an optimized append has already been performed, so do nothing.\n if (!(this == node && utils.isShadyRoot(node))) {\n return this[utils.SHADY_PREFIX + 'insertBefore'](node);\n }\n },\n\n /**\n * Patched `removeChild`. Note that all dom \"removals\" are routed here.\n * Removes the given `node` from the element's `children`.\n * This method also performs dom composition.\n * @this {Node}\n * @param {Node} node\n * @param {boolean=} skipUnscoping\n */\n removeChild(node, skipUnscoping = false) {\n if (this.ownerDocument !== doc) {\n return this[utils.NATIVE_PREFIX + 'removeChild'](node);\n }\n if (node[utils.SHADY_PREFIX + 'parentNode'] !== this) {\n throw Error(\n 'The node to be removed is not a child of this node: ' + node\n );\n }\n scheduleObserver(this, null, node);\n let preventNativeRemove;\n let ownerRoot = ownerShadyRootForNode(node);\n const removingInsertionPoint =\n ownerRoot && ownerRoot._removeContainedSlots(node);\n const parentData = shadyDataForNode(this);\n if (utils.isTrackingLogicalChildNodes(this)) {\n recordRemoveChild(node, this);\n if (utils.hasShadowRootWithSlot(this)) {\n parentData.root._asyncRender();\n preventNativeRemove = true;\n }\n }\n // unscope a node leaving a ShadowRoot if ShadyCSS is present, and this node\n // is not going to be rescoped in `insertBefore`\n if (\n getScopingShim() &&\n !skipUnscoping &&\n ownerRoot &&\n node.nodeType !== Node.TEXT_NODE\n ) {\n const oldScopeName = currentScopeForNode(node);\n treeVisitor(node, (node) => {\n removeShadyScoping(node, oldScopeName);\n });\n }\n removeOwnerShadyRoot(node);\n // if removing slot, must render containing root\n if (ownerRoot) {\n let changeSlotContent = this.localName === 'slot';\n if (changeSlotContent) {\n preventNativeRemove = true;\n }\n if (removingInsertionPoint || changeSlotContent) {\n ownerRoot._asyncRender();\n }\n }\n if (!preventNativeRemove) {\n // if removing from a shadyRoot, remove from host instead\n let container = utils.isShadyRoot(this)\n ? /** @type {ShadowRoot} */ (this).host\n : this;\n // not guaranteed to physically be in container; e.g.\n // (1) if parent has a shadyRoot, element may or may not at distributed\n // location (could be undistributed)\n // (2) if parent is a slot, element may not ben in composed dom\n if (\n !(parentData.root || node.localName === 'slot') ||\n container === node[utils.NATIVE_PREFIX + 'parentNode']\n ) {\n container[utils.NATIVE_PREFIX + 'removeChild'](node);\n }\n }\n return node;\n },\n\n /**\n * @this {Node}\n * @param {Node} node\n * @param {Node=} ref_node\n */\n replaceChild(node, ref_node) {\n this[utils.SHADY_PREFIX + 'insertBefore'](node, ref_node);\n this[utils.SHADY_PREFIX + 'removeChild'](ref_node);\n return node;\n },\n\n /**\n * @this {Node}\n * @param {boolean=} deep\n */\n cloneNode(deep) {\n if (this.localName == 'template') {\n return this[utils.NATIVE_PREFIX + 'cloneNode'](deep);\n } else {\n const n = this[utils.NATIVE_PREFIX + 'cloneNode'](false);\n // Attribute nodes historically had childNodes, but they have later\n // been removed from the spec.\n // Make sure we do not do a deep clone on them for old browsers (IE11)\n if (deep && n.nodeType !== Node.ATTRIBUTE_NODE) {\n for (\n let c = this[utils.SHADY_PREFIX + 'firstChild'], nc;\n c;\n c = c[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n nc = c[utils.SHADY_PREFIX + 'cloneNode'](true);\n n[utils.SHADY_PREFIX + 'appendChild'](nc);\n }\n }\n return n;\n }\n },\n\n /**\n * @this {Node}\n * @param {Object=} options\n */\n // TODO(sorvell): implement `options` e.g. `{ composed: boolean }`\n getRootNode(options) {\n if (!this || !this.nodeType) {\n return;\n }\n const nodeData = ensureShadyDataForNode(this);\n let root = nodeData.ownerShadyRoot;\n if (root === undefined) {\n if (utils.isShadyRoot(this)) {\n root = this;\n nodeData.ownerShadyRoot = root;\n } else {\n let parent = this[utils.SHADY_PREFIX + 'parentNode'];\n root = parent\n ? parent[utils.SHADY_PREFIX + 'getRootNode'](options)\n : this;\n // memo-ize result for performance but only memo-ize\n // result if node is in the document. This avoids a problem where a root\n // can be cached while an element is inside a fragment.\n // If this happens and we cache the result, the value can become stale\n // because for perf we avoid processing the subtree of added fragments.\n if (document.documentElement[utils.NATIVE_PREFIX + 'contains'](this)) {\n nodeData.ownerShadyRoot = root;\n }\n }\n }\n return root;\n },\n\n /** @this {Node} */\n contains(node) {\n return utils.contains(this, node);\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport {calculateSplices} from './array-splice.js';\nimport * as utils from './utils.js';\nimport {enqueue} from './flush.js';\nimport {ensureShadyDataForNode, shadyDataForNode} from './shady-data.js';\nimport {recordChildNodes} from './link-nodes.js';\nimport {patchShadyRoot} from './patch-shadyRoot.js';\n\n// Do not export this object. It must be passed as the first argument to the\n// ShadyRoot constructor in `attachShadow` to prevent the constructor from\n// throwing. This prevents the user from being able to manually construct a\n// ShadyRoot (i.e. `new ShadowRoot()`).\nconst ShadyRootConstructionToken = {};\n\nconst CATCHALL_NAME = '__catchall';\n\nconst MODE_CLOSED = 'closed';\n\nlet isRendering =\n utils.settings['deferConnectionCallbacks'] &&\n document.readyState === 'loading';\nlet rootRendered;\n\nfunction ancestorList(node) {\n let ancestors = [];\n do {\n ancestors.unshift(node);\n } while ((node = node[utils.SHADY_PREFIX + 'parentNode']));\n return ancestors;\n}\n\n/**\n * @extends {ShadowRoot}\n */\nclass ShadyRoot {\n constructor(token, host, options) {\n if (token !== ShadyRootConstructionToken) {\n throw new TypeError('Illegal constructor');\n }\n /** @type {boolean} */\n this._renderPending;\n /** @type {boolean} */\n this._hasRendered;\n /** @type {?Array<HTMLSlotElement>} */\n this._slotList = null;\n /** @type {?Object<string, Array<HTMLSlotElement>>} */\n this._slotMap;\n /** @type {?Array<HTMLSlotElement>} */\n this._pendingSlots;\n this._init(host, options);\n }\n\n _init(host, options) {\n // root <=> host\n this.host = host;\n /** @type {!string|undefined} */\n this.mode = options && options.mode;\n recordChildNodes(this.host);\n const hostData = ensureShadyDataForNode(this.host);\n /** @type {!ShadyRoot} */\n hostData.root = this;\n hostData.publicRoot = this.mode !== MODE_CLOSED ? this : null;\n // setup root\n const rootData = ensureShadyDataForNode(this);\n rootData.firstChild = rootData.lastChild = rootData.parentNode = rootData.nextSibling = rootData.previousSibling = null;\n // NOTE: optimization flag, only require an asynchronous render\n // to record parsed children if flag is not set.\n if (utils.settings['preferPerformance']) {\n let n;\n while ((n = this.host[utils.NATIVE_PREFIX + 'firstChild'])) {\n this.host[utils.NATIVE_PREFIX + 'removeChild'](n);\n }\n } else {\n this._asyncRender();\n }\n }\n\n _asyncRender() {\n if (!this._renderPending) {\n this._renderPending = true;\n enqueue(() => this._render());\n }\n }\n\n // returns the oldest renderPending ancestor root.\n _getPendingDistributionRoot() {\n let renderRoot;\n let root = this;\n while (root) {\n if (root._renderPending) {\n renderRoot = root;\n }\n root = root._getDistributionParent();\n }\n return renderRoot;\n }\n\n // Returns the shadyRoot `this.host` if `this.host`\n // has children that require distribution.\n _getDistributionParent() {\n let root = this.host[utils.SHADY_PREFIX + 'getRootNode']();\n if (!utils.isShadyRoot(root)) {\n return;\n }\n const nodeData = shadyDataForNode(this.host);\n if (nodeData && nodeData.__childSlotCount > 0) {\n return root;\n }\n }\n\n // Renders the top most render pending shadowRoot in the distribution tree.\n // This is safe because when a distribution parent renders, all children render.\n _render() {\n // If this root is not pending, it needs no rendering work. Any pending\n // parent that needs to render wll cause this root to render.\n const root = this._renderPending && this._getPendingDistributionRoot();\n if (root) {\n root._renderSelf();\n }\n }\n\n _flushInitial() {\n if (!this._hasRendered && this._renderPending) {\n this._render();\n }\n }\n\n /** @override */\n _renderSelf() {\n // track rendering state.\n const wasRendering = isRendering;\n isRendering = true;\n this._renderPending = false;\n if (this._slotList) {\n this._distribute();\n this._compose();\n }\n // NOTE: optimization flag, only process parsed children\n // if optimization flag is not set.\n // on initial render remove any undistributed children.\n if (!utils.settings['preferPerformance'] && !this._hasRendered) {\n for (\n let n = this.host[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n const data = shadyDataForNode(n);\n if (\n n[utils.NATIVE_PREFIX + 'parentNode'] === this.host &&\n (n.localName === 'slot' || !data.assignedSlot)\n ) {\n this.host[utils.NATIVE_PREFIX + 'removeChild'](n);\n }\n }\n }\n this._hasRendered = true;\n isRendering = wasRendering;\n if (rootRendered) {\n rootRendered();\n }\n }\n\n _distribute() {\n this._validateSlots();\n // capture # of previously assigned nodes to help determine if dirty.\n for (let i = 0, slot; i < this._slotList.length; i++) {\n slot = this._slotList[i];\n this._clearSlotAssignedNodes(slot);\n }\n // distribute host children.\n for (\n let n = this.host[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n this._distributeNodeToSlot(n);\n }\n // fallback content, slotchange, and dirty roots\n for (let i = 0; i < this._slotList.length; i++) {\n const slot = this._slotList[i];\n const slotData = shadyDataForNode(slot);\n // distribute fallback content\n if (!slotData.assignedNodes.length) {\n for (\n let n = slot[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n this._distributeNodeToSlot(n, slot);\n }\n }\n const slotParentData = shadyDataForNode(\n slot[utils.SHADY_PREFIX + 'parentNode']\n );\n const slotParentRoot = slotParentData && slotParentData.root;\n if (\n slotParentRoot &&\n (slotParentRoot._hasInsertionPoint() || slotParentRoot._renderPending)\n ) {\n slotParentRoot._renderSelf();\n }\n this._addAssignedToFlattenedNodes(\n slotData.flattenedNodes,\n slotData.assignedNodes\n );\n let prevAssignedNodes = slotData._previouslyAssignedNodes;\n if (prevAssignedNodes) {\n for (let i = 0; i < prevAssignedNodes.length; i++) {\n shadyDataForNode(prevAssignedNodes[i])._prevAssignedSlot = null;\n }\n slotData._previouslyAssignedNodes = null;\n // dirty if previously less assigned nodes than previously assigned.\n if (prevAssignedNodes.length > slotData.assignedNodes.length) {\n slotData.dirty = true;\n }\n }\n /* Note: A slot is marked dirty whenever a node is newly assigned to it\n or a node is assigned to a different slot (done in `_distributeNodeToSlot`)\n or if the number of nodes assigned to the slot has decreased (done above);\n */\n if (slotData.dirty) {\n slotData.dirty = false;\n this._fireSlotChange(slot);\n }\n }\n }\n\n /**\n * Distributes given `node` to the appropriate slot based on its `slot`\n * attribute. If `forcedSlot` is given, then the node is distributed to the\n * `forcedSlot`.\n * Note: slot to which the node is assigned will be marked dirty for firing\n * `slotchange`.\n * @param {Node} node\n * @param {Node=} forcedSlot\n *\n */\n _distributeNodeToSlot(node, forcedSlot) {\n const nodeData = ensureShadyDataForNode(node);\n let oldSlot = nodeData._prevAssignedSlot;\n nodeData._prevAssignedSlot = null;\n let slot = forcedSlot;\n if (!slot) {\n let name = node[utils.SHADY_PREFIX + 'slot'] || CATCHALL_NAME;\n const list = this._slotMap[name];\n slot = list && list[0];\n }\n if (slot) {\n const slotData = ensureShadyDataForNode(slot);\n slotData.assignedNodes.push(node);\n nodeData.assignedSlot = slot;\n } else {\n nodeData.assignedSlot = undefined;\n }\n if (oldSlot !== nodeData.assignedSlot) {\n if (nodeData.assignedSlot) {\n ensureShadyDataForNode(nodeData.assignedSlot).dirty = true;\n }\n }\n }\n\n /**\n * Clears the assignedNodes tracking data for a given `slot`. Note, the current\n * assigned node data is tracked (via _previouslyAssignedNodes and\n * _prevAssignedSlot) to see if `slotchange` should fire. This data may be out\n * of date at this time because the assigned nodes may have already been\n * distributed to another root. This is ok since this data is only used to\n * track changes.\n * @param {HTMLSlotElement} slot\n */\n _clearSlotAssignedNodes(slot) {\n const slotData = shadyDataForNode(slot);\n let n$ = slotData.assignedNodes;\n slotData.assignedNodes = [];\n slotData.flattenedNodes = [];\n slotData._previouslyAssignedNodes = n$;\n if (n$) {\n for (let i = 0; i < n$.length; i++) {\n let n = shadyDataForNode(n$[i]);\n n._prevAssignedSlot = n.assignedSlot;\n // only clear if it was previously set to this slot;\n // this helps ensure that if the node has otherwise been distributed\n // ignore it.\n if (n.assignedSlot === slot) {\n n.assignedSlot = null;\n }\n }\n }\n }\n\n _addAssignedToFlattenedNodes(flattened, assigned) {\n for (let i = 0, n; i < assigned.length && (n = assigned[i]); i++) {\n if (n.localName == 'slot') {\n const nestedAssigned = shadyDataForNode(n).assignedNodes;\n if (nestedAssigned && nestedAssigned.length) {\n this._addAssignedToFlattenedNodes(flattened, nestedAssigned);\n }\n } else {\n flattened.push(assigned[i]);\n }\n }\n }\n\n _fireSlotChange(slot) {\n // NOTE: cannot bubble correctly here so not setting bubbles: true\n // Safari tech preview does not bubble but chrome does\n // Spec says it bubbles (https://dom.spec.whatwg.org/#mutation-observers)\n slot[utils.NATIVE_PREFIX + 'dispatchEvent'](new Event('slotchange'));\n const slotData = shadyDataForNode(slot);\n if (slotData.assignedSlot) {\n this._fireSlotChange(slotData.assignedSlot);\n }\n }\n\n // Reify dom such that it is at its correct rendering position\n // based on logical distribution.\n // NOTE: here we only compose parents of <slot> elements and not the\n // shadowRoot into the host. The latter is performend via a fast path\n // in the `logical-mutation`.insertBefore.\n _compose() {\n const slots = this._slotList;\n let composeList = [];\n for (let i = 0; i < slots.length; i++) {\n const parent = slots[i][utils.SHADY_PREFIX + 'parentNode'];\n /* compose node only if:\n (1) parent does not have a shadowRoot since shadowRoot has already\n composed into the host\n (2) we're not already composing it\n [consider (n^2) but rare better than Set]\n */\n const parentData = shadyDataForNode(parent);\n if (!(parentData && parentData.root) && composeList.indexOf(parent) < 0) {\n composeList.push(parent);\n }\n }\n for (let i = 0; i < composeList.length; i++) {\n const node = composeList[i];\n const targetNode = node === this ? this.host : node;\n this._updateChildNodes(targetNode, this._composeNode(node));\n }\n }\n\n // Returns the list of nodes which should be rendered inside `node`.\n _composeNode(node) {\n let children = [];\n for (\n let n = node[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n // Note: if we see a slot here, the nodes are guaranteed to need to be\n // composed here. This is because if there is redistribution, it has\n // already been handled by this point.\n if (this._isInsertionPoint(n)) {\n let flattenedNodes = shadyDataForNode(n).flattenedNodes;\n for (let j = 0; j < flattenedNodes.length; j++) {\n let distributedNode = flattenedNodes[j];\n children.push(distributedNode);\n }\n } else {\n children.push(n);\n }\n }\n return children;\n }\n\n _isInsertionPoint(node) {\n return node.localName == 'slot';\n }\n\n // Ensures that the rendered node list inside `container` is `children`.\n _updateChildNodes(container, children) {\n let composed = utils.nativeChildNodesArray(container);\n let splices = calculateSplices(children, composed);\n // process removals\n for (let i = 0, d = 0, s; i < splices.length && (s = splices[i]); i++) {\n for (let j = 0, n; j < s.removed.length && (n = s.removed[j]); j++) {\n // check if the node is still where we expect it is before trying\n // to remove it; this can happen if we move a node and\n // then schedule its previous host for distribution resulting in\n // the node being removed here.\n if (n[utils.NATIVE_PREFIX + 'parentNode'] === container) {\n container[utils.NATIVE_PREFIX + 'removeChild'](n);\n }\n // TODO(sorvell): avoid the need for splicing here.\n composed.splice(s.index + d, 1);\n }\n d -= s.addedCount;\n }\n // process adds\n for (let i = 0, s, next; i < splices.length && (s = splices[i]); i++) {\n // eslint-disable-line no-redeclare\n next = composed[s.index];\n for (let j = s.index, n; j < s.index + s.addedCount; j++) {\n n = children[j];\n container[utils.NATIVE_PREFIX + 'insertBefore'](n, next);\n composed.splice(j, 0, n);\n }\n }\n }\n\n _ensureSlotData() {\n this._pendingSlots = this._pendingSlots || [];\n this._slotList = this._slotList || [];\n this._slotMap = this._slotMap || {};\n }\n\n _addSlots(slots) {\n this._ensureSlotData();\n this._pendingSlots.push(...slots);\n }\n\n _validateSlots() {\n if (this._pendingSlots && this._pendingSlots.length) {\n this._mapSlots(this._pendingSlots);\n this._pendingSlots = [];\n }\n }\n\n /**\n * Adds the given slots. Slots are maintained in an dom-ordered list.\n * In addition a map of name to slot is updated.\n */\n _mapSlots(slots) {\n let slotNamesToSort;\n for (let i = 0; i < slots.length; i++) {\n const slot = slots[i];\n // ensure insertionPoints's and their parents have logical dom info.\n // save logical tree info\n // a. for shadyRoot\n // b. for insertion points (fallback)\n // c. for parents of insertion points\n recordChildNodes(slot);\n const slotParent = slot[utils.SHADY_PREFIX + 'parentNode'];\n recordChildNodes(slotParent);\n const slotParentData = shadyDataForNode(slotParent);\n slotParentData.__childSlotCount =\n (slotParentData.__childSlotCount || 0) + 1;\n let name = this._nameForSlot(slot);\n if (this._slotMap[name]) {\n slotNamesToSort = slotNamesToSort || {};\n slotNamesToSort[name] = true;\n this._slotMap[name].push(slot);\n } else {\n this._slotMap[name] = [slot];\n }\n this._slotList.push(slot);\n }\n if (slotNamesToSort) {\n for (let n in slotNamesToSort) {\n this._slotMap[n] = this._sortSlots(this._slotMap[n]);\n }\n }\n }\n\n _nameForSlot(slot) {\n const name = slot['name'] || slot.getAttribute('name') || CATCHALL_NAME;\n slot.__slotName = name;\n return name;\n }\n\n /**\n * Slots are kept in an ordered list. Slots with the same name\n * are sorted here by tree order.\n */\n _sortSlots(slots) {\n // NOTE: Cannot use `compareDocumentPosition` because it's not polyfilled,\n // but the code here could be used to polyfill the preceeding/following info\n // in `compareDocumentPosition`.\n return slots.sort((a, b) => {\n let listA = ancestorList(a);\n let listB = ancestorList(b);\n for (var i = 0; i < listA.length; i++) {\n let nA = listA[i];\n let nB = listB[i];\n if (nA !== nB) {\n let c$ = utils.childNodesArray(nA[utils.SHADY_PREFIX + 'parentNode']);\n return c$.indexOf(nA) - c$.indexOf(nB);\n }\n }\n });\n }\n\n /**\n * Removes from tracked slot data any slots contained within `container` and\n * then updates the tracked data (_slotList and _slotMap).\n * Any removed slots also have their `assignedNodes` removed from comopsed dom.\n */\n _removeContainedSlots(container) {\n if (!this._slotList) {\n return;\n }\n this._validateSlots();\n let didRemove;\n const map = this._slotMap;\n for (let n in map) {\n const slots = map[n];\n for (let i = 0; i < slots.length; i++) {\n const slot = slots[i];\n if (utils.contains(container, slot)) {\n slots.splice(i, 1);\n const x = this._slotList.indexOf(slot);\n if (x >= 0) {\n this._slotList.splice(x, 1);\n const slotParentData = shadyDataForNode(\n slot[utils.SHADY_PREFIX + 'parentNode']\n );\n if (slotParentData && slotParentData.__childSlotCount) {\n slotParentData.__childSlotCount--;\n }\n }\n i--;\n this._removeFlattenedNodes(slot);\n didRemove = true;\n }\n }\n }\n return didRemove;\n }\n\n _updateSlotName(slot) {\n if (!this._slotList) {\n return;\n }\n // make sure slotMap is initialized with this slot\n this._validateSlots();\n const oldName = slot.__slotName;\n const name = this._nameForSlot(slot);\n if (name === oldName) {\n return;\n }\n // remove from existing tracking\n let slots = this._slotMap[oldName];\n const i = slots.indexOf(slot);\n if (i >= 0) {\n slots.splice(i, 1);\n }\n // add to new location and sort if nedessary\n let list = this._slotMap[name] || (this._slotMap[name] = []);\n list.push(slot);\n if (list.length > 1) {\n this._slotMap[name] = this._sortSlots(list);\n }\n }\n\n _removeFlattenedNodes(slot) {\n const data = shadyDataForNode(slot);\n let n$ = data.flattenedNodes;\n if (n$) {\n for (let i = 0; i < n$.length; i++) {\n let node = n$[i];\n let parent = node[utils.NATIVE_PREFIX + 'parentNode'];\n if (parent) {\n parent[utils.NATIVE_PREFIX + 'removeChild'](node);\n }\n }\n }\n data.flattenedNodes = [];\n data.assignedNodes = [];\n }\n\n _hasInsertionPoint() {\n this._validateSlots();\n return Boolean(this._slotList && this._slotList.length);\n }\n}\n\npatchShadyRoot(ShadyRoot.prototype);\nexport {ShadyRoot};\n\n/**\n Implements a pared down version of ShadowDOM's scoping, which is easy to\n polyfill across browsers.\n*/\nexport const attachShadow = (host, options) => {\n if (!host) {\n throw new Error('Must provide a host.');\n }\n if (!options) {\n throw new Error('Not enough arguments.');\n }\n let root;\n // Optimization for booting up a shadowRoot from a fragment rather than\n // creating one.\n if (options['shadyUpgradeFragment'] && utils.canUpgrade()) {\n root = options['shadyUpgradeFragment'];\n root.__proto__ = ShadowRoot.prototype;\n root._init(host, options);\n recordChildNodes(root, root);\n // Note: qsa is native when used with noPatch.\n /** @type {?NodeList<Element>} */\n const slotsAdded = root['__noInsertionPoint']\n ? null\n : root.querySelectorAll('slot');\n // Reset scoping information so normal scoing rules apply after this.\n root['__noInsertionPoint'] = undefined;\n // if a slot is added, must render containing root.\n if (slotsAdded && slotsAdded.length) {\n root._addSlots(slotsAdded);\n root._asyncRender();\n }\n /** @type {ShadowRoot} */ (root).host[utils.NATIVE_PREFIX + 'appendChild'](\n root\n );\n } else {\n root = new ShadyRoot(ShadyRootConstructionToken, host, options);\n }\n return root;\n};\n\n// Mitigate connect/disconnect spam by wrapping custom element classes. This\n// should happen if custom elements are available in any capacity, polyfilled or\n// not.\nif (\n utils.hasCustomElements() &&\n utils.settings.inUse &&\n !utils.settings['preferPerformance']\n) {\n // process connect/disconnect after roots have rendered to avoid\n // issues with reaction stack.\n let connectMap = new Map();\n rootRendered = function () {\n // allow elements to connect\n // save map state (without needing polyfills on IE11)\n const r = [];\n connectMap.forEach((v, k) => {\n r.push([k, v]);\n });\n connectMap.clear();\n for (let i = 0; i < r.length; i++) {\n const e = r[i][0],\n value = r[i][1];\n if (value) {\n e['__shadydom_connectedCallback']();\n } else {\n e['__shadydom_disconnectedCallback']();\n }\n }\n };\n\n // Document is in loading state and flag is set (deferConnectionCallbacks)\n // so process connection stack when `readystatechange` fires.\n if (isRendering) {\n document.addEventListener(\n 'readystatechange',\n () => {\n isRendering = false;\n rootRendered();\n },\n {once: true}\n );\n }\n\n /*\n * (1) elements can only be connected/disconnected if they are in the expected\n * state.\n * (2) never run connect/disconnect during rendering to avoid reaction stack issues.\n */\n const ManageConnect = (base, connected, disconnected) => {\n let counter = 0;\n const connectFlag = `__isConnected${counter++}`;\n if (connected || disconnected) {\n /** @this {!HTMLElement} */\n base.prototype.connectedCallback = base.prototype[\n '__shadydom_connectedCallback'\n ] = function () {\n // if rendering defer connected\n // otherwise connect only if we haven't already\n if (isRendering) {\n connectMap.set(this, true);\n } else if (!this[connectFlag]) {\n this[connectFlag] = true;\n if (connected) {\n connected.call(this);\n }\n }\n };\n\n /** @this {!HTMLElement} */\n base.prototype.disconnectedCallback = base.prototype[\n '__shadydom_disconnectedCallback'\n ] = function () {\n // if rendering, cancel a pending connection and queue disconnect,\n // otherwise disconnect only if a connection has been allowed\n if (isRendering) {\n // This is necessary only because calling removeChild\n // on a node that requires distribution leaves it in the DOM tree\n // until distribution.\n // NOTE: remember this is checking the patched isConnected to determine\n // if the node is in the logical tree.\n if (!this.isConnected) {\n connectMap.set(this, false);\n }\n } else if (this[connectFlag]) {\n this[connectFlag] = false;\n if (disconnected) {\n disconnected.call(this);\n }\n }\n };\n }\n\n return base;\n };\n\n const originalDefine = window['customElements']['define'];\n const define = function (name, constructor) {\n const connected = constructor.prototype.connectedCallback;\n const disconnected = constructor.prototype.disconnectedCallback;\n originalDefine.call(\n window['customElements'],\n name,\n ManageConnect(constructor, connected, disconnected)\n );\n // unpatch connected/disconnected on class; custom elements tears this off\n // so the patch is maintained, but if the user calls these methods for\n // e.g. testing, they will be as expected.\n constructor.prototype.connectedCallback = connected;\n constructor.prototype.disconnectedCallback = disconnected;\n };\n // Note, it would be better to only patch the CustomElementRegistry.prototype,\n // but ShadyCSS patches define directly.\n window.customElements.define = define;\n // Still patch the registry directly since Safari 10 loses the patch\n // unless this is done.\n Object.defineProperty(window['CustomElementRegistry'].prototype, 'define', {\n value: define,\n configurable: true,\n });\n}\n\n/** @return {!ShadyRoot|undefined} */\nexport const ownerShadyRootForNode = (node) => {\n let root = node[utils.SHADY_PREFIX + 'getRootNode']();\n if (utils.isShadyRoot(root)) {\n return root;\n }\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {shadyDataForNode} from '../shady-data.js';\n\nexport const SlotablePatches = utils.getOwnPropertyDescriptors({\n /** @this {Node} */\n get assignedSlot() {\n // Force any parent's shadowRoot to flush so that distribution occurs\n // and this node has an assignedSlot.\n const parent = this[utils.SHADY_PREFIX + 'parentNode'];\n const ownerRoot = parent && parent[utils.SHADY_PREFIX + 'shadowRoot'];\n if (ownerRoot) {\n ownerRoot._render();\n }\n const nodeData = shadyDataForNode(this);\n return (nodeData && nodeData.assignedSlot) || null;\n },\n});\n","/**\n * @license\n * Copyright (c) 2022 The Polymer Project Authors\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\n/**\n * A map describing parentheses-like grouping characters and their behavior. The\n * keys are the group's start character and the value's `end` property contains\n * the end character. The `matchNestedParens` property indicates whether or not\n * other grouping characters nested in the group retain their grouping behavior\n * within that group - i.e. if nested grouping characters need to be matched.\n *\n * @type {!Map<string, {end: string, matchNestedParens: boolean}>}\n */\nconst PARENS = new Map();\n// IE 11 doesn't support `Map`'s constructor parameter.\n[\n ['(', {end: ')', matchNestedParens: true}],\n ['[', {end: ']', matchNestedParens: true}],\n ['\"', {end: '\"', matchNestedParens: false}],\n [\"'\", {end: \"'\", matchNestedParens: false}],\n].forEach(([k, v]) => {\n PARENS.set(k, v);\n});\n\n/**\n * Finds the first character of `queryChars` within `str` from index `start`\n * onwards that is _not_ nested within any parentheses, brackets, or\n * single/double-quoted strings or part of an escape sequence.\n *\n * If the end of the string is reached without finding a character in\n * `queryChars`, the length of the string is returned.\n *\n * @param {string} str\n * @param {number} start\n * @param {!Array<string>} queryChars\n * @param {boolean} matchNestedParens\n * @return {number}\n */\nconst findNext = (str, start, queryChars, matchNestedParens = true) => {\n for (let i = start; i < str.length; i++) {\n if (str[i] === '\\\\' && i < str.length - 1 && str[i + 1] !== '\\n') {\n // Skip escape sequences.\n i++;\n } else if (queryChars.indexOf(str[i]) !== -1) {\n // One of `queryChars` was found.\n return i;\n } else if (matchNestedParens && PARENS.has(str[i])) {\n // Handle any grouping characters by skipping over the group.\n const parenInfo = PARENS.get(str[i]);\n i = findNext(str, i + 1, [parenInfo.end], parenInfo.matchNestedParens);\n continue;\n }\n\n // Do nothing, let `i++` happen.\n }\n\n // Reached the end of the string without finding a final char.\n return str.length;\n};\n\n/**\n * Arrays of compound selectors and combinators that form a complex selector\n * when interleaved.\n *\n * @typedef {{\n * compoundSelectors: !Array<string>,\n * combinators: !Array<string>,\n * }}\n */\nexport let ComplexSelectorParts;\n\n/**\n * Splits a selector list into individual complex selectors and creates a\n * `ComplexSelectorParts` for each.\n *\n * @param {string} str\n * @return {!Array<!ComplexSelectorParts>}\n */\nexport const parseSelectorList = (str) => {\n /**\n * @type {!Array<!ComplexSelectorParts>}\n */\n const results = [];\n\n /**\n * Compound selectors and combinators parsed from the current complex\n * selector.\n *\n * @type {!Array<string>}\n */\n const chunks = [];\n\n /**\n * Creates a new `ComplexSelectorParts` from the current `chunks`, pushes it\n * into `results` and resets `chunks`.\n */\n const endComplexSelector = () => {\n if (chunks.length > 0) {\n while (chunks[chunks.length - 1] === ' ') {\n chunks.pop();\n }\n results.push({\n compoundSelectors: chunks.filter((x, i) => i % 2 === 0),\n combinators: chunks.filter((x, i) => i % 2 === 1),\n });\n chunks.length = 0;\n }\n };\n\n for (let i = 0; i < str.length; ) {\n const prevChunk = chunks[chunks.length - 1];\n // `nextIndex` is the next complex selector boundary, combinator, or\n // whitespace that isn't inside other grouping characters.\n const nextIndex = findNext(str, i, [',', ' ', '>', '+', '~']);\n // If `nextIndex` is `i`, then the chunk we're considering is only the next\n // single character.\n const nextChunk = nextIndex === i ? str[i] : str.substring(i, nextIndex);\n\n if (nextChunk === ',') {\n endComplexSelector();\n } else if (\n [undefined, ' ', '>', '+', '~'].indexOf(prevChunk) !== -1 &&\n nextChunk === ' '\n ) {\n // Ignore leading whitespace and whitespace directly after combinators.\n } else if (prevChunk === ' ' && ['>', '+', '~'].indexOf(nextChunk) !== -1) {\n // If the last chunk was whitespace and this chunk is a non-whitespace\n // combinator, replace the whitespace with this combinator.\n chunks[chunks.length - 1] = nextChunk;\n } else {\n chunks.push(nextChunk);\n }\n\n i = nextIndex + (nextIndex === i ? 1 : 0);\n }\n\n endComplexSelector();\n\n return results;\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {shadyDataForNode} from '../shady-data.js';\nimport {ComplexSelectorParts, parseSelectorList} from '../selector-parser.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/**\n * @param {Node} node\n * @param {Function} matcher\n * @param {Function=} halter\n */\nexport function query(node, matcher, halter) {\n let list = [];\n queryChildNodes(node, matcher, halter, list);\n return list;\n}\n\nfunction queryChildNodes(parent, matcher, halter, list) {\n for (\n let n = parent[utils.SHADY_PREFIX + 'firstChild'];\n n;\n n = n[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n if (\n n.nodeType === Node.ELEMENT_NODE &&\n queryElement(n, matcher, halter, list)\n ) {\n return true;\n }\n }\n}\n\nfunction queryElement(node, matcher, halter, list) {\n let result = matcher(node);\n if (result) {\n list.push(node);\n }\n if (halter && halter(result)) {\n return result;\n }\n queryChildNodes(node, matcher, halter, list);\n}\n\n// Needed on Element, DocumentFragment, Document\nexport const ParentNodePatches = utils.getOwnPropertyDescriptors({\n /** @this {Element} */\n get firstElementChild() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.firstChild !== undefined) {\n let n = this[utils.SHADY_PREFIX + 'firstChild'];\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n[utils.SHADY_PREFIX + 'nextSibling'];\n }\n return n;\n } else {\n return this[utils.NATIVE_PREFIX + 'firstElementChild'];\n }\n },\n\n /** @this {Element} */\n get lastElementChild() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.lastChild !== undefined) {\n let n = this[utils.SHADY_PREFIX + 'lastChild'];\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n[utils.SHADY_PREFIX + 'previousSibling'];\n }\n return n;\n } else {\n return this[utils.NATIVE_PREFIX + 'lastElementChild'];\n }\n },\n\n /** @this {Element} */\n get children() {\n if (!utils.isTrackingLogicalChildNodes(this)) {\n return this[utils.NATIVE_PREFIX + 'children'];\n }\n return utils.createPolyfilledHTMLCollection(\n Array.prototype.filter.call(utils.childNodesArray(this), (n) => {\n return n.nodeType === Node.ELEMENT_NODE;\n })\n );\n },\n\n /** @this {Element} */\n get childElementCount() {\n let children = this[utils.SHADY_PREFIX + 'children'];\n if (children) {\n return children.length;\n }\n return 0;\n },\n\n /** @this {Element} */\n append(...args) {\n this[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n null\n );\n },\n\n /** @this {Element} */\n prepend(...args) {\n this[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n this[utils.SHADY_PREFIX + 'firstChild']\n );\n },\n\n /** @this {Element} */\n ['replaceChildren'](...args) {\n let child;\n while ((child = this[utils.SHADY_PREFIX + 'firstChild']) !== null) {\n this[utils.SHADY_PREFIX + 'removeChild'](child);\n }\n this[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n null\n );\n },\n});\n\n/**\n * Performs the equivalent of `querySelectorAll` within Shady DOM's logical\n * model of the tree for a selector list.\n *\n * See <./logicalQuerySelectorAll.md> for implementation details.\n *\n * @param {!ParentNode} contextNode\n * @param {string} selectorList\n * @return {!Array<!Element>}\n */\nconst logicalQuerySelectorAll = (contextNode, selectorList) => {\n /**\n * @type {!Array<!ComplexSelectorParts>}\n */\n const complexSelectors = parseSelectorList(selectorList);\n\n if (complexSelectors.length < 1) {\n return [];\n }\n\n /**\n * Determines if a single compound selector matches an element. If the\n * selector contains `:scope` (as a substring), then the selector only is only\n * considered matching if `element` is `contextNode`.\n *\n * @param {!Element} element\n * @param {string} compoundSelector\n * @return {boolean}\n */\n const matchesCompoundSelector = (element, compoundSelector) => {\n return (\n (element === contextNode || compoundSelector.indexOf(':scope') === -1) &&\n utils.matchesSelector(element, compoundSelector)\n );\n };\n\n /**\n * An object used to track the current position of a potential selector match.\n *\n * - `target` is the element that would be considered matching if the cursor\n * eventually results in a complete match.\n *\n * - `complexSelectorParts` is the parsed representation of the complex\n * selector that this cursor is attempting to match.\n *\n * - `index` is the index into `.complexSelectorParts.compoundSelectors` of\n * the last successfully matched compound selector.\n *\n * - `matchedElement` is the element that successfully matched the compound\n * selector in `.complexSelectorParts.compoundSelectors` at `index`.\n *\n * @typedef {{\n * target: !Element,\n * complexSelectorParts: !ComplexSelectorParts,\n * matchedElement: !Element,\n * index: number,\n * }}\n */\n let SelectorMatchingCursor; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n /**\n * The list of `SelectorMatchingCursor`s, initialized with cursors pointing at\n * all descendants of `contextNode` that match the last compound selector in\n * any complex selector in `selectorList`.\n *\n * @type {!Array<!SelectorMatchingCursor>}\n */\n let cursors = utils.flat(\n query(contextNode, (_element) => true).map((element) => {\n return utils.flat(\n complexSelectors.map((complexSelectorParts) => {\n const {compoundSelectors} = complexSelectorParts;\n // Selectors are matched by iterating their compound selectors in\n // reverse order for efficiency. In particular, when finding\n // candidates for the descendant combinator, iterating forwards would\n // imply needing to walk all descendants of the last matched element\n // for possible candidates, but iterating backwards only requires\n // walking up the ancestor chain.\n const index = compoundSelectors.length - 1;\n if (matchesCompoundSelector(element, compoundSelectors[index])) {\n return {\n target: element,\n complexSelectorParts,\n matchedElement: element,\n index,\n };\n } else {\n return [];\n }\n })\n );\n })\n );\n\n // At each step, any remaining cursors that have not finished matching (i.e.\n // with `cursor.index > 0`) should be replaced with new cursors for any valid\n // candidates that match the next compound selector.\n while (cursors.some((cursor) => cursor.index > 0)) {\n cursors = utils.flat(\n cursors.map((cursor) => {\n // Cursors with `index` of 0 have already matched and should not be\n // replaced or removed.\n if (cursor.index <= 0) {\n return cursor;\n }\n\n const {\n target,\n matchedElement,\n complexSelectorParts,\n index: lastIndex,\n } = cursor;\n const index = lastIndex - 1;\n const combinator = complexSelectorParts.combinators[index];\n const compoundSelector = complexSelectorParts.compoundSelectors[index];\n\n if (combinator === ' ') {\n const results = [];\n\n // For `a b`, where existing cursors have `matchedElement`s matching\n // `b`, the candidates to test against `a` are all ancestors of each\n // cursor's `matchedElement`.\n for (\n let ancestor = matchedElement[utils.SHADY_PREFIX + 'parentElement'];\n ancestor;\n ancestor = ancestor[utils.SHADY_PREFIX + 'parentElement']\n ) {\n if (matchesCompoundSelector(ancestor, compoundSelector)) {\n results.push({\n target,\n complexSelectorParts,\n matchedElement: ancestor,\n index,\n });\n }\n }\n\n return results;\n } else if (combinator === '>') {\n const parent = matchedElement[utils.SHADY_PREFIX + 'parentElement'];\n\n // For `a > b`, where existing cursors have `matchedElement`s matching\n // `b`, the candidates to test against `a` are the parents of each\n // cursor's `matchedElement`.\n if (matchesCompoundSelector(parent, compoundSelector)) {\n return {\n target,\n complexSelectorParts,\n matchedElement: parent,\n index,\n };\n }\n\n return [];\n } else if (combinator === '+') {\n const sibling =\n matchedElement[utils.SHADY_PREFIX + 'previousElementSibling'];\n\n // For `a + b`, where existing cursors have `matchedElement`s matching\n // `b`, the candidates to test against `a` are the immediately\n // preceding siblings of each cursor's `matchedElement`.\n if (sibling && matchesCompoundSelector(sibling, compoundSelector)) {\n return {\n target,\n complexSelectorParts,\n matchedElement: sibling,\n index,\n };\n }\n\n return [];\n } else if (combinator === '~') {\n const results = [];\n\n // For `a ~ b`, where existing cursors have `matchedElement`s matching\n // `b`, the candidates to test against `a` are all preceding siblings\n // of each cursor's `matchedElement`.\n for (\n let sibling =\n matchedElement[utils.SHADY_PREFIX + 'previousElementSibling'];\n sibling;\n sibling = sibling[utils.SHADY_PREFIX + 'previousElementSibling']\n ) {\n if (matchesCompoundSelector(sibling, compoundSelector)) {\n results.push({\n target,\n complexSelectorParts,\n matchedElement: sibling,\n index,\n });\n }\n }\n\n return results;\n } else {\n // As of writing, there are no other combinators:\n // <https://drafts.csswg.org/selectors/#combinators>\n throw new Error(`Unrecognized combinator: '${combinator}'.`);\n }\n })\n );\n }\n\n // Map remaining cursors to their `target` and deduplicate.\n return utils.deduplicate(cursors.map(({target}) => target));\n};\n\nconst querySelectorImplementation =\n utils.settings['querySelectorImplementation'];\n\nexport const QueryPatches = utils.getOwnPropertyDescriptors({\n /**\n * @this {!ParentNode}\n * @param {string} selector\n */\n querySelector(selector) {\n if (querySelectorImplementation === 'native') {\n // Polyfilled `ShadowRoot`s don't have a native `querySelectorAll`.\n const target =\n this instanceof ShadowRoot\n ? /** @type {!ShadowRoot} */ (this).host\n : this;\n const candidates = Array.prototype.slice.call(\n target[utils.NATIVE_PREFIX + 'querySelectorAll'](selector)\n );\n const root = this[utils.SHADY_PREFIX + 'getRootNode']();\n // This could use `find`, but Closure doesn't polyfill it.\n for (const candidate of candidates) {\n if (candidate[utils.SHADY_PREFIX + 'getRootNode']() == root) {\n return candidate;\n }\n }\n return null;\n } else if (querySelectorImplementation === 'selectorEngine') {\n return logicalQuerySelectorAll(this, selector)[0] || null;\n } else if (querySelectorImplementation === undefined) {\n // match selector and halt on first result.\n let result = query(\n this,\n function (n) {\n return utils.matchesSelector(n, selector);\n },\n function (n) {\n return Boolean(n);\n }\n )[0];\n return result || null;\n } else {\n throw new Error(\n 'Unrecognized value of ShadyDOM.querySelectorImplementation: ' +\n `'${querySelectorImplementation}'`\n );\n }\n },\n\n /**\n * @this {!ParentNode}\n * @param {string} selector\n * @param {boolean} useNative\n */\n querySelectorAll(selector, useNative) {\n if (useNative || querySelectorImplementation === 'native') {\n // Polyfilled `ShadowRoot`s don't have a native `querySelectorAll`.\n const target =\n this instanceof ShadowRoot\n ? /** @type {!ShadowRoot} */ (this).host\n : this;\n const candidates = Array.prototype.slice.call(\n target[utils.NATIVE_PREFIX + 'querySelectorAll'](selector)\n );\n const root = this[utils.SHADY_PREFIX + 'getRootNode']();\n return utils.createPolyfilledHTMLCollection(\n candidates.filter(\n (e) => e[utils.SHADY_PREFIX + 'getRootNode']() == root\n )\n );\n } else if (querySelectorImplementation === 'selectorEngine') {\n return utils.createPolyfilledHTMLCollection(\n logicalQuerySelectorAll(this, selector)\n );\n } else if (querySelectorImplementation === undefined) {\n return utils.createPolyfilledHTMLCollection(\n query(this, function (n) {\n return utils.matchesSelector(n, selector);\n })\n );\n } else {\n throw new Error(\n 'Unrecognized value of ShadyDOM.querySelectorImplementation: ' +\n `'${querySelectorImplementation}'`\n );\n }\n },\n});\n\n// In preferPerformance mode, create a custom `ParentNodeDocumentOrFragment`\n// that optionally does not mixin querySelector/All; this is a performance\n// optimization. In noPatch, we need to keep the query patches here in order to\n// ensure the query API is available on the wrapper\nexport const ParentNodeDocumentOrFragmentPatches =\n utils.settings.preferPerformance && !utils.settings.noPatch\n ? utils.assign({}, ParentNodePatches)\n : ParentNodePatches;\n\nutils.assign(ParentNodePatches, QueryPatches);\n","/**\n@license\nCopyright (c) 2020 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n\nexport const ChildNodePatches = utils.getOwnPropertyDescriptors({\n /** @this {Element} */\n after(...args) {\n const parentNode = this[utils.SHADY_PREFIX + 'parentNode'];\n if (parentNode === null) {\n return;\n }\n const nextSibling = this[utils.SHADY_PREFIX + 'nextSibling'];\n parentNode[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n nextSibling\n );\n },\n\n /** @this {Element} */\n before(...args) {\n const parentNode = this[utils.SHADY_PREFIX + 'parentNode'];\n if (parentNode === null) {\n return;\n }\n parentNode[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n this\n );\n },\n\n /** @this {Element} */\n remove() {\n const parentNode = this[utils.SHADY_PREFIX + 'parentNode'];\n if (parentNode === null) {\n return;\n }\n parentNode[utils.SHADY_PREFIX + 'removeChild'](this);\n },\n\n /** @this {Element} */\n replaceWith(...args) {\n const parentNode = this[utils.SHADY_PREFIX + 'parentNode'];\n if (parentNode === null) {\n return;\n }\n const nextSibling = this[utils.SHADY_PREFIX + 'nextSibling'];\n parentNode[utils.SHADY_PREFIX + 'removeChild'](this);\n parentNode[utils.SHADY_PREFIX + 'insertBefore'](\n utils.convertNodesIntoANode(...args),\n nextSibling\n );\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {scopeClassAttribute} from '../style-scoping.js';\nimport {shadyDataForNode} from '../shady-data.js';\nimport {attachShadow, ownerShadyRootForNode} from '../attach-shadow.js';\n// prettier-ignore\nimport {eventPropertyNamesForElement, wrappedDescriptorForEventProperty} from '../patch-events.js';\n\nconst doc = window.document;\n\n/**\n * Should be called whenever an attribute changes. If the `slot` attribute\n * changes, provokes rendering if necessary. If a `<slot>` element's `name`\n * attribute changes, updates the root's slot map and renders.\n * @param {Node} node\n * @param {string} name\n */\nfunction distributeAttributeChange(node, name) {\n if (name === 'slot') {\n const parent = node[utils.SHADY_PREFIX + 'parentNode'];\n if (utils.hasShadowRootWithSlot(parent)) {\n shadyDataForNode(parent).root._asyncRender();\n }\n } else if (node.localName === 'slot' && name === 'name') {\n let root = ownerShadyRootForNode(node);\n if (root) {\n root._updateSlotName(node);\n root._asyncRender();\n }\n }\n}\n\nexport const ElementPatches = utils.getOwnPropertyDescriptors({\n /** @this {Element} */\n get previousElementSibling() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.previousSibling !== undefined) {\n let n = this[utils.SHADY_PREFIX + 'previousSibling'];\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n[utils.SHADY_PREFIX + 'previousSibling'];\n }\n return n;\n } else {\n return this[utils.NATIVE_PREFIX + 'previousElementSibling'];\n }\n },\n\n /** @this {Element} */\n get nextElementSibling() {\n const nodeData = shadyDataForNode(this);\n if (nodeData && nodeData.nextSibling !== undefined) {\n let n = this[utils.SHADY_PREFIX + 'nextSibling'];\n while (n && n.nodeType !== Node.ELEMENT_NODE) {\n n = n[utils.SHADY_PREFIX + 'nextSibling'];\n }\n return n;\n } else {\n return this[utils.NATIVE_PREFIX + 'nextElementSibling'];\n }\n },\n\n /** @this {Element} */\n get slot() {\n return this.getAttribute('slot');\n },\n\n /** @this {Element} */\n set slot(value) {\n this[utils.SHADY_PREFIX + 'setAttribute']('slot', value);\n },\n\n /** @this {Element} */\n get className() {\n return this.getAttribute('class') || '';\n },\n\n /**\n * @this {Element}\n * @param {string} value\n */\n set className(value) {\n this[utils.SHADY_PREFIX + 'setAttribute']('class', value);\n },\n\n /**\n * @this {Element}\n * @param {string} attr\n * @param {string} value\n */\n setAttribute(attr, value) {\n if (this.ownerDocument !== doc) {\n this[utils.NATIVE_PREFIX + 'setAttribute'](attr, value);\n } else if (!scopeClassAttribute(this, attr, value)) {\n this[utils.NATIVE_PREFIX + 'setAttribute'](attr, value);\n distributeAttributeChange(this, attr);\n }\n },\n\n /**\n * @this {Element}\n * @param {string} attr\n */\n removeAttribute(attr) {\n if (this.ownerDocument !== doc) {\n this[utils.NATIVE_PREFIX + 'removeAttribute'](attr);\n } else if (!scopeClassAttribute(this, attr, '')) {\n this[utils.NATIVE_PREFIX + 'removeAttribute'](attr);\n distributeAttributeChange(this, attr);\n } else if (this.getAttribute(attr) === '') {\n // ensure that \"class\" attribute is fully removed if ShadyCSS does not keep scoping\n this[utils.NATIVE_PREFIX + 'removeAttribute'](attr);\n }\n },\n});\n\nif (!utils.settings.preferPerformance) {\n eventPropertyNamesForElement.forEach((property) => {\n ElementPatches[property] = wrappedDescriptorForEventProperty(property);\n });\n}\n\nexport const ElementShadowPatches = utils.getOwnPropertyDescriptors({\n /**\n * @this {Element}\n * @param {!{mode: string}} options\n */\n attachShadow(options) {\n const root = attachShadow(this, options);\n // TODO(sorvell): Workaround for CE not seeing shadowRoot in `on-demand`\n // noPatch mode. CE's attachShadow patch is overwritten by this patch\n // and cannot set its own special tracking for shadowRoot. It does this\n // to be able to see closed shadowRoots.\n // This is necessary so that the CE polyfill can traverse into nodes\n // with shadowRoot that will under `on-demand` have their childNodes patched.\n this['__CE_shadowRoot'] = root;\n return root;\n },\n\n // Note: Can be patched on element prototype on all browsers.\n // Must be patched on instance on browsers that support native Shadow DOM\n // but do not have builtin accessors (old Chrome).\n /** @this {Element} */\n get shadowRoot() {\n const nodeData = shadyDataForNode(this);\n return (nodeData && nodeData.publicRoot) || null;\n },\n});\n\nutils.assign(ElementPatches, ElementShadowPatches);\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {getInnerHTML} from '../innerHTML.js';\nimport {clearNode} from './Node.js';\n\n/** @type {!Document} */\nconst inertDoc = document.implementation.createHTMLDocument('inert');\n\nexport const ElementOrShadowRootPatches = utils.getOwnPropertyDescriptors({\n /** @this {Element} */\n get innerHTML() {\n if (utils.isTrackingLogicalChildNodes(this)) {\n const content =\n this.localName === 'template'\n ? /** @type {HTMLTemplateElement} */ (this).content\n : this;\n return getInnerHTML(content, utils.childNodesArray);\n } else {\n return this[utils.NATIVE_PREFIX + 'innerHTML'];\n }\n },\n\n /**\n * @this {Element}\n * @param {string} value\n */\n set innerHTML(value) {\n if (this.localName === 'template') {\n this[utils.NATIVE_PREFIX + 'innerHTML'] = value;\n } else {\n clearNode(this);\n const containerName = this.localName || 'div';\n let htmlContainer;\n if (!this.namespaceURI || this.namespaceURI === inertDoc.namespaceURI) {\n htmlContainer = inertDoc.createElement(containerName);\n } else {\n htmlContainer = inertDoc.createElementNS(\n this.namespaceURI,\n containerName\n );\n }\n if (utils.settings.hasDescriptors) {\n htmlContainer[utils.NATIVE_PREFIX + 'innerHTML'] = value;\n } else {\n htmlContainer.innerHTML = value;\n }\n let firstChild;\n while ((firstChild = htmlContainer[utils.SHADY_PREFIX + 'firstChild'])) {\n this[utils.SHADY_PREFIX + 'insertBefore'](firstChild);\n }\n }\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n// prettier-ignore\nimport {eventPropertyNamesForHTMLElement, wrappedDescriptorForEventProperty} from '../patch-events.js';\nimport {shadyDataForNode} from '../shady-data.js';\n\nexport const HTMLElementPatches = utils.getOwnPropertyDescriptors({\n /** @this {HTMLElement} */\n blur() {\n const nodeData = shadyDataForNode(this);\n let root = nodeData && nodeData.root;\n let shadowActive = root && root.activeElement;\n if (shadowActive) {\n shadowActive[utils.SHADY_PREFIX + 'blur']();\n } else {\n this[utils.NATIVE_PREFIX + 'blur']();\n }\n },\n});\n\nif (!utils.settings.preferPerformance) {\n eventPropertyNamesForHTMLElement.forEach((property) => {\n HTMLElementPatches[property] = wrappedDescriptorForEventProperty(property);\n });\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {shadyDataForNode} from '../shady-data.js';\nimport {addEventListener, removeEventListener} from '../patch-events.js';\n\nexport const SlotPatches = utils.getOwnPropertyDescriptors({\n /**\n * @this {HTMLSlotElement}\n * @param {Object=} options\n */\n assignedNodes(options) {\n if (this.localName === 'slot') {\n // Force any containing shadowRoot to flush so that distribution occurs\n // and this node has assignedNodes.\n const root = this[utils.SHADY_PREFIX + 'getRootNode']();\n if (root && utils.isShadyRoot(root)) {\n root._render();\n }\n const nodeData = shadyDataForNode(this);\n return nodeData\n ? (options && options.flatten\n ? nodeData.flattenedNodes\n : nodeData.assignedNodes) || []\n : [];\n }\n },\n\n /**\n * @this {HTMLSlotElement}\n * @param {string} type\n * @param {Function} fn\n * @param {Object|boolean=} optionsOrCapture\n */\n addEventListener(type, fn, optionsOrCapture) {\n // NOTE, check if this is a `slot` because these patches are installed on\n // Element where browsers don't have `<slot>`\n if (this.localName !== 'slot' || type === 'slotchange') {\n addEventListener.call(this, type, fn, optionsOrCapture);\n } else {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture),\n };\n }\n const parent = this[utils.SHADY_PREFIX + 'parentNode'];\n if (!parent) {\n throw new Error(\n 'ShadyDOM cannot attach event to slot unless it has a `parentNode`'\n );\n }\n optionsOrCapture.__shadyTarget = this;\n parent[utils.SHADY_PREFIX + 'addEventListener'](\n type,\n fn,\n optionsOrCapture\n );\n }\n },\n\n /**\n * @this {HTMLSlotElement}\n * @param {string} type\n * @param {Function} fn\n * @param {Object|boolean=} optionsOrCapture\n */\n removeEventListener(type, fn, optionsOrCapture) {\n // NOTE, check if this is a `slot` because these patches are installed on\n // Element where browsers don't have `<slot>`\n if (this.localName !== 'slot' || type === 'slotchange') {\n removeEventListener.call(this, type, fn, optionsOrCapture);\n } else {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture),\n };\n }\n const parent = this[utils.SHADY_PREFIX + 'parentNode'];\n if (!parent) {\n throw new Error(\n 'ShadyDOM cannot attach event to slot unless it has a `parentNode`'\n );\n }\n optionsOrCapture.__shadyTarget = this;\n parent[utils.SHADY_PREFIX + 'removeEventListener'](\n type,\n fn,\n optionsOrCapture\n );\n }\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport * as utils from '../utils.js';\nimport {query} from './ParentNode.js';\n\nexport const DocumentOrFragmentPatches = utils.getOwnPropertyDescriptors({\n /**\n * @this {Element}\n * @param {string} id\n */\n getElementById(id) {\n if (id === '') {\n return null;\n }\n let result = query(\n this,\n function (n) {\n return n.id == id;\n },\n function (n) {\n return Boolean(n);\n }\n )[0];\n return result || null;\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\nimport {ownerShadyRootForNode} from '../attach-shadow.js';\n\nfunction getDocumentActiveElement() {\n if (utils.settings.hasDescriptors) {\n return document[utils.NATIVE_PREFIX + 'activeElement'];\n } else {\n return document.activeElement;\n }\n}\n\n// Get the element within the given set of roots.\nfunction getElInRoot(roots, el) {\n let elRoot;\n while (\n el &&\n !roots.has((elRoot = el[utils.SHADY_PREFIX + 'getRootNode']()))\n ) {\n el = elRoot.host;\n }\n return el;\n}\n\nfunction getAncestorRoots(docOrRoot) {\n const roots = new Set();\n roots.add(docOrRoot);\n while (utils.isShadyRoot(docOrRoot) && docOrRoot.host) {\n docOrRoot = docOrRoot.host[utils.SHADY_PREFIX + 'getRootNode']();\n roots.add(docOrRoot);\n }\n return roots;\n}\n\nconst USE_NATIVE_DOCUMENT_EFP = 'useNativeDocumentEFP';\n\nconst elementsFromPointProperty =\n utils.NATIVE_PREFIX +\n utils.getPropertyName(Document.prototype, 'elementsFromPoint');\n\nexport const DocumentOrShadowRootPatches = utils.getOwnPropertyDescriptors({\n /** @this {Document|ShadowRoot} */\n get activeElement() {\n let active = getDocumentActiveElement();\n // In IE11, activeElement might be an empty object if the document is\n // contained in an iframe.\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10998788/\n if (!active || !active.nodeType) {\n return null;\n }\n let isShadyRoot = !!utils.isShadyRoot(this);\n if (this !== document) {\n // If this node isn't a document or shady root, then it doesn't have\n // an active element.\n if (!isShadyRoot) {\n return null;\n }\n // If this shady root's host is the active element or the active\n // element is not a descendant of the host (in the composed tree),\n // then it doesn't have an active element.\n if (\n this.host === active ||\n !this.host[utils.NATIVE_PREFIX + 'contains'](active)\n ) {\n return null;\n }\n }\n // This node is either the document or a shady root of which the active\n // element is a (composed) descendant of its host; iterate upwards to\n // find the active element's most shallow host within it.\n let activeRoot = ownerShadyRootForNode(active);\n while (activeRoot && activeRoot !== this) {\n active = activeRoot.host;\n activeRoot = ownerShadyRootForNode(active);\n }\n if (this === document) {\n // This node is the document, so activeRoot should be null.\n return activeRoot ? null : active;\n } else {\n // This node is a non-document shady root, and it should be\n // activeRoot.\n return activeRoot === this ? active : null;\n }\n },\n\n /** @this {Document|ShadowRoot} */\n elementsFromPoint(x, y) {\n const nativeResult = document[elementsFromPointProperty](x, y);\n // support optionally opt-ing out for document\n if (this === document && utils.settings[USE_NATIVE_DOCUMENT_EFP]) {\n return nativeResult;\n }\n const nativeArray = utils.arrayFrom(nativeResult);\n // Filter native result to return the element in this root\n // OR an above root.\n // Set containing this root and its ancestor roots.\n const ancestorRoots = getAncestorRoots(this);\n // Use a Set since the elements can repeat.\n const rootedResult = new Set();\n for (let i = 0; i < nativeArray.length; i++) {\n rootedResult.add(getElInRoot(ancestorRoots, nativeArray[i]));\n }\n // Note, for IE compat avoid Array.from(set).\n const r = [];\n rootedResult.forEach((x) => r.push(x));\n return r;\n },\n\n /** @this {Document|ShadowRoot} */\n elementFromPoint(x, y) {\n // support optionally opt-ing out for document\n return this === document && utils.settings[USE_NATIVE_DOCUMENT_EFP]\n ? this[utils.NATIVE_PREFIX + 'elementFromPoint'](x, y)\n : this[utils.SHADY_PREFIX + 'elementsFromPoint'](x, y)[0] || null;\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n\nconst doc = window.document;\n\nexport const DocumentPatches = utils.getOwnPropertyDescriptors({\n // note: Though not technically correct, we fast path `importNode`\n // when called on a node not owned by the main document.\n // This allows, for example, elements that cannot\n // contain custom elements and are therefore not likely to contain shadowRoots\n // to cloned natively. This is a fairly significant performance win.\n /**\n * @this {Document}\n * @param {Node} node\n * @param {boolean} deep\n */\n importNode(node, deep) {\n // A template element normally has no children with shadowRoots, so make\n // sure we always make a deep copy to correctly construct the template.content\n if (node.ownerDocument !== doc || node.localName === 'template') {\n return this[utils.NATIVE_PREFIX + 'importNode'](node, deep);\n }\n let n = this[utils.NATIVE_PREFIX + 'importNode'](node, false);\n if (deep) {\n for (\n let c = node[utils.SHADY_PREFIX + 'firstChild'], nc;\n c;\n c = c[utils.SHADY_PREFIX + 'nextSibling']\n ) {\n nc = this[utils.SHADY_PREFIX + 'importNode'](c, true);\n n[utils.SHADY_PREFIX + 'appendChild'](nc);\n }\n }\n return n;\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\nimport * as utils from '../utils.js';\n// prettier-ignore\nimport {addEventListener, removeEventListener, dispatchEvent} from '../patch-events.js';\n\nexport const WindowPatches = utils.getOwnPropertyDescriptors({\n // Ensure that `dispatchEvent` is patched directly on Window since on\n // IE11, Window does not descend from EventTarget.\n dispatchEvent,\n\n // NOTE: ensure these methods are bound to `window` so that `this` is correct\n // when called directly from global context without a receiver; e.g.\n // `addEventListener(...)`.\n addEventListener: addEventListener.bind(window),\n\n removeEventListener: removeEventListener.bind(window),\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {EventTargetPatches} from './patches/EventTarget.js';\nimport {NodePatches} from './patches/Node.js';\nimport {SlotablePatches} from './patches/Slotable.js';\n// prettier-ignore\nimport {ParentNodePatches, ParentNodeDocumentOrFragmentPatches} from './patches/ParentNode.js';\nimport {ChildNodePatches} from './patches/ChildNode.js';\nimport {ElementPatches, ElementShadowPatches} from './patches/Element.js';\nimport {ElementOrShadowRootPatches} from './patches/ElementOrShadowRoot.js';\nimport {HTMLElementPatches} from './patches/HTMLElement.js';\nimport {SlotPatches} from './patches/Slot.js';\nimport {DocumentOrFragmentPatches} from './patches/DocumentOrFragment.js';\nimport {DocumentOrShadowRootPatches} from './patches/DocumentOrShadowRoot.js';\nimport {DocumentPatches} from './patches/Document.js';\nimport {WindowPatches} from './patches/Window.js';\n\n// Some browsers (IE/Edge) have non-standard HTMLElement accessors.\nconst NonStandardHTMLElement = {};\n\nif (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'parentElement')) {\n NonStandardHTMLElement.parentElement = NodePatches.parentElement;\n}\n\nif (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'contains')) {\n NonStandardHTMLElement.contains = NodePatches.contains;\n}\n\nif (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'children')) {\n NonStandardHTMLElement.children = ParentNodePatches.children;\n}\n\nif (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'innerHTML')) {\n NonStandardHTMLElement.innerHTML = ElementOrShadowRootPatches.innerHTML;\n}\n\nif (Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'className')) {\n NonStandardHTMLElement.className = ElementPatches.className;\n}\n\n// Avoid patching `innerHTML` if it does not exist on Element (IE)\n// and we can patch accessors (hasDescriptors).\nconst ElementShouldHaveInnerHTML =\n !utils.settings.hasDescriptors || 'innerHTML' in Element.prototype;\n\n// setup patching\nconst patchMap = {\n EventTarget: [EventTargetPatches],\n Node: [NodePatches, !window.EventTarget ? EventTargetPatches : null],\n Text: [SlotablePatches],\n Comment: [SlotablePatches],\n CDATASection: [SlotablePatches],\n ProcessingInstruction: [SlotablePatches],\n Element: [\n ElementPatches,\n ParentNodePatches,\n ChildNodePatches,\n SlotablePatches,\n ElementShouldHaveInnerHTML ? ElementOrShadowRootPatches : null,\n !window.HTMLSlotElement ? SlotPatches : null,\n ],\n HTMLElement: [HTMLElementPatches, NonStandardHTMLElement],\n HTMLSlotElement: [SlotPatches],\n DocumentFragment: [\n ParentNodeDocumentOrFragmentPatches,\n DocumentOrFragmentPatches,\n ],\n Document: [\n DocumentPatches,\n ParentNodeDocumentOrFragmentPatches,\n DocumentOrFragmentPatches,\n DocumentOrShadowRootPatches,\n ],\n Window: [WindowPatches],\n CharacterData: [ChildNodePatches],\n XMLHttpRequest: [!window.EventTarget ? EventTargetPatches : null],\n};\n\nconst getPatchPrototype = (name) => window[name] && window[name].prototype;\n\n// Note, must avoid patching accessors on prototypes when descriptors are not correct\n// because the CustomElements polyfill checks if these exist before patching instances.\n// CustomElements polyfill *only* cares about these accessors.\nconst disallowedNativePatches = utils.settings.hasDescriptors\n ? null\n : ['innerHTML', 'textContent'];\n\n/**\n * Patch a group of accessors on an object.\n * @param {!Object} proto\n * @param {!Array<Object>} list\n * @param {string=} prefix\n * @param {Array=} disallowed\n */\nfunction applyPatchList(proto, list, prefix, disallowed) {\n list.forEach(\n (patch) =>\n proto && patch && utils.patchProperties(proto, patch, prefix, disallowed)\n );\n}\n\n/** @param {string=} prefix */\nexport const applyPatches = (prefix) => {\n const disallowed = prefix ? null : disallowedNativePatches;\n for (let p in patchMap) {\n const proto = getPatchPrototype(p);\n applyPatchList(proto, patchMap[p], prefix, disallowed);\n }\n};\n\nconst PROTO_IS_PATCHED = utils.SHADY_PREFIX + 'protoIsPatched';\n\n// This property is stored directly on these objects, rather than in a local\n// Map, because IE11 has a bug around `defineProperty`/`hasOwnProperty` which\n// breaks Closure Compiler's WeakMap polyfill when using both certain native\n// prototypes (e.g. of CDATASection) and their instances as keys - even if\n// they're isolated to different WeakMaps. Closure's WeakMap polyfill is used\n// transitively by its own Map and Set polyfills, so this bug applies to any\n// situation where either of Map or Set are polyfilled also.\nconst PATCHED_PROTO = utils.SHADY_PREFIX + 'patchedProto';\n\n// Patch non-element prototypes up front so that we don't have to check\n// the type of Node when patching an can always assume we're patching an element.\n['Text', 'Comment', 'CDATASection', 'ProcessingInstruction'].forEach((name) => {\n const ctor = window[name];\n const patchedProto = Object.create(ctor.prototype);\n patchedProto[PROTO_IS_PATCHED] = true;\n applyPatchList(patchedProto, patchMap.EventTarget);\n applyPatchList(patchedProto, patchMap.Node);\n if (patchMap[name]) {\n applyPatchList(patchedProto, patchMap[name]);\n }\n ctor.prototype[PATCHED_PROTO] = patchedProto;\n});\n\nexport const patchElementProto = (proto) => {\n proto[PROTO_IS_PATCHED] = true;\n applyPatchList(proto, patchMap.EventTarget);\n applyPatchList(proto, patchMap.Node);\n applyPatchList(proto, patchMap.Element);\n applyPatchList(proto, patchMap.HTMLElement);\n applyPatchList(proto, patchMap.HTMLSlotElement);\n return proto;\n};\n\nexport const patchNodeProto = (node) => {\n if (node[PROTO_IS_PATCHED] || utils.isShadyRoot(node)) {\n return;\n }\n const nativeProto = Object.getPrototypeOf(node);\n // Note, this hasOwnProperty check is critical to avoid seeing a patched\n // prototype lower in the prototype chain, e.g. if an <s> element has been\n // patched, without this check, an <input> element would get the wrong patch.\n let proto =\n nativeProto.hasOwnProperty(PATCHED_PROTO) && nativeProto[PATCHED_PROTO];\n if (!proto) {\n proto = Object.create(nativeProto);\n patchElementProto(proto);\n nativeProto[PATCHED_PROTO] = proto;\n }\n Object.setPrototypeOf(node, proto);\n};\n\nexport const patchShadowOnElement = () => {\n utils.patchProperties(Element.prototype, ElementShadowPatches);\n};\n\nexport const addShadyPrefixedProperties = () => {\n // perform shady patches\n applyPatches(utils.SHADY_PREFIX);\n\n // install `_activeElement` because some browsers (older Chrome/Safari) do not have\n // a 'configurable' `activeElement` accesssor.\n const descriptor = DocumentOrShadowRootPatches.activeElement;\n Object.defineProperty(document, '_activeElement', descriptor);\n\n // On Window, we're patching `addEventListener` which is a weird auto-bound\n // property that is not directly on the Window prototype.\n utils.patchProperties(Window.prototype, WindowPatches, utils.SHADY_PREFIX);\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {shadyDataForNode, ensureShadyDataForNode} from './shady-data.js';\n// prettier-ignore\nimport {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-instances.js';\nimport {patchNodeProto} from './patch-prototypes.js';\n\nconst OutsideAccessors = 1;\nconst InsideAcccessors = 2;\n\nconst patchOnDemand = utils.settings.patchOnDemand;\nconst hasDescriptors = utils.settings.hasDescriptors;\n\nfunction patchNode(node, type) {\n if (patchOnDemand) {\n patchNodeProto(node);\n }\n if (!hasDescriptors) {\n if (type === OutsideAccessors) {\n patchOutsideElementAccessors(node);\n } else if (type === InsideAcccessors) {\n patchInsideElementAccessors(node);\n }\n }\n}\n\nfunction linkNode(node, container, containerData, ref_node) {\n patchNode(node, OutsideAccessors);\n ref_node = ref_node || null;\n const nodeData = ensureShadyDataForNode(node);\n const ref_nodeData = ref_node ? ensureShadyDataForNode(ref_node) : null;\n // update ref_node.previousSibling <-> node\n nodeData.previousSibling = ref_node\n ? ref_nodeData.previousSibling\n : container[utils.SHADY_PREFIX + 'lastChild'];\n let psd = shadyDataForNode(nodeData.previousSibling);\n if (psd) {\n psd.nextSibling = node;\n }\n // update node <-> ref_node\n let nsd = shadyDataForNode((nodeData.nextSibling = ref_node));\n if (nsd) {\n nsd.previousSibling = node;\n }\n // update node <-> container\n nodeData.parentNode = container;\n if (ref_node) {\n if (ref_node === containerData.firstChild) {\n containerData.firstChild = node;\n }\n } else {\n containerData.lastChild = node;\n if (!containerData.firstChild) {\n containerData.firstChild = node;\n }\n }\n // remove caching of childNodes\n containerData.childNodes = null;\n}\n\nexport const recordInsertBefore = (node, container, ref_node) => {\n patchNode(container, InsideAcccessors);\n const containerData = ensureShadyDataForNode(container);\n if (containerData.firstChild !== undefined) {\n containerData.childNodes = null;\n }\n // handle document fragments\n if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // Note, documentFragments should not have logical DOM so there's\n // no need update that. It is possible to append a ShadowRoot, but we're\n // choosing not to support that.\n const first = node[utils.NATIVE_PREFIX + 'firstChild'];\n for (let n = first; n; n = n[utils.NATIVE_PREFIX + 'nextSibling']) {\n linkNode(n, container, containerData, ref_node);\n }\n } else {\n linkNode(node, container, containerData, ref_node);\n }\n};\n\nexport const recordRemoveChild = (node, container) => {\n const nodeData = ensureShadyDataForNode(node);\n const containerData = ensureShadyDataForNode(container);\n if (node === containerData.firstChild) {\n containerData.firstChild = nodeData.nextSibling;\n }\n if (node === containerData.lastChild) {\n containerData.lastChild = nodeData.previousSibling;\n }\n let p = nodeData.previousSibling;\n let n = nodeData.nextSibling;\n if (p) {\n ensureShadyDataForNode(p).nextSibling = n;\n }\n if (n) {\n ensureShadyDataForNode(n).previousSibling = p;\n }\n // When an element is removed, logical data is no longer tracked.\n // Explicitly set `undefined` here to indicate this. This is disginguished\n // from `null` which is set if info is null.\n nodeData.parentNode = nodeData.previousSibling = nodeData.nextSibling = undefined;\n if (containerData.childNodes !== undefined) {\n // remove caching of childNodes\n containerData.childNodes = null;\n }\n};\n\n/**\n * @param {!Node|DocumentFragment} node\n * @param {!Node|DocumentFragment=} adoptedParent\n */\nexport const recordChildNodes = (node, adoptedParent) => {\n const nodeData = ensureShadyDataForNode(node);\n if (!adoptedParent && nodeData.firstChild !== undefined) {\n return;\n }\n // remove caching of childNodes\n nodeData.childNodes = null;\n const first = (nodeData.firstChild =\n node[utils.NATIVE_PREFIX + 'firstChild']);\n nodeData.lastChild = node[utils.NATIVE_PREFIX + 'lastChild'];\n patchNode(node, InsideAcccessors);\n for (let n = first, previous; n; n = n[utils.NATIVE_PREFIX + 'nextSibling']) {\n const sd = ensureShadyDataForNode(n);\n sd.parentNode = adoptedParent || node;\n sd.nextSibling = n[utils.NATIVE_PREFIX + 'nextSibling'];\n sd.previousSibling = previous || null;\n previous = n;\n patchNode(n, OutsideAccessors);\n }\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from '../utils.js';\n\nexport const ShadowRootPatches = utils.getOwnPropertyDescriptors({\n /**\n * @this {ShadowRoot}\n * @param {string} type\n * @param {Function} fn\n * @param {Object|boolean=} optionsOrCapture\n */\n addEventListener(type, fn, optionsOrCapture) {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture),\n };\n }\n // Note, `__shadyTarget` may already be set if an event was added on a <slot> child\n optionsOrCapture.__shadyTarget = optionsOrCapture.__shadyTarget || this;\n this.host[utils.SHADY_PREFIX + 'addEventListener'](\n type,\n fn,\n optionsOrCapture\n );\n },\n\n /**\n * @this {ShadowRoot}\n * @param {string} type\n * @param {Function} fn\n * @param {Object|boolean=} optionsOrCapture\n */\n removeEventListener(type, fn, optionsOrCapture) {\n if (typeof optionsOrCapture !== 'object') {\n optionsOrCapture = {\n capture: Boolean(optionsOrCapture),\n };\n }\n // Note, `__shadyTarget` may already be set if an event was added on a <slot> child\n optionsOrCapture.__shadyTarget = optionsOrCapture.__shadyTarget || this;\n this.host[utils.SHADY_PREFIX + 'removeEventListener'](\n type,\n fn,\n optionsOrCapture\n );\n },\n});\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\nimport {NodePatches} from './patches/Node.js';\n// prettier-ignore\nimport {OutsideDescriptors, InsideDescriptors, TextContentInnerHTMLDescriptors} from './patch-instances.js';\nimport {ParentNodePatches} from './patches/ParentNode.js';\nimport {DocumentOrFragmentPatches} from './patches/DocumentOrFragment.js';\nimport {DocumentOrShadowRootPatches} from './patches/DocumentOrShadowRoot.js';\nimport {ElementOrShadowRootPatches} from './patches/ElementOrShadowRoot.js';\nimport {ShadowRootPatches} from './patches/ShadowRoot.js';\n\n/**\n * @param {!Object} proto\n * @param {string=} prefix\n */\nconst patchShadyAccessors = (proto, prefix) => {\n utils.patchProperties(proto, ShadowRootPatches, prefix);\n utils.patchProperties(proto, DocumentOrShadowRootPatches, prefix);\n utils.patchProperties(proto, ElementOrShadowRootPatches, prefix);\n // We ensure ParentNode accessors since these do not exist in Edge/IE on DocumentFragments.\n utils.patchProperties(proto, ParentNodePatches, prefix);\n // Ensure `shadowRoot` has basic descriptors when we cannot rely\n // on them coming from DocumentFragment.\n //\n // Case 1, noPatching: Because we want noPatch ShadyRoots to have native property\n // names so that they do not have to be wrapped...\n // When we do *not* patch Node/DocumentFragment.prototype\n // we must manually install those properties on ShadyRoot's prototype.\n // Note, it's important to only install these in this mode so as not to stomp\n // over CustomElements polyfill's patches on Node/DocumentFragment methods.\n if (utils.settings.noPatch && !prefix) {\n utils.patchProperties(proto, NodePatches, prefix);\n utils.patchProperties(proto, DocumentOrFragmentPatches, prefix);\n }\n // Case 2, bad descriptors: Ensure accessors are on ShadowRoot.\n // These descriptors are normally used for instance patching but because\n // ShadyRoot can always be patched, just do it to the prototype.\n else if (!utils.settings.hasDescriptors) {\n utils.patchProperties(proto, OutsideDescriptors);\n utils.patchProperties(proto, InsideDescriptors);\n utils.patchProperties(proto, TextContentInnerHTMLDescriptors);\n }\n};\n\nexport const patchShadyRoot = (proto) => {\n proto.__proto__ = DocumentFragment.prototype;\n\n // patch both prefixed and not, even when noPatch == true.\n patchShadyAccessors(proto, utils.SHADY_PREFIX);\n patchShadyAccessors(proto);\n\n // Ensure native properties are all safely wrapped since ShadowRoot is not an\n // actual DocumentFragment instance.\n Object.defineProperties(proto, {\n nodeType: {\n value: Node.DOCUMENT_FRAGMENT_NODE,\n configurable: true,\n },\n nodeName: {\n value: '#document-fragment',\n configurable: true,\n },\n nodeValue: {\n value: null,\n configurable: true,\n },\n });\n\n // make undefined\n ['localName', 'namespaceURI', 'prefix'].forEach((prop) => {\n Object.defineProperty(proto, prop, {\n value: undefined,\n configurable: true,\n });\n });\n\n // defer properties to host\n ['ownerDocument', 'baseURI', 'isConnected'].forEach((prop) => {\n Object.defineProperty(proto, prop, {\n /** @this {ShadowRoot} */\n get() {\n return this.host[prop];\n },\n configurable: true,\n });\n });\n};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nimport * as utils from './utils.js';\n// prettier-ignore\nimport {eventPropertyNamesForElement, eventPropertyNamesForHTMLElement} from './patch-events.js';\n\n/** @implements {IWrapper} */\nclass Wrapper {\n /** @param {!Node} node */\n constructor(node) {\n this.node = node;\n }\n\n // node\n addEventListener(name, fn, options) {\n return this.node[utils.SHADY_PREFIX + 'addEventListener'](\n name,\n fn,\n options\n );\n }\n\n removeEventListener(name, fn, options) {\n return this.node[utils.SHADY_PREFIX + 'removeEventListener'](\n name,\n fn,\n options\n );\n }\n\n appendChild(node) {\n return this.node[utils.SHADY_PREFIX + 'appendChild'](node);\n }\n\n insertBefore(node, ref_node) {\n return this.node[utils.SHADY_PREFIX + 'insertBefore'](node, ref_node);\n }\n\n removeChild(node) {\n return this.node[utils.SHADY_PREFIX + 'removeChild'](node);\n }\n\n replaceChild(node, ref_node) {\n return this.node[utils.SHADY_PREFIX + 'replaceChild'](node, ref_node);\n }\n\n cloneNode(deep) {\n return this.node[utils.SHADY_PREFIX + 'cloneNode'](deep);\n }\n\n getRootNode(options) {\n return this.node[utils.SHADY_PREFIX + 'getRootNode'](options);\n }\n\n contains(node) {\n return this.node[utils.SHADY_PREFIX + 'contains'](node);\n }\n\n dispatchEvent(event) {\n return this.node[utils.SHADY_PREFIX + 'dispatchEvent'](event);\n }\n\n // element\n setAttribute(name, value) {\n this.node[utils.SHADY_PREFIX + 'setAttribute'](name, value);\n }\n\n // NOTE: not needed, just here for balance\n getAttribute(name) {\n return this.node[utils.NATIVE_PREFIX + 'getAttribute'](name);\n }\n\n // NOTE: not needed, just here for balance\n hasAttribute(name) {\n return this.node[utils.NATIVE_PREFIX + 'hasAttribute'](name);\n }\n\n removeAttribute(name) {\n this.node[utils.SHADY_PREFIX + 'removeAttribute'](name);\n }\n\n attachShadow(options) {\n return this.node[utils.SHADY_PREFIX + 'attachShadow'](options);\n }\n\n /** @return {!Node|undefined} */\n get activeElement() {\n if (\n utils.isShadyRoot(this.node) ||\n this.node.nodeType === Node.DOCUMENT_NODE\n ) {\n const e = this.node[utils.SHADY_PREFIX + 'activeElement'];\n return e;\n }\n return undefined;\n }\n\n /**\n * Installed for compatibility with browsers (older Chrome/Safari) that do\n * not have a configurable `activeElement` accessor. Enables noPatch and\n * patch mode both to consistently use ShadyDOM.wrap(document)._activeElement.\n * @override\n * @return {!Node|undefined}\n */\n get _activeElement() {\n return this.activeElement;\n }\n\n // NOTE: not needed, just here for balance\n /** @override */\n focus() {\n this.node[utils.NATIVE_PREFIX + 'focus']();\n }\n\n blur() {\n this.node[utils.SHADY_PREFIX + 'blur']();\n }\n\n // document\n importNode(node, deep) {\n if (this.node.nodeType === Node.DOCUMENT_NODE) {\n return this.node[utils.SHADY_PREFIX + 'importNode'](node, deep);\n }\n }\n\n getElementById(id) {\n if (this.node.nodeType === Node.DOCUMENT_NODE) {\n return this.node[utils.SHADY_PREFIX + 'getElementById'](id);\n }\n }\n\n elementsFromPoint(x, y) {\n return this.node[utils.SHADY_PREFIX + 'elementsFromPoint'](x, y);\n }\n\n elementFromPoint(x, y) {\n return this.node[utils.SHADY_PREFIX + 'elementFromPoint'](x, y);\n }\n\n // query\n querySelector(selector) {\n return this.node[utils.SHADY_PREFIX + 'querySelector'](selector);\n }\n\n querySelectorAll(selector, useNative) {\n return this.node[utils.SHADY_PREFIX + 'querySelectorAll'](\n selector,\n useNative\n );\n }\n\n // slot\n assignedNodes(options) {\n if (this.node.localName === 'slot') {\n return this.node[utils.SHADY_PREFIX + 'assignedNodes'](options);\n }\n }\n\n get host() {\n if (utils.isShadyRoot(this.node)) {\n return /** @type {!ShadowRoot} */ (this.node).host;\n }\n return undefined;\n }\n\n get parentNode() {\n return this.node[utils.SHADY_PREFIX + 'parentNode'];\n }\n\n get firstChild() {\n return this.node[utils.SHADY_PREFIX + 'firstChild'];\n }\n\n get lastChild() {\n return this.node[utils.SHADY_PREFIX + 'lastChild'];\n }\n\n get nextSibling() {\n return this.node[utils.SHADY_PREFIX + 'nextSibling'];\n }\n\n get previousSibling() {\n return this.node[utils.SHADY_PREFIX + 'previousSibling'];\n }\n\n get childNodes() {\n return this.node[utils.SHADY_PREFIX + 'childNodes'];\n }\n\n get parentElement() {\n return this.node[utils.SHADY_PREFIX + 'parentElement'];\n }\n\n get firstElementChild() {\n return this.node[utils.SHADY_PREFIX + 'firstElementChild'];\n }\n\n get lastElementChild() {\n return this.node[utils.SHADY_PREFIX + 'lastElementChild'];\n }\n\n get nextElementSibling() {\n return this.node[utils.SHADY_PREFIX + 'nextElementSibling'];\n }\n\n get previousElementSibling() {\n return this.node[utils.SHADY_PREFIX + 'previousElementSibling'];\n }\n\n get children() {\n return this.node[utils.SHADY_PREFIX + 'children'];\n }\n\n get childElementCount() {\n return this.node[utils.SHADY_PREFIX + 'childElementCount'];\n }\n\n get shadowRoot() {\n return this.node[utils.SHADY_PREFIX + 'shadowRoot'];\n }\n\n get assignedSlot() {\n return this.node[utils.SHADY_PREFIX + 'assignedSlot'];\n }\n\n get isConnected() {\n return this.node[utils.SHADY_PREFIX + 'isConnected'];\n }\n\n get innerHTML() {\n return this.node[utils.SHADY_PREFIX + 'innerHTML'];\n }\n\n set innerHTML(value) {\n this.node[utils.SHADY_PREFIX + 'innerHTML'] = value;\n }\n\n get textContent() {\n return this.node[utils.SHADY_PREFIX + 'textContent'];\n }\n\n set textContent(value) {\n this.node[utils.SHADY_PREFIX + 'textContent'] = value;\n }\n\n get slot() {\n return this.node[utils.SHADY_PREFIX + 'slot'];\n }\n\n set slot(value) {\n this.node[utils.SHADY_PREFIX + 'slot'] = value;\n }\n\n get className() {\n return this.node[utils.SHADY_PREFIX + 'className'];\n }\n\n set className(value) {\n this.node[utils.SHADY_PREFIX + 'className'] = value;\n }\n\n append(...args) {\n return this.node[utils.SHADY_PREFIX + 'append'](...args);\n }\n\n prepend(...args) {\n return this.node[utils.SHADY_PREFIX + 'prepend'](...args);\n }\n\n replaceChildren(...args) {\n return this.node[utils.SHADY_PREFIX + 'replaceChildren'](...args);\n }\n\n after(...args) {\n return this.node[utils.SHADY_PREFIX + 'after'](...args);\n }\n\n before(...args) {\n return this.node[utils.SHADY_PREFIX + 'before'](...args);\n }\n\n remove() {\n return this.node[utils.SHADY_PREFIX + 'remove']();\n }\n\n replaceWith(...args) {\n return this.node[utils.SHADY_PREFIX + 'replaceWith'](...args);\n }\n}\n\nconst addEventPropertyWrapper = (name) => {\n Object.defineProperty(Wrapper.prototype, name, {\n /** @this {Wrapper} */\n get() {\n return this.node[utils.SHADY_PREFIX + name];\n },\n /** @this {Wrapper} */\n set(value) {\n this.node[utils.SHADY_PREFIX + name] = value;\n },\n configurable: true,\n });\n};\n\neventPropertyNamesForElement.forEach((name) => addEventPropertyWrapper(name));\neventPropertyNamesForHTMLElement.forEach((name) =>\n addEventPropertyWrapper(name)\n);\n\nexport {Wrapper};\n\nconst wrapperMap = new WeakMap();\n\nexport function wrap(obj) {\n if (utils.isShadyRoot(obj) || obj instanceof Wrapper) {\n return obj;\n }\n let wrapper = wrapperMap.get(obj);\n if (!wrapper) {\n wrapper = new Wrapper(obj);\n wrapperMap.set(obj, wrapper);\n }\n return wrapper;\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * Patches elements that interacts with ShadyDOM\n * such that tree traversal and mutation apis act like they would under\n * ShadowDOM.\n *\n * This import enables seemless interaction with ShadyDOM powered\n * custom elements, enabling better interoperation with 3rd party code,\n * libraries, and frameworks that use DOM tree manipulation apis.\n */\n\nimport * as utils from './utils.js';\nimport {flush, enqueue} from './flush.js';\n// prettier-ignore\nimport {observeChildren, unobserveChildren, filterMutations} from './observe-changes.js';\n// prettier-ignore\nimport {addNativePrefixedProperties, nativeMethods, nativeTree} from './patch-native.js';\n// prettier-ignore\nimport {patchInsideElementAccessors, patchOutsideElementAccessors} from './patch-instances.js';\nimport {patchEvents, patchClick, composedPath} from './patch-events.js';\nimport {ShadyRoot} from './attach-shadow.js';\nimport {wrap, Wrapper} from './wrapper.js';\n// prettier-ignore\nimport {addShadyPrefixedProperties, applyPatches, patchShadowOnElement, patchElementProto} from './patch-prototypes.js';\n\nif (utils.settings.inUse) {\n const patch = utils.settings.hasDescriptors\n ? (n) => n\n : (node) => {\n patchInsideElementAccessors(node);\n patchOutsideElementAccessors(node);\n return node;\n };\n\n let ShadyDOM = {\n // TODO(sorvell): remove when Polymer does not depend on this.\n 'inUse': utils.settings.inUse,\n // NOTE: old browsers without prototype accessors (very old Chrome\n // and Safari) need manually patched accessors to properly set\n // `innerHTML` and `textContent` when an element is:\n // (1) inside a shadowRoot\n // (2) does not have special (slot) children itself\n // (3) and setting the property needs to provoke distribution (because\n // a nested slot is added/removed)\n 'patch': patch,\n 'isShadyRoot': utils.isShadyRoot,\n 'enqueue': enqueue,\n 'flush': flush,\n 'flushInitial': (root) => {\n root._flushInitial();\n },\n 'settings': utils.settings,\n 'filterMutations': filterMutations,\n 'observeChildren': observeChildren,\n 'unobserveChildren': unobserveChildren,\n // Set to true to defer native custom elements connection until the\n // document has fully parsed. This enables custom elements that create\n // shadowRoots to be defined while the document is loading. Elements\n // customized as they are created by the parser will successfully\n // render with this flag on.\n 'deferConnectionCallbacks': utils.settings['deferConnectionCallbacks'],\n // Set to true to speed up the polyfill slightly at the cost of correctness\n // * does not patch querySelector/All on Document or DocumentFragment\n // * does not wrap connected/disconnected callbacks to de-dup these\n // when using native customElements\n // * does not wait to process children of elements with shadowRoots\n // meaning shadowRoots should not be created while an element is parsing\n // (e.g. if a custom element that creates a shadowRoot is defined before\n // a candidate element in the document below it.\n 'preferPerformance': utils.settings['preferPerformance'],\n // Integration point with ShadyCSS to disable styling MutationObserver,\n // as ShadyDOM will now handle dynamic scoping.\n 'handlesDynamicScoping': true,\n // Ensure the node is wrapped. This should be used when `noPatch` is set\n // to ensure Shadow DOM compatible DOM operation.\n // Note, wrap falls back to patch so that it ensures API \"always just works\"\n 'wrap': utils.settings.noPatch ? wrap : patch,\n // When code should be compatible with `noPatch` `true` and `on-demand`\n // settings, `wrapIfNeeded` can be used for optimal performance (v. `wrap`)\n // for all DOM operations except the following: `appendChild` and\n // `insertBefore` (when the node is being moved from a location where it\n // was logically positioned in the DOM); when setting `className`/`class`;\n // when calling `querySelector|All`; when setting `textContent` or\n // `innerHTML`; `addEventListener`, `removeEventListener` and\n // `dispatchEvent`; and all scope specific API's like `getRootNode`,\n // `isConnected`, `slot`, `assignedSlot`, `assignedNodes`. Note,\n // `wrapIfNeeded` falls back to a pass through to preserve optimal\n // performance.\n 'wrapIfNeeded': utils.settings.noPatch === true ? wrap : (n) => n,\n 'Wrapper': Wrapper,\n 'composedPath': composedPath,\n // Set to true to avoid patching regular platform property names. When set,\n // Shadow DOM compatible behavior is only available when accessing DOM\n // API using `ShadyDOM.wrap`, e.g. `ShadyDOM.wrap(element).shadowRoot`.\n // This setting provides a small performance boost, but requires all DOM API\n // access that requires Shadow DOM behavior to be proxied via `ShadyDOM.wrap`.\n //\n // WARNING: When `noPatch` is set and the Custom Elements polyfill is\n // needed, the Custom Elements polyfill must be loaded before this\n // polyfill; however, when `noPatch` is not used, this polyfill should be\n // loaded before the Custom Elements polyfill. This is because\n // ShadyDOM captures DOM mutation methods and when `noPatch` is used,\n // ShadyDOM must call the mutation methods patched by the Custom Elements\n // polyfill or custom elements will not function as expected. When `noPatch`\n // is not used, the Custom Elements polyfill patches call through to the\n // ShadyDOM patches so ShadyDOM should be loaded first.\n 'noPatch': utils.settings.noPatch,\n 'patchOnDemand': utils.settings.patchOnDemand,\n 'nativeMethods': nativeMethods,\n 'nativeTree': nativeTree,\n 'patchElementProto': patchElementProto,\n // Use this setting to choose the implementation of `querySelector` and\n // `querySelectorAll`. The options provide different tradeoffs between\n // accuracy and performance, as explained below. More specifically, the\n // logical tree exposed by Shady DOM through the DOM APIs it wraps doesn't\n // match the structure of the tree seen by the browser (the 'real tree'), so\n // the degree to which the browser itself is used to match selectors affects\n // this tradeoff.\n //\n // - `undefined` (default): Shady DOM will walk the logical descendants of\n // the context element and call `matches` with the given selector to find\n // matching elements.\n //\n // This option is a balance between accuracy and performance. This option\n // will be able to match all logical descendants of the context element\n // (i.e. including descendants of unassigned nodes) but selectors are\n // matched against the real tree, so complex selectors may fail to match\n // since their combinators will attempt to match against the structure of\n // the real tree. Generally, you should only pass compound selectors when\n // using the default implementation. This implementation also breaks the\n // semantics of `:scope` because the wrapped `querySelector` call is\n // translated into many `matches` calls on different elements.\n //\n // - `'native'`: Shady DOM's wrapper for (e.g.) `querySelector` will call\n // into the native `querySelector` function and then filter out results that\n // are not in the same shadow root in the logical tree.\n //\n // This is the fastest option. This option will not match elements that\n // are logical descendants of unassigned nodes because they will not be in\n // the real tree, against which the browser matches the selector. Like the\n // default option, this option may not correctly match complex selectors\n // (i.e. those with combinators) due to the structural differences between\n // the real tree and the logical tree. This option preserves the semantics\n // of `:scope` because the context element of the call to the wrapper is\n // also the context element of the call to the native function.\n //\n // - `'selectorEngine'`: Shady DOM's wrapper for (e.g.) `querySelector` will\n // partially parse the given selector list and perform the tree-traversal\n // steps of a selector engine against the logical tree.\n //\n // This is the slowest and most accurate option. This option is able to\n // find all logical descendants of the context element by manually walking\n // the tree. This option is also able to correctly match complex selectors\n // because it does not rely on the browser to handle combinators. Despite\n // using `matches` to match compound selectors during selector evaluation,\n // this option preserves the semantics of `:scope` by only considering\n // compound selectors containing `:scope` to be matching if the context\n // element of the `matches` call is also the context element of the\n // wrapper call.\n //\n // However, the parser used for this option is not strictly correct.\n // Notable caveats include:\n //\n // - The parser assumes the selector list it's given is syntactically\n // correct. When given a selector that would not parse under a full\n // implementation, this implementation may fail silently.\n //\n // - Nested selectors are _not_ taken into consideration while walking\n // the tree. Each outer-most compound selector is tested against\n // candidate elements as a whole, without modification. This means that\n // selectors nested in arguments of functional pseudo-classes, such as\n // `a > b` in `:is(a > b)`, are still matched by the browser against the\n // real tree, not Shady DOM's logical tree.\n //\n // - `:scope` is only supported at the top-level. Particularly, if the\n // text `:scope` appears anywhere within a compound selector, then the\n // selector engine will only allow that compound selector to match the\n // context element. Having the text `:scope` inside a string\n // (`x[y=\":scope\"]`) or an argument to a functional pseudo-selector\n // (`:not(:scope > x)`) will likely break your selector.\n //\n // - The `:host` and `:host-context` pseudo-classes are not supported.\n //\n // - Comments are not supported. (e.g. `a /* b */ c`)\n //\n // - The (draft) column combinator is not supported. (e.g. `a || b`)\n 'querySelectorImplementation':\n utils.settings['querySelectorImplementation'],\n };\n\n window['ShadyDOM'] = ShadyDOM;\n\n // Modifies native prototypes for Node, Element, etc. to\n // make native platform behavior available at prefixed names, e.g.\n // `utils.NATIVE_PREFIX + 'firstChild'` or `__shady_native_firstChild`.\n // This allows the standard names to be safely patched while retaining the\n // ability for native behavior to be used. This polyfill manipulates DOM\n // by using this saved native behavior.\n // Note, some browsers do not have proper element descriptors for\n // accessors; in this case, native behavior for these accessors is simulated\n // via a TreeWalker.\n addNativePrefixedProperties();\n\n // Modifies native prototypes for Node, Element, etc. to make ShadowDOM\n // behavior available at prefixed names, e.g.\n // `utils.SHADY_PREFIX + 'firstChild` or `__shady_firstChild`. This is done\n // so this polyfill can perform Shadow DOM style DOM manipulation.\n // Because patching normal platform property names is optional, these prefixed\n // names are used internally.\n addShadyPrefixedProperties();\n\n // Modifies native prototypes for Node, Element, etc. to patch\n // regular platform property names to have Shadow DOM compatible API behavior.\n // This applies the utils.SHADY_PREFIX behavior to normal names. For example,\n // if `noPatch` is not set, then `el.__shady_firstChild` is equivalent to\n // `el.firstChild`.\n // NOTE, on older browsers (old Chrome/Safari) native accessors cannot be\n // patched on prototypes (e.g. Node.prototype.firstChild cannot be modified).\n // On these browsers, instance level patching is performed where needed; this\n // instance patching is only done when `noPatch` is *not* set.\n if (!utils.settings.noPatch) {\n applyPatches();\n // Patch click event behavior only if we're patching\n patchClick();\n } else if (utils.settings.patchOnDemand) {\n // In `on-demand` patching, do patch `attachShadow` and `shadowRoot`.\n // These are the only patched properties in `on-demand` mode and these\n // patches kick off patching \"on-demand\" for other nodes.\n patchShadowOnElement();\n }\n\n // For simplicity, patch events unconditionally.\n // Patches the event system to have Shadow DOM compatible behavior (e.g.\n // event retargeting). When `noPatch` is set, retargeting is only available\n // when adding event listeners and dispatching events via `ShadyDOM.wrap`\n // (e.g. `ShadyDOM.wrap(element).addEventListener(...)`).\n patchEvents();\n\n window.ShadowRoot = /** @type {function(new:ShadowRoot)} */ (ShadyRoot);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array<StyleNode>} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\nexport {StyleNode};\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length;\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {!StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous']\n ? node['previous']['end']\n : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = (node['parsedSelector'] = node['selector'] = t.trim());\n node['atRule'] = s.indexOf(AT_START) === 0;\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] = node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function () {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nexport function stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties\n ? node['cssText']\n : removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array<StyleNode>} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return (\n Boolean(r) &&\n Boolean(r['selector']) &&\n r['selector'].indexOf(VAR_START) === 0\n );\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nexport function removeCustomPropAssignment(cssText) {\n return cssText.replace(RX.customProp, '').replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText.replace(RX.mixinApply, '').replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nexport const types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000,\n};\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g,\n};\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport const nativeShadow = !(\n window['ShadyDOM'] && window['ShadyDOM']['inUse']\n);\n/** @type {boolean} */\nlet nativeCssVariables_;\n\n/**\n * @param {(ShadyCSSOptions | ShadyCSSInterface)=} settings\n */\nfunction calcCssVariables(settings) {\n if (settings && settings.shimcssproperties) {\n nativeCssVariables_ = false;\n } else {\n // chrome 49 has semi-working css vars, check if box-shadow works\n // safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\n // However, shim css custom properties are only supported with ShadyDOM enabled,\n // so fall back on native if we do not detect ShadyDOM\n // Edge 15: custom properties used in ::before and ::after will also be used in the parent element\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12414257/\n nativeCssVariables_ =\n nativeShadow ||\n Boolean(\n !navigator.userAgent.match(/AppleWebKit\\/601|Edge\\/15/) &&\n window.CSS &&\n CSS.supports &&\n CSS.supports('box-shadow', '0 0 0 var(--foo)')\n );\n }\n}\n\n/** @type {string | undefined} */\nexport let cssBuild;\nif (window.ShadyCSS && window.ShadyCSS.cssBuild !== undefined) {\n cssBuild = window.ShadyCSS.cssBuild;\n}\n\n/** @type {boolean} */\nexport const disableRuntime = Boolean(\n window.ShadyCSS && window.ShadyCSS.disableRuntime\n);\n\nif (window.ShadyCSS && window.ShadyCSS.nativeCss !== undefined) {\n nativeCssVariables_ = window.ShadyCSS.nativeCss;\n} else if (window.ShadyCSS) {\n calcCssVariables(window.ShadyCSS);\n // reset window variable to let ShadyCSS API take its place\n window.ShadyCSS = undefined;\n} else {\n calcCssVariables(window['WebComponents'] && window['WebComponents']['flags']);\n}\n\n// Hack for type error under new type inference which doesn't like that\n// nativeCssVariables is updated in a function and assigns the type\n// `function(): ?` instead of `boolean`.\nexport const nativeCssVariables = /** @type {boolean} */ (nativeCssVariables_);\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\nexport const VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};{])+)|\\{([^}]*)\\}(?:(?=[;\\s}])|$))/gi;\nexport const MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nexport const VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nexport const ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nexport const MEDIA_MATCH = /@media\\s(.*)/;\nexport const IS_VAR = /^--/;\nexport const BRACKETED = /\\{[^}]*\\}/g;\nexport const HOST_PREFIX = '(?:^|[^.#[:])';\nexport const HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/** @type {!Set<string>} */\nconst styleTextSet = new Set();\n\nexport const scopingAttribute = 'shady-unscoped';\n\n/**\n * Add a specifically-marked style to the document directly, and only one copy of that style.\n *\n * @param {!HTMLStyleElement} style\n * @return {undefined}\n */\nexport function processUnscopedStyle(style) {\n const text = style.textContent;\n if (!styleTextSet.has(text)) {\n styleTextSet.add(text);\n const newStyle = document.createElement('style');\n newStyle.setAttribute('shady-unscoped', '');\n newStyle.textContent = text;\n document.head.appendChild(newStyle);\n }\n}\n\n/**\n * Check if a style is supposed to be unscoped\n * @param {!HTMLStyleElement} style\n * @return {boolean} true if the style has the unscoping attribute\n */\nexport function isUnscopedStyle(style) {\n return style.hasAttribute(scopingAttribute);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables, cssBuild} from './style-settings.js';\nimport {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\nimport {MEDIA_MATCH} from './common-regex.js';\n// prettier-ignore\nimport {processUnscopedStyle, isUnscopedStyle} from './unscoped-style-handler.js';\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n * @return {string}\n */\nexport function toCssText(rules, callback) {\n if (!rules) {\n return '';\n }\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nexport function rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'] || null;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nexport function isKeyframesSelector(rule) {\n return (\n Boolean(rule['parent']) && rule['parent']['type'] === types.KEYFRAMES_RULE\n );\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(\n node,\n styleRuleCallback,\n keyframesRuleCallback,\n onlyActiveRules\n) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback && type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i = 0, l = r$.length, r; i < l && (r = r$[i]); i++) {\n forEachRule(r, styleRuleCallback, keyframesRuleCallback, onlyActiveRules);\n }\n }\n}\n\n// add a string of cssText to the document.\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @param {Node} target\n * @param {Node} contextNode\n * @return {HTMLStyleElement}\n */\nexport function applyCss(cssText, moniker, target, contextNode) {\n let style = createScopeStyle(cssText, moniker);\n applyStyle(style, target, contextNode);\n return style;\n}\n\n/**\n * @param {string} cssText\n * @param {string} moniker\n * @return {!HTMLStyleElement}\n */\nexport function createScopeStyle(cssText, moniker) {\n let style = /** @type {HTMLStyleElement} */ (document.createElement('style'));\n if (moniker) {\n style.setAttribute('scope', moniker);\n }\n style.textContent = cssText;\n return style;\n}\n\n/**\n * Track the position of the last added style for placing placeholders\n * @type {Node}\n */\nlet lastHeadApplyNode = null;\n\n// insert a comment node as a styling position placeholder.\n/**\n * @param {string} moniker\n * @return {!Comment}\n */\nexport function applyStylePlaceHolder(moniker) {\n let placeHolder = document.createComment(\n ' Shady DOM styles for ' + moniker + ' '\n );\n let after = lastHeadApplyNode ? lastHeadApplyNode['nextSibling'] : null;\n let scope = document.head;\n scope.insertBefore(placeHolder, after || scope.firstChild);\n lastHeadApplyNode = placeHolder;\n return placeHolder;\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @param {?Node} target\n * @param {?Node} contextNode\n */\nexport function applyStyle(style, target, contextNode) {\n target = target || document.head;\n let after = (contextNode && contextNode.nextSibling) || target.firstChild;\n target.insertBefore(style, after);\n if (!lastHeadApplyNode) {\n lastHeadApplyNode = style;\n } else {\n // only update lastHeadApplyNode if the new style is inserted after the old lastHeadApplyNode\n let position = style.compareDocumentPosition(lastHeadApplyNode);\n if (position === Node.DOCUMENT_POSITION_PRECEDING) {\n lastHeadApplyNode = style;\n }\n }\n}\n\n/**\n * @param {string} buildType\n * @return {boolean}\n */\nexport function isTargetedBuild(buildType) {\n return nativeShadow ? buildType === 'shadow' : buildType === 'shady';\n}\n\n/**\n * Walk from text[start] matching parens and\n * returns position of the outer end paren\n * @param {string} text\n * @param {number} start\n * @return {number}\n */\nexport function findMatchingParen(text, start) {\n let level = 0;\n for (let i = start, l = text.length; i < l; i++) {\n if (text[i] === '(') {\n level++;\n } else if (text[i] === ')') {\n if (--level === 0) {\n return i;\n }\n }\n }\n return -1;\n}\n\n/**\n * @param {string} str\n * @param {function(string, string, string, string)} callback\n */\nexport function processVariableAndFallback(str, callback) {\n // find 'var('\n let start = str.indexOf('var(');\n if (start === -1) {\n // no var?, everything is prefix\n return callback(str, '', '', '');\n }\n //${prefix}var(${inner})${suffix}\n let end = findMatchingParen(str, start + 3);\n let inner = str.substring(start + 4, end);\n let prefix = str.substring(0, start);\n // suffix may have other variables\n let suffix = processVariableAndFallback(str.substring(end + 1), callback);\n let comma = inner.indexOf(',');\n // value and fallback args should be trimmed to match in property lookup\n if (comma === -1) {\n // variable, no fallback\n return callback(prefix, inner.trim(), '', suffix);\n }\n // var(${value},${fallback})\n let value = inner.substring(0, comma).trim();\n let fallback = inner.substring(comma + 1).trim();\n return callback(prefix, value, fallback, suffix);\n}\n\n/**\n * @param {Element} element\n * @param {string} value\n */\nexport function setElementClassRaw(element, value) {\n // use native setAttribute provided by ShadyDOM when setAttribute is patched\n if (nativeShadow) {\n element.setAttribute('class', value);\n } else {\n window['ShadyDOM']['nativeMethods']['setAttribute'].call(\n element,\n 'class',\n value\n );\n }\n}\n\n/**\n * @type {function(*):*}\n */\nexport const wrap =\n (window['ShadyDOM'] && window['ShadyDOM']['wrap']) || ((node) => node);\n\n/**\n * @param {Element | {is: string, extends: string}} element\n * @return {{is: string, typeExtension: string}}\n */\nexport function getIsExtends(element) {\n let localName = element['localName'];\n let is = '',\n typeExtension = '';\n /*\n NOTE: technically, this can be wrong for certain svg elements\n with `-` in the name like `<font-face>`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */ (element).is;\n typeExtension = /** @type {?} */ (element).extends;\n }\n return {is, typeExtension};\n}\n\n/**\n * @param {Element|DocumentFragment} element\n * @return {string}\n */\nexport function gatherStyleText(element) {\n /** @type {!Array<string>} */\n const styleTextParts = [];\n const styles = /** @type {!NodeList<!HTMLStyleElement>} */ (element.querySelectorAll(\n 'style'\n ));\n for (let i = 0; i < styles.length; i++) {\n const style = styles[i];\n if (isUnscopedStyle(style)) {\n if (!nativeShadow) {\n processUnscopedStyle(style);\n style.parentNode.removeChild(style);\n }\n } else {\n styleTextParts.push(style.textContent);\n style.parentNode.removeChild(style);\n }\n }\n return styleTextParts.join('').trim();\n}\n\n/**\n * Split a selector separated by commas into an array in a smart way\n * @param {string} selector\n * @return {!Array<string>}\n */\nexport function splitSelectorList(selector) {\n const parts = [];\n let part = '';\n for (let i = 0; i >= 0 && i < selector.length; i++) {\n // A selector with parentheses will be one complete part\n if (selector[i] === '(') {\n // find the matching paren\n const end = findMatchingParen(selector, i);\n // push the paren block into the part\n part += selector.slice(i, end + 1);\n // move the index to after the paren block\n i = end;\n } else if (selector[i] === ',') {\n parts.push(part);\n part = '';\n } else {\n part += selector[i];\n }\n }\n // catch any pieces after the last comma\n if (part) {\n parts.push(part);\n }\n return parts;\n}\n\nconst CSS_BUILD_ATTR = 'css-build';\n\n/**\n * Return the polymer-css-build \"build type\" applied to this element\n *\n * @param {!HTMLElement} element\n * @return {string} Can be \"\", \"shady\", or \"shadow\"\n */\nexport function getCssBuild(element) {\n if (cssBuild !== undefined) {\n return /** @type {string} */ (cssBuild);\n }\n if (element.__cssBuild === undefined) {\n // try attribute first, as it is the common case\n const attrValue = element.getAttribute(CSS_BUILD_ATTR);\n if (attrValue) {\n element.__cssBuild = attrValue;\n } else {\n const buildComment = getBuildComment(element);\n if (buildComment !== '') {\n // remove build comment so it is not needlessly copied into every element instance\n removeBuildComment(element);\n }\n element.__cssBuild = buildComment;\n }\n }\n return element.__cssBuild || '';\n}\n\n/**\n * Check if the given element, either a <template> or <style>, has been processed\n * by polymer-css-build.\n *\n * If so, then we can make a number of optimizations:\n * - polymer-css-build will decompose mixins into individual CSS Custom Properties,\n * so the ApplyShim can be skipped entirely.\n * - Under native ShadowDOM, the style text can just be copied into each instance\n * without modification\n * - If the build is \"shady\" and ShadyDOM is in use, the styling does not need\n * scoping beyond the shimming of CSS Custom Properties\n *\n * @param {!HTMLElement} element\n * @return {boolean}\n */\nexport function elementHasBuiltCss(element) {\n return getCssBuild(element) !== '';\n}\n\n/**\n * For templates made with tagged template literals, polymer-css-build will\n * insert a comment of the form `<!--css-build:shadow-->`\n *\n * @param {!HTMLElement} element\n * @return {string}\n */\nexport function getBuildComment(element) {\n const buildComment =\n element.localName === 'template'\n ? /** @type {!HTMLTemplateElement} */ (element).content.firstChild\n : element.firstChild;\n if (buildComment instanceof Comment) {\n const commentParts = buildComment.textContent.trim().split(':');\n if (commentParts[0] === CSS_BUILD_ATTR) {\n return commentParts[1];\n }\n }\n return '';\n}\n\n/**\n * Check if the css build status is optimal, and do no unneeded work.\n *\n * @param {string=} cssBuild CSS build status\n * @return {boolean} css build is optimal or not\n */\nexport function isOptimalCssBuild(cssBuild = '') {\n // CSS custom property shim always requires work\n if (cssBuild === '' || !nativeCssVariables) {\n return false;\n }\n return nativeShadow ? cssBuild === 'shadow' : cssBuild === 'shady';\n}\n\n/**\n * @param {!HTMLElement} element\n */\nfunction removeBuildComment(element) {\n const buildComment =\n element.localName === 'template'\n ? /** @type {!HTMLTemplateElement} */ (element).content.firstChild\n : element.firstChild;\n buildComment.parentNode.removeChild(buildComment);\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\nimport * as StyleUtil from './style-util.js';\nimport {nativeShadow} from './style-settings.js';\n\n/* Transforms ShadowDOM styling into ShadyDOM styling\n\n* scoping:\n\n * elements in scope get scoping selector class=\"x-foo-scope\"\n * selectors re-written as follows:\n\n div button -> div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n /** @return {string} */\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n /**\n * Given a node and scope name, add a scoping class to each node\n * in the tree. This facilitates transforming css into scoped rules.\n * @param {!Node} node\n * @param {string} scope\n * @param {boolean=} shouldRemoveScope\n * @deprecated\n */\n dom(node, scope, shouldRemoveScope) {\n const fn = (node) => {\n this.element(node, scope || '', shouldRemoveScope);\n };\n this._transformDom(node, fn);\n }\n\n /**\n * Given a node and scope name, add a scoping class to each node in the tree.\n * @param {!Node} node\n * @param {string} scope\n */\n domAddScope(node, scope) {\n const fn = (node) => {\n this.element(node, scope || '');\n };\n this._transformDom(node, fn);\n }\n\n /**\n * @param {!Node} startNode\n * @param {function(!Node)} transformer\n */\n _transformDom(startNode, transformer) {\n if (startNode.nodeType === Node.ELEMENT_NODE) {\n transformer(startNode);\n }\n let c$;\n if (startNode.localName === 'template') {\n const template = /** @type {!HTMLTemplateElement} */ (startNode);\n // In case the template is in svg context, fall back to the node\n // since it won't be an HTMLTemplateElement with a .content property\n c$ = (template.content || template._content || template).childNodes;\n } else {\n c$ =\n /** @type {!ParentNode} */ (startNode).children || startNode.childNodes;\n }\n if (c$) {\n for (let i = 0; i < c$.length; i++) {\n this._transformDom(c$[i], transformer);\n }\n }\n }\n\n /**\n * @param {?} element\n * @param {?} scope\n * @param {?=} shouldRemoveScope\n */\n element(element, scope, shouldRemoveScope) {\n // note: if using classes, we add both the general 'style-scope' class\n // as well as the specific scope. This enables easy filtering of all\n // `style-scope` elements\n if (scope) {\n // note: svg on IE does not have classList so fallback to class\n if (element.classList) {\n if (shouldRemoveScope) {\n element.classList.remove(SCOPE_NAME);\n element.classList.remove(scope);\n } else {\n element.classList.add(SCOPE_NAME);\n element.classList.add(scope);\n }\n } else if (element.getAttribute) {\n let c = element.getAttribute(CLASS);\n if (shouldRemoveScope) {\n if (c) {\n let newValue = c.replace(SCOPE_NAME, '').replace(scope, '');\n StyleUtil.setElementClassRaw(element, newValue);\n }\n } else {\n let newValue = (c ? c + ' ' : '') + SCOPE_NAME + ' ' + scope;\n StyleUtil.setElementClassRaw(element, newValue);\n }\n }\n }\n }\n\n /**\n * Given a node, replace the scoping class to each subnode in the tree.\n * @param {!Node} node\n * @param {string} oldScope\n * @param {string} newScope\n */\n domReplaceScope(node, oldScope, newScope) {\n const fn = (node) => {\n this.element(node, oldScope, true);\n this.element(node, newScope);\n };\n this._transformDom(node, fn);\n }\n /**\n * Given a node, remove the scoping class to each subnode in the tree.\n * @param {!Node} node\n * @param {string} oldScope\n */\n domRemoveScope(node, oldScope) {\n const fn = (node) => {\n this.element(node, oldScope || '', true);\n };\n this._transformDom(node, fn);\n }\n\n /**\n * @param {?} element\n * @param {?} styleRules\n * @param {?=} callback\n * @param {string=} cssBuild\n * @param {string=} cssText\n * @return {string}\n */\n elementStyles(element, styleRules, callback, cssBuild = '', cssText = '') {\n // no need to shim selectors if settings.useNativeShadow, also\n // a shady css build will already have transformed selectors\n // NOTE: This method may be called as part of static or property shimming.\n // When there is a targeted build it will not be called for static shimming,\n // but when the property shim is used it is called and should opt out of\n // static shimming work when a proper build exists.\n if (cssText === '') {\n if (nativeShadow || cssBuild === 'shady') {\n cssText = StyleUtil.toCssText(styleRules, callback);\n } else {\n let {is, typeExtension} = StyleUtil.getIsExtends(element);\n cssText = this.css(styleRules, is, typeExtension, callback) + '\\n\\n';\n }\n }\n return cssText.trim();\n }\n\n // Given a string of cssText and a scoping string (scope), returns\n // a string of scoped css where each selector is transformed to include\n // a class created from the scope. ShadowDOM selectors are also transformed\n // (e.g. :host) to use the scoping selector.\n css(rules, scope, ext, callback) {\n let hostScope = this._calcHostScope(scope, ext);\n scope = this._calcElementScope(scope);\n let self = this;\n return StyleUtil.toCssText(rules, function (/** StyleNode */ rule) {\n if (!(/** @type {?} */ (rule.isScoped))) {\n self.rule(rule, scope, hostScope);\n rule.isScoped = true;\n }\n if (callback) {\n callback(rule, scope, hostScope);\n }\n });\n }\n\n _calcElementScope(scope) {\n if (scope) {\n return CSS_CLASS_PREFIX + scope;\n } else {\n return '';\n }\n }\n\n _calcHostScope(scope, ext) {\n return ext ? `[is=${scope}]` : scope;\n }\n\n rule(rule, scope, hostScope) {\n this._transformRule(rule, this._transformComplexSelector, scope, hostScope);\n }\n\n /**\n * transforms a css rule to a scoped rule.\n *\n * @param {StyleNode} rule\n * @param {Function} transformer\n * @param {string=} scope\n * @param {string=} hostScope\n */\n _transformRule(rule, transformer, scope, hostScope) {\n // NOTE: save transformedSelector for subsequent matching of elements\n // against selectors (e.g. when calculating style properties)\n rule[\n 'selector'\n ] = /** @type {?} */ (rule).transformedSelector = this._transformRuleCss(\n rule,\n transformer,\n scope,\n hostScope\n );\n }\n\n /**\n * @param {StyleNode} rule\n * @param {Function} transformer\n * @param {string=} scope\n * @param {string=} hostScope\n */\n _transformRuleCss(rule, transformer, scope, hostScope) {\n let p$ = StyleUtil.splitSelectorList(rule['selector']);\n // we want to skip transformation of rules that appear in keyframes,\n // because they are keyframe selectors, not element selectors.\n if (!StyleUtil.isKeyframesSelector(rule)) {\n for (let i = 0, l = p$.length, p; i < l && (p = p$[i]); i++) {\n p$[i] = transformer.call(this, p, scope, hostScope);\n }\n }\n return p$.filter((part) => Boolean(part)).join(COMPLEX_SELECTOR_SEP);\n }\n\n /**\n * @param {string} selector\n * @return {string}\n */\n _twiddleNthPlus(selector) {\n return selector.replace(NTH, (m, type, inside) => {\n if (inside.indexOf('+') > -1) {\n inside = inside.replace(/\\+/g, '___');\n } else if (inside.indexOf('___') > -1) {\n inside = inside.replace(/___/g, '+');\n }\n return `:${type}(${inside})`;\n });\n }\n\n /**\n * Preserve `:matches()` selectors by replacing them with MATCHES_REPLACMENT\n * and returning an array of `:matches()` selectors.\n * Use `_replacesMatchesPseudo` to replace the `:matches()` parts\n *\n * @param {string} selector\n * @return {{selector: string, matches: !Array<string>}}\n */\n _preserveMatchesPseudo(selector) {\n /** @type {!Array<string>} */\n const matches = [];\n let match;\n while ((match = selector.match(MATCHES))) {\n const start = match.index;\n const end = StyleUtil.findMatchingParen(selector, start);\n if (end === -1) {\n throw new Error(`${match.input} selector missing ')'`);\n }\n const part = selector.slice(start, end + 1);\n selector = selector.replace(part, MATCHES_REPLACEMENT);\n matches.push(part);\n }\n return {selector, matches};\n }\n\n /**\n * Replace MATCHES_REPLACMENT character with the given set of `:matches()`\n * selectors.\n *\n * @param {string} selector\n * @param {!Array<string>} matches\n * @return {string}\n */\n _replaceMatchesPseudo(selector, matches) {\n const parts = selector.split(MATCHES_REPLACEMENT);\n return matches.reduce(\n (acc, cur, idx) => acc + cur + parts[idx + 1],\n parts[0]\n );\n }\n\n /**\n * @param {string} selector\n * @param {string} scope\n * @param {string=} hostScope\n */\n _transformComplexSelector(selector, scope, hostScope) {\n let stop = false;\n selector = selector.trim();\n // Remove spaces inside of selectors like `:nth-of-type` because it confuses SIMPLE_SELECTOR_SEP\n let isNth = NTH.test(selector);\n if (isNth) {\n selector = selector.replace(\n NTH,\n (m, type, inner) => `:${type}(${inner.replace(/\\s/g, '')})`\n );\n selector = this._twiddleNthPlus(selector);\n }\n // Preserve selectors like `:-webkit-any` so that SIMPLE_SELECTOR_SEP does\n // not get confused by spaces inside the pseudo selector\n const isMatches = MATCHES.test(selector);\n /** @type {!Array<string>} */\n let matches;\n if (isMatches) {\n ({selector, matches} = this._preserveMatchesPseudo(selector));\n }\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n // replace `:matches()` selectors\n if (isMatches) {\n selector = this._replaceMatchesPseudo(selector, matches);\n }\n if (isNth) {\n selector = this._twiddleNthPlus(selector);\n }\n selector = selector.replace(\n DIR_PAREN,\n (m, before, dir, after) =>\n `[dir=\"${dir}\"] ${before}${after}, ${before}[dir=\"${dir}\"]${after}`\n );\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope\n ? this._transformSimpleSelector(selector, scope)\n : selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n const attributes = selector.split(/(\\[.+?\\])/);\n\n const output = [];\n for (let i = 0; i < attributes.length; i++) {\n // Do not attempt to transform any attribute selector content\n if (i % 2 === 1) {\n output.push(attributes[i]);\n } else {\n const part = attributes[i];\n\n if (!(part === '' && i === attributes.length - 1)) {\n let p$ = part.split(PSEUDO_PREFIX);\n p$[0] += scope;\n output.push(p$.join(PSEUDO_PREFIX));\n }\n }\n }\n\n return output.join('');\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = (m && m[2].trim()) || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n }\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function (m, host, paren) {\n return hostScope + paren;\n });\n }\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n /**\n * @param {StyleNode} rule\n */\n documentRule(rule) {\n // reset selector in case this is redone.\n rule['selector'] = rule['parsedSelector'];\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n /**\n * @param {StyleNode} rule\n */\n normalizeRootSelector(rule) {\n if (rule['selector'] === ROOT) {\n rule['selector'] = 'html';\n }\n }\n\n /**\n * @param {string} selector\n */\n _transformDocumentSelector(selector) {\n if (selector.match(HOST)) {\n // remove ':host' type selectors in document rules\n return '';\n } else if (selector.match(SLOTTED)) {\n return this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR);\n } else {\n return this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n }\n}\n\nconst NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nconst SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nconst COMPLEX_SELECTOR_SEP = ',';\nconst SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=[])+)/g;\nconst SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nconst HOST = ':host';\nconst ROOT = ':root';\nconst SLOTTED = '::slotted';\nconst SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nconst HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nconst SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nconst DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)(.*)/;\nconst CSS_CLASS_PREFIX = '.';\nconst PSEUDO_PREFIX = ':';\nconst CLASS = 'class';\nconst SELECTOR_NO_MATCH = 'should_not_match';\nconst MATCHES = /:(?:matches|any|-(?:webkit|moz)-any)/;\nconst MATCHES_REPLACEMENT = '\\u{e000}';\n\nexport default new StyleTransformer();\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {parse, StyleNode} from './css-parse.js';\n// prettier-ignore\nimport {nativeShadow, nativeCssVariables, disableRuntime} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport StyleProperties from './style-properties.js';\n// prettier-ignore\nimport {ensureStylePlaceholder, getStylePlaceholder} from './style-placeholder.js';\nimport StyleInfo from './style-info.js';\nimport StyleCache from './style-cache.js';\n// prettier-ignore\nimport {flush as watcherFlush, getOwnerScope, getCurrentScope} from './document-watcher.js';\nimport templateMap from './template-map.js';\nimport * as ApplyShimUtils from './apply-shim-utils.js';\nimport {updateNativeProperties, detectMixin} from './common-utils.js';\n// prettier-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport {CustomStyleInterfaceInterface, CustomStyleProvider} from './custom-style-interface.js';\n\n/** @type {!Object<string, string>} */\nconst adoptedCssTextMap = {};\n\n/**\n * @const {StyleCache}\n */\nconst styleCache = new StyleCache();\n\nexport default class ScopingShim {\n constructor() {\n this._scopeCounter = {};\n this._documentOwner = /** @type {!HTMLElement} */ (document.documentElement);\n let ast = new StyleNode();\n ast['rules'] = [];\n this._documentOwnerStyleInfo = StyleInfo.set(\n this._documentOwner,\n new StyleInfo(ast)\n );\n this._elementsHaveApplied = false;\n /** @type {?Object} */\n this._applyShim = null;\n /** @type {?CustomStyleInterfaceInterface} */\n this._customStyleInterface = null;\n }\n flush() {\n watcherFlush();\n }\n _generateScopeSelector(name) {\n let id = (this._scopeCounter[name] = (this._scopeCounter[name] || 0) + 1);\n return `${name}-${id}`;\n }\n getStyleAst(style) {\n return StyleUtil.rulesForStyle(style);\n }\n styleAstToString(ast) {\n return StyleUtil.toCssText(ast);\n }\n _gatherStyles(template) {\n return StyleUtil.gatherStyleText(template.content);\n }\n /**\n * Prepare the styling and template for the given element type\n *\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} typeExtension\n */\n prepareTemplate(template, elementName, typeExtension) {\n this.prepareTemplateDom(template, elementName);\n this.prepareTemplateStyles(template, elementName, typeExtension);\n }\n /**\n * Prepare styling for the given element type\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} typeExtension\n */\n prepareTemplateStyles(template, elementName, typeExtension) {\n if (template._prepared || disableRuntime) {\n return;\n }\n // style placeholders are only used when ShadyDOM is active\n if (!nativeShadow) {\n ensureStylePlaceholder(elementName);\n }\n template._prepared = true;\n template.name = elementName;\n template.extends = typeExtension;\n templateMap[elementName] = template;\n let cssBuild = StyleUtil.getCssBuild(template);\n const optimalBuild = StyleUtil.isOptimalCssBuild(cssBuild);\n let info = {\n is: elementName,\n extends: typeExtension,\n };\n let cssText =\n this._gatherStyles(template) + (adoptedCssTextMap[elementName] || '');\n // check if the styling has mixin definitions or uses\n this._ensure();\n if (!optimalBuild) {\n let hasMixins = !cssBuild && detectMixin(cssText);\n let ast = parse(cssText);\n // only run the applyshim transforms if there is a mixin involved\n if (hasMixins && nativeCssVariables && this._applyShim) {\n this._applyShim['transformRules'](ast, elementName);\n }\n template['_styleAst'] = ast;\n }\n let ownPropertyNames = [];\n if (!nativeCssVariables) {\n ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst']);\n }\n if (!ownPropertyNames.length || nativeCssVariables) {\n let root = nativeShadow ? template.content : null;\n let placeholder = getStylePlaceholder(elementName);\n let style = this._generateStaticStyle(\n info,\n template['_styleAst'],\n root,\n placeholder,\n cssBuild,\n optimalBuild ? cssText : ''\n );\n template._style = style;\n }\n template._ownPropertyNames = ownPropertyNames;\n }\n\n /**\n * @param {!Array<string>} cssTextArray\n * @param {string} elementName\n */\n prepareAdoptedCssText(cssTextArray, elementName) {\n adoptedCssTextMap[elementName] = cssTextArray.join(' ');\n }\n /**\n * Prepare template for the given element type\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplateDom(template, elementName) {\n if (disableRuntime) {\n return;\n }\n const cssBuild = StyleUtil.getCssBuild(template);\n if (!nativeShadow && cssBuild !== 'shady' && !template._domPrepared) {\n template._domPrepared = true;\n StyleTransformer.domAddScope(template.content, elementName);\n }\n }\n /**\n * @param {!{is: string, extends: (string|undefined)}} info\n * @param {!StyleNode} rules\n * @param {DocumentFragment} shadowroot\n * @param {Node} placeholder\n * @param {string} cssBuild\n * @param {string=} cssText\n * @return {?HTMLStyleElement}\n */\n _generateStaticStyle(\n info,\n rules,\n shadowroot,\n placeholder,\n cssBuild,\n cssText\n ) {\n cssText = StyleTransformer.elementStyles(\n info,\n rules,\n null,\n cssBuild,\n cssText\n );\n if (cssText.length) {\n return StyleUtil.applyCss(cssText, info.is, shadowroot, placeholder);\n }\n return null;\n }\n _prepareHost(host) {\n const {is, typeExtension} = StyleUtil.getIsExtends(host);\n const placeholder = getStylePlaceholder(is);\n const template = templateMap[is];\n if (!template) {\n return;\n }\n const ast = template['_styleAst'];\n const ownStylePropertyNames = template._ownPropertyNames;\n const cssBuild = StyleUtil.getCssBuild(template);\n const styleInfo = new StyleInfo(\n ast,\n placeholder,\n ownStylePropertyNames,\n is,\n typeExtension,\n cssBuild\n );\n StyleInfo.set(host, styleInfo);\n return styleInfo;\n }\n /**\n * Returns a boolean that indicates if styles need to be reprocessed because\n * the apply shim is now available.\n * @return {boolean}\n */\n _ensureApplyShim() {\n if (!this._applyShim && window.ShadyCSS && window.ShadyCSS.ApplyShim) {\n this._applyShim = /** @type {!Object} */ (window.ShadyCSS.ApplyShim);\n this._applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n return true;\n }\n return false;\n }\n _ensureCustomStyleInterface() {\n if (this._customStyleInterface) {\n return;\n } else if (window.ShadyCSS && window.ShadyCSS.CustomStyleInterface) {\n this._customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */ (window\n .ShadyCSS.CustomStyleInterface);\n /** @type {function(!HTMLStyleElement)} */\n this._customStyleInterface['transformCallback'] = (style) => {\n this.transformCustomStyleForDocument(style);\n };\n this._customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (\n this._customStyleInterface['enqueued'] ||\n this._elementsHaveApplied\n ) {\n this.flushCustomStyles();\n }\n });\n };\n }\n }\n /**\n * Returns a boolean that indicates if styles need to be reprocessed because\n * the apply shim is now available.\n * @return {boolean}\n */\n _ensure() {\n const needsApplyShimUpdate = this._ensureApplyShim();\n this._ensureCustomStyleInterface();\n return needsApplyShimUpdate;\n }\n /**\n * Flush and apply custom styles to document\n */\n flushCustomStyles() {\n if (disableRuntime) {\n return;\n }\n const needsApplyShimUpdate = this._ensure();\n if (!this._customStyleInterface) {\n return;\n }\n let customStyles = this._customStyleInterface['processStyles']();\n // early return if custom-styles don't need validation\n if (!needsApplyShimUpdate && !this._customStyleInterface['enqueued']) {\n return;\n }\n // bail if custom styles are built optimally\n if (StyleUtil.isOptimalCssBuild(this._documentOwnerStyleInfo.cssBuild)) {\n return;\n }\n if (!nativeCssVariables) {\n this._reorderCustomStylesRules(customStyles);\n this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n this._applyCustomStyles(customStyles);\n if (this._elementsHaveApplied) {\n // if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree\n this.styleDocument();\n }\n } else if (!this._documentOwnerStyleInfo.cssBuild) {\n this._revalidateCustomStyleApplyShim(customStyles);\n }\n this._customStyleInterface['enqueued'] = false;\n }\n /**\n * Reorder of custom styles for Custom Property shim\n * @param {!Array<!CustomStyleProvider>} customStyles\n */\n _reorderCustomStylesRules(customStyles) {\n const styles = customStyles\n .map((c) => this._customStyleInterface['getStyleForCustomStyle'](c))\n .filter((s) => !!s);\n // sort styles in document order\n styles.sort((a, b) => {\n // use `b.compare(a)` to be more straightforward\n const position = b.compareDocumentPosition(a);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING) {\n // A is after B, A should be higher sorted\n return 1;\n } else if (position & Node.DOCUMENT_POSITION_PRECEDING) {\n // A is before B, A should be lower sorted\n return -1;\n } else {\n return 0;\n }\n });\n // sort ast ordering for document\n this._documentOwnerStyleInfo.styleRules['rules'] = styles.map((s) =>\n StyleUtil.rulesForStyle(s)\n );\n }\n /**\n * Apply styles for the given element\n *\n * @param {!HTMLElement} host\n * @param {Object=} overrideProps\n */\n styleElement(host, overrideProps) {\n if (disableRuntime) {\n if (overrideProps) {\n if (!StyleInfo.get(host)) {\n StyleInfo.set(host, new StyleInfo(null));\n }\n const styleInfo = /** @type {!StyleInfo} */ (StyleInfo.get(host));\n this._mixOverrideStyleProps(styleInfo, overrideProps);\n this.styleElementNativeVariables(host, styleInfo);\n }\n return;\n }\n const styleInfo = StyleInfo.get(host) || this._prepareHost(host);\n // if there is no style info at this point, bail\n if (!styleInfo) {\n return;\n }\n // Only trip the `elementsHaveApplied` flag if a node other that the root document has `applyStyle` called\n if (!this._isRootOwner(host)) {\n this._elementsHaveApplied = true;\n }\n if (overrideProps) {\n this._mixOverrideStyleProps(styleInfo, overrideProps);\n }\n if (!nativeCssVariables) {\n this.styleElementShimVariables(host, styleInfo);\n } else {\n this.styleElementNativeVariables(host, styleInfo);\n }\n }\n /**\n * @param {!StyleInfo} styleInfo\n * @param {Object} overrideProps\n */\n _mixOverrideStyleProps(styleInfo, overrideProps) {\n styleInfo.overrideStyleProperties = styleInfo.overrideStyleProperties || {};\n Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n }\n /**\n * @param {!HTMLElement} host\n * @param {!StyleInfo} styleInfo\n */\n styleElementShimVariables(host, styleInfo) {\n this.flush();\n this._updateProperties(host, styleInfo);\n if (\n styleInfo.ownStylePropertyNames &&\n styleInfo.ownStylePropertyNames.length\n ) {\n this._applyStyleProperties(host, styleInfo);\n }\n }\n /**\n * @param {!HTMLElement} host\n * @param {!StyleInfo} styleInfo\n */\n styleElementNativeVariables(host, styleInfo) {\n const {is} = StyleUtil.getIsExtends(host);\n if (styleInfo.overrideStyleProperties) {\n updateNativeProperties(host, styleInfo.overrideStyleProperties);\n }\n const template = templateMap[is];\n // bail early if there is no shadowroot for this element\n if (!template && !this._isRootOwner(host)) {\n return;\n }\n // bail early if the template was built with polymer-css-build\n if (template && StyleUtil.elementHasBuiltCss(template)) {\n return;\n }\n if (\n template &&\n template._style &&\n !ApplyShimUtils.templateIsValid(template)\n ) {\n // update template\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this._ensure();\n this._applyShim &&\n this._applyShim['transformRules'](template['_styleAst'], is);\n template._style.textContent = StyleTransformer.elementStyles(\n host,\n styleInfo.styleRules\n );\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update instance if native shadowdom\n if (nativeShadow) {\n let root = host.shadowRoot;\n if (root) {\n let style = root.querySelector('style');\n if (style) {\n style.textContent = StyleTransformer.elementStyles(\n host,\n styleInfo.styleRules\n );\n }\n }\n }\n styleInfo.styleRules = template['_styleAst'];\n }\n }\n _styleOwnerForNode(node) {\n let root = StyleUtil.wrap(node).getRootNode();\n let host = root.host;\n if (host) {\n if (StyleInfo.get(host) || this._prepareHost(host)) {\n return host;\n } else {\n return this._styleOwnerForNode(host);\n }\n }\n return this._documentOwner;\n }\n _isRootOwner(node) {\n return node === this._documentOwner;\n }\n _applyStyleProperties(host, styleInfo) {\n let is = StyleUtil.getIsExtends(host).is;\n let cacheEntry = styleCache.fetch(\n is,\n styleInfo.styleProperties,\n styleInfo.ownStylePropertyNames\n );\n let cachedScopeSelector = cacheEntry && cacheEntry.scopeSelector;\n let cachedStyle = cacheEntry ? cacheEntry.styleElement : null;\n let oldScopeSelector = styleInfo.scopeSelector;\n // only generate new scope if cached style is not found\n styleInfo.scopeSelector =\n cachedScopeSelector || this._generateScopeSelector(is);\n let style = StyleProperties.applyElementStyle(\n host,\n styleInfo.styleProperties,\n styleInfo.scopeSelector,\n cachedStyle\n );\n if (!nativeShadow) {\n StyleProperties.applyElementScopeSelector(\n host,\n styleInfo.scopeSelector,\n oldScopeSelector\n );\n }\n if (!cacheEntry) {\n styleCache.store(\n is,\n styleInfo.styleProperties,\n style,\n styleInfo.scopeSelector\n );\n }\n return style;\n }\n _updateProperties(host, styleInfo) {\n let owner = this._styleOwnerForNode(host);\n let ownerStyleInfo = StyleInfo.get(owner);\n let ownerProperties = ownerStyleInfo.styleProperties;\n // style owner has not updated properties yet\n // go up the chain and force property update,\n // except if the owner is the document\n if (owner !== this._documentOwner && !ownerProperties) {\n this._updateProperties(owner, ownerStyleInfo);\n ownerProperties = ownerStyleInfo.styleProperties;\n }\n let props = Object.create(ownerProperties || null);\n let hostAndRootProps = StyleProperties.hostAndRootPropertiesForScope(\n host,\n styleInfo.styleRules,\n styleInfo.cssBuild\n );\n let propertyData = StyleProperties.propertyDataFromStyles(\n ownerStyleInfo.styleRules,\n host\n );\n let propertiesMatchingHost = propertyData.properties;\n Object.assign(\n props,\n hostAndRootProps.hostProps,\n propertiesMatchingHost,\n hostAndRootProps.rootProps\n );\n this._mixinOverrideStyles(props, styleInfo.overrideStyleProperties);\n StyleProperties.reify(props);\n styleInfo.styleProperties = props;\n }\n _mixinOverrideStyles(props, overrides) {\n for (let p in overrides) {\n let v = overrides[p];\n // skip override props if they are not truthy or 0\n // in order to fall back to inherited values\n if (v || v === 0) {\n props[p] = v;\n }\n }\n }\n /**\n * Update styles of the whole document\n *\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.styleSubtree(this._documentOwner, properties);\n }\n /**\n * Update styles of a subtree\n *\n * @param {!HTMLElement} host\n * @param {Object=} properties\n */\n styleSubtree(host, properties) {\n const wrappedHost = StyleUtil.wrap(host);\n const root = wrappedHost.shadowRoot;\n const isRootOwner = this._isRootOwner(host);\n if (root || isRootOwner) {\n this.styleElement(host, properties);\n }\n const descendantRoot = isRootOwner ? wrappedHost : root;\n if (descendantRoot) {\n const descendantHosts = Array.from(\n descendantRoot.querySelectorAll('*')\n ).filter((x) => StyleUtil.wrap(x).shadowRoot);\n for (let i = 0; i < descendantHosts.length; i++) {\n this.styleSubtree(descendantHosts[i]);\n }\n }\n }\n /* Custom Style operations */\n _revalidateCustomStyleApplyShim(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n this._revalidateApplyShim(s);\n }\n }\n }\n _applyCustomStyles(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n StyleProperties.applyCustomStyle(\n s,\n this._documentOwnerStyleInfo.styleProperties\n );\n }\n }\n }\n transformCustomStyleForDocument(style) {\n const cssBuild = StyleUtil.getCssBuild(style);\n if (cssBuild !== this._documentOwnerStyleInfo.cssBuild) {\n this._documentOwnerStyleInfo.cssBuild = cssBuild;\n }\n if (StyleUtil.isOptimalCssBuild(cssBuild)) {\n return;\n }\n let ast = StyleUtil.rulesForStyle(style);\n StyleUtil.forEachRule(ast, (rule) => {\n if (nativeShadow) {\n StyleTransformer.normalizeRootSelector(rule);\n } else {\n StyleTransformer.documentRule(rule);\n }\n if (nativeCssVariables && cssBuild === '') {\n this._ensure();\n this._applyShim && this._applyShim['transformRule'](rule);\n }\n });\n if (nativeCssVariables) {\n style.textContent = StyleUtil.toCssText(ast);\n } else {\n this._documentOwnerStyleInfo.styleRules['rules'].push(ast);\n }\n }\n _revalidateApplyShim(style) {\n if (nativeCssVariables && this._applyShim) {\n let ast = StyleUtil.rulesForStyle(style);\n this._ensure();\n this._applyShim['transformRules'](ast);\n style.textContent = StyleUtil.toCssText(ast);\n }\n }\n getComputedStyleValue(element, property) {\n let value;\n if (!nativeCssVariables) {\n // element is either a style host, or an ancestor of a style host\n let styleInfo =\n StyleInfo.get(element) ||\n StyleInfo.get(this._styleOwnerForNode(element));\n value = styleInfo.styleProperties[property];\n }\n // fall back to the property value from the computed styling\n value =\n value || window.getComputedStyle(element).getPropertyValue(property);\n // trim whitespace that can come after the `:` in css\n // example: padding: 2px -> \" 2px\"\n return value ? value.trim() : '';\n }\n // given an element and a classString, replaces\n // the element's class with the provided classString and adds\n // any necessary ShadyCSS static and property based scoping selectors\n setElementClass(element, classString) {\n let root = StyleUtil.wrap(element).getRootNode();\n let classes;\n if (classString) {\n let definitelyString =\n typeof classString === 'string' ? classString : String(classString);\n classes = definitelyString.split(/\\s/);\n } else {\n classes = [];\n }\n let scopeName = root.host && root.host.localName;\n // If no scope, try to discover scope name from existing class.\n // This can occur if, for example, a template stamped element that\n // has been scoped is manipulated when not in a root.\n if (!scopeName) {\n var classAttr = element.getAttribute('class');\n if (classAttr) {\n let k$ = classAttr.split(/\\s/);\n for (let i = 0; i < k$.length; i++) {\n if (k$[i] === StyleTransformer.SCOPE_NAME) {\n scopeName = k$[i + 1];\n break;\n }\n }\n }\n }\n if (scopeName) {\n classes.push(StyleTransformer.SCOPE_NAME, scopeName);\n }\n if (!nativeCssVariables) {\n let styleInfo = StyleInfo.get(element);\n if (styleInfo && styleInfo.scopeSelector) {\n classes.push(StyleProperties.XSCOPE_NAME, styleInfo.scopeSelector);\n }\n }\n StyleUtil.setElementClassRaw(element, classes.join(' '));\n }\n _styleInfoForNode(node) {\n return StyleInfo.get(node);\n }\n /**\n * @param {!Element} node\n * @param {string} scope\n */\n scopeNode(node, scope) {\n StyleTransformer.element(node, scope);\n }\n /**\n * @param {!Element} node\n * @param {string} scope\n */\n unscopeNode(node, scope) {\n StyleTransformer.element(node, scope, true);\n }\n /**\n * @param {!Node} node\n * @return {string}\n */\n scopeForNode(node) {\n return getOwnerScope(node);\n }\n /**\n * @param {!Element} node\n * @return {string}\n */\n currentScopeForNode(node) {\n return getCurrentScope(node);\n }\n}\n\n/* exports */\n/* eslint-disable no-self-assign */\nScopingShim.prototype['flush'] = ScopingShim.prototype.flush;\nScopingShim.prototype['prepareTemplate'] =\n ScopingShim.prototype.prepareTemplate;\nScopingShim.prototype['styleElement'] = ScopingShim.prototype.styleElement;\nScopingShim.prototype['styleDocument'] = ScopingShim.prototype.styleDocument;\nScopingShim.prototype['styleSubtree'] = ScopingShim.prototype.styleSubtree;\nScopingShim.prototype['getComputedStyleValue'] =\n ScopingShim.prototype.getComputedStyleValue;\nScopingShim.prototype['setElementClass'] =\n ScopingShim.prototype.setElementClass;\nScopingShim.prototype['_styleInfoForNode'] =\n ScopingShim.prototype._styleInfoForNode;\nScopingShim.prototype['transformCustomStyleForDocument'] =\n ScopingShim.prototype.transformCustomStyleForDocument;\nScopingShim.prototype['getStyleAst'] = ScopingShim.prototype.getStyleAst;\nScopingShim.prototype['styleAstToString'] =\n ScopingShim.prototype.styleAstToString;\nScopingShim.prototype['flushCustomStyles'] =\n ScopingShim.prototype.flushCustomStyles;\nScopingShim.prototype['scopeNode'] = ScopingShim.prototype.scopeNode;\nScopingShim.prototype['unscopeNode'] = ScopingShim.prototype.unscopeNode;\nScopingShim.prototype['scopeForNode'] = ScopingShim.prototype.scopeForNode;\nScopingShim.prototype['currentScopeForNode'] =\n ScopingShim.prototype.currentScopeForNode;\nScopingShim.prototype['prepareAdoptedCssText'] =\n ScopingShim.prototype.prepareAdoptedCssText;\n/* eslint-enable no-self-assign */\nObject.defineProperties(ScopingShim.prototype, {\n 'nativeShadow': {\n get() {\n return nativeShadow;\n },\n },\n 'nativeCss': {\n get() {\n return nativeCssVariables;\n },\n },\n});\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport {getIsExtends, elementHasBuiltCss, wrap} from './style-util.js';\n\nexport let flush = function () {};\n\n/**\n * @param {!Element} element\n * @return {string}\n */\nfunction getClasses(element) {\n if (element.classList && element.classList.value) {\n return element.classList.value;\n } else {\n // NOTE: className is patched to remove scoping classes in ShadyDOM\n // use getAttribute('class') instead, which is unpatched\n return element.getAttribute('class') || '';\n }\n}\n\nconst scopeRegExp = new RegExp(`${StyleTransformer.SCOPE_NAME}\\\\s*([^\\\\s]*)`);\n\n/**\n * @param {!Element} element\n * @return {string}\n */\nexport function getCurrentScope(element) {\n const match = getClasses(element).match(scopeRegExp);\n if (match) {\n return match[1];\n } else {\n return '';\n }\n}\n\n/**\n * @param {!Node} node\n */\nexport function getOwnerScope(node) {\n const ownerRoot = wrap(node).getRootNode();\n if (ownerRoot === node || ownerRoot === node.ownerDocument) {\n return '';\n }\n const host = /** @type {!ShadowRoot} */ (ownerRoot).host;\n if (!host) {\n // this may actually be a document fragment\n return '';\n }\n return getIsExtends(host).is;\n}\n\n/**\n * @param {!Element} element\n */\nexport function ensureCorrectScope(element) {\n const currentScope = getCurrentScope(element);\n const ownerRoot = wrap(element).getRootNode();\n if (ownerRoot === element) {\n return;\n }\n if (currentScope && ownerRoot === element.ownerDocument) {\n // node was scoped, but now is in document\n StyleTransformer.domRemoveScope(element, currentScope);\n } else if (ownerRoot instanceof ShadowRoot) {\n const ownerScope = getOwnerScope(element);\n if (ownerScope !== currentScope) {\n // node was scoped, but not by its current owner\n StyleTransformer.domReplaceScope(element, currentScope, ownerScope);\n }\n }\n}\n\n/**\n * @param {!HTMLElement|!HTMLDocument} element\n */\nexport function ensureCorrectSubtreeScoping(element) {\n // find unscoped subtree nodes\n const unscopedNodes = window['ShadyDOM']['nativeMethods'][\n 'querySelectorAll'\n ].call(element, `:not(.${StyleTransformer.SCOPE_NAME})`);\n\n for (let j = 0; j < unscopedNodes.length; j++) {\n // it's possible, during large batch inserts, that nodes that aren't\n // scoped within the current scope were added.\n // To make sure that any unscoped nodes that were inserted in the current batch are correctly styled,\n // query all unscoped nodes and force their style-scope to be applied.\n // This could happen if a sub-element appended an unscoped node in its shadowroot and this function\n // runs on a parent element of the host of that unscoped node:\n // parent-element -> element -> unscoped node\n // Here unscoped node should have the style-scope element, not parent-element.\n const unscopedNode = unscopedNodes[j];\n const scopeForPreviouslyUnscopedNode = getOwnerScope(unscopedNode);\n if (scopeForPreviouslyUnscopedNode) {\n StyleTransformer.element(unscopedNode, scopeForPreviouslyUnscopedNode);\n }\n }\n}\n\n/**\n * @param {HTMLElement} el\n * @return {boolean}\n */\nfunction isElementWithBuiltCss(el) {\n if (el.localName === 'style' || el.localName === 'template') {\n return elementHasBuiltCss(el);\n }\n return false;\n}\n\n/**\n * @param {Array<MutationRecord|null>|null} mxns\n */\nfunction handler(mxns) {\n for (let x = 0; x < mxns.length; x++) {\n let mxn = mxns[x];\n if (\n mxn.target === document.documentElement ||\n mxn.target === document.head\n ) {\n continue;\n }\n for (let i = 0; i < mxn.addedNodes.length; i++) {\n let n = mxn.addedNodes[i];\n if (n.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n n = /** @type {HTMLElement} */ (n); // eslint-disable-line no-self-assign\n let root = n.getRootNode();\n let currentScope = getCurrentScope(n);\n // node was scoped, but now is in document\n // If this element has built css, we must not remove scoping as this node\n // will be used as a template or style without re - applying scoping as an optimization\n if (\n currentScope &&\n root === n.ownerDocument &&\n !isElementWithBuiltCss(n)\n ) {\n StyleTransformer.domRemoveScope(n, currentScope);\n } else if (root instanceof ShadowRoot) {\n const newScope = getOwnerScope(n);\n // rescope current node and subtree if necessary\n if (newScope !== currentScope) {\n StyleTransformer.domReplaceScope(n, currentScope, newScope);\n }\n // make sure all the subtree elements are scoped correctly\n ensureCorrectSubtreeScoping(n);\n }\n }\n }\n}\n\n// if native Shadow DOM is being used, or ShadyDOM handles dynamic scoiping, do not activate the MutationObserver\nif (\n !nativeShadow &&\n !(window['ShadyDOM'] && window['ShadyDOM']['handlesDynamicScoping'])\n) {\n let observer = new MutationObserver(handler);\n let start = (node) => {\n observer.observe(node, {childList: true, subtree: true});\n };\n let nativeCustomElements =\n window['customElements'] &&\n !window['customElements']['polyfillWrapFlushCallback'];\n // need to start immediately with native custom elements\n // TODO(dfreedm): with polyfilled HTMLImports and native custom elements\n // excessive mutations may be observed; this can be optimized via cooperation\n // with the HTMLImports polyfill.\n if (nativeCustomElements) {\n start(document);\n } else {\n let delayedStart = () => {\n start(document.body);\n };\n // use polyfill timing if it's available\n if (window['HTMLImports']) {\n window['HTMLImports']['whenReady'](delayedStart);\n // otherwise push beyond native imports being ready\n // which requires RAF + readystate interactive.\n } else {\n requestAnimationFrame(function () {\n if (document.readyState === 'loading') {\n let listener = function () {\n delayedStart();\n document.removeEventListener('readystatechange', listener);\n };\n document.addEventListener('readystatechange', listener);\n } else {\n delayedStart();\n }\n });\n }\n }\n\n flush = function () {\n handler(observer.takeRecords());\n };\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment, StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\nimport {nativeShadow} from './style-settings.js';\nimport StyleTransformer from './style-transformer.js';\nimport * as StyleUtil from './style-util.js';\nimport * as RX from './common-regex.js';\nimport StyleInfo from './style-info.js';\n\n// TODO: dedupe with shady\n/**\n * @param {string} selector\n * @return {boolean}\n * @this {Element}\n */\nconst matchesSelector = function (selector) {\n const method =\n this.matches ||\n this.matchesSelector ||\n this.mozMatchesSelector ||\n this.msMatchesSelector ||\n this.oMatchesSelector ||\n this.webkitMatchesSelector;\n return method && method.call(this, selector);\n};\n\nconst rootSelector = /:host\\s*>\\s*/;\n\nfunction checkRoot(hostScope, selector) {\n return (\n Boolean(selector.match(rootSelector)) ||\n (hostScope === 'html' && selector.indexOf('html') > -1)\n );\n}\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n /** @return {string} */\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n /**\n * decorates styles with rule info and returns an array of used style property names\n *\n * @param {StyleNode} rules\n * @return {!Array<string>}\n */\n decorateStyles(rules) {\n let self = this,\n props = {},\n keyframes = [],\n ruleIndex = 0;\n StyleUtil.forEachRule(\n rules,\n function (rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n },\n function onKeyframesRule(rule) {\n keyframes.push(rule);\n }\n );\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {},\n properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule['rules'] = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m,\n rx = RX.VAR_ASSIGN;\n let cssText = rule['parsedCssText'];\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule['parsedCssText']);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(RX.BRACKETED, '').replace(RX.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = RX.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i = 0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >= 0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function (prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue =\n self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return (property && property.trim()) || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i = 0, p, m; i < parts.length; i++) {\n if ((p = parts[i])) {\n RX.MIXIN_MATCH.lastIndex = 0;\n m = RX.MIXIN_MATCH.exec(p);\n if (m) {\n p = this.valueForProperty(props[m[1]], props);\n } else {\n let colon = p.indexOf(':');\n if (colon !== -1) {\n let pp = p.substring(colon);\n pp = pp.trim();\n pp = this.valueForProperty(pp, props) || pp;\n p = p.substring(0, colon) + pp;\n }\n }\n parts[i] =\n p && p.lastIndexOf(';') === p.length - 1\n ? p.slice(0, -1) // strip trailing ;\n : p || '';\n }\n }\n return parts.join(';');\n }\n\n applyProperties(rule, props) {\n let output = '';\n // dynamically added sheets may not be decorated so ensure they are.\n if (!rule.propertyInfo) {\n this.decorateRule(rule);\n }\n if (rule.propertyInfo.cssText) {\n output = this.valueForProperties(rule.propertyInfo.cssText, props);\n }\n rule['cssText'] = output;\n }\n\n // Apply keyframe transformations to the cssText of a given rule. The\n // keyframeTransforms object is a map of keyframe names to transformer\n // functions which take in cssText and spit out transformed cssText.\n applyKeyframeTransforms(rule, keyframeTransforms) {\n let input = rule['cssText'];\n let output = rule['cssText'];\n if (rule.hasAnimations == null) {\n // Cache whether or not the rule has any animations to begin with:\n rule.hasAnimations = RX.ANIMATION_MATCH.test(input);\n }\n // If there are no animations referenced, we can skip transforms:\n if (rule.hasAnimations) {\n let transform;\n // If we haven't transformed this rule before, we iterate over all\n // transforms:\n if (rule.keyframeNamesToTransform == null) {\n rule.keyframeNamesToTransform = [];\n for (let keyframe in keyframeTransforms) {\n transform = keyframeTransforms[keyframe];\n output = transform(input);\n // If the transform actually changed the CSS text, we cache the\n // transform name for future use:\n if (input !== output) {\n input = output;\n rule.keyframeNamesToTransform.push(keyframe);\n }\n }\n } else {\n // If we already have a list of keyframe names that apply to this\n // rule, we apply only those keyframe name transforms:\n for (let i = 0; i < rule.keyframeNamesToTransform.length; ++i) {\n transform = keyframeTransforms[rule.keyframeNamesToTransform[i]];\n input = transform(input);\n }\n output = input;\n }\n }\n rule['cssText'] = output;\n }\n\n // Test if the rules in these styles matches the given `element` and if so,\n // collect any custom properties into `props`.\n /**\n * @param {StyleNode} rules\n * @param {Element} element\n */\n propertyDataFromStyles(rules, element) {\n let props = {};\n // generates a unique key for these matches\n let o = [];\n // note: active rules excludes non-matching @media rules\n StyleUtil.forEachRule(\n rules,\n (rule) => {\n // TODO(sorvell): we could trim the set of rules at declaration\n // time to only include ones that have properties\n if (!rule.propertyInfo) {\n this.decorateRule(rule);\n }\n // match element against transformedSelector: selector may contain\n // unwanted uniquification and parsedSelector does not directly match\n // for :host selectors.\n let selectorToMatch =\n rule.transformedSelector || rule['parsedSelector'];\n if (element && rule.propertyInfo.properties && selectorToMatch) {\n if (matchesSelector.call(element, selectorToMatch)) {\n this.collectProperties(rule, props);\n // produce numeric key for these matches for lookup\n addToBitMask(rule.index, o);\n }\n }\n },\n null,\n true\n );\n return {properties: props, key: o};\n }\n\n /**\n * @param {Element} scope\n * @param {StyleNode} rule\n * @param {string} cssBuild\n * @param {function(Object)} callback\n */\n whenHostOrRootRule(scope, rule, cssBuild, callback) {\n if (!(/** @type {?} */ (rule.propertyInfo))) {\n this.decorateRule(rule);\n }\n if (!(/** @type {?} */ (rule.propertyInfo).properties)) {\n return;\n }\n let {is, typeExtension} = StyleUtil.getIsExtends(scope);\n let hostScope = is\n ? StyleTransformer._calcHostScope(is, typeExtension)\n : 'html';\n let parsedSelector = rule['parsedSelector'];\n let isRoot = checkRoot(hostScope, parsedSelector);\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot =\n parsedSelector === hostScope + ' > *.' + hostScope ||\n parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host because `:host` does not work with `matches`\n if (!(/** @type {?} */ (rule.transformedSelector))) {\n // transform :host into a matchable selector\n rule.transformedSelector = StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(is),\n hostScope\n );\n }\n selectorToMatch =\n /** @type {?} */ (rule.transformedSelector) || hostScope;\n }\n if (isRoot && hostScope === 'html') {\n selectorToMatch =\n /** @type {?} */ (rule.transformedSelector) ||\n /** @type {?} */ (rule.parsedSelector);\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot,\n });\n }\n /**\n * @param {Element} scope\n * @param {StyleNode} rules\n * @param {string} cssBuild\n * @return {!Object}\n */\n hostAndRootPropertiesForScope(scope, rules, cssBuild) {\n let hostProps = {},\n rootProps = {};\n // note: active rules excludes non-matching @media rules\n StyleUtil.forEachRule(\n rules,\n (rule) => {\n // if scope is StyleDefaults, use _element for matchesSelector\n this.whenHostOrRootRule(scope, rule, cssBuild, (info) => {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n this.collectProperties(rule, hostProps);\n } else {\n this.collectProperties(rule, rootProps);\n }\n }\n });\n },\n null,\n true\n );\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n /**\n * @param {Element} element\n * @param {Object} properties\n * @param {string} scopeSelector\n */\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let {is, typeExtension} = StyleUtil.getIsExtends(element);\n let hostSelector = StyleTransformer._calcHostScope(is, typeExtension);\n let rxHostSelector = element.extends\n ? '\\\\' + hostSelector.slice(0, -1) + '\\\\]'\n : hostSelector;\n let hostRx = new RegExp(RX.HOST_PREFIX + rxHostSelector + RX.HOST_SUFFIX);\n let {styleRules: rules, cssBuild} = StyleInfo.get(element);\n let keyframeTransforms = this._elementKeyframeTransforms(\n element,\n rules,\n scopeSelector\n );\n return StyleTransformer.elementStyles(\n element,\n rules,\n function (rule) {\n self.applyProperties(rule, properties);\n if (\n !nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule['cssText']\n ) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n },\n cssBuild\n );\n }\n\n /**\n * @param {Element} element\n * @param {StyleNode} rules\n * @param {string} scopeSelector\n * @return {!Object}\n */\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (\n let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]\n ) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[\n keyframesRule['keyframesName']\n ] = this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n /**\n * @param {StyleNode} keyframesRule\n * @return {function(string):string}\n */\n _keyframesRuleTransformer(keyframesRule) {\n return function (cssText) {\n return cssText.replace(\n /** @type {?} */ (keyframesRule.keyframesNameRx),\n /** @type {?} */ (keyframesRule.transformedKeyframesName)\n );\n };\n }\n\n /**\n * Transforms `@keyframes` names to be unique for the current host.\n * Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n *\n * @param {StyleNode} rule\n * @param {string} scopeId\n */\n _scopeKeyframes(rule, scopeId) {\n // Animation names are of the form [\\w-], so ensure that the name regex does not partially apply\n // to similarly named keyframe names by checking for a word boundary at the beginning and\n // a non-word boundary or `-` at the end.\n rule.keyframesNameRx = new RegExp(\n `\\\\b${rule['keyframesName']}(?!\\\\B|-)`,\n 'g'\n );\n rule.transformedKeyframesName = rule['keyframesName'] + '-' + scopeId;\n rule.transformedSelector =\n /** @type {?} */ (rule.transformedSelector) || rule['selector'];\n rule['selector'] = /** @type {?} */ (rule.transformedSelector).replace(\n rule['keyframesName'],\n rule.transformedKeyframesName\n );\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n /**\n * @param {StyleNode} rule\n * @param {RegExp} hostRx\n * @param {string} hostSelector\n * @param {string} scopeId\n */\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector =\n /** @type {?} */ (rule.transformedSelector) || rule['selector'];\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = StyleUtil.splitSelectorList(selector);\n for (let i = 0, l = parts.length, p; i < l && (p = parts[i]); i++) {\n parts[i] = p.match(hostRx)\n ? p.replace(hostSelector, scope)\n : scope + ' ' + p;\n }\n rule['selector'] = parts.join(',');\n }\n\n /**\n * @param {Element} element\n * @param {string} selector\n * @param {string} old\n */\n applyElementScopeSelector(element, selector, old) {\n let c = element.getAttribute('class') || '';\n let v = c;\n if (old) {\n v = c.replace(\n new RegExp('\\\\s*' + XSCOPE_NAME + '\\\\s*' + old + '\\\\s*', 'g'),\n ' '\n );\n }\n v += (v ? ' ' : '') + XSCOPE_NAME + ' ' + selector;\n if (c !== v) {\n StyleUtil.setElementClassRaw(element, v);\n }\n }\n\n /**\n * @param {HTMLElement} element\n * @param {Object} properties\n * @param {string} selector\n * @param {HTMLStyleElement} style\n * @return {HTMLStyleElement}\n */\n applyElementStyle(element, properties, selector, style) {\n // calculate cssText to apply\n let cssText = style\n ? style.textContent || ''\n : this.transformStyles(element, properties, selector);\n // if shady and we have a cached style that is not style, decrement\n let styleInfo = StyleInfo.get(element);\n let s = styleInfo.customStyle;\n if (s && !nativeShadow && s !== style) {\n s['_useCount']--;\n if (s['_useCount'] <= 0 && s.parentNode) {\n s.parentNode.removeChild(s);\n }\n }\n // apply styling always under native or if we generated style\n // or the cached style is not in document(!)\n if (nativeShadow) {\n // update existing style only under native\n if (styleInfo.customStyle) {\n styleInfo.customStyle.textContent = cssText;\n style = styleInfo.customStyle;\n // otherwise, if we have css to apply, do so\n } else if (cssText) {\n // apply css after the scope style of the element to help with\n // style precedence rules.\n style = StyleUtil.applyCss(\n cssText,\n selector,\n element.shadowRoot,\n styleInfo.placeholder\n );\n }\n } else {\n // shady and no cache hit\n if (!style) {\n // apply css after the scope style of the element to help with\n // style precedence rules.\n if (cssText) {\n style = StyleUtil.applyCss(\n cssText,\n selector,\n null,\n styleInfo.placeholder\n );\n }\n // shady and cache hit but not in document\n } else if (!style.parentNode) {\n if (IS_IE && cssText.indexOf('@media') > -1) {\n // @media rules may be stale in IE 10 and 11\n // refresh the text content of the style to revalidate them.\n style.textContent = cssText;\n }\n StyleUtil.applyStyle(style, null, styleInfo.placeholder);\n }\n }\n // ensure this style is our custom style and increment its use count.\n if (style) {\n style['_useCount'] = style['_useCount'] || 0;\n // increment use count if we changed styles\n if (styleInfo.customStyle != style) {\n style['_useCount']++;\n }\n styleInfo.customStyle = style;\n }\n return style;\n }\n\n /**\n * @param {Element} style\n * @param {Object} properties\n */\n applyCustomStyle(style, properties) {\n let rules = StyleUtil.rulesForStyle(\n /** @type {HTMLStyleElement} */ (style)\n );\n let self = this;\n style.textContent = StyleUtil.toCssText(rules, function (\n /** StyleNode */ rule\n ) {\n let css = (rule['cssText'] = rule['parsedCssText']);\n if (\n /** @type {?} */ (rule.propertyInfo) &&\n /** @type {?} */ (rule.propertyInfo).cssText\n ) {\n // remove property assignments\n // so next function isn't confused\n // NOTE: we have 3 categories of css:\n // (1) normal properties,\n // (2) custom property assignments (--foo: red;),\n // (3) custom property usage: border: var(--foo); @apply(--foo);\n // In elements, 1 and 3 are separated for efficiency; here they\n // are not and this makes this case unique.\n css = removeCustomPropAssignment(/** @type {string} */ (css));\n // replace with reified properties, scenario is same as mixin\n rule['cssText'] = self.valueForProperties(css, properties);\n }\n });\n }\n}\n\n/**\n * @param {number} n\n * @param {Array<number>} bits\n */\nfunction addToBitMask(n, bits) {\n let o = parseInt(n / 32, 10);\n let v = 1 << n % 32;\n bits[o] = (bits[o] || 0) | v;\n}\n\nexport default new StyleProperties();\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/** @const {string} */\nconst infoKey = '__styleInfo';\n\nexport default class StyleInfo {\n /**\n * @param {Element} node\n * @return {StyleInfo}\n */\n static get(node) {\n if (node) {\n return node[infoKey];\n } else {\n return null;\n }\n }\n /**\n * @param {!Element} node\n * @param {StyleInfo} styleInfo\n * @return {StyleInfo}\n */\n static set(node, styleInfo) {\n node[infoKey] = styleInfo;\n return styleInfo;\n }\n /**\n * @param {StyleNode} ast\n * @param {Node=} placeholder\n * @param {Array<string>=} ownStylePropertyNames\n * @param {string=} elementName\n * @param {string=} typeExtension\n * @param {string=} cssBuild\n */\n constructor(\n ast,\n placeholder,\n ownStylePropertyNames,\n elementName,\n typeExtension,\n cssBuild\n ) {\n /** @type {StyleNode} */\n this.styleRules = ast || null;\n /** @type {Node} */\n this.placeholder = placeholder || null;\n /** @type {!Array<string>} */\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n /** @type {Object} */\n this.overrideStyleProperties = null;\n /** @type {string} */\n this.elementName = elementName || '';\n /** @type {string} */\n this.cssBuild = cssBuild || '';\n /** @type {string} */\n this.typeExtension = typeExtension || '';\n /** @type {Object<string, string>} */\n this.styleProperties = null;\n /** @type {?string} */\n this.scopeSelector = null;\n /** @type {HTMLStyleElement} */\n this.customStyle = null;\n }\n _getStyleRules() {\n return this.styleRules;\n }\n}\n\n/* eslint-disable-next-line no-self-assign */\nStyleInfo.prototype['_getStyleRules'] = StyleInfo.prototype._getStyleRules;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {applyStylePlaceHolder} from './style-util.js';\nimport {nativeShadow, disableRuntime} from './style-settings.js';\n\n/** @type {!Object<string, !Node>} */\nconst placeholderMap = {};\n\n/**\n * @param {string} elementName\n * @return {Node}\n */\nexport function getStylePlaceholder(elementName) {\n return placeholderMap[elementName] || null;\n}\n\n/**\n * @param {string} elementName\n */\nexport function ensureStylePlaceholder(elementName) {\n if (!placeholderMap[elementName]) {\n placeholderMap[elementName] = applyStylePlaceHolder(elementName);\n }\n}\n\n/**\n * @const {CustomElementRegistry}\n */\nconst ce = window['customElements'];\nif (ce && !nativeShadow && !disableRuntime) {\n /**\n * @const {function(this:CustomElementRegistry, string,function(new:HTMLElement),{extends: string}=)}\n */\n const origDefine = ce['define'];\n /**\n * @param {string} name\n * @param {function(new:HTMLElement)} clazz\n * @param {{extends: string}=} options\n */\n const wrappedDefine = (name, clazz, options) => {\n ensureStylePlaceholder(name);\n origDefine.call(\n /** @type {!CustomElementRegistry} */ (ce),\n name,\n clazz,\n options\n );\n };\n ce['define'] = wrappedDefine;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';\n\nexport default class StyleCache {\n constructor(typeMax = 100) {\n // map element name -> [{properties, styleElement, scopeSelector}]\n this.cache = {};\n /** @type {number} */\n this.typeMax = typeMax;\n }\n\n _validate(cacheEntry, properties, ownPropertyNames) {\n for (let idx = 0; idx < ownPropertyNames.length; idx++) {\n let pn = ownPropertyNames[idx];\n if (cacheEntry.properties[pn] !== properties[pn]) {\n return false;\n }\n }\n return true;\n }\n\n store(tagname, properties, styleElement, scopeSelector) {\n let list = this.cache[tagname] || [];\n list.push({properties, styleElement, scopeSelector});\n if (list.length > this.typeMax) {\n list.shift();\n }\n this.cache[tagname] = list;\n }\n\n fetch(tagname, properties, ownPropertyNames) {\n let list = this.cache[tagname];\n if (!list) {\n return;\n }\n // reverse list for most-recent lookups\n for (let idx = list.length - 1; idx >= 0; idx--) {\n let entry = list[idx];\n if (this._validate(entry, properties, ownPropertyNames)) {\n return entry;\n }\n }\n }\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\n/**\n * @const {!Object<string, !HTMLTemplateElement>}\n */\nconst templateMap = {};\nexport default templateMap;\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\nimport templateMap from './template-map.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line @typescript-eslint/no-unused-vars\n\n/*\n * Utilities for handling invalidating apply-shim mixins for a given template.\n *\n * The invalidation strategy involves keeping track of the \"current\" version of a template's mixins, and updating that count when a mixin is invalidated.\n * The template\n */\n\n/** @const {string} */\nconst CURRENT_VERSION = '_applyShimCurrentVersion';\n\n/** @const {string} */\nconst NEXT_VERSION = '_applyShimNextVersion';\n\n/** @const {string} */\nconst VALIDATING_VERSION = '_applyShimValidatingVersion';\n\n/**\n * @const {Promise<void>}\n */\nconst promise = Promise.resolve();\n\n/**\n * @param {string} elementName\n */\nexport function invalidate(elementName) {\n let template = templateMap[elementName];\n if (template) {\n invalidateTemplate(template);\n }\n}\n\n/**\n * This function can be called multiple times to mark a template invalid\n * and signal that the style inside must be regenerated.\n *\n * Use `startValidatingTemplate` to begin an asynchronous validation cycle.\n * During that cycle, call `templateIsValidating` to see if the template must\n * be revalidated\n * @param {HTMLTemplateElement} template\n */\nexport function invalidateTemplate(template) {\n // default the current version to 0\n template[CURRENT_VERSION] = template[CURRENT_VERSION] || 0;\n // ensure the \"validating for\" flag exists\n template[VALIDATING_VERSION] = template[VALIDATING_VERSION] || 0;\n // increment the next version\n template[NEXT_VERSION] = (template[NEXT_VERSION] || 0) + 1;\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValid(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValid(template);\n }\n return true;\n}\n\n/**\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValid(template) {\n return template[CURRENT_VERSION] === template[NEXT_VERSION];\n}\n\n/**\n * @param {string} elementName\n * @return {boolean}\n */\nexport function isValidating(elementName) {\n let template = templateMap[elementName];\n if (template) {\n return templateIsValidating(template);\n }\n return false;\n}\n\n/**\n * Returns true if the template is currently invalid and `startValidating` has been called since the last invalidation.\n * If false, the template must be validated.\n * @param {HTMLTemplateElement} template\n * @return {boolean}\n */\nexport function templateIsValidating(template) {\n return (\n !templateIsValid(template) &&\n template[VALIDATING_VERSION] === template[NEXT_VERSION]\n );\n}\n\n/**\n * the template is marked as `validating` for one microtask so that all instances\n * found in the tree crawl of `applyStyle` will update themselves,\n * but the template will only be updated once.\n * @param {string} elementName\n */\nexport function startValidating(elementName) {\n let template = templateMap[elementName];\n startValidatingTemplate(template);\n}\n\n/**\n * Begin an asynchronous invalidation cycle.\n * This should be called after every validation of a template\n *\n * After one microtask, the template will be marked as valid until the next call to `invalidateTemplate`\n * @param {HTMLTemplateElement} template\n */\nexport function startValidatingTemplate(template) {\n // remember that the current \"next version\" is the reason for this validation cycle\n template[VALIDATING_VERSION] = template[NEXT_VERSION];\n // however, there only needs to be one async task to clear the counters\n if (!template._validating) {\n template._validating = true;\n promise.then(function () {\n // sync the current version to let future invalidations cause a refresh cycle\n template[CURRENT_VERSION] = template[NEXT_VERSION];\n template._validating = false;\n });\n }\n}\n\n/**\n * @return {boolean}\n */\nexport function elementsAreInvalid() {\n for (let elementName in templateMap) {\n let template = templateMap[elementName];\n if (!templateIsValid(template)) {\n return true;\n }\n }\n return false;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js';\n\n/**\n * @param {Element} element\n * @param {Object=} properties\n */\nexport function updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n}\n\n/**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\nexport function getComputedStyleValue(element, property) {\n /**\n * @const {string}\n */\n const value = window.getComputedStyle(element).getPropertyValue(property);\n if (!value) {\n return '';\n } else {\n return value.trim();\n }\n}\n\n/**\n * return true if `cssText` contains a mixin definition or consumption\n * @param {string} cssText\n * @return {boolean}\n */\nexport function detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n}\n","/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport ScopingShim from '../src/scoping-shim.js';\n// prettier-ignore\nimport {nativeCssVariables, nativeShadow, cssBuild, disableRuntime} from '../src/style-settings.js';\n\n/** @const {ScopingShim} */\nconst scopingShim = new ScopingShim();\n\nlet ApplyShim, CustomStyleInterface;\n\nif (window['ShadyCSS']) {\n ApplyShim = window['ShadyCSS']['ApplyShim'];\n CustomStyleInterface = window['ShadyCSS']['CustomStyleInterface'];\n}\n\nwindow.ShadyCSS = {\n ScopingShim: scopingShim,\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplate(template, elementName, elementExtends) {\n scopingShim.flushCustomStyles();\n scopingShim.prepareTemplate(template, elementName, elementExtends);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n */\n prepareTemplateDom(template, elementName) {\n scopingShim.prepareTemplateDom(template, elementName);\n },\n\n /**\n * @param {!HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} elementExtends\n */\n prepareTemplateStyles(template, elementName, elementExtends) {\n scopingShim.flushCustomStyles();\n scopingShim.prepareTemplateStyles(template, elementName, elementExtends);\n },\n /**\n * @param {!HTMLElement} element\n * @param {Object=} properties\n */\n styleSubtree(element, properties) {\n scopingShim.flushCustomStyles();\n scopingShim.styleSubtree(element, properties);\n },\n\n /**\n * @param {!HTMLElement} element\n */\n styleElement(element) {\n scopingShim.flushCustomStyles();\n scopingShim.styleElement(element);\n },\n\n /**\n * @param {Object=} properties\n */\n styleDocument(properties) {\n scopingShim.flushCustomStyles();\n scopingShim.styleDocument(properties);\n },\n\n flushCustomStyles() {\n scopingShim.flushCustomStyles();\n },\n\n /**\n * @param {Element} element\n * @param {string} property\n * @return {string}\n */\n getComputedStyleValue(element, property) {\n return scopingShim.getComputedStyleValue(element, property);\n },\n\n nativeCss: nativeCssVariables,\n\n nativeShadow: nativeShadow,\n\n cssBuild: cssBuild,\n\n disableRuntime: disableRuntime,\n};\n\nif (ApplyShim) {\n window.ShadyCSS.ApplyShim = ApplyShim;\n}\n\nif (CustomStyleInterface) {\n window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n}\n"]}
\No newline at end of file