'use strict';

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

var _redux = require('redux');

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

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

var _presenter2 = _interopRequireDefault(_presenter);

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

var modalActions = _interopRequireWildcard(_modal);

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

var _interactionTypes = require('../../../common/api/interactionTypes');

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

var _stateHelper2 = _interopRequireDefault(_stateHelper);

var _modalHelpers = require('../../../common/util/modalHelpers');

var _featureCheck = require('../../../common/util/featureCheck');

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

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

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

function mapStateToProps(state, props) {
  return {
    modalOpen: state.getIn(['modal', 'isOpen']) === _constants.ADD_BANK_ENTRY_MODAL,
    modalTrigger: (0, _modalHelpers.getModalTrigger)(state),
    interactionTypes: _stateHelper2.default.interactionTypes(),
    stimulusBankingOn: (0, _featureCheck.featureOn)('stimulus_banking')
  };
}

var mapDispatchToProps = function mapDispatchToProps(dispatch, props) {
  return {
    closeModal: (0, _redux.bindActionCreators)(modalActions.closeModal, dispatch),
    createBankItem: (0, _redux.bindActionCreators)(_modifications.createBankItem, dispatch),
    getInteractionTypes: (0, _redux.bindActionCreators)(_interactionTypes.interactionTypeFetch, dispatch),
    navigateToBankEntry: (0, _redux.bindActionCreators)(props.navigateToBankEntry, dispatch)
  };
};

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