-
Notifications
You must be signed in to change notification settings - Fork 5
/
loader.min.js
1 lines (1 loc) · 912 Bytes
/
loader.min.js
1
LIB.ready((function(){function e(){const e=document.querySelectorAll('script[type="text/script"],script[type="text/module"]'),t=e.length;let n=0;for(;n<t;n++)setTimeout(function(e,t){return function(){const n=e.parentElement;t.text=e.text,"text/module"==e.type&&(t.type="module");try{n.insertBefore(t,e),n.removeChild(e)}catch(e){console.error(e)}}}(e[n],document.createElement("script")),0);const o=document.querySelector("template[data-type=module]");o&&setTimeout((function(){o.parentElement.insertBefore(o.content,o),o.remove()}),0)}const t=document.querySelectorAll("link[data-media]"),n=t.length;let o,r=0;for(;r<n;r++)o=t[r],o.hasAttribute("data-media")?(o.media=o.dataset.media,o.removeAttribute("data-media")):o.removeAttribute("media");const c=document.querySelectorAll("script[data-async]");let l=c.length;if(0===l)e();else for(r=0;r<l;r++)c[r].addEventListener("load",(function(){l--,0==l&&e()}))}));