"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_node_path = require('../node/path.js');
const require_paths_socket = require('../paths/socket.js');

//#region src/fs/_internal.ts
/**
* @file Private state shared between `fs/safe` and `fs/path-cache`. The `_`
*   prefix keeps this module out of the generated package.json `exports` map
*   (the `dist/**\/_*` ignore pattern in
*   `scripts/fix/generate-package-exports.mts` filters it out), so it is not
*   part of the public surface — it exists only to give the two leaves above a
*   common owner for the allowed-directory cache. The cache is invalidated by
*   `invalidatePathCache()` in `fs/path-cache.ts` whenever paths are rewired in
*   tests (`paths/rewire.ts` registers `invalidatePathCache` as one of its
*   cache callbacks); `getAllowedDirectories()` rehydrates on next call.
*/
let _cachedAllowedDirs;
/**
* Clear the cached allowed-directories list. Used by `invalidatePathCache()`
* when test path rewiring changes any of the underlying paths so the next read
* picks up the new resolved values.
*/
function clearAllowedDirectories() {
	_cachedAllowedDirs = void 0;
}
/**
* Get resolved allowed directories for safe deletion with lazy caching. These
* directories are resolved once and cached for the process lifetime.
*/
function getAllowedDirectories() {
	if (_cachedAllowedDirs === void 0) {
		const path = /* @__PURE__ */ require_node_path.getNodePath();
		_cachedAllowedDirs = [
			path.resolve(require_paths_socket.getOsTmpDir()),
			path.resolve(require_paths_socket.getSocketCacacheDir()),
			path.resolve(require_paths_socket.getSocketUserDir())
		];
	}
	return _cachedAllowedDirs;
}

//#endregion
exports.clearAllowedDirectories = clearAllowedDirectories;
exports.getAllowedDirectories = getAllowedDirectories;