import{removeTrailingSlash as u}from"./utils.js";function m(t,n){return Object.fromEntries(Object.entries(t).map(([e,r])=>[e,n(r,e)]))}async function x(t,n){return Object.fromEntries(await Promise.all(Object.entries(t).map(async([e,r])=>[e,await n(r,e)])))}function s(t,n,e=[]){for(const r of t)r[n]&&e.push(r[n]),r.items&&s(r.items,n,e);return e}function d(t,n=50,e=!1){let r;return function(...o){let i=()=>{r=void 0,e||t.apply(this,o)};const c=e&&!r;clearTimeout(r),r=setTimeout(i,n),c&&t.apply(this,o)}}function h(t,n){if(typeof t!="function"||n!=null&&typeof n!="function")throw new TypeError("Expected a function");const e=function(...r){const o=n?n.apply(this,r):r[0],i=e.cache;if(i.has(o))return i.get(o);const c=t.apply(this,r);return e.cache=i.set(o,c)||i,c};return e.cache=new Map,e}function O(t){return typeof t=="function"}function b(t){return Object.fromEntries(t.entries())}function j(){return typeof window<"u"&&"HTMLElement"in window}function w(t,n){const e=t.endsWith("/")?u(t):t,r=n.endsWith("/")?u(n):n;return e===r}function g(t){return t!=null}function f(t){if(typeof t=="object"&&t!==null){if(typeof Object.getPrototypeOf=="function"){const n=Object.getPrototypeOf(t);return n===Object.prototype||n===null}return Object.prototype.toString.call(t)==="[object Object]"}return!1}function p(...t){return t.reduce((n,e={})=>{for(const r of Object.keys(e))["__proto__","constructor","prototype"].includes(r)||(Array.isArray(n[r])&&Array.isArray(e[r])?n[r]=e[r]:f(n[r])&&f(e[r])?n[r]=p(n[r],e[r]):n[r]=e[r]);return n},{})}function a(t,[n,...e]){typeof t!="object"||!t||t?.[n]===void 0||(e.length===0?delete t?.[n]:t?.[n]&&a(t?.[n],e))}function A(t,n){for(const e of t)if(n(e))return e}function E(t,n){const e=new Set,r=[];for(const o of t){const i=n?n(o):o;e.has(i)||r.push(o),e.add(i)}return r}function l(t,n){for(const e of t){if(n(e)===!0)return e;if(e.items){const r=l(e.items,n);if(r!==void 0)return r}}}function T(t,n){const e={},r=[];for(const o of t){const i=n(o);if(!i){r.push([o]);continue}e[i]||(e[i]=[]),e[i].push(o)}return Object.values(e).concat(r)}function D(t){return Array.isArray(t)?t:[t]}async function P(t,n){const e=[],r=[];for(const o of t)await n(o)?e.push(o):r.push(o);return[e,r]}function S(t){return Object.fromEntries(Object.entries(t).sort((n,e)=>n[0].localeCompare(e[0])))}function k(t){return t.replace(/[\u00A0-\u9999<>\&]/gim,function(n){return"&#"+n.charCodeAt(0)+";"})}function _(t){return t==null?void 0:String(t)}function M(t){return!!t}function v(t,n){const e={};for(const r of t){const o=n(r);e[o]||(e[o]=[]),e[o].push(r)}return e}function z(t,n){let e=t;try{for(let r=0;r<n.length;r++)e=e[n[r]]}catch(r){return{error:r,value:null}}return{error:null,value:e}}export{s as collectPropValueDeep,w as compareURIs,d as debounce,p as deepMerge,k as encodeHtmlEntities,D as ensureArray,l as findDeepFirst,A as findInIterable,z as getValueDeep,v as groupBy,j as isBrowser,g as isDefined,O as isFunction,f as isObject,M as isTruthy,m as mapObject,x as mapObjectAsync,b as mapToObject,h as memoize,T as partition,a as removeDeepProperty,S as sortObjectKeys,P as splitArrayAsync,_ as toStringIfDefined,E as unique};
