index.b9aedd1d.js 2.1 KB

1
  1. import{b8 as y,b9 as P,S as b,a2 as g,b7 as h}from"./index.394decd7.js";var c;const $=typeof window!="undefined",N=t=>typeof t=="string",V=()=>{};$&&((c=window==null?void 0:window.navigator)==null?void 0:c.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function _(t,r){function n(...e){t(()=>r.apply(this,e),{fn:r,thisArg:this,args:e})}return n}const O=t=>t();function F(t,r=!0,n=!0){let e=0,i,a=!0;const l=()=>{i&&(clearTimeout(i),i=void 0)};return s=>{const o=h(t),p=Date.now()-e;if(l(),o<=0)return e=Date.now(),s();p>o&&(n||!a)?(e=Date.now(),s()):r&&(i=setTimeout(()=>{e=Date.now(),a=!0,l(),s()},o)),!n&&!i&&(i=setTimeout(()=>a=!0,o)),a=!1}}function j(t=O){const r=b(!0);function n(){r.value=!1}function e(){r.value=!0}return{isActive:r,pause:n,resume:e,eventFilter:(...a)=>{r.value&&t(...a)}}}function q(t,r=!1,n="Timeout"){return new Promise((e,i)=>{setTimeout(r?()=>i(n):e,t)})}function z(t){return y()?(P(t),!0):!1}function B(t,r=200,n=!0,e=!0){return _(F(r,n,e),t)}var v=Object.getOwnPropertySymbols,S=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable,T=(t,r)=>{var n={};for(var e in t)S.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(t!=null&&v)for(var e of v(t))r.indexOf(e)<0&&D.call(t,e)&&(n[e]=t[e]);return n};function A(t,r,n={}){const e=n,{eventFilter:i=O}=e,a=T(e,["eventFilter"]);return g(t,_(i,r),a)}var E=Object.defineProperty,x=Object.defineProperties,I=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,w=(t,r,n)=>r in t?E(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,C=(t,r)=>{for(var n in r||(r={}))m.call(r,n)&&w(t,n,r[n]);if(f)for(var n of f(r))d.call(r,n)&&w(t,n,r[n]);return t},R=(t,r)=>x(t,I(r)),W=(t,r)=>{var n={};for(var e in t)m.call(t,e)&&r.indexOf(e)<0&&(n[e]=t[e]);if(t!=null&&f)for(var e of f(t))r.indexOf(e)<0&&d.call(t,e)&&(n[e]=t[e]);return n};function G(t,r,n={}){const e=n,{eventFilter:i}=e,a=W(e,["eventFilter"]),{eventFilter:l,pause:u,resume:s,isActive:o}=j(i);return{stop:A(t,r,R(C({},a),{eventFilter:l})),pause:u,resume:s,isActive:o}}export{N as a,$ as i,V as n,q as p,z as t,B as u,G as w};