import C from "../../../../@babel/runtime/helpers/esm/extends.mjs";
import * as D from "react";
import w from "./DecadeHeader.mjs";
import s, { DECADE_COL_COUNT as x } from "./DecadeBody.mjs";
import { createKeyDownHandler as y } from "../../utils/uiUtil.mjs";
import { DECADE_UNIT_DIFF as m, DECADE_DISTANCE_COUNT as u } from "./constant.mjs";
function I(e) {
  var f = e.prefixCls, g = e.onViewDateChange, r = e.generateConfig, a = e.viewDate, E = e.operationRef, c = e.onSelect, l = e.onPanelChange, h = "".concat(f, "-decade-panel");
  E.current = {
    onKeyDown: function(n) {
      return y(n, {
        onLeftRight: function(o) {
          c(r.addYear(a, o * m), "key");
        },
        onCtrlLeftRight: function(o) {
          c(r.addYear(a, o * u), "key");
        },
        onUpDown: function(o) {
          c(r.addYear(a, o * m * x), "key");
        },
        onEnter: function() {
          l("year", a);
        }
      });
    }
  };
  var d = function(n) {
    var t = r.addYear(a, n * u);
    g(t), l(null, t);
  }, v = function(n) {
    c(n, "mouse"), l("year", n);
  };
  return /* @__PURE__ */ D.createElement("div", {
    className: h
  }, /* @__PURE__ */ D.createElement(w, C({}, e, {
    prefixCls: f,
    onPrevDecades: function() {
      d(-1);
    },
    onNextDecades: function() {
      d(1);
    }
  })), /* @__PURE__ */ D.createElement(s, C({}, e, {
    prefixCls: f,
    onSelect: v
  })));
}
export {
  u as DECADE_DISTANCE_COUNT,
  m as DECADE_UNIT_DIFF,
  I as default
};
