const { ErrorCtor: _p_ErrorCtor } = require('../primordials/error.js')
const { SetCtor: _p_SetCtor } = require('../primordials/map-set.js')

const { ObjectAssign: _p_ObjectAssign, ObjectKeys: _p_ObjectKeys, ObjectValues: _p_ObjectValues } = require('../primordials/object.js')

"use strict";
/**
 * Bundled from libnpmexec
 * This is a zero-dependency bundle created by rolldown.
 */
'use strict';

//#region \0rolldown/runtime.js
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
	value,
	configurable: true
});
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);

//#endregion

//#region node_modules/.pnpm/libnpmexec@10.2.3_supports-color@10.2.2/node_modules/libnpmexec/lib/get-bin-from-manifest.js
var require_get_bin_from_manifest = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	const getBinFromManifest = (mani) => {
		const bin = mani.bin || {};
		if (new _p_SetCtor(_p_ObjectValues(bin)).size === 1) return _p_ObjectKeys(bin)[0];
		const name = mani.name.replace(/^@[^/]+\//, "");
		if (bin[name]) return name;
		throw _p_ObjectAssign(/* @__PURE__ */ new _p_ErrorCtor("could not determine executable to run"), { pkgid: mani._id });
	};
	module.exports = getBinFromManifest;
}));

//#endregion
//#region src/external/libnpmexec.js
const getBinFromManifest = require_get_bin_from_manifest();
module.exports = { getBinFromManifest };

//#endregion