import { jsx as c } from "react/jsx-runtime";
import { translationService as u } from "./index-translation.service.js";
import { DateRangePickerFormatter as l } from "./index-DateRangePicker.formatter.js";
import o from "imask";
import f from "./index-moment.js";
import { forwardRef as h, useRef as d } from "react";
import { IMaskInput as k } from "react-imask";
const g = (r, m) => {
  const {
    onChange: n,
    ...s
  } = r, t = u.translateArray(f.monthsShort()), i = d([...t, ...t.map((e) => p(e)), ...t.map((e) => e.toLowerCase()), ...t.map((e) => e.toUpperCase())]), a = new l();
  function p(e) {
    return e.charAt(0).toUpperCase() + e.slice(1);
  }
  return c(k, {
    ...s,
    placeholder: "d m - d m",
    mask: "d m - d m",
    autofix: !0,
    lazy: !1,
    eager: !0,
    inputRef: m,
    autoCapitalize: "true",
    autoComplete: "true",
    definitions: {
      "#": /[1-9]/
    },
    blocks: {
      d: {
        mask: o.MaskedRange,
        placeholderChar: a.dayPlaceholder,
        from: 1,
        to: 31,
        maxLength: 2
      },
      m: {
        enum: i.current,
        mask: o.MaskedEnum,
        placeholderChar: a.monthPlaceholder,
        minLength: 3,
        maxLength: 3
      }
    },
    onAccept: (e) => n({
      target: {
        name: r.name,
        value: e
      }
    }),
    overwrite: !0
  });
}, w = h(g);
export {
  w as DateRangePickerIMaskInput
};
