import o from "./index-extends.js";
import b from "./index-objectWithoutPropertiesLoose.js";
import * as A from "react";
import { useLocaleText as D, useUtils as T } from "./index-useUtils.js";
import { Calendar as h } from "./index-icons.js";
import { useMaskedInput as R } from "./index-useMaskedInput.js";
import { jsx as r } from "react/jsx-runtime";
import y from "./index-InputAdornment.js";
import B from "./index-IconButton2.js";
const _ = ["className", "components", "disableOpenPicker", "getOpenDialogAriaText", "InputAdornmentProps", "InputProps", "inputRef", "openPicker", "OpenPickerButtonProps", "renderInput"], U = /* @__PURE__ */ A.forwardRef(function(i, s) {
  const {
    className: a,
    components: c = {},
    disableOpenPicker: d,
    getOpenDialogAriaText: p,
    InputAdornmentProps: n,
    InputProps: l,
    inputRef: u,
    openPicker: m,
    OpenPickerButtonProps: P,
    renderInput: f
  } = i, e = b(i, _), I = D(), k = p ?? I.openDatePickerDialogue, x = T(), O = R(e), t = (n == null ? void 0 : n.position) || "end", g = c.OpenPickerIcon || h;
  return f(o({
    ref: s,
    inputRef: u,
    className: a
  }, O, {
    InputProps: o({}, l, {
      [`${t}Adornment`]: d ? void 0 : /* @__PURE__ */ r(y, o({
        position: t
      }, n, {
        children: /* @__PURE__ */ r(B, o({
          edge: t,
          disabled: e.disabled || e.readOnly,
          "aria-label": k(e.rawValue, x)
        }, P, {
          onClick: m,
          children: /* @__PURE__ */ r(g, {})
        }))
      }))
    })
  }));
});
export {
  U as KeyboardDateInput
};
