import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { forwardRef } from 'react';
import { Field, getIn } from 'formik';
import { dissoc } from 'ramda';
import Input from '../Input.js';
import { jsx } from 'react/jsx-runtime';
import '@babel/runtime/helpers/slicedToArray';
import 'classnames';
import '../useId-Jj9hXm-g.js';
import 'react-router-dom';
import '@bigbinary/neeto-hotkeys';
import '../overlayManager.js';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '../index-QWVp_Xt6.js';
import '@bigbinary/neeto-cist';
import 'qs';
import '../en-Dmu3B4Vs.js';
import '../index-DyUNP5G9.js';
import '@babel/runtime/helpers/toConsumableArray';
import 'dayjs';
import 'dayjs/plugin/localeData';
import 'dayjs/plugin/utc';
import 'dayjs/plugin/weekday';
import 'dayjs/plugin/weekOfYear';
import 'i18next';
import '../Label.js';
import '@bigbinary/neeto-icons/Help';
import '../Button.js';
import '../Spinner.js';
import '../Tooltip.js';
import '@tippyjs/react';
import 'tippy.js';
import '../usePrefersReducedMotion-n4ZJtExQ.js';
import '../Popover.js';
import '../Typography.js';

var _excluded = ["name"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var FormikInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var name = _ref.name,
    rest = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/jsx(Field, {
    name: name,
    children: function children(_ref2) {
      var field = _ref2.field,
        meta = _ref2.meta,
        form = _ref2.form;
      var _form$status = form.status,
        status = _form$status === void 0 ? {} : _form$status,
        setStatus = form.setStatus;
      var fieldStatus = getIn(status, name);
      var fieldProps = _objectSpread(_objectSpread({}, field), {}, {
        onChange: function onChange(e) {
          setStatus(dissoc(name, status));
          field.onChange(e);
        }
      });
      return /*#__PURE__*/jsx(Input, _objectSpread(_objectSpread({}, _objectSpread({
        ref: ref
      }, fieldProps)), {}, {
        error: meta.touched ? meta.error || fieldStatus : ""
      }, rest));
    }
  });
});
FormikInput.displayName = "FormikInput";

export { FormikInput as default };
//# sourceMappingURL=Input.js.map
