document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof puffergoFeaturedColumn&&document.addEventListener("click",function(e){var t=e.target.closest(".puffergo-toggle-featured");if(t&&(e.preventDefault(),!t.disabled)){var a=t.getAttribute("data-post-id"),n=t.getAttribute("data-nonce"),o=t.querySelector(".dashicons");t.disabled=!0;var r=new URLSearchParams;r.set("action",puffergoFeaturedColumn.action),r.set("post_id",a),r.set("nonce",n),fetch(puffergoFeaturedColumn.ajaxUrl,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()}).then(function(e){return e.json()}).then(function(e){if(e&&e.success){var a=!!e.data.featured;t.setAttribute("aria-pressed",a?"true":"false"),o&&(o.classList.toggle("dashicons-star-filled",a),o.classList.toggle("dashicons-star-empty",!a))}}).finally(function(){t.disabled=!1})}})});