@mjhls/mjh-framework 1.0.235 → 1.0.236
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/README.md +1 -1
- package/dist/cjs/AdSlot-983cfe5f.js +515 -0
- package/dist/cjs/DeckContent.js +3 -3
- package/dist/cjs/DeckQueue.js +2 -2
- package/dist/cjs/{Dfp-f62b16e1.js → Dfp-f16a4421.js} +1 -1
- package/dist/cjs/{GridContent-6dae5d6a.js → GridContent-3f7dc5ac.js} +4 -4
- package/dist/cjs/GridContent.js +4 -4
- package/dist/cjs/MasterDeck.js +2 -2
- package/dist/cjs/{Normal-821546cd.js → Normal-815c5ad0.js} +3 -3
- package/dist/cjs/QueueDeckExpanded.js +2 -2
- package/dist/cjs/{TaxonomyCard-d97685e2.js → TaxonomyCard-0d4ec68b.js} +1 -1
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +4 -4
- package/dist/cjs/{Ustream-0d3dd953.js → Ustream-5f595d09.js} +1 -1
- package/dist/cjs/Ustream.js +2 -2
- package/dist/cjs/VideoSeriesListing.js +1 -1
- package/dist/cjs/{_babelHelpers-f321c258.js → _babelHelpers-4a69caad.js} +30 -0
- package/dist/cjs/index.js +79 -8
- package/dist/cjs/{main-58839f4e.js → main-becc38ae.js} +1 -0
- package/dist/esm/AdSlot-c40f4438.js +509 -0
- package/dist/esm/DeckContent.js +3 -3
- package/dist/esm/DeckQueue.js +2 -2
- package/dist/esm/{Dfp-f026ab16.js → Dfp-0567f8a3.js} +1 -1
- package/dist/esm/{GridContent-7990f509.js → GridContent-e61fff04.js} +4 -4
- package/dist/esm/GridContent.js +4 -4
- package/dist/esm/MasterDeck.js +2 -2
- package/dist/esm/{Normal-20ff5bf5.js → Normal-ebb02255.js} +3 -3
- package/dist/esm/QueueDeckExpanded.js +2 -2
- package/dist/esm/{TaxonomyCard-f9c93953.js → TaxonomyCard-92f9e327.js} +1 -1
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +4 -4
- package/dist/esm/{Ustream-6bb45fe7.js → Ustream-2bfb1813.js} +1 -1
- package/dist/esm/Ustream.js +2 -2
- package/dist/esm/VideoSeriesListing.js +1 -1
- package/dist/esm/{_babelHelpers-67c05996.js → _babelHelpers-c212c59c.js} +30 -1
- package/dist/esm/index.js +82 -12
- package/dist/esm/{main-cd81c243.js → main-e84e7749.js} +1 -1
- package/package.json +3 -1
- package/dist/cjs/AdSlot-d87cef08.js +0 -69
- package/dist/esm/AdSlot-0ea49f7e.js +0 -64
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import React__default, { useState } from 'react';
|
|
2
|
+
import { b as lib_2 } from './index-70f7c966.js';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
5
|
+
import { a as main_16 } from './main-e84e7749.js';
|
|
6
|
+
import { b as asyncToGenerator, s as slicedToArray } from './_babelHelpers-c212c59c.js';
|
|
7
|
+
|
|
8
|
+
var faunadb = require('faunadb');
|
|
9
|
+
|
|
10
|
+
var _require = require('faunadb'),
|
|
11
|
+
q = _require.query;
|
|
12
|
+
|
|
13
|
+
var shortid = require('shortid');
|
|
14
|
+
var moment = require('moment');
|
|
15
|
+
var cookie = require('react-cookies'); // client side cookie handler
|
|
16
|
+
|
|
17
|
+
var _require2 = require('cookie'),
|
|
18
|
+
serialize = _require2.serialize; // cookie serializer
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var serverCookies = require('next-cookies'); // server side cookie handler
|
|
22
|
+
require("babel-polyfill");
|
|
23
|
+
|
|
24
|
+
// admin key for beam
|
|
25
|
+
var secret = 'fnADs4GncNACEiNgTqb2GYn7p8SENkcQmbRmywRA';
|
|
26
|
+
// server key for beam
|
|
27
|
+
// fnADs4Gtx6ACEgKgwlNo-eNSIrdwykH9Zj74GsDI
|
|
28
|
+
|
|
29
|
+
var Beam = {
|
|
30
|
+
init: function init(ctx) {
|
|
31
|
+
// set eKey in cookie for later use
|
|
32
|
+
var eKey = ctx.query.eKey;
|
|
33
|
+
|
|
34
|
+
if (eKey) {
|
|
35
|
+
ctx.res.setHeader('Set-Cookie', serialize('eKey', eKey, { path: '/' }));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
var _serverCookies = serverCookies(ctx),
|
|
39
|
+
MJH_SSID = _serverCookies.MJH_SSID;
|
|
40
|
+
|
|
41
|
+
if (!MJH_SSID) {
|
|
42
|
+
ctx.res.setHeader('Set-Cookie', serialize('MJH_SSID', shortid.generate(), { path: '/' }));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
var _serverCookies2 = serverCookies(ctx),
|
|
46
|
+
BEAMID = _serverCookies2.BEAMID;
|
|
47
|
+
|
|
48
|
+
if (!BEAMID) {
|
|
49
|
+
var now = new Date();
|
|
50
|
+
var time = now.getTime();
|
|
51
|
+
var expireTime = time + 1000 * 60 * 60 * 24 * 365 * 20;
|
|
52
|
+
now.setTime(expireTime);
|
|
53
|
+
ctx.res.setHeader('Set-Cookie', serialize('BEAMID', shortid.generate(), { path: '/', expires: now }));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
get_email_from_ekey: function get_email_from_ekey(eKey) {
|
|
57
|
+
var email = '';
|
|
58
|
+
if (eKey) {
|
|
59
|
+
try {
|
|
60
|
+
var buff = new Buffer(eKey, 'base64');
|
|
61
|
+
email = buff.toString('ascii');
|
|
62
|
+
} catch (e) {
|
|
63
|
+
console.log('invalid eKey:', eKey);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return email;
|
|
68
|
+
},
|
|
69
|
+
save_beam_ad: function save_beam_ad(beam_id, session_id, ip, url, host, eKey, event, referer, device, agent, cID, lID, campID, adSize, keywords) {
|
|
70
|
+
var _this = this;
|
|
71
|
+
|
|
72
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
73
|
+
var client, _id, email, result;
|
|
74
|
+
|
|
75
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
76
|
+
while (1) {
|
|
77
|
+
switch (_context.prev = _context.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
_context.prev = 0;
|
|
80
|
+
client = new faunadb.Client({ secret: secret });
|
|
81
|
+
_id = shortid.generate();
|
|
82
|
+
email = _this.get_email_from_ekey(eKey);
|
|
83
|
+
_context.next = 6;
|
|
84
|
+
return client.query(q.Create(q.Collection('beamlogad'), {
|
|
85
|
+
data: {
|
|
86
|
+
id: _id,
|
|
87
|
+
beam_id: beam_id,
|
|
88
|
+
session_id: session_id,
|
|
89
|
+
eKey: eKey,
|
|
90
|
+
email: email,
|
|
91
|
+
keywords: keywords,
|
|
92
|
+
ip: ip,
|
|
93
|
+
domain: host,
|
|
94
|
+
url: url,
|
|
95
|
+
fullUrl: '' + host + url,
|
|
96
|
+
referer: referer,
|
|
97
|
+
device: device,
|
|
98
|
+
event: event,
|
|
99
|
+
serverAgent: agent,
|
|
100
|
+
cID: cID,
|
|
101
|
+
lID: lID,
|
|
102
|
+
campID: campID,
|
|
103
|
+
adSize: adSize,
|
|
104
|
+
uptime: moment().utc().format()
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
107
|
+
|
|
108
|
+
case 6:
|
|
109
|
+
result = _context.sent;
|
|
110
|
+
|
|
111
|
+
if (!(!result.data || !result.data.id)) {
|
|
112
|
+
_context.next = 9;
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
throw new Error('Failed to report pageview!');
|
|
117
|
+
|
|
118
|
+
case 9:
|
|
119
|
+
return _context.abrupt('return', { error: '', log_id: _id });
|
|
120
|
+
|
|
121
|
+
case 12:
|
|
122
|
+
_context.prev = 12;
|
|
123
|
+
_context.t0 = _context['catch'](0);
|
|
124
|
+
return _context.abrupt('return', { error: _context.t0.message, log_id: '' });
|
|
125
|
+
|
|
126
|
+
case 15:
|
|
127
|
+
case 'end':
|
|
128
|
+
return _context.stop();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}, _callee, _this, [[0, 12]]);
|
|
132
|
+
}))();
|
|
133
|
+
},
|
|
134
|
+
save_beam_event: function save_beam_event(beam_id, session_id, ip, url, host, eKey, event, referer, device, agent, keywords) {
|
|
135
|
+
var _this2 = this;
|
|
136
|
+
|
|
137
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
|
|
138
|
+
var client, _id, email, result;
|
|
139
|
+
|
|
140
|
+
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
141
|
+
while (1) {
|
|
142
|
+
switch (_context2.prev = _context2.next) {
|
|
143
|
+
case 0:
|
|
144
|
+
_context2.prev = 0;
|
|
145
|
+
client = new faunadb.Client({ secret: secret });
|
|
146
|
+
_id = shortid.generate();
|
|
147
|
+
email = _this2.get_email_from_ekey(eKey);
|
|
148
|
+
_context2.next = 6;
|
|
149
|
+
return client.query(q.Create(q.Collection('beamlog'), {
|
|
150
|
+
data: {
|
|
151
|
+
id: _id,
|
|
152
|
+
beam_id: beam_id,
|
|
153
|
+
session_id: session_id,
|
|
154
|
+
eKey: eKey,
|
|
155
|
+
email: email,
|
|
156
|
+
keywords: keywords,
|
|
157
|
+
ip: ip,
|
|
158
|
+
domain: host,
|
|
159
|
+
url: url,
|
|
160
|
+
fullUrl: '' + host + url,
|
|
161
|
+
referer: referer,
|
|
162
|
+
device: device,
|
|
163
|
+
event: event,
|
|
164
|
+
serverAgent: agent,
|
|
165
|
+
uptime: moment().utc().format()
|
|
166
|
+
}
|
|
167
|
+
}));
|
|
168
|
+
|
|
169
|
+
case 6:
|
|
170
|
+
result = _context2.sent;
|
|
171
|
+
|
|
172
|
+
if (!(!result.data || !result.data.id)) {
|
|
173
|
+
_context2.next = 9;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
throw new Error('Failed to report pageview!');
|
|
178
|
+
|
|
179
|
+
case 9:
|
|
180
|
+
return _context2.abrupt('return', { error: '', log_id: _id });
|
|
181
|
+
|
|
182
|
+
case 12:
|
|
183
|
+
_context2.prev = 12;
|
|
184
|
+
_context2.t0 = _context2['catch'](0);
|
|
185
|
+
return _context2.abrupt('return', { error: _context2.t0.message, log_id: '' });
|
|
186
|
+
|
|
187
|
+
case 15:
|
|
188
|
+
case 'end':
|
|
189
|
+
return _context2.stop();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, _callee2, _this2, [[0, 12]]);
|
|
193
|
+
}))();
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
/*
|
|
198
|
+
### for /api/beam/event
|
|
199
|
+
import { process_beam_ad } from '@mjhls/mjh-framework'
|
|
200
|
+
export default async(req, res) => {
|
|
201
|
+
await process_beam_ad(req, res)
|
|
202
|
+
}
|
|
203
|
+
*/
|
|
204
|
+
process_beam_event: function process_beam_event(req, res) {
|
|
205
|
+
var _this3 = this;
|
|
206
|
+
|
|
207
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
|
|
208
|
+
var ip, userAgent, host, url, eKey, referer, device, event, session_id, beam_id, keywords;
|
|
209
|
+
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
210
|
+
while (1) {
|
|
211
|
+
switch (_context3.prev = _context3.next) {
|
|
212
|
+
case 0:
|
|
213
|
+
ip = req.headers['x-real-ip'];
|
|
214
|
+
userAgent = req.headers['user-agent'];
|
|
215
|
+
host = req.headers['host'];
|
|
216
|
+
url = req.body.url;
|
|
217
|
+
eKey = req.body.eKey;
|
|
218
|
+
referer = req.body.referer;
|
|
219
|
+
device = req.body.device;
|
|
220
|
+
event = req.body.event;
|
|
221
|
+
session_id = req.body.session_id;
|
|
222
|
+
beam_id = req.body.beam_id;
|
|
223
|
+
keywords = req.body.keywords;
|
|
224
|
+
_context3.t0 = res;
|
|
225
|
+
_context3.next = 14;
|
|
226
|
+
return _this3.save_beam_event(beam_id, session_id, ip, url, host, eKey, event, referer, device, userAgent, keywords);
|
|
227
|
+
|
|
228
|
+
case 14:
|
|
229
|
+
_context3.t1 = _context3.sent;
|
|
230
|
+
return _context3.abrupt('return', _context3.t0.json.call(_context3.t0, _context3.t1));
|
|
231
|
+
|
|
232
|
+
case 16:
|
|
233
|
+
case 'end':
|
|
234
|
+
return _context3.stop();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, _callee3, _this3);
|
|
238
|
+
}))();
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
/*
|
|
243
|
+
### for /api/beam/ad
|
|
244
|
+
import { process_beam_ad } from '@mjhls/mjh-framework'
|
|
245
|
+
export default async(req, res) => {
|
|
246
|
+
await process_beam_ad(req, res)
|
|
247
|
+
}
|
|
248
|
+
*/
|
|
249
|
+
process_beam_ad: function process_beam_ad(req, res) {
|
|
250
|
+
var _this4 = this;
|
|
251
|
+
|
|
252
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
253
|
+
var ip, userAgent, host, url, eKey, referer, device, cID, lID, campID, adSize, event, session_id, beam_id, keywords, result;
|
|
254
|
+
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
255
|
+
while (1) {
|
|
256
|
+
switch (_context4.prev = _context4.next) {
|
|
257
|
+
case 0:
|
|
258
|
+
ip = req.headers['x-real-ip'];
|
|
259
|
+
userAgent = req.headers['user-agent'];
|
|
260
|
+
host = req.headers['host'];
|
|
261
|
+
url = req.body.url;
|
|
262
|
+
eKey = req.body.eKey;
|
|
263
|
+
referer = req.body.referer;
|
|
264
|
+
device = req.body.device;
|
|
265
|
+
cID = req.body.cID;
|
|
266
|
+
lID = req.body.lID;
|
|
267
|
+
campID = req.body.campID;
|
|
268
|
+
adSize = req.body.adSize;
|
|
269
|
+
event = req.body.event;
|
|
270
|
+
session_id = req.body.session_id;
|
|
271
|
+
beam_id = req.body.beam_id;
|
|
272
|
+
keywords = req.body.keywords;
|
|
273
|
+
_context4.next = 17;
|
|
274
|
+
return _this4.save_beam_ad(beam_id, session_id, ip, url, host, eKey, event, referer, device, userAgent, cID, lID, campID, adSize, keywords);
|
|
275
|
+
|
|
276
|
+
case 17:
|
|
277
|
+
result = _context4.sent;
|
|
278
|
+
return _context4.abrupt('return', res.json(result));
|
|
279
|
+
|
|
280
|
+
case 19:
|
|
281
|
+
case 'end':
|
|
282
|
+
return _context4.stop();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}, _callee4, _this4);
|
|
286
|
+
}))();
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
/* for client use */
|
|
291
|
+
report_beam_event: function report_beam_event(event, deviceType) {
|
|
292
|
+
var _this5 = this;
|
|
293
|
+
|
|
294
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
|
|
295
|
+
var referer, eKey, url, session_id, beam_id, element, keywords, response, data;
|
|
296
|
+
return regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
297
|
+
while (1) {
|
|
298
|
+
switch (_context5.prev = _context5.next) {
|
|
299
|
+
case 0:
|
|
300
|
+
referer = document.referrer;
|
|
301
|
+
eKey = cookie.load('eKey');
|
|
302
|
+
url = window.location.pathname + window.location.search;
|
|
303
|
+
session_id = cookie.load('MJH_SSID');
|
|
304
|
+
beam_id = cookie.load('BEAMID');
|
|
305
|
+
element = document.querySelector('meta[name="keywords"]');
|
|
306
|
+
keywords = element.getAttribute("content");
|
|
307
|
+
_context5.next = 9;
|
|
308
|
+
return fetch('/api/beam/event', {
|
|
309
|
+
headers: {
|
|
310
|
+
'Content-Type': 'application/json',
|
|
311
|
+
'Accept': 'application/json'
|
|
312
|
+
},
|
|
313
|
+
method: 'post',
|
|
314
|
+
credentials: 'same-origin',
|
|
315
|
+
body: JSON.stringify({
|
|
316
|
+
url: url,
|
|
317
|
+
referer: referer,
|
|
318
|
+
device: deviceType,
|
|
319
|
+
eKey: eKey,
|
|
320
|
+
event: event,
|
|
321
|
+
session_id: session_id,
|
|
322
|
+
beam_id: beam_id,
|
|
323
|
+
keywords: keywords
|
|
324
|
+
})
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
case 9:
|
|
328
|
+
response = _context5.sent;
|
|
329
|
+
_context5.next = 12;
|
|
330
|
+
return response.json();
|
|
331
|
+
|
|
332
|
+
case 12:
|
|
333
|
+
data = _context5.sent;
|
|
334
|
+
|
|
335
|
+
if (data.error) {
|
|
336
|
+
console.error('Beam reporting error:', data.error);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
case 14:
|
|
340
|
+
case 'end':
|
|
341
|
+
return _context5.stop();
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}, _callee5, _this5);
|
|
345
|
+
}))();
|
|
346
|
+
},
|
|
347
|
+
report_beam_ad: function report_beam_ad(event, deviceType, cID, lID, campID, adSize) {
|
|
348
|
+
var _this6 = this;
|
|
349
|
+
|
|
350
|
+
return asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {
|
|
351
|
+
var referer, eKey, url, session_id, beam_id, element, keywords, response, data;
|
|
352
|
+
return regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
353
|
+
while (1) {
|
|
354
|
+
switch (_context6.prev = _context6.next) {
|
|
355
|
+
case 0:
|
|
356
|
+
referer = document.referrer;
|
|
357
|
+
eKey = cookie.load('eKey');
|
|
358
|
+
url = window.location.pathname + window.location.search;
|
|
359
|
+
session_id = cookie.load('MJH_SSID');
|
|
360
|
+
beam_id = cookie.load('BEAMID');
|
|
361
|
+
element = document.querySelector('meta[name="keywords"]');
|
|
362
|
+
keywords = element.getAttribute("content");
|
|
363
|
+
_context6.next = 9;
|
|
364
|
+
return fetch('/api/beam/ad', {
|
|
365
|
+
headers: {
|
|
366
|
+
'Content-Type': 'application/json',
|
|
367
|
+
'Accept': 'application/json'
|
|
368
|
+
},
|
|
369
|
+
method: 'post',
|
|
370
|
+
credentials: 'same-origin',
|
|
371
|
+
body: JSON.stringify({
|
|
372
|
+
url: url,
|
|
373
|
+
referer: referer,
|
|
374
|
+
device: deviceType,
|
|
375
|
+
eKey: eKey,
|
|
376
|
+
event: event,
|
|
377
|
+
session_id: session_id,
|
|
378
|
+
beam_id: beam_id,
|
|
379
|
+
keywords: keywords,
|
|
380
|
+
cID: cID,
|
|
381
|
+
lID: lID,
|
|
382
|
+
campID: campID,
|
|
383
|
+
adSize: adSize
|
|
384
|
+
})
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
case 9:
|
|
388
|
+
response = _context6.sent;
|
|
389
|
+
_context6.next = 12;
|
|
390
|
+
return response.json();
|
|
391
|
+
|
|
392
|
+
case 12:
|
|
393
|
+
data = _context6.sent;
|
|
394
|
+
|
|
395
|
+
if (data.error) {
|
|
396
|
+
console.error('Beam AD reporting error:', data.error);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
case 14:
|
|
400
|
+
case 'end':
|
|
401
|
+
return _context6.stop();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}, _callee6, _this6);
|
|
405
|
+
}))();
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
410
|
+
var adUnit = _ref.adUnit,
|
|
411
|
+
sizeMapping = _ref.sizeMapping,
|
|
412
|
+
className = _ref.className,
|
|
413
|
+
slotId = _ref.slotId,
|
|
414
|
+
sizes = _ref.sizes,
|
|
415
|
+
_ref$targeting = _ref.targeting,
|
|
416
|
+
targeting = _ref$targeting === undefined ? {} : _ref$targeting;
|
|
417
|
+
|
|
418
|
+
var _useState = useState(false),
|
|
419
|
+
_useState2 = slicedToArray(_useState, 2),
|
|
420
|
+
adRendered = _useState2[0],
|
|
421
|
+
setAdRendered = _useState2[1];
|
|
422
|
+
|
|
423
|
+
var _useState3 = useState(false),
|
|
424
|
+
_useState4 = slicedToArray(_useState3, 2),
|
|
425
|
+
adRefreshable = _useState4[0],
|
|
426
|
+
setAdRefreshable = _useState4[1];
|
|
427
|
+
|
|
428
|
+
var _useState5 = useState(false),
|
|
429
|
+
_useState6 = slicedToArray(_useState5, 2),
|
|
430
|
+
adHasFocus = _useState6[0],
|
|
431
|
+
setAdHasFocus = _useState6[1];
|
|
432
|
+
|
|
433
|
+
var handleVisibilityChange = debounce_1(function (_ref2) {
|
|
434
|
+
var event = _ref2.event;
|
|
435
|
+
|
|
436
|
+
if (event.inViewPercentage <= 0) {
|
|
437
|
+
setAdRefreshable(false);
|
|
438
|
+
} else {
|
|
439
|
+
setAdRefreshable(true);
|
|
440
|
+
}
|
|
441
|
+
}, 500);
|
|
442
|
+
|
|
443
|
+
return React__default.createElement(
|
|
444
|
+
'div',
|
|
445
|
+
{ className: className },
|
|
446
|
+
React__default.createElement(lib_2, {
|
|
447
|
+
slotId: slotId,
|
|
448
|
+
sizes: sizes,
|
|
449
|
+
adUnit: adUnit,
|
|
450
|
+
sizeMapping: sizeMapping,
|
|
451
|
+
targetingArguments: targeting,
|
|
452
|
+
onSlotRender: function onSlotRender(eventData) {
|
|
453
|
+
setAdRendered(true);
|
|
454
|
+
if (eventData && eventData.event) {
|
|
455
|
+
var cID = eventData.event.creativeId;
|
|
456
|
+
var lID = eventData.event.lineItemId;
|
|
457
|
+
var campID = eventData.event.campaignId;
|
|
458
|
+
var adSize = eventData.event.size.length > 1 ? eventData.event.size[0] + 'x' + eventData.event.size[1] : '';
|
|
459
|
+
Beam.report_beam_ad('AD Rendered', main_16, cID, lID, campID, adSize);
|
|
460
|
+
|
|
461
|
+
var slot_div = document.getElementById(eventData.slotId);
|
|
462
|
+
if (slot_div) {
|
|
463
|
+
slot_div.addEventListener('mouseenter', function () {
|
|
464
|
+
var timeoutId = slot_div.getAttribute('timeoutId');
|
|
465
|
+
clearTimeout(timeoutId);
|
|
466
|
+
slot_div.setAttribute('hasFocus', 'yes');
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
slot_div.addEventListener('mouseleave', function () {
|
|
470
|
+
var timeoutId = setTimeout(function () {
|
|
471
|
+
slot_div.setAttribute('hasFocus', 'no');
|
|
472
|
+
}, 60);
|
|
473
|
+
slot_div.setAttribute('timeoutId', timeoutId);
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
document.addEventListener('visibilitychange', function () {
|
|
477
|
+
if (!document.hidden) {
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
var hasFocus = slot_div.getAttribute('hasFocus');
|
|
482
|
+
if (hasFocus == 'yes' && document.hidden) {
|
|
483
|
+
console.log('AD Clicked:', eventData.slotId);
|
|
484
|
+
slot_div.setAttribute('hasFocus', 'no');
|
|
485
|
+
Beam.report_beam_ad('AD Clicked', main_16, cID, lID, campID, adSize);
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
} else {
|
|
489
|
+
console.error('slot div not found:', slotId);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
onSlotVisibilityChanged: handleVisibilityChange,
|
|
494
|
+
shouldRefresh: function shouldRefresh() {
|
|
495
|
+
if (adRendered && adRefreshable) return true;else return false;
|
|
496
|
+
}
|
|
497
|
+
})
|
|
498
|
+
);
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
DFPAdSlot.propTypes = {
|
|
502
|
+
adUnit: PropTypes.string.isRequired,
|
|
503
|
+
slotId: PropTypes.string,
|
|
504
|
+
className: PropTypes.string,
|
|
505
|
+
sizeMapping: PropTypes.array,
|
|
506
|
+
sizes: PropTypes.array
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
export { Beam as B, DFPAdSlot as D };
|
package/dist/esm/DeckContent.js
CHANGED
|
@@ -13,10 +13,10 @@ import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
|
13
13
|
import 'react-dom';
|
|
14
14
|
import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
15
15
|
import { L as LazyLoad } from './index-3c1ee9ab.js';
|
|
16
|
-
import { m as main_36 } from './main-
|
|
16
|
+
import { m as main_36 } from './main-e84e7749.js';
|
|
17
17
|
import { c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
18
|
-
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-
|
|
19
|
-
import { D as DFPAdSlot } from './AdSlot-
|
|
18
|
+
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
|
|
19
|
+
import { D as DFPAdSlot } from './AdSlot-c40f4438.js';
|
|
20
20
|
|
|
21
21
|
var DeckContent = function (_React$Component) {
|
|
22
22
|
inherits(DeckContent, _React$Component);
|
package/dist/esm/DeckQueue.js
CHANGED
|
@@ -13,9 +13,9 @@ import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
|
13
13
|
import 'react-dom';
|
|
14
14
|
import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
15
15
|
import { L as LazyLoad } from './index-3c1ee9ab.js';
|
|
16
|
-
import { m as main_36 } from './main-
|
|
16
|
+
import { m as main_36 } from './main-e84e7749.js';
|
|
17
17
|
import { c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
18
|
-
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-
|
|
18
|
+
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
|
|
19
19
|
import { g as get_1 } from './get-b074314b.js';
|
|
20
20
|
|
|
21
21
|
var DeckQueue = function (_React$Component) {
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
import { V as VisibilitySensor } from './visibility-sensor-71e50a91.js';
|
|
6
6
|
import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
7
7
|
import 'react-dom';
|
|
8
|
-
import { s as slicedToArray } from './_babelHelpers-
|
|
8
|
+
import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
|
|
9
9
|
|
|
10
10
|
var AD = function AD(_ref) {
|
|
11
11
|
var networkID = _ref.networkID,
|
|
@@ -10,14 +10,14 @@ import { withRouter } from 'next/router';
|
|
|
10
10
|
import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
11
11
|
import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
12
12
|
import { L as LazyLoad } from './index-3c1ee9ab.js';
|
|
13
|
-
import { m as main_36 } from './main-
|
|
13
|
+
import { m as main_36 } from './main-e84e7749.js';
|
|
14
14
|
import { c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
15
|
-
import { i as inherits, c as createClass, t as toConsumableArray, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-
|
|
16
|
-
import { D as DFPAdSlot } from './AdSlot-
|
|
15
|
+
import { i as inherits, c as createClass, t as toConsumableArray, a as classCallCheck, p as possibleConstructorReturn, _ as _extends } from './_babelHelpers-c212c59c.js';
|
|
16
|
+
import { D as DFPAdSlot } from './AdSlot-c40f4438.js';
|
|
17
17
|
import { g as get_1 } from './get-b074314b.js';
|
|
18
18
|
|
|
19
19
|
var Dfp = React__default.lazy(function () {
|
|
20
|
-
return import('./Dfp-
|
|
20
|
+
return import('./Dfp-0567f8a3.js');
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
var AD = function AD(props) {
|
package/dist/esm/GridContent.js
CHANGED
|
@@ -13,9 +13,9 @@ import './debounce-dc0c02e5.js';
|
|
|
13
13
|
import 'react-dom';
|
|
14
14
|
import './index-ca4ff5cb.js';
|
|
15
15
|
import './index-3c1ee9ab.js';
|
|
16
|
-
import './main-
|
|
16
|
+
import './main-e84e7749.js';
|
|
17
17
|
import './entities-e85d3a4a.js';
|
|
18
|
-
import './_babelHelpers-
|
|
19
|
-
import './AdSlot-
|
|
18
|
+
import './_babelHelpers-c212c59c.js';
|
|
19
|
+
import './AdSlot-c40f4438.js';
|
|
20
20
|
import './get-b074314b.js';
|
|
21
|
-
export { G as default } from './GridContent-
|
|
21
|
+
export { G as default } from './GridContent-e61fff04.js';
|
package/dist/esm/MasterDeck.js
CHANGED
|
@@ -12,8 +12,8 @@ import { withRouter } from 'next/router';
|
|
|
12
12
|
import { d as debounce_1 } from './debounce-dc0c02e5.js';
|
|
13
13
|
import 'react-dom';
|
|
14
14
|
import './index-ca4ff5cb.js';
|
|
15
|
-
import { m as main_36 } from './main-
|
|
16
|
-
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-
|
|
15
|
+
import { m as main_36 } from './main-e84e7749.js';
|
|
16
|
+
import { i as inherits, c as createClass, a as classCallCheck, p as possibleConstructorReturn, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
|
|
17
17
|
|
|
18
18
|
var MasterDeck = function (_React$Component) {
|
|
19
19
|
inherits(MasterDeck, _React$Component);
|
|
@@ -5,9 +5,9 @@ import Container from 'react-bootstrap/Container';
|
|
|
5
5
|
import Row from 'react-bootstrap/Row';
|
|
6
6
|
import Col from 'react-bootstrap/Col';
|
|
7
7
|
import Link from 'next/link';
|
|
8
|
-
import { m as main_36,
|
|
9
|
-
import { s as slicedToArray } from './_babelHelpers-
|
|
10
|
-
import { D as DFPAdSlot } from './AdSlot-
|
|
8
|
+
import { m as main_36, c as main_37 } from './main-e84e7749.js';
|
|
9
|
+
import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
|
|
10
|
+
import { D as DFPAdSlot } from './AdSlot-c40f4438.js';
|
|
11
11
|
import { g as get_1 } from './get-b074314b.js';
|
|
12
12
|
import { Dropdown } from 'react-bootstrap';
|
|
13
13
|
import { G as GenIcon, b as IoMdLogIn, c as IoIosHome } from './index.esm-536609db.js';
|
|
@@ -8,9 +8,9 @@ import { useRouter } from 'next/router';
|
|
|
8
8
|
import 'react-dom';
|
|
9
9
|
import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
10
10
|
import { L as LazyLoad } from './index-3c1ee9ab.js';
|
|
11
|
-
import { m as main_36 } from './main-
|
|
11
|
+
import { m as main_36 } from './main-e84e7749.js';
|
|
12
12
|
import { c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
13
|
-
import { s as slicedToArray, _ as _extends, t as toConsumableArray } from './_babelHelpers-
|
|
13
|
+
import { s as slicedToArray, _ as _extends, t as toConsumableArray } from './_babelHelpers-c212c59c.js';
|
|
14
14
|
import { Container, Media } from 'react-bootstrap';
|
|
15
15
|
|
|
16
16
|
var urlFor = function urlFor(source, builder) {
|
|
@@ -6,7 +6,7 @@ import Col from 'react-bootstrap/Col';
|
|
|
6
6
|
import Card from 'react-bootstrap/Card';
|
|
7
7
|
import { n as node, i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
8
8
|
import { L as LazyLoad } from './index-3c1ee9ab.js';
|
|
9
|
-
import { _ as _extends } from './_babelHelpers-
|
|
9
|
+
import { _ as _extends } from './_babelHelpers-c212c59c.js';
|
|
10
10
|
|
|
11
11
|
/*
|
|
12
12
|
object-assign
|
package/dist/esm/TaxonomyCard.js
CHANGED
|
@@ -8,5 +8,5 @@ import 'react-bootstrap/Card';
|
|
|
8
8
|
import 'react-dom';
|
|
9
9
|
import './index-ca4ff5cb.js';
|
|
10
10
|
import './index-3c1ee9ab.js';
|
|
11
|
-
import './_babelHelpers-
|
|
12
|
-
export { T as default } from './TaxonomyCard-
|
|
11
|
+
import './_babelHelpers-c212c59c.js';
|
|
12
|
+
export { T as default } from './TaxonomyCard-92f9e327.js';
|
|
@@ -7,14 +7,14 @@ import 'react-bootstrap/Row';
|
|
|
7
7
|
import 'react-bootstrap/Col';
|
|
8
8
|
import 'next/link';
|
|
9
9
|
import './debounce-dc0c02e5.js';
|
|
10
|
-
import './main-
|
|
11
|
-
import './_babelHelpers-
|
|
12
|
-
import './AdSlot-
|
|
10
|
+
import './main-e84e7749.js';
|
|
11
|
+
import './_babelHelpers-c212c59c.js';
|
|
12
|
+
import './AdSlot-c40f4438.js';
|
|
13
13
|
import './get-b074314b.js';
|
|
14
14
|
import 'react-bootstrap';
|
|
15
15
|
import './index.esm-536609db.js';
|
|
16
16
|
import 'react-bootstrap/Button';
|
|
17
|
-
export { T as default } from './Normal-
|
|
17
|
+
export { T as default } from './Normal-ebb02255.js';
|
|
18
18
|
import 'react-bootstrap/ListGroup';
|
|
19
19
|
import 'next/head';
|
|
20
20
|
import 'react-bootstrap/Nav';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
2
|
-
import { s as slicedToArray } from './_babelHelpers-
|
|
2
|
+
import { s as slicedToArray } from './_babelHelpers-c212c59c.js';
|
|
3
3
|
import { G as GenIcon, d as IoIosOpen } from './index.esm-536609db.js';
|
|
4
4
|
|
|
5
5
|
// THIS FILE IS AUTO GENERATED
|
package/dist/esm/Ustream.js
CHANGED