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AAC,GAC7E,QACA,gBACI,EAAmD,EAA6C,EAAW,cAAgB,OAGvI,EAEF,aAAa,aAAe,aAC5B,aAAa,eAAiB,eAC9B,aAAa,UAAY,UACzB,aAAa,cAAgB,cAC7B,aAAa,WAAa,WAC1B,aAAa,mBAAqB,mBAClC,aAAa,cAAgB,cAC7B,aAAa,sBAAwB,sBACrC,aAAa,eAAiB,eAC9B,aAAa,cAAgB,cAC7B,aAAa,WAAa,WAC1B,aAAa,eAAiB,eAC9B,aAAa,iBAAmB,iBAChC,aAAa,mBAAqB,mBAClC,aAAa,aAAe,aAC5B,OAAO,QAAU","file":"/npm/terser-webpack-plugin@5.6.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /npm/terser-webpack-plugin@5.6.1/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\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst {\n  validate\n} = require(\"schema-utils\");\nconst {\n  minify\n} = require(\"./minify\");\nconst schema = require(\"./options.json\");\nconst {\n  cleanCssMinify,\n  cssnanoMinify,\n  cssoMinify,\n  esbuildMinify,\n  esbuildMinifyCss,\n  getEcmaVersion,\n  htmlMinifierTerser,\n  jsonMinify,\n  lightningCssMinify,\n  memoize,\n  minifyHtmlNode,\n  swcMinify,\n  swcMinifyCss,\n  swcMinifyHtml,\n  swcMinifyHtmlFragment,\n  terserMinify,\n  throttleAll,\n  uglifyJsMinify\n} = require(\"./utils\");\n\n/** @typedef {import(\"schema-utils/declarations/validate\").Schema} Schema */\n/** @typedef {import(\"webpack\").Compiler} Compiler */\n/** @typedef {import(\"webpack\").Compilation} Compilation */\n/** @typedef {import(\"webpack\").Asset} Asset */\n/** @typedef {import(\"webpack\").AssetInfo} AssetInfo */\n/** @typedef {import(\"webpack\").TemplatePath} TemplatePath */\n/** @typedef {import(\"jest-worker\").Worker} JestWorker */\n/** @typedef {import(\"@jridgewell/trace-mapping\").EncodedSourceMap & { sources: string[], sourcesContent?: string[], file: string }} RawSourceMap */\n/** @typedef {import(\"@jridgewell/trace-mapping\").TraceMap} TraceMap */\n\n/** @typedef {RegExp | string} Rule */\n/** @typedef {Rule[] | Rule} Rules */\n\n// eslint-disable-next-line jsdoc/reject-any-type\n/** @typedef {any} EXPECTED_ANY */\n// eslint-disable-next-line jsdoc/require-property\n/** @typedef {object} EXPECTED_OBJECT */\n\n/**\n * @callback ExtractCommentsFunction\n * @param {EXPECTED_ANY} astNode ast Node\n * @param {{ value: string, type: \"comment1\" | \"comment2\" | \"comment3\" | \"comment4\", pos: number, line: number, col: number }} comment comment node\n * @returns {boolean} true when need to extract comment, otherwise false\n */\n\n/**\n * @typedef {boolean | \"all\" | \"some\" | RegExp | ExtractCommentsFunction} ExtractCommentsCondition\n */\n\n/**\n * @typedef {TemplatePath} ExtractCommentsFilename\n */\n\n/**\n * @typedef {boolean | string | ((commentsFile: string) => string)} ExtractCommentsBanner\n */\n\n/**\n * @typedef {object} ExtractCommentsObject\n * @property {ExtractCommentsCondition=} condition condition which comments need to be expected\n * @property {ExtractCommentsFilename=} filename filename for extracted comments\n * @property {ExtractCommentsBanner=} banner banner in filename for extracted comments\n */\n\n/**\n * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions\n */\n\n/**\n * @typedef {object} ErrorObject\n * @property {string} message message\n * @property {number=} line line number\n * @property {number=} column column number\n * @property {string=} stack error stack trace\n */\n\n/**\n * @typedef {object} MinimizedResult\n * @property {string=} code code\n * @property {RawSourceMap=} map source map\n * @property {(Error | string)[]=} errors errors\n * @property {(Error | string)[]=} warnings warnings\n * @property {string[]=} extractedComments extracted comments\n */\n\n/**\n * @typedef {{ [file: string]: string }} Input\n */\n\n/**\n * @typedef {{ [key: string]: EXPECTED_ANY }} CustomOptions\n */\n\n/**\n * @template T\n * @typedef {T extends infer U ? U : CustomOptions} InferDefaultType\n */\n\n/**\n * @template T\n * @typedef {T extends EXPECTED_ANY[] ? { [P in keyof T]?: T[P] & InferDefaultType<T[P]> } : T & InferDefaultType<T>} MinimizerOptions\n */\n\n/**\n * @template T\n * @callback BasicMinimizerImplementation\n * @param {Input} input\n * @param {RawSourceMap | undefined} sourceMap\n * @param {MinimizerOptions<T>} minifyOptions\n * @param {ExtractCommentsOptions | undefined} extractComments\n * @returns {Promise<MinimizedResult> | MinimizedResult}\n */\n\n/**\n * @typedef {object} MinimizeFunctionHelpers\n * @property {() => string | undefined=} getMinimizerVersion function that returns version of minimizer\n * @property {() => boolean | undefined=} supportsWorkerThreads true when minimizer support worker threads, otherwise false\n * @property {() => boolean | undefined=} supportsWorker true when minimizer support worker, otherwise false\n * @property {(name: string, info?: AssetInfo) => boolean | undefined=} filter return true when the minimizer supports the asset, otherwise false. When an array of minimizers is configured, each asset is dispatched only to the minimizers whose `filter` accepts it. Assets rejected by every minimizer in the array are skipped entirely.\n */\n\n/**\n * @template T\n * @typedef {T extends EXPECTED_ANY[] ? { [P in keyof T]: BasicMinimizerImplementation<T[P]> & MinimizeFunctionHelpers } : BasicMinimizerImplementation<T> & MinimizeFunctionHelpers} MinimizerImplementation\n */\n\n/**\n * @template T\n * @typedef {object} InternalOptions\n * @property {string} name name\n * @property {string} input input\n * @property {RawSourceMap | undefined} inputSourceMap input source map\n * @property {ExtractCommentsOptions | undefined} extractComments extract comments option\n * @property {{ implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> }} minimizer minimizer\n * @property {boolean=} module true when code is a EC module, otherwise false\n * @property {number | string=} ecma ecma version\n */\n\n/**\n * @template T\n * @typedef {JestWorker & { transform: (options: string) => Promise<MinimizedResult>, minify: (options: InternalOptions<T>) => Promise<MinimizedResult> }} MinimizerWorker\n */\n\n/**\n * @typedef {undefined | boolean | number} Parallel\n */\n\n/**\n * @typedef {object} BasePluginOptions\n * @property {Rules=} test test rule\n * @property {Rules=} include include rile\n * @property {Rules=} exclude exclude rule\n * @property {ExtractCommentsOptions=} extractComments extract comments options\n * @property {Parallel=} parallel parallel option\n */\n\n/**\n * @template T\n * @typedef {T extends import(\"terser\").MinifyOptions ? { minify?: MinimizerImplementation<T> | undefined, minimizerOptions?: MinimizerOptions<T> | undefined, terserOptions?: MinimizerOptions<T> | undefined } : { minify: MinimizerImplementation<T>, minimizerOptions?: MinimizerOptions<T> | undefined, terserOptions?: MinimizerOptions<T> | undefined }} DefinedDefaultMinimizerAndOptions\n */\n\n/**\n * @template T\n * @typedef {BasePluginOptions & { minimizer: { implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> } }} InternalPluginOptions\n */\n\nconst getTraceMapping = memoize(() => require(\"@jridgewell/trace-mapping\"));\nconst getSerializeJavascript = memoize(() => require(\"./serialize-javascript\"));\n\n/**\n * @template [T=import(\"terser\").MinifyOptions]\n */\nclass TerserPlugin {\n  /**\n   * @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>=} options options\n   */\n  constructor(options) {\n    validate(/** @type {Schema} */schema, options || {}, {\n      name: \"Terser Plugin\",\n      baseDataPath: \"options\"\n    });\n\n    // TODO handle json and etc in the next major release\n    // TODO make `minimizer` option instead `minify` and `terserOptions` in the next major release, also rename `terserMinify` to `terserMinimize`\n    const {\n      minify = (/** @type {MinimizerImplementation<T>} */\n      /** @type {unknown} */terserMinify),\n      minimizerOptions,\n      terserOptions,\n      test = /\\.[cm]?js(\\?.*)?$/i,\n      extractComments = true,\n      parallel = true,\n      include,\n      exclude\n    } = options || {};\n\n    // `terserOptions` is a deprecated alias of `minimizerOptions`; prefer the\n    // new name when both are provided.\n    const resolvedMinimizerOptions = /** @type {MinimizerOptions<T>} */\n\n    typeof minimizerOptions !== \"undefined\" ? minimizerOptions : terserOptions || {};\n\n    /**\n     * @private\n     * @type {InternalPluginOptions<T>}\n     */\n    this.options = {\n      test,\n      extractComments,\n      parallel,\n      include,\n      exclude,\n      minimizer: {\n        implementation: minify,\n        options: resolvedMinimizerOptions\n      }\n    };\n  }\n\n  /**\n   * @private\n   * @param {unknown} input Input to check\n   * @returns {boolean} Whether input is a source map\n   */\n  static isSourceMap(input) {\n    // All required options for `new TraceMap(...options)`\n    // https://github.com/jridgewell/trace-mapping#usage\n    return Boolean(input && typeof input === \"object\" && input !== null && \"version\" in input && \"sources\" in input && Array.isArray(input.sources) && \"mappings\" in input && typeof input.mappings === \"string\");\n  }\n\n  /**\n   * @private\n   * @param {unknown} warning warning\n   * @param {string} file file\n   * @returns {Error} built warning\n   */\n  static buildWarning(warning, file) {\n    /**\n     * @type {Error & { hideStack: true, file: string }}\n     */\n    // @ts-expect-error\n    const builtWarning = new Error(warning.toString());\n    builtWarning.name = \"Warning\";\n    builtWarning.hideStack = true;\n    builtWarning.file = file;\n    return builtWarning;\n  }\n\n  /**\n   * @private\n   * @param {Error | ErrorObject | string} error error\n   * @param {string} file file\n   * @param {TraceMap=} sourceMap source map\n   * @param {Compilation[\"requestShortener\"]=} requestShortener request shortener\n   * @returns {Error} built error\n   */\n  static buildError(error, file, sourceMap, requestShortener) {\n    /**\n     * @type {Error & { file?: string }}\n     */\n    let builtError;\n    if (typeof error === \"string\") {\n      builtError = new Error(`${file} from Terser plugin\\n${error}`);\n      builtError.file = file;\n      return builtError;\n    }\n    if (/** @type {ErrorObject} */error.line) {\n      const {\n        line,\n        column\n      } = /** @type {ErrorObject & { line: number, column: number }} */error;\n      const original = sourceMap && getTraceMapping().originalPositionFor(sourceMap, {\n        line,\n        column\n      });\n      if (original && original.source && requestShortener) {\n        builtError = new Error(`${file} from Terser plugin\\n${error.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${line},${column}]${error.stack ? `\\n${error.stack.split(\"\\n\").slice(1).join(\"\\n\")}` : \"\"}`);\n        builtError.file = file;\n        return builtError;\n      }\n      builtError = new Error(`${file} from Terser plugin\\n${error.message} [${file}:${line},${column}]${error.stack ? `\\n${error.stack.split(\"\\n\").slice(1).join(\"\\n\")}` : \"\"}`);\n      builtError.file = file;\n      return builtError;\n    }\n    if (error.stack) {\n      builtError = new Error(`${file} from Terser plugin\\n${typeof error.message !== \"undefined\" ? error.message : \"\"}\\n${error.stack}`);\n      builtError.file = file;\n      return builtError;\n    }\n    builtError = new Error(`${file} from Terser plugin\\n${error.message}`);\n    builtError.file = file;\n    return builtError;\n  }\n\n  /**\n   * @private\n   * @param {Parallel} parallel value of the `parallel` option\n   * @returns {number} number of cores for parallelism\n   */\n  static getAvailableNumberOfCores(parallel) {\n    // In some cases cpus() returns undefined\n    // https://github.com/nodejs/node/issues/19022\n    const cpus =\n    // eslint-disable-next-line n/no-unsupported-features/node-builtins\n    typeof os.availableParallelism === \"function\" ?\n    // eslint-disable-next-line n/no-unsupported-features/node-builtins\n    {\n      length: os.availableParallelism()\n    } : os.cpus() || {\n      length: 1\n    };\n    return parallel === true || typeof parallel === \"undefined\" ? cpus.length - 1 : Math.min(parallel || 0, cpus.length - 1);\n  }\n\n  /**\n   * @private\n   * @param {Compiler} compiler compiler\n   * @param {Compilation} compilation compilation\n   * @param {Record<string, import(\"webpack\").sources.Source>} assets assets\n   * @param {{ availableNumberOfCores: number }} optimizeOptions optimize options\n   * @returns {Promise<void>}\n   */\n  async optimize(compiler, compilation, assets, optimizeOptions) {\n    const cache = compilation.getCache(\"TerserWebpackPlugin\");\n    let numberOfAssets = 0;\n\n    // Normalize the implementation list to an array so dispatch and the\n    // worker-pool capability checks below can iterate uniformly. The\n    // original shape on `this.options.minimizer.implementation` is preserved\n    // for chunk hashing.\n    const implementations = Array.isArray(this.options.minimizer.implementation) ? this.options.minimizer.implementation : [this.options.minimizer.implementation];\n\n    /**\n     * Collect the indices of minimizers whose `filter` accepts `name`.\n     * Filters returning `undefined` are treated as accept (matches the\n     * convention used by `supportsWorkerThreads`).\n     * @param {string} name asset name\n     * @param {AssetInfo} info asset info\n     * @returns {number[]} indices into `implementations` that accept the asset\n     */\n    const matchingMinimizers = (name, info) => {\n      const matched = [];\n      for (let i = 0; i < implementations.length; i++) {\n        const impl = implementations[i];\n        if (typeof impl.filter !== \"function\" ||\n        // eslint-disable-next-line unicorn/no-array-method-this-argument\n        impl.filter(name, info) !== false) {\n          matched.push(i);\n        }\n      }\n      return matched;\n    };\n    /** @type {Map<string, number[]>} */\n    const matchedByName = new Map();\n    const assetsForMinify = await Promise.all(Object.keys(assets).filter(name => {\n      const {\n        info\n      } = /** @type {Asset} */compilation.getAsset(name);\n      if (\n      // Skip double minimize assets from child compilation\n      info.minimized ||\n      // Skip minimizing for extracted comments assets\n      info.extractedComments) {\n        return false;\n      }\n      if (!compiler.webpack.ModuleFilenameHelpers.matchObject.bind(undefined, this.options)(name)) {\n        return false;\n      }\n\n      // Compute the matching minimizers once and carry the result to the\n      // per-asset task via `matchedByName` so the regexes don't run again.\n      const matched = matchingMinimizers(name, info);\n      if (matched.length === 0) {\n        return false;\n      }\n      matchedByName.set(name, matched);\n      return true;\n    }).map(async name => {\n      const {\n        info,\n        source\n      } = /** @type {Asset} */\n      compilation.getAsset(name);\n      const eTag = cache.getLazyHashedEtag(source);\n      const cacheItem = cache.getItemCache(name, eTag);\n      const output = await cacheItem.getPromise();\n      if (!output) {\n        numberOfAssets += 1;\n      }\n      return {\n        name,\n        info,\n        inputSource: source,\n        output,\n        cacheItem,\n        matched: (/** @type {number[]} */matchedByName.get(name))\n      };\n    }));\n    if (assetsForMinify.length === 0) {\n      return;\n    }\n\n    /** @type {undefined | (() => MinimizerWorker<T>)} */\n    let getWorker;\n    /** @type {undefined | MinimizerWorker<T>} */\n    let initializedWorker;\n    /** @type {undefined | number} */\n    let numberOfWorkers;\n    const needCreateWorker = optimizeOptions.availableNumberOfCores > 0 && implementations.every(impl => typeof impl.supportsWorker === \"undefined\" || typeof impl.supportsWorker === \"function\" && impl.supportsWorker());\n    if (needCreateWorker) {\n      // Do not create unnecessary workers when the number of files is less than the available cores, it saves memory\n      numberOfWorkers = Math.min(numberOfAssets, optimizeOptions.availableNumberOfCores);\n      getWorker = () => {\n        if (initializedWorker) {\n          return initializedWorker;\n        }\n        const {\n          Worker\n        } = require(\"jest-worker\");\n        initializedWorker = /** @type {MinimizerWorker<T>} */\n\n        new Worker(require.resolve(\"./minify\"), {\n          numWorkers: numberOfWorkers,\n          enableWorkerThreads: implementations.every(impl => typeof impl.supportsWorkerThreads === \"undefined\" || impl.supportsWorkerThreads() !== false)\n        });\n\n        // https://github.com/facebook/jest/issues/8872#issuecomment-524822081\n        const workerStdout = initializedWorker.getStdout();\n        if (workerStdout) {\n          workerStdout.on(\"data\", chunk => process.stdout.write(chunk));\n        }\n        const workerStderr = initializedWorker.getStderr();\n        if (workerStderr) {\n          workerStderr.on(\"data\", chunk => process.stderr.write(chunk));\n        }\n        return initializedWorker;\n      };\n    }\n    const {\n      SourceMapSource,\n      ConcatSource,\n      RawSource\n    } = compiler.webpack.sources;\n\n    /** @typedef {{ extractedCommentsSource: import(\"webpack\").sources.RawSource, commentsFilename: string }} ExtractedCommentsInfo */\n    /** @type {Map<string, ExtractedCommentsInfo>} */\n    const allExtractedComments = new Map();\n    const scheduledTasks = [];\n    for (const asset of assetsForMinify) {\n      scheduledTasks.push(async () => {\n        const {\n          name,\n          inputSource,\n          info,\n          cacheItem,\n          matched\n        } = asset;\n        let {\n          output\n        } = asset;\n        if (!output) {\n          let input;\n          /** @type {RawSourceMap | undefined} */\n          let inputSourceMap;\n          const {\n            source: sourceFromInputSource,\n            map\n          } = inputSource.sourceAndMap();\n          input = sourceFromInputSource;\n          if (map) {\n            if (!TerserPlugin.isSourceMap(map)) {\n              compilation.warnings.push(new Error(`${name} contains invalid source map`));\n            } else {\n              inputSourceMap = /** @type {RawSourceMap} */map;\n            }\n          }\n          if (Buffer.isBuffer(input)) {\n            input = input.toString();\n          }\n\n          // Dispatch to only the minimizers whose `filter` accepted this\n          // asset (computed once when collecting `assetsForMinify`).\n          // `minify.js` already normalizes a single implementation into a\n          // one-element array, so we always hand it the matching subset.\n          // Options are sliced as references — `minify.js` overlays\n          // `module`/`ecma` without mutating the caller's object.\n          const assetImplementation = /** @type {MinimizerImplementation<T>} */\n          matched.map(i => implementations[i]);\n          const sourceOptions = this.options.minimizer.options;\n          const assetMinimizerOptions = /** @type {MinimizerOptions<T>} */\n\n          Array.isArray(sourceOptions) ? matched.map(i => sourceOptions[i] || {}) : sourceOptions;\n\n          /**\n           * @type {InternalOptions<T>}\n           */\n          const options = {\n            name,\n            input,\n            inputSourceMap,\n            minimizer: {\n              implementation: assetImplementation,\n              options: assetMinimizerOptions\n            },\n            extractComments: this.options.extractComments\n          };\n          if (typeof info.javascriptModule !== \"undefined\") {\n            options.module = info.javascriptModule;\n          } else if (/\\.mjs(\\?.*)?$/i.test(name)) {\n            options.module = true;\n          } else if (/\\.cjs(\\?.*)?$/i.test(name)) {\n            options.module = false;\n          }\n          options.ecma = getEcmaVersion(compiler.options.output.environment);\n          try {\n            output = await (getWorker ? getWorker().transform(getSerializeJavascript()(options)) : minify(options));\n          } catch (error) {\n            const hasSourceMap = inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap);\n            compilation.errors.push(TerserPlugin.buildError(/** @type {Error | ErrorObject | string} */\n            error, name, hasSourceMap ? new (getTraceMapping().TraceMap)(/** @type {RawSourceMap} */\n            inputSourceMap) : undefined, hasSourceMap ? compilation.requestShortener : undefined));\n            return;\n          }\n          if (typeof output.code === \"undefined\") {\n            compilation.errors.push(new Error(`${name} from Terser plugin\\nMinimizer doesn't return result`));\n          }\n          if (output.warnings && output.warnings.length > 0) {\n            output.warnings = output.warnings.map(\n            /**\n             * @param {Error | string} item a warning\n             * @returns {Error} built warning with extra info\n             */\n            item => TerserPlugin.buildWarning(item, name));\n          }\n          if (output.errors && output.errors.length > 0) {\n            const hasSourceMap = inputSourceMap && TerserPlugin.isSourceMap(inputSourceMap);\n            output.errors = output.errors.map(\n            /**\n             * @param {Error | string} item an error\n             * @returns {Error} built error with extra info\n             */\n            item => TerserPlugin.buildError(item, name, hasSourceMap ? new (getTraceMapping().TraceMap)(/** @type {RawSourceMap} */\n            inputSourceMap) : undefined, hasSourceMap ? compilation.requestShortener : undefined));\n          }\n          let shebang;\n\n          // Custom functions can return `undefined` or `null` when the\n          // minimizer only produced warnings, errors or extracted comments\n          if (typeof output.code !== \"undefined\" && output.code !== null) {\n            if (/** @type {ExtractCommentsObject} */\n            this.options.extractComments.banner !== false && output.extractedComments && output.extractedComments.length > 0 && output.code.startsWith(\"#!\")) {\n              const firstNewlinePosition = output.code.indexOf(\"\\n\");\n              shebang = output.code.slice(0, Math.max(0, firstNewlinePosition));\n              output.code = output.code.slice(Math.max(0, firstNewlinePosition + 1));\n            }\n            if (output.map) {\n              output.source = new SourceMapSource(output.code, name, output.map, input, /** @type {RawSourceMap} */\n              inputSourceMap, true);\n            } else {\n              output.source = new RawSource(output.code);\n            }\n          }\n          if (output.extractedComments && output.extractedComments.length > 0) {\n            const commentsFilename = /** @type {ExtractCommentsObject} */\n            this.options.extractComments.filename || \"[file].LICENSE.txt[query]\";\n            let query = \"\";\n            let filename = name;\n            const querySplit = filename.indexOf(\"?\");\n            if (querySplit >= 0) {\n              query = filename.slice(querySplit);\n              filename = filename.slice(0, querySplit);\n            }\n            const lastSlashIndex = filename.lastIndexOf(\"/\");\n            const basename = lastSlashIndex === -1 ? filename : filename.slice(lastSlashIndex + 1);\n            const data = {\n              filename,\n              basename,\n              query\n            };\n            output.commentsFilename = compilation.getPath(commentsFilename, data);\n\n            // Banner only applies when we have a new source to prepend to\n            if (output.source && /** @type {ExtractCommentsObject} */\n            this.options.extractComments.banner !== false) {\n              let banner = /** @type {ExtractCommentsObject} */\n              this.options.extractComments.banner || `For license information please see ${path.relative(path.dirname(name), output.commentsFilename).replace(/\\\\/g, \"/\")}`;\n              if (typeof banner === \"function\") {\n                banner = banner(output.commentsFilename);\n              }\n              if (banner) {\n                output.source = new ConcatSource(shebang ? `${shebang}\\n` : \"\", `/*! ${banner} */\\n`, output.source);\n              }\n            }\n            const extractedCommentsString = output.extractedComments.sort().join(\"\\n\\n\");\n            output.extractedCommentsSource = new RawSource(`${extractedCommentsString}\\n`);\n          }\n          await cacheItem.storePromise({\n            source: output.source,\n            errors: output.errors,\n            warnings: output.warnings,\n            commentsFilename: output.commentsFilename,\n            extractedCommentsSource: output.extractedCommentsSource\n          });\n        }\n        if (output.warnings && output.warnings.length > 0) {\n          for (const warning of output.warnings) {\n            compilation.warnings.push(warning);\n          }\n        }\n        if (output.errors && output.errors.length > 0) {\n          for (const error of output.errors) {\n            compilation.errors.push(error);\n          }\n        }\n\n        // Emit extracted comments file even if the main asset was not\n        // rewritten (some minimizers only produce comments / warnings / errors)\n        if (output.extractedCommentsSource) {\n          allExtractedComments.set(name, {\n            extractedCommentsSource: output.extractedCommentsSource,\n            commentsFilename: (/** @type {string} */output.commentsFilename)\n          });\n        }\n        if (!output.source) {\n          return;\n        }\n\n        /** @type {AssetInfo} */\n        const newInfo = {\n          minimized: true\n        };\n        if (output.extractedCommentsSource) {\n          newInfo.related = {\n            license: (/** @type {string} */output.commentsFilename)\n          };\n        }\n        compilation.updateAsset(name, output.source, newInfo);\n      });\n    }\n    const limit = getWorker && numberOfAssets > 0 ? (/** @type {number} */numberOfWorkers) : scheduledTasks.length;\n    await throttleAll(limit, scheduledTasks);\n    if (initializedWorker) {\n      await initializedWorker.end();\n    }\n\n    /** @typedef {{ source: import(\"webpack\").sources.Source, commentsFilename: string, from: string }} ExtractedCommentsInfoWithFrom */\n    await [...allExtractedComments].sort().reduce(\n    /**\n     * @param {Promise<unknown>} previousPromise previous result\n     * @param {[string, ExtractedCommentsInfo]} extractedComments extracted comments\n     * @returns {Promise<ExtractedCommentsInfoWithFrom>} extract comments with info\n     */\n    async (previousPromise, [from, value]) => {\n      const previous = /** @type {ExtractedCommentsInfoWithFrom | undefined} * */\n      await previousPromise;\n      const {\n        commentsFilename,\n        extractedCommentsSource\n      } = value;\n      if (previous && previous.commentsFilename === commentsFilename) {\n        const {\n          from: previousFrom,\n          source: prevSource\n        } = previous;\n        const mergedName = `${previousFrom}|${from}`;\n        const name = `${commentsFilename}|${mergedName}`;\n        const eTag = [prevSource, extractedCommentsSource].map(item => cache.getLazyHashedEtag(item)).reduce((previousValue, currentValue) => cache.mergeEtags(previousValue, currentValue));\n        let source = await cache.getPromise(name, eTag);\n        if (!source) {\n          source = new ConcatSource([...new Set([... /** @type {string} */prevSource.source().split(\"\\n\\n\"), ... /** @type {string} */extractedCommentsSource.source().split(\"\\n\\n\")])].join(\"\\n\\n\"));\n          await cache.storePromise(name, eTag, source);\n        }\n        compilation.updateAsset(commentsFilename, source);\n        return {\n          source,\n          commentsFilename,\n          from: mergedName\n        };\n      }\n      const existingAsset = compilation.getAsset(commentsFilename);\n      if (existingAsset) {\n        return {\n          source: existingAsset.source,\n          commentsFilename,\n          from: commentsFilename\n        };\n      }\n      compilation.emitAsset(commentsFilename, extractedCommentsSource, {\n        extractedComments: true\n      });\n      return {\n        source: extractedCommentsSource,\n        commentsFilename,\n        from\n      };\n    }, /** @type {Promise<unknown>} */Promise.resolve());\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {void}\n   */\n  apply(compiler) {\n    const pluginName = this.constructor.name;\n    const availableNumberOfCores = TerserPlugin.getAvailableNumberOfCores(this.options.parallel);\n    compiler.hooks.compilation.tap(pluginName, compilation => {\n      const hooks = compiler.webpack.javascript.JavascriptModulesPlugin.getCompilationHooks(compilation);\n      /**\n       * @param {BasicMinimizerImplementation<EXPECTED_ANY> & MinimizeFunctionHelpers} impl implementation\n       * @returns {string} minimizer version or \"0.0.0\"\n       */\n      const getVersion = impl => typeof impl.getMinimizerVersion !== \"undefined\" ? impl.getMinimizerVersion() || \"0.0.0\" : \"0.0.0\";\n      const data = getSerializeJavascript()({\n        minimizer: Array.isArray(this.options.minimizer.implementation) ? this.options.minimizer.implementation.map(getVersion) : getVersion(/** @type {BasicMinimizerImplementation<EXPECTED_ANY> & MinimizeFunctionHelpers} */\n        this.options.minimizer.implementation),\n        options: this.options.minimizer.options\n      });\n      hooks.chunkHash.tap(pluginName, (chunk, hash) => {\n        hash.update(\"TerserPlugin\");\n        hash.update(data);\n      });\n      compilation.hooks.processAssets.tapPromise({\n        name: pluginName,\n        stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE,\n        additionalAssets: true\n      }, assets => this.optimize(compiler, compilation, assets, {\n        availableNumberOfCores\n      }));\n      compilation.hooks.statsPrinter.tap(pluginName, stats => {\n        stats.hooks.print.for(\"asset.info.minimized\").tap(\"minimizer-webpack-plugin\", (minimized, {\n          green,\n          formatFlag\n        }) => minimized ? /** @type {(text: string) => string} */green(/** @type {(flag: string) => string} */formatFlag(\"minimized\")) : \"\");\n      });\n    });\n  }\n}\nTerserPlugin.terserMinify = terserMinify;\nTerserPlugin.uglifyJsMinify = uglifyJsMinify;\nTerserPlugin.swcMinify = swcMinify;\nTerserPlugin.esbuildMinify = esbuildMinify;\nTerserPlugin.jsonMinify = jsonMinify;\nTerserPlugin.htmlMinifierTerser = htmlMinifierTerser;\nTerserPlugin.swcMinifyHtml = swcMinifyHtml;\nTerserPlugin.swcMinifyHtmlFragment = swcMinifyHtmlFragment;\nTerserPlugin.minifyHtmlNode = minifyHtmlNode;\nTerserPlugin.cssnanoMinify = cssnanoMinify;\nTerserPlugin.cssoMinify = cssoMinify;\nTerserPlugin.cleanCssMinify = cleanCssMinify;\nTerserPlugin.esbuildMinifyCss = esbuildMinifyCss;\nTerserPlugin.lightningCssMinify = lightningCssMinify;\nTerserPlugin.swcMinifyCss = swcMinifyCss;\nmodule.exports = TerserPlugin;"]}