'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) {
  function a() {
    return {
      addDeviceInfo: { show: !1 },
      projectInfo: { selected: 'setting' },
      editorOpenFileInfo: {},
      uploadInfo: { show: !1, status: 0, qrcode: '', uuid: '', wording: '' },
      shareInfo: { show: !1 },
      uploadPluginDocInfo: { show: !1 },
      confirmInfo: {
        show: !1,
        type: 'error',
        title: '',
        content: '',
        showConfirm: !0,
        showCancel: !0,
        confirmText: '\u786E\u5B9A',
        cancelText: '\u53D6\u6D88',
        callback: null
      },
      confirmPopups: [],
      successTip: ''
    }
  }
  function b() {
    return {
      type: 'warn',
      title: '',
      content: '',
      showConfirm: !0,
      showCancel: !0,
      confirmText: '\u786E\u5B9A',
      cancelText: '\u53D6\u6D88'
    }
  }
  const c = require('lodash'),
    { REHYDRATE: d } = require('redux-persist/lib/constants'),
    e = require('./0634ee2ebd3e560d9d4804ecc960160f.js')
  module.exports = function(d = a(), f) {
    switch (f.type) {
      case e.INFO_SET_PROJECT:
        return _extends({}, d, {
          projectInfo: _extends({}, d.projectInfo, f.data)
        })
      case e.INFO_SET_UPLOAD:
        return _extends({}, d, {
          uploadInfo: _extends({}, d.uploadInfo, f.data)
        })
      case e.INFO_SET_CONFIRM:
        return _extends({}, d, {
          confirmInfo: _extends({}, d.confirmInfo, { callback: null }, f.data)
        })
      case e.INFO_SHOW_ERROR:
        return _extends({}, d, {
          confirmInfo: _extends({}, f.confirmInfo, {
            show: !0,
            type: 'error',
            title: '\u63D0\u793A',
            content: f.data.message,
            showCancel: !1,
            showConfirm: !0,
            callback: null,
            confirmText: '\u5173\u95ED'
          })
        })
      case e.INFO_SHOW_CONFIRM_POPUP: {
        if (d.confirmPopups.find(a => a.id === f.data.id)) return d
        const a = [...d.confirmPopups]
        return (
          a.push(c.merge(b(), f.data)),
          5 < a.length && a.pop(),
          _extends({}, d, { confirmPopups: a })
        )
      }
      case e.INFO_CLOSE_CONFIRM_POPUP: {
        const a = d.confirmPopups.filter(a => a.id !== f.id)
        return a.length === d.confirmPopups.length
          ? d
          : _extends({}, d, { confirmPopups: a })
      }
      case e.INFO_SHOW_SUCCESS:
        return _extends({}, d, { successTip: f.data })
      case e.INFO_SET_SHARE:
        return _extends({}, d, { shareInfo: _extends({}, d.shareInfo, f.data) })
      case e.INFO_SET_UPLOAD_PLUGIN_DOC:
        return _extends({}, d, {
          uploadPluginDocInfo: _extends({}, d.uploadPluginDocInfo, f.data)
        })
      case e.INFO_OPEN_EDITOR_FILE:
        return _extends({}, d, {
          editorOpenFileInfo: _extends({}, f.data, { ts: Date.now() })
        })
      case e.INFO_ADD_DEVICE_POPUP:
        return _extends({}, d, {
          addDeviceInfo: _extends({}, d.addDeviceInfo, f.data)
        })
      default:
        return d
    }
  }
})(require('lazyload'), require)
