import { _ as _defineProperty } from '../../../defineProperty-Dcer7TUY.js';
import { map, pick } from 'ramda';
import { ALLOWED_CONFIG_KEYS } from './constants.js';
import '../../../toPropertyKey-BAXkSB3z.js';
import '../../../typeof-D-UKOauR.js';

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var mergeConfig = function mergeConfig(columnData) {
  var configuration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
  var columnMap = new Map(); // Using Map for correct ordering of columns.

  configuration.forEach(function (config) {
    columnMap.set(config.key, config);
  });
  columnData.forEach(function (column) {
    var _col$hidden;
    var col = _objectSpread(_objectSpread({}, column), columnMap.get(column.key));
    col.hidden = (_col$hidden = col.hidden) !== null && _col$hidden !== void 0 ? _col$hidden : col.isShown === false;
    columnMap.set(column.key, col);
  });
  return Array.from(columnMap.values());
};
var packConfig = map(pick(ALLOWED_CONFIG_KEYS));

export { mergeConfig, packConfig };
//# sourceMappingURL=utils.js.map
