gwchq-textjam 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -64824,6 +64824,35 @@ function SvgFile(props) {
64824
64824
 
64825
64825
  /***/ }),
64826
64826
 
64827
+ /***/ 72020:
64828
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64829
+
64830
+ __webpack_require__.r(__webpack_exports__);
64831
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
64832
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
64833
+ /* harmony export */ });
64834
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
64835
+ var _path;
64836
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
64837
+
64838
+ function SvgFiles(props) {
64839
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
64840
+ width: 22,
64841
+ height: 20,
64842
+ fill: "none",
64843
+ xmlns: "http://www.w3.org/2000/svg"
64844
+ }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
64845
+ d: "M10.75 8.75v6m-3-3h6m7 5a2 2 0 01-2 2h-16a2 2 0 01-2-2v-14a2 2 0 012-2h5l2 3h9a2 2 0 012 2v11z",
64846
+ stroke: "#33625E",
64847
+ strokeWidth: 1.5,
64848
+ strokeLinecap: "round",
64849
+ strokeLinejoin: "round"
64850
+ })));
64851
+ }
64852
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgFiles);
64853
+
64854
+ /***/ }),
64855
+
64827
64856
  /***/ 97091:
64828
64857
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64829
64858
 
@@ -64888,6 +64917,35 @@ function SvgGifFile(props) {
64888
64917
 
64889
64918
  /***/ }),
64890
64919
 
64920
+ /***/ 69046:
64921
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64922
+
64923
+ __webpack_require__.r(__webpack_exports__);
64924
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
64925
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
64926
+ /* harmony export */ });
64927
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
64928
+ var _path;
64929
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
64930
+
64931
+ function SvgHome(props) {
64932
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
64933
+ width: 20,
64934
+ height: 22,
64935
+ fill: "none",
64936
+ xmlns: "http://www.w3.org/2000/svg"
64937
+ }, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
64938
+ d: "M6.75 20.75v-10h6v10m-12-13l9-7 9 7v11a2 2 0 01-2 2h-14a2 2 0 01-2-2v-11z",
64939
+ stroke: "#33625E",
64940
+ strokeWidth: 1.5,
64941
+ strokeLinecap: "round",
64942
+ strokeLinejoin: "round"
64943
+ })));
64944
+ }
64945
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgHome);
64946
+
64947
+ /***/ }),
64948
+
64891
64949
  /***/ 59917:
64892
64950
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
64893
64951
 
@@ -65362,6 +65420,2380 @@ function SvgWavFile(props) {
65362
65420
  }
65363
65421
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgWavFile);
65364
65422
 
