var e={exports:{}};function t(e,t=100,n={}){if(typeof e!=="function"){throw new TypeError(`Expected the first parameter to be a function, got \`${typeof e}\`.`)}if(t<0){throw new RangeError("`wait` must not be negative.")}const{immediate:o}=typeof n==="boolean"?{immediate:n}:n;let i;let r;let f;let u;let c;function s(){const t=i;const n=r;i=undefined;r=undefined;c=e.apply(t,n);return c}function d(){const e=Date.now()-u;if(e<t&&e>=0){f=setTimeout(d,t-e)}else{f=undefined;if(!o){c=s()}}}const a=function(...e){if(i&&this!==i&&Object.getPrototypeOf(this)===Object.getPrototypeOf(i)){throw new Error("Debounced method called with different contexts of the same prototype.")}i=this;r=e;u=Date.now();const n=o&&!f;if(!f){f=setTimeout(d,t)}if(n){c=s()}return c};Object.defineProperty(a,"isPending",{get(){return f!==undefined}});a.clear=()=>{if(!f){return}clearTimeout(f);f=undefined};a.flush=()=>{if(!f){return}a.trigger()};a.trigger=()=>{c=s();a.clear()};return a}e.exports.debounce=t;e.exports=t;const n=e.exports;export{n as d};
//# sourceMappingURL=p-3e4d9396.js.map