'use strict'
!(function(require, directRequire) {
  function a() {
    l = {}
  }
  function b(b, c) {
    let e = d.extname(c)
    '.json' === e && a()
  }
  async function c(c) {
    if (k) {
      let b = k.setting && k.setting.newFeature,
        d = c.setting && c.setting.newFeature
      b != d && a()
    }
    k = c
    let d = await e(c)
    ;(j && j.srcPath == d.srcPath) ||
      (a(), j && j.unWatch(b), (j = d), j.watch(b))
  }
  const d = require('path'),
    e = require('./162bf2ee28b76d3b3d95b685cede4146.js'),
    f = require('./1dea83a77e99a7c94f6b6f01f5c175b0.js'),
    g = require('./d260ebf687a29f24aed49f66b233ab7d.js'),
    h = require('./6b5520e429c60abf5d2f924c0fa05fd0.js'),
    i = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js')
  var j,
    k,
    l = {}
  module.exports = async function(a, b) {
    if ((await c(a), l[b])) return l[b]
    let e = await f(a),
      j = i.checkIsInSubPackage(e, b),
      k = await h.getFileListWithMainPack(a, e, j),
      m = d.posix.dirname(b),
      n = await g(a, b)
    if (n.usingComponents && 0 < Object.keys(n.usingComponents).length) {
      let a = {},
        b = {}
      for (let c in n.usingComponents) {
        let f = n.usingComponents[c] || '',
          g = c.split('*'),
          h = f.split('*')
        1 < g.length
          ? ((f = d.posix.normalize(f)),
            (f = d.posix.isAbsolute(f) ? f : `/${d.posix.join(m, f)}`),
            (b[c] = f))
          : e.plugins || (j && j.plugins)
            ? (a[c] = f.replace(
                /^plugin:\/\/([^\/]*)\/(.*)/,
                (a, b, c, d, f) => {
                  let g =
                    (e.plugins && e.plugins[b]) ||
                    (j && j.plugins && j.plugins[b])
                  return g ? `plugin://${g.provider}/${c}` : f
                }
              ))
            : (a[c] = f)
      }
      if (0 < Object.keys(b).length)
        for (let c in b) {
          let d = b[c],
            e = new RegExp(d.replace(/\*/g, '([^/]*)'))
          k.forEach(b => {
            b = '/' + b
            let d = b.match(e)
            if (!d) return
            let f = 1,
              g = c.replace(/\*/g, function() {
                return d[f++]
              })
            a[g] = b
          })
        }
      n.usingComponents = a
    }
    return (l[b] = n), l[b]
  }
})(require('lazyload'), require)
