!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx"));else if("function"==typeof define&&define.amd)define(["lit","lit/decorators.js","lit/directives/class-map.js","lit/directives/style-map.js","lit/directives/if-defined.js","@momentum-ui/icons/data/momentumUiIconsNames.json","@momentum-ui/utils/lib/getColorValue","mobx"],e);else{var i="object"==typeof exports?e(require("lit"),require("lit/decorators.js"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js"),require("lit/directives/if-defined.js"),require("@momentum-ui/icons/data/momentumUiIconsNames.json"),require("@momentum-ui/utils/lib/getColorValue"),require("mobx")):e(t.lit,t["lit/decorators.js"],t["lit/directives/class-map.js"],t["lit/directives/style-map.js"],t["lit/directives/if-defined.js"],t["@momentum-ui/icons/data/momentumUiIconsNames.json"],t["@momentum-ui/utils/lib/getColorValue"],t.mobx);for(var r in i)("object"==typeof exports?exports:t)[r]=i[r]}}(self,(t,e,i,r,a,o,s,n)=>(()=>{"use strict";var l,u={8751(t,e,i){i.r(e),i.d(e,{Pagination:()=>r}),i(5983),i(1821);var r,a=i(9609),o=i(4084),s=i(7161),n=i(429),l=i(9940),u=function(t,e,i,r){var a,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(s=(o<3?a(s):o>3?a(e,i,s):a(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,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,l.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,i]=[this.currentPage-1,this.currentPage,this.currentPage+1];let r=[];if(e<=this.visiblePage-1)return r=[...Array(this.visiblePage)].map((t,e)=>1+e),r.push("..."),r.push(this.totalPage),r;if(this.totalPage-e<=this.visiblePage-2){r=[],r.push(1),r.push("...");const t=[...Array(this.visiblePage)].map((t,e)=>this.totalPage-this.visiblePage+1+e);return r.concat(t)}return[1,"...",t,e,i,"...",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>
      `}};u([(0,n.property)({type:Boolean,attribute:"dots"})],e.prototype,"hasDots",void 0),u([(0,n.property)({type:Boolean,reflect:!0,attribute:"only-dots"})],e.prototype,"onlyDots",void 0),u([(0,n.property)({type:Boolean,reflect:!0,attribute:"no-navigation"})],e.prototype,"noNavigation",void 0),u([(0,n.property)({type:Number,reflect:!0,attribute:"total-page"})],e.prototype,"totalPage",void 0),u([(0,n.property)({type:Number,reflect:!0,attribute:"visible-page"})],e.prototype,"visiblePage",void 0),u([(0,n.property)({type:Number,reflect:!0,attribute:"current-page"})],e.prototype,"currentPage",null),e=u([(0,a.w)("md-pagination")],e),t.ELEMENT=e}(r||(r={}))},2022(t){t.exports=o},554(t){t.exports=s},7161(e){e.exports=t},429(t){t.exports=e},5125(t){t.exports=i},291(t){t.exports=a},318(t){t.exports=r},5314(t){t.exports=n}},c={};function m(t){var e=c[t];if(void 0!==e)return e.exports;var i=c[t]={exports:{}};return u[t](i,i.exports,m),i.exports}m.m=u,l=[],m.O=(t,e,i,r)=>{if(!e){var a=1/0;for(u=0;u<l.length;u++){for(var[e,i,r]=l[u],o=!0,s=0;s<e.length;s++)(!1&r||a>=r)&&Object.keys(m.O).every(t=>m.O[t](e[s]))?e.splice(s--,1):(o=!1,r<a&&(a=r));if(o){l.splice(u--,1);var n=i();void 0!==n&&(t=n)}}return t}r=r||0;for(var u=l.length;u>0&&l[u-1][2]>r;u--)l[u]=l[u-1];l[u]=[e,i,r]},m.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return m.d(e,{a:e}),e},m.d=(t,e)=>{for(var i in e)m.o(e,i)&&!m.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},m.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),m.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t={1788:0};m.O.j=e=>0===t[e];var e=(e,i)=>{var r,a,[o,s,n]=i,l=0;if(o.some(e=>0!==t[e])){for(r in s)m.o(s,r)&&(m.m[r]=s[r]);if(n)var u=n(m)}for(e&&e(i);l<o.length;l++)a=o[l],m.o(t,a)&&t[a]&&t[a][0](),t[a]=0;return m.O(u)},i=self["momentum-web-components-[id]"]=self["momentum-web-components-[id]"]||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})();var p=m.O(void 0,[9609,4084,3305,4739,7154,9773,5983,9488,1821,519,9940],()=>m(8751));return m.O(p)})());