import { h, getAssetPath } from '@stencil/core';
export class EclCategoryFilter {
  constructor() {
    this.styleClass = '';
    this.theme = 'ec';
    this.eclScript = false;
  }
  getClass() {
    return [
      `ecl-category-filter`,
      this.styleClass
    ].join(' ');
  }
  componentDidRender() {
    if (this.eclScript) {
      const src = getAssetPath('./build/scripts/ecl-category-filter-vanilla.js');
      if (document.querySelector(`script[src="${src}"]`)) {
        document.querySelector(`script[src="${src}"]`).remove();
      }
      const script = document.createElement('script');
      script.src = src;
      script.onload = () => {
        const categoryFilter = new ECL.CategoryFilter(this.el.firstElementChild);
        categoryFilter.init();
      };
      document.body.appendChild(script);
    }
  }
  render() {
    return (h("nav", { class: this.getClass(), "data-ecl-category-filter": true }, h("ul", { class: "ecl-category-filter__list" }, h("slot", null))));
  }
  static get is() { return "ecl-category-filter"; }
  static get encapsulation() { return "scoped"; }
  static get originalStyleUrls() {
    return {
      "ec": ["./build/styles/ecl-category-filter-ec.css"],
      "eu": ["./build/styles/ecl-category-filter-eu.css"]
    };
  }
  static get styleUrls() {
    return {
      "ec": ["./build/styles/ecl-category-filter-ec.css"],
      "eu": ["./build/styles/ecl-category-filter-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'"
      },
      "eclScript": {
        "type": "boolean",
        "mutable": false,
        "complexType": {
          "original": "boolean",
          "resolved": "boolean",
          "references": {}
        },
        "required": false,
        "optional": false,
        "docs": {
          "tags": [],
          "text": ""
        },
        "attribute": "ecl-script",
        "reflect": false,
        "defaultValue": "false"
      }
    };
  }
  static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-category-filter.js.map