65423
+ /***/ }),
65424
+
65425
+ /***/ 97957:
65426
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
65427
+
65428
+ // ESM COMPAT FLAG
65429
+ __webpack_require__.r(__webpack_exports__);
65430
+
65431
+ // EXPORTS
65432
+ __webpack_require__.d(__webpack_exports__, {
65433
+ ControlledMenu: () => (/* reexport */ ControlledMenu),
65434
+ FocusableItem: () => (/* reexport */ FocusableItem),
65435
+ Menu: () => (/* reexport */ Menu),
65436
+ MenuButton: () => (/* reexport */ MenuButton),
65437
+ MenuDivider: () => (/* reexport */ MenuDivider),
65438
+ MenuGroup: () => (/* reexport */ MenuGroup),
65439
+ MenuHeader: () => (/* reexport */ MenuHeader),
65440
+ MenuItem: () => (/* reexport */ MenuItem),
65441
+ MenuRadioGroup: () => (/* reexport */ MenuRadioGroup),
65442
+ SubMenu: () => (/* reexport */ SubMenu),
65443
+ useClick: () => (/* reexport */ useClick),
65444
+ useHover: () => (/* reexport */ useHover),
65445
+ useMenuState: () => (/* reexport */ useMenuState)
65446
+ });
65447
+
65448
+ ;// ./node_modules/@szhsin/react-menu/dist/es/_virtual/_rollupPluginBabelHelpers.js
65449
+ function _extends() {
65450
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
65451
+ for (var i = 1; i < arguments.length; i++) {
65452
+ var source = arguments[i];
65453
+ for (var key in source) {
65454
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
65455
+ target[key] = source[key];
65456
+ }
65457
+ }
65458
+ }
65459
+ return target;
65460
+ };
65461
+ return _extends.apply(this, arguments);
65462
+ }
65463
+ function _objectWithoutPropertiesLoose(source, excluded) {
65464
+ if (source == null) return {};
65465
+ var target = {};
65466
+ var sourceKeys = Object.keys(source);
65467
+ var key, i;
65468
+ for (i = 0; i < sourceKeys.length; i++) {
65469
+ key = sourceKeys[i];
65470
+ if (excluded.indexOf(key) >= 0) continue;
65471
+ target[key] = source[key];
65472
+ }
65473
+ return target;
65474
+ }
65475
+
65476
+
65477
+
65478
+ // EXTERNAL MODULE: external "react"
65479
+ var external_react_ = __webpack_require__(51649);
65480
+ // EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js
65481
+ var jsx_runtime = __webpack_require__(74848);
65482
+ // EXTERNAL MODULE: external "react-dom"
65483
+ var external_react_dom_ = __webpack_require__(7516);
65484
+ ;// ./node_modules/@szhsin/react-menu/dist/es/utils/utils.js
65485
+
65486
+
65487
+ var isMenuOpen = function isMenuOpen(state) {
65488
+ return !!state && state[0] === 'o';
65489
+ };
65490
+ var batchedUpdates = external_react_dom_.unstable_batchedUpdates || function (callback) {
65491
+ return callback();
65492
+ };
65493
+ var values = Object.values || function (obj) {
65494
+ return Object.keys(obj).map(function (key) {
65495
+ return obj[key];
65496
+ });
65497
+ };
65498
+ var floatEqual = function floatEqual(a, b, diff) {
65499
+ if (diff === void 0) {
65500
+ diff = 0.0001;
65501
+ }
65502
+ return Math.abs(a - b) < diff;
65503
+ };
65504
+ var getTransition = function getTransition(transition, name) {
65505
+ return transition === true || !!(transition && transition[name]);
65506
+ };
65507
+ var safeCall = function safeCall(fn, arg) {
65508
+ return typeof fn === 'function' ? fn(arg) : fn;
65509
+ };
65510
+ var internalKey = '_szhsinMenu';
65511
+ var getName = function getName(component) {
65512
+ return component[internalKey];
65513
+ };
65514
+ var defineName = function defineName(name, component) {
65515
+ return Object.defineProperty(component, internalKey, {
65516
+ value: name
65517
+ });
65518
+ };
65519
+ var mergeProps = function mergeProps(target, source) {
65520
+ source && Object.keys(source).forEach(function (key) {
65521
+ var targetProp = target[key];
65522
+ var sourceProp = source[key];
65523
+ if (typeof sourceProp === 'function' && targetProp) {
65524
+ target[key] = function () {
65525
+ sourceProp.apply(void 0, arguments);
65526
+ targetProp.apply(void 0, arguments);
65527
+ };
65528
+ } else {
65529
+ target[key] = sourceProp;
65530
+ }
65531
+ });
65532
+ return target;
65533
+ };
65534
+ var parsePadding = function parsePadding(paddingStr) {
65535
+ if (typeof paddingStr !== 'string') return {
65536
+ top: 0,
65537
+ right: 0,
65538
+ bottom: 0,
65539
+ left: 0
65540
+ };
65541
+ var padding = paddingStr.trim().split(/\s+/, 4).map(parseFloat);
65542
+ var top = !isNaN(padding[0]) ? padding[0] : 0;
65543
+ var right = !isNaN(padding[1]) ? padding[1] : top;
65544
+ return {
65545
+ top: top,
65546
+ right: right,
65547
+ bottom: !isNaN(padding[2]) ? padding[2] : top,
65548
+ left: !isNaN(padding[3]) ? padding[3] : right
65549
+ };
65550
+ };
65551
+ var getScrollAncestor = function getScrollAncestor(node) {
65552
+ while (node) {
65553
+ node = node.parentNode;
65554
+ if (!node || node === document.body || !node.parentNode) return;
65555
+ var _getComputedStyle = getComputedStyle(node),
65556
+ overflow = _getComputedStyle.overflow,
65557
+ overflowX = _getComputedStyle.overflowX,
65558
+ overflowY = _getComputedStyle.overflowY;
65559
+ if (/auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX)) return node;
65560
+ }
65561
+ };
65562
+ function commonProps(isDisabled, isHovering) {
65563
+ return {
65564
+ 'aria-disabled': isDisabled || undefined,
65565
+ tabIndex: isHovering ? 0 : -1
65566
+ };
65567
+ }
65568
+ function indexOfNode(nodeList, node) {
65569
+ for (var i = 0; i < nodeList.length; i++) {
65570
+ if (nodeList[i] === node) return i;
65571
+ }
65572
+ return -1;
65573
+ }
65574
+
65575
+
65576
+
65577
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useBEM.js
65578
+
65579
+
65580
+ var useBEM = function useBEM(_ref) {
65581
+ var block = _ref.block,
65582
+ element = _ref.element,
65583
+ modifiers = _ref.modifiers,
65584
+ className = _ref.className;
65585
+ return (0,external_react_.useMemo)(function () {
65586
+ var blockElement = element ? block + "__" + element : block;
65587
+ var classString = blockElement;
65588
+ modifiers && Object.keys(modifiers).forEach(function (name) {
65589
+ var value = modifiers[name];
65590
+ if (value) classString += " " + blockElement + "--" + (value === true ? name : name + "-" + value);
65591
+ });
65592
+ var expandedClassName = typeof className === 'function' ? className(modifiers) : className;
65593
+ if (typeof expandedClassName === 'string') {
65594
+ expandedClassName = expandedClassName.trim();
65595
+ if (expandedClassName) classString += " " + expandedClassName;
65596
+ }
65597
+ return classString;
65598
+ }, [block, element, modifiers, className]);
65599
+ };
65600
+
65601
+
65602
+
65603
+ ;// ./node_modules/@szhsin/react-menu/dist/es/utils/constants.js
65604
+
65605
+
65606
+ var menuContainerClass = 'szh-menu-container';
65607
+ var menuClass = 'szh-menu';
65608
+ var menuButtonClass = 'szh-menu-button';
65609
+ var menuArrowClass = 'arrow';
65610
+ var menuItemClass = 'item';
65611
+ var menuDividerClass = 'divider';
65612
+ var menuHeaderClass = 'header';
65613
+ var menuGroupClass = 'group';
65614
+ var subMenuClass = 'submenu';
65615
+ var radioGroupClass = 'radio-group';
65616
+ var HoverItemContext = /*#__PURE__*/(0,external_react_.createContext)();
65617
+ var MenuListItemContext = /*#__PURE__*/(0,external_react_.createContext)({});
65618
+ var MenuListContext = /*#__PURE__*/(0,external_react_.createContext)({});
65619
+ var EventHandlersContext = /*#__PURE__*/(0,external_react_.createContext)({});
65620
+ var RadioGroupContext = /*#__PURE__*/(0,external_react_.createContext)({});
65621
+ var SettingsContext = /*#__PURE__*/(0,external_react_.createContext)({});
65622
+ var Keys = /*#__PURE__*/Object.freeze({
65623
+ ENTER: 'Enter',
65624
+ ESC: 'Escape',
65625
+ SPACE: ' ',
65626
+ HOME: 'Home',
65627
+ END: 'End',
65628
+ LEFT: 'ArrowLeft',
65629
+ RIGHT: 'ArrowRight',
65630
+ UP: 'ArrowUp',
65631
+ DOWN: 'ArrowDown'
65632
+ });
65633
+ var HoverActionTypes = /*#__PURE__*/Object.freeze({
65634
+ RESET: 0,
65635
+ SET: 1,
65636
+ UNSET: 2,
65637
+ INCREASE: 3,
65638
+ DECREASE: 4,
65639
+ FIRST: 5,
65640
+ LAST: 6,
65641
+ SET_INDEX: 7
65642
+ });
65643
+ var CloseReason = /*#__PURE__*/Object.freeze({
65644
+ CLICK: 'click',
65645
+ CANCEL: 'cancel',
65646
+ BLUR: 'blur',
65647
+ SCROLL: 'scroll'
65648
+ });
65649
+ var FocusPositions = /*#__PURE__*/Object.freeze({
65650
+ FIRST: 'first',
65651
+ LAST: 'last'
65652
+ });
65653
+ var MenuStateMap = /*#__PURE__*/Object.freeze({
65654
+ entering: 'opening',
65655
+ entered: 'open',
65656
+ exiting: 'closing',
65657
+ exited: 'closed'
65658
+ });
65659
+ var positionAbsolute = 'absolute';
65660
+ var roleNone = 'presentation';
65661
+ var roleMenuitem = 'menuitem';
65662
+ var dummyItemProps = {
65663
+ 'aria-hidden': true,
65664
+ role: roleMenuitem
65665
+ };
65666
+
65667
+
65668
+
65669
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuButton.js
65670
+
65671
+
65672
+
65673
+
65674
+
65675
+
65676
+
65677
+
65678
+
65679
+ var _excluded = ["className", "isOpen", "disabled", "children"];
65680
+ var MenuButton = /*#__PURE__*/defineName('MenuButton', /*#__PURE__*/(0,external_react_.forwardRef)(function MenuButton(_ref, ref) {
65681
+ var className = _ref.className,
65682
+ isOpen = _ref.isOpen,
65683
+ disabled = _ref.disabled,
65684
+ children = _ref.children,
65685
+ restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
65686
+ var modifiers = (0,external_react_.useMemo)(function () {
65687
+ return {
65688
+ open: isOpen
65689
+ };
65690
+ }, [isOpen]);
65691
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("button", _extends({
65692
+ "aria-haspopup": true,
65693
+ "aria-expanded": isOpen,
65694
+ "aria-disabled": disabled || undefined,
65695
+ type: "button",
65696
+ disabled: disabled
65697
+ }, restProps, {
65698
+ ref: ref,
65699
+ className: useBEM({
65700
+ block: menuButtonClass,
65701
+ modifiers: modifiers,
65702
+ className: className
65703
+ }),
65704
+ children: children
65705
+ }));
65706
+ }));
65707
+ false ? 0 : void 0;
65708
+
65709
+
65710
+
65711
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuContainer.js
65712
+
65713
+
65714
+
65715
+
65716
+
65717
+
65718
+
65719
+ var MenuContainer = function MenuContainer(_ref) {
65720
+ var className = _ref.className,
65721
+ containerRef = _ref.containerRef,
65722
+ containerProps = _ref.containerProps,
65723
+ children = _ref.children,
65724
+ isOpen = _ref.isOpen,
65725
+ skipOpen = _ref.skipOpen,
65726
+ theming = _ref.theming,
65727
+ transition = _ref.transition,
65728
+ onClose = _ref.onClose;
65729
+ var itemTransition = getTransition(transition, 'item');
65730
+ var onKeyDown = function onKeyDown(_ref2) {
65731
+ var key = _ref2.key;
65732
+ switch (key) {
65733
+ case Keys.ESC:
65734
+ safeCall(onClose, {
65735
+ key: key,
65736
+ reason: CloseReason.CANCEL
65737
+ });
65738
+ break;
65739
+ }
65740
+ };
65741
+ var onBlur = function onBlur(e) {
65742
+ if (isOpen && !e.currentTarget.contains(e.relatedTarget || document.activeElement)) {
65743
+ safeCall(onClose, {
65744
+ reason: CloseReason.BLUR
65745
+ });
65746
+ if (skipOpen) {
65747
+ skipOpen.current = true;
65748
+ setTimeout(function () {
65749
+ return skipOpen.current = false;
65750
+ }, 300);
65751
+ }
65752
+ }
65753
+ };
65754
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({}, mergeProps({
65755
+ onKeyDown: onKeyDown,
65756
+ onBlur: onBlur
65757
+ }, containerProps), {
65758
+ className: useBEM({
65759
+ block: menuContainerClass,
65760
+ modifiers: (0,external_react_.useMemo)(function () {
65761
+ return {
65762
+ theme: theming,
65763
+ itemTransition: itemTransition
65764
+ };
65765
+ }, [theming, itemTransition]),
65766
+ className: className
65767
+ }),
65768
+ style: _extends({
65769
+ position: 'absolute'
65770
+ }, containerProps == null ? void 0 : containerProps.style),
65771
+ ref: containerRef,
65772
+ children: children
65773
+ }));
65774
+ };
65775
+
65776
+
65777
+
65778
+ ;// ./node_modules/@szhsin/react-menu/dist/es/utils/submenuCtx.js
65779
+ var createSubmenuCtx = function createSubmenuCtx() {
65780
+ var timer,
65781
+ count = 0;
65782
+ return {
65783
+ toggle: function toggle(isOpen) {
65784
+ isOpen ? count++ : count--;
65785
+ count = Math.max(count, 0);
65786
+ },
65787
+ on: function on(closeDelay, pending, settled) {
65788
+ if (count) {
65789
+ if (!timer) timer = setTimeout(function () {
65790
+ timer = 0;
65791
+ pending();
65792
+ }, closeDelay);
65793
+ } else {
65794
+ settled == null ? void 0 : settled();
65795
+ }
65796
+ },
65797
+ off: function off() {
65798
+ if (timer) {
65799
+ clearTimeout(timer);
65800
+ timer = 0;
65801
+ }
65802
+ }
65803
+ };
65804
+ };
65805
+
65806
+
65807
+
65808
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useItems.js
65809
+
65810
+
65811
+
65812
+
65813
+ var useItems = function useItems(menuRef, focusRef) {
65814
+ var _useState = (0,external_react_.useState)(),
65815
+ hoverItem = _useState[0],
65816
+ setHoverItem = _useState[1];
65817
+ var stateRef = (0,external_react_.useRef)({
65818
+ items: [],
65819
+ hoverIndex: -1,
65820
+ sorted: false
65821
+ });
65822
+ var mutableState = stateRef.current;
65823
+ var updateItems = (0,external_react_.useCallback)(function (item, isMounted) {
65824
+ var items = mutableState.items;
65825
+ if (!item) {
65826
+ mutableState.items = [];
65827
+ } else if (isMounted) {
65828
+ items.push(item);
65829
+ } else {
65830
+ var index = items.indexOf(item);
65831
+ if (index > -1) {
65832
+ items.splice(index, 1);
65833
+ if (item.contains(document.activeElement)) {
65834
+ focusRef.current.focus();
65835
+ setHoverItem();
65836
+ }
65837
+ }
65838
+ }
65839
+ mutableState.hoverIndex = -1;
65840
+ mutableState.sorted = false;
65841
+ }, [mutableState, focusRef]);
65842
+ var dispatch = (0,external_react_.useCallback)(function (actionType, item, nextIndex) {
65843
+ var items = mutableState.items,
65844
+ hoverIndex = mutableState.hoverIndex;
65845
+ var sortItems = function sortItems() {
65846
+ if (mutableState.sorted) return;
65847
+ var orderedNodes = menuRef.current.querySelectorAll('.szh-menu__item');
65848
+ items.sort(function (a, b) {
65849
+ return indexOfNode(orderedNodes, a) - indexOfNode(orderedNodes, b);
65850
+ });
65851
+ mutableState.sorted = true;
65852
+ };
65853
+ var index = -1,
65854
+ newItem = undefined;
65855
+ switch (actionType) {
65856
+ case HoverActionTypes.RESET:
65857
+ break;
65858
+ case HoverActionTypes.SET:
65859
+ newItem = item;
65860
+ break;
65861
+ case HoverActionTypes.UNSET:
65862
+ newItem = function newItem(prevItem) {
65863
+ return prevItem === item ? undefined : prevItem;
65864
+ };
65865
+ break;
65866
+ case HoverActionTypes.FIRST:
65867
+ sortItems();
65868
+ index = 0;
65869
+ newItem = items[index];
65870
+ break;
65871
+ case HoverActionTypes.LAST:
65872
+ sortItems();
65873
+ index = items.length - 1;
65874
+ newItem = items[index];
65875
+ break;
65876
+ case HoverActionTypes.SET_INDEX:
65877
+ sortItems();
65878
+ index = nextIndex;
65879
+ newItem = items[index];
65880
+ break;
65881
+ case HoverActionTypes.INCREASE:
65882
+ sortItems();
65883
+ index = hoverIndex;
65884
+ if (index < 0) index = items.indexOf(item);
65885
+ index++;
65886
+ if (index >= items.length) index = 0;
65887
+ newItem = items[index];
65888
+ break;
65889
+ case HoverActionTypes.DECREASE:
65890
+ sortItems();
65891
+ index = hoverIndex;
65892
+ if (index < 0) index = items.indexOf(item);
65893
+ index--;
65894
+ if (index < 0) index = items.length - 1;
65895
+ newItem = items[index];
65896
+ break;
65897
+ default:
65898
+ if (false) {}
65899
+ }
65900
+ if (!newItem) index = -1;
65901
+ setHoverItem(newItem);
65902
+ mutableState.hoverIndex = index;
65903
+ }, [menuRef, mutableState]);
65904
+ return {
65905
+ hoverItem: hoverItem,
65906
+ dispatch: dispatch,
65907
+ updateItems: updateItems
65908
+ };
65909
+ };
65910
+
65911
+
65912
+
65913
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/getPositionHelpers.js
65914
+
65915
+
65916
+ var getPositionHelpers = function getPositionHelpers(containerRef, menuRef, menuScroll, boundingBoxPadding) {
65917
+ var menuRect = menuRef.current.getBoundingClientRect();
65918
+ var containerRect = containerRef.current.getBoundingClientRect();
65919
+ var boundingRect = menuScroll === window ? {
65920
+ left: 0,
65921
+ top: 0,
65922
+ right: document.documentElement.clientWidth,
65923
+ bottom: window.innerHeight
65924
+ } : menuScroll.getBoundingClientRect();
65925
+ var padding = parsePadding(boundingBoxPadding);
65926
+ var getLeftOverflow = function getLeftOverflow(x) {
65927
+ return x + containerRect.left - boundingRect.left - padding.left;
65928
+ };
65929
+ var getRightOverflow = function getRightOverflow(x) {
65930
+ return x + containerRect.left + menuRect.width - boundingRect.right + padding.right;
65931
+ };
65932
+ var getTopOverflow = function getTopOverflow(y) {
65933
+ return y + containerRect.top - boundingRect.top - padding.top;
65934
+ };
65935
+ var getBottomOverflow = function getBottomOverflow(y) {
65936
+ return y + containerRect.top + menuRect.height - boundingRect.bottom + padding.bottom;
65937
+ };
65938
+ var confineHorizontally = function confineHorizontally(x) {
65939
+ var leftOverflow = getLeftOverflow(x);
65940
+ if (leftOverflow < 0) {
65941
+ x -= leftOverflow;
65942
+ } else {
65943
+ var rightOverflow = getRightOverflow(x);
65944
+ if (rightOverflow > 0) {
65945
+ x -= rightOverflow;
65946
+ leftOverflow = getLeftOverflow(x);
65947
+ if (leftOverflow < 0) x -= leftOverflow;
65948
+ }
65949
+ }
65950
+ return x;
65951
+ };
65952
+ var confineVertically = function confineVertically(y) {
65953
+ var topOverflow = getTopOverflow(y);
65954
+ if (topOverflow < 0) {
65955
+ y -= topOverflow;
65956
+ } else {
65957
+ var bottomOverflow = getBottomOverflow(y);
65958
+ if (bottomOverflow > 0) {
65959
+ y -= bottomOverflow;
65960
+ topOverflow = getTopOverflow(y);
65961
+ if (topOverflow < 0) y -= topOverflow;
65962
+ }
65963
+ }
65964
+ return y;
65965
+ };
65966
+ return {
65967
+ menuRect: menuRect,
65968
+ containerRect: containerRect,
65969
+ getLeftOverflow: getLeftOverflow,
65970
+ getRightOverflow: getRightOverflow,
65971
+ getTopOverflow: getTopOverflow,
65972
+ getBottomOverflow: getBottomOverflow,
65973
+ confineHorizontally: confineHorizontally,
65974
+ confineVertically: confineVertically
65975
+ };
65976
+ };
65977
+
65978
+
65979
+
65980
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/placeArrowVertical.js
65981
+ var placeArrowVertical = function placeArrowVertical(_ref) {
65982
+ var arrowRef = _ref.arrowRef,
65983
+ menuY = _ref.menuY,
65984
+ anchorRect = _ref.anchorRect,
65985
+ containerRect = _ref.containerRect,
65986
+ menuRect = _ref.menuRect;
65987
+ var y = anchorRect.top - containerRect.top - menuY + anchorRect.height / 2;
65988
+ var offset = arrowRef.current.offsetHeight * 1.25;
65989
+ y = Math.max(offset, y);
65990
+ y = Math.min(y, menuRect.height - offset);
65991
+ return y;
65992
+ };
65993
+
65994
+
65995
+
65996
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/placeLeftorRight.js
65997
+
65998
+
65999
+ var placeLeftorRight = function placeLeftorRight(_ref) {
66000
+ var anchorRect = _ref.anchorRect,
66001
+ containerRect = _ref.containerRect,
66002
+ menuRect = _ref.menuRect,
66003
+ placeLeftorRightY = _ref.placeLeftorRightY,
66004
+ placeLeftX = _ref.placeLeftX,
66005
+ placeRightX = _ref.placeRightX,
66006
+ getLeftOverflow = _ref.getLeftOverflow,
66007
+ getRightOverflow = _ref.getRightOverflow,
66008
+ confineHorizontally = _ref.confineHorizontally,
66009
+ confineVertically = _ref.confineVertically,
66010
+ arrowRef = _ref.arrowRef,
66011
+ arrow = _ref.arrow,
66012
+ direction = _ref.direction,
66013
+ position = _ref.position;
66014
+ var computedDirection = direction;
66015
+ var y = placeLeftorRightY;
66016
+ if (position !== 'initial') {
66017
+ y = confineVertically(y);
66018
+ if (position === 'anchor') {
66019
+ y = Math.min(y, anchorRect.bottom - containerRect.top);
66020
+ y = Math.max(y, anchorRect.top - containerRect.top - menuRect.height);
66021
+ }
66022
+ }
66023
+ var x, leftOverflow, rightOverflow;
66024
+ if (computedDirection === 'left') {
66025
+ x = placeLeftX;
66026
+ if (position !== 'initial') {
66027
+ leftOverflow = getLeftOverflow(x);
66028
+ if (leftOverflow < 0) {
66029
+ rightOverflow = getRightOverflow(placeRightX);
66030
+ if (rightOverflow <= 0 || -leftOverflow > rightOverflow) {
66031
+ x = placeRightX;
66032
+ computedDirection = 'right';
66033
+ }
66034
+ }
66035
+ }
66036
+ } else {
66037
+ x = placeRightX;
66038
+ if (position !== 'initial') {
66039
+ rightOverflow = getRightOverflow(x);
66040
+ if (rightOverflow > 0) {
66041
+ leftOverflow = getLeftOverflow(placeLeftX);
66042
+ if (leftOverflow >= 0 || -leftOverflow < rightOverflow) {
66043
+ x = placeLeftX;
66044
+ computedDirection = 'left';
66045
+ }
66046
+ }
66047
+ }
66048
+ }
66049
+ if (position === 'auto') x = confineHorizontally(x);
66050
+ var arrowY = arrow ? placeArrowVertical({
66051
+ menuY: y,
66052
+ arrowRef: arrowRef,
66053
+ anchorRect: anchorRect,
66054
+ containerRect: containerRect,
66055
+ menuRect: menuRect
66056
+ }) : undefined;
66057
+ return {
66058
+ arrowY: arrowY,
66059
+ x: x,
66060
+ y: y,
66061
+ computedDirection: computedDirection
66062
+ };
66063
+ };
66064
+
66065
+
66066
+
66067
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/placeArrowHorizontal.js
66068
+ var placeArrowHorizontal = function placeArrowHorizontal(_ref) {
66069
+ var arrowRef = _ref.arrowRef,
66070
+ menuX = _ref.menuX,
66071
+ anchorRect = _ref.anchorRect,
66072
+ containerRect = _ref.containerRect,
66073
+ menuRect = _ref.menuRect;
66074
+ var x = anchorRect.left - containerRect.left - menuX + anchorRect.width / 2;
66075
+ var offset = arrowRef.current.offsetWidth * 1.25;
66076
+ x = Math.max(offset, x);
66077
+ x = Math.min(x, menuRect.width - offset);
66078
+ return x;
66079
+ };
66080
+
66081
+
66082
+
66083
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/placeToporBottom.js
66084
+
66085
+
66086
+ var placeToporBottom = function placeToporBottom(_ref) {
66087
+ var anchorRect = _ref.anchorRect,
66088
+ containerRect = _ref.containerRect,
66089
+ menuRect = _ref.menuRect,
66090
+ placeToporBottomX = _ref.placeToporBottomX,
66091
+ placeTopY = _ref.placeTopY,
66092
+ placeBottomY = _ref.placeBottomY,
66093
+ getTopOverflow = _ref.getTopOverflow,
66094
+ getBottomOverflow = _ref.getBottomOverflow,
66095
+ confineHorizontally = _ref.confineHorizontally,
66096
+ confineVertically = _ref.confineVertically,
66097
+ arrowRef = _ref.arrowRef,
66098
+ arrow = _ref.arrow,
66099
+ direction = _ref.direction,
66100
+ position = _ref.position;
66101
+ var computedDirection = direction === 'top' ? 'top' : 'bottom';
66102
+ var x = placeToporBottomX;
66103
+ if (position !== 'initial') {
66104
+ x = confineHorizontally(x);
66105
+ if (position === 'anchor') {
66106
+ x = Math.min(x, anchorRect.right - containerRect.left);
66107
+ x = Math.max(x, anchorRect.left - containerRect.left - menuRect.width);
66108
+ }
66109
+ }
66110
+ var y, topOverflow, bottomOverflow;
66111
+ if (computedDirection === 'top') {
66112
+ y = placeTopY;
66113
+ if (position !== 'initial') {
66114
+ topOverflow = getTopOverflow(y);
66115
+ if (topOverflow < 0) {
66116
+ bottomOverflow = getBottomOverflow(placeBottomY);
66117
+ if (bottomOverflow <= 0 || -topOverflow > bottomOverflow) {
66118
+ y = placeBottomY;
66119
+ computedDirection = 'bottom';
66120
+ }
66121
+ }
66122
+ }
66123
+ } else {
66124
+ y = placeBottomY;
66125
+ if (position !== 'initial') {
66126
+ bottomOverflow = getBottomOverflow(y);
66127
+ if (bottomOverflow > 0) {
66128
+ topOverflow = getTopOverflow(placeTopY);
66129
+ if (topOverflow >= 0 || -topOverflow < bottomOverflow) {
66130
+ y = placeTopY;
66131
+ computedDirection = 'top';
66132
+ }
66133
+ }
66134
+ }
66135
+ }
66136
+ if (position === 'auto') y = confineVertically(y);
66137
+ var arrowX = arrow ? placeArrowHorizontal({
66138
+ menuX: x,
66139
+ arrowRef: arrowRef,
66140
+ anchorRect: anchorRect,
66141
+ containerRect: containerRect,
66142
+ menuRect: menuRect
66143
+ }) : undefined;
66144
+ return {
66145
+ arrowX: arrowX,
66146
+ x: x,
66147
+ y: y,
66148
+ computedDirection: computedDirection
66149
+ };
66150
+ };
66151
+
66152
+
66153
+
66154
+ ;// ./node_modules/@szhsin/react-menu/dist/es/positionUtils/positionMenu.js
66155
+
66156
+
66157
+
66158
+
66159
+ var positionMenu = function positionMenu(_ref) {
66160
+ var arrow = _ref.arrow,
66161
+ align = _ref.align,
66162
+ direction = _ref.direction,
66163
+ offsetX = _ref.offsetX,
66164
+ offsetY = _ref.offsetY,
66165
+ position = _ref.position,
66166
+ anchorRect = _ref.anchorRect,
66167
+ arrowRef = _ref.arrowRef,
66168
+ positionHelpers = _ref.positionHelpers;
66169
+ var menuRect = positionHelpers.menuRect,
66170
+ containerRect = positionHelpers.containerRect;
66171
+ var horizontalOffset = offsetX;
66172
+ var verticalOffset = offsetY;
66173
+ if (arrow) {
66174
+ if (direction === 'left' || direction === 'right') {
66175
+ horizontalOffset += arrowRef.current.offsetWidth;
66176
+ } else {
66177
+ verticalOffset += arrowRef.current.offsetHeight;
66178
+ }
66179
+ }
66180
+ var placeLeftX = anchorRect.left - containerRect.left - menuRect.width - horizontalOffset;
66181
+ var placeRightX = anchorRect.right - containerRect.left + horizontalOffset;
66182
+ var placeTopY = anchorRect.top - containerRect.top - menuRect.height - verticalOffset;
66183
+ var placeBottomY = anchorRect.bottom - containerRect.top + verticalOffset;
66184
+ var placeToporBottomX, placeLeftorRightY;
66185
+ if (align === 'end') {
66186
+ placeToporBottomX = anchorRect.right - containerRect.left - menuRect.width;
66187
+ placeLeftorRightY = anchorRect.bottom - containerRect.top - menuRect.height;
66188
+ } else if (align === 'center') {
66189
+ placeToporBottomX = anchorRect.left - containerRect.left - (menuRect.width - anchorRect.width) / 2;
66190
+ placeLeftorRightY = anchorRect.top - containerRect.top - (menuRect.height - anchorRect.height) / 2;
66191
+ } else {
66192
+ placeToporBottomX = anchorRect.left - containerRect.left;
66193
+ placeLeftorRightY = anchorRect.top - containerRect.top;
66194
+ }
66195
+ placeToporBottomX += horizontalOffset;
66196
+ placeLeftorRightY += verticalOffset;
66197
+ var options = _extends({}, positionHelpers, {
66198
+ anchorRect: anchorRect,
66199
+ placeLeftX: placeLeftX,
66200
+ placeRightX: placeRightX,
66201
+ placeLeftorRightY: placeLeftorRightY,
66202
+ placeTopY: placeTopY,
66203
+ placeBottomY: placeBottomY,
66204
+ placeToporBottomX: placeToporBottomX,
66205
+ arrowRef: arrowRef,
66206
+ arrow: arrow,
66207
+ direction: direction,
66208
+ position: position
66209
+ });
66210
+ switch (direction) {
66211
+ case 'left':
66212
+ case 'right':
66213
+ return placeLeftorRight(options);
66214
+ case 'top':
66215
+ case 'bottom':
66216
+ default:
66217
+ return placeToporBottom(options);
66218
+ }
66219
+ };
66220
+
66221
+
66222
+
66223
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useIsomorphicLayoutEffect.js
66224
+
66225
+
66226
+ var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? external_react_.useLayoutEffect : external_react_.useEffect;
66227
+
66228
+
66229
+
66230
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useCombinedRef.js
66231
+
66232
+
66233
+ function setRef(ref, instance) {
66234
+ typeof ref === 'function' ? ref(instance) : ref.current = instance;
66235
+ }
66236
+ var useCombinedRef = function useCombinedRef(refA, refB) {
66237
+ return (0,external_react_.useMemo)(function () {
66238
+ if (!refA) return refB;
66239
+ if (!refB) return refA;
66240
+ return function (instance) {
66241
+ setRef(refA, instance);
66242
+ setRef(refB, instance);
66243
+ };
66244
+ }, [refA, refB]);
66245
+ };
66246
+
66247
+
66248
+
66249
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuList.js
66250
+
66251
+
66252
+
66253
+
66254
+
66255
+
66256
+
66257
+
66258
+
66259
+
66260
+
66261
+
66262
+
66263
+
66264
+
66265
+ var MenuList_excluded = ["ariaLabel", "menuClassName", "menuStyle", "arrowClassName", "arrowStyle", "anchorPoint", "anchorRef", "containerRef", "containerProps", "focusProps", "externalRef", "parentScrollingRef", "arrow", "align", "direction", "position", "overflow", "setDownOverflow", "repositionFlag", "captureFocus", "state", "endTransition", "isDisabled", "menuItemFocus", "offsetX", "offsetY", "children", "onClose"];
66266
+ var MenuList = function MenuList(_ref) {
66267
+ var ariaLabel = _ref.ariaLabel,
66268
+ menuClassName = _ref.menuClassName,
66269
+ menuStyle = _ref.menuStyle,
66270
+ arrowClassName = _ref.arrowClassName,
66271
+ arrowStyle = _ref.arrowStyle,
66272
+ anchorPoint = _ref.anchorPoint,
66273
+ anchorRef = _ref.anchorRef,
66274
+ containerRef = _ref.containerRef,
66275
+ containerProps = _ref.containerProps,
66276
+ focusProps = _ref.focusProps,
66277
+ externalRef = _ref.externalRef,
66278
+ parentScrollingRef = _ref.parentScrollingRef,
66279
+ arrow = _ref.arrow,
66280
+ _ref$align = _ref.align,
66281
+ align = _ref$align === void 0 ? 'start' : _ref$align,
66282
+ _ref$direction = _ref.direction,
66283
+ direction = _ref$direction === void 0 ? 'bottom' : _ref$direction,
66284
+ _ref$position = _ref.position,
66285
+ position = _ref$position === void 0 ? 'auto' : _ref$position,
66286
+ _ref$overflow = _ref.overflow,
66287
+ overflow = _ref$overflow === void 0 ? 'visible' : _ref$overflow,
66288
+ setDownOverflow = _ref.setDownOverflow,
66289
+ repositionFlag = _ref.repositionFlag,
66290
+ _ref$captureFocus = _ref.captureFocus,
66291
+ captureFocus = _ref$captureFocus === void 0 ? true : _ref$captureFocus,
66292
+ state = _ref.state,
66293
+ endTransition = _ref.endTransition,
66294
+ isDisabled = _ref.isDisabled,
66295
+ menuItemFocus = _ref.menuItemFocus,
66296
+ _ref$offsetX = _ref.offsetX,
66297
+ offsetX = _ref$offsetX === void 0 ? 0 : _ref$offsetX,
66298
+ _ref$offsetY = _ref.offsetY,
66299
+ offsetY = _ref$offsetY === void 0 ? 0 : _ref$offsetY,
66300
+ children = _ref.children,
66301
+ onClose = _ref.onClose,
66302
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuList_excluded);
66303
+ var _useState = (0,external_react_.useState)({
66304
+ x: 0,
66305
+ y: 0
66306
+ }),
66307
+ menuPosition = _useState[0],
66308
+ setMenuPosition = _useState[1];
66309
+ var _useState2 = (0,external_react_.useState)({}),
66310
+ arrowPosition = _useState2[0],
66311
+ setArrowPosition = _useState2[1];
66312
+ var _useState3 = (0,external_react_.useState)(),
66313
+ overflowData = _useState3[0],
66314
+ setOverflowData = _useState3[1];
66315
+ var _useState4 = (0,external_react_.useState)(direction),
66316
+ expandedDirection = _useState4[0],
66317
+ setExpandedDirection = _useState4[1];
66318
+ var _useState5 = (0,external_react_.useState)(createSubmenuCtx),
66319
+ submenuCtx = _useState5[0];
66320
+ var _useReducer = (0,external_react_.useReducer)(function (c) {
66321
+ return c + 1;
66322
+ }, 1),
66323
+ reposSubmenu = _useReducer[0],
66324
+ forceReposSubmenu = _useReducer[1];
66325
+ var _useContext = (0,external_react_.useContext)(SettingsContext),
66326
+ transition = _useContext.transition,
66327
+ boundingBoxRef = _useContext.boundingBoxRef,
66328
+ boundingBoxPadding = _useContext.boundingBoxPadding,
66329
+ rootMenuRef = _useContext.rootMenuRef,
66330
+ rootAnchorRef = _useContext.rootAnchorRef,
66331
+ scrollNodesRef = _useContext.scrollNodesRef,
66332
+ reposition = _useContext.reposition,
66333
+ viewScroll = _useContext.viewScroll,
66334
+ submenuCloseDelay = _useContext.submenuCloseDelay;
66335
+ var _useContext2 = (0,external_react_.useContext)(MenuListContext),
66336
+ parentSubmenuCtx = _useContext2.submenuCtx,
66337
+ _useContext2$reposSub = _useContext2.reposSubmenu,
66338
+ reposFlag = _useContext2$reposSub === void 0 ? repositionFlag : _useContext2$reposSub;
66339
+ var menuRef = (0,external_react_.useRef)(null);
66340
+ var focusRef = (0,external_react_.useRef)();
66341
+ var arrowRef = (0,external_react_.useRef)();
66342
+ var prevOpen = (0,external_react_.useRef)(false);
66343
+ var latestMenuSize = (0,external_react_.useRef)({
66344
+ width: 0,
66345
+ height: 0
66346
+ });
66347
+ var latestHandlePosition = (0,external_react_.useRef)(function () {});
66348
+ var _useItems = useItems(menuRef, focusRef),
66349
+ hoverItem = _useItems.hoverItem,
66350
+ dispatch = _useItems.dispatch,
66351
+ updateItems = _useItems.updateItems;
66352
+ var isOpen = isMenuOpen(state);
66353
+ var openTransition = getTransition(transition, 'open');
66354
+ var closeTransition = getTransition(transition, 'close');
66355
+ var scrollNodes = scrollNodesRef.current;
66356
+ var onKeyDown = function onKeyDown(e) {
66357
+ switch (e.key) {
66358
+ case Keys.HOME:
66359
+ dispatch(HoverActionTypes.FIRST);
66360
+ break;
66361
+ case Keys.END:
66362
+ dispatch(HoverActionTypes.LAST);
66363
+ break;
66364
+ case Keys.UP:
66365
+ dispatch(HoverActionTypes.DECREASE, hoverItem);
66366
+ break;
66367
+ case Keys.DOWN:
66368
+ dispatch(HoverActionTypes.INCREASE, hoverItem);
66369
+ break;
66370
+ case Keys.SPACE:
66371
+ if (e.target && e.target.className.indexOf(menuClass) !== -1) {
66372
+ e.preventDefault();
66373
+ }
66374
+ return;
66375
+ default:
66376
+ return;
66377
+ }
66378
+ e.preventDefault();
66379
+ e.stopPropagation();
66380
+ };
66381
+ var onAnimationEnd = function onAnimationEnd() {
66382
+ if (state === 'closing') {
66383
+ setOverflowData();
66384
+ }
66385
+ safeCall(endTransition);
66386
+ };
66387
+ var onPointerMove = function onPointerMove(e) {
66388
+ e.stopPropagation();
66389
+ submenuCtx.on(submenuCloseDelay, function () {
66390
+ dispatch(HoverActionTypes.RESET);
66391
+ focusRef.current.focus();
66392
+ });
66393
+ };
66394
+ var onPointerLeave = function onPointerLeave(e) {
66395
+ if (e.target === e.currentTarget) submenuCtx.off();
66396
+ };
66397
+ var handlePosition = (0,external_react_.useCallback)(function (noOverflowCheck) {
66398
+ var _anchorRef$current;
66399
+ var anchorRect = anchorRef ? (_anchorRef$current = anchorRef.current) == null ? void 0 : _anchorRef$current.getBoundingClientRect() : anchorPoint ? {
66400
+ left: anchorPoint.x,
66401
+ right: anchorPoint.x,
66402
+ top: anchorPoint.y,
66403
+ bottom: anchorPoint.y,
66404
+ width: 0,
66405
+ height: 0
66406
+ } : null;
66407
+ if (!anchorRect) {
66408
+ if (false) {}
66409
+ return;
66410
+ }
66411
+ if (!scrollNodes.menu) {
66412
+ scrollNodes.menu = (boundingBoxRef ? boundingBoxRef.current : getScrollAncestor(rootMenuRef.current)) || window;
66413
+ }
66414
+ var positionHelpers = getPositionHelpers(containerRef, menuRef, scrollNodes.menu, boundingBoxPadding);
66415
+ var _positionMenu = positionMenu({
66416
+ arrow: arrow,
66417
+ align: align,
66418
+ direction: direction,
66419
+ offsetX: offsetX,
66420
+ offsetY: offsetY,
66421
+ position: position,
66422
+ anchorRect: anchorRect,
66423
+ arrowRef: arrowRef,
66424
+ positionHelpers: positionHelpers
66425
+ }),
66426
+ arrowX = _positionMenu.arrowX,
66427
+ arrowY = _positionMenu.arrowY,
66428
+ x = _positionMenu.x,
66429
+ y = _positionMenu.y,
66430
+ computedDirection = _positionMenu.computedDirection;
66431
+ var menuRect = positionHelpers.menuRect;
66432
+ var menuHeight = menuRect.height;
66433
+ if (!noOverflowCheck && overflow !== 'visible') {
66434
+ var getTopOverflow = positionHelpers.getTopOverflow,
66435
+ getBottomOverflow = positionHelpers.getBottomOverflow;
66436
+ var height, _overflowAmt;
66437
+ var prevHeight = latestMenuSize.current.height;
66438
+ var bottomOverflow = getBottomOverflow(y);
66439
+ if (bottomOverflow > 0 || floatEqual(bottomOverflow, 0) && floatEqual(menuHeight, prevHeight)) {
66440
+ height = menuHeight - bottomOverflow;
66441
+ _overflowAmt = bottomOverflow;
66442
+ } else {
66443
+ var topOverflow = getTopOverflow(y);
66444
+ if (topOverflow < 0 || floatEqual(topOverflow, 0) && floatEqual(menuHeight, prevHeight)) {
66445
+ height = menuHeight + topOverflow;
66446
+ _overflowAmt = 0 - topOverflow;
66447
+ if (height >= 0) y -= topOverflow;
66448
+ }
66449
+ }
66450
+ if (height >= 0) {
66451
+ menuHeight = height;
66452
+ setOverflowData({
66453
+ height: height,
66454
+ overflowAmt: _overflowAmt
66455
+ });
66456
+ } else {
66457
+ setOverflowData();
66458
+ }
66459
+ }
66460
+ if (arrow) setArrowPosition({
66461
+ x: arrowX,
66462
+ y: arrowY
66463
+ });
66464
+ setMenuPosition({
66465
+ x: x,
66466
+ y: y
66467
+ });
66468
+ setExpandedDirection(computedDirection);
66469
+ latestMenuSize.current = {
66470
+ width: menuRect.width,
66471
+ height: menuHeight
66472
+ };
66473
+ }, [arrow, align, boundingBoxPadding, direction, offsetX, offsetY, position, overflow, anchorPoint, anchorRef, containerRef, boundingBoxRef, rootMenuRef, scrollNodes]);
66474
+ useIsomorphicLayoutEffect(function () {
66475
+ if (isOpen) {
66476
+ handlePosition();
66477
+ if (prevOpen.current) forceReposSubmenu();
66478
+ }
66479
+ prevOpen.current = isOpen;
66480
+ latestHandlePosition.current = handlePosition;
66481
+ }, [isOpen, handlePosition, reposFlag]);
66482
+ useIsomorphicLayoutEffect(function () {
66483
+ if (overflowData && !setDownOverflow) menuRef.current.scrollTop = 0;
66484
+ }, [overflowData, setDownOverflow]);
66485
+ useIsomorphicLayoutEffect(function () {
66486
+ return updateItems;
66487
+ }, [updateItems]);
66488
+ (0,external_react_.useEffect)(function () {
66489
+ var menuScroll = scrollNodes.menu;
66490
+ if (!isOpen || !menuScroll) return;
66491
+ menuScroll = menuScroll.addEventListener ? menuScroll : window;
66492
+ if (!scrollNodes.anchors) {
66493
+ scrollNodes.anchors = [];
66494
+ var anchorScroll = getScrollAncestor(rootAnchorRef && rootAnchorRef.current);
66495
+ while (anchorScroll && anchorScroll !== menuScroll) {
66496
+ scrollNodes.anchors.push(anchorScroll);
66497
+ anchorScroll = getScrollAncestor(anchorScroll);
66498
+ }
66499
+ }
66500
+ var scroll = viewScroll;
66501
+ if (scrollNodes.anchors.length && scroll === 'initial') scroll = 'auto';
66502
+ if (scroll === 'initial') return;
66503
+ var handleScroll = function handleScroll() {
66504
+ if (scroll === 'auto') {
66505
+ batchedUpdates(function () {
66506
+ return handlePosition(true);
66507
+ });
66508
+ } else {
66509
+ safeCall(onClose, {
66510
+ reason: CloseReason.SCROLL
66511
+ });
66512
+ }
66513
+ };
66514
+ var scrollObservers = scrollNodes.anchors.concat(viewScroll !== 'initial' ? menuScroll : []);
66515
+ scrollObservers.forEach(function (o) {
66516
+ return o.addEventListener('scroll', handleScroll);
66517
+ });
66518
+ return function () {
66519
+ return scrollObservers.forEach(function (o) {
66520
+ return o.removeEventListener('scroll', handleScroll);
66521
+ });
66522
+ };
66523
+ }, [rootAnchorRef, scrollNodes, isOpen, onClose, viewScroll, handlePosition]);
66524
+ var hasOverflow = !!overflowData && overflowData.overflowAmt > 0;
66525
+ (0,external_react_.useEffect)(function () {
66526
+ if (hasOverflow || !isOpen || !parentScrollingRef) return;
66527
+ var handleScroll = function handleScroll() {
66528
+ return batchedUpdates(handlePosition);
66529
+ };
66530
+ var parentScroll = parentScrollingRef.current;
66531
+ parentScroll.addEventListener('scroll', handleScroll);
66532
+ return function () {
66533
+ return parentScroll.removeEventListener('scroll', handleScroll);
66534
+ };
66535
+ }, [isOpen, hasOverflow, parentScrollingRef, handlePosition]);
66536
+ (0,external_react_.useEffect)(function () {
66537
+ if (typeof ResizeObserver !== 'function' || reposition === 'initial') return;
66538
+ var resizeObserver = new ResizeObserver(function (_ref2) {
66539
+ var entry = _ref2[0];
66540
+ var borderBoxSize = entry.borderBoxSize,
66541
+ target = entry.target;
66542
+ var width, height;
66543
+ if (borderBoxSize) {
66544
+ var _ref3 = borderBoxSize[0] || borderBoxSize,
66545
+ inlineSize = _ref3.inlineSize,
66546
+ blockSize = _ref3.blockSize;
66547
+ width = inlineSize;
66548
+ height = blockSize;
66549
+ } else {
66550
+ var borderRect = target.getBoundingClientRect();
66551
+ width = borderRect.width;
66552
+ height = borderRect.height;
66553
+ }
66554
+ if (width === 0 || height === 0) return;
66555
+ if (floatEqual(width, latestMenuSize.current.width, 1) && floatEqual(height, latestMenuSize.current.height, 1)) return;
66556
+ (0,external_react_dom_.flushSync)(function () {
66557
+ latestHandlePosition.current();
66558
+ forceReposSubmenu();
66559
+ });
66560
+ });
66561
+ var observeTarget = menuRef.current;
66562
+ resizeObserver.observe(observeTarget, {
66563
+ box: 'border-box'
66564
+ });
66565
+ return function () {
66566
+ return resizeObserver.unobserve(observeTarget);
66567
+ };
66568
+ }, [reposition]);
66569
+ (0,external_react_.useEffect)(function () {
66570
+ if (!isOpen) {
66571
+ dispatch(HoverActionTypes.RESET);
66572
+ if (!closeTransition) setOverflowData();
66573
+ return;
66574
+ }
66575
+ var _ref4 = menuItemFocus || {},
66576
+ position = _ref4.position,
66577
+ alwaysUpdate = _ref4.alwaysUpdate;
66578
+ var setItemFocus = function setItemFocus() {
66579
+ if (position === FocusPositions.FIRST) {
66580
+ dispatch(HoverActionTypes.FIRST);
66581
+ } else if (position === FocusPositions.LAST) {
66582
+ dispatch(HoverActionTypes.LAST);
66583
+ } else if (position >= -1) {
66584
+ dispatch(HoverActionTypes.SET_INDEX, undefined, position);
66585
+ }
66586
+ };
66587
+ if (alwaysUpdate) {
66588
+ setItemFocus();
66589
+ } else if (captureFocus) {
66590
+ var id = setTimeout(function () {
66591
+ if (!menuRef.current.contains(document.activeElement)) {
66592
+ focusRef.current.focus();
66593
+ setItemFocus();
66594
+ }
66595
+ }, openTransition ? 170 : 100);
66596
+ return function () {
66597
+ return clearTimeout(id);
66598
+ };
66599
+ }
66600
+ }, [isOpen, openTransition, closeTransition, captureFocus, menuItemFocus, dispatch]);
66601
+ var itemContext = (0,external_react_.useMemo)(function () {
66602
+ return {
66603
+ isParentOpen: isOpen,
66604
+ submenuCtx: submenuCtx,
66605
+ dispatch: dispatch,
66606
+ updateItems: updateItems
66607
+ };
66608
+ }, [isOpen, submenuCtx, dispatch, updateItems]);
66609
+ var maxHeight, overflowAmt;
66610
+ if (overflowData) {
66611
+ setDownOverflow ? overflowAmt = overflowData.overflowAmt : maxHeight = overflowData.height;
66612
+ }
66613
+ var listContext = (0,external_react_.useMemo)(function () {
66614
+ return {
66615
+ reposSubmenu: reposSubmenu,
66616
+ submenuCtx: submenuCtx,
66617
+ overflow: overflow,
66618
+ overflowAmt: overflowAmt,
66619
+ parentMenuRef: menuRef,
66620
+ parentDir: expandedDirection
66621
+ };
66622
+ }, [reposSubmenu, submenuCtx, overflow, overflowAmt, expandedDirection]);
66623
+ var overflowStyle = maxHeight >= 0 ? {
66624
+ maxHeight: maxHeight,
66625
+ overflow: overflow
66626
+ } : undefined;
66627
+ var modifiers = (0,external_react_.useMemo)(function () {
66628
+ return {
66629
+ state: state,
66630
+ dir: expandedDirection
66631
+ };
66632
+ }, [state, expandedDirection]);
66633
+ var arrowModifiers = (0,external_react_.useMemo)(function () {
66634
+ return {
66635
+ dir: expandedDirection
66636
+ };
66637
+ }, [expandedDirection]);
66638
+ var _arrowClass = useBEM({
66639
+ block: menuClass,
66640
+ element: menuArrowClass,
66641
+ modifiers: arrowModifiers,
66642
+ className: arrowClassName
66643
+ });
66644
+ var menu = /*#__PURE__*/(0,jsx_runtime.jsxs)("ul", _extends({
66645
+ role: "menu",
66646
+ "aria-label": ariaLabel
66647
+ }, commonProps(isDisabled), mergeProps({
66648
+ onPointerEnter: parentSubmenuCtx == null ? void 0 : parentSubmenuCtx.off,
66649
+ onPointerMove: onPointerMove,
66650
+ onPointerLeave: onPointerLeave,
66651
+ onKeyDown: onKeyDown,
66652
+ onAnimationEnd: onAnimationEnd
66653
+ }, restProps), {
66654
+ ref: useCombinedRef(externalRef, menuRef),
66655
+ className: useBEM({
66656
+ block: menuClass,
66657
+ modifiers: modifiers,
66658
+ className: menuClassName
66659
+ }),
66660
+ style: _extends({}, menuStyle, overflowStyle, {
66661
+ margin: 0,
66662
+ display: state === 'closed' ? 'none' : undefined,
66663
+ position: positionAbsolute,
66664
+ left: menuPosition.x,
66665
+ top: menuPosition.y
66666
+ }),
66667
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({
66668
+ tabIndex: -1,
66669
+ style: {
66670
+ position: positionAbsolute,
66671
+ left: 0,
66672
+ top: 0,
66673
+ display: 'block',
66674
+ outline: 'none'
66675
+ },
66676
+ ref: focusRef
66677
+ }, dummyItemProps, focusProps)), arrow && /*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({
66678
+ className: _arrowClass,
66679
+ style: _extends({
66680
+ display: 'block',
66681
+ position: positionAbsolute,
66682
+ left: arrowPosition.x,
66683
+ top: arrowPosition.y
66684
+ }, arrowStyle),
66685
+ ref: arrowRef
66686
+ }, dummyItemProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(MenuListContext.Provider, {
66687
+ value: listContext,
66688
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(MenuListItemContext.Provider, {
66689
+ value: itemContext,
66690
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(HoverItemContext.Provider, {
66691
+ value: hoverItem,
66692
+ children: safeCall(children, modifiers)
66693
+ })
66694
+ })
66695
+ })]
66696
+ }));
66697
+ return containerProps ? /*#__PURE__*/(0,jsx_runtime.jsx)(MenuContainer, _extends({}, containerProps, {
66698
+ isOpen: isOpen,
66699
+ children: menu
66700
+ })) : menu;
66701
+ };
66702
+
66703
+
66704
+
66705
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/ControlledMenu.js
66706
+
66707
+
66708
+
66709
+
66710
+
66711
+
66712
+
66713
+
66714
+
66715
+
66716
+ var ControlledMenu_excluded = ["aria-label", "className", "containerProps", "initialMounted", "unmountOnClose", "transition", "transitionTimeout", "boundingBoxRef", "boundingBoxPadding", "reposition", "submenuOpenDelay", "submenuCloseDelay", "skipOpen", "viewScroll", "portal", "theming", "onItemClick"];
66717
+ var ControlledMenu = /*#__PURE__*/(0,external_react_.forwardRef)(function ControlledMenu(_ref, externalRef) {
66718
+ var ariaLabel = _ref['aria-label'],
66719
+ className = _ref.className,
66720
+ containerProps = _ref.containerProps,
66721
+ initialMounted = _ref.initialMounted,
66722
+ unmountOnClose = _ref.unmountOnClose,
66723
+ transition = _ref.transition,
66724
+ transitionTimeout = _ref.transitionTimeout,
66725
+ boundingBoxRef = _ref.boundingBoxRef,
66726
+ boundingBoxPadding = _ref.boundingBoxPadding,
66727
+ _ref$reposition = _ref.reposition,
66728
+ reposition = _ref$reposition === void 0 ? 'auto' : _ref$reposition,
66729
+ _ref$submenuOpenDelay = _ref.submenuOpenDelay,
66730
+ submenuOpenDelay = _ref$submenuOpenDelay === void 0 ? 300 : _ref$submenuOpenDelay,
66731
+ _ref$submenuCloseDela = _ref.submenuCloseDelay,
66732
+ submenuCloseDelay = _ref$submenuCloseDela === void 0 ? 150 : _ref$submenuCloseDela,
66733
+ skipOpen = _ref.skipOpen,
66734
+ _ref$viewScroll = _ref.viewScroll,
66735
+ viewScroll = _ref$viewScroll === void 0 ? 'initial' : _ref$viewScroll,
66736
+ portal = _ref.portal,
66737
+ theming = _ref.theming,
66738
+ onItemClick = _ref.onItemClick,
66739
+ restProps = _objectWithoutPropertiesLoose(_ref, ControlledMenu_excluded);
66740
+ var containerRef = (0,external_react_.useRef)(null);
66741
+ var scrollNodesRef = (0,external_react_.useRef)({});
66742
+ var anchorRef = restProps.anchorRef,
66743
+ state = restProps.state,
66744
+ onClose = restProps.onClose;
66745
+ var settings = (0,external_react_.useMemo)(function () {
66746
+ return {
66747
+ initialMounted: initialMounted,
66748
+ unmountOnClose: unmountOnClose,
66749
+ transition: transition,
66750
+ transitionTimeout: transitionTimeout,
66751
+ boundingBoxRef: boundingBoxRef,
66752
+ boundingBoxPadding: boundingBoxPadding,
66753
+ rootMenuRef: containerRef,
66754
+ rootAnchorRef: anchorRef,
66755
+ scrollNodesRef: scrollNodesRef,
66756
+ reposition: reposition,
66757
+ viewScroll: viewScroll,
66758
+ submenuOpenDelay: submenuOpenDelay,
66759
+ submenuCloseDelay: submenuCloseDelay
66760
+ };
66761
+ }, [initialMounted, unmountOnClose, transition, transitionTimeout, anchorRef, boundingBoxRef, boundingBoxPadding, reposition, viewScroll, submenuOpenDelay, submenuCloseDelay]);
66762
+ var eventHandlers = (0,external_react_.useMemo)(function () {
66763
+ return {
66764
+ handleClick: function handleClick(event, isCheckorRadio) {
66765
+ if (!event.stopPropagation) safeCall(onItemClick, event);
66766
+ var keepOpen = event.keepOpen;
66767
+ if (keepOpen === undefined) {
66768
+ keepOpen = isCheckorRadio && event.key === Keys.SPACE;
66769
+ }
66770
+ if (!keepOpen) {
66771
+ safeCall(onClose, {
66772
+ value: event.value,
66773
+ key: event.key,
66774
+ reason: CloseReason.CLICK
66775
+ });
66776
+ }
66777
+ },
66778
+ handleClose: function handleClose(key) {
66779
+ safeCall(onClose, {
66780
+ key: key,
66781
+ reason: CloseReason.CLICK
66782
+ });
66783
+ }
66784
+ };
66785
+ }, [onItemClick, onClose]);
66786
+ if (!state) return null;
66787
+ var menuList = /*#__PURE__*/(0,jsx_runtime.jsx)(SettingsContext.Provider, {
66788
+ value: settings,
66789
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(EventHandlersContext.Provider, {
66790
+ value: eventHandlers,
66791
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(MenuList, _extends({}, restProps, {
66792
+ ariaLabel: ariaLabel || 'Menu',
66793
+ externalRef: externalRef,
66794
+ containerRef: containerRef,
66795
+ containerProps: {
66796
+ className: className,
66797
+ containerRef: containerRef,
66798
+ containerProps: containerProps,
66799
+ skipOpen: skipOpen,
66800
+ theming: theming,
66801
+ transition: transition,
66802
+ onClose: onClose
66803
+ }
66804
+ }))
66805
+ })
66806
+ });
66807
+ if (portal === true && typeof document !== 'undefined') {
66808
+ return /*#__PURE__*/(0,external_react_dom_.createPortal)(menuList, document.body);
66809
+ } else if (portal) {
66810
+ return portal.target ? /*#__PURE__*/(0,external_react_dom_.createPortal)(menuList, portal.target) : portal.stablePosition ? null : menuList;
66811
+ }
66812
+ return menuList;
66813
+ });
66814
+ false ? 0 : void 0;
66815
+
66816
+
66817
+
66818
+ ;// ./node_modules/react-transition-state/dist/index.es.js
66819
+
66820
+
66821
+ var PRE_ENTER = 0;
66822
+ var ENTERING = 1;
66823
+ var ENTERED = 2;
66824
+ var PRE_EXIT = 3;
66825
+ var EXITING = 4;
66826
+ var EXITED = 5;
66827
+ var UNMOUNTED = 6;
66828
+ var STATES = ['preEnter', 'entering', 'entered', 'preExit', 'exiting', 'exited', 'unmounted'];
66829
+
66830
+ var startOrEnd = function startOrEnd(unmounted) {
66831
+ return unmounted ? UNMOUNTED : EXITED;
66832
+ };
66833
+
66834
+ var updateState = function updateState(state, setState, latestState, timeoutId, onChange) {
66835
+ clearTimeout(timeoutId.current);
66836
+ setState(state);
66837
+ latestState.current = state;
66838
+ onChange && onChange({
66839
+ state: STATES[state]
66840
+ });
66841
+ };
66842
+
66843
+ var useTransition = function useTransition(_temp) {
66844
+ var _ref = _temp === void 0 ? {} : _temp,
66845
+ _ref$enter = _ref.enter,
66846
+ enter = _ref$enter === void 0 ? true : _ref$enter,
66847
+ _ref$exit = _ref.exit,
66848
+ exit = _ref$exit === void 0 ? true : _ref$exit,
66849
+ preEnter = _ref.preEnter,
66850
+ preExit = _ref.preExit,
66851
+ timeout = _ref.timeout,
66852
+ initialEntered = _ref.initialEntered,
66853
+ mountOnEnter = _ref.mountOnEnter,
66854
+ unmountOnExit = _ref.unmountOnExit,
66855
+ onChange = _ref.onChange;
66856
+
66857
+ var _useState = (0,external_react_.useState)(initialEntered ? ENTERED : startOrEnd(mountOnEnter)),
66858
+ state = _useState[0],
66859
+ setState = _useState[1];
66860
+
66861
+ var latestState = (0,external_react_.useRef)(state);
66862
+ var timeoutId = (0,external_react_.useRef)();
66863
+ var enterTimeout, exitTimeout;
66864
+
66865
+ if (typeof timeout === 'object') {
66866
+ enterTimeout = timeout.enter;
66867
+ exitTimeout = timeout.exit;
66868
+ } else {
66869
+ enterTimeout = exitTimeout = timeout;
66870
+ }
66871
+
66872
+ var endTransition = (0,external_react_.useCallback)(function () {
66873
+ var newState;
66874
+
66875
+ switch (latestState.current) {
66876
+ case ENTERING:
66877
+ case PRE_ENTER:
66878
+ newState = ENTERED;
66879
+ break;
66880
+
66881
+ case EXITING:
66882
+ case PRE_EXIT:
66883
+ newState = startOrEnd(unmountOnExit);
66884
+ break;
66885
+ }
66886
+
66887
+ if (newState !== undefined) {
66888
+ updateState(newState, setState, latestState, timeoutId, onChange);
66889
+ }
66890
+ }, [onChange, unmountOnExit]);
66891
+ var toggle = (0,external_react_.useCallback)(function (toEnter) {
66892
+ var transitState = function transitState(newState) {
66893
+ updateState(newState, setState, latestState, timeoutId, onChange);
66894
+
66895
+ switch (newState) {
66896
+ case ENTERING:
66897
+ if (enterTimeout >= 0) timeoutId.current = setTimeout(endTransition, enterTimeout);
66898
+ break;
66899
+
66900
+ case EXITING:
66901
+ if (exitTimeout >= 0) timeoutId.current = setTimeout(endTransition, exitTimeout);
66902
+ break;
66903
+
66904
+ case PRE_ENTER:
66905
+ case PRE_EXIT:
66906
+ timeoutId.current = setTimeout(function () {
66907
+ return transitState(newState + 1);
66908
+ }, 0);
66909
+ break;
66910
+ }
66911
+ };
66912
+
66913
+ var enterStage = latestState.current <= ENTERED;
66914
+ if (typeof toEnter !== 'boolean') toEnter = !enterStage;
66915
+
66916
+ if (toEnter) {
66917
+ if (!enterStage) {
66918
+ transitState(enter ? preEnter ? PRE_ENTER : ENTERING : ENTERED);
66919
+ }
66920
+ } else {
66921
+ if (enterStage) {
66922
+ transitState(exit ? preExit ? PRE_EXIT : EXITING : startOrEnd(unmountOnExit));
66923
+ }
66924
+ }
66925
+ }, [endTransition, onChange, enter, exit, preEnter, preExit, enterTimeout, exitTimeout, unmountOnExit]);
66926
+ (0,external_react_.useEffect)(function () {
66927
+ return function () {
66928
+ return clearTimeout(timeoutId.current);
66929
+ };
66930
+ }, []);
66931
+ return [STATES[state], toggle, endTransition];
66932
+ };
66933
+
66934
+
66935
+
66936
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useMenuState.js
66937
+
66938
+
66939
+
66940
+
66941
+ var useMenuState = function useMenuState(_temp) {
66942
+ var _ref = _temp === void 0 ? {} : _temp,
66943
+ initialOpen = _ref.initialOpen,
66944
+ initialMounted = _ref.initialMounted,
66945
+ unmountOnClose = _ref.unmountOnClose,
66946
+ transition = _ref.transition,
66947
+ _ref$transitionTimeou = _ref.transitionTimeout,
66948
+ transitionTimeout = _ref$transitionTimeou === void 0 ? 500 : _ref$transitionTimeou;
66949
+ var _useTransition = useTransition({
66950
+ initialEntered: initialOpen,
66951
+ mountOnEnter: !initialMounted,
66952
+ unmountOnExit: unmountOnClose,
66953
+ timeout: transitionTimeout,
66954
+ enter: getTransition(transition, 'open'),
66955
+ exit: getTransition(transition, 'close')
66956
+ }),
66957
+ state = _useTransition[0],
66958
+ toggleMenu = _useTransition[1],
66959
+ endTransition = _useTransition[2];
66960
+ return [{
66961
+ state: MenuStateMap[state],
66962
+ endTransition: endTransition
66963
+ }, toggleMenu];
66964
+ };
66965
+
66966
+
66967
+
66968
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useMenuStateAndFocus.js
66969
+
66970
+
66971
+
66972
+
66973
+ var useMenuStateAndFocus = function useMenuStateAndFocus(options) {
66974
+ var _useMenuState = useMenuState(options),
66975
+ menuProps = _useMenuState[0],
66976
+ toggleMenu = _useMenuState[1];
66977
+ var _useState = (0,external_react_.useState)(),
66978
+ menuItemFocus = _useState[0],
66979
+ setMenuItemFocus = _useState[1];
66980
+ var openMenu = function openMenu(position, alwaysUpdate) {
66981
+ setMenuItemFocus({
66982
+ position: position,
66983
+ alwaysUpdate: alwaysUpdate
66984
+ });
66985
+ toggleMenu(true);
66986
+ };
66987
+ return [_extends({
66988
+ menuItemFocus: menuItemFocus
66989
+ }, menuProps), toggleMenu, openMenu];
66990
+ };
66991
+
66992
+
66993
+
66994
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useClick.js
66995
+
66996
+
66997
+ var useClick = function useClick(state, onToggle) {
66998
+ if (false) {}
66999
+ var _useState = (0,external_react_.useState)({}),
67000
+ skipOpen = _useState[0];
67001
+ return {
67002
+ onMouseDown: function onMouseDown() {
67003
+ skipOpen.v = state && state !== 'closed';
67004
+ },
67005
+ onClick: function onClick(e) {
67006
+ return skipOpen.v ? skipOpen.v = false : onToggle(true, e);
67007
+ }
67008
+ };
67009
+ };
67010
+
67011
+
67012
+
67013
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useMenuChange.js
67014
+
67015
+
67016
+
67017
+ var useMenuChange = function useMenuChange(onMenuChange, isOpen) {
67018
+ var prevOpen = (0,external_react_.useRef)(isOpen);
67019
+ (0,external_react_.useEffect)(function () {
67020
+ if (prevOpen.current !== isOpen) safeCall(onMenuChange, {
67021
+ open: isOpen
67022
+ });
67023
+ prevOpen.current = isOpen;
67024
+ }, [onMenuChange, isOpen]);
67025
+ };
67026
+
67027
+
67028
+
67029
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/Menu.js
67030
+
67031
+
67032
+
67033
+
67034
+
67035
+
67036
+
67037
+
67038
+
67039
+
67040
+
67041
+
67042
+
67043
+ var Menu_excluded = ["aria-label", "captureFocus", "initialOpen", "menuButton", "instanceRef", "onMenuChange"];
67044
+ var Menu = /*#__PURE__*/(0,external_react_.forwardRef)(function Menu(_ref, externalRef) {
67045
+ var ariaLabel = _ref['aria-label'],
67046
+ menuButton = _ref.menuButton,
67047
+ instanceRef = _ref.instanceRef,
67048
+ onMenuChange = _ref.onMenuChange,
67049
+ restProps = _objectWithoutPropertiesLoose(_ref, Menu_excluded);
67050
+ var _useMenuStateAndFocus = useMenuStateAndFocus(restProps),
67051
+ stateProps = _useMenuStateAndFocus[0],
67052
+ toggleMenu = _useMenuStateAndFocus[1],
67053
+ openMenu = _useMenuStateAndFocus[2];
67054
+ var state = stateProps.state;
67055
+ var isOpen = isMenuOpen(state);
67056
+ var buttonRef = (0,external_react_.useRef)(null);
67057
+ var anchorProps = useClick(state, function (_, e) {
67058
+ return openMenu(!e.detail ? FocusPositions.FIRST : undefined);
67059
+ });
67060
+ var handleClose = (0,external_react_.useCallback)(function (e) {
67061
+ toggleMenu(false);
67062
+ if (e.key) setTimeout(function () {
67063
+ var _buttonRef$current;
67064
+ return (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();
67065
+ }, 0);
67066
+ }, [toggleMenu]);
67067
+ var onKeyDown = function onKeyDown(e) {
67068
+ switch (e.key) {
67069
+ case Keys.UP:
67070
+ openMenu(FocusPositions.LAST);
67071
+ break;
67072
+ case Keys.DOWN:
67073
+ openMenu(FocusPositions.FIRST);
67074
+ break;
67075
+ default:
67076
+ return;
67077
+ }
67078
+ e.preventDefault();
67079
+ };
67080
+ var button = safeCall(menuButton, {
67081
+ open: isOpen
67082
+ });
67083
+ if (!button || !button.type) throw new Error('Menu requires a menuButton prop.');
67084
+ var buttonProps = _extends({
67085
+ ref: useCombinedRef(button.ref, buttonRef)
67086
+ }, mergeProps(_extends({
67087
+ onKeyDown: onKeyDown
67088
+ }, anchorProps), button.props));
67089
+ if (getName(button.type) === 'MenuButton') {
67090
+ buttonProps.isOpen = isOpen;
67091
+ }
67092
+ var renderButton = /*#__PURE__*/(0,external_react_.cloneElement)(button, buttonProps);
67093
+ useMenuChange(onMenuChange, isOpen);
67094
+ (0,external_react_.useImperativeHandle)(instanceRef, function () {
67095
+ return {
67096
+ openMenu: openMenu,
67097
+ closeMenu: function closeMenu() {
67098
+ return toggleMenu(false);
67099
+ }
67100
+ };
67101
+ });
67102
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(external_react_.Fragment, {
67103
+ children: [renderButton, /*#__PURE__*/(0,jsx_runtime.jsx)(ControlledMenu, _extends({}, restProps, stateProps, {
67104
+ "aria-label": ariaLabel || (typeof button.props.children === 'string' ? button.props.children : 'Menu'),
67105
+ anchorRef: buttonRef,
67106
+ ref: externalRef,
67107
+ onClose: handleClose
67108
+ }))]
67109
+ });
67110
+ });
67111
+ false ? 0 : void 0;
67112
+
67113
+
67114
+
67115
+ ;// ./node_modules/@szhsin/react-menu/dist/es/utils/withHovering.js
67116
+
67117
+
67118
+
67119
+
67120
+
67121
+ var withHovering = function withHovering(name, WrappedComponent) {
67122
+ var Component = /*#__PURE__*/(0,external_react_.memo)(WrappedComponent);
67123
+ var WithHovering = /*#__PURE__*/(0,external_react_.forwardRef)(function (props, ref) {
67124
+ var itemRef = (0,external_react_.useRef)(null);
67125
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(Component, _extends({}, props, {
67126
+ itemRef: itemRef,
67127
+ externalRef: ref,
67128
+ isHovering: (0,external_react_.useContext)(HoverItemContext) === itemRef.current
67129
+ }));
67130
+ });
67131
+ WithHovering.displayName = "WithHovering(" + name + ")";
67132
+ return WithHovering;
67133
+ };
67134
+
67135
+
67136
+
67137
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useItemEffect.js
67138
+
67139
+
67140
+ var useItemEffect = function useItemEffect(isDisabled, itemRef, updateItems) {
67141
+ useIsomorphicLayoutEffect(function () {
67142
+ if (false) {}
67143
+ if (isDisabled) return;
67144
+ var item = itemRef.current;
67145
+ updateItems(item, true);
67146
+ return function () {
67147
+ updateItems(item);
67148
+ };
67149
+ }, [isDisabled, itemRef, updateItems]);
67150
+ };
67151
+
67152
+
67153
+
67154
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/SubMenu.js
67155
+
67156
+
67157
+
67158
+
67159
+
67160
+
67161
+
67162
+
67163
+
67164
+
67165
+
67166
+
67167
+
67168
+
67169
+
67170
+
67171
+ var SubMenu_excluded = ["aria-label", "className", "disabled", "direction", "label", "openTrigger", "onMenuChange", "isHovering", "instanceRef", "itemRef", "captureFocus", "repositionFlag", "itemProps"],
67172
+ _excluded2 = ["ref", "className"];
67173
+ var SubMenu = /*#__PURE__*/withHovering('SubMenu', function SubMenu(_ref) {
67174
+ var ariaLabel = _ref['aria-label'],
67175
+ className = _ref.className,
67176
+ disabled = _ref.disabled,
67177
+ direction = _ref.direction,
67178
+ label = _ref.label,
67179
+ openTrigger = _ref.openTrigger,
67180
+ onMenuChange = _ref.onMenuChange,
67181
+ isHovering = _ref.isHovering,
67182
+ instanceRef = _ref.instanceRef,
67183
+ itemRef = _ref.itemRef,
67184
+ _ref$itemProps = _ref.itemProps,
67185
+ itemProps = _ref$itemProps === void 0 ? {} : _ref$itemProps,
67186
+ restProps = _objectWithoutPropertiesLoose(_ref, SubMenu_excluded);
67187
+ var settings = (0,external_react_.useContext)(SettingsContext);
67188
+ var rootMenuRef = settings.rootMenuRef,
67189
+ submenuOpenDelay = settings.submenuOpenDelay,
67190
+ submenuCloseDelay = settings.submenuCloseDelay;
67191
+ var _useContext = (0,external_react_.useContext)(MenuListContext),
67192
+ parentMenuRef = _useContext.parentMenuRef,
67193
+ parentDir = _useContext.parentDir,
67194
+ parentOverflow = _useContext.overflow;
67195
+ var _useContext2 = (0,external_react_.useContext)(MenuListItemContext),
67196
+ isParentOpen = _useContext2.isParentOpen,
67197
+ submenuCtx = _useContext2.submenuCtx,
67198
+ dispatch = _useContext2.dispatch,
67199
+ updateItems = _useContext2.updateItems;
67200
+ var isPortal = parentOverflow !== 'visible';
67201
+ var _useMenuStateAndFocus = useMenuStateAndFocus(settings),
67202
+ stateProps = _useMenuStateAndFocus[0],
67203
+ toggleMenu = _useMenuStateAndFocus[1],
67204
+ _openMenu = _useMenuStateAndFocus[2];
67205
+ var state = stateProps.state;
67206
+ var isDisabled = !!disabled;
67207
+ var isOpen = isMenuOpen(state);
67208
+ var containerRef = (0,external_react_.useRef)(null);
67209
+ var _useState = (0,external_react_.useState)({
67210
+ v: 0
67211
+ }),
67212
+ timerId = _useState[0];
67213
+ var stopTimer = function stopTimer() {
67214
+ submenuCtx.off();
67215
+ if (timerId.v) {
67216
+ clearTimeout(timerId.v);
67217
+ timerId.v = 0;
67218
+ }
67219
+ };
67220
+ var _openMenu2 = function openMenu() {
67221
+ stopTimer();
67222
+ setHover();
67223
+ !isDisabled && _openMenu.apply(void 0, arguments);
67224
+ };
67225
+ var setHover = function setHover() {
67226
+ return !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);
67227
+ };
67228
+ var delayOpen = function delayOpen(delay) {
67229
+ setHover();
67230
+ if (!openTrigger) timerId.v = setTimeout(function () {
67231
+ return batchedUpdates(_openMenu2);
67232
+ }, Math.max(delay, 0));
67233
+ };
67234
+ var onPointerMove = function onPointerMove(e) {
67235
+ if (isDisabled) return;
67236
+ e.stopPropagation();
67237
+ if (timerId.v || isOpen) return;
67238
+ submenuCtx.on(submenuCloseDelay, function () {
67239
+ return delayOpen(submenuOpenDelay - submenuCloseDelay);
67240
+ }, function () {
67241
+ return delayOpen(submenuOpenDelay);
67242
+ });
67243
+ };
67244
+ var onPointerLeave = function onPointerLeave() {
67245
+ stopTimer();
67246
+ if (!isOpen) dispatch(HoverActionTypes.UNSET, itemRef.current);
67247
+ };
67248
+ var onKeyDown = function onKeyDown(e) {
67249
+ if (!isHovering) return;
67250
+ switch (e.key) {
67251
+ case Keys.ENTER:
67252
+ case Keys.SPACE:
67253
+ case Keys.RIGHT:
67254
+ openTrigger !== 'none' && _openMenu2(FocusPositions.FIRST);
67255
+ break;
67256
+ }
67257
+ };
67258
+ var onKeyDownOfRoot = function onKeyDownOfRoot(e) {
67259
+ var handled = false;
67260
+ switch (e.key) {
67261
+ case Keys.LEFT:
67262
+ if (isOpen) {
67263
+ itemRef.current.focus();
67264
+ toggleMenu(false);
67265
+ handled = true;
67266
+ }
67267
+ break;
67268
+ case Keys.RIGHT:
67269
+ if (!isOpen) handled = true;
67270
+ break;
67271
+ }
67272
+ if (handled) {
67273
+ e.preventDefault();
67274
+ e.stopPropagation();
67275
+ }
67276
+ };
67277
+ useItemEffect(isDisabled, itemRef, updateItems);
67278
+ useMenuChange(onMenuChange, isOpen);
67279
+ (0,external_react_.useEffect)(function () {
67280
+ return submenuCtx.toggle(isOpen);
67281
+ }, [submenuCtx, isOpen]);
67282
+ (0,external_react_.useEffect)(function () {
67283
+ return function () {
67284
+ return clearTimeout(timerId.v);
67285
+ };
67286
+ }, [timerId]);
67287
+ (0,external_react_.useEffect)(function () {
67288
+ if (isHovering && isParentOpen) {
67289
+ itemRef.current.focus();
67290
+ } else {
67291
+ toggleMenu(false);
67292
+ }
67293
+ }, [isHovering, isParentOpen, toggleMenu, itemRef]);
67294
+ (0,external_react_.useImperativeHandle)(instanceRef, function () {
67295
+ return {
67296
+ openMenu: function openMenu() {
67297
+ isParentOpen && _openMenu2.apply(void 0, arguments);
67298
+ },
67299
+ closeMenu: function closeMenu() {
67300
+ if (isOpen) {
67301
+ itemRef.current.focus();
67302
+ toggleMenu(false);
67303
+ }
67304
+ }
67305
+ };
67306
+ });
67307
+ var modifiers = (0,external_react_.useMemo)(function () {
67308
+ return {
67309
+ open: isOpen,
67310
+ hover: isHovering,
67311
+ disabled: isDisabled,
67312
+ submenu: true
67313
+ };
67314
+ }, [isOpen, isHovering, isDisabled]);
67315
+ var externalItemRef = itemProps.ref,
67316
+ itemClassName = itemProps.className,
67317
+ restItemProps = _objectWithoutPropertiesLoose(itemProps, _excluded2);
67318
+ var mergedItemProps = mergeProps({
67319
+ onPointerEnter: submenuCtx.off,
67320
+ onPointerMove: onPointerMove,
67321
+ onPointerLeave: onPointerLeave,
67322
+ onKeyDown: onKeyDown,
67323
+ onClick: function onClick() {
67324
+ return openTrigger !== 'none' && _openMenu2();
67325
+ }
67326
+ }, restItemProps);
67327
+ var getMenuList = function getMenuList() {
67328
+ var menuList = /*#__PURE__*/(0,jsx_runtime.jsx)(MenuList, _extends({}, restProps, stateProps, {
67329
+ ariaLabel: ariaLabel || (typeof label === 'string' ? label : 'Submenu'),
67330
+ anchorRef: itemRef,
67331
+ containerRef: isPortal ? rootMenuRef : containerRef,
67332
+ direction: direction || (parentDir === 'right' || parentDir === 'left' ? parentDir : 'right'),
67333
+ parentScrollingRef: isPortal && parentMenuRef,
67334
+ isDisabled: isDisabled
67335
+ }));
67336
+ var container = rootMenuRef.current;
67337
+ return isPortal && container ? /*#__PURE__*/(0,external_react_dom_.createPortal)(menuList, container) : menuList;
67338
+ };
67339
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)("li", {
67340
+ className: useBEM({
67341
+ block: menuClass,
67342
+ element: subMenuClass,
67343
+ className: className
67344
+ }),
67345
+ style: {
67346
+ position: 'relative'
67347
+ },
67348
+ role: roleNone,
67349
+ ref: containerRef,
67350
+ onKeyDown: onKeyDownOfRoot,
67351
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({
67352
+ role: roleMenuitem,
67353
+ "aria-haspopup": true,
67354
+ "aria-expanded": isOpen
67355
+ }, commonProps(isDisabled, isHovering), mergedItemProps, {
67356
+ ref: useCombinedRef(externalItemRef, itemRef),
67357
+ className: useBEM({
67358
+ block: menuClass,
67359
+ element: menuItemClass,
67360
+ modifiers: modifiers,
67361
+ className: itemClassName
67362
+ }),
67363
+ children: (0,external_react_.useMemo)(function () {
67364
+ return safeCall(label, modifiers);
67365
+ }, [label, modifiers])
67366
+ })), state && getMenuList()]
67367
+ });
67368
+ });
67369
+ false ? 0 : void 0;
67370
+
67371
+
67372
+
67373
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useItemState.js
67374
+
67375
+
67376
+
67377
+
67378
+ var useItemState = function useItemState(itemRef, focusRef, isHovering, isDisabled) {
67379
+ var _useContext = (0,external_react_.useContext)(SettingsContext),
67380
+ submenuCloseDelay = _useContext.submenuCloseDelay;
67381
+ var _useContext2 = (0,external_react_.useContext)(MenuListItemContext),
67382
+ isParentOpen = _useContext2.isParentOpen,
67383
+ submenuCtx = _useContext2.submenuCtx,
67384
+ dispatch = _useContext2.dispatch,
67385
+ updateItems = _useContext2.updateItems;
67386
+ var setHover = function setHover() {
67387
+ !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, itemRef.current);
67388
+ };
67389
+ var unsetHover = function unsetHover() {
67390
+ !isDisabled && dispatch(HoverActionTypes.UNSET, itemRef.current);
67391
+ };
67392
+ var onBlur = function onBlur(e) {
67393
+ if (isHovering && !e.currentTarget.contains(e.relatedTarget)) unsetHover();
67394
+ };
67395
+ var onPointerMove = function onPointerMove(e) {
67396
+ if (!isDisabled) {
67397
+ e.stopPropagation();
67398
+ submenuCtx.on(submenuCloseDelay, setHover, setHover);
67399
+ }
67400
+ };
67401
+ var onPointerLeave = function onPointerLeave(_, keepHover) {
67402
+ submenuCtx.off();
67403
+ !keepHover && unsetHover();
67404
+ };
67405
+ useItemEffect(isDisabled, itemRef, updateItems);
67406
+ (0,external_react_.useEffect)(function () {
67407
+ if (isHovering && isParentOpen) {
67408
+ focusRef.current && focusRef.current.focus();
67409
+ }
67410
+ }, [focusRef, isHovering, isParentOpen]);
67411
+ return {
67412
+ setHover: setHover,
67413
+ onBlur: onBlur,
67414
+ onPointerMove: onPointerMove,
67415
+ onPointerLeave: onPointerLeave
67416
+ };
67417
+ };
67418
+
67419
+
67420
+
67421
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuItem.js
67422
+
67423
+
67424
+
67425
+
67426
+
67427
+
67428
+
67429
+
67430
+
67431
+
67432
+
67433
+
67434
+ var MenuItem_excluded = ["className", "value", "href", "type", "checked", "disabled", "children", "onClick", "isHovering", "itemRef", "externalRef"],
67435
+ MenuItem_excluded2 = ["setHover"];
67436
+ var MenuItem = /*#__PURE__*/withHovering('MenuItem', function MenuItem(_ref) {
67437
+ var className = _ref.className,
67438
+ value = _ref.value,
67439
+ href = _ref.href,
67440
+ type = _ref.type,
67441
+ checked = _ref.checked,
67442
+ disabled = _ref.disabled,
67443
+ children = _ref.children,
67444
+ onClick = _ref.onClick,
67445
+ isHovering = _ref.isHovering,
67446
+ itemRef = _ref.itemRef,
67447
+ externalRef = _ref.externalRef,
67448
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuItem_excluded);
67449
+ var isDisabled = !!disabled;
67450
+ var _useItemState = useItemState(itemRef, itemRef, isHovering, isDisabled),
67451
+ setHover = _useItemState.setHover,
67452
+ restStateProps = _objectWithoutPropertiesLoose(_useItemState, MenuItem_excluded2);
67453
+ var eventHandlers = (0,external_react_.useContext)(EventHandlersContext);
67454
+ var radioGroup = (0,external_react_.useContext)(RadioGroupContext);
67455
+ var isRadio = type === 'radio';
67456
+ var isCheckBox = type === 'checkbox';
67457
+ var isAnchor = !!href && !isDisabled && !isRadio && !isCheckBox;
67458
+ var isChecked = isRadio ? radioGroup.value === value : isCheckBox ? !!checked : false;
67459
+ var handleClick = function handleClick(e) {
67460
+ if (isDisabled) {
67461
+ e.stopPropagation();
67462
+ e.preventDefault();
67463
+ return;
67464
+ }
67465
+ var event = {
67466
+ value: value,
67467
+ syntheticEvent: e
67468
+ };
67469
+ if (e.key !== undefined) event.key = e.key;
67470
+ if (isCheckBox) event.checked = !isChecked;
67471
+ if (isRadio) event.name = radioGroup.name;
67472
+ safeCall(onClick, event);
67473
+ if (isRadio) safeCall(radioGroup.onRadioChange, event);
67474
+ eventHandlers.handleClick(event, isCheckBox || isRadio);
67475
+ };
67476
+ var handleKeyDown = function handleKeyDown(e) {
67477
+ if (!isHovering) return;
67478
+ switch (e.key) {
67479
+ case Keys.ENTER:
67480
+ case Keys.SPACE:
67481
+ isAnchor ? e.key === Keys.SPACE && itemRef.current.click() : handleClick(e);
67482
+ }
67483
+ };
67484
+ var modifiers = (0,external_react_.useMemo)(function () {
67485
+ return {
67486
+ type: type,
67487
+ disabled: isDisabled,
67488
+ hover: isHovering,
67489
+ checked: isChecked,
67490
+ anchor: isAnchor
67491
+ };
67492
+ }, [type, isDisabled, isHovering, isChecked, isAnchor]);
67493
+ var mergedProps = mergeProps(_extends({}, restStateProps, {
67494
+ onPointerDown: setHover,
67495
+ onKeyDown: handleKeyDown,
67496
+ onClick: handleClick
67497
+ }), restProps);
67498
+ var menuItemProps = _extends({
67499
+ role: isRadio ? 'menuitemradio' : isCheckBox ? 'menuitemcheckbox' : roleMenuitem,
67500
+ 'aria-checked': isRadio || isCheckBox ? isChecked : undefined
67501
+ }, commonProps(isDisabled, isHovering), mergedProps, {
67502
+ ref: useCombinedRef(externalRef, itemRef),
67503
+ className: useBEM({
67504
+ block: menuClass,
67505
+ element: menuItemClass,
67506
+ modifiers: modifiers,
67507
+ className: className
67508
+ }),
67509
+ children: (0,external_react_.useMemo)(function () {
67510
+ return safeCall(children, modifiers);
67511
+ }, [children, modifiers])
67512
+ });
67513
+ return isAnchor ? /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
67514
+ role: roleNone,
67515
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("a", _extends({
67516
+ href: href
67517
+ }, menuItemProps))
67518
+ }) : /*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({}, menuItemProps));
67519
+ });
67520
+ false ? 0 : void 0;
67521
+
67522
+
67523
+
67524
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/FocusableItem.js
67525
+
67526
+
67527
+
67528
+
67529
+
67530
+
67531
+
67532
+
67533
+
67534
+
67535
+
67536
+
67537
+ var FocusableItem_excluded = ["className", "disabled", "children", "isHovering", "itemRef", "externalRef"],
67538
+ FocusableItem_excluded2 = ["setHover", "onPointerLeave"];
67539
+ var FocusableItem = /*#__PURE__*/withHovering('FocusableItem', function FocusableItem(_ref) {
67540
+ var className = _ref.className,
67541
+ disabled = _ref.disabled,
67542
+ children = _ref.children,
67543
+ isHovering = _ref.isHovering,
67544
+ itemRef = _ref.itemRef,
67545
+ externalRef = _ref.externalRef,
67546
+ restProps = _objectWithoutPropertiesLoose(_ref, FocusableItem_excluded);
67547
+ var isDisabled = !!disabled;
67548
+ var ref = (0,external_react_.useRef)(null);
67549
+ var _useItemState = useItemState(itemRef, ref, isHovering, isDisabled),
67550
+ setHover = _useItemState.setHover,
67551
+ _onPointerLeave = _useItemState.onPointerLeave,
67552
+ restStateProps = _objectWithoutPropertiesLoose(_useItemState, FocusableItem_excluded2);
67553
+ var _useContext = (0,external_react_.useContext)(EventHandlersContext),
67554
+ handleClose = _useContext.handleClose;
67555
+ var modifiers = (0,external_react_.useMemo)(function () {
67556
+ return {
67557
+ disabled: isDisabled,
67558
+ hover: isHovering,
67559
+ focusable: true
67560
+ };
67561
+ }, [isDisabled, isHovering]);
67562
+ var renderChildren = (0,external_react_.useMemo)(function () {
67563
+ return safeCall(children, _extends({}, modifiers, {
67564
+ ref: ref,
67565
+ closeMenu: handleClose
67566
+ }));
67567
+ }, [children, modifiers, handleClose]);
67568
+ var mergedProps = mergeProps(_extends({}, restStateProps, {
67569
+ onPointerLeave: function onPointerLeave(e) {
67570
+ return _onPointerLeave(e, true);
67571
+ },
67572
+ onFocus: setHover
67573
+ }), restProps);
67574
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({
67575
+ role: roleMenuitem
67576
+ }, commonProps(isDisabled), mergedProps, {
67577
+ ref: useCombinedRef(externalRef, itemRef),
67578
+ className: useBEM({
67579
+ block: menuClass,
67580
+ element: menuItemClass,
67581
+ modifiers: modifiers,
67582
+ className: className
67583
+ }),
67584
+ children: renderChildren
67585
+ }));
67586
+ });
67587
+ false ? 0 : void 0;
67588
+
67589
+
67590
+
67591
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuDivider.js
67592
+
67593
+
67594
+
67595
+
67596
+
67597
+
67598
+
67599
+ var MenuDivider_excluded = ["className"];
67600
+ var MenuDivider = /*#__PURE__*/(0,external_react_.memo)( /*#__PURE__*/(0,external_react_.forwardRef)(function MenuDivider(_ref, externalRef) {
67601
+ var className = _ref.className,
67602
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuDivider_excluded);
67603
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({
67604
+ role: "separator"
67605
+ }, restProps, {
67606
+ ref: externalRef,
67607
+ className: useBEM({
67608
+ block: menuClass,
67609
+ element: menuDividerClass,
67610
+ className: className
67611
+ })
67612
+ }));
67613
+ }));
67614
+ false ? 0 : void 0;
67615
+
67616
+
67617
+
67618
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuHeader.js
67619
+
67620
+
67621
+
67622
+
67623
+
67624
+
67625
+
67626
+ var MenuHeader_excluded = ["className"];
67627
+ var MenuHeader = /*#__PURE__*/(0,external_react_.memo)( /*#__PURE__*/(0,external_react_.forwardRef)(function MenuHeader(_ref, externalRef) {
67628
+ var className = _ref.className,
67629
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuHeader_excluded);
67630
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("li", _extends({
67631
+ role: roleNone
67632
+ }, restProps, {
67633
+ ref: externalRef,
67634
+ className: useBEM({
67635
+ block: menuClass,
67636
+ element: menuHeaderClass,
67637
+ className: className
67638
+ })
67639
+ }));
67640
+ }));
67641
+ false ? 0 : void 0;
67642
+
67643
+
67644
+
67645
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuGroup.js
67646
+
67647
+
67648
+
67649
+
67650
+
67651
+
67652
+
67653
+
67654
+
67655
+
67656
+ var MenuGroup_excluded = ["className", "style", "takeOverflow"];
67657
+ var MenuGroup = /*#__PURE__*/(0,external_react_.forwardRef)(function MenuGroup(_ref, externalRef) {
67658
+ var className = _ref.className,
67659
+ style = _ref.style,
67660
+ takeOverflow = _ref.takeOverflow,
67661
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuGroup_excluded);
67662
+ var ref = (0,external_react_.useRef)(null);
67663
+ var _useState = (0,external_react_.useState)(),
67664
+ overflowStyle = _useState[0],
67665
+ setOverflowStyle = _useState[1];
67666
+ var _useContext = (0,external_react_.useContext)(MenuListContext),
67667
+ overflow = _useContext.overflow,
67668
+ overflowAmt = _useContext.overflowAmt;
67669
+ useIsomorphicLayoutEffect(function () {
67670
+ var maxHeight;
67671
+ if (takeOverflow && overflowAmt >= 0) {
67672
+ maxHeight = ref.current.getBoundingClientRect().height - overflowAmt;
67673
+ if (maxHeight < 0) maxHeight = 0;
67674
+ }
67675
+ setOverflowStyle(maxHeight >= 0 ? {
67676
+ maxHeight: maxHeight,
67677
+ overflow: overflow
67678
+ } : undefined);
67679
+ }, [takeOverflow, overflow, overflowAmt]);
67680
+ useIsomorphicLayoutEffect(function () {
67681
+ if (overflowStyle) ref.current.scrollTop = 0;
67682
+ }, [overflowStyle]);
67683
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", _extends({}, restProps, {
67684
+ ref: useCombinedRef(externalRef, ref),
67685
+ className: useBEM({
67686
+ block: menuClass,
67687
+ element: menuGroupClass,
67688
+ className: className
67689
+ }),
67690
+ style: _extends({}, style, overflowStyle)
67691
+ }));
67692
+ });
67693
+ false ? 0 : void 0;
67694
+
67695
+
67696
+
67697
+ ;// ./node_modules/@szhsin/react-menu/dist/es/components/MenuRadioGroup.js
67698
+
67699
+
67700
+
67701
+
67702
+
67703
+
67704
+
67705
+
67706
+ var MenuRadioGroup_excluded = ["aria-label", "className", "name", "value", "onRadioChange"];
67707
+ var MenuRadioGroup = /*#__PURE__*/(0,external_react_.forwardRef)(function MenuRadioGroup(_ref, externalRef) {
67708
+ var ariaLabel = _ref['aria-label'],
67709
+ className = _ref.className,
67710
+ name = _ref.name,
67711
+ value = _ref.value,
67712
+ onRadioChange = _ref.onRadioChange,
67713
+ restProps = _objectWithoutPropertiesLoose(_ref, MenuRadioGroup_excluded);
67714
+ var contextValue = (0,external_react_.useMemo)(function () {
67715
+ return {
67716
+ name: name,
67717
+ value: value,
67718
+ onRadioChange: onRadioChange
67719
+ };
67720
+ }, [name, value, onRadioChange]);
67721
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(RadioGroupContext.Provider, {
67722
+ value: contextValue,
67723
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("li", {
67724
+ role: roleNone,
67725
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)("ul", _extends({
67726
+ role: "group",
67727
+ "aria-label": ariaLabel || name || 'Radio group'
67728
+ }, restProps, {
67729
+ ref: externalRef,
67730
+ className: useBEM({
67731
+ block: menuClass,
67732
+ element: radioGroupClass,
67733
+ className: className
67734
+ })
67735
+ }))
67736
+ })
67737
+ });
67738
+ });
67739
+ false ? 0 : void 0;
67740
+
67741
+
67742
+
67743
+ ;// ./node_modules/@szhsin/react-menu/dist/es/hooks/useHover.js
67744
+
67745
+
67746
+
67747
+
67748
+ var useHover = function useHover(isOpen, onToggle, _temp) {
67749
+ var _ref = _temp === void 0 ? {} : _temp,
67750
+ _ref$openDelay = _ref.openDelay,
67751
+ openDelay = _ref$openDelay === void 0 ? 100 : _ref$openDelay,
67752
+ _ref$closeDelay = _ref.closeDelay,
67753
+ closeDelay = _ref$closeDelay === void 0 ? 300 : _ref$closeDelay;
67754
+ var _useState = (0,external_react_.useState)({}),
67755
+ config = _useState[0];
67756
+ var clearTimer = function clearTimer() {
67757
+ return clearTimeout(config.t);
67758
+ };
67759
+ var delayAction = function delayAction(toOpen) {
67760
+ return function (e) {
67761
+ clearTimer();
67762
+ config.t = setTimeout(function () {
67763
+ return onToggle(toOpen, e);
67764
+ }, toOpen ? openDelay : closeDelay);
67765
+ };
67766
+ };
67767
+ var props = {
67768
+ onMouseEnter: delayAction(true),
67769
+ onMouseLeave: delayAction(false)
67770
+ };
67771
+ return {
67772
+ anchorProps: _extends({}, props, useClick(isOpen, onToggle)),
67773
+ hoverProps: _extends({}, props, {
67774
+ onMouseEnter: clearTimer
67775
+ })
67776
+ };
67777
+ };
67778
+
67779
+
67780
+
67781
+ ;// ./node_modules/@szhsin/react-menu/dist/es/index.js
67782
+
67783
+
67784
+
67785
+
67786
+
67787
+
67788
+
67789
+
67790
+
67791
+
67792
+
67793
+
67794
+
67795
+
67796
+
65365
67797
  /***/ }),
