@mjhls/mjh-framework 1.0.720-beta.0 → 1.0.720-navigation-scroll-fix-v2

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 (102) hide show
  1. package/dist/cjs/ArticleCarousel.js +1 -1
  2. package/dist/cjs/ArticleProgramLandingPage.js +6 -6
  3. package/dist/cjs/ArticleSeriesLandingPage.js +3 -3
  4. package/dist/cjs/ArticleSeriesListing.js +2 -2
  5. package/dist/cjs/Auth.js +11 -211
  6. package/dist/cjs/{BlockContent-091a991f.js → BlockContent-80b15fac.js} +1 -1
  7. package/dist/cjs/ConferenceArticleCard.js +1 -1
  8. package/dist/cjs/DeckContent.js +2 -2
  9. package/dist/cjs/DeckQueue.js +2 -2
  10. package/dist/cjs/ExternalResources.js +4 -4
  11. package/dist/cjs/Feature.js +1 -1
  12. package/dist/cjs/ForbesHero.js +1 -1
  13. package/dist/cjs/GridContent.js +3 -3
  14. package/dist/cjs/GridHero.js +1 -1
  15. package/dist/cjs/GroupDeck.js +1 -1
  16. package/dist/cjs/HamMagazine.js +9 -8
  17. package/dist/cjs/Hero.js +1 -1
  18. package/dist/cjs/HorizontalArticleListing.js +4 -4
  19. package/dist/cjs/HorizontalHero.js +1 -1
  20. package/dist/cjs/IssueContentDeck.js +1 -1
  21. package/dist/cjs/IssueDeck.js +1 -1
  22. package/dist/cjs/IssueLanding.js +2 -2
  23. package/dist/cjs/MasterDeck.js +3 -3
  24. package/dist/cjs/OncliveHero.js +1 -1
  25. package/dist/cjs/OncliveLargeHero.js +1 -1
  26. package/dist/cjs/PartnerDetailListing.js +7 -7
  27. package/dist/cjs/PublicationDeck.js +2 -2
  28. package/dist/cjs/QueueDeckExpanded.js +2 -2
  29. package/dist/cjs/RecentNews.js +1 -1
  30. package/dist/cjs/RelatedContent.js +1 -1
  31. package/dist/cjs/TaxonomyCard.js +2 -2
  32. package/dist/cjs/TaxonomyDescription.js +4 -4
  33. package/dist/cjs/ThumbnailCard.js +1 -1
  34. package/dist/cjs/VerticalHero.js +1 -1
  35. package/dist/cjs/VideoProgramLandingPage.js +6 -6
  36. package/dist/cjs/VideoSeriesCard.js +3 -3
  37. package/dist/cjs/VideoSeriesLandingPage.js +5 -5
  38. package/dist/cjs/VideoSeriesListing.js +2 -2
  39. package/dist/cjs/View.js +32 -32
  40. package/dist/cjs/YahooHero.js +1 -1
  41. package/dist/cjs/YoutubeGroup.js +9 -11
  42. package/dist/cjs/getRelatedArticle.js +416 -5
  43. package/dist/cjs/getSerializers.js +4 -4
  44. package/dist/cjs/{getTargeting-9af0ef69.js → getTargeting-fee8c429.js} +2 -2
  45. package/dist/cjs/getTargeting.js +1 -1
  46. package/dist/cjs/{index-be0c82be.js → index-39beccb3.js} +2 -1
  47. package/dist/cjs/{index-792274b1.js → index-a2ecf598.js} +451 -439
  48. package/dist/cjs/index-bd6c9f56.js +211 -0
  49. package/dist/cjs/index.js +9 -9
  50. package/dist/cjs/{inherits-c9f99d47.js → inherits-513d81cd.js} +4 -4
  51. package/dist/cjs/{lodash-fc2922d0.js → lodash-7fd85bcf.js} +71 -22
  52. package/dist/cjs/urlFor.js +1 -1
  53. package/dist/esm/ArticleCarousel.js +1 -1
  54. package/dist/esm/ArticleProgramLandingPage.js +3 -3
  55. package/dist/esm/ArticleSeriesLandingPage.js +2 -2
  56. package/dist/esm/ArticleSeriesListing.js +1 -1
  57. package/dist/esm/Auth.js +3 -203
  58. package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-c409aca5.js} +1 -1
  59. package/dist/esm/ConferenceArticleCard.js +1 -1
  60. package/dist/esm/DeckContent.js +1 -1
  61. package/dist/esm/DeckQueue.js +1 -1
  62. package/dist/esm/ExternalResources.js +3 -3
  63. package/dist/esm/Feature.js +1 -1
  64. package/dist/esm/ForbesHero.js +1 -1
  65. package/dist/esm/GridContent.js +2 -2
  66. package/dist/esm/GridHero.js +1 -1
  67. package/dist/esm/GroupDeck.js +1 -1
  68. package/dist/esm/HamMagazine.js +9 -8
  69. package/dist/esm/Hero.js +1 -1
  70. package/dist/esm/HorizontalArticleListing.js +3 -3
  71. package/dist/esm/HorizontalHero.js +1 -1
  72. package/dist/esm/IssueContentDeck.js +1 -1
  73. package/dist/esm/IssueDeck.js +1 -1
  74. package/dist/esm/IssueLanding.js +2 -2
  75. package/dist/esm/MasterDeck.js +2 -2
  76. package/dist/esm/OncliveHero.js +1 -1
  77. package/dist/esm/OncliveLargeHero.js +1 -1
  78. package/dist/esm/PartnerDetailListing.js +4 -4
  79. package/dist/esm/PublicationDeck.js +2 -2
  80. package/dist/esm/QueueDeckExpanded.js +2 -2
  81. package/dist/esm/RecentNews.js +1 -1
  82. package/dist/esm/RelatedContent.js +1 -1
  83. package/dist/esm/TaxonomyCard.js +2 -2
  84. package/dist/esm/TaxonomyDescription.js +3 -3
  85. package/dist/esm/ThumbnailCard.js +1 -1
  86. package/dist/esm/VerticalHero.js +1 -1
  87. package/dist/esm/VideoProgramLandingPage.js +3 -3
  88. package/dist/esm/VideoSeriesCard.js +1 -1
  89. package/dist/esm/VideoSeriesLandingPage.js +2 -2
  90. package/dist/esm/VideoSeriesListing.js +1 -1
  91. package/dist/esm/View.js +5 -5
  92. package/dist/esm/YahooHero.js +1 -1
  93. package/dist/esm/YoutubeGroup.js +9 -11
  94. package/dist/esm/getRelatedArticle.js +416 -5
  95. package/dist/esm/getSerializers.js +3 -3
  96. package/dist/esm/{index-c3a5ff39.js → index-2749e7d8.js} +450 -438
  97. package/dist/esm/{index-73819142.js → index-3849e3fe.js} +2 -1
  98. package/dist/esm/index-db3bb315.js +207 -0
  99. package/dist/esm/index.js +6 -6
  100. package/dist/esm/{lodash-17fdfebb.js → lodash-ec8c6b48.js} +71 -22
  101. package/dist/esm/urlFor.js +1 -1
  102. package/package.json +3 -3
