const fileName_1 = "(@effect/core) _src/io/Schedule/operations/delays.ts";
import * as tsplus_module_1 from "@tsplus/stdlib/data/Duration";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/flatMap";
import { makeWithState } from "@effect/core/io/Schedule/operations/_internal/makeWithState";
/**
 * Returns a new schedule that outputs the delay between each occurence.
 *
 * @tsplus getter ets/Schedule delays
 * @tsplus getter ets/Schedule/WithState delays
 */

export function delays(self) {
  return makeWithState(self._initial, (now, input, state) => tsplus_module_4.flatMap_(self._step(now, input, state), ({
    tuple: [state, _, decision]
  }) => decision._tag === "Done" ? tsplus_module_3.succeedNow(tsplus_module_2.make(state, tsplus_module_1.millis(0), decision), fileName_1 + ":18:30") : tsplus_module_3.succeedNow(tsplus_module_2.make(state, new tsplus_module_1.Duration(decision.interval.startMillis - now), decision), fileName_1 + ":19:30"), fileName_1 + ":16:15"));
}
//# sourceMappingURL=delays.mjs.map