'use strict';

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

var _immutable = require('immutable');

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

var _presenter2 = _interopRequireDefault(_presenter);

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

var _stateHelper2 = _interopRequireDefault(_stateHelper);

var _quizzes = require('../../../../../../building/api/quizzes');

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

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

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

function mapStateToProps() {
  var activeQuiz = _stateHelper2.default.activeQuiz();
  var workingInst = activeQuiz.getWorkingInstance();

  return {
    activeQuizId: activeQuiz.id,
    filterIpAddress: workingInst.filterIpAddress,
    filters: workingInst.filters || (0, _immutable.Map)()
  };
}

var actions = { setFilterIpAddress: _quizzes.setFilterIpAddress, setIpFiltersApi: _quizzes.setIpFiltersApi, setIpFiltersUi: _quizzes.setIpFiltersUi, screenreaderNotification: _alerts.screenreaderNotification };

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