@@ -15,7 +15,7 @@ var React = require('react');
15
15
  var React__default = _interopDefault(React);
16
16
  require('prop-types');
17
17
  require('react-dom');
18
- var index$1 = require('./index-be0c82be.js');
18
+ var index$1 = require('./index-39beccb3.js');
19
19
  var index$2 = require('./index-da796b8c.js');
20
20
  var main = require('./main-02daeefe.js');
21
21
  var slicedToArray = require('./slicedToArray-8f385299.js');
@@ -33,7 +33,6 @@ var YoutubeGroup = function YoutubeGroup(props) {
33
33
  var innerSlider = React.useRef(null);
34
34
  var tileArray = React.useRef([]);
35
35
  var viewableWindow = React.useRef(null);
36
- var viewableArea = React.useRef(null);
37
36
 
38
37
  var _useState = React.useState(0),
39
38
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -77,47 +76,46 @@ var YoutubeGroup = function YoutubeGroup(props) {
77
76
  var setThumbSize = function setThumbSize() {
78
77
  var thumbSize = void 0;
79
78
  var scrollerVisible = false;
80
- var tileDividerWidth = parseInt(getComputedStyle(document.documentElement).fontSize) / 2 || 8;
81
79
 
82
80
  if (viewableWindow.current.offsetWidth > 1399) {
83
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 5) / 6);
81
+ thumbSize = Math.floor(viewableWindow.current.clientWidth / 6);
84
82
  if (props.dataset.length > 5) {
85
83
  scrollerVisible = true;
86
84
  }
87
85
  }
88
86
  if (viewableWindow.current.offsetWidth < 1399 && viewableWindow.current.offsetWidth > 992) {
89
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 5) / 6);
87
+ thumbSize = Math.floor((viewableWindow.current.clientWidth + 50) / 6);
90
88
  if (props.dataset.length > 5) {
91
89
  scrollerVisible = true;
92
90
  }
