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ACN,UAAW,YAAY,GACvB,KAAM,GACN,IAGJ,KAAK,EAAU,QAAQ,IAIrB,GAHA,KAAK,eAGD,KAAK,MAAM,KACb,OAGF,MAAM,EAAY,EAAM,YAClB,EAAS,EAAY,mBAAqB,eAC1C,EAAO,KAAK,MAAM,MAAQ,OAAS,WAAW,QAAQ,OAAO,KAAK,MAAM,OAAQ,GAAK,GAC3F,OAAO,OAAO,KAAK,MAAO,IAAK,cAC7B,SAAU,IACV,MAAM,EACN,QAAS,YAAY,IAAS,IAC9B,cAEF,KAAK,cAAc,YACnB,KAAK,cAAc,OAAQ,CACzB,UAGG,KAAK,aACR,KAAK,cAAc,iBACnB,KAAK,cAAc,WACnB,KAAK,cAAc,gBACrB,IAEJ,CAEA,cAAA,CAAe,EAAU,EAAG,EAAU,GAAI,EAAU,IAClD,MAAM,EAAW,KAAK,MAAgB,IAAV,GAC5B,OAAO,OAAO,KAAK,MAAO,CACxB,WACA,QAAS,GAAW,GACpB,UACA,QAAS,aAAa,EAAQ,MAEhC,KAAK,cAAc,WACrB,EAIF,OAAO,QAAU","file":"/npm/webpackbar@4.0.0/dist/webpackbar.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.19.2.\n * Original file: /npm/webpackbar@4.0.0/dist/webpackbar.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\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar webpack = require('webpack');\nvar env = _interopDefault(require('std-env'));\nvar prettyTime = _interopDefault(require('pretty-time'));\nvar path = require('path');\nvar path__default = _interopDefault(path);\nvar chalk = _interopDefault(require('chalk'));\nvar Consola = _interopDefault(require('consola'));\nvar textTable = _interopDefault(require('text-table'));\nvar figures = require('figures');\nvar ansiEscapes = _interopDefault(require('ansi-escapes'));\nvar wrapAnsi = _interopDefault(require('wrap-ansi'));\n\nfunction first(arr) {\n  return arr[0];\n}\nfunction last(arr) {\n  return arr.length ? arr[arr.length - 1] : null;\n}\nfunction startCase(str) {\n  return str[0].toUpperCase() + str.substr(1);\n}\nfunction firstMatch(regex, str) {\n  const m = regex.exec(str);\n  return m ? m[0] : null;\n}\nfunction hasValue(s) {\n  return s && s.length;\n}\nfunction removeAfter(delimiter, str) {\n  return first(str.split(delimiter)) || '';\n}\nfunction removeBefore(delimiter, str) {\n  return last(str.split(delimiter)) || '';\n}\nfunction range(len) {\n  const arr = [];\n\n  for (let i = 0; i < len; i++) {\n    arr.push(i);\n  }\n\n  return arr;\n}\nfunction shortenPath(path$1 = '') {\n  const cwd = process.cwd() + path.sep;\n  return String(path$1).replace(cwd, '');\n}\nfunction objectValues(obj) {\n  return Object.keys(obj).map(key => obj[key]);\n}\n\nconst nodeModules = `${path__default.delimiter}node_modules${path__default.delimiter}`;\nconst BAR_LENGTH = 25;\nconst BLOCK_CHAR = '█';\nconst BLOCK_CHAR2 = '█';\nconst NEXT = ' ' + chalk.blue(figures.pointerSmall) + ' ';\nconst BULLET = figures.bullet;\nconst TICK = figures.tick;\nconst CROSS = figures.cross;\nconst CIRCLE_OPEN = figures.radioOff;\n\nconst consola = Consola.withTag('webpackbar');\nconst colorize = color => {\n  if (color[0] === '#') {\n    return chalk.hex(color);\n  }\n\n  return chalk[color] || chalk.keyword(color);\n};\nconst renderBar = (progress, color) => {\n  const w = progress * (BAR_LENGTH / 100);\n  const bg = chalk.white(BLOCK_CHAR);\n  const fg = colorize(color)(BLOCK_CHAR2);\n  return range(BAR_LENGTH).map(i => i < w ? fg : bg).join('');\n};\nfunction createTable(data) {\n  return textTable(data, {\n    align: data[0].map(() => 'l')\n  }).replace(/\\n/g, '\\n\\n');\n}\nfunction ellipsisLeft(str, n) {\n  if (str.length <= n - 3) {\n    return str;\n  }\n\n  return `...${str.substr(str.length - n - 1)}`;\n}\n\nconst parseRequest = requestStr => {\n  const parts = (requestStr || '').split('!');\n  const file = path__default.relative(process.cwd(), removeAfter('?', removeBefore(nodeModules, parts.pop())));\n  const loaders = parts.map(part => firstMatch(/[a-z0-9-@]+-loader/, part)).filter(hasValue);\n  return {\n    file: hasValue(file) ? file : null,\n    loaders\n  };\n};\nconst formatRequest = request => {\n  const loaders = request.loaders.join(NEXT);\n\n  if (!loaders.length) {\n    return request.file || '';\n  }\n\n  return `${loaders}${NEXT}${request.file}`;\n}; // Hook helper for webpack 3 + 4 support\n\nfunction hook(compiler, hookName, fn) {\n  if (compiler.hooks) {\n    compiler.hooks[hookName].tap('WebpackBar:' + hookName, fn);\n  } else {\n    compiler.plugin(hookName, fn);\n  }\n}\n\nconst originalWrite = Symbol('webpackbarWrite');\nclass LogUpdate {\n  constructor() {\n    this.prevLineCount = 0;\n    this.listening = false;\n    this.extraLines = '';\n    this._onData = this._onData.bind(this);\n    this._streams = [process.stdout, process.stderr];\n  }\n\n  render(lines) {\n    this.listen();\n    const wrappedLines = wrapAnsi(lines, this.columns, {\n      trim: false,\n      hard: true,\n      wordWrap: false\n    });\n    const data = ansiEscapes.eraseLines(this.prevLineCount) + wrappedLines + '\\n' + this.extraLines;\n    this.write(data);\n    this.prevLineCount = data.split('\\n').length;\n  }\n\n  get columns() {\n    return (process.stderr.columns || 80) - 2;\n  }\n\n  write(data) {\n    const stream = process.stderr;\n\n    if (stream.write[originalWrite]) {\n      stream.write[originalWrite].call(stream, data, 'utf-8');\n    } else {\n      stream.write(data, 'utf-8');\n    }\n  }\n\n  clear() {\n    this.done();\n    this.write(ansiEscapes.eraseLines(this.prevLineCount));\n  }\n\n  done() {\n    this.stopListen();\n    this.prevLineCount = 0;\n    this.extraLines = '';\n  }\n\n  _onData(data) {\n    const str = String(data);\n    const lines = str.split('\\n').length - 1;\n\n    if (lines > 0) {\n      this.prevLineCount += lines;\n      this.extraLines += data;\n    }\n  }\n\n  listen() {\n    // Prevent listening more than once\n    if (this.listening) {\n      return;\n    } // Spy on all streams\n\n\n    for (const stream of this._streams) {\n      // Prevent overriding more than once\n      if (stream.write[originalWrite]) {\n        continue;\n      } // Create a wrapper fn\n\n\n      const write = (data, ...args) => {\n        if (!stream.write[originalWrite]) {\n          return stream.write(data, ...args);\n        }\n\n        this._onData(data);\n\n        return stream.write[originalWrite].call(stream, data, ...args);\n      }; // Backup original write fn\n\n\n      write[originalWrite] = stream.write; // Override write fn\n\n      stream.write = write;\n    }\n\n    this.listening = true;\n  }\n\n  stopListen() {\n    // Restore original write fns\n    for (const stream of this._streams) {\n      if (stream.write[originalWrite]) {\n        stream.write = stream.write[originalWrite];\n      }\n    }\n\n    this.listening = false;\n  }\n\n}\n\n/* eslint-disable no-console */\nconst logUpdate = new LogUpdate();\nlet lastRender = Date.now();\nclass FancyReporter {\n  allDone() {\n    logUpdate.done();\n  }\n\n  done(context) {\n    this._renderStates(context.statesArray);\n\n    if (context.hasErrors) {\n      logUpdate.done();\n    }\n  }\n\n  progress(context) {\n    if (Date.now() - lastRender > 50) {\n      this._renderStates(context.statesArray);\n    }\n  }\n\n  _renderStates(statesArray) {\n    lastRender = Date.now();\n    const renderedStates = statesArray.map(c => this._renderState(c)).join('\\n\\n');\n    logUpdate.render('\\n' + renderedStates + '\\n');\n  }\n\n  _renderState(state) {\n    const color = colorize(state.color);\n    let line1;\n    let line2;\n\n    if (state.progress >= 0 && state.progress < 100) {\n      // Running\n      line1 = [color(BULLET), color(state.name), renderBar(state.progress, state.color), state.message, `(${state.progress || 0}%)`, chalk.grey(state.details[0] || ''), chalk.grey(state.details[1] || '')].join(' ');\n      line2 = state.request ? ' ' + chalk.grey(ellipsisLeft(formatRequest(state.request), logUpdate.columns)) : '';\n    } else {\n      let icon = ' ';\n\n      if (state.hasErrors) {\n        icon = CROSS;\n      } else if (state.progress === 100) {\n        icon = TICK;\n      } else if (state.progress === -1) {\n        icon = CIRCLE_OPEN;\n      }\n\n      line1 = color(`${icon} ${state.name}`);\n      line2 = chalk.grey('  ' + state.message);\n    }\n\n    return line1 + '\\n' + line2;\n  }\n\n}\n\nclass SimpleReporter {\n  start(context) {\n    consola.info(`Compiling ${context.state.name}`);\n  }\n\n  change(context, {\n    shortPath\n  }) {\n    consola.debug(`${shortPath} changed.`, `Rebuilding ${context.state.name}`);\n  }\n\n  done(context) {\n    const {\n      hasError,\n      message,\n      name\n    } = context.state;\n    consola[hasError ? 'error' : 'success'](`${name}: ${message}`);\n  }\n\n}\n\nconst DB = {\n  loader: {\n    get: loader => startCase(loader)\n  },\n  ext: {\n    get: ext => `${ext} files`,\n    vue: 'Vue Single File components',\n    js: 'JavaScript files',\n    sass: 'SASS files',\n    scss: 'SASS files',\n    unknown: 'Unknown files'\n  }\n};\nfunction getDescription(category, keyword) {\n  if (!DB[category]) {\n    return startCase(keyword);\n  }\n\n  if (DB[category][keyword]) {\n    return DB[category][keyword];\n  }\n\n  if (DB[category].get) {\n    return DB[category].get(keyword);\n  }\n\n  return '-';\n}\n\nfunction formatStats(allStats) {\n  const lines = [];\n  Object.keys(allStats).forEach(category => {\n    const stats = allStats[category];\n    lines.push(`> Stats by ${chalk.bold(startCase(category))}`);\n    let totalRequests = 0;\n    const totalTime = [0, 0];\n    const data = [[startCase(category), 'Requests', 'Time', 'Time/Request', 'Description']];\n    Object.keys(stats).forEach(item => {\n      const stat = stats[item];\n      totalRequests += stat.count || 0;\n      const description = getDescription(category, item);\n      totalTime[0] += stat.time[0];\n      totalTime[1] += stat.time[1];\n      const avgTime = [stat.time[0] / stat.count, stat.time[1] / stat.count];\n      data.push([item, stat.count || '-', prettyTime(stat.time), prettyTime(avgTime), description]);\n    });\n    data.push(['Total', totalRequests, prettyTime(totalTime), '', '']);\n    lines.push(createTable(data));\n  });\n  return `${lines.join('\\n\\n')}\\n`;\n}\n\nclass Profiler {\n  constructor() {\n    this.requests = [];\n  }\n\n  onRequest(request) {\n    if (!request) {\n      return;\n    } // Measure time for last request\n\n\n    if (this.requests.length) {\n      const lastReq = this.requests[this.requests.length - 1];\n\n      if (lastReq.start) {\n        lastReq.time = process.hrtime(lastReq.start);\n        delete lastReq.start;\n      }\n    } // Ignore requests without any file or loaders\n\n\n    if (!request.file || !request.loaders.length) {\n      return;\n    }\n\n    this.requests.push({\n      request,\n      start: process.hrtime()\n    });\n  }\n\n  getStats() {\n    const loaderStats = {};\n    const extStats = {};\n\n    const getStat = (stats, name) => {\n      if (!stats[name]) {\n        // eslint-disable-next-line no-param-reassign\n        stats[name] = {\n          count: 0,\n          time: [0, 0]\n        };\n      }\n\n      return stats[name];\n    };\n\n    const addToStat = (stats, name, count, time) => {\n      const stat = getStat(stats, name);\n      stat.count += count;\n      stat.time[0] += time[0];\n      stat.time[1] += time[1];\n    };\n\n    this.requests.forEach(({\n      request,\n      time = [0, 0]\n    }) => {\n      request.loaders.forEach(loader => {\n        addToStat(loaderStats, loader, 1, time);\n      });\n      const ext = request.file && path__default.extname(request.file).substr(1);\n      addToStat(extStats, ext && ext.length ? ext : 'unknown', 1, time);\n    });\n    return {\n      ext: extStats,\n      loader: loaderStats\n    };\n  }\n\n  getFormattedStats() {\n    return formatStats(this.getStats());\n  }\n\n}\n\nclass ProfileReporter {\n  progress(context) {\n    if (!context.state.profiler) {\n      context.state.profiler = new Profiler();\n    }\n\n    context.state.profiler.onRequest(context.state.request);\n  }\n\n  done(context) {\n    if (context.state.profiler) {\n      context.state.profile = context.state.profiler.getFormattedStats();\n      delete context.state.profiler;\n    }\n  }\n\n  allDone(context) {\n    let str = '';\n\n    for (const state of context.statesArray) {\n      const color = colorize(state.color);\n\n      if (state.profile) {\n        str += color(`\\nProfile results for ${chalk.bold(state.name)}\\n`) + `\\n${state.profile}\\n`;\n        delete state.profile;\n      }\n    }\n\n    process.stderr.write(str);\n  }\n\n}\n\nclass StatsReporter {\n  constructor(options) {\n    this.options = Object.assign({\n      chunks: false,\n      children: false,\n      modules: false,\n      colors: true,\n      warnings: true,\n      errors: true\n    }, options);\n  }\n\n  done(context, {\n    stats\n  }) {\n    const str = stats.toString(this.options);\n\n    if (context.hasErrors) {\n      process.stderr.write('\\n' + str + '\\n');\n    } else {\n      context.state.statsString = str;\n    }\n  }\n\n  allDone(context) {\n    let str = '';\n\n    for (const state of context.statesArray) {\n      if (state.statsString) {\n        str += '\\n' + state.statsString + '\\n';\n        delete state.statsString;\n      }\n    }\n\n    process.stderr.write(str);\n  }\n\n}\n\n\n\nvar reporters = /*#__PURE__*/Object.freeze({\n  fancy: FancyReporter,\n  basic: SimpleReporter,\n  profile: ProfileReporter,\n  stats: StatsReporter\n});\n\nconst DEFAULTS = {\n  name: 'webpack',\n  color: 'green',\n  reporters: env.minimalCLI ? ['basic'] : ['fancy'],\n  reporter: null // Default state object\n\n};\nconst DEFAULT_STATE = {\n  start: null,\n  progress: -1,\n  done: false,\n  message: '',\n  details: [],\n  request: null,\n  hasErrors: false // Mapping from name => State\n\n};\nconst globalStates = {};\nclass WebpackBarPlugin extends webpack.ProgressPlugin {\n  constructor(options) {\n    super();\n    this.options = Object.assign({}, DEFAULTS, options); // Assign a better handler to base ProgressPlugin\n\n    this.handler = (percent, message, ...details) => {\n      this.updateProgress(percent, message, details);\n    }; // Reporters\n\n\n    this.reporters = Array.from(this.options.reporters || []);\n\n    if (this.options.reporter) {\n      this.reporters.push(this.options.reporter);\n    } // Resolve reporters\n\n\n    this.reporters = this.reporters.filter(Boolean).map(_reporter => {\n      if (this.options[_reporter] === false) {\n        return false;\n      }\n\n      let reporter = _reporter;\n      let reporterOptions = this.options[reporter] || {};\n\n      if (Array.isArray(_reporter)) {\n        reporter = _reporter[0];\n\n        if (_reporter[1] === false) {\n          return false;\n        }\n\n        if (_reporter[1]) {\n          reporterOptions = _reporter[1];\n        }\n      }\n\n      if (typeof reporter === 'string') {\n        if (reporters[reporter]) {\n          // eslint-disable-line import/namespace\n          reporter = reporters[reporter]; // eslint-disable-line import/namespace\n        } else {\n          reporter = require(reporter);\n        }\n      }\n\n      if (typeof reporter === 'function') {\n        if (typeof reporter.constructor === 'function') {\n          const Reporter = reporter;\n          reporter = new Reporter(reporterOptions);\n        } else {\n          reporter = reporter(reporterOptions);\n        }\n      }\n\n      return reporter;\n    }).filter(Boolean);\n  }\n\n  callReporters(fn, payload = {}) {\n    for (const reporter of this.reporters) {\n      if (typeof reporter[fn] === 'function') {\n        try {\n          reporter[fn](this, payload);\n        } catch (e) {\n          process.stdout.write(e.stack + '\\n');\n        }\n      }\n    }\n  }\n\n  get hasRunning() {\n    return objectValues(this.states).some(state => !state.done);\n  }\n\n  get hasErrors() {\n    return objectValues(this.states).some(state => state.hasErrors);\n  }\n\n  get statesArray() {\n    return objectValues(this.states).sort((s1, s2) => s1.name.localeCompare(s2.name));\n  }\n\n  get states() {\n    return globalStates;\n  }\n\n  get state() {\n    return globalStates[this.options.name];\n  }\n\n  _ensureState() {\n    // Keep our state in shared object\n    if (!this.states[this.options.name]) {\n      this.states[this.options.name] = { ...DEFAULT_STATE,\n        color: this.options.color,\n        name: startCase(this.options.name)\n      };\n    }\n  }\n\n  apply(compiler) {\n    // Prevent adding multi instances to the same compiler\n    if (compiler.webpackbar) {\n      return;\n    }\n\n    compiler.webpackbar = this; // Apply base hooks\n\n    super.apply(compiler); // Register our state after all plugins initialized\n\n    hook(compiler, 'afterPlugins', () => {\n      this._ensureState();\n    }); // Hook into the compiler before a new compilation is created.\n\n    hook(compiler, 'compile', () => {\n      this._ensureState();\n\n      Object.assign(this.state, { ...DEFAULT_STATE,\n        start: process.hrtime()\n      });\n      this.callReporters('start');\n    }); // Watch compilation has been invalidated.\n\n    hook(compiler, 'invalid', (fileName, changeTime) => {\n      this._ensureState();\n\n      this.callReporters('change', {\n        path: fileName,\n        shortPath: shortenPath(fileName),\n        time: changeTime\n      });\n    }); // Compilation has completed\n\n    hook(compiler, 'done', stats => {\n      this._ensureState(); // Prevent calling done twice\n\n\n      if (this.state.done) {\n        return;\n      }\n\n      const hasErrors = stats.hasErrors();\n      const status = hasErrors ? 'with some errors' : 'successfully';\n      const time = this.state.start ? ' in ' + prettyTime(process.hrtime(this.state.start), 2) : '';\n      Object.assign(this.state, { ...DEFAULT_STATE,\n        progress: 100,\n        done: true,\n        message: `Compiled ${status}${time}`,\n        hasErrors\n      });\n      this.callReporters('progress');\n      this.callReporters('done', {\n        stats\n      });\n\n      if (!this.hasRunning) {\n        this.callReporters('beforeAllDone');\n        this.callReporters('allDone');\n        this.callReporters('afterAllDone');\n      }\n    });\n  }\n\n  updateProgress(percent = 0, message = '', details = []) {\n    const progress = Math.floor(percent * 100);\n    Object.assign(this.state, {\n      progress,\n      message: message || '',\n      details,\n      request: parseRequest(details[2])\n    });\n    this.callReporters('progress');\n  }\n\n}\n\nmodule.exports = WebpackBarPlugin;\n"]}