"use strict";
/* Socket Lib - Built with esbuild */
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var packages_exports = {};
__export(packages_exports, {
  AT_LATEST: () => AT_LATEST,
  LATEST: () => LATEST,
  PACKAGE: () => PACKAGE,
  PACKAGE_DEFAULT_VERSION: () => PACKAGE_DEFAULT_VERSION,
  getLifecycleScriptNames: () => getLifecycleScriptNames,
  getNpmLifecycleEvent: () => getNpmLifecycleEvent,
  getPackageDefaultNodeRange: () => getPackageDefaultNodeRange,
  getPackageDefaultSocketCategories: () => getPackageDefaultSocketCategories,
  getPackageExtensions: () => getPackageExtensions,
  getPackumentCache: () => getPackumentCache,
  getPacoteCachePath: () => getPacoteCachePath
});
module.exports = __toCommonJS(packages_exports);
var import_npm = require("../env/npm");
let _lifecycleScriptNames;
let _packageDefaultNodeRange;
let _packageDefaultSocketCategories;
let _packageExtensions;
let _pacoteCachePath;
let _packumentCache;
const PACKAGE = "package";
const AT_LATEST = "@latest";
const LATEST = "latest";
const PACKAGE_DEFAULT_VERSION = "1.0.0";
function getPackageDefaultNodeRange() {
  if (_packageDefaultNodeRange === void 0) {
    _packageDefaultNodeRange = require("../package-default-node-range");
  }
  return _packageDefaultNodeRange;
}
function getPackageDefaultSocketCategories() {
  if (_packageDefaultSocketCategories === void 0) {
    _packageDefaultSocketCategories = require("../package-default-socket-categories");
  }
  return _packageDefaultSocketCategories;
}
function getPackageExtensions() {
  if (_packageExtensions === void 0) {
    const exts = require("../package-extensions");
    _packageExtensions = Object.entries(exts);
  }
  return _packageExtensions;
}
function getNpmLifecycleEvent() {
  return (0, import_npm.getNpmLifecycleEvent)();
}
function getLifecycleScriptNames() {
  if (_lifecycleScriptNames === void 0) {
    const scriptNamesSet = require("../lifecycle-script-names");
    _lifecycleScriptNames = Array.from(scriptNamesSet);
  }
  return _lifecycleScriptNames;
}
function getPackumentCache() {
  if (_packumentCache === void 0) {
    _packumentCache = /* @__PURE__ */ new Map();
  }
  return _packumentCache;
}
function getPacoteCachePath() {
  if (_pacoteCachePath === void 0) {
    try {
      const pacote = require('../external/pacote');
      const { normalizePath } = require("../path");
      const proto = Reflect.getPrototypeOf(
        pacote.RegistryFetcher.prototype
      );
      const PacoteFetcherBase = proto?.constructor;
      const cachePath = PacoteFetcherBase ? new PacoteFetcherBase(
        /*dummy package spec*/
        "x",
        {}
      ).cache : "";
      _pacoteCachePath = normalizePath(cachePath);
    } catch {
      _pacoteCachePath = "";
    }
  }
  return _pacoteCachePath;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AT_LATEST,
  LATEST,
  PACKAGE,
  PACKAGE_DEFAULT_VERSION,
  getLifecycleScriptNames,
  getNpmLifecycleEvent,
  getPackageDefaultNodeRange,
  getPackageDefaultSocketCategories,
  getPackageExtensions,
  getPackumentCache,
  getPacoteCachePath
});
