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