65366
67798
 
65367
67799
  /***/ 30416:
@@ -67541,8 +69973,8 @@ __webpack_require__.r(__webpack_exports__);
67541
69973
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
67542
69974
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
67543
69975
  /* harmony export */ });
67544
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
67545
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
69976
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(89379);
69977
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(53986);
67546
69978
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
67547
69979
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(98850);
67548
69980
  /* harmony import */ var react_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14062);
@@ -67566,7 +69998,7 @@ var DraggableTab = _ref => {
67566
69998
  panelIndex,
67567
69999
  fileIndex
67568
70000
  } = _ref,
67569
- otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
70001
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)(_ref, _excluded);
67570
70002
  var openFiles = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useSelector)(state => state.editor.openedFiles);
67571
70003
  var openFilesCount = openFiles[panelIndex].length;
67572
70004
  var dispatch = (0,react_redux__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
@@ -67583,7 +70015,7 @@ var DraggableTab = _ref => {
67583
70015
  switchToFileTab(panelIndex, (fileIndex + openFilesCount - 1) % openFilesCount);
67584
70016
  }
67585
70017
  };
67586
- var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
70018
+ var InnerTab = () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_2__.Tab, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
67587
70019
  onClick: e => {
67588
70020
  e.stopPropagation();
67589
70021
  switchToFileTab(panelIndex, fileIndex);
@@ -67601,7 +70033,7 @@ var DraggableTab = _ref => {
67601
70033
  draggableProps,
67602
70034
  dragHandleProps
67603
70035
  } = _ref2;
67604
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
70036
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A)({
67605
70037
  className: "draggable-tab",
67606
70038
  ref: innerRef
67607
70039
  }, draggableProps), dragHandleProps), {}, {
@@ -67623,8 +70055,8 @@ __webpack_require__.r(__webpack_exports__);
67623
70055
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
67624
70056
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
67625
70057
  /* harmony export */ });
