'use strict'
!(function(require, directRequire) {
  function a() {
    x = {}
  }
  function b(a, b) {
    delete x[b]
  }
  async function c(c) {
    let d = await j(c)
    ;(v && v.srcPath == d.srcPath) ||
      (a(), v && v.unWatch(b), (v = d), v.watch(b))
  }
  function d(a) {
    z.push(a),
      y && clearTimeout(y),
      (y = setTimeout(() => {
        ;(y = void 0),
          n.display({
            command: o.DISPLAY_INFO,
            type: 'COMPILE_JS_TOO_LARGE_IGNORE',
            data: { files: [...z] }
          }),
          (z = [])
      }, 1e3))
  }
  async function e(a, b) {
    let { setting: c } = a,
      e = v.getFile(b, 'utf8'),
      g = await k(a),
      h = g.openDataContext || g.subContext,
      i = h && 0 === b.indexOf(h),
      j = g.workers,
      r = j && 0 === b.indexOf(j)
    if (c.es6) {
      let a = f.basename(b)
      if (512000 > e.length) {
        let c = !0
        try {
          ;(c = !p.getState().settings.compiler.clusterCompile),
            'number' != typeof q && (q = require('os').cpus().length),
            (c = c || 4 >= q)
        } catch (a) {
          console.error(a), (c = !0)
        }
        try {
          let d = await l({
            taskName: 'processJS',
            config: {
              projectPath: v.srcPath,
              file: b,
              es6: 'yes',
              sourceMaps: 'map',
              sourceFileName: a
            },
            dataStr: e,
            useBackup: !0,
            maxTimeout: 60000,
            forceBackup: c
          })
          if (d.error) throw d.error
          e = d.map
            ? `${
                d.code
              }\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${new Buffer(
                d.map
              ).toString('base64')}`
            : d.code
        } catch (a) {
          let b = a
          throw (b instanceof Error ||
            ((b = new Error(a.message)), (b.message = a.message)),
          n.display({
            command: o.DISPLAY_ERROR,
            type: m.CODE_ERROR,
            data: { error: b }
          }),
          b)
        }
      } else d(b)
    }
    return (
      (e = `define("${b.replace(
        /\"/g,
        '\\"'
      )}", function(require, module, exports, process){ ${e}\n});`),
      r && (e = `__workersCode__['${b}'] = ${JSON.stringify(e)}`),
      e
    )
  }
  const f = require('path'),
    g = require('babel-code-frame'),
    h = require('babel-core'),
    i = require('./d28a711224425b00101635efe1034c99.js'),
    j = require('./162bf2ee28b76d3b3d95b685cede4146.js'),
    k = require('./48679210e49dc5028a8b6642263eba75.js'),
    l = require('./41168dca39589e852da6631126d0f94d.js'),
    m = require('./6242f55dbdfe53c2f07b7a51568311f2.js').errorPrefix,
    n = require('./2dfc6a3df6d6fc51266b293c8420e88b.js'),
    o = require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),
    p = require('./bc78839ccca8df9e5ceeb7fae11b7be2.js')
  let q
  const {
    asDebug: r,
    subAsDebug: s,
    workerAsDebug: t,
    WeixinWorkerTpl: u
  } = require('./d9ce5316cc172b6017fdd2399a91117a.js')
  var v,
    w,
    x = {}
  let y,
    z = []
  module.exports = async function(b, d, g) {
    if (
      (await c(b),
      w !== b.setting.es6 && ((w = b.setting.es6), a()),
      0 === d.indexOf('__dev__/'))
    ) {
      let a = d.replace('__dev__/', ''),
        b = await i.getFile(a)
      return b
    }
    if (0 === d.indexOf('__subdev__/')) {
      let a = d.replace('__subdev__/', ''),
        b = await i.getFile(a)
      return b
    }
    if (0 === d.indexOf('__workerdev__/')) {
      let a = d.replace('__workerdev__/', ''),
        b = await i.getFile(a)
      return `__workerVendorCode__['${a}'] = ${JSON.stringify(
        b.toString('utf8')
      )}`
    }
    if (0 === d.indexOf('__asdebug__/')) return r
    if (0 === d.indexOf('__subasdebug__/')) return s
    if (0 === d.indexOf('__workerasdebug__')) {
      if (d.endsWith('workerasdebug.js')) return t
      if (d.endsWith('weixinworker.js')) return u
    }
    if (!x[d]) {
      let a = f.extname(d)
      x[d] = '.js' === a ? e(b, d) : v.getFile(d, g)
    }
    return x[d]
  }
})(require('lazyload'), require)
