import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
import { d as defineCustomElement$2 } from './ecl-icon2.js';

const EclGalleryItem$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    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 = 'video';
  }
  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("img", { src: this.mediaHref, alt: this.imageAlt, class: `ecl-gallery__image sc-ecl-gallery-${this.theme}` }) : '', this.type !== 'image' ?
      h("ecl-icon", { "style-class": `ecl-gallery__image-icon sc-ecl-gallery-${this.theme}`, icon: this.icon, size: "l" }) : '', h("figcaption", { class: `ecl-gallery__description sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-description": true }, h("slot", null), h("span", { class: `ecl-gallery__meta sc-ecl-gallery-${this.theme}`, "data-ecl-gallery-meta": true }, this.meta))))));
  }
}, [4, "ecl-gallery-item", {
    "styleClass": [1, "style-class"],
    "theme": [1],
    "imageAlt": [1, "image-alt"],
    "mediaHref": [1, "media-href"],
    "mediaIframeHref": [1, "media-iframe-href"],
    "mediaSharePath": [1, "media-share-path"],
    "meta": [1],
    "type": [1],
    "icon": [1]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["ecl-gallery-item", "ecl-icon"];
  components.forEach(tagName => { switch (tagName) {
    case "ecl-gallery-item":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, EclGalleryItem$1);
      }
      break;
    case "ecl-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}

const EclGalleryItem = EclGalleryItem$1;
const defineCustomElement = defineCustomElement$1;

export { EclGalleryItem, defineCustomElement };

//# sourceMappingURL=ecl-gallery-item.js.map