String.fromCharCode;var e=/#/g,t=/&/g,n=/\//g,r=/=/g,i=/\+/g,a=/%5e/gi,o=/%60/gi,s=/%7c/gi,c=/%20/gi,l=/%2f/gi;function u(e){return encodeURI(``+e).replace(s,`|`)}function d(r){return u(typeof r==`string`?r:JSON.stringify(r)).replace(i,`%2B`).replace(c,`+`).replace(e,`%23`).replace(t,`%26`).replace(o,"`").replace(a,`^`).replace(n,`%2F`)}function f(e){return d(e).replace(r,`%3D`)}function p(e=``){try{return decodeURIComponent(``+e)}catch{return``+e}}function m(e){return p(e.replace(l,`%252F`))}function h(e){return p(e.replace(i,` `))}function g(e){return p(e.replace(i,` `))}function _(e=``){let t=Object.create(null);e[0]===`?`&&(e=e.slice(1));for(let n of e.split(`&`)){let e=n.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let r=h(e[1]);if(r===`__proto__`||r===`constructor`)continue;let i=g(e[2]||``);t[r]===void 0?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}return t}function v(e,t){return(typeof t==`number`||typeof t==`boolean`)&&(t=String(t)),t?Array.isArray(t)?t.map(t=>`${f(e)}=${d(t)}`).join(`&`):`${f(e)}=${d(t)}`:f(e)}function y(e){return Object.keys(e).filter(t=>e[t]!==void 0).map(t=>v(t,e[t])).filter(Boolean).join(`&`)}var b=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,x=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,S=/^([/\\]\s*){2,}[^/\\]/,C=/^[\s\0]*(blob|data|javascript|vbscript):$/i,w=/\/$|\/\?|\/#/,T=/^\.?\//;function E(e,t={}){return typeof t==`boolean`&&(t={acceptRelative:t}),t.strict?b.test(e):x.test(e)||(t.acceptRelative?S.test(e):!1)}function D(e){return!!e&&C.test(e)}function O(e=``,t){return t?w.test(e):e.endsWith(`/`)}function k(e=``,t){if(!t)return(O(e)?e.slice(0,-1):e)||`/`;if(!O(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);i!==-1&&(n=e.slice(0,i),r=e.slice(i));let[a,...o]=n.split(`?`);return((a.endsWith(`/`)?a.slice(0,-1):a)||`/`)+(o.length>0?`?${o.join(`?`)}`:``)+r}function A(e=``,t){if(!t)return e.endsWith(`/`)?e:e+`/`;if(O(e,!0))return e||`/`;let n=e,r=``,i=e.indexOf(`#`);if(i!==-1&&(n=e.slice(0,i),r=e.slice(i),!n))return r;let[a,...o]=n.split(`?`);return a+`/`+(o.length>0?`?${o.join(`?`)}`:``)+r}function j(e,t){if(P(t)||E(e))return e;let n=k(t);if(e.startsWith(n)){let t=e[n.length];if(!t||t===`/`||t===`?`)return e}return I(n,e)}function M(e,t){if(P(t))return e;let n=k(t);if(!e.startsWith(n))return e;let r=e[n.length];return r&&r!==`/`&&r!==`?`?e:`/`+e.slice(n.length).replace(/^\/+/,``)}function N(e,t){let n=B(e);return n.search=y({..._(n.search),...t}),H(n)}function P(e){return!e||e===`/`}function F(e){return e&&e!==`/`}function I(e,...t){let n=e||``;for(let e of t.filter(e=>F(e)))if(n){let t=e.replace(T,``);n=A(n)+t}else n=e;return n}function L(...e){let t=/\/(?!\/)/,n=e.filter(Boolean),r=[],i=0;for(let e of n)if(e&&e!==`/`){for(let[n,a]of e.split(t).entries())if(a&&a!==`.`){if(a===`..`){if(r.length===1&&E(r[0]))continue;r.pop(),i--}else n===1&&r[r.length-1]?.endsWith(`:/`)?r[r.length-1]+=`/`+a:(r.push(a),i++)}}let a=r.join(`/`);return i>=0?n[0]?.startsWith(`/`)&&!a.startsWith(`/`)?a=`/`+a:n[0]?.startsWith(`./`)&&!a.startsWith(`./`)&&(a=`./`+a):a=`../`.repeat(-1*i)+a,n[n.length-1]?.endsWith(`/`)&&!a.endsWith(`/`)&&(a+=`/`),a}function R(e,t){return p(k(e))===p(k(t))}var z=Symbol.for(`ufo:protocolRelative`);function B(e=``,t){let n=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=``]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:``,host:``,search:``,hash:``}}if(!E(e,{acceptRelative:!0}))return t?B(t+e):V(e);let[,r=``,i,a=``]=e.replace(/\\/g,`/`).match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,o=``,s=``]=a.match(/([^#/?]*)(.*)?/)||[];r===`file:`&&(s=s.replace(/\/(?=[A-Za-z]:)/,``));let{pathname:c,search:l,hash:u}=V(s);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):``,host:o,pathname:c,search:l,hash:u,[z]:!r}}function V(e=``){let[t=``,n=``,r=``]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:n,hash:r}}function H(e){let t=e.pathname||``,n=e.search?(e.search.startsWith(`?`)?``:`?`)+e.search:``,r=e.hash||``,i=e.auth?e.auth+`@`:``,a=e.host||``;return(e.protocol||e[z]?(e.protocol||``)+`//`:``)+i+a+t+n+r}export{L as a,B as c,A as d,M as f,D as i,j as l,E as n,I as o,k as p,R as r,_ as s,m as t,N as u};