import _objectSpread from "@babel/runtime/helpers/objectSpread2";
import rjsf_enUS from '@visma/rjsf-core/dist/compiled-lang/en-US.json';
import rjsf_fiFI from '@visma/rjsf-core/dist/compiled-lang/fi-FI.json';
import rjsf_svSE from '@visma/rjsf-core/dist/compiled-lang/sv-SE.json';
import { forwardRef } from 'react';
import { IntlProvider, useIntl } from 'react-intl';
import formula_enUS from '../.compiled-lang/en-US.json';
import formula_fiFI from '../.compiled-lang/fi-FI.json';
import formula_svSE from '../.compiled-lang/sv-SE.json';
import { Form, Formula } from './Formula';
import { jsx as _jsx } from "react/jsx-runtime";
var formula_messages = {
  'en-US': formula_enUS,
  'fi-FI': formula_fiFI,
  'sv-SE': formula_svSE
};
var rjsf_messages = {
  'en-US': rjsf_enUS,
  'fi-FI': rjsf_fiFI,
  'sv-SE': rjsf_svSE
};

function withMessages(Form) {
  return /*#__PURE__*/forwardRef(function (props, ref) {
    var intl = useIntl();
    return /*#__PURE__*/_jsx(IntlProvider, _objectSpread(_objectSpread({}, intl), {}, {
      messages: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, rjsf_messages[intl.defaultLocale]), rjsf_messages[intl.locale]), formula_messages[intl.defaultLocale]), formula_messages[intl.locale]), intl.messages),
      children: /*#__PURE__*/_jsx(Form, _objectSpread({
        ref: ref
      }, props))
    }));
  });
}

var FormWithMessages = withMessages(Form);
var FormulaWithMessages = withMessages(Formula);
export * from '.';
export { FormulaWithMessages as Formula, FormWithMessages as Form, FormulaWithMessages as default };
//# sourceMappingURL=main.js.map