1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t}from"./jsx-runtime-D3F0h15I.js";var n=e(t());function r(e,t,r,i){var a=this,o=(0,n.useRef)(null),s=(0,n.useRef)(0),c=(0,n.useRef)(0),l=(0,n.useRef)(null),u=(0,n.useRef)([]),d=(0,n.useRef)(),f=(0,n.useRef)(),p=(0,n.useRef)(e),m=(0,n.useRef)(!0),h=(0,n.useRef)(),g=(0,n.useRef)();p.current=e;var _=typeof window<`u`,v=!t&&t!==0&&_;if(typeof e!=`function`)throw TypeError(`Expected a function`);t=+t||0;var y=!!(r||={}).leading,b=!(`trailing`in r)||!!r.trailing,x=!!r.flushOnExit&&b,S=`maxWait`in r,C=`debounceOnServer`in r&&!!r.debounceOnServer,w=S?Math.max(+r.maxWait||0,t):null,T=(0,n.useMemo)(function(){var e=function(e){var t=u.current,n=d.current;return u.current=d.current=null,s.current=e,c.current=c.current||e,f.current=p.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(l.current),l.current=v?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!m.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||S&&e-s.current>=w},T=function(t){return l.current=null,b&&u.current?e(t):(u.current=d.current=null,f.current)},E=function e(){var i=Date.now();if(y&&c.current===s.current&&D(),r(i))return T(i);if(m.current){var a=t-(i-o.current);n(e,S?Math.min(a,w-(i-s.current)):a)}},D=function(){i&&i({})},O=function(){if(_||C){var i,c=Date.now(),p=r(c);if(u.current=[].slice.call(arguments),d.current=a,o.current=c,x&&!h.current&&(h.current=function(){globalThis.document?.visibilityState===`hidden`&&g.current.flush()},(i=globalThis.document)==null||i.addEventListener==null||i.addEventListener(`visibilitychange`,h.current)),p){if(!l.current&&m.current)return s.current=o.current,n(E,t),y?e(o.current):f.current;if(S)return n(E,t),e(o.current)}return l.current||n(E,t),f.current}};return O.cancel=function(){var e=l.current;e&&(v?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,u.current=o.current=d.current=l.current=null,e&&i&&i({})},O.isPending=function(){return!!l.current},O.flush=function(){return l.current?T(Date.now()):f.current},O},[y,S,t,w,b,x,v,_,C,i]);return g.current=T,(0,n.useEffect)(function(){return m.current=!0,function(){var e;x&&g.current.flush(),h.current&&=((e=globalThis.document)==null||e.removeEventListener==null||e.removeEventListener(`visibilitychange`,h.current),null),m.current=!1}},[x]),T}function i(e,t,n){var i=n===void 0?{}:n,a=i.leading,o=i.trailing,s=i.flushOnExit;return r(e,t,{maxWait:t,leading:a===void 0||a,trailing:o===void 0||o,flushOnExit:s!==void 0&&s})}export{r as n,i as t}; 2//# sourceMappingURL=index.module-DGdcFisy.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.