");background-position:center;background-size:19px 19px;background-repeat:no-repeat;background-color:#222;padding:0;width:var(--form-elem-height);height:var(--form-elem-height);font-size:0;}:is(.js-newsletter-wrapper, .newsletter_bar.newsletter-wrapper) .widget__body:has(.response:not(:empty)) :is(.widget__headline, .widget__subheadline, #mc_embed_signup .mc-field-group, #mc_embed_signup input[type="submit"]){display:none;}:is(.grey_newsblock .newsletter-wrapper, .newsletter-wrapper) #mce-responses:has(.response:not(:empty)){grid-row:1 / -1;grid-column:1 / -1;}.newsletter-wrapper .widget__body > .snark-line:has(.response:not(:empty)){grid-column:1 / -1;}:is(.grey_newsblock .newsletter-wrapper, .newsletter-wrapper) :is(.newsletter-campaign:has(.response:not(:empty)), .newsletter-and-social:has(.response:not(:empty))){width:100%;}.newsletter-wrapper .newsletter_bar_col{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 20px;margin:0 auto;}.newsletter-wrapper .newsletter_bar_col .text-element{display:flex;color:var(--shares-color);margin:0 !important;font-weight:400 !important;font-size:16px !important;}.newsletter-wrapper .newsletter_bar_col .whitebar_social{display:flex;gap:12px;width:auto;}.newsletter-wrapper .newsletter_bar_col a{margin:0;background-color:#0000;padding:0;width:32px;height:32px;}.newsletter-wrapper .social_icon:after{display:none;}.newsletter-wrapper .widget article:before, .newsletter-wrapper .widget article:after{display:none;}#sFollow_Block_0_0_1_0_0_0_1{margin:0;}.donation_banner{position:relative;background:#000;}.donation_banner .posts-custom *, .donation_banner .posts-custom :after, .donation_banner .posts-custom :before{margin:0;}.donation_banner .posts-custom .widget{position:absolute;inset:0;}.donation_banner__wrapper{position:relative;z-index:2;pointer-events:none;}.donation_banner .donate_btn{position:relative;z-index:2;}#sSHARED_-_Support_Block_0_0_8_0_0_3_1_0{color:#fff;}#sSHARED_-_Support_Block_0_0_8_0_0_3_1_1{font-weight:normal;}.sticky-sidebar{margin:auto;}@media (min-width: 980px){.main:has(.sticky-sidebar){overflow:visible;}}@media (min-width: 980px){.row:has(.sticky-sidebar){display:flex;overflow:visible;}}@media (min-width: 980px){.sticky-sidebar{position:-webkit-sticky;position:sticky;top:100px;transition:top .3s ease-in-out, position .3s ease-in-out;}}#sProfile_0_0_4_0_0_7{margin:100px 0;}.paywall-bar--expanded-content .widget, .breaking-news-top-wrapper{max-width:100%;margin:auto;text-align:center;display:block;}.paywall-bar--expanded-content .widget__head{z-index:0;}.paywall-bar--expanded-content .widget__headline-text, .paywall-bar--expanded-content .widget__headline{font-style:normal !important;font-weight:600 !important;}.paywall-bar--expanded-content .widget .widget__subheadline-text p, .paywall-bar--expanded-content .widget .widget__subheadline-text{font-style:normal !important;font-weight:500 !important;}.paywall-bar--expanded-content .body-description p{line-height:24px;font-style:normal !important;font-weight:500 !important;}.paywall-bar__wrapper .widget__headline{cursor:default !important;}.paywall-bar__wrapper .widget__headline-text:hover{color:#fff !important;}.paywall-bar--expanded-content .widget:hover .widget__headline a{color:#fff !important;}.paywall-bar--expanded-content .widget__headline-text, .paywall-bar--expanded-content .widget__headline{color:#fff;font-size:38px;font-family:Oswald, sans-serif;line-height:45px;}.paywall-bar--expanded-content .widget .widget__subheadline-text p, .paywall-bar--expanded-content .widget .widget__subheadline-text{font-family:Open Sans;color:#fff;font-size:16px;line-height:24px;}.paywall-bar--expanded-content .body-description p{color:#fff;font-size:16px;font-family:Open Sans;}.paywall-bar__expanded, .paywall-bar__collapsed{background:#000 !important;}.breaking-news-top-wrapper{max-width:100%;margin:auto;background:#000 !important;}.paywall-bar--expanded-content .widget__body{align-items:center;justify-content:center;padding:0 35px 0 50px;display:flex !important;flex-direction:column !important;}.paywall-bar--expanded-content .widget__head .widget__body{;}.paywall-bar--expanded-content .body{margin:0;width:100%;}.paywall-bar--expanded-content .widget__headline, .paywall-bar--expanded-content .widget__body{align-items:start;text-align:left;}.paywall-bar--expanded-content .body-description p{background:none;padding:0;text-decoration:none;}.paywall-bar--expanded-content .body-description a{color:#fff !important;}@media (min-width: 1025px){.paywall-bar--expanded-content .widget__body{height:370px;}}@media (min-width: 768px) and (max-width: 1024px){.paywall-bar--expanded-content .widget__headline-text, .paywall-bar--expanded-content .widget__headline{margin-bottom:10px;font-size:28px !important;line-height:28px !important;}}@media (min-width: 768px) and (max-width: 1024px){.paywall-bar--expanded-content .widget .widget__subheadline-text p, .paywall-bar--expanded-content .widget .widget__subheadline-text{font-size:14px !important;line-height:18px !important;}}@media (min-width: 768px) and (max-width: 1024px){.paywall-bar--expanded-content .body-description p{font-size:14px;line-height:18px !important;}}@media (min-width: 768px) and (max-width: 1024px){.paywall-bar--expanded-content .widget__body{height:385px !important;padding:20px 50px 0 !important;}}@media (min-width: 768px) and (max-width: 1024px){.paywall-bar--expanded-content .widget__head .widget__body{position:absolute;padding:20px;inset:0 5% 0 45%;z-index:2;background:none;width:auto;background:#000 !important;}}@media (min-width: 767px){.paywall-bar--expanded-content .widget__head .widget__body{position:absolute;padding:20px;inset:0 5% 0 45%;z-index:2;background:none;width:auto;background:#000 !important;}}@media (min-width: 767px){.paywall-bar--expanded-content .widget__head .widget__body:before{display:block;position:absolute;content:"";top:0;right:100%;bottom:0;width:100%;z-index:1;background:linear-gradient(90deg, #0000 50%, #000 100%);}}@media (min-width: 767px){.paywall-bar--expanded-content .widget__head .widget__body:after{display:block;position:absolute;content:"";top:0;left:98%;bottom:0;width:100%;z-index:1;background:#000;}}@media (min-width: 767px){.paywall-bar--expanded-content .widget__subheadline p{text-align:left;}}.paywall-bar--collapsed-content .widget, .paywall-bar--collapsed-content{max-width:100%;margin:auto;text-align:center;display:block;}.paywall-bar--collapsed-content .widget:hover .widget__headline a{color:#fff !important;}.paywall-bar--collapsed-content .widget__headline-text, .paywall-bar--collapsed-content .widget__headline{color:#fff;font-size:38px;font-family:Oswald, sans-serif;line-height:45px;margin-right:17px;width:unset !important;display:inline-block !important;}.paywall-bar--collapsed-content{min-height:120px;max-width:100%;margin:auto;background:#000 !important;}.paywall-bar--collapsed-content .body-description a{color:#fff !important;}.paywall-bar--collapsed-content .body{margin-top:0;}.grey_newsblock .newsletter-wrapper, .newsletter-wrapper, .newsletter-wrapper.sidebar{background:linear-gradient(91deg, #005dc7 28%, #1d63b2 65%, #0353ae 85%);}
Isabel Ostrer | Author | Common Dreams
Isabel Ostrer
Isabel Ostrer is a medical student at the University of California San Francisco (UCSF) and a member of Students for a National Health Program (SNaHP).
"),t.type){case"pdf":if(a.default.isFirefox()||a.default.isEdge()||a.default.isIE())try{if(console.info("PrintJS currently doesn't support PDF printing in Firefox, Internet Explorer and Edge."),!0===t.onBrowserIncompatible())window.open(t.fallbackPrintable,"_blank").focus(),t.onPdfOpen&&t.onPdfOpen()}catch(e){t.onError(e)}finally{t.showModal&&l.default.close(),t.onLoadingEnd&&t.onLoadingEnd()}else d.default.print(t,o);break;case"image":f.default.print(t,o);break;case"html":u.default.print(t,o);break;case"raw-html":c.default.print(t,o);break;case"json":s.default.print(t,o)}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r},a=n(1);function l(e,t,n){var r=new window.Blob([n],{type:"application/pdf"});r=window.URL.createObjectURL(r),t.setAttribute("src",r),i.default.send(e,t)}t.default={print:function(e,t){if(e.base64){var n=Uint8Array.from(atob(e.printable),function(e){return e.charCodeAt(0)});l(e,t,n)}else{e.printable=/^(blob|http)/i.test(e.printable)?e.printable:window.location.origin+("/"!==e.printable.charAt(0)?"/"+e.printable:e.printable);var r=new window.XMLHttpRequest;r.responseType="arraybuffer",r.addEventListener("load",function(){if(-1===[200,201].indexOf(r.status))return(0,a.cleanUp)(e),void e.onError(r.statusText);l(e,t,r.response)}),r.open("GET",e.printable,!0),r.send()}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(e,t){var n=document.getElementById(e.printable);n?(e.printableElement=function e(t,n){var r=t.cloneNode();var o=!0;var i=!1;var a=void 0;try{for(var l,d=t.childNodes[Symbol.iterator]();!(o=(l=d.next()).done);o=!0){var u=l.value;if(-1===n.ignoreElements.indexOf(u.id)){var c=e(u,n);r.appendChild(c)}}}catch(e){i=!0,a=e}finally{try{!o&&d.return&&d.return()}finally{if(i)throw a}}switch(t.tagName){case"SELECT":r.value=t.value;break;case"CANVAS":r.getContext("2d").drawImage(t,0,0)}return r}(n,e),e.header&&(0,o.addHeader)(e.printableElement,e),a.default.send(e,t)):window.console.error("Invalid HTML element id: "+e.printable)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(0),i=(r=o)&&r.__esModule?r:{default:r};t.default={print:function(e,t){e.printableElement=document.createElement("div"),e.printableElement.setAttribute("style","width:100%"),e.printableElement.innerHTML=e.printable,i.default.send(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(r,e){r.printable.constructor!==Array&&(r.printable=[r.printable]),r.printableElement=document.createElement("div"),r.printable.forEach(function(e){var t=document.createElement("img");t.setAttribute("style",r.imageStyle),t.src=e;var n=document.createElement("div");n.appendChild(t),r.printableElement.appendChild(n)}),r.header&&(0,o.addHeader)(r.printableElement,r),a.default.send(r,e)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c=n(1),i=n(0),a=(r=i)&&r.__esModule?r:{default:r};t.default={print:function(t,e){if("object"!==o(t.printable))throw new Error("Invalid javascript data object (JSON).");if("boolean"!=typeof t.repeatTableHeader)throw new Error("Invalid value for repeatTableHeader attribute (JSON).");if(!t.properties||!Array.isArray(t.properties))throw new Error("Invalid properties array for your JSON data.");t.properties=t.properties.map(function(e){return{field:"object"===(void 0===e?"undefined":o(e))?e.field:e,displayName:"object"===(void 0===e?"undefined":o(e))?e.displayName:e,columnSize:"object"===(void 0===e?"undefined":o(e))&&e.columnSize?e.columnSize+";":100/t.properties.length+"%;"}}),t.printableElement=document.createElement("div"),t.header&&(0,c.addHeader)(t.printableElement,t),t.printableElement.innerHTML+=function(e){var t=e.printable,n=e.properties,r='';e.repeatTableHeader&&(r+="");r+="";for(var o=0;o'+(0,c.capitalizePrint)(n[o].displayName)+"";r+=" ",e.repeatTableHeader&&(r+="");r+="";for(var i=0;i";for(var a=0;a'+l+""}r+=""}return r+=" "}(t),a.default.send(t,e)}}}]).default});
document.querySelector('.all-content-wrapper').setAttribute('id','printable');
ChangeListener('.lead_post_body_main .share-pinterest, .mobile_social_links .share-pinterest', function(el) {
el.outerHTML=' ';
});
ChangeListener('.lead_post_body_main .share-print, .mobile_social_links .share-print', function(el) {
el.addEventListener("click", function(){
if (navigator.userAgent.indexOf("Firefox") > 0) {window.print();}else{
printJS({printable: 'printable',type: 'html',targetStyles: ['*'],css: 'https://partners.rebelmouse.com/commondreams/print.css?s=0',style: ".custom-field-after-seconds,.custom-field-popup-bg-color,.custom-field-popup-text-color,.custom-field-location,.no-print { display: none !important; }"});
}
});
});
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
if (getCookie("popupShown") || (getCookie("hide_newsletter") != null && getCookie("hide_newsletter"))) {
console.log("nothing to do");
return;
}
if(document.querySelector(".popup-modal .mb-2.popup--article #mc-embedded-subscribe") != null) {
const popupform = document.querySelector(".popup-modal [name='mc-embedded-subscribe-form']");
popupform.addEventListener("submit", () => {
setCookie("hide_newsletter", "true", 365);
});
popupform.addEventListener("click", () => {
setCookie("hide_newsletter", "true", 365);
});
/*document.querySelector(".popup-modal .mb-2.popup--article #mc-embedded-subscribe").addEventListener("click", function(){
// Set the "hide_newsletter" cookie to "true" for 1 year (365 days)
setCookie("hide_newsletter", "true", 365);
});*/
}
const popupBackdrop = document.querySelector(".popup--backdrop");
const closePopupButton = popupBackdrop.querySelector(".close-button");
const afterSecondsField = popupBackdrop.querySelector(
".custom-field-after-seconds"
)?.textContent;
const scrollingBeginsField = popupBackdrop.querySelector(
".custom-field-scrolling-begins"
)?.textContent;
const customFieldObj = document.querySelector(".popup--article .custom-field-visible-to-admin-only");
const customBGColor = popupBackdrop.querySelector('.custom-field-popup-bg-color').textContent
const customTextColor = popupBackdrop.querySelector('.custom-field-popup-text-color').textContent
popupBackdrop.style.setProperty('--background-color', `${customBGColor}`)
popupBackdrop.style.setProperty('--text-color', `${customTextColor}`)
const after_seconds = Number(afterSecondsField);
const scrolling_begins = scrollingBeginsField === "True";
let lastScrollPosition = 0;
let userHasInteracted = false;
const scrollDeltaThreshold = 5;
const showPopup = () => {
console.log("---- showPopup ----")
if (((customFieldObj != null && getCookie("userIsAdmin")) || customFieldObj == null) && !getCookie("popupShown") ){
popupBackdrop.classList.add("open");
setCookie("popupShown", true, 30);
}
};
const hidePopup = () => popupBackdrop.classList.remove("open");
closePopupButton.addEventListener("click", hidePopup);
const userEvents = ["mousemove", "mousedown", "keydown", "touchstart"];
let userEventListenersRemoved = false;
const userInteraction = () => {
userHasInteracted = true;
if (userEventListenersRemoved) return;
userEvents.forEach((event) => {
document.removeEventListener(event, userInteraction);
userEventListenersRemoved = true;
});
};
userEvents.forEach((event) =>
document.addEventListener(event, userInteraction)
);
if (!scrolling_begins && !isNaN(after_seconds)) {
setTimeout(showPopup, after_seconds * 1000);
} else if (scrolling_begins) {
document.addEventListener("scroll", debounce(handleScroll, 50));
}
function handleScroll() {
console.log("----handle Scroll----")
if (scrolling_begins && !userHasInteracted) return;
if (scrolling_begins) {
const currentScrollPosition =
window.scrollY || document.documentElement.scrollTop;
const scrollDelta = Math.abs(currentScrollPosition - lastScrollPosition);
if (scrollDelta > scrollDeltaThreshold) {
setTimeout(showPopup, 0);
document.removeEventListener("scroll", debounce(handleScroll, 50));
}
lastScrollPosition = currentScrollPosition;
}
}
function debounce(func, wait, immediate = false) {
let timeout;
return function (...args) {
const context = this;
const later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
const shouldCallNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (shouldCallNow) func.apply(context, args);
};
}
// to be implemented: cookies
function setCookie(name, value, days) {
let date = new Date();
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
let expires = "expires=" + date.toUTCString();
document.cookie = name + "=" + value + ";" + expires + ";path=/";
}
function getCookie(cname) {
let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(";");
for (let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == " ") {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
REBELMOUSE_STDLIB.createElementChangeListener(".newsletter-campaign .custom-field-source-text", function(button){
button.setAttribute('data-before', '');
button.innerHTML=' ';
})
});
window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){
/*
Checking the position set with a post custom field, if it is not a default one (above) - change the position to custom
*/
const blockPlacement = () => {
const newsletterBlock = document.querySelector('.js-newsletter-wrapper');
const placementPosition = document.querySelector('.custom-field-newsletter-position') ? document.querySelector('.custom-field-newsletter-position').innerText : false;
if (!placementPosition) {
return newsletterBlock.classList.remove('visually-hidden');
}
const targetBlock = document.querySelector('.tab_wrap');
placementPosition === 'above' || placementPosition === '' ? false : targetBlock.insertAdjacentElement('afterend', newsletterBlock);
return newsletterBlock.classList.remove('visually-hidden');
}
blockPlacement();
});