@mjhls/mjh-framework 1.0.692 → 1.0.694-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AD.js +1 -1
  3. package/dist/cjs/AD300x250.js +3 -3
  4. package/dist/cjs/AD300x250x600.js +3 -3
  5. package/dist/cjs/AD728x90.js +4 -4
  6. package/dist/cjs/ADFloatingFooter.js +2 -2
  7. package/dist/cjs/ADGutter.js +2 -2
  8. package/dist/cjs/ADSkyscraper.js +2 -2
  9. package/dist/cjs/ADSponsoredResources.js +2 -2
  10. package/dist/cjs/ADWebcast.js +2 -2
  11. package/dist/cjs/ADWelcome.js +2 -2
  12. package/dist/cjs/AdSlot.js +2 -2
  13. package/dist/cjs/AdSlotsProvider.js +1 -1
  14. package/dist/cjs/ArticleCarousel.js +1 -1
  15. package/dist/cjs/ArticleSeriesListing.js +4 -4
  16. package/dist/cjs/Auth.js +250 -301
  17. package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-091a991f.js} +1 -1
  18. package/dist/cjs/BrowseVideosListing.js +1 -1
  19. package/dist/cjs/CMEDeck.js +5 -5
  20. package/dist/cjs/Column3.js +4 -4
  21. package/dist/cjs/ConferenceArticleCard.js +2 -2
  22. package/dist/cjs/DeckContent.js +7 -7
  23. package/dist/cjs/DeckQueue.js +6 -6
  24. package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-f6a18ed2.js} +1 -1
  25. package/dist/cjs/EventsDeck.js +4 -4
  26. package/dist/cjs/ExternalResources.js +7 -7
  27. package/dist/cjs/Feature.js +3 -3
  28. package/dist/cjs/ForbesHero.js +2 -2
  29. package/dist/cjs/GridContent.js +10 -10
  30. package/dist/cjs/GridHero.js +2 -2
  31. package/dist/cjs/GroupDeck.js +1 -1
  32. package/dist/cjs/HamMagazine.js +4 -4
  33. package/dist/cjs/Hero.js +1 -1
  34. package/dist/cjs/HorizontalHero.js +2 -2
  35. package/dist/cjs/IssueContentDeck.js +2 -2
  36. package/dist/cjs/IssueDeck.js +2 -2
  37. package/dist/cjs/IssueLanding.js +7 -7
  38. package/dist/cjs/LeftNav.js +2 -2
  39. package/dist/cjs/MasterDeck.js +7 -7
  40. package/dist/cjs/NavMagazine.js +4 -4
  41. package/dist/cjs/NavNative.js +31 -24
  42. package/dist/cjs/OncliveHero.js +2 -2
  43. package/dist/cjs/OncliveLargeHero.js +2 -2
  44. package/dist/cjs/PartnerDetailListing.js +16 -16
  45. package/dist/cjs/PublicationDeck.js +1 -1
  46. package/dist/cjs/QueueDeckExpanded.js +9 -9
  47. package/dist/cjs/RecentNews.js +2 -2
  48. package/dist/cjs/RelatedContent.js +2 -2
  49. package/dist/cjs/{SocialSearchComponent-6b5e5b47.js → SocialSearchComponent-9cd24578.js} +5 -5
  50. package/dist/cjs/TaxonomyCard.js +2 -2
  51. package/dist/cjs/TemplateNormal.js +3 -3
  52. package/dist/cjs/ThumbnailCard.js +1 -1
  53. package/dist/cjs/Ustream.js +2 -2
  54. package/dist/cjs/VerticalHero.js +2 -2
  55. package/dist/cjs/VideoSeriesCard.js +2 -2
  56. package/dist/cjs/VideoSeriesListing.js +4 -4
  57. package/dist/cjs/View.js +174 -213
  58. package/dist/cjs/YahooHero.js +2 -2
  59. package/dist/cjs/YoutubeGroup.js +1 -1
  60. package/dist/cjs/getQuery.js +2 -2
  61. package/dist/cjs/getRelatedArticle.js +119 -153
  62. package/dist/cjs/getSerializers.js +6 -6
  63. package/dist/cjs/{getTargeting-fee8c429.js → getTargeting-9af0ef69.js} +2 -2
  64. package/dist/cjs/getTargeting.js +1 -1
  65. package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
  66. package/dist/cjs/{index-59436c13.js → index-a5919bab.js} +462 -474
  67. package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
  68. package/dist/cjs/{index-2d0a4911.js → index-fa8ed292.js} +27 -34
  69. package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
  70. package/dist/cjs/index.js +12 -12
  71. package/dist/cjs/{main-b6c96c8d.js → main-a4cb15bb.js} +36 -67
  72. package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
  73. package/dist/cjs/timeDifferenceCalc.js +1 -1
  74. package/dist/cjs/urlFor.js +1 -1
  75. package/dist/esm/AD.js +1 -1
  76. package/dist/esm/AD300x250.js +3 -3
  77. package/dist/esm/AD300x250x600.js +3 -3
  78. package/dist/esm/AD728x90.js +4 -4
  79. package/dist/esm/ADFloatingFooter.js +2 -2
  80. package/dist/esm/ADGutter.js +2 -2
  81. package/dist/esm/ADSkyscraper.js +2 -2
  82. package/dist/esm/ADSponsoredResources.js +2 -2
  83. package/dist/esm/ADWebcast.js +2 -2
  84. package/dist/esm/ADWelcome.js +2 -2
  85. package/dist/esm/AdSlot.js +2 -2
  86. package/dist/esm/AdSlotsProvider.js +1 -1
  87. package/dist/esm/ArticleCarousel.js +1 -1
  88. package/dist/esm/ArticleSeriesListing.js +4 -4
  89. package/dist/esm/Auth.js +247 -298
  90. package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
  91. package/dist/esm/BrowseVideosListing.js +1 -1
  92. package/dist/esm/CMEDeck.js +5 -5
  93. package/dist/esm/Column3.js +4 -4
  94. package/dist/esm/ConferenceArticleCard.js +2 -2
  95. package/dist/esm/DeckContent.js +7 -7
  96. package/dist/esm/DeckQueue.js +6 -6
  97. package/dist/esm/{Dfp-8a8fca18.js → Dfp-96b49def.js} +1 -1
  98. package/dist/esm/EventsDeck.js +4 -4
  99. package/dist/esm/ExternalResources.js +7 -7
  100. package/dist/esm/Feature.js +3 -3
  101. package/dist/esm/ForbesHero.js +2 -2
  102. package/dist/esm/GridContent.js +10 -10
  103. package/dist/esm/GridHero.js +2 -2
  104. package/dist/esm/GroupDeck.js +1 -1
  105. package/dist/esm/HamMagazine.js +4 -4
  106. package/dist/esm/Hero.js +1 -1
  107. package/dist/esm/HorizontalHero.js +2 -2
  108. package/dist/esm/IssueContentDeck.js +2 -2
  109. package/dist/esm/IssueDeck.js +2 -2
  110. package/dist/esm/IssueLanding.js +7 -7
  111. package/dist/esm/LeftNav.js +2 -2
  112. package/dist/esm/MasterDeck.js +7 -7
  113. package/dist/esm/NavMagazine.js +4 -4
  114. package/dist/esm/NavNative.js +31 -24
  115. package/dist/esm/OncliveHero.js +2 -2
  116. package/dist/esm/OncliveLargeHero.js +2 -2
  117. package/dist/esm/PartnerDetailListing.js +14 -14
  118. package/dist/esm/PublicationDeck.js +1 -1
  119. package/dist/esm/QueueDeckExpanded.js +9 -9
  120. package/dist/esm/RecentNews.js +2 -2
  121. package/dist/esm/RelatedContent.js +2 -2
  122. package/dist/esm/{SocialSearchComponent-7f14e0f3.js → SocialSearchComponent-93233334.js} +5 -5
  123. package/dist/esm/TaxonomyCard.js +2 -2
  124. package/dist/esm/TemplateNormal.js +3 -3
  125. package/dist/esm/ThumbnailCard.js +1 -1
  126. package/dist/esm/Ustream.js +2 -2
  127. package/dist/esm/VerticalHero.js +2 -2
  128. package/dist/esm/VideoSeriesCard.js +2 -2
  129. package/dist/esm/VideoSeriesListing.js +4 -4
  130. package/dist/esm/View.js +149 -188
  131. package/dist/esm/YahooHero.js +2 -2
  132. package/dist/esm/YoutubeGroup.js +1 -1
  133. package/dist/esm/getQuery.js +2 -2
  134. package/dist/esm/getRelatedArticle.js +119 -153
  135. package/dist/esm/getSerializers.js +6 -6
  136. package/dist/esm/{index-93ec3c59.js → index-0e45a0b2.js} +27 -34
  137. package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
  138. package/dist/esm/{index-a2e78632.js → index-c376cd8e.js} +462 -474
  139. package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
  140. package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
  141. package/dist/esm/index.js +11 -11
  142. package/dist/esm/{main-0465b2a0.js → main-5d1e4bd3.js} +34 -65
  143. package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
  144. package/dist/esm/timeDifferenceCalc.js +1 -1
  145. package/dist/esm/urlFor.js +1 -1
  146. package/package.json +1 -1
  147. /package/dist/cjs/{ADInfeed-3410ab3c.js → ADInfeed-2fe7211c.js} +0 -0
  148. /package/dist/cjs/{ADlgInfeed-845aac15.js → ADlgInfeed-14e17b43.js} +0 -0
  149. /package/dist/esm/{ADInfeed-205cb7a9.js → ADInfeed-eae71d07.js} +0 -0
  150. /package/dist/esm/{ADlgInfeed-e538f17a.js → ADlgInfeed-c619fe64.js} +0 -0