93
91
  }
94
92
  if (viewableWindow.current.offsetWidth < 992 && viewableWindow.current.offsetWidth > 768) {
95
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 3) / 4);
93
+ thumbSize = Math.floor((viewableWindow.current.clientWidth + 50) / 4);
96
94
  if (props.dataset.length > 4) {
97
95
  scrollerVisible = true;
98
96
  }
99
97
  }
100
98
  if (viewableWindow.current.offsetWidth < 768 && viewableWindow.current.offsetWidth > 604) {
101
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 2) / 3);
99
+ thumbSize = Math.floor((viewableWindow.current.clientWidth + 50) / 3);
102
100
  if (props.dataset.length > 3) {
103
101
  scrollerVisible = true;
104
102
  }
105
103
  }
106
104
  if (viewableWindow.current.offsetWidth < 604) {
107
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 2) / 3);
105
+ thumbSize = Math.floor(viewableWindow.current.clientWidth / 3);
108
106
  if (props.dataset.length > 3) {
109
107
  scrollerVisible = true;
110
108
  }
111
109
  }
112
110
 
113
111
  if (main.main_36) {
114
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth) / 2);
112
+ thumbSize = Math.floor(viewableWindow.current.clientWidth / 2);
115
113
  if (props.dataset.length > 2) {
116
114
  scrollerVisible = true;
117
115
  }
118
116
  }
