@mjhls/mjh-framework 1.0.664 → 1.0.665-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 +3 -3
  15. package/dist/cjs/ArticleSeriesListing.js +4 -4
  16. package/dist/cjs/Auth.js +256 -507
  17. package/dist/cjs/{BlockContent-88f69acd.js → BlockContent-091a991f.js} +1 -1
  18. package/dist/cjs/CMEDeck.js +5 -5
  19. package/dist/cjs/Column3.js +4 -4
  20. package/dist/cjs/ConferenceArticleCard.js +2 -2
  21. package/dist/cjs/DeckContent.js +7 -7
  22. package/dist/cjs/DeckQueue.js +6 -6
  23. package/dist/cjs/{Dfp-b2bc3b97.js → Dfp-f6a18ed2.js} +1 -1
  24. package/dist/cjs/EventsDeck.js +5 -5
  25. package/dist/cjs/ExternalResources.js +7 -7
  26. package/dist/cjs/Feature.js +3 -3
  27. package/dist/cjs/ForbesHero.js +2 -2
  28. package/dist/cjs/GridContent.js +10 -10
  29. package/dist/cjs/GridHero.js +2 -2
  30. package/dist/cjs/GroupDeck.js +1 -1
  31. package/dist/cjs/HamMagazine.js +5 -5
  32. package/dist/cjs/Hero.js +1 -1
  33. package/dist/cjs/HorizontalHero.js +2 -2
  34. package/dist/cjs/IssueContentDeck.js +2 -2
  35. package/dist/cjs/IssueDeck.js +2 -2
  36. package/dist/cjs/IssueLanding.js +7 -7
  37. package/dist/cjs/LeftNav.js +2 -2
  38. package/dist/cjs/MasterDeck.js +8 -8
  39. package/dist/cjs/NavMagazine.js +4 -4
  40. package/dist/cjs/NavNative.js +3 -3
  41. package/dist/cjs/OncliveHero.js +2 -2
  42. package/dist/cjs/OncliveLargeHero.js +2 -2
  43. package/dist/cjs/PartnerDetailListing.js +1212 -15
  44. package/dist/cjs/PublicationDeck.js +1 -1
  45. package/dist/cjs/QueueDeckExpanded.js +9 -9
  46. package/dist/cjs/RecentNews.js +2 -2
  47. package/dist/cjs/RelatedContent.js +2 -2
  48. package/dist/cjs/{SocialSearchComponent-962b1344.js → SocialSearchComponent-81a50f81.js} +5 -5
  49. package/dist/cjs/TaxonomyCard.js +2 -2
  50. package/dist/cjs/TemplateNormal.js +3 -3
  51. package/dist/cjs/ThumbnailCard.js +1 -1
  52. package/dist/cjs/Ustream.js +2 -2
  53. package/dist/cjs/VerticalHero.js +2 -2
  54. package/dist/cjs/VideoSeriesCard.js +2 -2
  55. package/dist/cjs/VideoSeriesListing.js +3 -3
  56. package/dist/cjs/View.js +227 -70
  57. package/dist/cjs/YahooHero.js +2 -2
  58. package/dist/cjs/YoutubeGroup.js +1 -1
  59. package/dist/cjs/getQuery.js +2 -2
  60. package/dist/cjs/getRelatedArticle-606b1d0b.js +447 -0
  61. package/dist/cjs/getRelatedArticle.js +5 -90
  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-6f1ee5f0.js → index-bc3e2d5c.js} +450 -462
  67. package/dist/cjs/index-bd6c9f56.js +211 -0
  68. package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
  69. package/dist/cjs/{index-2d0a4911.js → index-fa8ed292.js} +27 -34
  70. package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
  71. package/dist/cjs/index.js +15 -16
  72. package/dist/cjs/{main-b6c96c8d.js → main-a4cb15bb.js} +36 -67
  73. package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.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 +248 -499
  90. package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
  91. package/dist/esm/CMEDeck.js +5 -5
  92. package/dist/esm/Column3.js +4 -4
  93. package/dist/esm/ConferenceArticleCard.js +2 -2
  94. package/dist/esm/DeckContent.js +7 -7
  95. package/dist/esm/DeckQueue.js +6 -6
  96. package/dist/esm/{Dfp-8a8fca18.js → Dfp-96b49def.js} +1 -1
  97. package/dist/esm/EventsDeck.js +5 -5
  98. package/dist/esm/ExternalResources.js +7 -7
  99. package/dist/esm/Feature.js +3 -3
  100. package/dist/esm/ForbesHero.js +2 -2
  101. package/dist/esm/GridContent.js +10 -10
  102. package/dist/esm/GridHero.js +2 -2
  103. package/dist/esm/GroupDeck.js +1 -1
  104. package/dist/esm/HamMagazine.js +5 -5
  105. package/dist/esm/Hero.js +1 -1
  106. package/dist/esm/HorizontalHero.js +2 -2
  107. package/dist/esm/IssueContentDeck.js +2 -2
  108. package/dist/esm/IssueDeck.js +2 -2
  109. package/dist/esm/IssueLanding.js +7 -7
  110. package/dist/esm/LeftNav.js +2 -2
  111. package/dist/esm/MasterDeck.js +8 -8
  112. package/dist/esm/NavMagazine.js +4 -4
  113. package/dist/esm/NavNative.js +3 -3
  114. package/dist/esm/OncliveHero.js +2 -2
  115. package/dist/esm/OncliveLargeHero.js +2 -2
  116. package/dist/esm/PartnerDetailListing.js +1209 -13
  117. package/dist/esm/PublicationDeck.js +1 -1
  118. package/dist/esm/QueueDeckExpanded.js +9 -9
  119. package/dist/esm/RecentNews.js +2 -2
  120. package/dist/esm/RelatedContent.js +2 -2
  121. package/dist/esm/{SocialSearchComponent-75527dfe.js → SocialSearchComponent-55960ec4.js} +5 -5
  122. package/dist/esm/TaxonomyCard.js +2 -2
  123. package/dist/esm/TemplateNormal.js +3 -3
  124. package/dist/esm/ThumbnailCard.js +1 -1
  125. package/dist/esm/Ustream.js +2 -2
  126. package/dist/esm/VerticalHero.js +2 -2
  127. package/dist/esm/VideoSeriesCard.js +2 -2
  128. package/dist/esm/VideoSeriesListing.js +3 -3
  129. package/dist/esm/View.js +198 -41
  130. package/dist/esm/YahooHero.js +2 -2
  131. package/dist/esm/YoutubeGroup.js +1 -1
  132. package/dist/esm/getQuery.js +2 -2
  133. package/dist/esm/getRelatedArticle-80e67416.js +443 -0
  134. package/dist/esm/getRelatedArticle.js +4 -93
  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-3a33f7d6.js → index-6d49c905.js} +450 -462
  138. package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
  139. package/dist/esm/index-db3bb315.js +207 -0
  140. package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
  141. package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
  142. package/dist/esm/index.js +13 -14
  143. package/dist/esm/{main-0465b2a0.js → main-5d1e4bd3.js} +34 -65
  144. package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
  145. package/dist/esm/urlFor.js +1 -1
  146. package/package.json +1 -1
  147. /package/dist/cjs/{ADInfeed-9735aff2.js → ADInfeed-388ec28a.js} +0 -0
  148. /package/dist/cjs/{ADlgInfeed-6bd11848.js → ADlgInfeed-5548ff47.js} +0 -0
  149. /package/dist/esm/{ADInfeed-9140aa7d.js → ADInfeed-eae0af19.js} +0 -0
  150. /package/dist/esm/{ADlgInfeed-7656ecd1.js → ADlgInfeed-2f4c7a7c.js} +0 -0
