@quintype/arrow 3.15.1-fallback-support.1 → 3.15.1-perf.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/atoms/Author/index.js +2250 -0
  2. package/{Author → atoms/Author}/styles.arrow.css +0 -0
  3. package/atoms/AuthorWithTime/index.js +2954 -0
  4. package/{AuthorWithTime → atoms/AuthorWithTime}/styles.arrow.css +0 -0
  5. package/atoms/CollectionName/index.js +2334 -0
  6. package/{CollectionName → atoms/CollectionName}/styles.arrow.css +0 -0
  7. package/atoms/ExtendedLoadMore/index-2d713010.js +166 -0
  8. package/atoms/ExtendedLoadMore/index-4191a84c.js +240 -0
  9. package/atoms/ExtendedLoadMore/index-5a7900ba.js +181 -0
  10. package/atoms/ExtendedLoadMore/index-6cb56d1a.js +350 -0
  11. package/atoms/ExtendedLoadMore/index-6daa674c.js +282 -0
  12. package/atoms/ExtendedLoadMore/index-6f8c780e.js +243 -0
  13. package/atoms/ExtendedLoadMore/index-7eb05b3d.js +199 -0
  14. package/atoms/ExtendedLoadMore/index-8345922c.js +175 -0
  15. package/atoms/ExtendedLoadMore/index-99af722e.js +175 -0
  16. package/atoms/ExtendedLoadMore/index-aa8b8ab8.js +990 -0
  17. package/atoms/ExtendedLoadMore/index-c8f346d0.js +223 -0
  18. package/atoms/ExtendedLoadMore/index-e39b3ca8.js +3023 -0
  19. package/atoms/ExtendedLoadMore/index-f6e578e3.js +86 -0
  20. package/atoms/ExtendedLoadMore/index.js +5 -0
  21. package/atoms/ExtendedLoadMore/styles.arrow.css +1 -0
  22. package/atoms/Headline/index.js +2459 -0
  23. package/{Headline → atoms/Headline}/styles.arrow.css +0 -0
  24. package/atoms/HeroImage/index.js +2475 -0
  25. package/{HeroImage → atoms/HeroImage}/styles.arrow.css +0 -0
  26. package/atoms/LoadmoreButton/index.js +2268 -0
  27. package/{LoadmoreButton → atoms/LoadmoreButton}/styles.arrow.css +0 -0
  28. package/atoms/ScrollSnap/index.js +2531 -0
  29. package/{ScrollSnap → atoms/ScrollSnap}/styles.arrow.css +0 -0
  30. package/atoms/SectionTag/index.js +2220 -0
  31. package/{SectionTag → atoms/SectionTag}/styles.arrow.css +0 -0
  32. package/atoms/Subheadline/index.js +2200 -0
  33. package/{Subheadline → atoms/Subheadline}/styles.arrow.css +0 -0
  34. package/atoms/TimeStamp/index.js +2661 -0
  35. package/{TimeStamp → atoms/TimeStamp}/styles.arrow.css +0 -0
  36. package/molecules/KeyEvents/index.js +2968 -0
  37. package/{KeyEvents → molecules/KeyEvents}/styles.arrow.css +0 -0
  38. package/molecules/PageIntroductionCard/index.js +2676 -0
  39. package/{PageIntroductionCard → molecules/PageIntroductionCard}/styles.arrow.css +0 -0
  40. package/molecules/SocialShareTemplate/index.js +3093 -0
  41. package/{SocialShareTemplate → molecules/SocialShareTemplate}/styles.arrow.css +0 -0
  42. package/molecules/StoryCard/index.js +3938 -0
  43. package/{StoryCard → molecules/StoryCard}/styles.arrow.css +0 -0
  44. package/molecules/StoryElementCard/index.js +5832 -0
  45. package/{StoryElementCard → molecules/StoryElementCard}/styles.arrow.css +0 -0
  46. package/molecules/StorycardContent/index.js +3416 -0
  47. package/{StorycardContent → molecules/StorycardContent}/styles.arrow.css +0 -0
  48. package/package.json +1 -1
  49. package/rows/AlternateCollectionFilter/index.js +4744 -0
  50. package/{AlternateCollectionFilter → rows/AlternateCollectionFilter}/styles.arrow.css +0 -0
  51. package/rows/AsideCollection/index.js +4690 -0
  52. package/{AsideCollection → rows/AsideCollection}/styles.arrow.css +0 -0
  53. package/rows/AstrologyCollection/index.js +4661 -0
  54. package/{AstrologyCollection → rows/AstrologyCollection}/styles.arrow.css +0 -0
  55. package/rows/AuthorIntroductionCard/index.js +3520 -0
  56. package/{AuthorIntroductionCard → rows/AuthorIntroductionCard}/styles.arrow.css +0 -0
  57. package/rows/AuthorsList/index.js +3715 -0
  58. package/{AuthorsList → rows/AuthorsList}/styles.arrow.css +0 -0
  59. package/rows/CollectionFilter/index.js +4834 -0
  60. package/{CollectionFilter → rows/CollectionFilter}/styles.arrow.css +0 -0
  61. package/rows/ElevenStories/index.js +4638 -0
  62. package/{ElevenStories → rows/ElevenStories}/styles.arrow.css +0 -0
  63. package/rows/FourColFiveStories/index.js +4359 -0
  64. package/{FourColFiveStories → rows/FourColFiveStories}/styles.arrow.css +0 -0
  65. package/rows/FourColGrid/index.js +4584 -0
  66. package/{FourColGrid → rows/FourColGrid}/styles.arrow.css +0 -0
  67. package/rows/FourColPortraitStories/index.js +4617 -0
  68. package/{FourColPortraitStories → rows/FourColPortraitStories}/styles.arrow.css +0 -0
  69. package/rows/FourColSixteenStories/index.js +4375 -0
  70. package/{FourColSixteenStories → rows/FourColSixteenStories}/styles.arrow.css +0 -0
  71. package/rows/FourColTwelveStories/index.js +4335 -0
  72. package/{FourColTwelveStories → rows/FourColTwelveStories}/styles.arrow.css +0 -0
  73. package/rows/FourStorySlider/index.js +4743 -0
  74. package/{FourStorySlider → rows/FourStorySlider}/styles.arrow.css +0 -0
  75. package/rows/FourStorySliderPortrait/index.js +4746 -0
  76. package/{FourStorySliderPortrait → rows/FourStorySliderPortrait}/styles.arrow.css +1 -1
  77. package/rows/FourTabbedBigStorySlider/index.js +4505 -0
  78. package/{FourTabbedBigStorySlider → rows/FourTabbedBigStorySlider}/styles.arrow.css +0 -0
  79. package/rows/FullScreenSlider/index.js +4661 -0
  80. package/{FullScreenSlider → rows/FullScreenSlider}/styles.arrow.css +0 -0
  81. package/rows/HalfScreenSlider/index.js +4514 -0
  82. package/{HalfScreenSlider → rows/HalfScreenSlider}/styles.arrow.css +0 -0
  83. package/rows/ListComponent/index.js +4462 -0
  84. package/{ListComponent → rows/ListComponent}/styles.arrow.css +0 -0
  85. package/rows/Listicles/index.js +3131 -0
  86. package/{Listicles → rows/Listicles}/styles.arrow.css +0 -0
  87. package/rows/MagazineEditions/index.js +3142 -0
  88. package/{MagazineEditions → rows/MagazineEditions}/styles.arrow.css +0 -0
  89. package/rows/MagazineHeaderCard/index.js +3136 -0
  90. package/{MagazineHeaderCard → rows/MagazineHeaderCard}/styles.arrow.css +0 -0
  91. package/rows/MagazineWidget/index.js +4514 -0
  92. package/{MagazineWidget → rows/MagazineWidget}/styles.arrow.css +0 -0
  93. package/rows/OneColStoryList/index.js +4670 -0
  94. package/{OneColStoryList → rows/OneColStoryList}/styles.arrow.css +0 -0
  95. package/rows/OpinionCollection/index.js +4037 -0
  96. package/{OpinionCollection → rows/OpinionCollection}/styles.arrow.css +0 -0
  97. package/rows/SixColSixStories/index.js +4515 -0
  98. package/{SixColSixStories → rows/SixColSixStories}/styles.arrow.css +0 -0
  99. package/rows/StoryCollection/index.js +4690 -0
  100. package/{StoryCollection → rows/StoryCollection}/styles.arrow.css +0 -0
  101. package/rows/TagIntroductionCard/index.js +1901 -0
  102. package/{TagIntroductionCard → rows/TagIntroductionCard}/styles.arrow.css +0 -0
  103. package/rows/ThreeColFlexStories/index.js +4575 -0
  104. package/{ThreeColFlexStories → rows/ThreeColFlexStories}/styles.arrow.css +0 -0
  105. package/rows/ThreeColFourteenStories/index.js +4283 -0
  106. package/{ThreeColFourteenStories → rows/ThreeColFourteenStories}/styles.arrow.css +0 -0
  107. package/rows/ThreeColGrid/index.js +4605 -0
  108. package/{ThreeColGrid → rows/ThreeColGrid}/styles.arrow.css +0 -0
  109. package/rows/ThreeColSevenStory/index.js +4502 -0
  110. package/{ThreeColSevenStory → rows/ThreeColSevenStory}/styles.arrow.css +0 -0
  111. package/rows/ThreeColSixStories/index.js +4485 -0
  112. package/{ThreeColSixStories → rows/ThreeColSixStories}/styles.arrow.css +0 -0
  113. package/rows/ThreeColTwelveStories/index.js +4380 -0
  114. package/{ThreeColTwelveStories → rows/ThreeColTwelveStories}/styles.arrow.css +0 -0
  115. package/rows/TwoColFourStories/index.js +4463 -0
  116. package/{TwoColFourStories → rows/TwoColFourStories}/styles.arrow.css +0 -0
  117. package/rows/TwoColFourStoryHighlight/index.js +4456 -0
  118. package/{TwoColFourStoryHighlight → rows/TwoColFourStoryHighlight}/styles.arrow.css +0 -0
  119. package/rows/TwoColSevenStories/index.js +4490 -0
  120. package/{TwoColSevenStories → rows/TwoColSevenStories}/styles.arrow.css +0 -0
  121. package/rows/TwoColSixStories/index.js +4489 -0
  122. package/{TwoColSixStories → rows/TwoColSixStories}/styles.arrow.css +0 -0
  123. package/rows/TwoColTenStoriesSidebar/index.js +4549 -0
  124. package/{TwoColTenStoriesSidebar → rows/TwoColTenStoriesSidebar}/styles.arrow.css +0 -0
  125. package/rows/TwoColThreeStories/index.js +4436 -0
  126. package/{TwoColThreeStories → rows/TwoColThreeStories}/styles.arrow.css +0 -0
  127. package/story-elements/AlsoRead/index.js +2457 -0
  128. package/{AlsoRead → story-elements/AlsoRead}/styles.arrow.css +0 -0
  129. package/story-elements/Attachment/index.js +2013 -0
  130. package/{Attachment → story-elements/Attachment}/styles.arrow.css +0 -0
  131. package/story-elements/BigFact/index.js +1983 -0
  132. package/{BigFact → story-elements/BigFact}/styles.arrow.css +0 -0
  133. package/story-elements/BlockQuote/index.js +2431 -0
  134. package/{BlockQuote → story-elements/BlockQuote}/styles.arrow.css +0 -0
  135. package/story-elements/Blurb/index.js +2094 -0
  136. package/{Blurb → story-elements/Blurb}/styles.arrow.css +0 -0
  137. package/story-elements/Image/index.js +2711 -0
  138. package/{Image → story-elements/Image}/styles.arrow.css +0 -0
  139. package/story-elements/ImageGallery/index.js +2644 -0
  140. package/{ImageGallery → story-elements/ImageGallery}/styles.arrow.css +0 -0
  141. package/story-elements/ImageSlideshow/index.js +2955 -0
  142. package/{ImageSlideshow → story-elements/ImageSlideshow}/styles.arrow.css +0 -0
  143. package/story-elements/QuestionAnswer/index.js +2395 -0
  144. package/{QuestionAnswer → story-elements/QuestionAnswer}/styles.arrow.css +0 -0
  145. package/story-elements/Quote/index.js +2012 -0
  146. package/{Quote → story-elements/Quote}/styles.arrow.css +0 -0
  147. package/story-elements/Reference/index.js +2006 -0
  148. package/{Reference → story-elements/Reference}/styles.arrow.css +0 -0
  149. package/story-elements/StoryElement/index.js +1779 -0
  150. package/story-elements/Summary/index.js +2036 -0
  151. package/{Summary → story-elements/Summary}/styles.arrow.css +0 -0
  152. package/story-elements/Text/index.js +2293 -0
  153. package/{Text → story-elements/Text}/styles.arrow.css +0 -0
  154. package/story-elements/Video/index.js +1785 -0
  155. package/{Video → story-elements/Video}/styles.arrow.css +0 -0
  156. package/story-templates/ListicleStoryTemplate/index.js +8442 -0
  157. package/{ListicleStoryTemplate → story-templates/ListicleStoryTemplate}/styles.arrow.css +0 -0
  158. package/story-templates/LiveBlogStoryTemplate/index.js +8618 -0
  159. package/{LiveBlogStoryTemplate → story-templates/LiveBlogStoryTemplate}/styles.arrow.css +0 -0
  160. package/story-templates/PhotoStoryTemplate/index.js +8420 -0
  161. package/{PhotoStoryTemplate → story-templates/PhotoStoryTemplate}/styles.arrow.css +0 -0
  162. package/story-templates/TextStoryTemplate/index.js +8493 -0
  163. package/{TextStoryTemplate → story-templates/TextStoryTemplate}/styles.arrow.css +0 -0
  164. package/story-templates/VideoStoryTemplate/index.js +8352 -0
  165. package/{VideoStoryTemplate → story-templates/VideoStoryTemplate}/styles.arrow.css +0 -0
  166. package/cjs/index.js +0 -1
  167. package/esm/index.js +0 -1
