'use strict'
!(function(require, directRequire) {
  const a = require('jimp')
  module.exports = {
    isSameColorImage: (b, c) =>
      new Promise((d, e) => {
        b || d({ error: !1, same: !0 })
        let f
        'dataURI' === c.type
          ? 'png' === c.format
            ? (f = Buffer.from(b.slice(22), 'base64'))
            : 'jpg' === c.format
              ? (f = Buffer.from(b.slice(22), 'base64'))
              : 'jpeg' === c.format && (f = Buffer.from(b.slice(23), 'base64'))
          : (f = b),
          a.read(f, (a, b) => {
            if (a) return e(a)
            b = b.grayscale()
            let c = 0,
              f = 255
            b.scan(0, 0, b.bitmap.width, b.bitmap.height, function(a, b, d) {
              let e = this.bitmap.data[d + 0]
              e > c && (c = e), e < f && (f = e)
            }),
              c - f < 10
                ? d({ error: !1, same: !0 })
                : d({ error: !1, same: !1 })
          })
      })
  }
})(require('lazyload'), require)
