import "./style.css";
import { unref as g } from "vue";
var p;
const D = typeof window < "u", m = () => {
};
D && ((p = window == null ? void 0 : window.navigator) != null && p.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
function P(e) {
  return typeof e == "function" ? e() : g(e);
}
function T(e, r) {
  function o(...i) {
    return new Promise((t, n) => {
      Promise.resolve(e(() => r.apply(this, i), { fn: r, thisArg: this, args: i })).then(t).catch(n);
    });
  }
  return o;
}
function x(e, r = !0, o = !0, i = !1) {
  let t = 0, n, u = !0, a = m, l;
  const c = () => {
    n && (clearTimeout(n), n = void 0, a(), a = m);
  };
  return (h) => {
    const s = P(e), w = Date.now() - t, f = () => l = h();
    return c(), s <= 0 ? (t = Date.now(), f()) : (w > s && (o || !u) ? (t = Date.now(), f()) : r && (l = new Promise((d, v) => {
      a = i ? v : d, n = setTimeout(() => {
        t = Date.now(), u = !0, d(f()), c();
      }, Math.max(0, s - w));
    })), !o && !n && (n = setTimeout(() => u = !0, s)), u = !1, l);
  };
}
function j(e, r = 200, o = !1, i = !0, t = !1) {
  return T(x(r, o, i, t), e);
}
export {
  j as u
};
//# sourceMappingURL=index-CeNzXk8O.js.map
