"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/jsx-runtime.js"),p=require("./styles.js"),o=require("../IconButton/index.js"),k=require("./utils.js"),m=require("./components/WidePagination.js"),b=require("./components/NarrowPagination.js"),u=require("../../utils/index.js"),f=require("../../icons/ChevronLeft.js"),q=require("../../icons/ChevronRight.js");function R({rowsPerPage:d,totalItems:s,currentPage:i,onChangePage:a,variant:x="wide",alignment:v="right",paginationLimiter:l,narrowPaginationText:c,...e}){const r=u.getId(e["data-testid"]),n=u.getId(e["data-trackid"]),j=k.getNumberOfPages(s,d);return t.jsxRuntimeExports.jsxs(p.PaginationControl,{alignment:v,"data-testid":e["data-testid"],"data-trackid":e["data-trackid"],role:"navigation",children:[t.jsxRuntimeExports.jsx(o.IconButton,{icon:t.jsxRuntimeExports.jsx(f.default,{}),variant:"ghost-tertiary",size:"x-small",disabled:i===1,onClick:()=>a(i-1),"data-testid":r("button-previous"),"data-trackid":n("button-previous")}),x==="wide"?t.jsxRuntimeExports.jsx(m.default,{variant:"wide",rowsPerPage:d,onChangePage:a,currentPage:i,totalItems:s,paginationLimiter:l,"data-testid":r("wide-pagination"),"data-trackid":n("wide-pagination")}):t.jsxRuntimeExports.jsx(b.default,{variant:"narrow",rowsPerPage:d,onChangePage:a,currentPage:i,totalItems:s,narrowPaginationText:c,"data-testid":r("narrow-pagination"),"data-trackid":n("narrow-pagination")}),t.jsxRuntimeExports.jsx(o.IconButton,{icon:t.jsxRuntimeExports.jsx(q.default,{}),variant:"ghost-tertiary",size:"x-small",disabled:i===j,onClick:()=>a(i+1),"data-testid":r("button-next"),"data-trackid":n("button-next")})]})}exports.Pagination=R;
