"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _sharedMessages = _interopRequireDefault(require("../../sharedMessages"));
var _ConfirmationModal = _interopRequireDefault(require("../MaterialUI/DataDisplay/PredefinedElements/ConfirmationModal"));
var _constants = require("../../constants");
var _reactIntl = require("react-intl");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var ScopeModificationConfirmationDialog = function ScopeModificationConfirmationDialog(_ref) {
  var scopeDialogType = _ref.scopeDialogType,
    isModalOpened = _ref.isModalOpened,
    closeModalCallback = _ref.closeModalCallback,
    okCallback = _ref.okCallback;
  var message;
  var title;
  switch (scopeDialogType) {
    case _constants.scopeConfirmationDialogTypes.scopeChangeConfirmation:
      message = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _sharedMessages.default.scopeChangeWithOpenedTabsConfirmation);
      title = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _sharedMessages.default.scopeChangeWithOpenedTabsTitle);
      break;
    case _constants.scopeConfirmationDialogTypes.hasUnsavedDataMessage:
      message = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _sharedMessages.default.scopeChangeWithUnsavedDataConfirmation);
      title = /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _sharedMessages.default.scopeChangeWithUnsavedDataTitle);
      break;
    default:
      return null;
  }
  return /*#__PURE__*/_react.default.createElement(_ConfirmationModal.default, {
    title: title,
    message: message,
    open: isModalOpened,
    okButtonLabel: _sharedMessages.default.yes,
    cancelButtonLabel: _sharedMessages.default.no,
    okCallback: okCallback,
    cancelCallback: closeModalCallback,
    backdropClickCallback: closeModalCallback
  });
};
var _default = ScopeModificationConfirmationDialog;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(ScopeModificationConfirmationDialog, "ScopeModificationConfirmationDialog", "/home/vsts/work/1/s/src/components/Scope/ScopeModificationConfirmationDialog.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Scope/ScopeModificationConfirmationDialog.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(ScopeModificationConfirmationDialog, "ScopeModificationConfirmationDialog", "/home/vsts/work/1/s/src/components/Scope/ScopeModificationConfirmationDialog.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Scope/ScopeModificationConfirmationDialog.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();