Create a gist now

Instantly share code, notes, and snippets.

Lets Make The CNN Archive Great Again: Unmangled Mins
/*
const <name> = min file unmangled
properties
'Global CNN varible w/ property chain': [
{
prop: 'lhs' // CNN w/ property chain assignee
to: 'rhs' // Assigned to
}
]
*/
const cnn_analytics_min_js = {
'CNN.Analytics': [{
prop: 'CNN.Analytics',
to: CNN.Analytics || {}
}],
'CNN.Gallery': [{
prop: 'CNN.Gallery',
to: CNN.Gallery || {}
}],
'CNN.Analytics.utils': [{
prop: 'CNN.Analytics.utils',
to: function() {
"use strict";
function e() {
var e = CNN.CurrentWidth.getClientWidth(),
t = 640,
n = 960,
a = 1120,
i = "no-value-set";
return i = e >= a ? "14col" : a > e && e >= n ? "12col" : n >
e && e >= t ? "8col" : "4col";
}
function t(e) {
var t = {};
return t.section = "section front", t.special = "specials", t
.videos = "video", "string" == typeof e && e in t && (e = t[
e]), "undefined" == typeof CNN.contentModel ||
"undefined" == typeof CNN.contentModel.sectionName ||
"homepage" !== CNN.contentModel.sectionName &&
"intl_homepage" !== CNN.contentModel.sectionName || (e =
"index"), e;
}
function n(e, t, n) {
var a = e.split(";"),
i = 0;
for (t = "string" == typeof t && t.length > 0 ? ";expires=" +
t : "", n = "string" == typeof n && n.length > 0 ? ";path=" +
n : ";path=/"; i < a.length; i++) document.cookie = a[i] +
n + t + ";";
}
function a(e, t) {
"string" == typeof t && t.length > 0 && n(t), e.currentTarget
.attributes.hasOwnProperty("data-vr-track") && window._vrtrack({
track_url: e.currentTarget.href,
event_type: "partner"
});
}
function i() {
var n, a, i, r, l, c = CNN.contentModel.pageType,
s = "no-value-set",
d = s,
u = e(),
p = jQuery(CNN.Carousel.carouselSelector)
.first(),
g = jQuery("div[data-analytics-pivit]")
.length > 0,
h = s,
y = s,
_ = s,
f = jQuery(".js-media__video")
.length,
m = CNN.contentModel.env || s,
N = CNN.contentModel.analytics && CNN.contentModel.analytics
.showName || "",
b = CNN.contentModel.title || s,
v = [],
C = s,
w = s,
k = s,
j = s,
M = s,
T = s,
Q = "none",
z = 0,
x = "";
if ("undefined" == typeof CNN.contentModel || "undefined" ==
typeof CNN.contentModel.pageType || "undefined" == typeof CNN
.contentModel.sectionName || "section" !== CNN.contentModel
.pageType && "homepage" !== CNN.contentModel.sectionName &&
"intl_homepage" !== CNN.contentModel.sectionName || (b = s),
"undefined" != typeof CNN.contentModel && "undefined" !=
typeof CNN.contentModel.layout && "error" === CNN.contentModel
.layout && (c = "error"), p.length) switch (c) {
case "article":
h = p.data("galleryname"), y = p.find(
"[data-slidename]")
.first()
.data("slidename");
break;
case "gallery":
h = b, y = p.find("[data-slidename]")
.first()
.data("slidename"), z = 1;
}
"undefined" != typeof CNN.contentModel.analytics && (
"undefined" != typeof CNN.contentModel.analytics.publishDate &&
(_ = CNN.contentModel.analytics.publishDate, v = CNN.contentModel
.analytics.publishDate.split("T")[0].split("-"), 3 ===
v.length && (_ = v[0] + "/" + v[1] + "/" + v[2])), C =
CNN.contentModel.analytics.author || s, w = CNN.contentModel
.analytics.cap_genre || s, k = CNN.contentModel.analytics
.cap_franchise || s, j = CNN.contentModel.analytics.cap_mediaType ||
s, M = CNN.contentModel.analytics.cap_topics || s, T =
CNN.contentModel.pageType || s, r = CNN.contentModel.analytics
.branding_content_page || s, n = CNN.contentModel.analytics
.branding_content_zone || s, a = CNN.contentModel.analytics
.branding_content_container || s, i = CNN.contentModel.analytics
.branding_content_card || s, l = CNN.contentModel.analytics
.contentId || s, "gallery" === T && "string" == typeof CNN
.contentModel.analytics.branding_content_page &&
"default" !== CNN.contentModel.analytics.branding_content_page &&
(x = CNN.contentModel.analytics.branding_content_page), g &&
(Q = "pivit widget")), jQuery.extend(CNN.omniture, {
branding_ad_page: s,
branding_ad_zone: s,
branding_ad_container: s,
branding_ad_card: s,
branding_content_page: r,
branding_content_zone: n,
branding_content_container: a,
branding_content_card: i,
branding_gallery: x,
cap_author: C,
cap_content_type: T,
cap_genre: w,
cap_franchise: k,
cap_media_type: j,
cap_show_name: N,
cap_topic: M,
video_opportunity: f,
content_id: l,
content_type: Q,
friendly_name: d,
full_gallery: z,
gallery_name: h,
gallery_slide: y,
grid_size: u,
headline: b,
ireport_assignment: s,
publish_date: _,
rs_flag: m,
section: o(CNN.contentModel),
template_type: t(c)
}), "error" === CNN.omniture.template_type && (CNN.omniture
.section = ["error", s]), "function" == typeof jQuery.fn.triggerAnalyticsMetadataReady ?
jQuery(document)
.triggerAnalyticsMetadataReady() : jQuery(document)
.trigger("cnn-analytics-metadata-added");
}
function o(e) {
var t = "",
n = "",
a = "",
i = e,
o = e.analytics || {};
return a = "undefined" != typeof i.sectionName ? i.sectionName :
"undefined" != typeof o.parentPath ? o.parentPath.indexOf(
"/") > -1 ? o.parentPath.split("/")[1] : o.parentPath :
"undefined" != typeof i.layout && "search" === i.layout ?
"search" : "no-value-set", d[a] ? (t = d[a].section, n = d[
a].subsection || "") : (t = a, n = ""), [t, n];
}
function r() {
try {
var e = location.href.toLowerCase();
window.jsmd = _jsmd.init(), -1 === e.indexOf(
"/.element/ssi/ads.iframes/") && -1 === e.indexOf(
"/doubleclick/dartiframe.html") && -1 === e.indexOf(
"/search/") && (_jsmd.plugin.gQuery("refresh") ? jsmd.trackMetrics(
"dynamic-autoRefresh", "autorefresh",
"cnn-autorefresh") : "gallery" !== CNN.omniture.template_type_content &&
jsmd.send());
} catch (t) {
console.log("JSMD/Analytics error: ", t);
}
}
function l(e) {
var t = jQuery(".nav--plain-header"),
n = jQuery("footer.l-footer"),
a = CNN.Analytics.hpt;
jQuery(e)
.find("a")
.each(function() {
var e, i = jQuery(this),
o = i.attr("href");
"string" == typeof o && (e = "page", i.closest(".nav",
t)
.length > 0 ? e = "header" : i.closest(
".nav-flyout__menu-item", t)
.length > 0 ? e = "header" : i.closest(".l-footer",
n)
.length > 0 && (e = "footer"), a.getHptValues(i, e)
.done(function(e) {
var t;
"object" == typeof e && -1 === o.indexOf(e.hptValue) ?
(t = "hpt=" + e.hptValue + ";hpt2=" + e.hpt2Value,
i.click(jQuery.proxy(function(e, t) {
CNN.Analytics.utils.clickEventTracker(
t, e);
}, this, t))) : "string" == typeof i.data(
"vr-track") && o.length > 1 && i.click(CNN.Analytics
.utils.clickEventTracker);
}));
});
}
function c() {
var e = jQuery("a", "div.metadata-header__follow-icon"),
t = jQuery("div.share-bar-whatsapp-container"),
n = jQuery("a", "div.nav-flyout-footer__social");
e.click(function() {
return s(this, !1);
}), t.click(function() {
var e = document.querySelector(
".share-bar-whatsapp-container")
.dataset,
t = e.url + " " + e.title + " " + e.storyurl;
return jQuery("html")
.hasClass("phone") && (document.location = t), s(this, !
1);
}), n.click(function() {
return s(this, !0);
});
}
function s(e, t) {
var n = e.getAttribute("data-social-media-name");
if ("function" == typeof window.trackMetrics) try {
window.trackMetrics({
type: "social-click",
data: {
clickObj: {
socialType: "social: " + n,
isMainNav: t
}
}
});
} catch (a) {}
return !0;
}
var d = {
videos: {
section: "videos"
},
"watch-cnn": {
section: "watch-cnn"
},
intl_homepage: {
section: "cnn homepage",
subsection: ""
},
homepage: {
section: "cnn homepage",
subsection: ""
},
us: {
section: "us",
subsection: ""
},
world: {
section: "world",
subsection: ""
},
politics: {
section: "politics",
subsection: ""
},
tech: {
section: "tech",
subsection: ""
},
health: {
section: "health",
subsection: ""
},
entertainment: {
section: "entertainment",
subsection: ""
},
living: {
section: "living",
subsection: ""
},
aviation: {
section: "travel",
subsection: "aviation"
},
destinations: {
section: "travel",
subsection: "destinations"
},
foodanddrink: {
section: "travel",
subsection: "foodanddrink"
},
hotels: {
section: "travel",
subsection: "hotels"
},
intl_travel: {
section: "travel",
subsection: ""
},
travel: {
section: "travel",
subsection: ""
},
china: {
section: "world",
subsection: "china"
},
africa: {
section: "world",
subsection: "africa"
},
americas: {
section: "world",
subsection: "americas"
},
asia: {
section: "world",
subsection: "asia"
},
europe: {
section: "world",
subsection: "europe"
},
middleeast: {
section: "world",
subsection: "middleeast"
},
football: {
section: "sport",
subsection: "football"
},
motorsport: {
section: "sport",
subsection: "motorsport"
},
sailing: {
section: "sport",
subsection: "sailing"
},
golf: {
section: "sport",
subsection: "golf"
},
tennis: {
section: "sport",
subsection: "tennis"
},
horseracing: {
section: "sport",
subsection: "horseracing"
},
equestrian: {
section: "sport",
subsection: "equestrian"
},
skiing: {
section: "sport",
subsection: "skiing"
},
architecture: {
section: "style",
subsection: "architecture"
},
arts: {
section: "style",
subsection: "arts"
},
autos: {
section: "style",
subsection: "autos"
},
design: {
section: "style",
subsection: "design"
},
fashion: {
section: "style",
subsection: "fashion"
},
luxury: {
section: "style",
subsection: "luxury"
},
style: {
section: "style",
subsection: ""
}
};
return CNN.omniture = CNN.omniture || {}, {
gridSize: e,
renamingTemplateType: t,
addMetadataObject: i,
jsmdTracking: r,
addTrackingTags: l,
setCookie: n,
clickEventTracker: a,
addSocialMediaInteractionMetrics: c
};
}()
}],
'CNN.omniture.section': [{
prop: 'CNN.omniture.section',
to: ["error", s]
}],
'CNN.omniture': [{
prop: 'CNN.omniture',
to: CNN.omniture || {}
}],
'CNN.Analytics.hpt': [{
prop: 'CNN.Analytics.hpt',
to: function() {
"use strict";
function e(e) {
var t = "";
return e = "undefined" == typeof e ? "" : e.replace(/^zn-/,
""), t = l[e] ? l[e] : "no-value-set";
}
function t(e) {
var t = "";
return e = "undefined" == typeof e ? "" : e.replace(/^cn-/,
""), t = r[e] ? r[e] : "no-value-set";
}
function n(n, a) {
var i, o = {},
r = "no-value-set",
l = r,
c = CNN.contentModel.pageType,
s = CNN.contentModel.sectionName || r,
d = CNN.contentModel.type || r,
u = r,
p = r,
g = r,
h = r,
y = r,
_ = r,
f = r,
m = "zone-level",
N = [],
b = r,
v = r,
C = r,
w = n.closest("[data-analytics]"),
k = n.closest("[class^=\'zn zn-\']"),
j = n.closest("section.zn"),
M = n.closest(".cn"),
T = n.closest("[data-analytics-header]"),
Q = r,
z = r,
x = r,
O = [],
S = CNN.Analytics.utils;
return m = n.text()
.length > 0 ? n.text()
.toLowerCase() : "zone-level", k.length && "A" !== k[0].tagName &&
k[0].className && (i = k[0].className, "undefined" !=
typeof i && (y = i.split(" ")
.length > 1 ? i.split(" ")[2] : r)), j.length && (i = j
.data("zone-label"), "undefined" != typeof i && i.length &&
(h = i), i = j.data("vr-zone"), "undefined" != typeof i &&
i.length && (_ = i)), i = w.length ? w.data("analytics") :
n[0].className.indexOf("cd-banner") >= 0 ? n.nextAll(
"[data-analytics]")
.data("analytics") : void 0, "undefined" != typeof i && i.length &&
(l = i.split("_"), l = l.length ? l : [], b = l[0].length >
0 ? l[0] : r, b = b.replace(/\\s/g, "-"), v = l[1], g = l
.length > 2 ? l[2] : r, l.length >= 4 && l[3].length > 0 ?
f = l[3] : 0 === n.text()
.length || n.text()
.indexOf("<img") >= 0 ? (f = "image", m = "image") : f =
"text"), n.eq(0)
.text() && (p = n.eq(0)
.text(), p = p.replace(/[ ]/g, "-"), p.indexOf("<img") >=
0 && (p = "image-file")), i = T.data("analytics-header"),
"header" === a && "string" == typeof i && i.split("_")
.length && (u = "header", O = i.split("_"), O = O.length ?
O : [], Q = "main-menu" === O[0] || "flyout-menu" === O[0] ?
O[1].toLowerCase() : r, z = "flyout-submenu" === O[0] ? O[
1].toLowerCase() : r, x = r), i = w.data("analytics"),
"footer" === a && "string" == typeof i && i.split("_")
.length && (O = i.split("_"), O = O.length ? O : [], 1 ===
O.length && (u = "footer", Q = O[0].toLowerCase(), z = r,
x = r), 2 === O.length && (u = O[0].toLowerCase(), Q =
O[1].toLowerCase(), z = r, x = r), 3 === O.length && (u =
O[0].toLowerCase(), Q = O[1].toLowerCase(), z = O[2].toLowerCase(),
x = r)), "page" === a && M.length && (i = M[0].className,
"undefined" != typeof i && (N = i.split(/\\s+/), N.length &&
(C = N[N.length - 1], C = C.replace(/_/g, "-")))), o = {
linkText: m,
hpt_page_pageIndicator: d,
hpt_page_gridSize: S.gridSize(),
hpt_page_section: s,
hpt_page_template: S.renamingTemplateType(c),
hpt_page_zoneId: _,
hpt_page_zoneLabel: h,
hpt_page_containerId: C,
hpt_page_containerLabel: b,
hpt2_page_pageIndicator: d,
hpt2_page_gridSize: S.gridSize(),
hpt2_page_section: s,
hpt2_page_template: S.renamingTemplateType(c),
hpt2_page_zoneId: _,
hpt2_page_zoneType: e(y),
hpt2_page_containerId: C,
hpt2_page_containerType: t(v),
hpt_header_globalIndicator: u,
hpt_header_gridSize: S.gridSize(),
hpt_header_section: s,
hpt_header_template: S.renamingTemplateType(c),
hpt_header_level1: Q,
hpt_header_level2: z,
hpt_header_level3: x,
hpt_header_linkElement: m,
hpt_header_linkType: f,
hpt2_header_globalIndicator: u,
hpt2_header_gridSize: S.gridSize(),
hpt2_header_section: s,
hpt2_header_template: S.renamingTemplateType(c),
hpt2_header_level1: Q,
hpt2_header_level2: z,
hpt2_header_level3: x,
hpt2_header_linkElement: m,
hpt2_header_linkType: f
};
}
function a(e, t, n) {
var a = jQuery.Deferred();
return fastdom.measure(function() {
var i, o, r, l = t.data("filter-hpt"),
c = t.data("filter-" + e),
s = "string" == typeof l,
d = "string" == typeof c,
u = "",
p = n.split("_");
if (d || s) {
for (u = d ? c : l, i = u.split("_"), o = 0, r = i.length; r >
o; o += 1) p[o] && "" !== i[o] && (p[o] = i[o]);
n = p.join("_");
}
a.resolve(n);
}), a.promise();
}
function i(e, t) {
return {
hptValue: CNN.Utils.b64Encode(e.replace("", ""))
.replace(/\r/g, ""),
hpt2Value: CNN.Utils.b64Encode(t.replace("", ""))
.replace(/\r/g, "")
};
}
function o(e, t) {
var o = n(e, t),
r = "",
l = "";
return "page" === t ? (r = o.hpt_page_pageIndicator + "_" + o
.hpt_page_gridSize + "_" + o.hpt_page_section + "_" + o.hpt_page_template +
"_" + o.hpt_page_zoneId + "_" + o.hpt_page_zoneLabel +
"_" + o.hpt_page_containerId + "_" + o.hpt_page_containerLabel,
l = o.hpt2_page_pageIndicator + "_" + o.hpt2_page_gridSize +
"_" + o.hpt2_page_section + "_" + o.hpt2_page_template +
"_" + o.hpt2_page_zoneId + "_" + o.hpt2_page_zoneType +
"_" + o.hpt2_page_containerId + "_" + o.hpt2_page_containerType
) : (r = o.hpt_header_globalIndicator + "_" + o.hpt_header_gridSize +
"_" + o.hpt_header_section + "_" + o.hpt_header_template +
"_" + o.hpt_header_level1 + "_" + o.hpt_header_level2 +
"_" + o.hpt_header_linkElement + "_" + o.hpt_header_linkType,
l = o.hpt2_header_globalIndicator + "_" + o.hpt2_header_gridSize +
"_" + o.hpt2_header_section + "_" + o.hpt2_header_template +
"_" + o.hpt2_header_level1 + "_" + o.hpt2_header_level2 +
"_" + o.hpt2_header_linkElement + "_" + o.hpt2_header_linkType
), jQuery.when(a("hpt1", e, r), a("hpt2", e, l))
.then(i);
}
var r = {
"list-hierarchical-small-horizontal": "lead+list:lead+headlines-w/images",
"list-hierarchical-xs": "lead+list:lead+headlines",
"list-large-horizontal": "list:full-cards",
"list-large-vertical": "vertical-strip:full-cards",
"list-small-horizontal": "list:headlines+images",
"list-small-vertical": "vertical-strip:headlines+images",
"list-xs": "headlines",
"grid-medium": "grid:grid(spaced)",
"grid-small": "grid:grid",
"stack-large-horizontal": "list:full-cards(spaced)",
"stack-large-vertical": "vertical-strip:full-cards(spaced)",
"stack-medium-horizontal": "list:headlines+images(spaced)",
"stack-medium-vertical": "vertical-strip:headlines+images(spaced)",
"carousel-large-strip": "carousel:large",
"carousel-medium-matrix": "carousel:double-deck",
"carousel-medium-strip": "carousel:standard",
"stack-ul": "unknown name",
"section-preview": "unknown name"
},
l = {
"left-fluid-right-stack": "hero-3",
"left-fluid-bg-bleed": "superhero",
"left-fluid": "priority+2",
"right-stack-bg-inline": "hero-plus",
"right-stack-bg-bleed": "full-bleed",
staggered: "staggered",
balanced: "balanced",
"60-40": "priority+1",
"30-70": "grid-right",
"40-60": "unknown name",
"70-30": "unknown name",
body: "unknown name",
"single-column": "unknown name",
"zone-background": "unknown name",
"zone-banner": "unknown name",
"zone-header": "unknown name"
};
return {
getHptValues: o
};
}()
}],
'CNN.Gallery.analytics': [{
prop: 'CNN.Gallery.analytics',
to: function() {
"use strict";
function e(e, t) {
var n = jQuery(e),
a = {},
i = [],
o = "",
r = {},
l = "",
c = !1,
s = [],
d = "",
u = "",
p = 1;
for (c = "boolean" == typeof n.data("is-gallery") ? n.data(
"is-gallery") : !1, a = {
video: 0,
article: 0,
gallery: 0,
image: 0,
hyperlink: 0,
matched: 0
}, jQuery("div.owl-item div[data-analytics]", e)
.each(function() {
var e, t = jQuery(this);
e = t.data("analytics")
.split("_"), s.push(e[2] || ""), u = e[1];
}), d = s.length > 0 ? s[0] : d; p < s.length; p++)
if (s[p] !== d) {
d = "multimedia";
break;
}
return "boolean" == typeof t && t && (o = "owl-nav" === e.className ?
e.offsetParent.id.split("_")[1] : e.id.split("_")[1], r =
document.getElementById("cn-jumbotron-details-container_" +
o), jQuery.each(jQuery(r)
.find(
".js-jumbotron-card-wrapper.jumbotron-card-wrapper.active-card"
),
function(e, t) {
i = t.firstChild.className.match(/cd\\-\\-article/),
null === i && (i = t.firstChild.className.match(
/cd\\-\\-(video|image|gallery|hyperlink)/)), null !==
i && (l = i[0].replace("cd--", ""));
}), jQuery.each(jQuery(r)
.find("article.cd"),
function(e, t) {
t.className.indexOf("cd--video") > -1 ? a.video++ : t
.className.indexOf("cd--article") > -1 ? a.article++
: t.className.indexOf("cd--image") > -1 ? a.image++
: t.className.indexOf("cd--gallery") > -1 ? a.gallery++
: t.className.indexOf("cd--hyperlink") > -1 && a.hyperlink++;
}), a.video > 0 && (d = "video", a.matched++), a.article >
0 && (d = "article", a.matched++), a.image > 0 && (d =
"image", a.matched++), a.hyperlink > 0 && (d =
"hyperlink", a.matched++), a.gallery > 0 && (d =
"gallery", a.matched++), a.matched > 1 && (d =
"multimedia")), d = d.length > 0 ? "carousel_" + d : d, {
contentType: d,
carouselType: u,
isGallery: c
};
}
function t(e) {
return "undefined" != typeof jQuery(e)
.data(u) ? jQuery(e)
.data(u) : "";
}
function n(e) {
var t = -1,
n = "",
a = jQuery(e),
i = a.find(p) || [];
return t = a.data("active") || "", jQuery.isNumeric(t) && t >
0 && (n = jQuery(i[t - 1])
.find("img")
.attr("src"), n = "undefined" != typeof n ? n.substring(n
.lastIndexOf("/") + 1) : ""), n;
}
function a(e, t) {
var n = [],
a = 0;
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR),
n.find(".owl-item")
.each(function(e, t) {
jQuery(t)
.hasClass("cloned") || a++;
})) : a = "undefined" != typeof jQuery(e)
.data(g) ? jQuery(e)
.data(g) : "", a;
}
function i(e) {
var t = jQuery(".owl-stage", e)
.find(".owl-item.active .el__resize img:first")
.attr("alt");
return "string" != typeof t ? "" : t.replace(
/[\\u0250-\\ue007]/g, "")
.substr(0, 40);
}
function o(e, t) {
var n = [],
a = 0;
return t ? (n = jQuery(CNN.Jumbotron.Constants.CONST_SMALL_CAROUSEL_SELECTOR),
n.find(".owl-item")
.each(function(e, t) {
return !jQuery(t)
.hasClass("cloned") && (a++, jQuery(t)
.hasClass("active")) ? !1 : void 0;
})) : a = i(e), a;
}
function r(i, r) {
var l = {};
return l = e(i, r), l.galleryName = t(i), l.galleryType = l.isGallery ?
"photo gallery" : "carousel", l.imageName = "carousel" !==
l.galleryType ? n(i) : "", l.slideCount = a(i, r), l.slideNumber =
o(i, r), "carousel" !== l.galleryType && (l.carouselType =
""), l;
}
function l(e, t) {
"undefined" != typeof t.isJumbotron && t.isJumbotron === !0 &&
(e.data.page_view = !0, e.data.carousel_type = "jumbotron");
}
function c(e) {
var t = CNN.CurrentWidth.getClientWidth() * CNN.CurrentHeight
.getClientHeight(),
n = t / 2 + 1,
a = e.target.clientWidth * e.target.clientHeight,
i = r(e.currentTarget, e.isJumbotron),
o = CNN.Analytics.hpt;
o.getHptValues(jQuery(e.currentTarget), "page")
.done(function(t) {
var o = {
type: "cnngallery-click",
data: {
page_view: !1,
gallery_name: i.galleryName,
image_name: i.imageName,
content_type: i.contentType,
carousel_type: i.carouselType,
gallery_type: i.galleryType,
gallery_slide_count: i.slideCount,
gallery_slide: i.slideNumber,
hpt: t.hptValue,
hpt2: t.hpt2Value
}
};
o.data.page_view = a >= n, l(o, e), CNN.ads.events.refreshGalleryRailAd(
e), null !== window.trackMetrics && void 0 !==
window.trackMetrics && window.trackMetrics(o);
});
}
function s(e) {
jQuery(CNN.Carousel.carouselSelector, e)
.off("carousel-action-event")
.on("carousel-action-event", c);
}
function d() {
var e, t, n = 0;
try {
if (t = function(e, t) {
"undefined" != typeof t && t.actionType === CNN.Jumbotron
.Constants.CONST_EVENT_CAROUSEL_ACTION_TYPE_CLICK ? (
e.isJumbotron = !0, c(e)) : "click" !== e.type &&
"changed" !== e.type && "dragged" !== e.type || (e.isJumbotron = !
0, c(e));
}, window.cnnJumbotronManager && window.cnnJumbotronManager
.getJumbotrons)
for (e = window.cnnJumbotronManager.getJumbotrons(); n <
e.length; n++) e[n] instanceof CNN.Jumbotron.Container &&
"undefined" != typeof e[n].jumbotronElementRaw && (
jQuery(e[n].jumbotronElementRaw)
.on("carousel-action-event", t), Modernizr.touchevents ?
jQuery(e[n].jumbotronElementRaw)
.find(".cn-jumbotron-card-details")
.on(CNN.Carousel.events.changed, t) : (jQuery(e[n].jumbotronElementRaw)
.find(".owl-nav")
.on("click", t), jQuery(e[n].jumbotronElementRaw)
.find(".jumbotron-small-carousel")
.on(CNN.Carousel.events.dragged, t)));
} catch (a) {
console.log("Error caught in initJumbotronTracking: %s", a.message);
}
}
var u = "galleryname",
p = "[data-slidename]",
g = "slide-count";
return {
init: s,
initJumbotronTracking: d,
trackGalleryClick: c
};
}()
}]
}
const cnn_footer_lib_min_js = {
'CNN.Window.width': [{
prop: 'CNN.Window.width',
to: "0"
}, {
prop: 'CNN.Window.width',
to: "640"
}, {
prop: 'CNN.Window.width',
to: "800"
}, {
prop: 'CNN.Window.width',
to: CNN.Window.width || ""
}],
'CNN.Columns.current': [{
prop: 'CNN.Columns.current',
to: "12"
}, {
prop: 'CNN.Columns.current',
to: "4"
}, {
prop: 'CNN.Columns.current',
to: "5"
}, {
prop: 'CNN.Columns.current',
to: "6"
}, {
prop: 'CNN.Columns.current',
to: "7"
}, {
prop: 'CNN.Columns.current',
to: "8"
}, {
prop: 'CNN.Columns.current',
to: "9"
}, {
prop: 'CNN.Columns.current',
to: "10"
}, {
prop: 'CNN.Columns.current',
to: "11"
}],
'CNN.iZLoading': [{
prop: 'CNN.iZLoading',
to: !0
}, {
prop: 'CNN.iZLoading',
to: !1
}, {
prop: 'CNN.iZLoading',
to: CNN.iZLoading || !1
}],
'CNN.DemandLoading.pageBottom': [{
prop: 'CNN.DemandLoading.pageBottom',
to: !1
}, {
prop: 'CNN.DemandLoading.pageBottom',
to: !r
}, {
prop: 'CNN.DemandLoading.pageBottom',
to: !0
}],
'CNN.DemandLoading.thirdParty.money.markets': [{
prop: 'CNN.DemandLoading.thirdParty.money.markets',
to: !0
}],
'CNN.DemandLoading.thirdParty.money.currencies': [{
prop: 'CNN.DemandLoading.thirdParty.money.currencies',
to: !0
}],
'CNN.PlainNavigation': [{
prop: 'CNN.PlainNavigation',
to: {
breakpoint: 1120,
pickerBreakpoint: 768,
init: function() {
this.$editionItems = jQuery(".js-edition-item"), this.$flyoutFooterEditionItems =
jQuery(".js-nav-flyout-footer-edition-list-item"), this.$hamburgerMenu =
jQuery(document.getElementById("menu")), this.$articleTitle =
jQuery(document.getElementById(
"js-nav-section-article-title")), this.$sectionExpandIcon =
jQuery(".js-nav-section-name"), this.$searchButton = jQuery(
document.getElementById("search-button")), this.$searchSubmitButton =
jQuery(document.getElementById("submit-button")), this.$editionPicker =
jQuery(".edition-picker__current-edition"), this.detectSubNav(),
jQuery("body")
.hasClass("pg-leaf") === !0 && (jQuery(window)
.on("scroll", function() {
jQuery("body")
.toggleClass("page-scrolled", jQuery(window)
.scrollTop() > 100);
}), CNN.contentModel && CNN.contentModel.title && this.$articleTitle
.html(CNN.contentModel.title)), this.$editionItems.on(
"click", this.changeEdition), this.$flyoutFooterEditionItems
.on("click", this.changeEdition), this.$hamburgerMenu.on(
"click", this.hideEdition), this.$searchSubmitButton.on(
"click", this.searchSubmit), this.$sectionExpandIcon.on(
"click", this.sectionRootExpand), this.$searchButton.on(
"click",
function(e) {
window.innerWidth < CNN.PlainNavigation.breakpoint ?
CNN.PlainNavigation.searchSubmit(e) : CNN.PlainNavigation
.searchExpand(e);
}), this.$editionPicker.on("click", this.toggleEdition);
},
hideEdition: function() {
jQuery(".edition-picker__current-edition")
.removeClass("nav-section--expanded"), jQuery(
".js-nav-editions")
.removeClass("nav-section--expanded");
},
sectionRootExpand: function(e) {
window.innerWidth >= CNN.PlainNavigation.breakpoint || (e.preventDefault(),
jQuery(this)
.parent()
.toggleClass("nav-section--expanded"), jQuery(this)
.parent()
.hasClass("nav-section--expanded") === !0 ? jQuery(
document.getElementById("nav-section-submenu"))
.addClass("nav-section--expanded") : jQuery(document.getElementById(
"nav-section-submenu"))
.removeClass("nav-section--expanded"));
},
searchSubmit: function(e) {
e.preventDefault(), jQuery(document.getElementById(
"search-form"))
.submit();
},
searchExpand: function(e) {
e.preventDefault(), jQuery("body")
.toggleClass("search-expanded"), jQuery(document.getElementById(
"search-input-field"))
.focus();
},
toggleEdition: function(e) {
e && e.preventDefault(), jQuery("body")
.hasClass("nav-open") === !0 && window.innerWidth >= CNN.PlainNavigation
.pickerBreakpoint || (jQuery(
".edition-picker__current-edition")
.toggleClass("nav-section--expanded"), jQuery(
".js-nav-editions")
.toggleClass("nav-section--expanded"));
},
detectSubNav: function() {
var e = CNN.contentModel.sectionName,
t = jQuery("body")
.hasClass("pg-" + e),
n = jQuery("body")
.hasClass("pg-intl_" + e);
t !== !0 && n !== !0 || "homepage" === e || "intl_homepage" ===
e || jQuery(document.getElementById("nav"))
.addClass(e);
},
changeEdition: function(e, t) {
var n = e ? jQuery(e.currentTarget) : t,
i = n.parent(),
o = i.parent(),
s = o.data("location") + "_" + o.data("analytics"),
a = "/web/20160903014131/http://www.cnn.com",
r = n.data("value"),
d = r + "?hpt=" + s,
l = n.data("type");
CNN.contentModel && CNN.contentModel.edition && (a =
"international" === CNN.contentModel.edition ? "edition" :
"www"), -1 === a.indexOf(l) && (window.location = d);
}
}
}],
'CNN.selectNavigation': [{
prop: 'CNN.selectNavigation',
to: function(e, t) {
if ("undefined" == typeof e) throw "selector is not defined";
t !== !0 && (t = !1), jQuery(e)
.on("change", function() {
var e = jQuery(this)
.find(":selected")
.val();
t === !1 ? window.location = e : window.location.hash =
"#" + e;
});
}
}],
'CNN.EditionPicker': [{
prop: 'CNN.EditionPicker',
to: CNN.EditionPicker || function(e, t) {
function n(e) {
e.stopPropagation();
}
function i() {
r.on("click", n)
.on("click", ".list .item--edition", o)
.on("click", ".current", s)
.on("click", ".item--select", CNN.EditionPrefs.showPreferences);
}
function o(n, i) {
var o = n ? e(n.currentTarget) : i,
s = o.children("input"),
a = o.closest(".list"),
r = a.data("location") + "_" + a.data("analytics"),
d = "/web/20160903014131/http://www.cnn.com",
l = o.data("value"),
c = l + "?hpt=" + r;
CNN.contentModel && CNN.contentModel.edition && (d =
"international" === CNN.contentModel.edition ? "edition" :
"www"), -1 === d.indexOf(s.val()) && (t.location = c);
}
function s(t) {
var n = t ? e(t.currentTarget)
.closest(".edition-picker") : r;
n.hasClass("open") ? (n.removeClass("open"), a.off("click", s)) :
(r.removeClass("open"), n.addClass("open"), a.one("click",
s));
}
var a = e("body"),
r = e(".edition-picker");
return e(document)
.onZonesAndDomReady(i), {
changeEdition: o,
togglePicker: s
};
}(jQuery, window)
}],
'CNN.contentModel': [{
prop: 'CNN.contentModel',
to: CNN.contentModel || {}
}],
'CNN.Window': [{
prop: 'CNN.Window',
to: CNN.Window || {}
}],
'CNN.Columns': [{
prop: 'CNN.Columns',
to: CNN.Columns || {
4: 4 * columnWidth,
5: 5 * columnWidth,
6: 6 * columnWidth,
7: 7 * columnWidth,
8: 8 * columnWidth,
9: 9 * columnWidth,
10: 10 * columnWidth,
11: 11 * columnWidth,
12: 12 * columnWidth
}
}],
'CNN.Zones': [{
prop: 'CNN.Zones',
to: CNN.Zones || {}
}],
'CNN.Zones.runningZoneIds': [{
prop: 'CNN.Zones.runningZoneIds',
to: []
}],
'CNN.Zones.loadedZoneIds': [{
prop: 'CNN.Zones.loadedZoneIds',
to: []
}],
'CNN.processedContainers': [{
prop: 'CNN.processedContainers',
to: []
}],
'CNN.serverSentZones': [{
prop: 'CNN.serverSentZones',
to: loadAllZonesLazy === !0 ? 0 : 1
}],
'CNN.Containers': [{
prop: 'CNN.Containers',
to: {}
}, {
prop: 'CNN.Containers',
to: f.containers ? f.containers[u] : {}
}],
'CNN.DemandLoading.thirdParty.outbrain': [{
prop: 'CNN.DemandLoading.thirdParty.outbrain',
to: !0
}],
'CNN.DemandLoading': [{
prop: 'CNN.DemandLoading',
to: {
zoneImages: {},
thirdParty: {
money: {
currencies: !1,
market: !1
},
outbrain: !1
}
}
}],
'CNN.DemandLoading.allZoneImagesLoaded': [{
prop: 'CNN.DemandLoading.allZoneImagesLoaded',
to: function(e, t) {
CNN.DemandLoading.zoneImages[e] = {
images: jQuery("#" + e + " img"),
count: 0
}, CNN.DemandLoading.zoneImages[e].images.load(function() {
CNN.DemandLoading.zoneImages[e].count++, CNN.DemandLoading
.zoneImages[e].count === CNN.DemandLoading.zoneImages[e]
.images.length && "function" == typeof t && t();
});
}
}],
'CNN.DemandLoading.updateZoneView': [{
prop: 'CNN.DemandLoading.updateZoneView',
to: function() {
var t, n = CNN.CurrentScrollTop.getClientScrollTop(),
i = !1,
o = n + jQuery(window)
.height();
jQuery("section.zn-loaded")
.length > 0 && (jQuery("section.zn-loaded")
.each(function(n) {
return jQuery(this)
.offset()
.top > o ? (visibleZone = s(0 !== n ? t : e(this)), i = !
0, !1) : void(t = e(this));
}), i || (visibleZone = s(t)));
}
}],
'CNN.DemandLoading.updateZones': [{
prop: 'CNN.DemandLoading.updateZones',
to: function() {
var t, s, a, r, d, l, c, u, h = !1,
f = CNN.Zones,
m = 0,
p = "video" === CNN.contentModel.pageType ?
"videos/index.html" : o(document.location.pathname),
g = $page.find("section.zn-loaded:not(.nativeSponsor)")
.length,
y = f.zones || {},
v = y.minWidth || {};
if (a = v[CNN.Window.width] || CNN.contentModel.zoneIds || [],
1 === CNN.serverSentZones && (u = a[0] || "", u.indexOf(":") >
-1 && (u = u.split(":"), u = u[1] || ""), CNN.Containers =
f.containers ? f.containers[u] : {}, setZoneWindowWidth(),
loadContainers(u)), 0 === renderZoneIds.length)
for (; m < a.length; m++) r = a[m], r = CNN.Utils.exists(r) &&
r.indexOf(":") > 0 ? r.split(":")[1] : r, CNN.Utils.exists(
r) && (renderZoneIds.push(r), l = e(".zn--idx-" + m), d =
e(".zn--idx-" + (m - 1)), 0 === l.length && 1 === d.length &&
d.after('<section class="zn--idx-' + m +
' zn-empty"></section>'));
for (; g < a.length; g++)
if (h = !1, r = a[g], CNN.Utils.exists(r) && r.indexOf(":") >
0) {
if (s = r.split(":"), s = s[1], CNN.Zones.loadedZoneIds.indexOf(
s) > -1) continue;
if (t = e(".zn--idx-" + g + ".zn-empty"), 0 === t.length &&
(t = e(document.querySelectorAll(".zn-loaded"))
.last(), h = !0), 1 === t.length) {
if (CNN.Zones.runningZoneIds.indexOf(s) > -1) break;
if (c = {
path: p,
zone: t,
zoneIdx: g,
append: h,
idPath: r
}, n(s, c), i(g)) break;
}
} else {
if (s = a[g], CNN.Zones.loadedZoneIds.indexOf(s) > -1)
continue;
if (t = e(document.getElementById(s)), 1 === t.length) {
if (CNN.Zones.runningZoneIds.indexOf(s) > -1) break;
if (c = {
path: p,
zone: t,
zoneIdx: g
}, n(s, c), i(g)) break;
}
}
}
}],
'CNN.DemandLoading.allLoaded': [{
prop: 'CNN.DemandLoading.allLoaded',
to: !1
}, {
prop: 'CNN.DemandLoading.allLoaded',
to: !0
}],
'CNN.DemandLoading.elements': [{
prop: 'CNN.DemandLoading.elements',
to: []
}, {
prop: 'CNN.DemandLoading.elements',
to: e(a)
}, {
prop: 'CNN.DemandLoading.elements',
to: s
}],
'CNN.DemandLoading.addElement': [{
prop: 'CNN.DemandLoading.addElement',
to: function(n) {
var i = 0,
o = e("img", n);
if (0 === o.length && (o = e(n)), o.length > 0)
for (CNN.DemandLoading.allLoaded = !1, t(o), i = 0; i < o.length; i++)
CNN.DemandLoading.elements.push(o[i]);
return CNN.DemandLoading.process();
}
}],
'CNN.DemandLoading.update': [{
prop: 'CNN.DemandLoading.update',
to: function() {
var t = !1,
n = CNN.CurrentScrollTop.getClientScrollTop() + e(document)
.height() + d;
return n > l && (l = n, l >= e(document)
.height() && (CNN.DemandLoading.pageBottom = !0), t = CNN.DemandLoading
.process()), t;
}
}],
'CNN.DemandLoading.process': [{
prop: 'CNN.DemandLoading.process',
to: function() {
var n, i, o, s, r, d = [];
if (0 === CNN.DemandLoading.elements.length && (CNN.DemandLoading
.elements = e(a)), n = CNN.DemandLoading.elements, i = n.length ||
0, 0 === i) CNN.DemandLoading.allLoaded = !0;
else {
for (s = [], o = 0; i > o; o++) r = e(n[o]), r.offset() && r.offset()
.top <= l ? (t(r, !0), d.push(r[0])) : s.push(r[0]);
d.length > 0 && (CNN.DemandLoading.elements = s, CNN.DemandLoading
.allLoaded = !1);
}
return d;
}
}],
'CNN.DemandLoading.reProcess': [{
prop: 'CNN.DemandLoading.reProcess',
to: function() {
return CNN.DemandLoading.elements = e(a), CNN.DemandLoading.process();
}
}],
'CNN.DemandLoadConfig': [{
prop: 'CNN.DemandLoadConfig',
to: CNN.DemandLoadConfig || {}
}],
'CNN.DemandLoading.zoneImages[e]': [{
prop: 'CNN.DemandLoading.zoneImages[e]',
to: {
images: jQuery("#" + e + " img"),
count: 0
}
}],
'CNN.Columns.previous': [{
prop: 'CNN.Columns.previous',
to: CNN.Columns.current
}],
'CNN.Gallery': [{
prop: 'CNN.Gallery',
to: CNN.Gallery || {}
}],
'CNN.Carousel': [{
prop: 'CNN.Carousel',
to: CNN.Carousel || {
carouselSelector: ".js-owl-carousel",
events: {
initialize: "initialize.owl.carousel",
initialized: "initialized.owl.carousel",
loadedImage: "loaded.owl.lazy",
navigationInitialized: "initialized.owl.navigation",
destroy: "destroy.owl.carousel",
dragged: "dragged.owl.carousel",
change: "change.owl.carousel",
changed: "changed.owl.carousel",
resize: "resize.owl.carousel",
resized: "resized.owl.carousel",
refresh: "refresh.owl.carousel",
refreshed: "refreshed.owl.carousel",
to: "to.owl.carousel",
next: "next.owl.carousel",
prev: "prev.owl.carousel",
drag: "drag.owl.carousel"
},
refreshCarousels: function() {
jQuery(CNN.Carousel.carouselSelector)
.trigger(CNN.Carousel.events.refresh);
},
owl: function(e) {
var t = this,
n = 30;
return this.$carousel = jQuery(e), this.$filmstrip = this.$carousel
.next(".js-owl-filmstrip"), this.isPaginatedCarousel =
this.$carousel.hasClass("carousel-small-paginated"), this
.isGallery = this.$filmstrip.length > 0 || this.isPaginatedCarousel,
this.isAutoHeight = this.isGallery || this.$carousel.is(
'[data-auto-height="true"]'), this.galleryHeightRatio =
null, this.isFullCarousel = this.$carousel.is(
".carousel--full"), this.isLargeStripCarousel = this.$carousel
.is(".carousel-large-strip"), this.hasSingleItem = 1 ===
this.$carousel.data("slide-count"), jQuery.extend(this.$filmstrip,
this), jQuery.extend(this.$carousel, this), this.carouselAdjustNavigation =
function(e) {
var i = "4:3" === t.$carousel.data("cut-format") ? .75 :
"9:16" === t.$carousel.data("cut-format") ? 16 / 9 :
9 / 16,
o = t.$carousel.find(".owl-item")
.find(".el__resize, .media")
.width() * i,
s = o / 2 - n,
a = t.$carousel.find(".owl-prev, .owl-next");
"true" === t.$carousel.attr("data-is-gallery") ? a.css(
"top", s + "px") : a.css("height", o + "px"), t.$carousel
.siblings(".ad-slide")
.find(".ad-slide__prev, .ad-slide__next")
.css("top", s + "px");
}, this.makeLazy = function(e) {
e.find("img")
.each(function() {
var e, t = jQuery(this),
n = (t.attr("data-eq-state") || "")
.replace(/^(\\S+\\s+)*/, "");
e = n ? "xsmall" === n ? "data-src-small" :
"data-src-" + n : "src", t.attr("data-src", t.attr(
e))
.addClass("owl-lazy");
});
}, this.setNumberOfItems = function(e) {
var t, n = e.relatedTarget;
if (0 !== n._widths[0]) return t = n.settings.items > 1 ?
n.$element.width() / n._widths[0] : n.settings.items,
t > 1 && (n.settings.items = Math.ceil(t), n.settings
.slideBy = Math.floor(t), n.$element.trigger(CNN.Carousel
.events.refresh)), t;
}, this.resetThumbnails = function(e) {
var n = t.$filmstrip.find(".owl-item");
n.find("img")
.css("opacity", 1);
}, this.setAspectRatio = function() {
function e(e) {
if (!e) return 1;
var t = /\\d+:\\d+/.exec(e.data("cutFormat")) || [];
return t = (t[0] || "16:9")
.split(":"), t = t[1] / t[0] * 100;
}
t.$carousel.data("gallery-ratio-set") || (t.$carousel.data(
"gallery-ratio-set", !0), t.galleryHeightRatio =
e(t.$carousel), t.$carousel.find(
".js-gallery-aspect-ratio-wrapper")
.css("padding-bottom", t.galleryHeightRatio + "%"),
t.$carousel.find("[data-cut-format]")
.each(function() {
var t = jQuery(this),
n = e(this.$carousel);
n < this.galleryHeightRatio ? t.css("padding",
(this.galleryHeightRatio - n) / 2 + "% 0") :
n > this.galleryHeightRatio && t.css(
"padding", "0 " + (1 - this.galleryHeightRatio /
n) / 2 * 100 + "%");
}));
}, this.stagePadding = function() {
var e, n;
if (t.isFullCarousel && !t.isGallery) switch (n = (
jQuery("body")
.attr("data-eq-state") || "")
.replace(/^(\\S+\\s+)*/, "")) {
case "xsmall":
e = 50;
break;
case "medium":
e = 100;
break;
case "large":
case "full16x9":
e = 150;
} else e = 0;
return e;
}, this.onResize = function(e) {
e.relatedTarget.options.stagePadding = t.stagePadding(),
t.$carousel.trigger(CNN.Carousel.events.refresh);
}, this.onMainCarouselChange = function(e) {
"position" === e.property.name && t.$filmstrip.data() &&
setTimeout(function() {
var n = e.property.value - e.relatedTarget.clones()
.length / 2,
i = t.$filmstrip.data("owl.carousel")
._items.length - 1,
o = t.$filmstrip.find(".owl-item");
n = -1 === n ? i : n > i ? 0 : n, o.removeClass(
"synced"), t.isGallerySlide() && (o.eq(n)
.addClass("synced"), t.$filmstrip.trigger(CNN
.Carousel.events.to, [n]));
}, 0);
}, this.onLazyImageLoaded = function(e) {
CNN.ResponsiveImages.process(CNN.DemandLoading.addElement(
e.element));
}, this.onRefreshed = function(e) {
CNN.ResponsiveImages.queryEqjs(e.target);
}, this.onInitialized = function(e) {
t.setNumberOfItems(e), t.$carousel.on(CNN.Carousel.events
.changed, t.onMainCarouselChange), t.$carousel.on(
CNN.Carousel.events.resized, t.carouselAdjustNavigation
), t.$carousel.on(CNN.Carousel.events.resized, t.setNumberOfItems),
t.$carousel.on(CNN.Carousel.events.resized, t.resetThumbnails),
t.$carousel.on(CNN.Carousel.events.resized, t.onResize),
t.$carousel.on(CNN.Carousel.events.refreshed, t.onRefreshed),
t.$carousel.on(CNN.Carousel.events.refreshed, t.carouselAdjustNavigation),
t.$carousel.on(CNN.Carousel.events.loadedImage,
function(e) {
t.onLazyImageLoaded(e), t.onRefreshed(e), t.resetThumbnails(
e);
});
}, this.addAnalyticsListeners = function(e) {
t.$carousel.find(".owl-nav > div")
.on("click", function(e) {
t.$carousel.trigger("carousel-action-event");
}), t.$carousel.on(CNN.Carousel.events.dragged,
function(e) {
t.$carousel.trigger("carousel-action-event");
});
}, this.isGallerySlide = function() {
return !!t.$carousel.find(
".owl-item.active > div[data-slidename]")
.length;
}, this.makeLazy(this.$carousel), this.setAspectRatio(),
this.$carousel.on(CNN.Carousel.events.initialized, this.onInitialized),
this.$carousel.on(CNN.Carousel.events.navigationInitialized,
this.carouselAdjustNavigation), this.$carousel.on(CNN.Carousel
.events.navigationInitialized, this.addAnalyticsListeners
), this.$carousel.owlCarousel({
addClassActive: !0,
nav: !0,
navText: ["", ""],
dots: this.isPaginatedCarousel,
lazyLoad: !0,
transitionStyle: this.isGallery ? "fadeIn" : !1,
slideBy: this.isFullCarousel ? 1 : "page",
slideSpeed: 300,
responsive: this.$carousel.hasClass("carousel--fixed") ?
!1 : {},
responsiveBaseWidth: this.$carousel[0],
autoWidth: !this.isFullCarousel,
autoHeight: this.isAutoHeight,
items: this.isFullCarousel ? 1 : 3,
stagePadding: this.stagePadding(),
margin: this.isFullCarousel && !this.isGallery ? 20 : 0,
loop: !this.isPaginatedCarousel || !this.hasSingleItem,
mouseDrag: !this.hasSingleItem,
touchDrag: !this.hasSingleItem
}), this.isGallery && !this.isPaginatedCarousel && (this.reBindBigCarousel =
function(e) {
"position" === e.property.name && (t.$carousel.trigger(
"carousel-action-event"), t.$carousel.off(CNN.Carousel
.events.changed, t.reBindBigCarousel), t.$carousel
.on(CNN.Carousel.events.changed, t.onMainCarouselChange)
);
}, this.enableLastItem = function(e) {
var n = e.relatedTarget,
i = n.settings.items,
o = Math.abs(n._coordinates.slice(-1)[0]),
s = n._width,
a = n._widths[0],
r = Math.ceil((o - s) / a);
o > s && a > 0 && (t.resetThumbnails(e), n.settings.items =
i > 1 ? Math.floor(s / a) : i, n._coordinates[r -
1] = s % a - a * r, n.maximum = function(e) {
var t = this.settings,
i = this._width,
o = this._coordinates.length,
s = this._current > 0 ? this._coordinates[
this._current - 1] : 0,
a = Math.abs(n._coordinates.slice(-1)[0]) - (
i - s);
return o = t.loop ? this._clones.length / 2 +
this._items.length - 1 : t.autoWidth || t.merge ?
Math.ceil((a > i ? i - s : a - s) / this._widths[
0]) : t.center ? this._items.length - 1 :
this._items.length - t.items, e && (o -= this
._clones.length / 2), Math.max(o, 0);
});
}, this.onFilmstripChange = function(e) {
if ("items" === e.property.name) {
var n = t.$filmstrip.find(".synced")
.index() < e.item.index ? e.item.index : t.$filmstrip
.find(".synced")
.index();
t.$filmstrip.find(".owl-item")
.removeClass("synced"), t.$filmstrip.find(
".owl-item")
.eq(n)
.addClass("synced"), t.$carousel.trigger(CNN.Carousel
.events.to, [n]);
}
}, this.onFilmstripItemClicked = function(e) {
var n = jQuery(e.currentTarget)
.index(),
i = t.$filmstrip.find(".owl-item");
i.eq(n)
.hasClass("synced") || (i.removeClass("synced"), i.eq(
n)
.addClass("synced"), t.$carousel.off(CNN.Carousel
.events.changed, t.onMainCarouselChange), t.$carousel
.on(CNN.Carousel.events.changed, t.reBindBigCarousel),
t.$carousel.on(CNN.Carousel.events.changed, t.resetThumbnails),
t.$carousel.trigger(CNN.Carousel.events.to, [n]));
}, this.onFilmstripInit = function(e) {
t.setNumberOfItems(e), t.enableLastItem(e), t.$filmstrip
.find(".owl-item")
.eq(0)
.addClass("synced"), t.$filmstrip.on("click",
".owl-item", t.onFilmstripItemClicked), t.$filmstrip
.on(CNN.Carousel.events.changed, t.onFilmstripChange),
t.$filmstrip.on(CNN.Carousel.events.resized, t.setNumberOfItems),
t.$filmstrip.on(CNN.Carousel.events.resized, t.enableLastItem),
t.$filmstrip.on(CNN.Carousel.events.refreshed, t.enableLastItem);
}, this.makeLazy(this.$filmstrip), this.$filmstrip.on(
CNN.Carousel.events.initialized, this.onFilmstripInit
), this.$filmstrip.owlCarousel({
items: 10,
autoWidth: !0,
lazyLoad: !0,
loop: !1,
nav: !0,
dots: !1,
navText: ["", ""],
responsiveRefreshRate: 100
})), this;
},
restore: function(e) {
var t, n =
".cn-collection-player.el__videoexperience__collection,.el__leafmedia--video-leaf-player.el__videoexperience__collection";
CNN.Features.enableVideoExperienceUnification ? jQuery(CNN.Carousel
.carouselSelector, e)
.each(function() {
return t = jQuery(this), t.parents(n)
.length > 0 ? void Modernizr.on("phone", function(e) {
function n(e) {
CNN.Videx && (clearInterval(e.interval), CNN.Videx
.SeeMore.init(t));
}
var i = {
interval: 0
};
return e ? (CNN.Carousel.manualImageLoad(t),
void(CNN.Videx ? CNN.Videx.SeeMore.init(t) :
i.interval = setInterval(jQuery.proxy(n,
window, i), 250))) : new CNN.Carousel.owl(
t);
}) : new CNN.Carousel.owl(this);
}) : jQuery(CNN.Carousel.carouselSelector, e)
.each(function() {
return new CNN.Carousel.owl(this);
});
},
manualImageLoad: function(e) {
e.find("img")
.each(function() {
var e, t = jQuery(this),
n = (t.attr("data-eq-state") || "")
.replace(/^(\\S+\\s+)*/, "");
e = n ? "xsmall" === n ? "data-src-small" :
"data-src-" + n : "src", t.attr("data-src", t.attr(
e))
.addClass("owl-lazy"), CNN.ResponsiveImages.process(
CNN.DemandLoading.addElement(t));
}), CNN.ResponsiveImages.queryEqjs(e);
},
init: function(e) {
CNN.Carousel.restore(e), jQuery(window)
.throttleEvent("resize", function() {
jQuery(CNN.Carousel.carouselSelector)
.trigger(CNN.Carousel.events.refresh);
}, 100), jQuery(window)
.on("orientationchange", function() {
jQuery(CNN.Carousel.carouselSelector)
.trigger(CNN.Carousel.events.refresh);
});
}
}
}, {
prop: 'CNN.Carousel',
to: CNN.Carousel || {}
}],
'CNN.ads': [{
prop: 'CNN.ads',
to: CNN.ads || {}
}],
'CNN.ads.events': [{
prop: 'CNN.ads.events',
to: CNN.ads.events || function() {
function e(e, t) {
var i;
"undefined" != typeof e && "undefined" != typeof window.AMPTManager &&
jQuery(e.target)
.parents(t.galleryParent)
.length && CNN.contentModel.pageType === t.pageType && CNN.Features
.enableEpicAds === !0 && (n++, i = t.adId || jQuery(t.toolParent)
.find(t.tool + ":first-child div")
.attr("id"), n % 2 === 0 && window.AMPTManager.refreshAd(
i));
}
function t(t) {
var n = {
adId: "ad_rect_atf_01",
pageType: "article",
galleryParent: ".zn-large-media",
toolParent: ".pg-rail",
tool: ".ad-desktop"
};
t = t || null, e(t, n);
}
var n = 0;
return {
refreshGalleryRailAd: t
};
}()
}],
'CNN.ResponsiveImages': [{
prop: 'CNN.ResponsiveImages',
to: {}
}],
'CNN.ResponsiveImages.process': [{
prop: 'CNN.ResponsiveImages.process',
to: function(t) {
function n(e, t) {
var n, a, r, d = o.filter(e)
.filter(i)
.not(s);
for (r = 0, a = d.length; a > r; r++) n = d.eq(r), n.attr(
"src", n.data(t));
s = s.add(d);
}
var i = "[data-demand-load=loaded]",
o = e(t),
s = e();
n(
'.cd--horizontal[data-eq-state$="xsmall"] img[data-src-mini1x1], .cd--horizontal[data-eq-state$="small"] img[data-src-mini1x1]',
"src-mini1x1"), n(
'.zn[data-eq-state$="full16x9"] .zn-top img[data-src-full16x9]',
"src-full16x9"), n(
'img[data-eq-state$="mini"][data-src-mini]', "src-mini"), n(
'img[data-eq-state$="xsmall"][data-src-xsmall]',
"src-xsmall"), n(
'img[data-eq-state$="small"][data-src-small]', "src-small"),
n('img[data-eq-state$="medium"][data-src-medium]',
"src-medium"), n(
'img[data-eq-state$="large"][data-src-large]', "src-large");
}
}],
'CNN.ResponsiveImages.queryEqjs': [{
prop: 'CNN.ResponsiveImages.queryEqjs',
to: function(n) {
var i = CNN.Utils.existsObject(n),
o = i ? e(n)
.filter("[data-eq-pts]") : e("[data-eq-pts]"),
s = [];
i && 0 === o.length && (o = e(n)
.find("[data-eq-pts]")), s = o instanceof jQuery ? o.toArray() :
o, 0 !== s.length && t.query(s, function() {
CNN.DemandLoading.allLoaded || CNN.DemandLoading.update(),
o.length > 0 && CNN.ResponsiveImages.process(o);
});
}
}],
'CNN.ResponsiveImages.scroll': [{
prop: 'CNN.ResponsiveImages.scroll',
to: function() {
if (CNN._zonesAndDomReadyEvent && (CNN.DemandLoading.pageBottom ||
CNN.DemandLoading.allLoaded)) e(window)
.off("scroll.responsiveImages");
else {
var t = CNN.DemandLoading.update();
t.length > 0 && CNN.ResponsiveImages.process(t);
}
}
}],
'CNN.ResponsiveImages.reload': [{
prop: 'CNN.ResponsiveImages.reload',
to: function() {
var e = CNN.DemandLoading.reProcess();
e.length > 0 && CNN.ResponsiveImages.process(e);
}
}],
'CNN.ResponsiveImages.processChildrenImages': [{
prop: 'CNN.ResponsiveImages.processChildrenImages',
to: function(e) {
var n = CNN.contentModel && "boolean" == typeof CNN.contentModel
.lazyLoad ? CNN.contentModel.lazyLoad : !1,
i = CNN.contentModel && "boolean" == typeof CNN.contentModel.enablePictureFill ?
CNN.contentModel.enablePictureFill : !1;
n && i ? window.picturefill && picturefill() : t.query(e.querySelectorAll(
"[data-eq-pts]"), function(e) {
e.length > 0 && CNN.ResponsiveImages.process(e);
});
}
}],
'CNN.ResponsiveImages.resize': [{
prop: 'CNN.ResponsiveImages.resize',
to: function() {
CNN.ResponsiveImages.queryEqjs(document);
}
}],
'CNN.LocatorMap': [{
prop: 'CNN.LocatorMap',
to: function(t) {
"undefined" != typeof t && "undefined" != typeof t.id && (a.data =
t, a.$mapCanvas = e(n.getElementById("mapToolCanvas-" + a.data
.id)), o());
}
}],
'CNN.VideoAjax': [{
prop: 'CNN.VideoAjax',
to: CNN.VideoAjax || function() {
return function(e) {
var t = {},
n = {
id: "VideoAjax",
eventName: "CNN_VideoAjax_autoUpdated",
ajaxFrequency: 3e5
};
return t.config = jQuery.extend({}, n, e), t.autoUpdateEvent =
jQuery.Event(t.config.eventName), t.fetchOnNowTimer =
null, t.isFetching = !1, t.serverData = null, t.logError =
function(e, t) {
if ("undefined" != typeof t) throw t;
throw e;
}, t.updateOnNowData = function() {
this.fetchExternalData(jQuery.proxy(function(e) {
this.serverData = e, jQuery(document)
.trigger(this.autoUpdateEvent);
}, this));
}, t.id = t.config.id, t.init = function() {
this.updateOnNowData(), this.startPeriodicFetch();
}, t.stopPeriodicFetch = function() {
null !== this.fetchOnNowTimer && (clearInterval(this.fetchOnNowTimer),
this.fetchOnNowTimer = null);
}, t.startPeriodicFetch = function() {
null === this.fetchOnNowTimer && (this.fetchOnNowTimer =
setInterval(jQuery.proxy(this.updateOnNowData, this),
this.config.ajaxFrequency));
}, t.fetchExternalData = function() {
throw "fetchExternalData in the ajax was intended to be overridden.";
}, t.filterNetwork = function(e) {
var t = 0,
n = null;
if ("undefined" != typeof this.serverData && null !==
this.serverData) {
for (t = this.serverData.channel.length - 1; t >= 0; t--)
if (this.serverData.channel[t].id.toLowerCase() ===
e.toLowerCase()) {
n = this.serverData.channel[t];
break;
}
return n;
}
}, t.getServerData = function() {
return this.serverData;
}, t.getEventName = function() {
return this.config.eventName;
}, t.getIsFetching = function() {
return this.isFetching;
}, t.setIsFetching = function(e) {
this.isFetching = e;
}, t;
};
}()
}],
'CNN.VideoAjax.NowPlaying': [{
prop: 'CNN.VideoAjax.NowPlaying',
to: CNN.VideoAjax.NowPlaying || function() {
var e = CNN.VideoAjax({
id: "NowPlaying",
eventName: "CNN_NowPlaying_autoUpdated"
});
return e.fetchExternalData = function(t) {
if (e.getIsFetching() !== !0) {
if ("undefined" == typeof t || "function" != typeof t)
throw "callback parameter is not defined or is not a function. Ajax request was not sent.";
e.setIsFetching(!0), jQuery.ajax({
url: "/web/20160903014131/http://data.cnn.com/jsonp/video/nowPlayingSchedule.json",
type: "get",
error: function(t, n) {
e.logError(t, n);
},
success: function(e) {
t(e);
},
timeout: function(t, n) {
e.logError(t, n);
},
complete: function() {
e.setIsFetching(!1);
},
dataType: "jsonp",
jsonpCallback: "nowPlayingScheduleCallbackWrapper"
});
}
}, e;
}()
}],
'CNN.VideoAjax.LiveStream': [{
prop: 'CNN.VideoAjax.LiveStream',
to: CNN.VideoAjax.LiveStream || function() {
var e = CNN.VideoAjax({
id: "LiveStream",
eventName: "CNN_LiveEvent_autoUpdated"
});
return e.fetchExternalData = function(t) {
function n(t) {
return jQuery.ajax({
url: "/CNNLiveFlash/StreamStatus/metadata/stream_dvr_" +
t + ".xml",
type: "get",
error: function(t, n) {
e.logError(t, n);
},
success: function(e) {
o["live" + t] = {
xml: e,
thumbnail: void 0,
isStreaming: !1
};
},
timeout: function(t, n) {
e.logError(t, n);
},
dataType: "xml",
crossDomain: !1
});
}
function i() {
var e, t = [],
n = {};
for (e in o) e in o && "undefined" != typeof o[e].isStreaming &&
o[e].isStreaming !== !1 && (n = jQuery(o[e].xml)
.find("stream")
.first(), t.push({
id: o[e].id,
url: n.find("affiliate url")
.text(),
kicker: n.find("affiliate headline")
.text(),
program: n.find("title")
.text(),
images: {
"120x68": o[e].thumbnail
},
description: n.find("description")
.text(),
streamIndex: o[e].index
}));
return t.sort(function(e, t) {
return parseInt(e.streamIndex, 10) - parseInt(t.streamIndex,
10);
}), {
channel: t
};
}
var o = {};
if (e.getIsFetching() !== !0) {
if ("undefined" == typeof t || "function" != typeof t)
throw "callback parameter is not defined or is not a function. Ajax request was not sent.";
e.setIsFetching(!0), jQuery.when(n(1), n(2), n(3), n(4))
.done(function() {
jQuery.ajax({
url: "/.element/ssi/www/auto/2.0/video/xml/pipeline.xml",
type: "get",
error: function(t, n) {
e.logError(t, n);
},
success: function(n) {
var s = 0,
a = "",
r = jQuery(n)
.find("video");
for (s = r.length - 1; s >= 0; s--) a =
parseInt(r.eq(s)
.find("video_url")
.text()
.substring(7), 10), isNaN(a) || (o[
"live" + a].id = "live-" + a, o[
"live" + a].thumbnail = r.eq(s)
.find("image_url")
.text(), o["live" + a].isStreaming = !
0, o["live" + a].streamIndex = a);
e.setIsFetching(!1), t(i());
},
timeout: function(t, n) {
e.logError(t, n);
},
dataType: "xml",
crossDomain: !1
});
});
}
}, e;
}()
}],
'CNN.Features': [{
prop: 'CNN.Features',
to: CNN.Features || {}
}],
'CNN.VideoEndSlateBase': [{
prop: 'CNN.VideoEndSlateBase',
to: function(e, t) {
this.endSlateFlag = "boolean" == typeof t ? t : "boolean" ==
typeof CNN.Features.enableVideoEndSlate ? CNN.Features.enableVideoEndSlate :
!0, this.containerId = e, this.initialize();
}
}],
'CNN.VideoEndSlateBase.extend': [{
prop: 'CNN.VideoEndSlateBase.extend',
to: function(e, t) {
var n, i = t.prototype;
t.prototype = Object.create(e.prototype);
for (n in i) t.prototype[n] = i[n];
t.prototype.constructor = t;
try {
Object.defineProperty(t.prototype, "constructor", {
enumerable: !1,
value: t
});
} catch (o) {}
}
}],
'CNN.VideoEndSlateBase.prototype': [{
prop: 'CNN.VideoEndSlateBase.prototype',
to: {
getVideoPlayerContainerId: function() {
return this.containerId;
},
renderRecommendedVideos: function(e, t) {
function n(e) {
return e.stopPropagation(), e.preventDefault(), !1;
}
var i = e.data("owl.carousel");
this.setResponsiveState(), e.empty()
.append(t), e.on(CNN.Carousel.events.change, n), e.on(CNN.Carousel
.events.changed, n), e.on(CNN.Carousel.events.drag, n), e
.on(CNN.Carousel.events.initialize, n), e.on(CNN.Carousel.events
.initialized, n), e.on(CNN.Carousel.events.resized, n), e
.on(CNN.Carousel.events.navigationInitialized, n),
"undefined" != typeof i && i.destroy(), e.owlCarousel({
mouseDrag: !0,
touchDrag: !0,
nav: !0,
navText: ["", ""],
dots: !1,
autoWidth: !0,
autoHeight: !0,
margin: 20,
rewindNav: !0,
responsive: !1,
scrollPerPage: !1,
items: 3,
itemsDesktop: [1100, 3],
itemsDesktopSmall: [900, 3],
itemsTablet: [600, 2],
itemsMobile: !1,
loop: !0
});
},
getRecommendedVideos: function(e) {
var t, n = this.getRelatedContentUrl(),
i = "end-slate-carousel" + Math.floor(100 * Math.random());
return t = n.substring(n.indexOf("/video/data/3.0")), jQuery.Deferred(
function(n) {
jQuery.ajax({
url: t,
type: "GET",
dataType: "json",
error: function(e, t, n) {
"undefined" != typeof console && console.log(
n);
},
success: function(t) {
var o = {
relatedVideos: {
id: i,
containerContents: [],
layout: "carousel-medium-strip",
type: "container"
}
};
"undefined" != typeof t && null !== t &&
"undefined" != typeof t.videos && (jQuery(t
.videos)
.each(function(e, t) {
o.relatedVideos.containerContents.push({
cardContents: {
headlineText: t.headline,
iconType: "video",
media: {
contentType: "image",
cutFormat: "16:9",
duration: t.duration,
elementContents: {
imageAlt: t.headline,
imageUrl: t.thumbnail_url,
cuts: {
small: {
uri: t.endslate_url_small
},
medium: {
uri: t.endslate_url_medium
},
large: {
uri: t.endslate_url_large
}
},
type: "element"
}
},
type: "card",
url: t.clickback_url.substring(
"/video/?/video")
.replace("/video/?/video",
"/videos"),
videoId: t.id
},
contentType: "video",
type: "card"
});
}), dust.render(
"views/pages/common/video-end-slate-carousel",
o,
function(t, n) {
e.push(n);
})), n.resolve();
}
});
})
.promise();
},
setCurrentVideoHeadline: function(e) {
var t, n = this.getEndSlateForContainer(this.getContainerId()),
i = JSON.parse(e);
"undefined" != typeof n && n && (t = jQuery(n)
.find(".js-cd__headline-text"), t && t.text(i.headline));
},
fetchAndShowRecommendedVideos: function(e, t) {
var n, i = [],
o =
".js-video__end-slate__tertiary .js-video__end-slate__carousel";
t = t || !0, this.$videoEndSlate = this.getEndSlateForContainer(),
this.setCurrentVideoHeadline(e), n = this.$videoEndSlate.find(
o), this.setRelatedContentUrl(e), t && this.fetchRecommendedVideos(
n, i);
},
fetchRecommendedVideos: function(e, t) {
var n = this;
jQuery.when(this.getRecommendedVideos(t))
.done(function() {
n.renderRecommendedVideos(e, t);
});
},
destroy: function() {
var e = this.getCurrentCarousel(),
t = e.data("owl.carousel");
this.hideEndSlateForContainer(), e.empty(), "undefined" !=
typeof t && t.destroy();
},
getCurrentCarousel: function() {
var e, t =
".js-video__end-slate__tertiary .js-video__end-slate__carousel";
return this.$videoEndSlate = this.getEndSlateForContainer(),
e = this.$videoEndSlate.find(t);
},
setResponsiveState: function(e) {
e = e || !1, "undefined" != typeof this.getContainerId() &&
"undefined" == typeof $videoEndSlate && (this.$videoEndSlate =
this.getEndSlateForContainer()), eqjs.query(this.$videoEndSlate),
e && this.showEndSlateForContainer();
},
getContainerId: function() {
return this.containerId;
},
onReplayClickedHandler: function() {
var e = this.getEndSlateForContainer();
e.removeClass("video__end-slate--active")
.addClass("video__end-slate--inactive"), window.cnnVideoManager
.getPlayerByContainer(this.getVideoPlayerContainerId())
.replay();
},
initialize: function() {
this.addEventListeners();
},
addEventListeners: function() {
var e = this.getEndSlateForContainer();
e.on("click", ".js-video__end-slate__replay", jQuery.proxy(
this.onReplayClickedHandler, this)), e.on("click",
".js-video__end-slate__replay-text", jQuery.proxy(this.onReplayClickedHandler,
this)), e.on("click", ".js-el__video__replayer-wrapper",
jQuery.proxy(this.onReplayClickedHandler, this));
},
removeEventListeners: function() {
var e = this.getEndSlateForContainer();
e.off("click", ".js-video__end-slate__replay"), e.off("click",
".js-video__end-slate__replay-text");
},
handleShowEndSlate: function(e) {
"undefined" != typeof e && null !== e && (this.setResponsiveState(),
e.removeClass("video__end-slate--inactive")
.addClass("video__end-slate--active"));
},
handleHideEndSlate: function(e) {
"undefined" != typeof e && null !== e && (this.setResponsiveState(),
e.removeClass("video__end-slate--active")
.addClass("video__end-slate--inactive"));
},
hideEndSlateForContainer: function() {
var e = this.getEndSlateForContainer();
this.handleHideEndSlate(e);
},
showEndSlateForContainer: function() {
var e = this.getEndSlateForContainer();
this.handleShowEndSlate(e);
},
setRelatedContentUrl: function(e) {
var t;
t = JSON.parse(e), this.relatedContentUrl = t.relatedVideosJson;
},
getRelatedContentUrl: function() {
return this.relatedContentUrl;
},
getEndSlateElement: function() {
return this.$videoEndSlate;
},
isEndSlateEnabled: function() {
return this.endSlateFlag;
}
}
}],
'CNN.VideoEndSlate': [{
prop: 'CNN.VideoEndSlate',
to: function(e, t) {
this.relatedContentUrl = "", this.$videoEndSlate = {}, CNN.VideoEndSlateBase
.call(this, e, t);
}
}],
'CNN.VideoEndSlate.prototype': [{
prop: 'CNN.VideoEndSlate.prototype',
to: {
getEndSlateForContainer: function() {
var e = jQuery(document.getElementById(this.getContainerId()))
.parent()
.find(".js-video__end-slate")
.eq(0);
return e;
}
}
}],
'CNN.JumbotronVideoEndSlate': [{
prop: 'CNN.JumbotronVideoEndSlate',
to: function(e, t) {
this.jumbotron = e, this.mode = t || "desktop", CNN.VideoEndSlate
.call(this, jQuery(e.jumbotronElementRaw)
.attr("id"), !0);
}
}],
'CNN.JumbotronVideoEndSlate.prototype': [{
prop: 'CNN.JumbotronVideoEndSlate.prototype',
to: {
addEventListeners: function() {
CNN.VideoEndSlateBase.prototype.addEventListeners.call(this),
"undefined" != typeof this.jumbotron && (jQuery(this.jumbotron
.jumbotronElementRaw)
.on("CVPEvent", jQuery.proxy(this.onVideoEventHandler,
this)), jQuery(this.jumbotron)
.on("jumbotron-item-selected", jQuery.proxy(this.hideEndSlateForContainer,
this)), jQuery(this.jumbotron)
.on("jumbotron-mode-change", jQuery.proxy(this.onJumbotronModeChangeHandler,
this)));
},
removeEventListeners: function() {
CNN.VideoEndSlateBase.prototype.removeEventListeners.call(
this), "undefined" != typeof this.jumbotron && (jQuery(
this.jumbotron.jumbotronElementRaw)
.off("CVPEvent"), jQuery(this.jumbotron)
.off("jumbotron-item-selected"), jQuery(this.jumbotron)
.off("jumbotron-mode-change"));
},
onJumbotronModeChangeHandler: function(e, t) {
this.mode = t, this.destroy();
},
onVideoEventHandler: function(e, t) {
if (t && t.eventType) switch (t.eventType) {
case "onContentMetadata":
this.fetchAndShowRecommendedVideos(t.metadata, "mobile" !==
this.mode);
break;
case "onContentComplete":
this.showEndSlateForContainer();
break;
case "onContentPlay":
this.hideEndSlateForContainer();
}
},
getVideoPlayerContainerId: function() {
try {
var e = jQuery(jQuery(document.getElementById(this.getContainerId()))
.find(".js-jumbotron-video-player")
.eq(0));
return e.attr("id");
} catch (t) {
return this.containerId;
}
},
getEndSlateForContainer: function() {
var e = jQuery(document.getElementById(this.getContainerId()))
.find(".js-video__end-slate")
.eq(0);
return e;
}
}
}],
'CNN.VideoConfig': [{
prop: 'CNN.VideoConfig',
to: CNN.VideoConfig || {}
}],
'CNN.VideoPlayer': [{
prop: 'CNN.VideoPlayer',
to: CNN.VideoPlayer || {}
}],
'CNN.VideoPlayer.SimpleEmbedCodeCopy': [{
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy',
to: function(e, t, n) {
this.videoContainerId = e, this.embedDivId = t, this.parentElement =
jQuery(n);
}
}],
'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype': [{
prop: 'CNN.VideoPlayer.SimpleEmbedCodeCopy.prototype',
to: {
onSuccessfulCopy: function() {
"undefined" != typeof this.parentElement && (this.parentElement
.find(".metadata__embed-video-confirmation")
.remove(), this.parentElement.append(
'<span class="metadata__embed-video-confirmation"><p>Embed Code copied successfully</p></span>'
), setTimeout(jQuery.proxy(function() {
jQuery(this.parentElement.find(
".metadata__embed-video-confirmation"))
.slideUp(500);
}, this), 3e3));
},
generateEmbedContainer: function() {
"undefined" != typeof this.parentElement && (this.parentElement
.find(this.getEmbedContainerId())
.remove(), this.movieDivId = this.getEmbedContainerId() +
"--movie", this.parentElement.append(
'<span class="metadata__embed-video-button" id="' +
this.getEmbedContainerId() + '"><div id="' + this.movieDivId +
'"/></span>'));
},
getEmbedContainer: function() {
var e = this.getEmbedContainerId();
return jQuery("#" + e);
},
getEmbedContainerId: function() {
return this.embedDivId;
},
getVideoContainerId: function() {
return this.videoContainerId;
},
show: function(e) {
var t, n, i, o = "successCallback" + this.getVideoContainerId(),
s = this.getEmbedContainer();
t = window[o] = jQuery.proxy(this.onSuccessfulCopy, this),
"object" == typeof e && "undefined" != typeof e.isEmbeddable &&
"false" !== e.isEmbeddable && "no" !== e.isEmbeddable && s &&
"undefined" != typeof CVP && "undefined" != typeof CNN.VideoConfig
.embedLinks && "undefined" != typeof CNN.VideoConfig.embedLinks
.clipboardOperationsSWF ? (n = CNN.VideoConfig.embedLinks.embedLinkPattern,
n = n.replace("{host}", window.location.hostname)
.replace("{videoId}", e.id), i = CNN.VideoConfig.embedLinks
.buttonImage, i = i.replace("{cdnassetpath}",
"/web/20160903014131/http://www.i.cdn.cnn.com/.a")
.replace("{build}", "1.292.4"), (!Array.isArray(s) || s.length <=
0) && this.generateEmbedContainer(), CVP.swfobject.embedSWF(
CNN.VideoConfig.embedLinks.clipboardOperationsSWF, this
.movieDivId, "80px", "21px", "10.0.0", CNN.VideoConfig.embedLinks
.clipboardOperationsSWF + "?nocache=" + new Date()
.valueOf(), {
callback: 'window["' + o + '"]',
buttonImage: i,
copyValue: n,
xOffset: CNN.VideoConfig.embedLinks.imageButtonXOffset,
yOffset: CNN.VideoConfig.embedLinks.imageButtonYOffset
}, {
allowScriptAccess: "always",
quality: "high",
wmode: "transparent"
}, {})) : this.hide();
},
hide: function() {
this.getEmbedContainer() && this.getEmbedContainer()
.remove();
}
}
}],
'CNN.Feeds': [{
prop: 'CNN.Feeds',
to: CNN.Feeds || {}
}],
'CNN.EditionPrefs': [{
prop: 'CNN.EditionPrefs',
to: CNN.EditionPrefs || function(e) {
function t() {
n(), i();
}
function n() {
l.on("click", ".js-edition-preferences__confirm", s);
}
function i() {
jQuery(".js-edition-option")
.prop("checked", !1)
.filter('[data-type="' + m + '"]')
.prop("checked", !0), jQuery(
".js-edition-preferences__choice")
.prop("checked", !1)
.filter('[value="' + m + '"]')
.prop("checked", !0);
}
function o(e, t) {
a(e, c), CNN.EditionPicker.togglePicker(), CNN.EditionPicker.changeEdition(!
1, t);
}
function s(t) {
var n = e(t.currentTarget)
.parent(),
i = n.find("input")
.filter(":checked");
o(i.val(), i.parent());
}
function a(e, t) {
CNN.Utils.setCNNCookie(u, e, t);
}
function r() {
setTimeout(function() {
l.removeClass("list--set");
}, 0);
}
function d(t) {
e(t.currentTarget)
.closest(".js-edition-picker__list")
.addClass("list--set");
}
var l = e(".js-edition-picker__list"),
c = 854400,
u = "PreferredEdition",
h = "international" === CNN.contentModel.edition ? "edition" :
"www",
f = CNN.Utils.getCookie(u),
m = CNN.Utils.exists(f) ? f : h;
return t(), {
showPreferences: d,
hidePreferences: r,
indicateCurrentEdition: i
};
}(jQuery)
}],
'CNN.EditionPickerPrefs': [{
prop: 'CNN.EditionPickerPrefs',
to: CNN.EditionPickerPrefs || function(e) {
function t() {
n();
}
function n() {
jQuery(".js-edition-confirm")
.on("click", s);
}
function i(e, t) {
CNN.Utils.setCNNCookie(r, e, t);
}
function o(e, t) {
i(e, a), CNN.PlainNavigation.toggleEdition(!1), CNN.PlainNavigation
.changeEdition(!1, t);
}
function s(e) {
e.preventDefault();
var t = jQuery(e.target.form)
.children()
.filter("label")
.children()
.filter("input")
.filter(":checked");
o(t.data("type"), t);
}
var a = 854400,