"use strict";(globalThis.webpackChunkinfinity_hitab_client=globalThis.webpackChunkinfinity_hitab_client||[]).push([[204],{91367:(e,t,a)=>{a.d(t,{Z:()=>g});var l=a(89349),i=a(57268),o=a(89404),s=a(93278),n=a(87890),m=a(91757);const[u,c,r]=(0,o.do)("pagination"),p=(e,t,a)=>({number:e,text:t,active:a}),d={mode:(0,s.SQ)("multi"),prevText:String,nextText:String,pageCount:(0,s.SI)(0),modelValue:(0,s.qM)(0),totalItems:(0,s.SI)(0),showPageSize:(0,s.SI)(5),itemsPerPage:(0,s.SI)(10),forceEllipses:Boolean};var b=(0,i.aZ)({name:u,props:d,emits:["change","update:modelValue"],setup(e,{emit:t,slots:a}){const l=(0,i.Fl)((()=>{const{pageCount:t,totalItems:a,itemsPerPage:l}=e,i=+t||Math.ceil(+a/+l);return Math.max(1,i)})),o=(0,i.Fl)((()=>{const t=[],a=l.value,i=+e.showPageSize,{modelValue:o,forceEllipses:s}=e;let n=1,m=a;const u=i<a;u&&(n=Math.max(o-Math.floor(i/2),1),m=n+i-1,m>a&&(m=a,n=m-i+1));for(let e=n;e<=m;e++){const a=p(e,e,e===o);t.push(a)}if(u&&i>0&&s){if(n>1){const e=p(n-1,"...");t.unshift(e)}if(m<a){const e=p(m+1,"...");t.push(e)}}return t})),s=(a,i)=>{a=(0,n.uZ)(a,1,l.value),e.modelValue!==a&&(t("update:modelValue",a),i&&t("change",a))};(0,i.m0)((()=>s(e.modelValue)));const u=()=>{const{mode:t,modelValue:l}=e,o=a["prev-text"],n=1===l;return(0,i.Wm)("li",{class:[c("item",{disabled:n,border:"simple"===t,prev:!0}),m._K]},[(0,i.Wm)("button",{type:"button",disabled:n,onClick:()=>s(l-1,!0)},[o?o():e.prevText||r("prev")])])},d=()=>{const{mode:t,modelValue:o}=e,n=a["next-text"],u=o===l.value;return(0,i.Wm)("li",{class:[c("item",{disabled:u,border:"simple"===t,next:!0}),m._K]},[(0,i.Wm)("button",{type:"button",disabled:u,onClick:()=>s(o+1,!0)},[n?n():e.nextText||r("next")])])};return()=>(0,i.Wm)("nav",{role:"navigation",class:c()},[(0,i.Wm)("ul",{class:c("items")},[u(),"simple"===e.mode?(0,i.Wm)("li",{class:c("page-desc")},[a.pageDesc?a.pageDesc():`${e.modelValue}/${l.value}`]):o.value.map((e=>(0,i.Wm)("li",{class:[c("item",{active:e.active,page:!0}),m._K]},[(0,i.Wm)("button",{type:"button","aria-current":e.active||void 0,onClick:()=>s(e.number,!0)},[a.page?a.page(e):e.text])]))),d()])])}});var g=(0,l.n)(b)},28308:(e,t,a)=>{a(46629)}}]);