UNPKG

iobroker.backitup

Version:

ioBroker.backitup allows you to backup and restore your ioBroker installation and other systems, such as databases, Zigbee, scripts and many more.

2 lines (1 loc) 1.26 kB
const y="modulepreload",w=function(u,c){return new URL(u,c).href},v={},P=function(c,a,f){let d=Promise.resolve();if(a&&a.length>0){let E=function(t){return Promise.all(t.map(o=>Promise.resolve(o).then(s=>({status:"fulfilled",value:s}),s=>({status:"rejected",reason:s}))))};const r=document.getElementsByTagName("link"),e=document.querySelector("meta[property=csp-nonce]"),m=(e==null?void 0:e.nonce)||(e==null?void 0:e.getAttribute("nonce"));d=E(a.map(t=>{if(t=w(t,f),t in v)return;v[t]=!0;const o=t.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(f)for(let l=r.length-1;l>=0;l--){const i=r[l];if(i.href===t&&(!o||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${s}`))return;const n=document.createElement("link");if(n.rel=o?"stylesheet":y,o||(n.as="script"),n.crossOrigin="",n.href=t,m&&n.setAttribute("nonce",m),document.head.appendChild(n),o)return new Promise((l,i)=>{n.addEventListener("load",l),n.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${t}`)))})}))}function h(r){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=r,window.dispatchEvent(e),!e.defaultPrevented)throw r}return d.then(r=>{for(const e of r||[])e.status==="rejected"&&h(e.reason);return c().catch(h)})};export{P as _};