@webcomponents/shadycss
Advanced tools
Comparing version 1.0.6 to 1.1.0
@@ -11,18 +11,19 @@ (function(){/* | ||
'use strict';var k={};function n(){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 p(a){a=a.replace(aa,"").replace(ba,"");var b=q,c=a,d=new n;d.start=0;d.end=c.length;for(var e=d,f=0,h=c.length;f<h;f++)if("{"===c[f]){e.rules||(e.rules=[]);var g=e,m=g.rules[g.rules.length-1]||null;e=new n;e.start=f+1;e.parent=g;e.previous=m;g.rules.push(e)}else"}"===c[f]&&(e.end=f+1,e=e.parent||d);return b(d,a)} | ||
function q(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=ca(c),c=c.replace(r," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=t:c.match(da)&&(a.type=u,a.keyframesName=a.selector.split(r).pop()):a.type=0===c.indexOf("--")?v:x);if(c=a.rules)for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)q(f,b);return a} | ||
function ca(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})} | ||
function y(a,b,c){c=void 0===c?"":c;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=e.length,g;f<h&&(g=e[f]);f++)d=y(g,b,d)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ea,"").replace(fa,""),b=b.replace(ha,"").replace(ia,"")),(d=b.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(c+=a.selector+" {\n"),c+=d,a.selector&&(c+="}\n\n"));return c} | ||
var x=1,u=7,t=4,v=1E3,aa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ba=/@import[^;]*;/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ha=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ia=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,da=/^@[^\s]*keyframes/,r=/\s+/g;var ja=Promise.resolve();function ka(a){if(a=k[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function z(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function la(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.a||(a.a=!0,ja.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.a=!1}))};var A=!(window.ShadyDOM&&window.ShadyDOM.inUse),B;function C(a){B=a&&a.shimcssproperties?!1:A||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?B=window.ShadyCSS.nativeCss:window.ShadyCSS?(C(window.ShadyCSS),window.ShadyCSS=void 0):C(window.WebComponents&&window.WebComponents.flags);var E=B;var F=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,G=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ma=/@media\s(.*)/;function H(a){if(!a)return"";"string"===typeof a&&(a=p(a));return y(a,E)}function I(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function J(a,b,c,d){if(a){var e=!1,f=a.type;if(d&&f===t){var h=a.selector.match(ma);h&&(window.matchMedia(h[1]).matches||(e=!0))}f===x?b(a):c&&f===u?c(a):f===v&&(e=!0);if((a=a.rules)&&!e){e=0;f=a.length;for(var g;e<f&&(g=a[e]);e++)J(g,b,c,d)}}} | ||
function K(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var d=0;var e=c+3;for(var f=a.length;e<f;e++)if("("===a[e])d++;else if(")"===a[e]&&0===--d)break a;e=-1}d=a.substring(c+4,e);c=a.substring(0,c);a=K(a.substring(e+1),b);e=d.indexOf(",");return-1===e?b(c,d.trim(),"",a):b(c,d.substring(0,e).trim(),d.substring(e+1).trim(),a)};var na=/;\s*/m,oa=/^\s*(initial)|(inherit)\s*$/;function L(){this.a={}}L.prototype.set=function(a,b){a=a.trim();this.a[a]={h:b,i:{}}};L.prototype.get=function(a){a=a.trim();return this.a[a]||null};var M=null;function N(){this.b=this.c=null;this.a=new L}N.prototype.o=function(a){a=G.test(a)||F.test(a);G.lastIndex=0;F.lastIndex=0;return a};N.prototype.m=function(a,b){a=a.content.querySelector("style");var c=null;a&&(c=this.j(a,b));return c}; | ||
N.prototype.j=function(a,b){b=void 0===b?"":b;var c=I(a);this.l(c,b);a.textContent=H(c);return c};N.prototype.f=function(a){var b=this,c=I(a);J(c,function(a){":root"===a.selector&&(a.selector="html");b.g(a)});a.textContent=H(c);return c};N.prototype.l=function(a,b){var c=this;this.c=b;J(a,function(a){c.g(a)});this.c=null};N.prototype.g=function(a){a.cssText=pa(this,a.parsedCssText);":root"===a.selector&&(a.selector=":host > *")}; | ||
function pa(a,b){b=b.replace(F,function(b,d,e,f){return qa(a,b,d,e,f)});return O(a,b)}function O(a,b){for(var c;c=G.exec(b);){var d=c[0],e=c[1];c=c.index;var f=b.slice(0,c+d.indexOf("@apply"));b=b.slice(c+d.length);var h=P(a,f);d=void 0;var g=a;e=e.replace(na,"");var m=[];var l=g.a.get(e);l||(g.a.set(e,{}),l=g.a.get(e));if(l)for(d in g.c&&(l.i[g.c]=!0),l.h)g=h&&h[d],l=[d,": var(",e,"_-_",d],g&&l.push(",",g),l.push(")"),m.push(l.join(""));d=m.join("; ");b=""+f+d+b;G.lastIndex=c+d.length}return b} | ||
function P(a,b){b=b.split(";");for(var c,d,e={},f=0,h;f<b.length;f++)if(c=b[f])if(h=c.split(":"),1<h.length){c=h[0].trim();var g=a;d=c;h=h.slice(1).join(":");var m=oa.exec(h);m&&(m[1]?(g.b||(g.b=document.createElement("meta"),g.b.setAttribute("apply-shim-measure",""),g.b.style.all="initial",document.head.appendChild(g.b)),d=window.getComputedStyle(g.b).getPropertyValue(d)):d="apply-shim-inherit",h=d);d=h;e[c]=d}return e}function ra(a,b){if(M)for(var c in b.i)c!==a.c&&M(c)} | ||
function qa(a,b,c,d,e){d&&K(d,function(b,c){c&&a.a.get(c)&&(e="@apply "+c+";")});if(!e)return b;var f=O(a,e),h=b.slice(0,b.indexOf("--")),g=f=P(a,f),m=a.a.get(c),l=m&&m.h;l?g=Object.assign(Object.create(l),f):a.a.set(c,g);var X=[],w,Y=!1;for(w in g){var D=f[w];void 0===D&&(D="initial");!l||w in l||(Y=!0);X.push(""+c+"_-_"+w+": "+D)}Y&&ra(a,m);m&&(m.h=g);d&&(h=b+";"+h);return""+h+X.join("; ")+";"}N.prototype.detectMixin=N.prototype.o;N.prototype.transformStyle=N.prototype.j; | ||
N.prototype.transformCustomStyle=N.prototype.f;N.prototype.transformRules=N.prototype.l;N.prototype.transformRule=N.prototype.g;N.prototype.transformTemplate=N.prototype.m;N.prototype._separator="_-_";Object.defineProperty(N.prototype,"invalidCallback",{get:function(){return M},set:function(a){M=a}});var Q=null,R=window.HTMLImports&&window.HTMLImports.whenReady||null,S;function sa(a){requestAnimationFrame(function(){R?R(a):(Q||(Q=new Promise(function(a){S=a}),"complete"===document.readyState?S():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&S()})),Q.then(function(){a&&a()}))})};var T=new N;function U(){var a=this;this.a=null;sa(function(){V(a)});T.invalidCallback=ka}function V(a){a.a||(a.a=window.ShadyCSS.CustomStyleInterface,a.a&&(a.a.transformCallback=function(a){T.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&W(a)})}))}U.prototype.prepareTemplate=function(a,b){V(this);k[b]=a;b=T.m(a,b);a._styleAst=b}; | ||
function W(a){V(a);if(a.a){var b=a.a.processStyles();if(a.a.enqueued){for(var c=0;c<b.length;c++){var d=a.a.getStyleForCustomStyle(b[c]);d&&T.f(d)}a.a.enqueued=!1}}}U.prototype.styleSubtree=function(a,b){V(this);if(b)for(var c in b)null===c?a.style.removeProperty(c):a.style.setProperty(c,b[c]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b]);else for(a=a.children||a.childNodes,b=0;b<a.length;b++)this.styleSubtree(a[b])}; | ||
U.prototype.styleElement=function(a){V(this);var b=a.localName,c;b?-1<b.indexOf("-")?c=b:c=a.getAttribute&&a.getAttribute("is")||"":c=a.is;if((b=k[c])&&!z(b)){if(z(b)||b._applyShimValidatingVersion!==b._applyShimNextVersion)this.prepareTemplate(b,c),la(b);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=b._styleAst,a.textContent=H(b._styleAst)}};U.prototype.styleDocument=function(a){V(this);this.styleSubtree(document.body,a)}; | ||
if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var Z=new U,ta=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,b){W(Z);Z.prepareTemplate(a,b)},styleSubtree:function(a,b){W(Z);Z.styleSubtree(a,b)},styleElement:function(a){W(Z);Z.styleElement(a)},styleDocument:function(a){W(Z);Z.styleDocument(a)},getComputedStyleValue:function(a,b){return(a=window.getComputedStyle(a).getPropertyValue(b))?a.trim():""},nativeCss:E,nativeShadow:A};ta&&(window.ShadyCSS.CustomStyleInterface= | ||
ta)}window.ShadyCSS.ApplyShim=T;}).call(this); | ||
function p(a){a=a.replace(aa,"").replace(ba,"");var c=q,b=a,d=new n;d.start=0;d.end=b.length;for(var e=d,f=0,h=b.length;f<h;f++)if("{"===b[f]){e.rules||(e.rules=[]);var g=e,m=g.rules[g.rules.length-1]||null;e=new n;e.start=f+1;e.parent=g;e.previous=m;g.rules.push(e)}else"}"===b[f]&&(e.end=f+1,e=e.parent||d);return c(d,a)} | ||
function q(a,c){var b=c.substring(a.start,a.end-1);a.parsedCssText=a.cssText=b.trim();a.parent&&(b=c.substring(a.previous?a.previous.end:a.parent.start,a.start-1),b=ca(b),b=b.replace(r," "),b=b.substring(b.lastIndexOf(";")+1),b=a.parsedSelector=a.selector=b.trim(),a.atRule=0===b.indexOf("@"),a.atRule?0===b.indexOf("@media")?a.type=t:b.match(da)&&(a.type=u,a.keyframesName=a.selector.split(r).pop()):a.type=0===b.indexOf("--")?v:x);if(b=a.rules)for(var d=0,e=b.length,f;d<e&&(f=b[d]);d++)q(f,c);return a} | ||
function ca(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,b){a=b;for(b=6-a.length;b--;)a="0"+a;return"\\"+a})} | ||
function y(a,c,b){b=void 0===b?"":b;var d="";if(a.cssText||a.rules){var e=a.rules,f;if(f=e)f=e[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=e.length,g;f<h&&(g=e[f]);f++)d=y(g,c,d)}else c?c=a.cssText:(c=a.cssText,c=c.replace(ea,"").replace(fa,""),c=c.replace(ha,"").replace(ia,"")),(d=c.trim())&&(d=" "+d+"\n")}d&&(a.selector&&(b+=a.selector+" {\n"),b+=d,a.selector&&(b+="}\n\n"));return b} | ||
var x=1,u=7,t=4,v=1E3,aa=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ba=/@import[^;]*;/gim,ea=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,fa=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,ha=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,ia=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,da=/^@[^\s]*keyframes/,r=/\s+/g;var ja=Promise.resolve();function ka(a){if(a=k[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function z(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function la(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,ja.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))};var A=!(window.ShadyDOM&&window.ShadyDOM.inUse),B;function C(a){B=a&&a.shimcssproperties?!1:A||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?B=window.ShadyCSS.nativeCss:window.ShadyCSS?(C(window.ShadyCSS),window.ShadyCSS=void 0):C(window.WebComponents&&window.WebComponents.flags);var D=B;var F=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,G=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,ma=/@media\s(.*)/;var H=new Set;function I(a){if(!a)return"";"string"===typeof a&&(a=p(a));return y(a,D)}function J(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function K(a,c,b,d){if(a){var e=!1,f=a.type;if(d&&f===t){var h=a.selector.match(ma);h&&(window.matchMedia(h[1]).matches||(e=!0))}f===x?c(a):b&&f===u?b(a):f===v&&(e=!0);if((a=a.rules)&&!e){e=0;f=a.length;for(var g;e<f&&(g=a[e]);e++)K(g,c,b,d)}}} | ||
function L(a,c){var b=a.indexOf("var(");if(-1===b)return c(a,"","","");a:{var d=0;var e=b+3;for(var f=a.length;e<f;e++)if("("===a[e])d++;else if(")"===a[e]&&0===--d)break a;e=-1}d=a.substring(b+4,e);b=a.substring(0,b);a=L(a.substring(e+1),c);e=d.indexOf(",");return-1===e?c(b,d.trim(),"",a):c(b,d.substring(0,e).trim(),d.substring(e+1).trim(),a)};var na=/;\s*/m,oa=/^\s*(initial)|(inherit)\s*$/;function M(){this.a={}}M.prototype.set=function(a,c){a=a.trim();this.a[a]={h:c,i:{}}};M.prototype.get=function(a){a=a.trim();return this.a[a]||null};var N=null;function O(){this.b=this.c=null;this.a=new M}O.prototype.o=function(a){a=G.test(a)||F.test(a);G.lastIndex=0;F.lastIndex=0;return a}; | ||
O.prototype.m=function(a,c){if(void 0===a.a){var b=[];for(var d=a.content.querySelectorAll("style"),e=0;e<d.length;e++){var f=d[e];if(f.hasAttribute("shady-unscoped")){if(!A){var h=f.textContent;H.has(h)||(H.add(h),h=f.cloneNode(!0),document.head.appendChild(h));f.parentNode.removeChild(f)}}else b.push(f.textContent),f.parentNode.removeChild(f)}(b=b.join("").trim())?(d=document.createElement("style"),d.textContent=b,a.content.insertBefore(d,a.content.firstChild),b=d):b=null;a.a=b}return(a=a.a)?this.j(a, | ||
c):null};O.prototype.j=function(a,c){c=void 0===c?"":c;var b=J(a);this.l(b,c);a.textContent=I(b);return b};O.prototype.f=function(a){var c=this,b=J(a);K(b,function(a){":root"===a.selector&&(a.selector="html");c.g(a)});a.textContent=I(b);return b};O.prototype.l=function(a,c){var b=this;this.c=c;K(a,function(a){b.g(a)});this.c=null};O.prototype.g=function(a){a.cssText=pa(this,a.parsedCssText);":root"===a.selector&&(a.selector=":host > *")}; | ||
function pa(a,c){c=c.replace(F,function(b,c,e,f){return qa(a,b,c,e,f)});return P(a,c)}function P(a,c){for(var b;b=G.exec(c);){var d=b[0],e=b[1];b=b.index;var f=c.slice(0,b+d.indexOf("@apply"));c=c.slice(b+d.length);var h=Q(a,f);d=void 0;var g=a;e=e.replace(na,"");var m=[];var l=g.a.get(e);l||(g.a.set(e,{}),l=g.a.get(e));if(l)for(d in g.c&&(l.i[g.c]=!0),l.h)g=h&&h[d],l=[d,": var(",e,"_-_",d],g&&l.push(",",g),l.push(")"),m.push(l.join(""));d=m.join("; ");c=""+f+d+c;G.lastIndex=b+d.length}return c} | ||
function Q(a,c){c=c.split(";");for(var b,d,e={},f=0,h;f<c.length;f++)if(b=c[f])if(h=b.split(":"),1<h.length){b=h[0].trim();var g=a;d=b;h=h.slice(1).join(":");var m=oa.exec(h);m&&(m[1]?(g.b||(g.b=document.createElement("meta"),g.b.setAttribute("apply-shim-measure",""),g.b.style.all="initial",document.head.appendChild(g.b)),d=window.getComputedStyle(g.b).getPropertyValue(d)):d="apply-shim-inherit",h=d);d=h;e[b]=d}return e}function ra(a,c){if(N)for(var b in c.i)b!==a.c&&N(b)} | ||
function qa(a,c,b,d,e){d&&L(d,function(c,b){b&&a.a.get(b)&&(e="@apply "+b+";")});if(!e)return c;var f=P(a,e),h=c.slice(0,c.indexOf("--")),g=f=Q(a,f),m=a.a.get(b),l=m&&m.h;l?g=Object.assign(Object.create(l),f):a.a.set(b,g);var Y=[],w,Z=!1;for(w in g){var E=f[w];void 0===E&&(E="initial");!l||w in l||(Z=!0);Y.push(""+b+"_-_"+w+": "+E)}Z&&ra(a,m);m&&(m.h=g);d&&(h=c+";"+h);return""+h+Y.join("; ")+";"}O.prototype.detectMixin=O.prototype.o;O.prototype.transformStyle=O.prototype.j; | ||
O.prototype.transformCustomStyle=O.prototype.f;O.prototype.transformRules=O.prototype.l;O.prototype.transformRule=O.prototype.g;O.prototype.transformTemplate=O.prototype.m;O.prototype._separator="_-_";Object.defineProperty(O.prototype,"invalidCallback",{get:function(){return N},set:function(a){N=a}});var R=null,sa=window.HTMLImports&&window.HTMLImports.whenReady||null,S;function ta(a){requestAnimationFrame(function(){sa?sa(a):(R||(R=new Promise(function(a){S=a}),"complete"===document.readyState?S():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&S()})),R.then(function(){a&&a()}))})};var T=new O;function U(){var a=this;this.a=null;ta(function(){V(a)});T.invalidCallback=ka}function V(a){a.a||(a.a=window.ShadyCSS.CustomStyleInterface,a.a&&(a.a.transformCallback=function(a){T.f(a)},a.a.validateCallback=function(){requestAnimationFrame(function(){a.a.enqueued&&W(a)})}))}U.prototype.prepareTemplate=function(a,c){V(this);k[c]=a;c=T.m(a,c);a._styleAst=c}; | ||
function W(a){V(a);if(a.a){var c=a.a.processStyles();if(a.a.enqueued){for(var b=0;b<c.length;b++){var d=a.a.getStyleForCustomStyle(c[b]);d&&T.f(d)}a.a.enqueued=!1}}}U.prototype.styleSubtree=function(a,c){V(this);if(c)for(var b in c)null===b?a.style.removeProperty(b):a.style.setProperty(b,c[b]);if(a.shadowRoot)for(this.styleElement(a),a=a.shadowRoot.children||a.shadowRoot.childNodes,c=0;c<a.length;c++)this.styleSubtree(a[c]);else for(a=a.children||a.childNodes,c=0;c<a.length;c++)this.styleSubtree(a[c])}; | ||
U.prototype.styleElement=function(a){V(this);var c=a.localName,b;c?-1<c.indexOf("-")?b=c:b=a.getAttribute&&a.getAttribute("is")||"":b=a.is;if((c=k[b])&&!z(c)){if(z(c)||c._applyShimValidatingVersion!==c._applyShimNextVersion)this.prepareTemplate(c,b),la(c);if(a=a.shadowRoot)if(a=a.querySelector("style"))a.__cssRules=c._styleAst,a.textContent=I(c._styleAst)}};U.prototype.styleDocument=function(a){V(this);this.styleSubtree(document.body,a)}; | ||
if(!window.ShadyCSS||!window.ShadyCSS.ScopingShim){var X=new U,ua=window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface;window.ShadyCSS={prepareTemplate:function(a,c){W(X);X.prepareTemplate(a,c)},styleSubtree:function(a,c){W(X);X.styleSubtree(a,c)},styleElement:function(a){W(X);X.styleElement(a)},styleDocument:function(a){W(X);X.styleDocument(a)},getComputedStyleValue:function(a,c){return(a=window.getComputedStyle(a).getPropertyValue(c))?a.trim():""},nativeCss:D,nativeShadow:A};ua&&(window.ShadyCSS.CustomStyleInterface= | ||
ua)}window.ShadyCSS.ApplyShim=T;}).call(this); | ||
//# sourceMappingURL=apply-shim.min.js.map |
{ | ||
"name": "@webcomponents/shadycss", | ||
"version": "1.0.6", | ||
"version": "1.1.0", | ||
"description": "Styling helpers for ShadyDOM", | ||
@@ -5,0 +5,0 @@ "main": "shadycss.min.js", |
@@ -11,42 +11,43 @@ (function(){/* | ||
'use strict';var l,aa="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,m={};function n(){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 p(a){a=a.replace(ba,"").replace(ca,"");var b=da,c=a,e=new n;e.start=0;e.end=c.length;for(var d=e,f=0,g=c.length;f<g;f++)if("{"===c[f]){d.rules||(d.rules=[]);var h=d,k=h.rules[h.rules.length-1]||null;d=new n;d.start=f+1;d.parent=h;d.previous=k;h.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} | ||
function p(a){a=a.replace(ba,"").replace(ca,"");var b=da,c=a,e=new n;e.start=0;e.end=c.length;for(var d=e,f=0,h=c.length;f<h;f++)if("{"===c[f]){d.rules||(d.rules=[]);var g=d,k=g.rules[g.rules.length-1]||null;d=new n;d.start=f+1;d.parent=g;d.previous=k;g.rules.push(d)}else"}"===c[f]&&(d.end=f+1,d=d.parent||e);return b(e,a)} | ||
function da(a,b){var c=b.substring(a.start,a.end-1);a.parsedCssText=a.cssText=c.trim();a.parent&&(c=b.substring(a.previous?a.previous.end:a.parent.start,a.start-1),c=ea(c),c=c.replace(fa," "),c=c.substring(c.lastIndexOf(";")+1),c=a.parsedSelector=a.selector=c.trim(),a.atRule=0===c.indexOf("@"),a.atRule?0===c.indexOf("@media")?a.type=ha:c.match(ia)&&(a.type=r,a.keyframesName=a.selector.split(fa).pop()):a.type=0===c.indexOf("--")?ja:ka);if(c=a.rules)for(var e=0,d=c.length,f;e<d&&(f=c[e]);e++)da(f,b); | ||
return a}function ea(a){return a.replace(/\\([0-9a-f]{1,6})\s/gi,function(a,c){a=c;for(c=6-a.length;c--;)a="0"+a;return"\\"+a})} | ||
function la(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var g=d.length,h;f<g&&(h=d[f]);f++)e=la(h,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ma,"").replace(na,""),b=b.replace(oa,"").replace(pa,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} | ||
var ka=1,r=7,ha=4,ja=1E3,ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ca=/@import[^;]*;/gim,ma=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,na=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,oa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,pa=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ia=/^@[^\s]*keyframes/,fa=/\s+/g;var qa=Promise.resolve();function ra(a){if(a=m[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function sa(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function ta(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,qa.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))};var t=!(window.ShadyDOM&&window.ShadyDOM.inUse),u;function ua(a){u=a&&a.shimcssproperties?!1:t||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?u=window.ShadyCSS.nativeCss:window.ShadyCSS?(ua(window.ShadyCSS),window.ShadyCSS=void 0):ua(window.WebComponents&&window.WebComponents.flags);var v=u;var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,y=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,va=/(--[\w-]+)\s*([:,;)]|$)/gi,wa=/(animation\s*:)|(animation-name\s*:)/,xa=/@media\s(.*)/,ya=/\{[^}]*\}/g;function z(a,b){if(!a)return"";"string"===typeof a&&(a=p(a));b&&A(a,b);return la(a,v)}function B(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function za(a){return!!a.parent&&a.parent.type===r}function A(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===ha){var g=a.selector.match(xa);g&&(window.matchMedia(g[1]).matches||(d=!0))}f===ka?b(a):c&&f===r?c(a):f===ja&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var h;d<f&&(h=a[d]);d++)A(h,b,c,e)}}} | ||
function C(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;Aa(d,c,e);return d}var D=null;function Aa(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);D?a.compareDocumentPosition(D)===Node.DOCUMENT_POSITION_PRECEDING&&(D=a):D=a} | ||
function Ba(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=Ba(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)}function E(a,b){t?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)} | ||
function F(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,u:c}};var G=null,Ca=window.HTMLImports&&window.HTMLImports.whenReady||null,H;function Da(a){requestAnimationFrame(function(){Ca?Ca(a):(G||(G=new Promise(function(a){H=a}),"complete"===document.readyState?H():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&H()})),G.then(function(){a&&a()}))})};function I(){}function J(a,b,c){var e=K;a.__styleScoped?a.__styleScoped=null:Ea(e,a,b||"",c)}function Ea(a,b,c,e){b.nodeType===Node.ELEMENT_NODE&&Fa(b,c,e);if(b="template"===b.localName?(b.content||b.R).childNodes:b.children||b.childNodes)for(var d=0;d<b.length;d++)Ea(a,b[d],c,e)} | ||
function Fa(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var e=a.getAttribute(Ga);c?e&&(b=e.replace("style-scope","").replace(b,""),E(a,b)):E(a,(e?e+" ":"")+"style-scope "+b)}}function L(a,b,c){var e=K,d=a.__cssBuild;t||"shady"===d?b=z(b,c):(a=F(a),b=Ha(e,b,a.is,a.u,c)+"\n\n");return b.trim()} | ||
function Ha(a,b,c,e,d){var f=M(c,e);c=c?Ia+c:"";return z(b,function(b){b.c||(b.selector=b.g=Ja(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function M(a,b){return b?"[is="+a+"]":a}function Ja(a,b,c,e,d){var f=b.selector.split(Ka);if(!za(b)){b=0;for(var g=f.length,h;b<g&&(h=f[b]);b++)f[b]=c.call(a,h,e,d)}return f.join(Ka)}function La(a){return a.replace(Ma,function(a,c,e){-1<e.indexOf("+")?e=e.replace(/\+/g,"___"):-1<e.indexOf("___")&&(e=e.replace(/___/g,"+"));return":"+c+"("+e+")"})} | ||
I.prototype.b=function(a,b,c){var e=!1;a=a.trim();var d=Ma.test(a);d&&(a=a.replace(Ma,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=La(a));a=a.replace(Na,Oa+" $1");a=a.replace(Pa,function(a,d,h){e||(a=Qa(h,d,b,c),e=e||a.stop,d=a.H,h=a.value);return d+h});d&&(a=La(a));return a}; | ||
function Qa(a,b,c,e){var d=a.indexOf(Ra);0<=a.indexOf(Oa)?a=Sa(a,e):0!==d&&(a=c?Ta(a,c):a);c=!1;0<=d&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Ua,function(a,b){return" > "+b}))}a=a.replace(Va,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,H:b,stop:f}}function Ta(a,b){a=a.split(Wa);a[0]+=b;return a.join(Wa)} | ||
function Sa(a,b){var c=a.match(Xa);return(c=c&&c[2].trim()||"")?c[0].match(Ya)?a.replace(Xa,function(a,c,f){return b+f}):c.split(Ya)[0]===b?c:Za:a.replace(Oa,b)}function $a(a){a.selector===ab&&(a.selector="html")}I.prototype.c=function(a){return a.match(Ra)?this.b(a,bb):Ta(a.trim(),bb)};aa.Object.defineProperties(I.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); | ||
var Ma=/:(nth[-\w]+)\(([^)]+)\)/,bb=":not(.style-scope)",Ka=",",Pa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Ya=/[[.:#*]/,Oa=":host",ab=":root",Ra="::slotted",Na=new RegExp("^("+Ra+")"),Xa=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Ua=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Va=/(.*):dir\((?:(ltr|rtl))\)/,Ia=".",Wa=":",Ga="class",Za="should_not_match",K=new I;function cb(){} | ||
function db(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var e=0;e<c.addedNodes.length;e++){var d=c.addedNodes[e];if(d.nodeType===Node.ELEMENT_NODE){var f=d.getRootNode();var g=d;var h=[];g.classList?h=Array.from(g.classList):g instanceof window.SVGElement&&g.hasAttribute("class")&&(h=g.getAttribute("class").split(/\s+/));g=h;h=g.indexOf(K.a);if((g=-1<h?g[h+1]:"")&&f===d.ownerDocument)J(d,g,!0);else if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f= | ||
f.host))if(f=F(f).is,g===f)for(d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+K.a+")"),f=0;f<d.length;f++)Fa(d[f],g);else g&&J(d,g,!0),J(d,f)}}}} | ||
if(!t){var eb=new MutationObserver(db),fb=function(a){eb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)fb(document);else{var gb=function(){fb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(gb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){gb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else gb()})}cb=function(){db(eb.takeRecords())}} | ||
var hb=cb;function N(a,b,c,e,d){this.j=a||null;this.b=b||null;this.B=c||[];this.s=null;this.u=d||"";this.a=this.h=this.m=null}function O(a){return a?a.__styleInfo:null}function ib(a,b){return a.__styleInfo=b}N.prototype.c=function(){return this.j};N.prototype._getStyleRules=N.prototype.c;var Q=window.Element.prototype,jb=Q.matches||Q.matchesSelector||Q.mozMatchesSelector||Q.msMatchesSelector||Q.oMatchesSelector||Q.webkitMatchesSelector,kb=navigator.userAgent.match("Trident");function lb(){}function mb(a){var b={},c=[],e=0;A(a,function(a){R(a);a.index=e++;a=a.f.cssText;for(var c;c=va.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var d in b)a.push(d);return a} | ||
function la(a,b,c){c=void 0===c?"":c;var e="";if(a.cssText||a.rules){var d=a.rules,f;if(f=d)f=d[0],f=!(f&&f.selector&&0===f.selector.indexOf("--"));if(f){f=0;for(var h=d.length,g;f<h&&(g=d[f]);f++)e=la(g,b,e)}else b?b=a.cssText:(b=a.cssText,b=b.replace(ma,"").replace(na,""),b=b.replace(oa,"").replace(pa,"")),(e=b.trim())&&(e=" "+e+"\n")}e&&(a.selector&&(c+=a.selector+" {\n"),c+=e,a.selector&&(c+="}\n\n"));return c} | ||
var ka=1,r=7,ha=4,ja=1E3,ba=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,ca=/@import[^;]*;/gim,ma=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,na=/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,oa=/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,pa=/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,ia=/^@[^\s]*keyframes/,fa=/\s+/g;var qa=Promise.resolve();function ra(a){if(a=m[a])a._applyShimCurrentVersion=a._applyShimCurrentVersion||0,a._applyShimValidatingVersion=a._applyShimValidatingVersion||0,a._applyShimNextVersion=(a._applyShimNextVersion||0)+1}function sa(a){return a._applyShimCurrentVersion===a._applyShimNextVersion}function ta(a){a._applyShimValidatingVersion=a._applyShimNextVersion;a.b||(a.b=!0,qa.then(function(){a._applyShimCurrentVersion=a._applyShimNextVersion;a.b=!1}))};var t=!(window.ShadyDOM&&window.ShadyDOM.inUse),u;function ua(a){u=a&&a.shimcssproperties?!1:t||!(navigator.userAgent.match(/AppleWebKit\/601|Edge\/15/)||!window.CSS||!CSS.supports||!CSS.supports("box-shadow","0 0 0 var(--foo)"))}window.ShadyCSS&&void 0!==window.ShadyCSS.nativeCss?u=window.ShadyCSS.nativeCss:window.ShadyCSS?(ua(window.ShadyCSS),window.ShadyCSS=void 0):ua(window.WebComponents&&window.WebComponents.flags);var v=u;var w=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gi,y=/(?:^|\W+)@apply\s*\(?([^);\n]*)\)?/gi,va=/(--[\w-]+)\s*([:,;)]|$)/gi,wa=/(animation\s*:)|(animation-name\s*:)/,xa=/@media\s(.*)/,ya=/\{[^}]*\}/g;var za=new Set;function z(a,b){if(!a)return"";"string"===typeof a&&(a=p(a));b&&A(a,b);return la(a,v)}function B(a){!a.__cssRules&&a.textContent&&(a.__cssRules=p(a.textContent));return a.__cssRules||null}function Aa(a){return!!a.parent&&a.parent.type===r}function A(a,b,c,e){if(a){var d=!1,f=a.type;if(e&&f===ha){var h=a.selector.match(xa);h&&(window.matchMedia(h[1]).matches||(d=!0))}f===ka?b(a):c&&f===r?c(a):f===ja&&(d=!0);if((a=a.rules)&&!d){d=0;f=a.length;for(var g;d<f&&(g=a[d]);d++)A(g,b,c,e)}}} | ||
function C(a,b,c,e){var d=document.createElement("style");b&&d.setAttribute("scope",b);d.textContent=a;Ba(d,c,e);return d}var D=null;function Ba(a,b,c){b=b||document.head;b.insertBefore(a,c&&c.nextSibling||b.firstChild);D?a.compareDocumentPosition(D)===Node.DOCUMENT_POSITION_PRECEDING&&(D=a):D=a} | ||
function Ca(a,b){var c=a.indexOf("var(");if(-1===c)return b(a,"","","");a:{var e=0;var d=c+3;for(var f=a.length;d<f;d++)if("("===a[d])e++;else if(")"===a[d]&&0===--e)break a;d=-1}e=a.substring(c+4,d);c=a.substring(0,c);a=Ca(a.substring(d+1),b);d=e.indexOf(",");return-1===d?b(c,e.trim(),"",a):b(c,e.substring(0,d).trim(),e.substring(d+1).trim(),a)}function E(a,b){t?a.setAttribute("class",b):window.ShadyDOM.nativeMethods.setAttribute.call(a,"class",b)} | ||
function F(a){var b=a.localName,c="";b?-1<b.indexOf("-")||(c=b,b=a.getAttribute&&a.getAttribute("is")||""):(b=a.is,c=a.extends);return{is:b,u:c}};var G=null,Da=window.HTMLImports&&window.HTMLImports.whenReady||null,H;function Ea(a){requestAnimationFrame(function(){Da?Da(a):(G||(G=new Promise(function(a){H=a}),"complete"===document.readyState?H():document.addEventListener("readystatechange",function(){"complete"===document.readyState&&H()})),G.then(function(){a&&a()}))})};function I(){}function J(a,b,c){var e=K;a.__styleScoped?a.__styleScoped=null:Fa(e,a,b||"",c)}function Fa(a,b,c,e){b.nodeType===Node.ELEMENT_NODE&&Ga(b,c,e);if(b="template"===b.localName?(b.content||b.R).childNodes:b.children||b.childNodes)for(var d=0;d<b.length;d++)Fa(a,b[d],c,e)} | ||
function Ga(a,b,c){if(b)if(a.classList)c?(a.classList.remove("style-scope"),a.classList.remove(b)):(a.classList.add("style-scope"),a.classList.add(b));else if(a.getAttribute){var e=a.getAttribute(Ha);c?e&&(b=e.replace("style-scope","").replace(b,""),E(a,b)):E(a,(e?e+" ":"")+"style-scope "+b)}}function L(a,b,c){var e=K,d=a.__cssBuild;t||"shady"===d?b=z(b,c):(a=F(a),b=Ia(e,b,a.is,a.u,c)+"\n\n");return b.trim()} | ||
function Ia(a,b,c,e,d){var f=M(c,e);c=c?Ja+c:"";return z(b,function(b){b.c||(b.selector=b.g=Ka(a,b,a.b,c,f),b.c=!0);d&&d(b,c,f)})}function M(a,b){return b?"[is="+a+"]":a}function Ka(a,b,c,e,d){var f=b.selector.split(La);if(!Aa(b)){b=0;for(var h=f.length,g;b<h&&(g=f[b]);b++)f[b]=c.call(a,g,e,d)}return f.join(La)}function Ma(a){return a.replace(Na,function(a,c,e){-1<e.indexOf("+")?e=e.replace(/\+/g,"___"):-1<e.indexOf("___")&&(e=e.replace(/___/g,"+"));return":"+c+"("+e+")"})} | ||
I.prototype.b=function(a,b,c){var e=!1;a=a.trim();var d=Na.test(a);d&&(a=a.replace(Na,function(a,b,c){return":"+b+"("+c.replace(/\s/g,"")+")"}),a=Ma(a));a=a.replace(Oa,Pa+" $1");a=a.replace(Qa,function(a,d,g){e||(a=Ra(g,d,b,c),e=e||a.stop,d=a.H,g=a.value);return d+g});d&&(a=Ma(a));return a}; | ||
function Ra(a,b,c,e){var d=a.indexOf(Sa);0<=a.indexOf(Pa)?a=Ta(a,e):0!==d&&(a=c?Ua(a,c):a);c=!1;0<=d&&(b="",c=!0);if(c){var f=!0;c&&(a=a.replace(Va,function(a,b){return" > "+b}))}a=a.replace(Wa,function(a,b,c){return'[dir="'+c+'"] '+b+", "+b+'[dir="'+c+'"]'});return{value:a,H:b,stop:f}}function Ua(a,b){a=a.split(Xa);a[0]+=b;return a.join(Xa)} | ||
function Ta(a,b){var c=a.match(Ya);return(c=c&&c[2].trim()||"")?c[0].match(Za)?a.replace(Ya,function(a,c,f){return b+f}):c.split(Za)[0]===b?c:$a:a.replace(Pa,b)}function ab(a){a.selector===bb&&(a.selector="html")}I.prototype.c=function(a){return a.match(Sa)?this.b(a,cb):Ua(a.trim(),cb)};aa.Object.defineProperties(I.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"style-scope"}}}); | ||
var Na=/:(nth[-\w]+)\(([^)]+)\)/,cb=":not(.style-scope)",La=",",Qa=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=[])+)/g,Za=/[[.:#*]/,Pa=":host",bb=":root",Sa="::slotted",Oa=new RegExp("^("+Sa+")"),Ya=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Va=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,Wa=/(.*):dir\((?:(ltr|rtl))\)/,Ja=".",Xa=":",Ha="class",$a="should_not_match",K=new I;function db(){} | ||
function eb(a){for(var b=0;b<a.length;b++){var c=a[b];if(c.target!==document.documentElement&&c.target!==document.head)for(var e=0;e<c.addedNodes.length;e++){var d=c.addedNodes[e];if(d.nodeType===Node.ELEMENT_NODE){var f=d.getRootNode();var h=d;var g=[];h.classList?g=Array.from(h.classList):h instanceof window.SVGElement&&h.hasAttribute("class")&&(g=h.getAttribute("class").split(/\s+/));h=g;g=h.indexOf(K.a);if((h=-1<g?h[g+1]:"")&&f===d.ownerDocument)J(d,h,!0);else if(f.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(f= | ||
f.host))if(f=F(f).is,h===f)for(d=window.ShadyDOM.nativeMethods.querySelectorAll.call(d,":not(."+K.a+")"),f=0;f<d.length;f++)Ga(d[f],h);else h&&J(d,h,!0),J(d,f)}}}} | ||
if(!t){var fb=new MutationObserver(eb),gb=function(a){fb.observe(a,{childList:!0,subtree:!0})};if(window.customElements&&!window.customElements.polyfillWrapFlushCallback)gb(document);else{var hb=function(){gb(document.body)};window.HTMLImports?window.HTMLImports.whenReady(hb):requestAnimationFrame(function(){if("loading"===document.readyState){var a=function(){hb();document.removeEventListener("readystatechange",a)};document.addEventListener("readystatechange",a)}else hb()})}db=function(){eb(fb.takeRecords())}} | ||
var ib=db;function N(a,b,c,e,d){this.j=a||null;this.b=b||null;this.B=c||[];this.s=null;this.u=d||"";this.a=this.h=this.m=null}function O(a){return a?a.__styleInfo:null}function jb(a,b){return a.__styleInfo=b}N.prototype.c=function(){return this.j};N.prototype._getStyleRules=N.prototype.c;var Q=window.Element.prototype,kb=Q.matches||Q.matchesSelector||Q.mozMatchesSelector||Q.msMatchesSelector||Q.oMatchesSelector||Q.webkitMatchesSelector,lb=navigator.userAgent.match("Trident");function mb(){}function nb(a){var b={},c=[],e=0;A(a,function(a){R(a);a.index=e++;a=a.f.cssText;for(var c;c=va.exec(a);){var d=c[1];":"!==c[2]&&(b[d]=!0)}},function(a){c.push(a)});a.b=c;a=[];for(var d in b)a.push(d);return a} | ||
function R(a){if(!a.f){var b={},c={};S(a,c)&&(b.i=c,a.rules=null);b.cssText=a.parsedCssText.replace(ya,"").replace(w,"");a.f=b}}function S(a,b){var c=a.f;if(c){if(c.i)return Object.assign(b,c.i),!0}else{c=a.parsedCssText;for(var e;a=w.exec(c);){e=(a[2]||a[3]).trim();if("inherit"!==e||"unset"!==e)b[a[1].trim()]=e;e=!0}return e}} | ||
function T(a,b,c){b&&(b=0<=b.indexOf(";")?nb(a,b,c):Ba(b,function(b,d,f,g){if(!d)return b+g;(d=T(a,c[d],c))&&"initial"!==d?"apply-shim-inherit"===d&&(d="inherit"):d=T(a,c[f]||f,c)||f;return b+(d||"")+g}));return b&&b.trim()||""} | ||
function nb(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){y.lastIndex=0;if(f=y.exec(d))d=T(a,c[f[1]],c);else if(f=d.indexOf(":"),-1!==f){var g=d.substring(f);g=g.trim();g=T(a,g,c)||g;d=d.substring(0,f)+g}b[e]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return b.join(";")} | ||
function ob(a,b){var c={},e=[];A(a,function(a){a.f||R(a);var d=a.g||a.parsedSelector;b&&a.f.i&&d&&jb.call(b,d)&&(S(a,c),a=a.index,d=parseInt(a/32,10),e[d]=(e[d]||0)|1<<a%32)},null,!0);return{i:c,key:e}} | ||
function pb(a,b,c,e,d){c.f||R(c);if(c.f.i){b=F(b);a=b.is;b=b.u;b=a?M(a,b):"html";var f=c.parsedSelector,g=":host > *"===f||"html"===f,h=0===f.indexOf(":host")&&!g;"shady"===e&&(g=f===b+" > *."+b||-1!==f.indexOf("html"),h=!g&&0===f.indexOf(b));"shadow"===e&&(g=":host > *"===f||"html"===f,h=h&&!g);if(g||h)e=b,h&&(t&&!c.g&&(c.g=Ja(K,c,K.b,a?Ia+a:"",b)),e=c.g||b),d({M:e,K:h,S:g})}} | ||
function qb(a,b){var c={},e={},d=U,f=b&&b.__cssBuild;A(b,function(b){pb(d,a,b,f,function(d){jb.call(a.A||a,d.M)&&(d.K?S(b,c):S(b,e))})},null,!0);return{L:e,J:c}} | ||
function rb(a,b,c,e){var d=F(b),f=M(d.is,d.u),g=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])");d=O(b).j;var h=sb(d,e);return L(b,d,function(b){var d="";b.f||R(b);b.f.cssText&&(d=nb(a,b.f.cssText,c));b.cssText=d;if(!t&&!za(b)&&b.cssText){var k=d=b.cssText;null==b.C&&(b.C=wa.test(d));if(b.C)if(null==b.w){b.w=[];for(var q in h)k=h[q],k=k(d),d!==k&&(d=k,b.w.push(q))}else{for(q=0;q<b.w.length;++q)k=h[b.w[q]],d=k(d);k=d}b.cssText=k;b.g=b.g||b.selector;d="."+e;q=b.g.split(","); | ||
k=0;for(var yb=q.length,P;k<yb&&(P=q[k]);k++)q[k]=P.match(g)?P.replace(f,d):d+" "+P;b.selector=q.join(",")}})}function sb(a,b){a=a.b;var c={};if(!t&&a)for(var e=0,d=a[e];e<a.length;d=a[++e]){var f=d,g=b;f.l=new RegExp(f.keyframesName,"g");f.a=f.keyframesName+"-"+g;f.g=f.g||f.selector;f.selector=f.g.replace(f.keyframesName,f.a);c[d.keyframesName]=tb(d)}return c}function tb(a){return function(b){return b.replace(a.l,a.a)}} | ||
function ub(a,b){var c=U,e=B(a);a.textContent=z(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=nb(c,d,b))})}aa.Object.defineProperties(lb.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var U=new lb;var vb={},V=window.customElements;if(V&&!t){var wb=V.define;V.define=function(a,b,c){var e=document.createComment(" Shady DOM styles for "+a+" "),d=document.head;d.insertBefore(e,(D?D.nextSibling:null)||d.firstChild);D=e;vb[a]=e;return wb.call(V,a,b,c)}};var W=new function(){this.cache={};this.a=100};function X(){var a=this;this.A={};this.c=document.documentElement;var b=new n;b.rules=[];this.l=ib(this.c,new N(b));this.v=!1;this.b=this.a=null;Da(function(){Y(a)})}l=X.prototype;l.F=function(){hb()};l.I=function(a){return B(a)};l.O=function(a){return z(a)}; | ||
l.prepareTemplate=function(a,b,c){if(!a.l){a.l=!0;a.name=b;a.extends=c;m[b]=a;var e=(e=a.content.querySelector("style"))?e.getAttribute("css-build")||"":"";var d=a.content.querySelectorAll("style");for(var f=[],g=0;g<d.length;g++){var h=d[g];f.push(h.textContent);h.parentNode.removeChild(h)}d=f.join("").trim();c={is:b,extends:c,P:e};t||J(a.content,b);Y(this);f=y.test(d)||w.test(d);y.lastIndex=0;w.lastIndex=0;d=p(d);f&&v&&this.a&&this.a.transformRules(d,b);a._styleAst=d;a.v=e;e=[];v||(e=mb(a._styleAst)); | ||
if(!e.length||v)d=t?a.content:null,b=vb[b],f=L(c,a._styleAst),b=f.length?C(f,c.is,d,b):void 0,a.a=b;a.c=e}};function xb(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.D(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.v)&&a.o()})})}function Y(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=ra);xb(a)} | ||
l.o=function(){Y(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued){if(v)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&v&&this.a){var e=B(c);Y(this);this.a.transformRules(e);c.textContent=z(e)}}else for(zb(this,this.c,this.l),b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&ub(c,this.l.m);this.b.enqueued=!1;this.v&&!v&&this.styleDocument()}}}; | ||
l.styleElement=function(a,b){var c=F(a).is,e=O(a);if(!e){var d=F(a);e=d.is;d=d.u;var f=vb[e];e=m[e];if(e){var g=e._styleAst;var h=e.c}e=ib(a,new N(g,f,h,0,d))}a!==this.c&&(this.v=!0);b&&(e.s=e.s||{},Object.assign(e.s,b));if(v){if(e.s){b=e.s;for(var k in b)null===k?a.style.removeProperty(k):a.style.setProperty(k,b[k])}if(((k=m[c])||a===this.c)&&k&&k.a&&!sa(k)){if(sa(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)Y(this),this.a&&this.a.transformRules(k._styleAst,c),k.a.textContent=L(a, | ||
e.j),ta(k);t&&(c=a.shadowRoot)&&(c.querySelector("style").textContent=L(a,e.j));e.j=k._styleAst}}else if(zb(this,a,e),e.B&&e.B.length){c=e;k=F(a).is;a:{if(b=W.cache[k])for(g=b.length-1;0<=g;g--){h=b[g];b:{e=c.B;for(d=0;d<e.length;d++)if(f=e[d],h.i[f]!==c.m[f]){e=!1;break b}e=!0}if(e){b=h;break a}}b=void 0}e=b?b.styleElement:null;g=c.h;(h=b&&b.h)||(h=this.A[k]=(this.A[k]||0)+1,h=k+"-"+h);c.h=h;h=c.h;d=U;d=e?e.textContent||"":rb(d,a,c.m,h);f=O(a);var x=f.a;x&&!t&&x!==e&&(x._useCount--,0>=x._useCount&& | ||
x.parentNode&&x.parentNode.removeChild(x));t?f.a?(f.a.textContent=d,e=f.a):d&&(e=C(d,h,a.shadowRoot,f.b)):e?e.parentNode||(kb&&-1<d.indexOf("@media")&&(e.textContent=d),Aa(e,null,f.b)):d&&(e=C(d,h,null,f.b));e&&(e._useCount=e._useCount||0,f.a!=e&&e._useCount++,f.a=e);h=e;t||(e=c.h,f=d=a.getAttribute("class")||"",g&&(f=d.replace(new RegExp("\\s*x-scope\\s*"+g+"\\s*","g")," ")),f+=(f?" ":"")+"x-scope "+e,d!==f&&E(a,f));b||(a=W.cache[k]||[],a.push({i:c.m,styleElement:h,h:c.h}),a.length>W.a&&a.shift(), | ||
W.cache[k]=a)}};function Ab(a,b){return(b=b.getRootNode().host)?O(b)?b:Ab(a,b):a.c}function zb(a,b,c){a=Ab(a,b);var e=O(a);a=Object.create(e.m||null);var d=qb(b,c.j);b=ob(e.j,b).i;Object.assign(a,d.J,b,d.L);b=c.s;for(var f in b)if((d=b[f])||0===d)a[f]=d;f=U;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=T(f,a[e],a);c.m=a}l.styleDocument=function(a){this.styleSubtree(this.c,a)}; | ||
l.styleSubtree=function(a,b){var c=a.shadowRoot;(c||a===this.c)&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])};l.D=function(a){var b=this,c=B(a);A(c,function(a){if(t)$a(a);else{var c=K;a.selector=a.parsedSelector;$a(a);a.selector=a.g=Ja(c,a,c.c,void 0,void 0)}v&&(Y(b),b.a&&b.a.transformRule(a))});v?a.textContent=z(c):this.l.j.rules.push(c)}; | ||
l.getComputedStyleValue=function(a,b){var c;v||(c=(O(a)||O(Ab(this,a))).m[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};l.N=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var e=a.getAttribute("class");if(e){e=e.split(/\s/);for(var d=0;d<e.length;d++)if(e[d]===K.a){c=e[d+1];break}}}c&&b.push(K.a,c);v||(c=O(a))&&c.h&&b.push(U.a,c.h);E(a,b.join(" "))};l.G=function(a){return O(a)};X.prototype.flush=X.prototype.F; | ||
function T(a,b,c){b&&(b=0<=b.indexOf(";")?ob(a,b,c):Ca(b,function(b,d,f,h){if(!d)return b+h;(d=T(a,c[d],c))&&"initial"!==d?"apply-shim-inherit"===d&&(d="inherit"):d=T(a,c[f]||f,c)||f;return b+(d||"")+h}));return b&&b.trim()||""} | ||
function ob(a,b,c){b=b.split(";");for(var e=0,d,f;e<b.length;e++)if(d=b[e]){y.lastIndex=0;if(f=y.exec(d))d=T(a,c[f[1]],c);else if(f=d.indexOf(":"),-1!==f){var h=d.substring(f);h=h.trim();h=T(a,h,c)||h;d=d.substring(0,f)+h}b[e]=d&&d.lastIndexOf(";")===d.length-1?d.slice(0,-1):d||""}return b.join(";")} | ||
function pb(a,b){var c={},e=[];A(a,function(a){a.f||R(a);var d=a.g||a.parsedSelector;b&&a.f.i&&d&&kb.call(b,d)&&(S(a,c),a=a.index,d=parseInt(a/32,10),e[d]=(e[d]||0)|1<<a%32)},null,!0);return{i:c,key:e}} | ||
function qb(a,b,c,e,d){c.f||R(c);if(c.f.i){b=F(b);a=b.is;b=b.u;b=a?M(a,b):"html";var f=c.parsedSelector,h=":host > *"===f||"html"===f,g=0===f.indexOf(":host")&&!h;"shady"===e&&(h=f===b+" > *."+b||-1!==f.indexOf("html"),g=!h&&0===f.indexOf(b));"shadow"===e&&(h=":host > *"===f||"html"===f,g=g&&!h);if(h||g)e=b,g&&(t&&!c.g&&(c.g=Ka(K,c,K.b,a?Ja+a:"",b)),e=c.g||b),d({M:e,K:g,S:h})}} | ||
function rb(a,b){var c={},e={},d=U,f=b&&b.__cssBuild;A(b,function(b){qb(d,a,b,f,function(d){kb.call(a.A||a,d.M)&&(d.K?S(b,c):S(b,e))})},null,!0);return{L:e,J:c}} | ||
function sb(a,b,c,e){var d=F(b),f=M(d.is,d.u),h=new RegExp("(?:^|[^.#[:])"+(b.extends?"\\"+f.slice(0,-1)+"\\]":f)+"($|[.:[\\s>+~])");d=O(b).j;var g=tb(d,e);return L(b,d,function(b){var d="";b.f||R(b);b.f.cssText&&(d=ob(a,b.f.cssText,c));b.cssText=d;if(!t&&!Aa(b)&&b.cssText){var k=d=b.cssText;null==b.C&&(b.C=wa.test(d));if(b.C)if(null==b.w){b.w=[];for(var q in g)k=g[q],k=k(d),d!==k&&(d=k,b.w.push(q))}else{for(q=0;q<b.w.length;++q)k=g[b.w[q]],d=k(d);k=d}b.cssText=k;b.g=b.g||b.selector;d="."+e;q=b.g.split(","); | ||
k=0;for(var zb=q.length,P;k<zb&&(P=q[k]);k++)q[k]=P.match(h)?P.replace(f,d):d+" "+P;b.selector=q.join(",")}})}function tb(a,b){a=a.b;var c={};if(!t&&a)for(var e=0,d=a[e];e<a.length;d=a[++e]){var f=d,h=b;f.l=new RegExp(f.keyframesName,"g");f.a=f.keyframesName+"-"+h;f.g=f.g||f.selector;f.selector=f.g.replace(f.keyframesName,f.a);c[d.keyframesName]=ub(d)}return c}function ub(a){return function(b){return b.replace(a.l,a.a)}} | ||
function vb(a,b){var c=U,e=B(a);a.textContent=z(e,function(a){var d=a.cssText=a.parsedCssText;a.f&&a.f.cssText&&(d=d.replace(ma,"").replace(na,""),a.cssText=ob(c,d,b))})}aa.Object.defineProperties(mb.prototype,{a:{configurable:!0,enumerable:!0,get:function(){return"x-scope"}}});var U=new mb;var wb={},V=window.customElements;if(V&&!t){var xb=V.define;V.define=function(a,b,c){var e=document.createComment(" Shady DOM styles for "+a+" "),d=document.head;d.insertBefore(e,(D?D.nextSibling:null)||d.firstChild);D=e;wb[a]=e;return xb.call(V,a,b,c)}};var W=new function(){this.cache={};this.a=100};function X(){var a=this;this.A={};this.c=document.documentElement;var b=new n;b.rules=[];this.l=jb(this.c,new N(b));this.v=!1;this.b=this.a=null;Ea(function(){Y(a)})}l=X.prototype;l.F=function(){ib()};l.I=function(a){return B(a)};l.O=function(a){return z(a)}; | ||
l.prepareTemplate=function(a,b,c){if(!a.l){a.l=!0;a.name=b;a.extends=c;m[b]=a;var e=(e=a.content.querySelector("style"))?e.getAttribute("css-build")||"":"";var d=[];for(var f=a.content.querySelectorAll("style"),h=0;h<f.length;h++){var g=f[h];if(g.hasAttribute("shady-unscoped")){if(!t){var k=g.textContent;za.has(k)||(za.add(k),k=g.cloneNode(!0),document.head.appendChild(k));g.parentNode.removeChild(g)}}else d.push(g.textContent),g.parentNode.removeChild(g)}d=d.join("").trim();c={is:b,extends:c,P:e}; | ||
t||J(a.content,b);Y(this);f=y.test(d)||w.test(d);y.lastIndex=0;w.lastIndex=0;d=p(d);f&&v&&this.a&&this.a.transformRules(d,b);a._styleAst=d;a.v=e;e=[];v||(e=nb(a._styleAst));if(!e.length||v)d=t?a.content:null,b=wb[b],f=L(c,a._styleAst),b=f.length?C(f,c.is,d,b):void 0,a.a=b;a.c=e}}; | ||
function yb(a){!a.b&&window.ShadyCSS&&window.ShadyCSS.CustomStyleInterface&&(a.b=window.ShadyCSS.CustomStyleInterface,a.b.transformCallback=function(b){a.D(b)},a.b.validateCallback=function(){requestAnimationFrame(function(){(a.b.enqueued||a.v)&&a.o()})})}function Y(a){!a.a&&window.ShadyCSS&&window.ShadyCSS.ApplyShim&&(a.a=window.ShadyCSS.ApplyShim,a.a.invalidCallback=ra);yb(a)} | ||
l.o=function(){Y(this);if(this.b){var a=this.b.processStyles();if(this.b.enqueued){if(v)for(var b=0;b<a.length;b++){var c=this.b.getStyleForCustomStyle(a[b]);if(c&&v&&this.a){var e=B(c);Y(this);this.a.transformRules(e);c.textContent=z(e)}}else for(Ab(this,this.c,this.l),b=0;b<a.length;b++)(c=this.b.getStyleForCustomStyle(a[b]))&&vb(c,this.l.m);this.b.enqueued=!1;this.v&&!v&&this.styleDocument()}}}; | ||
l.styleElement=function(a,b){var c=F(a).is,e=O(a);if(!e){var d=F(a);e=d.is;d=d.u;var f=wb[e];e=m[e];if(e){var h=e._styleAst;var g=e.c}e=jb(a,new N(h,f,g,0,d))}a!==this.c&&(this.v=!0);b&&(e.s=e.s||{},Object.assign(e.s,b));if(v){if(e.s){b=e.s;for(var k in b)null===k?a.style.removeProperty(k):a.style.setProperty(k,b[k])}if(((k=m[c])||a===this.c)&&k&&k.a&&!sa(k)){if(sa(k)||k._applyShimValidatingVersion!==k._applyShimNextVersion)Y(this),this.a&&this.a.transformRules(k._styleAst,c),k.a.textContent=L(a, | ||
e.j),ta(k);t&&(c=a.shadowRoot)&&(c.querySelector("style").textContent=L(a,e.j));e.j=k._styleAst}}else if(Ab(this,a,e),e.B&&e.B.length){c=e;k=F(a).is;a:{if(b=W.cache[k])for(h=b.length-1;0<=h;h--){g=b[h];b:{e=c.B;for(d=0;d<e.length;d++)if(f=e[d],g.i[f]!==c.m[f]){e=!1;break b}e=!0}if(e){b=g;break a}}b=void 0}e=b?b.styleElement:null;h=c.h;(g=b&&b.h)||(g=this.A[k]=(this.A[k]||0)+1,g=k+"-"+g);c.h=g;g=c.h;d=U;d=e?e.textContent||"":sb(d,a,c.m,g);f=O(a);var x=f.a;x&&!t&&x!==e&&(x._useCount--,0>=x._useCount&& | ||
x.parentNode&&x.parentNode.removeChild(x));t?f.a?(f.a.textContent=d,e=f.a):d&&(e=C(d,g,a.shadowRoot,f.b)):e?e.parentNode||(lb&&-1<d.indexOf("@media")&&(e.textContent=d),Ba(e,null,f.b)):d&&(e=C(d,g,null,f.b));e&&(e._useCount=e._useCount||0,f.a!=e&&e._useCount++,f.a=e);g=e;t||(e=c.h,f=d=a.getAttribute("class")||"",h&&(f=d.replace(new RegExp("\\s*x-scope\\s*"+h+"\\s*","g")," ")),f+=(f?" ":"")+"x-scope "+e,d!==f&&E(a,f));b||(a=W.cache[k]||[],a.push({i:c.m,styleElement:g,h:c.h}),a.length>W.a&&a.shift(), | ||
W.cache[k]=a)}};function Bb(a,b){return(b=b.getRootNode().host)?O(b)?b:Bb(a,b):a.c}function Ab(a,b,c){a=Bb(a,b);var e=O(a);a=Object.create(e.m||null);var d=rb(b,c.j);b=pb(e.j,b).i;Object.assign(a,d.J,b,d.L);b=c.s;for(var f in b)if((d=b[f])||0===d)a[f]=d;f=U;b=Object.getOwnPropertyNames(a);for(d=0;d<b.length;d++)e=b[d],a[e]=T(f,a[e],a);c.m=a}l.styleDocument=function(a){this.styleSubtree(this.c,a)}; | ||
l.styleSubtree=function(a,b){var c=a.shadowRoot;(c||a===this.c)&&this.styleElement(a,b);if(b=c&&(c.children||c.childNodes))for(a=0;a<b.length;a++)this.styleSubtree(b[a]);else if(a=a.children||a.childNodes)for(b=0;b<a.length;b++)this.styleSubtree(a[b])};l.D=function(a){var b=this,c=B(a);A(c,function(a){if(t)ab(a);else{var c=K;a.selector=a.parsedSelector;ab(a);a.selector=a.g=Ka(c,a,c.c,void 0,void 0)}v&&(Y(b),b.a&&b.a.transformRule(a))});v?a.textContent=z(c):this.l.j.rules.push(c)}; | ||
l.getComputedStyleValue=function(a,b){var c;v||(c=(O(a)||O(Bb(this,a))).m[b]);return(c=c||window.getComputedStyle(a).getPropertyValue(b))?c.trim():""};l.N=function(a,b){var c=a.getRootNode();b=b?b.split(/\s/):[];c=c.host&&c.host.localName;if(!c){var e=a.getAttribute("class");if(e){e=e.split(/\s/);for(var d=0;d<e.length;d++)if(e[d]===K.a){c=e[d+1];break}}}c&&b.push(K.a,c);v||(c=O(a))&&c.h&&b.push(U.a,c.h);E(a,b.join(" "))};l.G=function(a){return O(a)};X.prototype.flush=X.prototype.F; | ||
X.prototype.prepareTemplate=X.prototype.prepareTemplate;X.prototype.styleElement=X.prototype.styleElement;X.prototype.styleDocument=X.prototype.styleDocument;X.prototype.styleSubtree=X.prototype.styleSubtree;X.prototype.getComputedStyleValue=X.prototype.getComputedStyleValue;X.prototype.setElementClass=X.prototype.N;X.prototype._styleInfoForNode=X.prototype.G;X.prototype.transformCustomStyleForDocument=X.prototype.D;X.prototype.getStyleAst=X.prototype.I;X.prototype.styleAstToString=X.prototype.O; | ||
X.prototype.flushCustomStyles=X.prototype.o;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return t}},nativeCss:{get:function(){return v}}});var Z=new X,Bb,Cb;window.ShadyCSS&&(Bb=window.ShadyCSS.ApplyShim,Cb=window.ShadyCSS.CustomStyleInterface);window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.o();Z.prepareTemplate(a,b,c)},styleSubtree:function(a,b){Z.o();Z.styleSubtree(a,b)},styleElement:function(a){Z.o();Z.styleElement(a)},styleDocument:function(a){Z.o();Z.styleDocument(a)},getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:v,nativeShadow:t};Bb&&(window.ShadyCSS.ApplyShim=Bb); | ||
Cb&&(window.ShadyCSS.CustomStyleInterface=Cb);}).call(this); | ||
X.prototype.flushCustomStyles=X.prototype.o;Object.defineProperties(X.prototype,{nativeShadow:{get:function(){return t}},nativeCss:{get:function(){return v}}});var Z=new X,Cb,Db;window.ShadyCSS&&(Cb=window.ShadyCSS.ApplyShim,Db=window.ShadyCSS.CustomStyleInterface);window.ShadyCSS={ScopingShim:Z,prepareTemplate:function(a,b,c){Z.o();Z.prepareTemplate(a,b,c)},styleSubtree:function(a,b){Z.o();Z.styleSubtree(a,b)},styleElement:function(a){Z.o();Z.styleElement(a)},styleDocument:function(a){Z.o();Z.styleDocument(a)},getComputedStyleValue:function(a,b){return Z.getComputedStyleValue(a,b)},nativeCss:v,nativeShadow:t};Cb&&(window.ShadyCSS.ApplyShim=Cb); | ||
Db&&(window.ShadyCSS.CustomStyleInterface=Db);}).call(this); | ||
//# sourceMappingURL=scoping-shim.min.js.map |
@@ -74,3 +74,3 @@ /** | ||
import {forEachRule, processVariableAndFallback, rulesForStyle, toCssText} from './style-util.js'; | ||
import {forEachRule, processVariableAndFallback, rulesForStyle, toCssText, gatherStyleText} from './style-util.js'; | ||
import {MIXIN_MATCH, VAR_ASSIGN} from './common-regex.js'; | ||
@@ -155,4 +155,20 @@ import {detectMixin} from './common-utils.js'; | ||
} | ||
/** | ||
* Gather styles into one style for easier processing | ||
* @param {!HTMLTemplateElement} template | ||
* @return {HTMLStyleElement} | ||
*/ | ||
gatherStyles(template) { | ||
const styleText = gatherStyleText(template.content); | ||
if (styleText) { | ||
const style = /** @type {!HTMLStyleElement} */(document.createElement('style')); | ||
style.textContent = styleText; | ||
template.content.insertBefore(style, template.content.firstChild); | ||
return style; | ||
} | ||
return null; | ||
} | ||
/** | ||
* @param {!HTMLTemplateElement} template | ||
* @param {string} elementName | ||
@@ -162,9 +178,8 @@ * @return {StyleNode} | ||
transformTemplate(template, elementName) { | ||
const style = /** @type {HTMLStyleElement} */(template.content.querySelector('style')); | ||
/** @type {StyleNode} */ | ||
let ast = null; | ||
if (style) { | ||
ast = this.transformStyle(style, elementName); | ||
if (template._gatheredStyle === undefined) { | ||
template._gatheredStyle = this.gatherStyles(template); | ||
} | ||
return ast; | ||
/** @type {HTMLStyleElement} */ | ||
const style = template._gatheredStyle; | ||
return style ? this.transformStyle(style, elementName) : null; | ||
} | ||
@@ -171,0 +186,0 @@ /** |
@@ -62,10 +62,3 @@ /** | ||
_gatherStyles(template) { | ||
let styles = template.content.querySelectorAll('style'); | ||
let cssText = []; | ||
for (let i = 0; i < styles.length; i++) { | ||
let s = styles[i]; | ||
cssText.push(s.textContent); | ||
s.parentNode.removeChild(s); | ||
} | ||
return cssText.join('').trim(); | ||
return StyleUtil.gatherStyleText(template.content); | ||
} | ||
@@ -72,0 +65,0 @@ _getCssBuild(template) { |
@@ -16,2 +16,3 @@ /** | ||
import {MEDIA_MATCH} from './common-regex.js'; | ||
import {processUnscopedStyle, isUnscopedStyle} from './unscoped-style-handler.js'; | ||
@@ -272,1 +273,24 @@ /** | ||
} | ||
/** | ||
* @param {Element|DocumentFragment} element | ||
* @return {string} | ||
*/ | ||
export function gatherStyleText(element) { | ||
/** @type {!Array<string>} */ | ||
const styleTextParts = []; | ||
const styles = /** @type {!NodeList<!HTMLStyleElement>} */(element.querySelectorAll('style')); | ||
for (let i = 0; i < styles.length; i++) { | ||
const style = styles[i]; | ||
if (isUnscopedStyle(style)) { | ||
if (!nativeShadow) { | ||
processUnscopedStyle(style); | ||
style.parentNode.removeChild(style); | ||
} | ||
} else { | ||
styleTextParts.push(style.textContent); | ||
style.parentNode.removeChild(style); | ||
} | ||
} | ||
return styleTextParts.join('').trim(); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
527712
4053