import{U as s,i,h as c}from"./vidstack-D40FSa5B.js";import"./vidstack-DQvyz7Mm.js";function u(e,r){const n=new URL(e);for(const t of Object.keys(r))n.searchParams.set(t,r[t]+"");return n.toString()}function a(e,r="preconnect"){const n=document.querySelector(`link[href="${e}"]`);if(!s(n))return!0;const t=document.createElement("link");return t.rel=r,t.href=e,t.crossOrigin="true",document.head.append(t),!0}const o={};function d(e){if(o[e])return o[e].promise;const r=c(),n=document.querySelector(`script[src="${e}"]`);if(!s(n))return r.resolve(),r.promise;o[e]=r;const t=document.createElement("script");return t.src=e,t.onload=()=>{r.resolve(),delete o[e]},t.onerror=()=>{r.reject(),delete o[e]},setTimeout(()=>document.head.append(t),0),r.promise}function l(e){return e==="use-credentials"?"include":i(e)?"same-origin":void 0}export{u as a,l as g,d as l,a as p};
