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

const EclFileTranslations$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  constructor() {
    super();
    this.__registerHost();
    this.theme = 'ec';
    this.styleClass = undefined;
    this.toggleLabel = undefined;
    this.others = false;
  }
  getClass() {
    const styleClasses = [
      `ecl-file__translation-container`,
      `sc-ecl-file-${this.theme}`,
      this.styleClass
    ];
    return styleClasses.join(' ');
  }
  componentDidRender() {
    const translationsTotal = this.el.querySelectorAll('.ecl-file__translation-item').length;
    const text = document.createTextNode(`( ${translationsTotal} )`);
    if (this.el.querySelector('.ecl-file__translation-toggle')) {
      this.el.querySelector('.ecl-file__translation-toggle .ecl-button__label').appendChild(text);
    }
  }
  render() {
    return (h("div", { class: this.getClass(), "data-ecl-file-translation-container": true }, h("ecl-button", { styleClass: `ecl-file__translation-toggle sc-ecl-file-${this.theme}`, variant: "ghost", "data-ecl-file-translation-toggle": true, theme: this.theme }, this.toggleLabel, h("ecl-icon", { styleClass: "ecl-button__icon ecl-button__icon--after", icon: "corener-arrow", transform: "rotate-180", size: "fluid" })), h("ul", { class: `ecl-file__translation-list sc-ecl-file-${this.theme}` }, h("slot", null), this.others ?
      h("li", { class: `ecl-file__translation-item ecl-file__translation-description sc-ecl-file-${this.theme}` }, h("slot", { name: "others" })) : '')));
  }
  get el() { return this; }
}, [4, "ecl-file-translations", {
    "theme": [1],
    "styleClass": [1, "style-class"],
    "toggleLabel": [1, "toggle-label"],
    "others": [4]
  }]);
function defineCustomElement$1() {
  if (typeof customElements === "undefined") {
    return;
  }
  const components = ["ecl-file-translations", "ecl-button", "ecl-icon"];
  components.forEach(tagName => { switch (tagName) {
    case "ecl-file-translations":
      if (!customElements.get(tagName)) {
        customElements.define(tagName, EclFileTranslations$1);
      }
      break;
    case "ecl-button":
      if (!customElements.get(tagName)) {
        defineCustomElement$3();
      }
      break;
    case "ecl-icon":
      if (!customElements.get(tagName)) {
        defineCustomElement$2();
      }
      break;
  } });
}

const EclFileTranslations = EclFileTranslations$1;
const defineCustomElement = defineCustomElement$1;

export { EclFileTranslations, defineCustomElement };

//# sourceMappingURL=ecl-file-translations.js.map