"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.closeFnSet = void 0;
exports.show = show;
var _react = _interopRequireDefault(require("react"));
var _dialog = require("./dialog");
var _renderImperatively = require("../../utils/render-imperatively");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const closeFnSet = exports.closeFnSet = new Set();
function show(props) {
  const handler = (0, _renderImperatively.renderImperatively)(_react.default.createElement(_dialog.Dialog, Object.assign({}, props, {
    afterClose: () => {
      var _a;
      closeFnSet.delete(handler.close);
      (_a = props.afterClose) === null || _a === void 0 ? void 0 : _a.call(props);
    }
  })));
  closeFnSet.add(handler.close);
  return handler;
}