67626
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
67627
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
70058
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(89379);
70059
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(53986);
67628
70060
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
67629
70061
  /* harmony import */ var _hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(98850);
67630
70062
  /* harmony import */ var react_tabs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(39243);
@@ -67643,8 +70075,8 @@ var DroppableTabList = _ref => {
67643
70075
  children: _children,
67644
70076
  index
67645
70077
  } = _ref,
67646
- otherProps = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
67647
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
70078
+ otherProps = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)(_ref, _excluded);
70079
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(react_tabs__WEBPACK_IMPORTED_MODULE_1__.TabList, (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({}, otherProps), {}, {
67648
70080
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_hello_pangea_dnd__WEBPACK_IMPORTED_MODULE_6__.Droppable, {
67649
70081
  direction: "horizontal",
67650
70082
  droppableId: index.toString(),
@@ -67654,7 +70086,7 @@ var DroppableTabList = _ref => {
67654
70086
  droppableProps,
67655
70087
  placeholder
67656
70088
  } = _ref2;
67657
- return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
70089
+ return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
67658
70090
  className: "droppable-tab-list"
67659
70091
  }, droppableProps), {}, {
67660
70092
  ref: innerRef,
@@ -101293,7 +103725,7 @@ __webpack_require__.r(__webpack_exports__);
101293
103725
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
101294
103726
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
101295
103727
  /* harmony export */ });
101296
- /* harmony import */ var _Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89379);
103728
+ /* harmony import */ var _Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(89379);
101297
103729
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(51649);
101298
103730
  /* harmony import */ var highcharts__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14783);