@@ -0,0 +1,443 @@
1
+ import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
2
+ import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
3
+ import { c as cookie } from './index-db3bb315.js';
4
+ import getQuery from './getQuery.js';
5
+
6
+ var defaultParseOptions = {
7
+ decodeValues: true,
8
+ map: false,
9
+ silent: false,
10
+ };
11
+
12
+ function isNonEmptyString(str) {
13
+ return typeof str === "string" && !!str.trim();
14
+ }
15
+
16
+ function parseString(setCookieValue, options) {
17
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
18
+ var nameValue = parts.shift().split("=");
19
+ var name = nameValue.shift();
20
+ var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
21
+
22
+ options = options
23
+ ? Object.assign({}, defaultParseOptions, options)
24
+ : defaultParseOptions;
25
+
26
+ var cookie = {
27
+ name: name, // grab everything before the first =
28
+ value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
29
+ };
30
+
31
+ parts.forEach(function (part) {
32
+ var sides = part.split("=");
33
+ var key = sides.shift().trimLeft().toLowerCase();
34
+ var value = sides.join("=");
35
+ if (key === "expires") {
36
+ cookie.expires = new Date(value);
37
+ } else if (key === "max-age") {
38
+ cookie.maxAge = parseInt(value, 10);
39
+ } else if (key === "secure") {
40
+ cookie.secure = true;
41
+ } else if (key === "httponly") {
42
+ cookie.httpOnly = true;
43
+ } else if (key === "samesite") {
44
+ cookie.sameSite = value;
45
+ } else {
46
+ cookie[key] = value;
47
+ }
48
+ });
49
+
50
+ return cookie;
51
+ }
52
+
53
+ function parse(input, options) {
54
+ options = options
55
+ ? Object.assign({}, defaultParseOptions, options)
56
+ : defaultParseOptions;
57
+
58
+ if (!input) {
59
+ if (!options.map) {
60
+ return [];
61
+ } else {
62
+ return {};
63
+ }
64
+ }
65
+
66
+ if (input.headers && input.headers["set-cookie"]) {
67
+ // fast-path for node.js (which automatically normalizes header names to lower-case
68
+ input = input.headers["set-cookie"];
69
+ } else if (input.headers) {
70
+ // slow-path for other environments - see #25
71
+ var sch =
72
+ input.headers[
73
+ Object.keys(input.headers).find(function (key) {
74
+ return key.toLowerCase() === "set-cookie";
75
+ })
76
+ ];
77
+ // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
78
+ if (!sch && input.headers.cookie && !options.silent) {
79
+ console.warn(
80
+ "Warning: set-cookie-parser appears to have been called on a request object. It is designed to parse Set-Cookie headers from responses, not Cookie headers from requests. Set the option {silent: true} to suppress this warning."
81
+ );
82
+ }
83
+ input = sch;
84
+ }
85
+ if (!Array.isArray(input)) {
86
+ input = [input];
87
+ }
88
+
89
+ options = options
90
+ ? Object.assign({}, defaultParseOptions, options)
91
+ : defaultParseOptions;
92
+
93
+ if (!options.map) {
94
+ return input.filter(isNonEmptyString).map(function (str) {
95
+ return parseString(str, options);
96
+ });
97
+ } else {
98
+ var cookies = {};
99
+ return input.filter(isNonEmptyString).reduce(function (cookies, str) {
100
+ var cookie = parseString(str, options);
101
+ cookies[cookie.name] = cookie;
102
+ return cookies;
103
+ }, cookies);
104
+ }
105
+ }
106
+
107
+ /*
108
+ Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
109
+ that are within a single set-cookie field-value, such as in the Expires portion.
110
+
111
+ This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
112
+ Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
113
+ React Native's fetch does this for *every* header, including set-cookie.
114
+
115
+ Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
116
+ Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
117
+ */
118
+ function splitCookiesString(cookiesString) {
119
+ if (Array.isArray(cookiesString)) {
120
+ return cookiesString;
121
+ }
122
+ if (typeof cookiesString !== "string") {
123
+ return [];
124
+ }
125
+
126
+ var cookiesStrings = [];
127
+ var pos = 0;
128
+ var start;
129
+ var ch;
130
+ var lastComma;
131
+ var nextStart;
132
+ var cookiesSeparatorFound;
133
+
134
+ function skipWhitespace() {
135
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
136
+ pos += 1;
137
+ }
138
+ return pos < cookiesString.length;
139
+ }
140
+
141
+ function notSpecialChar() {
142
+ ch = cookiesString.charAt(pos);
143
+
144
+ return ch !== "=" && ch !== ";" && ch !== ",";
145
+ }
146
+
147
+ while (pos < cookiesString.length) {
148
+ start = pos;
149
+ cookiesSeparatorFound = false;
150
+
151
+ while (skipWhitespace()) {
152
+ ch = cookiesString.charAt(pos);
153
+ if (ch === ",") {
154
+ // ',' is a cookie separator if we have later first '=', not ';' or ','
155
+ lastComma = pos;
156
+ pos += 1;
157
+
158
+ skipWhitespace();
159
+ nextStart = pos;
160
+
161
+ while (pos < cookiesString.length && notSpecialChar()) {
162
+ pos += 1;
163
+ }
164
+
165
+ // currently special character
166
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
167
+ // we found cookies separator
168
+ cookiesSeparatorFound = true;
169
+ // pos is inside the next cookie, so back up and return it.
170
+ pos = nextStart;
171
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
172
+ start = pos;
173
+ } else {
174
+ // in param ',' or param separator ';',
175
+ // we continue from that comma
176
+ pos = lastComma + 1;
177
+ }
178
+ } else {
179
+ pos += 1;
180
+ }
181
+ }
182
+
183
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
184
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
185
+ }
186
+ }
187
+
188
+ return cookiesStrings;
189
+ }
190
+
191
+ var setCookie = parse;
192
+ var parse_1 = parse;
193
+ var parseString_1 = parseString;
194
+ var splitCookiesString_1 = splitCookiesString;
195
+ setCookie.parse = parse_1;
196
+ setCookie.parseString = parseString_1;
197
+ setCookie.splitCookiesString = splitCookiesString_1;
198
+
199
+ var dist = createCommonjsModule(function (module, exports) {
200
+ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
201
+ __assign = Object.assign || function(t) {
202
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
203
+ s = arguments[i];
204
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
205
+ t[p] = s[p];
206
+ }
207
+ return t;
208
+ };
209
+ return __assign.apply(this, arguments);
210
+ };
211
+ Object.defineProperty(exports, "__esModule", { value: true });
212
+ exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
213
+
214
+
215
+ var isBrowser = function () { return typeof window !== 'undefined'; };
216
+ function hasSameProperties(a, b) {
217
+ var aProps = Object.getOwnPropertyNames(a);
218
+ var bProps = Object.getOwnPropertyNames(b);
219
+ if (aProps.length !== bProps.length) {
220
+ return false;
221
+ }
222
+ for (var i = 0; i < aProps.length; i++) {
223
+ var propName = aProps[i];
224
+ if (a[propName] !== b[propName]) {
225
+ return false;
226
+ }
227
+ }
228
+ return true;
229
+ }
230
+ /**
231
+ * Compare the cookie and return true if the cookies has equivalent
232
+ * options and the cookies would be overwritten in the browser storage.
233
+ *
234
+ * @param a first Cookie for comparison
235
+ * @param b second Cookie for comparison
236
+ */
237
+ function areCookiesEqual(a, b) {
238
+ var sameSiteSame = a.sameSite === b.sameSite;
239
+ if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
240
+ sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
241
+ }
242
+ return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
243
+ }
244
+ /**
245
+ * Create an instance of the Cookie interface
246
+ *
247
+ * @param name name of the Cookie
248
+ * @param value value of the Cookie
249
+ * @param options Cookie options
250
+ */
251
+ function createCookie(name, value, options) {
252
+ var sameSite = options.sameSite;
253
+ if (sameSite === true) {
254
+ sameSite = 'strict';
255
+ }
256
+ if (sameSite === undefined || sameSite === false) {
257
+ sameSite = 'lax';
258
+ }
259
+ var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
260
+ delete cookieToSet.encode;
261
+ return __assign({ name: name, value: value }, cookieToSet);
262
+ }
263
+ /**
264
+ *
265
+ * Parses cookies.
266
+ *
267
+ * @param ctx
268
+ * @param options
269
+ */
270
+ function parseCookies(ctx, options) {
271
+ if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
272
+ return cookie.parse(ctx.req.headers.cookie, options);
273
+ }
274
+ if (isBrowser()) {
275
+ return cookie.parse(document.cookie, options);
276
+ }
277
+ return {};
278
+ }
279
+ exports.parseCookies = parseCookies;
280
+ /**
281
+ *
282
+ * Sets a cookie.
283
+ *
284
+ * @param ctx
285
+ * @param name
286
+ * @param value
287
+ * @param options
288
+ */
289
+ function setCookie$1(ctx, name, value, options) {
290
+ if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
291
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
292
+ if (typeof cookies === 'string')
293
+ cookies = [cookies];
294
+ if (typeof cookies === 'number')
295
+ cookies = [];
296
+ var parsedCookies = setCookie.parse(cookies);
297
+ var cookiesToSet_1 = [];
298
+ parsedCookies.forEach(function (parsedCookie) {
299
+ if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
300
+ cookiesToSet_1.push(cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
301
+ }
302
+ });
303
+ cookiesToSet_1.push(cookie.serialize(name, value, options));
304
+ if (!ctx.res.finished) {
305
+ ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
306
+ }
307
+ }
308
+ if (isBrowser()) {
309
+ if (options && options.httpOnly) {
310
+ throw new Error('Can not set a httpOnly cookie in the browser.');
311
+ }
312
+ document.cookie = cookie.serialize(name, value, options);
313
+ }
314
+ return {};
315
+ }
316
+ exports.setCookie = setCookie$1;
317
+ /**
318
+ *
319
+ * Destroys a cookie with a particular name.
320
+ *
321
+ * @param ctx
322
+ * @param name
323
+ * @param options
324
+ */
325
+ function destroyCookie(ctx, name, options) {
326
+ var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
327
+ if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
328
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
329
+ if (typeof cookies === 'string')
330
+ cookies = [cookies];
331
+ if (typeof cookies === 'number')
332
+ cookies = [];
333
+ cookies.push(cookie.serialize(name, '', opts));
334
+ ctx.res.setHeader('Set-Cookie', cookies);
335
+ }
336
+ if (isBrowser()) {
337
+ document.cookie = cookie.serialize(name, '', opts);
338
+ }
339
+ return {};
340
+ }
341
+ exports.destroyCookie = destroyCookie;
342
+ exports.default = {
343
+ set: setCookie$1,
344
+ get: parseCookies,
345
+ destroy: destroyCookie,
346
+ };
347
+
348
+ });
349
+
350
+ unwrapExports(dist);
351
+ var dist_1 = dist.destroyCookie;
352
+ var dist_2 = dist.setCookie;
353
+ var dist_3 = dist.parseCookies;
354
+
355
+ var _this = undefined;
356
+
357
+ var getRelatedArticle = function () {
358
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
359
+ var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
360
+ var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
361
+ var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
362
+ var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
363
+ var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
364
+
365
+ var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
366
+
367
+ return regenerator.wrap(function _callee$(_context) {
368
+ while (1) {
369
+ switch (_context.prev = _context.next) {
370
+ case 0:
371
+ taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
372
+ _article$url = _article$url === undefined ? {
373
+ current: null
374
+ } : _article$url;
375
+ url = _article$url.current, content_placement = article.content_placement;
376
+ taxonomy = [];
377
+ //404 articles were throwing server error
378
+
379
+ if (content_placement) {
380
+ content_placement.forEach(function (_ref3) {
381
+ var path = _ref3.path,
382
+ _id = _ref3._id;
383
+
384
+ if (!_id || typeof _id == 'undefined') {
385
+ return null;
386
+ }
387
+ var prev_url_to_check = prevUrl;
388
+ if (prev_url_to_check.includes('?')) {
389
+ prev_url_to_check = prev_url_to_check.split('?')[0];
390
+ }
391
+ if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
392
+ });
393
+ }
394
+
395
+ //404 articles were throwing server error
396
+ if (taxonomy.length === 0 && taxonomyMapping) {
397
+ taxonomyMapping.forEach(function (_ref4) {
398
+ var _ref = _ref4._ref;
399
+
400
+ if (_ref) {
401
+ taxonomy.push(_ref);
402
+ }
403
+ });
404
+ }
405
+
406
+ params = {
407
+ url: url,
408
+ taxonomy: taxonomy,
409
+ index: articleCount
410
+ };
411
+ conditions = '';
412
+
413
+ if (ctx && url) {
414
+ cookies = dist_3(ctx);
415
+ prevSlugs = cookies['prevSlugs'];
416
+
417
+ if (!!prevSlugs) {
418
+ dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
419
+ conditions = '&& !(url.current in [' + prevSlugs + '])';
420
+ } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
421
+ }
422
+ relatedArticleQuery = getQuery('related', conditions, '', articleCount);
423
+ _context.next = 12;
424
+ return client.fetch(relatedArticleQuery, params);
425
+
426
+ case 12:
427
+ relatedArticle = _context.sent;
428
+ return _context.abrupt('return', relatedArticle);
429
+
430
+ case 14:
431
+ case 'end':
432
+ return _context.stop();
433
+ }
434
+ }
435
+ }, _callee, _this);
436
+ }));
437
+
438
+ return function getRelatedArticle() {
439
+ return _ref2.apply(this, arguments);
440
+ };
441
+ }();
442
+
443
+ export { dist_2 as a, dist_3 as d, getRelatedArticle as g };
@@ -5,97 +5,8 @@ import './_library-528f1934.js';
5
5
  import './_iter-detect-59409a32.js';
