@ably/ui 8.10.0 → 9.0.0

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 (53) hide show
  1. package/core/Code/component.css +3 -3
  2. package/core/Code/component.js +1 -1
  3. package/core/Code.jsx +353 -7273
  4. package/core/CompanyAutocomplete/component.js +1 -1
  5. package/core/ConnectStateWrapper.jsx +13 -4
  6. package/core/ContactFooter.jsx +13 -119
  7. package/core/CookieMessage.jsx +21 -293
  8. package/core/CustomerLogos.jsx +9 -114
  9. package/core/DropdownMenu.jsx +10 -116
  10. package/core/FeaturedLink.jsx +10 -116
  11. package/core/Flash.jsx +29 -1483
  12. package/core/Footer.jsx +17 -123
  13. package/core/Icon.jsx +9 -114
  14. package/core/Loader.jsx +9 -114
  15. package/core/Logo.jsx +13 -118
  16. package/core/Meganav/component.js +1 -2
  17. package/core/Meganav.jsx +2844 -10189
  18. package/core/MeganavBlogPostsList/component.js +1 -1
  19. package/core/MeganavBlogPostsList.jsx +11 -118
  20. package/core/MeganavContentCompany.jsx +31 -124
  21. package/core/MeganavContentDevelopers.jsx +10 -116
  22. package/core/MeganavContentPlatform.jsx +11 -118
  23. package/core/MeganavContentUseCases.jsx +10 -116
  24. package/core/MeganavControl.jsx +10 -116
  25. package/core/MeganavControlMobileDropdown/component.js +1 -1
  26. package/core/MeganavControlMobileDropdown.jsx +10 -116
  27. package/core/MeganavControlMobilePanelClose.jsx +10 -116
  28. package/core/MeganavControlMobilePanelOpen.jsx +10 -116
  29. package/core/MeganavItemsDesktop.jsx +13 -121
  30. package/core/MeganavItemsMobile.jsx +18 -132
  31. package/core/MeganavItemsSignedIn.jsx +16 -129
  32. package/core/MeganavSearch.jsx +13 -123
  33. package/core/MeganavSearchAutocomplete/component.js +1 -2
  34. package/core/MeganavSearchPanel.jsx +12 -121
  35. package/core/MeganavSearchSuggestions.jsx +11 -118
  36. package/core/Notice/component.js +1 -2
  37. package/core/Notice.jsx +62 -2136
  38. package/core/SignOutLink.jsx +9 -114
  39. package/core/Slider/component.js +1 -1
  40. package/core/Slider.jsx +25 -582
  41. package/core/Uptime.jsx +15 -118
  42. package/core/scripts.js +1 -1
  43. package/package.json +4 -4
  44. package/src/core/Code/component.css +1 -67
  45. package/src/core/Code/component.js +11 -46
  46. package/src/core/Code/component.jsx +7 -3
  47. package/src/core/FeatureFooter/component.html.erb +1 -1
  48. package/src/core/utils/syntax-highlighter-registry.js +61 -0
  49. package/src/core/utils/syntax-highlighter.css +69 -0
  50. package/src/core/utils/syntax-highlighter.js +98 -0
  51. package/core/Meganav/component.js.LICENSE.txt +0 -7
  52. package/core/MeganavSearchAutocomplete/component.js.LICENSE.txt +0 -7
  53. package/core/Notice/component.js.LICENSE.txt +0 -9
package/core/Uptime.jsx CHANGED
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(require("react"));
3
+ module.exports = factory(require("react"), require("prop-types"));
4
4
  else if(typeof define === 'function' && define.amd)
5
- define([], factory);
5
+ define([, ], factory);
6
6
  else {
7
- var a = typeof exports === 'object' ? factory(require("react")) : factory(root[undefined]);
7
+ var a = typeof exports === 'object' ? factory(require("react"), require("prop-types")) : factory(root[undefined], root[undefined]);
8
8
  for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
9
  }
10
- })(this, function(__WEBPACK_EXTERNAL_MODULE__9281__) {
10
+ })(this, function(__WEBPACK_EXTERNAL_MODULE__9281__, __WEBPACK_EXTERNAL_MODULE__3474__) {
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
@@ -28,7 +28,7 @@ module.exports = __webpack_require__(5666);
28
28
  /* harmony export */ });
29
29
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
30
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);
31
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3474);
32
32
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
33
33
  /* harmony import */ var _Icon_component_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9008);
34
34
 
@@ -78,7 +78,7 @@ FeaturedLink.propTypes = {
78
78
  /* harmony export */ });
