function f(){let o="all",s="";const l=document.querySelectorAll("[data-gateway-cat]"),i=document.querySelectorAll("[data-gateway-card]"),u=document.getElementById("gateway-search"),d=document.getElementById("gw-empty-state");function y(){let t=0;i.forEach(e=>{const c=(e.getAttribute("data-cat")||"").split(/\s+/),n=o==="all"||c.includes(o),r=!s||(e.getAttribute("data-search")||"").includes(s),a=n&&r;e.style.display=a?"":"none",a&&t++}),d&&d.classList.toggle("hidden",t>0)}l.forEach(t=>{t.addEventListener("click",()=>{l.forEach(e=>e.setAttribute("data-active","false")),t.setAttribute("data-active","true"),o=t.getAttribute("data-gateway-cat"),y()})}),u&&u.addEventListener("input",t=>{s=(t.target.value||"").toLowerCase(),y()}),i.forEach(t=>{const e=t.querySelector("[data-gateway-head]"),c=t.querySelector("[data-gateway-body]"),n=t.querySelector("[data-gateway-chev]");!e||!c||e.addEventListener("click",r=>{if(r.target.closest("form, button, a, input"))return;const a=!c.classList.contains("hidden");c.classList.toggle("hidden",a),n&&(n.style.transform=a?"":"rotate(180deg)"),t.setAttribute("data-open",a?"false":"true")})}),document.querySelectorAll("[data-currency-pills]").forEach(t=>{const e=t.querySelectorAll("[data-currency-pill]"),c=t.parentElement?.querySelector("[data-currency-count]"),n=()=>{c&&(c.textContent=String(t.querySelectorAll('input[type="checkbox"]:checked').length))};e.forEach(r=>{const a=r.querySelector('input[type="checkbox"]');a&&r.addEventListener("click",h=>{setTimeout(()=>{r.setAttribute("data-selected",a.checked?"true":"false"),n()},0)})}),n()})}export{f as default};
