'use strict'
var _extends =
  Object.assign ||
  function(a) {
    for (var b, c = 1; c < arguments.length; c++)
      for (var d in ((b = arguments[c]), b))
        Object.prototype.hasOwnProperty.call(b, d) && (a[d] = b[d])
    return a
  }
!(function(require, directRequire) {
  const a = require('react'),
    b = require('redux'),
    c = require('./6620a0cf7dad1b400d60f0fdae40f524.js'),
    d = require('./a8c87029da0fa06e986298d447ab0fe2.js'),
    e = require('./0794878a22a26634e42df858bbaca543.js'),
    f = require('./56c390e04c10e91a4aa2a2c19d9a885d.js'),
    g = require('./3b5f8e2469c474c8d433c1c6926d8999.js'),
    { connect: h } = require('react-redux')
  class i extends a.Component {
    constructor(a) {
      super(a)
    }
    componentDidMount() {
      this.props.win.show()
    }
    onConfirm() {
      this.props.confirm()
    }
    onCancel() {
      this.props.cancel()
    }
    render() {
      let { confirmText: b, cancelText: c, content: d, title: e } = this.props
      const f = e ? {} : g.displayNone,
        h = d ? {} : g.displayNone,
        i = this.props.showCancel ? g.nodrag : g.displayNone,
        j = this.props.showConfirm ? g.nodrag : g.displayNone,
        k = this.props.showLoading ? {} : g.displayNone
      return a.createElement(
        'div',
        { className: 'container', style: g.drag },
        a.createElement(
          'div',
          null,
          a.createElement(
            'div',
            { className: 'modal' },
            a.createElement('div', { className: 'modal-hd' }),
            a.createElement(
              'div',
              { className: 'modal-bd' },
              a.createElement(
                'div',
                { className: 'ui-msg' },
                a.createElement(
                  'div',
                  { className: 'ui-msg-icon' },
                  a.createElement('i', { className: 'ui-icon-info' })
                ),
                a.createElement(
                  'div',
                  { className: 'ui-msg-content', style: { maxHeight: 90 } },
                  a.createElement('h4', { style: f }, decodeURIComponent(e)),
                  a.createElement('p', { style: h }, decodeURIComponent(d)),
                  a.createElement('div', { className: 'ui-progress', style: k })
                )
              ),
              a.createElement(
                'div',
                { className: 'ui-msg-action' },
                a.createElement(
                  'button',
                  {
                    className: 'ui-button ui-button-default',
                    style: i,
                    onClick: this.onCancel.bind(this)
                  },
                  c
                ),
                a.createElement(
                  'button',
                  {
                    className: 'ui-button ui-button-primary',
                    style: j,
                    onClick: this.onConfirm.bind(this)
                  },
                  b
                )
              )
            )
          )
        )
      )
    }
  }
  const j = h(
    () => {
      return {}
    },
    () => {
      return {}
    }
  )(i)
  module.exports = class extends a.Component {
    constructor(a) {
      super(a),
        (this.resolved = !1),
        (this.renderProps = _extends({}, a, {
          confirm: () => {
            ;(this.resolved = !0), a.resolve && a.resolve(!0)
          },
          cancel: () => {
            ;(this.resolved = !0), a.resolve && a.resolve(!1)
          }
        }))
    }
    componentWillUnmount() {
      !this.resolved && this.props.resolve && this.props.resolve(!1)
    }
    onWindowClose() {
      !this.resolved && this.props.resolve && this.props.resolve(!1)
    }
    render() {
      return a.createElement(c, {
        title: ' ',
        frame: !1,
        show: !1,
        width: f.SIZE.CONFIRM.WIDTH,
        height: f.SIZE.CONFIRM.HEIGHT,
        resizable: !1,
        fullscreen: !1,
        always_on_top: !0,
        templateHTML: 'html/modal.html',
        onWindowClose: this.onWindowClose.bind(this),
        renderClass: j,
        renderProps: this.renderProps
      })
    }
  }
})(require('lazyload'), require)