6
6
  import './core.get-iterator-method-54d2e411.js';
7
7
  import './web.dom.iterable-8956f9a5.js';
8
- import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
8
+ import './asyncToGenerator-7c654f36.js';
9
9
  import './_set-species-cede29f8.js';
10
- import { parseCookies, setCookie } from 'nookies';
11
- import getQuery from './getQuery.js';
12
-
13
- var _this = undefined;
14
-
15
- var getRelatedArticle = function () {
16
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
17
- var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
18
- var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
19
- var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
20
- var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
21
- var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
22
-
23
- var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
24
-
25
- return regenerator.wrap(function _callee$(_context) {
26
- while (1) {
27
- switch (_context.prev = _context.next) {
28
- case 0:
29
- taxonomyMapping = article.taxonomyMapping, _article$url = article.url;
30
- _article$url = _article$url === undefined ? {
31
- current: null
32
- } : _article$url;
33
- url = _article$url.current, content_placement = article.content_placement;
34
- taxonomy = [];
35
- //404 articles were throwing server error
36
-
37
- if (content_placement) {
38
- content_placement.forEach(function (_ref3) {
39
- var path = _ref3.path,
40
- _id = _ref3._id;
41
-
42
- if (!_id || typeof _id == 'undefined') {
43
- return null;
44
- }
45
- var prev_url_to_check = prevUrl;
46
- if (prev_url_to_check.includes('?')) {
47
- prev_url_to_check = prev_url_to_check.split('?')[0];
48
- }
49
- if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
50
- });
51
- }
52
-
53
- //404 articles were throwing server error
54
- if (taxonomy.length === 0 && taxonomyMapping) {
55
- taxonomyMapping.forEach(function (_ref4) {
56
- var _ref = _ref4._ref;
57
-
58
- if (_ref) {
59
- taxonomy.push(_ref);
60
- }
61
- });
62
- }
63
-
64
- params = {
65
- url: url,
66
- taxonomy: taxonomy,
67
- index: articleCount
68
- };
69
- conditions = '';
70
-
71
- if (ctx && url) {
72
- cookies = parseCookies(ctx);
73
- prevSlugs = cookies['prevSlugs'];
74
-
75
- if (!!prevSlugs) {
76
- setCookie(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
77
- conditions = '&& !(url.current in [' + prevSlugs + '])';
78
- } else setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
79
- }
80
- relatedArticleQuery = getQuery('related', conditions, '', articleCount);
81
- _context.next = 12;
82
- return client.fetch(relatedArticleQuery, params);
83
-
84
- case 12:
85
- relatedArticle = _context.sent;
86
- return _context.abrupt('return', relatedArticle);
87
-
88
- case 14:
89
- case 'end':
90
- return _context.stop();
91
- }
92
- }
93
- }, _callee, _this);
94
- }));
95
-
96
- return function getRelatedArticle() {
97
- return _ref2.apply(this, arguments);
98
- };
99
- }();
100
-
101
- export default getRelatedArticle;
10
+ import './index-db3bb315.js';
11
+ export { g as default } from './getRelatedArticle-80e67416.js';
12
+ import './getQuery.js';
@@ -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';
@@ -33,12 +33,12 @@ import './asyncToGenerator-7c654f36.js';
33
33
  import './_set-species-cede29f8.js';
34
34
  import './beam-681a9749.js';
35
35
  import './AdSlot.js';
36
- import './BlockContent-a614acdf.js';
36
+ import './BlockContent-e9b4ddcf.js';
37
37
  import './smoothscroll-4b699764.js';
38
38
  import './GroupDeck.js';
39
39
  import 'react-bootstrap';
40
40
  import 'react-bootstrap/Button';
41
- export { g as default } from './index-3a33f7d6.js';
41
+ export { g as default } from './index-6d49c905.js';
42
42
  import './util-7700fc59.js';
43
43
  import './brightcove-react-player-loader.es-83f53e4e.js';
44
44
  import 'react-bootstrap/Pagination';