import { h } from "@stencil/core";
export class EclGalleryItem {
    constructor() {
        this.styleClass = '';
        this.theme = 'ec';
        this.imageAlt = undefined;
        this.mediaHref = undefined;
        this.mediaIframeHref = undefined;
        this.mediaSharePath = undefined;
        this.meta = undefined;
        this.type = 'image';
        this.icon = undefined;
    }
    getClass() {
        return [
            `ecl-gallery__item`,
            `sc-ecl-gallery-${this.theme}`,
            this.styleClass
        ].join(' ');
    }
    getLinkAttr() {
        const attrs = {
            'data-ecl-gallery-item': ''
        };
        if (this.mediaSharePath) {
            attrs['data-ecl-gallery-item-share'] = this.mediaSharePath;
        }
        if (this.mediaIframeHref) {
            attrs['data-ecl-gallery-item-embed-src'] = this.mediaIframeHref;
        }
        return attrs;
    }
    render() {
        return (h("li", { class: this.getClass() }, h("a", Object.assign({ href: this.mediaIframeHref ? this.mediaIframeHref : this.mediaHref, class: `ecl-gallery__item-link sc-ecl-gallery-${this.theme}` }, this.getLinkAttr()), h("figure", { class: `ecl-gallery__image-container sc-ecl-gallery-${this.theme}` }, h("slot", { name: "video" }), this.type !== 'html-video' ?
            h("ecl-picture", { image: this.mediaHref, "image-alt": this.imageAlt, styleClass: `ecl-gallery__picture sc-ecl-gallery-${this.theme}`, "img-class": `ecl-gallery__image sc-ecl-gallery-${this.theme}` }, h("slot", { name: "sources" })) : '', this.type !== 'image' ?
            h("div", { class: `ecl-gallery__item-icon-wrapper sc-ecl-gallery-${this.theme}` }, h("ecl-icon", { "style-class": `ecl-gallery__item-icon sc-ecl-gallery-${this.theme}`, icon: "play-filled", size: "l", color: "inverted" })) : '', h("figcaption", { class: `ecl-gallery__description sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-description": true }, this.icon ?
            h("ecl-icon", { icon: this.icon, styleClass: "ecl-gallery__description-icon", size: "s" }) : '', h("slot", null), h("span", { class: `ecl-gallery__meta sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-meta": true }, this.meta))))));
    }
    static get is() { return "ecl-gallery-item"; }
    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'"
            },
            "imageAlt": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "image-alt",
                "reflect": false
            },
            "mediaHref": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "media-href",
                "reflect": false
            },
            "mediaIframeHref": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "media-iframe-href",
                "reflect": false
            },
            "mediaSharePath": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "media-share-path",
                "reflect": false
            },
            "meta": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "meta",
                "reflect": false
            },
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'image'"
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "icon",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=ecl-gallery-item.js.map
