import { h } from "@stencil/core";
import getAssetPath from "../../utils/assetPath";
export class EclFooter {
    constructor() {
        this.styleClass = '';
        this.theme = 'ec';
        this.logoAlt = undefined;
        this.logoTitle = undefined;
        this.logoLink = undefined;
        this.logoAriaLabel = undefined;
        this.logoLangCode = undefined;
        this.siteName = undefined;
        this.variant = undefined;
        this.description = undefined;
    }
    getClass() {
        const styleClasses = [
            `ecl-site-footer`,
            `ecl-site-footer--${this.variant}`,
            this.styleClass
        ];
        if (this.theme === 'ec' && this.variant === 'core') {
            styleClasses.push('ecl-site-footer--split-columns');
        }
        return styleClasses.join(' ');
    }
    componentDidLoad() {
        const lists = this.el.querySelectorAll('.ecl-site-footer__list');
        const titles = this.el.querySelectorAll('ecl-text[tag="h2"]');
        if (titles && titles[0]) {
            titles.forEach((title) => {
                const section = title.parentElement.parentElement;
                title.firstElementChild.classList.add(`sc-ecl-footer-${this.theme}`);
                section.insertBefore(title.firstElementChild, section.firstElementChild);
            });
        }
        if (lists) {
            lists.forEach((list) => {
                const items = list.querySelectorAll('.ecl-site-footer__list-item');
                if (items) {
                    list.innerHTML = '';
                    list.append(...items);
                }
            });
        }
    }
    render() {
        const logoPath = this.theme === 'ec' ?
            getAssetPath(`./build/images/${this.theme}/logos/negative/logo-${this.theme}--${this.logoLangCode}.svg`) :
            getAssetPath(`./build/images/${this.theme}/logos/standard-version/positive/logo-${this.theme}--${this.logoLangCode}.svg`);
        return (h("footer", { class: this.getClass() }, h("div", { class: "ecl-container ecl-site-footer__container" }, this.theme === 'eu' && this.variant === 'harmonised' ?
            h("div", { class: "ecl-site-footer__row" }, h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section  ecl-site-footer__section--site-info" }, h("h2", { class: "ecl-site-footer__title" }, this.siteName), h("div", { class: "ecl-site-footer__description" }, this.description), h("ul", { class: `ecl-site-footer__list` }, h("slot", { name: "ecl-footer-list-info" })))), h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-top-middle" }))), h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-top-middle-bottom" })))), h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-top-right" }))))) : '', h("div", { class: "ecl-site-footer__row" }, h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, this.variant === 'core' || this.variant === 'harmonised' ?
            h("ecl-link", { path: this.logoLink, theme: this.theme, variant: "standalone", styleClass: `ecl-site-footer__logo-link sc-ecl-footer-${this.theme}`, ariaLabel: this.logoAriaLabel }, h("ecl-picture", { theme: this.theme, imageAlt: this.logoAlt, imgClass: `sc-ecl-footer-${this.theme} ecl-site-footer__logo-image`, styleClass: `ecl-site-footer__picture sc-ecl-site-footer-${this.theme}`, image: this.theme === 'ec' ?
                    logoPath :
                    getAssetPath(`./build/images/${this.theme}/logos/condensed-version/positive/logo-${this.theme}--${this.logoLangCode}.svg`) }, h("source", { srcSet: logoPath, media: "(min-width: 996px)" }), h("slot", { name: "sources" }))) : '', this.theme === 'ec' ?
            h("h2", { class: "ecl-site-footer__title" }, this.siteName) : '', this.theme === 'ec' || this.variant === 'core' ?
            h("div", { class: "ecl-site-footer__description" }, h("slot", { name: "description" })) :
            h("div", { class: "ecl-site-footer__description" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "description" }))), this.theme === 'ec' && this.variant !== 'core' ?
            h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-info" })) : '')), h("div", { class: "ecl-site-footer__column" }, h("div", { class: `ecl-site-footer__section ${this.theme === 'ec' && this.variant === 'core' ? 'ecl-site-footer__section--separator' : ''}` }, h("ul", { class: `ecl-site-footer__list ${this.theme === 'ec' && this.variant === 'core' ? 'ecl-site-footer__list--columns' : ''}` }, h("slot", { name: "ecl-footer-list-main" }))), h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-bottom-left" }))), (this.variant === 'standardised' || this.variant === 'harmonised') ?
            h("div", { class: "ecl-site-footer__section" }, h("ul", { class: `ecl-site-footer__list ${this.theme === 'ec' ? 'ecl-site-footer__list--inline' : ''}` }, h("slot", { name: "ecl-footer-list-main-bottom" }))) : '', this.variant === 'core' ?
            h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-bottom-right" }))) : ''), this.theme === 'ec' && (this.variant === 'standardised' || this.variant === 'harmonised') ?
            h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, h("ul", { class: `ecl-site-footer__list` }, h("slot", { name: "ecl-footer-list-main-right" }))), h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-main-right-bottom" })))) : '', this.theme === 'eu' ?
            h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-right" })))) : ''), this.theme === 'ec' && (this.variant === 'standardised' || this.variant === 'harmonised') ?
            h("div", { class: "ecl-site-footer__row" }, h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section ecl-site-footer-section--condensed" }, h("div", { class: "ecl-site-footer__content" }, "More information on: "), h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-middle" }))))) : '', this.theme === 'ec' && (this.variant === 'standardised' || this.variant === 'harmonised') ? (h("div", { class: "ecl-site-footer__row" }, h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section" }, h("ecl-link", { theme: this.theme, path: this.logoLink, variant: "standalone", styleClass: `ecl-site-footer__logo-link sc-ecl-footer-${this.theme}`, ariaLabel: this.logoAriaLabel }, h("ecl-picture", { theme: this.theme, imageAlt: this.logoAlt, imgClass: `ecl-site-footer__logo-image sc-ecl-site-footer-${this.theme}`, image: logoPath, styleClass: `ecl-site-footer__picture sc-ecl-site-footer-${this.theme}` }, h("slot", { name: "sources" }))))), h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section ecl-site-footer__section--split-list" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-bottom-center" })))), h("div", { class: "ecl-site-footer__column" }, h("div", { class: "ecl-site-footer__section ecl-site-footer__section--split-list" }, h("ul", { class: "ecl-site-footer__list" }, h("slot", { name: "ecl-footer-list-bottom-right" })))))) : (''))));
    }
    static get is() { return "ecl-footer"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-footer-ec.css"],
            "eu": ["./build/styles/ecl-footer-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-footer-ec.css"],
            "eu": ["build/styles/ecl-footer-eu.css"]
        };
    }
    static get assetsDirs() { return ["build"]; }
    static get properties() {
        return {
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "style-class",
                "reflect": false,
                "defaultValue": "''"
            },
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "'ec'"
            },
            "logoAlt": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "logo-alt",
                "reflect": false
            },
            "logoTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "logo-title",
                "reflect": false
            },
            "logoLink": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "logo-link",
                "reflect": false
            },
            "logoAriaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "logo-aria-label",
                "reflect": false
            },
            "logoLangCode": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "logo-lang-code",
                "reflect": false
            },
            "siteName": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "site-name",
                "reflect": false
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "variant",
                "reflect": false
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "description",
                "reflect": false
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-footer.js.map
