@quintype/arrow 3.15.1-perf.3 → 3.15.1-perf.4
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/atoms/Author/index.js +14 -2103
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +32 -2482
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +12 -2101
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-b22f1843.js → index-0f809dd9.js} +10 -7
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-bc129cb8.js → index-37a9ccff.js} +18 -10
- package/atoms/ExtendedLoadMore/{index-6e083738.js → index-446679c8.js} +20 -12
- package/atoms/ExtendedLoadMore/{index-9e0d32b7.js → index-44f97338.js} +19 -9
- package/atoms/ExtendedLoadMore/{index-b5936059.js → index-57dd4870.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-fee73a14.js → index-66dd4dbd.js} +15 -7
- package/atoms/ExtendedLoadMore/{index-5c8eda4a.js → index-8462c597.js} +21 -16
- package/atoms/ExtendedLoadMore/{index-3c4ac692.js → index-93cb06d1.js} +42 -51
- package/atoms/ExtendedLoadMore/{index-4ddfe28d.js → index-afd44863.js} +6 -4
- package/atoms/ExtendedLoadMore/{index-3976fac4.js → index-b5754c5d.js} +20 -14
- package/atoms/ExtendedLoadMore/{index-a5c95f84.js → index-bbaf526e.js} +16 -8
- package/atoms/ExtendedLoadMore/{index-6ecceae4.js → index-cfb262ef.js} +18 -9
- package/atoms/ExtendedLoadMore/index.js +8 -1
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +14 -2103
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +22 -2170
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +12 -2114
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +17 -2178
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +10 -2099
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +8 -2097
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +13 -2463
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +23 -2545
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +17 -2454
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +144 -2740
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +64 -2582
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +123 -2893
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +45 -2495
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +92 -2659
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +92 -2659
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +89 -2656
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +27 -2743
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +34 -2763
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +91 -2658
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +81 -2612
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +75 -2603
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +92 -2623
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +91 -2622
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +80 -2617
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +72 -2596
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +84 -2615
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +84 -2615
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +80 -2611
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +85 -2616
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +81 -2612
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +75 -2606
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +38 -2235
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +24 -2487
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +26 -2489
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +81 -2612
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +92 -2623
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +61 -2583
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +91 -2622
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +92 -2659
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +9 -1816
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +91 -2622
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +72 -2596
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +94 -2625
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +84 -2615
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +76 -2607
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +80 -2617
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +78 -2609
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +80 -2617
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +77 -2608
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +82 -2619
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +79 -2610
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +75 -2606
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +24 -2170
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +15 -1870
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +16 -1871
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +20 -2157
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +18 -1932
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +42 -2251
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +45 -2254
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +48 -2257
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +26 -2163
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +17 -1872
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +15 -1870
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +12 -1725
- package/story-elements/Summary/index.js +18 -1873
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +16 -2153
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +12 -1725
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +282 -3167
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +504 -3389
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +287 -3172
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +416 -3301
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +382 -3267
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e7cde739.js +0 -3051
|
@@ -2,12 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _toArray = require('@babel/runtime/helpers/toArray');
|
|
5
6
|
var React = require('react');
|
|
7
|
+
var lodash = require('lodash');
|
|
6
8
|
var PropTypes = require('prop-types');
|
|
7
9
|
var reactRedux = require('react-redux');
|
|
10
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
11
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
8
12
|
var components = require('@quintype/components');
|
|
13
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
14
|
+
require('@babel/runtime/helpers/typeof');
|
|
15
|
+
require('@babel/runtime/regenerator');
|
|
9
16
|
var Timeago = require('react-timeago');
|
|
10
17
|
var dateFnsTz = require('date-fns-tz');
|
|
18
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
19
|
var ReactDOM = require('react-dom');
|
|
12
20
|
|
|
13
21
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -30,2536 +38,15 @@ function _interopNamespace(e) {
|
|
|
30
38
|
return Object.freeze(n);
|
|
31
39
|
}
|
|
32
40
|
|
|
41
|
+
var _toArray__default = /*#__PURE__*/_interopDefaultLegacy(_toArray);
|
|
33
42
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
43
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
44
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
45
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
35
46
|
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
47
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
36
48
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
37
49
|
|
|
38
|
-
function _arrayWithHoles(arr) {
|
|
39
|
-
if (Array.isArray(arr)) return arr;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _iterableToArray(iter) {
|
|
43
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function _arrayLikeToArray(arr, len) {
|
|
47
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
48
|
-
|
|
49
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
50
|
-
arr2[i] = arr[i];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return arr2;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
57
|
-
if (!o) return;
|
|
58
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
59
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
60
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
61
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
62
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _nonIterableRest() {
|
|
66
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function _toArray(arr) {
|
|
70
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Checks if `value` is classified as an `Array` object.
|
|
75
|
-
*
|
|
76
|
-
* @static
|
|
77
|
-
* @memberOf _
|
|
78
|
-
* @since 0.1.0
|
|
79
|
-
* @category Lang
|
|
80
|
-
* @param {*} value The value to check.
|
|
81
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
82
|
-
* @example
|
|
83
|
-
*
|
|
84
|
-
* _.isArray([1, 2, 3]);
|
|
85
|
-
* // => true
|
|
86
|
-
*
|
|
87
|
-
* _.isArray(document.body.children);
|
|
88
|
-
* // => false
|
|
89
|
-
*
|
|
90
|
-
* _.isArray('abc');
|
|
91
|
-
* // => false
|
|
92
|
-
*
|
|
93
|
-
* _.isArray(_.noop);
|
|
94
|
-
* // => false
|
|
95
|
-
*/
|
|
96
|
-
var isArray = Array.isArray;
|
|
97
|
-
|
|
98
|
-
var isArray_1 = isArray;
|
|
99
|
-
|
|
100
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
101
|
-
|
|
102
|
-
function getDefaultExportFromCjs (x) {
|
|
103
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function createCommonjsModule(fn) {
|
|
107
|
-
var module = { exports: {} };
|
|
108
|
-
return fn(module, module.exports), module.exports;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/** Detect free variable `global` from Node.js. */
|
|
112
|
-
|
|
113
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
114
|
-
|
|
115
|
-
var _freeGlobal = freeGlobal;
|
|
116
|
-
|
|
117
|
-
/** Detect free variable `self`. */
|
|
118
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
119
|
-
|
|
120
|
-
/** Used as a reference to the global object. */
|
|
121
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
122
|
-
|
|
123
|
-
var _root = root;
|
|
124
|
-
|
|
125
|
-
/** Built-in value references. */
|
|
126
|
-
var Symbol$1 = _root.Symbol;
|
|
127
|
-
|
|
128
|
-
var _Symbol = Symbol$1;
|
|
129
|
-
|
|
130
|
-
/** Used for built-in method references. */
|
|
131
|
-
var objectProto$4 = Object.prototype;
|
|
132
|
-
|
|
133
|
-
/** Used to check objects for own properties. */
|
|
134
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Used to resolve the
|
|
138
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
139
|
-
* of values.
|
|
140
|
-
*/
|
|
141
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
142
|
-
|
|
143
|
-
/** Built-in value references. */
|
|
144
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
148
|
-
*
|
|
149
|
-
* @private
|
|
150
|
-
* @param {*} value The value to query.
|
|
151
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
152
|
-
*/
|
|
153
|
-
function getRawTag(value) {
|
|
154
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
155
|
-
tag = value[symToStringTag$1];
|
|
156
|
-
|
|
157
|
-
try {
|
|
158
|
-
value[symToStringTag$1] = undefined;
|
|
159
|
-
var unmasked = true;
|
|
160
|
-
} catch (e) {}
|
|
161
|
-
|
|
162
|
-
var result = nativeObjectToString$1.call(value);
|
|
163
|
-
if (unmasked) {
|
|
164
|
-
if (isOwn) {
|
|
165
|
-
value[symToStringTag$1] = tag;
|
|
166
|
-
} else {
|
|
167
|
-
delete value[symToStringTag$1];
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
var _getRawTag = getRawTag;
|
|
174
|
-
|
|
175
|
-
/** Used for built-in method references. */
|
|
176
|
-
var objectProto$3 = Object.prototype;
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* Used to resolve the
|
|
180
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
181
|
-
* of values.
|
|
182
|
-
*/
|
|
183
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
187
|
-
*
|
|
188
|
-
* @private
|
|
189
|
-
* @param {*} value The value to convert.
|
|
190
|
-
* @returns {string} Returns the converted string.
|
|
191
|
-
*/
|
|
192
|
-
function objectToString(value) {
|
|
193
|
-
return nativeObjectToString.call(value);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
var _objectToString = objectToString;
|
|
197
|
-
|
|
198
|
-
/** `Object#toString` result references. */
|
|
199
|
-
var nullTag = '[object Null]',
|
|
200
|
-
undefinedTag = '[object Undefined]';
|
|
201
|
-
|
|
202
|
-
/** Built-in value references. */
|
|
203
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
207
|
-
*
|
|
208
|
-
* @private
|
|
209
|
-
* @param {*} value The value to query.
|
|
210
|
-
* @returns {string} Returns the `toStringTag`.
|
|
211
|
-
*/
|
|
212
|
-
function baseGetTag(value) {
|
|
213
|
-
if (value == null) {
|
|
214
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
215
|
-
}
|
|
216
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
217
|
-
? _getRawTag(value)
|
|
218
|
-
: _objectToString(value);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
var _baseGetTag = baseGetTag;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
225
|
-
* and has a `typeof` result of "object".
|
|
226
|
-
*
|
|
227
|
-
* @static
|
|
228
|
-
* @memberOf _
|
|
229
|
-
* @since 4.0.0
|
|
230
|
-
* @category Lang
|
|
231
|
-
* @param {*} value The value to check.
|
|
232
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
233
|
-
* @example
|
|
234
|
-
*
|
|
235
|
-
* _.isObjectLike({});
|
|
236
|
-
* // => true
|
|
237
|
-
*
|
|
238
|
-
* _.isObjectLike([1, 2, 3]);
|
|
239
|
-
* // => true
|
|
240
|
-
*
|
|
241
|
-
* _.isObjectLike(_.noop);
|
|
242
|
-
* // => false
|
|
243
|
-
*
|
|
244
|
-
* _.isObjectLike(null);
|
|
245
|
-
* // => false
|
|
246
|
-
*/
|
|
247
|
-
function isObjectLike(value) {
|
|
248
|
-
return value != null && typeof value == 'object';
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
var isObjectLike_1 = isObjectLike;
|
|
252
|
-
|
|
253
|
-
/** `Object#toString` result references. */
|
|
254
|
-
var symbolTag = '[object Symbol]';
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
258
|
-
*
|
|
259
|
-
* @static
|
|
260
|
-
* @memberOf _
|
|
261
|
-
* @since 4.0.0
|
|
262
|
-
* @category Lang
|
|
263
|
-
* @param {*} value The value to check.
|
|
264
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
265
|
-
* @example
|
|
266
|
-
*
|
|
267
|
-
* _.isSymbol(Symbol.iterator);
|
|
268
|
-
* // => true
|
|
269
|
-
*
|
|
270
|
-
* _.isSymbol('abc');
|
|
271
|
-
* // => false
|
|
272
|
-
*/
|
|
273
|
-
function isSymbol(value) {
|
|
274
|
-
return typeof value == 'symbol' ||
|
|
275
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
var isSymbol_1 = isSymbol;
|
|
279
|
-
|
|
280
|
-
/** Used to match property names within property paths. */
|
|
281
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
282
|
-
reIsPlainProp = /^\w*$/;
|
|
283
|
-
|
|
284
|
-
/**
|
|
285
|
-
* Checks if `value` is a property name and not a property path.
|
|
286
|
-
*
|
|
287
|
-
* @private
|
|
288
|
-
* @param {*} value The value to check.
|
|
289
|
-
* @param {Object} [object] The object to query keys on.
|
|
290
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
291
|
-
*/
|
|
292
|
-
function isKey(value, object) {
|
|
293
|
-
if (isArray_1(value)) {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
|
-
var type = typeof value;
|
|
297
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
298
|
-
value == null || isSymbol_1(value)) {
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
302
|
-
(object != null && value in Object(object));
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
var _isKey = isKey;
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Checks if `value` is the
|
|
309
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
310
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
311
|
-
*
|
|
312
|
-
* @static
|
|
313
|
-
* @memberOf _
|
|
314
|
-
* @since 0.1.0
|
|
315
|
-
* @category Lang
|
|
316
|
-
* @param {*} value The value to check.
|
|
317
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
318
|
-
* @example
|
|
319
|
-
*
|
|
320
|
-
* _.isObject({});
|
|
321
|
-
* // => true
|
|
322
|
-
*
|
|
323
|
-
* _.isObject([1, 2, 3]);
|
|
324
|
-
* // => true
|
|
325
|
-
*
|
|
326
|
-
* _.isObject(_.noop);
|
|
327
|
-
* // => true
|
|
328
|
-
*
|
|
329
|
-
* _.isObject(null);
|
|
330
|
-
* // => false
|
|
331
|
-
*/
|
|
332
|
-
function isObject(value) {
|
|
333
|
-
var type = typeof value;
|
|
334
|
-
return value != null && (type == 'object' || type == 'function');
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
var isObject_1 = isObject;
|
|
338
|
-
|
|
339
|
-
/** `Object#toString` result references. */
|
|
340
|
-
var asyncTag = '[object AsyncFunction]',
|
|
341
|
-
funcTag = '[object Function]',
|
|
342
|
-
genTag = '[object GeneratorFunction]',
|
|
343
|
-
proxyTag = '[object Proxy]';
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Checks if `value` is classified as a `Function` object.
|
|
347
|
-
*
|
|
348
|
-
* @static
|
|
349
|
-
* @memberOf _
|
|
350
|
-
* @since 0.1.0
|
|
351
|
-
* @category Lang
|
|
352
|
-
* @param {*} value The value to check.
|
|
353
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
354
|
-
* @example
|
|
355
|
-
*
|
|
356
|
-
* _.isFunction(_);
|
|
357
|
-
* // => true
|
|
358
|
-
*
|
|
359
|
-
* _.isFunction(/abc/);
|
|
360
|
-
* // => false
|
|
361
|
-
*/
|
|
362
|
-
function isFunction(value) {
|
|
363
|
-
if (!isObject_1(value)) {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
367
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
368
|
-
var tag = _baseGetTag(value);
|
|
369
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
var isFunction_1 = isFunction;
|
|
373
|
-
|
|
374
|
-
/** Used to detect overreaching core-js shims. */
|
|
375
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
376
|
-
|
|
377
|
-
var _coreJsData = coreJsData;
|
|
378
|
-
|
|
379
|
-
/** Used to detect methods masquerading as native. */
|
|
380
|
-
var maskSrcKey = (function() {
|
|
381
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
382
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
383
|
-
}());
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Checks if `func` has its source masked.
|
|
387
|
-
*
|
|
388
|
-
* @private
|
|
389
|
-
* @param {Function} func The function to check.
|
|
390
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
391
|
-
*/
|
|
392
|
-
function isMasked(func) {
|
|
393
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
var _isMasked = isMasked;
|
|
397
|
-
|
|
398
|
-
/** Used for built-in method references. */
|
|
399
|
-
var funcProto$1 = Function.prototype;
|
|
400
|
-
|
|
401
|
-
/** Used to resolve the decompiled source of functions. */
|
|
402
|
-
var funcToString$1 = funcProto$1.toString;
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Converts `func` to its source code.
|
|
406
|
-
*
|
|
407
|
-
* @private
|
|
408
|
-
* @param {Function} func The function to convert.
|
|
409
|
-
* @returns {string} Returns the source code.
|
|
410
|
-
*/
|
|
411
|
-
function toSource(func) {
|
|
412
|
-
if (func != null) {
|
|
413
|
-
try {
|
|
414
|
-
return funcToString$1.call(func);
|
|
415
|
-
} catch (e) {}
|
|
416
|
-
try {
|
|
417
|
-
return (func + '');
|
|
418
|
-
} catch (e) {}
|
|
419
|
-
}
|
|
420
|
-
return '';
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
var _toSource = toSource;
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Used to match `RegExp`
|
|
427
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
428
|
-
*/
|
|
429
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
430
|
-
|
|
431
|
-
/** Used to detect host constructors (Safari). */
|
|
432
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
433
|
-
|
|
434
|
-
/** Used for built-in method references. */
|
|
435
|
-
var funcProto = Function.prototype,
|
|
436
|
-
objectProto$2 = Object.prototype;
|
|
437
|
-
|
|
438
|
-
/** Used to resolve the decompiled source of functions. */
|
|
439
|
-
var funcToString = funcProto.toString;
|
|
440
|
-
|
|
441
|
-
/** Used to check objects for own properties. */
|
|
442
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
443
|
-
|
|
444
|
-
/** Used to detect if a method is native. */
|
|
445
|
-
var reIsNative = RegExp('^' +
|
|
446
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
447
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
448
|
-
);
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
452
|
-
*
|
|
453
|
-
* @private
|
|
454
|
-
* @param {*} value The value to check.
|
|
455
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
456
|
-
* else `false`.
|
|
457
|
-
*/
|
|
458
|
-
function baseIsNative(value) {
|
|
459
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
460
|
-
return false;
|
|
461
|
-
}
|
|
462
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
463
|
-
return pattern.test(_toSource(value));
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
var _baseIsNative = baseIsNative;
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Gets the value at `key` of `object`.
|
|
470
|
-
*
|
|
471
|
-
* @private
|
|
472
|
-
* @param {Object} [object] The object to query.
|
|
473
|
-
* @param {string} key The key of the property to get.
|
|
474
|
-
* @returns {*} Returns the property value.
|
|
475
|
-
*/
|
|
476
|
-
function getValue(object, key) {
|
|
477
|
-
return object == null ? undefined : object[key];
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
var _getValue = getValue;
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Gets the native function at `key` of `object`.
|
|
484
|
-
*
|
|
485
|
-
* @private
|
|
486
|
-
* @param {Object} object The object to query.
|
|
487
|
-
* @param {string} key The key of the method to get.
|
|
488
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
489
|
-
*/
|
|
490
|
-
function getNative(object, key) {
|
|
491
|
-
var value = _getValue(object, key);
|
|
492
|
-
return _baseIsNative(value) ? value : undefined;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
var _getNative = getNative;
|
|
496
|
-
|
|
497
|
-
/* Built-in method references that are verified to be native. */
|
|
498
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
499
|
-
|
|
500
|
-
var _nativeCreate = nativeCreate;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Removes all key-value entries from the hash.
|
|
504
|
-
*
|
|
505
|
-
* @private
|
|
506
|
-
* @name clear
|
|
507
|
-
* @memberOf Hash
|
|
508
|
-
*/
|
|
509
|
-
function hashClear() {
|
|
510
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
511
|
-
this.size = 0;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
var _hashClear = hashClear;
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* Removes `key` and its value from the hash.
|
|
518
|
-
*
|
|
519
|
-
* @private
|
|
520
|
-
* @name delete
|
|
521
|
-
* @memberOf Hash
|
|
522
|
-
* @param {Object} hash The hash to modify.
|
|
523
|
-
* @param {string} key The key of the value to remove.
|
|
524
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
525
|
-
*/
|
|
526
|
-
function hashDelete(key) {
|
|
527
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
528
|
-
this.size -= result ? 1 : 0;
|
|
529
|
-
return result;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
var _hashDelete = hashDelete;
|
|
533
|
-
|
|
534
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
535
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
536
|
-
|
|
537
|
-
/** Used for built-in method references. */
|
|
538
|
-
var objectProto$1 = Object.prototype;
|
|
539
|
-
|
|
540
|
-
/** Used to check objects for own properties. */
|
|
541
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
542
|
-
|
|
543
|
-
/**
|
|
544
|
-
* Gets the hash value for `key`.
|
|
545
|
-
*
|
|
546
|
-
* @private
|
|
547
|
-
* @name get
|
|
548
|
-
* @memberOf Hash
|
|
549
|
-
* @param {string} key The key of the value to get.
|
|
550
|
-
* @returns {*} Returns the entry value.
|
|
551
|
-
*/
|
|
552
|
-
function hashGet(key) {
|
|
553
|
-
var data = this.__data__;
|
|
554
|
-
if (_nativeCreate) {
|
|
555
|
-
var result = data[key];
|
|
556
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
557
|
-
}
|
|
558
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
var _hashGet = hashGet;
|
|
562
|
-
|
|
563
|
-
/** Used for built-in method references. */
|
|
564
|
-
var objectProto = Object.prototype;
|
|
565
|
-
|
|
566
|
-
/** Used to check objects for own properties. */
|
|
567
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Checks if a hash value for `key` exists.
|
|
571
|
-
*
|
|
572
|
-
* @private
|
|
573
|
-
* @name has
|
|
574
|
-
* @memberOf Hash
|
|
575
|
-
* @param {string} key The key of the entry to check.
|
|
576
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
577
|
-
*/
|
|
578
|
-
function hashHas(key) {
|
|
579
|
-
var data = this.__data__;
|
|
580
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
var _hashHas = hashHas;
|
|
584
|
-
|
|
585
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
586
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* Sets the hash `key` to `value`.
|
|
590
|
-
*
|
|
591
|
-
* @private
|
|
592
|
-
* @name set
|
|
593
|
-
* @memberOf Hash
|
|
594
|
-
* @param {string} key The key of the value to set.
|
|
595
|
-
* @param {*} value The value to set.
|
|
596
|
-
* @returns {Object} Returns the hash instance.
|
|
597
|
-
*/
|
|
598
|
-
function hashSet(key, value) {
|
|
599
|
-
var data = this.__data__;
|
|
600
|
-
this.size += this.has(key) ? 0 : 1;
|
|
601
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
602
|
-
return this;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
var _hashSet = hashSet;
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Creates a hash object.
|
|
609
|
-
*
|
|
610
|
-
* @private
|
|
611
|
-
* @constructor
|
|
612
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
613
|
-
*/
|
|
614
|
-
function Hash(entries) {
|
|
615
|
-
var index = -1,
|
|
616
|
-
length = entries == null ? 0 : entries.length;
|
|
617
|
-
|
|
618
|
-
this.clear();
|
|
619
|
-
while (++index < length) {
|
|
620
|
-
var entry = entries[index];
|
|
621
|
-
this.set(entry[0], entry[1]);
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
// Add methods to `Hash`.
|
|
626
|
-
Hash.prototype.clear = _hashClear;
|
|
627
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
628
|
-
Hash.prototype.get = _hashGet;
|
|
629
|
-
Hash.prototype.has = _hashHas;
|
|
630
|
-
Hash.prototype.set = _hashSet;
|
|
631
|
-
|
|
632
|
-
var _Hash = Hash;
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Removes all key-value entries from the list cache.
|
|
636
|
-
*
|
|
637
|
-
* @private
|
|
638
|
-
* @name clear
|
|
639
|
-
* @memberOf ListCache
|
|
640
|
-
*/
|
|
641
|
-
function listCacheClear() {
|
|
642
|
-
this.__data__ = [];
|
|
643
|
-
this.size = 0;
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
var _listCacheClear = listCacheClear;
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Performs a
|
|
650
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
651
|
-
* comparison between two values to determine if they are equivalent.
|
|
652
|
-
*
|
|
653
|
-
* @static
|
|
654
|
-
* @memberOf _
|
|
655
|
-
* @since 4.0.0
|
|
656
|
-
* @category Lang
|
|
657
|
-
* @param {*} value The value to compare.
|
|
658
|
-
* @param {*} other The other value to compare.
|
|
659
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
660
|
-
* @example
|
|
661
|
-
*
|
|
662
|
-
* var object = { 'a': 1 };
|
|
663
|
-
* var other = { 'a': 1 };
|
|
664
|
-
*
|
|
665
|
-
* _.eq(object, object);
|
|
666
|
-
* // => true
|
|
667
|
-
*
|
|
668
|
-
* _.eq(object, other);
|
|
669
|
-
* // => false
|
|
670
|
-
*
|
|
671
|
-
* _.eq('a', 'a');
|
|
672
|
-
* // => true
|
|
673
|
-
*
|
|
674
|
-
* _.eq('a', Object('a'));
|
|
675
|
-
* // => false
|
|
676
|
-
*
|
|
677
|
-
* _.eq(NaN, NaN);
|
|
678
|
-
* // => true
|
|
679
|
-
*/
|
|
680
|
-
function eq(value, other) {
|
|
681
|
-
return value === other || (value !== value && other !== other);
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
var eq_1 = eq;
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
688
|
-
*
|
|
689
|
-
* @private
|
|
690
|
-
* @param {Array} array The array to inspect.
|
|
691
|
-
* @param {*} key The key to search for.
|
|
692
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
693
|
-
*/
|
|
694
|
-
function assocIndexOf(array, key) {
|
|
695
|
-
var length = array.length;
|
|
696
|
-
while (length--) {
|
|
697
|
-
if (eq_1(array[length][0], key)) {
|
|
698
|
-
return length;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
return -1;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
var _assocIndexOf = assocIndexOf;
|
|
705
|
-
|
|
706
|
-
/** Used for built-in method references. */
|
|
707
|
-
var arrayProto = Array.prototype;
|
|
708
|
-
|
|
709
|
-
/** Built-in value references. */
|
|
710
|
-
var splice = arrayProto.splice;
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Removes `key` and its value from the list cache.
|
|
714
|
-
*
|
|
715
|
-
* @private
|
|
716
|
-
* @name delete
|
|
717
|
-
* @memberOf ListCache
|
|
718
|
-
* @param {string} key The key of the value to remove.
|
|
719
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
720
|
-
*/
|
|
721
|
-
function listCacheDelete(key) {
|
|
722
|
-
var data = this.__data__,
|
|
723
|
-
index = _assocIndexOf(data, key);
|
|
724
|
-
|
|
725
|
-
if (index < 0) {
|
|
726
|
-
return false;
|
|
727
|
-
}
|
|
728
|
-
var lastIndex = data.length - 1;
|
|
729
|
-
if (index == lastIndex) {
|
|
730
|
-
data.pop();
|
|
731
|
-
} else {
|
|
732
|
-
splice.call(data, index, 1);
|
|
733
|
-
}
|
|
734
|
-
--this.size;
|
|
735
|
-
return true;
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
var _listCacheDelete = listCacheDelete;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Gets the list cache value for `key`.
|
|
742
|
-
*
|
|
743
|
-
* @private
|
|
744
|
-
* @name get
|
|
745
|
-
* @memberOf ListCache
|
|
746
|
-
* @param {string} key The key of the value to get.
|
|
747
|
-
* @returns {*} Returns the entry value.
|
|
748
|
-
*/
|
|
749
|
-
function listCacheGet(key) {
|
|
750
|
-
var data = this.__data__,
|
|
751
|
-
index = _assocIndexOf(data, key);
|
|
752
|
-
|
|
753
|
-
return index < 0 ? undefined : data[index][1];
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
var _listCacheGet = listCacheGet;
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* Checks if a list cache value for `key` exists.
|
|
760
|
-
*
|
|
761
|
-
* @private
|
|
762
|
-
* @name has
|
|
763
|
-
* @memberOf ListCache
|
|
764
|
-
* @param {string} key The key of the entry to check.
|
|
765
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
766
|
-
*/
|
|
767
|
-
function listCacheHas(key) {
|
|
768
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
var _listCacheHas = listCacheHas;
|
|
772
|
-
|
|
773
|
-
/**
|
|
774
|
-
* Sets the list cache `key` to `value`.
|
|
775
|
-
*
|
|
776
|
-
* @private
|
|
777
|
-
* @name set
|
|
778
|
-
* @memberOf ListCache
|
|
779
|
-
* @param {string} key The key of the value to set.
|
|
780
|
-
* @param {*} value The value to set.
|
|
781
|
-
* @returns {Object} Returns the list cache instance.
|
|
782
|
-
*/
|
|
783
|
-
function listCacheSet(key, value) {
|
|
784
|
-
var data = this.__data__,
|
|
785
|
-
index = _assocIndexOf(data, key);
|
|
786
|
-
|
|
787
|
-
if (index < 0) {
|
|
788
|
-
++this.size;
|
|
789
|
-
data.push([key, value]);
|
|
790
|
-
} else {
|
|
791
|
-
data[index][1] = value;
|
|
792
|
-
}
|
|
793
|
-
return this;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
var _listCacheSet = listCacheSet;
|
|
797
|
-
|
|
798
|
-
/**
|
|
799
|
-
* Creates an list cache object.
|
|
800
|
-
*
|
|
801
|
-
* @private
|
|
802
|
-
* @constructor
|
|
803
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
804
|
-
*/
|
|
805
|
-
function ListCache(entries) {
|
|
806
|
-
var index = -1,
|
|
807
|
-
length = entries == null ? 0 : entries.length;
|
|
808
|
-
|
|
809
|
-
this.clear();
|
|
810
|
-
while (++index < length) {
|
|
811
|
-
var entry = entries[index];
|
|
812
|
-
this.set(entry[0], entry[1]);
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
|
|
816
|
-
// Add methods to `ListCache`.
|
|
817
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
818
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
819
|
-
ListCache.prototype.get = _listCacheGet;
|
|
820
|
-
ListCache.prototype.has = _listCacheHas;
|
|
821
|
-
ListCache.prototype.set = _listCacheSet;
|
|
822
|
-
|
|
823
|
-
var _ListCache = ListCache;
|
|
824
|
-
|
|
825
|
-
/* Built-in method references that are verified to be native. */
|
|
826
|
-
var Map = _getNative(_root, 'Map');
|
|
827
|
-
|
|
828
|
-
var _Map = Map;
|
|
829
|
-
|
|
830
|
-
/**
|
|
831
|
-
* Removes all key-value entries from the map.
|
|
832
|
-
*
|
|
833
|
-
* @private
|
|
834
|
-
* @name clear
|
|
835
|
-
* @memberOf MapCache
|
|
836
|
-
*/
|
|
837
|
-
function mapCacheClear() {
|
|
838
|
-
this.size = 0;
|
|
839
|
-
this.__data__ = {
|
|
840
|
-
'hash': new _Hash,
|
|
841
|
-
'map': new (_Map || _ListCache),
|
|
842
|
-
'string': new _Hash
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
var _mapCacheClear = mapCacheClear;
|
|
847
|
-
|
|
848
|
-
/**
|
|
849
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
850
|
-
*
|
|
851
|
-
* @private
|
|
852
|
-
* @param {*} value The value to check.
|
|
853
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
854
|
-
*/
|
|
855
|
-
function isKeyable(value) {
|
|
856
|
-
var type = typeof value;
|
|
857
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
858
|
-
? (value !== '__proto__')
|
|
859
|
-
: (value === null);
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
var _isKeyable = isKeyable;
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* Gets the data for `map`.
|
|
866
|
-
*
|
|
867
|
-
* @private
|
|
868
|
-
* @param {Object} map The map to query.
|
|
869
|
-
* @param {string} key The reference key.
|
|
870
|
-
* @returns {*} Returns the map data.
|
|
871
|
-
*/
|
|
872
|
-
function getMapData(map, key) {
|
|
873
|
-
var data = map.__data__;
|
|
874
|
-
return _isKeyable(key)
|
|
875
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
876
|
-
: data.map;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
var _getMapData = getMapData;
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* Removes `key` and its value from the map.
|
|
883
|
-
*
|
|
884
|
-
* @private
|
|
885
|
-
* @name delete
|
|
886
|
-
* @memberOf MapCache
|
|
887
|
-
* @param {string} key The key of the value to remove.
|
|
888
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
889
|
-
*/
|
|
890
|
-
function mapCacheDelete(key) {
|
|
891
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
892
|
-
this.size -= result ? 1 : 0;
|
|
893
|
-
return result;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
897
|
-
|
|
898
|
-
/**
|
|
899
|
-
* Gets the map value for `key`.
|
|
900
|
-
*
|
|
901
|
-
* @private
|
|
902
|
-
* @name get
|
|
903
|
-
* @memberOf MapCache
|
|
904
|
-
* @param {string} key The key of the value to get.
|
|
905
|
-
* @returns {*} Returns the entry value.
|
|
906
|
-
*/
|
|
907
|
-
function mapCacheGet(key) {
|
|
908
|
-
return _getMapData(this, key).get(key);
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
var _mapCacheGet = mapCacheGet;
|
|
912
|
-
|
|
913
|
-
/**
|
|
914
|
-
* Checks if a map value for `key` exists.
|
|
915
|
-
*
|
|
916
|
-
* @private
|
|
917
|
-
* @name has
|
|
918
|
-
* @memberOf MapCache
|
|
919
|
-
* @param {string} key The key of the entry to check.
|
|
920
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
921
|
-
*/
|
|
922
|
-
function mapCacheHas(key) {
|
|
923
|
-
return _getMapData(this, key).has(key);
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
var _mapCacheHas = mapCacheHas;
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Sets the map `key` to `value`.
|
|
930
|
-
*
|
|
931
|
-
* @private
|
|
932
|
-
* @name set
|
|
933
|
-
* @memberOf MapCache
|
|
934
|
-
* @param {string} key The key of the value to set.
|
|
935
|
-
* @param {*} value The value to set.
|
|
936
|
-
* @returns {Object} Returns the map cache instance.
|
|
937
|
-
*/
|
|
938
|
-
function mapCacheSet(key, value) {
|
|
939
|
-
var data = _getMapData(this, key),
|
|
940
|
-
size = data.size;
|
|
941
|
-
|
|
942
|
-
data.set(key, value);
|
|
943
|
-
this.size += data.size == size ? 0 : 1;
|
|
944
|
-
return this;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
var _mapCacheSet = mapCacheSet;
|
|
948
|
-
|
|
949
|
-
/**
|
|
950
|
-
* Creates a map cache object to store key-value pairs.
|
|
951
|
-
*
|
|
952
|
-
* @private
|
|
953
|
-
* @constructor
|
|
954
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
955
|
-
*/
|
|
956
|
-
function MapCache(entries) {
|
|
957
|
-
var index = -1,
|
|
958
|
-
length = entries == null ? 0 : entries.length;
|
|
959
|
-
|
|
960
|
-
this.clear();
|
|
961
|
-
while (++index < length) {
|
|
962
|
-
var entry = entries[index];
|
|
963
|
-
this.set(entry[0], entry[1]);
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
|
|
967
|
-
// Add methods to `MapCache`.
|
|
968
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
969
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
970
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
971
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
972
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
973
|
-
|
|
974
|
-
var _MapCache = MapCache;
|
|
975
|
-
|
|
976
|
-
/** Error message constants. */
|
|
977
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
981
|
-
* provided, it determines the cache key for storing the result based on the
|
|
982
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
983
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
984
|
-
* is invoked with the `this` binding of the memoized function.
|
|
985
|
-
*
|
|
986
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
987
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
988
|
-
* constructor with one whose instances implement the
|
|
989
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
990
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
991
|
-
*
|
|
992
|
-
* @static
|
|
993
|
-
* @memberOf _
|
|
994
|
-
* @since 0.1.0
|
|
995
|
-
* @category Function
|
|
996
|
-
* @param {Function} func The function to have its output memoized.
|
|
997
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
998
|
-
* @returns {Function} Returns the new memoized function.
|
|
999
|
-
* @example
|
|
1000
|
-
*
|
|
1001
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
1002
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
1003
|
-
*
|
|
1004
|
-
* var values = _.memoize(_.values);
|
|
1005
|
-
* values(object);
|
|
1006
|
-
* // => [1, 2]
|
|
1007
|
-
*
|
|
1008
|
-
* values(other);
|
|
1009
|
-
* // => [3, 4]
|
|
1010
|
-
*
|
|
1011
|
-
* object.a = 2;
|
|
1012
|
-
* values(object);
|
|
1013
|
-
* // => [1, 2]
|
|
1014
|
-
*
|
|
1015
|
-
* // Modify the result cache.
|
|
1016
|
-
* values.cache.set(object, ['a', 'b']);
|
|
1017
|
-
* values(object);
|
|
1018
|
-
* // => ['a', 'b']
|
|
1019
|
-
*
|
|
1020
|
-
* // Replace `_.memoize.Cache`.
|
|
1021
|
-
* _.memoize.Cache = WeakMap;
|
|
1022
|
-
*/
|
|
1023
|
-
function memoize(func, resolver) {
|
|
1024
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1025
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1026
|
-
}
|
|
1027
|
-
var memoized = function() {
|
|
1028
|
-
var args = arguments,
|
|
1029
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1030
|
-
cache = memoized.cache;
|
|
1031
|
-
|
|
1032
|
-
if (cache.has(key)) {
|
|
1033
|
-
return cache.get(key);
|
|
1034
|
-
}
|
|
1035
|
-
var result = func.apply(this, args);
|
|
1036
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1037
|
-
return result;
|
|
1038
|
-
};
|
|
1039
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1040
|
-
return memoized;
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
// Expose `MapCache`.
|
|
1044
|
-
memoize.Cache = _MapCache;
|
|
1045
|
-
|
|
1046
|
-
var memoize_1 = memoize;
|
|
1047
|
-
|
|
1048
|
-
/** Used as the maximum memoize cache size. */
|
|
1049
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1050
|
-
|
|
1051
|
-
/**
|
|
1052
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1053
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1054
|
-
*
|
|
1055
|
-
* @private
|
|
1056
|
-
* @param {Function} func The function to have its output memoized.
|
|
1057
|
-
* @returns {Function} Returns the new memoized function.
|
|
1058
|
-
*/
|
|
1059
|
-
function memoizeCapped(func) {
|
|
1060
|
-
var result = memoize_1(func, function(key) {
|
|
1061
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1062
|
-
cache.clear();
|
|
1063
|
-
}
|
|
1064
|
-
return key;
|
|
1065
|
-
});
|
|
1066
|
-
|
|
1067
|
-
var cache = result.cache;
|
|
1068
|
-
return result;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
var _memoizeCapped = memoizeCapped;
|
|
1072
|
-
|
|
1073
|
-
/** Used to match property names within property paths. */
|
|
1074
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1075
|
-
|
|
1076
|
-
/** Used to match backslashes in property paths. */
|
|
1077
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Converts `string` to a property path array.
|
|
1081
|
-
*
|
|
1082
|
-
* @private
|
|
1083
|
-
* @param {string} string The string to convert.
|
|
1084
|
-
* @returns {Array} Returns the property path array.
|
|
1085
|
-
*/
|
|
1086
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1087
|
-
var result = [];
|
|
1088
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1089
|
-
result.push('');
|
|
1090
|
-
}
|
|
1091
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1092
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1093
|
-
});
|
|
1094
|
-
return result;
|
|
1095
|
-
});
|
|
1096
|
-
|
|
1097
|
-
var _stringToPath = stringToPath;
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1101
|
-
* shorthands.
|
|
1102
|
-
*
|
|
1103
|
-
* @private
|
|
1104
|
-
* @param {Array} [array] The array to iterate over.
|
|
1105
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1106
|
-
* @returns {Array} Returns the new mapped array.
|
|
1107
|
-
*/
|
|
1108
|
-
function arrayMap(array, iteratee) {
|
|
1109
|
-
var index = -1,
|
|
1110
|
-
length = array == null ? 0 : array.length,
|
|
1111
|
-
result = Array(length);
|
|
1112
|
-
|
|
1113
|
-
while (++index < length) {
|
|
1114
|
-
result[index] = iteratee(array[index], index, array);
|
|
1115
|
-
}
|
|
1116
|
-
return result;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
var _arrayMap = arrayMap;
|
|
1120
|
-
|
|
1121
|
-
/** Used as references for various `Number` constants. */
|
|
1122
|
-
var INFINITY$1 = 1 / 0;
|
|
1123
|
-
|
|
1124
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1125
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1126
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1127
|
-
|
|
1128
|
-
/**
|
|
1129
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1130
|
-
* values to empty strings.
|
|
1131
|
-
*
|
|
1132
|
-
* @private
|
|
1133
|
-
* @param {*} value The value to process.
|
|
1134
|
-
* @returns {string} Returns the string.
|
|
1135
|
-
*/
|
|
1136
|
-
function baseToString(value) {
|
|
1137
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1138
|
-
if (typeof value == 'string') {
|
|
1139
|
-
return value;
|
|
1140
|
-
}
|
|
1141
|
-
if (isArray_1(value)) {
|
|
1142
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1143
|
-
return _arrayMap(value, baseToString) + '';
|
|
1144
|
-
}
|
|
1145
|
-
if (isSymbol_1(value)) {
|
|
1146
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1147
|
-
}
|
|
1148
|
-
var result = (value + '');
|
|
1149
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
var _baseToString = baseToString;
|
|
1153
|
-
|
|
1154
|
-
/**
|
|
1155
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1156
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1157
|
-
*
|
|
1158
|
-
* @static
|
|
1159
|
-
* @memberOf _
|
|
1160
|
-
* @since 4.0.0
|
|
1161
|
-
* @category Lang
|
|
1162
|
-
* @param {*} value The value to convert.
|
|
1163
|
-
* @returns {string} Returns the converted string.
|
|
1164
|
-
* @example
|
|
1165
|
-
*
|
|
1166
|
-
* _.toString(null);
|
|
1167
|
-
* // => ''
|
|
1168
|
-
*
|
|
1169
|
-
* _.toString(-0);
|
|
1170
|
-
* // => '-0'
|
|
1171
|
-
*
|
|
1172
|
-
* _.toString([1, 2, 3]);
|
|
1173
|
-
* // => '1,2,3'
|
|
1174
|
-
*/
|
|
1175
|
-
function toString(value) {
|
|
1176
|
-
return value == null ? '' : _baseToString(value);
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
var toString_1 = toString;
|
|
1180
|
-
|
|
1181
|
-
/**
|
|
1182
|
-
* Casts `value` to a path array if it's not one.
|
|
1183
|
-
*
|
|
1184
|
-
* @private
|
|
1185
|
-
* @param {*} value The value to inspect.
|
|
1186
|
-
* @param {Object} [object] The object to query keys on.
|
|
1187
|
-
* @returns {Array} Returns the cast property path array.
|
|
1188
|
-
*/
|
|
1189
|
-
function castPath(value, object) {
|
|
1190
|
-
if (isArray_1(value)) {
|
|
1191
|
-
return value;
|
|
1192
|
-
}
|
|
1193
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
var _castPath = castPath;
|
|
1197
|
-
|
|
1198
|
-
/** Used as references for various `Number` constants. */
|
|
1199
|
-
var INFINITY = 1 / 0;
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1203
|
-
*
|
|
1204
|
-
* @private
|
|
1205
|
-
* @param {*} value The value to inspect.
|
|
1206
|
-
* @returns {string|symbol} Returns the key.
|
|
1207
|
-
*/
|
|
1208
|
-
function toKey(value) {
|
|
1209
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1210
|
-
return value;
|
|
1211
|
-
}
|
|
1212
|
-
var result = (value + '');
|
|
1213
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
var _toKey = toKey;
|
|
1217
|
-
|
|
1218
|
-
/**
|
|
1219
|
-
* The base implementation of `_.get` without support for default values.
|
|
1220
|
-
*
|
|
1221
|
-
* @private
|
|
1222
|
-
* @param {Object} object The object to query.
|
|
1223
|
-
* @param {Array|string} path The path of the property to get.
|
|
1224
|
-
* @returns {*} Returns the resolved value.
|
|
1225
|
-
*/
|
|
1226
|
-
function baseGet(object, path) {
|
|
1227
|
-
path = _castPath(path, object);
|
|
1228
|
-
|
|
1229
|
-
var index = 0,
|
|
1230
|
-
length = path.length;
|
|
1231
|
-
|
|
1232
|
-
while (object != null && index < length) {
|
|
1233
|
-
object = object[_toKey(path[index++])];
|
|
1234
|
-
}
|
|
1235
|
-
return (index && index == length) ? object : undefined;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
var _baseGet = baseGet;
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1242
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1243
|
-
*
|
|
1244
|
-
* @static
|
|
1245
|
-
* @memberOf _
|
|
1246
|
-
* @since 3.7.0
|
|
1247
|
-
* @category Object
|
|
1248
|
-
* @param {Object} object The object to query.
|
|
1249
|
-
* @param {Array|string} path The path of the property to get.
|
|
1250
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1251
|
-
* @returns {*} Returns the resolved value.
|
|
1252
|
-
* @example
|
|
1253
|
-
*
|
|
1254
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1255
|
-
*
|
|
1256
|
-
* _.get(object, 'a[0].b.c');
|
|
1257
|
-
* // => 3
|
|
1258
|
-
*
|
|
1259
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1260
|
-
* // => 3
|
|
1261
|
-
*
|
|
1262
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1263
|
-
* // => 'default'
|
|
1264
|
-
*/
|
|
1265
|
-
function get(object, path, defaultValue) {
|
|
1266
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1267
|
-
return result === undefined ? defaultValue : result;
|
|
1268
|
-
}
|
|
1269
|
-
|
|
1270
|
-
var get_1 = get;
|
|
1271
|
-
|
|
1272
|
-
function _iterableToArrayLimit(arr, i) {
|
|
1273
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
1274
|
-
|
|
1275
|
-
if (_i == null) return;
|
|
1276
|
-
var _arr = [];
|
|
1277
|
-
var _n = true;
|
|
1278
|
-
var _d = false;
|
|
1279
|
-
|
|
1280
|
-
var _s, _e;
|
|
1281
|
-
|
|
1282
|
-
try {
|
|
1283
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
1284
|
-
_arr.push(_s.value);
|
|
1285
|
-
|
|
1286
|
-
if (i && _arr.length === i) break;
|
|
1287
|
-
}
|
|
1288
|
-
} catch (err) {
|
|
1289
|
-
_d = true;
|
|
1290
|
-
_e = err;
|
|
1291
|
-
} finally {
|
|
1292
|
-
try {
|
|
1293
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
1294
|
-
} finally {
|
|
1295
|
-
if (_d) throw _e;
|
|
1296
|
-
}
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
return _arr;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
function _slicedToArray(arr, i) {
|
|
1303
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
1307
|
-
|
|
1308
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1309
|
-
value: true
|
|
1310
|
-
});
|
|
1311
|
-
exports["default"] = void 0;
|
|
1312
|
-
var optionsDefaults = {
|
|
1313
|
-
attributeNames: {
|
|
1314
|
-
styleName: 'className'
|
|
1315
|
-
},
|
|
1316
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
1317
|
-
handleMissingStyleName: 'throw'
|
|
1318
|
-
};
|
|
1319
|
-
var _default = optionsDefaults;
|
|
1320
|
-
exports["default"] = _default;
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
});
|
|
1324
|
-
|
|
1325
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
1326
|
-
|
|
1327
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1328
|
-
value: true
|
|
1329
|
-
});
|
|
1330
|
-
exports["default"] = void 0;
|
|
1331
|
-
|
|
1332
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
1333
|
-
|
|
1334
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
1335
|
-
|
|
1336
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
1337
|
-
return styleName.indexOf('.') !== -1;
|
|
1338
|
-
};
|
|
1339
|
-
|
|
1340
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
1341
|
-
if (handleMissingStyleName === 'throw') {
|
|
1342
|
-
throw new Error(message);
|
|
1343
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
1344
|
-
// eslint-disable-next-line no-console
|
|
1345
|
-
console.warn(message);
|
|
1346
|
-
}
|
|
1347
|
-
|
|
1348
|
-
return null;
|
|
1349
|
-
};
|
|
1350
|
-
|
|
1351
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1352
|
-
// Note:
|
|
1353
|
-
// Do not use the desctructing syntax with Babel.
|
|
1354
|
-
// Desctructing adds _slicedToArray helper.
|
|
1355
|
-
var styleNameParts = styleName.split('.');
|
|
1356
|
-
var importName = styleNameParts[0];
|
|
1357
|
-
var moduleName = styleNameParts[1];
|
|
1358
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1359
|
-
|
|
1360
|
-
if (!moduleName) {
|
|
1361
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
if (!styleModuleImportMap[importName]) {
|
|
1365
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
1369
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
1370
|
-
}
|
|
1371
|
-
|
|
1372
|
-
return styleModuleImportMap[importName][moduleName];
|
|
1373
|
-
};
|
|
1374
|
-
|
|
1375
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
1376
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
1377
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
1378
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
1379
|
-
}).filter(function (importKey) {
|
|
1380
|
-
return importKey;
|
|
1381
|
-
});
|
|
1382
|
-
|
|
1383
|
-
if (importKeysWithMatches.length > 1) {
|
|
1384
|
-
throw new Error('Cannot resolve styleName "' + styleName + '" because it is present in multiple imports:' + '\n\n\t' + importKeysWithMatches.join('\n\t') + '\n\nYou can resolve this by using a named import, e.g:' + '\n\n\timport foo from "' + importKeysWithMatches[0] + '";' + '\n\t<div styleName="foo.' + styleName + '" />' + '\n\n');
|
|
1385
|
-
}
|
|
1386
|
-
|
|
1387
|
-
if (importKeysWithMatches.length === 0) {
|
|
1388
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1389
|
-
}
|
|
1390
|
-
|
|
1391
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
1392
|
-
};
|
|
1393
|
-
|
|
1394
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
1395
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
1396
|
-
|
|
1397
|
-
var _ref = options || {},
|
|
1398
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
1399
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
1400
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
1401
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
1402
|
-
|
|
1403
|
-
if (!styleNameValue) {
|
|
1404
|
-
return '';
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
1408
|
-
return styleName;
|
|
1409
|
-
}).map(function (styleName) {
|
|
1410
|
-
if (isNamespacedStyleName(styleName)) {
|
|
1411
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
1415
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1419
|
-
if (!autoResolveMultipleImports) {
|
|
1420
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1424
|
-
}
|
|
1425
|
-
|
|
1426
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1427
|
-
|
|
1428
|
-
if (!styleModuleMap[styleName]) {
|
|
1429
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1430
|
-
}
|
|
1431
|
-
|
|
1432
|
-
return styleModuleMap[styleName];
|
|
1433
|
-
}).filter(function (className) {
|
|
1434
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1435
|
-
return className;
|
|
1436
|
-
}).join(' ');
|
|
1437
|
-
};
|
|
1438
|
-
|
|
1439
|
-
exports["default"] = _default;
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
});
|
|
1443
|
-
|
|
1444
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
1445
|
-
|
|
1446
|
-
/**
|
|
1447
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1448
|
-
*
|
|
1449
|
-
* This source code is licensed under the MIT license found in the
|
|
1450
|
-
* LICENSE file in the root directory of this source tree.
|
|
1451
|
-
*/
|
|
1452
|
-
|
|
1453
|
-
createCommonjsModule(function (module) {
|
|
1454
|
-
var runtime = (function (exports) {
|
|
1455
|
-
|
|
1456
|
-
var Op = Object.prototype;
|
|
1457
|
-
var hasOwn = Op.hasOwnProperty;
|
|
1458
|
-
var undefined$1; // More compressible than void 0.
|
|
1459
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
1460
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
1461
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
1462
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1463
|
-
|
|
1464
|
-
function define(obj, key, value) {
|
|
1465
|
-
Object.defineProperty(obj, key, {
|
|
1466
|
-
value: value,
|
|
1467
|
-
enumerable: true,
|
|
1468
|
-
configurable: true,
|
|
1469
|
-
writable: true
|
|
1470
|
-
});
|
|
1471
|
-
return obj[key];
|
|
1472
|
-
}
|
|
1473
|
-
try {
|
|
1474
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1475
|
-
define({}, "");
|
|
1476
|
-
} catch (err) {
|
|
1477
|
-
define = function(obj, key, value) {
|
|
1478
|
-
return obj[key] = value;
|
|
1479
|
-
};
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1483
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1484
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1485
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1486
|
-
var context = new Context(tryLocsList || []);
|
|
1487
|
-
|
|
1488
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1489
|
-
// .throw, and .return methods.
|
|
1490
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1491
|
-
|
|
1492
|
-
return generator;
|
|
1493
|
-
}
|
|
1494
|
-
exports.wrap = wrap;
|
|
1495
|
-
|
|
1496
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1497
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1498
|
-
// have been (and was previously) designed to take a closure to be
|
|
1499
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1500
|
-
// already have an existing method we want to call, so there's no need
|
|
1501
|
-
// to create a new function object. We can even get away with assuming
|
|
1502
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1503
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1504
|
-
// only additional allocation required is the completion record, which
|
|
1505
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1506
|
-
function tryCatch(fn, obj, arg) {
|
|
1507
|
-
try {
|
|
1508
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1509
|
-
} catch (err) {
|
|
1510
|
-
return { type: "throw", arg: err };
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1515
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1516
|
-
var GenStateExecuting = "executing";
|
|
1517
|
-
var GenStateCompleted = "completed";
|
|
1518
|
-
|
|
1519
|
-
// Returning this object from the innerFn has the same effect as
|
|
1520
|
-
// breaking out of the dispatch switch statement.
|
|
1521
|
-
var ContinueSentinel = {};
|
|
1522
|
-
|
|
1523
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1524
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1525
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1526
|
-
// minifier not to mangle the names of these two functions.
|
|
1527
|
-
function Generator() {}
|
|
1528
|
-
function GeneratorFunction() {}
|
|
1529
|
-
function GeneratorFunctionPrototype() {}
|
|
1530
|
-
|
|
1531
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1532
|
-
// don't natively support it.
|
|
1533
|
-
var IteratorPrototype = {};
|
|
1534
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1535
|
-
return this;
|
|
1536
|
-
});
|
|
1537
|
-
|
|
1538
|
-
var getProto = Object.getPrototypeOf;
|
|
1539
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1540
|
-
if (NativeIteratorPrototype &&
|
|
1541
|
-
NativeIteratorPrototype !== Op &&
|
|
1542
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1543
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1544
|
-
// of the polyfill.
|
|
1545
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1546
|
-
}
|
|
1547
|
-
|
|
1548
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1549
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1550
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1551
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1552
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1553
|
-
GeneratorFunction.displayName = define(
|
|
1554
|
-
GeneratorFunctionPrototype,
|
|
1555
|
-
toStringTagSymbol,
|
|
1556
|
-
"GeneratorFunction"
|
|
1557
|
-
);
|
|
1558
|
-
|
|
1559
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1560
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1561
|
-
function defineIteratorMethods(prototype) {
|
|
1562
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1563
|
-
define(prototype, method, function(arg) {
|
|
1564
|
-
return this._invoke(method, arg);
|
|
1565
|
-
});
|
|
1566
|
-
});
|
|
1567
|
-
}
|
|
1568
|
-
|
|
1569
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1570
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1571
|
-
return ctor
|
|
1572
|
-
? ctor === GeneratorFunction ||
|
|
1573
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1574
|
-
// do is to check its .name property.
|
|
1575
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1576
|
-
: false;
|
|
1577
|
-
};
|
|
1578
|
-
|
|
1579
|
-
exports.mark = function(genFun) {
|
|
1580
|
-
if (Object.setPrototypeOf) {
|
|
1581
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1582
|
-
} else {
|
|
1583
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1584
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1585
|
-
}
|
|
1586
|
-
genFun.prototype = Object.create(Gp);
|
|
1587
|
-
return genFun;
|
|
1588
|
-
};
|
|
1589
|
-
|
|
1590
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1591
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1592
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1593
|
-
// meant to be awaited.
|
|
1594
|
-
exports.awrap = function(arg) {
|
|
1595
|
-
return { __await: arg };
|
|
1596
|
-
};
|
|
1597
|
-
|
|
1598
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1599
|
-
function invoke(method, arg, resolve, reject) {
|
|
1600
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1601
|
-
if (record.type === "throw") {
|
|
1602
|
-
reject(record.arg);
|
|
1603
|
-
} else {
|
|
1604
|
-
var result = record.arg;
|
|
1605
|
-
var value = result.value;
|
|
1606
|
-
if (value &&
|
|
1607
|
-
typeof value === "object" &&
|
|
1608
|
-
hasOwn.call(value, "__await")) {
|
|
1609
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1610
|
-
invoke("next", value, resolve, reject);
|
|
1611
|
-
}, function(err) {
|
|
1612
|
-
invoke("throw", err, resolve, reject);
|
|
1613
|
-
});
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1617
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1618
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1619
|
-
// current iteration.
|
|
1620
|
-
result.value = unwrapped;
|
|
1621
|
-
resolve(result);
|
|
1622
|
-
}, function(error) {
|
|
1623
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1624
|
-
// into the async generator function so it can be handled there.
|
|
1625
|
-
return invoke("throw", error, resolve, reject);
|
|
1626
|
-
});
|
|
1627
|
-
}
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
var previousPromise;
|
|
1631
|
-
|
|
1632
|
-
function enqueue(method, arg) {
|
|
1633
|
-
function callInvokeWithMethodAndArg() {
|
|
1634
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1635
|
-
invoke(method, arg, resolve, reject);
|
|
1636
|
-
});
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
return previousPromise =
|
|
1640
|
-
// If enqueue has been called before, then we want to wait until
|
|
1641
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1642
|
-
// so that results are always delivered in the correct order. If
|
|
1643
|
-
// enqueue has not been called before, then it is important to
|
|
1644
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1645
|
-
// so that the async generator function has the opportunity to do
|
|
1646
|
-
// any necessary setup in a predictable way. This predictability
|
|
1647
|
-
// is why the Promise constructor synchronously invokes its
|
|
1648
|
-
// executor callback, and why async functions synchronously
|
|
1649
|
-
// execute code before the first await. Since we implement simple
|
|
1650
|
-
// async functions in terms of async generators, it is especially
|
|
1651
|
-
// important to get this right, even though it requires care.
|
|
1652
|
-
previousPromise ? previousPromise.then(
|
|
1653
|
-
callInvokeWithMethodAndArg,
|
|
1654
|
-
// Avoid propagating failures to Promises returned by later
|
|
1655
|
-
// invocations of the iterator.
|
|
1656
|
-
callInvokeWithMethodAndArg
|
|
1657
|
-
) : callInvokeWithMethodAndArg();
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
// Define the unified helper method that is used to implement .next,
|
|
1661
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1662
|
-
this._invoke = enqueue;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1666
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1667
|
-
return this;
|
|
1668
|
-
});
|
|
1669
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1670
|
-
|
|
1671
|
-
// Note that simple async functions are implemented on top of
|
|
1672
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1673
|
-
// the final result produced by the iterator.
|
|
1674
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1675
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1676
|
-
|
|
1677
|
-
var iter = new AsyncIterator(
|
|
1678
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1679
|
-
PromiseImpl
|
|
1680
|
-
);
|
|
1681
|
-
|
|
1682
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1683
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1684
|
-
: iter.next().then(function(result) {
|
|
1685
|
-
return result.done ? result.value : iter.next();
|
|
1686
|
-
});
|
|
1687
|
-
};
|
|
1688
|
-
|
|
1689
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1690
|
-
var state = GenStateSuspendedStart;
|
|
1691
|
-
|
|
1692
|
-
return function invoke(method, arg) {
|
|
1693
|
-
if (state === GenStateExecuting) {
|
|
1694
|
-
throw new Error("Generator is already running");
|
|
1695
|
-
}
|
|
1696
|
-
|
|
1697
|
-
if (state === GenStateCompleted) {
|
|
1698
|
-
if (method === "throw") {
|
|
1699
|
-
throw arg;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1703
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1704
|
-
return doneResult();
|
|
1705
|
-
}
|
|
1706
|
-
|
|
1707
|
-
context.method = method;
|
|
1708
|
-
context.arg = arg;
|
|
1709
|
-
|
|
1710
|
-
while (true) {
|
|
1711
|
-
var delegate = context.delegate;
|
|
1712
|
-
if (delegate) {
|
|
1713
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1714
|
-
if (delegateResult) {
|
|
1715
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1716
|
-
return delegateResult;
|
|
1717
|
-
}
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
if (context.method === "next") {
|
|
1721
|
-
// Setting context._sent for legacy support of Babel's
|
|
1722
|
-
// function.sent implementation.
|
|
1723
|
-
context.sent = context._sent = context.arg;
|
|
1724
|
-
|
|
1725
|
-
} else if (context.method === "throw") {
|
|
1726
|
-
if (state === GenStateSuspendedStart) {
|
|
1727
|
-
state = GenStateCompleted;
|
|
1728
|
-
throw context.arg;
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
context.dispatchException(context.arg);
|
|
1732
|
-
|
|
1733
|
-
} else if (context.method === "return") {
|
|
1734
|
-
context.abrupt("return", context.arg);
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
state = GenStateExecuting;
|
|
1738
|
-
|
|
1739
|
-
var record = tryCatch(innerFn, self, context);
|
|
1740
|
-
if (record.type === "normal") {
|
|
1741
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1742
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1743
|
-
state = context.done
|
|
1744
|
-
? GenStateCompleted
|
|
1745
|
-
: GenStateSuspendedYield;
|
|
1746
|
-
|
|
1747
|
-
if (record.arg === ContinueSentinel) {
|
|
1748
|
-
continue;
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
return {
|
|
1752
|
-
value: record.arg,
|
|
1753
|
-
done: context.done
|
|
1754
|
-
};
|
|
1755
|
-
|
|
1756
|
-
} else if (record.type === "throw") {
|
|
1757
|
-
state = GenStateCompleted;
|
|
1758
|
-
// Dispatch the exception by looping back around to the
|
|
1759
|
-
// context.dispatchException(context.arg) call above.
|
|
1760
|
-
context.method = "throw";
|
|
1761
|
-
context.arg = record.arg;
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
};
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1768
|
-
// result, either by returning a { value, done } result from the
|
|
1769
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1770
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1771
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1772
|
-
var method = delegate.iterator[context.method];
|
|
1773
|
-
if (method === undefined$1) {
|
|
1774
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1775
|
-
// method always terminates the yield* loop.
|
|
1776
|
-
context.delegate = null;
|
|
1777
|
-
|
|
1778
|
-
if (context.method === "throw") {
|
|
1779
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1780
|
-
if (delegate.iterator["return"]) {
|
|
1781
|
-
// If the delegate iterator has a return method, give it a
|
|
1782
|
-
// chance to clean up.
|
|
1783
|
-
context.method = "return";
|
|
1784
|
-
context.arg = undefined$1;
|
|
1785
|
-
maybeInvokeDelegate(delegate, context);
|
|
1786
|
-
|
|
1787
|
-
if (context.method === "throw") {
|
|
1788
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1789
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1790
|
-
return ContinueSentinel;
|
|
1791
|
-
}
|
|
1792
|
-
}
|
|
1793
|
-
|
|
1794
|
-
context.method = "throw";
|
|
1795
|
-
context.arg = new TypeError(
|
|
1796
|
-
"The iterator does not provide a 'throw' method");
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
return ContinueSentinel;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1803
|
-
|
|
1804
|
-
if (record.type === "throw") {
|
|
1805
|
-
context.method = "throw";
|
|
1806
|
-
context.arg = record.arg;
|
|
1807
|
-
context.delegate = null;
|
|
1808
|
-
return ContinueSentinel;
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
var info = record.arg;
|
|
1812
|
-
|
|
1813
|
-
if (! info) {
|
|
1814
|
-
context.method = "throw";
|
|
1815
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1816
|
-
context.delegate = null;
|
|
1817
|
-
return ContinueSentinel;
|
|
1818
|
-
}
|
|
1819
|
-
|
|
1820
|
-
if (info.done) {
|
|
1821
|
-
// Assign the result of the finished delegate to the temporary
|
|
1822
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1823
|
-
context[delegate.resultName] = info.value;
|
|
1824
|
-
|
|
1825
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1826
|
-
context.next = delegate.nextLoc;
|
|
1827
|
-
|
|
1828
|
-
// If context.method was "throw" but the delegate handled the
|
|
1829
|
-
// exception, let the outer generator proceed normally. If
|
|
1830
|
-
// context.method was "next", forget context.arg since it has been
|
|
1831
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1832
|
-
// "return", allow the original .return call to continue in the
|
|
1833
|
-
// outer generator.
|
|
1834
|
-
if (context.method !== "return") {
|
|
1835
|
-
context.method = "next";
|
|
1836
|
-
context.arg = undefined$1;
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1839
|
-
} else {
|
|
1840
|
-
// Re-yield the result returned by the delegate method.
|
|
1841
|
-
return info;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1845
|
-
// the outer generator.
|
|
1846
|
-
context.delegate = null;
|
|
1847
|
-
return ContinueSentinel;
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1851
|
-
// unified ._invoke helper method.
|
|
1852
|
-
defineIteratorMethods(Gp);
|
|
1853
|
-
|
|
1854
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1855
|
-
|
|
1856
|
-
// A Generator should always return itself as the iterator object when the
|
|
1857
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1858
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1859
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1860
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1861
|
-
define(Gp, iteratorSymbol, function() {
|
|
1862
|
-
return this;
|
|
1863
|
-
});
|
|
1864
|
-
|
|
1865
|
-
define(Gp, "toString", function() {
|
|
1866
|
-
return "[object Generator]";
|
|
1867
|
-
});
|
|
1868
|
-
|
|
1869
|
-
function pushTryEntry(locs) {
|
|
1870
|
-
var entry = { tryLoc: locs[0] };
|
|
1871
|
-
|
|
1872
|
-
if (1 in locs) {
|
|
1873
|
-
entry.catchLoc = locs[1];
|
|
1874
|
-
}
|
|
1875
|
-
|
|
1876
|
-
if (2 in locs) {
|
|
1877
|
-
entry.finallyLoc = locs[2];
|
|
1878
|
-
entry.afterLoc = locs[3];
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
this.tryEntries.push(entry);
|
|
1882
|
-
}
|
|
1883
|
-
|
|
1884
|
-
function resetTryEntry(entry) {
|
|
1885
|
-
var record = entry.completion || {};
|
|
1886
|
-
record.type = "normal";
|
|
1887
|
-
delete record.arg;
|
|
1888
|
-
entry.completion = record;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
function Context(tryLocsList) {
|
|
1892
|
-
// The root entry object (effectively a try statement without a catch
|
|
1893
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1894
|
-
// locations where there is no enclosing try statement.
|
|
1895
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1896
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1897
|
-
this.reset(true);
|
|
1898
|
-
}
|
|
1899
|
-
|
|
1900
|
-
exports.keys = function(object) {
|
|
1901
|
-
var keys = [];
|
|
1902
|
-
for (var key in object) {
|
|
1903
|
-
keys.push(key);
|
|
1904
|
-
}
|
|
1905
|
-
keys.reverse();
|
|
1906
|
-
|
|
1907
|
-
// Rather than returning an object with a next method, we keep
|
|
1908
|
-
// things simple and return the next function itself.
|
|
1909
|
-
return function next() {
|
|
1910
|
-
while (keys.length) {
|
|
1911
|
-
var key = keys.pop();
|
|
1912
|
-
if (key in object) {
|
|
1913
|
-
next.value = key;
|
|
1914
|
-
next.done = false;
|
|
1915
|
-
return next;
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
|
|
1919
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1920
|
-
// and .done properties off the next function object itself. This
|
|
1921
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1922
|
-
next.done = true;
|
|
1923
|
-
return next;
|
|
1924
|
-
};
|
|
1925
|
-
};
|
|
1926
|
-
|
|
1927
|
-
function values(iterable) {
|
|
1928
|
-
if (iterable) {
|
|
1929
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1930
|
-
if (iteratorMethod) {
|
|
1931
|
-
return iteratorMethod.call(iterable);
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
if (typeof iterable.next === "function") {
|
|
1935
|
-
return iterable;
|
|
1936
|
-
}
|
|
1937
|
-
|
|
1938
|
-
if (!isNaN(iterable.length)) {
|
|
1939
|
-
var i = -1, next = function next() {
|
|
1940
|
-
while (++i < iterable.length) {
|
|
1941
|
-
if (hasOwn.call(iterable, i)) {
|
|
1942
|
-
next.value = iterable[i];
|
|
1943
|
-
next.done = false;
|
|
1944
|
-
return next;
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
|
|
1948
|
-
next.value = undefined$1;
|
|
1949
|
-
next.done = true;
|
|
1950
|
-
|
|
1951
|
-
return next;
|
|
1952
|
-
};
|
|
1953
|
-
|
|
1954
|
-
return next.next = next;
|
|
1955
|
-
}
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
// Return an iterator with no values.
|
|
1959
|
-
return { next: doneResult };
|
|
1960
|
-
}
|
|
1961
|
-
exports.values = values;
|
|
1962
|
-
|
|
1963
|
-
function doneResult() {
|
|
1964
|
-
return { value: undefined$1, done: true };
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
Context.prototype = {
|
|
1968
|
-
constructor: Context,
|
|
1969
|
-
|
|
1970
|
-
reset: function(skipTempReset) {
|
|
1971
|
-
this.prev = 0;
|
|
1972
|
-
this.next = 0;
|
|
1973
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1974
|
-
// function.sent implementation.
|
|
1975
|
-
this.sent = this._sent = undefined$1;
|
|
1976
|
-
this.done = false;
|
|
1977
|
-
this.delegate = null;
|
|
1978
|
-
|
|
1979
|
-
this.method = "next";
|
|
1980
|
-
this.arg = undefined$1;
|
|
1981
|
-
|
|
1982
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1983
|
-
|
|
1984
|
-
if (!skipTempReset) {
|
|
1985
|
-
for (var name in this) {
|
|
1986
|
-
// Not sure about the optimal order of these conditions:
|
|
1987
|
-
if (name.charAt(0) === "t" &&
|
|
1988
|
-
hasOwn.call(this, name) &&
|
|
1989
|
-
!isNaN(+name.slice(1))) {
|
|
1990
|
-
this[name] = undefined$1;
|
|
1991
|
-
}
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
},
|
|
1995
|
-
|
|
1996
|
-
stop: function() {
|
|
1997
|
-
this.done = true;
|
|
1998
|
-
|
|
1999
|
-
var rootEntry = this.tryEntries[0];
|
|
2000
|
-
var rootRecord = rootEntry.completion;
|
|
2001
|
-
if (rootRecord.type === "throw") {
|
|
2002
|
-
throw rootRecord.arg;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
return this.rval;
|
|
2006
|
-
},
|
|
2007
|
-
|
|
2008
|
-
dispatchException: function(exception) {
|
|
2009
|
-
if (this.done) {
|
|
2010
|
-
throw exception;
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
var context = this;
|
|
2014
|
-
function handle(loc, caught) {
|
|
2015
|
-
record.type = "throw";
|
|
2016
|
-
record.arg = exception;
|
|
2017
|
-
context.next = loc;
|
|
2018
|
-
|
|
2019
|
-
if (caught) {
|
|
2020
|
-
// If the dispatched exception was caught by a catch block,
|
|
2021
|
-
// then let that catch block handle the exception normally.
|
|
2022
|
-
context.method = "next";
|
|
2023
|
-
context.arg = undefined$1;
|
|
2024
|
-
}
|
|
2025
|
-
|
|
2026
|
-
return !! caught;
|
|
2027
|
-
}
|
|
2028
|
-
|
|
2029
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2030
|
-
var entry = this.tryEntries[i];
|
|
2031
|
-
var record = entry.completion;
|
|
2032
|
-
|
|
2033
|
-
if (entry.tryLoc === "root") {
|
|
2034
|
-
// Exception thrown outside of any try block that could handle
|
|
2035
|
-
// it, so set the completion value of the entire function to
|
|
2036
|
-
// throw the exception.
|
|
2037
|
-
return handle("end");
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
if (entry.tryLoc <= this.prev) {
|
|
2041
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
2042
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
2043
|
-
|
|
2044
|
-
if (hasCatch && hasFinally) {
|
|
2045
|
-
if (this.prev < entry.catchLoc) {
|
|
2046
|
-
return handle(entry.catchLoc, true);
|
|
2047
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
2048
|
-
return handle(entry.finallyLoc);
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
} else if (hasCatch) {
|
|
2052
|
-
if (this.prev < entry.catchLoc) {
|
|
2053
|
-
return handle(entry.catchLoc, true);
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
} else if (hasFinally) {
|
|
2057
|
-
if (this.prev < entry.finallyLoc) {
|
|
2058
|
-
return handle(entry.finallyLoc);
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
} else {
|
|
2062
|
-
throw new Error("try statement without catch or finally");
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
},
|
|
2067
|
-
|
|
2068
|
-
abrupt: function(type, arg) {
|
|
2069
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2070
|
-
var entry = this.tryEntries[i];
|
|
2071
|
-
if (entry.tryLoc <= this.prev &&
|
|
2072
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
2073
|
-
this.prev < entry.finallyLoc) {
|
|
2074
|
-
var finallyEntry = entry;
|
|
2075
|
-
break;
|
|
2076
|
-
}
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
if (finallyEntry &&
|
|
2080
|
-
(type === "break" ||
|
|
2081
|
-
type === "continue") &&
|
|
2082
|
-
finallyEntry.tryLoc <= arg &&
|
|
2083
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2084
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2085
|
-
// location outside the try/catch block.
|
|
2086
|
-
finallyEntry = null;
|
|
2087
|
-
}
|
|
2088
|
-
|
|
2089
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2090
|
-
record.type = type;
|
|
2091
|
-
record.arg = arg;
|
|
2092
|
-
|
|
2093
|
-
if (finallyEntry) {
|
|
2094
|
-
this.method = "next";
|
|
2095
|
-
this.next = finallyEntry.finallyLoc;
|
|
2096
|
-
return ContinueSentinel;
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
|
-
return this.complete(record);
|
|
2100
|
-
},
|
|
2101
|
-
|
|
2102
|
-
complete: function(record, afterLoc) {
|
|
2103
|
-
if (record.type === "throw") {
|
|
2104
|
-
throw record.arg;
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
if (record.type === "break" ||
|
|
2108
|
-
record.type === "continue") {
|
|
2109
|
-
this.next = record.arg;
|
|
2110
|
-
} else if (record.type === "return") {
|
|
2111
|
-
this.rval = this.arg = record.arg;
|
|
2112
|
-
this.method = "return";
|
|
2113
|
-
this.next = "end";
|
|
2114
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2115
|
-
this.next = afterLoc;
|
|
2116
|
-
}
|
|
2117
|
-
|
|
2118
|
-
return ContinueSentinel;
|
|
2119
|
-
},
|
|
2120
|
-
|
|
2121
|
-
finish: function(finallyLoc) {
|
|
2122
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2123
|
-
var entry = this.tryEntries[i];
|
|
2124
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2125
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2126
|
-
resetTryEntry(entry);
|
|
2127
|
-
return ContinueSentinel;
|
|
2128
|
-
}
|
|
2129
|
-
}
|
|
2130
|
-
},
|
|
2131
|
-
|
|
2132
|
-
"catch": function(tryLoc) {
|
|
2133
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2134
|
-
var entry = this.tryEntries[i];
|
|
2135
|
-
if (entry.tryLoc === tryLoc) {
|
|
2136
|
-
var record = entry.completion;
|
|
2137
|
-
if (record.type === "throw") {
|
|
2138
|
-
var thrown = record.arg;
|
|
2139
|
-
resetTryEntry(entry);
|
|
2140
|
-
}
|
|
2141
|
-
return thrown;
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
// The context.catch method must only be called with a location
|
|
2146
|
-
// argument that corresponds to a known catch block.
|
|
2147
|
-
throw new Error("illegal catch attempt");
|
|
2148
|
-
},
|
|
2149
|
-
|
|
2150
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2151
|
-
this.delegate = {
|
|
2152
|
-
iterator: values(iterable),
|
|
2153
|
-
resultName: resultName,
|
|
2154
|
-
nextLoc: nextLoc
|
|
2155
|
-
};
|
|
2156
|
-
|
|
2157
|
-
if (this.method === "next") {
|
|
2158
|
-
// Deliberately forget the last sent value so that we don't
|
|
2159
|
-
// accidentally pass it on to the delegate.
|
|
2160
|
-
this.arg = undefined$1;
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
return ContinueSentinel;
|
|
2164
|
-
}
|
|
2165
|
-
};
|
|
2166
|
-
|
|
2167
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
2168
|
-
// or not, return the runtime object so that we can declare the variable
|
|
2169
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
2170
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
2171
|
-
return exports;
|
|
2172
|
-
|
|
2173
|
-
}(
|
|
2174
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
2175
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
2176
|
-
// object. Either way, the resulting object will be used to initialize
|
|
2177
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
2178
|
-
module.exports
|
|
2179
|
-
));
|
|
2180
|
-
|
|
2181
|
-
try {
|
|
2182
|
-
regeneratorRuntime = runtime;
|
|
2183
|
-
} catch (accidentalStrictMode) {
|
|
2184
|
-
// This module should not be running in strict mode, so the above
|
|
2185
|
-
// assignment should always work unless something is misconfigured. Just
|
|
2186
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
2187
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
2188
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
2189
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
2190
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
2191
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
2192
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
2193
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
2194
|
-
if (typeof globalThis === "object") {
|
|
2195
|
-
globalThis.regeneratorRuntime = runtime;
|
|
2196
|
-
} else {
|
|
2197
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
});
|
|
2201
|
-
|
|
2202
|
-
/**
|
|
2203
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
2204
|
-
* iteratee shorthands.
|
|
2205
|
-
*
|
|
2206
|
-
* @private
|
|
2207
|
-
* @param {Array} [array] The array to iterate over.
|
|
2208
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2209
|
-
* @param {*} [accumulator] The initial value.
|
|
2210
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
2211
|
-
* the initial value.
|
|
2212
|
-
* @returns {*} Returns the accumulated value.
|
|
2213
|
-
*/
|
|
2214
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2215
|
-
var index = -1,
|
|
2216
|
-
length = array == null ? 0 : array.length;
|
|
2217
|
-
|
|
2218
|
-
if (initAccum && length) {
|
|
2219
|
-
accumulator = array[++index];
|
|
2220
|
-
}
|
|
2221
|
-
while (++index < length) {
|
|
2222
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2223
|
-
}
|
|
2224
|
-
return accumulator;
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
var _arrayReduce = arrayReduce;
|
|
2228
|
-
|
|
2229
|
-
/**
|
|
2230
|
-
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
2231
|
-
*
|
|
2232
|
-
* @private
|
|
2233
|
-
* @param {Object} object The object to query.
|
|
2234
|
-
* @returns {Function} Returns the new accessor function.
|
|
2235
|
-
*/
|
|
2236
|
-
function basePropertyOf(object) {
|
|
2237
|
-
return function(key) {
|
|
2238
|
-
return object == null ? undefined : object[key];
|
|
2239
|
-
};
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
var _basePropertyOf = basePropertyOf;
|
|
2243
|
-
|
|
2244
|
-
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
2245
|
-
var deburredLetters = {
|
|
2246
|
-
// Latin-1 Supplement block.
|
|
2247
|
-
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
2248
|
-
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
2249
|
-
'\xc7': 'C', '\xe7': 'c',
|
|
2250
|
-
'\xd0': 'D', '\xf0': 'd',
|
|
2251
|
-
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
2252
|
-
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
2253
|
-
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
2254
|
-
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
2255
|
-
'\xd1': 'N', '\xf1': 'n',
|
|
2256
|
-
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
2257
|
-
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
2258
|
-
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
2259
|
-
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
2260
|
-
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
2261
|
-
'\xc6': 'Ae', '\xe6': 'ae',
|
|
2262
|
-
'\xde': 'Th', '\xfe': 'th',
|
|
2263
|
-
'\xdf': 'ss',
|
|
2264
|
-
// Latin Extended-A block.
|
|
2265
|
-
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
2266
|
-
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
2267
|
-
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
2268
|
-
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
2269
|
-
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
2270
|
-
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
2271
|
-
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
2272
|
-
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
2273
|
-
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
2274
|
-
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
2275
|
-
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
2276
|
-
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
2277
|
-
'\u0134': 'J', '\u0135': 'j',
|
|
2278
|
-
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
2279
|
-
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
2280
|
-
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
2281
|
-
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
2282
|
-
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
2283
|
-
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
2284
|
-
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
2285
|
-
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
2286
|
-
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
2287
|
-
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
2288
|
-
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
2289
|
-
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
2290
|
-
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
2291
|
-
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
2292
|
-
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
2293
|
-
'\u0174': 'W', '\u0175': 'w',
|
|
2294
|
-
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
2295
|
-
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
2296
|
-
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
2297
|
-
'\u0132': 'IJ', '\u0133': 'ij',
|
|
2298
|
-
'\u0152': 'Oe', '\u0153': 'oe',
|
|
2299
|
-
'\u0149': "'n", '\u017f': 's'
|
|
2300
|
-
};
|
|
2301
|
-
|
|
2302
|
-
/**
|
|
2303
|
-
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
2304
|
-
* letters to basic Latin letters.
|
|
2305
|
-
*
|
|
2306
|
-
* @private
|
|
2307
|
-
* @param {string} letter The matched letter to deburr.
|
|
2308
|
-
* @returns {string} Returns the deburred letter.
|
|
2309
|
-
*/
|
|
2310
|
-
var deburrLetter = _basePropertyOf(deburredLetters);
|
|
2311
|
-
|
|
2312
|
-
var _deburrLetter = deburrLetter;
|
|
2313
|
-
|
|
2314
|
-
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
2315
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
2316
|
-
|
|
2317
|
-
/** Used to compose unicode character classes. */
|
|
2318
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f',
|
|
2319
|
-
reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
|
|
2320
|
-
rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
|
|
2321
|
-
rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
2322
|
-
|
|
2323
|
-
/** Used to compose unicode capture groups. */
|
|
2324
|
-
var rsCombo$1 = '[' + rsComboRange$1 + ']';
|
|
2325
|
-
|
|
2326
|
-
/**
|
|
2327
|
-
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
2328
|
-
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
2329
|
-
*/
|
|
2330
|
-
var reComboMark = RegExp(rsCombo$1, 'g');
|
|
2331
|
-
|
|
2332
|
-
/**
|
|
2333
|
-
* Deburrs `string` by converting
|
|
2334
|
-
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
2335
|
-
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
2336
|
-
* letters to basic Latin letters and removing
|
|
2337
|
-
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
2338
|
-
*
|
|
2339
|
-
* @static
|
|
2340
|
-
* @memberOf _
|
|
2341
|
-
* @since 3.0.0
|
|
2342
|
-
* @category String
|
|
2343
|
-
* @param {string} [string=''] The string to deburr.
|
|
2344
|
-
* @returns {string} Returns the deburred string.
|
|
2345
|
-
* @example
|
|
2346
|
-
*
|
|
2347
|
-
* _.deburr('déjà vu');
|
|
2348
|
-
* // => 'deja vu'
|
|
2349
|
-
*/
|
|
2350
|
-
function deburr(string) {
|
|
2351
|
-
string = toString_1(string);
|
|
2352
|
-
return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
var deburr_1 = deburr;
|
|
2356
|
-
|
|
2357
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
2358
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
2359
|
-
|
|
2360
|
-
/**
|
|
2361
|
-
* Splits an ASCII `string` into an array of its words.
|
|
2362
|
-
*
|
|
2363
|
-
* @private
|
|
2364
|
-
* @param {string} The string to inspect.
|
|
2365
|
-
* @returns {Array} Returns the words of `string`.
|
|
2366
|
-
*/
|
|
2367
|
-
function asciiWords(string) {
|
|
2368
|
-
return string.match(reAsciiWord) || [];
|
|
2369
|
-
}
|
|
2370
|
-
|
|
2371
|
-
var _asciiWords = asciiWords;
|
|
2372
|
-
|
|
2373
|
-
/** Used to detect strings that need a more robust regexp to match words. */
|
|
2374
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
2375
|
-
|
|
2376
|
-
/**
|
|
2377
|
-
* Checks if `string` contains a word composed of Unicode symbols.
|
|
2378
|
-
*
|
|
2379
|
-
* @private
|
|
2380
|
-
* @param {string} string The string to inspect.
|
|
2381
|
-
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
2382
|
-
*/
|
|
2383
|
-
function hasUnicodeWord(string) {
|
|
2384
|
-
return reHasUnicodeWord.test(string);
|
|
2385
|
-
}
|
|
2386
|
-
|
|
2387
|
-
var _hasUnicodeWord = hasUnicodeWord;
|
|
2388
|
-
|
|
2389
|
-
/** Used to compose unicode character classes. */
|
|
2390
|
-
var rsAstralRange = '\\ud800-\\udfff',
|
|
2391
|
-
rsComboMarksRange = '\\u0300-\\u036f',
|
|
2392
|
-
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
|
2393
|
-
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
|
2394
|
-
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
|
2395
|
-
rsDingbatRange = '\\u2700-\\u27bf',
|
|
2396
|
-
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
2397
|
-
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
2398
|
-
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
2399
|
-
rsPunctuationRange = '\\u2000-\\u206f',
|
|
2400
|
-
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
|
2401
|
-
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
2402
|
-
rsVarRange = '\\ufe0e\\ufe0f',
|
|
2403
|
-
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
2404
|
-
|
|
2405
|
-
/** Used to compose unicode capture groups. */
|
|
2406
|
-
var rsApos$1 = "['\u2019]",
|
|
2407
|
-
rsBreak = '[' + rsBreakRange + ']',
|
|
2408
|
-
rsCombo = '[' + rsComboRange + ']',
|
|
2409
|
-
rsDigits = '\\d+',
|
|
2410
|
-
rsDingbat = '[' + rsDingbatRange + ']',
|
|
2411
|
-
rsLower = '[' + rsLowerRange + ']',
|
|
2412
|
-
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
2413
|
-
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
2414
|
-
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
2415
|
-
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
2416
|
-
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
2417
|
-
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
2418
|
-
rsUpper = '[' + rsUpperRange + ']',
|
|
2419
|
-
rsZWJ = '\\u200d';
|
|
2420
|
-
|
|
2421
|
-
/** Used to compose unicode regexes. */
|
|
2422
|
-
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
2423
|
-
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
2424
|
-
rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
|
|
2425
|
-
rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
|
|
2426
|
-
reOptMod = rsModifier + '?',
|
|
2427
|
-
rsOptVar = '[' + rsVarRange + ']?',
|
|
2428
|
-
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
2429
|
-
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
|
2430
|
-
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
|
2431
|
-
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
2432
|
-
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
2433
|
-
|
|
2434
|
-
/** Used to match complex or compound words. */
|
|
2435
|
-
var reUnicodeWord = RegExp([
|
|
2436
|
-
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
2437
|
-
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
|
|
2438
|
-
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
|
|
2439
|
-
rsUpper + '+' + rsOptContrUpper,
|
|
2440
|
-
rsOrdUpper,
|
|
2441
|
-
rsOrdLower,
|
|
2442
|
-
rsDigits,
|
|
2443
|
-
rsEmoji
|
|
2444
|
-
].join('|'), 'g');
|
|
2445
|
-
|
|
2446
|
-
/**
|
|
2447
|
-
* Splits a Unicode `string` into an array of its words.
|
|
2448
|
-
*
|
|
2449
|
-
* @private
|
|
2450
|
-
* @param {string} The string to inspect.
|
|
2451
|
-
* @returns {Array} Returns the words of `string`.
|
|
2452
|
-
*/
|
|
2453
|
-
function unicodeWords(string) {
|
|
2454
|
-
return string.match(reUnicodeWord) || [];
|
|
2455
|
-
}
|
|
2456
|
-
|
|
2457
|
-
var _unicodeWords = unicodeWords;
|
|
2458
|
-
|
|
2459
|
-
/**
|
|
2460
|
-
* Splits `string` into an array of its words.
|
|
2461
|
-
*
|
|
2462
|
-
* @static
|
|
2463
|
-
* @memberOf _
|
|
2464
|
-
* @since 3.0.0
|
|
2465
|
-
* @category String
|
|
2466
|
-
* @param {string} [string=''] The string to inspect.
|
|
2467
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
2468
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2469
|
-
* @returns {Array} Returns the words of `string`.
|
|
2470
|
-
* @example
|
|
2471
|
-
*
|
|
2472
|
-
* _.words('fred, barney, & pebbles');
|
|
2473
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
2474
|
-
*
|
|
2475
|
-
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
2476
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
2477
|
-
*/
|
|
2478
|
-
function words(string, pattern, guard) {
|
|
2479
|
-
string = toString_1(string);
|
|
2480
|
-
pattern = guard ? undefined : pattern;
|
|
2481
|
-
|
|
2482
|
-
if (pattern === undefined) {
|
|
2483
|
-
return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
|
2484
|
-
}
|
|
2485
|
-
return string.match(pattern) || [];
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
var words_1 = words;
|
|
2489
|
-
|
|
2490
|
-
/** Used to compose unicode capture groups. */
|
|
2491
|
-
var rsApos = "['\u2019]";
|
|
2492
|
-
|
|
2493
|
-
/** Used to match apostrophes. */
|
|
2494
|
-
var reApos = RegExp(rsApos, 'g');
|
|
2495
|
-
|
|
2496
|
-
/**
|
|
2497
|
-
* Creates a function like `_.camelCase`.
|
|
2498
|
-
*
|
|
2499
|
-
* @private
|
|
2500
|
-
* @param {Function} callback The function to combine each word.
|
|
2501
|
-
* @returns {Function} Returns the new compounder function.
|
|
2502
|
-
*/
|
|
2503
|
-
function createCompounder(callback) {
|
|
2504
|
-
return function(string) {
|
|
2505
|
-
return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
|
2506
|
-
};
|
|
2507
|
-
}
|
|
2508
|
-
|
|
2509
|
-
var _createCompounder = createCompounder;
|
|
2510
|
-
|
|
2511
|
-
/**
|
|
2512
|
-
* Converts `string`, as space separated words, to upper case.
|
|
2513
|
-
*
|
|
2514
|
-
* @static
|
|
2515
|
-
* @memberOf _
|
|
2516
|
-
* @since 4.0.0
|
|
2517
|
-
* @category String
|
|
2518
|
-
* @param {string} [string=''] The string to convert.
|
|
2519
|
-
* @returns {string} Returns the upper cased string.
|
|
2520
|
-
* @example
|
|
2521
|
-
*
|
|
2522
|
-
* _.upperCase('--foo-bar');
|
|
2523
|
-
* // => 'FOO BAR'
|
|
2524
|
-
*
|
|
2525
|
-
* _.upperCase('fooBar');
|
|
2526
|
-
* // => 'FOO BAR'
|
|
2527
|
-
*
|
|
2528
|
-
* _.upperCase('__foo_bar__');
|
|
2529
|
-
* // => 'FOO BAR'
|
|
2530
|
-
*/
|
|
2531
|
-
var upperCase = _createCompounder(function(result, word, index) {
|
|
2532
|
-
return result + (index ? ' ' : '') + word.toUpperCase();
|
|
2533
|
-
});
|
|
2534
|
-
|
|
2535
|
-
var upperCase_1 = upperCase;
|
|
2536
|
-
|
|
2537
|
-
/**
|
|
2538
|
-
* Converts `string`, as space separated words, to lower case.
|
|
2539
|
-
*
|
|
2540
|
-
* @static
|
|
2541
|
-
* @memberOf _
|
|
2542
|
-
* @since 4.0.0
|
|
2543
|
-
* @category String
|
|
2544
|
-
* @param {string} [string=''] The string to convert.
|
|
2545
|
-
* @returns {string} Returns the lower cased string.
|
|
2546
|
-
* @example
|
|
2547
|
-
*
|
|
2548
|
-
* _.lowerCase('--Foo-Bar--');
|
|
2549
|
-
* // => 'foo bar'
|
|
2550
|
-
*
|
|
2551
|
-
* _.lowerCase('fooBar');
|
|
2552
|
-
* // => 'foo bar'
|
|
2553
|
-
*
|
|
2554
|
-
* _.lowerCase('__FOO_BAR__');
|
|
2555
|
-
* // => 'foo bar'
|
|
2556
|
-
*/
|
|
2557
|
-
var lowerCase = _createCompounder(function(result, word, index) {
|
|
2558
|
-
return result + (index ? ' ' : '') + word.toLowerCase();
|
|
2559
|
-
});
|
|
2560
|
-
|
|
2561
|
-
var lowerCase_1 = lowerCase;
|
|
2562
|
-
|
|
2563
50
|
var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
|
|
2564
51
|
var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
2565
52
|
var _config$showTime = config.showTime,
|
|
@@ -2579,7 +66,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2579
66
|
var localizedMonth = month;
|
|
2580
67
|
|
|
2581
68
|
if (isUpperCase) {
|
|
2582
|
-
localizedMonth =
|
|
69
|
+
localizedMonth = lodash.upperCase(month);
|
|
2583
70
|
}
|
|
2584
71
|
|
|
2585
72
|
var year = dateTime.getFullYear();
|
|
@@ -2592,7 +79,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2592
79
|
var timetoShow;
|
|
2593
80
|
|
|
2594
81
|
if (localizedMonths) {
|
|
2595
|
-
localizedMonth =
|
|
82
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2596
83
|
}
|
|
2597
84
|
|
|
2598
85
|
if (localizedMeridiem) {
|
|
@@ -2622,17 +109,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2622
109
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2623
110
|
// unit here refers to seconds, minute, minutes,...
|
|
2624
111
|
|
|
2625
|
-
var localizedSuffix =
|
|
112
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2626
113
|
var localizedUnitOfTime;
|
|
2627
114
|
|
|
2628
115
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2629
116
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2630
117
|
} else if (value > 1) {
|
|
2631
|
-
localizedUnitOfTime =
|
|
118
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2632
119
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2633
120
|
}
|
|
2634
121
|
|
|
2635
|
-
localizedUnitOfTime =
|
|
122
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2636
123
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2637
124
|
}
|
|
2638
125
|
|
|
@@ -2685,10 +172,10 @@ var clientWidths = {
|
|
|
2685
172
|
tablet: 1024
|
|
2686
173
|
};
|
|
2687
174
|
var clientWidth = function clientWidth(device) {
|
|
2688
|
-
var foundDeviceWidth =
|
|
175
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2689
176
|
|
|
2690
177
|
if (foundDeviceWidth) {
|
|
2691
|
-
return
|
|
178
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2692
179
|
}
|
|
2693
180
|
|
|
2694
181
|
return false;
|
|
@@ -2730,7 +217,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2730
217
|
var isSection = collection.template === "section";
|
|
2731
218
|
|
|
2732
219
|
if (isSection) {
|
|
2733
|
-
var sectionId =
|
|
220
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2734
221
|
var sections = config.sections;
|
|
2735
222
|
var section = sections && sections.find(function (section) {
|
|
2736
223
|
return section.id === sectionId;
|
|
@@ -2746,7 +233,7 @@ function isExternalStory() {
|
|
|
2746
233
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2747
234
|
_story$metadata = story.metadata,
|
|
2748
235
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2749
|
-
return storyTemplate === "news-elsewhere" ?
|
|
236
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2750
237
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2751
238
|
PropTypes__default["default"].shape({
|
|
2752
239
|
"sketches-host": PropTypes__default["default"].string,
|
|
@@ -2760,7 +247,7 @@ PropTypes__default["default"].shape({
|
|
|
2760
247
|
});
|
|
2761
248
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2762
249
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2763
|
-
return
|
|
250
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2764
251
|
};
|
|
2765
252
|
var navigateTo = function navigateTo(dispatch) {
|
|
2766
253
|
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -2975,7 +462,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2975
462
|
return null;
|
|
2976
463
|
} : _config$StoryTemplate;
|
|
2977
464
|
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
2978
|
-
return
|
|
465
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
2979
466
|
});
|
|
2980
467
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
2981
468
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -2984,7 +471,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2984
471
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
2985
472
|
|
|
2986
473
|
var getPadding = function getPadding(aspectRatio) {
|
|
2987
|
-
var _aspectRatio =
|
|
474
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
2988
475
|
height = _aspectRatio[0],
|
|
2989
476
|
width = _aspectRatio[1];
|
|
2990
477
|
|
|
@@ -2996,7 +483,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
2996
483
|
return 0;
|
|
2997
484
|
};
|
|
2998
485
|
|
|
2999
|
-
var _aspectRatio2 =
|
|
486
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3000
487
|
mobileAspectRatio = _aspectRatio2[0],
|
|
3001
488
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
3002
489
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -3004,8 +491,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3004
491
|
var isMobile = clientWidth("mobile");
|
|
3005
492
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
3006
493
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
3007
|
-
var slug =
|
|
3008
|
-
var hyperLink =
|
|
494
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
495
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
3009
496
|
|
|
3010
497
|
var fallbackImage = function fallbackImage() {
|
|
3011
498
|
if (!slug) {
|
|
@@ -3014,7 +501,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3014
501
|
style: {
|
|
3015
502
|
paddingTop: imagePadding + "%"
|
|
3016
503
|
},
|
|
3017
|
-
className: "arr--responsive-hero-image " +
|
|
504
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
3018
505
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3019
506
|
className: "qt-image",
|
|
3020
507
|
"data-src": "".concat(fallbackImageUrl),
|
|
@@ -3027,7 +514,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3027
514
|
style: {
|
|
3028
515
|
paddingTop: imagePadding + "%"
|
|
3029
516
|
},
|
|
3030
|
-
className: "arr--fallback-hero-image " +
|
|
517
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
3031
518
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3032
519
|
storyTemplate: story["story-template"]
|
|
3033
520
|
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
@@ -3037,7 +524,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3037
524
|
style: {
|
|
3038
525
|
paddingTop: imagePadding + "%"
|
|
3039
526
|
},
|
|
3040
|
-
className: "arr--responsive-hero-image " +
|
|
527
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$b)
|
|
3041
528
|
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3042
529
|
storyTemplate: story["story-template"]
|
|
3043
530
|
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
@@ -3056,13 +543,13 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3056
543
|
|
|
3057
544
|
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3058
545
|
"data-test-id": "arr--hero-image",
|
|
3059
|
-
className: "arr--hero-image " +
|
|
546
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
3060
547
|
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3061
548
|
"data-test-id": "arr--hero-image",
|
|
3062
549
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3063
550
|
externalLink: isExternalStory(story),
|
|
3064
551
|
"aria-label": "fallback-hero-image",
|
|
3065
|
-
className: "arr--hero-image " +
|
|
552
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$b)
|
|
3066
553
|
}, fallbackImage()));
|
|
3067
554
|
};
|
|
3068
555
|
HeroImage.propTypes = {
|
|
@@ -3105,21 +592,6 @@ HeroImage.defaultProps = {
|
|
|
3105
592
|
config: {}
|
|
3106
593
|
};
|
|
3107
594
|
|
|
3108
|
-
function _defineProperty(obj, key, value) {
|
|
3109
|
-
if (key in obj) {
|
|
3110
|
-
Object.defineProperty(obj, key, {
|
|
3111
|
-
value: value,
|
|
3112
|
-
enumerable: true,
|
|
3113
|
-
configurable: true,
|
|
3114
|
-
writable: true
|
|
3115
|
-
});
|
|
3116
|
-
} else {
|
|
3117
|
-
obj[key] = value;
|
|
3118
|
-
}
|
|
3119
|
-
|
|
3120
|
-
return obj;
|
|
3121
|
-
}
|
|
3122
|
-
|
|
3123
595
|
var _styleModuleImportMap$a = {
|
|
3124
596
|
"./load-more.m.css": {
|
|
3125
597
|
"button": "load-more-m_button__1mmf1",
|
|
@@ -3131,7 +603,7 @@ var _styleModuleImportMap$a = {
|
|
|
3131
603
|
|
|
3132
604
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3133
605
|
|
|
3134
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
606
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3135
607
|
var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
3136
608
|
var _ref$config = _ref.config,
|
|
3137
609
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
@@ -3155,14 +627,14 @@ var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
|
3155
627
|
return template === "SubsequentLoadCount" ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3156
628
|
onClick: onClick,
|
|
3157
629
|
"data-test-id": "load-more",
|
|
3158
|
-
className: "arr--button " +
|
|
630
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$a)
|
|
3159
631
|
}, buttonText) : /*#__PURE__*/React__default["default"].createElement(components.LinkBase, {
|
|
3160
632
|
href: slug,
|
|
3161
633
|
navigateTo: navigate,
|
|
3162
634
|
"data-test-id": "load-more",
|
|
3163
635
|
"aria-label": "load-more"
|
|
3164
636
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3165
|
-
className: "arr--button " +
|
|
637
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$a)
|
|
3166
638
|
}, buttonText));
|
|
3167
639
|
};
|
|
3168
640
|
LoadmoreButton.propTypes = {
|
|
@@ -3199,7 +671,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3199
671
|
_ref$navigate = _ref.navigate,
|
|
3200
672
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
3201
673
|
var collectionTitle = useStateValue() || {};
|
|
3202
|
-
var showRowTitle =
|
|
674
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
3203
675
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
3204
676
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
3205
677
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -3275,7 +747,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
3275
747
|
borderBottom: borderBottomFullStyle
|
|
3276
748
|
},
|
|
3277
749
|
"data-test-id": "collection-name",
|
|
3278
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
750
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$9)
|
|
3279
751
|
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3280
752
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
3281
753
|
style: {
|
|
@@ -3312,7 +784,7 @@ CollectionNameBase.defaultProps = {
|
|
|
3312
784
|
|
|
3313
785
|
function mapStateToProps$1(state) {
|
|
3314
786
|
return {
|
|
3315
|
-
config:
|
|
787
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3316
788
|
};
|
|
3317
789
|
}
|
|
3318
790
|
|
|
@@ -3552,8 +1024,8 @@ var Headline = function Headline(_ref) {
|
|
|
3552
1024
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
3553
1025
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
3554
1026
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
3555
|
-
var alternateHeadline =
|
|
3556
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
1027
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
1028
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
3557
1029
|
var headline = alternateHeadline || story.headline;
|
|
3558
1030
|
var HeaderTag = "h" + headerLevel;
|
|
3559
1031
|
|
|
@@ -3579,10 +1051,10 @@ var Headline = function Headline(_ref) {
|
|
|
3579
1051
|
var textColor = getTextColor(configData.theme);
|
|
3580
1052
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
3581
1053
|
var iconSize = "24px";
|
|
3582
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
1054
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
3583
1055
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3584
1056
|
"data-test-id": "headline",
|
|
3585
|
-
className: "arrow-component arr--headline " +
|
|
1057
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$8)
|
|
3586
1058
|
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
3587
1059
|
width: iconSize,
|
|
3588
1060
|
height: iconSize,
|
|
@@ -3594,9 +1066,9 @@ var Headline = function Headline(_ref) {
|
|
|
3594
1066
|
externalLink: isExternalStory(story),
|
|
3595
1067
|
"aria-label": "headline"
|
|
3596
1068
|
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3597
|
-
className:
|
|
1069
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$8)
|
|
3598
1070
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
3599
|
-
className:
|
|
1071
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$8)
|
|
3600
1072
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
3601
1073
|
};
|
|
3602
1074
|
Headline.propTypes = {
|
|
@@ -3637,9 +1109,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3637
1109
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3638
1110
|
isLightTheme = _ref.isLightTheme;
|
|
3639
1111
|
var config = useStateValue() || {};
|
|
3640
|
-
var isSection =
|
|
3641
|
-
var templateFromRowContext =
|
|
3642
|
-
var section =
|
|
1112
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
1113
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
1114
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3643
1115
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3644
1116
|
var getUrl = section ? section["section-url"] : "/";
|
|
3645
1117
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3661,7 +1133,7 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3661
1133
|
style: {
|
|
3662
1134
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3663
1135
|
},
|
|
3664
|
-
className: "section-tag arrow-component " +
|
|
1136
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$7)
|
|
3665
1137
|
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3666
1138
|
className: "section-m_border-left__2oUyp",
|
|
3667
1139
|
style: {
|
|
@@ -3704,13 +1176,13 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3704
1176
|
_ref$config = _ref.config,
|
|
3705
1177
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3706
1178
|
var configState = useStateValue() || {};
|
|
3707
|
-
var isTime =
|
|
1179
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3708
1180
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3709
1181
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3710
1182
|
var textColor = getTextColor(configState.theme);
|
|
3711
1183
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3712
1184
|
"data-test-id": "publish-time",
|
|
3713
|
-
className: "time arr--publish-time " +
|
|
1185
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$6)
|
|
3714
1186
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3715
1187
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3716
1188
|
}, getTimeStamp(time, formatter, config))));
|
|
@@ -3745,9 +1217,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3745
1217
|
_ref$config = _ref.config,
|
|
3746
1218
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3747
1219
|
var configData = useStateValue() || {};
|
|
3748
|
-
var isAuthor =
|
|
1220
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3749
1221
|
|
|
3750
|
-
var _get =
|
|
1222
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3751
1223
|
avatarUrl = _get["avatar-url"],
|
|
3752
1224
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3753
1225
|
authorName = _get.name,
|
|
@@ -3755,7 +1227,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3755
1227
|
|
|
3756
1228
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3757
1229
|
var textColor = getTextColor(configData.theme);
|
|
3758
|
-
var mountAt =
|
|
1230
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3759
1231
|
|
|
3760
1232
|
var authorImage = function authorImage(dir) {
|
|
3761
1233
|
if (!avatarUrl && !avatarS3Key) {
|
|
@@ -3764,7 +1236,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3764
1236
|
|
|
3765
1237
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3766
1238
|
"data-test-id": "author-image",
|
|
3767
|
-
className:
|
|
1239
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$5)
|
|
3768
1240
|
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3769
1241
|
slug: avatarS3Key,
|
|
3770
1242
|
"aspect-ratio": [1, 1],
|
|
@@ -3781,7 +1253,7 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3781
1253
|
var isPrefix = function isPrefix(dir) {
|
|
3782
1254
|
if (prefix) {
|
|
3783
1255
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3784
|
-
className: "arr-author-prefix " +
|
|
1256
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$5)
|
|
3785
1257
|
}, prefix);
|
|
3786
1258
|
}
|
|
3787
1259
|
|
|
@@ -3791,16 +1263,16 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3791
1263
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3792
1264
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3793
1265
|
"aria-label": "author-name",
|
|
3794
|
-
className: "author-name arr-author-name arrow-component " +
|
|
1266
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$5)
|
|
3795
1267
|
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3796
1268
|
"data-test-id": "author-name",
|
|
3797
|
-
className: "author-name " +
|
|
1269
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$5)
|
|
3798
1270
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3799
1271
|
};
|
|
3800
1272
|
|
|
3801
1273
|
function mapStateToProps(state) {
|
|
3802
1274
|
return {
|
|
3803
|
-
config:
|
|
1275
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3804
1276
|
};
|
|
3805
1277
|
}
|
|
3806
1278
|
|
|
@@ -3837,7 +1309,7 @@ var Dot = function Dot(_ref) {
|
|
|
3837
1309
|
_ref$color = _ref.color,
|
|
3838
1310
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3839
1311
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3840
|
-
className:
|
|
1312
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$4)
|
|
3841
1313
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3842
1314
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3843
1315
|
width: width,
|
|
@@ -3873,7 +1345,7 @@ var Divider = function Divider(_ref) {
|
|
|
3873
1345
|
_ref$color = _ref.color,
|
|
3874
1346
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3875
1347
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3876
|
-
className:
|
|
1348
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$3)
|
|
3877
1349
|
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3878
1350
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3879
1351
|
width: width,
|
|
@@ -3905,14 +1377,14 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3905
1377
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3906
1378
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3907
1379
|
var config = useStateValue() || {};
|
|
3908
|
-
var showReadTime =
|
|
3909
|
-
var readTime =
|
|
1380
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
1381
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3910
1382
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3911
1383
|
if (!showReadTime || !readTime) return null;
|
|
3912
|
-
var timeToRead =
|
|
1384
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
3913
1385
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3914
1386
|
"data-test-id": "read-time",
|
|
3915
|
-
className: "arrow-component arr--read-time " +
|
|
1387
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$2)
|
|
3916
1388
|
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3917
1389
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3918
1390
|
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
@@ -3948,9 +1420,9 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3948
1420
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3949
1421
|
isLightTheme = _ref.isLightTheme;
|
|
3950
1422
|
var configState = useStateValue() || {};
|
|
3951
|
-
var isAuthor =
|
|
3952
|
-
var isTime =
|
|
3953
|
-
var isReadTime =
|
|
1423
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
1424
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
1425
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3954
1426
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3955
1427
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3956
1428
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
@@ -3970,7 +1442,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3970
1442
|
var getTimeStamp = function getTimeStamp() {
|
|
3971
1443
|
if (!isTime) return null;
|
|
3972
1444
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3973
|
-
className: "arr-separator " +
|
|
1445
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$1)
|
|
3974
1446
|
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3975
1447
|
story: story,
|
|
3976
1448
|
config: config
|
|
@@ -3982,7 +1454,7 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3982
1454
|
};
|
|
3983
1455
|
|
|
3984
1456
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3985
|
-
className: "arr--author-time " +
|
|
1457
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$1)
|
|
3986
1458
|
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3987
1459
|
story: story,
|
|
3988
1460
|
isBottom: true,
|
|
@@ -4040,7 +1512,7 @@ var StorycardContent = function StorycardContent(_ref) {
|
|
|
4040
1512
|
backgroundColor: theme,
|
|
4041
1513
|
color: textColor
|
|
4042
1514
|
},
|
|
4043
|
-
className: "arr--content-wrapper " +
|
|
1515
|
+
className: "arr--content-wrapper " + _getClassName__default["default"]("wrapper ".concat(borderTemplate, " ").concat(horizontalCard), _styleModuleImportMap)
|
|
4044
1516
|
}, children || /*#__PURE__*/React__default["default"].createElement(DefaultStoryCardContent, {
|
|
4045
1517
|
story: story,
|
|
4046
1518
|
headerLevel: headerLevel,
|
|
@@ -4135,7 +1607,7 @@ var useNearScreen = (function (_ref) {
|
|
|
4135
1607
|
var ref = _ref.ref;
|
|
4136
1608
|
|
|
4137
1609
|
var _useState = React.useState(false),
|
|
4138
|
-
_useState2 =
|
|
1610
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
4139
1611
|
show = _useState2[0],
|
|
4140
1612
|
setShow = _useState2[1];
|
|
4141
1613
|
|
|
@@ -4258,7 +1730,7 @@ var FourColFiveStoriesBase = function FourColFiveStoriesBase(_ref2) {
|
|
|
4258
1730
|
_config$subsequentLoa = config.subsequentLoadCount,
|
|
4259
1731
|
subsequentLoadCount = _config$subsequentLoa === void 0 ? 4 : _config$subsequentLoa;
|
|
4260
1732
|
|
|
4261
|
-
var _get =
|
|
1733
|
+
var _get = lodash.get(slotConfig, [0], {}),
|
|
4262
1734
|
_get$type = _get.type,
|
|
4263
1735
|
type = _get$type === void 0 ? "story" : _get$type,
|
|
4264
1736
|
component = _get.component;
|
|
@@ -4268,11 +1740,11 @@ var FourColFiveStoriesBase = function FourColFiveStoriesBase(_ref2) {
|
|
|
4268
1740
|
var adWidgetSlot = type === "ad" || type === "widget" ? getSlot(type, component) : null;
|
|
4269
1741
|
var dispatch = reactRedux.useDispatch();
|
|
4270
1742
|
var qtConfig = reactRedux.useSelector(function (state) {
|
|
4271
|
-
return
|
|
1743
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
4272
1744
|
});
|
|
4273
1745
|
|
|
4274
1746
|
var _ref3 = stories || [],
|
|
4275
|
-
_ref4 =
|
|
1747
|
+
_ref4 = _toArray__default["default"](_ref3),
|
|
4276
1748
|
firstStory = _ref4[0],
|
|
4277
1749
|
otherStories = _ref4.slice(1);
|
|
4278
1750
|
|
|
@@ -4294,7 +1766,7 @@ var FourColFiveStoriesBase = function FourColFiveStoriesBase(_ref2) {
|
|
|
4294
1766
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4295
1767
|
className: "four-col-five-stories-m_card__2lzhH",
|
|
4296
1768
|
"data-test-id": "story-card",
|
|
4297
|
-
key: "four-col-five-story-".concat(index, "-").concat(
|
|
1769
|
+
key: "four-col-five-story-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
4298
1770
|
}, storyCard(story));
|
|
4299
1771
|
};
|
|
4300
1772
|
|