@mjhls/mjh-framework 1.0.594 → 1.0.597

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 (166) hide show
  1. package/README.md +172 -172
  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 +5 -5
  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/ArticleQueue.js +298 -28
  15. package/dist/cjs/Auth.js +256 -507
  16. package/dist/cjs/{AuthorComponent-cb8b8128.js → AuthorComponent-3c79e1ab.js} +2 -2
  17. package/dist/cjs/{BlockContent-f942392e.js → BlockContent-77f81ffc.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 +17 -17
  21. package/dist/cjs/DeckContent.js +16 -16
  22. package/dist/cjs/DeckQueue.js +7 -7
  23. package/dist/cjs/{Dfp-fbe32b96.js → Dfp-fcdeabc4.js} +1 -1
  24. package/dist/cjs/EventsDeck.js +22 -22
  25. package/dist/cjs/ExternalResources.js +7 -7
  26. package/dist/cjs/Feature.js +3 -3
  27. package/dist/cjs/ForbesHero.js +3 -3
  28. package/dist/cjs/GridContent.js +12 -12
  29. package/dist/cjs/GridHero.js +3 -3
  30. package/dist/cjs/GroupDeck.js +5 -5
  31. package/dist/cjs/HamMagazine.js +11 -11
  32. package/dist/cjs/Hero.js +1 -1
  33. package/dist/cjs/HorizontalHero.js +2 -2
  34. package/dist/cjs/InscreenSensor-22a96661.js +85 -0
  35. package/dist/cjs/IssueContentDeck.js +3 -3
  36. package/dist/cjs/IssueDeck.js +2 -2
  37. package/dist/cjs/IssueLanding.js +37 -37
  38. package/dist/cjs/KMTracker.js +15 -15
  39. package/dist/cjs/LeftNav.js +2 -2
  40. package/dist/cjs/MasterDeck.js +17 -17
  41. package/dist/cjs/NavMagazine.js +12 -12
  42. package/dist/cjs/NavNative.js +11 -11
  43. package/dist/cjs/OncliveHero.js +2 -2
  44. package/dist/cjs/OncliveLargeHero.js +3 -3
  45. package/dist/cjs/PartnerDetailListing.js +1307 -30
  46. package/dist/cjs/PublicationDeck.js +1 -1
  47. package/dist/cjs/PublicationLanding.js +33 -33
  48. package/dist/cjs/QueueDeckExpanded.js +10 -10
  49. package/dist/cjs/RecentNews.js +93 -0
  50. package/dist/cjs/RelatedContent.js +30 -30
  51. package/dist/cjs/RelatedTopicsDropdown.js +10 -10
  52. package/dist/cjs/SideFooter.js +2 -2
  53. package/dist/cjs/TaxonomyCard.js +2 -2
  54. package/dist/cjs/TemplateNormal.js +2 -2
  55. package/dist/cjs/ThumbnailCard.js +1 -1
  56. package/dist/cjs/Ustream.js +2 -2
  57. package/dist/cjs/VerticalHero.js +2 -2
  58. package/dist/cjs/VideoSeriesFilter.js +1 -1
  59. package/dist/cjs/VideoSeriesListing.js +5 -5
  60. package/dist/cjs/View.js +259 -88
  61. package/dist/cjs/YahooHero.js +3 -3
  62. package/dist/cjs/YoutubeGroup.js +5 -5
  63. package/dist/cjs/getQuery.js +2 -4
  64. package/dist/cjs/getRelatedArticle.js +358 -11
  65. package/dist/cjs/getSerializers.js +6 -6
  66. package/dist/cjs/{getTargeting-b15993cb.js → getTargeting-3d208b98.js} +11 -11
  67. package/dist/cjs/getTargeting.js +1 -1
  68. package/dist/cjs/{index-5be2866f.js → index-3294d3bc.js} +1 -1
  69. package/dist/cjs/index-bd6c9f56.js +211 -0
  70. package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
  71. package/dist/cjs/{index-e7f86168.js → index-c4972b44.js} +441 -453
  72. package/dist/cjs/{index-f7ee1612.js → index-fa3cec70.js} +6 -4
  73. package/dist/cjs/{index.es-ab3f2690.js → index.es-9110add6.js} +1 -3
  74. package/dist/cjs/index.js +17 -18
  75. package/dist/cjs/{inherits-93684212.js → inherits-14962339.js} +4 -4
  76. package/dist/cjs/{main-bc4db521.js → main-88348b15.js} +35 -66
  77. package/dist/cjs/{moment-66a6a284.js → moment-575fe24c.js} +1 -1
  78. package/dist/cjs/urlFor.js +2 -2
  79. package/dist/esm/AD.js +1 -1
  80. package/dist/esm/AD300x250.js +5 -5
  81. package/dist/esm/AD300x250x600.js +5 -5
  82. package/dist/esm/AD728x90.js +6 -6
  83. package/dist/esm/ADFloatingFooter.js +7 -7
  84. package/dist/esm/ADGutter.js +4 -4
  85. package/dist/esm/ADSkyscraper.js +4 -4
  86. package/dist/esm/ADSponsoredResources.js +4 -4
  87. package/dist/esm/ADWebcast.js +4 -4
  88. package/dist/esm/ADWelcome.js +4 -4
  89. package/dist/esm/AdSlot.js +4 -4
  90. package/dist/esm/AdSlotsProvider.js +1 -1
  91. package/dist/esm/ArticleQueue.js +296 -26
  92. package/dist/esm/Auth.js +248 -499
  93. package/dist/esm/{AuthorComponent-158226c9.js → AuthorComponent-357dbee9.js} +2 -2
  94. package/dist/esm/{BlockContent-a614acdf.js → BlockContent-e9b4ddcf.js} +1 -1
  95. package/dist/esm/CMEDeck.js +7 -7
  96. package/dist/esm/Column2.js +3 -3
  97. package/dist/esm/Column3.js +8 -8
  98. package/dist/esm/ConferenceArticleCard.js +17 -17
  99. package/dist/esm/DeckContent.js +17 -17
  100. package/dist/esm/DeckQueue.js +10 -10
  101. package/dist/esm/{Dfp-ae9336e2.js → Dfp-a36ad202.js} +3 -3
  102. package/dist/esm/EventsDeck.js +22 -22
  103. package/dist/esm/ExternalResources.js +9 -9
  104. package/dist/esm/Feature.js +3 -3
  105. package/dist/esm/ForbesHero.js +3 -3
  106. package/dist/esm/GridContent.js +15 -15
  107. package/dist/esm/GridHero.js +3 -3
  108. package/dist/esm/GroupDeck.js +5 -5
  109. package/dist/esm/HamMagazine.js +11 -11
  110. package/dist/esm/Hero.js +1 -1
  111. package/dist/esm/HorizontalHero.js +2 -2
  112. package/dist/esm/InscreenSensor-beb2ec79.js +80 -0
  113. package/dist/esm/IssueContentDeck.js +3 -3
  114. package/dist/esm/IssueDeck.js +2 -2
  115. package/dist/esm/IssueLanding.js +39 -39
  116. package/dist/esm/KMTracker.js +15 -15
  117. package/dist/esm/LeftNav.js +4 -4
  118. package/dist/esm/MasterDeck.js +18 -18
  119. package/dist/esm/NavMagazine.js +12 -12
  120. package/dist/esm/NavNative.js +11 -11
  121. package/dist/esm/OncliveHero.js +2 -2
  122. package/dist/esm/OncliveLargeHero.js +3 -3
  123. package/dist/esm/PartnerDetailListing.js +1307 -30
  124. package/dist/esm/PublicationDeck.js +1 -1
  125. package/dist/esm/PublicationLanding.js +33 -33
  126. package/dist/esm/QueueDeckExpanded.js +12 -12
  127. package/dist/esm/RecentNews.js +88 -0
  128. package/dist/esm/RelatedContent.js +30 -30
  129. package/dist/esm/RelatedTopicsDropdown.js +10 -10
  130. package/dist/esm/SideFooter.js +5 -5
  131. package/dist/esm/TaxonomyCard.js +2 -2
  132. package/dist/esm/TemplateNormal.js +6 -6
  133. package/dist/esm/ThumbnailCard.js +1 -1
  134. package/dist/esm/Ustream.js +2 -2
  135. package/dist/esm/VerticalHero.js +2 -2
  136. package/dist/esm/VideoSeriesFilter.js +1 -1
  137. package/dist/esm/VideoSeriesListing.js +6 -6
  138. package/dist/esm/View.js +237 -66
  139. package/dist/esm/YahooHero.js +3 -3
  140. package/dist/esm/YoutubeGroup.js +5 -5
  141. package/dist/esm/{_arrayMap-64cbe0e4.js → _arrayMap-818441dd.js} +1 -1
  142. package/dist/esm/{debounce-048d9cb6.js → debounce-a0d9abca.js} +1 -1
  143. package/dist/esm/{get-0eb56363.js → get-58d2f7cc.js} +2 -2
  144. package/dist/esm/getQuery.js +2 -4
  145. package/dist/esm/getRelatedArticle.js +358 -11
  146. package/dist/esm/getSerializers.js +8 -8
  147. package/dist/esm/{getTargeting-1a0bd08d.js → getTargeting-1f2c61e3.js} +9 -9
  148. package/dist/esm/getTargeting.js +1 -1
  149. package/dist/esm/{index-93ec3c59.js → index-3f4dd6f2.js} +6 -4
  150. package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
  151. package/dist/esm/{index-80cb5ee6.js → index-7ca90052.js} +441 -453
  152. package/dist/esm/index-db3bb315.js +207 -0
  153. package/dist/esm/{index-d2f90501.js → index-ef6d5dcf.js} +1 -1
  154. package/dist/esm/{index.es-938a3a58.js → index.es-29c1cef5.js} +1 -3
  155. package/dist/esm/index.js +19 -20
  156. package/dist/esm/{isSymbol-b7b7434f.js → isSymbol-47f5ff3b.js} +1 -1
  157. package/dist/esm/{main-7255814e.js → main-d7ee6151.js} +34 -65
  158. package/dist/esm/{moment-12415288.js → moment-e2f9b20c.js} +1 -1
  159. package/dist/esm/urlFor.js +2 -2
  160. package/package.json +107 -107
  161. package/dist/cjs/InscreenSensor-e7f3579f.js +0 -361
  162. package/dist/esm/InscreenSensor-280b2b10.js +0 -352
  163. /package/dist/cjs/{ADInfeed-17a378db.js → ADInfeed-df340285.js} +0 -0
  164. /package/dist/cjs/{ADlgInfeed-070d911c.js → ADlgInfeed-2110d08c.js} +0 -0
  165. /package/dist/esm/{ADInfeed-c7dba95f.js → ADInfeed-a5a1f81f.js} +0 -0
  166. /package/dist/esm/{ADlgInfeed-8bfd6d58.js → ADlgInfeed-99f14909.js} +0 -0
@@ -9,13 +9,13 @@ require('./web.dom.iterable-43c3e277.js');
9
9
  var React = require('react');
10
10
  var React__default = _interopDefault(React);
11
11
  require('prop-types');
12
- var moment = require('./moment-66a6a284.js');
12
+ var moment = require('./moment-575fe24c.js');
13
13
  require('react-dom');
14
- var index$1 = require('./index-b5eb3ff8.js');
14
+ var index$1 = require('./index-be0c82be.js');
15
15
  var index$2 = require('./index-fa0fb52c.js');
16
16
  var entities = require('./entities-310b46ee.js');
17
17
  require('./slicedToArray-8063ee51.js');
18
- var AuthorComponent = require('./AuthorComponent-cb8b8128.js');
18
+ var AuthorComponent = require('./AuthorComponent-3c79e1ab.js');
19
19
 
20
20
  var YahooHero = function YahooHero(props) {
21
21
  var removeTimeStamp = props.removeTimeStamp;
@@ -14,15 +14,15 @@ var React = require('react');
14
14
  var React__default = _interopDefault(React);
15
15
  require('prop-types');
16
16
  require('react-dom');
17
- var index$1 = require('./index-b5eb3ff8.js');
17
+ var index$1 = require('./index-be0c82be.js');
18
18
  var index$2 = require('./index-fa0fb52c.js');
19
19
  var slicedToArray = require('./slicedToArray-8063ee51.js');
20
20
  var smoothscroll = require('./smoothscroll-95231a70.js');
21
21
 
22
- /*
23
- GROQ query -
24
- accepts an array of title, URL
25
- `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
22
+ /*
23
+ GROQ query -
24
+ accepts an array of title, URL
25
+ `https://img.youtube.com/vi/${getYouTubeId(vid.url)}/hqdefault.jpg`
26
26
  */
27
27
 
28
28
  var YoutubeGroup = function YoutubeGroup(props) {
@@ -1,18 +1,16 @@
1
1
  'use strict';
2
2
 
3
- require('./_commonjsHelpers-06173234.js');
4
- require('./moment-66a6a284.js');
5
-
6
3
  var getQuery = function getQuery(type) {
7
4
  var conditions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
8
5
  var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
6
+ var articleCount = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
9
7
 
10
8
  //Added feature to include additional conditions and parameters for site level operations
11
9
  //Site level conditions should start with && (logical AND), and site level params should end with , (comma) in order to execute query
12
10
 
13
11
  switch (type) {
14
12
  case 'related':
15
- return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[$index]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
13
+ return '*[\n _type == "article"\n && defined(title)\n && defined(url)\n && !(_id in path("drafts.**"))\n && is_visible == true\n && published <= now()\n && passwordLock!=true\n && taxonomyMapping[]._ref in $taxonomy\n && taxonomyMapping[].disableAds != \'true\'\n && contentCategory->.name != \'Poll\'\n && contentCategory->.name != \'Slideshows\'\n && contentCategory->.disableAds != \'true\'\n && ExcludeFromInfiniteScroll !=true\n && url.current != $url\n && !defined(body[].videos)\n ' + conditions + '\n ]| order(published desc)[' + (articleCount ? articleCount : '$index') + ']{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier,\n disableAds\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n }';
16
14
  case 'article':
17
15
  return '*[\n _type == "article"\n && !(_id in path("drafts.**"))\n && defined(title)\n && defined(url)\n && url.current == $url\n ' + conditions + '\n ][0]{\n ' + params + '\n title,\n published,\n summary,\n thumbnail,\n ...,\n passwordLock,\n password,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n body[] {\n ...,\n upload_doc {\n _type,\n asset->\n },\n uploadAudio {\n _type,\n asset->\n },\n medias[]{ \n ...,\n upload_doc { \n _type,\n asset-> \n } \n },\n articles[]{\n ...,\n "authorDetails": authorMapping[]->{ displayName, url, profileImage, biography },\n }\n },\n \'content_placement\': taxonomyMapping[]-> {\n ...,\n \'ancestor\': parent->parent->identifier,\n \'parent\': parent->identifier,\n \'name\': name,\n \'path\': identifier\n },\n documentGroup-> {\n name,\n thumbnail,\n parent->{...,parent->},\n \'path\': identifier.current\n },\n \'category\':contentCategory->{\n name,\n disableAds\n },\n \'issue\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.issueGroup._ref][0] {\n name,\n volume,\n \'issueNumber\': number,\n \'articleSource\': source,\n \'path\': identifier.current,\n \'publication\' : *[_type == \'publication\' && !(_id in path("drafts.**")) && is_visible == true && _id == ^.parent._ref][0] {\n name,\n \'path\': identifier.current\n },\n \'url\' : pdf.asset-> url\n }\n\n }';
18
16
  case 'publication':
@@ -1,17 +1,365 @@
1
1
  'use strict';
2
2
 
3
- require('./_commonjsHelpers-06173234.js');
3
+ var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
4
4
  require('./_to-object-329a650b.js');
5
5
  require('./core.get-iterator-method-41e87ec1.js');
6
6
  require('./_library-dd23b178.js');
7
7
  require('./_iter-detect-4d0352f8.js');
8
8
  require('./web.dom.iterable-43c3e277.js');
9
- require('./moment-66a6a284.js');
10
9
  var asyncToGenerator = require('./asyncToGenerator-8e707718.js');
11
10
  require('./_set-species-4458e975.js');
12
- var nookies = require('nookies');
11
+ var index$4 = require('./index-bd6c9f56.js');
13
12
  var getQuery = require('./getQuery.js');
14
13
 
14
+ var defaultParseOptions = {
15
+ decodeValues: true,
16
+ map: false,
17
+ silent: false,
18
+ };
19
+
20
+ function isNonEmptyString(str) {
21
+ return typeof str === "string" && !!str.trim();
22
+ }
23
+
24
+ function parseString(setCookieValue, options) {
25
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
26
+ var nameValue = parts.shift().split("=");
27
+ var name = nameValue.shift();
28
+ var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
29
+
30
+ options = options
31
+ ? Object.assign({}, defaultParseOptions, options)
32
+ : defaultParseOptions;
33
+
34
+ var cookie = {
35
+ name: name, // grab everything before the first =
36
+ value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
37
+ };
38
+
39
+ parts.forEach(function (part) {
40
+ var sides = part.split("=");
41
+ var key = sides.shift().trimLeft().toLowerCase();
42
+ var value = sides.join("=");
43
+ if (key === "expires") {
44
+ cookie.expires = new Date(value);
45
+ } else if (key === "max-age") {
46
+ cookie.maxAge = parseInt(value, 10);
47
+ } else if (key === "secure") {
48
+ cookie.secure = true;
49
+ } else if (key === "httponly") {
50
+ cookie.httpOnly = true;
51
+ } else if (key === "samesite") {
52
+ cookie.sameSite = value;
53
+ } else {
54
+ cookie[key] = value;
55
+ }
56
+ });
57
+
58
+ return cookie;
59
+ }
60
+
61
+ function parse(input, options) {
62
+ options = options
63
+ ? Object.assign({}, defaultParseOptions, options)
64
+ : defaultParseOptions;
65
+
66
+ if (!input) {
67
+ if (!options.map) {
68
+ return [];
69
+ } else {
70
+ return {};
71
+ }
72
+ }
73
+
74
+ if (input.headers && input.headers["set-cookie"]) {
75
+ // fast-path for node.js (which automatically normalizes header names to lower-case
76
+ input = input.headers["set-cookie"];
77
+ } else if (input.headers) {
78
+ // slow-path for other environments - see #25
79
+ var sch =
80
+ input.headers[
81
+ Object.keys(input.headers).find(function (key) {
82
+ return key.toLowerCase() === "set-cookie";
83
+ })
84
+ ];
85
+ // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
86
+ if (!sch && input.headers.cookie && !options.silent) {
87
+ console.warn(
88
+ "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."
89
+ );
90
+ }
91
+ input = sch;
92
+ }
93
+ if (!Array.isArray(input)) {
94
+ input = [input];
95
+ }
96
+
97
+ options = options
98
+ ? Object.assign({}, defaultParseOptions, options)
99
+ : defaultParseOptions;
100
+
101
+ if (!options.map) {
102
+ return input.filter(isNonEmptyString).map(function (str) {
103
+ return parseString(str, options);
104
+ });
105
+ } else {
106
+ var cookies = {};
107
+ return input.filter(isNonEmptyString).reduce(function (cookies, str) {
108
+ var cookie = parseString(str, options);
109
+ cookies[cookie.name] = cookie;
110
+ return cookies;
111
+ }, cookies);
112
+ }
113
+ }
114
+
115
+ /*
116
+ Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
117
+ that are within a single set-cookie field-value, such as in the Expires portion.
118
+
119
+ This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
120
+ Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
121
+ React Native's fetch does this for *every* header, including set-cookie.
122
+
123
+ Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
124
+ Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
125
+ */
126
+ function splitCookiesString(cookiesString) {
127
+ if (Array.isArray(cookiesString)) {
128
+ return cookiesString;
129
+ }
130
+ if (typeof cookiesString !== "string") {
131
+ return [];
132
+ }
133
+
134
+ var cookiesStrings = [];
135
+ var pos = 0;
136
+ var start;
137
+ var ch;
138
+ var lastComma;
139
+ var nextStart;
140
+ var cookiesSeparatorFound;
141
+
142
+ function skipWhitespace() {
143
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
144
+ pos += 1;
145
+ }
146
+ return pos < cookiesString.length;
147
+ }
148
+
149
+ function notSpecialChar() {
150
+ ch = cookiesString.charAt(pos);
151
+
152
+ return ch !== "=" && ch !== ";" && ch !== ",";
153
+ }
154
+
155
+ while (pos < cookiesString.length) {
156
+ start = pos;
157
+ cookiesSeparatorFound = false;
158
+
159
+ while (skipWhitespace()) {
160
+ ch = cookiesString.charAt(pos);
161
+ if (ch === ",") {
162
+ // ',' is a cookie separator if we have later first '=', not ';' or ','
163
+ lastComma = pos;
164
+ pos += 1;
165
+
166
+ skipWhitespace();
167
+ nextStart = pos;
168
+
169
+ while (pos < cookiesString.length && notSpecialChar()) {
170
+ pos += 1;
171
+ }
172
+
173
+ // currently special character
174
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
175
+ // we found cookies separator
176
+ cookiesSeparatorFound = true;
177
+ // pos is inside the next cookie, so back up and return it.
178
+ pos = nextStart;
179
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
180
+ start = pos;
181
+ } else {
182
+ // in param ',' or param separator ';',
183
+ // we continue from that comma
184
+ pos = lastComma + 1;
185
+ }
186
+ } else {
187
+ pos += 1;
188
+ }
189
+ }
190
+
191
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
192
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
193
+ }
194
+ }
195
+
196
+ return cookiesStrings;
197
+ }
198
+
199
+ var setCookie = parse;
200
+ var parse_1 = parse;
201
+ var parseString_1 = parseString;
202
+ var splitCookiesString_1 = splitCookiesString;
203
+ setCookie.parse = parse_1;
204
+ setCookie.parseString = parseString_1;
205
+ setCookie.splitCookiesString = splitCookiesString_1;
206
+
207
+ var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
208
+ var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
209
+ __assign = Object.assign || function(t) {
210
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
211
+ s = arguments[i];
212
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
213
+ t[p] = s[p];
214
+ }
215
+ return t;
216
+ };
217
+ return __assign.apply(this, arguments);
218
+ };
219
+ Object.defineProperty(exports, "__esModule", { value: true });
220
+ exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
221
+
222
+
223
+ var isBrowser = function () { return typeof window !== 'undefined'; };
224
+ function hasSameProperties(a, b) {
225
+ var aProps = Object.getOwnPropertyNames(a);
226
+ var bProps = Object.getOwnPropertyNames(b);
227
+ if (aProps.length !== bProps.length) {
228
+ return false;
229
+ }
230
+ for (var i = 0; i < aProps.length; i++) {
231
+ var propName = aProps[i];
232
+ if (a[propName] !== b[propName]) {
233
+ return false;
234
+ }
235
+ }
236
+ return true;
237
+ }
238
+ /**
239
+ * Compare the cookie and return true if the cookies has equivalent
240
+ * options and the cookies would be overwritten in the browser storage.
241
+ *
242
+ * @param a first Cookie for comparison
243
+ * @param b second Cookie for comparison
244
+ */
245
+ function areCookiesEqual(a, b) {
246
+ var sameSiteSame = a.sameSite === b.sameSite;
247
+ if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
248
+ sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
249
+ }
250
+ return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
251
+ }
252
+ /**
253
+ * Create an instance of the Cookie interface
254
+ *
255
+ * @param name name of the Cookie
256
+ * @param value value of the Cookie
257
+ * @param options Cookie options
258
+ */
259
+ function createCookie(name, value, options) {
260
+ var sameSite = options.sameSite;
261
+ if (sameSite === true) {
262
+ sameSite = 'strict';
263
+ }
264
+ if (sameSite === undefined || sameSite === false) {
265
+ sameSite = 'lax';
266
+ }
267
+ var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
268
+ delete cookieToSet.encode;
269
+ return __assign({ name: name, value: value }, cookieToSet);
270
+ }
271
+ /**
272
+ *
273
+ * Parses cookies.
274
+ *
275
+ * @param ctx
276
+ * @param options
277
+ */
278
+ function parseCookies(ctx, options) {
279
+ if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
280
+ return index$4.cookie.parse(ctx.req.headers.cookie, options);
281
+ }
282
+ if (isBrowser()) {
283
+ return index$4.cookie.parse(document.cookie, options);
284
+ }
285
+ return {};
286
+ }
287
+ exports.parseCookies = parseCookies;
288
+ /**
289
+ *
290
+ * Sets a cookie.
291
+ *
292
+ * @param ctx
293
+ * @param name
294
+ * @param value
295
+ * @param options
296
+ */
297
+ function setCookie$1(ctx, name, value, options) {
298
+ if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
299
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
300
+ if (typeof cookies === 'string')
301
+ cookies = [cookies];
302
+ if (typeof cookies === 'number')
303
+ cookies = [];
304
+ var parsedCookies = setCookie.parse(cookies);
305
+ var cookiesToSet_1 = [];
306
+ parsedCookies.forEach(function (parsedCookie) {
307
+ if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
308
+ cookiesToSet_1.push(index$4.cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({ encode: function (val) { return val; } }, parsedCookie)));
309
+ }
310
+ });
311
+ cookiesToSet_1.push(index$4.cookie.serialize(name, value, options));
312
+ if (!ctx.res.finished) {
313
+ ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
314
+ }
315
+ }
316
+ if (isBrowser()) {
317
+ if (options && options.httpOnly) {
318
+ throw new Error('Can not set a httpOnly cookie in the browser.');
319
+ }
320
+ document.cookie = index$4.cookie.serialize(name, value, options);
321
+ }
322
+ return {};
323
+ }
324
+ exports.setCookie = setCookie$1;
325
+ /**
326
+ *
327
+ * Destroys a cookie with a particular name.
328
+ *
329
+ * @param ctx
330
+ * @param name
331
+ * @param options
332
+ */
333
+ function destroyCookie(ctx, name, options) {
334
+ var opts = __assign(__assign({}, (options || {})), { maxAge: -1 });
335
+ if (ctx && ctx.res && ctx.res.setHeader && ctx.res.getHeader) {
336
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
337
+ if (typeof cookies === 'string')
338
+ cookies = [cookies];
339
+ if (typeof cookies === 'number')
340
+ cookies = [];
341
+ cookies.push(index$4.cookie.serialize(name, '', opts));
342
+ ctx.res.setHeader('Set-Cookie', cookies);
343
+ }
344
+ if (isBrowser()) {
345
+ document.cookie = index$4.cookie.serialize(name, '', opts);
346
+ }
347
+ return {};
348
+ }
349
+ exports.destroyCookie = destroyCookie;
350
+ exports.default = {
351
+ set: setCookie$1,
352
+ get: parseCookies,
353
+ destroy: destroyCookie,
354
+ };
355
+
356
+ });
357
+
358
+ _commonjsHelpers.unwrapExports(dist);
359
+ var dist_1 = dist.destroyCookie;
360
+ var dist_2 = dist.setCookie;
361
+ var dist_3 = dist.parseCookies;
362
+
15
363
  var _this = undefined;
