"use strict";

exports.__esModule = true;
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

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

var _reactIntl = require("react-intl");

var _locale = require("../selectors/locale");

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

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};

var I18n = function I18n(props) {
  var locale = (0, _reactRedux.useSelector)(_locale.currentLocaleOrDefault);

  var messages = require("translations/" + locale + ".json");

  return /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, _extends({
    key: locale // TODO: Remove this when react-intl suports new React context API
    ,
    locale: locale,
    messages: messages
  }, props));
};

__signature__(I18n, "useSelector{locale}", function () {
  return [_reactRedux.useSelector];
});

__signature__(I18n, "useSelector{locale}", function () {
  return [_reactRedux.useSelector];
});

var _default = I18n;
var _default2 = _default;
var _default3 = _default2;
exports.default = _default3;
;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(I18n, "I18n", "/home/vsts/work/1/s/src/components/I18n.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/I18n.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();

;

(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;

  if (!reactHotLoader) {
    return;
  }

  reactHotLoader.register(I18n, "I18n", "/home/vsts/work/1/s/src/components/I18n.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/I18n.js");
})();

;

(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();