@mjhls/mjh-framework 1.0.238 → 1.0.240

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 (49) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AdSlot-c472fff6.js +1192 -0
  3. package/dist/cjs/DeckContent.js +6 -5
  4. package/dist/cjs/DeckQueue.js +5 -5
  5. package/dist/cjs/{Dfp-045b016b.js → Dfp-7a5533f9.js} +1 -1
  6. package/dist/cjs/{GridContent-53e78cbf.js → GridContent-f9e3fff5.js} +7 -7
  7. package/dist/cjs/GridContent.js +8 -7
  8. package/dist/cjs/MasterDeck.js +331 -13
  9. package/dist/cjs/{Normal-a94a1ec8.js → Normal-0497eb61.js} +5 -5
  10. package/dist/cjs/QueueDeckExpanded.js +2 -2
  11. package/dist/cjs/TemplateNormal.js +6 -5
  12. package/dist/cjs/VideoSeriesListing.js +2 -2
  13. package/dist/cjs/{debounce-bbca43c4.js → debounce-783eb233.js} +3 -0
  14. package/dist/cjs/{get-af2516a4.js → get-1f91592f.js} +1 -1
  15. package/dist/cjs/index.js +118 -842
  16. package/dist/cjs/{inherits-5b5ca8db.js → inherits-9898af5a.js} +2 -4
  17. package/dist/cjs/{main-d9a1b014.js → main-0ea1b808.js} +51 -0
  18. package/dist/cjs/{MasterDeck-91c6ad85.js → promise-b96c61f8.js} +7 -340
  19. package/dist/cjs/{toConsumableArray-7e4caf3c.js → toConsumableArray-f05a306f.js} +5 -52
  20. package/dist/esm/AdSlot-bdd7a629.js +1183 -0
  21. package/dist/esm/DeckContent.js +11 -10
  22. package/dist/esm/DeckQueue.js +9 -9
  23. package/dist/esm/{Dfp-01f14ae3.js → Dfp-71879c9d.js} +5 -5
  24. package/dist/esm/{GridContent-f5bc4d75.js → GridContent-d4f5457e.js} +8 -8
  25. package/dist/esm/GridContent.js +13 -12
  26. package/dist/esm/MasterDeck.js +333 -15
  27. package/dist/esm/{Normal-357f00d1.js → Normal-e1855047.js} +6 -6
  28. package/dist/esm/QueueDeckExpanded.js +7 -7
  29. package/dist/esm/{TaxonomyCard-f74512cb.js → TaxonomyCard-ee1a22ae.js} +1 -1
  30. package/dist/esm/TaxonomyCard.js +3 -3
  31. package/dist/esm/TemplateNormal.js +10 -9
  32. package/dist/esm/{Ustream-62a07a32.js → Ustream-d51b9b11.js} +1 -1
  33. package/dist/esm/Ustream.js +5 -5
  34. package/dist/esm/VideoSeriesListing.js +5 -5
  35. package/dist/esm/{_to-object-86553f76.js → _to-object-b9b796ec.js} +1 -1
  36. package/dist/esm/{core.get-iterator-method-709061dc.js → core.get-iterator-method-31c1fb1a.js} +2 -2
  37. package/dist/esm/{debounce-fa7fbf11.js → debounce-806f886b.js} +3 -1
  38. package/dist/esm/{extends-7f88fa22.js → extends-dbbe308d.js} +1 -1
  39. package/dist/esm/{get-8d382479.js → get-b2201dc8.js} +1 -1
  40. package/dist/esm/index.js +124 -850
  41. package/dist/esm/{inherits-a82a4471.js → inherits-a75c8a1c.js} +5 -6
  42. package/dist/esm/{main-eecf7b27.js → main-155ec04f.js} +48 -1
  43. package/dist/esm/{MasterDeck-5dd97a66.js → promise-683a9c54.js} +6 -335
  44. package/dist/esm/{slicedToArray-eb7eca9e.js → slicedToArray-d0a9593a.js} +3 -3
  45. package/dist/esm/{toConsumableArray-08d50169.js → toConsumableArray-eb308ede.js} +5 -49
  46. package/dist/esm/{web.dom.iterable-f05d2f57.js → web.dom.iterable-3be50d6c.js} +2 -2
  47. package/package.json +3 -2
  48. package/dist/cjs/AdSlot-1fe1c231.js +0 -69
  49. package/dist/esm/AdSlot-017b8051.js +0 -64
