var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var l,t,o,u,i,a={},r={},c={};function d(){return l||(l=1,n=c,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),n.debounce=function(n,e,{signal:l,edges:t}={}){let o,u=null;const i=null!=t&&t.includes("leading"),a=null==t||t.includes("trailing"),r=()=>{null!==u&&(n.apply(o,u),o=void 0,u=null)};let c=null;const d=()=>{null!=c&&clearTimeout(c),c=setTimeout(()=>{c=null,a&&r(),s()},e)},s=()=>{null!==c&&(clearTimeout(c),c=null),o=void 0,u=null},f=function(...n){if(l?.aborted)return;o=this,u=n;const e=null==c;d(),i&&e&&r()};return f.schedule=d,f.cancel=s,f.flush=()=>{r()},l?.addEventListener("abort",s,{once:!0}),f}),c;var n}function s(){return t||(t=1,function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const e=d();n.debounce=function(n,l=0,t={}){"object"!=typeof t&&(t={});const{leading:o=!1,trailing:u=!0,maxWait:i}=t,a=Array(2);let r;o&&(a[0]="leading"),u&&(a[1]="trailing");let c=null;const d=e.debounce(function(...e){r=n.apply(this,e),c=null},l,{edges:a}),s=function(...e){return null!=i&&(null===c&&(c=Date.now()),Date.now()-c>=i)?(r=n.apply(this,e),c=Date.now(),d.cancel(),d.schedule(),r):(d.apply(this,e),r)};return s.cancel=d.cancel,s.flush=()=>(d.flush(),r),s}}(r)),r}function f(){return o||(o=1,function(n){Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});const e=s();n.throttle=function(n,l=0,t={}){const{leading:o=!0,trailing:u=!0}=t;return e.debounce(n,l,{leading:o,maxWait:l,trailing:u})}}(a)),a}function g(){return i?u:(i=1,u=f().throttle)}const p=e(g());export{n as c,e as g,p as t};