119
117
  if (main.main_41) {
120
- thumbSize = Math.floor((viewableArea.current.clientWidth - tileDividerWidth * 2) / 3);
118
+ thumbSize = Math.floor((viewableWindow.current.clientWidth + 50) / 3);
121
119
  if (props.dataset.length > 3) {
122
120
  scrollerVisible = true;
123
121
  }
@@ -209,7 +207,7 @@ var YoutubeGroup = function YoutubeGroup(props) {
209
207
  { ref: viewableWindow, id: 'vid-slider', style: { maxWidth: '100%' }, className: 'col' },
210
208
  React__default.createElement(
211
209
  'div',
212
- { ref: viewableArea, className: 'row', style: { display: 'flex', alignItems: 'center' } },
210
+ { className: 'row', style: { display: 'flex', alignItems: 'center' } },
213
211
  showScroller && showScroller && React__default.createElement(
214
212
  'div',
215
213
  {
@@ -1,6 +1,6 @@
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('./es6.string.iterator-cc0bbaa4.js');
6
6
  require('./_library-dd23b178.js');
@@ -9,9 +9,420 @@ require('./core.get-iterator-method-f62321d4.js');
9
9
  require('./web.dom.iterable-a0e279c1.js');
10
10
  var asyncToGenerator = require('./asyncToGenerator-533d476a.js');
11
11
  require('./_set-species-f92c67c5.js');
12
- var nookies = require('nookies');
12
+ var index$5 = require('./index-bd6c9f56.js');
13
13
  var getQuery = require('./getQuery.js');
14
14
 
15
+ var defaultParseOptions = {
16
+ decodeValues: true,
17
+ map: false,
18
+ silent: false,
19
+ };
20
+
21
+ function isNonEmptyString(str) {
22
+ return typeof str === "string" && !!str.trim();
23
+ }
24
+
25
+ function parseString(setCookieValue, options) {
26
+ var parts = setCookieValue.split(";").filter(isNonEmptyString);
27
+ var nameValue = parts.shift().split("=");
28
+ var name = nameValue.shift();
29
+ var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
30
+
31
+ options = options
32
+ ? Object.assign({}, defaultParseOptions, options)
33
+ : defaultParseOptions;
34
+
35
+ try {
36
+ value = options.decodeValues ? decodeURIComponent(value) : value; // decode cookie value
37
+ } catch (e) {
38
+ console.error(
39
+ `set-cookie-parser encountered an error while decoding a cookie with value '${value}'. Set options.decodeValues to false to disable this feature.`,
40
+ e
41
+ );
42
+ }
43
+
44
+ var cookie = {
45
+ name: name, // grab everything before the first =
46
+ value: value,
47
+ };
48
+
49
+ parts.forEach(function (part) {
50
+ var sides = part.split("=");
51
+ var key = sides.shift().trimLeft().toLowerCase();
52
+ var value = sides.join("=");
53
+ if (key === "expires") {
54
+ cookie.expires = new Date(value);
55
+ } else if (key === "max-age") {
56
+ cookie.maxAge = parseInt(value, 10);
57
+ } else if (key === "secure") {
58
+ cookie.secure = true;
59
+ } else if (key === "httponly") {
60
+ cookie.httpOnly = true;
61
+ } else if (key === "samesite") {
62
+ cookie.sameSite = value;
63
+ } else {
64
+ cookie[key] = value;
65
+ }
66
+ });
67
+
68
+ return cookie;
69
+ }
70
+
71
+ function parse(input, options) {
72
+ options = options
73
+ ? Object.assign({}, defaultParseOptions, options)
74
+ : defaultParseOptions;
75
+
76
+ if (!input) {
77
+ if (!options.map) {
78
+ return [];
79
+ } else {
80
+ return {};
81
+ }
82
+ }
83
+
84
+ if (input.headers && input.headers["set-cookie"]) {
85
+ // fast-path for node.js (which automatically normalizes header names to lower-case
86
+ input = input.headers["set-cookie"];
87
+ } else if (input.headers) {
88
+ // slow-path for other environments - see #25
89
+ var sch =
90
+ input.headers[
91
+ Object.keys(input.headers).find(function (key) {
92
+ return key.toLowerCase() === "set-cookie";
93
+ })
94
+ ];
95
+ // warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
96
+ if (!sch && input.headers.cookie && !options.silent) {
97
+ console.warn(
98
+ "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."
99
+ );
100
+ }
101
+ input = sch;
102
+ }
103
+ if (!Array.isArray(input)) {
104
+ input = [input];
105
+ }
106
+
107
+ options = options
108
+ ? Object.assign({}, defaultParseOptions, options)
109
+ : defaultParseOptions;
110
+
111
+ if (!options.map) {
112
+ return input.filter(isNonEmptyString).map(function (str) {
113
+ return parseString(str, options);
114
+ });
115
+ } else {
116
+ var cookies = {};
117
+ return input.filter(isNonEmptyString).reduce(function (cookies, str) {
118
+ var cookie = parseString(str, options);
119
+ cookies[cookie.name] = cookie;
120
+ return cookies;
121
+ }, cookies);
122
+ }
123
+ }
124
+
125
+ /*
126
+ Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
127
+ that are within a single set-cookie field-value, such as in the Expires portion.
128
+
129
+ This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
130
+ Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
131
+ React Native's fetch does this for *every* header, including set-cookie.
132
+
133
+ Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
134
+ Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
135
+ */
136
+ function splitCookiesString(cookiesString) {
137
+ if (Array.isArray(cookiesString)) {
138
+ return cookiesString;
139
+ }
140
+ if (typeof cookiesString !== "string") {
141
+ return [];
142
+ }
143
+
144
+ var cookiesStrings = [];
145
+ var pos = 0;
146
+ var start;
147
+ var ch;
148
+ var lastComma;
149
+ var nextStart;
150
+ var cookiesSeparatorFound;
151
+
152
+ function skipWhitespace() {
153
+ while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
154
+ pos += 1;
155
+ }
156
+ return pos < cookiesString.length;
157
+ }
158
+
159
+ function notSpecialChar() {
160
+ ch = cookiesString.charAt(pos);
161
+
162
+ return ch !== "=" && ch !== ";" && ch !== ",";
163
+ }
164
+
165
+ while (pos < cookiesString.length) {
166
+ start = pos;
167
+ cookiesSeparatorFound = false;
168
+
169
+ while (skipWhitespace()) {
170
+ ch = cookiesString.charAt(pos);
171
+ if (ch === ",") {
172
+ // ',' is a cookie separator if we have later first '=', not ';' or ','
173
+ lastComma = pos;
174
+ pos += 1;
175
+
176
+ skipWhitespace();
177
+ nextStart = pos;
178
+
179
+ while (pos < cookiesString.length && notSpecialChar()) {
180
+ pos += 1;
181
+ }
182
+
183
+ // currently special character
184
+ if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
185
+ // we found cookies separator
186
+ cookiesSeparatorFound = true;
187
+ // pos is inside the next cookie, so back up and return it.
188
+ pos = nextStart;
189
+ cookiesStrings.push(cookiesString.substring(start, lastComma));
190
+ start = pos;
191
+ } else {
192
+ // in param ',' or param separator ';',
193
+ // we continue from that comma
194
+ pos = lastComma + 1;
195
+ }
196
+ } else {
197
+ pos += 1;
198
+ }
199
+ }
200
+
201
+ if (!cookiesSeparatorFound || pos >= cookiesString.length) {
202
+ cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
203
+ }
204
+ }
205
+
206
+ return cookiesStrings;
207
+ }
208
+
209
+ var setCookie = parse;
210
+ var parse_1 = parse;
211
+ var parseString_1 = parseString;
212
+ var splitCookiesString_1 = splitCookiesString;
213
+ setCookie.parse = parse_1;
214
+ setCookie.parseString = parseString_1;
215
+ setCookie.splitCookiesString = splitCookiesString_1;
216
+
217
+ var utils = _commonjsHelpers.createCommonjsModule(function (module, exports) {
218
+ var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
219
+ __assign = Object.assign || function(t) {
220
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
221
+ s = arguments[i];
222
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
223
+ t[p] = s[p];
224
+ }
225
+ return t;
226
+ };
227
+ return __assign.apply(this, arguments);
228
+ };
229
+ Object.defineProperty(exports, "__esModule", { value: true });
230
+ exports.areCookiesEqual = exports.hasSameProperties = exports.createCookie = exports.isBrowser = void 0;
231
+ /**
232
+ * Tells whether we are in a browser or server.
233
+ */
234
+ function isBrowser() {
235
+ return typeof window !== 'undefined';
236
+ }
237
+ exports.isBrowser = isBrowser;
238
+ /**
239
+ * Create an instance of the Cookie interface
240
+ */
241
+ function createCookie(name, value, options) {
242
+ var sameSite = options.sameSite;
243
+ if (sameSite === true) {
244
+ sameSite = 'strict';
245
+ }
246
+ if (sameSite === undefined || sameSite === false) {
247
+ sameSite = 'lax';
248
+ }
249
+ var cookieToSet = __assign(__assign({}, options), { sameSite: sameSite });
250
+ delete cookieToSet.encode;
251
+ return __assign({ name: name, value: value }, cookieToSet);
252
+ }
253
+ exports.createCookie = createCookie;
254
+ /**
255
+ * Tells whether given objects have the same properties.
256
+ */
257
+ function hasSameProperties(a, b) {
258
+ var aProps = Object.getOwnPropertyNames(a);
259
+ var bProps = Object.getOwnPropertyNames(b);
260
+ if (aProps.length !== bProps.length) {
261
+ return false;
262
+ }
263
+ for (var i = 0; i < aProps.length; i++) {
264
+ var propName = aProps[i];
265
+ if (a[propName] !== b[propName]) {
266
+ return false;
267
+ }
268
+ }
269
+ return true;
270
+ }
271
+ exports.hasSameProperties = hasSameProperties;
272
+ /**
273
+ * Compare the cookie and return true if the cookies have equivalent
274
+ * options and the cookies would be overwritten in the browser storage.
275
+ *
276
+ * @param a first Cookie for comparison
277
+ * @param b second Cookie for comparison
278
+ */
279
+ function areCookiesEqual(a, b) {
280
+ var sameSiteSame = a.sameSite === b.sameSite;
281
+ if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
282
+ sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
283
+ }
284
+ return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
285
+ }
286
+ exports.areCookiesEqual = areCookiesEqual;
287
+ /* Functions */
288
+
289
+ });
290
+
291
+ _commonjsHelpers.unwrapExports(utils);
292
+ var utils_1 = utils.areCookiesEqual;
293
+ var utils_2 = utils.hasSameProperties;
294
+ var utils_3 = utils.createCookie;
295
+ var utils_4 = utils.isBrowser;
296
+
297
+ var dist = _commonjsHelpers.createCommonjsModule(function (module, exports) {
298
+ var __assign = (_commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.__assign) || function () {
299
+ __assign = Object.assign || function(t) {
300
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
301
+ s = arguments[i];
302
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
303
+ t[p] = s[p];
304
+ }
305
+ return t;
306
+ };
307
+ return __assign.apply(this, arguments);
308
+ };
309
+ Object.defineProperty(exports, "__esModule", { value: true });
310
+ exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
311
+
312
+
313
+
314
+ /**
315
+ * Parses cookies.
316
+ *
317
+ * @param ctx NextJS page or API context, express context, null or undefined.
318
+ * @param options Options that we pass down to `cookie` library.
319
+ */
320
+ function parseCookies(ctx, options) {
321
+ var _a, _b;
322
+ 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) {
323
+ return index$5.cookie.parse(ctx.req.headers.cookie, options);
324
+ }
325
+ if (utils.isBrowser()) {
326
+ return index$5.cookie.parse(document.cookie, options);
327
+ }
328
+ return {};
329
+ }
330
+ exports.parseCookies = parseCookies;
331
+ /**
332
+ * Sets a cookie.
333
+ *
334
+ * @param ctx NextJS page or API context, express context, null or undefined.
335
+ * @param name The name of your cookie.
336
+ * @param value The value of your cookie.
337
+ * @param options Options that we pass down to `cookie` library.
338
+ */
339
+ function setCookie$1(ctx, name, value, options) {
340
+ var _a, _b;
341
+ if (options === void 0) { options = {}; }
342
+ // SSR
343
+ if (((_a = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _a === void 0 ? void 0 : _a.getHeader) && ctx.res.setHeader) {
344
+ // Check if response has finished and warn about it.
345
+ if ((_b = ctx === null || ctx === void 0 ? void 0 : ctx.res) === null || _b === void 0 ? void 0 : _b.finished) {
346
+ console.warn("Not setting \"" + name + "\" cookie. Response has finished.");
347
+ console.warn("You should set cookie before res.send()");
348
+ return {};
349
+ }
350
+ /**
351
+ * Load existing cookies from the header and parse them.
352
+ */
353
+ var cookies = ctx.res.getHeader('Set-Cookie') || [];
354
+ if (typeof cookies === 'string')
355
+ cookies = [cookies];
356
+ if (typeof cookies === 'number')
357
+ cookies = [];
358
+ /**
359
+ * Parse cookies but ignore values - we've already encoded
360
+ * them in the previous call.
361
+ */
362
+ var parsedCookies = setCookie.parse(cookies, {
363
+ decodeValues: false,
364
+ });
365
+ /**
366
+ * We create the new cookie and make sure that none of
367
+ * the existing cookies match it.
368
+ */
369
+ var newCookie_1 = utils.createCookie(name, value, options);
370
+ var cookiesToSet_1 = [];
371
+ parsedCookies.forEach(function (parsedCookie) {
372
+ if (!utils.areCookiesEqual(parsedCookie, newCookie_1)) {
373
+ /**
374
+ * We serialize the cookie back to the original format
375
+ * if it isn't the same as the new one.
376
+ */
377
+ var serializedCookie = index$5.cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({
378
+ // we prevent reencoding by default, but you might override it
379
+ encode: function (val) { return val; } }, parsedCookie));
380
+ cookiesToSet_1.push(serializedCookie);
381
+ }
382
+ });
383
+ cookiesToSet_1.push(index$5.cookie.serialize(name, value, options));
384
+ // Update the header.
385
+ ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
386
+ }
387
+ // Browser
388
+ if (utils.isBrowser()) {
389
+ if (options && options.httpOnly) {
390
+ throw new Error('Can not set a httpOnly cookie in the browser.');
391
+ }
392
+ document.cookie = index$5.cookie.serialize(name, value, options);
393
+ }
394
+ return {};
395
+ }
396
+ exports.setCookie = setCookie$1;
397
+ /**
398
+ * Destroys a cookie with a particular name.
399
+ *
400
+ * @param ctx NextJS page or API context, express context, null or undefined.
401
+ * @param name Cookie name.
402
+ * @param options Options that we pass down to `cookie` library.
403
+ */
404
+ function destroyCookie(ctx, name, options) {
405
+ /**
406
+ * We forward the request destroy to setCookie function
407
+ * as it is the same function with modified maxAge value.
408
+ */
409
+ return setCookie$1(ctx, name, '', __assign(__assign({}, (options || {})), { maxAge: -1 }));
410
+ }
411
+ exports.destroyCookie = destroyCookie;
412
+ /* Utility Exports */
413
+ exports.default = {
414
+ set: setCookie$1,
415
+ get: parseCookies,
416
+ destroy: destroyCookie,
417
+ };
418
+
419
+ });
420
+
421
+ _commonjsHelpers.unwrapExports(dist);
422
+ var dist_1 = dist.destroyCookie;
423
+ var dist_2 = dist.setCookie;
424
+ var dist_3 = dist.parseCookies;
425
+
15
426
  var _this = undefined;
