(()=>{var e=document.querySelector(".givewp-sale-banners-container"),n=document.querySelectorAll(".givewp-sale-banner__dismiss"),t=document.querySelector(".page-title-action, .wp-heading-inline, #give-in-plugin-upsells h1"),o=document.querySelector("#give-admin-donations-root, #give-admin-donation-forms-root, #give-admin-donors-root"),i=function(n){var t=n.target,o=new FormData;o.append("id",t.dataset.id),document.getElementById(t.getAttribute("aria-controls")).remove(),fetch("".concat(window.GiveSaleBanners.apiRoot,"/hide"),{method:"POST",headers:{"X-WP-Nonce":window.GiveSaleBanners.apiNonce},body:o}),0===e.querySelectorAll(".givewp-sale-banner").length&&e.remove()};(t||o)&&e&&(e.style.display=null,t?t.parentNode.insertBefore(e,t.nextSibling):o&&o.querySelector("header").insertAdjacentElement("afterend",e)),n.forEach((function(e){e.addEventListener("click",i)}))})();