document.addEventListener("DOMContentLoaded",function(){let e=!1;const t="cr_boom",c=document.querySelector(".bonus__item"),i=document.querySelector(".chicken"),n=document.querySelector(".popup__button"),o=document.querySelector(".please-tap"),s=document.querySelector(".popup__container"),a=document.querySelector(".left"),r=document.querySelector(".right"),l=["./img/chicken/chicken_start-1.webp","./img/chicken/chicken_start-2.webp"],u=["./img/egg/egg_crush_anim/egg_crush_anim_3-1.webp","./img/egg/egg_crush_anim/egg_crush_anim_3-2.webp","./img/egg/egg_crush_anim/egg_crush_anim_3-3.webp"],g=["./img/egg/egg_crush_static_0.webp","./img/egg/egg_crush_static_1.webp","./img/egg/egg_crush_static_2.webp"],m=["./img/chicken/chicken_crush_anim/chicken_crush_anim-1.webp","./img/chicken/chicken_crush_anim/chicken_crush_anim-2.webp","./img/chicken/chicken_crush_anim/chicken_crush_anim-3.webp"],_=new URLSearchParams(window.location.search).get("lang");let h;function d(){e||(o.style.opacity="1",o.style.visibility="visible",setTimeout(()=>{o.style.opacity="0",o.style.visibility="hidden"},3e3))}h=_||navigator.language,console.log("Browser language:",h);const p=setInterval(d,8e3);d();function y(e){let t=0,c=e.offsetLeft,i=e.offsetTop;const n=window.innerWidth;!function o(){e.style.backgroundImage=`url(${m[t]})`,t=(t+1)%m.length,c+=100,i-=80,e.style.left=c+"px",e.style.top=i+"px",c<n+e.offsetWidth?setTimeout(o,100):(e.style.display="none",s.style.visibility="visible",a.classList.add("confetti-animation"),r.classList.add("confetti-animation"))}()}[...l,...u,...g,...m].forEach(e=>{(new Image).src=e}),function(){let t=0;!function c(){if(e)return;i.style.backgroundImage=`url(${l[t]})`,t=0===t?1:0,setTimeout(c,1===t?2400:200)}()}();let b=0;c.style.backgroundImage=`url(${g[b]})`,c.addEventListener("click",()=>{if(!e){if(2===b)return e=!0,clearInterval(p),o.style.opacity="0",o.style.visibility="hidden",function(e){let t=0;!function c(){e.style.backgroundImage=`url(${u[t]})`,t++,t<u.length&&setTimeout(c,100)}()}(c),void y(i);b++,c.style.backgroundImage=`url(${g[b]})`}});let f=window.location.search;""===f?f="?show_popup_reg=1&lp="+t:f+="&show_popup_reg=1&lp="+t;let w="https://"+window.location.hostname.replace("promo.","")+f;n.href=w,n.addEventListener("click",function(){document.cookie="offer_last_point="+f+"; max-age=2592000"});const k=document.createElement("link");k.setAttribute("rel","stylesheet"),k.setAttribute("class","custom-css");(document.head||document.getElementsByTagName("head")[0]).appendChild(k),document.querySelector(".custom-css").href="css/cr_boom.css"});