"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.ConnectedRecordPage = void 0;
var _reactRedux = require("react-redux");
var _withConfig = _interopRequireDefault(require("../../enhancers/withConfig"));
var _RecordPage = _interopRequireWildcard(require("../../components/pages/RecordPage"));
var _record = require("../../actions/record");
var _recordPage = require("../../actions/recordPage");
var _reducers = require("../../reducers");
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const mapStateToProps = (state, ownProps) => {
  const {
    csid
  } = (0, _RecordPage.getParams)(ownProps);
  return {
    data: (0, _reducers.getRecordData)(state, csid),
    error: (0, _reducers.getRecordError)(state, csid),
    isSidebarOpen: (0, _reducers.isRecordSidebarOpen)(state),
    perms: (0, _reducers.getUserPerms)(state)
  };
};
const mapDispatchToProps = {
  clearRecord: _record.clearRecord,
  readRecord: _record.readRecord,
  setRecordPagePrimaryCsid: _recordPage.setRecordPagePrimaryCsid
};
const ConnectedRecordPage = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(_RecordPage.default);
exports.ConnectedRecordPage = ConnectedRecordPage;
var _default = (0, _withConfig.default)(ConnectedRecordPage);
exports.default = _default;