import { jsx } from "react/jsx-runtime";
import { DSInputMask, MASK_TYPES, MASK_PIPES } from "@elliemae/ds-form";
import {
  Controller
} from "react-hook-form";
const InputMask = ({
  name,
  defaultValue = "",
  rules = {},
  onChange: changeHandler,
  onBlur: onBlurHandler,
  ...rest
}) => /* @__PURE__ */ jsx(
  Controller,
  {
    name,
    rules,
    defaultValue,
    render: ({ field: { onChange, onBlur, ...props } }) => /* @__PURE__ */ jsx(
      DSInputMask,
      {
        ...rest,
        ...props,
        onChange: (e) => {
          onChange(e);
          if (changeHandler) changeHandler(e);
        },
        onBlur: (e) => {
          onBlur();
          if (onBlurHandler) onBlurHandler(e);
        }
      }
    )
  }
);
export {
  InputMask,
  MASK_PIPES,
  MASK_TYPES
};
