diff --git a/webcomponents-hi-sd-ce.js b/webcomponents-hi-sd-ce.js index 0b699d4..ec41a4e 100644 --- a/webcomponents-hi-sd-ce.js +++ b/webcomponents-hi-sd-ce.js @@ -1,6 +1,6 @@ -(function(){'use strict';function _(Wt){return Wt=$(Wt),te(ee(Wt),Wt)}function $(Wt){return Wt.replace(we.comments,'').replace(we.port,'')}function ee(Wt){let Bt=new Ie;Bt.start=0,Bt.end=Wt.length;let jt=Bt;for(let Kt=0,Gt=Wt.length;Kt{It=Bt}),'complete'===document.readyState?It():document.addEventListener('readystatechange',()=>{'complete'===document.readyState&&It()})),At.then(function(){Wt&&Wt()}))}function xe(Wt,Bt){for(let jt in Bt)null===jt?Wt.style.removeProperty(jt):Wt.style.setProperty(jt,Bt[jt])}(Wt=>{const Bt=!!('import'in document.createElement('link'));let jt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return jt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const Kt=/(^\/)|(^#)|(^[\w-\d]*:)/,Gt=/(url\()([^)]*)(\))/g,Vt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Xt=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Yt={fixUrls(_o,yo){_o.href&&_o.setAttribute('href',Yt.replaceAttrUrl(_o.getAttribute('href'),yo)),_o.src&&_o.setAttribute('src',Yt.replaceAttrUrl(_o.getAttribute('src'),yo)),'style'===_o.localName&&Yt.resolveUrlsInStyle(_o,yo)},fixUrlAttributes(_o,yo){const mo=['action','src','href','url','style'];for(let fo,go=0;gobo.search(/({{|\[\[)/)&&(So.value='style'===fo?Yt.resolveUrlsInCssText(bo,yo):Yt.replaceAttrUrl(bo,yo))}},fixUrlsInTemplates(_o,yo){const mo=_o.querySelectorAll('template');for(let go=0;go{let No=So.replace(/["']/g,'');return yo&&(No=Yt.resolveUrl(No,yo)),fo+'\''+No+'\''+bo})},replaceAttrUrl(_o,yo){return _o&&Kt.test(_o)?_o:Yt.resolveUrl(_o,yo)},resolveUrl(_o,yo){if(void 0===Yt.__workingURL){Yt.__workingURL=!1;try{const go=new URL('b','http://a');go.pathname='c%20d',Yt.__workingURL='http://a/c%20d'===go.href}catch(go){}}if(Yt.__workingURL)return new URL(_o,yo).href;let mo=Yt.__tempDoc;return mo||(mo=document.implementation.createHTMLDocument('temp'),Yt.__tempDoc=mo,mo.__base=mo.createElement('base'),mo.head.appendChild(mo.__base),mo.__anchor=mo.createElement('a')),mo.__base.href=yo,mo.__anchor.href=_o,mo.__anchor.href||_o}},zt={async:!0,load(_o,yo,mo){if(!_o)mo('error: href must be specified');else if(_o.match(/^data:/)){const go=_o.split(','),fo=go[0];let So=go[1];So=-1{let fo=go.getResponseHeader('Location');if(fo&&0===fo.indexOf('/')){const bo=location.origin||location.protocol+'//'+location.host;fo=bo+fo}const So=go.response||go.responseText;304===go.status||0===go.status||200<=go.status&&300>go.status?yo(So,fo):mo(So)},go.send()}}},$t=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),Zt='link[rel=import]',Qt='import-disable',Jt=`link[rel=stylesheet][href][type=${Qt}]`,eo=`${Zt}, ${Jt}, +(function(){'use strict';function _(Ut){return Ut=$(Ut),te(ee(Ut),Ut)}function $(Ut){return Ut.replace(De.comments,'').replace(De.port,'')}function ee(Ut){let qt=new xe;qt.start=0,qt.end=Ut.length;let Wt=qt;for(let Bt=0,jt=Ut.length;Bt{Rt=qt}),'complete'===document.readyState?Rt():document.addEventListener('readystatechange',()=>{'complete'===document.readyState&&Rt()})),Pt.then(function(){Ut&&Ut()}))}function Ae(Ut,qt){for(let Wt in qt)null===Wt?Ut.style.removeProperty(Wt):Ut.style.setProperty(Wt,qt[Wt])}(Ut=>{const qt=!!('import'in document.createElement('link'));let Wt=null;!1=='currentScript'in document&&Object.defineProperty(document,'currentScript',{get(){return Wt||('complete'===document.readyState?null:document.scripts[document.scripts.length-1])},configurable:!0});const Bt=/(^\/)|(^#)|(^[\w-\d]*:)/,jt=/(url\()([^)]*)(\))/g,Kt=/(@import[\s]+(?!url\())([^;]*)(;)/g,Gt=/(]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,Vt={fixUrls(ho,uo){ho.href&&ho.setAttribute('href',Vt.replaceAttrUrl(ho.getAttribute('href'),uo)),ho.src&&ho.setAttribute('src',Vt.replaceAttrUrl(ho.getAttribute('src'),uo)),'style'===ho.localName&&Vt.resolveUrlsInStyle(ho,uo)},fixUrlAttributes(ho,uo){const _o=['action','src','href','url','style'];for(let mo,yo=0;yo<_o.length&&(mo=_o[yo]);yo++){const go=ho.attributes[mo],fo=go&&go.value;fo&&0>fo.search(/({{|\[\[)/)&&(go.value='style'===mo?Vt.resolveUrlsInCssText(fo,uo):Vt.replaceAttrUrl(fo,uo))}},fixUrlsInTemplates(ho,uo){const _o=ho.querySelectorAll('template');for(let yo=0;yo<_o.length;yo++)Vt.fixUrlsInTemplate(_o[yo],uo)},fixUrlsInTemplate(ho,uo){const _o=ho.content||ho,yo=_o.querySelectorAll('style, form[action], [src], [href], [url], [style]');for(let mo=0;mo{let So=go.replace(/["']/g,'');return uo&&(So=Vt.resolveUrl(So,uo)),mo+'\''+So+'\''+fo})},replaceAttrUrl(ho,uo){return ho&&Bt.test(ho)?ho:Vt.resolveUrl(ho,uo)},resolveUrl(ho,uo){if(void 0===Vt.__workingURL){Vt.__workingURL=!1;try{const yo=new URL('b','http://a');yo.pathname='c%20d',Vt.__workingURL='http://a/c%20d'===yo.href}catch(yo){}}if(Vt.__workingURL)return new URL(ho,uo).href;let _o=Vt.__tempDoc;return _o||(_o=document.implementation.createHTMLDocument('temp'),Vt.__tempDoc=_o,_o.__base=_o.createElement('base'),_o.head.appendChild(_o.__base),_o.__anchor=_o.createElement('a')),_o.__base.href=uo,_o.__anchor.href=ho,_o.__anchor.href||ho}},Xt={async:!0,load(ho,uo,_o){if(!ho)_o('error: href must be specified');else if(ho.match(/^data:/)){const yo=ho.split(','),mo=yo[0];let go=yo[1];go=-1{let mo=yo.getResponseHeader('Location');if(mo&&0===mo.indexOf('/')){const fo=location.origin||location.protocol+'//'+location.host;mo=fo+mo}const go=yo.response||yo.responseText;304===yo.status||0===yo.status||200<=yo.status&&300>yo.status?uo(go,mo):_o(go)},yo.send()}}},Yt=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent),zt='link[rel=import]',$t='import-disable',Zt=`link[rel=stylesheet][href][type=${$t}]`,Qt=`${zt}, ${Zt}, style:not([type]), link[rel=stylesheet][href]:not([type]), script:not([type]), script[type="application/javascript"], - script[type="text/javascript"]`,to='import-dependency',oo=`${Zt}:not(${to})`,ro=`script[${to}]`,no=`style[${to}], - link[rel=stylesheet][${to}]`;const lo=_o=>{return _o.nodeType===Node.ELEMENT_NODE&&'link'===_o.localName&&'import'===_o.rel},ao=(_o,yo)=>{if(_o.__loaded)yo&&yo();else if('script'===_o.localName&&!_o.src)_o.__loaded=!0,yo&&yo();else{const mo=go=>{_o.removeEventListener(go.type,mo),_o.__loaded=!0,yo&&yo()};_o.addEventListener('load',mo),$t&&'style'===_o.localName||_o.addEventListener('error',mo)}},io=_o=>{po(()=>co(()=>_o&&_o()))},po=_o=>{if('loading'!==document.readyState)_o();else{const yo=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',yo),_o())};document.addEventListener('readystatechange',yo)}},co=_o=>{let yo=document.querySelectorAll(oo),mo=yo.length;if(!mo)return void _o();for(let So,go=0,fo=yo.length;go{0==--mo&&_o()})},ho=_o=>{if(Bt)return _o.ownerDocument===document?null:_o.ownerDocument;let yo=_o.__importDoc;if(!yo&&_o.parentNode){if(yo=_o.parentNode,'function'==typeof yo.closest)yo=yo.closest(Zt);else for(;!lo(yo)&&(yo=yo.parentNode););_o.__importDoc=yo}return yo},uo=(_o,yo)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(_o,yo);const mo=document.createEvent('CustomEvent');return mo.initCustomEvent(_o,!!yo.bubbles,!!yo.cancelable,yo.detail),mo};if(Bt){const _o=document.querySelectorAll(Zt);for(let fo,mo=0,go=_o.length;mo{const go=mo.target;lo(go)&&(go.__loaded=!0)};document.addEventListener('load',yo,!0),document.addEventListener('error',yo,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(_o=>this.handleMutations(_o)),po(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(_o){const yo=_o.querySelectorAll(Zt);for(let mo=0,go=yo.length;mo{const fo=this.makeDocument(mo,go||yo);this.documents[yo]=fo,this.inflight--,this.loadImports(fo),this.processImportsIfLoadingDone()},()=>{this.documents[yo]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(_o,yo){if(!_o)return document.createDocumentFragment();$t&&(_o=_o.replace(Xt,(No,Co,Eo)=>{return-1===No.indexOf('type=')?`${Co} type=${Qt} ${Eo}`:No}));let mo;const go=document.createElement('template');if(go.innerHTML=_o,go.content)mo=go.content;else for(mo=document.createDocumentFragment();go.firstChild;)mo.appendChild(go.firstChild);const fo=mo.querySelector('base');fo&&(yo=Yt.replaceAttrUrl(fo.getAttribute('href'),yo),fo.removeAttribute('href'));const So=mo.querySelectorAll(eo);let bo=0;for(let Eo,No=0,Co=So.length;No{yo&&_o&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{yo=!0,mo()}),this.runScripts(()=>{_o=!0,mo()})}}flatten(_o){const yo=_o.querySelectorAll(Zt);for(let fo,mo=0,go=yo.length;mofo.href,configurable:!0,enumerable:!0}),this.flatten(So),fo.appendChild(So))}}runScripts(_o){const yo=document.querySelectorAll(ro),mo=yo.length,go=fo=>{if(fo{jt=null,go(fo+1)})}else _o()};go(0)}waitForStyles(_o){const yo=document.querySelectorAll(no);let mo=yo.length;if(!mo)return void _o();const go=$t&&!!document.querySelector(Jt);for(let bo,fo=0,So=yo.length;fo{bo.removeAttribute(to),0==--mo&&_o()}),go&&bo.parentNode!==document.head){const No=document.createElement(bo.localName);No.__appliedElement=bo,No.setAttribute('type','import-placeholder'),bo.parentNode.insertBefore(No,bo.nextSibling);let Co=ho(bo);for(;Co&&ho(Co);)Co=ho(Co);Co.parentNode!==document.head&&(Co=null),document.head.insertBefore(bo,Co),bo.removeAttribute('type')}}fireEvents(){const _o=document.querySelectorAll(Zt);for(let mo,yo=_o.length-1;0<=yo&&(mo=_o[yo]);yo--)this.fireEventIfNeeded(mo)}fireEventIfNeeded(_o){if(!_o.__loaded){_o.__loaded=!0,_o.import&&(_o.import.readyState='complete');const yo=_o.import?'load':'error';_o.dispatchEvent(uo(yo,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(_o){for(let yo=0;yo<_o.length;yo++){const mo=_o[yo];if(mo.addedNodes)for(let go=0;godocument.dispatchEvent(uo('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),Wt.useNative=Bt,Wt.whenReady=io,Wt.importForElement=ho})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function Wt(Mr,Dr,wr){return{index:Mr,removed:Dr,addedCount:wr}}function Bt(Mr){return'ShadyRoot'===Mr.__localName}function jt(Mr,Dr){if(Mr&&Dr)for(var kr,wr=Object.getOwnPropertyNames(Dr),Lr=0;Lr'===Mr?'>':'"'===Mr?'"':'\xA0'===Mr?' ':void 0}function Xt(Mr){for(var Dr={},wr=0;wr';case Node.TEXT_NODE:return Mr=Mr.data,Dr&&Wo[Dr.localName]?Mr:Mr.replace(Uo,Vt);case Node.COMMENT_NODE:return'';default:throw window.console.error(Mr),Error('not implemented');}}function zt(Mr,Dr){'template'===Mr.localName&&(Mr=Mr.content);for(var Hr,wr='',Lr=Dr?Dr(Mr):Mr.childNodes,kr=0,Fr=Lr.length;kr]/g,qo=Xt('area base br col command embed hr img input keygen link meta param source track wbr'.split(' ')),Wo=Xt('style script xmp iframe noembed noframes plaintext noscript'.split(' '));Fo.getOuterHTML=Yt,Fo.getInnerHTML=zt;var Bo={},jo=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),Ko=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);Bo.parentNode=function(Mr){return jo.currentNode=Mr,jo.parentNode()},Bo.firstChild=function(Mr){return jo.currentNode=Mr,jo.firstChild()},Bo.lastChild=function(Mr){return jo.currentNode=Mr,jo.lastChild()},Bo.previousSibling=function(Mr){return jo.currentNode=Mr,jo.previousSibling()},Bo.nextSibling=function(Mr){return jo.currentNode=Mr,jo.nextSibling()},Bo.childNodes=$t,Bo.parentElement=function(Mr){return Ko.currentNode=Mr,Ko.parentNode()},Bo.firstElementChild=function(Mr){return Ko.currentNode=Mr,Ko.firstChild()},Bo.lastElementChild=function(Mr){return Ko.currentNode=Mr,Ko.lastChild()},Bo.previousElementSibling=function(Mr){return Ko.currentNode=Mr,Ko.previousSibling()},Bo.nextElementSibling=function(Mr){return Ko.currentNode=Mr,Ko.nextSibling()},Bo.children=function(Mr){var Dr=[];for(Ko.currentNode=Mr,Mr=Ko.firstChild();Mr;)Dr.push(Mr),Mr=Ko.nextSibling();return Dr},Bo.innerHTML=function(Mr){return Fo.getInnerHTML(Mr,function(Dr){return $t(Dr)})},Bo.textContent=function(Mr){if(Mr.nodeType!==Node.ELEMENT_NODE)return Mr.nodeValue;Mr=document.createTreeWalker(Mr,NodeFilter.SHOW_TEXT,null,!1);for(var wr,Dr='';wr=Mr.nextNode();)Dr+=wr.nodeValue;return Dr};var Go={},Vo=Object.getOwnPropertyDescriptor(Element.prototype,'innerHTML')||Object.getOwnPropertyDescriptor(HTMLElement.prototype,'innerHTML'),Xo=document.implementation.createHTMLDocument('inert').createElement('div'),Yo=Object.getOwnPropertyDescriptor(Document.prototype,'activeElement'),zo={parentElement:Zt('parentElement'),parentNode:Zt('parentNode'),nextSibling:Zt('nextSibling'),previousSibling:Zt('previousSibling'),className:{get:function(){return this.getAttribute('class')},set:function(Mr){this.setAttribute('class',Mr)},configurable:!0},nextElementSibling:{get:function(){if(ko.hasProperty(this,'nextSibling')){for(var Mr=this.nextSibling;Mr&&Mr.nodeType!==Node.ELEMENT_NODE;)Mr=Mr.nextSibling;return Mr}return Bo.nextElementSibling(this)},configurable:!0},previousElementSibling:{get:function(){if(ko.hasProperty(this,'previousSibling')){for(var Mr=this.previousSibling;Mr&&Mr.nodeType!==Node.ELEMENT_NODE;)Mr=Mr.previousSibling;return Mr}return Bo.previousElementSibling(this)},configurable:!0}},$o={childNodes:{get:function(){if(ko.hasProperty(this,'firstChild')){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var Mr=this.firstChild;Mr;Mr=Mr.nextSibling)this.__shady.childNodes.push(Mr)}return this.__shady.childNodes}return Bo.childNodes(this)},configurable:!0},firstChild:Zt('firstChild'),lastChild:Zt('lastChild'),textContent:{get:function(){if(ko.hasProperty(this,'firstChild')){for(var Lr,Mr=[],Dr=0,wr=this.childNodes;Lr=wr[Dr];Dr++)Lr.nodeType!==Node.COMMENT_NODE&&Mr.push(Lr.textContent);return Mr.join('')}return Bo.textContent(this)},set:function(Mr){if(this.nodeType!==Node.ELEMENT_NODE)this.nodeValue=Mr;else{for(;this.firstChild;)this.removeChild(this.firstChild);Mr&&this.appendChild(document.createTextNode(Mr))}},configurable:!0},firstElementChild:{get:function(){if(ko.hasProperty(this,'firstChild')){for(var Mr=this.firstChild;Mr&&Mr.nodeType!==Node.ELEMENT_NODE;)Mr=Mr.nextSibling;return Mr}return Bo.firstElementChild(this)},configurable:!0},lastElementChild:{get:function(){if(ko.hasProperty(this,'lastChild')){for(var Mr=this.lastChild;Mr&&Mr.nodeType!==Node.ELEMENT_NODE;)Mr=Mr.previousSibling;return Mr}return Bo.lastElementChild(this)},configurable:!0},children:{get:function(){return ko.hasProperty(this,'firstChild')?Array.prototype.filter.call(this.childNodes,function(Mr){return Mr.nodeType===Node.ELEMENT_NODE}):Bo.children(this)},configurable:!0},innerHTML:{get:function(){var Mr='template'===this.localName?this.content:this;return ko.hasProperty(this,'firstChild')?Fo.getInnerHTML(Mr):Bo.innerHTML(Mr)},set:function(Mr){for(var Dr='template'===this.localName?this.content:this;Dr.firstChild;)Dr.removeChild(Dr.firstChild);for(Vo&&Vo.set?Vo.set.call(Xo,Mr):Xo.innerHTML=Mr;Xo.firstChild;)Dr.appendChild(Xo.firstChild)},configurable:!0}},Zo={shadowRoot:{get:function(){return this.shadyRoot},set:function(Mr){this.shadyRoot=Mr},configurable:!0}},Qo={activeElement:{get:function(){var Mr;if(Mr=Yo&&Yo.get?Yo.get.call(document):Po.settings.hasDescriptors?void 0:document.activeElement,Mr){var Dr=!!Po.isShadyRoot(this);if(this===document||Dr&&this.host!==Mr&&this.host.contains(Mr)){for(Dr=Po.ownerShadyRootForNode(Mr);Dr&&Dr!==this;)Mr=Dr.host,Dr=Po.ownerShadyRootForNode(Mr);Mr=this===document?Dr?null:Mr:Dr===this?Mr:null}else Mr=null}else Mr=null;return Mr},set:function(){},configurable:!0}},Jo=Po.settings.hasDescriptors?function(){}:function(Mr){Mr.__shady&&Mr.__shady.__outsideAccessors||(Mr.__shady=Mr.__shady||{},Mr.__shady.__outsideAccessors=!0,Qt(Mr,zo,!0))},er=Po.settings.hasDescriptors?function(){}:function(Mr){Mr.__shady&&Mr.__shady.__insideAccessors||(Mr.__shady=Mr.__shady||{},Mr.__shady.__insideAccessors=!0,Qt(Mr,$o,!0),Qt(Mr,Zo,!0))};Go.ShadowRootAccessor=Zo,Go.ActiveElementAccessor=Qo,Go.patchAccessors=function(Mr){Qt(Mr,zo),Qt(Mr,$o),Qt(Mr,Qo)},Go.patchShadowRootAccessors=function(Mr){Qt(Mr,$o,!0),Qt(Mr,Qo,!0)},Go.patchOutsideElementAccessors=Jo,Go.patchInsideElementAccessors=er;var tr={};tr.recordInsertBefore=function(Mr,Dr,wr){if(Go.patchInsideElementAccessors(Dr),Dr.__shady=Dr.__shady||{},ko.hasProperty(Dr,'firstChild')&&(Dr.__shady.childNodes=null),Mr.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(var Lr=Mr.childNodes,kr=0;kr`:${Vt}(${Xt.replace(/\s/g,'')})`),Wt=Wt.replace(st,`${ot} $1`),Wt=Wt.replace(et,(Gt,Vt,Xt)=>{if(!Kt){let Yt=this._transformCompoundSelector(Xt,Vt,Bt,jt);Kt=Kt||Yt.stop,Vt=Yt.combinator,Xt=Yt.value}return Vt+Xt}),Wt}_transformCompoundSelector(Wt,Bt,jt,Kt){let Gt=Wt.indexOf(nt);0<=Wt.indexOf(ot)?Wt=this._transformHostSelector(Wt,Kt):0!==Gt&&(Wt=jt?this._transformSimpleSelector(Wt,jt):Wt);let Vt=!1;0<=Gt&&(Bt='',Vt=!0);let Xt;return Vt&&(Xt=!0,Vt&&(Wt=Wt.replace(dt,(Yt,zt)=>` > ${zt}`))),Wt=Wt.replace(it,(Yt,zt,$t)=>`[dir="${$t}"] ${zt}, ${zt}[dir="${$t}"]`),{value:Wt,combinator:Bt,stop:Xt}}_transformSimpleSelector(Wt,Bt){let jt=Wt.split(ct);return jt[0]+=Bt,jt.join(ct)}_transformHostSelector(Wt,Bt){let jt=Wt.match(lt),Kt=jt&&jt[2].trim()||'';if(Kt){if(!Kt[0].match(tt)){let Gt=Kt.split(tt)[0];return Gt===Bt?Kt:'should_not_match'}return Wt.replace(lt,function(Gt,Vt,Xt){return Bt+Xt})}return Wt.replace(ot,Bt)}documentRule(Wt){Wt.selector=Wt.parsedSelector,this.normalizeRootSelector(Wt),this._transformRule(Wt,this._transformDocumentSelector)}normalizeRootSelector(Wt){Wt.selector===':root'&&(Wt.selector='html')}_transformDocumentSelector(Wt){return Wt.match(nt)?this._transformComplexSelector(Wt,Qe):this._transformSimpleSelector(Wt.trim(),Qe)}}let Ze=/:(nth[-\w]+)\(([^)]+)\)/,Qe=`:not(.${ze})`,Je=',',et=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,tt=/[[.:#*]/,ot=':host',nt='::slotted',st=/^(::slotted)/,lt=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,dt=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,it=/(.*):dir\((?:(ltr|rtl))\)/,ct=':';var _t=new $e;const yt='__styleInfo';class mt{static get(Wt){return Wt?Wt[yt]:null}static set(Wt,Bt){return Wt[yt]=Bt,Bt}constructor(Wt,Bt,jt,Kt,Gt,Vt){this.styleRules=Wt||null,this.placeholder=Bt||null,this.ownStylePropertyNames=jt||[],this.overrideStyleProperties=null,this.elementName=Kt||'',this.cssBuild=Vt||'',this.typeExtension=Gt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}_getStyleRules(){return this.styleRules}}mt.prototype._getStyleRules=mt.prototype._getStyleRules;const gt=(Wt=>Wt.matches||Wt.matchesSelector||Wt.mozMatchesSelector||Wt.msMatchesSelector||Wt.oMatchesSelector||Wt.webkitMatchesSelector)(window.Element.prototype),ft=navigator.userAgent.match('Trident'),St='x-scope';class bt{get XSCOPE_NAME(){return St}decorateStyles(Wt){let Bt=this,jt={},Kt=[],Gt=0;ue(Wt,function(Xt){Bt.decorateRule(Xt),Xt.index=Gt++,Bt.collectPropertiesInCssText(Xt.propertyInfo.cssText,jt)},function(Yt){Kt.push(Yt)}),Wt._keyframes=Kt;let Vt=[];for(let Xt in jt)Vt.push(Xt);return Vt}decorateRule(Wt){if(Wt.propertyInfo)return Wt.propertyInfo;let Bt={},jt={},Kt=this.collectProperties(Wt,jt);return Kt&&(Bt.properties=jt,Wt.rules=null),Bt.cssText=this.collectCssText(Wt),Wt.propertyInfo=Bt,Bt}collectProperties(Wt,Bt){let jt=Wt.propertyInfo;if(!jt){let Kt,Vt=Wt.parsedCssText,Xt,Yt;for(;Kt=qe.exec(Vt);)Xt=(Kt[2]||Kt[3]).trim(),('inherit'!==Xt||'unset'!==Xt)&&(Bt[Kt[1].trim()]=Xt),Yt=!0;return Yt}else if(jt.properties)return Object.assign(Bt,jt.properties),!0}collectCssText(Wt){return this.collectConsumingCssText(Wt.parsedCssText)}collectConsumingCssText(Wt){return Wt.replace(Ge,'').replace(qe,'')}collectPropertiesInCssText(Wt,Bt){for(let jt,Kt;jt=Be.exec(Wt);)Kt=jt[1],':'!==jt[2]&&(Bt[Kt]=!0)}reify(Wt){let Bt=Object.getOwnPropertyNames(Wt);for(let Kt,jt=0;jt *'===Yt||'html'===Yt,$t=0===Yt.indexOf(':host')&&!zt;if('shady'===jt&&(zt=Yt===Xt+' > *.'+Xt||-1!==Yt.indexOf('html'),$t=!zt&&0===Yt.indexOf(Xt)),'shadow'===jt&&(zt=':host > *'===Yt||'html'===Yt,$t=$t&&!zt),zt||$t){let Zt=Xt;$t&&(He&&!Bt.transformedSelector&&(Bt.transformedSelector=_t._transformRuleCss(Bt,_t._transformComplexSelector,_t._calcElementScope(Gt),Xt)),Zt=Bt.transformedSelector||Xt),Kt({selector:Zt,isHost:$t,isRoot:zt})}}}hostAndRootPropertiesForScope(Wt,Bt){let jt={},Kt={},Gt=this,Vt=Bt&&Bt.__cssBuild;return ue(Bt,function(Xt){Gt.whenHostOrRootRule(Wt,Xt,Vt,function(Yt){let zt=Wt._element||Wt;gt.call(zt,Yt.selector)&&(Yt.isHost?Gt.collectProperties(Xt,jt):Gt.collectProperties(Xt,Kt))})},null,!0),{rootProps:Kt,hostProps:jt}}transformStyles(Wt,Bt,jt){let Kt=this,{is:Gt,typeExtension:Vt}=Ne(Wt),Xt=_t._calcHostScope(Gt,Vt),Yt=Wt.extends?'\\'+Xt.slice(0,-1)+'\\]':Xt,zt=new RegExp('(?:^|[^.#[:])'+Yt+'($|[.:[\\s>+~])'),$t=mt.get(Wt).styleRules,Zt=this._elementKeyframeTransforms(Wt,$t,jt);return _t.elementStyles(Wt,$t,function(Qt){Kt.applyProperties(Qt,Bt),He||he(Qt)||!Qt.cssText||(Kt.applyKeyframeTransforms(Qt,Zt),Kt._scopeSelector(Qt,zt,Xt,jt))})}_elementKeyframeTransforms(Wt,Bt,jt){let Kt=Bt._keyframes,Gt={};if(!He&&Kt)for(let Vt=0,Xt=Kt[Vt];Vt=Xt._useCount&&Xt.parentNode&&Xt.parentNode.removeChild(Xt)),He?Vt.customStyle?(Vt.customStyle.textContent=Gt,Kt=Vt.customStyle):Gt&&(Kt=_e(Gt,jt,Wt.shadowRoot,Vt.placeholder)):Kt?!Kt.parentNode&&ye(Kt,null,Vt.placeholder):Gt&&(Kt=_e(Gt,jt,null,Vt.placeholder)),Kt&&(Kt._useCount=Kt._useCount||0,Vt.customStyle!=Kt&&Kt._useCount++,Vt.customStyle=Kt),ft&&(Kt.textContent=Kt.textContent),Kt}applyCustomStyle(Wt,Bt){let jt=pe(Wt),Kt=this;Wt.textContent=ie(jt,function(Gt){let Vt=Gt.cssText=Gt.parsedCssText;Gt.propertyInfo&&Gt.propertyInfo.cssText&&(Vt=le(Vt),Gt.cssText=Kt.valueForProperties(Vt,Bt))})}}var Nt=new bt;let Ct={};const Et=window.customElements;if(Et&&!He){const Wt=Et.define;Et.define=(jt,Kt,Gt)=>{return Ct[jt]=ge(jt),Wt.call(Et,jt,Kt,Gt)}}let Pt=function(){};if(!He){let Wt=Vt=>{return Vt.classList&&!Vt.classList.contains(_t.SCOPE_NAME)||Vt instanceof window.SVGElement&&(!Vt.hasAttribute('class')||0>Vt.getAttribute('class').indexOf(_t.SCOPE_NAME))},Bt=Vt=>{for(let Yt,Xt=0;Xt{jt.observe(Vt,{childList:!0,subtree:!0})},Gt=window.customElements&&!window.customElements.flush;if(Gt)Kt(document);else{let Vt=()=>{Kt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Vt):requestAnimationFrame(function(){if('loading'===document.readyState){let Xt=function(){Vt(),document.removeEventListener('readystatechange',Xt)};document.addEventListener('readystatechange',Xt)}else Vt()})}Pt=function(){Bt(jt.takeRecords())}}const Tt={},Rt=Promise.resolve();let At=null,xt=window.HTMLImports&&window.HTMLImports.whenReady||null,It;const Ot='__processedByShadyCSS',Mt='__seenByShadyCSS';let Dt=null,wt=null;class Lt{constructor(){this.customStyles=[],this.enqueued=!1}enqueueDocumentValidation(){this.enqueued||!wt||(this.enqueued=!0,Ae(wt))}addCustomStyle(Wt){Wt[Mt]||(Wt[Mt]=!0,this.customStyles.push(Wt),this.enqueueDocumentValidation())}getStyleForCustomStyle(Wt){let Bt;return Bt=Wt.getStyle?Wt.getStyle():Wt,Bt}processStyles(){let Wt=this.customStyles;for(let jt,Bt=0;Btthis.typeMax&&Gt.shift(),this.cache[Wt]=Gt}fetch(Wt,Bt,jt){let Kt=this.cache[Wt];if(Kt)for(let Vt,Gt=Kt.length-1;0<=Gt;Gt--)if(Vt=Kt[Gt],this._validate(Vt,Bt,jt))return Vt}};class Ft{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement;let Wt=new Ie;Wt.rules=[],this._documentOwnerStyleInfo=mt.set(this._documentOwner,new mt(Wt)),this._elementsHaveApplied=!1,this._applyShim=null,this._customStyleInterface=null,Ae(()=>{this._ensure()})}flush(){Pt()}_generateScopeSelector(Wt){let Bt=this._scopeCounter[Wt]=(this._scopeCounter[Wt]||0)+1;return`${Wt}-${Bt}`}getStyleAst(Wt){return pe(Wt)}styleAstToString(Wt){return ie(Wt)}_gatherStyles(Wt){let Bt=Wt.content.querySelectorAll('style'),jt=[];for(let Gt,Kt=0;Kt{this.transformCustomStyleForDocument(Wt)},this._customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{(this._customStyleInterface.enqueued||this._elementsHaveApplied)&&this.flushCustomStyles()})}):this._customStyleInterface={['processStyles'](){},enqueued:!1,['getStyleForCustomStyle'](){return null}})}_ensure(){this._ensureApplyShim(),this._ensureCustomStyleInterface()}flushCustomStyles(){this._ensure();let Wt=this._customStyleInterface.processStyles();this._customStyleInterface.enqueued&&(Ue?this._revalidateCustomStyleApplyShim(Wt):(this._updateProperties(this._documentOwner,this._documentOwnerStyleInfo),this._applyCustomStyles(Wt)),this._customStyleInterface.enqueued=!1,this._elementsHaveApplied&&!Ue&&this.styleDocument())}styleElement(Wt,Bt){let{is:jt}=Ne(Wt),Kt=mt.get(Wt);if(Kt||(Kt=this._prepareHost(Wt)),this._isRootOwner(Wt)||(this._elementsHaveApplied=!0),Bt&&(Kt.overrideStyleProperties=Kt.overrideStyleProperties||{},Object.assign(Kt.overrideStyleProperties,Bt)),!Ue)this._updateProperties(Wt,Kt),Kt.ownStylePropertyNames&&Kt.ownStylePropertyNames.length&&this._applyStyleProperties(Wt,Kt);else{Kt.overrideStyleProperties&&xe(Wt,Kt.overrideStyleProperties);let Gt=Tt[jt];if(!Gt&&!this._isRootOwner(Wt))return;if(Gt&&Gt._style&&!Pe(Gt)){if(Te(Gt)||(this._ensure(),this._applyShim.transformRules(Gt._styleAst,jt),Gt._style.textContent=_t.elementStyles(Wt,Kt.styleRules),Re(Gt)),He){let Vt=Wt.shadowRoot;if(Vt){let Xt=Vt.querySelector('style');Xt.textContent=_t.elementStyles(Wt,Kt.styleRules)}}Kt.styleRules=Gt._styleAst}}}_styleOwnerForNode(Wt){let Bt=Wt.getRootNode(),jt=Bt.host;return jt?mt.get(jt)?jt:this._styleOwnerForNode(jt):this._documentOwner}_isRootOwner(Wt){return Wt===this._documentOwner}_applyStyleProperties(Wt,Bt){let jt=Ne(Wt).is,Kt=kt.fetch(jt,Bt.styleProperties,Bt.ownStylePropertyNames),Gt=Kt&&Kt.scopeSelector,Vt=Kt?Kt.styleElement:null,Xt=Bt.scopeSelector;Bt.scopeSelector=Gt||this._generateScopeSelector(jt);let Yt=Nt.applyElementStyle(Wt,Bt.styleProperties,Bt.scopeSelector,Vt);return He||Nt.applyElementScopeSelector(Wt,Bt.scopeSelector,Xt),Kt||kt.store(jt,Bt.styleProperties,Yt,Bt.scopeSelector),Yt}_updateProperties(Wt,Bt){let jt=this._styleOwnerForNode(Wt),Kt=mt.get(jt),Gt=Kt.styleProperties,Vt=Object.create(Gt||null),Xt=Nt.hostAndRootPropertiesForScope(Wt,Bt.styleRules),Yt=Nt.propertyDataFromStyles(Kt.styleRules,Wt),zt=Yt.properties;Object.assign(Vt,Xt.hostProps,zt,Xt.rootProps),this._mixinOverrideStyles(Vt,Bt.overrideStyleProperties),Nt.reify(Vt),Bt.styleProperties=Vt}_mixinOverrideStyles(Wt,Bt){for(let jt in Bt){let Kt=Bt[jt];(Kt||0===Kt)&&(Wt[jt]=Kt)}}styleDocument(Wt){this.styleSubtree(this._documentOwner,Wt)}styleSubtree(Wt,Bt){let jt=Wt.shadowRoot;(jt||this._isRootOwner(Wt))&&this.styleElement(Wt,Bt);let Kt=jt&&(jt.children||jt.childNodes);if(Kt)for(let Vt,Gt=0;Gt{He?_t.normalizeRootSelector(jt):_t.documentRule(jt),Ue&&(this._ensure(),this._applyShim.transformRule(jt))}),Ue?Wt.textContent=ie(Bt):this._documentOwnerStyleInfo.styleRules.rules.push(Bt)}_revalidateApplyShim(Wt){if(Ue){let Bt=pe(Wt);this._ensure(),this._applyShim.transformRules(Bt),Wt.textContent=ie(Bt)}}getComputedStyleValue(Wt,Bt){let jt;if(!Ue){let Kt=mt.get(Wt)||mt.get(this._styleOwnerForNode(Wt));jt=Kt.styleProperties[Bt]}return jt=jt||window.getComputedStyle(Wt).getPropertyValue(Bt),jt.trim()}setElementClass(Wt,Bt){let jt=Wt.getRootNode(),Kt=Bt?Bt.split(/\s/):[],Gt=jt.host&&jt.host.localName;if(!Gt){var Vt=Wt.getAttribute('class');if(Vt){let Xt=Vt.split(/\s/);for(let Yt=0;Yt{return ho.nodeType===Node.ELEMENT_NODE&&'link'===ho.localName&&'import'===ho.rel},so=(ho,uo)=>{if(ho.__loaded)uo&&uo();else if('script'===ho.localName&&!ho.src)ho.__loaded=!0,uo&&uo();else{const _o=yo=>{ho.removeEventListener(yo.type,_o),ho.__loaded=!0,uo&&uo()};ho.addEventListener('load',_o),Yt&&'style'===ho.localName||ho.addEventListener('error',_o)}},lo=ho=>{ao(()=>io(()=>ho&&ho()))},ao=ho=>{if('loading'!==document.readyState)ho();else{const uo=()=>{'loading'!==document.readyState&&(document.removeEventListener('readystatechange',uo),ho())};document.addEventListener('readystatechange',uo)}},io=ho=>{let uo=document.querySelectorAll(eo),_o=uo.length;if(!_o)return void ho();for(let go,yo=0,mo=uo.length;yo{0==--_o&&ho()})},po=ho=>{if(qt)return ho.ownerDocument===document?null:ho.ownerDocument;let uo=ho.__importDoc;if(!uo&&ho.parentNode){if(uo=ho.parentNode,'function'==typeof uo.closest)uo=uo.closest(zt);else for(;!no(uo)&&(uo=uo.parentNode););ho.__importDoc=uo}return uo},co=(ho,uo)=>{if('function'==typeof window.CustomEvent)return new CustomEvent(ho,uo);const _o=document.createEvent('CustomEvent');return _o.initCustomEvent(ho,!!uo.bubbles,!!uo.cancelable,uo.detail),_o};if(qt){const ho=document.querySelectorAll(zt);for(let mo,_o=0,yo=ho.length;_o{const yo=_o.target;no(yo)&&(yo.__loaded=!0)};document.addEventListener('load',uo,!0),document.addEventListener('error',uo,!0)}else new class{constructor(){this.documents={},this.inflight=0,this.dynamicImportsMO=new MutationObserver(ho=>this.handleMutations(ho)),ao(()=>{this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.loadImports(document)})}loadImports(ho){const uo=ho.querySelectorAll(zt);for(let _o=0,yo=uo.length;_o{const mo=this.makeDocument(_o,yo||uo);this.documents[uo]=mo,this.inflight--,this.loadImports(mo),this.processImportsIfLoadingDone()},()=>{this.documents[uo]=null,this.inflight--,this.processImportsIfLoadingDone()})}makeDocument(ho,uo){if(!ho)return document.createDocumentFragment();Yt&&(ho=ho.replace(Gt,(So,bo,No)=>{return-1===So.indexOf('type=')?`${bo} type=${$t} ${No}`:So}));let _o;const yo=document.createElement('template');if(yo.innerHTML=ho,yo.content)_o=yo.content;else for(_o=document.createDocumentFragment();yo.firstChild;)_o.appendChild(yo.firstChild);const mo=_o.querySelector('base');mo&&(uo=Vt.replaceAttrUrl(mo.getAttribute('href'),uo),mo.removeAttribute('href'));const go=_o.querySelectorAll(Qt);let fo=0;for(let No,So=0,bo=go.length;So{uo&&ho&&(this.dynamicImportsMO.observe(document.head,{childList:!0,subtree:!0}),this.fireEvents())};this.waitForStyles(()=>{uo=!0,_o()}),this.runScripts(()=>{ho=!0,_o()})}}flatten(ho){const uo=ho.querySelectorAll(zt);for(let mo,_o=0,yo=uo.length;_omo.href,configurable:!0,enumerable:!0}),this.flatten(go),mo.appendChild(go))}}runScripts(ho){const uo=document.querySelectorAll(to),_o=uo.length,yo=mo=>{if(mo<_o){const go=uo[mo],fo=document.createElement('script');go.removeAttribute(Jt);for(let So=0,bo=go.attributes.length;So{Wt=null,yo(mo+1)})}else ho()};yo(0)}waitForStyles(ho){const uo=document.querySelectorAll(oo);let _o=uo.length;if(!_o)return void ho();const yo=Yt&&!!document.querySelector(Zt);for(let fo,mo=0,go=uo.length;mo{fo.removeAttribute(Jt),0==--_o&&ho()}),yo&&fo.parentNode!==document.head){const So=document.createElement(fo.localName);So.__appliedElement=fo,So.setAttribute('type','import-placeholder'),fo.parentNode.insertBefore(So,fo.nextSibling);let bo=po(fo);for(;bo&&po(bo);)bo=po(bo);bo.parentNode!==document.head&&(bo=null),document.head.insertBefore(fo,bo),fo.removeAttribute('type')}}fireEvents(){const ho=document.querySelectorAll(zt);for(let _o,uo=ho.length-1;0<=uo&&(_o=ho[uo]);uo--)this.fireEventIfNeeded(_o)}fireEventIfNeeded(ho){if(!ho.__loaded){ho.__loaded=!0,ho.import&&(ho.import.readyState='complete');const uo=ho.import?'load':'error';ho.dispatchEvent(co(uo,{bubbles:!1,cancelable:!1,detail:void 0}))}}handleMutations(ho){for(let uo=0;uodocument.dispatchEvent(co('HTMLImportsLoaded',{cancelable:!0,bubbles:!0,detail:void 0}))),Ut.useNative=qt,Ut.whenReady=lo,Ut.importForElement=po})(window.HTMLImports=window.HTMLImports||{}),function(){'use strict';function Ut(Ir,Or,Mr){return{index:Ir,removed:Or,addedCount:Mr}}function qt(Ir){return'ShadyRoot'===Ir.__localName}function Wt(Ir,Or){if(Ir&&Or)for(var wr,Mr=Object.getOwnPropertyNames(Or),Dr=0;Dr'===Ir?'>':'"'===Ir?'"':'\xA0'===Ir?' ':void 0}function Gt(Ir){for(var Or={},Mr=0;Mr';case Node.TEXT_NODE:return Ir=Ir.data,Or&&Uo[Or.localName]?Ir:Ir.replace(Fo,Kt);case Node.COMMENT_NODE:return'';default:throw window.console.error(Ir),Error('not implemented');}}function Xt(Ir,Or){'template'===Ir.localName&&(Ir=Ir.content);for(var kr,Mr='',Dr=Or?Or(Ir):Ir.childNodes,wr=0,Lr=Dr.length;wr]/g,Ho=Gt('area base br col command embed hr img input keygen link meta param source track wbr'.split(' ')),Uo=Gt('style script xmp iframe noembed noframes plaintext noscript'.split(' '));Lo.getOuterHTML=Vt,Lo.getInnerHTML=Xt;var qo={},Wo=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),Bo=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1);qo.parentNode=function(Ir){return Wo.currentNode=Ir,Wo.parentNode()},qo.firstChild=function(Ir){return Wo.currentNode=Ir,Wo.firstChild()},qo.lastChild=function(Ir){return Wo.currentNode=Ir,Wo.lastChild()},qo.previousSibling=function(Ir){return Wo.currentNode=Ir,Wo.previousSibling()},qo.nextSibling=function(Ir){return Wo.currentNode=Ir,Wo.nextSibling()},qo.childNodes=Yt,qo.parentElement=function(Ir){return Bo.currentNode=Ir,Bo.parentNode()},qo.firstElementChild=function(Ir){return Bo.currentNode=Ir,Bo.firstChild()},qo.lastElementChild=function(Ir){return Bo.currentNode=Ir,Bo.lastChild()},qo.previousElementSibling=function(Ir){return Bo.currentNode=Ir,Bo.previousSibling()},qo.nextElementSibling=function(Ir){return Bo.currentNode=Ir,Bo.nextSibling()},qo.children=function(Ir){var Or=[];for(Bo.currentNode=Ir,Ir=Bo.firstChild();Ir;)Or.push(Ir),Ir=Bo.nextSibling();return Or},qo.innerHTML=function(Ir){return Lo.getInnerHTML(Ir,function(Or){return Yt(Or)})},qo.textContent=function(Ir){if(Ir.nodeType!==Node.ELEMENT_NODE)return Ir.nodeValue;Ir=document.createTreeWalker(Ir,NodeFilter.SHOW_TEXT,null,!1);for(var Mr,Or='';Mr=Ir.nextNode();)Or+=Mr.nodeValue;return Or};var jo={},Ko=Object.getOwnPropertyDescriptor(Element.prototype,'innerHTML')||Object.getOwnPropertyDescriptor(HTMLElement.prototype,'innerHTML'),Go=document.implementation.createHTMLDocument('inert').createElement('div'),Vo=Object.getOwnPropertyDescriptor(Document.prototype,'activeElement'),Xo={parentElement:zt('parentElement'),parentNode:zt('parentNode'),nextSibling:zt('nextSibling'),previousSibling:zt('previousSibling'),className:{get:function(){return this.getAttribute('class')},set:function(Ir){this.setAttribute('class',Ir)},configurable:!0},nextElementSibling:{get:function(){if(wo.hasProperty(this,'nextSibling')){for(var Ir=this.nextSibling;Ir&&Ir.nodeType!==Node.ELEMENT_NODE;)Ir=Ir.nextSibling;return Ir}return qo.nextElementSibling(this)},configurable:!0},previousElementSibling:{get:function(){if(wo.hasProperty(this,'previousSibling')){for(var Ir=this.previousSibling;Ir&&Ir.nodeType!==Node.ELEMENT_NODE;)Ir=Ir.previousSibling;return Ir}return qo.previousElementSibling(this)},configurable:!0}},Yo={childNodes:{get:function(){if(wo.hasProperty(this,'firstChild')){if(!this.__shady.childNodes){this.__shady.childNodes=[];for(var Ir=this.firstChild;Ir;Ir=Ir.nextSibling)this.__shady.childNodes.push(Ir)}return this.__shady.childNodes}return qo.childNodes(this)},configurable:!0},firstChild:zt('firstChild'),lastChild:zt('lastChild'),textContent:{get:function(){if(wo.hasProperty(this,'firstChild')){for(var Dr,Ir=[],Or=0,Mr=this.childNodes;Dr=Mr[Or];Or++)Dr.nodeType!==Node.COMMENT_NODE&&Ir.push(Dr.textContent);return Ir.join('')}return qo.textContent(this)},set:function(Ir){if(this.nodeType!==Node.ELEMENT_NODE)this.nodeValue=Ir;else{for(;this.firstChild;)this.removeChild(this.firstChild);Ir&&this.appendChild(document.createTextNode(Ir))}},configurable:!0},firstElementChild:{get:function(){if(wo.hasProperty(this,'firstChild')){for(var Ir=this.firstChild;Ir&&Ir.nodeType!==Node.ELEMENT_NODE;)Ir=Ir.nextSibling;return Ir}return qo.firstElementChild(this)},configurable:!0},lastElementChild:{get:function(){if(wo.hasProperty(this,'lastChild')){for(var Ir=this.lastChild;Ir&&Ir.nodeType!==Node.ELEMENT_NODE;)Ir=Ir.previousSibling;return Ir}return qo.lastElementChild(this)},configurable:!0},children:{get:function(){return wo.hasProperty(this,'firstChild')?Array.prototype.filter.call(this.childNodes,function(Ir){return Ir.nodeType===Node.ELEMENT_NODE}):qo.children(this)},configurable:!0},innerHTML:{get:function(){var Ir='template'===this.localName?this.content:this;return wo.hasProperty(this,'firstChild')?Lo.getInnerHTML(Ir):qo.innerHTML(Ir)},set:function(Ir){for(var Or='template'===this.localName?this.content:this;Or.firstChild;)Or.removeChild(Or.firstChild);for(Ko&&Ko.set?Ko.set.call(Go,Ir):Go.innerHTML=Ir;Go.firstChild;)Or.appendChild(Go.firstChild)},configurable:!0}},zo={shadowRoot:{get:function(){return this.shadyRoot},set:function(Ir){this.shadyRoot=Ir},configurable:!0}},$o={activeElement:{get:function(){var Ir;if(Ir=Vo&&Vo.get?Vo.get.call(document):Eo.settings.hasDescriptors?void 0:document.activeElement,Ir){var Or=!!Eo.isShadyRoot(this);if(this===document||Or&&this.host!==Ir&&this.host.contains(Ir)){for(Or=Eo.ownerShadyRootForNode(Ir);Or&&Or!==this;)Ir=Or.host,Or=Eo.ownerShadyRootForNode(Ir);Ir=this===document?Or?null:Ir:Or===this?Ir:null}else Ir=null}else Ir=null;return Ir},set:function(){},configurable:!0}},Zo=Eo.settings.hasDescriptors?function(){}:function(Ir){Ir.__shady&&Ir.__shady.__outsideAccessors||(Ir.__shady=Ir.__shady||{},Ir.__shady.__outsideAccessors=!0,$t(Ir,Xo,!0))},Qo=Eo.settings.hasDescriptors?function(){}:function(Ir){Ir.__shady&&Ir.__shady.__insideAccessors||(Ir.__shady=Ir.__shady||{},Ir.__shady.__insideAccessors=!0,$t(Ir,Yo,!0),$t(Ir,zo,!0))};jo.ShadowRootAccessor=zo,jo.ActiveElementAccessor=$o,jo.patchAccessors=function(Ir){$t(Ir,Xo),$t(Ir,Yo),$t(Ir,$o)},jo.patchShadowRootAccessors=function(Ir){$t(Ir,Yo,!0),$t(Ir,$o,!0)},jo.patchOutsideElementAccessors=Zo,jo.patchInsideElementAccessors=Qo;var Jo={};Jo.recordInsertBefore=function(Ir,Or,Mr){if(jo.patchInsideElementAccessors(Or),Or.__shady=Or.__shady||{},wo.hasProperty(Or,'firstChild')&&(Or.__shady.childNodes=null),Ir.nodeType===Node.DOCUMENT_FRAGMENT_NODE){for(var Dr=Ir.childNodes,wr=0;wr`:${Kt}(${Gt.replace(/\s/g,'')})`),Ut=Ut.replace(nt,`${tt} $1`),Ut=Ut.replace(Je,(jt,Kt,Gt)=>{if(!Bt){let Vt=this._transformCompoundSelector(Gt,Kt,qt,Wt);Bt=Bt||Vt.stop,Kt=Vt.combinator,Gt=Vt.value}return Kt+Gt}),Ut}_transformCompoundSelector(Ut,qt,Wt,Bt){let jt=Ut.indexOf(rt);0<=Ut.indexOf(tt)?Ut=this._transformHostSelector(Ut,Bt):0!==jt&&(Ut=Wt?this._transformSimpleSelector(Ut,Wt):Ut);let Kt=!1;0<=jt&&(qt='',Kt=!0);let Gt;return Kt&&(Gt=!0,Kt&&(Ut=Ut.replace(lt,(Vt,Xt)=>` > ${Xt}`))),Ut=Ut.replace(dt,(Vt,Xt,Yt)=>`[dir="${Yt}"] ${Xt}, ${Xt}[dir="${Yt}"]`),{value:Ut,combinator:qt,stop:Gt}}_transformSimpleSelector(Ut,qt){let Wt=Ut.split(pt);return Wt[0]+=qt,Wt.join(pt)}_transformHostSelector(Ut,qt){let Wt=Ut.match(st),Bt=Wt&&Wt[2].trim()||'';if(Bt){if(!Bt[0].match(et)){let jt=Bt.split(et)[0];return jt===qt?Bt:'should_not_match'}return Ut.replace(st,function(jt,Kt,Gt){return qt+Gt})}return Ut.replace(tt,qt)}documentRule(Ut){Ut.selector=Ut.parsedSelector,this.normalizeRootSelector(Ut),this._transformRule(Ut,this._transformDocumentSelector)}normalizeRootSelector(Ut){Ut.selector===':root'&&(Ut.selector='html')}_transformDocumentSelector(Ut){return Ut.match(rt)?this._transformComplexSelector(Ut,Ze):this._transformSimpleSelector(Ut.trim(),Ze)}}let $e=/:(nth[-\w]+)\(([^)]+)\)/,Ze=`:not(.${Ye})`,Qe=',',Je=/(^|[\s>+~]+)((?:\[.+?\]|[^\s>+~=\[])+)/g,et=/[[.:#*]/,tt=':host',rt='::slotted',nt=/^(::slotted)/,st=/(:host)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,lt=/(?:::slotted)(?:\(((?:\([^)(]*\)|[^)(]*)+?)\))/,dt=/(.*):dir\((?:(ltr|rtl))\)/,pt=':';var ut=new ze;const _t='__styleInfo';class yt{static get(Ut){return Ut?Ut[_t]:null}static set(Ut,qt){return Ut[_t]=qt,qt}constructor(Ut,qt,Wt,Bt,jt,Kt){this.styleRules=Ut||null,this.placeholder=qt||null,this.ownStylePropertyNames=Wt||[],this.overrideStyleProperties=null,this.elementName=Bt||'',this.cssBuild=Kt||'',this.typeExtension=jt||'',this.styleProperties=null,this.scopeSelector=null,this.customStyle=null}_getStyleRules(){return this.styleRules}}yt.prototype._getStyleRules=yt.prototype._getStyleRules;const mt=(Ut=>Ut.matches||Ut.matchesSelector||Ut.mozMatchesSelector||Ut.msMatchesSelector||Ut.oMatchesSelector||Ut.webkitMatchesSelector)(window.Element.prototype),gt=navigator.userAgent.match('Trident'),ft='x-scope';class St{get XSCOPE_NAME(){return ft}decorateStyles(Ut){let qt=this,Wt={},Bt=[],jt=0;he(Ut,function(Gt){qt.decorateRule(Gt),Gt.index=jt++,qt.collectPropertiesInCssText(Gt.propertyInfo.cssText,Wt)},function(Vt){Bt.push(Vt)}),Ut._keyframes=Bt;let Kt=[];for(let Gt in Wt)Kt.push(Gt);return Kt}decorateRule(Ut){if(Ut.propertyInfo)return Ut.propertyInfo;let qt={},Wt={},Bt=this.collectProperties(Ut,Wt);return Bt&&(qt.properties=Wt,Ut.rules=null),qt.cssText=this.collectCssText(Ut),Ut.propertyInfo=qt,qt}collectProperties(Ut,qt){let Wt=Ut.propertyInfo;if(!Wt){let Bt,Kt=Ut.parsedCssText,Gt,Vt;for(;Bt=Ue.exec(Kt);)Gt=(Bt[2]||Bt[3]).trim(),('inherit'!==Gt||'unset'!==Gt)&&(qt[Bt[1].trim()]=Gt),Vt=!0;return Vt}else if(Wt.properties)return Object.assign(qt,Wt.properties),!0}collectCssText(Ut){return this.collectConsumingCssText(Ut.parsedCssText)}collectConsumingCssText(Ut){return Ut.replace(Ke,'').replace(Ue,'')}collectPropertiesInCssText(Ut,qt){for(let Wt,Bt;Wt=We.exec(Ut);)Bt=Wt[1],':'!==Wt[2]&&(qt[Bt]=!0)}reify(Ut){let qt=Object.getOwnPropertyNames(Ut);for(let Bt,Wt=0;Wt *'===Vt||'html'===Vt,Yt=0===Vt.indexOf(':host')&&!Xt;if('shady'===Wt&&(Xt=Vt===Gt+' > *.'+Gt||-1!==Vt.indexOf('html'),Yt=!Xt&&0===Vt.indexOf(Gt)),'shadow'===Wt&&(Xt=':host > *'===Vt||'html'===Vt,Yt=Yt&&!Xt),Xt||Yt){let zt=Gt;Yt&&(Fe&&!qt.transformedSelector&&(qt.transformedSelector=ut._transformRuleCss(qt,ut._transformComplexSelector,ut._calcElementScope(jt),Gt)),zt=qt.transformedSelector||Gt),Bt({selector:zt,isHost:Yt,isRoot:Xt})}}}hostAndRootPropertiesForScope(Ut,qt){let Wt={},Bt={},jt=this,Kt=qt&&qt.__cssBuild;return he(qt,function(Gt){jt.whenHostOrRootRule(Ut,Gt,Kt,function(Vt){let Xt=Ut._element||Ut;mt.call(Xt,Vt.selector)&&(Vt.isHost?jt.collectProperties(Gt,Wt):jt.collectProperties(Gt,Bt))})},null,!0),{rootProps:Bt,hostProps:Wt}}transformStyles(Ut,qt,Wt){let Bt=this,{is:jt,typeExtension:Kt}=be(Ut),Gt=ut._calcHostScope(jt,Kt),Vt=Ut.extends?'\\'+Gt.slice(0,-1)+'\\]':Gt,Xt=new RegExp('(?:^|[^.#[:])'+Vt+'($|[.:[\\s>+~])'),Yt=yt.get(Ut).styleRules,zt=this._elementKeyframeTransforms(Ut,Yt,Wt);return ut.elementStyles(Ut,Yt,function($t){Bt.applyProperties($t,qt),Fe||ce($t)||!$t.cssText||(Bt.applyKeyframeTransforms($t,zt),Bt._scopeSelector($t,Xt,Gt,Wt))})}_elementKeyframeTransforms(Ut,qt,Wt){let Bt=qt._keyframes,jt={};if(!Fe&&Bt)for(let Kt=0,Gt=Bt[Kt];Kt=Gt._useCount&&Gt.parentNode&&Gt.parentNode.removeChild(Gt)),Fe?Kt.customStyle?(Kt.customStyle.textContent=jt,Bt=Kt.customStyle):jt&&(Bt=ue(jt,Wt,Ut.shadowRoot,Kt.placeholder)):Bt?!Bt.parentNode&&me(Bt,null,Kt.placeholder):jt&&(Bt=ue(jt,Wt,null,Kt.placeholder)),Bt&&(Bt._useCount=Bt._useCount||0,Kt.customStyle!=Bt&&Bt._useCount++,Kt.customStyle=Bt),gt&&(Bt.textContent=Bt.textContent),Bt}applyCustomStyle(Ut,qt){let Wt=pe(Ut),Bt=this;Ut.textContent=ie(Wt,function(jt){let Kt=jt.cssText=jt.parsedCssText;jt.propertyInfo&&jt.propertyInfo.cssText&&(Kt=le(Kt),jt.cssText=Bt.valueForProperties(Kt,qt))})}}var bt=new St;let Ct=function(){};if(!Fe){let Ut=Kt=>{return Kt.classList&&!Kt.classList.contains(ut.SCOPE_NAME)||Kt instanceof window.SVGElement&&(!Kt.hasAttribute('class')||0>Kt.getAttribute('class').indexOf(ut.SCOPE_NAME))},qt=Kt=>{for(let Vt,Gt=0;Gt{Wt.observe(Kt,{childList:!0,subtree:!0})},jt=window.customElements&&!window.customElements.flush;if(jt)Bt(document);else{let Kt=()=>{Bt(document.body)};window.HTMLImports?window.HTMLImports.whenReady(Kt):requestAnimationFrame(function(){if('loading'===document.readyState){let Gt=function(){Kt(),document.removeEventListener('readystatechange',Gt)};document.addEventListener('readystatechange',Gt)}else Kt()})}Ct=function(){qt(Wt.takeRecords())}}const Et={},vt=Promise.resolve();let Pt=null,Tt=window.HTMLImports&&window.HTMLImports.whenReady||null,Rt;const At='__processedByShadyCSS',xt='__seenByShadyCSS';let It=null,Ot=null;class Mt{constructor(){this.customStyles=[],this.enqueued=!1}enqueueDocumentValidation(){this.enqueued||!Ot||(this.enqueued=!0,Re(Ot))}addCustomStyle(Ut){Ut[xt]||(Ut[xt]=!0,this.customStyles.push(Ut),this.enqueueDocumentValidation())}getStyleForCustomStyle(Ut){let qt;return qt=Ut.getStyle?Ut.getStyle():Ut,qt}processStyles(){let Ut=this.customStyles;for(let Wt,qt=0;qtthis.typeMax&&jt.shift(),this.cache[Ut]=jt}fetch(Ut,qt,Wt){let Bt=this.cache[Ut];if(Bt)for(let Kt,jt=Bt.length-1;0<=jt;jt--)if(Kt=Bt[jt],this._validate(Kt,qt,Wt))return Kt}},wt={};class Lt{constructor(){this._scopeCounter={},this._documentOwner=document.documentElement;let Ut=new xe;Ut.rules=[],this._documentOwnerStyleInfo=yt.set(this._documentOwner,new yt(Ut)),this._elementsHaveApplied=!1,this._applyShim=null,this._customStyleInterface=null,Re(()=>{this._ensure()})}flush(){Ct()}_generateScopeSelector(Ut){let qt=this._scopeCounter[Ut]=(this._scopeCounter[Ut]||0)+1;return`${Ut}-${qt}`}getStyleAst(Ut){return pe(Ut)}styleAstToString(Ut){return ie(Ut)}_gatherStyles(Ut){let qt=Ut.content.querySelectorAll('style'),Wt=[];for(let jt,Bt=0;Bt{this.transformCustomStyleForDocument(Ut)},this._customStyleInterface.validateCallback=()=>{requestAnimationFrame(()=>{(this._customStyleInterface.enqueued||this._elementsHaveApplied)&&this.flushCustomStyles()})}):this._customStyleInterface={['processStyles'](){},enqueued:!1,['getStyleForCustomStyle'](){return null}})}_ensure(){this._ensureApplyShim(),this._ensureCustomStyleInterface()}flushCustomStyles(){this._ensure();let Ut=this._customStyleInterface.processStyles();this._customStyleInterface.enqueued&&(He?this._revalidateCustomStyleApplyShim(Ut):(this._updateProperties(this._documentOwner,this._documentOwnerStyleInfo),this._applyCustomStyles(Ut)),this._customStyleInterface.enqueued=!1,this._elementsHaveApplied&&!He&&this.styleDocument())}styleElement(Ut,qt){let{is:Wt}=be(Ut),Bt=yt.get(Ut);if(Bt||(Bt=this._prepareHost(Ut)),this._isRootOwner(Ut)||(this._elementsHaveApplied=!0),qt&&(Bt.overrideStyleProperties=Bt.overrideStyleProperties||{},Object.assign(Bt.overrideStyleProperties,qt)),!He)this._updateProperties(Ut,Bt),Bt.ownStylePropertyNames&&Bt.ownStylePropertyNames.length&&this._applyStyleProperties(Ut,Bt);else{Bt.overrideStyleProperties&&Ae(Ut,Bt.overrideStyleProperties);let jt=Et[Wt];if(!jt&&!this._isRootOwner(Ut))return;if(jt&&jt._style&&!ve(jt)){if(Pe(jt)||(this._ensure(),this._applyShim.transformRules(jt._styleAst,Wt),jt._style.textContent=ut.elementStyles(Ut,Bt.styleRules),Te(jt)),Fe){let Kt=Ut.shadowRoot;if(Kt){let Gt=Kt.querySelector('style');Gt.textContent=ut.elementStyles(Ut,Bt.styleRules)}}Bt.styleRules=jt._styleAst}}}_styleOwnerForNode(Ut){let qt=Ut.getRootNode(),Wt=qt.host;return Wt?yt.get(Wt)?Wt:this._styleOwnerForNode(Wt):this._documentOwner}_isRootOwner(Ut){return Ut===this._documentOwner}_applyStyleProperties(Ut,qt){let Wt=be(Ut).is,Bt=Dt.fetch(Wt,qt.styleProperties,qt.ownStylePropertyNames),jt=Bt&&Bt.scopeSelector,Kt=Bt?Bt.styleElement:null,Gt=qt.scopeSelector;qt.scopeSelector=jt||this._generateScopeSelector(Wt);let Vt=bt.applyElementStyle(Ut,qt.styleProperties,qt.scopeSelector,Kt);return Fe||bt.applyElementScopeSelector(Ut,qt.scopeSelector,Gt),Bt||Dt.store(Wt,qt.styleProperties,Vt,qt.scopeSelector),Vt}_updateProperties(Ut,qt){let Wt=this._styleOwnerForNode(Ut),Bt=yt.get(Wt),jt=Bt.styleProperties,Kt=Object.create(jt||null),Gt=bt.hostAndRootPropertiesForScope(Ut,qt.styleRules),Vt=bt.propertyDataFromStyles(Bt.styleRules,Ut),Xt=Vt.properties;Object.assign(Kt,Gt.hostProps,Xt,Gt.rootProps),this._mixinOverrideStyles(Kt,qt.overrideStyleProperties),bt.reify(Kt),qt.styleProperties=Kt}_mixinOverrideStyles(Ut,qt){for(let Wt in qt){let Bt=qt[Wt];(Bt||0===Bt)&&(Ut[Wt]=Bt)}}styleDocument(Ut){this.styleSubtree(this._documentOwner,Ut)}styleSubtree(Ut,qt){let Wt=Ut.shadowRoot;(Wt||this._isRootOwner(Ut))&&this.styleElement(Ut,qt);let Bt=Wt&&(Wt.children||Wt.childNodes);if(Bt)for(let Kt,jt=0;jt{Fe?ut.normalizeRootSelector(Wt):ut.documentRule(Wt),He&&(this._ensure(),this._applyShim.transformRule(Wt))}),He?Ut.textContent=ie(qt):this._documentOwnerStyleInfo.styleRules.rules.push(qt)}_revalidateApplyShim(Ut){if(He){let qt=pe(Ut);this._ensure(),this._applyShim.transformRules(qt),Ut.textContent=ie(qt)}}getComputedStyleValue(Ut,qt){let Wt;if(!He){let Bt=yt.get(Ut)||yt.get(this._styleOwnerForNode(Ut));Wt=Bt.styleProperties[qt]}return Wt=Wt||window.getComputedStyle(Ut).getPropertyValue(qt),Wt.trim()}setElementClass(Ut,qt){let Wt=Ut.getRootNode(),Bt=qt?qt.split(/\s/):[],jt=Wt.host&&Wt.host.localName;if(!jt){var Kt=Ut.getAttribute('class');if(Kt){let Gt=Kt.split(/\s/);for(let Vt=0;Vt {\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 //