import{p as e,H as t,h as s,t as c}from"./p-BHHBMN0G.js";import{d as i}from"./p-C1DHlsEo.js";import{d as l}from"./p-Bmv0DoO8.js";import{d as a}from"./p-CvotSt5y.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.styleClass="",this.subItems=!1,this.expanded=!1}clickedItem(e){this.lastClicked=e.target.closest(".ecl-category-filter__list-item")}getClass(){return["ecl-category-filter__list-item","sc-ecl-category-filter-"+this.theme,this.styleClass].join(" ")}getLinkClass(){const e=["ecl-category-filter__item","sc-ecl-category-filter-"+this.theme,"ecl-category-filter__item--level-"+this.level,this.styleClass];return this.subItems&&e.push("ecl-category-filter__item--has-children"),e.join(" ")}componentWillLoad(){var e;this.theme=null!==(e=document.documentElement.getAttribute("data-ecl-theme"))&&void 0!==e?e:this.theme||"ec"}render(){const e={};return this.subItems&&(e["aria-expanded"]="false"),this.expanded&&(e["aria-expanded"]="true"),s("li",{key:"dfeb0077a7d82be5677a42c49bbb72c760d4fdf8",class:this.getClass(),onClick:e=>this.clickedItem(e)},this.path&&!this.subItems&&s("ecl-link",{key:"a96e2cab50a10f5249f0163fd2cb61c6cabcb190",styleClass:this.getLinkClass(),path:this.path},this.label),this.path&&this.subItems&&s("button",Object.assign({key:"c61e85e0dbdc7ee041da685729fda5eaba99e785",class:this.getLinkClass()},e),1===this.level&&this.label,s("ecl-icon",{key:"9459de74b93230f17d0aa80764ac6c7d4791f370",styleClass:"ecl-category-filter__item-icon sc-ecl-category-filter-"+this.theme,icon:1===this.level?"corner-arrow":"solid-arrow",rotate:1===this.level?"180":"90"}),this.level>1&&this.label),!this.path&&this.label,this.subItems&&s("ul",{key:"d0cadadb8d2b73dadd1eddf6a99a2058618d2628",class:"ecl-category-filter__list sc-ecl-category-filter-"+this.theme},s("slot",{key:"d4cb038470b5c77b8ada26d41c1aa8f4751b9bad"})))}get el(){return this}},[260,"ecl-category-filter-item",{styleClass:[1,"style-class"],theme:[1025],label:[1],path:[1],level:[2],subItems:[4,"sub-items"],expanded:[4],lastClicked:[16]}]),o=r,d=function(){"undefined"!=typeof customElements&&["ecl-category-filter-item","ecl-icon","ecl-indicator","ecl-link"].forEach((e=>{switch(e){case"ecl-category-filter-item":customElements.get(c(e))||customElements.define(c(e),r);break;case"ecl-icon":customElements.get(c(e))||i();break;case"ecl-indicator":customElements.get(c(e))||l();break;case"ecl-link":customElements.get(c(e))||a()}}))};export{o as EclCategoryFilterItem,d as defineCustomElement}