mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
7 lines
24 KiB
JavaScript
7 lines
24 KiB
JavaScript
(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=/(<link[^>]*)(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)},fixUrlsInTemplates(Ta,Ua){const Va=Ta.querySelectorAll('template');for(let Wa=0;Wa<Va.length;Wa++)Aa.fixUrlsInTemplate(Va[Wa],Ua)},fixUrlsInTemplate(Ta,Ua){const Va=Ta.content||Ta,Wa=Va.querySelectorAll('style, [src], [style]');for(let Xa=0;Xa<Wa.length;Xa++){const Ya=Wa[Xa];'style'==Ya.localName?Aa.resolveUrlsInStyle(Ya,Ua):Aa.fixUrlAttributes(Ya,Ua)}Aa.fixUrlsInTemplates(Va,Ua)},fixUrlAttributes(Ta,Ua){const Va=['src','style'];for(let Xa,Wa=0;Wa<Va.length&&(Xa=Va[Wa]);Wa++){const Ya=Ta.attributes[Xa],Za=Ya&&Ya.value;Za&&0>Za.search(/({{|\[\[)/)&&(Ya.value='style'===Xa?Aa.resolveUrlsInCssText(Za,Ua):Aa.replaceAttrUrl(Za,Ua))}},resolveUrlsInStyle(Ta,Ua){Ta.textContent=Aa.resolveUrlsInCssText(Ta.textContent,Ua)},resolveUrlsInCssText(Ta,Ua){let Va=Aa.replaceUrls(Ta,Ua,xa);return Va=Aa.replaceUrls(Va,Ua,ya),Va},replaceUrls(Ta,Ua,Va){return Ta.replace(Va,(Wa,Xa,Ya,Za)=>{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<Xa.indexOf(';base64')?atob(Ya):decodeURIComponent(Ya),Ua(Ya)}else{const Wa=new XMLHttpRequest;Wa.open('GET',Ta,Ba.async),Wa.onload=()=>{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"]`,Ha='import-dependency',Ia=`${Da}:not(${Ha})`,Ja=`script[${Ha}]`,Ka=`style[${Ha}],
|
|
link[rel=stylesheet][${Ha}]`;const Ma=Ta=>{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<Xa&&(Ya=Ua[Wa]);Wa++)Na(Ya,()=>{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<Wa&&(Xa=Ta[Va]);Va++)Xa.import&&'loading'===Xa.import.readyState||(Xa.__loaded=!0);const Ua=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<Wa;Va++)this.loadImport(Ua[Va])}loadImport(Ta){const Ua=Ta.href;if(void 0!==this.documents[Ua]){const Va=this.documents[Ua];return void(Va&&Va.__loaded&&(Ta.import=Va,this.fireEventIfNeeded(Ta)))}this.inflight++,this.documents[Ua]='pending',Ba.load(Ua,(Va,Wa)=>{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;Va<Wa&&(Xa=Ua[Va]);Va++){const Ya=this.documents[Xa.href];Xa.import=Ya,Ya&&Ya.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(this.documents[Xa.href]=Xa,Xa.readyState='loading',Xa.import=Xa,Object.defineProperty(Xa,'baseURI',{get:()=>Xa.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<Va){const Ya=Ua[Xa],Za=document.createElement('script');Ya.removeAttribute(Ha);for(let $a=0,_a=Ya.attributes.length;$a<_a;$a++)Za.setAttribute(Ya.attributes[$a].name,Ya.attributes[$a].value);_=Za,Ya.parentNode.replaceChild(Za,Ya),Na(Za,()=>{_=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<Ya&&(Za=Ua[Xa]);Xa++)if(Na(Za,()=>{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;Ua<Ta.length;Ua++){const Va=Ta[Ua];if(Va.addedNodes)for(let Wa=0;Wa<Va.addedNodes.length;Wa++){const Xa=Va.addedNodes[Wa];Xa&&Xa.nodeType===Node.ELEMENT_NODE&&(Ma(Xa)?this.loadImport(Xa):this.loadImports(Xa))}}}};Oa(()=>document.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<zb.c.length;Bb++)zb.c[Bb](Ab)}}function Da(zb,Ab){var Bb=[];for(wa(Ab,function(Db){return Bb.push(Db)}),Ab=0;Ab<Bb.length;Ab++){var Cb=Bb[Ab];1===Cb.__CE_state?zb.connectedCallback(Cb):Ga(zb,Cb)}}function Ea(zb,Ab){var Bb=[];for(wa(Ab,function(Db){return Bb.push(Db)}),Ab=0;Ab<Bb.length;Ab++){var Cb=Bb[Ab];1===Cb.__CE_state&&zb.disconnectedCallback(Cb)}}function Fa(zb,Ab,Bb){Bb=Bb?Bb:new Set;var Cb=[];if(wa(Ab,function(Db){if('link'===Db.localName&&'import'===Db.getAttribute('rel')){var Eb=Db.import;Eb instanceof Node&&'complete'===Eb.readyState?(Eb.__CE_isImportDocument=!0,Eb.__CE_hasRegistry=!0):Db.addEventListener('load',function(){var Fb=Db.import;Fb.__CE_documentLoadHandled||(Fb.__CE_documentLoadHandled=!0,Fb.__CE_isImportDocument=!0,Fb.__CE_hasRegistry=!0,new Set(Bb),Bb.delete(Fb),Fa(zb,Fb,Bb))})}else Cb.push(Db)},Bb),zb.b)for(Ab=0;Ab<Cb.length;Ab++)Ca(zb,Cb[Ab]);for(Ab=0;Ab<Cb.length;Ab++)Ga(zb,Cb[Ab])}function Ga(zb,Ab){if(void 0===Ab.__CE_state){var Bb=zb.a.get(Ab.localName);if(Bb){Bb.constructionStack.push(Ab);var Cb=Bb.constructor;try{try{if(new Cb!==Ab)throw Error('The custom element constructor did not produce the element being upgraded.')}finally{Bb.constructionStack.pop()}}catch(Fb){throw Ab.__CE_state=2,Fb}if(Ab.__CE_state=1,Ab.__CE_definition=Bb,Bb.attributeChangedCallback)for(Bb=Bb.observedAttributes,Cb=0;Cb<Bb.length;Cb++){var Db=Bb[Cb],Eb=Ab.getAttribute(Db);null!==Eb&&zb.attributeChangedCallback(Ab,Db,null,Eb,null)}$(Ab)&&zb.connectedCallback(Ab)}}}function Ha(zb,Ab){this.c=zb,this.a=Ab,this.b=void 0,Fa(this.c,this.a),'loading'===this.a.readyState&&(this.b=new MutationObserver(this.f.bind(this)),this.b.observe(this.a,{childList:!0,subtree:!0}))}function Ia(zb){zb.b&&zb.b.disconnect()}function Ja(){var zb=this;this.b=this.a=void 0,this.c=new Promise(function(Ab){zb.b=Ab,zb.a&&Ab(zb.a)})}function Ka(zb){if(zb.a)throw Error('Already resolved.');zb.a=void 0,zb.b&&zb.b(void 0)}function La(zb){this.f=!1,this.a=zb,this.h=new Map,this.g=function(Ab){return Ab()},this.b=!1,this.c=[],this.j=new Ha(zb,document)}function Ma(){var zb=xb;window.HTMLElement=function(){function Ab(){var Bb=this.constructor,Cb=zb.f.get(Bb);if(!Cb)throw Error('The custom element being constructed was not registered with `customElements`.');var Db=Cb.constructionStack;if(!Db.length)return Db=Ua.call(document,Cb.localName),Object.setPrototypeOf(Db,Bb.prototype),Db.__CE_state=1,Db.__CE_definition=Cb,Ca(zb,Db),Db;var Cb=Db.length-1,Eb=Db[Cb];if(Eb===Sa)throw Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.');return Db[Cb]=Sa,Object.setPrototypeOf(Eb,Bb.prototype),Ca(zb,Eb),Eb}return Ab.prototype=tb.prototype,Ab}()}function Na(zb,Ab,Bb){Ab.prepend=function(){for(var Db=[],Eb=0;Eb<arguments.length;++Eb)Db[Eb-0]=arguments[Eb];Eb=Db.filter(function(Gb){return Gb instanceof Node&&$(Gb)}),Bb.i.apply(this,Db);for(var Fb=0;Fb<Eb.length;Fb++)Ea(zb,Eb[Fb]);if($(this))for(Eb=0;Eb<Db.length;Eb++)Fb=Db[Eb],Fb instanceof Element&&Da(zb,Fb)},Ab.append=function(){for(var Db=[],Eb=0;Eb<arguments.length;++Eb)Db[Eb-0]=arguments[Eb];Eb=Db.filter(function(Gb){return Gb instanceof Node&&$(Gb)}),Bb.append.apply(this,Db);for(var Fb=0;Fb<Eb.length;Fb++)Ea(zb,Eb[Fb]);if($(this))for(Eb=0;Eb<Db.length;Eb++)Fb=Db[Eb],Fb instanceof Element&&Da(zb,Fb)}}function Oa(){var zb=xb;xa(Document.prototype,'createElement',function(Ab){if(this.__CE_hasRegistry){var Bb=zb.a.get(Ab);if(Bb)return new Bb.constructor}return Ab=Ua.call(this,Ab),Ca(zb,Ab),Ab}),xa(Document.prototype,'importNode',function(Ab,Bb){return Ab=Wa.call(this,Ab,Bb),this.__CE_hasRegistry?Fa(zb,Ab):Ba(zb,Ab),Ab}),xa(Document.prototype,'createElementNS',function(Ab,Bb){if(this.__CE_hasRegistry&&(null===Ab||'http://www.w3.org/1999/xhtml'===Ab)){var Cb=zb.a.get(Bb);if(Cb)return new Cb.constructor}return Ab=Va.call(this,Ab,Bb),Ca(zb,Ab),Ab}),Na(zb,Document.prototype,{i:Xa,append:Ya})}function Pa(){function zb(Bb,Cb){Object.defineProperty(Bb,'textContent',{enumerable:Cb.enumerable,configurable:!0,get:Cb.get,set:function(Db){if(this.nodeType===Node.TEXT_NODE)Cb.set.call(this,Db);else{var Eb;if(this.firstChild){var Fb=this.childNodes,Gb=Fb.length;if(0<Gb&&$(this))for(var Eb=Array(Gb),Hb=0;Hb<Gb;Hb++)Eb[Hb]=Fb[Hb]}if(Cb.set.call(this,Db),Eb)for(Db=0;Db<Eb.length;Db++)Ea(Ab,Eb[Db])}}})}var Ab=xb;xa(Node.prototype,'insertBefore',function(Bb,Cb){if(Bb instanceof DocumentFragment){var Db=Array.prototype.slice.apply(Bb.childNodes);if(Bb=_a.call(this,Bb,Cb),$(this))for(Cb=0;Cb<Db.length;Cb++)Da(Ab,Db[Cb]);return Bb}return Db=$(Bb),Cb=_a.call(this,Bb,Cb),Db&&Ea(Ab,Bb),$(this)&&Da(Ab,Bb),Cb}),xa(Node.prototype,'appendChild',function(Bb){if(Bb instanceof DocumentFragment){var Cb=Array.prototype.slice.apply(Bb.childNodes);if(Bb=$a.call(this,Bb),$(this))for(var Db=0;Db<Cb.length;Db++)Da(Ab,Cb[Db]);return Bb}return Cb=$(Bb),Db=$a.call(this,Bb),Cb&&Ea(Ab,Bb),$(this)&&Da(Ab,Bb),Db}),xa(Node.prototype,'cloneNode',function(Bb){return Bb=Za.call(this,Bb),this.ownerDocument.__CE_hasRegistry?Fa(Ab,Bb):Ba(Ab,Bb),Bb}),xa(Node.prototype,'removeChild',function(Bb){var Cb=$(Bb),Db=ab.call(this,Bb);return Cb&&Ea(Ab,Bb),Db}),xa(Node.prototype,'replaceChild',function(Bb,Cb){if(Bb instanceof DocumentFragment){var Db=Array.prototype.slice.apply(Bb.childNodes);if(Bb=bb.call(this,Bb,Cb),$(this))for(Ea(Ab,Cb),Cb=0;Cb<Db.length;Cb++)Da(Ab,Db[Cb]);return Bb}var Db=$(Bb),Eb=bb.call(this,Bb,Cb),Fb=$(this);return Fb&&Ea(Ab,Cb),Db&&Ea(Ab,Bb),Fb&&Da(Ab,Bb),Eb}),db&&db.get?zb(Node.prototype,db):Aa(Ab,function(Bb){zb(Bb,{enumerable:!0,configurable:!0,get:function(){for(var Cb=[],Db=0;Db<this.childNodes.length;Db++)Cb.push(this.childNodes[Db].textContent);return Cb.join('')},set:function(Cb){for(;this.firstChild;)ab.call(this,this.firstChild);$a.call(this,document.createTextNode(Cb))}})})}function Qa(zb){var Ab=Element.prototype;Ab.before=function(){for(var Cb=[],Db=0;Db<arguments.length;++Db)Cb[Db-0]=arguments[Db];Db=Cb.filter(function(Fb){return Fb instanceof Node&&$(Fb)}),pb.apply(this,Cb);for(var Eb=0;Eb<Db.length;Eb++)Ea(zb,Db[Eb]);if($(this))for(Db=0;Db<Cb.length;Db++)Eb=Cb[Db],Eb instanceof Element&&Da(zb,Eb)},Ab.after=function(){for(var Cb=[],Db=0;Db<arguments.length;++Db)Cb[Db-0]=arguments[Db];Db=Cb.filter(function(Fb){return Fb instanceof Node&&$(Fb)}),qb.apply(this,Cb);for(var Eb=0;Eb<Db.length;Eb++)Ea(zb,Db[Eb]);if($(this))for(Db=0;Db<Cb.length;Db++)Eb=Cb[Db],Eb instanceof Element&&Da(zb,Eb)},Ab.replaceWith=function(){for(var Cb=[],Db=0;Db<arguments.length;++Db)Cb[Db-0]=arguments[Db];var Db=Cb.filter(function(Gb){return Gb instanceof Node&&$(Gb)}),Eb=$(this);rb.apply(this,Cb);for(var Fb=0;Fb<Db.length;Fb++)Ea(zb,Db[Fb]);if(Eb)for(Ea(zb,this),Db=0;Db<Cb.length;Db++)Eb=Cb[Db],Eb instanceof Element&&Da(zb,Eb)},Ab.remove=function(){var Bb=$(this);sb.call(this),Bb&&Ea(zb,this)}}function Ra(){function zb(Db,Eb){Object.defineProperty(Db,'innerHTML',{enumerable:Eb.enumerable,configurable:!0,get:Eb.get,set:function(Fb){var Hb,Gb=this;if($(this)&&(Hb=[],wa(this,function(Kb){Kb!==Gb&&Hb.push(Kb)})),Eb.set.call(this,Fb),Hb)for(var Jb,Ib=0;Ib<Hb.length;Ib++)Jb=Hb[Ib],1===Jb.__CE_state&&Bb.disconnectedCallback(Jb);return this.ownerDocument.__CE_hasRegistry?Fa(Bb,this):Ba(Bb,this),Fb}})}function Ab(Db,Eb){xa(Db,'insertAdjacentElement',function(Fb,Gb){var Hb=$(Gb);return Fb=Eb.call(this,Fb,Gb),Hb&&Ea(Bb,Gb),$(Fb)&&Da(Bb,Gb),Fb})}var Bb=xb;if(eb?xa(Element.prototype,'attachShadow',function(Db){return this.__CE_shadowRoot=Db=eb.call(this,Db)}):console.warn('Custom Elements: `Element#attachShadow` was not patched.'),fb&&fb.get)zb(Element.prototype,fb);else if(ub&&ub.get)zb(HTMLElement.prototype,ub);else{var Cb=Ua.call(document,'div');Aa(Bb,function(Db){zb(Db,{enumerable:!0,configurable:!0,get:function(){return Za.call(this,!0).innerHTML},set:function(Eb){var Fb='template'===this.localName?this.content:this;for(Cb.innerHTML=Eb;0<Fb.childNodes.length;)ab.call(Fb,Fb.childNodes[0]);for(;0<Cb.childNodes.length;)$a.call(Fb,Cb.childNodes[0])}})})}xa(Element.prototype,'setAttribute',function(Db,Eb){if(1!==this.__CE_state)return hb.call(this,Db,Eb);var Fb=gb.call(this,Db);hb.call(this,Db,Eb),Eb=gb.call(this,Db),Fb!==Eb&&Bb.attributeChangedCallback(this,Db,Fb,Eb,null)}),xa(Element.prototype,'setAttributeNS',function(Db,Eb,Fb){if(1!==this.__CE_state)return kb.call(this,Db,Eb,Fb);var Gb=jb.call(this,Db,Eb);kb.call(this,Db,Eb,Fb),Fb=jb.call(this,Db,Eb),Gb!==Fb&&Bb.attributeChangedCallback(this,Eb,Gb,Fb,Db)}),xa(Element.prototype,'removeAttribute',function(Db){if(1!==this.__CE_state)return ib.call(this,Db);var Eb=gb.call(this,Db);ib.call(this,Db),null!==Eb&&Bb.attributeChangedCallback(this,Db,Eb,null,null)}),xa(Element.prototype,'removeAttributeNS',function(Db,Eb){if(1!==this.__CE_state)return lb.call(this,Db,Eb);var Fb=jb.call(this,Db,Eb);lb.call(this,Db,Eb);var Gb=jb.call(this,Db,Eb);Fb!==Gb&&Bb.attributeChangedCallback(this,Eb,Fb,Gb,Db)}),vb?Ab(HTMLElement.prototype,vb):mb?Ab(Element.prototype,mb):console.warn('Custom Elements: `Element#insertAdjacentElement` was not patched.'),Na(Bb,Element.prototype,{i:nb,append:ob}),Qa(Bb)}var Sa=new function(){},Ta=new Set('annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph'.split(' '));ya.prototype.connectedCallback=function(zb){var Ab=zb.__CE_definition;Ab.connectedCallback&&Ab.connectedCallback.call(zb)},ya.prototype.disconnectedCallback=function(zb){var Ab=zb.__CE_definition;Ab.disconnectedCallback&&Ab.disconnectedCallback.call(zb)},ya.prototype.attributeChangedCallback=function(zb,Ab,Bb,Cb,Db){var Eb=zb.__CE_definition;Eb.attributeChangedCallback&&-1<Eb.observedAttributes.indexOf(Ab)&&Eb.attributeChangedCallback.call(zb,Ab,Bb,Cb,Db)},Ha.prototype.f=function(zb){var Ab=this.a.readyState;for('interactive'!==Ab&&'complete'!==Ab||Ia(this),Ab=0;Ab<zb.length;Ab++)for(var Bb=zb[Ab].addedNodes,Cb=0;Cb<Bb.length;Cb++)Fa(this.c,Bb[Cb])},La.prototype.l=function(zb,Ab){var Bb=this;if(!(Ab instanceof Function))throw new TypeError('Custom element constructors must be functions.');if(!o(zb))throw new SyntaxError('The element name \''+zb+'\' is not valid.');if(this.a.a.get(zb))throw Error('A custom element with name \''+zb+'\' has already been defined.');if(this.f)throw Error('A custom element is already being defined.');this.f=!0;var Cb,Db,Eb,Fb,Gb;try{var Hb=function(Jb){var Kb=Ib[Jb];if(void 0!==Kb&&!(Kb instanceof Function))throw Error('The \''+Jb+'\' callback must be a function.');return Kb},Ib=Ab.prototype;if(!(Ib instanceof Object))throw new TypeError('The custom element constructor\'s prototype is not an object.');Cb=Hb('connectedCallback'),Db=Hb('disconnectedCallback'),Eb=Hb('adoptedCallback'),Fb=Hb('attributeChangedCallback'),Gb=Ab.observedAttributes||[]}catch(Jb){return}finally{this.f=!1}za(this.a,zb,{localName:zb,constructor:Ab,connectedCallback:Cb,disconnectedCallback:Db,adoptedCallback:Eb,attributeChangedCallback:Fb,observedAttributes:Gb,constructionStack:[]}),this.c.push(zb),this.b||(this.b=!0,this.g(function(){if(!1!==Bb.b)for(Bb.b=!1,Fa(Bb.a,document);0<Bb.c.length;){var Jb=Bb.c.shift();(Jb=Bb.h.get(Jb))&&Ka(Jb)}}))},La.prototype.get=function(zb){if(zb=this.a.a.get(zb))return zb.constructor},La.prototype.o=function(zb){if(!o(zb))return Promise.reject(new SyntaxError('\''+zb+'\' is not a valid custom element name.'));var Ab=this.h.get(zb);return Ab?Ab.c:(Ab=new Ja,this.h.set(zb,Ab),this.a.a.get(zb)&&-1===this.c.indexOf(zb)&&Ka(Ab),Ab.c)},La.prototype.m=function(zb){Ia(this.j);var Ab=this.g;this.g=function(Bb){return zb(function(){return Ab(Bb)})}},window.CustomElementRegistry=La,La.prototype.define=La.prototype.l,La.prototype.get=La.prototype.get,La.prototype.whenDefined=La.prototype.o,La.prototype.polyfillWrapFlushCallback=La.prototype.m;var Ua=window.Document.prototype.createElement,Va=window.Document.prototype.createElementNS,Wa=window.Document.prototype.importNode,Xa=window.Document.prototype.prepend,Ya=window.Document.prototype.append,Za=window.Node.prototype.cloneNode,$a=window.Node.prototype.appendChild,_a=window.Node.prototype.insertBefore,ab=window.Node.prototype.removeChild,bb=window.Node.prototype.replaceChild,db=Object.getOwnPropertyDescriptor(window.Node.prototype,'textContent'),eb=window.Element.prototype.attachShadow,fb=Object.getOwnPropertyDescriptor(window.Element.prototype,'innerHTML'),gb=window.Element.prototype.getAttribute,hb=window.Element.prototype.setAttribute,ib=window.Element.prototype.removeAttribute,jb=window.Element.prototype.getAttributeNS,kb=window.Element.prototype.setAttributeNS,lb=window.Element.prototype.removeAttributeNS,mb=window.Element.prototype.insertAdjacentElement,nb=window.Element.prototype.prepend,ob=window.Element.prototype.append,pb=window.Element.prototype.before,qb=window.Element.prototype.after,rb=window.Element.prototype.replaceWith,sb=window.Element.prototype.remove,tb=window.HTMLElement,ub=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,'innerHTML'),vb=window.HTMLElement.prototype.insertAdjacentElement,wb=window.customElements;if(!wb||wb.forcePolyfill||'function'!=typeof wb.define||'function'!=typeof wb.get){var xb=new ya;Ma(),Oa(),Pa(),Ra(),document.__CE_hasRegistry=!0;var yb=new La(xb);Object.defineProperty(window,'customElements',{configurable:!0,enumerable:!0,value:yb})}}.call(self),function(){'use strict';if(customElements&&customElements.polyfillWrapFlushCallback){function $(){if(_){let xa=_;return _=null,xa(),!0}}let _,wa=HTMLImports.whenReady;customElements.polyfillWrapFlushCallback(function(xa){_=xa,wa($)}),HTMLImports.whenReady=function(xa){wa(function(){$()?HTMLImports.whenReady(xa):xa()})}}HTMLImports.whenReady(function(){requestAnimationFrame(function(){window.dispatchEvent(new CustomEvent('WebComponentsReady'))})})}(window.WebComponents),function(){var $=document.createElement('style');$.textContent='body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n';var _=document.querySelector('head');_.insertBefore($,_.firstChild)}(window.WebComponents)})();
|
|
//# sourceMappingURL=webcomponents-hi-ce.js.map
|