PageSourceSearch

https://insideinvestigator.org/wp-content/plugins/newspack-newsletters/dist/subscribeBlock.js?ver=1790277715

js insideinvestigator.org collected 2026-09-25 18:52:45 UTC 3,622 bytes, 1 lines download raw bytes

1(()=>{"use strict";let e;var t;t=function(){const t=new Event("newspack-newsletters-subscribe-success");document.querySelectorAll(".newspack-newsletters-subscribe").forEach(s=>{const n=s.querySelector("form");if(!n)return;const i=s.querySelector(".newspack-newsletters-subscribe__response"),o=s.querySelector(".newspack-newsletters-subscribe__message"),r=s.querySelector('input[type="email"]'),c=s.querySelector('button[type="submit"]'),a=document.createElement("span");a.classList.add("spinner"),n.endFlow=(e,u=500,d=!1,l={})=>{s.setAttribute("data-status",u);const p=document.createElement("p");if(r.removeAttribute("disabled"),c.removeChild(a),c.removeAttribute("disabled"),n.classList.remove("in-progress"),p.innerHTML=d?s.getAttribute("data-success-message"):e,o.appendChild(p),p.className=`message status-${u}`,200===u){s.replaceChild(i,n),n.dispatchEvent(t),function(e,t,s){const n=e.getAttribute("data-after-success-behavior");if(!n)return;const i=e.getAttribute("data-after-success-url");if("custom"===n&&!i)return;if(t.querySelector(".newspack-newsletters-subscribe__continue"))return;const o=e.getAttribute("data-after-success-label")||"Continue",r=document.createElement("button");r.type="button",r.textContent=o,r.className="newspack-newsletters-subscribe__continue "+(s?.className||"submit-button");const c=s?.getAttribute("style");c&&r.setAttribute("style",c),r.addEventListener("click",()=>{"custom"===n?window.location.href=i:"referrer"===n&&function(){const e=document.referrer;if(e)try{if(new URL(e).origin===window.location.origin)return void(window.location.href=e)}catch(e){}window.history.back()}()}),t.appendChild(r),r.focus()}(s,i,c),window.newspackRAS=window.newspackRAS||[];const e=new FormData(n).getAll("lists[]"),o={email:r.value};l?.newspack_popup_id&&(o.newspack_popup_id=l.newspack_popup_id),l?.gate_post_id&&(o.gate_post_id=l.gate_post_id),e.length&&d&&window.newspackRAS.push(function(t){t.dispatchActivity("newsletter_signup",{...o,lists:e,newsletters_subscription_method:l?.newsletters_subscription_method||"newsletters-subscription-block"})}),l?.registered&&window.newspackRAS.push(function(e){e.dispatchActivity("reader_registered",{...o,registration_method:l?.registration_method||"newsletters-subscription"})})}},n.addEventListener("submit",t=>{if(t.preventDefault(),o.innerHTML="",n.classList.add("in-progress"),c.disabled=!0,c.appendChild(a),!n.npe?.value)return n.endFlow(newspack_newsletters_subscribe_block.invalid_email,400);const s=new FormData(n);if(!s.has("npe")||!s.get("npe"))return n.endFlow(newspack_newsletters_subscribe_block.invalid_email,400);e&&s.set("newspack_newsletters_subscribe",e),r.setAttribute("disabled","true"),c.setAttribute("disabled","true"),fetch(n.getAttribute("action")||window.location.pathname,{method:"POST",headers:{Accept:"application/json"},body:s}).then(t=>{t.json().then(s=>{const{message:i,newspack_newsletters_subscribed:o,newspack_newsletters_subscribe:r,metadata:c}=s;e=r,n.endFlow(i,t.status,o,c),200===t.status&&s?.registered&&!0!==s?.verified&&s?.verification_nonce&&(window.newspackRAS=window.newspackRAS||[],window.newspackRAS.push(e=>{"function"==typeof e?.openVerificationModal&&e.openVerificationModal({email:s.email,verificationNonce:s.verification_nonce,onSendCode:()=>{"function"==typeof e?.openAuthModal&&e.openAuthModal({skipAuthenticatedCheck:!0,skipNewslettersSignup:!0,backButtonClosesModal:!0,initialState:"otp",closeOnSuccess:!0,onClose:null})}})}))})})})})},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",t):t())})();

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.