An error has occurred

{{terminalError}}

A Message From
Jeremy Scahill
The Intercept is needed now more than ever. Stand with our nonprofit newsroom before 2021 runs out.
RAISED
${amount.condensed}{amount.scaleAbbreviation}
GOAL
${goal.condensed}{goal.scaleAbbreviation}
(function() { window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date; ga('create', 'UA-79475609-15', 'auto'); var script = document.createElement('script'); script.setAttribute('defer', ''); script.setAttribute('src', 'https://www.google-analytics.com/analytics.js'); script.setAttribute('type', 'text/javascript'); document.head.appendChild(script); })(); (function(src) { window.FLMPiano = window.FLMPiano || {}; window.FLMPiano.onLoad = function(handler) { window.FLMPiano.loadHandlers = window.FLMPiano.loadHandlers || []; window.FLMPiano.loadHandlers.push(handler); }; var script = document.createElement('script'); script.setAttribute('defer', ''); script.setAttribute('src', src); script.setAttribute('type', 'text/javascript'); document.head.appendChild(script); })('https://static.theintercept.com/piano/flmpiano-v3.js'); (function(src) { window.TI = window.TI || {}; window.TI.onLoad = function(handler) { window.TI.loadHandlers = window.TI.loadHandlers || []; window.TI.loadHandlers.push(handler); }; var script = document.createElement('script'); script.setAttribute('data-ti-js', ''); script.setAttribute('defer', ''); script.setAttribute('src', src); script.setAttribute('type', 'text/javascript'); document.head.appendChild(script); })('https://static.theintercept.com/ti.js/ti-v1.js'); $(function() { var experienceDismissalTtl = '1'; var experienceImpressionTtl = '1'; var experiencePrefix = '2021_eoy_donate_ask'; var realmSpeakingId = 'theintercept'; var showCountdown = 'no' == 'yes'; var showThermometer = 'no' === 'yes'; var showThermometerText = 'yes' === 'yes'; var source = 'web_intercept_20211130_GT-article_unsubscribed_donateform' || 'web_intercept_piano_direct-ask-modal-unknown'; var thermometerPageName = '2021_winter_campaign'; var originatingReferrer, referrerPostId, referrerUrl; // flmpiano.js donation form var amountFrequencyOrder = 'amount-frequency'; var initialOneTimeAmount = '25'; var initialMonthlyAmount = '10'; var initialRecurringPeriod = 'months'; var initialAmount = (initialRecurringPeriod === 'months') ? initialMonthlyAmount : initialOneTimeAmount; var oneTimeAmountOptions = '15,25,50,100'; var monthlyAmountOptions = '5,8,10,15'; var recurringPeriodLabels = { 'one-time': 'One-time', 'months': 'Monthly', 'years': 'Yearly' }; var recurringPeriodOptions = 'one-time,months'; var showDonationForm = 'yes' === 'yes'; var htmlElement = document.querySelector('html'); var $html = $(htmlElement); var bodyElement = document.querySelector('body'); var closeButton = document.getElementById('close'); var donateButton = document.getElementById('donate'); var donateButtons = document.querySelectorAll('.donate-button'); var articlesRemainingElement = document.getElementById('articles-remaining'); var elementsWithPlaceholderText = document.querySelectorAll('.has-placeholder-text'); var formElement = document.getElementById('form'); var formFieldsContainer = document.getElementById('form-fields-container'); var thermometerContainer = document.getElementById('thermometer-container'); // event handlers function handleCloseButtonClick(event) { FLMPiano.dispatchEventToParent('experience:dismiss', { experienceDismissalTtl: experienceDismissalTtl, experiencePrefix: experiencePrefix }); FLMPiano.trackGAEvent({ eventLabel: 'newsletter: popup close', metric6: 1, transport: 'beacon' }); } function handleDonateButtonClick(event) { FLMPiano.trackGAEvent({ eventLabel: 'newsletter: donate button click', metric5: 1, transport: 'beacon' }); closeButton.click(); } function handleKeypress(event) { switch (event.code) { case 'Escape': console.info('Closing...'); closeButton.click(); break; default: // pass through } } function handleDataLoad() { if (TPParam.params.preview === true) { $html.addClass('extraSmall'); $html.addClass('sized'); } else { FLMPiano.dispatchEventToParent('experience:impression', { experienceImpressionTtl: experienceImpressionTtl, experiencePrefix: experiencePrefix }); FLMPiano.trackGAEvent({ eventLabel: 'direct-ask: popup open', metric3: 1 }); } $html.addClass('loaded'); } function handleLoad() { if (showDonationForm) { FLMPiano.renderDonateFormFields({ amountFrequencyOrder, donateButton, formElement, formFieldsContainer, initialOneTimeAmount, initialMonthlyAmount, initialRecurringPeriod, monthlyAmountOptions, oneTimeAmountOptions, recurringPeriodLabels, recurringPeriodOptions }); } FLMPiano.setUpResponsiveContainer('body', { onResize: handleParentResize }); renderCountdown(showCountdown); renderLogo(); TI.tracking.parsely.insert(); // thermometer specific stuff if (thermometerPageName) { FLMPiano.thermometers.fetch(thermometerPageName) .then(function(thermometerData) { elementsWithPlaceholderText.forEach(function(element) { element.innerHTML = FLMPiano.formatText(element.innerHTML, thermometerData); }); if (showThermometer) { FLMPiano.dom.appendChildToElement( thermometerContainer, FLMPiano.thermometers.render(thermometerData, 'graduated-bar') ); } else { thermometerContainer.style.display = 'none'; } setTimeout(handleDataLoad, 0); }) .catch(function(error) { console.error(error); }); } else { handleDataLoad(); } FLMPiano.waitForParams({ requirements: { activeMeters: false, customVariables: true } }).then(function(params) { var donateUrl; if (typeof params.customVariables.originatingReferrer === 'string') { originatingReferrer = params.customVariables.originatingReferrer; } if (typeof params.customVariables.referrer_post_id === 'string') { referrerPostId = params.customVariables.referrer_post_id; } referrerUrl = params.url; // update donate links donateUrl = FLMPiano.buildUrl(donateButtons[0].href, { originating_referrer: originatingReferrer, referrer_post_id: referrerPostId, referrer_url: referrerUrl, source: source }); donateButtons.forEach(function(donateButton) { donateButton.setAttribute('href', donateUrl); }); FLMPiano.updateDonateUrlParams({ donateButton, formElement, params: { amount: initialAmount, originating_referrer: originatingReferrer, recurring_period: initialRecurringPeriod, referrer_post_id: referrerPostId, referrer_url: referrerUrl, source: source }}); if (params.preview) { $html.addClass('extraSmall'); $html.addClass('sized'); } else { FLMPiano.dispatchEventToParent('experience:impression', { experienceImpressionTtl: experienceImpressionTtl, experiencePrefix: experiencePrefix }); FLMPiano.trackGAEvent({ eventLabel: 'registration: popup open', metric3: 1 }); } $html.addClass('loaded'); }); } function updateDonateSource(source) { var donateUrl = FLMPiano.buildUrl(donateButtons[0].href, { source: source }); donateButtons.forEach(function(donateButton) { donateButton.setAttribute('href', donateUrl); }); } // helpers function handleParentResize(resizeEvent) { $(bodyElement).toggleClass('extraSmallHeight', resizeEvent.height < 570); $(bodyElement).toggleClass('smallHeight', resizeEvent.height < 700); $(bodyElement).toggleClass('extraLarge', resizeEvent.width > 1441); if (resizeEvent.breakpoint === 'large') { // ensure that the modal is the full viewport height // attempting to fix weird gap issue at top of piano modal var bodyHeight = Number(resizeEvent.height) + 1; bodyElement.style.height = bodyHeight + 'px'; } else { // let the modal's height be determined automatically bodyElement.style.height = 'auto'; } setTimeout(function() { $(htmlElement).toggleClass('sized', true); }, 0); } // UI helpers function renderCountdown(show) { var endDate; var selector = '#countdown-clock'; if (!show) { $(selector).hide(); } else { endDate = new Date(Date.UTC(2021, 0, 1, 8, 0, 0, 0)); // pacific new year (in GMT) FLMPiano.animations.animateCountdownClockElement(selector, endDate); } } function renderLogo() { var container = document.getElementById('logo-container'); var logo; if (realmSpeakingId === 'theintercept-brasil') { logo = new TI.branding.Logo({ type: 'brasil' }); } else { logo = new TI.branding.Logo({}); } container.appendChild(logo.element); } // wire up events closeButton.addEventListener('click', handleCloseButtonClick); donateButtons.forEach(function(donateButton) { donateButton.addEventListener('click', handleDonateButtonClick); }); FLMPiano.onLoad(function() { TI.onLoad(function() { handleLoad(); }); }); });