import{Mi as e}from"./src-CD6Jsigc.js";import{t}from"./backendApi-BRM6WgjB.js";import"./useClipboard-BKdTpz-d.js";var n={in:`ingame/frontend`,pre:`pregame/frontend`,post:`postgame/frontend`},r=`o`;async function i(e){let r=await t.get(n[e]),i=new URL(r);return i.searchParams.delete(`backendport`),i}function a(e,...t){let n=new URL(e.toString()),r=t.filter(e=>!!e).join(`/`),i=r.split(`/`).filter(e=>e.length>0),a=n.pathname.replace(/\/+$/,``),o=i.length===0||r.endsWith(`/`);return n.pathname=i.length>0?`${a}/${i.join(`/`)}${o?`/`:``}`:`${a}/`,n}function o(e,t){return t.set&&e.searchParams.set(`set`,t.set),e}async function s(e,t={}){return o(a(await i(e),`v2`),t).toString()}async function c(e,t,n={}){return o(a(await i(e),`v2`,r,t),n).toString()}async function l(e,t,n=``){return a(await i(e),n,t).toString()}async function u(t,n,r,i=``){try{let a=await l(t,n.value,i);await e(a),r.value=!0,setTimeout(()=>r.value=!1,1500)}catch(e){console.error(`Copy failed:`,e)}}export{a,l as i,c as n,u as o,s as r,i as t};