ably-ui 5.0.0.dev.bf26560 → 5.0.0.dev.d3162ab

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/ably_ui/core/code/component.css +0 -2
  3. data/lib/ably_ui/core/code/component.js +1 -7468
  4. data/lib/ably_ui/core/connect_state_wrapper/component.js +1 -22
  5. data/lib/ably_ui/core/contact_footer/component.css +0 -2
  6. data/lib/ably_ui/core/contact_footer/component.js +1 -211
  7. data/lib/ably_ui/core/cookie_message/component.css +0 -2
  8. data/lib/ably_ui/core/cookie_message/component.js +1 -82
  9. data/lib/ably_ui/core/feature_footer/component.css +0 -2
  10. data/lib/ably_ui/core/feature_footer/component.js +1 -211
  11. data/lib/ably_ui/core/featured_link/component.css +0 -2
  12. data/lib/ably_ui/core/featured_link/component.js +1 -82
  13. data/lib/ably_ui/core/flash/component.css +0 -2
  14. data/lib/ably_ui/core/flash/component.js +1 -82
  15. data/lib/ably_ui/core/footer/component.css +0 -2
  16. data/lib/ably_ui/core/footer/component.js +1 -82
  17. data/lib/ably_ui/core/icon/component.js +1 -22
  18. data/lib/ably_ui/core/logo/component.js +1 -22
  19. data/lib/ably_ui/core/meganav/component.css +0 -2
  20. data/lib/ably_ui/core/meganav/component.js +1 -1857
  21. data/lib/ably_ui/core/meganav_blog_posts_list/component.js +1 -1934
  22. data/lib/ably_ui/core/meganav_content_developers/component.js +1 -22
  23. data/lib/ably_ui/core/meganav_content_platform/component.js +1 -22
  24. data/lib/ably_ui/core/meganav_content_use_cases/component.js +1 -22
  25. data/lib/ably_ui/core/meganav_content_why_ably/component.js +1 -22
  26. data/lib/ably_ui/core/meganav_control/component.js +1 -208
  27. data/lib/ably_ui/core/meganav_control_mobile_dropdown/component.js +1 -975
  28. data/lib/ably_ui/core/meganav_control_mobile_panel_close/component.js +1 -142
  29. data/lib/ably_ui/core/meganav_control_mobile_panel_open/component.js +1 -170
  30. data/lib/ably_ui/core/meganav_items_desktop/component.js +1 -22
  31. data/lib/ably_ui/core/meganav_items_mobile/component.js +1 -22
  32. data/lib/ably_ui/core/meganav_items_signed_in/component.js +1 -22
  33. data/lib/ably_ui/core/notice/component.css +0 -2
  34. data/lib/ably_ui/core/notice/component.js +2 -4613
  35. data/lib/ably_ui/core/showcase/component.css +0 -2
  36. data/lib/ably_ui/core/showcase/component.js +1 -343
  37. data/lib/ably_ui/core/sign_out_link/component.js +1 -22
  38. data/lib/ably_ui/core/slider/component.css +0 -2
  39. data/lib/ably_ui/core/slider/component.js +1 -38
  40. data/lib/ably_ui/core/uptime/component.css +0 -2
  41. data/lib/ably_ui/core/uptime/component.js +1 -82
  42. data/lib/ably_ui/version.rb +1 -1
  43. metadata +1 -1
