var w=Object.create;var h=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var F=(t,o)=>{for(var n in o)h(t,n,{get:o[n],enumerable:!0})},k=(t,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of M(o))!B.call(t,e)&&e!==n&&h(t,e,{get:()=>o[e],enumerable:!(i=D(o,e))||i.enumerable});return t};var L=(t,o,n)=>(n=t!=null?w(z(t)):{},k(o||!t||!t.__esModule?h(n,"default",{value:t,enumerable:!0}):n,t)),N=t=>k(h({},"__esModule",{value:!0}),t);var j={};F(j,{default:()=>T});module.exports=N(j);var E=require("react");var v=require("react"),g="...",x=(t,o)=>{let n=o-t+1;return Array.from({length:n},(i,e)=>e+t)},C=({totalCount:t,pageSize:o,siblingCount:n=1,currentPage:i})=>(0,v.useMemo)(()=>{let r=Math.ceil(t/o);if(n+5>=r)return x(1,r);let l=Math.max(i-n,1),f=Math.min(i+n,r),m=l>2,c=f<r-2,s=1,p=r;if(!m&&c){let d=3+2*n;return[...x(1,d),g,r]}if(m&&!c){let d=3+2*n,R=x(r-d+1,r);return[s,g,...R]}if(m&&c){let d=x(l,f);return[s,g,...d,g,p]}},[t,o,n,i]);var y=L(require("@emotion/styled"),1),S=y.default.ul`
  display: flex;
  align-items: center;
  justify-content: center;
  list-style-type: none;
`,I=y.default.li`
  padding: 0 12px;
  height: 32px;
  min-width: 32px;
  text-align: center;
  margin: auto 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;

  ${({disabled:t})=>t&&`
    pointer-events: none;

    &:hover {
      background-color: transparent;
      cursor: default;
    }
  `}

  &.dots:hover {
    background-color: transparent;
    cursor: default;
  }
  &:hover {
    background-color: var(--bad-colors-muted);
    cursor: pointer;
  }

  &.selected {
    background-color: var(--bad-colors-muted);
  }

  &.disabled {
  }
`;var P=require("@chakra-ui/icons"),u=require("@chakra-ui/react"),a=require("react/jsx-runtime");var O=t=>{let{onPageChange:o,totalCount:n,siblingCount:i=1,currentPage:e,pageSize:r,className:b}=t,l=C({currentPage:e,totalCount:n,siblingCount:i,pageSize:r});if(e===0||l.length<2)return null;let f=()=>{o(e+1)},m=()=>{o(e-1)},c=l[l.length-1];return(0,a.jsxs)(u.Flex,{align:"center",children:[(0,a.jsx)(u.Box,{children:(0,a.jsx)(P.ChevronLeftIcon,{boxSize:6,onClick:e===1?()=>{}:m,opacity:e===1?.1:1,cursor:e===1?"not-allowed":"pointer"})}),(0,a.jsx)(S,{children:l.map((s,p)=>s===g?(0,a.jsx)(I,{className:"dots",children:"\u2026"},p):(0,a.jsx)(I,{className:s===e?"selected":"",onClick:s===e?()=>{}:()=>o(s),children:s},p))}),(0,a.jsx)(u.Box,{children:(0,a.jsx)(P.ChevronRightIcon,{boxSize:6,onClick:e===c?()=>{}:f,opacity:e===c?.1:1,cursor:e===c?"not-allowed":"pointer"})})]})},T=O;
