define('app/core/stats/pageview/pubfilter',["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isReaderInteraction = exports.isCollectionOrReaderInteraction = void 0;
function isCollectionOrReaderInteraction(interaction) {
if (interaction.action.toPlace === 3 /* OTHER_COLLECTION */) {
return true;
}
if (interaction.action.fromPlace === 0 /* COLLECTION */ && interaction.action.toPlace === 7 /* READER_MAP */) {
return true;
}
if (interaction.action.fromPlace === 7 /* READER_MAP */ && interaction.action.toPlace === 0 /* COLLECTION */) {
return true;
}
if (isReaderInteraction(interaction)) {
return true;
}
return false;
}
exports.isCollectionOrReaderInteraction = isCollectionOrReaderInteraction;
function isReaderInteraction(interaction) {
if (interaction.action.fromPlace === 7 /* READER_MAP */ && interaction.action.toPlace === 9 /* READER_OTHER_MAP */) {
return true;
}
}
exports.isReaderInteraction = isReaderInteraction;
});
var FlashHeed = (function(window) {
var document = window.document;
var gsub = function(string, pattern, replacement) {
var result = '', source = string, match;
while (source.length > 0) {
if (match = source.match(pattern)) {
result += source.slice(0, match.index);
result += replacement;
source = source.slice(match.index + match[0].length);
} else {
result += source, source = '';
}
}
return result;
};
var heed = function(el) {
if(el === undefined || el === null) var el = document;
var objects = el.getElementsByTagName('object');
var len = objects.length;
var i;
for(i = 0; i < len; i++) {
var o = objects[i];
var params = o.getElementsByTagName('param');
var params_length = params.length;
var embeds = o.getElementsByTagName('embed');
var embed = null;
if(embeds.length > 0) var embed = embeds[0];
// Handle embed tag (for non-IE)
if(embed) {
// Need to set the embed wmode attribute
// In this case, we need to remove and re-add the child node
embed.setAttribute('wmode', 'transparent');
var nx = embed.nextSibling, pn = embed.parentNode;
pn.removeChild(embed);
pn.insertBefore(embed, nx);
}
// Handle param tags (for IE)
var correct_wmode_found = false;
var incorrect_wmode_found = false;
for(var j = 0; j < params_length; j++) {
if(params[j].name === 'wmode') {
if(/transparent/i.test(params[j].value) || /opaque/i.test(params[j].value)) {
// an existing wmode with "transparent" or "opaque" is found
correct_wmode_found = true;
} else {
incorrect_wmode_found = true;
}
}
}
if(!correct_wmode_found || incorrect_wmode_found) {
var html = o.outerHTML;
var nx = o.nextSibling, pn = o.parentNode;
// Do a string replacement for a window param that IE injects be default to the innerhtml
html = gsub(html, //i, '');
// Add the correct transparent wmode param
html = gsub(html, /<\/object>/i, '');
// Totally remove the object tag from the dom
pn.removeChild(o);
// Add it to our new div, only to clobber it immediately.
// This is the only way we've found to force IE to unrender the object.
// We use a new container for this because you can't mess with the innerhtml
// of an object tag. (throws a runtime error)
var div = document.createElement("div");
div.appendChild(o);
div.innerHTML = '';
// Update it with our new HTML that has the correct param tag
div.innerHTML = html;
// Finally, insert this new div back in the original spot
pn.insertBefore(div, nx);
}
}
}
return {
heed: heed
}
})(window);
define("flashheed", function(){});
///
///
///
///
define('app/pub/pubengine',["require", "exports", "app/core/stats/pageview/track/trackerenums", "app/core/stats/pageview/pubfilter", "app/pub/pubhelper", "app/pub/placeholder/placeholdermanager", "flashheed"], function (require, exports, te, pf, pl, pm) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pubsimple = void 0;
var pubsimple;
(function (pubsimple) {
class PubEngine {
constructor() {
this.adsHidden = false;
}
init(id) {
this.id = id;
this.placeholderManager = pm.placeholdermanager.get(this.sandbox);
this.pubHelper = pl.pubhelper.get(this.sandbox);
this.listenToEvents();
if (this.sandbox.isAcademicUser() && !this.sandbox.isPremiumUser()) {
// free edu
this.showPromo(6 /* FREE_EDU */);
}
else if (this.sandbox.isAnonymousMode()) {
// not logged
this.showPromo(8 /* ANONYMOUS */);
}
else if (!this.sandbox.isPremiumUser()) {
// free account
this.showPromo(7 /* PREMIUM */);
}
}
listenToEvents() {
this.listenToPageViews();
this.listenToAdsToggle();
}
listenToAdsToggle() {
this.sandbox.getEventBus().subscribeTo(35 /* ADS_CHANNEL */, 12 /* ADS_TOGGLE */, (show) => {
if (this.adsHidden) {
this.adsHidden = false;
this.sandbox.getEventBus().publish(35 /* ADS_CHANNEL */, 13 /* ADS_QUEUE_TOGGLE */);
this.refreshAds();
}
else {
this.adsHidden = true;
this.sandbox.getEventBus().publish(35 /* ADS_CHANNEL */, 13 /* ADS_QUEUE_TOGGLE */);
}
}, this);
}
listenToPageViews() {
if (te.isOldSystem()) {
this.sandbox.getEventBus().subscribeToMultipleEvents(42 /* FUNNEL_CHANNEL */, [54 /* VIEW_COLLECTION */], () => {
this.onNewPageView();
}, this);
this.sandbox.getEventBus().subscribeToMultipleEvents(42 /* FUNNEL_CHANNEL */, [55 /* VIEW_ITEM */], () => {
this.onNewPageView();
}, this);
}
else {
this.sandbox.getEventBus().subscribeTo(35 /* ADS_CHANNEL */, 2 /* ADS_COMPLETE_PAGEVIEW */, (interaction) => {
var hasToWait = pf.isCollectionOrReaderInteraction(interaction);
if (!hasToWait || pf.isReaderInteraction(interaction)) {
this.updateUrlIfNeeded();
}
this.onNewPageView();
}, this);
}
}
updateUrlIfNeeded() {
pl.pubhelper.get(this.sandbox).replaceUrlIfNeeded(1);
}
onNewPageView() {
this.handlePageView();
}
handlePageView() {
if (this.adsHidden || this.sandbox.isPremiumUser()) {
return;
}
this.refreshAds();
}
refreshAds() {
if (this.sandbox.isPremiumUser()) {
return;
}
this.showPromo();
}
showPromo(reason) {
this.pubHelper.launchCb();
this.placeholderManager.showLargePromotion({ color: 0 /* BLUE */ });
}
}
pubsimple.PubEngine = PubEngine;
})(pubsimple = exports.pubsimple || (exports.pubsimple = {}));
});
///
///
define('app/pub/rectangle/rectangle',["require", "exports", "app/pub/pubengine"], function (require, exports, ps) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rectangle = void 0;
var rectangle;
(function (rectangle) {
class Rectangle extends ps.pubsimple.PubEngine {
activate(params, region) {
this.init('right-column');
this.sandbox
.getEventBus()
.publish(0 /* MODULE_CHANNEL */, 3 /* MODULE_FULLY_STARTED */, { moduleKey: this.moduleId, instanceId: this.instanceId });
}
deactivate() {
//TODO unsubscribe
}
}
rectangle.Rectangle = Rectangle;
})(rectangle = exports.rectangle || (exports.rectangle = {}));
});