import { symbol as symbol$1, equals } from "./dist-esm-Equal.js";
import { symbol, cached, random, structure } from "./dist-esm-Hash.js";
import { pipeArguments } from "./dist-esm-Pipeable.js";
import { SingleShotGen, YieldWrap } from "./dist-esm-Utils.js";
import { getCurrentVersion } from "./dist-esm-internal-version.js";
const EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
const StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
const SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
const ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
const effectVariance = {
  /* c8 ignore next */
  _R: (_) => _,
  /* c8 ignore next */
  _E: (_) => _,
  /* c8 ignore next */
  _A: (_) => _,
  _V: /* @__PURE__ */ getCurrentVersion()
};
const sinkVariance = {
  /* c8 ignore next */
  _A: (_) => _,
  /* c8 ignore next */
  _In: (_) => _,
  /* c8 ignore next */
  _L: (_) => _,
  /* c8 ignore next */
  _E: (_) => _,
  /* c8 ignore next */
  _R: (_) => _
};
const channelVariance = {
  /* c8 ignore next */
  _Env: (_) => _,
  /* c8 ignore next */
  _InErr: (_) => _,
  /* c8 ignore next */
  _InElem: (_) => _,
  /* c8 ignore next */
  _InDone: (_) => _,
  /* c8 ignore next */
  _OutErr: (_) => _,
  /* c8 ignore next */
  _OutElem: (_) => _,
  /* c8 ignore next */
  _OutDone: (_) => _
};
const EffectPrototype = {
  [EffectTypeId]: effectVariance,
  [StreamTypeId]: effectVariance,
  [SinkTypeId]: sinkVariance,
  [ChannelTypeId]: channelVariance,
  [symbol$1](that) {
    return this === that;
  },
  [symbol]() {
    return cached(this, random(this));
  },
  [Symbol.iterator]() {
    return new SingleShotGen(new YieldWrap(this));
  },
  pipe() {
    return pipeArguments(this, arguments);
  }
};
const StructuralPrototype = {
  [symbol]() {
    return cached(this, structure(this));
  },
  [symbol$1](that) {
    const selfKeys = Object.keys(this);
    const thatKeys = Object.keys(that);
    if (selfKeys.length !== thatKeys.length) {
      return false;
    }
    for (const key of selfKeys) {
      if (!(key in that && equals(this[key], that[key]))) {
        return false;
      }
    }
    return true;
  }
};
({
  ...StructuralPrototype
});
export {
  ChannelTypeId,
  EffectPrototype,
  EffectTypeId,
  SinkTypeId,
  StreamTypeId,
  StructuralPrototype,
  effectVariance
};
//# sourceMappingURL=dist-esm-internal-effectable.js.map
