'use strict';

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

const EclListIllustrationItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.iconSize = '2xl';
        this.squareImage = false;
        this.hasColumns = false;
        this.divider = false;
        this.mediaSize = 'm';
    }
    getClass() {
        const styleClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__item`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    getContentClass() {
        const contentClasses = [
            'ecl-list-illustration__item-content',
            `sc-ecl-list-illustration-${this.theme}`,
        ];
        if (this.divider) {
            contentClasses.push('ecl-list-illustration__divider');
        }
        if (this.image && !this.hasColumns) {
            contentClasses.push('ecl-list-illustration__item-content--row');
        }
        return contentClasses.join(' ');
    }
    getImgClass() {
        const imgClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__image`,
        ];
        if (this.squareImage) {
            imgClasses.push('ecl-list-illustration__image--square');
            imgClasses.push(`ecl-list-illustration__image--${this.mediaSize}`);
        }
        return imgClasses.join(' ');
    }
    getImgAttr() {
        const attrs = {
            role: 'img',
        };
        if (this.imageAlt) {
            attrs['aria-label'] = this.imageAlt;
        }
        return attrs;
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    render() {
        return (index.h("li", { key: 'b4c325c2f782dd56488dfea53d145f044d885546', class: this.getClass() }, index.h("div", { key: 'c186408a6bc4df4800be274dd9437cd8a223885c', class: this.getContentClass() }, this.image ?
            index.h("ecl-picture", Object.assign({ styleClass: `ecl-list-illustration__picture sc-ecl-list-illustration-${this.theme}`, imgClass: this.getImgClass(), image: this.image, imageAlt: this.imageAlt }, this.getImgAttr()), index.h("slot", { name: "sources" })) : '', this.icon ?
            index.h("ecl-icon", { icon: this.icon, size: this.iconSize, "style-class": `ecl-list-illustration__icon sc-ecl-list-illustration-${this.theme}` }) : '', index.h("div", { key: '6d048b4a209ce8487e7ef7c0703c963c8ccc3e95', class: `ecl-list-illustration__detail sc-ecl-list-illustration-${this.theme}` }, index.h("div", { key: '0ad18913575a44c460309723dc643aab4fe52a0d', class: `ecl-list-illustration__title-container sc-ecl-list-illustration-${this.theme}` }, this.itemValue ?
            index.h("div", { class: `ecl-list-illustration__value sc-ecl-list-illustration-${this.theme}` }, this.itemValue) : '', this.itemTitle && (index.h("div", { key: '95b24ee9d5e938d262aec29a4df8dabe3a50a8d0', class: `ecl-list-illustration__title sc-ecl-list-illustration-${this.theme}` }, this.itemLink ? (index.h("ecl-link", { variant: "standalone", path: this.itemLink }, this.itemTitle)) : (this.itemTitle)))), index.h("div", { key: 'eb1f5c43d873cf50fbdfc306e6c63475e38b999d', class: `ecl-list-illustration__description sc-ecl-list-illustration-${this.theme}` }, index.h("slot", { key: '5af094d1ee22f4b08a4e3747913cebd929625fb2' }))))));
    }
};

exports.ecl_list_illustration_item = EclListIllustrationItem;
