'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-420e0ca1.js');
const assetPath = require('./assetPath-3fb1a4a9.js');

const eclCategoryFilterEcCss = ".ecl-category-filter.sc-ecl-category-filter-ec{max-width:18rem}.ecl-category-filter__list-item.sc-ecl-category-filter-ec{position:relative}.ecl-category-filter__item-icon.sc-ecl-category-filter-ec{color:#004494;margin:-3px 0}.ecl-category-filter__item.sc-ecl-category-filter-ec{border-bottom:1px solid #e3e3e3;color:#404040;display:flex;font:normal normal 400 .875rem/1rem arial,sans-serif;justify-content:space-between;padding:.75rem;text-decoration:none}.ecl-category-filter__item.sc-ecl-category-filter-ec:hover{text-decoration:underline}.ecl-category-filter__item.sc-ecl-category-filter-ec:focus-visible{outline:2px solid #004494;outline-offset:-2px;text-decoration:underline}.ecl-category-filter__item.ecl-category-filter__item--level-1.sc-ecl-category-filter-ec .ecl-category-filter__item-icon.sc-ecl-category-filter-ec{margin:0 0 0 .5rem}.ecl-category-filter__item.ecl-category-filter__item--level-2.sc-ecl-category-filter-ec{justify-content:normal;padding-inline-start:2rem}.ecl-category-filter__item.ecl-category-filter__item--level-2.ecl-category-filter__item--has-children.sc-ecl-category-filter-ec{padding-inline-start:.5rem}.ecl-category-filter__item.ecl-category-filter__item--level-3.sc-ecl-category-filter-ec{justify-content:normal;padding-inline-start:3rem}.ecl-category-filter__item.ecl-category-filter__item--level-3.ecl-category-filter__item--has-children.sc-ecl-category-filter-ec{padding-inline-start:1.5rem}.ecl-category-filter__item.ecl-category-filter__item--level-4.sc-ecl-category-filter-ec{justify-content:normal;padding-inline-start:4rem}.ecl-category-filter__list.sc-ecl-category-filter-ec{list-style:none;margin:0;padding:0}.ecl-category-filter__list.sc-ecl-category-filter-ec .ecl-category-filter__list.sc-ecl-category-filter-ec .ecl-category-filter__item.sc-ecl-category-filter-ec,.ecl-category-filter__list-item.sc-ecl-category-filter-ec:last-child .ecl-category-filter__item.sc-ecl-category-filter-ec{border-bottom:0}.ecl-category-filter__list-item[aria-expanded=false].sc-ecl-category-filter-ec .ecl-category-filter__list.sc-ecl-category-filter-ec{display:none}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec .ecl-category-filter__item.sc-ecl-category-filter-ec{border-bottom:0}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec>.ecl-category-filter__item.sc-ecl-category-filter-ec .ecl-category-filter__item-icon.sc-ecl-category-filter-ec{transform:rotate(180deg)}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec .ecl-category-filter__item--level-1.sc-ecl-category-filter-ec .ecl-category-filter__item-icon.sc-ecl-category-filter-ec{transform:rotate(0deg)}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec>.ecl-category-filter__list.sc-ecl-category-filter-ec{display:block}.ecl-category-filter__item--current.sc-ecl-category-filter-ec,.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec{background-color:#ebebeb}.ecl-category-filter__item--current.sc-ecl-category-filter-ec:before,.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec:before{background-color:#004494;content:\"\";display:inline-block;height:100%;left:0;position:absolute;top:0;width:4px;z-index:1}.ecl-category-filter__item--current.sc-ecl-category-filter-ec{font-weight:700}.ecl-category-filter.sc-ecl-category-filter-ec>.ecl-category-filter__list.sc-ecl-category-filter-ec>.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-ec{border-bottom:1px solid #e3e3e3}.no-js.sc-ecl-category-filter-ec .ecl-category-filter__list-item.sc-ecl-category-filter-ec .ecl-category-filter__item.sc-ecl-category-filter-ec{border-bottom:0}.no-js.sc-ecl-category-filter-ec .ecl-category-filter__list-item.sc-ecl-category-filter-ec .ecl-category-filter__list.sc-ecl-category-filter-ec{display:block}.ecl-category-filter__item-icon.sc-ecl-category-filter-ec.sc-ecl-category-filter-ec{margin:-3px 0!important}.ecl-category-filter__list-item.sc-ecl-category-filter-ec.sc-ecl-category-filter-ec{border-bottom:1px solid #e3e3e3}.ecl-category-filter__list-item.sc-ecl-category-filter-ec.sc-ecl-category-filter-ec .ecl-category-filter__list-item.sc-ecl-category-filter-ec{border:none}";

