import{a as e,i as t,r as n}from"./BB0YooBY.js";import{t as r}from"./CDMkP1nK.js";var i=`[object Symbol]`;function a(e){return typeof e==`symbol`||n(e)&&t(e)==i}var o=/\s/;function s(e){for(var t=e.length;t--&&o.test(e.charAt(t)););return t}var c=/^\s+/;function l(e){return e&&e.slice(0,s(e)+1).replace(c,``)}var u=NaN,d=/^[-+]0x[0-9a-f]+$/i,f=/^0b[01]+$/i,p=/^0o[0-7]+$/i,m=parseInt;function h(e){if(typeof e==`number`)return e;if(a(e))return u;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=l(e);var n=f.test(e);return n||p.test(e)?m(e.slice(2),n?2:8):d.test(e)?u:+e}var g=function(){return e.Date.now()},_=`Expected a function`,v=Math.max,y=Math.min;function b(e,t,n){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(_);t=h(t)||0,r(n)&&(d=!!n.leading,f=`maxWait`in n,o=f?v(h(n.maxWait)||0,t):o,p=`trailing`in n?!!n.trailing:p);function m(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function b(e){return u=e,c=setTimeout(C,t),d?m(e):s}function x(e){var n=e-l,r=e-u,i=t-n;return f?y(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,x(e))}function w(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(g())}function D(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return b(l);if(f)return clearTimeout(c),c=setTimeout(C,t),m(l)}return c===void 0&&(c=setTimeout(C,t)),s}return D.cancel=T,D.flush=E,D}var x=`Expected a function`;function S(e,t,n){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(x);return r(n)&&(i=`leading`in n?!!n.leading:i,a=`trailing`in n?!!n.trailing:a),b(e,t,{leading:i,maxWait:t,trailing:a})}export{S as t};