'use strict';

var index = require('./index-Bkm7eeWO.js');

const EclFileTranslations = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.others = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-file__translation-container`,
            `sc-ecl-file-${this.theme}`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidRender() {
        const translationsTotal = this.el.querySelectorAll('.ecl-file__translation-item').length;
        const text = document.createTextNode(` (${translationsTotal}) `);
        if (this.el.querySelector('.ecl-file__translation-toggle')) {
            this.el.querySelector('.ecl-file__translation-toggle .ecl-button__icon').before(text);
        }
    }
    render() {
        return (index.h("div", { key: '217c411335fdf9aaf79b9f90a168bc262a1030c5', class: this.getClass(), "data-ecl-file-translation-container": true }, index.h("ecl-button", { key: 'e3f4f9ac27c432c97e4e2fd209311d2fdce70857', styleClass: `ecl-file__translation-toggle sc-ecl-file-${this.theme}`, variant: "tertiary", "data-ecl-file-translation-toggle": true, theme: this.theme }, this.toggleLabel, index.h("ecl-icon", { key: 'c17979edc0afcb4afa62f103602ac146a8132f59', styleClass: "ecl-button__icon ecl-button__icon--after", icon: "corner-arrow", rotate: "180", size: "fluid" })), index.h("ul", { key: 'cf9704b444d2063298f28532d7438a0346f49059', class: `ecl-file__translation-list sc-ecl-file-${this.theme}` }, index.h("slot", { key: '7edaa3370f47be8502f0debf8c780fb14cbe5dcc' }), this.others ?
            index.h("li", { class: `ecl-file__translation-item ecl-file__translation-description sc-ecl-file-${this.theme}` }, index.h("slot", { name: "others" })) : '')));
    }
    get el() { return index.getElement(this); }
};

exports.ecl_file_translations = EclFileTranslations;