101299
103731
  /* harmony import */ var highcharts__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(highcharts__WEBPACK_IMPORTED_MODULE_1__);
@@ -101314,15 +103746,15 @@ var VisualOutputPane = _ref => {
101314
103746
  var showVisual = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((visual, output) => {
101315
103747
  switch (visual.origin) {
101316
103748
  case "pygal":
101317
- var chartContent = (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content), {}, {
101318
- chart: (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.chart), {}, {
101319
- events: (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.chart.events), {}, {
103749
+ var chartContent = (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content), {}, {
103750
+ chart: (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.chart), {}, {
103751
+ events: (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.chart.events), {}, {
101320
103752
  load: function load() {
101321
103753
  this.renderTo.style.overflow = "visible";
101322
103754
  }
101323
103755
  })
101324
103756
  }),
101325
- tooltip: (0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_valeriya_projects_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.tooltip), {}, {
103757
+ tooltip: (0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)((0,_Users_hanna_gwc_gwchq_textjam_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .A)({}, visual.content.tooltip), {}, {
101326
103758
  formatter: visual.content.chart.type === "pie" ? function () {
101327
103759
  return this.key + ": " + this.y;
101328
103760
  } : null
@@ -101424,29 +103856,29 @@ var SidebarPanel = props => {
101424
103856
  });
101425
103857
  var panelContent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
101426
103858
  children: [heading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
101427
- className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelHeader,
103859
+ className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelHeader,
101428
103860
  children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("h2", {
101429
- className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelHeading,
103861
+ className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelHeading,
101430
103862
  children: heading
101431
103863
  }), (buttons === null || buttons === void 0 ? void 0 : buttons.length) > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
101432
- className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelButtons,
103864
+ className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelButtons,
101433
103865
  children: buttons
101434
103866
  })]
101435
103867
  }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
101436
- className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelContent,
103868
+ className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelContent,
101437
103869
  children: children
101438
103870
  }), Footer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
101439
- className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelFooter,
103871
+ className: _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelFooter,
101440
103872
  children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Footer, {})
101441
103873
  })]
