import { h } from "@stencil/core";
export class EclSocialMediaFollow {
    constructor() {
        this.variant = 'horizontal';
        this.position = 'left';
        this.inlineTitle = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-social-media-follow`,
            `ecl-social-media-follow--${this.variant}`,
            this.styleClass
        ];
        if (this.position === 'right') {
            styleClasses.push('ecl-social-media-follow--right');
        }
        if (this.inlineTitle) {
            styleClasses.push('ecl-social-media-follow--description_inline');
        }
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidRender() {
        if (this.el.querySelector('.ecl-social-media-follow__list')) {
            const list = this.el.querySelector('.ecl-social-media-follow__list');
            const popover = this.el.getElementsByTagName('ecl-popover')[0] || false;
            if (popover) {
                const li = document.createElement('li');
                li.classList.add('ecl-social-media-follow__item', `sc-ecl-social-media-follow-${this.theme}`);
                popover.parentNode.insertBefore(li, popover);
                li.appendChild(popover);
                li.querySelector('.ecl-popover__toggle').classList.add(`ecl-social-media-follow__link`, `sc-ecl-social-media-follow-${this.theme}`);
            }
            const items = this.el.querySelectorAll('.ecl-social-media-follow__item');
            list.innerHTML = '';
            list.append(...items);
        }
    }
    render() {
        return (h("div", { key: '853eda788114e619021d1709c299cb3f535e2495', class: this.getClass() }, this.description ?
            h("p", { class: "ecl-social-media-follow__description" }, this.description) : '', h("ul", { key: 'eafc5efdd060fd7fae06b8618bbba5dd48837978', class: "ecl-social-media-follow__list" }, h("slot", { key: 'ee19c79f2c23169d5956c2fb3f85828520a3c298' }))));
    }
    static get is() { return "ecl-social-media-follow"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-social-media-follow-ec.css"],
            "eu": ["./build/styles/ecl-social-media-follow-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-social-media-follow-ec.css"],
            "eu": ["build/styles/ecl-social-media-follow-eu.css"]
        };
    }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class"
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "variant",
                "defaultValue": "'horizontal'"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "description"
            },
            "position": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "position",
                "defaultValue": "'left'"
            },
            "inlineTitle": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "inline-title",
                "defaultValue": "false"
            }
        };
    }
    static get elementRef() { return "el"; }
}
