import{bj as m,m as i}from"./entry.client-CV0PzNS2.js";const u=r=>{const n=r.split("?");if(n.length>1){const t=n[1].split("&"),e={};return t.forEach(o=>{const[s,a]=o.split("=");e[decodeURIComponent(s)]=decodeURIComponent(a)}),e}return{}},P=(r,n)=>{if(!r.includes("?")&&!n)return null;const t=u(r);if(n){const e=m(t??{},n);return"?"+i(e,(s,a)=>`${encodeURIComponent(a)}=${encodeURIComponent(s)}`).join("&")}return"?"+r.split("?")[1]};export{P as p};