79
79
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9281);
80
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);
81
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3474);
82
82
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
83
83
  var _excluded = ["name", "size", "color", "additionalCSS"];
84
84
 
@@ -120,117 +120,6 @@ Icon.propTypes = {
120
120
  };
121
121
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Icon);
122
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
123
  /***/ }),
235
124
 
236
125
  /***/ 5666:
@@ -986,6 +875,14 @@ try {
986
875
  }
987
876
 
988
877
 
878
+ /***/ }),
879
+
880
+ /***/ 3474:
881
+ /***/ ((module) => {
882
+
883
+ "use strict";
884
+ module.exports = __WEBPACK_EXTERNAL_MODULE__3474__;
885
+
989
886
  /***/ }),
990
887
 
991
888
  /***/ 9281:
@@ -1078,7 +975,7 @@ __webpack_require__.r(__webpack_exports__);
1078
975
  /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);
1079
976
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9281);
1080
977
  /* 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);
978
+ /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3474);
1082
979
  /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
1083
980
  /* harmony import */ var _FeaturedLink_component_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5751);
1084
981
  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; }
package/core/scripts.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define([,],e):"object"==typeof exports?exports.AblyUi=e(require("react"),require("react-dom")):(t.AblyUi=t.AblyUi||{},t.AblyUi.Core=e(t[void 0],t[void 0]))}(this,(function(t,e){return(()=>{var r={757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),a=new A(n||[]);return i._invoke=function(t,e,r){var n=l;return function(o,i){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return k()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=s(t,e,r);if("normal"===u.type){if(n=r.done?d:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function s(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l="suspendedStart",p="suspendedYield",h="executing",d="completed",y={};function v(){}function b(){}function g(){}var w={};w[i]=function(){return this};var m=Object.getPrototypeOf,O=m&&m(m(N([])));O&&O!==r&&n.call(O,i)&&(w=O);var x=g.prototype=v.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var o=s(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function N(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:k}}function k(){return{value:e,done:!0}}return b.prototype=x.constructor=g,g.constructor=b,b.displayName=u(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,c,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},E(j.prototype),j.prototype[a]=function(){return this},t.AsyncIterator=j,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new j(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},E(x),u(x,c,"Generator"),x[i]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),f=n.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},281:e=>{"use strict";e.exports=t},645:t=>{"use strict";t.exports=e}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{"use strict";o.r(i),o.d(i,{attachStoreToWindow:()=>O,connectState:()=>E,createRemoteDataStore:()=>j,fetchBlogPosts:()=>T,fetchSessionData:()=>M,getRemoteDataStore:()=>x,loadSprites:()=>u,queryId:()=>f,queryIdAll:()=>s,reactRenderer:()=>c,reducerBlogPosts:()=>D,reducerSessionData:()=>F,renderComponent:()=>a,selectRecentBlogPosts:()=>I,selectSessionData:()=>W,toggleChatWidget:()=>d}),Array.prototype.flat||Object.defineProperty(Array.prototype,"flat",{configurable:!0,value:function t(){var e=isNaN(arguments[0])?1:Number(arguments[0]);return e?Array.prototype.reduce.call(this,(function(r,n){return Array.isArray(n)?r.push.apply(r,t.call(n,e-1)):r.push(n),r}),[]):Array.prototype.slice.call(this)},writable:!0}),Array.prototype.flatMap||Object.defineProperty(Array.prototype,"flatMap",{configurable:!0,value:function(t){return Array.prototype.map.apply(this,arguments).flat()},writable:!0});var t=o(281),e=o.n(t),r=o(645),n=o.n(r),a=function(t,r,o){return n().render(e().createElement(t,r),o)};function c(t){var r=document.querySelectorAll("[data-react]");Array.from(r).forEach((function(r){var o=r.getAttribute("data-react"),i=t[o];if(i){var a=r.getAttribute("data-react-props"),c=a&&JSON.parse(a||{});n().render(e().createElement(i,c),r),r.removeAttribute("data-react"),r.removeAttribute("data-react-props")}}))}const u=function(t){fetch(t).then((function(t){return t.text()})).then((function(t){var e=document.createElement("div");e.style.display="none",e.innerHTML=t,document.body.appendChild(e)})).catch((function(t){return console.error(t)}))};var f=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector("[data-id=".concat(t,"]"))},s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelectorAll("[data-id=".concat(t,"]"))};function l(t,e){t.disabled=!1,t.innerText=e}function p(t,e){t.disabled=!0,t.innerText=e}var h=30;function d(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dataId,r=f(e),n=f("open-chat-widget",r),o=n.dataset.enabledLabel,i=n.dataset.disabledLabel;if(e&&r){var a,c=f("open-chat-widget",r),u=function t(e){var r,n,i=null===(r=window)||void 0===r||null===(n=r.HubSpotConversations)||void 0===n?void 0:n.widget,u=document.querySelector("#hubspot-messages-iframe-container");a=function(t){t.preventDefault(),i.open()},i&&u?(c.addEventListener("click",a),l(c,o)):--h&&setTimeout((function(){return t(100)}),e)};return p(c,i),u(0),function(){p(c,i),c.removeEventListener("click",a)}}}function y(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var v="function"==typeof Symbol&&Symbol.observable||"@@observable",b=function(){return Math.random().toString(36).substring(7).split("").join(".")},g={INIT:"@@redux/INIT"+b(),REPLACE:"@@redux/REPLACE"+b(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+b()}};function w(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function m(t,e,r){var n;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(y(0));if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw new Error(y(1));return r(m)(t,e)}if("function"!=typeof t)throw new Error(y(2));var o=t,i=e,a=[],c=a,u=!1;function f(){c===a&&(c=a.slice())}function s(){if(u)throw new Error(y(3));return i}function l(t){if("function"!=typeof t)throw new Error(y(4));if(u)throw new Error(y(5));var e=!0;return f(),c.push(t),function(){if(e){if(u)throw new Error(y(6));e=!1,f();var r=c.indexOf(t);c.splice(r,1),a=null}}}function p(t){if(!w(t))throw new Error(y(7));if(void 0===t.type)throw new Error(y(8));if(u)throw new Error(y(9));try{u=!0,i=o(i,t)}finally{u=!1}for(var e=a=c,r=0;r<e.length;r++)(0,e[r])();return t}function h(t){if("function"!=typeof t)throw new Error(y(10));o=t,p({type:g.REPLACE})}function d(){var t,e=l;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(y(11));function r(){t.next&&t.next(s())}return r(),{unsubscribe:e(r)}}})[v]=function(){return this},t}return p({type:g.INIT}),(n={dispatch:p,subscribe:l,getState:s,replaceReducer:h})[v]=d,n}var O=function(t){window.AblyUi=window.AblyUi||{},window.AblyUi.RemoteDataStore=t},x=function(){if(!window.AblyUi.RemoteDataStore)throw new Error("Remote store was called before one was created");return window.AblyUi.RemoteDataStore},E=function(t,e){var r=x(),n=t(r);r.subscribe((function(){var o=t(r);o!==n&&(n=o,e(o))}))},j=function(t){return m(function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var o=e[n];"function"==typeof t[o]&&(r[o]=t[o])}var i,a=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:g.INIT}))throw new Error(y(12));if(void 0===r(void 0,{type:g.PROBE_UNKNOWN_ACTION()}))throw new Error(y(13))}))}(r)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var n=!1,o={},c=0;c<a.length;c++){var u=a[c],f=r[u],s=t[u],l=f(s,e);if(void 0===l)throw e&&e.type,new Error(y(14));o[u]=l,n=n||l!==s}return(n=n||a.length!==Object.keys(t).length)?o:t}}(t))},P=o(757),S=o.n(P),L=function(t){return t&&t.includes("application/json")};function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){k(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function k(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var T=function(){var t,e=(t=S().mark((function t(e,r){var n,o;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r){t.next=4;break}return console.log('Skipping fetching blog posts, invalid blogUrl: "'.concat(r,'"')),t.abrupt("return");case 4:return t.next=6,fetch(r);case 6:if(n=t.sent,!L(n.headers.get("content-type"))){t.next=14;break}return t.next=10,n.json();case 10:o=t.sent,e.dispatch({type:"blog/loaded",payload:o}),t.next=15;break;case 14:throw new Error("Blog posts url is not serving json");case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(0),console.warn("Could not fetch blog posts due to error:",t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,17]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_(i,n,o,a,c,"next",t)}function c(t){_(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),R={recent:null},D=k({},"blogPosts",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:R,e=arguments.length>1?arguments[1]:void 0;return"blog/loaded"===e.type?N(N({},t),{},{recent:e.payload}):t})),I=function(t){var e;return null===(e=t.getState().blogPosts)||void 0===e?void 0:e.recent};function U(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?U(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var M=function(){var t,e=(t=S().mark((function t(e,r){var n,o,i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.dispatch({type:"session/loaded",payload:t})},t.prev=1,r){t.next=6;break}return console.log('Skipping fetching session, invalid sessionUrl: "'.concat(r,'"')),n(),t.abrupt("return");case 6:return t.next=8,fetch(r,{cache:"no-cache"});case 8:if(o=t.sent,L(o.headers.get("content-type"))){t.next=12;break}throw new Error("Session endpoint is not serving json");case 12:return t.next=14,o.json();case 14:"not-found"===(i=t.sent).error?n():n(i),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(1),n(),console.warn("Could not fetch session data due to error:",t.t0);case 22:case"end":return t.stop()}}),t,null,[[1,18]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){G(i,n,o,a,c,"next",t)}function c(t){G(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),B={data:null},F=q({},"session",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:B,e=arguments.length>1?arguments[1]:void 0;return"session/loaded"===e.type?C(C({},t),{},{data:e.payload}):t})),W=function(t){var e;return null===(e=t.getState().session)||void 0===e?void 0:e.data}})(),i})()}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("array-flat-polyfill"),require("react"),require("react-dom"),require("redux")):"function"==typeof define&&define.amd?define([,,,],e):"object"==typeof exports?exports.AblyUi=e(require("array-flat-polyfill"),require("react"),require("react-dom"),require("redux")):(t.AblyUi=t.AblyUi||{},t.AblyUi.Core=e(t[void 0],t[void 0],t[void 0],t[void 0]))}(this,(function(t,e,r,n){return(()=>{var o={757:(t,e,r)=>{t.exports=r(666)},666:t=>{var e=function(t){"use strict";var e,r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new k(n||[]);return i._invoke=function(t,e,r){var n=f;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===h){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=P(a,r);if(c){if(c===v)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=h,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var u=l(t,e,r);if("normal"===u.type){if(n=r.done?h:p,u.arg===v)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=h,r.method="throw",r.arg=u.arg)}}}(t,r,a),i}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var f="suspendedStart",p="suspendedYield",d="executing",h="completed",v={};function y(){}function g(){}function b(){}var m={};m[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(A([])));x&&x!==r&&n.call(x,i)&&(m=x);var O=b.prototype=y.prototype=Object.create(m);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(o,i,a,c){var u=l(t[o],t,i);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(f).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}}function P(t,r){var n=t.iterator[r.method];if(n===e){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method))return v;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=l(n,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function A(t){if(t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}return{next:_}}function _(){return{value:e,done:!0}}return g.prototype=O.constructor=b,b.constructor=g,g.displayName=u(b,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u(t,c,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(O),u(O,c,"Generator"),O[i]=function(){return this},O.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=A,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}},806:e=>{"use strict";e.exports=t},281:t=>{"use strict";t.exports=e},645:t=>{"use strict";t.exports=r},44:t=>{"use strict";t.exports=n}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={exports:{}};return o[t](r,r.exports,a),r.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var c={};return(()=>{"use strict";a.r(c),a.d(c,{attachStoreToWindow:()=>y,connectState:()=>b,createRemoteDataStore:()=>m,fetchBlogPosts:()=>L,fetchSessionData:()=>U,getRemoteDataStore:()=>g,loadSprites:()=>u,queryId:()=>s,queryIdAll:()=>l,reactRenderer:()=>i,reducerBlogPosts:()=>A,reducerSessionData:()=>G,renderComponent:()=>o,selectRecentBlogPosts:()=>_,selectSessionData:()=>C,toggleChatWidget:()=>h}),a(806);var t=a(281),e=a.n(t),r=a(645),n=a.n(r),o=function(t,r,o){return n().render(e().createElement(t,r),o)};function i(t){var r=document.querySelectorAll("[data-react]");Array.from(r).forEach((function(r){var o=r.getAttribute("data-react"),i=t[o];if(i){var a=r.getAttribute("data-react-props"),c=a&&JSON.parse(a||{});n().render(e().createElement(i,c),r),r.removeAttribute("data-react"),r.removeAttribute("data-react-props")}}))}const u=function(t){fetch(t).then((function(t){return t.text()})).then((function(t){var e=document.createElement("div");e.style.display="none",e.innerHTML=t,document.body.appendChild(e)})).catch((function(t){return console.error(t)}))};var s=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelector("[data-id=".concat(t,"]"))},l=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return e.querySelectorAll("[data-id=".concat(t,"]"))};function f(t,e){t.disabled=!1,t.innerText=e}function p(t,e){t.disabled=!0,t.innerText=e}var d=30;function h(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.dataId,r=s(e),n=s("open-chat-widget",r),o=n.dataset.enabledLabel,i=n.dataset.disabledLabel;if(e&&r){var a,c=s("open-chat-widget",r),u=function t(e){var r,n,i=null===(r=window)||void 0===r||null===(n=r.HubSpotConversations)||void 0===n?void 0:n.widget,u=document.querySelector("#hubspot-messages-iframe-container");a=function(t){t.preventDefault(),i.open()},i&&u?(c.addEventListener("click",a),f(c,o)):--d&&setTimeout((function(){return t(100)}),e)};return p(c,i),u(0),function(){p(c,i),c.removeEventListener("click",a)}}}var v=a(44),y=function(t){window.AblyUi=window.AblyUi||{},window.AblyUi.RemoteDataStore=t},g=function(){if(!window.AblyUi.RemoteDataStore)throw new Error("Remote store was called before one was created");return window.AblyUi.RemoteDataStore},b=function(t,e){var r=g(),n=t(r);r.subscribe((function(){var o=t(r);o!==n&&(n=o,e(o))}))},m=function(t){return(0,v.createStore)((0,v.combineReducers)(t))},w=a(757),x=a.n(w),O=function(t){return t&&t.includes("application/json")};function j(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function S(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?j(Object(r),!0).forEach((function(e){P(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function P(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var L=function(){var t,e=(t=x().mark((function t(e,r){var n,o;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r){t.next=4;break}return console.log('Skipping fetching blog posts, invalid blogUrl: "'.concat(r,'"')),t.abrupt("return");case 4:return t.next=6,fetch(r);case 6:if(n=t.sent,!O(n.headers.get("content-type"))){t.next=14;break}return t.next=10,n.json();case 10:o=t.sent,e.dispatch({type:"blog/loaded",payload:o}),t.next=15;break;case 14:throw new Error("Blog posts url is not serving json");case 15:t.next=20;break;case 17:t.prev=17,t.t0=t.catch(0),console.warn("Could not fetch blog posts due to error:",t.t0);case 20:case"end":return t.stop()}}),t,null,[[0,17]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){E(i,n,o,a,c,"next",t)}function c(t){E(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),k={recent:null},A=P({},"blogPosts",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,e=arguments.length>1?arguments[1]:void 0;return"blog/loaded"===e.type?S(S({},t),{},{recent:e.payload}):t})),_=function(t){var e;return null===(e=t.getState().blogPosts)||void 0===e?void 0:e.recent};function D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function q(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?D(Object(r),!0).forEach((function(e){T(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function T(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function R(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var U=function(){var t,e=(t=x().mark((function t(e,r){var n,o,i;return x().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.dispatch({type:"session/loaded",payload:t})},t.prev=1,r){t.next=6;break}return console.log('Skipping fetching session, invalid sessionUrl: "'.concat(r,'"')),n(),t.abrupt("return");case 6:return t.next=8,fetch(r,{cache:"no-cache"});case 8:if(o=t.sent,O(o.headers.get("content-type"))){t.next=12;break}throw new Error("Session endpoint is not serving json");case 12:return t.next=14,o.json();case 14:"not-found"===(i=t.sent).error?n():n(i),t.next=22;break;case 18:t.prev=18,t.t0=t.catch(1),n(),console.warn("Could not fetch session data due to error:",t.t0);case 22:case"end":return t.stop()}}),t,null,[[1,18]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){R(i,n,o,a,c,"next",t)}function c(t){R(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(t,r){return e.apply(this,arguments)}}(),N={data:null},G=T({},"session",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N,e=arguments.length>1?arguments[1]:void 0;return"session/loaded"===e.type?q(q({},t),{},{data:e.payload}):t})),C=function(t){var e;return null===(e=t.getState().session)||void 0===e?void 0:e.data}})(),c})()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ably/ui",
3
- "version": "8.10.0",
3
+ "version": "9.0.0",
4
4
  "description": "Home of the Ably design system library ([design.ably.com](https://design.ably.com)). It provides a showcase, development/test environment and a publishing pipeline for different distributables.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,6 +34,7 @@
34
34
  "eslint-plugin-cypress": "^2.11.2",
35
35
  "eslint-plugin-react": "^7.21.5",
36
36
  "extra-watch-webpack-plugin": "^1.0.3",
37
+ "find-imports": "^1.1.0",
37
38
  "mini-css-extract-plugin": "^1.2.1",
38
39
  "null-loader": "^4.0.1",
39
40
  "postcss": "^8.1.10",
@@ -42,7 +43,6 @@
42
43
  "postcss-import": "^13.0.0",
43
44
  "postcss-loader": "^4.0.4",
44
45
  "prettier": "^2.3.0",
45
- "prop-types": "^15.7.2",
46
46
  "svg-spritemap-webpack-plugin": "^3.7.1",
47
47
  "tailwindcss": "^2.0.1",
48
48
  "tailwindcss-filters": "^3.0.0",
@@ -67,13 +67,13 @@
67
67
  "dependencies": {
68
68
  "addsearch-js-client": "^0.7.0",
69
69
  "array-flat-polyfill": "^1.0.1",
70
- "deepmerge": "^4.2.2",
71
70
  "dompurify": "^2.2.9",
72
71
  "highlight.js": "^10.7.2",
72
+ "highlightjs-curl": "^1.3.0",
73
73
  "js-cookie": "^2.2.1",
74
- "lodash.debounce": "^4.0.8",
75
74
  "lodash.throttle": "^4.1.1",
76
75
  "nanoid": "^4.0.0",
76
+ "prop-types": "^15.7.2",
77
77
  "react": "^17.0.1",
78
78
  "react-dom": "^17.0.1",
79
79
  "redux": "^4.0.5",
@@ -1,67 +1 @@
1
- @import "../fonts/source-code-pro.css";
2
-
3
- @layer components {
4
- .hljs {
5
- background: var(--syntax-black);
6
- color: var(--syntax-light-grey);
7
- }
8
-
9
- .hljs-emphasis {
10
- font-style: italic;
11
- }
12
-
13
- .hljs-strong {
14
- font-weight: bold;
15
- }
16
-
17
- .hljs-comment,
18
- .hljs-quote {
19
- color: var(--syntax-dark-grey);
20
- }
21
-
22
- .hljs-variable,
23
- .hljs-template-variable,
24
- .hljs-tag,
25
- .hljs-name,
26
- .hljs-selector-id,
27
- .hljs-selector-class,
28
- .hljs-regexp,
29
- .hljs-deletion {
30
- color: var(--syntax-red);
31
- }
32
-
33
- .hljs-number,
34
- .hljs-built_in,
35
- .hljs-literal,
36
- .hljs-type,
37
- .hljs-params,
38
- .hljs-meta,
39
- .hljs-link {
40
- color: var(--syntax-orange);
41
- }
42
-
43
- .hljs-attribute {
44
- color: var(--syntax-yellow);
45
- }
46
-
47
- .hljs-string,
48
- .hljs-symbol,
49
- .hljs-bullet,
50
- .hljs-addition {
51
- color: var(--syntax-green);
52
- }
53
-
54
- .hljs-title,
55
- .hljs-section {
56
- color: var(--syntax-blue);
57
- }
58
-
59
- .hljs-keyword,
60
- .hljs-selector-tag {
61
- color: var(--syntax-lilac);
62
- }
63
-
64
- .hljs-subst {
65
- color: var(--syntax-mid-grey);
66
- }
67
- }
1
+ @import "../utils/syntax-highlighter.css";
@@ -1,47 +1,17 @@
1
1
  import "./component.css";
2
- import hljs from "highlight.js/lib/core";
3
2
 
4
- import bash from "highlight.js/lib/languages/bash";
5
- import cpp from "highlight.js/lib/languages/cpp";
6
- import csharp from "highlight.js/lib/languages/csharp";
7
- import dart from "highlight.js/lib/languages/dart";
8
- import plaintext from "highlight.js/lib/languages/plaintext";
9
- import go from "highlight.js/lib/languages/go";
10
- import java from "highlight.js/lib/languages/java";
11
- import javascript from "highlight.js/lib/languages/javascript";
12
- import json from "highlight.js/lib/languages/json";
13
- import objectivec from "highlight.js/lib/languages/objectivec";
14
- import php from "highlight.js/lib/languages/php";
15
- import python from "highlight.js/lib/languages/python";
16
- import ruby from "highlight.js/lib/languages/ruby";
17
- import swift from "highlight.js/lib/languages/swift";
18
- import xml from "highlight.js/lib/languages/xml";
3
+ // Note: importing syntax-highlighter here means the component.js file will include
4
+ // all the language dependecies, creating a large a bundle. Prefer using the highlighter serverside.
5
+ import {
6
+ highlightSnippet,
7
+ registerDefaultLanguages,
8
+ } from "../utils/syntax-highlighter";
19
9
 
20
- // Supported languages need to be imported here
21
- // https://github.com/highlightjs/highlight.js/blob/master/SUPPORTED_LANGUAGES.md
22
- const register = [
23
- { label: "", key: "plaintext", module: plaintext },
24
- { label: "JS", key: "javascript", module: javascript },
25
- { label: "Java", key: "java", module: java },
26
- { label: "Ruby", key: "ruby", module: ruby },
27
- { label: "Python", key: "python", module: python },
28
- { label: "PHP", key: "php", module: php },
29
- { label: "Shell", key: "bash", module: bash },
30
- { label: "C#", key: "cs", module: csharp },
31
- { label: "Go", key: "go", module: go },
32
- { label: "HTML", key: "xml", module: xml },
33
- { label: "C++", key: "cpp", module: cpp },
34
- { label: "Dart", key: "dart", module: dart },
35
- { label: "Swift", key: "swift", module: swift },
36
- { label: "Objective C", key: "objectivec", module: objectivec },
37
- { label: "Node.js", key: "javascript", module: javascript },
38
- { label: "JSON", key: "json", module: json },
39
- ];
10
+ import languagesRegistry from "../utils/syntax-highlighter-registry";
40
11
 
41
- // Initialize a sub-set of languages as used
42
- register.forEach(({ key, module }) => hljs.registerLanguage(key, module));
12
+ registerDefaultLanguages(languagesRegistry);
43
13
 
44
- function convertCodeToHTML(el) {
14
+ function highlightEl(el) {
45
15
  if (!el) throw "Missing code element";
46
16
 
47
17
  const pre = el.querySelector("pre");
@@ -51,14 +21,9 @@ function convertCodeToHTML(el) {
51
21
  if (!code || !pre || !language) throw "Malformed code element";
52
22
 
53
23
  const { innerHTML } = code;
54
- const html = hljs.highlight(innerHTML, { language }).value;
24
+ const html = highlightSnippet(language, innerHTML);
55
25
 
56
26
  code.innerHTML = html;
57
27
  }
58
28
 
59
- function highlight(language, snippet) {
60
- return hljs.highlight(snippet, { language }).value;
61
- }
62
-
63
- export { highlight };
64
- export default convertCodeToHTML;
29
+ export default highlightEl;
@@ -1,12 +1,16 @@
1
1
  import React from "react";
2
2
  import T from "prop-types";
3
3
 
4
- import "./component.css";
5
- import { highlight } from "./component.js";
4
+ import "../utils/syntax-highlighter.css";
5
+ import { highlightSnippet, registerDefaultLanguages } from "../utils/syntax-highlighter";
6
+ import languagesRegistry from "../utils/syntax-highlighter-registry";
7
+
8
+ registerDefaultLanguages(languagesRegistry);
6
9
 
7
10
  const Code = ({ language, snippet, textSize = "ui-text-code", padding = "p-32", additionalCSS = "" }) => {
8
- const HTMLraw = highlight(language, `${snippet}`.trim());
11
+ const HTMLraw = highlightSnippet(language, `${snippet}`.trim());
9
12
  const className = `language-${language} ${textSize}`;
13
+
10
14
  return (
11
15
  <div className={`hljs overflow-auto ${padding} ${additionalCSS}`} data-id="code">
12
16
  <pre lang={language}>
@@ -46,7 +46,7 @@
46
46
  </ul>
47
47
  </span>
48
48
  <span class="flex-0">
49
- <%= link_to 'Start with a free account', abs_url("/sign-up"), class: "ui-btn-secondary self-start mt-24" %>
49
+ <%= link_to 'Start building', abs_url("/sign-up"), class: "ui-btn-secondary self-start mt-24" %>
50
50
  </span>
51
51
  </div>
52
52
  </div>
@@ -0,0 +1,61 @@
1
+ // This file can be used in the browser, but because of the weight of all the language
2
+ // definitions, preferably it should be used on the server.
3
+
4
+ import bash from "highlight.js/lib/languages/bash";
5
+ import cpp from "highlight.js/lib/languages/cpp";
6
+ import csharp from "highlight.js/lib/languages/csharp";
7
+ import css from "highlight.js/lib/languages/css";
8
+ import dart from "highlight.js/lib/languages/dart";
9
+ import dos from "highlight.js/lib/languages/dos";
10
+ import diff from "highlight.js/lib/languages/diff";
11
+ import erlang from "highlight.js/lib/languages/erlang";
12
+ import elixir from "highlight.js/lib/languages/elixir";
13
+ import plaintext from "highlight.js/lib/languages/plaintext";
14
+ import go from "highlight.js/lib/languages/go";
15
+ import http from "highlight.js/lib/languages/http";
16
+ import java from "highlight.js/lib/languages/java";
17
+ import javascript from "highlight.js/lib/languages/javascript";
18
+ import typescript from "highlight.js/lib/languages/typescript";
19
+ import json from "highlight.js/lib/languages/json";
20
+ import objectivec from "highlight.js/lib/languages/objectivec";
21
+ import php from "highlight.js/lib/languages/php";
22
+ import python from "highlight.js/lib/languages/python";
23
+ import ruby from "highlight.js/lib/languages/ruby";
24
+ import swift from "highlight.js/lib/languages/swift";
25
+ import sql from "highlight.js/lib/languages/sql";
26
+ import xml from "highlight.js/lib/languages/xml";
27
+ import yaml from "highlight.js/lib/languages/yaml";
28
+ import curl from "highlightjs-curl/src/languages/curl";
29
+
30
+ const registry = [
31
+ { label: "Text", key: "text", module: plaintext },
32
+ { label: "JS", key: "javascript", module: javascript },
33
+ { label: "TS", key: "typescript", module: typescript },
34
+ { label: "Java", key: "java", module: java },
35
+ { label: "Ruby", key: "ruby", module: ruby },
36
+ { label: "Python", key: "python", module: python },
37
+ { label: "PHP", key: "php", module: php },
38
+ { label: "Shell", key: "bash", module: bash },
39
+ { label: "C#", key: "cs", module: csharp },
40
+ { label: "CSS", key: "css", module: css },
41
+ { label: "Go", key: "go", module: go },
42
+ { label: "HTML", key: "xml", module: xml },
43
+ { label: "HTTP", key: "http", module: http },
44
+ { label: "C++", key: "cpp", module: cpp },
45
+ { label: "Dart", key: "dart", module: dart },
46
+ { label: "Swift", key: "swift", module: swift },
47
+ { label: "Objective C", key: "objectivec", module: objectivec },
48
+ { label: "Node.js", key: "javascript", module: javascript },
49
+ { label: "JSON", key: "json", module: json },
50
+ { label: "DOS", key: "dos", module: dos },
51
+ { label: "YAML", key: "yaml", module: yaml },
52
+ { label: "Erlang", key: "erlang", module: erlang },
53
+ { label: "Elixir", key: "elixir", module: elixir },
54
+ { label: "Diff", key: "diff", module: diff },
55
+ { label: "SQL", key: "sql", module: sql },
56
+ { label: "cURL", key: "curl", module: curl },
57
+ { label: "HTML", key: "html", module: xml },
58
+ { label: "XML", key: "xml", module: xml },
59
+ ];
60
+
61
+ export default registry;
@@ -0,0 +1,69 @@
1
+ @layer base {
2
+ @import url("https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,600;0,700;1,600;1,700&display=swap");
3
+ }
4
+
5
+ @layer components {
6
+ .hljs {
7
+ background: var(--syntax-black);
8
+ color: var(--syntax-light-grey);
9
+ }
10
+
11
+ .hljs-emphasis {
12
+ @apply italic;
13
+ }
14
+
15
+ .hljs-strong {
16
+ @apply font-bold;
17
+ }
18
+
19
+ .hljs-comment,
20
+ .hljs-quote {
21
+ color: var(--syntax-dark-grey);
22
+ }
23
+
24
+ .hljs-variable,
25
+ .hljs-template-variable,
26
+ .hljs-tag,
27
+ .hljs-name,
28
+ .hljs-selector-id,
29
+ .hljs-selector-class,
30
+ .hljs-regexp,
31
+ .hljs-deletion {
32
+ color: var(--syntax-red);
33
+ }
34
+
35
+ .hljs-number,
36
+ .hljs-built_in,
37
+ .hljs-literal,
38
+ .hljs-type,
39
+ .hljs-params,
40
+ .hljs-meta,
41
+ .hljs-link {
42
+ color: var(--syntax-orange);
43
+ }
44
+
45
+ .hljs-attribute {
46
+ color: var(--syntax-yellow);
47
+ }
48
+
49
+ .hljs-string,
50
+ .hljs-symbol,
51
+ .hljs-bullet,
52
+ .hljs-addition {
53
+ color: var(--syntax-green);
54
+ }
55
+
56
+ .hljs-title,
57
+ .hljs-section {
58
+ color: var(--syntax-blue);
59
+ }
60
+
61
+ .hljs-keyword,
62
+ .hljs-selector-tag {
63
+ color: var(--syntax-lilac);
64
+ }
65
+
66
+ .hljs-subst {
67
+ color: var(--syntax-mid-grey);
68
+ }
69
+ }