import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/head";
import * as tsplus_module_2 from "@tsplus/stdlib/collections/SortedMap/headMaybe";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/map";
import * as tsplus_module_4 from "@tsplus/stdlib/data/Maybe/flatMap";
import * as tsplus_module_5 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_6 from "@effect/core/stm/TRef/operations/modify";
import { concreteTPriorityQueue } from "@effect/core/stm/TPriorityQueue/operations/_internal/InternalTPriorityQueue";
/**
 * Peeks at the first value in the queue without removing it, returning `None`
 * if there is not a value in the queue.
 *
 * @tsplus getter ets/TPriorityQueue peekMaybe
 */

export function peekMaybe(self) {
  void 0;
  return tsplus_module_6.modify_(self.map, map => tsplus_module_5.make(tsplus_module_4.flatMap_(tsplus_module_3.map_(tsplus_module_2.headMaybe(map), tuple => tuple.get(1)), chunk => tsplus_module_1.head(chunk)), map));
}
//# sourceMappingURL=peekMaybe.mjs.map