var n, s;
function _() {
  if (s) return n;
  s = 1;
  var l = /* @__PURE__ */ function() {
    function i() {
      this.maxAttempts_ = 1, this.delayFactor_ = 0.1, this.fuzzFactor_ = 0.1, this.initialDelay_ = 1e3, this.enabled_ = !1;
    }
    var e = i.prototype;
    return e.getIsEnabled = function() {
      return this.enabled_;
    }, e.enable = function() {
      this.enabled_ = !0;
    }, e.disable = function() {
      this.enabled_ = !1;
    }, e.reset = function() {
      this.maxAttempts_ = 1, this.delayFactor_ = 0.1, this.fuzzFactor_ = 0.1, this.initialDelay_ = 1e3, this.enabled_ = !1;
    }, e.getMaxAttempts = function() {
      return this.maxAttempts_;
    }, e.setMaxAttempts = function(a) {
      this.maxAttempts_ = a;
    }, e.getDelayFactor = function() {
      return this.delayFactor_;
    }, e.setDelayFactor = function(a) {
      this.delayFactor_ = a;
    }, e.getFuzzFactor = function() {
      return this.fuzzFactor_;
    }, e.setFuzzFactor = function(a) {
      this.fuzzFactor_ = a;
    }, e.getInitialDelay = function() {
      return this.initialDelay_;
    }, e.setInitialDelay = function(a) {
      this.initialDelay_ = a;
    }, e.createRetry = function(a) {
      var r = a === void 0 ? {} : a, o = r.maxAttempts, c = r.delayFactor, y = r.fuzzFactor, h = r.initialDelay;
      return new u({
        maxAttempts: o || this.maxAttempts_,
        delayFactor: c || this.delayFactor_,
        fuzzFactor: y || this.fuzzFactor_,
        initialDelay: h || this.initialDelay_
      });
    }, i;
  }(), u = /* @__PURE__ */ function() {
    function i(t) {
      this.maxAttempts_ = t.maxAttempts, this.delayFactor_ = t.delayFactor, this.fuzzFactor_ = t.fuzzFactor, this.currentDelay_ = t.initialDelay, this.currentAttempt_ = 1;
    }
    var e = i.prototype;
    return e.moveToNextAttempt = function() {
      this.currentAttempt_++;
      var a = this.currentDelay_ * this.delayFactor_;
      this.currentDelay_ = this.currentDelay_ + a;
    }, e.shouldRetry = function() {
      return this.currentAttempt_ < this.maxAttempts_;
    }, e.getCurrentDelay = function() {
      return this.currentDelay_;
    }, e.getCurrentMinPossibleDelay = function() {
      return (1 - this.fuzzFactor_) * this.currentDelay_;
    }, e.getCurrentMaxPossibleDelay = function() {
      return (1 + this.fuzzFactor_) * this.currentDelay_;
    }, e.getCurrentFuzzedDelay = function() {
      var a = this.getCurrentMinPossibleDelay(), r = this.getCurrentMaxPossibleDelay();
      return a + Math.random() * (r - a);
    }, i;
  }();
  return n = l, n;
}
export {
  _ as __require
};
//# sourceMappingURL=retry.js.map
