import * as i0 from '@angular/core';
import { EventEmitter, HostListener, Output, Input, ViewChild, ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import * as i1 from '@agorapulse/ui-symbol';
import { apArrowLeft, apArrowRight, SymbolComponent } from '@agorapulse/ui-symbol';
import * as i2 from '@angular/forms';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { Subject, BehaviorSubject, combineLatest, distinctUntilChanged, takeUntil } from 'rxjs';

class PaginatorButtonComponent {
    button;
    ariaLabel = '';
    disabled = false;
    pageIndex = 0;
    selectedPageIndex = 0;
    selectPage = new EventEmitter();
    focused = false;
    onClickHandle(pageIndex) {
        this.button.nativeElement.blur();
        this.selectPage.emit(pageIndex);
    }
    onBlurHandle() {
        this.focused = false;
    }
    onFocusHandle() {
        this.focused = true;
    }
    onSpaceKeyUp(event) {
        if (this.focused) {
            event.preventDefault();
            console.log('this.button.nativeElement', this.button.nativeElement);
            this.button.nativeElement.click();
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: PaginatorButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.18", type: PaginatorButtonComponent, isStandalone: true, selector: "ap-paginator-button", inputs: { ariaLabel: "ariaLabel", disabled: "disabled", pageIndex: "pageIndex", selectedPageIndex: "selectedPageIndex" }, outputs: { selectPage: "selectPage" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" } }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], ngImport: i0, template: "<button\n    #button\n    class=\"square-button\"\n    role=\"button\"\n    type=\"button\"\n    [id]=\"'paginator-button-' + pageIndex\"\n    [class.active]=\"selectedPageIndex === pageIndex\"\n    [attr.aria-label]=\"ariaLabel || null\"\n    (click)=\"onClickHandle(pageIndex)\"\n    (blur)=\"onBlurHandle()\"\n    (focus)=\"onFocusHandle()\">\n    <span>\n        {{ pageIndex + 1 }}\n    </span>\n</button>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.square-button{width:36px;height:36px;max-width:36px;max-height:36px;min-width:36px;min-height:36px;border-radius:var(--ref-border-radius-sm);background:transparent;display:flex;align-items:center;justify-content:center;border:none;box-sizing:border-box}.square-button:hover{cursor:pointer}.square-button:hover:not(.active){background-color:var(--ref-color-electric-blue-10)}@media (hover: hover){.square-button:focus:not(.disabled):not(:active){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}.square-button:active{background-color:var(--ref-color-electric-blue-20)!important}.square-button.active{background-color:var(--ref-color-electric-blue-100)}.square-button.active span{color:var(--ref-color-white)}.square-button span{color:var(--ref-color-electric-blue-100);font-family:var(--ref-font-family);font-weight:var(--ref-font-weight-regular);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: PaginatorButtonComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ap-paginator-button', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<button\n    #button\n    class=\"square-button\"\n    role=\"button\"\n    type=\"button\"\n    [id]=\"'paginator-button-' + pageIndex\"\n    [class.active]=\"selectedPageIndex === pageIndex\"\n    [attr.aria-label]=\"ariaLabel || null\"\n    (click)=\"onClickHandle(pageIndex)\"\n    (blur)=\"onBlurHandle()\"\n    (focus)=\"onFocusHandle()\">\n    <span>\n        {{ pageIndex + 1 }}\n    </span>\n</button>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}.square-button{width:36px;height:36px;max-width:36px;max-height:36px;min-width:36px;min-height:36px;border-radius:var(--ref-border-radius-sm);background:transparent;display:flex;align-items:center;justify-content:center;border:none;box-sizing:border-box}.square-button:hover{cursor:pointer}.square-button:hover:not(.active){background-color:var(--ref-color-electric-blue-10)}@media (hover: hover){.square-button:focus:not(.disabled):not(:active){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}.square-button:active{background-color:var(--ref-color-electric-blue-20)!important}.square-button.active{background-color:var(--ref-color-electric-blue-100)}.square-button.active span{color:var(--ref-color-white)}.square-button span{color:var(--ref-color-electric-blue-100);font-family:var(--ref-font-family);font-weight:var(--ref-font-weight-regular);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm)}\n"] }]
        }], propDecorators: { button: [{
                type: ViewChild,
                args: ['button']
            }], ariaLabel: [{
                type: Input
            }], disabled: [{
                type: Input
            }], pageIndex: [{
                type: Input
            }], selectedPageIndex: [{
                type: Input
            }], selectPage: [{
                type: Output
            }], onSpaceKeyUp: [{
                type: HostListener,
                args: ['window:keyup.space', ['$event']]
            }] } });

