"use strict";

exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireWildcard(require("react"));
var _reactRedux = require("react-redux");
var _locale = require("../selectors/locale");
var _reactDatepicker = require("react-datepicker");
var date_fns_locale = _interopRequireWildcard(require("date-fns/locale"));
var _localizationHelper = require("../utils/localizationHelper");
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
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 Culture = function Culture() {
  var _navigator$language;
  var locale = (0, _reactRedux.useSelector)(_locale.currentLocaleOrDefault);
  var language = (_navigator$language = navigator.language) != null ? _navigator$language : locale;
  (0, _react.useMemo)(function () {
    var fnsLocale = (0, _localizationHelper.findCorrespondingLocale)(date_fns_locale, language);
    if (fnsLocale != null) {
      (0, _reactDatepicker.registerLocale)(language, fnsLocale);
      (0, _reactDatepicker.setDefaultLocale)(language);
    }
  }, [language]);
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
};
__signature__(Culture, "useSelector{locale}\nuseMemo{}", function () {
  return [_reactRedux.useSelector];
});
__signature__(Culture, "useSelector{locale}\nuseMemo{}", function () {
  return [_reactRedux.useSelector];
});
var _default = Culture;
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(Culture, "Culture", "/home/vsts/work/1/s/src/components/Culture.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Culture.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(Culture, "Culture", "/home/vsts/work/1/s/src/components/Culture.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Culture.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();