wordalle / static /_app /immutable /chunks /preload-helper-2ab26066.js
radames's picture
add statics
32c1428
raw
history blame
1.12 kB
import{s as d,E as f}from"./index-86f4d6c3.js";const c=[];function $(s,l=f){let o;const e=new Set;function i(n){if(d(s,n)&&(s=n,o)){const a=!c.length;for(const t of e)t[1](),c.push(t,s);if(a){for(let t=0;t<c.length;t+=2)c[t][0](c[t+1]);c.length=0}}}function u(n){i(n(s))}function r(n,a=f){const t=[n,a];return e.add(t),e.size===1&&(o=l(i)||f),n(s),()=>{e.delete(t),e.size===0&&(o(),o=null)}}return{set:i,update:u,subscribe:r}}let b="",m="";function w(s){b=s.base,m=s.assets||b}const g="modulepreload",h={},p="/embed/huggingface-projects/wordalle/static/_app/immutable/",E=function(l,o){return!o||o.length===0?l():Promise.all(o.map(e=>{if(e=`${p}${e}`,e in h)return;h[e]=!0;const i=e.endsWith(".css"),u=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${u}`))return;const r=document.createElement("link");if(r.rel=i?"stylesheet":g,i||(r.as="script",r.crossOrigin=""),r.href=e,document.head.appendChild(r),i)return new Promise((n,a)=>{r.addEventListener("load",n),r.addEventListener("error",()=>a(new Error(`Unable to preload CSS for ${e}`)))})})).then(()=>l())};export{E as _,m as a,b,w as s,$ as w};