"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("./isObject.js"),p=require("./now.js"),A=require("./toNumber.js");var _,S;function D(){if(S)return _;S=1;var y=$.__require(),v=p.__require(),h=A.__require(),M="Expected a function",W=Math.max,C=Math.min;function L(q,i,u){var a,c,s,f,n,t,o=0,x=!1,d=!1,g=!0;if(typeof q!="function")throw new TypeError(M);i=h(i)||0,y(u)&&(x=!!u.leading,d="maxWait"in u,s=d?W(h(u.maxWait)||0,i):s,g="trailing"in u?!!u.trailing:g);function T(e){var r=a,l=c;return a=c=void 0,o=e,f=q.apply(l,r),f}function O(e){return o=e,n=setTimeout(m,i),x?T(e):f}function R(e){var r=e-t,l=e-o,I=i-r;return d?C(I,s-l):I}function E(e){var r=e-t,l=e-o;return t===void 0||r>=i||r<0||d&&l>=s}function m(){var e=v();if(E(e))return k(e);n=setTimeout(m,R(e))}function k(e){return n=void 0,g&&a?T(e):(a=c=void 0,f)}function j(){n!==void 0&&clearTimeout(n),o=0,a=t=c=n=void 0}function N(){return n===void 0?f:k(v())}function b(){var e=v(),r=E(e);if(a=arguments,c=this,t=e,r){if(n===void 0)return O(t);if(d)return clearTimeout(n),n=setTimeout(m,i),T(t)}return n===void 0&&(n=setTimeout(m,i)),f}return b.cancel=j,b.flush=N,b}return _=L,_}exports.__require=D;
