import { r as registerInstance, h } from './index-ytAlchvh.js';

const EclPaginationItem = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.styleClass = '';
        this.truncation = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-pagination__item`,
            `sc-ecl-pagination-${this.theme}`,
            this.styleClass
        ];
        if (this.current) {
            styleClasses.push('ecl-pagination__item--current');
        }
        if (this.previous) {
            styleClasses.push('ecl-pagination__item--previous');
        }
        if (this.next) {
            styleClasses.push('ecl-pagination__item--next');
        }
        if (this.truncation) {
            styleClasses.push('ecl-pagination__item--truncation');
        }
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    render() {
        return (h("li", { key: '539da0b1c82a4bbc732aea08de036d8466a34eec', class: this.getClass() }, this.truncation ?
            h("span", { class: `ecl-pagination__text ecl-pagination__text--summary sc-ecl-pagination-${this.theme}` }, "...")
            : !this.current ?
                h("ecl-link", { theme: this.theme, variant: "standalone", path: this.path, "aria-label": this.ariaLabel, "hide-label": !!(this.previous || this.next), styleClass: `sc-ecl-pagination-${this.theme} ecl-pagination__link` }, h("slot", null), this.previous || this.next ?
                    h("ecl-icon", { icon: "corner-arrow", size: "xs", rotate: this.previous ? '270' : '90', slot: this.previous ? 'icon-before' : 'icon-after', "style-class": `sc-ecl-pagination-${this.theme}` }) : '') : '', this.current ?
            h("span", { class: `ecl-pagination__text ecl-pagination__text--summary sc-ecl-pagination-${this.theme}` }, h("slot", null)) : '', this.current ?
            h("span", { class: `ecl-pagination__text ecl-pagination__text--full sc-ecl-pagination-${this.theme}` }, this.ariaLabel) : ''));
    }
    ;
};

export { EclPaginationItem as ecl_pagination_item };
