diff --git a/entrypoints/webcomponents-hi-ce-index.js b/entrypoints/webcomponents-hi-ce-index.js
index 4111b23..98c6c39 100644
--- a/entrypoints/webcomponents-hi-ce-index.js
+++ b/entrypoints/webcomponents-hi-ce-index.js
@@ -17,10 +17,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
import '../bower_components/html-imports/src/html-imports.js'
import '../bower_components/custom-elements/custom-elements.min.js'
-// TODO(notwaldorf): Remove after this is addressed:
-// https://github.com/webcomponents/shadycss/issues/46
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
-
import '../src/post-polyfill.js'
import '../src/unresolved.js'
diff --git a/entrypoints/webcomponents-hi-index.js b/entrypoints/webcomponents-hi-index.js
index 849e253..d02073c 100644
--- a/entrypoints/webcomponents-hi-index.js
+++ b/entrypoints/webcomponents-hi-index.js
@@ -16,10 +16,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
import '../bower_components/html-imports/src/html-imports.js'
-// TODO(notwaldorf): Remove after this is addressed:
-// https://github.com/webcomponents/shadycss/issues/46
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
-
import '../src/post-polyfill.js'
import '../src/unresolved.js'
diff --git a/entrypoints/webcomponents-hi-sd-ce-index.js b/entrypoints/webcomponents-hi-sd-ce-index.js
index 47eca9b..df3780f 100644
--- a/entrypoints/webcomponents-hi-sd-ce-index.js
+++ b/entrypoints/webcomponents-hi-sd-ce-index.js
@@ -17,7 +17,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
import '../bower_components/html-imports/src/html-imports.js'
import '../bower_components/shadydom/shadydom.min.js'
import '../bower_components/custom-elements/custom-elements.min.js'
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
+import '../bower_components/shadycss/entrypoints/scoping-shim.js'
import '../src/post-polyfill.js'
import '../src/unresolved.js'
diff --git a/entrypoints/webcomponents-hi-sd-ce-pf-index.js b/entrypoints/webcomponents-hi-sd-ce-pf-index.js
index 7d30bf8..4d15b57 100644
--- a/entrypoints/webcomponents-hi-sd-ce-pf-index.js
+++ b/entrypoints/webcomponents-hi-sd-ce-pf-index.js
@@ -22,7 +22,6 @@ import '../bower_components/html-imports/src/html-imports.js'
import '../src/pre-polyfill.js'
import '../bower_components/shadydom/shadydom.min.js'
import '../bower_components/custom-elements/custom-elements.min.js'
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
+import '../bower_components/shadycss/entrypoints/scoping-shim.js'
import '../src/post-polyfill.js'
import '../src/unresolved.js'
diff --git a/entrypoints/webcomponents-none-index.js b/entrypoints/webcomponents-none-index.js
deleted file mode 100644
index ac57b88..0000000
--- a/entrypoints/webcomponents-none-index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
-@license
-Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
-This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
-The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
-The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
-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';
-
-/*
- * Polyfills loaded: None
- * Used in: Chrome
- */
-
-// TODO: This needs to not exist at all.
-
-// TODO(notwaldorf): Remove after this is addressed:
-// https://github.com/webcomponents/shadycss/issues/46
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
\ No newline at end of file
diff --git a/entrypoints/webcomponents-sd-ce-index.js b/entrypoints/webcomponents-sd-ce-index.js
index e57b264..dc4b357 100644
--- a/entrypoints/webcomponents-sd-ce-index.js
+++ b/entrypoints/webcomponents-sd-ce-index.js
@@ -16,5 +16,4 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
import '../bower_components/shadydom/shadydom.min.js'
import '../bower_components/custom-elements/custom-elements.min.js'
-import '../bower_components/shadycss/src/ShadyCSS.js'
-import '../bower_components/shadycss/src/custom-style-element.js'
+import '../bower_components/shadycss/entrypoints/scoping-shim.js'
diff --git a/gulpfile.js b/gulpfile.js
index b243f2e..9d7723f 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -63,10 +63,6 @@ function minify(sourceName, fileName, needsContext) {
.pipe(gulp.dest('./'))
}
-gulp.task('minify-none', () => {
- return minify('webcomponents-none')
-});
-
gulp.task('minify-hi', () => {
return minify('webcomponents-hi')
});
@@ -100,4 +96,4 @@ gulp.task('default', (cb) => {
runseq('refresh-bower', 'build', cb);
});
-gulp.task('build', ['minify-none', 'minify-hi', 'minify-hi-ce', 'minify-hi-sd-ce', 'minify-hi-sd-ce-pf', 'minify-sd-ce']);
+gulp.task('build', ['minify-hi', 'minify-hi-ce', 'minify-hi-sd-ce', 'minify-hi-sd-ce-pf', 'minify-sd-ce']);
diff --git a/tests/imports/simple-element.html b/tests/imports/simple-element.html
index 8384ce8..41d3dbb 100644
--- a/tests/imports/simple-element.html
+++ b/tests/imports/simple-element.html
@@ -18,14 +18,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
`;
if (template) {
- window.ShadyCSS.prepareTemplate(template, 'simple-element');
+ if (window.ShadyCSS) {
+ window.ShadyCSS.prepareTemplate(template, 'simple-element');
+ }
}
class SimpleElement extends HTMLElement {
constructor() {
super();
this.bestName = 'batman';
- window.ShadyCSS.applyStyle(this);
+ if (window.ShadyCSS) {
+ window.ShadyCSS.styleElement(this);
+ }
if (template && !this.shadowRoot) {
this.attachShadow({mode: 'open'});
diff --git a/webcomponents-hi-ce.js b/webcomponents-hi-ce.js
index 6197353..50724b8 100644
--- a/webcomponents-hi-ce.js
+++ b/webcomponents-hi-ce.js
@@ -1,6 +1,6 @@
-(function(){'use strict';function _(Ot){return Ot=$(Ot),te(ee(Ot),Ot)}function $(Ot){return Ot.replace(Re.comments,'').replace(Re.port,'')}function ee(Ot){let Pt={start:0,end:Ot.length},Lt=Pt;for(let wt=0,kt=Ot.length;wt{'complete'===document.readyState&&Ae()}))}function Ae(){requestAnimationFrame(()=>{(Tt||xt._elementsHaveApplied)&&xt.updateStyles(),Tt=!1})}(Ot=>{const Pt=!!('import'in document.createElement('link'));let Lt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return Lt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const wt=/(^\/)|(^#)|(^[\w-\d]*:)/,kt=/(url\()([^)]*)(\))/g,Dt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Ht=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Ut={fixUrls(or,nr){or.href&&or.setAttribute('href',Ut.replaceAttrUrl(or.getAttribute('href'),nr)),or.src&&or.setAttribute('src',Ut.replaceAttrUrl(or.getAttribute('src'),nr)),'style'===or.localName&&Ut.resolveUrlsInStyle(or,nr)},fixUrlAttributes(or,nr){const lr=['action','src','href','url','style'];for(let ar,sr=0;srpr.search(/({{|\[\[)/)&&(ir.value='style'===ar?Ut.resolveUrlsInCssText(pr,nr):Ut.replaceAttrUrl(pr,nr))}},fixUrlsInTemplates(or,nr){const lr=or.querySelectorAll('template');for(let sr=0;sr{let dr=ir.replace(/["']/g,'');return nr&&(dr=Ut.resolveUrl(dr,nr)),ar+'\''+dr+'\''+pr})},replaceAttrUrl(or,nr){return or&&wt.test(or)?or:Ut.resolveUrl(or,nr)},resolveUrl(or,nr){if(void 0===Ut.__workingURL){Ut.__workingURL=!1;try{const sr=new URL('b','http://a');sr.pathname='c%20d',Ut.__workingURL='http://a/c%20d'===sr.href}catch(sr){}}if(Ut.__workingURL)return new URL(or,nr).href;let lr=Ut.__tempDoc;return lr||(lr=document.implementation.createHTMLDocument('temp'),Ut.__tempDoc=lr,lr.__base=lr.createElement('base'),lr.head.appendChild(lr.__base),lr.__anchor=lr.createElement('a')),lr.__base.href=nr,lr.__anchor.href=or,lr.__anchor.href||or}},Ft={async:!0,load(or,nr,lr){if(!or)lr('error: href must be specified');else if(or.match(/^data:/)){const sr=or.split(','),ar=sr[0];let ir=sr[1];ir=-1{let ar=sr.getResponseHeader('Location');if(ar&&0===ar.indexOf('/')){const pr=location.origin||location.protocol+'//'+location.host;ar=pr+ar}const ir=sr.response||sr.responseText;304===sr.status||0===sr.status||200<=sr.status&&300>sr.status?nr(ir,ar):lr(ir)},sr.send()}}},jt=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),qt='link[rel=import]',Bt='import-disable',Kt=`link[rel=stylesheet][href][type=${Bt}]`,Xt=`${qt}, ${Kt},
+(function(){'use strict';(o=>{const $=!!('import'in document.createElement('link'));let _=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return _||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const wa=/(^\/)|(^#)|(^[\w-\d]*:)/,xa=/(url\()([^)]*)(\))/g,ya=/(@import[\s]+(?!url\())([^;]*)(;)/g,za=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Aa={fixUrls(Ta,Ua){Ta.href&&Ta.setAttribute('href',Aa.replaceAttrUrl(Ta.getAttribute('href'),Ua)),Ta.src&&Ta.setAttribute('src',Aa.replaceAttrUrl(Ta.getAttribute('src'),Ua)),'style'===Ta.localName&&Aa.resolveUrlsInStyle(Ta,Ua)},fixUrlAttributes(Ta,Ua){const Va=['action','src','href','url','style'];for(let Xa,Wa=0;WaZa.search(/({{|\[\[)/)&&(Ya.value='style'===Xa?Aa.resolveUrlsInCssText(Za,Ua):Aa.replaceAttrUrl(Za,Ua))}},fixUrlsInTemplates(Ta,Ua){const Va=Ta.querySelectorAll('template');for(let Wa=0;Wa{let $a=Ya.replace(/["']/g,'');return Ua&&($a=Aa.resolveUrl($a,Ua)),Xa+'\''+$a+'\''+Za})},replaceAttrUrl(Ta,Ua){return Ta&&wa.test(Ta)?Ta:Aa.resolveUrl(Ta,Ua)},resolveUrl(Ta,Ua){if(void 0===Aa.__workingURL){Aa.__workingURL=!1;try{const Wa=new URL('b','http://a');Wa.pathname='c%20d',Aa.__workingURL='http://a/c%20d'===Wa.href}catch(Wa){}}if(Aa.__workingURL)return new URL(Ta,Ua).href;let Va=Aa.__tempDoc;return Va||(Va=document.implementation.createHTMLDocument('temp'),Aa.__tempDoc=Va,Va.__base=Va.createElement('base'),Va.head.appendChild(Va.__base),Va.__anchor=Va.createElement('a')),Va.__base.href=Ua,Va.__anchor.href=Ta,Va.__anchor.href||Ta}},Ba={async:!0,load(Ta,Ua,Va){if(!Ta)Va('error: href must be specified');else if(Ta.match(/^data:/)){const Wa=Ta.split(','),Xa=Wa[0];let Ya=Wa[1];Ya=-1{let Xa=Wa.getResponseHeader('Location');if(Xa&&0===Xa.indexOf('/')){const Za=location.origin||location.protocol+'//'+location.host;Xa=Za+Xa}const Ya=Wa.response||Wa.responseText;304===Wa.status||0===Wa.status||200<=Wa.status&&300>Wa.status?Ua(Ya,Xa):Va(Ya)},Wa.send()}}},Ca=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),Da='link[rel=import]',Ea='import-disable',Fa=`link[rel=stylesheet][href][type=${Ea}]`,Ga=`${Da}, ${Fa},
style:not([type]), link[rel=stylesheet][href]:not([type]),
script:not([type]), script[type="application/javascript"],
- script[type="text/javascript"]`,Wt='import-dependency',Vt=`${qt}:not(${Wt})`,Gt=`script[${Wt}]`,Yt=`style[${Wt}],
- link[rel=stylesheet][${Wt}]`;const $t=or=>{return or.nodeType===Node.ELEMENT_NODE&&'link'===or.localName&&'import'===or.rel},Jt=(or,nr)=>{if(or.__loaded)nr&&nr();else if('script'===or.localName&&!or.src)or.__loaded=!0,nr&&nr();else{const lr=sr=>{or.removeEventListener(sr.type,lr),or.__loaded=!0,nr&&nr()};or.addEventListener('load',lr),jt&&'style'===or.localName||or.addEventListener('error',lr)}},Zt=or=>{Qt(()=>er(()=>or&&or()))},Qt=or=>{if('loading'!==document.readyState)or();else{const nr=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',nr),or())};document.addEventListener('readystatechange',nr)}},er=or=>{let nr=document.querySelectorAll(Vt),lr=nr.length;if(!lr)return void or();for(let ir,sr=0,ar=nr.length;sr{0==--lr&&or()})},tr=or=>{if(Pt)return or.ownerDocument===document?null:or.ownerDocument;let nr=or.__importDoc;if(!nr&&or.parentNode){if(nr=or.parentNode,'function'==typeof nr.closest)nr=nr.closest(qt);else for(;!$t(nr)&&(nr=nr.parentNode););or.__importDoc=nr}return nr},rr=(or,nr)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(or,nr);const lr=document.createEvent('CustomEvent');return lr.initCustomEvent(or,!!nr.bubbles,!!nr.cancelable,nr.detail),lr};if(Pt){const or=document.querySelectorAll(qt);for(let ar,lr=0,sr=or.length;lr{const sr=lr.target;$t(sr)&&(sr.__loaded=!0)};document.addEventListener('load',nr,!0),document.addEventListener('error',nr,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(or=>this.handleMutations(or)),Qt(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(or){const nr=or.querySelectorAll(qt);for(let lr=0,sr=nr.length;lr{const ar=this.makeDocument(lr,sr||nr);this.documents[nr]=ar,this.inflight--,this.loadImports(ar),this.processImportsIfLoadingDone()},()=>{this.documents[nr]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(or,nr){if(!or)return document.createDocumentFragment();jt&&(or=or.replace(Ht,(dr,cr,mr)=>{return-1===dr.indexOf('type=')?`${cr} type=${Bt} ${mr}`:dr}));let lr;const sr=document.createElement('template');if(sr.innerHTML=or,sr.content)lr=sr.content;else for(lr=document.createDocumentFragment();sr.firstChild;)lr.appendChild(sr.firstChild);const ar=lr.querySelector('base');ar&&(nr=Ut.replaceAttrUrl(ar.getAttribute('href'),nr),ar.removeAttribute('href'));const ir=lr.querySelectorAll(Xt);let pr=0;for(let mr,dr=0,cr=ir.length;dr{nr&&or&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{nr=!0,lr()}),this.runScripts(()=>{or=!0,lr()})}}flatten(or){const nr=or.querySelectorAll(qt);for(let ar,lr=0,sr=nr.length;lrar.href,configurable:!0,enumerable:!0}),this.flatten(ir),ar.appendChild(ir))}}runScripts(or){const nr=document.querySelectorAll(Gt),lr=nr.length,sr=ar=>{if(ar{Lt=null,sr(ar+1)})}else or()};sr(0)}waitForStyles(or){const nr=document.querySelectorAll(Yt);let lr=nr.length;if(!lr)return void or();const sr=jt&&!!document.querySelector(Kt);for(let pr,ar=0,ir=nr.length;ar{pr.removeAttribute(Wt),0==--lr&&or()}),sr&&pr.parentNode!==document.head){const dr=document.createElement(pr.localName);dr.__appliedElement=pr,dr.setAttribute('type','import-placeholder'),pr.parentNode.insertBefore(dr,pr.nextSibling);let cr=tr(pr);for(;cr&&tr(cr);)cr=tr(cr);cr.parentNode!==document.head&&(cr=null),document.head.insertBefore(pr,cr),pr.removeAttribute('type')}}fireEvents(){const or=document.querySelectorAll(qt);for(let lr,nr=or.length-1;0<=nr&&(lr=or[nr]);nr--)this.fireEventIfNeeded(lr)}fireEventIfNeeded(or){if(!or.__loaded){or.__loaded=!0,or.import&&(or.import.readyState='complete');const nr=or.import?'load':'error';or.dispatchEvent(rr(nr,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(or){for(let nr=0;nrdocument.dispatchEvent(rr('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),Ot.useNative=Pt,Ot.whenReady=Zt,Ot.importForElement=tr})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function Ot(Dr){var Hr=or.has(Dr);return Dr=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(Dr),!Hr&&Dr}function Pt(Dr){var Hr=Dr.isConnected;if(void 0!==Hr)return Hr;for(;Dr&&!(Dr.__CE_isImportDocument||Dr instanceof Document);)Dr=Dr.parentNode||(window.ShadowRoot&&Dr instanceof ShadowRoot?Dr.host:void 0);return Dr&&(Dr.__CE_isImportDocument||Dr instanceof Document)}function Lt(Dr,Hr){for(;Hr&&Hr!==Dr&&!Hr.nextSibling;)Hr=Hr.parentNode;return Hr&&Hr!==Dr?Hr.nextSibling:null}function wt(Dr,Hr,Ur){Ur=Ur?Ur:new Set;for(var Fr=Dr;Fr;){if(Fr.nodeType===Node.ELEMENT_NODE){var jr=Fr;Hr(jr);var qr=jr.localName;if('link'===qr&&'import'===jr.getAttribute('rel')){if(Fr=jr.import,Fr instanceof Node&&!Ur.has(Fr))for(Ur.add(Fr),Fr=Fr.firstChild;Fr;Fr=Fr.nextSibling)wt(Fr,Hr,Ur);Fr=Lt(Dr,jr);continue}else if('template'===qr){Fr=Lt(Dr,jr);continue}if(jr=jr.__CE_shadowRoot)for(jr=jr.firstChild;jr;jr=jr.nextSibling)wt(jr,Hr,Ur)}Fr=Fr.firstChild?Fr.firstChild:Lt(Dr,Fr)}}function kt(Dr,Hr,Ur){Dr[Hr]=Ur}function Dt(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function Ht(Dr,Hr,Ur){Dr.a.set(Hr,Ur),Dr.f.set(Ur.constructor,Ur)}function Ut(Dr,Hr){Dr.b=!0,Dr.c.push(Hr)}function Ft(Dr,Hr){Dr.b&&wt(Hr,function(Ur){return jt(Dr,Ur)})}function jt(Dr,Hr){if(Dr.b&&!Hr.__CE_patched){Hr.__CE_patched=!0;for(var Ur=0;Ur+~])'};const He='style-scope';class Ue{get SCOPE_NAME(){return He}dom(Ot,Pt,Lt){Ot.__styleScoped?Ot.__styleScoped=null:this._transformDom(Ot,Pt||'',Lt)}_transformDom(Ot,Pt,Lt){Ot.nodeType===Node.ELEMENT_NODE&&this.element(Ot,Pt,Lt);let wt='template'===Ot.localName?(Ot.content||Ot._content).childNodes:Ot.children||Ot.childNodes;if(wt)for(let kt=0;kt`:${Dt}(${Ht.replace(/\s/g,'')})`),Ot=Ot.replace(Ge,`${Xe} $1`),Ot=Ot.replace(Be,(kt,Dt,Ht)=>{if(!wt){let Ut=this._transformCompoundSelector(Ht,Dt,Pt,Lt);wt=wt||Ut.stop,Dt=Ut.combinator,Ht=Ut.value}return Dt+Ht}),Ot}_transformCompoundSelector(Ot,Pt,Lt,wt){let kt=Ot.indexOf(Ve);0<=Ot.indexOf(Xe)?Ot=this._transformHostSelector(Ot,wt):0!==kt&&(Ot=Lt?this._transformSimpleSelector(Ot,Lt):Ot);let Dt=!1;0<=kt&&(Pt='',Dt=!0);let Ht;return Dt&&(Ht=!0,Dt&&(Ot=Ot.replace(ze,(Ut,Ft)=>` > ${Ft}`))),Ot=Ot.replace($e,(Ut,Ft,jt)=>`[dir="${jt}"] ${Ft}, ${Ft}[dir="${jt}"]`),{value:Ot,combinator:Pt,stop:Ht}}_transformSimpleSelector(Ot,Pt){let Lt=Ot.split(Ze);return Lt[0]+=Pt,Lt.join(Ze)}_transformHostSelector(Ot,Pt){let Lt=Ot.match(Ye),wt=Lt&&Lt[2].trim()||'';if(wt){if(!wt[0].match(Ke)){let kt=wt.split(Ke)[0];return kt===Pt?wt:et}return Ot.replace(Ye,function(kt,Dt,Ht){return Pt+Ht})}return Ot.replace(Xe,Pt)}documentRule(Ot){Ot.selector=Ot.parsedSelector,this.normalizeRootSelector(Ot),this._transformRule(Ot,this._transformDocumentSelector)}normalizeRootSelector(Ot){Ot.selector===We&&(Ot.selector='html')}_transformDocumentSelector(Ot){return Ot.match(Ve)?this._transformComplexSelector(Ot,je):this._transformSimpleSelector(Ot.trim(),je)}}let Fe=/:(nth[-\w]+)\(([^)]+)\)/,je=`:not(.${He})`,qe=',',Be=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,Ke=/[[.:#*]/,Xe=':host',We=':root',Ve='::slotted',Ge=/^(::slotted)/,Ye=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,ze=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,$e=/(.*):dir\((?:(ltr|rtl))\)/,Je='.',Ze=':',Qe='class',et='should_not_match';var tt=new Ue,rt={};const ot=Promise.resolve();class nt{static get(Ot){return Ot.__styleInfo}static set(Ot,Pt){return Ot.__styleInfo=Pt,Pt}static invalidate(Ot){rt[Ot]&&(rt[Ot]._applyShimInvalid=!0)}static startValidating(Ot){const Pt=rt[Ot];Pt._validating||(Pt._validating=!0,ot.then(()=>{Pt._applyShimInvalid=!1,Pt._validating=!1}))}constructor(Ot,Pt,Lt,wt,kt,Dt){this.styleRules=Ot||null,this.placeholder=Pt||null,this.ownStylePropertyNames=Lt||[],this.overrideStyleProperties=null,this.elementName=wt||'',this.cssBuild=Dt||'',this.typeExtension=kt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}}const lt=window.Element.prototype,st=lt.matches||lt.matchesSelector||lt.mozMatchesSelector||lt.msMatchesSelector||lt.oMatchesSelector||lt.webkitMatchesSelector,it=navigator.userAgent.match('Trident'),pt='x-scope';class dt{get XSCOPE_NAME(){return pt}decorateStyles(Ot){let Pt=this,Lt={},wt=[],kt=0;ye(Ot,function(Ht){Pt.decorateRule(Ht),Ht.index=kt++,Pt.collectPropertiesInCssText(Ht.propertyInfo.cssText,Lt)},function(Ut){wt.push(Ut)}),Ot._keyframes=wt;let Dt=[];for(let Ht in Lt)Dt.push(Ht);return Dt}decorateRule(Ot){if(Ot.propertyInfo)return Ot.propertyInfo;let Pt={},Lt={},wt=this.collectProperties(Ot,Lt);return wt&&(Pt.properties=Lt,Ot.rules=null),Pt.cssText=this.collectCssText(Ot),Ot.propertyInfo=Pt,Pt}collectProperties(Ot,Pt){let Lt=Ot.propertyInfo;if(!Lt){let wt,kt=De.VAR_ASSIGN,Dt=Ot.parsedCssText,Ht,Ut;for(;wt=kt.exec(Dt);)Ht=(wt[2]||wt[3]).trim(),('inherit'!==Ht||'unset'!==Ht)&&(Pt[wt[1].trim()]=Ht),Ut=!0;return Ut}else if(Lt.properties)return Object.assign(Pt,Lt.properties),!0}collectCssText(Ot){return this.collectConsumingCssText(Ot.parsedCssText)}collectConsumingCssText(Ot){return Ot.replace(De.BRACKETED,'').replace(De.VAR_ASSIGN,'')}collectPropertiesInCssText(Ot,Pt){for(let Lt,wt;Lt=De.VAR_CONSUMED.exec(Ot);)wt=Lt[1],':'!==Lt[2]&&(Pt[wt]=!0)}reify(Ot){let Pt=Object.getOwnPropertyNames(Ot);for(let wt,Lt=0;Lt *'===Dt||'html'===Dt,Ut=0===Dt.indexOf(':host')&&!Ht;if('shady'===Lt&&(Ht=Dt===kt+' > *.'+kt||-1!==Dt.indexOf('html'),Ut=!Ht&&0===Dt.indexOf(kt)),'shadow'===Lt&&(Ht=':host > *'===Dt||'html'===Dt,Ut=Ut&&!Ht),Ht||Ut){let Ft=kt;Ut&&(Pe&&!Pt.transformedSelector&&(Pt.transformedSelector=tt._transformRuleCss(Pt,tt._transformComplexSelector,tt._calcElementScope(Ot.is),kt)),Ft=Pt.transformedSelector||kt),wt({selector:Ft,isHost:Ut,isRoot:Ht})}}}hostAndRootPropertiesForScope(Ot,Pt){let Lt={},wt={},kt=this,Dt=Pt&&Pt.__cssBuild;return ye(Pt,function(Ht){kt.whenHostOrRootRule(Ot,Ht,Dt,function(Ut){let Ft=Ot._element||Ot;st.call(Ft,Ut.selector)&&(Ut.isHost?kt.collectProperties(Ht,Lt):kt.collectProperties(Ht,wt))})},null,!0),{rootProps:wt,hostProps:Lt}}transformStyles(Ot,Pt,Lt){let wt=this,kt=tt._calcHostScope(Ot.is,Ot.extends),Dt=Ot.extends?'\\'+kt.slice(0,-1)+'\\]':kt,Ht=new RegExp(De.HOST_PREFIX+Dt+De.HOST_SUFFIX),Ut=nt.get(Ot).styleRules,Ft=this._elementKeyframeTransforms(Ot,Ut,Lt);return tt.elementStyles(Ot,Ut,function(jt){wt.applyProperties(jt,Pt),Pe||ue(jt)||!jt.cssText||(wt.applyKeyframeTransforms(jt,Ft),wt._scopeSelector(jt,Ht,kt,Lt))})}_elementKeyframeTransforms(Ot,Pt,Lt){let wt=Pt._keyframes,kt={};if(!Pe&&wt)for(let Dt=0,Ht=wt[Dt];Dt=Ht._useCount&&Ht.parentNode&&Ht.parentNode.removeChild(Ht)),Pe?Dt.customStyle?(Dt.customStyle.textContent=kt,wt=Dt.customStyle):kt&&(wt=he(kt,Lt,Ot.shadowRoot,Dt.placeholder)):wt?!wt.parentNode&&fe(wt,null,Dt.placeholder):kt&&(wt=he(kt,Lt,null,Dt.placeholder)),wt&&(wt._useCount=wt._useCount||0,Dt.customStyle!=wt&&wt._useCount++,Dt.customStyle=wt),it&&(wt.textContent=wt.textContent),wt}applyCustomStyle(Ot,Pt){let Lt=me(Ot),wt=this;Ot.textContent=de(Lt,function(kt){let Dt=kt.cssText=kt.parsedCssText;kt.propertyInfo&&kt.propertyInfo.cssText&&(Dt=se(Dt),kt.cssText=wt.valueForProperties(Dt,Pt))})}}var ct=new dt;let mt={};const ut=window.customElements;if(ut&&!Pe){const Ot=ut.define;ut.define=function(Pt,Lt,wt){return mt[Pt]=ge(Pt),Ot.call(ut,Pt,Lt,wt)}}let ht=De.MIXIN_MATCH,ft=De.VAR_ASSIGN,_t=/;\s*/m,gt=/^\s*(initial)|(inherit)\s*$/,St='_-_';class Ct{constructor(){this._map={}}set(Ot,Pt){Ot=Ot.trim(),this._map[Ot]={properties:Pt,dependants:{}}}get(Ot){return Ot=Ot.trim(),this._map[Ot]}}class bt{constructor(){this._currentTemplate=null,this._measureElement=null,this._map=new Ct,this._separator=St,this._boundProduceCssProperties=(Ot,Pt,Lt,wt)=>this._produceCssProperties(Ot,Pt,Lt,wt)}detectMixin(Ot){const Pt=ht.test(Ot)||ft.test(Ot);return ht.lastIndex=0,ft.lastIndex=0,Pt}transformStyle(Ot,Pt){let Lt=me(Ot);return this.transformRules(Lt,Pt),Lt}transformRules(Ot,Pt){this._currentTemplate=rt[Pt],ye(Ot,Lt=>{this.transformRule(Lt)}),this._currentTemplate=null}transformRule(Ot){Ot.cssText=this.transformCssText(Ot.parsedCssText),':root'===Ot.selector&&(Ot.selector=':host > *')}transformCssText(Ot){return Ot=Ot.replace(ft,this._boundProduceCssProperties),this._consumeCssProperties(Ot)}_getInitialValueForProperty(Ot){return this._measureElement||(this._measureElement=document.createElement('meta'),this._measureElement.style.all='initial',document.head.appendChild(this._measureElement)),window.getComputedStyle(this._measureElement).getPropertyValue(Ot)}_consumeCssProperties(Ot){for(let Pt;Pt=ht.exec(Ot);){let Lt=Pt[0],wt=Pt[1],kt=Pt.index,Dt=kt+Lt.indexOf('@apply'),Ht=kt+Lt.length,Ut=Ot.slice(0,Dt),Ft=Ot.slice(Ht),jt=this._cssTextToMap(Ut),qt=this._atApplyToCssProperties(wt,jt);Ot=[Ut,qt,Ft].join(''),ht.lastIndex=kt+qt.length}return Ot}_atApplyToCssProperties(Ot,Pt){Ot=Ot.replace(_t,'');let Lt=[],wt=this._map.get(Ot);if(wt||(this._map.set(Ot,{}),wt=this._map.get(Ot)),wt){this._currentTemplate&&(wt.dependants[this._currentTemplate.name]=this._currentTemplate);let kt,Dt,Ht;for(kt in wt.properties)Ht=Pt&&Pt[kt],Dt=[kt,': var(',Ot,St,kt],Ht&&Dt.push(',',Ht),Dt.push(')'),Lt.push(Dt.join(''))}return Lt.join('; ')}_replaceInitialOrInherit(Ot,Pt){let Lt=gt.exec(Pt);return Lt&&(Lt[1]?Pt=bt._getInitialValueForProperty(Ot):Pt='apply-shim-inherit'),Pt}_cssTextToMap(Ot){let Pt=Ot.split(';'),Lt,wt,kt={};for(let Ht,Ut,Dt=0;Dt{Vt&&this._map.get(Vt)&&(wt='@apply '+Vt+';')}),!wt)return Ot;let kt=this._consumeCssProperties(wt),Dt=Ot.slice(0,Ot.indexOf('--')),Ht=this._cssTextToMap(kt),Ut=Ht,Ft=this._map.get(Pt),jt=Ft&&Ft.properties;jt?Ut=Object.assign(Object.create(jt),Ht):this._map.set(Pt,Ut);let Bt,Kt,qt=[],Xt=!1;for(Bt in Ut)Kt=Ht[Bt],void 0==Kt&&(Kt='initial'),jt&&!(Bt in jt)&&(Xt=!0),qt.push(Pt+St+Bt+': '+Kt);return Xt&&this._invalidateMixinEntry(Ft),Ft&&(Ft.properties=Ut),Lt&&(Dt=Ot+';'+Dt),Dt+qt.join('; ')+';'}}let Et=new bt;window.ApplyShim=Et;let Nt=function(){};if(!Pe){let Ot=Dt=>{return Dt.classList&&!Dt.classList.contains(tt.SCOPE_NAME)||Dt instanceof SVGElement&&(!Dt.hasAttribute('class')||0>Dt.getAttribute('class').indexOf(tt.SCOPE_NAME))},Pt=Dt=>{for(let Ut,Ht=0;Ht{Lt.observe(Dt,{childList:!0,subtree:!0})},kt=window.customElements&&!window.customElements.flush;if(kt)wt(document);else{let Dt=()=>{wt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Dt):requestAnimationFrame(function(){if('loading'===document.readyState){let Ht=function(){Dt(),document.removeEventListener('readystatechange',Ht)};document.addEventListener('readystatechange',Ht)}else Dt()})}Nt=function(){Pt(Lt.takeRecords())}}let At=new class{constructor(Ot=100){this.cache={},this.typeMax=Ot}_validate(Ot,Pt,Lt){for(let kt,wt=0;wtthis.typeMax&&kt.shift(),this.cache[Ot]=kt}fetch(Ot,Pt,Lt){let wt=this.cache[Ot];if(wt)for(let Dt,kt=wt.length-1;0<=kt;kt--)if(Dt=wt[kt],this._validate(Dt,Pt,Lt))return Dt}};class vt{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement,this._documentOwnerStyleInfo=nt.set(document.documentElement,new nt({rules:[]})),this._elementsHaveApplied=!1}get nativeShadow(){return Pe}get nativeCss(){return Le}get nativeCssApply(){return!1}flush(){Nt()}_generateScopeSelector(Ot){let Pt=this._scopeCounter[Ot]=(this._scopeCounter[Ot]||0)+1;return`${Ot}-${Pt}`}getStyleAst(Ot){return me(Ot)}styleAstToString(Ot){return de(Ot)}_gatherStyles(Ot){let Pt=Ot.content.querySelectorAll('style'),Lt=[];for(let kt,wt=0;wt{Pe?tt.normalizeRootSelector(Lt):tt.documentRule(Lt),this.nativeCss&&!this.nativeCssApply&&Et.transformRule(Lt)}),this.nativeCss?Ot.textContent=de(Pt):this._documentOwnerStyleInfo.styleRules.rules.push(Pt)}_revalidateApplyShim(Ot){if(this.nativeCss&&!this.nativeCssApply){let Pt=me(Ot);Et.transformRules(Pt),Ot.textContent=de(Pt)}}_applyCustomStyleToDocument(Ot){this.nativeCss||ct.applyCustomStyle(Ot,this._documentOwnerStyleInfo.styleProperties)}getComputedStyleValue(Ot,Pt){let Lt;if(!this.nativeCss){let wt=nt.get(Ot)||nt.get(this._styleOwnerForNode(Ot));Lt=wt.styleProperties[Pt]}return Lt=Lt||window.getComputedStyle(Ot).getPropertyValue(Pt),Lt.trim()}setElementClass(Ot,Pt){let Lt=Ot.getRootNode(),wt=Pt?Pt.split(/\s/):[],kt=Lt.host&&Lt.host.localName;if(!kt){var Dt=Ot.getAttribute('class');if(Dt){let Ht=Dt.split(/\s/);for(let Ut=0;Ut{return Ta.nodeType===Node.ELEMENT_NODE&&'link'===Ta.localName&&'import'===Ta.rel},Na=(Ta,Ua)=>{if(Ta.__loaded)Ua&&Ua();else if('script'===Ta.localName&&!Ta.src)Ta.__loaded=!0,Ua&&Ua();else{const Va=Wa=>{Ta.removeEventListener(Wa.type,Va),Ta.__loaded=!0,Ua&&Ua()};Ta.addEventListener('load',Va),Ca&&'style'===Ta.localName||Ta.addEventListener('error',Va)}},Oa=Ta=>{Pa(()=>Qa(()=>Ta&&Ta()))},Pa=Ta=>{if('loading'!==document.readyState)Ta();else{const Ua=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',Ua),Ta())};document.addEventListener('readystatechange',Ua)}},Qa=Ta=>{let Ua=document.querySelectorAll(Ia),Va=Ua.length;if(!Va)return void Ta();for(let Ya,Wa=0,Xa=Ua.length;Wa{0==--Va&&Ta()})},Ra=Ta=>{if($)return Ta.ownerDocument===document?null:Ta.ownerDocument;let Ua=Ta.__importDoc;if(!Ua&&Ta.parentNode){if(Ua=Ta.parentNode,'function'==typeof Ua.closest)Ua=Ua.closest(Da);else for(;!Ma(Ua)&&(Ua=Ua.parentNode););Ta.__importDoc=Ua}return Ua},Sa=(Ta,Ua)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(Ta,Ua);const Va=document.createEvent('CustomEvent');return Va.initCustomEvent(Ta,!!Ua.bubbles,!!Ua.cancelable,Ua.detail),Va};if($){const Ta=document.querySelectorAll(Da);for(let Xa,Va=0,Wa=Ta.length;Va{const Wa=Va.target;Ma(Wa)&&(Wa.__loaded=!0)};document.addEventListener('load',Ua,!0),document.addEventListener('error',Ua,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(Ta=>this.handleMutations(Ta)),Pa(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(Ta){const Ua=Ta.querySelectorAll(Da);for(let Va=0,Wa=Ua.length;Va{const Xa=this.makeDocument(Va,Wa||Ua);this.documents[Ua]=Xa,this.inflight--,this.loadImports(Xa),this.processImportsIfLoadingDone()},()=>{this.documents[Ua]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(Ta,Ua){if(!Ta)return document.createDocumentFragment();Ca&&(Ta=Ta.replace(za,($a,_a,ab)=>{return-1===$a.indexOf('type=')?`${_a} type=${Ea} ${ab}`:$a}));let Va;const Wa=document.createElement('template');if(Wa.innerHTML=Ta,Wa.content)Va=Wa.content;else for(Va=document.createDocumentFragment();Wa.firstChild;)Va.appendChild(Wa.firstChild);const Xa=Va.querySelector('base');Xa&&(Ua=Aa.replaceAttrUrl(Xa.getAttribute('href'),Ua),Xa.removeAttribute('href'));const Ya=Va.querySelectorAll(Ga);let Za=0;for(let ab,$a=0,_a=Ya.length;$a<_a&&(ab=Ya[$a]);$a++)if(Na(ab),Aa.fixUrls(ab,Ua),ab.setAttribute(Ha,''),'script'===ab.localName&&!ab.src&&ab.textContent){const bb=Za?`-${Za}`:'',db=ab.textContent+`\n//# sourceURL=${Ua}${bb}.js\n`;ab.setAttribute('src','data:text/javascript;charset=utf-8,'+encodeURIComponent(db)),ab.textContent='',Za++}return Aa.fixUrlsInTemplates(Va,Ua),Va}processImportsIfLoadingDone(){if(!this.inflight){this.dynamicImportsMO.disconnect(),this.flatten(document);let Ta=!1,Ua=!1;const Va=()=>{Ua&&Ta&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{Ua=!0,Va()}),this.runScripts(()=>{Ta=!0,Va()})}}flatten(Ta){const Ua=Ta.querySelectorAll(Da);for(let Xa,Va=0,Wa=Ua.length;VaXa.href,configurable:!0,enumerable:!0}),this.flatten(Ya),Xa.appendChild(Ya))}}runScripts(Ta){const Ua=document.querySelectorAll(Ja),Va=Ua.length,Wa=Xa=>{if(Xa{_=null,Wa(Xa+1)})}else Ta()};Wa(0)}waitForStyles(Ta){const Ua=document.querySelectorAll(Ka);let Va=Ua.length;if(!Va)return void Ta();const Wa=Ca&&!!document.querySelector(Fa);for(let Za,Xa=0,Ya=Ua.length;Xa{Za.removeAttribute(Ha),0==--Va&&Ta()}),Wa&&Za.parentNode!==document.head){const $a=document.createElement(Za.localName);$a.__appliedElement=Za,$a.setAttribute('type','import-placeholder'),Za.parentNode.insertBefore($a,Za.nextSibling);let _a=Ra(Za);for(;_a&&Ra(_a);)_a=Ra(_a);_a.parentNode!==document.head&&(_a=null),document.head.insertBefore(Za,_a),Za.removeAttribute('type')}}fireEvents(){const Ta=document.querySelectorAll(Da);for(let Va,Ua=Ta.length-1;0<=Ua&&(Va=Ta[Ua]);Ua--)this.fireEventIfNeeded(Va)}fireEventIfNeeded(Ta){if(!Ta.__loaded){Ta.__loaded=!0,Ta.import&&(Ta.import.readyState='complete');const Ua=Ta.import?'load':'error';Ta.dispatchEvent(Sa(Ua,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(Ta){for(let Ua=0;Uadocument.dispatchEvent(Sa('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),o.useNative=$,o.whenReady=Oa,o.importForElement=Ra})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function o(zb){var Ab=Ta.has(zb);return zb=/^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(zb),!Ab&&zb}function $(zb){var Ab=zb.isConnected;if(void 0!==Ab)return Ab;for(;zb&&!(zb.__CE_isImportDocument||zb instanceof Document);)zb=zb.parentNode||(window.ShadowRoot&&zb instanceof ShadowRoot?zb.host:void 0);return zb&&(zb.__CE_isImportDocument||zb instanceof Document)}function _(zb,Ab){for(;Ab&&Ab!==zb&&!Ab.nextSibling;)Ab=Ab.parentNode;return Ab&&Ab!==zb?Ab.nextSibling:null}function wa(zb,Ab,Bb){Bb=Bb?Bb:new Set;for(var Cb=zb;Cb;){if(Cb.nodeType===Node.ELEMENT_NODE){var Db=Cb;Ab(Db);var Eb=Db.localName;if('link'===Eb&&'import'===Db.getAttribute('rel')){if(Cb=Db.import,Cb instanceof Node&&!Bb.has(Cb))for(Bb.add(Cb),Cb=Cb.firstChild;Cb;Cb=Cb.nextSibling)wa(Cb,Ab,Bb);Cb=_(zb,Db);continue}else if('template'===Eb){Cb=_(zb,Db);continue}if(Db=Db.__CE_shadowRoot)for(Db=Db.firstChild;Db;Db=Db.nextSibling)wa(Db,Ab,Bb)}Cb=Cb.firstChild?Cb.firstChild:_(zb,Cb)}}function xa(zb,Ab,Bb){zb[Ab]=Bb}function ya(){this.a=new Map,this.f=new Map,this.c=[],this.b=!1}function za(zb,Ab,Bb){zb.a.set(Ab,Bb),zb.f.set(Bb.constructor,Bb)}function Aa(zb,Ab){zb.b=!0,zb.c.push(Ab)}function Ba(zb,Ab){zb.b&&wa(Ab,function(Bb){return Ca(zb,Bb)})}function Ca(zb,Ab){if(zb.b&&!Ab.__CE_patched){Ab.__CE_patched=!0;for(var Bb=0;Bb {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n // not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.replaceAttrUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList} */\n (content.querySelectorAll(importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n }\n Path.fixUrlsInTemplates(content, url);\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) {\n return;\n }\n\n // Stop observing, flatten & load resource, then restart observing .\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n };\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n const imp = this.documents[n.href];\n n.import = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n // Suppress Closure warning about incompatible subtype assignment.\n ( /** @type {!HTMLElement} */ (n).import = n);\n // Override baseURI so that link.import.baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n Object.defineProperty(n, 'baseURI', {\n get: () => n.href,\n configurable: true,\n enumerable: true\n });\n this.flatten(imp);\n n.appendChild(imp);\n }\n }\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = document.querySelectorAll(pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n for (let j = 0, ll = s.attributes.length; j < ll; j++) {\n clone.setAttribute(s.attributes[j].name, s.attributes[j].value);\n }\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList} */\n (document.querySelectorAll(pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one imported, we must move all imported\n // links and styles to .\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n for (let i = 0, l = s$.length, s; i < l && (s = s$[i]); i++) {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to .\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of .\n s.removeAttribute('type');\n }\n }\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList} */\n (document.querySelectorAll(importSelector));\n // Inverse order to have events firing bottom-up.\n for (let i = n$.length - 1, n; i >= 0 && (n = n$[i]); i--) {\n this.fireEventIfNeeded(n);\n }\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array} mutations\n */\n handleMutations(mutations) {\n for (let i = 0; i < mutations.length; i++) {\n const m = mutations[i];\n if (!m.addedNodes) {\n continue;\n }\n for (let ii = 0; ii < m.addedNodes.length; ii++) {\n const elem = m.addedNodes[ii];\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if (element.localName === 'script' && !element.src) {\n // Inline scripts don't trigger load/error events, consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // \n\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n 'use strict';\r\n\r\n if (customElements && customElements.polyfillWrapFlushCallback) {\r\n // Here we ensure that the public `HTMLImports.whenReady`\r\n // always comes *after* custom elements have upgraded.\r\n let flushCallback;\r\n function runAndClearCallback() {\r\n if (flushCallback) {\r\n let cb = flushCallback;\r\n flushCallback = null;\r\n cb();\r\n return true;\r\n }\r\n }\r\n let origWhenReady = HTMLImports.whenReady;\r\n customElements.polyfillWrapFlushCallback(function(cb) {\r\n flushCallback = cb;\r\n origWhenReady(runAndClearCallback);\r\n });\r\n\r\n HTMLImports.whenReady = function(cb) {\r\n origWhenReady(function() {\r\n // custom element code may add dynamic imports\r\n // to match processing of native custom elements before\r\n // domContentLoaded, we wait for these imports to resolve first.\r\n if (runAndClearCallback()) {\r\n HTMLImports.whenReady(cb);\r\n } else {\r\n cb();\r\n }\r\n });\r\n };\r\n\r\n }\r\n\r\n HTMLImports.whenReady(function() {\r\n requestAnimationFrame(function() {\r\n window.dispatchEvent(new CustomEvent('WebComponentsReady'));\r\n });\r\n });\r\n\r\n})(window.WebComponents);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n // It's desireable to provide a default stylesheet\r\n // that's convenient for styling unresolved elements, but\r\n // it's cumbersome to have to include this manually in every page.\r\n // It would make sense to put inside some HTMLImport but\r\n // the HTMLImports polyfill does not allow loading of stylesheets\r\n // that block rendering. Therefore this injection is tolerated here.\r\n //\r\n // NOTE: position: relative fixes IE's failure to inherit opacity\r\n // when a child is not statically positioned.\r\n var style = document.createElement('style');\r\n style.textContent = ''\r\n + 'body {'\r\n + 'transition: opacity ease-in 0.2s;'\r\n + ' } \\n'\r\n + 'body[unresolved] {'\r\n + 'opacity: 0; display: block; overflow: hidden; position: relative;'\r\n + ' } \\n'\r\n ;\r\n var head = document.querySelector('head');\r\n head.insertBefore(style, head.firstChild);\r\n\r\n})(window.WebComponents);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: HTML Imports, Custom Elements\r\n * Used in: Safari 10, Firefox once SD is shipped\r\n */\r\n\r\n// TODO(notwaldorf): Remove after this is addressed:\r\n// https://github.com/webcomponents/shadycss/issues/46\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n(scope => {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n // not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.replaceAttrUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList} */\n (content.querySelectorAll(importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n }\n Path.fixUrlsInTemplates(content, url);\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) {\n return;\n }\n\n // Stop observing, flatten & load resource, then restart observing .\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n }\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n const imp = this.documents[n.href];\n n.import = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n // Suppress Closure warning about incompatible subtype assignment.\n ( /** @type {!HTMLElement} */ (n).import = n);\n // Override baseURI so that link.import.baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n Object.defineProperty(n, 'baseURI', {\n get: () => n.href,\n configurable: true,\n enumerable: true\n });\n this.flatten(imp);\n n.appendChild(imp);\n }\n }\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = document.querySelectorAll(pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n for (let j = 0, ll = s.attributes.length; j < ll; j++) {\n clone.setAttribute(s.attributes[j].name, s.attributes[j].value);\n }\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList} */\n (document.querySelectorAll(pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one imported, we must move all imported\n // links and styles to .\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n for (let i = 0, l = s$.length, s; i < l && (s = s$[i]); i++) {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to .\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of .\n s.removeAttribute('type');\n }\n }\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList} */\n (document.querySelectorAll(importSelector));\n // Inverse order to have events firing bottom-up.\n for (let i = n$.length - 1, n; i >= 0 && (n = n$[i]); i--) {\n this.fireEventIfNeeded(n);\n }\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array} mutations\n */\n handleMutations(mutations) {\n for (let i = 0; i < mutations.length; i++) {\n const m = mutations[i];\n if (!m.addedNodes) {\n continue;\n }\n for (let ii = 0; ii < m.addedNodes.length; ii++) {\n const elem = m.addedNodes[ii];\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if (element.localName === 'script' && !element.src) {\n // Inline scripts don't trigger load/error events, consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // \n\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n 'use strict';\r\n\r\n if (customElements && customElements.polyfillWrapFlushCallback) {\r\n // Here we ensure that the public `HTMLImports.whenReady`\r\n // always comes *after* custom elements have upgraded.\r\n let flushCallback;\r\n function runAndClearCallback() {\r\n if (flushCallback) {\r\n let cb = flushCallback;\r\n flushCallback = null;\r\n cb();\r\n return true;\r\n }\r\n }\r\n let origWhenReady = HTMLImports.whenReady;\r\n customElements.polyfillWrapFlushCallback(function(cb) {\r\n flushCallback = cb;\r\n origWhenReady(runAndClearCallback);\r\n });\r\n\r\n HTMLImports.whenReady = function(cb) {\r\n origWhenReady(function() {\r\n // custom element code may add dynamic imports\r\n // to match processing of native custom elements before\r\n // domContentLoaded, we wait for these imports to resolve first.\r\n if (runAndClearCallback()) {\r\n HTMLImports.whenReady(cb);\r\n } else {\r\n cb();\r\n }\r\n });\r\n };\r\n\r\n }\r\n\r\n HTMLImports.whenReady(function() {\r\n requestAnimationFrame(function() {\r\n window.dispatchEvent(new CustomEvent('WebComponentsReady'));\r\n });\r\n });\r\n\r\n})(window.WebComponents);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n // It's desireable to provide a default stylesheet\r\n // that's convenient for styling unresolved elements, but\r\n // it's cumbersome to have to include this manually in every page.\r\n // It would make sense to put inside some HTMLImport but\r\n // the HTMLImports polyfill does not allow loading of stylesheets\r\n // that block rendering. Therefore this injection is tolerated here.\r\n //\r\n // NOTE: position: relative fixes IE's failure to inherit opacity\r\n // when a child is not statically positioned.\r\n var style = document.createElement('style');\r\n style.textContent = ''\r\n + 'body {'\r\n + 'transition: opacity ease-in 0.2s;'\r\n + ' } \\n'\r\n + 'body[unresolved] {'\r\n + 'opacity: 0; display: block; overflow: hidden; position: relative;'\r\n + ' } \\n'\r\n ;\r\n var head = document.querySelector('head');\r\n head.insertBefore(style, head.firstChild);\r\n\r\n})(window.WebComponents);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: HTML Imports, Custom Elements, Shady DOM/Shady CSS\r\n * Used in: Safari 9, Firefox, Edge\r\n */\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n(scope => {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n // not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.replaceAttrUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList} */\n (content.querySelectorAll(importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n }\n Path.fixUrlsInTemplates(content, url);\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) {\n return;\n }\n\n // Stop observing, flatten & load resource, then restart observing .\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n }\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n const imp = this.documents[n.href];\n n.import = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n // Suppress Closure warning about incompatible subtype assignment.\n ( /** @type {!HTMLElement} */ (n).import = n);\n // Override baseURI so that link.import.baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n Object.defineProperty(n, 'baseURI', {\n get: () => n.href,\n configurable: true,\n enumerable: true\n });\n this.flatten(imp);\n n.appendChild(imp);\n }\n }\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = document.querySelectorAll(pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n for (let j = 0, ll = s.attributes.length; j < ll; j++) {\n clone.setAttribute(s.attributes[j].name, s.attributes[j].value);\n }\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList} */\n (document.querySelectorAll(pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one imported, we must move all imported\n // links and styles to .\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n for (let i = 0, l = s$.length, s; i < l && (s = s$[i]); i++) {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to .\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of .\n s.removeAttribute('type');\n }\n }\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList} */\n (document.querySelectorAll(importSelector));\n // Inverse order to have events firing bottom-up.\n for (let i = n$.length - 1, n; i >= 0 && (n = n$[i]); i--) {\n this.fireEventIfNeeded(n);\n }\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array} mutations\n */\n handleMutations(mutations) {\n for (let i = 0; i < mutations.length; i++) {\n const m = mutations[i];\n if (!m.addedNodes) {\n continue;\n }\n for (let ii = 0; ii < m.addedNodes.length; ii++) {\n const elem = m.addedNodes[ii];\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if (element.localName === 'script' && !element.src) {\n // Inline scripts don't trigger load/error events, consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // \n\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n 'use strict';\r\n\r\n if (customElements && customElements.polyfillWrapFlushCallback) {\r\n // Here we ensure that the public `HTMLImports.whenReady`\r\n // always comes *after* custom elements have upgraded.\r\n let flushCallback;\r\n function runAndClearCallback() {\r\n if (flushCallback) {\r\n let cb = flushCallback;\r\n flushCallback = null;\r\n cb();\r\n return true;\r\n }\r\n }\r\n let origWhenReady = HTMLImports.whenReady;\r\n customElements.polyfillWrapFlushCallback(function(cb) {\r\n flushCallback = cb;\r\n origWhenReady(runAndClearCallback);\r\n });\r\n\r\n HTMLImports.whenReady = function(cb) {\r\n origWhenReady(function() {\r\n // custom element code may add dynamic imports\r\n // to match processing of native custom elements before\r\n // domContentLoaded, we wait for these imports to resolve first.\r\n if (runAndClearCallback()) {\r\n HTMLImports.whenReady(cb);\r\n } else {\r\n cb();\r\n }\r\n });\r\n };\r\n\r\n }\r\n\r\n HTMLImports.whenReady(function() {\r\n requestAnimationFrame(function() {\r\n window.dispatchEvent(new CustomEvent('WebComponentsReady'));\r\n });\r\n });\r\n\r\n})(window.WebComponents);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n // It's desireable to provide a default stylesheet\r\n // that's convenient for styling unresolved elements, but\r\n // it's cumbersome to have to include this manually in every page.\r\n // It would make sense to put inside some HTMLImport but\r\n // the HTMLImports polyfill does not allow loading of stylesheets\r\n // that block rendering. Therefore this injection is tolerated here.\r\n //\r\n // NOTE: position: relative fixes IE's failure to inherit opacity\r\n // when a child is not statically positioned.\r\n var style = document.createElement('style');\r\n style.textContent = ''\r\n + 'body {'\r\n + 'transition: opacity ease-in 0.2s;'\r\n + ' } \\n'\r\n + 'body[unresolved] {'\r\n + 'opacity: 0; display: block; overflow: hidden; position: relative;'\r\n + ' } \\n'\r\n ;\r\n var head = document.querySelector('head');\r\n head.insertBefore(style, head.firstChild);\r\n\r\n})(window.WebComponents);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: HTML Imports\r\n * Used in: Safari Tech Preview\r\n */\r\n\r\n// TODO(notwaldorf): Remove after this is addressed:\r\n// https://github.com/webcomponents/shadycss/issues/46\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n(scope => {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n // not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.replaceAttrUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList} */\n (content.querySelectorAll(importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n }\n Path.fixUrlsInTemplates(content, url);\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) {\n return;\n }\n\n // Stop observing, flatten & load resource, then restart observing .\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n }\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n const imp = this.documents[n.href];\n n.import = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n // Suppress Closure warning about incompatible subtype assignment.\n ( /** @type {!HTMLElement} */ (n).import = n);\n // Override baseURI so that link.import.baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n Object.defineProperty(n, 'baseURI', {\n get: () => n.href,\n configurable: true,\n enumerable: true\n });\n this.flatten(imp);\n n.appendChild(imp);\n }\n }\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = document.querySelectorAll(pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n for (let j = 0, ll = s.attributes.length; j < ll; j++) {\n clone.setAttribute(s.attributes[j].name, s.attributes[j].value);\n }\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList} */\n (document.querySelectorAll(pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one imported, we must move all imported\n // links and styles to .\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n for (let i = 0, l = s$.length, s; i < l && (s = s$[i]); i++) {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to .\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of .\n s.removeAttribute('type');\n }\n }\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList} */\n (document.querySelectorAll(importSelector));\n // Inverse order to have events firing bottom-up.\n for (let i = n$.length - 1, n; i >= 0 && (n = n$[i]); i--) {\n this.fireEventIfNeeded(n);\n }\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array} mutations\n */\n handleMutations(mutations) {\n for (let i = 0; i < mutations.length; i++) {\n const m = mutations[i];\n if (!m.addedNodes) {\n continue;\n }\n for (let ii = 0; ii < m.addedNodes.length; ii++) {\n const elem = m.addedNodes[ii];\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if (element.localName === 'script' && !element.src) {\n // Inline scripts don't trigger load/error events, consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // \n\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n 'use strict';\r\n\r\n if (customElements && customElements.polyfillWrapFlushCallback) {\r\n // Here we ensure that the public `HTMLImports.whenReady`\r\n // always comes *after* custom elements have upgraded.\r\n let flushCallback;\r\n function runAndClearCallback() {\r\n if (flushCallback) {\r\n let cb = flushCallback;\r\n flushCallback = null;\r\n cb();\r\n return true;\r\n }\r\n }\r\n let origWhenReady = HTMLImports.whenReady;\r\n customElements.polyfillWrapFlushCallback(function(cb) {\r\n flushCallback = cb;\r\n origWhenReady(runAndClearCallback);\r\n });\r\n\r\n HTMLImports.whenReady = function(cb) {\r\n origWhenReady(function() {\r\n // custom element code may add dynamic imports\r\n // to match processing of native custom elements before\r\n // domContentLoaded, we wait for these imports to resolve first.\r\n if (runAndClearCallback()) {\r\n HTMLImports.whenReady(cb);\r\n } else {\r\n cb();\r\n }\r\n });\r\n };\r\n\r\n }\r\n\r\n HTMLImports.whenReady(function() {\r\n requestAnimationFrame(function() {\r\n window.dispatchEvent(new CustomEvent('WebComponentsReady'));\r\n });\r\n });\r\n\r\n})(window.WebComponents);\n\n/**\r\n * @license\r\n * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n(function(scope) {\r\n\r\n // It's desireable to provide a default stylesheet\r\n // that's convenient for styling unresolved elements, but\r\n // it's cumbersome to have to include this manually in every page.\r\n // It would make sense to put inside some HTMLImport but\r\n // the HTMLImports polyfill does not allow loading of stylesheets\r\n // that block rendering. Therefore this injection is tolerated here.\r\n //\r\n // NOTE: position: relative fixes IE's failure to inherit opacity\r\n // when a child is not statically positioned.\r\n var style = document.createElement('style');\r\n style.textContent = ''\r\n + 'body {'\r\n + 'transition: opacity ease-in 0.2s;'\r\n + ' } \\n'\r\n + 'body[unresolved] {'\r\n + 'opacity: 0; display: block; overflow: hidden; position: relative;'\r\n + ' } \\n'\r\n ;\r\n var head = document.querySelector('head');\r\n head.insertBefore(style, head.firstChild);\r\n\r\n})(window.WebComponents);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: HTML Imports, Custom Elements, Shady DOM/Shady CSS, platform polyfills (URL/template)\r\n * Used in: IE 11\r\n */\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n(function(scope) {\n\n 'use strict';\n\n // defaultPrevented is broken in IE.\n // https://connect.microsoft.com/IE/feedback/details/790389/event-defaultprevented-returns-false-after-preventdefault-was-called\n var workingDefaultPrevented = (function() {\n var e = document.createEvent('Event');\n e.initEvent('foo', true, true);\n e.preventDefault();\n return e.defaultPrevented;\n })();\n\n if (!workingDefaultPrevented) {\n var origPreventDefault = Event.prototype.preventDefault;\n Event.prototype.preventDefault = function() {\n if (!this.cancelable) {\n return;\n }\n\n origPreventDefault.call(this);\n\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n },\n configurable: true\n });\n };\n }\n\n var isIE = /Trident/.test(navigator.userAgent);\n\n // CustomEvent constructor shim\n if (!window.CustomEvent || isIE && (typeof window.CustomEvent !== 'function')) {\n window.CustomEvent = function(inType, params) {\n params = params || {};\n var e = document.createEvent('CustomEvent');\n e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail);\n return e;\n };\n window.CustomEvent.prototype = window.Event.prototype;\n }\n\n // Event constructor shim\n if (!window.Event || isIE && (typeof window.Event !== 'function')) {\n var origEvent = window.Event;\n window.Event = function(inType, params) {\n params = params || {};\n var e = document.createEvent('Event');\n e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable));\n return e;\n };\n if (origEvent) {\n for (var i in origEvent) {\n window.Event[i] = origEvent[i];\n }\n }\n window.Event.prototype = origEvent.prototype;\n }\n\n if (!window.MouseEvent || isIE && (typeof window.MouseEvent !== 'function')) {\n var origMouseEvent = window.MouseEvent;\n window.MouseEvent = function(inType, params) {\n params = params || {};\n var e = document.createEvent('MouseEvent');\n e.initMouseEvent(inType,\n Boolean(params.bubbles), Boolean(params.cancelable),\n params.view || window, params.detail,\n params.screenX, params.screenY, params.clientX, params.clientY,\n params.ctrlKey, params.altKey, params.shiftKey, params.metaKey,\n params.button, params.relatedTarget);\n return e;\n };\n if (origMouseEvent) {\n for (var i in origMouseEvent) {\n window.MouseEvent[i] = origMouseEvent[i];\n }\n }\n window.MouseEvent.prototype = origMouseEvent.prototype;\n }\n\n // ES6 stuff\n if (!Array.from) {\n Array.from = function (object) {\n return [].slice.call(object);\n };\n }\n\n if (!Object.assign) {\n var assign = function(target, source) {\n var n$ = Object.getOwnPropertyNames(source);\n for (var i=0, p; i < n$.length; i++) {\n p = n$[i];\n target[p] = source[p];\n }\n }\n\n Object.assign = function(target, sources) {\n var args = [].slice.call(arguments, 1);\n for (var i=0, s; i < args.length; i++) {\n s = args[i];\n if (s) {\n assign(target, s);\n }\n }\n return target;\n }\n }\n\n})(window.WebComponents);\n","/* Any copyright is dedicated to the Public Domain.\n * http://creativecommons.org/publicdomain/zero/1.0/ */\n\n(function(scope) {\n 'use strict';\n\n // feature detect for URL constructor\n var hasWorkingUrl = false;\n if (!scope.forceJURL) {\n try {\n var u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n hasWorkingUrl = u.href === 'http://a/c%20d';\n } catch(e) {}\n }\n\n if (hasWorkingUrl)\n return;\n\n var relative = Object.create(null);\n relative['ftp'] = 21;\n relative['file'] = 0;\n relative['gopher'] = 70;\n relative['http'] = 80;\n relative['https'] = 443;\n relative['ws'] = 80;\n relative['wss'] = 443;\n\n var relativePathDotMapping = Object.create(null);\n relativePathDotMapping['%2e'] = '.';\n relativePathDotMapping['.%2e'] = '..';\n relativePathDotMapping['%2e.'] = '..';\n relativePathDotMapping['%2e%2e'] = '..';\n\n function isRelativeScheme(scheme) {\n return relative[scheme] !== undefined;\n }\n\n function invalid() {\n clear.call(this);\n this._isInvalid = true;\n }\n\n function IDNAToASCII(h) {\n if ('' == h) {\n invalid.call(this)\n }\n // XXX\n return h.toLowerCase()\n }\n\n function percentEscape(c) {\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ? `\n [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponent(c);\n }\n\n function percentEscapeQuery(c) {\n // XXX This actually needs to encode c using encoding and then\n // convert the bytes one-by-one.\n\n var unicode = c.charCodeAt(0);\n if (unicode > 0x20 &&\n unicode < 0x7F &&\n // \" # < > ` (do not escape '?')\n [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) == -1\n ) {\n return c;\n }\n return encodeURIComponent(c);\n }\n\n var EOF = undefined,\n ALPHA = /[a-zA-Z]/,\n ALPHANUMERIC = /[a-zA-Z0-9\\+\\-\\.]/;\n\n function parse(input, stateOverride, base) {\n function err(message) {\n errors.push(message)\n }\n\n var state = stateOverride || 'scheme start',\n cursor = 0,\n buffer = '',\n seenAt = false,\n seenBracket = false,\n errors = [];\n\n loop: while ((input[cursor - 1] != EOF || cursor == 0) && !this._isInvalid) {\n var c = input[cursor];\n switch (state) {\n case 'scheme start':\n if (c && ALPHA.test(c)) {\n buffer += c.toLowerCase(); // ASCII-safe\n state = 'scheme';\n } else if (!stateOverride) {\n buffer = '';\n state = 'no scheme';\n continue;\n } else {\n err('Invalid scheme.');\n break loop;\n }\n break;\n\n case 'scheme':\n if (c && ALPHANUMERIC.test(c)) {\n buffer += c.toLowerCase(); // ASCII-safe\n } else if (':' == c) {\n this._scheme = buffer;\n buffer = '';\n if (stateOverride) {\n break loop;\n }\n if (isRelativeScheme(this._scheme)) {\n this._isRelative = true;\n }\n if ('file' == this._scheme) {\n state = 'relative';\n } else if (this._isRelative && base && base._scheme == this._scheme) {\n state = 'relative or authority';\n } else if (this._isRelative) {\n state = 'authority first slash';\n } else {\n state = 'scheme data';\n }\n } else if (!stateOverride) {\n buffer = '';\n cursor = 0;\n state = 'no scheme';\n continue;\n } else if (EOF == c) {\n break loop;\n } else {\n err('Code point not allowed in scheme: ' + c)\n break loop;\n }\n break;\n\n case 'scheme data':\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else {\n // XXX error handling\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._schemeData += percentEscape(c);\n }\n }\n break;\n\n case 'no scheme':\n if (!base || !(isRelativeScheme(base._scheme))) {\n err('Missing scheme.');\n invalid.call(this);\n } else {\n state = 'relative';\n continue;\n }\n break;\n\n case 'relative or authority':\n if ('/' == c && '/' == input[cursor+1]) {\n state = 'authority ignore slashes';\n } else {\n err('Expected /, got: ' + c);\n state = 'relative';\n continue\n }\n break;\n\n case 'relative':\n this._isRelative = true;\n if ('file' != this._scheme)\n this._scheme = base._scheme;\n if (EOF == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._username = base._username;\n this._password = base._password;\n break loop;\n } else if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c)\n err('\\\\ is an invalid code point.');\n state = 'relative slash';\n } else if ('?' == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = '?';\n this._username = base._username;\n this._password = base._password;\n state = 'query';\n } else if ('#' == c) {\n this._host = base._host;\n this._port = base._port;\n this._path = base._path.slice();\n this._query = base._query;\n this._fragment = '#';\n this._username = base._username;\n this._password = base._password;\n state = 'fragment';\n } else {\n var nextC = input[cursor+1]\n var nextNextC = input[cursor+2]\n if (\n 'file' != this._scheme || !ALPHA.test(c) ||\n (nextC != ':' && nextC != '|') ||\n (EOF != nextNextC && '/' != nextNextC && '\\\\' != nextNextC && '?' != nextNextC && '#' != nextNextC)) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n this._path = base._path.slice();\n this._path.pop();\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'relative slash':\n if ('/' == c || '\\\\' == c) {\n if ('\\\\' == c) {\n err('\\\\ is an invalid code point.');\n }\n if ('file' == this._scheme) {\n state = 'file host';\n } else {\n state = 'authority ignore slashes';\n }\n } else {\n if ('file' != this._scheme) {\n this._host = base._host;\n this._port = base._port;\n this._username = base._username;\n this._password = base._password;\n }\n state = 'relative path';\n continue;\n }\n break;\n\n case 'authority first slash':\n if ('/' == c) {\n state = 'authority second slash';\n } else {\n err(\"Expected '/', got: \" + c);\n state = 'authority ignore slashes';\n continue;\n }\n break;\n\n case 'authority second slash':\n state = 'authority ignore slashes';\n if ('/' != c) {\n err(\"Expected '/', got: \" + c);\n continue;\n }\n break;\n\n case 'authority ignore slashes':\n if ('/' != c && '\\\\' != c) {\n state = 'authority';\n continue;\n } else {\n err('Expected authority, got: ' + c);\n }\n break;\n\n case 'authority':\n if ('@' == c) {\n if (seenAt) {\n err('@ already seen.');\n buffer += '%40';\n }\n seenAt = true;\n for (var i = 0; i < buffer.length; i++) {\n var cp = buffer[i];\n if ('\\t' == cp || '\\n' == cp || '\\r' == cp) {\n err('Invalid whitespace in authority.');\n continue;\n }\n // XXX check URL code points\n if (':' == cp && null === this._password) {\n this._password = '';\n continue;\n }\n var tempC = percentEscape(cp);\n (null !== this._password) ? this._password += tempC : this._username += tempC;\n }\n buffer = '';\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n cursor -= buffer.length;\n buffer = '';\n state = 'host';\n continue;\n } else {\n buffer += c;\n }\n break;\n\n case 'file host':\n if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n if (buffer.length == 2 && ALPHA.test(buffer[0]) && (buffer[1] == ':' || buffer[1] == '|')) {\n state = 'relative path';\n } else if (buffer.length == 0) {\n state = 'relative path start';\n } else {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'relative path start';\n }\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid whitespace in file host.');\n } else {\n buffer += c;\n }\n break;\n\n case 'host':\n case 'hostname':\n if (':' == c && !seenBracket) {\n // XXX host parsing\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'port';\n if ('hostname' == stateOverride) {\n break loop;\n }\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c) {\n this._host = IDNAToASCII.call(this, buffer);\n buffer = '';\n state = 'relative path start';\n if (stateOverride) {\n break loop;\n }\n continue;\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n if ('[' == c) {\n seenBracket = true;\n } else if (']' == c) {\n seenBracket = false;\n }\n buffer += c;\n } else {\n err('Invalid code point in host/hostname: ' + c);\n }\n break;\n\n case 'port':\n if (/[0-9]/.test(c)) {\n buffer += c;\n } else if (EOF == c || '/' == c || '\\\\' == c || '?' == c || '#' == c || stateOverride) {\n if ('' != buffer) {\n var temp = parseInt(buffer, 10);\n if (temp != relative[this._scheme]) {\n this._port = temp + '';\n }\n buffer = '';\n }\n if (stateOverride) {\n break loop;\n }\n state = 'relative path start';\n continue;\n } else if ('\\t' == c || '\\n' == c || '\\r' == c) {\n err('Invalid code point in port: ' + c);\n } else {\n invalid.call(this);\n }\n break;\n\n case 'relative path start':\n if ('\\\\' == c)\n err(\"'\\\\' not allowed in path.\");\n state = 'relative path';\n if ('/' != c && '\\\\' != c) {\n continue;\n }\n break;\n\n case 'relative path':\n if (EOF == c || '/' == c || '\\\\' == c || (!stateOverride && ('?' == c || '#' == c))) {\n if ('\\\\' == c) {\n err('\\\\ not allowed in relative path.');\n }\n var tmp;\n if (tmp = relativePathDotMapping[buffer.toLowerCase()]) {\n buffer = tmp;\n }\n if ('..' == buffer) {\n this._path.pop();\n if ('/' != c && '\\\\' != c) {\n this._path.push('');\n }\n } else if ('.' == buffer && '/' != c && '\\\\' != c) {\n this._path.push('');\n } else if ('.' != buffer) {\n if ('file' == this._scheme && this._path.length == 0 && buffer.length == 2 && ALPHA.test(buffer[0]) && buffer[1] == '|') {\n buffer = buffer[0] + ':';\n }\n this._path.push(buffer);\n }\n buffer = '';\n if ('?' == c) {\n this._query = '?';\n state = 'query';\n } else if ('#' == c) {\n this._fragment = '#';\n state = 'fragment';\n }\n } else if ('\\t' != c && '\\n' != c && '\\r' != c) {\n buffer += percentEscape(c);\n }\n break;\n\n case 'query':\n if (!stateOverride && '#' == c) {\n this._fragment = '#';\n state = 'fragment';\n } else if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._query += percentEscapeQuery(c);\n }\n break;\n\n case 'fragment':\n if (EOF != c && '\\t' != c && '\\n' != c && '\\r' != c) {\n this._fragment += c;\n }\n break;\n }\n\n cursor++;\n }\n }\n\n function clear() {\n this._scheme = '';\n this._schemeData = '';\n this._username = '';\n this._password = null;\n this._host = '';\n this._port = '';\n this._path = [];\n this._query = '';\n this._fragment = '';\n this._isInvalid = false;\n this._isRelative = false;\n }\n\n // Does not process domain names or IP addresses.\n // Does not handle encoding for the query parameter.\n function jURL(url, base /* , encoding */) {\n if (base !== undefined && !(base instanceof jURL))\n base = new jURL(String(base));\n\n this._url = url;\n clear.call(this);\n\n var input = url.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n // encoding = encoding || 'utf-8'\n\n parse.call(this, input, null, base);\n }\n\n jURL.prototype = {\n toString: function() {\n return this.href;\n },\n get href() {\n if (this._isInvalid)\n return this._url;\n\n var authority = '';\n if ('' != this._username || null != this._password) {\n authority = this._username +\n (null != this._password ? ':' + this._password : '') + '@';\n }\n\n return this.protocol +\n (this._isRelative ? '//' + authority + this.host : '') +\n this.pathname + this._query + this._fragment;\n },\n set href(href) {\n clear.call(this);\n parse.call(this, href);\n },\n\n get protocol() {\n return this._scheme + ':';\n },\n set protocol(protocol) {\n if (this._isInvalid)\n return;\n parse.call(this, protocol + ':', 'scheme start');\n },\n\n get host() {\n return this._isInvalid ? '' : this._port ?\n this._host + ':' + this._port : this._host;\n },\n set host(host) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, host, 'host');\n },\n\n get hostname() {\n return this._host;\n },\n set hostname(hostname) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, hostname, 'hostname');\n },\n\n get port() {\n return this._port;\n },\n set port(port) {\n if (this._isInvalid || !this._isRelative)\n return;\n parse.call(this, port, 'port');\n },\n\n get pathname() {\n return this._isInvalid ? '' : this._isRelative ?\n '/' + this._path.join('/') : this._schemeData;\n },\n set pathname(pathname) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._path = [];\n parse.call(this, pathname, 'relative path start');\n },\n\n get search() {\n return this._isInvalid || !this._query || '?' == this._query ?\n '' : this._query;\n },\n set search(search) {\n if (this._isInvalid || !this._isRelative)\n return;\n this._query = '?';\n if ('?' == search[0])\n search = search.slice(1);\n parse.call(this, search, 'query');\n },\n\n get hash() {\n return this._isInvalid || !this._fragment || '#' == this._fragment ?\n '' : this._fragment;\n },\n set hash(hash) {\n if (this._isInvalid)\n return;\n this._fragment = '#';\n if ('#' == hash[0])\n hash = hash.slice(1);\n parse.call(this, hash, 'fragment');\n },\n\n get origin() {\n var host;\n if (this._isInvalid || !this._scheme) {\n return '';\n }\n // javascript: Gecko returns String(\"\"), WebKit/Blink String(\"null\")\n // Gecko throws error for \"data://\"\n // data: Gecko returns \"\", Blink returns \"data://\", WebKit returns \"null\"\n // Gecko returns String(\"\") for file: mailto:\n // WebKit/Blink returns String(\"SCHEME://\") for file: mailto:\n switch (this._scheme) {\n case 'data':\n case 'file':\n case 'javascript':\n case 'mailto':\n return 'null';\n }\n host = this.host;\n if (!host) {\n return '';\n }\n return this._scheme + '://' + host;\n }\n };\n\n // Copy over the static methods\n var OriginalURL = scope.URL;\n if (OriginalURL) {\n jURL.createObjectURL = function(blob) {\n // IE extension allows a second optional options argument.\n // http://msdn.microsoft.com/en-us/library/ie/hh772302(v=vs.85).aspx\n return OriginalURL.createObjectURL.apply(OriginalURL, arguments);\n };\n jURL.revokeObjectURL = function(url) {\n OriginalURL.revokeObjectURL(url);\n };\n }\n\n scope.URL = jURL;\n\n})(window);\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n// minimal template polyfill\n(function() {\n\n var needsTemplate = (typeof HTMLTemplateElement === 'undefined');\n\n // NOTE: Patch document.importNode to work around IE11 bug that\n // casues children of a document fragment imported while\n // there is a mutation observer to not have a parentNode (!?!)\n // It's important that this is the first patch to `importNode` so that\n // dom produced for later patches is correct.\n if (/Trident/.test(navigator.userAgent)) {\n (function() {\n var Native_importNode = Document.prototype.importNode;\n Document.prototype.importNode = function() {\n var n = Native_importNode.apply(this, arguments);\n // Copy all children to a new document fragment since\n // this one may be broken\n if (n.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n var f = this.createDocumentFragment();\n f.appendChild(n);\n return f;\n } else {\n return n;\n }\n };\n })();\n }\n\n // NOTE: we rely on this cloneNode not causing element upgrade.\n // This means this polyfill must load before the CE polyfill and\n // this would need to be re-worked if a browser supports native CE\n // but not .\n var Native_cloneNode = Node.prototype.cloneNode;\n var Native_createElement = Document.prototype.createElement;\n var Native_importNode = Document.prototype.importNode;\n\n // returns true if nested templates cannot be cloned (they cannot be on\n // some impl's like Safari 8 and Edge)\n // OR if cloning a document fragment does not result in a document fragment\n var needsCloning = (function() {\n if (!needsTemplate) {\n var t = document.createElement('template');\n var t2 = document.createElement('template');\n t2.content.appendChild(document.createElement('div'));\n t.content.appendChild(t2);\n var clone = t.cloneNode(true);\n return (clone.content.childNodes.length === 0 || clone.content.firstChild.content.childNodes.length === 0\n || !(document.createDocumentFragment().cloneNode() instanceof DocumentFragment));\n }\n })();\n\n var TEMPLATE_TAG = 'template';\n var PolyfilledHTMLTemplateElement = function() {};\n\n if (needsTemplate) {\n\n var contentDoc = document.implementation.createHTMLDocument('template');\n var canDecorate = true;\n\n var templateStyle = document.createElement('style');\n templateStyle.textContent = TEMPLATE_TAG + '{display:none;}';\n\n var head = document.head;\n head.insertBefore(templateStyle, head.firstElementChild);\n\n /**\n Provides a minimal shim for the element.\n */\n PolyfilledHTMLTemplateElement.prototype = Object.create(HTMLElement.prototype);\n\n\n // if elements do not have `innerHTML` on instances, then\n // templates can be patched by swizzling their prototypes.\n var canProtoPatch =\n !(document.createElement('div').hasOwnProperty('innerHTML'));\n\n /**\n The `decorate` method moves element children to the template's `content`.\n NOTE: there is no support for dynamically adding elements to templates.\n */\n PolyfilledHTMLTemplateElement.decorate = function(template) {\n // if the template is decorated, return fast\n if (template.content) {\n return;\n }\n template.content = contentDoc.createDocumentFragment();\n var child;\n while (child = template.firstChild) {\n template.content.appendChild(child);\n }\n // NOTE: prefer prototype patching for performance and\n // because on some browsers (IE11), re-defining `innerHTML`\n // can result in intermittent errors.\n if (canProtoPatch) {\n template.__proto__ = PolyfilledHTMLTemplateElement.prototype;\n } else {\n template.cloneNode = function(deep) {\n return PolyfilledHTMLTemplateElement._cloneNode(this, deep);\n };\n // add innerHTML to template, if possible\n // Note: this throws on Safari 7\n if (canDecorate) {\n try {\n defineInnerHTML(template);\n } catch (err) {\n canDecorate = false;\n }\n }\n }\n // bootstrap recursively\n PolyfilledHTMLTemplateElement.bootstrap(template.content);\n };\n\n function defineInnerHTML(obj) {\n Object.defineProperty(obj, 'innerHTML', {\n get: function() {\n var o = '';\n for (var e = this.content.firstChild; e; e = e.nextSibling) {\n o += e.outerHTML || escapeData(e.data);\n }\n return o;\n },\n set: function(text) {\n contentDoc.body.innerHTML = text;\n PolyfilledHTMLTemplateElement.bootstrap(contentDoc);\n while (this.content.firstChild) {\n this.content.removeChild(this.content.firstChild);\n }\n while (contentDoc.body.firstChild) {\n this.content.appendChild(contentDoc.body.firstChild);\n }\n },\n configurable: true\n });\n }\n\n defineInnerHTML(PolyfilledHTMLTemplateElement.prototype);\n\n /**\n The `bootstrap` method is called automatically and \"fixes\" all\n elements in the document referenced by the `doc` argument.\n */\n PolyfilledHTMLTemplateElement.bootstrap = function(doc) {\n var templates = doc.querySelectorAll(TEMPLATE_TAG);\n for (var i=0, l=templates.length, t; (i]/g;\n\n function escapeReplace(c) {\n switch (c) {\n case '&':\n return '&';\n case '<':\n return '<';\n case '>':\n return '>';\n case '\\u00A0':\n return ' ';\n }\n }\n\n function escapeData(s) {\n return s.replace(escapeDataRegExp, escapeReplace);\n }\n }\n\n // make cloning/importing work!\n if (needsTemplate || needsCloning) {\n\n PolyfilledHTMLTemplateElement._cloneNode = function(template, deep) {\n var clone = Native_cloneNode.call(template, false);\n // NOTE: decorate doesn't auto-fix children because they are already\n // decorated so they need special clone fixup.\n if (this.decorate) {\n this.decorate(clone);\n }\n if (deep) {\n // NOTE: use native clone node to make sure CE's wrapped\n // cloneNode does not cause elements to upgrade.\n clone.content.appendChild(\n Native_cloneNode.call(template.content, true));\n // now ensure nested templates are cloned correctly.\n this.fixClonedDom(clone.content, template.content);\n }\n return clone;\n };\n\n PolyfilledHTMLTemplateElement.prototype.cloneNode = function(deep) {\n return PolyfilledHTMLTemplateElement._cloneNode(this, deep);\n }\n\n // Given a source and cloned subtree, find 's in the cloned\n // subtree and replace them with cloned 's from source.\n // We must do this because only the source templates have proper .content.\n PolyfilledHTMLTemplateElement.fixClonedDom = function(clone, source) {\n // do nothing if cloned node is not an element\n if (!source.querySelectorAll) return;\n // these two lists should be coincident\n var s$ = source.querySelectorAll(TEMPLATE_TAG);\n var t$ = clone.querySelectorAll(TEMPLATE_TAG);\n for (var i=0, l=t$.length, t, s; i's.\n // However, the ownerDocument of the cloned template will be correct!\n // This is because the native import node creates the right document owned\n // subtree and `fixClonedDom` inserts cloned templates into this subtree,\n // thus updating the owner doc.\n Document.prototype.importNode = function(element, deep) {\n if (element.localName === TEMPLATE_TAG) {\n return PolyfilledHTMLTemplateElement._cloneNode(element, deep);\n } else {\n var dom = Native_importNode.call(this, element, deep);\n if (deep) {\n PolyfilledHTMLTemplateElement.fixClonedDom(dom, element);\n }\n return dom;\n }\n };\n\n if (needsCloning) {\n window.HTMLTemplateElement.prototype.cloneNode = function(deep) {\n return PolyfilledHTMLTemplateElement._cloneNode(this, deep);\n };\n }\n }\n\n if (needsTemplate) {\n window.HTMLTemplateElement = PolyfilledHTMLTemplateElement;\n }\n\n})();\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):t.ES6Promise=e()}(this,function(){\"use strict\";function t(t){return\"function\"==typeof t||\"object\"==typeof t&&null!==t}function e(t){return\"function\"==typeof t}function n(t){I=t}function r(t){J=t}function o(){return function(){return process.nextTick(a)}}function i(){return\"undefined\"!=typeof H?function(){H(a)}:c()}function s(){var t=0,e=new V(a),n=document.createTextNode(\"\");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function u(){var t=new MessageChannel;return t.port1.onmessage=a,function(){return t.port2.postMessage(0)}}function c(){var t=setTimeout;return function(){return t(a,1)}}function a(){for(var t=0;t {\n\n /********************* base setup *********************/\n const useNative = Boolean('import' in document.createElement('link'));\n\n // Polyfill `currentScript` for browsers without it.\n let currentScript = null;\n if ('currentScript' in document === false) {\n Object.defineProperty(document, 'currentScript', {\n get() {\n return currentScript ||\n // NOTE: only works when called in synchronously executing code.\n // readyState should check if `loading` but IE10 is\n // interactive when scripts run so we cheat. This is not needed by\n // html-imports polyfill but helps generally polyfill `currentScript`.\n (document.readyState !== 'complete' ?\n document.scripts[document.scripts.length - 1] : null);\n },\n configurable: true\n });\n }\n\n /********************* path fixup *********************/\n const ABS_URL_TEST = /(^\\/)|(^#)|(^[\\w-\\d]*:)/;\n const CSS_URL_REGEXP = /(url\\()([^)]*)(\\))/g;\n const CSS_IMPORT_REGEXP = /(@import[\\s]+(?!url\\())([^;]*)(;)/g;\n const STYLESHEET_REGEXP = /(]*)(rel=['|\"]?stylesheet['|\"]?[^>]*>)/g;\n\n // path fixup: style elements in imports must be made relative to the main\n // document. We fixup url's in url() and @import.\n const Path = {\n\n fixUrls(element, base) {\n if (element.href) {\n element.setAttribute('href',\n Path.replaceAttrUrl(element.getAttribute('href'), base));\n }\n if (element.src) {\n element.setAttribute('src',\n Path.replaceAttrUrl(element.getAttribute('src'), base));\n }\n if (element.localName === 'style') {\n Path.resolveUrlsInStyle(element, base);\n }\n },\n\n fixUrlAttributes(element, base) {\n const attrs = ['action', 'src', 'href', 'url', 'style'];\n for (let i = 0, a; i < attrs.length && (a = attrs[i]); i++) {\n const at = element.attributes[a];\n const v = at && at.value;\n // Skip bound attribute values (assume binding is done via {} and []).\n // TODO(valdrin) consider exposing a library-implementable hook.\n if (v && (v.search(/({{|\\[\\[)/) < 0)) {\n at.value = (a === 'style') ?\n Path.resolveUrlsInCssText(v, base) :\n Path.replaceAttrUrl(v, base);\n }\n }\n },\n\n fixUrlsInTemplates(element, base) {\n const t$ = element.querySelectorAll('template');\n for (let i = 0; i < t$.length; i++) {\n Path.fixUrlsInTemplate(t$[i], base);\n }\n },\n\n fixUrlsInTemplate(template, base) {\n // If template is not supported, still resolve urls within it.\n const content = template.content || template;\n const n$ = content.querySelectorAll(\n 'style, form[action], [src], [href], [url], [style]');\n for (let i = 0; i < n$.length; i++) {\n const n = n$[i];\n if (n.localName == 'style') {\n Path.resolveUrlsInStyle(n, base);\n } else {\n Path.fixUrlAttributes(n, base);\n }\n }\n Path.fixUrlsInTemplates(content, base);\n },\n\n resolveUrlsInStyle(style, linkUrl) {\n style.textContent = Path.resolveUrlsInCssText(style.textContent, linkUrl);\n },\n\n resolveUrlsInCssText(cssText, linkUrl) {\n let r = Path.replaceUrls(cssText, linkUrl, CSS_URL_REGEXP);\n r = Path.replaceUrls(r, linkUrl, CSS_IMPORT_REGEXP);\n return r;\n },\n\n replaceUrls(text, linkUrl, regexp) {\n return text.replace(regexp, (m, pre, url, post) => {\n let urlPath = url.replace(/[\"']/g, '');\n if (linkUrl) {\n urlPath = Path.resolveUrl(urlPath, linkUrl);\n }\n return pre + '\\'' + urlPath + '\\'' + post;\n });\n },\n\n replaceAttrUrl(text, linkUrl) {\n if (text && ABS_URL_TEST.test(text)) {\n return text;\n } else {\n return Path.resolveUrl(text, linkUrl);\n }\n },\n\n resolveUrl(url, base) {\n // Lazy feature detection.\n if (Path.__workingURL === undefined) {\n Path.__workingURL = false;\n try {\n const u = new URL('b', 'http://a');\n u.pathname = 'c%20d';\n Path.__workingURL = (u.href === 'http://a/c%20d');\n } catch (e) {}\n }\n\n if (Path.__workingURL) {\n return (new URL(url, base)).href;\n }\n\n // Fallback to creating an anchor into a disconnected document.\n let doc = Path.__tempDoc;\n if (!doc) {\n doc = document.implementation.createHTMLDocument('temp');\n Path.__tempDoc = doc;\n doc.__base = doc.createElement('base');\n doc.head.appendChild(doc.__base);\n doc.__anchor = doc.createElement('a');\n }\n doc.__base.href = base;\n doc.__anchor.href = url;\n return doc.__anchor.href || url;\n }\n };\n\n /********************* Xhr processor *********************/\n const Xhr = {\n\n async: true,\n\n /**\n * @param {!string} url\n * @param {!function(!string, string=)} success\n * @param {!function(!string)} fail\n */\n load(url, success, fail) {\n if (!url) {\n fail('error: href must be specified');\n } else if (url.match(/^data:/)) {\n // Handle Data URI Scheme\n const pieces = url.split(',');\n const header = pieces[0];\n let resource = pieces[1];\n if (header.indexOf(';base64') > -1) {\n resource = atob(resource);\n } else {\n resource = decodeURIComponent(resource);\n }\n success(resource);\n } else {\n const request = new XMLHttpRequest();\n request.open('GET', url, Xhr.async);\n request.onload = () => {\n // Servers redirecting an import can add a Location header to help us\n // polyfill correctly. Handle relative and full paths.\n let redirectedUrl = request.getResponseHeader('Location');\n if (redirectedUrl && redirectedUrl.indexOf('/') === 0) {\n // In IE location.origin might not work\n // https://connect.microsoft.com/IE/feedback/details/1763802/location-origin-is-undefined-in-ie-11-on-windows-10-but-works-on-windows-7\n const origin = (location.origin || location.protocol + '//' + location.host);\n redirectedUrl = origin + redirectedUrl;\n }\n const resource = /** @type {string} */ (request.response || request.responseText);\n if (request.status === 304 || request.status === 0 ||\n request.status >= 200 && request.status < 300) {\n success(resource, redirectedUrl);\n } else {\n fail(resource);\n }\n };\n request.send();\n }\n }\n };\n\n /********************* importer *********************/\n\n const isIE = /Trident/.test(navigator.userAgent) ||\n /Edge\\/\\d./i.test(navigator.userAgent);\n\n const importSelector = 'link[rel=import]';\n\n // Used to disable loading of resources.\n const importDisableType = 'import-disable';\n\n const disabledLinkSelector = `link[rel=stylesheet][href][type=${importDisableType}]`;\n\n const importDependenciesSelector = `${importSelector}, ${disabledLinkSelector},\n style:not([type]), link[rel=stylesheet][href]:not([type]),\n script:not([type]), script[type=\"application/javascript\"],\n script[type=\"text/javascript\"]`;\n\n const importDependencyAttr = 'import-dependency';\n\n const rootImportSelector = `${importSelector}:not(${importDependencyAttr})`;\n\n const pendingScriptsSelector = `script[${importDependencyAttr}]`;\n\n const pendingStylesSelector = `style[${importDependencyAttr}],\n link[rel=stylesheet][${importDependencyAttr}]`;\n\n /**\n * Importer will:\n * - load any linked import documents (with deduping)\n * - whenever an import is loaded, prompt the parser to try to parse\n * - observe imported documents for new elements (these are handled via the\n * dynamic importer)\n */\n class Importer {\n constructor() {\n this.documents = {};\n // Used to keep track of pending loads, so that flattening and firing of\n // events can be done when all resources are ready.\n this.inflight = 0;\n this.dynamicImportsMO = new MutationObserver(m => this.handleMutations(m));\n // 1. Load imports contents\n // 2. Assign them to first import links on the document\n // 3. Wait for import styles & scripts to be done loading/running\n // 4. Fire load/error events\n whenDocumentReady(() => {\n // Observe changes on .\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.loadImports(document);\n });\n }\n\n /**\n * @param {!(HTMLDocument|DocumentFragment|Element)} doc\n */\n loadImports(doc) {\n const links = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = links.length; i < l; i++) {\n this.loadImport(links[i]);\n }\n }\n\n /**\n * @param {!HTMLLinkElement} link\n */\n loadImport(link) {\n const url = link.href;\n // This resource is already being handled by another import.\n if (this.documents[url] !== undefined) {\n // If import is already loaded, we can safely associate it to the link\n // and fire the load/error event.\n const imp = this.documents[url];\n if (imp && imp['__loaded']) {\n link.import = imp;\n this.fireEventIfNeeded(link);\n }\n return;\n }\n this.inflight++;\n // Mark it as pending to notify others this url is being loaded.\n this.documents[url] = 'pending';\n Xhr.load(url, (resource, redirectedUrl) => {\n const doc = this.makeDocument(resource, redirectedUrl || url);\n this.documents[url] = doc;\n this.inflight--;\n // Load subtree.\n this.loadImports(doc);\n this.processImportsIfLoadingDone();\n }, () => {\n // If load fails, handle error.\n this.documents[url] = null;\n this.inflight--;\n this.processImportsIfLoadingDone();\n });\n }\n\n /**\n * Creates a new document containing resource and normalizes urls accordingly.\n * @param {string=} resource\n * @param {string=} url\n * @return {!DocumentFragment}\n */\n makeDocument(resource, url) {\n if (!resource) {\n return document.createDocumentFragment();\n }\n\n if (isIE) {\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order. We disable the loading by\n // setting the type before setting innerHTML to avoid loading\n // resources twice.\n resource = resource.replace(STYLESHEET_REGEXP, (match, p1, p2) => {\n if (match.indexOf('type=') === -1) {\n return `${p1} type=${importDisableType} ${p2}`;\n }\n return match;\n });\n }\n\n let content;\n const template = /** @type {!HTMLTemplateElement} */\n (document.createElement('template'));\n template.innerHTML = resource;\n if (template.content) {\n // This creates issues in Safari10 when used with shadydom (see #12).\n content = template.content;\n } else {\n // not supported, create fragment and move content into it.\n content = document.createDocumentFragment();\n while (template.firstChild) {\n content.appendChild(template.firstChild);\n }\n }\n\n // Support in imported docs. Resolve url and remove its href.\n const baseEl = content.querySelector('base');\n if (baseEl) {\n url = Path.replaceAttrUrl(baseEl.getAttribute('href'), url);\n baseEl.removeAttribute('href');\n }\n\n const n$ = /** @type {!NodeList} */\n (content.querySelectorAll(importDependenciesSelector));\n // For source map hints.\n let inlineScriptIndex = 0;\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n // Listen for load/error events, then fix urls.\n whenElementLoaded(n);\n Path.fixUrls(n, url);\n // Mark for easier selectors.\n n.setAttribute(importDependencyAttr, '');\n // Generate source map hints for inline scripts.\n if (n.localName === 'script' && !n.src && n.textContent) {\n const num = inlineScriptIndex ? `-${inlineScriptIndex}` : '';\n const content = n.textContent + `\\n//# sourceURL=${url}${num}.js\\n`;\n // We use the src attribute so it triggers load/error events, and it's\n // easier to capture errors (e.g. parsing) like this.\n n.setAttribute('src', 'data:text/javascript;charset=utf-8,' + encodeURIComponent(content));\n n.textContent = '';\n inlineScriptIndex++;\n }\n }\n Path.fixUrlsInTemplates(content, url);\n return content;\n }\n\n /**\n * Waits for loaded imports to finish loading scripts and styles, then fires\n * the load/error events.\n */\n processImportsIfLoadingDone() {\n // Wait until all resources are ready, then load import resources.\n if (this.inflight) {\n return;\n }\n\n // Stop observing, flatten & load resource, then restart observing .\n this.dynamicImportsMO.disconnect();\n this.flatten(document);\n // We wait for styles to load, and at the same time we execute the scripts,\n // then fire the load/error events for imports to have faster whenReady\n // callback execution.\n // NOTE: This is different for native behavior where scripts would be\n // executed after the styles before them are loaded.\n // To achieve that, we could select pending styles and scripts in the\n // document and execute them sequentially in their dom order.\n let scriptsOk = false,\n stylesOk = false;\n const onLoadingDone = () => {\n if (stylesOk && scriptsOk) {\n // Restart observing.\n this.dynamicImportsMO.observe(document.head, {\n childList: true,\n subtree: true\n });\n this.fireEvents();\n }\n }\n this.waitForStyles(() => {\n stylesOk = true;\n onLoadingDone();\n });\n this.runScripts(() => {\n scriptsOk = true;\n onLoadingDone();\n });\n }\n\n /**\n * @param {!HTMLDocument} doc\n */\n flatten(doc) {\n const n$ = /** @type {!NodeList} */\n (doc.querySelectorAll(importSelector));\n for (let i = 0, l = n$.length, n; i < l && (n = n$[i]); i++) {\n const imp = this.documents[n.href];\n n.import = /** @type {!Document} */ (imp);\n if (imp && imp.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // We set the .import to be the link itself, and update its readyState.\n // Other links with the same href will point to this link.\n this.documents[n.href] = n;\n n.readyState = 'loading';\n // Suppress Closure warning about incompatible subtype assignment.\n ( /** @type {!HTMLElement} */ (n).import = n);\n // Override baseURI so that link.import.baseURI can be used seemlessly\n // on native or polyfilled html-imports.\n Object.defineProperty(n, 'baseURI', {\n get: () => n.href,\n configurable: true,\n enumerable: true\n });\n this.flatten(imp);\n n.appendChild(imp);\n }\n }\n }\n\n /**\n * Replaces all the imported scripts with a clone in order to execute them.\n * Updates the `currentScript`.\n * @param {!function()} callback\n */\n runScripts(callback) {\n const s$ = document.querySelectorAll(pendingScriptsSelector);\n const l = s$.length;\n const cloneScript = i => {\n if (i < l) {\n // The pending scripts have been generated through innerHTML and\n // browsers won't execute them for security reasons. We cannot use\n // s.cloneNode(true) either, the only way to run the script is manually\n // creating a new element and copying its attributes.\n const s = s$[i];\n const clone = /** @type {!HTMLScriptElement} */\n (document.createElement('script'));\n // Remove import-dependency attribute to avoid double cloning.\n s.removeAttribute(importDependencyAttr);\n for (let j = 0, ll = s.attributes.length; j < ll; j++) {\n clone.setAttribute(s.attributes[j].name, s.attributes[j].value);\n }\n // Update currentScript and replace original with clone script.\n currentScript = clone;\n s.parentNode.replaceChild(clone, s);\n whenElementLoaded(clone, () => {\n currentScript = null;\n cloneScript(i + 1);\n });\n } else {\n callback();\n }\n };\n cloneScript(0);\n }\n\n /**\n * Waits for all the imported stylesheets/styles to be loaded.\n * @param {!function()} callback\n */\n waitForStyles(callback) {\n const s$ = /** @type {!NodeList} */\n (document.querySelectorAll(pendingStylesSelector));\n let pending = s$.length;\n if (!pending) {\n callback();\n return;\n }\n // should be appended to . Not doing so\n // in IE/Edge breaks the cascading order\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/10472273/\n // If there is one imported, we must move all imported\n // links and styles to .\n const needsMove = isIE && !!document.querySelector(disabledLinkSelector);\n for (let i = 0, l = s$.length, s; i < l && (s = s$[i]); i++) {\n // Listen for load/error events, remove selector once is done loading.\n whenElementLoaded(s, () => {\n s.removeAttribute(importDependencyAttr);\n if (--pending === 0) {\n callback();\n }\n });\n // Check if was already moved to head, to handle the case where the element\n // has already been moved but it is still loading.\n if (needsMove && s.parentNode !== document.head) {\n // Replace the element we're about to move with a placeholder.\n const placeholder = document.createElement(s.localName);\n // Add reference of the moved element.\n placeholder['__appliedElement'] = s;\n // Disable this from appearing in document.styleSheets.\n placeholder.setAttribute('type', 'import-placeholder');\n // Append placeholder next to the sibling, and move original to .\n s.parentNode.insertBefore(placeholder, s.nextSibling);\n let newSibling = importForElement(s);\n while (newSibling && importForElement(newSibling)) {\n newSibling = importForElement(newSibling);\n }\n if (newSibling.parentNode !== document.head) {\n newSibling = null;\n }\n document.head.insertBefore(s, newSibling);\n // Enable the loading of .\n s.removeAttribute('type');\n }\n }\n }\n\n /**\n * Fires load/error events for imports in the right order .\n */\n fireEvents() {\n const n$ = /** @type {!NodeList} */\n (document.querySelectorAll(importSelector));\n // Inverse order to have events firing bottom-up.\n for (let i = n$.length - 1, n; i >= 0 && (n = n$[i]); i--) {\n this.fireEventIfNeeded(n);\n }\n }\n\n /**\n * Fires load/error event for the import if this wasn't done already.\n * @param {!HTMLLinkElement} link\n */\n fireEventIfNeeded(link) {\n // Don't fire twice same event.\n if (!link['__loaded']) {\n link['__loaded'] = true;\n // Update link's import readyState.\n link.import && (link.import.readyState = 'complete');\n const eventType = link.import ? 'load' : 'error';\n link.dispatchEvent(newCustomEvent(eventType, {\n bubbles: false,\n cancelable: false,\n detail: undefined\n }));\n }\n }\n\n /**\n * @param {Array} mutations\n */\n handleMutations(mutations) {\n for (let i = 0; i < mutations.length; i++) {\n const m = mutations[i];\n if (!m.addedNodes) {\n continue;\n }\n for (let ii = 0; ii < m.addedNodes.length; ii++) {\n const elem = m.addedNodes[ii];\n if (!elem || elem.nodeType !== Node.ELEMENT_NODE) {\n continue;\n }\n // NOTE: added scripts are not updating currentScript in IE.\n if (isImportLink(elem)) {\n this.loadImport( /** @type {!HTMLLinkElement} */ (elem));\n } else {\n this.loadImports( /** @type {!Element} */ (elem));\n }\n }\n }\n }\n }\n\n /**\n * @param {!Node} node\n * @return {boolean}\n */\n const isImportLink = node => {\n return node.nodeType === Node.ELEMENT_NODE && node.localName === 'link' &&\n ( /** @type {!HTMLLinkElement} */ (node).rel === 'import');\n };\n\n /**\n * Waits for an element to finish loading. If already done loading, it will\n * mark the element accordingly.\n * @param {!(HTMLLinkElement|HTMLScriptElement|HTMLStyleElement)} element\n * @param {function()=} callback\n */\n const whenElementLoaded = (element, callback) => {\n if (element['__loaded']) {\n callback && callback();\n } else if (element.localName === 'script' && !element.src) {\n // Inline scripts don't trigger load/error events, consider them already loaded.\n element['__loaded'] = true;\n callback && callback();\n } else {\n const onLoadingDone = event => {\n element.removeEventListener(event.type, onLoadingDone);\n element['__loaded'] = true;\n callback && callback();\n };\n element.addEventListener('load', onLoadingDone);\n // NOTE: We listen only for load events in IE/Edge, because in IE/Edge\n // \n\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: None\r\n * Used in: Chrome\r\n */\r\n\r\n// TODO: This needs to not exist at all.\r\n\r\n// TODO(notwaldorf): Remove after this is addressed:\r\n// https://github.com/webcomponents/shadycss/issues/46\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport * as StyleUtil from './style-util'\nimport {nativeShadow} from './style-settings'\n\n/* Transforms ShadowDOM styling into ShadyDOM styling\n\n* scoping:\n\n * elements in scope get scoping selector class=\"x-foo-scope\"\n * selectors re-written as follows:\n\n div button -> div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n // Given a node and scope name, add a scoping class to each node\n // in the tree. This facilitates transforming css into scoped rules.\n dom(node, scope, shouldRemoveScope) {\n // one time optimization to skip scoping...\n if (node.__styleScoped) {\n node.__styleScoped = null;\n } else {\n this._transformDom(node, scope || '', shouldRemoveScope);\n }\n }\n\n _transformDom(node, selector, shouldRemoveScope) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.element(node, selector, shouldRemoveScope);\n }\n let c$ = (node.localName === 'template') ?\n (node.content || node._content).childNodes :\n node.children || node.childNodes;\n if (c$) {\n for (let i=0; i `:${type}(${inner.replace(/\\s/g, '')})`);\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope ? this._transformSimpleSelector(selector, scope) :\n selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n let p$ = selector.split(PSEUDO_PREFIX);\n p$[0] += scope;\n return p$.join(PSEUDO_PREFIX);\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = m && m[2].trim() || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n } else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function(m, host, paren) {\n return hostScope + paren;\n });\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n } else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n documentRule(rule) {\n // reset selector in case this is redone.\n rule.selector = rule.parsedSelector;\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n normalizeRootSelector(rule) {\n if (rule.selector === ROOT) {\n rule.selector = 'html';\n }\n }\n\n _transformDocumentSelector(selector) {\n return selector.match(SLOTTED) ?\n this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=\\[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nexport default new StyleTransformer()","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport default {};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport templateMap from './template-map'\n\nconst promise = Promise.resolve();\n\nexport default class StyleInfo {\n static get(node) {\n return node.__styleInfo;\n }\n static set(node, styleInfo) {\n node.__styleInfo = styleInfo;\n return styleInfo;\n }\n static invalidate(elementName) {\n if (templateMap[elementName]) {\n templateMap[elementName]._applyShimInvalid = true;\n }\n }\n /*\n the template is marked as `validating` for one microtask so that all instances\n found in the tree crawl of `applyStyle` will update themselves,\n but the template will only be updated once.\n */\n static startValidating(elementName) {\n const template = templateMap[elementName];\n if (!template._validating) {\n template._validating = true;\n promise.then(() => {\n template._applyShimInvalid = false;\n template._validating = false;\n });\n }\n }\n constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n this.styleRules = ast || null;\n this.placeholder = placeholder || null;\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n this.overrideStyleProperties = null;\n this.elementName = elementName || '';\n this.cssBuild = cssBuild || '';\n this.typeExtension = typeExtension || '';\n this.styleProperties = null;\n this.scopeSelector = null;\n this.customStyle = null;\n }\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {applyStylePlaceHolder} from './style-util'\nimport {nativeShadow} from './style-settings'\n\nlet placeholderMap = {};\n\nconst ce = window.customElements;\nif (ce && !nativeShadow) {\n const origDefine = ce.define;\n ce.define = function(name, clazz, options) {\n placeholderMap[name] = applyStylePlaceHolder(name);\n return origDefine.call(ce, name, clazz, options);\n };\n}\n\nexport default placeholderMap;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/**\n * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n * --foo: {color: red; background: blue;}\n *\n * to this:\n *\n * --foo_-_color: red;\n * --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n * --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n * --foo_-_border: 2px solid red;\n * --foo_-_color: initial;\n * --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n * background: orange;\n * @apply --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background, orange);\n * border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\nimport {rx, forEachRule, processVariableAndFallback, rulesForStyle} from './style-util'\nimport templateMap from './template-map'\nimport StyleInfo from './style-info'\n\nlet MIXIN_MATCH = rx.MIXIN_MATCH;\nlet VAR_ASSIGN = rx.VAR_ASSIGN;\n\nlet APPLY_NAME_CLEAN = /;\\s*/m;\nlet INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nlet MIXIN_VAR_SEP = '_-_';\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n constructor() {\n this._map = {};\n }\n set(name, props) {\n name = name.trim();\n this._map[name] = {\n properties: props,\n dependants: {}\n }\n }\n get(name) {\n name = name.trim();\n return this._map[name];\n }\n}\n\nclass ApplyShim {\n constructor() {\n this._currentTemplate = null;\n this._measureElement = null;\n this._map = new MixinMap();\n this._separator = MIXIN_VAR_SEP;\n this._boundProduceCssProperties = (\n matchText, propertyName, valueProperty, valueMixin) =>\n this._produceCssProperties(\n matchText, propertyName, valueProperty, valueMixin);\n }\n // return true if `cssText` contains a mixin definition or consumption\n detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n }\n transformStyle(style, elementName) {\n let ast = rulesForStyle(style);\n this.transformRules(ast, elementName);\n return ast;\n }\n transformRules(rules, elementName) {\n this._currentTemplate = templateMap[elementName];\n forEachRule(rules, (r) => {\n this.transformRule(r);\n });\n this._currentTemplate = null;\n }\n transformRule(rule) {\n rule.cssText = this.transformCssText(rule.parsedCssText);\n // :root was only used for variable assignment in property shim,\n // but generates invalid selectors with real properties.\n // replace with `:host > *`, which serves the same effect\n if (rule.selector === ':root') {\n rule.selector = ':host > *';\n }\n }\n transformCssText(cssText) {\n // produce variables\n cssText = cssText.replace(VAR_ASSIGN, this._boundProduceCssProperties);\n // consume mixins\n return this._consumeCssProperties(cssText);\n }\n _getInitialValueForProperty(property) {\n if (!this._measureElement) {\n this._measureElement = document.createElement('meta');\n this._measureElement.style.all = 'initial';\n document.head.appendChild(this._measureElement);\n }\n return window.getComputedStyle(this._measureElement).getPropertyValue(property);\n }\n // replace mixin consumption with variable consumption\n _consumeCssProperties(text) {\n let m;\n // loop over text until all mixins with defintions have been applied\n while((m = MIXIN_MATCH.exec(text))) {\n let matchText = m[0];\n let mixinName = m[1];\n let idx = m.index;\n // collect properties before apply to be \"defaults\" if mixin might override them\n // match includes a \"prefix\", so find the start and end positions of @apply\n let applyPos = idx + matchText.indexOf('@apply');\n let afterApplyPos = idx + matchText.length;\n // find props defined before this @apply\n let textBeforeApply = text.slice(0, applyPos);\n let textAfterApply = text.slice(afterApplyPos);\n let defaults = this._cssTextToMap(textBeforeApply);\n let replacement = this._atApplyToCssProperties(mixinName, defaults);\n // use regex match position to replace mixin, keep linear processing time\n text = [textBeforeApply, replacement, textAfterApply].join('');\n // move regex search to _after_ replacement\n MIXIN_MATCH.lastIndex = idx + replacement.length;\n }\n return text;\n }\n // produce variable consumption at the site of mixin consumption\n // @apply --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n // Example:\n // border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n _atApplyToCssProperties(mixinName, fallbacks) {\n mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n let vars = [];\n let mixinEntry = this._map.get(mixinName);\n // if we depend on a mixin before it is created\n // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n if (!mixinEntry) {\n this._map.set(mixinName, {});\n mixinEntry = this._map.get(mixinName);\n }\n if (mixinEntry) {\n if (this._currentTemplate) {\n mixinEntry.dependants[this._currentTemplate.name] = this._currentTemplate;\n }\n let p, parts, f;\n for (p in mixinEntry.properties) {\n f = fallbacks && fallbacks[p];\n parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n if (f) {\n parts.push(',', f);\n }\n parts.push(')');\n vars.push(parts.join(''));\n }\n }\n return vars.join('; ');\n }\n\n _replaceInitialOrInherit(property, value) {\n let match = INITIAL_INHERIT.exec(value);\n if (match) {\n if (match[1]) {\n // initial\n // replace `initial` with the concrete initial value for this property\n value = ApplyShim._getInitialValueForProperty(property);\n } else {\n // inherit\n // with this purposfully illegal value, the variable will be invalid at\n // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n // and for inheriting values, will behave similarly\n // we cannot support the same behavior for non inheriting values like 'border'\n value = 'apply-shim-inherit';\n }\n }\n return value;\n }\n\n // \"parse\" a mixin definition into a map of properties and values\n // cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n _cssTextToMap(text) {\n let props = text.split(';');\n let property, value;\n let out = {};\n for (let i = 0, p, sp; i < props.length; i++) {\n p = props[i];\n if (p) {\n sp = p.split(':');\n // ignore lines that aren't definitions like @media\n if (sp.length > 1) {\n property = sp[0].trim();\n // some properties may have ':' in the value, like data urls\n value = this._replaceInitialOrInherit(property, sp.slice(1).join(':'));\n out[property] = value;\n }\n }\n }\n return out;\n }\n\n _invalidateMixinEntry(mixinEntry) {\n for (let elementName in mixinEntry.dependants) {\n if (!this._currentTemplate || elementName !== this._currentTemplate.name) {\n StyleInfo.invalidate(elementName);\n }\n }\n }\n\n _produceCssProperties(matchText, propertyName, valueProperty, valueMixin) {\n // handle case where property value is a mixin\n if (valueProperty) {\n // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n processVariableAndFallback(valueProperty, (prefix, value) => {\n if (value && this._map.get(value)) {\n valueMixin = '@apply ' + value + ';';\n }\n });\n }\n if (!valueMixin) {\n return matchText;\n }\n let mixinAsProperties = this._consumeCssProperties(valueMixin);\n let prefix = matchText.slice(0, matchText.indexOf('--'));\n let mixinValues = this._cssTextToMap(mixinAsProperties);\n let combinedProps = mixinValues;\n let mixinEntry = this._map.get(propertyName);\n let oldProps = mixinEntry && mixinEntry.properties;\n if (oldProps) {\n // NOTE: since we use mixin, the map of properties is updated here\n // and this is what we want.\n combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n } else {\n this._map.set(propertyName, combinedProps);\n }\n let out = [];\n let p, v;\n // set variables defined by current mixin\n let needToInvalidate = false;\n for (p in combinedProps) {\n v = mixinValues[p];\n // if property not defined by current mixin, set initial\n if (v === undefined) {\n v = 'initial';\n }\n if (oldProps && !(p in oldProps)) {\n needToInvalidate = true;\n }\n out.push(propertyName + MIXIN_VAR_SEP + p + ': ' + v);\n }\n if (needToInvalidate) {\n this._invalidateMixinEntry(mixinEntry);\n }\n if (mixinEntry) {\n mixinEntry.properties = combinedProps;\n }\n // because the mixinMap is global, the mixin might conflict with\n // a different scope's simple variable definition:\n // Example:\n // some style somewhere:\n // --mixin1:{ ... }\n // --mixin2: var(--mixin1);\n // some other element:\n // --mixin1: 10px solid red;\n // --foo: var(--mixin1);\n // In this case, we leave the original variable definition in place.\n if (valueProperty) {\n prefix = matchText + ';' + prefix;\n }\n return prefix + out.join('; ') + ';';\n }\n}\n\nlet applyShim = new ApplyShim();\nwindow['ApplyShim'] = applyShim;\nexport default applyShim;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\n\nexport let flush = function() {};\n\nif (!nativeShadow) {\n let elementNeedsScoping = (element) => {\n return (element.classList &&\n !element.classList.contains(StyleTransformer.SCOPE_NAME) ||\n // note: necessary for IE11\n (element instanceof SVGElement && (!element.hasAttribute('class') ||\n element.getAttribute('class').indexOf(StyleTransformer.SCOPE_NAME) < 0)));\n }\n\n let handler = (mxns) => {\n for (let x=0; x < mxns.length; x++) {\n let mxn = mxns[x];\n if (mxn.target === document.documentElement ||\n mxn.target === document.head) {\n continue;\n }\n for (let i=0; i < mxn.addedNodes.length; i++) {\n let n = mxn.addedNodes[i];\n if (elementNeedsScoping(n)) {\n let root = n.getRootNode();\n if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // may no longer be in a shadowroot\n let host = root.host;\n if (host) {\n let scope = host.is || host.localName;\n StyleTransformer.dom(n, scope);\n }\n }\n }\n }\n for (let i=0; i < mxn.removedNodes.length; i++) {\n let n = mxn.removedNodes[i];\n if (n.nodeType === Node.ELEMENT_NODE) {\n let classes = undefined;\n if (n.classList) {\n classes = Array.from(n.classList);\n } else if (n.hasAttribute('class')) {\n classes = n.getAttribute('class').split(/\\s+/);\n }\n if (classes !== undefined) {\n // NOTE: relies on the scoping class always being adjacent to the\n // SCOPE_NAME class.\n let classIdx = classes.indexOf(StyleTransformer.SCOPE_NAME);\n if (classIdx >= 0) {\n let scope = classes[classIdx + 1];\n if (scope) {\n StyleTransformer.dom(n, scope, true);\n }\n }\n }\n }\n }\n }\n };\n\n let observer = new MutationObserver(handler);\n let start = (node) => {\n observer.observe(node, {childList: true, subtree: true});\n }\n let nativeCustomElements = (window.customElements &&\n !window.customElements.flush);\n // need to start immediately with native custom elements\n // TODO(dfreedm): with polyfilled HTMLImports and native custom elements\n // excessive mutations may be observed; this can be optimized via cooperation\n // with the HTMLImports polyfill.\n if (nativeCustomElements) {\n start(document);\n } else {\n let delayedStart = () => {\n start(document.body);\n }\n // use polyfill timing if it's available\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(delayedStart);\n // otherwise push beyond native imports being ready\n // which requires RAF + readystate interactive.\n } else {\n requestAnimationFrame(function() {\n if (document.readyState === 'loading') {\n let listener = function() {\n delayedStart();\n document.removeEventListener('readystatechange', listener);\n }\n document.addEventListener('readystatechange', listener);\n } else {\n delayedStart();\n }\n });\n }\n }\n\n flush = function() {\n handler(observer.takeRecords());\n }\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {parse} from './css-parse'\nimport {nativeShadow, nativeCssVariables, nativeCssApply} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleProperties from './style-properties'\nimport templateMap from './template-map'\nimport placeholderMap from './style-placeholder'\nimport StyleInfo from './style-info'\nimport StyleCache from './style-cache'\n\n// TODO(dfreedm): consider spliting into separate global\nimport ApplyShim from './apply-shim'\nimport {flush as watcherFlush} from './document-watcher'\n\nlet styleCache = new StyleCache();\n\nclass ShadyCSS {\n constructor() {\n this._scopeCounter = {};\n this._documentOwner = document.documentElement;\n this._documentOwnerStyleInfo = StyleInfo.set(document.documentElement, new StyleInfo({rules: []}));\n this._elementsHaveApplied = false;\n }\n get nativeShadow() {\n return nativeShadow;\n }\n get nativeCss() {\n return nativeCssVariables;\n }\n get nativeCssApply() {\n return nativeCssApply;\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 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 (!this.nativeShadow) {\n StyleTransformer.dom(template.content, elementName);\n }\n // check if the styling has mixin definitions or uses\n let hasMixins = ApplyShim.detectMixin(cssText);\n let ast = parse(cssText);\n // only run the applyshim transforms if there is a mixin involved\n if (hasMixins && this.nativeCss && !this.nativeCssApply) {\n ApplyShim.transformRules(ast, elementName);\n }\n template._styleAst = ast;\n\n let ownPropertyNames = [];\n if (!this.nativeCss) {\n ownPropertyNames = StyleProperties.decorateStyles(template._styleAst, info);\n }\n if (!ownPropertyNames.length || this.nativeCss) {\n let root = this.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 = host.getAttribute('is') || host.localName;\n let typeExtension;\n if (is !== host.localName) {\n typeExtension = host.localName;\n }\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 applyStyle(host, overrideProps) {\n let is = host.getAttribute('is') || host.localName;\n let styleInfo = StyleInfo.get(host);\n let hasApplied = Boolean(styleInfo);\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 (window.CustomStyle) {\n let CS = window.CustomStyle;\n if (CS._documentDirty) {\n CS.findStyles();\n if (!this.nativeCss) {\n this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n } else if (!this.nativeCssApply) {\n CS._revalidateApplyShim();\n }\n CS.applyStyles();\n // if no elements have booted yet, we can just update the document and be done\n if (!this._elementsHaveApplied) {\n return;\n }\n // if no native css custom properties, we must recalculate the whole tree\n if (!this.nativeCss) {\n this.updateStyles();\n /*\n When updateStyles() runs, this element may not have a shadowroot yet.\n If not, we need to make sure that this element runs `applyStyle` on itself at least once to generate a style\n */\n if (hasApplied) {\n return;\n }\n }\n }\n }\n if (overrideProps) {\n styleInfo.overrideStyleProperties =\n styleInfo.overrideStyleProperties || {};\n Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n }\n if (this.nativeCss) {\n if (styleInfo.overrideStyleProperties) {\n this._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._applyShimInvalid && template._style) {\n // update template\n if (!template._validating) {\n ApplyShim.transformRules(template._styleAst, is);\n template._style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n StyleInfo.startValidating(is);\n }\n // update instance if native shadowdom\n if (this.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 } else {\n this._updateProperties(host, styleInfo);\n if (styleInfo.ownStylePropertyNames && styleInfo.ownStylePropertyNames.length) {\n this._applyStyleProperties(host, styleInfo);\n }\n }\n if (hasApplied) {\n let root = this._isRootOwner(host) ? host : host.shadowRoot;\n // note: some elements may not have a root!\n if (root) {\n this._applyToDescendants(root);\n }\n }\n }\n _applyToDescendants(root) {\n // note: fallback to childNodes to support recursing into SVG which\n // does not support children in some browsers (Edge/IE)\n let c$ = root.children || root.childNodes;\n for (let i = 0, c; i < c$.length; i++) {\n c = c$[i];\n if (c.shadowRoot) {\n this.applyStyle(c);\n }\n this._applyToDescendants(c);\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 = host.getAttribute('is') || host.localName;\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 (!this.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 _updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n }\n updateStyles(properties) {\n this.applyStyle(this._documentOwner, properties);\n }\n /* Custom Style operations */\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 (this.nativeCss && !this.nativeCssApply) {\n ApplyShim.transformRule(rule);\n }\n });\n if (this.nativeCss) {\n style.textContent = StyleUtil.toCssText(ast);\n } else {\n this._documentOwnerStyleInfo.styleRules.rules.push(ast);\n }\n }\n _revalidateApplyShim(style) {\n if (this.nativeCss && !this.nativeCssApply) {\n let ast = StyleUtil.rulesForStyle(style);\n ApplyShim.transformRules(ast);\n style.textContent = StyleUtil.toCssText(ast);\n }\n }\n _applyCustomStyleToDocument(style) {\n if (!this.nativeCss) {\n StyleProperties.applyCustomStyle(style, this._documentOwnerStyleInfo.styleProperties);\n }\n }\n getComputedStyleValue(element, property) {\n let value;\n if (!this.nativeCss) {\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.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 (!this.nativeCss) {\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\nwindow['ShadyCSS'] = new ShadyCSS();","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';\n\nexport default class StyleCache {\n constructor(typeMax = 100) {\n // map element name -> [{properties, styleElement, scopeSelector}]\n this.cache = {};\n this.typeMax = typeMax;\n }\n\n _validate(cacheEntry, properties, ownPropertyNames) {\n for (let idx = 0; idx < ownPropertyNames.length; idx++) {\n let pn = ownPropertyNames[idx];\n if (cacheEntry.properties[pn] !== properties[pn]) {\n return false;\n }\n }\n return true;\n }\n\n store(tagname, properties, styleElement, scopeSelector) {\n let list = this.cache[tagname] || [];\n list.push({properties, styleElement, scopeSelector});\n if (list.length > this.typeMax) {\n list.shift();\n }\n this.cache[tagname] = list;\n }\n\n fetch(tagname, properties, ownPropertyNames) {\n let list = this.cache[tagname];\n if (!list) {\n return;\n }\n // reverse list for most-recent lookups\n for (let idx = list.length - 1; idx >= 0; idx--) {\n let entry = list[idx];\n if (this._validate(entry, properties, ownPropertyNames)) {\n return entry;\n }\n }\n }\n}\n"]}
\ No newline at end of file
+{"version":3,"sources":["webcomponents-none-index.js","bower_components/shadycss/src/css-parse.js","bower_components/shadycss/src/style-settings.js","bower_components/shadycss/src/style-util.js","bower_components/shadycss/src/style-properties.js","bower_components/shadycss/src/apply-shim-utils.js","bower_components/shadycss/src/document-wait.js","bower_components/shadycss/src/common-utils.js","bower_components/shadycss/src/common-regex.js","bower_components/shadycss/src/style-transformer.js","bower_components/shadycss/src/style-info.js","bower_components/shadycss/src/style-placeholder.js","bower_components/shadycss/src/document-watcher.js","bower_components/shadycss/src/template-map.js","bower_components/shadycss/src/custom-style-interface.js","bower_components/shadycss/src/scoping-shim.js","bower_components/shadycss/src/style-cache.js","bower_components/shadycss/entrypoints/scoping-shim.js"],"names":["parse","text","clean","parseCss","lex","cssText","replace","RX","comments","port","root","StyleNode","length","n","i","l","OPEN_BRACE","p","previous","push","CLOSE_BRACE","node","t","substring","trim","ss","_expandUnicodeEscapes","multipleSpaces","lastIndexOf","s","indexOf","types","MEDIA_RULE","match","keyframesRule","KEYFRAMES_RULE","split","pop","VAR_START","MIXIN_RULE","STYLE_RULE","r$","r","code","arguments","repeat","stringify","preserveProperties","_hasMixinRules","removeCustomProps","rules","removeCustomPropAssignment","removeCustomPropApply","customProp","mixinProp","mixinApply","varApply","parseSettings","settings","nativeCssVariables","nativeShadow","toCssText","callback","forEachRule","rulesForStyle","style","textContent","isKeyframesSelector","rule","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","type","matchMedia","MEDIA_MATCH","window","matches","applyCss","moniker","target","contextNode","createScopeStyle","applyStyle","document","head","after","nextSibling","firstChild","lastHeadApplyNode","insertBefore","createElement","setAttribute","applyStylePlaceHolder","placeHolder","createComment","scope","findMatchingParen","start","level","processVariableAndFallback","str","end","inner","prefix","suffix","comma","value","fallback","setElementClassRaw","element","call","getIsExtends","is","getAttribute","localName","extendz","extends","addToBitMask","bits","o","parseInt","invalidate","elementName","template","templateMap","invalidateTemplate","templateIsValid","templateIsValidating","_validating","startValidatingTemplate","promise","then","documentWait","whenReady","readyPromise","Promise","resolve","resolveFn","readyState","addEventListener","updateNativeProperties","properties","removeProperty","setProperty","constructor","navigator","userAgent","CSS","supports","ShadyCSS","VAR_ASSIGN","MIXIN_MATCH","VAR_CONSUMED","ANIMATION_MATCH","BRACKETED","SCOPE_NAME","StyleTransformer","dom","shouldRemoveScope","_transformDom","selector","nodeType","Node","ELEMENT_NODE","c$","content","_content","childNodes","children","classList","remove","add","c","newValue","StyleUtil.setElementClassRaw","elementStyles","styleRules","cssBuildType","StyleUtil.toCssText","ex","StyleUtil.getIsExtends","css","ext","hostScope","_calcHostScope","_calcElementScope","self","isScoped","_transformRule","_transformComplexSelector","transformer","transformedSelector","_transformRuleCss","p$","COMPLEX_SELECTOR_SEP","StyleUtil.isKeyframesSelector","join","stop","NTH","m","SLOTTED_START","HOST","SIMPLE_SELECTOR_SEP","info","_transformCompoundSelector","combinator","slottedIndex","SLOTTED","_transformHostSelector","_transformSimpleSelector","slotted","SLOTTED_PAREN","paren","DIR_PAREN","before","dir","PSEUDO_PREFIX","HOST_PAREN","SIMPLE_SELECTOR_PREFIX","typeSelector","host","documentRule","normalizeRootSelector","_transformDocumentSelector","SCOPE_DOC_SELECTOR","StyleTransformer$1","infoKey","StyleInfo","get","set","styleInfo","ast","placeholder","ownStylePropertyNames","typeExtension","cssBuild","overrideStyleProperties","styleProperties","scopeSelector","customStyle","_getStyleRules","prototype","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","Element","IS_IE","XSCOPE_NAME","StyleProperties","decorateStyles","props","keyframes","ruleIndex","StyleUtil.forEachRule","decorateRule","index","collectPropertiesInCssText","propertyInfo","_keyframes","names","hasProperties","collectProperties","collectCssText","any","RX.VAR_ASSIGN","exec","Object","assign","collectConsumingCssText","RX.BRACKETED","name","RX.VAR_CONSUMED","reify","getOwnPropertyNames","valueForProperty","property","valueForProperties","StyleUtil.processVariableAndFallback","propertyValue","parts","RX.MIXIN_MATCH","lastIndex","colon","pp","slice","applyProperties","output","applyKeyframeTransforms","keyframeTransforms","input","hasAnimations","RX.ANIMATION_MATCH","test","transform","keyframeNamesToTransform","keyframe","propertyDataFromStyles","selectorToMatch","key","whenHostOrRootRule","isExtends","parsedSelector","isRoot","isHost","hostAndRootPropertiesForScope","hostProps","rootProps","_element","transformStyles","hostSelector","rxHostSelector","hostRx","RegExp","RX.HOST_PREFIX","_elementKeyframeTransforms","_scopeSelector","keyframesRules","_scopeKeyframes","_keyframesRuleTransformer","keyframesNameRx","transformedKeyframesName","scopeId","applyElementScopeSelector","old","v","applyElementStyle","parentNode","removeChild","StyleUtil.applyCss","shadowRoot","StyleUtil.applyStyle","applyCustomStyle","StyleUtil.rulesForStyle","StyleProperties$1","placeholderMap","ce","origDefine","clazz","options","flush","elementNeedsScoping","contains","hasAttribute","handler","mxns","mxn","x","documentElement","addedNodes","getRootNode","DOCUMENT_FRAGMENT_NODE","removedNodes","classes","Array","from","classIdx","observer","MutationObserver","observe","childList","subtree","nativeCustomElements","customElements","delayedStart","body","requestAnimationFrame","listener","removeEventListener","takeRecords","PROCESSED_MARKER","SEEN_MARKER","transformFn","validateFn","CustomStyleInterface","enqueueDocumentValidation","addCustomStyle","getStyleForCustomStyle","findStyles","cs","appliedStyle","attr","attributes","defineProperties","fn","needsEnqueue","styleCache","typeMax","cache","_validate","cacheEntry","ownPropertyNames","pn","idx","store","tagname","styleElement","list","shift","fetch","entry","ScopingShim","_scopeCounter","_documentOwner","_documentOwnerStyleInfo","_elementsHaveApplied","_applyShim","_customStyleInterface","_ensure","watcherFlush","_generateScopeSelector","id","getStyleAst","styleAstToString","_gatherStyles","styles","querySelectorAll","_getCssBuild","querySelector","prepareTemplate","_prepared","__cssBuild","hasMixins","_styleAst","_cssBuild","_generateStaticStyle","_style","_ownPropertyNames","shadowroot","_prepareHost","_ensureApplyShim","ApplyShim","ApplyShimUtils.invalidate","_ensureCustomStyleInterface","transformCustomStyleForDocument","flushCustomStyles","customStyles","_revalidateCustomStyleApplyShim","_updateProperties","_applyCustomStyles","styleDocument","overrideProps","_isRootOwner","_applyStyleProperties","ApplyShimUtils.templateIsValid","ApplyShimUtils.templateIsValidating","ApplyShimUtils.startValidatingTemplate","_styleOwnerForNode","cachedScopeSelector","cachedStyle","oldScopeSelector","owner","ownerStyleInfo","ownerProperties","create","hostAndRootProps","propertyData","propertiesMatchingHost","_mixinOverrideStyles","overrides","styleSubtree","shadowChildren","_revalidateApplyShim","getComputedStyleValue","getComputedStyle","getPropertyValue","setElementClass","classString","scopeName","classAttr","k$","_styleInfoForNode","scopingShim","elementExtends","nativeCss"],"mappings":"AAAC,WAAY,CACb,aCDA;;;;;;;;EAsDA,QAAgBA,EAAhB,CAAsBC,EAAtB,CAA4B,CAE1B,MADAA,IAAOC,EAAMD,EAAN,CACP,CAAOE,EAASC,EAAIH,EAAJ,CAAT,CAAoBA,EAApB,CACR,CAOD,QAASC,EAAT,CAAeG,EAAf,CAAwB,CACtB,MAAOA,IAAQC,OAAR,CA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\n/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n/** @unrestricted */\nclass StyleNode {\n constructor() {\n /** @type {number} */\n this['start'] = 0;\n /** @type {number} */\n this['end'] = 0;\n /** @type {StyleNode} */\n this['previous'] = null;\n /** @type {StyleNode} */\n this['parent'] = null;\n /** @type {Array} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length;\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous'] ? node['previous']['end'] : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node['parsedSelector'] = node['selector'] = t.trim();\n node['atRule'] = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] =\n node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nfunction stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node['cssText'] :\n removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nconst types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n};\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n};\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n\n/**\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\nlet nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nlet nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n/**\n * @param {ShadyCSSOptions | ShadyCSSInterface | undefined} settings\n */\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings['nativeCss'] && !settings['shimcssproperties'];\n nativeShadow = nativeShadow && !settings['nativeShadow'] && !settings['shimshadow'];\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window['WebComponents']) {\n parseSettings(window['WebComponents']['flags']);\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\nconst VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\\s}])|$)/gi;\nconst MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nconst VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nconst ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nconst MEDIA_MATCH = /@media[^(]*(\\([^)]*\\))/;\n\nconst BRACKETED = /\\{[^}]*\\}/g;\nconst HOST_PREFIX = '(?:^|[^.#[:])';\nconst HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n\n/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n */\nfunction toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nfunction rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'];\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nfunction isKeyframesSelector(rule) {\n return Boolean(rule['parent']) &&\n rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nfunction forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n // Given a node and scope name, add a scoping class to each node\n // in the tree. This facilitates transforming css into scoped rules.\n dom(node, scope, shouldRemoveScope) {\n // one time optimization to skip scoping...\n if (node['__styleScoped']) {\n node['__styleScoped'] = null;\n } else {\n this._transformDom(node, scope || '', shouldRemoveScope);\n }\n }\n\n _transformDom(node, selector, shouldRemoveScope) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.element(node, selector, shouldRemoveScope);\n }\n let c$ = (node.localName === 'template') ?\n (node.content || node._content).childNodes :\n node.children || node.childNodes;\n if (c$) {\n for (let i=0; i `:${type}(${inner.replace(/\\s/g, '')})`);\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope ? this._transformSimpleSelector(selector, scope) :\n selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n let p$ = selector.split(PSEUDO_PREFIX);\n p$[0] += scope;\n return p$.join(PSEUDO_PREFIX);\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = m && m[2].trim() || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n } else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function(m, host, paren) {\n return hostScope + paren;\n });\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n } else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n /**\n * @param {StyleNode} rule\n */\n documentRule(rule) {\n // reset selector in case this is redone.\n rule['selector'] = rule['parsedSelector'];\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n /**\n * @param {StyleNode} rule\n */\n normalizeRootSelector(rule) {\n if (rule['selector'] === ROOT) {\n rule['selector'] = 'html';\n }\n }\n\n/**\n * @param {string} selector\n */\n _transformDocumentSelector(selector) {\n return selector.match(SLOTTED) ?\n this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=\\[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nvar StyleTransformer$1 = new StyleTransformer();\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/** @const {string} */\nconst infoKey = '__styleInfo';\n\nclass StyleInfo {\n /**\n * @param {Element} node\n * @return {StyleInfo}\n */\n static get(node) {\n if (node) {\n return node[infoKey];\n } else {\n return null;\n }\n }\n /**\n * @param {!Element} node\n * @param {StyleInfo} styleInfo\n * @return {StyleInfo}\n */\n static set(node, styleInfo) {\n node[infoKey] = styleInfo;\n return styleInfo;\n }\n /**\n * @param {StyleNode} ast\n * @param {Node=} placeholder\n * @param {Array=} ownStylePropertyNames\n * @param {string=} elementName\n * @param {string=} typeExtension\n * @param {string=} cssBuild\n */\n constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n /** @type {StyleNode} */\n this.styleRules = ast || null;\n /** @type {Node} */\n this.placeholder = placeholder || null;\n /** @type {!Array} */\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n /** @type {Array\n*/\n\nlet ShadyCSS$1 = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS$1._elementsHaveApplied) {\n ShadyCSS$1.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS$1._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS$1._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);\n\n/**\r\n@license\r\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\r\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\nCode distributed by Google as part of the polymer project is also\r\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n*/\r\n/*\r\n * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS\r\n * Used in: Safari 9, Firefox, Edge\r\n */\n\n}());\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/*\nExtremely simple css parser. Intended to be not more than what we need\nand definitely not necessarily correct =).\n*/\n\n'use strict';\n\n// given a string of css, return a simple rule tree\nexport function parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\nfunction lex(text) {\n let root = {\n start: 0,\n end: text.length\n };\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n.rules) {\n n.rules = [];\n }\n let p = n;\n let previous = p.rules[p.rules.length - 1];\n n = {\n start: i + 1,\n parent: p,\n previous: previous\n };\n p.rules.push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n.end = i + 1;\n n = n.parent || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\nfunction parseCss(node, text) {\n let t = text.substring(node.start, node.end - 1);\n node.parsedCssText = node.cssText = t.trim();\n if (node.parent) {\n let ss = node.previous ? node.previous.end : node.parent.start;\n t = text.substring(ss, node.start - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node.parsedSelector = node.selector = t.trim();\n node.atRule = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node.atRule) {\n if (s.indexOf(MEDIA_START) === 0) {\n node.type = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node.type = types.KEYFRAMES_RULE;\n node.keyframesName =\n node.selector.split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node.type = types.MIXIN_RULE;\n } else {\n node.type = types.STYLE_RULE;\n }\n }\n }\n let r$ = node.rules;\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n// conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n// expanded form that doesn't require trailing space `\\000033`\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n// stringify parsed css.\nexport function stringify(node, preserveProperties, text) {\n text = text || '';\n // calc rule cssText\n let cssText = '';\n if (node.cssText || node.rules) {\n let r$ = node.rules;\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node.cssText :\n removeCustomProps(node.cssText);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node.selector) {\n text += node.selector + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node.selector) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\nfunction _hasMixinRules(rules) {\n return rules[0].selector.indexOf(VAR_START) === 0;\n}\n\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\nexport function removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\nexport let types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n}\n\nlet OPEN_BRACE = '{';\nlet CLOSE_BRACE = '}';\n\n// helper regexp's\nlet RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n}\n\nlet VAR_START = '--';\nlet MEDIA_START = '@media';\nlet AT_START = '@';\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport let nativeShadow = !(window.ShadyDOM && window.ShadyDOM.inUse);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nexport let nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n// experimental support for native @apply\nfunction detectNativeApply() {\n let style = document.createElement('style');\n style.textContent = '.foo { @apply --foo }';\n document.head.appendChild(style);\n let nativeCssApply = (style.sheet.cssRules[0].cssText.indexOf('apply') >= 0);\n document.head.removeChild(style);\n return nativeCssApply;\n}\n\nexport let nativeCssApply = false && detectNativeApply();\n\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings.shimcssproperties;\n nativeShadow = nativeShadow && !settings.shimshadow;\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window.WebComponents) {\n parseSettings(window.WebComponents.flags);\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow, nativeCssVariables} from './style-settings'\nimport {parse, stringify, types} from './css-parse'\n\nexport function toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\nexport function rulesForStyle(style) {\n if (!style.__cssRules && style.textContent) {\n style.__cssRules = parse(style.textContent);\n }\n return style.__cssRules;\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\nexport function isKeyframesSelector(rule) {\n return rule.parent &&\n rule.parent.type === types.KEYFRAMES_RULE;\n}\n\nexport function forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n if (onlyActiveRules) {\n if (node.type === types.MEDIA_RULE) {\n let matchMedia = node.selector.match(rx.MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (node.type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n node.type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (node.type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node.rules;\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i+~])'\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {removeCustomPropAssignment} from './css-parse'\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleInfo from './style-info'\n\n// TODO: dedupe with shady\nconst p = window.Element.prototype;\nconst matchesSelector = p.matches || p.matchesSelector ||\n p.mozMatchesSelector || p.msMatchesSelector ||\n p.oMatchesSelector || p.webkitMatchesSelector;\n\nconst IS_IE = navigator.userAgent.match('Trident');\n\nconst XSCOPE_NAME = 'x-scope';\n\nclass StyleProperties {\n get XSCOPE_NAME() {\n return XSCOPE_NAME;\n }\n // decorates styles with rule info and returns an array of used style\n // property names\n decorateStyles(rules) {\n let self = this, props = {}, keyframes = [], ruleIndex = 0;\n StyleUtil.forEachRule(rules, function(rule) {\n self.decorateRule(rule);\n // mark in-order position of ast rule in styles block, used for cache key\n rule.index = ruleIndex++;\n self.collectPropertiesInCssText(rule.propertyInfo.cssText, props);\n }, function onKeyframesRule(rule) {\n keyframes.push(rule);\n });\n // Cache all found keyframes rules for later reference:\n rules._keyframes = keyframes;\n // return this list of property names *consumes* in these styles.\n let names = [];\n for (let i in props) {\n names.push(i);\n }\n return names;\n }\n\n // decorate a single rule with property info\n decorateRule(rule) {\n if (rule.propertyInfo) {\n return rule.propertyInfo;\n }\n let info = {}, properties = {};\n let hasProperties = this.collectProperties(rule, properties);\n if (hasProperties) {\n info.properties = properties;\n // TODO(sorvell): workaround parser seeing mixins as additional rules\n rule.rules = null;\n }\n info.cssText = this.collectCssText(rule);\n rule.propertyInfo = info;\n return info;\n }\n\n // collects the custom properties from a rule's cssText\n collectProperties(rule, properties) {\n let info = rule.propertyInfo;\n if (info) {\n if (info.properties) {\n Object.assign(properties, info.properties);\n return true;\n }\n } else {\n let m, rx = StyleUtil.rx.VAR_ASSIGN;\n let cssText = rule.parsedCssText;\n let value;\n let any;\n while ((m = rx.exec(cssText))) {\n // note: group 2 is var, 3 is mixin\n value = (m[2] || m[3]).trim();\n // value of 'inherit' or 'unset' is equivalent to not setting the property here\n if (value !== 'inherit' || value !== 'unset') {\n properties[m[1].trim()] = value;\n }\n any = true;\n }\n return any;\n }\n\n }\n\n // returns cssText of properties that consume variables/mixins\n collectCssText(rule) {\n return this.collectConsumingCssText(rule.parsedCssText);\n }\n\n // NOTE: we support consumption inside mixin assignment\n // but not production, so strip out {...}\n collectConsumingCssText(cssText) {\n return cssText.replace(StyleUtil.rx.BRACKETED, '')\n .replace(StyleUtil.rx.VAR_ASSIGN, '');\n }\n\n collectPropertiesInCssText(cssText, props) {\n let m;\n while ((m = StyleUtil.rx.VAR_CONSUMED.exec(cssText))) {\n let name = m[1];\n // This regex catches all variable names, and following non-whitespace char\n // If next char is not ':', then variable is a consumer\n if (m[2] !== ':') {\n props[name] = true;\n }\n }\n }\n\n // turns custom properties into realized values.\n reify(props) {\n // big perf optimization here: reify only *own* properties\n // since this object has __proto__ of the element's scope properties\n let names = Object.getOwnPropertyNames(props);\n for (let i=0, n; i < names.length; i++) {\n n = names[i];\n props[n] = this.valueForProperty(props[n], props);\n }\n }\n\n // given a property value, returns the reified value\n // a property value may be:\n // (1) a literal value like: red or 5px;\n // (2) a variable value like: var(--a), var(--a, red), or var(--a, --b) or\n // var(--a, var(--b));\n // (3) a literal mixin value like { properties }. Each of these properties\n // can have values that are: (a) literal, (b) variables, (c) @apply mixins.\n valueForProperty(property, props) {\n // case (1) default\n // case (3) defines a mixin and we have to reify the internals\n if (property) {\n if (property.indexOf(';') >=0) {\n property = this.valueForProperties(property, props);\n } else {\n // case (2) variable\n let self = this;\n let fn = function(prefix, value, fallback, suffix) {\n if (!value) {\n return prefix + suffix;\n }\n let propertyValue = self.valueForProperty(props[value], props);\n // if value is \"initial\", then the variable should be treated as unset\n if (!propertyValue || propertyValue === 'initial') {\n // fallback may be --a or var(--a) or literal\n propertyValue = self.valueForProperty(props[fallback] || fallback, props) ||\n fallback;\n } else if (propertyValue === 'apply-shim-inherit') {\n // CSS build will replace `inherit` with `apply-shim-inherit`\n // for use with native css variables.\n // Since we have full control, we can use `inherit` directly.\n propertyValue = 'inherit';\n }\n return prefix + (propertyValue || '') + suffix;\n };\n property = StyleUtil.processVariableAndFallback(property, fn);\n }\n }\n return property && property.trim() || '';\n }\n\n // note: we do not yet support mixin within mixin\n valueForProperties(property, props) {\n let parts = property.split(';');\n for (let i=0, p, m; i *' || parsedSelector === 'html');\n let isHost = parsedSelector.indexOf(':host') === 0 && !isRoot;\n // build info is either in scope (when scope is an element) or in the style\n // when scope is the default scope; note: this allows default scope to have\n // mixed mode built and unbuilt styles.\n if (cssBuild === 'shady') {\n // :root -> x-foo > *.x-foo for elements and html for custom-style\n isRoot = parsedSelector === (hostScope + ' > *.' + hostScope) || parsedSelector.indexOf('html') !== -1;\n // :host -> x-foo for elements, but sub-rules have .x-foo in them\n isHost = !isRoot && parsedSelector.indexOf(hostScope) === 0;\n }\n if (cssBuild === 'shadow') {\n isRoot = parsedSelector === ':host > *' || parsedSelector === 'html';\n isHost = isHost && !isRoot;\n }\n if (!isRoot && !isHost) {\n return;\n }\n let selectorToMatch = hostScope;\n if (isHost) {\n // need to transform :host under ShadowDOM because `:host` does not work with `matches`\n if (nativeShadow && !rule.transformedSelector) {\n // transform :host into a matchable selector\n rule.transformedSelector =\n StyleTransformer._transformRuleCss(\n rule,\n StyleTransformer._transformComplexSelector,\n StyleTransformer._calcElementScope(scope.is),\n hostScope\n );\n }\n selectorToMatch = rule.transformedSelector || hostScope;\n }\n callback({\n selector: selectorToMatch,\n isHost: isHost,\n isRoot: isRoot\n });\n }\n\n hostAndRootPropertiesForScope(scope, rules) {\n let hostProps = {}, rootProps = {}, self = this;\n // note: active rules excludes non-matching @media rules\n let cssBuild = rules && rules.__cssBuild;\n StyleUtil.forEachRule(rules, function(rule) {\n // if scope is StyleDefaults, use _element for matchesSelector\n self.whenHostOrRootRule(scope, rule, cssBuild, function(info) {\n let element = scope._element || scope;\n if (matchesSelector.call(element, info.selector)) {\n if (info.isHost) {\n self.collectProperties(rule, hostProps);\n } else {\n self.collectProperties(rule, rootProps);\n }\n }\n });\n }, null, true);\n return {rootProps: rootProps, hostProps: hostProps};\n }\n\n transformStyles(element, properties, scopeSelector) {\n let self = this;\n let hostSelector = StyleTransformer\n ._calcHostScope(element.is, element.extends);\n let rxHostSelector = element.extends ?\n '\\\\' + hostSelector.slice(0, -1) + '\\\\]' :\n hostSelector;\n let hostRx = new RegExp(StyleUtil.rx.HOST_PREFIX + rxHostSelector +\n StyleUtil.rx.HOST_SUFFIX);\n let rules = StyleInfo.get(element).styleRules;\n let keyframeTransforms =\n this._elementKeyframeTransforms(element, rules, scopeSelector);\n return StyleTransformer.elementStyles(element, rules, function(rule) {\n self.applyProperties(rule, properties);\n if (!nativeShadow &&\n !StyleUtil.isKeyframesSelector(rule) &&\n rule.cssText) {\n // NOTE: keyframe transforms only scope munge animation names, so it\n // is not necessary to apply them in ShadowDOM.\n self.applyKeyframeTransforms(rule, keyframeTransforms);\n self._scopeSelector(rule, hostRx, hostSelector, scopeSelector);\n }\n });\n }\n\n _elementKeyframeTransforms(element, rules, scopeSelector) {\n let keyframesRules = rules._keyframes;\n let keyframeTransforms = {};\n if (!nativeShadow && keyframesRules) {\n // For non-ShadowDOM, we transform all known keyframes rules in\n // advance for the current scope. This allows us to catch keyframes\n // rules that appear anywhere in the stylesheet:\n for (let i = 0, keyframesRule = keyframesRules[i];\n i < keyframesRules.length;\n keyframesRule = keyframesRules[++i]) {\n this._scopeKeyframes(keyframesRule, scopeSelector);\n keyframeTransforms[keyframesRule.keyframesName] =\n this._keyframesRuleTransformer(keyframesRule);\n }\n }\n return keyframeTransforms;\n }\n\n // Generate a factory for transforming a chunk of CSS text to handle a\n // particular scoped keyframes rule.\n _keyframesRuleTransformer(keyframesRule) {\n return function(cssText) {\n return cssText.replace(\n keyframesRule.keyframesNameRx,\n keyframesRule.transformedKeyframesName);\n };\n }\n\n // Transforms `@keyframes` names to be unique for the current host.\n // Example: @keyframes foo-anim -> @keyframes foo-anim-x-foo-0\n _scopeKeyframes(rule, scopeId) {\n rule.keyframesNameRx = new RegExp(rule.keyframesName, 'g');\n rule.transformedKeyframesName = rule.keyframesName + '-' + scopeId;\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n rule.selector = rule.transformedSelector.replace(\n rule.keyframesName, rule.transformedKeyframesName);\n }\n\n // Strategy: x scope shim a selector e.g. to scope `.x-foo-42` (via classes):\n // non-host selector: .a.x-foo -> .x-foo-42 .a.x-foo\n // host selector: x-foo.wide -> .x-foo-42.wide\n // note: we use only the scope class (.x-foo-42) and not the hostSelector\n // (x-foo) to scope :host rules; this helps make property host rules\n // have low specificity. They are overrideable by class selectors but,\n // unfortunately, not by type selectors (e.g. overriding via\n // `.special` is ok, but not by `x-foo`).\n _scopeSelector(rule, hostRx, hostSelector, scopeId) {\n rule.transformedSelector = rule.transformedSelector || rule.selector;\n let selector = rule.transformedSelector;\n let scope = '.' + scopeId;\n let parts = selector.split(',');\n for (let i=0, l=parts.length, p; (i elements to co-operate with ShadyCSS\n\nExample:\n\n \n\n*/\n\n'use strict';\n\nlet ShadyCSS = window.ShadyCSS;\n\nlet enqueued = false;\n\nlet customStyles = [];\n\nlet hookFn = null;\n\n/*\nIf a page only has elements, it will flash unstyled content,\nas all the instances will boot asynchronously after page load.\n\nCalling ShadyCSS.updateStyles() will force the work to happen synchronously\n*/\nfunction enqueueDocumentValidation() {\n if (enqueued) {\n return;\n }\n enqueued = true;\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(validateDocument);\n } else if (document.readyState === 'complete') {\n validateDocument();\n } else {\n document.addEventListener('readystatechange', () => {\n if (document.readyState === 'complete') {\n validateDocument();\n }\n });\n }\n}\n\nfunction validateDocument() {\n requestAnimationFrame(() => {\n if (enqueued || ShadyCSS._elementsHaveApplied) {\n ShadyCSS.updateStyles();\n }\n enqueued = false;\n });\n}\n\nclass CustomStyle extends HTMLElement {\n static get _customStyles() {\n return customStyles;\n }\n static get processHook() {\n return hookFn;\n }\n static set processHook(fn) {\n hookFn = fn;\n }\n static get _documentDirty() {\n return enqueued;\n }\n static findStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (!c._style) {\n let style = c.querySelector('style');\n if (!style) {\n continue;\n }\n // HTMLImports polyfill may have cloned the style into the main document,\n // which is referenced with __appliedElement.\n // Also, we must copy over the attributes.\n if (style.__appliedElement) {\n for (let i = 0; i < style.attributes.length; i++) {\n let attr = style.attributes[i];\n style.__appliedElement.setAttribute(attr.name, attr.value);\n }\n }\n c._style = style.__appliedElement || style;\n if (hookFn) {\n hookFn(c._style);\n }\n ShadyCSS._transformCustomStyleForDocument(c._style);\n }\n }\n }\n static _revalidateApplyShim() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._revalidateApplyShim(c._style);\n }\n }\n }\n static applyStyles() {\n for (let i = 0; i < customStyles.length; i++) {\n let c = customStyles[i];\n if (c._style) {\n ShadyCSS._applyCustomStyleToDocument(c._style);\n }\n }\n enqueued = false;\n }\n constructor() {\n super();\n customStyles.push(this);\n enqueueDocumentValidation();\n }\n}\n\nwindow['CustomStyle'] = CustomStyle;\nwindow.customElements.define('custom-style', CustomStyle);","(function(){\n/*\n\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';var aa={};function l(a,b,c){return{index:a,removed:b,addedCount:c}}\nvar ba={calcEditDistances:function(a,b,c,d,e,f){f=f-e+1;c=c-b+1;for(var g=Array(f),h=0;h]/g;function ja(a){switch(a){case \"&\":return\"&\";case \"<\":return\"<\";case \">\":return\">\";case '\"':return\""\";case \"\\u00a0\":return\" \"}}function ka(a){for(var b={},c=0;c\";return la[b]?d:d+oa(a,c)+\"\"+b+\">\";case Node.TEXT_NODE:return a=a.data,b&&ma[b.localName]?a:a.replace(ia,ja);case Node.COMMENT_NODE:return\"\\x3c!--\"+a.data+\"--\\x3e\";default:throw window.console.error(a),Error(\"not implemented\");}}\nfunction oa(a,b){\"template\"===a.localName&&(a=a.content);for(var c=\"\",d=b?b(a):a.childNodes,e=0,f=d.length,g;e div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n // Given a node and scope name, add a scoping class to each node\n // in the tree. This facilitates transforming css into scoped rules.\n dom(node, scope, shouldRemoveScope) {\n // one time optimization to skip scoping...\n if (node.__styleScoped) {\n node.__styleScoped = null;\n } else {\n this._transformDom(node, scope || '', shouldRemoveScope);\n }\n }\n\n _transformDom(node, selector, shouldRemoveScope) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.element(node, selector, shouldRemoveScope);\n }\n let c$ = (node.localName === 'template') ?\n (node.content || node._content).childNodes :\n node.children || node.childNodes;\n if (c$) {\n for (let i=0; i `:${type}(${inner.replace(/\\s/g, '')})`);\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope ? this._transformSimpleSelector(selector, scope) :\n selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n let p$ = selector.split(PSEUDO_PREFIX);\n p$[0] += scope;\n return p$.join(PSEUDO_PREFIX);\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = m && m[2].trim() || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n } else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function(m, host, paren) {\n return hostScope + paren;\n });\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n } else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n documentRule(rule) {\n // reset selector in case this is redone.\n rule.selector = rule.parsedSelector;\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n normalizeRootSelector(rule) {\n if (rule.selector === ROOT) {\n rule.selector = 'html';\n }\n }\n\n _transformDocumentSelector(selector) {\n return selector.match(SLOTTED) ?\n this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=\\[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nexport default new StyleTransformer()","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nexport default {};\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport templateMap from './template-map'\n\nconst promise = Promise.resolve();\n\nexport default class StyleInfo {\n static get(node) {\n return node.__styleInfo;\n }\n static set(node, styleInfo) {\n node.__styleInfo = styleInfo;\n return styleInfo;\n }\n static invalidate(elementName) {\n if (templateMap[elementName]) {\n templateMap[elementName]._applyShimInvalid = true;\n }\n }\n /*\n the template is marked as `validating` for one microtask so that all instances\n found in the tree crawl of `applyStyle` will update themselves,\n but the template will only be updated once.\n */\n static startValidating(elementName) {\n const template = templateMap[elementName];\n if (!template._validating) {\n template._validating = true;\n promise.then(() => {\n template._applyShimInvalid = false;\n template._validating = false;\n });\n }\n }\n constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n this.styleRules = ast || null;\n this.placeholder = placeholder || null;\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n this.overrideStyleProperties = null;\n this.elementName = elementName || '';\n this.cssBuild = cssBuild || '';\n this.typeExtension = typeExtension || '';\n this.styleProperties = null;\n this.scopeSelector = null;\n this.customStyle = null;\n }\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {applyStylePlaceHolder} from './style-util'\nimport {nativeShadow} from './style-settings'\n\nlet placeholderMap = {};\n\nconst ce = window.customElements;\nif (ce && !nativeShadow) {\n const origDefine = ce.define;\n ce.define = function(name, clazz, options) {\n placeholderMap[name] = applyStylePlaceHolder(name);\n return origDefine.call(ce, name, clazz, options);\n };\n}\n\nexport default placeholderMap;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n/**\n * The apply shim simulates the behavior of `@apply` proposed at\n * https://tabatkins.github.io/specs/css-apply-rule/.\n * The approach is to convert a property like this:\n *\n * --foo: {color: red; background: blue;}\n *\n * to this:\n *\n * --foo_-_color: red;\n * --foo_-_background: blue;\n *\n * Then where `@apply --foo` is used, that is converted to:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background);\n *\n * This approach generally works but there are some issues and limitations.\n * Consider, for example, that somewhere *between* where `--foo` is set and used,\n * another element sets it to:\n *\n * --foo: { border: 2px solid red; }\n *\n * We must now ensure that the color and background from the previous setting\n * do not apply. This is accomplished by changing the property set to this:\n *\n * --foo_-_border: 2px solid red;\n * --foo_-_color: initial;\n * --foo_-_background: initial;\n *\n * This works but introduces one new issue.\n * Consider this setup at the point where the `@apply` is used:\n *\n * background: orange;\n * @apply --foo;\n *\n * In this case the background will be unset (initial) rather than the desired\n * `orange`. We address this by altering the property set to use a fallback\n * value like this:\n *\n * color: var(--foo_-_color);\n * background: var(--foo_-_background, orange);\n * border: var(--foo_-_border);\n *\n * Note that the default is retained in the property set and the `background` is\n * the desired `orange`. This leads us to a limitation.\n *\n * Limitation 1:\n\n * Only properties in the rule where the `@apply`\n * is used are considered as default values.\n * If another rule matches the element and sets `background` with\n * less specificity than the rule in which `@apply` appears,\n * the `background` will not be set.\n *\n * Limitation 2:\n *\n * When using Polymer's `updateStyles` api, new properties may not be set for\n * `@apply` properties.\n\n*/\n\n'use strict';\n\nimport {rx, forEachRule, processVariableAndFallback, rulesForStyle} from './style-util'\nimport templateMap from './template-map'\nimport StyleInfo from './style-info'\n\nlet MIXIN_MATCH = rx.MIXIN_MATCH;\nlet VAR_ASSIGN = rx.VAR_ASSIGN;\n\nlet APPLY_NAME_CLEAN = /;\\s*/m;\nlet INITIAL_INHERIT = /^\\s*(initial)|(inherit)\\s*$/;\n\n// separator used between mixin-name and mixin-property-name when producing properties\n// NOTE: plain '-' may cause collisions in user styles\nlet MIXIN_VAR_SEP = '_-_';\n\n// map of mixin to property names\n// --foo: {border: 2px} -> {properties: {(--foo, ['border'])}, dependants: {'element-name': proto}}\nclass MixinMap {\n constructor() {\n this._map = {};\n }\n set(name, props) {\n name = name.trim();\n this._map[name] = {\n properties: props,\n dependants: {}\n }\n }\n get(name) {\n name = name.trim();\n return this._map[name];\n }\n}\n\nclass ApplyShim {\n constructor() {\n this._currentTemplate = null;\n this._measureElement = null;\n this._map = new MixinMap();\n this._separator = MIXIN_VAR_SEP;\n this._boundProduceCssProperties = (\n matchText, propertyName, valueProperty, valueMixin) =>\n this._produceCssProperties(\n matchText, propertyName, valueProperty, valueMixin);\n }\n // return true if `cssText` contains a mixin definition or consumption\n detectMixin(cssText) {\n const has = MIXIN_MATCH.test(cssText) || VAR_ASSIGN.test(cssText);\n // reset state of the regexes\n MIXIN_MATCH.lastIndex = 0;\n VAR_ASSIGN.lastIndex = 0;\n return has;\n }\n transformStyle(style, elementName) {\n let ast = rulesForStyle(style);\n this.transformRules(ast, elementName);\n return ast;\n }\n transformRules(rules, elementName) {\n this._currentTemplate = templateMap[elementName];\n forEachRule(rules, (r) => {\n this.transformRule(r);\n });\n this._currentTemplate = null;\n }\n transformRule(rule) {\n rule.cssText = this.transformCssText(rule.parsedCssText);\n // :root was only used for variable assignment in property shim,\n // but generates invalid selectors with real properties.\n // replace with `:host > *`, which serves the same effect\n if (rule.selector === ':root') {\n rule.selector = ':host > *';\n }\n }\n transformCssText(cssText) {\n // produce variables\n cssText = cssText.replace(VAR_ASSIGN, this._boundProduceCssProperties);\n // consume mixins\n return this._consumeCssProperties(cssText);\n }\n _getInitialValueForProperty(property) {\n if (!this._measureElement) {\n this._measureElement = document.createElement('meta');\n this._measureElement.style.all = 'initial';\n document.head.appendChild(this._measureElement);\n }\n return window.getComputedStyle(this._measureElement).getPropertyValue(property);\n }\n // replace mixin consumption with variable consumption\n _consumeCssProperties(text) {\n let m;\n // loop over text until all mixins with defintions have been applied\n while((m = MIXIN_MATCH.exec(text))) {\n let matchText = m[0];\n let mixinName = m[1];\n let idx = m.index;\n // collect properties before apply to be \"defaults\" if mixin might override them\n // match includes a \"prefix\", so find the start and end positions of @apply\n let applyPos = idx + matchText.indexOf('@apply');\n let afterApplyPos = idx + matchText.length;\n // find props defined before this @apply\n let textBeforeApply = text.slice(0, applyPos);\n let textAfterApply = text.slice(afterApplyPos);\n let defaults = this._cssTextToMap(textBeforeApply);\n let replacement = this._atApplyToCssProperties(mixinName, defaults);\n // use regex match position to replace mixin, keep linear processing time\n text = [textBeforeApply, replacement, textAfterApply].join('');\n // move regex search to _after_ replacement\n MIXIN_MATCH.lastIndex = idx + replacement.length;\n }\n return text;\n }\n // produce variable consumption at the site of mixin consumption\n // @apply --foo; -> for all props (${propname}: var(--foo_-_${propname}, ${fallback[propname]}}))\n // Example:\n // border: var(--foo_-_border); padding: var(--foo_-_padding, 2px)\n _atApplyToCssProperties(mixinName, fallbacks) {\n mixinName = mixinName.replace(APPLY_NAME_CLEAN, '');\n let vars = [];\n let mixinEntry = this._map.get(mixinName);\n // if we depend on a mixin before it is created\n // make a sentinel entry in the map to add this element as a dependency for when it is defined.\n if (!mixinEntry) {\n this._map.set(mixinName, {});\n mixinEntry = this._map.get(mixinName);\n }\n if (mixinEntry) {\n if (this._currentTemplate) {\n mixinEntry.dependants[this._currentTemplate.name] = this._currentTemplate;\n }\n let p, parts, f;\n for (p in mixinEntry.properties) {\n f = fallbacks && fallbacks[p];\n parts = [p, ': var(', mixinName, MIXIN_VAR_SEP, p];\n if (f) {\n parts.push(',', f);\n }\n parts.push(')');\n vars.push(parts.join(''));\n }\n }\n return vars.join('; ');\n }\n\n _replaceInitialOrInherit(property, value) {\n let match = INITIAL_INHERIT.exec(value);\n if (match) {\n if (match[1]) {\n // initial\n // replace `initial` with the concrete initial value for this property\n value = ApplyShim._getInitialValueForProperty(property);\n } else {\n // inherit\n // with this purposfully illegal value, the variable will be invalid at\n // compute time (https://www.w3.org/TR/css-variables/#invalid-at-computed-value-time)\n // and for inheriting values, will behave similarly\n // we cannot support the same behavior for non inheriting values like 'border'\n value = 'apply-shim-inherit';\n }\n }\n return value;\n }\n\n // \"parse\" a mixin definition into a map of properties and values\n // cssTextToMap('border: 2px solid black') -> ('border', '2px solid black')\n _cssTextToMap(text) {\n let props = text.split(';');\n let property, value;\n let out = {};\n for (let i = 0, p, sp; i < props.length; i++) {\n p = props[i];\n if (p) {\n sp = p.split(':');\n // ignore lines that aren't definitions like @media\n if (sp.length > 1) {\n property = sp[0].trim();\n // some properties may have ':' in the value, like data urls\n value = this._replaceInitialOrInherit(property, sp.slice(1).join(':'));\n out[property] = value;\n }\n }\n }\n return out;\n }\n\n _invalidateMixinEntry(mixinEntry) {\n for (let elementName in mixinEntry.dependants) {\n if (!this._currentTemplate || elementName !== this._currentTemplate.name) {\n StyleInfo.invalidate(elementName);\n }\n }\n }\n\n _produceCssProperties(matchText, propertyName, valueProperty, valueMixin) {\n // handle case where property value is a mixin\n if (valueProperty) {\n // form: --mixin2: var(--mixin1), where --mixin1 is in the map\n processVariableAndFallback(valueProperty, (prefix, value) => {\n if (value && this._map.get(value)) {\n valueMixin = '@apply ' + value + ';';\n }\n });\n }\n if (!valueMixin) {\n return matchText;\n }\n let mixinAsProperties = this._consumeCssProperties(valueMixin);\n let prefix = matchText.slice(0, matchText.indexOf('--'));\n let mixinValues = this._cssTextToMap(mixinAsProperties);\n let combinedProps = mixinValues;\n let mixinEntry = this._map.get(propertyName);\n let oldProps = mixinEntry && mixinEntry.properties;\n if (oldProps) {\n // NOTE: since we use mixin, the map of properties is updated here\n // and this is what we want.\n combinedProps = Object.assign(Object.create(oldProps), mixinValues);\n } else {\n this._map.set(propertyName, combinedProps);\n }\n let out = [];\n let p, v;\n // set variables defined by current mixin\n let needToInvalidate = false;\n for (p in combinedProps) {\n v = mixinValues[p];\n // if property not defined by current mixin, set initial\n if (v === undefined) {\n v = 'initial';\n }\n if (oldProps && !(p in oldProps)) {\n needToInvalidate = true;\n }\n out.push(propertyName + MIXIN_VAR_SEP + p + ': ' + v);\n }\n if (needToInvalidate) {\n this._invalidateMixinEntry(mixinEntry);\n }\n if (mixinEntry) {\n mixinEntry.properties = combinedProps;\n }\n // because the mixinMap is global, the mixin might conflict with\n // a different scope's simple variable definition:\n // Example:\n // some style somewhere:\n // --mixin1:{ ... }\n // --mixin2: var(--mixin1);\n // some other element:\n // --mixin1: 10px solid red;\n // --foo: var(--mixin1);\n // In this case, we leave the original variable definition in place.\n if (valueProperty) {\n prefix = matchText + ';' + prefix;\n }\n return prefix + out.join('; ') + ';';\n }\n}\n\nlet applyShim = new ApplyShim();\nwindow['ApplyShim'] = applyShim;\nexport default applyShim;\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {nativeShadow} from './style-settings'\nimport StyleTransformer from './style-transformer'\n\nexport let flush = function() {};\n\nif (!nativeShadow) {\n let elementNeedsScoping = (element) => {\n return (element.classList &&\n !element.classList.contains(StyleTransformer.SCOPE_NAME) ||\n // note: necessary for IE11\n (element instanceof SVGElement && (!element.hasAttribute('class') ||\n element.getAttribute('class').indexOf(StyleTransformer.SCOPE_NAME) < 0)));\n }\n\n let handler = (mxns) => {\n for (let x=0; x < mxns.length; x++) {\n let mxn = mxns[x];\n if (mxn.target === document.documentElement ||\n mxn.target === document.head) {\n continue;\n }\n for (let i=0; i < mxn.addedNodes.length; i++) {\n let n = mxn.addedNodes[i];\n if (elementNeedsScoping(n)) {\n let root = n.getRootNode();\n if (root.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n // may no longer be in a shadowroot\n let host = root.host;\n if (host) {\n let scope = host.is || host.localName;\n StyleTransformer.dom(n, scope);\n }\n }\n }\n }\n for (let i=0; i < mxn.removedNodes.length; i++) {\n let n = mxn.removedNodes[i];\n if (n.nodeType === Node.ELEMENT_NODE) {\n let classes = undefined;\n if (n.classList) {\n classes = Array.from(n.classList);\n } else if (n.hasAttribute('class')) {\n classes = n.getAttribute('class').split(/\\s+/);\n }\n if (classes !== undefined) {\n // NOTE: relies on the scoping class always being adjacent to the\n // SCOPE_NAME class.\n let classIdx = classes.indexOf(StyleTransformer.SCOPE_NAME);\n if (classIdx >= 0) {\n let scope = classes[classIdx + 1];\n if (scope) {\n StyleTransformer.dom(n, scope, true);\n }\n }\n }\n }\n }\n }\n };\n\n let observer = new MutationObserver(handler);\n let start = (node) => {\n observer.observe(node, {childList: true, subtree: true});\n }\n let nativeCustomElements = (window.customElements &&\n !window.customElements.flush);\n // need to start immediately with native custom elements\n // TODO(dfreedm): with polyfilled HTMLImports and native custom elements\n // excessive mutations may be observed; this can be optimized via cooperation\n // with the HTMLImports polyfill.\n if (nativeCustomElements) {\n start(document);\n } else {\n let delayedStart = () => {\n start(document.body);\n }\n // use polyfill timing if it's available\n if (window.HTMLImports) {\n window.HTMLImports.whenReady(delayedStart);\n // otherwise push beyond native imports being ready\n // which requires RAF + readystate interactive.\n } else {\n requestAnimationFrame(function() {\n if (document.readyState === 'loading') {\n let listener = function() {\n delayedStart();\n document.removeEventListener('readystatechange', listener);\n }\n document.addEventListener('readystatechange', listener);\n } else {\n delayedStart();\n }\n });\n }\n }\n\n flush = function() {\n handler(observer.takeRecords());\n }\n}\n","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n'use strict';\n\nimport {parse} from './css-parse'\nimport {nativeShadow, nativeCssVariables, nativeCssApply} from './style-settings'\nimport StyleTransformer from './style-transformer'\nimport * as StyleUtil from './style-util'\nimport StyleProperties from './style-properties'\nimport templateMap from './template-map'\nimport placeholderMap from './style-placeholder'\nimport StyleInfo from './style-info'\nimport StyleCache from './style-cache'\n\n// TODO(dfreedm): consider spliting into separate global\nimport ApplyShim from './apply-shim'\nimport {flush as watcherFlush} from './document-watcher'\n\nlet styleCache = new StyleCache();\n\nclass ShadyCSS {\n constructor() {\n this._scopeCounter = {};\n this._documentOwner = document.documentElement;\n this._documentOwnerStyleInfo = StyleInfo.set(document.documentElement, new StyleInfo({rules: []}));\n this._elementsHaveApplied = false;\n }\n get nativeShadow() {\n return nativeShadow;\n }\n get nativeCss() {\n return nativeCssVariables;\n }\n get nativeCssApply() {\n return nativeCssApply;\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 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 (!this.nativeShadow) {\n StyleTransformer.dom(template.content, elementName);\n }\n // check if the styling has mixin definitions or uses\n let hasMixins = ApplyShim.detectMixin(cssText);\n let ast = parse(cssText);\n // only run the applyshim transforms if there is a mixin involved\n if (hasMixins && this.nativeCss && !this.nativeCssApply) {\n ApplyShim.transformRules(ast, elementName);\n }\n template._styleAst = ast;\n\n let ownPropertyNames = [];\n if (!this.nativeCss) {\n ownPropertyNames = StyleProperties.decorateStyles(template._styleAst, info);\n }\n if (!ownPropertyNames.length || this.nativeCss) {\n let root = this.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 = host.getAttribute('is') || host.localName;\n let typeExtension;\n if (is !== host.localName) {\n typeExtension = host.localName;\n }\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 applyStyle(host, overrideProps) {\n let is = host.getAttribute('is') || host.localName;\n let styleInfo = StyleInfo.get(host);\n let hasApplied = Boolean(styleInfo);\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 (window.CustomStyle) {\n let CS = window.CustomStyle;\n if (CS._documentDirty) {\n CS.findStyles();\n if (!this.nativeCss) {\n this._updateProperties(this._documentOwner, this._documentOwnerStyleInfo);\n } else if (!this.nativeCssApply) {\n CS._revalidateApplyShim();\n }\n CS.applyStyles();\n // if no elements have booted yet, we can just update the document and be done\n if (!this._elementsHaveApplied) {\n return;\n }\n // if no native css custom properties, we must recalculate the whole tree\n if (!this.nativeCss) {\n this.updateStyles();\n /*\n When updateStyles() runs, this element may not have a shadowroot yet.\n If not, we need to make sure that this element runs `applyStyle` on itself at least once to generate a style\n */\n if (hasApplied) {\n return;\n }\n }\n }\n }\n if (overrideProps) {\n styleInfo.overrideStyleProperties =\n styleInfo.overrideStyleProperties || {};\n Object.assign(styleInfo.overrideStyleProperties, overrideProps);\n }\n if (this.nativeCss) {\n if (styleInfo.overrideStyleProperties) {\n this._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._applyShimInvalid && template._style) {\n // update template\n if (!template._validating) {\n ApplyShim.transformRules(template._styleAst, is);\n template._style.textContent = StyleTransformer.elementStyles(host, styleInfo.styleRules);\n StyleInfo.startValidating(is);\n }\n // update instance if native shadowdom\n if (this.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 } else {\n this._updateProperties(host, styleInfo);\n if (styleInfo.ownStylePropertyNames && styleInfo.ownStylePropertyNames.length) {\n this._applyStyleProperties(host, styleInfo);\n }\n }\n if (hasApplied) {\n let root = this._isRootOwner(host) ? host : host.shadowRoot;\n // note: some elements may not have a root!\n if (root) {\n this._applyToDescendants(root);\n }\n }\n }\n _applyToDescendants(root) {\n // note: fallback to childNodes to support recursing into SVG which\n // does not support children in some browsers (Edge/IE)\n let c$ = root.children || root.childNodes;\n for (let i = 0, c; i < c$.length; i++) {\n c = c$[i];\n if (c.shadowRoot) {\n this.applyStyle(c);\n }\n this._applyToDescendants(c);\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 = host.getAttribute('is') || host.localName;\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 (!this.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 _updateNativeProperties(element, properties) {\n // remove previous properties\n for (let p in properties) {\n // NOTE: for bc with shim, don't apply null values.\n if (p === null) {\n element.style.removeProperty(p);\n } else {\n element.style.setProperty(p, properties[p]);\n }\n }\n }\n updateStyles(properties) {\n this.applyStyle(this._documentOwner, properties);\n }\n /* Custom Style operations */\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 (this.nativeCss && !this.nativeCssApply) {\n ApplyShim.transformRule(rule);\n }\n });\n if (this.nativeCss) {\n style.textContent = StyleUtil.toCssText(ast);\n } else {\n this._documentOwnerStyleInfo.styleRules.rules.push(ast);\n }\n }\n _revalidateApplyShim(style) {\n if (this.nativeCss && !this.nativeCssApply) {\n let ast = StyleUtil.rulesForStyle(style);\n ApplyShim.transformRules(ast);\n style.textContent = StyleUtil.toCssText(ast);\n }\n }\n _applyCustomStyleToDocument(style) {\n if (!this.nativeCss) {\n StyleProperties.applyCustomStyle(style, this._documentOwnerStyleInfo.styleProperties);\n }\n }\n getComputedStyleValue(element, property) {\n let value;\n if (!this.nativeCss) {\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.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 (!this.nativeCss) {\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\nwindow['ShadyCSS'] = new ShadyCSS();","/**\n@license\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';\n\nexport default class StyleCache {\n constructor(typeMax = 100) {\n // map element name -> [{properties, styleElement, scopeSelector}]\n this.cache = {};\n this.typeMax = typeMax;\n }\n\n _validate(cacheEntry, properties, ownPropertyNames) {\n for (let idx = 0; idx < ownPropertyNames.length; idx++) {\n let pn = ownPropertyNames[idx];\n if (cacheEntry.properties[pn] !== properties[pn]) {\n return false;\n }\n }\n return true;\n }\n\n store(tagname, properties, styleElement, scopeSelector) {\n let list = this.cache[tagname] || [];\n list.push({properties, styleElement, scopeSelector});\n if (list.length > this.typeMax) {\n list.shift();\n }\n this.cache[tagname] = list;\n }\n\n fetch(tagname, properties, ownPropertyNames) {\n let list = this.cache[tagname];\n if (!list) {\n return;\n }\n // reverse list for most-recent lookups\n for (let idx = list.length - 1; idx >= 0; idx--) {\n let entry = list[idx];\n if (this._validate(entry, properties, ownPropertyNames)) {\n return entry;\n }\n }\n }\n}\n"]}
\ No newline at end of file
+{"version":3,"sources":["webcomponents-sd-ce-index.js","bower_components/shadycss/src/css-parse.js","bower_components/shadycss/src/style-settings.js","bower_components/shadycss/src/style-util.js","bower_components/shadycss/src/style-properties.js","bower_components/shadycss/src/apply-shim-utils.js","bower_components/shadycss/src/document-wait.js","bower_components/shadycss/src/common-utils.js","bower_components/shadydom/shadydom.min.js","bower_components/custom-elements/custom-elements.min.js","bower_components/shadycss/src/common-regex.js","bower_components/shadycss/src/style-transformer.js","bower_components/shadycss/src/style-info.js","bower_components/shadycss/src/style-placeholder.js","bower_components/shadycss/src/document-watcher.js","bower_components/shadycss/src/template-map.js","bower_components/shadycss/src/custom-style-interface.js","bower_components/shadycss/src/scoping-shim.js","bower_components/shadycss/src/style-cache.js","bower_components/shadycss/entrypoints/scoping-shim.js"],"names":["parse","text","clean","parseCss","lex","cssText","replace","RX","comments","port","root","StyleNode","length","n","i","l","OPEN_BRACE","p","previous","push","CLOSE_BRACE","node","t","substring","trim","ss","_expandUnicodeEscapes","multipleSpaces","lastIndexOf","s","indexOf","types","MEDIA_RULE","match","keyframesRule","KEYFRAMES_RULE","split","pop","VAR_START","MIXIN_RULE","STYLE_RULE","r$","r","code","arguments","repeat","stringify","preserveProperties","_hasMixinRules","removeCustomProps","rules","removeCustomPropAssignment","removeCustomPropApply","customProp","mixinProp","mixinApply","varApply","parseSettings","settings","nativeCssVariables","nativeShadow","toCssText","callback","forEachRule","rulesForStyle","style","textContent","isKeyframesSelector","rule","styleRuleCallback","keyframesRuleCallback","onlyActiveRules","skipRules","type","matchMedia","MEDIA_MATCH","window","matches","applyCss","moniker","target","contextNode","createScopeStyle","applyStyle","document","createElement","setAttribute","applyStylePlaceHolder","placeHolder","createComment","after","lastHeadApplyNode","scope","head","insertBefore","firstChild","nextSibling","position","compareDocumentPosition","Node","DOCUMENT_POSITION_PRECEDING","findMatchingParen","start","level","processVariableAndFallback","str","end","inner","prefix","suffix","comma","value","fallback","setElementClassRaw","element","call","getIsExtends","localName","is","typeExtension","getAttribute","extends","addToBitMask","bits","o","parseInt","invalidate","elementName","template","templateMap","invalidateTemplate","templateIsValid","templateIsValidating","_validating","startValidatingTemplate","promise","then","documentWait","whenReady","readyPromise","Promise","resolve","resolveFn","readyState","addEventListener","updateNativeProperties","properties","removeProperty","setProperty","a","b","c","index","removed","addedCount","ca","__localName","e","Object","getOwnPropertyNames","d","f","h","getOwnPropertyDescriptor","defineProperty","A","z","w","shift","ga","__shady","ja","ka","na","nodeType","ELEMENT_NODE","g","attributes","name","ha","la","oa","TEXT_NODE","data","ma","ia","COMMENT_NODE","console","error","Error","content","childNodes","pa","E","currentNode","H","get","B","getProperty","D","configurable","N","warn","ua","G","patchOutsideElementAccessors","previousSibling","lastChild","parentNode","Q","insertionPointTag","S","Fa","TypeError","createDocumentFragment","__proto__","prototype","_init","Ga","hasProperty","m","ownerShadyRootForNode","Ha","O","recordRemoveChild","_insertionPoints","k","assignedNodes","flatten","x","y","P","removeChild","getInsertionPointTag","_skipUpdateInsertionPoints","U","Ia","Ja","observer","addedNodes","removedNodes","schedule","Ka","__ownerShadyRoot","isShadyRoot","documentElement","contains","La","DOCUMENT_FRAGMENT_NODE","__noInsertionPoint","recordChildNodes","querySelectorAll","shadyRoot","hasInsertionPoint","_changePending","update","Ma","Na","da","Oa","ownerDocument","importNode","appendChild","X","_scheduled","callbacks","Set","Qa","getRootNode","assignedSlot","host","Ra","Ta","__composed","composed","mixin","Va","__handlers","__immediatePropagationStopped","Wa","composedPath","__propagationStopped","Event","AT_TARGET","shadowRoot","Xa","Ua","__target","Ya","stopImmediatePropagation","__relatedTarget","relatedTarget","hasDescriptors","patchPrototype","Sa","extend","cb","T","renderRootNode","Z","aa","ba","calcEditDistances","Array","equals","spliceOperationsFromEditDistances","reverse","calcSplices","Math","min","sharedPrefix","sharedSuffix","calculateSplices","ShadyDOM","hasNativeShadowDOM","Element","attachShadow","inUse","force","q","ea","matchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","createTextNode","fa","u","MutationObserver","observe","characterData","extendAll","getPrototypeOf","hasOwnProperty","create","__sourceProto","__patchProto","microtask","v","list","enqueue","flush","C","getOuterHTML","getInnerHTML","createTreeWalker","NodeFilter","SHOW_ALL","F","SHOW_ELEMENT","parentElement","firstElementChild","lastElementChild","previousElementSibling","nextElementSibling","children","innerHTML","nodeValue","SHOW_TEXT","nextNode","I","HTMLElement","J","implementation","createHTMLDocument","K","Document","qa","className","set","L","join","filter","ra","M","activeElement","sa","__outsideAccessors","ta","__insideAccessors","ShadowRootAccessor","ActiveElementAccessor","patchAccessors","patchShadowRootAccessors","patchInsideElementAccessors","recordInsertBefore","va","wa","xa","ya","removeAttribute","za","cloneNode","Aa","Ba","Ca","removeEventListener","Da","Ea","createEvent","initEvent","bubbles","cancelable","getInsertionPoints","isInsertionPoint","distribute","distributePool","collectPool","distributeInsertionPoint","clearAssignedSlots","matchesInsertionPoint","_prevAssignedSlot","distributeNodeInto","setDistributedNodesOnInsertionPoint","_fireSlotChange","distributedNodes","dispatchEvent","isFinalDestination","default","R","DocumentFragment","_hasRendered","_renderPending","_distributor","render","_getRenderRoot","_rendererForHost","_render","updateInsertionPoints","compose","forceRender","__insertionPoints","_composeTree","_updateChildNodes","_composeNode","splice","ShadyRoot","V","query","ShadyCSS","ScopingShim","setElementClass","querySelector","W","takeRecords","forEach","observeChildren","add","_callback","_observer","_node","unobserveChildren","delete","size","filterMutations","map","from","Y","Pa","blur","focus","focusin","focusout","click","dblclick","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","wheel","beforeinput","input","keydown","keyup","compositionstart","compositionupdate","compositionend","touchstart","touchend","touchmove","touchcancel","pointerover","pointerenter","pointerdown","pointermove","pointerup","pointercancel","pointerout","pointerleave","gotpointercapture","lostpointercapture","dragstart","drag","dragenter","dragleave","dragover","drop","dragend","DOMActivate","DOMFocusIn","DOMFocusOut","keypress","isTrusted","__composedPath","currentTarget","__relatedTargetComposedPath","stopPropagation","Za","$a","CustomEvent","ab","MouseEvent","capture","once","passive","__eventWrappers","eventPhase","BUBBLING_PHASE","wrapperFn","bubble","patchEvents","bb","db","replaceChild","isConnected","eb","fb","gb","hb","slot","defineProperties","ib","_activeElement","patchBuiltins","Text","HTMLSlotElement","customElements","nativeHTMLElement","patch","nativeMethods","nativeTree","ShadowRoot","has","test","__CE_isImportDocument","import","__CE_shadowRoot","Map","constructor","__CE_patched","__CE_state","connectedCallback","disconnectedCallback","__CE_hasRegistry","__CE_documentLoadHandled","constructionStack","__CE_definition","attributeChangedCallback","observedAttributes","bind","childList","subtree","disconnect","j","setPrototypeOf","prepend","apply","append","enumerable","slice","before","replaceWith","remove","Function","SyntaxError","adoptedCallback","reject","CustomElementRegistry","define","whenDefined","polyfillWrapFlushCallback","createElementNS","getAttributeNS","setAttributeNS","removeAttributeNS","insertAdjacentElement","forcePolyfill","self","navigator","userAgent","CSS","supports","VAR_ASSIGN","MIXIN_MATCH","VAR_CONSUMED","ANIMATION_MATCH","BRACKETED","SCOPE_NAME","StyleTransformer","dom","shouldRemoveScope","_transformDom","selector","c$","_content","classList","newValue","StyleUtil.setElementClassRaw","elementStyles","styleRules","cssBuildType","StyleUtil.toCssText","StyleUtil.getIsExtends","css","ext","hostScope","_calcHostScope","_calcElementScope","isScoped","_transformRule","_transformComplexSelector","transformer","transformedSelector","_transformRuleCss","p$","COMPLEX_SELECTOR_SEP","StyleUtil.isKeyframesSelector","stop","NTH","SLOTTED_START","HOST","SIMPLE_SELECTOR_SEP","info","_transformCompoundSelector","combinator","slottedIndex","SLOTTED","_transformHostSelector","_transformSimpleSelector","slotted","SLOTTED_PAREN","paren","DIR_PAREN","dir","PSEUDO_PREFIX","HOST_PAREN","SIMPLE_SELECTOR_PREFIX","typeSelector","documentRule","normalizeRootSelector","_transformDocumentSelector","SCOPE_DOC_SELECTOR","StyleTransformer$1","infoKey","StyleInfo","styleInfo","ast","placeholder","ownStylePropertyNames","cssBuild","overrideStyleProperties","styleProperties","scopeSelector","customStyle","_getStyleRules","IS_IE","XSCOPE_NAME","StyleProperties","decorateStyles","props","keyframes","ruleIndex","StyleUtil.forEachRule","decorateRule","collectPropertiesInCssText","propertyInfo","_keyframes","names","hasProperties","collectProperties","collectCssText","any","RX.VAR_ASSIGN","exec","assign","collectConsumingCssText","RX.BRACKETED","RX.VAR_CONSUMED","reify","valueForProperty","property","valueForProperties","StyleUtil.processVariableAndFallback","propertyValue","parts","RX.MIXIN_MATCH","lastIndex","colon","pp","applyProperties","output","applyKeyframeTransforms","keyframeTransforms","hasAnimations","RX.ANIMATION_MATCH","transform","keyframeNamesToTransform","keyframe","propertyDataFromStyles","selectorToMatch","key","whenHostOrRootRule","parsedSelector","isRoot","isHost","hostAndRootPropertiesForScope","hostProps","rootProps","_element","transformStyles","hostSelector","rxHostSelector","hostRx","RegExp","RX.HOST_PREFIX","_elementKeyframeTransforms","_scopeSelector","keyframesRules","_scopeKeyframes","_keyframesRuleTransformer","keyframesNameRx","transformedKeyframesName","scopeId","applyElementScopeSelector","old","applyElementStyle","StyleUtil.applyCss","StyleUtil.applyStyle","applyCustomStyle","StyleUtil.rulesForStyle","StyleProperties$1","placeholderMap","ce","origDefine","clazz","options","elementNeedsScoping","hasAttribute","handler","mxns","mxn","classes","classIdx","nativeCustomElements","delayedStart","body","requestAnimationFrame","listener","PROCESSED_MARKER","SEEN_MARKER","transformFn","validateFn","CustomStyleInterface","enqueueDocumentValidation","addCustomStyle","getStyleForCustomStyle","processStyles","cs","appliedStyle","attr","fn","needsEnqueue","styleCache","typeMax","cache","_validate","cacheEntry","ownPropertyNames","pn","idx","store","tagname","styleElement","fetch","entry","_scopeCounter","_documentOwner","_documentOwnerStyleInfo","_elementsHaveApplied","_applyShim","_customStyleInterface","_ensure","watcherFlush","_generateScopeSelector","id","getStyleAst","styleAstToString","_gatherStyles","styles","_getCssBuild","prepareTemplate","_prepared","__cssBuild","hasMixins","_cssBuild","_generateStaticStyle","_style","_ownPropertyNames","shadowroot","_prepareHost","_ensureApplyShim","ApplyShim","ApplyShimUtils.invalidate","_ensureCustomStyleInterface","transformCustomStyleForDocument","flushCustomStyles","customStyles","_revalidateCustomStyleApplyShim","_updateProperties","_applyCustomStyles","styleDocument","overrideProps","_isRootOwner","_applyStyleProperties","ApplyShimUtils.templateIsValid","ApplyShimUtils.templateIsValidating","ApplyShimUtils.startValidatingTemplate","_styleOwnerForNode","cachedScopeSelector","cachedStyle","oldScopeSelector","owner","ownerStyleInfo","ownerProperties","hostAndRootProps","propertyData","propertiesMatchingHost","_mixinOverrideStyles","overrides","styleSubtree","shadowChildren","_revalidateApplyShim","getComputedStyleValue","getComputedStyle","getPropertyValue","classString","scopeName","classAttr","k$","_styleInfoForNode","scopingShim","elementExt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strict';\n\n(function(){\n/*\n\nCopyright (c) 2016 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n'use strict';var aa={};function l(a,b,c){return{index:a,removed:b,addedCount:c}}\nvar ba={calcEditDistances:function(a,b,c,d,e,f){f=f-e+1;c=c-b+1;for(var g=Array(f),h=0;h]/g;function ja(a){switch(a){case \"&\":return\"&\";case \"<\":return\"<\";case \">\":return\">\";case '\"':return\""\";case \"\\u00a0\":return\" \"}}function ka(a){for(var b={},c=0;c\";return la[b]?d:d+oa(a,c)+\"\"+b+\">\";case Node.TEXT_NODE:return a=a.data,b&&ma[b.localName]?a:a.replace(ia,ja);case Node.COMMENT_NODE:return\"\\x3c!--\"+a.data+\"--\\x3e\";default:throw window.console.error(a),Error(\"not implemented\");}}\nfunction oa(a,b){\"template\"===a.localName&&(a=a.content);for(var c=\"\",d=b?b(a):a.childNodes,e=0,f=d.length,g;e} */\n this['rules'] = null;\n /** @type {string} */\n this['parsedCssText'] = '';\n /** @type {string} */\n this['cssText'] = '';\n /** @type {boolean} */\n this['atRule'] = false;\n /** @type {number} */\n this['type'] = 0;\n /** @type {string} */\n this['keyframesName'] = '';\n /** @type {string} */\n this['selector'] = '';\n /** @type {string} */\n this['parsedSelector'] = '';\n }\n}\n\n// given a string of css, return a simple rule tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parse(text) {\n text = clean(text);\n return parseCss(lex(text), text);\n}\n\n// remove stuff we don't care about that may hinder parsing\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction clean(cssText) {\n return cssText.replace(RX.comments, '').replace(RX.port, '');\n}\n\n// super simple {...} lexer that returns a node tree\n/**\n * @param {string} text\n * @return {StyleNode}\n */\nfunction lex(text) {\n let root = new StyleNode();\n root['start'] = 0;\n root['end'] = text.length;\n let n = root;\n for (let i = 0, l = text.length; i < l; i++) {\n if (text[i] === OPEN_BRACE) {\n if (!n['rules']) {\n n['rules'] = [];\n }\n let p = n;\n let previous = p['rules'][p['rules'].length - 1] || null;\n n = new StyleNode();\n n['start'] = i + 1;\n n['parent'] = p;\n n['previous'] = previous;\n p['rules'].push(n);\n } else if (text[i] === CLOSE_BRACE) {\n n['end'] = i + 1;\n n = n['parent'] || root;\n }\n }\n return root;\n}\n\n// add selectors/cssText to node tree\n/**\n * @param {StyleNode} node\n * @param {string} text\n * @return {StyleNode}\n */\nfunction parseCss(node, text) {\n let t = text.substring(node['start'], node['end'] - 1);\n node['parsedCssText'] = node['cssText'] = t.trim();\n if (node['parent']) {\n let ss = node['previous'] ? node['previous']['end'] : node['parent']['start'];\n t = text.substring(ss, node['start'] - 1);\n t = _expandUnicodeEscapes(t);\n t = t.replace(RX.multipleSpaces, ' ');\n // TODO(sorvell): ad hoc; make selector include only after last ;\n // helps with mixin syntax\n t = t.substring(t.lastIndexOf(';') + 1);\n let s = node['parsedSelector'] = node['selector'] = t.trim();\n node['atRule'] = (s.indexOf(AT_START) === 0);\n // note, support a subset of rule types...\n if (node['atRule']) {\n if (s.indexOf(MEDIA_START) === 0) {\n node['type'] = types.MEDIA_RULE;\n } else if (s.match(RX.keyframesRule)) {\n node['type'] = types.KEYFRAMES_RULE;\n node['keyframesName'] =\n node['selector'].split(RX.multipleSpaces).pop();\n }\n } else {\n if (s.indexOf(VAR_START) === 0) {\n node['type'] = types.MIXIN_RULE;\n } else {\n node['type'] = types.STYLE_RULE;\n }\n }\n }\n let r$ = node['rules'];\n if (r$) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n parseCss(r, text);\n }\n }\n return node;\n}\n\n/**\n * conversion of sort unicode escapes with spaces like `\\33 ` (and longer) into\n * expanded form that doesn't require trailing space `\\000033`\n * @param {string} s\n * @return {string}\n */\nfunction _expandUnicodeEscapes(s) {\n return s.replace(/\\\\([0-9a-f]{1,6})\\s/gi, function() {\n let code = arguments[1],\n repeat = 6 - code.length;\n while (repeat--) {\n code = '0' + code;\n }\n return '\\\\' + code;\n });\n}\n\n/**\n * stringify parsed css.\n * @param {StyleNode} node\n * @param {boolean=} preserveProperties\n * @param {string=} text\n * @return {string}\n */\nfunction stringify(node, preserveProperties, text = '') {\n // calc rule cssText\n let cssText = '';\n if (node['cssText'] || node['rules']) {\n let r$ = node['rules'];\n if (r$ && !_hasMixinRules(r$)) {\n for (let i = 0, l = r$.length, r;\n (i < l) && (r = r$[i]); i++) {\n cssText = stringify(r, preserveProperties, cssText);\n }\n } else {\n cssText = preserveProperties ? node['cssText'] :\n removeCustomProps(node['cssText']);\n cssText = cssText.trim();\n if (cssText) {\n cssText = ' ' + cssText + '\\n';\n }\n }\n }\n // emit rule if there is cssText\n if (cssText) {\n if (node['selector']) {\n text += node['selector'] + ' ' + OPEN_BRACE + '\\n';\n }\n text += cssText;\n if (node['selector']) {\n text += CLOSE_BRACE + '\\n\\n';\n }\n }\n return text;\n}\n\n/**\n * @param {Array} rules\n * @return {boolean}\n */\nfunction _hasMixinRules(rules) {\n let r = rules[0];\n return Boolean(r) && Boolean(r['selector']) && r['selector'].indexOf(VAR_START) === 0;\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomProps(cssText) {\n cssText = removeCustomPropAssignment(cssText);\n return removeCustomPropApply(cssText);\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropAssignment(cssText) {\n return cssText\n .replace(RX.customProp, '')\n .replace(RX.mixinProp, '');\n}\n\n/**\n * @param {string} cssText\n * @return {string}\n */\nfunction removeCustomPropApply(cssText) {\n return cssText\n .replace(RX.mixinApply, '')\n .replace(RX.varApply, '');\n}\n\n/** @enum {number} */\nconst types = {\n STYLE_RULE: 1,\n KEYFRAMES_RULE: 7,\n MEDIA_RULE: 4,\n MIXIN_RULE: 1000\n};\n\nconst OPEN_BRACE = '{';\nconst CLOSE_BRACE = '}';\n\n// helper regexp's\nconst RX = {\n comments: /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//gim,\n port: /@import[^;]*;/gim,\n customProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\\n]|$)/gim,\n mixinProp: /(?:^[^;\\-\\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\\n]|$)?/gim,\n mixinApply: /@apply\\s*\\(?[^);]*\\)?\\s*(?:[;\\n]|$)?/gim,\n varApply: /[^;:]*?:[^;]*?var\\([^;]*\\)(?:[;\\n]|$)?/gim,\n keyframesRule: /^@[^\\s]*keyframes/,\n multipleSpaces: /\\s+/g\n};\n\nconst VAR_START = '--';\nconst MEDIA_START = '@media';\nconst AT_START = '@';\n\n/**\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\nlet nativeShadow = !(window['ShadyDOM'] && window['ShadyDOM']['inUse']);\n// chrome 49 has semi-working css vars, check if box-shadow works\n// safari 9.1 has a recalc bug: https://bugs.webkit.org/show_bug.cgi?id=155782\nlet nativeCssVariables = (!navigator.userAgent.match('AppleWebKit/601') &&\nwindow.CSS && CSS.supports && CSS.supports('box-shadow', '0 0 0 var(--foo)'));\n\n/**\n * @param {ShadyCSSOptions | ShadyCSSInterface | undefined} settings\n */\nfunction parseSettings(settings) {\n if (settings) {\n nativeCssVariables = nativeCssVariables && !settings['nativeCss'] && !settings['shimcssproperties'];\n nativeShadow = nativeShadow && !settings['nativeShadow'] && !settings['shimshadow'];\n }\n}\n\nif (window.ShadyCSS) {\n parseSettings(window.ShadyCSS);\n} else if (window['WebComponents']) {\n parseSettings(window['WebComponents']['flags']);\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\nconst VAR_ASSIGN = /(?:^|[;\\s{]\\s*)(--[\\w-]*?)\\s*:\\s*(?:([^;{]*)|{([^}]*)})(?:(?=[;\\s}])|$)/gi;\nconst MIXIN_MATCH = /(?:^|\\W+)@apply\\s*\\(?([^);\\n]*)\\)?/gi;\nconst VAR_CONSUMED = /(--[\\w-]+)\\s*([:,;)]|$)/gi;\nconst ANIMATION_MATCH = /(animation\\s*:)|(animation-name\\s*:)/;\nconst MEDIA_MATCH = /@media[^(]*(\\([^)]*\\))/;\n\nconst BRACKETED = /\\{[^}]*\\}/g;\nconst HOST_PREFIX = '(?:^|[^.#[:])';\nconst HOST_SUFFIX = '($|[.:[\\\\s>+~])';\n\n/**\n@license\nCopyright (c) 2017 The Polymer Project Authors. All rights reserved.\nThis code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\nThe complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\nThe complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\nCode distributed by Google as part of the polymer project is also\nsubject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n*/\n\n/**\n * @param {string|StyleNode} rules\n * @param {function(StyleNode)=} callback\n */\nfunction toCssText (rules, callback) {\n if (typeof rules === 'string') {\n rules = parse(rules);\n }\n if (callback) {\n forEachRule(rules, callback);\n }\n return stringify(rules, nativeCssVariables);\n}\n\n/**\n * @param {HTMLStyleElement} style\n * @return {StyleNode}\n */\nfunction rulesForStyle(style) {\n if (!style['__cssRules'] && style.textContent) {\n style['__cssRules'] = parse(style.textContent);\n }\n return style['__cssRules'];\n}\n\n// Tests if a rule is a keyframes selector, which looks almost exactly\n// like a normal selector but is not (it has nothing to do with scoping\n// for example).\n/**\n * @param {StyleNode} rule\n * @return {boolean}\n */\nfunction isKeyframesSelector(rule) {\n return Boolean(rule['parent']) &&\n rule['parent']['type'] === types.KEYFRAMES_RULE;\n}\n\n/**\n * @param {StyleNode} node\n * @param {Function=} styleRuleCallback\n * @param {Function=} keyframesRuleCallback\n * @param {boolean=} onlyActiveRules\n */\nfunction forEachRule(node, styleRuleCallback, keyframesRuleCallback, onlyActiveRules) {\n if (!node) {\n return;\n }\n let skipRules = false;\n let type = node['type'];\n if (onlyActiveRules) {\n if (type === types.MEDIA_RULE) {\n let matchMedia = node['selector'].match(MEDIA_MATCH);\n if (matchMedia) {\n // if rule is a non matching @media rule, skip subrules\n if (!window.matchMedia(matchMedia[1]).matches) {\n skipRules = true;\n }\n }\n }\n }\n if (type === types.STYLE_RULE) {\n styleRuleCallback(node);\n } else if (keyframesRuleCallback &&\n type === types.KEYFRAMES_RULE) {\n keyframesRuleCallback(node);\n } else if (type === types.MIXIN_RULE) {\n skipRules = true;\n }\n let r$ = node['rules'];\n if (r$ && !skipRules) {\n for (let i=0, l=r$.length, r; (i`\n */\n if (localName) {\n if (localName.indexOf('-') > -1) {\n is = localName;\n } else {\n typeExtension = localName;\n is = (element.getAttribute && element.getAttribute('is')) || '';\n }\n } else {\n is = /** @type {?} */(element).is;\n typeExtension = /** @type {?} */(element).extends;\n }\n return {is, typeExtension};\n}\n\n/**\n@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/* Transforms ShadowDOM styling into ShadyDOM styling\n\n* scoping:\n\n * elements in scope get scoping selector class=\"x-foo-scope\"\n * selectors re-written as follows:\n\n div button -> div.x-foo-scope button.x-foo-scope\n\n* :host -> scopeName\n\n* :host(...) -> scopeName...\n\n* ::slotted(...) -> scopeName > ...\n\n* ...:dir(ltr|rtl) -> [dir=\"ltr|rtl\"] ..., ...[dir=\"ltr|rtl\"]\n\n* :host(:dir[rtl]) -> scopeName:dir(rtl) -> [dir=\"rtl\"] scopeName, scopeName[dir=\"rtl\"]\n\n*/\nconst SCOPE_NAME = 'style-scope';\n\nclass StyleTransformer {\n get SCOPE_NAME() {\n return SCOPE_NAME;\n }\n // Given a node and scope name, add a scoping class to each node\n // in the tree. This facilitates transforming css into scoped rules.\n dom(node, scope, shouldRemoveScope) {\n // one time optimization to skip scoping...\n if (node['__styleScoped']) {\n node['__styleScoped'] = null;\n } else {\n this._transformDom(node, scope || '', shouldRemoveScope);\n }\n }\n\n _transformDom(node, selector, shouldRemoveScope) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n this.element(node, selector, shouldRemoveScope);\n }\n let c$ = (node.localName === 'template') ?\n (node.content || node._content).childNodes :\n node.children || node.childNodes;\n if (c$) {\n for (let i=0; i `:${type}(${inner.replace(/\\s/g, '')})`);\n selector = selector.replace(SLOTTED_START, `${HOST} $1`);\n selector = selector.replace(SIMPLE_SELECTOR_SEP, (m, c, s) => {\n if (!stop) {\n let info = this._transformCompoundSelector(s, c, scope, hostScope);\n stop = stop || info.stop;\n c = info.combinator;\n s = info.value;\n }\n return c + s;\n });\n return selector;\n }\n\n _transformCompoundSelector(selector, combinator, scope, hostScope) {\n // replace :host with host scoping class\n let slottedIndex = selector.indexOf(SLOTTED);\n if (selector.indexOf(HOST) >= 0) {\n selector = this._transformHostSelector(selector, hostScope);\n // replace other selectors with scoping class\n } else if (slottedIndex !== 0) {\n selector = scope ? this._transformSimpleSelector(selector, scope) :\n selector;\n }\n // mark ::slotted() scope jump to replace with descendant selector + arg\n // also ignore left-side combinator\n let slotted = false;\n if (slottedIndex >= 0) {\n combinator = '';\n slotted = true;\n }\n // process scope jumping selectors up to the scope jump and then stop\n let stop;\n if (slotted) {\n stop = true;\n if (slotted) {\n // .zonk ::slotted(.foo) -> .zonk.scope > .foo\n selector = selector.replace(SLOTTED_PAREN, (m, paren) => ` > ${paren}`);\n }\n }\n selector = selector.replace(DIR_PAREN, (m, before, dir) =>\n `[dir=\"${dir}\"] ${before}, ${before}[dir=\"${dir}\"]`);\n return {value: selector, combinator, stop};\n }\n\n _transformSimpleSelector(selector, scope) {\n let p$ = selector.split(PSEUDO_PREFIX);\n p$[0] += scope;\n return p$.join(PSEUDO_PREFIX);\n }\n\n // :host(...) -> scopeName...\n _transformHostSelector(selector, hostScope) {\n let m = selector.match(HOST_PAREN);\n let paren = m && m[2].trim() || '';\n if (paren) {\n if (!paren[0].match(SIMPLE_SELECTOR_PREFIX)) {\n // paren starts with a type selector\n let typeSelector = paren.split(SIMPLE_SELECTOR_PREFIX)[0];\n // if the type selector is our hostScope then avoid pre-pending it\n if (typeSelector === hostScope) {\n return paren;\n // otherwise, this selector should not match in this scope so\n // output a bogus selector.\n } else {\n return SELECTOR_NO_MATCH;\n }\n } else {\n // make sure to do a replace here to catch selectors like:\n // `:host(.foo)::before`\n return selector.replace(HOST_PAREN, function(m, host, paren) {\n return hostScope + paren;\n });\n }\n // if no paren, do a straight :host replacement.\n // TODO(sorvell): this should not strictly be necessary but\n // it's needed to maintain support for `:host[foo]` type selectors\n // which have been improperly used under Shady DOM. This should be\n // deprecated.\n } else {\n return selector.replace(HOST, hostScope);\n }\n }\n\n /**\n * @param {StyleNode} rule\n */\n documentRule(rule) {\n // reset selector in case this is redone.\n rule['selector'] = rule['parsedSelector'];\n this.normalizeRootSelector(rule);\n this._transformRule(rule, this._transformDocumentSelector);\n }\n\n /**\n * @param {StyleNode} rule\n */\n normalizeRootSelector(rule) {\n if (rule['selector'] === ROOT) {\n rule['selector'] = 'html';\n }\n }\n\n/**\n * @param {string} selector\n */\n _transformDocumentSelector(selector) {\n return selector.match(SLOTTED) ?\n this._transformComplexSelector(selector, SCOPE_DOC_SELECTOR) :\n this._transformSimpleSelector(selector.trim(), SCOPE_DOC_SELECTOR);\n }\n}\n\nlet NTH = /:(nth[-\\w]+)\\(([^)]+)\\)/;\nlet SCOPE_DOC_SELECTOR = `:not(.${SCOPE_NAME})`;\nlet COMPLEX_SELECTOR_SEP = ',';\nlet SIMPLE_SELECTOR_SEP = /(^|[\\s>+~]+)((?:\\[.+?\\]|[^\\s>+~=\\[])+)/g;\nlet SIMPLE_SELECTOR_PREFIX = /[[.:#*]/;\nlet HOST = ':host';\nlet ROOT = ':root';\nlet SLOTTED = '::slotted';\nlet SLOTTED_START = new RegExp(`^(${SLOTTED})`);\n// NOTE: this supports 1 nested () pair for things like\n// :host(:not([selected]), more general support requires\n// parsing which seems like overkill\nlet HOST_PAREN = /(:host)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\n// similar to HOST_PAREN\nlet SLOTTED_PAREN = /(?:::slotted)(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))/;\nlet DIR_PAREN = /(.*):dir\\((?:(ltr|rtl))\\)/;\nlet CSS_CLASS_PREFIX = '.';\nlet PSEUDO_PREFIX = ':';\nlet CLASS = 'class';\nlet SELECTOR_NO_MATCH = 'should_not_match';\n\nvar StyleTransformer$1 = new StyleTransformer();\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/** @const {string} */\nconst infoKey = '__styleInfo';\n\nclass StyleInfo {\n /**\n * @param {Element} node\n * @return {StyleInfo}\n */\n static get(node) {\n if (node) {\n return node[infoKey];\n } else {\n return null;\n }\n }\n /**\n * @param {!Element} node\n * @param {StyleInfo} styleInfo\n * @return {StyleInfo}\n */\n static set(node, styleInfo) {\n node[infoKey] = styleInfo;\n return styleInfo;\n }\n /**\n * @param {StyleNode} ast\n * @param {Node=} placeholder\n * @param {Array=} ownStylePropertyNames\n * @param {string=} elementName\n * @param {string=} typeExtension\n * @param {string=} cssBuild\n */\n constructor(ast, placeholder, ownStylePropertyNames, elementName, typeExtension, cssBuild) {\n /** @type {StyleNode} */\n this.styleRules = ast || null;\n /** @type {Node} */\n this.placeholder = placeholder || null;\n /** @type {!Array} */\n this.ownStylePropertyNames = ownStylePropertyNames || [];\n /** @type {Array