'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.mapStateToProps = undefined;

var _reactRedux = require('../../../../react-redux');

var _stateHelper = require('../../../../../common/util/stateHelper');

var _stateHelper2 = _interopRequireDefault(_stateHelper);

var _makeEditable = require('../../../../../common/components/shared/functionality/makeEditable');

var _makeEditable2 = _interopRequireDefault(_makeEditable);

var _presenter = require('./presenter');

var _presenter2 = _interopRequireDefault(_presenter);

var _alerts = require('../../../../../common/actions/alerts');

var _modifications = require('../../../../../common/actions/modifications');

var _quizEntries = require('../../../../../building/api/quizEntries');

var _ui = require('../../../../../common/actions/ui');

var _modal = require('../../../../../common/actions/modal');

var _constants = require('../../../../../constants');

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

var mapStateToProps = exports.mapStateToProps = function mapStateToProps(state, props) {
  var activeQuiz = _stateHelper2.default.activeQuiz();
  return {
    movedInSidebar: state.getIn(['ui', _constants.MOVED_IN_SIDEBAR]),
    movedQuizEntry: state.getIn(['ui', _constants.MOVED_QUIZ_ENTRY]),
    quizId: activeQuiz.id
  };
};

var mapDispatchToProps = {
  clearUI: _ui.clear,
  moveQuizEntry: _quizEntries.moveQuizEntry,
  moveTemporaryQuizEntry: _modifications.moveTemporaryQuizEntry,
  openMoveImmutableModal: _modal.openMoveImmutableModal,
  screenreaderNotification: _alerts.screenreaderNotification,
  setUI: _ui.set
};

exports.default = (0, _makeEditable2.default)((0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_presenter2.default));