import { j as o } from "../../node_modules/react/jsx-runtime.mjs";
import { useRef as O, useEffect as R } from "react";
import N from "../../node_modules/dayjs/dayjs.min.mjs";
import k from "../../node_modules/dayjs/plugin/weekOfYear.mjs";
import "../../node_modules/dayjs/locale/zh-cn.mjs";
import w from "../../node_modules/antd/es/calendar/index.mjs";
import a from "../../node_modules/antd/es/select/index.mjs";
import y from "../../node_modules/antd/es/grid/col.mjs";
import B from "../../node_modules/antd/es/grid/row.mjs";
N.extend(k);
N.locale("zh-cn");
const F = ({ fold: l = !1, ...g }) => {
  const m = { fold: l, ...g }, f = O(null);
  return R(() => {
    setTimeout(() => {
      var c, i;
      const t = (c = f.current) == null ? void 0 : c.querySelector(".ant-picker-calendar-date-today"), s = (i = t == null ? void 0 : t.parentNode) == null ? void 0 : i.parentNode, n = s == null ? void 0 : s.parentNode, u = n == null ? void 0 : n.parentNode;
      u.style.height = "auto", Array.from(n == null ? void 0 : n.children).forEach((r) => {
        l ? r.style.display = r === s ? "table-row" : "none" : r.style.display = "table-row";
      });
    }, 0);
  }, [l]), o.jsx("div", { ref: f, children: o.jsx(w, { className: "BitzCalendarBlock", fullscreen: !1, headerRender: m.headerRender ? m.headerRender : ({ value: t, type: s, onChange: n, onTypeChange: u }) => {
    const r = [];
    let p = t.clone();
    const z = t.localeData(), x = [];
    for (let e = 0; e < 12; e++)
      p = p.month(e), x.push(z.monthsShort(p));
    for (let e = 0; e < 12; e++)
      r.push(o.jsx(a.Option, { value: e, className: "month-item", children: x[e] }, e));
    const d = t.year(), S = t.month(), j = [];
    for (let e = d - 10; e < d + 10; e += 1)
      j.push(o.jsx(a.Option, { value: e, className: "year-item", children: e }, e));
    return o.jsx("div", { style: { padding: 8 }, children: o.jsxs(B, { gutter: 8, children: [o.jsx(y, { children: o.jsx(a, { size: "small", popupMatchSelectWidth: !1, className: "my-year-select", value: d, onChange: (e) => {
      const h = t.clone().year(e);
      n(h);
    }, children: j }) }), o.jsx(y, { children: o.jsx(a, { size: "small", popupMatchSelectWidth: !1, value: S, onChange: (e) => {
      const h = t.clone().month(e);
      n(h);
    }, children: r }) })] }) });
  } }) });
};
export {
  F as default
};
