@mjhls/mjh-framework 1.0.691-beta.4 → 1.0.691-beta.5
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.
- package/dist/cjs/AD.js +1 -1
- package/dist/cjs/AD300x250.js +2 -2
- package/dist/cjs/AD300x250x600.js +2 -2
- package/dist/cjs/AD728x90.js +2 -2
- package/dist/cjs/ADFloatingFooter.js +2 -2
- package/dist/cjs/ADGutter.js +4 -6
- package/dist/cjs/{ADInfeed-24664851.js → ADInfeed-8952e375.js} +2 -4
- package/dist/cjs/ADSkyscraper.js +4 -6
- package/dist/cjs/ADSponsoredResources.js +2 -2
- package/dist/cjs/ADWebcast.js +4 -6
- package/dist/cjs/ADWelcome.js +2 -2
- package/dist/cjs/{ADlgInfeed-c417a192.js → ADlgInfeed-20c916fc.js} +2 -4
- package/dist/cjs/AdSlot.js +5 -11
- package/dist/cjs/AdSlotsProvider.js +8 -5
- package/dist/cjs/ArticleCarousel.js +1 -1
- package/dist/cjs/ArticleSeriesListing.js +2 -2
- package/dist/cjs/Auth.js +211 -11
- package/dist/cjs/{BlockContent-091a991f.js → BlockContent-80b15fac.js} +1 -1
- package/dist/cjs/BrowseVideosListing.js +1 -1
- package/dist/cjs/CMEDeck.js +2 -2
- package/dist/cjs/Column3.js +2 -2
- package/dist/cjs/ConferenceArticleCard.js +1 -1
- package/dist/cjs/DeckContent.js +4 -4
- package/dist/cjs/DeckQueue.js +3 -3
- package/dist/cjs/{Dfp-f6a18ed2.js → Dfp-390337bf.js} +1 -1
- package/dist/cjs/EventsDeck.js +1 -1
- package/dist/cjs/ExternalResources.js +5 -5
- package/dist/cjs/Feature.js +2 -2
- package/dist/cjs/ForbesHero.js +1 -1
- package/dist/cjs/GridContent.js +6 -6
- package/dist/cjs/GridHero.js +1 -1
- package/dist/cjs/GroupDeck.js +1 -1
- package/dist/cjs/HamMagazine.js +2 -2
- package/dist/cjs/Hero.js +1 -1
- package/dist/cjs/HorizontalHero.js +1 -1
- package/dist/cjs/IssueContentDeck.js +1 -1
- package/dist/cjs/IssueDeck.js +1 -1
- package/dist/cjs/IssueLanding.js +6 -6
- package/dist/cjs/LeftNav.js +2 -2
- package/dist/cjs/MasterDeck.js +6 -6
- package/dist/cjs/NavMagazine.js +2 -2
- package/dist/cjs/NavNative.js +2 -2
- package/dist/cjs/OncliveHero.js +1 -1
- package/dist/cjs/OncliveLargeHero.js +1 -1
- package/dist/cjs/PartnerDetailListing.js +15 -15
- package/dist/cjs/PublicationDeck.js +2 -2
- package/dist/cjs/QueueDeckExpanded.js +6 -6
- package/dist/cjs/RecentNews.js +1 -1
- package/dist/cjs/RelatedContent.js +1 -1
- package/dist/cjs/{SocialSearchComponent-9cd24578.js → SocialSearchComponent-56d49a1a.js} +1 -1
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -3
- package/dist/cjs/ThumbnailCard.js +1 -1
- package/dist/cjs/Ustream.js +1 -1
- package/dist/cjs/VerticalHero.js +1 -1
- package/dist/cjs/VideoSeriesCard.js +1 -1
- package/dist/cjs/VideoSeriesListing.js +2 -2
- package/dist/cjs/View.js +34 -34
- package/dist/cjs/YahooHero.js +1 -1
- package/dist/cjs/YoutubeGroup.js +1 -1
- package/dist/cjs/getRelatedArticle.js +5 -354
- package/dist/cjs/getSerializers.js +5 -5
- package/dist/cjs/{getTargeting-9af0ef69.js → getTargeting-fee8c429.js} +2 -2
- package/dist/cjs/getTargeting.js +1 -1
- package/dist/cjs/{index-fa8ed292.js → index-099d45ae.js} +30 -21
- package/dist/cjs/{index-d80358aa.js → index-0fff88e9.js} +452 -440
- package/dist/cjs/{index-be0c82be.js → index-39beccb3.js} +2 -1
- package/dist/cjs/index.js +13 -13
- package/dist/cjs/{lodash-fc2922d0.js → lodash-7fd85bcf.js} +71 -22
- package/dist/cjs/{main-a4cb15bb.js → main-03ffa84c.js} +1 -0
- package/dist/cjs/urlFor.js +1 -1
- package/dist/esm/AD.js +1 -1
- package/dist/esm/AD300x250.js +2 -2
- package/dist/esm/AD300x250x600.js +2 -2
- package/dist/esm/AD728x90.js +2 -2
- package/dist/esm/ADFloatingFooter.js +2 -2
- package/dist/esm/ADGutter.js +4 -6
- package/dist/esm/{ADInfeed-ffcb5391.js → ADInfeed-1153eefc.js} +2 -4
- package/dist/esm/ADSkyscraper.js +4 -6
- package/dist/esm/ADSponsoredResources.js +2 -2
- package/dist/esm/ADWebcast.js +4 -6
- package/dist/esm/ADWelcome.js +2 -2
- package/dist/esm/{ADlgInfeed-6df5151e.js → ADlgInfeed-8cb4e36a.js} +2 -4
- package/dist/esm/AdSlot.js +5 -11
- package/dist/esm/AdSlotsProvider.js +8 -5
- package/dist/esm/ArticleCarousel.js +1 -1
- package/dist/esm/ArticleSeriesListing.js +2 -2
- package/dist/esm/Auth.js +203 -3
- package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-c409aca5.js} +1 -1
- package/dist/esm/BrowseVideosListing.js +1 -1
- package/dist/esm/CMEDeck.js +2 -2
- package/dist/esm/Column3.js +2 -2
- package/dist/esm/ConferenceArticleCard.js +1 -1
- package/dist/esm/DeckContent.js +4 -4
- package/dist/esm/DeckQueue.js +3 -3
- package/dist/esm/{Dfp-96b49def.js → Dfp-741c01be.js} +1 -1
- package/dist/esm/EventsDeck.js +1 -1
- package/dist/esm/ExternalResources.js +5 -5
- package/dist/esm/Feature.js +2 -2
- package/dist/esm/ForbesHero.js +1 -1
- package/dist/esm/GridContent.js +6 -6
- package/dist/esm/GridHero.js +1 -1
- package/dist/esm/GroupDeck.js +1 -1
- package/dist/esm/HamMagazine.js +2 -2
- package/dist/esm/Hero.js +1 -1
- package/dist/esm/HorizontalHero.js +1 -1
- package/dist/esm/IssueContentDeck.js +1 -1
- package/dist/esm/IssueDeck.js +1 -1
- package/dist/esm/IssueLanding.js +6 -6
- package/dist/esm/LeftNav.js +2 -2
- package/dist/esm/MasterDeck.js +6 -6
- package/dist/esm/NavMagazine.js +2 -2
- package/dist/esm/NavNative.js +2 -2
- package/dist/esm/OncliveHero.js +1 -1
- package/dist/esm/OncliveLargeHero.js +1 -1
- package/dist/esm/PartnerDetailListing.js +13 -13
- package/dist/esm/PublicationDeck.js +2 -2
- package/dist/esm/QueueDeckExpanded.js +6 -6
- package/dist/esm/RecentNews.js +1 -1
- package/dist/esm/RelatedContent.js +1 -1
- package/dist/esm/{SocialSearchComponent-93233334.js → SocialSearchComponent-677ed3bd.js} +1 -1
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -3
- package/dist/esm/ThumbnailCard.js +1 -1
- package/dist/esm/Ustream.js +1 -1
- package/dist/esm/VerticalHero.js +1 -1
- package/dist/esm/VideoSeriesCard.js +1 -1
- package/dist/esm/VideoSeriesListing.js +2 -2
- package/dist/esm/View.js +9 -9
- package/dist/esm/YahooHero.js +1 -1
- package/dist/esm/YoutubeGroup.js +1 -1
- package/dist/esm/getRelatedArticle.js +5 -354
- package/dist/esm/getSerializers.js +5 -5
- package/dist/esm/{index-73819142.js → index-3849e3fe.js} +2 -1
- package/dist/esm/{index-0e45a0b2.js → index-3f4dd6f2.js} +30 -21
- package/dist/esm/{index-1ee3baee.js → index-792a492f.js} +452 -440
- package/dist/esm/index.js +11 -11
- package/dist/esm/{lodash-17fdfebb.js → lodash-ec8c6b48.js} +71 -22
- package/dist/esm/{main-5d1e4bd3.js → main-35ff7b4f.js} +1 -1
- package/dist/esm/urlFor.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/index-bd6c9f56.js +0 -211
- package/dist/esm/index-db3bb315.js +0 -207
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './_commonjsHelpers-0c4b6f40.js';
|
|
2
2
|
import './_to-object-ded78eb9.js';
|
|
3
3
|
import './es6.string.iterator-9b2af4a5.js';
|
|
4
4
|
import './_library-528f1934.js';
|
|
@@ -7,358 +7,9 @@ import './core.get-iterator-method-54d2e411.js';
|
|
|
7
7
|
import './web.dom.iterable-8956f9a5.js';
|
|
8
8
|
import { a as _asyncToGenerator, r as regenerator } from './asyncToGenerator-7c654f36.js';
|
|
9
9
|
import './_set-species-cede29f8.js';
|
|
10
|
-
import {
|
|
10
|
+
import { parseCookies, setCookie } from 'nookies';
|
|
11
11
|
import getQuery from './getQuery.js';
|
|
12
12
|
|
|
13
|
-
var defaultParseOptions = {
|
|
14
|
-
decodeValues: true,
|
|
15
|
-
map: false,
|
|
16
|
-
silent: false,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function isNonEmptyString(str) {
|
|
20
|
-
return typeof str === "string" && !!str.trim();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function parseString(setCookieValue, options) {
|
|
24
|
-
var parts = setCookieValue.split(";").filter(isNonEmptyString);
|
|
25
|
-
var nameValue = parts.shift().split("=");
|
|
26
|
-
var name = nameValue.shift();
|
|
27
|
-
var value = nameValue.join("="); // everything after the first =, joined by a "=" if there was more than one part
|
|
28
|
-
|
|
29
|
-
options = options
|
|
30
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
31
|
-
: defaultParseOptions;
|
|
32
|
-
|
|
33
|
-
var cookie = {
|
|
34
|
-
name: name, // grab everything before the first =
|
|
35
|
-
value: options.decodeValues ? decodeURIComponent(value) : value, // decode cookie value
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
parts.forEach(function (part) {
|
|
39
|
-
var sides = part.split("=");
|
|
40
|
-
var key = sides.shift().trimLeft().toLowerCase();
|
|
41
|
-
var value = sides.join("=");
|
|
42
|
-
if (key === "expires") {
|
|
43
|
-
cookie.expires = new Date(value);
|
|
44
|
-
} else if (key === "max-age") {
|
|
45
|
-
cookie.maxAge = parseInt(value, 10);
|
|
46
|
-
} else if (key === "secure") {
|
|
47
|
-
cookie.secure = true;
|
|
48
|
-
} else if (key === "httponly") {
|
|
49
|
-
cookie.httpOnly = true;
|
|
50
|
-
} else if (key === "samesite") {
|
|
51
|
-
cookie.sameSite = value;
|
|
52
|
-
} else {
|
|
53
|
-
cookie[key] = value;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return cookie;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function parse(input, options) {
|
|
61
|
-
options = options
|
|
62
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
63
|
-
: defaultParseOptions;
|
|
64
|
-
|
|
65
|
-
if (!input) {
|
|
66
|
-
if (!options.map) {
|
|
67
|
-
return [];
|
|
68
|
-
} else {
|
|
69
|
-
return {};
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (input.headers && input.headers["set-cookie"]) {
|
|
74
|
-
// fast-path for node.js (which automatically normalizes header names to lower-case
|
|
75
|
-
input = input.headers["set-cookie"];
|
|
76
|
-
} else if (input.headers) {
|
|
77
|
-
// slow-path for other environments - see #25
|
|
78
|
-
var sch =
|
|
79
|
-
input.headers[
|
|
80
|
-
Object.keys(input.headers).find(function (key) {
|
|
81
|
-
return key.toLowerCase() === "set-cookie";
|
|
82
|
-
})
|
|
83
|
-
];
|
|
84
|
-
// warn if called on a request-like object with a cookie header rather than a set-cookie header - see #34, 36
|
|
85
|
-
if (!sch && input.headers.cookie && !options.silent) {
|
|
86
|
-
console.warn(
|
|
87
|
-
"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."
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
input = sch;
|
|
91
|
-
}
|
|
92
|
-
if (!Array.isArray(input)) {
|
|
93
|
-
input = [input];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
options = options
|
|
97
|
-
? Object.assign({}, defaultParseOptions, options)
|
|
98
|
-
: defaultParseOptions;
|
|
99
|
-
|
|
100
|
-
if (!options.map) {
|
|
101
|
-
return input.filter(isNonEmptyString).map(function (str) {
|
|
102
|
-
return parseString(str, options);
|
|
103
|
-
});
|
|
104
|
-
} else {
|
|
105
|
-
var cookies = {};
|
|
106
|
-
return input.filter(isNonEmptyString).reduce(function (cookies, str) {
|
|
107
|
-
var cookie = parseString(str, options);
|
|
108
|
-
cookies[cookie.name] = cookie;
|
|
109
|
-
return cookies;
|
|
110
|
-
}, cookies);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/*
|
|
115
|
-
Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
|
|
116
|
-
that are within a single set-cookie field-value, such as in the Expires portion.
|
|
117
|
-
|
|
118
|
-
This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
|
|
119
|
-
Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
|
|
120
|
-
React Native's fetch does this for *every* header, including set-cookie.
|
|
121
|
-
|
|
122
|
-
Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
|
|
123
|
-
Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
|
|
124
|
-
*/
|
|
125
|
-
function splitCookiesString(cookiesString) {
|
|
126
|
-
if (Array.isArray(cookiesString)) {
|
|
127
|
-
return cookiesString;
|
|
128
|
-
}
|
|
129
|
-
if (typeof cookiesString !== "string") {
|
|
130
|
-
return [];
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
var cookiesStrings = [];
|
|
134
|
-
var pos = 0;
|
|
135
|
-
var start;
|
|
136
|
-
var ch;
|
|
137
|
-
var lastComma;
|
|
138
|
-
var nextStart;
|
|
139
|
-
var cookiesSeparatorFound;
|
|
140
|
-
|
|
141
|
-
function skipWhitespace() {
|
|
142
|
-
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) {
|
|
143
|
-
pos += 1;
|
|
144
|
-
}
|
|
145
|
-
return pos < cookiesString.length;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function notSpecialChar() {
|
|
149
|
-
ch = cookiesString.charAt(pos);
|
|
150
|
-
|
|
151
|
-
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
while (pos < cookiesString.length) {
|
|
155
|
-
start = pos;
|
|
156
|
-
cookiesSeparatorFound = false;
|
|
157
|
-
|
|
158
|
-
while (skipWhitespace()) {
|
|
159
|
-
ch = cookiesString.charAt(pos);
|
|
160
|
-
if (ch === ",") {
|
|
161
|
-
// ',' is a cookie separator if we have later first '=', not ';' or ','
|
|
162
|
-
lastComma = pos;
|
|
163
|
-
pos += 1;
|
|
164
|
-
|
|
165
|
-
skipWhitespace();
|
|
166
|
-
nextStart = pos;
|
|
167
|
-
|
|
168
|
-
while (pos < cookiesString.length && notSpecialChar()) {
|
|
169
|
-
pos += 1;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// currently special character
|
|
173
|
-
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
174
|
-
// we found cookies separator
|
|
175
|
-
cookiesSeparatorFound = true;
|
|
176
|
-
// pos is inside the next cookie, so back up and return it.
|
|
177
|
-
pos = nextStart;
|
|
178
|
-
cookiesStrings.push(cookiesString.substring(start, lastComma));
|
|
179
|
-
start = pos;
|
|
180
|
-
} else {
|
|
181
|
-
// in param ',' or param separator ';',
|
|
182
|
-
// we continue from that comma
|
|
183
|
-
pos = lastComma + 1;
|
|
184
|
-
}
|
|
185
|
-
} else {
|
|
186
|
-
pos += 1;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (!cookiesSeparatorFound || pos >= cookiesString.length) {
|
|
191
|
-
cookiesStrings.push(cookiesString.substring(start, cookiesString.length));
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return cookiesStrings;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
var setCookie = parse;
|
|
199
|
-
var parse_1 = parse;
|
|
200
|
-
var parseString_1 = parseString;
|
|
201
|
-
var splitCookiesString_1 = splitCookiesString;
|
|
202
|
-
setCookie.parse = parse_1;
|
|
203
|
-
setCookie.parseString = parseString_1;
|
|
204
|
-
setCookie.splitCookiesString = splitCookiesString_1;
|
|
205
|
-
|
|
206
|
-
var dist = createCommonjsModule(function (module, exports) {
|
|
207
|
-
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
208
|
-
__assign = Object.assign || function(t) {
|
|
209
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
210
|
-
s = arguments[i];
|
|
211
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
212
|
-
t[p] = s[p];
|
|
213
|
-
}
|
|
214
|
-
return t;
|
|
215
|
-
};
|
|
216
|
-
return __assign.apply(this, arguments);
|
|
217
|
-
};
|
|
218
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
219
|
-
exports.destroyCookie = exports.setCookie = exports.parseCookies = void 0;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
var isBrowser = function () { return typeof window !== 'undefined'; };
|
|
223
|
-
function hasSameProperties(a, b) {
|
|
224
|
-
var aProps = Object.getOwnPropertyNames(a);
|
|
225
|
-
var bProps = Object.getOwnPropertyNames(b);
|
|
226
|
-
if (aProps.length !== bProps.length) {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
for (var i = 0; i < aProps.length; i++) {
|
|
230
|
-
var propName = aProps[i];
|
|
231
|
-
if (a[propName] !== b[propName]) {
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return true;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Compare the cookie and return true if the cookies has equivalent
|
|
239
|
-
* options and the cookies would be overwritten in the browser storage.
|
|
240
|
-
*
|
|
241
|
-
* @param a first Cookie for comparison
|
|
242
|
-
* @param b second Cookie for comparison
|
|
243
|
-
*/
|
|
244
|
-
function areCookiesEqual(a, b) {
|
|
245
|
-
var sameSiteSame = a.sameSite === b.sameSite;
|
|
246
|
-
if (typeof a.sameSite === 'string' && typeof b.sameSite === 'string') {
|
|
247
|
-
sameSiteSame = a.sameSite.toLowerCase() === b.sameSite.toLowerCase();
|
|
248
|
-
}
|
|
249
|
-
return (hasSameProperties(__assign(__assign({}, a), { sameSite: undefined }), __assign(__assign({}, b), { sameSite: undefined })) && sameSiteSame);
|
|
250
|
-
}
|
|
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
|
-
*
|
|
272
|
-
* Parses cookies.
|
|
273
|
-
*
|
|
274
|
-
* @param ctx
|
|
275
|
-
* @param options
|
|
276
|
-
*/
|
|
277
|
-
function parseCookies(ctx, options) {
|
|
278
|
-
if (ctx && ctx.req && ctx.req.headers && ctx.req.headers.cookie) {
|
|
279
|
-
return cookie.parse(ctx.req.headers.cookie, options);
|
|
280
|
-
}
|
|
281
|
-
if (isBrowser()) {
|
|
282
|
-
return cookie.parse(document.cookie, options);
|
|
283
|
-
}
|
|
284
|
-
return {};
|
|
285
|
-
}
|
|
286
|
-
exports.parseCookies = parseCookies;
|
|
287
|
-
/**
|
|
288
|
-
*
|
|
289
|
-
* Sets a cookie.
|
|
290
|
-
*
|
|
291
|
-
* @param ctx
|
|
292
|
-
* @param name
|
|
293
|
-
* @param value
|
|
294
|
-
* @param options
|
|
295
|
-
*/
|
|
296
|
-
function setCookie$1(ctx, name, value, options) {
|
|
297
|
-
if (ctx && ctx.res && ctx.res.getHeader && ctx.res.setHeader) {
|
|
298
|
-
var cookies = ctx.res.getHeader('Set-Cookie') || [];
|
|
299
|
-
if (typeof cookies === 'string')
|
|
300
|
-
cookies = [cookies];
|
|
301
|
-
if (typeof cookies === 'number')
|
|
302
|
-
cookies = [];
|
|
303
|
-
var parsedCookies = setCookie.parse(cookies);
|
|
304
|
-
var cookiesToSet_1 = [];
|
|
305
|
-
parsedCookies.forEach(function (parsedCookie) {
|
|
306
|
-
if (!areCookiesEqual(parsedCookie, createCookie(name, value, options))) {
|
|
307
|
-
cookiesToSet_1.push(cookie.serialize(parsedCookie.name, parsedCookie.value, __assign({}, parsedCookie)));
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
cookiesToSet_1.push(cookie.serialize(name, value, options));
|
|
311
|
-
if (!ctx.res.finished) {
|
|
312
|
-
ctx.res.setHeader('Set-Cookie', cookiesToSet_1);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
if (isBrowser()) {
|
|
316
|
-
if (options && options.httpOnly) {
|
|
317
|
-
throw new Error('Can not set a httpOnly cookie in the browser.');
|
|
318
|
-
}
|
|
319
|
-
document.cookie = cookie.serialize(name, value, options);
|
|
320
|
-
}
|
|
321
|
-
return {};
|
|
322
|
-
}
|
|
323
|
-
exports.setCookie = setCookie$1;
|
|
324
|
-
/**
|
|
325
|
-
*
|
|
326
|
-
* Destroys a cookie with a particular name.
|
|
327
|
-
*
|
|
328
|
-
* @param ctx
|
|
329
|
-
* @param name
|
|
330
|
-
* @param options
|
|
331
|
-
*/
|
|
332
|
-
function destroyCookie(ctx, name, options) {
|
|
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 {};
|
|
347
|
-
}
|
|
348
|
-
exports.destroyCookie = destroyCookie;
|
|
349
|
-
exports.default = {
|
|
350
|
-
set: setCookie$1,
|
|
351
|
-
get: parseCookies,
|
|
352
|
-
destroy: destroyCookie,
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
});
|
|
356
|
-
|
|
357
|
-
unwrapExports(dist);
|
|
358
|
-
var dist_1 = dist.destroyCookie;
|
|
359
|
-
var dist_2 = dist.setCookie;
|
|
360
|
-
var dist_3 = dist.parseCookies;
|
|
361
|
-
|
|
362
13
|
var _this = undefined;
|
|
363
14
|
|
|
364
15
|
var getRelatedArticle = function () {
|
|
@@ -418,13 +69,13 @@ var getRelatedArticle = function () {
|
|
|
418
69
|
conditions = '';
|
|
419
70
|
|
|
420
71
|
if (ctx && url) {
|
|
421
|
-
cookies =
|
|
72
|
+
cookies = parseCookies(ctx);
|
|
422
73
|
prevSlugs = cookies['prevSlugs'];
|
|
423
74
|
|
|
424
75
|
if (!!prevSlugs) {
|
|
425
|
-
|
|
76
|
+
setCookie(ctx, 'prevSlugs', prevSlugs + ',"' + url + '"', {});
|
|
426
77
|
conditions = '&& !(url.current in [' + prevSlugs + '])';
|
|
427
|
-
} else
|
|
78
|
+
} else setCookie(ctx, 'prevSlugs', '"' + url + '"', {});
|
|
428
79
|
}
|
|
429
80
|
relatedArticleQuery = getQuery('related', conditions, '', articleCount);
|
|
430
81
|
_context.next = 12;
|
|
@@ -14,7 +14,7 @@ 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-
|
|
17
|
+
import './index-3f4dd6f2.js';
|
|
18
18
|
import 'prop-types';
|
|
19
19
|
import 'react-bootstrap/Row';
|
|
20
20
|
import 'react-bootstrap/Col';
|
|
@@ -23,9 +23,9 @@ import 'next/router';
|
|
|
23
23
|
import './isSymbol-807e927e.js';
|
|
24
24
|
import './debounce-1a993acf.js';
|
|
25
25
|
import 'react-dom';
|
|
26
|
-
import './index-
|
|
26
|
+
import './index-3849e3fe.js';
|
|
27
27
|
import './index-5f9f807a.js';
|
|
28
|
-
import './main-
|
|
28
|
+
import './main-35ff7b4f.js';
|
|
29
29
|
import './entities-7cc3bf45.js';
|
|
30
30
|
import './stringify-008c8802.js';
|
|
31
31
|
import './slicedToArray-7021e5df.js';
|
|
@@ -34,12 +34,12 @@ import './_set-species-cede29f8.js';
|
|
|
34
34
|
import './Segment.js';
|
|
35
35
|
import './Beam.js';
|
|
36
36
|
import './AdSlot.js';
|
|
37
|
-
import './BlockContent-
|
|
37
|
+
import './BlockContent-c409aca5.js';
|
|
38
38
|
import './smoothscroll-4b699764.js';
|
|
39
39
|
import './GroupDeck.js';
|
|
40
40
|
import 'react-bootstrap';
|
|
41
41
|
import 'react-bootstrap/Button';
|
|
42
|
-
export { g as default } from './index-
|
|
42
|
+
export { g as default } from './index-792a492f.js';
|
|
43
43
|
import './util-7700fc59.js';
|
|
44
44
|
import './brightcove-react-player-loader.es-83f53e4e.js';
|
|
45
45
|
import 'react-bootstrap/Pagination';
|
|
@@ -375,7 +375,8 @@ function urlBuilder(options) {
|
|
|
375
375
|
var client = options;
|
|
376
376
|
if (isSanityClient(client)) {
|
|
377
377
|
// Inherit config from client
|
|
378
|
-
var _a = client.clientConfig,
|
|
378
|
+
var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
|
|
379
|
+
var apiHost = apiUrl || 'https://api.sanity.io';
|
|
379
380
|
return new ImageUrlBuilder(null, {
|
|
380
381
|
baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
|
|
381
382
|
projectId: projectId,
|
|
@@ -722,6 +722,8 @@ 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
|
+
|
|
725
727
|
slotsToInitialize.forEach(function (currentSlotId) {
|
|
726
728
|
registeredSlots[currentSlotId].loading = false;
|
|
727
729
|
googletag.cmd.push(function () {
|
|
@@ -785,14 +787,25 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
785
787
|
});
|
|
786
788
|
});
|
|
787
789
|
},
|
|
788
|
-
|
|
790
|
+
// configure those gpt parameters that need to be set before pubsads service
|
|
791
|
+
// initialization.
|
|
792
|
+
configureInitialOptions: function configureInitialOptions(googletag) {
|
|
789
793
|
var _this4 = this;
|
|
790
794
|
|
|
795
|
+
googletag.cmd.push(function () {
|
|
796
|
+
if (_this4.disableInitialLoadIsEnabled()) {
|
|
797
|
+
googletag.pubads().disableInitialLoad();
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
},
|
|
801
|
+
configureOptions: function configureOptions(googletag) {
|
|
802
|
+
var _this5 = this;
|
|
803
|
+
|
|
791
804
|
googletag.cmd.push(function () {
|
|
792
805
|
var pubadsService = googletag.pubads();
|
|
793
|
-
pubadsService.setRequestNonPersonalizedAds(
|
|
806
|
+
pubadsService.setRequestNonPersonalizedAds(_this5.personalizedAdsEnabled() ? 0 : 1);
|
|
794
807
|
|
|
795
|
-
var targetingArguments =
|
|
808
|
+
var targetingArguments = _this5.getTargetingArguments(); // set global targetting arguments
|
|
796
809
|
|
|
797
810
|
|
|
798
811
|
Object.keys(targetingArguments).forEach(function (varName) {
|
|
@@ -801,16 +814,16 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
801
814
|
}
|
|
802
815
|
}); // set global adSense attributes
|
|
803
816
|
|
|
804
|
-
var adSenseAttributes =
|
|
817
|
+
var adSenseAttributes = _this5.getAdSenseAttributes();
|
|
805
818
|
|
|
806
819
|
Object.keys(adSenseAttributes).forEach(function (key) {
|
|
807
820
|
pubadsService.set(key, adSenseAttributes[key]);
|
|
808
821
|
});
|
|
809
822
|
|
|
810
|
-
if (
|
|
823
|
+
if (_this5.lazyLoadIsEnabled()) {
|
|
811
824
|
var args = [];
|
|
812
825
|
|
|
813
|
-
var config =
|
|
826
|
+
var config = _this5.getLazyLoadConfig();
|
|
814
827
|
|
|
815
828
|
if (config !== null) {
|
|
816
829
|
args.push(config);
|
|
@@ -819,16 +832,12 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
819
832
|
pubadsService.enableLazyLoad.call(args);
|
|
820
833
|
}
|
|
821
834
|
|
|
822
|
-
if (
|
|
835
|
+
if (_this5.singleRequestIsEnabled()) {
|
|
823
836
|
pubadsService.enableSingleRequest();
|
|
824
837
|
}
|
|
825
838
|
|
|
826
|
-
if (
|
|
827
|
-
pubadsService.
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
if (_this4.collapseEmptyDivs === true || _this4.collapseEmptyDivs === false) {
|
|
831
|
-
pubadsService.collapseEmptyDivs(_this4.collapseEmptyDivs);
|
|
839
|
+
if (_this5.collapseEmptyDivs === true || _this5.collapseEmptyDivs === false) {
|
|
840
|
+
pubadsService.collapseEmptyDivs(_this5.collapseEmptyDivs);
|
|
832
841
|
}
|
|
833
842
|
});
|
|
834
843
|
},
|
|
@@ -870,10 +879,10 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
870
879
|
}
|
|
871
880
|
},
|
|
872
881
|
gptRefreshAds: function gptRefreshAds(slots) {
|
|
873
|
-
var
|
|
882
|
+
var _this6 = this;
|
|
874
883
|
|
|
875
884
|
return this.getGoogletag().then(function (googletag) {
|
|
876
|
-
|
|
885
|
+
_this6.configureOptions(googletag);
|
|
877
886
|
|
|
878
887
|
googletag.cmd.push(function () {
|
|
879
888
|
var pubadsService = googletag.pubads();
|
|
@@ -884,14 +893,14 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
884
893
|
});
|
|
885
894
|
},
|
|
886
895
|
reload: function reload() {
|
|
887
|
-
var
|
|
896
|
+
var _this7 = this;
|
|
888
897
|
|
|
889
898
|
return this.destroyGPTSlots.apply(this, arguments).then(function () {
|
|
890
|
-
return
|
|
899
|
+
return _this7.load();
|
|
891
900
|
});
|
|
892
901
|
},
|
|
893
902
|
destroyGPTSlots: function destroyGPTSlots() {
|
|
894
|
-
var
|
|
903
|
+
var _this8 = this;
|
|
895
904
|
|
|
896
905
|
for (var _len4 = arguments.length, slotsToDestroy = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
897
906
|
slotsToDestroy[_key4] = arguments[_key4];
|
|
@@ -911,7 +920,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
911
920
|
slots.push(slot);
|
|
912
921
|
}
|
|
913
922
|
|
|
914
|
-
|
|
923
|
+
_this8.getGoogletag().then(function (googletag) {
|
|
915
924
|
googletag.cmd.push(function () {
|
|
916
925
|
if (managerAlreadyInitialized === true) {
|
|
917
926
|
if (slotsToDestroy.length > 0) {
|
|
@@ -934,7 +943,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
934
943
|
});
|
|
935
944
|
},
|
|
936
945
|
registerSlot: function registerSlot(_ref) {
|
|
937
|
-
var
|
|
946
|
+
var _this9 = this;
|
|
938
947
|
|
|
939
948
|
var slotId = _ref.slotId,
|
|
940
949
|
dfpNetworkId = _ref.dfpNetworkId,
|
|
@@ -973,7 +982,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
|
|
|
973
982
|
gptSlot = slot.gptSlot;
|
|
974
983
|
|
|
975
984
|
if (loading === false && !gptSlot) {
|
|
976
|
-
|
|
985
|
+
_this9.load(slotId);
|
|
977
986
|
}
|
|
978
987
|
}
|
|
979
988
|
});
|