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