"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _lodash = require("lodash");

var _useLocalize = require("./useLocalize");

var _excluded = ["intl"];

function useLocalizeConfig() {
  var localize = (0, _useLocalize.useLocalize)();
  return function localizeConfig(_ref) {
    var intl = _ref.intl,
        other = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
    return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, (0, _lodash.mapValues)(other, function (value, key) {
      return Array.isArray(value) ? value.map(function (value) {
        return typeof value === 'object' ? localizeConfig(value) : value;
      }) : value;
    })), (0, _lodash.mapValues)(intl, localize));
  };
}
//# sourceMappingURL=useLocalizeConfig_intl_prop_proposal.cjs.map