@@ -0,0 +1,1183 @@
1
+ import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
2
+ import { b as _core } from './_to-object-b9b796ec.js';
3
+ import { d as debounce_1 } from './debounce-806f886b.js';
4
+ import { a as main_16 } from './main-155ec04f.js';
5
+ import React__default, { useState } from 'react';
6
+ import { b as lib_2 } from './index-fa84ea96.js';
7
+ import PropTypes from 'prop-types';
8
+ import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
9
+ import { p as promise } from './promise-683a9c54.js';
10
+
11
+ var runtime = createCommonjsModule(function (module) {
12
+ /**
13
+ * Copyright (c) 2014-present, Facebook, Inc.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+
19
+ !(function(global) {
20
+
21
+ var Op = Object.prototype;
22
+ var hasOwn = Op.hasOwnProperty;
23
+ var undefined$1; // More compressible than void 0.
24
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
25
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
26
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
27
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
28
+ var runtime = global.regeneratorRuntime;
29
+ if (runtime) {
30
+ {
31
+ // If regeneratorRuntime is defined globally and we're in a module,
32
+ // make the exports object identical to regeneratorRuntime.
33
+ module.exports = runtime;
34
+ }
35
+ // Don't bother evaluating the rest of this file if the runtime was
36
+ // already defined globally.
37
+ return;
38
+ }
39
+
40
+ // Define the runtime globally (as expected by generated code) as either
41
+ // module.exports (if we're in a module) or a new, empty object.
42
+ runtime = global.regeneratorRuntime = module.exports ;
43
+
44
+ function wrap(innerFn, outerFn, self, tryLocsList) {
45
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
46
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
47
+ var generator = Object.create(protoGenerator.prototype);
48
+ var context = new Context(tryLocsList || []);
49
+
50
+ // The ._invoke method unifies the implementations of the .next,
51
+ // .throw, and .return methods.
52
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
53
+
54
+ return generator;
55
+ }
56
+ runtime.wrap = wrap;
57
+
58
+ // Try/catch helper to minimize deoptimizations. Returns a completion
59
+ // record like context.tryEntries[i].completion. This interface could
60
+ // have been (and was previously) designed to take a closure to be
61
+ // invoked without arguments, but in all the cases we care about we
62
+ // already have an existing method we want to call, so there's no need
63
+ // to create a new function object. We can even get away with assuming
64
+ // the method takes exactly one argument, since that happens to be true
65
+ // in every case, so we don't have to touch the arguments object. The
66
+ // only additional allocation required is the completion record, which
67
+ // has a stable shape and so hopefully should be cheap to allocate.
68
+ function tryCatch(fn, obj, arg) {
69
+ try {
70
+ return { type: "normal", arg: fn.call(obj, arg) };
71
+ } catch (err) {
72
+ return { type: "throw", arg: err };
73
+ }
74
+ }
75
+
76
+ var GenStateSuspendedStart = "suspendedStart";
77
+ var GenStateSuspendedYield = "suspendedYield";
78
+ var GenStateExecuting = "executing";
79
+ var GenStateCompleted = "completed";
80
+
81
+ // Returning this object from the innerFn has the same effect as
82
+ // breaking out of the dispatch switch statement.
83
+ var ContinueSentinel = {};
84
+
85
+ // Dummy constructor functions that we use as the .constructor and
86
+ // .constructor.prototype properties for functions that return Generator
87
+ // objects. For full spec compliance, you may wish to configure your
88
+ // minifier not to mangle the names of these two functions.
89
+ function Generator() {}
90
+ function GeneratorFunction() {}
91
+ function GeneratorFunctionPrototype() {}
92
+
93
+ // This is a polyfill for %IteratorPrototype% for environments that
94
+ // don't natively support it.
95
+ var IteratorPrototype = {};
96
+ IteratorPrototype[iteratorSymbol] = function () {
97
+ return this;
98
+ };
99
+
100
+ var getProto = Object.getPrototypeOf;
101
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
102
+ if (NativeIteratorPrototype &&
103
+ NativeIteratorPrototype !== Op &&
104
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
105
+ // This environment has a native %IteratorPrototype%; use it instead
106
+ // of the polyfill.
107
+ IteratorPrototype = NativeIteratorPrototype;
108
+ }
109
+
110
+ var Gp = GeneratorFunctionPrototype.prototype =
111
+ Generator.prototype = Object.create(IteratorPrototype);
112
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
113
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
114
+ GeneratorFunctionPrototype[toStringTagSymbol] =
115
+ GeneratorFunction.displayName = "GeneratorFunction";
116
+
117
+ // Helper for defining the .next, .throw, and .return methods of the
118
+ // Iterator interface in terms of a single ._invoke method.
119
+ function defineIteratorMethods(prototype) {
120
+ ["next", "throw", "return"].forEach(function(method) {
121
+ prototype[method] = function(arg) {
122
+ return this._invoke(method, arg);
123
+ };
124
+ });
125
+ }
126
+
127
+ runtime.isGeneratorFunction = function(genFun) {
128
+ var ctor = typeof genFun === "function" && genFun.constructor;
129
+ return ctor
130
+ ? ctor === GeneratorFunction ||
131
+ // For the native GeneratorFunction constructor, the best we can
132
+ // do is to check its .name property.
133
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
134
+ : false;
135
+ };
136
+
137
+ runtime.mark = function(genFun) {
138
+ if (Object.setPrototypeOf) {
139
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
140
+ } else {
141
+ genFun.__proto__ = GeneratorFunctionPrototype;
142
+ if (!(toStringTagSymbol in genFun)) {
143
+ genFun[toStringTagSymbol] = "GeneratorFunction";
144
+ }
145
+ }
146
+ genFun.prototype = Object.create(Gp);
147
+ return genFun;
148
+ };
149
+
150
+ // Within the body of any async function, `await x` is transformed to
151
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
152
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
153
+ // meant to be awaited.
154
+ runtime.awrap = function(arg) {
155
+ return { __await: arg };
156
+ };
157
+
158
+ function AsyncIterator(generator) {
159
+ function invoke(method, arg, resolve, reject) {
160
+ var record = tryCatch(generator[method], generator, arg);
161
+ if (record.type === "throw") {
162
+ reject(record.arg);
163
+ } else {
164
+ var result = record.arg;
165
+ var value = result.value;
166
+ if (value &&
167
+ typeof value === "object" &&
168
+ hasOwn.call(value, "__await")) {
169
+ return Promise.resolve(value.__await).then(function(value) {
170
+ invoke("next", value, resolve, reject);
171
+ }, function(err) {
172
+ invoke("throw", err, resolve, reject);
173
+ });
174
+ }
175
+
176
+ return Promise.resolve(value).then(function(unwrapped) {
177
+ // When a yielded Promise is resolved, its final value becomes
178
+ // the .value of the Promise<{value,done}> result for the
179
+ // current iteration. If the Promise is rejected, however, the
180
+ // result for this iteration will be rejected with the same
181
+ // reason. Note that rejections of yielded Promises are not
182
+ // thrown back into the generator function, as is the case
183
+ // when an awaited Promise is rejected. This difference in
184
+ // behavior between yield and await is important, because it
185
+ // allows the consumer to decide what to do with the yielded
186
+ // rejection (swallow it and continue, manually .throw it back
187
+ // into the generator, abandon iteration, whatever). With
188
+ // await, by contrast, there is no opportunity to examine the
189
+ // rejection reason outside the generator function, so the
190
+ // only option is to throw it from the await expression, and
191
+ // let the generator function handle the exception.
192
+ result.value = unwrapped;
193
+ resolve(result);
194
+ }, reject);
195
+ }
196
+ }
197
+
198
+ var previousPromise;
199
+
200
+ function enqueue(method, arg) {
201
+ function callInvokeWithMethodAndArg() {
202
+ return new Promise(function(resolve, reject) {
203
+ invoke(method, arg, resolve, reject);
204
+ });
205
+ }
206
+
207
+ return previousPromise =
208
+ // If enqueue has been called before, then we want to wait until
209
+ // all previous Promises have been resolved before calling invoke,
210
+ // so that results are always delivered in the correct order. If
211
+ // enqueue has not been called before, then it is important to
212
+ // call invoke immediately, without waiting on a callback to fire,
213
+ // so that the async generator function has the opportunity to do
214
+ // any necessary setup in a predictable way. This predictability
215
+ // is why the Promise constructor synchronously invokes its
216
+ // executor callback, and why async functions synchronously
217
+ // execute code before the first await. Since we implement simple
218
+ // async functions in terms of async generators, it is especially
219
+ // important to get this right, even though it requires care.
220
+ previousPromise ? previousPromise.then(
221
+ callInvokeWithMethodAndArg,
222
+ // Avoid propagating failures to Promises returned by later
223
+ // invocations of the iterator.
224
+ callInvokeWithMethodAndArg
225
+ ) : callInvokeWithMethodAndArg();
226
+ }
227
+
228
+ // Define the unified helper method that is used to implement .next,
229
+ // .throw, and .return (see defineIteratorMethods).
230
+ this._invoke = enqueue;
231
+ }
232
+
233
+ defineIteratorMethods(AsyncIterator.prototype);
234
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
235
+ return this;
236
+ };
237
+ runtime.AsyncIterator = AsyncIterator;
238
+
239
+ // Note that simple async functions are implemented on top of
240
+ // AsyncIterator objects; they just return a Promise for the value of
241
+ // the final result produced by the iterator.
242
+ runtime.async = function(innerFn, outerFn, self, tryLocsList) {
243
+ var iter = new AsyncIterator(
244
+ wrap(innerFn, outerFn, self, tryLocsList)
245
+ );
246
+
247
+ return runtime.isGeneratorFunction(outerFn)
248
+ ? iter // If outerFn is a generator, return the full iterator.
249
+ : iter.next().then(function(result) {
250
+ return result.done ? result.value : iter.next();
251
+ });
252
+ };
253
+
254
+ function makeInvokeMethod(innerFn, self, context) {
255
+ var state = GenStateSuspendedStart;
256
+
257
+ return function invoke(method, arg) {
258
+ if (state === GenStateExecuting) {
259
+ throw new Error("Generator is already running");
260
+ }
261
+
262
+ if (state === GenStateCompleted) {
263
+ if (method === "throw") {
264
+ throw arg;
265
+ }
266
+
267
+ // Be forgiving, per 25.3.3.3.3 of the spec:
268
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
269
+ return doneResult();
270
+ }
271
+
272
+ context.method = method;
273
+ context.arg = arg;
274
+
275
+ while (true) {
276
+ var delegate = context.delegate;
277
+ if (delegate) {
278
+ var delegateResult = maybeInvokeDelegate(delegate, context);
279
+ if (delegateResult) {
280
+ if (delegateResult === ContinueSentinel) continue;
281
+ return delegateResult;
282
+ }
283
+ }
284
+
285
+ if (context.method === "next") {
286
+ // Setting context._sent for legacy support of Babel's
287
+ // function.sent implementation.
288
+ context.sent = context._sent = context.arg;
289
+
290
+ } else if (context.method === "throw") {
291
+ if (state === GenStateSuspendedStart) {
292
+ state = GenStateCompleted;
293
+ throw context.arg;
294
+ }
295
+
296
+ context.dispatchException(context.arg);
297
+
298
+ } else if (context.method === "return") {
299
+ context.abrupt("return", context.arg);
300
+ }
301
+
302
+ state = GenStateExecuting;
303
+
304
+ var record = tryCatch(innerFn, self, context);
305
+ if (record.type === "normal") {
306
+ // If an exception is thrown from innerFn, we leave state ===
307
+ // GenStateExecuting and loop back for another invocation.
308
+ state = context.done
309
+ ? GenStateCompleted
310
+ : GenStateSuspendedYield;
311
+
312
+ if (record.arg === ContinueSentinel) {
313
+ continue;
314
+ }
315
+
316
+ return {
317
+ value: record.arg,
318
+ done: context.done
319
+ };
320
+
321
+ } else if (record.type === "throw") {
322
+ state = GenStateCompleted;
323
+ // Dispatch the exception by looping back around to the
324
+ // context.dispatchException(context.arg) call above.
325
+ context.method = "throw";
326
+ context.arg = record.arg;
327
+ }
328
+ }
329
+ };
330
+ }
331
+
332
+ // Call delegate.iterator[context.method](context.arg) and handle the
333
+ // result, either by returning a { value, done } result from the
334
+ // delegate iterator, or by modifying context.method and context.arg,
335
+ // setting context.delegate to null, and returning the ContinueSentinel.
336
+ function maybeInvokeDelegate(delegate, context) {
337
+ var method = delegate.iterator[context.method];
338
+ if (method === undefined$1) {
339
+ // A .throw or .return when the delegate iterator has no .throw
340
+ // method always terminates the yield* loop.
341
+ context.delegate = null;
342
+
343
+ if (context.method === "throw") {
344
+ if (delegate.iterator.return) {
345
+ // If the delegate iterator has a return method, give it a
346
+ // chance to clean up.
347
+ context.method = "return";
348
+ context.arg = undefined$1;
349
+ maybeInvokeDelegate(delegate, context);
350
+
351
+ if (context.method === "throw") {
352
+ // If maybeInvokeDelegate(context) changed context.method from
353
+ // "return" to "throw", let that override the TypeError below.
354
+ return ContinueSentinel;
355
+ }
356
+ }
357
+
358
+ context.method = "throw";
359
+ context.arg = new TypeError(
360
+ "The iterator does not provide a 'throw' method");
361
+ }
362
+
363
+ return ContinueSentinel;
364
+ }
365
+
366
+ var record = tryCatch(method, delegate.iterator, context.arg);
367
+
368
+ if (record.type === "throw") {
369
+ context.method = "throw";
370
+ context.arg = record.arg;
371
+ context.delegate = null;
372
+ return ContinueSentinel;
373
+ }
374
+
375
+ var info = record.arg;
376
+
377
+ if (! info) {
378
+ context.method = "throw";
379
+ context.arg = new TypeError("iterator result is not an object");
380
+ context.delegate = null;
381
+ return ContinueSentinel;
382
+ }
383
+
384
+ if (info.done) {
385
+ // Assign the result of the finished delegate to the temporary
386
+ // variable specified by delegate.resultName (see delegateYield).
387
+ context[delegate.resultName] = info.value;
388
+
389
+ // Resume execution at the desired location (see delegateYield).
390
+ context.next = delegate.nextLoc;
391
+
392
+ // If context.method was "throw" but the delegate handled the
393
+ // exception, let the outer generator proceed normally. If
394
+ // context.method was "next", forget context.arg since it has been
395
+ // "consumed" by the delegate iterator. If context.method was
396
+ // "return", allow the original .return call to continue in the
397
+ // outer generator.
398
+ if (context.method !== "return") {
399
+ context.method = "next";
400
+ context.arg = undefined$1;
401
+ }
402
+
403
+ } else {
404
+ // Re-yield the result returned by the delegate method.
405
+ return info;
406
+ }
407
+
408
+ // The delegate iterator is finished, so forget it and continue with
409
+ // the outer generator.
410
+ context.delegate = null;
411
+ return ContinueSentinel;
412
+ }
413
+
414
+ // Define Generator.prototype.{next,throw,return} in terms of the
415
+ // unified ._invoke helper method.
416
+ defineIteratorMethods(Gp);
417
+
418
+ Gp[toStringTagSymbol] = "Generator";
419
+
420
+ // A Generator should always return itself as the iterator object when the
421
+ // @@iterator function is called on it. Some browsers' implementations of the
422
+ // iterator prototype chain incorrectly implement this, causing the Generator
423
+ // object to not be returned from this call. This ensures that doesn't happen.
424
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
425
+ Gp[iteratorSymbol] = function() {
426
+ return this;
427
+ };
428
+
429
+ Gp.toString = function() {
430
+ return "[object Generator]";
431
+ };
432
+
433
+ function pushTryEntry(locs) {
434
+ var entry = { tryLoc: locs[0] };
435
+
436
+ if (1 in locs) {
437
+ entry.catchLoc = locs[1];
438
+ }
439
+
440
+ if (2 in locs) {
441
+ entry.finallyLoc = locs[2];
442
+ entry.afterLoc = locs[3];
443
+ }
444
+
445
+ this.tryEntries.push(entry);
446
+ }
447
+
448
+ function resetTryEntry(entry) {
449
+ var record = entry.completion || {};
450
+ record.type = "normal";
451
+ delete record.arg;
452
+ entry.completion = record;
453
+ }
454
+
455
+ function Context(tryLocsList) {
456
+ // The root entry object (effectively a try statement without a catch
457
+ // or a finally block) gives us a place to store values thrown from
458
+ // locations where there is no enclosing try statement.
459
+ this.tryEntries = [{ tryLoc: "root" }];
460
+ tryLocsList.forEach(pushTryEntry, this);
461
+ this.reset(true);
462
+ }
463
+
464
+ runtime.keys = function(object) {
465
+ var keys = [];
466
+ for (var key in object) {
467
+ keys.push(key);
468
+ }
469
+ keys.reverse();
470
+
471
+ // Rather than returning an object with a next method, we keep
472
+ // things simple and return the next function itself.
473
+ return function next() {
474
+ while (keys.length) {
475
+ var key = keys.pop();
476
+ if (key in object) {
477
+ next.value = key;
478
+ next.done = false;
479
+ return next;
480
+ }
481
+ }
482
+
483
+ // To avoid creating an additional object, we just hang the .value
484
+ // and .done properties off the next function object itself. This
485
+ // also ensures that the minifier will not anonymize the function.
486
+ next.done = true;
487
+ return next;
488
+ };
489
+ };
490
+
491
+ function values(iterable) {
492
+ if (iterable) {
493
+ var iteratorMethod = iterable[iteratorSymbol];
494
+ if (iteratorMethod) {
495
+ return iteratorMethod.call(iterable);
496
+ }
497
+
498
+ if (typeof iterable.next === "function") {
499
+ return iterable;
500
+ }
501
+
502
+ if (!isNaN(iterable.length)) {
503
+ var i = -1, next = function next() {
504
+ while (++i < iterable.length) {
505
+ if (hasOwn.call(iterable, i)) {
506
+ next.value = iterable[i];
507
+ next.done = false;
508
+ return next;
509
+ }
510
+ }
511
+
512
+ next.value = undefined$1;
513
+ next.done = true;
514
+
515
+ return next;
516
+ };
517
+
518
+ return next.next = next;
519
+ }
520
+ }
521
+
522
+ // Return an iterator with no values.
523
+ return { next: doneResult };
524
+ }
525
+ runtime.values = values;
526
+
527
+ function doneResult() {
528
+ return { value: undefined$1, done: true };
529
+ }
530
+
531
+ Context.prototype = {
532
+ constructor: Context,
533
+
534
+ reset: function(skipTempReset) {
535
+ this.prev = 0;
536
+ this.next = 0;
537
+ // Resetting context._sent for legacy support of Babel's
538
+ // function.sent implementation.
539
+ this.sent = this._sent = undefined$1;
540
+ this.done = false;
541
+ this.delegate = null;
542
+
543
+ this.method = "next";
544
+ this.arg = undefined$1;
545
+
546
+ this.tryEntries.forEach(resetTryEntry);
547
+
548
+ if (!skipTempReset) {
549
+ for (var name in this) {
550
+ // Not sure about the optimal order of these conditions:
551
+ if (name.charAt(0) === "t" &&
552
+ hasOwn.call(this, name) &&
553
+ !isNaN(+name.slice(1))) {
554
+ this[name] = undefined$1;
555
+ }
556
+ }
557
+ }
558
+ },
559
+
560
+ stop: function() {
561
+ this.done = true;
562
+
563
+ var rootEntry = this.tryEntries[0];
564
+ var rootRecord = rootEntry.completion;
565
+ if (rootRecord.type === "throw") {
566
+ throw rootRecord.arg;
567
+ }
568
+
569
+ return this.rval;
570
+ },
571
+
572
+ dispatchException: function(exception) {
573
+ if (this.done) {
574
+ throw exception;
575
+ }
576
+
577
+ var context = this;
578
+ function handle(loc, caught) {
579
+ record.type = "throw";
580
+ record.arg = exception;
581
+ context.next = loc;
582
+
583
+ if (caught) {
584
+ // If the dispatched exception was caught by a catch block,
585
+ // then let that catch block handle the exception normally.
586
+ context.method = "next";
587
+ context.arg = undefined$1;
588
+ }
589
+
590
+ return !! caught;
591
+ }
592
+
593
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
594
+ var entry = this.tryEntries[i];
595
+ var record = entry.completion;
596
+
597
+ if (entry.tryLoc === "root") {
598
+ // Exception thrown outside of any try block that could handle
599
+ // it, so set the completion value of the entire function to
600
+ // throw the exception.
601
+ return handle("end");
602
+ }
603
+
604
+ if (entry.tryLoc <= this.prev) {
605
+ var hasCatch = hasOwn.call(entry, "catchLoc");
606
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
607
+
608
+ if (hasCatch && hasFinally) {
609
+ if (this.prev < entry.catchLoc) {
610
+ return handle(entry.catchLoc, true);
611
+ } else if (this.prev < entry.finallyLoc) {
612
+ return handle(entry.finallyLoc);
613
+ }
614
+
615
+ } else if (hasCatch) {
616
+ if (this.prev < entry.catchLoc) {
617
+ return handle(entry.catchLoc, true);
618
+ }
619
+
620
+ } else if (hasFinally) {
621
+ if (this.prev < entry.finallyLoc) {
622
+ return handle(entry.finallyLoc);
623
+ }
624
+
625
+ } else {
626
+ throw new Error("try statement without catch or finally");
627
+ }
628
+ }
629
+ }
630
+ },
631
+
632
+ abrupt: function(type, arg) {
633
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
634
+ var entry = this.tryEntries[i];
635
+ if (entry.tryLoc <= this.prev &&
636
+ hasOwn.call(entry, "finallyLoc") &&
637
+ this.prev < entry.finallyLoc) {
638
+ var finallyEntry = entry;
639
+ break;
640
+ }
641
+ }
642
+
643
+ if (finallyEntry &&
644
+ (type === "break" ||
645
+ type === "continue") &&
646
+ finallyEntry.tryLoc <= arg &&
647
+ arg <= finallyEntry.finallyLoc) {
648
+ // Ignore the finally entry if control is not jumping to a
649
+ // location outside the try/catch block.
650
+ finallyEntry = null;
651
+ }
652
+
653
+ var record = finallyEntry ? finallyEntry.completion : {};
654
+ record.type = type;
655
+ record.arg = arg;
656
+
657
+ if (finallyEntry) {
658
+ this.method = "next";
659
+ this.next = finallyEntry.finallyLoc;
660
+ return ContinueSentinel;
661
+ }
662
+
663
+ return this.complete(record);
664
+ },
665
+
666
+ complete: function(record, afterLoc) {
667
+ if (record.type === "throw") {
668
+ throw record.arg;
669
+ }
670
+
671
+ if (record.type === "break" ||
672
+ record.type === "continue") {
673
+ this.next = record.arg;
674
+ } else if (record.type === "return") {
675
+ this.rval = this.arg = record.arg;
676
+ this.method = "return";
677
+ this.next = "end";
678
+ } else if (record.type === "normal" && afterLoc) {
679
+ this.next = afterLoc;
680
+ }
681
+
682
+ return ContinueSentinel;
683
+ },
684
+
685
+ finish: function(finallyLoc) {
686
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
687
+ var entry = this.tryEntries[i];
688
+ if (entry.finallyLoc === finallyLoc) {
689
+ this.complete(entry.completion, entry.afterLoc);
690
+ resetTryEntry(entry);
691
+ return ContinueSentinel;
692
+ }
693
+ }
694
+ },
695
+
696
+ "catch": function(tryLoc) {
697
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
698
+ var entry = this.tryEntries[i];
699
+ if (entry.tryLoc === tryLoc) {
700
+ var record = entry.completion;
701
+ if (record.type === "throw") {
702
+ var thrown = record.arg;
703
+ resetTryEntry(entry);
704
+ }
705
+ return thrown;
706
+ }
707
+ }
708
+
709
+ // The context.catch method must only be called with a location
710
+ // argument that corresponds to a known catch block.
711
+ throw new Error("illegal catch attempt");
712
+ },
713
+
714
+ delegateYield: function(iterable, resultName, nextLoc) {
715
+ this.delegate = {
716
+ iterator: values(iterable),
717
+ resultName: resultName,
718
+ nextLoc: nextLoc
719
+ };
720
+
721
+ if (this.method === "next") {
722
+ // Deliberately forget the last sent value so that we don't
723
+ // accidentally pass it on to the delegate.
724
+ this.arg = undefined$1;
725
+ }
726
+
727
+ return ContinueSentinel;
728
+ }
729
+ };
730
+ })(
731
+ // In sloppy mode, unbound `this` refers to the global object, fallback to
732
+ // Function constructor if we're in global strict mode. That is sadly a form
733
+ // of indirect eval which violates Content Security Policy.
734
+ (function() { return this })() || Function("return this")()
735
+ );
736
+ });
737
+
738
+ /**
739
+ * Copyright (c) 2014-present, Facebook, Inc.
740
+ *
741
+ * This source code is licensed under the MIT license found in the
742
+ * LICENSE file in the root directory of this source tree.
743
+ */
744
+
745
+ // This method of obtaining a reference to the global object needs to be
746
+ // kept identical to the way it is obtained in runtime.js
747
+ var g = (function() { return this })() || Function("return this")();
748
+
749
+ // Use `getOwnPropertyNames` because not all browsers support calling
750
+ // `hasOwnProperty` on the global `self` object in a worker. See #183.
751
+ var hadRuntime = g.regeneratorRuntime &&
752
+ Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
753
+
754
+ // Save the old regeneratorRuntime in case it needs to be restored later.
755
+ var oldRuntime = hadRuntime && g.regeneratorRuntime;
756
+
757
+ // Force reevalutation of runtime.js.
758
+ g.regeneratorRuntime = undefined;
759
+
760
+ var runtimeModule = runtime;
761
+
762
+ if (hadRuntime) {
763
+ // Restore the original runtime.
764
+ g.regeneratorRuntime = oldRuntime;
765
+ } else {
766
+ // Remove the global property added by runtime.js.
767
+ try {
768
+ delete g.regeneratorRuntime;
769
+ } catch(e) {
770
+ g.regeneratorRuntime = undefined;
771
+ }
772
+ }
773
+
774
+ var regenerator = runtimeModule;
775
+
776
+ var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
777
+ var stringify = function stringify(it) { // eslint-disable-line no-unused-vars
778
+ return $JSON.stringify.apply($JSON, arguments);
779
+ };
780
+
781
+ var stringify$1 = createCommonjsModule(function (module) {
782
+ module.exports = { "default": stringify, __esModule: true };
783
+ });
784
+
785
+ var _JSON$stringify = unwrapExports(stringify$1);
786
+
787
+ var asyncToGenerator = createCommonjsModule(function (module, exports) {
788
+
789
+ exports.__esModule = true;
790
+
791
+
792
+
793
+ var _promise2 = _interopRequireDefault(promise);
794
+
795
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
796
+
797
+ exports.default = function (fn) {
798
+ return function () {
799
+ var gen = fn.apply(this, arguments);
800
+ return new _promise2.default(function (resolve, reject) {
801
+ function step(key, arg) {
802
+ try {
803
+ var info = gen[key](arg);
804
+ var value = info.value;
805
+ } catch (error) {
806
+ reject(error);
807
+ return;
808
+ }
809
+
810
+ if (info.done) {
811
+ resolve(value);
812
+ } else {
813
+ return _promise2.default.resolve(value).then(function (value) {
814
+ step("next", value);
815
+ }, function (err) {
816
+ step("throw", err);
817
+ });
818
+ }
819
+ }
820
+
821
+ return step("next");
822
+ });
823
+ };
824
+ };
825
+ });
826
+
827
+ var _asyncToGenerator = unwrapExports(asyncToGenerator);
828
+
829
+ var faunadb = require('faunadb');
830
+
831
+ var _require = require('faunadb'),
832
+ q = _require.query;
833
+
834
+ var shortid = require('shortid');
835
+ var moment = require('moment');
836
+ var cookie = require('react-cookies'); // client side cookie handler
837
+
838
+ var _require2 = require('cookie'),
839
+ serialize = _require2.serialize; // cookie serializer
840
+
841
+
842
+ var serverCookies = require('next-cookies'); // server side cookie handler
843
+ var request = require('superagent');
844
+ require("babel-polyfill");
845
+ // server key for beam
846
+ // fnADs4Gtx6ACEgKgwlNo-eNSIrdwykH9Zj74GsDI
847
+
848
+ var beam_domain = 'https://beam.mjhlifesciences.com';
849
+
850
+ var Beam = {
851
+ proc_url: function proc_url() {
852
+ var $_GET = {};
853
+ document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
854
+ function decode(s) {
855
+ return decodeURIComponent(s.split("+").join(" "));
856
+ }
857
+ $_GET[decode(arguments[1])] = decode(arguments[2]);
858
+ });
859
+
860
+ return $_GET;
861
+ },
862
+ proc_eKey: function proc_eKey($_GET) {
863
+ var eKey = "N/A";
864
+
865
+ if ($_GET["eKey"]) {
866
+ eKey = $_GET["eKey"];
867
+ } else if (typeof window.eKey !== 'undefined') {
868
+ eKey = window.eKey;
869
+ }
870
+
871
+ return eKey;
872
+ },
873
+ proc_source: function proc_source() {
874
+ var referrer = "N/A";
875
+
876
+ if (encodeURIComponent(document.referrer)) {
877
+ referrer = encodeURIComponent(document.referrer);
878
+ }
879
+
880
+ return referrer;
881
+ },
882
+ proc_meta: function proc_meta() {
883
+ var data = {};
884
+
885
+ //keyword processing
886
+ var element = document.querySelector('meta[name="keywords"]');
887
+
888
+ data.keywords = "N/A";
889
+
890
+ if (element && element.getAttribute("content")) {
891
+ data.keywords = element.getAttribute("content");
892
+ }
893
+
894
+ //title processing
895
+ data.title = "N/A";
896
+ if (document.title !== "undefined") {
897
+ data.title = document.title;
898
+ }
899
+
900
+ return data;
901
+ },
902
+ proc_host: function proc_host() {
903
+ var data = {};
904
+ data.domain = window.location.hostname;
905
+ data.uri = window.location.pathname;
906
+ data.host = window.location.host;
907
+ data.protocol = window.location.protocol;
908
+
909
+ if (window.location.search) {
910
+ data.uri = data.uri + window.location.search;
911
+ }
912
+
913
+ return data;
914
+ },
915
+ get_beam: function get_beam(deviceType) {
916
+ var beam = {};
917
+ beam.eKey = this.proc_eKey(this.proc_url());
918
+ beam.source = this.proc_source();
919
+ beam.meta = this.proc_meta();
920
+ beam.host = this.proc_host();
921
+ beam.device = deviceType;
922
+ return beam;
923
+ },
924
+
925
+
926
+ /* for client use */
927
+ report_beam_event: function report_beam_event(action, deviceType) {
928
+ var _this = this;
929
+
930
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
931
+ var beam, response, res;
932
+ return regenerator.wrap(function _callee$(_context) {
933
+ while (1) {
934
+ switch (_context.prev = _context.next) {
935
+ case 0:
936
+ beam = _this.get_beam(deviceType);
937
+ _context.next = 3;
938
+ return fetch(beam_domain + '/api/beam/event', {
939
+ headers: {
940
+ 'Content-Type': 'application/json',
941
+ 'Accept': 'application/json'
942
+ },
943
+ method: 'post',
944
+ credentials: "include",
945
+ body: _JSON$stringify({
946
+ event: 'Beam',
947
+ action: action,
948
+ beam: _JSON$stringify(beam)
949
+ })
950
+ });
951
+
952
+ case 3:
953
+ response = _context.sent;
954
+ _context.next = 6;
955
+ return response.json();
956
+
957
+ case 6:
958
+ res = _context.sent;
959
+
960
+ if (res.error) {
961
+ console.error('Beam reporting error:', res.error);
962
+ }
963
+
964
+ case 8:
965
+ case 'end':
966
+ return _context.stop();
967
+ }
968
+ }
969
+ }, _callee, _this);
970
+ }))();
971
+ },
972
+ report_beam_ad: function report_beam_ad(action, deviceType, cID, lID, campID, adSize, slotId) {
973
+ var _this2 = this;
974
+
975
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
976
+ var beam, data, response, res;
977
+ return regenerator.wrap(function _callee2$(_context2) {
978
+ while (1) {
979
+ switch (_context2.prev = _context2.next) {
980
+ case 0:
981
+ beam = _this2.get_beam(deviceType);
982
+ data = {};
983
+
984
+ data.campaignId = campID;
985
+ data.lineItemId = lID;
986
+ data.creativeId = cID;
987
+ data.size = adSize;
988
+ data.slotId = slotId;
989
+
990
+ _context2.next = 9;
991
+ return fetch(beam_domain + '/api/beam/ad', {
992
+ headers: {
993
+ 'Content-Type': 'application/json',
994
+ 'Accept': 'application/json'
995
+ },
996
+ method: 'post',
997
+ credentials: "include",
998
+ body: _JSON$stringify({
999
+ event: 'DFP',
1000
+ action: action,
1001
+ beam: _JSON$stringify(beam),
1002
+ data: _JSON$stringify(data)
1003
+ })
1004
+ });
1005
+
1006
+ case 9:
1007
+ response = _context2.sent;
1008
+ _context2.next = 12;
1009
+ return response.json();
1010
+
1011
+ case 12:
1012
+ res = _context2.sent;
1013
+
1014
+ if (res.error) {
1015
+ console.error('Beam AD reporting error:', res.error);
1016
+ }
1017
+
1018
+ case 14:
1019
+ case 'end':
1020
+ return _context2.stop();
1021
+ }
1022
+ }
1023
+ }, _callee2, _this2);
1024
+ }))();
1025
+ },
1026
+ report_beam_video: function report_beam_video(action, deviceType, duration, current, segment) {
1027
+ var _this3 = this;
1028
+
1029
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
1030
+ var beam, data, response, res;
1031
+ return regenerator.wrap(function _callee3$(_context3) {
1032
+ while (1) {
1033
+ switch (_context3.prev = _context3.next) {
1034
+ case 0:
1035
+ beam = _this3.get_beam(deviceType);
1036
+ data = {};
1037
+
1038
+ data.duration = duration;
1039
+ data.queue = Math.floor(duration / 10);
1040
+ data.segment = segment;
1041
+ data.current = current;
1042
+
1043
+ _context3.next = 8;
1044
+ return fetch(beam_domain + '/api/beam/video', {
1045
+ headers: {
1046
+ 'Content-Type': 'application/json',
1047
+ 'Accept': 'application/json'
1048
+ },
1049
+ method: 'post',
1050
+ credentials: "include",
1051
+ body: _JSON$stringify({
1052
+ event: 'DFP',
1053
+ action: action,
1054
+ beam: _JSON$stringify(beam),
1055
+ data: _JSON$stringify(data)
1056
+ })
1057
+ });
1058
+
1059
+ case 8:
1060
+ response = _context3.sent;
1061
+ _context3.next = 11;
1062
+ return response.json();
1063
+
1064
+ case 11:
1065
+ res = _context3.sent;
1066
+
1067
+ if (res.error) {
1068
+ console.error('Beam AD reporting error:', res.error);
1069
+ }
1070
+
1071
+ case 13:
1072
+ case 'end':
1073
+ return _context3.stop();
1074
+ }
1075
+ }
1076
+ }, _callee3, _this3);
1077
+ }))();
1078
+ }
1079
+ };
1080
+
1081
+ var DFPAdSlot = function DFPAdSlot(_ref) {
1082
+ var adUnit = _ref.adUnit,
1083
+ sizeMapping = _ref.sizeMapping,
1084
+ className = _ref.className,
1085
+ slotId = _ref.slotId,
1086
+ sizes = _ref.sizes,
1087
+ _ref$targeting = _ref.targeting,
1088
+ targeting = _ref$targeting === undefined ? {} : _ref$targeting;
1089
+
1090
+ var _useState = useState(false),
1091
+ _useState2 = _slicedToArray(_useState, 2),
1092
+ adRendered = _useState2[0],
1093
+ setAdRendered = _useState2[1];
1094
+
1095
+ var _useState3 = useState(false),
1096
+ _useState4 = _slicedToArray(_useState3, 2),
1097
+ adRefreshable = _useState4[0],
1098
+ setAdRefreshable = _useState4[1];
1099
+
1100
+ var _useState5 = useState(false),
1101
+ _useState6 = _slicedToArray(_useState5, 2),
1102
+ adHasFocus = _useState6[0],
1103
+ setAdHasFocus = _useState6[1];
1104
+
1105
+ var handleVisibilityChange = debounce_1(function (_ref2) {
1106
+ var event = _ref2.event;
1107
+
1108
+ if (event.inViewPercentage <= 0) {
1109
+ setAdRefreshable(false);
1110
+ } else {
1111
+ setAdRefreshable(true);
1112
+ }
1113
+ }, 500);
1114
+
1115
+ return React__default.createElement(
1116
+ 'div',
1117
+ { className: className },
1118
+ React__default.createElement(lib_2, {
1119
+ slotId: slotId,
1120
+ sizes: sizes,
1121
+ adUnit: adUnit,
1122
+ sizeMapping: sizeMapping,
1123
+ targetingArguments: targeting,
1124
+ onSlotRender: function onSlotRender(eventData) {
1125
+ setAdRendered(true);
1126
+ if (eventData && eventData.event) {
1127
+ var cID = eventData.event.creativeId;
1128
+ var lID = eventData.event.lineItemId;
1129
+ var campID = eventData.event.campaignId;
1130
+ var adSize = eventData.event.size.length > 1 ? eventData.event.size[0] + 'x' + eventData.event.size[1] : '';
1131
+ var slot_id = eventData.slotId ? eventData.slotId : '';
1132
+
1133
+ Beam.report_beam_ad('Impression', main_16, cID, lID, campID, adSize, slot_id);
1134
+
1135
+ var slot_div = document.getElementById(eventData.slotId);
1136
+ if (slot_div) {
1137
+ slot_div.addEventListener('mouseenter', function () {
1138
+ var timeoutId = slot_div.getAttribute('timeoutId');
1139
+ clearTimeout(timeoutId);
1140
+ slot_div.setAttribute('hasFocus', 'yes');
1141
+ });
1142
+
1143
+ slot_div.addEventListener('mouseleave', function () {
1144
+ var timeoutId = setTimeout(function () {
1145
+ slot_div.setAttribute('hasFocus', 'no');
1146
+ }, 60);
1147
+ slot_div.setAttribute('timeoutId', timeoutId);
1148
+ });
1149
+
1150
+ document.addEventListener('visibilitychange', function () {
1151
+ if (!document.hidden) {
1152
+ return;
1153
+ }
1154
+
1155
+ var hasFocus = slot_div.getAttribute('hasFocus');
1156
+ if (hasFocus == 'yes' && document.hidden) {
1157
+ console.log('AD Clicked:', eventData.slotId);
1158
+ slot_div.setAttribute('hasFocus', 'no');
1159
+ Beam.report_beam_ad('Click', main_16, cID, lID, campID, adSize, slotId);
1160
+ }
1161
+ });
1162
+ } else {
1163
+ console.error('slot div not found:', slotId);
1164
+ }
1165
+ }
1166
+ },
1167
+ onSlotVisibilityChanged: handleVisibilityChange,
1168
+ shouldRefresh: function shouldRefresh() {
1169
+ if (adRendered && adRefreshable) return true;else return false;
1170
+ }
1171
+ })
1172
+ );
1173
+ };
1174
+
1175
+ DFPAdSlot.propTypes = {
1176
+ adUnit: PropTypes.string.isRequired,
1177
+ slotId: PropTypes.string,
1178
+ className: PropTypes.string,
1179
+ sizeMapping: PropTypes.array,
1180
+ sizes: PropTypes.array
1181
+ };
1182
+
1183
+ export { Beam as B, DFPAdSlot as D, _JSON$stringify as _, _asyncToGenerator as a, regenerator as r };