import{r as d,h as _,j as n,cf as l,c8 as E}from"./index-E0AVXOTn.js";const S=e=>d.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},d.createElement("path",{d:"M8.63065 8.26498L3.63065 13.265C3.55956 13.3312 3.46554 13.3673 3.36839 13.3656C3.27123 13.3639 3.17854 13.3245 3.10984 13.2558C3.04113 13.1871 3.00177 13.0944 3.00006 12.9972C2.99834 12.9001 3.03441 12.8061 3.10065 12.735L7.83502 7.99998L3.10065 3.26498C3.03441 3.1939 2.99834 3.09987 3.00006 3.00272C3.00177 2.90557 3.04113 2.81288 3.10984 2.74417C3.17854 2.67547 3.27123 2.63611 3.36839 2.6344C3.46554 2.63268 3.55956 2.66874 3.63065 2.73498L8.63065 7.73498C8.70087 7.8053 8.74032 7.90061 8.74032 7.99998C8.74032 8.09936 8.70087 8.19467 8.63065 8.26498Z",fill:"#777472"}),d.createElement("path",{d:"M12.9959 8.26498L7.99588 13.265C7.92479 13.3312 7.83077 13.3673 7.73362 13.3656C7.63647 13.3639 7.54378 13.3245 7.47507 13.2558C7.40636 13.1871 7.36701 13.0944 7.36529 12.9972C7.36358 12.9001 7.39964 12.8061 7.46588 12.735L12.2003 7.99998L7.46588 3.26498C7.39964 3.1939 7.36358 3.09987 7.36529 3.00272C7.36701 2.90557 7.40636 2.81288 7.47507 2.74417C7.54378 2.67547 7.63647 2.63611 7.73362 2.6344C7.83077 2.63268 7.92479 2.66874 7.99588 2.73498L12.9959 7.73498C13.0661 7.8053 13.1056 7.90061 13.1056 7.99998C13.1056 8.09936 13.0661 8.19467 12.9959 8.26498Z",fill:"#777472"})),k=5,p=10,B=1e3,m=(e,r)=>Array.from({length:r-e+1},(s,c)=>e+c),D=(e,r,s)=>{const c=r{const[L,C]=_(),o=typeof e=="number"?e:parseInt(e),A=Math.ceil(Number(r)/c),i=Math.min(A,B),f=a==="extend"?p:k,w=d.useMemo(()=>D(o,i,f),[o,i,f]),M=t=>t===o,P=o===1,b=o===i,g=i>1,j=a==="extend"&&i>f,v=t=>{C(x=>({...Object.fromEntries(x.entries()),pageNumber:t.toString()}))},h=t=>{const x=t==="first"?1:t==="last"?i:t==="prev"?Math.max(1,o-1):t==="next"?Math.min(i,o+1):t;if(s){s(x);return}v(x)};return n.jsxs(l.PageContainer,{...u,children:[a==="extend"&&j&&n.jsx(l.ArrowButton,{disabled:P,type:"button",onClick:()=>h("first"),"aria-label":"처음 페이지로 이동",style:{transform:"scaleX(-1)"},children:n.jsx(S,{})}),g&&!P&&n.jsx(l.ArrowButton,{type:"button",onClick:()=>h("prev"),"aria-label":"이전 페이지로 이동",style:{transform:"scaleX(-1)"},children:n.jsx(E,{})}),n.jsx(l.PageList,{children:w.map(t=>n.jsx("li",{children:n.jsx(l.PageButton,{"aria-current":M(t),type:"button",onClick:()=>h(t),children:t})},t))}),g&&!b&&n.jsx(l.ArrowButton,{type:"button",onClick:()=>h("next"),"aria-label":"다음 페이지로 이동",children:n.jsx(E,{})}),a==="extend"&&j&&n.jsx(l.ArrowButton,{disabled:b,type:"button",onClick:()=>h("last"),"aria-label":"마지막 페이지로 이동",children:n.jsx(S,{})})]})};export{N as P};