import a from "./index-extends.js";
import f from "./index-objectWithoutPropertiesLoose.js";
import * as P from "react";
import o from "./index-_virtual16.js";
import { useDatePickerDefaultizedProps as h, datePickerValueManager as g } from "./index-shared.js";
import { DatePickerToolbar as D } from "./index-DatePickerToolbar.js";
import { MobileWrapper as T } from "./index-MobileWrapper.js";
import { useDateValidation as y } from "./index-useDateValidation.js";
import { PureDateInput as O } from "./index-PureDateInput.js";
import { usePickerState as k } from "./index-usePickerState.js";
import { jsx as p } from "react/jsx-runtime";
import { CalendarOrClockPicker as C } from "./index-CalendarOrClockPicker.js";
const x = ["ToolbarComponent", "value", "onChange", "components", "componentsProps"], I = /* @__PURE__ */ P.forwardRef(function(s, l) {
  const e = h(s, "MuiMobileDatePicker"), c = y(e) !== null, {
    pickerProps: u,
    inputProps: m,
    wrapperProps: b
  } = k(e, g), {
    ToolbarComponent: d = D,
    components: n,
    componentsProps: t
  } = e, r = f(e, x), i = a({}, m, r, {
    components: n,
    componentsProps: t,
    ref: l,
    validationError: c
  });
  return /* @__PURE__ */ p(T, a({}, r, b, {
    DateInputProps: i,
    PureDateInputComponent: O,
    components: n,
    componentsProps: t,
    children: /* @__PURE__ */ p(C, a({}, u, {
      autoFocus: !0,
      toolbarTitle: e.label || e.toolbarTitle,
      ToolbarComponent: d,
      DateInputProps: i,
      components: n,
      componentsProps: t
    }, r))
  }));
});
process.env.NODE_ENV !== "production" && (I.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "yarn proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * Regular expression to detect "accepted" symbols.
   * @default /\dap/gi
   */
  acceptRegex: o.instanceOf(RegExp),
  autoFocus: o.bool,
  children: o.node,
  /**
   * className applied to the root component.
   */
  className: o.string,
  /**
   * If `true` the popup or dialog will immediately close after submitting full date.
   * @default `true` for Desktop, `false` for Mobile (based on the chosen wrapper and `desktopModeMediaQuery` prop).
   */
  closeOnSelect: o.bool,
  /**
   * Overrideable components.
   * @default {}
   */
  components: o.object,
  /**
   * The props used for each component slot.
   * @default {}
   */
  componentsProps: o.object,
  /**
   * Formats the day of week displayed in the calendar header.
   * @param {string} day The day of week provided by the adapter's method `getWeekdays`.
   * @returns {string} The name to display.
   * @default (day) => day.charAt(0).toUpperCase()
   */
  dayOfWeekFormatter: o.func,
  /**
   * Default calendar month displayed when `value={null}`.
   */
  defaultCalendarMonth: o.any,
  /**
   * Props applied to the [`Dialog`](https://mui.com/material-ui/api/dialog/) element.
   */
  DialogProps: o.object,
  /**
   * If `true`, the picker and text field are disabled.
   * @default false
   */
  disabled: o.bool,
  /**
   * If `true` future days are disabled.
   * @default false
   */
  disableFuture: o.bool,
  /**
   * If `true`, today's date is rendering without highlighting with circle.
   * @default false
   */
  disableHighlightToday: o.bool,
  /**
   * Disable mask on the keyboard, this should be used rarely. Consider passing proper mask for your format.
   * @default false
   */
  disableMaskedInput: o.bool,
  /**
   * Do not render open picker button (renders only text field with validation).
   * @default false
   */
  disableOpenPicker: o.bool,
  /**
   * If `true` past days are disabled.
   * @default false
   */
  disablePast: o.bool,
  /**
   * Get aria-label text for control that opens picker dialog. Aria-label text must include selected date. @DateIOType
   * @template TInputDate, TDate
   * @param {TInputDate} date The date from which we want to add an aria-text.
   * @param {MuiPickersAdapter<TDate>} utils The utils to manipulate the date.
   * @returns {string} The aria-text to render inside the dialog.
   * @default (date, utils) => `Choose date, selected date is ${utils.format(utils.date(date), 'fullDate')}`
   */
  getOpenDialogAriaText: o.func,
  /**
   * Get aria-label text for switching between views button.
   * @param {CalendarPickerView} currentView The view from which we want to get the button text.
   * @returns {string} The label of the view.
   * @deprecated Use the `localeText` prop of `LocalizationProvider` instead, see https://mui.com/x/react-date-pickers/localization/.
   */
  getViewSwitchingButtonText: o.func,
  ignoreInvalidInputs: o.bool,
  /**
   * Props to pass to keyboard input adornment.
   */
  InputAdornmentProps: o.object,
  /**
   * Format string.
   */
  inputFormat: o.string,
  InputProps: o.object,
  /**
   * Pass a ref to the `input` element.
   */
  inputRef: o.oneOfType([o.func, o.shape({
    current: o.object
  })]),
  label: o.node,
  /**
   * Left arrow icon aria-label text.
   * @deprecated
   */
  leftArrowButtonText: o.string,
  /**
   * If `true` renders `LoadingComponent` in calendar instead of calendar view.
   * Can be used to preload information and show it in calendar.
   * @default false
   */
  loading: o.bool,
  /**
   * Custom mask. Can be used to override generate from format. (e.g. `__/__/____ __:__` or `__/__/____ __:__ _M`).
   */
  mask: o.string,
  /**
   * Maximal selectable date. @DateIOType
   */
  maxDate: o.any,
  /**
   * Minimal selectable date. @DateIOType
   */
  minDate: o.any,
  /**
   * Callback fired when date is accepted @DateIOType.
   * @template TValue
   * @param {TValue} value The value that was just accepted.
   */
  onAccept: o.func,
  /**
   * Callback fired when the value (the selected date) changes @DateIOType.
   * @template TValue
   * @param {TValue} value The new parsed value.
   * @param {string} keyboardInputValue The current value of the keyboard input.
   */
  onChange: o.func.isRequired,
  /**
   * Callback fired when the popup requests to be closed.
   * Use in controlled mode (see open).
   */
  onClose: o.func,
  /**
   * Callback that fired when input value or new `value` prop validation returns **new** validation error (or value is valid after error).
   * In case of validation error detected `reason` prop return non-null value and `TextField` must be displayed in `error` state.
   * This can be used to render appropriate form error.
   *
   * [Read the guide](https://next.material-ui-pickers.dev/guides/forms) about form integration and error displaying.
   * @DateIOType
   *
   * @template TError, TInputValue
   * @param {TError} reason The reason why the current value is not valid.
   * @param {TInputValue} value The invalid value.
   */
  onError: o.func,
  /**
   * Callback firing on month change @DateIOType.
   * @template TDate
   * @param {TDate} month The new month.
   * @returns {void|Promise} -
   */
  onMonthChange: o.func,
  /**
   * Callback fired when the popup requests to be opened.
   * Use in controlled mode (see open).
   */
  onOpen: o.func,
  /**
   * Callback fired on view change.
   * @param {CalendarPickerView} view The new view.
   */
  onViewChange: o.func,
  /**
   * Callback firing on year change @DateIOType.
   * @template TDate
   * @param {TDate} year The new year.
   */
  onYearChange: o.func,
  /**
   * Control the popup or dialog open state.
   */
  open: o.bool,
  /**
   * Props to pass to keyboard adornment button.
   */
  OpenPickerButtonProps: o.object,
  /**
   * First view to show.
   * Must be a valid option from `views` list
   * @default 'day'
   */
  openTo: o.oneOf(["day", "month", "year"]),
  /**
   * Force rendering in particular orientation.
   */
  orientation: o.oneOf(["landscape", "portrait"]),
  /**
   * Make picker read only.
   * @default false
   */
  readOnly: o.bool,
  /**
   * Disable heavy animations.
   * @default typeof navigator !== 'undefined' && /(android)/i.test(navigator.userAgent)
   */
  reduceAnimations: o.bool,
  /**
   * Custom renderer for day. Check the [PickersDay](https://mui.com/x/api/date-pickers/pickers-day/) component.
   * @template TDate
   * @param {TDate} day The day to render.
   * @param {Array<TDate | null>} selectedDays The days currently selected.
   * @param {PickersDayProps<TDate>} pickersDayProps The props of the day to render.
   * @returns {JSX.Element} The element representing the day.
   */
  renderDay: o.func,
  /**
   * The `renderInput` prop allows you to customize the rendered input.
   * The `props` argument of this render prop contains props of [TextField](https://mui.com/material-ui/api/text-field/#props) that you need to forward.
   * Pay specific attention to the `ref` and `inputProps` keys.
   * @example ```jsx
   * renderInput={props => <TextField {...props} />}
   * ````
   * @param {MuiTextFieldPropsType} props The props of the input.
   * @returns {React.ReactNode} The node to render as the input.
   */
  renderInput: o.func.isRequired,
  /**
   * Component displaying when passed `loading` true.
   * @returns {React.ReactNode} The node to render when loading.
   * @default () => <span data-mui-test="loading-progress">...</span>
   */
  renderLoading: o.func,
  /**
   * Custom formatter to be passed into Rifm component.
   * @param {string} str The un-formatted string.
   * @returns {string} The formatted string.
   */
  rifmFormatter: o.func,
  /**
   * Right arrow icon aria-label text.
   * @deprecated
   */
  rightArrowButtonText: o.string,
  /**
   * Disable specific date. @DateIOType
   * @template TDate
   * @param {TDate} day The date to test.
   * @returns {boolean} Returns `true` if the date should be disabled.
   */
  shouldDisableDate: o.func,
  /**
   * Disable specific months dynamically.
   * Works like `shouldDisableDate` but for month selection view @DateIOType.
   * @template TDate
   * @param {TDate} month The month to check.
   * @returns {boolean} If `true` the month will be disabled.
   */
  shouldDisableMonth: o.func,
  /**
   * Disable specific years dynamically.
   * Works like `shouldDisableDate` but for year selection view @DateIOType.
   * @template TDate
   * @param {TDate} year The year to test.
   * @returns {boolean} Returns `true` if the year should be disabled.
   */
  shouldDisableYear: o.func,
  /**
   * If `true`, days that have `outsideCurrentMonth={true}` are displayed.
   * @default false
   */
  showDaysOutsideCurrentMonth: o.bool,
  /**
   * If `true`, show the toolbar even in desktop mode.
   */
  showToolbar: o.bool,
  /**
   * Component that will replace default toolbar renderer.
   * @default DatePickerToolbar
   */
  ToolbarComponent: o.elementType,
  /**
   * Date format, that is displaying in toolbar.
   */
  toolbarFormat: o.string,
  /**
   * Mobile picker date value placeholder, displaying if `value` === `null`.
   * @default '–'
   */
  toolbarPlaceholder: o.node,
  /**
   * Mobile picker title, displaying in the toolbar.
   * @default 'Select date'
   */
  toolbarTitle: o.node,
  /**
   * The value of the picker.
   */
  value: o.any,
  /**
   * Array of views to show.
   * @default ['year', 'day']
   */
  views: o.arrayOf(o.oneOf(["day", "month", "year"]).isRequired)
});
export {
  I as MobileDatePicker
};
