f7cloud_client/apps/activity/js/preload-helper-B9rAsR6N.chunk.mjs
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

3 lines
1.3 KiB
JavaScript

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