-->
`;
const embedded = createRawHtml(rawHtml);
embedded.appendChild(appendScript("https://platform.twitter.com/widgets.js"));
return embedded;
}
function processSingleContentElement(contentElement) {
switch (contentElement.displayType) {
case 'section': return contentElement.elements.map(it => processSingleContentElement(it));
case 'paragraph': return createSimpleTextElement(contentElement.text);
case 'header': return createSimpleTextElement(contentElement.text, 'h' + contentElement.level);
case 'image': return createImage(contentElement);
case 'twitter': return createTwitter(contentElement);
case 'youtube': return createYoutube(contentElement);
default: return createSimpleTextElement(JSON.stringify(contentElement));
}
}
function fillContentIntoElement(createdElement, htmlEl) {
try {
console.log(createdElement, htmlEl);
if (createdElement.length) {
createdElement.forEach(ch => htmlEl.appendChild(ch));
} else {
htmlEl.appendChild(createdElement);
}
} catch (e) {
console.error(e.message);
}
}
function fillContent(contentElementsList, htmlElements) {
const contentElements = Array.from(contentElementsList);
console.log(contentElements);
const lastElementIndex = htmlElements.length - 1;
htmlElements.forEach((htmlEl, index) => {
htmlEl.innerHTML = '';
if(contentElements.length > index) {
if(index === lastElementIndex) {
contentElements.slice(index).forEach(ce => fillContentIntoElement(processSingleContentElement(ce),htmlEl))
} else {
const createdElement = processSingleContentElement(contentElements[index]);
fillContentIntoElement(createdElement, htmlEl);
}
}
});
}
function createSlides(slides) {
const templateWrapper = document.getElementById('slide-template');
const template = templateWrapper.content.querySelector(".slide-template");
return slides.map((it, index) => {
const cloned = template.cloneNode(true);
const contentPlaceholders = cloned.querySelectorAll(".content-placeholder");
fillContent(it.elements, contentPlaceholders)
if (infiniteLayout) {
cloned.querySelectorAll(".adslot").forEach(slot => {
slot.id = slot.id + '_' + index;
});
}
return cloned;
});
}
var slides = [{"elements":[{"text":"","level":3,"displayType":"header"},{"elements":[{"text":"Most of us find inspiration in songs to help us through difficult times. Sometimes a verse can accurately describe how we are feeling or give us that extra little bit of strength to get past a hard moment. 12-year-old Sparsh Shah feels empowered when he hears Eminem’s songs. The New Jersey resident was born with an incurable disease called osteogenesis imperfecta, making his bones brittle and fragile. Sparsh whose rapper name is Purhythm, has endured 125 fractures in his life but that has not stopped him from following his passion; music. The Slim Shady fan recently recorded the cover of “Not Afraid,” minus the swearing. Sparsh hopes to one day meet his idol and collaborate with him on a song. He has already written his own songs, poems, and short stories to prepare for his encounter. Sparsh has a beautiful voice whose rendition from the 2010 hit will bring tears to your eyes.","level":0,"displayType":"paragraph"}],"displayType":"section"},{"elements":[{"text":"","level":1,"displayType":"paragraph"}],"displayType":"section"}]}];
var slide_index = parseInt(0);
var slide_json = createSlides(slides);
var initial_slide = slide_index;
var initial_url = location.pathname + location.search;
var base_url = '/sparsh-shah';
var next_gallery = '/bird-panhandling';
var first_load = true;
var has_scrolled = false;
var title = "Eminem’s ‘Not Afraid’ Was Powerfully Covered By This AMAZING 12 Year-Old.";
var path = base_url
var utm_campaign, utm_subid, utm_source, utm_content, utm_term = 'n/a';
// try {
// var url = new URL(window.location.href);
// utm_campaign = encodeURIComponent(url.searchParams.get("utm_campaign"));
// utm_source = encodeURIComponent(url.searchParams.get("utm_source"));
// utm_content = encodeURIComponent(url.searchParams.get("utm_content"));
// utm_term = encodeURIComponent(url.searchParams.get("utm_term"));
// utm_medium = encodeURIComponent(url.searchParams.get("utm_medium"));
// if (utm_content && utm_campaign){
// var googletag = googletag || {};
// googletag.cmd = googletag.cmd || [];
// googletag.cmd.push(function() {
// googletag.pubads().setTargeting("utm_subid", utm_term);
// googletag.pubads().setTargeting("utm_subid_c", utm_campaign);
// });
// }
// } catch (e) {
// }