101442
103874
  });
101443
103875
  return isMobile ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
101444
103876
  "data-testid": "sidebar__panel",
101445
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panel, className, Footer && _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelWithFooter),
103877
+ className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panel, className, Footer && _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelWithFooter),
101446
103878
  children: panelContent
101447
103879
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_utils_ResizableWithHandle__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A, {
101448
103880
  "data-testid": "sidebar__panel",
101449
- className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panel, className, Footer && _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .A.panelWithFooter),
103881
+ className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(_styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panel, className, Footer && _styles_module_scss__WEBPACK_IMPORTED_MODULE_2__["default"].panelWithFooter),
101450
103882
  defaultWidth: defaultWidth,
101451
103883
  defaultHeight: "100%",
101452
103884
  handleDirection: "right",
@@ -138392,6 +140824,18 @@ __webpack_require__.r(__webpack_exports__);
138392
140824
 
138393
140825
  /***/ }),
138394
140826
 
140827
+ /***/ 29707:
140828
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
140829
+
140830
+ __webpack_require__.r(__webpack_exports__);
140831
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
140832
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
140833
+ /* harmony export */ });
140834
+ // extracted by mini-css-extract-plugin
140835
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","contextMenu":"styles-module__contextMenu--HNX6Z","contextItem":"styles-module__contextItem--9nzMH"});
140836
+
140837
+ /***/ }),
140838
+
138395
140839
  /***/ 68233:
