import { jsx as e } from "react/jsx-runtime";
import { forwardRef as $ } from "react";
import { cx as c } from "../../utils/classNames.js";
import { useArrowTheme as y } from "../../hooks/useArrowTheme.js";
const C = $(
  ({
    count: m,
    startIndex: d,
    activeIndex: f,
    maxVisible: a,
    onDotClick: p,
    inverse: u,
    hover: v,
    focused: h,
    pressed: g,
    className: b
  }, w) => {
    const _ = y(), M = u ?? _.inverse, o = Math.max(m, 2), n = Math.max(0, Math.min(d, Math.max(0, o - a))), r = Math.min(n + a - 1, o - 1), s = [];
    for (let t = n; t <= r; t++) s.push(t);
    return /* @__PURE__ */ e(
      "nav",
      {
        ref: w,
        "aria-label": "Pagination navigation",
        className: c("tdds-pagination-dot", b),
        ...M ? { "data-inverse": "true" } : {},
        children: /* @__PURE__ */ e("ol", { role: "list", className: "tdds-pagination-dot__list", children: s.map((t) => {
          const N = o > a && t === n && n > 0, O = o > a && t === r && r < o - 1, i = N || O, l = `Go to slide ${t + 1} of ${o}`, P = i ? `${l}, more available` : l;
          return /* @__PURE__ */ e("li", { role: "listitem", children: /* @__PURE__ */ e(
            "button",
            {
              type: "button",
              className: c("tdds-pagination-dot__button", {
                "tdds-pagination-dot__button--overflow": i,
                "force-focus": !!h && t === 3,
                "force-hover": !!v && t === 3,
                "force-pressed": !!g && t === 3
              }),
              "aria-label": P,
              "aria-current": t === f ? "true" : void 0,
              onClick: () => p(t)
            }
          ) }, t);
        }) })
      }
    );
  }
);
C.displayName = "PaginationDot";
export {
  C as PaginationDot
};
//# sourceMappingURL=PaginationDot.js.map
