var t,e,a={8751(t,e,a){a.d(e,{d:()=>i}),a(5983),a(1821);var i,r=a(9609),o=a(4084),s=a(2927),n=a(8899),p=a(9940),l=function(t,e,a,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,a):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,a,i);else for(var n=t.length-1;n>=0;n--)(r=t[n])&&(s=(o<3?r(s):o>3?r(e,a,s):r(e,a))||s);return o>3&&s&&Object.defineProperty(e,a,s),s};!function(t){let e=class extends s.LitElement{constructor(){super(...arguments),this._currentPage=1,this.hasDots=!1,this.onlyDots=!1,this.noNavigation=!1,this.totalPage=0,this.visiblePage=3}get currentPage(){return this._currentPage}set currentPage(t){const e=this._currentPage;this._currentPage=t,this.notifyPageChange(e,t),this.requestUpdate("currentPage",e)}static get styles(){return[o.A,p.A]}computePrevious(t){1!==t&&t!==this.currentPage&&(this.currentPage-=1)}computeNext(t){t<=this.totalPage&&t!==this.currentPage&&(this.currentPage+=1)}computeFirst(){this.currentPage>=1&&(this.currentPage=1)}computeLast(){this.currentPage>=1&&(this.currentPage=this.totalPage)}computeCurrent(t){this.currentPage=t}notifyPageChange(t,e){this.dispatchEvent(new CustomEvent("page-change",{composed:!0,bubbles:!0,detail:{oldPage:t,newPage:e}}))}get hasPreviousPage(){return this.currentPage<=1}get hasNextPage(){return this.currentPage>=this.totalPage}computePageList(t){if(this.totalPage>this.visiblePage&&t){const[t,e,a]=[this.currentPage-1,this.currentPage,this.currentPage+1];let i=[];if(e<=this.visiblePage-1)return i=[...Array(this.visiblePage)].map((t,e)=>1+e),i.push("..."),i.push(this.totalPage),i;if(this.totalPage-e<=this.visiblePage-2){i=[],i.push(1),i.push("...");const t=[...Array(this.visiblePage)].map((t,e)=>this.totalPage-this.visiblePage+1+e);return i.concat(t)}return[1,"...",t,e,a,"...",this.totalPage]}return[...Array(this.totalPage)].map((t,e)=>1+e)}pagesTemplate(t){return this.computePageList(t).map(t=>"..."===t?s.html` <li class="page-ellipsis">${t}</li> `:s.html`
              <li @click=${()=>this.computeCurrent(t)} aria-current=${t===this.currentPage}>
                ${t}
              </li>
            `)}dotsTemplate(t){return this.computePageList(t).map(t=>"..."===t?s.nothing:s.html`
              <li @click=${()=>this.computeCurrent(t)} aria-current=${t===this.currentPage}></li>
            `)}render(){return s.html`
        <nav class="md-pagination" role="navigation" part="pagination">
          ${this.noNavigation?s.nothing:s.html`
                <md-button
                  class="md-pagination-nav"
                  ariaLabel="First Page"
                  ?disabled=${this.hasPreviousPage}
                  @click=${this.computeFirst}
                  part="pagination-first"
                  variant="ghost"
                  size="24"
                  circle
                >
                  <md-icon name="overflow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
                </md-button>
                <md-button
                  class="md-pagination-nav"
                  ariaLabel="Next Page"
                  ?disabled=${this.hasPreviousPage}
                  @click=${()=>this.computePrevious(this.currentPage-1)}
                  part="pagination-prev"
                  variant="ghost"
                  size="24"
                  circle
                >
                  <md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
                </md-button>
              `}
          <div class="md-pagination-container">
            ${this.onlyDots?s.html`
                  <ul class="md-pagination-dots" part="pagination-only-dots">
                    ${this.dotsTemplate(!1)}
                  </ul>
                `:s.html`
                  <ul class="md-pagination-list" part=pagination-list">
                    ${this.pagesTemplate(!0)}
                  </ul>
                `}
            ${this.hasDots&&!this.onlyDots?s.html`
                  <ul class="md-pagination-dots" part="pagination-dots">
                    ${this.dotsTemplate(!0)}
                  </ul>
                `:s.nothing}
          </div>
          ${this.noNavigation?s.nothing:s.html`
                <md-button
                  class="md-pagination-nav"
                  ariaLabel="Previous Page"
                  ?disabled=${this.hasNextPage}
                  @click=${()=>this.computeNext(this.currentPage+1)}
                  part="pagination-next"
                  variant="ghost"
                  size="24"
                  circle
                >
                  <md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
                </md-button>
                <md-button
                  class="md-pagination-nav"
                  ariaLabel="Last Page"
                  ?disabled=${this.hasNextPage}
                  @click=${this.computeLast}
                  part="pagination-last"
                  variant="ghost"
                  size="24"
                  circle
                >
                  <md-icon name="overflow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
                </md-button>
              `}
        </nav>
      `}};l([(0,n.property)({type:Boolean,attribute:"dots"})],e.prototype,"hasDots",void 0),l([(0,n.property)({type:Boolean,reflect:!0,attribute:"only-dots"})],e.prototype,"onlyDots",void 0),l([(0,n.property)({type:Boolean,reflect:!0,attribute:"no-navigation"})],e.prototype,"noNavigation",void 0),l([(0,n.property)({type:Number,reflect:!0,attribute:"total-page"})],e.prototype,"totalPage",void 0),l([(0,n.property)({type:Number,reflect:!0,attribute:"visible-page"})],e.prototype,"visiblePage",void 0),l([(0,n.property)({type:Number,reflect:!0,attribute:"current-page"})],e.prototype,"currentPage",null),e=l([(0,r.w)("md-pagination")],e),t.ELEMENT=e}(i||(i={}))}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return a[t](o,o.exports,r),o.exports}r.m=a,t=[],r.O=(e,a,i,o)=>{if(!a){var s=1/0;for(c=0;c<t.length;c++){for(var[a,i,o]=t[c],n=!0,p=0;p<a.length;p++)(!1&o||s>=o)&&Object.keys(r.O).every(t=>r.O[t](a[p]))?a.splice(p--,1):(n=!1,o<s&&(s=o));if(n){t.splice(c--,1);var l=i();void 0!==l&&(e=l)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[a,i,o]},r.d=(t,e)=>{for(var a in e)r.o(e,a)&&!r.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);export{r as __webpack_require__};e={1788:0},r.C=t=>{var a,i,{__webpack_esm_ids__:o,__webpack_esm_modules__:s,__webpack_esm_runtime__:n}=t,p=0;for(a in s)r.o(s,a)&&(r.m[a]=s[a]);for(n&&n(r);p<o.length;p++)i=o[p],r.o(e,i)&&e[i]&&e[i][0](),e[o[p]]=0;r.O()},r.O.j=t=>0===e[t];import*as o from"../9609.js";r.C(o);import*as s from"../4084.js";r.C(s);import*as n from"../4955.js";r.C(n);import*as p from"../3517.js";r.C(p);import*as l from"../1156.js";r.C(l);import*as c from"../3305.js";r.C(c);import*as m from"../4739.js";r.C(m);import*as g from"../7154.js";r.C(g);import*as u from"../9773.js";r.C(u);import*as h from"../5983.js";r.C(h);import*as d from"../7755.js";r.C(d);import*as P from"../1821.js";r.C(P);import*as v from"../4980.js";r.C(v);import*as f from"../9500.js";r.C(f);import*as b from"../519.js";r.C(b);import*as y from"../4137.js";r.C(y);import*as j from"../8165.js";r.C(j);import*as C from"../9940.js";r.C(C);var _=r.O(void 0,[9609,4084,4955,3517,1156,3305,4739,7154,9773,5983,7755,1821,4980,9500,519,4137,8165,9940],()=>r(8751));const $=(_=r.O(_)).d;export{$ as Pagination};