1import{t as c}from"./event-zU-Y6ZHH.js";import f from"./custom-html-element-Cddc4xm8.js";import"./logger-pamvzmAu.js";import"./exports-NHIMKJG4.js";class m extends f{constructor(){super(),this._onFilterChanged=this._onFilterChanged.bind(this),this._onApply=this._onApply.bind(this),this._onRemoveFilter=this._onRemoveFilter.bind(this),this._onClearAll=this._onClearAll.bind(this),this._onCriteriaApplied=this._onCriteriaApplied.bind(this)}connectedCallback(){this.delegate.on("change",".js-filter-checkbox, .js-sort-radio",this._onFilterChanged),this.delegate.on("click",".js-apply-filters",this._onApply),this.delegate.on("click",".js-remove-filter",this._onRemoveFilter),this.delegate.on("click",".js-clear-filters",this._onClearAll),this.rootDelegate.on("facet:criteria-applied",this._onCriteriaApplied)}_onFilterChanged(){this._syncPills()}_onApply(){c(this,"facet:criteria-changed",{url:this._buildUrl()})}_onRemoveFilter(e,t){e.preventDefault();const{param:r,value:s}=t.dataset,l=this.querySelector(`.js-filter-checkbox[name="${r}"][value="${s}"]`);l&&(l.checked=!1,this._syncPills(),c(this,"facet:criteria-changed",{url:this._buildUrl()}))}_onClearAll(e){e.preventDefault(),this.querySelectorAll(".js-filter-checkbox").forEach(t=>{t.checked=!1}),this._syncPills(),c(this,"facet:criteria-changed",{url:this._buildUrl()})}_onCriteriaApplied(){const e=document.getElementById("facet-filters-drawer"),t=e&&e.querySelector(".js-close");t&&t.click()}_syncPills(){const e=this.querySelector(".js-filter-pills"),t=this.querySelector(".js-pill-templates");if(!e||!t)return;const r=t.querySelector("template[data-pill]"),s=t.querySelector("template[data-clear-all]"),{deleteLabel:l}=t.dataset,o=[...this.querySelectorAll(".js-filter-checkbox:checked")],h=o.map(({name:p,value:d,dataset:{label:u}})=>{const a=u||d,i=r.content.cloneNode(!0);i.querySelector('[role="group"]').setAttribute("aria-label",a),i.querySelector("span").textContent=a;const n=i.querySelector(".js-remove-filter");return n.setAttribute("aria-label",`${l}: ${a}`),n.dataset.param=p,n.dataset.value=d,i});o.length>0&&h.push(s.content.cloneNode(!0)),e.replaceChildren(...h),e.classList.toggle("hidden",o.length===0)}_buildUrl(){const e=this.querySelector(".js-facet-filters-form");if(!e)return window.location.href;const t=new FormData(e);return`${window.location.pathname}?${new URLSearchParams(t)}`}}window.customElements.get("facet-filters")||window.customElements.define("facet-filters",m);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.