(()=>{let t=a("kmps_usrid"),e=JSON.parse(a("popup_state"));function o(t,e,o){var a=new Date;a.setTime(a.getTime()+24*o*60*60*1e3);var n="expires="+a.toUTCString();document.cookie=t+"="+e+";"+n+";domain=.kompas.com;path=/"}function a(t){for(var e=t+"=",o=document.cookie.split(";"),a=0;a<o.length;a++){for(var n=o[a];" "==n.charAt(0);)n=n.substring(1);if(0==n.indexOf(e))return n.substring(e.length,n.length)}return null}t&&-1==document.cookie.indexOf("kompasplus_reminder_cooldown=")&&6==e.active_popup_id&&fetch("https://subs.kompas.com/api/v1/subscription?user_id="+t+"&reminder=1").then((t=>{if(!t.ok)throw new Error("Network response was not ok");return t.json()})).then((e=>{!function(t){const e=new Date(t),o=(new Date-e)/864e5;return o>=0&&o<5}(e.data[0].expired_date)||-1!=document.cookie.indexOf("kompasplus_reminder_cooldown=")?o("kompasplus_reminder_cooldown",!0,1):(document.body.insertAdjacentHTML("beforeend",'\x3c!-- freemium abis --\x3e\n\t<section class="kgmModal -medium -hide -bottom kgmModal-dialog" id="kgmModal-onetap-kompasplusreminder" data-event-category="kompascom_plus" data-event-action="view_popup_reminder" data-event-track="impression">\n\t\t\t<div class="kgmModal-block">\n\t\t\t\t\t<div class="kgmModal-header">\n\t\t\t\t\t\t\t<div class="kgmModal-header-inner">\n\t\t\t\t\t\t\t\t\t<div class="kgmModal-header-logo">\n\t\t\t\t\t\t\t\t\t\t\t<img src="https://asset.kompas.com/data/2024/10/09/images/logo-kompascom.svg"\n\t\t\t\t\t\t\t\t\t\t\t\t\talt="Kompas.com">\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<button type="button" onclick="return false;" class="kgmModal-kompasplusreminder-close kgmModal-close"></button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="kgmModal-body">\n\t\t\t\t\t\t\t<div class="kgmModal-img">\n\t\t\t\t\t\t\t\t\t<img src="https://asset.kompas.com/data/2024/10/14/images/dateline.svg" alt="">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="kgmModal-title">Langganan Sudah Selesai</div>\n\t\t\t\t\t\t\t<div class="kgmModal-lead">Waduh! Paket langganan Kompas.com Plus sudah habis. Lanjut langganan lagi!</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="kgmModal-footer">\n\t\t\t\t\t\t\t<div class="form-row-big">\n\t\t\t\t\t\t\t\t\t<div class="form-row">\n\t\t\t\t\t\t\t\t\t\t\t<a href="https://plus.kompas.com?utm_source=popup_reminder" class="button -primary">Perpanjang Langganan</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class="form-row">\n\t\t\t\t\t\t\t\t\t\t\t<a href="https://www.kompas.com/feedback?source=kompasplus" class="button">Berikan Pendapatmu</a>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t</div>\n\t</section>'),t&&window.addEventListener("scroll",(function t(){let e=document.getElementById("kgmModal-onetap-kompasplusreminder");e&&(o("kompasplus_reminder_cooldown",!0,1),e.classList.remove("-hide"),document.body.classList.add("-locked"),window.removeEventListener("scroll",t))})),document.querySelector(".kgmModal-kompasplusreminder-close").addEventListener("click",(function(){let t=document.getElementById("kgmModal-onetap-kompasplusreminder");t&&(o("kompasplus_reminder_cooldown",!0,1),t.classList.add("-hide"),document.body.classList.remove("-locked"))})))})).catch((t=>{console.error("There was a problem with the fetch operation:",t)}))})();