"use strict";

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

var _toast = _interopRequireDefault(require("antd-mobile/es/components/toast"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = function _default(_ref) {
  var _ref$icon = _ref.icon,
      icon = _ref$icon === void 0 ? 'success' : _ref$icon,
      title = _ref.title,
      _ref$duration = _ref.duration,
      duration = _ref$duration === void 0 ? 3000 : _ref$duration,
      _ref$mask = _ref.mask,
      mask = _ref$mask === void 0 ? false : _ref$mask;
  return new Promise(function (resolve) {
    _toast.default.show({
      icon: icon === 'none' ? undefined : icon,
      content: title,
      duration: duration,
      maskClickable: !mask,
      afterClose: function afterClose() {
        return resolve('');
      }
    });
  });
};

exports.default = _default;