import{r as t,h as e,a as s}from"./p-ytAlchvh.js";const i=class{constructor(e){t(this,e),this.styleClass="",this.subItems=!1,this.expanded=!1}clickedItem(t){this.lastClicked=t.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 t=["ecl-category-filter__item",`sc-ecl-category-filter-${this.theme}`,`ecl-category-filter__item--level-${this.level}`,this.styleClass];return this.subItems&&t.push("ecl-category-filter__item--has-children"),t.join(" ")}componentWillLoad(){var t;this.theme=null!==(t=document.documentElement.getAttribute("data-ecl-theme"))&&void 0!==t?t:this.theme||"ec"}render(){const t={};return this.subItems&&(t["aria-expanded"]="false"),this.expanded&&(t["aria-expanded"]="true"),e("li",{key:"dfeb0077a7d82be5677a42c49bbb72c760d4fdf8",class:this.getClass(),onClick:t=>this.clickedItem(t)},this.path&&!this.subItems&&e("ecl-link",{key:"a96e2cab50a10f5249f0163fd2cb61c6cabcb190",styleClass:this.getLinkClass(),path:this.path},this.label),this.path&&this.subItems&&e("button",Object.assign({key:"c61e85e0dbdc7ee041da685729fda5eaba99e785",class:this.getLinkClass()},t),1===this.level&&this.label,e("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&&e("ul",{key:"d0cadadb8d2b73dadd1eddf6a99a2058618d2628",class:`ecl-category-filter__list sc-ecl-category-filter-${this.theme}`},e("slot",{key:"d4cb038470b5c77b8ada26d41c1aa8f4751b9bad"})))}get el(){return s(this)}};export{i as ecl_category_filter_item}