'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var Button = require('../Button-BlNtYr1w.js');
require('react-router-dom');
require('../utils-BhM0B89p.js');
require('../renderIcon-BRrpZu9a.js');
require('../primitives/Button.js');
require('../button-CMl9rLXi.js');
require('../index-vioSzJOw.js');
require('../index-DuNgWCXZ.js');
require('../index-D-iDn9RI.js');
require('../primitives/Spinner.js');
require('react-i18next');
require('../loader-circle-Bw7zP2Gn.js');
require('../createLucideIcon-D0tRgV6l.js');
require('../primitives/Tooltip.js');
require('../tooltip-BYCcUMZn.js');
require('../index-COPkC3I5.js');
require('../index-CGUGhyIp.js');
require('../index-Bvu9MiFi.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-lWVw05cs.js');
require('../index-BwAq9ba8.js');
require('../index-CCdG4z4E.js');
require('../index-C9ICrOhM.js');
require('../floating-ui.react-dom-B4Aw6O7R.js');
require('../index-Bf0WsHta.js');
require('../index-Df-Ffa3s.js');
require('../index-DcCSSgb7.js');
require('../index-CyrAgb4H.js');
require('../index-CB9xFokC.js');

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

exports.FormikButton = FormikButton;
//# sourceMappingURL=Button.js.map
