import m from "./index.es165.js";
function g(f, o, a) {
  var e, l, r, n, t = 0;
  a || (a = {});
  var s = function() {
    t = a.leading === !1 ? 0 : m(), e = null, n = f.apply(l, r), e || (l = r = null);
  }, c = function() {
    var i = m();
    !t && a.leading === !1 && (t = i);
    var u = o - (i - t);
    return l = this, r = arguments, u <= 0 || u > o ? (e && (clearTimeout(e), e = null), t = i, n = f.apply(l, r), e || (l = r = null)) : !e && a.trailing !== !1 && (e = setTimeout(s, u)), n;
  };
  return c.cancel = function() {
    clearTimeout(e), t = 0, e = l = r = null;
  }, c;
}
export {
  g as default
};
//# sourceMappingURL=index.es171.js.map
