({2776:function(){const t=document.getElementById("new-comments-badge"),e=t=>{localStorage.setItem("commentsCount-"+postID,t)},n=()=>{t&&(t.style.display="none")};"undefined"!=typeof count&&(n=>{if(!t)return;let o=localStorage.getItem("commentsCount-"+postID);null===o?(e(n),t.style.display="block"):(o=parseInt(o),n>o&&(e(n),t.style.display="block"))})(count),"undefined"!=typeof commentsButton&&t&&commentsButton.addEventListener("click",n);const o=(t=>{let e;return(...n)=>{clearTimeout(e),e=setTimeout((()=>t.apply(this,n)),100)}})((()=>{const t=document.getElementById("comments");if(!t)return;const e=t.getBoundingClientRect();e.top0&&(n(),window.removeEventListener("scroll",o))}));window.addEventListener("scroll",o)}})[2776]();; (() => { // Use a different namespace to avoid conflicts window.GAMURS_wordpress_blocks = window.GAMURS_wordpress_blocks || {}; window.GAMURS_wordpress_blocks.polls = window.GAMURS_wordpress_blocks.polls || {}; window.GAMURS_wordpress_blocks.polls.history = window.GAMURS_wordpress_blocks.polls.history || []; window.GAMURS_wordpress_blocks.polls.queued_polls = []; // Still support the old namespace for backward compatibility window.GAMURS_wordpress_blocks = window.GAMURS_wordpress_blocks || {}; window.GAMURS_wordpress_blocks.polls = window.GAMURS_wordpress_blocks.polls || {}; let campaignId = window.GAMURS_wordpress_blocks.polls.campaign || false; // console.log('Poll using campaign ID:', campaignId); function shouldShowEmailGate() { const emailGateEnabled = window.GAMURS_Polls_email_gate || false; if (!emailGateEnabled) return false; if (document.cookie.includes('gamurs_polls_email_gate_completed=true')) return false; if (window.GAMURS_wordpress_blocks.polls.emailGateShown) return false; const queuedPollCount = window.GAMURS_wordpress_blocks.polls.history.length; // console.log('Poll history array:', window.GAMURS_wordpress_blocks.polls.history); const hasActiveCampaign = campaignId && campaignId !== ''; return queuedPollCount === 3 && !hasActiveCampaign; } function createEmailGate(insertInto) { const gateHtml = `
Level up your gaming experience! 🎮

Want to keep voting and get access to exclusive gaming content directly in your email? Sign-up now!

`; insertInto.firstElementChild.innerHTML = gateHtml; insertInto.classList = []; insertInto.classList.add("wp-block-embed", "wp-block-gamurs-poll", "is-provider-email-gate"); // Show skip button after 3 seconds setTimeout(() => { const skipButton = document.getElementById('email-gate-skip'); if (skipButton) { skipButton.style.display = 'block'; } }, 3000); // Handle form submission const form = document.getElementById('email-gate-form'); if (form) { form.addEventListener('submit', async (e) => { e.preventDefault(); const email = document.getElementById('email-gate-input').value; // Clear previous errors const existingError = document.querySelector('.email-gate-error'); if (existingError) existingError.remove(); if (!email || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { const errorDiv = document.createElement('div'); errorDiv.className = 'email-gate-error'; errorDiv.style.color = '#d63384'; errorDiv.style.fontSize = '0.9em'; errorDiv.style.marginTop = '0.5rem'; errorDiv.textContent = 'Please enter a valid email address'; form.appendChild(errorDiv); return; } // Add loading state const submitButton = e.target.querySelector('button[type="submit"]'); const originalText = submitButton.textContent; submitButton.textContent = 'Joining...'; submitButton.disabled = true; try { const domain = insertInto.dataset.domain || "infinite-poll-system-dev.gamurs.workers.dev"; const response = await fetch(`https://${domain}/email-gate`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email: email, url: window.location.href, responded_polls: window.GAMURS_wordpress_blocks.polls.history.slice(0, 3) }) }); if (response.ok) { // Set cookie for 365 days const expiryDate = new Date(); expiryDate.setTime(expiryDate.getTime() + (365 * 24 * 60 * 60 * 1000)); document.cookie = `gamurs_polls_email_gate_completed=true; expires=${expiryDate.toUTCString()}; path=/`; // Show success message and continue insertInto.firstElementChild.innerHTML = `
Welcome to the community! 🎉

Thanks for joining! Loading next poll...

`; setTimeout(() => { continueToNextPoll(insertInto); }, 2000); } else { throw new Error('Server error'); } } catch (error) { console.error('Error submitting email:', error); const errorDiv = document.createElement('div'); errorDiv.className = 'email-gate-error'; errorDiv.style.color = '#d63384'; errorDiv.style.fontSize = '0.9em'; errorDiv.style.marginTop = '0.5rem'; errorDiv.textContent = 'Something went wrong. Please try again.'; form.appendChild(errorDiv); // Reset button submitButton.textContent = originalText; submitButton.disabled = false; } }); } // Handle skip button const skipButton = document.getElementById('email-gate-skip'); if (skipButton) { skipButton.addEventListener('click', () => { continueToNextPoll(insertInto); }); } window.GAMURS_wordpress_blocks.polls.emailGateShown = true; } function continueToNextPoll(insertInto) { next_poll(insertInto); } async function next_poll(insertInto) { // console.log("Poll > next_poll > insertInto: ", insertInto); if (!insertInto) { return } if (insertInto.dataset.next === "null") { return; } if (!insertInto.checkVisibility()) { return; } if (shouldShowEmailGate()) { createEmailGate(insertInto); return; } const post_root = insertInto.closest(".gamurs-inf-scroll-post") let queue = 0; if (post_root !== null && post_root.dataset.id) { queue = post_root.dataset.id } if (window.GAMURS_wordpress_blocks.polls.queued_polls[queue]) { append_poll(insertInto, window.GAMURS_wordpress_blocks.polls.queued_polls[queue]) window.GAMURS_wordpress_blocks.polls.queued_polls[queue] = null } else { const nextLink = get_link(insertInto) await fetch(nextLink) .then((res) => res.json()) .then((json) => { append_poll(insertInto, json) if (json.id) { if (json.id && !window.GAMURS_wordpress_blocks.polls.history.includes(json.id)) { window.GAMURS_wordpress_blocks.polls.history.push(json.id) // console.log("Fetched poll ID:", json.id, "Title:", json.title); } } }) .catch((e) => { console.log("Failed to fetch next poll:", error.message); insertInto.dataset.next = "null"; }) } let rootDomArticle = insertInto.closest(".gamurs-inf-scroll-post"); if (!rootDomArticle) { rootDomArticle = insertInto.closest("#post-1326269"); } if (!rootDomArticle) { rootDomArticle = insertInto.closest(".post"); } if (!rootDomArticle) { rootDomArticle = insertInto.closest("article"); } const nextLink = get_link(insertInto) await fetch(nextLink) .then((res) => res.json()) .then((json) => { Array.from(rootDomArticle.getElementsByClassName("wp-block-gamurs-poll")) .map((e) => Array.from(e.getElementsByClassName("wp-block-gamurs-button"))).reduce((acc, cur) => [...acc, ...cur], []) .map((e) => Array.from(e.getElementsByTagName("div"))).reduce((acc, cur) => [...acc, ...cur], []) .forEach((e) => e.innerHTML = json.title) Array.from(rootDomArticle.getElementsByClassName("wp-block-gamurs-poll__next-poll")) .forEach((e) => e.classList.remove("default-text")) }) .catch((e) => { console.warn("Failed to update poll button:", error.message); insertInto.dataset.next = "null"; Array.from(rootDomArticle.getElementsByClassName("wp-block-gamurs-poll__next-poll")) .forEach((e) => e.classList.add("default-text")) }) } function get_link(insertInto) { // console.log("Poll > get_link > insertInto: ", insertInto); const categories = insertInto.dataset.categories || null; const tags = insertInto.dataset.tags || null; // console.log("Poll > get_link > tags being sent to API:", tags); const url = window.location.href; const domain = insertInto.dataset.domain || "infinite-poll-system-dev.gamurs.workers.dev"; const urlObj = new URL(window.location.href); const hostParts = urlObj.hostname.split("."); let website = hostParts[hostParts.length - 2]; // Second to last part if (website === "lndo") { // http://hopefully-the-tester-named-their-website-appropriately.vipdev.lndo.site website = hostParts[0]; } else if (website === "go-vip") { // twinfinite-net.go-vip.net website = hostParts[0]; website = website.split("-")[0]; if (website === "www") { website = hostParts[0].split("-")[1]; } } const id = insertInto.dataset.id || null; const commercial = insertInto.dataset.commercial === "true" nextLink = `https://${domain}/poll?url=${url}&website=${website}&id=${id}${commercial ? "&commercial=true" : ""}${campaignId ? "&campaign_id=" + campaignId : ""}` if (categories) { // Filter out longer than 45 characters (SQLite limit) const validCategories = categories.split(',').filter(cat => cat.length <= 45); if (validCategories.length > 0) { nextLink += `&categories=${validCategories.join(',')}`; } } if (tags) { // Filter out longer than 45 characters (SQLite limit) const validTags = tags.split(',').filter(tag => tag.length <= 45); if (validTags.length > 0) { nextLink += `&tags=${validTags.join(',')}`; } } if (window.GAMURS_wordpress_blocks.polls.history.length) { window.GAMURS_wordpress_blocks.polls.history.forEach((id) => { nextLink += `&history=${id}` }) } console.log("Poll > get_link > nextLink: ", nextLink); return nextLink } function append_poll(insertInto, json) { // console.log("Poll > append_poll > insertInto start: ", insertInto); // console.log("Poll > append_poll > JSON: ", json); if (insertInto.firstElementChild) { if (json.html) { insertInto.firstElementChild.style.display = "none" while (insertInto.firstElementChild.firstChild) { insertInto.firstElementChild.removeChild(insertInto.firstElementChild.lastChild); } const iframe = document.createElement("iframe"); insertInto.firstElementChild.append(iframe) iframe.contentDocument.open(); iframe.contentDocument.write(json.html); iframe.contentDocument.close(); if (iframe.contentDocument && iframe.contentDocument.readyState === "loading") { iframe.contentDocument.addEventListener("DOMContentLoaded", function () { post_append_extraction(insertInto, json.html) }) } else { post_append_extraction(insertInto, json.html) } } insertInto.classList = []; let newClass = ["wp-block-embed", "wp-block-gamurs-poll"] if (json.type) { newClass.push(`is-type-${json.type}`) } if (json.provider_name) { const provider = json.provider_name.toLowerCase() newClass.push(`is-provider-${provider}`) newClass.push(`wp-block-embed-${provider}`) } insertInto.classList.add(...newClass) } // console.log("Poll > append_poll > insertInto end: ", insertInto); } function post_append_extraction(insertInto, html) { Array.from(insertInto.firstElementChild.firstElementChild.contentDocument.body.children).forEach((e) => insertInto.firstElementChild.append(e)) insertInto.firstElementChild.removeChild(insertInto.firstElementChild.firstElementChild) const virtualDiv = document.createElement("div") virtualDiv.innerHTML = html const range = document.createRange() range.selectNode(insertInto.firstElementChild) Array.from(virtualDiv.getElementsByTagName("script")).forEach((script) => { insertInto.firstElementChild.append(range.createContextualFragment(script.outerHTML)) }) insertInto.firstElementChild.style.display = "" const finishedInsertion = new Event("ggInfinityPollLoaded"); document.dispatchEvent(finishedInsertion); } const forEachSeries = async (iterable, action) => { for (const x of iterable) { await action(x) } } GAMURS_wordpress_blocks.polls.next_poll = next_poll; GAMURS_wordpress_blocks.polls.queue = GAMURS_wordpress_blocks.polls.queue || []; GAMURS_wordpress_blocks.polls.queue = GAMURS_wordpress_blocks.polls.queue.sort((a, b) => { let aElement = document.getElementById(a) let bElement = document.getElementById(b) if (aElement.dataset.commercial === "true" && bElement.dataset.commercial === "false") { return -1; } if (aElement.dataset.commercial === "false" && bElement.dataset.commercial === "true") { return 1; } return 0; }) forEachSeries(GAMURS_wordpress_blocks.polls.queue.map((id) => document.getElementById(id)), next_poll) GAMURS_wordpress_blocks.polls.queue = []; if (typeof window.gamursInfScrollOnUrlChange === "function") { } else { window.gamursInfScrollOnUrlChange = function () { } } })();; (()=>{var e=Array.from(document.getElementsByClassName("wp-block-gamurs-container")).filter((e=>e.classList.contains("is-category-container")))[0];function t(){return window.innerWidth<768}function l(){const e=document.querySelector(".wp-block-gamurs-article-content");e&&e.querySelectorAll(".wp-block-table").forEach((e=>{const t=e.querySelector("table");if(t&&t.offsetWidth>e.offsetWidth){e.style.overflowX="auto";const t=e.previousElementSibling?.classList.contains("swipe-indicator");if(!t){const t=document.createElement("div");t.className="swipe-indicator",t.innerHTML='\n Swipe to scroll\n \n \n \n \n \n \n \n \n \n \n \n \n \n ',e.parentNode.insertBefore(t,e),e.classList.add("swipe-indicator-table")}}}))}Array.from(document.getElementsByTagName("ul")).map((e=>e.getElementsByClassName("wp-block-gamurs-ad"))).reduce(((e,t)=>[...e,...Array.from(t)]),[]).forEach((t=>{t.children[0].style.setProperty("min-height","250px","important"),t.style.setProperty("margin-block","0.5rem","important");var l=t.offsetLeft-e.offsetLeft;t.style.setProperty("margin-left",`-${l}px`,"important"),t.style.setProperty("margin-left",`-${l+(t.offsetLeft-e.offsetLeft)}px`,"important")})),document.addEventListener("DOMContentLoaded",(()=>{t()&&l()})),window.addEventListener("resize",(()=>{t()?l():document.querySelectorAll(".swipe-indicator").forEach((e=>e.remove()))}))})();; window.growthbook_queue=window.growthbook_queue||[],window.growthbook_queue.push((e=>{const t=()=>{const t=Object.keys(e.getFeatures());Array.from(document.getElementsByClassName("wp-block-gamurs-ab-testing")).forEach((s=>{if(t.includes(s.dataset.key)&&"true"!==s.dataset.lock){const t=e.getFeatureValue(s.dataset.key);!0===t?(s.classList.remove("false"),s.classList.add("true")):!1===t&&(s.classList.remove("true"),s.classList.add("false")),Array.from(s.children).filter((e=>Array.from(e.classList).includes("wp-block-gamurs-ab-testing__custom"))).forEach((e=>{e.dataset.keyValue!==t?e.style.display="none":e.style.display="block"}))}}))};t(),document.addEventListener("growthbookdata",t)}));; window.addEventListener("DOMContentLoaded",(()=>{if(window.GAMURS_wordpress_blocks.ad.right_rail_btf){const t=document.querySelector(".is-sidebar-container > .wp-block-gamurs-column");var e=t.querySelector("div[data-openweb-ad]");if(t){let r=t.clientHeight;if(r>0){const n=900,i=t.querySelectorAll(".wp-block-gamurs-column").length;e&&(r-=e.clientHeight);const l=Math.floor(r/n)-i;for(let r=0;r