@@ -1,1857 +1 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else if(typeof exports === 'object')
7
- exports["AblyUi"] = factory();
8
- else
9
- root["AblyUi"] = root["AblyUi"] || {}, root["AblyUi"]["Core"] = root["AblyUi"]["Core"] || {}, root["AblyUi"]["Core"]["Meganav"] = factory();
10
- })(this, function() {
11
- return /******/ (() => { // webpackBootstrap
12
- /******/ var __webpack_modules__ = ({
13
-
14
- /***/ "./src/core/MeganavControl/component.js":
15
- /*!**********************************************!*\
16
- !*** ./src/core/MeganavControl/component.js ***!
17
- \**********************************************/
18
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
19
-
20
- "use strict";
21
- __webpack_require__.r(__webpack_exports__);
22
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
24
- /* harmony export */ });
25
- /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
26
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
27
-
28
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
-
30
- 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); }
31
-
32
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
33
-
34
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
35
-
36
- 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; }
37
-
38
-
39
-
40
- var MeganavControl = function MeganavControl() {
41
- var controls = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-control"));
42
- var panels = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-panel"));
43
- var mdBreakpoint = getComputedStyle(document.documentElement).getPropertyValue("--bp-md");
44
-
45
- var hoverEnabled = function hoverEnabled() {
46
- return window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: ".concat(mdBreakpoint, ")")).matches;
47
- };
48
-
49
- var controlsHaveFocus = function controlsHaveFocus() {
50
- return controls.some(function (control) {
51
- return control === document.activeElement;
52
- });
53
- };
54
-
55
- var hover = function hover(control, panel, open) {
56
- if (hoverEnabled() && !controlsHaveFocus()) {
57
- var _panel$classList;
58
-
59
- var classes = ["invisible", "visible"];
60
-
61
- (_panel$classList = panel.classList).replace.apply(_panel$classList, _toConsumableArray(open ? classes : classes.reverse()));
62
-
63
- control.setAttribute("aria-expanded", open);
64
- }
65
- };
66
-
67
- var mouseenterHandler = function mouseenterHandler(control, panel) {
68
- return function () {
69
- return hover(control, panel, true);
70
- };
71
- };
72
-
73
- var mouseleaveHandler = function mouseleaveHandler(control, panel) {
74
- return function () {
75
- return hover(control, panel, false);
76
- };
77
- };
78
-
79
- var clickHandler = function clickHandler(control, panel) {
80
- return function () {
81
- controls.forEach(function (node) {
82
- return node !== control && node.setAttribute("aria-expanded", false);
83
- });
84
- panels.forEach(function (node) {
85
- return node !== panel && node.classList.replace("visible", "invisible");
86
- });
87
- var ariaExpanded = control.getAttribute("aria-expanded");
88
-
89
- if (ariaExpanded) {
90
- control.setAttribute("aria-expanded", true);
91
- panel.classList.replace("invisible", "visible");
92
- } else {
93
- control.setAttribute("aria-expanded", false);
94
- panel.classList.replace("visible", "invisible");
95
- }
96
- };
97
- };
98
-
99
- return controls.map(function (control) {
100
- var item = control.parentNode;
101
- var panel = document.querySelector("#".concat(control.getAttribute("aria-controls")));
102
- var click = clickHandler(control, panel);
103
- var mouseenter = mouseenterHandler(control, panel);
104
- var mouseleave = mouseleaveHandler(control, panel);
105
- item.addEventListener("mouseenter", mouseenter);
106
- item.addEventListener("mouseleave", mouseleave);
107
- control.addEventListener("click", click);
108
- return [{
109
- teardown: function teardown() {
110
- item.removeEventListener("mouseenter", mouseenter);
111
- item.removeEventListener("mouseleave", mouseleave);
112
- control.removeEventListener("click", click);
113
- },
114
- clear: function clear() {
115
- control.setAttribute("aria-expanded", false);
116
- panel.classList.replace("visible", "invisible");
117
- }
118
- }];
119
- }).flat();
120
- };
121
-
122
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeganavControl);
123
-
124
- /***/ }),
125
-
126
- /***/ "./src/core/MeganavControlMobileDropdown/component.js":
127
- /*!************************************************************!*\
128
- !*** ./src/core/MeganavControlMobileDropdown/component.js ***!
129
- \************************************************************/
130
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
131
-
132
- "use strict";
133
- __webpack_require__.r(__webpack_exports__);
134
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
135
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
136
- /* harmony export */ });
137
- /* harmony import */ var scroll_lock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! scroll-lock */ "./node_modules/scroll-lock/dist/scroll-lock.js");
138
- /* harmony import */ var scroll_lock__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(scroll_lock__WEBPACK_IMPORTED_MODULE_0__);
139
- /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
140
-
141
-
142
-
143
- var MeganavControlMobileDropdown = function MeganavControlMobileDropdown(_ref) {
144
- var clearPanels = _ref.clearPanels;
145
- var control = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown");
146
- var dropdown = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-mobile-dropdown");
147
- var menuIcon = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown-menu");
148
- var closeIcon = (0,_dom_query__WEBPACK_IMPORTED_MODULE_1__.queryId)("meganav-control-mobile-dropdown-close");
149
-
150
- var clickHandler = function clickHandler() {
151
- var ariaExpanded = control.getAttribute("aria-expanded");
152
-
153
- if (ariaExpanded === "false") {
154
- dropdown.classList.replace("invisible", "visible");
155
- control.setAttribute("aria-expanded", true);
156
- scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().disablePageScroll();
157
- } else {
158
- dropdown.classList.replace("visible", "invisible");
159
- control.setAttribute("aria-expanded", false);
160
- scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
161
- clearPanels();
162
- }
163
-
164
- menuIcon.classList.toggle("hidden");
165
- closeIcon.classList.toggle("hidden");
166
- };
167
-
168
- control.addEventListener("click", clickHandler);
169
- return {
170
- teardown: function teardown() {
171
- control.removeEventListener("click", clickHandler);
172
- scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
173
- },
174
- clear: function clear() {
175
- dropdown.classList.replace("visible", "invisible");
176
- control.setAttribute("aria-expanded", false);
177
- menuIcon.classList.remove("hidden");
178
- closeIcon.classList.add("hidden");
179
- scroll_lock__WEBPACK_IMPORTED_MODULE_0___default().enablePageScroll();
180
- }
181
- };
182
- };
183
-
184
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeganavControlMobileDropdown);
185
-
186
- /***/ }),
187
-
188
- /***/ "./src/core/MeganavControlMobilePanelClose/component.js":
189
- /*!**************************************************************!*\
190
- !*** ./src/core/MeganavControlMobilePanelClose/component.js ***!
191
- \**************************************************************/
192
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
193
-
194
- "use strict";
195
- __webpack_require__.r(__webpack_exports__);
196
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
197
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
198
- /* harmony export */ });
199
- /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
200
-
201
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () {
202
- var closeControls = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-control-mobile-panel-close"));
203
- var openControls = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-control-mobile-panel-open"));
204
-
205
- var clickHandler = function clickHandler(btn, openBtn, panel) {
206
- return function () {
207
- btn.setAttribute("aria-expanded", false);
208
- openBtn.setAttribute("aria-expanded", false);
209
- panel.classList.replace("block", "hidden");
210
- panel.style.height = null;
211
- };
212
- };
213
-
214
- return closeControls.map(function (btn) {
215
- var openBtn = openControls.find(function (open) {
216
- return open.getAttribute("aria-controls") === btn.getAttribute("aria-controls");
217
- });
218
- var panel = document.querySelector("#".concat(btn.getAttribute("aria-controls")));
219
- var handler = clickHandler(btn, openBtn, panel);
220
- btn.addEventListener("click", handler);
221
- return {
222
- teardown: function teardown() {
223
- return btn.removeEventListener("click", handler);
224
- },
225
- clear: function clear() {
226
- return btn.setAttribute("aria-expanded", false);
227
- }
228
- };
229
- });
230
- });
231
-
232
- /***/ }),
233
-
234
- /***/ "./src/core/MeganavControlMobilePanelOpen/component.js":
235
- /*!*************************************************************!*\
236
- !*** ./src/core/MeganavControlMobilePanelOpen/component.js ***!
237
- \*************************************************************/
238
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239
-
240
- "use strict";
241
- __webpack_require__.r(__webpack_exports__);
242
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
243
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
244
- /* harmony export */ });
245
- /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
246
- /* harmony import */ var _css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../css */ "./src/core/css.js");
247
-
248
-
249
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (function () {
250
- var closeControls = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-control-mobile-panel-close"));
251
- var openControls = Array.from((0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryIdAll)("meganav-control-mobile-panel-open"));
252
- var dropdown = (0,_dom_query__WEBPACK_IMPORTED_MODULE_0__.queryId)("meganav-mobile-dropdown"); // Height is defined in rem's so to get the pixel value we need to find the fontSize on root
253
-
254
- var meganavHeight = (0,_css__WEBPACK_IMPORTED_MODULE_1__.remsToPixelValue)(getComputedStyle(document.documentElement).getPropertyValue("--ui-meganav-height"));
255
-
256
- var clickHandler = function clickHandler(btn, closeBtn, panel) {
257
- return function () {
258
- btn.setAttribute("aria-expanded", true);
259
- closeBtn.setAttribute("aria-expanded", true);
260
- panel.classList.replace("hidden", "block"); // On devices where we don't have enough space for the panel, set it's height to
261
- // the height of the viewport (minus the meganav height) - this will trigger a scroll.
262
- // Otherwise just set it to the panel height. This handles the case where the ratio of vertical
263
- // space to horizontal is especially high (think tablets, but not only).
264
-
265
- panel.style.height = "".concat(window.innerHeight - meganavHeight > panel.offsetHeight ? panel.offsetHeight : window.innerHeight - meganavHeight, "px");
266
- };
267
- };
268
-
269
- return openControls.map(function (btn) {
270
- var closeBtn = closeControls.find(function (node) {
271
- return node.getAttribute("aria-controls") === btn.getAttribute("aria-controls");
272
- });
273
- var panel = document.querySelector("#".concat(btn.getAttribute("aria-controls")));
274
- var handler = clickHandler(btn, closeBtn, panel);
275
- btn.addEventListener("click", handler);
276
- return {
277
- teardown: function teardown() {
278
- return btn.removeEventListener("click", handler);
279
- },
280
- clear: function clear() {
281
- panel.classList.replace("block", "hidden");
282
- dropdown.classList.remove("ui-meganav-mobile-dropdown-expand");
283
- btn.setAttribute("aria-expanded", false);
284
- panel.style.height = null;
285
- }
286
- };
287
- });
288
- });
289
-
290
- /***/ }),
291
-
292
- /***/ "./src/core/css.js":
293
- /*!*************************!*\
294
- !*** ./src/core/css.js ***!
295
- \*************************/
296
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
297
-
298
- "use strict";
299
- __webpack_require__.r(__webpack_exports__);
300
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
301
- /* harmony export */ "remsToPixelValue": () => (/* binding */ remsToPixelValue)
302
- /* harmony export */ });
303
- var remsToPixelValue = function remsToPixelValue(remString) {
304
- return parseFloat(remString) * parseFloat(getComputedStyle(document.documentElement).fontSize);
305
- };
306
-
307
- /***/ }),
308
-
309
- /***/ "./src/core/dom-query.js":
310
- /*!*******************************!*\
311
- !*** ./src/core/dom-query.js ***!
312
- \*******************************/
313
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
314
-
315
- "use strict";
316
- __webpack_require__.r(__webpack_exports__);
317
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
318
- /* harmony export */ "queryId": () => (/* binding */ queryId),
319
- /* harmony export */ "queryIdAll": () => (/* binding */ queryIdAll)
320
- /* harmony export */ });
321
- var queryId = function queryId(val) {
322
- var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
323
- return root.querySelector("[data-id=".concat(val, "]"));
324
- };
325
- var queryIdAll = function queryIdAll(val) {
326
- var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;
327
- return root.querySelectorAll("[data-id=".concat(val, "]"));
328
- };
329
-
330
- /***/ }),
331
-
332
- /***/ "./node_modules/lodash.throttle/index.js":
333
- /*!***********************************************!*\
334
- !*** ./node_modules/lodash.throttle/index.js ***!
335
- \***********************************************/
336
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
337
-
338
- /**
339
- * lodash (Custom Build) <https://lodash.com/>
340
- * Build: `lodash modularize exports="npm" -o ./`
341
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
342
- * Released under MIT license <https://lodash.com/license>
343
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
344
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
345
- */
346
-
347
- /** Used as the `TypeError` message for "Functions" methods. */
348
- var FUNC_ERROR_TEXT = 'Expected a function';
349
-
350
- /** Used as references for various `Number` constants. */
351
- var NAN = 0 / 0;
352
-
353
- /** `Object#toString` result references. */
354
- var symbolTag = '[object Symbol]';
355
-
356
- /** Used to match leading and trailing whitespace. */
357
- var reTrim = /^\s+|\s+$/g;
358
-
359
- /** Used to detect bad signed hexadecimal string values. */
360
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
361
-
362
- /** Used to detect binary string values. */
363
- var reIsBinary = /^0b[01]+$/i;
364
-
365
- /** Used to detect octal string values. */
366
- var reIsOctal = /^0o[0-7]+$/i;
367
-
368
- /** Built-in method references without a dependency on `root`. */
369
- var freeParseInt = parseInt;
370
-
371
- /** Detect free variable `global` from Node.js. */
372
- var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
373
-
374
- /** Detect free variable `self`. */
375
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
376
-
377
- /** Used as a reference to the global object. */
378
- var root = freeGlobal || freeSelf || Function('return this')();
379
-
380
- /** Used for built-in method references. */
381
- var objectProto = Object.prototype;
382
-
383
- /**
384
- * Used to resolve the
385
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
386
- * of values.
387
- */
388
- var objectToString = objectProto.toString;
389
-
390
- /* Built-in method references for those with the same name as other `lodash` methods. */
391
- var nativeMax = Math.max,
392
- nativeMin = Math.min;
393
-
394
- /**
395
- * Gets the timestamp of the number of milliseconds that have elapsed since
396
- * the Unix epoch (1 January 1970 00:00:00 UTC).
397
- *
398
- * @static
399
- * @memberOf _
400
- * @since 2.4.0
401
- * @category Date
402
- * @returns {number} Returns the timestamp.
403
- * @example
404
- *
405
- * _.defer(function(stamp) {
406
- * console.log(_.now() - stamp);
407
- * }, _.now());
408
- * // => Logs the number of milliseconds it took for the deferred invocation.
409
- */
410
- var now = function() {
411
- return root.Date.now();
412
- };
413
-
414
- /**
415
- * Creates a debounced function that delays invoking `func` until after `wait`
416
- * milliseconds have elapsed since the last time the debounced function was
417
- * invoked. The debounced function comes with a `cancel` method to cancel
418
- * delayed `func` invocations and a `flush` method to immediately invoke them.
419
- * Provide `options` to indicate whether `func` should be invoked on the
420
- * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
421
- * with the last arguments provided to the debounced function. Subsequent
422
- * calls to the debounced function return the result of the last `func`
423
- * invocation.
424
- *
425
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
426
- * invoked on the trailing edge of the timeout only if the debounced function
427
- * is invoked more than once during the `wait` timeout.
428
- *
429
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
430
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
431
- *
432
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
433
- * for details over the differences between `_.debounce` and `_.throttle`.
434
- *
435
- * @static
436
- * @memberOf _
437
- * @since 0.1.0
438
- * @category Function
439
- * @param {Function} func The function to debounce.
440
- * @param {number} [wait=0] The number of milliseconds to delay.
441
- * @param {Object} [options={}] The options object.
442
- * @param {boolean} [options.leading=false]
443
- * Specify invoking on the leading edge of the timeout.
444
- * @param {number} [options.maxWait]
445
- * The maximum time `func` is allowed to be delayed before it's invoked.
446
- * @param {boolean} [options.trailing=true]
447
- * Specify invoking on the trailing edge of the timeout.
448
- * @returns {Function} Returns the new debounced function.
449
- * @example
450
- *
451
- * // Avoid costly calculations while the window size is in flux.
452
- * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
453
- *
454
- * // Invoke `sendMail` when clicked, debouncing subsequent calls.
455
- * jQuery(element).on('click', _.debounce(sendMail, 300, {
456
- * 'leading': true,
457
- * 'trailing': false
458
- * }));
459
- *
460
- * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
461
- * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
462
- * var source = new EventSource('/stream');
463
- * jQuery(source).on('message', debounced);
464
- *
465
- * // Cancel the trailing debounced invocation.
466
- * jQuery(window).on('popstate', debounced.cancel);
467
- */
468
- function debounce(func, wait, options) {
469
- var lastArgs,
470
- lastThis,
471
- maxWait,
472
- result,
473
- timerId,
474
- lastCallTime,
475
- lastInvokeTime = 0,
476
- leading = false,
477
- maxing = false,
478
- trailing = true;
479
-
480
- if (typeof func != 'function') {
481
- throw new TypeError(FUNC_ERROR_TEXT);
482
- }
483
- wait = toNumber(wait) || 0;
484
- if (isObject(options)) {
485
- leading = !!options.leading;
486
- maxing = 'maxWait' in options;
487
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
488
- trailing = 'trailing' in options ? !!options.trailing : trailing;
489
- }
490
-
491
- function invokeFunc(time) {
492
- var args = lastArgs,
493
- thisArg = lastThis;
494
-
495
- lastArgs = lastThis = undefined;
496
- lastInvokeTime = time;
497
- result = func.apply(thisArg, args);
498
- return result;
499
- }
500
-
501
- function leadingEdge(time) {
502
- // Reset any `maxWait` timer.
503
- lastInvokeTime = time;
504
- // Start the timer for the trailing edge.
505
- timerId = setTimeout(timerExpired, wait);
506
- // Invoke the leading edge.
507
- return leading ? invokeFunc(time) : result;
508
- }
509
-
510
- function remainingWait(time) {
511
- var timeSinceLastCall = time - lastCallTime,
512
- timeSinceLastInvoke = time - lastInvokeTime,
513
- result = wait - timeSinceLastCall;
514
-
515
- return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
516
- }
517
-
518
- function shouldInvoke(time) {
519
- var timeSinceLastCall = time - lastCallTime,
520
- timeSinceLastInvoke = time - lastInvokeTime;
521
-
522
- // Either this is the first call, activity has stopped and we're at the
523
- // trailing edge, the system time has gone backwards and we're treating
524
- // it as the trailing edge, or we've hit the `maxWait` limit.
525
- return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
526
- (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
527
- }
528
-
529
- function timerExpired() {
530
- var time = now();
531
- if (shouldInvoke(time)) {
532
- return trailingEdge(time);
533
- }
534
- // Restart the timer.
535
- timerId = setTimeout(timerExpired, remainingWait(time));
536
- }
537
-
538
- function trailingEdge(time) {
539
- timerId = undefined;
540
-
541
- // Only invoke if we have `lastArgs` which means `func` has been
542
- // debounced at least once.
543
- if (trailing && lastArgs) {
544
- return invokeFunc(time);
545
- }
546
- lastArgs = lastThis = undefined;
547
- return result;
548
- }
549
-
550
- function cancel() {
551
- if (timerId !== undefined) {
552
- clearTimeout(timerId);
553
- }
554
- lastInvokeTime = 0;
555
- lastArgs = lastCallTime = lastThis = timerId = undefined;
556
- }
557
-
558
- function flush() {
559
- return timerId === undefined ? result : trailingEdge(now());
560
- }
561
-
562
- function debounced() {
563
- var time = now(),
564
- isInvoking = shouldInvoke(time);
565
-
566
- lastArgs = arguments;
567
- lastThis = this;
568
- lastCallTime = time;
569
-
570
- if (isInvoking) {
571
- if (timerId === undefined) {
572
- return leadingEdge(lastCallTime);
573
- }
574
- if (maxing) {
575
- // Handle invocations in a tight loop.
576
- timerId = setTimeout(timerExpired, wait);
577
- return invokeFunc(lastCallTime);
578
- }
579
- }
580
- if (timerId === undefined) {
581
- timerId = setTimeout(timerExpired, wait);
582
- }
583
- return result;
584
- }
585
- debounced.cancel = cancel;
586
- debounced.flush = flush;
587
- return debounced;
588
- }
589
-
590
- /**
591
- * Creates a throttled function that only invokes `func` at most once per
592
- * every `wait` milliseconds. The throttled function comes with a `cancel`
593
- * method to cancel delayed `func` invocations and a `flush` method to
594
- * immediately invoke them. Provide `options` to indicate whether `func`
595
- * should be invoked on the leading and/or trailing edge of the `wait`
596
- * timeout. The `func` is invoked with the last arguments provided to the
597
- * throttled function. Subsequent calls to the throttled function return the
598
- * result of the last `func` invocation.
599
- *
600
- * **Note:** If `leading` and `trailing` options are `true`, `func` is
601
- * invoked on the trailing edge of the timeout only if the throttled function
602
- * is invoked more than once during the `wait` timeout.
603
- *
604
- * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
605
- * until to the next tick, similar to `setTimeout` with a timeout of `0`.
606
- *
607
- * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
608
- * for details over the differences between `_.throttle` and `_.debounce`.
609
- *
610
- * @static
611
- * @memberOf _
612
- * @since 0.1.0
613
- * @category Function
614
- * @param {Function} func The function to throttle.
615
- * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
616
- * @param {Object} [options={}] The options object.
617
- * @param {boolean} [options.leading=true]
618
- * Specify invoking on the leading edge of the timeout.
619
- * @param {boolean} [options.trailing=true]
620
- * Specify invoking on the trailing edge of the timeout.
621
- * @returns {Function} Returns the new throttled function.
622
- * @example
623
- *
624
- * // Avoid excessively updating the position while scrolling.
625
- * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
626
- *
627
- * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
628
- * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
629
- * jQuery(element).on('click', throttled);
630
- *
631
- * // Cancel the trailing throttled invocation.
632
- * jQuery(window).on('popstate', throttled.cancel);
633
- */
634
- function throttle(func, wait, options) {
635
- var leading = true,
636
- trailing = true;
637
-
638
- if (typeof func != 'function') {
639
- throw new TypeError(FUNC_ERROR_TEXT);
640
- }
641
- if (isObject(options)) {
642
- leading = 'leading' in options ? !!options.leading : leading;
643
- trailing = 'trailing' in options ? !!options.trailing : trailing;
644
- }
645
- return debounce(func, wait, {
646
- 'leading': leading,
647
- 'maxWait': wait,
648
- 'trailing': trailing
649
- });
650
- }
651
-
652
- /**
653
- * Checks if `value` is the
654
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
655
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
656
- *
657
- * @static
658
- * @memberOf _
659
- * @since 0.1.0
660
- * @category Lang
661
- * @param {*} value The value to check.
662
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
663
- * @example
664
- *
665
- * _.isObject({});
666
- * // => true
667
- *
668
- * _.isObject([1, 2, 3]);
669
- * // => true
670
- *
671
- * _.isObject(_.noop);
672
- * // => true
673
- *
674
- * _.isObject(null);
675
- * // => false
676
- */
677
- function isObject(value) {
678
- var type = typeof value;
679
- return !!value && (type == 'object' || type == 'function');
680
- }
681
-
682
- /**
683
- * Checks if `value` is object-like. A value is object-like if it's not `null`
684
- * and has a `typeof` result of "object".
685
- *
686
- * @static
687
- * @memberOf _
688
- * @since 4.0.0
689
- * @category Lang
690
- * @param {*} value The value to check.
691
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
692
- * @example
693
- *
694
- * _.isObjectLike({});
695
- * // => true
696
- *
697
- * _.isObjectLike([1, 2, 3]);
698
- * // => true
699
- *
700
- * _.isObjectLike(_.noop);
701
- * // => false
702
- *
703
- * _.isObjectLike(null);
704
- * // => false
705
- */
706
- function isObjectLike(value) {
707
- return !!value && typeof value == 'object';
708
- }
709
-
710
- /**
711
- * Checks if `value` is classified as a `Symbol` primitive or object.
712
- *
713
- * @static
714
- * @memberOf _
715
- * @since 4.0.0
716
- * @category Lang
717
- * @param {*} value The value to check.
718
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
719
- * @example
720
- *
721
- * _.isSymbol(Symbol.iterator);
722
- * // => true
723
- *
724
- * _.isSymbol('abc');
725
- * // => false
726
- */
727
- function isSymbol(value) {
728
- return typeof value == 'symbol' ||
729
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
730
- }
731
-
732
- /**
733
- * Converts `value` to a number.
734
- *
735
- * @static
736
- * @memberOf _
737
- * @since 4.0.0
738
- * @category Lang
739
- * @param {*} value The value to process.
740
- * @returns {number} Returns the number.
741
- * @example
742
- *
743
- * _.toNumber(3.2);
744
- * // => 3.2
745
- *
746
- * _.toNumber(Number.MIN_VALUE);
747
- * // => 5e-324
748
- *
749
- * _.toNumber(Infinity);
750
- * // => Infinity
751
- *
752
- * _.toNumber('3.2');
753
- * // => 3.2
754
- */
755
- function toNumber(value) {
756
- if (typeof value == 'number') {
757
- return value;
758
- }
759
- if (isSymbol(value)) {
760
- return NAN;
761
- }
762
- if (isObject(value)) {
763
- var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
764
- value = isObject(other) ? (other + '') : other;
765
- }
766
- if (typeof value != 'string') {
767
- return value === 0 ? value : +value;
768
- }
769
- value = value.replace(reTrim, '');
770
- var isBinary = reIsBinary.test(value);
771
- return (isBinary || reIsOctal.test(value))
772
- ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
773
- : (reIsBadHex.test(value) ? NAN : +value);
774
- }
775
-
776
- module.exports = throttle;
777
-
778
-
779
- /***/ }),
780
-
781
- /***/ "./src/core/Meganav/component.css":
782
- /*!****************************************!*\
783
- !*** ./src/core/Meganav/component.css ***!
784
- \****************************************/
785
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
786
-
787
- "use strict";
788
- __webpack_require__.r(__webpack_exports__);
789
- // extracted by mini-css-extract-plugin
790
-
791
-
792
- /***/ }),
793
-
794
- /***/ "./node_modules/scroll-lock/dist/scroll-lock.js":
795
- /*!******************************************************!*\
796
- !*** ./node_modules/scroll-lock/dist/scroll-lock.js ***!
797
- \******************************************************/
798
- /***/ (function(module) {
799
-
800
- (function webpackUniversalModuleDefinition(root, factory) {
801
- if(true)
802
- module.exports = factory();
803
- else {}
804
- })(this, function() {
805
- return /******/ (function(modules) { // webpackBootstrap
806
- /******/ // The module cache
807
- /******/ var installedModules = {};
808
- /******/
809
- /******/ // The require function
810
- /******/ function __nested_webpack_require_543__(moduleId) {
811
- /******/
812
- /******/ // Check if module is in cache
813
- /******/ if(installedModules[moduleId]) {
814
- /******/ return installedModules[moduleId].exports;
815
- /******/ }
816
- /******/ // Create a new module (and put it into the cache)
817
- /******/ var module = installedModules[moduleId] = {
818
- /******/ i: moduleId,
819
- /******/ l: false,
820
- /******/ exports: {}
821
- /******/ };
822
- /******/
823
- /******/ // Execute the module function
824
- /******/ modules[moduleId].call(module.exports, module, module.exports, __nested_webpack_require_543__);
825
- /******/
826
- /******/ // Flag the module as loaded
827
- /******/ module.l = true;
828
- /******/
829
- /******/ // Return the exports of the module
830
- /******/ return module.exports;
831
- /******/ }
832
- /******/
833
- /******/
834
- /******/ // expose the modules object (__webpack_modules__)
835
- /******/ __nested_webpack_require_543__.m = modules;
836
- /******/
837
- /******/ // expose the module cache
838
- /******/ __nested_webpack_require_543__.c = installedModules;
839
- /******/
840
- /******/ // define getter function for harmony exports
841
- /******/ __nested_webpack_require_543__.d = function(exports, name, getter) {
842
- /******/ if(!__nested_webpack_require_543__.o(exports, name)) {
843
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
844
- /******/ }
845
- /******/ };
846
- /******/
847
- /******/ // define __esModule on exports
848
- /******/ __nested_webpack_require_543__.r = function(exports) {
849
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
850
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
851
- /******/ }
852
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
853
- /******/ };
854
- /******/
855
- /******/ // create a fake namespace object
856
- /******/ // mode & 1: value is a module id, require it
857
- /******/ // mode & 2: merge all properties of value into the ns
858
- /******/ // mode & 4: return value when already ns object
859
- /******/ // mode & 8|1: behave like require
860
- /******/ __nested_webpack_require_543__.t = function(value, mode) {
861
- /******/ if(mode & 1) value = __nested_webpack_require_543__(value);
862
- /******/ if(mode & 8) return value;
863
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
864
- /******/ var ns = Object.create(null);
865
- /******/ __nested_webpack_require_543__.r(ns);
866
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
867
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __nested_webpack_require_543__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
868
- /******/ return ns;
869
- /******/ };
870
- /******/
871
- /******/ // getDefaultExport function for compatibility with non-harmony modules
872
- /******/ __nested_webpack_require_543__.n = function(module) {
873
- /******/ var getter = module && module.__esModule ?
874
- /******/ function getDefault() { return module['default']; } :
875
- /******/ function getModuleExports() { return module; };
876
- /******/ __nested_webpack_require_543__.d(getter, 'a', getter);
877
- /******/ return getter;
878
- /******/ };
879
- /******/
880
- /******/ // Object.prototype.hasOwnProperty.call
881
- /******/ __nested_webpack_require_543__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
882
- /******/
883
- /******/ // __webpack_public_path__
884
- /******/ __nested_webpack_require_543__.p = "";
885
- /******/
886
- /******/
887
- /******/ // Load entry module and return exports
888
- /******/ return __nested_webpack_require_543__(__nested_webpack_require_543__.s = 0);
889
- /******/ })
890
- /************************************************************************/
891
- /******/ ([
892
- /* 0 */
893
- /***/ (function(module, __webpack_exports__, __nested_webpack_require_4019__) {
894
-
895
- "use strict";
896
- __nested_webpack_require_4019__.r(__webpack_exports__);
897
-
898
- // CONCATENATED MODULE: ./src/tools.js
899
- var argumentAsArray = function argumentAsArray(argument) {
900
- return Array.isArray(argument) ? argument : [argument];
901
- };
902
- var isElement = function isElement(target) {
903
- return target instanceof Node;
904
- };
905
- var isElementList = function isElementList(nodeList) {
906
- return nodeList instanceof NodeList;
907
- };
908
- var eachNode = function eachNode(nodeList, callback) {
909
- if (nodeList && callback) {
910
- nodeList = isElementList(nodeList) ? nodeList : [nodeList];
911
-
912
- for (var i = 0; i < nodeList.length; i++) {
913
- if (callback(nodeList[i], i, nodeList.length) === true) {
914
- break;
915
- }
916
- }
917
- }
918
- };
919
- var throwError = function throwError(message) {
920
- return console.error("[scroll-lock] ".concat(message));
921
- };
922
- var arrayAsSelector = function arrayAsSelector(array) {
923
- if (Array.isArray(array)) {
924
- var selector = array.join(', ');
925
- return selector;
926
- }
927
- };
928
- var nodeListAsArray = function nodeListAsArray(nodeList) {
929
- var nodes = [];
930
- eachNode(nodeList, function (node) {
931
- return nodes.push(node);
932
- });
933
- return nodes;
934
- };
935
- var findParentBySelector = function findParentBySelector($el, selector) {
936
- var self = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
937
- var $root = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document;
938
-
939
- if (self && nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) !== -1) {
940
- return $el;
941
- }
942
-
943
- while (($el = $el.parentElement) && nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) === -1) {
944
- ;
945
- }
946
-
947
- return $el;
948
- };
949
- var elementHasSelector = function elementHasSelector($el, selector) {
950
- var $root = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document;
951
- var has = nodeListAsArray($root.querySelectorAll(selector)).indexOf($el) !== -1;
952
- return has;
953
- };
954
- var elementHasOverflowHidden = function elementHasOverflowHidden($el) {
955
- if ($el) {
956
- var computedStyle = getComputedStyle($el);
957
- var overflowIsHidden = computedStyle.overflow === 'hidden';
958
- return overflowIsHidden;
959
- }
960
- };
961
- var elementScrollTopOnStart = function elementScrollTopOnStart($el) {
962
- if ($el) {
963
- if (elementHasOverflowHidden($el)) {
964
- return true;
965
- }
966
-
967
- var scrollTop = $el.scrollTop;
968
- return scrollTop <= 0;
969
- }
970
- };
971
- var elementScrollTopOnEnd = function elementScrollTopOnEnd($el) {
972
- if ($el) {
973
- if (elementHasOverflowHidden($el)) {
974
- return true;
975
- }
976
-
977
- var scrollTop = $el.scrollTop;
978
- var scrollHeight = $el.scrollHeight;
979
- var scrollTopWithHeight = scrollTop + $el.offsetHeight;
980
- return scrollTopWithHeight >= scrollHeight;
981
- }
982
- };
983
- var elementScrollLeftOnStart = function elementScrollLeftOnStart($el) {
984
- if ($el) {
985
- if (elementHasOverflowHidden($el)) {
986
- return true;
987
- }
988
-
989
- var scrollLeft = $el.scrollLeft;
990
- return scrollLeft <= 0;
991
- }
992
- };
993
- var elementScrollLeftOnEnd = function elementScrollLeftOnEnd($el) {
994
- if ($el) {
995
- if (elementHasOverflowHidden($el)) {
996
- return true;
997
- }
998
-
999
- var scrollLeft = $el.scrollLeft;
1000
- var scrollWidth = $el.scrollWidth;
1001
- var scrollLeftWithWidth = scrollLeft + $el.offsetWidth;
1002
- return scrollLeftWithWidth >= scrollWidth;
1003
- }
1004
- };
1005
- var elementIsScrollableField = function elementIsScrollableField($el) {
1006
- var selector = 'textarea, [contenteditable="true"]';
1007
- return elementHasSelector($el, selector);
1008
- };
1009
- var elementIsInputRange = function elementIsInputRange($el) {
1010
- var selector = 'input[type="range"]';
1011
- return elementHasSelector($el, selector);
1012
- };
1013
- // CONCATENATED MODULE: ./src/scroll-lock.js
1014
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "disablePageScroll", function() { return disablePageScroll; });
1015
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "enablePageScroll", function() { return enablePageScroll; });
1016
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getScrollState", function() { return getScrollState; });
1017
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "clearQueueScrollLocks", function() { return clearQueueScrollLocks; });
1018
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getTargetScrollBarWidth", function() { return scroll_lock_getTargetScrollBarWidth; });
1019
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getCurrentTargetScrollBarWidth", function() { return scroll_lock_getCurrentTargetScrollBarWidth; });
1020
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getPageScrollBarWidth", function() { return getPageScrollBarWidth; });
1021
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "getCurrentPageScrollBarWidth", function() { return getCurrentPageScrollBarWidth; });
1022
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addScrollableTarget", function() { return scroll_lock_addScrollableTarget; });
1023
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeScrollableTarget", function() { return scroll_lock_removeScrollableTarget; });
1024
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addScrollableSelector", function() { return scroll_lock_addScrollableSelector; });
1025
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeScrollableSelector", function() { return scroll_lock_removeScrollableSelector; });
1026
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addLockableTarget", function() { return scroll_lock_addLockableTarget; });
1027
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addLockableSelector", function() { return scroll_lock_addLockableSelector; });
1028
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "setFillGapMethod", function() { return scroll_lock_setFillGapMethod; });
1029
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addFillGapTarget", function() { return scroll_lock_addFillGapTarget; });
1030
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeFillGapTarget", function() { return scroll_lock_removeFillGapTarget; });
1031
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "addFillGapSelector", function() { return scroll_lock_addFillGapSelector; });
1032
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "removeFillGapSelector", function() { return scroll_lock_removeFillGapSelector; });
1033
- /* harmony export (binding) */ __nested_webpack_require_4019__.d(__webpack_exports__, "refillGaps", function() { return refillGaps; });
1034
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
1035
-
1036
- 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; }
1037
-
1038
-
1039
- var FILL_GAP_AVAILABLE_METHODS = ['padding', 'margin', 'width', 'max-width', 'none'];
1040
- var TOUCH_DIRECTION_DETECT_OFFSET = 3;
1041
- var state = {
1042
- scroll: true,
1043
- queue: 0,
1044
- scrollableSelectors: ['[data-scroll-lock-scrollable]'],
1045
- lockableSelectors: ['body', '[data-scroll-lock-lockable]'],
1046
- fillGapSelectors: ['body', '[data-scroll-lock-fill-gap]', '[data-scroll-lock-lockable]'],
1047
- fillGapMethod: FILL_GAP_AVAILABLE_METHODS[0],
1048
- //
1049
- startTouchY: 0,
1050
- startTouchX: 0
1051
- };
1052
- var disablePageScroll = function disablePageScroll(target) {
1053
- if (state.queue <= 0) {
1054
- state.scroll = false;
1055
- scroll_lock_hideLockableOverflow();
1056
- fillGaps();
1057
- }
1058
-
1059
- scroll_lock_addScrollableTarget(target);
1060
- state.queue++;
1061
- };
1062
- var enablePageScroll = function enablePageScroll(target) {
1063
- state.queue > 0 && state.queue--;
1064
-
1065
- if (state.queue <= 0) {
1066
- state.scroll = true;
1067
- scroll_lock_showLockableOverflow();
1068
- unfillGaps();
1069
- }
1070
-
1071
- scroll_lock_removeScrollableTarget(target);
1072
- };
1073
- var getScrollState = function getScrollState() {
1074
- return state.scroll;
1075
- };
1076
- var clearQueueScrollLocks = function clearQueueScrollLocks() {
1077
- state.queue = 0;
1078
- };
1079
- var scroll_lock_getTargetScrollBarWidth = function getTargetScrollBarWidth($target) {
1080
- var onlyExists = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1081
-
1082
- if (isElement($target)) {
1083
- var currentOverflowYProperty = $target.style.overflowY;
1084
-
1085
- if (onlyExists) {
1086
- if (!getScrollState()) {
1087
- $target.style.overflowY = $target.getAttribute('data-scroll-lock-saved-overflow-y-property');
1088
- }
1089
- } else {
1090
- $target.style.overflowY = 'scroll';
1091
- }
1092
-
1093
- var width = scroll_lock_getCurrentTargetScrollBarWidth($target);
1094
- $target.style.overflowY = currentOverflowYProperty;
1095
- return width;
1096
- } else {
1097
- return 0;
1098
- }
1099
- };
1100
- var scroll_lock_getCurrentTargetScrollBarWidth = function getCurrentTargetScrollBarWidth($target) {
1101
- if (isElement($target)) {
1102
- if ($target === document.body) {
1103
- var documentWidth = document.documentElement.clientWidth;
1104
- var windowWidth = window.innerWidth;
1105
- var currentWidth = windowWidth - documentWidth;
1106
- return currentWidth;
1107
- } else {
1108
- var borderLeftWidthCurrentProperty = $target.style.borderLeftWidth;
1109
- var borderRightWidthCurrentProperty = $target.style.borderRightWidth;
1110
- $target.style.borderLeftWidth = '0px';
1111
- $target.style.borderRightWidth = '0px';
1112
-
1113
- var _currentWidth = $target.offsetWidth - $target.clientWidth;
1114
-
1115
- $target.style.borderLeftWidth = borderLeftWidthCurrentProperty;
1116
- $target.style.borderRightWidth = borderRightWidthCurrentProperty;
1117
- return _currentWidth;
1118
- }
1119
- } else {
1120
- return 0;
1121
- }
1122
- };
1123
- var getPageScrollBarWidth = function getPageScrollBarWidth() {
1124
- var onlyExists = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1125
- return scroll_lock_getTargetScrollBarWidth(document.body, onlyExists);
1126
- };
1127
- var getCurrentPageScrollBarWidth = function getCurrentPageScrollBarWidth() {
1128
- return scroll_lock_getCurrentTargetScrollBarWidth(document.body);
1129
- };
1130
- var scroll_lock_addScrollableTarget = function addScrollableTarget(target) {
1131
- if (target) {
1132
- var targets = argumentAsArray(target);
1133
- targets.map(function ($targets) {
1134
- eachNode($targets, function ($target) {
1135
- if (isElement($target)) {
1136
- $target.setAttribute('data-scroll-lock-scrollable', '');
1137
- } else {
1138
- throwError("\"".concat($target, "\" is not a Element."));
1139
- }
1140
- });
1141
- });
1142
- }
1143
- };
1144
- var scroll_lock_removeScrollableTarget = function removeScrollableTarget(target) {
1145
- if (target) {
1146
- var targets = argumentAsArray(target);
1147
- targets.map(function ($targets) {
1148
- eachNode($targets, function ($target) {
1149
- if (isElement($target)) {
1150
- $target.removeAttribute('data-scroll-lock-scrollable');
1151
- } else {
1152
- throwError("\"".concat($target, "\" is not a Element."));
1153
- }
1154
- });
1155
- });
1156
- }
1157
- };
1158
- var scroll_lock_addScrollableSelector = function addScrollableSelector(selector) {
1159
- if (selector) {
1160
- var selectors = argumentAsArray(selector);
1161
- selectors.map(function (selector) {
1162
- state.scrollableSelectors.push(selector);
1163
- });
1164
- }
1165
- };
1166
- var scroll_lock_removeScrollableSelector = function removeScrollableSelector(selector) {
1167
- if (selector) {
1168
- var selectors = argumentAsArray(selector);
1169
- selectors.map(function (selector) {
1170
- state.scrollableSelectors = state.scrollableSelectors.filter(function (sSelector) {
1171
- return sSelector !== selector;
1172
- });
1173
- });
1174
- }
1175
- };
1176
- var scroll_lock_addLockableTarget = function addLockableTarget(target) {
1177
- if (target) {
1178
- var targets = argumentAsArray(target);
1179
- targets.map(function ($targets) {
1180
- eachNode($targets, function ($target) {
1181
- if (isElement($target)) {
1182
- $target.setAttribute('data-scroll-lock-lockable', '');
1183
- } else {
1184
- throwError("\"".concat($target, "\" is not a Element."));
1185
- }
1186
- });
1187
- });
1188
-
1189
- if (!getScrollState()) {
1190
- scroll_lock_hideLockableOverflow();
1191
- }
1192
- }
1193
- };
1194
- var scroll_lock_addLockableSelector = function addLockableSelector(selector) {
1195
- if (selector) {
1196
- var selectors = argumentAsArray(selector);
1197
- selectors.map(function (selector) {
1198
- state.lockableSelectors.push(selector);
1199
- });
1200
-
1201
- if (!getScrollState()) {
1202
- scroll_lock_hideLockableOverflow();
1203
- }
1204
-
1205
- scroll_lock_addFillGapSelector(selector);
1206
- }
1207
- };
1208
- var scroll_lock_setFillGapMethod = function setFillGapMethod(method) {
1209
- if (method) {
1210
- if (FILL_GAP_AVAILABLE_METHODS.indexOf(method) !== -1) {
1211
- state.fillGapMethod = method;
1212
- refillGaps();
1213
- } else {
1214
- var methods = FILL_GAP_AVAILABLE_METHODS.join(', ');
1215
- throwError("\"".concat(method, "\" method is not available!\nAvailable fill gap methods: ").concat(methods, "."));
1216
- }
1217
- }
1218
- };
1219
- var scroll_lock_addFillGapTarget = function addFillGapTarget(target) {
1220
- if (target) {
1221
- var targets = argumentAsArray(target);
1222
- targets.map(function ($targets) {
1223
- eachNode($targets, function ($target) {
1224
- if (isElement($target)) {
1225
- $target.setAttribute('data-scroll-lock-fill-gap', '');
1226
-
1227
- if (!state.scroll) {
1228
- scroll_lock_fillGapTarget($target);
1229
- }
1230
- } else {
1231
- throwError("\"".concat($target, "\" is not a Element."));
1232
- }
1233
- });
1234
- });
1235
- }
1236
- };
1237
- var scroll_lock_removeFillGapTarget = function removeFillGapTarget(target) {
1238
- if (target) {
1239
- var targets = argumentAsArray(target);
1240
- targets.map(function ($targets) {
1241
- eachNode($targets, function ($target) {
1242
- if (isElement($target)) {
1243
- $target.removeAttribute('data-scroll-lock-fill-gap');
1244
-
1245
- if (!state.scroll) {
1246
- scroll_lock_unfillGapTarget($target);
1247
- }
1248
- } else {
1249
- throwError("\"".concat($target, "\" is not a Element."));
1250
- }
1251
- });
1252
- });
1253
- }
1254
- };
1255
- var scroll_lock_addFillGapSelector = function addFillGapSelector(selector) {
1256
- if (selector) {
1257
- var selectors = argumentAsArray(selector);
1258
- selectors.map(function (selector) {
1259
- if (state.fillGapSelectors.indexOf(selector) === -1) {
1260
- state.fillGapSelectors.push(selector);
1261
-
1262
- if (!state.scroll) {
1263
- scroll_lock_fillGapSelector(selector);
1264
- }
1265
- }
1266
- });
1267
- }
1268
- };
1269
- var scroll_lock_removeFillGapSelector = function removeFillGapSelector(selector) {
1270
- if (selector) {
1271
- var selectors = argumentAsArray(selector);
1272
- selectors.map(function (selector) {
1273
- state.fillGapSelectors = state.fillGapSelectors.filter(function (fSelector) {
1274
- return fSelector !== selector;
1275
- });
1276
-
1277
- if (!state.scroll) {
1278
- scroll_lock_unfillGapSelector(selector);
1279
- }
1280
- });
1281
- }
1282
- };
1283
- var refillGaps = function refillGaps() {
1284
- if (!state.scroll) {
1285
- fillGaps();
1286
- }
1287
- };
1288
-
1289
- var scroll_lock_hideLockableOverflow = function hideLockableOverflow() {
1290
- var selector = arrayAsSelector(state.lockableSelectors);
1291
- scroll_lock_hideLockableOverflowSelector(selector);
1292
- };
1293
-
1294
- var scroll_lock_showLockableOverflow = function showLockableOverflow() {
1295
- var selector = arrayAsSelector(state.lockableSelectors);
1296
- scroll_lock_showLockableOverflowSelector(selector);
1297
- };
1298
-
1299
- var scroll_lock_hideLockableOverflowSelector = function hideLockableOverflowSelector(selector) {
1300
- var $targets = document.querySelectorAll(selector);
1301
- eachNode($targets, function ($target) {
1302
- scroll_lock_hideLockableOverflowTarget($target);
1303
- });
1304
- };
1305
-
1306
- var scroll_lock_showLockableOverflowSelector = function showLockableOverflowSelector(selector) {
1307
- var $targets = document.querySelectorAll(selector);
1308
- eachNode($targets, function ($target) {
1309
- scroll_lock_showLockableOverflowTarget($target);
1310
- });
1311
- };
1312
-
1313
- var scroll_lock_hideLockableOverflowTarget = function hideLockableOverflowTarget($target) {
1314
- if (isElement($target) && $target.getAttribute('data-scroll-lock-locked') !== 'true') {
1315
- var computedStyle = window.getComputedStyle($target);
1316
- $target.setAttribute('data-scroll-lock-saved-overflow-y-property', computedStyle.overflowY);
1317
- $target.setAttribute('data-scroll-lock-saved-inline-overflow-property', $target.style.overflow);
1318
- $target.setAttribute('data-scroll-lock-saved-inline-overflow-y-property', $target.style.overflowY);
1319
- $target.style.overflow = 'hidden';
1320
- $target.setAttribute('data-scroll-lock-locked', 'true');
1321
- }
1322
- };
1323
-
1324
- var scroll_lock_showLockableOverflowTarget = function showLockableOverflowTarget($target) {
1325
- if (isElement($target) && $target.getAttribute('data-scroll-lock-locked') === 'true') {
1326
- $target.style.overflow = $target.getAttribute('data-scroll-lock-saved-inline-overflow-property');
1327
- $target.style.overflowY = $target.getAttribute('data-scroll-lock-saved-inline-overflow-y-property');
1328
- $target.removeAttribute('data-scroll-lock-saved-overflow-property');
1329
- $target.removeAttribute('data-scroll-lock-saved-inline-overflow-property');
1330
- $target.removeAttribute('data-scroll-lock-saved-inline-overflow-y-property');
1331
- $target.removeAttribute('data-scroll-lock-locked');
1332
- }
1333
- };
1334
-
1335
- var fillGaps = function fillGaps() {
1336
- state.fillGapSelectors.map(function (selector) {
1337
- scroll_lock_fillGapSelector(selector);
1338
- });
1339
- };
1340
-
1341
- var unfillGaps = function unfillGaps() {
1342
- state.fillGapSelectors.map(function (selector) {
1343
- scroll_lock_unfillGapSelector(selector);
1344
- });
1345
- };
1346
-
1347
- var scroll_lock_fillGapSelector = function fillGapSelector(selector) {
1348
- var $targets = document.querySelectorAll(selector);
1349
- var isLockable = state.lockableSelectors.indexOf(selector) !== -1;
1350
- eachNode($targets, function ($target) {
1351
- scroll_lock_fillGapTarget($target, isLockable);
1352
- });
1353
- };
1354
-
1355
- var scroll_lock_fillGapTarget = function fillGapTarget($target) {
1356
- var isLockable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1357
-
1358
- if (isElement($target)) {
1359
- var scrollBarWidth;
1360
-
1361
- if ($target.getAttribute('data-scroll-lock-lockable') === '' || isLockable) {
1362
- scrollBarWidth = scroll_lock_getTargetScrollBarWidth($target, true);
1363
- } else {
1364
- var $lockableParent = findParentBySelector($target, arrayAsSelector(state.lockableSelectors));
1365
- scrollBarWidth = scroll_lock_getTargetScrollBarWidth($lockableParent, true);
1366
- }
1367
-
1368
- if ($target.getAttribute('data-scroll-lock-filled-gap') === 'true') {
1369
- scroll_lock_unfillGapTarget($target);
1370
- }
1371
-
1372
- var computedStyle = window.getComputedStyle($target);
1373
- $target.setAttribute('data-scroll-lock-filled-gap', 'true');
1374
- $target.setAttribute('data-scroll-lock-current-fill-gap-method', state.fillGapMethod);
1375
-
1376
- if (state.fillGapMethod === 'margin') {
1377
- var currentMargin = parseFloat(computedStyle.marginRight);
1378
- $target.style.marginRight = "".concat(currentMargin + scrollBarWidth, "px");
1379
- } else if (state.fillGapMethod === 'width') {
1380
- $target.style.width = "calc(100% - ".concat(scrollBarWidth, "px)");
1381
- } else if (state.fillGapMethod === 'max-width') {
1382
- $target.style.maxWidth = "calc(100% - ".concat(scrollBarWidth, "px)");
1383
- } else if (state.fillGapMethod === 'padding') {
1384
- var currentPadding = parseFloat(computedStyle.paddingRight);
1385
- $target.style.paddingRight = "".concat(currentPadding + scrollBarWidth, "px");
1386
- }
1387
- }
1388
- };
1389
-
1390
- var scroll_lock_unfillGapSelector = function unfillGapSelector(selector) {
1391
- var $targets = document.querySelectorAll(selector);
1392
- eachNode($targets, function ($target) {
1393
- scroll_lock_unfillGapTarget($target);
1394
- });
1395
- };
1396
-
1397
- var scroll_lock_unfillGapTarget = function unfillGapTarget($target) {
1398
- if (isElement($target)) {
1399
- if ($target.getAttribute('data-scroll-lock-filled-gap') === 'true') {
1400
- var currentFillGapMethod = $target.getAttribute('data-scroll-lock-current-fill-gap-method');
1401
- $target.removeAttribute('data-scroll-lock-filled-gap');
1402
- $target.removeAttribute('data-scroll-lock-current-fill-gap-method');
1403
-
1404
- if (currentFillGapMethod === 'margin') {
1405
- $target.style.marginRight = "";
1406
- } else if (currentFillGapMethod === 'width') {
1407
- $target.style.width = "";
1408
- } else if (currentFillGapMethod === 'max-width') {
1409
- $target.style.maxWidth = "";
1410
- } else if (currentFillGapMethod === 'padding') {
1411
- $target.style.paddingRight = "";
1412
- }
1413
- }
1414
- }
1415
- };
1416
-
1417
- var onResize = function onResize(e) {
1418
- refillGaps();
1419
- };
1420
-
1421
- var onTouchStart = function onTouchStart(e) {
1422
- if (!state.scroll) {
1423
- state.startTouchY = e.touches[0].clientY;
1424
- state.startTouchX = e.touches[0].clientX;
1425
- }
1426
- };
1427
-
1428
- var scroll_lock_onTouchMove = function onTouchMove(e) {
1429
- if (!state.scroll) {
1430
- var startTouchY = state.startTouchY,
1431
- startTouchX = state.startTouchX;
1432
- var currentClientY = e.touches[0].clientY;
1433
- var currentClientX = e.touches[0].clientX;
1434
-
1435
- if (e.touches.length < 2) {
1436
- var selector = arrayAsSelector(state.scrollableSelectors);
1437
- var direction = {
1438
- up: startTouchY < currentClientY,
1439
- down: startTouchY > currentClientY,
1440
- left: startTouchX < currentClientX,
1441
- right: startTouchX > currentClientX
1442
- };
1443
- var directionWithOffset = {
1444
- up: startTouchY + TOUCH_DIRECTION_DETECT_OFFSET < currentClientY,
1445
- down: startTouchY - TOUCH_DIRECTION_DETECT_OFFSET > currentClientY,
1446
- left: startTouchX + TOUCH_DIRECTION_DETECT_OFFSET < currentClientX,
1447
- right: startTouchX - TOUCH_DIRECTION_DETECT_OFFSET > currentClientX
1448
- };
1449
-
1450
- var handle = function handle($el) {
1451
- var skip = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1452
-
1453
- if ($el) {
1454
- var parentScrollableEl = findParentBySelector($el, selector, false);
1455
-
1456
- if (elementIsInputRange($el)) {
1457
- return false;
1458
- }
1459
-
1460
- if (skip || elementIsScrollableField($el) && findParentBySelector($el, selector) || elementHasSelector($el, selector)) {
1461
- var prevent = false;
1462
-
1463
- if (elementScrollLeftOnStart($el) && elementScrollLeftOnEnd($el)) {
1464
- if (direction.up && elementScrollTopOnStart($el) || direction.down && elementScrollTopOnEnd($el)) {
1465
- prevent = true;
1466
- }
1467
- } else if (elementScrollTopOnStart($el) && elementScrollTopOnEnd($el)) {
1468
- if (direction.left && elementScrollLeftOnStart($el) || direction.right && elementScrollLeftOnEnd($el)) {
1469
- prevent = true;
1470
- }
1471
- } else if (directionWithOffset.up && elementScrollTopOnStart($el) || directionWithOffset.down && elementScrollTopOnEnd($el) || directionWithOffset.left && elementScrollLeftOnStart($el) || directionWithOffset.right && elementScrollLeftOnEnd($el)) {
1472
- prevent = true;
1473
- }
1474
-
1475
- if (prevent) {
1476
- if (parentScrollableEl) {
1477
- handle(parentScrollableEl, true);
1478
- } else {
1479
- if (e.cancelable) {
1480
- e.preventDefault();
1481
- }
1482
- }
1483
- }
1484
- } else {
1485
- handle(parentScrollableEl);
1486
- }
1487
- } else {
1488
- if (e.cancelable) {
1489
- e.preventDefault();
1490
- }
1491
- }
1492
- };
1493
-
1494
- handle(e.target);
1495
- }
1496
- }
1497
- };
1498
-
1499
- var onTouchEnd = function onTouchEnd(e) {
1500
- if (!state.scroll) {
1501
- state.startTouchY = 0;
1502
- state.startTouchX = 0;
1503
- }
1504
- };
1505
-
1506
- if (typeof window !== 'undefined') {
1507
- window.addEventListener('resize', onResize);
1508
- }
1509
-
1510
- if (typeof document !== 'undefined') {
1511
- document.addEventListener('touchstart', onTouchStart);
1512
- document.addEventListener('touchmove', scroll_lock_onTouchMove, {
1513
- passive: false
1514
- });
1515
- document.addEventListener('touchend', onTouchEnd);
1516
- }
1517
-
1518
- var deprecatedMethods = {
1519
- hide: function hide(target) {
1520
- throwError('"hide" is deprecated! Use "disablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#disablepagescrollscrollabletarget');
1521
- disablePageScroll(target);
1522
- },
1523
- show: function show(target) {
1524
- throwError('"show" is deprecated! Use "enablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#enablepagescrollscrollabletarget');
1525
- enablePageScroll(target);
1526
- },
1527
- toggle: function toggle(target) {
1528
- throwError('"toggle" is deprecated! Do not use it.');
1529
-
1530
- if (getScrollState()) {
1531
- disablePageScroll();
1532
- } else {
1533
- enablePageScroll(target);
1534
- }
1535
- },
1536
- getState: function getState() {
1537
- throwError('"getState" is deprecated! Use "getScrollState" instead. \n https://github.com/FL3NKEY/scroll-lock#getscrollstate');
1538
- return getScrollState();
1539
- },
1540
- getWidth: function getWidth() {
1541
- throwError('"getWidth" is deprecated! Use "getPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getpagescrollbarwidth');
1542
- return getPageScrollBarWidth();
1543
- },
1544
- getCurrentWidth: function getCurrentWidth() {
1545
- throwError('"getCurrentWidth" is deprecated! Use "getCurrentPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getcurrentpagescrollbarwidth');
1546
- return getCurrentPageScrollBarWidth();
1547
- },
1548
- setScrollableTargets: function setScrollableTargets(target) {
1549
- throwError('"setScrollableTargets" is deprecated! Use "addScrollableTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addscrollabletargetscrollabletarget');
1550
- scroll_lock_addScrollableTarget(target);
1551
- },
1552
- setFillGapSelectors: function setFillGapSelectors(selector) {
1553
- throwError('"setFillGapSelectors" is deprecated! Use "addFillGapSelector" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgapselectorfillgapselector');
1554
- scroll_lock_addFillGapSelector(selector);
1555
- },
1556
- setFillGapTargets: function setFillGapTargets(target) {
1557
- throwError('"setFillGapTargets" is deprecated! Use "addFillGapTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgaptargetfillgaptarget');
1558
- scroll_lock_addFillGapTarget(target);
1559
- },
1560
- clearQueue: function clearQueue() {
1561
- throwError('"clearQueue" is deprecated! Use "clearQueueScrollLocks" instead. \n https://github.com/FL3NKEY/scroll-lock#clearqueuescrolllocks');
1562
- clearQueueScrollLocks();
1563
- }
1564
- };
1565
-
1566
- var scrollLock = _objectSpread({
1567
- disablePageScroll: disablePageScroll,
1568
- enablePageScroll: enablePageScroll,
1569
- getScrollState: getScrollState,
1570
- clearQueueScrollLocks: clearQueueScrollLocks,
1571
- getTargetScrollBarWidth: scroll_lock_getTargetScrollBarWidth,
1572
- getCurrentTargetScrollBarWidth: scroll_lock_getCurrentTargetScrollBarWidth,
1573
- getPageScrollBarWidth: getPageScrollBarWidth,
1574
- getCurrentPageScrollBarWidth: getCurrentPageScrollBarWidth,
1575
- addScrollableSelector: scroll_lock_addScrollableSelector,
1576
- removeScrollableSelector: scroll_lock_removeScrollableSelector,
1577
- addScrollableTarget: scroll_lock_addScrollableTarget,
1578
- removeScrollableTarget: scroll_lock_removeScrollableTarget,
1579
- addLockableSelector: scroll_lock_addLockableSelector,
1580
- addLockableTarget: scroll_lock_addLockableTarget,
1581
- addFillGapSelector: scroll_lock_addFillGapSelector,
1582
- removeFillGapSelector: scroll_lock_removeFillGapSelector,
1583
- addFillGapTarget: scroll_lock_addFillGapTarget,
1584
- removeFillGapTarget: scroll_lock_removeFillGapTarget,
1585
- setFillGapMethod: scroll_lock_setFillGapMethod,
1586
- refillGaps: refillGaps,
1587
- _state: state
1588
- }, deprecatedMethods);
1589
-
1590
- /* harmony default export */ var scroll_lock = __webpack_exports__["default"] = (scrollLock);
1591
-
1592
- /***/ })
1593
- /******/ ])["default"];
1594
- });
1595
-
1596
- /***/ })
1597
-
1598
- /******/ });
1599
- /************************************************************************/
1600
- /******/ // The module cache
1601
- /******/ var __webpack_module_cache__ = {};
1602
- /******/
1603
- /******/ // The require function
1604
- /******/ function __webpack_require__(moduleId) {
1605
- /******/ // Check if module is in cache
1606
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
1607
- /******/ if (cachedModule !== undefined) {
1608
- /******/ return cachedModule.exports;
1609
- /******/ }
1610
- /******/ // Create a new module (and put it into the cache)
1611
- /******/ var module = __webpack_module_cache__[moduleId] = {
1612
- /******/ // no module.id needed
1613
- /******/ // no module.loaded needed
1614
- /******/ exports: {}
1615
- /******/ };
1616
- /******/
1617
- /******/ // Execute the module function
1618
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1619
- /******/
1620
- /******/ // Return the exports of the module
1621
- /******/ return module.exports;
1622
- /******/ }
1623
- /******/
1624
- /************************************************************************/
1625
- /******/ /* webpack/runtime/compat get default export */
1626
- /******/ (() => {
1627
- /******/ // getDefaultExport function for compatibility with non-harmony modules
1628
- /******/ __webpack_require__.n = (module) => {
1629
- /******/ var getter = module && module.__esModule ?
1630
- /******/ () => (module['default']) :
1631
- /******/ () => (module);
1632
- /******/ __webpack_require__.d(getter, { a: getter });
1633
- /******/ return getter;
1634
- /******/ };
1635
- /******/ })();
1636
- /******/
1637
- /******/ /* webpack/runtime/define property getters */
1638
- /******/ (() => {
1639
- /******/ // define getter functions for harmony exports
1640
- /******/ __webpack_require__.d = (exports, definition) => {
1641
- /******/ for(var key in definition) {
1642
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
1643
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
1644
- /******/ }
1645
- /******/ }
1646
- /******/ };
1647
- /******/ })();
1648
- /******/
1649
- /******/ /* webpack/runtime/global */
1650
- /******/ (() => {
1651
- /******/ __webpack_require__.g = (function() {
1652
- /******/ if (typeof globalThis === 'object') return globalThis;
1653
- /******/ try {
1654
- /******/ return this || new Function('return this')();
1655
- /******/ } catch (e) {
1656
- /******/ if (typeof window === 'object') return window;
1657
- /******/ }
1658
- /******/ })();
1659
- /******/ })();
1660
- /******/
1661
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
1662
- /******/ (() => {
1663
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1664
- /******/ })();
1665
- /******/
1666
- /******/ /* webpack/runtime/make namespace object */
1667
- /******/ (() => {
1668
- /******/ // define __esModule on exports
1669
- /******/ __webpack_require__.r = (exports) => {
1670
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
1671
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1672
- /******/ }
1673
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
1674
- /******/ };
1675
- /******/ })();
1676
- /******/
1677
- /************************************************************************/
1678
- var __webpack_exports__ = {};
1679
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
1680
- (() => {
1681
- "use strict";
1682
- /*!***************************************!*\
1683
- !*** ./src/core/Meganav/component.js ***!
1684
- \***************************************/
1685
- __webpack_require__.r(__webpack_exports__);
1686
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1687
- /* harmony export */ "default": () => (/* binding */ Meganav)
1688
- /* harmony export */ });
1689
- /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash.throttle */ "./node_modules/lodash.throttle/index.js");
1690
- /* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_0__);
1691
- /* harmony import */ var _component_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./component.css */ "./src/core/Meganav/component.css");
1692
- /* harmony import */ var _dom_query__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom-query */ "./src/core/dom-query.js");
1693
- /* harmony import */ var _MeganavControl_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../MeganavControl/component */ "./src/core/MeganavControl/component.js");
1694
- /* harmony import */ var _MeganavControlMobileDropdown_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../MeganavControlMobileDropdown/component */ "./src/core/MeganavControlMobileDropdown/component.js");
1695
- /* harmony import */ var _MeganavControlMobilePanelOpen_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../MeganavControlMobilePanelOpen/component */ "./src/core/MeganavControlMobilePanelOpen/component.js");
1696
- /* harmony import */ var _MeganavControlMobilePanelClose_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../MeganavControlMobilePanelClose/component */ "./src/core/MeganavControlMobilePanelClose/component.js");
1697
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1698
-
1699
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1700
-
1701
- 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); }
1702
-
1703
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
1704
-
1705
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1706
-
1707
- 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; }
1708
-
1709
-
1710
- // Glossary:
1711
- // item - is the element which contains both the control and the panel - these are adjacent
1712
- // control - interactive element that controls showing and hiding of dropdown or panel
1713
- // panel - container for meganav content
1714
- // dropdown - container for top level items on mobile
1715
- // clear - return to initial state
1716
- // teardown - remove all event listeners (for example when removing nodes)
1717
-
1718
-
1719
-
1720
-
1721
-
1722
- // Close menu when user clicks outside of viewport
1723
-
1724
- var windowOnBlur = function windowOnBlur(closeAll) {
1725
- window.onblur = function () {
1726
- return closeAll();
1727
- };
1728
-
1729
- return {
1730
- teardown: function teardown() {
1731
- return window.onblur = null;
1732
- }
1733
- };
1734
- }; // Close menu when click/tap outside of nav
1735
-
1736
-
1737
- var documentClick = function documentClick(closeAll) {
1738
- var meganav = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav");
1739
-
1740
- var clickHandler = function clickHandler(e) {
1741
- if (meganav.contains(e.target)) return;
1742
- closeAll();
1743
- };
1744
-
1745
- document.addEventListener("click", clickHandler);
1746
- return {
1747
- teardown: function teardown() {
1748
- return document.removeEventListener("click", clickHandler);
1749
- }
1750
- };
1751
- }; // Invert from transparent to white
1752
-
1753
-
1754
- var documentScroll = function documentScroll(themeName) {
1755
- if (themeName !== "transparentToWhite") return {
1756
- teardown: function teardown() {}
1757
- };
1758
- var meganav = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav");
1759
- var navItems = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryIdAll)("meganav-link");
1760
- var controlMobileDropdownMenu = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav-control-mobile-dropdown-menu");
1761
- var controlMobileDropdownClose = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav-control-mobile-dropdown-close");
1762
- var controls = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryIdAll)("meganav-control");
1763
- var signUpBtn = (0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav-sign-up-btn");
1764
- var invertTextCollection = [].concat(_toConsumableArray(Array.from(controls)), _toConsumableArray(Array.from(navItems)), [(0,_dom_query__WEBPACK_IMPORTED_MODULE_2__.queryId)("meganav-logo")]);
1765
-
1766
- var invertMobleDropdownColor = function invertMobleDropdownColor(invert) {
1767
- var whiteToBlack = ["ui-icon-white", "ui-icon-cool-black"];
1768
- var blackToWhite = [].concat(whiteToBlack).reverse();
1769
-
1770
- if (invert) {
1771
- var _controlMobileDropdow, _controlMobileDropdow2;
1772
-
1773
- controlMobileDropdownMenu === null || controlMobileDropdownMenu === void 0 ? void 0 : (_controlMobileDropdow = controlMobileDropdownMenu.classList).replace.apply(_controlMobileDropdow, whiteToBlack);
1774
- controlMobileDropdownClose === null || controlMobileDropdownClose === void 0 ? void 0 : (_controlMobileDropdow2 = controlMobileDropdownClose.classList).replace.apply(_controlMobileDropdow2, whiteToBlack);
1775
- } else {
1776
- var _controlMobileDropdow3, _controlMobileDropdow4;
1777
-
1778
- controlMobileDropdownMenu === null || controlMobileDropdownMenu === void 0 ? void 0 : (_controlMobileDropdow3 = controlMobileDropdownMenu.classList).replace.apply(_controlMobileDropdow3, _toConsumableArray(blackToWhite));
1779
- controlMobileDropdownClose === null || controlMobileDropdownClose === void 0 ? void 0 : (_controlMobileDropdow4 = controlMobileDropdownClose.classList).replace.apply(_controlMobileDropdow4, _toConsumableArray(blackToWhite));
1780
- }
1781
- };
1782
-
1783
- var inverSignupBtnColors = function inverSignupBtnColors(invert) {
1784
- if (invert) {
1785
- signUpBtn === null || signUpBtn === void 0 ? void 0 : signUpBtn.classList.replace("bg-white", "bg-cool-black");
1786
- signUpBtn === null || signUpBtn === void 0 ? void 0 : signUpBtn.classList.replace("text-cool-black", "text-white");
1787
- } else {
1788
- signUpBtn === null || signUpBtn === void 0 ? void 0 : signUpBtn.classList.replace("bg-cool-black", "bg-white");
1789
- signUpBtn === null || signUpBtn === void 0 ? void 0 : signUpBtn.classList.replace("text-white", "text-cool-black");
1790
- }
1791
- };
1792
-
1793
- var scrollHandler = lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default()(function () {
1794
- if (window.scrollY > 5) {
1795
- meganav.classList.replace("bg-transparent", "bg-white");
1796
- inverSignupBtnColors(true);
1797
- invertMobleDropdownColor(true);
1798
- invertTextCollection.forEach(function (n) {
1799
- return n.classList.replace("text-white", "text-cool-black");
1800
- });
1801
- } else {
1802
- meganav.classList.replace("bg-white", "bg-transparent");
1803
- inverSignupBtnColors(false);
1804
- invertMobleDropdownColor(false);
1805
- invertTextCollection.forEach(function (n) {
1806
- return n.classList.replace("text-cool-black", "text-white");
1807
- });
1808
- }
1809
- }, 150);
1810
- document.addEventListener("scroll", scrollHandler);
1811
- return {
1812
- teardown: function teardown() {
1813
- return document.removeEventListener("scroll", scrollHandler);
1814
- }
1815
- };
1816
- };
1817
-
1818
- function Meganav() {
1819
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
1820
- themeName: null
1821
- },
1822
- themeName = _ref.themeName;
1823
-
1824
- var controls = (0,_MeganavControl_component__WEBPACK_IMPORTED_MODULE_3__.default)();
1825
- var panelOpenControls = (0,_MeganavControlMobilePanelOpen_component__WEBPACK_IMPORTED_MODULE_5__.default)();
1826
- var panelCloseControls = (0,_MeganavControlMobilePanelClose_component__WEBPACK_IMPORTED_MODULE_6__.default)();
1827
- var mobileDropdownControl = (0,_MeganavControlMobileDropdown_component__WEBPACK_IMPORTED_MODULE_4__.default)({
1828
- clearPanels: function clearPanels() {
1829
- return [].concat(_toConsumableArray(panelOpenControls), _toConsumableArray(panelCloseControls)).forEach(function (i) {
1830
- return i.clear();
1831
- });
1832
- }
1833
- });
1834
-
1835
- var closeAll = function closeAll() {
1836
- return [mobileDropdownControl].concat(_toConsumableArray(panelOpenControls), _toConsumableArray(panelCloseControls), _toConsumableArray(controls)).forEach(function (i) {
1837
- return i.clear();
1838
- });
1839
- };
1840
-
1841
- var teardowns = [documentScroll(themeName), documentClick(closeAll), windowOnBlur(closeAll), mobileDropdownControl].concat(_toConsumableArray(controls), _toConsumableArray(panelOpenControls), _toConsumableArray(panelCloseControls)).map(function (i) {
1842
- return i.teardown;
1843
- });
1844
- return function () {
1845
- return teardowns.forEach(function (teardown) {
1846
- return teardown();
1847
- });
1848
- };
1849
- }
1850
- })();
1851
-
1852
- __webpack_exports__ = __webpack_exports__.default;
1853
- /******/ return __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GRvd25Db250cm9sID0gTWVnYW5hdkNvbnRyb2xNb2JpbGVEcm9wZG93bih7XG4gICAgY2xlYXJQYW5lbHM6ICgpID0+XG4gICAgICBbLi4ucGFuZWxPcGVuQ29udHJvbHMsIC4uLnBhbmVsQ2xvc2VDb250cm9sc10uZm9yRWFjaCgoaSkgPT4gaS5jbGVhcigpKSxcbiAgfSk7XG5cbiAgY29uc3QgY2xvc2VBbGwgPSAoKSA9PlxuICAgIFtcbiAgICAgIG1vYmlsZURyb3Bkb3duQ29udHJvbCxcbiAgICAgIC4uLnBhbmVsT3BlbkNvbnRyb2xzLFxuICAgICAgLi4ucGFuZWxDbG9zZUNvbnRyb2xzLFxuICAgICAgLi4uY29udHJvbHMsXG4gICAgXS5mb3JFYWNoKChpKSA9PiBpLmNsZWFyKCkpO1xuXG4gIGNvbnN0IHRlYXJkb3ducyA9IFtcbiAgICBkb2N1bWVudFNjcm9sbCh0aGVtZU5hbWUpLFxuICAgIGRvY3VtZW50Q2xpY2soY2xvc2VBbGwpLFxuICAgIHdpbmRvd09uQmx1cihjbG9zZUFsbCksXG4gICAgbW9iaWxlRHJvcGRvd25Db250cm9sLFxuICAgIC4uLmNvbnRyb2xzLFxuICAgIC4uLnBhbmVsT3BlbkNvbnRyb2xzLFxuICAgIC4uLnBhbmVsQ2xvc2VDb250cm9scyxcbiAgXS5tYXAoKGkpID0+IGkudGVhcmRvd24pO1xuXG4gIHJldHVybiAoKSA9PiB0ZWFyZG93bnMuZm9yRWFjaCgodGVhcmRvd24pID0+IHRlYXJkb3duKCkpO1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AblyUi=t():(e.AblyUi=e.AblyUi||{},e.AblyUi.Core=e.AblyUi.Core||{},e.AblyUi.Core.Meganav=t())}(this,(function(){return(()=>{var e={2498:(e,t,r)=>{"use strict";r.d(t,{default:()=>l});var n=r(9581);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}const l=function(){var e=Array.from((0,n.n)("meganav-control")),t=Array.from((0,n.n)("meganav-panel")),r=getComputedStyle(document.documentElement).getPropertyValue("--bp-md"),l=function(t,n,l){if(window.matchMedia("(hover: hover) and (pointer: fine) and (min-width: ".concat(r,")")).matches&&!e.some((function(e){return e===document.activeElement}))){var i,a=["invisible","visible"];(i=n.classList).replace.apply(i,function(e){if(Array.isArray(e))return o(e)}(c=l?a:a.reverse())||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t.setAttribute("aria-expanded",l)}var c};return e.map((function(r){var n=r.parentNode,o=document.querySelector("#".concat(r.getAttribute("aria-controls"))),i=function(r,n){return function(){e.forEach((function(e){return e!==r&&e.setAttribute("aria-expanded",!1)})),t.forEach((function(e){return e!==n&&e.classList.replace("visible","invisible")})),r.getAttribute("aria-expanded")?(r.setAttribute("aria-expanded",!0),n.classList.replace("invisible","visible")):(r.setAttribute("aria-expanded",!1),n.classList.replace("visible","invisible"))}}(r,o),a=function(e,t){return function(){return l(e,t,!0)}}(r,o),c=function(e,t){return function(){return l(e,t,!1)}}(r,o);return n.addEventListener("mouseenter",a),n.addEventListener("mouseleave",c),r.addEventListener("click",i),[{teardown:function(){n.removeEventListener("mouseenter",a),n.removeEventListener("mouseleave",c),r.removeEventListener("click",i)},clear:function(){r.setAttribute("aria-expanded",!1),o.classList.replace("visible","invisible")}}]})).flat()}},1792:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(6265),o=r.n(n),l=r(9581);const i=function(e){var t=e.clearPanels,r=(0,l.A)("meganav-control-mobile-dropdown"),n=(0,l.A)("meganav-mobile-dropdown"),i=(0,l.A)("meganav-control-mobile-dropdown-menu"),a=(0,l.A)("meganav-control-mobile-dropdown-close"),c=function(){"false"===r.getAttribute("aria-expanded")?(n.classList.replace("invisible","visible"),r.setAttribute("aria-expanded",!0),o().disablePageScroll()):(n.classList.replace("visible","invisible"),r.setAttribute("aria-expanded",!1),o().enablePageScroll(),t()),i.classList.toggle("hidden"),a.classList.toggle("hidden")};return r.addEventListener("click",c),{teardown:function(){r.removeEventListener("click",c),o().enablePageScroll()},clear:function(){n.classList.replace("visible","invisible"),r.setAttribute("aria-expanded",!1),i.classList.remove("hidden"),a.classList.add("hidden"),o().enablePageScroll()}}}},7359:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(9581);const o=function(){var e=Array.from((0,n.n)("meganav-control-mobile-panel-close")),t=Array.from((0,n.n)("meganav-control-mobile-panel-open"));return e.map((function(e){var r=t.find((function(t){return t.getAttribute("aria-controls")===e.getAttribute("aria-controls")})),n=document.querySelector("#".concat(e.getAttribute("aria-controls"))),o=function(e,t,r){return function(){e.setAttribute("aria-expanded",!1),t.setAttribute("aria-expanded",!1),r.classList.replace("block","hidden"),r.style.height=null}}(e,r,n);return e.addEventListener("click",o),{teardown:function(){return e.removeEventListener("click",o)},clear:function(){return e.setAttribute("aria-expanded",!1)}}}))}},9552:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var n=r(9581);const o=function(){var e,t=Array.from((0,n.n)("meganav-control-mobile-panel-close")),r=Array.from((0,n.n)("meganav-control-mobile-panel-open")),o=(0,n.A)("meganav-mobile-dropdown"),l=(e=getComputedStyle(document.documentElement).getPropertyValue("--ui-meganav-height"),parseFloat(e)*parseFloat(getComputedStyle(document.documentElement).fontSize));return r.map((function(e){var r=t.find((function(t){return t.getAttribute("aria-controls")===e.getAttribute("aria-controls")})),n=document.querySelector("#".concat(e.getAttribute("aria-controls"))),i=function(e,t,r){return function(){e.setAttribute("aria-expanded",!0),t.setAttribute("aria-expanded",!0),r.classList.replace("hidden","block"),r.style.height="".concat(window.innerHeight-l>r.offsetHeight?r.offsetHeight:window.innerHeight-l,"px")}}(e,r,n);return e.addEventListener("click",i),{teardown:function(){return e.removeEventListener("click",i)},clear:function(){n.classList.replace("block","hidden"),o.classList.remove("ui-meganav-mobile-dropdown-expand"),e.setAttribute("aria-expanded",!1),n.style.height=null}}}))}},9581:(e,t,r)=>{"use strict";r.d(t,{A:()=>n,n:()=>o});var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector("[data-id=".concat(e,"]"))},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelectorAll("[data-id=".concat(e,"]"))}},3096:(e,t,r)=>{var n="Expected a function",o=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt,u="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,s="object"==typeof self&&self&&self.Object===Object&&self,d=u||s||Function("return this")(),f=Object.prototype.toString,p=Math.max,g=Math.min,b=function(){return d.Date.now()};function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==f.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var r=i.test(e);return r||a.test(e)?c(e.slice(2),r?2:8):l.test(e)?NaN:+e}e.exports=function(e,t,r){var o=!0,l=!0;if("function"!=typeof e)throw new TypeError(n);return v(r)&&(o="leading"in r?!!r.leading:o,l="trailing"in r?!!r.trailing:l),function(e,t,r){var o,l,i,a,c,u,s=0,d=!1,f=!1,h=!0;if("function"!=typeof e)throw new TypeError(n);function y(t){var r=o,n=l;return o=l=void 0,s=t,a=e.apply(n,r)}function S(e){return s=e,c=setTimeout(A,t),d?y(e):a}function w(e){var r=e-u;return void 0===u||r>=t||r<0||f&&e-s>=i}function A(){var e=b();if(w(e))return k(e);c=setTimeout(A,function(e){var r=t-(e-u);return f?g(r,i-(e-s)):r}(e))}function k(e){return c=void 0,h&&o?y(e):(o=l=void 0,a)}function L(){var e=b(),r=w(e);if(o=arguments,l=this,u=e,r){if(void 0===c)return S(u);if(f)return c=setTimeout(A,t),y(u)}return void 0===c&&(c=setTimeout(A,t)),a}return t=m(t)||0,v(r)&&(d=!!r.leading,i=(f="maxWait"in r)?p(m(r.maxWait)||0,t):i,h="trailing"in r?!!r.trailing:h),L.cancel=function(){void 0!==c&&clearTimeout(c),s=0,o=u=l=c=void 0},L.flush=function(){return void 0===c?a:k(b())},L}(e,t,{leading:o,maxWait:t,trailing:l})}},6265:function(e){var t;t=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=function(e){return Array.isArray(e)?e:[e]},o=function(e){return e instanceof Node},l=function(e,t){if(e&&t){e=function(e){return e instanceof NodeList}(e)?e:[e];for(var r=0;r<e.length&&!0!==t(e[r],r,e.length);r++);}},i=function(e){return console.error("[scroll-lock] ".concat(e))},a=function(e){if(Array.isArray(e))return e.join(", ")},c=function(e){var t=[];return l(e,(function(e){return t.push(e)})),t},u=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:document;if(r&&-1!==c(n.querySelectorAll(t)).indexOf(e))return e;for(;(e=e.parentElement)&&-1===c(n.querySelectorAll(t)).indexOf(e););return e},s=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n=-1!==c(r.querySelectorAll(t)).indexOf(e);return n},d=function(e){if(e)return"hidden"===getComputedStyle(e).overflow},f=function(e){if(e)return!!d(e)||e.scrollTop<=0},p=function(e){if(e){if(d(e))return!0;var t=e.scrollTop,r=e.scrollHeight;return t+e.offsetHeight>=r}},g=function(e){if(e)return!!d(e)||e.scrollLeft<=0},b=function(e){if(e){if(d(e))return!0;var t=e.scrollLeft,r=e.scrollWidth;return t+e.offsetWidth>=r}},v=function(e){return s(e,'textarea, [contenteditable="true"]')},m=function(e){return s(e,'input[type="range"]')};function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"disablePageScroll",(function(){return w})),r.d(t,"enablePageScroll",(function(){return A})),r.d(t,"getScrollState",(function(){return k})),r.d(t,"clearQueueScrollLocks",(function(){return L})),r.d(t,"getTargetScrollBarWidth",(function(){return x})),r.d(t,"getCurrentTargetScrollBarWidth",(function(){return E})),r.d(t,"getPageScrollBarWidth",(function(){return T})),r.d(t,"getCurrentPageScrollBarWidth",(function(){return j})),r.d(t,"addScrollableTarget",(function(){return O})),r.d(t,"removeScrollableTarget",(function(){return G})),r.d(t,"addScrollableSelector",(function(){return W})),r.d(t,"removeScrollableSelector",(function(){return F})),r.d(t,"addLockableTarget",(function(){return P})),r.d(t,"addLockableSelector",(function(){return Y})),r.d(t,"setFillGapMethod",(function(){return q})),r.d(t,"addFillGapTarget",(function(){return M})),r.d(t,"removeFillGapTarget",(function(){return C})),r.d(t,"addFillGapSelector",(function(){return N})),r.d(t,"removeFillGapSelector",(function(){return U})),r.d(t,"refillGaps",(function(){return B}));var y=["padding","margin","width","max-width","none"],S={scroll:!0,queue:0,scrollableSelectors:["[data-scroll-lock-scrollable]"],lockableSelectors:["body","[data-scroll-lock-lockable]"],fillGapSelectors:["body","[data-scroll-lock-fill-gap]","[data-scroll-lock-lockable]"],fillGapMethod:y[0],startTouchY:0,startTouchX:0},w=function(e){S.queue<=0&&(S.scroll=!1,K(),$()),O(e),S.queue++},A=function(e){S.queue>0&&S.queue--,S.queue<=0&&(S.scroll=!0,R(),D()),G(e)},k=function(){return S.scroll},L=function(){S.queue=0},x=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var r=e.style.overflowY;t?k()||(e.style.overflowY=e.getAttribute("data-scroll-lock-saved-overflow-y-property")):e.style.overflowY="scroll";var n=E(e);return e.style.overflowY=r,n}return 0},E=function(e){if(o(e)){if(e===document.body){var t=document.documentElement.clientWidth;return window.innerWidth-t}var r=e.style.borderLeftWidth,n=e.style.borderRightWidth;e.style.borderLeftWidth="0px",e.style.borderRightWidth="0px";var l=e.offsetWidth-e.clientWidth;return e.style.borderLeftWidth=r,e.style.borderRightWidth=n,l}return 0},T=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return x(document.body,e)},j=function(){return E(document.body)},O=function(e){e&&n(e).map((function(e){l(e,(function(e){o(e)?e.setAttribute("data-scroll-lock-scrollable",""):i('"'.concat(e,'" is not a Element.'))}))}))},G=function(e){e&&n(e).map((function(e){l(e,(function(e){o(e)?e.removeAttribute("data-scroll-lock-scrollable"):i('"'.concat(e,'" is not a Element.'))}))}))},W=function(e){e&&n(e).map((function(e){S.scrollableSelectors.push(e)}))},F=function(e){e&&n(e).map((function(e){S.scrollableSelectors=S.scrollableSelectors.filter((function(t){return t!==e}))}))},P=function(e){e&&(n(e).map((function(e){l(e,(function(e){o(e)?e.setAttribute("data-scroll-lock-lockable",""):i('"'.concat(e,'" is not a Element.'))}))})),k()||K())},Y=function(e){e&&(n(e).map((function(e){S.lockableSelectors.push(e)})),k()||K(),N(e))},q=function(e){if(e)if(-1!==y.indexOf(e))S.fillGapMethod=e,B();else{var t=y.join(", ");i('"'.concat(e,'" method is not available!\nAvailable fill gap methods: ').concat(t,"."))}},M=function(e){e&&n(e).map((function(e){l(e,(function(e){o(e)?(e.setAttribute("data-scroll-lock-fill-gap",""),S.scroll||z(e)):i('"'.concat(e,'" is not a Element.'))}))}))},C=function(e){e&&n(e).map((function(e){l(e,(function(e){o(e)?(e.removeAttribute("data-scroll-lock-fill-gap"),S.scroll||J(e)):i('"'.concat(e,'" is not a Element.'))}))}))},N=function(e){e&&n(e).map((function(e){-1===S.fillGapSelectors.indexOf(e)&&(S.fillGapSelectors.push(e),S.scroll||Q(e))}))},U=function(e){e&&n(e).map((function(e){S.fillGapSelectors=S.fillGapSelectors.filter((function(t){return t!==e})),S.scroll||V(e)}))},B=function(){S.scroll||$()},K=function(){var e=a(S.lockableSelectors);_(e)},R=function(){var e=a(S.lockableSelectors);I(e)},_=function(e){var t=document.querySelectorAll(e);l(t,(function(e){H(e)}))},I=function(e){var t=document.querySelectorAll(e);l(t,(function(e){X(e)}))},H=function(e){if(o(e)&&"true"!==e.getAttribute("data-scroll-lock-locked")){var t=window.getComputedStyle(e);e.setAttribute("data-scroll-lock-saved-overflow-y-property",t.overflowY),e.setAttribute("data-scroll-lock-saved-inline-overflow-property",e.style.overflow),e.setAttribute("data-scroll-lock-saved-inline-overflow-y-property",e.style.overflowY),e.style.overflow="hidden",e.setAttribute("data-scroll-lock-locked","true")}},X=function(e){o(e)&&"true"===e.getAttribute("data-scroll-lock-locked")&&(e.style.overflow=e.getAttribute("data-scroll-lock-saved-inline-overflow-property"),e.style.overflowY=e.getAttribute("data-scroll-lock-saved-inline-overflow-y-property"),e.removeAttribute("data-scroll-lock-saved-overflow-property"),e.removeAttribute("data-scroll-lock-saved-inline-overflow-property"),e.removeAttribute("data-scroll-lock-saved-inline-overflow-y-property"),e.removeAttribute("data-scroll-lock-locked"))},$=function(){S.fillGapSelectors.map((function(e){Q(e)}))},D=function(){S.fillGapSelectors.map((function(e){V(e)}))},Q=function(e){var t=document.querySelectorAll(e),r=-1!==S.lockableSelectors.indexOf(e);l(t,(function(e){z(e,r)}))},z=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(o(e)){var r;if(""===e.getAttribute("data-scroll-lock-lockable")||t)r=x(e,!0);else{var n=u(e,a(S.lockableSelectors));r=x(n,!0)}"true"===e.getAttribute("data-scroll-lock-filled-gap")&&J(e);var l=window.getComputedStyle(e);if(e.setAttribute("data-scroll-lock-filled-gap","true"),e.setAttribute("data-scroll-lock-current-fill-gap-method",S.fillGapMethod),"margin"===S.fillGapMethod){var i=parseFloat(l.marginRight);e.style.marginRight="".concat(i+r,"px")}else if("width"===S.fillGapMethod)e.style.width="calc(100% - ".concat(r,"px)");else if("max-width"===S.fillGapMethod)e.style.maxWidth="calc(100% - ".concat(r,"px)");else if("padding"===S.fillGapMethod){var c=parseFloat(l.paddingRight);e.style.paddingRight="".concat(c+r,"px")}}},V=function(e){var t=document.querySelectorAll(e);l(t,(function(e){J(e)}))},J=function(e){if(o(e)&&"true"===e.getAttribute("data-scroll-lock-filled-gap")){var t=e.getAttribute("data-scroll-lock-current-fill-gap-method");e.removeAttribute("data-scroll-lock-filled-gap"),e.removeAttribute("data-scroll-lock-current-fill-gap-method"),"margin"===t?e.style.marginRight="":"width"===t?e.style.width="":"max-width"===t?e.style.maxWidth="":"padding"===t&&(e.style.paddingRight="")}};"undefined"!=typeof window&&window.addEventListener("resize",(function(e){B()})),"undefined"!=typeof document&&(document.addEventListener("touchstart",(function(e){S.scroll||(S.startTouchY=e.touches[0].clientY,S.startTouchX=e.touches[0].clientX)})),document.addEventListener("touchmove",(function(e){if(!S.scroll){var t=S.startTouchY,r=S.startTouchX,n=e.touches[0].clientY,o=e.touches[0].clientX;if(e.touches.length<2){var l=a(S.scrollableSelectors),i={up:t<n,down:t>n,left:r<o,right:r>o},c={up:t+3<n,down:t-3>n,left:r+3<o,right:r-3>o};!function t(r){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r){var o=u(r,l,!1);if(m(r))return!1;if(n||v(r)&&u(r,l)||s(r,l)){var a=!1;g(r)&&b(r)?(i.up&&f(r)||i.down&&p(r))&&(a=!0):f(r)&&p(r)?(i.left&&g(r)||i.right&&b(r))&&(a=!0):(c.up&&f(r)||c.down&&p(r)||c.left&&g(r)||c.right&&b(r))&&(a=!0),a&&(o?t(o,!0):e.cancelable&&e.preventDefault())}else t(o)}else e.cancelable&&e.preventDefault()}(e.target)}}}),{passive:!1}),document.addEventListener("touchend",(function(e){S.scroll||(S.startTouchY=0,S.startTouchX=0)})));var Z={hide:function(e){i('"hide" is deprecated! Use "disablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#disablepagescrollscrollabletarget'),w(e)},show:function(e){i('"show" is deprecated! Use "enablePageScroll" instead. \n https://github.com/FL3NKEY/scroll-lock#enablepagescrollscrollabletarget'),A(e)},toggle:function(e){i('"toggle" is deprecated! Do not use it.'),k()?w():A(e)},getState:function(){return i('"getState" is deprecated! Use "getScrollState" instead. \n https://github.com/FL3NKEY/scroll-lock#getscrollstate'),k()},getWidth:function(){return i('"getWidth" is deprecated! Use "getPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getpagescrollbarwidth'),T()},getCurrentWidth:function(){return i('"getCurrentWidth" is deprecated! Use "getCurrentPageScrollBarWidth" instead. \n https://github.com/FL3NKEY/scroll-lock#getcurrentpagescrollbarwidth'),j()},setScrollableTargets:function(e){i('"setScrollableTargets" is deprecated! Use "addScrollableTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addscrollabletargetscrollabletarget'),O(e)},setFillGapSelectors:function(e){i('"setFillGapSelectors" is deprecated! Use "addFillGapSelector" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgapselectorfillgapselector'),N(e)},setFillGapTargets:function(e){i('"setFillGapTargets" is deprecated! Use "addFillGapTarget" instead. \n https://github.com/FL3NKEY/scroll-lock#addfillgaptargetfillgaptarget'),M(e)},clearQueue:function(){i('"clearQueue" is deprecated! Use "clearQueueScrollLocks" instead. \n https://github.com/FL3NKEY/scroll-lock#clearqueuescrolllocks'),L()}},ee=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){h(e,t,r[t])}))}return e}({disablePageScroll:w,enablePageScroll:A,getScrollState:k,clearQueueScrollLocks:L,getTargetScrollBarWidth:x,getCurrentTargetScrollBarWidth:E,getPageScrollBarWidth:T,getCurrentPageScrollBarWidth:j,addScrollableSelector:W,removeScrollableSelector:F,addScrollableTarget:O,removeScrollableTarget:G,addLockableSelector:Y,addLockableTarget:P,addFillGapSelector:N,removeFillGapSelector:U,addFillGapTarget:M,removeFillGapTarget:C,setFillGapMethod:q,refillGaps:B,_state:S},Z);t.default=ee}]).default},e.exports=t()}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var l=t[n]={exports:{}};return e[n].call(l.exports,l,l.exports,r),l.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};return(()=>{"use strict";r.d(n,{default:()=>g});var e=r(3096),t=r.n(e),o=r(9581),l=r(2498),i=r(1792),a=r(9552),c=r(7359);function u(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d=function(e){return window.onblur=function(){return e()},{teardown:function(){return window.onblur=null}}},f=function(e){var t=(0,o.A)("meganav"),r=function(r){t.contains(r.target)||e()};return document.addEventListener("click",r),{teardown:function(){return document.removeEventListener("click",r)}}},p=function(e){if("transparentToWhite"!==e)return{teardown:function(){}};var r=(0,o.A)("meganav"),n=(0,o.n)("meganav-link"),l=(0,o.A)("meganav-control-mobile-dropdown-menu"),i=(0,o.A)("meganav-control-mobile-dropdown-close"),a=(0,o.n)("meganav-control"),c=(0,o.A)("meganav-sign-up-btn"),s=[].concat(u(Array.from(a)),u(Array.from(n)),[(0,o.A)("meganav-logo")]),d=function(e){var t,r,n,o,a=["ui-icon-white","ui-icon-cool-black"],c=[].concat(a).reverse();e?(null==l||(t=l.classList).replace.apply(t,a),null==i||(r=i.classList).replace.apply(r,a)):(null==l||(n=l.classList).replace.apply(n,u(c)),null==i||(o=i.classList).replace.apply(o,u(c)))},f=function(e){e?(null==c||c.classList.replace("bg-white","bg-cool-black"),null==c||c.classList.replace("text-cool-black","text-white")):(null==c||c.classList.replace("bg-cool-black","bg-white"),null==c||c.classList.replace("text-white","text-cool-black"))},p=t()((function(){window.scrollY>5?(r.classList.replace("bg-transparent","bg-white"),f(!0),d(!0),s.forEach((function(e){return e.classList.replace("text-white","text-cool-black")}))):(r.classList.replace("bg-white","bg-transparent"),f(!1),d(!1),s.forEach((function(e){return e.classList.replace("text-cool-black","text-white")})))}),150);return document.addEventListener("scroll",p),{teardown:function(){return document.removeEventListener("scroll",p)}}};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{themeName:null},t=e.themeName,r=(0,l.default)(),n=(0,a.default)(),o=(0,c.default)(),s=(0,i.default)({clearPanels:function(){return[].concat(u(n),u(o)).forEach((function(e){return e.clear()}))}}),g=function(){return[s].concat(u(n),u(o),u(r)).forEach((function(e){return e.clear()}))},b=[p(t),f(g),d(g),s].concat(u(r),u(n),u(o)).map((function(e){return e.teardown}));return function(){return b.forEach((function(e){return e()}))}}})(),n.default})()}));