16
427
 
17
428
  var getRelatedArticle = function () {
@@ -88,13 +499,13 @@ var getRelatedArticle = function () {
88
499
 
89
500
 
90
501
  if (ctx && url) {
91
- cookies = nookies.parseCookies(ctx);
502
+ cookies = dist_3(ctx);
92
503
  prevSlugs = cookies['prevSlugs'];
93
504
 
94
505
  if (!!prevSlugs) {
95
- nookies.setCookie(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
506
+ dist_2(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
96
507
  filters = '&& !(url.current in [' + prevSlugs + '])';
97
- } else nookies.setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
508
+ } else dist_2(ctx, 'prevSlugs', '"' + url + '"', {});
98
509
  }
99
510
 
100
511
  query = getQuery('related', filters, '', articleCount).replace('&& taxonomyMapping[]._ref in $taxonomy', '');
@@ -10,7 +10,7 @@ require('./core.get-iterator-method-f62321d4.js');
10
10
  require('./_object-pie-68c5bcbc.js');
11
11
  require('./extends-60837c34.js');
12
12
  require('./_object-sap-5e74ba08.js');
13
- require('./inherits-c9f99d47.js');
13
+ require('./inherits-513d81cd.js');
14
14
  require('./define-property-f4d12f4e.js');
15
15
  require('./web.dom.iterable-a0e279c1.js');
16
16
  require('./typeof-725500bc.js');
@@ -25,7 +25,7 @@ require('next/router');
25
25
  require('./isSymbol-04666465.js');
26
26
  require('./debounce-eb287781.js');
27
27
  require('react-dom');
28
- require('./index-be0c82be.js');
28
+ require('./index-39beccb3.js');
29
29
  require('./index-da796b8c.js');
30
30
  require('./main-02daeefe.js');
31
31
  require('./entities-310b46ee.js');
@@ -36,14 +36,14 @@ require('./_set-species-f92c67c5.js');
36
36
  require('./Segment.js');
37
37
  require('./Beam.js');
38
38
  require('./AdSlot.js');
39
- require('./BlockContent-091a991f.js');
39
+ require('./BlockContent-80b15fac.js');
40
40
  require('./index-187c967e.js');
41
41
  require('./smoothscroll-5054361f.js');
42
42
  require('./GroupDeck.js');
43
43
  require('react-bootstrap');
44
44
  require('./iconBase-68959171.js');
45
45
  require('./index.esm-90433435.js');
46
- var getSerializers = require('./index-792274b1.js');
46
+ var getSerializers = require('./index-a2ecf598.js');
47
47
  require('./util-f2c1b65b.js');
48
48
  require('./brightcove-react-player-loader.es-156bd4d6.js');
49
49
  require('./_object-to-array-5762f850.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var toConsumableArray = require('./toConsumableArray-9a3476fe.js');
4
- var _extends$1 = require('./extends-60837c34.js');
4
+ var _extends = require('./extends-60837c34.js');
5
5
 
6
6
  var getContentPlacementUrl = function getContentPlacementUrl(cp) {
7
7
  var cp_url = '';
@@ -133,7 +133,7 @@ var getTargeting = function getTargeting(props) {
133
133
  }
134
134
 
135
135
  if (props.cache && props.cache.hyperTargeting) {
136
- targeting = _extends$1._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
136
+ targeting = _extends._extends({}, targeting, { campaign_id: props.cache.hyperTargeting });
137
137
  }
138
138
 
139
139
  if (position && position.length) {
@@ -8,7 +8,7 @@ require('./toConsumableArray-9a3476fe.js');
8
8
  require('./core.get-iterator-method-f62321d4.js');
9
9
  require('./_object-pie-68c5bcbc.js');
10
10
  require('./extends-60837c34.js');
11
- var getTargeting = require('./getTargeting-9af0ef69.js');
11
+ var getTargeting = require('./getTargeting-fee8c429.js');
12
12
 
13
13
 
14
14
 
@@ -377,7 +377,8 @@ function urlBuilder(options) {
377
377
  var client = options;
378
378
  if (isSanityClient(client)) {
379
379
  // Inherit config from client
380
- var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
380
+ var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
381
+ var apiHost = apiUrl || 'https://api.sanity.io';
381
382
  return new ImageUrlBuilder(null, {
382
383
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
383
384
  projectId: projectId,