"use client";
import { jsx as a, jsxs as r } from "react/jsx-runtime";
import { cn as i } from "../../lib/utils.js";
import { buttonVariants as c } from "./button.js";
import m from "../../node_modules/lucide-react/dist/esm/icons/ellipsis.js";
import p from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
import d from "../../node_modules/lucide-react/dist/esm/icons/chevron-left.js";
import u from "../../node_modules/lucide-react/dist/esm/icons/chevron-first.js";
import g from "../../node_modules/lucide-react/dist/esm/icons/chevron-last.js";
function j({ className: n, ...e }) {
  return /* @__PURE__ */ a(
    "nav",
    {
      role: "navigation",
      "aria-label": "pagination",
      "data-slot": "pagination",
      className: i("mx-auto flex w-full justify-center", n),
      ...e
    }
  );
}
function k({
  className: n,
  ...e
}) {
  return /* @__PURE__ */ a(
    "ul",
    {
      "data-slot": "pagination-content",
      className: i("flex flex-row items-center gap-1", n),
      ...e
    }
  );
}
function C({ ...n }) {
  return /* @__PURE__ */ a("li", { "data-slot": "pagination-item", ...n });
}
function o({
  className: n,
  isActive: e,
  isDisabled: t,
  size: s = "icon",
  ...l
}) {
  return /* @__PURE__ */ a(
    "a",
    {
      "aria-current": e ? "page" : void 0,
      "data-slot": "pagination-link",
      "data-active": e,
      className: i(
        "border-d-border/30 select-none",
        c({
          variant: e ? "outline" : "ghost",
          size: s
        }),
        t && "pointer-events-none cursor-not-allowed opacity-40",
        e && "bg-d-secondary border-d-border border",
        n
      ),
      ...l
    }
  );
}
function G({
  className: n,
  label: e,
  ...t
}) {
  return /* @__PURE__ */ r(
    o,
    {
      "aria-label": "Go to previous page",
      className: i(
        "flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
        n
      ),
      ...t,
      children: [
        /* @__PURE__ */ a(u, {}),
        /* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Primo" })
      ]
    }
  );
}
function L({
  className: n,
  label: e,
  ...t
}) {
  return /* @__PURE__ */ r(
    o,
    {
      "aria-label": "Go to previous page",
      className: i(
        "flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
        n
      ),
      ...t,
      children: [
        /* @__PURE__ */ a(d, {}),
        /* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Precedente" })
      ]
    }
  );
}
function w({
  className: n,
  label: e,
  ...t
}) {
  return /* @__PURE__ */ r(
    o,
    {
      "aria-label": "Go to next page",
      className: i(
        "flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pl-2.5",
        n
      ),
      ...t,
      children: [
        /* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Prossimo" }),
        /* @__PURE__ */ a(p, {})
      ]
    }
  );
}
function z({
  className: n,
  label: e,
  ...t
}) {
  return /* @__PURE__ */ r(
    o,
    {
      "aria-label": "Go to next page",
      className: i(
        "flex items-center justify-center gap-1 px-2.5 align-middle select-none sm:pr-2.5",
        n
      ),
      ...t,
      children: [
        /* @__PURE__ */ a("span", { className: "hidden sm:block", children: e ?? "Ultimo" }),
        /* @__PURE__ */ a(g, {})
      ]
    }
  );
}
function E({
  className: n,
  ...e
}) {
  return /* @__PURE__ */ r(
    "span",
    {
      "aria-hidden": !0,
      "data-slot": "pagination-ellipsis",
      className: i("flex size-9 items-center justify-center", n),
      ...e,
      children: [
        /* @__PURE__ */ a(m, { className: "size-4" }),
        /* @__PURE__ */ a("span", { className: "sr-only", children: "More pages" })
      ]
    }
  );
}
export {
  j as Pagination,
  k as PaginationContent,
  E as PaginationEllipsis,
  G as PaginationFirst,
  C as PaginationItem,
  z as PaginationLast,
  o as PaginationLink,
  w as PaginationNext,
  L as PaginationPrevious
};
