"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _modalManager = _interopRequireDefault(require("../modal-manager"));

var _Modal = _interopRequireDefault(require("./Modal"));

var _ModalContainer = require("../modal-container/ModalContainer");

var _confirm = _interopRequireDefault(require("./confirm"));

var _preview = _interopRequireDefault(require("./preview"));

var _utils = require("./utils");

_Modal["default"].key = _modalManager["default"].getKey;
_Modal["default"].open = _ModalContainer.open;
_Modal["default"].confirm = _confirm["default"];
_Modal["default"].preview = _preview["default"];

_Modal["default"].info = function (props) {
  return (0, _confirm["default"])((0, _objectSpread2["default"])({
    type: 'info',
    okCancel: false
  }, (0, _utils.normalizeProps)(props)));
};

_Modal["default"].success = function (props) {
  return (0, _confirm["default"])((0, _objectSpread2["default"])({
    type: 'success',
    iconType: 'check_circle',
    okCancel: false
  }, (0, _utils.normalizeProps)(props)));
};

_Modal["default"].error = function (props) {
  return (0, _confirm["default"])((0, _objectSpread2["default"])({
    type: 'error',
    iconType: 'cancel',
    okCancel: false
  }, (0, _utils.normalizeProps)(props)));
};

_Modal["default"].warning = function (props) {
  return (0, _confirm["default"])((0, _objectSpread2["default"])({
    type: 'warning',
    iconType: 'warning',
    okCancel: false
  }, (0, _utils.normalizeProps)(props)));
};

_Modal["default"].destroyAll = function destroyAllFn() {
  _modalManager["default"].clear();
};

var _default = _Modal["default"];
exports["default"] = _default;
//# sourceMappingURL=index.js.map
