function t(t){let e;try{e=new URL(t,"http://example.com").search.substring(1)}catch(t){}if(e)return e}function n(t){let e="";const r=Object.entries(t);let n;for(;n=r.shift();){let[t,o]=n;if(Array.isArray(o)||o&&o.constructor===Object){const e=Object.entries(o).reverse();for(const[n,o]of e)r.unshift([`${t}[${n}]`,o])}else void 0!==o&&(null===o&&(o=""),e+="&"+[t,o].map(encodeURIComponent).join("="))}return e.substr(1)}function e(t){try{return decodeURIComponent(t)}catch(e){return t}}function o(t,e,r){const n=e.length,o=n-1;for(let c=0;c<n;c++){let n=e[c];!n&&Array.isArray(t)&&(n=t.length.toString()),n=["__proto__","constructor","prototype"].includes(n)?n.toUpperCase():n;const s=!isNaN(Number(e[c+1]));t[n]=c===o?r:t[n]||(s?[]:{}),Array.isArray(t[n])&&!s&&(t[n]={...t[n]}),t=t[n]}}function r(r){return(t(r)||"").replace(/\+/g,"%20").split("&").reduce(((t,r)=>{const[n,c=""]=r.split("=").filter(Boolean).map(e);return n&&o(t,n.replace(/\]/g,"").split("["),c),t}),Object.create(null))}function c(t="",e){if(!e||!Object.keys(e).length)return t;let o=t;const c=t.indexOf("?");return-1!==c&&(e=Object.assign(r(t),e),o=o.substr(0,c)),o+"?"+n(e)}export{c as a,n as b,r as g};