@@ -0,0 +1,4514 @@
1
+ import React, { useContext, createContext } from 'react';
2
+ import PropTypes, { PropTypes as PropTypes$1 } from 'prop-types';
3
+ import { connect, useSelector, useDispatch } from 'react-redux';
4
+ import { Link, LinkBase, ResponsiveImage, ResponsiveHeroImage, LazyLoadImages } from '@quintype/components';
5
+ import Timeago from 'react-timeago';
6
+ import { utcToZonedTime, format } from 'date-fns-tz';
7
+
8
+ function _defineProperty(obj, key, value) {
9
+ if (key in obj) {
10
+ Object.defineProperty(obj, key, {
11
+ value: value,
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true
15
+ });
16
+ } else {
17
+ obj[key] = value;
18
+ }
19
+
20
+ return obj;
21
+ }
22
+
23
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
24
+
25
+ function getDefaultExportFromCjs (x) {
26
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
27
+ }
28
+
29
+ function createCommonjsModule(fn) {
30
+ var module = { exports: {} };
31
+ return fn(module, module.exports), module.exports;
32
+ }
33
+
34
+ var optionsDefaults_1 = createCommonjsModule(function (module, exports) {
35
+
36
+ Object.defineProperty(exports, "__esModule", {
37
+ value: true
38
+ });
39
+ exports["default"] = void 0;
40
+ var optionsDefaults = {
41
+ attributeNames: {
42
+ styleName: 'className'
43
+ },
44
+ generateScopedName: '[path]___[name]__[local]___[hash:base64:5]',
45
+ handleMissingStyleName: 'throw'
46
+ };
47
+ var _default = optionsDefaults;
48
+ exports["default"] = _default;
49
+
50
+
51
+ });
52
+
53
+ var getClassName = createCommonjsModule(function (module, exports) {
54
+
55
+ Object.defineProperty(exports, "__esModule", {
56
+ value: true
57
+ });
58
+ exports["default"] = void 0;
59
+
60
+ var _optionsDefaults = _interopRequireDefault(optionsDefaults_1);
61
+
62
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
63
+
64
+ var isNamespacedStyleName = function isNamespacedStyleName(styleName) {
65
+ return styleName.indexOf('.') !== -1;
66
+ };
67
+
68
+ var handleError = function handleError(message, handleMissingStyleName) {
69
+ if (handleMissingStyleName === 'throw') {
70
+ throw new Error(message);
71
+ } else if (handleMissingStyleName === 'warn') {
72
+ // eslint-disable-next-line no-console
73
+ console.warn(message);
74
+ }
75
+
76
+ return null;
77
+ };
78
+
79
+ var getClassNameForNamespacedStyleName = function getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
80
+ // Note:
81
+ // Do not use the desctructing syntax with Babel.
82
+ // Desctructing adds _slicedToArray helper.
83
+ var styleNameParts = styleName.split('.');
84
+ var importName = styleNameParts[0];
85
+ var moduleName = styleNameParts[1];
86
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
87
+
88
+ if (!moduleName) {
89
+ return handleError('Invalid style name: ' + styleName, handleMissingStyleName);
90
+ }
91
+
92
+ if (!styleModuleImportMap[importName]) {
93
+ return handleError('CSS module import does not exist: ' + importName, handleMissingStyleName);
94
+ }
95
+
96
+ if (!styleModuleImportMap[importName][moduleName]) {
97
+ return handleError('CSS module does not exist: ' + moduleName, handleMissingStyleName);
98
+ }
99
+
100
+ return styleModuleImportMap[importName][moduleName];
101
+ };
102
+
103
+ var getClassNameFromMultipleImports = function getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleNameOption) {
104
+ var handleMissingStyleName = handleMissingStyleNameOption || _optionsDefaults["default"].handleMissingStyleName;
105
+ var importKeysWithMatches = Object.keys(styleModuleImportMap).map(function (importKey) {
106
+ return styleModuleImportMap[importKey][styleName] && importKey;
107
+ }).filter(function (importKey) {
108
+ return importKey;
109
+ });
110
+
111
+ if (importKeysWithMatches.length > 1) {
112
+ 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');
113
+ }
114
+
115
+ if (importKeysWithMatches.length === 0) {
116
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
117
+ }
118
+
119
+ return styleModuleImportMap[importKeysWithMatches[0]][styleName];
120
+ };
121
+
122
+ var _default = function _default(styleNameValue, styleModuleImportMap, options) {
123
+ var styleModuleImportMapKeys = Object.keys(styleModuleImportMap);
124
+
125
+ var _ref = options || {},
126
+ _ref$handleMissingSty = _ref.handleMissingStyleName,
127
+ handleMissingStyleName = _ref$handleMissingSty === void 0 ? _optionsDefaults["default"].handleMissingStyleName : _ref$handleMissingSty,
128
+ _ref$autoResolveMulti = _ref.autoResolveMultipleImports,
129
+ autoResolveMultipleImports = _ref$autoResolveMulti === void 0 ? _optionsDefaults["default"].autoResolveMultipleImports : _ref$autoResolveMulti;
130
+
131
+ if (!styleNameValue) {
132
+ return '';
133
+ }
134
+
135
+ return styleNameValue.split(' ').filter(function (styleName) {
136
+ return styleName;
137
+ }).map(function (styleName) {
138
+ if (isNamespacedStyleName(styleName)) {
139
+ return getClassNameForNamespacedStyleName(styleName, styleModuleImportMap, handleMissingStyleName);
140
+ }
141
+
142
+ if (styleModuleImportMapKeys.length === 0) {
143
+ throw new Error('Cannot use styleName attribute for style name \'' + styleName + '\' without importing at least one stylesheet.');
144
+ }
145
+
146
+ if (styleModuleImportMapKeys.length > 1) {
147
+ if (!autoResolveMultipleImports) {
148
+ throw new Error('Cannot use anonymous style name \'' + styleName + '\' with more than one stylesheet import without setting \'autoResolveMultipleImports\' to true.');
149
+ }
150
+
151
+ return getClassNameFromMultipleImports(styleName, styleModuleImportMap, handleMissingStyleName);
152
+ }
153
+
154
+ var styleModuleMap = styleModuleImportMap[styleModuleImportMapKeys[0]];
155
+
156
+ if (!styleModuleMap[styleName]) {
157
+ return handleError('Could not resolve the styleName \'' + styleName + '\'.', handleMissingStyleName);
158
+ }
159
+
160
+ return styleModuleMap[styleName];
161
+ }).filter(function (className) {
162
+ // Remove any styles which could not be found (if handleMissingStyleName === 'ignore')
163
+ return className;
164
+ }).join(' ');
165
+ };
166
+
167
+ exports["default"] = _default;
168
+
169
+
170
+ });
171
+
172
+ var _getClassName = /*@__PURE__*/getDefaultExportFromCjs(getClassName);
173
+
174
+ var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
175
+
176
+ var StateProvider = function StateProvider(RowComponent) {
177
+ return function (props) {
178
+ return (
179
+ /*#__PURE__*/
180
+ // eslint-disable-next-line react/prop-types
181
+ React.createElement(StateContext.Provider, {
182
+ value: props.config
183
+ }, /*#__PURE__*/React.createElement(RowComponent, props))
184
+ );
185
+ };
186
+ };
187
+ var useStateValue = function useStateValue() {
188
+ return useContext(StateContext);
189
+ };
190
+
191
+ /**
192
+ * Checks if `value` is classified as an `Array` object.
193
+ *
194
+ * @static
195
+ * @memberOf _
196
+ * @since 0.1.0
197
+ * @category Lang
198
+ * @param {*} value The value to check.
199
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
200
+ * @example
201
+ *
202
+ * _.isArray([1, 2, 3]);
203
+ * // => true
204
+ *
205
+ * _.isArray(document.body.children);
206
+ * // => false
207
+ *
208
+ * _.isArray('abc');
209
+ * // => false
210
+ *
211
+ * _.isArray(_.noop);
212
+ * // => false
213
+ */
214
+ var isArray = Array.isArray;
215
+
216
+ var isArray_1 = isArray;
217
+
218
+ /** Detect free variable `global` from Node.js. */
219
+
220
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
221
+
222
+ var _freeGlobal = freeGlobal;
223
+
224
+ /** Detect free variable `self`. */
225
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
226
+
227
+ /** Used as a reference to the global object. */
228
+ var root = _freeGlobal || freeSelf || Function('return this')();
229
+
230
+ var _root = root;
231
+
232
+ /** Built-in value references. */
233
+ var Symbol$1 = _root.Symbol;
234
+
235
+ var _Symbol = Symbol$1;
236
+
237
+ /** Used for built-in method references. */
238
+ var objectProto$4 = Object.prototype;
239
+
240
+ /** Used to check objects for own properties. */
241
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
242
+
243
+ /**
244
+ * Used to resolve the
245
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
246
+ * of values.
247
+ */
248
+ var nativeObjectToString$1 = objectProto$4.toString;
249
+
250
+ /** Built-in value references. */
251
+ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
252
+
253
+ /**
254
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
255
+ *
256
+ * @private
257
+ * @param {*} value The value to query.
258
+ * @returns {string} Returns the raw `toStringTag`.
259
+ */
260
+ function getRawTag(value) {
261
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
262
+ tag = value[symToStringTag$1];
263
+
264
+ try {
265
+ value[symToStringTag$1] = undefined;
266
+ var unmasked = true;
267
+ } catch (e) {}
268
+
269
+ var result = nativeObjectToString$1.call(value);
270
+ if (unmasked) {
271
+ if (isOwn) {
272
+ value[symToStringTag$1] = tag;
273
+ } else {
274
+ delete value[symToStringTag$1];
275
+ }
276
+ }
277
+ return result;
278
+ }
279
+
280
+ var _getRawTag = getRawTag;
281
+
282
+ /** Used for built-in method references. */
283
+ var objectProto$3 = Object.prototype;
284
+
285
+ /**
286
+ * Used to resolve the
287
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
288
+ * of values.
289
+ */
290
+ var nativeObjectToString = objectProto$3.toString;
291
+
292
+ /**
293
+ * Converts `value` to a string using `Object.prototype.toString`.
294
+ *
295
+ * @private
296
+ * @param {*} value The value to convert.
297
+ * @returns {string} Returns the converted string.
298
+ */
299
+ function objectToString(value) {
300
+ return nativeObjectToString.call(value);
301
+ }
302
+
303
+ var _objectToString = objectToString;
304
+
305
+ /** `Object#toString` result references. */
306
+ var nullTag = '[object Null]',
307
+ undefinedTag = '[object Undefined]';
308
+
309
+ /** Built-in value references. */
310
+ var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
311
+
312
+ /**
313
+ * The base implementation of `getTag` without fallbacks for buggy environments.
314
+ *
315
+ * @private
316
+ * @param {*} value The value to query.
317
+ * @returns {string} Returns the `toStringTag`.
318
+ */
319
+ function baseGetTag(value) {
320
+ if (value == null) {
321
+ return value === undefined ? undefinedTag : nullTag;
322
+ }
323
+ return (symToStringTag && symToStringTag in Object(value))
324
+ ? _getRawTag(value)
325
+ : _objectToString(value);
326
+ }
327
+
328
+ var _baseGetTag = baseGetTag;
329
+
330
+ /**
331
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
332
+ * and has a `typeof` result of "object".
333
+ *
334
+ * @static
335
+ * @memberOf _
336
+ * @since 4.0.0
337
+ * @category Lang
338
+ * @param {*} value The value to check.
339
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
340
+ * @example
341
+ *
342
+ * _.isObjectLike({});
343
+ * // => true
344
+ *
345
+ * _.isObjectLike([1, 2, 3]);
346
+ * // => true
347
+ *
348
+ * _.isObjectLike(_.noop);
349
+ * // => false
350
+ *
351
+ * _.isObjectLike(null);
352
+ * // => false
353
+ */
354
+ function isObjectLike(value) {
355
+ return value != null && typeof value == 'object';
356
+ }
357
+
358
+ var isObjectLike_1 = isObjectLike;
359
+
360
+ /** `Object#toString` result references. */
361
+ var symbolTag = '[object Symbol]';
362
+
363
+ /**
364
+ * Checks if `value` is classified as a `Symbol` primitive or object.
365
+ *
366
+ * @static
367
+ * @memberOf _
368
+ * @since 4.0.0
369
+ * @category Lang
370
+ * @param {*} value The value to check.
371
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
372
+ * @example
373
+ *
374
+ * _.isSymbol(Symbol.iterator);
375
+ * // => true
376
+ *
377
+ * _.isSymbol('abc');
378
+ * // => false
379
+ */
380
+ function isSymbol(value) {
381
+ return typeof value == 'symbol' ||
382
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
383
+ }
384
+
385
+ var isSymbol_1 = isSymbol;
386
+
387
+ /** Used to match property names within property paths. */
388
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
389
+ reIsPlainProp = /^\w*$/;
390
+
391
+ /**
392
+ * Checks if `value` is a property name and not a property path.
393
+ *
394
+ * @private
395
+ * @param {*} value The value to check.
396
+ * @param {Object} [object] The object to query keys on.
397
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
398
+ */
399
+ function isKey(value, object) {
400
+ if (isArray_1(value)) {
401
+ return false;
402
+ }
403
+ var type = typeof value;
404
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
405
+ value == null || isSymbol_1(value)) {
406
+ return true;
407
+ }
408
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
409
+ (object != null && value in Object(object));
410
+ }
411
+
412
+ var _isKey = isKey;
413
+
414
+ /**
415
+ * Checks if `value` is the
416
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
417
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
418
+ *
419
+ * @static
420
+ * @memberOf _
421
+ * @since 0.1.0
422
+ * @category Lang
423
+ * @param {*} value The value to check.
424
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
425
+ * @example
426
+ *
427
+ * _.isObject({});
428
+ * // => true
429
+ *
430
+ * _.isObject([1, 2, 3]);
431
+ * // => true
432
+ *
433
+ * _.isObject(_.noop);
434
+ * // => true
435
+ *
436
+ * _.isObject(null);
437
+ * // => false
438
+ */
439
+ function isObject(value) {
440
+ var type = typeof value;
441
+ return value != null && (type == 'object' || type == 'function');
442
+ }
443
+
444
+ var isObject_1 = isObject;
445
+
446
+ /** `Object#toString` result references. */
447
+ var asyncTag = '[object AsyncFunction]',
448
+ funcTag = '[object Function]',
449
+ genTag = '[object GeneratorFunction]',
450
+ proxyTag = '[object Proxy]';
451
+
452
+ /**
453
+ * Checks if `value` is classified as a `Function` object.
454
+ *
455
+ * @static
456
+ * @memberOf _
457
+ * @since 0.1.0
458
+ * @category Lang
459
+ * @param {*} value The value to check.
460
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
461
+ * @example
462
+ *
463
+ * _.isFunction(_);
464
+ * // => true
465
+ *
466
+ * _.isFunction(/abc/);
467
+ * // => false
468
+ */
469
+ function isFunction(value) {
470
+ if (!isObject_1(value)) {
471
+ return false;
472
+ }
473
+ // The use of `Object#toString` avoids issues with the `typeof` operator
474
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
475
+ var tag = _baseGetTag(value);
476
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
477
+ }
478
+
479
+ var isFunction_1 = isFunction;
480
+
481
+ /** Used to detect overreaching core-js shims. */
482
+ var coreJsData = _root['__core-js_shared__'];
483
+
484
+ var _coreJsData = coreJsData;
485
+
486
+ /** Used to detect methods masquerading as native. */
487
+ var maskSrcKey = (function() {
488
+ var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
489
+ return uid ? ('Symbol(src)_1.' + uid) : '';
490
+ }());
491
+
492
+ /**
493
+ * Checks if `func` has its source masked.
494
+ *
495
+ * @private
496
+ * @param {Function} func The function to check.
497
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
498
+ */
499
+ function isMasked(func) {
500
+ return !!maskSrcKey && (maskSrcKey in func);
501
+ }
502
+
503
+ var _isMasked = isMasked;
504
+
505
+ /** Used for built-in method references. */
506
+ var funcProto$1 = Function.prototype;
507
+
508
+ /** Used to resolve the decompiled source of functions. */
509
+ var funcToString$1 = funcProto$1.toString;
510
+
511
+ /**
512
+ * Converts `func` to its source code.
513
+ *
514
+ * @private
515
+ * @param {Function} func The function to convert.
516
+ * @returns {string} Returns the source code.
517
+ */
518
+ function toSource(func) {
519
+ if (func != null) {
520
+ try {
521
+ return funcToString$1.call(func);
522
+ } catch (e) {}
523
+ try {
524
+ return (func + '');
525
+ } catch (e) {}
526
+ }
527
+ return '';
528
+ }
529
+
530
+ var _toSource = toSource;
531
+
532
+ /**
533
+ * Used to match `RegExp`
534
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
535
+ */
536
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
537
+
538
+ /** Used to detect host constructors (Safari). */
539
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
540
+
541
+ /** Used for built-in method references. */
542
+ var funcProto = Function.prototype,
543
+ objectProto$2 = Object.prototype;
544
+
545
+ /** Used to resolve the decompiled source of functions. */
546
+ var funcToString = funcProto.toString;
547
+
548
+ /** Used to check objects for own properties. */
549
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
550
+
551
+ /** Used to detect if a method is native. */
552
+ var reIsNative = RegExp('^' +
553
+ funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
554
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
555
+ );
556
+
557
+ /**
558
+ * The base implementation of `_.isNative` without bad shim checks.
559
+ *
560
+ * @private
561
+ * @param {*} value The value to check.
562
+ * @returns {boolean} Returns `true` if `value` is a native function,
563
+ * else `false`.
564
+ */
565
+ function baseIsNative(value) {
566
+ if (!isObject_1(value) || _isMasked(value)) {
567
+ return false;
568
+ }
569
+ var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
570
+ return pattern.test(_toSource(value));
571
+ }
572
+
573
+ var _baseIsNative = baseIsNative;
574
+
575
+ /**
576
+ * Gets the value at `key` of `object`.
577
+ *
578
+ * @private
579
+ * @param {Object} [object] The object to query.
580
+ * @param {string} key The key of the property to get.
581
+ * @returns {*} Returns the property value.
582
+ */
583
+ function getValue(object, key) {
584
+ return object == null ? undefined : object[key];
585
+ }
586
+
587
+ var _getValue = getValue;
588
+
589
+ /**
590
+ * Gets the native function at `key` of `object`.
591
+ *
592
+ * @private
593
+ * @param {Object} object The object to query.
594
+ * @param {string} key The key of the method to get.
595
+ * @returns {*} Returns the function if it's native, else `undefined`.
596
+ */
597
+ function getNative(object, key) {
598
+ var value = _getValue(object, key);
599
+ return _baseIsNative(value) ? value : undefined;
600
+ }
601
+
602
+ var _getNative = getNative;
603
+
604
+ /* Built-in method references that are verified to be native. */
605
+ var nativeCreate = _getNative(Object, 'create');
606
+
607
+ var _nativeCreate = nativeCreate;
608
+
609
+ /**
610
+ * Removes all key-value entries from the hash.
611
+ *
612
+ * @private
613
+ * @name clear
614
+ * @memberOf Hash
615
+ */
616
+ function hashClear() {
617
+ this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
618
+ this.size = 0;
619
+ }
620
+
621
+ var _hashClear = hashClear;
622
+
623
+ /**
624
+ * Removes `key` and its value from the hash.
625
+ *
626
+ * @private
627
+ * @name delete
628
+ * @memberOf Hash
629
+ * @param {Object} hash The hash to modify.
630
+ * @param {string} key The key of the value to remove.
631
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
632
+ */
633
+ function hashDelete(key) {
634
+ var result = this.has(key) && delete this.__data__[key];
635
+ this.size -= result ? 1 : 0;
636
+ return result;
637
+ }
638
+
639
+ var _hashDelete = hashDelete;
640
+
641
+ /** Used to stand-in for `undefined` hash values. */
642
+ var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
643
+
644
+ /** Used for built-in method references. */
645
+ var objectProto$1 = Object.prototype;
646
+
647
+ /** Used to check objects for own properties. */
648
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
649
+
650
+ /**
651
+ * Gets the hash value for `key`.
652
+ *
653
+ * @private
654
+ * @name get
655
+ * @memberOf Hash
656
+ * @param {string} key The key of the value to get.
657
+ * @returns {*} Returns the entry value.
658
+ */
659
+ function hashGet(key) {
660
+ var data = this.__data__;
661
+ if (_nativeCreate) {
662
+ var result = data[key];
663
+ return result === HASH_UNDEFINED$1 ? undefined : result;
664
+ }
665
+ return hasOwnProperty$1.call(data, key) ? data[key] : undefined;
666
+ }
667
+
668
+ var _hashGet = hashGet;
669
+
670
+ /** Used for built-in method references. */
671
+ var objectProto = Object.prototype;
672
+
673
+ /** Used to check objects for own properties. */
674
+ var hasOwnProperty = objectProto.hasOwnProperty;
675
+
676
+ /**
677
+ * Checks if a hash value for `key` exists.
678
+ *
679
+ * @private
680
+ * @name has
681
+ * @memberOf Hash
682
+ * @param {string} key The key of the entry to check.
683
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
684
+ */
685
+ function hashHas(key) {
686
+ var data = this.__data__;
687
+ return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
688
+ }
689
+
690
+ var _hashHas = hashHas;
691
+
692
+ /** Used to stand-in for `undefined` hash values. */
693
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
694
+
695
+ /**
696
+ * Sets the hash `key` to `value`.
697
+ *
698
+ * @private
699
+ * @name set
700
+ * @memberOf Hash
701
+ * @param {string} key The key of the value to set.
702
+ * @param {*} value The value to set.
703
+ * @returns {Object} Returns the hash instance.
704
+ */
705
+ function hashSet(key, value) {
706
+ var data = this.__data__;
707
+ this.size += this.has(key) ? 0 : 1;
708
+ data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
709
+ return this;
710
+ }
711
+
712
+ var _hashSet = hashSet;
713
+
714
+ /**
715
+ * Creates a hash object.
716
+ *
717
+ * @private
718
+ * @constructor
719
+ * @param {Array} [entries] The key-value pairs to cache.
720
+ */
721
+ function Hash(entries) {
722
+ var index = -1,
723
+ length = entries == null ? 0 : entries.length;
724
+
725
+ this.clear();
726
+ while (++index < length) {
727
+ var entry = entries[index];
728
+ this.set(entry[0], entry[1]);
729
+ }
730
+ }
731
+
732
+ // Add methods to `Hash`.
733
+ Hash.prototype.clear = _hashClear;
734
+ Hash.prototype['delete'] = _hashDelete;
735
+ Hash.prototype.get = _hashGet;
736
+ Hash.prototype.has = _hashHas;
737
+ Hash.prototype.set = _hashSet;
738
+
739
+ var _Hash = Hash;
740
+
741
+ /**
742
+ * Removes all key-value entries from the list cache.
743
+ *
744
+ * @private
745
+ * @name clear
746
+ * @memberOf ListCache
747
+ */
748
+ function listCacheClear() {
749
+ this.__data__ = [];
750
+ this.size = 0;
751
+ }
752
+
753
+ var _listCacheClear = listCacheClear;
754
+
755
+ /**
756
+ * Performs a
757
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
758
+ * comparison between two values to determine if they are equivalent.
759
+ *
760
+ * @static
761
+ * @memberOf _
762
+ * @since 4.0.0
763
+ * @category Lang
764
+ * @param {*} value The value to compare.
765
+ * @param {*} other The other value to compare.
766
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
767
+ * @example
768
+ *
769
+ * var object = { 'a': 1 };
770
+ * var other = { 'a': 1 };
771
+ *
772
+ * _.eq(object, object);
773
+ * // => true
774
+ *
775
+ * _.eq(object, other);
776
+ * // => false
777
+ *
778
+ * _.eq('a', 'a');
779
+ * // => true
780
+ *
781
+ * _.eq('a', Object('a'));
782
+ * // => false
783
+ *
784
+ * _.eq(NaN, NaN);
785
+ * // => true
786
+ */
787
+ function eq(value, other) {
788
+ return value === other || (value !== value && other !== other);
789
+ }
790
+
791
+ var eq_1 = eq;
792
+
793
+ /**
794
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
795
+ *
796
+ * @private
797
+ * @param {Array} array The array to inspect.
798
+ * @param {*} key The key to search for.
799
+ * @returns {number} Returns the index of the matched value, else `-1`.
800
+ */
801
+ function assocIndexOf(array, key) {
802
+ var length = array.length;
803
+ while (length--) {
804
+ if (eq_1(array[length][0], key)) {
805
+ return length;
806
+ }
807
+ }
808
+ return -1;
809
+ }
810
+
811
+ var _assocIndexOf = assocIndexOf;
812
+
813
+ /** Used for built-in method references. */
814
+ var arrayProto = Array.prototype;
815
+
816
+ /** Built-in value references. */
817
+ var splice = arrayProto.splice;
818
+
819
+ /**
820
+ * Removes `key` and its value from the list cache.
821
+ *
822
+ * @private
823
+ * @name delete
824
+ * @memberOf ListCache
825
+ * @param {string} key The key of the value to remove.
826
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
827
+ */
828
+ function listCacheDelete(key) {
829
+ var data = this.__data__,
830
+ index = _assocIndexOf(data, key);
831
+
832
+ if (index < 0) {
833
+ return false;
834
+ }
835
+ var lastIndex = data.length - 1;
836
+ if (index == lastIndex) {
837
+ data.pop();
838
+ } else {
839
+ splice.call(data, index, 1);
840
+ }
841
+ --this.size;
842
+ return true;
843
+ }
844
+
845
+ var _listCacheDelete = listCacheDelete;
846
+
847
+ /**
848
+ * Gets the list cache value for `key`.
849
+ *
850
+ * @private
851
+ * @name get
852
+ * @memberOf ListCache
853
+ * @param {string} key The key of the value to get.
854
+ * @returns {*} Returns the entry value.
855
+ */
856
+ function listCacheGet(key) {
857
+ var data = this.__data__,
858
+ index = _assocIndexOf(data, key);
859
+
860
+ return index < 0 ? undefined : data[index][1];
861
+ }
862
+
863
+ var _listCacheGet = listCacheGet;
864
+
865
+ /**
866
+ * Checks if a list cache value for `key` exists.
867
+ *
868
+ * @private
869
+ * @name has
870
+ * @memberOf ListCache
871
+ * @param {string} key The key of the entry to check.
872
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
873
+ */
874
+ function listCacheHas(key) {
875
+ return _assocIndexOf(this.__data__, key) > -1;
876
+ }
877
+
878
+ var _listCacheHas = listCacheHas;
879
+
880
+ /**
881
+ * Sets the list cache `key` to `value`.
882
+ *
883
+ * @private
884
+ * @name set
885
+ * @memberOf ListCache
886
+ * @param {string} key The key of the value to set.
887
+ * @param {*} value The value to set.
888
+ * @returns {Object} Returns the list cache instance.
889
+ */
890
+ function listCacheSet(key, value) {
891
+ var data = this.__data__,
892
+ index = _assocIndexOf(data, key);
893
+
894
+ if (index < 0) {
895
+ ++this.size;
896
+ data.push([key, value]);
897
+ } else {
898
+ data[index][1] = value;
899
+ }
900
+ return this;
901
+ }
902
+
903
+ var _listCacheSet = listCacheSet;
904
+
905
+ /**
906
+ * Creates an list cache object.
907
+ *
908
+ * @private
909
+ * @constructor
910
+ * @param {Array} [entries] The key-value pairs to cache.
911
+ */
912
+ function ListCache(entries) {
913
+ var index = -1,
914
+ length = entries == null ? 0 : entries.length;
915
+
916
+ this.clear();
917
+ while (++index < length) {
918
+ var entry = entries[index];
919
+ this.set(entry[0], entry[1]);
920
+ }
921
+ }
922
+
923
+ // Add methods to `ListCache`.
924
+ ListCache.prototype.clear = _listCacheClear;
925
+ ListCache.prototype['delete'] = _listCacheDelete;
926
+ ListCache.prototype.get = _listCacheGet;
927
+ ListCache.prototype.has = _listCacheHas;
928
+ ListCache.prototype.set = _listCacheSet;
929
+
930
+ var _ListCache = ListCache;
931
+
932
+ /* Built-in method references that are verified to be native. */
933
+ var Map = _getNative(_root, 'Map');
934
+
935
+ var _Map = Map;
936
+
937
+ /**
938
+ * Removes all key-value entries from the map.
939
+ *
940
+ * @private
941
+ * @name clear
942
+ * @memberOf MapCache
943
+ */
944
+ function mapCacheClear() {
945
+ this.size = 0;
946
+ this.__data__ = {
947
+ 'hash': new _Hash,
948
+ 'map': new (_Map || _ListCache),
949
+ 'string': new _Hash
950
+ };
951
+ }
952
+
953
+ var _mapCacheClear = mapCacheClear;
954
+
955
+ /**
956
+ * Checks if `value` is suitable for use as unique object key.
957
+ *
958
+ * @private
959
+ * @param {*} value The value to check.
960
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
961
+ */
962
+ function isKeyable(value) {
963
+ var type = typeof value;
964
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
965
+ ? (value !== '__proto__')
966
+ : (value === null);
967
+ }
968
+
969
+ var _isKeyable = isKeyable;
970
+
971
+ /**
972
+ * Gets the data for `map`.
973
+ *
974
+ * @private
975
+ * @param {Object} map The map to query.
976
+ * @param {string} key The reference key.
977
+ * @returns {*} Returns the map data.
978
+ */
979
+ function getMapData(map, key) {
980
+ var data = map.__data__;
981
+ return _isKeyable(key)
982
+ ? data[typeof key == 'string' ? 'string' : 'hash']
983
+ : data.map;
984
+ }
985
+
986
+ var _getMapData = getMapData;
987
+
988
+ /**
989
+ * Removes `key` and its value from the map.
990
+ *
991
+ * @private
992
+ * @name delete
993
+ * @memberOf MapCache
994
+ * @param {string} key The key of the value to remove.
995
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
996
+ */
997
+ function mapCacheDelete(key) {
998
+ var result = _getMapData(this, key)['delete'](key);
999
+ this.size -= result ? 1 : 0;
1000
+ return result;
1001
+ }
1002
+
1003
+ var _mapCacheDelete = mapCacheDelete;
1004
+
1005
+ /**
1006
+ * Gets the map value for `key`.
1007
+ *
1008
+ * @private
1009
+ * @name get
1010
+ * @memberOf MapCache
1011
+ * @param {string} key The key of the value to get.
1012
+ * @returns {*} Returns the entry value.
1013
+ */
1014
+ function mapCacheGet(key) {
1015
+ return _getMapData(this, key).get(key);
1016
+ }
1017
+
1018
+ var _mapCacheGet = mapCacheGet;
1019
+
1020
+ /**
1021
+ * Checks if a map value for `key` exists.
1022
+ *
1023
+ * @private
1024
+ * @name has
1025
+ * @memberOf MapCache
1026
+ * @param {string} key The key of the entry to check.
1027
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
1028
+ */
1029
+ function mapCacheHas(key) {
1030
+ return _getMapData(this, key).has(key);
1031
+ }
1032
+
1033
+ var _mapCacheHas = mapCacheHas;
1034
+
1035
+ /**
1036
+ * Sets the map `key` to `value`.
1037
+ *
1038
+ * @private
1039
+ * @name set
1040
+ * @memberOf MapCache
1041
+ * @param {string} key The key of the value to set.
1042
+ * @param {*} value The value to set.
1043
+ * @returns {Object} Returns the map cache instance.
1044
+ */
1045
+ function mapCacheSet(key, value) {
1046
+ var data = _getMapData(this, key),
1047
+ size = data.size;
1048
+
1049
+ data.set(key, value);
1050
+ this.size += data.size == size ? 0 : 1;
1051
+ return this;
1052
+ }
1053
+
1054
+ var _mapCacheSet = mapCacheSet;
1055
+
1056
+ /**
1057
+ * Creates a map cache object to store key-value pairs.
1058
+ *
1059
+ * @private
1060
+ * @constructor
1061
+ * @param {Array} [entries] The key-value pairs to cache.
1062
+ */
1063
+ function MapCache(entries) {
1064
+ var index = -1,
1065
+ length = entries == null ? 0 : entries.length;
1066
+
1067
+ this.clear();
1068
+ while (++index < length) {
1069
+ var entry = entries[index];
1070
+ this.set(entry[0], entry[1]);
1071
+ }
1072
+ }
1073
+
1074
+ // Add methods to `MapCache`.
1075
+ MapCache.prototype.clear = _mapCacheClear;
1076
+ MapCache.prototype['delete'] = _mapCacheDelete;
1077
+ MapCache.prototype.get = _mapCacheGet;
1078
+ MapCache.prototype.has = _mapCacheHas;
1079
+ MapCache.prototype.set = _mapCacheSet;
1080
+
1081
+ var _MapCache = MapCache;
1082
+
1083
+ /** Error message constants. */
1084
+ var FUNC_ERROR_TEXT = 'Expected a function';
1085
+
1086
+ /**
1087
+ * Creates a function that memoizes the result of `func`. If `resolver` is
1088
+ * provided, it determines the cache key for storing the result based on the
1089
+ * arguments provided to the memoized function. By default, the first argument
1090
+ * provided to the memoized function is used as the map cache key. The `func`
1091
+ * is invoked with the `this` binding of the memoized function.
1092
+ *
1093
+ * **Note:** The cache is exposed as the `cache` property on the memoized
1094
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
1095
+ * constructor with one whose instances implement the
1096
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
1097
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
1098
+ *
1099
+ * @static
1100
+ * @memberOf _
1101
+ * @since 0.1.0
1102
+ * @category Function
1103
+ * @param {Function} func The function to have its output memoized.
1104
+ * @param {Function} [resolver] The function to resolve the cache key.
1105
+ * @returns {Function} Returns the new memoized function.
1106
+ * @example
1107
+ *
1108
+ * var object = { 'a': 1, 'b': 2 };
1109
+ * var other = { 'c': 3, 'd': 4 };
1110
+ *
1111
+ * var values = _.memoize(_.values);
1112
+ * values(object);
1113
+ * // => [1, 2]
1114
+ *
1115
+ * values(other);
1116
+ * // => [3, 4]
1117
+ *
1118
+ * object.a = 2;
1119
+ * values(object);
1120
+ * // => [1, 2]
1121
+ *
1122
+ * // Modify the result cache.
1123
+ * values.cache.set(object, ['a', 'b']);
1124
+ * values(object);
1125
+ * // => ['a', 'b']
1126
+ *
1127
+ * // Replace `_.memoize.Cache`.
1128
+ * _.memoize.Cache = WeakMap;
1129
+ */
1130
+ function memoize(func, resolver) {
1131
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
1132
+ throw new TypeError(FUNC_ERROR_TEXT);
1133
+ }
1134
+ var memoized = function() {
1135
+ var args = arguments,
1136
+ key = resolver ? resolver.apply(this, args) : args[0],
1137
+ cache = memoized.cache;
1138
+
1139
+ if (cache.has(key)) {
1140
+ return cache.get(key);
1141
+ }
1142
+ var result = func.apply(this, args);
1143
+ memoized.cache = cache.set(key, result) || cache;
1144
+ return result;
1145
+ };
1146
+ memoized.cache = new (memoize.Cache || _MapCache);
1147
+ return memoized;
1148
+ }
1149
+
1150
+ // Expose `MapCache`.
1151
+ memoize.Cache = _MapCache;
1152
+
1153
+ var memoize_1 = memoize;
1154
+
1155
+ /** Used as the maximum memoize cache size. */
1156
+ var MAX_MEMOIZE_SIZE = 500;
1157
+
1158
+ /**
1159
+ * A specialized version of `_.memoize` which clears the memoized function's
1160
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
1161
+ *
1162
+ * @private
1163
+ * @param {Function} func The function to have its output memoized.
1164
+ * @returns {Function} Returns the new memoized function.
1165
+ */
1166
+ function memoizeCapped(func) {
1167
+ var result = memoize_1(func, function(key) {
1168
+ if (cache.size === MAX_MEMOIZE_SIZE) {
1169
+ cache.clear();
1170
+ }
1171
+ return key;
1172
+ });
1173
+
1174
+ var cache = result.cache;
1175
+ return result;
1176
+ }
1177
+
1178
+ var _memoizeCapped = memoizeCapped;
1179
+
1180
+ /** Used to match property names within property paths. */
1181
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
1182
+
1183
+ /** Used to match backslashes in property paths. */
1184
+ var reEscapeChar = /\\(\\)?/g;
1185
+
1186
+ /**
1187
+ * Converts `string` to a property path array.
1188
+ *
1189
+ * @private
1190
+ * @param {string} string The string to convert.
1191
+ * @returns {Array} Returns the property path array.
1192
+ */
1193
+ var stringToPath = _memoizeCapped(function(string) {
1194
+ var result = [];
1195
+ if (string.charCodeAt(0) === 46 /* . */) {
1196
+ result.push('');
1197
+ }
1198
+ string.replace(rePropName, function(match, number, quote, subString) {
1199
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
1200
+ });
1201
+ return result;
1202
+ });
1203
+
1204
+ var _stringToPath = stringToPath;
1205
+
1206
+ /**
1207
+ * A specialized version of `_.map` for arrays without support for iteratee
1208
+ * shorthands.
1209
+ *
1210
+ * @private
1211
+ * @param {Array} [array] The array to iterate over.
1212
+ * @param {Function} iteratee The function invoked per iteration.
1213
+ * @returns {Array} Returns the new mapped array.
1214
+ */
1215
+ function arrayMap(array, iteratee) {
1216
+ var index = -1,
1217
+ length = array == null ? 0 : array.length,
1218
+ result = Array(length);
1219
+
1220
+ while (++index < length) {
1221
+ result[index] = iteratee(array[index], index, array);
1222
+ }
1223
+ return result;
1224
+ }
1225
+
1226
+ var _arrayMap = arrayMap;
1227
+
1228
+ /** Used as references for various `Number` constants. */
1229
+ var INFINITY$1 = 1 / 0;
1230
+
1231
+ /** Used to convert symbols to primitives and strings. */
1232
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
1233
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
1234
+
1235
+ /**
1236
+ * The base implementation of `_.toString` which doesn't convert nullish
1237
+ * values to empty strings.
1238
+ *
1239
+ * @private
1240
+ * @param {*} value The value to process.
1241
+ * @returns {string} Returns the string.
1242
+ */
1243
+ function baseToString(value) {
1244
+ // Exit early for strings to avoid a performance hit in some environments.
1245
+ if (typeof value == 'string') {
1246
+ return value;
1247
+ }
1248
+ if (isArray_1(value)) {
1249
+ // Recursively convert values (susceptible to call stack limits).
1250
+ return _arrayMap(value, baseToString) + '';
1251
+ }
1252
+ if (isSymbol_1(value)) {
1253
+ return symbolToString ? symbolToString.call(value) : '';
1254
+ }
1255
+ var result = (value + '');
1256
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
1257
+ }
1258
+
1259
+ var _baseToString = baseToString;
1260
+
1261
+ /**
1262
+ * Converts `value` to a string. An empty string is returned for `null`
1263
+ * and `undefined` values. The sign of `-0` is preserved.
1264
+ *
1265
+ * @static
1266
+ * @memberOf _
1267
+ * @since 4.0.0
1268
+ * @category Lang
1269
+ * @param {*} value The value to convert.
1270
+ * @returns {string} Returns the converted string.
1271
+ * @example
1272
+ *
1273
+ * _.toString(null);
1274
+ * // => ''
1275
+ *
1276
+ * _.toString(-0);
1277
+ * // => '-0'
1278
+ *
1279
+ * _.toString([1, 2, 3]);
1280
+ * // => '1,2,3'
1281
+ */
1282
+ function toString(value) {
1283
+ return value == null ? '' : _baseToString(value);
1284
+ }
1285
+
1286
+ var toString_1 = toString;
1287
+
1288
+ /**
1289
+ * Casts `value` to a path array if it's not one.
1290
+ *
1291
+ * @private
1292
+ * @param {*} value The value to inspect.
1293
+ * @param {Object} [object] The object to query keys on.
1294
+ * @returns {Array} Returns the cast property path array.
1295
+ */
1296
+ function castPath(value, object) {
1297
+ if (isArray_1(value)) {
1298
+ return value;
1299
+ }
1300
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
1301
+ }
1302
+
1303
+ var _castPath = castPath;
1304
+
1305
+ /** Used as references for various `Number` constants. */
1306
+ var INFINITY = 1 / 0;
1307
+
1308
+ /**
1309
+ * Converts `value` to a string key if it's not a string or symbol.
1310
+ *
1311
+ * @private
1312
+ * @param {*} value The value to inspect.
1313
+ * @returns {string|symbol} Returns the key.
1314
+ */
1315
+ function toKey(value) {
1316
+ if (typeof value == 'string' || isSymbol_1(value)) {
1317
+ return value;
1318
+ }
1319
+ var result = (value + '');
1320
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
1321
+ }
1322
+
1323
+ var _toKey = toKey;
1324
+
1325
+ /**
1326
+ * The base implementation of `_.get` without support for default values.
1327
+ *
1328
+ * @private
1329
+ * @param {Object} object The object to query.
1330
+ * @param {Array|string} path The path of the property to get.
1331
+ * @returns {*} Returns the resolved value.
1332
+ */
1333
+ function baseGet(object, path) {
1334
+ path = _castPath(path, object);
1335
+
1336
+ var index = 0,
1337
+ length = path.length;
1338
+
1339
+ while (object != null && index < length) {
1340
+ object = object[_toKey(path[index++])];
1341
+ }
1342
+ return (index && index == length) ? object : undefined;
1343
+ }
1344
+
1345
+ var _baseGet = baseGet;
1346
+
1347
+ /**
1348
+ * Gets the value at `path` of `object`. If the resolved value is
1349
+ * `undefined`, the `defaultValue` is returned in its place.
1350
+ *
1351
+ * @static
1352
+ * @memberOf _
1353
+ * @since 3.7.0
1354
+ * @category Object
1355
+ * @param {Object} object The object to query.
1356
+ * @param {Array|string} path The path of the property to get.
1357
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
1358
+ * @returns {*} Returns the resolved value.
1359
+ * @example
1360
+ *
1361
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
1362
+ *
1363
+ * _.get(object, 'a[0].b.c');
1364
+ * // => 3
1365
+ *
1366
+ * _.get(object, ['a', '0', 'b', 'c']);
1367
+ * // => 3
1368
+ *
1369
+ * _.get(object, 'a.b.c', 'default');
1370
+ * // => 'default'
1371
+ */
1372
+ function get(object, path, defaultValue) {
1373
+ var result = object == null ? undefined : _baseGet(object, path);
1374
+ return result === undefined ? defaultValue : result;
1375
+ }
1376
+
1377
+ var get_1 = get;
1378
+
1379
+ function _typeof(obj) {
1380
+ "@babel/helpers - typeof";
1381
+
1382
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
1383
+ return typeof obj;
1384
+ } : function (obj) {
1385
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1386
+ }, _typeof(obj);
1387
+ }
1388
+
1389
+ /**
1390
+ * Copyright (c) 2014-present, Facebook, Inc.
1391
+ *
1392
+ * This source code is licensed under the MIT license found in the
1393
+ * LICENSE file in the root directory of this source tree.
1394
+ */
1395
+
1396
+ createCommonjsModule(function (module) {
1397
+ var runtime = (function (exports) {
1398
+
1399
+ var Op = Object.prototype;
1400
+ var hasOwn = Op.hasOwnProperty;
1401
+ var undefined$1; // More compressible than void 0.
1402
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
1403
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
1404
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1405
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1406
+
1407
+ function define(obj, key, value) {
1408
+ Object.defineProperty(obj, key, {
1409
+ value: value,
1410
+ enumerable: true,
1411
+ configurable: true,
1412
+ writable: true
1413
+ });
1414
+ return obj[key];
1415
+ }
1416
+ try {
1417
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
1418
+ define({}, "");
1419
+ } catch (err) {
1420
+ define = function(obj, key, value) {
1421
+ return obj[key] = value;
1422
+ };
1423
+ }
1424
+
1425
+ function wrap(innerFn, outerFn, self, tryLocsList) {
1426
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1427
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1428
+ var generator = Object.create(protoGenerator.prototype);
1429
+ var context = new Context(tryLocsList || []);
1430
+
1431
+ // The ._invoke method unifies the implementations of the .next,
1432
+ // .throw, and .return methods.
1433
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
1434
+
1435
+ return generator;
1436
+ }
1437
+ exports.wrap = wrap;
1438
+
1439
+ // Try/catch helper to minimize deoptimizations. Returns a completion
1440
+ // record like context.tryEntries[i].completion. This interface could
1441
+ // have been (and was previously) designed to take a closure to be
1442
+ // invoked without arguments, but in all the cases we care about we
1443
+ // already have an existing method we want to call, so there's no need
1444
+ // to create a new function object. We can even get away with assuming
1445
+ // the method takes exactly one argument, since that happens to be true
1446
+ // in every case, so we don't have to touch the arguments object. The
1447
+ // only additional allocation required is the completion record, which
1448
+ // has a stable shape and so hopefully should be cheap to allocate.
1449
+ function tryCatch(fn, obj, arg) {
1450
+ try {
1451
+ return { type: "normal", arg: fn.call(obj, arg) };
1452
+ } catch (err) {
1453
+ return { type: "throw", arg: err };
1454
+ }
1455
+ }
1456
+
1457
+ var GenStateSuspendedStart = "suspendedStart";
1458
+ var GenStateSuspendedYield = "suspendedYield";
1459
+ var GenStateExecuting = "executing";
1460
+ var GenStateCompleted = "completed";
1461
+
1462
+ // Returning this object from the innerFn has the same effect as
1463
+ // breaking out of the dispatch switch statement.
1464
+ var ContinueSentinel = {};
1465
+
1466
+ // Dummy constructor functions that we use as the .constructor and
1467
+ // .constructor.prototype properties for functions that return Generator
1468
+ // objects. For full spec compliance, you may wish to configure your
1469
+ // minifier not to mangle the names of these two functions.
1470
+ function Generator() {}
1471
+ function GeneratorFunction() {}
1472
+ function GeneratorFunctionPrototype() {}
1473
+
1474
+ // This is a polyfill for %IteratorPrototype% for environments that
1475
+ // don't natively support it.
1476
+ var IteratorPrototype = {};
1477
+ define(IteratorPrototype, iteratorSymbol, function () {
1478
+ return this;
1479
+ });
1480
+
1481
+ var getProto = Object.getPrototypeOf;
1482
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1483
+ if (NativeIteratorPrototype &&
1484
+ NativeIteratorPrototype !== Op &&
1485
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1486
+ // This environment has a native %IteratorPrototype%; use it instead
1487
+ // of the polyfill.
1488
+ IteratorPrototype = NativeIteratorPrototype;
1489
+ }
1490
+
1491
+ var Gp = GeneratorFunctionPrototype.prototype =
1492
+ Generator.prototype = Object.create(IteratorPrototype);
1493
+ GeneratorFunction.prototype = GeneratorFunctionPrototype;
1494
+ define(Gp, "constructor", GeneratorFunctionPrototype);
1495
+ define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
1496
+ GeneratorFunction.displayName = define(
1497
+ GeneratorFunctionPrototype,
1498
+ toStringTagSymbol,
1499
+ "GeneratorFunction"
1500
+ );
1501
+
1502
+ // Helper for defining the .next, .throw, and .return methods of the
1503
+ // Iterator interface in terms of a single ._invoke method.
1504
+ function defineIteratorMethods(prototype) {
1505
+ ["next", "throw", "return"].forEach(function(method) {
1506
+ define(prototype, method, function(arg) {
1507
+ return this._invoke(method, arg);
1508
+ });
1509
+ });
1510
+ }
1511
+
1512
+ exports.isGeneratorFunction = function(genFun) {
1513
+ var ctor = typeof genFun === "function" && genFun.constructor;
1514
+ return ctor
1515
+ ? ctor === GeneratorFunction ||
1516
+ // For the native GeneratorFunction constructor, the best we can
1517
+ // do is to check its .name property.
1518
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
1519
+ : false;
1520
+ };
1521
+
1522
+ exports.mark = function(genFun) {
1523
+ if (Object.setPrototypeOf) {
1524
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1525
+ } else {
1526
+ genFun.__proto__ = GeneratorFunctionPrototype;
1527
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
1528
+ }
1529
+ genFun.prototype = Object.create(Gp);
1530
+ return genFun;
1531
+ };
1532
+
1533
+ // Within the body of any async function, `await x` is transformed to
1534
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1535
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
1536
+ // meant to be awaited.
1537
+ exports.awrap = function(arg) {
1538
+ return { __await: arg };
1539
+ };
1540
+
1541
+ function AsyncIterator(generator, PromiseImpl) {
1542
+ function invoke(method, arg, resolve, reject) {
1543
+ var record = tryCatch(generator[method], generator, arg);
1544
+ if (record.type === "throw") {
1545
+ reject(record.arg);
1546
+ } else {
1547
+ var result = record.arg;
1548
+ var value = result.value;
1549
+ if (value &&
1550
+ typeof value === "object" &&
1551
+ hasOwn.call(value, "__await")) {
1552
+ return PromiseImpl.resolve(value.__await).then(function(value) {
1553
+ invoke("next", value, resolve, reject);
1554
+ }, function(err) {
1555
+ invoke("throw", err, resolve, reject);
1556
+ });
1557
+ }
1558
+
1559
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
1560
+ // When a yielded Promise is resolved, its final value becomes
1561
+ // the .value of the Promise<{value,done}> result for the
1562
+ // current iteration.
1563
+ result.value = unwrapped;
1564
+ resolve(result);
1565
+ }, function(error) {
1566
+ // If a rejected Promise was yielded, throw the rejection back
1567
+ // into the async generator function so it can be handled there.
1568
+ return invoke("throw", error, resolve, reject);
1569
+ });
1570
+ }
1571
+ }
1572
+
1573
+ var previousPromise;
1574
+
1575
+ function enqueue(method, arg) {
1576
+ function callInvokeWithMethodAndArg() {
1577
+ return new PromiseImpl(function(resolve, reject) {
1578
+ invoke(method, arg, resolve, reject);
1579
+ });
1580
+ }
1581
+
1582
+ return previousPromise =
1583
+ // If enqueue has been called before, then we want to wait until
1584
+ // all previous Promises have been resolved before calling invoke,
1585
+ // so that results are always delivered in the correct order. If
1586
+ // enqueue has not been called before, then it is important to
1587
+ // call invoke immediately, without waiting on a callback to fire,
1588
+ // so that the async generator function has the opportunity to do
1589
+ // any necessary setup in a predictable way. This predictability
1590
+ // is why the Promise constructor synchronously invokes its
1591
+ // executor callback, and why async functions synchronously
1592
+ // execute code before the first await. Since we implement simple
1593
+ // async functions in terms of async generators, it is especially
1594
+ // important to get this right, even though it requires care.
1595
+ previousPromise ? previousPromise.then(
1596
+ callInvokeWithMethodAndArg,
1597
+ // Avoid propagating failures to Promises returned by later
1598
+ // invocations of the iterator.
1599
+ callInvokeWithMethodAndArg
1600
+ ) : callInvokeWithMethodAndArg();
1601
+ }
1602
+
1603
+ // Define the unified helper method that is used to implement .next,
1604
+ // .throw, and .return (see defineIteratorMethods).
1605
+ this._invoke = enqueue;
1606
+ }
1607
+
1608
+ defineIteratorMethods(AsyncIterator.prototype);
1609
+ define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
1610
+ return this;
1611
+ });
1612
+ exports.AsyncIterator = AsyncIterator;
1613
+
1614
+ // Note that simple async functions are implemented on top of
1615
+ // AsyncIterator objects; they just return a Promise for the value of
1616
+ // the final result produced by the iterator.
1617
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
1618
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
1619
+
1620
+ var iter = new AsyncIterator(
1621
+ wrap(innerFn, outerFn, self, tryLocsList),
1622
+ PromiseImpl
1623
+ );
1624
+
1625
+ return exports.isGeneratorFunction(outerFn)
1626
+ ? iter // If outerFn is a generator, return the full iterator.
1627
+ : iter.next().then(function(result) {
1628
+ return result.done ? result.value : iter.next();
1629
+ });
1630
+ };
1631
+
1632
+ function makeInvokeMethod(innerFn, self, context) {
1633
+ var state = GenStateSuspendedStart;
1634
+
1635
+ return function invoke(method, arg) {
1636
+ if (state === GenStateExecuting) {
1637
+ throw new Error("Generator is already running");
1638
+ }
1639
+
1640
+ if (state === GenStateCompleted) {
1641
+ if (method === "throw") {
1642
+ throw arg;
1643
+ }
1644
+
1645
+ // Be forgiving, per 25.3.3.3.3 of the spec:
1646
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
1647
+ return doneResult();
1648
+ }
1649
+
1650
+ context.method = method;
1651
+ context.arg = arg;
1652
+
1653
+ while (true) {
1654
+ var delegate = context.delegate;
1655
+ if (delegate) {
1656
+ var delegateResult = maybeInvokeDelegate(delegate, context);
1657
+ if (delegateResult) {
1658
+ if (delegateResult === ContinueSentinel) continue;
1659
+ return delegateResult;
1660
+ }
1661
+ }
1662
+
1663
+ if (context.method === "next") {
1664
+ // Setting context._sent for legacy support of Babel's
1665
+ // function.sent implementation.
1666
+ context.sent = context._sent = context.arg;
1667
+
1668
+ } else if (context.method === "throw") {
1669
+ if (state === GenStateSuspendedStart) {
1670
+ state = GenStateCompleted;
1671
+ throw context.arg;
1672
+ }
1673
+
1674
+ context.dispatchException(context.arg);
1675
+
1676
+ } else if (context.method === "return") {
1677
+ context.abrupt("return", context.arg);
1678
+ }
1679
+
1680
+ state = GenStateExecuting;
1681
+
1682
+ var record = tryCatch(innerFn, self, context);
1683
+ if (record.type === "normal") {
1684
+ // If an exception is thrown from innerFn, we leave state ===
1685
+ // GenStateExecuting and loop back for another invocation.
1686
+ state = context.done
1687
+ ? GenStateCompleted
1688
+ : GenStateSuspendedYield;
1689
+
1690
+ if (record.arg === ContinueSentinel) {
1691
+ continue;
1692
+ }
1693
+
1694
+ return {
1695
+ value: record.arg,
1696
+ done: context.done
1697
+ };
1698
+
1699
+ } else if (record.type === "throw") {
1700
+ state = GenStateCompleted;
1701
+ // Dispatch the exception by looping back around to the
1702
+ // context.dispatchException(context.arg) call above.
1703
+ context.method = "throw";
1704
+ context.arg = record.arg;
1705
+ }
1706
+ }
1707
+ };
1708
+ }
1709
+
1710
+ // Call delegate.iterator[context.method](context.arg) and handle the
1711
+ // result, either by returning a { value, done } result from the
1712
+ // delegate iterator, or by modifying context.method and context.arg,
1713
+ // setting context.delegate to null, and returning the ContinueSentinel.
1714
+ function maybeInvokeDelegate(delegate, context) {
1715
+ var method = delegate.iterator[context.method];
1716
+ if (method === undefined$1) {
1717
+ // A .throw or .return when the delegate iterator has no .throw
1718
+ // method always terminates the yield* loop.
1719
+ context.delegate = null;
1720
+
1721
+ if (context.method === "throw") {
1722
+ // Note: ["return"] must be used for ES3 parsing compatibility.
1723
+ if (delegate.iterator["return"]) {
1724
+ // If the delegate iterator has a return method, give it a
1725
+ // chance to clean up.
1726
+ context.method = "return";
1727
+ context.arg = undefined$1;
1728
+ maybeInvokeDelegate(delegate, context);
1729
+
1730
+ if (context.method === "throw") {
1731
+ // If maybeInvokeDelegate(context) changed context.method from
1732
+ // "return" to "throw", let that override the TypeError below.
1733
+ return ContinueSentinel;
1734
+ }
1735
+ }
1736
+
1737
+ context.method = "throw";
1738
+ context.arg = new TypeError(
1739
+ "The iterator does not provide a 'throw' method");
1740
+ }
1741
+
1742
+ return ContinueSentinel;
1743
+ }
1744
+
1745
+ var record = tryCatch(method, delegate.iterator, context.arg);
1746
+
1747
+ if (record.type === "throw") {
1748
+ context.method = "throw";
1749
+ context.arg = record.arg;
1750
+ context.delegate = null;
1751
+ return ContinueSentinel;
1752
+ }
1753
+
1754
+ var info = record.arg;
1755
+
1756
+ if (! info) {
1757
+ context.method = "throw";
1758
+ context.arg = new TypeError("iterator result is not an object");
1759
+ context.delegate = null;
1760
+ return ContinueSentinel;
1761
+ }
1762
+
1763
+ if (info.done) {
1764
+ // Assign the result of the finished delegate to the temporary
1765
+ // variable specified by delegate.resultName (see delegateYield).
1766
+ context[delegate.resultName] = info.value;
1767
+
1768
+ // Resume execution at the desired location (see delegateYield).
1769
+ context.next = delegate.nextLoc;
1770
+
1771
+ // If context.method was "throw" but the delegate handled the
1772
+ // exception, let the outer generator proceed normally. If
1773
+ // context.method was "next", forget context.arg since it has been
1774
+ // "consumed" by the delegate iterator. If context.method was
1775
+ // "return", allow the original .return call to continue in the
1776
+ // outer generator.
1777
+ if (context.method !== "return") {
1778
+ context.method = "next";
1779
+ context.arg = undefined$1;
1780
+ }
1781
+
1782
+ } else {
1783
+ // Re-yield the result returned by the delegate method.
1784
+ return info;
1785
+ }
1786
+
1787
+ // The delegate iterator is finished, so forget it and continue with
1788
+ // the outer generator.
1789
+ context.delegate = null;
1790
+ return ContinueSentinel;
1791
+ }
1792
+
1793
+ // Define Generator.prototype.{next,throw,return} in terms of the
1794
+ // unified ._invoke helper method.
1795
+ defineIteratorMethods(Gp);
1796
+
1797
+ define(Gp, toStringTagSymbol, "Generator");
1798
+
1799
+ // A Generator should always return itself as the iterator object when the
1800
+ // @@iterator function is called on it. Some browsers' implementations of the
1801
+ // iterator prototype chain incorrectly implement this, causing the Generator
1802
+ // object to not be returned from this call. This ensures that doesn't happen.
1803
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
1804
+ define(Gp, iteratorSymbol, function() {
1805
+ return this;
1806
+ });
1807
+
1808
+ define(Gp, "toString", function() {
1809
+ return "[object Generator]";
1810
+ });
1811
+
1812
+ function pushTryEntry(locs) {
1813
+ var entry = { tryLoc: locs[0] };
1814
+
1815
+ if (1 in locs) {
1816
+ entry.catchLoc = locs[1];
1817
+ }
1818
+
1819
+ if (2 in locs) {
1820
+ entry.finallyLoc = locs[2];
1821
+ entry.afterLoc = locs[3];
1822
+ }
1823
+
1824
+ this.tryEntries.push(entry);
1825
+ }
1826
+
1827
+ function resetTryEntry(entry) {
1828
+ var record = entry.completion || {};
1829
+ record.type = "normal";
1830
+ delete record.arg;
1831
+ entry.completion = record;
1832
+ }
1833
+
1834
+ function Context(tryLocsList) {
1835
+ // The root entry object (effectively a try statement without a catch
1836
+ // or a finally block) gives us a place to store values thrown from
1837
+ // locations where there is no enclosing try statement.
1838
+ this.tryEntries = [{ tryLoc: "root" }];
1839
+ tryLocsList.forEach(pushTryEntry, this);
1840
+ this.reset(true);
1841
+ }
1842
+
1843
+ exports.keys = function(object) {
1844
+ var keys = [];
1845
+ for (var key in object) {
1846
+ keys.push(key);
1847
+ }
1848
+ keys.reverse();
1849
+
1850
+ // Rather than returning an object with a next method, we keep
1851
+ // things simple and return the next function itself.
1852
+ return function next() {
1853
+ while (keys.length) {
1854
+ var key = keys.pop();
1855
+ if (key in object) {
1856
+ next.value = key;
1857
+ next.done = false;
1858
+ return next;
1859
+ }
1860
+ }
1861
+
1862
+ // To avoid creating an additional object, we just hang the .value
1863
+ // and .done properties off the next function object itself. This
1864
+ // also ensures that the minifier will not anonymize the function.
1865
+ next.done = true;
1866
+ return next;
1867
+ };
1868
+ };
1869
+
1870
+ function values(iterable) {
1871
+ if (iterable) {
1872
+ var iteratorMethod = iterable[iteratorSymbol];
1873
+ if (iteratorMethod) {
1874
+ return iteratorMethod.call(iterable);
1875
+ }
1876
+
1877
+ if (typeof iterable.next === "function") {
1878
+ return iterable;
1879
+ }
1880
+
1881
+ if (!isNaN(iterable.length)) {
1882
+ var i = -1, next = function next() {
1883
+ while (++i < iterable.length) {
1884
+ if (hasOwn.call(iterable, i)) {
1885
+ next.value = iterable[i];
1886
+ next.done = false;
1887
+ return next;
1888
+ }
1889
+ }
1890
+
1891
+ next.value = undefined$1;
1892
+ next.done = true;
1893
+
1894
+ return next;
1895
+ };
1896
+
1897
+ return next.next = next;
1898
+ }
1899
+ }
1900
+
1901
+ // Return an iterator with no values.
1902
+ return { next: doneResult };
1903
+ }
1904
+ exports.values = values;
1905
+
1906
+ function doneResult() {
1907
+ return { value: undefined$1, done: true };
1908
+ }
1909
+
1910
+ Context.prototype = {
1911
+ constructor: Context,
1912
+
1913
+ reset: function(skipTempReset) {
1914
+ this.prev = 0;
1915
+ this.next = 0;
1916
+ // Resetting context._sent for legacy support of Babel's
1917
+ // function.sent implementation.
1918
+ this.sent = this._sent = undefined$1;
1919
+ this.done = false;
1920
+ this.delegate = null;
1921
+
1922
+ this.method = "next";
1923
+ this.arg = undefined$1;
1924
+
1925
+ this.tryEntries.forEach(resetTryEntry);
1926
+
1927
+ if (!skipTempReset) {
1928
+ for (var name in this) {
1929
+ // Not sure about the optimal order of these conditions:
1930
+ if (name.charAt(0) === "t" &&
1931
+ hasOwn.call(this, name) &&
1932
+ !isNaN(+name.slice(1))) {
1933
+ this[name] = undefined$1;
1934
+ }
1935
+ }
1936
+ }
1937
+ },
1938
+
1939
+ stop: function() {
1940
+ this.done = true;
1941
+
1942
+ var rootEntry = this.tryEntries[0];
1943
+ var rootRecord = rootEntry.completion;
1944
+ if (rootRecord.type === "throw") {
1945
+ throw rootRecord.arg;
1946
+ }
1947
+
1948
+ return this.rval;
1949
+ },
1950
+
1951
+ dispatchException: function(exception) {
1952
+ if (this.done) {
1953
+ throw exception;
1954
+ }
1955
+
1956
+ var context = this;
1957
+ function handle(loc, caught) {
1958
+ record.type = "throw";
1959
+ record.arg = exception;
1960
+ context.next = loc;
1961
+
1962
+ if (caught) {
1963
+ // If the dispatched exception was caught by a catch block,
1964
+ // then let that catch block handle the exception normally.
1965
+ context.method = "next";
1966
+ context.arg = undefined$1;
1967
+ }
1968
+
1969
+ return !! caught;
1970
+ }
1971
+
1972
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1973
+ var entry = this.tryEntries[i];
1974
+ var record = entry.completion;
1975
+
1976
+ if (entry.tryLoc === "root") {
1977
+ // Exception thrown outside of any try block that could handle
1978
+ // it, so set the completion value of the entire function to
1979
+ // throw the exception.
1980
+ return handle("end");
1981
+ }
1982
+
1983
+ if (entry.tryLoc <= this.prev) {
1984
+ var hasCatch = hasOwn.call(entry, "catchLoc");
1985
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
1986
+
1987
+ if (hasCatch && hasFinally) {
1988
+ if (this.prev < entry.catchLoc) {
1989
+ return handle(entry.catchLoc, true);
1990
+ } else if (this.prev < entry.finallyLoc) {
1991
+ return handle(entry.finallyLoc);
1992
+ }
1993
+
1994
+ } else if (hasCatch) {
1995
+ if (this.prev < entry.catchLoc) {
1996
+ return handle(entry.catchLoc, true);
1997
+ }
1998
+
1999
+ } else if (hasFinally) {
2000
+ if (this.prev < entry.finallyLoc) {
2001
+ return handle(entry.finallyLoc);
2002
+ }
2003
+
2004
+ } else {
2005
+ throw new Error("try statement without catch or finally");
2006
+ }
2007
+ }
2008
+ }
2009
+ },
2010
+
2011
+ abrupt: function(type, arg) {
2012
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2013
+ var entry = this.tryEntries[i];
2014
+ if (entry.tryLoc <= this.prev &&
2015
+ hasOwn.call(entry, "finallyLoc") &&
2016
+ this.prev < entry.finallyLoc) {
2017
+ var finallyEntry = entry;
2018
+ break;
2019
+ }
2020
+ }
2021
+
2022
+ if (finallyEntry &&
2023
+ (type === "break" ||
2024
+ type === "continue") &&
2025
+ finallyEntry.tryLoc <= arg &&
2026
+ arg <= finallyEntry.finallyLoc) {
2027
+ // Ignore the finally entry if control is not jumping to a
2028
+ // location outside the try/catch block.
2029
+ finallyEntry = null;
2030
+ }
2031
+
2032
+ var record = finallyEntry ? finallyEntry.completion : {};
2033
+ record.type = type;
2034
+ record.arg = arg;
2035
+
2036
+ if (finallyEntry) {
2037
+ this.method = "next";
2038
+ this.next = finallyEntry.finallyLoc;
2039
+ return ContinueSentinel;
2040
+ }
2041
+
2042
+ return this.complete(record);
2043
+ },
2044
+
2045
+ complete: function(record, afterLoc) {
2046
+ if (record.type === "throw") {
2047
+ throw record.arg;
2048
+ }
2049
+
2050
+ if (record.type === "break" ||
2051
+ record.type === "continue") {
2052
+ this.next = record.arg;
2053
+ } else if (record.type === "return") {
2054
+ this.rval = this.arg = record.arg;
2055
+ this.method = "return";
2056
+ this.next = "end";
2057
+ } else if (record.type === "normal" && afterLoc) {
2058
+ this.next = afterLoc;
2059
+ }
2060
+
2061
+ return ContinueSentinel;
2062
+ },
2063
+
2064
+ finish: function(finallyLoc) {
2065
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2066
+ var entry = this.tryEntries[i];
2067
+ if (entry.finallyLoc === finallyLoc) {
2068
+ this.complete(entry.completion, entry.afterLoc);
2069
+ resetTryEntry(entry);
2070
+ return ContinueSentinel;
2071
+ }
2072
+ }
2073
+ },
2074
+
2075
+ "catch": function(tryLoc) {
2076
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2077
+ var entry = this.tryEntries[i];
2078
+ if (entry.tryLoc === tryLoc) {
2079
+ var record = entry.completion;
2080
+ if (record.type === "throw") {
2081
+ var thrown = record.arg;
2082
+ resetTryEntry(entry);
2083
+ }
2084
+ return thrown;
2085
+ }
2086
+ }
2087
+
2088
+ // The context.catch method must only be called with a location
2089
+ // argument that corresponds to a known catch block.
2090
+ throw new Error("illegal catch attempt");
2091
+ },
2092
+
2093
+ delegateYield: function(iterable, resultName, nextLoc) {
2094
+ this.delegate = {
2095
+ iterator: values(iterable),
2096
+ resultName: resultName,
2097
+ nextLoc: nextLoc
2098
+ };
2099
+
2100
+ if (this.method === "next") {
2101
+ // Deliberately forget the last sent value so that we don't
2102
+ // accidentally pass it on to the delegate.
2103
+ this.arg = undefined$1;
2104
+ }
2105
+
2106
+ return ContinueSentinel;
2107
+ }
2108
+ };
2109
+
2110
+ // Regardless of whether this script is executing as a CommonJS module
2111
+ // or not, return the runtime object so that we can declare the variable
2112
+ // regeneratorRuntime in the outer scope, which allows this module to be
2113
+ // injected easily by `bin/regenerator --include-runtime script.js`.
2114
+ return exports;
2115
+
2116
+ }(
2117
+ // If this script is executing as a CommonJS module, use module.exports
2118
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
2119
+ // object. Either way, the resulting object will be used to initialize
2120
+ // the regeneratorRuntime variable at the top of this file.
2121
+ module.exports
2122
+ ));
2123
+
2124
+ try {
2125
+ regeneratorRuntime = runtime;
2126
+ } catch (accidentalStrictMode) {
2127
+ // This module should not be running in strict mode, so the above
2128
+ // assignment should always work unless something is misconfigured. Just
2129
+ // in case runtime.js accidentally runs in strict mode, in modern engines
2130
+ // we can explicitly access globalThis. In older engines we can escape
2131
+ // strict mode using a global Function call. This could conceivably fail
2132
+ // if a Content Security Policy forbids using Function, but in that case
2133
+ // the proper solution is to fix the accidental strict mode problem. If
2134
+ // you've misconfigured your bundler to force strict mode and applied a
2135
+ // CSP to forbid Function, and you're not willing to fix either of those
2136
+ // problems, please detail your unique predicament in a GitHub issue.
2137
+ if (typeof globalThis === "object") {
2138
+ globalThis.regeneratorRuntime = runtime;
2139
+ } else {
2140
+ Function("r", "regeneratorRuntime = r")(runtime);
2141
+ }
2142
+ }
2143
+ });
2144
+
2145
+ /**
2146
+ * A specialized version of `_.reduce` for arrays without support for
2147
+ * iteratee shorthands.
2148
+ *
2149
+ * @private
2150
+ * @param {Array} [array] The array to iterate over.
2151
+ * @param {Function} iteratee The function invoked per iteration.
2152
+ * @param {*} [accumulator] The initial value.
2153
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
2154
+ * the initial value.
2155
+ * @returns {*} Returns the accumulated value.
2156
+ */
2157
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
2158
+ var index = -1,
2159
+ length = array == null ? 0 : array.length;
2160
+
2161
+ if (initAccum && length) {
2162
+ accumulator = array[++index];
2163
+ }
2164
+ while (++index < length) {
2165
+ accumulator = iteratee(accumulator, array[index], index, array);
2166
+ }
2167
+ return accumulator;
2168
+ }
2169
+
2170
+ var _arrayReduce = arrayReduce;
2171
+
2172
+ /**
2173
+ * The base implementation of `_.propertyOf` without support for deep paths.
2174
+ *
2175
+ * @private
2176
+ * @param {Object} object The object to query.
2177
+ * @returns {Function} Returns the new accessor function.
2178
+ */
2179
+ function basePropertyOf(object) {
2180
+ return function(key) {
2181
+ return object == null ? undefined : object[key];
2182
+ };
2183
+ }
2184
+
2185
+ var _basePropertyOf = basePropertyOf;
2186
+
2187
+ /** Used to map Latin Unicode letters to basic Latin letters. */
2188
+ var deburredLetters = {
2189
+ // Latin-1 Supplement block.
2190
+ '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
2191
+ '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
2192
+ '\xc7': 'C', '\xe7': 'c',
2193
+ '\xd0': 'D', '\xf0': 'd',
2194
+ '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
2195
+ '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
2196
+ '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
2197
+ '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
2198
+ '\xd1': 'N', '\xf1': 'n',
2199
+ '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
2200
+ '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
2201
+ '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
2202
+ '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
2203
+ '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
2204
+ '\xc6': 'Ae', '\xe6': 'ae',
2205
+ '\xde': 'Th', '\xfe': 'th',
2206
+ '\xdf': 'ss',
2207
+ // Latin Extended-A block.
2208
+ '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
2209
+ '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
2210
+ '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
2211
+ '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
2212
+ '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
2213
+ '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
2214
+ '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
2215
+ '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
2216
+ '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
2217
+ '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
2218
+ '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
2219
+ '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
2220
+ '\u0134': 'J', '\u0135': 'j',
2221
+ '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
2222
+ '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
2223
+ '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
2224
+ '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
2225
+ '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
2226
+ '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
2227
+ '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
2228
+ '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
2229
+ '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
2230
+ '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
2231
+ '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
2232
+ '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
2233
+ '\u0163': 't', '\u0165': 't', '\u0167': 't',
2234
+ '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
2235
+ '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
2236
+ '\u0174': 'W', '\u0175': 'w',
2237
+ '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
2238
+ '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
2239
+ '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
2240
+ '\u0132': 'IJ', '\u0133': 'ij',
2241
+ '\u0152': 'Oe', '\u0153': 'oe',
2242
+ '\u0149': "'n", '\u017f': 's'
2243
+ };
2244
+
2245
+ /**
2246
+ * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
2247
+ * letters to basic Latin letters.
2248
+ *
2249
+ * @private
2250
+ * @param {string} letter The matched letter to deburr.
2251
+ * @returns {string} Returns the deburred letter.
2252
+ */
2253
+ var deburrLetter = _basePropertyOf(deburredLetters);
2254
+
2255
+ var _deburrLetter = deburrLetter;
2256
+
2257
+ /** Used to match Latin Unicode letters (excluding mathematical operators). */
2258
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
2259
+
2260
+ /** Used to compose unicode character classes. */
2261
+ var rsComboMarksRange$1 = '\\u0300-\\u036f',
2262
+ reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f',
2263
+ rsComboSymbolsRange$1 = '\\u20d0-\\u20ff',
2264
+ rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
2265
+
2266
+ /** Used to compose unicode capture groups. */
2267
+ var rsCombo$1 = '[' + rsComboRange$1 + ']';
2268
+
2269
+ /**
2270
+ * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
2271
+ * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
2272
+ */
2273
+ var reComboMark = RegExp(rsCombo$1, 'g');
2274
+
2275
+ /**
2276
+ * Deburrs `string` by converting
2277
+ * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
2278
+ * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
2279
+ * letters to basic Latin letters and removing
2280
+ * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
2281
+ *
2282
+ * @static
2283
+ * @memberOf _
2284
+ * @since 3.0.0
2285
+ * @category String
2286
+ * @param {string} [string=''] The string to deburr.
2287
+ * @returns {string} Returns the deburred string.
2288
+ * @example
2289
+ *
2290
+ * _.deburr('déjà vu');
2291
+ * // => 'deja vu'
2292
+ */
2293
+ function deburr(string) {
2294
+ string = toString_1(string);
2295
+ return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
2296
+ }
2297
+
2298
+ var deburr_1 = deburr;
2299
+
2300
+ /** Used to match words composed of alphanumeric characters. */
2301
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
2302
+
2303
+ /**
2304
+ * Splits an ASCII `string` into an array of its words.
2305
+ *
2306
+ * @private
2307
+ * @param {string} The string to inspect.
2308
+ * @returns {Array} Returns the words of `string`.
2309
+ */
2310
+ function asciiWords(string) {
2311
+ return string.match(reAsciiWord) || [];
2312
+ }
2313
+
2314
+ var _asciiWords = asciiWords;
2315
+
2316
+ /** Used to detect strings that need a more robust regexp to match words. */
2317
+ 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 ]/;
2318
+
2319
+ /**
2320
+ * Checks if `string` contains a word composed of Unicode symbols.
2321
+ *
2322
+ * @private
2323
+ * @param {string} string The string to inspect.
2324
+ * @returns {boolean} Returns `true` if a word is found, else `false`.
2325
+ */
2326
+ function hasUnicodeWord(string) {
2327
+ return reHasUnicodeWord.test(string);
2328
+ }
2329
+
2330
+ var _hasUnicodeWord = hasUnicodeWord;
2331
+
2332
+ /** Used to compose unicode character classes. */
2333
+ var rsAstralRange = '\\ud800-\\udfff',
2334
+ rsComboMarksRange = '\\u0300-\\u036f',
2335
+ reComboHalfMarksRange = '\\ufe20-\\ufe2f',
2336
+ rsComboSymbolsRange = '\\u20d0-\\u20ff',
2337
+ rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
2338
+ rsDingbatRange = '\\u2700-\\u27bf',
2339
+ rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
2340
+ rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
2341
+ rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
2342
+ rsPunctuationRange = '\\u2000-\\u206f',
2343
+ 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',
2344
+ rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
2345
+ rsVarRange = '\\ufe0e\\ufe0f',
2346
+ rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
2347
+
2348
+ /** Used to compose unicode capture groups. */
2349
+ var rsApos$1 = "['\u2019]",
2350
+ rsBreak = '[' + rsBreakRange + ']',
2351
+ rsCombo = '[' + rsComboRange + ']',
2352
+ rsDigits = '\\d+',
2353
+ rsDingbat = '[' + rsDingbatRange + ']',
2354
+ rsLower = '[' + rsLowerRange + ']',
2355
+ rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
2356
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
2357
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
2358
+ rsNonAstral = '[^' + rsAstralRange + ']',
2359
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
2360
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
2361
+ rsUpper = '[' + rsUpperRange + ']',
2362
+ rsZWJ = '\\u200d';
2363
+
2364
+ /** Used to compose unicode regexes. */
2365
+ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
2366
+ rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
2367
+ rsOptContrLower = '(?:' + rsApos$1 + '(?:d|ll|m|re|s|t|ve))?',
2368
+ rsOptContrUpper = '(?:' + rsApos$1 + '(?:D|LL|M|RE|S|T|VE))?',
2369
+ reOptMod = rsModifier + '?',
2370
+ rsOptVar = '[' + rsVarRange + ']?',
2371
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
2372
+ rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
2373
+ rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
2374
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
2375
+ rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;
2376
+
2377
+ /** Used to match complex or compound words. */
2378
+ var reUnicodeWord = RegExp([
2379
+ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
2380
+ rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
2381
+ rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
2382
+ rsUpper + '+' + rsOptContrUpper,
2383
+ rsOrdUpper,
2384
+ rsOrdLower,
2385
+ rsDigits,
2386
+ rsEmoji
2387
+ ].join('|'), 'g');
2388
+
2389
+ /**
2390
+ * Splits a Unicode `string` into an array of its words.
2391
+ *
2392
+ * @private
2393
+ * @param {string} The string to inspect.
2394
+ * @returns {Array} Returns the words of `string`.
2395
+ */
2396
+ function unicodeWords(string) {
2397
+ return string.match(reUnicodeWord) || [];
2398
+ }
2399
+
2400
+ var _unicodeWords = unicodeWords;
2401
+
2402
+ /**
2403
+ * Splits `string` into an array of its words.
2404
+ *
2405
+ * @static
2406
+ * @memberOf _
2407
+ * @since 3.0.0
2408
+ * @category String
2409
+ * @param {string} [string=''] The string to inspect.
2410
+ * @param {RegExp|string} [pattern] The pattern to match words.
2411
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
2412
+ * @returns {Array} Returns the words of `string`.
2413
+ * @example
2414
+ *
2415
+ * _.words('fred, barney, & pebbles');
2416
+ * // => ['fred', 'barney', 'pebbles']
2417
+ *
2418
+ * _.words('fred, barney, & pebbles', /[^, ]+/g);
2419
+ * // => ['fred', 'barney', '&', 'pebbles']
2420
+ */
2421
+ function words(string, pattern, guard) {
2422
+ string = toString_1(string);
2423
+ pattern = guard ? undefined : pattern;
2424
+
2425
+ if (pattern === undefined) {
2426
+ return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
2427
+ }
2428
+ return string.match(pattern) || [];
2429
+ }
2430
+
2431
+ var words_1 = words;
2432
+
2433
+ /** Used to compose unicode capture groups. */
2434
+ var rsApos = "['\u2019]";
2435
+
2436
+ /** Used to match apostrophes. */
2437
+ var reApos = RegExp(rsApos, 'g');
2438
+
2439
+ /**
2440
+ * Creates a function like `_.camelCase`.
2441
+ *
2442
+ * @private
2443
+ * @param {Function} callback The function to combine each word.
2444
+ * @returns {Function} Returns the new compounder function.
2445
+ */
2446
+ function createCompounder(callback) {
2447
+ return function(string) {
2448
+ return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
2449
+ };
2450
+ }
2451
+
2452
+ var _createCompounder = createCompounder;
2453
+
2454
+ /**
2455
+ * Converts `string`, as space separated words, to upper case.
2456
+ *
2457
+ * @static
2458
+ * @memberOf _
2459
+ * @since 4.0.0
2460
+ * @category String
2461
+ * @param {string} [string=''] The string to convert.
2462
+ * @returns {string} Returns the upper cased string.
2463
+ * @example
2464
+ *
2465
+ * _.upperCase('--foo-bar');
2466
+ * // => 'FOO BAR'
2467
+ *
2468
+ * _.upperCase('fooBar');
2469
+ * // => 'FOO BAR'
2470
+ *
2471
+ * _.upperCase('__foo_bar__');
2472
+ * // => 'FOO BAR'
2473
+ */
2474
+ var upperCase = _createCompounder(function(result, word, index) {
2475
+ return result + (index ? ' ' : '') + word.toUpperCase();
2476
+ });
2477
+
2478
+ var upperCase_1 = upperCase;
2479
+
2480
+ /**
2481
+ * Converts `string`, as space separated words, to lower case.
2482
+ *
2483
+ * @static
2484
+ * @memberOf _
2485
+ * @since 4.0.0
2486
+ * @category String
2487
+ * @param {string} [string=''] The string to convert.
2488
+ * @returns {string} Returns the lower cased string.
2489
+ * @example
2490
+ *
2491
+ * _.lowerCase('--Foo-Bar--');
2492
+ * // => 'foo bar'
2493
+ *
2494
+ * _.lowerCase('fooBar');
2495
+ * // => 'foo bar'
2496
+ *
2497
+ * _.lowerCase('__FOO_BAR__');
2498
+ * // => 'foo bar'
2499
+ */
2500
+ var lowerCase = _createCompounder(function(result, word, index) {
2501
+ return result + (index ? ' ' : '') + word.toLowerCase();
2502
+ });
2503
+
2504
+ var lowerCase_1 = lowerCase;
2505
+
2506
+ function truncate() {
2507
+ var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
2508
+ var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
2509
+ var ellipsis = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2510
+ var putEllipsis = ellipsis ? " ..." : "";
2511
+ return typeof string === "string" && string.length > limit ? string.substring(0, limit) + putEllipsis : string;
2512
+ }
2513
+ var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
2514
+ var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
2515
+ var _config$showTime = config.showTime,
2516
+ showTime = _config$showTime === void 0 ? false : _config$showTime,
2517
+ _config$isTimeFirst = config.isTimeFirst,
2518
+ isTimeFirst = _config$isTimeFirst === void 0 ? false : _config$isTimeFirst,
2519
+ _config$isUpperCase = config.isUpperCase,
2520
+ isUpperCase = _config$isUpperCase === void 0 ? false : _config$isUpperCase,
2521
+ _config$disableMeridi = config.disableMeridiem,
2522
+ disableMeridiem = _config$disableMeridi === void 0 ? false : _config$disableMeridi,
2523
+ _config$timeFormat = config.timeFormat,
2524
+ timeFormat = _config$timeFormat === void 0 ? "12hours" : _config$timeFormat;
2525
+ var monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2526
+ var dateTime = new Date(timestamp);
2527
+ var date = dateTime.getDate().toString().padStart(2, 0);
2528
+ var month = monthList[dateTime.getMonth()];
2529
+ var localizedMonth = month;
2530
+
2531
+ if (isUpperCase) {
2532
+ localizedMonth = upperCase_1(month);
2533
+ }
2534
+
2535
+ var year = dateTime.getFullYear();
2536
+ var localizedMeridiem = config.localizedMeridiem,
2537
+ localizedMonths = config.localizedMonths,
2538
+ _config$direction = config.direction,
2539
+ direction = _config$direction === void 0 ? "ltr" : _config$direction;
2540
+ var time = formatAMPM(timestamp, timeFormat);
2541
+ var timeWithLocalizedMeridiem = time;
2542
+ var timetoShow;
2543
+
2544
+ if (localizedMonths) {
2545
+ localizedMonth = get_1(localizedMonths, [lowerCase_1(month)]) || month;
2546
+ }
2547
+
2548
+ if (localizedMeridiem) {
2549
+ var isAm = time.includes("am");
2550
+ var _localizedMeridiem$am = localizedMeridiem.am,
2551
+ am = _localizedMeridiem$am === void 0 ? "am" : _localizedMeridiem$am,
2552
+ _localizedMeridiem$pm = localizedMeridiem.pm,
2553
+ pm = _localizedMeridiem$pm === void 0 ? "pm" : _localizedMeridiem$pm;
2554
+ timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
2555
+ }
2556
+
2557
+ if (direction === "rtl") {
2558
+ timetoShow = showTime ? "".concat(timeWithLocalizedMeridiem) : "";
2559
+ return "".concat(date, " ").concat(localizedMonth, ", ").concat(year, " ").concat(timetoShow, " ");
2560
+ } else {
2561
+ if (disableMeridiem) {
2562
+ return "".concat(localizedMonth, " ").concat(date, ", ").concat(year);
2563
+ } else if (isTimeFirst) {
2564
+ return "".concat(timeWithLocalizedMeridiem, ", ").concat(date, " ").concat(localizedMonth, " ").concat(year);
2565
+ } else {
2566
+ timetoShow = showTime ? ", ".concat(timeWithLocalizedMeridiem) : "";
2567
+ return "".concat(date, " ").concat(localizedMonth, ", ").concat(year).concat(timetoShow);
2568
+ }
2569
+ }
2570
+ };
2571
+ function formatter(value, unit, suffix, date, config) {
2572
+ var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
2573
+ // unit here refers to seconds, minute, minutes,...
2574
+
2575
+ var localizedSuffix = get_1(config, ["localizedPublishTime", suffix]) || suffix;
2576
+ var localizedUnitOfTime;
2577
+
2578
+ if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
2579
+ return timestampToFormat(value, unit, suffix, date, config);
2580
+ } else if (value > 1) {
2581
+ localizedUnitOfTime = get_1(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
2582
+ return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
2583
+ }
2584
+
2585
+ localizedUnitOfTime = get_1(config, ["localizedPublishTime", unit]) || unit;
2586
+ return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
2587
+ }
2588
+
2589
+ function formatAMPM(timestamp) {
2590
+ var timeFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "12hours";
2591
+ var dateTime = new Date(timestamp);
2592
+ var hours = dateTime.getHours();
2593
+ var minutes = dateTime.getMinutes();
2594
+ var ampm = hours >= 12 ? "pm" : "am";
2595
+ hours = hours % 12;
2596
+ hours = hours || 12;
2597
+ minutes = minutes < 10 ? "0" + minutes : minutes;
2598
+ var strTime = hours + ":" + minutes + " " + ampm;
2599
+
2600
+ if (timeFormat === "24hours") {
2601
+ return dateTime.toLocaleTimeString([], {
2602
+ hour: "2-digit",
2603
+ minute: "2-digit"
2604
+ });
2605
+ }
2606
+
2607
+ return strTime;
2608
+ }
2609
+
2610
+ var hexToRGB = function hexToRGB(hex) {
2611
+ var r = parseInt(hex.slice(1, 3), 16);
2612
+ var g = parseInt(hex.slice(3, 5), 16);
2613
+ var b = parseInt(hex.slice(5, 7), 16);
2614
+ return {
2615
+ r: r,
2616
+ g: g,
2617
+ b: b
2618
+ };
2619
+ };
2620
+ var getLuminanceOfColor = function getLuminanceOfColor(hex) {
2621
+ var _hexToRGB = hexToRGB(hex),
2622
+ r = _hexToRGB.r,
2623
+ g = _hexToRGB.g,
2624
+ b = _hexToRGB.b;
2625
+
2626
+ return r * 0.299 + g * 0.587 + b * 0.114;
2627
+ };
2628
+ var rgbToHex = function rgbToHex() {
2629
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
2630
+ var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
2631
+ return rgba && rgba.length === 4 ? "#" + ("0" + parseInt(rgba[1], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[2], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[3], 10).toString(16)).slice(-2) : color;
2632
+ };
2633
+ var clientWidths = {
2634
+ mobile: 767,
2635
+ tablet: 1024
2636
+ };
2637
+ var clientWidth = function clientWidth(device) {
2638
+ var foundDeviceWidth = get_1(clientWidths, device);
2639
+
2640
+ if (foundDeviceWidth) {
2641
+ return get_1(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
2642
+ }
2643
+
2644
+ return false;
2645
+ };
2646
+ var getTextColor = function getTextColor() {
2647
+ var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
2648
+ var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
2649
+ var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
2650
+ var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
2651
+ return textColor;
2652
+ };
2653
+ var getSlug = function getSlug(collection) {
2654
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2655
+ var _config$magazineSlug = config.magazineSlug,
2656
+ magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug,
2657
+ _config$isArchivePage = config.isArchivePage,
2658
+ isArchivePage = _config$isArchivePage === void 0 ? false : _config$isArchivePage;
2659
+
2660
+ if (isArchivePage) {
2661
+ return "/magazine/archive/".concat(magazineSlug);
2662
+ }
2663
+
2664
+ if (magazineSlug) {
2665
+ return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
2666
+ }
2667
+
2668
+ var isSection = collection.template === "section";
2669
+
2670
+ if (isSection) {
2671
+ var sectionId = get_1(collection, ["metadata", "section", "0", "id"], "");
2672
+ var sections = config.sections;
2673
+ var section = sections && sections.find(function (section) {
2674
+ return section.id === sectionId;
2675
+ });
2676
+ return section ? section["section-url"] : "/";
2677
+ }
2678
+
2679
+ return "/collection/".concat(collection.slug);
2680
+ };
2681
+ function isExternalStory() {
2682
+ var story = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2683
+ var _story$storyTemplate = story["story-template"],
2684
+ storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
2685
+ _story$metadata = story.metadata,
2686
+ metadata = _story$metadata === void 0 ? {} : _story$metadata;
2687
+ return storyTemplate === "news-elsewhere" ? get_1(metadata, ["reference-url"], "") : "";
2688
+ } // Adds target='_blank' attribute to anchor tags if not present
2689
+ var isEmpty = function isEmpty(value) {
2690
+ return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
2691
+ _typeof(value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
2692
+ };
2693
+ PropTypes.shape({
2694
+ "sketches-host": PropTypes.string,
2695
+ "cdn-name": PropTypes.string,
2696
+ "cdn-image": PropTypes.string
2697
+ });
2698
+ PropTypes.shape({
2699
+ headline: PropTypes.string,
2700
+ "last-published-at": PropTypes.number,
2701
+ subheadline: PropTypes.string
2702
+ });
2703
+ var getStoryUrl = function getStoryUrl(story) {
2704
+ var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2705
+ return get_1(story, ["story-template"]) === "news-elsewhere" ? get_1(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
2706
+ };
2707
+ var navigateTo = function navigateTo(dispatch) {
2708
+ var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
2709
+ global.app.navigateToPage(dispatch, url);
2710
+ };
2711
+ var generateNavigateSlug = function generateNavigateSlug() {
2712
+ var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2713
+ var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2714
+ var customUrlPath = arguments.length > 2 ? arguments[2] : undefined;
2715
+
2716
+ if (customUrlPath) {
2717
+ return customUrlPath;
2718
+ }
2719
+
2720
+ var _config$magazineSlug2 = config.magazineSlug,
2721
+ magazineSlug = _config$magazineSlug2 === void 0 ? "" : _config$magazineSlug2,
2722
+ _config$isArchivePage2 = config.isArchivePage,
2723
+ isArchivePage = _config$isArchivePage2 === void 0 ? false : _config$isArchivePage2;
2724
+
2725
+ if (isArchivePage) {
2726
+ return "/magazine/archive/".concat(magazineSlug);
2727
+ }
2728
+
2729
+ if (magazineSlug) {
2730
+ return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
2731
+ }
2732
+
2733
+ if (collection) {
2734
+ return getSlug(collection, config);
2735
+ }
2736
+
2737
+ return "/";
2738
+ };
2739
+ var getTimeStamp = function getTimeStamp(date, _formatter) {
2740
+ var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
2741
+ var template = arguments.length > 3 ? arguments[3] : undefined;
2742
+ var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
2743
+
2744
+ if (timezone && template === "story") {
2745
+ var zonedTime = timezone && utcToZonedTime(date, timezone);
2746
+ var formatZonedTime = zonedTime && format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
2747
+ timeZone: timezone
2748
+ });
2749
+ var timeStamp = timestampToFormat("", "", "", date, config);
2750
+ return /*#__PURE__*/React.createElement("time", {
2751
+ dateTime: formatZonedTime
2752
+ }, timeStamp);
2753
+ }
2754
+
2755
+ return /*#__PURE__*/React.createElement(Timeago, {
2756
+ date: date,
2757
+ formatter: function formatter(value, unit, suffix, date) {
2758
+ return _formatter(value, unit, suffix, date, config);
2759
+ }
2760
+ });
2761
+ };
2762
+
2763
+ var _styleModuleImportMap$e = {
2764
+ "./collection-name.m.css": {
2765
+ "collection": "collection-name-m_collection__JD6sx",
2766
+ "collection-borderLeft": "collection-name-m_collection-borderLeft__3Dznk",
2767
+ "border-left": "collection-name-m_border-left__3_pYw",
2768
+ "collection-borderBottomFull": "collection-name-m_collection-borderBottomFull__Dkq3K",
2769
+ "collection-borderBottom": "collection-name-m_collection-borderBottom__2rdQM",
2770
+ "collection-crossLine": "collection-name-m_collection-crossLine__1sIpN",
2771
+ "border-bottom": "collection-name-m_border-bottom__1MnlV",
2772
+ "dark": "collection-name-m_dark__nMe5H",
2773
+ "light": "collection-name-m_light__1vFDN"
2774
+ }
2775
+ };
2776
+ var CollectionNameBase = function CollectionNameBase(_ref) {
2777
+ var _ref$collectionNameBo = _ref.collectionNameBorderColor,
2778
+ collectionNameBorderColor = _ref$collectionNameBo === void 0 ? "" : _ref$collectionNameBo,
2779
+ collection = _ref.collection,
2780
+ config = _ref.config,
2781
+ collectionNameTemplate = _ref.collectionNameTemplate,
2782
+ headerLevel = _ref.headerLevel,
2783
+ _ref$customCollection = _ref.customCollectionName,
2784
+ customCollectionName = _ref$customCollection === void 0 ? "" : _ref$customCollection,
2785
+ _ref$navigate = _ref.navigate,
2786
+ navigate = _ref$navigate === void 0 ? true : _ref$navigate;
2787
+ var collectionTitle = useStateValue() || {};
2788
+ var showRowTitle = get_1(collectionTitle, ["showRowTitle"], true);
2789
+ var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
2790
+ var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
2791
+ var slug = navigate && collection && getSlug(collection, config) || "";
2792
+ var collectionName = customCollectionName || collection.name || "";
2793
+ var textColor = getTextColor(collectionTitle.theme);
2794
+ var HeaderTag = "h" + headerLevel;
2795
+ var CollectionNameBorderColor = rgbToHex(collectionNameBorderColor);
2796
+ var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
2797
+
2798
+ var borderBottomStyle = function borderBottomStyle() {
2799
+ return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React.createElement("div", {
2800
+ className: "collection-name-m_border-bottom__1MnlV",
2801
+ style: {
2802
+ borderBottom: "4px solid ".concat(CollectionNameBorderColor)
2803
+ }
2804
+ }) : "";
2805
+ };
2806
+
2807
+ var isMobile = clientWidth("mobile");
2808
+
2809
+ var getBorderHeight = function getBorderHeight() {
2810
+ if (isMobile) {
2811
+ switch (headerLevel) {
2812
+ case "1":
2813
+ return "32px";
2814
+
2815
+ case "2":
2816
+ return "24px";
2817
+
2818
+ case "3":
2819
+ return "20px";
2820
+
2821
+ case "4":
2822
+ return "18px";
2823
+
2824
+ case "5":
2825
+ return "16px";
2826
+
2827
+ case "6":
2828
+ return "16px";
2829
+
2830
+ default:
2831
+ return "20px";
2832
+ }
2833
+ }
2834
+
2835
+ switch (headerLevel) {
2836
+ case "1":
2837
+ return "40px";
2838
+
2839
+ case "2":
2840
+ return "32px";
2841
+
2842
+ case "3":
2843
+ return "24px";
2844
+
2845
+ case "4":
2846
+ return "20px";
2847
+
2848
+ case "5":
2849
+ return "18px";
2850
+
2851
+ case "6":
2852
+ return "16px";
2853
+
2854
+ default:
2855
+ return "24px";
2856
+ }
2857
+ };
2858
+
2859
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React.createElement("div", {
2860
+ style: {
2861
+ borderBottom: borderBottomFullStyle
2862
+ },
2863
+ "data-test-id": "collection-name",
2864
+ className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$e)
2865
+ }, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React.createElement("span", {
2866
+ className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
2867
+ style: {
2868
+ color: CollectionNameBorderColor,
2869
+ fontSize: getBorderHeight()
2870
+ }
2871
+ }), slug && !slug.includes(undefined) ? /*#__PURE__*/React.createElement(Link, {
2872
+ href: slug,
2873
+ "aria-label": "collection-name"
2874
+ }, /*#__PURE__*/React.createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React.createElement(HeaderTag, null, collectionName), borderBottomStyle()));
2875
+ };
2876
+ CollectionNameBase.propTypes = {
2877
+ /** Collection name border color */
2878
+ collectionNameBorderColor: PropTypes$1.string,
2879
+
2880
+ /** The Collection Object from the API response */
2881
+ collection: PropTypes$1.object,
2882
+
2883
+ /** The publisher config from the API response */
2884
+ config: PropTypes$1.object,
2885
+
2886
+ /** The style template for the component */
2887
+ collectionNameTemplate: PropTypes$1.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
2888
+
2889
+ /** Header tags ranging h1-h6, where h[headerLevel] */
2890
+ headerLevel: PropTypes$1.string,
2891
+ customCollectionName: PropTypes$1.string,
2892
+ navigate: PropTypes$1.bool
2893
+ };
2894
+ CollectionNameBase.defaultProps = {
2895
+ collectionNameTemplate: "",
2896
+ headerLevel: "3"
2897
+ };
2898
+
2899
+ function mapStateToProps$1(state) {
2900
+ return {
2901
+ config: get_1(state, ["qt", "config"], {})
2902
+ };
2903
+ }
2904
+
2905
+ var CollectionName = connect(mapStateToProps$1)(CollectionNameBase);
2906
+
2907
+ var _styleModuleImportMap$d = {
2908
+ "./load-more.m.css": {
2909
+ "button": "load-more-m_button__1mmf1",
2910
+ "default": "load-more-m_default__2_k4V",
2911
+ "dark": "load-more-m_dark__3dfzb",
2912
+ "light": "load-more-m_light__ePZQI"
2913
+ }
2914
+ };
2915
+
2916
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2917
+
2918
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2919
+ var LoadmoreButton = function LoadmoreButton(_ref) {
2920
+ var _ref$config = _ref.config,
2921
+ config = _ref$config === void 0 ? {} : _ref$config,
2922
+ collection = _ref.collection,
2923
+ _ref$template = _ref.template,
2924
+ template = _ref$template === void 0 ? "SubsequentLoadCount" : _ref$template,
2925
+ onClick = _ref.onClick,
2926
+ navigate = _ref.navigate,
2927
+ qtConfig = _ref.qtConfig;
2928
+ var _config$showButton = config.showButton,
2929
+ showButton = _config$showButton === void 0 ? true : _config$showButton,
2930
+ _config$buttonText = config.buttonText,
2931
+ buttonText = _config$buttonText === void 0 ? "Read More" : _config$buttonText,
2932
+ _config$theme = config.theme,
2933
+ theme = _config$theme === void 0 ? "" : _config$theme,
2934
+ _config$customUrlPath = config.customUrlPath,
2935
+ customUrlPath = _config$customUrlPath === void 0 ? "" : _config$customUrlPath;
2936
+ if (!showButton) return null;
2937
+ var textColor = getTextColor(theme);
2938
+ var slug = customUrlPath ? "/".concat(customUrlPath) : generateNavigateSlug(collection, _objectSpread$1(_objectSpread$1({}, qtConfig), config));
2939
+ return template === "SubsequentLoadCount" ? /*#__PURE__*/React.createElement("div", {
2940
+ onClick: onClick,
2941
+ "data-test-id": "load-more",
2942
+ className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap$d)
2943
+ }, buttonText) : /*#__PURE__*/React.createElement(LinkBase, {
2944
+ href: slug,
2945
+ navigateTo: navigate,
2946
+ "data-test-id": "load-more",
2947
+ "aria-label": "load-more"
2948
+ }, /*#__PURE__*/React.createElement("div", {
2949
+ className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap$d)
2950
+ }, buttonText));
2951
+ };
2952
+ LoadmoreButton.propTypes = {
2953
+ collection: PropTypes.object,
2954
+ template: PropTypes.string,
2955
+ config: PropTypes.object,
2956
+ onClick: PropTypes.func,
2957
+ navigate: PropTypes.func,
2958
+ qtConfig: PropTypes.object
2959
+ };
2960
+
2961
+ var CrownIcon = function CrownIcon(_ref) {
2962
+ var height = _ref.height,
2963
+ width = _ref.width,
2964
+ _ref$color = _ref.color,
2965
+ color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
2966
+ positionTop = _ref.positionTop;
2967
+ return /*#__PURE__*/React.createElement("svg", {
2968
+ xmlns: "http://www.w3.org/2000/svg",
2969
+ width: width,
2970
+ height: height,
2971
+ viewBox: "0 0 40 40",
2972
+ style: {
2973
+ position: "relative",
2974
+ top: positionTop
2975
+ }
2976
+ }, /*#__PURE__*/React.createElement("g", {
2977
+ fill: "none",
2978
+ fillRule: "evenodd",
2979
+ stroke: "none",
2980
+ strokeWidth: "1"
2981
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
2982
+ transform: "translate(8 8)"
2983
+ }, /*#__PURE__*/React.createElement("path", {
2984
+ d: "M0 0H24V24H0z"
2985
+ }), /*#__PURE__*/React.createElement("g", {
2986
+ fill: color,
2987
+ fillRule: "nonzero",
2988
+ transform: "translate(0 2)"
2989
+ }, /*#__PURE__*/React.createElement("path", {
2990
+ 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"
2991
+ }))))));
2992
+ };
2993
+ CrownIcon.propTypes = {
2994
+ height: PropTypes.string,
2995
+ width: PropTypes.string,
2996
+ color: PropTypes.string,
2997
+ positionTop: PropTypes.string
2998
+ };
2999
+
3000
+ var KeyIcon = function KeyIcon(_ref) {
3001
+ var height = _ref.height,
3002
+ width = _ref.width,
3003
+ _ref$color = _ref.color,
3004
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3005
+ positionTop = _ref.positionTop;
3006
+ return /*#__PURE__*/React.createElement("svg", {
3007
+ xmlns: "http://www.w3.org/2000/svg",
3008
+ width: width,
3009
+ height: height,
3010
+ viewBox: "0 0 40 40",
3011
+ style: {
3012
+ position: "relative",
3013
+ top: positionTop
3014
+ }
3015
+ }, /*#__PURE__*/React.createElement("g", {
3016
+ fill: "none",
3017
+ fillRule: "evenodd",
3018
+ stroke: "none",
3019
+ strokeWidth: "1"
3020
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
3021
+ transform: "translate(8 8)"
3022
+ }, /*#__PURE__*/React.createElement("path", {
3023
+ d: "M0 0H24V24H0z"
3024
+ }), /*#__PURE__*/React.createElement("path", {
3025
+ fill: color,
3026
+ fillRule: "nonzero",
3027
+ 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",
3028
+ transform: "translate(0 5)"
3029
+ })))));
3030
+ };
3031
+ KeyIcon.propTypes = {
3032
+ height: PropTypes.string,
3033
+ width: PropTypes.string,
3034
+ color: PropTypes.string,
3035
+ positionTop: PropTypes.string
3036
+ };
3037
+
3038
+ var LockIcon = function LockIcon(_ref) {
3039
+ var height = _ref.height,
3040
+ width = _ref.width,
3041
+ _ref$color = _ref.color,
3042
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3043
+ positionTop = _ref.positionTop;
3044
+ return /*#__PURE__*/React.createElement("svg", {
3045
+ xmlns: "http://www.w3.org/2000/svg",
3046
+ width: width,
3047
+ height: height,
3048
+ viewBox: "0 0 40 40",
3049
+ style: {
3050
+ position: "relative",
3051
+ top: positionTop
3052
+ }
3053
+ }, /*#__PURE__*/React.createElement("g", {
3054
+ fill: "none",
3055
+ fillRule: "evenodd",
3056
+ stroke: "none",
3057
+ strokeWidth: "1"
3058
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
3059
+ transform: "translate(8 8)"
3060
+ }, /*#__PURE__*/React.createElement("path", {
3061
+ d: "M0 0H24V24H0z"
3062
+ }), /*#__PURE__*/React.createElement("g", {
3063
+ fill: color,
3064
+ fillRule: "nonzero",
3065
+ transform: "translate(3)"
3066
+ }, /*#__PURE__*/React.createElement("path", {
3067
+ 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"
3068
+ }))))));
3069
+ };
3070
+ LockIcon.propTypes = {
3071
+ height: PropTypes.string,
3072
+ width: PropTypes.string,
3073
+ color: PropTypes.string,
3074
+ positionTop: PropTypes.string
3075
+ };
3076
+
3077
+ var StarIcon = function StarIcon(_ref) {
3078
+ var width = _ref.width,
3079
+ height = _ref.height,
3080
+ _ref$color = _ref.color,
3081
+ color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
3082
+ _ref$positionTop = _ref.positionTop,
3083
+ positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
3084
+ return /*#__PURE__*/React.createElement("svg", {
3085
+ xmlns: "http://www.w3.org/2000/svg",
3086
+ width: width,
3087
+ height: height,
3088
+ viewBox: "0 0 40 40",
3089
+ style: {
3090
+ position: "relative",
3091
+ top: positionTop
3092
+ }
3093
+ }, /*#__PURE__*/React.createElement("g", {
3094
+ fill: "none",
3095
+ fillRule: "evenodd",
3096
+ stroke: "none",
3097
+ strokeWidth: "1"
3098
+ }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
3099
+ fill: color,
3100
+ 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"
3101
+ }))));
3102
+ };
3103
+ StarIcon.propTypes = {
3104
+ height: PropTypes.string,
3105
+ width: PropTypes.string,
3106
+ color: PropTypes.string,
3107
+ positionTop: PropTypes.string
3108
+ };
3109
+
3110
+ var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
3111
+ var width = _ref.width,
3112
+ height = _ref.height,
3113
+ color = _ref.color,
3114
+ iconType = _ref.iconType,
3115
+ positionTop = _ref.positionTop;
3116
+
3117
+ switch (iconType) {
3118
+ case "crown":
3119
+ return /*#__PURE__*/React.createElement(CrownIcon, {
3120
+ width: width,
3121
+ height: height,
3122
+ color: color,
3123
+ positionTop: positionTop
3124
+ });
3125
+
3126
+ case "lock":
3127
+ return /*#__PURE__*/React.createElement(LockIcon, {
3128
+ width: width,
3129
+ height: height,
3130
+ color: color,
3131
+ positionTop: positionTop
3132
+ });
3133
+
3134
+ case "key":
3135
+ return /*#__PURE__*/React.createElement(KeyIcon, {
3136
+ width: width,
3137
+ height: height,
3138
+ color: color,
3139
+ positionTop: positionTop
3140
+ });
3141
+
3142
+ default:
3143
+ return /*#__PURE__*/React.createElement(StarIcon, {
3144
+ width: width,
3145
+ height: height,
3146
+ color: color,
3147
+ positionTop: positionTop
3148
+ });
3149
+ }
3150
+ };
3151
+ PremiumStoryIcon.propTypes = {
3152
+ width: PropTypes.string,
3153
+ height: PropTypes.string,
3154
+ color: PropTypes.string,
3155
+ iconType: PropTypes.string,
3156
+ positionTop: PropTypes.string
3157
+ };
3158
+
3159
+ function LiveIcon() {
3160
+ return /*#__PURE__*/React.createElement("svg", {
3161
+ className: "live-icon",
3162
+ xmlns: "http://www.w3.org/2000/svg",
3163
+ width: "25",
3164
+ height: "24",
3165
+ viewBox: "0 0 25 24"
3166
+ }, /*#__PURE__*/React.createElement("path", {
3167
+ fill: "#ff5858",
3168
+ 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"
3169
+ }));
3170
+ }
3171
+
3172
+ var _styleModuleImportMap$c = {
3173
+ "./headline.m.css": {
3174
+ "wrapper": "headline-m_wrapper__3nUmh",
3175
+ "headline": "headline-m_headline__3_NhV",
3176
+ "dark": "headline-m_dark__en3hW",
3177
+ "light": "headline-m_light__3lKJB"
3178
+ }
3179
+ };
3180
+ var Headline = function Headline(_ref) {
3181
+ var story = _ref.story,
3182
+ headerLevel = _ref.headerLevel,
3183
+ _ref$premiumStoryIcon = _ref.premiumStoryIconConfig,
3184
+ premiumStoryIconConfig = _ref$premiumStoryIcon === void 0 ? {} : _ref$premiumStoryIcon,
3185
+ isLink = _ref.isLink;
3186
+ var configData = useStateValue() || {};
3187
+ var _premiumStoryIconConf = premiumStoryIconConfig.iconColor,
3188
+ iconColor = _premiumStoryIconConf === void 0 ? "#F7B500" : _premiumStoryIconConf,
3189
+ _premiumStoryIconConf2 = premiumStoryIconConfig.iconStyle,
3190
+ iconStyle = _premiumStoryIconConf2 === void 0 ? "star" : _premiumStoryIconConf2,
3191
+ _premiumStoryIconConf3 = premiumStoryIconConfig.enablePremiumStoryIcon,
3192
+ enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
3193
+ _premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
3194
+ showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
3195
+ var alternateHeadline = get_1(story, ["alternative", "home", "default", "headline"]);
3196
+ var premiumStory = enablePremiumStoryIcon && get_1(story, ["access"]) === "subscription";
3197
+ var headline = alternateHeadline || story.headline;
3198
+ var HeaderTag = "h" + headerLevel;
3199
+
3200
+ var positionHeadline = function positionHeadline() {
3201
+ switch (parseInt(headerLevel)) {
3202
+ case 1:
3203
+ return "-2px";
3204
+
3205
+ case 2:
3206
+ return "2px";
3207
+
3208
+ case 3:
3209
+ return "4px";
3210
+
3211
+ case 4:
3212
+ return "5px";
3213
+
3214
+ default:
3215
+ return "6px";
3216
+ }
3217
+ };
3218
+
3219
+ var textColor = getTextColor(configData.theme);
3220
+ var wrapperClass = premiumStory ? "wrapper" : "";
3221
+ var iconSize = "24px";
3222
+ var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !get_1(story, ["metadata", "is-closed"], false);
3223
+ return /*#__PURE__*/React.createElement("div", {
3224
+ "data-test-id": "headline",
3225
+ className: "arrow-component arr--headline " + _getClassName(wrapperClass, _styleModuleImportMap$c)
3226
+ }, premiumStory && /*#__PURE__*/React.createElement(PremiumStoryIcon, {
3227
+ width: iconSize,
3228
+ height: iconSize,
3229
+ color: iconColor,
3230
+ iconType: iconStyle,
3231
+ positionTop: positionHeadline()
3232
+ }), isLink ? /*#__PURE__*/React.createElement(Link, {
3233
+ href: getStoryUrl(story, "/".concat(story.slug)),
3234
+ externalLink: isExternalStory(story),
3235
+ "aria-label": "headline"
3236
+ }, /*#__PURE__*/React.createElement(HeaderTag, {
3237
+ className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$c)
3238
+ }, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline)) : /*#__PURE__*/React.createElement(HeaderTag, {
3239
+ className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$c)
3240
+ }, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline));
3241
+ };
3242
+ Headline.propTypes = {
3243
+ /** The Story Object from the API response */
3244
+ story: PropTypes.object.isRequired,
3245
+
3246
+ /** Header tags ranging h1-h6, where h[headerLevel] */
3247
+ headerLevel: PropTypes.string,
3248
+ premiumStoryIconConfig: PropTypes.shape({
3249
+ iconColor: PropTypes.string,
3250
+ iconType: PropTypes.string,
3251
+ enablePremiumStoryIcon: PropTypes.bool
3252
+ }),
3253
+ isLink: PropTypes.bool
3254
+ };
3255
+ Headline.defaultProps = {
3256
+ headerLevel: "6",
3257
+ isLink: true
3258
+ };
3259
+
3260
+ var _styleModuleImportMap$b = {
3261
+ "./subheadline.m.css": {
3262
+ "subheadline": "subheadline-m_subheadline__3fd7z",
3263
+ "dark": "subheadline-m_dark__28u00",
3264
+ "light": "subheadline-m_light__2YUOe"
3265
+ }
3266
+ };
3267
+ var Subheadline = function Subheadline(_ref) {
3268
+ var story = _ref.story,
3269
+ _ref$truncateChars = _ref.truncateChars,
3270
+ truncateChars = _ref$truncateChars === void 0 ? 200 : _ref$truncateChars,
3271
+ lineClamp = _ref.lineClamp,
3272
+ _ref$clazzName = _ref.clazzName,
3273
+ clazzName = _ref$clazzName === void 0 ? "" : _ref$clazzName,
3274
+ forceShowAtom = _ref.forceShowAtom,
3275
+ showFullContent = _ref.showFullContent;
3276
+ var config = useStateValue() || {};
3277
+ var subheadline = forceShowAtom || get_1(config, ["showSubheadline"], true);
3278
+ if (!subheadline) return null;
3279
+ var textColor = getTextColor(config.theme);
3280
+ return /*#__PURE__*/React.createElement("div", {
3281
+ style: {
3282
+ WebkitLineClamp: lineClamp
3283
+ },
3284
+ "data-test-id": "subheadline",
3285
+ className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName("subheadline ".concat(textColor), _styleModuleImportMap$b)
3286
+ }, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
3287
+ };
3288
+ Subheadline.propTypes = {
3289
+ /** The Story Object from the API response */
3290
+ story: PropTypes.object.isRequired,
3291
+ // Restricts the number of lines for subheadline.
3292
+ lineClamp: PropTypes.number,
3293
+
3294
+ /** Number of characters to truncate the subheadline */
3295
+ truncateChars: PropTypes.number,
3296
+ clazzName: PropTypes.string,
3297
+ forceShowAtom: PropTypes.bool,
3298
+ showFullContent: PropTypes.bool
3299
+ };
3300
+ Subheadline.defaultProps = {
3301
+ forceShowAtom: false,
3302
+ showFullContent: false
3303
+ };
3304
+
3305
+ var _styleModuleImportMap$a = {
3306
+ "./timestamp.m.css": {
3307
+ "time": "timestamp-m_time__2v46i",
3308
+ "time-wrapper": "timestamp-m_time-wrapper__3O2lM",
3309
+ "bottom-fix": "timestamp-m_bottom-fix__1Zh8r",
3310
+ "dark": "timestamp-m_dark__2lk9E",
3311
+ "light": "timestamp-m_light__2QlrI"
3312
+ }
3313
+ };
3314
+ var TimeStamp = function TimeStamp(_ref) {
3315
+ var story = _ref.story,
3316
+ isBottom = _ref.isBottom,
3317
+ _ref$config = _ref.config,
3318
+ config = _ref$config === void 0 ? {} : _ref$config;
3319
+ var configState = useStateValue() || {};
3320
+ var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
3321
+ var time = story["last-published-at"] || story["first-published-at"];
3322
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
3323
+ var textColor = getTextColor(configState.theme);
3324
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isTime && /*#__PURE__*/React.createElement("div", {
3325
+ "data-test-id": "publish-time",
3326
+ className: "time arr--publish-time " + _getClassName("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$a)
3327
+ }, /*#__PURE__*/React.createElement("div", {
3328
+ className: "timestamp-m_time-wrapper__3O2lM"
3329
+ }, getTimeStamp(time, formatter, config))));
3330
+ };
3331
+ TimeStamp.propTypes = {
3332
+ /** The Story Object from the API response */
3333
+ story: PropTypes.object,
3334
+ isBottom: PropTypes.bool,
3335
+ config: PropTypes.object
3336
+ };
3337
+
3338
+ var _styleModuleImportMap$9 = {
3339
+ "./author.m.css": {
3340
+ "author": "author-m_author__WRuLm",
3341
+ "author-image": "author-m_author-image__3q2oc",
3342
+ "author-name": "author-m_author-name__3WP-O",
3343
+ "bottom-fix": "author-m_bottom-fix__223TT",
3344
+ "prefix": "author-m_prefix__YSInK",
3345
+ "rtl-image": "author-m_rtl-image__2nglD",
3346
+ "ltr-image": "author-m_ltr-image__3bc0L",
3347
+ "dark": "author-m_dark__2TTlp",
3348
+ "light": "author-m_light__3y8_x"
3349
+ }
3350
+ };
3351
+
3352
+ var AuthorBase = function AuthorBase(_ref) {
3353
+ var story = _ref.story,
3354
+ hideAuthorImage = _ref.hideAuthorImage,
3355
+ isBottom = _ref.isBottom,
3356
+ _ref$prefix = _ref.prefix,
3357
+ prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
3358
+ _ref$config = _ref.config,
3359
+ config = _ref$config === void 0 ? {} : _ref$config;
3360
+ var configData = useStateValue() || {};
3361
+ var isAuthor = get_1(configData, ["showAuthor"], true);
3362
+
3363
+ var _get = get_1(story, ["authors", "0"], ""),
3364
+ avatarUrl = _get["avatar-url"],
3365
+ avatarS3Key = _get["avatar-s3-key"],
3366
+ authorName = _get.name,
3367
+ slug = _get.slug;
3368
+
3369
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
3370
+ var textColor = getTextColor(configData.theme);
3371
+ var mountAt = get_1(config, ["mountAt"], "");
3372
+
3373
+ var authorImage = function authorImage(dir) {
3374
+ if (!avatarUrl && !avatarS3Key) {
3375
+ return null;
3376
+ }
3377
+
3378
+ return /*#__PURE__*/React.createElement("div", {
3379
+ "data-test-id": "author-image",
3380
+ className: _getClassName("author-image ".concat(dir, "-image"), _styleModuleImportMap$9)
3381
+ }, /*#__PURE__*/React.createElement("figure", null, avatarS3Key ? /*#__PURE__*/React.createElement(ResponsiveImage, {
3382
+ slug: avatarS3Key,
3383
+ "aspect-ratio": [1, 1],
3384
+ defaultWidth: 400,
3385
+ imgParams: {
3386
+ auto: ["format", "compress"]
3387
+ },
3388
+ alt: authorName
3389
+ }) : /*#__PURE__*/React.createElement("img", {
3390
+ src: avatarUrl
3391
+ })));
3392
+ };
3393
+
3394
+ var isPrefix = function isPrefix(dir) {
3395
+ if (prefix) {
3396
+ return /*#__PURE__*/React.createElement("div", {
3397
+ className: "arr-author-prefix " + _getClassName("prefix ".concat(textColor), _styleModuleImportMap$9)
3398
+ }, prefix);
3399
+ }
3400
+
3401
+ return !hideAuthorImage && authorImage(dir);
3402
+ };
3403
+
3404
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement(Link, {
3405
+ href: "".concat(mountAt, "/author/") + slug,
3406
+ "aria-label": "author-name",
3407
+ className: "author-name arr-author-name arrow-component " + _getClassName("author ".concat(isBottomClasses), _styleModuleImportMap$9)
3408
+ }, isPrefix("ltr"), /*#__PURE__*/React.createElement("div", {
3409
+ "data-test-id": "author-name",
3410
+ className: "author-name " + _getClassName("author-name ".concat(textColor), _styleModuleImportMap$9)
3411
+ }, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
3412
+ };
3413
+
3414
+ function mapStateToProps(state) {
3415
+ return {
3416
+ config: get_1(state, ["qt", "config"], {})
3417
+ };
3418
+ }
3419
+
3420
+ var Author = connect(mapStateToProps)(AuthorBase);
3421
+ AuthorBase.propTypes = {
3422
+ /** The Story Object from the API response */
3423
+ story: PropTypes.object.isRequired,
3424
+
3425
+ /** Hide Author Avatar Image */
3426
+ hideAuthorImage: PropTypes.bool,
3427
+ // fix Author bottom of the storyCard
3428
+ isBottom: PropTypes.bool,
3429
+ // fix prefix before the author name
3430
+ prefix: PropTypes.string,
3431
+ config: PropTypes.object
3432
+ };
3433
+ AuthorBase.defaultProps = {
3434
+ hideAuthorImage: false,
3435
+ isBottom: false,
3436
+ prefix: ""
3437
+ };
3438
+
3439
+ var _styleModuleImportMap$8 = {
3440
+ "./dot.m.css": {
3441
+ "dark": "dot-m_dark__1Njxl",
3442
+ "light": "dot-m_light__27IA3"
3443
+ }
3444
+ };
3445
+ var Dot = function Dot(_ref) {
3446
+ var _ref$width = _ref.width,
3447
+ width = _ref$width === void 0 ? "3px" : _ref$width,
3448
+ _ref$height = _ref.height,
3449
+ height = _ref$height === void 0 ? "3px" : _ref$height,
3450
+ _ref$color = _ref.color,
3451
+ color = _ref$color === void 0 ? "light" : _ref$color;
3452
+ return /*#__PURE__*/React.createElement("div", {
3453
+ className: _getClassName(color, _styleModuleImportMap$8)
3454
+ }, /*#__PURE__*/React.createElement("svg", {
3455
+ xmlns: "http://www.w3.org/2000/svg",
3456
+ width: width,
3457
+ height: height,
3458
+ viewBox: "0 0 3 3"
3459
+ }, /*#__PURE__*/React.createElement("circle", {
3460
+ cx: "87",
3461
+ cy: "9",
3462
+ r: "1",
3463
+ fill: "inherit",
3464
+ fillRule: "nonzero",
3465
+ transform: "translate(-86 -8)"
3466
+ })));
3467
+ };
3468
+ Dot.propTypes = {
3469
+ /** height , width and color of the dot icon */
3470
+ color: PropTypes.string,
3471
+ width: PropTypes.string,
3472
+ height: PropTypes.string
3473
+ };
3474
+
3475
+ var _styleModuleImportMap$7 = {
3476
+ "./divider.m.css": {
3477
+ "dark": "divider-m_dark__26FRi",
3478
+ "light": "divider-m_light__w-7sy"
3479
+ }
3480
+ };
3481
+ var Divider = function Divider(_ref) {
3482
+ var _ref$width = _ref.width,
3483
+ width = _ref$width === void 0 ? "1" : _ref$width,
3484
+ _ref$height = _ref.height,
3485
+ height = _ref$height === void 0 ? "10" : _ref$height,
3486
+ _ref$color = _ref.color,
3487
+ color = _ref$color === void 0 ? "light" : _ref$color;
3488
+ return /*#__PURE__*/React.createElement("div", {
3489
+ className: _getClassName(color, _styleModuleImportMap$7)
3490
+ }, /*#__PURE__*/React.createElement("svg", {
3491
+ xmlns: "http://www.w3.org/2000/svg",
3492
+ width: width,
3493
+ height: height
3494
+ }, /*#__PURE__*/React.createElement("path", {
3495
+ fill: "inherit",
3496
+ d: "M0 0h1v10H0z"
3497
+ })));
3498
+ };
3499
+ Divider.propTypes = {
3500
+ /** height , width and color of the dot icon */
3501
+ color: PropTypes.string,
3502
+ width: PropTypes.string,
3503
+ height: PropTypes.string
3504
+ };
3505
+
3506
+ var _styleModuleImportMap$6 = {
3507
+ "./read-time.m.css": {
3508
+ "read-time-wrapper": "read-time-m_read-time-wrapper__3GyC_",
3509
+ "dot-indicator": "read-time-m_dot-indicator__3Sqh2",
3510
+ "dark": "read-time-m_dark__3yRaK",
3511
+ "light": "read-time-m_light__1GAZu"
3512
+ }
3513
+ };
3514
+ var ReadTime = function ReadTime(_ref) {
3515
+ var story = _ref.story,
3516
+ _ref$opts = _ref.opts,
3517
+ opts = _ref$opts === void 0 ? {} : _ref$opts,
3518
+ _ref$isLightTheme = _ref.isLightTheme,
3519
+ isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
3520
+ var config = useStateValue() || {};
3521
+ var showReadTime = get_1(config, ["showReadTime"]) || get_1(opts, ["showReadTime"], true);
3522
+ var readTime = get_1(story, ["read-time"], 0);
3523
+ var textColor = isLightTheme ? "light" : getTextColor(config.theme);
3524
+ if (!showReadTime || !readTime) return null;
3525
+ var timeToRead = get_1(opts, ["localizedTimeToRead"]) || "min read";
3526
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3527
+ "data-test-id": "read-time",
3528
+ className: "arrow-component arr--read-time " + _getClassName("read-time-wrapper ".concat(textColor), _styleModuleImportMap$6)
3529
+ }, /*#__PURE__*/React.createElement("span", {
3530
+ className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
3531
+ }, /*#__PURE__*/React.createElement(Dot, {
3532
+ color: textColor
3533
+ })), /*#__PURE__*/React.createElement("span", null, readTime, " ", timeToRead)));
3534
+ };
3535
+ ReadTime.propTypes = {
3536
+ story: PropTypes.shape({
3537
+ "read-time": PropTypes.number
3538
+ }),
3539
+ opts: PropTypes.shape({
3540
+ showReadTime: PropTypes.bool
3541
+ }),
3542
+ isLightTheme: PropTypes.bool
3543
+ };
3544
+
3545
+ var _styleModuleImportMap$5 = {
3546
+ "./author-with-timestamp.m.css": {
3547
+ "author-time-wrapper": "author-with-timestamp-m_author-time-wrapper__G7_eI",
3548
+ "author-image": "author-with-timestamp-m_author-image__24xrD",
3549
+ "dot": "author-with-timestamp-m_dot__1LHXD",
3550
+ "bottom-fix": "author-with-timestamp-m_bottom-fix__1rWGv",
3551
+ "dash": "author-with-timestamp-m_dash__2L5XC"
3552
+ }
3553
+ };
3554
+ var AuthorWithTime = function AuthorWithTime(_ref) {
3555
+ var story = _ref.story,
3556
+ separator = _ref.separator,
3557
+ isBottom = _ref.isBottom,
3558
+ hideAuthorImage = _ref.hideAuthorImage,
3559
+ prefix = _ref.prefix,
3560
+ _ref$config = _ref.config,
3561
+ config = _ref$config === void 0 ? {} : _ref$config,
3562
+ isLightTheme = _ref.isLightTheme;
3563
+ var configState = useStateValue() || {};
3564
+ var isAuthor = get_1(config, ["showAuthor"], get_1(configState, ["showAuthor"], true));
3565
+ var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
3566
+ var isReadTime = get_1(configState, ["showReadTime"], true);
3567
+ var isBottomClasses = isBottom ? "bottom-fix" : "";
3568
+ var seperatorStyle = separator === "dot" ? "dot" : "dash";
3569
+ var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
3570
+
3571
+ var getSeparator = function getSeparator() {
3572
+ if (separator === "divider") {
3573
+ return /*#__PURE__*/React.createElement(Divider, {
3574
+ color: textColor
3575
+ });
3576
+ }
3577
+
3578
+ return /*#__PURE__*/React.createElement(Dot, {
3579
+ color: textColor
3580
+ });
3581
+ };
3582
+
3583
+ var getTimeStamp = function getTimeStamp() {
3584
+ if (!isTime) return null;
3585
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement("span", {
3586
+ className: "arr-separator " + _getClassName("".concat(seperatorStyle), _styleModuleImportMap$5)
3587
+ }, getSeparator()), /*#__PURE__*/React.createElement(TimeStamp, {
3588
+ story: story,
3589
+ config: config
3590
+ }), isReadTime && /*#__PURE__*/React.createElement(ReadTime, {
3591
+ story: story,
3592
+ opts: config,
3593
+ isLightTheme: isLightTheme
3594
+ }));
3595
+ };
3596
+
3597
+ return /*#__PURE__*/React.createElement("div", {
3598
+ className: "arr--author-time " + _getClassName("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$5)
3599
+ }, isAuthor ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Author, {
3600
+ story: story,
3601
+ isBottom: true,
3602
+ hideAuthorImage: hideAuthorImage,
3603
+ prefix: prefix
3604
+ }), getTimeStamp()) : getTimeStamp());
3605
+ };
3606
+ AuthorWithTime.propTypes = {
3607
+ story: PropTypes.object,
3608
+
3609
+ /** Style of separator between the Author & Timestamp */
3610
+ separator: PropTypes.oneOf(["dot", "divider"]),
3611
+
3612
+ /** hide the author image */
3613
+ hideAuthorImage: PropTypes.bool,
3614
+ // fix author and time at the end
3615
+ isBottom: PropTypes.bool,
3616
+ // fix prefix before the author name
3617
+ prefix: PropTypes.string,
3618
+ config: PropTypes.object,
3619
+ isLightTheme: PropTypes.bool
3620
+ };
3621
+ AuthorWithTime.defaultProps = {
3622
+ separator: "dot",
3623
+ isBottom: false,
3624
+ hideAuthorImage: true,
3625
+ prefix: "",
3626
+ isLightTheme: false
3627
+ };
3628
+
3629
+ function _arrayWithHoles(arr) {
3630
+ if (Array.isArray(arr)) return arr;
3631
+ }
3632
+
3633
+ function _iterableToArrayLimit(arr, i) {
3634
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
3635
+
3636
+ if (_i == null) return;
3637
+ var _arr = [];
3638
+ var _n = true;
3639
+ var _d = false;
3640
+
3641
+ var _s, _e;
3642
+
3643
+ try {
3644
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
3645
+ _arr.push(_s.value);
3646
+
3647
+ if (i && _arr.length === i) break;
3648
+ }
3649
+ } catch (err) {
3650
+ _d = true;
3651
+ _e = err;
3652
+ } finally {
3653
+ try {
3654
+ if (!_n && _i["return"] != null) _i["return"]();
3655
+ } finally {
3656
+ if (_d) throw _e;
3657
+ }
3658
+ }
3659
+
3660
+ return _arr;
3661
+ }
3662
+
3663
+ function _arrayLikeToArray(arr, len) {
3664
+ if (len == null || len > arr.length) len = arr.length;
3665
+
3666
+ for (var i = 0, arr2 = new Array(len); i < len; i++) {
3667
+ arr2[i] = arr[i];
3668
+ }
3669
+
3670
+ return arr2;
3671
+ }
3672
+
3673
+ function _unsupportedIterableToArray(o, minLen) {
3674
+ if (!o) return;
3675
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
3676
+ var n = Object.prototype.toString.call(o).slice(8, -1);
3677
+ if (n === "Object" && o.constructor) n = o.constructor.name;
3678
+ if (n === "Map" || n === "Set") return Array.from(o);
3679
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
3680
+ }
3681
+
3682
+ function _nonIterableRest() {
3683
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3684
+ }
3685
+
3686
+ function _slicedToArray(arr, i) {
3687
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
3688
+ }
3689
+
3690
+ var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
3691
+ var _ref$width = _ref.width,
3692
+ width = _ref$width === void 0 ? 40 : _ref$width,
3693
+ _ref$height = _ref.height,
3694
+ height = _ref$height === void 0 ? 30 : _ref$height,
3695
+ _ref$iconColor = _ref.iconColor,
3696
+ iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
3697
+ return /*#__PURE__*/React.createElement("svg", {
3698
+ width: width,
3699
+ height: height,
3700
+ viewBox: "0 0 102 76",
3701
+ version: "1.1"
3702
+ }, /*#__PURE__*/React.createElement("g", {
3703
+ id: "demo-home-copy",
3704
+ stroke: "none",
3705
+ strokeWidth: "1",
3706
+ fill: "none",
3707
+ fillRule: "evenodd",
3708
+ transform: "translate(-377.000000, -314.000000)"
3709
+ }, /*#__PURE__*/React.createElement("g", {
3710
+ id: "Group-13",
3711
+ transform: "translate(377.000000, 314.000000)"
3712
+ }, /*#__PURE__*/React.createElement("path", {
3713
+ 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",
3714
+ id: "Combined-Shape",
3715
+ fill: iconColor,
3716
+ fillRule: "nonzero"
3717
+ }), /*#__PURE__*/React.createElement("rect", {
3718
+ id: "Rectangle-19",
3719
+ stroke: iconColor,
3720
+ strokeWidth: "3",
3721
+ x: "1.5",
3722
+ y: "1.5",
3723
+ width: "99",
3724
+ height: "73",
3725
+ rx: "3"
3726
+ }))));
3727
+ };
3728
+ ImageFallbackIcon.propTypes = {
3729
+ width: PropTypes.object,
3730
+ height: PropTypes.object,
3731
+ iconColor: PropTypes.object
3732
+ };
3733
+
3734
+ var imageFallback = function imageFallback() {
3735
+ return /*#__PURE__*/React.createElement("div", {
3736
+ className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
3737
+ }, /*#__PURE__*/React.createElement("figure", {
3738
+ className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
3739
+ }, /*#__PURE__*/React.createElement(ImageFallbackIcon, null)));
3740
+ };
3741
+
3742
+ var FallbackImage = function FallbackImage(_ref) {
3743
+ var slug = _ref.slug;
3744
+
3745
+ if (slug) {
3746
+ return /*#__PURE__*/React.createElement(Link, {
3747
+ href: slug,
3748
+ "aria-label": "image-fallback"
3749
+ }, imageFallback());
3750
+ } else {
3751
+ return imageFallback();
3752
+ }
3753
+ };
3754
+ FallbackImage.propTypes = {
3755
+ slug: PropTypes.string
3756
+ };
3757
+
3758
+ var HyperLinkIcon = function HyperLinkIcon() {
3759
+ return /*#__PURE__*/React.createElement("svg", {
3760
+ xmlns: "http://www.w3.org/2000/svg",
3761
+ width: "36",
3762
+ height: "28"
3763
+ }, /*#__PURE__*/React.createElement("g", {
3764
+ fill: "none",
3765
+ fillRule: "evenodd"
3766
+ }, /*#__PURE__*/React.createElement("rect", {
3767
+ width: "36",
3768
+ height: "28",
3769
+ fill: "#3D6FCF",
3770
+ rx: "4"
3771
+ }), /*#__PURE__*/React.createElement("path", {
3772
+ stroke: "#FFF",
3773
+ strokeLinecap: "round",
3774
+ strokeLinejoin: "round",
3775
+ strokeWidth: "2",
3776
+ d: "M22 14.667v4c0 .736-.597 1.333-1.333 1.333h-7.334A1.333 1.333 0 0112 18.667v-7.334c0-.736.597-1.333 1.333-1.333h4M20 8h4v4m-7.333 3.333L24 8"
3777
+ })));
3778
+ };
3779
+
3780
+ var HyperLink = function HyperLink(_ref) {
3781
+ var _ref$hyperLink = _ref.hyperLink,
3782
+ hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
3783
+ if (!hyperLink) return null;
3784
+ return /*#__PURE__*/React.createElement(Link, {
3785
+ href: hyperLink,
3786
+ "aria-label": "hyperlink-button",
3787
+ className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
3788
+ target: "_blank",
3789
+ rel: "noopener noreferrer"
3790
+ }, /*#__PURE__*/React.createElement(HyperLinkIcon, null));
3791
+ };
3792
+ HyperLink.propTypes = {
3793
+ hyperLink: PropTypes.string
3794
+ };
3795
+
3796
+ var _styleModuleImportMap$4 = {
3797
+ "./hero-image.m.css": {
3798
+ "hero-image": "hero-image-m_hero-image__3lraV",
3799
+ "right-padding": "hero-image-m_right-padding__1LkCe",
3800
+ "left-padding": "hero-image-m_left-padding__pYRAj",
3801
+ "right-padding-mob": "hero-image-m_right-padding-mob__3-uOU",
3802
+ "placeholder": "hero-image-m_placeholder__1omCm",
3803
+ "hero-image-mob": "hero-image-m_hero-image-mob__13JJp",
3804
+ "with-padding": "hero-image-m_with-padding__324G_",
3805
+ "image": "hero-image-m_image__1mz0U"
3806
+ }
3807
+ };
3808
+ var HeroImage = function HeroImage(_ref) {
3809
+ var story = _ref.story,
3810
+ FullBleed = _ref.FullBleed,
3811
+ aspectRatio = _ref.aspectRatio,
3812
+ defaultWidth = _ref.defaultWidth,
3813
+ widths = _ref.widths,
3814
+ isHorizontal = _ref.isHorizontal,
3815
+ isHorizontalMobile = _ref.isHorizontalMobile,
3816
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast,
3817
+ defaultFallback = _ref.defaultFallback,
3818
+ isStoryPageImage = _ref.isStoryPageImage,
3819
+ config = _ref.config;
3820
+
3821
+ var _ref2 = useStateValue() || {},
3822
+ _ref2$fallbackImageUr = _ref2.fallbackImageUrl,
3823
+ fallbackImageUrl = _ref2$fallbackImageUr === void 0 ? "" : _ref2$fallbackImageUr;
3824
+
3825
+ var _config$StoryTemplate = config.StoryTemplateIcon,
3826
+ StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
3827
+ return null;
3828
+ } : _config$StoryTemplate;
3829
+ var showImagePlaceholder = useSelector(function (state) {
3830
+ return get_1(state, ["qt", "config", "showPlaceholder"]);
3831
+ });
3832
+ var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
3833
+ var fullBleed = FullBleed ? "" : "with-padding";
3834
+ var heroImageClass = "hero-image";
3835
+ if (isHorizontal) heroImageClass = "right-padding";else if (isHorizontalWithImageLast) heroImageClass = "left-padding";
3836
+ var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
3837
+
3838
+ var getPadding = function getPadding(aspectRatio) {
3839
+ var _aspectRatio = _slicedToArray(aspectRatio, 2),
3840
+ height = _aspectRatio[0],
3841
+ width = _aspectRatio[1];
3842
+
3843
+ if (height > 0 && width > 0) {
3844
+ var padding = width / height * 100;
3845
+ return padding;
3846
+ }
3847
+
3848
+ return 0;
3849
+ };
3850
+
3851
+ var _aspectRatio2 = _slicedToArray(aspectRatio, 2),
3852
+ mobileAspectRatio = _aspectRatio2[0],
3853
+ _aspectRatio2$ = _aspectRatio2[1],
3854
+ desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
3855
+
3856
+ var isMobile = clientWidth("mobile");
3857
+ var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
3858
+ var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
3859
+ var slug = get_1(story, ["hero-image-s3-key"]) || get_1(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
3860
+ var hyperLink = get_1(story, ["hero-image-hyperlink"], "");
3861
+
3862
+ var fallbackImage = function fallbackImage() {
3863
+ if (!slug) {
3864
+ if (fallbackImageUrl && !isStoryPageImage) {
3865
+ return /*#__PURE__*/React.createElement("figure", {
3866
+ style: {
3867
+ paddingTop: imagePadding + "%"
3868
+ },
3869
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$4)
3870
+ }, /*#__PURE__*/React.createElement("img", {
3871
+ className: "qt-image",
3872
+ "data-src": "".concat(fallbackImageUrl),
3873
+ alt: "image-fallback"
3874
+ }));
3875
+ }
3876
+
3877
+ return /*#__PURE__*/React.createElement(React.Fragment, null, defaultFallback ? /*#__PURE__*/React.createElement("div", {
3878
+ "data-test-id": "arr--fallback-hero-image",
3879
+ style: {
3880
+ paddingTop: imagePadding + "%"
3881
+ },
3882
+ className: "arr--fallback-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$4)
3883
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
3884
+ storyTemplate: story["story-template"]
3885
+ }), /*#__PURE__*/React.createElement(FallbackImage, null)) : null);
3886
+ }
3887
+
3888
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("figure", {
3889
+ style: {
3890
+ paddingTop: imagePadding + "%"
3891
+ },
3892
+ className: "arr--responsive-hero-image " + _getClassName("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$4)
3893
+ }, /*#__PURE__*/React.createElement(StoryTemplateIcon, {
3894
+ storyTemplate: story["story-template"]
3895
+ }), /*#__PURE__*/React.createElement(ResponsiveHeroImage, {
3896
+ story: story,
3897
+ aspectRatio: imageAspectRatio,
3898
+ defaultWidth: defaultWidth,
3899
+ widths: widths,
3900
+ imgParams: {
3901
+ auto: ["format", "compress"],
3902
+ fit: "max"
3903
+ }
3904
+ })), isStoryPageImage && hyperLink && /*#__PURE__*/React.createElement(HyperLink, {
3905
+ hyperLink: hyperLink
3906
+ }));
3907
+ };
3908
+
3909
+ return story && (isStoryPageImage ? /*#__PURE__*/React.createElement("div", {
3910
+ "data-test-id": "arr--hero-image",
3911
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$4)
3912
+ }, fallbackImage()) : /*#__PURE__*/React.createElement(Link, {
3913
+ "data-test-id": "arr--hero-image",
3914
+ href: getStoryUrl(story, "/".concat(story.slug)),
3915
+ externalLink: isExternalStory(story),
3916
+ "aria-label": "fallback-hero-image",
3917
+ className: "arr--hero-image " + _getClassName("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$4)
3918
+ }, fallbackImage()));
3919
+ };
3920
+ HeroImage.propTypes = {
3921
+ /** The Story Object from the API response */
3922
+ story: PropTypes.object.isRequired,
3923
+
3924
+ /** Removes the Hero Image padding for the image to bleed over the margin */
3925
+ FullBleed: PropTypes.bool,
3926
+
3927
+ /** The default width for the image, in case the browser does not support srcset */
3928
+ defaultWidth: PropTypes.number,
3929
+
3930
+ /** The list of available widths */
3931
+ widths: PropTypes.array,
3932
+ // fatch the correct hero image
3933
+ aspectRatio: PropTypes.array,
3934
+ // Hints for the browser to choose the best size
3935
+
3936
+ /** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
3937
+ isHorizontal: PropTypes.bool,
3938
+
3939
+ /** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
3940
+ isHorizontalMobile: PropTypes.bool,
3941
+ // this prop is responsive for rendering fallback image on story page
3942
+ defaultFallback: PropTypes.bool,
3943
+ isHorizontalWithImageLast: PropTypes.bool,
3944
+ isStoryPageImage: PropTypes.bool,
3945
+ config: PropTypes.object
3946
+ };
3947
+ HeroImage.defaultProps = {
3948
+ FullBleed: true,
3949
+ aspectRatio: [[1, 1], [16, 9]],
3950
+ defaultWidth: 480,
3951
+ widths: [250, 480, 640],
3952
+ isHorizontal: false,
3953
+ isHorizontalMobile: false,
3954
+ defaultFallback: true,
3955
+ isStoryPageImage: false,
3956
+ isHorizontalWithImageLast: false,
3957
+ config: {}
3958
+ };
3959
+
3960
+ var _styleModuleImportMap$3 = {
3961
+ "./section.m.css": {
3962
+ "section": "section-m_section__2N4S3",
3963
+ "section-borderBottomSml": "section-m_section-borderBottomSml__2GNbo",
3964
+ "border-bottom": "section-m_border-bottom__3cRoD",
3965
+ "section-borderLeft": "section-m_section-borderLeft__3hKVj",
3966
+ "border-left": "section-m_border-left__2oUyp",
3967
+ "section-solid": "section-m_section-solid__1vB1Q",
3968
+ "dark": "section-m_dark__1r3C4",
3969
+ "light": "section-m_light__306hW"
3970
+ }
3971
+ };
3972
+ var SectionTag = function SectionTag(_ref) {
3973
+ var story = _ref.story,
3974
+ _ref$template = _ref.template,
3975
+ template = _ref$template === void 0 ? "" : _ref$template,
3976
+ _ref$borderColor = _ref.borderColor,
3977
+ borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
3978
+ isLightTheme = _ref.isLightTheme;
3979
+ var config = useStateValue() || {};
3980
+ var isSection = get_1(config, ["showSection"], true);
3981
+ var templateFromRowContext = get_1(config, ["sectionTagTemplate"]);
3982
+ var section = get_1(story, ["sections", 0], "");
3983
+ var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
3984
+ var getUrl = section ? section["section-url"] : "/";
3985
+ var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
3986
+ var textColor = isLightTheme ? "light" : getTextColor(colorToApplyContrast);
3987
+ var sectionTagBorderColor = rgbToHex(borderColor);
3988
+ var templateStyle = supportedTemplates.includes(template) ? "section section-".concat(template) : "section";
3989
+
3990
+ if (templateFromRowContext) {
3991
+ templateStyle = supportedTemplates.includes(templateFromRowContext) ? "section section-".concat(templateFromRowContext) : "section";
3992
+ }
3993
+
3994
+ if (!isSection) return null;
3995
+ return /*#__PURE__*/React.createElement(Link, {
3996
+ href: getUrl,
3997
+ className: "arrow-component arr--section-name",
3998
+ "aria-label": "section-name"
3999
+ }, /*#__PURE__*/React.createElement("div", {
4000
+ "data-test-id": "sectionTag",
4001
+ style: {
4002
+ backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
4003
+ },
4004
+ className: "section-tag arrow-component " + _getClassName("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$3)
4005
+ }, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React.createElement("span", {
4006
+ className: "section-m_border-left__2oUyp",
4007
+ style: {
4008
+ color: sectionTagBorderColor
4009
+ }
4010
+ }), section["display-name"] || section["name"], /*#__PURE__*/React.createElement("div", {
4011
+ className: "section-m_border-bottom__3cRoD",
4012
+ style: {
4013
+ backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
4014
+ }
4015
+ })));
4016
+ };
4017
+ SectionTag.propTypes = {
4018
+ /** The Story Object from the API response */
4019
+ story: PropTypes.object.isRequired,
4020
+
4021
+ /** The style template for section tag */
4022
+ template: PropTypes.oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
4023
+ borderColor: PropTypes.string,
4024
+ solidBorderColor: PropTypes.string,
4025
+ isLightTheme: PropTypes.bool
4026
+ };
4027
+ SectionTag.defaultProps = {
4028
+ template: "",
4029
+ isLightTheme: false
4030
+ };
4031
+
4032
+ var _styleModuleImportMap$2 = {
4033
+ "./storycard.m.css": {
4034
+ "author-timestamp-wrapper": "storycard-m_author-timestamp-wrapper__20yjp",
4035
+ "default-card": "storycard-m_default-card__1-POn",
4036
+ "horizontal-card": "storycard-m_horizontal-card___7afz",
4037
+ "backgroung-img": "storycard-m_backgroung-img__1FMJT",
4038
+ "content-overlap": "storycard-m_content-overlap__1yNHR",
4039
+ "border-full": "storycard-m_border-full__1nhy7",
4040
+ "light": "storycard-m_light__3EhXN",
4041
+ "dark": "storycard-m_dark__2wCTq",
4042
+ "border-bottom": "storycard-m_border-bottom__2_E-I",
4043
+ "border-boxShadow": "storycard-m_border-boxShadow__2-k3Z",
4044
+ "center-align": "storycard-m_center-align__1Sn8-",
4045
+ "content-bottom": "storycard-m_content-bottom__1QHeC",
4046
+ "content-full": "storycard-m_content-full__2zJmU",
4047
+ "content-boxShadow": "storycard-m_content-boxShadow__2IAWZ",
4048
+ "hero-image": "storycard-m_hero-image__1H3MB",
4049
+ "right-padding": "storycard-m_right-padding__12-lQ",
4050
+ "horizontal-mob": "storycard-m_horizontal-mob__17JG2",
4051
+ "content": "storycard-m_content__1Q9vq",
4052
+ "border-default": "storycard-m_border-default__PEZ1x",
4053
+ "card": "storycard-m_card__KJwRa",
4054
+ "horizontal-image-last": "storycard-m_horizontal-image-last__3o6LY"
4055
+ }
4056
+ };
4057
+ var StoryCard = function StoryCard(_ref) {
4058
+ var story = _ref.story,
4059
+ children = _ref.children,
4060
+ isHorizontal = _ref.isHorizontal,
4061
+ aspectRatio = _ref.aspectRatio,
4062
+ border = _ref.border,
4063
+ useImageAsBackground = _ref.useImageAsBackground,
4064
+ bgImgContentOverlap = _ref.bgImgContentOverlap,
4065
+ theme = _ref.theme,
4066
+ borderColor = _ref.borderColor,
4067
+ isHorizontalMobile = _ref.isHorizontalMobile,
4068
+ centerAlign = _ref.centerAlign,
4069
+ headerLevel = _ref.headerLevel,
4070
+ hideAuthorImage = _ref.hideAuthorImage,
4071
+ prefix = _ref.prefix,
4072
+ config = _ref.config,
4073
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
4074
+ if (!story || isEmpty(story)) return /*#__PURE__*/React.createElement("div", null);
4075
+ var borderOptions = ["default", "full", "bottom", "boxShadow"];
4076
+ var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
4077
+
4078
+ var horizontalCardStyle = "default-card";
4079
+ if (isHorizontal) horizontalCardStyle = "horizontal-card";else if (isHorizontalWithImageLast) horizontalCardStyle = "horizontal-image-last";
4080
+ var bgImageClasses = useImageAsBackground ? "backgroung-img" : "";
4081
+ var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
4082
+ var textColor = getTextColor(theme);
4083
+ var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
4084
+ var defaultStorycard = /*#__PURE__*/React.createElement(DefaultStoryCard, {
4085
+ story: story,
4086
+ aspectRatio: aspectRatio,
4087
+ border: border,
4088
+ isHorizontalMobile: isHorizontalMobile,
4089
+ isHorizontal: isHorizontal,
4090
+ centerAlign: centerAlign,
4091
+ headerLevel: headerLevel,
4092
+ borderColor: borderColor,
4093
+ hideAuthorImage: hideAuthorImage,
4094
+ prefix: prefix,
4095
+ config: config,
4096
+ isHorizontalWithImageLast: isHorizontalWithImageLast
4097
+ });
4098
+ return /*#__PURE__*/React.createElement("div", {
4099
+ "data-test-id": "story-card",
4100
+ style: {
4101
+ backgroundColor: theme,
4102
+ color: textColor
4103
+ },
4104
+ className: "arr--story-card " + _getClassName("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap$2)
4105
+ }, children || defaultStorycard);
4106
+ };
4107
+
4108
+ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
4109
+ var story = _ref2.story;
4110
+ _ref2.border;
4111
+ var isHorizontal = _ref2.isHorizontal,
4112
+ aspectRatio = _ref2.aspectRatio,
4113
+ headerLevel = _ref2.headerLevel,
4114
+ _ref2$isHorizontalMob = _ref2.isHorizontalMobile,
4115
+ isHorizontalMobile = _ref2$isHorizontalMob === void 0 ? false : _ref2$isHorizontalMob,
4116
+ _ref2$centerAlign = _ref2.centerAlign,
4117
+ centerAlign = _ref2$centerAlign === void 0 ? false : _ref2$centerAlign,
4118
+ borderColor = _ref2.borderColor,
4119
+ hideAuthorImage = _ref2.hideAuthorImage,
4120
+ prefix = _ref2.prefix,
4121
+ isHorizontalWithImageLast = _ref2.isHorizontalWithImageLast,
4122
+ config = _ref2.config;
4123
+ var alignment = centerAlign ? "center-align" : "";
4124
+ var SectionTagborderColor = rgbToHex(borderColor);
4125
+ var _config$localizationC = config.localizationConfig,
4126
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
4127
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isHorizontal ? /*#__PURE__*/React.createElement(HeroImage, {
4128
+ config: config,
4129
+ story: story,
4130
+ isHorizontal: true,
4131
+ isHorizontalMobile: isHorizontalMobile,
4132
+ aspectRatio: aspectRatio
4133
+ }) : isHorizontalWithImageLast ? /*#__PURE__*/React.createElement(HeroImage, {
4134
+ config: config,
4135
+ story: story,
4136
+ isHorizontalWithImageLast: true,
4137
+ isHorizontalMobile: isHorizontalMobile,
4138
+ aspectRatio: aspectRatio
4139
+ }) : /*#__PURE__*/React.createElement(HeroImage, {
4140
+ story: story,
4141
+ config: config,
4142
+ isHorizontalMobile: isHorizontalMobile,
4143
+ aspectRatio: aspectRatio
4144
+ }), /*#__PURE__*/React.createElement("div", {
4145
+ className: "arr--story-content " + _getClassName("content ".concat(alignment), _styleModuleImportMap$2)
4146
+ }, /*#__PURE__*/React.createElement(SectionTag, {
4147
+ story: story,
4148
+ borderColor: SectionTagborderColor
4149
+ }), /*#__PURE__*/React.createElement(Headline, {
4150
+ story: story,
4151
+ headerLevel: headerLevel,
4152
+ premiumStoryIconConfig: config
4153
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4154
+ config: localizationConfig,
4155
+ story: story,
4156
+ isBottom: true,
4157
+ prefix: prefix,
4158
+ hideAuthorImage: hideAuthorImage
4159
+ }), /*#__PURE__*/React.createElement(Subheadline, {
4160
+ story: story
4161
+ })));
4162
+ };
4163
+
4164
+ DefaultStoryCard.propTypes = {
4165
+ story: PropTypes.object.isRequired,
4166
+ border: PropTypes.oneOfType([PropTypes.string]),
4167
+ isBottom: PropTypes.bool,
4168
+ isHorizontal: PropTypes.bool,
4169
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
4170
+ isHorizontalMobile: PropTypes.bool,
4171
+ centerAlign: PropTypes.bool,
4172
+ headerLevel: PropTypes.string,
4173
+ borderColor: PropTypes.string,
4174
+ hideAuthorImage: PropTypes.bool,
4175
+ prefix: PropTypes.string,
4176
+ config: PropTypes.object,
4177
+ isHorizontalWithImageLast: PropTypes.bool
4178
+ };
4179
+ StoryCard.propTypes = {
4180
+ /** The Story Object from the API response */
4181
+ story: PropTypes.object.isRequired,
4182
+ children: PropTypes.node,
4183
+
4184
+ /** Flip the Story Card to Horizonal mode */
4185
+ isHorizontal: PropTypes.bool,
4186
+
4187
+ /** Add border to the Story Card */
4188
+ border: PropTypes.oneOfType([PropTypes.string]),
4189
+ // story card with background image
4190
+ useImageAsBackground: PropTypes.bool,
4191
+ // story card content overlap with image
4192
+ bgImgContentOverlap: PropTypes.bool,
4193
+
4194
+ /** add aspect ratio for hero image */
4195
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
4196
+
4197
+ /** add theme(dark /light/custom color) for storycard */
4198
+ theme: PropTypes.string,
4199
+
4200
+ /** flip the story card mobile design horizontal */
4201
+ isHorizontalMobile: PropTypes.bool,
4202
+ // make content center align in desktop and left align in mobile
4203
+ centerAlign: PropTypes.bool,
4204
+ headerLevel: PropTypes.string,
4205
+ borderColor: PropTypes.string,
4206
+ // handle author image through storycard
4207
+ hideAuthorImage: PropTypes.bool,
4208
+ // handle author prefix through storycard
4209
+ prefix: PropTypes.string,
4210
+ config: PropTypes.object,
4211
+ isHorizontalWithImageLast: PropTypes.bool
4212
+ };
4213
+ StoryCard.defaultProps = {
4214
+ isHorizontal: false,
4215
+ isHorizontalMobile: false,
4216
+ border: "default",
4217
+ theme: "",
4218
+ centerAlign: false,
4219
+ borderColor: "",
4220
+ isHorizontalWithImageLast: false
4221
+ };
4222
+
4223
+ var _styleModuleImportMap$1 = {
4224
+ "./storycardContent.m.css": {
4225
+ "wrapper": "storycardContent-m_wrapper__TEmfA",
4226
+ "horizontal-content-wrapper": "storycardContent-m_horizontal-content-wrapper__NgpuC",
4227
+ "border-full": "storycardContent-m_border-full__2km37"
4228
+ }
4229
+ };
4230
+ var StorycardContent = function StorycardContent(_ref) {
4231
+ var story = _ref.story,
4232
+ children = _ref.children,
4233
+ theme = _ref.theme,
4234
+ border = _ref.border,
4235
+ isHorizontalMobile = _ref.isHorizontalMobile,
4236
+ headerLevel = _ref.headerLevel,
4237
+ borderColor = _ref.borderColor,
4238
+ config = _ref.config;
4239
+ var textColor = getTextColor(theme);
4240
+ var borderOptions = ["full"];
4241
+ var SectionTagborderColor = rgbToHex(borderColor);
4242
+ var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : "";
4243
+ var horizontalCard = isHorizontalMobile ? "horizontal-content-wrapper" : "";
4244
+ return /*#__PURE__*/React.createElement("div", {
4245
+ "data-test-id": "story-card-content",
4246
+ style: {
4247
+ backgroundColor: theme,
4248
+ color: textColor
4249
+ },
4250
+ className: "arr--content-wrapper " + _getClassName("wrapper ".concat(borderTemplate, " ").concat(horizontalCard), _styleModuleImportMap$1)
4251
+ }, children || /*#__PURE__*/React.createElement(DefaultStoryCardContent, {
4252
+ story: story,
4253
+ headerLevel: headerLevel,
4254
+ isHorizontalMobile: isHorizontalMobile,
4255
+ borderColor: SectionTagborderColor,
4256
+ config: config
4257
+ }));
4258
+ };
4259
+
4260
+ var DefaultStoryCardContent = function DefaultStoryCardContent(_ref2) {
4261
+ var story = _ref2.story,
4262
+ headerLevel = _ref2.headerLevel,
4263
+ borderColor = _ref2.borderColor,
4264
+ _ref2$config = _ref2.config,
4265
+ config = _ref2$config === void 0 ? {} : _ref2$config;
4266
+ var SectionTagborderColor = rgbToHex(borderColor);
4267
+ var _config$localizationC = config.localizationConfig,
4268
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
4269
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SectionTag, {
4270
+ story: story,
4271
+ borderColor: SectionTagborderColor
4272
+ }), /*#__PURE__*/React.createElement(Headline, {
4273
+ story: story,
4274
+ headerLevel: headerLevel,
4275
+ premiumStoryIconConfig: config
4276
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4277
+ config: localizationConfig,
4278
+ story: story
4279
+ }));
4280
+ };
4281
+
4282
+ DefaultStoryCardContent.propTypes = {
4283
+ story: PropTypes.object.isRequired,
4284
+ border: PropTypes.string,
4285
+ theme: PropTypes.string,
4286
+ isHorizontalMobile: PropTypes.bool,
4287
+ headerLevel: PropTypes.string,
4288
+ borderColor: PropTypes.string,
4289
+ config: PropTypes.object
4290
+ };
4291
+ StorycardContent.propTypes = {
4292
+ story: PropTypes.object.isRequired,
4293
+ children: PropTypes.node,
4294
+ theme: PropTypes.string,
4295
+ border: PropTypes.string,
4296
+ isHorizontalMobile: PropTypes.bool,
4297
+ headerLevel: PropTypes.string,
4298
+ borderColor: PropTypes.string,
4299
+ config: PropTypes.object
4300
+ };
4301
+
4302
+ var MagazineCoverImageCard = function MagazineCoverImageCard(_ref) {
4303
+ var collection = _ref.collection,
4304
+ _ref$config = _ref.config,
4305
+ config = _ref$config === void 0 ? {} : _ref$config;
4306
+ var imgAltText = get_1(collection, ["metadata", "magazine", "name"], "cover-image");
4307
+ var coverImageData = get_1(collection, ["metadata", "cover-image"]) || {};
4308
+ var _config$magazineSlug = config.magazineSlug,
4309
+ magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug;
4310
+ var coverUrl = coverImageData["cover-image-url"],
4311
+ covers3Key = coverImageData["cover-image-s3-key"],
4312
+ coverImageMetaData = coverImageData["cover-image-metadata"];
4313
+ var slug = magazineSlug && collection && getSlug(collection, config);
4314
+ return /*#__PURE__*/React.createElement("div", {
4315
+ className: "arr--magazine-cover-img magazine-cover-image-m_cover-image__1McI_"
4316
+ }, covers3Key || coverUrl ? /*#__PURE__*/React.createElement("figure", {
4317
+ className: "magazine-cover-image-m_image__3-ZtB"
4318
+ }, covers3Key ? /*#__PURE__*/React.createElement(Link, {
4319
+ href: slug,
4320
+ "aria-label": "magazine-cover-image"
4321
+ }, /*#__PURE__*/React.createElement(LazyLoadImages, null, /*#__PURE__*/React.createElement(ResponsiveImage, {
4322
+ slug: covers3Key,
4323
+ aspectRatio: [1, 2],
4324
+ metadata: {
4325
+ coverImageMetaData: coverImageMetaData
4326
+ },
4327
+ defaultWidth: 400,
4328
+ imgParams: {
4329
+ auto: ["format", "compress"]
4330
+ },
4331
+ alt: imgAltText
4332
+ }))) : /*#__PURE__*/React.createElement("img", {
4333
+ src: coverUrl,
4334
+ alt: "cover-image",
4335
+ loading: "lazy"
4336
+ })) : /*#__PURE__*/React.createElement("div", {
4337
+ className: "magazine-cover-image-m_fallback-img__cyAjK"
4338
+ }, /*#__PURE__*/React.createElement(FallbackImage, {
4339
+ slug: slug
4340
+ })));
4341
+ };
4342
+ MagazineCoverImageCard.propTypes = {
4343
+ collection: PropTypes.shape({
4344
+ "cover-image-url": PropTypes.string,
4345
+ "cover-image-s3-key": PropTypes.string,
4346
+ "cover-image-metadata": PropTypes.string,
4347
+ slug: PropTypes.string
4348
+ }),
4349
+ config: PropTypes.shape({
4350
+ magazineSlug: PropTypes.string
4351
+ })
4352
+ };
4353
+
4354
+ var _styleModuleImportMap = {
4355
+ "../MagazineHeaderCard/magazine-cards.m.css": {
4356
+ "viewports": "\"../../../../assets/stylesheets/viewports.m.css\"",
4357
+ "mobile": "768px",
4358
+ "tablet": "992px",
4359
+ "magazine-header": "magazine-cards-m_magazine-header__2pSI3",
4360
+ "content": "magazine-cards-m_content__16_KC",
4361
+ "time": "magazine-cards-m_time__3DIrk",
4362
+ "story-cards": "magazine-cards-m_story-cards__1mNHC",
4363
+ "widget": "magazine-cards-m_widget__2aE9g",
4364
+ "intro-button": "magazine-cards-m_intro-button__3J5c6",
4365
+ "widget-button": "magazine-cards-m_widget-button__3P7F7",
4366
+ "summary": "magazine-cards-m_summary__2jUgG",
4367
+ "dark": "magazine-cards-m_dark__3CSmK",
4368
+ "light": "magazine-cards-m_light__33r9r"
4369
+ }
4370
+ };
4371
+
4372
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4373
+
4374
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4375
+ var MagazineWidgetBase = function MagazineWidgetBase(_ref) {
4376
+ var _ref$collection = _ref.collection,
4377
+ collection = _ref$collection === void 0 ? {} : _ref$collection,
4378
+ _ref$config = _ref.config,
4379
+ config = _ref$config === void 0 ? {} : _ref$config;
4380
+ var createdAt = collection["created-at"],
4381
+ issueDate = collection["collection-date"],
4382
+ summary = collection.summary,
4383
+ items = collection.items,
4384
+ _collection$metadata = collection.metadata,
4385
+ metadata = _collection$metadata === void 0 ? {} : _collection$metadata;
4386
+ var _config$theme = config.theme,
4387
+ theme = _config$theme === void 0 ? "" : _config$theme,
4388
+ _config$footerButton = config.footerButton,
4389
+ footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
4390
+ border = config.border,
4391
+ _config$localizationC = config.localizationConfig,
4392
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC,
4393
+ _config$navigate = config.navigate,
4394
+ navigate = _config$navigate === void 0 ? true : _config$navigate,
4395
+ _config$magazineSlug = config.magazineSlug,
4396
+ magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug;
4397
+ var textColor = getTextColor(theme);
4398
+ var dispatch = useDispatch();
4399
+ var qtConfig = useSelector(function (state) {
4400
+ return get_1(state, ["qt", "config"], {});
4401
+ });
4402
+ var updatedMagazineSlug = magazineSlug || get_1(metadata, ["entities", "collectionEntities", "magazine", 0, "slug"], "");
4403
+
4404
+ var updatedConfig = _objectSpread(_objectSpread({}, config), {}, {
4405
+ magazineSlug: updatedMagazineSlug
4406
+ });
4407
+
4408
+ var url = generateNavigateSlug(collection, _objectSpread(_objectSpread({}, qtConfig), updatedConfig));
4409
+ var sliceValue = 4;
4410
+ var isTablet = clientWidth("tablet");
4411
+ var timeStampConfig = {
4412
+ isUpperCase: true,
4413
+ disableMeridiem: true
4414
+ };
4415
+ var date = issueDate || createdAt;
4416
+
4417
+ var storyCards = function storyCards(items) {
4418
+ return /*#__PURE__*/React.createElement("div", {
4419
+ className: "magazine-cards-m_story-cards__1mNHC"
4420
+ }, items.slice(0, sliceValue).map(function (storyItems, index) {
4421
+ var story = storyItems.story;
4422
+ var isMobile = clientWidth("mobile");
4423
+
4424
+ var borderBottom = function borderBottom() {
4425
+ var lastStoryIndex = 3;
4426
+ var lastTwoStoriesIndex = [2, 3];
4427
+
4428
+ if (isMobile && !lastStoryIndex === index) {
4429
+ return "bottom";
4430
+ }
4431
+
4432
+ if (!lastTwoStoriesIndex.includes(index)) {
4433
+ return "bottom";
4434
+ }
4435
+ };
4436
+
4437
+ var borderSettings = border === "borderBottom" ? borderBottom() : "";
4438
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StoryCard, {
4439
+ story: story,
4440
+ border: borderSettings,
4441
+ isHorizontal: true,
4442
+ config: config
4443
+ }, /*#__PURE__*/React.createElement(HeroImage, {
4444
+ story: story,
4445
+ isHorizontal: true,
4446
+ aspectRatio: [[4, 3]]
4447
+ }), /*#__PURE__*/React.createElement(StorycardContent, {
4448
+ story: story,
4449
+ config: config
4450
+ }, /*#__PURE__*/React.createElement(Headline, {
4451
+ story: story,
4452
+ premiumStoryIconConfig: config
4453
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
4454
+ config: localizationConfig,
4455
+ story: story,
4456
+ prefix: "By"
4457
+ }))));
4458
+ }));
4459
+ };
4460
+
4461
+ var bottomCard = function bottomCard() {
4462
+ return /*#__PURE__*/React.createElement("div", {
4463
+ className: "magazine-cards-m_widget__2aE9g"
4464
+ }, storyCards(items), /*#__PURE__*/React.createElement(LoadmoreButton, {
4465
+ collection: collection,
4466
+ template: footerButton,
4467
+ config: updatedConfig,
4468
+ navigate: function navigate() {
4469
+ return navigateTo(dispatch, url);
4470
+ },
4471
+ qtConfig: qtConfig
4472
+ }));
4473
+ };
4474
+
4475
+ return /*#__PURE__*/React.createElement("div", {
4476
+ className: "full-width-with-padding arrow-component",
4477
+ style: {
4478
+ backgroundColor: theme
4479
+ },
4480
+ "data-test-id": "magazine-widget"
4481
+ }, /*#__PURE__*/React.createElement("div", {
4482
+ className: "arr-magazine-widget magazine-cards-m_magazine-header__2pSI3 magazine-cards-m_widget-button__3P7F7"
4483
+ }, /*#__PURE__*/React.createElement(MagazineCoverImageCard, {
4484
+ collection: collection,
4485
+ config: updatedConfig
4486
+ }), /*#__PURE__*/React.createElement("div", {
4487
+ className: "magazine-cards-m_content__16_KC"
4488
+ }, /*#__PURE__*/React.createElement("div", {
4489
+ "data-test-id": "widget-date",
4490
+ className: _getClassName("time ".concat(textColor), _styleModuleImportMap)
4491
+ }, getTimeStamp(date, timestampToFormat, timeStampConfig)), /*#__PURE__*/React.createElement(CollectionName, {
4492
+ collection: collection,
4493
+ config: config,
4494
+ navigate: navigate
4495
+ }), /*#__PURE__*/React.createElement("div", {
4496
+ "data-test-id": "widget-summary",
4497
+ className: _getClassName("summary ".concat(textColor), _styleModuleImportMap)
4498
+ }, summary), !isTablet && bottomCard()), isTablet && bottomCard()));
4499
+ };
4500
+ MagazineWidgetBase.propTypes = {
4501
+ collection: PropTypes.shape({
4502
+ "created-at": PropTypes.number,
4503
+ summary: PropTypes.string,
4504
+ items: PropTypes.array
4505
+ }),
4506
+ config: PropTypes.shape({
4507
+ theme: PropTypes.string,
4508
+ footerButton: PropTypes.string,
4509
+ border: PropTypes.string
4510
+ })
4511
+ };
4512
+ var MagazineWidget = StateProvider(MagazineWidgetBase);
4513
+
4514
+ export { MagazineWidget, MagazineWidgetBase };