diff --git a/webcomponents-hi-sd-ce.js b/webcomponents-hi-sd-ce.js index d11db6031..fef20d7b4 100644 --- a/webcomponents-hi-sd-ce.js +++ b/webcomponents-hi-sd-ce.js @@ -29,60 +29,60 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ -'use strict';var gb="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this; -(function(){function k(){var a=this;this.m={};this.g=document.documentElement;var b=new pa;b.rules=[];this.h=v.set(this.g,new v(b));this.i=!1;this.a=this.b=null;hb(function(){a.c()})}function D(){this.customStyles=[];this.enqueued=!1}function ib(){}function ba(a){this.cache={};this.f=void 0===a?100:a}function n(){}function v(a,b,c,d,e){this.G=a||null;this.b=b||null;this.sa=c||[];this.N=null;this.W=e||"";this.a=this.C=this.H=null}function r(){}function pa(){this.end=this.start=0;this.rules=this.parent= -this.previous=null;this.cssText=this.parsedCssText="";this.atRule=!1;this.type=0;this.parsedSelector=this.selector=this.keyframesName=""}function Kc(a){function b(b,c){Object.defineProperty(b,"innerHTML",{enumerable:c.enumerable,configurable:!0,get:c.get,set:function(b){var d=this,e=void 0;m(this)&&(e=[],K(this,function(a){a!==d&&e.push(a)}));c.set.call(this,b);if(e)for(var f=0;f":return">";case '"':return""";case "\u00a0":return" "}}function Db(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:h=h.data;h=l&&fd[l.localName]?h:h.replace(gd,Cb);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),Error("not implemented");}}c+=h}return c}function L(a){x.currentNode=a;return x.parentNode()}function ya(a){x.currentNode= -a;return x.firstChild()}function za(a){x.currentNode=a;return x.lastChild()}function Eb(a){x.currentNode=a;return x.previousSibling()}function Fb(a){x.currentNode=a;return x.nextSibling()}function W(a){var b=[];x.currentNode=a;for(a=x.firstChild();a;)b.push(a),a=x.nextSibling();return b}function Gb(a){B.currentNode=a;return B.parentNode()}function Hb(a){B.currentNode=a;return B.firstChild()}function Ib(a){B.currentNode=a;return B.lastChild()}function Jb(a){B.currentNode=a;return B.previousSibling()} -function Kb(a){B.currentNode=a;return B.nextSibling()}function Lb(a){var b=[];B.currentNode=a;for(a=B.firstChild();a;)b.push(a),a=B.nextSibling();return b}function Mb(a){return Ga(a,function(a){return W(a)})}function Nb(a){if(a.nodeType!==Node.ELEMENT_NODE)return a.nodeValue;a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b}function I(a,b,c){for(var d in b){var e=Object.getOwnPropertyDescriptor(a,d);e&&e.configurable||!e&&c?Object.defineProperty(a, -d,b[d]):c&&console.warn("Could not define",d,"on",a)}}function M(a){I(a,Ob);I(a,Ha);I(a,Ia)}function Pb(a,b,c){yb(a);c=c||null;a.__shady=a.__shady||{};b.__shady=b.__shady||{};c&&(c.__shady=c.__shady||{});a.__shady.previousSibling=c?c.__shady.previousSibling:b.lastChild;var d=a.__shady.previousSibling;d&&d.__shady&&(d.__shady.nextSibling=a);(d=a.__shady.nextSibling=c)&&d.__shady&&(d.__shady.previousSibling=a);a.__shady.parentNode=b;c?c===b.__shady.firstChild&&(b.__shady.firstChild=a):(b.__shady.lastChild= -a,b.__shady.firstChild||(b.__shady.firstChild=a));b.__shady.childNodes=null}function Qb(a){var b=a.__shady&&a.__shady.parentNode,c,d=R(a);if(b||d){c=Rb(a);if(b){a.__shady=a.__shady||{};b.__shady=b.__shady||{};a===b.__shady.firstChild&&(b.__shady.firstChild=a.__shady.nextSibling);a===b.__shady.lastChild&&(b.__shady.lastChild=a.__shady.previousSibling);var e=a.__shady.previousSibling,f=a.__shady.nextSibling;e&&(e.__shady=e.__shady||{},e.__shady.nextSibling=f);f&&(f.__shady=f.__shady||{},f.__shady.previousSibling= -e);a.__shady.parentNode=a.__shady.previousSibling=a.__shady.nextSibling=void 0;void 0!==b.__shady.childNodes&&(b.__shady.childNodes=null)}if(e=d){for(var g,e=d.na(),f=0;f":return">";case '"':return""";case "\u00a0":return" "}}function Eb(a){for(var b={},c=0;c";break a;case Node.TEXT_NODE:h=h.data;h=l&&gd[l.localName]?h:h.replace(hd,Db);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),Error("not implemented");}}c+=h}return c}function L(a){x.currentNode=a;return x.parentNode()}function za(a){x.currentNode= +a;return x.firstChild()}function Aa(a){x.currentNode=a;return x.lastChild()}function Fb(a){x.currentNode=a;return x.previousSibling()}function Gb(a){x.currentNode=a;return x.nextSibling()}function W(a){var b=[];x.currentNode=a;for(a=x.firstChild();a;)b.push(a),a=x.nextSibling();return b}function Hb(a){B.currentNode=a;return B.parentNode()}function Ib(a){B.currentNode=a;return B.firstChild()}function Jb(a){B.currentNode=a;return B.lastChild()}function Kb(a){B.currentNode=a;return B.previousSibling()} +function Lb(a){B.currentNode=a;return B.nextSibling()}function Mb(a){var b=[];B.currentNode=a;for(a=B.firstChild();a;)b.push(a),a=B.nextSibling();return b}function Nb(a){return Ga(a,function(a){return W(a)})}function Ob(a){if(a.nodeType!==Node.ELEMENT_NODE)return a.nodeValue;a=document.createTreeWalker(a,NodeFilter.SHOW_TEXT,null,!1);for(var b="",c;c=a.nextNode();)b+=c.nodeValue;return b}function I(a,b,c){for(var d in b){var e=Object.getOwnPropertyDescriptor(a,d);e&&e.configurable||!e&&c?Object.defineProperty(a, +d,b[d]):c&&console.warn("Could not define",d,"on",a)}}function M(a){I(a,Pb);I(a,Ha);I(a,Ia)}function Qb(a,b,c){zb(a);c=c||null;a.__shady=a.__shady||{};b.__shady=b.__shady||{};c&&(c.__shady=c.__shady||{});a.__shady.previousSibling=c?c.__shady.previousSibling:b.lastChild;var d=a.__shady.previousSibling;d&&d.__shady&&(d.__shady.nextSibling=a);(d=a.__shady.nextSibling=c)&&d.__shady&&(d.__shady.previousSibling=a);a.__shady.parentNode=b;c?c===b.__shady.firstChild&&(b.__shady.firstChild=a):(b.__shady.lastChild= +a,b.__shady.firstChild||(b.__shady.firstChild=a));b.__shady.childNodes=null}function Rb(a){var b=a.__shady&&a.__shady.parentNode,c,d=R(a);if(b||d){c=Sb(a);if(b){a.__shady=a.__shady||{};b.__shady=b.__shady||{};a===b.__shady.firstChild&&(b.__shady.firstChild=a.__shady.nextSibling);a===b.__shady.lastChild&&(b.__shady.lastChild=a.__shady.previousSibling);var e=a.__shady.previousSibling,f=a.__shady.nextSibling;e&&(e.__shady=e.__shady||{},e.__shady.nextSibling=f);f&&(f.__shady=f.__shady||{},f.__shady.previousSibling= +e);a.__shady.parentNode=a.__shady.previousSibling=a.__shady.nextSibling=void 0;void 0!==b.__shady.childNodes&&(b.__shady.childNodes=null)}if(e=d){for(var g,e=d.na(),f=0;f]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,p={eb:function(a,b){a.href&&a.setAttribute("href",p.ua(a.getAttribute("href"),b));a.src&&a.setAttribute("src",p.ua(a.getAttribute("src"),b));if("style"===a.localName){var c=p.Ka(a.textContent,b,q);a.textContent=p.Ka(c,b,r)}},Ka:function(a,b,c){return a.replace(c,function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=p.La(a,b));return c+"'"+a+"'"+e})},ua:function(a,b){return a&&n.test(a)?a:p.La(a, -b)},La:function(a,b){if(void 0===p.la){p.la=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";p.la="http://a/c%20d"===c.href}catch(Sd){}}if(p.la)return(new URL(a,b)).href;c=p.Wa;c||(c=document.implementation.createHTMLDocument("temp"),p.Wa=c,c.xa=c.createElement("base"),c.head.appendChild(c.xa),c.wa=c.createElement("a"));c.xa.href=b;c.wa.href=a;return c.wa.href||a}},u={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a=a.split(",");var d=a[1],d=-1e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},w=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent);l.prototype.c=function(a){a=a.querySelectorAll("link[rel=import]");for(var b= 0,c=a.length;b]/g,ed=Db("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),fd=Db("style script xmp iframe noembed noframes plaintext noscript".split(" ")),x=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),B=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),wd=Object.freeze({parentNode:L,firstChild:ya,lastChild:za,previousSibling:Eb, -nextSibling:Fb,childNodes:W,parentElement:Gb,firstElementChild:Hb,lastElementChild:Ib,previousElementSibling:Jb,nextElementSibling:Kb,children:Lb,innerHTML:Mb,textContent:Nb}),Za=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML")||Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML"),ka=document.implementation.createHTMLDocument("inert").createElement("div"),$a=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"),Ob={parentElement:{get:function(){var a=this.__shady&& -this.__shady.parentElement;return void 0!==a?a:Gb(this)},configurable:!0},parentNode:{get:function(){var a=this.__shady&&this.__shady.parentNode;return void 0!==a?a:L(this)},configurable:!0},nextSibling:{get:function(){var a=this.__shady&&this.__shady.nextSibling;return void 0!==a?a:Fb(this)},configurable:!0},previousSibling:{get:function(){var a=this.__shady&&this.__shady.previousSibling;return void 0!==a?a:Eb(this)},configurable:!0},className:{get:function(){return this.getAttribute("class")||""}, -set:function(a){this.setAttribute("class",a)},configurable:!0},nextElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.nextSibling){for(var a=this.nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return Kb(this)},configurable:!0},previousElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.previousSibling){for(var a=this.previousSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Jb(this)},configurable:!0}},Ha={childNodes:{get:function(){if(this.__shady&& -void 0!==this.__shady.firstChild){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var a=this.firstChild;a;a=a.nextSibling)this.__shady.childNodes.push(a)}return this.__shady.childNodes}return W(this)},configurable:!0},firstChild:{get:function(){var a=this.__shady&&this.__shady.firstChild;return void 0!==a?a:ya(this)},configurable:!0},lastChild:{get:function(){var a=this.__shady&&this.__shady.lastChild;return void 0!==a?a:za(this)},configurable:!0},textContent:{get:function(){if(this.__shady&& -void 0!==this.__shady.firstChild){for(var a=[],b=0,c=this.childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.textContent);return a.join("")}return Nb(this)},set:function(a){if(this.nodeType!==Node.ELEMENT_NODE)this.nodeValue=a;else{for(;this.firstChild;)this.removeChild(this.firstChild);a&&this.appendChild(document.createTextNode(a))}},configurable:!0},firstElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.firstChild){for(var a=this.firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a= -a.nextSibling;return a}return Hb(this)},configurable:!0},lastElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.lastChild){for(var a=this.lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Ib(this)},configurable:!0},children:{get:function(){return this.__shady&&void 0!==this.__shady.firstChild?Array.prototype.filter.call(this.childNodes,function(a){return a.nodeType===Node.ELEMENT_NODE}):Lb(this)},configurable:!0},innerHTML:{get:function(){var a="template"=== -this.localName?this.content:this;return this.__shady&&void 0!==this.__shady.firstChild?Ga(a):Mb(a)},set:function(a){for(var b="template"===this.localName?this.content:this;b.firstChild;)b.removeChild(b.firstChild);for(Za&&Za.set?Za.set.call(ka,a):ka.innerHTML=a;ka.firstChild;)b.appendChild(ka.firstChild)},configurable:!0}},yc={shadowRoot:{get:function(){return this.__shady&&this.__shady.root||null},set:function(a){this.__shady=this.__shady||{};this.__shady.root=a},configurable:!0}},Ia={activeElement:{get:function(){var a; -a=$a&&$a.get?$a.get.call(document):C.T?void 0:document.activeElement;if(a&&a.nodeType){var b=!!E(this);if(this===document||b&&this.host!==a&&this.host.contains(a)){for(b=R(a);b&&b!==this;)a=b.host,b=R(a);a=this===document?b?null:a:b===this?a:null}else a=null}else a=null;return a},set:function(){},configurable:!0}},yb=C.T?function(){}:function(a){a.__shady&&a.__shady.Va||(a.__shady=a.__shady||{},a.__shady.Va=!0,I(a,Ob,!0))},xb=C.T?function(){}:function(a){a.__shady&&a.__shady.Ta||(a.__shady=a.__shady|| -{},a.__shady.Ta=!0,I(a,Ha,!0),I(a,yc,!0))},la=null,xd={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0, -lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},ec={get composed(){!1!==this.isTrusted&&void 0===this.ia&&(this.ia=xd[this.type]);return this.ia||!1},composedPath:function(){this.ya||(this.ya=Oa(this.__target,this.composed));return this.ya},get target(){return ac(this.currentTarget,this.composedPath())},get relatedTarget(){if(!this.za)return null;this.Aa||(this.Aa=Oa(this.za,!0));return ac(this.currentTarget, -this.Aa)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.ja=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.ja=this.Sa=!0}},Qa={focus:!0,blur:!0},yd=Pa(window.Event),zd=Pa(window.CustomEvent),Ad=Pa(window.MouseEvent),Bd="function"===typeof Event?Event:function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};z.prototype.fb=function(){return this.root.querySelectorAll("slot")}; -z.prototype.ra=function(a){return a.localName&&"slot"==a.localName};z.prototype.pa=function(){return this.root.qa()?this.g(this.c()):[]};z.prototype.c=function(){for(var a=[],b=0,c=this.root.host.firstChild;c;c=c.nextSibling)a[b++]=c;return a};z.prototype.g=function(a){for(var b=[],c=this.root.na(),d=0,e=c.length,f;d "+ -b})));a=a.replace(Nd,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,bb:b,stop:f}};r.prototype.m=function(a,b){a=a.split(Cc);a[0]+=b;return a.join(Cc)};r.prototype.O=function(a,b){var c=a.match(Dc);return(c=c&&c[2].trim()||"")?c[0].match(Ec)?a.replace(Dc,function(a,c,f){return b+f}):c.split(Ec)[0]===b?c:Od:a.replace(ab,b)};r.prototype.R=function(a){a.selector=a.parsedSelector;this.o(a);this.j(a,this.J)};r.prototype.o=function(a){a.selector===Pd&&(a.selector="html")}; -r.prototype.J=function(a){return a.match(bb)?this.g(a,Fc):this.m(a.trim(),Fc)};gb.Object.defineProperties(r.prototype,{c:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});var Jd=/:(nth[-\w]+)\(([^)]+)\)/,Fc=":not(.style-scope)",Bc=",",Ld=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Ec=/[[.:#*]/,ab=":host",Pd=":root",bb="::slotted",Kd=new RegExp("^("+bb+")"),Dc=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Md=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Nd=/(.*):dir\((?:(ltr|rtl))\)/, -Id=".",Cc=":",Hd="class",Od="should_not_match",u=new r;v.get=function(a){return a?a.__styleInfo:null};v.set=function(a,b){return a.__styleInfo=b};v.prototype.c=function(){return this.G};v.prototype._getStyleRules=v.prototype.c;var Gc=function(a){return a.matches||a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}(window.Element.prototype),Qd=navigator.userAgent.match("Trident");n.prototype.S=function(a){var b=this,c={},d=[],e=0;U(a,function(a){b.c(a); -a.index=e++;b.R(a.s.cssText,c)},function(a){d.push(a)});a.b=d;a=[];for(var f in c)a.push(f);return a};n.prototype.c=function(a){if(!a.s){var b={},c={};this.b(a,c)&&(b.F=c,a.rules=null);b.cssText=this.P(a);a.s=b}};n.prototype.b=function(a,b){var c=a.s;if(c){if(c.F)return Object.assign(b,c.F),!0}else{for(var c=a.parsedCssText,d;a=zc.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}};n.prototype.P=function(a){return this.O(a.parsedCssText)};n.prototype.O=function(a){return a.replace(Gd, -"").replace(zc,"")};n.prototype.R=function(a,b){for(var c;c=Ed.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}};n.prototype.ea=function(a){for(var b=Object.getOwnPropertyNames(a),c=0,d;c *"=== -f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===c&&(g=f===e+" > *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));"shadow"===c&&(g=":host > *"===f||"html"===f,h=h&&!g);if(g||h)c=e,h&&(p&&!b.B&&(b.B=u.l(b,u.g,u.h(a),e)),c=b.B||e),d({ob:c,ib:h,vb:g})}};n.prototype.ca=function(a,b){var c={},d={},e=this,f=b&&b.__cssBuild;U(b,function(b){e.ga(a,b,f,function(f){Gc.call(a.ub||a,f.ob)&&(f.ib?e.b(b,c):e.b(b,d))})},null,!0);return{mb:d,hb:c}};n.prototype.fa=function(a,b,c){var d=this,e=P(a),f=u.f(e.is, -e.W),g=new RegExp("(?:^|[^.#[:])"+(a.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),e=v.get(a).G,h=this.h(e,c);return u.b(a,e,function(a){d.J(a,b);p||nc(a)||!a.cssText||(d.I(a,h),d.l(a,g,f,c))})};n.prototype.h=function(a,b){a=a.b;var c={};if(!p&&a)for(var d=0,e=a[d];d=f._useCount&&f.parentNode&&f.parentNode.removeChild(f));p?e.a?(e.a.textContent=b,d=e.a):b&&(d=Ua(b,c,a.shadowRoot,e.b)):d?d.parentNode||(Qd&&-1this.f&&e.shift();this.cache[a]=e};ba.prototype.a=function(a,b,c){if(a=this.cache[a])for(var d=a.length-1;0<=d;d--){var e=a[d];if(this.b(e,b,c))return e}};if(!p){var Hc=new MutationObserver(qc),Ic=function(a){Hc.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)Ic(document);else{var db=function(){Ic(document.body)};window.HTMLImports?window.HTMLImports.whenReady(db): -requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){db();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else db()})}ib=function(){qc(Hc.takeRecords())}}var ja={},ud=Promise.resolve(),Va=null,sc=window.HTMLImports&&window.HTMLImports.whenReady||null,Wa,oa=null,aa=null;D.prototype.Da=function(){!this.enqueued&&aa&&(this.enqueued=!0,hb(aa))};D.prototype.b=function(a){a.__seenByShadyCSS||(a.__seenByShadyCSS=!0,this.customStyles.push(a), -this.Da())};D.prototype.a=function(a){return a.__shadyCSSCachedStyle?a.__shadyCSSCachedStyle:a.getStyle?a.getStyle():a};D.prototype.c=function(){for(var a=this.customStyles,b=0;b]/g,fd=Eb("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),gd=Eb("style script xmp iframe noembed noframes plaintext noscript".split(" ")),x=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),B=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),xd=Object.freeze({parentNode:L, +firstChild:za,lastChild:Aa,previousSibling:Fb,nextSibling:Gb,childNodes:W,parentElement:Hb,firstElementChild:Ib,lastElementChild:Jb,previousElementSibling:Kb,nextElementSibling:Lb,children:Mb,innerHTML:Nb,textContent:Ob}),$a=Object.getOwnPropertyDescriptor(Element.prototype,"innerHTML")||Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML"),la=document.implementation.createHTMLDocument("inert").createElement("div"),ab=Object.getOwnPropertyDescriptor(Document.prototype,"activeElement"), +Pb={parentElement:{get:function(){var a=this.__shady&&this.__shady.parentNode;a&&a.nodeType!==Node.ELEMENT_NODE&&(a=null);return void 0!==a?a:Hb(this)},configurable:!0},parentNode:{get:function(){var a=this.__shady&&this.__shady.parentNode;return void 0!==a?a:L(this)},configurable:!0},nextSibling:{get:function(){var a=this.__shady&&this.__shady.nextSibling;return void 0!==a?a:Gb(this)},configurable:!0},previousSibling:{get:function(){var a=this.__shady&&this.__shady.previousSibling;return void 0!== +a?a:Fb(this)},configurable:!0},className:{get:function(){return this.getAttribute("class")||""},set:function(a){this.setAttribute("class",a)},configurable:!0},nextElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.nextSibling){for(var a=this.nextSibling;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return Lb(this)},configurable:!0},previousElementSibling:{get:function(){if(this.__shady&&void 0!==this.__shady.previousSibling){for(var a=this.previousSibling;a&&a.nodeType!== +Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Kb(this)},configurable:!0}},Ha={childNodes:{get:function(){var a;if(this.__shady&&void 0!==this.__shady.firstChild){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var b=this.firstChild;b;b=b.nextSibling)this.__shady.childNodes.push(b)}a=this.__shady.childNodes}else a=W(this);a.item=function(b){return a[b]};return a},configurable:!0},childElementCount:{get:function(){return this.children.length},configurable:!0},firstChild:{get:function(){var a= +this.__shady&&this.__shady.firstChild;return void 0!==a?a:za(this)},configurable:!0},lastChild:{get:function(){var a=this.__shady&&this.__shady.lastChild;return void 0!==a?a:Aa(this)},configurable:!0},textContent:{get:function(){if(this.__shady&&void 0!==this.__shady.firstChild){for(var a=[],b=0,c=this.childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.textContent);return a.join("")}return Ob(this)},set:function(a){if(this.nodeType!==Node.ELEMENT_NODE)this.nodeValue=a;else{for(;this.firstChild;)this.removeChild(this.firstChild); +this.appendChild(document.createTextNode(a))}},configurable:!0},firstElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.firstChild){for(var a=this.firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.nextSibling;return a}return Ib(this)},configurable:!0},lastElementChild:{get:function(){if(this.__shady&&void 0!==this.__shady.lastChild){for(var a=this.lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.previousSibling;return a}return Jb(this)},configurable:!0},children:{get:function(){var a; +this.__shady&&void 0!==this.__shady.firstChild?a=Array.prototype.filter.call(this.childNodes,function(a){return a.nodeType===Node.ELEMENT_NODE}):a=Mb(this);a.item=function(b){return a[b]};return a},configurable:!0},innerHTML:{get:function(){var a="template"===this.localName?this.content:this;return this.__shady&&void 0!==this.__shady.firstChild?Ga(a):Nb(a)},set:function(a){for(var b="template"===this.localName?this.content:this;b.firstChild;)b.removeChild(b.firstChild);for($a&&$a.set?$a.set.call(la, +a):la.innerHTML=a;la.firstChild;)b.appendChild(la.firstChild)},configurable:!0}},zc={shadowRoot:{get:function(){return this.__shady&&this.__shady.root||null},set:function(a){this.__shady=this.__shady||{};this.__shady.root=a},configurable:!0}},Ia={activeElement:{get:function(){var a;a=ab&&ab.get?ab.get.call(document):C.T?void 0:document.activeElement;if(a&&a.nodeType){var b=!!E(this);if(this===document||b&&this.host!==a&&this.host.contains(a)){for(b=R(a);b&&b!==this;)a=b.host,b=R(a);a=this===document? +b?null:a:b===this?a:null}else a=null}else a=null;return a},set:function(){},configurable:!0}},zb=C.T?function(){}:function(a){a.__shady&&a.__shady.Va||(a.__shady=a.__shady||{},a.__shady.Va=!0,I(a,Pb,!0))},yb=C.T?function(){}:function(a){a.__shady&&a.__shady.Ta||(a.__shady=a.__shady||{},a.__shady.Ta=!0,I(a,Ha,!0),I(a,zc,!0))},ma=null,yd={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0, +input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},fc={get composed(){!1!==this.isTrusted&&void 0===this.ia&&(this.ia= +yd[this.type]);return this.ia||!1},composedPath:function(){this.ya||(this.ya=Oa(this.__target,this.composed));return this.ya},get target(){return bc(this.currentTarget,this.composedPath())},get relatedTarget(){if(!this.za)return null;this.Aa||(this.Aa=Oa(this.za,!0));return bc(this.currentTarget,this.Aa)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.ja=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.ja=this.Sa=!0}},Qa= +{focus:!0,blur:!0},zd=Pa(window.Event),Ad=Pa(window.CustomEvent),Bd=Pa(window.MouseEvent),Cd="function"===typeof Event?Event:function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};z.prototype.fb=function(){return this.root.querySelectorAll("slot")};z.prototype.ra=function(a){return a.localName&&"slot"==a.localName};z.prototype.pa=function(){return this.root.qa()?this.g(this.c()):[]};z.prototype.c=function(){for(var a=[],b=0,c=this.root.host.firstChild;c;c= +c.nextSibling)a[b++]=c;return a};z.prototype.g=function(a){for(var b=[],c=this.root.na(),d=0,e=c.length,f;d "+b})));a=a.replace(Od,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,bb:b,stop:f}};r.prototype.m=function(a,b){a=a.split(Dc);a[0]+=b;return a.join(Dc)};r.prototype.O=function(a,b){var c=a.match(Ec);return(c=c&&c[2].trim()||"")?c[0].match(Fc)?a.replace(Ec,function(a,c,f){return b+f}):c.split(Fc)[0]===b?c:Pd:a.replace(bb,b)};r.prototype.R=function(a){a.selector=a.parsedSelector;this.o(a);this.j(a,this.J)}; +r.prototype.o=function(a){a.selector===Qd&&(a.selector="html")};r.prototype.J=function(a){return a.match(cb)?this.g(a,Gc):this.m(a.trim(),Gc)};hb.Object.defineProperties(r.prototype,{c:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}});var Kd=/:(nth[-\w]+)\(([^)]+)\)/,Gc=":not(.style-scope)",Cc=",",Md=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Fc=/[[.:#*]/,bb=":host",Qd=":root",cb="::slotted",Ld=new RegExp("^("+cb+")"),Ec=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Nd=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/, +Od=/(.*):dir\((?:(ltr|rtl))\)/,Jd=".",Dc=":",Id="class",Pd="should_not_match",u=new r;v.get=function(a){return a?a.__styleInfo:null};v.set=function(a,b){return a.__styleInfo=b};v.prototype.c=function(){return this.G};v.prototype._getStyleRules=v.prototype.c;var Hc=function(a){return a.matches||a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}(window.Element.prototype),Rd=navigator.userAgent.match("Trident");q.prototype.S=function(a){var b=this, +c={},d=[],e=0;U(a,function(a){b.c(a);a.index=e++;b.R(a.s.cssText,c)},function(a){d.push(a)});a.b=d;a=[];for(var f in c)a.push(f);return a};q.prototype.c=function(a){if(!a.s){var b={},c={};this.b(a,c)&&(b.F=c,a.rules=null);b.cssText=this.P(a);a.s=b}};q.prototype.b=function(a,b){var c=a.s;if(c){if(c.F)return Object.assign(b,c.F),!0}else{for(var c=a.parsedCssText,d;a=Ac.exec(c);){d=(a[2]||a[3]).trim();if("inherit"!==d||"unset"!==d)b[a[1].trim()]=d;d=!0}return d}};q.prototype.P=function(a){return this.O(a.parsedCssText)}; +q.prototype.O=function(a){return a.replace(Hd,"").replace(Ac,"")};q.prototype.R=function(a,b){for(var c;c=Fd.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}};q.prototype.ea=function(a){for(var b=Object.getOwnPropertyNames(a),c=0,d;c *"===f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===c&&(g=f===e+" > *."+e||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(e));"shadow"===c&&(g=":host > *"===f||"html"===f,h=h&&!g);if(g||h)c=e,h&&(p&&!b.B&&(b.B=u.l(b,u.g,u.h(a),e)),c=b.B||e),d({ob:c,ib:h,vb:g})}};q.prototype.ca=function(a,b){var c={},d={},e=this,f=b&&b.__cssBuild;U(b,function(b){e.ga(a,b,f,function(f){Hc.call(a.ub||a,f.ob)&&(f.ib?e.b(b,c):e.b(b,d))})},null,!0);return{mb:d,hb:c}};q.prototype.fa= +function(a,b,c){var d=this,e=P(a),f=u.f(e.is,e.W),g=new RegExp("(?:^|[^.#[:])"+(a.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])"),e=v.get(a).G,h=this.h(e,c);return u.b(a,e,function(a){d.J(a,b);p||oc(a)||!a.cssText||(d.I(a,h),d.l(a,g,f,c))})};q.prototype.h=function(a,b){a=a.b;var c={};if(!p&&a)for(var d=0,e=a[d];d=f._useCount&&f.parentNode&&f.parentNode.removeChild(f));p?e.a?(e.a.textContent=b,d=e.a):b&&(d=Ua(b,c,a.shadowRoot,e.b)):d?d.parentNode||(Rd&&-1this.f&&e.shift();this.cache[a]=e};ba.prototype.a=function(a,b,c){if(a=this.cache[a])for(var d=a.length-1;0<=d;d--){var e=a[d];if(this.b(e,b,c))return e}};if(!p){var Ic=new MutationObserver(rc),Jc=function(a){Ic.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)Jc(document);else{var eb=function(){Jc(document.body)}; +window.HTMLImports?window.HTMLImports.whenReady(eb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){eb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else eb()})}jb=function(){rc(Ic.takeRecords())}}var ka={},vd=Promise.resolve(),Va=null,tc=window.HTMLImports&&window.HTMLImports.whenReady||null,Wa,pa=null,aa=null;D.prototype.Da=function(){!this.enqueued&&aa&&(this.enqueued=!0,ib(aa))};D.prototype.b=function(a){a.__seenByShadyCSS|| +(a.__seenByShadyCSS=!0,this.customStyles.push(a),this.Da())};D.prototype.a=function(a){return a.__shadyCSSCachedStyle?a.__shadyCSSCachedStyle:a.getStyle?a.getStyle():a};D.prototype.c=function(){for(var a=this.customStyles,b=0;b {\n this._ensure();\n });\n }\n flush() {\n watcherFlush();\n }\n _generateScopeSelector(name) {\n let id = this._scopeCounter[name] = (this._scopeCounter[name] || 0) + 1;\n return `${name}-${id}`;\n }\n getStyleAst(style) {\n return StyleUtil.rulesForStyle(style);\n }\n styleAstToString(ast) {\n return StyleUtil.toCssText(ast);\n }\n _gatherStyles(template) {\n let styles = template.content.querySelectorAll('style');\n let cssText = [];\n for (let i = 0; i < styles.length; i++) {\n let s = styles[i];\n cssText.push(s.textContent);\n s.parentNode.removeChild(s);\n }\n return cssText.join('').trim();\n }\n _getCssBuild(template) {\n let style = template.content.querySelector('style');\n if (!style) {\n return '';\n }\n return style.getAttribute('css-build') || '';\n }\n /**\n * Prepare the styling and template for the given element type\n *\n * @param {HTMLTemplateElement} template\n * @param {string} elementName\n * @param {string=} typeExtension\n */\n prepareTemplate(template, elementName, typeExtension) {\n if (template._prepared) {\n return;\n }\n template._prepared = true;\n template.name = elementName;\n template.extends = typeExtension;\n templateMap[elementName] = template;\n let cssBuild = this._getCssBuild(template);\n let cssText = this._gatherStyles(template);\n let info = {\n is: elementName,\n extends: typeExtension,\n __cssBuild: cssBuild,\n };\n if (!nativeShadow) {\n StyleTransformer.dom(template.content, elementName);\n }\n // check if the styling has mixin definitions or uses\n this._ensure();\n let hasMixins = this._applyShim['detectMixin'](cssText);\n let ast = parse(cssText);\n // only run the applyshim transforms if there is a mixin involved\n if (hasMixins && nativeCssVariables) {\n this._applyShim['transformRules'](ast, elementName);\n }\n template['_styleAst'] = ast;\n template._cssBuild = cssBuild;\n\n let ownPropertyNames = [];\n if (!nativeCssVariables) {\n ownPropertyNames = StyleProperties.decorateStyles(template['_styleAst'], info);\n }\n if (!ownPropertyNames.length || nativeCssVariables) {\n let root = nativeShadow ? template.content : null;\n let placeholder = placeholderMap[elementName];\n let style = this._generateStaticStyle(info, template['_styleAst'], root, placeholder);\n template._style = style;\n }\n template._ownPropertyNames = ownPropertyNames;\n }\n _generateStaticStyle(info, rules, shadowroot, placeholder) {\n let cssText = StyleTransformer.elementStyles(info, rules);\n if (cssText.length) {\n return StyleUtil.applyCss(cssText, info.is, shadowroot, placeholder);\n }\n }\n _prepareHost(host) {\n let {is, typeExtension} = StyleUtil.getIsExtends(host);\n let placeholder = placeholderMap[is];\n let template = templateMap[is];\n let ast;\n let ownStylePropertyNames;\n let cssBuild;\n if (template) {\n ast = template['_styleAst'];\n ownStylePropertyNames = template._ownPropertyNames;\n cssBuild = template._cssBuild;\n }\n return StyleInfo.set(host,\n new StyleInfo(\n ast,\n placeholder,\n ownStylePropertyNames,\n is,\n typeExtension,\n cssBuild\n )\n );\n }\n _ensureApplyShim() {\n if (this._applyShim) {\n return;\n } else if (window.ShadyCSS && window.ShadyCSS.ApplyShim) {\n this._applyShim = window.ShadyCSS.ApplyShim;\n this._applyShim['invalidCallback'] = ApplyShimUtils.invalidate;\n } else {\n this._applyShim = {\n /* eslint-disable no-unused-vars */\n ['detectMixin'](str){return false},\n ['transformRule'](ast){},\n ['transformRules'](ast, name){},\n /* eslint-enable no-unused-vars */\n }\n }\n }\n _ensureCustomStyleInterface() {\n if (this._customStyleInterface) {\n return;\n } else if (window.ShadyCSS && window.ShadyCSS.CustomStyleInterface) {\n this._customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */(window.ShadyCSS.CustomStyleInterface);\n /** @type {function(!HTMLStyleElement)} */\n this._customStyleInterface['transformCallback'] = (style) => {this.transformCustomStyleForDocument(style)};\n this._customStyleInterface['validateCallback'] = () => {\n requestAnimationFrame(() => {\n if (this._customStyleInterface['enqueued'] || this._elementsHaveApplied) {\n this.flushCustomStyles();\n }\n })\n };\n } else {\n this._customStyleInterface = /** @type {!CustomStyleInterfaceInterface} */({\n ['processStyles']() {},\n ['enqueued']: false,\n ['getStyleForCustomStyle'](s) { return null } // eslint-disable-line no-unused-vars\n })\n }\n }\n _ensure() {\n this._ensureApplyShim();\n this._ensureCustomStyleInterface();\n }\n /**\n * Flush and apply custom styles to document\n */\n flushCustomStyles() {\n this._ensure();\n let customStyles = this._customStyleInterface['processStyles']();\n // early return if custom-styles don't need validation\n if (!this._customStyleInterface['enqueued']) {\n return;\n }\n if (!nativeCssVariables) {\n this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n this._applyCustomStyles(customStyles);\n } else {\n this._revalidateCustomStyleApplyShim(customStyles);\n }\n this._customStyleInterface['enqueued'] = false;\n // if custom elements have upgraded and there are no native css variables, we must recalculate the whole tree\n if (this._elementsHaveApplied && !nativeCssVariables) {\n this.styleDocument();\n }\n }\n /**\n * Apply styles for the given element\n *\n * @param {!HTMLElement} host\n * @param {Object=} overrideProps\n */\n styleElement(host, overrideProps) {\n let {is} = StyleUtil.getIsExtends(host);\n let styleInfo = StyleInfo.get(host);\n if (!styleInfo) {\n styleInfo = this._prepareHost(host);\n }\n // Only trip the `elementsHaveApplied` flag if a node other that the root document has `applyStyle` called\n if (!this._isRootOwner(host)) {\n this._elementsHaveApplied = true;\n }\n if (overrideProps) {\n styleInfo.overrideStyleProperties =\n styleInfo.overrideStyleProperties || {};\n Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n }\n if (!nativeCssVariables) {\n this._updateProperties(host, styleInfo);\n if (styleInfo.ownStylePropertyNames && styleInfo.ownStylePropertyNames.length) {\n this._applyStyleProperties(host, styleInfo);\n }\n } else {\n if (styleInfo.overrideStyleProperties) {\n updateNativeProperties(host, styleInfo.overrideStyleProperties);\n }\n let template = templateMap[is];\n // bail early if there is no shadowroot for this element\n if (!template && !this._isRootOwner(host)) {\n return;\n }\n if (template && template._style && !ApplyShimUtils.templateIsValid(template)) {\n // update template\n if (!ApplyShimUtils.templateIsValidating(template)) {\n this._ensure();\n this._applyShim['transformRules'](template['_styleAst'], is);\n template._style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n ApplyShimUtils.startValidatingTemplate(template);\n }\n // update instance if native shadowdom\n if (nativeShadow) {\n let root = host.shadowRoot;\n if (root) {\n let style = root.querySelector('style');\n style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n }\n }\n styleInfo.styleRules = template['_styleAst'];\n }\n }\n }\n _styleOwnerForNode(node) {\n let root = node.getRootNode();\n let host = root.host;\n if (host) {\n if (StyleInfo.get(host)) {\n return host;\n } else {\n return this._styleOwnerForNode(host);\n }\n }\n return this._documentOwner;\n }\n _isRootOwner(node) {\n return (node === this._documentOwner);\n }\n _applyStyleProperties(host, styleInfo) {\n let is = StyleUtil.getIsExtends(host).is;\n let cacheEntry = styleCache.fetch(is, styleInfo.styleProperties, styleInfo.ownStylePropertyNames);\n let cachedScopeSelector = cacheEntry && cacheEntry.scopeSelector;\n let cachedStyle = cacheEntry ? cacheEntry.styleElement : null;\n let oldScopeSelector = styleInfo.scopeSelector;\n // only generate new scope if cached style is not found\n styleInfo.scopeSelector = cachedScopeSelector || this._generateScopeSelector(is);\n let style = StyleProperties.applyElementStyle(host, styleInfo.styleProperties, styleInfo.scopeSelector, cachedStyle);\n if (!nativeShadow) {\n StyleProperties.applyElementScopeSelector(host, styleInfo.scopeSelector, oldScopeSelector);\n }\n if (!cacheEntry) {\n styleCache.store(is, styleInfo.styleProperties, style, styleInfo.scopeSelector);\n }\n return style;\n }\n _updateProperties(host, styleInfo) {\n let owner = this._styleOwnerForNode(host);\n let ownerStyleInfo = StyleInfo.get(owner);\n let ownerProperties = ownerStyleInfo.styleProperties;\n let props = Object.create(ownerProperties || null);\n let hostAndRootProps = StyleProperties.hostAndRootPropertiesForScope(host, styleInfo.styleRules);\n let propertyData = StyleProperties.propertyDataFromStyles(ownerStyleInfo.styleRules, host);\n let propertiesMatchingHost = propertyData.properties\n Object.assign(\n props,\n hostAndRootProps.hostProps,\n propertiesMatchingHost,\n hostAndRootProps.rootProps\n );\n this._mixinOverrideStyles(props, styleInfo.overrideStyleProperties);\n StyleProperties.reify(props);\n styleInfo.styleProperties = props;\n }\n _mixinOverrideStyles(props, overrides) {\n for (let p in overrides) {\n let v = overrides[p];\n // skip override props if they are not truthy or 0\n // in order to fall back to inherited values\n if (v || v === 0) {\n props[p] = v;\n }\n }\n }\n /**\n * Update styles of the whole document\n *\n * @param {Object=} properties\n */\n styleDocument(properties) {\n this.styleSubtree(this._documentOwner, properties);\n }\n /**\n * Update styles of a subtree\n *\n * @param {!HTMLElement} host\n * @param {Object=} properties\n */\n styleSubtree(host, properties) {\n let root = host.shadowRoot;\n if (root || this._isRootOwner(host)) {\n this.styleElement(host, properties);\n }\n // process the shadowdom children of `host`\n let shadowChildren = root && (root.children || root.childNodes);\n if (shadowChildren) {\n for (let i = 0; i < shadowChildren.length; i++) {\n let c = /** @type {!HTMLElement} */(shadowChildren[i]);\n this.styleSubtree(c);\n }\n } else {\n // process the lightdom children of `host`\n let children = host.children || host.childNodes;\n if (children) {\n for (let i = 0; i < children.length; i++) {\n let c = /** @type {!HTMLElement} */(children[i]);\n this.styleSubtree(c);\n }\n }\n }\n }\n /* Custom Style operations */\n _revalidateCustomStyleApplyShim(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n this._revalidateApplyShim(s);\n }\n }\n }\n _applyCustomStyles(customStyles) {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n let s = this._customStyleInterface['getStyleForCustomStyle'](c);\n if (s) {\n StyleProperties.applyCustomStyle(s, this._documentOwnerStyleInfo.styleProperties);\n }\n }\n }\n transformCustomStyleForDocument(style) {\n let ast = StyleUtil.rulesForStyle(style);\n StyleUtil.forEachRule(ast, (rule) => {\n if (nativeShadow) {\n StyleTransformer.normalizeRootSelector(rule);\n } else {\n StyleTransformer.documentRule(rule);\n }\n if (nativeCssVariables) {\n this._ensure();\n this._applyShim['transformRule'](rule);\n }\n });\n if (nativeCssVariables) {\n style.textContent = StyleUtil.toCssText(ast);\n } else {\n this._documentOwnerStyleInfo.styleRules.rules.push(ast);\n }\n }\n _revalidateApplyShim(style) {\n if (nativeCssVariables) {\n let ast = StyleUtil.rulesForStyle(style);\n this._ensure();\n this._applyShim['transformRules'](ast);\n style.textContent = StyleUtil.toCssText(ast);\n }\n }\n getComputedStyleValue(element, property) {\n let value;\n if (!nativeCssVariables) {\n // element is either a style host, or an ancestor of a style host\n let styleInfo = StyleInfo.get(element) || StyleInfo.get(this._styleOwnerForNode(element));\n value = styleInfo.styleProperties[property];\n }\n // fall back to the property value from the computed styling\n value = value || window.getComputedStyle(element).getPropertyValue(property);\n // trim whitespace that can come after the `:` in css\n // example: padding: 2px -> \" 2px\"\n return value ? value.trim() : '';\n }\n // given an element and a classString, replaces\n // the element's class with the provided classString and adds\n // any necessary ShadyCSS static and property based scoping selectors\n setElementClass(element, classString) {\n let root = element.getRootNode();\n let classes = classString ? classString.split(/\\s/) : [];\n let scopeName = root.host && root.host.localName;\n // If no scope, try to discover scope name from existing class.\n // This can occur if, for example, a template stamped element that\n // has been scoped is manipulated when not in a root.\n if (!scopeName) {\n var classAttr = element.getAttribute('class');\n if (classAttr) {\n let k$ = classAttr.split(/\\s/);\n for (let i=0; i < k$.length; i++) {\n if (k$[i] === StyleTransformer.SCOPE_NAME) {\n scopeName = k$[i+1];\n break;\n }\n }\n }\n }\n if (scopeName) {\n classes.push(StyleTransformer.SCOPE_NAME, scopeName);\n }\n if (!nativeCssVariables) {\n let styleInfo = StyleInfo.get(element);\n if (styleInfo && styleInfo.scopeSelector) {\n classes.push(StyleProperties.XSCOPE_NAME, styleInfo.scopeSelector);\n }\n }\n StyleUtil.setElementClassRaw(element, classes.join(' '));\n }\n _styleInfoForNode(node) {\n return StyleInfo.get(node);\n }\n}\n\n/* exports */\nScopingShim.prototype['flush'] = ScopingShim.prototype.flush;\nScopingShim.prototype['prepareTemplate'] = ScopingShim.prototype.prepareTemplate;\nScopingShim.prototype['styleElement'] = ScopingShim.prototype.styleElement;\nScopingShim.prototype['styleDocument'] = ScopingShim.prototype.styleDocument;\nScopingShim.prototype['styleSubtree'] = ScopingShim.prototype.styleSubtree;\nScopingShim.prototype['getComputedStyleValue'] = ScopingShim.prototype.getComputedStyleValue;\nScopingShim.prototype['setElementClass'] = ScopingShim.prototype.setElementClass;\nScopingShim.prototype['_styleInfoForNode'] = ScopingShim.prototype._styleInfoForNode;\nScopingShim.prototype['transformCustomStyleForDocument'] = ScopingShim.prototype.transformCustomStyleForDocument;\nScopingShim.prototype['getStyleAst'] = ScopingShim.prototype.getStyleAst;\nScopingShim.prototype['styleAstToString'] = ScopingShim.prototype.styleAstToString;\nScopingShim.prototype['flushCustomStyles'] = ScopingShim.prototype.flushCustomStyles;\nObject.defineProperties(ScopingShim.prototype, {\n 'nativeShadow': {\n get() {\n return nativeShadow;\n }\n },\n 'nativeCss': {\n get() {\n return nativeCssVariables;\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'\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