"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
var _exportNames = {
  Formula: true,
  Form: true
};
exports.Form = exports["default"] = exports.Formula = void 0;

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

var _enUS = _interopRequireDefault(require("@visma/rjsf-core/dist/compiled-lang/en-US.json"));

var _fiFI = _interopRequireDefault(require("@visma/rjsf-core/dist/compiled-lang/fi-FI.json"));

var _svSE = _interopRequireDefault(require("@visma/rjsf-core/dist/compiled-lang/sv-SE.json"));

var _react = require("react");

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

var _enUS2 = _interopRequireDefault(require("../.compiled-lang/en-US.json"));

var _fiFI2 = _interopRequireDefault(require("../.compiled-lang/fi-FI.json"));

var _svSE2 = _interopRequireDefault(require("../.compiled-lang/sv-SE.json"));

var _Formula = require("./Formula");

var _jsxRuntime = require("react/jsx-runtime");

var _ = require(".");

Object.keys(_).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
  if (key in exports && exports[key] === _[key]) return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _[key];
    }
  });
});
var formula_messages = {
  'en-US': _enUS2["default"],
  'fi-FI': _fiFI2["default"],
  'sv-SE': _svSE2["default"]
};
var rjsf_messages = {
  'en-US': _enUS["default"],
  'fi-FI': _fiFI["default"],
  'sv-SE': _svSE["default"]
};

function withMessages(Form) {
  return /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
    var intl = (0, _reactIntl.useIntl)();
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactIntl.IntlProvider, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, intl), {}, {
      messages: (0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, rjsf_messages[intl.defaultLocale]), rjsf_messages[intl.locale]), formula_messages[intl.defaultLocale]), formula_messages[intl.locale]), intl.messages),
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Form, (0, _objectSpread2["default"])({
        ref: ref
      }, props))
    }));
  });
}

var FormWithMessages = withMessages(_Formula.Form);
exports.Form = FormWithMessages;
var FormulaWithMessages = withMessages(_Formula.Formula);
exports["default"] = exports.Formula = FormulaWithMessages;
//# sourceMappingURL=main.cjs.map