'use strict'
!(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'),
    { connect: g } = require('react-redux'),
    h = 'darwin' === process.platform
  class i extends a.Component {
    constructor(a) {
      super(a)
    }
    componentDidMount() {
      let a = this.props.win
      ;(a.title = '\u4E0A\u4F20\u817E\u8BAF\u4E91'), a.show()
    }
    componentWillReceiveProps(a) {
      a.status != this.props.status &&
        a.status == f.QCLOUD_STATUS.DONE &&
        a.win.restore()
    }
    componentWillUnmount() {
      clearInterval(this.timer), this.props.close()
    }
    onClick() {
      this.props.status != f.QCLOUD_STATUS.DONE && this.props.loading
        ? this.props.win.minimize()
        : this.props.close()
    }
    render() {
      const b = this.props,
        c = b.loading ? {} : { display: 'none' },
        d = 0 < b.descList.length ? {} : { display: 'none' }
      let e = '',
        g = this.props.win
      e = b.loading
        ? '\u6700\u5C0F\u5316'
        : b.status == f.QCLOUD_STATUS.DONE
          ? '\u77E5\u9053\u4E86'
          : '\u5173\u95ED'
      let h = []
      return (
        this.props.descList.map((b, c) => {
          h.push(a.createElement('span', { key: `span${c}` }, b)),
            h.push(a.createElement('br', { key: `br${c}` }))
        }),
        a.createElement(
          'div',
          {
            className: 'container',
            style: {
              WebkitAppRegion: 'drag',
              position: 'absolute',
              width: '100%'
            }
          },
          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-qcloud-colorful'
                    })
                  ),
                  a.createElement(
                    'div',
                    { className: 'ui-msg-content' },
                    a.createElement('h4', null, decodeURIComponent(b.text)),
                    a.createElement('p', { style: d }, h),
                    a.createElement('div', {
                      className: 'ui-progress',
                      style: c
                    })
                  )
                ),
                a.createElement(
                  'div',
                  { className: 'ui-msg-action' },
                  a.createElement(
                    'button',
                    {
                      className: 'ui-button ui-button-primary',
                      style: { WebkitAppRegion: 'no-drag' },
                      onClick: this.onClick.bind(this)
                    },
                    e
                  )
                )
              )
            )
          )
        )
      )
    }
  }
  const j = g(
    a => {
      let b = a.window.qcloud.uploading,
        c = b.status,
        d =
          c == f.QCLOUD_STATUS.UPLOADING ||
          c == f.QCLOUD_STATUS.DEPLOYING ||
          c == f.QCLOUD_STATUS.INSTALLING ||
          c == f.QCLOUD_STATUS.RESTARTING,
        e =
          c == f.QCLOUD_STATUS.UPLOAD_FAIL ||
          c == f.QCLOUD_STATUS.DEPLOY_FAIL ||
          c == f.INSTALL_FAIL ||
          c == f.RESTART_FAIL
      return {
        text: b.text,
        descList: b.descList || [],
        status: c,
        failed: e,
        loading: d
      }
    },
    a => {
      return {
        close: () => {
          a(d.setQCloud({ uploading: { show: !1, descList: [] } }))
        }
      }
    }
  )(i)
  module.exports = class extends a.Component {
    constructor(a) {
      super(a)
    }
    render() {
      return a.createElement(c, {
        title: ' ',
        frame: !1,
        show: !1,
        width: f.SIZE.QCLOUD_UPLOADING.WIDTH,
        height: f.SIZE.QCLOUD_UPLOADING.HEIGHT,
        resizable: !1,
        fullscreen: !1,
        always_on_top: !1,
        templateHTML: 'html/qcloudModal.html',
        renderClass: j
      })
    }
  }
})(require('lazyload'), require)
