import{a as I,b as y}from"./chunk-WQ6DP4JQ.js";import{Aa as l,Ba as f,Mg as k,Te as P,ab as b,bb as x,dc as c,dd as v,eh as w,ha as p,mg as u,ya as m,zc as h}from"./chunk-SKPDQO4E.js";var z=`<div class="pagination-container" *ngIf="visibleComponent">
  <div class="info-container">
    <span>{{'COMMON.PAGE'|translate}} :</span>
    <nz-form-item class="ms-1 mb-0 mws-8">
      <nz-select [(ngModel)]="activePageIndex" (ngModelChange)="pageIndexChanged($event)" nzSize="small" [nzAutoFocus]="false"
        [nzDropdownMatchSelectWidth]="false">
        <nz-option *ngFor="let page of comboPages" [nzValue]="page.index" [nzLabel]="(page.index + 1)"></nz-option>
      </nz-select>
    </nz-form-item>
  </div>
  <div class="info-container d-none d-md-flex" *ngIf="!minimal">
    <span>{{'COMMON.TOTAL'|translate}} : {{paginationResponse.total}}</span>
  </div>
  <div class="desktop-buttons d-none d-md-flex">
    <div class="buttonItem" *ngIf="visibleFirstPage" (click)="pageFirstClicked()">&lt;&lt;</div>
    <div class="buttonItem" *ngIf="visiblePrevPage" (click)="pagePrevClicked()">{{(minimal ? '&lt;' : 'BUTTON.PREV' ) | translate}}</div>
    <ng-container *ngIf="!minimal">
      <div class="pageItem" [attr.disabledpage]="page.disabled"
        *ngFor="let page of pages; let pageIndex = index; let pageFirst = first; let pageLast = last;"
        (click)="pageClicked(page)">
        {{page.index + 1}}
      </div>
    </ng-container>
    <div class="buttonItem" *ngIf="visibleNextPage" (click)="pageNextClicked()">{{(minimal ? '&gt;' : 'BUTTON.NEXT' ) | translate}}</div>
    <div class="buttonItem" *ngIf="visibleLastPage" (click)="pageLastClicked()">&gt;&gt;</div>
  </div>
  <div class="mobile-buttons d-sm-none">
    <div class="buttonItem mobile" *ngIf="visiblePrevPage" (click)="pagePrevClicked()">{{'BUTTON.PREV'|translate}}</div>
    <div class="buttonItem mobile" *ngIf="visibleNextPage" (click)="pageNextClicked()">{{'BUTTON.NEXT'|translate}}</div>
  </div>
</div>`;var C=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host .pagination-container{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;padding:.2rem;-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;background-color:#fff}:host .pagination-container .info-container{padding:2px 6px;margin-right:3px;font-size:.672rem;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center}:host .pagination-container .baseItem,:host .pagination-container .mobile-buttons .buttonItem,:host .pagination-container .desktop-buttons .buttonItem,:host .pagination-container .pageItem,:host .pagination-container .pageItem[disabledpage=true]{margin:2px;padding:2px 5px;color:#fff;background-color:#0a2a5a;border:1px solid rgba(10,42,90,.5);-webkit-border-radius:.375rem;-moz-border-radius:.375rem;border-radius:.375rem;cursor:pointer;font-size:.672rem}:host .pagination-container .desktop-buttons{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;-webkit-align-items:center;-moz-align-items:center;align-items:center;margin-left:auto}:host .pagination-container .mobile-buttons{display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-moz-box-orient:horizontal;-webkit-flex-direction:row;-moz-flex-direction:row;-ms-flex-direction:row;flex-direction:row;margin-left:auto}:host .pagination-container .pageItem[disabledpage=true]{cursor:default;color:#0a2a5a;background-color:#ccc;border:1px solid rgba(153,153,153,.5)}
`;var O=function(s,e,t,a){var n=arguments.length,i=n<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,t):a,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(s,e,t,a);else for(var d=s.length-1;d>=0;d--)(o=s[d])&&(i=(n<3?o(i):n>3?o(e,t,i):o(e,t))||i);return n>3&&i&&Object.defineProperty(e,t,i),i},r=2,R=class{paginationResponse;scrollDomId="side-nav-content";scrollDisable=!1;minimal=!1;pageChanged=new p;allPages=[];pages=[];comboPages=[];activePageIndex;visibleComponent=!1;visibleNextPage=!1;visibleLastPage=!1;visiblePrevPage=!1;visibleFirstPage=!1;constructor(){}ngOnInit(){setTimeout(()=>this.updateScrollPosition(),50)}ngOnChanges(e){e.paginationResponse&&this.paginationResponse&&this.updatePagination()}updatePagination(){if(this.visibleComponent=!1,this.paginationResponse.total>0){this.allPages=[];let t=0;this.paginationResponse.take||(this.paginationResponse.take=h.REQUEST_ITEM_LIMIT);for(var e=0;e<this.paginationResponse.total;e+=this.paginationResponse.take){let i=new g;!this.paginationResponse.skip&&e==0?(i.disabled=!0,this.activePageIndex=t):e==this.paginationResponse.skip&&(i.disabled=!0,this.activePageIndex=t),i.index=t,this.allPages.push(i),t++}let a,n;if(this.activePageIndex<=r?(a=0,this.visibleFirstPage=!1):(this.visibleFirstPage=!this.minimal,a=this.activePageIndex-r),this.activePageIndex>=this.allPages.length-r?(n=this.allPages.length-1,this.visibleLastPage=!1):(n=this.activePageIndex+r,this.visibleLastPage=!this.minimal),this.visiblePrevPage=this.activePageIndex!=0,this.visibleNextPage=this.activePageIndex!=this.allPages.length-1,this.pages=c(this.allPages).splice(a,n-a+1),this.allPages.length>500){let i=null;this.allPages.length>1e4?i=100:this.allPages.length>5e3?i=50:this.allPages.length>3e3?i=20:this.allPages.length>1e3?i=10:i=5,this.comboPages=this.allPages.filter(o=>(o.index+1)%i==0||o.index==this.activePageIndex)}else this.comboPages=c(this.allPages);this.visibleComponent=!0}}updateScrollPosition(){if(this.scrollDisable==!1){let e=document.getElementById(this.scrollDomId);e||(e=document.getElementById("content-area-div")),e.scrollTop=0}}changePage(e){let t=new k;t.skip=e*this.paginationResponse.take,t.take=this.paginationResponse.take,this.pageChanged.emit(t),this.updateScrollPosition()}pageClicked(e){e.disabled||this.changePage(e.index)}pageFirstClicked(e){this.visibleFirstPage&&this.changePage(0)}pagePrevClicked(e){this.visiblePrevPage&&this.changePage(this.activePageIndex-1)}pageNextClicked(e){this.visibleNextPage&&this.changePage(this.activePageIndex+1)}pageLastClicked(e){this.visibleLastPage&&this.changePage(this.allPages.length-1)}pageIndexChanged(e){this.changePage(this.activePageIndex)}static ctorParameters=()=>[];static propDecorators={paginationResponse:[{type:l}],scrollDomId:[{type:l}],scrollDisable:[{type:l}],minimal:[{type:l}],pageChanged:[{type:f}]}};R=O([m({selector:"armon-pagination",template:z,standalone:!0,imports:[x,I,y,w,P,u,b,v],styles:[C]})],R);var g=class{index;disabled=!1};export{R as a};
