"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _CircularProgress = _interopRequireDefault(require("@material-ui/core/CircularProgress"));
var _ComponentContainer = _interopRequireDefault(require("../../../Framework/ComponentContainer"));
var _ServiceLocator = require("../../ServiceLocator");
var _SaveConfiguration = _interopRequireDefault(require("../Components/SaveConfiguration"));
var _Selectors = require("../../Reducers/Configurator/Selectors");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var mapStateToProps = function mapStateToProps(_ref) {
  var ui = _ref.ui,
    configurator = _ref.configurator;
  return {
    Component: _SaveConfiguration["default"],
    ProgressComponent: _CircularProgress["default"],
    show: !!ui.visibilityMap.saveConfiguration,
    workInProgress: !!ui.backgroundWorkMap.saveConfiguration,
    errorMessage: ui.error && ui.error.message,
    code: configurator.configuration.code || '',
    savedconfiguration: configurator.configuration,
    loadLoginInfoInProgress: !!ui.backgroundWorkMap.loadLoginInfo,
    shareUrl: (0, _Selectors.getShareUrl)(configurator)
  };
};
var mapDispatchToProps = function mapDispatchToProps() {
  return {
    onClose: function onClose() {
      return _ServiceLocator.Services.ui.hide('saveConfiguration');
    },
    onOkClick: function onOkClick() {
      return _ServiceLocator.Services.ui.hide('saveConfiguration');
    }
  };
};
var _default = exports["default"] = (0, _ComponentContainer["default"])(mapStateToProps, mapDispatchToProps);