'use strict'
!(function(require, directRequire) {
  const a = require('./15ba1827c7f6564a45df6bd44da3a977.js'),
    b = require('./f171257bbcaef547a3cf27266ccb0db2.js')
  module.exports = {
    decodeQRCode: (c, d) =>
      new Promise(async (e, f) => {
        try {
          const { body: f } = await a({
            url: `${b.jsDecodeQRCodeURL}?&appid=${d}`,
            method: 'post',
            body: c,
            needToken: 1,
            needAppID: d ? 0 : 1
          })
          if (f.result) {
            let a = decodeURIComponent(f.result)
            e(a)
          }
        } catch (a) {
          f(a)
        }
      }),
    toBase64: (a, b) => {
      if (!a) throw new Error('Empty image data')
      if (!b) throw new Error('Format must be given')
      return 'data:image/jpeg;base64,' + a.toString('base64')
    }
  }
})(require('lazyload'), require)
