PageSourceSearch

https://www.childfund.org/scripts/C6FoKtH3-alert-banners.js

js childfund.org collected 2026-10-02 06:06:33 UTC 1,568 bytes, 2 lines download raw bytes

1import{l as c}from"./-mcz9By9-verndale-core.js";class h extends c.Component{get storageKey(){return`dismissedAlertBanners_${this.el.dataset.bannerGroup}`}setupDefaults(){this.sortBannersByPriority(),this.checkDismissedBanners()}addListeners(){this.el.querySelectorAll(".alert-banner__close-button").forEach(t=>{t.addEventListener("click",this.handleDismiss.bind(this))})}sortBannersByPriority(){const s=this.el,t=Array.from(s.querySelectorAll(".alert-banner")),e={high:1,mid:2,low:3},r=n=>{if(!n||!n.className)return"low";const o=n.className.trim().match(/alert-banner--(high|mid|low)/);return o&&o[1]?o[1]:"low"};t.filter(Boolean).sort((n,a)=>{const o=r(n),l=r(a);return(e[o]??99)-(e[l]??99)}).forEach(n=>s.appendChild(n))}checkDismissedBanners(){const s=this.getDismissedIds();this.el.querySelectorAll(".alert-banner").forEach(e=>{const r=e.id;r&&s.includes(r)&&e.remove()})}getDismissedIds(){try{const s=sessionStorage.getItem(this.storageKey);return s?JSON.parse(s):[]}catch{return[]}}saveDismissedId(s){try{const t=this.getDismissedIds();t.includes(s)||(t.push(s),sessionStorage.setItem(this.storageKey,JSON.stringify(t)))}catch{}}handleDismiss(s){const e=s.currentTarget.closest(".alert-banner");if(e){const r=e.id;r&&this.saveDismissedId(r);const i=getComputedStyle(e).getPropertyValue("--transition-duration-short")||"0.2s";e.style.transition=`opacity ${i} ease-out, transform ${i} ease-out`,e.style.opacity="0",e.style.transform="translateY(-10px)",setTimeout(()=>{e.remove()},200)}}}export{h as default};
2//# sourceMappingURL=C6FoKtH3-alert-banners.js.map

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.