{"version":3,"sources":["jsdelivr-header.js","/npm/hashedmoduleidsplugin@1.0.0/HashedModuleIdsPlugin.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACFA,aACA,MAAM,WAAa,QAAQ,UAAU,WAErC,MAAM,sBACF,WAAA,CAAY,GACR,KAAK,QAAU,OAAO,OAAO,CACzB,aAAc,MACd,WAAY,SACZ,iBAAkB,GACnB,EACP,CAEA,KAAA,CAAM,GACF,MAAM,EAAU,KAAK,QACrB,EAAS,OAAO,eAAgB,IAC5B,MAAM,EAAU,IAAI,IACpB,EAAY,OAAO,qBAAsB,IACrC,EAAQ,SAAS,IACb,GAAiB,OAAd,EAAO,IAAe,EAAO,SAAU,CACtC,MAAM,EAAK,EAAO,SAAS,CACvB,QAAS,KAAK,QAAQ,SAAW,EAAS,QAAQ,UAEhD,EAAO,WAAW,EAAQ,cAChC,EAAK,OAAO,GACZ,MAAM,EAAS,EAAK,OAAO,EAAQ,YACnC,IAAI,EAAM,EAAQ,iBAClB,KAAM,EAAQ,IAAI,EAAO,OAAO,EAAG,KAC/B,IACJ,EAAO,GAAK,EAAO,OAAO,EAAG,GAC7B,EAAQ,IAAI,EAAO,GACvB,IACF,GACJ,GAEV,EAGJ,OAAO,QAAU","file":"/npm/hashedmoduleidsplugin@1.0.0/HashedModuleIdsPlugin.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/hashedmoduleidsplugin@1.0.0/HashedModuleIdsPlugin.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*\r\n    MIT License http://www.opensource.org/licenses/mit-license.php\r\n    Author Tobias Koppers @sokra\r\n*/\r\n\"use strict\";\r\nconst createHash = require(\"crypto\").createHash;\r\n\r\nclass HashedModuleIdsPlugin {\r\n    constructor(options) {\r\n        this.options = Object.assign({\r\n            hashFunction: \"md5\",\r\n            hashDigest: \"base64\",\r\n            hashDigestLength: 4\r\n        }, options);\r\n    }\r\n\r\n    apply(compiler) {\r\n        const options = this.options;\r\n        compiler.plugin(\"compilation\", (compilation) => {\r\n            const usedIds = new Set();\r\n            compilation.plugin(\"before-module-ids\", (modules) => {\r\n                modules.forEach((module) => {\r\n                    if(module.id === null && module.libIdent) {\r\n                        const id = module.libIdent({\r\n                            context: this.options.context || compiler.options.context\r\n                        });\r\n                        const hash = createHash(options.hashFunction);\r\n                        hash.update(id);\r\n                        const hashId = hash.digest(options.hashDigest);\r\n                        let len = options.hashDigestLength;\r\n                        while(usedIds.has(hashId.substr(0, len)))\r\n                            len++;\r\n                        module.id = hashId.substr(0, len);\r\n                        usedIds.add(module.id);\r\n                    }\r\n                });\r\n            });\r\n        });\r\n    }\r\n}\r\n\r\nmodule.exports = HashedModuleIdsPlugin;"]}