class PaginatorComponent {
    symbolRegistry;
    DEFAULT_MIDDLE_SIZE = 3;
    DEFAULT_ITEM_COUNT = 0;
    DEFAULT_ITEM_COUNT_PER_PAGE = 10;
    DEFAULT_CURRENT_PAGE_INDEX = 0;
    DEFAULT_EDGE_SIZE = 5;
    set currentPageIndex(value) {
        this._currentPageIndex.next(value ?? this.DEFAULT_CURRENT_PAGE_INDEX);
    }
    get currentPageIndex() {
        return this._currentPageIndex.getValue();
    }
    displayGoTo = false;
    edgeSize = this.DEFAULT_EDGE_SIZE;
    goToLabel = 'Go to';
    set itemCount(value) {
        this._itemCount.next(value ?? this.DEFAULT_ITEM_COUNT);
    }
    get itemCount() {
        return this._itemCount.getValue();
    }
    set itemCountPerPage(value) {
        this._itemCountPerPage.next(value ?? this.DEFAULT_ITEM_COUNT_PER_PAGE);
    }
    get itemCountPerPage() {
        return this._itemCountPerPage.getValue();
    }
    _middleSize;
    set middleSize(value) {
        // make sure middle size is an odd number
        if (value && value % 2 === 0) {
            value++;
        }
        this._middleSize = value ?? this.DEFAULT_MIDDLE_SIZE;
    }
    get middleSize() {
        return this._middleSize;
    }
    currentPageIndexChange = new EventEmitter();
    pageInput = '';
    pageCount = 0;
    firstPageDisplayed = true;
    lastPageDisplayed = true;
    destroy$ = new Subject();
    _itemCount = new BehaviorSubject(this.DEFAULT_ITEM_COUNT);
    _itemCountPerPage = new BehaviorSubject(this.DEFAULT_ITEM_COUNT_PER_PAGE);
    _currentPageIndex = new BehaviorSubject(this.DEFAULT_CURRENT_PAGE_INDEX);
    constructor(symbolRegistry) {
        this.symbolRegistry = symbolRegistry;
        this.symbolRegistry.registerSymbols([apArrowLeft, apArrowRight]);
        combineLatest([this._itemCount, this._itemCountPerPage, this._currentPageIndex])
            .pipe(distinctUntilChanged(([previousItemCount, previousItemCountPerPage, previousCurrentPageIndex], [itemCount, itemCountPerPage, currentPageIndex]) => {
            return (previousItemCount === itemCount &&
                previousItemCountPerPage === itemCountPerPage &&
                previousCurrentPageIndex === currentPageIndex);
        }), takeUntil(this.destroy$))
            .subscribe(([itemCount, itemCountPerPage, currentPageIndex]) => {
            this.pageCount = Math.ceil(itemCount / itemCountPerPage);
            // make sure page index is between min and max page index
            this._currentPageIndex.next(Math.max(0, Math.min(this.pageCount - 1, currentPageIndex)));
            this.firstPageDisplayed = this.currentPageIndex === 0;
            this.lastPageDisplayed = this.currentPageIndex === this.pageCount - 1;
        });
    }
    ngOnDestroy() {
        this.destroy$.next();
        this.destroy$.complete();
    }
    onEnterKeydownPressed() {
        if (this.pageInput && !isNaN(+this.pageInput) && +this.pageInput > 0 && +this.pageInput <= this.pageCount) {
            this.onSelectPage(+this.pageInput - 1);
        }
        this.pageInput = '';
    }
    onSelectPage(pageIndex) {
        this._currentPageIndex.next(pageIndex);
        this.currentPageIndexChange.emit(pageIndex);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: PaginatorComponent, deps: [{ token: i1.SymbolRegistry }], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: PaginatorComponent, isStandalone: true, selector: "ap-paginator", inputs: { currentPageIndex: "currentPageIndex", displayGoTo: "displayGoTo", edgeSize: "edgeSize", goToLabel: "goToLabel", itemCount: "itemCount", itemCountPerPage: "itemCountPerPage", middleSize: "middleSize" }, outputs: { currentPageIndexChange: "currentPageIndexChange" }, host: { listeners: { "keydown.enter": "onEnterKeydownPressed()" } }, ngImport: i0, template: "<div class=\"item-index-overview\">\n    {{ currentPageIndex * itemCountPerPage + 1 }}\n    - {{ lastPageDisplayed ? itemCount : (currentPageIndex + 1) * itemCountPerPage }} of {{ itemCount }}\n</div>\n\n<div class=\"pages\">\n    <button\n        class=\"navigation-button\"\n        ariaLabel=\"Select Previous Page button\"\n        [disabled]=\"firstPageDisplayed\"\n        (click)=\"onSelectPage(currentPageIndex - 1)\">\n        <ap-symbol size=\"sm\" symbolId=\"arrow-left\" />\n    </button>\n    @if (pageCount > edgeSize + 1) {\n        @if (currentPageIndex >= edgeSize - 1) {\n            @if (currentPageIndex <= pageCount - edgeSize) {\n                <ap-paginator-button\n                    [pageIndex]=\"0\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n                <span class=\"ellipsis\">...</span>\n                @for (dummy of [].constructor(middleSize); track dummy; let i = $index) {\n                    <ap-paginator-button\n                        [pageIndex]=\"currentPageIndex + i - (middleSize - 1) / 2\"\n                        [selectedPageIndex]=\"currentPageIndex\"\n                        (selectPage)=\"onSelectPage($event)\" />\n                }\n                <span class=\"ellipsis\">...</span>\n                <ap-paginator-button\n                    [pageIndex]=\"pageCount - 1\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n            } @else {\n                <ap-paginator-button\n                    [pageIndex]=\"0\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n                <span class=\"ellipsis\">...</span>\n                @for (dummy of [].constructor(edgeSize); track dummy; let i = $index) {\n                    <ap-paginator-button\n                        [pageIndex]=\"pageCount - edgeSize + i\"\n                        [selectedPageIndex]=\"currentPageIndex\"\n                        (selectPage)=\"onSelectPage($event)\" />\n                }\n            }\n        } @else {\n            @for (dummy of [].constructor(edgeSize); track dummy; let i = $index) {\n                <ap-paginator-button\n                    [pageIndex]=\"i\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n            }\n            <span class=\"ellipsis\">...</span>\n            <ap-paginator-button\n                [pageIndex]=\"pageCount - 1\"\n                [selectedPageIndex]=\"currentPageIndex\"\n                (selectPage)=\"onSelectPage($event)\" />\n        }\n    } @else {\n        @for (dummy of [].constructor(pageCount); track dummy; let i = $index) {\n            <ap-paginator-button\n                [pageIndex]=\"i\"\n                [selectedPageIndex]=\"currentPageIndex\"\n                (selectPage)=\"onSelectPage($event)\" />\n        }\n    }\n    <button\n        class=\"navigation-button\"\n        ariaLabel=\"Select Next Page button\"\n        [disabled]=\"lastPageDisplayed\"\n        (click)=\"onSelectPage(currentPageIndex + 1)\">\n        <ap-symbol size=\"sm\" symbolId=\"arrow-right\" />\n    </button>\n</div>\n<div class=\"go-to\">\n    @if (displayGoTo) {\n        <span>{{ goToLabel }}</span>\n    }\n    @if (displayGoTo) {\n        <input\n            type=\"number\"\n            [(ngModel)]=\"pageInput\" />\n    }\n</div>\n", styles: ["ap-paginator{display:flex;align-items:center;gap:var(--ref-spacing-lg);width:100%;justify-content:space-between;--paginator-button-height: 36px}ap-paginator .item-index-overview{font-weight:var(--ref-font-weight-regular);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm);color:var(--ref-color-grey-60);white-space:nowrap}ap-paginator .navigation-button{display:grid;place-content:center;height:var(--paginator-button-height);width:var(--paginator-button-height);min-height:var(--paginator-button-height);min-width:var(--paginator-button-height);max-height:var(--paginator-button-height);max-width:var(--paginator-button-height);border-radius:var(--ref-border-radius-sm);background:transparent;border:none}ap-paginator .navigation-button ap-symbol{color:var(--ref-color-electric-blue-100)}ap-paginator .navigation-button:disabled{pointer-events:none}ap-paginator .navigation-button:disabled ap-symbol{color:var(--ref-color-grey-40)}ap-paginator .navigation-button:not(:disabled){cursor:pointer}ap-paginator .navigation-button:hover:not(:disabled){background:var(--ref-color-electric-blue-10)}ap-paginator .navigation-button:active{background:var(--ref-color-electric-blue-20)}@media (hover: hover){ap-paginator .navigation-button:focus:not(.disabled):not(:active){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-paginator .pages{display:flex;justify-self:center;color:var(--ref-color-electric-blue-100);gap:var(--ref-spacing-xxxs)}ap-paginator .pages ap-paginator-button,ap-paginator .pages button.mat-flat-button{vertical-align:middle}ap-paginator .pages button.mat-flat-button:not(.mat-accent):not([disabled]){color:var(--ref-color-electric-blue-100)}ap-paginator .pages button.mat-flat-button:not(.mat-accent):not([disabled]):hover{background-color:var(--ref-color-electric-blue-10)}ap-paginator .pages .ellipsis{display:inline-block;width:var(--paginator-button-height);line-height:var(--paginator-button-height);text-align:center;vertical-align:bottom}ap-paginator .go-to{display:flex;align-items:center;gap:var(--ref-spacing-xs)}ap-paginator .go-to span{font-weight:var(--ref-font-weight-standard);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm);color:var(--ref-color-grey-60)}ap-paginator .go-to input{box-sizing:border-box;background:var(--ref-color-white);width:48px;height:var(--paginator-button-height);border-radius:var(--ref-border-radius-sm);border:1px solid var(--ref-color-grey-20);padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "component", type: PaginatorButtonComponent, selector: "ap-paginator-button", inputs: ["ariaLabel", "disabled", "pageIndex", "selectedPageIndex"], outputs: ["selectPage"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: PaginatorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ap-paginator', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SymbolComponent, PaginatorButtonComponent, ReactiveFormsModule, FormsModule], encapsulation: ViewEncapsulation.None, template: "<div class=\"item-index-overview\">\n    {{ currentPageIndex * itemCountPerPage + 1 }}\n    - {{ lastPageDisplayed ? itemCount : (currentPageIndex + 1) * itemCountPerPage }} of {{ itemCount }}\n</div>\n\n<div class=\"pages\">\n    <button\n        class=\"navigation-button\"\n        ariaLabel=\"Select Previous Page button\"\n        [disabled]=\"firstPageDisplayed\"\n        (click)=\"onSelectPage(currentPageIndex - 1)\">\n        <ap-symbol size=\"sm\" symbolId=\"arrow-left\" />\n    </button>\n    @if (pageCount > edgeSize + 1) {\n        @if (currentPageIndex >= edgeSize - 1) {\n            @if (currentPageIndex <= pageCount - edgeSize) {\n                <ap-paginator-button\n                    [pageIndex]=\"0\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n                <span class=\"ellipsis\">...</span>\n                @for (dummy of [].constructor(middleSize); track dummy; let i = $index) {\n                    <ap-paginator-button\n                        [pageIndex]=\"currentPageIndex + i - (middleSize - 1) / 2\"\n                        [selectedPageIndex]=\"currentPageIndex\"\n                        (selectPage)=\"onSelectPage($event)\" />\n                }\n                <span class=\"ellipsis\">...</span>\n                <ap-paginator-button\n                    [pageIndex]=\"pageCount - 1\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n            } @else {\n                <ap-paginator-button\n                    [pageIndex]=\"0\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n                <span class=\"ellipsis\">...</span>\n                @for (dummy of [].constructor(edgeSize); track dummy; let i = $index) {\n                    <ap-paginator-button\n                        [pageIndex]=\"pageCount - edgeSize + i\"\n                        [selectedPageIndex]=\"currentPageIndex\"\n                        (selectPage)=\"onSelectPage($event)\" />\n                }\n            }\n        } @else {\n            @for (dummy of [].constructor(edgeSize); track dummy; let i = $index) {\n                <ap-paginator-button\n                    [pageIndex]=\"i\"\n                    [selectedPageIndex]=\"currentPageIndex\"\n                    (selectPage)=\"onSelectPage($event)\" />\n            }\n            <span class=\"ellipsis\">...</span>\n            <ap-paginator-button\n                [pageIndex]=\"pageCount - 1\"\n                [selectedPageIndex]=\"currentPageIndex\"\n                (selectPage)=\"onSelectPage($event)\" />\n        }\n    } @else {\n        @for (dummy of [].constructor(pageCount); track dummy; let i = $index) {\n            <ap-paginator-button\n                [pageIndex]=\"i\"\n                [selectedPageIndex]=\"currentPageIndex\"\n                (selectPage)=\"onSelectPage($event)\" />\n        }\n    }\n    <button\n        class=\"navigation-button\"\n        ariaLabel=\"Select Next Page button\"\n        [disabled]=\"lastPageDisplayed\"\n        (click)=\"onSelectPage(currentPageIndex + 1)\">\n        <ap-symbol size=\"sm\" symbolId=\"arrow-right\" />\n    </button>\n</div>\n<div class=\"go-to\">\n    @if (displayGoTo) {\n        <span>{{ goToLabel }}</span>\n    }\n    @if (displayGoTo) {\n        <input\n            type=\"number\"\n            [(ngModel)]=\"pageInput\" />\n    }\n</div>\n", styles: ["ap-paginator{display:flex;align-items:center;gap:var(--ref-spacing-lg);width:100%;justify-content:space-between;--paginator-button-height: 36px}ap-paginator .item-index-overview{font-weight:var(--ref-font-weight-regular);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm);color:var(--ref-color-grey-60);white-space:nowrap}ap-paginator .navigation-button{display:grid;place-content:center;height:var(--paginator-button-height);width:var(--paginator-button-height);min-height:var(--paginator-button-height);min-width:var(--paginator-button-height);max-height:var(--paginator-button-height);max-width:var(--paginator-button-height);border-radius:var(--ref-border-radius-sm);background:transparent;border:none}ap-paginator .navigation-button ap-symbol{color:var(--ref-color-electric-blue-100)}ap-paginator .navigation-button:disabled{pointer-events:none}ap-paginator .navigation-button:disabled ap-symbol{color:var(--ref-color-grey-40)}ap-paginator .navigation-button:not(:disabled){cursor:pointer}ap-paginator .navigation-button:hover:not(:disabled){background:var(--ref-color-electric-blue-10)}ap-paginator .navigation-button:active{background:var(--ref-color-electric-blue-20)}@media (hover: hover){ap-paginator .navigation-button:focus:not(.disabled):not(:active){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-paginator .pages{display:flex;justify-self:center;color:var(--ref-color-electric-blue-100);gap:var(--ref-spacing-xxxs)}ap-paginator .pages ap-paginator-button,ap-paginator .pages button.mat-flat-button{vertical-align:middle}ap-paginator .pages button.mat-flat-button:not(.mat-accent):not([disabled]){color:var(--ref-color-electric-blue-100)}ap-paginator .pages button.mat-flat-button:not(.mat-accent):not([disabled]):hover{background-color:var(--ref-color-electric-blue-10)}ap-paginator .pages .ellipsis{display:inline-block;width:var(--paginator-button-height);line-height:var(--paginator-button-height);text-align:center;vertical-align:bottom}ap-paginator .go-to{display:flex;align-items:center;gap:var(--ref-spacing-xs)}ap-paginator .go-to span{font-weight:var(--ref-font-weight-standard);font-size:var(--ref-font-size-sm);line-height:var(--ref-line-height-sm);color:var(--ref-color-grey-60)}ap-paginator .go-to input{box-sizing:border-box;background:var(--ref-color-white);width:48px;height:var(--paginator-button-height);border-radius:var(--ref-border-radius-sm);border:1px solid var(--ref-color-grey-20);padding:var(--ref-spacing-xs) var(--ref-spacing-sm)}\n"] }]
        }], ctorParameters: () => [{ type: i1.SymbolRegistry }], propDecorators: { currentPageIndex: [{
                type: Input
            }], displayGoTo: [{
                type: Input
            }], edgeSize: [{
                type: Input
            }], goToLabel: [{
                type: Input
            }], itemCount: [{
                type: Input
            }], itemCountPerPage: [{
                type: Input
            }], middleSize: [{
                type: Input
            }], currentPageIndexChange: [{
                type: Output
            }], onEnterKeydownPressed: [{
                type: HostListener,
                args: ['keydown.enter']
            }] } });

/**
 * Generated bundle index. Do not edit.
 */

export { PaginatorButtonComponent, PaginatorComponent };
//# sourceMappingURL=agorapulse-ui-components-paginator.mjs.map
