var g=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},N="Expected a function",S=0/0,W="[object Symbol]",$=/^\s+|\s+$/g,A=/^[-+]0x[0-9a-f]+$/i,B=/^0b[01]+$/i,F=/^0o[0-7]+$/i,R=parseInt,_=typeof g=="object"&&g&&g.Object===Object&&g,G=typeof self=="object"&&self&&self.Object===Object&&self,P=_||G||Function("return this")(),w=Object.prototype,D=w.toString,H=Math.max,U=Math.min,j=function(){return P.Date.now()};function X(e,t,i){var a,u,b,c,r,o,s=0,h=!1,d=!1,y=!0;if(typeof e!="function")throw new TypeError(N);t=k(t)||0,v(i)&&(h=!!i.leading,d="maxWait"in i,b=d?H(k(i.maxWait)||0,t):b,y="trailing"in i?!!i.trailing:y);function p(n){var f=a,l=u;return a=u=void 0,s=n,c=e.apply(l,f),c}function E(n){return s=n,r=setTimeout(m,t),h?p(n):c}function L(n){var f=n-o,l=n-s,O=t-f;return d?U(O,b-l):O}function x(n){var f=n-o,l=n-s;return o===void 0||f>=t||f<0||d&&l>=b}function m(){var n=j();if(x(n))return I(n);r=setTimeout(m,L(n))}function I(n){return r=void 0,y&&a?p(n):(a=u=void 0,c)}function C(){r!==void 0&&clearTimeout(r),s=0,a=o=u=r=void 0}function M(){return r===void 0?c:I(j())}function T(){var n=j(),f=x(n);if(a=arguments,u=this,o=n,f){if(r===void 0)return E(o);if(d)return r=setTimeout(m,t),p(o)}return r===void 0&&(r=setTimeout(m,t)),c}return T.cancel=C,T.flush=M,T}function v(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function q(e){return!!e&&typeof e=="object"}function z(e){return typeof e=="symbol"||q(e)&&D.call(e)==W}function k(e){if(typeof e=="number")return e;if(z(e))return S;if(v(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=v(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace($,"");var i=B.test(e);return i||F.test(e)?R(e.slice(2),i?2:8):A.test(e)?S:+e}var J=X;export default J;