16
364
 
17
365
  var getRelatedArticle = function () {
@@ -20,6 +368,7 @@ var getRelatedArticle = function () {
20
368
  var client = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
21
369
  var article = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
22
370
  var prevUrl = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '/';
371
+ var articleCount = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
23
372
 
24
373
  var taxonomyMapping, _article$url, url, content_placement, taxonomy, params, conditions, cookies, prevSlugs, relatedArticleQuery, relatedArticle;
25
374
 
@@ -44,7 +393,7 @@ var getRelatedArticle = function () {
44
393
  if (prev_url_to_check.includes('?')) {
45
394
  prev_url_to_check = prev_url_to_check.split('?')[0];
46
395
  }
47
- if (prev_url_to_check.endsWith(path)) taxonomy.push(_id);
396
+ if (prev_url_to_check.endsWith(path) && _id) taxonomy.push(_id);
48
397
  });
49
398
  }
50
399
 
@@ -55,25 +404,23 @@ var getRelatedArticle = function () {
55
404
  return _ref;
56
405
  });
57
406
  }
58
-
59
407
  params = {
60
408
  url: url,
61
409
  taxonomy: taxonomy,
62
- index: 0
410
+ index: articleCount
63
411
  };
64
412
  conditions = '';
65
413
 
66
414
  if (ctx && url) {
67
- cookies = nookies.parseCookies(ctx);
415
+ cookies = dist_3(ctx);
68
416
  prevSlugs = cookies['prevSlugs'];
69
417
 
70
418
  if (!!prevSlugs) {
71
- nookies.setCookie(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
419
+ dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
72
420
  conditions = '&& !(url.current in [' + prevSlugs + '])';
73
- } else nookies.setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
421
+ } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
74
422
  }