138396
140840
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138397
140841
 
@@ -138419,8 +140863,9 @@ __webpack_require__.r(__webpack_exports__);
138419
140863
  /***/ 50239:
138420
140864
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138421
140865
 
140866
+ __webpack_require__.r(__webpack_exports__);
138422
140867
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
138423
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
140868
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
138424
140869
  /* harmony export */ });
138425
140870
  // extracted by mini-css-extract-plugin
138426
140871
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"grey-rpi-grey-15":"#d5d7dc","grey-rpi-grey-40":"#9497a4","grey-rpi-grey-5":"#f1f2f3","grey-rpi-grey-70":"#4a4d59","grey-rpf-white":"#fff","sidebar":"styles-module__sidebar--Fu5Qi","gwcLogo":"styles-module__gwcLogo--o2p4A","bar":"styles-module__bar--fOlLf","optionsTop":"styles-module__optionsTop--2jNbs","optionsBottom":"styles-module__optionsBottom--PtwF4","option":"styles-module__option--MOGCu","userOption":"styles-module__userOption--qGt5j","selected":"styles-module__selected--avjSK","panel":"styles-module__panel--bHhSv","panelWithFooter":"styles-module__panelWithFooter--5ItsY","panelHeading":"styles-module__panelHeading--GRNt0","panelHeader":"styles-module__panelHeader--bAHfN","panelContent":"styles-module__panelContent--X7kot","panelButtons":"styles-module__panelButtons---y4S-","panelFooter":"styles-module__panelFooter--T1y-s"});
@@ -363594,6 +366039,29 @@ const RunnerFactory = ({ projectType, outputPanels = ["text", "visual"], package
363594
366039
  exports["default"] = RunnerFactory;
363595
366040
 
363596
366041
 
366042
+ /***/ }),
366043
+
366044
+ /***/ 39179:
366045
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
366046
+
366047
+
366048
+ var __importDefault = (this && this.__importDefault) || function (mod) {
366049
+ return (mod && mod.__esModule) ? mod : { "default": mod };
366050
+ };
366051
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366052
+ const jsx_runtime_1 = __webpack_require__(74848);
366053
+ const react_menu_1 = __webpack_require__(97957);
366054
+ const styles_module_scss_1 = __importDefault(__webpack_require__(29707));
366055
+ const ContextMenu = (props) => {
366056
+ const { align, direction, menuOptions, offsetX, offsetY, menuWidth, opened, anchorRef, onClose, skipOpen, } = props;
366057
+ const portalTarget = document.getElementById("textjam-root") || document.body;
366058
+ return ((0, jsx_runtime_1.jsx)(react_menu_1.ControlledMenu, { transition: true, align: align, direction: direction, menuStyle: { width: `${menuWidth}px` }, offsetX: offsetX, offsetY: offsetY, position: "anchor", viewScroll: "initial", portal: {
366059
+ target: portalTarget,
366060
+ }, menuClassName: styles_module_scss_1.default.contextMenu, menuItemFocus: { position: "first" }, state: opened ? "open" : "closed", anchorRef: anchorRef, skipOpen: skipOpen, onClose: onClose, children: menuOptions.map((option, i) => ((0, jsx_runtime_1.jsxs)(react_menu_1.MenuItem, { className: styles_module_scss_1.default.contextItem, onClick: option.action, children: [option.icon ? (0, jsx_runtime_1.jsx)(option.icon, {}) : null, option.text] }, i))) }));
366061
+ };
366062
+ exports["default"] = ContextMenu;
366063
+
366064
+
363597
366065
  /***/ }),
363598
366066
 
363599
366067
  /***/ 7802:
@@ -364227,6 +366695,204 @@ const FileTree = () => {
364227
366695
  exports.FileTree = FileTree;
364228
366696
 
364229
366697
 
366698
+ /***/ }),
366699
+
366700
+ /***/ 20791:
366701
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
366702
+
366703
+
366704
+ var __importDefault = (this && this.__importDefault) || function (mod) {
366705
+ return (mod && mod.__esModule) ? mod : { "default": mod };
366706
+ };
366707
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366708
+ const jsx_runtime_1 = __webpack_require__(74848);
366709
+ const react_1 = __webpack_require__(51649);
366710
+ const stores_1 = __webpack_require__(32132);
366711
+ const classnames_1 = __importDefault(__webpack_require__(46942));
366712
+ const FilePanel_1 = __importDefault(__webpack_require__(7802));
366713
+ const SidebarBar_1 = __importDefault(__webpack_require__(26624));
366714
+ const files_svg_1 = __importDefault(__webpack_require__(72020));
366715
+ const home_svg_1 = __importDefault(__webpack_require__(69046));
366716
+ const styles_module_scss_1 = __importDefault(__webpack_require__(50239));
366717
+ const getSidebarOptions = (initials) => [
366718
+ {
366719
+ name: "files",
366720
+ icon: files_svg_1.default,
366721
+ title: "Files",
366722
+ position: "top",
366723
+ panel: FilePanel_1.default,
366724
+ },
366725
+ //should be introduced in the later phases
366726
+ // {
366727
+ // name: "activity",
366728
+ // icon: ActivityIcon,
366729
+ // title: "Activity",
366730
+ // position: "top",
366731
+ // },
366732
+ // {
366733
+ // name: "playground",
366734
+ // icon: PlaygroundIcon,
366735
+ // title: "Playground",
366736
+ // position: "top",
366737
+ // },
366738
+ {
366739
+ name: "home",
366740
+ icon: home_svg_1.default,
366741
+ title: "Home",
366742
+ position: "top",
366743
+ },
366744
+ //should be introduced in the later phases
366745
+ // {
366746
+ // name: "fonts",
366747
+ // icon: FontIcon,
366748
+ // title: "Fonts",
366749
+ // position: "bottom",
366750
+ // panel: SettingsPanel,
366751
+ // },
366752
+ // {
366753
+ // name: "theme",
366754
+ // icon: ThemeIcon,
366755
+ // title: "Theme",
366756
+ // position: "bottom",
366757
+ // panel: SettingsPanel,
366758
+ // },
366759
+ {
366760
+ name: "user",
366761
+ buttonText: initials,
366762
+ title: "User account",
366763
+ position: "bottom",
366764
+ },
366765
+ ];
366766
+ const Sidebar = ({ options = [] }) => {
366767
+ const initials = (0, stores_1.useAppSelector)((state) => state.user.initials);
366768
+ const sideBarOptions = getSidebarOptions(initials);
366769
+ let menuOptions = sideBarOptions.filter((option) => options.includes(option.name));
366770
+ const [option, setOption] = (0, react_1.useState)(null);
366771
+ const toggleOption = (newOption) => {
366772
+ // when toggle the same option, close panel
366773
+ if (option === newOption) {
366774
+ setOption(null);
366775
+ }
366776
+ else {
366777
+ setOption(newOption);
366778
+ }
366779
+ };
366780
+ const activeOption = menuOptions.find((opt) => opt.name === option);
366781
+ const CustomSidebarPanel = activeOption?.panel || (() => null);
366782
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.sidebar), children: [(0, jsx_runtime_1.jsx)(SidebarBar_1.default, { menuOptions: menuOptions, option: option, toggleOption: toggleOption }), option && (0, jsx_runtime_1.jsx)(CustomSidebarPanel, {})] }));
366783
+ };
366784
+ exports["default"] = Sidebar;
366785
+
366786
+
366787
+ /***/ }),
366788
+
366789
+ /***/ 26624:
366790
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
366791
+
366792
+
366793
+ var __importDefault = (this && this.__importDefault) || function (mod) {
366794
+ return (mod && mod.__esModule) ? mod : { "default": mod };
366795
+ };
366796
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366797
+ const jsx_runtime_1 = __webpack_require__(74848);
366798
+ const styles_module_scss_1 = __importDefault(__webpack_require__(50239));
366799
+ const SidebarBarOption_1 = __importDefault(__webpack_require__(19371));
366800
+ const SidebarBar = (props) => {
366801
+ const { menuOptions, option, toggleOption } = props;
366802
+ const topMenuOptions = menuOptions.filter((menuOption) => menuOption.position === "top");
366803
+ const bottomMenuOptions = menuOptions.filter((menuOption) => menuOption.position === "bottom");
366804
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.bar, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.optionsTop, children: topMenuOptions.map((menuOption, i) => ((0, jsx_runtime_1.jsx)(SidebarBarOption_1.default, { Icon: menuOption.icon, title: menuOption.title, isActive: option === menuOption.name, toggleOption: toggleOption, name: menuOption.name }, i))) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.optionsBottom, children: bottomMenuOptions.map((menuOption, i) => ((0, jsx_runtime_1.jsx)(SidebarBarOption_1.default, { Icon: menuOption.icon, title: menuOption.title, isActive: option === menuOption.name, toggleOption: toggleOption, name: menuOption.name, buttonText: menuOption.buttonText, isUser: menuOption.name === "user" }, i))) })] }));
366805
+ };
366806
+ exports["default"] = SidebarBar;
366807
+
366808
+
366809
+ /***/ }),
366810
+
366811
+ /***/ 19371:
366812
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
366813
+
366814
+
366815
+ var __importDefault = (this && this.__importDefault) || function (mod) {
366816
+ return (mod && mod.__esModule) ? mod : { "default": mod };
366817
+ };
366818
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366819
+ const jsx_runtime_1 = __webpack_require__(74848);
366820
+ const react_1 = __webpack_require__(51649);
366821
+ const stores_1 = __webpack_require__(32132);
366822
+ const Button_1 = __importDefault(__webpack_require__(60232));
366823
+ const classnames_1 = __importDefault(__webpack_require__(46942));
366824
+ const styles_module_scss_1 = __importDefault(__webpack_require__(50239));
366825
+ const UserMenu_1 = __importDefault(__webpack_require__(2957));
366826
+ const backgroundColors = [
366827
+ 'D7F9F4', '43D6B9',
366828
+ '0D9C90', 'E5F8FF',
366829
+ 'FEEFEE', 'F37C6F',
366830
+ 'FFF3E8', 'F9B88C',
366831
+ 'FA7815', 'FCE688'
366832
+ ];
366833
+ const SidebarBarOption = (props) => {
366834
+ const { Icon, isActive, name, title, toggleOption, buttonText, isUser } = props;
366835
+ const userId = (0, stores_1.useAppSelector)((state) => state.user.userId);
366836
+ const isFacilitator = (0, stores_1.useAppSelector)((state) => state.user.isFacilitator);
366837
+ const avatarSrc = (0, stores_1.useAppSelector)((state) => state.user.avatarSrc);
366838
+ const avatarStyle = isUser
366839
+ ? isFacilitator
366840
+ ? { background: 'linear-gradient(90deg,#d7f9f4,#fff9e2,#fff3e8,#e5f8ff,#d7f9f4)' }
366841
+ : { backgroundColor: `#${backgroundColors[(userId ?? 0) % 10]}` }
366842
+ : null;
366843
+ const [isMenuOpen, setIsMenuOpen] = (0, react_1.useState)(false);
366844
+ const buttonRef = (0, react_1.useRef)(null);
366845
+ const skipOpenRef = (0, react_1.useRef)(false);
366846
+ const openMenu = () => {
366847
+ if (!skipOpenRef.current) {
366848
+ setIsMenuOpen(true);
366849
+ }
366850
+ skipOpenRef.current = false;
366851
+ };
366852
+ const onClickHandler = () => {
366853
+ isUser ? openMenu() : toggleOption(name);
366854
+ };
366855
+ const handleClose = () => {
366856
+ skipOpenRef.current = true;
366857
+ setIsMenuOpen(false);
366858
+ };
366859
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!avatarSrc && isUser ? ((0, jsx_runtime_1.jsx)("img", { ref: buttonRef, onClick: onClickHandler, className: (0, classnames_1.default)(styles_module_scss_1.default.option, styles_module_scss_1.default.userOption), src: avatarSrc, alt: "User profile avatar" })) : ((0, jsx_runtime_1.jsx)(Button_1.default, { buttonRef: buttonRef, className: (0, classnames_1.default)(styles_module_scss_1.default.option, isActive && styles_module_scss_1.default.selected, isUser && styles_module_scss_1.default.userOption), style: avatarStyle, ButtonIcon: Icon, title: title, buttonText: buttonText, onClickHandler: onClickHandler, ...(isUser && {
366860
+ label: `Profile image placeholder displaying the user’s initials`,
366861
+ }) })), isUser && ((0, jsx_runtime_1.jsx)(UserMenu_1.default, { anchorRef: buttonRef, opened: isMenuOpen, onClose: handleClose, skipOpen: skipOpenRef }))] }));
366862
+ };
366863
+ exports["default"] = SidebarBarOption;
366864
+
366865
+
366866
+ /***/ }),
366867
+
366868
+ /***/ 2957:
366869
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
366870
+
366871
+
366872
+ var __importDefault = (this && this.__importDefault) || function (mod) {
366873
+ return (mod && mod.__esModule) ? mod : { "default": mod };
366874
+ };
366875
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366876
+ const jsx_runtime_1 = __webpack_require__(74848);
366877
+ const ContextMenu_1 = __importDefault(__webpack_require__(39179));
366878
+ const AuthContext_1 = __webpack_require__(55471);
366879
+ const UserMenu = (props) => {
366880
+ const { anchorRef, opened, onClose, skipOpen } = props;
366881
+ const { onLogout, onViewProfile } = (0, AuthContext_1.useAuthActions)();
366882
+ return ((0, jsx_runtime_1.jsx)(ContextMenu_1.default, { align: "start", direction: "top", menuWidth: 142, menuOptions: [
366883
+ {
366884
+ text: "View Profile",
366885
+ action: onViewProfile,
366886
+ },
366887
+ {
366888
+ text: "Logout",
366889
+ action: onLogout,
366890
+ },
366891
+ ], offsetX: 0, offsetY: 4, opened: opened, anchorRef: anchorRef, onClose: onClose, skipOpen: skipOpen }));
366892
+ };
366893
+ exports["default"] = UserMenu;
366894
+
366895
+
364230
366896
  /***/ }),