const eclCategoryFilterEuCss = ".ecl-category-filter.sc-ecl-category-filter-eu{max-width:18rem}.ecl-category-filter__list-item.sc-ecl-category-filter-eu{position:relative}.ecl-category-filter__item-icon.sc-ecl-category-filter-eu{color:#0e47cb;margin:-3px 0}.ecl-category-filter__item.sc-ecl-category-filter-eu{border-bottom:1px solid #cfdaf5;color:#262b38;display:flex;font:normal normal 400 .875rem/1rem arial,sans-serif;justify-content:space-between;padding:.75rem;text-decoration:none}.ecl-category-filter__item.sc-ecl-category-filter-eu:hover{text-decoration:underline}.ecl-category-filter__item.sc-ecl-category-filter-eu:focus-visible{outline:2px solid #0e47cb;outline-offset:-2px;text-decoration:underline}.ecl-category-filter__item.ecl-category-filter__item--level-1.sc-ecl-category-filter-eu .ecl-category-filter__item-icon.sc-ecl-category-filter-eu{margin:0 0 0 .5rem}.ecl-category-filter__item.ecl-category-filter__item--level-2.sc-ecl-category-filter-eu{justify-content:normal;padding-inline-start:2rem}.ecl-category-filter__item.ecl-category-filter__item--level-2.ecl-category-filter__item--has-children.sc-ecl-category-filter-eu{padding-inline-start:.5rem}.ecl-category-filter__item.ecl-category-filter__item--level-3.sc-ecl-category-filter-eu{justify-content:normal;padding-inline-start:3rem}.ecl-category-filter__item.ecl-category-filter__item--level-3.ecl-category-filter__item--has-children.sc-ecl-category-filter-eu{padding-inline-start:1.5rem}.ecl-category-filter__item.ecl-category-filter__item--level-4.sc-ecl-category-filter-eu{justify-content:normal;padding-inline-start:4rem}.ecl-category-filter__list.sc-ecl-category-filter-eu{list-style:none;margin:0;padding:0}.ecl-category-filter__list.sc-ecl-category-filter-eu .ecl-category-filter__list.sc-ecl-category-filter-eu .ecl-category-filter__item.sc-ecl-category-filter-eu,.ecl-category-filter__list-item.sc-ecl-category-filter-eu:last-child .ecl-category-filter__item.sc-ecl-category-filter-eu{border-bottom:0}.ecl-category-filter__list-item[aria-expanded=false].sc-ecl-category-filter-eu .ecl-category-filter__list.sc-ecl-category-filter-eu{display:none}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu .ecl-category-filter__item.sc-ecl-category-filter-eu{border-bottom:0}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu>.ecl-category-filter__item.sc-ecl-category-filter-eu .ecl-category-filter__item-icon.sc-ecl-category-filter-eu{transform:rotate(180deg)}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu .ecl-category-filter__item--level-1.sc-ecl-category-filter-eu .ecl-category-filter__item-icon.sc-ecl-category-filter-eu{transform:rotate(0deg)}.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu>.ecl-category-filter__list.sc-ecl-category-filter-eu{display:block}.ecl-category-filter__item--current.sc-ecl-category-filter-eu,.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu{background-color:#e7edfa}.ecl-category-filter__item--current.sc-ecl-category-filter-eu:before,.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu:before{background-color:#0e47cb;content:\"\";display:inline-block;height:100%;left:0;position:absolute;top:0;width:4px;z-index:1}.ecl-category-filter__item--current.sc-ecl-category-filter-eu{font-weight:700}.ecl-category-filter.sc-ecl-category-filter-eu>.ecl-category-filter__list.sc-ecl-category-filter-eu>.ecl-category-filter__list-item[aria-expanded=true].sc-ecl-category-filter-eu{border-bottom:1px solid #cfdaf5}.no-js.sc-ecl-category-filter-eu .ecl-category-filter__list-item.sc-ecl-category-filter-eu .ecl-category-filter__item.sc-ecl-category-filter-eu{border-bottom:0}.no-js.sc-ecl-category-filter-eu .ecl-category-filter__list-item.sc-ecl-category-filter-eu .ecl-category-filter__list.sc-ecl-category-filter-eu{display:block}.ecl-category-filter__item-icon.sc-ecl-category-filter-eu.sc-ecl-category-filter-eu{margin:-3px 0!important}.ecl-category-filter__list-item.sc-ecl-category-filter-eu.sc-ecl-category-filter-eu{border-bottom:1px solid #e3e3e3}.ecl-category-filter__list-item.sc-ecl-category-filter-eu.sc-ecl-category-filter-eu .ecl-category-filter__list-item.sc-ecl-category-filter-eu{border:none}";

const EclCategoryFilter = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.styleClass = '';
        this.theme = 'ec';
        this.eclScript = false;
    }
    getClass() {
        return [
            `ecl-category-filter`,
            this.styleClass
        ].join(' ');
    }
    componentDidRender() {
        const items = Array.from(this.el.querySelectorAll('.ecl-category-filter__item--level-1'));
        if (items[0]) {
            const lastItem = items[items.length - 1];
            lastItem.parentElement.parentElement.style.border = 'none';
        }
        if (this.eclScript) {
            const src = assetPath.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 (index.h("nav", { class: this.getClass(), "data-ecl-category-filter": true }, index.h("ul", { class: "ecl-category-filter__list" }, index.h("slot", null))));
    }
    static get assetsDirs() { return ["build"]; }
    get el() { return index.getElement(this); }
};
EclCategoryFilter.style = {
    ec: eclCategoryFilterEcCss,
    eu: eclCategoryFilterEuCss
};

exports.ecl_category_filter = EclCategoryFilter;

//# sourceMappingURL=ecl-category-filter.cjs.entry.js.map