const fileName_1 = "(@effect/core) _src/io/Supervisor/operations/and.ts";
import * as tsplus_module_1 from "@effect/core/io/Supervisor/definition";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/zip";
/**
 * Returns a new supervisor that performs the function of this supervisor, and
 * the function of the specified supervisor, producing a tuple of the outputs
 * produced by both supervisors.
 *
 * @tsplus operator ets/Supervisor +
 * @tsplus fluent ets/Supervisor and
 */

export function and_(self, that) {
  return new tsplus_module_1.Supervisor(tsplus_module_2.zip_(self.value, () => that.value, fileName_1 + ":14:19"), (environment, effect, parent, fiber) => {
    try {
      self.unsafeOnStart(environment, effect, parent, fiber);
    } finally {
      that.unsafeOnStart(environment, effect, parent, fiber);
    }
  }, (exit, fiber) => {
    self.unsafeOnEnd(exit, fiber);
    that.unsafeOnEnd(exit, fiber);
  }, (fiber, effect) => {
    self.unsafeOnEffect(fiber, effect);
    that.unsafeOnEffect(fiber, effect);
  }, fiber => {
    self.unsafeOnSuspend(fiber);
    that.unsafeOnSuspend(fiber);
  }, fiber => {
    self.unsafeOnSuspend(fiber);
    that.unsafeOnSuspend(fiber);
  });
}
/**
 * Returns a new supervisor that performs the function of this supervisor, and
 * the function of the specified supervisor, producing a tuple of the outputs
 * produced by both supervisors.
 */

export const and = that => self => and_(self, that);
//# sourceMappingURL=and.mjs.map