'use strict'
var _extends =
  Object.assign ||
  function(a) {
    for (var b, c = 1; c < arguments.length; c++)
      for (var d in ((b = arguments[c]), b))
        Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d])
    return a
  }
!(function(require, directRequire) {
  const a = require('fs'),
    b = require('path'),
    c = require('./15ba1827c7f6564a45df6bd44da3a977.js'),
    d = require('./f171257bbcaef547a3cf27266ccb0db2.js'),
    e = require('./29552ee79b3c130ddd9b6e8c13c40be9.js'),
    f = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js')
  var g = {},
    h = {}
  module.exports = async c => {
    const d = c.projectid
    return g[d]
      ? g[d]
      : ((g = {}),
        new Promise((f, i) => {
          if (!h[d]) h[d] = [{ resolve: f, reject: i }]
          else return void h[d].push({ resolve: f, reject: i })
          let j = a.readdirSync(c.projectpath),
            k = []
          j.forEach(a => {
            ;/\.wxapkg$/.test(a) && k.push(b.join(c.projectpath, a))
          })
          let l = k.length
          g[d] = {}
          for (let b = 0, c = k.length; b < c; b++) {
            let c = k[b],
              f = a.readFileSync(c)
            e(f)
              .then(a => {
                l--,
                  (g[d] = _extends({}, g[d], a)),
                  0 >= l &&
                    h[d].forEach(a => {
                      a.resolve(g[d])
                    })
              })
              .catch(() => {
                h[d].forEach(a => {
                  a.reject(g[d])
                }),
                  delete h[d]
              })
          }
        }))
  }
})(require('lazyload'), require)
