document.addEventListener("DOMContentLoaded",function(){const e=new URLSearchParams(window.location.search).get("lang");let t;t=e||navigator.language,console.log("Browser language:",t);const o=document.querySelector(".wheel"),n=document.querySelector(".wheel__button"),c=document.querySelector(".wheel__counter-number"),s=document.querySelector(".popup__container"),r=document.querySelector(".left"),a=document.querySelector(".right"),l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("class","custom-css");(document.head||document.getElementsByTagName("head")[0]).appendChild(l),document.querySelector(".custom-css").href="css/cbt2ny.css";var i=0;n.addEventListener("click",function(){var e=Date.now();e-i>=4e3&&(i=e,c.textContent>0&&(2==c.textContent?(c.textContent--,o.classList.add("first-spin")):1==c.textContent&&(c.textContent--,o.classList.remove("first-spin"),o.classList.add("second-spin"),setTimeout(()=>{s.style.visibility="visible",r.classList.add("confetti-animation"),a.classList.add("confetti-animation"),document.querySelector(".container.flex.fcol-center").classList.add("popup-open")},4100))))});const u="cbt2ny";let d=window.location.search;""===d?d="?show_popup_reg=1&lp="+u:d+="&show_popup_reg=1&lp="+u;let p="https://"+window.location.hostname.replace("promo.","")+d;document.querySelector(".popup__button").href=p,document.querySelector(".popup__button").addEventListener("click",function(){document.cookie="offer_last_point="+d+"; max-age=2592000"})});