@ably/ui 5.0.1-dev.baf5b97.0 → 5.3.0-dev.3c981a4

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 (176) hide show
  1. package/core/.gitignore +1 -0
  2. package/core/Code/component.css +70 -0
  3. package/core/Code/component.js +1 -0
  4. package/core/Code.jsx +7578 -0
  5. package/core/ConnectStateWrapper/component.js +1 -0
  6. package/core/ConnectStateWrapper.jsx +213 -0
  7. package/core/ContactFooter/component.css +12 -0
  8. package/core/ContactFooter/component.js +1 -0
  9. package/core/ContactFooter.jsx +448 -0
  10. package/core/CookieMessage/component.css +14 -0
  11. package/core/CookieMessage/component.js +1 -0
  12. package/core/CookieMessage.jsx +476 -0
  13. package/core/CustomerLogos/component.js +1 -0
  14. package/core/CustomerLogos.jsx +246 -0
  15. package/core/FeatureFooter/component.css +13 -0
  16. package/core/FeatureFooter/component.js +1 -0
  17. package/core/FeatureFooter.jsx +17 -0
  18. package/core/FeaturedLink/component.css +16 -0
  19. package/core/FeaturedLink/component.js +1 -0
  20. package/core/FeaturedLink.jsx +307 -0
  21. package/core/Flash/component.css +30 -0
  22. package/core/Flash/component.js +1 -0
  23. package/core/Flash.jsx +2002 -0
  24. package/core/Footer/component.css +14 -0
  25. package/core/Footer/component.js +1 -0
  26. package/core/Footer.jsx +593 -0
  27. package/core/Icon/component.css +1 -0
  28. package/core/Icon/component.js +1 -0
  29. package/core/Icon.jsx +257 -0
  30. package/core/Logo/component.js +1 -0
  31. package/core/Logo.jsx +302 -0
  32. package/core/Meganav/component.css +103 -0
  33. package/core/Meganav/component.js +1 -0
  34. package/core/Meganav/component.json +37 -0
  35. package/core/Meganav.jsx +6514 -0
  36. package/core/MeganavBlogPostsList/component.js +1 -0
  37. package/core/MeganavBlogPostsList.jsx +360 -0
  38. package/core/MeganavContentDevelopers/component.js +1 -0
  39. package/core/MeganavContentDevelopers.jsx +418 -0
  40. package/core/MeganavContentPlatform/component.js +1 -0
  41. package/core/MeganavContentPlatform.jsx +440 -0
  42. package/core/MeganavContentUseCases/component.js +1 -0
  43. package/core/MeganavContentUseCases.jsx +309 -0
  44. package/core/MeganavContentWhyAbly/component.js +1 -0
  45. package/core/MeganavContentWhyAbly.jsx +1471 -0
  46. package/core/MeganavControl/component.js +1 -0
  47. package/core/MeganavControl.jsx +301 -0
  48. package/core/MeganavControlMobileDropdown/component.js +1 -0
  49. package/core/MeganavControlMobileDropdown.jsx +303 -0
  50. package/core/MeganavControlMobilePanelClose/component.js +1 -0
  51. package/core/MeganavControlMobilePanelClose.jsx +301 -0
  52. package/core/MeganavControlMobilePanelOpen/component.js +1 -0
  53. package/core/MeganavControlMobilePanelOpen.jsx +299 -0
  54. package/core/MeganavItemsDesktop/component.js +1 -0
  55. package/core/MeganavItemsDesktop.jsx +377 -0
  56. package/core/MeganavItemsMobile/component.js +1 -0
  57. package/core/MeganavItemsMobile.jsx +581 -0
  58. package/core/MeganavItemsSignedIn/component.js +1 -0
  59. package/core/MeganavItemsSignedIn.jsx +461 -0
  60. package/core/Notice/component.css +8 -0
  61. package/core/Notice/component.js +2 -0
  62. package/core/Notice/component.js.LICENSE.txt +9 -0
  63. package/core/Notice.jsx +2915 -0
  64. package/core/Showcase/component.css +31 -0
  65. package/core/Showcase/component.js +1 -0
  66. package/core/Showcase.jsx +17 -0
  67. package/core/SignOutLink/component.js +1 -0
  68. package/core/SignOutLink.jsx +262 -0
  69. package/core/Slider/component.css +9 -0
  70. package/core/Slider/component.js +1 -0
  71. package/core/Slider.jsx +957 -0
  72. package/core/Test/component.js +59 -0
  73. package/core/Test.jsx +4 -0
  74. package/core/Uptime/component.css +129 -0
  75. package/core/Uptime/component.js +1 -0
  76. package/core/Uptime.jsx +1373 -0
  77. package/core/core.base.css +1 -0
  78. package/core/core.components.css +49 -0
  79. package/core/fonts/.DS_Store +0 -0
  80. package/core/fonts/NEXT-Book-Light-Italic.eot +0 -0
  81. package/core/fonts/NEXT-Book-Light-Italic.otf +0 -0
  82. package/core/fonts/NEXT-Book-Light-Italic.woff +0 -0
  83. package/core/fonts/NEXT-Book-Light-Italic.woff2 +0 -0
  84. package/core/fonts/NEXT-Book-Light.eot +0 -0
  85. package/core/fonts/NEXT-Book-Light.otf +0 -0
  86. package/core/fonts/NEXT-Book-Light.woff +0 -0
  87. package/core/fonts/NEXT-Book-Light.woff2 +0 -0
  88. package/core/fonts/NEXT-Book-Medium-Italic.eot +0 -0
  89. package/core/fonts/NEXT-Book-Medium-Italic.otf +0 -0
  90. package/core/fonts/NEXT-Book-Medium-Italic.woff +0 -0
  91. package/core/fonts/NEXT-Book-Medium-Italic.woff2 +0 -0
  92. package/core/fonts/NEXT-Book-Medium.eot +0 -0
  93. package/core/fonts/NEXT-Book-Medium.otf +0 -0
  94. package/core/fonts/NEXT-Book-Medium.woff +0 -0
  95. package/core/fonts/NEXT-Book-Medium.woff2 +0 -0
  96. package/core/fonts/next.css +59 -0
  97. package/core/images/.DS_Store +0 -0
  98. package/core/images/ably-logo.svg +15 -0
  99. package/core/images/ably-stack.svg +14 -0
  100. package/core/images/blog-thumb1.jpg +0 -0
  101. package/core/images/blog-thumb2.jpg +0 -0
  102. package/core/images/blog-thumb3.jpg +0 -0
  103. package/core/images/cust-logo-ao-col-pos.png +0 -0
  104. package/core/images/cust-logo-ao-col-pos@2x.png +0 -0
  105. package/core/images/cust-logo-ausopen-col-pos.png +0 -0
  106. package/core/images/cust-logo-ausopen-col-pos@2x.png +0 -0
  107. package/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
  108. package/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
  109. package/core/images/cust-logo-hopin-mono-pos.svg +4 -0
  110. package/core/images/cust-logo-hubspot-col-pos.png +0 -0
  111. package/core/images/cust-logo-hubspot-col-pos@2x.png +0 -0
  112. package/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
  113. package/core/images/cust-logo-lightspeed-col-pos.png +0 -0
  114. package/core/images/cust-logo-lightspeed-col-pos@2x.png +0 -0
  115. package/core/images/cust-logo-lightspeed-syst-col-pos.png +0 -0
  116. package/core/images/cust-logo-lightspeed-syst-col-pos@2x.png +0 -0
  117. package/core/images/cust-logo-split-col-pos.png +0 -0
  118. package/core/images/cust-logo-split-col-pos@2x.png +0 -0
  119. package/core/images/cust-logo-split-mono-pos.svg +9 -0
  120. package/core/images/cust-logo-toyota-mono-pos.svg +18 -0
  121. package/core/images/cust-logo-vitac-col-pos.png +0 -0
  122. package/core/images/cust-logo-vitac-col-pos@2x.png +0 -0
  123. package/core/images/cust-photo-hubspot-max-freiert.jpg +0 -0
  124. package/core/images/cust-photo-split-pato-echague.jpg +0 -0
  125. package/core/images/cust-photo-vitac-joe-antonio.jpg +0 -0
  126. package/core/images/flexible-companies.png +0 -0
  127. package/core/images/rocket-list-2021.png +0 -0
  128. package/core/images/scale-motif-open-empathetic.svg +1 -0
  129. package/core/images/technical-support-01-800x533.jpg +0 -0
  130. package/core/scripts.js +1 -0
  131. package/core/sprites.svg +130 -0
  132. package/core/styles.base.css +1 -0
  133. package/core/styles.components.css +49 -0
  134. package/core/styles.css +560 -0
  135. package/package.json +1 -1
  136. package/preview/log/.keep +0 -0
  137. package/preview/tmp/.keep +0 -0
  138. package/preview/tmp/pids/.keep +0 -0
  139. package/reset/.gitignore +1 -0
  140. package/reset/scripts.js +1 -0
  141. package/reset/styles.css +487 -0
  142. package/src/.DS_Store +0 -0
  143. package/src/core/.DS_Store +0 -0
  144. package/src/core/Code/component.html.erb +3 -3
  145. package/src/core/Code/component.jsx +3 -2
  146. package/src/core/Code/component.rb +2 -1
  147. package/src/core/CustomerLogos/component.html.erb +9 -0
  148. package/src/core/CustomerLogos/component.js +0 -0
  149. package/src/core/CustomerLogos/component.jsx +27 -0
  150. package/src/core/CustomerLogos/component.rb +13 -0
  151. package/src/core/FeaturedLink/component.css +1 -2
  152. package/src/core/FeaturedLink/component.html.erb +1 -1
  153. package/src/core/FeaturedLink/component.rb +3 -1
  154. package/src/core/MeganavItemsSignedIn/component.html.erb +1 -1
  155. package/src/core/MeganavItemsSignedIn/component.jsx +1 -1
  156. package/src/core/Slider/component.html.erb +2 -2
  157. package/src/core/Slider/component.js +2 -2
  158. package/src/core/Slider/component.jsx +2 -2
  159. package/src/core/icons/icon-display-api-keys.svg +3 -0
  160. package/src/core/icons/icon-display-cloud-servers.svg +3 -0
  161. package/src/core/icons/icon-display-map-pin.svg +1 -1
  162. package/src/core/icons/icon-display-servers.svg +3 -0
  163. package/src/core/icons/icon-gui-history.svg +3 -0
  164. package/src/core/icons/icon-gui-refresh.svg +10 -0
  165. package/src/core/images/cust-logo-ausopen-mono-pos.svg +5 -0
  166. package/src/core/images/cust-logo-bloomberg-mono-pos.svg +11 -0
  167. package/src/core/images/cust-logo-hopin-mono-pos.svg +4 -0
  168. package/src/core/images/cust-logo-hubspot-mono-pos.svg +4 -0
  169. package/src/core/images/cust-logo-split-mono-pos.svg +9 -0
  170. package/src/core/images/cust-logo-toyota-mono-pos.svg +18 -0
  171. package/src/core/styles/buttons.css +91 -4
  172. package/src/core/styles/forms.css +50 -0
  173. package/src/core/styles/properties.css +34 -6
  174. package/src/core/styles/text.css +62 -1
  175. package/src/core/styles.components.css +1 -0
  176. package/tailwind.config.js +22 -1