364231
366897
 
364232
366898
  /***/ 82803:
@@ -364314,6 +366980,31 @@ const SvgIcon = ({ size, SvgElement, ...rest }) => {
364314
366980
  exports.SvgIcon = SvgIcon;
364315
366981
 
364316
366982
 
366983
+ /***/ }),
366984
+
366985
+ /***/ 55471:
366986
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
366987
+
366988
+
366989
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
366990
+ exports.useAuthActions = exports.AuthProvider = void 0;
366991
+ const jsx_runtime_1 = __webpack_require__(74848);
366992
+ const react_1 = __webpack_require__(51649);
366993
+ const AuthContext = (0, react_1.createContext)(undefined);
366994
+ const AuthProvider = ({ children, onLogout, onViewProfile, }) => {
366995
+ return ((0, jsx_runtime_1.jsx)(AuthContext.Provider, { value: { onLogout, onViewProfile }, children: children }));
366996
+ };
366997
+ exports.AuthProvider = AuthProvider;
366998
+ const useAuthActions = () => {
366999
+ const context = (0, react_1.useContext)(AuthContext);
367000
+ if (!context) {
367001
+ throw new Error('useAuthActions must be used within AuthProvider');
367002
+ }
367003
+ return context;
367004
+ };
367005
+ exports.useAuthActions = useAuthActions;
367006
+
367007
+
364317
367008
  /***/ }),
364318
367009
 
364319
367010
  /***/ 54095:
@@ -364709,6 +367400,7 @@ exports.userInitialState = {
364709
367400
  userId: null,
364710
367401
  initials: "",
364711
367402
  isFacilitator: null,
367403
+ avatarSrc: null,
364712
367404
  };
364713
367405
  exports.UserSlice = (0, toolkit_1.createSlice)({
364714
367406
  name: "user",
@@ -364718,6 +367410,7 @@ exports.UserSlice = (0, toolkit_1.createSlice)({
364718
367410
  state.userId = action.payload.userId;
364719
367411
  state.initials = action.payload.initials;
364720
367412
  state.isFacilitator = action.payload.isFacilitator;
367413
+ state.avatarSrc = action.payload.avatarSrc;
364721
367414
  },
364722
367415
  },
364723
367416
  });
@@ -385149,219 +387842,9 @@ var ProjectBar = _ref => {
385149
387842
  });
385150
387843
  };
385151
387844
  /* harmony default export */ const ProjectBar_ProjectBar = (ProjectBar);
385152
- // EXTERNAL MODULE: ./src/components/Menus/Sidebar/FilePanel/FilePanel.tsx
385153
- var FilePanel = __webpack_require__(7802);
385154
- var FilePanel_default = /*#__PURE__*/__webpack_require__.n(FilePanel);
385155
- // EXTERNAL MODULE: ./src/components/Menus/Sidebar/styles.module.scss
385156
- var Sidebar_styles_module = __webpack_require__(50239);
385157
- ;// ./src/components/Menus/Sidebar/SidebarBarOption.jsx
385158
-
385159
-
385160
-
385161
-
385162
-
385163
-
385164
- var backgroundColors = ['D7F9F4', '43D6B9', '0D9C90', 'E5F8FF', 'FEEFEE', 'F37C6F', 'FFF3E8', 'F9B88C', 'FA7815', 'FCE688'];
385165
- var SidebarBarOption = props => {
385166
- var {
385167
- Icon,
385168
- isActive,
385169
- name,
385170
- title,
385171
- toggleOption,
385172
- buttonText,
385173
- isUser
385174
- } = props;
385175
- var userId = (0,external_react_redux_.useSelector)(state => state.user.userId);
385176
- var isFacilitator = (0,external_react_redux_.useSelector)(state => state.user.isFacilitator);
385177
- var avatarStyle = isUser ? isFacilitator ? {
385178
- background: 'linear-gradient(90deg,#d7f9f4,#fff9e2,#fff3e8,#e5f8ff,#d7f9f4)'
385179
- } : {
385180
- backgroundColor: "#".concat(backgroundColors[userId % 10])
385181
- } : null;
385182
- var onClickHandler = () => {
385183
- toggleOption(name);
385184
- };
385185
- return /*#__PURE__*/(0,jsx_runtime.jsx)(Button["default"], {
385186
- className: classnames_default()(Sidebar_styles_module/* default */.A.option, {
385187
- [Sidebar_styles_module/* default */.A.selected]: isActive,
385188
- [Sidebar_styles_module/* default */.A.userOption]: isUser
385189
- }),
385190
- style: avatarStyle,
385191
- ButtonIcon: Icon,
385192
- title: title,
385193
- buttonText: buttonText,
385194
- onClickHandler: onClickHandler
385195
- });
385196
- };
385197
- /* harmony default export */ const Sidebar_SidebarBarOption = (SidebarBarOption);
385198
- ;// ./src/components/Menus/Sidebar/SidebarBar.jsx
385199
-
385200
-
385201
-
385202
-
385203
- var SidebarBar = props => {
385204
- var {
385205
- menuOptions,
385206
- option,
385207
- toggleOption
385208
- } = props;
385209
- var topMenuOptions = menuOptions.filter(menuOption => menuOption.position === "top");
385210
- var bottomMenuOptions = menuOptions.filter(menuOption => menuOption.position === "bottom");
385211
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
385212
- className: Sidebar_styles_module/* default */.A.bar,
385213
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", {
385214
- className: Sidebar_styles_module/* default */.A.optionsTop,
385215
- children: topMenuOptions.map((menuOption, i) => /*#__PURE__*/(0,jsx_runtime.jsx)(Sidebar_SidebarBarOption, {
385216
- Icon: menuOption.icon,
385217
- title: menuOption.title,
385218
- isActive: option === menuOption.name,
385219
- toggleOption: toggleOption,
385220
- name: menuOption.name
385221
- }, i))
385222
- }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
385223
- className: Sidebar_styles_module/* default */.A.optionsBottom,
385224
- children: bottomMenuOptions.map((menuOption, i) => /*#__PURE__*/(0,jsx_runtime.jsx)(Sidebar_SidebarBarOption, {
385225
- Icon: menuOption.icon,
385226
- title: menuOption.title,
385227
- isActive: option === menuOption.name,
385228
- toggleOption: toggleOption,
385229
- name: menuOption.name,
385230
- buttonText: menuOption.buttonText,
385231
- isUser: menuOption.name === "user"
385232
- }, i))
385233
- })]
385234
- });
385235
- };
385236
- /* harmony default export */ const Sidebar_SidebarBar = (SidebarBar);
385237
- ;// ./src/assets/icons/files.svg
385238
- var files_path;
385239
- function files_extends() { return files_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, files_extends.apply(null, arguments); }
385240
-
385241
- function SvgFiles(props) {
385242
- return /*#__PURE__*/external_react_.createElement("svg", files_extends({
385243
- width: 22,
385244
- height: 20,
385245
- fill: "none",
385246
- xmlns: "http://www.w3.org/2000/svg"
385247
- }, props), files_path || (files_path = /*#__PURE__*/external_react_.createElement("path", {
385248
- d: "M10.75 8.75v6m-3-3h6m7 5a2 2 0 01-2 2h-16a2 2 0 01-2-2v-14a2 2 0 012-2h5l2 3h9a2 2 0 012 2v11z",
385249
- stroke: "#33625E",
385250
- strokeWidth: 1.5,
385251
- strokeLinecap: "round",
385252
- strokeLinejoin: "round"
385253
- })));
385254
- }
385255
- /* harmony default export */ const files = (SvgFiles);
385256
- ;// ./src/assets/icons/home.svg
385257
- var home_path;
385258
- function home_extends() { return home_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, home_extends.apply(null, arguments); }
385259
-
385260
- function SvgHome(props) {
385261
- return /*#__PURE__*/external_react_.createElement("svg", home_extends({
385262
- width: 20,
385263
- height: 22,
385264
- fill: "none",
385265
- xmlns: "http://www.w3.org/2000/svg"
385266
- }, props), home_path || (home_path = /*#__PURE__*/external_react_.createElement("path", {
385267
- d: "M6.75 20.75v-10h6v10m-12-13l9-7 9 7v11a2 2 0 01-2 2h-14a2 2 0 01-2-2v-11z",
385268
- stroke: "#33625E",
385269
- strokeWidth: 1.5,
385270
- strokeLinecap: "round",
385271
- strokeLinejoin: "round"
385272
- })));
385273
- }
385274
- /* harmony default export */ const home = (SvgHome);
385275
- ;// ./src/components/Menus/Sidebar/Sidebar.jsx
385276
-
385277
-
385278
-
385279
-
385280
-
385281
-
385282
-
385283
-
385284
-
385285
-
385286
-
385287
-
385288
-
385289
-
385290
- var getSidebarOptions = initials => [{
385291
- name: "files",
385292
- icon: files,
385293
- title: "Files",
385294
- position: "top",
385295
- panel: (FilePanel_default())
385296
- },
385297
- //should be introduced in the later phases
385298
- // {
385299
- // name: "activity",
385300
- // icon: ActivityIcon,
385301
- // title: "Activity",
385302
- // position: "top",
385303
- // },
385304
- // {
385305
- // name: "playground",
385306
- // icon: PlaygroundIcon,
385307
- // title: "Playground",
385308
- // position: "top",
385309
- // },
385310
- {
385311
- name: "home",
385312
- icon: home,
385313
- title: "Home",
385314
- position: "top"
385315
- },
385316
- //should be introduced in the later phases
385317
- // {
385318
- // name: "fonts",
385319
- // icon: FontIcon,
385320
- // title: "Fonts",
385321
- // position: "bottom",
385322
- // panel: SettingsPanel,
385323
- // },
385324
- // {
385325
- // name: "theme",
385326
- // icon: ThemeIcon,
385327
- // title: "Theme",
385328
- // position: "bottom",
385329
- // panel: SettingsPanel,
385330
- // },
385331
- {
385332
- name: "user",
385333
- buttonText: initials,
385334
- title: "User account",
385335
- position: "bottom"
385336
- }];
385337
- var Sidebar = _ref => {
385338
- var {
385339
- options = []
385340
- } = _ref;
385341
- var initials = (0,external_react_redux_.useSelector)(state => state.user.initials);
385342
- var sideBarOptions = getSidebarOptions(initials);
385343
- var menuOptions = sideBarOptions.filter(option => options.includes(option.name));
385344
- var [option, setOption] = (0,external_react_.useState)(null);
385345
- var toggleOption = newOption => {
385346
- // when toggle the same option, close panel
385347
- if (option === newOption) {
385348
- setOption(null);
385349
- } else {
385350
- setOption(newOption);
385351
- }
385352
- };
385353
- var activeOption = menuOptions.find(opt => opt.name === option);
385354
- var CustomSidebarPanel = (activeOption === null || activeOption === void 0 ? void 0 : activeOption.panel) || (() => null);
385355
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
385356
- className: classnames_default()(Sidebar_styles_module/* default */.A.sidebar),
385357
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Sidebar_SidebarBar, {
385358
- menuOptions: menuOptions,
385359
- option: option,
385360
- toggleOption: toggleOption
385361
- }), option && /*#__PURE__*/(0,jsx_runtime.jsx)(CustomSidebarPanel, {})]
385362
- });
385363
- };
385364
- /* harmony default export */ const Sidebar_Sidebar = (Sidebar);
387845
+ // EXTERNAL MODULE: ./src/components/Menus/Sidebar/Sidebar.tsx
387846
+ var Sidebar = __webpack_require__(20791);
387847
+ var Sidebar_default = /*#__PURE__*/__webpack_require__.n(Sidebar);
385365
387848
  // EXTERNAL MODULE: ./src/components/Editor/EditorInput/EditorInput.tsx
385366
387849
  var EditorInput = __webpack_require__(99692);
385367
387850
  var EditorInput_default = /*#__PURE__*/__webpack_require__.n(EditorInput);
@@ -385431,7 +387914,7 @@ var Project = props => {
385431
387914
  nameEditable: nameEditable
385432
387915
  }), /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
385433
387916
  className: Project_styles_module.projContainer,
385434
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)(Sidebar_Sidebar, {
387917
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)((Sidebar_default()), {
385435
387918
  options: sidebarOptions
385436
387919
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
385437
387920
  className: Project_styles_module.projectWrapper,
@@ -386610,7 +389093,8 @@ var WebComponentLoader = props => {
386610
389093
  dispatch((0,UserSlice.setUserData)({
386611
389094
  userId: user.userId,
386612
389095
  initials: user.initials,
386613
- isFacilitator: user.isFacilitator
389096
+ isFacilitator: user.isFacilitator,
389097
+ avatarSrc: user.avatarSrc
386614
389098
  }));
386615
389099
  }
386616
389100
  }, [user, dispatch]);
@@ -386709,10 +389193,13 @@ var stores = __webpack_require__(32132);
386709
389193
  var stores_default = /*#__PURE__*/__webpack_require__.n(stores);
386710
389194
  // EXTERNAL MODULE: ./node_modules/react-router-dom/dist/index.js + 2 modules
386711
389195
  var dist = __webpack_require__(92648);
389196
+ // EXTERNAL MODULE: ./src/context/AuthContext.tsx
389197
+ var AuthContext = __webpack_require__(55471);
386712
389198
  ;// ./src/App.jsx
386713
389199
 
386714
389200
 
386715
- var App_excluded = ["queryString"];
389201
+ var App_excluded = ["queryString", "onLogoutClick", "onViewProfileClick"];
389202
+
386716
389203
 
386717
389204
 
386718
389205
 
@@ -386723,7 +389210,9 @@ var App_excluded = ["queryString"];
386723
389210
  var TextJamEditor = function TextJamEditor() {
386724
389211
  var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
386725
389212
  {
386726
- queryString
389213
+ queryString,
389214
+ onLogoutClick = () => {},
389215
+ onViewProfileClick = () => {}
386727
389216
  } = _ref,
386728
389217
  componentProps = (0,objectWithoutProperties/* default */.A)(_ref, App_excluded);
386729
389218
  // Default props that match the previous web-component defaults
@@ -386743,7 +389232,11 @@ var TextJamEditor = function TextJamEditor() {
386743
389232
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(external_react_redux_.Provider, {
386744
389233
  store: (stores_default()),
386745
389234
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(dist/* BrowserRouter */.Kd, {
386746
- children: /*#__PURE__*/(0,jsx_runtime.jsx)(containers_WebComponentLoader, (0,objectSpread2/* default */.A)({}, mergedProps))
389235
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(AuthContext.AuthProvider, {
389236
+ onLogout: onLogoutClick,
389237
+ onViewProfile: onViewProfileClick,
389238
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(containers_WebComponentLoader, (0,objectSpread2/* default */.A)({}, mergedProps))
389239
+ })
386747
389240
  })
386748
389241
  })
386749
389242
  })