import{a as u}from"/build/_shared/chunk-WL3EVROT.js";import{e as b,f as h,k as f,l as v}from"/build/_shared/chunk-VX2L2R2M.js";import{B as T,C as c,o as d}from"/build/_shared/chunk-XIQ3C74K.js";import{d as g}from"/build/_shared/chunk-G5WX4PPA.js";T();var e=g(c(),1),i=({page:o,pageText:n,variant:t="ghost",disabled:s=!1,isActive:l=!1})=>{let p=(0,e.jsx)(u,{variant:t,size:"sm",className:l?"bg-muted":"",disabled:s,children:n||o});return s?p:(0,e.jsx)(d,{to:`?page=${o}`,prefetch:"intent",children:p})};function w({currentPage:o,totalPages:n}){let t=Array.from({length:n},(a,y)=>y+1),s=o>=3,l=o<=n-2,p=Math.max(0,o===n?n-3:o-2),x=Math.min(n,o===1?3:o+1),N=t.slice(p,x),L=t[0],k=t[t.length-1],m=o>1,r=o<n;return(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(i,{variant:"outline",page:L,pageText:(0,e.jsx)(f,{}),disabled:!m}),(0,e.jsx)(i,{variant:"outline",page:o-1,pageText:(0,e.jsx)(b,{}),disabled:!m}),s&&(0,e.jsx)("span",{className:"-mr-1 ml-1 text-gray-500",children:"..."}),N.map(a=>(0,e.jsx)(i,{page:a,pageText:a,isActive:o===a},a)),l&&(0,e.jsx)("span",{className:"-ml-1 mr-1 text-gray-500",children:"..."}),(0,e.jsx)(i,{variant:"outline",page:o+1,pageText:(0,e.jsx)(h,{}),disabled:!r}),(0,e.jsx)(i,{variant:"outline",page:k,pageText:(0,e.jsx)(v,{}),disabled:!r})]})}export{w as a};
