"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_primordials_map_set = require('../primordials/map-set.js');

//#region src/temporal/slots.ts
/**
* @file Internal-slot machinery for Temporal objects. The TC39 Temporal spec
*   models per-object state as non-introspectable internal slots —
*   `[[InitializedTemporalInstant]]`, `[[Nanoseconds]]`,
*   `[[InitializedTemporalDuration]]`, etc. Slots are not observable via
*   property access, `Reflect`, or iteration. Slot presence is the spec's
*   identity check, distinct from `instanceof` (which coincides on
*   freshly-constructed instances but diverges under
*   `Object.create(C.prototype)`, where instanceof passes but slots are
*   absent). One `WeakMap` per slot, or `WeakSet` for boolean presence.
*   Receiver is the key. `WeakMap` semantics keep slot storage out of the GC
*   graph, matching the spec's "internal slot" wording. Spec reference:
*   https://tc39.es/proposal-temporal/ — search for
*   `[[InitializedTemporalInstant]]` and `RequireInternalSlot`. Reference impl:
*   js-temporal/temporal-polyfill `lib/slots.ts` (pinned commit in README.md).
*/
const _initializedInstant = new require_primordials_map_set.WeakSetCtor();
const _instantNanoseconds = new require_primordials_map_set.WeakMapCtor();
/**
* Read `[[Nanoseconds]]`. Caller MUST gate on `hasInstantSlot` first; behaviour
* on absent-slot input is undefined.
*/
function getInstantNanoseconds(o) {
	return _instantNanoseconds.get(o);
}
/**
* Spec's `RequireInternalSlot(O, [[InitializedTemporalInstant]])` predicate.
* Returns false for non-object inputs.
*/
function hasInstantSlot(o) {
	return typeof o === "object" && o !== null && _initializedInstant.has(o);
}
/**
* Install `[[InitializedTemporalInstant]]` and `[[Nanoseconds]]` on a receiver.
* Caller is responsible for range-validating `nanoseconds` against
* `IsValidEpochNanoseconds` first; this function does not.
*/
function setInstantSlots(o, nanoseconds) {
	_initializedInstant.add(o);
	_instantNanoseconds.set(o, nanoseconds);
}

//#endregion
exports.getInstantNanoseconds = getInstantNanoseconds;
exports.hasInstantSlot = hasInstantSlot;
exports.setInstantSlots = setInstantSlots;