75
-
76
- relatedArticleQuery = getQuery('related', conditions);
423
+ relatedArticleQuery = getQuery('related', conditions, '', articleCount);
77
424
  _context.next = 12;
78
425
  return client.fetch(relatedArticleQuery, params);
79
426
 
@@ -12,18 +12,18 @@ require('./web.dom.iterable-43c3e277.js');
12
12
  require('./typeof-1869832c.js');
13
13
  require('./_is-array-754e012d.js');
14
14
  require('react');
15
- require('./index-f7ee1612.js');
15
+ require('./index-fa3cec70.js');
16
16
  require('prop-types');
17
17
  require('react-bootstrap/Row');
18
18
  require('react-bootstrap/Col');
19
- require('./moment-66a6a284.js');
19
+ require('./moment-575fe24c.js');
20
20
  require('next/router');
21
21
  require('./isSymbol-488934a7.js');
22
22
  require('./debounce-32e57002.js');
23
23
  require('react-dom');
24
- require('./index-b5eb3ff8.js');
24
+ require('./index-be0c82be.js');
25
25
  require('./index-fa0fb52c.js');
26
- require('./main-bc4db521.js');
26
+ require('./main-88348b15.js');
27
27
  require('./entities-310b46ee.js');
28
28
  require('./slicedToArray-8063ee51.js');
