import{b as n,c as e,d as t,e as o,f as r}from"./p-f021dfd0.js";import{I as c}from"./p-8ffe7be8.js";const s=(n,e=1)=>new Promise(((t,o)=>{const r=new Image,c=()=>{delete r.onload,delete r.onerror,r.naturalWidth>=e?t(r):o(r)};Object.assign(r,{onload:c,onerror:c,src:n})})),i=(n,e,t=(()=>{}))=>{const o=document.createElement("script");o.src=n,o.onload=e,o.onerror=t;const r=document.getElementsByTagName("script")[0];r.parentNode.insertBefore(o,r)},d=o=>{var r;if(!e(r=o)&&(n(r)||t(r)&&r.startsWith("{")))return(e=>n(e)?e:function(n){if(t(n))try{return JSON.parse(n)}catch(n){return}}(e))(o)},w=(n,e="")=>{if(!c)return e;try{return window.decodeURIComponent(n)}catch(n){return e}},u=/(?:^[#?]?|&)([^=&]+)(?:=([^&]*))?/g,a=(n,e="preconnect",t)=>{if(!c)return!1;const o=document.createElement("link");return o.rel=e,o.href=n,r(t)||(o.as=t),o.crossOrigin="true",document.head.append(o),!0},f=(t,c)=>((n,e)=>{if(r(e)||0===e.length)return n;const t=n.split("?",2);return t[0]+(r(t[1])?"?"+e:`?${t[1]}&${e}`)})(t,n(c)?(n=>{const t=[],r=(n,e)=>{t.push(`${encodeURIComponent(n)}=${encodeURIComponent(e)}`)};return Object.keys(n).forEach((t=>{const c=n[t];e(c)||(o(c)?c.forEach((n=>r(t,n))):r(t,c))})),t.join("&")})(c):c),m=n=>{if(t(n))return(n=>{const e=Object.create(null);if(r(n))return e;let c;for(;c=u.exec(n);){const n=w(c[1],c[1]).replace("[]",""),r=t(c[2])?w(c[2].replace(/\+/g," "),c[2]):"",s=e[n];s&&!o(s)&&(e[n]=[s]),s?e[n].push(r):e[n]=r}return e})(n)},l={},p=(n,e,t,o=(()=>!0),c=i)=>{const s=n=>r(window[n])?window.exports&&window.exports[n]?window.exports[n]:window.module&&window.module.exports&&window.module.exports[n]?window.module.exports[n]:void 0:window[n],d=s(e);return d&&o(d)?Promise.resolve(d):new Promise(((o,i)=>{if(!r(l[n]))return void l[n].push({resolve:o,reject:i});l[n]=[{resolve:o,reject:i}];const d=e=>{l[n].forEach((n=>n.resolve(e)))};if(!r(t)){const n=window[t];window[t]=function(){r(n)||n(),d(s(e))}}c(n,(()=>{r(t)&&d(s(e))}),(e=>{l[n].forEach((n=>{n.reject(e)})),delete l[n]}))}))},j=(n,e)=>{c&&window.fetch(n).then((n=>n.text())).then((t=>{const o=document.createElement("div");o.setAttribute("data-sprite",n),o.style.display="none",o.innerHTML=t,(null!=e?e:document.head).append(o)}))};export{p as a,d as b,s as c,m as d,f as e,j as l,a as p}