const fileName_1 = "(@effect/core) _src/stream/Stream/Emit.ts";
import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeedNow";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/die";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/dieMessage";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/Chunk/single";
import * as tsplus_module_6 from "@effect/core/io/Exit/operations/mapBoth";
import * as tsplus_module_7 from "@effect/core/io/Effect/operations/done";
import * as tsplus_module_8 from "@effect/core/io/Effect/operations/fail";
import * as tsplus_module_9 from "@effect/core/io/Effect/operations/mapBoth";
import * as tsplus_module_10 from "@effect/core/io/Effect/operations/mapError";
import * as tsplus_module_11 from "@effect/core/io/Cause/operations/map";
import * as tsplus_module_12 from "@effect/core/io/Effect/operations/failCause";
export const Emit = {};
/**
 * @tsplus static ets/Stream/Emit/Ops __call
 */

export function apply(fn) {
  const ops = {
    chunk(as, __tsplusTrace) {
      return this(tsplus_module_1.succeedNow(as, fileName_1 + ":78:36"));
    },

    die(err, __tsplusTrace) {
      return this(tsplus_module_2.die(() => err, fileName_1 + ":81:29"));
    },

    dieMessage(message, __tsplusTrace) {
      return this(tsplus_module_3.dieMessage(() => message, fileName_1 + ":84:36"));
    },

    done(exit, __tsplusTrace) {
      return this(tsplus_module_7.done(() => tsplus_module_6.mapBoth_(exit, e => tsplus_module_4.some(e), a => tsplus_module_5.single(a)), fileName_1 + ":88:20"));
    },

    end(__tsplusTrace) {
      return this(tsplus_module_8.fail(() => tsplus_module_4.none, fileName_1 + ":97:30"));
    },

    fail(e, __tsplusTrace) {
      return this(tsplus_module_8.fail(() => tsplus_module_4.some(e), fileName_1 + ":100:30"));
    },

    fromEffect(io, __tsplusTrace) {
      return this(tsplus_module_9.mapBoth_(io, e => tsplus_module_4.some(e), a => tsplus_module_5.single(a), fileName_1 + ":104:19"));
    },

    fromEffectChunk(io, __tsplusTrace) {
      return this(tsplus_module_10.mapError_(io, e => tsplus_module_4.some(e), fileName_1 + ":115:30"));
    },

    halt(cause, __tsplusTrace) {
      return this(tsplus_module_12.failCause(() => tsplus_module_11.map_(cause, e => tsplus_module_4.some(e)), fileName_1 + ":118:35"));
    },

    single(a, __tsplusTrace) {
      return this(tsplus_module_1.succeedNow(tsplus_module_5.single(a), fileName_1 + ":121:36"));
    }

  };
  return Object.assign(fn, ops);
}
//# sourceMappingURL=Emit.mjs.map