'use strict'
!(function(require, directRequire) {
  function a() {
    u = ''
  }
  function b(b, c) {
    let e = d.extname(c)
    '.js' === e
      ? ('add' == b || 'unlink' == b) && a()
      : ('app-config.json' == c || 'game.json' == c) && a()
  }
  async function c(c) {
    let d = await g(c)
    ;(t && t.srcPath == d.srcPath) ||
      (a(), t && t.unWatch(b), (t = d), t.watch(b))
  }
  const d = require('path'),
    e = require('./d28a711224425b00101635efe1034c99.js'),
    f = require('./d3976cc01aeebc5b09e11c4135b6bd8d.js'),
    g = require('./162bf2ee28b76d3b3d95b685cede4146.js'),
    h = require('./48679210e49dc5028a8b6642263eba75.js'),
    i = require('./dbf59194122bf3d143456959d86d6213.js'),
    j = require('./be8599cf60139a20dca47b3e43647454.js'),
    k = require('./bc78839ccca8df9e5ceeb7fae11b7be2.js'),
    {
      subcontextHtmlTpl: l,
      subAsDebug: m,
      devSubContextList: n,
      subvendorList: o,
      subVendorPlaceholder: p,
      subAppservicejslistPlaceholder: q
    } = require('./d9ce5316cc172b6017fdd2399a91117a.js'),
    r = global.appConfig.isDev,
    s = r && !nw.App.manifest.forceVendor ? n : o
  var t,
    u = '',
    v = ''
  e.on('VENDOR_CONFIG_CHANGE', a),
    e.on('VENDOR_VERSION_CHANGE', a),
    a(),
    (module.exports = async function(a, b = {}) {
      await c(a)
      let e = !1,
        f = j(),
        g = JSON.stringify({
          setting: a.setting,
          condiction: a.condiction,
          devtoolsConfig: f
        })
      if ((g !== v && ((e = !0), (v = g)), e || !u || b.force)) {
        let b = l,
          c = await h(a),
          e = c.openDataContext || c.subContext
        e &&
          (b = b.replace(p, () => {
            let a = []
            for (let b = 0, c = s.length; b < c; b++) {
              let c = s[b],
                e = d.extname(c)
              '.js' === e
                ? a.push(`<script src="__subdev__/${c}"></script>`)
                : '.css' === e &&
                  a.push(
                    `<link rel="stylesheet" type="text/css" href="__subdev__/${c}" />`
                  )
            }
            return a.join('\n')
          }))
        let f = t.getAllJSFiles(),
          g = []
        f.forEach(a => {
          e && 0 === a.indexOf(e) && g.push(a)
        }),
          e &&
            g.length &&
            (b = b.replace(q, () => {
              let a = []
              for (let b = 0; b < g.length; b++)
                a.push(`<script src="${encodeURI(g[b])}"></script>`)
              return (
                a.push(
                  `<script>require('${e}${
                    c.openDataContext ? 'index.js' : 'sub.js'
                  }')</script>`
                ),
                a.join('\n')
              )
            })),
          (u = b)
      }
      return u
    })
})(require('lazyload'), require)
