@quintype/arrow 3.15.1-perf.1 → 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 +48 -2128
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +116 -2556
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +48 -2127
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-6f8c780e.js → index-0f809dd9.js} +73 -62
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-2d713010.js → index-37a9ccff.js} +63 -47
- package/atoms/ExtendedLoadMore/{index-8345922c.js → index-446679c8.js} +67 -51
- package/atoms/ExtendedLoadMore/{index-6daa674c.js → index-44f97338.js} +86 -68
- package/atoms/ExtendedLoadMore/{index-c8f346d0.js → index-57dd4870.js} +80 -64
- package/atoms/ExtendedLoadMore/{index-7eb05b3d.js → index-66dd4dbd.js} +70 -54
- package/atoms/ExtendedLoadMore/{index-6cb56d1a.js → index-8462c597.js} +93 -80
- package/atoms/ExtendedLoadMore/{index-aa8b8ab8.js → index-93cb06d1.js} +252 -226
- package/atoms/ExtendedLoadMore/index-afd44863.js +95 -0
- package/atoms/ExtendedLoadMore/{index-5a7900ba.js → index-b5754c5d.js} +67 -53
- package/atoms/ExtendedLoadMore/{index-4191a84c.js → index-bbaf526e.js} +78 -62
- package/atoms/ExtendedLoadMore/{index-99af722e.js → index-cfb262ef.js} +65 -48
- package/atoms/ExtendedLoadMore/index.js +20 -5
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +95 -2175
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +91 -2230
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +40 -2133
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +89 -2241
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +40 -2120
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +35 -2115
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +43 -2483
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +95 -2606
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +59 -2487
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +213 -2800
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +308 -2816
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +611 -3352
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +218 -2658
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +438 -2993
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +432 -2987
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +411 -2966
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +183 -2890
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +217 -2936
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +453 -3008
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +439 -2959
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +374 -2872
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +426 -2927
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +430 -2931
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +368 -2894
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +387 -2900
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +443 -2963
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +444 -2964
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +403 -2923
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +422 -2942
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +390 -2910
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +398 -2918
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +189 -2375
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +128 -2580
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +125 -2577
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +408 -2928
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +439 -2940
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +308 -2800
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +405 -2906
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +432 -2987
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +35 -1833
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +421 -2922
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +358 -2871
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +428 -2929
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +406 -2926
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +400 -2920
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +383 -2909
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +395 -2915
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +398 -2924
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +400 -2920
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +398 -2924
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +418 -2938
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +392 -2912
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +92 -2229
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +53 -1899
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +49 -1895
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +79 -2206
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +52 -1957
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +147 -2329
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +135 -2317
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +173 -2355
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +79 -2207
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +52 -1898
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +53 -1899
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +34 -1738
- package/story-elements/Summary/index.js +56 -1902
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +48 -2176
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +35 -1739
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +1182 -4038
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +1377 -4233
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +1162 -4018
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +1277 -4133
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +1231 -4087
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e39b3ca8.js +0 -3023
- package/atoms/ExtendedLoadMore/index-f6e578e3.js +0 -86
|
@@ -1,2480 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
|
|
30
|
-
handleMissingStyleName: 'throw'
|
|
31
|
-
};
|
|
32
|
-
var _default = optionsDefaults;
|
|
33
|
-
exports["default"] = _default;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
var getClassName = createCommonjsModule(function (module, exports) {
|
|
39
|
-
|
|
40
|
-
Object.defineProperty(exports, "__esModule", {
|
|
41
|
-
value: true
|
|
42
|
-
});
|
|
43
|
-
exports["default"] = void 0;
|
|
44
|
-
|
|
45
|
-
var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
|
|
46
|
-
|
|
47
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
48
|
-
|
|
49
|
-
var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
|
|
50
|
-
return styleName.indexOf('.') !== -1;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
var handleError = function handleError(message, handleMissingStyleName) {
|
|
54
|
-
if (handleMissingStyleName === 'throw') {
|
|
55
|
-
throw new Error(message);
|
|
56
|
-
} else if (handleMissingStyleName === 'warn') {
|
|
57
|
-
// eslint-disable-next-line no-console
|
|
58
|
-
console.warn(message);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return null;
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
65
|
-
// Note:
|
|
66
|
-
// Do not use the desctructing syntax with Babel.
|
|
67
|
-
// Desctructing adds _slicedToArray helper.
|
|
68
|
-
var styleNameParts = styleName.split('.');
|
|
69
|
-
var importName = styleNameParts[0];
|
|
70
|
-
var moduleName = styleNameParts[1];
|
|
71
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
72
|
-
|
|
73
|
-
if (!moduleName) {
|
|
74
|
-
return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!styleModuleImportMap[importName]) {
|
|
78
|
-
return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (!styleModuleImportMap[importName][moduleName]) {
|
|
82
|
-
return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return styleModuleImportMap[importName][moduleName];
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
|
|
89
|
-
var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
|
|
90
|
-
var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
|
|
91
|
-
return styleModuleImportMap[importKey][styleName] && importKey;
|
|
92
|
-
}).filter(function (importKey) {
|
|
93
|
-
return importKey;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
if (importKeysWithMatches.length > 1) {
|
|
97
|
-
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');
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (importKeysWithMatches.length === 0) {
|
|
101
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return styleModuleImportMap[importKeysWithMatches[0]][styleName];
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
var _default = function _default(styleNameValue, styleModuleImportMap, options) {
|
|
108
|
-
var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
|
|
109
|
-
|
|
110
|
-
var _ref = options || {},
|
|
111
|
-
_ref$handleMissingSty = _ref.handleMissingStyleName,
|
|
112
|
-
handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
|
|
113
|
-
_ref$autoResolveMulti = _ref.autoResolveMultipleImports,
|
|
114
|
-
autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
|
|
115
|
-
|
|
116
|
-
if (!styleNameValue) {
|
|
117
|
-
return '';
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return styleNameValue.split(' ').filter(function (styleName) {
|
|
121
|
-
return styleName;
|
|
122
|
-
}).map(function (styleName) {
|
|
123
|
-
if (isNamespacedStyleName(styleName)) {
|
|
124
|
-
return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (styleModuleImportMapKeys.length === 0) {
|
|
128
|
-
throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (styleModuleImportMapKeys.length > 1) {
|
|
132
|
-
if (!autoResolveMultipleImports) {
|
|
133
|
-
throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
|
|
140
|
-
|
|
141
|
-
if (!styleModuleMap[styleName]) {
|
|
142
|
-
return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return styleModuleMap[styleName];
|
|
146
|
-
}).filter(function (className) {
|
|
147
|
-
// Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
|
|
148
|
-
return className;
|
|
149
|
-
}).join(' ');
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
exports["default"] = _default;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
|
|
158
|
-
|
|
159
|
-
var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var PropTypes = require('prop-types');
|
|
8
|
+
var components = require('@quintype/components');
|
|
9
|
+
var lodash = require('lodash');
|
|
10
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
11
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
12
|
+
require('@babel/runtime/regenerator');
|
|
13
|
+
var Timeago = require('react-timeago');
|
|
14
|
+
var dateFnsTz = require('date-fns-tz');
|
|
15
|
+
var reactRedux = require('react-redux');
|
|
16
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
24
|
+
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
25
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
26
|
+
|
|
27
|
+
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
160
28
|
var useStateValue = function useStateValue() {
|
|
161
|
-
return useContext(StateContext);
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Checks if `value` is classified as an `Array` object.
|
|
166
|
-
*
|
|
167
|
-
* @static
|
|
168
|
-
* @memberOf _
|
|
169
|
-
* @since 0.1.0
|
|
170
|
-
* @category Lang
|
|
171
|
-
* @param {*} value The value to check.
|
|
172
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
173
|
-
* @example
|
|
174
|
-
*
|
|
175
|
-
* _.isArray([1, 2, 3]);
|
|
176
|
-
* // => true
|
|
177
|
-
*
|
|
178
|
-
* _.isArray(document.body.children);
|
|
179
|
-
* // => false
|
|
180
|
-
*
|
|
181
|
-
* _.isArray('abc');
|
|
182
|
-
* // => false
|
|
183
|
-
*
|
|
184
|
-
* _.isArray(_.noop);
|
|
185
|
-
* // => false
|
|
186
|
-
*/
|
|
187
|
-
var isArray = Array.isArray;
|
|
188
|
-
|
|
189
|
-
var isArray_1 = isArray;
|
|
190
|
-
|
|
191
|
-
/** Detect free variable `global` from Node.js. */
|
|
192
|
-
|
|
193
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
194
|
-
|
|
195
|
-
var _freeGlobal = freeGlobal;
|
|
196
|
-
|
|
197
|
-
/** Detect free variable `self`. */
|
|
198
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
199
|
-
|
|
200
|
-
/** Used as a reference to the global object. */
|
|
201
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
202
|
-
|
|
203
|
-
var _root = root;
|
|
204
|
-
|
|
205
|
-
/** Built-in value references. */
|
|
206
|
-
var Symbol$1 = _root.Symbol;
|
|
207
|
-
|
|
208
|
-
var _Symbol = Symbol$1;
|
|
209
|
-
|
|
210
|
-
/** Used for built-in method references. */
|
|
211
|
-
var objectProto$4 = Object.prototype;
|
|
212
|
-
|
|
213
|
-
/** Used to check objects for own properties. */
|
|
214
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Used to resolve the
|
|
218
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
219
|
-
* of values.
|
|
220
|
-
*/
|
|
221
|
-
var nativeObjectToString$1 = objectProto$4.toString;
|
|
222
|
-
|
|
223
|
-
/** Built-in value references. */
|
|
224
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
228
|
-
*
|
|
229
|
-
* @private
|
|
230
|
-
* @param {*} value The value to query.
|
|
231
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
232
|
-
*/
|
|
233
|
-
function getRawTag(value) {
|
|
234
|
-
var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
|
|
235
|
-
tag = value[symToStringTag$1];
|
|
236
|
-
|
|
237
|
-
try {
|
|
238
|
-
value[symToStringTag$1] = undefined;
|
|
239
|
-
var unmasked = true;
|
|
240
|
-
} catch (e) {}
|
|
241
|
-
|
|
242
|
-
var result = nativeObjectToString$1.call(value);
|
|
243
|
-
if (unmasked) {
|
|
244
|
-
if (isOwn) {
|
|
245
|
-
value[symToStringTag$1] = tag;
|
|
246
|
-
} else {
|
|
247
|
-
delete value[symToStringTag$1];
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return result;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
var _getRawTag = getRawTag;
|
|
254
|
-
|
|
255
|
-
/** Used for built-in method references. */
|
|
256
|
-
var objectProto$3 = Object.prototype;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Used to resolve the
|
|
260
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
261
|
-
* of values.
|
|
262
|
-
*/
|
|
263
|
-
var nativeObjectToString = objectProto$3.toString;
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
267
|
-
*
|
|
268
|
-
* @private
|
|
269
|
-
* @param {*} value The value to convert.
|
|
270
|
-
* @returns {string} Returns the converted string.
|
|
271
|
-
*/
|
|
272
|
-
function objectToString(value) {
|
|
273
|
-
return nativeObjectToString.call(value);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
var _objectToString = objectToString;
|
|
277
|
-
|
|
278
|
-
/** `Object#toString` result references. */
|
|
279
|
-
var nullTag = '[object Null]',
|
|
280
|
-
undefinedTag = '[object Undefined]';
|
|
281
|
-
|
|
282
|
-
/** Built-in value references. */
|
|
283
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
287
|
-
*
|
|
288
|
-
* @private
|
|
289
|
-
* @param {*} value The value to query.
|
|
290
|
-
* @returns {string} Returns the `toStringTag`.
|
|
291
|
-
*/
|
|
292
|
-
function baseGetTag(value) {
|
|
293
|
-
if (value == null) {
|
|
294
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
295
|
-
}
|
|
296
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
297
|
-
? _getRawTag(value)
|
|
298
|
-
: _objectToString(value);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
var _baseGetTag = baseGetTag;
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
305
|
-
* and has a `typeof` result of "object".
|
|
306
|
-
*
|
|
307
|
-
* @static
|
|
308
|
-
* @memberOf _
|
|
309
|
-
* @since 4.0.0
|
|
310
|
-
* @category Lang
|
|
311
|
-
* @param {*} value The value to check.
|
|
312
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
313
|
-
* @example
|
|
314
|
-
*
|
|
315
|
-
* _.isObjectLike({});
|
|
316
|
-
* // => true
|
|
317
|
-
*
|
|
318
|
-
* _.isObjectLike([1, 2, 3]);
|
|
319
|
-
* // => true
|
|
320
|
-
*
|
|
321
|
-
* _.isObjectLike(_.noop);
|
|
322
|
-
* // => false
|
|
323
|
-
*
|
|
324
|
-
* _.isObjectLike(null);
|
|
325
|
-
* // => false
|
|
326
|
-
*/
|
|
327
|
-
function isObjectLike(value) {
|
|
328
|
-
return value != null && typeof value == 'object';
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
var isObjectLike_1 = isObjectLike;
|
|
332
|
-
|
|
333
|
-
/** `Object#toString` result references. */
|
|
334
|
-
var symbolTag = '[object Symbol]';
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
338
|
-
*
|
|
339
|
-
* @static
|
|
340
|
-
* @memberOf _
|
|
341
|
-
* @since 4.0.0
|
|
342
|
-
* @category Lang
|
|
343
|
-
* @param {*} value The value to check.
|
|
344
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
345
|
-
* @example
|
|
346
|
-
*
|
|
347
|
-
* _.isSymbol(Symbol.iterator);
|
|
348
|
-
* // => true
|
|
349
|
-
*
|
|
350
|
-
* _.isSymbol('abc');
|
|
351
|
-
* // => false
|
|
352
|
-
*/
|
|
353
|
-
function isSymbol(value) {
|
|
354
|
-
return typeof value == 'symbol' ||
|
|
355
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
var isSymbol_1 = isSymbol;
|
|
359
|
-
|
|
360
|
-
/** Used to match property names within property paths. */
|
|
361
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
362
|
-
reIsPlainProp = /^\w*$/;
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Checks if `value` is a property name and not a property path.
|
|
366
|
-
*
|
|
367
|
-
* @private
|
|
368
|
-
* @param {*} value The value to check.
|
|
369
|
-
* @param {Object} [object] The object to query keys on.
|
|
370
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
371
|
-
*/
|
|
372
|
-
function isKey(value, object) {
|
|
373
|
-
if (isArray_1(value)) {
|
|
374
|
-
return false;
|
|
375
|
-
}
|
|
376
|
-
var type = typeof value;
|
|
377
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
378
|
-
value == null || isSymbol_1(value)) {
|
|
379
|
-
return true;
|
|
380
|
-
}
|
|
381
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
382
|
-
(object != null && value in Object(object));
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
var _isKey = isKey;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Checks if `value` is the
|
|
389
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
390
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
391
|
-
*
|
|
392
|
-
* @static
|
|
393
|
-
* @memberOf _
|
|
394
|
-
* @since 0.1.0
|
|
395
|
-
* @category Lang
|
|
396
|
-
* @param {*} value The value to check.
|
|
397
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
398
|
-
* @example
|
|
399
|
-
*
|
|
400
|
-
* _.isObject({});
|
|
401
|
-
* // => true
|
|
402
|
-
*
|
|
403
|
-
* _.isObject([1, 2, 3]);
|
|
404
|
-
* // => true
|
|
405
|
-
*
|
|
406
|
-
* _.isObject(_.noop);
|
|
407
|
-
* // => true
|
|
408
|
-
*
|
|
409
|
-
* _.isObject(null);
|
|
410
|
-
* // => false
|
|
411
|
-
*/
|
|
412
|
-
function isObject(value) {
|
|
413
|
-
var type = typeof value;
|
|
414
|
-
return value != null && (type == 'object' || type == 'function');
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
var isObject_1 = isObject;
|
|
418
|
-
|
|
419
|
-
/** `Object#toString` result references. */
|
|
420
|
-
var asyncTag = '[object AsyncFunction]',
|
|
421
|
-
funcTag = '[object Function]',
|
|
422
|
-
genTag = '[object GeneratorFunction]',
|
|
423
|
-
proxyTag = '[object Proxy]';
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Checks if `value` is classified as a `Function` object.
|
|
427
|
-
*
|
|
428
|
-
* @static
|
|
429
|
-
* @memberOf _
|
|
430
|
-
* @since 0.1.0
|
|
431
|
-
* @category Lang
|
|
432
|
-
* @param {*} value The value to check.
|
|
433
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
434
|
-
* @example
|
|
435
|
-
*
|
|
436
|
-
* _.isFunction(_);
|
|
437
|
-
* // => true
|
|
438
|
-
*
|
|
439
|
-
* _.isFunction(/abc/);
|
|
440
|
-
* // => false
|
|
441
|
-
*/
|
|
442
|
-
function isFunction(value) {
|
|
443
|
-
if (!isObject_1(value)) {
|
|
444
|
-
return false;
|
|
445
|
-
}
|
|
446
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
447
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
448
|
-
var tag = _baseGetTag(value);
|
|
449
|
-
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
var isFunction_1 = isFunction;
|
|
453
|
-
|
|
454
|
-
/** Used to detect overreaching core-js shims. */
|
|
455
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
456
|
-
|
|
457
|
-
var _coreJsData = coreJsData;
|
|
458
|
-
|
|
459
|
-
/** Used to detect methods masquerading as native. */
|
|
460
|
-
var maskSrcKey = (function() {
|
|
461
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
462
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
463
|
-
}());
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Checks if `func` has its source masked.
|
|
467
|
-
*
|
|
468
|
-
* @private
|
|
469
|
-
* @param {Function} func The function to check.
|
|
470
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
471
|
-
*/
|
|
472
|
-
function isMasked(func) {
|
|
473
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
var _isMasked = isMasked;
|
|
477
|
-
|
|
478
|
-
/** Used for built-in method references. */
|
|
479
|
-
var funcProto$1 = Function.prototype;
|
|
480
|
-
|
|
481
|
-
/** Used to resolve the decompiled source of functions. */
|
|
482
|
-
var funcToString$1 = funcProto$1.toString;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Converts `func` to its source code.
|
|
486
|
-
*
|
|
487
|
-
* @private
|
|
488
|
-
* @param {Function} func The function to convert.
|
|
489
|
-
* @returns {string} Returns the source code.
|
|
490
|
-
*/
|
|
491
|
-
function toSource(func) {
|
|
492
|
-
if (func != null) {
|
|
493
|
-
try {
|
|
494
|
-
return funcToString$1.call(func);
|
|
495
|
-
} catch (e) {}
|
|
496
|
-
try {
|
|
497
|
-
return (func + '');
|
|
498
|
-
} catch (e) {}
|
|
499
|
-
}
|
|
500
|
-
return '';
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
var _toSource = toSource;
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Used to match `RegExp`
|
|
507
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
508
|
-
*/
|
|
509
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
510
|
-
|
|
511
|
-
/** Used to detect host constructors (Safari). */
|
|
512
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
513
|
-
|
|
514
|
-
/** Used for built-in method references. */
|
|
515
|
-
var funcProto = Function.prototype,
|
|
516
|
-
objectProto$2 = Object.prototype;
|
|
517
|
-
|
|
518
|
-
/** Used to resolve the decompiled source of functions. */
|
|
519
|
-
var funcToString = funcProto.toString;
|
|
520
|
-
|
|
521
|
-
/** Used to check objects for own properties. */
|
|
522
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
523
|
-
|
|
524
|
-
/** Used to detect if a method is native. */
|
|
525
|
-
var reIsNative = RegExp('^' +
|
|
526
|
-
funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
|
|
527
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
528
|
-
);
|
|
529
|
-
|
|
530
|
-
/**
|
|
531
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
532
|
-
*
|
|
533
|
-
* @private
|
|
534
|
-
* @param {*} value The value to check.
|
|
535
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
536
|
-
* else `false`.
|
|
537
|
-
*/
|
|
538
|
-
function baseIsNative(value) {
|
|
539
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
540
|
-
return false;
|
|
541
|
-
}
|
|
542
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
543
|
-
return pattern.test(_toSource(value));
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
var _baseIsNative = baseIsNative;
|
|
547
|
-
|
|
548
|
-
/**
|
|
549
|
-
* Gets the value at `key` of `object`.
|
|
550
|
-
*
|
|
551
|
-
* @private
|
|
552
|
-
* @param {Object} [object] The object to query.
|
|
553
|
-
* @param {string} key The key of the property to get.
|
|
554
|
-
* @returns {*} Returns the property value.
|
|
555
|
-
*/
|
|
556
|
-
function getValue(object, key) {
|
|
557
|
-
return object == null ? undefined : object[key];
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
var _getValue = getValue;
|
|
561
|
-
|
|
562
|
-
/**
|
|
563
|
-
* Gets the native function at `key` of `object`.
|
|
564
|
-
*
|
|
565
|
-
* @private
|
|
566
|
-
* @param {Object} object The object to query.
|
|
567
|
-
* @param {string} key The key of the method to get.
|
|
568
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
569
|
-
*/
|
|
570
|
-
function getNative(object, key) {
|
|
571
|
-
var value = _getValue(object, key);
|
|
572
|
-
return _baseIsNative(value) ? value : undefined;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
var _getNative = getNative;
|
|
576
|
-
|
|
577
|
-
/* Built-in method references that are verified to be native. */
|
|
578
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
579
|
-
|
|
580
|
-
var _nativeCreate = nativeCreate;
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Removes all key-value entries from the hash.
|
|
584
|
-
*
|
|
585
|
-
* @private
|
|
586
|
-
* @name clear
|
|
587
|
-
* @memberOf Hash
|
|
588
|
-
*/
|
|
589
|
-
function hashClear() {
|
|
590
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
591
|
-
this.size = 0;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
var _hashClear = hashClear;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Removes `key` and its value from the hash.
|
|
598
|
-
*
|
|
599
|
-
* @private
|
|
600
|
-
* @name delete
|
|
601
|
-
* @memberOf Hash
|
|
602
|
-
* @param {Object} hash The hash to modify.
|
|
603
|
-
* @param {string} key The key of the value to remove.
|
|
604
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
605
|
-
*/
|
|
606
|
-
function hashDelete(key) {
|
|
607
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
608
|
-
this.size -= result ? 1 : 0;
|
|
609
|
-
return result;
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
var _hashDelete = hashDelete;
|
|
613
|
-
|
|
614
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
615
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
616
|
-
|
|
617
|
-
/** Used for built-in method references. */
|
|
618
|
-
var objectProto$1 = Object.prototype;
|
|
619
|
-
|
|
620
|
-
/** Used to check objects for own properties. */
|
|
621
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
622
|
-
|
|
623
|
-
/**
|
|
624
|
-
* Gets the hash value for `key`.
|
|
625
|
-
*
|
|
626
|
-
* @private
|
|
627
|
-
* @name get
|
|
628
|
-
* @memberOf Hash
|
|
629
|
-
* @param {string} key The key of the value to get.
|
|
630
|
-
* @returns {*} Returns the entry value.
|
|
631
|
-
*/
|
|
632
|
-
function hashGet(key) {
|
|
633
|
-
var data = this.__data__;
|
|
634
|
-
if (_nativeCreate) {
|
|
635
|
-
var result = data[key];
|
|
636
|
-
return result === HASH_UNDEFINED$1 ? undefined : result;
|
|
637
|
-
}
|
|
638
|
-
return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
var _hashGet = hashGet;
|
|
642
|
-
|
|
643
|
-
/** Used for built-in method references. */
|
|
644
|
-
var objectProto = Object.prototype;
|
|
645
|
-
|
|
646
|
-
/** Used to check objects for own properties. */
|
|
647
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Checks if a hash value for `key` exists.
|
|
651
|
-
*
|
|
652
|
-
* @private
|
|
653
|
-
* @name has
|
|
654
|
-
* @memberOf Hash
|
|
655
|
-
* @param {string} key The key of the entry to check.
|
|
656
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
657
|
-
*/
|
|
658
|
-
function hashHas(key) {
|
|
659
|
-
var data = this.__data__;
|
|
660
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
var _hashHas = hashHas;
|
|
664
|
-
|
|
665
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
666
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Sets the hash `key` to `value`.
|
|
670
|
-
*
|
|
671
|
-
* @private
|
|
672
|
-
* @name set
|
|
673
|
-
* @memberOf Hash
|
|
674
|
-
* @param {string} key The key of the value to set.
|
|
675
|
-
* @param {*} value The value to set.
|
|
676
|
-
* @returns {Object} Returns the hash instance.
|
|
677
|
-
*/
|
|
678
|
-
function hashSet(key, value) {
|
|
679
|
-
var data = this.__data__;
|
|
680
|
-
this.size += this.has(key) ? 0 : 1;
|
|
681
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
|
682
|
-
return this;
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
var _hashSet = hashSet;
|
|
686
|
-
|
|
687
|
-
/**
|
|
688
|
-
* Creates a hash object.
|
|
689
|
-
*
|
|
690
|
-
* @private
|
|
691
|
-
* @constructor
|
|
692
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
693
|
-
*/
|
|
694
|
-
function Hash(entries) {
|
|
695
|
-
var index = -1,
|
|
696
|
-
length = entries == null ? 0 : entries.length;
|
|
697
|
-
|
|
698
|
-
this.clear();
|
|
699
|
-
while (++index < length) {
|
|
700
|
-
var entry = entries[index];
|
|
701
|
-
this.set(entry[0], entry[1]);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
// Add methods to `Hash`.
|
|
706
|
-
Hash.prototype.clear = _hashClear;
|
|
707
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
708
|
-
Hash.prototype.get = _hashGet;
|
|
709
|
-
Hash.prototype.has = _hashHas;
|
|
710
|
-
Hash.prototype.set = _hashSet;
|
|
711
|
-
|
|
712
|
-
var _Hash = Hash;
|
|
713
|
-
|
|
714
|
-
/**
|
|
715
|
-
* Removes all key-value entries from the list cache.
|
|
716
|
-
*
|
|
717
|
-
* @private
|
|
718
|
-
* @name clear
|
|
719
|
-
* @memberOf ListCache
|
|
720
|
-
*/
|
|
721
|
-
function listCacheClear() {
|
|
722
|
-
this.__data__ = [];
|
|
723
|
-
this.size = 0;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
var _listCacheClear = listCacheClear;
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
* Performs a
|
|
730
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
731
|
-
* comparison between two values to determine if they are equivalent.
|
|
732
|
-
*
|
|
733
|
-
* @static
|
|
734
|
-
* @memberOf _
|
|
735
|
-
* @since 4.0.0
|
|
736
|
-
* @category Lang
|
|
737
|
-
* @param {*} value The value to compare.
|
|
738
|
-
* @param {*} other The other value to compare.
|
|
739
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
740
|
-
* @example
|
|
741
|
-
*
|
|
742
|
-
* var object = { 'a': 1 };
|
|
743
|
-
* var other = { 'a': 1 };
|
|
744
|
-
*
|
|
745
|
-
* _.eq(object, object);
|
|
746
|
-
* // => true
|
|
747
|
-
*
|
|
748
|
-
* _.eq(object, other);
|
|
749
|
-
* // => false
|
|
750
|
-
*
|
|
751
|
-
* _.eq('a', 'a');
|
|
752
|
-
* // => true
|
|
753
|
-
*
|
|
754
|
-
* _.eq('a', Object('a'));
|
|
755
|
-
* // => false
|
|
756
|
-
*
|
|
757
|
-
* _.eq(NaN, NaN);
|
|
758
|
-
* // => true
|
|
759
|
-
*/
|
|
760
|
-
function eq(value, other) {
|
|
761
|
-
return value === other || (value !== value && other !== other);
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
var eq_1 = eq;
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
768
|
-
*
|
|
769
|
-
* @private
|
|
770
|
-
* @param {Array} array The array to inspect.
|
|
771
|
-
* @param {*} key The key to search for.
|
|
772
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
773
|
-
*/
|
|
774
|
-
function assocIndexOf(array, key) {
|
|
775
|
-
var length = array.length;
|
|
776
|
-
while (length--) {
|
|
777
|
-
if (eq_1(array[length][0], key)) {
|
|
778
|
-
return length;
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
return -1;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
var _assocIndexOf = assocIndexOf;
|
|
785
|
-
|
|
786
|
-
/** Used for built-in method references. */
|
|
787
|
-
var arrayProto = Array.prototype;
|
|
788
|
-
|
|
789
|
-
/** Built-in value references. */
|
|
790
|
-
var splice = arrayProto.splice;
|
|
791
|
-
|
|
792
|
-
/**
|
|
793
|
-
* Removes `key` and its value from the list cache.
|
|
794
|
-
*
|
|
795
|
-
* @private
|
|
796
|
-
* @name delete
|
|
797
|
-
* @memberOf ListCache
|
|
798
|
-
* @param {string} key The key of the value to remove.
|
|
799
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
800
|
-
*/
|
|
801
|
-
function listCacheDelete(key) {
|
|
802
|
-
var data = this.__data__,
|
|
803
|
-
index = _assocIndexOf(data, key);
|
|
804
|
-
|
|
805
|
-
if (index < 0) {
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
var lastIndex = data.length - 1;
|
|
809
|
-
if (index == lastIndex) {
|
|
810
|
-
data.pop();
|
|
811
|
-
} else {
|
|
812
|
-
splice.call(data, index, 1);
|
|
813
|
-
}
|
|
814
|
-
--this.size;
|
|
815
|
-
return true;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
var _listCacheDelete = listCacheDelete;
|
|
819
|
-
|
|
820
|
-
/**
|
|
821
|
-
* Gets the list cache value for `key`.
|
|
822
|
-
*
|
|
823
|
-
* @private
|
|
824
|
-
* @name get
|
|
825
|
-
* @memberOf ListCache
|
|
826
|
-
* @param {string} key The key of the value to get.
|
|
827
|
-
* @returns {*} Returns the entry value.
|
|
828
|
-
*/
|
|
829
|
-
function listCacheGet(key) {
|
|
830
|
-
var data = this.__data__,
|
|
831
|
-
index = _assocIndexOf(data, key);
|
|
832
|
-
|
|
833
|
-
return index < 0 ? undefined : data[index][1];
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
var _listCacheGet = listCacheGet;
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Checks if a list cache value for `key` exists.
|
|
840
|
-
*
|
|
841
|
-
* @private
|
|
842
|
-
* @name has
|
|
843
|
-
* @memberOf ListCache
|
|
844
|
-
* @param {string} key The key of the entry to check.
|
|
845
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
846
|
-
*/
|
|
847
|
-
function listCacheHas(key) {
|
|
848
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
var _listCacheHas = listCacheHas;
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Sets the list cache `key` to `value`.
|
|
855
|
-
*
|
|
856
|
-
* @private
|
|
857
|
-
* @name set
|
|
858
|
-
* @memberOf ListCache
|
|
859
|
-
* @param {string} key The key of the value to set.
|
|
860
|
-
* @param {*} value The value to set.
|
|
861
|
-
* @returns {Object} Returns the list cache instance.
|
|
862
|
-
*/
|
|
863
|
-
function listCacheSet(key, value) {
|
|
864
|
-
var data = this.__data__,
|
|
865
|
-
index = _assocIndexOf(data, key);
|
|
866
|
-
|
|
867
|
-
if (index < 0) {
|
|
868
|
-
++this.size;
|
|
869
|
-
data.push([key, value]);
|
|
870
|
-
} else {
|
|
871
|
-
data[index][1] = value;
|
|
872
|
-
}
|
|
873
|
-
return this;
|
|
874
|
-
}
|
|
875
|
-
|
|
876
|
-
var _listCacheSet = listCacheSet;
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* Creates an list cache object.
|
|
880
|
-
*
|
|
881
|
-
* @private
|
|
882
|
-
* @constructor
|
|
883
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
884
|
-
*/
|
|
885
|
-
function ListCache(entries) {
|
|
886
|
-
var index = -1,
|
|
887
|
-
length = entries == null ? 0 : entries.length;
|
|
888
|
-
|
|
889
|
-
this.clear();
|
|
890
|
-
while (++index < length) {
|
|
891
|
-
var entry = entries[index];
|
|
892
|
-
this.set(entry[0], entry[1]);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
// Add methods to `ListCache`.
|
|
897
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
898
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
899
|
-
ListCache.prototype.get = _listCacheGet;
|
|
900
|
-
ListCache.prototype.has = _listCacheHas;
|
|
901
|
-
ListCache.prototype.set = _listCacheSet;
|
|
902
|
-
|
|
903
|
-
var _ListCache = ListCache;
|
|
904
|
-
|
|
905
|
-
/* Built-in method references that are verified to be native. */
|
|
906
|
-
var Map = _getNative(_root, 'Map');
|
|
907
|
-
|
|
908
|
-
var _Map = Map;
|
|
909
|
-
|
|
910
|
-
/**
|
|
911
|
-
* Removes all key-value entries from the map.
|
|
912
|
-
*
|
|
913
|
-
* @private
|
|
914
|
-
* @name clear
|
|
915
|
-
* @memberOf MapCache
|
|
916
|
-
*/
|
|
917
|
-
function mapCacheClear() {
|
|
918
|
-
this.size = 0;
|
|
919
|
-
this.__data__ = {
|
|
920
|
-
'hash': new _Hash,
|
|
921
|
-
'map': new (_Map || _ListCache),
|
|
922
|
-
'string': new _Hash
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
var _mapCacheClear = mapCacheClear;
|
|
927
|
-
|
|
928
|
-
/**
|
|
929
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
930
|
-
*
|
|
931
|
-
* @private
|
|
932
|
-
* @param {*} value The value to check.
|
|
933
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
934
|
-
*/
|
|
935
|
-
function isKeyable(value) {
|
|
936
|
-
var type = typeof value;
|
|
937
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
938
|
-
? (value !== '__proto__')
|
|
939
|
-
: (value === null);
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
var _isKeyable = isKeyable;
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Gets the data for `map`.
|
|
946
|
-
*
|
|
947
|
-
* @private
|
|
948
|
-
* @param {Object} map The map to query.
|
|
949
|
-
* @param {string} key The reference key.
|
|
950
|
-
* @returns {*} Returns the map data.
|
|
951
|
-
*/
|
|
952
|
-
function getMapData(map, key) {
|
|
953
|
-
var data = map.__data__;
|
|
954
|
-
return _isKeyable(key)
|
|
955
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
956
|
-
: data.map;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
var _getMapData = getMapData;
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* Removes `key` and its value from the map.
|
|
963
|
-
*
|
|
964
|
-
* @private
|
|
965
|
-
* @name delete
|
|
966
|
-
* @memberOf MapCache
|
|
967
|
-
* @param {string} key The key of the value to remove.
|
|
968
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
969
|
-
*/
|
|
970
|
-
function mapCacheDelete(key) {
|
|
971
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
972
|
-
this.size -= result ? 1 : 0;
|
|
973
|
-
return result;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
977
|
-
|
|
978
|
-
/**
|
|
979
|
-
* Gets the map value for `key`.
|
|
980
|
-
*
|
|
981
|
-
* @private
|
|
982
|
-
* @name get
|
|
983
|
-
* @memberOf MapCache
|
|
984
|
-
* @param {string} key The key of the value to get.
|
|
985
|
-
* @returns {*} Returns the entry value.
|
|
986
|
-
*/
|
|
987
|
-
function mapCacheGet(key) {
|
|
988
|
-
return _getMapData(this, key).get(key);
|
|
989
|
-
}
|
|
990
|
-
|
|
991
|
-
var _mapCacheGet = mapCacheGet;
|
|
992
|
-
|
|
993
|
-
/**
|
|
994
|
-
* Checks if a map value for `key` exists.
|
|
995
|
-
*
|
|
996
|
-
* @private
|
|
997
|
-
* @name has
|
|
998
|
-
* @memberOf MapCache
|
|
999
|
-
* @param {string} key The key of the entry to check.
|
|
1000
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1001
|
-
*/
|
|
1002
|
-
function mapCacheHas(key) {
|
|
1003
|
-
return _getMapData(this, key).has(key);
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
var _mapCacheHas = mapCacheHas;
|
|
1007
|
-
|
|
1008
|
-
/**
|
|
1009
|
-
* Sets the map `key` to `value`.
|
|
1010
|
-
*
|
|
1011
|
-
* @private
|
|
1012
|
-
* @name set
|
|
1013
|
-
* @memberOf MapCache
|
|
1014
|
-
* @param {string} key The key of the value to set.
|
|
1015
|
-
* @param {*} value The value to set.
|
|
1016
|
-
* @returns {Object} Returns the map cache instance.
|
|
1017
|
-
*/
|
|
1018
|
-
function mapCacheSet(key, value) {
|
|
1019
|
-
var data = _getMapData(this, key),
|
|
1020
|
-
size = data.size;
|
|
1021
|
-
|
|
1022
|
-
data.set(key, value);
|
|
1023
|
-
this.size += data.size == size ? 0 : 1;
|
|
1024
|
-
return this;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
var _mapCacheSet = mapCacheSet;
|
|
1028
|
-
|
|
1029
|
-
/**
|
|
1030
|
-
* Creates a map cache object to store key-value pairs.
|
|
1031
|
-
*
|
|
1032
|
-
* @private
|
|
1033
|
-
* @constructor
|
|
1034
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
1035
|
-
*/
|
|
1036
|
-
function MapCache(entries) {
|
|
1037
|
-
var index = -1,
|
|
1038
|
-
length = entries == null ? 0 : entries.length;
|
|
1039
|
-
|
|
1040
|
-
this.clear();
|
|
1041
|
-
while (++index < length) {
|
|
1042
|
-
var entry = entries[index];
|
|
1043
|
-
this.set(entry[0], entry[1]);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
// Add methods to `MapCache`.
|
|
1048
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
1049
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
1050
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
1051
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
1052
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
1053
|
-
|
|
1054
|
-
var _MapCache = MapCache;
|
|
1055
|
-
|
|
1056
|
-
/** Error message constants. */
|
|
1057
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
1058
|
-
|
|
1059
|
-
/**
|
|
1060
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
1061
|
-
* provided, it determines the cache key for storing the result based on the
|
|
1062
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
1063
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
1064
|
-
* is invoked with the `this` binding of the memoized function.
|
|
1065
|
-
*
|
|
1066
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
1067
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
1068
|
-
* constructor with one whose instances implement the
|
|
1069
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
1070
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
1071
|
-
*
|
|
1072
|
-
* @static
|
|
1073
|
-
* @memberOf _
|
|
1074
|
-
* @since 0.1.0
|
|
1075
|
-
* @category Function
|
|
1076
|
-
* @param {Function} func The function to have its output memoized.
|
|
1077
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
1078
|
-
* @returns {Function} Returns the new memoized function.
|
|
1079
|
-
* @example
|
|
1080
|
-
*
|
|
1081
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
1082
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
1083
|
-
*
|
|
1084
|
-
* var values = _.memoize(_.values);
|
|
1085
|
-
* values(object);
|
|
1086
|
-
* // => [1, 2]
|
|
1087
|
-
*
|
|
1088
|
-
* values(other);
|
|
1089
|
-
* // => [3, 4]
|
|
1090
|
-
*
|
|
1091
|
-
* object.a = 2;
|
|
1092
|
-
* values(object);
|
|
1093
|
-
* // => [1, 2]
|
|
1094
|
-
*
|
|
1095
|
-
* // Modify the result cache.
|
|
1096
|
-
* values.cache.set(object, ['a', 'b']);
|
|
1097
|
-
* values(object);
|
|
1098
|
-
* // => ['a', 'b']
|
|
1099
|
-
*
|
|
1100
|
-
* // Replace `_.memoize.Cache`.
|
|
1101
|
-
* _.memoize.Cache = WeakMap;
|
|
1102
|
-
*/
|
|
1103
|
-
function memoize(func, resolver) {
|
|
1104
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
1105
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1106
|
-
}
|
|
1107
|
-
var memoized = function() {
|
|
1108
|
-
var args = arguments,
|
|
1109
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
1110
|
-
cache = memoized.cache;
|
|
1111
|
-
|
|
1112
|
-
if (cache.has(key)) {
|
|
1113
|
-
return cache.get(key);
|
|
1114
|
-
}
|
|
1115
|
-
var result = func.apply(this, args);
|
|
1116
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
1117
|
-
return result;
|
|
1118
|
-
};
|
|
1119
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
1120
|
-
return memoized;
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
// Expose `MapCache`.
|
|
1124
|
-
memoize.Cache = _MapCache;
|
|
1125
|
-
|
|
1126
|
-
var memoize_1 = memoize;
|
|
1127
|
-
|
|
1128
|
-
/** Used as the maximum memoize cache size. */
|
|
1129
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
1130
|
-
|
|
1131
|
-
/**
|
|
1132
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
1133
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
1134
|
-
*
|
|
1135
|
-
* @private
|
|
1136
|
-
* @param {Function} func The function to have its output memoized.
|
|
1137
|
-
* @returns {Function} Returns the new memoized function.
|
|
1138
|
-
*/
|
|
1139
|
-
function memoizeCapped(func) {
|
|
1140
|
-
var result = memoize_1(func, function(key) {
|
|
1141
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
1142
|
-
cache.clear();
|
|
1143
|
-
}
|
|
1144
|
-
return key;
|
|
1145
|
-
});
|
|
1146
|
-
|
|
1147
|
-
var cache = result.cache;
|
|
1148
|
-
return result;
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
var _memoizeCapped = memoizeCapped;
|
|
1152
|
-
|
|
1153
|
-
/** Used to match property names within property paths. */
|
|
1154
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
1155
|
-
|
|
1156
|
-
/** Used to match backslashes in property paths. */
|
|
1157
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* Converts `string` to a property path array.
|
|
1161
|
-
*
|
|
1162
|
-
* @private
|
|
1163
|
-
* @param {string} string The string to convert.
|
|
1164
|
-
* @returns {Array} Returns the property path array.
|
|
1165
|
-
*/
|
|
1166
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
1167
|
-
var result = [];
|
|
1168
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
1169
|
-
result.push('');
|
|
1170
|
-
}
|
|
1171
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
1172
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
1173
|
-
});
|
|
1174
|
-
return result;
|
|
1175
|
-
});
|
|
1176
|
-
|
|
1177
|
-
var _stringToPath = stringToPath;
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
1181
|
-
* shorthands.
|
|
1182
|
-
*
|
|
1183
|
-
* @private
|
|
1184
|
-
* @param {Array} [array] The array to iterate over.
|
|
1185
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1186
|
-
* @returns {Array} Returns the new mapped array.
|
|
1187
|
-
*/
|
|
1188
|
-
function arrayMap(array, iteratee) {
|
|
1189
|
-
var index = -1,
|
|
1190
|
-
length = array == null ? 0 : array.length,
|
|
1191
|
-
result = Array(length);
|
|
1192
|
-
|
|
1193
|
-
while (++index < length) {
|
|
1194
|
-
result[index] = iteratee(array[index], index, array);
|
|
1195
|
-
}
|
|
1196
|
-
return result;
|
|
1197
|
-
}
|
|
1198
|
-
|
|
1199
|
-
var _arrayMap = arrayMap;
|
|
1200
|
-
|
|
1201
|
-
/** Used as references for various `Number` constants. */
|
|
1202
|
-
var INFINITY$1 = 1 / 0;
|
|
1203
|
-
|
|
1204
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1205
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
1206
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
1210
|
-
* values to empty strings.
|
|
1211
|
-
*
|
|
1212
|
-
* @private
|
|
1213
|
-
* @param {*} value The value to process.
|
|
1214
|
-
* @returns {string} Returns the string.
|
|
1215
|
-
*/
|
|
1216
|
-
function baseToString(value) {
|
|
1217
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
1218
|
-
if (typeof value == 'string') {
|
|
1219
|
-
return value;
|
|
1220
|
-
}
|
|
1221
|
-
if (isArray_1(value)) {
|
|
1222
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
1223
|
-
return _arrayMap(value, baseToString) + '';
|
|
1224
|
-
}
|
|
1225
|
-
if (isSymbol_1(value)) {
|
|
1226
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
1227
|
-
}
|
|
1228
|
-
var result = (value + '');
|
|
1229
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
var _baseToString = baseToString;
|
|
1233
|
-
|
|
1234
|
-
/**
|
|
1235
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
1236
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
1237
|
-
*
|
|
1238
|
-
* @static
|
|
1239
|
-
* @memberOf _
|
|
1240
|
-
* @since 4.0.0
|
|
1241
|
-
* @category Lang
|
|
1242
|
-
* @param {*} value The value to convert.
|
|
1243
|
-
* @returns {string} Returns the converted string.
|
|
1244
|
-
* @example
|
|
1245
|
-
*
|
|
1246
|
-
* _.toString(null);
|
|
1247
|
-
* // => ''
|
|
1248
|
-
*
|
|
1249
|
-
* _.toString(-0);
|
|
1250
|
-
* // => '-0'
|
|
1251
|
-
*
|
|
1252
|
-
* _.toString([1, 2, 3]);
|
|
1253
|
-
* // => '1,2,3'
|
|
1254
|
-
*/
|
|
1255
|
-
function toString(value) {
|
|
1256
|
-
return value == null ? '' : _baseToString(value);
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
var toString_1 = toString;
|
|
1260
|
-
|
|
1261
|
-
/**
|
|
1262
|
-
* Casts `value` to a path array if it's not one.
|
|
1263
|
-
*
|
|
1264
|
-
* @private
|
|
1265
|
-
* @param {*} value The value to inspect.
|
|
1266
|
-
* @param {Object} [object] The object to query keys on.
|
|
1267
|
-
* @returns {Array} Returns the cast property path array.
|
|
1268
|
-
*/
|
|
1269
|
-
function castPath(value, object) {
|
|
1270
|
-
if (isArray_1(value)) {
|
|
1271
|
-
return value;
|
|
1272
|
-
}
|
|
1273
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
var _castPath = castPath;
|
|
1277
|
-
|
|
1278
|
-
/** Used as references for various `Number` constants. */
|
|
1279
|
-
var INFINITY = 1 / 0;
|
|
1280
|
-
|
|
1281
|
-
/**
|
|
1282
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
1283
|
-
*
|
|
1284
|
-
* @private
|
|
1285
|
-
* @param {*} value The value to inspect.
|
|
1286
|
-
* @returns {string|symbol} Returns the key.
|
|
1287
|
-
*/
|
|
1288
|
-
function toKey(value) {
|
|
1289
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
1290
|
-
return value;
|
|
1291
|
-
}
|
|
1292
|
-
var result = (value + '');
|
|
1293
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
var _toKey = toKey;
|
|
1297
|
-
|
|
1298
|
-
/**
|
|
1299
|
-
* The base implementation of `_.get` without support for default values.
|
|
1300
|
-
*
|
|
1301
|
-
* @private
|
|
1302
|
-
* @param {Object} object The object to query.
|
|
1303
|
-
* @param {Array|string} path The path of the property to get.
|
|
1304
|
-
* @returns {*} Returns the resolved value.
|
|
1305
|
-
*/
|
|
1306
|
-
function baseGet(object, path) {
|
|
1307
|
-
path = _castPath(path, object);
|
|
1308
|
-
|
|
1309
|
-
var index = 0,
|
|
1310
|
-
length = path.length;
|
|
1311
|
-
|
|
1312
|
-
while (object != null && index < length) {
|
|
1313
|
-
object = object[_toKey(path[index++])];
|
|
1314
|
-
}
|
|
1315
|
-
return (index && index == length) ? object : undefined;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
var _baseGet = baseGet;
|
|
1319
|
-
|
|
1320
|
-
/**
|
|
1321
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
1322
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
1323
|
-
*
|
|
1324
|
-
* @static
|
|
1325
|
-
* @memberOf _
|
|
1326
|
-
* @since 3.7.0
|
|
1327
|
-
* @category Object
|
|
1328
|
-
* @param {Object} object The object to query.
|
|
1329
|
-
* @param {Array|string} path The path of the property to get.
|
|
1330
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
1331
|
-
* @returns {*} Returns the resolved value.
|
|
1332
|
-
* @example
|
|
1333
|
-
*
|
|
1334
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
1335
|
-
*
|
|
1336
|
-
* _.get(object, 'a[0].b.c');
|
|
1337
|
-
* // => 3
|
|
1338
|
-
*
|
|
1339
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
1340
|
-
* // => 3
|
|
1341
|
-
*
|
|
1342
|
-
* _.get(object, 'a.b.c', 'default');
|
|
1343
|
-
* // => 'default'
|
|
1344
|
-
*/
|
|
1345
|
-
function get(object, path, defaultValue) {
|
|
1346
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
1347
|
-
return result === undefined ? defaultValue : result;
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
var get_1 = get;
|
|
1351
|
-
|
|
1352
|
-
function _typeof(obj) {
|
|
1353
|
-
"@babel/helpers - typeof";
|
|
1354
|
-
|
|
1355
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
1356
|
-
return typeof obj;
|
|
1357
|
-
} : function (obj) {
|
|
1358
|
-
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
1359
|
-
}, _typeof(obj);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
1364
|
-
*
|
|
1365
|
-
* This source code is licensed under the MIT license found in the
|
|
1366
|
-
* LICENSE file in the root directory of this source tree.
|
|
1367
|
-
*/
|
|
1368
|
-
|
|
1369
|
-
createCommonjsModule(function (module) {
|
|
1370
|
-
var runtime = (function (exports) {
|
|
1371
|
-
|
|
1372
|
-
var Op = Object.prototype;
|
|
1373
|
-
var hasOwn = Op.hasOwnProperty;
|
|
1374
|
-
var undefined$1; // More compressible than void 0.
|
|
1375
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
1376
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
1377
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
1378
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
1379
|
-
|
|
1380
|
-
function define(obj, key, value) {
|
|
1381
|
-
Object.defineProperty(obj, key, {
|
|
1382
|
-
value: value,
|
|
1383
|
-
enumerable: true,
|
|
1384
|
-
configurable: true,
|
|
1385
|
-
writable: true
|
|
1386
|
-
});
|
|
1387
|
-
return obj[key];
|
|
1388
|
-
}
|
|
1389
|
-
try {
|
|
1390
|
-
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
|
1391
|
-
define({}, "");
|
|
1392
|
-
} catch (err) {
|
|
1393
|
-
define = function(obj, key, value) {
|
|
1394
|
-
return obj[key] = value;
|
|
1395
|
-
};
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
1399
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
1400
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
1401
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
1402
|
-
var context = new Context(tryLocsList || []);
|
|
1403
|
-
|
|
1404
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
1405
|
-
// .throw, and .return methods.
|
|
1406
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
1407
|
-
|
|
1408
|
-
return generator;
|
|
1409
|
-
}
|
|
1410
|
-
exports.wrap = wrap;
|
|
1411
|
-
|
|
1412
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
1413
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
1414
|
-
// have been (and was previously) designed to take a closure to be
|
|
1415
|
-
// invoked without arguments, but in all the cases we care about we
|
|
1416
|
-
// already have an existing method we want to call, so there's no need
|
|
1417
|
-
// to create a new function object. We can even get away with assuming
|
|
1418
|
-
// the method takes exactly one argument, since that happens to be true
|
|
1419
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
1420
|
-
// only additional allocation required is the completion record, which
|
|
1421
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
1422
|
-
function tryCatch(fn, obj, arg) {
|
|
1423
|
-
try {
|
|
1424
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
1425
|
-
} catch (err) {
|
|
1426
|
-
return { type: "throw", arg: err };
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
|
|
1430
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
1431
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
1432
|
-
var GenStateExecuting = "executing";
|
|
1433
|
-
var GenStateCompleted = "completed";
|
|
1434
|
-
|
|
1435
|
-
// Returning this object from the innerFn has the same effect as
|
|
1436
|
-
// breaking out of the dispatch switch statement.
|
|
1437
|
-
var ContinueSentinel = {};
|
|
1438
|
-
|
|
1439
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
1440
|
-
// .constructor.prototype properties for functions that return Generator
|
|
1441
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
1442
|
-
// minifier not to mangle the names of these two functions.
|
|
1443
|
-
function Generator() {}
|
|
1444
|
-
function GeneratorFunction() {}
|
|
1445
|
-
function GeneratorFunctionPrototype() {}
|
|
1446
|
-
|
|
1447
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
1448
|
-
// don't natively support it.
|
|
1449
|
-
var IteratorPrototype = {};
|
|
1450
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
1451
|
-
return this;
|
|
1452
|
-
});
|
|
1453
|
-
|
|
1454
|
-
var getProto = Object.getPrototypeOf;
|
|
1455
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
1456
|
-
if (NativeIteratorPrototype &&
|
|
1457
|
-
NativeIteratorPrototype !== Op &&
|
|
1458
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
1459
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
1460
|
-
// of the polyfill.
|
|
1461
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
1465
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
1466
|
-
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
|
1467
|
-
define(Gp, "constructor", GeneratorFunctionPrototype);
|
|
1468
|
-
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
|
1469
|
-
GeneratorFunction.displayName = define(
|
|
1470
|
-
GeneratorFunctionPrototype,
|
|
1471
|
-
toStringTagSymbol,
|
|
1472
|
-
"GeneratorFunction"
|
|
1473
|
-
);
|
|
1474
|
-
|
|
1475
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
1476
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
1477
|
-
function defineIteratorMethods(prototype) {
|
|
1478
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
1479
|
-
define(prototype, method, function(arg) {
|
|
1480
|
-
return this._invoke(method, arg);
|
|
1481
|
-
});
|
|
1482
|
-
});
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
exports.isGeneratorFunction = function(genFun) {
|
|
1486
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
1487
|
-
return ctor
|
|
1488
|
-
? ctor === GeneratorFunction ||
|
|
1489
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
1490
|
-
// do is to check its .name property.
|
|
1491
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
1492
|
-
: false;
|
|
1493
|
-
};
|
|
1494
|
-
|
|
1495
|
-
exports.mark = function(genFun) {
|
|
1496
|
-
if (Object.setPrototypeOf) {
|
|
1497
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
1498
|
-
} else {
|
|
1499
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
1500
|
-
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
|
1501
|
-
}
|
|
1502
|
-
genFun.prototype = Object.create(Gp);
|
|
1503
|
-
return genFun;
|
|
1504
|
-
};
|
|
1505
|
-
|
|
1506
|
-
// Within the body of any async function, `await x` is transformed to
|
|
1507
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
1508
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
1509
|
-
// meant to be awaited.
|
|
1510
|
-
exports.awrap = function(arg) {
|
|
1511
|
-
return { __await: arg };
|
|
1512
|
-
};
|
|
1513
|
-
|
|
1514
|
-
function AsyncIterator(generator, PromiseImpl) {
|
|
1515
|
-
function invoke(method, arg, resolve, reject) {
|
|
1516
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
1517
|
-
if (record.type === "throw") {
|
|
1518
|
-
reject(record.arg);
|
|
1519
|
-
} else {
|
|
1520
|
-
var result = record.arg;
|
|
1521
|
-
var value = result.value;
|
|
1522
|
-
if (value &&
|
|
1523
|
-
typeof value === "object" &&
|
|
1524
|
-
hasOwn.call(value, "__await")) {
|
|
1525
|
-
return PromiseImpl.resolve(value.__await).then(function(value) {
|
|
1526
|
-
invoke("next", value, resolve, reject);
|
|
1527
|
-
}, function(err) {
|
|
1528
|
-
invoke("throw", err, resolve, reject);
|
|
1529
|
-
});
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1532
|
-
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
|
1533
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
1534
|
-
// the .value of the Promise<{value,done}> result for the
|
|
1535
|
-
// current iteration.
|
|
1536
|
-
result.value = unwrapped;
|
|
1537
|
-
resolve(result);
|
|
1538
|
-
}, function(error) {
|
|
1539
|
-
// If a rejected Promise was yielded, throw the rejection back
|
|
1540
|
-
// into the async generator function so it can be handled there.
|
|
1541
|
-
return invoke("throw", error, resolve, reject);
|
|
1542
|
-
});
|
|
1543
|
-
}
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
var previousPromise;
|
|
1547
|
-
|
|
1548
|
-
function enqueue(method, arg) {
|
|
1549
|
-
function callInvokeWithMethodAndArg() {
|
|
1550
|
-
return new PromiseImpl(function(resolve, reject) {
|
|
1551
|
-
invoke(method, arg, resolve, reject);
|
|
1552
|
-
});
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
return previousPromise =
|
|
1556
|
-
// If enqueue has been called before, then we want to wait until
|
|
1557
|
-
// all previous Promises have been resolved before calling invoke,
|
|
1558
|
-
// so that results are always delivered in the correct order. If
|
|
1559
|
-
// enqueue has not been called before, then it is important to
|
|
1560
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
1561
|
-
// so that the async generator function has the opportunity to do
|
|
1562
|
-
// any necessary setup in a predictable way. This predictability
|
|
1563
|
-
// is why the Promise constructor synchronously invokes its
|
|
1564
|
-
// executor callback, and why async functions synchronously
|
|
1565
|
-
// execute code before the first await. Since we implement simple
|
|
1566
|
-
// async functions in terms of async generators, it is especially
|
|
1567
|
-
// important to get this right, even though it requires care.
|
|
1568
|
-
previousPromise ? previousPromise.then(
|
|
1569
|
-
callInvokeWithMethodAndArg,
|
|
1570
|
-
// Avoid propagating failures to Promises returned by later
|
|
1571
|
-
// invocations of the iterator.
|
|
1572
|
-
callInvokeWithMethodAndArg
|
|
1573
|
-
) : callInvokeWithMethodAndArg();
|
|
1574
|
-
}
|
|
1575
|
-
|
|
1576
|
-
// Define the unified helper method that is used to implement .next,
|
|
1577
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
1578
|
-
this._invoke = enqueue;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
1582
|
-
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
1583
|
-
return this;
|
|
1584
|
-
});
|
|
1585
|
-
exports.AsyncIterator = AsyncIterator;
|
|
1586
|
-
|
|
1587
|
-
// Note that simple async functions are implemented on top of
|
|
1588
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
1589
|
-
// the final result produced by the iterator.
|
|
1590
|
-
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
1591
|
-
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
|
1592
|
-
|
|
1593
|
-
var iter = new AsyncIterator(
|
|
1594
|
-
wrap(innerFn, outerFn, self, tryLocsList),
|
|
1595
|
-
PromiseImpl
|
|
1596
|
-
);
|
|
1597
|
-
|
|
1598
|
-
return exports.isGeneratorFunction(outerFn)
|
|
1599
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
1600
|
-
: iter.next().then(function(result) {
|
|
1601
|
-
return result.done ? result.value : iter.next();
|
|
1602
|
-
});
|
|
1603
|
-
};
|
|
1604
|
-
|
|
1605
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
1606
|
-
var state = GenStateSuspendedStart;
|
|
1607
|
-
|
|
1608
|
-
return function invoke(method, arg) {
|
|
1609
|
-
if (state === GenStateExecuting) {
|
|
1610
|
-
throw new Error("Generator is already running");
|
|
1611
|
-
}
|
|
1612
|
-
|
|
1613
|
-
if (state === GenStateCompleted) {
|
|
1614
|
-
if (method === "throw") {
|
|
1615
|
-
throw arg;
|
|
1616
|
-
}
|
|
1617
|
-
|
|
1618
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
1619
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
1620
|
-
return doneResult();
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
context.method = method;
|
|
1624
|
-
context.arg = arg;
|
|
1625
|
-
|
|
1626
|
-
while (true) {
|
|
1627
|
-
var delegate = context.delegate;
|
|
1628
|
-
if (delegate) {
|
|
1629
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
1630
|
-
if (delegateResult) {
|
|
1631
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
1632
|
-
return delegateResult;
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
if (context.method === "next") {
|
|
1637
|
-
// Setting context._sent for legacy support of Babel's
|
|
1638
|
-
// function.sent implementation.
|
|
1639
|
-
context.sent = context._sent = context.arg;
|
|
1640
|
-
|
|
1641
|
-
} else if (context.method === "throw") {
|
|
1642
|
-
if (state === GenStateSuspendedStart) {
|
|
1643
|
-
state = GenStateCompleted;
|
|
1644
|
-
throw context.arg;
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
|
-
context.dispatchException(context.arg);
|
|
1648
|
-
|
|
1649
|
-
} else if (context.method === "return") {
|
|
1650
|
-
context.abrupt("return", context.arg);
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
state = GenStateExecuting;
|
|
1654
|
-
|
|
1655
|
-
var record = tryCatch(innerFn, self, context);
|
|
1656
|
-
if (record.type === "normal") {
|
|
1657
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
1658
|
-
// GenStateExecuting and loop back for another invocation.
|
|
1659
|
-
state = context.done
|
|
1660
|
-
? GenStateCompleted
|
|
1661
|
-
: GenStateSuspendedYield;
|
|
1662
|
-
|
|
1663
|
-
if (record.arg === ContinueSentinel) {
|
|
1664
|
-
continue;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
return {
|
|
1668
|
-
value: record.arg,
|
|
1669
|
-
done: context.done
|
|
1670
|
-
};
|
|
1671
|
-
|
|
1672
|
-
} else if (record.type === "throw") {
|
|
1673
|
-
state = GenStateCompleted;
|
|
1674
|
-
// Dispatch the exception by looping back around to the
|
|
1675
|
-
// context.dispatchException(context.arg) call above.
|
|
1676
|
-
context.method = "throw";
|
|
1677
|
-
context.arg = record.arg;
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
1684
|
-
// result, either by returning a { value, done } result from the
|
|
1685
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
1686
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
1687
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
1688
|
-
var method = delegate.iterator[context.method];
|
|
1689
|
-
if (method === undefined$1) {
|
|
1690
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
1691
|
-
// method always terminates the yield* loop.
|
|
1692
|
-
context.delegate = null;
|
|
1693
|
-
|
|
1694
|
-
if (context.method === "throw") {
|
|
1695
|
-
// Note: ["return"] must be used for ES3 parsing compatibility.
|
|
1696
|
-
if (delegate.iterator["return"]) {
|
|
1697
|
-
// If the delegate iterator has a return method, give it a
|
|
1698
|
-
// chance to clean up.
|
|
1699
|
-
context.method = "return";
|
|
1700
|
-
context.arg = undefined$1;
|
|
1701
|
-
maybeInvokeDelegate(delegate, context);
|
|
1702
|
-
|
|
1703
|
-
if (context.method === "throw") {
|
|
1704
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
1705
|
-
// "return" to "throw", let that override the TypeError below.
|
|
1706
|
-
return ContinueSentinel;
|
|
1707
|
-
}
|
|
1708
|
-
}
|
|
1709
|
-
|
|
1710
|
-
context.method = "throw";
|
|
1711
|
-
context.arg = new TypeError(
|
|
1712
|
-
"The iterator does not provide a 'throw' method");
|
|
1713
|
-
}
|
|
1714
|
-
|
|
1715
|
-
return ContinueSentinel;
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
1719
|
-
|
|
1720
|
-
if (record.type === "throw") {
|
|
1721
|
-
context.method = "throw";
|
|
1722
|
-
context.arg = record.arg;
|
|
1723
|
-
context.delegate = null;
|
|
1724
|
-
return ContinueSentinel;
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
var info = record.arg;
|
|
1728
|
-
|
|
1729
|
-
if (! info) {
|
|
1730
|
-
context.method = "throw";
|
|
1731
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
1732
|
-
context.delegate = null;
|
|
1733
|
-
return ContinueSentinel;
|
|
1734
|
-
}
|
|
1735
|
-
|
|
1736
|
-
if (info.done) {
|
|
1737
|
-
// Assign the result of the finished delegate to the temporary
|
|
1738
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
1739
|
-
context[delegate.resultName] = info.value;
|
|
1740
|
-
|
|
1741
|
-
// Resume execution at the desired location (see delegateYield).
|
|
1742
|
-
context.next = delegate.nextLoc;
|
|
1743
|
-
|
|
1744
|
-
// If context.method was "throw" but the delegate handled the
|
|
1745
|
-
// exception, let the outer generator proceed normally. If
|
|
1746
|
-
// context.method was "next", forget context.arg since it has been
|
|
1747
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
1748
|
-
// "return", allow the original .return call to continue in the
|
|
1749
|
-
// outer generator.
|
|
1750
|
-
if (context.method !== "return") {
|
|
1751
|
-
context.method = "next";
|
|
1752
|
-
context.arg = undefined$1;
|
|
1753
|
-
}
|
|
1754
|
-
|
|
1755
|
-
} else {
|
|
1756
|
-
// Re-yield the result returned by the delegate method.
|
|
1757
|
-
return info;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
1761
|
-
// the outer generator.
|
|
1762
|
-
context.delegate = null;
|
|
1763
|
-
return ContinueSentinel;
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
1767
|
-
// unified ._invoke helper method.
|
|
1768
|
-
defineIteratorMethods(Gp);
|
|
1769
|
-
|
|
1770
|
-
define(Gp, toStringTagSymbol, "Generator");
|
|
1771
|
-
|
|
1772
|
-
// A Generator should always return itself as the iterator object when the
|
|
1773
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
1774
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
1775
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
1776
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
1777
|
-
define(Gp, iteratorSymbol, function() {
|
|
1778
|
-
return this;
|
|
1779
|
-
});
|
|
1780
|
-
|
|
1781
|
-
define(Gp, "toString", function() {
|
|
1782
|
-
return "[object Generator]";
|
|
1783
|
-
});
|
|
1784
|
-
|
|
1785
|
-
function pushTryEntry(locs) {
|
|
1786
|
-
var entry = { tryLoc: locs[0] };
|
|
1787
|
-
|
|
1788
|
-
if (1 in locs) {
|
|
1789
|
-
entry.catchLoc = locs[1];
|
|
1790
|
-
}
|
|
1791
|
-
|
|
1792
|
-
if (2 in locs) {
|
|
1793
|
-
entry.finallyLoc = locs[2];
|
|
1794
|
-
entry.afterLoc = locs[3];
|
|
1795
|
-
}
|
|
1796
|
-
|
|
1797
|
-
this.tryEntries.push(entry);
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
function resetTryEntry(entry) {
|
|
1801
|
-
var record = entry.completion || {};
|
|
1802
|
-
record.type = "normal";
|
|
1803
|
-
delete record.arg;
|
|
1804
|
-
entry.completion = record;
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
function Context(tryLocsList) {
|
|
1808
|
-
// The root entry object (effectively a try statement without a catch
|
|
1809
|
-
// or a finally block) gives us a place to store values thrown from
|
|
1810
|
-
// locations where there is no enclosing try statement.
|
|
1811
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
1812
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
1813
|
-
this.reset(true);
|
|
1814
|
-
}
|
|
1815
|
-
|
|
1816
|
-
exports.keys = function(object) {
|
|
1817
|
-
var keys = [];
|
|
1818
|
-
for (var key in object) {
|
|
1819
|
-
keys.push(key);
|
|
1820
|
-
}
|
|
1821
|
-
keys.reverse();
|
|
1822
|
-
|
|
1823
|
-
// Rather than returning an object with a next method, we keep
|
|
1824
|
-
// things simple and return the next function itself.
|
|
1825
|
-
return function next() {
|
|
1826
|
-
while (keys.length) {
|
|
1827
|
-
var key = keys.pop();
|
|
1828
|
-
if (key in object) {
|
|
1829
|
-
next.value = key;
|
|
1830
|
-
next.done = false;
|
|
1831
|
-
return next;
|
|
1832
|
-
}
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
// To avoid creating an additional object, we just hang the .value
|
|
1836
|
-
// and .done properties off the next function object itself. This
|
|
1837
|
-
// also ensures that the minifier will not anonymize the function.
|
|
1838
|
-
next.done = true;
|
|
1839
|
-
return next;
|
|
1840
|
-
};
|
|
1841
|
-
};
|
|
1842
|
-
|
|
1843
|
-
function values(iterable) {
|
|
1844
|
-
if (iterable) {
|
|
1845
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
1846
|
-
if (iteratorMethod) {
|
|
1847
|
-
return iteratorMethod.call(iterable);
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1850
|
-
if (typeof iterable.next === "function") {
|
|
1851
|
-
return iterable;
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
if (!isNaN(iterable.length)) {
|
|
1855
|
-
var i = -1, next = function next() {
|
|
1856
|
-
while (++i < iterable.length) {
|
|
1857
|
-
if (hasOwn.call(iterable, i)) {
|
|
1858
|
-
next.value = iterable[i];
|
|
1859
|
-
next.done = false;
|
|
1860
|
-
return next;
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
|
-
next.value = undefined$1;
|
|
1865
|
-
next.done = true;
|
|
1866
|
-
|
|
1867
|
-
return next;
|
|
1868
|
-
};
|
|
1869
|
-
|
|
1870
|
-
return next.next = next;
|
|
1871
|
-
}
|
|
1872
|
-
}
|
|
1873
|
-
|
|
1874
|
-
// Return an iterator with no values.
|
|
1875
|
-
return { next: doneResult };
|
|
1876
|
-
}
|
|
1877
|
-
exports.values = values;
|
|
1878
|
-
|
|
1879
|
-
function doneResult() {
|
|
1880
|
-
return { value: undefined$1, done: true };
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
|
-
Context.prototype = {
|
|
1884
|
-
constructor: Context,
|
|
1885
|
-
|
|
1886
|
-
reset: function(skipTempReset) {
|
|
1887
|
-
this.prev = 0;
|
|
1888
|
-
this.next = 0;
|
|
1889
|
-
// Resetting context._sent for legacy support of Babel's
|
|
1890
|
-
// function.sent implementation.
|
|
1891
|
-
this.sent = this._sent = undefined$1;
|
|
1892
|
-
this.done = false;
|
|
1893
|
-
this.delegate = null;
|
|
1894
|
-
|
|
1895
|
-
this.method = "next";
|
|
1896
|
-
this.arg = undefined$1;
|
|
1897
|
-
|
|
1898
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
1899
|
-
|
|
1900
|
-
if (!skipTempReset) {
|
|
1901
|
-
for (var name in this) {
|
|
1902
|
-
// Not sure about the optimal order of these conditions:
|
|
1903
|
-
if (name.charAt(0) === "t" &&
|
|
1904
|
-
hasOwn.call(this, name) &&
|
|
1905
|
-
!isNaN(+name.slice(1))) {
|
|
1906
|
-
this[name] = undefined$1;
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
}
|
|
1910
|
-
},
|
|
1911
|
-
|
|
1912
|
-
stop: function() {
|
|
1913
|
-
this.done = true;
|
|
1914
|
-
|
|
1915
|
-
var rootEntry = this.tryEntries[0];
|
|
1916
|
-
var rootRecord = rootEntry.completion;
|
|
1917
|
-
if (rootRecord.type === "throw") {
|
|
1918
|
-
throw rootRecord.arg;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
1921
|
-
return this.rval;
|
|
1922
|
-
},
|
|
1923
|
-
|
|
1924
|
-
dispatchException: function(exception) {
|
|
1925
|
-
if (this.done) {
|
|
1926
|
-
throw exception;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
var context = this;
|
|
1930
|
-
function handle(loc, caught) {
|
|
1931
|
-
record.type = "throw";
|
|
1932
|
-
record.arg = exception;
|
|
1933
|
-
context.next = loc;
|
|
1934
|
-
|
|
1935
|
-
if (caught) {
|
|
1936
|
-
// If the dispatched exception was caught by a catch block,
|
|
1937
|
-
// then let that catch block handle the exception normally.
|
|
1938
|
-
context.method = "next";
|
|
1939
|
-
context.arg = undefined$1;
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
|
-
return !! caught;
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1946
|
-
var entry = this.tryEntries[i];
|
|
1947
|
-
var record = entry.completion;
|
|
1948
|
-
|
|
1949
|
-
if (entry.tryLoc === "root") {
|
|
1950
|
-
// Exception thrown outside of any try block that could handle
|
|
1951
|
-
// it, so set the completion value of the entire function to
|
|
1952
|
-
// throw the exception.
|
|
1953
|
-
return handle("end");
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
if (entry.tryLoc <= this.prev) {
|
|
1957
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
1958
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
1959
|
-
|
|
1960
|
-
if (hasCatch && hasFinally) {
|
|
1961
|
-
if (this.prev < entry.catchLoc) {
|
|
1962
|
-
return handle(entry.catchLoc, true);
|
|
1963
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
1964
|
-
return handle(entry.finallyLoc);
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
} else if (hasCatch) {
|
|
1968
|
-
if (this.prev < entry.catchLoc) {
|
|
1969
|
-
return handle(entry.catchLoc, true);
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
} else if (hasFinally) {
|
|
1973
|
-
if (this.prev < entry.finallyLoc) {
|
|
1974
|
-
return handle(entry.finallyLoc);
|
|
1975
|
-
}
|
|
1976
|
-
|
|
1977
|
-
} else {
|
|
1978
|
-
throw new Error("try statement without catch or finally");
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1982
|
-
},
|
|
1983
|
-
|
|
1984
|
-
abrupt: function(type, arg) {
|
|
1985
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
1986
|
-
var entry = this.tryEntries[i];
|
|
1987
|
-
if (entry.tryLoc <= this.prev &&
|
|
1988
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
1989
|
-
this.prev < entry.finallyLoc) {
|
|
1990
|
-
var finallyEntry = entry;
|
|
1991
|
-
break;
|
|
1992
|
-
}
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
if (finallyEntry &&
|
|
1996
|
-
(type === "break" ||
|
|
1997
|
-
type === "continue") &&
|
|
1998
|
-
finallyEntry.tryLoc <= arg &&
|
|
1999
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2000
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2001
|
-
// location outside the try/catch block.
|
|
2002
|
-
finallyEntry = null;
|
|
2003
|
-
}
|
|
2004
|
-
|
|
2005
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2006
|
-
record.type = type;
|
|
2007
|
-
record.arg = arg;
|
|
2008
|
-
|
|
2009
|
-
if (finallyEntry) {
|
|
2010
|
-
this.method = "next";
|
|
2011
|
-
this.next = finallyEntry.finallyLoc;
|
|
2012
|
-
return ContinueSentinel;
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
return this.complete(record);
|
|
2016
|
-
},
|
|
2017
|
-
|
|
2018
|
-
complete: function(record, afterLoc) {
|
|
2019
|
-
if (record.type === "throw") {
|
|
2020
|
-
throw record.arg;
|
|
2021
|
-
}
|
|
2022
|
-
|
|
2023
|
-
if (record.type === "break" ||
|
|
2024
|
-
record.type === "continue") {
|
|
2025
|
-
this.next = record.arg;
|
|
2026
|
-
} else if (record.type === "return") {
|
|
2027
|
-
this.rval = this.arg = record.arg;
|
|
2028
|
-
this.method = "return";
|
|
2029
|
-
this.next = "end";
|
|
2030
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2031
|
-
this.next = afterLoc;
|
|
2032
|
-
}
|
|
2033
|
-
|
|
2034
|
-
return ContinueSentinel;
|
|
2035
|
-
},
|
|
2036
|
-
|
|
2037
|
-
finish: function(finallyLoc) {
|
|
2038
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2039
|
-
var entry = this.tryEntries[i];
|
|
2040
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2041
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2042
|
-
resetTryEntry(entry);
|
|
2043
|
-
return ContinueSentinel;
|
|
2044
|
-
}
|
|
2045
|
-
}
|
|
2046
|
-
},
|
|
2047
|
-
|
|
2048
|
-
"catch": function(tryLoc) {
|
|
2049
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2050
|
-
var entry = this.tryEntries[i];
|
|
2051
|
-
if (entry.tryLoc === tryLoc) {
|
|
2052
|
-
var record = entry.completion;
|
|
2053
|
-
if (record.type === "throw") {
|
|
2054
|
-
var thrown = record.arg;
|
|
2055
|
-
resetTryEntry(entry);
|
|
2056
|
-
}
|
|
2057
|
-
return thrown;
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
// The context.catch method must only be called with a location
|
|
2062
|
-
// argument that corresponds to a known catch block.
|
|
2063
|
-
throw new Error("illegal catch attempt");
|
|
2064
|
-
},
|
|
2065
|
-
|
|
2066
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2067
|
-
this.delegate = {
|
|
2068
|
-
iterator: values(iterable),
|
|
2069
|
-
resultName: resultName,
|
|
2070
|
-
nextLoc: nextLoc
|
|
2071
|
-
};
|
|
2072
|
-
|
|
2073
|
-
if (this.method === "next") {
|
|
2074
|
-
// Deliberately forget the last sent value so that we don't
|
|
2075
|
-
// accidentally pass it on to the delegate.
|
|
2076
|
-
this.arg = undefined$1;
|
|
2077
|
-
}
|
|
2078
|
-
|
|
2079
|
-
return ContinueSentinel;
|
|
2080
|
-
}
|
|
2081
|
-
};
|
|
2082
|
-
|
|
2083
|
-
// Regardless of whether this script is executing as a CommonJS module
|
|
2084
|
-
// or not, return the runtime object so that we can declare the variable
|
|
2085
|
-
// regeneratorRuntime in the outer scope, which allows this module to be
|
|
2086
|
-
// injected easily by `bin/regenerator --include-runtime script.js`.
|
|
2087
|
-
return exports;
|
|
2088
|
-
|
|
2089
|
-
}(
|
|
2090
|
-
// If this script is executing as a CommonJS module, use module.exports
|
|
2091
|
-
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
|
2092
|
-
// object. Either way, the resulting object will be used to initialize
|
|
2093
|
-
// the regeneratorRuntime variable at the top of this file.
|
|
2094
|
-
module.exports
|
|
2095
|
-
));
|
|
2096
|
-
|
|
2097
|
-
try {
|
|
2098
|
-
regeneratorRuntime = runtime;
|
|
2099
|
-
} catch (accidentalStrictMode) {
|
|
2100
|
-
// This module should not be running in strict mode, so the above
|
|
2101
|
-
// assignment should always work unless something is misconfigured. Just
|
|
2102
|
-
// in case runtime.js accidentally runs in strict mode, in modern engines
|
|
2103
|
-
// we can explicitly access globalThis. In older engines we can escape
|
|
2104
|
-
// strict mode using a global Function call. This could conceivably fail
|
|
2105
|
-
// if a Content Security Policy forbids using Function, but in that case
|
|
2106
|
-
// the proper solution is to fix the accidental strict mode problem. If
|
|
2107
|
-
// you've misconfigured your bundler to force strict mode and applied a
|
|
2108
|
-
// CSP to forbid Function, and you're not willing to fix either of those
|
|
2109
|
-
// problems, please detail your unique predicament in a GitHub issue.
|
|
2110
|
-
if (typeof globalThis === "object") {
|
|
2111
|
-
globalThis.regeneratorRuntime = runtime;
|
|
2112
|
-
} else {
|
|
2113
|
-
Function("r", "regeneratorRuntime = r")(runtime);
|
|
2114
|
-
}
|
|
2115
|
-
}
|
|
2116
|
-
});
|
|
2117
|
-
|
|
2118
|
-
/**
|
|
2119
|
-
* A specialized version of `_.reduce` for arrays without support for
|
|
2120
|
-
* iteratee shorthands.
|
|
2121
|
-
*
|
|
2122
|
-
* @private
|
|
2123
|
-
* @param {Array} [array] The array to iterate over.
|
|
2124
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2125
|
-
* @param {*} [accumulator] The initial value.
|
|
2126
|
-
* @param {boolean} [initAccum] Specify using the first element of `array` as
|
|
2127
|
-
* the initial value.
|
|
2128
|
-
* @returns {*} Returns the accumulated value.
|
|
2129
|
-
*/
|
|
2130
|
-
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
2131
|
-
var index = -1,
|
|
2132
|
-
length = array == null ? 0 : array.length;
|
|
2133
|
-
|
|
2134
|
-
if (initAccum && length) {
|
|
2135
|
-
accumulator = array[++index];
|
|
2136
|
-
}
|
|
2137
|
-
while (++index < length) {
|
|
2138
|
-
accumulator = iteratee(accumulator, array[index], index, array);
|
|
2139
|
-
}
|
|
2140
|
-
return accumulator;
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
|
-
var _arrayReduce = arrayReduce;
|
|
2144
|
-
|
|
2145
|
-
/**
|
|
2146
|
-
* The base implementation of `_.propertyOf` without support for deep paths.
|
|
2147
|
-
*
|
|
2148
|
-
* @private
|
|
2149
|
-
* @param {Object} object The object to query.
|
|
2150
|
-
* @returns {Function} Returns the new accessor function.
|
|
2151
|
-
*/
|
|
2152
|
-
function basePropertyOf(object) {
|
|
2153
|
-
return function(key) {
|
|
2154
|
-
return object == null ? undefined : object[key];
|
|
2155
|
-
};
|
|
2156
|
-
}
|
|
2157
|
-
|
|
2158
|
-
var _basePropertyOf = basePropertyOf;
|
|
2159
|
-
|
|
2160
|
-
/** Used to map Latin Unicode letters to basic Latin letters. */
|
|
2161
|
-
var deburredLetters = {
|
|
2162
|
-
// Latin-1 Supplement block.
|
|
2163
|
-
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
|
|
2164
|
-
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
|
|
2165
|
-
'\xc7': 'C', '\xe7': 'c',
|
|
2166
|
-
'\xd0': 'D', '\xf0': 'd',
|
|
2167
|
-
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
|
|
2168
|
-
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
|
|
2169
|
-
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
|
|
2170
|
-
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
|
|
2171
|
-
'\xd1': 'N', '\xf1': 'n',
|
|
2172
|
-
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
|
|
2173
|
-
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
|
|
2174
|
-
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
|
|
2175
|
-
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
|
|
2176
|
-
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
|
|
2177
|
-
'\xc6': 'Ae', '\xe6': 'ae',
|
|
2178
|
-
'\xde': 'Th', '\xfe': 'th',
|
|
2179
|
-
'\xdf': 'ss',
|
|
2180
|
-
// Latin Extended-A block.
|
|
2181
|
-
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
|
|
2182
|
-
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
|
|
2183
|
-
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
|
|
2184
|
-
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
|
|
2185
|
-
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
|
|
2186
|
-
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
|
|
2187
|
-
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
|
|
2188
|
-
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
|
|
2189
|
-
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
|
|
2190
|
-
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
|
|
2191
|
-
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
|
|
2192
|
-
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
|
|
2193
|
-
'\u0134': 'J', '\u0135': 'j',
|
|
2194
|
-
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
|
|
2195
|
-
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
|
|
2196
|
-
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
|
|
2197
|
-
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
|
|
2198
|
-
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
|
|
2199
|
-
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
|
|
2200
|
-
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
|
|
2201
|
-
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
|
|
2202
|
-
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
|
|
2203
|
-
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
|
|
2204
|
-
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
|
|
2205
|
-
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
|
|
2206
|
-
'\u0163': 't', '\u0165': 't', '\u0167': 't',
|
|
2207
|
-
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
|
|
2208
|
-
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
|
|
2209
|
-
'\u0174': 'W', '\u0175': 'w',
|
|
2210
|
-
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
|
|
2211
|
-
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
|
|
2212
|
-
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
|
|
2213
|
-
'\u0132': 'IJ', '\u0133': 'ij',
|
|
2214
|
-
'\u0152': 'Oe', '\u0153': 'oe',
|
|
2215
|
-
'\u0149': "'n", '\u017f': 's'
|
|
2216
|
-
};
|
|
2217
|
-
|
|
2218
|
-
/**
|
|
2219
|
-
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
|
|
2220
|
-
* letters to basic Latin letters.
|
|
2221
|
-
*
|
|
2222
|
-
* @private
|
|
2223
|
-
* @param {string} letter The matched letter to deburr.
|
|
2224
|
-
* @returns {string} Returns the deburred letter.
|
|
2225
|
-
*/
|
|
2226
|
-
var deburrLetter = _basePropertyOf(deburredLetters);
|
|
2227
|
-
|
|
2228
|
-
var _deburrLetter = deburrLetter;
|
|
2229
|
-
|
|
2230
|
-
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
2231
|
-
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
2232
|
-
|
|
2233
|
-
/** Used to compose unicode character classes. */
|
|
2234
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f',
|
|
2235
|
-
reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
|
|
2236
|
-
rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
|
|
2237
|
-
rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
|
2238
|
-
|
|
2239
|
-
/** Used to compose unicode capture groups. */
|
|
2240
|
-
var rsCombo$1 = '[' + rsComboRange$1 + ']';
|
|
2241
|
-
|
|
2242
|
-
/**
|
|
2243
|
-
* Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
|
|
2244
|
-
* [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
|
|
2245
|
-
*/
|
|
2246
|
-
var reComboMark = RegExp(rsCombo$1, 'g');
|
|
2247
|
-
|
|
2248
|
-
/**
|
|
2249
|
-
* Deburrs `string` by converting
|
|
2250
|
-
* [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
|
|
2251
|
-
* and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
|
|
2252
|
-
* letters to basic Latin letters and removing
|
|
2253
|
-
* [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
|
|
2254
|
-
*
|
|
2255
|
-
* @static
|
|
2256
|
-
* @memberOf _
|
|
2257
|
-
* @since 3.0.0
|
|
2258
|
-
* @category String
|
|
2259
|
-
* @param {string} [string=''] The string to deburr.
|
|
2260
|
-
* @returns {string} Returns the deburred string.
|
|
2261
|
-
* @example
|
|
2262
|
-
*
|
|
2263
|
-
* _.deburr('déjà vu');
|
|
2264
|
-
* // => 'deja vu'
|
|
2265
|
-
*/
|
|
2266
|
-
function deburr(string) {
|
|
2267
|
-
string = toString_1(string);
|
|
2268
|
-
return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
|
2269
|
-
}
|
|
2270
|
-
|
|
2271
|
-
var deburr_1 = deburr;
|
|
2272
|
-
|
|
2273
|
-
/** Used to match words composed of alphanumeric characters. */
|
|
2274
|
-
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
2275
|
-
|
|
2276
|
-
/**
|
|
2277
|
-
* Splits an ASCII `string` into an array of its words.
|
|
2278
|
-
*
|
|
2279
|
-
* @private
|
|
2280
|
-
* @param {string} The string to inspect.
|
|
2281
|
-
* @returns {Array} Returns the words of `string`.
|
|
2282
|
-
*/
|
|
2283
|
-
function asciiWords(string) {
|
|
2284
|
-
return string.match(reAsciiWord) || [];
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
var _asciiWords = asciiWords;
|
|
2288
|
-
|
|
2289
|
-
/** Used to detect strings that need a more robust regexp to match words. */
|
|
2290
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
2291
|
-
|
|
2292
|
-
/**
|
|
2293
|
-
* Checks if `string` contains a word composed of Unicode symbols.
|
|
2294
|
-
*
|
|
2295
|
-
* @private
|
|
2296
|
-
* @param {string} string The string to inspect.
|
|
2297
|
-
* @returns {boolean} Returns `true` if a word is found, else `false`.
|
|
2298
|
-
*/
|
|
2299
|
-
function hasUnicodeWord(string) {
|
|
2300
|
-
return reHasUnicodeWord.test(string);
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
var _hasUnicodeWord = hasUnicodeWord;
|
|
2304
|
-
|
|
2305
|
-
/** Used to compose unicode character classes. */
|
|
2306
|
-
var rsAstralRange = '\\ud800-\\udfff',
|
|
2307
|
-
rsComboMarksRange = '\\u0300-\\u036f',
|
|
2308
|
-
reComboHalfMarksRange = '\\ufe20-\\ufe2f',
|
|
2309
|
-
rsComboSymbolsRange = '\\u20d0-\\u20ff',
|
|
2310
|
-
rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
|
2311
|
-
rsDingbatRange = '\\u2700-\\u27bf',
|
|
2312
|
-
rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
|
2313
|
-
rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
|
2314
|
-
rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
|
2315
|
-
rsPunctuationRange = '\\u2000-\\u206f',
|
|
2316
|
-
rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
|
|
2317
|
-
rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
|
2318
|
-
rsVarRange = '\\ufe0e\\ufe0f',
|
|
2319
|
-
rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
2320
|
-
|
|
2321
|
-
/** Used to compose unicode capture groups. */
|
|
2322
|
-
var rsApos$1 = "['\u2019]",
|
|
2323
|
-
rsBreak = '[' + rsBreakRange + ']',
|
|
2324
|
-
rsCombo = '[' + rsComboRange + ']',
|
|
2325
|
-
rsDigits = '\\d+',
|
|
2326
|
-
rsDingbat = '[' + rsDingbatRange + ']',
|
|
2327
|
-
rsLower = '[' + rsLowerRange + ']',
|
|
2328
|
-
rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
|
2329
|
-
rsFitz = '\\ud83c[\\udffb-\\udfff]',
|
|
2330
|
-
rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
|
2331
|
-
rsNonAstral = '[^' + rsAstralRange + ']',
|
|
2332
|
-
rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
|
|
2333
|
-
rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
|
|
2334
|
-
rsUpper = '[' + rsUpperRange + ']',
|
|
2335
|
-
rsZWJ = '\\u200d';
|
|
2336
|
-
|
|
2337
|
-
/** Used to compose unicode regexes. */
|
|
2338
|
-
var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
|
2339
|
-
rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
|
2340
|
-
rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
|
|
2341
|
-
rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
|
|
2342
|
-
reOptMod = rsModifier + '?',
|
|
2343
|
-
rsOptVar = '[' + rsVarRange + ']?',
|
|
2344
|
-
rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
|
2345
|
-
rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
|
2346
|
-
rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
|
2347
|
-
rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
|
2348
|
-
rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
|
|
2349
|
-
|
|
2350
|
-
/** Used to match complex or compound words. */
|
|
2351
|
-
var reUnicodeWord = RegExp([
|
|
2352
|
-
rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
|
|
2353
|
-
rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
|
|
2354
|
-
rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
|
|
2355
|
-
rsUpper + '+' + rsOptContrUpper,
|
|
2356
|
-
rsOrdUpper,
|
|
2357
|
-
rsOrdLower,
|
|
2358
|
-
rsDigits,
|
|
2359
|
-
rsEmoji
|
|
2360
|
-
].join('|'), 'g');
|
|
2361
|
-
|
|
2362
|
-
/**
|
|
2363
|
-
* Splits a Unicode `string` into an array of its words.
|
|
2364
|
-
*
|
|
2365
|
-
* @private
|
|
2366
|
-
* @param {string} The string to inspect.
|
|
2367
|
-
* @returns {Array} Returns the words of `string`.
|
|
2368
|
-
*/
|
|
2369
|
-
function unicodeWords(string) {
|
|
2370
|
-
return string.match(reUnicodeWord) || [];
|
|
2371
|
-
}
|
|
2372
|
-
|
|
2373
|
-
var _unicodeWords = unicodeWords;
|
|
2374
|
-
|
|
2375
|
-
/**
|
|
2376
|
-
* Splits `string` into an array of its words.
|
|
2377
|
-
*
|
|
2378
|
-
* @static
|
|
2379
|
-
* @memberOf _
|
|
2380
|
-
* @since 3.0.0
|
|
2381
|
-
* @category String
|
|
2382
|
-
* @param {string} [string=''] The string to inspect.
|
|
2383
|
-
* @param {RegExp|string} [pattern] The pattern to match words.
|
|
2384
|
-
* @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
|
|
2385
|
-
* @returns {Array} Returns the words of `string`.
|
|
2386
|
-
* @example
|
|
2387
|
-
*
|
|
2388
|
-
* _.words('fred, barney, & pebbles');
|
|
2389
|
-
* // => ['fred', 'barney', 'pebbles']
|
|
2390
|
-
*
|
|
2391
|
-
* _.words('fred, barney, & pebbles', /[^, ]+/g);
|
|
2392
|
-
* // => ['fred', 'barney', '&', 'pebbles']
|
|
2393
|
-
*/
|
|
2394
|
-
function words(string, pattern, guard) {
|
|
2395
|
-
string = toString_1(string);
|
|
2396
|
-
pattern = guard ? undefined : pattern;
|
|
2397
|
-
|
|
2398
|
-
if (pattern === undefined) {
|
|
2399
|
-
return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
|
2400
|
-
}
|
|
2401
|
-
return string.match(pattern) || [];
|
|
2402
|
-
}
|
|
2403
|
-
|
|
2404
|
-
var words_1 = words;
|
|
2405
|
-
|
|
2406
|
-
/** Used to compose unicode capture groups. */
|
|
2407
|
-
var rsApos = "['\u2019]";
|
|
2408
|
-
|
|
2409
|
-
/** Used to match apostrophes. */
|
|
2410
|
-
var reApos = RegExp(rsApos, 'g');
|
|
2411
|
-
|
|
2412
|
-
/**
|
|
2413
|
-
* Creates a function like `_.camelCase`.
|
|
2414
|
-
*
|
|
2415
|
-
* @private
|
|
2416
|
-
* @param {Function} callback The function to combine each word.
|
|
2417
|
-
* @returns {Function} Returns the new compounder function.
|
|
2418
|
-
*/
|
|
2419
|
-
function createCompounder(callback) {
|
|
2420
|
-
return function(string) {
|
|
2421
|
-
return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
|
2422
|
-
};
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
var _createCompounder = createCompounder;
|
|
2426
|
-
|
|
2427
|
-
/**
|
|
2428
|
-
* Converts `string`, as space separated words, to upper case.
|
|
2429
|
-
*
|
|
2430
|
-
* @static
|
|
2431
|
-
* @memberOf _
|
|
2432
|
-
* @since 4.0.0
|
|
2433
|
-
* @category String
|
|
2434
|
-
* @param {string} [string=''] The string to convert.
|
|
2435
|
-
* @returns {string} Returns the upper cased string.
|
|
2436
|
-
* @example
|
|
2437
|
-
*
|
|
2438
|
-
* _.upperCase('--foo-bar');
|
|
2439
|
-
* // => 'FOO BAR'
|
|
2440
|
-
*
|
|
2441
|
-
* _.upperCase('fooBar');
|
|
2442
|
-
* // => 'FOO BAR'
|
|
2443
|
-
*
|
|
2444
|
-
* _.upperCase('__foo_bar__');
|
|
2445
|
-
* // => 'FOO BAR'
|
|
2446
|
-
*/
|
|
2447
|
-
var upperCase = _createCompounder(function(result, word, index) {
|
|
2448
|
-
return result + (index ? ' ' : '') + word.toUpperCase();
|
|
2449
|
-
});
|
|
2450
|
-
|
|
2451
|
-
var upperCase_1 = upperCase;
|
|
2452
|
-
|
|
2453
|
-
/**
|
|
2454
|
-
* Converts `string`, as space separated words, to lower case.
|
|
2455
|
-
*
|
|
2456
|
-
* @static
|
|
2457
|
-
* @memberOf _
|
|
2458
|
-
* @since 4.0.0
|
|
2459
|
-
* @category String
|
|
2460
|
-
* @param {string} [string=''] The string to convert.
|
|
2461
|
-
* @returns {string} Returns the lower cased string.
|
|
2462
|
-
* @example
|
|
2463
|
-
*
|
|
2464
|
-
* _.lowerCase('--Foo-Bar--');
|
|
2465
|
-
* // => 'foo bar'
|
|
2466
|
-
*
|
|
2467
|
-
* _.lowerCase('fooBar');
|
|
2468
|
-
* // => 'foo bar'
|
|
2469
|
-
*
|
|
2470
|
-
* _.lowerCase('__FOO_BAR__');
|
|
2471
|
-
* // => 'foo bar'
|
|
2472
|
-
*/
|
|
2473
|
-
var lowerCase = _createCompounder(function(result, word, index) {
|
|
2474
|
-
return result + (index ? ' ' : '') + word.toLowerCase();
|
|
2475
|
-
});
|
|
2476
|
-
|
|
2477
|
-
var lowerCase_1 = lowerCase;
|
|
29
|
+
return React.useContext(StateContext);
|
|
30
|
+
};
|
|
2478
31
|
|
|
2479
32
|
function truncate() {
|
|
2480
33
|
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
@@ -2502,7 +55,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2502
55
|
var localizedMonth = month;
|
|
2503
56
|
|
|
2504
57
|
if (isUpperCase) {
|
|
2505
|
-
localizedMonth =
|
|
58
|
+
localizedMonth = lodash.upperCase(month);
|
|
2506
59
|
}
|
|
2507
60
|
|
|
2508
61
|
var year = dateTime.getFullYear();
|
|
@@ -2515,7 +68,7 @@ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestam
|
|
|
2515
68
|
var timetoShow;
|
|
2516
69
|
|
|
2517
70
|
if (localizedMonths) {
|
|
2518
|
-
localizedMonth =
|
|
71
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
2519
72
|
}
|
|
2520
73
|
|
|
2521
74
|
if (localizedMeridiem) {
|
|
@@ -2545,17 +98,17 @@ function formatter(value, unit, suffix, date, config) {
|
|
|
2545
98
|
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
2546
99
|
// unit here refers to seconds, minute, minutes,...
|
|
2547
100
|
|
|
2548
|
-
var localizedSuffix =
|
|
101
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
2549
102
|
var localizedUnitOfTime;
|
|
2550
103
|
|
|
2551
104
|
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
2552
105
|
return timestampToFormat(value, unit, suffix, date, config);
|
|
2553
106
|
} else if (value > 1) {
|
|
2554
|
-
localizedUnitOfTime =
|
|
107
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
2555
108
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
2556
109
|
}
|
|
2557
110
|
|
|
2558
|
-
localizedUnitOfTime =
|
|
111
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
2559
112
|
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
2560
113
|
}
|
|
2561
114
|
|
|
@@ -2608,10 +161,10 @@ var clientWidths = {
|
|
|
2608
161
|
tablet: 1024
|
|
2609
162
|
};
|
|
2610
163
|
var clientWidth = function clientWidth(device) {
|
|
2611
|
-
var foundDeviceWidth =
|
|
164
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
2612
165
|
|
|
2613
166
|
if (foundDeviceWidth) {
|
|
2614
|
-
return
|
|
167
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
2615
168
|
}
|
|
2616
169
|
|
|
2617
170
|
return false;
|
|
@@ -2629,25 +182,25 @@ function isExternalStory() {
|
|
|
2629
182
|
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
2630
183
|
_story$metadata = story.metadata,
|
|
2631
184
|
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
2632
|
-
return storyTemplate === "news-elsewhere" ?
|
|
185
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
2633
186
|
} // Adds target='_blank' attribute to anchor tags if not present
|
|
2634
187
|
var isEmpty = function isEmpty(value) {
|
|
2635
188
|
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
2636
|
-
|
|
189
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
2637
190
|
};
|
|
2638
|
-
|
|
2639
|
-
"sketches-host":
|
|
2640
|
-
"cdn-name":
|
|
2641
|
-
"cdn-image":
|
|
191
|
+
PropTypes__default["default"].shape({
|
|
192
|
+
"sketches-host": PropTypes__default["default"].string,
|
|
193
|
+
"cdn-name": PropTypes__default["default"].string,
|
|
194
|
+
"cdn-image": PropTypes__default["default"].string
|
|
2642
195
|
});
|
|
2643
|
-
|
|
2644
|
-
headline:
|
|
2645
|
-
"last-published-at":
|
|
2646
|
-
subheadline:
|
|
196
|
+
PropTypes__default["default"].shape({
|
|
197
|
+
headline: PropTypes__default["default"].string,
|
|
198
|
+
"last-published-at": PropTypes__default["default"].number,
|
|
199
|
+
subheadline: PropTypes__default["default"].string
|
|
2647
200
|
});
|
|
2648
201
|
var getStoryUrl = function getStoryUrl(story) {
|
|
2649
202
|
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
2650
|
-
return
|
|
203
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
2651
204
|
};
|
|
2652
205
|
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
2653
206
|
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -2655,17 +208,17 @@ var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
|
2655
208
|
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
2656
209
|
|
|
2657
210
|
if (timezone && template === "story") {
|
|
2658
|
-
var zonedTime = timezone && utcToZonedTime(date, timezone);
|
|
2659
|
-
var formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
211
|
+
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
212
|
+
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
2660
213
|
timeZone: timezone
|
|
2661
214
|
});
|
|
2662
215
|
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
2663
|
-
return /*#__PURE__*/
|
|
216
|
+
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
2664
217
|
dateTime: formatZonedTime
|
|
2665
218
|
}, timeStamp);
|
|
2666
219
|
}
|
|
2667
220
|
|
|
2668
|
-
return /*#__PURE__*/
|
|
221
|
+
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
2669
222
|
date: date,
|
|
2670
223
|
formatter: function formatter(value, unit, suffix, date) {
|
|
2671
224
|
return _formatter(value, unit, suffix, date, config);
|
|
@@ -2679,7 +232,7 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
2679
232
|
_ref$color = _ref.color,
|
|
2680
233
|
color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
|
|
2681
234
|
positionTop = _ref.positionTop;
|
|
2682
|
-
return /*#__PURE__*/
|
|
235
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2683
236
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2684
237
|
width: width,
|
|
2685
238
|
height: height,
|
|
@@ -2688,28 +241,28 @@ var CrownIcon = function CrownIcon(_ref) {
|
|
|
2688
241
|
position: "relative",
|
|
2689
242
|
top: positionTop
|
|
2690
243
|
}
|
|
2691
|
-
}, /*#__PURE__*/
|
|
244
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2692
245
|
fill: "none",
|
|
2693
246
|
fillRule: "evenodd",
|
|
2694
247
|
stroke: "none",
|
|
2695
248
|
strokeWidth: "1"
|
|
2696
|
-
}, /*#__PURE__*/
|
|
249
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2697
250
|
transform: "translate(8 8)"
|
|
2698
|
-
}, /*#__PURE__*/
|
|
251
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2699
252
|
d: "M0 0H24V24H0z"
|
|
2700
|
-
}), /*#__PURE__*/
|
|
253
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2701
254
|
fill: color,
|
|
2702
255
|
fillRule: "nonzero",
|
|
2703
256
|
transform: "translate(0 2)"
|
|
2704
|
-
}, /*#__PURE__*/
|
|
257
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2705
258
|
d: "M21.043 19.553c0-.743-.601-1.344-1.344-1.344h-15.4a1.343 1.343 0 100 2.688h15.4c.743 0 1.344-.603 1.344-1.344zM1.598 8.673c.022 0 .042 0 .064-.003l2.131 7.713h16.411l2.132-7.713c.022 0 .041.003.063.003a1.599 1.599 0 10-1.52-1.108L17.025 9.82 12.882 2.95a1.599 1.599 0 10-1.765 0L6.976 9.82 3.121 7.565a1.599 1.599 0 10-1.523 1.107z"
|
|
2706
259
|
}))))));
|
|
2707
260
|
};
|
|
2708
261
|
CrownIcon.propTypes = {
|
|
2709
|
-
height:
|
|
2710
|
-
width:
|
|
2711
|
-
color:
|
|
2712
|
-
positionTop:
|
|
262
|
+
height: PropTypes__default["default"].string,
|
|
263
|
+
width: PropTypes__default["default"].string,
|
|
264
|
+
color: PropTypes__default["default"].string,
|
|
265
|
+
positionTop: PropTypes__default["default"].string
|
|
2713
266
|
};
|
|
2714
267
|
|
|
2715
268
|
var KeyIcon = function KeyIcon(_ref) {
|
|
@@ -2718,7 +271,7 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2718
271
|
_ref$color = _ref.color,
|
|
2719
272
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2720
273
|
positionTop = _ref.positionTop;
|
|
2721
|
-
return /*#__PURE__*/
|
|
274
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2722
275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2723
276
|
width: width,
|
|
2724
277
|
height: height,
|
|
@@ -2727,16 +280,16 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2727
280
|
position: "relative",
|
|
2728
281
|
top: positionTop
|
|
2729
282
|
}
|
|
2730
|
-
}, /*#__PURE__*/
|
|
283
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2731
284
|
fill: "none",
|
|
2732
285
|
fillRule: "evenodd",
|
|
2733
286
|
stroke: "none",
|
|
2734
287
|
strokeWidth: "1"
|
|
2735
|
-
}, /*#__PURE__*/
|
|
288
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2736
289
|
transform: "translate(8 8)"
|
|
2737
|
-
}, /*#__PURE__*/
|
|
290
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2738
291
|
d: "M0 0H24V24H0z"
|
|
2739
|
-
}), /*#__PURE__*/
|
|
292
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2740
293
|
fill: color,
|
|
2741
294
|
fillRule: "nonzero",
|
|
2742
295
|
d: "M12.71 4.364A6.54 6.54 0 000 6.545a6.54 6.54 0 0012.71 2.182h4.745v4.364h4.363V8.727H24V4.364H12.71zM6.544 8.727a2.181 2.181 0 110-4.362 2.181 2.181 0 010 4.362z",
|
|
@@ -2744,10 +297,10 @@ var KeyIcon = function KeyIcon(_ref) {
|
|
|
2744
297
|
})))));
|
|
2745
298
|
};
|
|
2746
299
|
KeyIcon.propTypes = {
|
|
2747
|
-
height:
|
|
2748
|
-
width:
|
|
2749
|
-
color:
|
|
2750
|
-
positionTop:
|
|
300
|
+
height: PropTypes__default["default"].string,
|
|
301
|
+
width: PropTypes__default["default"].string,
|
|
302
|
+
color: PropTypes__default["default"].string,
|
|
303
|
+
positionTop: PropTypes__default["default"].string
|
|
2751
304
|
};
|
|
2752
305
|
|
|
2753
306
|
var LockIcon = function LockIcon(_ref) {
|
|
@@ -2756,7 +309,7 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
2756
309
|
_ref$color = _ref.color,
|
|
2757
310
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2758
311
|
positionTop = _ref.positionTop;
|
|
2759
|
-
return /*#__PURE__*/
|
|
312
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2760
313
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2761
314
|
width: width,
|
|
2762
315
|
height: height,
|
|
@@ -2765,28 +318,28 @@ var LockIcon = function LockIcon(_ref) {
|
|
|
2765
318
|
position: "relative",
|
|
2766
319
|
top: positionTop
|
|
2767
320
|
}
|
|
2768
|
-
}, /*#__PURE__*/
|
|
321
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2769
322
|
fill: "none",
|
|
2770
323
|
fillRule: "evenodd",
|
|
2771
324
|
stroke: "none",
|
|
2772
325
|
strokeWidth: "1"
|
|
2773
|
-
}, /*#__PURE__*/
|
|
326
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2774
327
|
transform: "translate(8 8)"
|
|
2775
|
-
}, /*#__PURE__*/
|
|
328
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2776
329
|
d: "M0 0H24V24H0z"
|
|
2777
|
-
}), /*#__PURE__*/
|
|
330
|
+
}), /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2778
331
|
fill: color,
|
|
2779
332
|
fillRule: "nonzero",
|
|
2780
333
|
transform: "translate(3)"
|
|
2781
|
-
}, /*#__PURE__*/
|
|
334
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2782
335
|
d: "M15.692 9h-.747V6c0-3.31-2.681-6-5.978-6C5.67 0 2.989 2.69 2.989 6v3h-.747A2.249 2.249 0 000 11.25v10.5A2.249 2.249 0 002.242 24h13.45a2.249 2.249 0 002.242-2.25v-10.5A2.249 2.249 0 0015.692 9zM4.982 6c0-2.206 1.787-4 3.985-4s3.985 1.794 3.985 4v3h-7.97V6z"
|
|
2783
336
|
}))))));
|
|
2784
337
|
};
|
|
2785
338
|
LockIcon.propTypes = {
|
|
2786
|
-
height:
|
|
2787
|
-
width:
|
|
2788
|
-
color:
|
|
2789
|
-
positionTop:
|
|
339
|
+
height: PropTypes__default["default"].string,
|
|
340
|
+
width: PropTypes__default["default"].string,
|
|
341
|
+
color: PropTypes__default["default"].string,
|
|
342
|
+
positionTop: PropTypes__default["default"].string
|
|
2790
343
|
};
|
|
2791
344
|
|
|
2792
345
|
var StarIcon = function StarIcon(_ref) {
|
|
@@ -2796,7 +349,7 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
2796
349
|
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
2797
350
|
_ref$positionTop = _ref.positionTop,
|
|
2798
351
|
positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
|
|
2799
|
-
return /*#__PURE__*/
|
|
352
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2800
353
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2801
354
|
width: width,
|
|
2802
355
|
height: height,
|
|
@@ -2805,21 +358,21 @@ var StarIcon = function StarIcon(_ref) {
|
|
|
2805
358
|
position: "relative",
|
|
2806
359
|
top: positionTop
|
|
2807
360
|
}
|
|
2808
|
-
}, /*#__PURE__*/
|
|
361
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
2809
362
|
fill: "none",
|
|
2810
363
|
fillRule: "evenodd",
|
|
2811
364
|
stroke: "none",
|
|
2812
365
|
strokeWidth: "1"
|
|
2813
|
-
}, /*#__PURE__*/
|
|
366
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", null, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2814
367
|
fill: color,
|
|
2815
368
|
d: "M20 26L12.946577 29.7082039 14.2936609 21.854102 8.5873218 16.2917961 16.4732885 15.145898 20 8 23.5267115 15.145898 31.4126782 16.2917961 25.7063391 21.854102 27.053423 29.7082039z"
|
|
2816
369
|
}))));
|
|
2817
370
|
};
|
|
2818
371
|
StarIcon.propTypes = {
|
|
2819
|
-
height:
|
|
2820
|
-
width:
|
|
2821
|
-
color:
|
|
2822
|
-
positionTop:
|
|
372
|
+
height: PropTypes__default["default"].string,
|
|
373
|
+
width: PropTypes__default["default"].string,
|
|
374
|
+
color: PropTypes__default["default"].string,
|
|
375
|
+
positionTop: PropTypes__default["default"].string
|
|
2823
376
|
};
|
|
2824
377
|
|
|
2825
378
|
var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
@@ -2831,7 +384,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2831
384
|
|
|
2832
385
|
switch (iconType) {
|
|
2833
386
|
case "crown":
|
|
2834
|
-
return /*#__PURE__*/
|
|
387
|
+
return /*#__PURE__*/React__default["default"].createElement(CrownIcon, {
|
|
2835
388
|
width: width,
|
|
2836
389
|
height: height,
|
|
2837
390
|
color: color,
|
|
@@ -2839,7 +392,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2839
392
|
});
|
|
2840
393
|
|
|
2841
394
|
case "lock":
|
|
2842
|
-
return /*#__PURE__*/
|
|
395
|
+
return /*#__PURE__*/React__default["default"].createElement(LockIcon, {
|
|
2843
396
|
width: width,
|
|
2844
397
|
height: height,
|
|
2845
398
|
color: color,
|
|
@@ -2847,7 +400,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2847
400
|
});
|
|
2848
401
|
|
|
2849
402
|
case "key":
|
|
2850
|
-
return /*#__PURE__*/
|
|
403
|
+
return /*#__PURE__*/React__default["default"].createElement(KeyIcon, {
|
|
2851
404
|
width: width,
|
|
2852
405
|
height: height,
|
|
2853
406
|
color: color,
|
|
@@ -2855,7 +408,7 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2855
408
|
});
|
|
2856
409
|
|
|
2857
410
|
default:
|
|
2858
|
-
return /*#__PURE__*/
|
|
411
|
+
return /*#__PURE__*/React__default["default"].createElement(StarIcon, {
|
|
2859
412
|
width: width,
|
|
2860
413
|
height: height,
|
|
2861
414
|
color: color,
|
|
@@ -2864,21 +417,21 @@ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
|
2864
417
|
}
|
|
2865
418
|
};
|
|
2866
419
|
PremiumStoryIcon.propTypes = {
|
|
2867
|
-
width:
|
|
2868
|
-
height:
|
|
2869
|
-
color:
|
|
2870
|
-
iconType:
|
|
2871
|
-
positionTop:
|
|
420
|
+
width: PropTypes__default["default"].string,
|
|
421
|
+
height: PropTypes__default["default"].string,
|
|
422
|
+
color: PropTypes__default["default"].string,
|
|
423
|
+
iconType: PropTypes__default["default"].string,
|
|
424
|
+
positionTop: PropTypes__default["default"].string
|
|
2872
425
|
};
|
|
2873
426
|
|
|
2874
427
|
function LiveIcon() {
|
|
2875
|
-
return /*#__PURE__*/
|
|
428
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
2876
429
|
className: "live-icon",
|
|
2877
430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2878
431
|
width: "25",
|
|
2879
432
|
height: "24",
|
|
2880
433
|
viewBox: "0 0 25 24"
|
|
2881
|
-
}, /*#__PURE__*/
|
|
434
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
2882
435
|
fill: "#ff5858",
|
|
2883
436
|
d: "M12 18a6 6 0 110-12 6 6 0 010 12zm0 2.5a8.5 8.5 0 110-17 8.5 8.5 0 010 17zm0-1a7.5 7.5 0 100-15 7.5 7.5 0 000 15z"
|
|
2884
437
|
}));
|
|
@@ -2907,8 +460,8 @@ var Headline = function Headline(_ref) {
|
|
|
2907
460
|
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
2908
461
|
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
2909
462
|
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
2910
|
-
var alternateHeadline =
|
|
2911
|
-
var premiumStory = enablePremiumStoryIcon &&
|
|
463
|
+
var alternateHeadline = lodash.get(story, ["alternative", "home", "default", "headline"]);
|
|
464
|
+
var premiumStory = enablePremiumStoryIcon && lodash.get(story, ["access"]) === "subscription";
|
|
2912
465
|
var headline = alternateHeadline || story.headline;
|
|
2913
466
|
var HeaderTag = "h" + headerLevel;
|
|
2914
467
|
|
|
@@ -2934,38 +487,38 @@ var Headline = function Headline(_ref) {
|
|
|
2934
487
|
var textColor = getTextColor(configData.theme);
|
|
2935
488
|
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
2936
489
|
var iconSize = "24px";
|
|
2937
|
-
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !
|
|
2938
|
-
return /*#__PURE__*/
|
|
490
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !lodash.get(story, ["metadata", "is-closed"], false);
|
|
491
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2939
492
|
"data-test-id": "headline",
|
|
2940
|
-
className: "arrow-component arr--headline " +
|
|
2941
|
-
}, premiumStory && /*#__PURE__*/
|
|
493
|
+
className: "arrow-component arr--headline " + _getClassName__default["default"](wrapperClass, _styleModuleImportMap$a)
|
|
494
|
+
}, premiumStory && /*#__PURE__*/React__default["default"].createElement(PremiumStoryIcon, {
|
|
2942
495
|
width: iconSize,
|
|
2943
496
|
height: iconSize,
|
|
2944
497
|
color: iconColor,
|
|
2945
498
|
iconType: iconStyle,
|
|
2946
499
|
positionTop: positionHeadline()
|
|
2947
|
-
}), isLink ? /*#__PURE__*/
|
|
500
|
+
}), isLink ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
2948
501
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
2949
502
|
externalLink: isExternalStory(story),
|
|
2950
503
|
"aria-label": "headline"
|
|
2951
|
-
}, /*#__PURE__*/
|
|
2952
|
-
className:
|
|
2953
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
2954
|
-
className:
|
|
2955
|
-
}, enableLiveIcon && /*#__PURE__*/
|
|
504
|
+
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
505
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$a)
|
|
506
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, {
|
|
507
|
+
className: _getClassName__default["default"]("headline ".concat(textColor), _styleModuleImportMap$a)
|
|
508
|
+
}, enableLiveIcon && /*#__PURE__*/React__default["default"].createElement(LiveIcon, null), headline));
|
|
2956
509
|
};
|
|
2957
510
|
Headline.propTypes = {
|
|
2958
511
|
/** The Story Object from the API response */
|
|
2959
|
-
story:
|
|
512
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
2960
513
|
|
|
2961
514
|
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
2962
|
-
headerLevel:
|
|
2963
|
-
premiumStoryIconConfig:
|
|
2964
|
-
iconColor:
|
|
2965
|
-
iconType:
|
|
2966
|
-
enablePremiumStoryIcon:
|
|
515
|
+
headerLevel: PropTypes__default["default"].string,
|
|
516
|
+
premiumStoryIconConfig: PropTypes__default["default"].shape({
|
|
517
|
+
iconColor: PropTypes__default["default"].string,
|
|
518
|
+
iconType: PropTypes__default["default"].string,
|
|
519
|
+
enablePremiumStoryIcon: PropTypes__default["default"].bool
|
|
2967
520
|
}),
|
|
2968
|
-
isLink:
|
|
521
|
+
isLink: PropTypes__default["default"].bool
|
|
2969
522
|
};
|
|
2970
523
|
Headline.defaultProps = {
|
|
2971
524
|
headerLevel: "6",
|
|
@@ -2989,28 +542,28 @@ var Subheadline = function Subheadline(_ref) {
|
|
|
2989
542
|
forceShowAtom = _ref.forceShowAtom,
|
|
2990
543
|
showFullContent = _ref.showFullContent;
|
|
2991
544
|
var config = useStateValue() || {};
|
|
2992
|
-
var subheadline = forceShowAtom ||
|
|
545
|
+
var subheadline = forceShowAtom || lodash.get(config, ["showSubheadline"], true);
|
|
2993
546
|
if (!subheadline) return null;
|
|
2994
547
|
var textColor = getTextColor(config.theme);
|
|
2995
|
-
return /*#__PURE__*/
|
|
548
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2996
549
|
style: {
|
|
2997
550
|
WebkitLineClamp: lineClamp
|
|
2998
551
|
},
|
|
2999
552
|
"data-test-id": "subheadline",
|
|
3000
|
-
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") +
|
|
553
|
+
className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName__default["default"]("subheadline ".concat(textColor), _styleModuleImportMap$9)
|
|
3001
554
|
}, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
|
|
3002
555
|
};
|
|
3003
556
|
Subheadline.propTypes = {
|
|
3004
557
|
/** The Story Object from the API response */
|
|
3005
|
-
story:
|
|
558
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3006
559
|
// Restricts the number of lines for subheadline.
|
|
3007
|
-
lineClamp:
|
|
560
|
+
lineClamp: PropTypes__default["default"].number,
|
|
3008
561
|
|
|
3009
562
|
/** Number of characters to truncate the subheadline */
|
|
3010
|
-
truncateChars:
|
|
3011
|
-
clazzName:
|
|
3012
|
-
forceShowAtom:
|
|
3013
|
-
showFullContent:
|
|
563
|
+
truncateChars: PropTypes__default["default"].number,
|
|
564
|
+
clazzName: PropTypes__default["default"].string,
|
|
565
|
+
forceShowAtom: PropTypes__default["default"].bool,
|
|
566
|
+
showFullContent: PropTypes__default["default"].bool
|
|
3014
567
|
};
|
|
3015
568
|
Subheadline.defaultProps = {
|
|
3016
569
|
forceShowAtom: false,
|
|
@@ -3032,22 +585,22 @@ var TimeStamp = function TimeStamp(_ref) {
|
|
|
3032
585
|
_ref$config = _ref.config,
|
|
3033
586
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3034
587
|
var configState = useStateValue() || {};
|
|
3035
|
-
var isTime =
|
|
588
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
3036
589
|
var time = story["last-published-at"] || story["first-published-at"];
|
|
3037
590
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3038
591
|
var textColor = getTextColor(configState.theme);
|
|
3039
|
-
return /*#__PURE__*/
|
|
592
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3040
593
|
"data-test-id": "publish-time",
|
|
3041
|
-
className: "time arr--publish-time " +
|
|
3042
|
-
}, /*#__PURE__*/
|
|
594
|
+
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$8)
|
|
595
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3043
596
|
className: "timestamp-m_time-wrapper__3O2lM"
|
|
3044
597
|
}, getTimeStamp(time, formatter, config))));
|
|
3045
598
|
};
|
|
3046
599
|
TimeStamp.propTypes = {
|
|
3047
600
|
/** The Story Object from the API response */
|
|
3048
|
-
story:
|
|
3049
|
-
isBottom:
|
|
3050
|
-
config:
|
|
601
|
+
story: PropTypes__default["default"].object,
|
|
602
|
+
isBottom: PropTypes__default["default"].bool,
|
|
603
|
+
config: PropTypes__default["default"].object
|
|
3051
604
|
};
|
|
3052
605
|
|
|
3053
606
|
var _styleModuleImportMap$7 = {
|
|
@@ -3073,9 +626,9 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3073
626
|
_ref$config = _ref.config,
|
|
3074
627
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
3075
628
|
var configData = useStateValue() || {};
|
|
3076
|
-
var isAuthor =
|
|
629
|
+
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
3077
630
|
|
|
3078
|
-
var _get =
|
|
631
|
+
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
3079
632
|
avatarUrl = _get["avatar-url"],
|
|
3080
633
|
avatarS3Key = _get["avatar-s3-key"],
|
|
3081
634
|
authorName = _get.name,
|
|
@@ -3083,17 +636,17 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3083
636
|
|
|
3084
637
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3085
638
|
var textColor = getTextColor(configData.theme);
|
|
3086
|
-
var mountAt =
|
|
639
|
+
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
3087
640
|
|
|
3088
641
|
var authorImage = function authorImage(dir) {
|
|
3089
642
|
if (!avatarUrl && !avatarS3Key) {
|
|
3090
643
|
return null;
|
|
3091
644
|
}
|
|
3092
645
|
|
|
3093
|
-
return /*#__PURE__*/
|
|
646
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3094
647
|
"data-test-id": "author-image",
|
|
3095
|
-
className:
|
|
3096
|
-
}, /*#__PURE__*/
|
|
648
|
+
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$7)
|
|
649
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
3097
650
|
slug: avatarS3Key,
|
|
3098
651
|
"aspect-ratio": [1, 1],
|
|
3099
652
|
defaultWidth: 400,
|
|
@@ -3101,49 +654,49 @@ var AuthorBase = function AuthorBase(_ref) {
|
|
|
3101
654
|
auto: ["format", "compress"]
|
|
3102
655
|
},
|
|
3103
656
|
alt: authorName
|
|
3104
|
-
}) : /*#__PURE__*/
|
|
657
|
+
}) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3105
658
|
src: avatarUrl
|
|
3106
659
|
})));
|
|
3107
660
|
};
|
|
3108
661
|
|
|
3109
662
|
var isPrefix = function isPrefix(dir) {
|
|
3110
663
|
if (prefix) {
|
|
3111
|
-
return /*#__PURE__*/
|
|
3112
|
-
className: "arr-author-prefix " +
|
|
664
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
665
|
+
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$7)
|
|
3113
666
|
}, prefix);
|
|
3114
667
|
}
|
|
3115
668
|
|
|
3116
669
|
return !hideAuthorImage && authorImage(dir);
|
|
3117
670
|
};
|
|
3118
671
|
|
|
3119
|
-
return /*#__PURE__*/
|
|
672
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3120
673
|
href: "".concat(mountAt, "/author/") + slug,
|
|
3121
674
|
"aria-label": "author-name",
|
|
3122
|
-
className: "author-name arr-author-name arrow-component " +
|
|
3123
|
-
}, isPrefix("ltr"), /*#__PURE__*/
|
|
675
|
+
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$7)
|
|
676
|
+
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3124
677
|
"data-test-id": "author-name",
|
|
3125
|
-
className: "author-name " +
|
|
678
|
+
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$7)
|
|
3126
679
|
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
3127
680
|
};
|
|
3128
681
|
|
|
3129
682
|
function mapStateToProps(state) {
|
|
3130
683
|
return {
|
|
3131
|
-
config:
|
|
684
|
+
config: lodash.get(state, ["qt", "config"], {})
|
|
3132
685
|
};
|
|
3133
686
|
}
|
|
3134
687
|
|
|
3135
|
-
var Author = connect(mapStateToProps)(AuthorBase);
|
|
688
|
+
var Author = reactRedux.connect(mapStateToProps)(AuthorBase);
|
|
3136
689
|
AuthorBase.propTypes = {
|
|
3137
690
|
/** The Story Object from the API response */
|
|
3138
|
-
story:
|
|
691
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3139
692
|
|
|
3140
693
|
/** Hide Author Avatar Image */
|
|
3141
|
-
hideAuthorImage:
|
|
694
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3142
695
|
// fix Author bottom of the storyCard
|
|
3143
|
-
isBottom:
|
|
696
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3144
697
|
// fix prefix before the author name
|
|
3145
|
-
prefix:
|
|
3146
|
-
config:
|
|
698
|
+
prefix: PropTypes__default["default"].string,
|
|
699
|
+
config: PropTypes__default["default"].object
|
|
3147
700
|
};
|
|
3148
701
|
AuthorBase.defaultProps = {
|
|
3149
702
|
hideAuthorImage: false,
|
|
@@ -3164,14 +717,14 @@ var Dot = function Dot(_ref) {
|
|
|
3164
717
|
height = _ref$height === void 0 ? "3px" : _ref$height,
|
|
3165
718
|
_ref$color = _ref.color,
|
|
3166
719
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3167
|
-
return /*#__PURE__*/
|
|
3168
|
-
className:
|
|
3169
|
-
}, /*#__PURE__*/
|
|
720
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
721
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$6)
|
|
722
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3170
723
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3171
724
|
width: width,
|
|
3172
725
|
height: height,
|
|
3173
726
|
viewBox: "0 0 3 3"
|
|
3174
|
-
}, /*#__PURE__*/
|
|
727
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
3175
728
|
cx: "87",
|
|
3176
729
|
cy: "9",
|
|
3177
730
|
r: "1",
|
|
@@ -3182,9 +735,9 @@ var Dot = function Dot(_ref) {
|
|
|
3182
735
|
};
|
|
3183
736
|
Dot.propTypes = {
|
|
3184
737
|
/** height , width and color of the dot icon */
|
|
3185
|
-
color:
|
|
3186
|
-
width:
|
|
3187
|
-
height:
|
|
738
|
+
color: PropTypes__default["default"].string,
|
|
739
|
+
width: PropTypes__default["default"].string,
|
|
740
|
+
height: PropTypes__default["default"].string
|
|
3188
741
|
};
|
|
3189
742
|
|
|
3190
743
|
var _styleModuleImportMap$5 = {
|
|
@@ -3200,22 +753,22 @@ var Divider = function Divider(_ref) {
|
|
|
3200
753
|
height = _ref$height === void 0 ? "10" : _ref$height,
|
|
3201
754
|
_ref$color = _ref.color,
|
|
3202
755
|
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
3203
|
-
return /*#__PURE__*/
|
|
3204
|
-
className:
|
|
3205
|
-
}, /*#__PURE__*/
|
|
756
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
757
|
+
className: _getClassName__default["default"](color, _styleModuleImportMap$5)
|
|
758
|
+
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3206
759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3207
760
|
width: width,
|
|
3208
761
|
height: height
|
|
3209
|
-
}, /*#__PURE__*/
|
|
762
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3210
763
|
fill: "inherit",
|
|
3211
764
|
d: "M0 0h1v10H0z"
|
|
3212
765
|
})));
|
|
3213
766
|
};
|
|
3214
767
|
Divider.propTypes = {
|
|
3215
768
|
/** height , width and color of the dot icon */
|
|
3216
|
-
color:
|
|
3217
|
-
width:
|
|
3218
|
-
height:
|
|
769
|
+
color: PropTypes__default["default"].string,
|
|
770
|
+
width: PropTypes__default["default"].string,
|
|
771
|
+
height: PropTypes__default["default"].string
|
|
3219
772
|
};
|
|
3220
773
|
|
|
3221
774
|
var _styleModuleImportMap$4 = {
|
|
@@ -3233,28 +786,28 @@ var ReadTime = function ReadTime(_ref) {
|
|
|
3233
786
|
_ref$isLightTheme = _ref.isLightTheme,
|
|
3234
787
|
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
3235
788
|
var config = useStateValue() || {};
|
|
3236
|
-
var showReadTime =
|
|
3237
|
-
var readTime =
|
|
789
|
+
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
790
|
+
var readTime = lodash.get(story, ["read-time"], 0);
|
|
3238
791
|
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
3239
792
|
if (!showReadTime || !readTime) return null;
|
|
3240
|
-
var timeToRead =
|
|
3241
|
-
return /*#__PURE__*/
|
|
793
|
+
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
794
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3242
795
|
"data-test-id": "read-time",
|
|
3243
|
-
className: "arrow-component arr--read-time " +
|
|
3244
|
-
}, /*#__PURE__*/
|
|
796
|
+
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$4)
|
|
797
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3245
798
|
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
3246
|
-
}, /*#__PURE__*/
|
|
799
|
+
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3247
800
|
color: textColor
|
|
3248
|
-
})), /*#__PURE__*/
|
|
801
|
+
})), /*#__PURE__*/React__default["default"].createElement("span", null, readTime, " ", timeToRead)));
|
|
3249
802
|
};
|
|
3250
803
|
ReadTime.propTypes = {
|
|
3251
|
-
story:
|
|
3252
|
-
"read-time":
|
|
804
|
+
story: PropTypes__default["default"].shape({
|
|
805
|
+
"read-time": PropTypes__default["default"].number
|
|
3253
806
|
}),
|
|
3254
|
-
opts:
|
|
3255
|
-
showReadTime:
|
|
807
|
+
opts: PropTypes__default["default"].shape({
|
|
808
|
+
showReadTime: PropTypes__default["default"].bool
|
|
3256
809
|
}),
|
|
3257
|
-
isLightTheme:
|
|
810
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3258
811
|
};
|
|
3259
812
|
|
|
3260
813
|
var _styleModuleImportMap$3 = {
|
|
@@ -3276,42 +829,42 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3276
829
|
config = _ref$config === void 0 ? {} : _ref$config,
|
|
3277
830
|
isLightTheme = _ref.isLightTheme;
|
|
3278
831
|
var configState = useStateValue() || {};
|
|
3279
|
-
var isAuthor =
|
|
3280
|
-
var isTime =
|
|
3281
|
-
var isReadTime =
|
|
832
|
+
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
833
|
+
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
834
|
+
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
3282
835
|
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
3283
836
|
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
3284
837
|
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
3285
838
|
|
|
3286
839
|
var getSeparator = function getSeparator() {
|
|
3287
840
|
if (separator === "divider") {
|
|
3288
|
-
return /*#__PURE__*/
|
|
841
|
+
return /*#__PURE__*/React__default["default"].createElement(Divider, {
|
|
3289
842
|
color: textColor
|
|
3290
843
|
});
|
|
3291
844
|
}
|
|
3292
845
|
|
|
3293
|
-
return /*#__PURE__*/
|
|
846
|
+
return /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
3294
847
|
color: textColor
|
|
3295
848
|
});
|
|
3296
849
|
};
|
|
3297
850
|
|
|
3298
851
|
var getTimeStamp = function getTimeStamp() {
|
|
3299
852
|
if (!isTime) return null;
|
|
3300
|
-
return /*#__PURE__*/
|
|
3301
|
-
className: "arr-separator " +
|
|
3302
|
-
}, getSeparator()), /*#__PURE__*/
|
|
853
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
854
|
+
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap$3)
|
|
855
|
+
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
3303
856
|
story: story,
|
|
3304
857
|
config: config
|
|
3305
|
-
}), isReadTime && /*#__PURE__*/
|
|
858
|
+
}), isReadTime && /*#__PURE__*/React__default["default"].createElement(ReadTime, {
|
|
3306
859
|
story: story,
|
|
3307
860
|
opts: config,
|
|
3308
861
|
isLightTheme: isLightTheme
|
|
3309
862
|
}));
|
|
3310
863
|
};
|
|
3311
864
|
|
|
3312
|
-
return /*#__PURE__*/
|
|
3313
|
-
className: "arr--author-time " +
|
|
3314
|
-
}, isAuthor ? /*#__PURE__*/
|
|
865
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
866
|
+
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$3)
|
|
867
|
+
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
3315
868
|
story: story,
|
|
3316
869
|
isBottom: true,
|
|
3317
870
|
hideAuthorImage: hideAuthorImage,
|
|
@@ -3319,19 +872,19 @@ var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
|
3319
872
|
}), getTimeStamp()) : getTimeStamp());
|
|
3320
873
|
};
|
|
3321
874
|
AuthorWithTime.propTypes = {
|
|
3322
|
-
story:
|
|
875
|
+
story: PropTypes__default["default"].object,
|
|
3323
876
|
|
|
3324
877
|
/** Style of separator between the Author & Timestamp */
|
|
3325
|
-
separator:
|
|
878
|
+
separator: PropTypes__default["default"].oneOf(["dot", "divider"]),
|
|
3326
879
|
|
|
3327
880
|
/** hide the author image */
|
|
3328
|
-
hideAuthorImage:
|
|
881
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3329
882
|
// fix author and time at the end
|
|
3330
|
-
isBottom:
|
|
883
|
+
isBottom: PropTypes__default["default"].bool,
|
|
3331
884
|
// fix prefix before the author name
|
|
3332
|
-
prefix:
|
|
3333
|
-
config:
|
|
3334
|
-
isLightTheme:
|
|
885
|
+
prefix: PropTypes__default["default"].string,
|
|
886
|
+
config: PropTypes__default["default"].object,
|
|
887
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3335
888
|
};
|
|
3336
889
|
AuthorWithTime.defaultProps = {
|
|
3337
890
|
separator: "dot",
|
|
@@ -3341,67 +894,6 @@ AuthorWithTime.defaultProps = {
|
|
|
3341
894
|
isLightTheme: false
|
|
3342
895
|
};
|
|
3343
896
|
|
|
3344
|
-
function _arrayWithHoles(arr) {
|
|
3345
|
-
if (Array.isArray(arr)) return arr;
|
|
3346
|
-
}
|
|
3347
|
-
|
|
3348
|
-
function _iterableToArrayLimit(arr, i) {
|
|
3349
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3350
|
-
|
|
3351
|
-
if (_i == null) return;
|
|
3352
|
-
var _arr = [];
|
|
3353
|
-
var _n = true;
|
|
3354
|
-
var _d = false;
|
|
3355
|
-
|
|
3356
|
-
var _s, _e;
|
|
3357
|
-
|
|
3358
|
-
try {
|
|
3359
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
3360
|
-
_arr.push(_s.value);
|
|
3361
|
-
|
|
3362
|
-
if (i && _arr.length === i) break;
|
|
3363
|
-
}
|
|
3364
|
-
} catch (err) {
|
|
3365
|
-
_d = true;
|
|
3366
|
-
_e = err;
|
|
3367
|
-
} finally {
|
|
3368
|
-
try {
|
|
3369
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
3370
|
-
} finally {
|
|
3371
|
-
if (_d) throw _e;
|
|
3372
|
-
}
|
|
3373
|
-
}
|
|
3374
|
-
|
|
3375
|
-
return _arr;
|
|
3376
|
-
}
|
|
3377
|
-
|
|
3378
|
-
function _arrayLikeToArray(arr, len) {
|
|
3379
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3380
|
-
|
|
3381
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
3382
|
-
arr2[i] = arr[i];
|
|
3383
|
-
}
|
|
3384
|
-
|
|
3385
|
-
return arr2;
|
|
3386
|
-
}
|
|
3387
|
-
|
|
3388
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
3389
|
-
if (!o) return;
|
|
3390
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
3391
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
3392
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
3393
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
3394
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
3395
|
-
}
|
|
3396
|
-
|
|
3397
|
-
function _nonIterableRest() {
|
|
3398
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3399
|
-
}
|
|
3400
|
-
|
|
3401
|
-
function _slicedToArray(arr, i) {
|
|
3402
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3403
|
-
}
|
|
3404
|
-
|
|
3405
897
|
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
3406
898
|
var _ref$width = _ref.width,
|
|
3407
899
|
width = _ref$width === void 0 ? 40 : _ref$width,
|
|
@@ -3409,27 +901,27 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
3409
901
|
height = _ref$height === void 0 ? 30 : _ref$height,
|
|
3410
902
|
_ref$iconColor = _ref.iconColor,
|
|
3411
903
|
iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
|
|
3412
|
-
return /*#__PURE__*/
|
|
904
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3413
905
|
width: width,
|
|
3414
906
|
height: height,
|
|
3415
907
|
viewBox: "0 0 102 76",
|
|
3416
908
|
version: "1.1"
|
|
3417
|
-
}, /*#__PURE__*/
|
|
909
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3418
910
|
id: "demo-home-copy",
|
|
3419
911
|
stroke: "none",
|
|
3420
912
|
strokeWidth: "1",
|
|
3421
913
|
fill: "none",
|
|
3422
914
|
fillRule: "evenodd",
|
|
3423
915
|
transform: "translate(-377.000000, -314.000000)"
|
|
3424
|
-
}, /*#__PURE__*/
|
|
916
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3425
917
|
id: "Group-13",
|
|
3426
918
|
transform: "translate(377.000000, 314.000000)"
|
|
3427
|
-
}, /*#__PURE__*/
|
|
919
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3428
920
|
d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
|
|
3429
921
|
id: "Combined-Shape",
|
|
3430
922
|
fill: iconColor,
|
|
3431
923
|
fillRule: "nonzero"
|
|
3432
|
-
}), /*#__PURE__*/
|
|
924
|
+
}), /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
3433
925
|
id: "Rectangle-19",
|
|
3434
926
|
stroke: iconColor,
|
|
3435
927
|
strokeWidth: "3",
|
|
@@ -3441,24 +933,24 @@ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
|
3441
933
|
}))));
|
|
3442
934
|
};
|
|
3443
935
|
ImageFallbackIcon.propTypes = {
|
|
3444
|
-
width:
|
|
3445
|
-
height:
|
|
3446
|
-
iconColor:
|
|
936
|
+
width: PropTypes__default["default"].object,
|
|
937
|
+
height: PropTypes__default["default"].object,
|
|
938
|
+
iconColor: PropTypes__default["default"].object
|
|
3447
939
|
};
|
|
3448
940
|
|
|
3449
941
|
var imageFallback = function imageFallback() {
|
|
3450
|
-
return /*#__PURE__*/
|
|
942
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3451
943
|
className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
|
|
3452
|
-
}, /*#__PURE__*/
|
|
944
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3453
945
|
className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
|
|
3454
|
-
}, /*#__PURE__*/
|
|
946
|
+
}, /*#__PURE__*/React__default["default"].createElement(ImageFallbackIcon, null)));
|
|
3455
947
|
};
|
|
3456
948
|
|
|
3457
949
|
var FallbackImage = function FallbackImage(_ref) {
|
|
3458
950
|
var slug = _ref.slug;
|
|
3459
951
|
|
|
3460
952
|
if (slug) {
|
|
3461
|
-
return /*#__PURE__*/
|
|
953
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3462
954
|
href: slug,
|
|
3463
955
|
"aria-label": "image-fallback"
|
|
3464
956
|
}, imageFallback());
|
|
@@ -3467,23 +959,23 @@ var FallbackImage = function FallbackImage(_ref) {
|
|
|
3467
959
|
}
|
|
3468
960
|
};
|
|
3469
961
|
FallbackImage.propTypes = {
|
|
3470
|
-
slug:
|
|
962
|
+
slug: PropTypes__default["default"].string
|
|
3471
963
|
};
|
|
3472
964
|
|
|
3473
965
|
var HyperLinkIcon = function HyperLinkIcon() {
|
|
3474
|
-
return /*#__PURE__*/
|
|
966
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
3475
967
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3476
968
|
width: "36",
|
|
3477
969
|
height: "28"
|
|
3478
|
-
}, /*#__PURE__*/
|
|
970
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
3479
971
|
fill: "none",
|
|
3480
972
|
fillRule: "evenodd"
|
|
3481
|
-
}, /*#__PURE__*/
|
|
973
|
+
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
3482
974
|
width: "36",
|
|
3483
975
|
height: "28",
|
|
3484
976
|
fill: "#3D6FCF",
|
|
3485
977
|
rx: "4"
|
|
3486
|
-
}), /*#__PURE__*/
|
|
978
|
+
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
3487
979
|
stroke: "#FFF",
|
|
3488
980
|
strokeLinecap: "round",
|
|
3489
981
|
strokeLinejoin: "round",
|
|
@@ -3496,16 +988,16 @@ var HyperLink = function HyperLink(_ref) {
|
|
|
3496
988
|
var _ref$hyperLink = _ref.hyperLink,
|
|
3497
989
|
hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
|
|
3498
990
|
if (!hyperLink) return null;
|
|
3499
|
-
return /*#__PURE__*/
|
|
991
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3500
992
|
href: hyperLink,
|
|
3501
993
|
"aria-label": "hyperlink-button",
|
|
3502
994
|
className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
|
|
3503
995
|
target: "_blank",
|
|
3504
996
|
rel: "noopener noreferrer"
|
|
3505
|
-
}, /*#__PURE__*/
|
|
997
|
+
}, /*#__PURE__*/React__default["default"].createElement(HyperLinkIcon, null));
|
|
3506
998
|
};
|
|
3507
999
|
HyperLink.propTypes = {
|
|
3508
|
-
hyperLink:
|
|
1000
|
+
hyperLink: PropTypes__default["default"].string
|
|
3509
1001
|
};
|
|
3510
1002
|
|
|
3511
1003
|
var _styleModuleImportMap$2 = {
|
|
@@ -3541,8 +1033,8 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3541
1033
|
StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
|
|
3542
1034
|
return null;
|
|
3543
1035
|
} : _config$StoryTemplate;
|
|
3544
|
-
var showImagePlaceholder = useSelector(function (state) {
|
|
3545
|
-
return
|
|
1036
|
+
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
1037
|
+
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
3546
1038
|
});
|
|
3547
1039
|
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
3548
1040
|
var fullBleed = FullBleed ? "" : "with-padding";
|
|
@@ -3551,7 +1043,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3551
1043
|
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
3552
1044
|
|
|
3553
1045
|
var getPadding = function getPadding(aspectRatio) {
|
|
3554
|
-
var _aspectRatio =
|
|
1046
|
+
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3555
1047
|
height = _aspectRatio[0],
|
|
3556
1048
|
width = _aspectRatio[1];
|
|
3557
1049
|
|
|
@@ -3563,7 +1055,7 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3563
1055
|
return 0;
|
|
3564
1056
|
};
|
|
3565
1057
|
|
|
3566
|
-
var _aspectRatio2 =
|
|
1058
|
+
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
3567
1059
|
mobileAspectRatio = _aspectRatio2[0],
|
|
3568
1060
|
_aspectRatio2$ = _aspectRatio2[1],
|
|
3569
1061
|
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
@@ -3571,43 +1063,43 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3571
1063
|
var isMobile = clientWidth("mobile");
|
|
3572
1064
|
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
3573
1065
|
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
3574
|
-
var slug =
|
|
3575
|
-
var hyperLink =
|
|
1066
|
+
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
1067
|
+
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
3576
1068
|
|
|
3577
1069
|
var fallbackImage = function fallbackImage() {
|
|
3578
1070
|
if (!slug) {
|
|
3579
1071
|
if (fallbackImageUrl && !isStoryPageImage) {
|
|
3580
|
-
return /*#__PURE__*/
|
|
1072
|
+
return /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3581
1073
|
style: {
|
|
3582
1074
|
paddingTop: imagePadding + "%"
|
|
3583
1075
|
},
|
|
3584
|
-
className: "arr--responsive-hero-image " +
|
|
3585
|
-
}, /*#__PURE__*/
|
|
1076
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$2)
|
|
1077
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
3586
1078
|
className: "qt-image",
|
|
3587
1079
|
"data-src": "".concat(fallbackImageUrl),
|
|
3588
1080
|
alt: "image-fallback"
|
|
3589
1081
|
}));
|
|
3590
1082
|
}
|
|
3591
1083
|
|
|
3592
|
-
return /*#__PURE__*/
|
|
1084
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, defaultFallback ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3593
1085
|
"data-test-id": "arr--fallback-hero-image",
|
|
3594
1086
|
style: {
|
|
3595
1087
|
paddingTop: imagePadding + "%"
|
|
3596
1088
|
},
|
|
3597
|
-
className: "arr--fallback-hero-image " +
|
|
3598
|
-
}, /*#__PURE__*/
|
|
1089
|
+
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$2)
|
|
1090
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3599
1091
|
storyTemplate: story["story-template"]
|
|
3600
|
-
}), /*#__PURE__*/
|
|
1092
|
+
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
3601
1093
|
}
|
|
3602
1094
|
|
|
3603
|
-
return /*#__PURE__*/
|
|
1095
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
3604
1096
|
style: {
|
|
3605
1097
|
paddingTop: imagePadding + "%"
|
|
3606
1098
|
},
|
|
3607
|
-
className: "arr--responsive-hero-image " +
|
|
3608
|
-
}, /*#__PURE__*/
|
|
1099
|
+
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$2)
|
|
1100
|
+
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
3609
1101
|
storyTemplate: story["story-template"]
|
|
3610
|
-
}), /*#__PURE__*/
|
|
1102
|
+
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
3611
1103
|
story: story,
|
|
3612
1104
|
aspectRatio: imageAspectRatio,
|
|
3613
1105
|
defaultWidth: defaultWidth,
|
|
@@ -3616,48 +1108,48 @@ var HeroImage = function HeroImage(_ref) {
|
|
|
3616
1108
|
auto: ["format", "compress"],
|
|
3617
1109
|
fit: "max"
|
|
3618
1110
|
}
|
|
3619
|
-
})), isStoryPageImage && hyperLink && /*#__PURE__*/
|
|
1111
|
+
})), isStoryPageImage && hyperLink && /*#__PURE__*/React__default["default"].createElement(HyperLink, {
|
|
3620
1112
|
hyperLink: hyperLink
|
|
3621
1113
|
}));
|
|
3622
1114
|
};
|
|
3623
1115
|
|
|
3624
|
-
return story && (isStoryPageImage ? /*#__PURE__*/
|
|
1116
|
+
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3625
1117
|
"data-test-id": "arr--hero-image",
|
|
3626
|
-
className: "arr--hero-image " +
|
|
3627
|
-
}, fallbackImage()) : /*#__PURE__*/
|
|
1118
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$2)
|
|
1119
|
+
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3628
1120
|
"data-test-id": "arr--hero-image",
|
|
3629
1121
|
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
3630
1122
|
externalLink: isExternalStory(story),
|
|
3631
1123
|
"aria-label": "fallback-hero-image",
|
|
3632
|
-
className: "arr--hero-image " +
|
|
1124
|
+
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$2)
|
|
3633
1125
|
}, fallbackImage()));
|
|
3634
1126
|
};
|
|
3635
1127
|
HeroImage.propTypes = {
|
|
3636
1128
|
/** The Story Object from the API response */
|
|
3637
|
-
story:
|
|
1129
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3638
1130
|
|
|
3639
1131
|
/** Removes the Hero Image padding for the image to bleed over the margin */
|
|
3640
|
-
FullBleed:
|
|
1132
|
+
FullBleed: PropTypes__default["default"].bool,
|
|
3641
1133
|
|
|
3642
1134
|
/** The default width for the image, in case the browser does not support srcset */
|
|
3643
|
-
defaultWidth:
|
|
1135
|
+
defaultWidth: PropTypes__default["default"].number,
|
|
3644
1136
|
|
|
3645
1137
|
/** The list of available widths */
|
|
3646
|
-
widths:
|
|
1138
|
+
widths: PropTypes__default["default"].array,
|
|
3647
1139
|
// fatch the correct hero image
|
|
3648
|
-
aspectRatio:
|
|
1140
|
+
aspectRatio: PropTypes__default["default"].array,
|
|
3649
1141
|
// Hints for the browser to choose the best size
|
|
3650
1142
|
|
|
3651
1143
|
/** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
|
|
3652
|
-
isHorizontal:
|
|
1144
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
3653
1145
|
|
|
3654
1146
|
/** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
|
|
3655
|
-
isHorizontalMobile:
|
|
1147
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
3656
1148
|
// this prop is responsive for rendering fallback image on story page
|
|
3657
|
-
defaultFallback:
|
|
3658
|
-
isHorizontalWithImageLast:
|
|
3659
|
-
isStoryPageImage:
|
|
3660
|
-
config:
|
|
1149
|
+
defaultFallback: PropTypes__default["default"].bool,
|
|
1150
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool,
|
|
1151
|
+
isStoryPageImage: PropTypes__default["default"].bool,
|
|
1152
|
+
config: PropTypes__default["default"].object
|
|
3661
1153
|
};
|
|
3662
1154
|
HeroImage.defaultProps = {
|
|
3663
1155
|
FullBleed: true,
|
|
@@ -3692,9 +1184,9 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3692
1184
|
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
3693
1185
|
isLightTheme = _ref.isLightTheme;
|
|
3694
1186
|
var config = useStateValue() || {};
|
|
3695
|
-
var isSection =
|
|
3696
|
-
var templateFromRowContext =
|
|
3697
|
-
var section =
|
|
1187
|
+
var isSection = lodash.get(config, ["showSection"], true);
|
|
1188
|
+
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
1189
|
+
var section = lodash.get(story, ["sections", 0], "");
|
|
3698
1190
|
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
3699
1191
|
var getUrl = section ? section["section-url"] : "/";
|
|
3700
1192
|
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
@@ -3707,22 +1199,22 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3707
1199
|
}
|
|
3708
1200
|
|
|
3709
1201
|
if (!isSection) return null;
|
|
3710
|
-
return /*#__PURE__*/
|
|
1202
|
+
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
3711
1203
|
href: getUrl,
|
|
3712
1204
|
className: "arrow-component arr--section-name",
|
|
3713
1205
|
"aria-label": "section-name"
|
|
3714
|
-
}, /*#__PURE__*/
|
|
1206
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3715
1207
|
"data-test-id": "sectionTag",
|
|
3716
1208
|
style: {
|
|
3717
1209
|
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
3718
1210
|
},
|
|
3719
|
-
className: "section-tag arrow-component " +
|
|
3720
|
-
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/
|
|
1211
|
+
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$1)
|
|
1212
|
+
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3721
1213
|
className: "section-m_border-left__2oUyp",
|
|
3722
1214
|
style: {
|
|
3723
1215
|
color: sectionTagBorderColor
|
|
3724
1216
|
}
|
|
3725
|
-
}), section["display-name"] || section["name"], /*#__PURE__*/
|
|
1217
|
+
}), section["display-name"] || section["name"], /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3726
1218
|
className: "section-m_border-bottom__3cRoD",
|
|
3727
1219
|
style: {
|
|
3728
1220
|
backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
|
|
@@ -3731,13 +1223,13 @@ var SectionTag = function SectionTag(_ref) {
|
|
|
3731
1223
|
};
|
|
3732
1224
|
SectionTag.propTypes = {
|
|
3733
1225
|
/** The Story Object from the API response */
|
|
3734
|
-
story:
|
|
1226
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
3735
1227
|
|
|
3736
1228
|
/** The style template for section tag */
|
|
3737
|
-
template:
|
|
3738
|
-
borderColor:
|
|
3739
|
-
solidBorderColor:
|
|
3740
|
-
isLightTheme:
|
|
1229
|
+
template: PropTypes__default["default"].oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
|
|
1230
|
+
borderColor: PropTypes__default["default"].string,
|
|
1231
|
+
solidBorderColor: PropTypes__default["default"].string,
|
|
1232
|
+
isLightTheme: PropTypes__default["default"].bool
|
|
3741
1233
|
};
|
|
3742
1234
|
SectionTag.defaultProps = {
|
|
3743
1235
|
template: "",
|
|
@@ -3786,7 +1278,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3786
1278
|
prefix = _ref.prefix,
|
|
3787
1279
|
config = _ref.config,
|
|
3788
1280
|
isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
|
|
3789
|
-
if (!story || isEmpty(story)) return /*#__PURE__*/
|
|
1281
|
+
if (!story || isEmpty(story)) return /*#__PURE__*/React__default["default"].createElement("div", null);
|
|
3790
1282
|
var borderOptions = ["default", "full", "bottom", "boxShadow"];
|
|
3791
1283
|
var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
|
|
3792
1284
|
|
|
@@ -3796,7 +1288,7 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3796
1288
|
var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
|
|
3797
1289
|
var textColor = getTextColor(theme);
|
|
3798
1290
|
var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
|
|
3799
|
-
var defaultStorycard = /*#__PURE__*/
|
|
1291
|
+
var defaultStorycard = /*#__PURE__*/React__default["default"].createElement(DefaultStoryCard, {
|
|
3800
1292
|
story: story,
|
|
3801
1293
|
aspectRatio: aspectRatio,
|
|
3802
1294
|
border: border,
|
|
@@ -3810,13 +1302,13 @@ var StoryCard = function StoryCard(_ref) {
|
|
|
3810
1302
|
config: config,
|
|
3811
1303
|
isHorizontalWithImageLast: isHorizontalWithImageLast
|
|
3812
1304
|
});
|
|
3813
|
-
return /*#__PURE__*/
|
|
1305
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3814
1306
|
"data-test-id": "story-card",
|
|
3815
1307
|
style: {
|
|
3816
1308
|
backgroundColor: theme,
|
|
3817
1309
|
color: textColor
|
|
3818
1310
|
},
|
|
3819
|
-
className: "arr--story-card " +
|
|
1311
|
+
className: "arr--story-card " + _getClassName__default["default"]("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap)
|
|
3820
1312
|
}, children || defaultStorycard);
|
|
3821
1313
|
};
|
|
3822
1314
|
|
|
@@ -3839,91 +1331,91 @@ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
|
|
|
3839
1331
|
var SectionTagborderColor = rgbToHex(borderColor);
|
|
3840
1332
|
var _config$localizationC = config.localizationConfig,
|
|
3841
1333
|
localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
|
|
3842
|
-
return /*#__PURE__*/
|
|
1334
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isHorizontal ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
3843
1335
|
config: config,
|
|
3844
1336
|
story: story,
|
|
3845
1337
|
isHorizontal: true,
|
|
3846
1338
|
isHorizontalMobile: isHorizontalMobile,
|
|
3847
1339
|
aspectRatio: aspectRatio
|
|
3848
|
-
}) : isHorizontalWithImageLast ? /*#__PURE__*/
|
|
1340
|
+
}) : isHorizontalWithImageLast ? /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
3849
1341
|
config: config,
|
|
3850
1342
|
story: story,
|
|
3851
1343
|
isHorizontalWithImageLast: true,
|
|
3852
1344
|
isHorizontalMobile: isHorizontalMobile,
|
|
3853
1345
|
aspectRatio: aspectRatio
|
|
3854
|
-
}) : /*#__PURE__*/
|
|
1346
|
+
}) : /*#__PURE__*/React__default["default"].createElement(HeroImage, {
|
|
3855
1347
|
story: story,
|
|
3856
1348
|
config: config,
|
|
3857
1349
|
isHorizontalMobile: isHorizontalMobile,
|
|
3858
1350
|
aspectRatio: aspectRatio
|
|
3859
|
-
}), /*#__PURE__*/
|
|
3860
|
-
className: "arr--story-content " +
|
|
3861
|
-
}, /*#__PURE__*/
|
|
1351
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1352
|
+
className: "arr--story-content " + _getClassName__default["default"]("content ".concat(alignment), _styleModuleImportMap)
|
|
1353
|
+
}, /*#__PURE__*/React__default["default"].createElement(SectionTag, {
|
|
3862
1354
|
story: story,
|
|
3863
1355
|
borderColor: SectionTagborderColor
|
|
3864
|
-
}), /*#__PURE__*/
|
|
1356
|
+
}), /*#__PURE__*/React__default["default"].createElement(Headline, {
|
|
3865
1357
|
story: story,
|
|
3866
1358
|
headerLevel: headerLevel,
|
|
3867
1359
|
premiumStoryIconConfig: config
|
|
3868
|
-
}), /*#__PURE__*/
|
|
1360
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorWithTime, {
|
|
3869
1361
|
config: localizationConfig,
|
|
3870
1362
|
story: story,
|
|
3871
1363
|
isBottom: true,
|
|
3872
1364
|
prefix: prefix,
|
|
3873
1365
|
hideAuthorImage: hideAuthorImage
|
|
3874
|
-
}), /*#__PURE__*/
|
|
1366
|
+
}), /*#__PURE__*/React__default["default"].createElement(Subheadline, {
|
|
3875
1367
|
story: story
|
|
3876
1368
|
})));
|
|
3877
1369
|
};
|
|
3878
1370
|
|
|
3879
1371
|
DefaultStoryCard.propTypes = {
|
|
3880
|
-
story:
|
|
3881
|
-
border:
|
|
3882
|
-
isBottom:
|
|
3883
|
-
isHorizontal:
|
|
3884
|
-
aspectRatio:
|
|
3885
|
-
isHorizontalMobile:
|
|
3886
|
-
centerAlign:
|
|
3887
|
-
headerLevel:
|
|
3888
|
-
borderColor:
|
|
3889
|
-
hideAuthorImage:
|
|
3890
|
-
prefix:
|
|
3891
|
-
config:
|
|
3892
|
-
isHorizontalWithImageLast:
|
|
1372
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1373
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
1374
|
+
isBottom: PropTypes__default["default"].bool,
|
|
1375
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
1376
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
1377
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
1378
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1379
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1380
|
+
borderColor: PropTypes__default["default"].string,
|
|
1381
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
1382
|
+
prefix: PropTypes__default["default"].string,
|
|
1383
|
+
config: PropTypes__default["default"].object,
|
|
1384
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
3893
1385
|
};
|
|
3894
1386
|
StoryCard.propTypes = {
|
|
3895
1387
|
/** The Story Object from the API response */
|
|
3896
|
-
story:
|
|
3897
|
-
children:
|
|
1388
|
+
story: PropTypes__default["default"].object.isRequired,
|
|
1389
|
+
children: PropTypes__default["default"].node,
|
|
3898
1390
|
|
|
3899
1391
|
/** Flip the Story Card to Horizonal mode */
|
|
3900
|
-
isHorizontal:
|
|
1392
|
+
isHorizontal: PropTypes__default["default"].bool,
|
|
3901
1393
|
|
|
3902
1394
|
/** Add border to the Story Card */
|
|
3903
|
-
border:
|
|
1395
|
+
border: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string]),
|
|
3904
1396
|
// story card with background image
|
|
3905
|
-
useImageAsBackground:
|
|
1397
|
+
useImageAsBackground: PropTypes__default["default"].bool,
|
|
3906
1398
|
// story card content overlap with image
|
|
3907
|
-
bgImgContentOverlap:
|
|
1399
|
+
bgImgContentOverlap: PropTypes__default["default"].bool,
|
|
3908
1400
|
|
|
3909
1401
|
/** add aspect ratio for hero image */
|
|
3910
|
-
aspectRatio:
|
|
1402
|
+
aspectRatio: PropTypes__default["default"].oneOfType([PropTypes__default["default"].array]),
|
|
3911
1403
|
|
|
3912
1404
|
/** add theme(dark /light/custom color) for storycard */
|
|
3913
|
-
theme:
|
|
1405
|
+
theme: PropTypes__default["default"].string,
|
|
3914
1406
|
|
|
3915
1407
|
/** flip the story card mobile design horizontal */
|
|
3916
|
-
isHorizontalMobile:
|
|
1408
|
+
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
3917
1409
|
// make content center align in desktop and left align in mobile
|
|
3918
|
-
centerAlign:
|
|
3919
|
-
headerLevel:
|
|
3920
|
-
borderColor:
|
|
1410
|
+
centerAlign: PropTypes__default["default"].bool,
|
|
1411
|
+
headerLevel: PropTypes__default["default"].string,
|
|
1412
|
+
borderColor: PropTypes__default["default"].string,
|
|
3921
1413
|
// handle author image through storycard
|
|
3922
|
-
hideAuthorImage:
|
|
1414
|
+
hideAuthorImage: PropTypes__default["default"].bool,
|
|
3923
1415
|
// handle author prefix through storycard
|
|
3924
|
-
prefix:
|
|
3925
|
-
config:
|
|
3926
|
-
isHorizontalWithImageLast:
|
|
1416
|
+
prefix: PropTypes__default["default"].string,
|
|
1417
|
+
config: PropTypes__default["default"].object,
|
|
1418
|
+
isHorizontalWithImageLast: PropTypes__default["default"].bool
|
|
3927
1419
|
};
|
|
3928
1420
|
StoryCard.defaultProps = {
|
|
3929
1421
|
isHorizontal: false,
|
|
@@ -3935,4 +1427,4 @@ StoryCard.defaultProps = {
|
|
|
3935
1427
|
isHorizontalWithImageLast: false
|
|
3936
1428
|
};
|
|
3937
1429
|
|
|
3938
|
-
|
|
1430
|
+
exports.StoryCard = StoryCard;
|