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ACxC,OAAO,MAAM,QAAQ,CAAC;AACxB;AASO,SAAS,0CAAoB,KAA+B;IACjE,IAAI,gBAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;IACrC,IAAI,qBAAqB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;IAC1C,IAAI,QAAQ,iBAAiB;IAC7B,IAAI,OAAO,CAAA,GAAA,kDAAqB,EAAE,OAAO;IACzC,OAAO,MAAM,QAAQ,CAAC;AACxB;AAYO,MAAM,yDAAkB,CAAA,GAAA,uBAAS,EAAE,SAAS,gBACjD,KAA2B,EAC3B,GAAqC;IAErC,IAAI,UAAC,MAAM,UAAE,MAAM,aAAE,YAAY,8BAA8B,GAAG,cAAa,GAAG;IAClF,IAAI,gBAAgB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;IACrC,IAAI,qBAAqB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;IAC1C,IAAI,QAAQ,iBAAiB;IAC7B,IAAI,OAAO,CAAA,GAAA,8CAAiB,EAAE;gBAAC;gBAAQ;IAAM,GAAG;IAEhD,qBACE,0DAAC,CAAA,GAAA,iCAAM;QAAG,GAAG,YAAY;QAAE,WAAW;QAAW,KAAK;OACnD;AAGP","sources":["packages/react-aria-components/src/Calendar.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {\n  CalendarHeadingProps as AriaCalendarHeadingProps,\n  CalendarMonthPickerProps as AriaCalendarMonthPickerProps,\n  AriaCalendarProps,\n  CalendarYearPickerProps as AriaCalendarYearPickerProps,\n  CalendarMonthPickerAria,\n  CalendarYearPickerAria,\n  useCalendar,\n  useCalendarCell,\n  useCalendarGrid,\n  useCalendarHeading,\n  useCalendarMonthPicker,\n  useCalendarYearPicker\n} from 'react-aria/useCalendar';\nimport {AriaRangeCalendarProps, useRangeCalendar} from 'react-aria/useRangeCalendar';\nimport {ButtonContext} from './Button';\nimport {\n  CalendarDate,\n  CalendarIdentifier,\n  createCalendar,\n  DateDuration,\n  endOfMonth,\n  Calendar as ICalendar,\n  isSameDay,\n  isSameMonth,\n  isToday\n} from '@internationalized/date';\nimport {CalendarSelectionMode, CalendarState} from 'react-stately/useCalendarState';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  DOMProps,\n  DOMRenderProps,\n  Provider,\n  RenderProps,\n  SlotProps,\n  StyleProps,\n  useContextProps,\n  useRenderProps,\n  useSlottedContext\n} from './utils';\nimport {DateValue, useRangeCalendarState} from 'react-stately/useRangeCalendarState';\nimport {\n  DOMAttributes,\n  FocusableElement,\n  forwardRefType,\n  GlobalDOMAttributes,\n  HoverEvents\n} from '@react-types/shared';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {Heading, HeadingContext, HeadingProps} from './Heading';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendarState} from 'react-stately/useRangeCalendarState';\nimport React, {\n  createContext,\n  ForwardedRef,\n  forwardRef,\n  JSX,\n  ReactElement,\n  useContext,\n  useRef\n} from 'react';\nimport {TextContext} from './Text';\nimport {useCalendarState} from 'react-stately/useCalendarState';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface CalendarRenderProps<M extends CalendarSelectionMode = 'single'> {\n  /**\n   * Whether the calendar is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * State of the calendar.\n   */\n  state: CalendarState<M>;\n  /**\n   * Whether the calendar is invalid.\n   *\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean;\n}\n\nexport interface RangeCalendarRenderProps extends Omit<CalendarRenderProps, 'state'> {\n  /**\n   * State of the range calendar.\n   */\n  state: RangeCalendarState;\n}\n\nexport interface CalendarProps<T extends DateValue, M extends CalendarSelectionMode = 'single'>\n  extends\n    Omit<AriaCalendarProps<T, M>, 'errorMessage' | 'validationState'>,\n    RenderProps<CalendarRenderProps<M>, 'div'>,\n    SlotProps,\n    GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-Calendar'\n   */\n  className?: ClassNameOrFunction<CalendarRenderProps<M>>;\n  /**\n   * The amount of days that will be displayed at once. This affects how pagination works.\n   *\n   * @default { months: 1 }\n   */\n  visibleDuration?: DateDuration;\n  /**\n   * A function to create a new\n   * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n   * given calendar identifier. If not provided, the `createCalendar` function from\n   * `@internationalized/date` will be used.\n   */\n  createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface RangeCalendarProps<T extends DateValue>\n  extends\n    Omit<AriaRangeCalendarProps<T>, 'errorMessage' | 'validationState'>,\n    RenderProps<RangeCalendarRenderProps, 'div'>,\n    SlotProps,\n    GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-RangeCalendar'\n   */\n  className?: ClassNameOrFunction<RangeCalendarRenderProps>;\n  /**\n   * The amount of days that will be displayed at once. This affects how pagination works.\n   *\n   * @default { months: 1 }\n   */\n  visibleDuration?: DateDuration;\n  /**\n   * A function to create a new\n   * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n   * given calendar identifier. If not provided, the `createCalendar` function from\n   * `@internationalized/date` will be used.\n   */\n  createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport const CalendarContext =\n  createContext<ContextValue<CalendarProps<any, CalendarSelectionMode>, HTMLDivElement>>(null);\nexport const RangeCalendarContext =\n  createContext<ContextValue<RangeCalendarProps<any>, HTMLDivElement>>(null);\nexport const CalendarStateContext = createContext<CalendarState<CalendarSelectionMode> | null>(\n  null\n);\nexport const RangeCalendarStateContext = createContext<RangeCalendarState | null>(null);\n\n/**\n * A calendar displays one or more date grids and allows users to select a single date.\n */\nexport const Calendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Calendar<\n  T extends DateValue,\n  M extends CalendarSelectionMode = 'single'\n>(props: CalendarProps<T, M>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, CalendarContext);\n  let {locale} = useLocale();\n  let state = useCalendarState({\n    ...props,\n    locale,\n    createCalendar: props.createCalendar || createCalendar\n  });\n\n  let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} = useCalendar(\n    props,\n    state\n  );\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false,\n      isInvalid: state.isValueInvalid\n    },\n    defaultClassName: 'react-aria-Calendar'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps, calendarProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}\n      data-invalid={state.isValueInvalid || undefined}>\n      <Provider\n        values={[\n          [\n            ButtonContext,\n            {\n              slots: {\n                previous: prevButtonProps,\n                next: nextButtonProps\n              }\n            }\n          ],\n          [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n          [CalendarStateContext, state],\n          [CalendarContext, props as any],\n          [\n            TextContext,\n            {\n              slots: {\n                errorMessage: errorMessageProps\n              }\n            }\n          ]\n        ]}>\n        {/* Add a screen reader only description of the entire visible range rather than\n         * a separate heading above each month grid. This is placed first in the DOM order\n         * so that it is the first thing a touch screen reader user encounters.\n         * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n         * elements, so the aria-label of the Calendar is included here as well. */}\n        <VisuallyHidden>\n          <h2>{calendarProps['aria-label']}</h2>\n        </VisuallyHidden>\n        {renderProps.children}\n        {/* For touch screen readers, add a visually hidden next button after the month grid\n         * so it's easy to navigate after reaching the end without going all the way\n         * back to the start of the month. */}\n        <VisuallyHidden>\n          <button\n            aria-label={nextButtonProps['aria-label']}\n            disabled={nextButtonProps.isDisabled}\n            onClick={() => state.focusNextPage()}\n            tabIndex={-1}\n          />\n        </VisuallyHidden>\n      </Provider>\n    </dom.div>\n  );\n});\n\n/**\n * A range calendar displays one or more date grids and allows users to select a contiguous range of\n * dates.\n */\nexport const RangeCalendar = /*#__PURE__*/ (forwardRef as forwardRefType)(function RangeCalendar<\n  T extends DateValue\n>(props: RangeCalendarProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, RangeCalendarContext);\n  let {locale} = useLocale();\n  let state = useRangeCalendarState({\n    ...props,\n    locale,\n    createCalendar: props.createCalendar || createCalendar\n  });\n\n  let {calendarProps, prevButtonProps, nextButtonProps, errorMessageProps, title} =\n    useRangeCalendar(props, state, ref);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      state,\n      isDisabled: props.isDisabled || false,\n      isInvalid: state.isValueInvalid\n    },\n    defaultClassName: 'react-aria-RangeCalendar'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(renderProps, DOMProps, calendarProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-disabled={props.isDisabled || undefined}\n      data-invalid={state.isValueInvalid || undefined}>\n      <Provider\n        values={[\n          [\n            ButtonContext,\n            {\n              slots: {\n                previous: prevButtonProps,\n                next: nextButtonProps\n              }\n            }\n          ],\n          [HeadingContext, {'aria-hidden': true, level: 2, children: title}],\n          [RangeCalendarStateContext, state],\n          [RangeCalendarContext, props as RangeCalendarProps<any>],\n          [\n            TextContext,\n            {\n              slots: {\n                errorMessage: errorMessageProps\n              }\n            }\n          ]\n        ]}>\n        {/* Add a screen reader only description of the entire visible range rather than\n         * a separate heading above each month grid. This is placed first in the DOM order\n         * so that it is the first thing a touch screen reader user encounters.\n         * In addition, VoiceOver on iOS does not announce the aria-label of the grid\n         * elements, so the aria-label of the Calendar is included here as well. */}\n        <VisuallyHidden>\n          <h2>{calendarProps['aria-label']}</h2>\n        </VisuallyHidden>\n        {renderProps.children}\n        {/* For touch screen readers, add a visually hidden next button after the month grid\n         * so it's easy to navigate after reaching the end without going all the way\n         * back to the start of the month. */}\n        <VisuallyHidden>\n          <button\n            aria-label={nextButtonProps['aria-label']}\n            disabled={nextButtonProps.isDisabled}\n            onClick={() => state.focusNextPage()}\n            tabIndex={-1}\n          />\n        </VisuallyHidden>\n      </Provider>\n    </dom.div>\n  );\n});\n\nexport interface CalendarCellRenderProps {\n  /** The date that the cell represents. */\n  date: CalendarDate;\n  /** The day number formatted according to the current locale. */\n  formattedDate: string;\n  /**\n   * Whether the cell is currently hovered with a mouse.\n   *\n   * @selector [data-hovered]\n   */\n  isHovered: boolean;\n  /**\n   * Whether the cell is currently being pressed.\n   *\n   * @selector [data-pressed]\n   */\n  isPressed: boolean;\n  /**\n   * Whether the cell is selected.\n   *\n   * @selector [data-selected]\n   */\n  isSelected: boolean;\n  /**\n   * Whether the cell is the first date in a range selection.\n   *\n   * @selector [data-selection-start]\n   */\n  isSelectionStart: boolean;\n  /**\n   * Whether the cell is the last date in a range selection.\n   *\n   * @selector [data-selection-end]\n   */\n  isSelectionEnd: boolean;\n  /**\n   * Whether the cell is focused.\n   *\n   * @selector [data-focused]\n   */\n  isFocused: boolean;\n  /**\n   * Whether the cell is keyboard focused.\n   *\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean;\n  /**\n   * Whether the cell is disabled, according to the calendar's `minValue`, `maxValue`, and\n   * `isDisabled` props. Disabled dates are not focusable, and cannot be selected by the user. They\n   * are typically displayed with a dimmed appearance.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * Whether the cell is outside the visible range of the calendar.\n   * For example, dates before the first day of a month in the same week.\n   *\n   * @selector [data-outside-visible-range]\n   */\n  isOutsideVisibleRange: boolean;\n  /**\n   * Whether the cell is outside the current month.\n   *\n   * @selector [data-outside-month]\n   */\n  isOutsideMonth: boolean;\n  /**\n   * Whether the cell is unavailable, according to the calendar's `isDateUnavailable` prop.\n   * Unavailable dates remain focusable, but cannot be selected by the user. They should be\n   * displayed with a visual affordance to indicate they are unavailable, such as a different color\n   * or a strikethrough.\n   *\n   * Note that because they are focusable, unavailable dates must meet a 4.5:1 color contrast ratio,\n   * [as defined by WCAG](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html).\n   *\n   * @selector [data-unavailable]\n   */\n  isUnavailable: boolean;\n  /**\n   * Whether the cell is part of an invalid selection.\n   *\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean;\n  /**\n   * Whether the cell is today.\n   *\n   * @selector [data-today]\n   */\n  isToday: boolean;\n}\n\nexport interface CalendarGridProps\n  extends StyleProps, DOMRenderProps<'table', undefined>, GlobalDOMAttributes<HTMLTableElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-CalendarGrid'\n   */\n  className?: string;\n  /**\n   * Either a function to render calendar cells for each date in the month,\n   * or children containing a `<CalendarGridHeader>`` and `<CalendarGridBody>`\n   * when additional customization is needed.\n   */\n  children?: ReactElement | ReactElement[] | ((date: CalendarDate) => ReactElement);\n  /**\n   * An offset from the beginning of the visible date range that this\n   * CalendarGrid should display. Useful when displaying more than one\n   * month at a time.\n   */\n  offset?: DateDuration;\n  /**\n   * The style of weekday names to display in the calendar grid header,\n   * e.g. single letter, abbreviation, or full day name.\n   *\n   * @default 'narrow'\n   */\n  weekdayStyle?: 'narrow' | 'short' | 'long';\n}\n\ninterface InternalCalendarGridContextValue {\n  headerProps: DOMAttributes<FocusableElement>;\n  weekDays: string[];\n  startDate: CalendarDate;\n  weeksInMonth: number;\n}\n\nconst InternalCalendarGridContext = createContext<InternalCalendarGridContextValue | null>(null);\n\n/**\n * A calendar grid displays a single grid of days within a calendar or range calendar which\n * can be keyboard navigated and selected by the user.\n */\nexport const CalendarGrid = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarGrid(\n  props: CalendarGridProps,\n  ref: ForwardedRef<HTMLTableElement>\n) {\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let calenderProps = useSlottedContext(CalendarContext)!;\n  let rangeCalenderProps = useSlottedContext(RangeCalendarContext)!;\n  let state = calendarState ?? rangeCalendarState!;\n  let startDate = state.visibleRange.start;\n  if (props.offset) {\n    startDate = startDate.add(props.offset);\n  }\n\n  let firstDayOfWeek = calenderProps?.firstDayOfWeek ?? rangeCalenderProps?.firstDayOfWeek;\n\n  let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid(\n    {\n      startDate,\n      endDate: endOfMonth(startDate),\n      weekdayStyle: props.weekdayStyle,\n      firstDayOfWeek\n    },\n    state\n  );\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <InternalCalendarGridContext.Provider value={{headerProps, weekDays, startDate, weeksInMonth}}>\n      <dom.table\n        render={props.render}\n        {...mergeProps(DOMProps, gridProps)}\n        ref={ref}\n        style={props.style}\n        cellPadding={0}\n        className={props.className ?? 'react-aria-CalendarGrid'}>\n        {typeof props.children !== 'function' ? (\n          props.children\n        ) : (\n          <>\n            <CalendarGridHeaderForwardRef>\n              {day => <CalendarHeaderCellForwardRef>{day}</CalendarHeaderCellForwardRef>}\n            </CalendarGridHeaderForwardRef>\n            <CalendarGridBodyForwardRef>{props.children}</CalendarGridBodyForwardRef>\n          </>\n        )}\n      </dom.table>\n    </InternalCalendarGridContext.Provider>\n  );\n});\n\nexport interface CalendarGridHeaderProps\n  extends\n    StyleProps,\n    DOMRenderProps<'thead', undefined>,\n    GlobalDOMAttributes<HTMLTableSectionElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-CalendarGridHeader'\n   */\n  className?: string;\n  /** A function to render a `<CalendarHeaderCell>` for a weekday name. */\n  children: (day: string) => ReactElement;\n}\n\nfunction CalendarGridHeader(\n  props: CalendarGridHeaderProps,\n  ref: ForwardedRef<HTMLTableSectionElement>\n) {\n  let {children, style, className} = props;\n  let {headerProps, weekDays} = useContext(InternalCalendarGridContext)!;\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.thead\n      render={props.render}\n      {...mergeProps(DOMProps, headerProps)}\n      ref={ref}\n      style={style}\n      className={className ?? 'react-aria-CalendarGridHeader'}>\n      <tr>{weekDays.map((day, key) => React.cloneElement(children(day), {key}))}</tr>\n    </dom.thead>\n  );\n}\n\n/**\n * A calendar grid header displays a row of week day names at the top of a month.\n */\nconst CalendarGridHeaderForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(\n  CalendarGridHeader\n);\nexport {CalendarGridHeaderForwardRef as CalendarGridHeader};\n\nexport interface CalendarHeaderCellProps\n  extends\n    DOMProps,\n    DOMRenderProps<'th', undefined>,\n    GlobalDOMAttributes<HTMLTableHeaderCellElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-CalendarHeaderCell'\n   */\n  className?: string;\n}\n\nfunction CalendarHeaderCell(\n  props: CalendarHeaderCellProps,\n  ref: ForwardedRef<HTMLTableCellElement>\n) {\n  let {children, style, className} = props;\n  let DOMProps = filterDOMProps(props, {global: true});\n  return (\n    <dom.th\n      render={props.render}\n      {...DOMProps}\n      ref={ref}\n      style={style}\n      className={className || 'react-aria-CalendarHeaderCell'}>\n      {children}\n    </dom.th>\n  );\n}\n\n/**\n * A calendar header cell displays a week day name at the top of a column within a calendar.\n */\nconst CalendarHeaderCellForwardRef = forwardRef(CalendarHeaderCell);\nexport {CalendarHeaderCellForwardRef as CalendarHeaderCell};\n\nexport interface CalendarGridBodyProps\n  extends\n    StyleProps,\n    DOMRenderProps<'tbody', undefined>,\n    GlobalDOMAttributes<HTMLTableSectionElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-CalendarGridBody'\n   */\n  className?: string;\n  /** A function to render a `<CalendarCell>` for a given date. */\n  children: (date: CalendarDate) => ReactElement;\n}\n\nfunction CalendarGridBody(\n  props: CalendarGridBodyProps,\n  ref: ForwardedRef<HTMLTableSectionElement>\n) {\n  let {children, style, className} = props;\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let state = calendarState ?? rangeCalendarState!;\n  let {startDate, weeksInMonth} = useContext(InternalCalendarGridContext)!;\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.tbody\n      render={props.render}\n      {...DOMProps}\n      ref={ref}\n      style={style}\n      className={className ?? 'react-aria-CalendarGridBody'}>\n      {[...new Array(weeksInMonth).keys()].map(weekIndex => (\n        <tr key={weekIndex}>\n          {state\n            .getDatesInWeek(weekIndex, startDate)\n            .map((date, i) =>\n              date ? React.cloneElement(children(date), {key: i}) : <td key={i} />\n            )}\n        </tr>\n      ))}\n    </dom.tbody>\n  );\n}\n\n/**\n * A calendar grid body displays a grid of calendar cells within a month.\n */\nconst CalendarGridBodyForwardRef = /*#__PURE__*/ (forwardRef as forwardRefType)(CalendarGridBody);\nexport {CalendarGridBodyForwardRef as CalendarGridBody};\n\nexport interface CalendarCellProps\n  extends\n    RenderProps<CalendarCellRenderProps, 'div'>,\n    HoverEvents,\n    GlobalDOMAttributes<HTMLTableCellElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-CalendarCell'\n   */\n  className?: ClassNameOrFunction<CalendarCellRenderProps>;\n  /** The date to render in the cell. */\n  date: CalendarDate;\n}\n\n/**\n * A calendar cell displays a date cell within a calendar grid which can be selected by the user.\n */\nexport const CalendarCell = /*#__PURE__*/ (forwardRef as forwardRefType)(function CalendarCell(\n  {date, ...otherProps}: CalendarCellProps,\n  ref: ForwardedRef<HTMLTableCellElement>\n) {\n  let calendarState = useContext(CalendarStateContext);\n  let rangeCalendarState = useContext(RangeCalendarStateContext);\n  let state = calendarState ?? rangeCalendarState!;\n  let {startDate: currentMonth} = useContext(InternalCalendarGridContext) ?? {\n    startDate: state.visibleRange.start\n  };\n  let isOutsideMonth =\n    state.visibleDuration.days || state.visibleDuration.weeks\n      ? false\n      : !isSameMonth(currentMonth, date);\n  let istoday = isToday(date, state.timeZone);\n\n  let buttonRef = useRef<HTMLDivElement>(null);\n  let {cellProps, buttonProps, ...states} = useCalendarCell(\n    {date, isOutsideMonth},\n    state,\n    buttonRef\n  );\n\n  let {hoverProps, isHovered} = useHover({\n    ...otherProps,\n    isDisabled: states.isDisabled || states.isUnavailable\n  });\n  let {focusProps, isFocusVisible} = useFocusRing();\n  isFocusVisible &&= states.isFocused;\n  let isSelectionStart = false;\n  let isSelectionEnd = false;\n  if ('highlightedRange' in state && state.highlightedRange) {\n    isSelectionStart = isSameDay(date, state.highlightedRange.start);\n    isSelectionEnd = isSameDay(date, state.highlightedRange.end);\n  }\n\n  let renderProps = useRenderProps({\n    ...otherProps,\n    defaultChildren: states.formattedDate,\n    defaultClassName: 'react-aria-CalendarCell',\n    values: {\n      date,\n      isHovered,\n      isOutsideMonth,\n      isFocusVisible,\n      isSelectionStart,\n      isSelectionEnd,\n      isToday: istoday,\n      ...states\n    }\n  });\n\n  let dataAttrs = {\n    'data-focused': states.isFocused || undefined,\n    'data-hovered': isHovered || undefined,\n    'data-pressed': states.isPressed || undefined,\n    'data-unavailable': states.isUnavailable || undefined,\n    'data-disabled': states.isDisabled || undefined,\n    'data-focus-visible': isFocusVisible || undefined,\n    'data-outside-visible-range': states.isOutsideVisibleRange || undefined,\n    'data-outside-month': isOutsideMonth || undefined,\n    'data-selected': states.isSelected || undefined,\n    'data-selection-start': isSelectionStart || undefined,\n    'data-selection-end': isSelectionEnd || undefined,\n    'data-invalid': states.isInvalid || undefined,\n    'data-today': istoday || undefined\n  };\n\n  let DOMProps = filterDOMProps(otherProps, {global: true});\n\n  return (\n    <td {...cellProps} ref={ref}>\n      <dom.div\n        {...mergeProps(DOMProps, buttonProps, focusProps, hoverProps, dataAttrs, renderProps)}\n        ref={buttonRef}\n      />\n    </td>\n  );\n});\n\nexport interface CalendarYearPickerProps extends AriaCalendarYearPickerProps {\n  /**\n   * A function to render the year picker.\n   */\n  children: (renderProps: CalendarYearPickerAria) => JSX.Element;\n}\n\nexport function CalendarYearPicker(props: CalendarYearPickerProps): JSX.Element {\n  let calendarState = React.useContext(CalendarStateContext);\n  let rangeCalendarState = React.useContext(RangeCalendarStateContext);\n  let state = calendarState || rangeCalendarState!;\n  let aria = useCalendarYearPicker(props, state);\n  return props.children(aria);\n}\n\nexport interface CalendarMonthPickerProps extends AriaCalendarMonthPickerProps {\n  /**\n   * A function to render the month picker.\n   */\n  children: (renderProps: CalendarMonthPickerAria) => JSX.Element;\n}\n\nexport function CalendarMonthPicker(props: CalendarMonthPickerProps): JSX.Element {\n  let calendarState = React.useContext(CalendarStateContext);\n  let rangeCalendarState = React.useContext(RangeCalendarStateContext);\n  let state = calendarState || rangeCalendarState!;\n  let aria = useCalendarMonthPicker(props, state);\n  return props.children(aria);\n}\n\nexport interface CalendarHeadingProps extends AriaCalendarHeadingProps, HeadingProps {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element.\n   *\n   * @default 'react-aria-CalendarHeading'\n   */\n  className?: string;\n}\n\nexport const CalendarHeading = forwardRef(function CalendarHeading(\n  props: CalendarHeadingProps,\n  ref: ForwardedRef<HTMLHeadingElement>\n) {\n  let {offset, format, className = 'react-aria-CalendarHeading', ...headingProps} = props;\n  let calendarState = React.useContext(CalendarStateContext);\n  let rangeCalendarState = React.useContext(RangeCalendarStateContext);\n  let state = calendarState || rangeCalendarState!;\n  let aria = useCalendarHeading({offset, format}, state);\n\n  return (\n    <Heading {...headingProps} className={className} ref={ref}>\n      {aria}\n    </Heading>\n  );\n});\n"],"names":[],"version":3,"file":"Calendar.cjs.map"}