29
29
  require('./stringify-7c5aff47.js');
@@ -32,12 +32,12 @@ require('./_set-species-4458e975.js');
32
32
  require('./beam-d22818d3.js');
33
33
  require('./AdSlot.js');
34
34
  require('./lodash-fc2922d0.js');
35
- require('./BlockContent-f942392e.js');
35
+ require('./BlockContent-77f81ffc.js');
36
36
  require('./smoothscroll-95231a70.js');
37
37
  require('./GroupDeck.js');
38
38
  require('react-bootstrap');
39
39
  require('react-bootstrap/Button');
40
- var getSerializers = require('./index-e7f86168.js');
40
+ var getSerializers = require('./index-c4972b44.js');
41
41
  require('./util-f2c1b65b.js');
42
42
  require('./brightcove-react-player-loader.es-156bd4d6.js');
43
43
  require('react-bootstrap/Pagination');
@@ -1,21 +1,21 @@
1
1
  'use strict';
2
2
 
3
3
  var toConsumableArray = require('./toConsumableArray-ca04303b.js');
4
- var _extends = require('./extends-60837c34.js');
4
+ var _extends$1 = require('./extends-60837c34.js');
5
5
 
6
6
  var getContentPlacementUrl = function getContentPlacementUrl(cp) {
7
- var cp_url = '';
8
- if (cp.ancestor && typeof cp.ancestor == 'string') {
9
- cp_url += (cp_url === '' ? '' : '/') + cp.ancestor;
10
- }
7
+ var cp_url = '';
8
+ if (cp.ancestor && typeof cp.ancestor == 'string') {
9
+ cp_url += (cp_url === '' ? '' : '/') + cp.ancestor;
10
+ }
11
11
 
12
- if (!cp.ancestor && cp.parent && typeof cp.parent == 'string') {
13
- cp_url += (cp_url === '' ? '' : '/') + cp.parent;
14
- }
12
+ if (!cp.ancestor && cp.parent && typeof cp.parent == 'string') {
13
+ cp_url += (cp_url === '' ? '' : '/') + cp.parent;
14
+ }
15
15
 
16
- cp_url += (cp_url === '' ? '' : '/') + cp.path;
16
+ cp_url += (cp_url === '' ? '' : '/') + cp.path;
17
17
 
18
- return cp_url;
18
+ return cp_url;
19
19
  };
20
20
 
21
21
  var getTargeting = function getTargeting(props) {
@@ -102,7 +102,7 @@ var getTargeting = function getTargeting(props) {
102
102
  }
103
103
 
104
104
  if (props.cache && props.cache.hyperTargeting) {
105
- targeting = _extends._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
105
+ targeting = _extends$1._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
106
106
  }
107
107
 
108
108
  if (position && position.length) {
@@ -8,7 +8,7 @@ require('./from-ea347372.js');
8
8
  require('./toConsumableArray-ca04303b.js');
9
9
  require('./_object-pie-68c5bcbc.js');
10
10
  require('./extends-60837c34.js');
11
- var getTargeting = require('./getTargeting-b15993cb.js');
11
+ var getTargeting = require('./getTargeting-3d208b98.js');
12
12
 
13
13
 
14
14
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
4
- var moment = require('./moment-66a6a284.js');
4
+ var moment = require('./moment-575fe24c.js');
5
5
 
6
6
  var momentTimezone = _commonjsHelpers.createCommonjsModule(function (module) {
7
7
  //! moment-timezone.js