import{S as o,a as m}from"./Str-Ckn63bs5.js";import{A as w}from"./Arr-MwYQQ3qa.js";class P{static appendQueryParams(r,t={}){const e=new URL(r);return Object.entries(t).forEach(([n,s])=>{s!=null&&e.searchParams.append(n,s.toString())}),e.toString()}static join(r,t,e={}){return o.endsWith(r,"/")||(r=r+"/"),o.startsWith(t,"/")&&(t=t.substring(1)),this.appendQueryParams(r+t,e)}static addParam(r,t,e){const n=new URL(r);return n.searchParams.append(t,e),n.toString()}static getParam(r,t){return new URL(r??window.location.href).searchParams.get(t)}static removeParam(r,t){const e=new URL(r);return e.searchParams.delete(t),e.toString()}static pushToVueUrl(r=null,t={}){const e=this.appendToVueUrl(r,t);e&&window.history.replaceState({},"",e)}static appendToVueUrl(r=null,t={}){if(typeof window>"u")return;const e=r??window.location.href,n=new URL(e),s=e.split("#")[0],a=n.hash;if(!a.includes("?")){const i=a.replace(/\/?$/,"/")+"?"+new URLSearchParams(t).toString();return`${s}${i}`}const[u,l]=a.slice(1).split("?"),c=new URLSearchParams(l||"");Object.entries(t).forEach(([i,h])=>{c.set(i,h.toString())});const d=`#${u}?${c.toString()}`;return`${s}${d}`}static getAdminRoute(r=""){return w.get(window,"fluentCartAdminApp.admin_url")+r}static getVueParams(r){var e;const t=m();return((e=t==null?void 0:t.query)==null?void 0:e[r])??(t==null?void 0:t.query)??null}}export{P as U};
