import{j as i}from"./main-ac2fa4b1.js";import{m as d,B as x,f as t,I as l,p as g,g as f}from"./chunk-material-ui-42c43899.js";const u=d(n=>({paginationNav:{"@media (max-width: 479px)":{width:"100%"}},ul:{listStyle:"none",padding:0,margin:0,display:"flex",alignItems:"center","@media (max-width: 479px)":{justifyContent:"space-between"}},paginationIconBtn:{fontSize:n.typography.pxToRem(24),padding:n.spacing(2),color:n.color.black100},paginationBtn:{border:"unset",padding:n.spacing(2),minWidth:"auto",fontSize:n.typography.pxToRem(16),lineHeight:n.typography.pxToRem(24),color:n.color.black60,"&:hover":{backgroundColor:"unset"},"@media (max-width: 479px)":{fontSize:"1rem"}},paginationCurrentBtn:{color:"#1e6ee4",border:"unset",padding:n.spacing(2),minWidth:"auto",fontSize:n.typography.pxToRem(16),lineHeight:n.typography.pxToRem(24),"&:hover":{backgroundColor:"unset"},"@media (max-width: 479px)":{fontSize:"1rem"}},paginationMore:{color:n.color.black60,fontFamily:"TTFirsNeue-Regular,sans-serif",fontSize:n.typography.pxToRem(16),lineHeight:n.typography.pxToRem(24),padding:n.spacing(2)},paginationPosition:{justifyContent:"flex-end","@media (max-width: 479px)":{justifyContent:"center"}}}),{name:"TPagination"}),y=({data:n})=>{const s=u();return i.jsx("nav",{className:s.paginationNav,children:i.jsx("ul",{className:s.ul,children:n==null?void 0:n.map(({page:r,type:e,selected:p,...a},c)=>{let o;return e==="start-ellipsis"||e==="end-ellipsis"?o=i.jsx(x,{className:s.paginationMore,children:"…"}):e==="page"?p?o=i.jsx(t,{...a,classes:{root:s.paginationCurrentBtn},children:r}):o=i.jsx(t,{...a,classes:{root:s.paginationBtn},children:r}):e==="previous"?o=i.jsx(l,{classes:{root:s.paginationIconBtn},size:"small",...a,children:i.jsx(g,{fontSize:"inherit"})}):e==="next"?a.disabled?o=null:o=i.jsx(l,{classes:{root:s.paginationIconBtn},size:"small",...a,children:i.jsx(f,{fontSize:"inherit"})}):o=i.jsx(t,{...a,classes:{root:s.paginationBtn},children:r}),o&&i.jsx("li",{children:o},c)})})})},j=(n,s)=>{switch(s){case 1:case(n&&n):case(n&&n-1):return 0;case 2:case(n&&n-2):return .5;case 3:case(n&&n-3):return 1;case 4:case(n&&n-4):return 1;default:return 2}};export{y as T,j as s};