{"version":3,"sources":["webpack:///../src/lib/default-template-processor.ts","webpack:///src/lit-html.ts","webpack:///../src/lib/parts.ts","webpack:///../src/lib/template.ts","webpack:///../src/lib/dom.ts","webpack:///./node_modules/@zywave/zui-base/dist/zui-base-mixin.js","webpack:///./node_modules/@zywave/zui-base/dist/zui-base.js","webpack:///./node_modules/@zywave/zui-base/dist/index.js","webpack:///../src/lib/template-result.ts","webpack:///../src/lib/template-factory.ts","webpack:///./node_modules/@webcomponents/shadycss/src/style-settings.js","webpack:///./node_modules/@webcomponents/shadycss/src/common-regex.js","webpack:///./node_modules/@webcomponents/shadycss/src/common-utils.js","webpack:///./node_modules/@zywave/zui-colors/dist/index.js","webpack:///../src/lib/directive.ts","webpack:///../src/lib/render.ts","webpack:///./node_modules/@webcomponents/shadycss/src/document-wait.js","webpack:///./node_modules/@webcomponents/shadycss/src/custom-style-interface.js","webpack:///../src/lib/part.ts","webpack:///../src/lib/template-instance.ts","webpack:///../src/directives/when.ts","webpack:///../src/directives/until.ts","webpack:///./node_modules/@zywave/zui-svg/dist/zui-svg.js","webpack:///./node_modules/@zywave/zui-icons/dist/zui-icon.js","webpack:///./node_modules/@webcomponents/shadycss/entrypoints/custom-style-interface.js","webpack:///../src/lib/modify-template.ts","webpack:///../src/lib/shady-render.ts","webpack:///../src/lib/updating-element.ts","webpack:///../src/lib/decorators.ts","webpack:///src/lit-element.ts","webpack:///./node_modules/@zywave/zui-icons/dist/zui-icons.js","webpack:///./node_modules/@zywave/zui-colors/dist/colors.js","webpack:///./node_modules/@polymer/polymer/lib/utils/boot.js","webpack:///./node_modules/@polymer/polymer/lib/utils/resolve-url.js","webpack:///./node_modules/@polymer/polymer/lib/utils/settings.js","webpack:///./node_modules/@polymer/polymer/lib/utils/mixin.js","webpack:///./node_modules/@polymer/polymer/lib/elements/dom-module.js","webpack:///./node_modules/@polymer/polymer/lib/utils/style-gather.js","webpack:///./node_modules/@polymer/polymer/lib/utils/path.js","webpack:///./node_modules/@polymer/polymer/lib/utils/case-map.js","webpack:///./node_modules/@polymer/polymer/lib/utils/async.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/properties-changed.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/property-accessors.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/template-stamp.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/property-effects.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/properties-mixin.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/element-mixin.js","webpack:///./node_modules/@polymer/polymer/lib/utils/html-tag.js","webpack:///./node_modules/@polymer/polymer/polymer-element.js","webpack:///./node_modules/@zywave/zui-dialog/dist/zui-dialog-header.js","webpack:///./node_modules/@zywave/zui-dialog/dist/zui-dialog-content.js","webpack:///./node_modules/@zywave/zui-dialog/dist/zui-dialog-footer.js","webpack:///./node_modules/@polymer/polymer/lib/utils/render-status.js","webpack:///./node_modules/@webcomponents/shadycss/src/css-parse.js","webpack:///./node_modules/@webcomponents/shadycss/src/unscoped-style-handler.js","webpack:///./node_modules/@webcomponents/shadycss/src/style-util.js","webpack:///./node_modules/@webcomponents/shadycss/src/apply-shim.js","webpack:///./node_modules/@webcomponents/shadycss/src/template-map.js","webpack:///./node_modules/@webcomponents/shadycss/src/apply-shim-utils.js","webpack:///./node_modules/@webcomponents/shadycss/entrypoints/apply-shim.js","webpack:///./node_modules/@polymer/polymer/lib/utils/debounce.js","webpack:///./node_modules/@polymer/polymer/lib/utils/gestures.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/gesture-event-listeners.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/dir-mixin.js","webpack:///./node_modules/@polymer/polymer/lib/utils/unresolved.js","webpack:///./node_modules/@polymer/polymer/lib/utils/array-splice.js","webpack:///./node_modules/@polymer/polymer/lib/utils/flattened-nodes-observer.js","webpack:///./node_modules/@polymer/polymer/lib/utils/flush.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/polymer.dom.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/legacy-element-mixin.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/class.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/polymer-fn.js","webpack:///./node_modules/@polymer/polymer/lib/mixins/mutable-data.js","webpack:///./node_modules/@polymer/polymer/lib/utils/templatize.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/templatizer-behavior.js","webpack:///./node_modules/@polymer/polymer/lib/elements/dom-bind.js","webpack:///./node_modules/@polymer/polymer/lib/elements/dom-repeat.js","webpack:///./node_modules/@polymer/polymer/lib/elements/dom-if.js","webpack:///./node_modules/@polymer/polymer/lib/elements/array-selector.js","webpack:///./node_modules/@polymer/polymer/lib/elements/custom-style.js","webpack:///./node_modules/@polymer/polymer/lib/legacy/mutable-data-behavior.js","webpack:///./node_modules/@polymer/polymer/polymer-legacy.js","webpack:///./node_modules/@polymer/iron-fit-behavior/iron-fit-behavior.js","webpack:///./node_modules/@polymer/iron-resizable-behavior/iron-resizable-behavior.js","webpack:///./node_modules/@polymer/iron-overlay-behavior/iron-focusables-helper.js","webpack:///./node_modules/@polymer/iron-overlay-behavior/iron-overlay-backdrop.js","webpack:///./node_modules/@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js","webpack:///./node_modules/@polymer/iron-overlay-behavior/iron-overlay-manager.js","webpack:///./node_modules/@polymer/iron-overlay-behavior/iron-scroll-manager.js","webpack:///./node_modules/@polymer/iron-overlay-behavior/iron-overlay-behavior.js","webpack:///./node_modules/@zywave/zui-dialog/dist/zui-dialog-behavior.js","webpack:///./node_modules/@zywave/zui-dialog/dist/zui-dialog.js","webpack:///./node_modules/@zywave/zui-button/dist/zui-button.js","webpack:///./node_modules/@zywave/zui-button/dist/zui-floating-action-button.js","webpack:///./node_modules/@zywave/zui-button/dist/zui-toggle-button.js","webpack:///./node_modules/@zywave/zui-well/dist/zui-well.js","webpack:///./node_modules/@zywave/zui-well/dist/zui-well-action.js"],"names":["defaultTemplateProcessor","[object Object]","element","name","strings","options","prefix","parts","slice","eventContext","__webpack_require__","d","__webpack_exports__","lit_html_html","directive","dom","template_result","_len","arguments","length","values","Array","_key","AttributeCommitter","NodePart","BooleanAttributePart","PropertyCommitter","EventPart","_directive_js__WEBPACK_IMPORTED_MODULE_0__","_dom_js__WEBPACK_IMPORTED_MODULE_1__","_part_js__WEBPACK_IMPORTED_MODULE_2__","_template_instance_js__WEBPACK_IMPORTED_MODULE_3__","_template_result_js__WEBPACK_IMPORTED_MODULE_4__","_template_js__WEBPACK_IMPORTED_MODULE_5__","isPrimitive","value","this","dirty","i","_createPart","AttributePart","l","text","part","undefined","v","isArray","Symbol","iterator","t","String","setAttribute","_getValue","comitter","committer","Object","commit","_pendingValue","container","startNode","appendChild","endNode","ref","nextSibling","_insert","_commitText","_commitTemplateResult","Node","_commitNode","_commitIterable","then","_commitPromise","node","parentNode","insertBefore","clear","previousSibling","nodeType","TEXT_NODE","textContent","document","createTextNode","template","templateFactory","update","instance","processor","fragment","_clone","itemParts","itemPart","partIndex","item","push","appendIntoPart","insertAfterPart","setValue","Error","removeAttribute","super","single","PropertyPart","eventOptionsSupported","capture","window","addEventListener","removeEventListener","_e","eventName","_boundHandleEvent","e","handleEvent","newListener","oldListener","shouldRemoveListener","once","passive","shouldAddListener","_options","getOptions","event","call","o","marker","nodeMarker","rewritesStyleAttribute","Template","isTemplatePartActive","createMarker","lastAttributeNameRegex","Math","random","markerRegex","RegExp","el","createElement","getAttribute","result","index","nodesToRemove","_prepareTemplate","content","walker","createTreeWalker","previousNode","currentNode","nextNode","hasAttributes","attributes","count","indexOf","stringForPart","exec","attributeLookupName","test","toLowerCase","split","type","tagName","nodeValue","parent","lastIndex","n","removeChild","createComment","isCEPolyfill","reparentNodes","removeNodes","customElements","polyfillWrapFlushCallback","start","end","before","ZuiBaseMixin","superClass","connectedCallback","ZuiBaseElement","LitElement","zui_base_ZuiBaseElement","TemplateResult","SVGTemplateResult","_dom_js__WEBPACK_IMPORTED_MODULE_0__","_template_js__WEBPACK_IMPORTED_MODULE_1__","html","isTextBinding","s","close","lastIndexOf","replace","match","p1","p2","p3","innerHTML","getHTML","getTemplateElement","svgElement","firstChild","templateCaches","_template_js__WEBPACK_IMPORTED_MODULE_0__","templateCache","get","Map","set","nativeShadow","nativeCssVariables","nativeCssVariables_","calcCssVariables","settings","Boolean","navigator","userAgent","CSS","supports","ShadyCSS","nativeCss","VAR_ASSIGN","MIXIN_MATCH","MEDIA_MATCH","updateNativeProperties","getComputedStyleValue","detectMixin","_common_regex_js__WEBPACK_IMPORTED_MODULE_0__","properties","p","style","removeProperty","setProperty","property","getComputedStyle","getPropertyValue","trim","cssText","has","isDirective","directives","WeakMap","f","render","_parts_js__WEBPACK_IMPORTED_MODULE_1__","_template_factory_js__WEBPACK_IMPORTED_MODULE_2__","assign","appendInto","resolveFn","readyPromise","whenReady","documentWait","callback","requestAnimationFrame","Promise","resolve","readyState","custom_style_interface_CustomStyleInterface","SEEN_MARKER","CACHED_STYLE","transformFn","validateFn","CustomStyleInterface","constructor","enqueueDocumentValidation","addCustomStyle","getStyleForCustomStyle","customStyle","processStyles","cs","styleToTransform","prototype","defineProperties","transformCallback","fn","validateCallback","needsEnqueue","noChange","TemplateInstance","_parts","cloneNode","importNode","nodeIndex","_prepareInstance","handleTextExpression","insertAfterNode","handleAttributeExpressions","nodeName","adoptNode","upgrade","partCaches","when","lit_html","condition","trueValue","falseValue","parentPart","cache","truePart","falsePart","cacheContainer","createDocumentFragment","nextPart","nextValue","prevCondition","prevPart","until","promise","defaultContent","SvgCache","_instance","define","svgId","attribute","file","_renderStyle","svgNodeClone","svgNode","getElementById","_loadSvg","reject","request","XMLHttpRequest","open","onload","status","newDoc","implementation","createHTMLDocument","body","responseText","statusText","onerror","send","doc","_buildSvg","icon","r","_src_custom_style_interface_js__WEBPACK_IMPORTED_MODULE_0__","_src_common_utils_js__WEBPACK_IMPORTED_MODULE_1__","_src_style_settings_js__WEBPACK_IMPORTED_MODULE_2__","customStyleInterface","prepareTemplate","elementName","elementExtends","prepareTemplateDom","prepareTemplateStyles","styleSubtree","styleElement","styleDocument","flushCustomStyles","walkerNodeFilter","NodeFilter","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","removeNodesFromTemplate","modify_template_nextActiveIndexInTemplateParts","removeCount","nodesToRemoveInTemplate","currentRemovingNode","forEach","countNodes","DOCUMENT_FRAGMENT_NODE","lib_template","getTemplateCacheKey","scopeName","compatibleShadyCSSVersion","console","warn","TEMPLATE_TYPES","shadyRenderSet","Set","renderedDOM","add","styles","querySelectorAll","condensedStyle","templates","template_factory","from","removeStylesFromLitTemplates","refNode","insertCount","walkerIndex","insertNodeIntoTemplate","querySelector","removes","fromBooleanAttribute","toBooleanAttribute","notEqual","old","defaultPropertyDeclaration","reflect","hasChanged","microtaskPromise","STATE_HAS_UPDATED","STATE_UPDATE_REQUESTED","STATE_IS_REFLECTING","UpdatingElement","HTMLElement","_updateState","_instanceProperties","_updatePromise","_changedProperties","_reflectingProperties","initialize","observedAttributes","_finalize","_ref","_classProperties","_ref2","_slicedToArray","attr","_attributeNameForProperty","_attributeToPropertyMap","hasOwnProperty","superProperties","getPrototypeOf","k","key","defineProperty","oldValue","_requestPropertyUpdate","configurable","enumerable","_finalized","superCtor","props","propKeys","getOwnPropertyNames","getOwnPropertySymbols","createProperty","fromAttribute","toAttribute","renderRoot","createRenderRoot","_saveInstanceProperties","_ref3","_ref5","_ref6","attachShadow","mode","requestUpdate","_attributeToProperty","ctor","attrValue","_propertyValueToAttribute","propName","_propertyValueFromAttribute","_invalidate","_valueHasChanged","updateComplete","_hasRequestedUpdate","resolver","previousValidatePromise","_validate","_applyInstanceProperties","shouldUpdate","changedProperties","_markUpdated","firstUpdated","updated","size","_ref7","_ref8","_propertyToAttribute","_query","target","selector","queryFn","proto","lit_element_LitElement","templateResult","localName","hasRendered","cacheKey","shadyTemplateFactory","ShadowRoot","host","$_iconsContainer","head","$_colorsContainer","JSCompiler_renameProperty","prop","obj","workingURL","resolveDoc","CSS_URL_RX","ABS_URL","resolveUrl","url","baseURI","u","URL","pathname","href","location","base","anchor","resolveCss","m","pre","post","pathFromUrl","substring","useShadow","ShadyDOM","rootPath","sanitizeDOMValue","Polymer","passiveTouchGestures","strictTemplatePolicy","allowTemplateFromDomModule","dedupeId","MixinFunction","__mixinApplications","__mixinSet","dedupingMixin","mixin","mixinApplications","mixinDedupeId","baseSet","map","extended","mixinSet","create","modules","lcModules","setModule","id","module","findModule","DomModule","attributeChangedCallback","namespace","register","assetpath","__assetpath","owner","HTMLImports","importForElement","ownerDocument","inst","styleOutsideTemplateCheck","MODULE_STYLE_LINK_SELECTOR","INCLUDE_ATTR","SHADY_UNSCOPED_ATTR","importModule","moduleId","import","styleForImport","importDoc","importCss","stylesFromModules","moduleIds","stylesFromModule","_styles","_stylesFromModuleImports","stylesFromTemplate","e$","include","filter","self","p$","unscoped","hasAttribute","_unscopedStyle","_style","cssFromModule","_cssText","_cssFromModuleImports","cssFromTemplate","isPath","path","root","dotIndex","isAncestor","isDescendant","translate","newBase","normalize","args","toString","j","join","info","last","caseMap","DASH_TO_CAMEL","CAMEL_TO_DASH","dashToCamelCase","dash","toUpperCase","camelToDashCase","camel","microtaskCurrHandle","microtaskLastHandle","microtaskCallbacks","microtaskNodeContent","microtaskNode","MutationObserver","len","cb","setTimeout","splice","observe","characterData","timeOut","after","delay","run","cancel","handle","clearTimeout","microTask","idx","microtask","PropertiesChanged","_createPropertyAccessor","readOnly","_addPropertyToAttributeMap","__dataHasAccessor","_definePropertyAccessor","__dataAttributes","attributeNameForProperty","_getProperty","_setProperty","__dataEnabled","__dataReady","__dataInvalid","__data","__dataPending","__dataOld","__dataInstanceProps","__serializing","_initializeProperties","ready","_flushProperties","_initializeInstanceProperties","_setPendingProperty","_invalidateProperties","ext","changed","_shouldPropertyChange","_enableProperties","changedProps","_shouldPropertiesChange","_propertiesChanged","currentProps","oldProps","_deserializeValue","typeForProperty","_valueToNodeAttribute","str","_serializeValue","Number","nativeProperties","PropertyAccessors","a$","__dataProto","_initializeProtoProperties","_ensureAttribute","Date","JSON","stringify","x","outValue","parse","isNaN","model","saveAccessorValue","_hasAccessor","_isPropertyPending","templateExtensions","dom-if","dom-repeat","wrapTemplateExtension","is","replaceChild","findTemplateNode","nodeInfo","parentInfo","parentIndex","applyIdToMap","applyEventListener","events","_addMethodEventListenerToNode","applyTemplateContent","templateInfo","_templateInfo","TemplateStamp","outerTemplateInfo","nodeInfoList","stripWhiteSpace","_parseTemplateContent","_parseTemplateNode","noted","hasInsertionPoint","_parseTemplateNestedTemplate","_parseTemplateChildNodes","_parseTemplateNodeAttributes","next","childInfo","infoIndex","_parseTemplate","attrs","a","_parseTemplateNodeAttribute","_stampTemplate","HTMLTemplateElement","decorate","__noInsertionPoint","nodes","nodeList","$","methodName","context","handler","_methodHost","detail","createNodeEventHandler","_addEventListenerToNode","_removeEventListenerFromNode","TYPES","COMPUTE","REFLECT","NOTIFY","PROPAGATE","OBSERVE","READ_ONLY","capitalAttributeRegex","PropertyEffectsType","ensureOwnEffectMap","effects","protoFx","instFx","runEffects","hasPaths","extraArgs","ran","runEffectsForProperty","fxs","fx","lastRun","pathMatchesTrigger","trigger","triggerPath","structured","wildcard","runObserverEffect","method","changedProp","dynamicFn","notifyPath","rootProperty","dispatchNotifyEvent","queueProperty","dispatchEvent","CustomEvent","runNotifyEffect","runReflectEffect","attrName","runComputedEffect","runMethodEffect","computedProp","methodInfo","addBinding","kind","literal","bindings","binding","isCompound","_binding$parts$","negate","listenerEvent","listenerNegate","compoundIndex","addEffectForBindingPart","dependencies","evaluator","parseArg","_addTemplatePropertyEffect","runBindingEffect","source","__isPropertyEffectsClient","_setPendingPropertyOrPath","_enqueueClient","storage","__dataCompoundStorage","computeBindingValue","_setUnmanagedPropertyToNode","applyBindingValue","_evaluateBinding","setupCompoundStorage","literals","addNotifyListener","fromProp","toPath","fromPath","currentTarget","handleNotification","createMethodEffect","sig","effectFn","static","arg","_addPropertyEffect","_marshalArgs","apply","emptyArray","bindingRegex","OPEN_BRACKET","literalFromParts","parseMethod","expression","argList","rawArg","parseArgs","fc","notifySplices","array","splices","splicesPath","indexSplices","notifySplice","addedCount","removed","object","PropertyEffects","propertyEffectsBase","__dataCounter","__dataClientsReady","__dataPendingClients","__dataToNotify","__dataLinkedPaths","__dataHasPaths","__dataHost","__dataTemp","__dataClientsInitialized","__computeEffects","__reflectEffects","__notifyEffects","__propagateEffects","__observeEffects","__readOnly","__templateInfo","PROPERTY_EFFECT_TYPES","hostStack","registerHost","effect","_removePropertyEffect","_hasPropertyEffect","_hasReadOnlyEffect","_hasNotifyEffect","_hasReflectEffect","_hasComputedEffect","shouldNotify","isPathNotification","links","link","b","computeLinkedPaths","propIsPath","prevProps","client","_flushClients","__enableOrFlushClients","_readyClients","clients","setProperties","setReadOnly","computeEffects","inputProps","runComputedEffects","notifyProps","_propagatePropertyChanges","notified","runNotifyEffects","propertyEffects","nextTemplateInfo","linkPaths","to","unlinkPaths","items","ret","pop","hadLength","deleteCount","_len2","_key2","floor","shift","unshift","_len3","_key3","propPath","_createReadOnlyProperty","protectedSetter","upper","_createPropertyObserver","_createMethodObserver","_createNotifyingProperty","_createReflectedProperty","_createComputedProperty","data","baseChanged","matches","_bindTemplate","instanceBinding","wasPreBound","__templateInfoLast","previousTemplateInfo","hostProps","beginHosting","endHosting","childNodes","setupBindings","_removeBoundDom","_parseBindings","origName","customEvent","notifyEvent","colon","signature","dynamicFns","stack","stackLen","PropertiesMixin","superPropertiesClass","ownProperties","output","normalizeProperties","__ownProperties","_properties","keys","finalize","__finalized","_finalizeClass","createProperties","__properties","disconnectedCallback","version","ElementMixin","polymerElementBase","createPropertyFromConfig","allProps","computed","reflectToAttribute","notify","observer","processElementStyles","klass","templateStyles","stylesWithImports","linkedStyles","stylesFromModuleImports","firstTemplateChild","firstElementChild","_processStyleText","templateStyleIndex","templateStyle","polymerElementVersion","registrations","observers","__ownObservers","ownObservers","createObservers","error","_template","getTemplateFromDomModule","importPath","meta","importMeta","_importPath","instanceCount","_finalizeTemplate","__propertyDefaults","propertyDefaults","__polymerFinalized","_attachDom","shadowRoot","updateStyles","LiteralString","string","literalValue","reduce","acc","htmlValue","PolymerElement","scheduled","beforeRenderQueue","afterRenderQueue","schedule","flushQueue","queue","callMethod","runQueue","StyleNode","parseCss","ss","code","repeat","_expandUnicodeEscapes","RX","multipleSpaces","AT_START","MEDIA_START","types","MEDIA_RULE","keyframesRule","KEYFRAMES_RULE","VAR_START","MIXIN_RULE","STYLE_RULE","r$","OPEN_BRACE","previous","CLOSE_BRACE","lex","comments","port","clean","preserveProperties","rules","_hasMixinRules","mixinApply","varApply","removeCustomPropApply","customProp","mixinProp","removeCustomPropAssignment","removeCustomProps","styleTextSet","scopingAttribute","processUnscopedStyle","newStyle","isUnscopedStyle","toCssText","forEachRule","rulesForStyle","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","matchMedia","findMatchingParen","level","CSS_BUILD_ATTR","getCssBuild","__cssBuild","buildComment","Comment","commentParts","getBuildComment","removeBuildComment","elementHasBuiltCss","APPLY_NAME_CLEAN","INITIAL_INHERIT","IMPORTANT","MIXIN_VAR_SEP","MixinMap","_map","dependants","invalidCallback","ApplyShim","_currentElement","_measureElement","gatherStyles","styleText","styleTextParts","gatherStyleText","transformTemplate","_gatheredStyle","transformStyle","ast","transformRules","transformCustomStyle","rule","transformRule","transformCssText","matchText","propertyName","valueProperty","valueMixin","_produceCssProperties","_consumeCssProperties","_getInitialValueForProperty","all","_fallbacksFromPreviousRules","startRule","topRule","fallbacks","seenStartRule","_cssTextToMap","mixinName","applyPos","afterApplyPos","textBeforeApply","textAfterApply","defaults","replacement","_atApplyToCssProperties","vars","mixinEntry","_replaceInitialOrInherit","out","sp","_invalidateMixinEntry","processVariableAndFallback","inner","suffix","comma","mixinAsProperties","mixinValues","combinedProps","needToInvalidate","templateMap","CURRENT_VERSION","NEXT_VERSION","VALIDATING_VERSION","invalidate","invalidateTemplate","templateIsValid","templateIsValidating","startValidatingTemplate","_validating","applyShim","ScopingShim","applyShimInterface","ApplyShimUtils","ensure","shadowChildren","children","typeExtension","extends","getIsExtends","Debouncer","_asyncModule","_callback","_timer","setConfig","asyncModule","isActive","flush","debouncer","HAS_NATIVE_TA","touchAction","GESTURE_KEY","HANDLED_OBJ","TOUCH_ACTION","TAP_DISTANCE","TRACK_DISTANCE","MOUSE_TIMEOUT","MOUSE_EVENTS","MOUSE_WHICH_TO_BUTTONS","MOUSE_HAS_BUTTONS","MouseEvent","buttons","isMouseEvent","SUPPORTS_PASSIVE","PASSIVE_TOUCH","opts","IS_TOUCH_ONLY","clickedLabels","labellable","button","input","keygen","meter","textarea","progress","select","canBeDisabled","command","fieldset","optgroup","option","canBeLabelled","matchingLabels","labels","getRootNode","matching","mouseCanceller","mouseEvent","sc","sourceCapabilities","firesTouchEvents","skip","clickFromLabel","composedPath","ELEMENT_NODE","ownerLabels","POINTERSTATE","mouse","preventDefault","stopPropagation","setupTeardownMouseCanceller","setup","en","hasLeftMouseButton","ev","which","mouseIgnoreJob","touch","y","scrollDecided","trackDocument","stateObj","movefn","upfn","untrackDocument","debounce","gestures","recognizers","_findOriginalTarget","targets","_handleNative","handled","gobj","gs","changedTouches","touches","identifier","clientX","clientY","ta","firstTouchAction","shouldPrevent","dx","abs","dy","cancelable","prevent","_handleTouchAction","flow","reset","addListener","evType","recognizer","deps","dep","gd","_count","setTouchAction","_add","removeListener","_remove","recog","emits","_fire","Event","bubbles","composed","defaultPrevented","preventer","sourceEvent","evName","_findRecognizerByEvent","downupFire","trackHasMovedEnough","started","trackFire","ddx","secondlast","moves","lastmove","ddy","state","hover","elementFromPoint","deepTargetFind","trackForward","bcr","getBoundingClientRect","pageX","pageY","left","right","top","bottom","isSyntheticClick","mousedown","touchstart","touchend","addMove","move","ct","touchmove","NaN","click","GestureEventListeners","HOST_DIR","HOST_DIR_REPLACMENT","EL_DIR","EL_DIR_REPLACMENT","DIR_INSTANCES","DOCUMENT_DIR","getRTL","documentElement","setRTL","__autoDirOptOut","updateDirection","DirMixin","attributeFilter","elementBase","Dir","_replaceDirInCssText","replacedText","__activateDir","takeRecords","newSplice","EDIT_LEAVE","EDIT_UPDATE","EDIT_ADD","EDIT_DELETE","calcSplices","current","currentStart","currentEnd","oldStart","oldEnd","prefixCount","suffixCount","minLength","min","searchLength","equals","sharedPrefix","index1","index2","sharedSuffix","ops","distances","edits","northWest","west","north","reverse","spliceOperationsFromEditDistances","rowCount","columnCount","calcEditDistances","oldIndex","calculateSplices","currentValue","previousValue","isSlot","FlattenedNodesObserver","assignedNodes","flatten","concat","_shadyChildrenObserver","_nativeChildrenObserver","_connected","_target","_effectiveNodes","_observer","_scheduled","_boundSchedule","_schedule","connect","_listenSlots","observeChildren","mutations","_processMutations","childList","disconnect","_unlistenSlots","unobserveChildren","_processSlotMutations","mutation","addedNodes","removedNodes","newNodes","getFlattenedNodes","didFlush","debouncerQueue","enqueueDebouncer","flushDebouncers","shadyDOM","debouncers","Element","normalizedMatchesSelector","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","DomApi","observeNodes","unobserveNodes","observerHandle","notifyObserver","deepContains","contains","getOwnerRoot","getDistributedNodes","getDestinationInsertionPoints","ip$","assignedSlot","deep","Document","getEffectiveChildNodes","queryDistributedElements","c$","list","c","activeElement","_activeElement","lastChild","lastElementChild","nextElementSibling","previousElementSibling","classList","methods","forwardMethods","forwardReadOnlyProperties","forwardProperties","__domApi","helper","rootTarget","localTarget","styleInterface","LegacyElementMixin","legacyElementBase","DIRECTION_MAP","none","LegacyElement","isAttached","__boundListeners","_debouncers","_applyListeners","created","attached","detached","attributeChanged","__hasRegisterFinished","_registered","_ensureAttributes","serialize","deserialize","reflectPropertyToAttribute","serializeValueToAttribute","extend","api","n$","pd","getOwnPropertyDescriptor","chainObject","__proto__","instanceTemplate","_contentForTemplate","fire","listen","hbl","bl","unlisten","setScrollDirection","direction","$$","slctr","domHost","DocumentFragment","distributeContent","getEffectiveChildren","getEffectiveTextContent","cn","tc","COMMENT_NODE","queryEffectiveChildren","queryAllEffectiveChildren","getContentChildNodes","getContentChildren","isLightDescendant","isLocalDescendant","scopeSubtree","shouldObserve","jobName","wait","bind","isDebouncerActive","flushDebouncer","cancelDebouncer","async","waitTime","cancelAsync","tag","elt","elementMatches","toggleAttribute","bool","toggleClass","remove","transform","transformText","webkitTransform","translate3d","z","arrayDelete","arrayOrPath","_logger","_log","_warn","_error","_logf","_len4","_key4","metaProps","beforeRegister","registered","behaviors","mixinBehaviors","superBehaviors","_mixinBehaviors","GenerateClassFromInfo","flattenBehaviors","exclude","Base","PolymerGenerated","listeners","hostAttributes","generatedFrom","Class","mutablePropertyChange","mutableData","isObject","shouldChange","baseWithBehaviors","MutableData","OptionalMutableData","_mutablePropertyChange","newInstance","HTMLTemplateElementExtension","writable","DataTemplate","MutableDataTemplate","TemplateInstanceBase","_configureProperties","__templatizeInstance","__templatizeOwner","__hideTemplateChildren__","_showHideChildren","__templatizeOptions","instanceProps","forwardHostProp","hprop","__hostProps","iprop","parentModel","templateHost","hide","__polymerTextContent__","__polymerReplaced__","__polymerDisplay__","display","__parentModel","MutableTemplateInstanceBase","findMethodHost","createTemplatizerClass","userNotifyInstanceProp","notifyInstanceProp","createNotifyInstancePropEffect","addNotifyEffects","addPropagateEffects","userForwardHostProp","templatizeTemplateClass","createForwardHostPropEffect","setPrototypeOf","upgradeTemplate","hostProp","instProp","templatize","baseClass","templatizeInstanceClass","modelForElement","domBindBase","__children","__removeChildren","__insertChildren","domRepeatBase","DomRepeat","as","indexAs","itemsIndexAs","sort","Function","renderedItemCount","initialCount","targetFramerate","_targetFrameTime","__instances","__limit","Infinity","__pool","__renderDebouncer","__itemsIdxToInstIdx","__chunkCount","__lastChunkTime","__sortFn","__filterFn","__observePaths","__ctor","__isDetached","__detachInstance","__attachInstance","__ensureTemplatized","__render","i$","__getMethodHost","__functionFromPropertyValue","functionOrMethodName","__sortChanged","__debounceRender","__filterChanged","__computeFrameTime","rate","ceil","__initializeChunking","performance","now","__tryRenderChunk","__requestRenderChunk","__renderChunk","currChunkTime","ratio","round","__observeChanged","__itemsChanged","change","__handleItemPath","__handleObservedPaths","paths","__applyFullRefresh","_setRenderedItemCount","isntIdxToItemsIdx","itemsIdxToInstIdx","instIdx","limit","itemIdx","__insertInstance","__detachAndRemoveInstance","__stampInstance","beforeRow","beforeNode","hidden","itemsPath","dot","itemsIdx","parseInt","itemSubPath","itemPath","itemForElement","indexForElement","DomIf","if","restamp","__invalidProps","__instance","_lastIf","__teardownInstance","__ensureInstance","__syncHostProperties","baseArraySelector","multi","selected","selectedItem","toggle","__lastItems","__lastMulti","__selectedMap","__updateSelection","itemsInfo","newItems","lastItems","clearSelection","__applySplices","__deselectChangedIdx","__updateLinks","sidx","delete","isSelected","isIndexSelected","__selectedIndexForItemIndex","deselect","deselectIndex","selectIndex","ArraySelectorMixin","ArraySelector","getStyle","cssFromModules","IronFitBehavior","sizingTarget","fitInto","noOverlap","positionTarget","horizontalAlign","verticalAlign","dynamicAlign","horizontalOffset","verticalOffset","autoFitOnAttach","_fitInfo","_fitWidth","innerWidth","width","_fitHeight","innerHeight","height","_fitLeft","_fitTop","_defaultPositionTarget","_localeHorizontalAlign","_isRTL","__shouldPosition","fit","__deferredFit","position","constrain","center","_discoverInfo","sizer","inlineStyle","sizerInlineStyle","maxWidth","maxHeight","boxSizing","positionedBy","vertically","horizontally","sizedBy","minWidth","minHeight","margin","marginTop","marginRight","marginBottom","marginLeft","resetFit","refit","scrollLeft","scrollTop","rect","positionRect","__getNormalizedRect","fitRect","__getPosition","max","__sizeDimension","_sizeDimension","extent","flip","offset","offsetExtent","sizingOffset","__getOffscreenArea","verticalCrop","horizontalCrop","hAlign","vAlign","sizeNoMargins","positions","copy","candidate","vAlignOk","hAlignOk","alignOk","offscreenArea","diff","ORPHANS","IronResizableBehavior","_parentResizable","_notifyingDescendant","iron-request-resize-notifications","_interestedResizables","_boundNotifyResize","notifyResize","_boundOnDescendantIronResize","_onDescendantIronResize","_requestResizeNotifications","stopResizeNotificationsFor","resizable","resizerShouldNotify","_notifyDescendant","_fireResize","assignParentResizable","parentResizable","_subscribeIronResize","_unsubscribeIronResize","_onIronRequestResizeNotifications","_parentResizableChanged","descendant","readystatechanged","_findParent","orphan","IronFocusablesHelper","getTabbableNodes","_collectTabbableNodes","_sortByTabIndex","isFocusable","isTabbable","_isVisible","_normalizedTabIndex","tabIndex","needsSort","visibility","tabbables","pivot","_mergeSortByTabIndex","_hasLowerTabOrder","ati","bti","opened","transitionend","__openedRaf","_openedChanged","prepare","complete","_onTransitionend","transitionDuration","opacity","cancelAnimationFrame","KEY_IDENTIFIER","U+0008","U+0009","U+001B","U+0020","U+007F","KEY_CODE","8","9","13","27","33","34","35","36","32","37","38","39","40","46","106","MODIFIER_KEYS","ctrl","alt","KEY_CHAR","IDENT_CHAR","ARROW_KEY","SPACE_KEY","ESC_KEY","transformKey","noSpecialChars","validKey","lKey","normalizedKeyForEvent","keyEvent","keyIdent","fromCharCode","transformKeyIdentifier","keyIdentifier","keyCode","transformKeyCode","keyComboMatchesEvent","keyCombo","hasModifiers","shiftKey","ctrlKey","altKey","metaKey","parseEventString","eventString","keyComboString","combo","parsedKeyCombo","keyComboPart","eventParts","keyName","parseKeyComboString","IronA11yKeysBehavior","keyCombos","IronOverlayManagerClass","_overlays","_minimumZ","_backdropElement","_onCaptureClick","_onCaptureFocus","_onCaptureKeyDown","backdropElement","deepActiveElement","active","_bringOverlayAtIndexToFront","overlay","lastI","currentOverlay","_shouldBeBehindOverlay","minimumZ","currentOverlayZ","_getZ","_applyOverlayZ","addOrRemoveOverlay","addOverlay","removeOverlay","trackBackdrop","insertionIndex","newZ","previousOverlay","ensureMinimumZ","focusOverlay","_applyFocus","_overlayWithBackdrop","zIndex","getBackdrops","backdrops","withBackdrop","backdropZ","z1","_setZ","aboveZ","_overlayInPath","_manager","allowClickThrough","_onCaptureEsc","_onCaptureTab","overlay1","overlay2","alwaysOnTop","IronOverlayManager","_boundScrollHandler","currentLockingElement","lastTouchPosition","lastRootTarget","lastScrollableNodes","scrollEvents","pushScrollLock","_lockingElements","scrollables","lockingIndex","overflow","_getScrollableNodes","deltaX","deltaY","wheelDeltaX","wheelDeltaY","wheelDelta","axis","targetTouches","_getScrollInfo","verticalScroll","scrollHeight","clientHeight","scrollWidth","clientWidth","_getScrollingNode","_shouldPreventScrolling","_lockScrollInteractions","_lockedElementCache","_unlockedElementCache","removeScrollLock","_unlockScrollInteractions","IronOverlayBehavior","canceled","noAutoFocus","noCancelOnEscKey","noCancelOnOutsideClick","closingReason","restoreFocusOnClose","scrollAction","_focusedChild","iron-resize","_focusNode","_focusableNodes","__isAnimating","__shouldRemoveTabIndex","__firstFocusableNode","__lastFocusableNode","__rafs","__restoreFocusNode","__scrollTop","__scrollLeft","__onCaptureScroll","__rootNodes","_ensureSetup","_onNodesChange","_finishRenderOpened","_finishRenderClosed","_setCanceled","invalidateTabbables","_overlaySetup","outline","__deraf","__openedChanged","_canceledChanged","_withBackdropChanged","_prepareRenderOpened","_preparePositioning","_finishPositioning","blur","focus","_renderOpened","_renderClosed","transition","webkitTransition","__ensureFirstLastFocusables","nodeToCheck","nodeToSet","shouldWrap","focusedNode","_onIronResize","focusableNodes","jobname","rafs","__updateScrollObservers","__isValidScrollAction","__saveScrollPosition","__addScrollListeners","__removeScrollListeners","__restoreScrollPosition","scrollingElement","ZuiDialogBehaviorMixin","noCancelOutsideDialog","_closeOptionsChanged","hideBackdrop","_hideBackdropChanged","_onDialogClick","_triggerCloseEvent","val","afterNextRender","disabled","loading","slot","iconHtml","loadingHtml","textSlot","noIcon","_computeIcon"],"mappings":";;;;;;;;;;;;;GA0DO,MAAMA,EAA2B,UA1BtCC,2BACIC,EAAkBC,EAAcC,EAChCC,GACF,MAAMC,EAASH,EAAK,GACpB,MAAe,MAAXG,EACe,IAAIC,EAAA,EAAkBL,EAASC,EAAKK,MAAM,GAAIJ,GAC/CG,MAEH,MAAXD,GACM,IAAIC,EAAA,EAAUL,EAASC,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h3B,eACE,OAAO/H;;;;MAOTuD,SACE,IAAI6vD,EAAW,GAYf,OATEA,EADEv8D,KAAKuS,KACIpJ;0BACSnJ,KAAKuS;QAGdpJ;;QAKNA;QACHnJ,KAAKkR,qCAAqClR,KAAKo8D,cAAcG;SC/BrEn0D,eAAe0I,OAAO,kCAzBQlI,IAC5B+C,wBACE,SAGFmC,cACE/J,QAGFmN,eACE,OAAO/H;;;;MAOTuD,SACE,OAAOvD;QACHnJ,KAAKkR;+ECsFb9I,eAAe0I,OAAO,yBA/EAlI,IACpB+C,wBACE,OAMElE,MACEA,KAAM3G,OACNkV,SAAS,GAMX0mD,QACEj1D,KAAMoD,QACNmG,UAAW,YAKjBrI,oBACE5E,MAAM4E,oBAED3I,KAAKyH,OACRzH,KAAKyH,KAAO,QAIhByJ,eACE,OAAO/H;;;;MAOTuD,SACE,OAAOvD;QACHnJ,KAAKkR;2CAC8BlR,KAAK28D,aAAa38D,KAAKyH;;MAUhEk1D,aAAal1D,GAEX,IAAI8K,OAAO/R,EAEX,OAAQiH,GACN,IAAK,OACH8K,EAAO,OACP,MAEF,IAAK,UAIL,IAAK,QACHA,EAAO,eACP,MAEF,QACEA,EAAO,OAIX,aAAoBA,OCpFxBnK,eAAe0I,OAAO,gCAjBMlI,IAC1BsI,eACE,OAAO/H;;;;MAOTuD,SACE,OAAOvD;QACHnJ,KAAKkR","file":"2.built.js","sourcesContent":["/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\nimport {AttributeCommitter, BooleanAttributePart, EventPart, NodePart, PropertyCommitter} from './parts.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\n\n/**\n * Creates Parts when a template is instantiated.\n */\nexport class DefaultTemplateProcessor implements TemplateProcessor {\n  /**\n   * Create parts for an attribute-position binding, given the event, attribute\n   * name, and string literals.\n   *\n   * @param element The element containing the binding\n   * @param name  The attribute name\n   * @param strings The string literals. There are always at least two strings,\n   *   event for fully-controlled bindings with a single expression.\n   */\n  handleAttributeExpressions(\n      element: Element, name: string, strings: string[],\n      options: RenderOptions): Part[] {\n    const prefix = name[0];\n    if (prefix === '.') {\n      const comitter = new PropertyCommitter(element, name.slice(1), strings);\n      return comitter.parts;\n    }\n    if (prefix === '@') {\n      return [new EventPart(element, name.slice(1), options.eventContext)];\n    }\n    if (prefix === '?') {\n      return [new BooleanAttributePart(element, name.slice(1), strings)];\n    }\n    const comitter = new AttributeCommitter(element, name, strings);\n    return comitter.parts;\n  }\n  /**\n   * Create parts for a text-position binding.\n   * @param templateFactory\n   */\n  handleTextExpression(options: RenderOptions) {\n    return new NodePart(options);\n  }\n}\n\nexport const defaultTemplateProcessor = new DefaultTemplateProcessor();\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {defaultTemplateProcessor} from './lib/default-template-processor.js';\nimport {SVGTemplateResult, TemplateResult} from './lib/template-result.js';\n\nexport {DefaultTemplateProcessor, defaultTemplateProcessor} from './lib/default-template-processor.js';\nexport {directive, DirectiveFn, isDirective} from './lib/directive.js';\n// TODO(justinfagnani): remove line when we get NodePart moving methods\nexport {removeNodes, reparentNodes} from './lib/dom.js';\nexport {noChange, Part} from './lib/part.js';\nexport {AttributeCommitter, AttributePart, BooleanAttributePart, EventPart, isPrimitive, NodePart, PropertyCommitter, PropertyPart} from './lib/parts.js';\nexport {parts, render} from './lib/render.js';\nexport {templateCaches, templateFactory} from './lib/template-factory.js';\nexport {TemplateInstance} from './lib/template-instance.js';\nexport {SVGTemplateResult, TemplateResult} from './lib/template-result.js';\nexport {createMarker, isTemplatePartActive, Template} from './lib/template.js';\n\n/**\n * Interprets a template literal as an HTML template that can efficiently\n * render to and update a container.\n */\nexport const html = (strings: TemplateStringsArray, ...values: any[]) =>\n    new TemplateResult(strings, values, 'html', defaultTemplateProcessor);\n\n/**\n * Interprets a template literal as an SVG template that can efficiently\n * render to and update a container.\n */\nexport const svg = (strings: TemplateStringsArray, ...values: any[]) =>\n    new SVGTemplateResult(strings, values, 'svg', defaultTemplateProcessor);\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isDirective} from './directive.js';\nimport {removeNodes} from './dom.js';\nimport {noChange, Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateInstance} from './template-instance.js';\nimport {TemplateResult} from './template-result.js';\nimport {createMarker} from './template.js';\n\nexport const isPrimitive = (value: any) =>\n    (value === null ||\n     !(typeof value === 'object' || typeof value === 'function'));\n\n/**\n * Sets attribute values for AttributeParts, so that the value is only set once\n * even if there are multiple parts for an attribute.\n */\nexport class AttributeCommitter {\n  element: Element;\n  name: string;\n  strings: string[];\n  parts: AttributePart[];\n  dirty = true;\n\n  constructor(element: Element, name: string, strings: string[]) {\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n    this.parts = [];\n    for (let i = 0; i < strings.length - 1; i++) {\n      this.parts[i] = this._createPart();\n    }\n  }\n\n  /**\n   * Creates a single part. Override this to create a differnt type of part.\n   */\n  protected _createPart(): AttributePart {\n    return new AttributePart(this);\n  }\n\n  protected _getValue(): any {\n    const strings = this.strings;\n    const l = strings.length - 1;\n    let text = '';\n\n    for (let i = 0; i < l; i++) {\n      text += strings[i];\n      const part = this.parts[i];\n      if (part !== undefined) {\n        const v = part.value;\n        if (v != null &&\n            (Array.isArray(v) || typeof v !== 'string' && v[Symbol.iterator])) {\n          for (const t of v) {\n            text += typeof t === 'string' ? t : String(t);\n          }\n        } else {\n          text += typeof v === 'string' ? v : String(v);\n        }\n      }\n    }\n\n    text += strings[l];\n    return text;\n  }\n\n  commit(): void {\n    if (this.dirty) {\n      this.dirty = false;\n      this.element.setAttribute(this.name, this._getValue());\n    }\n  }\n}\n\nexport class AttributePart implements Part {\n  committer: AttributeCommitter;\n  value: any = undefined;\n\n  constructor(comitter: AttributeCommitter) {\n    this.committer = comitter;\n  }\n\n  setValue(value: any): void {\n    if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n      this.value = value;\n      // If the value is a not a directive, dirty the committer so that it'll\n      // call setAttribute. If the value is a directive, it'll dirty the\n      // committer if it calls setValue().\n      if (!isDirective(value)) {\n        this.committer.dirty = true;\n      }\n    }\n  }\n\n  commit() {\n    while (isDirective(this.value)) {\n      const directive = this.value;\n      this.value = noChange;\n      directive(this);\n    }\n    if (this.value === noChange) {\n      return;\n    }\n    this.committer.commit();\n  }\n}\n\nexport class NodePart implements Part {\n  options: RenderOptions;\n  startNode!: Node;\n  endNode!: Node;\n  value: any = undefined;\n  _pendingValue: any = undefined;\n\n  constructor(options: RenderOptions) {\n    this.options = options;\n  }\n\n  /**\n   * Inserts this part into a container.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendInto(container: Node) {\n    this.startNode = container.appendChild(createMarker());\n    this.endNode = container.appendChild(createMarker());\n  }\n\n  /**\n   * Inserts this part between `ref` and `ref`'s next sibling. Both `ref` and\n   * its next sibling must be static, unchanging nodes such as those that appear\n   * in a literal section of a template.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterNode(ref: Node) {\n    this.startNode = ref;\n    this.endNode = ref.nextSibling!;\n  }\n\n  /**\n   * Appends this part into a parent part.\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  appendIntoPart(part: NodePart) {\n    part._insert(this.startNode = createMarker());\n    part._insert(this.endNode = createMarker());\n  }\n\n  /**\n   * Appends this part after `ref`\n   *\n   * This part must be empty, as its contents are not automatically moved.\n   */\n  insertAfterPart(ref: NodePart) {\n    ref._insert(this.startNode = createMarker());\n    this.endNode = ref.endNode;\n    ref.endNode = this.startNode;\n  }\n\n  setValue(value: any): void {\n    this._pendingValue = value;\n  }\n\n  commit() {\n    while (isDirective(this._pendingValue)) {\n      const directive = this._pendingValue;\n      this._pendingValue = noChange;\n      directive(this);\n    }\n    const value = this._pendingValue;\n    if (value === noChange) {\n      return;\n    }\n    if (isPrimitive(value)) {\n      if (value !== this.value) {\n        this._commitText(value);\n      }\n    } else if (value instanceof TemplateResult) {\n      this._commitTemplateResult(value);\n    } else if (value instanceof Node) {\n      this._commitNode(value);\n    } else if (Array.isArray(value) || value[Symbol.iterator]) {\n      this._commitIterable(value);\n    } else if (value.then !== undefined) {\n      this._commitPromise(value);\n    } else {\n      // Fallback, will render the string representation\n      this._commitText(value);\n    }\n  }\n\n  private _insert(node: Node) {\n    this.endNode.parentNode!.insertBefore(node, this.endNode);\n  }\n\n  private _commitNode(value: Node): void {\n    if (this.value === value) {\n      return;\n    }\n    this.clear();\n    this._insert(value);\n    this.value = value;\n  }\n\n  private _commitText(value: string): void {\n    const node = this.startNode.nextSibling!;\n    value = value == null ? '' : value;\n    if (node === this.endNode.previousSibling &&\n        node.nodeType === Node.TEXT_NODE) {\n      // If we only have a single text node between the markers, we can just\n      // set its value, rather than replacing it.\n      // TODO(justinfagnani): Can we just check if this.value is primitive?\n      node.textContent = value;\n    } else {\n      this._commitNode(document.createTextNode(\n          typeof value === 'string' ? value : String(value)));\n    }\n    this.value = value;\n  }\n\n  private _commitTemplateResult(value: TemplateResult): void {\n    const template = this.options.templateFactory(value);\n    if (this.value && this.value.template === template) {\n      this.value.update(value.values);\n    } else {\n      // Make sure we propagate the template processor from the TemplateResult\n      // so that we use its syntax extension, etc. The template factory comes\n      // from the render function options so that it can control template\n      // caching and preprocessing.\n      const instance =\n          new TemplateInstance(template, value.processor, this.options);\n      const fragment = instance._clone();\n      instance.update(value.values);\n      this._commitNode(fragment);\n      this.value = instance;\n    }\n  }\n\n  private _commitIterable(value: any): void {\n    // For an Iterable, we create a new InstancePart per item, then set its\n    // value to the item. This is a little bit of overhead for every item in\n    // an Iterable, but it lets us recurse easily and efficiently update Arrays\n    // of TemplateResults that will be commonly returned from expressions like:\n    // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n\n    // If _value is an array, then the previous render was of an\n    // iterable and _value will contain the NodeParts from the previous\n    // render. If _value is not an array, clear this part and make a new\n    // array for NodeParts.\n    if (!Array.isArray(this.value)) {\n      this.value = [];\n      this.clear();\n    }\n\n    // Lets us keep track of how many items we stamped so we can clear leftover\n    // items from a previous render\n    const itemParts = this.value as NodePart[];\n    let partIndex = 0;\n    let itemPart: NodePart|undefined;\n\n    for (const item of value) {\n      // Try to reuse an existing part\n      itemPart = itemParts[partIndex];\n\n      // If no existing part, create a new one\n      if (itemPart === undefined) {\n        itemPart = new NodePart(this.options);\n        itemParts.push(itemPart);\n        if (partIndex === 0) {\n          itemPart.appendIntoPart(this);\n        } else {\n          itemPart.insertAfterPart(itemParts[partIndex - 1]);\n        }\n      }\n      itemPart.setValue(item);\n      itemPart.commit();\n      partIndex++;\n    }\n\n    if (partIndex < itemParts.length) {\n      // Truncate the parts array so _value reflects the current state\n      itemParts.length = partIndex;\n      this.clear(itemPart && itemPart!.endNode);\n    }\n  }\n\n  private _commitPromise(value: Promise<any>): void {\n    this.value = value;\n    value.then((v: any) => {\n      if (this.value === value) {\n        this.setValue(v);\n        this.commit();\n      }\n    });\n  }\n\n  clear(startNode: Node = this.startNode) {\n    removeNodes(\n        this.startNode.parentNode!, startNode.nextSibling!, this.endNode);\n  }\n}\n\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nexport class BooleanAttributePart implements Part {\n  element: Element;\n  name: string;\n  strings: string[];\n  value: any = undefined;\n  _pendingValue: any = undefined;\n\n  constructor(element: Element, name: string, strings: string[]) {\n    if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n      throw new Error(\n          'Boolean attributes can only contain a single expression');\n    }\n    this.element = element;\n    this.name = name;\n    this.strings = strings;\n  }\n\n  setValue(value: any): void {\n    this._pendingValue = value;\n  }\n\n  commit() {\n    while (isDirective(this._pendingValue)) {\n      const directive = this._pendingValue;\n      this._pendingValue = noChange;\n      directive(this);\n    }\n    if (this._pendingValue === noChange) {\n      return;\n    }\n    const value = !!this._pendingValue;\n    if (this.value !== value) {\n      if (value) {\n        this.element.setAttribute(this.name, '');\n      } else {\n        this.element.removeAttribute(this.name);\n      }\n    }\n    this.value = value;\n    this._pendingValue = noChange;\n  }\n}\n\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nexport class PropertyCommitter extends AttributeCommitter {\n  single: boolean;\n\n  constructor(element: Element, name: string, strings: string[]) {\n    super(element, name, strings);\n    this.single =\n        (strings.length === 2 && strings[0] === '' && strings[1] === '');\n  }\n\n  protected _createPart(): PropertyPart {\n    return new PropertyPart(this);\n  }\n\n  _getValue() {\n    if (this.single) {\n      return this.parts[0].value;\n    }\n    return super._getValue();\n  }\n\n  commit(): void {\n    if (this.dirty) {\n      this.dirty = false;\n      (this.element as any)[this.name] = this._getValue();\n    }\n  }\n}\n\nexport class PropertyPart extends AttributePart {}\n\n// Detect event listener options support. If the `capture` property is read\n// from the options object, then options are supported. If not, then the thrid\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the `capture` property.\nlet eventOptionsSupported = false;\n\ntry {\n  const options = {\n    get capture() {\n      eventOptionsSupported = true;\n      return false;\n    }\n  };\n  window.addEventListener('test', options as any, options);\n  window.removeEventListener('test', options as any, options);\n} catch (_e) {\n}\n\nexport class EventPart implements Part {\n  element: Element;\n  eventName: string;\n  eventContext?: EventTarget;\n  value: any = undefined;\n  _options?: AddEventListenerOptions;\n  _pendingValue: any = undefined;\n  _boundHandleEvent: (event: Event) => void;\n\n  constructor(element: Element, eventName: string, eventContext?: EventTarget) {\n    this.element = element;\n    this.eventName = eventName;\n    this.eventContext = eventContext;\n    this._boundHandleEvent = (e) => this.handleEvent(e);\n  }\n\n  setValue(value: any): void {\n    this._pendingValue = value;\n  }\n\n  commit() {\n    while (isDirective(this._pendingValue)) {\n      const directive = this._pendingValue;\n      this._pendingValue = noChange;\n      directive(this);\n    }\n    if (this._pendingValue === noChange) {\n      return;\n    }\n\n    const newListener = this._pendingValue;\n    const oldListener = this.value;\n    const shouldRemoveListener = newListener == null ||\n        oldListener != null &&\n            (newListener.capture !== oldListener.capture ||\n             newListener.once !== oldListener.once ||\n             newListener.passive !== oldListener.passive);\n    const shouldAddListener =\n        newListener != null && (oldListener == null || shouldRemoveListener);\n\n    if (shouldRemoveListener) {\n      this.element.removeEventListener(\n          this.eventName, this._boundHandleEvent, this._options);\n    }\n    this._options = getOptions(newListener);\n    if (shouldAddListener) {\n      this.element.addEventListener(\n          this.eventName, this._boundHandleEvent, this._options);\n    }\n    this.value = newListener;\n    this._pendingValue = noChange;\n  }\n\n  handleEvent(event: Event) {\n    if (typeof this.value === 'function') {\n      this.value.call(this.eventContext || this.element, event);\n    } else {\n      this.value.handleEvent(event);\n    }\n  }\n}\n\n// We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads `capture` if the argument is an object.\nconst getOptions = (o: any) => o &&\n    (eventOptionsSupported ?\n         {capture: o.capture, passive: o.passive, once: o.once} :\n         o.capture);\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, not attribute positions,\n * in template.\n */\nexport const nodeMarker = `<!--${marker}-->`;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\nexport const rewritesStyleAttribute = (() => {\n  const el = document.createElement('div');\n  el.setAttribute('style', '{{bad value}}');\n  return el.getAttribute('style') !== '{{bad value}}';\n})();\n\n/**\n * An updateable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n  parts: TemplatePart[] = [];\n  element: HTMLTemplateElement;\n\n  constructor(result: TemplateResult, element: HTMLTemplateElement) {\n    this.element = element;\n    let index = -1;\n    let partIndex = 0;\n    const nodesToRemove: Node[] = [];\n    const _prepareTemplate = (template: HTMLTemplateElement) => {\n      const content = template.content;\n      // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be\n      // null\n      const walker = document.createTreeWalker(\n          content,\n          133 /* NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT |\n                 NodeFilter.SHOW_TEXT */\n          ,\n          null as any,\n          false);\n      // The actual previous node, accounting for removals: if a node is removed\n      // it will never be the previousNode.\n      let previousNode: Node|undefined;\n      // Used to set previousNode at the top of the loop.\n      let currentNode: Node|undefined;\n      while (walker.nextNode()) {\n        index++;\n        previousNode = currentNode;\n        const node = currentNode = walker.currentNode as Element;\n        if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n          if (node.hasAttributes()) {\n            const attributes = node.attributes;\n            // Per\n            // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n            // attributes are not guaranteed to be returned in document order.\n            // In particular, Edge/IE can return them out of order, so we cannot\n            // assume a correspondance between part index and attribute index.\n            let count = 0;\n            for (let i = 0; i < attributes.length; i++) {\n              if (attributes[i].value.indexOf(marker) >= 0) {\n                count++;\n              }\n            }\n            while (count-- > 0) {\n              // Get the template literal section leading up to the first\n              // expression in this attribute\n              const stringForPart = result.strings[partIndex];\n              // Find the attribute name\n              const name = lastAttributeNameRegex.exec(stringForPart)![2];\n              // Find the corresponding attribute\n              // If the attribute name contains special characters, lower-case\n              // it so that on XML nodes with case-sensitive getAttribute() we\n              // can still find the attribute, which will have been lower-cased\n              // by the parser.\n              //\n              // If the attribute name doesn't contain special character, it's\n              // important to _not_ lower-case it, in case the name is\n              // case-sensitive, like with XML attributes like \"viewBox\".\n              const attributeLookupName =\n                  (rewritesStyleAttribute && name === 'style') ?\n                  'style$' :\n                  /^[a-zA-Z-]*$/.test(name) ? name : name.toLowerCase();\n              const attributeValue = node.getAttribute(attributeLookupName)!;\n              const strings = attributeValue.split(markerRegex);\n              this.parts.push({type: 'attribute', index, name, strings});\n              node.removeAttribute(attributeLookupName);\n              partIndex += strings.length - 1;\n            }\n          }\n          if (node.tagName === 'TEMPLATE') {\n            _prepareTemplate(node as HTMLTemplateElement);\n          }\n        } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n          const nodeValue = node.nodeValue!;\n          if (nodeValue.indexOf(marker) < 0) {\n            continue;\n          }\n          const parent = node.parentNode!;\n          const strings = nodeValue.split(markerRegex);\n          const lastIndex = strings.length - 1;\n          // We have a part for each match found\n          partIndex += lastIndex;\n          // Generate a new text node for each literal section\n          // These nodes are also used as the markers for node parts\n          for (let i = 0; i < lastIndex; i++) {\n            parent.insertBefore(\n                (strings[i] === '') ? createMarker() :\n                                      document.createTextNode(strings[i]),\n                node);\n            this.parts.push({type: 'node', index: index++});\n          }\n          parent.insertBefore(\n              strings[lastIndex] === '' ?\n                  createMarker() :\n                  document.createTextNode(strings[lastIndex]),\n              node);\n          nodesToRemove.push(node);\n        } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n          if (node.nodeValue === marker) {\n            const parent = node.parentNode!;\n            // Add a new marker node to be the startNode of the Part if any of\n            // the following are true:\n            //  * We don't have a previousSibling\n            //  * previousSibling is being removed (thus it's not the\n            //    `previousNode`)\n            //  * previousSibling is not a Text node\n            //\n            // TODO(justinfagnani): We should be able to use the previousNode\n            // here as the marker node and reduce the number of extra nodes we\n            // add to a template. See\n            // https://github.com/PolymerLabs/lit-html/issues/147\n            const previousSibling = node.previousSibling;\n            if (previousSibling === null || previousSibling !== previousNode ||\n                previousSibling.nodeType !== Node.TEXT_NODE) {\n              parent.insertBefore(createMarker(), node);\n            } else {\n              index--;\n            }\n            this.parts.push({type: 'node', index: index++});\n            nodesToRemove.push(node);\n            // If we don't have a nextSibling add a marker node.\n            // We don't have to check if the next node is going to be removed,\n            // because that node will induce a new marker if so.\n            if (node.nextSibling === null) {\n              parent.insertBefore(createMarker(), node);\n            } else {\n              index--;\n            }\n            currentNode = previousNode;\n            partIndex++;\n          } else {\n            let i = -1;\n            while ((i = node.nodeValue!.indexOf(marker, i + 1)) !== -1) {\n              // Comment node has a binding marker inside, make an inactive part\n              // The binding won't work, but subsequent bindings will\n              // TODO (justinfagnani): consider whether it's even worth it to\n              // make bindings in comments work\n              this.parts.push({type: 'node', index: -1});\n            }\n          }\n        }\n      }\n    };\n    _prepareTemplate(element);\n    // Remove text binding nodes after the walk to not disturb the TreeWalker\n    for (const n of nodesToRemove) {\n      n.parentNode!.removeChild(n);\n    }\n  }\n}\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n  type: 'node',\n  index: number\n}|{type: 'attribute', index: number, name: string, strings: string[]};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#attributes-0\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-character\n *\n * So an attribute is:\n *  * The name: any character except a control character, space character, ('),\n *    (\"), \">\", \"=\", or \"/\"\n *  * Followed by zero or more space characters\n *  * Followed by \"=\"\n *  * Followed by zero or more space characters\n *  * Followed by:\n *    * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n *    * (\") then any non-(\"), or\n *    * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n    /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \\x09\\x0a\\x0c\\x0d\"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nexport const isCEPolyfill = window.customElements !== undefined &&\n    (window.customElements as any).polyfillWrapFlushCallback !== undefined;\n\n/**\n * Reparents nodes, starting from `startNode` (inclusive) to `endNode`\n * (exclusive), into another container (could be the same container), before\n * `beforeNode`. If `beforeNode` is null, it appends the nodes to the\n * container.\n */\nexport const reparentNodes =\n    (container: Node,\n     start: Node|null,\n     end: Node|null = null,\n     before: Node|null = null): void => {\n      let node = start;\n      while (node !== end) {\n        const n = node!.nextSibling;\n        container.insertBefore(node!, before as Node);\n        node = n;\n      }\n    };\n\n/**\n * Removes nodes, starting from `startNode` (inclusive) to `endNode`\n * (exclusive), from `container`.\n */\nexport const removeNodes =\n    (container: Node, startNode: Node|null, endNode: Node|null = null):\n        void => {\n          let node = startNode;\n          while (node !== endNode) {\n            const n = node!.nextSibling;\n            container.removeChild(node!);\n            node = n;\n          }\n        };\n","export const ZuiBaseMixin = superClass => class extends superClass {\n  connectedCallback() {\n    super.connectedCallback();\n    this.removeAttribute('unresolved');\n  }\n\n};","import { LitElement } from '@polymer/lit-element/lit-element';\nimport { ZuiBaseMixin } from './zui-base-mixin';\n\nclass ZuiBaseElement extends ZuiBaseMixin(LitElement) {}\n\nexport { ZuiBaseElement };","export * from './zui-base';\nexport * from './zui-base-mixin';","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {reparentNodes} from './dom.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {lastAttributeNameRegex, marker, nodeMarker, rewritesStyleAttribute} from './template.js';\n\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n  strings: TemplateStringsArray;\n  values: any[];\n  type: string;\n  processor: TemplateProcessor;\n\n  constructor(\n      strings: TemplateStringsArray, values: any[], type: string,\n      processor: TemplateProcessor) {\n    this.strings = strings;\n    this.values = values;\n    this.type = type;\n    this.processor = processor;\n  }\n\n  /**\n   * Returns a string of HTML used to create a `<template>` element.\n   */\n  getHTML(): string {\n    const l = this.strings.length - 1;\n    let html = '';\n    let isTextBinding = true;\n    for (let i = 0; i < l; i++) {\n      const s = this.strings[i];\n      html += s;\n      const close = s.lastIndexOf('>');\n      // We're in a text position if the previous string closed its last tag, an\n      // attribute position if the string opened an unclosed tag, and unchanged\n      // if the string had no brackets at all:\n      //\n      // \"...>...\": text position. open === -1, close > -1\n      // \"...<...\": attribute position. open > -1\n      // \"...\": no change. open === -1, close === -1\n      isTextBinding =\n          (close > -1 || isTextBinding) && s.indexOf('<', close + 1) === -1;\n\n      if (!isTextBinding && rewritesStyleAttribute) {\n        html = html.replace(lastAttributeNameRegex, (match, p1, p2, p3) => {\n          return (p2 === 'style') ? `${p1}style$${p3}` : match;\n        });\n      }\n      html += isTextBinding ? nodeMarker : marker;\n    }\n    html += this.strings[l];\n    return html;\n  }\n\n  getTemplateElement(): HTMLTemplateElement {\n    const template = document.createElement('template');\n    template.innerHTML = this.getHTML();\n    return template;\n  }\n}\n\n/**\n * A TemplateResult for SVG fragments.\n *\n * This class wraps HTMl in an `<svg>` tag in order to parse its contents in the\n * SVG namespace, then modifies the template to remove the `<svg>` tag so that\n * clones only container the original fragment.\n */\nexport class SVGTemplateResult extends TemplateResult {\n  getHTML(): string {\n    return `<svg>${super.getHTML()}</svg>`;\n  }\n\n  getTemplateElement(): HTMLTemplateElement {\n    const template = super.getTemplateElement();\n    const content = template.content;\n    const svgElement = content.firstChild!;\n    content.removeChild(svgElement);\n    reparentNodes(content, svgElement.firstChild);\n    return template;\n  }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\nimport {Template} from './template.js';\n\n/**\n * A function type that creates a Template from a TemplateResult.\n *\n * This is a hook into the template-creation process for rendering that\n * requires some modification of templates before they're used, like ShadyCSS,\n * which must add classes to elements and remove styles.\n *\n * Templates should be cached as aggressively as possible, so that many\n * TemplateResults produced from the same expression only do the work of\n * creating the Template the first time.\n *\n * Templates are usually cached by TemplateResult.strings and\n * TemplateResult.type, but may be cached by other keys if this function\n * modifies the template.\n *\n * Note that currently TemplateFactories must not add, remove, or reorder\n * expressions, because there is no way to describe such a modification\n * to render() so that values are interpolated to the correct place in the\n * template instances.\n */\nexport type TemplateFactory = (result: TemplateResult) => Template;\n\n/**\n * The default TemplateFactory which caches Templates keyed on\n * result.type and result.strings.\n */\nexport function templateFactory(result: TemplateResult) {\n  let templateCache = templateCaches.get(result.type);\n  if (templateCache === undefined) {\n    templateCache = new Map<TemplateStringsArray, Template>();\n    templateCaches.set(result.type, templateCache);\n  }\n  let template = templateCache.get(result.strings);\n  if (template === undefined) {\n    template = new Template(result, result.getTemplateElement());\n    templateCache.set(result.strings, template);\n  }\n  return template;\n}\n\n// The first argument to JS template tags retain identity across multiple\n// calls to a tag for the same literal, so we can cache work done per literal\n// in a Map.\nexport const templateCaches =\n    new Map<string, Map<TemplateStringsArray, Template>>();\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 = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\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_ = nativeShadow || Boolean(!navigator.userAgent.match(/AppleWebKit\\/601|Edge\\/15/) &&\n      window.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n  }\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\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","import './colors.js';","\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap<any, Boolean>();\n\nexport type DirectiveFn = (part: Part) => void;\n\n/**\n * Brands a function as a directive so that lit-html will call the function\n * during template rendering, rather than passing as a value.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object\n *\n * @example\n *\n * ```\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n *   if (part.value !== v) {\n *     part.setValue(v)\n *   }\n * });\n * ```\n */\nexport const directive = <F extends Function>(f: F): F =>\n    ((...args: any[]) => {\n      const d = f(...args);\n      directives.set(d, true);\n      return d;\n    }) as unknown as F;\n\nexport const isDirective = (o: any) =>\n    typeof o === 'function' && directives.has(o);\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {removeNodes} from './dom.js';\nimport {NodePart} from './parts.js';\nimport {RenderOptions} from './render-options.js';\nimport {templateFactory} from './template-factory.js';\nimport {TemplateResult} from './template-result.js';\n\nexport const parts = new WeakMap<Node, NodePart>();\n\n/**\n * Renders a template to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call `render` with the new result.\n *\n * @param result a TemplateResult created by evaluating a template tag like\n *     `html` or `svg`.\n * @param container A DOM parent to render to. The entire contents are either\n *     replaced, or efficiently updated if the same result type was previous\n *     rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n *     container. Render options must *not* change between renders to the same\n *     container, as those changes will not effect previously rendered DOM.\n */\nexport const render =\n    (result: TemplateResult,\n     container: Element|DocumentFragment,\n     options?: Partial<RenderOptions>) => {\n      let part = parts.get(container);\n      if (part === undefined) {\n        removeNodes(container, container.firstChild);\n        parts.set(container, part = new NodePart({\n                               templateFactory,\n                               ...options,\n                             }));\n        part.appendInto(container);\n      }\n      part.setValue(result);\n      part.commit();\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/** @type {Promise<void>} */\nlet readyPromise = null;\n\n/** @type {?function(?function())} */\nlet whenReady = window['HTMLImports'] && window['HTMLImports']['whenReady'] || null;\n\n/** @type {function()} */\nlet resolveFn;\n\n/**\n * @param {?function()} callback\n */\nexport default function documentWait(callback) {\n  requestAnimationFrame(function() {\n    if (whenReady) {\n      whenReady(callback)\n    } else {\n      if (!readyPromise) {\n        readyPromise = new Promise((resolve) => {resolveFn = resolve});\n        if (document.readyState === 'complete') {\n          resolveFn();\n        } else {\n          document.addEventListener('readystatechange', () => {\n            if (document.readyState === 'complete') {\n              resolveFn();\n            }\n          });\n        }\n      }\n      readyPromise.then(function(){ callback && callback(); });\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 documentWait from './document-wait.js';\n\n/**\n * @typedef {HTMLStyleElement | {getStyle: function():HTMLStyleElement}}\n */\nexport let CustomStyleProvider;\n\nconst SEEN_MARKER = '__seenByShadyCSS';\nconst CACHED_STYLE = '__shadyCSSCachedStyle';\n\n/** @type {?function(!HTMLStyleElement)} */\nlet transformFn = null;\n\n/** @type {?function()} */\nlet validateFn = null;\n\n/**\nThis interface is provided to add document-level <style> elements to ShadyCSS for processing.\nThese styles must be processed by ShadyCSS to simulate ShadowRoot upper-bound encapsulation from outside styles\nIn addition, these styles may also need to be processed for @apply rules and CSS Custom Properties\n\nTo add document-level styles to ShadyCSS, one can call `ShadyCSS.addDocumentStyle(styleElement)` or `ShadyCSS.addDocumentStyle({getStyle: () => styleElement})`\n\nIn addition, if the process used to discover document-level styles can be synchronously flushed, one should set `ShadyCSS.documentStyleFlush`.\nThis function will be called when calculating styles.\n\nAn example usage of the document-level styling api can be found in `examples/document-style-lib.js`\n\n@unrestricted\n*/\nexport default class CustomStyleInterface {\n  constructor() {\n    /** @type {!Array<!CustomStyleProvider>} */\n    this['customStyles'] = [];\n    this['enqueued'] = false;\n    // NOTE(dfreedm): use quotes here to prevent closure inlining to `function(){}`;\n    documentWait(() => {\n      if (window['ShadyCSS']['flushCustomStyles']) {\n        window['ShadyCSS']['flushCustomStyles']();\n      }\n    })\n  }\n  /**\n   * Queue a validation for new custom styles to batch style recalculations\n   */\n  enqueueDocumentValidation() {\n    if (this['enqueued'] || !validateFn) {\n      return;\n    }\n    this['enqueued'] = true;\n    documentWait(validateFn);\n  }\n  /**\n   * @param {!HTMLStyleElement} style\n   */\n  addCustomStyle(style) {\n    if (!style[SEEN_MARKER]) {\n      style[SEEN_MARKER] = true;\n      this['customStyles'].push(style);\n      this.enqueueDocumentValidation();\n    }\n  }\n  /**\n   * @param {!CustomStyleProvider} customStyle\n   * @return {HTMLStyleElement}\n   */\n  getStyleForCustomStyle(customStyle) {\n    if (customStyle[CACHED_STYLE]) {\n      return customStyle[CACHED_STYLE];\n    }\n    let style;\n    if (customStyle['getStyle']) {\n      style = customStyle['getStyle']();\n    } else {\n      style = customStyle;\n    }\n    return style;\n  }\n  /**\n   * @return {!Array<!CustomStyleProvider>}\n   */\n  processStyles() {\n    const cs = this['customStyles'];\n    for (let i = 0; i < cs.length; i++) {\n      const customStyle = cs[i];\n      if (customStyle[CACHED_STYLE]) {\n        continue;\n      }\n      const style = this.getStyleForCustomStyle(customStyle);\n      if (style) {\n        // HTMLImports polyfill may have cloned the style into the main document,\n        // which is referenced with __appliedElement.\n        const styleToTransform = /** @type {!HTMLStyleElement} */(style['__appliedElement'] || style);\n        if (transformFn) {\n          transformFn(styleToTransform);\n        }\n        customStyle[CACHED_STYLE] = styleToTransform;\n      }\n    }\n    return cs;\n  }\n}\n\nCustomStyleInterface.prototype['addCustomStyle'] = CustomStyleInterface.prototype.addCustomStyle;\nCustomStyleInterface.prototype['getStyleForCustomStyle'] = CustomStyleInterface.prototype.getStyleForCustomStyle;\nCustomStyleInterface.prototype['processStyles'] = CustomStyleInterface.prototype.processStyles;\n\nObject.defineProperties(CustomStyleInterface.prototype, {\n  'transformCallback': {\n    /** @return {?function(!HTMLStyleElement)} */\n    get() {\n      return transformFn;\n    },\n    /** @param {?function(!HTMLStyleElement)} fn */\n    set(fn) {\n      transformFn = fn;\n    }\n  },\n  'validateCallback': {\n    /** @return {?function()} */\n    get() {\n      return validateFn;\n    },\n    /**\n     * @param {?function()} fn\n     * @this {CustomStyleInterface}\n     */\n    set(fn) {\n      let needsEnqueue = false;\n      if (!validateFn) {\n        needsEnqueue = true;\n      }\n      validateFn = fn;\n      if (needsEnqueue) {\n        this.enqueueDocumentValidation();\n      }\n    },\n  }\n})\n\n/** @typedef {{\n * customStyles: !Array<!CustomStyleProvider>,\n * addCustomStyle: function(!CustomStyleProvider),\n * getStyleForCustomStyle: function(!CustomStyleProvider): HTMLStyleElement,\n * findStyles: function(),\n * transformCallback: ?function(!HTMLStyleElement),\n * validateCallback: ?function()\n * }}\n */\nexport let CustomStyleInterfaceInterface;\n","/**\n * The Part interface represents a dynamic part of a template instance rendered\n * by lit-html.\n */\nexport interface Part {\n  value: any;\n\n  /**\n   * Sets the current part value, but does not write it to the DOM.\n   * @param value The value that will be committed.\n   */\n  setValue(value: any): void;\n\n  /**\n   * Commits the current part value, cause it to actually be written to the DOM.\n   */\n  commit(): void;\n}\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n\nimport {isCEPolyfill} from './dom.js';\nimport {Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\n// import {TemplateFactory} from './template-factory.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {isTemplatePartActive, Template} from './template.js';\n\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n  _parts: Array<Part|undefined> = [];\n  processor: TemplateProcessor;\n  options: RenderOptions;\n  template: Template;\n\n  constructor(\n      template: Template, processor: TemplateProcessor,\n      options: RenderOptions) {\n    this.template = template;\n    this.processor = processor;\n    this.options = options;\n  }\n\n  update(values: any[]) {\n    let i = 0;\n    for (const part of this._parts) {\n      if (part !== undefined) {\n        part.setValue(values[i]);\n      }\n      i++;\n    }\n    for (const part of this._parts) {\n      if (part !== undefined) {\n        part.commit();\n      }\n    }\n  }\n\n  _clone(): DocumentFragment {\n    // When using the Custom Elements polyfill, clone the node, rather than\n    // importing it, to keep the fragment in the template's document. This\n    // leaves the fragment inert so custom elements won't upgrade and\n    // potentially modify their contents by creating a polyfilled ShadowRoot\n    // while we traverse the tree.\n    const fragment = isCEPolyfill ?\n        this.template.element.content.cloneNode(true) as DocumentFragment :\n        document.importNode(this.template.element.content, true);\n\n    const parts = this.template.parts;\n    let partIndex = 0;\n    let nodeIndex = 0;\n    const _prepareInstance = (fragment: DocumentFragment) => {\n      // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be\n      // null\n      const walker = document.createTreeWalker(\n          fragment,\n          133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n          null as any,\n          false);\n      let node = walker.nextNode();\n      // Loop through all the nodes and parts of a template\n      while (partIndex < parts.length && node !== null) {\n        const part = parts[partIndex];\n        // Consecutive Parts may have the same node index, in the case of\n        // multiple bound attributes on an element. So each iteration we either\n        // increment the nodeIndex, if we aren't on a node with a part, or the\n        // partIndex if we are. By not incrementing the nodeIndex when we find a\n        // part, we allow for the next part to be associated with the current\n        // node if neccessasry.\n        if (!isTemplatePartActive(part)) {\n          this._parts.push(undefined);\n          partIndex++;\n        } else if (nodeIndex === part.index) {\n          if (part.type === 'node') {\n            const part = this.processor.handleTextExpression(this.options);\n            part.insertAfterNode(node);\n            this._parts.push(part);\n          } else {\n            this._parts.push(...this.processor.handleAttributeExpressions(\n                node as Element, part.name, part.strings, this.options));\n          }\n          partIndex++;\n        } else {\n          nodeIndex++;\n          if (node.nodeName === 'TEMPLATE') {\n            _prepareInstance((node as HTMLTemplateElement).content);\n          }\n          node = walker.nextNode();\n        }\n      }\n    };\n    _prepareInstance(fragment);\n    if (isCEPolyfill) {\n      document.adoptNode(fragment);\n      customElements.upgrade(fragment);\n    }\n    return fragment;\n  }\n}\n","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {directive, NodePart, Part, reparentNodes} from '../lit-html.js';\n\ninterface PartCache {\n  truePart: NodePart;\n  falsePart: NodePart;\n  prevCondition?: boolean;\n  cacheContainer: DocumentFragment;\n}\n\nconst partCaches = new WeakMap<NodePart, PartCache>();\n\n/**\n * Efficiently switches between two templates based on the given condition. The\n * rendered content is cached, and re-used when switching conditions. Templates\n * are evaluated lazily, so the passed values must be functions.\n *\n * While this directive can render any regular part, it makes the most sense\n * when used with TemplateResult since most other values are dirty checked\n * already.\n *\n * Example:\n *\n * ```\n * let checked = false;\n *\n * html`\n *   when(checked, () => html`Checkmark is checked`, () => html`Checkmark is not\n * checked`);\n * `\n * ```\n *\n * @param condition the condition to test truthiness against\n * @param trueValue the value to render given a true condition\n * @param falseValue the value to render given a false condition\n */\nexport const when = directive(\n    (condition: any, trueValue: () => any, falseValue: () => any) => (\n        parentPart: Part) => {\n      if (!(parentPart instanceof NodePart)) {\n        throw new Error('when can only be used in text bindings');\n      }\n\n      let cache = partCaches.get(parentPart);\n\n      // Create a new cache if this is the first render\n      if (cache === undefined) {\n        // Cache consists of two parts, one for each condition, and a\n        // docment fragment which we cache the nodes of the condition that's\n        // not currently rendered.\n        cache = {\n          truePart: new NodePart(parentPart.options),\n          falsePart: new NodePart(parentPart.options),\n          cacheContainer: document.createDocumentFragment(),\n        };\n        partCaches.set(parentPart, cache);\n\n        cache.truePart.appendIntoPart(parentPart);\n        cache.falsePart.appendIntoPart(parentPart);\n      }\n\n      // Based on the condition, select which part to render and which value\n      // to set on that part.\n      const nextPart = condition ? cache.truePart : cache.falsePart;\n      const nextValue = condition ? trueValue() : falseValue();\n\n      // If we switched condition, swap nodes to/from the cache.\n      if (!!condition !== cache.prevCondition) {\n        // Get the part which was rendered for the opposite condition. This\n        // should be added to the cache.\n        const prevPart = condition ? cache.falsePart : cache.truePart;\n\n        // If the next part was rendered, take it from the cache\n        if (nextPart.value) {\n          parentPart.startNode.parentNode!.appendChild(cache.cacheContainer);\n        }\n\n        // If the prev part was rendered, move it to the cache\n        if (prevPart.value) {\n          reparentNodes(\n              cache.cacheContainer,\n              prevPart.startNode,\n              prevPart.endNode.nextSibling);\n        }\n      }\n\n      // Set the next part's value\n      nextPart.setValue(nextValue);\n      nextPart.commit();\n\n      cache.prevCondition = !!condition;\n    });\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {directive, Part} from '../lit-html.js';\n\n/**\n * Display `defaultContent` until `promise` resolves.\n */\nexport const until =\n    directive((promise: Promise<any>, defaultContent: any) => (part: Part) => {\n      part.setValue(defaultContent);\n      part.commit();\n      part.setValue(promise);\n    });\n","import { LitElement, html } from '@polymer/lit-element/lit-element';\nimport { when } from 'lit-html/directives/when';\nimport { until } from 'lit-html/directives/until';\nimport '@zywave/zui-colors';\n\nclass SvgCache {\n  constructor() {\n    this.cache = new Map();\n  }\n\n  static get instance() {\n    return this._instance || (this._instance = new this());\n  }\n\n}\n\nclass ZuiSvg extends LitElement {\n  static get properties() {\n    return {\n      svgId: {\n        type: String,\n        attribute: 'svg-id'\n      },\n      file: {\n        type: String\n      }\n    };\n  }\n\n  constructor() {\n    super();\n    this.svgId = '';\n    this.file = '';\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host{pointer-events:none;display:inline-block;width:var(--zui-svg-width, 24px);height:var(--zui-svg-height, 24px);line-height:1;fill:currentColor}:host .svg{pointer-events:inherit;display:inherit;width:inherit;height:inherit;line-height:inherit;fill:inherit;all:inherit}:host(.small){--zui-svg-width: 16px;--zui-svg-height: 16px}:host(.medium){--zui-svg-width: 36px;--zui-svg-height: 36px}:host(.large){--zui-svg-width: 48px;--zui-svg-height: 48px}.svg-defs{display:none}\n      </style>\n    `;\n  }\n\n  render() {\n    let svgNodeClone = undefined;\n\n    if (!this.svgId) {\n      return html`\n        <style>\n          :host {\n            display: none;\n          }\n        </style>\n      `;\n    }\n\n    const svgNode = !this.file ? document.getElementById(this.svgId) : undefined;\n\n    if (svgNode) {\n      svgNodeClone = svgNode.cloneNode(true);\n    }\n\n    const isIE11 = /\\bTrident\\/[567]\\b|\\bMSIE (?:9|10)\\.0\\b/.test(navigator.userAgent);\n\n    if (isIE11 && this.file) {\n      return html`\n        ${until(this._loadSvg(), html`\n              <span class=\"svg-loading\"></span>\n            `)}\n      `;\n    }\n\n    return html`\n      ${this._renderStyle()}\n      ${when(svgNodeClone, () => html`\n              <svg class=\"svg-defs\"><defs>${svgNodeClone}</defs></svg>\n            `, () => html``)} <svg class=\"svg\"><use href=\"${this.file}#${this.svgId}\" xlink:href=\"${this.file}#${this.svgId}\"></use></svg>\n    `;\n  }\n\n  _loadSvg() {\n    let p = undefined;\n\n    if (SvgCache.instance.cache.has(this.file)) {\n      p = SvgCache.instance.cache.get(this.file);\n    } else {\n      p = new Promise((resolve, reject) => {\n        const request = new XMLHttpRequest();\n        request.open('GET', this.file);\n\n        request.onload = () => {\n          if (request.status >= 200 && request.status < 300) {\n            const newDoc = document.implementation.createHTMLDocument('');\n            newDoc.body.innerHTML = request.responseText;\n            resolve(newDoc);\n          } else {\n            reject({\n              status: request.status,\n              statusText: request.statusText\n            });\n          }\n        };\n\n        request.onerror = () => {\n          reject({\n            status: request.status,\n            statusText: request.statusText\n          });\n        };\n\n        request.send();\n      });\n      SvgCache.instance.cache.set(this.file, p);\n    }\n\n    return p.then(doc => this._buildSvg(doc));\n  }\n\n  _buildSvg(doc) {\n    const s = doc.getElementById(`${this.svgId}`).cloneNode(true);\n    return html`\n      <svg class=\"svg-defs\"><defs>${s}</defs></svg>\n      <svg class=\"svg\"><use href=\"#${this.svgId}\" xlink:href=\"#${this.svgId}\"></use></svg>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-svg', ZuiSvg);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\nimport '@zywave/zui-svg';\nimport { when } from 'lit-html/directives/when';\n\nclass ZuiIcon extends ZuiBaseElement {\n  static get properties() {\n    return {\n      icon: {\n        type: String\n      }\n    };\n  }\n\n  constructor() {\n    super();\n    this.icon = '';\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host{display:inline-block;width:var(--zui-icon-size, 24px);height:var(--zui-icon-size, 24px);line-height:1;fill:currentColor}zui-svg{pointer-events:none;display:inherit;width:inherit;height:inherit;line-height:inherit;fill:inherit}:host(.small){width:var(--zui-icon-size, 16px);height:var(--zui-icon-size, 16px)}:host(.medium){width:var(--zui-icon-size, 36px);height:var(--zui-icon-size, 36px)}:host(.large){width:var(--zui-icon-size, 48px);height:var(--zui-icon-size, 48px)}\n      </style>\n    `;\n  }\n\n  render() {\n    return html`\n      ${when(this.icon, () => html`\n            ${this._renderStyle()} <zui-svg svg-id=\"${this.icon}\"></zui-svg>\n          `, () => html`\n              <style>\n                :host {\n                  display: none;\n                }\n              </style>\n            `)}\n    `;\n  }\n\n}\n\ncustomElements.define('zui-icon', ZuiIcon);","/**\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 CustomStyleInterface from '../src/custom-style-interface.js';\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js';\nimport {nativeCssVariables, nativeShadow} from '../src/style-settings.js';\n\nconst customStyleInterface = new CustomStyleInterface();\n\nif (!window.ShadyCSS) {\n  window.ShadyCSS = {\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     * @param {string=} elementExtends\n     */\n    prepareTemplate(template, elementName, elementExtends) {}, // eslint-disable-line no-unused-vars\n\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     */\n    prepareTemplateDom(template, elementName) {}, // eslint-disable-line no-unused-vars\n\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     * @param {string=} elementExtends\n     */\n    prepareTemplateStyles(template, elementName, elementExtends) {}, // eslint-disable-line no-unused-vars\n\n    /**\n     * @param {Element} element\n     * @param {Object=} properties\n     */\n    styleSubtree(element, properties) {\n      customStyleInterface.processStyles();\n      updateNativeProperties(element, properties);\n    },\n\n    /**\n     * @param {Element} element\n     */\n    styleElement(element) { // eslint-disable-line no-unused-vars\n      customStyleInterface.processStyles();\n    },\n\n    /**\n     * @param {Object=} properties\n     */\n    styleDocument(properties) {\n      customStyleInterface.processStyles();\n      updateNativeProperties(document.body, properties);\n    },\n\n    /**\n     * @param {Element} element\n     * @param {string} property\n     * @return {string}\n     */\n    getComputedStyleValue(element, property) {\n      return getComputedStyleValue(element, property);\n    },\n\n    flushCustomStyles() {},\n    nativeCss: nativeCssVariables,\n    nativeShadow: nativeShadow\n  }\n}\n\nwindow.ShadyCSS.CustomStyleInterface = customStyleInterface;","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\nconst walkerNodeFilter =\n    NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT;\n\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n *   div#1 (remove) <-- start removing (removing node is div#1)\n *     div\n *       div#2 (remove)  <-- continue removing (removing node is still div#1)\n *         div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(\n    template: Template, nodesToRemove: Set<Node>) {\n  const {element: {content}, parts} = template;\n  const walker =\n      document.createTreeWalker(content, walkerNodeFilter, null as any, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let part = parts[partIndex];\n  let nodeIndex = -1;\n  let removeCount = 0;\n  const nodesToRemoveInTemplate = [];\n  let currentRemovingNode: Node|null = null;\n  while (walker.nextNode()) {\n    nodeIndex++;\n    const node = walker.currentNode as Element;\n    // End removal if stepped past the removing node\n    if (node.previousSibling === currentRemovingNode) {\n      currentRemovingNode = null;\n    }\n    // A node to remove was found in the template\n    if (nodesToRemove.has(node)) {\n      nodesToRemoveInTemplate.push(node);\n      // Track node we're removing\n      if (currentRemovingNode === null) {\n        currentRemovingNode = node;\n      }\n    }\n    // When removing, increment count by which to adjust subsequent part indices\n    if (currentRemovingNode !== null) {\n      removeCount++;\n    }\n    while (part !== undefined && part.index === nodeIndex) {\n      // If part is in a removed node deactivate it by setting index to -1 or\n      // adjust the index as needed.\n      part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n      // go to the next active part.\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n      part = parts[partIndex];\n    }\n  }\n  nodesToRemoveInTemplate.forEach((n) => n.parentNode!.removeChild(n));\n}\n\nconst countNodes = (node: Node) => {\n  let count = (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) ? 0 : 1;\n  const walker =\n      document.createTreeWalker(node, walkerNodeFilter, null as any, false);\n  while (walker.nextNode()) {\n    count++;\n  }\n  return count;\n};\n\nconst nextActiveIndexInTemplateParts =\n    (parts: TemplatePart[], startIndex: number = -1) => {\n      for (let i = startIndex + 1; i < parts.length; i++) {\n        const part = parts[i];\n        if (isTemplatePartActive(part)) {\n          return i;\n        }\n      }\n      return -1;\n    };\n\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(\n    template: Template, node: Node, refNode: Node|null = null) {\n  const {element: {content}, parts} = template;\n  // If there's no refNode, then put node at end of template.\n  // No part indices need to be shifted in this case.\n  if (refNode === null || refNode === undefined) {\n    content.appendChild(node);\n    return;\n  }\n  const walker =\n      document.createTreeWalker(content, walkerNodeFilter, null as any, false);\n  let partIndex = nextActiveIndexInTemplateParts(parts);\n  let insertCount = 0;\n  let walkerIndex = -1;\n  while (walker.nextNode()) {\n    walkerIndex++;\n    const walkerNode = walker.currentNode as Element;\n    if (walkerNode === refNode) {\n      insertCount = countNodes(node);\n      refNode.parentNode!.insertBefore(node, refNode);\n    }\n    while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n      // If we've inserted the node, simply adjust all subsequent parts\n      if (insertCount > 0) {\n        while (partIndex !== -1) {\n          parts[partIndex].index += insertCount;\n          partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n        }\n        return;\n      }\n      partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n    }\n  }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {insertNodeIntoTemplate, removeNodesFromTemplate} from './modify-template.js';\nimport {RenderOptions} from './render-options.js';\nimport {parts, render as litRender} from './render.js';\nimport {templateCaches} from './template-factory.js';\nimport {TemplateInstance} from './template-instance.js';\nimport {TemplateResult} from './template-result.js';\nimport {Template} from './template.js';\n\nexport {html, svg, TemplateResult} from '../lit-html.js';\n\n\n// Get a key to lookup in `templateCaches`.\nconst getTemplateCacheKey = (type: string, scopeName: string) =>\n    `${type}--${scopeName}`;\n\nlet compatibleShadyCSSVersion = true;\n\nif (typeof window.ShadyCSS === 'undefined') {\n  compatibleShadyCSSVersion = false;\n} else if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') {\n  console.warn(\n      `Incompatible ShadyCSS version detected.` +\n      `Please update to at least @webcomponents/webcomponentsjs@2.0.2 and` +\n      `@webcomponents/shadycss@1.3.1.`);\n  compatibleShadyCSSVersion = false;\n}\n\n/**\n * Template factory which scopes template DOM using ShadyCSS.\n * @param scopeName {string}\n */\nconst shadyTemplateFactory = (scopeName: string) =>\n    (result: TemplateResult) => {\n      const cacheKey = getTemplateCacheKey(result.type, scopeName);\n      let templateCache = templateCaches.get(cacheKey);\n      if (templateCache === undefined) {\n        templateCache = new Map<TemplateStringsArray, Template>();\n        templateCaches.set(cacheKey, templateCache);\n      }\n      let template = templateCache.get(result.strings);\n      if (template === undefined) {\n        const element = result.getTemplateElement();\n        if (compatibleShadyCSSVersion) {\n          window.ShadyCSS!.prepareTemplateDom(element, scopeName);\n        }\n        template = new Template(result, element);\n        templateCache.set(result.strings, template);\n      }\n      return template;\n    };\n\n\nconst TEMPLATE_TYPES = ['html', 'svg'];\n\n/**\n * Removes all style elements from Templates for the given scopeName.\n */\nconst removeStylesFromLitTemplates = (scopeName: string) => {\n  TEMPLATE_TYPES.forEach((type) => {\n    const templates = templateCaches.get(getTemplateCacheKey(type, scopeName));\n    if (templates !== undefined) {\n      templates.forEach((template) => {\n        const {element: {content}} = template;\n        // IE 11 doesn't support the iterable param Set constructor\n        const styles = new Set<Element>();\n        Array.from(content.querySelectorAll('style')).forEach((s: Element) => {\n          styles.add(s);\n        });\n        removeNodesFromTemplate(template, styles);\n      });\n    }\n  });\n};\n\nconst shadyRenderSet = new Set<string>();\n\n/**\n * For the given scope name, ensures that ShadyCSS style scoping is performed.\n * This is done just once per scope name so the fragment and template cannot\n * be modified.\n * (1) extracts styles from the rendered fragment and hands them to ShadyCSS\n * to be scoped and appended to the document\n * (2) removes style elements from all lit-html Templates for this scope name.\n *\n * Note, <style> elements can only be placed into templates for the\n * initial rendering of the scope. If <style> elements are included in templates\n * dynamically rendered to the scope (after the first scope render), they will\n * not be scoped and the <style> will be left in the template and rendered\n * output.\n */\nconst prepareTemplateStyles =\n    (renderedDOM: DocumentFragment, template: Template, scopeName: string) => {\n      shadyRenderSet.add(scopeName);\n      // Move styles out of rendered DOM and store.\n      const styles = renderedDOM.querySelectorAll('style');\n      // If there are no styles, there's no work to do.\n      if (styles.length === 0) {\n        return;\n      }\n      const condensedStyle = document.createElement('style');\n      // Collect styles into a single style. This helps us make sure ShadyCSS\n      // manipulations will not prevent us from being able to fix up template\n      // part indices.\n      // NOTE: collecting styles is inefficient for browsers but ShadyCSS\n      // currently does this anyway. When it does not, this should be changed.\n      for (let i = 0; i < styles.length; i++) {\n        const style = styles[i];\n        style.parentNode!.removeChild(style);\n        condensedStyle.textContent! += style.textContent;\n      }\n      // Remove styles from nested templates in this scope.\n      removeStylesFromLitTemplates(scopeName);\n      // And then put the condensed style into the \"root\" template passed in as\n      // `template`.\n      insertNodeIntoTemplate(\n          template, condensedStyle, template.element.content.firstChild);\n      // Note, it's important that ShadyCSS gets the template that `lit-html`\n      // will actually render so that it can update the style inside when\n      // needed (e.g. @apply native Shadow DOM case).\n      window.ShadyCSS!.prepareTemplateStyles(template.element, scopeName);\n      if (window.ShadyCSS!.nativeShadow) {\n        // When in native Shadow DOM, re-add styling to rendered content using\n        // the style ShadyCSS produced.\n        const style = template.element.content.querySelector('style')!;\n        renderedDOM.insertBefore(style.cloneNode(true), renderedDOM.firstChild);\n      } else {\n        // When not in native Shadow DOM, at this point ShadyCSS will have\n        // removed the style from the lit template and parts will be broken as a\n        // result. To fix this, we put back the style node ShadyCSS removed\n        // and then tell lit to remove that node from the template.\n        // NOTE, ShadyCSS creates its own style so we can safely add/remove\n        // `condensedStyle` here.\n        template.element.content.insertBefore(\n            condensedStyle, template.element.content.firstChild);\n        const removes = new Set();\n        removes.add(condensedStyle);\n        removeNodesFromTemplate(template, removes);\n      }\n    };\n\nexport interface ShadyRenderOptions extends Partial<RenderOptions> {\n  scopeName: string;\n}\n\nexport const render =\n    (result: TemplateResult,\n     container: Element|DocumentFragment,\n     options: ShadyRenderOptions) => {\n      const scopeName = options.scopeName;\n      const hasRendered = parts.has(container);\n      litRender(result, container, {\n        templateFactory: shadyTemplateFactory(scopeName),\n        ...options,\n      } as RenderOptions);\n      // When rendering a TemplateResult, scope the template with ShadyCSS\n      if (container instanceof ShadowRoot && compatibleShadyCSSVersion &&\n          result instanceof TemplateResult) {\n        // Scope the element template one time only for this scope.\n        if (!shadyRenderSet.has(scopeName)) {\n          const part = parts.get(container)!;\n          const instance = part.value as TemplateInstance;\n          prepareTemplateStyles(\n              (container as ShadowRoot), instance.template, scopeName);\n        }\n        // Update styling if this is the initial render to this container.\n        if (!hasRendered) {\n          window.ShadyCSS!.styleElement((container as ShadowRoot).host);\n        }\n      }\n    };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * Converts property values to and from attribute values.\n */\nexport interface AttributeSerializer<T = any> {\n\n  /**\n   * Deserializing function called to convert an attribute value to a property\n   * value.\n   */\n  fromAttribute?(value: string): T;\n\n  /**\n   * Serializing function called to convert a property value to an attribute\n   * value.\n   */\n  toAttribute?(value: T): string|null;\n}\n\ntype AttributeType<T = any> = AttributeSerializer<T>|((value: string) => T);\n\n/**\n * Defines options for a property accessor.\n */\nexport interface PropertyDeclaration<T = any> {\n\n  /**\n   * Indicates how and whether the property becomes an observed attribute.\n   * If the value is `false`, the property is not added to `observedAttributes`.\n   * If true or absent, the lowercased property name is observed (e.g. `fooBar`\n   * becomes `foobar`). If a string, the string value is observed (e.g\n   * `attribute: 'foo-bar'`).\n   */\n  attribute?: boolean|string;\n\n  /**\n   * Indicates how to serialize and deserialize the attribute to/from a\n   * property. If this value is a function, it is used to deserialize the\n   * attribute value a the property value. If it's an object, it can have keys\n   * for `fromAttribute` and `toAttribute` where `fromAttribute` is the\n   * deserialize function and `toAttribute` is a serialize function used to set\n   * the property to an attribute. If no `toAttribute` function is provided and\n   * `reflect` is set to `true`, the property value is set directly to the\n   * attribute.\n   */\n  type?: AttributeType<T>;\n\n  /**\n   * Indicates if the property should reflect to an attribute.\n   * If `true`, when the property is set, the attribute is set using the\n   * attribute name determined according to the rules for the `attribute`\n   * property option and the value of the property serialized using the rules\n   * from the `type` property option.\n   */\n  reflect?: boolean;\n\n  /**\n   * A function that indicates if a property should be considered changed when\n   * it is set. The function should take the `newValue` and `oldValue` and\n   * return `true` if an update should be requested.\n   */\n  hasChanged?(value: T, oldValue: T): boolean;\n}\n\n/**\n * Map of properties to PropertyDeclaration options. For each property an\n * accessor is made, and the property is processed according to the\n * PropertyDeclaration options.\n */\nexport interface PropertyDeclarations {\n  [key: string]: PropertyDeclaration;\n}\n\ntype PropertyDeclarationMap = Map<PropertyKey, PropertyDeclaration>;\n\ntype AttributeMap = Map<string, PropertyKey>;\n\nexport type PropertyValues = Map<PropertyKey, unknown>;\n\n// serializer/deserializers for boolean attribute\nconst fromBooleanAttribute = (value: string) => value !== null;\nconst toBooleanAttribute = (value: string) => value ? '' : null;\n\nexport interface HasChanged {\n  (value: unknown, old: unknown): boolean;\n}\n\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual: HasChanged = (value: unknown, old: unknown): boolean => {\n  // This ensures (old==NaN, value==NaN) always returns false\n  return old !== value && (old === old || value === value);\n};\n\nconst defaultPropertyDeclaration: PropertyDeclaration = {\n  attribute : true,\n  type : String,\n  reflect : false,\n  hasChanged : notEqual\n};\n\nconst microtaskPromise = new Promise((resolve) => resolve(true));\n\nconst STATE_HAS_UPDATED = 1;\nconst STATE_UPDATE_REQUESTED = 1 << 2;\nconst STATE_IS_REFLECTING = 1 << 3;\ntype UpdateState = typeof STATE_HAS_UPDATED|typeof STATE_UPDATE_REQUESTED|\n    typeof STATE_IS_REFLECTING;\n\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclassers to render updates as desired.\n */\nexport abstract class UpdatingElement extends HTMLElement {\n\n  /**\n   * Maps attribute names to properties; for example `foobar` attribute\n   * to `fooBar` property.\n   */\n  private static _attributeToPropertyMap: AttributeMap = new Map();\n\n  /**\n   * Marks class as having finished creating properties.\n   */\n  private static _finalized = true;\n\n  /**\n   * Memoized list of all class properties, including any superclass properties.\n   */\n  private static _classProperties: PropertyDeclarationMap = new Map();\n\n  static properties: PropertyDeclarations = {};\n\n  /**\n   * Returns a list of attributes corresponding to the registered properties.\n   */\n  static get observedAttributes() {\n    // note: piggy backing on this to ensure we're _finalized.\n    this._finalize();\n    const attributes = [];\n    for (const [p, v] of this._classProperties) {\n      const attr = this._attributeNameForProperty(p, v);\n      if (attr !== undefined) {\n        this._attributeToPropertyMap.set(attr, p);\n        attributes.push(attr);\n      }\n    }\n    return attributes;\n  }\n\n  /**\n   * Creates a property accessor on the element prototype if one does not exist.\n   * The property setter calls the property's `hasChanged` property option\n   * or uses a strict identity check to determine whether or not to request\n   * an update.\n   */\n  static createProperty(name: PropertyKey,\n                        options:\n                            PropertyDeclaration = defaultPropertyDeclaration) {\n    // ensure private storage for property declarations.\n    if (!this.hasOwnProperty('_classProperties')) {\n      this._classProperties = new Map();\n      // NOTE: Workaround IE11 not supporting Map constructor argument.\n      const superProperties = Object.getPrototypeOf(this)._classProperties;\n      if (superProperties !== undefined) {\n        superProperties.forEach((v: any, k: PropertyKey) =>\n                                    this._classProperties.set(k, v));\n      }\n    }\n    this._classProperties.set(name, options);\n    // Allow user defined accessors by not replacing an existing own-property\n    // accessor.\n    if (this.prototype.hasOwnProperty(name)) {\n      return;\n    }\n    const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n    Object.defineProperty(this.prototype, name, {\n      get() { return this[key]; },\n      set(value) {\n        const oldValue = this[name];\n        this[key] = value;\n        this._requestPropertyUpdate(name, oldValue, options);\n      },\n      configurable : true,\n      enumerable : true\n    });\n  }\n\n  /**\n   * Creates property accessors for registered properties and ensures\n   * any superclasses are also finalized.\n   */\n  private static _finalize() {\n    if (this.hasOwnProperty('_finalized') && this._finalized) {\n      return;\n    }\n    // finalize any superclasses\n    const superCtor = Object.getPrototypeOf(this);\n    if (typeof superCtor._finalize === 'function') {\n      superCtor._finalize();\n    }\n    this._finalized = true;\n    // initialize Map populated in observedAttributes\n    this._attributeToPropertyMap = new Map();\n    // make any properties\n    const props = this.properties;\n    // support symbols in properties (IE11 does not support this)\n    const propKeys = [\n      ...Object.getOwnPropertyNames(props),\n      ...(typeof Object.getOwnPropertySymbols === 'function')\n          ? Object.getOwnPropertySymbols(props)\n          : []\n    ];\n    for (const p of propKeys) {\n      // note, use of `any` is due to TypeSript lack of support for symbol in\n      // index types\n      this.createProperty(p, (props as any)[p]);\n    }\n  }\n\n  /**\n   * Returns the property name for the given attribute `name`.\n   */\n  private static _attributeNameForProperty(name: PropertyKey,\n                                           options?: PropertyDeclaration) {\n    const attribute = options !== undefined && options.attribute;\n    return attribute === false\n               ? undefined\n               : (typeof attribute === 'string'\n                      ? attribute\n                      : (typeof name === 'string' ? name.toLowerCase()\n                                                  : undefined));\n  }\n\n  /**\n   * Returns true if a property should request an update.\n   * Called when a property value is set and uses the `hasChanged`\n   * option for the property if present or a strict identity check.\n   */\n  private static _valueHasChanged(value: unknown, old: unknown,\n                                  hasChanged: HasChanged = notEqual) {\n    return hasChanged(value, old);\n  }\n\n  /**\n   * Returns the property value for the given attribute value.\n   * Called via the `attributeChangedCallback` and uses the property's `type`\n   * or `type.fromAttribute` property option.\n   */\n  private static _propertyValueFromAttribute(value: string,\n                                             options?: PropertyDeclaration) {\n    const type = options && options.type;\n    if (type === undefined) {\n      return value;\n    }\n    // Note: special case `Boolean` so users can use it as a `type`.\n    const fromAttribute =\n        type === Boolean\n            ? fromBooleanAttribute\n            : (typeof type === 'function' ? type : type.fromAttribute);\n    return fromAttribute ? fromAttribute(value) : value;\n  }\n\n  /**\n   * Returns the attribute value for the given property value. If this\n   * returns undefined, the property will *not* be reflected to an attribute.\n   * If this returns null, the attribute will be removed, otherwise the\n   * attribute will be set to the value.\n   * This uses the property's `reflect` and `type.toAttribute` property options.\n   */\n  private static _propertyValueToAttribute(value: unknown,\n                                           options?: PropertyDeclaration) {\n    if (options === undefined || options.reflect === undefined) {\n      return;\n    }\n    // Note: special case `Boolean` so users can use it as a `type`.\n    const toAttribute =\n        options.type === Boolean\n            ? toBooleanAttribute\n            : (options.type &&\n                   (options.type as AttributeSerializer).toAttribute ||\n               String);\n    return toAttribute(value);\n  }\n\n  private _updateState: UpdateState = 0;\n  private _instanceProperties: PropertyValues|undefined = undefined;\n  private _updatePromise: Promise<unknown> = microtaskPromise;\n\n  /**\n   * Map with keys for any properties that have changed since the last\n   * update cycle with previous values.\n   */\n  private _changedProperties: PropertyValues = new Map();\n\n  /**\n   * Map with keys of properties that should be reflected when updated.\n   */\n  private _reflectingProperties: Map<PropertyKey, PropertyDeclaration>|\n      undefined = undefined;\n\n  /**\n   * Node or ShadowRoot into which element DOM should be rendered. Defaults\n   * to an open shadowRoot.\n   */\n  protected renderRoot?: Element|DocumentFragment;\n\n  constructor() {\n    super();\n    this.initialize();\n  }\n\n  /**\n   * Performs element initialization. By default this calls `createRenderRoot`\n   * to create the element `renderRoot` node and captures any pre-set values for\n   * registered properties.\n   */\n  protected initialize() {\n    this.renderRoot = this.createRenderRoot();\n    this._saveInstanceProperties();\n  }\n\n  /**\n   * Fixes any properties set on the instance before upgrade time.\n   * Otherwise these would shadow the accessor and break these properties.\n   * The properties are stored in a Map which is played back after the\n   * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n   * (<=41), properties created for native platform properties like (`id` or\n   * `name`) may not have default values set in the element constructor. On\n   * these browsers native properties appear on instances and therefore their\n   * default value will overwrite any element default (e.g. if the element sets\n   * this.id = 'id' in the constructor, the 'id' will become '' since this is\n   * the native platform default).\n   */\n  private _saveInstanceProperties() {\n    for (const [p] of (this.constructor as typeof UpdatingElement)\n             ._classProperties) {\n      if (this.hasOwnProperty(p)) {\n        const value = this[p as keyof this];\n        delete this[p as keyof this];\n        if (!this._instanceProperties) {\n          this._instanceProperties = new Map();\n        }\n        this._instanceProperties.set(p, value);\n      }\n    }\n  }\n\n  /**\n   * Applies previously saved instance properties.\n   */\n  private _applyInstanceProperties() {\n    for (const [p, v] of this._instanceProperties!) {\n      (this as any)[p] = v;\n    }\n    this._instanceProperties = undefined;\n  }\n\n  /**\n   * Returns the node into which the element should render and by default\n   * creates and returns an open shadowRoot. Implement to customize where the\n   * element's DOM is rendered. For example, to render into the element's\n   * childNodes, return `this`.\n   * @returns {Element|DocumentFragment} Returns a node into which to render.\n   */\n  protected createRenderRoot(): Element|ShadowRoot {\n    return this.attachShadow({mode : 'open'});\n  }\n\n  /**\n   * Uses ShadyCSS to keep element DOM updated.\n   */\n  connectedCallback() {\n    if ((this._updateState & STATE_HAS_UPDATED)) {\n      if (window.ShadyCSS !== undefined) {\n        window.ShadyCSS.styleElement(this);\n      }\n    } else {\n      this.requestUpdate();\n    }\n  }\n\n  /**\n   * Allows for `super.disconnectedCallback()` in extensions while\n   * reserving the possibility of making non-breaking feature additions\n   * when disconnecting at some point in the future.\n   */\n  disconnectedCallback() {}\n\n  /**\n   * Synchronizes property values when attributes change.\n   */\n  attributeChangedCallback(name: string, old: string, value: string) {\n    if (old !== value) {\n      this._attributeToProperty(name, value);\n    }\n  }\n\n  private _propertyToAttribute(\n      name: PropertyKey, value: unknown,\n      options: PropertyDeclaration = defaultPropertyDeclaration) {\n    const ctor = (this.constructor as typeof UpdatingElement);\n    const attrValue = ctor._propertyValueToAttribute(value, options);\n    if (attrValue !== undefined) {\n      const attr = ctor._attributeNameForProperty(name, options);\n      if (attr !== undefined) {\n        // Track if the property is being reflected to avoid\n        // setting the property again via `attributeChangedCallback`. Note:\n        // 1. this takes advantage of the fact that the callback is synchronous.\n        // 2. will behave incorrectly if multiple attributes are in the reaction\n        // stack at time of calling. However, since we process attributes\n        // in `update` this should not be possible (or an extreme corner case\n        // that we'd like to discover).\n        // mark state reflecting\n        this._updateState = this._updateState | STATE_IS_REFLECTING;\n        if (attrValue === null) {\n          this.removeAttribute(attr);\n        } else {\n          this.setAttribute(attr, attrValue);\n        }\n        // mark state not reflecting\n        this._updateState = this._updateState & ~STATE_IS_REFLECTING;\n      }\n    }\n  }\n\n  private _attributeToProperty(name: string, value: string) {\n    // Use tracking info to avoid deserializing attribute value if it was\n    // just set from a property setter.\n    if (!(this._updateState & STATE_IS_REFLECTING)) {\n      const ctor = (this.constructor as typeof UpdatingElement);\n      const propName = ctor._attributeToPropertyMap.get(name);\n      if (propName !== undefined) {\n        const options = ctor._classProperties.get(propName);\n        this[propName as keyof this] =\n            ctor._propertyValueFromAttribute(value, options);\n      }\n    }\n  }\n\n  /**\n   * Requests an update which is processed asynchronously. This should\n   * be called when an element should update based on some state not triggered\n   * by setting a property. In this case, pass no arguments. It should also be\n   * called when manually implementing a property setter. In this case, pass the\n   * property `name` and `oldValue` to ensure that any configured property\n   * options are honored. Returns the `updateComplete` Promise which is resolved\n   * when the update completes.\n   *\n   * @param name {PropertyKey} (optional) name of requesting property\n   * @param oldValue {any} (optional) old value of requesting property\n   * @returns {Promise} A Promise that is resolved when the update completes.\n   */\n  requestUpdate(name?: PropertyKey, oldValue?: any) {\n    if (name !== undefined) {\n      const options = (this.constructor as typeof UpdatingElement)\n                          ._classProperties.get(name) ||\n                      defaultPropertyDeclaration;\n      return this._requestPropertyUpdate(name, oldValue, options);\n    }\n    return this._invalidate();\n  }\n\n  /**\n   * Requests an update for a specific property and records change information.\n   * @param name {PropertyKey} name of requesting property\n   * @param oldValue {any} old value of requesting property\n   * @param options {PropertyDeclaration}\n   */\n  private _requestPropertyUpdate(name: PropertyKey, oldValue: any,\n                                 options: PropertyDeclaration) {\n    if (!(this.constructor as typeof UpdatingElement)\n             ._valueHasChanged(this[name as keyof this], oldValue,\n                               options.hasChanged)) {\n      return this.updateComplete;\n    }\n    // track old value when changing.\n    if (!this._changedProperties.has(name)) {\n      this._changedProperties.set(name, oldValue);\n    }\n    // add to reflecting properties set\n    if (options.reflect === true) {\n      if (this._reflectingProperties === undefined) {\n        this._reflectingProperties = new Map();\n      }\n      this._reflectingProperties.set(name, options);\n    }\n    return this._invalidate();\n  }\n\n  /**\n   * Invalidates the element causing it to asynchronously update regardless\n   * of whether or not any property changes are pending. This method is\n   * automatically called when any registered property changes.\n   */\n  private async _invalidate() {\n    if (!this._hasRequestedUpdate) {\n      // mark state updating...\n      this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n      let resolver: any;\n      const previousValidatePromise = this._updatePromise;\n      this._updatePromise = new Promise((r) => resolver = r);\n      await previousValidatePromise;\n      this._validate();\n      resolver!(!this._hasRequestedUpdate);\n    }\n    return this.updateComplete;\n  }\n\n  private get _hasRequestedUpdate() {\n    return (this._updateState & STATE_UPDATE_REQUESTED);\n  }\n\n  /**\n   * Validates the element by updating it.\n   */\n  private _validate() {\n    // Mixin instance properties once, if they exist.\n    if (this._instanceProperties) {\n      this._applyInstanceProperties();\n    }\n    if (this.shouldUpdate(this._changedProperties)) {\n      const changedProperties = this._changedProperties;\n      this.update(changedProperties);\n      this._markUpdated();\n      if (!(this._updateState & STATE_HAS_UPDATED)) {\n        this._updateState = this._updateState | STATE_HAS_UPDATED;\n        this.firstUpdated(changedProperties);\n      }\n      this.updated(changedProperties);\n    } else {\n      this._markUpdated();\n    }\n  }\n  private _markUpdated() {\n    this._changedProperties = new Map();\n    this._updateState = this._updateState & ~STATE_UPDATE_REQUESTED;\n  }\n\n  /**\n   * Returns a Promise that resolves when the element has completed updating.\n   * The Promise value is a boolean that is `true` if the element completed the\n   * update without triggering another update. The Promise result is `false` if\n   * a property was set inside `updated()`. This getter can be implemented to\n   * await additional state. For example, it is sometimes useful to await a\n   * rendered element before fulfilling this Promise. To do this, first await\n   * `super.updateComplete` then any subsequent state.\n   *\n   * @returns {Promise} The Promise returns a boolean that indicates if the\n   * update resolved without triggering another update.\n   */\n  get updateComplete() { return this._updatePromise; }\n\n  /**\n   * Controls whether or not `update` should be called when the element requests\n   * an update. By default, this method always returns `true`, but this can be\n   * customized to control when to update.\n   *\n   * * @param _changedProperties Map of changed properties with old values\n   */\n  protected shouldUpdate(_changedProperties: PropertyValues): boolean {\n    return true;\n  }\n\n  /**\n   * Updates the element. This method reflects property values to attributes.\n   * It can be overridden to render and keep updated DOM in the element's\n   * `renderRoot`. Setting properties inside this method will *not* trigger\n   * another update.\n   *\n   * * @param _changedProperties Map of changed properties with old values\n   */\n  protected update(_changedProperties: PropertyValues) {\n    if (this._reflectingProperties !== undefined &&\n        this._reflectingProperties.size > 0) {\n      for (const [k, v] of this._reflectingProperties) {\n        this._propertyToAttribute(k, this[k as keyof this], v);\n      }\n      this._reflectingProperties = undefined;\n    }\n  }\n\n  /**\n   * Invoked whenever the element is updated. Implement to perform\n   * post-updating tasks via DOM APIs, for example, focusing an element.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * * @param _changedProperties Map of changed properties with old values\n   */\n  protected updated(_changedProperties: PropertyValues) {}\n\n  /**\n   * Invoked when the element is first updated. Implement to perform one time\n   * work on the element after update.\n   *\n   * Setting properties inside this method will trigger the element to update\n   * again after this update cycle completes.\n   *\n   * * @param _changedProperties Map of changed properties with old values\n   */\n  protected firstUpdated(_changedProperties: PropertyValues) {}\n}\n","\n/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {LitElement} from '../lit-element.js';\n\nimport {PropertyDeclaration, UpdatingElement} from './updating-element.js';\n\nexport type Constructor<T> = {\n  new (...args: any[]): T\n};\n\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * @param tagName the name of the custom element to define\n *\n * In TypeScript, the `tagName` passed to `customElement` must be a key of the\n * `HTMLElementTagNameMap` interface. To add your element to the interface,\n * declare the interface in this module:\n *\n *     @customElement('my-element')\n *     export class MyElement extends LitElement {}\n *\n *     declare global {\n *       interface HTMLElementTagNameMap {\n *         'my-element': MyElement;\n *       }\n *     }\n *\n */\nexport const customElement = (tagName: keyof HTMLElementTagNameMap) =>\n    (clazz: Constructor<HTMLElement>) => {\n      window.customElements.define(tagName, clazz);\n      // Cast as any because TS doesn't recognize the return type as being a\n      // subtype of the decorated class when clazz is typed as\n      // `Constructor<HTMLElement>` for some reason. `Constructor<HTMLElement>`\n      // is helpful to make sure the decorator is applied to elements however.\n      return clazz as any;\n    };\n\n/**\n * A property decorator which creates a LitElement property which reflects a\n * corresponding attribute value. A `PropertyDeclaration` may optionally be\n * supplied to configure property features.\n */\nexport const property = (options?: PropertyDeclaration) => (proto: Object,\n                                                            name: string) => {\n  (proto.constructor as typeof UpdatingElement).createProperty(name, options);\n};\n\n/**\n * A property decorator that converts a class property into a getter that\n * executes a querySelector on the element's renderRoot.\n */\nexport const query = _query((target: NodeSelector, selector: string) =>\n                                target.querySelector(selector));\n\n/**\n * A property decorator that converts a class property into a getter\n * that executes a querySelectorAll on the element's renderRoot.\n */\nexport const queryAll = _query((target: NodeSelector, selector: string) =>\n                                   target.querySelectorAll(selector));\n\n/**\n * Base-implementation of `@query` and `@queryAll` decorators.\n *\n * @param queryFn exectute a `selector` (ie, querySelector or querySelectorAll)\n * against `target`.\n */\nfunction _query<T>(queryFn: (target: NodeSelector, selector: string) => T) {\n  return (selector: string) => (proto: any, propName: string) => {\n    Object.defineProperty(proto, propName, {\n      get(this: LitElement) { return queryFn(this.renderRoot!, selector); },\n      enumerable : true,\n      configurable : true,\n    });\n  };\n}\n\n/**\n * Adds event listener options to a method used as an event listener in a\n * lit-html template.\n *\n * @param options An object that specifis event listener options as accepted by\n * `EventTarget#addEventListener` and `EventTarget#removeEventListener`.\n *\n * Current browsers support the `capture`, `passive`, and `once` options. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters\n *\n * @example\n *\n *     class MyElement {\n *\n *       clicked = false;\n *\n *       render() {\n *         return html`<div @click=${this._onClick}`><button></button></div>`;\n *       }\n *\n *       @eventOptions({capture: true})\n *       _onClick(e) {\n *         this.clicked = true;\n *       }\n *     }\n */\nexport const eventOptions = (options: EventListenerOptions) =>\n    (proto: any, name: string) => {\n      // This comment is here to fix a disagreement between formatter and linter\n      Object.assign(proto[name], options);\n    };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport {TemplateResult} from 'lit-html';\nimport {render} from 'lit-html/lib/shady-render';\n\nimport {PropertyValues, UpdatingElement} from './lib/updating-element.js';\n\nexport * from './lib/updating-element.js';\nexport * from './lib/decorators.js';\nexport {html, svg} from 'lit-html/lit-html';\n\nexport class LitElement extends UpdatingElement {\n\n  /**\n   * Render method used to render the lit-html TemplateResult to the element's\n   * DOM.\n   * @param {TemplateResult} Template to render.\n   * @param {Element|DocumentFragment} Node into which to render.\n   * @param {String} Element name.\n   */\n  static render = render;\n\n  /**\n   * Updates the element. This method reflects property values to attributes\n   * and calls `render` to render DOM via lit-html. Setting properties inside\n   * this method will *not* trigger another update.\n   * * @param _changedProperties Map of changed properties with old values\n   */\n  protected update(changedProperties: PropertyValues) {\n    super.update(changedProperties);\n    const templateResult = this.render() as any;\n    if (templateResult instanceof TemplateResult) {\n      (this.constructor as typeof LitElement)\n          .render(templateResult, this.renderRoot!,\n                  {scopeName : this.localName!, eventContext : this});\n    }\n  }\n\n  /**\n   * Invoked on each update to perform rendering tasks. This method must return\n   * a lit-html TemplateResult. Setting properties inside this method will *not*\n   * trigger the element to update.\n   * @returns {TemplateResult} Must return a lit-html TemplateResult.\n   */\n  protected render() {}\n}\n","const $_iconsContainer = document.createElement('div');\n$_iconsContainer.setAttribute('style', 'display: none;');\n$_iconsContainer.innerHTML = `<svg>\n    <defs>\n\n    <!-- Actions -->\n\n        <symbol id=\"zui-bookmark\" viewBox=\"0 0 48 48\">\n            <title>zui-bookmark</title>\n            <path d=\"M36,40l-12-8l-12,8V12c0-2.2,1.8-4,4-4h16c2.2,0,4,1.8,4,4V40z\"/>\n        </symbol>\n        <symbol id=\"zui-calendar-add\" viewBox=\"0 0 48 48\">\n            <title>zui-calendar-add</title>\n            <path d=\"M38,8.5h-2v2.3c0,1.3-0.7,2.5-1.8,3.1c-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2h-8v2.3c0,1.3-0.7,2.5-1.8,3.1\n\tc-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2H9.3C7.5,8.5,6,10,6,11.8v27.4c0,1.8,1.5,3.3,3.3,3.3h29.4\n\tc1.8,0,3.3-1.5,3.3-3.3V12.5C42,10.3,40.2,8.5,38,8.5 M10,38.5v-20h28v20 M16,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4\n\tC18,11.6,17.1,12.5,16,12.5 M32,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4C34,11.6,33.1,12.5,32,12.5\"/>\n            <path d=\"M30,26.5v4h-4v4h-4v-4h-4v-4h4v-4h4v4H30z\"/>\n        </symbol>\n        <symbol id=\"zui-check\" viewBox=\"0 0 48 48\">\n            <title>zui-check</title>\n            <path d=\"M40.9,12.2L17.8,35.3L15,38.1l-2.8-2.8l-7.1-7.1l2.8-2.8l7.1,7.1L38.1,9.4C38.1,9.4,40.9,12.2,40.9,12.2z\"/>\n        </symbol>\n        <symbol id=\"zui-collapse\" viewBox=\"0 0 48 48\">\n            <title>zui-collapse</title>\n            <path d=\"M32.8,18H40v4H26V8h4v7.2l9.6-9.6l2.8,2.8L32.8,18z M15.2,30H8v-4h14v14h-4v-7.2l-9.6,9.6l-2.8-2.8L15.2,30z\"/>\n        </symbol>\n        <symbol id=\"zui-clock\" viewBox=\"0 0 48 48\">\n            <title>zui-clock</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M30.5,32L22,23.5V8h4v13.9l7.3,7.3L30.5,32z\"/>\n        </symbol>\n        <symbol id=\"zui-close\" viewBox=\"0 0 48 48\">\n            <title>zui-close</title>\n            <path d=\"M39.6,36.7l-2.8,2.8L24,26.8L11.3,39.6l-2.8-2.8L21.2,24L8.4,11.3l2.8-2.8L24,21.2L36.7,8.4l2.8,2.8L26.8,24\n\tC26.8,24,39.6,36.7,39.6,36.7z\"/>\n        </symbol>\n        <symbol id=\"zui-cloud-download\" viewBox=\"0 0 48 48\">\n            <title>zui-cloud-download</title>\n            <path d=\"M37.4,18.6c-2.1-7.4-9.9-11.7-17.3-9.6c-3.1,0.9-5.9,2.9-7.7,5.6c-6.6,0.9-11.1,7-10.2,13.6C3.1,34.1,8.1,38.4,14,38.5h22\n\tc5.5,0,10-4.6,9.9-10.1C45.9,23.5,42.3,19.4,37.4,18.6z M24,34.5l-8-10h4v-8h8v8h4L24,34.5z\"/>\n        </symbol>\n        <symbol id=\"zui-cloud-upload\" viewBox=\"0 0 48 48\">\n            <title>zui-cloud-upload</title>\n            <path d=\"M37.4,18.6c-2.1-7.4-9.9-11.7-17.3-9.6c-3.1,0.9-5.9,2.9-7.7,5.6c-6.6,0.9-11.1,7-10.2,13.6C3.1,34.1,8.1,38.4,14,38.5h22\n\tc5.5,0,10-4.6,9.9-10.1C45.9,23.5,42.3,19.4,37.4,18.6z M24,16.5l8,10h-4v8h-8v-8h-4L24,16.5z\"/>\n        </symbol>\n        <symbol id=\"zui-copy\" viewBox=\"0 0 48 48\">\n            <title>zui-copy</title>\n            <path d=\"M36,12v24c0,2.2-1.8,4-4,4H16c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V16C40,13.8,38.2,12,36,12z\"/>\n            <path d=\"M28,4H12C9.8,4,8,5.8,8,8v24c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V8C32,5.8,30.2,4,28,4z M28,22h-6v6h-4v-6h-6v-4h6v-6h4v6h6\n\tV22z\"/>\n        </symbol>\n        <symbol id=\"zui-cut\" viewBox=\"0 0 48 48\">\n            <title>zui-cut</title>\n            <path d=\"M32.7,19.7c1.3,0.6,2.7,0.8,4.2,0.7c4.4-0.5,7.5-4.5,7-8.9S39.4,4,35,4.5c-3.7,0.4-6.6,3.4-7,7.1c-0.2,1.4,0.1,2.9,0.7,4.2\n\tL24,20.4l-4.7-4.7c0.6-1.3,0.9-2.7,0.7-4.2c-0.5-4.4-4.5-7.5-8.9-7c-4.4,0.5-7.5,4.5-7,8.9c0.4,3.7,3.3,6.6,7,7\n\tc1.4,0.2,2.9-0.1,4.2-0.7l4.7,4.7l-9.8,9.8c-1.5,2-2.2,4.5-2.2,7c-0.1,0.7,0.5,1.3,1.2,1.4c0.4,0,0.8-0.1,1-0.4L32.7,19.7z M32,12.4\n\tc0-2.2,1.8-4,4-4s4,1.8,4,4s-1.8,4-4,4S32,14.7,32,12.4 M8,12.4c0-2.2,1.8-4,4-4s4,1.8,4,4s-1.8,4-4,4S8,14.7,8,12.4 M37.8,34.2\n\tL30,26.4l-4,4l11.7,11.8c0.5,0.5,1.3,0.6,1.8,0.1c0.3-0.3,0.5-0.7,0.4-1.1C40,38.7,39.3,36.2,37.8,34.2\"/>\n        </symbol>\n        <symbol id=\"zui-delete\" viewBox=\"0 0 48 48\">\n            <title>zui-delete</title>\n            <path d=\"M38,6.1v4H10v-4h9l1-2h8l0.9,2C28.9,6.1,38,6.1,38,6.1z M12,13.1h24v27c0,2.2-1.8,4-4,4H16c-2.2,0-4-1.8-4-4\n\tC12,40.1,12,13.1,12,13.1z\"/>\n        </symbol>\n        <symbol id=\"zui-download\" viewBox=\"0 0 48 48\">\n            <title>zui-download</title>\n            <path d=\"M6,37.3h36v4H6V37.3z M34.3,23l-7.5,7.5L26,31.3l-2,2l-2-2l-0.8-0.8L13.7,23l2.8-2.8l5.5,5.5V8.1h4v17.5l5.5-5.5L34.3,23z\" />\n        </symbol>\n        <symbol id=\"zui-external\" viewBox=\"0 0 48 48\">\n            <title>zui-external</title>\n            <path d=\"M37.5,6.5h-18c-2.2,0-4,1.8-4,4v18c0,2.2,1.8,4,4,4h18c2.2,0,4-1.8,4-4v-18C41.5,8.3,39.7,6.5,37.5,6.5z M35.5,25h-3.6v-6.5\n\tL23,27.4l-2.6-2.6l8.6-8.6h-6v-3.7h12.5V25L35.5,25z\"/>\n            <path d=\"M11.5,32.5v-18c-2.2,0-4,1.8-4,4v18c0,2.2,1.8,4,4,4h18c2.2,0,4-1.8,4-4h-18C13.3,36.5,11.5,34.7,11.5,32.5z\"/>\n        </symbol>\n        <symbol id=\"zui-eye\" viewBox=\"0 0 48 48\">\n            <title>zui-eye</title>\n            <circle cx=\"24\" cy=\"24\" r=\"6\"/>\n            <path d=\"M24,10C12,10,4,24,4,24s8,14,20,14s20-14,20-14S36,10,24,10z M24,34c-5.5,0-10-4.5-10-10s4.5-10,10-10s10,4.5,10,10\n\tS29.5,34,24,34z\"/>\n        </symbol>\n        <symbol id=\"zui-expand\" viewBox=\"0 0 48 48\">\n            <title>zui-expand</title>\n            <path d=\"M35.6,9.6h-7.2v-4h14v14h-4v-7.2L28.8,22L26,19.2L35.6,9.6z M12.4,38.4h7.2v4h-14v-14h4v7.2l9.6-9.6l2.8,2.8L12.4,38.4z\"/>\n        </symbol>\n        <symbol id=\"zui-filter\" viewBox=\"0 0 48 48\">\n            <title>zui-filter</title>\n            <path d=\"M6,6h36L28,24v14l-8,4V24L6,6z\"/>\n        </symbol>\n        <symbol id=\"zui-flag\" viewBox=\"0 0 48 48\">\n            <title>zui-flag</title>\n            <path d=\"M40,11v18c0,0.6-0.4,1-1,1H23c-1.7,0-3-1.3-3-3v-1h-6V6h10c1.7,0,3,1.3,3,3v16h3V10h9C39.6,10,40,10.4,40,11 M12,44V4H8v40\n\tH12z\"/>\n        </symbol>\n        <symbol id=\"zui-folder-open\" viewBox=\"0 0 48 48\">\n            <title>zui-folder-open</title>\n            <path d=\"M3.5,22.6C4.2,19.4,7,17,10.4,17h32.7v-1c0-2.2-1.8-4-4-4h-16l-4-4H6.3c-1.8,0-3.2,1.4-3.2,3.2v13.5L3.5,22.6z\"/>\n            <path d=\"M39.8,40H5.5c-1.1,0-2-0.9-2-2c0-0.1,0-0.3,0-0.4l2.9-14.4c0.4-1.9,2.1-3.3,4-3.2h34.2c1.1,0,2,0.9,2,2c0,0.1,0,0.3,0,0.4\n\tl-2.9,14.4C43.4,38.7,41.7,40,39.8,40z\"/>\n        </symbol>\n        <symbol id=\"zui-heart\" viewBox=\"0 0 48 48\">\n            <title>zui-heart</title>\n            <path d=\"M7.1,22.5c-0.6-1.1-0.9-2.3-1-3.5C6.2,20.2,6.5,21.4,7.1,22.5z M42,18.9c-0.1,1.2-0.4,2.4-1,3.5\n\tC41.5,21.4,41.8,20.2,42,18.9z\"/>\n            <path d=\"M42,18c0,0.3,0,0.6,0,0.9c-0.2,1.2-0.5,2.4-1,3.5C37.1,31.2,24,40,24,40S10.9,31.2,7.1,22.5c-0.5-1.1-0.8-2.3-1-3.5\n\tC6,18.6,6,18.3,6,18c0-5.5,4.5-10,10-10c3.1,0,6.1,1.5,8,4c3.3-4.4,9.6-5.3,14-2C40.5,11.9,42,14.9,42,18z\"/>\n        </symbol>\n        <symbol id=\"zui-link\" viewBox=\"0 0 48 48\">\n            <title>zui-link</title>\n            <path d=\"M20.4,28.9c-0.3-0.2-0.5-0.4-0.7-0.6c-0.6-0.7-1.1-1.5-1.3-2.4c-0.3-1.6,0.2-3.2,1.3-4.4l0.8-0.8l5.8-5.8l2-2l1.4-1.4\n\tc1.9-1.9,4.9-1.8,6.7,0c1.8,1.8,1.8,4.7,0.1,6.6c0.7,1.5,1.1,3.1,1.1,4.8l1.8-1.8c3.5-3.5,3.5-9.2,0-12.7C35.9,5,30.2,5,26.7,8.5\n\tl0,0L23.3,12l-6.6,6.5c-2.1,2.2-3.1,5.2-2.4,8.2c0.3,1.7,1.2,3.3,2.4,4.5c0.2,0.2,0.5,0.4,0.7,0.6L20.4,28.9z\"/>\n            <path d=\"M27.2,19.5c0.3,0.2,0.5,0.3,0.7,0.6c1.8,1.9,1.8,4.9,0,6.7l-0.8,0.8l-5.8,5.8l-2,2L18,36.7c-1.8,1.9-4.8,1.9-6.7,0\n\ts-1.9-4.8,0-6.7c-0.8-1.5-1.1-3.1-1.1-4.8L8.3,27C5,30.6,5.2,36.3,8.8,39.7c3.5,3.2,8.8,3.2,12.3,0l3.3-3.3l6.6-6.6\n\tc2.1-2.1,3.1-5.2,2.4-8.2c-0.4-1.7-1.2-3.3-2.4-4.5c-0.2-0.2-0.5-0.4-0.7-0.6L27.2,19.5z\"/>\n        </symbol>\n        <symbol id=\"zui-list\" viewBox=\"0 0 48 48\">\n            <title>zui-list</title>\n            <path d=\"M22,6h16c2.2,0,4,1.8,4,4v16c0,2.2-1.8,4-4,4H22c-2.2,0-4-1.8-4-4V10C18,7.8,19.8,6,22,6z\"/>\n            <path d=\"M19,33c-2.2,0-4-1.8-4-4V12.1c-1.8,0.5-3,2-3,3.9v16c0,2.2,1.8,4,4,4h16c1.8,0,3.4-1.2,3.9-3H19z\"/>\n            <path d=\"M13.1,38.9c-2.2,0-4-1.8-4-4V18c-1.8,0.4-3.1,2.1-3.1,4v16c0,2.2,1.8,4,4,4h16c1.9,0.1,3.6-1.2,4-3.1H13.1z\"/>\n        </symbol>\n        <symbol id=\"zui-lock\" viewBox=\"0 0 48 48\">\n            <style type=\"text/css\">\n\t.st0{fill:none;}\n\t</style>\n            <title>zui-lock</title>\n            <path d=\"M36,20.9h-2v-7.3c0-0.2,0-0.4,0-0.7c-0.2-5.5-4.8-9.9-10.3-9.7S13.8,8.1,14,13.6v7.3h-2c-2.2,0-4,1.8-4,4v14\n\tc0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-14C40,22.7,38.2,20.9,36,20.9z M24,38.9c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6\n\tS27.3,38.9,24,38.9z M18,20.9v-7.3c0-3.3,2.7-6,6-6s6,2.7,6,6v7.3H18z\"/>\n            <circle class=\"st0\" cx=\"24\" cy=\"32.9\" r=\"6\"/>\n            <path class=\"st0\" d=\"M30,13.6v7.3H18v-7.3c0-3.3,2.7-6,6-6S30,10.3,30,13.6z\"/>\n        </symbol>\n        <symbol id=\"zui-login\" viewBox=\"0 0 48 48\">\n            <title>zui-login</title>\n            <path d=\"M16.9,13.8l3.6,2.7V9h5c0.6-1,1.6-1.7,2.6-2.2L32.3,5H18.5c-1.1,0-2,0.9-2,2v6.5L16.9,13.8z M20.5,29.5l-3.6,2.7l-0.4,0.3\n\tV39c0,1.1,0.9,2,2,2h6v-4h-4V29.5z M42.5,5.2v35L31.3,45c-1,0.4-2.2,0-2.6-1.1c-0.1-0.2-0.1-0.5-0.2-0.7V12.5c0-0.8,0.5-1.5,1.2-1.8\n\tL42.5,5.2z M16.5,17v4h-12v4h12v4l8-6L16.5,17z\"/>\n        </symbol>\n        <symbol id=\"zui-logout\" viewBox=\"0 0 48 48\">\n            <title>zui-logout</title>\n            <path d=\"M27.5,28.9v8h-4v4h6c1.1,0,2-0.9,2-2v-10H27.5z M29.5,4.9H15.7l4.2,1.8c1.1,0.5,2,1.2,2.6,2.2h5v8h4v-10\n\tC31.5,5.8,30.6,4.9,29.5,4.9z M18.3,10.7c0.7,0.3,1.2,1,1.2,1.8v30.7c0,1.1-0.9,2-2,2c-0.3,0-0.5-0.1-0.8-0.2L5.5,40.2v-35\n\tL18.3,10.7z M35.5,28.9v-4h-12v-4h12v-4l8,6L35.5,28.9z\"/>\n        </symbol>\n        <symbol id=\"zui-minus\" viewBox=\"0 0 48 48\">\n            <title>zui-minus</title>\n            <path d=\"M4,22h40v4H4V22z\"/>\n        </symbol>\n        <symbol id=\"zui-navigate\" viewBox=\"0 0 48 48\">\n            <title>zui-navigate</title>\n            <path d=\"M10,39.5L24,4.9l14,34.6c0.2,0.5,0,1.1-0.5,1.3c-0.3,0.1-0.6,0.1-0.8,0L24,32.9l-12.6,8c-0.4,0.3-1.1,0.2-1.4-0.2\n\tC9.8,40.4,9.8,39.9,10,39.5z\"/>\n        </symbol>\n        <symbol id=\"zui-not-allowed\" viewBox=\"0 0 48 48\">\n            <title>zui-not-allowed</title>\n            <path d=\"M24,4.1c-11,0-20,9-20,20s9,20,20,20s20-9,20-20S35,4.1,24,4.1 M40,24.1c0,3.6-1.2,7.1-3.4,9.9L14.2,11.4\n\tc7-5.4,17-4.1,22.4,2.8C38.8,17.1,40,20.5,40,24.1 M8,24.1c0-3.5,1.2-7,3.4-9.8l22.4,22.4c-2.8,2.2-6.2,3.4-9.8,3.4\n\tC15.2,40.1,8,32.9,8,24.1\"/>\n        </symbol>\n        <symbol id=\"zui-paper-plane\" viewBox=\"0 0 48 48\">\n            <title>zui-paper-plane</title>\n            <path d=\"M6.8,41.8l36.3-16.3c0.8-0.4,1.1-1.4,0.8-2.2c-0.2-0.3-0.4-0.6-0.8-0.8L6.8,6.2c-1-0.4-2.2,0-2.6,1C4,7.5,4,7.9,4,8.2V20\n\tl28.2,4L4,28v11.9C3.9,41,4.7,41.9,5.8,42C6.2,42,6.5,42,6.8,41.8\"/>\n        </symbol>\n        <symbol id=\"zui-paperclip\" viewBox=\"0 0 48 48\">\n            <title>zui-paperclip</title>\n            <path d=\"M18.3,42.5c-2.8-0.1-5.4-1.2-7.2-3.3c-2.9-2.6-4-6.6-2.7-10.3c0.6-1.7,1.5-3.3,2.7-4.6l16-16c0.9-0.9,2-1.6,3.2-2\n\tc2.6-0.9,5.5-0.1,7.4,2c2.9,2.7,3.1,7.3,0.4,10.2c-0.1,0.1-0.3,0.3-0.4,0.4L22.8,33.9c-1.5,1.5-4.9,3.6-7.4,1.1s-0.4-6,1.1-7.4\n\tl16-16l2.1,2.1l-16,16c0,0-2,2.2-1.1,3.2s3.2-1,3.2-1.1l14.9-14.8c1.8-1.6,1.9-4.3,0.3-6.1c-0.1-0.1-0.2-0.2-0.3-0.3\n\tc-1.1-1.2-2.8-1.7-4.3-1.2c-0.7,0.3-1.4,0.7-2,1.2l-16,16c-2.9,2.7-3.1,7.2-0.4,10.2c0.1,0.1,0.3,0.3,0.4,0.4\n\tc2.7,2.9,7.3,3.1,10.2,0.4c0.1-0.1,0.3-0.3,0.4-0.4l14.8-14.8l2.1,2.1L26,39.3C23.9,41.3,21.2,42.5,18.3,42.5z\"/>\n        </symbol>\n        <symbol id=\"zui-paste\" viewBox=\"0 0 48 48\">\n            <title>zui-paste</title>\n            <path d=\"M13.5,39h3v4h-5c-1.7,0-3-1.3-3-3l0,0V12c0-1.7,1.3-3,3-3h3.2c0.4-1.2,1.5-2,2.8-2c0.5-2.7,3.2-4.5,5.9-3.9\n\tc2,0.4,3.5,1.9,3.9,3.9h0.1c1.3,0,2.4,0.8,2.8,2h3.2c1.7,0,3,1.3,3,3v5h-3.9v-3.1c0-0.6-0.4-1-1-1h-1V14c0,0.6-0.4,1-1,1h-14\n\tc-0.6,0-1-0.4-1-1v-1h-1c-0.6,0-1,0.4-1,1v24C12.5,38.6,12.9,39,13.5,39 M20.5,8c0,1.1,0.9,2,2,2s2-0.9,2-2c0-1.1-0.9-2-2-2\n\tS20.5,6.9,20.5,8\"/>\n            <path d=\"M38.5,37.5L33,43v-5.5H38.5z\"/>\n            <path d=\"M38.5,35.3v-12c0.1-1.2-0.9-2.2-2.1-2.3c0,0-0.1,0-0.1,0H23.1c-1.2,0-2.2,1-2.2,2.2l0,0v17.6c0,1.2,1,2.2,2.2,2.2h7.7v-7.7\n\tH38.5z\"/>\n        </symbol>\n        <symbol id=\"zui-pencil\" viewBox=\"0 0 48 48\">\n            <title>zui-pencil</title>\n            <path d=\"M15.7,38.5H9.5v-6.2l20.2-20.2l6.2,6.2L15.7,38.5z\"/>\n            <path d=\"M36,9.1l2.8,2.8c0.9,0.9,0.9,2.5,0,3.4l0,0l-1.4,1.4l-6.2-6.2l1.4-1.4C33.6,8.2,35.1,8.2,36,9.1C36,9.1,36,9.1,36,9.1z\"/>\n        </symbol>\n        <symbol id=\"zui-pin\" viewBox=\"0 0 48 48\">\n            <title>zui-pin</title>\n            <path d=\"M34,24l-3.6-12.6c1.7-0.5,2.9-2,2.9-3.8V7c0-0.6-0.4-1-1-1H15.7c-0.6,0-1,0.4-1,1v0.6c0,1.8,1.2,3.3,2.9,3.8L14,24\n\tc-2.5,0.2-4.2,2.4-4,4.9c0,0,0,0.1,0,0.1c0,0.6,0.4,1,1,1h9c0.1,1.4,0.4,2.7,1,4l2.1,7.5c0.2,0.5,0.8,0.7,1.3,0.5\n\tc0.2-0.1,0.4-0.3,0.5-0.5L27,34c0.6-1.3,0.9-2.6,1-4h9c0.6,0,1-0.4,1-1c0.3-2.4-1.4-4.7-3.9-5C34.1,24,34,24,34,24z M20.2,24H16\n\tl3.6-12h4.2L20.2,24z\"/>\n        </symbol>\n        <symbol id=\"zui-play\" viewBox=\"0 0 48 48\">\n            <title>zui-play</title>\n            <path d=\"M40,8H8c-2.2,0-4,1.8-4,4v24c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V12C44,9.8,42.2,8,40,8z M20,32V16l10.7,8L20,32z\"/>\n        </symbol>\n        <symbol id=\"zui-play-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-play-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M20,32V16l10.7,8L20,32z\"/>\n        </symbol>\n        <symbol id=\"zui-plus\" viewBox=\"0 0 48 48\">\n            <title>zui-plus</title>\n            <path d=\"M44,22v4H26v18h-4V26H4v-4h18V4h4v18H44z\"/>\n        </symbol>\n        <symbol id=\"zui-power\" viewBox=\"0 0 48 48\">\n            <title>zui-power</title>\n            <path d=\"M22,4.5h4v18h-4V4.5z\"/>\n            <path d=\"M30,7.6v4.3c7,3.3,10,11.7,6.6,18.6c-3.3,7-11.7,10-18.6,6.6S8,25.5,11.4,18.5c1.4-2.9,3.7-5.3,6.6-6.6V7.6\n\tc-9.4,3.3-14.3,13.6-11,23s13.6,14.3,23,11c9.4-3.3,14.3-13.6,11-23C39.2,13.4,35.1,9.4,30,7.6z\"/>\n        </symbol>\n        <symbol id=\"zui-print\" viewBox=\"0 0 48 48\">\n            <title>zui-print</title>\n            <path d=\"M12,4h24v6H12V4z M40,14H8c-2.2,0-4,1.8-4,4v12c0,2.2,1.8,4,4,4h4v10h24V34h4c2.2,0,4-1.8,4-4V18C44,15.8,42.2,14,40,14z\n\t M10,22c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,22,10,22z M32,40H16V28h16V40z\"/>\n        </symbol>\n        <symbol id=\"zui-reload\" viewBox=\"0 0 48 48\">\n            <title>zui-reload</title>\n            <path d=\"M32,20l3.7-3.7l-0.1-0.1c-0.2-0.3-0.3-0.5-0.6-0.8c-0.6-0.7-1.3-1.4-2-2c-0.2-0.2-0.4-0.4-0.6-0.5c-0.9-0.7-1.9-1.3-3-1.8\n\tc-0.3-0.1-0.5-0.2-0.8-0.3c-0.3-0.1-0.6-0.2-0.8-0.3l-0.9-0.2c-0.5-0.1-1-0.2-1.6-0.3h-1.3c-0.5,0-1,0-1.4,0c-0.4,0-0.8,0.1-1.2,0.2\n\tc-0.4,0.1-0.9,0.2-1.3,0.3c-0.4,0.1-0.7,0.2-1,0.4c-0.5,0.2-1,0.4-1.5,0.7c-0.3,0.2-0.7,0.4-1,0.6c-1.7,1.1-3.2,2.6-4.3,4.3\n\tc-0.2,0.3-0.4,0.7-0.6,1c-0.3,0.5-0.5,1-0.7,1.5c-0.1,0.3-0.3,0.7-0.4,1c-0.1,0.4-0.2,0.9-0.3,1.3c-0.1,0.4-0.1,0.8-0.2,1.2\n\tc0,0.5,0,1,0,1.4c0,7.7,6.3,14,14,14s14-6.3,14-14h4c0,9.9-8.1,18-18,18S6,33.9,6,24c0-1.4,0.2-2.9,0.5-4.3c0-0.2,0.1-0.4,0.2-0.7\n\tc0.1-0.4,0.2-0.9,0.4-1.3c0-0.3,0.2-0.5,0.3-0.8c0.1-0.3,0.3-0.6,0.4-0.9c0.1-0.2,0.2-0.4,0.3-0.7l0.5-0.8c0.1-0.2,0.3-0.5,0.4-0.7\n\tc1.3-1.9,3-3.6,4.9-4.9l0.7-0.4c1.4-0.9,2.9-1.5,4.4-2l0.7-0.2C21.2,6.1,22.6,6,24,6h1.7c0.5,0,0.9,0.1,1.4,0.2l1.1,0.2l0.6,0.1\n\tc0.4,0.1,0.7,0.2,1,0.3l0.5,0.2c0.4,0.1,0.7,0.3,1.1,0.5c0.4,0.2,0.8,0.4,1.2,0.6C33.2,8.5,33.6,8.7,34,9c0.4,0.3,0.8,0.6,1.2,0.9\n\tc0.8,0.6,1.5,1.3,2.2,2c0.2,0.2,0.4,0.5,0.6,0.7c0.2,0.2,0.3,0.4,0.5,0.6L42,10v10H32z\"/>\n        </symbol>\n        <symbol id=\"zui-save\" viewBox=\"0 0 48 48\">\n            <title>zui-save</title>\n            <path d=\"M34,6H10c-2.2,0-4,1.8-4,4v28c0,2.2,1.8,4,4,4h28c2.2,0,4-1.8,4-4V14L34,6z M24,38c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6\n\tS27.3,38,24,38z M30,18H10v-8h20V18z\"/>\n        </symbol>\n        <symbol id=\"zui-search\" viewBox=\"0 0 48 48\">\n            <title>zui-search</title>\n            <path d=\"M19.6,12.6c5,0,9,4,9,9c0,1.9-0.6,3.8-1.7,5.3l-0.8,1.2l-1.2,0.8c-1.5,1.1-3.4,1.7-5.3,1.7c-5,0-9-4-9-9\n\tS14.7,12.6,19.6,12.6 M19.6,8.6c-7.2,0-13,5.8-13,13s5.8,13,13,13c2.8,0,5.4-0.9,7.7-2.5l10,10l2.8-2.8l-10-10\n\tc1.6-2.2,2.5-4.9,2.5-7.7C32.6,14.4,26.8,8.6,19.6,8.6z\"/>\n        </symbol>\n        <symbol id=\"zui-sort\" viewBox=\"0 0 48 48\">\n            <title>zui-sort</title>\n            <path d=\"M17.3,20.4l-2.9-2.9L23.9,8l9.5,9.5l-2.9,2.9l-6.6-6.6C23.9,13.8,17.3,20.4,17.3,20.4z M30.5,27.6l2.9,2.9L23.9,40l-9.5-9.5\n\tl2.9-2.9l6.6,6.6L30.5,27.6z\"/>\n        </symbol>\n        <symbol id=\"zui-sort-az\" viewBox=\"0 0 48 48\">\n            <title>zui-sort-az</title>\n            <path d=\"M22,35.5l-2.3-6.3h-8.8l-2.2,6.3h-4l8.5-22.9h4L26,35.5H22z M18.7,26l-2.1-6.2c-0.2-0.4-0.4-1.1-0.7-2s-0.5-1.6-0.6-2\n\tC15,17.2,14.5,18.6,14,20l-2,6H18.7z M31.4,32.4l11.6-17v-2.7H27.3v3.2h11.2L26.9,32.9v2.6h16.3v-3.2L31.4,32.4z M24,44l4-4h-8\n\tL24,44z\"/>\n            <path d=\"M24,4l-4,4h8L24,4z\"/>\n        </symbol>\n        <symbol id=\"zui-star\" viewBox=\"0 0 48 48\">\n            <title>zui-star</title>\n            <path d=\"M33.8,41.8l-9.2-7c-0.4-0.3-0.9-0.3-1.2,0l-9.1,7.1c-0.4,0.3-1.1,0.3-1.4-0.2c-0.2-0.3-0.3-0.6-0.2-0.9l3.5-11.6\n\tc0.1-0.4,0-0.9-0.4-1.1l-9.4-7.2c-0.5-0.4-0.5-1-0.2-1.5c0.2-0.2,0.5-0.4,0.8-0.4h11.4c0.5,0,0.9-0.4,1-0.9l3.4-11.5\n\tC23,6,23.5,5.7,24.1,5.8c0.4,0.1,0.7,0.4,0.8,0.8l3.5,11.5c0.1,0.4,0.5,0.7,1,0.7h11.4c0.6,0,1,0.5,1,1c0,0.3-0.1,0.6-0.4,0.8\n\tl-9.4,7.2c-0.3,0.3-0.5,0.7-0.4,1.1l3.6,11.6c0.1,0.5-0.2,1.1-0.7,1.2C34.3,41.9,34,41.9,33.8,41.8z\"/>\n        </symbol>\n        <symbol id=\"zui-stop\" viewBox=\"0 0 48 48\">\n            <title>zui-stop</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M30,30H18V18h12V30z\"/>\n        </symbol>\n        <symbol id=\"zui-sync\" viewBox=\"0 0 48 48\">\n            <title>zui-sync</title>\n            <path d=\"M6,38V28h10l-3.7,3.7c0.5,0.8,1.1,1.5,1.8,2.2c5.5,5.5,14.3,5.5,19.8,0c2.6-2.6,4.1-6.2,4.1-9.9h4c0,9.9-8.1,18-18,18\n\tc-4.8,0-9.3-1.9-12.7-5.3c-0.7-0.7-1.3-1.4-1.8-2.2L6,38z M42,10v10H32l3.7-3.7c-0.5-0.8-1.1-1.5-1.8-2.2c-5.5-5.5-14.3-5.5-19.8,0\n\tC11.5,16.7,10,20.3,10,24H6c0-9.9,8.1-18,18-18c4.8,0,9.3,1.9,12.7,5.3c0.7,0.7,1.3,1.4,1.8,2.2L42,10z\"/>\n        </symbol>\n        <symbol id=\"zui-tag\" viewBox=\"0 0 48 48\">\n            <title>zui-tag</title>\n            <path d=\"M42.5,23.9V8.5c0-1.6-1.3-3-2.9-3c0,0-0.1,0-0.1,0H24.1c-0.8,0-1.5,0.3-2,0.9L5.4,23c-1.2,1.1-1.2,3,0,4.2c0,0,0,0,0,0\n\tl15.4,15.4c1.1,1.2,3,1.2,4.2,0c0,0,0,0,0,0L41.7,26c0.5-0.5,0.8-1.2,0.9-2 M37.3,10.3c1.2,1,1.4,2.8,0.4,4s-2.8,1.4-4,0.4\n\tc-0.1-0.1-0.3-0.2-0.4-0.4c-1-1.2-0.8-3,0.4-4C34.7,9.4,36.3,9.4,37.3,10.3 M25.2,35.5L12.5,22.8l2.8-2.8L28,32.7L25.2,35.5z\"/>\n        </symbol>\n        <symbol id=\"zui-unlink\" viewBox=\"0 0 48 48\">\n            <title>zui-unlink</title>\n            <path d=\"M36,14H26v4h10c3.3,0,6,2.7,6,6s-2.7,6-6,6H26v4h10c5.5,0,10-4.5,10-10S41.5,14,36,14z M22,30H12c-3.3,0-6-2.7-6-6\n\ts2.7-6,6-6h10v-4H12C6.5,14,2,18.5,2,24s4.5,10,10,10h10V30z\"/>\n            <path d=\"M14,22h20v4H14V22z\"/>\n        </symbol>\n        <symbol id=\"zui-unlock\" viewBox=\"0 0 48 48\">\n            <title>zui-unlock</title>\n            <path d=\"M36,20.8H18v-7.3c0-3.3,2.7-6,6-6s6,2.7,6,6c0,1.1,0.9,2,2,2s2-0.9,2-2c0-5.5-4.5-10-10-10S14,8,14,13.5v7.3h-2\n\tc-2.2,0-4,1.8-4,4v14c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-14C40,22.6,38.2,20.8,36,20.8z M24,38.8c-3.3,0-6-2.7-6-6s2.7-6,6-6\n\ts6,2.7,6,6S27.3,38.8,24,38.8z\"/>\n        </symbol>\n        <symbol id=\"zui-upload\" viewBox=\"0 0 48 48\">\n            <title>zui-upload</title>\n            <path d=\"M6,6.7h36v4H6V6.7z\"/>\n            <path d=\"M13.7,25l7.5-7.5l0.8-0.8l2-2l2,2l0.8,0.8l7.5,7.5l-2.8,2.8L26,22.4v17.5h-4V22.4l-5.5,5.5L13.7,25z\"/>\n        </symbol>\n        <symbol id=\"zui-user\" viewBox=\"0 0 48 48\">\n            <title>zui-user</title>\n            <circle cx=\"24\" cy=\"16\" r=\"8\"/>\n            <path d=\"M40,40v-7.5c-9.8-6.1-22.2-6.1-32,0V40H40z\"/>\n        </symbol>\n        <symbol id=\"zui-user-add\" viewBox=\"0 0 48 48\">\n            <title>zui-user-add</title>\n            <circle cx=\"28\" cy=\"16\" r=\"8\"/>\n            <path d=\"M44,40v-7.5c-9.8-6.1-22.2-6.1-32,0V40H44z\"/>\n            <path d=\"M8,16h4v12H8V16z\"/>\n            <path d=\"M4,20h12v4H4V20z\"/>\n        </symbol>\n        <symbol id=\"zui-wrench\" viewBox=\"0 0 48 48\">\n            <title>zui-wrench</title>\n            <path d=\"M40.5,13.2L35.6,18l-4.2-1.5L30,12.3l4.9-4.9c-4.3-1.1-8.6,1.4-9.8,5.7c-0.4,1.3-0.4,2.8,0,4.1L9.3,32.9\n\tc-1.6,1.6-1.6,4.1,0,5.7s4.1,1.6,5.7,0l15.7-15.7c4.3,1.1,8.6-1.4,9.8-5.7C40.9,15.8,40.9,14.4,40.5,13.2L40.5,13.2z M10.8,37.3\n\tc-0.8-0.8-0.8-2.1,0-2.8s2.1-0.8,2.8,0c0.8,0.8,0.8,2,0,2.8C12.8,38,11.6,38,10.8,37.3C10.8,37.3,10.8,37.3,10.8,37.3z\"/>\n        </symbol>\n\n\n    \n    <!-- Alerts -->\n    \n        <symbol id=\"zui-alert-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-alert-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M22,12h4v16h-4V12z M24,36c-1.4,0-2.5-1.1-2.5-2.5S22.6,31,24,31\n\ts2.5,1.1,2.5,2.5S25.4,36,24,36z\"/>\n        </symbol>\n        <symbol id=\"zui-alert\" viewBox=\"0 0 48 48\">\n            <title>zui-alert</title>\n            <path d=\"M46.8,39.3c-0.1-0.4-0.2-0.8-0.4-1.1l-7.7-13.3L27.6,5.5C27.2,4.9,26.7,4.3,26,4c-0.6-0.3-1.3-0.5-2-0.5\n\tc-1.4,0-2.7,0.8-3.5,2L1.7,38.2c-1.1,1.9-0.4,4.4,1.5,5.5c0.6,0.4,1.3,0.5,2,0.5h37.7c2.2,0,4-1.8,4-4\n\tC46.9,39.9,46.9,39.6,46.8,39.3 M26,30.2h-4v-16h4V30.2z M24,39.1c-1.4,0-2.5-1.1-2.5-2.5s1.1-2.5,2.5-2.5s2.5,1.1,2.5,2.5\n\tC26.5,38,25.4,39.1,24,39.1z\"/>\n        </symbol>\n        <symbol id=\"zui-bell\" viewBox=\"0 0 48 48\">\n            <title>zui-bell</title>\n            <path d=\"M24,45.5c2.2,0,4-1.8,4-4h-8C20,43.7,21.8,45.5,24,45.5z M42,36.5c0,0.3,0,0.7,0,1H6.1C6,37.2,6,36.8,6,36.5\n\tc0-2.4,1.7-4.4,4-4.9V21.5c0-6.6,4.6-12.3,11-13.7V6.5c0-1.7,1.3-3,3-3s3,1.3,3,3v1.3c6.4,1.4,11,7.1,11,13.7v10.1\n\tC40.3,32.1,42,34.1,42,36.5z\"/>\n        </symbol>\n        <symbol id=\"zui-bell-ringing\" viewBox=\"0 0 48 48\">\n            <title>zui-bell-ringing</title>\n            <path d=\"M24,45.5c2.2,0,4-1.8,4-4h-8C20,43.7,21.8,45.5,24,45.5z M42,36.5c0,0.3,0,0.7,0,1H6.1C6,37.2,6,36.8,6,36.5\n\tc0-2.4,1.7-4.4,4-4.9V21.5c0-6.6,4.6-12.3,11-13.7V6.5c0-1.7,1.3-3,3-3s3,1.3,3,3v1.3c6.4,1.4,11,7.1,11,13.7v10.1\n\tC40.3,32.1,42,34.1,42,36.5z\"/>\n            <path d=\"M42.5,23.5h3c0-8-4.4-15.3-11.5-19V8C39.3,11.4,42.5,17.2,42.5,23.5z M14,8V4.5c-7.1,3.7-11.5,11-11.5,19h3\n\tC5.5,17.2,8.7,11.4,14,8z\"/>\n        </symbol>\n        <symbol id=\"zui-check-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-check-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M32.7,20L22.5,30.2l-1.3,1.2l-0.7,0.7l-0.7-0.7l-1.2-1.2l-3.1-3.1\n\tl-0.7-0.7l0.7-0.7l1.3-1.3l0.7-0.7l0.7,0.7l2.4,2.4l9.5-9.5l0.7-0.7l0.7,0.7l1.3,1.3l0.7,0.7L32.7,20z\"/>\n        </symbol>\n        <symbol id=\"zui-close-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-close-circle</title>\n            <path d=\"M38.1,9.9C30.3,2,17.7,2,9.9,9.9S2,30.3,9.9,38.1s20.5,7.8,28.3,0c0,0,0,0,0,0C45.9,30.3,45.9,17.7,38.1,9.9z M32.5,31.1\n\tl-1.4,1.4l-0.7,0.7l-0.7-0.7L24,26.8l-5.7,5.7l-0.7,0.7l-0.7-0.7l-1.4-1.4l-0.7-0.7l0.7-0.7l5.7-5.7l-5.7-5.7l-0.7-0.7l0.7-0.7\n\tl1.4-1.4l0.7-0.7l0.7,0.7l5.7,5.7l5.7-5.7l0.7-0.7l0.7,0.7l1.4,1.4l0.7,0.7l-0.7,0.7L26.8,24l5.7,5.7l0.7,0.7L32.5,31.1z\"/>\n        </symbol>\n        <symbol id=\"zui-help\" viewBox=\"0 0 48 48\">\n            <title>zui-help</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M29.4,23.4c-0.7,0.7-1.4,1.4-2.2,2c-1.3,1-1.3,1-1.3,2.6h-4\n\tc-0.3-2.3,0.8-4.5,2.7-5.7c0.5-0.4,1.1-0.9,1.9-1.7c1-1.3,1.3-3,0.6-4.5c-0.5-1.3-1.8-2.2-3.2-2.1c-3.7,0-4,3.9-4,4.3l-4-0.2\n\tc0-4.4,3.6-8,8-8.1c3-0.1,5.8,1.8,6.9,4.6C32.2,17.6,31.6,21,29.4,23.4z M24,37c-1.4,0-2.5-1.1-2.5-2.5S22.6,32,24,32\n\ts2.5,1.1,2.5,2.5S25.4,37,24,37z\"/>\n        </symbol>\n        <symbol id=\"zui-info\" viewBox=\"0 0 48 48\">\n            <title>zui-info</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M26,36h-4V20h4V36z M24,16.5c-1.4,0-2.5-1.1-2.5-2.5\n\tc0-1.4,1.1-2.5,2.5-2.5c1.4,0,2.5,1.1,2.5,2.5C26.5,15.4,25.4,16.5,24,16.5C24,16.5,24,16.5,24,16.5z\"/>\n        </symbol>\n        <symbol id=\"zui-minus-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-minus-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M36,26H12v-4h24V26z\"/>\n        </symbol>\n        <symbol id=\"zui-plus-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-plus-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M35,23v3h-9v9h-4v-9h-9v-4h9v-9h4v9h9V23z\"/>\n        </symbol>\n\n\n\n    <!-- Directional -->\n   \n        <symbol id=\"zui-arrow-down\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-down</title>\n            <path d=\"M24,44L8,28.3l2.8-2.8l11.2,11V4h4v32.5l11.2-11l2.8,2.8L26.8,41.2L24,44z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-down-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-down-circle</title>\n            <path d=\"M46,24c0-12.2-9.8-22-22-22S2,11.8,2,24s9.8,22,22,22S46,36.2,46,24z M14,23.8h5.4V12h9.2v11.8H34L24,38L14,23.8z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-left\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-left</title>\n            <path d=\"M4,24L19.7,8l2.8,2.8L11.5,22H44v4H11.5l11,11.2L19.7,40L6.8,26.8L4,24z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-left-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-left-circle</title>\n            <path d=\"M24,46c12.2,0,22-9.8,22-22S36.2,2,24,2S2,11.8,2,24S11.8,46,24,46z M24.2,14v5.4H36v9.2H24.2V34L10,24L24.2,14z\"/> \n        </symbol>\n        <symbol id=\"zui-arrow-right\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-right</title>\n            <path d=\"M44,24L28.3,40l-2.8-2.8l11-11.2H4v-4h32.5l-11-11.2L28.3,8l12.9,13.2L44,24z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-right-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-right-circle</title>\n            <path d=\"M24,2C11.8,2,2,11.8,2,24s9.8,22,22,22s22-9.8,22-22S36.2,2,24,2z M23.8,34v-5.4H12v-9.2h11.8V14L38,24L23.8,34z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-up\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-up</title>\n            <path d=\"M24,4l16,15.7l-2.8,2.8L26,11.5V44h-4V11.5l-11.2,11L8,19.7L21.2,6.8L24,4z\"/>\n        </symbol>\n        <symbol id=\"zui-arrow-up-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-arrow-up-circle</title>\n            <path d=\"M2,24c0,12.2,9.8,22,22,22s22-9.8,22-22S36.2,2,24,2S2,11.8,2,24z M34,24.2h-5.4V36h-9.2V24.2H14L24,10L34,24.2z\"/> \n        </symbol>\n        <symbol id=\"zui-caret-down\" viewBox=\"0 0 48 48\">\n            <title>zui-caret-down</title>\n            <path d=\"M32,18.5H16l8,10L32,18.5z\"/>\n        </symbol>\n        <symbol id=\"zui-caret-left\" viewBox=\"0 0 48 48\">\n            <title>zui-caret-left</title>\n            <path d=\"M27.5,32V16l-10,8L27.5,32z\"/>\n        </symbol>\n        <symbol id=\"zui-caret-right\" viewBox=\"0 0 48 48\">\n            <title>zui-caret-right</title>\n            <path d=\"M19.5,16v16l10-8L19.5,16z\"/>\n        </symbol>\n        <symbol id=\"zui-caret-up\" viewBox=\"0 0 48 48\">\n            <title>zui-caret-up</title>\n            <path d=\"M16,27.5h16l-8-10L16,27.5z\"/>\n        </symbol>\n        <symbol id=\"zui-chevron-down\" viewBox=\"0 0 48 48\">\n            <title>zui-chevron-down</title>\n            <path d=\"M30.6,17.9l2.9,2.9L24,30.3l-9.5-9.5l2.9-2.9l6.6,6.6L30.6,17.9z\"/>\n        </symbol>\n        <symbol id=\"zui-chevron-left\" viewBox=\"0 0 48 48\">\n            <title>zui-chevron-left</title>\n            <path d=\"M30.1,30.6l-2.9,2.9L17.7,24l9.5-9.5l2.9,2.9L23.5,24L30.1,30.6z\"/>\n        </symbol>\n        <symbol id=\"zui-chevron-right\" viewBox=\"0 0 48 48\">\n            <title>zui-chevron-right</title>\n            <path d=\"M17.9,17.4l2.9-2.9l9.5,9.5l-9.5,9.5l-2.9-2.9l6.6-6.6L17.9,17.4z\"/>\n        </symbol>\n        <symbol id=\"zui-chevron-up\" viewBox=\"0 0 48 48\">\n            <title>zui-chevron-up</title>\n            <path d=\"M17.4,30.1l-2.9-2.9l9.5-9.5l9.5,9.5l-2.9,2.9L24,23.5L17.4,30.1z\"/>\n        </symbol>\n        <symbol id=\"zui-double-chevron-left\" viewBox=\"0 0 48 48\">\n            <title>zui-double-chevron-left</title>\n            <path d=\"M24.4,30.3l-2.9,2.9L12,23.8l9.5-9.5l2.9,2.9l-6.6,6.6L24.4,30.3z\"/>\n            <path d=\"M35.9,30.3L33,33.3l-9.5-9.5l9.5-9.5l2.9,2.9l-6.6,6.6L35.9,30.3z\"/>\n        </symbol>\n        <symbol id=\"zui-double-chevron-right\" viewBox=\"0 0 48 48\">\n            <title>zui-double-chevron-right</title>\n            <path d=\"M23.6,17.7l2.9-2.9l9.5,9.5l-9.5,9.5l-2.9-2.9l6.6-6.6L23.6,17.7z\"/>\n            <path d=\"M12.1,17.7l2.9-2.9l9.5,9.5L15,33.8l-2.9-2.9l6.6-6.6L12.1,17.7z\"/>\n        </symbol>\n        <symbol id=\"zui-down\" viewBox=\"0 0 48 48\">\n            <title>zui-down</title>\n            <path d=\"M37.1,15.3l2.9,2.9l-16,16l-16-16l2.9-2.9L24,28.4L37.1,15.3z\"/>\n        </symbol>\n        <symbol id=\"zui-left\" viewBox=\"0 0 48 48\">\n            <title>zui-left</title>\n            <path d=\"M32.7,37.1L29.8,40l-16-16l16-16l2.9,2.9L19.6,24L32.7,37.1z\"/>\n        </symbol>\n        <symbol id=\"zui-right\" viewBox=\"0 0 48 48\">\n            <title>zui-right</title>\n            <path d=\"M15.3,10.9L18.2,8l16,16l-16,16l-2.9-2.9L28.4,24L15.3,10.9z\"/>\n        </symbol>\n        <symbol id=\"zui-up\" viewBox=\"0 0 48 48\">\n            <title>zui-up</title>\n            <path d=\"M10.9,32.7L8,29.8l16-16l16,16l-2.9,2.9L24,19.6L10.9,32.7z\"/>\n        </symbol>\n        \n\n\n\n    <!-- File -->\n\n        <symbol id=\"zui-file-documents\" viewBox=\"0 0 48 48\">\n            <title>zui-file-documents</title>\n            <path d=\"M36,12v24c0,2.2-1.8,4-4,4H16c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V16C40,13.8,38.2,12,36,12z\"/>\n            <path d=\"M28,4H12C9.8,4,8,5.8,8,8v24c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V8C32,5.8,30.2,4,28,4z M28,13H12v-3h16V13z M28,19H12v-3\n\th16V19z M22,25H12v-3h10V25z\"/>\n        </symbol>\n        <symbol id=\"zui-file-excel\" viewBox=\"0 0 48 48\">\n            <title>zui-file-excel</title>\n            <path d=\"M40,13.9l-10-10v10H40z\"/>\n            <path d=\"M26,17.9v-14H12c-2.2,0-4,1.8-4,4v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-22L26,17.9z M27.8,37.5l-3-5.4l-3,5.5H18l4.7-7.9\n\tl-4.6-7.7h3.7l2.9,5.4l2.9-5.4h3.7l-4.6,7.7l4.7,7.9L27.8,37.5z\"/>\n        </symbol>\n        <symbol id=\"zui-file-pdf\" viewBox=\"0 0 48 48\">\n            <title>zui-file-pdf</title>\n            <path d=\"M40,13.9l-10-10v10H40z M23.8,30l-0.5,0.9l0,0l-0.6,1h2.2l-0.6-1C24.3,30.9,23.8,30,23.8,30z M17,34.9\n\tc-0.3-0.3-0.7-0.5-1.1-0.5c-0.8,0-1.5,0.7-1.5,1.5s0.7,1.5,1.5,1.5c0.2,0,0.3,0,0.5,0c0.6-0.2,1-0.8,1-1.4c0-0.2,0-0.4-0.1-0.6\n\tC17.2,35.2,17.1,35,17,34.9z M23.8,22.3c-0.7,0-1.3,0.5-1.4,1.1c0,0.1,0,0.3,0,0.4c0,0.7,0.5,1.3,1.1,1.4c0.1,0,0.2,0,0.4,0\n\tc0.1,0,0.2,0,0.3,0c0.7-0.1,1.2-0.7,1.2-1.5c0-0.2,0-0.4-0.1-0.5C25.1,22.7,24.5,22.3,23.8,22.3z M32.1,34.4h-0.2\n\tc-0.7,0-1.3,0.5-1.4,1.1c0,0.1,0,0.3,0,0.4c0,0.3,0.1,0.5,0.2,0.8c0.3,0.4,0.8,0.7,1.3,0.7c0.8,0,1.5-0.7,1.5-1.5\n\tC33.4,35.2,32.9,34.5,32.1,34.4L32.1,34.4z\"/>\n            <path d=\"M26,17.9v-14H12c-2.2,0-4,1.8-4,4v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-22L26,17.9z M31.8,39.9c-1.4,0-2.7-0.8-3.5-2\n\tv-0.1l-1.7-2.9h-5.8c-0.6,1.3-1.3,2.6-2.2,3.8c-0.8,0.8-1.8,1.2-2.9,1.2c-2.2,0-4-1.8-4-4s1.8-4,4-4h3.4l2.3-4l-1-1.7v-0.1l-0.3-0.5\n\tc-0.3-0.5-0.4-1.1-0.4-1.7c0-2.2,1.8-4,4-4c1.5,0,2.9,0.8,3.5,2.2c0.3,0.6,0.4,1.2,0.4,1.8c0,0.6-0.1,1.2-0.4,1.7l-0.3,0.5l-1,1.7\n\tl2.3,4h3.7c2.1,0.1,3.7,1.9,3.7,4c0.1,2.2-1.7,4-3.9,4.1C32,39.9,31.9,39.9,31.8,39.9z\"/>\n        </symbol>\n        <symbol id=\"zui-file-powerpoint\" viewBox=\"0 0 48 48\">\n            <title>zui-file-powerpoint</title>\n            <path d=\"M40,13.9l-10-10v10H40z\"/>\n            <path d=\"M26,17.9v-14H12c-2.2,0-4,1.8-4,4v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-22L26,17.9z M28.4,31.1c-1.2,0.9-2.8,1.4-4.4,1.3\n\th-2.8v5.5H18V22.3h6c1.1,0,2.1,0.2,3.1,0.6c0.8,0.4,1.5,1,2,1.8c0.6,0.8,0.9,1.7,0.9,2.7C30.1,28.8,29.5,30.2,28.4,31.1z\"/>\n            <path d=\"M26,25.9c0.5,0.5,0.7,1.2,0.7,1.8c0,0.6-0.2,1.3-0.7,1.7c-0.6,0.4-1.3,0.7-2,0.6h-2.7v-4.9h2.9C24.9,25.1,25.6,25.4,26,25.9\n\t\"/>\n        </symbol>\n        <symbol id=\"zui-file-word\" viewBox=\"0 0 48 48\">\n            <title>zui-file-word</title>\n            <path d=\"M40,13.9l-10-10v10H40z\"/>\n            <path d=\"M26,17.9v-14H12c-2.2,0-4,1.8-4,4v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4v-22L26,17.9z M29.1,37.9h-3.3l-2.5-10.5l-2.5,10.5\n\th-3.3L14,22.3h3.2l2.1,11.1L22,22.3h2.7l2.6,11.1l2-11.1h3.2L29.1,37.9z\"/>\n        </symbol>\n        <symbol id=\"zui-file-zip\" viewBox=\"0 0 48 48\">\n            <title>zui-file-zip</title>\n            <path d=\"M36,4H24v4h4v4h-4v4h4v4h-4v4h4v16h-8V28h4v-4h-4v-4h4v-4h-4v-4h4V8h-4V4h-8C9.8,4,8,5.8,8,8v32c0,2.2,1.8,4,4,4h24\n\tc2.2,0,4-1.8,4-4V8C40,5.8,38.2,4,36,4z\"/>\n            <path d=\"M22.4,34.4h3v3h-3V34.4z\"/>\n        </symbol>\n\n\n\n    <!-- Miscellaneous -->\n\n        <symbol id=\"zui-add\" viewBox=\"0 0 48 48\">\n            <title>zui-add</title>\n            <path d=\"M10,34V14c-2.2,0-4,1.8-4,4v20c0,2.2,1.8,4,4,4h20c2.2,0,4-1.8,4-4H14C11.8,38,10,36.2,10,34z\"/>\n            <path d=\"M38,6H18c-2.2,0-4,1.8-4,4v20c0,2.2,1.8,4,4,4h20c2.2,0,4-1.8,4-4V10C42,7.8,40.2,6,38,6z M34,22h-4v4h-4v-4h-4v-4h4v-4h4v4\n\th4V22z\"/>\n        </symbol>\n        <symbol id=\"zui-building\" viewBox=\"0 0 48 48\">\n            <title>zui-building</title>\n            <path d=\"M8,4h32v4H8V4z\"/>\n            <path d=\"M10,6v34c0,2.2,1.8,4,4,4h2V34h6v10h12c2.2,0,4-1.8,4-4V6H10z M32,40h-6v-6h6V40z M32,30h-6v-6h6V30z M22,30h-6v-6h6V30z\n\t M22,20h-6v-6h6V20z M32,20h-6v-6h6V20z\"/>\n        </symbol>\n        <symbol id=\"zui-calendar\" viewBox=\"0 0 48 48\">\n            <title>zui-calendar</title>\n            <path d=\"M38,8.5h-2v2.3c0,1.3-0.7,2.5-1.8,3.1c-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2h-8v2.3c0,1.3-0.7,2.5-1.8,3.1\n\tc-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2H9.3C7.5,8.5,6,10,6,11.8v27.4c0,1.8,1.5,3.3,3.3,3.3h29.4\n\tc1.8,0,3.3-1.5,3.3-3.3V12.5C42,10.3,40.2,8.5,38,8.5 M10,38.5v-20h28v20 M16,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4\n\tC18,11.6,17.1,12.5,16,12.5 M32,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4C34,11.6,33.1,12.5,32,12.5 M18,26.5h-4v-4h4\n\tV26.5z M26,26.5h-4v-4h4V26.5z M34,26.5h-4v-4h4V26.5z M18,34.5h-4v-4h4V34.5z M26,34.5h-4v-4h4V34.5z M34,34.5h-4v-4h4V34.5z\"/>\n        </symbol>\n        <symbol id=\"zui-calendar-check\" viewBox=\"0 0 48 48\">\n            <title>zui-calendar-check</title>\n            <path d=\"M38,8.5h-2v2.3c0,1.3-0.7,2.5-1.8,3.1c-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2h-8v2.3c0,1.3-0.7,2.5-1.8,3.1\n\tc-1.8,1.2-4.3,0.7-5.5-1.1c-0.4-0.7-0.7-1.5-0.7-2.3v-2H9.3C7.5,8.5,6,10,6,11.8v27.4c0,1.8,1.5,3.3,3.3,3.3h29.4\n\tc1.8,0,3.3-1.5,3.3-3.3V12.5C42,10.3,40.2,8.5,38,8.5 M10,38.5v-20h28v20 M16,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4\n\tC18,11.6,17.1,12.5,16,12.5 M32,12.5c-1.1,0-2-0.9-2-2v-4c0-1.1,0.9-2,2-2s2,0.9,2,2v4C34,11.6,33.1,12.5,32,12.5\"/>\n            <path d=\"M33,23.2l-9.2,9.2l-2.1,2.1L16,28.8l2.1-2.1l3.5,3.5l9.2-9.2L33,23.2z\"/>\n        </symbol>\n        <symbol id=\"zui-carrier-shield\" viewBox=\"0 0 48 48\">\n            <title>zui-carrier-shield</title>\n            <path d=\"M19,33.5c0-8.3,6.7-15,15-15c1.4,0,2.7,0.2,4,0.6V7.5c-6,0-16-4-16-4c-5,2.4-10.5,3.8-16,4v22c0,6,16,14,16,14l0.6-0.3\n\tC20.3,40.5,19,37.1,19,33.5z\"/>\n            <path d=\"M34,21.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S40.6,21.5,34,21.5z M32.4,41.7l-6.5-6.5l2.8-2.8l3.5,3.4l6.9-8.3\n\tl3.1,2.6L32.4,41.7z\"/>\n        </symbol>\n        <symbol id=\"zui-carrier-umbrella\" viewBox=\"0 0 48 48\">\n            <title>zui-carrier-umbrella</title>\n            <path d=\"M44,22.1c-3.9-2.9-9.4-2.5-12.9,0.9c-1.4-1.4-3.2-2.3-5.1-2.7v17.8c0.3,3-2,5.7-5,6s-5.7-2-6-5c0-0.3,0-0.6,0-0.9v-1.5h3\n\tv1.5c0,0.5,0.2,3,2.5,3s2.5-2.5,2.5-3v-18c-2.3,0.2-4.4,1.2-6,2.8c-3.5-3.4-9-3.7-12.9-0.8c0.8-11,10.3-19.3,21.4-18.5\n\tC35.4,4.3,43.3,12.2,44,22.1z\"/>\n        </symbol>\n        <symbol id=\"zui-chart-bar\" viewBox=\"0 0 48 48\">\n            <title>zui-chart-bar</title>\n            <path d=\"M8,40h32v4H8V40z M8,24h8v12H8V24z M20,14h8v22h-8V14z M32,4h8v32h-8V4z\"/>\n        </symbol>\n        <symbol id=\"zui-chart-line\" viewBox=\"0 0 48 48\">\n            <title>zui-chart-line</title>\n            <path d=\"M42,38v4H6V6h4v32H42z\"/>\n            <path d=\"M40.9,16.2l-8.5,8.5c-0.8,0.7-2,0.7-2.7,0l-4.3-4.3l-7.1,7.1c-0.8,0.8-2,0.8-2.8,0c-0.8-0.8-0.8-2,0-2.8c0,0,0,0,0,0\n\tl8.2-8.2c1-1,2.5-1,3.5,0c0,0,0,0,0,0l4,4l6.9-7.1c0.8-0.8,2-0.8,2.8,0c0,0,0,0,0,0C41.6,14.2,41.6,15.4,40.9,16.2z\"/>\n        </symbol>\n        <symbol id=\"zui-chart-pie\" viewBox=\"0 0 48 48\">\n            <title>zui-chart-pie</title>\n            <path d=\"M22,22V4.1c-9.5,1-17,8.5-17.9,18L22,22z M22,26H4.1c0.9,9.5,8.5,17.1,18,18L22,26z M26,4.1V44c11-1.1,19-10.9,17.9-21.9\n\tc-1-9.5-8.4-17-17.9-17.9V4.1z\"/>\n        </symbol>\n        <symbol id=\"zui-dislike\" viewBox=\"0 0 48 48\">\n            <title>zui-dislike</title>\n            <path d=\"M42.2,30h-6V10h6V30z\"/>\n            <path d=\"M5.7,24.9l3.6-12c0.5-1.7,2.1-2.9,3.8-2.9h15c2.2,0,4,1.8,4,4v12c0,0.1,0,0.3,0,0.4c0.1,0.9-0.1,1.9-0.7,2.7L22.2,42\n\tL20,39.9c-1.1-1.1-1.5-2.9-0.9-4.3l2.3-5.5h-12c-2.2,0-4-1.9-3.9-4.1C5.5,25.6,5.6,25.2,5.7,24.9z\"/>\n        </symbol>\n        <symbol id=\"zui-help-user\" viewBox=\"0 0 48 48\">\n            <title>zui-help-user</title>\n            <circle cx=\"17\" cy=\"12.5\" r=\"7\"/>\n            <path d=\"M31,17.5c-7.2,0-13,5.8-13,13s5.8,13,13,13s13-5.8,13-13S38.2,17.5,31,17.5z M34.5,30.1c-0.6,0.6-1,0.9-1.4,1.3\n\tc-0.8,0.7-0.8,0.7-0.8,1.7h-2.6c-0.1-1.5,0.5-2.9,1.8-3.7c0.4-0.3,0.8-0.7,1.2-1.1c0.7-0.8,0.8-1.9,0.4-2.9c-0.3-0.8-1.1-1.4-2-1.4\n\tc-2.4,0-2.6,2.5-2.6,2.8l-2.6-0.1c0.1-2.8,2.3-5.1,5.1-5.2c2,0,3.8,1.1,4.5,3C36.3,26.4,35.9,28.6,34.5,30.1z M31,39\n\tc-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6c0.9,0,1.6,0.7,1.6,1.6C32.6,38.2,31.9,39,31,39z\"/>\n            <path d=\"M14,30.5c0-2.4,0.5-4.8,1.5-7c-4.1,0.3-8,1.6-11.5,3.8v6.2h10.3C14.1,32.5,14,31.5,14,30.5z\"/>\n        </symbol>\n        <symbol id=\"zui-lightning-bolt\" viewBox=\"0 0 48 48\">\n            <title>zui-lightning-bolt</title>\n            <path d=\"M19.5,6h16l-8,14h8l-18,22l2-16h-6L19.5,6z\"/>\n        </symbol>\n        <symbol id=\"zui-like\" viewBox=\"0 0 48 48\">\n            <title>zui-like</title>\n            <path d=\"M5.8,18h6v20h-6V18z M42.3,23.1l-3.6,12c-0.5,1.7-2.1,2.9-3.8,2.9h-15c-2.2,0-4-1.8-4-4V22c0-0.1,0-0.3,0-0.4\n\tc-0.1-0.9,0.1-1.9,0.7-2.7L25.8,6L28,8.1c1.1,1.1,1.5,2.9,0.9,4.3L26.5,18h12c2.2,0,4,1.9,3.9,4.1C42.5,22.4,42.4,22.8,42.3,23.1z\" />\n        </symbol>\n        <symbol id=\"zui-location\" viewBox=\"0 0 48 48\">\n            <title>zui-location</title>\n            <path d=\"M24,4c-7.7,0-14,6.3-14,14c0,10,12,26,14,26s14-16,14-26C38,10.3,31.7,4,24,4z M24,24c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6\n\tS27.3,24,24,24z\"/>\n        </symbol>\n        <symbol id=\"zui-medicine\" viewBox=\"0 0 48 48\">\n            <title>zui-medicine</title>\n            <path d=\"M18,5h12v4H18V5z M12,37c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4v-4H12V37z M32,9H16c-2.2,0-4,1.8-4,4v4h24v-4\n\tC36,10.8,34.2,9,32,9z M29.1,23.5v3h-3.5V30h-3v-3.5h-3.5v-3h3.5V20h3v3.5H29.1z\"/>\n        </symbol>\n        <symbol id=\"zui-network\" viewBox=\"0 0 48 48\">\n            <title>zui-network</title>\n            <path d=\"M18,20c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S24.6,20,18,20z M18,24c2.2,0,4,1.8,4,4s-1.8,4-4,4s-4-1.8-4-4\n\tS15.8,24,18,24z M18,41.2c-2.2,0-4.4-0.8-6-2.4c1.4-1.9,3.6-3,6-2.9c2.4-0.1,4.6,1,6,2.9C22.4,40.4,20.2,41.3,18,41.2z\"/>\n            <path d=\"M13,11h4v12h-4V11z\"/>\n            <path d=\"M15,7c1.1,0,2,0.9,2,2c0,1.1-0.9,2-2,2s-2-0.9-2-2C13,7.9,13.9,7,15,7 M15,4c-2.8,0-5,2.2-5,5s2.2,5,5,5s5-2.2,5-5\n\tS17.8,4,15,4z\"/>\n            <path d=\"M34.2,11l2.8,2.8L24.4,26.4l-2.8-2.8L34.2,11z\"/>\n            <path d=\"M37,9c0.5,0,1,0.2,1.4,0.6c0.8,0.8,0.8,2,0,2.8c0,0,0,0,0,0c-0.8,0.8-2,0.8-2.8,0c0,0,0,0,0,0c-0.8-0.8-0.8-2,0-2.8\n\tc0,0,0,0,0,0C36,9.2,36.5,9,37,9 M37,6c-2.8,0-5,2.2-5,5c0,2.8,2.2,5,5,5c2.8,0,5-2.2,5-5c0-1.3-0.5-2.6-1.5-3.5\n\tC39.6,6.5,38.3,6,37,6z\"/>\n            <path d=\"M34,30v4H22v-4H34z\"/>\n            <path d=\"M36,30c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S34.9,30,36,30 M36,27c-2.8,0-5,2.2-5,5s2.2,5,5,5s5-2.2,5-5S38.8,27,36,27z\" />\n        </symbol>\n        <symbol id=\"zui-pill\" viewBox=\"0 0 48 48\">\n            <title>zui-pill</title>\n            <path d=\"M38.1,9.9C34.2,6,27.9,6,24,9.9L9.8,24c-1.5,1.5-2.5,3.5-2.8,5.6c-0.7,5.5,3.1,10.5,8.6,11.3c0.9,0.1,1.8,0.1,2.7,0\n\tc2.1-0.3,4.1-1.2,5.7-2.7L38.1,24C42,20.1,42,13.8,38.1,9.9z M26.8,12.7c2.3-2.3,6.2-2.3,8.5,0s2.3,6.2,0,8.5l-7.1,7.1l-8.5-8.5\n\tL26.8,12.7z\"/>\n        </symbol>\n        <symbol id=\"zui-syringe\" viewBox=\"0 0 48 48\">\n            <title>zui-syringe</title>\n            <path d=\"M35.1,15.8l2.8-2.8l2.8,2.8l2.8-2.8l-8.5-8.5l-2.8,2.8l2.8,2.8l-2.8,2.8L28,8.7l-17,17l1.4,1.4l-1.7,1.8l2.9,2.8l-6.8,6.8\n\tl-1.5,4.2l4.2-1.4l6.8-6.8l2.8,2.8l1.8-1.7l1.4,1.4l17-17L35.1,15.8z M33.7,20L22.3,31.3l-2.8-2.9l11.3-11.3L33.7,20z\"/>\n        </symbol>\n        <symbol id=\"zui-user-check\" viewBox=\"0 0 48 48\">\n            <title>zui-user-check</title>\n            <path d=\"M32,20c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S38.6,20,32,20z M30.4,40.2l-6.5-6.5l2.8-2.8l3.5,3.4L37,26l3.1,2.6\n\tL30.4,40.2z\"/>\n            <path d=\"M17,32H8v-5.6c3.6-2.2,7.8-3.4,12-3.4c2.8-3.8,7.3-6,12-6c1.4,0,2.7,0.2,4,0.6V8c0-2.2-1.8-4-4-4H8C5.8,4,4,5.8,4,8v24\n\tc0,2.2,1.8,4,4,4h9.6C17.2,34.7,17,33.4,17,32z M20,8c3.3,0,6,2.7,6,6s-2.7,6-6,6s-6-2.7-6-6S16.7,8,20,8z\"/>\n        </symbol>\n\n\n\n    <!-- Navigation -->\n\n        <symbol id=\"zui-account-management\" viewBox=\"0 0 48 48\">\n            <title>zui-account-management</title>\n            <circle cx=\"15\" cy=\"13\" r=\"5\"/>\n            <path d=\"M14,32.5c0-0.7,0.1-1.5,0.3-2.2c1.4-3.4,4.3-6,7.9-7C19.9,22.4,17.5,22,15,22c-5.5,0-10.1,2.1-10.9,4.8\n\tC4,27.1,4,27.3,4,27.6V34h10V32.5z M44,32.5V40H18v-7.5c0-0.3,0-0.6,0.1-0.9C19,28.4,24.5,26,31,26s12,2.5,12.9,5.6\n\tC44,31.9,44,32.2,44,32.5z\"/>\n            <circle cx=\"31\" cy=\"15\" r=\"7\"/>\n        </symbol>\n        <symbol id=\"zui-accounts\" viewBox=\"0 0 48 48\">\n            <title>zui-accounts</title>\n            <path d=\"M40,12v24c0,2.2-1.8,4-4,4H12c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V16C44,13.8,42.2,12,40,12z\"/>\n            <path d=\"M32,4H8C5.8,4,4,5.8,4,8v24c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V8C36,5.8,34.2,4,32,4z M20,8c3.3,0,6,2.7,6,6s-2.7,6-6,6\n\ts-6-2.7-6-6S16.7,8,20,8z M32,32H8v-5.6c7.4-4.5,16.6-4.5,24,0V32z\"/>\n        </symbol>\n        <symbol id=\"zui-admin\" viewBox=\"0 0 48 48\">\n            <title>zui-admin</title>\n            <path d=\"M17,34v-7h3l-2-2l0.9-0.9C13.6,24.3,8.5,25.8,4,28.5V36h13V34z M23.8,19l1.2-1.2l0.2,0.2c3.4-2.9,3.8-7.9,0.9-11.3\n\tC23.1,3.4,18.1,3,14.7,5.9s-3.8,7.9-0.9,11.3C15.4,19,17.6,20,20,20C21.3,20,22.6,19.7,23.8,19z\"/>\n            <path d=\"M44,34v-4h-2.2c-0.3-1.3-0.8-2.5-1.5-3.5l1.6-1.6l-2.8-2.8l-1.6,1.6c-1.1-0.7-2.3-1.2-3.5-1.5V20h-4v2.2\n\tc-1.3,0.3-2.5,0.8-3.5,1.5l-1.6-1.6l-2.8,2.8l1.6,1.6c-0.7,1.1-1.2,2.3-1.5,3.5H20v4h2.2c0.3,1.3,0.8,2.5,1.5,3.5l-1.6,1.6l2.8,2.9\n\tl1.6-1.6c1.1,0.7,2.3,1.1,3.5,1.4V44h4v-2.2c1.3-0.3,2.5-0.8,3.5-1.5l1.6,1.6l2.9-2.8l-1.6-1.6c0.7-1.1,1.1-2.3,1.4-3.5H44z M32,36\n\tc-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S34.2,36,32,36z\"/>\n            <path d=\"M44,34v-4h-2.2c-0.3-1.3-0.8-2.5-1.5-3.5l1.6-1.6l-2.8-2.8l-1.6,1.6c-1.1-0.7-2.3-1.2-3.5-1.5V20h-4v2.2\n\tc-1.3,0.3-2.5,0.8-3.5,1.5l-1.6-1.6l-2.8,2.8l1.6,1.6c-0.7,1.1-1.2,2.3-1.5,3.5H20v4h2.2c0.3,1.3,0.8,2.5,1.5,3.5l-1.6,1.6l2.8,2.9\n\tl1.6-1.6c1.1,0.7,2.3,1.1,3.5,1.4V44h4v-2.2c1.3-0.3,2.5-0.8,3.5-1.5l1.6,1.6l2.9-2.8l-1.6-1.6c0.7-1.1,1.1-2.3,1.4-3.5H44z M32,36\n\tc-2.2,0-4-1.8-4-4s1.8-4,4-4s4,1.8,4,4S34.2,36,32,36z\"/>\n        </symbol>\n        <symbol id=\"zui-apps\" viewBox=\"0 0 48 48\">\n            <title>zui-apps</title>\n            <path d=\"M16 9v6c0 .6-.4 1-1 1H9c-.6 0-1-.4-1-1V9c0-.6.4-1 1-1h6c.6 0 1 .4 1 1zm11-1h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9c0-.6-.4-1-1-1zM15 32H9c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1zM39 8h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1V9c0-.6-.4-1-1-1zM15 20H9c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1zm12 0h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1zm0 12h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1zm12-12h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1zm0 12h-6c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-6c0-.6-.4-1-1-1z\"/>\n        </symbol>\n        <symbol id=\"zui-books\" viewBox=\"0 0 48 48\">\n            <title>zui-books</title>\n            <path d=\"M3.5,8.9v32h8v-32H3.5z M8.8,22.9h-3v-10h3V22.9z M25.5,4.9v36h8v-36H25.5z M30.9,19.1h-3v-10h3V19.1z M14.3,14.9v26h8v-26\n\tH14.3z M19,37.1c-0.8,0.3-1.7-0.1-1.9-0.9c-0.3-0.8,0.1-1.7,0.9-1.9c0.8-0.3,1.6,0.1,1.9,0.9C20.2,35.9,19.9,36.8,19,37.1\n\tC19.1,37.1,19,37.1,19,37.1z M33.5,15.7l4.2,25.7l7.8-1.3l-4.2-25.7L33.5,15.7z\"/>\n        </symbol>\n        <symbol id=\"zui-carrier-info\" viewBox=\"0 0 48 48\">\n            <title>zui-carrier-info</title>\n            <path d=\"M24,4C19,6.4,13.5,7.8,8,8v22c0,6,16,14,16,14s16-8,16-14V8C34,8,24,4,24,4z M28,14c0,2.2-1.8,4-4,4s-4-1.8-4-4s1.8-4,4-4\n\tS28,11.8,28,14z M28,36h-8V22h8V36z\"/>\n        </symbol>\n        <symbol id=\"zui-carrier\" viewBox=\"0 0 48 48\">\n            <title>zui-carrier</title>\n            <path d=\"M24,4C19,6.4,13.5,7.8,8,8v22c0,6,16,14,16,14s16-8,16-14V8C34,8,24,4,24,4z\"/>\n        </symbol>\n        <symbol id=\"zui-checklist\" viewBox=\"0 0 48 48\">\n            <title>zui-checklist</title>\n            <path d=\"M17.6,38.5h-6.1c-0.5,0-1-0.4-1-1c0,0,0,0,0,0v-24c0-0.6,0.4-1,1-1h1v1.1c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1v-1.1h1\n\tc0.6,0,1,0.4,1,1v3.2c0.7-0.1,1.3-0.2,2-0.2c0.7,0,1.3,0.1,2,0.1v-5.2c0-1.6-1.4-3-3-3h-3.2c-0.4-1.2-1.5-2-2.8-2h-0.1\n\tc-0.5-2.7-3.1-4.5-5.8-3.9c-2,0.4-3.6,1.9-3.9,3.9c-1.3,0-2.4,0.8-2.8,2H9.5c-1.7,0-3,1.3-3,3v28c0,1.7,1.3,3,3,3l0,0H20\n\tC19,41.3,18.2,39.9,17.6,38.5z M20.5,5.5c1.1,0,2,0.9,2,2c0,1.1-0.9,2-2,2s-2-0.9-2-2C18.5,6.4,19.4,5.5,20.5,5.5z\"/>\n            <path d=\"M32.5,20.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S39.1,20.5,32.5,20.5z M30.9,40.7l-6.5-6.5l2.8-2.8l3.5,3.4\n\tl6.9-8.3l3.1,2.6L30.9,40.7z\"/>\n        </symbol>\n        <symbol id=\"zui-compass\" viewBox=\"0 0 48 48\">\n            <title>zui-compass</title>\n            <path d=\"M25.4,25.4c0.8-0.8,0.8-2.1,0-2.8s-2.1-0.8-2.8,0c-0.8,0.8-0.8,2,0,2.8C23.4,26.2,24.6,26.2,25.4,25.4\n\tC25.4,25.4,25.4,25.4,25.4,25.4z\"/>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M28.2,28.2l-15.6,7.1l7.1-15.6l15.6-7.1L28.2,28.2z\"/>\n        </symbol>\n        <symbol id=\"zui-community\" viewBox=\"0 0 48 48\">\n            <title>zui-community</title>\n            <path d=\"M24,8c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S22.9,8,24,8 M24,4c-3.3,0-6,2.7-6,6s2.7,6,6,6s6-2.7,6-6S27.3,4,24,4z M38,22\n\tc1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S36.9,22,38,22 M38,18c-3.3,0-6,2.7-6,6s2.7,6,6,6c3.3,0,6-2.7,6-6S41.3,18,38,18z M24,36\n\tc1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S22.9,36,24,36 M24,32c-3.3,0-6,2.7-6,6c0,3.3,2.7,6,6,6s6-2.7,6-6C30,34.7,27.3,32,24,32z\" />\n            <path d=\"M35.1,18.8C36,18.3,37,18,38,18c0.2,0,0.4,0,0.5,0c-1.6-3.9-4.7-7-8.5-8.6c0,0.2,0,0.4,0,0.6c0,1-0.3,2-0.8,2.9\n\tC31.8,14.1,33.9,16.2,35.1,18.8z M38,30c-1,0-2-0.3-2.9-0.8c-1.2,2.6-3.3,4.7-5.9,5.9C29.7,36,30,37,30,38c0,0.2,0,0.4,0,0.5\n\tc3.9-1.6,7-4.7,8.6-8.5C38.4,30,38.2,30,38,30z M10,18c1,0,2,0.3,2.9,0.8c1.2-2.6,3.3-4.7,5.9-5.9C18.3,12,18,11,18,10\n\tc0-0.2,0-0.4,0-0.6c-3.9,1.6-6.9,4.7-8.5,8.6C9.6,18,9.8,18,10,18z M12.9,29.2C12,29.7,11,30,10,30c-0.2,0-0.4,0-0.5,0\n\tc1.6,3.9,4.7,7,8.5,8.6c0-0.2,0-0.4,0-0.6c0-1,0.3-2,0.8-2.9C16.2,33.9,14.1,31.8,12.9,29.2z\"/>\n            <path d=\"M10,22c1.1,0,2,0.9,2,2s-0.9,2-2,2s-2-0.9-2-2S8.9,22,10,22 M10,18c-3.3,0-6,2.7-6,6s2.7,6,6,6s6-2.7,6-6S13.3,18,10,18z\"/>\n        </symbol>\n        <symbol id=\"zui-folder\" viewBox=\"0 0 48 48\">\n            <title>zui-folder</title>\n            <path d=\"M44,16v20c0,2.2-1.8,4-4,4H8c-2.2,0-4-1.8-4-4V11.2C4,9.4,5.4,8,7.2,8H20l4,4h16C42.2,12,44,13.8,44,16z\"/>\n        </symbol>\n        <symbol id=\"zui-gear\" viewBox=\"0 0 48 48\">\n            <title>zui-gear</title>\n            <path d=\"M39.5,21.9l4.5-2.6L38,8.9l-4.2,2.5l-4-2.2V4H18v4.9l-3.8,2.5L9.8,8.8l-6,10.4l4.5,2.6l-0.2,4.5l-4.2,2.5l6,10.4l4.4-2.5\n\tL18,39v5h11.9v-5.1l3.9-2.2l4.2,2.5l6-10.4l-4.2-2.5L39.5,21.9z M24,30c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S27.4,30,24,30z\"/>\n        </symbol>\n        <symbol id=\"zui-graduation-cap\" viewBox=\"0 0 48 48\">\n            <title>zui-graduation-cap</title>\n            <path d=\"M3.5,18l20,12l18-10v14h4V18l-22-12L3.5,18z\"/>\n            <path d=\"M9.5,26v8l14,8l14-8v-8l-14,8L9.5,26z\"/>\n        </symbol>\n        <symbol id=\"zui-grip\" viewBox=\"0 0 48 48\">\n            <title>zui-grip</title>\n            <circle cx=\"19\" cy=\"9\" r=\"3\"/>\n            <circle cx=\"29\" cy=\"9\" r=\"3\"/>\n            <circle cx=\"19\" cy=\"19\" r=\"3\"/>\n            <circle cx=\"29\" cy=\"19\" r=\"3\"/>\n            <circle cx=\"19\" cy=\"29\" r=\"3\"/>\n            <circle cx=\"29\" cy=\"29\" r=\"3\"/>\n            <circle cx=\"19\" cy=\"39\" r=\"3\"/>\n            <circle cx=\"29\" cy=\"39\" r=\"3\"/>\n        </symbol>\n        <symbol id=\"zui-heartbeat\" viewBox=\"0 0 48 48\">\n            <title>zui-heartbeat</title>\n            <path d=\"M6.8,21.9c0,0,0,0.1,0,0.1c0,0.2,0.2,0.3,0.2,0.5h8l5-10L26,26l3.9-9.7l3.1,6.2h8c0-0.2,0.2-0.3,0.2-0.5c0,0,0-0.1,0-0.1\n\tc0.4-0.9,0.7-1.9,0.8-2.9c0-0.3,0-0.6,0-0.9c0-5.5-4.5-10-10-10c-3.1,0-6.1,1.5-8,4c-3.3-4.4-9.6-5.3-14-2c-2.5,1.9-4,4.9-4,8\n\tc0,0.3,0,0.6,0,0.9C6.1,19.9,6.4,20.9,6.8,21.9z\"/>\n            <path d=\"M31.1,25.5l-0.9-1.8L26,34l-6-14.4l-3,6H8.6C13.6,33.4,24,40,24,40s10.4-6.6,15.4-14.5H31.1z\"/>\n        </symbol>\n        <symbol id=\"zui-home\" viewBox=\"0 0 48 48\">\n            <title>zui-home</title>\n            <path d=\"M46,25.5h-4v20H28v-16h-8v16H6v-20H2l22-22L46,25.5z\"/>\n        </symbol>\n        <symbol id=\"zui-lightbulb\" viewBox=\"0 0 48 48\">\n            <title>zui-lightbulb</title>\n            <path d=\"M38,15.6V16c-0.1,5-3.5,9.6-6.9,13.3C30.4,30,30,31,30,32v4H18v-4c0-0.9-0.4-1.8-1-2.5c-3.5-3.8-7-8.7-7-14\n\tC10,8,16.1,2,23.6,2c0.1,0,0.2,0,0.3,0c7.6-0.2,14,5.9,14.1,13.5C38,15.5,38,15.6,38,15.6z M20,42h8c0,2.2-1.8,4-4,4S20,44.2,20,42z\n\t\"/>\n        </symbol>\n        <symbol id=\"zui-lists\" viewBox=\"0 0 48 48\">\n            <title>zui-lists</title>\n            <path d=\"M4,8h8v8H4V8z M4,20h8v8H4V20z M4,32h8v8H4V32z M16,8h28v8H16V8z M16,20h28v8H16V20z M16,32h28v8H16V32z\"/>\n        </symbol>\n        <symbol id=\"zui-menu\" viewBox=\"0 0 48 48\">\n            <title>zui-menu</title>\n            <path d=\"M8,12h32v4H8V12z M8,22h32v4H8V22z M8,32h32v4H8V32z\"/>\n        </symbol>\n        <symbol id=\"zui-monitor\" viewBox=\"0 0 48 48\">\n            <title>zui-monitor</title>\n            <path d=\"M39.9,7.1h-32c-2.2,0-4,1.8-4,4v22c0,2.2,1.8,4,4,4h10v3.8h-1c-0.5,0-1,0.4-1,1c0,0,0,0,0,0c0,0.6,0.4,1,1,1h14\n\tc0.6,0,1-0.4,1-1c0-0.5-0.4-1-1-1c0,0,0,0,0,0h-1v-3.8h10c2.2,0,4-1.8,4-4v0v-22C43.9,8.9,42.1,7.1,39.9,7.1z M39.9,33.1h-32v-22h32\n\tV33.1z\"/>\n            <circle cx=\"23.9\" cy=\"17.2\" r=\"3\"/>\n            <path d=\"M29.9,29.1h-12v-3.7c3.4-3,8.6-3,12,0V29.1z\"/>\n        </symbol>\n        <symbol id=\"zui-more\" viewBox=\"0 0 48 48\">\n            <title>zui-more</title>\n            <circle cx=\"24\" cy=\"10\" r=\"4\"/>\n            <circle cx=\"24\" cy=\"24\" r=\"4\"/>\n            <circle cx=\"24\" cy=\"38\" r=\"4\"/>\n        </symbol>\n        <symbol id=\"zui-notebook\" viewBox=\"0 0 48 48\">\n            <title>zui-notebook</title>\n            <path d=\"M36.5,4h-24c-2.2,0-4,1.8-4,4v2h-2v4h2v4h-2v4h2v4h-2v4h2v4h-2v4h2v2c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V8\n\tC40.5,5.8,38.7,4,36.5,4z M14.5,18h18v4h-18V18z M30.5,38h-16v-4h16V38z M36.5,30h-22v-4h22V30z M36.5,14h-22v-4h22V14z\"/>\n        </symbol>\n        <symbol id=\"zui-paper\" viewBox=\"0 0 48 48\">\n            <title>zui-paper</title>\n            <path d=\"M36,4H12C9.8,4,8,5.8,8,8v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V8C40,5.8,38.2,4,36,4z M36,34H12v-4h24V34z M36,26H12v-4\n\th24V26z M36,18H12v-4h24V18z\"/>\n        </symbol>\n        <symbol id=\"zui-papers\" viewBox=\"0 0 48 48\">\n            <title>zui-papers</title>\n            <path d=\"M36,12v24c0,2.2-1.8,4-4,4H16c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V16C40,13.8,38.2,12,36,12z\"/>\n            <path d=\"M28,4H12C9.8,4,8,5.8,8,8v24c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V8C32,5.8,30.2,4,28,4z M28,13H12v-3h16V13z M28,19H12v-3\n\th16V19z M22,25H12v-3h10V25z\"/>\n        </symbol>\n        <symbol id=\"zui-portal\" viewBox=\"0 0 48 48\">\n            <title>zui-portal</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M36,34.6c-4.1-6.6-12.7-8.6-19.3-4.5c-1.8,1.1-3.4,2.7-4.5,4.5\n\tC9.5,31.7,8,27.9,8,24c0-8.8,7.2-16,16-16s16,7.2,16,16C40,27.9,38.6,31.7,36,34.6z\"/>\n            <circle cx=\"24\" cy=\"18\" r=\"6\"/>\n        </symbol>\n        <symbol id=\"zui-portal-admin\" viewBox=\"0 0 48 48\">\n            <title>zui-portal-admin</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M28,39.5v-8.3c5.1-2.2,7.4-8.1,5.2-13.2c-1-2.3-2.9-4.2-5.2-5.2V22\n\tl-4,2l-4-2v-9.2c-5.1,2.2-7.4,8.1-5.2,13.2c1,2.3,2.9,4.2,5.2,5.2v8.3C11.4,37.3,6.3,28.6,8.5,20C10.7,11.5,19.4,6.3,28,8.5\n\tS41.7,19.5,39.5,28C38,33.6,33.6,38,28,39.5z\"/>\n        </symbol>\n        <symbol id=\"zui-presentations\" viewBox=\"0 0 48 48\">\n            <title>zui-presentations</title>\n            <path d=\"M8,38c-1.1,0-2-0.9-2-2V12c0-1.1,0.9-2,2-2h32c1.1,0,2,0.9,2,2H28v12c0-5.5-4.5-10-10-10h-2v2c-5.5,0-10,4.5-10,10\n\ts4.5,10,10,10s10-4.5,10-10h2v10h14c0,1.1-0.9,2-2,2H8z\"/>\n            <path d=\"M26,12v3.1c-2.2-2-5-3.1-8-3.1H26 M14,12v2.2c-2.2,0.4-4.3,1.4-6,2.9V12H14 M26,32.6V36h-3.4C24,35.1,25.1,34,26,32.6\n\t M8,34.9c0.4,0.4,0.9,0.7,1.4,1.1H8V34.9 M40,8H8c-2.2,0-4,1.8-4,4v24c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V12C44,9.8,42.2,8,40,8z\n\t M30,18v-4h10v4H30z M18,24v-8c4.4,0,8,3.6,8,8H18z M16,34c-4.4,0-8-3.6-8-8s3.6-8,8-8v8h8C24,30.4,20.4,34,16,34z M30,26v-4h10v4\n\tH30z M30,34v-4h10v4H30z\"/>\n        </symbol>\n        <symbol id=\"zui-proposals\" viewBox=\"0 0 48 48\">\n            <title>zui-proposals</title>\n            <path d=\"M40,14L30,4v10H40z\"/>\n            <path d=\"M26,18V4H12C9.8,4,8,5.8,8,8v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V18H26z M25.6,37.8V40h-3v-2.2c-2-0.2-3.5-1.8-3.7-3.8\n\th2.2c0.1,1.2,0.9,2.1,3,2.1s2.7-1.1,2.7-1.8s-0.5-1.8-3-2.4s-4.7-1.8-4.7-4.1c0.2-1.9,1.6-3.4,3.5-3.6V22h3v2.2\n\tc1.8,0.4,3.2,2,3.2,3.8h-2.2c0-1.2-0.7-2.1-2.5-2.1s-2.7,0.8-2.7,1.9s0.7,1.5,3,2.1s4.7,1.6,4.7,4.4C29.1,36.3,27.5,37.5,25.6,37.8z\n\t\"/>\n        </symbol>\n        <symbol id=\"zui-reload-circle\" viewBox=\"0 0 48 48\">\n            <title>zui-reload-circle</title>\n            <path d=\"M24,4C13,4,4,13,4,24s9,20,20,20s20-9,20-20S35,4,24,4z M24,36c-6.6,0-12-5.4-12-12s5.4-12,12-12c2.9,0,5.7,1.1,7.9,3l2.9-3\n\tv8.5h-8.5l2.7-2.7c-3.4-2.8-8.4-2.4-11.3,1c-2.8,3.4-2.4,8.4,1,11.3c3.4,2.8,8.4,2.4,11.3-1c1.2-1.4,1.8-3.2,1.9-5.1h4\n\tC36,30.6,30.6,36,24,36z\"/>\n        </symbol>\n        <symbol id=\"zui-rfps\" viewBox=\"0 0 48 48\">\n            <title>zui-rfps</title>\n            <path d=\"M40,14L30,4v10H40z\"/>\n            <path d=\"M26,18V4H12C9.8,4,8,5.8,8,8v32c0,2.2,1.8,4,4,4h24c2.2,0,4-1.8,4-4V18H26z M14,31.4V36h-2.5V24H15c1.3-0.1,2.5,0.2,3.6,0.9\n\tc0.8,0.6,1.3,1.7,1.2,2.7c0,0.7-0.2,1.3-0.6,1.9c-0.4,0.6-1,1-1.7,1.3c1.8,2.7,3,4.4,3.5,5.2h-2.8l-2.9-4.6L14,31.4z M14,29.4h0.8\n\tc0.6,0,1.2-0.1,1.8-0.4c0.4-0.3,0.6-0.8,0.6-1.3c0-0.5-0.2-1-0.6-1.2c-0.6-0.3-1.2-0.4-1.8-0.4H14V29.4z M24.3,36h-2.5V24h6.9v2\n\th-4.4v3.1h4v2h-4V36z M38,27.7c0.1,1.1-0.4,2.2-1.2,3c-1,0.7-2.2,1.1-3.4,1h-1.1V36h-2.6V24h3.8c1.2-0.1,2.4,0.3,3.3,0.9\n\tC37.7,25.6,38.1,26.7,38,27.7z M32.3,29.6h0.8c0.6,0.1,1.2-0.1,1.7-0.5c0.4-0.3,0.6-0.8,0.6-1.3c0-0.5-0.1-1-0.5-1.3\n\tc-0.4-0.3-1-0.5-1.5-0.4h-1.2V29.6z\"/>\n        </symbol>\n        <symbol id=\"zui-rocket\" viewBox=\"0 0 48 48\">\n            <title>zui-rocket</title>\n            <path d=\"M10.5,33.5l4,4l-6.2,2.2 M26.7,31l8.9-7.4l1-0.9c3.1-3.1,2.8-14.1,2.8-14.1s-11-0.3-14.1,2.8l-0.9,1L17,21.3H9.7L6.9,27\n\tl6.4,1.3c-0.2,0.5-0.4,1.1-0.7,1.5l5.7,5.7c0.5-0.3,1-0.5,1.5-0.7l1.3,6.4l5.7-2.8V31z M29,19c-1.1-1-1.1-2.8,0-3.8c0,0,0,0,0,0\n\tc1.1-1.1,2.8-1.1,3.9,0c1.1,1.1,1.1,2.8,0,3.9l0,0C31.8,20.1,30.1,20.1,29,19C29,19.1,29,19,29,19z\"/>\n        </symbol>\n        <symbol id=\"zui-search-fill\" viewBox=\"0 0 48 48\">\n            <title>zui-search-fill</title>\n            <path d=\"M17.5,17.4c-2.4,2.4-2.4,6.4,0,8.8c2.4,2.4,6.4,2.4,8.8,0c2.4-2.4,2.4-6.4,0-8.8C23.8,14.9,19.9,14.9,17.5,17.4\n\tC17.5,17.4,17.5,17.4,17.5,17.4z\"/>\n            <path d=\"M24,2C11.8,2,2,11.8,2,24s9.8,22,22,22s22-9.8,22-22S36.2,2,24,2z M37.4,37.3c-0.8,0.8-2,0.8-2.8,0c0,0,0,0,0,0l-7.1-7.1\n\tL27.2,30c-4.5,3-10.6,1.9-13.6-2.6c-3-4.5-1.9-10.6,2.6-13.6s10.6-1.9,13.6,2.6c2.2,3.2,2.3,7.5,0.2,10.7l0.3,0.3l7.1,7.1\n\tC38.2,35.3,38.2,36.5,37.4,37.3C37.4,37.3,37.4,37.3,37.4,37.3z\"/>\n        </symbol>\n        <symbol id=\"zui-selector\" viewBox=\"0 0 48 48\">\n            <title>zui-selector</title>\n            <path d=\"M16,39h18v6H16V39z M34,22.4L32,35H18l-8-12c0-1.4,1.1-2.5,2.5-2.5c0.4,0,0.8,0.1,1.1,0.3L14,21l4,4V9c0-1.1,0.9-2,2-2\n\ts2,0.9,2,2v8l8.7,1.4C32.6,18.8,34,20.4,34,22.4z\"/>\n            <path d=\"M4,1v28h6.4l-2-3H7V4h34v22h-4.5L36,29h8V1H4z\"/>\n        </symbol>\n        <symbol id=\"zui-speech\" viewBox=\"0 0 48 48\">\n            <title>zui-speech</title>\n            <path d=\"M44,24c0,8.8-9,16-20,16c-3.7,0-7.4-0.8-10.7-2.5L6,40l2-6.3c-2.5-2.6-4-6.1-4-9.7c0-8.8,9-16,20-16S44,15.2,44,24z\"/>\n        </symbol>\n        <symbol id=\"zui-toolbox\" viewBox=\"0 0 48 48\">\n            <title>zui-toolbox</title>\n            <path d=\"M40,13h-6V5H14v8H8c-2.2,0-4,1.8-4,4v2h40v-2C44,14.8,42.2,13,40,13z M18,13V9h12v4H18z M30,23c0,2.2-1.8,4-4,4h-4\n\tc-2.2,0-4-1.8-4-4H4v14c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V23H30z\"/>\n        </symbol>\n        <symbol id=\"zui-zywave-sidebar\" viewBox=\"0 0 48 48\">\n            <title>zui-zywave-sidebar</title>\n            <path d=\"M40,12v24H8V12H40 M40,8H8c-2.2,0-4,1.8-4,4v24c0,2.2,1.8,4,4,4h32c2.2,0,4-1.8,4-4V12C44,9.8,42.2,8,40,8z\"/>\n            <path d=\"M30,15h7v18h-7V15z\"/>\n        </symbol>\n\n\n\n    <!-- Speech -->\n    \n        <symbol id=\"zui-speech-phone\" viewBox=\"0 0 48 48\">\n            <title>zui-speech-phone</title>\n            <path d=\"M40,31c-2.4,0-4.8-0.4-7.1-1.1c-0.7-0.2-1.5,0-2,0.5l-4.4,4.4c-5.7-2.9-10.3-7.5-13.2-13.2l4.4-4.4c0.5-0.5,0.7-1.3,0.5-2\n\tC17.4,12.8,17,10.4,17,8c0-1.1-0.9-2-2-2H8C6.9,6,6,6.9,6,8c0,18.8,15.2,34,34,34c1.1,0,2-0.9,2-2v-7C42,31.9,41.1,31,40,31z\"/>\n        </symbol>\n        <symbol id=\"zui-speech-chat\" viewBox=\"0 0 48 48\">\n            <title>zui-speech-chat</title>\n            <path d=\"M40,6H8c-2.2,0-4,1.8-4,4v22c0,2.2,1.8,4,4,4h14l8,6v-6h10c2.2,0,4-1.8,4-4V10C44,7.8,42.2,6,40,6z M30,26H10v-4h20V26z\n\t M38,18H10v-4h28V18z\"/>\n        </symbol>\n        <symbol id=\"zui-speech-feedback\" viewBox=\"0 0 48 48\">\n            <title>zui-speech-feedback</title>\n            <path d=\"M40,6H8c-2.2,0-4,1.8-4,4v22c0,2.2,1.8,4,4,4h14l8,6v-6h10c2.2,0,4-1.8,4-4V10C44,7.8,42.2,6,40,6z M27,22h-6V10h6V22z\n\t M27,32h-6v-6h6V32z\"/>\n        </symbol>\n        <symbol id=\"zui-speech-help\" viewBox=\"0 0 48 48\">\n            <title>zui-speech-help</title>\n            <path d=\"M40,4H8C5.8,4,4,5.8,4,8v26c0,2.2,1.8,4,4,4h14l8,6v-6h10c2.2,0,4-1.8,4-4V8C44,5.8,42.2,4,40,4z M29.4,21.4\n\tc-0.9,0.9-1.6,1.5-2.2,2c-1.3,1-1.3,1-1.3,2.6h-4c-0.3-2.3,0.8-4.5,2.7-5.7c0.5-0.4,1.1-0.9,1.9-1.7c1-1.3,1.3-3,0.6-4.5\n\tc-0.5-1.3-1.8-2.2-3.2-2.1c-3.7,0-4,3.9-4,4.3l-4-0.2c0-4.4,3.6-8,8-8.1c3-0.1,5.8,1.8,6.9,4.6C32.2,15.6,31.6,19,29.4,21.4z M24,35\n\tc-1.4,0-2.5-1.1-2.5-2.5S22.6,30,24,30s2.5,1.1,2.5,2.5S25.4,35,24,35z\"/>\n        </symbol>\n        <symbol id=\"zui-speech-mail\" viewBox=\"0 0 48 48\">\n            <title>zui-speech-mail</title>\n            <path d=\"M24,21.7l20-10.9V8H4v2.8L24,21.7z\"/>\n            <path d=\"M24,26.3L4,15.4V40h40V15.4L24,26.3z\"/>\n        </symbol>\n    </defs>\n</svg>`;\ndocument.head.appendChild($_iconsContainer);","const $_colorsContainer = document.createElement('div');\n$_colorsContainer.setAttribute('style', 'display: none;');\n$_colorsContainer.innerHTML = `<zui-custom-style><style>html{--zui-aqua-50: #e9fbfb;--zui-aqua-100: #d2f6f8;--zui-aqua-200: #a5edf1;--zui-aqua-300: #79e4e9;--zui-aqua-400: #4cdbe2;--zui-aqua-500: #1fd2db;--zui-aqua-600: #19a8af;--zui-aqua-700: #137e83;--zui-aqua-800: #0c5458;--zui-aqua-900: #062a2c;--zui-blue-50: #e9eff6;--zui-blue-100: #d2dfee;--zui-blue-200: #a5bfdc;--zui-blue-300: #799ecb;--zui-blue-400: #4c7eb9;--zui-blue-500: #1f5ea8;--zui-blue-600: #194b86;--zui-blue-700: #133865;--zui-blue-800: #0c2643;--zui-blue-900: #061322;--zui-brick-50: #f7eaeb;--zui-brick-100: #f0d5d7;--zui-brick-200: #e1abaf;--zui-brick-300: #d18287;--zui-brick-400: #c2585f;--zui-brick-500: #b32e37;--zui-brick-600: #8f252c;--zui-brick-700: #6b1c21;--zui-brick-800: #481216;--zui-brick-900: #24090b;--zui-gray-50: #f5f5f5;--zui-gray-100: #ebebeb;--zui-gray-200: #d6d6d6;--zui-gray-300: #c2c2c2;--zui-gray-400: #adadad;--zui-gray-500: #999;--zui-gray-600: #7a7a7a;--zui-gray-700: #5c5c5c;--zui-gray-800: #3d3d3d;--zui-gray-900: #1f1f1f;--zui-green-50: #f1f5e6;--zui-green-100: #e3eacc;--zui-green-200: #c7d599;--zui-green-300: #abc066;--zui-green-400: #8fab33;--zui-green-500: #739600;--zui-green-600: #5c7800;--zui-green-700: #455a00;--zui-green-800: #2e3c00;--zui-green-900: #171e00;--zui-jade-50: #edf7ee;--zui-jade-100: #dbefde;--zui-jade-200: #b7dfbc;--zui-jade-300: #94cf9b;--zui-jade-400: #70bf79;--zui-jade-500: #4caf58;--zui-jade-600: #3d8c46;--zui-jade-700: #2e6935;--zui-jade-800: #1e4623;--zui-jade-900: #0f2312;--zui-light-blue-50: #e9f5fe;--zui-light-blue-100: #d3eafd;--zui-light-blue-200: #a6d5fa;--zui-light-blue-300: #7ac0f8;--zui-light-blue-400: #4dabf5;--zui-light-blue-500: #2196f3;--zui-light-blue-600: #1a78c2;--zui-light-blue-700: #145a92;--zui-light-blue-800: #0d3c61;--zui-light-blue-900: #071e31;--zui-lime-50: #eefaeb;--zui-lime-100: #ddf4d6;--zui-lime-200: #bbe9ae;--zui-lime-300: #99df85;--zui-lime-400: #77d45d;--zui-lime-500: #55c934;--zui-lime-600: #44a12a;--zui-lime-700: #33791f;--zui-lime-800: #225015;--zui-lime-900: #11280a;--zui-magenta-50: #fde9ef;--zui-magenta-100: #fbd2e0;--zui-magenta-200: #f6a5c1;--zui-magenta-300: #f278a1;--zui-magenta-400: #ed4b82;--zui-magenta-500: #e91e63;--zui-magenta-600: #ba184f;--zui-magenta-700: #8c123b;--zui-magenta-800: #5d0c28;--zui-magenta-900: #2f0614;--zui-mint-50: #e9f6f4;--zui-mint-100: #d2eeea;--zui-mint-200: #a5dcd5;--zui-mint-300: #79cbbf;--zui-mint-400: #4cb9aa;--zui-mint-500: #1fa895;--zui-mint-600: #198677;--zui-mint-700: #136559;--zui-mint-800: #0c433c;--zui-mint-900: #06221e;--zui-orange-50: #fff7e6;--zui-orange-100: #ffefcc;--zui-orange-200: #ffde99;--zui-orange-300: #ffce66;--zui-orange-400: #ffbd33;--zui-orange-500: #ffad00;--zui-orange-600: #cc8a00;--zui-orange-700: #996800;--zui-orange-800: #664500;--zui-orange-900: #332300;--zui-plum-50: #f4ebf2;--zui-plum-100: #e9d6e4;--zui-plum-200: #d2adc9;--zui-plum-300: #bc85ae;--zui-plum-400: #a55c93;--zui-plum-500: #8f3378;--zui-plum-600: #722960;--zui-plum-700: #561f48;--zui-plum-800: #391430;--zui-plum-900: #1d0a18;--zui-purple-50: #efebf4;--zui-purple-100: #dfd6e9;--zui-purple-200: #c0add2;--zui-purple-300: #a085bc;--zui-purple-400: #815ca5;--zui-purple-500: #61338f;--zui-purple-600: #4e2972;--zui-purple-700: #3a1f56;--zui-purple-800: #271439;--zui-purple-900: #130a1d;--zui-red-50: #feeaea;--zui-red-100: #fdd5d5;--zui-red-200: #fcabab;--zui-red-300: #fa8080;--zui-red-400: #f95656;--zui-red-500: #f72c2c;--zui-red-600: #c62323;--zui-red-700: #941a1a;--zui-red-800: #631212;--zui-red-900: #310909;--zui-tangerine-50: #fff2e8;--zui-tangerine-100: #fee5d1;--zui-tangerine-200: #fdcca4;--zui-tangerine-300: #fcb276;--zui-tangerine-400: #fb9949;--zui-tangerine-500: #fa7f1b;--zui-tangerine-600: #c86616;--zui-tangerine-700: #964c10;--zui-tangerine-800: #64330b;--zui-tangerine-900: #321905;--zui-tomato-50: #ffeee9;--zui-tomato-100: #fedcd3;--zui-tomato-200: #fdb9a6;--zui-tomato-300: #fc967a;--zui-tomato-400: #fb734d;--zui-tomato-500: #fa5021;--zui-tomato-600: #c8401a;--zui-tomato-700: #963014;--zui-tomato-800: #64200d;--zui-tomato-900: #321007;--zui-yellow-50: #fffdeb;--zui-yellow-100: #fffbd8;--zui-yellow-200: #fff7b1;--zui-yellow-300: #fff389;--zui-yellow-400: #ffef62;--zui-yellow-500: #ffeb3b;--zui-yellow-600: #ccbc2f;--zui-yellow-700: #998d23;--zui-yellow-800: #665e18;--zui-yellow-900: #332f0c}</style></zui-custom-style>`;\ndocument.head.appendChild($_colorsContainer);","/**\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/* eslint-disable no-unused-vars */\n/**\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is replaced by the munged name for object[property]\n * We cannot alias this function, so we have to use a small shim that has the same behavior when not compiling.\n *\n * @param {string} prop Property name\n * @param {?Object} obj Reference object\n * @return {string} Potentially renamed property name\n */\nwindow.JSCompiler_renameProperty = function(prop, obj) {\n  return prop;\n};\n/* eslint-enable */\n\nexport {};\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*/\nimport './boot.js';\n\nlet CSS_URL_RX = /(url\\()([^)]*)(\\))/g;\nlet ABS_URL = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\nlet workingURL;\nlet resolveDoc;\n/**\n * Resolves the given URL against the provided `baseUri'.\n *\n * Note that this function performs no resolution for URLs that start\n * with `/` (absolute URLs) or `#` (hash identifiers).  For general purpose\n * URL resolution, use `window.URL`.\n *\n * @param {string} url Input URL to resolve\n * @param {?string=} baseURI Base URI to resolve the URL against\n * @return {string} resolved URL\n */\nexport function resolveUrl(url, baseURI) {\n  if (url && ABS_URL.test(url)) {\n    return url;\n  }\n  // Lazy feature detection.\n  if (workingURL === undefined) {\n    workingURL = false;\n    try {\n      const u = new URL('b', 'http://a');\n      u.pathname = 'c%20d';\n      workingURL = (u.href === 'http://a/c%20d');\n    } catch (e) {\n      // silently fail\n    }\n  }\n  if (!baseURI) {\n    baseURI = document.baseURI || window.location.href;\n  }\n  if (workingURL) {\n    return (new URL(url, baseURI)).href;\n  }\n  // Fallback to creating an anchor into a disconnected document.\n  if (!resolveDoc) {\n    resolveDoc = document.implementation.createHTMLDocument('temp');\n    resolveDoc.base = resolveDoc.createElement('base');\n    resolveDoc.head.appendChild(resolveDoc.base);\n    resolveDoc.anchor = resolveDoc.createElement('a');\n    resolveDoc.body.appendChild(resolveDoc.anchor);\n  }\n  resolveDoc.base.href = baseURI;\n  resolveDoc.anchor.href = url;\n  return resolveDoc.anchor.href || url;\n\n}\n\n/**\n * Resolves any relative URL's in the given CSS text against the provided\n * `ownerDocument`'s `baseURI`.\n *\n * @param {string} cssText CSS text to process\n * @param {string} baseURI Base URI to resolve the URL against\n * @return {string} Processed CSS text with resolved URL's\n */\nexport function resolveCss(cssText, baseURI) {\n  return cssText.replace(CSS_URL_RX, function(m, pre, url, post) {\n    return pre + '\\'' +\n      resolveUrl(url.replace(/[\"']/g, ''), baseURI) +\n      '\\'' + post;\n  });\n}\n\n/**\n * Returns a path from a given `url`. The path includes the trailing\n * `/` from the url.\n *\n * @param {string} url Input URL to transform\n * @return {string} resolved path\n */\nexport function pathFromUrl(url) {\n  return url.substring(0, url.lastIndexOf('/') + 1);\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*/\nimport './boot.js';\n\nimport { pathFromUrl } from './resolve-url.js';\nexport const useShadow = !(window.ShadyDOM);\nexport const useNativeCSSProperties = Boolean(!window.ShadyCSS || window.ShadyCSS.nativeCss);\nexport const useNativeCustomElements = !(window.customElements.polyfillWrapFlushCallback);\n\n\n/**\n * Globally settable property that is automatically assigned to\n * `ElementMixin` instances, useful for binding in templates to\n * make URL's relative to an application's root.  Defaults to the main\n * document URL, but can be overridden by users.  It may be useful to set\n * `rootPath` to provide a stable application mount path when\n * using client side routing.\n */\nexport let rootPath = undefined ||\n  pathFromUrl(document.baseURI || window.location.href);\n\n/**\n * Sets the global rootPath property used by `ElementMixin` and\n * available via `rootPath`.\n *\n * @param {string} path The new root path\n * @return {void}\n */\nexport const setRootPath = function(path) {\n  rootPath = path;\n};\n\n/**\n * A global callback used to sanitize any value before inserting it into the DOM.\n * The callback signature is:\n *\n *  function sanitizeDOMValue(value, name, type, node) { ... }\n *\n * Where:\n *\n * `value` is the value to sanitize.\n * `name` is the name of an attribute or property (for example, href).\n * `type` indicates where the value is being inserted: one of property, attribute, or text.\n * `node` is the node where the value is being inserted.\n *\n * @type {(function(*,string,string,Node):*)|undefined}\n */\nexport let sanitizeDOMValue = window.Polymer && window.Polymer.sanitizeDOMValue || undefined;\n\n/**\n * Sets the global sanitizeDOMValue available via this module's exported\n * `sanitizeDOMValue` variable.\n *\n * @param {(function(*,string,string,Node):*)|undefined} newSanitizeDOMValue the global sanitizeDOMValue callback\n * @return {void}\n */\nexport const setSanitizeDOMValue = function(newSanitizeDOMValue) {\n  sanitizeDOMValue = newSanitizeDOMValue;\n};\n\n/**\n * Globally settable property to make Polymer Gestures use passive TouchEvent listeners when recognizing gestures.\n * When set to `true`, gestures made from touch will not be able to prevent scrolling, allowing for smoother\n * scrolling performance.\n * Defaults to `false` for backwards compatibility.\n */\nexport let passiveTouchGestures = false;\n\n/**\n * Sets `passiveTouchGestures` globally for all elements using Polymer Gestures.\n *\n * @param {boolean} usePassive enable or disable passive touch gestures globally\n * @return {void}\n */\nexport const setPassiveTouchGestures = function(usePassive) {\n  passiveTouchGestures = usePassive;\n};\n\n/**\n * Setting to ensure Polymer template evaluation only occurs based on tempates\n * defined in trusted script.  When true, `<dom-module>` re-registration is\n * disallowed, `<dom-bind>` is disabled, and `<dom-if>`/`<dom-repeat>`\n * templates will only evaluate in the context of a trusted element template.\n */\nexport let strictTemplatePolicy = false;\n\n/**\n * Sets `strictTemplatePolicy` globally for all elements\n *\n * @param {boolean} useStrictPolicy enable or disable strict template policy\n *   globally\n * @return {void}\n */\nexport const setStrictTemplatePolicy = function(useStrictPolicy) {\n  strictTemplatePolicy = useStrictPolicy;\n};\n\n/**\n * Setting to enable dom-module lookup from Polymer.Element.  By default,\n * templates must be defined in script using the `static get template()`\n * getter and the `html` tag function.  To enable legacy loading of templates\n * via dom-module, set this flag to true.\n */\nexport let allowTemplateFromDomModule = false;\n\n/**\n * Sets `lookupTemplateFromDomModule` globally for all elements\n *\n * @param {boolean} allowDomModule enable or disable template lookup \n *   globally\n * @return {void}\n */\nexport const setAllowTemplateFromDomModule = function(allowDomModule) {\n  allowTemplateFromDomModule = allowDomModule;\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*/\nimport './boot.js';\n\n// unique global id for deduping mixins.\nlet dedupeId = 0;\n\n/**\n * @constructor\n * @extends {Function}\n * @private\n */\nfunction MixinFunction(){}\n/** @type {(WeakMap | undefined)} */\nMixinFunction.prototype.__mixinApplications;\n/** @type {(Object | undefined)} */\nMixinFunction.prototype.__mixinSet;\n\n/* eslint-disable valid-jsdoc */\n/**\n * Wraps an ES6 class expression mixin such that the mixin is only applied\n * if it has not already been applied its base argument. Also memoizes mixin\n * applications.\n *\n * @template T\n * @param {T} mixin ES6 class expression mixin to wrap\n * @return {T}\n * @suppress {invalidCasts}\n */\nexport const dedupingMixin = function(mixin) {\n  let mixinApplications = /** @type {!MixinFunction} */(mixin).__mixinApplications;\n  if (!mixinApplications) {\n    mixinApplications = new WeakMap();\n    /** @type {!MixinFunction} */(mixin).__mixinApplications = mixinApplications;\n  }\n  // maintain a unique id for each mixin\n  let mixinDedupeId = dedupeId++;\n  function dedupingMixin(base) {\n    let baseSet = /** @type {!MixinFunction} */(base).__mixinSet;\n    if (baseSet && baseSet[mixinDedupeId]) {\n      return base;\n    }\n    let map = mixinApplications;\n    let extended = map.get(base);\n    if (!extended) {\n      extended = /** @type {!Function} */(mixin)(base);\n      map.set(base, extended);\n    }\n    // copy inherited mixin set from the extended class, or the base class\n    // NOTE: we avoid use of Set here because some browser (IE11)\n    // cannot extend a base Set via the constructor.\n    let mixinSet = Object.create(/** @type {!MixinFunction} */(extended).__mixinSet || baseSet || null);\n    mixinSet[mixinDedupeId] = true;\n    /** @type {!MixinFunction} */(extended).__mixinSet = mixinSet;\n    return extended;\n  }\n\n  return dedupingMixin;\n};\n/* eslint-enable valid-jsdoc */\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*/\nimport '../utils/boot.js';\n\nimport { resolveUrl, pathFromUrl } from '../utils/resolve-url.js';\nimport { strictTemplatePolicy } from '../utils/settings.js';\n\nlet modules = {};\nlet lcModules = {};\n/**\n * Sets a dom-module into the global registry by id.\n *\n * @param {string} id dom-module id\n * @param {DomModule} module dom-module instance\n * @return {void}\n */\nfunction setModule(id, module) {\n  // store id separate from lowercased id so that\n  // in all cases mixedCase id will stored distinctly\n  // and lowercase version is a fallback\n  modules[id] = lcModules[id.toLowerCase()] = module;\n}\n/**\n * Retrieves a dom-module from the global registry by id.\n *\n * @param {string} id dom-module id\n * @return {DomModule!} dom-module instance\n */\nfunction findModule(id) {\n  return modules[id] || lcModules[id.toLowerCase()];\n}\n\nfunction styleOutsideTemplateCheck(inst) {\n  if (inst.querySelector('style')) {\n    console.warn('dom-module %s has style outside template', inst.id);\n  }\n}\n\n/**\n * The `dom-module` element registers the dom it contains to the name given\n * by the module's id attribute. It provides a unified database of dom\n * accessible via its static `import` API.\n *\n * A key use case of `dom-module` is for providing custom element `<template>`s\n * via HTML imports that are parsed by the native HTML parser, that can be\n * relocated during a bundling pass and still looked up by `id`.\n *\n * Example:\n *\n *     <dom-module id=\"foo\">\n *       <img src=\"stuff.png\">\n *     </dom-module>\n *\n * Then in code in some other location that cannot access the dom-module above\n *\n *     let img = customElements.get('dom-module').import('foo', 'img');\n *\n * @customElement\n * @extends HTMLElement\n * @summary Custom element that provides a registry of relocatable DOM content\n *   by `id` that is agnostic to bundling.\n * @unrestricted\n */\nexport class DomModule extends HTMLElement {\n\n  static get observedAttributes() { return ['id']; }\n\n  /**\n   * Retrieves the element specified by the css `selector` in the module\n   * registered by `id`. For example, this.import('foo', 'img');\n   * @param {string} id The id of the dom-module in which to search.\n   * @param {string=} selector The css selector by which to find the element.\n   * @return {Element} Returns the element which matches `selector` in the\n   * module registered at the specified `id`.\n   *\n   * @export\n   * @nocollapse Referred to indirectly in style-gather.js\n   */\n  static import(id, selector) {\n    if (id) {\n      let m = findModule(id);\n      if (m && selector) {\n        return m.querySelector(selector);\n      }\n      return m;\n    }\n    return null;\n  }\n\n  /* eslint-disable no-unused-vars */\n  /**\n   * @param {string} name Name of attribute.\n   * @param {?string} old Old value of attribute.\n   * @param {?string} value Current value of attribute.\n   * @param {?string} namespace Attribute namespace.\n   * @return {void}\n   * @override\n   */\n  attributeChangedCallback(name, old, value, namespace) {\n    if (old !== value) {\n      this.register();\n    }\n  }\n  /* eslint-enable no-unused-args */\n\n  /**\n   * The absolute URL of the original location of this `dom-module`.\n   *\n   * This value will differ from this element's `ownerDocument` in the\n   * following ways:\n   * - Takes into account any `assetpath` attribute added during bundling\n   *   to indicate the original location relative to the bundled location\n   * - Uses the HTMLImports polyfill's `importForElement` API to ensure\n   *   the path is relative to the import document's location since\n   *   `ownerDocument` is not currently polyfilled\n   */\n  get assetpath() {\n    // Don't override existing assetpath.\n    if (!this.__assetpath) {\n      // note: assetpath set via an attribute must be relative to this\n      // element's location; accomodate polyfilled HTMLImports\n      const owner = window.HTMLImports && HTMLImports.importForElement ?\n        HTMLImports.importForElement(this) || document : this.ownerDocument;\n      const url = resolveUrl(\n        this.getAttribute('assetpath') || '', owner.baseURI);\n      this.__assetpath = pathFromUrl(url);\n    }\n    return this.__assetpath;\n  }\n\n  /**\n   * Registers the dom-module at a given id. This method should only be called\n   * when a dom-module is imperatively created. For\n   * example, `document.createElement('dom-module').register('foo')`.\n   * @param {string=} id The id at which to register the dom-module.\n   * @return {void}\n   */\n  register(id) {\n    id = id || this.id;\n    if (id) {\n      // Under strictTemplatePolicy, reject and null out any re-registered\n      // dom-module since it is ambiguous whether first-in or last-in is trusted\n      if (strictTemplatePolicy && findModule(id) !== undefined) {\n        setModule(id, null);\n        throw new Error(`strictTemplatePolicy: dom-module ${id} re-registered`);\n      }\n      this.id = id;\n      setModule(id, this);\n      styleOutsideTemplateCheck(this);\n    }\n  }\n}\n\nDomModule.prototype['modules'] = modules;\n\ncustomElements.define('dom-module', DomModule);\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/**\n * Module with utilities for collection CSS text from `<templates>`, external\n * stylesheets, and `dom-module`s.\n *\n * @summary Module with utilities for collection CSS text from various sources.\n */\n\nimport { DomModule } from '../elements/dom-module.js';\nimport { resolveCss } from './resolve-url.js';\n\nconst MODULE_STYLE_LINK_SELECTOR = 'link[rel=import][type~=css]';\nconst INCLUDE_ATTR = 'include';\nconst SHADY_UNSCOPED_ATTR = 'shady-unscoped';\n\n/**\n * @param {string} moduleId .\n * @return {?DomModule} .\n */\nfunction importModule(moduleId) {\n  return /** @type {?DomModule} */(DomModule.import(moduleId));\n}\n\nfunction styleForImport(importDoc) {\n  // NOTE: polyfill affordance.\n  // under the HTMLImports polyfill, there will be no 'body',\n  // but the import pseudo-doc can be used directly.\n  let container = importDoc.body ? importDoc.body : importDoc;\n  const importCss = resolveCss(container.textContent,\n    importDoc.baseURI);\n  const style = document.createElement('style');\n  style.textContent = importCss;\n  return style;\n}\n\n/** @typedef {{assetpath: string}} */\nlet templateWithAssetPath; // eslint-disable-line no-unused-vars\n\n\n/**\n * Returns a list of <style> elements in a space-separated list of `dom-module`s.\n *\n * @function\n * @param {string} moduleIds List of dom-module id's within which to\n * search for css.\n * @return {!Array<!HTMLStyleElement>} Array of contained <style> elements\n */\nexport function stylesFromModules(moduleIds) {\n const modules = moduleIds.trim().split(/\\s+/);\n const styles = [];\n for (let i=0; i < modules.length; i++) {\n   styles.push(...stylesFromModule(modules[i]));\n }\n return styles;\n}\n\n/**\n * Returns a list of <style> elements in a given `dom-module`.\n * Styles in a `dom-module` can come either from `<style>`s within the\n * first `<template>`, or else from one or more\n * `<link rel=\"import\" type=\"css\">` links outside the template.\n *\n * @param {string} moduleId dom-module id to gather styles from\n * @return {!Array<!HTMLStyleElement>} Array of contained styles.\n */\nexport function stylesFromModule(moduleId) {\n  const m = importModule(moduleId);\n\n  if (!m) {\n    console.warn('Could not find style data in module named', moduleId);\n    return [];\n  }\n\n  if (m._styles === undefined) {\n    const styles = [];\n    // module imports: <link rel=\"import\" type=\"css\">\n    styles.push(..._stylesFromModuleImports(m));\n    // include css from the first template in the module\n    const template = /** @type {?HTMLTemplateElement} */(\n        m.querySelector('template'));\n    if (template) {\n      styles.push(...stylesFromTemplate(template,\n        /** @type {templateWithAssetPath} */(m).assetpath));\n    }\n\n    m._styles = styles;\n  }\n\n  return m._styles;\n}\n\n/**\n * Returns the `<style>` elements within a given template.\n *\n * @param {!HTMLTemplateElement} template Template to gather styles from\n * @param {string} baseURI baseURI for style content\n * @return {!Array<!HTMLStyleElement>} Array of styles\n */\nexport function stylesFromTemplate(template, baseURI) {\n  if (!template._styles) {\n    const styles = [];\n    // if element is a template, get content from its .content\n    const e$ = template.content.querySelectorAll('style');\n    for (let i=0; i < e$.length; i++) {\n      let e = e$[i];\n      // support style sharing by allowing styles to \"include\"\n      // other dom-modules that contain styling\n      let include = e.getAttribute(INCLUDE_ATTR);\n      if (include) {\n        styles.push(...stylesFromModules(include).filter(function(item, index, self) {\n          return self.indexOf(item) === index;\n        }));\n      }\n      if (baseURI) {\n        e.textContent = resolveCss(e.textContent, baseURI);\n      }\n      styles.push(e);\n    }\n    template._styles = styles;\n  }\n  return template._styles;\n}\n\n/**\n * Returns a list of <style> elements  from stylesheets loaded via `<link rel=\"import\" type=\"css\">` links within the specified `dom-module`.\n *\n * @param {string} moduleId Id of `dom-module` to gather CSS from\n * @return {!Array<!HTMLStyleElement>} Array of contained styles.\n */\nexport function stylesFromModuleImports(moduleId) {\n let m = importModule(moduleId);\n return m ? _stylesFromModuleImports(m) : [];\n}\n\n/**\n * @param {!HTMLElement} module dom-module element that could contain `<link rel=\"import\" type=\"css\">` styles\n * @return {!Array<!HTMLStyleElement>} Array of contained styles\n */\nfunction _stylesFromModuleImports(module) {\n  const styles = [];\n  const p$ = module.querySelectorAll(MODULE_STYLE_LINK_SELECTOR);\n  for (let i=0; i < p$.length; i++) {\n    let p = p$[i];\n    if (p.import) {\n      const importDoc = p.import;\n      const unscoped = p.hasAttribute(SHADY_UNSCOPED_ATTR);\n      if (unscoped && !importDoc._unscopedStyle) {\n        const style = styleForImport(importDoc);\n        style.setAttribute(SHADY_UNSCOPED_ATTR, '');\n        importDoc._unscopedStyle = style;\n      } else if (!importDoc._style) {\n        importDoc._style = styleForImport(importDoc);\n      }\n      styles.push(unscoped ? importDoc._unscopedStyle : importDoc._style);\n    }\n  }\n  return styles;\n}\n\n/**\n *\n * Returns CSS text of styles in a space-separated list of `dom-module`s.\n * Note: This method is deprecated, use `stylesFromModules` instead.\n *\n * @deprecated\n * @param {string} moduleIds List of dom-module id's within which to\n * search for css.\n * @return {string} Concatenated CSS content from specified `dom-module`s\n */\nexport function cssFromModules(moduleIds) {\n let modules = moduleIds.trim().split(/\\s+/);\n let cssText = '';\n for (let i=0; i < modules.length; i++) {\n   cssText += cssFromModule(modules[i]);\n }\n return cssText;\n}\n\n/**\n * Returns CSS text of styles in a given `dom-module`.  CSS in a `dom-module`\n * can come either from `<style>`s within the first `<template>`, or else\n * from one or more `<link rel=\"import\" type=\"css\">` links outside the\n * template.\n *\n * Any `<styles>` processed are removed from their original location.\n * Note: This method is deprecated, use `styleFromModule` instead.\n *\n * @deprecated\n * @param {string} moduleId dom-module id to gather styles from\n * @return {string} Concatenated CSS content from specified `dom-module`\n */\nexport function cssFromModule(moduleId) {\n  let m = importModule(moduleId);\n  if (m && m._cssText === undefined) {\n    // module imports: <link rel=\"import\" type=\"css\">\n    let cssText = _cssFromModuleImports(m);\n    // include css from the first template in the module\n    let t = /** @type {?HTMLTemplateElement} */(m.querySelector('template'));\n    if (t) {\n      cssText += cssFromTemplate(t,\n        /** @type {templateWithAssetPath} */(m).assetpath);\n    }\n    m._cssText = cssText || null;\n  }\n  if (!m) {\n    console.warn('Could not find style data in module named', moduleId);\n  }\n  return m && m._cssText || '';\n}\n\n/**\n * Returns CSS text of `<styles>` within a given template.\n *\n * Any `<styles>` processed are removed from their original location.\n * Note: This method is deprecated, use `styleFromTemplate` instead.\n *\n * @deprecated\n * @param {!HTMLTemplateElement} template Template to gather styles from\n * @param {string} baseURI Base URI to resolve the URL against\n * @return {string} Concatenated CSS content from specified template\n */\nexport function cssFromTemplate(template, baseURI) {\n  let cssText = '';\n  const e$ = stylesFromTemplate(template, baseURI);\n  // if element is a template, get content from its .content\n  for (let i=0; i < e$.length; i++) {\n    let e = e$[i];\n    if (e.parentNode) {\n      e.parentNode.removeChild(e);\n    }\n    cssText += e.textContent;\n  }\n  return cssText;\n}\n\n/**\n * Returns CSS text from stylesheets loaded via `<link rel=\"import\" type=\"css\">`\n * links within the specified `dom-module`.\n *\n * Note: This method is deprecated, use `stylesFromModuleImports` instead.\n *\n * @deprecated\n *\n * @param {string} moduleId Id of `dom-module` to gather CSS from\n * @return {string} Concatenated CSS content from links in specified `dom-module`\n */\nexport function cssFromModuleImports(moduleId) {\n  let m = importModule(moduleId);\n  return m ? _cssFromModuleImports(m) : '';\n}\n\n/**\n * @deprecated\n * @param {!HTMLElement} module dom-module element that could contain `<link rel=\"import\" type=\"css\">` styles\n * @return {string} Concatenated CSS content from links in the dom-module\n */\nfunction _cssFromModuleImports(module) {\n  let cssText = '';\n  let styles = _stylesFromModuleImports(module);\n  for (let i=0; i < styles.length; i++) {\n    cssText += styles[i].textContent;\n  }\n  return cssText;\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*/\nimport './boot.js';\n\n/**\n * Module with utilities for manipulating structured data path strings.\n *\n * @summary Module with utilities for manipulating structured data path strings.\n */\n\n/**\n * Returns true if the given string is a structured data path (has dots).\n *\n * Example:\n *\n * ```\n * isPath('foo.bar.baz') // true\n * isPath('foo')         // false\n * ```\n *\n * @param {string} path Path string\n * @return {boolean} True if the string contained one or more dots\n */\nexport function isPath(path) {\n  return path.indexOf('.') >= 0;\n}\n\n/**\n * Returns the root property name for the given path.\n *\n * Example:\n *\n * ```\n * root('foo.bar.baz') // 'foo'\n * root('foo')         // 'foo'\n * ```\n *\n * @param {string} path Path string\n * @return {string} Root property name\n */\nexport function root(path) {\n  let dotIndex = path.indexOf('.');\n  if (dotIndex === -1) {\n    return path;\n  }\n  return path.slice(0, dotIndex);\n}\n\n/**\n * Given `base` is `foo.bar`, `foo` is an ancestor, `foo.bar` is not\n * Returns true if the given path is an ancestor of the base path.\n *\n * Example:\n *\n * ```\n * isAncestor('foo.bar', 'foo')         // true\n * isAncestor('foo.bar', 'foo.bar')     // false\n * isAncestor('foo.bar', 'foo.bar.baz') // false\n * ```\n *\n * @param {string} base Path string to test against.\n * @param {string} path Path string to test.\n * @return {boolean} True if `path` is an ancestor of `base`.\n */\nexport function isAncestor(base, path) {\n  //     base.startsWith(path + '.');\n  return base.indexOf(path + '.') === 0;\n}\n\n/**\n * Given `base` is `foo.bar`, `foo.bar.baz` is an descendant\n *\n * Example:\n *\n * ```\n * isDescendant('foo.bar', 'foo.bar.baz') // true\n * isDescendant('foo.bar', 'foo.bar')     // false\n * isDescendant('foo.bar', 'foo')         // false\n * ```\n *\n * @param {string} base Path string to test against.\n * @param {string} path Path string to test.\n * @return {boolean} True if `path` is a descendant of `base`.\n */\nexport function isDescendant(base, path) {\n  //     path.startsWith(base + '.');\n  return path.indexOf(base + '.') === 0;\n}\n\n/**\n * Replaces a previous base path with a new base path, preserving the\n * remainder of the path.\n *\n * User must ensure `path` has a prefix of `base`.\n *\n * Example:\n *\n * ```\n * translate('foo.bar', 'zot', 'foo.bar.baz') // 'zot.baz'\n * ```\n *\n * @param {string} base Current base string to remove\n * @param {string} newBase New base string to replace with\n * @param {string} path Path to translate\n * @return {string} Translated string\n */\nexport function translate(base, newBase, path) {\n  return newBase + path.slice(base.length);\n}\n\n/**\n * @param {string} base Path string to test against\n * @param {string} path Path string to test\n * @return {boolean} True if `path` is equal to `base`\n */\nexport function matches(base, path) {\n  return (base === path) ||\n         isAncestor(base, path) ||\n         isDescendant(base, path);\n}\n\n/**\n * Converts array-based paths to flattened path.  String-based paths\n * are returned as-is.\n *\n * Example:\n *\n * ```\n * normalize(['foo.bar', 0, 'baz'])  // 'foo.bar.0.baz'\n * normalize('foo.bar.0.baz')        // 'foo.bar.0.baz'\n * ```\n *\n * @param {string | !Array<string|number>} path Input path\n * @return {string} Flattened path\n */\nexport function normalize(path) {\n  if (Array.isArray(path)) {\n    let parts = [];\n    for (let i=0; i<path.length; i++) {\n      let args = path[i].toString().split('.');\n      for (let j=0; j<args.length; j++) {\n        parts.push(args[j]);\n      }\n    }\n    return parts.join('.');\n  } else {\n    return path;\n  }\n}\n\n/**\n * Splits a path into an array of property names. Accepts either arrays\n * of path parts or strings.\n *\n * Example:\n *\n * ```\n * split(['foo.bar', 0, 'baz'])  // ['foo', 'bar', '0', 'baz']\n * split('foo.bar.0.baz')        // ['foo', 'bar', '0', 'baz']\n * ```\n *\n * @param {string | !Array<string|number>} path Input path\n * @return {!Array<string>} Array of path parts\n * @suppress {checkTypes}\n */\nexport function split(path) {\n  if (Array.isArray(path)) {\n    return normalize(path).split('.');\n  }\n  return path.toString().split('.');\n}\n\n/**\n * Reads a value from a path.  If any sub-property in the path is `undefined`,\n * this method returns `undefined` (will never throw.\n *\n * @param {Object} root Object from which to dereference path from\n * @param {string | !Array<string|number>} path Path to read\n * @param {Object=} info If an object is provided to `info`, the normalized\n *  (flattened) path will be set to `info.path`.\n * @return {*} Value at path, or `undefined` if the path could not be\n *  fully dereferenced.\n */\nexport function get(root, path, info) {\n  let prop = root;\n  let parts = split(path);\n  // Loop over path parts[0..n-1] and dereference\n  for (let i=0; i<parts.length; i++) {\n    if (!prop) {\n      return;\n    }\n    let part = parts[i];\n    prop = prop[part];\n  }\n  if (info) {\n    info.path = parts.join('.');\n  }\n  return prop;\n}\n\n/**\n * Sets a value to a path.  If any sub-property in the path is `undefined`,\n * this method will no-op.\n *\n * @param {Object} root Object from which to dereference path from\n * @param {string | !Array<string|number>} path Path to set\n * @param {*} value Value to set to path\n * @return {string | undefined} The normalized version of the input path\n */\nexport function set(root, path, value) {\n  let prop = root;\n  let parts = split(path);\n  let last = parts[parts.length-1];\n  if (parts.length > 1) {\n    // Loop over path parts[0..n-2] and dereference\n    for (let i=0; i<parts.length-1; i++) {\n      let part = parts[i];\n      prop = prop[part];\n      if (!prop) {\n        return;\n      }\n    }\n    // Set value to object at end of path\n    prop[last] = value;\n  } else {\n    // Simple property set\n    prop[path] = value;\n  }\n  return parts.join('.');\n}\n\n/**\n * Returns true if the given string is a structured data path (has dots).\n *\n * This function is deprecated.  Use `isPath` instead.\n *\n * Example:\n *\n * ```\n * isDeep('foo.bar.baz') // true\n * isDeep('foo')         // false\n * ```\n *\n * @deprecated\n * @param {string} path Path string\n * @return {boolean} True if the string contained one or more dots\n */\nexport const isDeep = isPath;\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*/\nimport './boot.js';\n\nconst caseMap = {};\nconst DASH_TO_CAMEL = /-[a-z]/g;\nconst CAMEL_TO_DASH = /([A-Z])/g;\n\n/**\n * @fileoverview Module with utilities for converting between \"dash-case\" and\n * \"camelCase\" identifiers.\n */\n\n/**\n * Converts \"dash-case\" identifier (e.g. `foo-bar-baz`) to \"camelCase\"\n * (e.g. `fooBarBaz`).\n *\n * @param {string} dash Dash-case identifier\n * @return {string} Camel-case representation of the identifier\n */\nexport function dashToCamelCase(dash) {\n  return caseMap[dash] || (\n    caseMap[dash] = dash.indexOf('-') < 0 ? dash : dash.replace(DASH_TO_CAMEL,\n      (m) => m[1].toUpperCase()\n    )\n  );\n}\n\n/**\n * Converts \"camelCase\" identifier (e.g. `fooBarBaz`) to \"dash-case\"\n * (e.g. `foo-bar-baz`).\n *\n * @param {string} camel Camel-case identifier\n * @return {string} Dash-case representation of the identifier\n */\nexport function camelToDashCase(camel) {\n  return caseMap[camel] || (\n    caseMap[camel] = camel.replace(CAMEL_TO_DASH, '-$1').toLowerCase()\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/**\n * @fileoverview\n *\n * This module provides a number of strategies for enqueuing asynchronous\n * tasks. Each sub-module provides a standard `run(fn)` interface that returns a\n * handle, and a `cancel(handle)` interface for canceling async tasks before\n * they run.\n *\n * @summary Module that provides a number of strategies for enqueuing\n * asynchronous tasks.\n */\n\nimport './boot.js';\n\n// Microtask implemented using Mutation Observer\nlet microtaskCurrHandle = 0;\nlet microtaskLastHandle = 0;\nlet microtaskCallbacks = [];\nlet microtaskNodeContent = 0;\nlet microtaskNode = document.createTextNode('');\nnew window.MutationObserver(microtaskFlush).observe(microtaskNode, {characterData: true});\n\nfunction microtaskFlush() {\n  const len = microtaskCallbacks.length;\n  for (let i = 0; i < len; i++) {\n    let cb = microtaskCallbacks[i];\n    if (cb) {\n      try {\n        cb();\n      } catch (e) {\n        setTimeout(() => { throw e; });\n      }\n    }\n  }\n  microtaskCallbacks.splice(0, len);\n  microtaskLastHandle += len;\n}\n\n/**\n * Async interface wrapper around `setTimeout`.\n *\n * @namespace\n * @summary Async interface wrapper around `setTimeout`.\n */\nconst timeOut = {\n  /**\n   * Returns a sub-module with the async interface providing the provided\n   * delay.\n   *\n   * @memberof timeOut\n   * @param {number=} delay Time to wait before calling callbacks in ms\n   * @return {!AsyncInterface} An async timeout interface\n   */\n  after(delay) {\n    return {\n      run(fn) { return window.setTimeout(fn, delay); },\n      cancel(handle) {\n        window.clearTimeout(handle);\n      }\n    };\n  },\n  /**\n   * Enqueues a function called in the next task.\n   *\n   * @memberof timeOut\n   * @param {!Function} fn Callback to run\n   * @param {number=} delay Delay in milliseconds\n   * @return {number} Handle used for canceling task\n   */\n  run(fn, delay) {\n    return window.setTimeout(fn, delay);\n  },\n  /**\n   * Cancels a previously enqueued `timeOut` callback.\n   *\n   * @memberof timeOut\n   * @param {number} handle Handle returned from `run` of callback to cancel\n   * @return {void}\n   */\n  cancel(handle) {\n    window.clearTimeout(handle);\n  }\n};\nexport {timeOut};\n\n/**\n * Async interface wrapper around `requestAnimationFrame`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestAnimationFrame`.\n */\nconst animationFrame = {\n  /**\n   * Enqueues a function called at `requestAnimationFrame` timing.\n   *\n   * @memberof animationFrame\n   * @param {function(number):void} fn Callback to run\n   * @return {number} Handle used for canceling task\n   */\n  run(fn) {\n    return window.requestAnimationFrame(fn);\n  },\n  /**\n   * Cancels a previously enqueued `animationFrame` callback.\n   *\n   * @memberof animationFrame\n   * @param {number} handle Handle returned from `run` of callback to cancel\n   * @return {void}\n   */\n  cancel(handle) {\n    window.cancelAnimationFrame(handle);\n  }\n};\nexport {animationFrame};\n\n/**\n * Async interface wrapper around `requestIdleCallback`.  Falls back to\n * `setTimeout` on browsers that do not support `requestIdleCallback`.\n *\n * @namespace\n * @summary Async interface wrapper around `requestIdleCallback`.\n */\nconst idlePeriod = {\n  /**\n   * Enqueues a function called at `requestIdleCallback` timing.\n   *\n   * @memberof idlePeriod\n   * @param {function(!IdleDeadline):void} fn Callback to run\n   * @return {number} Handle used for canceling task\n   */\n  run(fn) {\n    return window.requestIdleCallback ?\n      window.requestIdleCallback(fn) :\n      window.setTimeout(fn, 16);\n  },\n  /**\n   * Cancels a previously enqueued `idlePeriod` callback.\n   *\n   * @memberof idlePeriod\n   * @param {number} handle Handle returned from `run` of callback to cancel\n   * @return {void}\n   */\n  cancel(handle) {\n    window.cancelIdleCallback ?\n      window.cancelIdleCallback(handle) :\n      window.clearTimeout(handle);\n  }\n};\nexport {idlePeriod};\n\n/**\n * Async interface for enqueuing callbacks that run at microtask timing.\n *\n * Note that microtask timing is achieved via a single `MutationObserver`,\n * and thus callbacks enqueued with this API will all run in a single\n * batch, and not interleaved with other microtasks such as promises.\n * Promises are avoided as an implementation choice for the time being\n * due to Safari bugs that cause Promises to lack microtask guarantees.\n *\n * @namespace\n * @summary Async interface for enqueuing callbacks that run at microtask\n *   timing.\n */\nconst microTask = {\n\n  /**\n   * Enqueues a function called at microtask timing.\n   *\n   * @memberof microTask\n   * @param {!Function=} callback Callback to run\n   * @return {number} Handle used for canceling task\n   */\n  run(callback) {\n    microtaskNode.textContent = microtaskNodeContent++;\n    microtaskCallbacks.push(callback);\n    return microtaskCurrHandle++;\n  },\n\n  /**\n   * Cancels a previously enqueued `microTask` callback.\n   *\n   * @memberof microTask\n   * @param {number} handle Handle returned from `run` of callback to cancel\n   * @return {void}\n   */\n  cancel(handle) {\n    const idx = handle - microtaskLastHandle;\n    if (idx >= 0) {\n      if (!microtaskCallbacks[idx]) {\n        throw new Error('invalid async handle: ' + handle);\n      }\n      microtaskCallbacks[idx] = null;\n    }\n  }\n\n};\nexport {microTask};\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*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { microTask } from '../utils/async.js';\n\n/** @const {!AsyncInterface} */\nconst microtask = microTask;\n\n/**\n * Element class mixin that provides basic meta-programming for creating one\n * or more property accessors (getter/setter pair) that enqueue an async\n * (batched) `_propertiesChanged` callback.\n *\n * For basic usage of this mixin, call `MyClass.createProperties(props)`\n * once at class definition time to create property accessors for properties\n * named in props, implement `_propertiesChanged` to react as desired to\n * property changes, and implement `static get observedAttributes()` and\n * include lowercase versions of any property names that should be set from\n * attributes. Last, call `this._enableProperties()` in the element's\n * `connectedCallback` to enable the accessors.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin for reacting to property changes from\n *   generated property accessors.\n */\nexport const PropertiesChanged = dedupingMixin(\n    /**\n     * @template T\n     * @param {function(new:T)} superClass Class to apply mixin to.\n     * @return {function(new:T)} superClass with mixin applied.\n     */\n    (superClass) => {\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_PropertiesChanged}\n   * @unrestricted\n   */\n  class PropertiesChanged extends superClass {\n\n    /**\n     * Creates property accessors for the given property names.\n     * @param {!Object} props Object whose keys are names of accessors.\n     * @return {void}\n     * @protected\n     */\n    static createProperties(props) {\n      const proto = this.prototype;\n      for (let prop in props) {\n        // don't stomp an existing accessor\n        if (!(prop in proto)) {\n          proto._createPropertyAccessor(prop);\n        }\n      }\n    }\n\n    /**\n     * Returns an attribute name that corresponds to the given property.\n     * The attribute name is the lowercased property name. Override to\n     * customize this mapping.\n     * @param {string} property Property to convert\n     * @return {string} Attribute name corresponding to the given property.\n     *\n     * @protected\n     */\n    static attributeNameForProperty(property) {\n      return property.toLowerCase();\n    }\n\n    /**\n     * Override point to provide a type to which to deserialize a value to\n     * a given property.\n     * @param {string} name Name of property\n     *\n     * @protected\n     */\n    static typeForProperty(name) { } //eslint-disable-line no-unused-vars\n\n    /**\n     * Creates a setter/getter pair for the named property with its own\n     * local storage.  The getter returns the value in the local storage,\n     * and the setter calls `_setProperty`, which updates the local storage\n     * for the property and enqueues a `_propertiesChanged` callback.\n     *\n     * This method may be called on a prototype or an instance.  Calling\n     * this method may overwrite a property value that already exists on\n     * the prototype/instance by creating the accessor.\n     *\n     * @param {string} property Name of the property\n     * @param {boolean=} readOnly When true, no setter is created; the\n     *   protected `_setProperty` function must be used to set the property\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _createPropertyAccessor(property, readOnly) {\n      this._addPropertyToAttributeMap(property);\n      if (!this.hasOwnProperty('__dataHasAccessor')) {\n        this.__dataHasAccessor = Object.assign({}, this.__dataHasAccessor);\n      }\n      if (!this.__dataHasAccessor[property]) {\n        this.__dataHasAccessor[property] = true;\n        this._definePropertyAccessor(property, readOnly);\n      }\n    }\n\n    /**\n     * Adds the given `property` to a map matching attribute names\n     * to property names, using `attributeNameForProperty`. This map is\n     * used when deserializing attribute values to properties.\n     *\n     * @param {string} property Name of the property\n     * @override\n     */\n    _addPropertyToAttributeMap(property) {\n      if (!this.hasOwnProperty('__dataAttributes')) {\n        this.__dataAttributes = Object.assign({}, this.__dataAttributes);\n      }\n      if (!this.__dataAttributes[property]) {\n        const attr = this.constructor.attributeNameForProperty(property);\n        this.__dataAttributes[attr] = property;\n      }\n    }\n\n    /**\n     * Defines a property accessor for the given property.\n     * @param {string} property Name of the property\n     * @param {boolean=} readOnly When true, no setter is created\n     * @return {void}\n     * @override\n     */\n     _definePropertyAccessor(property, readOnly) {\n      Object.defineProperty(this, property, {\n        /* eslint-disable valid-jsdoc */\n        /** @this {PropertiesChanged} */\n        get() {\n          return this._getProperty(property);\n        },\n        /** @this {PropertiesChanged} */\n        set: readOnly ? function () {} : function (value) {\n          this._setProperty(property, value);\n        }\n        /* eslint-enable */\n      });\n    }\n\n    constructor() {\n      super();\n      this.__dataEnabled = false;\n      this.__dataReady = false;\n      this.__dataInvalid = false;\n      this.__data = {};\n      this.__dataPending = null;\n      this.__dataOld = null;\n      this.__dataInstanceProps = null;\n      this.__serializing = false;\n      this._initializeProperties();\n    }\n\n    /**\n     * Lifecycle callback called when properties are enabled via\n     * `_enableProperties`.\n     *\n     * Users may override this function to implement behavior that is\n     * dependent on the element having its property data initialized, e.g.\n     * from defaults (initialized from `constructor`, `_initializeProperties`),\n     * `attributeChangedCallback`, or values propagated from host e.g. via\n     * bindings.  `super.ready()` must be called to ensure the data system\n     * becomes enabled.\n     *\n     * @return {void}\n     * @public\n     * @override\n     */\n    ready() {\n      this.__dataReady = true;\n      this._flushProperties();\n    }\n\n    /**\n     * Initializes the local storage for property accessors.\n     *\n     * Provided as an override point for performing any setup work prior\n     * to initializing the property accessor system.\n     *\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _initializeProperties() {\n      // Capture instance properties; these will be set into accessors\n      // during first flush. Don't set them here, since we want\n      // these to overwrite defaults/constructor assignments\n      for (let p in this.__dataHasAccessor) {\n        if (this.hasOwnProperty(p)) {\n          this.__dataInstanceProps = this.__dataInstanceProps || {};\n          this.__dataInstanceProps[p] = this[p];\n          delete this[p];\n        }\n      }\n    }\n\n    /**\n     * Called at ready time with bag of instance properties that overwrote\n     * accessors when the element upgraded.\n     *\n     * The default implementation sets these properties back into the\n     * setter at ready time.  This method is provided as an override\n     * point for customizing or providing more efficient initialization.\n     *\n     * @param {Object} props Bag of property values that were overwritten\n     *   when creating property accessors.\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _initializeInstanceProperties(props) {\n      Object.assign(this, props);\n    }\n\n    /**\n     * Updates the local storage for a property (via `_setPendingProperty`)\n     * and enqueues a `_proeprtiesChanged` callback.\n     *\n     * @param {string} property Name of the property\n     * @param {*} value Value to set\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _setProperty(property, value) {\n      if (this._setPendingProperty(property, value)) {\n        this._invalidateProperties();\n      }\n    }\n\n    /**\n     * Returns the value for the given property.\n     * @param {string} property Name of property\n     * @return {*} Value for the given property\n     * @protected\n     * @override\n     */\n    _getProperty(property) {\n      return this.__data[property];\n    }\n\n    /* eslint-disable no-unused-vars */\n    /**\n     * Updates the local storage for a property, records the previous value,\n     * and adds it to the set of \"pending changes\" that will be passed to the\n     * `_propertiesChanged` callback.  This method does not enqueue the\n     * `_propertiesChanged` callback.\n     *\n     * @param {string} property Name of the property\n     * @param {*} value Value to set\n     * @param {boolean=} ext Not used here; affordance for closure\n     * @return {boolean} Returns true if the property changed\n     * @protected\n     * @override\n     */\n    _setPendingProperty(property, value, ext) {\n      let old = this.__data[property];\n      let changed = this._shouldPropertyChange(property, value, old);\n      if (changed) {\n        if (!this.__dataPending) {\n          this.__dataPending = {};\n          this.__dataOld = {};\n        }\n        // Ensure old is captured from the last turn\n        if (this.__dataOld && !(property in this.__dataOld)) {\n          this.__dataOld[property] = old;\n        }\n        this.__data[property] = value;\n        this.__dataPending[property] = value;\n      }\n      return changed;\n    }\n    /* eslint-enable */\n\n    /**\n     * Marks the properties as invalid, and enqueues an async\n     * `_propertiesChanged` callback.\n     *\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _invalidateProperties() {\n      if (!this.__dataInvalid && this.__dataReady) {\n        this.__dataInvalid = true;\n        microtask.run(() => {\n          if (this.__dataInvalid) {\n            this.__dataInvalid = false;\n            this._flushProperties();\n          }\n        });\n      }\n    }\n\n    /**\n     * Call to enable property accessor processing. Before this method is\n     * called accessor values will be set but side effects are\n     * queued. When called, any pending side effects occur immediately.\n     * For elements, generally `connectedCallback` is a normal spot to do so.\n     * It is safe to call this method multiple times as it only turns on\n     * property accessors once.\n     *\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _enableProperties() {\n      if (!this.__dataEnabled) {\n        this.__dataEnabled = true;\n        if (this.__dataInstanceProps) {\n          this._initializeInstanceProperties(this.__dataInstanceProps);\n          this.__dataInstanceProps = null;\n        }\n        this.ready();\n      }\n    }\n\n    /**\n     * Calls the `_propertiesChanged` callback with the current set of\n     * pending changes (and old values recorded when pending changes were\n     * set), and resets the pending set of changes. Generally, this method\n     * should not be called in user code.\n     *\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _flushProperties() {\n      const props = this.__data;\n      const changedProps = this.__dataPending;\n      const old = this.__dataOld;\n      if (this._shouldPropertiesChange(props, changedProps, old)) {\n        this.__dataPending = null;\n        this.__dataOld = null;\n        this._propertiesChanged(props, changedProps, old);\n      }\n    }\n\n    /**\n     * Called in `_flushProperties` to determine if `_propertiesChanged`\n     * should be called. The default implementation returns true if\n     * properties are pending. Override to customize when\n     * `_propertiesChanged` is called.\n     * @param {!Object} currentProps Bag of all current accessor values\n     * @param {?Object} changedProps Bag of properties changed since the last\n     *   call to `_propertiesChanged`\n     * @param {?Object} oldProps Bag of previous values for each property\n     *   in `changedProps`\n     * @return {boolean} true if changedProps is truthy\n     * @override\n     */\n    _shouldPropertiesChange(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars\n      return Boolean(changedProps);\n    }\n\n    /**\n     * Callback called when any properties with accessors created via\n     * `_createPropertyAccessor` have been set.\n     *\n     * @param {!Object} currentProps Bag of all current accessor values\n     * @param {?Object} changedProps Bag of properties changed since the last\n     *   call to `_propertiesChanged`\n     * @param {?Object} oldProps Bag of previous values for each property\n     *   in `changedProps`\n     * @return {void}\n     * @protected\n     * @override\n     */\n    _propertiesChanged(currentProps, changedProps, oldProps) { // eslint-disable-line no-unused-vars\n    }\n\n    /**\n     * Method called to determine whether a property value should be\n     * considered as a change and cause the `_propertiesChanged` callback\n     * to be enqueued.\n     *\n     * The default implementation returns `true` if a strict equality\n     * check fails. The method always returns false for `NaN`.\n     *\n     * Override this method to e.g. provide stricter checking for\n     * Objects/Arrays when using immutable patterns.\n     *\n     * @param {string} property Property name\n     * @param {*} value New property value\n     * @param {*} old Previous property value\n     * @return {boolean} Whether the property should be considered a change\n     *   and enqueue a `_proeprtiesChanged` callback\n     * @protected\n     * @override\n     */\n    _shouldPropertyChange(property, value, old) {\n      return (\n        // Strict equality check\n        (old !== value &&\n          // This ensures (old==NaN, value==NaN) always returns false\n          (old === old || value === value))\n      );\n    }\n\n    /**\n     * Implements native Custom Elements `attributeChangedCallback` to\n     * set an attribute value to a property via `_attributeToProperty`.\n     *\n     * @param {string} name Name of attribute that changed\n     * @param {?string} old Old attribute value\n     * @param {?string} value New attribute value\n     * @param {?string} namespace Attribute namespace.\n     * @return {void}\n     * @suppress {missingProperties} Super may or may not implement the callback\n     * @override\n     */\n    attributeChangedCallback(name, old, value, namespace) {\n      if (old !== value) {\n        this._attributeToProperty(name, value);\n      }\n      if (super.attributeChangedCallback) {\n        super.attributeChangedCallback(name, old, value, namespace);\n      }\n    }\n\n    /**\n     * Deserializes an attribute to its associated property.\n     *\n     * This method calls the `_deserializeValue` method to convert the string to\n     * a typed value.\n     *\n     * @param {string} attribute Name of attribute to deserialize.\n     * @param {?string} value of the attribute.\n     * @param {*=} type type to deserialize to, defaults to the value\n     * returned from `typeForProperty`\n     * @return {void}\n     * @override\n     */\n    _attributeToProperty(attribute, value, type) {\n      if (!this.__serializing) {\n        const map = this.__dataAttributes;\n        const property = map && map[attribute] || attribute;\n        this[property] = this._deserializeValue(value, type ||\n          this.constructor.typeForProperty(property));\n      }\n    }\n\n    /**\n     * Serializes a property to its associated attribute.\n     *\n     * @suppress {invalidCasts} Closure can't figure out `this` is an element.\n     *\n     * @param {string} property Property name to reflect.\n     * @param {string=} attribute Attribute name to reflect to.\n     * @param {*=} value Property value to refect.\n     * @return {void}\n     * @override\n     */\n    _propertyToAttribute(property, attribute, value) {\n      this.__serializing = true;\n      value = (arguments.length < 3) ? this[property] : value;\n      this._valueToNodeAttribute(/** @type {!HTMLElement} */(this), value,\n        attribute || this.constructor.attributeNameForProperty(property));\n      this.__serializing = false;\n    }\n\n    /**\n     * Sets a typed value to an HTML attribute on a node.\n     *\n     * This method calls the `_serializeValue` method to convert the typed\n     * value to a string.  If the `_serializeValue` method returns `undefined`,\n     * the attribute will be removed (this is the default for boolean\n     * type `false`).\n     *\n     * @param {Element} node Element to set attribute to.\n     * @param {*} value Value to serialize.\n     * @param {string} attribute Attribute name to serialize to.\n     * @return {void}\n     * @override\n     */\n    _valueToNodeAttribute(node, value, attribute) {\n      const str = this._serializeValue(value);\n      if (str === undefined) {\n        node.removeAttribute(attribute);\n      } else {\n        node.setAttribute(attribute, str);\n      }\n    }\n\n    /**\n     * Converts a typed JavaScript value to a string.\n     *\n     * This method is called when setting JS property values to\n     * HTML attributes.  Users may override this method to provide\n     * serialization for custom types.\n     *\n     * @param {*} value Property value to serialize.\n     * @return {string | undefined} String serialized from the provided\n     * property  value.\n     * @override\n     */\n    _serializeValue(value) {\n      switch (typeof value) {\n        case 'boolean':\n          return value ? '' : undefined;\n        default:\n          return value != null ? value.toString() : undefined;\n      }\n    }\n\n    /**\n     * Converts a string to a typed JavaScript value.\n     *\n     * This method is called when reading HTML attribute values to\n     * JS properties.  Users may override this method to provide\n     * deserialization for custom `type`s. Types for `Boolean`, `String`,\n     * and `Number` convert attributes to the expected types.\n     *\n     * @param {?string} value Value to deserialize.\n     * @param {*=} type Type to deserialize the string to.\n     * @return {*} Typed value deserialized from the provided string.\n     * @override\n     */\n    _deserializeValue(value, type) {\n      switch (type) {\n        case Boolean:\n          return (value !== null);\n        case Number:\n          return Number(value);\n        default:\n          return value;\n      }\n    }\n\n  }\n\n  return PropertiesChanged;\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*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { camelToDashCase, dashToCamelCase } from '../utils/case-map.js';\nimport { PropertiesChanged } from './properties-changed.js';\n\n// Save map of native properties; this forms a blacklist or properties\n// that won't have their values \"saved\" by `saveAccessorValue`, since\n// reading from an HTMLElement accessor from the context of a prototype throws\nconst nativeProperties = {};\nlet proto = HTMLElement.prototype;\nwhile (proto) {\n  let props = Object.getOwnPropertyNames(proto);\n  for (let i=0; i<props.length; i++) {\n    nativeProperties[props[i]] = true;\n  }\n  proto = Object.getPrototypeOf(proto);\n}\n\n/**\n * Used to save the value of a property that will be overridden with\n * an accessor. If the `model` is a prototype, the values will be saved\n * in `__dataProto`, and it's up to the user (or downstream mixin) to\n * decide how/when to set these values back into the accessors.\n * If `model` is already an instance (it has a `__data` property), then\n * the value will be set as a pending property, meaning the user should\n * call `_invalidateProperties` or `_flushProperties` to take effect\n *\n * @param {Object} model Prototype or instance\n * @param {string} property Name of property\n * @return {void}\n * @private\n */\nfunction saveAccessorValue(model, property) {\n  // Don't read/store value for any native properties since they could throw\n  if (!nativeProperties[property]) {\n    let value = model[property];\n    if (value !== undefined) {\n      if (model.__data) {\n        // Adding accessor to instance; update the property\n        // It is the user's responsibility to call _flushProperties\n        model._setPendingProperty(property, value);\n      } else {\n        // Adding accessor to proto; save proto's value for instance-time use\n        if (!model.__dataProto) {\n          model.__dataProto = {};\n        } else if (!model.hasOwnProperty(JSCompiler_renameProperty('__dataProto', model))) {\n          model.__dataProto = Object.create(model.__dataProto);\n        }\n        model.__dataProto[property] = value;\n      }\n    }\n  }\n}\n\n/**\n * Element class mixin that provides basic meta-programming for creating one\n * or more property accessors (getter/setter pair) that enqueue an async\n * (batched) `_propertiesChanged` callback.\n *\n * For basic usage of this mixin:\n *\n * -   Declare attributes to observe via the standard `static get observedAttributes()`. Use\n *     `dash-case` attribute names to represent `camelCase` property names.\n * -   Implement the `_propertiesChanged` callback on the class.\n * -   Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate\n *     property accessors for each observed attribute. This must be called before the first\n *     instance is created, for example, by calling it before calling `customElements.define`.\n *     It can also be called lazily from the element's `constructor`, as long as it's guarded so\n *     that the call is only made once, when the first instance is created.\n * -   Call `this._enableProperties()` in the element's `connectedCallback` to enable\n *     the accessors.\n *\n * Any `observedAttributes` will automatically be\n * deserialized via `attributeChangedCallback` and set to the associated\n * property using `dash-case`-to-`camelCase` convention.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertiesChanged\n * @summary Element class mixin for reacting to property changes from\n *   generated property accessors.\n */\nexport const PropertyAccessors = dedupingMixin(superClass => {\n\n  /**\n   * @constructor\n   * @extends {superClass}\n   * @implements {Polymer_PropertiesChanged}\n   * @unrestricted\n   * @private\n   */\n   const base = PropertiesChanged(superClass);\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_PropertyAccessors}\n   * @extends {base}\n   * @unrestricted\n   */\n  class PropertyAccessors extends base {\n\n    /**\n     * Generates property accessors for all attributes in the standard\n     * static `observedAttributes` array.\n     *\n     * Attribute names are mapped to property names using the `dash-case` to\n     * `camelCase` convention\n     *\n     * @return {void}\n     */\n    static createPropertiesForAttributes() {\n      let a$ = this.observedAttributes;\n      for (let i=0; i < a$.length; i++) {\n        this.prototype._createPropertyAccessor(dashToCamelCase(a$[i]));\n      }\n    }\n\n    /**\n     * Returns an attribute name that corresponds to the given property.\n     * By default, converts camel to dash case, e.g. `fooBar` to `foo-bar`.\n     * @param {string} property Property to convert\n     * @return {string} Attribute name corresponding to the given property.\n     *\n     * @protected\n     */\n    static attributeNameForProperty(property) {\n      return camelToDashCase(property);\n    }\n\n    /**\n     * Overrides PropertiesChanged implementation to initialize values for\n     * accessors created for values that already existed on the element\n     * prototype.\n     *\n     * @return {void}\n     * @protected\n     */\n    _initializeProperties() {\n      if (this.__dataProto) {\n        this._initializeProtoProperties(this.__dataProto);\n        this.__dataProto = null;\n      }\n      super._initializeProperties();\n    }\n\n    /**\n     * Called at instance time with bag of properties that were overwritten\n     * by accessors on the prototype when accessors were created.\n     *\n     * The default implementation sets these properties back into the\n     * setter at instance time.  This method is provided as an override\n     * point for customizing or providing more efficient initialization.\n     *\n     * @param {Object} props Bag of property values that were overwritten\n     *   when creating property accessors.\n     * @return {void}\n     * @protected\n     */\n    _initializeProtoProperties(props) {\n      for (let p in props) {\n        this._setProperty(p, props[p]);\n      }\n    }\n\n    /**\n     * Ensures the element has the given attribute. If it does not,\n     * assigns the given value to the attribute.\n     *\n     * @suppress {invalidCasts} Closure can't figure out `this` is infact an element\n     *\n     * @param {string} attribute Name of attribute to ensure is set.\n     * @param {string} value of the attribute.\n     * @return {void}\n     */\n    _ensureAttribute(attribute, value) {\n      const el = /** @type {!HTMLElement} */(this);\n      if (!el.hasAttribute(attribute)) {\n        this._valueToNodeAttribute(el, value, attribute);\n      }\n    }\n\n    /**\n     * Overrides PropertiesChanged implemention to serialize objects as JSON.\n     *\n     * @param {*} value Property value to serialize.\n     * @return {string | undefined} String serialized from the provided property value.\n     */\n    _serializeValue(value) {\n      /* eslint-disable no-fallthrough */\n      switch (typeof value) {\n        case 'object':\n          if (value instanceof Date) {\n            return value.toString();\n          } else if (value) {\n            try {\n              return JSON.stringify(value);\n            } catch(x) {\n              return '';\n            }\n          }\n\n        default:\n          return super._serializeValue(value);\n      }\n    }\n\n    /**\n     * Converts a string to a typed JavaScript value.\n     *\n     * This method is called by Polymer when reading HTML attribute values to\n     * JS properties.  Users may override this method on Polymer element\n     * prototypes to provide deserialization for custom `type`s.  Note,\n     * the `type` argument is the value of the `type` field provided in the\n     * `properties` configuration object for a given property, and is\n     * by convention the constructor for the type to deserialize.\n     *\n     *\n     * @param {?string} value Attribute value to deserialize.\n     * @param {*=} type Type to deserialize the string to.\n     * @return {*} Typed value deserialized from the provided string.\n     */\n    _deserializeValue(value, type) {\n      /**\n       * @type {*}\n       */\n      let outValue;\n      switch (type) {\n        case Object:\n          try {\n            outValue = JSON.parse(/** @type {string} */(value));\n          } catch(x) {\n            // allow non-JSON literals like Strings and Numbers\n            outValue = value;\n          }\n          break;\n        case Array:\n          try {\n            outValue = JSON.parse(/** @type {string} */(value));\n          } catch(x) {\n            outValue = null;\n            console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`);\n          }\n          break;\n        case Date:\n          outValue = isNaN(value) ? String(value) : Number(value);\n          outValue = new Date(outValue);\n          break;\n        default:\n          outValue = super._deserializeValue(value, type);\n          break;\n      }\n      return outValue;\n    }\n    /* eslint-enable no-fallthrough */\n\n    /**\n     * Overrides PropertiesChanged implementation to save existing prototype\n     * property value so that it can be reset.\n     * @param {string} property Name of the property\n     * @param {boolean=} readOnly When true, no setter is created\n     *\n     * When calling on a prototype, any overwritten values are saved in\n     * `__dataProto`, and it is up to the subclasser to decide how/when\n     * to set those properties back into the accessor.  When calling on an\n     * instance, the overwritten value is set via `_setPendingProperty`,\n     * and the user should call `_invalidateProperties` or `_flushProperties`\n     * for the values to take effect.\n     * @protected\n     * @return {void}\n     */\n    _definePropertyAccessor(property, readOnly) {\n      saveAccessorValue(this, property);\n      super._definePropertyAccessor(property, readOnly);\n    }\n\n    /**\n     * Returns true if this library created an accessor for the given property.\n     *\n     * @param {string} property Property name\n     * @return {boolean} True if an accessor was created\n     */\n    _hasAccessor(property) {\n      return this.__dataHasAccessor && this.__dataHasAccessor[property];\n    }\n\n    /**\n     * Returns true if the specified property has a pending change.\n     *\n     * @param {string} prop Property name\n     * @return {boolean} True if property has a pending change\n     * @protected\n     */\n    _isPropertyPending(prop) {\n      return Boolean(this.__dataPending && (prop in this.__dataPending));\n    }\n\n  }\n\n  return PropertyAccessors;\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*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\n\n// 1.x backwards-compatible auto-wrapper for template type extensions\n// This is a clear layering violation and gives favored-nation status to\n// dom-if and dom-repeat templates.  This is a conceit we're choosing to keep\n// a.) to ease 1.x backwards-compatibility due to loss of `is`, and\n// b.) to maintain if/repeat capability in parser-constrained elements\n//     (e.g. table, select) in lieu of native CE type extensions without\n//     massive new invention in this space (e.g. directive system)\nconst templateExtensions = {\n  'dom-if': true,\n  'dom-repeat': true\n};\nfunction wrapTemplateExtension(node) {\n  let is = node.getAttribute('is');\n  if (is && templateExtensions[is]) {\n    let t = node;\n    t.removeAttribute('is');\n    node = t.ownerDocument.createElement(is);\n    t.parentNode.replaceChild(node, t);\n    node.appendChild(t);\n    while(t.attributes.length) {\n      node.setAttribute(t.attributes[0].name, t.attributes[0].value);\n      t.removeAttribute(t.attributes[0].name);\n    }\n  }\n  return node;\n}\n\nfunction findTemplateNode(root, nodeInfo) {\n  // recursively ascend tree until we hit root\n  let parent = nodeInfo.parentInfo && findTemplateNode(root, nodeInfo.parentInfo);\n  // unwind the stack, returning the indexed node at each level\n  if (parent) {\n    // note: marginally faster than indexing via childNodes\n    // (http://jsperf.com/childnodes-lookup)\n    for (let n=parent.firstChild, i=0; n; n=n.nextSibling) {\n      if (nodeInfo.parentIndex === i++) {\n        return n;\n      }\n    }\n  } else {\n    return root;\n  }\n}\n\n// construct `$` map (from id annotations)\nfunction applyIdToMap(inst, map, node, nodeInfo) {\n  if (nodeInfo.id) {\n    map[nodeInfo.id] = node;\n  }\n}\n\n// install event listeners (from event annotations)\nfunction applyEventListener(inst, node, nodeInfo) {\n  if (nodeInfo.events && nodeInfo.events.length) {\n    for (let j=0, e$=nodeInfo.events, e; (j<e$.length) && (e=e$[j]); j++) {\n      inst._addMethodEventListenerToNode(node, e.name, e.value, inst);\n    }\n  }\n}\n\n// push configuration references at configure time\nfunction applyTemplateContent(inst, node, nodeInfo) {\n  if (nodeInfo.templateInfo) {\n    node._templateInfo = nodeInfo.templateInfo;\n  }\n}\n\nfunction createNodeEventHandler(context, eventName, methodName) {\n  // Instances can optionally have a _methodHost which allows redirecting where\n  // to find methods. Currently used by `templatize`.\n  context = context._methodHost || context;\n  let handler = function(e) {\n    if (context[methodName]) {\n      context[methodName](e, e.detail);\n    } else {\n      console.warn('listener method `' + methodName + '` not defined');\n    }\n  };\n  return handler;\n}\n\n/**\n * Element mixin that provides basic template parsing and stamping, including\n * the following template-related features for stamped templates:\n *\n * - Declarative event listeners (`on-eventname=\"listener\"`)\n * - Map of node id's to stamped node instances (`this.$.id`)\n * - Nested template content caching/removal and re-installation (performance\n *   optimization)\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin that provides basic template parsing and stamping\n */\nexport const TemplateStamp = dedupingMixin(\n    /**\n     * @template T\n     * @param {function(new:T)} superClass Class to apply mixin to.\n     * @return {function(new:T)} superClass with mixin applied.\n     */\n    (superClass) => {\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_TemplateStamp}\n   */\n  class TemplateStamp extends superClass {\n\n    /**\n     * Scans a template to produce template metadata.\n     *\n     * Template-specific metadata are stored in the object returned, and node-\n     * specific metadata are stored in objects in its flattened `nodeInfoList`\n     * array.  Only nodes in the template that were parsed as nodes of\n     * interest contain an object in `nodeInfoList`.  Each `nodeInfo` object\n     * contains an `index` (`childNodes` index in parent) and optionally\n     * `parent`, which points to node info of its parent (including its index).\n     *\n     * The template metadata object returned from this method has the following\n     * structure (many fields optional):\n     *\n     * ```js\n     *   {\n     *     // Flattened list of node metadata (for nodes that generated metadata)\n     *     nodeInfoList: [\n     *       {\n     *         // `id` attribute for any nodes with id's for generating `$` map\n     *         id: {string},\n     *         // `on-event=\"handler\"` metadata\n     *         events: [\n     *           {\n     *             name: {string},   // event name\n     *             value: {string},  // handler method name\n     *           }, ...\n     *         ],\n     *         // Notes when the template contained a `<slot>` for shady DOM\n     *         // optimization purposes\n     *         hasInsertionPoint: {boolean},\n     *         // For nested `<template>`` nodes, nested template metadata\n     *         templateInfo: {object}, // nested template metadata\n     *         // Metadata to allow efficient retrieval of instanced node\n     *         // corresponding to this metadata\n     *         parentInfo: {number},   // reference to parent nodeInfo>\n     *         parentIndex: {number},  // index in parent's `childNodes` collection\n     *         infoIndex: {number},    // index of this `nodeInfo` in `templateInfo.nodeInfoList`\n     *       },\n     *       ...\n     *     ],\n     *     // When true, the template had the `strip-whitespace` attribute\n     *     // or was nested in a template with that setting\n     *     stripWhitespace: {boolean},\n     *     // For nested templates, nested template content is moved into\n     *     // a document fragment stored here; this is an optimization to\n     *     // avoid the cost of nested template cloning\n     *     content: {DocumentFragment}\n     *   }\n     * ```\n     *\n     * This method kicks off a recursive treewalk as follows:\n     *\n     * ```\n     *    _parseTemplate <---------------------+\n     *      _parseTemplateContent              |\n     *        _parseTemplateNode  <------------|--+\n     *          _parseTemplateNestedTemplate --+  |\n     *          _parseTemplateChildNodes ---------+\n     *          _parseTemplateNodeAttributes\n     *            _parseTemplateNodeAttribute\n     *\n     * ```\n     *\n     * These methods may be overridden to add custom metadata about templates\n     * to either `templateInfo` or `nodeInfo`.\n     *\n     * Note that this method may be destructive to the template, in that\n     * e.g. event annotations may be removed after being noted in the\n     * template metadata.\n     *\n     * @param {!HTMLTemplateElement} template Template to parse\n     * @param {TemplateInfo=} outerTemplateInfo Template metadata from the outer\n     *   template, for parsing nested templates\n     * @return {!TemplateInfo} Parsed template metadata\n     */\n    static _parseTemplate(template, outerTemplateInfo) {\n      // since a template may be re-used, memo-ize metadata\n      if (!template._templateInfo) {\n        let templateInfo = template._templateInfo = {};\n        templateInfo.nodeInfoList = [];\n        templateInfo.stripWhiteSpace =\n          (outerTemplateInfo && outerTemplateInfo.stripWhiteSpace) ||\n          template.hasAttribute('strip-whitespace');\n        this._parseTemplateContent(template, templateInfo, {parent: null});\n      }\n      return template._templateInfo;\n    }\n\n    static _parseTemplateContent(template, templateInfo, nodeInfo) {\n      return this._parseTemplateNode(template.content, templateInfo, nodeInfo);\n    }\n\n    /**\n     * Parses template node and adds template and node metadata based on\n     * the current node, and its `childNodes` and `attributes`.\n     *\n     * This method may be overridden to add custom node or template specific\n     * metadata based on this node.\n     *\n     * @param {Node} node Node to parse\n     * @param {!TemplateInfo} templateInfo Template metadata for current template\n     * @param {!NodeInfo} nodeInfo Node metadata for current template.\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     */\n    static _parseTemplateNode(node, templateInfo, nodeInfo) {\n      let noted;\n      let element = /** @type {Element} */(node);\n      if (element.localName == 'template' && !element.hasAttribute('preserve-content')) {\n        noted = this._parseTemplateNestedTemplate(element, templateInfo, nodeInfo) || noted;\n      } else if (element.localName === 'slot') {\n        // For ShadyDom optimization, indicating there is an insertion point\n        templateInfo.hasInsertionPoint = true;\n      }\n      if (element.firstChild) {\n        noted = this._parseTemplateChildNodes(element, templateInfo, nodeInfo) || noted;\n      }\n      if (element.hasAttributes && element.hasAttributes()) {\n        noted = this._parseTemplateNodeAttributes(element, templateInfo, nodeInfo) || noted;\n      }\n      return noted;\n    }\n\n    /**\n     * Parses template child nodes for the given root node.\n     *\n     * This method also wraps whitelisted legacy template extensions\n     * (`is=\"dom-if\"` and `is=\"dom-repeat\"`) with their equivalent element\n     * wrappers, collapses text nodes, and strips whitespace from the template\n     * if the `templateInfo.stripWhitespace` setting was provided.\n     *\n     * @param {Node} root Root node whose `childNodes` will be parsed\n     * @param {!TemplateInfo} templateInfo Template metadata for current template\n     * @param {!NodeInfo} nodeInfo Node metadata for current template.\n     * @return {void}\n     */\n    static _parseTemplateChildNodes(root, templateInfo, nodeInfo) {\n      if (root.localName === 'script' || root.localName === 'style') {\n        return;\n      }\n      for (let node=root.firstChild, parentIndex=0, next; node; node=next) {\n        // Wrap templates\n        if (node.localName == 'template') {\n          node = wrapTemplateExtension(node);\n        }\n        // collapse adjacent textNodes: fixes an IE issue that can cause\n        // text nodes to be inexplicably split =(\n        // note that root.normalize() should work but does not so we do this\n        // manually.\n        next = node.nextSibling;\n        if (node.nodeType === Node.TEXT_NODE) {\n          let /** Node */ n = next;\n          while (n && (n.nodeType === Node.TEXT_NODE)) {\n            node.textContent += n.textContent;\n            next = n.nextSibling;\n            root.removeChild(n);\n            n = next;\n          }\n          // optionally strip whitespace\n          if (templateInfo.stripWhiteSpace && !node.textContent.trim()) {\n            root.removeChild(node);\n            continue;\n          }\n        }\n        let childInfo = { parentIndex, parentInfo: nodeInfo };\n        if (this._parseTemplateNode(node, templateInfo, childInfo)) {\n          childInfo.infoIndex = templateInfo.nodeInfoList.push(/** @type {!NodeInfo} */(childInfo)) - 1;\n        }\n        // Increment if not removed\n        if (node.parentNode) {\n          parentIndex++;\n        }\n      }\n    }\n\n    /**\n     * Parses template content for the given nested `<template>`.\n     *\n     * Nested template info is stored as `templateInfo` in the current node's\n     * `nodeInfo`. `template.content` is removed and stored in `templateInfo`.\n     * It will then be the responsibility of the host to set it back to the\n     * template and for users stamping nested templates to use the\n     * `_contentForTemplate` method to retrieve the content for this template\n     * (an optimization to avoid the cost of cloning nested template content).\n     *\n     * @param {HTMLTemplateElement} node Node to parse (a <template>)\n     * @param {TemplateInfo} outerTemplateInfo Template metadata for current template\n     *   that includes the template `node`\n     * @param {!NodeInfo} nodeInfo Node metadata for current template.\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     */\n    static _parseTemplateNestedTemplate(node, outerTemplateInfo, nodeInfo) {\n      let templateInfo = this._parseTemplate(node, outerTemplateInfo);\n      let content = templateInfo.content =\n        node.content.ownerDocument.createDocumentFragment();\n      content.appendChild(node.content);\n      nodeInfo.templateInfo = templateInfo;\n      return true;\n    }\n\n    /**\n     * Parses template node attributes and adds node metadata to `nodeInfo`\n     * for nodes of interest.\n     *\n     * @param {Element} node Node to parse\n     * @param {TemplateInfo} templateInfo Template metadata for current template\n     * @param {NodeInfo} nodeInfo Node metadata for current template.\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     */\n    static _parseTemplateNodeAttributes(node, templateInfo, nodeInfo) {\n      // Make copy of original attribute list, since the order may change\n      // as attributes are added and removed\n      let noted = false;\n      let attrs = Array.from(node.attributes);\n      for (let i=attrs.length-1, a; (a=attrs[i]); i--) {\n        noted = this._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, a.name, a.value) || noted;\n      }\n      return noted;\n    }\n\n    /**\n     * Parses a single template node attribute and adds node metadata to\n     * `nodeInfo` for attributes of interest.\n     *\n     * This implementation adds metadata for `on-event=\"handler\"` attributes\n     * and `id` attributes.\n     *\n     * @param {Element} node Node to parse\n     * @param {!TemplateInfo} templateInfo Template metadata for current template\n     * @param {!NodeInfo} nodeInfo Node metadata for current template.\n     * @param {string} name Attribute name\n     * @param {string} value Attribute value\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     */\n    static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) {\n      // events (on-*)\n      if (name.slice(0, 3) === 'on-') {\n        node.removeAttribute(name);\n        nodeInfo.events = nodeInfo.events || [];\n        nodeInfo.events.push({\n          name: name.slice(3),\n          value\n        });\n        return true;\n      }\n      // static id\n      else if (name === 'id') {\n        nodeInfo.id = value;\n        return true;\n      }\n      return false;\n    }\n\n    /**\n     * Returns the `content` document fragment for a given template.\n     *\n     * For nested templates, Polymer performs an optimization to cache nested\n     * template content to avoid the cost of cloning deeply nested templates.\n     * This method retrieves the cached content for a given template.\n     *\n     * @param {HTMLTemplateElement} template Template to retrieve `content` for\n     * @return {DocumentFragment} Content fragment\n     */\n    static _contentForTemplate(template) {\n      let templateInfo = /** @type {HTMLTemplateElementWithInfo} */ (template)._templateInfo;\n      return (templateInfo && templateInfo.content) || template.content;\n    }\n\n    /**\n     * Clones the provided template content and returns a document fragment\n     * containing the cloned dom.\n     *\n     * The template is parsed (once and memoized) using this library's\n     * template parsing features, and provides the following value-added\n     * features:\n     * * Adds declarative event listeners for `on-event=\"handler\"` attributes\n     * * Generates an \"id map\" for all nodes with id's under `$` on returned\n     *   document fragment\n     * * Passes template info including `content` back to templates as\n     *   `_templateInfo` (a performance optimization to avoid deep template\n     *   cloning)\n     *\n     * Note that the memoized template parsing process is destructive to the\n     * template: attributes for bindings and declarative event listeners are\n     * removed after being noted in notes, and any nested `<template>.content`\n     * is removed and stored in notes as well.\n     *\n     * @param {!HTMLTemplateElement} template Template to stamp\n     * @return {!StampedTemplate} Cloned template content\n     * @override\n     */\n    _stampTemplate(template) {\n      // Polyfill support: bootstrap the template if it has not already been\n      if (template && !template.content &&\n          window.HTMLTemplateElement && HTMLTemplateElement.decorate) {\n        HTMLTemplateElement.decorate(template);\n      }\n      let templateInfo = this.constructor._parseTemplate(template);\n      let nodeInfo = templateInfo.nodeInfoList;\n      let content = templateInfo.content || template.content;\n      let dom = /** @type {DocumentFragment} */ (document.importNode(content, true));\n      // NOTE: ShadyDom optimization indicating there is an insertion point\n      dom.__noInsertionPoint = !templateInfo.hasInsertionPoint;\n      let nodes = dom.nodeList = new Array(nodeInfo.length);\n      dom.$ = {};\n      for (let i=0, l=nodeInfo.length, info; (i<l) && (info=nodeInfo[i]); i++) {\n        let node = nodes[i] = findTemplateNode(dom, info);\n        applyIdToMap(this, dom.$, node, info);\n        applyTemplateContent(this, node, info);\n        applyEventListener(this, node, info);\n      }\n      dom = /** @type {!StampedTemplate} */(dom); // eslint-disable-line no-self-assign\n      return dom;\n    }\n\n    /**\n     * Adds an event listener by method name for the event provided.\n     *\n     * This method generates a handler function that looks up the method\n     * name at handling time.\n     *\n     * @param {!EventTarget} node Node to add listener on\n     * @param {string} eventName Name of event\n     * @param {string} methodName Name of method\n     * @param {*=} context Context the method will be called on (defaults\n     *   to `node`)\n     * @return {Function} Generated handler function\n     * @override\n     */\n    _addMethodEventListenerToNode(node, eventName, methodName, context) {\n      context = context || node;\n      let handler = createNodeEventHandler(context, eventName, methodName);\n      this._addEventListenerToNode(node, eventName, handler);\n      return handler;\n    }\n\n    /**\n     * Override point for adding custom or simulated event handling.\n     *\n     * @param {!EventTarget} node Node to add event listener to\n     * @param {string} eventName Name of event\n     * @param {function(!Event):void} handler Listener function to add\n     * @return {void}\n     * @override\n     */\n    _addEventListenerToNode(node, eventName, handler) {\n      node.addEventListener(eventName, handler);\n    }\n\n    /**\n     * Override point for adding custom or simulated event handling.\n     *\n     * @param {!EventTarget} node Node to remove event listener from\n     * @param {string} eventName Name of event\n     * @param {function(!Event):void} handler Listener function to remove\n     * @return {void}\n     * @override\n     */\n    _removeEventListenerFromNode(node, eventName, handler) {\n      node.removeEventListener(eventName, handler);\n    }\n\n  }\n\n  return TemplateStamp;\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\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { root, isAncestor, isDescendant, get, translate, isPath, set, normalize } from '../utils/path.js';\n/* for notify, reflect */\nimport { camelToDashCase, dashToCamelCase } from '../utils/case-map.js';\nimport { PropertyAccessors } from './property-accessors.js';\n/* for annotated effects */\nimport { TemplateStamp } from './template-stamp.js';\nimport { sanitizeDOMValue } from '../utils/settings.js';\n\n// Monotonically increasing unique ID used for de-duping effects triggered\n// from multiple properties in the same turn\nlet dedupeId = 0;\n\n/**\n * Property effect types; effects are stored on the prototype using these keys\n * @enum {string}\n */\nconst TYPES = {\n  COMPUTE: '__computeEffects',\n  REFLECT: '__reflectEffects',\n  NOTIFY: '__notifyEffects',\n  PROPAGATE: '__propagateEffects',\n  OBSERVE: '__observeEffects',\n  READ_ONLY: '__readOnly'\n};\n\n/** @const {RegExp} */\nconst capitalAttributeRegex = /[A-Z]/;\n\n/**\n * @typedef {{\n * name: (string | undefined),\n * structured: (boolean | undefined),\n * wildcard: (boolean | undefined)\n * }}\n */\nlet DataTrigger; //eslint-disable-line no-unused-vars\n\n/**\n * @typedef {{\n * info: ?,\n * trigger: (!DataTrigger | undefined),\n * fn: (!Function | undefined)\n * }}\n */\nlet DataEffect; //eslint-disable-line no-unused-vars\n\nlet PropertyEffectsType; //eslint-disable-line no-unused-vars\n\n/**\n * Ensures that the model has an own-property map of effects for the given type.\n * The model may be a prototype or an instance.\n *\n * Property effects are stored as arrays of effects by property in a map,\n * by named type on the model. e.g.\n *\n *   __computeEffects: {\n *     foo: [ ... ],\n *     bar: [ ... ]\n *   }\n *\n * If the model does not yet have an effect map for the type, one is created\n * and returned.  If it does, but it is not an own property (i.e. the\n * prototype had effects), the the map is deeply cloned and the copy is\n * set on the model and returned, ready for new effects to be added.\n *\n * @param {Object} model Prototype or instance\n * @param {string} type Property effect type\n * @return {Object} The own-property map of effects for the given type\n * @private\n */\nfunction ensureOwnEffectMap(model, type) {\n  let effects = model[type];\n  if (!effects) {\n    effects = model[type] = {};\n  } else if (!model.hasOwnProperty(type)) {\n    effects = model[type] = Object.create(model[type]);\n    for (let p in effects) {\n      let protoFx = effects[p];\n      let instFx = effects[p] = Array(protoFx.length);\n      for (let i=0; i<protoFx.length; i++) {\n        instFx[i] = protoFx[i];\n      }\n    }\n  }\n  return effects;\n}\n\n// -- effects ----------------------------------------------\n\n/**\n * Runs all effects of a given type for the given set of property changes\n * on an instance.\n *\n * @param {!PropertyEffectsType} inst The instance with effects to run\n * @param {Object} effects Object map of property-to-Array of effects\n * @param {Object} props Bag of current property changes\n * @param {Object=} oldProps Bag of previous values for changed properties\n * @param {boolean=} hasPaths True with `props` contains one or more paths\n * @param {*=} extraArgs Additional metadata to pass to effect function\n * @return {boolean} True if an effect ran for this property\n * @private\n */\nfunction runEffects(inst, effects, props, oldProps, hasPaths, extraArgs) {\n  if (effects) {\n    let ran = false;\n    let id = dedupeId++;\n    for (let prop in props) {\n      if (runEffectsForProperty(inst, effects, id, prop, props, oldProps, hasPaths, extraArgs)) {\n        ran = true;\n      }\n    }\n    return ran;\n  }\n  return false;\n}\n\n/**\n * Runs a list of effects for a given property.\n *\n * @param {!PropertyEffectsType} inst The instance with effects to run\n * @param {Object} effects Object map of property-to-Array of effects\n * @param {number} dedupeId Counter used for de-duping effects\n * @param {string} prop Name of changed property\n * @param {*} props Changed properties\n * @param {*} oldProps Old properties\n * @param {boolean=} hasPaths True with `props` contains one or more paths\n * @param {*=} extraArgs Additional metadata to pass to effect function\n * @return {boolean} True if an effect ran for this property\n * @private\n */\nfunction runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) {\n  let ran = false;\n  let rootProperty = hasPaths ? root(prop) : prop;\n  let fxs = effects[rootProperty];\n  if (fxs) {\n    for (let i=0, l=fxs.length, fx; (i<l) && (fx=fxs[i]); i++) {\n      if ((!fx.info || fx.info.lastRun !== dedupeId) &&\n          (!hasPaths || pathMatchesTrigger(prop, fx.trigger))) {\n        if (fx.info) {\n          fx.info.lastRun = dedupeId;\n        }\n        fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, extraArgs);\n        ran = true;\n      }\n    }\n  }\n  return ran;\n}\n\n/**\n * Determines whether a property/path that has changed matches the trigger\n * criteria for an effect.  A trigger is a descriptor with the following\n * structure, which matches the descriptors returned from `parseArg`.\n * e.g. for `foo.bar.*`:\n * ```\n * trigger: {\n *   name: 'a.b',\n *   structured: true,\n *   wildcard: true\n * }\n * ```\n * If no trigger is given, the path is deemed to match.\n *\n * @param {string} path Path or property that changed\n * @param {DataTrigger} trigger Descriptor\n * @return {boolean} Whether the path matched the trigger\n */\nfunction pathMatchesTrigger(path, trigger) {\n  if (trigger) {\n    let triggerPath = trigger.name;\n    return (triggerPath == path) ||\n      (trigger.structured && isAncestor(triggerPath, path)) ||\n      (trigger.wildcard && isDescendant(triggerPath, path));\n  } else {\n    return true;\n  }\n}\n\n/**\n * Implements the \"observer\" effect.\n *\n * Calls the method with `info.methodName` on the instance, passing the\n * new and old values.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {void}\n * @private\n */\nfunction runObserverEffect(inst, property, props, oldProps, info) {\n  let fn = typeof info.method === \"string\" ? inst[info.method] : info.method;\n  let changedProp = info.property;\n  if (fn) {\n    fn.call(inst, inst.__data[changedProp], oldProps[changedProp]);\n  } else if (!info.dynamicFn) {\n    console.warn('observer method `' + info.method + '` not defined');\n  }\n}\n\n/**\n * Runs \"notify\" effects for a set of changed properties.\n *\n * This method differs from the generic `runEffects` method in that it\n * will dispatch path notification events in the case that the property\n * changed was a path and the root property for that path didn't have a\n * \"notify\" effect.  This is to maintain 1.0 behavior that did not require\n * `notify: true` to ensure object sub-property notifications were\n * sent.\n *\n * @param {!PropertyEffectsType} inst The instance with effects to run\n * @param {Object} notifyProps Bag of properties to notify\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {\n  // Notify\n  let fxs = inst[TYPES.NOTIFY];\n  let notified;\n  let id = dedupeId++;\n  // Try normal notify effects; if none, fall back to try path notification\n  for (let prop in notifyProps) {\n    if (notifyProps[prop]) {\n      if (fxs && runEffectsForProperty(inst, fxs, id, prop, props, oldProps, hasPaths)) {\n        notified = true;\n      } else if (hasPaths && notifyPath(inst, prop, props)) {\n        notified = true;\n      }\n    }\n  }\n  // Flush host if we actually notified and host was batching\n  // And the host has already initialized clients; this prevents\n  // an issue with a host observing data changes before clients are ready.\n  let host;\n  if (notified && (host = inst.__dataHost) && host._invalidateProperties) {\n    host._invalidateProperties();\n  }\n}\n\n/**\n * Dispatches {property}-changed events with path information in the detail\n * object to indicate a sub-path of the property was changed.\n *\n * @param {!PropertyEffectsType} inst The element from which to fire the event\n * @param {string} path The path that was changed\n * @param {Object} props Bag of current property changes\n * @return {boolean} Returns true if the path was notified\n * @private\n */\nfunction notifyPath(inst, path, props) {\n  let rootProperty = root(path);\n  if (rootProperty !== path) {\n    let eventName = camelToDashCase(rootProperty) + '-changed';\n    dispatchNotifyEvent(inst, eventName, props[path], path);\n    return true;\n  }\n  return false;\n}\n\n/**\n * Dispatches {property}-changed events to indicate a property (or path)\n * changed.\n *\n * @param {!PropertyEffectsType} inst The element from which to fire the event\n * @param {string} eventName The name of the event to send ('{property}-changed')\n * @param {*} value The value of the changed property\n * @param {string | null | undefined} path If a sub-path of this property changed, the path\n *   that changed (optional).\n * @return {void}\n * @private\n * @suppress {invalidCasts}\n */\nfunction dispatchNotifyEvent(inst, eventName, value, path) {\n  let detail = {\n    value: value,\n    queueProperty: true\n  };\n  if (path) {\n    detail.path = path;\n  }\n  /** @type {!HTMLElement} */(inst).dispatchEvent(new CustomEvent(eventName, { detail }));\n}\n\n/**\n * Implements the \"notify\" effect.\n *\n * Dispatches a non-bubbling event named `info.eventName` on the instance\n * with a detail object containing the new `value`.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runNotifyEffect(inst, property, props, oldProps, info, hasPaths) {\n  let rootProperty = hasPaths ? root(property) : property;\n  let path = rootProperty != property ? property : null;\n  let value = path ? get(inst, path) : inst.__data[property];\n  if (path && value === undefined) {\n    value = props[property];  // specifically for .splices\n  }\n  dispatchNotifyEvent(inst, info.eventName, value, path);\n}\n\n/**\n * Handler function for 2-way notification events. Receives context\n * information captured in the `addNotifyListener` closure from the\n * `__notifyListeners` metadata.\n *\n * Sets the value of the notified property to the host property or path.  If\n * the event contained path information, translate that path to the host\n * scope's name for that path first.\n *\n * @param {CustomEvent} event Notification event (e.g. '<property>-changed')\n * @param {!PropertyEffectsType} inst Host element instance handling the notification event\n * @param {string} fromProp Child element property that was bound\n * @param {string} toPath Host property/path that was bound\n * @param {boolean} negate Whether the binding was negated\n * @return {void}\n * @private\n */\nfunction handleNotification(event, inst, fromProp, toPath, negate) {\n  let value;\n  let detail = /** @type {Object} */(event.detail);\n  let fromPath = detail && detail.path;\n  if (fromPath) {\n    toPath = translate(fromProp, toPath, fromPath);\n    value = detail && detail.value;\n  } else {\n    value = event.currentTarget[fromProp];\n  }\n  value = negate ? !value : value;\n  if (!inst[TYPES.READ_ONLY] || !inst[TYPES.READ_ONLY][toPath]) {\n    if (inst._setPendingPropertyOrPath(toPath, value, true, Boolean(fromPath))\n      && (!detail || !detail.queueProperty)) {\n      inst._invalidateProperties();\n    }\n  }\n}\n\n/**\n * Implements the \"reflect\" effect.\n *\n * Sets the attribute named `info.attrName` to the given property value.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {void}\n * @private\n */\nfunction runReflectEffect(inst, property, props, oldProps, info) {\n  let value = inst.__data[property];\n  if (sanitizeDOMValue) {\n    value = sanitizeDOMValue(value, info.attrName, 'attribute', /** @type {Node} */(inst));\n  }\n  inst._propertyToAttribute(property, info.attrName, value);\n}\n\n/**\n * Runs \"computed\" effects for a set of changed properties.\n *\n * This method differs from the generic `runEffects` method in that it\n * continues to run computed effects based on the output of each pass until\n * there are no more newly computed properties.  This ensures that all\n * properties that will be computed by the initial set of changes are\n * computed before other effects (binding propagation, observers, and notify)\n * run.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {!Object} changedProps Bag of changed properties\n * @param {!Object} oldProps Bag of previous values for changed properties\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @return {void}\n * @private\n */\nfunction runComputedEffects(inst, changedProps, oldProps, hasPaths) {\n  let computeEffects = inst[TYPES.COMPUTE];\n  if (computeEffects) {\n    let inputProps = changedProps;\n    while (runEffects(inst, computeEffects, inputProps, oldProps, hasPaths)) {\n      Object.assign(oldProps, inst.__dataOld);\n      Object.assign(changedProps, inst.__dataPending);\n      inputProps = inst.__dataPending;\n      inst.__dataPending = null;\n    }\n  }\n}\n\n/**\n * Implements the \"computed property\" effect by running the method with the\n * values of the arguments specified in the `info` object and setting the\n * return value to the computed property specified.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {void}\n * @private\n */\nfunction runComputedEffect(inst, property, props, oldProps, info) {\n  let result = runMethodEffect(inst, property, props, oldProps, info);\n  let computedProp = info.methodInfo;\n  if (inst.__dataHasAccessor && inst.__dataHasAccessor[computedProp]) {\n    inst._setPendingProperty(computedProp, result, true);\n  } else {\n    inst[computedProp] = result;\n  }\n}\n\n/**\n * Computes path changes based on path links set up using the `linkPaths`\n * API.\n *\n * @param {!PropertyEffectsType} inst The instance whose props are changing\n * @param {string | !Array<(string|number)>} path Path that has changed\n * @param {*} value Value of changed path\n * @return {void}\n * @private\n */\nfunction computeLinkedPaths(inst, path, value) {\n  let links = inst.__dataLinkedPaths;\n  if (links) {\n    let link;\n    for (let a in links) {\n      let b = links[a];\n      if (isDescendant(a, path)) {\n        link = translate(a, b, path);\n        inst._setPendingPropertyOrPath(link, value, true, true);\n      } else if (isDescendant(b, path)) {\n        link = translate(b, a, path);\n        inst._setPendingPropertyOrPath(link, value, true, true);\n      }\n    }\n  }\n}\n\n// -- bindings ----------------------------------------------\n\n/**\n * Adds binding metadata to the current `nodeInfo`, and binding effects\n * for all part dependencies to `templateInfo`.\n *\n * @param {Function} constructor Class that `_parseTemplate` is currently\n *   running on\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {NodeInfo} nodeInfo Node metadata for current template node\n * @param {string} kind Binding kind, either 'property', 'attribute', or 'text'\n * @param {string} target Target property name\n * @param {!Array<!BindingPart>} parts Array of binding part metadata\n * @param {string=} literal Literal text surrounding binding parts (specified\n *   only for 'property' bindings, since these must be initialized as part\n *   of boot-up)\n * @return {void}\n * @private\n */\nfunction addBinding(constructor, templateInfo, nodeInfo, kind, target, parts, literal) {\n  // Create binding metadata and add to nodeInfo\n  nodeInfo.bindings = nodeInfo.bindings || [];\n  let /** Binding */ binding = { kind, target, parts, literal, isCompound: (parts.length !== 1) };\n  nodeInfo.bindings.push(binding);\n  // Add listener info to binding metadata\n  if (shouldAddListener(binding)) {\n    let {event, negate} = binding.parts[0];\n    binding.listenerEvent = event || (camelToDashCase(target) + '-changed');\n    binding.listenerNegate = negate;\n  }\n  // Add \"propagate\" property effects to templateInfo\n  let index = templateInfo.nodeInfoList.length;\n  for (let i=0; i<binding.parts.length; i++) {\n    let part = binding.parts[i];\n    part.compoundIndex = i;\n    addEffectForBindingPart(constructor, templateInfo, binding, part, index);\n  }\n}\n\n/**\n * Adds property effects to the given `templateInfo` for the given binding\n * part.\n *\n * @param {Function} constructor Class that `_parseTemplate` is currently\n *   running on\n * @param {TemplateInfo} templateInfo Template metadata for current template\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @param {number} index Index into `nodeInfoList` for this node\n * @return {void}\n */\nfunction addEffectForBindingPart(constructor, templateInfo, binding, part, index) {\n  if (!part.literal) {\n    if (binding.kind === 'attribute' && binding.target[0] === '-') {\n      console.warn('Cannot set attribute ' + binding.target +\n        ' because \"-\" is not a valid attribute starting character');\n    } else {\n      let dependencies = part.dependencies;\n      let info = { index, binding, part, evaluator: constructor };\n      for (let j=0; j<dependencies.length; j++) {\n        let trigger = dependencies[j];\n        if (typeof trigger == 'string') {\n          trigger = parseArg(trigger);\n          trigger.wildcard = true;\n        }\n        constructor._addTemplatePropertyEffect(templateInfo, trigger.rootProperty, {\n          fn: runBindingEffect,\n          info, trigger\n        });\n      }\n    }\n  }\n}\n\n/**\n * Implements the \"binding\" (property/path binding) effect.\n *\n * Note that binding syntax is overridable via `_parseBindings` and\n * `_evaluateBinding`.  This method will call `_evaluateBinding` for any\n * non-literal parts returned from `_parseBindings`.  However,\n * there is no support for _path_ bindings via custom binding parts,\n * as this is specific to Polymer's path binding syntax.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} path Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @param {boolean} hasPaths True with `props` contains one or more paths\n * @param {Array} nodeList List of nodes associated with `nodeInfoList` template\n *   metadata\n * @return {void}\n * @private\n */\nfunction runBindingEffect(inst, path, props, oldProps, info, hasPaths, nodeList) {\n  let node = nodeList[info.index];\n  let binding = info.binding;\n  let part = info.part;\n  // Subpath notification: transform path and set to client\n  // e.g.: foo=\"{{obj.sub}}\", path: 'obj.sub.prop', set 'foo.prop'=obj.sub.prop\n  if (hasPaths && part.source && (path.length > part.source.length) &&\n      (binding.kind == 'property') && !binding.isCompound &&\n      node.__isPropertyEffectsClient &&\n      node.__dataHasAccessor && node.__dataHasAccessor[binding.target]) {\n    let value = props[path];\n    path = translate(part.source, binding.target, path);\n    if (node._setPendingPropertyOrPath(path, value, false, true)) {\n      inst._enqueueClient(node);\n    }\n  } else {\n    let value = info.evaluator._evaluateBinding(inst, part, path, props, oldProps, hasPaths);\n    // Propagate value to child\n    applyBindingValue(inst, node, binding, part, value);\n  }\n}\n\n/**\n * Sets the value for an \"binding\" (binding) effect to a node,\n * either as a property or attribute.\n *\n * @param {!PropertyEffectsType} inst The instance owning the binding effect\n * @param {Node} node Target node for binding\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @param {*} value Value to set\n * @return {void}\n * @private\n */\nfunction applyBindingValue(inst, node, binding, part, value) {\n  value = computeBindingValue(node, value, binding, part);\n  if (sanitizeDOMValue) {\n    value = sanitizeDOMValue(value, binding.target, binding.kind, node);\n  }\n  if (binding.kind == 'attribute') {\n    // Attribute binding\n    inst._valueToNodeAttribute(/** @type {Element} */(node), value, binding.target);\n  } else {\n    // Property binding\n    let prop = binding.target;\n    if (node.__isPropertyEffectsClient &&\n        node.__dataHasAccessor && node.__dataHasAccessor[prop]) {\n      if (!node[TYPES.READ_ONLY] || !node[TYPES.READ_ONLY][prop]) {\n        if (node._setPendingProperty(prop, value)) {\n          inst._enqueueClient(node);\n        }\n      }\n    } else  {\n      inst._setUnmanagedPropertyToNode(node, prop, value);\n    }\n  }\n}\n\n/**\n * Transforms an \"binding\" effect value based on compound & negation\n * effect metadata, as well as handling for special-case properties\n *\n * @param {Node} node Node the value will be set to\n * @param {*} value Value to set\n * @param {!Binding} binding Binding metadata\n * @param {!BindingPart} part Binding part metadata\n * @return {*} Transformed value to set\n * @private\n */\nfunction computeBindingValue(node, value, binding, part) {\n  if (binding.isCompound) {\n    let storage = node.__dataCompoundStorage[binding.target];\n    storage[part.compoundIndex] = value;\n    value = storage.join('');\n  }\n  if (binding.kind !== 'attribute') {\n    // Some browsers serialize `undefined` to `\"undefined\"`\n    if (binding.target === 'textContent' ||\n        (binding.target === 'value' &&\n          (node.localName === 'input' || node.localName === 'textarea'))) {\n      value = value == undefined ? '' : value;\n    }\n  }\n  return value;\n}\n\n/**\n * Returns true if a binding's metadata meets all the requirements to allow\n * 2-way binding, and therefore a `<property>-changed` event listener should be\n * added:\n * - used curly braces\n * - is a property (not attribute) binding\n * - is not a textContent binding\n * - is not compound\n *\n * @param {!Binding} binding Binding metadata\n * @return {boolean} True if 2-way listener should be added\n * @private\n */\nfunction shouldAddListener(binding) {\n  return Boolean(binding.target) &&\n         binding.kind != 'attribute' &&\n         binding.kind != 'text' &&\n         !binding.isCompound &&\n         binding.parts[0].mode === '{';\n}\n\n/**\n * Setup compound binding storage structures, notify listeners, and dataHost\n * references onto the bound nodeList.\n *\n * @param {!PropertyEffectsType} inst Instance that bas been previously bound\n * @param {TemplateInfo} templateInfo Template metadata\n * @return {void}\n * @private\n */\nfunction setupBindings(inst, templateInfo) {\n  // Setup compound storage, dataHost, and notify listeners\n  let {nodeList, nodeInfoList} = templateInfo;\n  if (nodeInfoList.length) {\n    for (let i=0; i < nodeInfoList.length; i++) {\n      let info = nodeInfoList[i];\n      let node = nodeList[i];\n      let bindings = info.bindings;\n      if (bindings) {\n        for (let i=0; i<bindings.length; i++) {\n          let binding = bindings[i];\n          setupCompoundStorage(node, binding);\n          addNotifyListener(node, inst, binding);\n        }\n      }\n      node.__dataHost = inst;\n    }\n  }\n}\n\n/**\n * Initializes `__dataCompoundStorage` local storage on a bound node with\n * initial literal data for compound bindings, and sets the joined\n * literal parts to the bound property.\n *\n * When changes to compound parts occur, they are first set into the compound\n * storage array for that property, and then the array is joined to result in\n * the final value set to the property/attribute.\n *\n * @param {Node} node Bound node to initialize\n * @param {Binding} binding Binding metadata\n * @return {void}\n * @private\n */\nfunction setupCompoundStorage(node, binding) {\n  if (binding.isCompound) {\n    // Create compound storage map\n    let storage = node.__dataCompoundStorage ||\n      (node.__dataCompoundStorage = {});\n    let parts = binding.parts;\n    // Copy literals from parts into storage for this binding\n    let literals = new Array(parts.length);\n    for (let j=0; j<parts.length; j++) {\n      literals[j] = parts[j].literal;\n    }\n    let target = binding.target;\n    storage[target] = literals;\n    // Configure properties with their literal parts\n    if (binding.literal && binding.kind == 'property') {\n      node[target] = binding.literal;\n    }\n  }\n}\n\n/**\n * Adds a 2-way binding notification event listener to the node specified\n *\n * @param {Object} node Child element to add listener to\n * @param {!PropertyEffectsType} inst Host element instance to handle notification event\n * @param {Binding} binding Binding metadata\n * @return {void}\n * @private\n */\nfunction addNotifyListener(node, inst, binding) {\n  if (binding.listenerEvent) {\n    let part = binding.parts[0];\n    node.addEventListener(binding.listenerEvent, function(e) {\n      handleNotification(e, inst, binding.target, part.source, part.negate);\n    });\n  }\n}\n\n// -- for method-based effects (complexObserver & computed) --------------\n\n/**\n * Adds property effects for each argument in the method signature (and\n * optionally, for the method name if `dynamic` is true) that calls the\n * provided effect function.\n *\n * @param {Element | Object} model Prototype or instance\n * @param {!MethodSignature} sig Method signature metadata\n * @param {string} type Type of property effect to add\n * @param {Function} effectFn Function to run when arguments change\n * @param {*=} methodInfo Effect-specific information to be included in\n *   method effect metadata\n * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether\n *   method names should be included as a dependency to the effect. Note,\n *   defaults to true if the signature is static (sig.static is true).\n * @return {void}\n * @private\n */\nfunction createMethodEffect(model, sig, type, effectFn, methodInfo, dynamicFn) {\n  dynamicFn = sig.static || (dynamicFn &&\n    (typeof dynamicFn !== 'object' || dynamicFn[sig.methodName]));\n  let info = {\n    methodName: sig.methodName,\n    args: sig.args,\n    methodInfo,\n    dynamicFn\n  };\n  for (let i=0, arg; (i<sig.args.length) && (arg=sig.args[i]); i++) {\n    if (!arg.literal) {\n      model._addPropertyEffect(arg.rootProperty, type, {\n        fn: effectFn, info: info, trigger: arg\n      });\n    }\n  }\n  if (dynamicFn) {\n    model._addPropertyEffect(sig.methodName, type, {\n      fn: effectFn, info: info\n    });\n  }\n}\n\n/**\n * Calls a method with arguments marshaled from properties on the instance\n * based on the method signature contained in the effect metadata.\n *\n * Multi-property observers, computed properties, and inline computing\n * functions call this function to invoke the method, then use the return\n * value accordingly.\n *\n * @param {!PropertyEffectsType} inst The instance the effect will be run on\n * @param {string} property Name of property\n * @param {Object} props Bag of current property changes\n * @param {Object} oldProps Bag of previous values for changed properties\n * @param {?} info Effect metadata\n * @return {*} Returns the return value from the method invocation\n * @private\n */\nfunction runMethodEffect(inst, property, props, oldProps, info) {\n  // Instances can optionally have a _methodHost which allows redirecting where\n  // to find methods. Currently used by `templatize`.\n  let context = inst._methodHost || inst;\n  let fn = context[info.methodName];\n  if (fn) {\n    let args = inst._marshalArgs(info.args, property, props);\n    return fn.apply(context, args);\n  } else if (!info.dynamicFn) {\n    console.warn('method `' + info.methodName + '` not defined');\n  }\n}\n\nconst emptyArray = [];\n\n// Regular expressions used for binding\nconst IDENT  = '(?:' + '[a-zA-Z_$][\\\\w.:$\\\\-*]*' + ')';\nconst NUMBER = '(?:' + '[-+]?[0-9]*\\\\.?[0-9]+(?:[eE][-+]?[0-9]+)?' + ')';\nconst SQUOTE_STRING = '(?:' + '\\'(?:[^\\'\\\\\\\\]|\\\\\\\\.)*\\'' + ')';\nconst DQUOTE_STRING = '(?:' + '\"(?:[^\"\\\\\\\\]|\\\\\\\\.)*\"' + ')';\nconst STRING = '(?:' + SQUOTE_STRING + '|' + DQUOTE_STRING + ')';\nconst ARGUMENT = '(?:(' + IDENT + '|' + NUMBER + '|' +  STRING + ')\\\\s*' + ')';\nconst ARGUMENTS = '(?:' + ARGUMENT + '(?:,\\\\s*' + ARGUMENT + ')*' + ')';\nconst ARGUMENT_LIST = '(?:' + '\\\\(\\\\s*' +\n                              '(?:' + ARGUMENTS + '?' + ')' +\n                            '\\\\)\\\\s*' + ')';\nconst BINDING = '(' + IDENT + '\\\\s*' + ARGUMENT_LIST + '?' + ')'; // Group 3\nconst OPEN_BRACKET = '(\\\\[\\\\[|{{)' + '\\\\s*';\nconst CLOSE_BRACKET = '(?:]]|}})';\nconst NEGATE = '(?:(!)\\\\s*)?'; // Group 2\nconst EXPRESSION = OPEN_BRACKET + NEGATE + BINDING + CLOSE_BRACKET;\nconst bindingRegex = new RegExp(EXPRESSION, \"g\");\n\n/**\n * Create a string from binding parts of all the literal parts\n *\n * @param {!Array<BindingPart>} parts All parts to stringify\n * @return {string} String made from the literal parts\n */\nfunction literalFromParts(parts) {\n  let s = '';\n  for (let i=0; i<parts.length; i++) {\n    let literal = parts[i].literal;\n    s += literal || '';\n  }\n  return s;\n}\n\n/**\n * Parses an expression string for a method signature, and returns a metadata\n * describing the method in terms of `methodName`, `static` (whether all the\n * arguments are literals), and an array of `args`\n *\n * @param {string} expression The expression to parse\n * @return {?MethodSignature} The method metadata object if a method expression was\n *   found, otherwise `undefined`\n * @private\n */\nfunction parseMethod(expression) {\n  // tries to match valid javascript property names\n  let m = expression.match(/([^\\s]+?)\\(([\\s\\S]*)\\)/);\n  if (m) {\n    let methodName = m[1];\n    let sig = { methodName, static: true, args: emptyArray };\n    if (m[2].trim()) {\n      // replace escaped commas with comma entity, split on un-escaped commas\n      let args = m[2].replace(/\\\\,/g, '&comma;').split(',');\n      return parseArgs(args, sig);\n    } else {\n      return sig;\n    }\n  }\n  return null;\n}\n\n/**\n * Parses an array of arguments and sets the `args` property of the supplied\n * signature metadata object. Sets the `static` property to false if any\n * argument is a non-literal.\n *\n * @param {!Array<string>} argList Array of argument names\n * @param {!MethodSignature} sig Method signature metadata object\n * @return {!MethodSignature} The updated signature metadata object\n * @private\n */\nfunction parseArgs(argList, sig) {\n  sig.args = argList.map(function(rawArg) {\n    let arg = parseArg(rawArg);\n    if (!arg.literal) {\n      sig.static = false;\n    }\n    return arg;\n  }, this);\n  return sig;\n}\n\n/**\n * Parses an individual argument, and returns an argument metadata object\n * with the following fields:\n *\n *   {\n *     value: 'prop',        // property/path or literal value\n *     literal: false,       // whether argument is a literal\n *     structured: false,    // whether the property is a path\n *     rootProperty: 'prop', // the root property of the path\n *     wildcard: false       // whether the argument was a wildcard '.*' path\n *   }\n *\n * @param {string} rawArg The string value of the argument\n * @return {!MethodArg} Argument metadata object\n * @private\n */\nfunction parseArg(rawArg) {\n  // clean up whitespace\n  let arg = rawArg.trim()\n    // replace comma entity with comma\n    .replace(/&comma;/g, ',')\n    // repair extra escape sequences; note only commas strictly need\n    // escaping, but we allow any other char to be escaped since its\n    // likely users will do this\n    .replace(/\\\\(.)/g, '\\$1')\n    ;\n  // basic argument descriptor\n  let a = {\n    name: arg,\n    value: '',\n    literal: false\n  };\n  // detect literal value (must be String or Number)\n  let fc = arg[0];\n  if (fc === '-') {\n    fc = arg[1];\n  }\n  if (fc >= '0' && fc <= '9') {\n    fc = '#';\n  }\n  switch(fc) {\n    case \"'\":\n    case '\"':\n      a.value = arg.slice(1, -1);\n      a.literal = true;\n      break;\n    case '#':\n      a.value = Number(arg);\n      a.literal = true;\n      break;\n  }\n  // if not literal, look for structured path\n  if (!a.literal) {\n    a.rootProperty = root(arg);\n    // detect structured path (has dots)\n    a.structured = isPath(arg);\n    if (a.structured) {\n      a.wildcard = (arg.slice(-2) == '.*');\n      if (a.wildcard) {\n        a.name = arg.slice(0, -2);\n      }\n    }\n  }\n  return a;\n}\n\n// data api\n\n/**\n * Sends array splice notifications (`.splices` and `.length`)\n *\n * Note: this implementation only accepts normalized paths\n *\n * @param {!PropertyEffectsType} inst Instance to send notifications to\n * @param {Array} array The array the mutations occurred on\n * @param {string} path The path to the array that was mutated\n * @param {Array} splices Array of splice records\n * @return {void}\n * @private\n */\nfunction notifySplices(inst, array, path, splices) {\n  let splicesPath = path + '.splices';\n  inst.notifyPath(splicesPath, { indexSplices: splices });\n  inst.notifyPath(path + '.length', array.length);\n  // Null here to allow potentially large splice records to be GC'ed.\n  inst.__data[splicesPath] = {indexSplices: null};\n}\n\n/**\n * Creates a splice record and sends an array splice notification for\n * the described mutation\n *\n * Note: this implementation only accepts normalized paths\n *\n * @param {!PropertyEffectsType} inst Instance to send notifications to\n * @param {Array} array The array the mutations occurred on\n * @param {string} path The path to the array that was mutated\n * @param {number} index Index at which the array mutation occurred\n * @param {number} addedCount Number of added items\n * @param {Array} removed Array of removed items\n * @return {void}\n * @private\n */\nfunction notifySplice(inst, array, path, index, addedCount, removed) {\n  notifySplices(inst, array, path, [{\n    index: index,\n    addedCount: addedCount,\n    removed: removed,\n    object: array,\n    type: 'splice'\n  }]);\n}\n\n/**\n * Returns an upper-cased version of the string.\n *\n * @param {string} name String to uppercase\n * @return {string} Uppercased string\n * @private\n */\nfunction upper(name) {\n  return name[0].toUpperCase() + name.substring(1);\n}\n\n/**\n * Element class mixin that provides meta-programming for Polymer's template\n * binding and data observation (collectively, \"property effects\") system.\n *\n * This mixin uses provides the following key static methods for adding\n * property effects to an element class:\n * - `addPropertyEffect`\n * - `createPropertyObserver`\n * - `createMethodObserver`\n * - `createNotifyingProperty`\n * - `createReadOnlyProperty`\n * - `createReflectedProperty`\n * - `createComputedProperty`\n * - `bindTemplate`\n *\n * Each method creates one or more property accessors, along with metadata\n * used by this mixin's implementation of `_propertiesChanged` to perform\n * the property effects.\n *\n * Underscored versions of the above methods also exist on the element\n * prototype for adding property effects on instances at runtime.\n *\n * Note that this mixin overrides several `PropertyAccessors` methods, in\n * many cases to maintain guarantees provided by the Polymer 1.x features;\n * notably it changes property accessors to be synchronous by default\n * whereas the default when using `PropertyAccessors` standalone is to be\n * async by default.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin TemplateStamp\n * @appliesMixin PropertyAccessors\n * @summary Element class mixin that provides meta-programming for Polymer's\n * template binding and data observation system.\n */\nexport const PropertyEffects = dedupingMixin(superClass => {\n\n  /**\n   * @constructor\n   * @extends {superClass}\n   * @implements {Polymer_PropertyAccessors}\n   * @implements {Polymer_TemplateStamp}\n   * @unrestricted\n   * @private\n   */\n  const propertyEffectsBase = TemplateStamp(PropertyAccessors(superClass));\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_PropertyEffects}\n   * @extends {propertyEffectsBase}\n   * @unrestricted\n   */\n  class PropertyEffects extends propertyEffectsBase {\n\n    constructor() {\n      super();\n      /** @type {boolean} */\n      // Used to identify users of this mixin, ala instanceof\n      this.__isPropertyEffectsClient = true;\n      /** @type {number} */\n      // NOTE: used to track re-entrant calls to `_flushProperties`\n      // path changes dirty check against `__dataTemp` only during one \"turn\"\n      // and are cleared when `__dataCounter` returns to 0.\n      this.__dataCounter = 0;\n      /** @type {boolean} */\n      this.__dataClientsReady;\n      /** @type {Array} */\n      this.__dataPendingClients;\n      /** @type {Object} */\n      this.__dataToNotify;\n      /** @type {Object} */\n      this.__dataLinkedPaths;\n      /** @type {boolean} */\n      this.__dataHasPaths;\n      /** @type {Object} */\n      this.__dataCompoundStorage;\n      /** @type {Polymer_PropertyEffects} */\n      this.__dataHost;\n      /** @type {!Object} */\n      this.__dataTemp;\n      /** @type {boolean} */\n      this.__dataClientsInitialized;\n      /** @type {!Object} */\n      this.__data;\n      /** @type {!Object} */\n      this.__dataPending;\n      /** @type {!Object} */\n      this.__dataOld;\n      /** @type {Object} */\n      this.__computeEffects;\n      /** @type {Object} */\n      this.__reflectEffects;\n      /** @type {Object} */\n      this.__notifyEffects;\n      /** @type {Object} */\n      this.__propagateEffects;\n      /** @type {Object} */\n      this.__observeEffects;\n      /** @type {Object} */\n      this.__readOnly;\n      /** @type {!TemplateInfo} */\n      this.__templateInfo;\n    }\n\n    get PROPERTY_EFFECT_TYPES() {\n      return TYPES;\n    }\n\n    /**\n     * @return {void}\n     */\n    _initializeProperties() {\n      super._initializeProperties();\n      hostStack.registerHost(this);\n      this.__dataClientsReady = false;\n      this.__dataPendingClients = null;\n      this.__dataToNotify = null;\n      this.__dataLinkedPaths = null;\n      this.__dataHasPaths = false;\n      // May be set on instance prior to upgrade\n      this.__dataCompoundStorage = this.__dataCompoundStorage || null;\n      this.__dataHost = this.__dataHost || null;\n      this.__dataTemp = {};\n      this.__dataClientsInitialized = false;\n    }\n\n    /**\n     * Overrides `PropertyAccessors` implementation to provide a\n     * more efficient implementation of initializing properties from\n     * the prototype on the instance.\n     *\n     * @override\n     * @param {Object} props Properties to initialize on the prototype\n     * @return {void}\n     */\n    _initializeProtoProperties(props) {\n      this.__data = Object.create(props);\n      this.__dataPending = Object.create(props);\n      this.__dataOld = {};\n    }\n\n    /**\n     * Overrides `PropertyAccessors` implementation to avoid setting\n     * `_setProperty`'s `shouldNotify: true`.\n     *\n     * @override\n     * @param {Object} props Properties to initialize on the instance\n     * @return {void}\n     */\n    _initializeInstanceProperties(props) {\n      let readOnly = this[TYPES.READ_ONLY];\n      for (let prop in props) {\n        if (!readOnly || !readOnly[prop]) {\n          this.__dataPending = this.__dataPending || {};\n          this.__dataOld = this.__dataOld || {};\n          this.__data[prop] = this.__dataPending[prop] = props[prop];\n        }\n      }\n    }\n\n    // Prototype setup ----------------------------------------\n\n    /**\n     * Equivalent to static `addPropertyEffect` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Property that should trigger the effect\n     * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n     * @param {Object=} effect Effect metadata object\n     * @return {void}\n     * @protected\n     */\n    _addPropertyEffect(property, type, effect) {\n      this._createPropertyAccessor(property, type == TYPES.READ_ONLY);\n      // effects are accumulated into arrays per property based on type\n      let effects = ensureOwnEffectMap(this, type)[property];\n      if (!effects) {\n        effects = this[type][property] = [];\n      }\n      effects.push(effect);\n    }\n\n    /**\n     * Removes the given property effect.\n     *\n     * @param {string} property Property the effect was associated with\n     * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n     * @param {Object=} effect Effect metadata object to remove\n     * @return {void}\n     */\n    _removePropertyEffect(property, type, effect) {\n      let effects = ensureOwnEffectMap(this, type)[property];\n      let idx = effects.indexOf(effect);\n      if (idx >= 0) {\n        effects.splice(idx, 1);\n      }\n    }\n\n    /**\n     * Returns whether the current prototype/instance has a property effect\n     * of a certain type.\n     *\n     * @param {string} property Property name\n     * @param {string=} type Effect type, from this.PROPERTY_EFFECT_TYPES\n     * @return {boolean} True if the prototype/instance has an effect of this type\n     * @protected\n     */\n    _hasPropertyEffect(property, type) {\n      let effects = this[type];\n      return Boolean(effects && effects[property]);\n    }\n\n    /**\n     * Returns whether the current prototype/instance has a \"read only\"\n     * accessor for the given property.\n     *\n     * @param {string} property Property name\n     * @return {boolean} True if the prototype/instance has an effect of this type\n     * @protected\n     */\n    _hasReadOnlyEffect(property) {\n      return this._hasPropertyEffect(property, TYPES.READ_ONLY);\n    }\n\n    /**\n     * Returns whether the current prototype/instance has a \"notify\"\n     * property effect for the given property.\n     *\n     * @param {string} property Property name\n     * @return {boolean} True if the prototype/instance has an effect of this type\n     * @protected\n     */\n    _hasNotifyEffect(property) {\n      return this._hasPropertyEffect(property, TYPES.NOTIFY);\n    }\n\n    /**\n     * Returns whether the current prototype/instance has a \"reflect to attribute\"\n     * property effect for the given property.\n     *\n     * @param {string} property Property name\n     * @return {boolean} True if the prototype/instance has an effect of this type\n     * @protected\n     */\n    _hasReflectEffect(property) {\n      return this._hasPropertyEffect(property, TYPES.REFLECT);\n    }\n\n    /**\n     * Returns whether the current prototype/instance has a \"computed\"\n     * property effect for the given property.\n     *\n     * @param {string} property Property name\n     * @return {boolean} True if the prototype/instance has an effect of this type\n     * @protected\n     */\n    _hasComputedEffect(property) {\n      return this._hasPropertyEffect(property, TYPES.COMPUTE);\n    }\n\n    // Runtime ----------------------------------------\n\n    /**\n     * Sets a pending property or path.  If the root property of the path in\n     * question had no accessor, the path is set, otherwise it is enqueued\n     * via `_setPendingProperty`.\n     *\n     * This function isolates relatively expensive functionality necessary\n     * for the public API (`set`, `setProperties`, `notifyPath`, and property\n     * change listeners via {{...}} bindings), such that it is only done\n     * when paths enter the system, and not at every propagation step.  It\n     * also sets a `__dataHasPaths` flag on the instance which is used to\n     * fast-path slower path-matching code in the property effects host paths.\n     *\n     * `path` can be a path string or array of path parts as accepted by the\n     * public API.\n     *\n     * @param {string | !Array<number|string>} path Path to set\n     * @param {*} value Value to set\n     * @param {boolean=} shouldNotify Set to true if this change should\n     *  cause a property notification event dispatch\n     * @param {boolean=} isPathNotification If the path being set is a path\n     *   notification of an already changed value, as opposed to a request\n     *   to set and notify the change.  In the latter `false` case, a dirty\n     *   check is performed and then the value is set to the path before\n     *   enqueuing the pending property change.\n     * @return {boolean} Returns true if the property/path was enqueued in\n     *   the pending changes bag.\n     * @protected\n     */\n    _setPendingPropertyOrPath(path, value, shouldNotify, isPathNotification) {\n      if (isPathNotification ||\n          root(Array.isArray(path) ? path[0] : path) !== path) {\n        // Dirty check changes being set to a path against the actual object,\n        // since this is the entry point for paths into the system; from here\n        // the only dirty checks are against the `__dataTemp` cache to prevent\n        // duplicate work in the same turn only. Note, if this was a notification\n        // of a change already set to a path (isPathNotification: true),\n        // we always let the change through and skip the `set` since it was\n        // already dirty checked at the point of entry and the underlying\n        // object has already been updated\n        if (!isPathNotification) {\n          let old = get(this, path);\n          path = /** @type {string} */ (set(this, path, value));\n          // Use property-accessor's simpler dirty check\n          if (!path || !super._shouldPropertyChange(path, value, old)) {\n            return false;\n          }\n        }\n        this.__dataHasPaths = true;\n        if (this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify)) {\n          computeLinkedPaths(this, path, value);\n          return true;\n        }\n      } else {\n        if (this.__dataHasAccessor && this.__dataHasAccessor[path]) {\n          return this._setPendingProperty(/**@type{string}*/(path), value, shouldNotify);\n        } else {\n          this[path] = value;\n        }\n      }\n      return false;\n    }\n\n    /**\n     * Applies a value to a non-Polymer element/node's property.\n     *\n     * The implementation makes a best-effort at binding interop:\n     * Some native element properties have side-effects when\n     * re-setting the same value (e.g. setting `<input>.value` resets the\n     * cursor position), so we do a dirty-check before setting the value.\n     * However, for better interop with non-Polymer custom elements that\n     * accept objects, we explicitly re-set object changes coming from the\n     * Polymer world (which may include deep object changes without the\n     * top reference changing), erring on the side of providing more\n     * information.\n     *\n     * Users may override this method to provide alternate approaches.\n     *\n     * @param {!Node} node The node to set a property on\n     * @param {string} prop The property to set\n     * @param {*} value The value to set\n     * @return {void}\n     * @protected\n     */\n    _setUnmanagedPropertyToNode(node, prop, value) {\n      // It is a judgment call that resetting primitives is\n      // \"bad\" and resettings objects is also \"good\"; alternatively we could\n      // implement a whitelist of tag & property values that should never\n      // be reset (e.g. <input>.value && <select>.value)\n      if (value !== node[prop] || typeof value == 'object') {\n        node[prop] = value;\n      }\n    }\n\n    /**\n     * Overrides the `PropertiesChanged` implementation to introduce special\n     * dirty check logic depending on the property & value being set:\n     *\n     * 1. Any value set to a path (e.g. 'obj.prop': 42 or 'obj.prop': {...})\n     *    Stored in `__dataTemp`, dirty checked against `__dataTemp`\n     * 2. Object set to simple property (e.g. 'prop': {...})\n     *    Stored in `__dataTemp` and `__data`, dirty checked against\n     *    `__dataTemp` by default implementation of `_shouldPropertyChange`\n     * 3. Primitive value set to simple property (e.g. 'prop': 42)\n     *    Stored in `__data`, dirty checked against `__data`\n     *\n     * The dirty-check is important to prevent cycles due to two-way\n     * notification, but paths and objects are only dirty checked against any\n     * previous value set during this turn via a \"temporary cache\" that is\n     * cleared when the last `_propertiesChanged` exits. This is so:\n     * a. any cached array paths (e.g. 'array.3.prop') may be invalidated\n     *    due to array mutations like shift/unshift/splice; this is fine\n     *    since path changes are dirty-checked at user entry points like `set`\n     * b. dirty-checking for objects only lasts one turn to allow the user\n     *    to mutate the object in-place and re-set it with the same identity\n     *    and have all sub-properties re-propagated in a subsequent turn.\n     *\n     * The temp cache is not necessarily sufficient to prevent invalid array\n     * paths, since a splice can happen during the same turn (with pathological\n     * user code); we could introduce a \"fixup\" for temporarily cached array\n     * paths if needed: https://github.com/Polymer/polymer/issues/4227\n     *\n     * @override\n     * @param {string} property Name of the property\n     * @param {*} value Value to set\n     * @param {boolean=} shouldNotify True if property should fire notification\n     *   event (applies only for `notify: true` properties)\n     * @return {boolean} Returns true if the property changed\n     */\n    _setPendingProperty(property, value, shouldNotify) {\n      let propIsPath = this.__dataHasPaths && isPath(property);\n      let prevProps = propIsPath ? this.__dataTemp : this.__data;\n      if (this._shouldPropertyChange(property, value, prevProps[property])) {\n        if (!this.__dataPending) {\n          this.__dataPending = {};\n          this.__dataOld = {};\n        }\n        // Ensure old is captured from the last turn\n        if (!(property in this.__dataOld)) {\n          this.__dataOld[property] = this.__data[property];\n        }\n        // Paths are stored in temporary cache (cleared at end of turn),\n        // which is used for dirty-checking, all others stored in __data\n        if (propIsPath) {\n          this.__dataTemp[property] = value;\n        } else {\n          this.__data[property] = value;\n        }\n        // All changes go into pending property bag, passed to _propertiesChanged\n        this.__dataPending[property] = value;\n        // Track properties that should notify separately\n        if (propIsPath || (this[TYPES.NOTIFY] && this[TYPES.NOTIFY][property])) {\n          this.__dataToNotify = this.__dataToNotify || {};\n          this.__dataToNotify[property] = shouldNotify;\n        }\n        return true;\n      }\n      return false;\n    }\n\n    /**\n     * Overrides base implementation to ensure all accessors set `shouldNotify`\n     * to true, for per-property notification tracking.\n     *\n     * @override\n     * @param {string} property Name of the property\n     * @param {*} value Value to set\n     * @return {void}\n     */\n    _setProperty(property, value) {\n      if (this._setPendingProperty(property, value, true)) {\n        this._invalidateProperties();\n      }\n    }\n\n    /**\n     * Overrides `PropertyAccessor`'s default async queuing of\n     * `_propertiesChanged`: if `__dataReady` is false (has not yet been\n     * manually flushed), the function no-ops; otherwise flushes\n     * `_propertiesChanged` synchronously.\n     *\n     * @override\n     * @return {void}\n     */\n    _invalidateProperties() {\n      if (this.__dataReady) {\n        this._flushProperties();\n      }\n    }\n\n    /**\n     * Enqueues the given client on a list of pending clients, whose\n     * pending property changes can later be flushed via a call to\n     * `_flushClients`.\n     *\n     * @param {Object} client PropertyEffects client to enqueue\n     * @return {void}\n     * @protected\n     */\n    _enqueueClient(client) {\n      this.__dataPendingClients = this.__dataPendingClients || [];\n      if (client !== this) {\n        this.__dataPendingClients.push(client);\n      }\n    }\n\n    /**\n     * Overrides superclass implementation.\n     *\n     * @return {void}\n     * @protected\n     */\n    _flushProperties() {\n      this.__dataCounter++;\n      super._flushProperties();\n      this.__dataCounter--;\n    }\n\n    /**\n     * Flushes any clients previously enqueued via `_enqueueClient`, causing\n     * their `_flushProperties` method to run.\n     *\n     * @return {void}\n     * @protected\n     */\n    _flushClients() {\n      if (!this.__dataClientsReady) {\n        this.__dataClientsReady = true;\n        this._readyClients();\n        // Override point where accessors are turned on; importantly,\n        // this is after clients have fully readied, providing a guarantee\n        // that any property effects occur only after all clients are ready.\n        this.__dataReady = true;\n      } else {\n        this.__enableOrFlushClients();\n      }\n    }\n\n    // NOTE: We ensure clients either enable or flush as appropriate. This\n    // handles two corner cases:\n    // (1) clients flush properly when connected/enabled before the host\n    // enables; e.g.\n    //   (a) Templatize stamps with no properties and does not flush and\n    //   (b) the instance is inserted into dom and\n    //   (c) then the instance flushes.\n    // (2) clients enable properly when not connected/enabled when the host\n    // flushes; e.g.\n    //   (a) a template is runtime stamped and not yet connected/enabled\n    //   (b) a host sets a property, causing stamped dom to flush\n    //   (c) the stamped dom enables.\n    __enableOrFlushClients() {\n      let clients = this.__dataPendingClients;\n      if (clients) {\n        this.__dataPendingClients = null;\n        for (let i=0; i < clients.length; i++) {\n          let client = clients[i];\n          if (!client.__dataEnabled) {\n            client._enableProperties();\n          } else if (client.__dataPending) {\n            client._flushProperties();\n          }\n        }\n      }\n    }\n\n    /**\n     * Perform any initial setup on client dom. Called before the first\n     * `_flushProperties` call on client dom and before any element\n     * observers are called.\n     *\n     * @return {void}\n     * @protected\n     */\n    _readyClients() {\n      this.__enableOrFlushClients();\n    }\n\n    /**\n     * Sets a bag of property changes to this instance, and\n     * synchronously processes all effects of the properties as a batch.\n     *\n     * Property names must be simple properties, not paths.  Batched\n     * path propagation is not supported.\n     *\n     * @param {Object} props Bag of one or more key-value pairs whose key is\n     *   a property and value is the new value to set for that property.\n     * @param {boolean=} setReadOnly When true, any private values set in\n     *   `props` will be set. By default, `setProperties` will not set\n     *   `readOnly: true` root properties.\n     * @return {void}\n     * @public\n     */\n    setProperties(props, setReadOnly) {\n      for (let path in props) {\n        if (setReadOnly || !this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][path]) {\n          //TODO(kschaaf): explicitly disallow paths in setProperty?\n          // wildcard observers currently only pass the first changed path\n          // in the `info` object, and you could do some odd things batching\n          // paths, e.g. {'foo.bar': {...}, 'foo': null}\n          this._setPendingPropertyOrPath(path, props[path], true);\n        }\n      }\n      this._invalidateProperties();\n    }\n\n    /**\n     * Overrides `PropertyAccessors` so that property accessor\n     * side effects are not enabled until after client dom is fully ready.\n     * Also calls `_flushClients` callback to ensure client dom is enabled\n     * that was not enabled as a result of flushing properties.\n     *\n     * @override\n     * @return {void}\n     */\n    ready() {\n      // It is important that `super.ready()` is not called here as it\n      // immediately turns on accessors. Instead, we wait until `readyClients`\n      // to enable accessors to provide a guarantee that clients are ready\n      // before processing any accessors side effects.\n      this._flushProperties();\n      // If no data was pending, `_flushProperties` will not `flushClients`\n      // so ensure this is done.\n      if (!this.__dataClientsReady) {\n        this._flushClients();\n      }\n      // Before ready, client notifications do not trigger _flushProperties.\n      // Therefore a flush is necessary here if data has been set.\n      if (this.__dataPending) {\n        this._flushProperties();\n      }\n    }\n\n    /**\n     * Implements `PropertyAccessors`'s properties changed callback.\n     *\n     * Runs each class of effects for the batch of changed properties in\n     * a specific order (compute, propagate, reflect, observe, notify).\n     *\n     * @param {!Object} currentProps Bag of all current accessor values\n     * @param {?Object} changedProps Bag of properties changed since the last\n     *   call to `_propertiesChanged`\n     * @param {?Object} oldProps Bag of previous values for each property\n     *   in `changedProps`\n     * @return {void}\n     */\n    _propertiesChanged(currentProps, changedProps, oldProps) {\n      // ----------------------------\n      // let c = Object.getOwnPropertyNames(changedProps || {});\n      // window.debug && console.group(this.localName + '#' + this.id + ': ' + c);\n      // if (window.debug) { debugger; }\n      // ----------------------------\n      let hasPaths = this.__dataHasPaths;\n      this.__dataHasPaths = false;\n      // Compute properties\n      runComputedEffects(this, changedProps, oldProps, hasPaths);\n      // Clear notify properties prior to possible reentry (propagate, observe),\n      // but after computing effects have a chance to add to them\n      let notifyProps = this.__dataToNotify;\n      this.__dataToNotify = null;\n      // Propagate properties to clients\n      this._propagatePropertyChanges(changedProps, oldProps, hasPaths);\n      // Flush clients\n      this._flushClients();\n      // Reflect properties\n      runEffects(this, this[TYPES.REFLECT], changedProps, oldProps, hasPaths);\n      // Observe properties\n      runEffects(this, this[TYPES.OBSERVE], changedProps, oldProps, hasPaths);\n      // Notify properties to host\n      if (notifyProps) {\n        runNotifyEffects(this, notifyProps, changedProps, oldProps, hasPaths);\n      }\n      // Clear temporary cache at end of turn\n      if (this.__dataCounter == 1) {\n        this.__dataTemp = {};\n      }\n      // ----------------------------\n      // window.debug && console.groupEnd(this.localName + '#' + this.id + ': ' + c);\n      // ----------------------------\n    }\n\n    /**\n     * Called to propagate any property changes to stamped template nodes\n     * managed by this element.\n     *\n     * @param {Object} changedProps Bag of changed properties\n     * @param {Object} oldProps Bag of previous values for changed properties\n     * @param {boolean} hasPaths True with `props` contains one or more paths\n     * @return {void}\n     * @protected\n     */\n    _propagatePropertyChanges(changedProps, oldProps, hasPaths) {\n      if (this[TYPES.PROPAGATE]) {\n        runEffects(this, this[TYPES.PROPAGATE], changedProps, oldProps, hasPaths);\n      }\n      let templateInfo = this.__templateInfo;\n      while (templateInfo) {\n        runEffects(this, templateInfo.propertyEffects, changedProps, oldProps,\n          hasPaths, templateInfo.nodeList);\n        templateInfo = templateInfo.nextTemplateInfo;\n      }\n    }\n\n    /**\n     * Aliases one data path as another, such that path notifications from one\n     * are routed to the other.\n     *\n     * @param {string | !Array<string|number>} to Target path to link.\n     * @param {string | !Array<string|number>} from Source path to link.\n     * @return {void}\n     * @public\n     */\n    linkPaths(to, from) {\n      to = normalize(to);\n      from = normalize(from);\n      this.__dataLinkedPaths = this.__dataLinkedPaths || {};\n      this.__dataLinkedPaths[to] = from;\n    }\n\n    /**\n     * Removes a data path alias previously established with `_linkPaths`.\n     *\n     * Note, the path to unlink should be the target (`to`) used when\n     * linking the paths.\n     *\n     * @param {string | !Array<string|number>} path Target path to unlink.\n     * @return {void}\n     * @public\n     */\n    unlinkPaths(path) {\n      path = normalize(path);\n      if (this.__dataLinkedPaths) {\n        delete this.__dataLinkedPaths[path];\n      }\n    }\n\n    /**\n     * Notify that an array has changed.\n     *\n     * Example:\n     *\n     *     this.items = [ {name: 'Jim'}, {name: 'Todd'}, {name: 'Bill'} ];\n     *     ...\n     *     this.items.splice(1, 1, {name: 'Sam'});\n     *     this.items.push({name: 'Bob'});\n     *     this.notifySplices('items', [\n     *       { index: 1, removed: [{name: 'Todd'}], addedCount: 1, object: this.items, type: 'splice' },\n     *       { index: 3, removed: [], addedCount: 1, object: this.items, type: 'splice'}\n     *     ]);\n     *\n     * @param {string} path Path that should be notified.\n     * @param {Array} splices Array of splice records indicating ordered\n     *   changes that occurred to the array. Each record should have the\n     *   following fields:\n     *    * index: index at which the change occurred\n     *    * removed: array of items that were removed from this index\n     *    * addedCount: number of new items added at this index\n     *    * object: a reference to the array in question\n     *    * type: the string literal 'splice'\n     *\n     *   Note that splice records _must_ be normalized such that they are\n     *   reported in index order (raw results from `Object.observe` are not\n     *   ordered and must be normalized/merged before notifying).\n     * @return {void}\n     * @public\n    */\n    notifySplices(path, splices) {\n      let info = {path: ''};\n      let array = /** @type {Array} */(get(this, path, info));\n      notifySplices(this, array, info.path, splices);\n    }\n\n    /**\n     * Convenience method for reading a value from a path.\n     *\n     * Note, if any part in the path is undefined, this method returns\n     * `undefined` (this method does not throw when dereferencing undefined\n     * paths).\n     *\n     * @param {(string|!Array<(string|number)>)} path Path to the value\n     *   to read.  The path may be specified as a string (e.g. `foo.bar.baz`)\n     *   or an array of path parts (e.g. `['foo.bar', 'baz']`).  Note that\n     *   bracketed expressions are not supported; string-based path parts\n     *   *must* be separated by dots.  Note that when dereferencing array\n     *   indices, the index may be used as a dotted part directly\n     *   (e.g. `users.12.name` or `['users', 12, 'name']`).\n     * @param {Object=} root Root object from which the path is evaluated.\n     * @return {*} Value at the path, or `undefined` if any part of the path\n     *   is undefined.\n     * @public\n     */\n    get(path, root) {\n      return get(root || this, path);\n    }\n\n    /**\n     * Convenience method for setting a value to a path and notifying any\n     * elements bound to the same path.\n     *\n     * Note, if any part in the path except for the last is undefined,\n     * this method does nothing (this method does not throw when\n     * dereferencing undefined paths).\n     *\n     * @param {(string|!Array<(string|number)>)} path Path to the value\n     *   to write.  The path may be specified as a string (e.g. `'foo.bar.baz'`)\n     *   or an array of path parts (e.g. `['foo.bar', 'baz']`).  Note that\n     *   bracketed expressions are not supported; string-based path parts\n     *   *must* be separated by dots.  Note that when dereferencing array\n     *   indices, the index may be used as a dotted part directly\n     *   (e.g. `'users.12.name'` or `['users', 12, 'name']`).\n     * @param {*} value Value to set at the specified path.\n     * @param {Object=} root Root object from which the path is evaluated.\n     *   When specified, no notification will occur.\n     * @return {void}\n     * @public\n    */\n    set(path, value, root) {\n      if (root) {\n        set(root, path, value);\n      } else {\n        if (!this[TYPES.READ_ONLY] || !this[TYPES.READ_ONLY][/** @type {string} */(path)]) {\n          if (this._setPendingPropertyOrPath(path, value, true)) {\n            this._invalidateProperties();\n          }\n        }\n      }\n    }\n\n    /**\n     * Adds items onto the end of the array at the path specified.\n     *\n     * The arguments after `path` and return value match that of\n     * `Array.prototype.push`.\n     *\n     * This method notifies other paths to the same array that a\n     * splice occurred to the array.\n     *\n     * @param {string | !Array<string|number>} path Path to array.\n     * @param {...*} items Items to push onto array\n     * @return {number} New length of the array.\n     * @public\n     */\n    push(path, ...items) {\n      let info = {path: ''};\n      let array = /** @type {Array}*/(get(this, path, info));\n      let len = array.length;\n      let ret = array.push(...items);\n      if (items.length) {\n        notifySplice(this, array, info.path, len, items.length, []);\n      }\n      return ret;\n    }\n\n    /**\n     * Removes an item from the end of array at the path specified.\n     *\n     * The arguments after `path` and return value match that of\n     * `Array.prototype.pop`.\n     *\n     * This method notifies other paths to the same array that a\n     * splice occurred to the array.\n     *\n     * @param {string | !Array<string|number>} path Path to array.\n     * @return {*} Item that was removed.\n     * @public\n     */\n    pop(path) {\n      let info = {path: ''};\n      let array = /** @type {Array} */(get(this, path, info));\n      let hadLength = Boolean(array.length);\n      let ret = array.pop();\n      if (hadLength) {\n        notifySplice(this, array, info.path, array.length, 0, [ret]);\n      }\n      return ret;\n    }\n\n    /**\n     * Starting from the start index specified, removes 0 or more items\n     * from the array and inserts 0 or more new items in their place.\n     *\n     * The arguments after `path` and return value match that of\n     * `Array.prototype.splice`.\n     *\n     * This method notifies other paths to the same array that a\n     * splice occurred to the array.\n     *\n     * @param {string | !Array<string|number>} path Path to array.\n     * @param {number} start Index from which to start removing/inserting.\n     * @param {number=} deleteCount Number of items to remove.\n     * @param {...*} items Items to insert into array.\n     * @return {Array} Array of removed items.\n     * @public\n     */\n    splice(path, start, deleteCount, ...items) {\n      let info = {path : ''};\n      let array = /** @type {Array} */(get(this, path, info));\n      // Normalize fancy native splice handling of crazy start values\n      if (start < 0) {\n        start = array.length - Math.floor(-start);\n      } else if (start) {\n        start = Math.floor(start);\n      }\n      // array.splice does different things based on the number of arguments\n      // you pass in. Therefore, array.splice(0) and array.splice(0, undefined)\n      // do different things. In the former, the whole array is cleared. In the\n      // latter, no items are removed.\n      // This means that we need to detect whether 1. one of the arguments\n      // is actually passed in and then 2. determine how many arguments\n      // we should pass on to the native array.splice\n      //\n      let ret;\n      // Omit any additional arguments if they were not passed in\n      if (arguments.length === 2) {\n        ret = array.splice(start);\n      // Either start was undefined and the others were defined, but in this\n      // case we can safely pass on all arguments\n      //\n      // Note: this includes the case where none of the arguments were passed in,\n      // e.g. this.splice('array'). However, if both start and deleteCount\n      // are undefined, array.splice will not modify the array (as expected)\n      } else {\n        ret = array.splice(start, deleteCount, ...items);\n      }\n      // At the end, check whether any items were passed in (e.g. insertions)\n      // or if the return array contains items (e.g. deletions).\n      // Only notify if items were added or deleted.\n      if (items.length || ret.length) {\n        notifySplice(this, array, info.path, start, items.length, ret);\n      }\n      return ret;\n    }\n\n    /**\n     * Removes an item from the beginning of array at the path specified.\n     *\n     * The arguments after `path` and return value match that of\n     * `Array.prototype.pop`.\n     *\n     * This method notifies other paths to the same array that a\n     * splice occurred to the array.\n     *\n     * @param {string | !Array<string|number>} path Path to array.\n     * @return {*} Item that was removed.\n     * @public\n     */\n    shift(path) {\n      let info = {path: ''};\n      let array = /** @type {Array} */(get(this, path, info));\n      let hadLength = Boolean(array.length);\n      let ret = array.shift();\n      if (hadLength) {\n        notifySplice(this, array, info.path, 0, 0, [ret]);\n      }\n      return ret;\n    }\n\n    /**\n     * Adds items onto the beginning of the array at the path specified.\n     *\n     * The arguments after `path` and return value match that of\n     * `Array.prototype.push`.\n     *\n     * This method notifies other paths to the same array that a\n     * splice occurred to the array.\n     *\n     * @param {string | !Array<string|number>} path Path to array.\n     * @param {...*} items Items to insert info array\n     * @return {number} New length of the array.\n     * @public\n     */\n    unshift(path, ...items) {\n      let info = {path: ''};\n      let array = /** @type {Array} */(get(this, path, info));\n      let ret = array.unshift(...items);\n      if (items.length) {\n        notifySplice(this, array, info.path, 0, items.length, []);\n      }\n      return ret;\n    }\n\n    /**\n     * Notify that a path has changed.\n     *\n     * Example:\n     *\n     *     this.item.user.name = 'Bob';\n     *     this.notifyPath('item.user.name');\n     *\n     * @param {string} path Path that should be notified.\n     * @param {*=} value Value at the path (optional).\n     * @return {void}\n     * @public\n    */\n    notifyPath(path, value) {\n      /** @type {string} */\n      let propPath;\n      if (arguments.length == 1) {\n        // Get value if not supplied\n        let info = {path: ''};\n        value = get(this, path, info);\n        propPath = info.path;\n      } else if (Array.isArray(path)) {\n        // Normalize path if needed\n        propPath = normalize(path);\n      } else {\n        propPath = /** @type{string} */(path);\n      }\n      if (this._setPendingPropertyOrPath(propPath, value, true, true)) {\n        this._invalidateProperties();\n      }\n    }\n\n    /**\n     * Equivalent to static `createReadOnlyProperty` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Property name\n     * @param {boolean=} protectedSetter Creates a custom protected setter\n     *   when `true`.\n     * @return {void}\n     * @protected\n     */\n    _createReadOnlyProperty(property, protectedSetter) {\n      this._addPropertyEffect(property, TYPES.READ_ONLY);\n      if (protectedSetter) {\n        this['_set' + upper(property)] = /** @this {PropertyEffects} */function(value) {\n          this._setProperty(property, value);\n        };\n      }\n    }\n\n    /**\n     * Equivalent to static `createPropertyObserver` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Property name\n     * @param {string|function(*,*)} method Function or name of observer method to call\n     * @param {boolean=} dynamicFn Whether the method name should be included as\n     *   a dependency to the effect.\n     * @return {void}\n     * @protected\n     */\n    _createPropertyObserver(property, method, dynamicFn) {\n      let info = { property, method, dynamicFn: Boolean(dynamicFn) };\n      this._addPropertyEffect(property, TYPES.OBSERVE, {\n        fn: runObserverEffect, info, trigger: {name: property}\n      });\n      if (dynamicFn) {\n        this._addPropertyEffect(/** @type {string} */(method), TYPES.OBSERVE, {\n          fn: runObserverEffect, info, trigger: {name: method}\n        });\n      }\n    }\n\n    /**\n     * Equivalent to static `createMethodObserver` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} expression Method expression\n     * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n     *   whether method names should be included as a dependency to the effect.\n     * @return {void}\n     * @protected\n     */\n    _createMethodObserver(expression, dynamicFn) {\n      let sig = parseMethod(expression);\n      if (!sig) {\n        throw new Error(\"Malformed observer expression '\" + expression + \"'\");\n      }\n      createMethodEffect(this, sig, TYPES.OBSERVE, runMethodEffect, null, dynamicFn);\n    }\n\n    /**\n     * Equivalent to static `createNotifyingProperty` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Property name\n     * @return {void}\n     * @protected\n     */\n    _createNotifyingProperty(property) {\n      this._addPropertyEffect(property, TYPES.NOTIFY, {\n        fn: runNotifyEffect,\n        info: {\n          eventName: camelToDashCase(property) + '-changed',\n          property: property\n        }\n      });\n    }\n\n    /**\n     * Equivalent to static `createReflectedProperty` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Property name\n     * @return {void}\n     * @protected\n     */\n    _createReflectedProperty(property) {\n      let attr = this.constructor.attributeNameForProperty(property);\n      if (attr[0] === '-') {\n        console.warn('Property ' + property + ' cannot be reflected to attribute ' +\n          attr + ' because \"-\" is not a valid starting attribute name. Use a lowercase first letter for the property instead.');\n      } else {\n        this._addPropertyEffect(property, TYPES.REFLECT, {\n          fn: runReflectEffect,\n          info: {\n            attrName: attr\n          }\n        });\n      }\n    }\n\n    /**\n     * Equivalent to static `createComputedProperty` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * @param {string} property Name of computed property to set\n     * @param {string} expression Method expression\n     * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n     *   whether method names should be included as a dependency to the effect.\n     * @return {void}\n     * @protected\n     */\n    _createComputedProperty(property, expression, dynamicFn) {\n      let sig = parseMethod(expression);\n      if (!sig) {\n        throw new Error(\"Malformed computed expression '\" + expression + \"'\");\n      }\n      createMethodEffect(this, sig, TYPES.COMPUTE, runComputedEffect, property, dynamicFn);\n    }\n\n    /**\n     * Gather the argument values for a method specified in the provided array\n     * of argument metadata.\n     *\n     * The `path` and `value` arguments are used to fill in wildcard descriptor\n     * when the method is being called as a result of a path notification.\n     *\n     * @param {!Array<!MethodArg>} args Array of argument metadata\n     * @param {string} path Property/path name that triggered the method effect\n     * @param {Object} props Bag of current property changes\n     * @return {Array<*>} Array of argument values\n     * @private\n     */\n    _marshalArgs(args, path, props) {\n      const data = this.__data;\n      let values = [];\n      for (let i=0, l=args.length; i<l; i++) {\n        let arg = args[i];\n        let name = arg.name;\n        let v;\n        if (arg.literal) {\n          v = arg.value;\n        } else {\n          if (arg.structured) {\n            v = get(data, name);\n            // when data is not stored e.g. `splices`\n            if (v === undefined) {\n              v = props[name];\n            }\n          } else {\n            v = data[name];\n          }\n        }\n        if (arg.wildcard) {\n          // Only send the actual path changed info if the change that\n          // caused the observer to run matched the wildcard\n          let baseChanged = (name.indexOf(path + '.') === 0);\n          let matches = (path.indexOf(name) === 0 && !baseChanged);\n          values[i] = {\n            path: matches ? path : name,\n            value: matches ? props[path] : v,\n            base: v\n          };\n        } else {\n          values[i] = v;\n        }\n      }\n      return values;\n    }\n\n    // -- static class methods ------------\n\n    /**\n     * Ensures an accessor exists for the specified property, and adds\n     * to a list of \"property effects\" that will run when the accessor for\n     * the specified property is set.  Effects are grouped by \"type\", which\n     * roughly corresponds to a phase in effect processing.  The effect\n     * metadata should be in the following form:\n     *\n     *     {\n     *       fn: effectFunction, // Reference to function to call to perform effect\n     *       info: { ... }       // Effect metadata passed to function\n     *       trigger: {          // Optional triggering metadata; if not provided\n     *         name: string      // the property is treated as a wildcard\n     *         structured: boolean\n     *         wildcard: boolean\n     *       }\n     *     }\n     *\n     * Effects are called from `_propertiesChanged` in the following order by\n     * type:\n     *\n     * 1. COMPUTE\n     * 2. PROPAGATE\n     * 3. REFLECT\n     * 4. OBSERVE\n     * 5. NOTIFY\n     *\n     * Effect functions are called with the following signature:\n     *\n     *     effectFunction(inst, path, props, oldProps, info, hasPaths)\n     *\n     * @param {string} property Property that should trigger the effect\n     * @param {string} type Effect type, from this.PROPERTY_EFFECT_TYPES\n     * @param {Object=} effect Effect metadata object\n     * @return {void}\n     * @protected\n     */\n    static addPropertyEffect(property, type, effect) {\n      this.prototype._addPropertyEffect(property, type, effect);\n    }\n\n    /**\n     * Creates a single-property observer for the given property.\n     *\n     * @param {string} property Property name\n     * @param {string|function(*,*)} method Function or name of observer method to call\n     * @param {boolean=} dynamicFn Whether the method name should be included as\n     *   a dependency to the effect.\n     * @return {void}\n     * @protected\n     */\n    static createPropertyObserver(property, method, dynamicFn) {\n      this.prototype._createPropertyObserver(property, method, dynamicFn);\n    }\n\n    /**\n     * Creates a multi-property \"method observer\" based on the provided\n     * expression, which should be a string in the form of a normal JavaScript\n     * function signature: `'methodName(arg1, [..., argn])'`.  Each argument\n     * should correspond to a property or path in the context of this\n     * prototype (or instance), or may be a literal string or number.\n     *\n     * @param {string} expression Method expression\n     * @param {boolean|Object=} dynamicFn Boolean or object map indicating\n     * @return {void}\n     *   whether method names should be included as a dependency to the effect.\n     * @protected\n     */\n    static createMethodObserver(expression, dynamicFn) {\n      this.prototype._createMethodObserver(expression, dynamicFn);\n    }\n\n    /**\n     * Causes the setter for the given property to dispatch `<property>-changed`\n     * events to notify of changes to the property.\n     *\n     * @param {string} property Property name\n     * @return {void}\n     * @protected\n     */\n    static createNotifyingProperty(property) {\n      this.prototype._createNotifyingProperty(property);\n    }\n\n    /**\n     * Creates a read-only accessor for the given property.\n     *\n     * To set the property, use the protected `_setProperty` API.\n     * To create a custom protected setter (e.g. `_setMyProp()` for\n     * property `myProp`), pass `true` for `protectedSetter`.\n     *\n     * Note, if the property will have other property effects, this method\n     * should be called first, before adding other effects.\n     *\n     * @param {string} property Property name\n     * @param {boolean=} protectedSetter Creates a custom protected setter\n     *   when `true`.\n     * @return {void}\n     * @protected\n     */\n    static createReadOnlyProperty(property, protectedSetter) {\n      this.prototype._createReadOnlyProperty(property, protectedSetter);\n    }\n\n    /**\n     * Causes the setter for the given property to reflect the property value\n     * to a (dash-cased) attribute of the same name.\n     *\n     * @param {string} property Property name\n     * @return {void}\n     * @protected\n     */\n    static createReflectedProperty(property) {\n      this.prototype._createReflectedProperty(property);\n    }\n\n    /**\n     * Creates a computed property whose value is set to the result of the\n     * method described by the given `expression` each time one or more\n     * arguments to the method changes.  The expression should be a string\n     * in the form of a normal JavaScript function signature:\n     * `'methodName(arg1, [..., argn])'`\n     *\n     * @param {string} property Name of computed property to set\n     * @param {string} expression Method expression\n     * @param {boolean|Object=} dynamicFn Boolean or object map indicating whether\n     *   method names should be included as a dependency to the effect.\n     * @return {void}\n     * @protected\n     */\n    static createComputedProperty(property, expression, dynamicFn) {\n      this.prototype._createComputedProperty(property, expression, dynamicFn);\n    }\n\n    /**\n     * Parses the provided template to ensure binding effects are created\n     * for them, and then ensures property accessors are created for any\n     * dependent properties in the template.  Binding effects for bound\n     * templates are stored in a linked list on the instance so that\n     * templates can be efficiently stamped and unstamped.\n     *\n     * @param {!HTMLTemplateElement} template Template containing binding\n     *   bindings\n     * @return {!TemplateInfo} Template metadata object\n     * @protected\n     */\n    static bindTemplate(template) {\n      return this.prototype._bindTemplate(template);\n    }\n\n    // -- binding ----------------------------------------------\n\n    /**\n     * Equivalent to static `bindTemplate` API but can be called on\n     * an instance to add effects at runtime.  See that method for\n     * full API docs.\n     *\n     * This method may be called on the prototype (for prototypical template\n     * binding, to avoid creating accessors every instance) once per prototype,\n     * and will be called with `runtimeBinding: true` by `_stampTemplate` to\n     * create and link an instance of the template metadata associated with a\n     * particular stamping.\n     *\n     * @param {!HTMLTemplateElement} template Template containing binding\n     *   bindings\n     * @param {boolean=} instanceBinding When false (default), performs\n     *   \"prototypical\" binding of the template and overwrites any previously\n     *   bound template for the class. When true (as passed from\n     *   `_stampTemplate`), the template info is instanced and linked into\n     *   the list of bound templates.\n     * @return {!TemplateInfo} Template metadata object; for `runtimeBinding`,\n     *   this is an instance of the prototypical template info\n     * @protected\n     */\n    _bindTemplate(template, instanceBinding) {\n      let templateInfo = this.constructor._parseTemplate(template);\n      let wasPreBound = this.__templateInfo == templateInfo;\n      // Optimization: since this is called twice for proto-bound templates,\n      // don't attempt to recreate accessors if this template was pre-bound\n      if (!wasPreBound) {\n        for (let prop in templateInfo.propertyEffects) {\n          this._createPropertyAccessor(prop);\n        }\n      }\n      if (instanceBinding) {\n        // For instance-time binding, create instance of template metadata\n        // and link into list of templates if necessary\n        templateInfo = /** @type {!TemplateInfo} */(Object.create(templateInfo));\n        templateInfo.wasPreBound = wasPreBound;\n        if (!wasPreBound && this.__templateInfo) {\n          let last = this.__templateInfoLast || this.__templateInfo;\n          this.__templateInfoLast = last.nextTemplateInfo = templateInfo;\n          templateInfo.previousTemplateInfo = last;\n          return templateInfo;\n        }\n      }\n      return this.__templateInfo = templateInfo;\n    }\n\n    /**\n     * Adds a property effect to the given template metadata, which is run\n     * at the \"propagate\" stage of `_propertiesChanged` when the template\n     * has been bound to the element via `_bindTemplate`.\n     *\n     * The `effect` object should match the format in `_addPropertyEffect`.\n     *\n     * @param {Object} templateInfo Template metadata to add effect to\n     * @param {string} prop Property that should trigger the effect\n     * @param {Object=} effect Effect metadata object\n     * @return {void}\n     * @protected\n     */\n    static _addTemplatePropertyEffect(templateInfo, prop, effect) {\n      let hostProps = templateInfo.hostProps = templateInfo.hostProps || {};\n      hostProps[prop] = true;\n      let effects = templateInfo.propertyEffects = templateInfo.propertyEffects || {};\n      let propEffects = effects[prop] = effects[prop] || [];\n      propEffects.push(effect);\n    }\n\n    /**\n     * Stamps the provided template and performs instance-time setup for\n     * Polymer template features, including data bindings, declarative event\n     * listeners, and the `this.$` map of `id`'s to nodes.  A document fragment\n     * is returned containing the stamped DOM, ready for insertion into the\n     * DOM.\n     *\n     * This method may be called more than once; however note that due to\n     * `shadycss` polyfill limitations, only styles from templates prepared\n     * using `ShadyCSS.prepareTemplate` will be correctly polyfilled (scoped\n     * to the shadow root and support CSS custom properties), and note that\n     * `ShadyCSS.prepareTemplate` may only be called once per element. As such,\n     * any styles required by in runtime-stamped templates must be included\n     * in the main element template.\n     *\n     * @param {!HTMLTemplateElement} template Template to stamp\n     * @return {!StampedTemplate} Cloned template content\n     * @override\n     * @protected\n     */\n    _stampTemplate(template) {\n      // Ensures that created dom is `_enqueueClient`'d to this element so\n      // that it can be flushed on next call to `_flushProperties`\n      hostStack.beginHosting(this);\n      let dom = super._stampTemplate(template);\n      hostStack.endHosting(this);\n      let templateInfo = /** @type {!TemplateInfo} */(this._bindTemplate(template, true));\n      // Add template-instance-specific data to instanced templateInfo\n      templateInfo.nodeList = dom.nodeList;\n      // Capture child nodes to allow unstamping of non-prototypical templates\n      if (!templateInfo.wasPreBound) {\n        let nodes = templateInfo.childNodes = [];\n        for (let n=dom.firstChild; n; n=n.nextSibling) {\n          nodes.push(n);\n        }\n      }\n      dom.templateInfo = templateInfo;\n      // Setup compound storage, 2-way listeners, and dataHost for bindings\n      setupBindings(this, templateInfo);\n      // Flush properties into template nodes if already booted\n      if (this.__dataReady) {\n        runEffects(this, templateInfo.propertyEffects, this.__data, null,\n          false, templateInfo.nodeList);\n      }\n      return dom;\n    }\n\n    /**\n     * Removes and unbinds the nodes previously contained in the provided\n     * DocumentFragment returned from `_stampTemplate`.\n     *\n     * @param {!StampedTemplate} dom DocumentFragment previously returned\n     *   from `_stampTemplate` associated with the nodes to be removed\n     * @return {void}\n     * @protected\n     */\n    _removeBoundDom(dom) {\n      // Unlink template info\n      let templateInfo = dom.templateInfo;\n      if (templateInfo.previousTemplateInfo) {\n        templateInfo.previousTemplateInfo.nextTemplateInfo =\n          templateInfo.nextTemplateInfo;\n      }\n      if (templateInfo.nextTemplateInfo) {\n        templateInfo.nextTemplateInfo.previousTemplateInfo =\n          templateInfo.previousTemplateInfo;\n      }\n      if (this.__templateInfoLast == templateInfo) {\n        this.__templateInfoLast = templateInfo.previousTemplateInfo;\n      }\n      templateInfo.previousTemplateInfo = templateInfo.nextTemplateInfo = null;\n      // Remove stamped nodes\n      let nodes = templateInfo.childNodes;\n      for (let i=0; i<nodes.length; i++) {\n        let node = nodes[i];\n        node.parentNode.removeChild(node);\n      }\n    }\n\n    /**\n     * Overrides default `TemplateStamp` implementation to add support for\n     * parsing bindings from `TextNode`'s' `textContent`.  A `bindings`\n     * array is added to `nodeInfo` and populated with binding metadata\n     * with information capturing the binding target, and a `parts` array\n     * with one or more metadata objects capturing the source(s) of the\n     * binding.\n     *\n     * @override\n     * @param {Node} node Node to parse\n     * @param {TemplateInfo} templateInfo Template metadata for current template\n     * @param {NodeInfo} nodeInfo Node metadata for current template node\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     * @protected\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n    static _parseTemplateNode(node, templateInfo, nodeInfo) {\n      let noted = super._parseTemplateNode(node, templateInfo, nodeInfo);\n      if (node.nodeType === Node.TEXT_NODE) {\n        let parts = this._parseBindings(node.textContent, templateInfo);\n        if (parts) {\n          // Initialize the textContent with any literal parts\n          // NOTE: default to a space here so the textNode remains; some browsers\n          // (IE) omit an empty textNode following cloneNode/importNode.\n          node.textContent = literalFromParts(parts) || ' ';\n          addBinding(this, templateInfo, nodeInfo, 'text', 'textContent', parts);\n          noted = true;\n        }\n      }\n      return noted;\n    }\n\n    /**\n     * Overrides default `TemplateStamp` implementation to add support for\n     * parsing bindings from attributes.  A `bindings`\n     * array is added to `nodeInfo` and populated with binding metadata\n     * with information capturing the binding target, and a `parts` array\n     * with one or more metadata objects capturing the source(s) of the\n     * binding.\n     *\n     * @override\n     * @param {Element} node Node to parse\n     * @param {TemplateInfo} templateInfo Template metadata for current template\n     * @param {NodeInfo} nodeInfo Node metadata for current template node\n     * @param {string} name Attribute name\n     * @param {string} value Attribute value\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     * @protected\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n    static _parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value) {\n      let parts = this._parseBindings(value, templateInfo);\n      if (parts) {\n        // Attribute or property\n        let origName = name;\n        let kind = 'property';\n        // The only way we see a capital letter here is if the attr has\n        // a capital letter in it per spec. In this case, to make sure\n        // this binding works, we go ahead and make the binding to the attribute.\n        if (capitalAttributeRegex.test(name)) {\n          kind = 'attribute';\n        } else if (name[name.length-1] == '$') {\n          name = name.slice(0, -1);\n          kind = 'attribute';\n        }\n        // Initialize attribute bindings with any literal parts\n        let literal = literalFromParts(parts);\n        if (literal && kind == 'attribute') {\n          node.setAttribute(name, literal);\n        }\n        // Clear attribute before removing, since IE won't allow removing\n        // `value` attribute if it previously had a value (can't\n        // unconditionally set '' before removing since attributes with `$`\n        // can't be set using setAttribute)\n        if (node.localName === 'input' && origName === 'value') {\n          node.setAttribute(origName, '');\n        }\n        // Remove annotation\n        node.removeAttribute(origName);\n        // Case hackery: attributes are lower-case, but bind targets\n        // (properties) are case sensitive. Gambit is to map dash-case to\n        // camel-case: `foo-bar` becomes `fooBar`.\n        // Attribute bindings are excepted.\n        if (kind === 'property') {\n          name = dashToCamelCase(name);\n        }\n        addBinding(this, templateInfo, nodeInfo, kind, name, parts, literal);\n        return true;\n      } else {\n        return super._parseTemplateNodeAttribute(node, templateInfo, nodeInfo, name, value);\n      }\n    }\n\n    /**\n     * Overrides default `TemplateStamp` implementation to add support for\n     * binding the properties that a nested template depends on to the template\n     * as `_host_<property>`.\n     *\n     * @override\n     * @param {Node} node Node to parse\n     * @param {TemplateInfo} templateInfo Template metadata for current template\n     * @param {NodeInfo} nodeInfo Node metadata for current template node\n     * @return {boolean} `true` if the visited node added node-specific\n     *   metadata to `nodeInfo`\n     * @protected\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n    static _parseTemplateNestedTemplate(node, templateInfo, nodeInfo) {\n      let noted = super._parseTemplateNestedTemplate(node, templateInfo, nodeInfo);\n      // Merge host props into outer template and add bindings\n      let hostProps = nodeInfo.templateInfo.hostProps;\n      let mode = '{';\n      for (let source in hostProps) {\n        let parts = [{ mode, source, dependencies: [source] }];\n        addBinding(this, templateInfo, nodeInfo, 'property', '_host_' + source, parts);\n      }\n      return noted;\n    }\n\n    /**\n     * Called to parse text in a template (either attribute values or\n     * textContent) into binding metadata.\n     *\n     * Any overrides of this method should return an array of binding part\n     * metadata  representing one or more bindings found in the provided text\n     * and any \"literal\" text in between.  Any non-literal parts will be passed\n     * to `_evaluateBinding` when any dependencies change.  The only required\n     * fields of each \"part\" in the returned array are as follows:\n     *\n     * - `dependencies` - Array containing trigger metadata for each property\n     *   that should trigger the binding to update\n     * - `literal` - String containing text if the part represents a literal;\n     *   in this case no `dependencies` are needed\n     *\n     * Additional metadata for use by `_evaluateBinding` may be provided in\n     * each part object as needed.\n     *\n     * The default implementation handles the following types of bindings\n     * (one or more may be intermixed with literal strings):\n     * - Property binding: `[[prop]]`\n     * - Path binding: `[[object.prop]]`\n     * - Negated property or path bindings: `[[!prop]]` or `[[!object.prop]]`\n     * - Two-way property or path bindings (supports negation):\n     *   `{{prop}}`, `{{object.prop}}`, `{{!prop}}` or `{{!object.prop}}`\n     * - Inline computed method (supports negation):\n     *   `[[compute(a, 'literal', b)]]`, `[[!compute(a, 'literal', b)]]`\n     *\n     * The default implementation uses a regular expression for best\n     * performance. However, the regular expression uses a white-list of\n     * allowed characters in a data-binding, which causes problems for\n     * data-bindings that do use characters not in this white-list.\n     *\n     * Instead of updating the white-list with all allowed characters,\n     * there is a StrictBindingParser (see lib/mixins/strict-binding-parser)\n     * that uses a state machine instead. This state machine is able to handle\n     * all characters. However, it is slightly less performant, therefore we\n     * extracted it into a separate optional mixin.\n     *\n     * @param {string} text Text to parse from attribute or textContent\n     * @param {Object} templateInfo Current template metadata\n     * @return {Array<!BindingPart>} Array of binding part metadata\n     * @protected\n     */\n    static _parseBindings(text, templateInfo) {\n      let parts = [];\n      let lastIndex = 0;\n      let m;\n      // Example: \"literal1{{prop}}literal2[[!compute(foo,bar)]]final\"\n      // Regex matches:\n      //        Iteration 1:  Iteration 2:\n      // m[1]: '{{'          '[['\n      // m[2]: ''            '!'\n      // m[3]: 'prop'        'compute(foo,bar)'\n      while ((m = bindingRegex.exec(text)) !== null) {\n        // Add literal part\n        if (m.index > lastIndex) {\n          parts.push({literal: text.slice(lastIndex, m.index)});\n        }\n        // Add binding part\n        let mode = m[1][0];\n        let negate = Boolean(m[2]);\n        let source = m[3].trim();\n        let customEvent = false, notifyEvent = '', colon = -1;\n        if (mode == '{' && (colon = source.indexOf('::')) > 0) {\n          notifyEvent = source.substring(colon + 2);\n          source = source.substring(0, colon);\n          customEvent = true;\n        }\n        let signature = parseMethod(source);\n        let dependencies = [];\n        if (signature) {\n          // Inline computed function\n          let {args, methodName} = signature;\n          for (let i=0; i<args.length; i++) {\n            let arg = args[i];\n            if (!arg.literal) {\n              dependencies.push(arg);\n            }\n          }\n          let dynamicFns = templateInfo.dynamicFns;\n          if (dynamicFns && dynamicFns[methodName] || signature.static) {\n            dependencies.push(methodName);\n            signature.dynamicFn = true;\n          }\n        } else {\n          // Property or path\n          dependencies.push(source);\n        }\n        parts.push({\n          source, mode, negate, customEvent, signature, dependencies,\n          event: notifyEvent\n        });\n        lastIndex = bindingRegex.lastIndex;\n      }\n      // Add a final literal part\n      if (lastIndex && lastIndex < text.length) {\n        let literal = text.substring(lastIndex);\n        if (literal) {\n          parts.push({\n            literal: literal\n          });\n        }\n      }\n      if (parts.length) {\n        return parts;\n      } else {\n        return null;\n      }\n    }\n\n    /**\n     * Called to evaluate a previously parsed binding part based on a set of\n     * one or more changed dependencies.\n     *\n     * @param {this} inst Element that should be used as scope for\n     *   binding dependencies\n     * @param {BindingPart} part Binding part metadata\n     * @param {string} path Property/path that triggered this effect\n     * @param {Object} props Bag of current property changes\n     * @param {Object} oldProps Bag of previous values for changed properties\n     * @param {boolean} hasPaths True with `props` contains one or more paths\n     * @return {*} Value the binding part evaluated to\n     * @protected\n     */\n    static _evaluateBinding(inst, part, path, props, oldProps, hasPaths) {\n      let value;\n      if (part.signature) {\n        value = runMethodEffect(inst, path, props, oldProps, part.signature);\n      } else if (path != part.source) {\n        value = get(inst, part.source);\n      } else {\n        if (hasPaths && isPath(path)) {\n          value = get(inst, path);\n        } else {\n          value = inst.__data[path];\n        }\n      }\n      if (part.negate) {\n        value = !value;\n      }\n      return value;\n    }\n\n  }\n\n  // make a typing for closure :P\n  PropertyEffectsType = PropertyEffects;\n\n  return PropertyEffects;\n});\n\n/**\n * Helper api for enqueuing client dom created by a host element.\n *\n * By default elements are flushed via `_flushProperties` when\n * `connectedCallback` is called. Elements attach their client dom to\n * themselves at `ready` time which results from this first flush.\n * This provides an ordering guarantee that the client dom an element\n * creates is flushed before the element itself (i.e. client `ready`\n * fires before host `ready`).\n *\n * However, if `_flushProperties` is called *before* an element is connected,\n * as for example `Templatize` does, this ordering guarantee cannot be\n * satisfied because no elements are connected. (Note: Bound elements that\n * receive data do become enqueued clients and are properly ordered but\n * unbound elements are not.)\n *\n * To maintain the desired \"client before host\" ordering guarantee for this\n * case we rely on the \"host stack. Client nodes registers themselves with\n * the creating host element when created. This ensures that all client dom\n * is readied in the proper order, maintaining the desired guarantee.\n *\n * @private\n */\nclass HostStack {\n  constructor() {\n    this.stack = [];\n  }\n\n  /**\n   * @param {*} inst Instance to add to hostStack\n   * @return {void}\n   */\n  registerHost(inst) {\n    if (this.stack.length) {\n      let host = this.stack[this.stack.length-1];\n      host._enqueueClient(inst);\n    }\n  }\n\n  /**\n   * @param {*} inst Instance to begin hosting\n   * @return {void}\n   */\n  beginHosting(inst) {\n    this.stack.push(inst);\n  }\n\n  /**\n   * @param {*} inst Instance to end hosting\n   * @return {void}\n   */\n  endHosting(inst) {\n    let stackLen = this.stack.length;\n    if (stackLen && this.stack[stackLen-1] == inst) {\n      this.stack.pop();\n    }\n  }\n}\nconst hostStack = new HostStack();\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*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { PropertiesChanged } from './properties-changed.js';\n\n/**\n * Creates a copy of `props` with each property normalized such that\n * upgraded it is an object with at least a type property { type: Type}.\n *\n * @param {Object} props Properties to normalize\n * @return {Object} Copy of input `props` with normalized properties that\n * are in the form {type: Type}\n * @private\n */\nfunction normalizeProperties(props) {\n  const output = {};\n  for (let p in props) {\n    const o = props[p];\n    output[p] = (typeof o === 'function') ? {type: o} : o;\n  }\n  return output;\n}\n\n/**\n * Mixin that provides a minimal starting point to using the PropertiesChanged\n * mixin by providing a mechanism to declare properties in a static\n * getter (e.g. static get properties() { return { foo: String } }). Changes\n * are reported via the `_propertiesChanged` method.\n *\n * This mixin provides no specific support for rendering. Users are expected\n * to create a ShadowRoot and put content into it and update it in whatever\n * way makes sense. This can be done in reaction to properties changing by\n * implementing `_propertiesChanged`.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertiesChanged\n * @summary Mixin that provides a minimal starting point for using\n * the PropertiesChanged mixin by providing a declarative `properties` object.\n */\nexport const PropertiesMixin = dedupingMixin(superClass => {\n\n /**\n  * @constructor\n  * @implements {Polymer_PropertiesChanged}\n  * @private\n  */\n const base = PropertiesChanged(superClass);\n\n /**\n  * Returns the super class constructor for the given class, if it is an\n  * instance of the PropertiesMixin.\n  *\n  * @param {!PropertiesMixinConstructor} constructor PropertiesMixin constructor\n  * @return {?PropertiesMixinConstructor} Super class constructor\n  */\n function superPropertiesClass(constructor) {\n   const superCtor = Object.getPrototypeOf(constructor);\n\n   // Note, the `PropertiesMixin` class below only refers to the class\n   // generated by this call to the mixin; the instanceof test only works\n   // because the mixin is deduped and guaranteed only to apply once, hence\n   // all constructors in a proto chain will see the same `PropertiesMixin`\n   return (superCtor.prototype instanceof PropertiesMixin) ?\n     /** @type {!PropertiesMixinConstructor} */ (superCtor) : null;\n }\n\n /**\n  * Returns a memoized version of the `properties` object for the\n  * given class. Properties not in object format are converted to at\n  * least {type}.\n  *\n  * @param {PropertiesMixinConstructor} constructor PropertiesMixin constructor\n  * @return {Object} Memoized properties object\n  */\n function ownProperties(constructor) {\n   if (!constructor.hasOwnProperty(JSCompiler_renameProperty('__ownProperties', constructor))) {\n     let props = null;\n\n     if (constructor.hasOwnProperty(JSCompiler_renameProperty('properties', constructor))) {\n       const properties = constructor.properties;\n\n       if (properties) {\n        props = normalizeProperties(properties);\n       }\n     }\n\n     constructor.__ownProperties = props;\n   }\n   return constructor.__ownProperties;\n }\n\n /**\n  * @polymer\n  * @mixinClass\n  * @extends {base}\n  * @implements {Polymer_PropertiesMixin}\n  * @unrestricted\n  */\n class PropertiesMixin extends base {\n\n   /**\n    * Implements standard custom elements getter to observes the attributes\n    * listed in `properties`.\n    * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n    */\n   static get observedAttributes() {\n     const props = this._properties;\n     return props ? Object.keys(props).map(p => this.attributeNameForProperty(p)) : [];\n   }\n\n   /**\n    * Finalizes an element definition, including ensuring any super classes\n    * are also finalized. This includes ensuring property\n    * accessors exist on the element prototype. This method calls\n    * `_finalizeClass` to finalize each constructor in the prototype chain.\n    * @return {void}\n    */\n   static finalize() {\n     if (!this.hasOwnProperty(JSCompiler_renameProperty('__finalized', this))) {\n       const superCtor = superPropertiesClass(/** @type {!PropertiesMixinConstructor} */(this));\n       if (superCtor) {\n         superCtor.finalize();\n       }\n       this.__finalized = true;\n       this._finalizeClass();\n     }\n   }\n\n   /**\n    * Finalize an element class. This includes ensuring property\n    * accessors exist on the element prototype. This method is called by\n    * `finalize` and finalizes the class constructor.\n    *\n    * @protected\n    */\n   static _finalizeClass() {\n     const props = ownProperties(/** @type {!PropertiesMixinConstructor} */(this));\n     if (props) {\n       this.createProperties(props);\n     }\n   }\n\n   /**\n    * Returns a memoized version of all properties, including those inherited\n    * from super classes. Properties not in object format are converted to\n    * at least {type}.\n    *\n    * @return {Object} Object containing properties for this class\n    * @protected\n    */\n   static get _properties() {\n     if (!this.hasOwnProperty(\n       JSCompiler_renameProperty('__properties', this))) {\n       const superCtor = superPropertiesClass(/** @type {!PropertiesMixinConstructor} */(this));\n       this.__properties = Object.assign({},\n         superCtor && superCtor._properties,\n         ownProperties(/** @type {PropertiesMixinConstructor} */(this)));\n     }\n     return this.__properties;\n   }\n\n   /**\n    * Overrides `PropertiesChanged` method to return type specified in the\n    * static `properties` object for the given property.\n    * @param {string} name Name of property\n    * @return {*} Type to which to deserialize attribute\n    *\n    * @protected\n    */\n   static typeForProperty(name) {\n     const info = this._properties[name];\n     return info && info.type;\n   }\n\n   /**\n    * Overrides `PropertiesChanged` method and adds a call to\n    * `finalize` which lazily configures the element's property accessors.\n    * @override\n    * @return {void}\n    */\n   _initializeProperties() {\n     this.constructor.finalize();\n     super._initializeProperties();\n   }\n\n   /**\n    * Called when the element is added to a document.\n    * Calls `_enableProperties` to turn on property system from\n    * `PropertiesChanged`.\n    * @suppress {missingProperties} Super may or may not implement the callback\n    * @return {void}\n    * @override\n    */\n   connectedCallback() {\n     if (super.connectedCallback) {\n       super.connectedCallback();\n     }\n     this._enableProperties();\n   }\n\n   /**\n    * Called when the element is removed from a document\n    * @suppress {missingProperties} Super may or may not implement the callback\n    * @return {void}\n    * @override\n    */\n   disconnectedCallback() {\n     if (super.disconnectedCallback) {\n       super.disconnectedCallback();\n     }\n   }\n\n }\n\n return PropertiesMixin;\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*/\nimport '../utils/boot.js';\n\nimport { rootPath, strictTemplatePolicy, allowTemplateFromDomModule } from '../utils/settings.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { stylesFromTemplate, stylesFromModuleImports } from '../utils/style-gather.js';\nimport { pathFromUrl, resolveCss, resolveUrl } from '../utils/resolve-url.js';\nimport { DomModule } from '../elements/dom-module.js';\nimport { PropertyEffects } from './property-effects.js';\nimport { PropertiesMixin } from './properties-mixin.js';\n\n/**\n * Current Polymer version in Semver notation.\n * @type {string} Semver notation of the current version of Polymer.\n */\nexport const version = '3.0.5';\n\n/**\n * Element class mixin that provides the core API for Polymer's meta-programming\n * features including template stamping, data-binding, attribute deserialization,\n * and property change observation.\n *\n * Subclassers may provide the following static getters to return metadata\n * used to configure Polymer's features for the class:\n *\n * - `static get is()`: When the template is provided via a `dom-module`,\n *   users should return the `dom-module` id from a static `is` getter.  If\n *   no template is needed or the template is provided directly via the\n *   `template` getter, there is no need to define `is` for the element.\n *\n * - `static get template()`: Users may provide the template directly (as\n *   opposed to via `dom-module`) by implementing a static `template` getter.\n *   The getter must return an `HTMLTemplateElement`.\n *\n * - `static get properties()`: Should return an object describing\n *   property-related metadata used by Polymer features (key: property name\n *   value: object containing property metadata). Valid keys in per-property\n *   metadata include:\n *   - `type` (String|Number|Object|Array|...): Used by\n *     `attributeChangedCallback` to determine how string-based attributes\n *     are deserialized to JavaScript property values.\n *   - `notify` (boolean): Causes a change in the property to fire a\n *     non-bubbling event called `<property>-changed`. Elements that have\n *     enabled two-way binding to the property use this event to observe changes.\n *   - `readOnly` (boolean): Creates a getter for the property, but no setter.\n *     To set a read-only property, use the private setter method\n *     `_setProperty(property, value)`.\n *   - `observer` (string): Observer method name that will be called when\n *     the property changes. The arguments of the method are\n *     `(value, previousValue)`.\n *   - `computed` (string): String describing method and dependent properties\n *     for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).\n *     Computed properties are read-only by default and can only be changed\n *     via the return value of the computing method.\n *\n * - `static get observers()`: Array of strings describing multi-property\n *   observer methods and their dependent properties (e.g.\n *   `'observeABC(a, b, c)'`).\n *\n * The base class provides default implementations for the following standard\n * custom element lifecycle callbacks; users may override these, but should\n * call the super method to ensure\n * - `constructor`: Run when the element is created or upgraded\n * - `connectedCallback`: Run each time the element is connected to the\n *   document\n * - `disconnectedCallback`: Run each time the element is disconnected from\n *   the document\n * - `attributeChangedCallback`: Run each time an attribute in\n *   `observedAttributes` is set or removed (note: this element's default\n *   `observedAttributes` implementation will automatically return an array\n *   of dash-cased attributes based on `properties`)\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertyEffects\n * @appliesMixin PropertiesMixin\n * @property rootPath {string} Set to the value of `rootPath`,\n *   which defaults to the main document path\n * @property importPath {string} Set to the value of the class's static\n *   `importPath` property, which defaults to the path of this element's\n *   `dom-module` (when `is` is used), but can be overridden for other\n *   import strategies.\n * @summary Element class mixin that provides the core API for Polymer's\n * meta-programming features.\n */\nexport const ElementMixin = dedupingMixin(base => {\n\n  /**\n   * @constructor\n   * @extends {base}\n   * @implements {Polymer_PropertyEffects}\n   * @implements {Polymer_PropertiesMixin}\n   * @private\n   */\n  const polymerElementBase = PropertiesMixin(PropertyEffects(base));\n\n  /**\n   * Returns a list of properties with default values.\n   * This list is created as an optimization since it is a subset of\n   * the list returned from `_properties`.\n   * This list is used in `_initializeProperties` to set property defaults.\n   *\n   * @param {PolymerElementConstructor} constructor Element class\n   * @return {PolymerElementProperties} Flattened properties for this class\n   *   that have default values\n   * @private\n   */\n  function propertyDefaults(constructor) {\n    if (!constructor.hasOwnProperty(\n      JSCompiler_renameProperty('__propertyDefaults', constructor))) {\n      constructor.__propertyDefaults = null;\n      let props = constructor._properties;\n      for (let p in props) {\n        let info = props[p];\n        if ('value' in info) {\n          constructor.__propertyDefaults = constructor.__propertyDefaults || {};\n          constructor.__propertyDefaults[p] = info;\n        }\n      }\n    }\n    return constructor.__propertyDefaults;\n  }\n\n  /**\n   * Returns a memoized version of the `observers` array.\n   * @param {PolymerElementConstructor} constructor Element class\n   * @return {Array} Array containing own observers for the given class\n   * @protected\n   */\n  function ownObservers(constructor) {\n    if (!constructor.hasOwnProperty(\n      JSCompiler_renameProperty('__ownObservers', constructor))) {\n        constructor.__ownObservers =\n        constructor.hasOwnProperty(JSCompiler_renameProperty('observers', constructor)) ?\n        /** @type {PolymerElementConstructor} */ (constructor).observers : null;\n    }\n    return constructor.__ownObservers;\n  }\n\n  /**\n   * Creates effects for a property.\n   *\n   * Note, once a property has been set to\n   * `readOnly`, `computed`, `reflectToAttribute`, or `notify`\n   * these values may not be changed. For example, a subclass cannot\n   * alter these settings. However, additional `observers` may be added\n   * by subclasses.\n   *\n   * The info object should contain property metadata as follows:\n   *\n   * * `type`: {function} type to which an attribute matching the property\n   * is deserialized. Note the property is camel-cased from a dash-cased\n   * attribute. For example, 'foo-bar' attribute is deserialized to a\n   * property named 'fooBar'.\n   *\n   * * `readOnly`: {boolean} creates a readOnly property and\n   * makes a private setter for the private of the form '_setFoo' for a\n   * property 'foo',\n   *\n   * * `computed`: {string} creates a computed property. A computed property\n   * is also automatically set to `readOnly: true`. The value is calculated\n   * by running a method and arguments parsed from the given string. For\n   * example 'compute(foo)' will compute a given property when the\n   * 'foo' property changes by executing the 'compute' method. This method\n   * must return the computed value.\n   *\n   * * `reflectToAttribute`: {boolean} If true, the property value is reflected\n   * to an attribute of the same name. Note, the attribute is dash-cased\n   * so a property named 'fooBar' is reflected as 'foo-bar'.\n   *\n   * * `notify`: {boolean} sends a non-bubbling notification event when\n   * the property changes. For example, a property named 'foo' sends an\n   * event named 'foo-changed' with `event.detail` set to the value of\n   * the property.\n   *\n   * * observer: {string} name of a method that runs when the property\n   * changes. The arguments of the method are (value, previousValue).\n   *\n   * Note: Users may want control over modifying property\n   * effects via subclassing. For example, a user might want to make a\n   * reflectToAttribute property not do so in a subclass. We've chosen to\n   * disable this because it leads to additional complication.\n   * For example, a readOnly effect generates a special setter. If a subclass\n   * disables the effect, the setter would fail unexpectedly.\n   * Based on feedback, we may want to try to make effects more malleable\n   * and/or provide an advanced api for manipulating them.\n   * Also consider adding warnings when an effect cannot be changed.\n   *\n   * @param {!PolymerElement} proto Element class prototype to add accessors\n   *   and effects to\n   * @param {string} name Name of the property.\n   * @param {Object} info Info object from which to create property effects.\n   * Supported keys:\n   * @param {Object} allProps Flattened map of all properties defined in this\n   *   element (including inherited properties)\n   * @return {void}\n   * @private\n   */\n  function createPropertyFromConfig(proto, name, info, allProps) {\n    // computed forces readOnly...\n    if (info.computed) {\n      info.readOnly = true;\n    }\n    // Note, since all computed properties are readOnly, this prevents\n    // adding additional computed property effects (which leads to a confusing\n    // setup where multiple triggers for setting a property)\n    // While we do have `hasComputedEffect` this is set on the property's\n    // dependencies rather than itself.\n    if (info.computed && !proto._hasReadOnlyEffect(name)) {\n      proto._createComputedProperty(name, info.computed, allProps);\n    }\n    if (info.readOnly && !proto._hasReadOnlyEffect(name)) {\n      proto._createReadOnlyProperty(name, !info.computed);\n    }\n    if (info.reflectToAttribute && !proto._hasReflectEffect(name)) {\n      proto._createReflectedProperty(name);\n    }\n    if (info.notify && !proto._hasNotifyEffect(name)) {\n      proto._createNotifyingProperty(name);\n    }\n    // always add observer\n    if (info.observer) {\n      proto._createPropertyObserver(name, info.observer, allProps[info.observer]);\n    }\n    // always create the mapping from attribute back to property for deserialization.\n    proto._addPropertyToAttributeMap(name);\n  }\n\n  /**\n   * Process all style elements in the element template. Styles with the\n   * `include` attribute are processed such that any styles in\n   * the associated \"style modules\" are included in the element template.\n   * @param {PolymerElementConstructor} klass Element class\n   * @param {!HTMLTemplateElement} template Template to process\n   * @param {string} is Name of element\n   * @param {string} baseURI Base URI for element\n   * @private\n   */\n  function processElementStyles(klass, template, is, baseURI) {\n    const templateStyles = template.content.querySelectorAll('style');\n    const stylesWithImports = stylesFromTemplate(template);\n    // insert styles from <link rel=\"import\" type=\"css\"> at the top of the template\n    const linkedStyles = stylesFromModuleImports(is);\n    const firstTemplateChild = template.content.firstElementChild;\n    for (let idx = 0; idx < linkedStyles.length; idx++) {\n      let s = linkedStyles[idx];\n      s.textContent = klass._processStyleText(s.textContent, baseURI);\n      template.content.insertBefore(s, firstTemplateChild);\n    }\n    // keep track of the last \"concrete\" style in the template we have encountered\n    let templateStyleIndex = 0;\n    // ensure all gathered styles are actually in this template.\n    for (let i = 0; i < stylesWithImports.length; i++) {\n      let s = stylesWithImports[i];\n      let templateStyle = templateStyles[templateStyleIndex];\n      // if the style is not in this template, it's been \"included\" and\n      // we put a clone of it in the template before the style that included it\n      if (templateStyle !== s) {\n        s = s.cloneNode(true);\n        templateStyle.parentNode.insertBefore(s, templateStyle);\n      } else {\n        templateStyleIndex++;\n      }\n      s.textContent = klass._processStyleText(s.textContent, baseURI);\n    }\n    if (window.ShadyCSS) {\n      window.ShadyCSS.prepareTemplate(template, is);\n    }\n  }\n\n  /**\n   * Look up template from dom-module for element\n   *\n   * @param {!string} is Element name to look up\n   * @return {!HTMLTemplateElement} Template found in dom module, or\n   *   undefined if not found\n   * @protected\n   */\n  function getTemplateFromDomModule(is) {\n    let template = null;\n    // Under strictTemplatePolicy in 3.x+, dom-module lookup is only allowed\n    // when opted-in via allowTemplateFromDomModule\n    if (is && (!strictTemplatePolicy || allowTemplateFromDomModule)) {\n      template = DomModule.import(is, 'template');\n      // Under strictTemplatePolicy, require any element with an `is`\n      // specified to have a dom-module\n      if (strictTemplatePolicy && !template) {\n        throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${is}`);\n      }\n    }\n    return template;\n  }\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @unrestricted\n   * @implements {Polymer_ElementMixin}\n   */\n  class PolymerElement extends polymerElementBase {\n\n    /**\n     * Current Polymer version in Semver notation.\n     * @type {string} Semver notation of the current version of Polymer.\n     */\n    static get polymerElementVersion() {\n      return version;\n    }\n\n    /**\n     * Override of PropertiesMixin _finalizeClass to create observers and\n     * find the template.\n     * @return {void}\n     * @protected\n     * @override\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n   static _finalizeClass() {\n      super._finalizeClass();\n      if (this.hasOwnProperty(\n        JSCompiler_renameProperty('is', this)) &&  this.is) {\n        register(this.prototype);\n      }\n      const observers = ownObservers(this);\n      if (observers) {\n        this.createObservers(observers, this._properties);\n      }\n      // note: create \"working\" template that is finalized at instance time\n      let template = /** @type {PolymerElementConstructor} */ (this).template;\n      if (template) {\n        if (typeof template === 'string') {\n          console.error('template getter must return HTMLTemplateElement');\n          template = null;\n        } else {\n          template = template.cloneNode(true);\n        }\n      }\n\n      this.prototype._template = template;\n    }\n\n    /**\n     * Override of PropertiesChanged createProperties to create accessors\n     * and property effects for all of the properties.\n     * @return {void}\n     * @protected\n     * @override\n     */\n     static createProperties(props) {\n      for (let p in props) {\n        createPropertyFromConfig(this.prototype, p, props[p], props);\n      }\n    }\n\n    /**\n     * Creates observers for the given `observers` array.\n     * Leverages `PropertyEffects` to create observers.\n     * @param {Object} observers Array of observer descriptors for\n     *   this class\n     * @param {Object} dynamicFns Object containing keys for any properties\n     *   that are functions and should trigger the effect when the function\n     *   reference is changed\n     * @return {void}\n     * @protected\n     */\n    static createObservers(observers, dynamicFns) {\n      const proto = this.prototype;\n      for (let i=0; i < observers.length; i++) {\n        proto._createMethodObserver(observers[i], dynamicFns);\n      }\n    }\n\n    /**\n     * Returns the template that will be stamped into this element's shadow root.\n     *\n     * If a `static get is()` getter is defined, the default implementation\n     * will return the first `<template>` in a `dom-module` whose `id`\n     * matches this element's `is`.\n     *\n     * Users may override this getter to return an arbitrary template\n     * (in which case the `is` getter is unnecessary). The template returned\n     * must be an `HTMLTemplateElement`.\n     *\n     * Note that when subclassing, if the super class overrode the default\n     * implementation and the subclass would like to provide an alternate\n     * template via a `dom-module`, it should override this getter and\n     * return `DomModule.import(this.is, 'template')`.\n     *\n     * If a subclass would like to modify the super class template, it should\n     * clone it rather than modify it in place.  If the getter does expensive\n     * work such as cloning/modifying a template, it should memoize the\n     * template for maximum performance:\n     *\n     *   let memoizedTemplate;\n     *   class MySubClass extends MySuperClass {\n     *     static get template() {\n     *       if (!memoizedTemplate) {\n     *         memoizedTemplate = super.template.cloneNode(true);\n     *         let subContent = document.createElement('div');\n     *         subContent.textContent = 'This came from MySubClass';\n     *         memoizedTemplate.content.appendChild(subContent);\n     *       }\n     *       return memoizedTemplate;\n     *     }\n     *   }\n     *\n     * @return {!HTMLTemplateElement|string} Template to be stamped\n     */\n    static get template() {\n      // Explanation of template-related properties:\n      // - constructor.template (this getter): the template for the class.\n      //     This can come from the prototype (for legacy elements), from a\n      //     dom-module, or from the super class's template (or can be overridden\n      //     altogether by the user)\n      // - constructor._template: memoized version of constructor.template\n      // - prototype._template: working template for the element, which will be\n      //     parsed and modified in place. It is a cloned version of\n      //     constructor.template, saved in _finalizeClass(). Note that before\n      //     this getter is called, for legacy elements this could be from a\n      //     _template field on the info object passed to Polymer(), a behavior,\n      //     or set in registered(); once the static getter runs, a clone of it\n      //     will overwrite it on the prototype as the working template.\n      if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {\n        this._template =\n          // If user has put template on prototype (e.g. in legacy via registered\n          // callback or info object), prefer that first\n          this.prototype.hasOwnProperty(JSCompiler_renameProperty('_template', this.prototype)) ?\n          this.prototype._template :\n          // Look in dom-module associated with this element's is\n          (getTemplateFromDomModule(/** @type {PolymerElementConstructor}*/ (this).is) ||\n          // Next look for superclass template (call the super impl this\n          // way so that `this` points to the superclass)\n          Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template);\n      }\n      return this._template;\n    }\n\n    /**\n     * Set the template.\n     *\n     * @param {!HTMLTemplateElement|string} value Template to set.\n     */\n    static set template(value) {\n      this._template = value;\n    }\n\n    /**\n     * Path matching the url from which the element was imported.\n     *\n     * This path is used to resolve url's in template style cssText.\n     * The `importPath` property is also set on element instances and can be\n     * used to create bindings relative to the import path.\n     *\n     * For elements defined in ES modules, users should implement\n     * `static get importMeta() { return import.meta; }`, and the default\n     * implementation of `importPath` will  return `import.meta.url`'s path.\n     * For elements defined in HTML imports, this getter will return the path\n     * to the document containing a `dom-module` element matching this\n     * element's static `is` property.\n     *\n     * Note, this path should contain a trailing `/`.\n     *\n     * @return {string} The import path for this element class\n     * @suppress {missingProperties}\n     */\n    static get importPath() {\n      if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {\n        const meta = this.importMeta;\n        if (meta) {\n          this._importPath = pathFromUrl(meta.url);\n        } else {\n          const module = DomModule.import(/** @type {PolymerElementConstructor} */ (this).is);\n          this._importPath = (module && module.assetpath) ||\n            Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath;\n        }\n      }\n      return this._importPath;\n    }\n\n    constructor() {\n      super();\n      /** @type {HTMLTemplateElement} */\n      this._template;\n      /** @type {string} */\n      this._importPath;\n      /** @type {string} */\n      this.rootPath;\n      /** @type {string} */\n      this.importPath;\n      /** @type {StampedTemplate | HTMLElement | ShadowRoot} */\n      this.root;\n      /** @type {!Object<string, !Element>} */\n      this.$;\n    }\n\n    /**\n     * Overrides the default `PropertyAccessors` to ensure class\n     * metaprogramming related to property accessors and effects has\n     * completed (calls `finalize`).\n     *\n     * It also initializes any property defaults provided via `value` in\n     * `properties` metadata.\n     *\n     * @return {void}\n     * @override\n     * @suppress {invalidCasts}\n     */\n    _initializeProperties() {\n      instanceCount++;\n      this.constructor.finalize();\n      // note: finalize template when we have access to `localName` to\n      // avoid dependence on `is` for polyfilling styling.\n      this.constructor._finalizeTemplate(/** @type {!HTMLElement} */(this).localName);\n      super._initializeProperties();\n      // set path defaults\n      this.rootPath = rootPath;\n      this.importPath = this.constructor.importPath;\n      // apply property defaults...\n      let p$ = propertyDefaults(this.constructor);\n      if (!p$) {\n        return;\n      }\n      for (let p in p$) {\n        let info = p$[p];\n        // Don't set default value if there is already an own property, which\n        // happens when a `properties` property with default but no effects had\n        // a property set (e.g. bound) by its host before upgrade\n        if (!this.hasOwnProperty(p)) {\n          let value = typeof info.value == 'function' ?\n            info.value.call(this) :\n            info.value;\n          // Set via `_setProperty` if there is an accessor, to enable\n          // initializing readOnly property defaults\n          if (this._hasAccessor(p)) {\n            this._setPendingProperty(p, value, true);\n          } else {\n            this[p] = value;\n          }\n        }\n      }\n    }\n\n    /**\n     * Gather style text for a style element in the template.\n     *\n     * @param {string} cssText Text containing styling to process\n     * @param {string} baseURI Base URI to rebase CSS paths against\n     * @return {string} The processed CSS text\n     * @protected\n     */\n    static _processStyleText(cssText, baseURI) {\n      return resolveCss(cssText, baseURI);\n    }\n\n    /**\n    * Configures an element `proto` to function with a given `template`.\n    * The element name `is` and extends `ext` must be specified for ShadyCSS\n    * style scoping.\n    *\n    * @param {string} is Tag name (or type extension name) for this element\n    * @return {void}\n    * @protected\n    */\n    static _finalizeTemplate(is) {\n      /** @const {HTMLTemplateElement} */\n      const template = this.prototype._template;\n      if (template && !template.__polymerFinalized) {\n        template.__polymerFinalized = true;\n        const importPath = this.importPath;\n        const baseURI = importPath ? resolveUrl(importPath) : '';\n        // e.g. support `include=\"module-name\"`, and ShadyCSS\n        processElementStyles(this, template, is, baseURI);\n        this.prototype._bindTemplate(template);\n      }\n    }\n\n    /**\n     * Provides a default implementation of the standard Custom Elements\n     * `connectedCallback`.\n     *\n     * The default implementation enables the property effects system and\n     * flushes any pending properties, and updates shimmed CSS properties\n     * when using the ShadyCSS scoping/custom properties polyfill.\n     *\n     * @suppress {missingProperties, invalidCasts} Super may or may not implement the callback\n     * @return {void}\n     */\n    connectedCallback() {\n      if (window.ShadyCSS && this._template) {\n        window.ShadyCSS.styleElement(/** @type {!HTMLElement} */(this));\n      }\n      super.connectedCallback();\n    }\n\n    /**\n     * Stamps the element template.\n     *\n     * @return {void}\n     * @override\n     */\n    ready() {\n      if (this._template) {\n        this.root = this._stampTemplate(this._template);\n        this.$ = this.root.$;\n      }\n      super.ready();\n    }\n\n    /**\n     * Implements `PropertyEffects`'s `_readyClients` call. Attaches\n     * element dom by calling `_attachDom` with the dom stamped from the\n     * element's template via `_stampTemplate`. Note that this allows\n     * client dom to be attached to the element prior to any observers\n     * running.\n     *\n     * @return {void}\n     * @override\n     */\n    _readyClients() {\n      if (this._template) {\n        this.root = this._attachDom(/** @type {StampedTemplate} */(this.root));\n      }\n      // The super._readyClients here sets the clients initialized flag.\n      // We must wait to do this until after client dom is created/attached\n      // so that this flag can be checked to prevent notifications fired\n      // during this process from being handled before clients are ready.\n      super._readyClients();\n    }\n\n\n    /**\n     * Attaches an element's stamped dom to itself. By default,\n     * this method creates a `shadowRoot` and adds the dom to it.\n     * However, this method may be overridden to allow an element\n     * to put its dom in another location.\n     *\n     * @throws {Error}\n     * @suppress {missingReturn}\n     * @param {StampedTemplate} dom to attach to the element.\n     * @return {ShadowRoot} node to which the dom has been attached.\n     */\n    _attachDom(dom) {\n      if (this.attachShadow) {\n        if (dom) {\n          if (!this.shadowRoot) {\n            this.attachShadow({mode: 'open'});\n          }\n          this.shadowRoot.appendChild(dom);\n          return this.shadowRoot;\n        }\n        return null;\n      } else {\n        throw new Error('ShadowDOM not available. ' +\n          // TODO(sorvell): move to compile-time conditional when supported\n        'PolymerElement can create dom as children instead of in ' +\n        'ShadowDOM by setting `this.root = this;\\` before \\`ready\\`.');\n      }\n    }\n\n    /**\n     * When using the ShadyCSS scoping and custom property shim, causes all\n     * shimmed styles in this element (and its subtree) to be updated\n     * based on current custom property values.\n     *\n     * The optional parameter overrides inline custom property styles with an\n     * object of properties where the keys are CSS properties, and the values\n     * are strings.\n     *\n     * Example: `this.updateStyles({'--color': 'blue'})`\n     *\n     * These properties are retained unless a value of `null` is set.\n     *\n     * Note: This function does not support updating CSS mixins.\n     * You can not dynamically change the value of an `@apply`.\n     *\n     * @param {Object=} properties Bag of custom property key/values to\n     *   apply to this element.\n     * @return {void}\n     * @suppress {invalidCasts}\n     */\n    updateStyles(properties) {\n      if (window.ShadyCSS) {\n        window.ShadyCSS.styleSubtree(/** @type {!HTMLElement} */(this), properties);\n      }\n    }\n\n    /**\n     * Rewrites a given URL relative to a base URL. The base URL defaults to\n     * the original location of the document containing the `dom-module` for\n     * this element. This method will return the same URL before and after\n     * bundling.\n     *\n     * Note that this function performs no resolution for URLs that start\n     * with `/` (absolute URLs) or `#` (hash identifiers).  For general purpose\n     * URL resolution, use `window.URL`.\n     *\n     * @param {string} url URL to resolve.\n     * @param {string=} base Optional base URL to resolve against, defaults\n     * to the element's `importPath`\n     * @return {string} Rewritten URL relative to base\n     */\n    resolveUrl(url, base) {\n      if (!base && this.importPath) {\n        base = resolveUrl(this.importPath);\n      }\n      return resolveUrl(url, base);\n    }\n\n    /**\n     * Overrides `PropertyAccessors` to add map of dynamic functions on\n     * template info, for consumption by `PropertyEffects` template binding\n     * code. This map determines which method templates should have accessors\n     * created for them.\n     *\n     * @override\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n    static _parseTemplateContent(template, templateInfo, nodeInfo) {\n      templateInfo.dynamicFns = templateInfo.dynamicFns || this._properties;\n      return super._parseTemplateContent(template, templateInfo, nodeInfo);\n    }\n\n  }\n\n  return PolymerElement;\n});\n\n/**\n * Total number of Polymer element instances created.\n * @type {number}\n */\nexport let instanceCount = 0;\n\n/**\n * Array of Polymer element classes that have been finalized.\n * @type {Array<PolymerElement>}\n */\nexport const registrations = [];\n\n/**\n * @param {!PolymerElementConstructor} prototype Element prototype to log\n * @this {this}\n * @private\n */\nfunction _regLog(prototype) {\n  console.log('[' + prototype.is + ']: registered');\n}\n\n/**\n * Registers a class prototype for telemetry purposes.\n * @param {HTMLElement} prototype Element prototype to register\n * @this {this}\n * @protected\n */\nexport function register(prototype) {\n  registrations.push(prototype);\n}\n\n/**\n * Logs all elements registered with an `is` to the console.\n * @public\n * @this {this}\n */\nexport function dumpRegistrations() {\n  registrations.forEach(_regLog);\n}\n\n/**\n * When using the ShadyCSS scoping and custom property shim, causes all\n * shimmed `styles` (via `custom-style`) in the document (and its subtree)\n * to be updated based on current custom property values.\n *\n * The optional parameter overrides inline custom property styles with an\n * object of properties where the keys are CSS properties, and the values\n * are strings.\n *\n * Example: `updateStyles({'--color': 'blue'})`\n *\n * These properties are retained unless a value of `null` is set.\n *\n * @param {Object=} props Bag of custom property key/values to\n *   apply to the document.\n * @return {void}\n */\nexport const updateStyles = function(props) {\n  if (window.ShadyCSS) {\n    window.ShadyCSS.styleDocument(props);\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*/\nimport './boot.js';\n\n/**\n * Class representing a static string value which can be used to filter\n * strings by asseting that they have been created via this class. The\n * `value` property returns the string passed to the constructor.\n */\nclass LiteralString {\n  constructor(string) {\n    /** @type {string} */\n    this.value = string.toString();\n  }\n  /**\n   * @return {string} LiteralString string value\n   * @override\n   */\n  toString() {\n    return this.value;\n  }\n}\n\n/**\n * @param {*} value Object to stringify into HTML\n * @return {string} HTML stringified form of `obj`\n */\nfunction literalValue(value) {\n  if (value instanceof LiteralString) {\n    return /** @type {!LiteralString} */(value).value;\n  } else {\n    throw new Error(\n        `non-literal value passed to Polymer's htmlLiteral function: ${value}`\n    );\n  }\n}\n\n/**\n * @param {*} value Object to stringify into HTML\n * @return {string} HTML stringified form of `obj`\n */\nfunction htmlValue(value) {\n  if (value instanceof HTMLTemplateElement) {\n    return /** @type {!HTMLTemplateElement } */(value).innerHTML;\n  } else if (value instanceof LiteralString) {\n    return literalValue(value);\n  } else {\n    throw new Error(\n        `non-template value passed to Polymer's html function: ${value}`);\n  }\n}\n\n/**\n * A template literal tag that creates an HTML <template> element from the\n * contents of the string.\n *\n * This allows you to write a Polymer Template in JavaScript.\n *\n * Templates can be composed by interpolating `HTMLTemplateElement`s in\n * expressions in the JavaScript template literal. The nested template's\n * `innerHTML` is included in the containing template.  The only other\n * values allowed in expressions are those returned from `htmlLiteral`\n * which ensures only literal values from JS source ever reach the HTML, to\n * guard against XSS risks.\n *\n * All other values are disallowed in expressions to help prevent XSS\n * attacks; however, `htmlLiteral` can be used to compose static\n * string values into templates. This is useful to compose strings into\n * places that do not accept html, like the css text of a `style`\n * element.\n *\n * Example:\n *\n *     static get template() {\n *       return html`\n *         <style>:host{ content:\"...\" }</style>\n *         <div class=\"shadowed\">${this.partialTemplate}</div>\n *         ${super.template}\n *       `;\n *     }\n *     static get partialTemplate() { return html`<span>Partial!</span>`; }\n *\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {...*} values Variable parts of tagged template literal\n * @return {!HTMLTemplateElement} Constructed HTMLTemplateElement\n */\nexport const html = function html(strings, ...values) {\n  const template = /** @type {!HTMLTemplateElement} */(document.createElement('template'));\n  template.innerHTML = values.reduce((acc, v, idx) =>\n      acc + htmlValue(v) + strings[idx + 1], strings[0]);\n  return template;\n};\n\n/**\n * An html literal tag that can be used with `html` to compose.\n * a literal string.\n *\n * Example:\n *\n *     static get template() {\n *       return html`\n *         <style>\n *           :host { display: block; }\n *           ${this.styleTemplate()}\n *         </style>\n *         <div class=\"shadowed\">${staticValue}</div>\n *         ${super.template}\n *       `;\n *     }\n *     static get styleTemplate() {\n *        return htmlLiteral`.shadowed { background: gray; }`;\n *     }\n *\n * @param {!ITemplateArray} strings Constant parts of tagged template literal\n * @param {...*} values Variable parts of tagged template literal\n * @return {!LiteralString} Constructed literal string\n */\nexport const htmlLiteral = function(strings, ...values) {\n  return new LiteralString(values.reduce((acc, v, idx) =>\n      acc + literalValue(v) + strings[idx + 1], strings[0]));\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\nimport { ElementMixin, version } from './lib/mixins/element-mixin.js';\nexport { html } from './lib/utils/html-tag.js';\n\nexport { version };\n\n/**\n * Base class that provides the core API for Polymer's meta-programming\n * features including template stamping, data-binding, attribute deserialization,\n * and property change observation.\n *\n * @customElement\n * @polymer\n * @constructor\n * @implements {Polymer_ElementMixin}\n * @extends HTMLElement\n * @appliesMixin ElementMixin\n * @summary Custom element base class that provides the core API for Polymer's\n *   key meta-programming features including template stamping, data-binding,\n *   attribute deserialization, and property change observation\n */\nexport const PolymerElement = ElementMixin(HTMLElement);\n","import { PolymerElement, html } from '@polymer/polymer/polymer-element';\n\nclass ZuiDialogHeader extends PolymerElement {\n  static get properties() {\n    return {};\n  }\n\n  constructor() {\n    super();\n  }\n\n  ready() {\n    super.ready();\n  }\n\n  static get template() {\n    return html`\n      <style>\n        :host > div {\n          margin: 5px 0;\n        }\n        h2 {\n          font-size: 1.86rem;\n          font-weight: 600;\n        }\n      </style>\n      <div>\n        <h2><slot></slot></h2>\n      </div>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-dialog-header', ZuiDialogHeader);","import { PolymerElement, html } from '@polymer/polymer/polymer-element';\n\nclass ZuiDialogContent extends PolymerElement {\n  static get properties() {\n    return {};\n  }\n\n  constructor() {\n    super();\n  }\n\n  ready() {\n    super.ready();\n  }\n\n  static get template() {\n    return html`\n      <style>\n        :host div{margin:5px 0;max-height:10000px;-webkit-transition:height 1s cubic-bezier(0.25, 0.8, 0.25, 1);transition:height 1s cubic-bezier(0.25, 0.8, 0.25, 1)}\n      </style>\n      <div> <slot></slot> </div>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-dialog-content', ZuiDialogContent);","import { PolymerElement, html } from '@polymer/polymer/polymer-element';\n\nclass ZuiDialogFooter extends PolymerElement {\n  static get properties() {\n    return {};\n  }\n\n  constructor() {\n    super();\n  }\n\n  ready() {\n    super.ready();\n  }\n\n  static get template() {\n    return html`\n      <style>\n        :host>div{height:60px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}\n      </style>\n      <div> <slot></slot> </div>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-dialog-footer', ZuiDialogFooter);","/**\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/**\n * Module for scheduling flushable pre-render and post-render tasks.\n *\n * @summary Module for scheduling flushable pre-render and post-render tasks.\n */\n\nimport './boot.js';\n\nlet scheduled = false;\nlet beforeRenderQueue = [];\nlet afterRenderQueue = [];\n\nfunction schedule() {\n  scheduled = true;\n  // before next render\n  requestAnimationFrame(function() {\n    scheduled = false;\n    flushQueue(beforeRenderQueue);\n    // after the render\n    setTimeout(function() {\n      runQueue(afterRenderQueue);\n    });\n  });\n}\n\nfunction flushQueue(queue) {\n  while (queue.length) {\n    callMethod(queue.shift());\n  }\n}\n\nfunction runQueue(queue) {\n  for (let i=0, l=queue.length; i < l; i++) {\n    callMethod(queue.shift());\n  }\n}\n\nfunction callMethod(info) {\n  const context = info[0];\n  const callback = info[1];\n  const args = info[2];\n  try {\n    callback.apply(context, args);\n  } catch(e) {\n    setTimeout(() => {\n      throw e;\n    });\n  }\n}\n\n/**\n * Flushes all `beforeNextRender` tasks, followed by all `afterNextRender`\n * tasks.\n *\n * @return {void}\n */\nexport function flush() {\n  while (beforeRenderQueue.length || afterRenderQueue.length) {\n    flushQueue(beforeRenderQueue);\n    flushQueue(afterRenderQueue);\n  }\n  scheduled = false;\n}\n\n\n/**\n * Enqueues a callback which will be run before the next render, at\n * `requestAnimationFrame` timing.\n *\n * This method is useful for enqueuing work that requires DOM measurement,\n * since measurement may not be reliable in custom element callbacks before\n * the first render, as well as for batching measurement tasks in general.\n *\n * Tasks in this queue may be flushed by calling `flush()`.\n *\n * @param {*} context Context object the callback function will be bound to\n * @param {function(...*):void} callback Callback function\n * @param {!Array=} args An array of arguments to call the callback function with\n * @return {void}\n */\nexport function beforeNextRender(context, callback, args) {\n  if (!scheduled) {\n    schedule();\n  }\n  beforeRenderQueue.push([context, callback, args]);\n}\n\n/**\n * Enqueues a callback which will be run after the next render, equivalent\n * to one task (`setTimeout`) after the next `requestAnimationFrame`.\n *\n * This method is useful for tuning the first-render performance of an\n * element or application by deferring non-critical work until after the\n * first paint.  Typical non-render-critical work may include adding UI\n * event listeners and aria attributes.\n *\n * @param {*} context Context object the callback function will be bound to\n * @param {function(...*):void} callback Callback function\n * @param {!Array=} args An array of arguments to call the callback function with\n * @return {void}\n */\nexport function afterNextRender(context, callback, args) {\n  if (!scheduled) {\n    schedule();\n  }\n  afterRenderQueue.push([context, callback, args]);\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/*\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'] ? node['previous']['end'] : 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'] =\n          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;\n      (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;\n        (i < l) && (r = r$[i]); i++) {\n        cssText = stringify(r, preserveProperties, cssText);\n      }\n    } else {\n      cssText = preserveProperties ? 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 Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\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\n    .replace(RX.customProp, '')\n    .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n  return cssText\n    .replace(RX.mixinApply, '')\n    .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\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 = style.cloneNode(true);\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@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} from './style-settings.js';\nimport {parse, stringify, types, StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\nimport {MEDIA_MATCH} from './common-regex.js';\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 Boolean(rule['parent']) &&\n  rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\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 &&\n    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(' Shady DOM styles for ' +\n    moniker + ' ');\n  let after = lastHeadApplyNode ?\n    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) ||\n    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(element, 'class', value);\n  }\n}\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 = '', 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('style'));\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 (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 = element.localName === 'template' ? element.content.firstChild : 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 * @param {!HTMLElement} element\n */\nfunction removeBuildComment(element) {\n  const buildComment = element.localName === 'template' ? element.content.firstChild : element.firstChild;\n  buildComment.parentNode.removeChild(buildComment);\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 * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n *    --foo: {color: red; background: blue;}\n *\n * to this:\n *\n *    --foo_-_color: red;\n *    --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n *    color: var(--foo_-_color);\n *    background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n *    --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n *    --foo_-_border: 2px solid red;\n *    --foo_-_color: initial;\n *    --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n *    background: orange;\n *    `@apply` --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n *    color: var(--foo_-_color);\n *    background: var(--foo_-_background, orange);\n *    border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\nimport {forEachRule, processVariableAndFallback, rulesForStyle, toCssText, gatherStyleText} from './style-util.js';\nimport {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js';\nimport {detectMixin} from './common-utils.js';\nimport {StyleNode} from './css-parse.js'; // eslint-disable-line no-unused-vars\n\nconst APPLY_NAME_CLEAN = /;\\s*/m;\nconst INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\nconst IMPORTANT = /\\s*!important/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nconst MIXIN_VAR_SEP = '_-_';\n\n/**\n * @typedef {!Object<string, string>}\n */\nlet PropertyEntry; // eslint-disable-line no-unused-vars\n\n/**\n * @typedef {!Object<string, boolean>}\n */\nlet DependantsEntry; // eslint-disable-line no-unused-vars\n\n/** @typedef {{\n *    properties: PropertyEntry,\n *    dependants: DependantsEntry\n * }}\n */\nlet MixinMapEntry; // eslint-disable-line no-unused-vars\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n  constructor() {\n    /** @type {!Object<string, !MixinMapEntry>} */\n    this._map = {};\n  }\n  /**\n   * @param {string} name\n   * @param {!PropertyEntry} props\n   */\n  set(name, props) {\n    name = name.trim();\n    this._map[name] = {\n      properties: props,\n      dependants: {}\n    }\n  }\n  /**\n   * @param {string} name\n   * @return {MixinMapEntry}\n   */\n  get(name) {\n    name = name.trim();\n    return this._map[name] || null;\n  }\n}\n\n/**\n * Callback for when an element is marked invalid\n * @type {?function(string)}\n */\nlet invalidCallback = null;\n\n/** @unrestricted */\nclass ApplyShim {\n  constructor() {\n    /** @type {?string} */\n    this._currentElement = null;\n    /** @type {HTMLMetaElement} */\n    this._measureElement = null;\n    this._map = new MixinMap();\n  }\n  /**\n   * return true if `cssText` contains a mixin definition or consumption\n   * @param {string} cssText\n   * @return {boolean}\n   */\n  detectMixin(cssText) {\n    return detectMixin(cssText);\n  }\n\n  /**\n   * Gather styles into one style for easier processing\n   * @param {!HTMLTemplateElement} template\n   * @return {HTMLStyleElement}\n   */\n  gatherStyles(template) {\n    const styleText = gatherStyleText(template.content);\n    if (styleText) {\n      const style = /** @type {!HTMLStyleElement} */(document.createElement('style'));\n      style.textContent = styleText;\n      template.content.insertBefore(style, template.content.firstChild);\n      return style;\n    }\n    return null;\n  }\n  /**\n   * @param {!HTMLTemplateElement} template\n   * @param {string} elementName\n   * @return {StyleNode}\n   */\n  transformTemplate(template, elementName) {\n    if (template._gatheredStyle === undefined) {\n      template._gatheredStyle = this.gatherStyles(template);\n    }\n    /** @type {HTMLStyleElement} */\n    const style = template._gatheredStyle;\n    return style ? this.transformStyle(style, elementName) : null;\n  }\n  /**\n   * @param {!HTMLStyleElement} style\n   * @param {string} elementName\n   * @return {StyleNode}\n   */\n  transformStyle(style, elementName = '') {\n    let ast = rulesForStyle(style);\n    this.transformRules(ast, elementName);\n    style.textContent = toCssText(ast);\n    return ast;\n  }\n  /**\n   * @param {!HTMLStyleElement} style\n   * @return {StyleNode}\n   */\n  transformCustomStyle(style) {\n    let ast = rulesForStyle(style);\n    forEachRule(ast, (rule) => {\n      if (rule['selector'] === ':root') {\n        rule['selector'] = 'html';\n      }\n      this.transformRule(rule);\n    })\n    style.textContent = toCssText(ast);\n    return ast;\n  }\n  /**\n   * @param {StyleNode} rules\n   * @param {string} elementName\n   */\n  transformRules(rules, elementName) {\n    this._currentElement = elementName;\n    forEachRule(rules, (r) => {\n      this.transformRule(r);\n    });\n    this._currentElement = null;\n  }\n  /**\n   * @param {!StyleNode} rule\n   */\n  transformRule(rule) {\n    rule['cssText'] = this.transformCssText(rule['parsedCssText'], rule);\n    // :root was only used for variable assignment in property shim,\n    // but generates invalid selectors with real properties.\n    // replace with `:host > *`, which serves the same effect\n    if (rule['selector'] === ':root') {\n      rule['selector'] = ':host > *';\n    }\n  }\n  /**\n   * @param {string} cssText\n   * @param {!StyleNode} rule\n   * @return {string}\n   */\n  transformCssText(cssText, rule) {\n    // produce variables\n    cssText = cssText.replace(VAR_ASSIGN, (matchText, propertyName, valueProperty, valueMixin) =>\n      this._produceCssProperties(matchText, propertyName, valueProperty, valueMixin, rule));\n    // consume mixins\n    return this._consumeCssProperties(cssText, rule);\n  }\n  /**\n   * @param {string} property\n   * @return {string}\n   */\n  _getInitialValueForProperty(property) {\n    if (!this._measureElement) {\n      this._measureElement = /** @type {HTMLMetaElement} */(document.createElement('meta'));\n      this._measureElement.setAttribute('apply-shim-measure', '');\n      this._measureElement.style.all = 'initial';\n      document.head.appendChild(this._measureElement);\n    }\n    return window.getComputedStyle(this._measureElement).getPropertyValue(property);\n  }\n  /**\n   * Walk over all rules before this rule to find fallbacks for mixins\n   *\n   * @param {!StyleNode} startRule\n   * @return {!Object}\n   */\n  _fallbacksFromPreviousRules(startRule) {\n    // find the \"top\" rule\n    let topRule = startRule;\n    while (topRule['parent']) {\n      topRule = topRule['parent'];\n    }\n    const fallbacks = {};\n    let seenStartRule = false;\n    forEachRule(topRule, (r) => {\n      // stop when we hit the input rule\n      seenStartRule = seenStartRule || r === startRule;\n      if (seenStartRule) {\n        return;\n      }\n      // NOTE: Only matching selectors are \"safe\" for this fallback processing\n      // It would be prohibitive to run `matchesSelector()` on each selector,\n      // so we cheat and only check if the same selector string is used, which\n      // guarantees things like specificity matching\n      if (r['selector'] === startRule['selector']) {\n        Object.assign(fallbacks, this._cssTextToMap(r['parsedCssText']));\n      }\n    });\n    return fallbacks;\n  }\n  /**\n   * replace mixin consumption with variable consumption\n   * @param {string} text\n   * @param {!StyleNode=} rule\n   * @return {string}\n   */\n  _consumeCssProperties(text, rule) {\n    /** @type {Array} */\n    let m = null;\n    // loop over text until all mixins with defintions have been applied\n    while((m = MIXIN_MATCH.exec(text))) {\n      let matchText = m[0];\n      let mixinName = m[1];\n      let idx = m.index;\n      // collect properties before apply to be \"defaults\" if mixin might override them\n      // match includes a \"prefix\", so find the start and end positions of @apply\n      let applyPos = idx + matchText.indexOf('@apply');\n      let afterApplyPos = idx + matchText.length;\n      // find props defined before this @apply\n      let textBeforeApply = text.slice(0, applyPos);\n      let textAfterApply = text.slice(afterApplyPos);\n      let defaults = rule ? this._fallbacksFromPreviousRules(rule) : {};\n      Object.assign(defaults, this._cssTextToMap(textBeforeApply));\n      let replacement = this._atApplyToCssProperties(mixinName, defaults);\n      // use regex match position to replace mixin, keep linear processing time\n      text = `${textBeforeApply}${replacement}${textAfterApply}`;\n      // move regex search to _after_ replacement\n      MIXIN_MATCH.lastIndex = idx + replacement.length;\n    }\n    return text;\n  }\n  /**\n   * produce variable consumption at the site of mixin consumption\n   * `@apply` --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n   * Example:\n   *  border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n   *\n   * @param {string} mixinName\n   * @param {Object} fallbacks\n   * @return {string}\n   */\n  _atApplyToCssProperties(mixinName, fallbacks) {\n    mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n    let vars = [];\n    let mixinEntry = this._map.get(mixinName);\n    // if we depend on a mixin before it is created\n    // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n    if (!mixinEntry) {\n      this._map.set(mixinName, {});\n      mixinEntry = this._map.get(mixinName);\n    }\n    if (mixinEntry) {\n      if (this._currentElement) {\n        mixinEntry.dependants[this._currentElement] = true;\n      }\n      let p, parts, f;\n      const properties = mixinEntry.properties;\n      for (p in properties) {\n        f = fallbacks && fallbacks[p];\n        parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n        if (f) {\n          parts.push(',', f.replace(IMPORTANT, ''));\n        }\n        parts.push(')');\n        if (IMPORTANT.test(properties[p])) {\n          parts.push(' !important');\n        }\n        vars.push(parts.join(''));\n      }\n    }\n    return vars.join('; ');\n  }\n\n  /**\n   * @param {string} property\n   * @param {string} value\n   * @return {string}\n   */\n  _replaceInitialOrInherit(property, value) {\n    let match = INITIAL_INHERIT.exec(value);\n    if (match) {\n      if (match[1]) {\n        // initial\n        // replace `initial` with the concrete initial value for this property\n        value = this._getInitialValueForProperty(property);\n      } else {\n        // inherit\n        // with this purposfully illegal value, the variable will be invalid at\n        // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n        // and for inheriting values, will behave similarly\n        // we cannot support the same behavior for non inheriting values like 'border'\n        value = 'apply-shim-inherit';\n      }\n    }\n    return value;\n  }\n\n  /**\n   * \"parse\" a mixin definition into a map of properties and values\n   * cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n   * @param {string} text\n   * @return {!Object<string, string>}\n   */\n  _cssTextToMap(text) {\n    let props = text.split(';');\n    let property, value;\n    let out = {};\n    for (let i = 0, p, sp; i < props.length; i++) {\n      p = props[i];\n      if (p) {\n        sp = p.split(':');\n        // ignore lines that aren't definitions like @media\n        if (sp.length > 1) {\n          property = sp[0].trim();\n          // some properties may have ':' in the value, like data urls\n          value = this._replaceInitialOrInherit(property, sp.slice(1).join(':'));\n          out[property] = value;\n        }\n      }\n    }\n    return out;\n  }\n\n  /**\n   * @param {MixinMapEntry} mixinEntry\n   */\n  _invalidateMixinEntry(mixinEntry) {\n    if (!invalidCallback) {\n      return;\n    }\n    for (let elementName in mixinEntry.dependants) {\n      if (elementName !== this._currentElement) {\n        invalidCallback(elementName);\n      }\n    }\n  }\n\n  /**\n   * @param {string} matchText\n   * @param {string} propertyName\n   * @param {?string} valueProperty\n   * @param {?string} valueMixin\n   * @param {!StyleNode} rule\n   * @return {string}\n   */\n  _produceCssProperties(matchText, propertyName, valueProperty, valueMixin, rule) {\n    // handle case where property value is a mixin\n    if (valueProperty) {\n      // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n      processVariableAndFallback(valueProperty, (prefix, value) => {\n        if (value && this._map.get(value)) {\n          valueMixin = `@apply ${value};`\n        }\n      });\n    }\n    if (!valueMixin) {\n      return matchText;\n    }\n    let mixinAsProperties = this._consumeCssProperties('' + valueMixin, rule);\n    let prefix = matchText.slice(0, matchText.indexOf('--'));\n    let mixinValues = this._cssTextToMap(mixinAsProperties);\n    let combinedProps = mixinValues;\n    let mixinEntry = this._map.get(propertyName);\n    let oldProps = mixinEntry && mixinEntry.properties;\n    if (oldProps) {\n      // NOTE: since we use mixin, the map of properties is updated here\n      // and this is what we want.\n      combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n    } else {\n      this._map.set(propertyName, combinedProps);\n    }\n    let out = [];\n    let p, v;\n    // set variables defined by current mixin\n    let needToInvalidate = false;\n    for (p in combinedProps) {\n      v = mixinValues[p];\n      // if property not defined by current mixin, set initial\n      if (v === undefined) {\n        v = 'initial';\n      }\n      if (oldProps && !(p in oldProps)) {\n        needToInvalidate = true;\n      }\n      out.push(`${propertyName}${MIXIN_VAR_SEP}${p}: ${v}`);\n    }\n    if (needToInvalidate) {\n      this._invalidateMixinEntry(mixinEntry);\n    }\n    if (mixinEntry) {\n      mixinEntry.properties = combinedProps;\n    }\n    // because the mixinMap is global, the mixin might conflict with\n    // a different scope's simple variable definition:\n    // Example:\n    // some style somewhere:\n    // --mixin1:{ ... }\n    // --mixin2: var(--mixin1);\n    // some other element:\n    // --mixin1: 10px solid red;\n    // --foo: var(--mixin1);\n    // In this case, we leave the original variable definition in place.\n    if (valueProperty) {\n      prefix = `${matchText};${prefix}`;\n    }\n    return `${prefix}${out.join('; ')};`;\n  }\n}\n\n/* exports */\nApplyShim.prototype['detectMixin'] = ApplyShim.prototype.detectMixin;\nApplyShim.prototype['transformStyle'] = ApplyShim.prototype.transformStyle;\nApplyShim.prototype['transformCustomStyle'] = ApplyShim.prototype.transformCustomStyle;\nApplyShim.prototype['transformRules'] = ApplyShim.prototype.transformRules;\nApplyShim.prototype['transformRule'] = ApplyShim.prototype.transformRule;\nApplyShim.prototype['transformTemplate'] = ApplyShim.prototype.transformTemplate;\nApplyShim.prototype['_separator'] = MIXIN_VAR_SEP;\nObject.defineProperty(ApplyShim.prototype, 'invalidCallback', {\n  /** @return {?function(string)} */\n  get() {\n    return invalidCallback;\n  },\n  /** @param {?function(string)} cb */\n  set(cb) {\n    invalidCallback = cb;\n  }\n});\n\nexport default ApplyShim;\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 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 !templateIsValid(template) && template[VALIDATING_VERSION] === template[NEXT_VERSION];\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@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 ApplyShim from '../src/apply-shim.js';\nimport templateMap from '../src/template-map.js';\nimport {getIsExtends, toCssText, elementHasBuiltCss} from '../src/style-util.js';\nimport * as ApplyShimUtils from '../src/apply-shim-utils.js';\nimport {getComputedStyleValue, updateNativeProperties} from '../src/common-utils.js';\nimport {CustomStyleInterfaceInterface} from '../src/custom-style-interface.js'; // eslint-disable-line no-unused-vars\nimport {nativeCssVariables, nativeShadow} from '../src/style-settings.js';\n\n/** @const {ApplyShim} */\nconst applyShim = new ApplyShim();\n\nclass ApplyShimInterface {\n  constructor() {\n    /** @type {?CustomStyleInterfaceInterface} */\n    this.customStyleInterface = null;\n    applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n  }\n  ensure() {\n    if (this.customStyleInterface) {\n      return;\n    }\n    this.customStyleInterface = window.ShadyCSS.CustomStyleInterface;\n    if (this.customStyleInterface) {\n      this.customStyleInterface['transformCallback'] = (style) => {\n        applyShim.transformCustomStyle(style);\n      };\n      this.customStyleInterface['validateCallback'] = () => {\n        requestAnimationFrame(() => {\n          if (this.customStyleInterface['enqueued']) {\n            this.flushCustomStyles();\n          }\n        });\n      }\n    }\n  }\n  /**\n   * @param {!HTMLTemplateElement} template\n   * @param {string} elementName\n   */\n  prepareTemplate(template, elementName) {\n    this.ensure();\n    if (elementHasBuiltCss(template)) {\n      return;\n    }\n    templateMap[elementName] = template;\n    let ast = applyShim.transformTemplate(template, elementName);\n    // save original style ast to use for revalidating instances\n    template['_styleAst'] = ast;\n  }\n  flushCustomStyles() {\n    this.ensure();\n    if (!this.customStyleInterface) {\n      return;\n    }\n    let styles = this.customStyleInterface['processStyles']();\n    if (!this.customStyleInterface['enqueued']) {\n      return;\n    }\n    for (let i = 0; i < styles.length; i++ ) {\n      let cs = styles[i];\n      let style = this.customStyleInterface['getStyleForCustomStyle'](cs);\n      if (style) {\n        applyShim.transformCustomStyle(style);\n      }\n    }\n    this.customStyleInterface['enqueued'] = false;\n  }\n  /**\n   * @param {HTMLElement} element\n   * @param {Object=} properties\n   */\n  styleSubtree(element, properties) {\n    this.ensure();\n    if (properties) {\n      updateNativeProperties(element, properties);\n    }\n    if (element.shadowRoot) {\n      this.styleElement(element);\n      let shadowChildren = element.shadowRoot.children || element.shadowRoot.childNodes;\n      for (let i = 0; i < shadowChildren.length; i++) {\n        this.styleSubtree(/** @type {HTMLElement} */(shadowChildren[i]));\n      }\n    } else {\n      let children = element.children || element.childNodes;\n      for (let i = 0; i < children.length; i++) {\n        this.styleSubtree(/** @type {HTMLElement} */(children[i]));\n      }\n    }\n  }\n  /**\n   * @param {HTMLElement} element\n   */\n  styleElement(element) {\n    this.ensure();\n    let {is} = getIsExtends(element);\n    let template = templateMap[is];\n    if (template && elementHasBuiltCss(template)) {\n      return;\n    }\n    if (template && !ApplyShimUtils.templateIsValid(template)) {\n      // only revalidate template once\n      if (!ApplyShimUtils.templateIsValidating(template)) {\n        this.prepareTemplate(template, is);\n        ApplyShimUtils.startValidatingTemplate(template);\n      }\n      // update this element instance\n      let root = element.shadowRoot;\n      if (root) {\n        let style = /** @type {HTMLStyleElement} */(root.querySelector('style'));\n        if (style) {\n          // reuse the template's style ast, it has all the original css text\n          style['__cssRules'] = template['_styleAst'];\n          style.textContent = toCssText(template['_styleAst'])\n        }\n      }\n    }\n  }\n  /**\n   * @param {Object=} properties\n   */\n  styleDocument(properties) {\n    this.ensure();\n    this.styleSubtree(document.body, properties);\n  }\n}\n\nif (!window.ShadyCSS || !window.ShadyCSS.ScopingShim) {\n  const applyShimInterface = new ApplyShimInterface();\n  let CustomStyleInterface = window.ShadyCSS && window.ShadyCSS.CustomStyleInterface;\n\n  /** @suppress {duplicate} */\n  window.ShadyCSS = {\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     * @param {string=} elementExtends\n     */\n    prepareTemplate(template, elementName, elementExtends) { // eslint-disable-line no-unused-vars\n      applyShimInterface.flushCustomStyles();\n      applyShimInterface.prepareTemplate(template, elementName);\n    },\n\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     * @param {string=} elementExtends\n     */\n    prepareTemplateStyles(template, elementName, elementExtends) {\n      this.prepareTemplate(template, elementName, elementExtends);\n    },\n\n    /**\n     * @param {!HTMLTemplateElement} template\n     * @param {string} elementName\n     */\n    prepareTemplateDom(template, elementName) {}, // eslint-disable-line no-unused-vars\n\n    /**\n     * @param {!HTMLElement} element\n     * @param {Object=} properties\n     */\n    styleSubtree(element, properties) {\n      applyShimInterface.flushCustomStyles();\n      applyShimInterface.styleSubtree(element, properties);\n    },\n\n    /**\n     * @param {!HTMLElement} element\n     */\n    styleElement(element) {\n      applyShimInterface.flushCustomStyles();\n      applyShimInterface.styleElement(element);\n    },\n\n    /**\n     * @param {Object=} properties\n     */\n    styleDocument(properties) {\n      applyShimInterface.flushCustomStyles();\n      applyShimInterface.styleDocument(properties);\n    },\n\n    /**\n     * @param {Element} element\n     * @param {string} property\n     * @return {string}\n     */\n    getComputedStyleValue(element, property) {\n      return getComputedStyleValue(element, property);\n    },\n\n    flushCustomStyles() {\n      applyShimInterface.flushCustomStyles();\n    },\n\n    nativeCss: nativeCssVariables,\n    nativeShadow: nativeShadow\n  };\n\n  if (CustomStyleInterface) {\n    window.ShadyCSS.CustomStyleInterface = CustomStyleInterface;\n  }\n}\n\nwindow.ShadyCSS.ApplyShim = applyShim;\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*/\nimport './boot.js';\n\nimport './mixin.js';\nimport './async.js';\n\n/**\n * @summary Collapse multiple callbacks into one invocation after a timer.\n */\nexport class Debouncer {\n  constructor() {\n    this._asyncModule = null;\n    this._callback = null;\n    this._timer = null;\n  }\n  /**\n   * Sets the scheduler; that is, a module with the Async interface,\n   * a callback and optional arguments to be passed to the run function\n   * from the async module.\n   *\n   * @param {!AsyncInterface} asyncModule Object with Async interface.\n   * @param {function()} callback Callback to run.\n   * @return {void}\n   */\n  setConfig(asyncModule, callback) {\n    this._asyncModule = asyncModule;\n    this._callback = callback;\n    this._timer = this._asyncModule.run(() => {\n      this._timer = null;\n      this._callback();\n    });\n  }\n  /**\n   * Cancels an active debouncer and returns a reference to itself.\n   *\n   * @return {void}\n   */\n  cancel() {\n    if (this.isActive()) {\n      this._asyncModule.cancel(/** @type {number} */(this._timer));\n      this._timer = null;\n    }\n  }\n  /**\n   * Flushes an active debouncer and returns a reference to itself.\n   *\n   * @return {void}\n   */\n  flush() {\n    if (this.isActive()) {\n      this.cancel();\n      this._callback();\n    }\n  }\n  /**\n   * Returns true if the debouncer is active.\n   *\n   * @return {boolean} True if active.\n   */\n  isActive() {\n    return this._timer != null;\n  }\n  /**\n   * Creates a debouncer if no debouncer is passed as a parameter\n   * or it cancels an active debouncer otherwise. The following\n   * example shows how a debouncer can be called multiple times within a\n   * microtask and \"debounced\" such that the provided callback function is\n   * called once. Add this method to a custom element:\n   *\n   * ```js\n   * import {microTask} from '@polymer/polymer/lib/utils/async.js';\n   * import {Debouncer} from '@polymer/polymer/lib/utils/debounce.js';\n   * // ...\n   *\n   * _debounceWork() {\n   *   this._debounceJob = Debouncer.debounce(this._debounceJob,\n   *       microTask, () => this._doWork());\n   * }\n   * ```\n   *\n   * If the `_debounceWork` method is called multiple times within the same\n   * microtask, the `_doWork` function will be called only once at the next\n   * microtask checkpoint.\n   *\n   * Note: In testing it is often convenient to avoid asynchrony. To accomplish\n   * this with a debouncer, you can use `enqueueDebouncer` and\n   * `flush`. For example, extend the above example by adding\n   * `enqueueDebouncer(this._debounceJob)` at the end of the\n   * `_debounceWork` method. Then in a test, call `flush` to ensure\n   * the debouncer has completed.\n   *\n   * @param {Debouncer?} debouncer Debouncer object.\n   * @param {!AsyncInterface} asyncModule Object with Async interface\n   * @param {function()} callback Callback to run.\n   * @return {!Debouncer} Returns a debouncer object.\n   */\n  static debounce(debouncer, asyncModule, callback) {\n    if (debouncer instanceof Debouncer) {\n      debouncer.cancel();\n    } else {\n      debouncer = new Debouncer();\n    }\n    debouncer.setConfig(asyncModule, callback);\n    return debouncer;\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/**\n * @fileoverview\n *\n * Module for adding listeners to a node for the following normalized\n * cross-platform \"gesture\" events:\n * - `down` - mouse or touch went down\n * - `up` - mouse or touch went up\n * - `tap` - mouse click or finger tap\n * - `track` - mouse drag or touch move\n *\n * @summary Module for adding cross-platform gesture event listeners.\n */\n\nimport './boot.js';\n\nimport { timeOut, microTask } from './async.js';\nimport { Debouncer } from './debounce.js';\nimport { passiveTouchGestures } from './settings.js';\n\n// detect native touch action support\nlet HAS_NATIVE_TA = typeof document.head.style.touchAction === 'string';\nlet GESTURE_KEY = '__polymerGestures';\nlet HANDLED_OBJ = '__polymerGesturesHandled';\nlet TOUCH_ACTION = '__polymerGesturesTouchAction';\n// radius for tap and track\nlet TAP_DISTANCE = 25;\nlet TRACK_DISTANCE = 5;\n// number of last N track positions to keep\nlet TRACK_LENGTH = 2;\n\n// Disabling \"mouse\" handlers for 2500ms is enough\nlet MOUSE_TIMEOUT = 2500;\nlet MOUSE_EVENTS = ['mousedown', 'mousemove', 'mouseup', 'click'];\n// an array of bitmask values for mapping MouseEvent.which to MouseEvent.buttons\nlet MOUSE_WHICH_TO_BUTTONS = [0, 1, 4, 2];\nlet MOUSE_HAS_BUTTONS = (function() {\n  try {\n    return new MouseEvent('test', {buttons: 1}).buttons === 1;\n  } catch (e) {\n    return false;\n  }\n})();\n\n/**\n * @param {string} name Possible mouse event name\n * @return {boolean} true if mouse event, false if not\n */\nfunction isMouseEvent(name) {\n  return MOUSE_EVENTS.indexOf(name) > -1;\n}\n\n/* eslint no-empty: [\"error\", { \"allowEmptyCatch\": true }] */\n// check for passive event listeners\nlet SUPPORTS_PASSIVE = false;\n(function() {\n  try {\n    let opts = Object.defineProperty({}, 'passive', {get() {SUPPORTS_PASSIVE = true;}});\n    window.addEventListener('test', null, opts);\n    window.removeEventListener('test', null, opts);\n  } catch(e) {}\n})();\n\n/**\n * Generate settings for event listeners, dependant on `passiveTouchGestures`\n *\n * @param {string} eventName Event name to determine if `{passive}` option is\n *   needed\n * @return {{passive: boolean} | undefined} Options to use for addEventListener\n *   and removeEventListener\n */\nfunction PASSIVE_TOUCH(eventName) {\n  if (isMouseEvent(eventName) || eventName === 'touchend') {\n    return;\n  }\n  if (HAS_NATIVE_TA && SUPPORTS_PASSIVE && passiveTouchGestures) {\n    return {passive: true};\n  } else {\n    return;\n  }\n}\n\n// Check for touch-only devices\nlet IS_TOUCH_ONLY = navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/);\n\n// keep track of any labels hit by the mouseCanceller\n/** @type {!Array<!HTMLLabelElement>} */\nconst clickedLabels = [];\n\n/** @type {!Object<boolean>} */\nconst labellable = {\n  'button': true,\n  'input': true,\n  'keygen': true,\n  'meter': true,\n  'output': true,\n  'textarea': true,\n  'progress': true,\n  'select': true\n};\n\n// Defined at https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#enabling-and-disabling-form-controls:-the-disabled-attribute\n/** @type {!Object<boolean>} */\nconst canBeDisabled = {\n  'button': true,\n  'command': true,\n  'fieldset': true,\n  'input': true,\n  'keygen': true,\n  'optgroup': true,\n  'option': true,\n  'select': true,\n  'textarea': true\n};\n\n/**\n * @param {HTMLElement} el Element to check labelling status\n * @return {boolean} element can have labels\n */\nfunction canBeLabelled(el) {\n  return labellable[el.localName] || false;\n}\n\n/**\n * @param {HTMLElement} el Element that may be labelled.\n * @return {!Array<!HTMLLabelElement>} Relevant label for `el`\n */\nfunction matchingLabels(el) {\n  let labels = Array.prototype.slice.call(/** @type {HTMLInputElement} */(el).labels || []);\n  // IE doesn't have `labels` and Safari doesn't populate `labels`\n  // if element is in a shadowroot.\n  // In this instance, finding the non-ancestor labels is enough,\n  // as the mouseCancellor code will handle ancstor labels\n  if (!labels.length) {\n    labels = [];\n    let root = el.getRootNode();\n    // if there is an id on `el`, check for all labels with a matching `for` attribute\n    if (el.id) {\n      let matching = root.querySelectorAll(`label[for = ${el.id}]`);\n      for (let i = 0; i < matching.length; i++) {\n        labels.push(/** @type {!HTMLLabelElement} */(matching[i]));\n      }\n    }\n  }\n  return labels;\n}\n\n// touch will make synthetic mouse events\n// `preventDefault` on touchend will cancel them,\n// but this breaks `<input>` focus and link clicks\n// disable mouse handlers for MOUSE_TIMEOUT ms after\n// a touchend to ignore synthetic mouse events\nlet mouseCanceller = function(mouseEvent) {\n  // Check for sourceCapabilities, used to distinguish synthetic events\n  // if mouseEvent did not come from a device that fires touch events,\n  // it was made by a real mouse and should be counted\n  // http://wicg.github.io/InputDeviceCapabilities/#dom-inputdevicecapabilities-firestouchevents\n  let sc = mouseEvent.sourceCapabilities;\n  if (sc && !sc.firesTouchEvents) {\n    return;\n  }\n  // skip synthetic mouse events\n  mouseEvent[HANDLED_OBJ] = {skip: true};\n  // disable \"ghost clicks\"\n  if (mouseEvent.type === 'click') {\n    let clickFromLabel = false;\n    let path = mouseEvent.composedPath && mouseEvent.composedPath();\n    if (path) {\n      for (let i = 0; i < path.length; i++) {\n        if (path[i].nodeType === Node.ELEMENT_NODE) {\n          if (path[i].localName === 'label') {\n            clickedLabels.push(path[i]);\n          } else if (canBeLabelled(path[i])) {\n            let ownerLabels = matchingLabels(path[i]);\n            // check if one of the clicked labels is labelling this element\n            for (let j = 0; j < ownerLabels.length; j++) {\n              clickFromLabel = clickFromLabel || clickedLabels.indexOf(ownerLabels[j]) > -1;\n            }\n          }\n        }\n        if (path[i] === POINTERSTATE.mouse.target) {\n          return;\n        }\n      }\n    }\n    // if one of the clicked labels was labelling the target element,\n    // this is not a ghost click\n    if (clickFromLabel) {\n      return;\n    }\n    mouseEvent.preventDefault();\n    mouseEvent.stopPropagation();\n  }\n};\n\n/**\n * @param {boolean=} setup True to add, false to remove.\n * @return {void}\n */\nfunction setupTeardownMouseCanceller(setup) {\n  let events = IS_TOUCH_ONLY ? ['click'] : MOUSE_EVENTS;\n  for (let i = 0, en; i < events.length; i++) {\n    en = events[i];\n    if (setup) {\n      // reset clickLabels array\n      clickedLabels.length = 0;\n      document.addEventListener(en, mouseCanceller, true);\n    } else {\n      document.removeEventListener(en, mouseCanceller, true);\n    }\n  }\n}\n\nfunction ignoreMouse(e) {\n  if (!POINTERSTATE.mouse.mouseIgnoreJob) {\n    setupTeardownMouseCanceller(true);\n  }\n  let unset = function() {\n    setupTeardownMouseCanceller();\n    POINTERSTATE.mouse.target = null;\n    POINTERSTATE.mouse.mouseIgnoreJob = null;\n  };\n  POINTERSTATE.mouse.target = e.composedPath()[0];\n  POINTERSTATE.mouse.mouseIgnoreJob = Debouncer.debounce(\n        POINTERSTATE.mouse.mouseIgnoreJob\n      , timeOut.after(MOUSE_TIMEOUT)\n      , unset);\n}\n\n/**\n * @param {MouseEvent} ev event to test for left mouse button down\n * @return {boolean} has left mouse button down\n */\nfunction hasLeftMouseButton(ev) {\n  let type = ev.type;\n  // exit early if the event is not a mouse event\n  if (!isMouseEvent(type)) {\n    return false;\n  }\n  // ev.button is not reliable for mousemove (0 is overloaded as both left button and no buttons)\n  // instead we use ev.buttons (bitmask of buttons) or fall back to ev.which (deprecated, 0 for no buttons, 1 for left button)\n  if (type === 'mousemove') {\n    // allow undefined for testing events\n    let buttons = ev.buttons === undefined ? 1 : ev.buttons;\n    if ((ev instanceof window.MouseEvent) && !MOUSE_HAS_BUTTONS) {\n      buttons = MOUSE_WHICH_TO_BUTTONS[ev.which] || 0;\n    }\n    // buttons is a bitmask, check that the left button bit is set (1)\n    return Boolean(buttons & 1);\n  } else {\n    // allow undefined for testing events\n    let button = ev.button === undefined ? 0 : ev.button;\n    // ev.button is 0 in mousedown/mouseup/click for left button activation\n    return button === 0;\n  }\n}\n\nfunction isSyntheticClick(ev) {\n  if (ev.type === 'click') {\n    // ev.detail is 0 for HTMLElement.click in most browsers\n    if (ev.detail === 0) {\n      return true;\n    }\n    // in the worst case, check that the x/y position of the click is within\n    // the bounding box of the target of the event\n    // Thanks IE 10 >:(\n    let t = _findOriginalTarget(ev);\n    // make sure the target of the event is an element so we can use getBoundingClientRect,\n    // if not, just assume it is a synthetic click\n    if (!t.nodeType || /** @type {Element} */(t).nodeType !== Node.ELEMENT_NODE) {\n      return true;\n    }\n    let bcr = /** @type {Element} */(t).getBoundingClientRect();\n    // use page x/y to account for scrolling\n    let x = ev.pageX, y = ev.pageY;\n    // ev is a synthetic click if the position is outside the bounding box of the target\n    return !((x >= bcr.left && x <= bcr.right) && (y >= bcr.top && y <= bcr.bottom));\n  }\n  return false;\n}\n\nlet POINTERSTATE = {\n  mouse: {\n    target: null,\n    mouseIgnoreJob: null\n  },\n  touch: {\n    x: 0,\n    y: 0,\n    id: -1,\n    scrollDecided: false\n  }\n};\n\nfunction firstTouchAction(ev) {\n  let ta = 'auto';\n  let path = ev.composedPath && ev.composedPath();\n  if (path) {\n    for (let i = 0, n; i < path.length; i++) {\n      n = path[i];\n      if (n[TOUCH_ACTION]) {\n        ta = n[TOUCH_ACTION];\n        break;\n      }\n    }\n  }\n  return ta;\n}\n\nfunction trackDocument(stateObj, movefn, upfn) {\n  stateObj.movefn = movefn;\n  stateObj.upfn = upfn;\n  document.addEventListener('mousemove', movefn);\n  document.addEventListener('mouseup', upfn);\n}\n\nfunction untrackDocument(stateObj) {\n  document.removeEventListener('mousemove', stateObj.movefn);\n  document.removeEventListener('mouseup', stateObj.upfn);\n  stateObj.movefn = null;\n  stateObj.upfn = null;\n}\n\n// use a document-wide touchend listener to start the ghost-click prevention mechanism\n// Use passive event listeners, if supported, to not affect scrolling performance\ndocument.addEventListener('touchend', ignoreMouse, SUPPORTS_PASSIVE ? {passive: true} : false);\n\n/** @type {!Object<string, !GestureRecognizer>} */\nexport const gestures = {};\n\n/** @type {!Array<!GestureRecognizer>} */\nexport const recognizers = [];\n\n/**\n * Finds the element rendered on the screen at the provided coordinates.\n *\n * Similar to `document.elementFromPoint`, but pierces through\n * shadow roots.\n *\n * @param {number} x Horizontal pixel coordinate\n * @param {number} y Vertical pixel coordinate\n * @return {Element} Returns the deepest shadowRoot inclusive element\n * found at the screen position given.\n */\nexport function deepTargetFind(x, y) {\n  let node = document.elementFromPoint(x, y);\n  let next = node;\n  // this code path is only taken when native ShadowDOM is used\n  // if there is a shadowroot, it may have a node at x/y\n  // if there is not a shadowroot, exit the loop\n  while (next && next.shadowRoot && !window.ShadyDOM) {\n    // if there is a node at x/y in the shadowroot, look deeper\n    let oldNext = next;\n    next = next.shadowRoot.elementFromPoint(x, y);\n    // on Safari, elementFromPoint may return the shadowRoot host\n    if (oldNext === next) {\n      break;\n    }\n    if (next) {\n      node = next;\n    }\n  }\n  return node;\n}\n\n/**\n * a cheaper check than ev.composedPath()[0];\n *\n * @private\n * @param {Event|Touch} ev Event.\n * @return {EventTarget} Returns the event target.\n */\nfunction _findOriginalTarget(ev) {\n  // shadowdom\n  if (ev.composedPath) {\n    const targets = /** @type {!Array<!EventTarget>} */(ev.composedPath());\n    // It shouldn't be, but sometimes targets is empty (window on Safari).\n    return targets.length > 0 ? targets[0] : ev.target;\n  }\n  // shadydom\n  return ev.target;\n}\n\n/**\n * @private\n * @param {Event} ev Event.\n * @return {void}\n */\nfunction _handleNative(ev) {\n  let handled;\n  let type = ev.type;\n  let node = ev.currentTarget;\n  let gobj = node[GESTURE_KEY];\n  if (!gobj) {\n    return;\n  }\n  let gs = gobj[type];\n  if (!gs) {\n    return;\n  }\n  if (!ev[HANDLED_OBJ]) {\n    ev[HANDLED_OBJ] = {};\n    if (type.slice(0, 5) === 'touch') {\n      ev = /** @type {TouchEvent} */(ev); // eslint-disable-line no-self-assign\n      let t = ev.changedTouches[0];\n      if (type === 'touchstart') {\n        // only handle the first finger\n        if (ev.touches.length === 1) {\n          POINTERSTATE.touch.id = t.identifier;\n        }\n      }\n      if (POINTERSTATE.touch.id !== t.identifier) {\n        return;\n      }\n      if (!HAS_NATIVE_TA) {\n        if (type === 'touchstart' || type === 'touchmove') {\n          _handleTouchAction(ev);\n        }\n      }\n    }\n  }\n  handled = ev[HANDLED_OBJ];\n  // used to ignore synthetic mouse events\n  if (handled.skip) {\n    return;\n  }\n  // reset recognizer state\n  for (let i = 0, r; i < recognizers.length; i++) {\n    r = recognizers[i];\n    if (gs[r.name] && !handled[r.name]) {\n      if (r.flow && r.flow.start.indexOf(ev.type) > -1 && r.reset) {\n        r.reset();\n      }\n    }\n  }\n  // enforce gesture recognizer order\n  for (let i = 0, r; i < recognizers.length; i++) {\n    r = recognizers[i];\n    if (gs[r.name] && !handled[r.name]) {\n      handled[r.name] = true;\n      r[type](ev);\n    }\n  }\n}\n\n/**\n * @private\n * @param {TouchEvent} ev Event.\n * @return {void}\n */\nfunction _handleTouchAction(ev) {\n  let t = ev.changedTouches[0];\n  let type = ev.type;\n  if (type === 'touchstart') {\n    POINTERSTATE.touch.x = t.clientX;\n    POINTERSTATE.touch.y = t.clientY;\n    POINTERSTATE.touch.scrollDecided = false;\n  } else if (type === 'touchmove') {\n    if (POINTERSTATE.touch.scrollDecided) {\n      return;\n    }\n    POINTERSTATE.touch.scrollDecided = true;\n    let ta = firstTouchAction(ev);\n    let shouldPrevent = false;\n    let dx = Math.abs(POINTERSTATE.touch.x - t.clientX);\n    let dy = Math.abs(POINTERSTATE.touch.y - t.clientY);\n    if (!ev.cancelable) {\n      // scrolling is happening\n    } else if (ta === 'none') {\n      shouldPrevent = true;\n    } else if (ta === 'pan-x') {\n      shouldPrevent = dy > dx;\n    } else if (ta === 'pan-y') {\n      shouldPrevent = dx > dy;\n    }\n    if (shouldPrevent) {\n      ev.preventDefault();\n    } else {\n      prevent('track');\n    }\n  }\n}\n\n/**\n * Adds an event listener to a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to add listener on\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function to call\n * @return {boolean} Returns true if a gesture event listener was added.\n */\nexport function addListener(node, evType, handler) {\n  if (gestures[evType]) {\n    _add(node, evType, handler);\n    return true;\n  }\n  return false;\n}\n\n/**\n * Removes an event listener from a node for the given gesture type.\n *\n * @param {!EventTarget} node Node to remove listener from\n * @param {string} evType Gesture type: `down`, `up`, `track`, or `tap`\n * @param {!function(!Event):void} handler Event listener function previously passed to\n *  `addListener`.\n * @return {boolean} Returns true if a gesture event listener was removed.\n */\nexport function removeListener(node, evType, handler) {\n  if (gestures[evType]) {\n    _remove(node, evType, handler);\n    return true;\n  }\n  return false;\n}\n\n/**\n * automate the event listeners for the native events\n *\n * @private\n * @param {!EventTarget} node Node on which to add the event.\n * @param {string} evType Event type to add.\n * @param {function(!Event)} handler Event handler function.\n * @return {void}\n */\nfunction _add(node, evType, handler) {\n  let recognizer = gestures[evType];\n  let deps = recognizer.deps;\n  let name = recognizer.name;\n  let gobj = node[GESTURE_KEY];\n  if (!gobj) {\n    node[GESTURE_KEY] = gobj = {};\n  }\n  for (let i = 0, dep, gd; i < deps.length; i++) {\n    dep = deps[i];\n    // don't add mouse handlers on iOS because they cause gray selection overlays\n    if (IS_TOUCH_ONLY && isMouseEvent(dep) && dep !== 'click') {\n      continue;\n    }\n    gd = gobj[dep];\n    if (!gd) {\n      gobj[dep] = gd = {_count: 0};\n    }\n    if (gd._count === 0) {\n      node.addEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n    }\n    gd[name] = (gd[name] || 0) + 1;\n    gd._count = (gd._count || 0) + 1;\n  }\n  node.addEventListener(evType, handler);\n  if (recognizer.touchAction) {\n    setTouchAction(node, recognizer.touchAction);\n  }\n}\n\n/**\n * automate event listener removal for native events\n *\n * @private\n * @param {!EventTarget} node Node on which to remove the event.\n * @param {string} evType Event type to remove.\n * @param {function(!Event): void} handler Event handler function.\n * @return {void}\n */\nfunction _remove(node, evType, handler) {\n  let recognizer = gestures[evType];\n  let deps = recognizer.deps;\n  let name = recognizer.name;\n  let gobj = node[GESTURE_KEY];\n  if (gobj) {\n    for (let i = 0, dep, gd; i < deps.length; i++) {\n      dep = deps[i];\n      gd = gobj[dep];\n      if (gd && gd[name]) {\n        gd[name] = (gd[name] || 1) - 1;\n        gd._count = (gd._count || 1) - 1;\n        if (gd._count === 0) {\n          node.removeEventListener(dep, _handleNative, PASSIVE_TOUCH(dep));\n        }\n      }\n    }\n  }\n  node.removeEventListener(evType, handler);\n}\n\n/**\n * Registers a new gesture event recognizer for adding new custom\n * gesture event types.\n *\n * @param {!GestureRecognizer} recog Gesture recognizer descriptor\n * @return {void}\n */\nexport function register(recog) {\n  recognizers.push(recog);\n  for (let i = 0; i < recog.emits.length; i++) {\n    gestures[recog.emits[i]] = recog;\n  }\n}\n\n/**\n * @private\n * @param {string} evName Event name.\n * @return {Object} Returns the gesture for the given event name.\n */\nfunction _findRecognizerByEvent(evName) {\n  for (let i = 0, r; i < recognizers.length; i++) {\n    r = recognizers[i];\n    for (let j = 0, n; j < r.emits.length; j++) {\n      n = r.emits[j];\n      if (n === evName) {\n        return r;\n      }\n    }\n  }\n  return null;\n}\n\n/**\n * Sets scrolling direction on node.\n *\n * This value is checked on first move, thus it should be called prior to\n * adding event listeners.\n *\n * @param {!EventTarget} node Node to set touch action setting on\n * @param {string} value Touch action value\n * @return {void}\n */\nexport function setTouchAction(node, value) {\n  if (HAS_NATIVE_TA && node instanceof HTMLElement) {\n    // NOTE: add touchAction async so that events can be added in\n    // custom element constructors. Otherwise we run afoul of custom\n    // elements restriction against settings attributes (style) in the\n    // constructor.\n    microTask.run(() => {\n      node.style.touchAction = value;\n    });\n  }\n  node[TOUCH_ACTION] = value;\n}\n\n/**\n * Dispatches an event on the `target` element of `type` with the given\n * `detail`.\n * @private\n * @param {!EventTarget} target The element on which to fire an event.\n * @param {string} type The type of event to fire.\n * @param {!Object=} detail The detail object to populate on the event.\n * @return {void}\n */\nfunction _fire(target, type, detail) {\n  let ev = new Event(type, { bubbles: true, cancelable: true, composed: true });\n  ev.detail = detail;\n  target.dispatchEvent(ev);\n  // forward `preventDefault` in a clean way\n  if (ev.defaultPrevented) {\n    let preventer = detail.preventer || detail.sourceEvent;\n    if (preventer && preventer.preventDefault) {\n      preventer.preventDefault();\n    }\n  }\n}\n\n/**\n * Prevents the dispatch and default action of the given event name.\n *\n * @param {string} evName Event name.\n * @return {void}\n */\nexport function prevent(evName) {\n  let recognizer = _findRecognizerByEvent(evName);\n  if (recognizer.info) {\n    recognizer.info.prevent = true;\n  }\n}\n\n/**\n * Reset the 2500ms timeout on processing mouse input after detecting touch input.\n *\n * Touch inputs create synthesized mouse inputs anywhere from 0 to 2000ms after the touch.\n * This method should only be called during testing with simulated touch inputs.\n * Calling this method in production may cause duplicate taps or other Gestures.\n *\n * @return {void}\n */\nexport function resetMouseCanceller() {\n  if (POINTERSTATE.mouse.mouseIgnoreJob) {\n    POINTERSTATE.mouse.mouseIgnoreJob.flush();\n  }\n}\n\n/* eslint-disable valid-jsdoc */\n\nregister({\n  name: 'downup',\n  deps: ['mousedown', 'touchstart', 'touchend'],\n  flow: {\n    start: ['mousedown', 'touchstart'],\n    end: ['mouseup', 'touchend']\n  },\n  emits: ['down', 'up'],\n\n  info: {\n    movefn: null,\n    upfn: null\n  },\n\n  /**\n   * @this {GestureRecognizer}\n   * @return {void}\n   */\n  reset: function() {\n    untrackDocument(this.info);\n  },\n\n  /**\n   * @this {GestureRecognizer}\n   * @param {MouseEvent} e\n   * @return {void}\n   */\n  mousedown: function(e) {\n    if (!hasLeftMouseButton(e)) {\n      return;\n    }\n    let t = _findOriginalTarget(e);\n    let self = this;\n    let movefn = function movefn(e) {\n      if (!hasLeftMouseButton(e)) {\n        downupFire('up', t, e);\n        untrackDocument(self.info);\n      }\n    };\n    let upfn = function upfn(e) {\n      if (hasLeftMouseButton(e)) {\n        downupFire('up', t, e);\n      }\n      untrackDocument(self.info);\n    };\n    trackDocument(this.info, movefn, upfn);\n    downupFire('down', t, e);\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchstart: function(e) {\n    downupFire('down', _findOriginalTarget(e), e.changedTouches[0], e);\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchend: function(e) {\n    downupFire('up', _findOriginalTarget(e), e.changedTouches[0], e);\n  }\n});\n\n/**\n * @param {string} type\n * @param {EventTarget} target\n * @param {Event|Touch} event\n * @param {Event=} preventer\n * @return {void}\n */\nfunction downupFire(type, target, event, preventer) {\n  if (!target) {\n    return;\n  }\n  _fire(target, type, {\n    x: event.clientX,\n    y: event.clientY,\n    sourceEvent: event,\n    preventer: preventer,\n    prevent: function(e) {\n      return prevent(e);\n    }\n  });\n}\n\nregister({\n  name: 'track',\n  touchAction: 'none',\n  deps: ['mousedown', 'touchstart', 'touchmove', 'touchend'],\n  flow: {\n    start: ['mousedown', 'touchstart'],\n    end: ['mouseup', 'touchend']\n  },\n  emits: ['track'],\n\n  info: {\n    x: 0,\n    y: 0,\n    state: 'start',\n    started: false,\n    moves: [],\n    /** @this {GestureInfo} */\n    addMove: function(move) {\n      if (this.moves.length > TRACK_LENGTH) {\n        this.moves.shift();\n      }\n      this.moves.push(move);\n    },\n    movefn: null,\n    upfn: null,\n    prevent: false\n  },\n\n  /**\n   * @this {GestureRecognizer}\n   * @return {void}\n   */\n  reset: function() {\n    this.info.state = 'start';\n    this.info.started = false;\n    this.info.moves = [];\n    this.info.x = 0;\n    this.info.y = 0;\n    this.info.prevent = false;\n    untrackDocument(this.info);\n  },\n\n  /**\n   * @this {GestureRecognizer}\n   * @param {MouseEvent} e\n   * @return {void}\n   */\n  mousedown: function(e) {\n    if (!hasLeftMouseButton(e)) {\n      return;\n    }\n    let t = _findOriginalTarget(e);\n    let self = this;\n    let movefn = function movefn(e) {\n      let x = e.clientX, y = e.clientY;\n      if (trackHasMovedEnough(self.info, x, y)) {\n        // first move is 'start', subsequent moves are 'move', mouseup is 'end'\n        self.info.state = self.info.started ? (e.type === 'mouseup' ? 'end' : 'track') : 'start';\n        if (self.info.state === 'start') {\n          // if and only if tracking, always prevent tap\n          prevent('tap');\n        }\n        self.info.addMove({x: x, y: y});\n        if (!hasLeftMouseButton(e)) {\n          // always fire \"end\"\n          self.info.state = 'end';\n          untrackDocument(self.info);\n        }\n        if (t) {\n          trackFire(self.info, t, e);\n        }\n        self.info.started = true;\n      }\n    };\n    let upfn = function upfn(e) {\n      if (self.info.started) {\n        movefn(e);\n      }\n\n      // remove the temporary listeners\n      untrackDocument(self.info);\n    };\n    // add temporary document listeners as mouse retargets\n    trackDocument(this.info, movefn, upfn);\n    this.info.x = e.clientX;\n    this.info.y = e.clientY;\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchstart: function(e) {\n    let ct = e.changedTouches[0];\n    this.info.x = ct.clientX;\n    this.info.y = ct.clientY;\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchmove: function(e) {\n    let t = _findOriginalTarget(e);\n    let ct = e.changedTouches[0];\n    let x = ct.clientX, y = ct.clientY;\n    if (trackHasMovedEnough(this.info, x, y)) {\n      if (this.info.state === 'start') {\n        // if and only if tracking, always prevent tap\n        prevent('tap');\n      }\n      this.info.addMove({x: x, y: y});\n      trackFire(this.info, t, ct);\n      this.info.state = 'track';\n      this.info.started = true;\n    }\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchend: function(e) {\n    let t = _findOriginalTarget(e);\n    let ct = e.changedTouches[0];\n    // only trackend if track was started and not aborted\n    if (this.info.started) {\n      // reset started state on up\n      this.info.state = 'end';\n      this.info.addMove({x: ct.clientX, y: ct.clientY});\n      trackFire(this.info, t, ct);\n    }\n  }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction trackHasMovedEnough(info, x, y) {\n  if (info.prevent) {\n    return false;\n  }\n  if (info.started) {\n    return true;\n  }\n  let dx = Math.abs(info.x - x);\n  let dy = Math.abs(info.y - y);\n  return (dx >= TRACK_DISTANCE || dy >= TRACK_DISTANCE);\n}\n\n/**\n * @param {!GestureInfo} info\n * @param {?EventTarget} target\n * @param {Touch} touch\n * @return {void}\n */\nfunction trackFire(info, target, touch) {\n  if (!target) {\n    return;\n  }\n  let secondlast = info.moves[info.moves.length - 2];\n  let lastmove = info.moves[info.moves.length - 1];\n  let dx = lastmove.x - info.x;\n  let dy = lastmove.y - info.y;\n  let ddx, ddy = 0;\n  if (secondlast) {\n    ddx = lastmove.x - secondlast.x;\n    ddy = lastmove.y - secondlast.y;\n  }\n  _fire(target, 'track', {\n    state: info.state,\n    x: touch.clientX,\n    y: touch.clientY,\n    dx: dx,\n    dy: dy,\n    ddx: ddx,\n    ddy: ddy,\n    sourceEvent: touch,\n    hover: function() {\n      return deepTargetFind(touch.clientX, touch.clientY);\n    }\n  });\n}\n\nregister({\n  name: 'tap',\n  deps: ['mousedown', 'click', 'touchstart', 'touchend'],\n  flow: {\n    start: ['mousedown', 'touchstart'],\n    end: ['click', 'touchend']\n  },\n  emits: ['tap'],\n  info: {\n    x: NaN,\n    y: NaN,\n    prevent: false\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @return {void}\n   */\n  reset: function() {\n    this.info.x = NaN;\n    this.info.y = NaN;\n    this.info.prevent = false;\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {MouseEvent} e\n   * @return {void}\n   */\n  mousedown: function(e) {\n    if (hasLeftMouseButton(e)) {\n      this.info.x = e.clientX;\n      this.info.y = e.clientY;\n    }\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {MouseEvent} e\n   * @return {void}\n   */\n  click: function(e) {\n    if (hasLeftMouseButton(e)) {\n      trackForward(this.info, e);\n    }\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchstart: function(e) {\n    const touch = e.changedTouches[0];\n    this.info.x = touch.clientX;\n    this.info.y = touch.clientY;\n  },\n  /**\n   * @this {GestureRecognizer}\n   * @param {TouchEvent} e\n   * @return {void}\n   */\n  touchend: function(e) {\n    trackForward(this.info, e.changedTouches[0], e);\n  }\n});\n\n/**\n * @param {!GestureInfo} info\n * @param {Event | Touch} e\n * @param {Event=} preventer\n * @return {void}\n */\nfunction trackForward(info, e, preventer) {\n  let dx = Math.abs(e.clientX - info.x);\n  let dy = Math.abs(e.clientY - info.y);\n  // find original target from `preventer` for TouchEvents, or `e` for MouseEvents\n  let t = _findOriginalTarget((preventer || e));\n  if (!t || (canBeDisabled[/** @type {!HTMLElement} */(t).localName] && t.hasAttribute('disabled'))) {\n    return;\n  }\n  // dx,dy can be NaN if `click` has been simulated and there was no `down` for `start`\n  if (isNaN(dx) || isNaN(dy) || (dx <= TAP_DISTANCE && dy <= TAP_DISTANCE) || isSyntheticClick(e)) {\n    // prevent taps from being generated if an event has canceled them\n    if (!info.prevent) {\n      _fire(t, 'tap', {\n        x: e.clientX,\n        y: e.clientY,\n        sourceEvent: e,\n        preventer: preventer\n      });\n    }\n  }\n}\n\n/* eslint-enable valid-jsdoc */\n\n/** @deprecated */\nexport const findOriginalTarget = _findOriginalTarget;\n\n/** @deprecated */\nexport const add = addListener;\n\n/** @deprecated */\nexport const remove = removeListener;\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*/\nimport '../utils/boot.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { addListener, removeListener } from '../utils/gestures.js';\n\n/**\n * Element class mixin that provides API for adding Polymer's cross-platform\n * gesture events to nodes.\n *\n * The API is designed to be compatible with override points implemented\n * in `TemplateStamp` such that declarative event listeners in\n * templates will support gesture events when this mixin is applied along with\n * `TemplateStamp`.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin that provides API for adding Polymer's\n *   cross-platform\n * gesture events to nodes\n */\nexport const GestureEventListeners = dedupingMixin(\n    /**\n     * @template T\n     * @param {function(new:T)} superClass Class to apply mixin to.\n     * @return {function(new:T)} superClass with mixin applied.\n     */\n    (superClass) => {\n      /**\n       * @polymer\n       * @mixinClass\n       * @implements {Polymer_GestureEventListeners}\n       */\n      class GestureEventListeners extends superClass {\n        /**\n         * Add the event listener to the node if it is a gestures event.\n         *\n         * @param {!EventTarget} node Node to add event listener to\n         * @param {string} eventName Name of event\n         * @param {function(!Event):void} handler Listener function to add\n         * @return {void}\n         * @override\n         */\n        _addEventListenerToNode(node, eventName, handler) {\n          if (!addListener(node, eventName, handler)) {\n            super._addEventListenerToNode(node, eventName, handler);\n          }\n        }\n\n        /**\n         * Remove the event listener to the node if it is a gestures event.\n         *\n         * @param {!EventTarget} node Node to remove event listener from\n         * @param {string} eventName Name of event\n         * @param {function(!Event):void} handler Listener function to remove\n         * @return {void}\n         * @override\n         */\n        _removeEventListenerFromNode(node, eventName, handler) {\n          if (!removeListener(node, eventName, handler)) {\n            super._removeEventListenerFromNode(node, eventName, handler);\n          }\n        }\n      }\n\n      return GestureEventListeners;\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*/\nimport { PropertyAccessors } from './property-accessors.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\n\nconst HOST_DIR = /:host\\(:dir\\((ltr|rtl)\\)\\)/g;\nconst HOST_DIR_REPLACMENT = ':host([dir=\"$1\"])';\n\nconst EL_DIR = /([\\s\\w-#\\.\\[\\]\\*]*):dir\\((ltr|rtl)\\)/g;\nconst EL_DIR_REPLACMENT = ':host([dir=\"$2\"]) $1';\n\n/**\n * @type {!Array<!Polymer_DirMixin>}\n */\nconst DIR_INSTANCES = [];\n\n/** @type {MutationObserver} */\nlet observer = null;\n\nlet DOCUMENT_DIR = '';\n\nfunction getRTL() {\n  DOCUMENT_DIR = document.documentElement.getAttribute('dir');\n}\n\n/**\n * @param {!Polymer_DirMixin} instance Instance to set RTL status on\n */\nfunction setRTL(instance) {\n  if (!instance.__autoDirOptOut) {\n    const el = /** @type {!HTMLElement} */(instance);\n    el.setAttribute('dir', DOCUMENT_DIR);\n  }\n}\n\nfunction updateDirection() {\n  getRTL();\n  DOCUMENT_DIR = document.documentElement.getAttribute('dir');\n  for (let i = 0; i < DIR_INSTANCES.length; i++) {\n    setRTL(DIR_INSTANCES[i]);\n  }\n}\n\nfunction takeRecords() {\n  if (observer && observer.takeRecords().length) {\n    updateDirection();\n  }\n}\n\n/**\n * Element class mixin that allows elements to use the `:dir` CSS Selector to\n * have text direction specific styling.\n *\n * With this mixin, any stylesheet provided in the template will transform\n * `:dir` into `:host([dir])` and sync direction with the page via the\n * element's `dir` attribute.\n *\n * Elements can opt out of the global page text direction by setting the `dir`\n * attribute directly in `ready()` or in HTML.\n *\n * Caveats:\n * - Applications must set `<html dir=\"ltr\">` or `<html dir=\"rtl\">` to sync\n *   direction\n * - Automatic left-to-right or right-to-left styling is sync'd with the\n *   `<html>` element only.\n * - Changing `dir` at runtime is supported.\n * - Opting out of the global direction styling is permanent\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin PropertyAccessors\n */\nexport const DirMixin = dedupingMixin((base) => {\n\n  if (!observer) {\n    getRTL();\n    observer = new MutationObserver(updateDirection);\n    observer.observe(document.documentElement, {attributes: true, attributeFilter: ['dir']});\n  }\n\n  /**\n   * @constructor\n   * @extends {base}\n   * @implements {Polymer_PropertyAccessors}\n   * @private\n   */\n  const elementBase = PropertyAccessors(base);\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_DirMixin}\n   */\n  class Dir extends elementBase {\n\n    /**\n     * @override\n     * @suppress {missingProperties} Interfaces in closure do not inherit statics, but classes do\n     */\n    static _processStyleText(cssText, baseURI) {\n      cssText = super._processStyleText(cssText, baseURI);\n      cssText = this._replaceDirInCssText(cssText);\n      return cssText;\n    }\n\n    /**\n     * Replace `:dir` in the given CSS text\n     *\n     * @param {string} text CSS text to replace DIR\n     * @return {string} Modified CSS\n     */\n    static _replaceDirInCssText(text) {\n      let replacedText = text;\n      replacedText = replacedText.replace(HOST_DIR, HOST_DIR_REPLACMENT);\n      replacedText = replacedText.replace(EL_DIR, EL_DIR_REPLACMENT);\n      if (text !== replacedText) {\n        this.__activateDir = true;\n      }\n      return replacedText;\n    }\n\n    constructor() {\n      super();\n      /** @type {boolean} */\n      this.__autoDirOptOut = false;\n    }\n\n    /**\n     * @suppress {invalidCasts} Closure doesn't understand that `this` is an HTMLElement\n     * @return {void}\n     */\n    ready() {\n      super.ready();\n      this.__autoDirOptOut = /** @type {!HTMLElement} */(this).hasAttribute('dir');\n    }\n\n    /**\n     * @suppress {missingProperties} If it exists on elementBase, it can be super'd\n     * @return {void}\n     */\n    connectedCallback() {\n      if (elementBase.prototype.connectedCallback) {\n        super.connectedCallback();\n      }\n      if (this.constructor.__activateDir) {\n        takeRecords();\n        DIR_INSTANCES.push(this);\n        setRTL(this);\n      }\n    }\n\n    /**\n     * @suppress {missingProperties} If it exists on elementBase, it can be super'd\n     * @return {void}\n     */\n    disconnectedCallback() {\n      if (elementBase.prototype.disconnectedCallback) {\n        super.disconnectedCallback();\n      }\n      if (this.constructor.__activateDir) {\n        const idx = DIR_INSTANCES.indexOf(this);\n        if (idx > -1) {\n          DIR_INSTANCES.splice(idx, 1);\n        }\n      }\n    }\n  }\n\n  Dir.__activateDir = false;\n\n  return Dir;\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\nfunction resolve() {\n  document.body.removeAttribute('unresolved');\n}\n\nif (document.readyState === 'interactive' || document.readyState === 'complete') {\n  resolve();\n} else {\n  window.addEventListener('DOMContentLoaded', resolve);\n}\n\nexport {};\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*/\nimport './boot.js';\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(current, currentStart, currentEnd,\n                            old, oldStart, oldEnd) {\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  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    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 *\n * @param {!Array} current The current \"changed\" array for which to\n * calculate splices.\n * @param {number} currentStart Starting index in the `current` array for\n * which splices are calculated.\n * @param {number} currentEnd Ending index in the `current` array for\n * which splices are calculated.\n * @param {!Array} old The original \"unchanged\" array to compare `current`\n * against to determine splices.\n * @param {number} oldStart Starting index in the `old` array for\n * which splices are calculated.\n * @param {number} oldEnd Ending index in the `old` array for\n * which splices are calculated.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nfunction calcSplices(current, currentStart, currentEnd,\n                      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  if (currentEnd == current.length && oldEnd == old.length)\n    suffixCount = sharedSuffix(current, old, minLength - prefixCount);\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  if (currentStart == currentEnd) {\n    splice = newSplice(currentStart, [], 0);\n    while (oldStart < oldEnd)\n      splice.removed.push(old[oldStart++]);\n\n    return [ splice ];\n  } else if (oldStart == oldEnd)\n    return [ newSplice(currentStart, [], currentEnd - currentStart) ];\n\n  let ops = spliceOperationsFromEditDistances(\n      calcEditDistances(current, currentStart, currentEnd,\n                             old, oldStart, oldEnd));\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        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        splice.addedCount++;\n        index++;\n        break;\n      case EDIT_DELETE:\n        if (!splice)\n          splice = newSplice(index, [], 0);\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  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  return count;\n}\n\n/**\n * Returns an array of splice records indicating the minimum edits required\n * to transform the `previous` array into the `current` array.\n *\n * Splice records are ordered by index and contain the following fields:\n * - `index`: index where edit started\n * - `removed`: array of removed items from this index\n * - `addedCount`: number of items added at this index\n *\n * This function is based on the Levenshtein \"minimum edit distance\"\n * algorithm. Note that updates are treated as removal followed by addition.\n *\n * The worst-case time complexity of this algorithm is `O(l * p)`\n *   l: The length of the current array\n *   p: The length of the previous array\n *\n * However, the worst-case complexity is reduced by an `O(n)` optimization\n * to detect any shared prefix & suffix between the two arrays and only\n * perform the more expensive minimum edit distance calculation over the\n * non-shared portions of the arrays.\n *\n * @function\n * @param {!Array} current The \"changed\" array for which splices will be\n * calculated.\n * @param {!Array} previous The \"unchanged\" original array to compare\n * `current` against to determine the splices.\n * @return {!Array} Returns an array of splice record objects. Each of these\n * contains: `index` the location where the splice occurred; `removed`\n * the array of removed items from this location; `addedCount` the number\n * of items added at this location.\n */\nexport function calculateSplices(current, previous) {\n  return calcSplices(current, 0, current.length, previous, 0,\n                          previous.length);\n}\n\nfunction equals(currentValue, previousValue) {\n  return currentValue === previousValue;\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*/\nimport './boot.js';\n\nimport { calculateSplices } from './array-splice.js';\nimport { microTask } from './async.js';\n\n/**\n * Returns true if `node` is a slot element\n * @param {!Node} node Node to test.\n * @return {boolean} Returns true if the given `node` is a slot\n * @private\n */\nfunction isSlot(node) {\n  return (node.localName === 'slot');\n}\n\n/**\n * Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`. The list of flattened nodes consists\n * of a node's children and, for any children that are `<slot>` elements,\n * the expanded flattened list of `assignedNodes`.\n * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n * and the `<slot>` has one `<div>` assigned to it, then the flattened\n * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n * `<slot>` elements assigned to it, these are flattened as well.\n *\n * The provided `callback` is called whenever any change to this list\n * of flattened nodes occurs, where an addition or removal of a node is\n * considered a change. The `callback` is called with one argument, an object\n * containing an array of any `addedNodes` and `removedNodes`.\n *\n * Note: the callback is called asynchronous to any changes\n * at a microtask checkpoint. This is because observation is performed using\n * `MutationObserver` and the `<slot>` element's `slotchange` event which\n * are asynchronous.\n *\n * An example:\n * ```js\n * class TestSelfObserve extends PolymerElement {\n *   static get is() { return 'test-self-observe';}\n *   connectedCallback() {\n *     super.connectedCallback();\n *     this._observer = new FlattenedNodesObserver(this, (info) => {\n *       this.info = info;\n *     });\n *   }\n *   disconnectedCallback() {\n *     super.disconnectedCallback();\n *     this._observer.disconnect();\n *   }\n * }\n * customElements.define(TestSelfObserve.is, TestSelfObserve);\n * ```\n *\n * @summary Class that listens for changes (additions or removals) to\n * \"flattened nodes\" on a given `node`.\n */\nexport class FlattenedNodesObserver {\n\n  /**\n   * Returns the list of flattened nodes for the given `node`.\n   * This list consists of a node's children and, for any children\n   * that are `<slot>` elements, the expanded flattened list of `assignedNodes`.\n   * For example, if the observed node has children `<a></a><slot></slot><b></b>`\n   * and the `<slot>` has one `<div>` assigned to it, then the flattened\n   * nodes list is `<a></a><div></div><b></b>`. If the `<slot>` has other\n   * `<slot>` elements assigned to it, these are flattened as well.\n   *\n   * @param {!HTMLElement|!HTMLSlotElement} node The node for which to\n   *      return the list of flattened nodes.\n   * @return {!Array<!Node>} The list of flattened nodes for the given `node`.\n   * @nocollapse See https://github.com/google/closure-compiler/issues/2763\n   */\n  static getFlattenedNodes(node) {\n    if (isSlot(node)) {\n      node = /** @type {!HTMLSlotElement} */(node); // eslint-disable-line no-self-assign\n      return node.assignedNodes({flatten: true});\n    } else {\n      return Array.from(node.childNodes).map((node) => {\n        if (isSlot(node)) {\n          node = /** @type {!HTMLSlotElement} */(node); // eslint-disable-line no-self-assign\n          return node.assignedNodes({flatten: true});\n        } else {\n          return [node];\n        }\n      }).reduce((a, b) => a.concat(b), []);\n    }\n  }\n\n  /**\n   * @param {!HTMLElement} target Node on which to listen for changes.\n   * @param {?function(this: Element, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Function called when there are additions\n   * or removals from the target's list of flattened nodes.\n   */\n  constructor(target, callback) {\n    /**\n     * @type {MutationObserver}\n     * @private\n     */\n    this._shadyChildrenObserver = null;\n    /**\n     * @type {MutationObserver}\n     * @private\n     */\n    this._nativeChildrenObserver = null;\n    this._connected = false;\n    /**\n     * @type {!HTMLElement}\n     * @private\n     */\n    this._target = target;\n    this.callback = callback;\n    this._effectiveNodes = [];\n    this._observer = null;\n    this._scheduled = false;\n    /**\n     * @type {function()}\n     * @private\n     */\n    this._boundSchedule = () => {\n      this._schedule();\n    };\n    this.connect();\n    this._schedule();\n  }\n\n  /**\n   * Activates an observer. This method is automatically called when\n   * a `FlattenedNodesObserver` is created. It should only be called to\n   * re-activate an observer that has been deactivated via the `disconnect` method.\n   *\n   * @return {void}\n   */\n  connect() {\n    if (isSlot(this._target)) {\n      this._listenSlots([this._target]);\n    } else if (this._target.children) {\n      this._listenSlots(\n          /** @type {!NodeList<!Node>} */ (this._target.children));\n      if (window.ShadyDOM) {\n        this._shadyChildrenObserver =\n          ShadyDOM.observeChildren(this._target, (mutations) => {\n            this._processMutations(mutations);\n          });\n      } else {\n        this._nativeChildrenObserver =\n          new MutationObserver((mutations) => {\n            this._processMutations(mutations);\n          });\n        this._nativeChildrenObserver.observe(this._target, {childList: true});\n      }\n    }\n    this._connected = true;\n  }\n\n  /**\n   * Deactivates the flattened nodes observer. After calling this method\n   * the observer callback will not be called when changes to flattened nodes\n   * occur. The `connect` method may be subsequently called to reactivate\n   * the observer.\n   *\n   * @return {void}\n   */\n  disconnect() {\n    if (isSlot(this._target)) {\n      this._unlistenSlots([this._target]);\n    } else if (this._target.children) {\n      this._unlistenSlots(\n          /** @type {!NodeList<!Node>} */ (this._target.children));\n      if (window.ShadyDOM && this._shadyChildrenObserver) {\n        ShadyDOM.unobserveChildren(this._shadyChildrenObserver);\n        this._shadyChildrenObserver = null;\n      } else if (this._nativeChildrenObserver) {\n        this._nativeChildrenObserver.disconnect();\n        this._nativeChildrenObserver = null;\n      }\n    }\n    this._connected = false;\n  }\n\n  /**\n   * @return {void}\n   * @private\n   */\n  _schedule() {\n    if (!this._scheduled) {\n      this._scheduled = true;\n      microTask.run(() => this.flush());\n    }\n  }\n\n  /**\n   * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n   * @return {void}\n   * @private\n   */\n  _processMutations(mutations) {\n    this._processSlotMutations(mutations);\n    this.flush();\n  }\n\n  /**\n   * @param {Array<MutationRecord>} mutations Mutations signaled by the mutation observer\n   * @return {void}\n   * @private\n   */\n  _processSlotMutations(mutations) {\n    if (mutations) {\n      for (let i=0; i < mutations.length; i++) {\n        let mutation = mutations[i];\n        if (mutation.addedNodes) {\n          this._listenSlots(mutation.addedNodes);\n        }\n        if (mutation.removedNodes) {\n          this._unlistenSlots(mutation.removedNodes);\n        }\n      }\n    }\n  }\n\n  /**\n   * Flushes the observer causing any pending changes to be immediately\n   * delivered the observer callback. By default these changes are delivered\n   * asynchronously at the next microtask checkpoint.\n   *\n   * @return {boolean} Returns true if any pending changes caused the observer\n   * callback to run.\n   */\n  flush() {\n    if (!this._connected) {\n      return false;\n    }\n    if (window.ShadyDOM) {\n      ShadyDOM.flush();\n    }\n    if (this._nativeChildrenObserver) {\n      this._processSlotMutations(this._nativeChildrenObserver.takeRecords());\n    } else if (this._shadyChildrenObserver) {\n      this._processSlotMutations(this._shadyChildrenObserver.takeRecords());\n    }\n    this._scheduled = false;\n    let info = {\n      target: this._target,\n      addedNodes: [],\n      removedNodes: []\n    };\n    let newNodes = this.constructor.getFlattenedNodes(this._target);\n    let splices = calculateSplices(newNodes,\n      this._effectiveNodes);\n    // process removals\n    for (let i=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        info.removedNodes.push(n);\n      }\n    }\n    // process adds\n    for (let i=0, s; (i<splices.length) && (s=splices[i]); i++) {\n      for (let j=s.index; j < s.index + s.addedCount; j++) {\n        info.addedNodes.push(newNodes[j]);\n      }\n    }\n    // update cache\n    this._effectiveNodes = newNodes;\n    let didFlush = false;\n    if (info.addedNodes.length || info.removedNodes.length) {\n      didFlush = true;\n      this.callback.call(this._target, info);\n    }\n    return didFlush;\n  }\n\n  /**\n   * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n   * @return {void}\n   * @private\n   */\n  _listenSlots(nodeList) {\n    for (let i=0; i < nodeList.length; i++) {\n      let n = nodeList[i];\n      if (isSlot(n)) {\n        n.addEventListener('slotchange', this._boundSchedule);\n      }\n    }\n  }\n\n  /**\n   * @param {!Array<!Node>|!NodeList<!Node>} nodeList Nodes that could change\n   * @return {void}\n   * @private\n   */\n  _unlistenSlots(nodeList) {\n    for (let i=0; i < nodeList.length; i++) {\n      let n = nodeList[i];\n      if (isSlot(n)) {\n        n.removeEventListener('slotchange', this._boundSchedule);\n      }\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*/\nimport './boot.js';\n/* eslint-disable no-unused-vars */\nimport { Debouncer } from '../utils/debounce.js';  // used in type annotations\n/* eslint-enable no-unused-vars */\n\nlet debouncerQueue = [];\n\n/**\n * Adds a `Debouncer` to a list of globally flushable tasks.\n *\n * @param {!Debouncer} debouncer Debouncer to enqueue\n * @return {void}\n */\nexport const enqueueDebouncer = function(debouncer) {\n  debouncerQueue.push(debouncer);\n};\n\nfunction flushDebouncers() {\n  const didFlush = Boolean(debouncerQueue.length);\n  while (debouncerQueue.length) {\n    try {\n      debouncerQueue.shift().flush();\n    } catch(e) {\n      setTimeout(() => {\n        throw e;\n      });\n    }\n  }\n  return didFlush;\n}\n\n/**\n * Forces several classes of asynchronously queued tasks to flush:\n * - Debouncers added via `enqueueDebouncer`\n * - ShadyDOM distribution\n *\n * @return {void}\n */\nexport const flush = function() {\n  let shadyDOM, debouncers;\n  do {\n    shadyDOM = window.ShadyDOM && ShadyDOM.flush();\n    if (window.ShadyCSS && window.ShadyCSS.ScopingShim) {\n      window.ShadyCSS.ScopingShim.flush();\n    }\n    debouncers = flushDebouncers();\n  } while (shadyDOM || debouncers);\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*/\nimport '../utils/boot.js';\n\nimport '../utils/settings.js';\nimport { FlattenedNodesObserver } from '../utils/flattened-nodes-observer.js';\nexport { flush, enqueueDebouncer as addDebouncer } from '../utils/flush.js';\n/* eslint-disable no-unused-vars */\nimport { Debouncer } from '../utils/debounce.js';  // used in type annotations\n/* eslint-enable no-unused-vars */\n\nconst p = Element.prototype;\n/**\n * @const {function(this:Node, string): boolean}\n */\nconst normalizedMatchesSelector = p.matches || p.matchesSelector ||\n  p.mozMatchesSelector || p.msMatchesSelector ||\n  p.oMatchesSelector || p.webkitMatchesSelector;\n\n/**\n * Cross-platform `element.matches` shim.\n *\n * @function matchesSelector\n * @param {!Node} node Node to check selector against\n * @param {string} selector Selector to match\n * @return {boolean} True if node matched selector\n */\nexport const matchesSelector = function(node, selector) {\n  return normalizedMatchesSelector.call(node, selector);\n};\n\n/**\n * Node API wrapper class returned from `Polymer.dom.(target)` when\n * `target` is a `Node`.\n *\n */\nexport class DomApi {\n\n  /**\n   * @param {Node} node Node for which to create a Polymer.dom helper object.\n   */\n  constructor(node) {\n    this.node = node;\n  }\n\n  /**\n   * Returns an instance of `FlattenedNodesObserver` that\n   * listens for node changes on this element.\n   *\n   * @param {function(this:HTMLElement, { target: !HTMLElement, addedNodes: !Array<!Element>, removedNodes: !Array<!Element> }):void} callback Called when direct or distributed children\n   *   of this element changes\n   * @return {!FlattenedNodesObserver} Observer instance\n   */\n  observeNodes(callback) {\n    return new FlattenedNodesObserver(\n        /** @type {!HTMLElement} */(this.node), callback);\n  }\n\n  /**\n   * Disconnects an observer previously created via `observeNodes`\n   *\n   * @param {!FlattenedNodesObserver} observerHandle Observer instance\n   *   to disconnect.\n   * @return {void}\n   */\n  unobserveNodes(observerHandle) {\n    observerHandle.disconnect();\n  }\n\n  /**\n   * Provided as a backwards-compatible API only.  This method does nothing.\n   * @return {void}\n   */\n  notifyObserver() {}\n\n  /**\n   * Returns true if the provided node is contained with this element's\n   * light-DOM children or shadow root, including any nested shadow roots\n   * of children therein.\n   *\n   * @param {Node} node Node to test\n   * @return {boolean} Returns true if the given `node` is contained within\n   *   this element's light or shadow DOM.\n   */\n  deepContains(node) {\n    if (this.node.contains(node)) {\n      return true;\n    }\n    let n = node;\n    let doc = node.ownerDocument;\n    // walk from node to `this` or `document`\n    while (n && n !== doc && n !== this.node) {\n      // use logical parentnode, or native ShadowRoot host\n      n = n.parentNode || n.host;\n    }\n    return n === this.node;\n  }\n\n  /**\n   * Returns the root node of this node.  Equivalent to `getRootNode()`.\n   *\n   * @return {Node} Top most element in the dom tree in which the node\n   * exists. If the node is connected to a document this is either a\n   * shadowRoot or the document; otherwise, it may be the node\n   * itself or a node or document fragment containing it.\n   */\n  getOwnerRoot() {\n    return this.node.getRootNode();\n  }\n\n  /**\n   * For slot elements, returns the nodes assigned to the slot; otherwise\n   * an empty array. It is equivalent to `<slot>.addignedNodes({flatten:true})`.\n   *\n   * @return {!Array<!Node>} Array of assigned nodes\n   */\n  getDistributedNodes() {\n    return (this.node.localName === 'slot') ?\n      this.node.assignedNodes({flatten: true}) :\n      [];\n  }\n\n  /**\n   * Returns an array of all slots this element was distributed to.\n   *\n   * @return {!Array<!HTMLSlotElement>} Description\n   */\n  getDestinationInsertionPoints() {\n    let ip$ = [];\n    let n = this.node.assignedSlot;\n    while (n) {\n      ip$.push(n);\n      n = n.assignedSlot;\n    }\n    return ip$;\n  }\n\n  /**\n   * Calls `importNode` on the `ownerDocument` for this node.\n   *\n   * @param {!Node} node Node to import\n   * @param {boolean} deep True if the node should be cloned deeply during\n   *   import\n   * @return {Node} Clone of given node imported to this owner document\n   */\n  importNode(node, deep) {\n    let doc = this.node instanceof Document ? this.node :\n      this.node.ownerDocument;\n    return doc.importNode(node, deep);\n  }\n\n  /**\n   * @return {!Array<!Node>} Returns a flattened list of all child nodes and\n   * nodes assigned to child slots.\n   */\n  getEffectiveChildNodes() {\n    return FlattenedNodesObserver.getFlattenedNodes(\n        /** @type {!HTMLElement} */ (this.node));\n  }\n\n  /**\n   * Returns a filtered list of flattened child elements for this element based\n   * on the given selector.\n   *\n   * @param {string} selector Selector to filter nodes against\n   * @return {!Array<!HTMLElement>} List of flattened child elements\n   */\n  queryDistributedElements(selector) {\n    let c$ = this.getEffectiveChildNodes();\n    let list = [];\n    for (let i=0, l=c$.length, c; (i<l) && (c=c$[i]); i++) {\n      if ((c.nodeType === Node.ELEMENT_NODE) &&\n          matchesSelector(c, selector)) {\n        list.push(c);\n      }\n    }\n    return list;\n  }\n\n  /**\n   * For shadow roots, returns the currently focused element within this\n   * shadow root.\n   *\n   * @return {Node|undefined} Currently focused element\n   */\n  get activeElement() {\n    let node = this.node;\n    return node._activeElement !== undefined ? node._activeElement : node.activeElement;\n  }\n}\n\nfunction forwardMethods(proto, methods) {\n  for (let i=0; i < methods.length; i++) {\n    let method = methods[i];\n    /* eslint-disable valid-jsdoc */\n    proto[method] = /** @this {DomApi} */ function() {\n      return this.node[method].apply(this.node, arguments);\n    };\n    /* eslint-enable */\n  }\n}\n\nfunction forwardReadOnlyProperties(proto, properties) {\n  for (let i=0; i < properties.length; i++) {\n    let name = properties[i];\n    Object.defineProperty(proto, name, {\n      get: function() {\n        const domApi = /** @type {DomApi} */(this);\n        return domApi.node[name];\n      },\n      configurable: true\n    });\n  }\n}\n\nfunction forwardProperties(proto, properties) {\n  for (let i=0; i < properties.length; i++) {\n    let name = properties[i];\n    Object.defineProperty(proto, name, {\n      /**\n       * @this {DomApi}\n       * @return {*} .\n       */\n      get: function() {\n        return this.node[name];\n      },\n      /**\n       * @this {DomApi}\n       * @param {*} value .\n       */\n      set: function(value) {\n        this.node[name] = value;\n      },\n      configurable: true\n    });\n  }\n}\n\n\n/**\n * Event API wrapper class returned from `dom.(target)` when\n * `target` is an `Event`.\n */\nexport class EventApi {\n  constructor(event) {\n    this.event = event;\n  }\n\n  /**\n   * Returns the first node on the `composedPath` of this event.\n   *\n   * @return {!EventTarget} The node this event was dispatched to\n   */\n  get rootTarget() {\n    return this.event.composedPath()[0];\n  }\n\n  /**\n   * Returns the local (re-targeted) target for this event.\n   *\n   * @return {!EventTarget} The local (re-targeted) target for this event.\n   */\n  get localTarget() {\n    return this.event.target;\n  }\n\n  /**\n   * Returns the `composedPath` for this event.\n   * @return {!Array<!EventTarget>} The nodes this event propagated through\n   */\n  get path() {\n    return this.event.composedPath();\n  }\n}\n\n/**\n * @function\n * @param {boolean=} deep\n * @return {!Node}\n */\nDomApi.prototype.cloneNode;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApi.prototype.appendChild;\n/**\n * @function\n * @param {!Node} newChild\n * @param {Node} refChild\n * @return {!Node}\n */\nDomApi.prototype.insertBefore;\n/**\n * @function\n * @param {!Node} node\n * @return {!Node}\n */\nDomApi.prototype.removeChild;\n/**\n * @function\n * @param {!Node} oldChild\n * @param {!Node} newChild\n * @return {!Node}\n */\nDomApi.prototype.replaceChild;\n/**\n * @function\n * @param {string} name\n * @param {string} value\n * @return {void}\n */\nDomApi.prototype.setAttribute;\n/**\n * @function\n * @param {string} name\n * @return {void}\n */\nDomApi.prototype.removeAttribute;\n/**\n * @function\n * @param {string} selector\n * @return {?Element}\n */\nDomApi.prototype.querySelector;\n/**\n * @function\n * @param {string} selector\n * @return {!NodeList<!Element>}\n */\nDomApi.prototype.querySelectorAll;\n\n/** @type {?Node} */\nDomApi.prototype.parentNode;\n/** @type {?Node} */\nDomApi.prototype.firstChild;\n/** @type {?Node} */\nDomApi.prototype.lastChild;\n/** @type {?Node} */\nDomApi.prototype.nextSibling;\n/** @type {?Node} */\nDomApi.prototype.previousSibling;\n/** @type {?HTMLElement} */\nDomApi.prototype.firstElementChild;\n/** @type {?HTMLElement} */\nDomApi.prototype.lastElementChild;\n/** @type {?HTMLElement} */\nDomApi.prototype.nextElementSibling;\n/** @type {?HTMLElement} */\nDomApi.prototype.previousElementSibling;\n/** @type {!Array<!Node>} */\nDomApi.prototype.childNodes;\n/** @type {!Array<!HTMLElement>} */\nDomApi.prototype.children;\n/** @type {?DOMTokenList} */\nDomApi.prototype.classList;\n\n/** @type {string} */\nDomApi.prototype.textContent;\n/** @type {string} */\nDomApi.prototype.innerHTML;\n\nforwardMethods(DomApi.prototype, [\n  'cloneNode', 'appendChild', 'insertBefore', 'removeChild',\n  'replaceChild', 'setAttribute', 'removeAttribute',\n  'querySelector', 'querySelectorAll'\n]);\n\nforwardReadOnlyProperties(DomApi.prototype, [\n  'parentNode', 'firstChild', 'lastChild',\n  'nextSibling', 'previousSibling', 'firstElementChild',\n  'lastElementChild', 'nextElementSibling', 'previousElementSibling',\n  'childNodes', 'children', 'classList'\n]);\n\nforwardProperties(DomApi.prototype, [\n  'textContent', 'innerHTML'\n]);\n\n/**\n * Legacy DOM and Event manipulation API wrapper factory used to abstract\n * differences between native Shadow DOM and \"Shady DOM\" when polyfilling on\n * older browsers.\n *\n * Note that in Polymer 2.x use of `Polymer.dom` is no longer required and\n * in the majority of cases simply facades directly to the standard native\n * API.\n *\n * @summary Legacy DOM and Event manipulation API wrapper factory used to\n * abstract differences between native Shadow DOM and \"Shady DOM.\"\n * @param {(Node|Event)=} obj Node or event to operate on\n * @return {!DomApi|!EventApi} Wrapper providing either node API or event API\n */\nexport const dom = function(obj) {\n  obj = obj || document;\n  if (!obj.__domApi) {\n    let helper;\n    if (obj instanceof Event) {\n      helper = new EventApi(obj);\n    } else {\n      helper = new DomApi(obj);\n    }\n    obj.__domApi = helper;\n  }\n  return obj.__domApi;\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*/\nimport '@webcomponents/shadycss/entrypoints/apply-shim.js';\n\nimport { ElementMixin } from '../mixins/element-mixin.js';\nimport { GestureEventListeners } from '../mixins/gesture-event-listeners.js';\nimport { DirMixin } from '../mixins/dir-mixin.js';\nimport { dedupingMixin } from '../utils/mixin.js';\nimport '../utils/render-status.js';\nimport '../utils/unresolved.js';\nimport { dom, matchesSelector } from './polymer.dom.js';\nimport { setTouchAction } from '../utils/gestures.js';\nimport { Debouncer } from '../utils/debounce.js';\nimport { timeOut, microTask } from '../utils/async.js';\nimport { get } from '../utils/path.js';\n\nlet styleInterface = window.ShadyCSS;\n\n/**\n * Element class mixin that provides Polymer's \"legacy\" API intended to be\n * backward-compatible to the greatest extent possible with the API\n * found on the Polymer 1.x `Polymer.Base` prototype applied to all elements\n * defined using the `Polymer({...})` function.\n *\n * @mixinFunction\n * @polymer\n * @appliesMixin ElementMixin\n * @appliesMixin GestureEventListeners\n * @property isAttached {boolean} Set to `true` in this element's\n *   `connectedCallback` and `false` in `disconnectedCallback`\n * @summary Element class mixin that provides Polymer's \"legacy\" API\n */\nexport const LegacyElementMixin = dedupingMixin((base) => {\n\n  /**\n   * @constructor\n   * @extends {base}\n   * @implements {Polymer_ElementMixin}\n   * @implements {Polymer_GestureEventListeners}\n   * @implements {Polymer_DirMixin}\n   * @private\n   */\n  const legacyElementBase = DirMixin(GestureEventListeners(ElementMixin(base)));\n\n  /**\n   * Map of simple names to touch action names\n   * @dict\n   */\n  const DIRECTION_MAP = {\n    'x': 'pan-x',\n    'y': 'pan-y',\n    'none': 'none',\n    'all': 'auto'\n  };\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @extends {legacyElementBase}\n   * @implements {Polymer_LegacyElementMixin}\n   * @unrestricted\n   */\n  class LegacyElement extends legacyElementBase {\n\n    constructor() {\n      super();\n      /** @type {boolean} */\n      this.isAttached;\n      /** @type {WeakMap<!Element, !Object<string, !Function>>} */\n      this.__boundListeners;\n      /** @type {Object<string, Function>} */\n      this._debouncers;\n      // Ensure listeners are applied immediately so that they are\n      // added before declarative event listeners. This allows an element to\n      // decorate itself via an event prior to any declarative listeners\n      // seeing the event. Note, this ensures compatibility with 1.x ordering.\n      this._applyListeners();\n    }\n\n    /**\n     * Forwards `importMeta` from the prototype (i.e. from the info object\n     * passed to `Polymer({...})`) to the static API.\n     *\n     * @return {!Object} The `import.meta` object set on the prototype\n     * @suppress {missingProperties} `this` is always in the instance in\n     *  closure for some reason even in a static method, rather than the class\n     */\n    static get importMeta() {\n      return this.prototype.importMeta;\n    }\n\n    /**\n     * Legacy callback called during the `constructor`, for overriding\n     * by the user.\n     * @return {void}\n     */\n    created() {}\n\n    /**\n     * Provides an implementation of `connectedCallback`\n     * which adds Polymer legacy API's `attached` method.\n     * @return {void}\n     * @override\n     */\n    connectedCallback() {\n      super.connectedCallback();\n      this.isAttached = true;\n      this.attached();\n    }\n\n    /**\n     * Legacy callback called during `connectedCallback`, for overriding\n     * by the user.\n     * @return {void}\n     */\n    attached() {}\n\n    /**\n     * Provides an implementation of `disconnectedCallback`\n     * which adds Polymer legacy API's `detached` method.\n     * @return {void}\n     * @override\n     */\n    disconnectedCallback() {\n      super.disconnectedCallback();\n      this.isAttached = false;\n      this.detached();\n    }\n\n    /**\n     * Legacy callback called during `disconnectedCallback`, for overriding\n     * by the user.\n     * @return {void}\n     */\n    detached() {}\n\n    /**\n     * Provides an override implementation of `attributeChangedCallback`\n     * which adds the Polymer legacy API's `attributeChanged` method.\n     * @param {string} name Name of attribute.\n     * @param {?string} old Old value of attribute.\n     * @param {?string} value Current value of attribute.\n     * @param {?string} namespace Attribute namespace.\n     * @return {void}\n     * @override\n     */\n    attributeChangedCallback(name, old, value, namespace) {\n      if (old !== value) {\n        super.attributeChangedCallback(name, old, value, namespace);\n        this.attributeChanged(name, old, value);\n      }\n    }\n\n    /**\n     * Legacy callback called during `attributeChangedChallback`, for overriding\n     * by the user.\n     * @param {string} name Name of attribute.\n     * @param {?string} old Old value of attribute.\n     * @param {?string} value Current value of attribute.\n     * @return {void}\n     */\n    attributeChanged(name, old, value) {} // eslint-disable-line no-unused-vars\n\n    /**\n     * Overrides the default `Polymer.PropertyEffects` implementation to\n     * add support for class initialization via the `_registered` callback.\n     * This is called only when the first instance of the element is created.\n     *\n     * @return {void}\n     * @override\n     * @suppress {invalidCasts}\n     */\n    _initializeProperties() {\n      let proto = Object.getPrototypeOf(this);\n      if (!proto.hasOwnProperty('__hasRegisterFinished')) {\n        proto.__hasRegisterFinished = true;\n        this._registered();\n      }\n      super._initializeProperties();\n      this.root = /** @type {HTMLElement} */(this);\n      this.created();\n    }\n\n    /**\n     * Called automatically when an element is initializing.\n     * Users may override this method to perform class registration time\n     * work. The implementation should ensure the work is performed\n     * only once for the class.\n     * @protected\n     * @return {void}\n     */\n    _registered() {}\n\n    /**\n     * Overrides the default `Polymer.PropertyEffects` implementation to\n     * add support for installing `hostAttributes` and `listeners`.\n     *\n     * @return {void}\n     * @override\n     */\n    ready() {\n      this._ensureAttributes();\n      super.ready();\n    }\n\n    /**\n     * Ensures an element has required attributes. Called when the element\n     * is being readied via `ready`. Users should override to set the\n     * element's required attributes. The implementation should be sure\n     * to check and not override existing attributes added by\n     * the user of the element. Typically, setting attributes should be left\n     * to the element user and not done here; reasonable exceptions include\n     * setting aria roles and focusability.\n     * @protected\n     * @return {void}\n     */\n    _ensureAttributes() {}\n\n    /**\n     * Adds element event listeners. Called when the element\n     * is being readied via `ready`. Users should override to\n     * add any required element event listeners.\n     * In performance critical elements, the work done here should be kept\n     * to a minimum since it is done before the element is rendered. In\n     * these elements, consider adding listeners asynchronously so as not to\n     * block render.\n     * @protected\n     * @return {void}\n     */\n    _applyListeners() {}\n\n    /**\n     * Converts a typed JavaScript value to a string.\n     *\n     * Note this method is provided as backward-compatible legacy API\n     * only.  It is not directly called by any Polymer features. To customize\n     * how properties are serialized to attributes for attribute bindings and\n     * `reflectToAttribute: true` properties as well as this method, override\n     * the `_serializeValue` method provided by `Polymer.PropertyAccessors`.\n     *\n     * @param {*} value Value to deserialize\n     * @return {string | undefined} Serialized value\n     */\n    serialize(value) {\n      return this._serializeValue(value);\n    }\n\n    /**\n     * Converts a string to a typed JavaScript value.\n     *\n     * Note this method is provided as backward-compatible legacy API\n     * only.  It is not directly called by any Polymer features.  To customize\n     * how attributes are deserialized to properties for in\n     * `attributeChangedCallback`, override `_deserializeValue` method\n     * provided by `Polymer.PropertyAccessors`.\n     *\n     * @param {string} value String to deserialize\n     * @param {*} type Type to deserialize the string to\n     * @return {*} Returns the deserialized value in the `type` given.\n     */\n    deserialize(value, type) {\n      return this._deserializeValue(value, type);\n    }\n\n    /**\n     * Serializes a property to its associated attribute.\n     *\n     * Note this method is provided as backward-compatible legacy API\n     * only.  It is not directly called by any Polymer features.\n     *\n     * @param {string} property Property name to reflect.\n     * @param {string=} attribute Attribute name to reflect.\n     * @param {*=} value Property value to reflect.\n     * @return {void}\n     */\n    reflectPropertyToAttribute(property, attribute, value) {\n      this._propertyToAttribute(property, attribute, value);\n    }\n\n    /**\n     * Sets a typed value to an HTML attribute on a node.\n     *\n     * Note this method is provided as backward-compatible legacy API\n     * only.  It is not directly called by any Polymer features.\n     *\n     * @param {*} value Value to serialize.\n     * @param {string} attribute Attribute name to serialize to.\n     * @param {Element} node Element to set attribute to.\n     * @return {void}\n     */\n    serializeValueToAttribute(value, attribute, node) {\n      this._valueToNodeAttribute(/** @type {Element} */ (node || this), value, attribute);\n    }\n\n    /**\n     * Copies own properties (including accessor descriptors) from a source\n     * object to a target object.\n     *\n     * @param {Object} prototype Target object to copy properties to.\n     * @param {Object} api Source object to copy properties from.\n     * @return {Object} prototype object that was passed as first argument.\n     */\n    extend(prototype, api) {\n      if (!(prototype && api)) {\n        return prototype || api;\n      }\n      let n$ = Object.getOwnPropertyNames(api);\n      for (let i=0, n; (i<n$.length) && (n=n$[i]); i++) {\n        let pd = Object.getOwnPropertyDescriptor(api, n);\n        if (pd) {\n          Object.defineProperty(prototype, n, pd);\n        }\n      }\n      return prototype;\n    }\n\n    /**\n     * Copies props from a source object to a target object.\n     *\n     * Note, this method uses a simple `for...in` strategy for enumerating\n     * properties.  To ensure only `ownProperties` are copied from source\n     * to target and that accessor implementations are copied, use `extend`.\n     *\n     * @param {!Object} target Target object to copy properties to.\n     * @param {!Object} source Source object to copy properties from.\n     * @return {!Object} Target object that was passed as first argument.\n     */\n    mixin(target, source) {\n      for (let i in source) {\n        target[i] = source[i];\n      }\n      return target;\n    }\n\n    /**\n     * Sets the prototype of an object.\n     *\n     * Note this method is provided as backward-compatible legacy API\n     * only.  It is not directly called by any Polymer features.\n     * @param {Object} object The object on which to set the prototype.\n     * @param {Object} prototype The prototype that will be set on the given\n     * `object`.\n     * @return {Object} Returns the given `object` with its prototype set\n     * to the given `prototype` object.\n     */\n    chainObject(object, prototype) {\n      if (object && prototype && object !== prototype) {\n        object.__proto__ = prototype;\n      }\n      return object;\n    }\n\n    /* **** Begin Template **** */\n\n    /**\n     * Calls `importNode` on the `content` of the `template` specified and\n     * returns a document fragment containing the imported content.\n     *\n     * @param {HTMLTemplateElement} template HTML template element to instance.\n     * @return {!DocumentFragment} Document fragment containing the imported\n     *   template content.\n    */\n    instanceTemplate(template) {\n      let content = this.constructor._contentForTemplate(template);\n      let dom = /** @type {!DocumentFragment} */\n        (document.importNode(content, true));\n      return dom;\n    }\n\n    /* **** Begin Events **** */\n\n\n\n    /**\n     * Dispatches a custom event with an optional detail value.\n     *\n     * @param {string} type Name of event type.\n     * @param {*=} detail Detail value containing event-specific\n     *   payload.\n     * @param {{ bubbles: (boolean|undefined), cancelable: (boolean|undefined), composed: (boolean|undefined) }=}\n     *  options Object specifying options.  These may include:\n     *  `bubbles` (boolean, defaults to `true`),\n     *  `cancelable` (boolean, defaults to false), and\n     *  `node` on which to fire the event (HTMLElement, defaults to `this`).\n     * @return {!Event} The new event that was fired.\n     */\n    fire(type, detail, options) {\n      options = options || {};\n      detail = (detail === null || detail === undefined) ? {} : detail;\n      let event = new Event(type, {\n        bubbles: options.bubbles === undefined ? true : options.bubbles,\n        cancelable: Boolean(options.cancelable),\n        composed: options.composed === undefined ? true: options.composed\n      });\n      event.detail = detail;\n      let node = options.node || this;\n      node.dispatchEvent(event);\n      return event;\n    }\n\n    /**\n     * Convenience method to add an event listener on a given element,\n     * late bound to a named method on this element.\n     *\n     * @param {?EventTarget} node Element to add event listener to.\n     * @param {string} eventName Name of event to listen for.\n     * @param {string} methodName Name of handler method on `this` to call.\n     * @return {void}\n     */\n    listen(node, eventName, methodName) {\n      node = /** @type {!EventTarget} */ (node || this);\n      let hbl = this.__boundListeners ||\n        (this.__boundListeners = new WeakMap());\n      let bl = hbl.get(node);\n      if (!bl) {\n        bl = {};\n        hbl.set(node, bl);\n      }\n      let key = eventName + methodName;\n      if (!bl[key]) {\n        bl[key] = this._addMethodEventListenerToNode(\n          node, eventName, methodName, this);\n      }\n    }\n\n    /**\n     * Convenience method to remove an event listener from a given element,\n     * late bound to a named method on this element.\n     *\n     * @param {?EventTarget} node Element to remove event listener from.\n     * @param {string} eventName Name of event to stop listening to.\n     * @param {string} methodName Name of handler method on `this` to not call\n     anymore.\n     * @return {void}\n     */\n    unlisten(node, eventName, methodName) {\n      node = /** @type {!EventTarget} */ (node || this);\n      let bl = this.__boundListeners && this.__boundListeners.get(node);\n      let key = eventName + methodName;\n      let handler = bl && bl[key];\n      if (handler) {\n        this._removeEventListenerFromNode(node, eventName, handler);\n        bl[key] = null;\n      }\n    }\n\n    /**\n     * Override scrolling behavior to all direction, one direction, or none.\n     *\n     * Valid scroll directions:\n     *   - 'all': scroll in any direction\n     *   - 'x': scroll only in the 'x' direction\n     *   - 'y': scroll only in the 'y' direction\n     *   - 'none': disable scrolling for this node\n     *\n     * @param {string=} direction Direction to allow scrolling\n     * Defaults to `all`.\n     * @param {Element=} node Element to apply scroll direction setting.\n     * Defaults to `this`.\n     * @return {void}\n     */\n    setScrollDirection(direction, node) {\n      setTouchAction(/** @type {Element} */ (node || this), DIRECTION_MAP[direction] || 'auto');\n    }\n    /* **** End Events **** */\n\n    /**\n     * Convenience method to run `querySelector` on this local DOM scope.\n     *\n     * This function calls `Polymer.dom(this.root).querySelector(slctr)`.\n     *\n     * @param {string} slctr Selector to run on this local DOM scope\n     * @return {Element} Element found by the selector, or null if not found.\n     */\n    $$(slctr) {\n      return this.root.querySelector(slctr);\n    }\n\n    /**\n     * Return the element whose local dom within which this element\n     * is contained. This is a shorthand for\n     * `this.getRootNode().host`.\n     * @this {Element}\n     */\n    get domHost() {\n      let root = this.getRootNode();\n      return (root instanceof DocumentFragment) ? /** @type {ShadowRoot} */ (root).host : root;\n    }\n\n    /**\n     * Force this element to distribute its children to its local dom.\n     * This should not be necessary as of Polymer 2.0.2 and is provided only\n     * for backwards compatibility.\n     * @return {void}\n     */\n    distributeContent() {\n      if (window.ShadyDOM && this.shadowRoot) {\n        ShadyDOM.flush();\n      }\n    }\n\n    /**\n     * Returns a list of nodes that are the effective childNodes. The effective\n     * childNodes list is the same as the element's childNodes except that\n     * any `<content>` elements are replaced with the list of nodes distributed\n     * to the `<content>`, the result of its `getDistributedNodes` method.\n     * @return {!Array<!Node>} List of effective child nodes.\n     * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement\n     */\n    getEffectiveChildNodes() {\n      const thisEl = /** @type {Element} */ (this);\n      const domApi = /** @type {DomApi} */(dom(thisEl));\n      return domApi.getEffectiveChildNodes();\n    }\n\n    /**\n     * Returns a list of nodes distributed within this element that match\n     * `selector`. These can be dom children or elements distributed to\n     * children that are insertion points.\n     * @param {string} selector Selector to run.\n     * @return {!Array<!Node>} List of distributed elements that match selector.\n     * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement\n     */\n    queryDistributedElements(selector) {\n      const thisEl = /** @type {Element} */ (this);\n      const domApi = /** @type {DomApi} */(dom(thisEl));\n      return domApi.queryDistributedElements(selector);\n    }\n\n    /**\n     * Returns a list of elements that are the effective children. The effective\n     * children list is the same as the element's children except that\n     * any `<content>` elements are replaced with the list of elements\n     * distributed to the `<content>`.\n     *\n     * @return {!Array<!Node>} List of effective children.\n     */\n    getEffectiveChildren() {\n      let list = this.getEffectiveChildNodes();\n      return list.filter(function(/** @type {!Node} */ n) {\n        return (n.nodeType === Node.ELEMENT_NODE);\n      });\n    }\n\n    /**\n     * Returns a string of text content that is the concatenation of the\n     * text content's of the element's effective childNodes (the elements\n     * returned by <a href=\"#getEffectiveChildNodes>getEffectiveChildNodes</a>.\n     *\n     * @return {string} List of effective children.\n     */\n    getEffectiveTextContent() {\n      let cn = this.getEffectiveChildNodes();\n      let tc = [];\n      for (let i=0, c; (c = cn[i]); i++) {\n        if (c.nodeType !== Node.COMMENT_NODE) {\n          tc.push(c.textContent);\n        }\n      }\n      return tc.join('');\n    }\n\n    /**\n     * Returns the first effective childNode within this element that\n     * match `selector`. These can be dom child nodes or elements distributed\n     * to children that are insertion points.\n     * @param {string} selector Selector to run.\n     * @return {Node} First effective child node that matches selector.\n     */\n    queryEffectiveChildren(selector) {\n      let e$ = this.queryDistributedElements(selector);\n      return e$ && e$[0];\n    }\n\n    /**\n     * Returns a list of effective childNodes within this element that\n     * match `selector`. These can be dom child nodes or elements distributed\n     * to children that are insertion points.\n     * @param {string} selector Selector to run.\n     * @return {!Array<!Node>} List of effective child nodes that match selector.\n     */\n    queryAllEffectiveChildren(selector) {\n      return this.queryDistributedElements(selector);\n    }\n\n    /**\n     * Returns a list of nodes distributed to this element's `<slot>`.\n     *\n     * If this element contains more than one `<slot>` in its local DOM,\n     * an optional selector may be passed to choose the desired content.\n     *\n     * @param {string=} slctr CSS selector to choose the desired\n     *   `<slot>`.  Defaults to `content`.\n     * @return {!Array<!Node>} List of distributed nodes for the `<slot>`.\n     */\n    getContentChildNodes(slctr) {\n      let content = this.root.querySelector(slctr || 'slot');\n      return content ? /** @type {DomApi} */(dom(content)).getDistributedNodes() : [];\n    }\n\n    /**\n     * Returns a list of element children distributed to this element's\n     * `<slot>`.\n     *\n     * If this element contains more than one `<slot>` in its\n     * local DOM, an optional selector may be passed to choose the desired\n     * content.  This method differs from `getContentChildNodes` in that only\n     * elements are returned.\n     *\n     * @param {string=} slctr CSS selector to choose the desired\n     *   `<content>`.  Defaults to `content`.\n     * @return {!Array<!HTMLElement>} List of distributed nodes for the\n     *   `<slot>`.\n     * @suppress {invalidCasts}\n     */\n    getContentChildren(slctr) {\n      let children = /** @type {!Array<!HTMLElement>} */(this.getContentChildNodes(slctr).filter(function(n) {\n        return (n.nodeType === Node.ELEMENT_NODE);\n      }));\n      return children;\n    }\n\n    /**\n     * Checks whether an element is in this element's light DOM tree.\n     *\n     * @param {?Node} node The element to be checked.\n     * @return {boolean} true if node is in this element's light DOM tree.\n     * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement\n     */\n    isLightDescendant(node) {\n      const thisNode = /** @type {Node} */ (this);\n      return thisNode !== node && thisNode.contains(node) &&\n        thisNode.getRootNode() === node.getRootNode();\n    }\n\n    /**\n     * Checks whether an element is in this element's local DOM tree.\n     *\n     * @param {!Element} node The element to be checked.\n     * @return {boolean} true if node is in this element's local DOM tree.\n     */\n    isLocalDescendant(node) {\n      return this.root === node.getRootNode();\n    }\n\n    /**\n     * No-op for backwards compatibility. This should now be handled by\n     * ShadyCss library.\n     * @param  {*} container Unused\n     * @param  {*} shouldObserve Unused\n     * @return {void}\n     */\n    scopeSubtree(container, shouldObserve) { // eslint-disable-line no-unused-vars\n    }\n\n    /**\n     * Returns the computed style value for the given property.\n     * @param {string} property The css property name.\n     * @return {string} Returns the computed css property value for the given\n     * `property`.\n     * @suppress {invalidCasts} LegacyElementMixin must be applied to an HTMLElement\n     */\n    getComputedStyleValue(property) {\n      return styleInterface.getComputedStyleValue(/** @type {!Element} */(this), property);\n    }\n\n    // debounce\n\n    /**\n     * Call `debounce` to collapse multiple requests for a named task into\n     * one invocation which is made after the wait time has elapsed with\n     * no new request.  If no wait time is given, the callback will be called\n     * at microtask timing (guaranteed before paint).\n     *\n     *     debouncedClickAction(e) {\n     *       // will not call `processClick` more than once per 100ms\n     *       this.debounce('click', function() {\n     *        this.processClick();\n     *       } 100);\n     *     }\n     *\n     * @param {string} jobName String to identify the debounce job.\n     * @param {function():void} callback Function that is called (with `this`\n     *   context) when the wait time elapses.\n     * @param {number} wait Optional wait time in milliseconds (ms) after the\n     *   last signal that must elapse before invoking `callback`\n     * @return {!Object} Returns a debouncer object on which exists the\n     * following methods: `isActive()` returns true if the debouncer is\n     * active; `cancel()` cancels the debouncer if it is active;\n     * `flush()` immediately invokes the debounced callback if the debouncer\n     * is active.\n     */\n    debounce(jobName, callback, wait) {\n      this._debouncers = this._debouncers || {};\n      return this._debouncers[jobName] = Debouncer.debounce(\n            this._debouncers[jobName]\n          , wait > 0 ? timeOut.after(wait) : microTask\n          , callback.bind(this));\n    }\n\n    /**\n     * Returns whether a named debouncer is active.\n     *\n     * @param {string} jobName The name of the debouncer started with `debounce`\n     * @return {boolean} Whether the debouncer is active (has not yet fired).\n     */\n    isDebouncerActive(jobName) {\n      this._debouncers = this._debouncers || {};\n      let debouncer = this._debouncers[jobName];\n      return !!(debouncer && debouncer.isActive());\n    }\n\n    /**\n     * Immediately calls the debouncer `callback` and inactivates it.\n     *\n     * @param {string} jobName The name of the debouncer started with `debounce`\n     * @return {void}\n     */\n    flushDebouncer(jobName) {\n      this._debouncers = this._debouncers || {};\n      let debouncer = this._debouncers[jobName];\n      if (debouncer) {\n        debouncer.flush();\n      }\n    }\n\n    /**\n     * Cancels an active debouncer.  The `callback` will not be called.\n     *\n     * @param {string} jobName The name of the debouncer started with `debounce`\n     * @return {void}\n     */\n    cancelDebouncer(jobName) {\n      this._debouncers = this._debouncers || {};\n      let debouncer = this._debouncers[jobName];\n      if (debouncer) {\n        debouncer.cancel();\n      }\n    }\n\n    /**\n     * Runs a callback function asynchronously.\n     *\n     * By default (if no waitTime is specified), async callbacks are run at\n     * microtask timing, which will occur before paint.\n     *\n     * @param {!Function} callback The callback function to run, bound to `this`.\n     * @param {number=} waitTime Time to wait before calling the\n     *   `callback`.  If unspecified or 0, the callback will be run at microtask\n     *   timing (before paint).\n     * @return {number} Handle that may be used to cancel the async job.\n     */\n    async(callback, waitTime) {\n      return waitTime > 0 ? timeOut.run(callback.bind(this), waitTime) :\n          ~microTask.run(callback.bind(this));\n    }\n\n    /**\n     * Cancels an async operation started with `async`.\n     *\n     * @param {number} handle Handle returned from original `async` call to\n     *   cancel.\n     * @return {void}\n     */\n    cancelAsync(handle) {\n      handle < 0 ? microTask.cancel(~handle) :\n          timeOut.cancel(handle);\n    }\n\n    // other\n\n    /**\n     * Convenience method for creating an element and configuring it.\n     *\n     * @param {string} tag HTML element tag to create.\n     * @param {Object=} props Object of properties to configure on the\n     *    instance.\n     * @return {!Element} Newly created and configured element.\n     */\n    create(tag, props) {\n      let elt = document.createElement(tag);\n      if (props) {\n        if (elt.setProperties) {\n          elt.setProperties(props);\n        } else {\n          for (let n in props) {\n            elt[n] = props[n];\n          }\n        }\n      }\n      return elt;\n    }\n\n    /**\n     * Polyfill for Element.prototype.matches, which is sometimes still\n     * prefixed.\n     *\n     * @param {string} selector Selector to test.\n     * @param {!Element=} node Element to test the selector against.\n     * @return {boolean} Whether the element matches the selector.\n     */\n    elementMatches(selector, node) {\n      return matchesSelector( (node || this), selector);\n    }\n\n    /**\n     * Toggles an HTML attribute on or off.\n     *\n     * @param {string} name HTML attribute name\n     * @param {boolean=} bool Boolean to force the attribute on or off.\n     *    When unspecified, the state of the attribute will be reversed.\n     * @return {boolean} true if the attribute now exists\n     */\n    toggleAttribute(name, bool) {\n      let node = /** @type {Element} */ this;\n      if (arguments.length === 3) {\n        node = /** @type {Element} */ arguments[2];\n      }\n      if (arguments.length == 1) {\n        bool = !node.hasAttribute(name);\n      }\n      if (bool) {\n        node.setAttribute(name, '');\n        return true;\n      } else {\n        node.removeAttribute(name);\n        return false;\n      }\n    }\n\n\n    /**\n     * Toggles a CSS class on or off.\n     *\n     * @param {string} name CSS class name\n     * @param {boolean=} bool Boolean to force the class on or off.\n     *    When unspecified, the state of the class will be reversed.\n     * @param {Element=} node Node to target.  Defaults to `this`.\n     * @return {void}\n     */\n    toggleClass(name, bool, node) {\n      node = /** @type {Element} */ (node || this);\n      if (arguments.length == 1) {\n        bool = !node.classList.contains(name);\n      }\n      if (bool) {\n        node.classList.add(name);\n      } else {\n        node.classList.remove(name);\n      }\n    }\n\n    /**\n     * Cross-platform helper for setting an element's CSS `transform` property.\n     *\n     * @param {string} transformText Transform setting.\n     * @param {Element=} node Element to apply the transform to.\n     * Defaults to `this`\n     * @return {void}\n     */\n    transform(transformText, node) {\n      node = /** @type {Element} */ (node || this);\n      node.style.webkitTransform = transformText;\n      node.style.transform = transformText;\n    }\n\n    /**\n     * Cross-platform helper for setting an element's CSS `translate3d`\n     * property.\n     *\n     * @param {number} x X offset.\n     * @param {number} y Y offset.\n     * @param {number} z Z offset.\n     * @param {Element=} node Element to apply the transform to.\n     * Defaults to `this`.\n     * @return {void}\n     */\n    translate3d(x, y, z, node) {\n      node = /** @type {Element} */ (node || this);\n      this.transform('translate3d(' + x + ',' + y + ',' + z + ')', node);\n    }\n\n    /**\n     * Removes an item from an array, if it exists.\n     *\n     * If the array is specified by path, a change notification is\n     * generated, so that observers, data bindings and computed\n     * properties watching that path can update.\n     *\n     * If the array is passed directly, **no change\n     * notification is generated**.\n     *\n     * @param {string | !Array<number|string>} arrayOrPath Path to array from which to remove the item\n     *   (or the array itself).\n     * @param {*} item Item to remove.\n     * @return {Array} Array containing item removed.\n     */\n    arrayDelete(arrayOrPath, item) {\n      let index;\n      if (Array.isArray(arrayOrPath)) {\n        index = arrayOrPath.indexOf(item);\n        if (index >= 0) {\n          return arrayOrPath.splice(index, 1);\n        }\n      } else {\n        let arr = get(this, arrayOrPath);\n        index = arr.indexOf(item);\n        if (index >= 0) {\n          return this.splice(arrayOrPath, index, 1);\n        }\n      }\n      return null;\n    }\n\n    // logging\n\n    /**\n     * Facades `console.log`/`warn`/`error` as override point.\n     *\n     * @param {string} level One of 'log', 'warn', 'error'\n     * @param {Array} args Array of strings or objects to log\n     * @return {void}\n     */\n    _logger(level, args) {\n      // accept ['foo', 'bar'] and [['foo', 'bar']]\n      if (Array.isArray(args) && args.length === 1 && Array.isArray(args[0])) {\n        args = args[0];\n      }\n      switch(level) {\n        case 'log':\n        case 'warn':\n        case 'error':\n          console[level](...args);\n      }\n    }\n\n    /**\n     * Facades `console.log` as an override point.\n     *\n     * @param {...*} args Array of strings or objects to log\n     * @return {void}\n     */\n    _log(...args) {\n      this._logger('log', args);\n    }\n\n    /**\n     * Facades `console.warn` as an override point.\n     *\n     * @param {...*} args Array of strings or objects to log\n     * @return {void}\n     */\n    _warn(...args) {\n      this._logger('warn', args);\n    }\n\n    /**\n     * Facades `console.error` as an override point.\n     *\n     * @param {...*} args Array of strings or objects to log\n     * @return {void}\n     */\n    _error(...args) {\n      this._logger('error', args);\n    }\n\n    /**\n     * Formats a message using the element type an a method name.\n     *\n     * @param {string} methodName Method name to associate with message\n     * @param {...*} args Array of strings or objects to log\n     * @return {Array} Array with formatting information for `console`\n     *   logging.\n     */\n    _logf(methodName, ...args) {\n      return ['[%s::%s]', this.is, methodName, ...args];\n    }\n\n  }\n\n  LegacyElement.prototype.is = '';\n\n  return LegacyElement;\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\nimport { LegacyElementMixin } from './legacy-element-mixin.js';\n\nlet metaProps = {\n  attached: true,\n  detached: true,\n  ready: true,\n  created: true,\n  beforeRegister: true,\n  registered: true,\n  attributeChanged: true,\n  // meta objects\n  behaviors: true\n};\n\n/**\n * Applies a \"legacy\" behavior or array of behaviors to the provided class.\n *\n * Note: this method will automatically also apply the `LegacyElementMixin`\n * to ensure that any legacy behaviors can rely on legacy Polymer API on\n * the underlying element.\n *\n * @function\n * @template T\n * @param {!Object|!Array<!Object>} behaviors Behavior object or array of behaviors.\n * @param {function(new:T)} klass Element class.\n * @return {?} Returns a new Element class extended by the\n * passed in `behaviors` and also by `LegacyElementMixin`.\n * @suppress {invalidCasts, checkTypes}\n */\nexport function mixinBehaviors(behaviors, klass) {\n  if (!behaviors) {\n    klass = /** @type {HTMLElement} */(klass); // eslint-disable-line no-self-assign\n    return klass;\n  }\n  // NOTE: ensure the behavior is extending a class with\n  // legacy element api. This is necessary since behaviors expect to be able\n  // to access 1.x legacy api.\n  klass = LegacyElementMixin(klass);\n  if (!Array.isArray(behaviors)) {\n    behaviors = [behaviors];\n  }\n  let superBehaviors = klass.prototype.behaviors;\n  // get flattened, deduped list of behaviors *not* already on super class\n  behaviors = flattenBehaviors(behaviors, null, superBehaviors);\n  // mixin new behaviors\n  klass = _mixinBehaviors(behaviors, klass);\n  if (superBehaviors) {\n    behaviors = superBehaviors.concat(behaviors);\n  }\n  // Set behaviors on prototype for BC...\n  klass.prototype.behaviors = behaviors;\n  return klass;\n}\n\n// NOTE:\n// 1.x\n// Behaviors were mixed in *in reverse order* and de-duped on the fly.\n// The rule was that behavior properties were copied onto the element\n// prototype if and only if the property did not already exist.\n// Given: Polymer{ behaviors: [A, B, C, A, B]}, property copy order was:\n// (1), B, (2), A, (3) C. This means prototype properties win over\n// B properties win over A win over C. This mirrors what would happen\n// with inheritance if element extended B extended A extended C.\n//\n// Again given, Polymer{ behaviors: [A, B, C, A, B]}, the resulting\n// `behaviors` array was [C, A, B].\n// Behavior lifecycle methods were called in behavior array order\n// followed by the element, e.g. (1) C.created, (2) A.created,\n// (3) B.created, (4) element.created. There was no support for\n// super, and \"super-behavior\" methods were callable only by name).\n//\n// 2.x\n// Behaviors are made into proper mixins which live in the\n// element's prototype chain. Behaviors are placed in the element prototype\n// eldest to youngest and de-duped youngest to oldest:\n// So, first [A, B, C, A, B] becomes [C, A, B] then,\n// the element prototype becomes (oldest) (1) PolymerElement, (2) class(C),\n// (3) class(A), (4) class(B), (5) class(Polymer({...})).\n// Result:\n// This means element properties win over B properties win over A win\n// over C. (same as 1.x)\n// If lifecycle is called (super then me), order is\n// (1) C.created, (2) A.created, (3) B.created, (4) element.created\n// (again same as 1.x)\nfunction _mixinBehaviors(behaviors, klass) {\n  for (let i=0; i<behaviors.length; i++) {\n    let b = behaviors[i];\n    if (b) {\n      klass = Array.isArray(b) ? _mixinBehaviors(b, klass) :\n        GenerateClassFromInfo(b, klass);\n    }\n  }\n  return klass;\n}\n\n/**\n * @param {Array} behaviors List of behaviors to flatten.\n * @param {Array=} list Target list to flatten behaviors into.\n * @param {Array=} exclude List of behaviors to exclude from the list.\n * @return {!Array} Returns the list of flattened behaviors.\n */\nfunction flattenBehaviors(behaviors, list, exclude) {\n  list = list || [];\n  for (let i=behaviors.length-1; i >= 0; i--) {\n    let b = behaviors[i];\n    if (b) {\n      if (Array.isArray(b)) {\n        flattenBehaviors(b, list);\n      } else {\n        // dedup\n        if (list.indexOf(b) < 0 && (!exclude || exclude.indexOf(b) < 0)) {\n          list.unshift(b);\n        }\n      }\n    } else {\n      console.warn('behavior is null, check for missing or 404 import');\n    }\n  }\n  return list;\n}\n\n/**\n * @param {!PolymerInit} info Polymer info object\n * @param {function(new:HTMLElement)} Base base class to extend with info object\n * @return {function(new:HTMLElement)} Generated class\n * @suppress {checkTypes}\n * @private\n */\nfunction GenerateClassFromInfo(info, Base) {\n\n  /** @private */\n  class PolymerGenerated extends Base {\n\n    static get properties() {\n      return info.properties;\n    }\n\n    static get observers() {\n      return info.observers;\n    }\n\n    /**\n     * @return {void}\n     */\n    created() {\n      super.created();\n      if (info.created) {\n        info.created.call(this);\n      }\n    }\n\n    /**\n     * @return {void}\n     */\n    _registered() {\n      super._registered();\n      /* NOTE: `beforeRegister` is called here for bc, but the behavior\n       is different than in 1.x. In 1.0, the method was called *after*\n       mixing prototypes together but *before* processing of meta-objects.\n       However, dynamic effects can still be set here and can be done either\n       in `beforeRegister` or `registered`. It is no longer possible to set\n       `is` in `beforeRegister` as you could in 1.x.\n      */\n      if (info.beforeRegister) {\n        info.beforeRegister.call(Object.getPrototypeOf(this));\n      }\n      if (info.registered) {\n        info.registered.call(Object.getPrototypeOf(this));\n      }\n    }\n\n    /**\n     * @return {void}\n     */\n    _applyListeners() {\n      super._applyListeners();\n      if (info.listeners) {\n        for (let l in info.listeners) {\n          this._addMethodEventListenerToNode(this, l, info.listeners[l]);\n        }\n      }\n    }\n\n    // note: exception to \"super then me\" rule;\n    // do work before calling super so that super attributes\n    // only apply if not already set.\n    /**\n     * @return {void}\n     */\n    _ensureAttributes() {\n      if (info.hostAttributes) {\n        for (let a in info.hostAttributes) {\n          this._ensureAttribute(a, info.hostAttributes[a]);\n        }\n      }\n      super._ensureAttributes();\n    }\n\n    /**\n     * @return {void}\n     */\n    ready() {\n      super.ready();\n      if (info.ready) {\n        info.ready.call(this);\n      }\n    }\n\n    /**\n     * @return {void}\n     */\n    attached() {\n      super.attached();\n      if (info.attached) {\n        info.attached.call(this);\n      }\n    }\n\n    /**\n     * @return {void}\n     */\n    detached() {\n      super.detached();\n      if (info.detached) {\n        info.detached.call(this);\n      }\n    }\n\n    /**\n     * Implements native Custom Elements `attributeChangedCallback` to\n     * set an attribute value to a property via `_attributeToProperty`.\n     *\n     * @param {string} name Name of attribute that changed\n     * @param {?string} old Old attribute value\n     * @param {?string} value New attribute value\n     * @return {void}\n     */\n    attributeChanged(name, old, value) {\n      super.attributeChanged(name, old, value);\n      if (info.attributeChanged) {\n        info.attributeChanged.call(this, name, old, value);\n      }\n   }\n  }\n\n  PolymerGenerated.generatedFrom = info;\n\n  for (let p in info) {\n    // NOTE: cannot copy `metaProps` methods onto prototype at least because\n    // `super.ready` must be called and is not included in the user fn.\n    if (!(p in metaProps)) {\n      let pd = Object.getOwnPropertyDescriptor(info, p);\n      if (pd) {\n        Object.defineProperty(PolymerGenerated.prototype, p, pd);\n      }\n    }\n  }\n\n  return PolymerGenerated;\n}\n\n/**\n * Generates a class that extends `LegacyElement` based on the\n * provided info object.  Metadata objects on the `info` object\n * (`properties`, `observers`, `listeners`, `behaviors`, `is`) are used\n * for Polymer's meta-programming systems, and any functions are copied\n * to the generated class.\n *\n * Valid \"metadata\" values are as follows:\n *\n * `is`: String providing the tag name to register the element under. In\n * addition, if a `dom-module` with the same id exists, the first template\n * in that `dom-module` will be stamped into the shadow root of this element,\n * with support for declarative event listeners (`on-...`), Polymer data\n * bindings (`[[...]]` and `{{...}}`), and id-based node finding into\n * `this.$`.\n *\n * `properties`: Object describing property-related metadata used by Polymer\n * features (key: property names, value: object containing property metadata).\n * Valid keys in per-property metadata include:\n * - `type` (String|Number|Object|Array|...): Used by\n *   `attributeChangedCallback` to determine how string-based attributes\n *   are deserialized to JavaScript property values.\n * - `notify` (boolean): Causes a change in the property to fire a\n *   non-bubbling event called `<property>-changed`. Elements that have\n *   enabled two-way binding to the property use this event to observe changes.\n * - `readOnly` (boolean): Creates a getter for the property, but no setter.\n *   To set a read-only property, use the private setter method\n *   `_setProperty(property, value)`.\n * - `observer` (string): Observer method name that will be called when\n *   the property changes. The arguments of the method are\n *   `(value, previousValue)`.\n * - `computed` (string): String describing method and dependent properties\n *   for computing the value of this property (e.g. `'computeFoo(bar, zot)'`).\n *   Computed properties are read-only by default and can only be changed\n *   via the return value of the computing method.\n *\n * `observers`: Array of strings describing multi-property observer methods\n *  and their dependent properties (e.g. `'observeABC(a, b, c)'`).\n *\n * `listeners`: Object describing event listeners to be added to each\n *  instance of this element (key: event name, value: method name).\n *\n * `behaviors`: Array of additional `info` objects containing metadata\n * and callbacks in the same format as the `info` object here which are\n * merged into this element.\n *\n * `hostAttributes`: Object listing attributes to be applied to the host\n *  once created (key: attribute name, value: attribute value).  Values\n *  are serialized based on the type of the value.  Host attributes should\n *  generally be limited to attributes such as `tabIndex` and `aria-...`.\n *  Attributes in `hostAttributes` are only applied if a user-supplied\n *  attribute is not already present (attributes in markup override\n *  `hostAttributes`).\n *\n * In addition, the following Polymer-specific callbacks may be provided:\n * - `registered`: called after first instance of this element,\n * - `created`: called during `constructor`\n * - `attached`: called during `connectedCallback`\n * - `detached`: called during `disconnectedCallback`\n * - `ready`: called before first `attached`, after all properties of\n *   this element have been propagated to its template and all observers\n *   have run\n *\n * @param {!PolymerInit} info Object containing Polymer metadata and functions\n *   to become class methods.\n * @template T\n * @param {function(T):T} mixin Optional mixin to apply to legacy base class\n *   before extending with Polymer metaprogramming.\n * @return {function(new:HTMLElement)} Generated class\n */\nexport const Class = function(info, mixin) {\n  if (!info) {\n    console.warn(`Polymer's Class function requires \\`info\\` argument`);\n  }\n  const baseWithBehaviors = info.behaviors ?\n    // note: mixinBehaviors ensures `LegacyElementMixin`.\n    mixinBehaviors(info.behaviors, HTMLElement) :\n    LegacyElementMixin(HTMLElement);\n  const baseWithMixin = mixin ? mixin(baseWithBehaviors) : baseWithBehaviors;\n  const klass = GenerateClassFromInfo(info, baseWithMixin);\n  // decorate klass with registration info\n  klass.is = info.is;\n  return klass;\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*/\nimport { Class } from './class.js';\n\nimport '../utils/boot.js';\n\n/**\n * Legacy class factory and registration helper for defining Polymer\n * elements.\n *\n * This method is equivalent to\n *\n *     import {Class} from '@polymer/polymer/lib/legacy/class.js';\n *     customElements.define(info.is, Class(info));\n *\n * See `Class` for details on valid legacy metadata format for `info`.\n *\n * @global\n * @override\n * @function\n * @param {!PolymerInit} info Object containing Polymer metadata and functions\n *   to become class methods.\n * @return {function(new: HTMLElement)} Generated class\n * @suppress {duplicate, invalidCasts, checkTypes}\n */\nconst Polymer = function(info) {\n  // if input is a `class` (aka a function with a prototype), use the prototype\n  // remember that the `constructor` will never be called\n  let klass;\n  if (typeof info === 'function') {\n    klass = info;\n  } else {\n    klass = Polymer.Class(info);\n  }\n  customElements.define(klass.is, /** @type {!HTMLElement} */(klass));\n  return klass;\n};\n\nPolymer.Class = Class;\n\nexport { Polymer };","/**\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*/\nimport { dedupingMixin } from '../utils/mixin.js';\n\n// Common implementation for mixin & behavior\nfunction mutablePropertyChange(inst, property, value, old, mutableData) {\n  let isObject;\n  if (mutableData) {\n    isObject = (typeof value === 'object' && value !== null);\n    // Pull `old` for Objects from temp cache, but treat `null` as a primitive\n    if (isObject) {\n      old = inst.__dataTemp[property];\n    }\n  }\n  // Strict equality check, but return false for NaN===NaN\n  let shouldChange = (old !== value && (old === old || value === value));\n  // Objects are stored in temporary cache (cleared at end of\n  // turn), which is used for dirty-checking\n  if (isObject && shouldChange) {\n    inst.__dataTemp[property] = value;\n  }\n  return shouldChange;\n}\n\n/**\n * Element class mixin to skip strict dirty-checking for objects and arrays\n * (always consider them to be \"dirty\"), for use on elements utilizing\n * `PropertyEffects`\n *\n * By default, `PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will cause Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\").  This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree.  Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must apply this mixin or enable the\n * `OptionalMutableData` mixin.\n *\n * In order to make the dirty check strategy configurable, see\n * `OptionalMutableData`.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse as opposed to using strict dirty checking with immutable\n * patterns or Polymer's path notification API.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin to skip strict dirty-checking for objects\n *   and arrays\n */\nexport const MutableData = dedupingMixin(superClass => {\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_MutableData}\n   */\n  class MutableData extends superClass {\n    /**\n     * Overrides `PropertyEffects` to provide option for skipping\n     * strict equality checking for Objects and Arrays.\n     *\n     * This method pulls the value to dirty check against from the `__dataTemp`\n     * cache (rather than the normal `__data` cache) for Objects.  Since the temp\n     * cache is cleared at the end of a turn, this implementation allows\n     * side-effects of deep object changes to be processed by re-setting the\n     * same object (using the temp cache as an in-turn backstop to prevent\n     * cycles due to 2-way notification).\n     *\n     * @param {string} property Property name\n     * @param {*} value New property value\n     * @param {*} old Previous property value\n     * @return {boolean} Whether the property should be considered a change\n     * @protected\n     */\n    _shouldPropertyChange(property, value, old) {\n      return mutablePropertyChange(this, property, value, old, true);\n    }\n\n  }\n\n  return MutableData;\n\n});\n\n/**\n * Element class mixin to add the optional ability to skip strict\n * dirty-checking for objects and arrays (always consider them to be\n * \"dirty\") by setting a `mutable-data` attribute on an element instance.\n *\n * By default, `PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will allow Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\").  This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree.  Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must enable this mixin or apply the\n * `MutableData` mixin.\n *\n * While this mixin adds the ability to forgo Object/Array dirty checking,\n * the `mutableData` flag defaults to false and must be set on the instance.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse by relying on `mutableData: true` as opposed to using\n * strict dirty checking with immutable patterns or Polymer's path notification\n * API.\n *\n * @mixinFunction\n * @polymer\n * @summary Element class mixin to optionally skip strict dirty-checking\n *   for objects and arrays\n */\nexport const OptionalMutableData = dedupingMixin(superClass => {\n\n  /**\n   * @mixinClass\n   * @polymer\n   * @implements {Polymer_OptionalMutableData}\n   */\n  class OptionalMutableData extends superClass {\n\n    static get properties() {\n      return {\n        /**\n         * Instance-level flag for configuring the dirty-checking strategy\n         * for this element.  When true, Objects and Arrays will skip dirty\n         * checking, otherwise strict equality checking will be used.\n         */\n        mutableData: Boolean\n      };\n    }\n\n    /**\n     * Overrides `PropertyEffects` to provide option for skipping\n     * strict equality checking for Objects and Arrays.\n     *\n     * When `this.mutableData` is true on this instance, this method\n     * pulls the value to dirty check against from the `__dataTemp` cache\n     * (rather than the normal `__data` cache) for Objects.  Since the temp\n     * cache is cleared at the end of a turn, this implementation allows\n     * side-effects of deep object changes to be processed by re-setting the\n     * same object (using the temp cache as an in-turn backstop to prevent\n     * cycles due to 2-way notification).\n     *\n     * @param {string} property Property name\n     * @param {*} value New property value\n     * @param {*} old Previous property value\n     * @return {boolean} Whether the property should be considered a change\n     * @protected\n     */\n    _shouldPropertyChange(property, value, old) {\n      return mutablePropertyChange(this, property, value, old, this.mutableData);\n    }\n  }\n\n  return OptionalMutableData;\n\n});\n\n// Export for use by legacy behavior\nMutableData._mutablePropertyChange = mutablePropertyChange;\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/**\n * Module for preparing and stamping instances of templates that utilize\n * Polymer's data-binding and declarative event listener features.\n *\n * Example:\n *\n *     // Get a template from somewhere, e.g. light DOM\n *     let template = this.querySelector('template');\n *     // Prepare the template\n *     let TemplateClass = Templatize.templatize(template);\n *     // Instance the template with an initial data model\n *     let instance = new TemplateClass({myProp: 'initial'});\n *     // Insert the instance's DOM somewhere, e.g. element's shadow DOM\n *     this.shadowRoot.appendChild(instance.root);\n *     // Changing a property on the instance will propagate to bindings\n *     // in the template\n *     instance.myProp = 'new value';\n *\n * The `options` dictionary passed to `templatize` allows for customizing\n * features of the generated template class, including how outer-scope host\n * properties should be forwarded into template instances, how any instance\n * properties added into the template's scope should be notified out to\n * the host, and whether the instance should be decorated as a \"parent model\"\n * of any event handlers.\n *\n *     // Customize property forwarding and event model decoration\n *     let TemplateClass = Templatize.templatize(template, this, {\n *       parentModel: true,\n *       forwardHostProp(property, value) {...},\n *       instanceProps: {...},\n *       notifyInstanceProp(instance, property, value) {...},\n *     });\n *\n * @summary Module for preparing and stamping instances of templates\n *   utilizing Polymer templating features.\n */\n\nimport './boot.js';\n\nimport { PropertyEffects } from '../mixins/property-effects.js';\nimport { MutableData } from '../mixins/mutable-data.js';\nimport { strictTemplatePolicy } from '../utils/settings.js';\n\n// Base class for HTMLTemplateElement extension that has property effects\n// machinery for propagating host properties to children. This is an ES5\n// class only because Babel (incorrectly) requires super() in the class\n// constructor even though no `this` is used and it returns an instance.\nlet newInstance = null;\n\n/**\n * @constructor\n * @extends {HTMLTemplateElement}\n * @private\n */\nfunction HTMLTemplateElementExtension() { return newInstance; }\nHTMLTemplateElementExtension.prototype = Object.create(HTMLTemplateElement.prototype, {\n  constructor: {\n    value: HTMLTemplateElementExtension,\n    writable: true\n  }\n});\n\n/**\n * @constructor\n * @implements {Polymer_PropertyEffects}\n * @extends {HTMLTemplateElementExtension}\n * @private\n */\nconst DataTemplate = PropertyEffects(HTMLTemplateElementExtension);\n\n/**\n * @constructor\n * @implements {Polymer_MutableData}\n * @extends {DataTemplate}\n * @private\n */\nconst MutableDataTemplate = MutableData(DataTemplate);\n\n// Applies a DataTemplate subclass to a <template> instance\nfunction upgradeTemplate(template, constructor) {\n  newInstance = template;\n  Object.setPrototypeOf(template, constructor.prototype);\n  new constructor();\n  newInstance = null;\n}\n\n/**\n * Base class for TemplateInstance.\n * @constructor\n * @implements {Polymer_PropertyEffects}\n * @private\n */\nconst base = PropertyEffects(class {});\n\n/**\n * @polymer\n * @customElement\n * @appliesMixin PropertyEffects\n * @unrestricted\n */\nclass TemplateInstanceBase extends base {\n  constructor(props) {\n    super();\n    this._configureProperties(props);\n    this.root = this._stampTemplate(this.__dataHost);\n    // Save list of stamped children\n    let children = this.children = [];\n    for (let n = this.root.firstChild; n; n=n.nextSibling) {\n      children.push(n);\n      n.__templatizeInstance = this;\n    }\n    if (this.__templatizeOwner &&\n      this.__templatizeOwner.__hideTemplateChildren__) {\n      this._showHideChildren(true);\n    }\n    // Flush props only when props are passed if instance props exist\n    // or when there isn't instance props.\n    let options = this.__templatizeOptions;\n    if ((props && options.instanceProps) || !options.instanceProps) {\n      this._enableProperties();\n    }\n  }\n  /**\n   * Configure the given `props` by calling `_setPendingProperty`. Also\n   * sets any properties stored in `__hostProps`.\n   * @private\n   * @param {Object} props Object of property name-value pairs to set.\n   * @return {void}\n   */\n  _configureProperties(props) {\n    let options = this.__templatizeOptions;\n    if (options.forwardHostProp) {\n      for (let hprop in this.__hostProps) {\n        this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]);\n      }\n    }\n    // Any instance props passed in the constructor will overwrite host props;\n    // normally this would be a user error but we don't specifically filter them\n    for (let iprop in props) {\n      this._setPendingProperty(iprop, props[iprop]);\n    }\n  }\n  /**\n   * Forwards a host property to this instance.  This method should be\n   * called on instances from the `options.forwardHostProp` callback\n   * to propagate changes of host properties to each instance.\n   *\n   * Note this method enqueues the change, which are flushed as a batch.\n   *\n   * @param {string} prop Property or path name\n   * @param {*} value Value of the property to forward\n   * @return {void}\n   */\n  forwardHostProp(prop, value) {\n    if (this._setPendingPropertyOrPath(prop, value, false, true)) {\n      this.__dataHost._enqueueClient(this);\n    }\n  }\n\n  /**\n   * Override point for adding custom or simulated event handling.\n   *\n   * @override\n   * @param {!Node} node Node to add event listener to\n   * @param {string} eventName Name of event\n   * @param {function(!Event):void} handler Listener function to add\n   * @return {void}\n   */\n  _addEventListenerToNode(node, eventName, handler) {\n    if (this._methodHost && this.__templatizeOptions.parentModel) {\n      // If this instance should be considered a parent model, decorate\n      // events this template instance as `model`\n      this._methodHost._addEventListenerToNode(node, eventName, (e) => {\n        e.model = this;\n        handler(e);\n      });\n    } else {\n      // Otherwise delegate to the template's host (which could be)\n      // another template instance\n      let templateHost = this.__dataHost.__dataHost;\n      if (templateHost) {\n        templateHost._addEventListenerToNode(node, eventName, handler);\n      }\n    }\n  }\n  /**\n   * Shows or hides the template instance top level child elements. For\n   * text nodes, `textContent` is removed while \"hidden\" and replaced when\n   * \"shown.\"\n   * @param {boolean} hide Set to true to hide the children;\n   * set to false to show them.\n   * @return {void}\n   * @protected\n   */\n  _showHideChildren(hide) {\n    let c = this.children;\n    for (let i=0; i<c.length; i++) {\n      let n = c[i];\n      // Ignore non-changes\n      if (Boolean(hide) != Boolean(n.__hideTemplateChildren__)) {\n        if (n.nodeType === Node.TEXT_NODE) {\n          if (hide) {\n            n.__polymerTextContent__ = n.textContent;\n            n.textContent = '';\n          } else {\n            n.textContent = n.__polymerTextContent__;\n          }\n        // remove and replace slot\n        } else if (n.localName === 'slot') {\n          if (hide) {\n            n.__polymerReplaced__ = document.createComment('hidden-slot');\n            n.parentNode.replaceChild(n.__polymerReplaced__, n);\n          } else {\n            const replace = n.__polymerReplaced__;\n            if (replace) {\n              replace.parentNode.replaceChild(n, replace);\n            }\n          }\n        }\n\n        else if (n.style) {\n          if (hide) {\n            n.__polymerDisplay__ = n.style.display;\n            n.style.display = 'none';\n          } else {\n            n.style.display = n.__polymerDisplay__;\n          }\n        }\n      }\n      n.__hideTemplateChildren__ = hide;\n      if (n._showHideChildren) {\n        n._showHideChildren(hide);\n      }\n    }\n  }\n  /**\n   * Overrides default property-effects implementation to intercept\n   * textContent bindings while children are \"hidden\" and cache in\n   * private storage for later retrieval.\n   *\n   * @override\n   * @param {!Node} node The node to set a property on\n   * @param {string} prop The property to set\n   * @param {*} value The value to set\n   * @return {void}\n   * @protected\n   */\n  _setUnmanagedPropertyToNode(node, prop, value) {\n    if (node.__hideTemplateChildren__ &&\n        node.nodeType == Node.TEXT_NODE && prop == 'textContent') {\n      node.__polymerTextContent__ = value;\n    } else {\n      super._setUnmanagedPropertyToNode(node, prop, value);\n    }\n  }\n  /**\n   * Find the parent model of this template instance.  The parent model\n   * is either another templatize instance that had option `parentModel: true`,\n   * or else the host element.\n   *\n   * @return {!Polymer_PropertyEffects} The parent model of this instance\n   */\n  get parentModel() {\n    let model = this.__parentModel;\n    if (!model) {\n      let options;\n      model = this;\n      do {\n        // A template instance's `__dataHost` is a <template>\n        // `model.__dataHost.__dataHost` is the template's host\n        model = model.__dataHost.__dataHost;\n      } while ((options = model.__templatizeOptions) && !options.parentModel);\n      this.__parentModel = model;\n    }\n    return model;\n  }\n\n  /**\n   * Stub of HTMLElement's `dispatchEvent`, so that effects that may\n   * dispatch events safely no-op.\n   *\n   * @param {Event} event Event to dispatch\n   * @return {boolean} Always true.\n   */\n   dispatchEvent(event) { // eslint-disable-line no-unused-vars\n     return true;\n  }\n}\n\n/** @type {!DataTemplate} */\nTemplateInstanceBase.prototype.__dataHost;\n/** @type {!TemplatizeOptions} */\nTemplateInstanceBase.prototype.__templatizeOptions;\n/** @type {!Polymer_PropertyEffects} */\nTemplateInstanceBase.prototype._methodHost;\n/** @type {!Object} */\nTemplateInstanceBase.prototype.__templatizeOwner;\n/** @type {!Object} */\nTemplateInstanceBase.prototype.__hostProps;\n\n/**\n * @constructor\n * @extends {TemplateInstanceBase}\n * @implements {Polymer_MutableData}\n * @private\n */\nconst MutableTemplateInstanceBase = MutableData(TemplateInstanceBase);\n\nfunction findMethodHost(template) {\n  // Technically this should be the owner of the outermost template.\n  // In shadow dom, this is always getRootNode().host, but we can\n  // approximate this via cooperation with our dataHost always setting\n  // `_methodHost` as long as there were bindings (or id's) on this\n  // instance causing it to get a dataHost.\n  let templateHost = template.__dataHost;\n  return templateHost && templateHost._methodHost || templateHost;\n}\n\n/* eslint-disable valid-jsdoc */\n/**\n * @suppress {missingProperties} class.prototype is not defined for some reason\n */\nfunction createTemplatizerClass(template, templateInfo, options) {\n  // Anonymous class created by the templatize\n  let base = options.mutableData ?\n    MutableTemplateInstanceBase : TemplateInstanceBase;\n  /**\n   * @constructor\n   * @extends {base}\n   * @private\n   */\n  let klass = class extends base { };\n  klass.prototype.__templatizeOptions = options;\n  klass.prototype._bindTemplate(template);\n  addNotifyEffects(klass, template, templateInfo, options);\n  return klass;\n}\n\n/**\n * @suppress {missingProperties} class.prototype is not defined for some reason\n */\nfunction addPropagateEffects(template, templateInfo, options) {\n  let userForwardHostProp = options.forwardHostProp;\n  if (userForwardHostProp) {\n    // Provide data API and property effects on memoized template class\n    let klass = templateInfo.templatizeTemplateClass;\n    if (!klass) {\n      let base = options.mutableData ? MutableDataTemplate : DataTemplate;\n      /** @private */\n      klass = templateInfo.templatizeTemplateClass =\n        class TemplatizedTemplate extends base {};\n      // Add template - >instances effects\n      // and host <- template effects\n      let hostProps = templateInfo.hostProps;\n      for (let prop in hostProps) {\n        klass.prototype._addPropertyEffect('_host_' + prop,\n          klass.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,\n          {fn: createForwardHostPropEffect(prop, userForwardHostProp)});\n        klass.prototype._createNotifyingProperty('_host_' + prop);\n      }\n    }\n    upgradeTemplate(template, klass);\n    // Mix any pre-bound data into __data; no need to flush this to\n    // instances since they pull from the template at instance-time\n    if (template.__dataProto) {\n      // Note, generally `__dataProto` could be chained, but it's guaranteed\n      // to not be since this is a vanilla template we just added effects to\n      Object.assign(template.__data, template.__dataProto);\n    }\n    // Clear any pending data for performance\n    template.__dataTemp = {};\n    template.__dataPending = null;\n    template.__dataOld = null;\n    template._enableProperties();\n  }\n}\n/* eslint-enable valid-jsdoc */\n\nfunction createForwardHostPropEffect(hostProp, userForwardHostProp) {\n  return function forwardHostProp(template, prop, props) {\n    userForwardHostProp.call(template.__templatizeOwner,\n      prop.substring('_host_'.length), props[prop]);\n  };\n}\n\nfunction addNotifyEffects(klass, template, templateInfo, options) {\n  let hostProps = templateInfo.hostProps || {};\n  for (let iprop in options.instanceProps) {\n    delete hostProps[iprop];\n    let userNotifyInstanceProp = options.notifyInstanceProp;\n    if (userNotifyInstanceProp) {\n      klass.prototype._addPropertyEffect(iprop,\n        klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,\n        {fn: createNotifyInstancePropEffect(iprop, userNotifyInstanceProp)});\n    }\n  }\n  if (options.forwardHostProp && template.__dataHost) {\n    for (let hprop in hostProps) {\n      klass.prototype._addPropertyEffect(hprop,\n        klass.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,\n        {fn: createNotifyHostPropEffect()});\n    }\n  }\n}\n\nfunction createNotifyInstancePropEffect(instProp, userNotifyInstanceProp) {\n  return function notifyInstanceProp(inst, prop, props) {\n    userNotifyInstanceProp.call(inst.__templatizeOwner,\n      inst, prop, props[prop]);\n  };\n}\n\nfunction createNotifyHostPropEffect() {\n  return function notifyHostProp(inst, prop, props) {\n    inst.__dataHost._setPendingPropertyOrPath('_host_' + prop, props[prop], true, true);\n  };\n}\n\n\n/**\n * Returns an anonymous `PropertyEffects` class bound to the\n * `<template>` provided.  Instancing the class will result in the\n * template being stamped into a document fragment stored as the instance's\n * `root` property, after which it can be appended to the DOM.\n *\n * Templates may utilize all Polymer data-binding features as well as\n * declarative event listeners.  Event listeners and inline computing\n * functions in the template will be called on the host of the template.\n *\n * The constructor returned takes a single argument dictionary of initial\n * property values to propagate into template bindings.  Additionally\n * host properties can be forwarded in, and instance properties can be\n * notified out by providing optional callbacks in the `options` dictionary.\n *\n * Valid configuration in `options` are as follows:\n *\n * - `forwardHostProp(property, value)`: Called when a property referenced\n *   in the template changed on the template's host. As this library does\n *   not retain references to templates instanced by the user, it is the\n *   templatize owner's responsibility to forward host property changes into\n *   user-stamped instances.  The `instance.forwardHostProp(property, value)`\n *    method on the generated class should be called to forward host\n *   properties into the template to prevent unnecessary property-changed\n *   notifications. Any properties referenced in the template that are not\n *   defined in `instanceProps` will be notified up to the template's host\n *   automatically.\n * - `instanceProps`: Dictionary of property names that will be added\n *   to the instance by the templatize owner.  These properties shadow any\n *   host properties, and changes within the template to these properties\n *   will result in `notifyInstanceProp` being called.\n * - `mutableData`: When `true`, the generated class will skip strict\n *   dirty-checking for objects and arrays (always consider them to be\n *   \"dirty\").\n * - `notifyInstanceProp(instance, property, value)`: Called when\n *   an instance property changes.  Users may choose to call `notifyPath`\n *   on e.g. the owner to notify the change.\n * - `parentModel`: When `true`, events handled by declarative event listeners\n *   (`on-event=\"handler\"`) will be decorated with a `model` property pointing\n *   to the template instance that stamped it.  It will also be returned\n *   from `instance.parentModel` in cases where template instance nesting\n *   causes an inner model to shadow an outer model.\n *\n * All callbacks are called bound to the `owner`. Any context\n * needed for the callbacks (such as references to `instances` stamped)\n * should be stored on the `owner` such that they can be retrieved via\n * `this`.\n *\n * When `options.forwardHostProp` is declared as an option, any properties\n * referenced in the template will be automatically forwarded from the host of\n * the `<template>` to instances, with the exception of any properties listed in\n * the `options.instanceProps` object.  `instanceProps` are assumed to be\n * managed by the owner of the instances, either passed into the constructor\n * or set after the fact.  Note, any properties passed into the constructor will\n * always be set to the instance (regardless of whether they would normally\n * be forwarded from the host).\n *\n * Note that `templatize()` can be run only once for a given `<template>`.\n * Further calls will result in an error. Also, there is a special\n * behavior if the template was duplicated through a mechanism such as\n * `<dom-repeat>` or `<test-fixture>`. In this case, all calls to\n * `templatize()` return the same class for all duplicates of a template.\n * The class returned from `templatize()` is generated only once using\n * the `options` from the first call. This means that any `options`\n * provided to subsequent calls will be ignored. Therefore, it is very\n * important not to close over any variables inside the callbacks. Also,\n * arrow functions must be avoided because they bind the outer `this`.\n * Inside the callbacks, any contextual information can be accessed\n * through `this`, which points to the `owner`.\n *\n * @param {!HTMLTemplateElement} template Template to templatize\n * @param {Polymer_PropertyEffects=} owner Owner of the template instances;\n *   any optional callbacks will be bound to this owner.\n * @param {Object=} options Options dictionary (see summary for details)\n * @return {function(new:TemplateInstanceBase)} Generated class bound to the template\n *   provided\n * @suppress {invalidCasts}\n */\nexport function templatize(template, owner, options) {\n  // Under strictTemplatePolicy, the templatized element must be owned\n  // by a (trusted) Polymer element, indicated by existence of _methodHost;\n  // e.g. for dom-if & dom-repeat in main document, _methodHost is null\n  if (strictTemplatePolicy && !findMethodHost(template)) {\n    throw new Error('strictTemplatePolicy: template owner not trusted');\n  }\n  options = /** @type {!TemplatizeOptions} */(options || {});\n  if (template.__templatizeOwner) {\n    throw new Error('A <template> can only be templatized once');\n  }\n  template.__templatizeOwner = owner;\n  const ctor = owner ? owner.constructor : TemplateInstanceBase;\n  let templateInfo = ctor._parseTemplate(template);\n  // Get memoized base class for the prototypical template, which\n  // includes property effects for binding template & forwarding\n  let baseClass = templateInfo.templatizeInstanceClass;\n  if (!baseClass) {\n    baseClass = createTemplatizerClass(template, templateInfo, options);\n    templateInfo.templatizeInstanceClass = baseClass;\n  }\n  // Host property forwarding must be installed onto template instance\n  addPropagateEffects(template, templateInfo, options);\n  // Subclass base class and add reference for this specific template\n  /** @private */\n  let klass = class TemplateInstance extends baseClass {};\n  klass.prototype._methodHost = findMethodHost(template);\n  klass.prototype.__dataHost = template;\n  klass.prototype.__templatizeOwner = owner;\n  klass.prototype.__hostProps = templateInfo.hostProps;\n  klass = /** @type {function(new:TemplateInstanceBase)} */(klass); //eslint-disable-line no-self-assign\n  return klass;\n}\n\n/**\n * Returns the template \"model\" associated with a given element, which\n * serves as the binding scope for the template instance the element is\n * contained in. A template model is an instance of\n * `TemplateInstanceBase`, and should be used to manipulate data\n * associated with this template instance.\n *\n * Example:\n *\n *   let model = modelForElement(el);\n *   if (model.index < 10) {\n *     model.set('item.checked', true);\n *   }\n *\n * @param {HTMLTemplateElement} template The model will be returned for\n *   elements stamped from this template\n * @param {Node=} node Node for which to return a template model.\n * @return {TemplateInstanceBase} Template instance representing the\n *   binding scope for the element\n */\nexport function modelForElement(template, node) {\n  let model;\n  while (node) {\n    // An element with a __templatizeInstance marks the top boundary\n    // of a scope; walk up until we find one, and then ensure that\n    // its __dataHost matches `this`, meaning this dom-repeat stamped it\n    if ((model = node.__templatizeInstance)) {\n      // Found an element stamped by another template; keep walking up\n      // from its __dataHost\n      if (model.__dataHost != template) {\n        node = model.__dataHost;\n      } else {\n        return model;\n      }\n    } else {\n      // Still in a template scope, keep going up until\n      // a __templatizeInstance is found\n      node = node.parentNode;\n    }\n  }\n  return null;\n}\n\nexport { TemplateInstanceBase };\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*/\nimport { TemplateInstanceBase, templatize, modelForElement } from '../utils/templatize.js'; // eslint-disable-line no-unused-vars\n\n/**\n * @typedef {{\n *   _templatizerTemplate: HTMLTemplateElement,\n *   _parentModel: boolean,\n *   _instanceProps: Object,\n *   _forwardHostPropV2: Function,\n *   _notifyInstancePropV2: Function,\n *   ctor: TemplateInstanceBase\n * }}\n */\nlet TemplatizerUser; // eslint-disable-line\n\n/**\n * The `Templatizer` behavior adds methods to generate instances of\n * templates that are each managed by an anonymous `PropertyEffects`\n * instance where data-bindings in the stamped template content are bound to\n * accessors on itself.\n *\n * This behavior is provided in Polymer 2.x-3.x as a hybrid-element convenience\n * only.  For non-hybrid usage, the `Templatize` library\n * should be used instead.\n *\n * Example:\n *\n *     import {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\n *     // Get a template from somewhere, e.g. light DOM\n *     let template = this.querySelector('template');\n *     // Prepare the template\n *     this.templatize(template);\n *     // Instance the template with an initial data model\n *     let instance = this.stamp({myProp: 'initial'});\n *     // Insert the instance's DOM somewhere, e.g. light DOM\n *     dom(this).appendChild(instance.root);\n *     // Changing a property on the instance will propagate to bindings\n *     // in the template\n *     instance.myProp = 'new value';\n *\n * Users of `Templatizer` may need to implement the following abstract\n * API's to determine how properties and paths from the host should be\n * forwarded into to instances:\n *\n *     _forwardHostPropV2: function(prop, value)\n *\n * Likewise, users may implement these additional abstract API's to determine\n * how instance-specific properties that change on the instance should be\n * forwarded out to the host, if necessary.\n *\n *     _notifyInstancePropV2: function(inst, prop, value)\n *\n * In order to determine which properties are instance-specific and require\n * custom notification via `_notifyInstanceProp`, define an `_instanceProps`\n * object containing keys for each instance prop, for example:\n *\n *     _instanceProps: {\n *       item: true,\n *       index: true\n *     }\n *\n * Any properties used in the template that are not defined in _instanceProp\n * will be forwarded out to the Templatize `owner` automatically.\n *\n * Users may also implement the following abstract function to show or\n * hide any DOM generated using `stamp`:\n *\n *     _showHideChildren: function(shouldHide)\n *\n * Note that some callbacks are suffixed with `V2` in the Polymer 2.x behavior\n * as the implementations will need to differ from the callbacks required\n * by the 1.x Templatizer API due to changes in the `TemplateInstance` API\n * between versions 1.x and 2.x.\n *\n * @polymerBehavior\n */\nexport const Templatizer = {\n\n  /**\n   * Generates an anonymous `TemplateInstance` class (stored as `this.ctor`)\n   * for the provided template.  This method should be called once per\n   * template to prepare an element for stamping the template, followed\n   * by `stamp` to create new instances of the template.\n   *\n   * @param {!HTMLTemplateElement} template Template to prepare\n   * @param {boolean=} mutableData When `true`, the generated class will skip\n   *   strict dirty-checking for objects and arrays (always consider them to\n   *   be \"dirty\"). Defaults to false.\n   * @return {void}\n   * @this {TemplatizerUser}\n   */\n  templatize(template, mutableData) {\n    this._templatizerTemplate = template;\n    this.ctor = templatize(template, this, {\n      mutableData: Boolean(mutableData),\n      parentModel: this._parentModel,\n      instanceProps: this._instanceProps,\n      forwardHostProp: this._forwardHostPropV2,\n      notifyInstanceProp: this._notifyInstancePropV2\n    });\n  },\n\n  /**\n   * Creates an instance of the template prepared by `templatize`.  The object\n   * returned is an instance of the anonymous class generated by `templatize`\n   * whose `root` property is a document fragment containing newly cloned\n   * template content, and which has property accessors corresponding to\n   * properties referenced in template bindings.\n   *\n   * @param {Object=} model Object containing initial property values to\n   *   populate into the template bindings.\n   * @return {TemplateInstanceBase} Returns the created instance of\n   * the template prepared by `templatize`.\n   * @this {TemplatizerUser}\n   */\n  stamp(model) {\n    return new this.ctor(model);\n  },\n\n  /**\n   * Returns the template \"model\" (`TemplateInstance`) associated with\n   * a given element, which serves as the binding scope for the template\n   * instance the element is contained in.  A template model should be used\n   * to manipulate data associated with this template instance.\n   *\n   * @param {HTMLElement} el Element for which to return a template model.\n   * @return {TemplateInstanceBase} Model representing the binding scope for\n   *   the element.\n   * @this {TemplatizerUser}\n   */\n  modelForElement(el) {\n    return modelForElement(this._templatizerTemplate, el);\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*/\nimport '../utils/boot.js';\n\nimport { PropertyEffects } from '../mixins/property-effects.js';\nimport { OptionalMutableData } from '../mixins/mutable-data.js';\nimport { GestureEventListeners } from '../mixins/gesture-event-listeners.js';\nimport { strictTemplatePolicy } from '../utils/settings.js';\n\n/**\n * @constructor\n * @extends {HTMLElement}\n * @implements {Polymer_PropertyEffects}\n * @implements {Polymer_OptionalMutableData}\n * @implements {Polymer_GestureEventListeners}\n * @private\n */\nconst domBindBase =\n  GestureEventListeners(\n    OptionalMutableData(\n      PropertyEffects(HTMLElement)));\n\n/**\n * Custom element to allow using Polymer's template features (data binding,\n * declarative event listeners, etc.) in the main document without defining\n * a new custom element.\n *\n * `<template>` tags utilizing bindings may be wrapped with the `<dom-bind>`\n * element, which will immediately stamp the wrapped template into the main\n * document and bind elements to the `dom-bind` element itself as the\n * binding scope.\n *\n * @polymer\n * @customElement\n * @appliesMixin PropertyEffects\n * @appliesMixin OptionalMutableData\n * @appliesMixin GestureEventListeners\n * @extends {domBindBase}\n * @summary Custom element to allow using Polymer's template features (data\n *   binding, declarative event listeners, etc.) in the main document.\n */\nexport class DomBind extends domBindBase {\n\n  static get observedAttributes() { return ['mutable-data']; }\n\n  constructor() {\n    super();\n    if (strictTemplatePolicy) {\n      throw new Error(`strictTemplatePolicy: dom-bind not allowed`);\n    }\n    this.root = null;\n    this.$ = null;\n    this.__children = null;\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  attributeChangedCallback() {\n    // assumes only one observed attribute\n    this.mutableData = true;\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  connectedCallback() {\n    this.style.display = 'none';\n    this.render();\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  disconnectedCallback() {\n    this.__removeChildren();\n  }\n\n  __insertChildren() {\n    this.parentNode.insertBefore(this.root, this);\n  }\n\n  __removeChildren() {\n    if (this.__children) {\n      for (let i=0; i<this.__children.length; i++) {\n        this.root.appendChild(this.__children[i]);\n      }\n    }\n  }\n\n  /**\n   * Forces the element to render its content. This is typically only\n   * necessary to call if HTMLImports with the async attribute are used.\n   * @return {void}\n   */\n  render() {\n    let template;\n    if (!this.__children) {\n      template = /** @type {HTMLTemplateElement} */(template || this.querySelector('template'));\n      if (!template) {\n        // Wait until childList changes and template should be there by then\n        let observer = new MutationObserver(() => {\n          template = /** @type {HTMLTemplateElement} */(this.querySelector('template'));\n          if (template) {\n            observer.disconnect();\n            this.render();\n          } else {\n            throw new Error('dom-bind requires a <template> child');\n          }\n        });\n        observer.observe(this, {childList: true});\n        return;\n      }\n      this.root = this._stampTemplate(\n        /** @type {!HTMLTemplateElement} */(template));\n      this.$ = this.root.$;\n      this.__children = [];\n      for (let n=this.root.firstChild; n; n=n.nextSibling) {\n        this.__children[this.__children.length] = n;\n      }\n      this._enableProperties();\n    }\n    this.__insertChildren();\n    this.dispatchEvent(new CustomEvent('dom-change', {\n      bubbles: true,\n      composed: true\n    }));\n  }\n\n}\n\ncustomElements.define('dom-bind', DomBind);\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*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { TemplateInstanceBase, templatize, modelForElement } from '../utils/templatize.js'; // eslint-disable-line no-unused-vars\nimport { Debouncer } from '../utils/debounce.js';\nimport { enqueueDebouncer, flush } from '../utils/flush.js';\nimport { OptionalMutableData } from '../mixins/mutable-data.js';\nimport { matches, translate } from '../utils/path.js';\nimport { timeOut, microTask } from '../utils/async.js';\n\n/**\n * @constructor\n * @implements {Polymer_OptionalMutableData}\n * @extends {PolymerElement}\n * @private\n */\nconst domRepeatBase = OptionalMutableData(PolymerElement);\n\n/**\n * The `<dom-repeat>` element will automatically stamp and binds one instance\n * of template content to each object in a user-provided array.\n * `dom-repeat` accepts an `items` property, and one instance of the template\n * is stamped for each item into the DOM at the location of the `dom-repeat`\n * element.  The `item` property will be set on each instance's binding\n * scope, thus templates should bind to sub-properties of `item`.\n *\n * Example:\n *\n * ```html\n * <dom-module id=\"employee-list\">\n *\n *   <template>\n *\n *     <div> Employee list: </div>\n *     <dom-repeat items=\"{{employees}}\">\n *       <template>\n *         <div>First name: <span>{{item.first}}</span></div>\n *         <div>Last name: <span>{{item.last}}</span></div>\n *       </template>\n *     </dom-repeat>\n *\n *   </template>\n *\n * </dom-module>\n * ```\n *\n * With the following custom element definition:\n *\n * ```js\n * class EmployeeList extends PolymerElement {\n *   static get is() { return 'employee-list'; }\n *   static get properties() {\n *     return {\n *       employees: {\n *         value() {\n *           return [\n *             {first: 'Bob', last: 'Smith'},\n *             {first: 'Sally', last: 'Johnson'},\n *             ...\n *           ];\n *         }\n *       }\n *     };\n *   }\n * }\n * ```\n *\n * Notifications for changes to items sub-properties will be forwarded to template\n * instances, which will update via the normal structured data notification system.\n *\n * Mutations to the `items` array itself should be made using the Array\n * mutation API's on the PropertyEffects mixin (`push`, `pop`, `splice`,\n * `shift`, `unshift`), and template instances will be kept in sync with the\n * data in the array.\n *\n * Events caught by event handlers within the `dom-repeat` template will be\n * decorated with a `model` property, which represents the binding scope for\n * each template instance.  The model should be used to manipulate data on the\n * instance, for example `event.model.set('item.checked', true);`.\n *\n * Alternatively, the model for a template instance for an element stamped by\n * a `dom-repeat` can be obtained using the `modelForElement` API on the\n * `dom-repeat` that stamped it, for example\n * `this.$.domRepeat.modelForElement(event.target).set('item.checked', true);`.\n * This may be useful for manipulating instance data of event targets obtained\n * by event handlers on parents of the `dom-repeat` (event delegation).\n *\n * A view-specific filter/sort may be applied to each `dom-repeat` by supplying a\n * `filter` and/or `sort` property.  This may be a string that names a function on\n * the host, or a function may be assigned to the property directly.  The functions\n * should implemented following the standard `Array` filter/sort API.\n *\n * In order to re-run the filter or sort functions based on changes to sub-fields\n * of `items`, the `observe` property may be set as a space-separated list of\n * `item` sub-fields that should cause a re-filter/sort when modified.  If\n * the filter or sort function depends on properties not contained in `items`,\n * the user should observe changes to those properties and call `render` to update\n * the view based on the dependency change.\n *\n * For example, for an `dom-repeat` with a filter of the following:\n *\n * ```js\n * isEngineer(item) {\n *   return item.type == 'engineer' || item.manager.type == 'engineer';\n * }\n * ```\n *\n * Then the `observe` property should be configured as follows:\n *\n * ```html\n * <dom-repeat items=\"{{employees}}\" filter=\"isEngineer\" observe=\"type manager.type\">\n * ```\n *\n * @customElement\n * @polymer\n * @extends {domRepeatBase}\n * @appliesMixin OptionalMutableData\n * @summary Custom element for stamping instance of a template bound to\n *   items in an array.\n */\nexport class DomRepeat extends domRepeatBase {\n\n  // Not needed to find template; can be removed once the analyzer\n  // can find the tag name from customElements.define call\n  static get is() { return 'dom-repeat'; }\n\n  static get template() { return null; }\n\n  static get properties() {\n\n    /**\n     * Fired whenever DOM is added or removed by this template (by\n     * default, rendering occurs lazily).  To force immediate rendering, call\n     * `render`.\n     *\n     * @event dom-change\n     */\n    return {\n\n      /**\n       * An array containing items determining how many instances of the template\n       * to stamp and that that each template instance should bind to.\n       */\n      items: {\n        type: Array\n      },\n\n      /**\n       * The name of the variable to add to the binding scope for the array\n       * element associated with a given template instance.\n       */\n      as: {\n        type: String,\n        value: 'item'\n      },\n\n      /**\n       * The name of the variable to add to the binding scope with the index\n       * of the instance in the sorted and filtered list of rendered items.\n       * Note, for the index in the `this.items` array, use the value of the\n       * `itemsIndexAs` property.\n       */\n      indexAs: {\n        type: String,\n        value: 'index'\n      },\n\n      /**\n       * The name of the variable to add to the binding scope with the index\n       * of the instance in the `this.items` array. Note, for the index of\n       * this instance in the sorted and filtered list of rendered items,\n       * use the value of the `indexAs` property.\n       */\n      itemsIndexAs: {\n        type: String,\n        value: 'itemsIndex'\n      },\n\n      /**\n       * A function that should determine the sort order of the items.  This\n       * property should either be provided as a string, indicating a method\n       * name on the element's host, or else be an actual function.  The\n       * function should match the sort function passed to `Array.sort`.\n       * Using a sort function has no effect on the underlying `items` array.\n       */\n      sort: {\n        type: Function,\n        observer: '__sortChanged'\n      },\n\n      /**\n       * A function that can be used to filter items out of the view.  This\n       * property should either be provided as a string, indicating a method\n       * name on the element's host, or else be an actual function.  The\n       * function should match the sort function passed to `Array.filter`.\n       * Using a filter function has no effect on the underlying `items` array.\n       */\n      filter: {\n        type: Function,\n        observer: '__filterChanged'\n      },\n\n      /**\n       * When using a `filter` or `sort` function, the `observe` property\n       * should be set to a space-separated list of the names of item\n       * sub-fields that should trigger a re-sort or re-filter when changed.\n       * These should generally be fields of `item` that the sort or filter\n       * function depends on.\n       */\n      observe: {\n        type: String,\n        observer: '__observeChanged'\n      },\n\n      /**\n       * When using a `filter` or `sort` function, the `delay` property\n       * determines a debounce time in ms after a change to observed item\n       * properties that must pass before the filter or sort is re-run.\n       * This is useful in rate-limiting shuffling of the view when\n       * item changes may be frequent.\n       */\n      delay: Number,\n\n      /**\n       * Count of currently rendered items after `filter` (if any) has been applied.\n       * If \"chunking mode\" is enabled, `renderedItemCount` is updated each time a\n       * set of template instances is rendered.\n       *\n       */\n      renderedItemCount: {\n        type: Number,\n        notify: true,\n        readOnly: true\n      },\n\n      /**\n       * Defines an initial count of template instances to render after setting\n       * the `items` array, before the next paint, and puts the `dom-repeat`\n       * into \"chunking mode\".  The remaining items will be created and rendered\n       * incrementally at each animation frame therof until all instances have\n       * been rendered.\n       */\n      initialCount: {\n        type: Number,\n        observer: '__initializeChunking'\n      },\n\n      /**\n       * When `initialCount` is used, this property defines a frame rate (in\n       * fps) to target by throttling the number of instances rendered each\n       * frame to not exceed the budget for the target frame rate.  The\n       * framerate is effectively the number of `requestAnimationFrame`s that\n       * it tries to allow to actually fire in a given second. It does this\n       * by measuring the time between `rAF`s and continuously adjusting the\n       * number of items created each `rAF` to maintain the target framerate.\n       * Setting this to a higher number allows lower latency and higher\n       * throughput for event handlers and other tasks, but results in a\n       * longer time for the remaining items to complete rendering.\n       */\n      targetFramerate: {\n        type: Number,\n        value: 20\n      },\n\n      _targetFrameTime: {\n        type: Number,\n        computed: '__computeFrameTime(targetFramerate)'\n      }\n\n    };\n\n  }\n\n  static get observers() {\n    return [ '__itemsChanged(items.*)' ];\n  }\n\n  constructor() {\n    super();\n    this.__instances = [];\n    this.__limit = Infinity;\n    this.__pool = [];\n    this.__renderDebouncer = null;\n    this.__itemsIdxToInstIdx = {};\n    this.__chunkCount = null;\n    this.__lastChunkTime = null;\n    this.__sortFn = null;\n    this.__filterFn = null;\n    this.__observePaths = null;\n    /** @type {?function(new:Polymer.TemplateInstanceBase, *)} */\n    this.__ctor = null;\n    this.__isDetached = true;\n    this.template = null;\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  disconnectedCallback() {\n    super.disconnectedCallback();\n    this.__isDetached = true;\n    for (let i=0; i<this.__instances.length; i++) {\n      this.__detachInstance(i);\n    }\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.style.display = 'none';\n    // only perform attachment if the element was previously detached.\n    if (this.__isDetached) {\n      this.__isDetached = false;\n      let parent = this.parentNode;\n      for (let i=0; i<this.__instances.length; i++) {\n        this.__attachInstance(i, parent);\n      }\n    }\n  }\n\n  __ensureTemplatized() {\n    // Templatizing (generating the instance constructor) needs to wait\n    // until ready, since won't have its template content handed back to\n    // it until then\n    if (!this.__ctor) {\n      let template = this.template = /** @type {HTMLTemplateElement} */(this.querySelector('template'));\n      if (!template) {\n        // // Wait until childList changes and template should be there by then\n        let observer = new MutationObserver(() => {\n          if (this.querySelector('template')) {\n            observer.disconnect();\n            this.__render();\n          } else {\n            throw new Error('dom-repeat requires a <template> child');\n          }\n        });\n        observer.observe(this, {childList: true});\n        return false;\n      }\n      // Template instance props that should be excluded from forwarding\n      let instanceProps = {};\n      instanceProps[this.as] = true;\n      instanceProps[this.indexAs] = true;\n      instanceProps[this.itemsIndexAs] = true;\n      this.__ctor = templatize(template, this, {\n        mutableData: this.mutableData,\n        parentModel: true,\n        instanceProps: instanceProps,\n        /**\n         * @this {DomRepeat}\n         * @param {string} prop Property to set\n         * @param {*} value Value to set property to\n         */\n        forwardHostProp: function(prop, value) {\n          let i$ = this.__instances;\n          for (let i=0, inst; (i<i$.length) && (inst=i$[i]); i++) {\n            inst.forwardHostProp(prop, value);\n          }\n        },\n        /**\n         * @this {DomRepeat}\n         * @param {Object} inst Instance to notify\n         * @param {string} prop Property to notify\n         * @param {*} value Value to notify\n         */\n        notifyInstanceProp: function(inst, prop, value) {\n          if (matches(this.as, prop)) {\n            let idx = inst[this.itemsIndexAs];\n            if (prop == this.as) {\n              this.items[idx] = value;\n            }\n            let path = translate(this.as, 'items.' + idx, prop);\n            this.notifyPath(path, value);\n          }\n        }\n      });\n    }\n    return true;\n  }\n\n  __getMethodHost() {\n    // Technically this should be the owner of the outermost template.\n    // In shadow dom, this is always getRootNode().host, but we can\n    // approximate this via cooperation with our dataHost always setting\n    // `_methodHost` as long as there were bindings (or id's) on this\n    // instance causing it to get a dataHost.\n    return this.__dataHost._methodHost || this.__dataHost;\n  }\n\n  __functionFromPropertyValue(functionOrMethodName) {\n    if (typeof functionOrMethodName === 'string') {\n      let methodName = functionOrMethodName;\n      let obj = this.__getMethodHost();\n      return function() { return obj[methodName].apply(obj, arguments); };\n    }\n\n    return functionOrMethodName;\n  }\n\n  __sortChanged(sort) {\n    this.__sortFn = this.__functionFromPropertyValue(sort);\n    if (this.items) { this.__debounceRender(this.__render); }\n  }\n\n  __filterChanged(filter) {\n    this.__filterFn = this.__functionFromPropertyValue(filter);\n    if (this.items) { this.__debounceRender(this.__render); }\n  }\n\n  __computeFrameTime(rate) {\n    return Math.ceil(1000/rate);\n  }\n\n  __initializeChunking() {\n    if (this.initialCount) {\n      this.__limit = this.initialCount;\n      this.__chunkCount = this.initialCount;\n      this.__lastChunkTime = performance.now();\n    }\n  }\n\n  __tryRenderChunk() {\n    // Debounced so that multiple calls through `_render` between animation\n    // frames only queue one new rAF (e.g. array mutation & chunked render)\n    if (this.items && this.__limit < this.items.length) {\n      this.__debounceRender(this.__requestRenderChunk);\n    }\n  }\n\n  __requestRenderChunk() {\n    requestAnimationFrame(()=>this.__renderChunk());\n  }\n\n  __renderChunk() {\n    // Simple auto chunkSize throttling algorithm based on feedback loop:\n    // measure actual time between frames and scale chunk count by ratio\n    // of target/actual frame time\n    let currChunkTime = performance.now();\n    let ratio = this._targetFrameTime / (currChunkTime - this.__lastChunkTime);\n    this.__chunkCount = Math.round(this.__chunkCount * ratio) || 1;\n    this.__limit += this.__chunkCount;\n    this.__lastChunkTime = currChunkTime;\n    this.__debounceRender(this.__render);\n  }\n\n  __observeChanged() {\n    this.__observePaths = this.observe &&\n      this.observe.replace('.*', '.').split(' ');\n  }\n\n  __itemsChanged(change) {\n    if (this.items && !Array.isArray(this.items)) {\n      console.warn('dom-repeat expected array for `items`, found', this.items);\n    }\n    // If path was to an item (e.g. 'items.3' or 'items.3.foo'), forward the\n    // path to that instance synchronously (returns false for non-item paths)\n    if (!this.__handleItemPath(change.path, change.value)) {\n      // Otherwise, the array was reset ('items') or spliced ('items.splices'),\n      // so queue a full refresh\n      this.__initializeChunking();\n      this.__debounceRender(this.__render);\n    }\n  }\n\n  __handleObservedPaths(path) {\n    // Handle cases where path changes should cause a re-sort/filter\n    if (this.__sortFn || this.__filterFn) {\n      if (!path) {\n        // Always re-render if the item itself changed\n        this.__debounceRender(this.__render, this.delay);\n      } else if (this.__observePaths) {\n        // Otherwise, re-render if the path changed matches an observed path\n        let paths = this.__observePaths;\n        for (let i=0; i<paths.length; i++) {\n          if (path.indexOf(paths[i]) === 0) {\n            this.__debounceRender(this.__render, this.delay);\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * @param {function(this:DomRepeat)} fn Function to debounce.\n   * @param {number=} delay Delay in ms to debounce by.\n   */\n  __debounceRender(fn, delay = 0) {\n    this.__renderDebouncer = Debouncer.debounce(\n          this.__renderDebouncer\n        , delay > 0 ? timeOut.after(delay) : microTask\n        , fn.bind(this));\n    enqueueDebouncer(this.__renderDebouncer);\n  }\n\n  /**\n   * Forces the element to render its content. Normally rendering is\n   * asynchronous to a provoking change. This is done for efficiency so\n   * that multiple changes trigger only a single render. The render method\n   * should be called if, for example, template rendering is required to\n   * validate application state.\n   * @return {void}\n   */\n  render() {\n    // Queue this repeater, then flush all in order\n    this.__debounceRender(this.__render);\n    flush();\n  }\n\n  __render() {\n    if (!this.__ensureTemplatized()) {\n      // No template found yet\n      return;\n    }\n    this.__applyFullRefresh();\n    // Reset the pool\n    // TODO(kschaaf): Reuse pool across turns and nested templates\n    // Now that objects/arrays are re-evaluated when set, we can safely\n    // reuse pooled instances across turns, however we still need to decide\n    // semantics regarding how long to hold, how many to hold, etc.\n    this.__pool.length = 0;\n    // Set rendered item count\n    this._setRenderedItemCount(this.__instances.length);\n    // Notify users\n    this.dispatchEvent(new CustomEvent('dom-change', {\n      bubbles: true,\n      composed: true\n    }));\n    // Check to see if we need to render more items\n    this.__tryRenderChunk();\n  }\n\n  __applyFullRefresh() {\n    let items = this.items || [];\n    let isntIdxToItemsIdx = new Array(items.length);\n    for (let i=0; i<items.length; i++) {\n      isntIdxToItemsIdx[i] = i;\n    }\n    // Apply user filter\n    if (this.__filterFn) {\n      isntIdxToItemsIdx = isntIdxToItemsIdx.filter((i, idx, array) =>\n        this.__filterFn(items[i], idx, array));\n    }\n    // Apply user sort\n    if (this.__sortFn) {\n      isntIdxToItemsIdx.sort((a, b) => this.__sortFn(items[a], items[b]));\n    }\n    // items->inst map kept for item path forwarding\n    const itemsIdxToInstIdx = this.__itemsIdxToInstIdx = {};\n    let instIdx = 0;\n    // Generate instances and assign items\n    const limit = Math.min(isntIdxToItemsIdx.length, this.__limit);\n    for (; instIdx<limit; instIdx++) {\n      let inst = this.__instances[instIdx];\n      let itemIdx = isntIdxToItemsIdx[instIdx];\n      let item = items[itemIdx];\n      itemsIdxToInstIdx[itemIdx] = instIdx;\n      if (inst) {\n        inst._setPendingProperty(this.as, item);\n        inst._setPendingProperty(this.indexAs, instIdx);\n        inst._setPendingProperty(this.itemsIndexAs, itemIdx);\n        inst._flushProperties();\n      } else {\n        this.__insertInstance(item, instIdx, itemIdx);\n      }\n    }\n    // Remove any extra instances from previous state\n    for (let i=this.__instances.length-1; i>=instIdx; i--) {\n      this.__detachAndRemoveInstance(i);\n    }\n  }\n\n  __detachInstance(idx) {\n    let inst = this.__instances[idx];\n    for (let i=0; i<inst.children.length; i++) {\n      let el = inst.children[i];\n      inst.root.appendChild(el);\n    }\n    return inst;\n  }\n\n  __attachInstance(idx, parent) {\n    let inst = this.__instances[idx];\n    parent.insertBefore(inst.root, this);\n  }\n\n  __detachAndRemoveInstance(idx) {\n    let inst = this.__detachInstance(idx);\n    if (inst) {\n      this.__pool.push(inst);\n    }\n    this.__instances.splice(idx, 1);\n  }\n\n  __stampInstance(item, instIdx, itemIdx) {\n    let model = {};\n    model[this.as] = item;\n    model[this.indexAs] = instIdx;\n    model[this.itemsIndexAs] = itemIdx;\n    return new this.__ctor(model);\n  }\n\n  __insertInstance(item, instIdx, itemIdx) {\n    let inst = this.__pool.pop();\n    if (inst) {\n      // TODO(kschaaf): If the pool is shared across turns, hostProps\n      // need to be re-set to reused instances in addition to item\n      inst._setPendingProperty(this.as, item);\n      inst._setPendingProperty(this.indexAs, instIdx);\n      inst._setPendingProperty(this.itemsIndexAs, itemIdx);\n      inst._flushProperties();\n    } else {\n      inst = this.__stampInstance(item, instIdx, itemIdx);\n    }\n    let beforeRow = this.__instances[instIdx + 1];\n    let beforeNode = beforeRow ? beforeRow.children[0] : this;\n    this.parentNode.insertBefore(inst.root, beforeNode);\n    this.__instances[instIdx] = inst;\n    return inst;\n  }\n\n  // Implements extension point from Templatize mixin\n  /**\n   * Shows or hides the template instance top level child elements. For\n   * text nodes, `textContent` is removed while \"hidden\" and replaced when\n   * \"shown.\"\n   * @param {boolean} hidden Set to true to hide the children;\n   * set to false to show them.\n   * @return {void}\n   * @protected\n   */\n  _showHideChildren(hidden) {\n    for (let i=0; i<this.__instances.length; i++) {\n      this.__instances[i]._showHideChildren(hidden);\n    }\n  }\n\n  // Called as a side effect of a host items.<key>.<path> path change,\n  // responsible for notifying item.<path> changes to inst for key\n  __handleItemPath(path, value) {\n    let itemsPath = path.slice(6); // 'items.'.length == 6\n    let dot = itemsPath.indexOf('.');\n    let itemsIdx = dot < 0 ? itemsPath : itemsPath.substring(0, dot);\n    // If path was index into array...\n    if (itemsIdx == parseInt(itemsIdx, 10)) {\n      let itemSubPath = dot < 0 ? '' : itemsPath.substring(dot+1);\n      // If the path is observed, it will trigger a full refresh\n      this.__handleObservedPaths(itemSubPath);\n      // Note, even if a rull refresh is triggered, always do the path\n      // notification because unless mutableData is used for dom-repeat\n      // and all elements in the instance subtree, a full refresh may\n      // not trigger the proper update.\n      let instIdx = this.__itemsIdxToInstIdx[itemsIdx];\n      let inst = this.__instances[instIdx];\n      if (inst) {\n        let itemPath = this.as + (itemSubPath ? '.' + itemSubPath : '');\n        // This is effectively `notifyPath`, but avoids some of the overhead\n        // of the public API\n        inst._setPendingPropertyOrPath(itemPath, value, false, true);\n        inst._flushProperties();\n      }\n      return true;\n    }\n  }\n\n  /**\n   * Returns the item associated with a given element stamped by\n   * this `dom-repeat`.\n   *\n   * Note, to modify sub-properties of the item,\n   * `modelForElement(el).set('item.<sub-prop>', value)`\n   * should be used.\n   *\n   * @param {!HTMLElement} el Element for which to return the item.\n   * @return {*} Item associated with the element.\n   */\n  itemForElement(el) {\n    let instance = this.modelForElement(el);\n    return instance && instance[this.as];\n  }\n\n  /**\n   * Returns the inst index for a given element stamped by this `dom-repeat`.\n   * If `sort` is provided, the index will reflect the sorted order (rather\n   * than the original array order).\n   *\n   * @param {!HTMLElement} el Element for which to return the index.\n   * @return {?number} Row index associated with the element (note this may\n   *   not correspond to the array index if a user `sort` is applied).\n   */\n  indexForElement(el) {\n    let instance = this.modelForElement(el);\n    return instance && instance[this.indexAs];\n  }\n\n  /**\n   * Returns the template \"model\" associated with a given element, which\n   * serves as the binding scope for the template instance the element is\n   * contained in. A template model\n   * should be used to manipulate data associated with this template instance.\n   *\n   * Example:\n   *\n   *   let model = modelForElement(el);\n   *   if (model.index < 10) {\n   *     model.set('item.checked', true);\n   *   }\n   *\n   * @param {!HTMLElement} el Element for which to return a template model.\n   * @return {TemplateInstanceBase} Model representing the binding scope for\n   *   the element.\n   */\n  modelForElement(el) {\n    return modelForElement(this.template, el);\n  }\n\n}\n\ncustomElements.define(DomRepeat.is, DomRepeat);\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*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { templatize } from '../utils/templatize.js';\nimport { Debouncer } from '../utils/debounce.js';\nimport { enqueueDebouncer, flush } from '../utils/flush.js';\nimport { microTask } from '../utils/async.js';\nimport { root } from '../utils/path.js';\n\n/**\n * The `<dom-if>` element will stamp a light-dom `<template>` child when\n * the `if` property becomes truthy, and the template can use Polymer\n * data-binding and declarative event features when used in the context of\n * a Polymer element's template.\n *\n * When `if` becomes falsy, the stamped content is hidden but not\n * removed from dom. When `if` subsequently becomes truthy again, the content\n * is simply re-shown. This approach is used due to its favorable performance\n * characteristics: the expense of creating template content is paid only\n * once and lazily.\n *\n * Set the `restamp` property to true to force the stamped content to be\n * created / destroyed when the `if` condition changes.\n *\n * @customElement\n * @polymer\n * @extends PolymerElement\n * @summary Custom element that conditionally stamps and hides or removes\n *   template content based on a boolean flag.\n */\nexport class DomIf extends PolymerElement {\n\n  // Not needed to find template; can be removed once the analyzer\n  // can find the tag name from customElements.define call\n  static get is() { return 'dom-if'; }\n\n  static get template() { return null; }\n\n  static get properties() {\n\n    return {\n\n      /**\n       * Fired whenever DOM is added or removed/hidden by this template (by\n       * default, rendering occurs lazily).  To force immediate rendering, call\n       * `render`.\n       *\n       * @event dom-change\n       */\n\n      /**\n       * A boolean indicating whether this template should stamp.\n       */\n      if: {\n        type: Boolean,\n        observer: '__debounceRender'\n      },\n\n      /**\n       * When true, elements will be removed from DOM and discarded when `if`\n       * becomes false and re-created and added back to the DOM when `if`\n       * becomes true.  By default, stamped elements will be hidden but left\n       * in the DOM when `if` becomes false, which is generally results\n       * in better performance.\n       */\n      restamp: {\n        type: Boolean,\n        observer: '__debounceRender'\n      }\n\n    };\n\n  }\n\n  constructor() {\n    super();\n    this.__renderDebouncer = null;\n    this.__invalidProps = null;\n    this.__instance = null;\n    this._lastIf = false;\n    this.__ctor = null;\n    this.__hideTemplateChildren__ = false;\n  }\n\n  __debounceRender() {\n    // Render is async for 2 reasons:\n    // 1. To eliminate dom creation trashing if user code thrashes `if` in the\n    //    same turn. This was more common in 1.x where a compound computed\n    //    property could result in the result changing multiple times, but is\n    //    mitigated to a large extent by batched property processing in 2.x.\n    // 2. To avoid double object propagation when a bag including values bound\n    //    to the `if` property as well as one or more hostProps could enqueue\n    //    the <dom-if> to flush before the <template>'s host property\n    //    forwarding. In that scenario creating an instance would result in\n    //    the host props being set once, and then the enqueued changes on the\n    //    template would set properties a second time, potentially causing an\n    //    object to be set to an instance more than once.  Creating the\n    //    instance async from flushing data ensures this doesn't happen. If\n    //    we wanted a sync option in the future, simply having <dom-if> flush\n    //    (or clear) its template's pending host properties before creating\n    //    the instance would also avoid the problem.\n    this.__renderDebouncer = Debouncer.debounce(\n          this.__renderDebouncer\n        , microTask\n        , () => this.__render());\n    enqueueDebouncer(this.__renderDebouncer);\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  disconnectedCallback() {\n    super.disconnectedCallback();\n    if (!this.parentNode ||\n        (this.parentNode.nodeType == Node.DOCUMENT_FRAGMENT_NODE &&\n         !this.parentNode.host)) {\n      this.__teardownInstance();\n    }\n  }\n\n  /**\n   * @override\n   * @return {void}\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.style.display = 'none';\n    if (this.if) {\n      this.__debounceRender();\n    }\n  }\n\n  /**\n   * Forces the element to render its content. Normally rendering is\n   * asynchronous to a provoking change. This is done for efficiency so\n   * that multiple changes trigger only a single render. The render method\n   * should be called if, for example, template rendering is required to\n   * validate application state.\n   * @return {void}\n   */\n  render() {\n    flush();\n  }\n\n  __render() {\n    if (this.if) {\n      if (!this.__ensureInstance()) {\n        // No template found yet\n        return;\n      }\n      this._showHideChildren();\n    } else if (this.restamp) {\n      this.__teardownInstance();\n    }\n    if (!this.restamp && this.__instance) {\n      this._showHideChildren();\n    }\n    if (this.if != this._lastIf) {\n      this.dispatchEvent(new CustomEvent('dom-change', {\n        bubbles: true,\n        composed: true\n      }));\n      this._lastIf = this.if;\n    }\n  }\n\n  __ensureInstance() {\n    let parentNode = this.parentNode;\n    // Guard against element being detached while render was queued\n    if (parentNode) {\n      if (!this.__ctor) {\n        let template = /** @type {HTMLTemplateElement} */(this.querySelector('template'));\n        if (!template) {\n          // Wait until childList changes and template should be there by then\n          let observer = new MutationObserver(() => {\n            if (this.querySelector('template')) {\n              observer.disconnect();\n              this.__render();\n            } else {\n              throw new Error('dom-if requires a <template> child');\n            }\n          });\n          observer.observe(this, {childList: true});\n          return false;\n        }\n        this.__ctor = templatize(template, this, {\n          // dom-if templatizer instances require `mutable: true`, as\n          // `__syncHostProperties` relies on that behavior to sync objects\n          mutableData: true,\n          /**\n           * @param {string} prop Property to forward\n           * @param {*} value Value of property\n           * @this {DomIf}\n           */\n          forwardHostProp: function(prop, value) {\n            if (this.__instance) {\n              if (this.if) {\n                this.__instance.forwardHostProp(prop, value);\n              } else {\n                // If we have an instance but are squelching host property\n                // forwarding due to if being false, note the invalidated\n                // properties so `__syncHostProperties` can sync them the next\n                // time `if` becomes true\n                this.__invalidProps = this.__invalidProps || Object.create(null);\n                this.__invalidProps[root(prop)] = true;\n              }\n            }\n          }\n        });\n      }\n      if (!this.__instance) {\n        this.__instance = new this.__ctor();\n        parentNode.insertBefore(this.__instance.root, this);\n      } else {\n        this.__syncHostProperties();\n        let c$ = this.__instance.children;\n        if (c$ && c$.length) {\n          // Detect case where dom-if was re-attached in new position\n          let lastChild = this.previousSibling;\n          if (lastChild !== c$[c$.length-1]) {\n            for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) {\n              parentNode.insertBefore(n, this);\n            }\n          }\n        }\n      }\n    }\n    return true;\n  }\n\n  __syncHostProperties() {\n    let props = this.__invalidProps;\n    if (props) {\n      for (let prop in props) {\n        this.__instance._setPendingProperty(prop, this.__dataHost[prop]);\n      }\n      this.__invalidProps = null;\n      this.__instance._flushProperties();\n    }\n  }\n\n  __teardownInstance() {\n    if (this.__instance) {\n      let c$ = this.__instance.children;\n      if (c$ && c$.length) {\n        // use first child parent, for case when dom-if may have been detached\n        let parent = c$[0].parentNode;\n          // Instance children may be disconnected from parents when dom-if\n          // detaches if a tree was innerHTML'ed\n          if (parent) {\n          for (let i=0, n; (i<c$.length) && (n=c$[i]); i++) {\n            parent.removeChild(n);\n          }\n        }\n      }\n      this.__instance = null;\n      this.__invalidProps = null;\n    }\n  }\n\n  /**\n   * Shows or hides the template instance top level child elements. For\n   * text nodes, `textContent` is removed while \"hidden\" and replaced when\n   * \"shown.\"\n   * @return {void}\n   * @protected\n   * @suppress {visibility}\n   */\n  _showHideChildren() {\n    let hidden = this.__hideTemplateChildren__ || !this.if;\n    if (this.__instance) {\n      this.__instance._showHideChildren(hidden);\n    }\n  }\n\n}\n\ncustomElements.define(DomIf.is, DomIf);\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*/\nimport { PolymerElement } from '../../polymer-element.js';\n\nimport { dedupingMixin } from '../utils/mixin.js';\nimport { calculateSplices } from '../utils/array-splice.js';\nimport { ElementMixin } from '../mixins/element-mixin.js';\n\n/**\n * Element mixin for recording dynamic associations between item paths in a\n * master `items` array and a `selected` array such that path changes to the\n * master array (at the host) element or elsewhere via data-binding) are\n * correctly propagated to items in the selected array and vice-versa.\n *\n * The `items` property accepts an array of user data, and via the\n * `select(item)` and `deselect(item)` API, updates the `selected` property\n * which may be bound to other parts of the application, and any changes to\n * sub-fields of `selected` item(s) will be kept in sync with items in the\n * `items` array.  When `multi` is false, `selected` is a property\n * representing the last selected item.  When `multi` is true, `selected`\n * is an array of multiply selected items.\n *\n * @polymer\n * @mixinFunction\n * @appliesMixin ElementMixin\n * @summary Element mixin for recording dynamic associations between item paths in a\n * master `items` array and a `selected` array\n */\nlet ArraySelectorMixin = dedupingMixin(superClass => {\n\n  /**\n   * @constructor\n   * @extends {superClass}\n   * @implements {Polymer_ElementMixin}\n   * @private\n   */\n  let elementBase = ElementMixin(superClass);\n\n  /**\n   * @polymer\n   * @mixinClass\n   * @implements {Polymer_ArraySelectorMixin}\n   * @unrestricted\n   */\n  class ArraySelectorMixin extends elementBase {\n\n    static get properties() {\n\n      return {\n\n        /**\n         * An array containing items from which selection will be made.\n         */\n        items: {\n          type: Array,\n        },\n\n        /**\n         * When `true`, multiple items may be selected at once (in this case,\n         * `selected` is an array of currently selected items).  When `false`,\n         * only one item may be selected at a time.\n         */\n        multi: {\n          type: Boolean,\n          value: false,\n        },\n\n        /**\n         * When `multi` is true, this is an array that contains any selected.\n         * When `multi` is false, this is the currently selected item, or `null`\n         * if no item is selected.\n         * @type {?(Object|Array<!Object>)}\n         */\n        selected: {\n          type: Object,\n          notify: true\n        },\n\n        /**\n         * When `multi` is false, this is the currently selected item, or `null`\n         * if no item is selected.\n         * @type {?Object}\n         */\n        selectedItem: {\n          type: Object,\n          notify: true\n        },\n\n        /**\n         * When `true`, calling `select` on an item that is already selected\n         * will deselect the item.\n         */\n        toggle: {\n          type: Boolean,\n          value: false\n        }\n\n      };\n    }\n\n    static get observers() {\n      return ['__updateSelection(multi, items.*)'];\n    }\n\n    constructor() {\n      super();\n      this.__lastItems = null;\n      this.__lastMulti = null;\n      this.__selectedMap = null;\n    }\n\n    __updateSelection(multi, itemsInfo) {\n      let path = itemsInfo.path;\n      if (path == 'items') {\n        // Case 1 - items array changed, so diff against previous array and\n        // deselect any removed items and adjust selected indices\n        let newItems = itemsInfo.base || [];\n        let lastItems = this.__lastItems;\n        let lastMulti = this.__lastMulti;\n        if (multi !== lastMulti) {\n          this.clearSelection();\n        }\n        if (lastItems) {\n          let splices = calculateSplices(newItems, lastItems);\n          this.__applySplices(splices);\n        }\n        this.__lastItems = newItems;\n        this.__lastMulti = multi;\n      } else if (itemsInfo.path == 'items.splices') {\n        // Case 2 - got specific splice information describing the array mutation:\n        // deselect any removed items and adjust selected indices\n        this.__applySplices(itemsInfo.value.indexSplices);\n      } else {\n        // Case 3 - an array element was changed, so deselect the previous\n        // item for that index if it was previously selected\n        let part = path.slice('items.'.length);\n        let idx = parseInt(part, 10);\n        if ((part.indexOf('.') < 0) && part == idx) {\n          this.__deselectChangedIdx(idx);\n        }\n      }\n    }\n\n    __applySplices(splices) {\n      let selected = this.__selectedMap;\n      // Adjust selected indices and mark removals\n      for (let i=0; i<splices.length; i++) {\n        let s = splices[i];\n        selected.forEach((idx, item) => {\n          if (idx < s.index) {\n            // no change\n          } else if (idx >= s.index + s.removed.length) {\n            // adjust index\n            selected.set(item, idx + s.addedCount - s.removed.length);\n          } else {\n            // remove index\n            selected.set(item, -1);\n          }\n        });\n        for (let j=0; j<s.addedCount; j++) {\n          let idx = s.index + j;\n          if (selected.has(this.items[idx])) {\n            selected.set(this.items[idx], idx);\n          }\n        }\n      }\n      // Update linked paths\n      this.__updateLinks();\n      // Remove selected items that were removed from the items array\n      let sidx = 0;\n      selected.forEach((idx, item) => {\n        if (idx < 0) {\n          if (this.multi) {\n            this.splice('selected', sidx, 1);\n          } else {\n            this.selected = this.selectedItem = null;\n          }\n          selected.delete(item);\n        } else {\n          sidx++;\n        }\n      });\n    }\n\n    __updateLinks() {\n      this.__dataLinkedPaths = {};\n      if (this.multi) {\n        let sidx = 0;\n        this.__selectedMap.forEach(idx => {\n          if (idx >= 0) {\n            this.linkPaths('items.' + idx, 'selected.' + sidx++);\n          }\n        });\n      } else {\n        this.__selectedMap.forEach(idx => {\n          this.linkPaths('selected', 'items.' + idx);\n          this.linkPaths('selectedItem', 'items.' + idx);\n        });\n      }\n    }\n\n    /**\n     * Clears the selection state.\n     * @return {void}\n     */\n    clearSelection() {\n      // Unbind previous selection\n      this.__dataLinkedPaths = {};\n      // The selected map stores 3 pieces of information:\n      // key: items array object\n      // value: items array index\n      // order: selected array index\n      this.__selectedMap = new Map();\n      // Initialize selection\n      this.selected = this.multi ? [] : null;\n      this.selectedItem = null;\n    }\n\n    /**\n     * Returns whether the item is currently selected.\n     *\n     * @param {*} item Item from `items` array to test\n     * @return {boolean} Whether the item is selected\n     */\n    isSelected(item) {\n      return this.__selectedMap.has(item);\n    }\n\n    /**\n     * Returns whether the item is currently selected.\n     *\n     * @param {number} idx Index from `items` array to test\n     * @return {boolean} Whether the item is selected\n     */\n    isIndexSelected(idx) {\n      return this.isSelected(this.items[idx]);\n    }\n\n    __deselectChangedIdx(idx) {\n      let sidx = this.__selectedIndexForItemIndex(idx);\n      if (sidx >= 0) {\n        let i = 0;\n        this.__selectedMap.forEach((idx, item) => {\n          if (sidx == i++) {\n            this.deselect(item);\n          }\n        });\n      }\n    }\n\n    __selectedIndexForItemIndex(idx) {\n      let selected = this.__dataLinkedPaths['items.' + idx];\n      if (selected) {\n        return parseInt(selected.slice('selected.'.length), 10);\n      }\n    }\n\n    /**\n     * Deselects the given item if it is already selected.\n     *\n     * @param {*} item Item from `items` array to deselect\n     * @return {void}\n     */\n    deselect(item) {\n      let idx = this.__selectedMap.get(item);\n      if (idx >= 0) {\n        this.__selectedMap.delete(item);\n        let sidx;\n        if (this.multi) {\n          sidx = this.__selectedIndexForItemIndex(idx);\n        }\n        this.__updateLinks();\n        if (this.multi) {\n          this.splice('selected', sidx, 1);\n        } else {\n          this.selected = this.selectedItem = null;\n        }\n      }\n    }\n\n    /**\n     * Deselects the given index if it is already selected.\n     *\n     * @param {number} idx Index from `items` array to deselect\n     * @return {void}\n     */\n    deselectIndex(idx) {\n      this.deselect(this.items[idx]);\n    }\n\n    /**\n     * Selects the given item.  When `toggle` is true, this will automatically\n     * deselect the item if already selected.\n     *\n     * @param {*} item Item from `items` array to select\n     * @return {void}\n     */\n    select(item) {\n      this.selectIndex(this.items.indexOf(item));\n    }\n\n    /**\n     * Selects the given index.  When `toggle` is true, this will automatically\n     * deselect the item if already selected.\n     *\n     * @param {number} idx Index from `items` array to select\n     * @return {void}\n     */\n    selectIndex(idx) {\n      let item = this.items[idx];\n      if (!this.isSelected(item)) {\n        if (!this.multi) {\n          this.__selectedMap.clear();\n        }\n        this.__selectedMap.set(item, idx);\n        this.__updateLinks();\n        if (this.multi) {\n          this.push('selected', item);\n        } else {\n          this.selected = this.selectedItem = item;\n        }\n      } else if (this.toggle) {\n        this.deselectIndex(idx);\n      }\n    }\n\n  }\n\n  return ArraySelectorMixin;\n\n});\n\n// export mixin\nexport { ArraySelectorMixin };\n\n/**\n * @constructor\n * @extends {PolymerElement}\n * @implements {Polymer_ArraySelectorMixin}\n * @private\n */\nlet baseArraySelector = ArraySelectorMixin(PolymerElement);\n\n/**\n * Element implementing the `ArraySelector` mixin, which records\n * dynamic associations between item paths in a master `items` array and a\n * `selected` array such that path changes to the master array (at the host)\n * element or elsewhere via data-binding) are correctly propagated to items\n * in the selected array and vice-versa.\n *\n * The `items` property accepts an array of user data, and via the\n * `select(item)` and `deselect(item)` API, updates the `selected` property\n * which may be bound to other parts of the application, and any changes to\n * sub-fields of `selected` item(s) will be kept in sync with items in the\n * `items` array.  When `multi` is false, `selected` is a property\n * representing the last selected item.  When `multi` is true, `selected`\n * is an array of multiply selected items.\n *\n * Example:\n *\n * ```js\n * import {PolymerElement} from '@polymer/polymer';\n * import '@polymer/polymer/lib/elements/array-selector.js';\n *\n * class EmployeeList extends PolymerElement {\n *   static get _template() {\n *     return html`\n *         <div> Employee list: </div>\n *         <dom-repeat id=\"employeeList\" items=\"{{employees}}\">\n *           <template>\n *             <div>First name: <span>{{item.first}}</span></div>\n *               <div>Last name: <span>{{item.last}}</span></div>\n *               <button on-click=\"toggleSelection\">Select</button>\n *           </template>\n *         </dom-repeat>\n *\n *         <array-selector id=\"selector\"\n *                         items=\"{{employees}}\"\n *                         selected=\"{{selected}}\"\n *                         multi toggle></array-selector>\n *\n *         <div> Selected employees: </div>\n *         <dom-repeat items=\"{{selected}}\">\n *           <template>\n *             <div>First name: <span>{{item.first}}</span></div>\n *             <div>Last name: <span>{{item.last}}</span></div>\n *           </template>\n *         </dom-repeat>`;\n *   }\n *   static get is() { return 'employee-list'; }\n *   static get properties() {\n *     return {\n *       employees: {\n *         value() {\n *           return [\n *             {first: 'Bob', last: 'Smith'},\n *             {first: 'Sally', last: 'Johnson'},\n *             ...\n *           ];\n *         }\n *       }\n *     };\n *   }\n *   toggleSelection(e) {\n *     const item = this.$.employeeList.itemForElement(e.target);\n *     this.$.selector.select(item);\n *   }\n * }\n * ```\n *\n * @polymer\n * @customElement\n * @extends {baseArraySelector}\n * @appliesMixin ArraySelectorMixin\n * @summary Custom element that links paths between an input `items` array and\n *   an output `selected` item or array based on calls to its selection API.\n */\nclass ArraySelector extends baseArraySelector {\n  // Not needed to find template; can be removed once the analyzer\n  // can find the tag name from customElements.define call\n  static get is() { return 'array-selector'; }\n}\ncustomElements.define(ArraySelector.is, ArraySelector);\nexport { ArraySelector };\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*/\nimport '@webcomponents/shadycss/entrypoints/custom-style-interface.js';\n\nimport { cssFromModules } from '../utils/style-gather.js';\n\nconst attr = 'include';\n\nconst CustomStyleInterface = window.ShadyCSS.CustomStyleInterface;\n\n/**\n * Custom element for defining styles in the main document that can take\n * advantage of [shady DOM](https://github.com/webcomponents/shadycss) shims\n * for style encapsulation, custom properties, and custom mixins.\n *\n * - Document styles defined in a `<custom-style>` are shimmed to ensure they\n *   do not leak into local DOM when running on browsers without native\n *   Shadow DOM.\n * - Custom properties can be defined in a `<custom-style>`. Use the `html` selector\n *   to define custom properties that apply to all custom elements.\n * - Custom mixins can be defined in a `<custom-style>`, if you import the optional\n *   [apply shim](https://github.com/webcomponents/shadycss#about-applyshim)\n *   (`shadycss/apply-shim.html`).\n *\n * To use:\n *\n * - Import `custom-style.html`.\n * - Place a `<custom-style>` element in the main document, wrapping an inline `<style>` tag that\n *   contains the CSS rules you want to shim.\n *\n * For example:\n *\n * ```html\n * <!-- import apply shim--only required if using mixins -->\n * <link rel=\"import\" href=\"bower_components/shadycss/apply-shim.html\">\n * <!-- import custom-style element -->\n * <link rel=\"import\" href=\"bower_components/polymer/lib/elements/custom-style.html\">\n *\n * <custom-style>\n *   <style>\n *     html {\n *       --custom-color: blue;\n *       --custom-mixin: {\n *         font-weight: bold;\n *         color: red;\n *       };\n *     }\n *   </style>\n * </custom-style>\n * ```\n *\n * @customElement\n * @extends HTMLElement\n * @summary Custom element for defining styles in the main document that can\n *   take advantage of Polymer's style scoping and custom properties shims.\n */\nexport class CustomStyle extends HTMLElement {\n  constructor() {\n    super();\n    this._style = null;\n    CustomStyleInterface.addCustomStyle(this);\n  }\n  /**\n   * Returns the light-DOM `<style>` child this element wraps.  Upon first\n   * call any style modules referenced via the `include` attribute will be\n   * concatenated to this element's `<style>`.\n   *\n   * @export\n   * @return {HTMLStyleElement} This element's light-DOM `<style>`\n   */\n  getStyle() {\n    if (this._style) {\n      return this._style;\n    }\n    const style = /** @type {HTMLStyleElement} */(this.querySelector('style'));\n    if (!style) {\n      return null;\n    }\n    this._style = style;\n    const include = style.getAttribute(attr);\n    if (include) {\n      style.removeAttribute(attr);\n      style.textContent = cssFromModules(include) + style.textContent;\n    }\n    /*\n    HTML Imports styling the main document are deprecated in Chrome\n    https://crbug.com/523952\n\n    If this element is not in the main document, then it must be in an HTML Import document.\n    In that case, move the custom style to the main document.\n\n    The ordering of `<custom-style>` should stay the same as when loaded by HTML Imports, but there may be odd\n    cases of ordering w.r.t the main document styles.\n    */\n    if (this.ownerDocument !== window.document) {\n      window.document.head.appendChild(this);\n    }\n    return this._style;\n  }\n}\n\nwindow.customElements.define('custom-style', CustomStyle);\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*/\nimport { MutableData } from '../mixins/mutable-data.js';\n\nlet mutablePropertyChange;\n/** @suppress {missingProperties} */\n(() => {\n  mutablePropertyChange = MutableData._mutablePropertyChange;\n})();\n\n/**\n * Legacy element behavior to skip strict dirty-checking for objects and arrays,\n * (always consider them to be \"dirty\") for use on legacy API Polymer elements.\n *\n * By default, `Polymer.PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will cause Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\").  This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree.  Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must apply this behavior or enable the\n * `Polymer.OptionalMutableDataBehavior`.\n *\n * In order to make the dirty check strategy configurable, see\n * `Polymer.OptionalMutableDataBehavior`.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse as opposed to using strict dirty checking with immutable\n * patterns or Polymer's path notification API.\n *\n * @polymerBehavior\n * @summary Behavior to skip strict dirty-checking for objects and\n *   arrays\n */\nexport const MutableDataBehavior = {\n\n  /**\n   * Overrides `Polymer.PropertyEffects` to provide option for skipping\n   * strict equality checking for Objects and Arrays.\n   *\n   * This method pulls the value to dirty check against from the `__dataTemp`\n   * cache (rather than the normal `__data` cache) for Objects.  Since the temp\n   * cache is cleared at the end of a turn, this implementation allows\n   * side-effects of deep object changes to be processed by re-setting the\n   * same object (using the temp cache as an in-turn backstop to prevent\n   * cycles due to 2-way notification).\n   *\n   * @param {string} property Property name\n   * @param {*} value New property value\n   * @param {*} old Previous property value\n   * @return {boolean} Whether the property should be considered a change\n   * @protected\n   */\n  _shouldPropertyChange(property, value, old) {\n    return mutablePropertyChange(this, property, value, old, true);\n  }\n};\n\n/**\n * Legacy element behavior to add the optional ability to skip strict\n * dirty-checking for objects and arrays (always consider them to be\n * \"dirty\") by setting a `mutable-data` attribute on an element instance.\n *\n * By default, `Polymer.PropertyEffects` performs strict dirty checking on\n * objects, which means that any deep modifications to an object or array will\n * not be propagated unless \"immutable\" data patterns are used (i.e. all object\n * references from the root to the mutation were changed).\n *\n * Polymer also provides a proprietary data mutation and path notification API\n * (e.g. `notifyPath`, `set`, and array mutation API's) that allow efficient\n * mutation and notification of deep changes in an object graph to all elements\n * bound to the same object graph.\n *\n * In cases where neither immutable patterns nor the data mutation API can be\n * used, applying this mixin will allow Polymer to skip dirty checking for\n * objects and arrays (always consider them to be \"dirty\").  This allows a\n * user to make a deep modification to a bound object graph, and then either\n * simply re-set the object (e.g. `this.items = this.items`) or call `notifyPath`\n * (e.g. `this.notifyPath('items')`) to update the tree.  Note that all\n * elements that wish to be updated based on deep mutations must apply this\n * mixin or otherwise skip strict dirty checking for objects/arrays.\n * Specifically, any elements in the binding tree between the source of a\n * mutation and the consumption of it must enable this behavior or apply the\n * `Polymer.OptionalMutableDataBehavior`.\n *\n * While this behavior adds the ability to forgo Object/Array dirty checking,\n * the `mutableData` flag defaults to false and must be set on the instance.\n *\n * Note, the performance characteristics of propagating large object graphs\n * will be worse by relying on `mutableData: true` as opposed to using\n * strict dirty checking with immutable patterns or Polymer's path notification\n * API.\n *\n * @polymerBehavior\n * @summary Behavior to optionally skip strict dirty-checking for objects and\n *   arrays\n */\nexport const OptionalMutableDataBehavior = {\n\n  properties: {\n    /**\n     * Instance-level flag for configuring the dirty-checking strategy\n     * for this element.  When true, Objects and Arrays will skip dirty\n     * checking, otherwise strict equality checking will be used.\n     */\n    mutableData: Boolean\n  },\n\n  /**\n   * Overrides `Polymer.PropertyEffects` to skip strict equality checking\n   * for Objects and Arrays.\n   *\n   * Pulls the value to dirty check against from the `__dataTemp` cache\n   * (rather than the normal `__data` cache) for Objects.  Since the temp\n   * cache is cleared at the end of a turn, this implementation allows\n   * side-effects of deep object changes to be processed by re-setting the\n   * same object (using the temp cache as an in-turn backstop to prevent\n   * cycles due to 2-way notification).\n   *\n   * @param {string} property Property name\n   * @param {*} value New property value\n   * @param {*} old Previous property value\n   * @return {boolean} Whether the property should be considered a change\n   * @this {this}\n   * @protected\n   */\n  _shouldPropertyChange(property, value, old) {\n    return mutablePropertyChange(this, property, value, old, this.mutableData);\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\nimport { LegacyElementMixin } from './lib/legacy/legacy-element-mixin.js';\nexport { Polymer } from  './lib/legacy/polymer-fn.js';\n/* template elements */\nimport './lib/legacy/templatizer-behavior.js';\nimport './lib/elements/dom-bind.js';\nimport './lib/elements/dom-repeat.js';\nimport './lib/elements/dom-if.js';\nimport './lib/elements/array-selector.js';\n/* custom-style */\nimport './lib/elements/custom-style.js';\n/* bc behaviors */\nimport './lib/legacy/mutable-data-behavior.js';\n/* import html-tag to export html */\nexport { html } from './lib/utils/html-tag.js';\n\n// bc\nexport const Base = LegacyElementMixin(HTMLElement).prototype;\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\n\n/**\n`Polymer.IronFitBehavior` fits an element in another element using `max-height`\nand `max-width`, and optionally centers it in the window or another element.\n\nThe element will only be sized and/or positioned if it has not already been\nsized and/or positioned by CSS.\n\nCSS properties            | Action\n--------------------------|-------------------------------------------\n`position` set            | Element is not centered horizontally or vertically\n`top` or `bottom` set     | Element is not vertically centered\n`left` or `right` set     | Element is not horizontally centered\n`max-height` set          | Element respects `max-height`\n`max-width` set           | Element respects `max-width`\n\n`Polymer.IronFitBehavior` can position an element into another element using\n`verticalAlign` and `horizontalAlign`. This will override the element's css\nposition.\n\n    <div class=\"container\">\n      <iron-fit-impl vertical-align=\"top\" horizontal-align=\"auto\">\n        Positioned into the container\n      </iron-fit-impl>\n    </div>\n\nUse `noOverlap` to position the element around another element without\noverlapping it.\n\n    <div class=\"container\">\n      <iron-fit-impl no-overlap vertical-align=\"auto\" horizontal-align=\"auto\">\n        Positioned around the container\n      </iron-fit-impl>\n    </div>\n\nUse `horizontalOffset, verticalOffset` to offset the element from its\n`positionTarget`; `Polymer.IronFitBehavior` will collapse these in order to\nkeep the element within `fitInto` boundaries, while preserving the element's\nCSS margin values.\n\n    <div class=\"container\">\n      <iron-fit-impl vertical-align=\"top\" vertical-offset=\"20\">\n        With vertical offset\n      </iron-fit-impl>\n    </div>\n\n@demo demo/index.html\n@polymerBehavior\n*/\nexport const IronFitBehavior = {\n\n  properties: {\n\n    /**\n     * The element that will receive a `max-height`/`width`. By default it is\n     * the same as `this`, but it can be set to a child element. This is useful,\n     * for example, for implementing a scrolling region inside the element.\n     * @type {!Element}\n     */\n    sizingTarget: {\n      type: Object,\n      value: function() {\n        return this;\n      }\n    },\n\n    /**\n     * The element to fit `this` into.\n     */\n    fitInto: {type: Object, value: window},\n\n    /**\n     * Will position the element around the positionTarget without overlapping\n     * it.\n     */\n    noOverlap: {type: Boolean},\n\n    /**\n     * The element that should be used to position the element. If not set, it\n     * will default to the parent node.\n     * @type {!Element}\n     */\n    positionTarget: {type: Element},\n\n    /**\n     * The orientation against which to align the element horizontally\n     * relative to the `positionTarget`. Possible values are \"left\", \"right\",\n     * \"center\", \"auto\".\n     */\n    horizontalAlign: {type: String},\n\n    /**\n     * The orientation against which to align the element vertically\n     * relative to the `positionTarget`. Possible values are \"top\", \"bottom\",\n     * \"middle\", \"auto\".\n     */\n    verticalAlign: {type: String},\n\n    /**\n     * If true, it will use `horizontalAlign` and `verticalAlign` values as\n     * preferred alignment and if there's not enough space, it will pick the\n     * values which minimize the cropping.\n     */\n    dynamicAlign: {type: Boolean},\n\n    /**\n     * A pixel value that will be added to the position calculated for the\n     * given `horizontalAlign`, in the direction of alignment. You can think\n     * of it as increasing or decreasing the distance to the side of the\n     * screen given by `horizontalAlign`.\n     *\n     * If `horizontalAlign` is \"left\" or \"center\", this offset will increase or\n     * decrease the distance to the left side of the screen: a negative offset\n     * will move the dropdown to the left; a positive one, to the right.\n     *\n     * Conversely if `horizontalAlign` is \"right\", this offset will increase\n     * or decrease the distance to the right side of the screen: a negative\n     * offset will move the dropdown to the right; a positive one, to the left.\n     */\n    horizontalOffset: {type: Number, value: 0, notify: true},\n\n    /**\n     * A pixel value that will be added to the position calculated for the\n     * given `verticalAlign`, in the direction of alignment. You can think\n     * of it as increasing or decreasing the distance to the side of the\n     * screen given by `verticalAlign`.\n     *\n     * If `verticalAlign` is \"top\" or \"middle\", this offset will increase or\n     * decrease the distance to the top side of the screen: a negative offset\n     * will move the dropdown upwards; a positive one, downwards.\n     *\n     * Conversely if `verticalAlign` is \"bottom\", this offset will increase\n     * or decrease the distance to the bottom side of the screen: a negative\n     * offset will move the dropdown downwards; a positive one, upwards.\n     */\n    verticalOffset: {type: Number, value: 0, notify: true},\n\n    /**\n     * Set to true to auto-fit on attach.\n     */\n    autoFitOnAttach: {type: Boolean, value: false},\n\n    /** @type {?Object} */\n    _fitInfo: {type: Object}\n  },\n\n  get _fitWidth() {\n    var fitWidth;\n    if (this.fitInto === window) {\n      fitWidth = this.fitInto.innerWidth;\n    } else {\n      fitWidth = this.fitInto.getBoundingClientRect().width;\n    }\n    return fitWidth;\n  },\n\n  get _fitHeight() {\n    var fitHeight;\n    if (this.fitInto === window) {\n      fitHeight = this.fitInto.innerHeight;\n    } else {\n      fitHeight = this.fitInto.getBoundingClientRect().height;\n    }\n    return fitHeight;\n  },\n\n  get _fitLeft() {\n    var fitLeft;\n    if (this.fitInto === window) {\n      fitLeft = 0;\n    } else {\n      fitLeft = this.fitInto.getBoundingClientRect().left;\n    }\n    return fitLeft;\n  },\n\n  get _fitTop() {\n    var fitTop;\n    if (this.fitInto === window) {\n      fitTop = 0;\n    } else {\n      fitTop = this.fitInto.getBoundingClientRect().top;\n    }\n    return fitTop;\n  },\n\n  /**\n   * The element that should be used to position the element,\n   * if no position target is configured.\n   */\n  get _defaultPositionTarget() {\n    var parent = dom(this).parentNode;\n\n    if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n      parent = parent.host;\n    }\n\n    return parent;\n  },\n\n  /**\n   * The horizontal align value, accounting for the RTL/LTR text direction.\n   */\n  get _localeHorizontalAlign() {\n    if (this._isRTL) {\n      // In RTL, \"left\" becomes \"right\".\n      if (this.horizontalAlign === 'right') {\n        return 'left';\n      }\n      if (this.horizontalAlign === 'left') {\n        return 'right';\n      }\n    }\n    return this.horizontalAlign;\n  },\n\n  /**\n   * True if the element should be positioned instead of centered.\n   * @private\n   */\n  get __shouldPosition() {\n    return (this.horizontalAlign || this.verticalAlign) && this.positionTarget;\n  },\n\n  attached: function() {\n    // Memoize this to avoid expensive calculations & relayouts.\n    // Make sure we do it only once\n    if (typeof this._isRTL === 'undefined') {\n      this._isRTL = window.getComputedStyle(this).direction == 'rtl';\n    }\n    this.positionTarget = this.positionTarget || this._defaultPositionTarget;\n    if (this.autoFitOnAttach) {\n      if (window.getComputedStyle(this).display === 'none') {\n        setTimeout(function() {\n          this.fit();\n        }.bind(this));\n      } else {\n        // NOTE: shadydom applies distribution asynchronously\n        // for performance reasons webcomponents/shadydom#120\n        // Flush to get correct layout info.\n        window.ShadyDOM && ShadyDOM.flush();\n        this.fit();\n      }\n    }\n  },\n\n  detached: function() {\n    if (this.__deferredFit) {\n      clearTimeout(this.__deferredFit);\n      this.__deferredFit = null;\n    }\n  },\n\n  /**\n   * Positions and fits the element into the `fitInto` element.\n   */\n  fit: function() {\n    this.position();\n    this.constrain();\n    this.center();\n  },\n\n  /**\n   * Memoize information needed to position and size the target element.\n   * @suppress {deprecated}\n   */\n  _discoverInfo: function() {\n    if (this._fitInfo) {\n      return;\n    }\n    var target = window.getComputedStyle(this);\n    var sizer = window.getComputedStyle(this.sizingTarget);\n\n    this._fitInfo = {\n      inlineStyle: {\n        top: this.style.top || '',\n        left: this.style.left || '',\n        position: this.style.position || ''\n      },\n      sizerInlineStyle: {\n        maxWidth: this.sizingTarget.style.maxWidth || '',\n        maxHeight: this.sizingTarget.style.maxHeight || '',\n        boxSizing: this.sizingTarget.style.boxSizing || ''\n      },\n      positionedBy: {\n        vertically: target.top !== 'auto' ?\n            'top' :\n            (target.bottom !== 'auto' ? 'bottom' : null),\n        horizontally: target.left !== 'auto' ?\n            'left' :\n            (target.right !== 'auto' ? 'right' : null)\n      },\n      sizedBy: {\n        height: sizer.maxHeight !== 'none',\n        width: sizer.maxWidth !== 'none',\n        minWidth: parseInt(sizer.minWidth, 10) || 0,\n        minHeight: parseInt(sizer.minHeight, 10) || 0\n      },\n      margin: {\n        top: parseInt(target.marginTop, 10) || 0,\n        right: parseInt(target.marginRight, 10) || 0,\n        bottom: parseInt(target.marginBottom, 10) || 0,\n        left: parseInt(target.marginLeft, 10) || 0\n      }\n    };\n  },\n\n  /**\n   * Resets the target element's position and size constraints, and clear\n   * the memoized data.\n   */\n  resetFit: function() {\n    var info = this._fitInfo || {};\n    for (var property in info.sizerInlineStyle) {\n      this.sizingTarget.style[property] = info.sizerInlineStyle[property];\n    }\n    for (var property in info.inlineStyle) {\n      this.style[property] = info.inlineStyle[property];\n    }\n\n    this._fitInfo = null;\n  },\n\n  /**\n   * Equivalent to calling `resetFit()` and `fit()`. Useful to call this after\n   * the element or the `fitInto` element has been resized, or if any of the\n   * positioning properties (e.g. `horizontalAlign, verticalAlign`) is updated.\n   * It preserves the scroll position of the sizingTarget.\n   */\n  refit: function() {\n    var scrollLeft = this.sizingTarget.scrollLeft;\n    var scrollTop = this.sizingTarget.scrollTop;\n    this.resetFit();\n    this.fit();\n    this.sizingTarget.scrollLeft = scrollLeft;\n    this.sizingTarget.scrollTop = scrollTop;\n  },\n\n  /**\n   * Positions the element according to `horizontalAlign, verticalAlign`.\n   */\n  position: function() {\n    if (!this.__shouldPosition) {\n      // needs to be centered, and it is done after constrain.\n      return;\n    }\n    this._discoverInfo();\n\n    this.style.position = 'fixed';\n    // Need border-box for margin/padding.\n    this.sizingTarget.style.boxSizing = 'border-box';\n    // Set to 0, 0 in order to discover any offset caused by parent stacking\n    // contexts.\n    this.style.left = '0px';\n    this.style.top = '0px';\n\n    var rect = this.getBoundingClientRect();\n    var positionRect = this.__getNormalizedRect(this.positionTarget);\n    var fitRect = this.__getNormalizedRect(this.fitInto);\n\n    var margin = this._fitInfo.margin;\n\n    // Consider the margin as part of the size for position calculations.\n    var size = {\n      width: rect.width + margin.left + margin.right,\n      height: rect.height + margin.top + margin.bottom\n    };\n\n    var position = this.__getPosition(\n        this._localeHorizontalAlign,\n        this.verticalAlign,\n        size,\n        rect,\n        positionRect,\n        fitRect);\n\n    var left = position.left + margin.left;\n    var top = position.top + margin.top;\n\n    // We first limit right/bottom within fitInto respecting the margin,\n    // then use those values to limit top/left.\n    var right = Math.min(fitRect.right - margin.right, left + rect.width);\n    var bottom = Math.min(fitRect.bottom - margin.bottom, top + rect.height);\n\n    // Keep left/top within fitInto respecting the margin.\n    left = Math.max(\n        fitRect.left + margin.left,\n        Math.min(left, right - this._fitInfo.sizedBy.minWidth));\n    top = Math.max(\n        fitRect.top + margin.top,\n        Math.min(top, bottom - this._fitInfo.sizedBy.minHeight));\n\n    // Use right/bottom to set maxWidth/maxHeight, and respect\n    // minWidth/minHeight.\n    this.sizingTarget.style.maxWidth =\n        Math.max(right - left, this._fitInfo.sizedBy.minWidth) + 'px';\n    this.sizingTarget.style.maxHeight =\n        Math.max(bottom - top, this._fitInfo.sizedBy.minHeight) + 'px';\n\n    // Remove the offset caused by any stacking context.\n    this.style.left = (left - rect.left) + 'px';\n    this.style.top = (top - rect.top) + 'px';\n  },\n\n  /**\n   * Constrains the size of the element to `fitInto` by setting `max-height`\n   * and/or `max-width`.\n   */\n  constrain: function() {\n    if (this.__shouldPosition) {\n      return;\n    }\n    this._discoverInfo();\n\n    var info = this._fitInfo;\n    // position at (0px, 0px) if not already positioned, so we can measure the\n    // natural size.\n    if (!info.positionedBy.vertically) {\n      this.style.position = 'fixed';\n      this.style.top = '0px';\n    }\n    if (!info.positionedBy.horizontally) {\n      this.style.position = 'fixed';\n      this.style.left = '0px';\n    }\n\n    // need border-box for margin/padding\n    this.sizingTarget.style.boxSizing = 'border-box';\n    // constrain the width and height if not already set\n    var rect = this.getBoundingClientRect();\n    if (!info.sizedBy.height) {\n      this.__sizeDimension(\n          rect, info.positionedBy.vertically, 'top', 'bottom', 'Height');\n    }\n    if (!info.sizedBy.width) {\n      this.__sizeDimension(\n          rect, info.positionedBy.horizontally, 'left', 'right', 'Width');\n    }\n  },\n\n  /**\n   * @protected\n   * @deprecated\n   */\n  _sizeDimension: function(rect, positionedBy, start, end, extent) {\n    this.__sizeDimension(rect, positionedBy, start, end, extent);\n  },\n\n  /**\n   * @private\n   */\n  __sizeDimension: function(rect, positionedBy, start, end, extent) {\n    var info = this._fitInfo;\n    var fitRect = this.__getNormalizedRect(this.fitInto);\n    var max = extent === 'Width' ? fitRect.width : fitRect.height;\n    var flip = (positionedBy === end);\n    var offset = flip ? max - rect[end] : rect[start];\n    var margin = info.margin[flip ? start : end];\n    var offsetExtent = 'offset' + extent;\n    var sizingOffset = this[offsetExtent] - this.sizingTarget[offsetExtent];\n    this.sizingTarget.style['max' + extent] =\n        (max - margin - offset - sizingOffset) + 'px';\n  },\n\n  /**\n   * Centers horizontally and vertically if not already positioned. This also\n   * sets `position:fixed`.\n   */\n  center: function() {\n    if (this.__shouldPosition) {\n      return;\n    }\n    this._discoverInfo();\n\n    var positionedBy = this._fitInfo.positionedBy;\n    if (positionedBy.vertically && positionedBy.horizontally) {\n      // Already positioned.\n      return;\n    }\n    // Need position:fixed to center\n    this.style.position = 'fixed';\n    // Take into account the offset caused by parents that create stacking\n    // contexts (e.g. with transform: translate3d). Translate to 0,0 and\n    // measure the bounding rect.\n    if (!positionedBy.vertically) {\n      this.style.top = '0px';\n    }\n    if (!positionedBy.horizontally) {\n      this.style.left = '0px';\n    }\n    // It will take in consideration margins and transforms\n    var rect = this.getBoundingClientRect();\n    var fitRect = this.__getNormalizedRect(this.fitInto);\n    if (!positionedBy.vertically) {\n      var top = fitRect.top - rect.top + (fitRect.height - rect.height) / 2;\n      this.style.top = top + 'px';\n    }\n    if (!positionedBy.horizontally) {\n      var left = fitRect.left - rect.left + (fitRect.width - rect.width) / 2;\n      this.style.left = left + 'px';\n    }\n  },\n\n  __getNormalizedRect: function(target) {\n    if (target === document.documentElement || target === window) {\n      return {\n        top: 0,\n        left: 0,\n        width: window.innerWidth,\n        height: window.innerHeight,\n        right: window.innerWidth,\n        bottom: window.innerHeight\n      };\n    }\n    return target.getBoundingClientRect();\n  },\n\n  __getOffscreenArea: function(position, size, fitRect) {\n    var verticalCrop = Math.min(0, position.top) +\n        Math.min(0, fitRect.bottom - (position.top + size.height));\n    var horizontalCrop = Math.min(0, position.left) +\n        Math.min(0, fitRect.right - (position.left + size.width));\n    return Math.abs(verticalCrop) * size.width +\n        Math.abs(horizontalCrop) * size.height;\n  },\n\n\n  __getPosition: function(\n      hAlign, vAlign, size, sizeNoMargins, positionRect, fitRect) {\n    // All the possible configurations.\n    // Ordered as top-left, top-right, bottom-left, bottom-right.\n    var positions = [\n      {\n        verticalAlign: 'top',\n        horizontalAlign: 'left',\n        top: positionRect.top + this.verticalOffset,\n        left: positionRect.left + this.horizontalOffset\n      },\n      {\n        verticalAlign: 'top',\n        horizontalAlign: 'right',\n        top: positionRect.top + this.verticalOffset,\n        left: positionRect.right - size.width - this.horizontalOffset\n      },\n      {\n        verticalAlign: 'bottom',\n        horizontalAlign: 'left',\n        top: positionRect.bottom - size.height - this.verticalOffset,\n        left: positionRect.left + this.horizontalOffset\n      },\n      {\n        verticalAlign: 'bottom',\n        horizontalAlign: 'right',\n        top: positionRect.bottom - size.height - this.verticalOffset,\n        left: positionRect.right - size.width - this.horizontalOffset\n      }\n    ];\n\n    if (this.noOverlap) {\n      // Duplicate.\n      for (var i = 0, l = positions.length; i < l; i++) {\n        var copy = {};\n        for (var key in positions[i]) {\n          copy[key] = positions[i][key];\n        }\n        positions.push(copy);\n      }\n      // Horizontal overlap only.\n      positions[0].top = positions[1].top += positionRect.height;\n      positions[2].top = positions[3].top -= positionRect.height;\n      // Vertical overlap only.\n      positions[4].left = positions[6].left += positionRect.width;\n      positions[5].left = positions[7].left -= positionRect.width;\n    }\n\n    // Consider auto as null for coding convenience.\n    vAlign = vAlign === 'auto' ? null : vAlign;\n    hAlign = hAlign === 'auto' ? null : hAlign;\n\n    if (!hAlign || hAlign === 'center') {\n      positions.push({\n        verticalAlign: 'top',\n        horizontalAlign: 'center',\n        top: positionRect.top + this.verticalOffset +\n            (this.noOverlap ? positionRect.height : 0),\n        left: positionRect.left - sizeNoMargins.width / 2 +\n            positionRect.width / 2 + this.horizontalOffset\n      });\n      positions.push({\n        verticalAlign: 'bottom',\n        horizontalAlign: 'center',\n        top: positionRect.bottom - size.height - this.verticalOffset -\n            (this.noOverlap ? positionRect.height : 0),\n        left: positionRect.left - sizeNoMargins.width / 2 +\n            positionRect.width / 2 + this.horizontalOffset\n      });\n    }\n\n    if (!vAlign || vAlign === 'middle') {\n      positions.push({\n        verticalAlign: 'middle',\n        horizontalAlign: 'left',\n        top: positionRect.top - sizeNoMargins.height / 2 +\n            positionRect.height / 2 + this.verticalOffset,\n        left: positionRect.left + this.horizontalOffset +\n            (this.noOverlap ? positionRect.width : 0)\n      });\n      positions.push({\n        verticalAlign: 'middle',\n        horizontalAlign: 'right',\n        top: positionRect.top - sizeNoMargins.height / 2 +\n            positionRect.height / 2 + this.verticalOffset,\n        left: positionRect.right - size.width - this.horizontalOffset -\n            (this.noOverlap ? positionRect.width : 0)\n      });\n    }\n\n    if (vAlign === 'middle' && hAlign === 'center') {\n      positions.push({\n        verticalAlign: 'middle',\n        horizontalAlign: 'center',\n        top: positionRect.top - sizeNoMargins.height / 2 +\n            positionRect.height / 2 + this.verticalOffset,\n        left: positionRect.left - sizeNoMargins.width / 2 +\n            positionRect.width / 2 + this.horizontalOffset\n      });\n    }\n\n    var position;\n    for (var i = 0; i < positions.length; i++) {\n      var candidate = positions[i];\n      var vAlignOk = candidate.verticalAlign === vAlign;\n      var hAlignOk = candidate.horizontalAlign === hAlign;\n\n      // If both vAlign and hAlign are defined, return exact match.\n      // For dynamicAlign and noOverlap we'll have more than one candidate, so\n      // we'll have to check the offscreenArea to make the best choice.\n      if (!this.dynamicAlign && !this.noOverlap && vAlignOk && hAlignOk) {\n        position = candidate;\n        break;\n      }\n\n      // Align is ok if alignment preferences are respected. If no preferences,\n      // it is considered ok.\n      var alignOk = (!vAlign || vAlignOk) && (!hAlign || hAlignOk);\n\n      // Filter out elements that don't match the alignment (if defined).\n      // With dynamicAlign, we need to consider all the positions to find the\n      // one that minimizes the cropped area.\n      if (!this.dynamicAlign && !alignOk) {\n        continue;\n      }\n\n      candidate.offscreenArea =\n          this.__getOffscreenArea(candidate, size, fitRect);\n      // If not cropped and respects the align requirements, keep it.\n      // This allows to prefer positions overlapping horizontally over the\n      // ones overlapping vertically.\n      if (candidate.offscreenArea === 0 && alignOk) {\n        position = candidate;\n        break;\n      }\n      position = position || candidate;\n      var diff = candidate.offscreenArea - position.offscreenArea;\n      // Check which crops less. If it crops equally, check if at least one\n      // align setting is ok.\n      if (diff < 0 || (diff === 0 && (vAlignOk || hAlignOk))) {\n        position = candidate;\n      }\n    }\n\n    return position;\n  }\n\n};\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {useShadow} from '@polymer/polymer/lib/utils/settings.js';\n\n// Contains all connected resizables that do not have a parent.\nvar ORPHANS = new Set();\n\n/**\n * `IronResizableBehavior` is a behavior that can be used in Polymer elements to\n * coordinate the flow of resize events between \"resizers\" (elements that\n *control the size or hidden state of their children) and \"resizables\" (elements\n *that need to be notified when they are resized or un-hidden by their parents\n *in order to take action on their new measurements).\n *\n * Elements that perform measurement should add the `IronResizableBehavior`\n *behavior to their element definition and listen for the `iron-resize` event on\n *themselves. This event will be fired when they become showing after having\n *been hidden, when they are resized explicitly by another resizable, or when\n *the window has been resized.\n *\n * Note, the `iron-resize` event is non-bubbling.\n *\n * @polymerBehavior\n * @demo demo/index.html\n **/\nexport const IronResizableBehavior = {\n  properties: {\n    /**\n     * The closest ancestor element that implements `IronResizableBehavior`.\n     */\n    _parentResizable: {\n      type: Object,\n      observer: '_parentResizableChanged',\n    },\n\n    /**\n     * True if this element is currently notifying its descendant elements of\n     * resize.\n     */\n    _notifyingDescendant: {\n      type: Boolean,\n      value: false,\n    }\n  },\n\n  listeners: {\n    'iron-request-resize-notifications': '_onIronRequestResizeNotifications'\n  },\n\n  created: function() {\n    // We don't really need property effects on these, and also we want them\n    // to be created before the `_parentResizable` observer fires:\n    this._interestedResizables = [];\n    this._boundNotifyResize = this.notifyResize.bind(this);\n    this._boundOnDescendantIronResize = this._onDescendantIronResize.bind(this);\n  },\n\n  attached: function() {\n    this._requestResizeNotifications();\n  },\n\n  detached: function() {\n    if (this._parentResizable) {\n      this._parentResizable.stopResizeNotificationsFor(this);\n    } else {\n      ORPHANS.delete(this);\n      window.removeEventListener('resize', this._boundNotifyResize);\n    }\n\n    this._parentResizable = null;\n  },\n\n  /**\n   * Can be called to manually notify a resizable and its descendant\n   * resizables of a resize change.\n   */\n  notifyResize: function() {\n    if (!this.isAttached) {\n      return;\n    }\n\n    this._interestedResizables.forEach(function(resizable) {\n      if (this.resizerShouldNotify(resizable)) {\n        this._notifyDescendant(resizable);\n      }\n    }, this);\n\n    this._fireResize();\n  },\n\n  /**\n   * Used to assign the closest resizable ancestor to this resizable\n   * if the ancestor detects a request for notifications.\n   */\n  assignParentResizable: function(parentResizable) {\n    if (this._parentResizable) {\n      this._parentResizable.stopResizeNotificationsFor(this);\n    }\n\n    this._parentResizable = parentResizable;\n\n    if (parentResizable &&\n        parentResizable._interestedResizables.indexOf(this) === -1) {\n      parentResizable._interestedResizables.push(this);\n      parentResizable._subscribeIronResize(this);\n    }\n  },\n\n  /**\n   * Used to remove a resizable descendant from the list of descendants\n   * that should be notified of a resize change.\n   */\n  stopResizeNotificationsFor: function(target) {\n    var index = this._interestedResizables.indexOf(target);\n\n    if (index > -1) {\n      this._interestedResizables.splice(index, 1);\n      this._unsubscribeIronResize(target);\n    }\n  },\n\n  /**\n   * Subscribe this element to listen to iron-resize events on the given target.\n   *\n   * Preferred over target.listen because the property renamer does not\n   * understand to rename when the target is not specifically \"this\"\n   *\n   * @param {!HTMLElement} target Element to listen to for iron-resize events.\n   */\n  _subscribeIronResize: function(target) {\n    target.addEventListener('iron-resize', this._boundOnDescendantIronResize);\n  },\n\n  /**\n   * Unsubscribe this element from listening to to iron-resize events on the\n   * given target.\n   *\n   * Preferred over target.unlisten because the property renamer does not\n   * understand to rename when the target is not specifically \"this\"\n   *\n   * @param {!HTMLElement} target Element to listen to for iron-resize events.\n   */\n  _unsubscribeIronResize: function(target) {\n    target.removeEventListener(\n        'iron-resize', this._boundOnDescendantIronResize);\n  },\n\n  /**\n   * This method can be overridden to filter nested elements that should or\n   * should not be notified by the current element. Return true if an element\n   * should be notified, or false if it should not be notified.\n   *\n   * @param {HTMLElement} element A candidate descendant element that\n   * implements `IronResizableBehavior`.\n   * @return {boolean} True if the `element` should be notified of resize.\n   */\n  resizerShouldNotify: function(element) {\n    return true;\n  },\n\n  _onDescendantIronResize: function(event) {\n    if (this._notifyingDescendant) {\n      event.stopPropagation();\n      return;\n    }\n\n    // no need to use this during shadow dom because of event retargeting\n    if (!useShadow) {\n      this._fireResize();\n    }\n  },\n\n  _fireResize: function() {\n    this.fire('iron-resize', null, {node: this, bubbles: false});\n  },\n\n  _onIronRequestResizeNotifications: function(event) {\n    var target = /** @type {!EventTarget} */ (dom(event).rootTarget);\n    if (target === this) {\n      return;\n    }\n\n    target.assignParentResizable(this);\n    this._notifyDescendant(target);\n\n    event.stopPropagation();\n  },\n\n  _parentResizableChanged: function(parentResizable) {\n    if (parentResizable) {\n      window.removeEventListener('resize', this._boundNotifyResize);\n    }\n  },\n\n  _notifyDescendant: function(descendant) {\n    // NOTE(cdata): In IE10, attached is fired on children first, so it's\n    // important not to notify them if the parent is not attached yet (or\n    // else they will get redundantly notified when the parent attaches).\n    if (!this.isAttached) {\n      return;\n    }\n\n    this._notifyingDescendant = true;\n    descendant.notifyResize();\n    this._notifyingDescendant = false;\n  },\n\n  _requestResizeNotifications: function() {\n    if (!this.isAttached) {\n      return;\n    }\n\n    if (document.readyState === 'loading') {\n      var _requestResizeNotifications =\n          this._requestResizeNotifications.bind(this);\n      document.addEventListener(\n          'readystatechange', function readystatechanged() {\n            document.removeEventListener('readystatechange', readystatechanged);\n            _requestResizeNotifications();\n          });\n    } else {\n      this._findParent();\n\n      if (!this._parentResizable) {\n        // If this resizable is an orphan, tell other orphans to try to find\n        // their parent again, in case it's this resizable.\n        ORPHANS.forEach(function(orphan) {\n          if (orphan !== this) {\n            orphan._findParent();\n          }\n        }, this);\n\n        window.addEventListener('resize', this._boundNotifyResize);\n        this.notifyResize();\n      } else {\n        // If this resizable has a parent, tell other child resizables of\n        // that parent to try finding their parent again, in case it's this\n        // resizable.\n        this._parentResizable._interestedResizables\n            .forEach(function(resizable) {\n              if (resizable !== this) {\n                resizable._findParent();\n              }\n            }, this);\n      }\n    }\n  },\n\n  _findParent: function() {\n    this.assignParentResizable(null);\n    this.fire(\n        'iron-request-resize-notifications',\n        null,\n        {node: this, bubbles: true, cancelable: true});\n\n    if (!this._parentResizable) {\n      ORPHANS.add(this);\n    } else {\n      ORPHANS.delete(this);\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\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\n\nvar p = Element.prototype;\nvar matches = p.matches || p.matchesSelector || p.mozMatchesSelector ||\n    p.msMatchesSelector || p.oMatchesSelector || p.webkitMatchesSelector;\n\nexport const IronFocusablesHelper = {\n\n  /**\n   * Returns a sorted array of tabbable nodes, including the root node.\n   * It searches the tabbable nodes in the light and shadow dom of the chidren,\n   * sorting the result by tabindex.\n   * @param {!Node} node\n   * @return {!Array<!HTMLElement>}\n   */\n  getTabbableNodes: function(node) {\n    var result = [];\n    // If there is at least one element with tabindex > 0, we need to sort\n    // the final array by tabindex.\n    var needsSortByTabIndex = this._collectTabbableNodes(node, result);\n    if (needsSortByTabIndex) {\n      return this._sortByTabIndex(result);\n    }\n    return result;\n  },\n\n  /**\n   * Returns if a element is focusable.\n   * @param {!HTMLElement} element\n   * @return {boolean}\n   */\n  isFocusable: function(element) {\n    // From http://stackoverflow.com/a/1600194/4228703:\n    // There isn't a definite list, it's up to the browser. The only\n    // standard we have is DOM Level 2 HTML\n    // https://www.w3.org/TR/DOM-Level-2-HTML/html.html, according to which the\n    // only elements that have a focus() method are HTMLInputElement,\n    // HTMLSelectElement, HTMLTextAreaElement and HTMLAnchorElement. This\n    // notably omits HTMLButtonElement and HTMLAreaElement. Referring to these\n    // tests with tabbables in different browsers\n    // http://allyjs.io/data-tables/focusable.html\n\n    // Elements that cannot be focused if they have [disabled] attribute.\n    if (matches.call(element, 'input, select, textarea, button, object')) {\n      return matches.call(element, ':not([disabled])');\n    }\n    // Elements that can be focused even if they have [disabled] attribute.\n    return matches.call(\n        element, 'a[href], area[href], iframe, [tabindex], [contentEditable]');\n  },\n\n  /**\n   * Returns if a element is tabbable. To be tabbable, a element must be\n   * focusable, visible, and with a tabindex !== -1.\n   * @param {!HTMLElement} element\n   * @return {boolean}\n   */\n  isTabbable: function(element) {\n    return this.isFocusable(element) &&\n        matches.call(element, ':not([tabindex=\"-1\"])') &&\n        this._isVisible(element);\n  },\n\n  /**\n   * Returns the normalized element tabindex. If not focusable, returns -1.\n   * It checks for the attribute \"tabindex\" instead of the element property\n   * `tabIndex` since browsers assign different values to it.\n   * e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n   * @param {!HTMLElement} element\n   * @return {!number}\n   * @private\n   */\n  _normalizedTabIndex: function(element) {\n    if (this.isFocusable(element)) {\n      var tabIndex = element.getAttribute('tabindex') || 0;\n      return Number(tabIndex);\n    }\n    return -1;\n  },\n\n  /**\n   * Searches for nodes that are tabbable and adds them to the `result` array.\n   * Returns if the `result` array needs to be sorted by tabindex.\n   * @param {!Node} node The starting point for the search; added to `result`\n   * if tabbable.\n   * @param {!Array<!HTMLElement>} result\n   * @return {boolean}\n   * @private\n   */\n  _collectTabbableNodes: function(node, result) {\n    // If not an element or not visible, no need to explore children.\n    if (node.nodeType !== Node.ELEMENT_NODE || !this._isVisible(node)) {\n      return false;\n    }\n    var element = /** @type {!HTMLElement} */ (node);\n    var tabIndex = this._normalizedTabIndex(element);\n    var needsSort = tabIndex > 0;\n    if (tabIndex >= 0) {\n      result.push(element);\n    }\n\n    // In ShadowDOM v1, tab order is affected by the order of distrubution.\n    // E.g. getTabbableNodes(#root) in ShadowDOM v1 should return [#A, #B];\n    // in ShadowDOM v0 tab order is not affected by the distrubution order,\n    // in fact getTabbableNodes(#root) returns [#B, #A].\n    //  <div id=\"root\">\n    //   <!-- shadow -->\n    //     <slot name=\"a\">\n    //     <slot name=\"b\">\n    //   <!-- /shadow -->\n    //   <input id=\"A\" slot=\"a\">\n    //   <input id=\"B\" slot=\"b\" tabindex=\"1\">\n    //  </div>\n    // TODO(valdrin) support ShadowDOM v1 when upgrading to Polymer v2.0.\n    var children;\n    if (element.localName === 'content' || element.localName === 'slot') {\n      children = dom(element).getDistributedNodes();\n    } else {\n      // Use shadow root if possible, will check for distributed nodes.\n      children = dom(element.root || element).children;\n    }\n    for (var i = 0; i < children.length; i++) {\n      // Ensure method is always invoked to collect tabbable children.\n      needsSort = this._collectTabbableNodes(children[i], result) || needsSort;\n    }\n    return needsSort;\n  },\n\n  /**\n   * Returns false if the element has `visibility: hidden` or `display: none`\n   * @param {!HTMLElement} element\n   * @return {boolean}\n   * @private\n   */\n  _isVisible: function(element) {\n    // Check inline style first to save a re-flow. If looks good, check also\n    // computed style.\n    var style = element.style;\n    if (style.visibility !== 'hidden' && style.display !== 'none') {\n      style = window.getComputedStyle(element);\n      return (style.visibility !== 'hidden' && style.display !== 'none');\n    }\n    return false;\n  },\n\n  /**\n   * Sorts an array of tabbable elements by tabindex. Returns a new array.\n   * @param {!Array<!HTMLElement>} tabbables\n   * @return {!Array<!HTMLElement>}\n   * @private\n   */\n  _sortByTabIndex: function(tabbables) {\n    // Implement a merge sort as Array.prototype.sort does a non-stable sort\n    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort\n    var len = tabbables.length;\n    if (len < 2) {\n      return tabbables;\n    }\n    var pivot = Math.ceil(len / 2);\n    var left = this._sortByTabIndex(tabbables.slice(0, pivot));\n    var right = this._sortByTabIndex(tabbables.slice(pivot));\n    return this._mergeSortByTabIndex(left, right);\n  },\n\n  /**\n   * Merge sort iterator, merges the two arrays into one, sorted by tab index.\n   * @param {!Array<!HTMLElement>} left\n   * @param {!Array<!HTMLElement>} right\n   * @return {!Array<!HTMLElement>}\n   * @private\n   */\n  _mergeSortByTabIndex: function(left, right) {\n    var result = [];\n    while ((left.length > 0) && (right.length > 0)) {\n      if (this._hasLowerTabOrder(left[0], right[0])) {\n        result.push(right.shift());\n      } else {\n        result.push(left.shift());\n      }\n    }\n\n    return result.concat(left, right);\n  },\n\n  /**\n   * Returns if element `a` has lower tab order compared to element `b`\n   * (both elements are assumed to be focusable and tabbable).\n   * Elements with tabindex = 0 have lower tab order compared to elements\n   * with tabindex > 0.\n   * If both have same tabindex, it returns false.\n   * @param {!HTMLElement} a\n   * @param {!HTMLElement} b\n   * @return {boolean}\n   * @private\n   */\n  _hasLowerTabOrder: function(a, b) {\n    // Normalize tabIndexes\n    // e.g. in Firefox `<div contenteditable>` has `tabIndex = -1`\n    var ati = Math.max(a.tabIndex, 0);\n    var bti = Math.max(b.tabIndex, 0);\n    return (ati === 0 || bti === 0) ? bti > ati : ati > bti;\n  }\n};\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {Polymer} from '@polymer/polymer/lib/legacy/polymer-fn.js';\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {html} from '@polymer/polymer/lib/utils/html-tag.js';\n\n/*\n`iron-overlay-backdrop` is a backdrop used by `Polymer.IronOverlayBehavior`. It\nshould be a singleton.\n\n### Styling\n\nThe following custom properties and mixins are available for styling.\n\nCustom property | Description | Default\n-------------------------------------------|------------------------|---------\n`--iron-overlay-backdrop-background-color` | Backdrop background color | #000\n`--iron-overlay-backdrop-opacity`          | Backdrop opacity | 0.6\n`--iron-overlay-backdrop`                  | Mixin applied to `iron-overlay-backdrop`.                      | {}\n`--iron-overlay-backdrop-opened`           | Mixin applied to `iron-overlay-backdrop` when it is displayed | {}\n*/\nPolymer({\n  _template: html`\n    <style>\n      :host {\n        position: fixed;\n        top: 0;\n        left: 0;\n        width: 100%;\n        height: 100%;\n        background-color: var(--iron-overlay-backdrop-background-color, #000);\n        opacity: 0;\n        transition: opacity 0.2s;\n        pointer-events: none;\n        @apply --iron-overlay-backdrop;\n      }\n\n      :host(.opened) {\n        opacity: var(--iron-overlay-backdrop-opacity, 0.6);\n        pointer-events: auto;\n        @apply --iron-overlay-backdrop-opened;\n      }\n    </style>\n\n    <slot></slot>\n`,\n\n  is: 'iron-overlay-backdrop',\n\n  properties: {\n\n    /**\n     * Returns true if the backdrop is opened.\n     */\n    opened: {\n      reflectToAttribute: true,\n      type: Boolean,\n      value: false,\n      observer: '_openedChanged',\n    }\n\n  },\n\n  listeners: {\n    'transitionend': '_onTransitionend',\n  },\n\n  created: function() {\n    // Used to cancel previous requestAnimationFrame calls when opened changes.\n    this.__openedRaf = null;\n  },\n\n  attached: function() {\n    this.opened && this._openedChanged(this.opened);\n  },\n\n  /**\n   * Appends the backdrop to document body if needed.\n   */\n  prepare: function() {\n    if (this.opened && !this.parentNode) {\n      dom(document.body).appendChild(this);\n    }\n  },\n\n  /**\n   * Shows the backdrop.\n   */\n  open: function() {\n    this.opened = true;\n  },\n\n  /**\n   * Hides the backdrop.\n   */\n  close: function() {\n    this.opened = false;\n  },\n\n  /**\n   * Removes the backdrop from document body if needed.\n   */\n  complete: function() {\n    if (!this.opened && this.parentNode === document.body) {\n      dom(this.parentNode).removeChild(this);\n    }\n  },\n\n  _onTransitionend: function(event) {\n    if (event && event.target === this) {\n      this.complete();\n    }\n  },\n\n  /**\n   * @param {boolean} opened\n   * @private\n   */\n  _openedChanged: function(opened) {\n    if (opened) {\n      // Auto-attach.\n      this.prepare();\n    } else {\n      // Animation might be disabled via the mixin or opacity custom property.\n      // If it is disabled in other ways, it's up to the user to call complete.\n      var cs = window.getComputedStyle(this);\n      if (cs.transitionDuration === '0s' || cs.opacity == 0) {\n        this.complete();\n      }\n    }\n\n    if (!this.isAttached) {\n      return;\n    }\n\n    // Always cancel previous requestAnimationFrame.\n    if (this.__openedRaf) {\n      window.cancelAnimationFrame(this.__openedRaf);\n      this.__openedRaf = null;\n    }\n    // Force relayout to ensure proper transitions.\n    this.scrollTop = this.scrollTop;\n    this.__openedRaf = window.requestAnimationFrame(function() {\n      this.__openedRaf = null;\n      this.toggleClass('opened', this.opened);\n    }.bind(this));\n  }\n});\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\n/**\n * Chrome uses an older version of DOM Level 3 Keyboard Events\n *\n * Most keys are labeled as text, but some are Unicode codepoints.\n * Values taken from:\n * http://www.w3.org/TR/2007/WD-DOM-Level-3-Events-20071221/keyset.html#KeySet-Set\n */\nvar KEY_IDENTIFIER = {\n  'U+0008': 'backspace',\n  'U+0009': 'tab',\n  'U+001B': 'esc',\n  'U+0020': 'space',\n  'U+007F': 'del'\n};\n\n/**\n * Special table for KeyboardEvent.keyCode.\n * KeyboardEvent.keyIdentifier is better, and KeyBoardEvent.key is even better\n * than that.\n *\n * Values from:\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Value_of_keyCode\n */\nvar KEY_CODE = {\n  8: 'backspace',\n  9: 'tab',\n  13: 'enter',\n  27: 'esc',\n  33: 'pageup',\n  34: 'pagedown',\n  35: 'end',\n  36: 'home',\n  32: 'space',\n  37: 'left',\n  38: 'up',\n  39: 'right',\n  40: 'down',\n  46: 'del',\n  106: '*'\n};\n\n/**\n * MODIFIER_KEYS maps the short name for modifier keys used in a key\n * combo string to the property name that references those same keys\n * in a KeyboardEvent instance.\n */\nvar MODIFIER_KEYS = {\n  'shift': 'shiftKey',\n  'ctrl': 'ctrlKey',\n  'alt': 'altKey',\n  'meta': 'metaKey'\n};\n\n/**\n * KeyboardEvent.key is mostly represented by printable character made by\n * the keyboard, with unprintable keys labeled nicely.\n *\n * However, on OS X, Alt+char can make a Unicode character that follows an\n * Apple-specific mapping. In this case, we fall back to .keyCode.\n */\nvar KEY_CHAR = /[a-z0-9*]/;\n\n/**\n * Matches a keyIdentifier string.\n */\nvar IDENT_CHAR = /U\\+/;\n\n/**\n * Matches arrow keys in Gecko 27.0+\n */\nvar ARROW_KEY = /^arrow/;\n\n/**\n * Matches space keys everywhere (notably including IE10's exceptional name\n * `spacebar`).\n */\nvar SPACE_KEY = /^space(bar)?/;\n\n/**\n * Matches ESC key.\n *\n * Value from: http://w3c.github.io/uievents-key/#key-Escape\n */\nvar ESC_KEY = /^escape$/;\n\n/**\n * Transforms the key.\n * @param {string} key The KeyBoardEvent.key\n * @param {Boolean} [noSpecialChars] Limits the transformation to\n * alpha-numeric characters.\n */\nfunction transformKey(key, noSpecialChars) {\n  var validKey = '';\n  if (key) {\n    var lKey = key.toLowerCase();\n    if (lKey === ' ' || SPACE_KEY.test(lKey)) {\n      validKey = 'space';\n    } else if (ESC_KEY.test(lKey)) {\n      validKey = 'esc';\n    } else if (lKey.length == 1) {\n      if (!noSpecialChars || KEY_CHAR.test(lKey)) {\n        validKey = lKey;\n      }\n    } else if (ARROW_KEY.test(lKey)) {\n      validKey = lKey.replace('arrow', '');\n    } else if (lKey == 'multiply') {\n      // numpad '*' can map to Multiply on IE/Windows\n      validKey = '*';\n    } else {\n      validKey = lKey;\n    }\n  }\n  return validKey;\n}\n\nfunction transformKeyIdentifier(keyIdent) {\n  var validKey = '';\n  if (keyIdent) {\n    if (keyIdent in KEY_IDENTIFIER) {\n      validKey = KEY_IDENTIFIER[keyIdent];\n    } else if (IDENT_CHAR.test(keyIdent)) {\n      keyIdent = parseInt(keyIdent.replace('U+', '0x'), 16);\n      validKey = String.fromCharCode(keyIdent).toLowerCase();\n    } else {\n      validKey = keyIdent.toLowerCase();\n    }\n  }\n  return validKey;\n}\n\nfunction transformKeyCode(keyCode) {\n  var validKey = '';\n  if (Number(keyCode)) {\n    if (keyCode >= 65 && keyCode <= 90) {\n      // ascii a-z\n      // lowercase is 32 offset from uppercase\n      validKey = String.fromCharCode(32 + keyCode);\n    } else if (keyCode >= 112 && keyCode <= 123) {\n      // function keys f1-f12\n      validKey = 'f' + (keyCode - 112 + 1);\n    } else if (keyCode >= 48 && keyCode <= 57) {\n      // top 0-9 keys\n      validKey = String(keyCode - 48);\n    } else if (keyCode >= 96 && keyCode <= 105) {\n      // num pad 0-9\n      validKey = String(keyCode - 96);\n    } else {\n      validKey = KEY_CODE[keyCode];\n    }\n  }\n  return validKey;\n}\n\n/**\n * Calculates the normalized key for a KeyboardEvent.\n * @param {KeyboardEvent} keyEvent\n * @param {Boolean} [noSpecialChars] Set to true to limit keyEvent.key\n * transformation to alpha-numeric chars. This is useful with key\n * combinations like shift + 2, which on FF for MacOS produces\n * keyEvent.key = @\n * To get 2 returned, set noSpecialChars = true\n * To get @ returned, set noSpecialChars = false\n */\nfunction normalizedKeyForEvent(keyEvent, noSpecialChars) {\n  // Fall back from .key, to .detail.key for artifical keyboard events,\n  // and then to deprecated .keyIdentifier and .keyCode.\n  if (keyEvent.key) {\n    return transformKey(keyEvent.key, noSpecialChars);\n  }\n  if (keyEvent.detail && keyEvent.detail.key) {\n    return transformKey(keyEvent.detail.key, noSpecialChars);\n  }\n  return transformKeyIdentifier(keyEvent.keyIdentifier) ||\n      transformKeyCode(keyEvent.keyCode) || '';\n}\n\nfunction keyComboMatchesEvent(keyCombo, event) {\n  // For combos with modifiers we support only alpha-numeric keys\n  var keyEvent = normalizedKeyForEvent(event, keyCombo.hasModifiers);\n  return keyEvent === keyCombo.key &&\n      (!keyCombo.hasModifiers ||\n       (!!event.shiftKey === !!keyCombo.shiftKey &&\n        !!event.ctrlKey === !!keyCombo.ctrlKey &&\n        !!event.altKey === !!keyCombo.altKey &&\n        !!event.metaKey === !!keyCombo.metaKey));\n}\n\nfunction parseKeyComboString(keyComboString) {\n  if (keyComboString.length === 1) {\n    return {combo: keyComboString, key: keyComboString, event: 'keydown'};\n  }\n  return keyComboString.split('+')\n      .reduce(function(parsedKeyCombo, keyComboPart) {\n        var eventParts = keyComboPart.split(':');\n        var keyName = eventParts[0];\n        var event = eventParts[1];\n\n        if (keyName in MODIFIER_KEYS) {\n          parsedKeyCombo[MODIFIER_KEYS[keyName]] = true;\n          parsedKeyCombo.hasModifiers = true;\n        } else {\n          parsedKeyCombo.key = keyName;\n          parsedKeyCombo.event = event || 'keydown';\n        }\n\n        return parsedKeyCombo;\n      }, {combo: keyComboString.split(':').shift()});\n}\n\nfunction parseEventString(eventString) {\n  return eventString.trim().split(' ').map(function(keyComboString) {\n    return parseKeyComboString(keyComboString);\n  });\n}\n\n/**\n * `Polymer.IronA11yKeysBehavior` provides a normalized interface for processing\n * keyboard commands that pertain to [WAI-ARIA best\n * practices](http://www.w3.org/TR/wai-aria-practices/#kbd_general_binding). The\n * element takes care of browser differences with respect to Keyboard events and\n * uses an expressive syntax to filter key presses.\n *\n * Use the `keyBindings` prototype property to express what combination of keys\n * will trigger the callback. A key binding has the format\n * `\"KEY+MODIFIER:EVENT\": \"callback\"` (`\"KEY\": \"callback\"` or\n * `\"KEY:EVENT\": \"callback\"` are valid as well). Some examples:\n *\n *      keyBindings: {\n *        'space': '_onKeydown', // same as 'space:keydown'\n *        'shift+tab': '_onKeydown',\n *        'enter:keypress': '_onKeypress',\n *        'esc:keyup': '_onKeyup'\n *      }\n *\n * The callback will receive with an event containing the following information\n * in `event.detail`:\n *\n *      _onKeydown: function(event) {\n *        console.log(event.detail.combo); // KEY+MODIFIER, e.g. \"shift+tab\"\n *        console.log(event.detail.key); // KEY only, e.g. \"tab\"\n *        console.log(event.detail.event); // EVENT, e.g. \"keydown\"\n *        console.log(event.detail.keyboardEvent); // the original KeyboardEvent\n *      }\n *\n * Use the `keyEventTarget` attribute to set up event handlers on a specific\n * node.\n *\n * See the [demo source\n * code](https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/master/demo/x-key-aware.html)\n * for an example.\n *\n * @demo demo/index.html\n * @polymerBehavior\n */\nexport const IronA11yKeysBehavior = {\n  properties: {\n    /**\n     * The EventTarget that will be firing relevant KeyboardEvents. Set it to\n     * `null` to disable the listeners.\n     * @type {?EventTarget}\n     */\n    keyEventTarget: {\n      type: Object,\n      value: function() {\n        return this;\n      }\n    },\n\n    /**\n     * If true, this property will cause the implementing element to\n     * automatically stop propagation on any handled KeyboardEvents.\n     */\n    stopKeyboardEventPropagation: {type: Boolean, value: false},\n\n    _boundKeyHandlers: {\n      type: Array,\n      value: function() {\n        return [];\n      }\n    },\n\n    // We use this due to a limitation in IE10 where instances will have\n    // own properties of everything on the \"prototype\".\n    _imperativeKeyBindings: {\n      type: Object,\n      value: function() {\n        return {};\n      }\n    }\n  },\n\n  observers: ['_resetKeyEventListeners(keyEventTarget, _boundKeyHandlers)'],\n\n\n  /**\n   * To be used to express what combination of keys  will trigger the relative\n   * callback. e.g. `keyBindings: { 'esc': '_onEscPressed'}`\n   * @type {!Object}\n   */\n  keyBindings: {},\n\n  registered: function() {\n    this._prepKeyBindings();\n  },\n\n  attached: function() {\n    this._listenKeyEventListeners();\n  },\n\n  detached: function() {\n    this._unlistenKeyEventListeners();\n  },\n\n  /**\n   * Can be used to imperatively add a key binding to the implementing\n   * element. This is the imperative equivalent of declaring a keybinding\n   * in the `keyBindings` prototype property.\n   *\n   * @param {string} eventString\n   * @param {string} handlerName\n   */\n  addOwnKeyBinding: function(eventString, handlerName) {\n    this._imperativeKeyBindings[eventString] = handlerName;\n    this._prepKeyBindings();\n    this._resetKeyEventListeners();\n  },\n\n  /**\n   * When called, will remove all imperatively-added key bindings.\n   */\n  removeOwnKeyBindings: function() {\n    this._imperativeKeyBindings = {};\n    this._prepKeyBindings();\n    this._resetKeyEventListeners();\n  },\n\n  /**\n   * Returns true if a keyboard event matches `eventString`.\n   *\n   * @param {KeyboardEvent} event\n   * @param {string} eventString\n   * @return {boolean}\n   */\n  keyboardEventMatchesKeys: function(event, eventString) {\n    var keyCombos = parseEventString(eventString);\n    for (var i = 0; i < keyCombos.length; ++i) {\n      if (keyComboMatchesEvent(keyCombos[i], event)) {\n        return true;\n      }\n    }\n    return false;\n  },\n\n  _collectKeyBindings: function() {\n    var keyBindings = this.behaviors.map(function(behavior) {\n      return behavior.keyBindings;\n    });\n\n    if (keyBindings.indexOf(this.keyBindings) === -1) {\n      keyBindings.push(this.keyBindings);\n    }\n\n    return keyBindings;\n  },\n\n  _prepKeyBindings: function() {\n    this._keyBindings = {};\n\n    this._collectKeyBindings().forEach(function(keyBindings) {\n      for (var eventString in keyBindings) {\n        this._addKeyBinding(eventString, keyBindings[eventString]);\n      }\n    }, this);\n\n    for (var eventString in this._imperativeKeyBindings) {\n      this._addKeyBinding(\n          eventString, this._imperativeKeyBindings[eventString]);\n    }\n\n    // Give precedence to combos with modifiers to be checked first.\n    for (var eventName in this._keyBindings) {\n      this._keyBindings[eventName].sort(function(kb1, kb2) {\n        var b1 = kb1[0].hasModifiers;\n        var b2 = kb2[0].hasModifiers;\n        return (b1 === b2) ? 0 : b1 ? -1 : 1;\n      })\n    }\n  },\n\n  _addKeyBinding: function(eventString, handlerName) {\n    parseEventString(eventString).forEach(function(keyCombo) {\n      this._keyBindings[keyCombo.event] =\n          this._keyBindings[keyCombo.event] || [];\n\n      this._keyBindings[keyCombo.event].push([keyCombo, handlerName]);\n    }, this);\n  },\n\n  _resetKeyEventListeners: function() {\n    this._unlistenKeyEventListeners();\n\n    if (this.isAttached) {\n      this._listenKeyEventListeners();\n    }\n  },\n\n  _listenKeyEventListeners: function() {\n    if (!this.keyEventTarget) {\n      return;\n    }\n    Object.keys(this._keyBindings).forEach(function(eventName) {\n      var keyBindings = this._keyBindings[eventName];\n      var boundKeyHandler = this._onKeyBindingEvent.bind(this, keyBindings);\n\n      this._boundKeyHandlers.push(\n          [this.keyEventTarget, eventName, boundKeyHandler]);\n\n      this.keyEventTarget.addEventListener(eventName, boundKeyHandler);\n    }, this);\n  },\n\n  _unlistenKeyEventListeners: function() {\n    var keyHandlerTuple;\n    var keyEventTarget;\n    var eventName;\n    var boundKeyHandler;\n\n    while (this._boundKeyHandlers.length) {\n      // My kingdom for block-scope binding and destructuring assignment..\n      keyHandlerTuple = this._boundKeyHandlers.pop();\n      keyEventTarget = keyHandlerTuple[0];\n      eventName = keyHandlerTuple[1];\n      boundKeyHandler = keyHandlerTuple[2];\n\n      keyEventTarget.removeEventListener(eventName, boundKeyHandler);\n    }\n  },\n\n  _onKeyBindingEvent: function(keyBindings, event) {\n    if (this.stopKeyboardEventPropagation) {\n      event.stopPropagation();\n    }\n\n    // if event has been already prevented, don't do anything\n    if (event.defaultPrevented) {\n      return;\n    }\n\n    for (var i = 0; i < keyBindings.length; i++) {\n      var keyCombo = keyBindings[i][0];\n      var handlerName = keyBindings[i][1];\n      if (keyComboMatchesEvent(keyCombo, event)) {\n        this._triggerKeyHandler(keyCombo, handlerName, event);\n        // exit the loop if eventDefault was prevented\n        if (event.defaultPrevented) {\n          return;\n        }\n      }\n    }\n  },\n\n  _triggerKeyHandler: function(keyCombo, handlerName, keyboardEvent) {\n    var detail = Object.create(keyCombo);\n    detail.keyboardEvent = keyboardEvent;\n    var event =\n        new CustomEvent(keyCombo.event, {detail: detail, cancelable: true});\n    this[handlerName].call(this, event);\n    if (event.defaultPrevented) {\n      keyboardEvent.preventDefault();\n    }\n  }\n};\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\nimport './iron-overlay-backdrop.js';\n\nimport {IronA11yKeysBehavior} from '@polymer/iron-a11y-keys-behavior/iron-a11y-keys-behavior.js';\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport * as gestures from '@polymer/polymer/lib/utils/gestures.js';\n\n/**\n * @struct\n * @constructor\n * @private\n */\nexport const IronOverlayManagerClass = function() {\n  /**\n   * Used to keep track of the opened overlays.\n   * @private {!Array<!Element>}\n   */\n  this._overlays = [];\n\n  /**\n   * iframes have a default z-index of 100,\n   * so this default should be at least that.\n   * @private {number}\n   */\n  this._minimumZ = 101;\n\n  /**\n   * Memoized backdrop element.\n   * @private {Element|null}\n   */\n  this._backdropElement = null;\n\n  // Enable document-wide tap recognizer.\n  // NOTE: Use useCapture=true to avoid accidentally prevention of the closing\n  // of an overlay via event.stopPropagation(). The only way to prevent\n  // closing of an overlay should be through its APIs.\n  // NOTE: enable tap on <html> to workaround Polymer/polymer#4459\n  // Pass no-op function because MSEdge 15 doesn't handle null as 2nd argument\n  // https://github.com/Microsoft/ChakraCore/issues/3863\n  gestures.add(document.documentElement, 'tap', function() {});\n  document.addEventListener('tap', this._onCaptureClick.bind(this), true);\n  document.addEventListener('focus', this._onCaptureFocus.bind(this), true);\n  document.addEventListener('keydown', this._onCaptureKeyDown.bind(this), true);\n};\n\nIronOverlayManagerClass.prototype = {\n\n  constructor: IronOverlayManagerClass,\n\n  /**\n   * The shared backdrop element.\n   * @return {!Element} backdropElement\n   */\n  get backdropElement() {\n    if (!this._backdropElement) {\n      this._backdropElement = document.createElement('iron-overlay-backdrop');\n    }\n    return this._backdropElement;\n  },\n\n  /**\n   * The deepest active element.\n   * @return {!Element} activeElement the active element\n   */\n  get deepActiveElement() {\n    var active = document.activeElement;\n    // document.activeElement can be null\n    // https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement\n    // In IE 11, it can also be an object when operating in iframes.\n    // In these cases, default it to document.body.\n    if (!active || active instanceof Element === false) {\n      active = document.body;\n    }\n    while (active.root && dom(active.root).activeElement) {\n      active = dom(active.root).activeElement;\n    }\n    return active;\n  },\n\n  /**\n   * Brings the overlay at the specified index to the front.\n   * @param {number} i\n   * @private\n   */\n  _bringOverlayAtIndexToFront: function(i) {\n    var overlay = this._overlays[i];\n    if (!overlay) {\n      return;\n    }\n    var lastI = this._overlays.length - 1;\n    var currentOverlay = this._overlays[lastI];\n    // Ensure always-on-top overlay stays on top.\n    if (currentOverlay &&\n        this._shouldBeBehindOverlay(overlay, currentOverlay)) {\n      lastI--;\n    }\n    // If already the top element, return.\n    if (i >= lastI) {\n      return;\n    }\n    // Update z-index to be on top.\n    var minimumZ = Math.max(this.currentOverlayZ(), this._minimumZ);\n    if (this._getZ(overlay) <= minimumZ) {\n      this._applyOverlayZ(overlay, minimumZ);\n    }\n\n    // Shift other overlays behind the new on top.\n    while (i < lastI) {\n      this._overlays[i] = this._overlays[i + 1];\n      i++;\n    }\n    this._overlays[lastI] = overlay;\n  },\n\n  /**\n   * Adds the overlay and updates its z-index if it's opened, or removes it if\n   * it's closed. Also updates the backdrop z-index.\n   * @param {!Element} overlay\n   */\n  addOrRemoveOverlay: function(overlay) {\n    if (overlay.opened) {\n      this.addOverlay(overlay);\n    } else {\n      this.removeOverlay(overlay);\n    }\n  },\n\n  /**\n   * Tracks overlays for z-index and focus management.\n   * Ensures the last added overlay with always-on-top remains on top.\n   * @param {!Element} overlay\n   */\n  addOverlay: function(overlay) {\n    var i = this._overlays.indexOf(overlay);\n    if (i >= 0) {\n      this._bringOverlayAtIndexToFront(i);\n      this.trackBackdrop();\n      return;\n    }\n    var insertionIndex = this._overlays.length;\n    var currentOverlay = this._overlays[insertionIndex - 1];\n    var minimumZ = Math.max(this._getZ(currentOverlay), this._minimumZ);\n    var newZ = this._getZ(overlay);\n\n    // Ensure always-on-top overlay stays on top.\n    if (currentOverlay &&\n        this._shouldBeBehindOverlay(overlay, currentOverlay)) {\n      // This bumps the z-index of +2.\n      this._applyOverlayZ(currentOverlay, minimumZ);\n      insertionIndex--;\n      // Update minimumZ to match previous overlay's z-index.\n      var previousOverlay = this._overlays[insertionIndex - 1];\n      minimumZ = Math.max(this._getZ(previousOverlay), this._minimumZ);\n    }\n\n    // Update z-index and insert overlay.\n    if (newZ <= minimumZ) {\n      this._applyOverlayZ(overlay, minimumZ);\n    }\n    this._overlays.splice(insertionIndex, 0, overlay);\n\n    this.trackBackdrop();\n  },\n\n  /**\n   * @param {!Element} overlay\n   */\n  removeOverlay: function(overlay) {\n    var i = this._overlays.indexOf(overlay);\n    if (i === -1) {\n      return;\n    }\n    this._overlays.splice(i, 1);\n\n    this.trackBackdrop();\n  },\n\n  /**\n   * Returns the current overlay.\n   * @return {!Element|undefined}\n   */\n  currentOverlay: function() {\n    var i = this._overlays.length - 1;\n    return this._overlays[i];\n  },\n\n  /**\n   * Returns the current overlay z-index.\n   * @return {number}\n   */\n  currentOverlayZ: function() {\n    return this._getZ(this.currentOverlay());\n  },\n\n  /**\n   * Ensures that the minimum z-index of new overlays is at least `minimumZ`.\n   * This does not effect the z-index of any existing overlays.\n   * @param {number} minimumZ\n   */\n  ensureMinimumZ: function(minimumZ) {\n    this._minimumZ = Math.max(this._minimumZ, minimumZ);\n  },\n\n  focusOverlay: function() {\n    var current = /** @type {?} */ (this.currentOverlay());\n    if (current) {\n      current._applyFocus();\n    }\n  },\n\n  /**\n   * Updates the backdrop z-index.\n   */\n  trackBackdrop: function() {\n    var overlay = this._overlayWithBackdrop();\n    // Avoid creating the backdrop if there is no overlay with backdrop.\n    if (!overlay && !this._backdropElement) {\n      return;\n    }\n    this.backdropElement.style.zIndex = this._getZ(overlay) - 1;\n    this.backdropElement.opened = !!overlay;\n    // Property observers are not fired until element is attached\n    // in Polymer 2.x, so we ensure element is attached if needed.\n    // https://github.com/Polymer/polymer/issues/4526\n    this.backdropElement.prepare();\n  },\n\n  /**\n   * @return {!Array<!Element>}\n   */\n  getBackdrops: function() {\n    var backdrops = [];\n    for (var i = 0; i < this._overlays.length; i++) {\n      if (this._overlays[i].withBackdrop) {\n        backdrops.push(this._overlays[i]);\n      }\n    }\n    return backdrops;\n  },\n\n  /**\n   * Returns the z-index for the backdrop.\n   * @return {number}\n   */\n  backdropZ: function() {\n    return this._getZ(this._overlayWithBackdrop()) - 1;\n  },\n\n  /**\n   * Returns the top opened overlay that has a backdrop.\n   * @return {!Element|undefined}\n   * @private\n   */\n  _overlayWithBackdrop: function() {\n    for (var i = this._overlays.length - 1; i >= 0; i--) {\n      if (this._overlays[i].withBackdrop) {\n        return this._overlays[i];\n      }\n    }\n  },\n\n  /**\n   * Calculates the minimum z-index for the overlay.\n   * @param {Element=} overlay\n   * @private\n   */\n  _getZ: function(overlay) {\n    var z = this._minimumZ;\n    if (overlay) {\n      var z1 = Number(\n          overlay.style.zIndex || window.getComputedStyle(overlay).zIndex);\n      // Check if is a number\n      // Number.isNaN not supported in IE 10+\n      if (z1 === z1) {\n        z = z1;\n      }\n    }\n    return z;\n  },\n\n  /**\n   * @param {!Element} element\n   * @param {number|string} z\n   * @private\n   */\n  _setZ: function(element, z) {\n    element.style.zIndex = z;\n  },\n\n  /**\n   * @param {!Element} overlay\n   * @param {number} aboveZ\n   * @private\n   */\n  _applyOverlayZ: function(overlay, aboveZ) {\n    this._setZ(overlay, aboveZ + 2);\n  },\n\n  /**\n   * Returns the deepest overlay in the path.\n   * @param {!Array<!Element>=} path\n   * @return {!Element|undefined}\n   * @suppress {missingProperties}\n   * @private\n   */\n  _overlayInPath: function(path) {\n    path = path || [];\n    for (var i = 0; i < path.length; i++) {\n      if (path[i]._manager === this) {\n        return path[i];\n      }\n    }\n  },\n\n  /**\n   * Ensures the click event is delegated to the right overlay.\n   * @param {!Event} event\n   * @private\n   */\n  _onCaptureClick: function(event) {\n    var i = this._overlays.length - 1;\n    if (i === -1)\n      return;\n    var path = /** @type {!Array<!EventTarget>} */ (dom(event).path);\n    var overlay;\n    // Check if clicked outside of overlay.\n    while ((overlay = /** @type {?} */ (this._overlays[i])) &&\n           this._overlayInPath(path) !== overlay) {\n      overlay._onCaptureClick(event);\n      if (overlay.allowClickThrough) {\n        i--;\n      } else {\n        break;\n      }\n    }\n  },\n\n  /**\n   * Ensures the focus event is delegated to the right overlay.\n   * @param {!Event} event\n   * @private\n   */\n  _onCaptureFocus: function(event) {\n    var overlay = /** @type {?} */ (this.currentOverlay());\n    if (overlay) {\n      overlay._onCaptureFocus(event);\n    }\n  },\n\n  /**\n   * Ensures TAB and ESC keyboard events are delegated to the right overlay.\n   * @param {!Event} event\n   * @private\n   */\n  _onCaptureKeyDown: function(event) {\n    var overlay = /** @type {?} */ (this.currentOverlay());\n    if (overlay) {\n      if (IronA11yKeysBehavior.keyboardEventMatchesKeys(event, 'esc')) {\n        overlay._onCaptureEsc(event);\n      } else if (IronA11yKeysBehavior.keyboardEventMatchesKeys(event, 'tab')) {\n        overlay._onCaptureTab(event);\n      }\n    }\n  },\n\n  /**\n   * Returns if the overlay1 should be behind overlay2.\n   * @param {!Element} overlay1\n   * @param {!Element} overlay2\n   * @return {boolean}\n   * @suppress {missingProperties}\n   * @private\n   */\n  _shouldBeBehindOverlay: function(overlay1, overlay2) {\n    return !overlay1.alwaysOnTop && overlay2.alwaysOnTop;\n  }\n};\n\nexport const IronOverlayManager = new IronOverlayManagerClass();\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\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\n/**\n * Used to calculate the scroll direction during touch events.\n * @type {!Object}\n */\nvar lastTouchPosition = {pageX: 0, pageY: 0};\n/**\n * Used to avoid computing event.path and filter scrollable nodes (better perf).\n * @type {?EventTarget}\n */\nvar lastRootTarget = null;\n/**\n * @type {!Array<!Node>}\n */\nvar lastScrollableNodes = [];\n/**\n * @type {!Array<string>}\n */\nvar scrollEvents = [\n  // Modern `wheel` event for mouse wheel scrolling:\n  'wheel',\n  // Older, non-standard `mousewheel` event for some FF:\n  'mousewheel',\n  // IE:\n  'DOMMouseScroll',\n  // Touch enabled devices\n  'touchstart',\n  'touchmove'\n];\n// must be defined for modulizer\nvar _boundScrollHandler;\nvar currentLockingElement;\n\n/**\n * The IronScrollManager is intended to provide a central source\n * of authority and control over which elements in a document are currently\n * allowed to scroll.\n *\n */\n`TODO(modulizer): A namespace named Polymer.IronScrollManager was\ndeclared here. The surrounding comments should be reviewed,\nand this string can then be deleted`;\n\n/**\n * The current element that defines the DOM boundaries of the\n * scroll lock. This is always the most recently locking element.\n *\n * @return {!Node|undefined}\n */\nexport {currentLockingElement};\n\n/**\n * Returns true if the provided element is \"scroll locked\", which is to\n * say that it cannot be scrolled via pointer or keyboard interactions.\n *\n * @param {!HTMLElement} element An HTML element instance which may or may\n * not be scroll locked.\n */\nexport function elementIsScrollLocked(element) {\n  var lockingElement = currentLockingElement;\n\n  if (lockingElement === undefined) {\n    return false;\n  }\n\n  var scrollLocked;\n\n  if (_hasCachedLockedElement(element)) {\n    return true;\n  }\n\n  if (_hasCachedUnlockedElement(element)) {\n    return false;\n  }\n\n  scrollLocked = !!lockingElement && lockingElement !== element &&\n      !_composedTreeContains(lockingElement, element);\n\n  if (scrollLocked) {\n    _lockedElementCache.push(element);\n  } else {\n    _unlockedElementCache.push(element);\n  }\n\n  return scrollLocked;\n}\n\n/**\n * Push an element onto the current scroll lock stack. The most recently\n * pushed element and its children will be considered scrollable. All\n * other elements will not be scrollable.\n *\n * Scroll locking is implemented as a stack so that cases such as\n * dropdowns within dropdowns are handled well.\n *\n * @param {!HTMLElement} element The element that should lock scroll.\n */\nexport function pushScrollLock(element) {\n  // Prevent pushing the same element twice\n  if (_lockingElements.indexOf(element) >= 0) {\n    return;\n  }\n\n  if (_lockingElements.length === 0) {\n    _lockScrollInteractions();\n  }\n\n  _lockingElements.push(element);\n  currentLockingElement = _lockingElements[_lockingElements.length - 1];\n\n  _lockedElementCache = [];\n  _unlockedElementCache = [];\n}\n\n/**\n * Remove an element from the scroll lock stack. The element being\n * removed does not need to be the most recently pushed element. However,\n * the scroll lock constraints only change when the most recently pushed\n * element is removed.\n *\n * @param {!HTMLElement} element The element to remove from the scroll\n * lock stack.\n */\nexport function removeScrollLock(element) {\n  var index = _lockingElements.indexOf(element);\n\n  if (index === -1) {\n    return;\n  }\n\n  _lockingElements.splice(index, 1);\n  currentLockingElement = _lockingElements[_lockingElements.length - 1];\n\n  _lockedElementCache = [];\n  _unlockedElementCache = [];\n\n  if (_lockingElements.length === 0) {\n    _unlockScrollInteractions();\n  }\n}\n\nexport const _lockingElements = [];\nexport let _lockedElementCache = null;\nexport let _unlockedElementCache = null;\n\nexport function _hasCachedLockedElement(element) {\n  return _lockedElementCache.indexOf(element) > -1;\n}\n\nexport function _hasCachedUnlockedElement(element) {\n  return _unlockedElementCache.indexOf(element) > -1;\n}\n\nexport function _composedTreeContains(element, child) {\n  // NOTE(cdata): This method iterates over content elements and their\n  // corresponding distributed nodes to implement a contains-like method\n  // that pierces through the composed tree of the ShadowDOM. Results of\n  // this operation are cached (elsewhere) on a per-scroll-lock basis, to\n  // guard against potentially expensive lookups happening repeatedly as\n  // a user scrolls / touchmoves.\n  var contentElements;\n  var distributedNodes;\n  var contentIndex;\n  var nodeIndex;\n\n  if (element.contains(child)) {\n    return true;\n  }\n\n  contentElements = dom(element).querySelectorAll('content,slot');\n\n  for (contentIndex = 0; contentIndex < contentElements.length;\n       ++contentIndex) {\n    distributedNodes = dom(contentElements[contentIndex]).getDistributedNodes();\n\n    for (nodeIndex = 0; nodeIndex < distributedNodes.length; ++nodeIndex) {\n      // Polymer 2.x returns slot.assignedNodes which can contain text nodes.\n      if (distributedNodes[nodeIndex].nodeType !== Node.ELEMENT_NODE)\n        continue;\n\n      if (_composedTreeContains(distributedNodes[nodeIndex], child)) {\n        return true;\n      }\n    }\n  }\n\n  return false;\n}\n\nexport function _scrollInteractionHandler(event) {\n  // Avoid canceling an event with cancelable=false, e.g. scrolling is in\n  // progress and cannot be interrupted.\n  if (event.cancelable && _shouldPreventScrolling(event)) {\n    event.preventDefault();\n  }\n  // If event has targetTouches (touch event), update last touch position.\n  if (event.targetTouches) {\n    var touch = event.targetTouches[0];\n    lastTouchPosition.pageX = touch.pageX;\n    lastTouchPosition.pageY = touch.pageY;\n  }\n}\n\n/**\n * @private\n */\nexport {_boundScrollHandler};\n\nexport function _lockScrollInteractions() {\n  _boundScrollHandler =\n      _boundScrollHandler || _scrollInteractionHandler.bind(undefined);\n  for (var i = 0, l = scrollEvents.length; i < l; i++) {\n    // NOTE: browsers that don't support objects as third arg will\n    // interpret it as boolean, hence useCapture = true in this case.\n    document.addEventListener(\n        scrollEvents[i], _boundScrollHandler, {capture: true, passive: false});\n  }\n}\n\nexport function _unlockScrollInteractions() {\n  for (var i = 0, l = scrollEvents.length; i < l; i++) {\n    // NOTE: browsers that don't support objects as third arg will\n    // interpret it as boolean, hence useCapture = true in this case.\n    document.removeEventListener(\n        scrollEvents[i], _boundScrollHandler, {capture: true, passive: false});\n  }\n}\n\n/**\n * Returns true if the event causes scroll outside the current locking\n * element, e.g. pointer/keyboard interactions, or scroll \"leaking\"\n * outside the locking element when it is already at its scroll boundaries.\n * @param {!Event} event\n * @return {boolean}\n * @private\n */\nexport function _shouldPreventScrolling(event) {\n  // Update if root target changed. For touch events, ensure we don't\n  // update during touchmove.\n  var target = dom(event).rootTarget;\n  if (event.type !== 'touchmove' && lastRootTarget !== target) {\n    lastRootTarget = target;\n    lastScrollableNodes = _getScrollableNodes(dom(event).path);\n  }\n\n  // Prevent event if no scrollable nodes.\n  if (!lastScrollableNodes.length) {\n    return true;\n  }\n  // Don't prevent touchstart event inside the locking element when it has\n  // scrollable nodes.\n  if (event.type === 'touchstart') {\n    return false;\n  }\n  // Get deltaX/Y.\n  var info = _getScrollInfo(event);\n  // Prevent if there is no child that can scroll.\n  return !_getScrollingNode(lastScrollableNodes, info.deltaX, info.deltaY);\n}\n\n/**\n * Returns an array of scrollable nodes up to the current locking element,\n * which is included too if scrollable.\n * @param {!Array<!Node>} nodes\n * @return {!Array<!Node>} scrollables\n * @private\n */\nexport function _getScrollableNodes(nodes) {\n  var scrollables = [];\n  var lockingIndex = nodes.indexOf(currentLockingElement);\n  // Loop from root target to locking element (included).\n  for (var i = 0; i <= lockingIndex; i++) {\n    // Skip non-Element nodes.\n    if (nodes[i].nodeType !== Node.ELEMENT_NODE) {\n      continue;\n    }\n    var node = /** @type {!Element} */ (nodes[i]);\n    // Check inline style before checking computed style.\n    var style = node.style;\n    if (style.overflow !== 'scroll' && style.overflow !== 'auto') {\n      style = window.getComputedStyle(node);\n    }\n    if (style.overflow === 'scroll' || style.overflow === 'auto') {\n      scrollables.push(node);\n    }\n  }\n  return scrollables;\n}\n\n/**\n * Returns the node that is scrolling. If there is no scrolling,\n * returns undefined.\n * @param {!Array<!Node>} nodes\n * @param {number} deltaX Scroll delta on the x-axis\n * @param {number} deltaY Scroll delta on the y-axis\n * @return {!Node|undefined}\n * @private\n */\nexport function _getScrollingNode(nodes, deltaX, deltaY) {\n  // No scroll.\n  if (!deltaX && !deltaY) {\n    return;\n  }\n  // Check only one axis according to where there is more scroll.\n  // Prefer vertical to horizontal.\n  var verticalScroll = Math.abs(deltaY) >= Math.abs(deltaX);\n  for (var i = 0; i < nodes.length; i++) {\n    var node = nodes[i];\n    var canScroll = false;\n    if (verticalScroll) {\n      // delta < 0 is scroll up, delta > 0 is scroll down.\n      canScroll = deltaY < 0 ?\n          node.scrollTop > 0 :\n          node.scrollTop < node.scrollHeight - node.clientHeight;\n    } else {\n      // delta < 0 is scroll left, delta > 0 is scroll right.\n      canScroll = deltaX < 0 ?\n          node.scrollLeft > 0 :\n          node.scrollLeft < node.scrollWidth - node.clientWidth;\n    }\n    if (canScroll) {\n      return node;\n    }\n  }\n}\n\n/**\n * Returns scroll `deltaX` and `deltaY`.\n * @param {!Event} event The scroll event\n * @return {{deltaX: number, deltaY: number}} Object containing the\n * x-axis scroll delta (positive: scroll right, negative: scroll left,\n * 0: no scroll), and the y-axis scroll delta (positive: scroll down,\n * negative: scroll up, 0: no scroll).\n * @private\n */\nexport function _getScrollInfo(event) {\n  var info = {deltaX: event.deltaX, deltaY: event.deltaY};\n  // Already available.\n  if ('deltaX' in event) {\n    // do nothing, values are already good.\n  }\n  // Safari has scroll info in `wheelDeltaX/Y`.\n  else if ('wheelDeltaX' in event && 'wheelDeltaY' in event) {\n    info.deltaX = -event.wheelDeltaX;\n    info.deltaY = -event.wheelDeltaY;\n  }\n  // IE10 has only vertical scroll info in `wheelDelta`.\n  else if ('wheelDelta' in event) {\n    info.deltaX = 0;\n    info.deltaY = -event.wheelDelta;\n  }\n  // Firefox has scroll info in `detail` and `axis`.\n  else if ('axis' in event) {\n    info.deltaX = event.axis === 1 ? event.detail : 0;\n    info.deltaY = event.axis === 2 ? event.detail : 0;\n  }\n  // On mobile devices, calculate scroll direction.\n  else if (event.targetTouches) {\n    var touch = event.targetTouches[0];\n    // Touch moves from right to left => scrolling goes right.\n    info.deltaX = lastTouchPosition.pageX - touch.pageX;\n    // Touch moves from down to up => scrolling goes down.\n    info.deltaY = lastTouchPosition.pageY - touch.pageY;\n  }\n  return info;\n}\n","/**\n@license\nCopyright (c) 2015 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at\nhttp://polymer.github.io/LICENSE.txt The complete set of authors may be found at\nhttp://polymer.github.io/AUTHORS.txt The complete set of contributors may be\nfound at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as\npart of the polymer project is also subject to an additional IP rights grant\nfound at http://polymer.github.io/PATENTS.txt\n*/\nimport '@polymer/polymer/polymer-legacy.js';\n\nimport {IronFitBehavior} from '@polymer/iron-fit-behavior/iron-fit-behavior.js';\nimport {IronResizableBehavior} from '@polymer/iron-resizable-behavior/iron-resizable-behavior.js';\nimport {dom} from '@polymer/polymer/lib/legacy/polymer.dom.js';\nimport {useShadow} from '@polymer/polymer/lib/utils/settings.js';\n\nimport {IronFocusablesHelper} from './iron-focusables-helper.js';\nimport {IronOverlayManager} from './iron-overlay-manager.js';\nimport {pushScrollLock, removeScrollLock} from './iron-scroll-manager.js';\n\n/** @polymerBehavior */\nexport const IronOverlayBehaviorImpl = {\n\n  properties: {\n\n    /**\n     * True if the overlay is currently displayed.\n     */\n    opened:\n        {observer: '_openedChanged', type: Boolean, value: false, notify: true},\n\n    /**\n     * True if the overlay was canceled when it was last closed.\n     */\n    canceled: {\n      observer: '_canceledChanged',\n      readOnly: true,\n      type: Boolean,\n      value: false\n    },\n\n    /**\n     * Set to true to display a backdrop behind the overlay. It traps the focus\n     * within the light DOM of the overlay.\n     */\n    withBackdrop: {\n      observer: '_withBackdropChanged',\n      type: Boolean,\n    },\n\n    /**\n     * Set to true to disable auto-focusing the overlay or child nodes with\n     * the `autofocus` attribute` when the overlay is opened.\n     */\n    noAutoFocus: {\n      type: Boolean,\n      value: false,\n    },\n\n    /**\n     * Set to true to disable canceling the overlay with the ESC key.\n     */\n    noCancelOnEscKey: {\n      type: Boolean,\n      value: false,\n    },\n\n    /**\n     * Set to true to disable canceling the overlay by clicking outside it.\n     */\n    noCancelOnOutsideClick: {\n      type: Boolean,\n      value: false,\n    },\n\n    /**\n     * Contains the reason(s) this overlay was last closed (see\n     * `iron-overlay-closed`). `IronOverlayBehavior` provides the `canceled`\n     * reason; implementers of the behavior can provide other reasons in\n     * addition to `canceled`.\n     */\n    closingReason: {\n      // was a getter before, but needs to be a property so other\n      // behaviors can override this.\n      type: Object,\n    },\n\n    /**\n     * Set to true to enable restoring of focus when overlay is closed.\n     */\n    restoreFocusOnClose: {\n      type: Boolean,\n      value: false,\n    },\n\n    /**\n     * Set to true to allow clicks to go through overlays.\n     * When the user clicks outside this overlay, the click may\n     * close the overlay below.\n     */\n    allowClickThrough: {\n      type: Boolean,\n    },\n\n    /**\n     * Set to true to keep overlay always on top.\n     */\n    alwaysOnTop: {\n      type: Boolean,\n    },\n\n    /**\n     * Determines which action to perform when scroll outside an opened overlay\n     * happens. Possible values: lock - blocks scrolling from happening, refit -\n     * computes the new position on the overlay cancel - causes the overlay to\n     * close\n     */\n    scrollAction: {\n      type: String,\n    },\n\n    /**\n     * Shortcut to access to the overlay manager.\n     * @private\n     * @type {!IronOverlayManagerClass}\n     */\n    _manager: {\n      type: Object,\n      value: IronOverlayManager,\n    },\n\n    /**\n     * The node being focused.\n     * @type {?Node}\n     */\n    _focusedChild: {\n      type: Object,\n    }\n\n  },\n\n  listeners: {'iron-resize': '_onIronResize'},\n\n  observers: ['__updateScrollObservers(isAttached, opened, scrollAction)'],\n\n  /**\n   * The backdrop element.\n   * @return {!Element}\n   */\n  get backdropElement() {\n    return this._manager.backdropElement;\n  },\n\n  /**\n   * Returns the node to give focus to.\n   * @return {!Node}\n   */\n  get _focusNode() {\n    return this._focusedChild || dom(this).querySelector('[autofocus]') || this;\n  },\n\n  /**\n   * Array of nodes that can receive focus (overlay included), ordered by\n   * `tabindex`. This is used to retrieve which is the first and last focusable\n   * nodes in order to wrap the focus for overlays `with-backdrop`.\n   *\n   * If you know what is your content (specifically the first and last focusable\n   * children), you can override this method to return only `[firstFocusable,\n   * lastFocusable];`\n   * @return {!Array<!Node>}\n   * @protected\n   */\n  get _focusableNodes() {\n    return IronFocusablesHelper.getTabbableNodes(this);\n  },\n\n  /**\n   * @return {void}\n   */\n  ready: function() {\n    // Used to skip calls to notifyResize and refit while the overlay is\n    // animating.\n    this.__isAnimating = false;\n    // with-backdrop needs tabindex to be set in order to trap the focus.\n    // If it is not set, IronOverlayBehavior will set it, and remove it if\n    // with-backdrop = false.\n    this.__shouldRemoveTabIndex = false;\n    // Used for wrapping the focus on TAB / Shift+TAB.\n    this.__firstFocusableNode = this.__lastFocusableNode = null;\n    // Used by to keep track of the RAF callbacks.\n    this.__rafs = {};\n    // Focused node before overlay gets opened. Can be restored on close.\n    this.__restoreFocusNode = null;\n    // Scroll info to be restored.\n    this.__scrollTop = this.__scrollLeft = null;\n    this.__onCaptureScroll = this.__onCaptureScroll.bind(this);\n    // Root nodes hosting the overlay, used to listen for scroll events on them.\n    this.__rootNodes = null;\n    this._ensureSetup();\n  },\n\n  attached: function() {\n    // Call _openedChanged here so that position can be computed correctly.\n    if (this.opened) {\n      this._openedChanged(this.opened);\n    }\n    this._observer = dom(this).observeNodes(this._onNodesChange);\n  },\n\n  detached: function() {\n    dom(this).unobserveNodes(this._observer);\n    this._observer = null;\n    for (var cb in this.__rafs) {\n      if (this.__rafs[cb] !== null) {\n        cancelAnimationFrame(this.__rafs[cb]);\n      }\n    }\n    this.__rafs = {};\n    this._manager.removeOverlay(this);\n\n    // We got detached while animating, ensure we show/hide the overlay\n    // and fire iron-overlay-opened/closed event!\n    if (this.__isAnimating) {\n      if (this.opened) {\n        this._finishRenderOpened();\n      } else {\n        // Restore the focus if necessary.\n        this._applyFocus();\n        this._finishRenderClosed();\n      }\n    }\n  },\n\n  /**\n   * Toggle the opened state of the overlay.\n   */\n  toggle: function() {\n    this._setCanceled(false);\n    this.opened = !this.opened;\n  },\n\n  /**\n   * Open the overlay.\n   */\n  open: function() {\n    this._setCanceled(false);\n    this.opened = true;\n  },\n\n  /**\n   * Close the overlay.\n   */\n  close: function() {\n    this._setCanceled(false);\n    this.opened = false;\n  },\n\n  /**\n   * Cancels the overlay.\n   * @param {Event=} event The original event\n   */\n  cancel: function(event) {\n    var cancelEvent =\n        this.fire('iron-overlay-canceled', event, {cancelable: true});\n    if (cancelEvent.defaultPrevented) {\n      return;\n    }\n\n    this._setCanceled(true);\n    this.opened = false;\n  },\n\n  /**\n   * Invalidates the cached tabbable nodes. To be called when any of the\n   * focusable content changes (e.g. a button is disabled).\n   */\n  invalidateTabbables: function() {\n    this.__firstFocusableNode = this.__lastFocusableNode = null;\n  },\n\n  _ensureSetup: function() {\n    if (this._overlaySetup) {\n      return;\n    }\n    this._overlaySetup = true;\n    this.style.outline = 'none';\n    this.style.display = 'none';\n  },\n\n  /**\n   * Called when `opened` changes.\n   * @param {boolean=} opened\n   * @protected\n   */\n  _openedChanged: function(opened) {\n    if (opened) {\n      this.removeAttribute('aria-hidden');\n    } else {\n      this.setAttribute('aria-hidden', 'true');\n    }\n\n    // Defer any animation-related code on attached\n    // (_openedChanged gets called again on attached).\n    if (!this.isAttached) {\n      return;\n    }\n\n    this.__isAnimating = true;\n\n    // Deraf for non-blocking rendering.\n    this.__deraf('__openedChanged', this.__openedChanged);\n  },\n\n  _canceledChanged: function() {\n    this.closingReason = this.closingReason || {};\n    this.closingReason.canceled = this.canceled;\n  },\n\n  _withBackdropChanged: function() {\n    // If tabindex is already set, no need to override it.\n    if (this.withBackdrop && !this.hasAttribute('tabindex')) {\n      this.setAttribute('tabindex', '-1');\n      this.__shouldRemoveTabIndex = true;\n    } else if (this.__shouldRemoveTabIndex) {\n      this.removeAttribute('tabindex');\n      this.__shouldRemoveTabIndex = false;\n    }\n    if (this.opened && this.isAttached) {\n      this._manager.trackBackdrop();\n    }\n  },\n\n  /**\n   * tasks which must occur before opening; e.g. making the element visible.\n   * @protected\n   */\n  _prepareRenderOpened: function() {\n    // Store focused node.\n    this.__restoreFocusNode = this._manager.deepActiveElement;\n\n    // Needed to calculate the size of the overlay so that transitions on its\n    // size will have the correct starting points.\n    this._preparePositioning();\n    this.refit();\n    this._finishPositioning();\n\n    // Safari will apply the focus to the autofocus element when displayed\n    // for the first time, so we make sure to return the focus where it was.\n    if (this.noAutoFocus && document.activeElement === this._focusNode) {\n      this._focusNode.blur();\n      this.__restoreFocusNode.focus();\n    }\n  },\n\n  /**\n   * Tasks which cause the overlay to actually open; typically play an\n   * animation.\n   * @protected\n   */\n  _renderOpened: function() {\n    this._finishRenderOpened();\n  },\n\n  /**\n   * Tasks which cause the overlay to actually close; typically play an\n   * animation.\n   * @protected\n   */\n  _renderClosed: function() {\n    this._finishRenderClosed();\n  },\n\n  /**\n   * Tasks to be performed at the end of open action. Will fire\n   * `iron-overlay-opened`.\n   * @protected\n   */\n  _finishRenderOpened: function() {\n    this.notifyResize();\n    this.__isAnimating = false;\n\n    this.fire('iron-overlay-opened');\n  },\n\n  /**\n   * Tasks to be performed at the end of close action. Will fire\n   * `iron-overlay-closed`.\n   * @protected\n   */\n  _finishRenderClosed: function() {\n    // Hide the overlay.\n    this.style.display = 'none';\n    // Reset z-index only at the end of the animation.\n    this.style.zIndex = '';\n    this.notifyResize();\n    this.__isAnimating = false;\n    this.fire('iron-overlay-closed', this.closingReason);\n  },\n\n  _preparePositioning: function() {\n    this.style.transition = this.style.webkitTransition = 'none';\n    this.style.transform = this.style.webkitTransform = 'none';\n    this.style.display = '';\n  },\n\n  _finishPositioning: function() {\n    // First, make it invisible & reactivate animations.\n    this.style.display = 'none';\n    // Force reflow before re-enabling animations so that they don't start.\n    // Set scrollTop to itself so that Closure Compiler doesn't remove this.\n    this.scrollTop = this.scrollTop;\n    this.style.transition = this.style.webkitTransition = '';\n    this.style.transform = this.style.webkitTransform = '';\n    // Now that animations are enabled, make it visible again\n    this.style.display = '';\n    // Force reflow, so that following animations are properly started.\n    // Set scrollTop to itself so that Closure Compiler doesn't remove this.\n    this.scrollTop = this.scrollTop;\n  },\n\n  /**\n   * Applies focus according to the opened state.\n   * @protected\n   */\n  _applyFocus: function() {\n    if (this.opened) {\n      if (!this.noAutoFocus) {\n        this._focusNode.focus();\n      }\n    } else {\n      // Restore focus.\n      if (this.restoreFocusOnClose && this.__restoreFocusNode) {\n        // If the activeElement is `<body>` or inside the overlay,\n        // we are allowed to restore the focus. In all the other\n        // cases focus might have been moved elsewhere by another\n        // component or by an user interaction (e.g. click on a\n        // button outside the overlay).\n        var activeElement = this._manager.deepActiveElement;\n        if (activeElement === document.body ||\n            dom(this).deepContains(activeElement)) {\n          this.__restoreFocusNode.focus();\n        }\n      }\n      this.__restoreFocusNode = null;\n      this._focusNode.blur();\n      this._focusedChild = null;\n    }\n  },\n\n  /**\n   * Cancels (closes) the overlay. Call when click happens outside the overlay.\n   * @param {!Event} event\n   * @protected\n   */\n  _onCaptureClick: function(event) {\n    if (!this.noCancelOnOutsideClick) {\n      this.cancel(event);\n    }\n  },\n\n  /**\n   * Keeps track of the focused child. If withBackdrop, traps focus within\n   * overlay.\n   * @param {!Event} event\n   * @protected\n   */\n  _onCaptureFocus: function(event) {\n    if (!this.withBackdrop) {\n      return;\n    }\n    var path = dom(event).path;\n    if (path.indexOf(this) === -1) {\n      event.stopPropagation();\n      this._applyFocus();\n    } else {\n      this._focusedChild = path[0];\n    }\n  },\n\n  /**\n   * Handles the ESC key event and cancels (closes) the overlay.\n   * @param {!Event} event\n   * @protected\n   */\n  _onCaptureEsc: function(event) {\n    if (!this.noCancelOnEscKey) {\n      this.cancel(event);\n    }\n  },\n\n  /**\n   * Handles TAB key events to track focus changes.\n   * Will wrap focus for overlays withBackdrop.\n   * @param {!Event} event\n   * @protected\n   */\n  _onCaptureTab: function(event) {\n    if (!this.withBackdrop) {\n      return;\n    }\n    this.__ensureFirstLastFocusables();\n    // TAB wraps from last to first focusable.\n    // Shift + TAB wraps from first to last focusable.\n    var shift = event.shiftKey;\n    var nodeToCheck =\n        shift ? this.__firstFocusableNode : this.__lastFocusableNode;\n    var nodeToSet =\n        shift ? this.__lastFocusableNode : this.__firstFocusableNode;\n    var shouldWrap = false;\n    if (nodeToCheck === nodeToSet) {\n      // If nodeToCheck is the same as nodeToSet, it means we have an overlay\n      // with 0 or 1 focusables; in either case we still need to trap the\n      // focus within the overlay.\n      shouldWrap = true;\n    } else {\n      // In dom=shadow, the manager will receive focus changes on the main\n      // root but not the ones within other shadow roots, so we can't rely on\n      // _focusedChild, but we should check the deepest active element.\n      var focusedNode = this._manager.deepActiveElement;\n      // If the active element is not the nodeToCheck but the overlay itself,\n      // it means the focus is about to go outside the overlay, hence we\n      // should prevent that (e.g. user opens the overlay and hit Shift+TAB).\n      shouldWrap = (focusedNode === nodeToCheck || focusedNode === this);\n    }\n\n    if (shouldWrap) {\n      // When the overlay contains the last focusable element of the document\n      // and it's already focused, pressing TAB would move the focus outside\n      // the document (e.g. to the browser search bar). Similarly, when the\n      // overlay contains the first focusable element of the document and it's\n      // already focused, pressing Shift+TAB would move the focus outside the\n      // document (e.g. to the browser search bar).\n      // In both cases, we would not receive a focus event, but only a blur.\n      // In order to achieve focus wrapping, we prevent this TAB event and\n      // force the focus. This will also prevent the focus to temporarily move\n      // outside the overlay, which might cause scrolling.\n      event.preventDefault();\n      this._focusedChild = nodeToSet;\n      this._applyFocus();\n    }\n  },\n\n  /**\n   * Refits if the overlay is opened and not animating.\n   * @protected\n   */\n  _onIronResize: function() {\n    if (this.opened && !this.__isAnimating) {\n      this.__deraf('refit', this.refit);\n    }\n  },\n\n  /**\n   * Will call notifyResize if overlay is opened.\n   * Can be overridden in order to avoid multiple observers on the same node.\n   * @protected\n   */\n  _onNodesChange: function() {\n    if (this.opened && !this.__isAnimating) {\n      // It might have added focusable nodes, so invalidate cached values.\n      this.invalidateTabbables();\n      this.notifyResize();\n    }\n  },\n\n  /**\n   * Updates the references to the first and last focusable nodes.\n   * @private\n   */\n  __ensureFirstLastFocusables: function() {\n    var focusableNodes = this._focusableNodes;\n    this.__firstFocusableNode = focusableNodes[0];\n    this.__lastFocusableNode = focusableNodes[focusableNodes.length - 1];\n  },\n\n  /**\n   * Tasks executed when opened changes: prepare for the opening, move the\n   * focus, update the manager, render opened/closed.\n   * @private\n   */\n  __openedChanged: function() {\n    if (this.opened) {\n      // Make overlay visible, then add it to the manager.\n      this._prepareRenderOpened();\n      this._manager.addOverlay(this);\n      // Move the focus to the child node with [autofocus].\n      this._applyFocus();\n\n      this._renderOpened();\n    } else {\n      // Remove overlay, then restore the focus before actually closing.\n      this._manager.removeOverlay(this);\n      this._applyFocus();\n\n      this._renderClosed();\n    }\n  },\n\n  /**\n   * Debounces the execution of a callback to the next animation frame.\n   * @param {!string} jobname\n   * @param {!Function} callback Always bound to `this`\n   * @private\n   */\n  __deraf: function(jobname, callback) {\n    var rafs = this.__rafs;\n    if (rafs[jobname] !== null) {\n      cancelAnimationFrame(rafs[jobname]);\n    }\n    rafs[jobname] = requestAnimationFrame(function nextAnimationFrame() {\n      rafs[jobname] = null;\n      callback.call(this);\n    }.bind(this));\n  },\n\n  /**\n   * @param {boolean} isAttached\n   * @param {boolean} opened\n   * @param {string=} scrollAction\n   * @private\n   */\n  __updateScrollObservers: function(isAttached, opened, scrollAction) {\n    if (!isAttached || !opened || !this.__isValidScrollAction(scrollAction)) {\n      removeScrollLock(this);\n      this.__removeScrollListeners();\n    } else {\n      if (scrollAction === 'lock') {\n        this.__saveScrollPosition();\n        pushScrollLock(this);\n      }\n      this.__addScrollListeners();\n    }\n  },\n\n  /**\n   * @private\n   */\n  __addScrollListeners: function() {\n    if (!this.__rootNodes) {\n      this.__rootNodes = [];\n      // Listen for scroll events in all shadowRoots hosting this overlay only\n      // when in native ShadowDOM.\n      if (useShadow) {\n        var node = this;\n        while (node) {\n          if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE && node.host) {\n            this.__rootNodes.push(node);\n          }\n          node = node.host || node.assignedSlot || node.parentNode;\n        }\n      }\n      this.__rootNodes.push(document);\n    }\n    this.__rootNodes.forEach(function(el) {\n      el.addEventListener('scroll', this.__onCaptureScroll, {\n        capture: true,\n        passive: true,\n      });\n    }, this);\n  },\n\n  /**\n   * @private\n   */\n  __removeScrollListeners: function() {\n    if (this.__rootNodes) {\n      this.__rootNodes.forEach(function(el) {\n        el.removeEventListener('scroll', this.__onCaptureScroll, {\n          capture: true,\n          passive: true,\n        });\n      }, this);\n    }\n    if (!this.isAttached) {\n      this.__rootNodes = null;\n    }\n  },\n\n  /**\n   * @param {string=} scrollAction\n   * @return {boolean}\n   * @private\n   */\n  __isValidScrollAction: function(scrollAction) {\n    return scrollAction === 'lock' || scrollAction === 'refit' ||\n        scrollAction === 'cancel';\n  },\n\n  /**\n   * @private\n   */\n  __onCaptureScroll: function(event) {\n    if (this.__isAnimating) {\n      return;\n    }\n    // Check if scroll outside the overlay.\n    if (dom(event).path.indexOf(this) >= 0) {\n      return;\n    }\n    switch (this.scrollAction) {\n      case 'lock':\n        // NOTE: scrolling might happen if a scroll event is not cancellable, or\n        // if user pressed keys that cause scrolling (they're not prevented in\n        // order not to break a11y features like navigate with arrow keys).\n        this.__restoreScrollPosition();\n        break;\n      case 'refit':\n        this.__deraf('refit', this.refit);\n        break;\n      case 'cancel':\n        this.cancel(event);\n        break;\n    }\n  },\n\n  /**\n   * Memoizes the scroll position of the outside scrolling element.\n   * @private\n   */\n  __saveScrollPosition: function() {\n    if (document.scrollingElement) {\n      this.__scrollTop = document.scrollingElement.scrollTop;\n      this.__scrollLeft = document.scrollingElement.scrollLeft;\n    } else {\n      // Since we don't know if is the body or html, get max.\n      this.__scrollTop =\n          Math.max(document.documentElement.scrollTop, document.body.scrollTop);\n      this.__scrollLeft = Math.max(\n          document.documentElement.scrollLeft, document.body.scrollLeft);\n    }\n  },\n\n  /**\n   * Resets the scroll position of the outside scrolling element.\n   * @private\n   */\n  __restoreScrollPosition: function() {\n    if (document.scrollingElement) {\n      document.scrollingElement.scrollTop = this.__scrollTop;\n      document.scrollingElement.scrollLeft = this.__scrollLeft;\n    } else {\n      // Since we don't know if is the body or html, set both.\n      document.documentElement.scrollTop = document.body.scrollTop =\n          this.__scrollTop;\n      document.documentElement.scrollLeft = document.body.scrollLeft =\n          this.__scrollLeft;\n    }\n  },\n\n};\n\n/**\n  Use `Polymer.IronOverlayBehavior` to implement an element that can be hidden\n  or shown, and displays on top of other content. It includes an optional\n  backdrop, and can be used to implement a variety of UI controls including\n  dialogs and drop downs. Multiple overlays may be displayed at once.\n\n  See the [demo source\n  code](https://github.com/PolymerElements/iron-overlay-behavior/blob/master/demo/simple-overlay.html)\n  for an example.\n\n  ### Closing and canceling\n\n  An overlay may be hidden by closing or canceling. The difference between close\n  and cancel is user intent. Closing generally implies that the user\n  acknowledged the content on the overlay. By default, it will cancel whenever\n  the user taps outside it or presses the escape key. This behavior is\n  configurable with the `no-cancel-on-esc-key` and the\n  `no-cancel-on-outside-click` properties. `close()` should be called explicitly\n  by the implementer when the user interacts with a control in the overlay\n  element. When the dialog is canceled, the overlay fires an\n  'iron-overlay-canceled' event. Call `preventDefault` on this event to prevent\n  the overlay from closing.\n\n  ### Positioning\n\n  By default the element is sized and positioned to fit and centered inside the\n  window. You can position and size it manually using CSS. See\n  `Polymer.IronFitBehavior`.\n\n  ### Backdrop\n\n  Set the `with-backdrop` attribute to display a backdrop behind the overlay.\n  The backdrop is appended to `<body>` and is of type `<iron-overlay-backdrop>`.\n  See its doc page for styling options.\n\n  In addition, `with-backdrop` will wrap the focus within the content in the\n  light DOM. Override the [`_focusableNodes`\n  getter](#Polymer.IronOverlayBehavior:property-_focusableNodes) to achieve a\n  different behavior.\n\n  ### Limitations\n\n  The element is styled to appear on top of other content by setting its\n  `z-index` property. You must ensure no element has a stacking context with a\n  higher `z-index` than its parent stacking context. You should place this\n  element as a child of `<body>` whenever possible.\n\n  @demo demo/index.html\n  @polymerBehavior\n */\nexport const IronOverlayBehavior =\n    [IronFitBehavior, IronResizableBehavior, IronOverlayBehaviorImpl];\n\n/**\n * Fired after the overlay opens.\n * @event iron-overlay-opened\n */\n\n/**\n * Fired when the overlay is canceled, but before it is closed.\n * @event iron-overlay-canceled\n * @param {Event} event The closing of the overlay can be prevented\n * by calling `event.preventDefault()`. The `event.detail` is the original event\n * that originated the canceling (e.g. ESC keyboard event or click event outside\n * the overlay).\n */\n\n/**\n * Fired after the overlay closes.\n * @event iron-overlay-closed\n * @param {Event} event The `event.detail` is the `closingReason` property\n * (contains `canceled`, whether the overlay was canceled).\n */\n","import { IronOverlayBehavior } from '@polymer/iron-overlay-behavior/iron-overlay-behavior';\nimport { mixinBehaviors } from '@polymer/polymer/lib/legacy/class';\nexport const ZuiDialogBehaviorMixin = superClass => {\n  return class extends mixinBehaviors(IronOverlayBehavior, superClass) {\n    static get properties() {\n      return {\n        noCancelOutsideDialog: {\n          type: Boolean,\n          value: false,\n\n          observer(value) {\n            this._closeOptionsChanged(value);\n          }\n\n        },\n        hideBackdrop: {\n          type: Boolean,\n          value: false,\n\n          observer(value) {\n            this._hideBackdropChanged(value);\n          }\n\n        }\n      };\n    }\n\n    constructor() {\n      super();\n      this.properties.withBackdrop.value = true;\n      this.restoreFocusOnClose = true;\n      this.addEventListener('click', this._onDialogClick);\n      this.addEventListener('iron-overlay-canceled', () => {\n        this._triggerCloseEvent(false);\n      });\n      let body = document.querySelector('body');\n      this.addEventListener('opened-changed', e => {\n        body.style.overflow = e.detail.value ? 'hidden' : 'auto';\n      });\n    }\n\n    _closeOptionsChanged(value) {\n      if (value) {\n        this.noCancelOnOutsideClick = true;\n        this.noCancelOnEscKey = true;\n      } else {\n        this.noCancelOnOutsideClick = false;\n        this.noCancelOnEscKey = false;\n      }\n    }\n\n    _hideBackdropChanged(value) {\n      this.withBackdrop = !value;\n    }\n\n    _onDialogClick(event) {\n      const path = event.path || event.composedPath && event.composedPath();\n\n      if (path.indexOf(this) === 0 && !this.noCancelOnOutsideClick) {\n        this._triggerCloseEvent(false);\n\n        this.close();\n        event.stopPropagation();\n      } else {\n        for (let i = 0, l = path.indexOf(this); i < l; i++) {\n          const target = path[i];\n\n          if (target.hasAttribute && (target.hasAttribute('dialog-close') || target.hasAttribute('dialog-confirm'))) {\n            this._triggerCloseEvent(target.hasAttribute('dialog-confirm'));\n\n            this.close();\n            event.stopPropagation();\n            break;\n          }\n        }\n      }\n    }\n\n    _triggerCloseEvent(val) {\n      this.dispatchEvent(new CustomEvent('close', {\n        detail: val\n      }));\n    }\n\n  };\n};","import { ZuiBaseMixin } from '@zywave/zui-base';\nimport { PolymerElement, html } from '@polymer/polymer/polymer-element';\nimport { afterNextRender } from '@polymer/polymer/lib/utils/render-status';\nimport { ZuiDialogBehaviorMixin } from './zui-dialog-behavior.js';\nimport '@zywave/zui-icons';\n\nclass ZuiDialog extends ZuiBaseMixin(ZuiDialogBehaviorMixin(PolymerElement)) {\n  static get properties() {\n    return {};\n  }\n\n  constructor() {\n    super();\n  }\n\n  ready() {\n    super.ready();\n    this.setAttribute('role', 'dialog');\n    afterNextRender(this, () => {\n      if (!this.noCancelOutsideDialog) {\n        this.shadowRoot.getElementById('close').addEventListener('click', () => {\n          this._triggerCloseEvent(false);\n\n          this.close();\n        });\n      }\n    });\n  }\n\n  static get template() {\n    return html`\n      <style>\n        :host{position:fixed;top:0;right:0;bottom:0;left:0;overflow-y:auto;display:-webkit-box;display:-ms-flexbox;display:flex;padding:2em;z-index:500000;-ms-flex-direction:column}:host .wrapper{position:relative;width:100%;margin:auto;padding:1em;background-color:white;-ms-flex-negative:0;-webkit-box-shadow:rgba(0,0,0,0.14) 0px 16px 24px 2px,rgba(0,0,0,0.12) 0px 6px 30px 5px,rgba(0,0,0,0.4) 0px 8px 10px -5px;box-shadow:rgba(0,0,0,0.14) 0px 16px 24px 2px,rgba(0,0,0,0.12) 0px 6px 30px 5px,rgba(0,0,0,0.4) 0px 8px 10px -5px}:host .wrapper .x{position:absolute;top:-1.75em;right:-1.75em;cursor:pointer;color:#fff;border:none;background-color:transparent;-webkit-transition:0.2s;transition:0.2s;margin-top:0px;padding:0px}:host .wrapper .x:hover{opacity:0.7;-webkit-transition:0.2s;transition:0.2s}:host .wrapper .x button{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;border:0;border-radius:30px;cursor:pointer;width:28px;height:28px;padding:3px;background-color:transparent;color:#fff}:host .wrapper .x button:active,:host .wrapper .x button:hover,:host .wrapper .x button:focus{outline:none;opacity:0.7;-webkit-transition:0.2s;transition:0.2s}:host .wrapper .x .icon{display:inline-block;vertical-align:top;padding:0;margin:0;height:22px;width:22px;margin-left:-1px}:host .wrapper .x .icon zui-icon{--iron-icon-height: 18px;--iron-icon-width: 18px}:host(.small) .wrapper{max-width:32em}:host(.medium) .wrapper{max-width:48em}:host(.large) .wrapper{max-width:64em}:host(.full) .wrapper{max-width:98%}:host([hide-backdrop]) .x button{border-radius:30px}:host([hide-backdrop]) .x button zui-icon{color:var(--zui-gray-600)}:host([hide-backdrop]) .x button:hover{-webkit-transition:0.2s;transition:0.2s}\n      </style>\n      <div id=\"wrapper\" class=\"wrapper\">\n        <template is=\"dom-if\" if=\"{{!noCancelOutsideDialog}}\">\n          <div class=\"x\">\n            <button id=\"close\" aria-label=\"close\">\n              <div class=\"icon\"> <zui-icon icon=\"zui-close\"></zui-icon> </div>\n            </button>\n          </div>\n        </template>\n        <slot></slot>\n      </div>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-dialog', ZuiDialog);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\nimport '@zywave/zui-icons';\nimport '@zywave/zui-colors';\n\nclass ZuiButton extends ZuiBaseElement {\n  static get properties() {\n    return {\n      disabled: {\n        type: Boolean\n      },\n      icon: {\n        type: String\n      },\n      loading: {\n        type: Boolean\n      }\n    };\n  }\n\n  constructor() {\n    super();\n  }\n\n  connectedCallback() {\n    super.connectedCallback();\n    this.setAttribute('role', 'button');\n  }\n\n  firstUpdated() {\n    let slot = this.shadowRoot.querySelector('slot');\n\n    if (slot) {\n      slot.addEventListener('click', e => {\n        if (this.disabled) {\n          e.stopPropagation();\n          e.preventDefault();\n        }\n      });\n    }\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host button{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-ms-flex-negative:0;flex-shrink:0;padding:1em 1.5em;border:0;border-radius:2em;text-align:center;cursor:pointer;font-size:inherit;line-height:1;background-color:var(--zui-button-color, var(--zui-gray-800));color:var(--zui-button-text-color, white);-webkit-transition:background-color 250ms ease-out;transition:background-color 250ms ease-out}:host button:hover{color:var(--zui-button-text-hover-color, var(--zui-button-text-color, white));background-color:var(--zui-button-hover-color, var(--zui-gray-700));text-decoration:none;-webkit-transition:background-color 250ms ease-out;transition:background-color 250ms ease-out}:host button:focus{outline:none;background-color:var(--zui-button-hover-color, var(--zui-gray-700));-webkit-transition:background-color 250ms ease-out;transition:background-color 250ms ease-out}:host button:active{background-color:var(--zui-button-active-color, var(--zui-gray-900));-webkit-box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black);box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black);-webkit-transform:translateY(1px);transform:translateY(1px)}:host([disabled]) button{background-color:var(--zui-gray-300);-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none;color:var(--zui-gray-400);outline:none}:host([disabled]) button:hover{cursor:not-allowed}:host([icon]) button{padding-top:0.643em;padding-bottom:0.643em}:host([icon]) button zui-icon{margin-left:0;margin-right:5px;display:inline-block;width:var(--zui-button-icon-size, var(--zui-icon-size, 24px));height:var(--zui-button-icon-size, var(--zui-icon-size, 24px));vertical-align:middle;fill:currentColor}:host([icon]) button:disabled zui-icon{fill:var(--zui-gray-400)}:host(.small) button{-ms-flex-negative:0;flex-shrink:0;padding:0.78571em 1em;font-size:inherit}:host(.secondary) button{background-color:transparent;color:var(--zui-button-text-color, var(--zui-button-color, var(--zui-gray-800)));-webkit-box-shadow:inset 0 0 0 1px var(--zui-button-active-box-shadow, var(--zui-gray-700));box-shadow:inset 0 0 0 1px var(--zui-button-active-box-shadow, var(--zui-gray-700))}:host(.secondary) button:hover{color:white;background-color:var(--zui-button-hover-color, var(--zui-gray-700));-webkit-box-shadow:inset 0 0 0 1px transparent;box-shadow:inset 0 0 0 1px transparent;-webkit-transition:background-color 250ms ease-out, -webkit-box-shadow 250ms ease-out;transition:background-color 250ms ease-out, -webkit-box-shadow 250ms ease-out;transition:background-color 250ms ease-out, box-shadow 250ms ease-out;transition:background-color 250ms ease-out, box-shadow 250ms ease-out, -webkit-box-shadow 250ms ease-out}:host(.secondary) button:focus{outline:none}:host(.secondary) button:active{color:white;background-color:var(--zui-button-active-color, var(--zui-gray-900));-webkit-box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black);box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black)}:host(.secondary) button:disabled{color:var(--zui-gray-400);-webkit-box-shadow:inset 0 0 0 1px var(--zui-gray-200);box-shadow:inset 0 0 0 1px var(--zui-gray-200)}:host(.secondary) button:disabled:hover,:host(.secondary) button:disabled:active{background-color:transparent}:host(.danger) button{background-color:var(--zui-danger-button-color, var(--zui-red-500));color:var(--zui-danger-button-text-color, white)}:host(.danger) button:active{background-color:var(--zui-danger-button-active-color, var(--zui-red-600));-webkit-box-shadow:inset 0 2px 0 var(--zui-danger-button-active-box-shadow, var(--zui-red-700));box-shadow:inset 0 2px 0 var(--zui-danger-button-active-box-shadow, var(--zui-red-700));-webkit-transform:translateY(1px);transform:translateY(1px)}:host(.danger) button:hover{background-color:var(--zui-danger-button-hover-color, var(--zui-red-400));text-decoration:none}:host(.danger) button:focus{outline:none}:host(.link) button{color:var(--zui-link-button-text-color, var(--zui-blue-400));background-color:transparent}:host(.link) button:hover{color:var(--zui-link-button-text-hover-color, var(--zui-blue-600));background-color:var(--zui-link-button-hover-color, var(--zui-gray-100))}:host(.link) button:focus{outline:none}:host(.link) button:active{color:var(--zui-link-button-text-active-color, var(--zui-blue-400));background-color:var(--zui-link-button-active-color, var(--zui-gray-100));-webkit-box-shadow:inset 0 2px 0 var(--zui-link-button-active-box-shadow, var(--zui-gray-200));box-shadow:inset 0 2px 0 var(--zui-link-button-active-box-shadow, var(--zui-gray-200))}:host(.link) button:disabled{color:var(--zui-gray-400);-webkit-box-shadow:inset 0 0 0 1px var(--zui-gray-200);box-shadow:inset 0 0 0 1px var(--zui-gray-200)}:host(.link) button:disabled:hover,:host(.link) button:disabled:active{background-color:transparent}\n      </style>\n    `;\n  }\n\n  render() {\n    let iconHtml = '';\n    let loadingHtml = '';\n    let textSlot = '';\n\n    if (this.loading) {\n      loadingHtml = html`\n        <zui-spinner active></zui-spinner>\n      `;\n    }\n\n    if (this.icon) {\n      iconHtml = html`\n        <zui-icon icon=\"${this.icon}\"></zui-icon>\n      `;\n      textSlot = html`\n        <span><slot></slot></span>\n      `;\n    } else {\n      iconHtml = '';\n      textSlot = html`\n        <slot></slot>\n      `;\n    }\n\n    return html`\n      ${this._renderStyle()} <button ?disabled=\"${this.disabled}\"> ${iconHtml} ${loadingHtml} ${textSlot} </button>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-button', ZuiButton);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\nimport '@zywave/zui-colors';\n\nclass ZuiFloatingActionButton extends ZuiBaseElement {\n  static get properties() {\n    return {\n      icon: {\n        type: String\n      },\n      disabled: {\n        type: Boolean\n      }\n    };\n  }\n\n  constructor() {\n    super();\n  }\n\n  connectedCallback() {\n    super.connectedCallback();\n    this.setAttribute('role', 'button');\n  }\n\n  firstUpdated() {\n    let slot = this.shadowRoot.querySelector('slot');\n\n    if (slot) {\n      slot.addEventListener('click', e => {\n        if (this.disabled) {\n          e.stopPropagation();\n          e.preventDefault();\n        }\n      });\n    }\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host button{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;width:5.2rem;height:5.2rem;padding:0;color:var(--zui-button-text-color, #fff);background-color:var(--zui-button-color, var(--zui-gray-800));border:none;border-radius:50%;cursor:pointer;-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,0.25);box-shadow:0 4px 8px 0 rgba(0,0,0,0.25);-webkit-transition:-webkit-box-shadow 100ms ease-in-out;transition:-webkit-box-shadow 100ms ease-in-out;transition:box-shadow 100ms ease-in-out;transition:box-shadow 100ms ease-in-out, -webkit-box-shadow 100ms ease-in-out}:host button:hover{background-color:var(--zui-button-hover-color, var(--zui-gray-700));-webkit-box-shadow:0 7px 12px 0 rgba(0,0,0,0.25);box-shadow:0 7px 12px 0 rgba(0,0,0,0.25)}:host button:focus{outline:none}:host button:active{background-color:var(--zui-button-active-color, var(--zui-gray-900));-webkit-box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black);box-shadow:inset 0 2px 0 var(--zui-button-active-box-shadow, black);-webkit-transform:translateY(1px);transform:translateY(1px)}:host([icon]) button zui-icon{font-weight:normal;font-style:normal;font-size:var(--zui-button-icon-size, 3rem);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;fill:var(--zui-floating-action-button-icon-color, currentColor)}:host([disabled]) button{background-color:var(--zui-gray-200);-webkit-transform:none;transform:none;-webkit-box-shadow:none;box-shadow:none;color:var(--zui-gray-400);outline:none}:host([disabled]) button:hover{cursor:not-allowed}\n      </style>\n    `;\n  }\n\n  render() {\n    let iconHtml = '';\n\n    if (this.icon) {\n      iconHtml = html`\n        <zui-icon icon=\"${this.icon}\"></zui-icon>\n      `;\n    } else {\n      iconHtml = html`\n        <slot></slot>\n      `;\n    }\n\n    return html`\n      ${this._renderStyle()} <button ?disabled=\"${this.disabled}\"> ${iconHtml} </button>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-fab', ZuiFloatingActionButton);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\nimport '@zywave/zui-colors';\n\nclass ZuiToggleButton extends ZuiBaseElement {\n  static get properties() {\n    return {};\n  }\n\n  constructor() {\n    super();\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}::slotted(zui-button){border-radius:0}::slotted(zui-button:first-of-type){border-bottom-left-radius:30px;border-top-left-radius:30px}::slotted(zui-button:last-of-type){border-top-right-radius:30px;border-bottom-right-radius:30px}\n      </style>\n    `;\n  }\n\n  render() {\n    return html`\n      ${this._renderStyle()} <slot></slot>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-toggle-button', ZuiToggleButton);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\nimport '@zywave/zui-colors';\nimport '@zywave/zui-icons';\n/**\n * ## Installation\n * ### With npm:\n * ```shell\n * > npm i--save @zywave/zui-well\n * ```\n * ### With yarn:\n * ```shell\n * > yarn add @zywave/zui-well\n * ```\n *\n * ## Basic Usage\n * ```html\n * <zui-well type=\"info\">\n *    <div>\n *      Employees must sign their own enrollment forms.\n *    </div>\n *    <zui-well-actions>\n *      <button>Remind employees</button>\n *    </zui-well-actions>\n *  </zui-well>\n * ```\n *\n * zui-well is a grouping of an icon, text, and a background color to emphasize text\n */\n\nclass ZuiWell extends ZuiBaseElement {\n  static get properties() {\n    return {\n      /**\n       * The type of well you want to display. Defaults to 'info'.\n       * The types of zui-well include: 'info', 'warning', 'error'\n       *\n       */\n      type: {\n        type: String,\n        reflect: true\n      },\n\n      /**\n       * Whether or not you want to display an icon in your well\n       */\n      noIcon: {\n        type: Boolean,\n        attribute: 'no-icon'\n      }\n    };\n  }\n\n  connectedCallback() {\n    super.connectedCallback(); // TODO(pat) investigate if this is the right place to set \"reflect\" attributes. Seems weird.\n\n    if (!this.type) {\n      this.type = 'info';\n    }\n  }\n\n  _renderStyle() {\n    return html`\n      <style>\n        :host{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%;max-width:500px;padding:0;max-height:0;opacity:0;color:var(--zui-gray-700);-webkit-animation-name:well--slide-down;animation-name:well--slide-down;-webkit-animation-duration:200ms;animation-duration:200ms;-webkit-animation-delay:0.8s;animation-delay:0.8s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host([no-icon]) .icon{display:none}:host([type='info']){background-color:var(--zui-light-blue-50);--zui-well-action-color: var(--zui-light-blue-500);--zui-well-action-hover-color: var(--zui-light-blue-600)}:host([type='info']) zui-icon{color:var(--zui-light-blue-500)}:host([type='warning']){background-color:var(--zui-tangerine-50);--zui-well-action-color: var(--zui-tangerine-500);--zui-well-action-hover-color: var(--zui-tangerine-600)}:host([type='warning']) zui-icon{color:var(--zui-tangerine-500)}:host([type='error']){background-color:var(--zui-red-50);--zui-well-action-color: var(--zui-red-500);--zui-well-action-hover-color: var(--zui-red-600)}:host([type='error']) zui-icon{color:var(--zui-red-500)}.icon{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;vertical-align:top;padding:0;margin:0;height:22px;width:22px;margin-right:15px;opacity:0;-webkit-animation-name:well-icon--grow;animation-name:well-icon--grow;-webkit-animation-duration:200ms;animation-duration:200ms;-webkit-animation-delay:1.2s;animation-delay:1.2s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.icon zui-icon{--iron-icon-height: 22px;--iron-icon-width: 22px}.text{display:inline-block;vertical-align:top;line-height:1.6;-webkit-box-flex:1;-ms-flex:1;flex:1;opacity:0;-webkit-animation-name:well-text--slide-down;animation-name:well-text--slide-down;-webkit-animation-duration:200ms;animation-duration:200ms;-webkit-animation-delay:1s;animation-delay:1s;-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@media all and (-ms-high-contrast: none){.text{opacity:1}}@-webkit-keyframes well-icon--grow{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes well-icon--grow{0%{opacity:0;-webkit-transform:scale(0);transform:scale(0)}100%{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes well-text--slide-down{0%{opacity:0;max-height:0}100%{max-height:100%;opacity:1}}@keyframes well-text--slide-down{0%{opacity:0;max-height:0}100%{max-height:100%;opacity:1}}@-webkit-keyframes well--slide-down{0%{opacity:0;max-height:0;margin:0}100%{max-height:100%;padding:15px;margin:20px 0;opacity:1}}@keyframes well--slide-down{0%{opacity:0;max-height:0;margin:0}100%{max-height:100%;padding:15px;margin:20px 0;opacity:1}}\n      </style>\n    `;\n  }\n\n  render() {\n    return html`\n      ${this._renderStyle()}\n      <div class=\"icon\"> <zui-icon icon=\"${this._computeIcon(this.type)}\" class=\"icon-size\"></zui-icon> </div>\n      <div class=\"text\"> <slot></slot> </div>\n    `;\n  }\n  /**\n   *\n   * @param {string} type Computes the _icon property. This determines which zui-icon this well will use.\n   */\n\n\n  _computeIcon(type) {\n    const prefix = 'zui';\n    let icon = undefined;\n\n    switch (type) {\n      case 'info':\n        icon = 'info';\n        break;\n\n      case 'warning':\n        icon = 'alert-circle';\n        break;\n\n      case 'error':\n        icon = 'alert-circle';\n        break;\n\n      default:\n        icon = 'info';\n        break;\n    }\n\n    return `${prefix}-${icon}`;\n  }\n\n}\n\ncustomElements.define('zui-well', ZuiWell);","import { ZuiBaseElement } from '@zywave/zui-base';\nimport { html } from 'lit-html';\n\nclass ZuiWellAction extends ZuiBaseElement {\n  _renderStyle() {\n    return html`\n      <style>\n        :host{--zui-button-color: var(--zui-well-action-color);--zui-button-hover-color: var(--zui-well-action-hover-color);color:var(--zui-button-color);font-weight:700;text-decoration:none;text-transform:uppercase;background:transparent;border:0;padding:0;margin:30px 0 0 0;cursor:pointer}:host ::slotted(*){color:var(--zui-button-color);font-weight:700;text-decoration:none;text-transform:uppercase;background:transparent;border:0;padding:0;margin:30px 0 0 0}:host ::slotted(:hover){color:var(--zui-button-hover-color);cursor:pointer}\n      </style>\n    `;\n  }\n\n  render() {\n    return html`\n      ${this._renderStyle()} <slot></slot>\n    `;\n  }\n\n}\n\ncustomElements.define('zui-well-action', ZuiWellAction);"],"sourceRoot":""}