import { jsx as r } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import p from "../../../Popover/Popover.js";
import { PopoverContainerVariant as c, PopoverContainerPosition as f, PopoverContainerSize as u } from "../../../Popover/types.js";
import { DEFAULT_FIRST_WEEK_DAY as C } from "../../../Calendar/calendar/timerange/presets/shared/offsetWeek.js";
import h from "../../../Calendar/hooks/useCalendarControlsRendering.js";
import v from "../../../../../core/Context/preact/useCoreContext.js";
import P from "../../../Calendar/Calendar.js";
import o from "../../../Calendar/calendar/facade/index.js";
function _({ isOpen: e, onClose: t, originDate: i, onHighlight: n, getGridLabel: a, targetElement: l }) {
  const { i18n: s } = v(), [d, m] = h();
  return /* @__PURE__ */ r(
    p,
    {
      containerSize: u.MEDIUM,
      dismiss: () => {
        t();
      },
      dismissible: !1,
      divider: !0,
      fitPosition: !0,
      open: e,
      position: f.BOTTOM,
      targetElement: l,
      withContentPadding: !0,
      variant: c.POPOVER,
      children: [
        /* @__PURE__ */ r(
          "div",
          {
            ref: m,
            role: "group",
            className: "adyen-pe-datepicker__controls",
            "aria-label": s.get("common.filters.types.date.calendar.navigation.label")
          }
        ),
        /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
          P,
          {
            getGridLabel: a,
            firstWeekDay: C,
            controls: o.controls.MINIMAL,
            highlight: o.highlight.ONE,
            dynamicBlockRows: !0,
            onlyCellsWithin: !0,
            originDate: i,
            onHighlight: n,
            renderControl: d,
            trackCurrentDay: !0
          }
        ) })
      ]
    }
  );
}
export {
  _ as CalendarInputPopover
};
