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