'use strict'
!(function(require, directRequire) {
  async function a() {
    return new Promise(a => {
      let d = {
        method: 'post',
        url: `${c.LOADCONFIG_URL}?type=checkup`,
        needToken: 0,
        body: JSON.stringify({ type: 7, version: global.appVersion })
      }
      b(d, (b, c, d) => {
        if (b) return e.error(`loadConfig error ${b}`)
        let h = JSON.parse(d),
          i = h.client_list,
          j = {}
        i.forEach(a => {
          j[a.key] = a.value
        })
        let k = h.cgi_list,
          l = {}
        k.forEach(a => {
          l[a.name] = a.url
        }),
          localStorage.setItem('urlConfig', JSON.stringify(l)),
          (g = j),
          f.emit('CONFIG_UPDATE', j),
          a(j)
      })
    })
  }
  const b = require('./233d77ecf0781f44985f684f70e316d0.js'),
    c = require('./f171257bbcaef547a3cf27266ccb0db2.js'),
    d = require('events').EventEmitter,
    e = require('./logger.js'),
    f = new d()
  let g = null,
    h = null
  module.exports = {
    loop: function() {
      return global.appConfig.isDev
        ? void a()
        : void (h && clearInterval(h),
          a(),
          (h = setInterval(() => {
            a()
          }, 600000)))
    },
    on: function(a, b) {
      f.on(a, b)
    },
    off: function(a, b) {
      f.removeListener(a, b)
    },
    get: function() {
      return g
    },
    refresh: async function() {
      return await a()
    }
  }
})(require('lazyload'), require)
