@mjhls/mjh-framework 1.0.280 → 1.0.282
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/{ADInfeed-f0bf34d7.js → ADInfeed-a33644bc.js} +1 -1
- package/dist/cjs/{AdSlot-9660e9aa.js → AdSlot-1886ea26.js} +2 -2
- package/dist/cjs/DeckContent.js +5 -5
- package/dist/cjs/DeckQueue.js +3 -3
- package/dist/cjs/{Dfp-36d51c84.js → Dfp-f75c65fd.js} +1 -1
- package/dist/cjs/{GridContent-4b4bbe7f.js → GridContent-26572c38.js} +5 -5
- package/dist/cjs/GridContent.js +7 -7
- package/dist/cjs/MasterDeck.js +3 -3
- package/dist/cjs/{Normal-878318e9.js → Normal-e68cf8f2.js} +5 -5
- package/dist/cjs/QueueDeckExpanded.js +4 -4
- package/dist/cjs/TemplateNormal.js +5 -5
- package/dist/cjs/VideoSeriesListing.js +2 -2
- package/dist/cjs/{debounce-fbfce522.js → debounce-ba3eaee2.js} +3 -0
- package/dist/cjs/{get-858530c2.js → get-de2660c3.js} +4 -1
- package/dist/cjs/index.js +1071 -321
- package/dist/cjs/{inherits-3fbaa008.js → inherits-dd435947.js} +1 -1
- package/dist/cjs/{promise-ea10b9c8.js → promise-2c453658.js} +1 -1
- package/dist/esm/{ADInfeed-cc019fcb.js → ADInfeed-fd816c1f.js} +1 -1
- package/dist/esm/{AdSlot-1f20130d.js → AdSlot-cc6a4f74.js} +2 -2
- package/dist/esm/DeckContent.js +5 -5
- package/dist/esm/DeckQueue.js +3 -3
- package/dist/esm/{Dfp-85f00c9b.js → Dfp-ea8d4531.js} +1 -1
- package/dist/esm/{GridContent-1292ff20.js → GridContent-2e9e7528.js} +5 -5
- package/dist/esm/GridContent.js +7 -7
- package/dist/esm/MasterDeck.js +3 -3
- package/dist/esm/{Normal-a2c50ae2.js → Normal-6a056c0d.js} +5 -5
- package/dist/esm/QueueDeckExpanded.js +4 -4
- package/dist/esm/TemplateNormal.js +5 -5
- package/dist/esm/VideoSeriesListing.js +2 -2
- package/dist/esm/{debounce-d15d4a31.js → debounce-93ab8f80.js} +1 -1
- package/dist/esm/{get-a0244443.js → get-9c285a85.js} +2 -2
- package/dist/esm/index.js +1073 -323
- package/dist/esm/{inherits-1d7657b5.js → inherits-2a854891.js} +1 -1
- package/dist/esm/{promise-eabb7f7e.js → promise-e3480f1c.js} +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as createCommonjsModule, a as commonjsGlobal, g as getCjsExportFromNamespace, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
2
|
import { _ as _objectKeys, a as _toObject, b as _core } from './_to-object-b9b796ec.js';
|
|
3
3
|
import './web.dom.iterable-3be50d6c.js';
|
|
4
|
-
import { d as debounce_1, l as lib_3, a as lib_1 } from './debounce-
|
|
4
|
+
import { d as debounce_1, l as lib_3, a as lib_1, i as isObjectLike_1, _ as _baseGetTag, t as toNumber_1, b as _root, c as _freeGlobal } from './debounce-93ab8f80.js';
|
|
5
5
|
import { m as main_36, a as main_16, b as main_35 } from './main-155ec04f.js';
|
|
6
6
|
import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-eb308ede.js';
|
|
7
7
|
import './core.get-iterator-method-31c1fb1a.js';
|
|
8
8
|
import { _ as _extends$2 } from './extends-dbbe308d.js';
|
|
9
|
-
import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1 } from './inherits-
|
|
9
|
+
import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1 } from './inherits-2a854891.js';
|
|
10
10
|
import React__default, { useState, useRef, useEffect } from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import Container from 'react-bootstrap/Container';
|
|
@@ -21,13 +21,13 @@ import { i as imageUrlBuilder } from './index-3849e3fe.js';
|
|
|
21
21
|
import './index-5f9f807a.js';
|
|
22
22
|
import { h as html_decode_1, c as clean_html_1 } from './entities-7cc3bf45.js';
|
|
23
23
|
import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
|
|
24
|
-
import { _ as _JSON$stringify, a as _asyncToGenerator, r as regenerator, D as DFPAdSlot, B as Beam } from './AdSlot-
|
|
25
|
-
export { D as AdSlot, B as Beam } from './AdSlot-
|
|
26
|
-
import './promise-
|
|
27
|
-
import './ADInfeed-
|
|
24
|
+
import { _ as _JSON$stringify, a as _asyncToGenerator, r as regenerator, D as DFPAdSlot, B as Beam } from './AdSlot-cc6a4f74.js';
|
|
25
|
+
export { D as AdSlot, B as Beam } from './AdSlot-cc6a4f74.js';
|
|
26
|
+
import './promise-e3480f1c.js';
|
|
27
|
+
import './ADInfeed-fd816c1f.js';
|
|
28
28
|
export { default as DeckContent } from './DeckContent.js';
|
|
29
|
-
import './get-
|
|
30
|
-
export { A as AD, G as GridContent } from './GridContent-
|
|
29
|
+
import { i as isFunction_1, a as isArray_1, _ as _arrayMap } from './get-9c285a85.js';
|
|
30
|
+
export { A as AD, G as GridContent } from './GridContent-2e9e7528.js';
|
|
31
31
|
export { default as DeckQueue } from './DeckQueue.js';
|
|
32
32
|
import 'react-bootstrap/Media';
|
|
33
33
|
export { default as ThumbnailCard } from './ThumbnailCard.js';
|
|
@@ -49,8 +49,8 @@ export { default as IssueDeck } from './IssueDeck.js';
|
|
|
49
49
|
import 'react-bootstrap/Badge';
|
|
50
50
|
export { default as IssueContentDeck } from './IssueContentDeck.js';
|
|
51
51
|
import Spinner from 'react-bootstrap/Spinner';
|
|
52
|
-
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-
|
|
53
|
-
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-
|
|
52
|
+
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-6a056c0d.js';
|
|
53
|
+
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-6a056c0d.js';
|
|
54
54
|
import 'react-bootstrap/ListGroup';
|
|
55
55
|
import Head from 'next/head';
|
|
56
56
|
import Accordion from 'react-bootstrap/Accordion';
|
|
@@ -15135,81 +15135,854 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
|
|
|
15135
15135
|
);
|
|
15136
15136
|
};
|
|
15137
15137
|
|
|
15138
|
-
|
|
15139
|
-
|
|
15138
|
+
/**
|
|
15139
|
+
* The base implementation of `_.findIndex` and `_.findLastIndex` without
|
|
15140
|
+
* support for iteratee shorthands.
|
|
15141
|
+
*
|
|
15142
|
+
* @private
|
|
15143
|
+
* @param {Array} array The array to inspect.
|
|
15144
|
+
* @param {Function} predicate The function invoked per iteration.
|
|
15145
|
+
* @param {number} fromIndex The index to search from.
|
|
15146
|
+
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
15147
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
15148
|
+
*/
|
|
15149
|
+
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
15150
|
+
var length = array.length,
|
|
15151
|
+
index = fromIndex + (fromRight ? 1 : -1);
|
|
15140
15152
|
|
|
15141
|
-
|
|
15142
|
-
|
|
15153
|
+
while ((fromRight ? index-- : ++index < length)) {
|
|
15154
|
+
if (predicate(array[index], index, array)) {
|
|
15155
|
+
return index;
|
|
15156
|
+
}
|
|
15157
|
+
}
|
|
15158
|
+
return -1;
|
|
15159
|
+
}
|
|
15143
15160
|
|
|
15144
|
-
|
|
15161
|
+
var _baseFindIndex = baseFindIndex;
|
|
15145
15162
|
|
|
15146
|
-
|
|
15147
|
-
|
|
15163
|
+
/**
|
|
15164
|
+
* The base implementation of `_.isNaN` without support for number objects.
|
|
15165
|
+
*
|
|
15166
|
+
* @private
|
|
15167
|
+
* @param {*} value The value to check.
|
|
15168
|
+
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
|
15169
|
+
*/
|
|
15170
|
+
function baseIsNaN(value) {
|
|
15171
|
+
return value !== value;
|
|
15172
|
+
}
|
|
15148
15173
|
|
|
15149
|
-
|
|
15150
|
-
if (visible != _this.visible) {
|
|
15151
|
-
_this.visible = visible;
|
|
15152
|
-
_this.props.onChange(visible);
|
|
15153
|
-
}
|
|
15154
|
-
};
|
|
15174
|
+
var _baseIsNaN = baseIsNaN;
|
|
15155
15175
|
|
|
15156
|
-
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
} else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
|
|
15170
|
-
return 'top';
|
|
15171
|
-
} else if (bottom <= viewHeight) {
|
|
15172
|
-
return 'bottom';
|
|
15173
|
-
} else {
|
|
15174
|
-
return false;
|
|
15175
|
-
}
|
|
15176
|
-
};
|
|
15176
|
+
/**
|
|
15177
|
+
* A specialized version of `_.indexOf` which performs strict equality
|
|
15178
|
+
* comparisons of values, i.e. `===`.
|
|
15179
|
+
*
|
|
15180
|
+
* @private
|
|
15181
|
+
* @param {Array} array The array to inspect.
|
|
15182
|
+
* @param {*} value The value to search for.
|
|
15183
|
+
* @param {number} fromIndex The index to search from.
|
|
15184
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
15185
|
+
*/
|
|
15186
|
+
function strictIndexOf(array, value, fromIndex) {
|
|
15187
|
+
var index = fromIndex - 1,
|
|
15188
|
+
length = array.length;
|
|
15177
15189
|
|
|
15178
|
-
|
|
15179
|
-
|
|
15180
|
-
|
|
15190
|
+
while (++index < length) {
|
|
15191
|
+
if (array[index] === value) {
|
|
15192
|
+
return index;
|
|
15181
15193
|
}
|
|
15194
|
+
}
|
|
15195
|
+
return -1;
|
|
15196
|
+
}
|
|
15182
15197
|
|
|
15183
|
-
|
|
15184
|
-
key: 'componentDidMount',
|
|
15185
|
-
value: function componentDidMount() {
|
|
15186
|
-
this.visible = this.checkInside();
|
|
15187
|
-
this.props.onChange(this.visible);
|
|
15188
|
-
window.addEventListener('scroll', this.scrollHandler);
|
|
15189
|
-
}
|
|
15190
|
-
}, {
|
|
15191
|
-
key: 'componentWillUnmount',
|
|
15192
|
-
value: function componentWillUnmount() {
|
|
15193
|
-
window.removeEventListener('scroll', this.scrollHandler);
|
|
15194
|
-
}
|
|
15195
|
-
}, {
|
|
15196
|
-
key: 'render',
|
|
15197
|
-
value: function render() {
|
|
15198
|
-
var _props = this.props,
|
|
15199
|
-
_props$className = _props.className,
|
|
15200
|
-
className = _props$className === undefined ? '' : _props$className,
|
|
15201
|
-
_props$style = _props.style,
|
|
15202
|
-
style = _props$style === undefined ? {} : _props$style;
|
|
15198
|
+
var _strictIndexOf = strictIndexOf;
|
|
15203
15199
|
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
|
|
15200
|
+
/**
|
|
15201
|
+
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
|
15202
|
+
*
|
|
15203
|
+
* @private
|
|
15204
|
+
* @param {Array} array The array to inspect.
|
|
15205
|
+
* @param {*} value The value to search for.
|
|
15206
|
+
* @param {number} fromIndex The index to search from.
|
|
15207
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
15208
|
+
*/
|
|
15209
|
+
function baseIndexOf(array, value, fromIndex) {
|
|
15210
|
+
return value === value
|
|
15211
|
+
? _strictIndexOf(array, value, fromIndex)
|
|
15212
|
+
: _baseFindIndex(array, _baseIsNaN, fromIndex);
|
|
15213
|
+
}
|
|
15214
|
+
|
|
15215
|
+
var _baseIndexOf = baseIndexOf;
|
|
15216
|
+
|
|
15217
|
+
/** Used as references for various `Number` constants. */
|
|
15218
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
15219
|
+
|
|
15220
|
+
/**
|
|
15221
|
+
* Checks if `value` is a valid array-like length.
|
|
15222
|
+
*
|
|
15223
|
+
* **Note:** This method is loosely based on
|
|
15224
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
15225
|
+
*
|
|
15226
|
+
* @static
|
|
15227
|
+
* @memberOf _
|
|
15228
|
+
* @since 4.0.0
|
|
15229
|
+
* @category Lang
|
|
15230
|
+
* @param {*} value The value to check.
|
|
15231
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
15232
|
+
* @example
|
|
15233
|
+
*
|
|
15234
|
+
* _.isLength(3);
|
|
15235
|
+
* // => true
|
|
15236
|
+
*
|
|
15237
|
+
* _.isLength(Number.MIN_VALUE);
|
|
15238
|
+
* // => false
|
|
15239
|
+
*
|
|
15240
|
+
* _.isLength(Infinity);
|
|
15241
|
+
* // => false
|
|
15242
|
+
*
|
|
15243
|
+
* _.isLength('3');
|
|
15244
|
+
* // => false
|
|
15245
|
+
*/
|
|
15246
|
+
function isLength(value) {
|
|
15247
|
+
return typeof value == 'number' &&
|
|
15248
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
15249
|
+
}
|
|
15250
|
+
|
|
15251
|
+
var isLength_1 = isLength;
|
|
15252
|
+
|
|
15253
|
+
/**
|
|
15254
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
15255
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
15256
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
15257
|
+
*
|
|
15258
|
+
* @static
|
|
15259
|
+
* @memberOf _
|
|
15260
|
+
* @since 4.0.0
|
|
15261
|
+
* @category Lang
|
|
15262
|
+
* @param {*} value The value to check.
|
|
15263
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
15264
|
+
* @example
|
|
15265
|
+
*
|
|
15266
|
+
* _.isArrayLike([1, 2, 3]);
|
|
15267
|
+
* // => true
|
|
15268
|
+
*
|
|
15269
|
+
* _.isArrayLike(document.body.children);
|
|
15270
|
+
* // => true
|
|
15271
|
+
*
|
|
15272
|
+
* _.isArrayLike('abc');
|
|
15273
|
+
* // => true
|
|
15274
|
+
*
|
|
15275
|
+
* _.isArrayLike(_.noop);
|
|
15276
|
+
* // => false
|
|
15277
|
+
*/
|
|
15278
|
+
function isArrayLike(value) {
|
|
15279
|
+
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
15280
|
+
}
|
|
15281
|
+
|
|
15282
|
+
var isArrayLike_1 = isArrayLike;
|
|
15283
|
+
|
|
15284
|
+
/** `Object#toString` result references. */
|
|
15285
|
+
var stringTag = '[object String]';
|
|
15286
|
+
|
|
15287
|
+
/**
|
|
15288
|
+
* Checks if `value` is classified as a `String` primitive or object.
|
|
15289
|
+
*
|
|
15290
|
+
* @static
|
|
15291
|
+
* @since 0.1.0
|
|
15292
|
+
* @memberOf _
|
|
15293
|
+
* @category Lang
|
|
15294
|
+
* @param {*} value The value to check.
|
|
15295
|
+
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
|
|
15296
|
+
* @example
|
|
15297
|
+
*
|
|
15298
|
+
* _.isString('abc');
|
|
15299
|
+
* // => true
|
|
15300
|
+
*
|
|
15301
|
+
* _.isString(1);
|
|
15302
|
+
* // => false
|
|
15303
|
+
*/
|
|
15304
|
+
function isString$1(value) {
|
|
15305
|
+
return typeof value == 'string' ||
|
|
15306
|
+
(!isArray_1(value) && isObjectLike_1(value) && _baseGetTag(value) == stringTag);
|
|
15307
|
+
}
|
|
15308
|
+
|
|
15309
|
+
var isString_1 = isString$1;
|
|
15310
|
+
|
|
15311
|
+
/** Used as references for various `Number` constants. */
|
|
15312
|
+
var INFINITY = 1 / 0,
|
|
15313
|
+
MAX_INTEGER = 1.7976931348623157e+308;
|
|
15314
|
+
|
|
15315
|
+
/**
|
|
15316
|
+
* Converts `value` to a finite number.
|
|
15317
|
+
*
|
|
15318
|
+
* @static
|
|
15319
|
+
* @memberOf _
|
|
15320
|
+
* @since 4.12.0
|
|
15321
|
+
* @category Lang
|
|
15322
|
+
* @param {*} value The value to convert.
|
|
15323
|
+
* @returns {number} Returns the converted number.
|
|
15324
|
+
* @example
|
|
15325
|
+
*
|
|
15326
|
+
* _.toFinite(3.2);
|
|
15327
|
+
* // => 3.2
|
|
15328
|
+
*
|
|
15329
|
+
* _.toFinite(Number.MIN_VALUE);
|
|
15330
|
+
* // => 5e-324
|
|
15331
|
+
*
|
|
15332
|
+
* _.toFinite(Infinity);
|
|
15333
|
+
* // => 1.7976931348623157e+308
|
|
15334
|
+
*
|
|
15335
|
+
* _.toFinite('3.2');
|
|
15336
|
+
* // => 3.2
|
|
15337
|
+
*/
|
|
15338
|
+
function toFinite(value) {
|
|
15339
|
+
if (!value) {
|
|
15340
|
+
return value === 0 ? value : 0;
|
|
15341
|
+
}
|
|
15342
|
+
value = toNumber_1(value);
|
|
15343
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
15344
|
+
var sign = (value < 0 ? -1 : 1);
|
|
15345
|
+
return sign * MAX_INTEGER;
|
|
15346
|
+
}
|
|
15347
|
+
return value === value ? value : 0;
|
|
15348
|
+
}
|
|
15349
|
+
|
|
15350
|
+
var toFinite_1 = toFinite;
|
|
15351
|
+
|
|
15352
|
+
/**
|
|
15353
|
+
* Converts `value` to an integer.
|
|
15354
|
+
*
|
|
15355
|
+
* **Note:** This method is loosely based on
|
|
15356
|
+
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
|
|
15357
|
+
*
|
|
15358
|
+
* @static
|
|
15359
|
+
* @memberOf _
|
|
15360
|
+
* @since 4.0.0
|
|
15361
|
+
* @category Lang
|
|
15362
|
+
* @param {*} value The value to convert.
|
|
15363
|
+
* @returns {number} Returns the converted integer.
|
|
15364
|
+
* @example
|
|
15365
|
+
*
|
|
15366
|
+
* _.toInteger(3.2);
|
|
15367
|
+
* // => 3
|
|
15368
|
+
*
|
|
15369
|
+
* _.toInteger(Number.MIN_VALUE);
|
|
15370
|
+
* // => 0
|
|
15371
|
+
*
|
|
15372
|
+
* _.toInteger(Infinity);
|
|
15373
|
+
* // => 1.7976931348623157e+308
|
|
15374
|
+
*
|
|
15375
|
+
* _.toInteger('3.2');
|
|
15376
|
+
* // => 3
|
|
15377
|
+
*/
|
|
15378
|
+
function toInteger(value) {
|
|
15379
|
+
var result = toFinite_1(value),
|
|
15380
|
+
remainder = result % 1;
|
|
15381
|
+
|
|
15382
|
+
return result === result ? (remainder ? result - remainder : result) : 0;
|
|
15383
|
+
}
|
|
15384
|
+
|
|
15385
|
+
var toInteger_1 = toInteger;
|
|
15386
|
+
|
|
15387
|
+
/**
|
|
15388
|
+
* The base implementation of `_.values` and `_.valuesIn` which creates an
|
|
15389
|
+
* array of `object` property values corresponding to the property names
|
|
15390
|
+
* of `props`.
|
|
15391
|
+
*
|
|
15392
|
+
* @private
|
|
15393
|
+
* @param {Object} object The object to query.
|
|
15394
|
+
* @param {Array} props The property names to get values for.
|
|
15395
|
+
* @returns {Object} Returns the array of property values.
|
|
15396
|
+
*/
|
|
15397
|
+
function baseValues(object, props) {
|
|
15398
|
+
return _arrayMap(props, function(key) {
|
|
15399
|
+
return object[key];
|
|
15400
|
+
});
|
|
15401
|
+
}
|
|
15402
|
+
|
|
15403
|
+
var _baseValues = baseValues;
|
|
15404
|
+
|
|
15405
|
+
/**
|
|
15406
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
|
15407
|
+
* or max array length checks.
|
|
15408
|
+
*
|
|
15409
|
+
* @private
|
|
15410
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
|
15411
|
+
* @param {Function} iteratee The function invoked per iteration.
|
|
15412
|
+
* @returns {Array} Returns the array of results.
|
|
15413
|
+
*/
|
|
15414
|
+
function baseTimes(n, iteratee) {
|
|
15415
|
+
var index = -1,
|
|
15416
|
+
result = Array(n);
|
|
15417
|
+
|
|
15418
|
+
while (++index < n) {
|
|
15419
|
+
result[index] = iteratee(index);
|
|
15420
|
+
}
|
|
15421
|
+
return result;
|
|
15422
|
+
}
|
|
15423
|
+
|
|
15424
|
+
var _baseTimes = baseTimes;
|
|
15425
|
+
|
|
15426
|
+
/** `Object#toString` result references. */
|
|
15427
|
+
var argsTag = '[object Arguments]';
|
|
15428
|
+
|
|
15429
|
+
/**
|
|
15430
|
+
* The base implementation of `_.isArguments`.
|
|
15431
|
+
*
|
|
15432
|
+
* @private
|
|
15433
|
+
* @param {*} value The value to check.
|
|
15434
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
15435
|
+
*/
|
|
15436
|
+
function baseIsArguments(value) {
|
|
15437
|
+
return isObjectLike_1(value) && _baseGetTag(value) == argsTag;
|
|
15438
|
+
}
|
|
15439
|
+
|
|
15440
|
+
var _baseIsArguments = baseIsArguments;
|
|
15441
|
+
|
|
15442
|
+
/** Used for built-in method references. */
|
|
15443
|
+
var objectProto = Object.prototype;
|
|
15444
|
+
|
|
15445
|
+
/** Used to check objects for own properties. */
|
|
15446
|
+
var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
|
15447
|
+
|
|
15448
|
+
/** Built-in value references. */
|
|
15449
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
15211
15450
|
|
|
15212
|
-
|
|
15451
|
+
/**
|
|
15452
|
+
* Checks if `value` is likely an `arguments` object.
|
|
15453
|
+
*
|
|
15454
|
+
* @static
|
|
15455
|
+
* @memberOf _
|
|
15456
|
+
* @since 0.1.0
|
|
15457
|
+
* @category Lang
|
|
15458
|
+
* @param {*} value The value to check.
|
|
15459
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
15460
|
+
* else `false`.
|
|
15461
|
+
* @example
|
|
15462
|
+
*
|
|
15463
|
+
* _.isArguments(function() { return arguments; }());
|
|
15464
|
+
* // => true
|
|
15465
|
+
*
|
|
15466
|
+
* _.isArguments([1, 2, 3]);
|
|
15467
|
+
* // => false
|
|
15468
|
+
*/
|
|
15469
|
+
var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
|
15470
|
+
return isObjectLike_1(value) && hasOwnProperty$1.call(value, 'callee') &&
|
|
15471
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
15472
|
+
};
|
|
15473
|
+
|
|
15474
|
+
var isArguments_1 = isArguments;
|
|
15475
|
+
|
|
15476
|
+
/**
|
|
15477
|
+
* This method returns `false`.
|
|
15478
|
+
*
|
|
15479
|
+
* @static
|
|
15480
|
+
* @memberOf _
|
|
15481
|
+
* @since 4.13.0
|
|
15482
|
+
* @category Util
|
|
15483
|
+
* @returns {boolean} Returns `false`.
|
|
15484
|
+
* @example
|
|
15485
|
+
*
|
|
15486
|
+
* _.times(2, _.stubFalse);
|
|
15487
|
+
* // => [false, false]
|
|
15488
|
+
*/
|
|
15489
|
+
function stubFalse() {
|
|
15490
|
+
return false;
|
|
15491
|
+
}
|
|
15492
|
+
|
|
15493
|
+
var stubFalse_1 = stubFalse;
|
|
15494
|
+
|
|
15495
|
+
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
15496
|
+
/** Detect free variable `exports`. */
|
|
15497
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
15498
|
+
|
|
15499
|
+
/** Detect free variable `module`. */
|
|
15500
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
15501
|
+
|
|
15502
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
15503
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
15504
|
+
|
|
15505
|
+
/** Built-in value references. */
|
|
15506
|
+
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
15507
|
+
|
|
15508
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
15509
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
15510
|
+
|
|
15511
|
+
/**
|
|
15512
|
+
* Checks if `value` is a buffer.
|
|
15513
|
+
*
|
|
15514
|
+
* @static
|
|
15515
|
+
* @memberOf _
|
|
15516
|
+
* @since 4.3.0
|
|
15517
|
+
* @category Lang
|
|
15518
|
+
* @param {*} value The value to check.
|
|
15519
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
15520
|
+
* @example
|
|
15521
|
+
*
|
|
15522
|
+
* _.isBuffer(new Buffer(2));
|
|
15523
|
+
* // => true
|
|
15524
|
+
*
|
|
15525
|
+
* _.isBuffer(new Uint8Array(2));
|
|
15526
|
+
* // => false
|
|
15527
|
+
*/
|
|
15528
|
+
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
15529
|
+
|
|
15530
|
+
module.exports = isBuffer;
|
|
15531
|
+
});
|
|
15532
|
+
|
|
15533
|
+
/** Used as references for various `Number` constants. */
|
|
15534
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
15535
|
+
|
|
15536
|
+
/** Used to detect unsigned integer values. */
|
|
15537
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
15538
|
+
|
|
15539
|
+
/**
|
|
15540
|
+
* Checks if `value` is a valid array-like index.
|
|
15541
|
+
*
|
|
15542
|
+
* @private
|
|
15543
|
+
* @param {*} value The value to check.
|
|
15544
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
15545
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
15546
|
+
*/
|
|
15547
|
+
function isIndex(value, length) {
|
|
15548
|
+
var type = typeof value;
|
|
15549
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
15550
|
+
|
|
15551
|
+
return !!length &&
|
|
15552
|
+
(type == 'number' ||
|
|
15553
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
|
15554
|
+
(value > -1 && value % 1 == 0 && value < length);
|
|
15555
|
+
}
|
|
15556
|
+
|
|
15557
|
+
var _isIndex = isIndex;
|
|
15558
|
+
|
|
15559
|
+
/** `Object#toString` result references. */
|
|
15560
|
+
var argsTag$1 = '[object Arguments]',
|
|
15561
|
+
arrayTag = '[object Array]',
|
|
15562
|
+
boolTag = '[object Boolean]',
|
|
15563
|
+
dateTag = '[object Date]',
|
|
15564
|
+
errorTag = '[object Error]',
|
|
15565
|
+
funcTag = '[object Function]',
|
|
15566
|
+
mapTag = '[object Map]',
|
|
15567
|
+
numberTag = '[object Number]',
|
|
15568
|
+
objectTag = '[object Object]',
|
|
15569
|
+
regexpTag = '[object RegExp]',
|
|
15570
|
+
setTag = '[object Set]',
|
|
15571
|
+
stringTag$1 = '[object String]',
|
|
15572
|
+
weakMapTag = '[object WeakMap]';
|
|
15573
|
+
|
|
15574
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
15575
|
+
dataViewTag = '[object DataView]',
|
|
15576
|
+
float32Tag = '[object Float32Array]',
|
|
15577
|
+
float64Tag = '[object Float64Array]',
|
|
15578
|
+
int8Tag = '[object Int8Array]',
|
|
15579
|
+
int16Tag = '[object Int16Array]',
|
|
15580
|
+
int32Tag = '[object Int32Array]',
|
|
15581
|
+
uint8Tag = '[object Uint8Array]',
|
|
15582
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
15583
|
+
uint16Tag = '[object Uint16Array]',
|
|
15584
|
+
uint32Tag = '[object Uint32Array]';
|
|
15585
|
+
|
|
15586
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
15587
|
+
var typedArrayTags = {};
|
|
15588
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
15589
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
15590
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
15591
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
15592
|
+
typedArrayTags[uint32Tag] = true;
|
|
15593
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =
|
|
15594
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
15595
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
15596
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
15597
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
15598
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
15599
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag$1] =
|
|
15600
|
+
typedArrayTags[weakMapTag] = false;
|
|
15601
|
+
|
|
15602
|
+
/**
|
|
15603
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
15604
|
+
*
|
|
15605
|
+
* @private
|
|
15606
|
+
* @param {*} value The value to check.
|
|
15607
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
15608
|
+
*/
|
|
15609
|
+
function baseIsTypedArray(value) {
|
|
15610
|
+
return isObjectLike_1(value) &&
|
|
15611
|
+
isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
15612
|
+
}
|
|
15613
|
+
|
|
15614
|
+
var _baseIsTypedArray = baseIsTypedArray;
|
|
15615
|
+
|
|
15616
|
+
/**
|
|
15617
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
15618
|
+
*
|
|
15619
|
+
* @private
|
|
15620
|
+
* @param {Function} func The function to cap arguments for.
|
|
15621
|
+
* @returns {Function} Returns the new capped function.
|
|
15622
|
+
*/
|
|
15623
|
+
function baseUnary(func) {
|
|
15624
|
+
return function(value) {
|
|
15625
|
+
return func(value);
|
|
15626
|
+
};
|
|
15627
|
+
}
|
|
15628
|
+
|
|
15629
|
+
var _baseUnary = baseUnary;
|
|
15630
|
+
|
|
15631
|
+
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
15632
|
+
/** Detect free variable `exports`. */
|
|
15633
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
15634
|
+
|
|
15635
|
+
/** Detect free variable `module`. */
|
|
15636
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
15637
|
+
|
|
15638
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
15639
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
15640
|
+
|
|
15641
|
+
/** Detect free variable `process` from Node.js. */
|
|
15642
|
+
var freeProcess = moduleExports && _freeGlobal.process;
|
|
15643
|
+
|
|
15644
|
+
/** Used to access faster Node.js helpers. */
|
|
15645
|
+
var nodeUtil = (function() {
|
|
15646
|
+
try {
|
|
15647
|
+
// Use `util.types` for Node.js 10+.
|
|
15648
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
15649
|
+
|
|
15650
|
+
if (types) {
|
|
15651
|
+
return types;
|
|
15652
|
+
}
|
|
15653
|
+
|
|
15654
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
15655
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
15656
|
+
} catch (e) {}
|
|
15657
|
+
}());
|
|
15658
|
+
|
|
15659
|
+
module.exports = nodeUtil;
|
|
15660
|
+
});
|
|
15661
|
+
|
|
15662
|
+
/* Node.js helper references. */
|
|
15663
|
+
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
15664
|
+
|
|
15665
|
+
/**
|
|
15666
|
+
* Checks if `value` is classified as a typed array.
|
|
15667
|
+
*
|
|
15668
|
+
* @static
|
|
15669
|
+
* @memberOf _
|
|
15670
|
+
* @since 3.0.0
|
|
15671
|
+
* @category Lang
|
|
15672
|
+
* @param {*} value The value to check.
|
|
15673
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
15674
|
+
* @example
|
|
15675
|
+
*
|
|
15676
|
+
* _.isTypedArray(new Uint8Array);
|
|
15677
|
+
* // => true
|
|
15678
|
+
*
|
|
15679
|
+
* _.isTypedArray([]);
|
|
15680
|
+
* // => false
|
|
15681
|
+
*/
|
|
15682
|
+
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
15683
|
+
|
|
15684
|
+
var isTypedArray_1 = isTypedArray;
|
|
15685
|
+
|
|
15686
|
+
/** Used for built-in method references. */
|
|
15687
|
+
var objectProto$1 = Object.prototype;
|
|
15688
|
+
|
|
15689
|
+
/** Used to check objects for own properties. */
|
|
15690
|
+
var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
|
|
15691
|
+
|
|
15692
|
+
/**
|
|
15693
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
|
15694
|
+
*
|
|
15695
|
+
* @private
|
|
15696
|
+
* @param {*} value The value to query.
|
|
15697
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
|
15698
|
+
* @returns {Array} Returns the array of property names.
|
|
15699
|
+
*/
|
|
15700
|
+
function arrayLikeKeys(value, inherited) {
|
|
15701
|
+
var isArr = isArray_1(value),
|
|
15702
|
+
isArg = !isArr && isArguments_1(value),
|
|
15703
|
+
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
15704
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
15705
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
|
15706
|
+
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
15707
|
+
length = result.length;
|
|
15708
|
+
|
|
15709
|
+
for (var key in value) {
|
|
15710
|
+
if ((inherited || hasOwnProperty$2.call(value, key)) &&
|
|
15711
|
+
!(skipIndexes && (
|
|
15712
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
15713
|
+
key == 'length' ||
|
|
15714
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
15715
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
15716
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
15717
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
15718
|
+
// Skip index properties.
|
|
15719
|
+
_isIndex(key, length)
|
|
15720
|
+
))) {
|
|
15721
|
+
result.push(key);
|
|
15722
|
+
}
|
|
15723
|
+
}
|
|
15724
|
+
return result;
|
|
15725
|
+
}
|
|
15726
|
+
|
|
15727
|
+
var _arrayLikeKeys = arrayLikeKeys;
|
|
15728
|
+
|
|
15729
|
+
/** Used for built-in method references. */
|
|
15730
|
+
var objectProto$2 = Object.prototype;
|
|
15731
|
+
|
|
15732
|
+
/**
|
|
15733
|
+
* Checks if `value` is likely a prototype object.
|
|
15734
|
+
*
|
|
15735
|
+
* @private
|
|
15736
|
+
* @param {*} value The value to check.
|
|
15737
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
15738
|
+
*/
|
|
15739
|
+
function isPrototype(value) {
|
|
15740
|
+
var Ctor = value && value.constructor,
|
|
15741
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$2;
|
|
15742
|
+
|
|
15743
|
+
return value === proto;
|
|
15744
|
+
}
|
|
15745
|
+
|
|
15746
|
+
var _isPrototype = isPrototype;
|
|
15747
|
+
|
|
15748
|
+
/**
|
|
15749
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
15750
|
+
*
|
|
15751
|
+
* @private
|
|
15752
|
+
* @param {Function} func The function to wrap.
|
|
15753
|
+
* @param {Function} transform The argument transform.
|
|
15754
|
+
* @returns {Function} Returns the new function.
|
|
15755
|
+
*/
|
|
15756
|
+
function overArg(func, transform) {
|
|
15757
|
+
return function(arg) {
|
|
15758
|
+
return func(transform(arg));
|
|
15759
|
+
};
|
|
15760
|
+
}
|
|
15761
|
+
|
|
15762
|
+
var _overArg = overArg;
|
|
15763
|
+
|
|
15764
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
15765
|
+
var nativeKeys = _overArg(Object.keys, Object);
|
|
15766
|
+
|
|
15767
|
+
var _nativeKeys = nativeKeys;
|
|
15768
|
+
|
|
15769
|
+
/** Used for built-in method references. */
|
|
15770
|
+
var objectProto$3 = Object.prototype;
|
|
15771
|
+
|
|
15772
|
+
/** Used to check objects for own properties. */
|
|
15773
|
+
var hasOwnProperty$3 = objectProto$3.hasOwnProperty;
|
|
15774
|
+
|
|
15775
|
+
/**
|
|
15776
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
15777
|
+
*
|
|
15778
|
+
* @private
|
|
15779
|
+
* @param {Object} object The object to query.
|
|
15780
|
+
* @returns {Array} Returns the array of property names.
|
|
15781
|
+
*/
|
|
15782
|
+
function baseKeys(object) {
|
|
15783
|
+
if (!_isPrototype(object)) {
|
|
15784
|
+
return _nativeKeys(object);
|
|
15785
|
+
}
|
|
15786
|
+
var result = [];
|
|
15787
|
+
for (var key in Object(object)) {
|
|
15788
|
+
if (hasOwnProperty$3.call(object, key) && key != 'constructor') {
|
|
15789
|
+
result.push(key);
|
|
15790
|
+
}
|
|
15791
|
+
}
|
|
15792
|
+
return result;
|
|
15793
|
+
}
|
|
15794
|
+
|
|
15795
|
+
var _baseKeys = baseKeys;
|
|
15796
|
+
|
|
15797
|
+
/**
|
|
15798
|
+
* Creates an array of the own enumerable property names of `object`.
|
|
15799
|
+
*
|
|
15800
|
+
* **Note:** Non-object values are coerced to objects. See the
|
|
15801
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
15802
|
+
* for more details.
|
|
15803
|
+
*
|
|
15804
|
+
* @static
|
|
15805
|
+
* @since 0.1.0
|
|
15806
|
+
* @memberOf _
|
|
15807
|
+
* @category Object
|
|
15808
|
+
* @param {Object} object The object to query.
|
|
15809
|
+
* @returns {Array} Returns the array of property names.
|
|
15810
|
+
* @example
|
|
15811
|
+
*
|
|
15812
|
+
* function Foo() {
|
|
15813
|
+
* this.a = 1;
|
|
15814
|
+
* this.b = 2;
|
|
15815
|
+
* }
|
|
15816
|
+
*
|
|
15817
|
+
* Foo.prototype.c = 3;
|
|
15818
|
+
*
|
|
15819
|
+
* _.keys(new Foo);
|
|
15820
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
15821
|
+
*
|
|
15822
|
+
* _.keys('hi');
|
|
15823
|
+
* // => ['0', '1']
|
|
15824
|
+
*/
|
|
15825
|
+
function keys$2(object) {
|
|
15826
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
|
15827
|
+
}
|
|
15828
|
+
|
|
15829
|
+
var keys_1 = keys$2;
|
|
15830
|
+
|
|
15831
|
+
/**
|
|
15832
|
+
* Creates an array of the own enumerable string keyed property values of `object`.
|
|
15833
|
+
*
|
|
15834
|
+
* **Note:** Non-object values are coerced to objects.
|
|
15835
|
+
*
|
|
15836
|
+
* @static
|
|
15837
|
+
* @since 0.1.0
|
|
15838
|
+
* @memberOf _
|
|
15839
|
+
* @category Object
|
|
15840
|
+
* @param {Object} object The object to query.
|
|
15841
|
+
* @returns {Array} Returns the array of property values.
|
|
15842
|
+
* @example
|
|
15843
|
+
*
|
|
15844
|
+
* function Foo() {
|
|
15845
|
+
* this.a = 1;
|
|
15846
|
+
* this.b = 2;
|
|
15847
|
+
* }
|
|
15848
|
+
*
|
|
15849
|
+
* Foo.prototype.c = 3;
|
|
15850
|
+
*
|
|
15851
|
+
* _.values(new Foo);
|
|
15852
|
+
* // => [1, 2] (iteration order is not guaranteed)
|
|
15853
|
+
*
|
|
15854
|
+
* _.values('hi');
|
|
15855
|
+
* // => ['h', 'i']
|
|
15856
|
+
*/
|
|
15857
|
+
function values(object) {
|
|
15858
|
+
return object == null ? [] : _baseValues(object, keys_1(object));
|
|
15859
|
+
}
|
|
15860
|
+
|
|
15861
|
+
var values_1 = values;
|
|
15862
|
+
|
|
15863
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
15864
|
+
var nativeMax = Math.max;
|
|
15865
|
+
|
|
15866
|
+
/**
|
|
15867
|
+
* Checks if `value` is in `collection`. If `collection` is a string, it's
|
|
15868
|
+
* checked for a substring of `value`, otherwise
|
|
15869
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
15870
|
+
* is used for equality comparisons. If `fromIndex` is negative, it's used as
|
|
15871
|
+
* the offset from the end of `collection`.
|
|
15872
|
+
*
|
|
15873
|
+
* @static
|
|
15874
|
+
* @memberOf _
|
|
15875
|
+
* @since 0.1.0
|
|
15876
|
+
* @category Collection
|
|
15877
|
+
* @param {Array|Object|string} collection The collection to inspect.
|
|
15878
|
+
* @param {*} value The value to search for.
|
|
15879
|
+
* @param {number} [fromIndex=0] The index to search from.
|
|
15880
|
+
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
|
|
15881
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
15882
|
+
* @example
|
|
15883
|
+
*
|
|
15884
|
+
* _.includes([1, 2, 3], 1);
|
|
15885
|
+
* // => true
|
|
15886
|
+
*
|
|
15887
|
+
* _.includes([1, 2, 3], 1, 2);
|
|
15888
|
+
* // => false
|
|
15889
|
+
*
|
|
15890
|
+
* _.includes({ 'a': 1, 'b': 2 }, 1);
|
|
15891
|
+
* // => true
|
|
15892
|
+
*
|
|
15893
|
+
* _.includes('abcd', 'bc');
|
|
15894
|
+
* // => true
|
|
15895
|
+
*/
|
|
15896
|
+
function includes(collection, value, fromIndex, guard) {
|
|
15897
|
+
collection = isArrayLike_1(collection) ? collection : values_1(collection);
|
|
15898
|
+
fromIndex = (fromIndex && !guard) ? toInteger_1(fromIndex) : 0;
|
|
15899
|
+
|
|
15900
|
+
var length = collection.length;
|
|
15901
|
+
if (fromIndex < 0) {
|
|
15902
|
+
fromIndex = nativeMax(length + fromIndex, 0);
|
|
15903
|
+
}
|
|
15904
|
+
return isString_1(collection)
|
|
15905
|
+
? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
|
|
15906
|
+
: (!!length && _baseIndexOf(collection, value, fromIndex) > -1);
|
|
15907
|
+
}
|
|
15908
|
+
|
|
15909
|
+
var includes_1 = includes;
|
|
15910
|
+
|
|
15911
|
+
var InscreenSensor = function (_React$Component) {
|
|
15912
|
+
_inherits$1(InscreenSensor, _React$Component);
|
|
15913
|
+
|
|
15914
|
+
function InscreenSensor(props) {
|
|
15915
|
+
_classCallCheck$1(this, InscreenSensor);
|
|
15916
|
+
|
|
15917
|
+
var _this = _possibleConstructorReturn$1(this, (InscreenSensor.__proto__ || _Object$getPrototypeOf(InscreenSensor)).call(this, props));
|
|
15918
|
+
|
|
15919
|
+
_this.scrollHandler = function () {
|
|
15920
|
+
// this.checkInside()
|
|
15921
|
+
|
|
15922
|
+
var visible = _this.checkInside();
|
|
15923
|
+
if (visible !== _this.visible) {
|
|
15924
|
+
_this.visible = visible;
|
|
15925
|
+
_this.props.onChange(visible);
|
|
15926
|
+
}
|
|
15927
|
+
};
|
|
15928
|
+
|
|
15929
|
+
_this.checkInside = function () {
|
|
15930
|
+
var rect = _this.wraperRef.current.getBoundingClientRect();
|
|
15931
|
+
var _this$props$offSetTop = _this.props.offSetTop,
|
|
15932
|
+
offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
|
|
15933
|
+
var top = rect.top,
|
|
15934
|
+
height = rect.height;
|
|
15935
|
+
|
|
15936
|
+
var bottom = top + height;
|
|
15937
|
+
var viewHeight = window.innerHeight;
|
|
15938
|
+
if (bottom < offSetTop) {
|
|
15939
|
+
return false;
|
|
15940
|
+
} else if (top > offSetTop && bottom <= viewHeight) {
|
|
15941
|
+
return true;
|
|
15942
|
+
} else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
|
|
15943
|
+
return 'top';
|
|
15944
|
+
} else if (bottom <= viewHeight) {
|
|
15945
|
+
return 'bottom';
|
|
15946
|
+
} else {
|
|
15947
|
+
return false;
|
|
15948
|
+
}
|
|
15949
|
+
};
|
|
15950
|
+
|
|
15951
|
+
_this.wraperRef = React__default.createRef();
|
|
15952
|
+
_this.visible = false;
|
|
15953
|
+
return _this;
|
|
15954
|
+
}
|
|
15955
|
+
|
|
15956
|
+
_createClass$1(InscreenSensor, [{
|
|
15957
|
+
key: 'componentDidMount',
|
|
15958
|
+
value: function componentDidMount() {
|
|
15959
|
+
this.visible = this.checkInside();
|
|
15960
|
+
this.props.onChange(this.visible);
|
|
15961
|
+
window.addEventListener('scroll', this.scrollHandler);
|
|
15962
|
+
}
|
|
15963
|
+
}, {
|
|
15964
|
+
key: 'componentWillUnmount',
|
|
15965
|
+
value: function componentWillUnmount() {
|
|
15966
|
+
window.removeEventListener('scroll', this.scrollHandler);
|
|
15967
|
+
}
|
|
15968
|
+
}, {
|
|
15969
|
+
key: 'render',
|
|
15970
|
+
value: function render() {
|
|
15971
|
+
var _props = this.props,
|
|
15972
|
+
_props$className = _props.className,
|
|
15973
|
+
className = _props$className === undefined ? '' : _props$className,
|
|
15974
|
+
_props$style = _props.style,
|
|
15975
|
+
style = _props$style === undefined ? {} : _props$style;
|
|
15976
|
+
|
|
15977
|
+
return React__default.createElement(
|
|
15978
|
+
'div',
|
|
15979
|
+
{ ref: this.wraperRef, className: className, style: style },
|
|
15980
|
+
this.props.children
|
|
15981
|
+
);
|
|
15982
|
+
}
|
|
15983
|
+
}]);
|
|
15984
|
+
|
|
15985
|
+
return InscreenSensor;
|
|
15213
15986
|
}(React__default.Component);
|
|
15214
15987
|
|
|
15215
15988
|
var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
|
|
@@ -15251,11 +16024,38 @@ var Article = function Article(props) {
|
|
|
15251
16024
|
} : _props$article$url;
|
|
15252
16025
|
var url = _props$article$url.current,
|
|
15253
16026
|
issue = _props$article.issue,
|
|
16027
|
+
regionalPages = props.regionalPages,
|
|
16028
|
+
nationalPage = props.nationalPage,
|
|
16029
|
+
ISIContent = props.ISIContent,
|
|
15254
16030
|
changeUrl = props.changeUrl,
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
-
|
|
16031
|
+
shareOptions = props.shareOptions;
|
|
16032
|
+
|
|
16033
|
+
|
|
16034
|
+
var urlFor = function urlFor(source) {
|
|
16035
|
+
return imageUrlBuilder(client).image(source);
|
|
16036
|
+
};
|
|
16037
|
+
|
|
16038
|
+
var isCutomPage = function isCutomPage(article) {
|
|
16039
|
+
var url = article.url.current;
|
|
16040
|
+
|
|
16041
|
+
if (regionalPages || nationalPage) {
|
|
16042
|
+
return regionalPages.includes(url) || nationalPage === url;
|
|
16043
|
+
} else {
|
|
16044
|
+
return false;
|
|
16045
|
+
}
|
|
16046
|
+
};
|
|
16047
|
+
|
|
16048
|
+
var renderIsiContent = function renderIsiContent(article) {
|
|
16049
|
+
var url = article.url.current;
|
|
16050
|
+
|
|
16051
|
+
if (regionalPages.includes(url)) {
|
|
16052
|
+
return React__default.createElement(ISIContent, null);
|
|
16053
|
+
} else if (nationalPage === url) {
|
|
16054
|
+
return React__default.createElement(ISIContent, { national: true });
|
|
16055
|
+
}
|
|
16056
|
+
return null;
|
|
16057
|
+
};
|
|
16058
|
+
|
|
15259
16059
|
var shareVia = shareOptions.shareVia,
|
|
15260
16060
|
shareSubject = shareOptions.shareSubject,
|
|
15261
16061
|
twitterSiteName = shareOptions.twitterSiteName,
|
|
@@ -15389,166 +16189,65 @@ var Article = function Article(props) {
|
|
|
15389
16189
|
React__default.createElement('hr', { className: 'article-seperater' })
|
|
15390
16190
|
);
|
|
15391
16191
|
};
|
|
16192
|
+
var ArticleQueue = function ArticleQueue(props) {
|
|
16193
|
+
var website = props.website,
|
|
16194
|
+
Ads = props.Ads,
|
|
16195
|
+
mainNavCache = props.mainNavCache,
|
|
16196
|
+
subNavCache = props.subNavCache,
|
|
16197
|
+
isLiveSite = props.isLiveSite,
|
|
16198
|
+
_props$sponsoredTaxon = props.sponsoredTaxonomies,
|
|
16199
|
+
sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon;
|
|
15392
16200
|
|
|
15393
|
-
var
|
|
15394
|
-
|
|
15395
|
-
|
|
15396
|
-
|
|
15397
|
-
_classCallCheck$1(this, ArticleQueue);
|
|
15398
|
-
|
|
15399
|
-
var _this = _possibleConstructorReturn$1(this, (ArticleQueue.__proto__ || _Object$getPrototypeOf(ArticleQueue)).call(this, props));
|
|
15400
|
-
|
|
15401
|
-
_initialiseProps.call(_this);
|
|
15402
|
-
|
|
15403
|
-
var _this$props$article = _this.props.article,
|
|
15404
|
-
summary = _this$props$article.summary,
|
|
15405
|
-
_this$props$article$s = _this$props$article.seo;
|
|
15406
|
-
_this$props$article$s = _this$props$article$s === undefined ? {
|
|
15407
|
-
meta_description: null
|
|
15408
|
-
} : _this$props$article$s;
|
|
15409
|
-
var description = _this$props$article$s.meta_description;
|
|
15410
|
-
|
|
15411
|
-
var targeting = _this.getTargeting(_this.props.article);
|
|
15412
|
-
var metaDescription = description ? description : summary ? summary : _this.getFirstLine(_this.props.article);
|
|
15413
|
-
var article = _this.props.article;
|
|
15414
|
-
article.Ads = _this.props.Ads.getRightItems(targeting);
|
|
15415
|
-
|
|
15416
|
-
_this.state = {
|
|
15417
|
-
config: {
|
|
15418
|
-
navComponent: _this.props.website.navigation,
|
|
15419
|
-
navItems: _this.props.mainNavCache,
|
|
15420
|
-
columns: '3',
|
|
15421
|
-
leftItems: _this.props.subNavCache,
|
|
15422
|
-
rightItems: _this.props.Ads.getRightItems(targeting),
|
|
15423
|
-
horizontalAD: _this.props.Ads.getHorizontal(targeting),
|
|
15424
|
-
isLiveSite: _this.props.isLiveSite
|
|
15425
|
-
},
|
|
15426
|
-
title: _this.props.article.title,
|
|
15427
|
-
summary: metaDescription,
|
|
15428
|
-
queueData: [article],
|
|
15429
|
-
keywords: [],
|
|
15430
|
-
maxListLength: 10,
|
|
15431
|
-
loading: false
|
|
15432
|
-
}, _this.preVscroll = 0;
|
|
15433
|
-
_this.isScrollDown = true;
|
|
15434
|
-
|
|
15435
|
-
return _this;
|
|
15436
|
-
}
|
|
15437
|
-
|
|
15438
|
-
_createClass$1(ArticleQueue, [{
|
|
15439
|
-
key: 'componentDidMount',
|
|
15440
|
-
value: function componentDidMount() {
|
|
15441
|
-
window.addEventListener('scroll', this.scrollDirectionDetect);
|
|
15442
|
-
}
|
|
15443
|
-
}, {
|
|
15444
|
-
key: 'componentWillUnmount',
|
|
15445
|
-
value: function componentWillUnmount() {
|
|
15446
|
-
window.removeEventListener('scroll', this.scrollDirectionDetect);
|
|
15447
|
-
}
|
|
15448
|
-
// To return the 1st Line of text in the article body
|
|
15449
|
-
|
|
15450
|
-
}, {
|
|
15451
|
-
key: 'render',
|
|
15452
|
-
value: function render() {
|
|
15453
|
-
var _this2 = this;
|
|
15454
|
-
|
|
15455
|
-
var _state = this.state,
|
|
15456
|
-
config = _state.config,
|
|
15457
|
-
queueData = _state.queueData,
|
|
15458
|
-
title = _state.title,
|
|
15459
|
-
summary = _state.summary,
|
|
15460
|
-
_state$keywords = _state.keywords,
|
|
15461
|
-
keywords = _state$keywords === undefined ? [] : _state$keywords;
|
|
15462
|
-
var _props = this.props,
|
|
15463
|
-
website = _props.website,
|
|
15464
|
-
shareOptions = _props.shareOptions;
|
|
15465
|
-
|
|
15466
|
-
|
|
15467
|
-
return React__default.createElement(
|
|
15468
|
-
TemplateNormal,
|
|
15469
|
-
{ config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: !main_36 },
|
|
15470
|
-
React__default.createElement(
|
|
15471
|
-
InfiniteScroll,
|
|
15472
|
-
{ dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
|
|
15473
|
-
queueData.map(function (article, index) {
|
|
15474
|
-
return React__default.createElement(Article, _extends$2({
|
|
15475
|
-
key: index,
|
|
15476
|
-
urlFor: _this2.urlFor,
|
|
15477
|
-
isCutomPage: _this2.isCutomPage,
|
|
15478
|
-
renderIsiContent: _this2.renderIsiContent
|
|
15479
|
-
}, _this2.props, {
|
|
15480
|
-
shareOptions: shareOptions,
|
|
15481
|
-
changeUrl: _this2.changeUrl,
|
|
15482
|
-
article: article
|
|
15483
|
-
}));
|
|
15484
|
-
})
|
|
15485
|
-
)
|
|
15486
|
-
);
|
|
15487
|
-
}
|
|
15488
|
-
}]);
|
|
16201
|
+
var _useState = useState(''),
|
|
16202
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16203
|
+
prevUrl = _useState2[0],
|
|
16204
|
+
setPrevUrl = _useState2[1];
|
|
15489
16205
|
|
|
15490
|
-
|
|
15491
|
-
|
|
16206
|
+
var _useState3 = useState([props.article]),
|
|
16207
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
16208
|
+
queueData = _useState4[0],
|
|
16209
|
+
setQueueData = _useState4[1];
|
|
15492
16210
|
|
|
15493
|
-
var
|
|
15494
|
-
|
|
16211
|
+
var _useState5 = useState({}),
|
|
16212
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
16213
|
+
activeArticle = _useState6[0],
|
|
16214
|
+
setActiveArticle = _useState6[1];
|
|
15495
16215
|
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
16216
|
+
var maxListLength = 10;
|
|
16217
|
+
var preVscroll = 0;
|
|
16218
|
+
var isScrollDown = true;
|
|
15499
16219
|
|
|
16220
|
+
var _activeArticle$title = activeArticle.title,
|
|
16221
|
+
title = _activeArticle$title === undefined ? '' : _activeArticle$title,
|
|
16222
|
+
_activeArticle$summar = activeArticle.summary,
|
|
16223
|
+
summary = _activeArticle$summar === undefined ? '' : _activeArticle$summar;
|
|
15500
16224
|
|
|
15501
|
-
if (_this3.preVscroll > window.scrollY) {
|
|
15502
|
-
if (!isScrollDown) {
|
|
15503
|
-
_this3.isScrollDown = true;
|
|
15504
|
-
}
|
|
15505
|
-
} else if (_this3.preVscroll < window.scrollY) {
|
|
15506
|
-
if (isScrollDown) {
|
|
15507
|
-
_this3.isScrollDown = false;
|
|
15508
|
-
}
|
|
15509
|
-
}
|
|
15510
|
-
_this3.preVscroll = window.scrollY;
|
|
15511
|
-
};
|
|
15512
16225
|
|
|
15513
|
-
|
|
16226
|
+
var getFirstLine = function getFirstLine(article) {
|
|
16227
|
+
var _article$body = article.body,
|
|
16228
|
+
body = _article$body === undefined ? [] : _article$body;
|
|
15514
16229
|
|
|
15515
|
-
var
|
|
15516
|
-
|
|
15517
|
-
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
_this3.props.client.fetch(query, params).then(function (article) {
|
|
15523
|
-
if (article && article._id) {
|
|
15524
|
-
var targeting = that.getTargeting(article);
|
|
15525
|
-
article.Ads = that.props.Ads.getRightItems(targeting);
|
|
15526
|
-
queueData.push(article);
|
|
15527
|
-
that.setState({ queueData: queueData });
|
|
16230
|
+
var desc = '';
|
|
16231
|
+
body.some(function (children) {
|
|
16232
|
+
children.children && children.children.some(function (item) {
|
|
16233
|
+
if (item.text && String(item.text).trim().length > 0 && desc == '') {
|
|
16234
|
+
console.log(String(item.text));
|
|
16235
|
+
desc = String(item.text);
|
|
16236
|
+
return true;
|
|
15528
16237
|
}
|
|
15529
16238
|
});
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
|
|
15534
|
-
|
|
15535
|
-
var _props2 = _this3.props,
|
|
15536
|
-
regionalPages = _props2.regionalPages,
|
|
15537
|
-
nationalPage = _props2.nationalPage;
|
|
15538
|
-
|
|
15539
|
-
if (regionalPages || nationalPage) {
|
|
15540
|
-
|
|
15541
|
-
return regionalPages.includes(url) || nationalPage === url;
|
|
15542
|
-
} else {
|
|
15543
|
-
return false;
|
|
15544
|
-
}
|
|
16239
|
+
if (desc !== '') {
|
|
16240
|
+
return true;
|
|
16241
|
+
}
|
|
16242
|
+
});
|
|
16243
|
+
return desc;
|
|
15545
16244
|
};
|
|
15546
16245
|
|
|
15547
|
-
|
|
15548
|
-
|
|
15549
|
-
}
|
|
16246
|
+
if (summary.length === 0) {
|
|
16247
|
+
summary = getFirstLine(activeArticle);
|
|
16248
|
+
}
|
|
15550
16249
|
|
|
15551
|
-
|
|
16250
|
+
var getTargeting = function getTargeting(article) {
|
|
15552
16251
|
var _article$internalTag = article.internalTag,
|
|
15553
16252
|
internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
|
|
15554
16253
|
_article$userDefinedT = article.userDefinedTag,
|
|
@@ -15570,34 +16269,33 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
15570
16269
|
content_placement = article.content_placement;
|
|
15571
16270
|
|
|
15572
16271
|
var context = url;
|
|
15573
|
-
var localHistory =
|
|
16272
|
+
var localHistory = props.historyCookie ? JSON.parse(props.historyCookie) : [];
|
|
15574
16273
|
if (!context && localHistory) {
|
|
15575
16274
|
context = localHistory[localHistory.length - 1];
|
|
15576
16275
|
}
|
|
15577
16276
|
context = context && context.split('?')[0];
|
|
15578
16277
|
context = context && context.split('&')[0];
|
|
15579
16278
|
var content_placement_urls = [];
|
|
16279
|
+
if (content_placement && prevUrl && prevUrl.length) {
|
|
16280
|
+
content_placement.forEach(function (item) {
|
|
16281
|
+
if (includes_1(prevUrl, item.path)) {
|
|
16282
|
+
content_placement_urls.push(item.path);
|
|
16283
|
+
}
|
|
16284
|
+
});
|
|
16285
|
+
}
|
|
16286
|
+
|
|
15580
16287
|
if (content_placement) {
|
|
15581
|
-
if (
|
|
15582
|
-
return context === item.path;
|
|
15583
|
-
})) {
|
|
15584
|
-
content_placement_urls = [context];
|
|
15585
|
-
} else if (content_placement.some(function (item) {
|
|
15586
|
-
return context === '/' + item.path;
|
|
15587
|
-
})) {
|
|
15588
|
-
content_placement_urls = [context.slice(1)];
|
|
15589
|
-
} else {
|
|
16288
|
+
if (content_placement_urls.length === 0) {
|
|
15590
16289
|
content_placement_urls = content_placement.map(function (item) {
|
|
15591
16290
|
return item.path;
|
|
15592
16291
|
});
|
|
15593
16292
|
}
|
|
16293
|
+
} else {
|
|
16294
|
+
content_placement_urls = ['/'];
|
|
15594
16295
|
}
|
|
15595
|
-
|
|
15596
|
-
content_placement_urls = [];
|
|
15597
|
-
}
|
|
15598
|
-
var keywords = [].concat(_toConsumableArray(internalTag), _toConsumableArray(userDefinedTag), _toConsumableArray(SponsorshipTag), _toConsumableArray(seoTag));
|
|
16296
|
+
var articleKeywords = [].concat(_toConsumableArray(internalTag), _toConsumableArray(userDefinedTag), _toConsumableArray(SponsorshipTag), _toConsumableArray(seoTag));
|
|
15599
16297
|
var targeting = {
|
|
15600
|
-
tags:
|
|
16298
|
+
tags: articleKeywords,
|
|
15601
16299
|
document_group: [document_group],
|
|
15602
16300
|
document_url: [url],
|
|
15603
16301
|
content_placement: content_placement_urls
|
|
@@ -15605,122 +16303,174 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
15605
16303
|
return targeting;
|
|
15606
16304
|
};
|
|
15607
16305
|
|
|
15608
|
-
|
|
16306
|
+
var _useState7 = useState(getTargeting(activeArticle)),
|
|
16307
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
16308
|
+
targeting = _useState8[0],
|
|
16309
|
+
setTargeting = _useState8[1];
|
|
16310
|
+
|
|
16311
|
+
var keywords = targeting && targeting.keywords ? targeting.keywords : [];
|
|
16312
|
+
|
|
16313
|
+
var config = {
|
|
16314
|
+
navComponent: website.navigation,
|
|
16315
|
+
navItems: mainNavCache,
|
|
16316
|
+
columns: '3',
|
|
16317
|
+
leftItems: subNavCache,
|
|
16318
|
+
rightItems: [],
|
|
16319
|
+
horizontalAD: {},
|
|
16320
|
+
isLiveSite: isLiveSite
|
|
16321
|
+
};
|
|
16322
|
+
props.article.Ads = [];
|
|
16323
|
+
|
|
16324
|
+
var _useState9 = useState(config),
|
|
16325
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
16326
|
+
pageConfig = _useState10[0],
|
|
16327
|
+
setPageConfig = _useState10[1];
|
|
16328
|
+
|
|
16329
|
+
var checkSponseredArticle = function checkSponseredArticle(article) {
|
|
15609
16330
|
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
15610
16331
|
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
15611
16332
|
|
|
15612
|
-
if (
|
|
15613
|
-
|
|
16333
|
+
if (props.checkSponsered) {
|
|
15614
16334
|
return taxonomyMapping.some(function (item) {
|
|
15615
|
-
return item._ref
|
|
16335
|
+
return includes_1(sponsoredTaxonomies, item._ref);
|
|
15616
16336
|
});
|
|
15617
16337
|
} else {
|
|
15618
16338
|
return false;
|
|
15619
16339
|
}
|
|
15620
16340
|
};
|
|
15621
16341
|
|
|
15622
|
-
|
|
15623
|
-
|
|
15624
|
-
|
|
15625
|
-
|
|
15626
|
-
|
|
15627
|
-
|
|
15628
|
-
|
|
15629
|
-
|
|
15630
|
-
|
|
15631
|
-
|
|
15632
|
-
|
|
16342
|
+
var updateConfig = function updateConfig(article) {
|
|
16343
|
+
if (prevUrl && prevUrl.length) {
|
|
16344
|
+
var _targeting = getTargeting(article);
|
|
16345
|
+
var _config = {
|
|
16346
|
+
navComponent: website.navigation,
|
|
16347
|
+
navItems: mainNavCache,
|
|
16348
|
+
columns: '3',
|
|
16349
|
+
leftItems: subNavCache,
|
|
16350
|
+
rightItems: checkSponseredArticle(article) ? [] : Ads.getRightItems(_targeting),
|
|
16351
|
+
horizontalAD: checkSponseredArticle(article) ? {} : Ads.getHorizontal(_targeting),
|
|
16352
|
+
isLiveSite: isLiveSite
|
|
16353
|
+
};
|
|
16354
|
+
setPageConfig(_config);
|
|
16355
|
+
if (!main_36) {
|
|
16356
|
+
lib_3.getGoogletag().then(function (googletag) {
|
|
16357
|
+
if (window.googletag && googletag.pubadsReady) {
|
|
16358
|
+
var slots = googletag.pubads().getSlots();
|
|
16359
|
+
slots.forEach(function (slot) {
|
|
16360
|
+
slot.clearTargeting();
|
|
16361
|
+
_Object$keys(_targeting).forEach(function (key) {
|
|
16362
|
+
slot.setTargeting(key, _targeting[key]);
|
|
16363
|
+
});
|
|
16364
|
+
});
|
|
16365
|
+
googletag.cmd.push(function () {
|
|
16366
|
+
googletag.pubads().refresh();
|
|
16367
|
+
});
|
|
16368
|
+
}
|
|
16369
|
+
});
|
|
16370
|
+
}
|
|
15633
16371
|
}
|
|
15634
|
-
return null;
|
|
15635
16372
|
};
|
|
15636
16373
|
|
|
15637
|
-
|
|
15638
|
-
|
|
15639
|
-
|
|
16374
|
+
useEffect(function () {
|
|
16375
|
+
setPrevUrl(document && document.referrer ? document.referrer : '/');
|
|
16376
|
+
props.article.Ads = Ads.getRightItems(targeting);
|
|
16377
|
+
setActiveArticle(props.article);
|
|
16378
|
+
}, [setPrevUrl]);
|
|
15640
16379
|
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15645
|
-
|
|
15646
|
-
|
|
15647
|
-
|
|
15648
|
-
|
|
15649
|
-
|
|
15650
|
-
|
|
15651
|
-
|
|
16380
|
+
useEffect(function () {
|
|
16381
|
+
setActiveArticle(props.article);
|
|
16382
|
+
}, [prevUrl]);
|
|
16383
|
+
|
|
16384
|
+
useEffect(function () {
|
|
16385
|
+
updateConfig(activeArticle);
|
|
16386
|
+
}, [activeArticle]);
|
|
16387
|
+
|
|
16388
|
+
var scrollDirectionDetect = function scrollDirectionDetect(e) {
|
|
16389
|
+
var window = e.currentTarget;
|
|
16390
|
+
if (preVscroll > window.scrollY) {
|
|
16391
|
+
if (!isScrollDown) {
|
|
16392
|
+
isScrollDown = true;
|
|
15652
16393
|
}
|
|
15653
|
-
})
|
|
15654
|
-
|
|
16394
|
+
} else if (preVscroll < window.scrollY) {
|
|
16395
|
+
if (isScrollDown) {
|
|
16396
|
+
isScrollDown = false;
|
|
16397
|
+
}
|
|
16398
|
+
}
|
|
16399
|
+
preVscroll = window.scrollY;
|
|
15655
16400
|
};
|
|
15656
16401
|
|
|
15657
|
-
|
|
15658
|
-
|
|
15659
|
-
|
|
16402
|
+
useEffect(function () {
|
|
16403
|
+
window.addEventListener('scroll', scrollDirectionDetect);
|
|
16404
|
+
});
|
|
16405
|
+
|
|
16406
|
+
var loadmore = function loadmore() {
|
|
16407
|
+
var query = props.relatedArticleQuery;
|
|
16408
|
+
var params = props.params;
|
|
16409
|
+
var data = queueData.map(function (item) {
|
|
16410
|
+
return item;
|
|
15660
16411
|
});
|
|
15661
|
-
|
|
15662
|
-
|
|
15663
|
-
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
|
|
15668
|
-
|
|
15669
|
-
|
|
15670
|
-
|
|
15671
|
-
_article$seo = article.seo;
|
|
15672
|
-
_article$seo = _article$seo === undefined ? {
|
|
15673
|
-
meta_description: null
|
|
15674
|
-
} : _article$seo;
|
|
15675
|
-
var description = _article$seo.meta_description;
|
|
15676
|
-
|
|
15677
|
-
var keywords = [].concat(_toConsumableArray(internalTag), _toConsumableArray(userDefinedTag), _toConsumableArray(SponsorshipTag), _toConsumableArray(seoTag));
|
|
15678
|
-
var config = _extends$2({}, _this3.state.config);
|
|
15679
|
-
var targeting = _this3.getTargeting(article);
|
|
15680
|
-
var rightItems = [];
|
|
15681
|
-
|
|
15682
|
-
if (_this3.checkSponseredArticle(article)) {
|
|
15683
|
-
rightItems = [];
|
|
15684
|
-
} else {
|
|
15685
|
-
rightItems = _this3.props.Ads.getRightItems(targeting);
|
|
16412
|
+
if (data && data.length < maxListLength) {
|
|
16413
|
+
params.index = data.length - 1;
|
|
16414
|
+
props.client.fetch(query, params).then(function (article) {
|
|
16415
|
+
if (article && article._id) {
|
|
16416
|
+
var _targeting2 = getTargeting(article);
|
|
16417
|
+
article.Ads = props.Ads.getRightItems(_targeting2);
|
|
16418
|
+
data.push(article);
|
|
16419
|
+
setQueueData(data);
|
|
16420
|
+
}
|
|
16421
|
+
});
|
|
15686
16422
|
}
|
|
15687
|
-
var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
|
|
15688
|
-
config.rightItems = rightItems;
|
|
15689
|
-
config.horizontalAD = horizontalAD;
|
|
15690
|
-
var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
|
|
15691
|
-
_this3.setState({ config: config, title: title, summary: metaDescription }, function () {
|
|
15692
|
-
if (!main_36) {
|
|
15693
|
-
lib_3.refresh();
|
|
15694
|
-
}
|
|
15695
|
-
});
|
|
15696
16423
|
};
|
|
15697
16424
|
|
|
15698
|
-
|
|
15699
|
-
var
|
|
16425
|
+
var refreshAdd = function refreshAdd(path) {
|
|
16426
|
+
var article = queueData.find(function (item) {
|
|
16427
|
+
return item.url.current === path;
|
|
16428
|
+
});
|
|
16429
|
+
var targeting = getTargeting(article);
|
|
16430
|
+
console.log('Forced Ad refresh', targeting);
|
|
16431
|
+
article.Ads = Ads.getRightItems(targeting);
|
|
16432
|
+
setActiveArticle(article);
|
|
16433
|
+
};
|
|
15700
16434
|
|
|
16435
|
+
var changeUrl = function changeUrl(path, visibility) {
|
|
15701
16436
|
var newPath = '/view/' + path;
|
|
15702
16437
|
if (!isScrollDown) {
|
|
15703
|
-
if (visibility
|
|
15704
|
-
// Router.push('/view/[url]', newPath, {shallow:true})
|
|
16438
|
+
if (visibility === 'top') {
|
|
16439
|
+
// Router.push('/view/[url]', newPath, { shallow: true })
|
|
15705
16440
|
window.history.pushState({ page: path }, path, newPath);
|
|
15706
|
-
if (
|
|
15707
|
-
|
|
16441
|
+
if (props.pageview) {
|
|
16442
|
+
props.pageview(newPath);
|
|
15708
16443
|
}
|
|
15709
|
-
|
|
15710
|
-
_this3.refreshAdd(path);
|
|
16444
|
+
refreshAdd(path);
|
|
15711
16445
|
}
|
|
15712
16446
|
} else {
|
|
15713
|
-
if (visibility
|
|
15714
|
-
// Router.push('/view/[url]', newPath, {shallow:true})
|
|
16447
|
+
if (visibility === 'bottom') {
|
|
16448
|
+
// Router.push('/view/[url]', newPath, { shallow: true })
|
|
15715
16449
|
window.history.pushState({ page: path }, path, newPath);
|
|
15716
|
-
if (
|
|
15717
|
-
|
|
16450
|
+
if (props.pageview) {
|
|
16451
|
+
props.pageview(newPath);
|
|
15718
16452
|
}
|
|
15719
16453
|
|
|
15720
|
-
|
|
16454
|
+
refreshAdd(path);
|
|
15721
16455
|
}
|
|
15722
16456
|
}
|
|
15723
16457
|
};
|
|
16458
|
+
|
|
16459
|
+
if (prevUrl && prevUrl.length) {
|
|
16460
|
+
return React__default.createElement(
|
|
16461
|
+
TemplateNormal,
|
|
16462
|
+
{ config: pageConfig, website: website, keywords: keywords, description: summary, title: title, showRightAd: !main_36 },
|
|
16463
|
+
React__default.createElement(
|
|
16464
|
+
InfiniteScroll,
|
|
16465
|
+
{ dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
|
|
16466
|
+
queueData.map(function (article, index) {
|
|
16467
|
+
return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article }));
|
|
16468
|
+
})
|
|
16469
|
+
)
|
|
16470
|
+
);
|
|
16471
|
+
} else {
|
|
16472
|
+
return null;
|
|
16473
|
+
}
|
|
15724
16474
|
};
|
|
15725
16475
|
|
|
15726
16476
|
var KMTracker = function KMTracker(props) {
|