"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _reactRedux = require("react-redux");

var _immutable = _interopRequireDefault(require("immutable"));

var _refNameHelpers = require("../../helpers/refNameHelpers");

var _notification = require("../../actions/notification");

var _record = require("../../actions/record");

var _reducers = require("../../reducers");

var _HierarchyReparentNotifier = _interopRequireDefault(require("../../components/record/HierarchyReparentNotifier"));

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

const mapStateToProps = (state, ownProps) => {
  const {
    childRefNames
  } = ownProps;
  return {
    childData: _immutable.default.Map(childRefNames.map(refName => [refName, (0, _reducers.getRecordData)(state, (0, _refNameHelpers.refNameToCsid)(refName))]))
  };
};

const mapDispatchToProps = {
  readRecord: _record.readRecord,
  removeNotification: _notification.removeNotification,
  showNotification: _notification.showNotification
};

var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_HierarchyReparentNotifier.default);

exports.default = _default;