PageSourceSearch

https://www.raconteur.net/wp-content/themes/raconteur/js/newsletters.min.js

js raconteur.net collected 2026-09-24 08:28:07 UTC 3,429 bytes, 1 lines download raw bytes

1let raconteur_thank_you_message=raconteurData.raconteur_thank_you_message;function sendEventToGoogleAnalytics(e,t,r,o,n){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:e,eventCategory:t,eventAction:r,eventLabel:o,eventValue:n})}function showErrorMessage(e,t,r){let o=e.querySelector(".error");o.innerHTML=r,o.classList.add("active"),t.remove(),e.classList.remove("loading"),setTimeout(()=>{o.classList.remove("active")},4e3)}function showThankYouMessage(e){e.classList.remove("loading"),e.style.minHeight=e.offsetHeight+"px";let t=`<div class="newsletter-thank-you">${raconteur_thank_you_message}</div>`;e.parentNode.innerHTML=t,document.querySelectorAll(".form-newsletter").forEach(e=>{e.parentNode.innerHTML=t})}function showBounceProtectionMessage(e){e.parentNode.innerHTML='<div class="newsletter-thank-you bounce-protection">Please check your email for a confirmation link.</div>'}function showBounceSuccessMessage(e){e.parentNode.innerHTML='<div class="newsletter-thank-you bounce-success">Thank you for subscribing!</div>'}function xorEncryptDecrypt(t,r){let o="";for(let e=0;e<t.length;e++){var n=t.charCodeAt(e),a=r.charCodeAt(e%r.length);o+=String.fromCharCode(n^a)}return o}function encryptForUrl(e){e=xorEncryptDecrypt(e,"raconteur");return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function redirectToThankYouPage(e){e=encryptForUrl(e);window.location.href="/subscribe/thank-you?e="+e}document.querySelectorAll(".form-newsletter").forEach(i=>{i.addEventListener("submit",async function(t){t.preventDefault(),i.classList.add("loading");var t=document.createElement("div"),e=(t.classList.add("spinner-container"),document.createElement("div")),e=(e.classList.add("spinner"),t.appendChild(e),i.parentNode.insertBefore(t,i),i.querySelector(".email").value);if(e.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/))try{var r,o,n,a,s=await fetch("/wp-content/themes/raconteur/inc/blocked-domains.json").then(e=>e.json()),c=e.split("@")[1];s.includes(c)?showErrorMessage(i,t,"This email domain is not allowed"):(r=i.querySelector(".pageUrl").value,o=i.querySelector(".newsletterType")?.value||"daily-newsletter",n=new URLSearchParams(window.location.search),(a=await fetch("https://auth.raconteur.net/api/taurus/newsletter/add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Object.fromEntries(Object.entries({email:e,pageUrl:r,newsletterType:o,source:n.get("source"),utm_source:n.get("utm_source"),utm_medium:n.get("utm_medium"),utm_campaign:n.get("utm_campaign"),utm_term:n.get("utm_term"),utm_content:n.get("utm_content")}).filter(([,e])=>e)))})).ok?(console.log(e),(e.includes("@gmail.com")?showBounceProtectionMessage:showThankYouMessage)(i),sendEventToGoogleAnalytics("NewsletterSubscription","Subscribe","cfo-newsletter"===o?"BTBS":"Daily","Email",e)):(showErrorMessage(i,t,"An error occurred while submitting the form"),console.error("Form submission failed with status:",a.status)),"true"===i.querySelector(".redirect")?.value&&redirectToThankYouPage(e))}catch(e){showErrorMessage(i,t,"An error occurred while submitting the form"),console.error("Form submission error:",e)}else showErrorMessage(i,t,"Please enter a valid email address")})}),document.addEventListener("DOMContentLoaded",function(){new URLSearchParams(window.location.search).get("bounceProtection")&&document.querySelectorAll(".form-newsletter").forEach(e=>{showBounceSuccessMessage(e)})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.