import{p as e,H as t,c as s,h as i,d as o,t as n}from"./p-yZBlG3YQ.js";import{integerSequence as l}from"@verdocs/js-sdk";const c=()=>`verdocs-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}`;const r=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>`;const a=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>`;const d=5;const p=({page:e,selected:t,onClick:s})=>{let o;if(e==="first"){o=r}else if(e==="last"){o=a}else{o=String(e+1)}return i("div",{class:`page-button ${e===t?"selected":""}`,onClick:()=>s(e),innerHTML:o})};const f=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.selectPage=s(this,"selectPage");this.selectedPage=0;this.itemCount=1;this.perPage=10}handleSelectPage(e){var t;this.selectedPage=e;(t=this.selectPage)===null||t===void 0?void 0:t.emit({selectedPage:e})}render(){const e=Math.max(0,this.selectedPage-2);const t=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;const s=l(0,Math.ceil(this.itemCount/this.perPage)).slice(e,e+d);return i(o,{key:"2ce45159b092a0283f247e7098931fcd34eebb99"},this.selectedPage>0&&i(p,{key:"0bec38eb497b2feef1c98fd73b682f997d68ac5b",page:"first",selected:this.selectedPage,onClick:()=>this.handleSelectPage(0)}),e>0&&i("div",{key:"706e4de3571b6b3883df226d300cfb9ae358c8b3",class:"ellipsis"},"..."),s.map((e=>i(p,{page:e,selected:this.selectedPage,onClick:e=>this.handleSelectPage(+e)}))),this.selectedPage<t-1&&i("div",{key:"9249824a3700ec561f6707e2a8fc4ebbf2362633",class:"ellipsis"},"..."),this.selectedPage<t-1&&i(p,{key:"d1051af6279d1e864ea39cfd087c7295739e2619",page:"last",selected:this.selectedPage,onClick:()=>this.handleSelectPage(t-1)}))}get el(){return this}static get style(){return c()}},[0,"verdocs-pagination",{selectedPage:[1538,"selected-page"],itemCount:[2,"item-count"],perPage:[2,"per-page"]}]);function h(){if(typeof customElements==="undefined"){return}const e=["verdocs-pagination"];e.forEach((e=>{switch(e){case"verdocs-pagination":if(!customElements.get(n(e))){customElements.define(n(e),f)}break}}))}export{f as V,h as d};
//# sourceMappingURL=p-DxBUReLi.js.map