"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = withLoadFormData;

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

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

var _react = require("react");

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

var _excluded = ["useLoadFormData"];

function withLoadFormData(Form) {
  return /*#__PURE__*/(0, _react.forwardRef)(function WithLoadFormData(_ref, ref) {
    var _useLoadFormData;

    var useLoadFormData = _ref.useLoadFormData,
        otherProps = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
    return /*#__PURE__*/(0, _jsxRuntime.jsx)(Form, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
      ref: ref
    }, otherProps), {}, {
      formData: (_useLoadFormData = useLoadFormData === null || useLoadFormData === void 0 ? void 0 : useLoadFormData(otherProps)) !== null && _useLoadFormData !== void 0 ? _useLoadFormData : otherProps.formData
    }));
  });
}
//# sourceMappingURL=withLoadFormData.cjs.map