@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
package/rows/Listicles/index.js
CHANGED
|
@@ -2,2229 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
8
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
9
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
5
10
|
var React = require('react');
|
|
6
11
|
var axios = require('axios');
|
|
7
12
|
var PropTypes = require('prop-types');
|
|
13
|
+
var lodash = require('lodash');
|
|
8
14
|
var components = require('@quintype/components');
|
|
9
15
|
var reactRedux = require('react-redux');
|
|
16
|
+
require('@babel/runtime/helpers/typeof');
|
|
10
17
|
require('react-timeago');
|
|
11
18
|
require('date-fns-tz');
|
|
12
19
|
|
|
13
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
21
|
|
|
22
|
+
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
25
|
+
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
26
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
15
27
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
28
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
17
29
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
30
|
|
|
19
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
20
|
-
try {
|
|
21
|
-
var info = gen[key](arg);
|
|
22
|
-
var value = info.value;
|
|
23
|
-
} catch (error) {
|
|
24
|
-
reject(error);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (info.done) {
|
|
29
|
-
resolve(value);
|
|
30
|
-
} else {
|
|
31
|
-
Promise.resolve(value).then(_next, _throw);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function _asyncToGenerator(fn) {
|
|
36
|
-
return function () {
|
|
37
|
-
var self = this,
|
|
38
|
-
args = arguments;
|
|
39
|
-
return new Promise(function (resolve, reject) {
|
|
40
|
-
var gen = fn.apply(self, args);
|
|
41
|
-
|
|
42
|
-
function _next(value) {
|
|
43
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function _throw(err) {
|
|
47
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
_next(undefined);
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function _defineProperty(obj, key, value) {
|
|
56
|
-
if (key in obj) {
|
|
57
|
-
Object.defineProperty(obj, key, {
|
|
58
|
-
value: value,
|
|
59
|
-
enumerable: true,
|
|
60
|
-
configurable: true,
|
|
61
|
-
writable: true
|
|
62
|
-
});
|
|
63
|
-
} else {
|
|
64
|
-
obj[key] = value;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return obj;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function _arrayWithHoles(arr) {
|
|
71
|
-
if (Array.isArray(arr)) return arr;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function _iterableToArrayLimit(arr, i) {
|
|
75
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
76
|
-
|
|
77
|
-
if (_i == null) return;
|
|
78
|
-
var _arr = [];
|
|
79
|
-
var _n = true;
|
|
80
|
-
var _d = false;
|
|
81
|
-
|
|
82
|
-
var _s, _e;
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
86
|
-
_arr.push(_s.value);
|
|
87
|
-
|
|
88
|
-
if (i && _arr.length === i) break;
|
|
89
|
-
}
|
|
90
|
-
} catch (err) {
|
|
91
|
-
_d = true;
|
|
92
|
-
_e = err;
|
|
93
|
-
} finally {
|
|
94
|
-
try {
|
|
95
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
96
|
-
} finally {
|
|
97
|
-
if (_d) throw _e;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return _arr;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function _arrayLikeToArray(arr, len) {
|
|
105
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
106
|
-
|
|
107
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
108
|
-
arr2[i] = arr[i];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return arr2;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
115
|
-
if (!o) return;
|
|
116
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
117
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
118
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
119
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
120
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function _nonIterableRest() {
|
|
124
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function _slicedToArray(arr, i) {
|
|
128
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
132
|
-
|
|
133
|
-
function getDefaultExportFromCjs (x) {
|
|
134
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function createCommonjsModule(fn) {
|
|
138
|
-
var module = { exports: {} };
|
|
139
|
-
return fn(module, module.exports), module.exports;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the MIT license found in the
|
|
146
|
-
* LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/
|
|
148
|
-
|
|
149
|
-
var runtime_1 = createCommonjsModule(function (module) {
|
|
150
|
-
var runtime = (function (exports) {
|
|
151
|
-
|
|
152
|
-
var Op = Object.prototype;
|
|
153
|
-
var hasOwn = Op.hasOwnProperty;
|
|
154
|
-
var undefined$1; // More compressible than void 0.
|
|
155
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
156
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
157
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
158
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
159
|
-
|
|
160
|
-
function define(obj, key, value) {
|
|
161
|
-
Object.defineProperty(obj, key, {
|
|
162
|
-
value: value,
|
|
163
|
-
enumerable: true,
|
|
164
|
-
configurable: true,
|
|
165
|
-
writable: true
|
|
166
|
-
});
|
|
167
|
-
return obj[key];
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
171
|
-
define({}, "");
|
|
172
|
-
} catch (err) {
|
|
173
|
-
define = function(obj, key, value) {
|
|
174
|
-
return obj[key] = value;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
179
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
180
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
181
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
182
|
-
var context = new Context(tryLocsList || []);
|
|
183
|
-
|
|
184
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
185
|
-
// .throw, and .return methods.
|
|
186
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
187
|
-
|
|
188
|
-
return generator;
|
|
189
|
-
}
|
|
190
|
-
exports.wrap = wrap;
|
|
191
|
-
|
|
192
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
193
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
194
|
-
// have been (and was previously) designed to take a closure to be
|
|
195
|
-
// invoked without arguments, but in all the cases we care about we
|
|
196
|
-
// already have an existing method we want to call, so there's no need
|
|
197
|
-
// to create a new function object. We can even get away with assuming
|
|
198
|
-
// the method takes exactly one argument, since that happens to be true
|
|
199
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
200
|
-
// only additional allocation required is the completion record, which
|
|
201
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
202
|
-
function tryCatch(fn, obj, arg) {
|
|
203
|
-
try {
|
|
204
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
205
|
-
} catch (err) {
|
|
206
|
-
return { type: "throw", arg: err };
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
211
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
212
|
-
var GenStateExecuting = "executing";
|
|
213
|
-
var GenStateCompleted = "completed";
|
|
214
|
-
|
|
215
|
-
// Returning this object from the innerFn has the same effect as
|
|
216
|
-
// breaking out of the dispatch switch statement.
|
|
217
|
-
var ContinueSentinel = {};
|
|
218
|
-
|
|
219
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
220
|
-
// .constructor.prototype properties for functions that return Generator
|
|
221
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
222
|
-
// minifier not to mangle the names of these two functions.
|
|
223
|
-
function Generator() {}
|
|
224
|
-
function GeneratorFunction() {}
|
|
225
|
-
function GeneratorFunctionPrototype() {}
|
|
226
|
-
|
|
227
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
228
|
-
// don't natively support it.
|
|
229
|
-
var IteratorPrototype = {};
|
|
230
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
231
|
-
return this;
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
var getProto = Object.getPrototypeOf;
|
|
235
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
236
|
-
if (NativeIteratorPrototype &&
|
|
237
|
-
NativeIteratorPrototype !== Op &&
|
|
238
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
239
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
240
|
-
// of the polyfill.
|
|
241
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
245
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
246
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
247
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
248
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
249
|
-
GeneratorFunction.displayName = define(
|
|
250
|
-
GeneratorFunctionPrototype,
|
|
251
|
-
toStringTagSymbol,
|
|
252
|
-
"GeneratorFunction"
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
256
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
257
|
-
function defineIteratorMethods(prototype) {
|
|
258
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
259
|
-
define(prototype, method, function(arg) {
|
|
260
|
-
return this._invoke(method, arg);
|
|
261
|
-
});
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
266
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
267
|
-
return ctor
|
|
268
|
-
? ctor === GeneratorFunction ||
|
|
269
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
270
|
-
// do is to check its .name property.
|
|
271
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
272
|
-
: false;
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
exports.mark = function(genFun) {
|
|
276
|
-
if (Object.setPrototypeOf) {
|
|
277
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
278
|
-
} else {
|
|
279
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
280
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
281
|
-
}
|
|
282
|
-
genFun.prototype = Object.create(Gp);
|
|
283
|
-
return genFun;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
// Within the body of any async function, `await x` is transformed to
|
|
287
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
288
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
289
|
-
// meant to be awaited.
|
|
290
|
-
exports.awrap = function(arg) {
|
|
291
|
-
return { __await: arg };
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
295
|
-
function invoke(method, arg, resolve, reject) {
|
|
296
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
297
|
-
if (record.type === "throw") {
|
|
298
|
-
reject(record.arg);
|
|
299
|
-
} else {
|
|
300
|
-
var result = record.arg;
|
|
301
|
-
var value = result.value;
|
|
302
|
-
if (value &&
|
|
303
|
-
typeof value === "object" &&
|
|
304
|
-
hasOwn.call(value, "__await")) {
|
|
305
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
306
|
-
invoke("next", value, resolve, reject);
|
|
307
|
-
}, function(err) {
|
|
308
|
-
invoke("throw", err, resolve, reject);
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
313
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
314
|
-
// the .value of the Promise<{value,done}> result for the
|
|
315
|
-
// current iteration.
|
|
316
|
-
result.value = unwrapped;
|
|
317
|
-
resolve(result);
|
|
318
|
-
}, function(error) {
|
|
319
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
320
|
-
// into the async generator function so it can be handled there.
|
|
321
|
-
return invoke("throw", error, resolve, reject);
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
var previousPromise;
|
|
327
|
-
|
|
328
|
-
function enqueue(method, arg) {
|
|
329
|
-
function callInvokeWithMethodAndArg() {
|
|
330
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
331
|
-
invoke(method, arg, resolve, reject);
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return previousPromise =
|
|
336
|
-
// If enqueue has been called before, then we want to wait until
|
|
337
|
-
// all previous Promises have been resolved before calling invoke,
|
|
338
|
-
// so that results are always delivered in the correct order. If
|
|
339
|
-
// enqueue has not been called before, then it is important to
|
|
340
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
341
|
-
// so that the async generator function has the opportunity to do
|
|
342
|
-
// any necessary setup in a predictable way. This predictability
|
|
343
|
-
// is why the Promise constructor synchronously invokes its
|
|
344
|
-
// executor callback, and why async functions synchronously
|
|
345
|
-
// execute code before the first await. Since we implement simple
|
|
346
|
-
// async functions in terms of async generators, it is especially
|
|
347
|
-
// important to get this right, even though it requires care.
|
|
348
|
-
previousPromise ? previousPromise.then(
|
|
349
|
-
callInvokeWithMethodAndArg,
|
|
350
|
-
// Avoid propagating failures to Promises returned by later
|
|
351
|
-
// invocations of the iterator.
|
|
352
|
-
callInvokeWithMethodAndArg
|
|
353
|
-
) : callInvokeWithMethodAndArg();
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
// Define the unified helper method that is used to implement .next,
|
|
357
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
358
|
-
this._invoke = enqueue;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
362
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
363
|
-
return this;
|
|
364
|
-
});
|
|
365
|
-
exports.AsyncIterator = AsyncIterator;
|
|
366
|
-
|
|
367
|
-
// Note that simple async functions are implemented on top of
|
|
368
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
369
|
-
// the final result produced by the iterator.
|
|
370
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
371
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
372
|
-
|
|
373
|
-
var iter = new AsyncIterator(
|
|
374
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
375
|
-
PromiseImpl
|
|
376
|
-
);
|
|
377
|
-
|
|
378
|
-
return exports.isGeneratorFunction(outerFn)
|
|
379
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
380
|
-
: iter.next().then(function(result) {
|
|
381
|
-
return result.done ? result.value : iter.next();
|
|
382
|
-
});
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
386
|
-
var state = GenStateSuspendedStart;
|
|
387
|
-
|
|
388
|
-
return function invoke(method, arg) {
|
|
389
|
-
if (state === GenStateExecuting) {
|
|
390
|
-
throw new Error("Generator is already running");
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
if (state === GenStateCompleted) {
|
|
394
|
-
if (method === "throw") {
|
|
395
|
-
throw arg;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
399
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
400
|
-
return doneResult();
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
context.method = method;
|
|
404
|
-
context.arg = arg;
|
|
405
|
-
|
|
406
|
-
while (true) {
|
|
407
|
-
var delegate = context.delegate;
|
|
408
|
-
if (delegate) {
|
|
409
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
410
|
-
if (delegateResult) {
|
|
411
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
412
|
-
return delegateResult;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
if (context.method === "next") {
|
|
417
|
-
// Setting context._sent for legacy support of Babel's
|
|
418
|
-
// function.sent implementation.
|
|
419
|
-
context.sent = context._sent = context.arg;
|
|
420
|
-
|
|
421
|
-
} else if (context.method === "throw") {
|
|
422
|
-
if (state === GenStateSuspendedStart) {
|
|
423
|
-
state = GenStateCompleted;
|
|
424
|
-
throw context.arg;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
context.dispatchException(context.arg);
|
|
428
|
-
|
|
429
|
-
} else if (context.method === "return") {
|
|
430
|
-
context.abrupt("return", context.arg);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
state = GenStateExecuting;
|
|
434
|
-
|
|
435
|
-
var record = tryCatch(innerFn, self, context);
|
|
436
|
-
if (record.type === "normal") {
|
|
437
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
438
|
-
// GenStateExecuting and loop back for another invocation.
|
|
439
|
-
state = context.done
|
|
440
|
-
? GenStateCompleted
|
|
441
|
-
: GenStateSuspendedYield;
|
|
442
|
-
|
|
443
|
-
if (record.arg === ContinueSentinel) {
|
|
444
|
-
continue;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
return {
|
|
448
|
-
value: record.arg,
|
|
449
|
-
done: context.done
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
} else if (record.type === "throw") {
|
|
453
|
-
state = GenStateCompleted;
|
|
454
|
-
// Dispatch the exception by looping back around to the
|
|
455
|
-
// context.dispatchException(context.arg) call above.
|
|
456
|
-
context.method = "throw";
|
|
457
|
-
context.arg = record.arg;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
464
|
-
// result, either by returning a { value, done } result from the
|
|
465
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
466
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
467
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
468
|
-
var method = delegate.iterator[context.method];
|
|
469
|
-
if (method === undefined$1) {
|
|
470
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
471
|
-
// method always terminates the yield* loop.
|
|
472
|
-
context.delegate = null;
|
|
473
|
-
|
|
474
|
-
if (context.method === "throw") {
|
|
475
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
476
|
-
if (delegate.iterator["return"]) {
|
|
477
|
-
// If the delegate iterator has a return method, give it a
|
|
478
|
-
// chance to clean up.
|
|
479
|
-
context.method = "return";
|
|
480
|
-
context.arg = undefined$1;
|
|
481
|
-
maybeInvokeDelegate(delegate, context);
|
|
482
|
-
|
|
483
|
-
if (context.method === "throw") {
|
|
484
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
485
|
-
// "return" to "throw", let that override the TypeError below.
|
|
486
|
-
return ContinueSentinel;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
context.method = "throw";
|
|
491
|
-
context.arg = new TypeError(
|
|
492
|
-
"The iterator does not provide a 'throw' method");
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
return ContinueSentinel;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
499
|
-
|
|
500
|
-
if (record.type === "throw") {
|
|
501
|
-
context.method = "throw";
|
|
502
|
-
context.arg = record.arg;
|
|
503
|
-
context.delegate = null;
|
|
504
|
-
return ContinueSentinel;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
var info = record.arg;
|
|
508
|
-
|
|
509
|
-
if (! info) {
|
|
510
|
-
context.method = "throw";
|
|
511
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
512
|
-
context.delegate = null;
|
|
513
|
-
return ContinueSentinel;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
if (info.done) {
|
|
517
|
-
// Assign the result of the finished delegate to the temporary
|
|
518
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
519
|
-
context[delegate.resultName] = info.value;
|
|
520
|
-
|
|
521
|
-
// Resume execution at the desired location (see delegateYield).
|
|
522
|
-
context.next = delegate.nextLoc;
|
|
523
|
-
|
|
524
|
-
// If context.method was "throw" but the delegate handled the
|
|
525
|
-
// exception, let the outer generator proceed normally. If
|
|
526
|
-
// context.method was "next", forget context.arg since it has been
|
|
527
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
528
|
-
// "return", allow the original .return call to continue in the
|
|
529
|
-
// outer generator.
|
|
530
|
-
if (context.method !== "return") {
|
|
531
|
-
context.method = "next";
|
|
532
|
-
context.arg = undefined$1;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
} else {
|
|
536
|
-
// Re-yield the result returned by the delegate method.
|
|
537
|
-
return info;
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
541
|
-
// the outer generator.
|
|
542
|
-
context.delegate = null;
|
|
543
|
-
return ContinueSentinel;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
547
|
-
// unified ._invoke helper method.
|
|
548
|
-
defineIteratorMethods(Gp);
|
|
549
|
-
|
|
550
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
551
|
-
|
|
552
|
-
// A Generator should always return itself as the iterator object when the
|
|
553
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
554
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
555
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
556
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
557
|
-
define(Gp, iteratorSymbol, function() {
|
|
558
|
-
return this;
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
define(Gp, "toString", function() {
|
|
562
|
-
return "[object Generator]";
|
|
563
|
-
});
|
|
564
|
-
|
|
565
|
-
function pushTryEntry(locs) {
|
|
566
|
-
var entry = { tryLoc: locs[0] };
|
|
567
|
-
|
|
568
|
-
if (1 in locs) {
|
|
569
|
-
entry.catchLoc = locs[1];
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
if (2 in locs) {
|
|
573
|
-
entry.finallyLoc = locs[2];
|
|
574
|
-
entry.afterLoc = locs[3];
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
this.tryEntries.push(entry);
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
function resetTryEntry(entry) {
|
|
581
|
-
var record = entry.completion || {};
|
|
582
|
-
record.type = "normal";
|
|
583
|
-
delete record.arg;
|
|
584
|
-
entry.completion = record;
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
function Context(tryLocsList) {
|
|
588
|
-
// The root entry object (effectively a try statement without a catch
|
|
589
|
-
// or a finally block) gives us a place to store values thrown from
|
|
590
|
-
// locations where there is no enclosing try statement.
|
|
591
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
592
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
593
|
-
this.reset(true);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
exports.keys = function(object) {
|
|
597
|
-
var keys = [];
|
|
598
|
-
for (var key in object) {
|
|
599
|
-
keys.push(key);
|
|
600
|
-
}
|
|
601
|
-
keys.reverse();
|
|
602
|
-
|
|
603
|
-
// Rather than returning an object with a next method, we keep
|
|
604
|
-
// things simple and return the next function itself.
|
|
605
|
-
return function next() {
|
|
606
|
-
while (keys.length) {
|
|
607
|
-
var key = keys.pop();
|
|
608
|
-
if (key in object) {
|
|
609
|
-
next.value = key;
|
|
610
|
-
next.done = false;
|
|
611
|
-
return next;
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
// To avoid creating an additional object, we just hang the .value
|
|
616
|
-
// and .done properties off the next function object itself. This
|
|
617
|
-
// also ensures that the minifier will not anonymize the function.
|
|
618
|
-
next.done = true;
|
|
619
|
-
return next;
|
|
620
|
-
};
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
function values(iterable) {
|
|
624
|
-
if (iterable) {
|
|
625
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
626
|
-
if (iteratorMethod) {
|
|
627
|
-
return iteratorMethod.call(iterable);
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
if (typeof iterable.next === "function") {
|
|
631
|
-
return iterable;
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
if (!isNaN(iterable.length)) {
|
|
635
|
-
var i = -1, next = function next() {
|
|
636
|
-
while (++i < iterable.length) {
|
|
637
|
-
if (hasOwn.call(iterable, i)) {
|
|
638
|
-
next.value = iterable[i];
|
|
639
|
-
next.done = false;
|
|
640
|
-
return next;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
next.value = undefined$1;
|
|
645
|
-
next.done = true;
|
|
646
|
-
|
|
647
|
-
return next;
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
return next.next = next;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
// Return an iterator with no values.
|
|
655
|
-
return { next: doneResult };
|
|
656
|
-
}
|
|
657
|
-
exports.values = values;
|
|
658
|
-
|
|
659
|
-
function doneResult() {
|
|
660
|
-
return { value: undefined$1, done: true };
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
Context.prototype = {
|
|
664
|
-
constructor: Context,
|
|
665
|
-
|
|
666
|
-
reset: function(skipTempReset) {
|
|
667
|
-
this.prev = 0;
|
|
668
|
-
this.next = 0;
|
|
669
|
-
// Resetting context._sent for legacy support of Babel's
|
|
670
|
-
// function.sent implementation.
|
|
671
|
-
this.sent = this._sent = undefined$1;
|
|
672
|
-
this.done = false;
|
|
673
|
-
this.delegate = null;
|
|
674
|
-
|
|
675
|
-
this.method = "next";
|
|
676
|
-
this.arg = undefined$1;
|
|
677
|
-
|
|
678
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
679
|
-
|
|
680
|
-
if (!skipTempReset) {
|
|
681
|
-
for (var name in this) {
|
|
682
|
-
// Not sure about the optimal order of these conditions:
|
|
683
|
-
if (name.charAt(0) === "t" &&
|
|
684
|
-
hasOwn.call(this, name) &&
|
|
685
|
-
!isNaN(+name.slice(1))) {
|
|
686
|
-
this[name] = undefined$1;
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
},
|
|
691
|
-
|
|
692
|
-
stop: function() {
|
|
693
|
-
this.done = true;
|
|
694
|
-
|
|
695
|
-
var rootEntry = this.tryEntries[0];
|
|
696
|
-
var rootRecord = rootEntry.completion;
|
|
697
|
-
if (rootRecord.type === "throw") {
|
|
698
|
-
throw rootRecord.arg;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
return this.rval;
|
|
702
|
-
},
|
|
703
|
-
|
|
704
|
-
dispatchException: function(exception) {
|
|
705
|
-
if (this.done) {
|
|
706
|
-
throw exception;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
var context = this;
|
|
710
|
-
function handle(loc, caught) {
|
|
711
|
-
record.type = "throw";
|
|
712
|
-
record.arg = exception;
|
|
713
|
-
context.next = loc;
|
|
714
|
-
|
|
715
|
-
if (caught) {
|
|
716
|
-
// If the dispatched exception was caught by a catch block,
|
|
717
|
-
// then let that catch block handle the exception normally.
|
|
718
|
-
context.method = "next";
|
|
719
|
-
context.arg = undefined$1;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
return !! caught;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
726
|
-
var entry = this.tryEntries[i];
|
|
727
|
-
var record = entry.completion;
|
|
728
|
-
|
|
729
|
-
if (entry.tryLoc === "root") {
|
|
730
|
-
// Exception thrown outside of any try block that could handle
|
|
731
|
-
// it, so set the completion value of the entire function to
|
|
732
|
-
// throw the exception.
|
|
733
|
-
return handle("end");
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
if (entry.tryLoc <= this.prev) {
|
|
737
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
738
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
739
|
-
|
|
740
|
-
if (hasCatch && hasFinally) {
|
|
741
|
-
if (this.prev < entry.catchLoc) {
|
|
742
|
-
return handle(entry.catchLoc, true);
|
|
743
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
744
|
-
return handle(entry.finallyLoc);
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
} else if (hasCatch) {
|
|
748
|
-
if (this.prev < entry.catchLoc) {
|
|
749
|
-
return handle(entry.catchLoc, true);
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
} else if (hasFinally) {
|
|
753
|
-
if (this.prev < entry.finallyLoc) {
|
|
754
|
-
return handle(entry.finallyLoc);
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
} else {
|
|
758
|
-
throw new Error("try statement without catch or finally");
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
},
|
|
763
|
-
|
|
764
|
-
abrupt: function(type, arg) {
|
|
765
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
766
|
-
var entry = this.tryEntries[i];
|
|
767
|
-
if (entry.tryLoc <= this.prev &&
|
|
768
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
769
|
-
this.prev < entry.finallyLoc) {
|
|
770
|
-
var finallyEntry = entry;
|
|
771
|
-
break;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
if (finallyEntry &&
|
|
776
|
-
(type === "break" ||
|
|
777
|
-
type === "continue") &&
|
|
778
|
-
finallyEntry.tryLoc <= arg &&
|
|
779
|
-
arg <= finallyEntry.finallyLoc) {
|
|
780
|
-
// Ignore the finally entry if control is not jumping to a
|
|
781
|
-
// location outside the try/catch block.
|
|
782
|
-
finallyEntry = null;
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
786
|
-
record.type = type;
|
|
787
|
-
record.arg = arg;
|
|
788
|
-
|
|
789
|
-
if (finallyEntry) {
|
|
790
|
-
this.method = "next";
|
|
791
|
-
this.next = finallyEntry.finallyLoc;
|
|
792
|
-
return ContinueSentinel;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
return this.complete(record);
|
|
796
|
-
},
|
|
797
|
-
|
|
798
|
-
complete: function(record, afterLoc) {
|
|
799
|
-
if (record.type === "throw") {
|
|
800
|
-
throw record.arg;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
if (record.type === "break" ||
|
|
804
|
-
record.type === "continue") {
|
|
805
|
-
this.next = record.arg;
|
|
806
|
-
} else if (record.type === "return") {
|
|
807
|
-
this.rval = this.arg = record.arg;
|
|
808
|
-
this.method = "return";
|
|
809
|
-
this.next = "end";
|
|
810
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
811
|
-
this.next = afterLoc;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
return ContinueSentinel;
|
|
815
|
-
},
|
|
816
|
-
|
|
817
|
-
finish: function(finallyLoc) {
|
|
818
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
819
|
-
var entry = this.tryEntries[i];
|
|
820
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
821
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
822
|
-
resetTryEntry(entry);
|
|
823
|
-
return ContinueSentinel;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
},
|
|
827
|
-
|
|
828
|
-
"catch": function(tryLoc) {
|
|
829
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
830
|
-
var entry = this.tryEntries[i];
|
|
831
|
-
if (entry.tryLoc === tryLoc) {
|
|
832
|
-
var record = entry.completion;
|
|
833
|
-
if (record.type === "throw") {
|
|
834
|
-
var thrown = record.arg;
|
|
835
|
-
resetTryEntry(entry);
|
|
836
|
-
}
|
|
837
|
-
return thrown;
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
// The context.catch method must only be called with a location
|
|
842
|
-
// argument that corresponds to a known catch block.
|
|
843
|
-
throw new Error("illegal catch attempt");
|
|
844
|
-
},
|
|
845
|
-
|
|
846
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
847
|
-
this.delegate = {
|
|
848
|
-
iterator: values(iterable),
|
|
849
|
-
resultName: resultName,
|
|
850
|
-
nextLoc: nextLoc
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
if (this.method === "next") {
|
|
854
|
-
// Deliberately forget the last sent value so that we don't
|
|
855
|
-
// accidentally pass it on to the delegate.
|
|
856
|
-
this.arg = undefined$1;
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
return ContinueSentinel;
|
|
860
|
-
}
|
|
861
|
-
};
|
|
862
|
-
|
|
863
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
864
|
-
// or not, return the runtime object so that we can declare the variable
|
|
865
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
866
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
867
|
-
return exports;
|
|
868
|
-
|
|
869
|
-
}(
|
|
870
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
871
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
872
|
-
// object. Either way, the resulting object will be used to initialize
|
|
873
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
874
|
-
module.exports
|
|
875
|
-
));
|
|
876
|
-
|
|
877
|
-
try {
|
|
878
|
-
regeneratorRuntime = runtime;
|
|
879
|
-
} catch (accidentalStrictMode) {
|
|
880
|
-
// This module should not be running in strict mode, so the above
|
|
881
|
-
// assignment should always work unless something is misconfigured. Just
|
|
882
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
883
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
884
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
885
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
886
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
887
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
888
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
889
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
890
|
-
if (typeof globalThis === "object") {
|
|
891
|
-
globalThis.regeneratorRuntime = runtime;
|
|
892
|
-
} else {
|
|
893
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
});
|
|
897
|
-
|
|
898
|
-
var regenerator = runtime_1;
|
|
899
|
-
|
|
900
|
-
var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
|
|
901
|
-
|
|
902
|
-
Object.defineProperty(exports, "__esModule", {
|
|
903
|
-
value: true
|
|
904
|
-
});
|
|
905
|
-
exports["default"] = void 0;
|
|
906
|
-
var optionsDefaults = {
|
|
907
|
-
attributeNames: {
|
|
908
|
-
styleName: 'className'
|
|
909
|
-
},
|
|
910
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
911
|
-
handleMissingStyleName: 'throw'
|
|
912
|
-
};
|
|
913
|
-
var _default = optionsDefaults;
|
|
914
|
-
exports["default"] = _default;
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
});
|
|
918
|
-
|
|
919
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
920
|
-
|
|
921
|
-
Object.defineProperty(exports, "__esModule", {
|
|
922
|
-
value: true
|
|
923
|
-
});
|
|
924
|
-
exports["default"] = void 0;
|
|
925
|
-
|
|
926
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
927
|
-
|
|
928
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
929
|
-
|
|
930
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
931
|
-
return styleName.indexOf('.') !== -1;
|
|
932
|
-
};
|
|
933
|
-
|
|
934
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
935
|
-
if (handleMissingStyleName === 'throw') {
|
|
936
|
-
throw new Error(message);
|
|
937
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
938
|
-
// eslint-disable-next-line no-console
|
|
939
|
-
console.warn(message);
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
return null;
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
946
|
-
// Note:
|
|
947
|
-
// Do not use the desctructing syntax with Babel.
|
|
948
|
-
// Desctructing adds _slicedToArray helper.
|
|
949
|
-
var styleNameParts = styleName.split('.');
|
|
950
|
-
var importName = styleNameParts[0];
|
|
951
|
-
var moduleName = styleNameParts[1];
|
|
952
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
953
|
-
|
|
954
|
-
if (!moduleName) {
|
|
955
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
if (!styleModuleImportMap[importName]) {
|
|
959
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
960
|
-
}
|
|
961
|
-
|
|
962
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
963
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
return styleModuleImportMap[importName][moduleName];
|
|
967
|
-
};
|
|
968
|
-
|
|
969
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
970
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
971
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
972
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
973
|
-
}).filter(function (importKey) {
|
|
974
|
-
return importKey;
|
|
975
|
-
});
|
|
976
|
-
|
|
977
|
-
if (importKeysWithMatches.length > 1) {
|
|
978
|
-
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');
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
if (importKeysWithMatches.length === 0) {
|
|
982
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
986
|
-
};
|
|
987
|
-
|
|
988
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
989
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
990
|
-
|
|
991
|
-
var _ref = options || {},
|
|
992
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
993
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
994
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
995
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
996
|
-
|
|
997
|
-
if (!styleNameValue) {
|
|
998
|
-
return '';
|
|
999
|
-
}
|
|
1000
|
-
|
|
1001
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
1002
|
-
return styleName;
|
|
1003
|
-
}).map(function (styleName) {
|
|
1004
|
-
if (isNamespacedStyleName(styleName)) {
|
|
1005
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
1009
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
1010
|
-
}
|
|
1011
|
-
|
|
1012
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
1013
|
-
if (!autoResolveMultipleImports) {
|
|
1014
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
1021
|
-
|
|
1022
|
-
if (!styleModuleMap[styleName]) {
|
|
1023
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
return styleModuleMap[styleName];
|
|
1027
|
-
}).filter(function (className) {
|
|
1028
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
1029
|
-
return className;
|
|
1030
|
-
}).join(' ');
|
|
1031
|
-
};
|
|
1032
|
-
|
|
1033
|
-
exports["default"] = _default;
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
});
|
|
1037
|
-
|
|
1038
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
1039
|
-
|
|
1040
|
-
/**
|
|
1041
|
-
* Checks if `value` is classified as an `Array` object.
|
|
1042
|
-
*
|
|
1043
|
-
* @static
|
|
1044
|
-
* @memberOf _
|
|
1045
|
-
* @since 0.1.0
|
|
1046
|
-
* @category Lang
|
|
1047
|
-
* @param {*} value The value to check.
|
|
1048
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1049
|
-
* @example
|
|
1050
|
-
*
|
|
1051
|
-
* _.isArray([1, 2, 3]);
|
|
1052
|
-
* // => true
|
|
1053
|
-
*
|
|
1054
|
-
* _.isArray(document.body.children);
|
|
1055
|
-
* // => false
|
|
1056
|
-
*
|
|
1057
|
-
* _.isArray('abc');
|
|
1058
|
-
* // => false
|
|
1059
|
-
*
|
|
1060
|
-
* _.isArray(_.noop);
|
|
1061
|
-
* // => false
|
|
1062
|
-
*/
|
|
1063
|
-
var isArray = Array.isArray;
|
|
1064
|
-
|
|
1065
|
-
var isArray_1 = isArray;
|
|
1066
|
-
|
|
1067
|
-
/** Detect free variable `global` from Node.js. */
|
|
1068
|
-
|
|
1069
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
1070
|
-
|
|
1071
|
-
var _freeGlobal = freeGlobal;
|
|
1072
|
-
|
|
1073
|
-
/** Detect free variable `self`. */
|
|
1074
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
1075
|
-
|
|
1076
|
-
/** Used as a reference to the global object. */
|
|
1077
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
1078
|
-
|
|
1079
|
-
var _root = root;
|
|
1080
|
-
|
|
1081
|
-
/** Built-in value references. */
|
|
1082
|
-
var Symbol$1 = _root.Symbol;
|
|
1083
|
-
|
|
1084
|
-
var _Symbol = Symbol$1;
|
|
1085
|
-
|
|
1086
|
-
/** Used for built-in method references. */
|
|
1087
|
-
var objectProto$4 = Object.prototype;
|
|
1088
|
-
|
|
1089
|
-
/** Used to check objects for own properties. */
|
|
1090
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1091
|
-
|
|
1092
|
-
/**
|
|
1093
|
-
* Used to resolve the
|
|
1094
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1095
|
-
* of values.
|
|
1096
|
-
*/
|
|
1097
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
1098
|
-
|
|
1099
|
-
/** Built-in value references. */
|
|
1100
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1101
|
-
|
|
1102
|
-
/**
|
|
1103
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
1104
|
-
*
|
|
1105
|
-
* @private
|
|
1106
|
-
* @param {*} value The value to query.
|
|
1107
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
1108
|
-
*/
|
|
1109
|
-
function getRawTag(value) {
|
|
1110
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
1111
|
-
tag = value[symToStringTag$1];
|
|
1112
|
-
|
|
1113
|
-
try {
|
|
1114
|
-
value[symToStringTag$1] = undefined;
|
|
1115
|
-
var unmasked = true;
|
|
1116
|
-
} catch (e) {}
|
|
1117
|
-
|
|
1118
|
-
var result = nativeObjectToString$1.call(value);
|
|
1119
|
-
if (unmasked) {
|
|
1120
|
-
if (isOwn) {
|
|
1121
|
-
value[symToStringTag$1] = tag;
|
|
1122
|
-
} else {
|
|
1123
|
-
delete value[symToStringTag$1];
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
return result;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
var _getRawTag = getRawTag;
|
|
1130
|
-
|
|
1131
|
-
/** Used for built-in method references. */
|
|
1132
|
-
var objectProto$3 = Object.prototype;
|
|
1133
|
-
|
|
1134
|
-
/**
|
|
1135
|
-
* Used to resolve the
|
|
1136
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
1137
|
-
* of values.
|
|
1138
|
-
*/
|
|
1139
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
1140
|
-
|
|
1141
|
-
/**
|
|
1142
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
1143
|
-
*
|
|
1144
|
-
* @private
|
|
1145
|
-
* @param {*} value The value to convert.
|
|
1146
|
-
* @returns {string} Returns the converted string.
|
|
1147
|
-
*/
|
|
1148
|
-
function objectToString(value) {
|
|
1149
|
-
return nativeObjectToString.call(value);
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
|
-
var _objectToString = objectToString;
|
|
1153
|
-
|
|
1154
|
-
/** `Object#toString` result references. */
|
|
1155
|
-
var nullTag = '[object Null]',
|
|
1156
|
-
undefinedTag = '[object Undefined]';
|
|
1157
|
-
|
|
1158
|
-
/** Built-in value references. */
|
|
1159
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
1160
|
-
|
|
1161
|
-
/**
|
|
1162
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
1163
|
-
*
|
|
1164
|
-
* @private
|
|
1165
|
-
* @param {*} value The value to query.
|
|
1166
|
-
* @returns {string} Returns the `toStringTag`.
|
|
1167
|
-
*/
|
|
1168
|
-
function baseGetTag(value) {
|
|
1169
|
-
if (value == null) {
|
|
1170
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
1171
|
-
}
|
|
1172
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
1173
|
-
? _getRawTag(value)
|
|
1174
|
-
: _objectToString(value);
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
var _baseGetTag = baseGetTag;
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1181
|
-
* and has a `typeof` result of "object".
|
|
1182
|
-
*
|
|
1183
|
-
* @static
|
|
1184
|
-
* @memberOf _
|
|
1185
|
-
* @since 4.0.0
|
|
1186
|
-
* @category Lang
|
|
1187
|
-
* @param {*} value The value to check.
|
|
1188
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1189
|
-
* @example
|
|
1190
|
-
*
|
|
1191
|
-
* _.isObjectLike({});
|
|
1192
|
-
* // => true
|
|
1193
|
-
*
|
|
1194
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1195
|
-
* // => true
|
|
1196
|
-
*
|
|
1197
|
-
* _.isObjectLike(_.noop);
|
|
1198
|
-
* // => false
|
|
1199
|
-
*
|
|
1200
|
-
* _.isObjectLike(null);
|
|
1201
|
-
* // => false
|
|
1202
|
-
*/
|
|
1203
|
-
function isObjectLike(value) {
|
|
1204
|
-
return value != null && typeof value == 'object';
|
|
1205
|
-
}
|
|
1206
|
-
|
|
1207
|
-
var isObjectLike_1 = isObjectLike;
|
|
1208
|
-
|
|
1209
|
-
/** `Object#toString` result references. */
|
|
1210
|
-
var symbolTag = '[object Symbol]';
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
1214
|
-
*
|
|
1215
|
-
* @static
|
|
1216
|
-
* @memberOf _
|
|
1217
|
-
* @since 4.0.0
|
|
1218
|
-
* @category Lang
|
|
1219
|
-
* @param {*} value The value to check.
|
|
1220
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
1221
|
-
* @example
|
|
1222
|
-
*
|
|
1223
|
-
* _.isSymbol(Symbol.iterator);
|
|
1224
|
-
* // => true
|
|
1225
|
-
*
|
|
1226
|
-
* _.isSymbol('abc');
|
|
1227
|
-
* // => false
|
|
1228
|
-
*/
|
|
1229
|
-
function isSymbol(value) {
|
|
1230
|
-
return typeof value == 'symbol' ||
|
|
1231
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
var isSymbol_1 = isSymbol;
|
|
1235
|
-
|
|
1236
|
-
/** Used to match property names within property paths. */
|
|
1237
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
1238
|
-
reIsPlainProp = /^\w*$/;
|
|
1239
|
-
|
|
1240
|
-
/**
|
|
1241
|
-
* Checks if `value` is a property name and not a property path.
|
|
1242
|
-
*
|
|
1243
|
-
* @private
|
|
1244
|
-
* @param {*} value The value to check.
|
|
1245
|
-
* @param {Object} [object] The object to query keys on.
|
|
1246
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
1247
|
-
*/
|
|
1248
|
-
function isKey(value, object) {
|
|
1249
|
-
if (isArray_1(value)) {
|
|
1250
|
-
return false;
|
|
1251
|
-
}
|
|
1252
|
-
var type = typeof value;
|
|
1253
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
1254
|
-
value == null || isSymbol_1(value)) {
|
|
1255
|
-
return true;
|
|
1256
|
-
}
|
|
1257
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
1258
|
-
(object != null && value in Object(object));
|
|
1259
|
-
}
|
|
1260
|
-
|
|
1261
|
-
var _isKey = isKey;
|
|
1262
|
-
|
|
1263
|
-
/**
|
|
1264
|
-
* Checks if `value` is the
|
|
1265
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
1266
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
1267
|
-
*
|
|
1268
|
-
* @static
|
|
1269
|
-
* @memberOf _
|
|
1270
|
-
* @since 0.1.0
|
|
1271
|
-
* @category Lang
|
|
1272
|
-
* @param {*} value The value to check.
|
|
1273
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
1274
|
-
* @example
|
|
1275
|
-
*
|
|
1276
|
-
* _.isObject({});
|
|
1277
|
-
* // => true
|
|
1278
|
-
*
|
|
1279
|
-
* _.isObject([1, 2, 3]);
|
|
1280
|
-
* // => true
|
|
1281
|
-
*
|
|
1282
|
-
* _.isObject(_.noop);
|
|
1283
|
-
* // => true
|
|
1284
|
-
*
|
|
1285
|
-
* _.isObject(null);
|
|
1286
|
-
* // => false
|
|
1287
|
-
*/
|
|
1288
|
-
function isObject(value) {
|
|
1289
|
-
var type = typeof value;
|
|
1290
|
-
return value != null && (type == 'object' || type == 'function');
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
var isObject_1 = isObject;
|
|
1294
|
-
|
|
1295
|
-
/** `Object#toString` result references. */
|
|
1296
|
-
var asyncTag = '[object AsyncFunction]',
|
|
1297
|
-
funcTag = '[object Function]',
|
|
1298
|
-
genTag = '[object GeneratorFunction]',
|
|
1299
|
-
proxyTag = '[object Proxy]';
|
|
1300
|
-
|
|
1301
|
-
/**
|
|
1302
|
-
* Checks if `value` is classified as a `Function` object.
|
|
1303
|
-
*
|
|
1304
|
-
* @static
|
|
1305
|
-
* @memberOf _
|
|
1306
|
-
* @since 0.1.0
|
|
1307
|
-
* @category Lang
|
|
1308
|
-
* @param {*} value The value to check.
|
|
1309
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
1310
|
-
* @example
|
|
1311
|
-
*
|
|
1312
|
-
* _.isFunction(_);
|
|
1313
|
-
* // => true
|
|
1314
|
-
*
|
|
1315
|
-
* _.isFunction(/abc/);
|
|
1316
|
-
* // => false
|
|
1317
|
-
*/
|
|
1318
|
-
function isFunction(value) {
|
|
1319
|
-
if (!isObject_1(value)) {
|
|
1320
|
-
return false;
|
|
1321
|
-
}
|
|
1322
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
1323
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
1324
|
-
var tag = _baseGetTag(value);
|
|
1325
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
var isFunction_1 = isFunction;
|
|
1329
|
-
|
|
1330
|
-
/** Used to detect overreaching core-js shims. */
|
|
1331
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
1332
|
-
|
|
1333
|
-
var _coreJsData = coreJsData;
|
|
1334
|
-
|
|
1335
|
-
/** Used to detect methods masquerading as native. */
|
|
1336
|
-
var maskSrcKey = (function() {
|
|
1337
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
1338
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
1339
|
-
}());
|
|
1340
|
-
|
|
1341
|
-
/**
|
|
1342
|
-
* Checks if `func` has its source masked.
|
|
1343
|
-
*
|
|
1344
|
-
* @private
|
|
1345
|
-
* @param {Function} func The function to check.
|
|
1346
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
1347
|
-
*/
|
|
1348
|
-
function isMasked(func) {
|
|
1349
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
var _isMasked = isMasked;
|
|
1353
|
-
|
|
1354
|
-
/** Used for built-in method references. */
|
|
1355
|
-
var funcProto$1 = Function.prototype;
|
|
1356
|
-
|
|
1357
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1358
|
-
var funcToString$1 = funcProto$1.toString;
|
|
1359
|
-
|
|
1360
|
-
/**
|
|
1361
|
-
* Converts `func` to its source code.
|
|
1362
|
-
*
|
|
1363
|
-
* @private
|
|
1364
|
-
* @param {Function} func The function to convert.
|
|
1365
|
-
* @returns {string} Returns the source code.
|
|
1366
|
-
*/
|
|
1367
|
-
function toSource(func) {
|
|
1368
|
-
if (func != null) {
|
|
1369
|
-
try {
|
|
1370
|
-
return funcToString$1.call(func);
|
|
1371
|
-
} catch (e) {}
|
|
1372
|
-
try {
|
|
1373
|
-
return (func + '');
|
|
1374
|
-
} catch (e) {}
|
|
1375
|
-
}
|
|
1376
|
-
return '';
|
|
1377
|
-
}
|
|
1378
|
-
|
|
1379
|
-
var _toSource = toSource;
|
|
1380
|
-
|
|
1381
|
-
/**
|
|
1382
|
-
* Used to match `RegExp`
|
|
1383
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
1384
|
-
*/
|
|
1385
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1386
|
-
|
|
1387
|
-
/** Used to detect host constructors (Safari). */
|
|
1388
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1389
|
-
|
|
1390
|
-
/** Used for built-in method references. */
|
|
1391
|
-
var funcProto = Function.prototype,
|
|
1392
|
-
objectProto$2 = Object.prototype;
|
|
1393
|
-
|
|
1394
|
-
/** Used to resolve the decompiled source of functions. */
|
|
1395
|
-
var funcToString = funcProto.toString;
|
|
1396
|
-
|
|
1397
|
-
/** Used to check objects for own properties. */
|
|
1398
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1399
|
-
|
|
1400
|
-
/** Used to detect if a method is native. */
|
|
1401
|
-
var reIsNative = RegExp('^' +
|
|
1402
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
1403
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
1404
|
-
);
|
|
1405
|
-
|
|
1406
|
-
/**
|
|
1407
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
1408
|
-
*
|
|
1409
|
-
* @private
|
|
1410
|
-
* @param {*} value The value to check.
|
|
1411
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
1412
|
-
* else `false`.
|
|
1413
|
-
*/
|
|
1414
|
-
function baseIsNative(value) {
|
|
1415
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
1416
|
-
return false;
|
|
1417
|
-
}
|
|
1418
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
1419
|
-
return pattern.test(_toSource(value));
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
var _baseIsNative = baseIsNative;
|
|
1423
|
-
|
|
1424
|
-
/**
|
|
1425
|
-
* Gets the value at `key` of `object`.
|
|
1426
|
-
*
|
|
1427
|
-
* @private
|
|
1428
|
-
* @param {Object} [object] The object to query.
|
|
1429
|
-
* @param {string} key The key of the property to get.
|
|
1430
|
-
* @returns {*} Returns the property value.
|
|
1431
|
-
*/
|
|
1432
|
-
function getValue(object, key) {
|
|
1433
|
-
return object == null ? undefined : object[key];
|
|
1434
|
-
}
|
|
1435
|
-
|
|
1436
|
-
var _getValue = getValue;
|
|
1437
|
-
|
|
1438
|
-
/**
|
|
1439
|
-
* Gets the native function at `key` of `object`.
|
|
1440
|
-
*
|
|
1441
|
-
* @private
|
|
1442
|
-
* @param {Object} object The object to query.
|
|
1443
|
-
* @param {string} key The key of the method to get.
|
|
1444
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
1445
|
-
*/
|
|
1446
|
-
function getNative(object, key) {
|
|
1447
|
-
var value = _getValue(object, key);
|
|
1448
|
-
return _baseIsNative(value) ? value : undefined;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
var _getNative = getNative;
|
|
1452
|
-
|
|
1453
|
-
/* Built-in method references that are verified to be native. */
|
|
1454
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
1455
|
-
|
|
1456
|
-
var _nativeCreate = nativeCreate;
|
|
1457
|
-
|
|
1458
|
-
/**
|
|
1459
|
-
* Removes all key-value entries from the hash.
|
|
1460
|
-
*
|
|
1461
|
-
* @private
|
|
1462
|
-
* @name clear
|
|
1463
|
-
* @memberOf Hash
|
|
1464
|
-
*/
|
|
1465
|
-
function hashClear() {
|
|
1466
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
1467
|
-
this.size = 0;
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
var _hashClear = hashClear;
|
|
1471
|
-
|
|
1472
|
-
/**
|
|
1473
|
-
* Removes `key` and its value from the hash.
|
|
1474
|
-
*
|
|
1475
|
-
* @private
|
|
1476
|
-
* @name delete
|
|
1477
|
-
* @memberOf Hash
|
|
1478
|
-
* @param {Object} hash The hash to modify.
|
|
1479
|
-
* @param {string} key The key of the value to remove.
|
|
1480
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1481
|
-
*/
|
|
1482
|
-
function hashDelete(key) {
|
|
1483
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
1484
|
-
this.size -= result ? 1 : 0;
|
|
1485
|
-
return result;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
var _hashDelete = hashDelete;
|
|
1489
|
-
|
|
1490
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1491
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
1492
|
-
|
|
1493
|
-
/** Used for built-in method references. */
|
|
1494
|
-
var objectProto$1 = Object.prototype;
|
|
1495
|
-
|
|
1496
|
-
/** Used to check objects for own properties. */
|
|
1497
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1498
|
-
|
|
1499
|
-
/**
|
|
1500
|
-
* Gets the hash value for `key`.
|
|
1501
|
-
*
|
|
1502
|
-
* @private
|
|
1503
|
-
* @name get
|
|
1504
|
-
* @memberOf Hash
|
|
1505
|
-
* @param {string} key The key of the value to get.
|
|
1506
|
-
* @returns {*} Returns the entry value.
|
|
1507
|
-
*/
|
|
1508
|
-
function hashGet(key) {
|
|
1509
|
-
var data = this.__data__;
|
|
1510
|
-
if (_nativeCreate) {
|
|
1511
|
-
var result = data[key];
|
|
1512
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
1513
|
-
}
|
|
1514
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
var _hashGet = hashGet;
|
|
1518
|
-
|
|
1519
|
-
/** Used for built-in method references. */
|
|
1520
|
-
var objectProto = Object.prototype;
|
|
1521
|
-
|
|
1522
|
-
/** Used to check objects for own properties. */
|
|
1523
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* Checks if a hash value for `key` exists.
|
|
1527
|
-
*
|
|
1528
|
-
* @private
|
|
1529
|
-
* @name has
|
|
1530
|
-
* @memberOf Hash
|
|
1531
|
-
* @param {string} key The key of the entry to check.
|
|
1532
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1533
|
-
*/
|
|
1534
|
-
function hashHas(key) {
|
|
1535
|
-
var data = this.__data__;
|
|
1536
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
var _hashHas = hashHas;
|
|
1540
|
-
|
|
1541
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
1542
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* Sets the hash `key` to `value`.
|
|
1546
|
-
*
|
|
1547
|
-
* @private
|
|
1548
|
-
* @name set
|
|
1549
|
-
* @memberOf Hash
|
|
1550
|
-
* @param {string} key The key of the value to set.
|
|
1551
|
-
* @param {*} value The value to set.
|
|
1552
|
-
* @returns {Object} Returns the hash instance.
|
|
1553
|
-
*/
|
|
1554
|
-
function hashSet(key, value) {
|
|
1555
|
-
var data = this.__data__;
|
|
1556
|
-
this.size += this.has(key) ? 0 : 1;
|
|
1557
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
1558
|
-
return this;
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
var _hashSet = hashSet;
|
|
1562
|
-
|
|
1563
|
-
/**
|
|
1564
|
-
* Creates a hash object.
|
|
1565
|
-
*
|
|
1566
|
-
* @private
|
|
1567
|
-
* @constructor
|
|
1568
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1569
|
-
*/
|
|
1570
|
-
function Hash(entries) {
|
|
1571
|
-
var index = -1,
|
|
1572
|
-
length = entries == null ? 0 : entries.length;
|
|
1573
|
-
|
|
1574
|
-
this.clear();
|
|
1575
|
-
while (++index < length) {
|
|
1576
|
-
var entry = entries[index];
|
|
1577
|
-
this.set(entry[0], entry[1]);
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
// Add methods to `Hash`.
|
|
1582
|
-
Hash.prototype.clear = _hashClear;
|
|
1583
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
1584
|
-
Hash.prototype.get = _hashGet;
|
|
1585
|
-
Hash.prototype.has = _hashHas;
|
|
1586
|
-
Hash.prototype.set = _hashSet;
|
|
1587
|
-
|
|
1588
|
-
var _Hash = Hash;
|
|
1589
|
-
|
|
1590
|
-
/**
|
|
1591
|
-
* Removes all key-value entries from the list cache.
|
|
1592
|
-
*
|
|
1593
|
-
* @private
|
|
1594
|
-
* @name clear
|
|
1595
|
-
* @memberOf ListCache
|
|
1596
|
-
*/
|
|
1597
|
-
function listCacheClear() {
|
|
1598
|
-
this.__data__ = [];
|
|
1599
|
-
this.size = 0;
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
var _listCacheClear = listCacheClear;
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* Performs a
|
|
1606
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
1607
|
-
* comparison between two values to determine if they are equivalent.
|
|
1608
|
-
*
|
|
1609
|
-
* @static
|
|
1610
|
-
* @memberOf _
|
|
1611
|
-
* @since 4.0.0
|
|
1612
|
-
* @category Lang
|
|
1613
|
-
* @param {*} value The value to compare.
|
|
1614
|
-
* @param {*} other The other value to compare.
|
|
1615
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
1616
|
-
* @example
|
|
1617
|
-
*
|
|
1618
|
-
* var object = { 'a': 1 };
|
|
1619
|
-
* var other = { 'a': 1 };
|
|
1620
|
-
*
|
|
1621
|
-
* _.eq(object, object);
|
|
1622
|
-
* // => true
|
|
1623
|
-
*
|
|
1624
|
-
* _.eq(object, other);
|
|
1625
|
-
* // => false
|
|
1626
|
-
*
|
|
1627
|
-
* _.eq('a', 'a');
|
|
1628
|
-
* // => true
|
|
1629
|
-
*
|
|
1630
|
-
* _.eq('a', Object('a'));
|
|
1631
|
-
* // => false
|
|
1632
|
-
*
|
|
1633
|
-
* _.eq(NaN, NaN);
|
|
1634
|
-
* // => true
|
|
1635
|
-
*/
|
|
1636
|
-
function eq(value, other) {
|
|
1637
|
-
return value === other || (value !== value && other !== other);
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
var eq_1 = eq;
|
|
1641
|
-
|
|
1642
|
-
/**
|
|
1643
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
1644
|
-
*
|
|
1645
|
-
* @private
|
|
1646
|
-
* @param {Array} array The array to inspect.
|
|
1647
|
-
* @param {*} key The key to search for.
|
|
1648
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
1649
|
-
*/
|
|
1650
|
-
function assocIndexOf(array, key) {
|
|
1651
|
-
var length = array.length;
|
|
1652
|
-
while (length--) {
|
|
1653
|
-
if (eq_1(array[length][0], key)) {
|
|
1654
|
-
return length;
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
|
-
return -1;
|
|
1658
|
-
}
|
|
1659
|
-
|
|
1660
|
-
var _assocIndexOf = assocIndexOf;
|
|
1661
|
-
|
|
1662
|
-
/** Used for built-in method references. */
|
|
1663
|
-
var arrayProto = Array.prototype;
|
|
1664
|
-
|
|
1665
|
-
/** Built-in value references. */
|
|
1666
|
-
var splice = arrayProto.splice;
|
|
1667
|
-
|
|
1668
|
-
/**
|
|
1669
|
-
* Removes `key` and its value from the list cache.
|
|
1670
|
-
*
|
|
1671
|
-
* @private
|
|
1672
|
-
* @name delete
|
|
1673
|
-
* @memberOf ListCache
|
|
1674
|
-
* @param {string} key The key of the value to remove.
|
|
1675
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1676
|
-
*/
|
|
1677
|
-
function listCacheDelete(key) {
|
|
1678
|
-
var data = this.__data__,
|
|
1679
|
-
index = _assocIndexOf(data, key);
|
|
1680
|
-
|
|
1681
|
-
if (index < 0) {
|
|
1682
|
-
return false;
|
|
1683
|
-
}
|
|
1684
|
-
var lastIndex = data.length - 1;
|
|
1685
|
-
if (index == lastIndex) {
|
|
1686
|
-
data.pop();
|
|
1687
|
-
} else {
|
|
1688
|
-
splice.call(data, index, 1);
|
|
1689
|
-
}
|
|
1690
|
-
--this.size;
|
|
1691
|
-
return true;
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
var _listCacheDelete = listCacheDelete;
|
|
1695
|
-
|
|
1696
|
-
/**
|
|
1697
|
-
* Gets the list cache value for `key`.
|
|
1698
|
-
*
|
|
1699
|
-
* @private
|
|
1700
|
-
* @name get
|
|
1701
|
-
* @memberOf ListCache
|
|
1702
|
-
* @param {string} key The key of the value to get.
|
|
1703
|
-
* @returns {*} Returns the entry value.
|
|
1704
|
-
*/
|
|
1705
|
-
function listCacheGet(key) {
|
|
1706
|
-
var data = this.__data__,
|
|
1707
|
-
index = _assocIndexOf(data, key);
|
|
1708
|
-
|
|
1709
|
-
return index < 0 ? undefined : data[index][1];
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
var _listCacheGet = listCacheGet;
|
|
1713
|
-
|
|
1714
|
-
/**
|
|
1715
|
-
* Checks if a list cache value for `key` exists.
|
|
1716
|
-
*
|
|
1717
|
-
* @private
|
|
1718
|
-
* @name has
|
|
1719
|
-
* @memberOf ListCache
|
|
1720
|
-
* @param {string} key The key of the entry to check.
|
|
1721
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1722
|
-
*/
|
|
1723
|
-
function listCacheHas(key) {
|
|
1724
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
var _listCacheHas = listCacheHas;
|
|
1728
|
-
|
|
1729
|
-
/**
|
|
1730
|
-
* Sets the list cache `key` to `value`.
|
|
1731
|
-
*
|
|
1732
|
-
* @private
|
|
1733
|
-
* @name set
|
|
1734
|
-
* @memberOf ListCache
|
|
1735
|
-
* @param {string} key The key of the value to set.
|
|
1736
|
-
* @param {*} value The value to set.
|
|
1737
|
-
* @returns {Object} Returns the list cache instance.
|
|
1738
|
-
*/
|
|
1739
|
-
function listCacheSet(key, value) {
|
|
1740
|
-
var data = this.__data__,
|
|
1741
|
-
index = _assocIndexOf(data, key);
|
|
1742
|
-
|
|
1743
|
-
if (index < 0) {
|
|
1744
|
-
++this.size;
|
|
1745
|
-
data.push([key, value]);
|
|
1746
|
-
} else {
|
|
1747
|
-
data[index][1] = value;
|
|
1748
|
-
}
|
|
1749
|
-
return this;
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
|
-
var _listCacheSet = listCacheSet;
|
|
1753
|
-
|
|
1754
|
-
/**
|
|
1755
|
-
* Creates an list cache object.
|
|
1756
|
-
*
|
|
1757
|
-
* @private
|
|
1758
|
-
* @constructor
|
|
1759
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1760
|
-
*/
|
|
1761
|
-
function ListCache(entries) {
|
|
1762
|
-
var index = -1,
|
|
1763
|
-
length = entries == null ? 0 : entries.length;
|
|
1764
|
-
|
|
1765
|
-
this.clear();
|
|
1766
|
-
while (++index < length) {
|
|
1767
|
-
var entry = entries[index];
|
|
1768
|
-
this.set(entry[0], entry[1]);
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
|
|
1772
|
-
// Add methods to `ListCache`.
|
|
1773
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
1774
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
1775
|
-
ListCache.prototype.get = _listCacheGet;
|
|
1776
|
-
ListCache.prototype.has = _listCacheHas;
|
|
1777
|
-
ListCache.prototype.set = _listCacheSet;
|
|
1778
|
-
|
|
1779
|
-
var _ListCache = ListCache;
|
|
1780
|
-
|
|
1781
|
-
/* Built-in method references that are verified to be native. */
|
|
1782
|
-
var Map = _getNative(_root, 'Map');
|
|
1783
|
-
|
|
1784
|
-
var _Map = Map;
|
|
1785
|
-
|
|
1786
|
-
/**
|
|
1787
|
-
* Removes all key-value entries from the map.
|
|
1788
|
-
*
|
|
1789
|
-
* @private
|
|
1790
|
-
* @name clear
|
|
1791
|
-
* @memberOf MapCache
|
|
1792
|
-
*/
|
|
1793
|
-
function mapCacheClear() {
|
|
1794
|
-
this.size = 0;
|
|
1795
|
-
this.__data__ = {
|
|
1796
|
-
'hash': new _Hash,
|
|
1797
|
-
'map': new (_Map || _ListCache),
|
|
1798
|
-
'string': new _Hash
|
|
1799
|
-
};
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
var _mapCacheClear = mapCacheClear;
|
|
1803
|
-
|
|
1804
|
-
/**
|
|
1805
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
1806
|
-
*
|
|
1807
|
-
* @private
|
|
1808
|
-
* @param {*} value The value to check.
|
|
1809
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
1810
|
-
*/
|
|
1811
|
-
function isKeyable(value) {
|
|
1812
|
-
var type = typeof value;
|
|
1813
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
1814
|
-
? (value !== '__proto__')
|
|
1815
|
-
: (value === null);
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
var _isKeyable = isKeyable;
|
|
1819
|
-
|
|
1820
|
-
/**
|
|
1821
|
-
* Gets the data for `map`.
|
|
1822
|
-
*
|
|
1823
|
-
* @private
|
|
1824
|
-
* @param {Object} map The map to query.
|
|
1825
|
-
* @param {string} key The reference key.
|
|
1826
|
-
* @returns {*} Returns the map data.
|
|
1827
|
-
*/
|
|
1828
|
-
function getMapData(map, key) {
|
|
1829
|
-
var data = map.__data__;
|
|
1830
|
-
return _isKeyable(key)
|
|
1831
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
1832
|
-
: data.map;
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
var _getMapData = getMapData;
|
|
1836
|
-
|
|
1837
|
-
/**
|
|
1838
|
-
* Removes `key` and its value from the map.
|
|
1839
|
-
*
|
|
1840
|
-
* @private
|
|
1841
|
-
* @name delete
|
|
1842
|
-
* @memberOf MapCache
|
|
1843
|
-
* @param {string} key The key of the value to remove.
|
|
1844
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
1845
|
-
*/
|
|
1846
|
-
function mapCacheDelete(key) {
|
|
1847
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
1848
|
-
this.size -= result ? 1 : 0;
|
|
1849
|
-
return result;
|
|
1850
|
-
}
|
|
1851
|
-
|
|
1852
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
1853
|
-
|
|
1854
|
-
/**
|
|
1855
|
-
* Gets the map value for `key`.
|
|
1856
|
-
*
|
|
1857
|
-
* @private
|
|
1858
|
-
* @name get
|
|
1859
|
-
* @memberOf MapCache
|
|
1860
|
-
* @param {string} key The key of the value to get.
|
|
1861
|
-
* @returns {*} Returns the entry value.
|
|
1862
|
-
*/
|
|
1863
|
-
function mapCacheGet(key) {
|
|
1864
|
-
return _getMapData(this, key).get(key);
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
var _mapCacheGet = mapCacheGet;
|
|
1868
|
-
|
|
1869
|
-
/**
|
|
1870
|
-
* Checks if a map value for `key` exists.
|
|
1871
|
-
*
|
|
1872
|
-
* @private
|
|
1873
|
-
* @name has
|
|
1874
|
-
* @memberOf MapCache
|
|
1875
|
-
* @param {string} key The key of the entry to check.
|
|
1876
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1877
|
-
*/
|
|
1878
|
-
function mapCacheHas(key) {
|
|
1879
|
-
return _getMapData(this, key).has(key);
|
|
1880
|
-
}
|
|
1881
|
-
|
|
1882
|
-
var _mapCacheHas = mapCacheHas;
|
|
1883
|
-
|
|
1884
|
-
/**
|
|
1885
|
-
* Sets the map `key` to `value`.
|
|
1886
|
-
*
|
|
1887
|
-
* @private
|
|
1888
|
-
* @name set
|
|
1889
|
-
* @memberOf MapCache
|
|
1890
|
-
* @param {string} key The key of the value to set.
|
|
1891
|
-
* @param {*} value The value to set.
|
|
1892
|
-
* @returns {Object} Returns the map cache instance.
|
|
1893
|
-
*/
|
|
1894
|
-
function mapCacheSet(key, value) {
|
|
1895
|
-
var data = _getMapData(this, key),
|
|
1896
|
-
size = data.size;
|
|
1897
|
-
|
|
1898
|
-
data.set(key, value);
|
|
1899
|
-
this.size += data.size == size ? 0 : 1;
|
|
1900
|
-
return this;
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
var _mapCacheSet = mapCacheSet;
|
|
1904
|
-
|
|
1905
|
-
/**
|
|
1906
|
-
* Creates a map cache object to store key-value pairs.
|
|
1907
|
-
*
|
|
1908
|
-
* @private
|
|
1909
|
-
* @constructor
|
|
1910
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1911
|
-
*/
|
|
1912
|
-
function MapCache(entries) {
|
|
1913
|
-
var index = -1,
|
|
1914
|
-
length = entries == null ? 0 : entries.length;
|
|
1915
|
-
|
|
1916
|
-
this.clear();
|
|
1917
|
-
while (++index < length) {
|
|
1918
|
-
var entry = entries[index];
|
|
1919
|
-
this.set(entry[0], entry[1]);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
// Add methods to `MapCache`.
|
|
1924
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
1925
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
1926
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
1927
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
1928
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
1929
|
-
|
|
1930
|
-
var _MapCache = MapCache;
|
|
1931
|
-
|
|
1932
|
-
/** Error message constants. */
|
|
1933
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
1934
|
-
|
|
1935
|
-
/**
|
|
1936
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
1937
|
-
* provided, it determines the cache key for storing the result based on the
|
|
1938
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
1939
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
1940
|
-
* is invoked with the `this` binding of the memoized function.
|
|
1941
|
-
*
|
|
1942
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
1943
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
1944
|
-
* constructor with one whose instances implement the
|
|
1945
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
1946
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
1947
|
-
*
|
|
1948
|
-
* @static
|
|
1949
|
-
* @memberOf _
|
|
1950
|
-
* @since 0.1.0
|
|
1951
|
-
* @category Function
|
|
1952
|
-
* @param {Function} func The function to have its output memoized.
|
|
1953
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
1954
|
-
* @returns {Function} Returns the new memoized function.
|
|
1955
|
-
* @example
|
|
1956
|
-
*
|
|
1957
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
1958
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
1959
|
-
*
|
|
1960
|
-
* var values = _.memoize(_.values);
|
|
1961
|
-
* values(object);
|
|
1962
|
-
* // => [1, 2]
|
|
1963
|
-
*
|
|
1964
|
-
* values(other);
|
|
1965
|
-
* // => [3, 4]
|
|
1966
|
-
*
|
|
1967
|
-
* object.a = 2;
|
|
1968
|
-
* values(object);
|
|
1969
|
-
* // => [1, 2]
|
|
1970
|
-
*
|
|
1971
|
-
* // Modify the result cache.
|
|
1972
|
-
* values.cache.set(object, ['a', 'b']);
|
|
1973
|
-
* values(object);
|
|
1974
|
-
* // => ['a', 'b']
|
|
1975
|
-
*
|
|
1976
|
-
* // Replace `_.memoize.Cache`.
|
|
1977
|
-
* _.memoize.Cache = WeakMap;
|
|
1978
|
-
*/
|
|
1979
|
-
function memoize(func, resolver) {
|
|
1980
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1981
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1982
|
-
}
|
|
1983
|
-
var memoized = function() {
|
|
1984
|
-
var args = arguments,
|
|
1985
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1986
|
-
cache = memoized.cache;
|
|
1987
|
-
|
|
1988
|
-
if (cache.has(key)) {
|
|
1989
|
-
return cache.get(key);
|
|
1990
|
-
}
|
|
1991
|
-
var result = func.apply(this, args);
|
|
1992
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1993
|
-
return result;
|
|
1994
|
-
};
|
|
1995
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1996
|
-
return memoized;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
// Expose `MapCache`.
|
|
2000
|
-
memoize.Cache = _MapCache;
|
|
2001
|
-
|
|
2002
|
-
var memoize_1 = memoize;
|
|
2003
|
-
|
|
2004
|
-
/** Used as the maximum memoize cache size. */
|
|
2005
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
2006
|
-
|
|
2007
|
-
/**
|
|
2008
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
2009
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
2010
|
-
*
|
|
2011
|
-
* @private
|
|
2012
|
-
* @param {Function} func The function to have its output memoized.
|
|
2013
|
-
* @returns {Function} Returns the new memoized function.
|
|
2014
|
-
*/
|
|
2015
|
-
function memoizeCapped(func) {
|
|
2016
|
-
var result = memoize_1(func, function(key) {
|
|
2017
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
2018
|
-
cache.clear();
|
|
2019
|
-
}
|
|
2020
|
-
return key;
|
|
2021
|
-
});
|
|
2022
|
-
|
|
2023
|
-
var cache = result.cache;
|
|
2024
|
-
return result;
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
var _memoizeCapped = memoizeCapped;
|
|
2028
|
-
|
|
2029
|
-
/** Used to match property names within property paths. */
|
|
2030
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
2031
|
-
|
|
2032
|
-
/** Used to match backslashes in property paths. */
|
|
2033
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
2034
|
-
|
|
2035
|
-
/**
|
|
2036
|
-
* Converts `string` to a property path array.
|
|
2037
|
-
*
|
|
2038
|
-
* @private
|
|
2039
|
-
* @param {string} string The string to convert.
|
|
2040
|
-
* @returns {Array} Returns the property path array.
|
|
2041
|
-
*/
|
|
2042
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
2043
|
-
var result = [];
|
|
2044
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
2045
|
-
result.push('');
|
|
2046
|
-
}
|
|
2047
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
2048
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
2049
|
-
});
|
|
2050
|
-
return result;
|
|
2051
|
-
});
|
|
2052
|
-
|
|
2053
|
-
var _stringToPath = stringToPath;
|
|
2054
|
-
|
|
2055
|
-
/**
|
|
2056
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
2057
|
-
* shorthands.
|
|
2058
|
-
*
|
|
2059
|
-
* @private
|
|
2060
|
-
* @param {Array} [array] The array to iterate over.
|
|
2061
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2062
|
-
* @returns {Array} Returns the new mapped array.
|
|
2063
|
-
*/
|
|
2064
|
-
function arrayMap(array, iteratee) {
|
|
2065
|
-
var index = -1,
|
|
2066
|
-
length = array == null ? 0 : array.length,
|
|
2067
|
-
result = Array(length);
|
|
2068
|
-
|
|
2069
|
-
while (++index < length) {
|
|
2070
|
-
result[index] = iteratee(array[index], index, array);
|
|
2071
|
-
}
|
|
2072
|
-
return result;
|
|
2073
|
-
}
|
|
2074
|
-
|
|
2075
|
-
var _arrayMap = arrayMap;
|
|
2076
|
-
|
|
2077
|
-
/** Used as references for various `Number` constants. */
|
|
2078
|
-
var INFINITY$1 = 1 / 0;
|
|
2079
|
-
|
|
2080
|
-
/** Used to convert symbols to primitives and strings. */
|
|
2081
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
2082
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
2083
|
-
|
|
2084
|
-
/**
|
|
2085
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
2086
|
-
* values to empty strings.
|
|
2087
|
-
*
|
|
2088
|
-
* @private
|
|
2089
|
-
* @param {*} value The value to process.
|
|
2090
|
-
* @returns {string} Returns the string.
|
|
2091
|
-
*/
|
|
2092
|
-
function baseToString(value) {
|
|
2093
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
2094
|
-
if (typeof value == 'string') {
|
|
2095
|
-
return value;
|
|
2096
|
-
}
|
|
2097
|
-
if (isArray_1(value)) {
|
|
2098
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
2099
|
-
return _arrayMap(value, baseToString) + '';
|
|
2100
|
-
}
|
|
2101
|
-
if (isSymbol_1(value)) {
|
|
2102
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
2103
|
-
}
|
|
2104
|
-
var result = (value + '');
|
|
2105
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
var _baseToString = baseToString;
|
|
2109
|
-
|
|
2110
|
-
/**
|
|
2111
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2112
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2113
|
-
*
|
|
2114
|
-
* @static
|
|
2115
|
-
* @memberOf _
|
|
2116
|
-
* @since 4.0.0
|
|
2117
|
-
* @category Lang
|
|
2118
|
-
* @param {*} value The value to convert.
|
|
2119
|
-
* @returns {string} Returns the converted string.
|
|
2120
|
-
* @example
|
|
2121
|
-
*
|
|
2122
|
-
* _.toString(null);
|
|
2123
|
-
* // => ''
|
|
2124
|
-
*
|
|
2125
|
-
* _.toString(-0);
|
|
2126
|
-
* // => '-0'
|
|
2127
|
-
*
|
|
2128
|
-
* _.toString([1, 2, 3]);
|
|
2129
|
-
* // => '1,2,3'
|
|
2130
|
-
*/
|
|
2131
|
-
function toString(value) {
|
|
2132
|
-
return value == null ? '' : _baseToString(value);
|
|
2133
|
-
}
|
|
2134
|
-
|
|
2135
|
-
var toString_1 = toString;
|
|
2136
|
-
|
|
2137
|
-
/**
|
|
2138
|
-
* Casts `value` to a path array if it's not one.
|
|
2139
|
-
*
|
|
2140
|
-
* @private
|
|
2141
|
-
* @param {*} value The value to inspect.
|
|
2142
|
-
* @param {Object} [object] The object to query keys on.
|
|
2143
|
-
* @returns {Array} Returns the cast property path array.
|
|
2144
|
-
*/
|
|
2145
|
-
function castPath(value, object) {
|
|
2146
|
-
if (isArray_1(value)) {
|
|
2147
|
-
return value;
|
|
2148
|
-
}
|
|
2149
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
2150
|
-
}
|
|
2151
|
-
|
|
2152
|
-
var _castPath = castPath;
|
|
2153
|
-
|
|
2154
|
-
/** Used as references for various `Number` constants. */
|
|
2155
|
-
var INFINITY = 1 / 0;
|
|
2156
|
-
|
|
2157
|
-
/**
|
|
2158
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
2159
|
-
*
|
|
2160
|
-
* @private
|
|
2161
|
-
* @param {*} value The value to inspect.
|
|
2162
|
-
* @returns {string|symbol} Returns the key.
|
|
2163
|
-
*/
|
|
2164
|
-
function toKey(value) {
|
|
2165
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
2166
|
-
return value;
|
|
2167
|
-
}
|
|
2168
|
-
var result = (value + '');
|
|
2169
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
2170
|
-
}
|
|
2171
|
-
|
|
2172
|
-
var _toKey = toKey;
|
|
2173
|
-
|
|
2174
|
-
/**
|
|
2175
|
-
* The base implementation of `_.get` without support for default values.
|
|
2176
|
-
*
|
|
2177
|
-
* @private
|
|
2178
|
-
* @param {Object} object The object to query.
|
|
2179
|
-
* @param {Array|string} path The path of the property to get.
|
|
2180
|
-
* @returns {*} Returns the resolved value.
|
|
2181
|
-
*/
|
|
2182
|
-
function baseGet(object, path) {
|
|
2183
|
-
path = _castPath(path, object);
|
|
2184
|
-
|
|
2185
|
-
var index = 0,
|
|
2186
|
-
length = path.length;
|
|
2187
|
-
|
|
2188
|
-
while (object != null && index < length) {
|
|
2189
|
-
object = object[_toKey(path[index++])];
|
|
2190
|
-
}
|
|
2191
|
-
return (index && index == length) ? object : undefined;
|
|
2192
|
-
}
|
|
2193
|
-
|
|
2194
|
-
var _baseGet = baseGet;
|
|
2195
|
-
|
|
2196
|
-
/**
|
|
2197
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2198
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2199
|
-
*
|
|
2200
|
-
* @static
|
|
2201
|
-
* @memberOf _
|
|
2202
|
-
* @since 3.7.0
|
|
2203
|
-
* @category Object
|
|
2204
|
-
* @param {Object} object The object to query.
|
|
2205
|
-
* @param {Array|string} path The path of the property to get.
|
|
2206
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2207
|
-
* @returns {*} Returns the resolved value.
|
|
2208
|
-
* @example
|
|
2209
|
-
*
|
|
2210
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2211
|
-
*
|
|
2212
|
-
* _.get(object, 'a[0].b.c');
|
|
2213
|
-
* // => 3
|
|
2214
|
-
*
|
|
2215
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2216
|
-
* // => 3
|
|
2217
|
-
*
|
|
2218
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2219
|
-
* // => 'default'
|
|
2220
|
-
*/
|
|
2221
|
-
function get(object, path, defaultValue) {
|
|
2222
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
2223
|
-
return result === undefined ? defaultValue : result;
|
|
2224
|
-
}
|
|
2225
|
-
|
|
2226
|
-
var get_1 = get;
|
|
2227
|
-
|
|
2228
31
|
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
2229
32
|
|
|
2230
33
|
var StateProvider = function StateProvider(RowComponent) {
|
|
@@ -2270,10 +73,10 @@ var clientWidths = {
|
|
|
2270
73
|
tablet: 1024
|
|
2271
74
|
};
|
|
2272
75
|
var clientWidth = function clientWidth(device) {
|
|
2273
|
-
var foundDeviceWidth =
|
|
76
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2274
77
|
|
|
2275
78
|
if (foundDeviceWidth) {
|
|
2276
|
-
return
|
|
79
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2277
80
|
}
|
|
2278
81
|
|
|
2279
82
|
return false;
|
|
@@ -2303,7 +106,7 @@ var getSlug = function getSlug(collection) {
|
|
|
2303
106
|
var isSection = collection.template === "section";
|
|
2304
107
|
|
|
2305
108
|
if (isSection) {
|
|
2306
|
-
var sectionId =
|
|
109
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
2307
110
|
var sections = config.sections;
|
|
2308
111
|
var section = sections && sections.find(function (section) {
|
|
2309
112
|
return section.id === sectionId;
|
|
@@ -2319,7 +122,7 @@ function isExternalStory() {
|
|
|
2319
122
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2320
123
|
_story$metadata = story.metadata,
|
|
2321
124
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2322
|
-
return storyTemplate === "news-elsewhere" ?
|
|
125
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2323
126
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2324
127
|
PropTypes__default["default"].shape({
|
|
2325
128
|
"sketches-host": PropTypes__default["default"].string,
|
|
@@ -2333,7 +136,7 @@ PropTypes__default["default"].shape({
|
|
|
2333
136
|
});
|
|
2334
137
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2335
138
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2336
|
-
return
|
|
139
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2337
140
|
};
|
|
2338
141
|
|
|
2339
142
|
var _styleModuleImportMap$2 = {
|
|
@@ -2361,7 +164,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2361
164
|
_ref$navigate = _ref.navigate,
|
|
2362
165
|
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
2363
166
|
var collectionTitle = useStateValue() || {};
|
|
2364
|
-
var showRowTitle =
|
|
167
|
+
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
2365
168
|
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
2366
169
|
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
2367
170
|
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
@@ -2437,7 +240,7 @@ var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
|
2437
240
|
borderBottom: borderBottomFullStyle
|
|
2438
241
|
},
|
|
2439
242
|
"data-test-id": "collection-name",
|
|
2440
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") +
|
|
243
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$2)
|
|
2441
244
|
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2442
245
|
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
2443
246
|
style: {
|
|
@@ -2474,7 +277,7 @@ CollectionNameBase.defaultProps = {
|
|
|
2474
277
|
|
|
2475
278
|
function mapStateToProps(state) {
|
|
2476
279
|
return {
|
|
2477
|
-
config:
|
|
280
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
2478
281
|
};
|
|
2479
282
|
}
|
|
2480
283
|
|
|
@@ -2849,8 +652,8 @@ var Headline = function Headline(_ref) {
|
|
|
2849
652
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
2850
653
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
2851
654
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
2852
|
-
var alternateHeadline =
|
|
2853
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
655
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
656
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
2854
657
|
var headline = alternateHeadline || story.headline;
|
|
2855
658
|
var HeaderTag = "h" + headerLevel;
|
|
2856
659
|
|
|
@@ -2876,10 +679,10 @@ var Headline = function Headline(_ref) {
|
|
|
2876
679
|
var textColor = getTextColor(configData.theme);
|
|
2877
680
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
2878
681
|
var iconSize = "24px";
|
|
2879
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
682
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
2880
683
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2881
684
|
"data-test-id": "headline",
|
|
2882
|
-
className: "arrow-component arr--headline " +
|
|
685
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$1)
|
|
2883
686
|
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
2884
687
|
width: iconSize,
|
|
2885
688
|
height: iconSize,
|
|
@@ -2891,9 +694,9 @@ var Headline = function Headline(_ref) {
|
|
|
2891
694
|
externalLink: isExternalStory(story),
|
|
2892
695
|
"aria-label": "headline"
|
|
2893
696
|
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
2894
|
-
className:
|
|
697
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$1)
|
|
2895
698
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
2896
|
-
className:
|
|
699
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$1)
|
|
2897
700
|
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
2898
701
|
};
|
|
2899
702
|
Headline.propTypes = {
|
|
@@ -2936,7 +739,7 @@ var _styleModuleImportMap = {
|
|
|
2936
739
|
|
|
2937
740
|
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; }
|
|
2938
741
|
|
|
2939
|
-
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) {
|
|
742
|
+
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; }
|
|
2940
743
|
var ListiclesBase = function ListiclesBase(_ref) {
|
|
2941
744
|
var collection = _ref.collection,
|
|
2942
745
|
_ref$config = _ref.config,
|
|
@@ -2951,26 +754,26 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2951
754
|
slotConfig = _config$slotConfig === void 0 ? null : _config$slotConfig;
|
|
2952
755
|
|
|
2953
756
|
var _useState = React.useState([]),
|
|
2954
|
-
_useState2 =
|
|
757
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
2955
758
|
subCollectionStories = _useState2[0],
|
|
2956
759
|
handleApiData = _useState2[1];
|
|
2957
760
|
|
|
2958
761
|
var _useState3 = React.useState({}),
|
|
2959
|
-
_useState4 =
|
|
762
|
+
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
2960
763
|
cachedStories = _useState4[0],
|
|
2961
764
|
updateCachedStories = _useState4[1];
|
|
2962
765
|
|
|
2963
766
|
var _useState5 = React.useState(0),
|
|
2964
|
-
_useState6 =
|
|
767
|
+
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
2965
768
|
active = _useState6[0],
|
|
2966
769
|
handleActive = _useState6[1];
|
|
2967
770
|
|
|
2968
771
|
var _useState7 = React.useState(true),
|
|
2969
|
-
_useState8 =
|
|
772
|
+
_useState8 = _slicedToArray__default["default"](_useState7, 2),
|
|
2970
773
|
loading = _useState8[0],
|
|
2971
774
|
handleLoading = _useState8[1];
|
|
2972
775
|
|
|
2973
|
-
var getFilteredCollection =
|
|
776
|
+
var getFilteredCollection = lodash.get(collection, ["items"], []).filter(function (collections) {
|
|
2974
777
|
return collections.type === "collection";
|
|
2975
778
|
});
|
|
2976
779
|
|
|
@@ -2984,7 +787,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2984
787
|
|
|
2985
788
|
var memoizeStories = function memoizeStories(id, data) {
|
|
2986
789
|
updateCachedStories(function (cachedStories) {
|
|
2987
|
-
return _objectSpread(_objectSpread({}, cachedStories), {},
|
|
790
|
+
return _objectSpread(_objectSpread({}, cachedStories), {}, _defineProperty__default["default"]({}, id, data));
|
|
2988
791
|
});
|
|
2989
792
|
};
|
|
2990
793
|
|
|
@@ -2993,13 +796,13 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
2993
796
|
}
|
|
2994
797
|
|
|
2995
798
|
function _fetchSubCollectionData() {
|
|
2996
|
-
_fetchSubCollectionData =
|
|
799
|
+
_fetchSubCollectionData = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee() {
|
|
2997
800
|
var id,
|
|
2998
801
|
data,
|
|
2999
802
|
res,
|
|
3000
803
|
childCollectionItems,
|
|
3001
804
|
_args = arguments;
|
|
3002
|
-
return
|
|
805
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
3003
806
|
while (1) {
|
|
3004
807
|
switch (_context.prev = _context.next) {
|
|
3005
808
|
case 0:
|
|
@@ -3098,7 +901,7 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3098
901
|
color: textColor
|
|
3099
902
|
}
|
|
3100
903
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3101
|
-
className:
|
|
904
|
+
className: _getClassName__default["default"]("wrapper ".concat(getCustomStyleName), _styleModuleImportMap)
|
|
3102
905
|
}, /*#__PURE__*/React__default["default"].createElement(CollectionName, {
|
|
3103
906
|
collection: collection,
|
|
3104
907
|
collectionNameTemplate: collectionNameTemplate,
|
|
@@ -3108,12 +911,12 @@ var ListiclesBase = function ListiclesBase(_ref) {
|
|
|
3108
911
|
}, getFilteredCollection.map(function (subCollections, index) {
|
|
3109
912
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3110
913
|
key: index,
|
|
3111
|
-
className: ((index === active ? "open-subchild" : "") ? (index === active ? "open-subchild" : "") + " " : "") +
|
|
914
|
+
className: ((index === active ? "open-subchild" : "") ? (index === active ? "open-subchild" : "") + " " : "") + _getClassName__default["default"]("child-collection-wrapper ".concat(index === active ? "open-subchild" : ""), _styleModuleImportMap)
|
|
3112
915
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3113
916
|
onClick: function onClick(event) {
|
|
3114
917
|
return openChildCollectionItems(event, index, subCollections.id);
|
|
3115
918
|
},
|
|
3116
|
-
className:
|
|
919
|
+
className: _getClassName__default["default"]("child-collection ".concat(textColor), _styleModuleImportMap)
|
|
3117
920
|
}, subCollections.name));
|
|
3118
921
|
})), /*#__PURE__*/React__default["default"].createElement("div", null, loading ? /*#__PURE__*/React__default["default"].createElement(Loading, null) : generateOpinions())));
|
|
3119
922
|
};
|