/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@11ty/dependency-tree@4.0.2/main.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
const path=require("node:path"),{TemplatePath:TemplatePath}=require("@11ty/eleventy-utils");function getAbsolutePath(e){let t=path.normalize(e);return e.startsWith("./")?path.join(path.resolve("."),t):t}function getRelativePath(e){let t=path.normalize(e),o=path.resolve(".");return"./"+(t.startsWith(o)?t.substr(o.length+1):t)}function getNodeModuleName(e){let t=!1,o=[],n=e.split(path.sep);for(let e of n){if(".pnpm"===e&&(t=!1),t&&(o.push(e),!e.startsWith("@")))return o.join("/");"node_modules"===e&&(t=!0)}return!1}function getDependenciesFor(e,t,o={}){"nodeModuleNamesOnly"in o&&!("nodeModuleNames"in o)&&(!0===o.nodeModuleNamesOnly&&(o.nodeModuleNames="only"),!1===o.nodeModuleNamesOnly&&(o.nodeModuleNames="exclude"));let n,l=Object.assign({allowNotFound:!1,nodeModuleNames:"exclude"},o),a=getAbsolutePath(e),r=new Set;try{let t=require(a);("Module"===t[Symbol.toStringTag]||t.__esModule)&&r.add(e)}catch(e){if("MODULE_NOT_FOUND"!==e.code||!l.allowNotFound)throw e}for(let e in require.cache)if(e===a){n=require.cache[e];break}let d=new Set;if(n){let e=getRelativePath(n.filename);if(t?"only"!==l.nodeModuleNames&&d.add(e):t={},t[e]=!0,Array.isArray(n.children)&&n.children.length>0)for(let e of n.children){let o=getRelativePath(e.filename),n=getNodeModuleName(e.filename);if("exclude"!==l.nodeModuleNames&&n&&d.add(n),!1===n&&!d.has(o)&&!t[o]){let{commonjs:e,esm:n}=getDependenciesFor(o,t,l);for(let t of e)d.add(t);for(let e of n)r.add(e)}}}else if(!l.allowNotFound)throw new Error(`Could not find ${e} in @11ty/dependency-tree`);return{esm:r,commonjs:d}}function normalizeList(e){return Array.from(e).map((e=>e.startsWith("./")?TemplatePath.standardizeFilePath(e):e))}function getCleanDependencyListFor(e,t={}){let{commonjs:o}=getDependenciesFor(e,null,t);return normalizeList(o)}function getCleanDependencyListByTypeFor(e,t={}){let{commonjs:o,esm:n}=getDependenciesFor(e,null,t);return{commonjs:normalizeList(o),esm:normalizeList(n)}}module.exports=getCleanDependencyListFor,module.exports.getPackagesByType=getCleanDependencyListByTypeFor,module.exports.getNodeModuleName=getNodeModuleName;
//# sourceMappingURL=/sm/d3dcead3bc386c93f4d80b9aafb4e2e21db66e7cda63112a76f1c7f0ad2ebd1f.map