import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { useFormikContext } from 'formik';
import { equals } from 'ramda';
import { b as Button } from '../Button-C4c_dj-f.js';
import 'react-router-dom';
import '../utils-BJnb9o5c.js';
import '../renderIcon-C6twJSqH.js';
import '../primitives/Button.js';
import '../button-CePY5zne.js';
import '../index-Bo3AAQJp.js';
import '../index-CfriMyrd.js';
import '../index-BtkPdosV.js';
import '../primitives/Spinner.js';
import 'react-i18next';
import '../loader-circle-DycHUAWN.js';
import '../createLucideIcon-C8ycilSN.js';
import '../primitives/Tooltip.js';
import '../tooltip-0DecQ06t.js';
import '../index-DNzunGHb.js';
import '../index-CiyxEyB0.js';
import '../index-BNPynZWM.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-CSUSJzOJ.js';
import '../index-zW4GjM5L.js';
import '../index-DOzu5J1s.js';
import '../index-XvwNqU74.js';
import '../floating-ui.react-dom-BtFUJRfb.js';
import '../floating-ui.utils.dom-Bw_Rc4bg.js';
import '../index-BYZaLNq1.js';
import '../index-fV_U4ZJM.js';
import '../index-yFgkK_AM.js';
import '../index-Cor698lu.js';
import '../index-CSggBaQF.js';

const FormikButton = forwardRef(
  ({ disabled, ...otherProps }, ref) => {
    const { handleSubmit, isSubmitting, values, initialValues, isValid } = useFormikContext();
    const isDisabled = disabled ?? (isSubmitting || equals(values, initialValues));
    const handleClick = (event) => handleSubmit(event);
    return /* @__PURE__ */ jsx(
      Button,
      {
        ref,
        disabled: isDisabled,
        loading: isSubmitting && isValid,
        onClick: handleClick,
        ...otherProps
      }
    );
  }
);
FormikButton.displayName = "FormikButton";

export { FormikButton };
//# sourceMappingURL=Button.js.map