@@ -30,18 +30,9 @@ function parseString(setCookieValue, options) {
30
30
  ? Object.assign({}, defaultParseOptions, options)
31
31
  : defaultParseOptions;
32
32
 
33
- try {
34
- value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
35
- } catch (e) {
36
- console.error(
37
- `set-cookie-parser encountered an error while decoding a cookie with value '${value}'. Set options.decodeValues to false to disable this feature.`,
38
- e
39
- );
40
- }
41
-
42
33
  var cookie = {
43
34
  name: name, // grab everything before the first =
44
- value: value,
35
+ value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
45
36
  };
46
37
 
47
38
  parts.forEach(function (part) {
@@ -212,7 +203,7 @@ setCookie.parse = parse_1;
212
203
  setCookie.parseString = parseString_1;
213
204
  setCookie.splitCookiesString = splitCookiesString_1;
214
205
 
215
- var utils = createCommonjsModule(function (module, exports) {
206
+ var dist = createCommonjsModule(function (module, exports) {
216
207
  var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
217
208
  __assign = Object.assign || function(t) {
218
209
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -225,33 +216,10 @@ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
225
216
  return __assign.apply(this, arguments);
226
217
  };
227
218
  Object.defineProperty(exports, "__esModule", { value: true });
228
- exports.areCookiesEqual = exports.hasSameProperties = exports.createCookie = exports.isBrowser = void 0;
229
- /**
230
- * Tells whether we are in a browser or server.
231
- */
232
- function isBrowser() {
233
- return typeof window !== 'undefined';
234
- }
235
- exports.isBrowser = isBrowser;
236
- /**
237
- * Create an instance of the Cookie interface
238
- */
239
- function createCookie(name, value, options) {
240
- var sameSite = options.sameSite;
241
- if (sameSite === true) {
242
- sameSite = 'strict';
243
- }
244
- if (sameSite === undefined || sameSite === false) {
245
- sameSite = 'lax';
246
- }
247
- var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
248
- delete cookieToSet.encode;
249
- return __assign({ name: name, value: value }, cookieToSet);
250
- }
251
- exports.createCookie = createCookie;
252
- /**
253
- * Tells whether given objects have the same properties.
254
- */
219
+ exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
220
+
221
+
222
+ var isBrowser = function () { return typeof window !== 'undefined'; };
255
223
  function hasSameProperties(a, b) {
256
224
  var aProps = Object.getOwnPropertyNames(a);
257
225
  var bProps = Object.getOwnPropertyNames(b);
@@ -266,9 +234,8 @@ function hasSameProperties(a, b) {
266
234
  }
267
235
  return true;
268
236
  }
269
- exports.hasSameProperties = hasSameProperties;
270
237
  /**
271
- * Compare the cookie and return true if the cookies have equivalent
238
+ * Compare the cookie and return true if the cookies has equivalent
272
239
  * options and the cookies would be overwritten in the browser storage.
273
240
  *
274
241
  * @param a first Cookie for comparison
@@ -281,109 +248,71 @@ function areCookiesEqual(a, b) {
281
248
  }
282
249
  return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
283
250
  }
284
- exports.areCookiesEqual = areCookiesEqual;
285
- /* Functions */
286
-
287
- });
288
-
289
- unwrapExports(utils);
290
- var utils_1 = utils.areCookiesEqual;
291
- var utils_2 = utils.hasSameProperties;
292
- var utils_3 = utils.createCookie;
293
- var utils_4 = utils.isBrowser;
294
-
295
- var dist = createCommonjsModule(function (module, exports) {
296
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
297
- __assign = Object.assign || function(t) {
298
- for (var s, i = 1, n = arguments.length; i < n; i++) {
299
- s = arguments[i];
300
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
301
- t[p] = s[p];
302
- }
303
- return t;
304
- };
305
- return __assign.apply(this, arguments);
306
- };
307
- Object.defineProperty(exports, "__esModule", { value: true });
308
- exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
309
-
310
-
311
-
312
251
  /**
252
+ * Create an instance of the Cookie interface
253
+ *
254
+ * @param name name of the Cookie
255
+ * @param value value of the Cookie
256
+ * @param options Cookie options
257
+ */
258
+ function createCookie(name, value, options) {
259
+ var sameSite = options.sameSite;
260
+ if (sameSite === true) {
261
+ sameSite = 'strict';
262
+ }
263
+ if (sameSite === undefined || sameSite === false) {
264
+ sameSite = 'lax';
265
+ }
266
+ var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
267
+ delete cookieToSet.encode;
268
+ return __assign({ name: name, value: value }, cookieToSet);
269
+ }
270
+ /**
271
+ *
313
272
  * Parses cookies.
314
273
  *
315
- * @param ctx NextJS page or API context, express context, null or undefined.
316
- * @param options Options that we pass down to `cookie` library.
274
+ * @param ctx
275
+ * @param options
317
276
  */
318
277
  function parseCookies(ctx, options) {
319
- var _a, _b;
320
- if ((_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.req) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.cookie) {
278
+ if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
321
279
  return cookie.parse(ctx.req.headers.cookie, options);
322
280
  }
323
- if (utils.isBrowser()) {
281
+ if (isBrowser()) {
324
282
  return cookie.parse(document.cookie, options);
325
283
  }
326
284
  return {};
327
285
  }
328
286
  exports.parseCookies = parseCookies;
329
287
  /**
288
+ *
330
289
  * Sets a cookie.
331
290
  *
332
- * @param ctx NextJS page or API context, express context, null or undefined.
333
- * @param name The name of your cookie.
334
- * @param value The value of your cookie.
335
- * @param options Options that we pass down to `cookie` library.
291
+ * @param ctx
292
+ * @param name
293
+ * @param value
294
+ * @param options
336
295
  */
337
296
  function setCookie$1(ctx, name, value, options) {
338
- var _a, _b;
339
- if (options === void 0) { options = {}; }
340
- // SSR
341
- if (((_a = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _a === void 0 ? void 0 : _a.getHeader) && ctx.res.setHeader) {
342
- // Check if response has finished and warn about it.
343
- if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _b === void 0 ? void 0 : _b.finished) {
344
- console.warn("Not setting \"" + name + "\" cookie. Response has finished.");
345
- console.warn("You should set cookie before res.send()");
346
- return {};
347
- }
348
- /**
349
- * Load existing cookies from the header and parse them.
350
- */
297
+ if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
351
298
  var cookies = ctx.res.getHeader('Set-Cookie') || [];
352
299
  if (typeof cookies === 'string')
353
300
  cookies = [cookies];
354
301
  if (typeof cookies === 'number')
355
302
  cookies = [];
356
- /**
357
- * Parse cookies but ignore values - we've already encoded
358
- * them in the previous call.
359
- */
360
- var parsedCookies = setCookie.parse(cookies, {
361
- decodeValues: false,
362
- });
363
- /**
364
- * We create the new cookie and make sure that none of
365
- * the existing cookies match it.
366
- */
367
- var newCookie_1 = utils.createCookie(name, value, options);
303
+ var parsedCookies = setCookie.parse(cookies);
368
304
  var cookiesToSet_1 = [];
369
305
  parsedCookies.forEach(function (parsedCookie) {
370
- if (!utils.areCookiesEqual(parsedCookie, newCookie_1)) {
371
- /**
372
- * We serialize the cookie back to the original format
373
- * if it isn't the same as the new one.
374
- */
375
- var serializedCookie = cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({
376
- // we prevent reencoding by default, but you might override it
377
- encode: function (val) { return val; } }, parsedCookie));
378
- cookiesToSet_1.push(serializedCookie);
306
+ if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
307
+ cookiesToSet_1.push(cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
379
308
  }
380
309
  });
381
310
  cookiesToSet_1.push(cookie.serialize(name, value, options));
382
- // Update the header.
383
- ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
311
+ if (!ctx.res.finished) {
312
+ ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
313
+ }
384
314
  }
385
- // Browser
386
- if (utils.isBrowser()) {
315
+ if (isBrowser()) {
387
316
  if (options && options.httpOnly) {
388
317
  throw new Error('Can not set a httpOnly cookie in the browser.');
389
318
  }
@@ -393,21 +322,30 @@ function setCookie$1(ctx, name, value, options) {
393
322
  }
394
323
  exports.setCookie = setCookie$1;
395
324
  /**
325
+ *
396
326
  * Destroys a cookie with a particular name.
397
327
  *
398
- * @param ctx NextJS page or API context, express context, null or undefined.
399
- * @param name Cookie name.
400
- * @param options Options that we pass down to `cookie` library.
328
+ * @param ctx
329
+ * @param name
330
+ * @param options
401
331
  */
402
332
  function destroyCookie(ctx, name, options) {
403
- /**
404
- * We forward the request destroy to setCookie function
405
- * as it is the same function with modified maxAge value.
406
- */
407
- return setCookie$1(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));
333
+ var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
334
+ if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
335
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
336
+ if (typeof cookies === 'string')
337
+ cookies = [cookies];
338
+ if (typeof cookies === 'number')
339
+ cookies = [];
340
+ cookies.push(cookie.serialize(name, '', opts));
341
+ ctx.res.setHeader('Set-Cookie', cookies);
342
+ }
343
+ if (isBrowser()) {
344
+ document.cookie = cookie.serialize(name, '', opts);
345
+ }
346
+ return {};
408
347
  }
409
348
  exports.destroyCookie = destroyCookie;
410
- /* Utility Exports */
411
349
  exports.default = {
412
350
  set: setCookie$1,
413
351
  get: parseCookies,
@@ -424,28 +362,33 @@ var dist_3 = dist.parseCookies;
424
362
  var _this = undefined;
425
363
 
426
364
  var getRelatedArticle = function () {
427
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
365
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
428
366
  var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
429
367
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
430
368
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
431
369
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
432
370
  var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
433
371
 
434
- var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
372
+ var _article$url, url, documentGroupMapping, issueGroup, content_placement, references, params, conditions, cookies, prevSlugs, articles, query;
435
373
 
436
374
  return regenerator.wrap(function _callee$(_context) {
437
375
  while (1) {
438
376
  switch (_context.prev = _context.next) {
439
377
  case 0:
440
- taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
378
+ _article$url = article.url;
441
379
  _article$url = _article$url === undefined ? {
442
380
  current: null
443
381
  } : _article$url;
444
- url = _article$url.current, content_placement = article.content_placement;
445
- taxonomy = [];
446
- //404 articles were throwing server error
382
+ url = _article$url.current, documentGroupMapping = article.documentGroupMapping, issueGroup = article.issueGroup;
383
+ content_placement = article.content_placement;
384
+ references = [];
385
+
447
386
 
448
- if (content_placement) {
387
+ content_placement = content_placement && content_placement.length > 0 && content_placement.filter(function (_ref2) {
388
+ var identifier = _ref2.identifier;
389
+ return identifier !== 'news';
390
+ });
391
+ if (content_placement && content_placement.length > 0) {
449
392
  content_placement.forEach(function (_ref3) {
450
393
  var path = _ref3.path,
451
394
  _id = _ref3._id;
@@ -457,26 +400,30 @@ var getRelatedArticle = function () {
457
400
  if (prev_url_to_check.includes('?')) {
458
401
  prev_url_to_check = prev_url_to_check.split('?')[0];
459
402
  }
460
- if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
403
+ if (prev_url_to_check.endsWith(path) && _id) references.push(_id);
461
404
  });
405
+ if (references.length === 0) {
406
+ content_placement.forEach(function (_ref4) {
407
+ var _id = _ref4._id;
408
+
409
+ if (_id) references.push(_id);
410
+ });
411
+ }
462
412
  }
463
413
 
464
- //404 articles were throwing server error
465
- if (taxonomy.length === 0 && taxonomyMapping) {
466
- taxonomyMapping.forEach(function (_ref4) {
467
- var _ref = _ref4._ref;
414
+ if (documentGroupMapping && documentGroupMapping.length > 0) {
415
+ documentGroupMapping.forEach(function (_ref5) {
416
+ var _id = _ref5._id;
468
417
 
469
- if (_ref) {
470
- taxonomy.push(_ref);
471
- }
418
+ if (_id) references.push(_id);
472
419
  });
473
420
  }
474
421
 
475
- params = {
476
- url: url,
477
- taxonomy: taxonomy,
478
- index: articleCount
479
- };
422
+ if (issueGroup && issueGroup._ref) {
423
+ references.push(issueGroup._ref);
424
+ }
425
+
426
+ params = { url: url, references: references, index: articleCount };
480
427
  conditions = '';
481
428
 
482
429
  if (ctx && url) {
@@ -488,24 +435,43 @@ var getRelatedArticle = function () {
488
435
  conditions = '&& !(url.current in [' + prevSlugs + '])';
489
436
  } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
490
437
  }
491
- relatedArticleQuery = getQuery('related', conditions, '', articleCount);
492
- _context.next = 12;
493
- return client.fetch(relatedArticleQuery, params);
494
438
 
495
- case 12:
496
- relatedArticle = _context.sent;
497
- return _context.abrupt('return', relatedArticle);
439
+ articles = null;
440
+
441
+ if (!(params.references && params.references.length > 0)) {
442
+ _context.next = 24;
443
+ break;
444
+ }
445
+
446
+ query = getQuery('related', conditions, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '&& references($references)');
447
+ _context.prev = 15;
448
+ _context.next = 18;
449
+ return client.fetch(query, params);
450
+
451
+ case 18:
452
+ articles = _context.sent;
453
+ _context.next = 24;
454
+ break;
455
+
456
+ case 21:
457
+ _context.prev = 21;
458
+ _context.t0 = _context['catch'](15);
459
+
460
+ console.error(_context.t0);
461
+
462
+ case 24:
463
+ return _context.abrupt('return', articles);
498
464
 
499
- case 14:
465
+ case 25:
500
466
  case 'end':
501
467
  return _context.stop();
502
468
  }
503
469
  }
504
- }, _callee, _this);
470
+ }, _callee, _this, [[15, 21]]);
505
471
  }));
506
472
 
507
473
  return function getRelatedArticle() {
508
- return _ref2.apply(this, arguments);
474
+ return _ref.apply(this, arguments);
509
475
  };
510
476
  }();
511
477
 
@@ -14,18 +14,18 @@ import './web.dom.iterable-8956f9a5.js';
14
14
  import './typeof-08f2c380.js';
15
15
  import './_is-array-49698029.js';
16
16
  import 'react';
17
- import './index-93ec3c59.js';
17
+ import './index-0e45a0b2.js';
18
18
  import 'prop-types';
19
19
  import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
- import './moment-12415288.js';
21
+ import './moment-e2f9b20c.js';
22
22
  import 'next/router';
23
23
  import './isSymbol-807e927e.js';
24
24
  import './debounce-1a993acf.js';
25
25
  import 'react-dom';
26
- import './index-51a80699.js';
26
+ import './index-73819142.js';
27
27
  import './index-5f9f807a.js';
28
- import './main-0465b2a0.js';
28
+ import './main-5d1e4bd3.js';
29
29
  import './entities-7cc3bf45.js';
30
30
  import './stringify-008c8802.js';
31
31
  import './slicedToArray-7021e5df.js';
@@ -34,14 +34,14 @@ import './_set-species-cede29f8.js';
34
34
  import './Segment.js';
35
35
  import './Beam.js';
36
36
  import './AdSlot.js';
37
- import './BlockContent-a614acdf.js';
37
+ import './BlockContent-e9b4ddcf.js';
38
38
  import './smoothscroll-4b699764.js';
39
39
  import './GroupDeck.js';
40
40
  import 'react-bootstrap';
41
41
  import './iconBase-602d52fe.js';
42
42
  import './index.esm-29e48d38.js';
43
43
  import 'react-bootstrap/Button';
44
- export { g as default } from './index-a2e78632.js';
44
+ export { g as default } from './index-c376cd8e.js';
45
45
  import './util-7700fc59.js';
46
46
  import './brightcove-react-player-loader.es-83f53e4e.js';
47
47
  import 'react-bootstrap/Pagination';
@@ -722,8 +722,6 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
722
722
 
723
723
  return new Promise(function (resolve) {
724
724
  _this3.getGoogletag().then(function (googletag) {
725
- _this3.configureInitialOptions(googletag);
726
-
727
725
  slotsToInitialize.forEach(function (currentSlotId) {
728
726
  registeredSlots[currentSlotId].loading = false;
729
727
  googletag.cmd.push(function () {
@@ -787,25 +785,14 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
787
785
  });
788
786
  });
789
787
  },
790
- // configure those gpt parameters that need to be set before pubsads service
791
- // initialization.
792
- configureInitialOptions: function configureInitialOptions(googletag) {
793
- var _this4 = this;
794
-
795
- googletag.cmd.push(function () {
796
- if (_this4.disableInitialLoadIsEnabled()) {
797
- googletag.pubads().disableInitialLoad();
798
- }
799
- });
800
- },
801
788
  configureOptions: function configureOptions(googletag) {
802
- var _this5 = this;
789
+ var _this4 = this;
803
790
 
804
791
  googletag.cmd.push(function () {
805
792
  var pubadsService = googletag.pubads();
806
- pubadsService.setRequestNonPersonalizedAds(_this5.personalizedAdsEnabled() ? 0 : 1);
793
+ pubadsService.setRequestNonPersonalizedAds(_this4.personalizedAdsEnabled() ? 0 : 1);
807
794
 
808
- var targetingArguments = _this5.getTargetingArguments(); // set global targetting arguments
795
+ var targetingArguments = _this4.getTargetingArguments(); // set global targetting arguments
809
796
 
810
797
 
811
798
  Object.keys(targetingArguments).forEach(function (varName) {
@@ -814,28 +801,34 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
814
801
  }
815
802
  }); // set global adSense attributes
816
803
 
817
- var adSenseAttributes = _this5.getAdSenseAttributes();
804
+ var adSenseAttributes = _this4.getAdSenseAttributes();
818
805
 
819
806
  Object.keys(adSenseAttributes).forEach(function (key) {
820
807
  pubadsService.set(key, adSenseAttributes[key]);
821
808
  });
822
809
 
823
- if (_this5.lazyLoadIsEnabled()) {
824
- var config = _this5.getLazyLoadConfig();
810
+ if (_this4.lazyLoadIsEnabled()) {
811
+ var args = [];
825
812
 
826
- if (config) {
827
- pubadsService.enableLazyLoad(config);
828
- } else {
829
- pubadsService.enableLazyLoad();
813
+ var config = _this4.getLazyLoadConfig();
814
+
815
+ if (config !== null) {
816
+ args.push(config);
830
817
  }
818
+
819
+ pubadsService.enableLazyLoad.call(args);
831
820
  }
832
821
 
833
- if (_this5.singleRequestIsEnabled()) {
822
+ if (_this4.singleRequestIsEnabled()) {
834
823
  pubadsService.enableSingleRequest();
835
824
  }
836
825
 
837
- if (_this5.collapseEmptyDivs === true || _this5.collapseEmptyDivs === false) {
838
- pubadsService.collapseEmptyDivs(_this5.collapseEmptyDivs);
826
+ if (_this4.disableInitialLoadIsEnabled()) {
827
+ pubadsService.disableInitialLoad();
828
+ }
829
+
830
+ if (_this4.collapseEmptyDivs === true || _this4.collapseEmptyDivs === false) {
831
+ pubadsService.collapseEmptyDivs(_this4.collapseEmptyDivs);
839
832
  }
840
833
  });
841
834
  },
@@ -877,10 +870,10 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
877
870
  }
878
871
  },
879
872
  gptRefreshAds: function gptRefreshAds(slots) {
880
- var _this6 = this;
873
+ var _this5 = this;
881
874
 
882
875
  return this.getGoogletag().then(function (googletag) {
883
- _this6.configureOptions(googletag);
876
+ _this5.configureOptions(googletag);
884
877
 
885
878
  googletag.cmd.push(function () {
886
879
  var pubadsService = googletag.pubads();
@@ -891,14 +884,14 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
891
884
  });
892
885
  },
893
886
  reload: function reload() {
894
- var _this7 = this;
887
+ var _this6 = this;
895
888
 
896
889
  return this.destroyGPTSlots.apply(this, arguments).then(function () {
897
- return _this7.load();
890
+ return _this6.load();
898
891
  });
899
892
  },
900
893
  destroyGPTSlots: function destroyGPTSlots() {
901
- var _this8 = this;
894
+ var _this7 = this;
902
895
 
903
896
  for (var _len4 = arguments.length, slotsToDestroy = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
904
897
  slotsToDestroy[_key4] = arguments[_key4];
@@ -918,7 +911,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
918
911
  slots.push(slot);
919
912
  }
920
913
 
921
- _this8.getGoogletag().then(function (googletag) {
914
+ _this7.getGoogletag().then(function (googletag) {
922
915
  googletag.cmd.push(function () {
923
916
  if (managerAlreadyInitialized === true) {
924
917
  if (slotsToDestroy.length > 0) {
@@ -941,7 +934,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
941
934
  });
942
935
  },
943
936
  registerSlot: function registerSlot(_ref) {
944
- var _this9 = this;
937
+ var _this8 = this;
945
938
 
946
939
  var slotId = _ref.slotId,
947
940
  dfpNetworkId = _ref.dfpNetworkId,
@@ -980,7 +973,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
980
973
  gptSlot = slot.gptSlot;
981
974
 
982
975
  if (loading === false && !gptSlot) {
983
- _this9.load(slotId);
976
+ _this8.load(slotId);
984
977
  }
985
978
  }
986
979
  });