import * as tsplus_module_1 from "@tsplus/stdlib/io/Eval/run";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/HashSet/make";
import * as tsplus_module_3 from "@tsplus/stdlib/io/Eval/succeed";
import * as tsplus_module_4 from "@tsplus/stdlib/collections/HashSet/from";
import * as tsplus_module_5 from "@tsplus/stdlib/collections/HashSet/empty";
import * as tsplus_module_6 from "@tsplus/stdlib/collections/HashSet/union";
import * as tsplus_module_7 from "@tsplus/stdlib/io/Eval/suspend";
import * as tsplus_module_8 from "@tsplus/stdlib/io/Eval/zipWith";
import { realFiberId } from "@effect/core/io/FiberId/definition";
/**
 * Get the set of identifiers for this `FiberId`.
 *
 * @tsplus getter ets/FiberId ids
 */

export function ids(self) {
  return tsplus_module_1.run(idsSafe(self));
}

function idsSafe(self) {
  void 0;

  switch (self._tag) {
    case "None":
      {
        return tsplus_module_3.succeed(() => tsplus_module_2.make());
      }

    case "Runtime":
      {
        return tsplus_module_3.succeed(() => tsplus_module_4.from([self.id]));
      }

    case "Composite":
      {
        let base = tsplus_module_3.succeed(() => tsplus_module_5.empty());

        for (const fiberId of self.fiberIds) {
          base = tsplus_module_8.zipWith_(tsplus_module_7.suspend(() => idsSafe(fiberId)), () => base, (a, b) => tsplus_module_6.union_(a, b));
        }

        return base;
      }
  }
}
//# sourceMappingURL=ids.mjs.map