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A0B,KAAK,QAAQ,UACnF,EAAS,MAAM,YAAY,IAAI,GAAY,IACzC,MAAM,EAAQ,EAAS,QAAQ,WAAW,wBAAwB,oBAAoB,GAChF,EAAO,yBAAyB,CACpC,eAAgF,IAA9D,KAAK,QAAQ,UAAU,eAAe,qBAAsC,KAAK,QAAQ,UAAU,eAAe,uBAAmC,QACvK,QAAS,KAAK,QAAQ,UAAU,UAElC,EAAM,UAAU,IAAI,GAAY,CAAC,EAAO,KACtC,EAAK,OAAO,gBACZ,EAAK,OAAO,EAAK,IAEnB,EAAY,MAAM,cAAc,WAAW,CACzC,KAAM,EACN,MAAO,EAAS,QAAQ,YAAY,mCACpC,kBAAkB,IACjB,GAAU,KAAK,SAAS,EAAU,EAAa,EAAQ,CACxD,6BAEF,EAAY,MAAM,aAAa,IAAI,GAAY,IAC7C,EAAM,MAAM,MAAM,IAAI,wBAAwB,IAAI,yBAAyB,CAAC,GAC1E,QACA,gBACI,EAAmD,EAA8C,EAAW,cAAgB,IAAG,GACrI,GAEN,EAEF,aAAa,aAAe,aAC5B,aAAa,eAAiB,eAC9B,aAAa,UAAY,UACzB,aAAa,cAAgB,cAC7B,OAAO,QAAU","file":"/npm/terser-webpack-plugin@5.3.15/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/terser-webpack-plugin@5.3.15/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  esbuildMinify,\n  memoize,\n  swcMinify,\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\").Configuration} Configuration */\n/** @typedef {import(\"webpack\").Asset} Asset */\n/** @typedef {import(\"webpack\").AssetInfo} AssetInfo */\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/no-restricted-syntax\n/**\n * @callback ExtractCommentsFunction\n * @param {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// eslint-disable-next-line jsdoc/no-restricted-syntax\n/**\n * @typedef {string | ((fileData: any) => string)} 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 {Array<Error | string>=} errors errors\n * @property {Array<Error | string>=} warnings warnings\n * @property {Array<string>=} extractedComments extracted comments\n */\n\n/**\n * @typedef {{ [file: string]: string }} Input\n */\n\n// eslint-disable-next-line jsdoc/no-restricted-syntax\n/**\n * @typedef {{ [key: string]: 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 {object} PredefinedOptions\n * @property {T extends { module?: infer P } ? P : boolean | string=} module true when code is a EC module, otherwise false\n * @property {T extends { ecma?: infer P } ? P : number | string=} ecma ecma version\n */\n\n/**\n * @template T\n * @typedef {PredefinedOptions<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 */\n\n/**\n * @template T\n * @typedef {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 */\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, terserOptions?: MinimizerOptions<T> | undefined } : { minify: MinimizerImplementation<T>, 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 make `minimizer` option instead `minify` and `terserOptions` in the next major release, also rename `terserMinify` to `terserMinimize`\n    const {\n      minify = ( /** @type {MinimizerImplementation<T>} */terserMinify),\n      terserOptions = ( /** @type {MinimizerOptions<T>} */{}),\n      test = /\\.[cm]?js(\\?.*)?$/i,\n      extractComments = true,\n      parallel = true,\n      include,\n      exclude\n    } = options || {};\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: terserOptions\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    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      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      };\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    if (optimizeOptions.availableNumberOfCores > 0) {\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: typeof this.options.minimizer.implementation.supportsWorkerThreads !== \"undefined\" ? this.options.minimizer.implementation.supportsWorkerThreads() !== false : true\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        } = 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          /**\n           * @type {InternalOptions<T>}\n           */\n          const options = {\n            name,\n            input,\n            inputSourceMap,\n            minimizer: {\n              implementation: this.options.minimizer.implementation,\n              options: {\n                ...this.options.minimizer.options\n              }\n            },\n            extractComments: this.options.extractComments\n          };\n          if (typeof options.minimizer.options.module === \"undefined\") {\n            if (typeof info.javascriptModule !== \"undefined\") {\n              options.minimizer.options.module = /** @type {PredefinedOptions<T>[\"module\"]} */\n              info.javascriptModule;\n            } else if (/\\.mjs(\\?.*)?$/i.test(name)) {\n              options.minimizer.options.module = /** @type {PredefinedOptions<T>[\"module\"]} */true;\n            } else if (/\\.cjs(\\?.*)?$/i.test(name)) {\n              options.minimizer.options.module = /** @type {PredefinedOptions<T>[\"module\"]} */false;\n            }\n          }\n          if (typeof options.minimizer.options.ecma === \"undefined\") {\n            options.minimizer.options.ecma = /** @type {PredefinedOptions<T>[\"ecma\"]} */\n\n            TerserPlugin.getEcmaVersion(compiler.options.output.environment || {});\n          }\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          if (output.code) {\n            let shebang;\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            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              let banner;\n\n              // Add a banner to the original file\n              if ( /** @type {ExtractCommentsObject} */\n              this.options.extractComments.banner !== false) {\n                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          }\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        if (!output.source) {\n          return;\n        }\n\n        /** @type {AssetInfo} */\n        const newInfo = {\n          minimized: true\n        };\n        const {\n          source,\n          extractedCommentsSource\n        } = output;\n\n        // Write extracted comments to commentsFilename\n        if (extractedCommentsSource) {\n          const {\n            commentsFilename\n          } = output;\n          newInfo.related = {\n            license: commentsFilename\n          };\n          allExtractedComments.set(name, {\n            extractedCommentsSource,\n            commentsFilename\n          });\n        }\n        compilation.updateAsset(name, 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   * @private\n   * @param {NonNullable<NonNullable<Configuration[\"output\"]>[\"environment\"]>} environment environment\n   * @returns {number} ecma version\n   */\n  static getEcmaVersion(environment) {\n    // ES 6th\n    if (environment.arrowFunction || environment.const || environment.destructuring || environment.forOf || environment.module) {\n      return 2015;\n    }\n\n    // ES 11th\n    if (environment.bigIntLiteral || environment.dynamicImport) {\n      return 2020;\n    }\n    return 5;\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      const data = getSerializeJavascript()({\n        minimizer: typeof this.options.minimizer.implementation.getMinimizerVersion !== \"undefined\" ? this.options.minimizer.implementation.getMinimizerVersion() || \"0.0.0\" : \"0.0.0\",\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(\"terser-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;\nmodule.exports = TerserPlugin;"]}