//#region src/pagination/helpers.ts
const range = (start, end) => {
	const length = end - start + 1;
	return Array.from({ length }, (_, i) => start + i);
};
/** Returns an array describing pagination items, like page buttons, prev/next arrows or ellipsis. */
function getPaginationItems(page, pageCount) {
	const boundaryCount = 1;
	const siblingCount = 1;
	const startPages = range(1, Math.min(boundaryCount, pageCount));
	const endPages = range(Math.max(pageCount - boundaryCount + 1, boundaryCount + 1), pageCount);
	const siblingsStart = Math.max(Math.min(page - siblingCount, pageCount - boundaryCount - siblingCount * 2 - 1), boundaryCount + 2);
	const siblingsEnd = Math.min(Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2), endPages.length > 0 ? endPages[0] - 2 : pageCount - 1);
	return [
		"previous",
		...startPages,
		...siblingsStart > boundaryCount + 2 ? ["ellipsisStart"] : boundaryCount + 1 < pageCount - boundaryCount ? [boundaryCount + 1] : [],
		...range(siblingsStart, siblingsEnd),
		...siblingsEnd < pageCount - boundaryCount - 1 ? ["ellipsisEnd"] : pageCount - boundaryCount > boundaryCount ? [pageCount - boundaryCount] : [],
		...endPages,
		"next"
	];
}

//#endregion
export { getPaginationItems };
globalThis.__vuiVersion__ = "4.0.1"
//# sourceMappingURL=helpers.js.map