@@ -0,0 +1,1373 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if(typeof exports === 'object' && typeof module === 'object')
3
+ module.exports = factory(require("react"));
4
+ else if(typeof define === 'function' && define.amd)
5
+ define([], factory);
6
+ else {
7
+ var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
8
+ for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
+ }
10
+ })(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
11
+ return /******/ (() => { // webpackBootstrap
12
+ /******/ var __webpack_modules__ = ({
13
+
14
+ /***/ 7757:
15
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16
+
17
+ module.exports = __webpack_require__(5666);
18
+
19
+
20
+ /***/ }),
21
+
22
+ /***/ 5751:
23
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24
+
25
+ "use strict";
26
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
27
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
28
+ /* harmony export */ });
29
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
30
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
31
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
32
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
33
+ /* harmony import */ var _Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9008);
34
+
35
+
36
+
37
+
38
+ var FeaturedLink = function FeaturedLink(_ref) {
39
+ var url = _ref.url,
40
+ _ref$textSize = _ref.textSize,
41
+ textSize = _ref$textSize === void 0 ? "text-menu3" : _ref$textSize,
42
+ _ref$iconColor = _ref.iconColor,
43
+ iconColor = _ref$iconColor === void 0 ? "text-cool-black" : _ref$iconColor,
44
+ _ref$flush = _ref.flush,
45
+ flush = _ref$flush === void 0 ? false : _ref$flush,
46
+ children = _ref.children;
47
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", {
48
+ href: url,
49
+ className: "ui-featured-link ".concat(textSize, " ").concat(flush ? "" : "py-8", " "),
50
+ style: {
51
+ "--featured-link-icon-size": "var(".concat(textSize.replace("text", "--fs"), ")")
52
+ }
53
+ }, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__.default, {
54
+ name: "icon-gui-link-arrow",
55
+ size: "calc(var(--featured-link-icon-size) * 1.25)",
56
+ color: iconColor,
57
+ additionalCSS: "ui-featured-link-icon"
58
+ }));
59
+ };
60
+
61
+ FeaturedLink.propTypes = {
62
+ url: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
63
+ children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
64
+ textSize: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
65
+ iconColor: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
66
+ flush: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
67
+ };
68
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FeaturedLink);
69
+
70
+ /***/ }),
71
+
72
+ /***/ 9008:
73
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
74
+
75
+ "use strict";
76
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
78
+ /* harmony export */ });
79
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
80
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
81
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5697);
82
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
83
+ var _excluded = ["name", "size", "color", "additionalCSS"];
84
+
85
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
86
+
87
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
88
+
89
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
90
+
91
+
92
+
93
+
94
+ var Icon = function Icon(_ref) {
95
+ var name = _ref.name,
96
+ _ref$size = _ref.size,
97
+ size = _ref$size === void 0 ? "0.75rem" : _ref$size,
98
+ _ref$color = _ref.color,
99
+ color = _ref$color === void 0 ? "" : _ref$color,
100
+ _ref$additionalCSS = _ref.additionalCSS,
101
+ additionalCSS = _ref$additionalCSS === void 0 ? "" : _ref$additionalCSS,
102
+ additionalAttributes = _objectWithoutProperties(_ref, _excluded);
103
+
104
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", _extends({
105
+ className: "".concat(color, " ").concat(additionalCSS),
106
+ style: {
107
+ width: size,
108
+ height: size
109
+ }
110
+ }, additionalAttributes), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("use", {
111
+ xlinkHref: "#sprite-".concat(name)
112
+ }));
113
+ };
114
+
115
+ Icon.propTypes = {
116
+ name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string.isRequired),
117
+ size: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
118
+ color: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
119
+ additionalCSS: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
120
+ };
121
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Icon);
122
+
123
+ /***/ }),
124
+
125
+ /***/ 2703:
126
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
127
+
128
+ "use strict";
129
+ /**
130
+ * Copyright (c) 2013-present, Facebook, Inc.
131
+ *
132
+ * This source code is licensed under the MIT license found in the
133
+ * LICENSE file in the root directory of this source tree.
134
+ */
135
+
136
+
137
+
138
+ var ReactPropTypesSecret = __webpack_require__(414);
139
+
140
+ function emptyFunction() {}
141
+ function emptyFunctionWithReset() {}
142
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
143
+
144
+ module.exports = function() {
145
+ function shim(props, propName, componentName, location, propFullName, secret) {
146
+ if (secret === ReactPropTypesSecret) {
147
+ // It is still safe when called from React.
148
+ return;
149
+ }
150
+ var err = new Error(
151
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
152
+ 'Use PropTypes.checkPropTypes() to call them. ' +
153
+ 'Read more at http://fb.me/use-check-prop-types'
154
+ );
155
+ err.name = 'Invariant Violation';
156
+ throw err;
157
+ };
158
+ shim.isRequired = shim;
159
+ function getShim() {
160
+ return shim;
161
+ };
162
+ // Important!
163
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
164
+ var ReactPropTypes = {
165
+ array: shim,
166
+ bool: shim,
167
+ func: shim,
168
+ number: shim,
169
+ object: shim,
170
+ string: shim,
171
+ symbol: shim,
172
+
173
+ any: shim,
174
+ arrayOf: getShim,
175
+ element: shim,
176
+ elementType: shim,
177
+ instanceOf: getShim,
178
+ node: shim,
179
+ objectOf: getShim,
180
+ oneOf: getShim,
181
+ oneOfType: getShim,
182
+ shape: getShim,
183
+ exact: getShim,
184
+
185
+ checkPropTypes: emptyFunctionWithReset,
186
+ resetWarningCache: emptyFunction
187
+ };
188
+
189
+ ReactPropTypes.PropTypes = ReactPropTypes;
190
+
191
+ return ReactPropTypes;
192
+ };
193
+
194
+
195
+ /***/ }),
196
+
197
+ /***/ 5697:
198
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
199
+
200
+ /**
201
+ * Copyright (c) 2013-present, Facebook, Inc.
202
+ *
203
+ * This source code is licensed under the MIT license found in the
204
+ * LICENSE file in the root directory of this source tree.
205
+ */
206
+
207
+ if (false) { var throwOnDirectAccess, ReactIs; } else {
208
+ // By explicitly using `prop-types` you are opting into new production behavior.
209
+ // http://fb.me/prop-types-in-prod
210
+ module.exports = __webpack_require__(2703)();
211
+ }
212
+
213
+
214
+ /***/ }),
215
+
216
+ /***/ 414:
217
+ /***/ ((module) => {
218
+
219
+ "use strict";
220
+ /**
221
+ * Copyright (c) 2013-present, Facebook, Inc.
222
+ *
223
+ * This source code is licensed under the MIT license found in the
224
+ * LICENSE file in the root directory of this source tree.
225
+ */
226
+
227
+
228
+
229
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
230
+
231
+ module.exports = ReactPropTypesSecret;
232
+
233
+
234
+ /***/ }),
235
+
236
+ /***/ 5666:
237
+ /***/ ((module) => {
238
+
239
+ /**
240
+ * Copyright (c) 2014-present, Facebook, Inc.
241
+ *
242
+ * This source code is licensed under the MIT license found in the
243
+ * LICENSE file in the root directory of this source tree.
244
+ */
245
+
246
+ var runtime = (function (exports) {
247
+ "use strict";
248
+
249
+ var Op = Object.prototype;
250
+ var hasOwn = Op.hasOwnProperty;
251
+ var undefined; // More compressible than void 0.
252
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
253
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
254
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
255
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
256
+
257
+ function define(obj, key, value) {
258
+ Object.defineProperty(obj, key, {
259
+ value: value,
260
+ enumerable: true,
261
+ configurable: true,
262
+ writable: true
263
+ });
264
+ return obj[key];
265
+ }
266
+ try {
267
+ // IE 8 has a broken Object.defineProperty that only works on DOM objects.
268
+ define({}, "");
269
+ } catch (err) {
270
+ define = function(obj, key, value) {
271
+ return obj[key] = value;
272
+ };
273
+ }
274
+
275
+ function wrap(innerFn, outerFn, self, tryLocsList) {
276
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
277
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
278
+ var generator = Object.create(protoGenerator.prototype);
279
+ var context = new Context(tryLocsList || []);
280
+
281
+ // The ._invoke method unifies the implementations of the .next,
282
+ // .throw, and .return methods.
283
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
284
+
285
+ return generator;
286
+ }
287
+ exports.wrap = wrap;
288
+
289
+ // Try/catch helper to minimize deoptimizations. Returns a completion
290
+ // record like context.tryEntries[i].completion. This interface could
291
+ // have been (and was previously) designed to take a closure to be
292
+ // invoked without arguments, but in all the cases we care about we
293
+ // already have an existing method we want to call, so there's no need
294
+ // to create a new function object. We can even get away with assuming
295
+ // the method takes exactly one argument, since that happens to be true
296
+ // in every case, so we don't have to touch the arguments object. The
297
+ // only additional allocation required is the completion record, which
298
+ // has a stable shape and so hopefully should be cheap to allocate.
299
+ function tryCatch(fn, obj, arg) {
300
+ try {
301
+ return { type: "normal", arg: fn.call(obj, arg) };
302
+ } catch (err) {
303
+ return { type: "throw", arg: err };
304
+ }
305
+ }
306
+
307
+ var GenStateSuspendedStart = "suspendedStart";
308
+ var GenStateSuspendedYield = "suspendedYield";
309
+ var GenStateExecuting = "executing";
310
+ var GenStateCompleted = "completed";
311
+
312
+ // Returning this object from the innerFn has the same effect as
313
+ // breaking out of the dispatch switch statement.
314
+ var ContinueSentinel = {};
315
+
316
+ // Dummy constructor functions that we use as the .constructor and
317
+ // .constructor.prototype properties for functions that return Generator
318
+ // objects. For full spec compliance, you may wish to configure your
319
+ // minifier not to mangle the names of these two functions.
320
+ function Generator() {}
321
+ function GeneratorFunction() {}
322
+ function GeneratorFunctionPrototype() {}
323
+
324
+ // This is a polyfill for %IteratorPrototype% for environments that
325
+ // don't natively support it.
326
+ var IteratorPrototype = {};
327
+ IteratorPrototype[iteratorSymbol] = function () {
328
+ return this;
329
+ };
330
+
331
+ var getProto = Object.getPrototypeOf;
332
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
333
+ if (NativeIteratorPrototype &&
334
+ NativeIteratorPrototype !== Op &&
335
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
336
+ // This environment has a native %IteratorPrototype%; use it instead
337
+ // of the polyfill.
338
+ IteratorPrototype = NativeIteratorPrototype;
339
+ }
340
+
341
+ var Gp = GeneratorFunctionPrototype.prototype =
342
+ Generator.prototype = Object.create(IteratorPrototype);
343
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
344
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
345
+ GeneratorFunction.displayName = define(
346
+ GeneratorFunctionPrototype,
347
+ toStringTagSymbol,
348
+ "GeneratorFunction"
349
+ );
350
+
351
+ // Helper for defining the .next, .throw, and .return methods of the
352
+ // Iterator interface in terms of a single ._invoke method.
353
+ function defineIteratorMethods(prototype) {
354
+ ["next", "throw", "return"].forEach(function(method) {
355
+ define(prototype, method, function(arg) {
356
+ return this._invoke(method, arg);
357
+ });
358
+ });
359
+ }
360
+
361
+ exports.isGeneratorFunction = function(genFun) {
362
+ var ctor = typeof genFun === "function" && genFun.constructor;
363
+ return ctor
364
+ ? ctor === GeneratorFunction ||
365
+ // For the native GeneratorFunction constructor, the best we can
366
+ // do is to check its .name property.
367
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
368
+ : false;
369
+ };
370
+
371
+ exports.mark = function(genFun) {
372
+ if (Object.setPrototypeOf) {
373
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
374
+ } else {
375
+ genFun.__proto__ = GeneratorFunctionPrototype;
376
+ define(genFun, toStringTagSymbol, "GeneratorFunction");
377
+ }
378
+ genFun.prototype = Object.create(Gp);
379
+ return genFun;
380
+ };
381
+
382
+ // Within the body of any async function, `await x` is transformed to
383
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
384
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
385
+ // meant to be awaited.
386
+ exports.awrap = function(arg) {
387
+ return { __await: arg };
388
+ };
389
+
390
+ function AsyncIterator(generator, PromiseImpl) {
391
+ function invoke(method, arg, resolve, reject) {
392
+ var record = tryCatch(generator[method], generator, arg);
393
+ if (record.type === "throw") {
394
+ reject(record.arg);
395
+ } else {
396
+ var result = record.arg;
397
+ var value = result.value;
398
+ if (value &&
399
+ typeof value === "object" &&
400
+ hasOwn.call(value, "__await")) {
401
+ return PromiseImpl.resolve(value.__await).then(function(value) {
402
+ invoke("next", value, resolve, reject);
403
+ }, function(err) {
404
+ invoke("throw", err, resolve, reject);
405
+ });
406
+ }
407
+
408
+ return PromiseImpl.resolve(value).then(function(unwrapped) {
409
+ // When a yielded Promise is resolved, its final value becomes
410
+ // the .value of the Promise<{value,done}> result for the
411
+ // current iteration.
412
+ result.value = unwrapped;
413
+ resolve(result);
414
+ }, function(error) {
415
+ // If a rejected Promise was yielded, throw the rejection back
416
+ // into the async generator function so it can be handled there.
417
+ return invoke("throw", error, resolve, reject);
418
+ });
419
+ }
420
+ }
421
+
422
+ var previousPromise;
423
+
424
+ function enqueue(method, arg) {
425
+ function callInvokeWithMethodAndArg() {
426
+ return new PromiseImpl(function(resolve, reject) {
427
+ invoke(method, arg, resolve, reject);
428
+ });
429
+ }
430
+
431
+ return previousPromise =
432
+ // If enqueue has been called before, then we want to wait until
433
+ // all previous Promises have been resolved before calling invoke,
434
+ // so that results are always delivered in the correct order. If
435
+ // enqueue has not been called before, then it is important to
436
+ // call invoke immediately, without waiting on a callback to fire,
437
+ // so that the async generator function has the opportunity to do
438
+ // any necessary setup in a predictable way. This predictability
439
+ // is why the Promise constructor synchronously invokes its
440
+ // executor callback, and why async functions synchronously
441
+ // execute code before the first await. Since we implement simple
442
+ // async functions in terms of async generators, it is especially
443
+ // important to get this right, even though it requires care.
444
+ previousPromise ? previousPromise.then(
445
+ callInvokeWithMethodAndArg,
446
+ // Avoid propagating failures to Promises returned by later
447
+ // invocations of the iterator.
448
+ callInvokeWithMethodAndArg
449
+ ) : callInvokeWithMethodAndArg();
450
+ }
451
+
452
+ // Define the unified helper method that is used to implement .next,
453
+ // .throw, and .return (see defineIteratorMethods).
454
+ this._invoke = enqueue;
455
+ }
456
+
457
+ defineIteratorMethods(AsyncIterator.prototype);
458
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
459
+ return this;
460
+ };
461
+ exports.AsyncIterator = AsyncIterator;
462
+
463
+ // Note that simple async functions are implemented on top of
464
+ // AsyncIterator objects; they just return a Promise for the value of
465
+ // the final result produced by the iterator.
466
+ exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
467
+ if (PromiseImpl === void 0) PromiseImpl = Promise;
468
+
469
+ var iter = new AsyncIterator(
470
+ wrap(innerFn, outerFn, self, tryLocsList),
471
+ PromiseImpl
472
+ );
473
+
474
+ return exports.isGeneratorFunction(outerFn)
475
+ ? iter // If outerFn is a generator, return the full iterator.
476
+ : iter.next().then(function(result) {
477
+ return result.done ? result.value : iter.next();
478
+ });
479
+ };
480
+
481
+ function makeInvokeMethod(innerFn, self, context) {
482
+ var state = GenStateSuspendedStart;
483
+
484
+ return function invoke(method, arg) {
485
+ if (state === GenStateExecuting) {
486
+ throw new Error("Generator is already running");
487
+ }
488
+
489
+ if (state === GenStateCompleted) {
490
+ if (method === "throw") {
491
+ throw arg;
492
+ }
493
+
494
+ // Be forgiving, per 25.3.3.3.3 of the spec:
495
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
496
+ return doneResult();
497
+ }
498
+
499
+ context.method = method;
500
+ context.arg = arg;
501
+
502
+ while (true) {
503
+ var delegate = context.delegate;
504
+ if (delegate) {
505
+ var delegateResult = maybeInvokeDelegate(delegate, context);
506
+ if (delegateResult) {
507
+ if (delegateResult === ContinueSentinel) continue;
508
+ return delegateResult;
509
+ }
510
+ }
511
+
512
+ if (context.method === "next") {
513
+ // Setting context._sent for legacy support of Babel's
514
+ // function.sent implementation.
515
+ context.sent = context._sent = context.arg;
516
+
517
+ } else if (context.method === "throw") {
518
+ if (state === GenStateSuspendedStart) {
519
+ state = GenStateCompleted;
520
+ throw context.arg;
521
+ }
522
+
523
+ context.dispatchException(context.arg);
524
+
525
+ } else if (context.method === "return") {
526
+ context.abrupt("return", context.arg);
527
+ }
528
+
529
+ state = GenStateExecuting;
530
+
531
+ var record = tryCatch(innerFn, self, context);
532
+ if (record.type === "normal") {
533
+ // If an exception is thrown from innerFn, we leave state ===
534
+ // GenStateExecuting and loop back for another invocation.
535
+ state = context.done
536
+ ? GenStateCompleted
537
+ : GenStateSuspendedYield;
538
+
539
+ if (record.arg === ContinueSentinel) {
540
+ continue;
541
+ }
542
+
543
+ return {
544
+ value: record.arg,
545
+ done: context.done
546
+ };
547
+
548
+ } else if (record.type === "throw") {
549
+ state = GenStateCompleted;
550
+ // Dispatch the exception by looping back around to the
551
+ // context.dispatchException(context.arg) call above.
552
+ context.method = "throw";
553
+ context.arg = record.arg;
554
+ }
555
+ }
556
+ };
557
+ }
558
+
559
+ // Call delegate.iterator[context.method](context.arg) and handle the
560
+ // result, either by returning a { value, done } result from the
561
+ // delegate iterator, or by modifying context.method and context.arg,
562
+ // setting context.delegate to null, and returning the ContinueSentinel.
563
+ function maybeInvokeDelegate(delegate, context) {
564
+ var method = delegate.iterator[context.method];
565
+ if (method === undefined) {
566
+ // A .throw or .return when the delegate iterator has no .throw
567
+ // method always terminates the yield* loop.
568
+ context.delegate = null;
569
+
570
+ if (context.method === "throw") {
571
+ // Note: ["return"] must be used for ES3 parsing compatibility.
572
+ if (delegate.iterator["return"]) {
573
+ // If the delegate iterator has a return method, give it a
574
+ // chance to clean up.
575
+ context.method = "return";
576
+ context.arg = undefined;
577
+ maybeInvokeDelegate(delegate, context);
578
+
579
+ if (context.method === "throw") {
580
+ // If maybeInvokeDelegate(context) changed context.method from
581
+ // "return" to "throw", let that override the TypeError below.
582
+ return ContinueSentinel;
583
+ }
584
+ }
585
+
586
+ context.method = "throw";
587
+ context.arg = new TypeError(
588
+ "The iterator does not provide a 'throw' method");
589
+ }
590
+
591
+ return ContinueSentinel;
592
+ }
593
+
594
+ var record = tryCatch(method, delegate.iterator, context.arg);
595
+
596
+ if (record.type === "throw") {
597
+ context.method = "throw";
598
+ context.arg = record.arg;
599
+ context.delegate = null;
600
+ return ContinueSentinel;
601
+ }
602
+
603
+ var info = record.arg;
604
+
605
+ if (! info) {
606
+ context.method = "throw";
607
+ context.arg = new TypeError("iterator result is not an object");
608
+ context.delegate = null;
609
+ return ContinueSentinel;
610
+ }
611
+
612
+ if (info.done) {
613
+ // Assign the result of the finished delegate to the temporary
614
+ // variable specified by delegate.resultName (see delegateYield).
615
+ context[delegate.resultName] = info.value;
616
+
617
+ // Resume execution at the desired location (see delegateYield).
618
+ context.next = delegate.nextLoc;
619
+
620
+ // If context.method was "throw" but the delegate handled the
621
+ // exception, let the outer generator proceed normally. If
622
+ // context.method was "next", forget context.arg since it has been
623
+ // "consumed" by the delegate iterator. If context.method was
624
+ // "return", allow the original .return call to continue in the
625
+ // outer generator.
626
+ if (context.method !== "return") {
627
+ context.method = "next";
628
+ context.arg = undefined;
629
+ }
630
+
631
+ } else {
632
+ // Re-yield the result returned by the delegate method.
633
+ return info;
634
+ }
635
+
636
+ // The delegate iterator is finished, so forget it and continue with
637
+ // the outer generator.
638
+ context.delegate = null;
639
+ return ContinueSentinel;
640
+ }
641
+
642
+ // Define Generator.prototype.{next,throw,return} in terms of the
643
+ // unified ._invoke helper method.
644
+ defineIteratorMethods(Gp);
645
+
646
+ define(Gp, toStringTagSymbol, "Generator");
647
+
648
+ // A Generator should always return itself as the iterator object when the
649
+ // @@iterator function is called on it. Some browsers' implementations of the
650
+ // iterator prototype chain incorrectly implement this, causing the Generator
651
+ // object to not be returned from this call. This ensures that doesn't happen.
652
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
653
+ Gp[iteratorSymbol] = function() {
654
+ return this;
655
+ };
656
+
657
+ Gp.toString = function() {
658
+ return "[object Generator]";
659
+ };
660
+
661
+ function pushTryEntry(locs) {
662
+ var entry = { tryLoc: locs[0] };
663
+
664
+ if (1 in locs) {
665
+ entry.catchLoc = locs[1];
666
+ }
667
+
668
+ if (2 in locs) {
669
+ entry.finallyLoc = locs[2];
670
+ entry.afterLoc = locs[3];
671
+ }
672
+
673
+ this.tryEntries.push(entry);
674
+ }
675
+
676
+ function resetTryEntry(entry) {
677
+ var record = entry.completion || {};
678
+ record.type = "normal";
679
+ delete record.arg;
680
+ entry.completion = record;
681
+ }
682
+
683
+ function Context(tryLocsList) {
684
+ // The root entry object (effectively a try statement without a catch
685
+ // or a finally block) gives us a place to store values thrown from
686
+ // locations where there is no enclosing try statement.
687
+ this.tryEntries = [{ tryLoc: "root" }];
688
+ tryLocsList.forEach(pushTryEntry, this);
689
+ this.reset(true);
690
+ }
691
+
692
+ exports.keys = function(object) {
693
+ var keys = [];
694
+ for (var key in object) {
695
+ keys.push(key);
696
+ }
697
+ keys.reverse();
698
+
699
+ // Rather than returning an object with a next method, we keep
700
+ // things simple and return the next function itself.
701
+ return function next() {
702
+ while (keys.length) {
703
+ var key = keys.pop();
704
+ if (key in object) {
705
+ next.value = key;
706
+ next.done = false;
707
+ return next;
708
+ }
709
+ }
710
+
711
+ // To avoid creating an additional object, we just hang the .value
712
+ // and .done properties off the next function object itself. This
713
+ // also ensures that the minifier will not anonymize the function.
714
+ next.done = true;
715
+ return next;
716
+ };
717
+ };
718
+
719
+ function values(iterable) {
720
+ if (iterable) {
721
+ var iteratorMethod = iterable[iteratorSymbol];
722
+ if (iteratorMethod) {
723
+ return iteratorMethod.call(iterable);
724
+ }
725
+
726
+ if (typeof iterable.next === "function") {
727
+ return iterable;
728
+ }
729
+
730
+ if (!isNaN(iterable.length)) {
731
+ var i = -1, next = function next() {
732
+ while (++i < iterable.length) {
733
+ if (hasOwn.call(iterable, i)) {
734
+ next.value = iterable[i];
735
+ next.done = false;
736
+ return next;
737
+ }
738
+ }
739
+
740
+ next.value = undefined;
741
+ next.done = true;
742
+
743
+ return next;
744
+ };
745
+
746
+ return next.next = next;
747
+ }
748
+ }
749
+
750
+ // Return an iterator with no values.
751
+ return { next: doneResult };
752
+ }
753
+ exports.values = values;
754
+
755
+ function doneResult() {
756
+ return { value: undefined, done: true };
757
+ }
758
+
759
+ Context.prototype = {
760
+ constructor: Context,
761
+
762
+ reset: function(skipTempReset) {
763
+ this.prev = 0;
764
+ this.next = 0;
765
+ // Resetting context._sent for legacy support of Babel's
766
+ // function.sent implementation.
767
+ this.sent = this._sent = undefined;
768
+ this.done = false;
769
+ this.delegate = null;
770
+
771
+ this.method = "next";
772
+ this.arg = undefined;
773
+
774
+ this.tryEntries.forEach(resetTryEntry);
775
+
776
+ if (!skipTempReset) {
777
+ for (var name in this) {
778
+ // Not sure about the optimal order of these conditions:
779
+ if (name.charAt(0) === "t" &&
780
+ hasOwn.call(this, name) &&
781
+ !isNaN(+name.slice(1))) {
782
+ this[name] = undefined;
783
+ }
784
+ }
785
+ }
786
+ },
787
+
788
+ stop: function() {
789
+ this.done = true;
790
+
791
+ var rootEntry = this.tryEntries[0];
792
+ var rootRecord = rootEntry.completion;
793
+ if (rootRecord.type === "throw") {
794
+ throw rootRecord.arg;
795
+ }
796
+
797
+ return this.rval;
798
+ },
799
+
800
+ dispatchException: function(exception) {
801
+ if (this.done) {
802
+ throw exception;
803
+ }
804
+
805
+ var context = this;
806
+ function handle(loc, caught) {
807
+ record.type = "throw";
808
+ record.arg = exception;
809
+ context.next = loc;
810
+
811
+ if (caught) {
812
+ // If the dispatched exception was caught by a catch block,
813
+ // then let that catch block handle the exception normally.
814
+ context.method = "next";
815
+ context.arg = undefined;
816
+ }
817
+
818
+ return !! caught;
819
+ }
820
+
821
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
822
+ var entry = this.tryEntries[i];
823
+ var record = entry.completion;
824
+
825
+ if (entry.tryLoc === "root") {
826
+ // Exception thrown outside of any try block that could handle
827
+ // it, so set the completion value of the entire function to
828
+ // throw the exception.
829
+ return handle("end");
830
+ }
831
+
832
+ if (entry.tryLoc <= this.prev) {
833
+ var hasCatch = hasOwn.call(entry, "catchLoc");
834
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
835
+
836
+ if (hasCatch && hasFinally) {
837
+ if (this.prev < entry.catchLoc) {
838
+ return handle(entry.catchLoc, true);
839
+ } else if (this.prev < entry.finallyLoc) {
840
+ return handle(entry.finallyLoc);
841
+ }
842
+
843
+ } else if (hasCatch) {
844
+ if (this.prev < entry.catchLoc) {
845
+ return handle(entry.catchLoc, true);
846
+ }
847
+
848
+ } else if (hasFinally) {
849
+ if (this.prev < entry.finallyLoc) {
850
+ return handle(entry.finallyLoc);
851
+ }
852
+
853
+ } else {
854
+ throw new Error("try statement without catch or finally");
855
+ }
856
+ }
857
+ }
858
+ },
859
+
860
+ abrupt: function(type, arg) {
861
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
862
+ var entry = this.tryEntries[i];
863
+ if (entry.tryLoc <= this.prev &&
864
+ hasOwn.call(entry, "finallyLoc") &&
865
+ this.prev < entry.finallyLoc) {
866
+ var finallyEntry = entry;
867
+ break;
868
+ }
869
+ }
870
+
871
+ if (finallyEntry &&
872
+ (type === "break" ||
873
+ type === "continue") &&
874
+ finallyEntry.tryLoc <= arg &&
875
+ arg <= finallyEntry.finallyLoc) {
876
+ // Ignore the finally entry if control is not jumping to a
877
+ // location outside the try/catch block.
878
+ finallyEntry = null;
879
+ }
880
+
881
+ var record = finallyEntry ? finallyEntry.completion : {};
882
+ record.type = type;
883
+ record.arg = arg;
884
+
885
+ if (finallyEntry) {
886
+ this.method = "next";
887
+ this.next = finallyEntry.finallyLoc;
888
+ return ContinueSentinel;
889
+ }
890
+
891
+ return this.complete(record);
892
+ },
893
+
894
+ complete: function(record, afterLoc) {
895
+ if (record.type === "throw") {
896
+ throw record.arg;
897
+ }
898
+
899
+ if (record.type === "break" ||
900
+ record.type === "continue") {
901
+ this.next = record.arg;
902
+ } else if (record.type === "return") {
903
+ this.rval = this.arg = record.arg;
904
+ this.method = "return";
905
+ this.next = "end";
906
+ } else if (record.type === "normal" && afterLoc) {
907
+ this.next = afterLoc;
908
+ }
909
+
910
+ return ContinueSentinel;
911
+ },
912
+
913
+ finish: function(finallyLoc) {
914
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
915
+ var entry = this.tryEntries[i];
916
+ if (entry.finallyLoc === finallyLoc) {
917
+ this.complete(entry.completion, entry.afterLoc);
918
+ resetTryEntry(entry);
919
+ return ContinueSentinel;
920
+ }
921
+ }
922
+ },
923
+
924
+ "catch": function(tryLoc) {
925
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
926
+ var entry = this.tryEntries[i];
927
+ if (entry.tryLoc === tryLoc) {
928
+ var record = entry.completion;
929
+ if (record.type === "throw") {
930
+ var thrown = record.arg;
931
+ resetTryEntry(entry);
932
+ }
933
+ return thrown;
934
+ }
935
+ }
936
+
937
+ // The context.catch method must only be called with a location
938
+ // argument that corresponds to a known catch block.
939
+ throw new Error("illegal catch attempt");
940
+ },
941
+
942
+ delegateYield: function(iterable, resultName, nextLoc) {
943
+ this.delegate = {
944
+ iterator: values(iterable),
945
+ resultName: resultName,
946
+ nextLoc: nextLoc
947
+ };
948
+
949
+ if (this.method === "next") {
950
+ // Deliberately forget the last sent value so that we don't
951
+ // accidentally pass it on to the delegate.
952
+ this.arg = undefined;
953
+ }
954
+
955
+ return ContinueSentinel;
956
+ }
957
+ };
958
+
959
+ // Regardless of whether this script is executing as a CommonJS module
960
+ // or not, return the runtime object so that we can declare the variable
961
+ // regeneratorRuntime in the outer scope, which allows this module to be
962
+ // injected easily by `bin/regenerator --include-runtime script.js`.
963
+ return exports;
964
+
965
+ }(
966
+ // If this script is executing as a CommonJS module, use module.exports
967
+ // as the regeneratorRuntime namespace. Otherwise create a new empty
968
+ // object. Either way, the resulting object will be used to initialize
969
+ // the regeneratorRuntime variable at the top of this file.
970
+ true ? module.exports : 0
971
+ ));
972
+
973
+ try {
974
+ regeneratorRuntime = runtime;
975
+ } catch (accidentalStrictMode) {
976
+ // This module should not be running in strict mode, so the above
977
+ // assignment should always work unless something is misconfigured. Just
978
+ // in case runtime.js accidentally runs in strict mode, we can escape
979
+ // strict mode using a global Function call. This could conceivably fail
980
+ // if a Content Security Policy forbids using Function, but in that case
981
+ // the proper solution is to fix the accidental strict mode problem. If
982
+ // you've misconfigured your bundler to force strict mode and applied a
983
+ // CSP to forbid Function, and you're not willing to fix either of those
984
+ // problems, please detail your unique predicament in a GitHub issue.
985
+ Function("r", "regeneratorRuntime = r")(runtime);
986
+ }
987
+
988
+
989
+ /***/ }),
990
+
991
+ /***/ 9281:
992
+ /***/ ((module) => {
993
+
994
+ "use strict";
995
+ module.exports = __WEBPACK_EXTERNAL_MODULE__9281__;
996
+
997
+ /***/ })
998
+
999
+ /******/ });
1000
+ /************************************************************************/
1001
+ /******/ // The module cache
1002
+ /******/ var __webpack_module_cache__ = {};
1003
+ /******/
1004
+ /******/ // The require function
1005
+ /******/ function __webpack_require__(moduleId) {
1006
+ /******/ // Check if module is in cache
1007
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
1008
+ /******/ if (cachedModule !== undefined) {
1009
+ /******/ return cachedModule.exports;
1010
+ /******/ }
1011
+ /******/ // Create a new module (and put it into the cache)
1012
+ /******/ var module = __webpack_module_cache__[moduleId] = {
1013
+ /******/ // no module.id needed
1014
+ /******/ // no module.loaded needed
1015
+ /******/ exports: {}
1016
+ /******/ };
1017
+ /******/
1018
+ /******/ // Execute the module function
1019
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
1020
+ /******/
1021
+ /******/ // Return the exports of the module
1022
+ /******/ return module.exports;
1023
+ /******/ }
1024
+ /******/
1025
+ /************************************************************************/
1026
+ /******/ /* webpack/runtime/compat get default export */
1027
+ /******/ (() => {
1028
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
1029
+ /******/ __webpack_require__.n = (module) => {
1030
+ /******/ var getter = module && module.__esModule ?
1031
+ /******/ () => (module['default']) :
1032
+ /******/ () => (module);
1033
+ /******/ __webpack_require__.d(getter, { a: getter });
1034
+ /******/ return getter;
1035
+ /******/ };
1036
+ /******/ })();
1037
+ /******/
1038
+ /******/ /* webpack/runtime/define property getters */
1039
+ /******/ (() => {
1040
+ /******/ // define getter functions for harmony exports
1041
+ /******/ __webpack_require__.d = (exports, definition) => {
1042
+ /******/ for(var key in definition) {
1043
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1044
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1045
+ /******/ }
1046
+ /******/ }
1047
+ /******/ };
1048
+ /******/ })();
1049
+ /******/
1050
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
1051
+ /******/ (() => {
1052
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1053
+ /******/ })();
1054
+ /******/
1055
+ /******/ /* webpack/runtime/make namespace object */
1056
+ /******/ (() => {
1057
+ /******/ // define __esModule on exports
1058
+ /******/ __webpack_require__.r = (exports) => {
1059
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1060
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1061
+ /******/ }
1062
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
1063
+ /******/ };
1064
+ /******/ })();
1065
+ /******/
1066
+ /************************************************************************/
1067
+ var __webpack_exports__ = {};
1068
+ // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1069
+ (() => {
1070
+ "use strict";
1071
+ __webpack_require__.r(__webpack_exports__);
1072
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1073
+ /* harmony export */ "themes": () => (/* binding */ themes),
1074
+ /* harmony export */ "ThemeContext": () => (/* binding */ ThemeContext),
1075
+ /* harmony export */ "default": () => (/* binding */ Uptime)
1076
+ /* harmony export */ });
1077
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7757);
1078
+ /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
1079
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9281);
1080
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
1081
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5697);
1082
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
1083
+ /* harmony import */ var _FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5751);
1084
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1085
+
1086
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1087
+
1088
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1089
+
1090
+
1091
+
1092
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
1093
+
1094
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
1095
+
1096
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1097
+
1098
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1099
+
1100
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1101
+
1102
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1103
+
1104
+ function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
1105
+
1106
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
1107
+
1108
+
1109
+
1110
+
1111
+ var themes = {
1112
+ light: {
1113
+ text: "text-cool-black",
1114
+ iconColor: "text-cool-black"
1115
+ },
1116
+ dark: {
1117
+ text: "text-white",
1118
+ iconColor: "text-white"
1119
+ }
1120
+ };
1121
+ var ThemeContext = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createContext();
1122
+
1123
+ function StatusLegend(_ref) {
1124
+ var metadata = _ref.metadata,
1125
+ textColor = _ref.textColor;
1126
+ var items = Object.entries(metadata[0]).map(function (e) {
1127
+ var _e2 = _slicedToArray(e, 2),
1128
+ id = _e2[0],
1129
+ text = _e2[1];
1130
+
1131
+ var classname = "ui-uptime-key ui-uptime-".concat(id, " ").concat(textColor);
1132
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
1133
+ key: id,
1134
+ className: classname
1135
+ }, text);
1136
+ });
1137
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1138
+ className: "ui-uptime-legend"
1139
+ }, items);
1140
+ }
1141
+
1142
+ function applyAlignment(value, i) {
1143
+ var count = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 8;
1144
+ var before = i < value + count;
1145
+ var after = i > value - count;
1146
+ if (i > 0 && !(before && after)) return null;
1147
+ var align = i === 0 || i > value ? "left" : "right";
1148
+ var diff = value - i;
1149
+ var amount = Math.abs(diff) || 0;
1150
+ var sign = i > value ? -1 : 1;
1151
+ return {
1152
+ align: align,
1153
+ amount: amount,
1154
+ sign: sign
1155
+ };
1156
+ }
1157
+
1158
+ function UptimeGraph(_ref2) {
1159
+ var collection = _ref2.collection;
1160
+ // add 30 day split deliminators
1161
+ collection.splice(29, 0, null);
1162
+ collection.splice(60, 0, null);
1163
+ var MAX_TOOLTIP_CHAR_LENGTH = 80;
1164
+ var items = collection.map(function (row, i) {
1165
+ if (!row) return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("li", {
1166
+ key: i,
1167
+ className: "ui-uptime-seperator"
1168
+ });
1169
+
1170
+ var _map$filter = [0, 29, 60, 91].map(function (value) {
1171
+ return applyAlignment(value, i);
1172
+ }).filter(function (s) {
1173
+ return s;
1174
+ }),
1175
+ _map$filter2 = _slicedToArray(_map$filter, 1),
1176
+ _map$filter2$ = _map$filter2[0],
1177
+ alignment = _map$filter2$ === void 0 ? {} : _map$filter2$;
1178
+
1179
+ var _alignment$align = alignment.align,
1180
+ align = _alignment$align === void 0 ? null : _alignment$align,
1181
+ _alignment$amount = alignment.amount,
1182
+ amount = _alignment$amount === void 0 ? null : _alignment$amount,
1183
+ _alignment$sign = alignment.sign,
1184
+ sign = _alignment$sign === void 0 ? null : _alignment$sign;
1185
+ var labelAlign = alignment && "ui-uptime-align-".concat(align);
1186
+ var classname = "ui-uptime-day ui-uptime-".concat(row["class"], " ").concat(labelAlign).trim();
1187
+ var label = row.label;
1188
+
1189
+ var _label$trim = label.trim(),
1190
+ length = _label$trim.length;
1191
+
1192
+ var tooltext = length < MAX_TOOLTIP_CHAR_LENGTH ? label : label.slice(0, MAX_TOOLTIP_CHAR_LENGTH - 1) + "…";
1193
+ var width = length > MAX_TOOLTIP_CHAR_LENGTH - 10 && "extra-wide" || length > MAX_TOOLTIP_CHAR_LENGTH / 2 && "wide" || "normal";
1194
+ var translateX = Math.min(Math.max(amount - 1, 0) * 10 >> 0, 50) * sign;
1195
+ var transform = align ? {
1196
+ transform: "translateX(".concat(translateX, "%)")
1197
+ } : {};
1198
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("li", {
1199
+ key: i,
1200
+ className: classname
1201
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("span", {
1202
+ className: "ui-uptime-width-".concat(width),
1203
+ style: transform
1204
+ }, tooltext));
1205
+ });
1206
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1207
+ className: "ui-uptime-graph"
1208
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("ul", {
1209
+ className: "ui-uptime-list"
1210
+ }, items));
1211
+ }
1212
+
1213
+ function StatusCtaLink(_ref3) {
1214
+ var href = _ref3.href,
1215
+ text = _ref3.text;
1216
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1217
+ className: "ui-uptime-link-back"
1218
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ThemeContext.Consumer, null, function (_ref4) {
1219
+ var iconColor = _ref4.iconColor;
1220
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(_FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_3__.default, {
1221
+ url: href,
1222
+ iconColor: iconColor
1223
+ }, text);
1224
+ }));
1225
+ }
1226
+
1227
+ function StatusFooter(_ref5) {
1228
+ var metadata = _ref5.metadata,
1229
+ href = _ref5.href,
1230
+ text = _ref5.text;
1231
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1232
+ className: "ui-uptime-footer"
1233
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ThemeContext.Consumer, null, function (_ref6) {
1234
+ var text = _ref6.text;
1235
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StatusLegend, {
1236
+ metadata: metadata,
1237
+ textColor: text
1238
+ });
1239
+ }), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StatusCtaLink, {
1240
+ href: href,
1241
+ text: text
1242
+ }));
1243
+ }
1244
+
1245
+ function handleError(err) {
1246
+ // output a message and normalise schema
1247
+ console.warn("Uptime Error", err);
1248
+
1249
+ var _ref7 = err || {},
1250
+ message = _ref7.message;
1251
+
1252
+ return {
1253
+ error: true,
1254
+ message: message
1255
+ };
1256
+ }
1257
+
1258
+ function Uptime(_ref8) {
1259
+ var serverUrl = _ref8.serverUrl,
1260
+ _ref8$linkTo = _ref8.linkTo,
1261
+ linkTo = _ref8$linkTo === void 0 ? null : _ref8$linkTo,
1262
+ _ref8$theme = _ref8.theme,
1263
+ theme = _ref8$theme === void 0 ? "light" : _ref8$theme;
1264
+ if (!serverUrl) throw new Error("Server endpoint URL required");
1265
+
1266
+ var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
1267
+ _useState2 = _slicedToArray(_useState, 2),
1268
+ data = _useState2[0],
1269
+ setData = _useState2[1];
1270
+
1271
+ var _ref9 = data || {},
1272
+ collection = _ref9.collection,
1273
+ metadata = _ref9.metadata;
1274
+
1275
+ var showFooterRow = (linkTo === null || linkTo === void 0 ? void 0 : linkTo.href) && (linkTo === null || linkTo === void 0 ? void 0 : linkTo.text);
1276
+ (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
1277
+ var fetchEndpointJson = /*#__PURE__*/function () {
1278
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().mark(function _callee() {
1279
+ var payload, _payload, _collection, _metadata;
1280
+
1281
+ return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default().wrap(function _callee$(_context) {
1282
+ while (1) {
1283
+ switch (_context.prev = _context.next) {
1284
+ case 0:
1285
+ payload = null;
1286
+ _context.prev = 1;
1287
+ _context.next = 4;
1288
+ return fetch(serverUrl);
1289
+
1290
+ case 4:
1291
+ payload = _context.sent;
1292
+ _context.next = 7;
1293
+ return payload.json();
1294
+
1295
+ case 7:
1296
+ payload = _context.sent;
1297
+ _payload = payload, _collection = _payload.chart_data, _metadata = _payload.chart_legend;
1298
+ payload = {
1299
+ collection: _collection,
1300
+ metadata: _metadata
1301
+ };
1302
+ _context.next = 15;
1303
+ break;
1304
+
1305
+ case 12:
1306
+ _context.prev = 12;
1307
+ _context.t0 = _context["catch"](1);
1308
+ payload = handleError(_context.t0);
1309
+
1310
+ case 15:
1311
+ setData(payload);
1312
+
1313
+ case 16:
1314
+ case "end":
1315
+ return _context.stop();
1316
+ }
1317
+ }
1318
+ }, _callee, null, [[1, 12]]);
1319
+ }));
1320
+
1321
+ return function fetchEndpointJson() {
1322
+ return _ref10.apply(this, arguments);
1323
+ };
1324
+ }();
1325
+
1326
+ fetchEndpointJson();
1327
+ }, []);
1328
+
1329
+ if (data && data.error) {
1330
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1331
+ className: "flex sm:flex-row justify-center items-center p-24 border rounded font-sans font-light text-p2 ".concat(themes[theme].text),
1332
+ "data-id": "uptime-error"
1333
+ }, "Sorry, we can\u2019t retrieve uptime data right now.");
1334
+ }
1335
+
1336
+ return data && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(ThemeContext.Provider, {
1337
+ value: themes[theme]
1338
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement("div", {
1339
+ className: "ui-uptime-widget",
1340
+ "data-id": "uptime"
1341
+ }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(UptimeGraph, {
1342
+ collection: collection
1343
+ }), showFooterRow && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StatusFooter, _objectSpread({
1344
+ metadata: metadata
1345
+ }, linkTo))));
1346
+ }
1347
+ UptimeGraph.propTypes = {
1348
+ collection: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array)
1349
+ };
1350
+ StatusLegend.propTypes = {
1351
+ metadata: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array),
1352
+ textColor: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
1353
+ };
1354
+ StatusFooter.propTypes = {
1355
+ metadata: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array),
1356
+ href: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
1357
+ text: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
1358
+ };
1359
+ StatusCtaLink.propTypes = {
1360
+ href: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
1361
+ text: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
1362
+ };
1363
+ Uptime.propTypes = {
1364
+ serverUrl: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
1365
+ linkTo: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
1366
+ theme: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(["light", "dark"])
1367
+ };
1368
+ })();
1369
+
1370
+ /******/ return __webpack_exports__;
1371
+ /******/ })()
1372
+ ;
1373
+ });