{"version":3,"sources":["jsdelivr-header.js","/npm/devtools-ignore-webpack-plugin@0.2.0/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,aAMA,MAAM,UAAY,QAAQ,WAGpB,YAAc,aACd,YAAc,yBACpB,SAAS,wBAAwB,GAC7B,OAAO,EAAK,SAAS,mBAAqB,EAAK,SAAS,YAC5D,CACA,SAAS,wBAAwB,GAC7B,OAAO,EAAK,SAAS,OACzB,CAMA,MAAM,qBACF,WAAA,CAAY,EAAU,CAAC,GACnB,IAAI,EAAI,EACR,KAAK,QAAU,CACX,iBAAsD,QAAnC,EAAK,EAAQ,wBAAqC,IAAP,EAAgB,EAAK,wBACnF,iBAAsD,QAAnC,EAAK,EAAQ,wBAAqC,IAAP,EAAgB,EAAK,wBAE3F,CACA,KAAA,CAAM,GACF,MAAM,UAAE,GAAc,EAAS,QAAQ,QACvC,EAAS,MAAM,YAAY,IAAI,aAAc,IACzC,EAAY,MAAM,cAAc,IAAI,CAChC,KAAM,YACN,MAAO,UAAU,YAAY,iCAC7B,kBAAkB,IAClB,IACA,IAAK,MAAO,EAAM,KAAU,OAAO,QAAQ,GAAS,CAIhD,IAAK,KAAK,QAAQ,iBAAiB,GAE/B,SAEJ,MAAM,EAAa,EAAM,SAAS,WAClC,IAAK,EACD,SAEJ,MAAM,EAAM,KAAK,MAAM,GACjB,EAAa,GACnB,IAAK,MAAO,EAAO,KAAS,EAAI,QAAQ,UAChC,KAAK,QAAQ,iBAAiB,IAC9B,EAAW,KAAK,GAGxB,EAAI,aAAe,EACnB,EAAY,YAAY,EAAM,IAAI,EAAU,KAAK,UAAU,IAC/D,IACF,GAEV,EAGJ,qBAAqB,QAAU,qBAC/B,OAAO,QAAU","file":"/npm/devtools-ignore-webpack-plugin@0.2.0/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/devtools-ignore-webpack-plugin@0.2.0/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n/**\n * This source code is based on a webpack plugin from the Angular CLI project\n * https://github.com/angular/angular-cli/blob/f3087dc4343f0dac26ffd7c633e7dcf3618db2b7/packages/angular_devkit/build_angular/src/webpack/plugins/devtools-ignore-plugin.ts\n * which is licensed under MIT.\n */\nconst webpack_1 = require(\"webpack\");\n// Following the naming conventions from\n// https://tc39.es/source-map/#source-map-format\nconst IGNORE_LIST = \"ignoreList\";\nconst PLUGIN_NAME = \"devtools-ignore-plugin\";\nfunction defaultShouldIgnorePath(path) {\n    return path.includes(\"/node_modules/\") || path.includes(\"/webpack/\");\n}\nfunction defaultIsSourceMapAsset(name) {\n    return name.endsWith(\".map\");\n}\n/**\n * This plugin adds a field to source maps that identifies which sources are\n * vendored or runtime-injected (aka third-party) sources. These are consumed by\n * Chrome DevTools to automatically ignore-list sources.\n */\nclass DevToolsIgnorePlugin {\n    constructor(options = {}) {\n        var _a, _b;\n        this.options = {\n            shouldIgnorePath: (_a = options.shouldIgnorePath) !== null && _a !== void 0 ? _a : defaultShouldIgnorePath,\n            isSourceMapAsset: (_b = options.isSourceMapAsset) !== null && _b !== void 0 ? _b : defaultIsSourceMapAsset,\n        };\n    }\n    apply(compiler) {\n        const { RawSource } = compiler.webpack.sources;\n        compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation) => {\n            compilation.hooks.processAssets.tap({\n                name: PLUGIN_NAME,\n                stage: webpack_1.Compilation.PROCESS_ASSETS_STAGE_DEV_TOOLING,\n                additionalAssets: true,\n            }, (assets) => {\n                for (const [name, asset] of Object.entries(assets)) {\n                    // Instead of using `asset.map()` to fetch the source maps from\n                    // SourceMapSource assets, process them directly as a RawSource.\n                    // This is because `.map()` is slow and can take several seconds.\n                    if (!this.options.isSourceMapAsset(name)) {\n                        // Ignore non source map files.\n                        continue;\n                    }\n                    const mapContent = asset.source().toString();\n                    if (!mapContent) {\n                        continue;\n                    }\n                    const map = JSON.parse(mapContent);\n                    const ignoreList = [];\n                    for (const [index, path] of map.sources.entries()) {\n                        if (this.options.shouldIgnorePath(path)) {\n                            ignoreList.push(index);\n                        }\n                    }\n                    map[IGNORE_LIST] = ignoreList;\n                    compilation.updateAsset(name, new RawSource(JSON.stringify(map)));\n                }\n            });\n        });\n    }\n}\n// @ts-ignore: a hack to make it work for both CommonJS and ES modules\nDevToolsIgnorePlugin.default = DevToolsIgnorePlugin;\nmodule.exports = DevToolsIgnorePlugin;\n"]}