@opengeoweb/shared 14.0.1 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/index.esm.js +537 -493
  2. package/package.json +2 -2
  3. package/src/index.d.ts +1 -1
  4. package/src/lib/components/AlertBanner/AlertBanner.d.ts +2 -2
  5. package/src/lib/components/AlertBanner/AlertBanner.stories.d.ts +1 -1
  6. package/src/lib/components/AlertIcon/AlertIcon.d.ts +2 -2
  7. package/src/lib/components/AppHeader/AppHeader.stories.d.ts +1 -1
  8. package/src/lib/components/AppLayout/AppLayout.stories.d.ts +1 -1
  9. package/src/lib/components/Avatar/Avatar.d.ts +1 -1
  10. package/src/lib/components/CanvasComponent/CanvasComponent.stories.d.ts +1 -1
  11. package/src/lib/components/ConfirmationDialog/ConfirmationButtons.d.ts +2 -2
  12. package/src/lib/components/ConfirmationDialog/ConfirmationDialog.d.ts +3 -3
  13. package/src/lib/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +1 -1
  14. package/src/lib/components/ConfirmationDialog/ConfirmationService.d.ts +2 -2
  15. package/src/lib/components/CustomAccordion/CustomAccordion.d.ts +2 -2
  16. package/src/lib/components/CustomDialog/CustomDialog.d.ts +5 -5
  17. package/src/lib/components/CustomDialog/CustomDialog.stories.d.ts +1 -1
  18. package/src/lib/components/CustomDialog/CustomDialogHeader.d.ts +4 -4
  19. package/src/lib/components/CustomIconButton/CustomIconButton.d.ts +2 -2
  20. package/src/lib/components/CustomSlider/CustomSlider.d.ts +2 -2
  21. package/src/lib/components/CustomToggleButton/CustomToggleButton.d.ts +3 -3
  22. package/src/lib/components/CustomTooltip/CustomTooltip.d.ts +2 -2
  23. package/src/lib/components/DraggableResizable/Draggable.d.ts +2 -2
  24. package/src/lib/components/DraggableResizable/Resizable.d.ts +1 -1
  25. package/src/lib/components/DraggableResizable/index.d.ts +1 -1
  26. package/src/lib/components/DraggableResizable/types.d.ts +2 -2
  27. package/src/lib/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
  28. package/src/lib/components/Filter/Filter.d.ts +3 -3
  29. package/src/lib/components/Filter/FilterChip.d.ts +1 -1
  30. package/src/lib/components/Filter/FilterList.d.ts +1 -1
  31. package/src/lib/components/Filter/FilterOption.d.ts +3 -2
  32. package/src/lib/components/Filter/SearchField.d.ts +1 -1
  33. package/src/lib/components/LastUpdateTime/LastUpdateTime.d.ts +1 -1
  34. package/src/lib/components/Providers/Providers.d.ts +1 -1
  35. package/src/lib/components/SearchField/SearchField.d.ts +1 -1
  36. package/src/lib/components/StatusTag/StatusTag.d.ts +2 -2
  37. package/src/lib/components/StatusTag/StatusTag.stories.d.ts +1 -1
  38. package/src/lib/components/Storybook/StorybookDocsWrapper.d.ts +1 -1
  39. package/src/lib/components/SwitchButton/SwitchButton.d.ts +2 -2
  40. package/src/lib/components/ToggleMenu/ToggleMenu.d.ts +3 -3
  41. package/src/lib/components/ToolContainer/ToolContainer.d.ts +1 -1
  42. package/src/lib/components/ToolContainer/ToolContainer.stories.d.ts +1 -1
  43. package/src/lib/components/ToolContainer/ToolContainerDraggable.d.ts +4 -4
  44. package/src/lib/components/ToolContainer/ToolHeader.d.ts +1 -1
  45. package/src/lib/components/ToolContainer/index.d.ts +1 -1
  46. package/src/lib/components/ToolContainer/types.d.ts +1 -1
  47. package/src/lib/components/ToolContainer/useHandleSizeFromOutsideComponent.d.ts +1 -1
  48. package/src/lib/components/TooltipSelect/TooltipSelect.d.ts +2 -2
  49. package/src/lib/hooks/useIsMounted/useIsMounted.d.ts +1 -1
  50. package/src/lib/hooks/useMakeSureContainerStaysInsideWindow/useMakeSureContainerStaysInsideWindow.d.ts +1 -1
  51. package/src/lib/hooks/usePoller/usePoller.d.ts +1 -1
  52. package/src/lib/hooks/usePrevious/usePrevious.stories.d.ts +1 -1
  53. package/src/lib/types/edr-coverage-types.d.ts +31 -6
  54. package/src/lib/types/index.d.ts +1 -1
  55. package/src/lib/types/types.d.ts +18 -1
  56. package/src/lib/utils/axiosErrorUtils/axiosErrorUtils.d.ts +1 -1
  57. package/src/lib/utils/dateUtils/dateUtils.d.ts +3 -2
  58. package/src/lib/utils/i18n.d.ts +1 -1
  59. package/src/lib/utils/index.d.ts +1 -1
  60. package/src/lib/utils/sessionStorage.d.ts +1 -1
package/index.esm.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import { Box, Typography, useTheme, Tooltip, IconButton, Menu, ListSubheader, MenuItem, Grid, ListItemText, ListItemIcon, DialogTitle, Button, Dialog, DialogContent, DialogActions, Paper, CircularProgress, Alert, AlertTitle, Drawer, Link, Avatar as Avatar$1, ClickAwayListener, MenuList, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Switch, Slider, ToggleButton, styled, Select, Accordion, AccordionSummary, AccordionDetails, FormLabel, TextField, InputAdornment, Chip, Stack, debounce as debounce$1, ListItemButton, Checkbox } from '@mui/material';
3
- import * as React from 'react';
4
- import React__default, { useRef, Component, useState } from 'react';
3
+ import 'i18next';
4
+ import { initReactI18next, useTranslation } from 'react-i18next';
5
+ import React, { useRef, useEffect, useState, Component } from 'react';
5
6
  import Draggable from 'react-draggable';
6
7
  import { Resizable } from 're-resizable';
7
8
  import { Resize, Options, Close, ChevronLeft, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Admin, useThemeContext, ThemeTypes, ArrowLeft, ArrowRight, KeyOption, KeyCommand, ArrowUp, ArrowDown, ChevronDown, Search, Clear, Cached } from '@opengeoweb/theme';
8
- import 'i18next';
9
- import { initReactI18next, useTranslation } from 'react-i18next';
10
9
  import { throttle, merge, escapeRegExp, debounce } from 'lodash';
11
- import * as Sentry from '@sentry/react';
10
+ import { addIntegration } from '@sentry/react';
12
11
  import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInYears as differenceInYears$1, differenceInMonths as differenceInMonths$1, differenceInDays as differenceInDays$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, differenceInSeconds as differenceInSeconds$1, roundToNearestMinutes as roundToNearestMinutes$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, fromUnixTime, set as set$1, getHours as getHours$1, startOfDay, addMinutes, addHours, setSeconds as setSeconds$1, getDay, getDayOfYear, getMonth, getWeek, getYear, isWithinInterval } from 'date-fns';
13
12
  import { fi as fi$1, nl as nl$1, nb, enGB } from 'date-fns/locale';
14
13
 
@@ -572,7 +571,7 @@ function _regeneratorRuntime() {
572
571
  })();
573
572
  }
574
573
 
575
- var _excluded$e = ["content", "color", "icon"];
574
+ var _excluded$e = ["content", "color", "icon", "sx"];
576
575
  var bgColors = {
577
576
  green: 'geowebColors.functional.successOutline.fill',
578
577
  grey: 'geowebColors.functional.disabledOutline.fill',
@@ -612,15 +611,16 @@ var StatusTag = function StatusTag(_ref) {
612
611
  var content = _ref.content,
613
612
  color = _ref.color,
614
613
  icon = _ref.icon,
615
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
614
+ sx = _ref.sx;
615
+ _objectWithoutPropertiesLoose(_ref, _excluded$e);
616
616
  return jsxs(Box, {
617
- display: "flex",
618
617
  alignItems: "center",
619
- textAlign: "center",
620
- "data-testid": "statusTag",
621
618
  className: "statusTag",
619
+ "data-testid": "statusTag",
620
+ display: "flex",
622
621
  position: "relative",
623
- sx: Object.assign({}, tagStyle(color), props.sx),
622
+ sx: Object.assign({}, tagStyle(color), Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx),
623
+ textAlign: "center",
624
624
  children: [jsx(Box, {
625
625
  sx: {
626
626
  position: 'absolute',
@@ -637,6 +637,54 @@ var StatusTag = function StatusTag(_ref) {
637
637
  });
638
638
  };
639
639
 
640
+ /* *
641
+ * Licensed under the Apache License, Version 2.0 (the "License");
642
+ * you may not use this file except in compliance with the License.
643
+ * You may obtain a copy of the License at
644
+ *
645
+ * http://www.apache.org/licenses/LICENSE-2.0
646
+ *
647
+ * Unless required by applicable law or agreed to in writing, software
648
+ * distributed under the License is distributed on an "AS IS" BASIS,
649
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
650
+ * See the License for the specific language governing permissions and
651
+ * limitations under the License.
652
+ *
653
+ * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
654
+ * Copyright 2025 - Finnish Meteorological Institute (FMI)
655
+ * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
656
+ * */
657
+ var SHARED_NAMESPACE = 'shared';
658
+ var geowebLanguages = ['en', 'fi', 'no', 'nl'];
659
+ var loadAllTranslations = function loadAllTranslations(i18nInstance, translationsToLoad) {
660
+ translationsToLoad.forEach(function (_ref) {
661
+ var ns = _ref.ns,
662
+ translations = _ref.translations;
663
+ geowebLanguages.forEach(function (lang) {
664
+ i18nInstance.addResourceBundle(lang, ns, translations[lang]);
665
+ });
666
+ });
667
+ };
668
+ var safelyInitI18nForTestsAndStories = function safelyInitI18nForTestsAndStories(i18nInstance, namespace, translationsToLoad, initLanguage) {
669
+ // This check ensures that we don't init the library many times.
670
+ // - in tests, the init is done globally, so this should not init
671
+ // - in stories, this function should init, but only once if called many times
672
+ if (!i18nInstance.isInitialized && !i18nInstance.isInitializing) {
673
+ void i18nInstance.use(initReactI18next).init({
674
+ lng: initLanguage != null ? initLanguage : 'en',
675
+ ns: namespace,
676
+ interpolation: {
677
+ escapeValue: false
678
+ },
679
+ resources: {}
680
+ });
681
+ }
682
+ loadAllTranslations(i18nInstance, translationsToLoad);
683
+ };
684
+ var useSharedTranslation = function useSharedTranslation() {
685
+ return useTranslation([SHARED_NAMESPACE]);
686
+ };
687
+
640
688
  var _excluded$d = ["bounds", "setIsDragging", "children", "onStop"];
641
689
  var DraggableComponent$1 = function DraggableComponent(_ref) {
642
690
  var _ref$bounds = _ref.bounds,
@@ -647,21 +695,21 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
647
695
  props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
648
696
  var onDragStart = function onDragStart(e) {
649
697
  // This makes sure that nothing is selected during drag
650
- setIsDragging && setIsDragging(true);
698
+ setIsDragging == null || setIsDragging(true);
651
699
  e.preventDefault();
652
700
  };
653
701
  var onDragStop = function onDragStop(event, pos) {
654
- setIsDragging && setIsDragging(false);
655
- onStop && onStop(event, pos);
702
+ setIsDragging == null || setIsDragging(false);
703
+ onStop == null || onStop(event, pos);
656
704
  };
657
705
  return jsx(Draggable, Object.assign({
658
706
  bounds: bounds
659
707
  }, props, {
708
+ enableUserSelectHack: false,
709
+ onStart: onDragStart,
660
710
  onStop: function onStop(event, pos) {
661
711
  return onDragStop(event, pos);
662
712
  },
663
- enableUserSelectHack: false,
664
- onStart: onDragStart,
665
713
  children: children
666
714
  }));
667
715
  };
@@ -669,10 +717,10 @@ var DraggableComponent$1 = function DraggableComponent(_ref) {
669
717
  var _excluded$c = ["children", "onResizeStart", "onResizeStop", "size", "setSize", "minHeight", "minWidth", "enable", "nodeRef"];
670
718
  var isDraggingClassName = 'is-dragging';
671
719
  var useBoundsProps = function useBoundsProps(nodeRef) {
672
- var _React$useState = React__default.useState({}),
720
+ var _React$useState = React.useState({}),
673
721
  boundsProps = _React$useState[0],
674
722
  setBoundsProps = _React$useState[1];
675
- React__default.useEffect(function () {
723
+ React.useEffect(function () {
676
724
  if (nodeRef) {
677
725
  var _nodeRef$current;
678
726
  setBoundsProps({
@@ -711,7 +759,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
711
759
  nodeRef = _ref.nodeRef,
712
760
  props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
713
761
  var theme = useTheme();
714
- var onStartResize = React__default.useCallback(function (event, _direction, node) {
762
+ var onStartResize = React.useCallback(function (event, _direction, node) {
715
763
  event.stopPropagation();
716
764
  node.classList.add(isDraggingClassName);
717
765
  var _node$getBoundingClie = node.getBoundingClientRect(),
@@ -726,7 +774,7 @@ var ResizeComponent = function ResizeComponent(_ref) {
726
774
  node.style.height = height + "px";
727
775
  onResizeStart();
728
776
  }, [onResizeStart, setSize]);
729
- var onStopResize = React__default.useCallback(function (event, direction, node, delta) {
777
+ var onStopResize = React.useCallback(function (event, direction, node, delta) {
730
778
  node.classList.remove(isDraggingClassName);
731
779
  if (!size) {
732
780
  return;
@@ -743,31 +791,31 @@ var ResizeComponent = function ResizeComponent(_ref) {
743
791
  return jsx(Resizable, Object.assign({
744
792
  minHeight: minHeight,
745
793
  minWidth: minWidth,
746
- size: size,
747
- onResizeStop: onStopResize
794
+ onResizeStop: onStopResize,
795
+ size: size
748
796
  }, boundsProps, {
797
+ enable: enable,
749
798
  handleComponent: {
750
799
  bottomRight: jsx(Resize, {
800
+ className: "resizableHandle",
751
801
  style: {
752
802
  fill: "" + theme.palette.geowebColors.buttons.flat["default"].color
753
803
  },
754
804
  sx: {
755
805
  display: 'none'
756
- },
757
- className: "resizableHandle"
806
+ }
758
807
  }),
759
808
  bottomLeft: jsx(Resize, {
809
+ className: "resizableHandle",
760
810
  isRightAligned: true,
761
811
  style: {
762
812
  fill: "" + theme.palette.geowebColors.buttons.flat["default"].color
763
813
  },
764
814
  sx: {
765
815
  display: 'none'
766
- },
767
- className: "resizableHandle"
816
+ }
768
817
  })
769
818
  },
770
- enable: enable,
771
819
  onResizeStart: onStartResize
772
820
  }, props, {
773
821
  children: children
@@ -783,7 +831,7 @@ var useControlledTooltip = function useControlledTooltip() {
783
831
  delayedTooltip = _React$useState2[0],
784
832
  setDelayedTooltip = _React$useState2[1];
785
833
  React.useEffect(function () {
786
- if (tooltipOpen === true) {
834
+ if (tooltipOpen) {
787
835
  var timer = setTimeout(function () {
788
836
  return setDelayedTooltip(true);
789
837
  }, defaultDelay);
@@ -798,14 +846,15 @@ var useControlledTooltip = function useControlledTooltip() {
798
846
  };
799
847
  var CustomTooltip = function CustomTooltip(props) {
800
848
  return jsx(Tooltip, Object.assign({}, props, {
849
+ disableInteractive: true,
801
850
  enterDelay: defaultDelay,
802
- enterNextDelay: defaultDelay,
803
- disableInteractive: true
851
+ enterNextDelay: defaultDelay
804
852
  }));
805
853
  };
806
854
 
807
855
  var _excluded$b = ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"];
808
856
  var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
857
+ var _defaultTooltipProps$;
809
858
  var _ref$tooltipTitle = _ref.tooltipTitle,
810
859
  defaultTooltipTitle = _ref$tooltipTitle === void 0 ? '' : _ref$tooltipTitle,
811
860
  _ref$variant = _ref.variant,
@@ -821,11 +870,12 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
821
870
  defaultTooltipProps = _ref.tooltipProps,
822
871
  props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
823
872
  var classNames = [].concat(className ? [className] : [], isSelected ? ['Mui-selected'] : [], [variant]).join(' ');
824
- var tooltipTitle = (defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) || defaultTooltipTitle;
873
+ var tooltipTitle = (_defaultTooltipProps$ = defaultTooltipProps == null ? void 0 : defaultTooltipProps.title) != null ? _defaultTooltipProps$ : defaultTooltipTitle;
825
874
  var tooltipProps = React.useMemo(function () {
875
+ var _defaultTooltipProps$2;
826
876
  return Object.assign({}, defaultTooltipProps, {
827
877
  title: tooltipTitle,
828
- placement: (defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement) || 'top',
878
+ placement: (_defaultTooltipProps$2 = defaultTooltipProps == null ? void 0 : defaultTooltipProps.placement) != null ? _defaultTooltipProps$2 : 'top',
829
879
  sx: {
830
880
  pointerEvents: 'none'
831
881
  }
@@ -835,11 +885,11 @@ var CustomIconButtonNoMemo = /*#__PURE__*/React.forwardRef(function (_ref, ref)
835
885
  return jsx(IconButton, Object.assign({
836
886
  "aria-label": tooltipTitle
837
887
  }, props, {
838
- size: size,
888
+ "aria-pressed": isSelected,
839
889
  className: classNames,
840
890
  ref: ref,
841
- "aria-pressed": isSelected,
842
- sx: Object.assign({}, props.sx, shouldShowAsDisabled && {
891
+ size: size,
892
+ sx: Object.assign({}, Array.isArray(props.sx) ? Object.assign.apply(Object, [{}].concat(props.sx)) : props.sx, shouldShowAsDisabled && {
843
893
  '&.MuiIconButton-root': {
844
894
  color: "geowebColors.iconButtons." + variant + ".disabled.color"
845
895
  },
@@ -937,29 +987,28 @@ var ToggleMenu = function ToggleMenu(_ref) {
937
987
  }, [isDefaultOpen, buttonTestId]);
938
988
  return jsxs(Fragment, {
939
989
  children: [jsx(CustomIconButton, {
990
+ "data-testid": buttonTestId,
991
+ disabled: isDisabled,
992
+ id: buttonTestId,
993
+ isSelected: isOpen,
994
+ onClick: handleClick,
995
+ sx: buttonSx,
940
996
  tooltipProps: {
941
997
  placement: 'top',
942
998
  title: tooltipTitle
943
999
  },
944
- isSelected: isOpen,
945
- sx: buttonSx,
946
- onClick: handleClick,
947
- "data-testid": buttonTestId,
948
1000
  variant: variant,
949
- id: buttonTestId,
950
- disabled: isDisabled,
951
1001
  children: buttonIcon
952
1002
  }), jsxs(Menu, {
953
1003
  anchorEl: anchorEl,
954
- open: isOpen,
1004
+ anchorOrigin: anchorOrigin,
955
1005
  onClose: function onClose(event, reason) {
956
1006
  if (reason === 'tabKeyDown') {
957
1007
  return;
958
1008
  }
959
1009
  handleClose(event);
960
1010
  },
961
- anchorOrigin: anchorOrigin,
962
- transformOrigin: transformOrigin,
1011
+ open: isOpen,
963
1012
  slotProps: {
964
1013
  backdrop: {
965
1014
  style: {
@@ -973,7 +1022,8 @@ var ToggleMenu = function ToggleMenu(_ref) {
973
1022
  }
974
1023
  })
975
1024
  },
976
- children: [menuTitle && jsx(ListSubheader, {
1025
+ transformOrigin: transformOrigin,
1026
+ children: [menuTitle ? jsx(ListSubheader, {
977
1027
  "data-testid": "toggleMenuTitle",
978
1028
  children: jsx(Typography, {
979
1029
  sx: {
@@ -981,28 +1031,28 @@ var ToggleMenu = function ToggleMenu(_ref) {
981
1031
  },
982
1032
  children: menuTitle
983
1033
  })
984
- }), menuItems && menuItems.length ? menuItems.map(function (menuItem) {
1034
+ }) : null, menuItems != null && menuItems.length ? menuItems.map(function (menuItem) {
985
1035
  var text = menuItem.text,
986
1036
  icon = menuItem.icon,
987
1037
  action = menuItem.action,
988
1038
  isDisabled = menuItem.isDisabled;
989
1039
  return jsx(MenuItem, {
1040
+ disabled: isDisabled,
990
1041
  onClick: function onClick(event) {
991
1042
  action(event);
992
1043
  handleClose(event);
993
1044
  },
994
- disabled: isDisabled,
995
1045
  selected: menuItem.isSelected,
996
1046
  children: jsxs(Grid, {
997
1047
  container: true,
998
- spacing: 2,
999
1048
  justifyContent: "space-between",
1000
1049
  size: "grow",
1050
+ spacing: 2,
1001
1051
  children: [jsx(Grid, {
1002
1052
  children: jsx(ListItemText, {
1003
1053
  children: text
1004
1054
  })
1005
- }), icon && jsx(Grid, {
1055
+ }), icon ? jsx(Grid, {
1006
1056
  alignItems: "flex-end",
1007
1057
  children: jsx(ListItemIcon, {
1008
1058
  sx: {
@@ -1012,7 +1062,7 @@ var ToggleMenu = function ToggleMenu(_ref) {
1012
1062
  },
1013
1063
  children: icon
1014
1064
  })
1015
- })]
1065
+ }) : null]
1016
1066
  })
1017
1067
  }, text);
1018
1068
  }) : jsx("div", {}) // Needed to make the menu work without any menuItems
@@ -1021,57 +1071,11 @@ var ToggleMenu = function ToggleMenu(_ref) {
1021
1071
  });
1022
1072
  };
1023
1073
 
1024
- /* *
1025
- * Licensed under the Apache License, Version 2.0 (the "License");
1026
- * you may not use this file except in compliance with the License.
1027
- * You may obtain a copy of the License at
1028
- *
1029
- * http://www.apache.org/licenses/LICENSE-2.0
1030
- *
1031
- * Unless required by applicable law or agreed to in writing, software
1032
- * distributed under the License is distributed on an "AS IS" BASIS,
1033
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1034
- * See the License for the specific language governing permissions and
1035
- * limitations under the License.
1036
- *
1037
- * Copyright 2025 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1038
- * Copyright 2025 - Finnish Meteorological Institute (FMI)
1039
- * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
1040
- * */
1041
- var SHARED_NAMESPACE = 'shared';
1042
- var geowebLanguages = ['en', 'fi', 'no', 'nl'];
1043
- var loadAllTranslations = function loadAllTranslations(i18nInstance, translationsToLoad) {
1044
- translationsToLoad.forEach(function (_ref) {
1045
- var ns = _ref.ns,
1046
- translations = _ref.translations;
1047
- geowebLanguages.forEach(function (lang) {
1048
- i18nInstance.addResourceBundle(lang, ns, translations[lang]);
1049
- });
1050
- });
1051
- };
1052
- var safelyInitI18nForTestsAndStories = function safelyInitI18nForTestsAndStories(i18nInstance, namespace, translationsToLoad, initLanguage) {
1053
- // This check ensures that we don't init the library many times.
1054
- // - in tests, the init is done globally, so this should not init
1055
- // - in stories, this function should init, but only once if called many times
1056
- if (!i18nInstance.isInitialized && !i18nInstance.isInitializing) {
1057
- void i18nInstance.use(initReactI18next).init({
1058
- lng: initLanguage != null ? initLanguage : 'en',
1059
- ns: namespace,
1060
- interpolation: {
1061
- escapeValue: false
1062
- },
1063
- resources: {}
1064
- });
1065
- }
1066
- loadAllTranslations(i18nInstance, translationsToLoad);
1067
- };
1068
- var useSharedTranslation = function useSharedTranslation() {
1069
- return useTranslation([SHARED_NAMESPACE]);
1070
- };
1071
-
1072
1074
  var Title = function Title(_ref) {
1073
1075
  var title = _ref.title;
1074
1076
  return jsx(Typography, {
1077
+ component: "span",
1078
+ "data-testid": "customDialog-title",
1075
1079
  sx: {
1076
1080
  fontSize: '16px',
1077
1081
  fontWeight: 500,
@@ -1081,8 +1085,6 @@ var Title = function Title(_ref) {
1081
1085
  whiteSpace: 'nowrap',
1082
1086
  color: 'geowebColors.typographyAndIcons.text'
1083
1087
  },
1084
- "data-testid": "customDialog-title",
1085
- component: "span",
1086
1088
  children: title
1087
1089
  });
1088
1090
  };
@@ -1101,11 +1103,11 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
1101
1103
  justifyContent: 'space-between',
1102
1104
  alignItems: 'center'
1103
1105
  },
1104
- children: [title && jsx(Title, {
1106
+ children: [title ? jsx(Title, {
1105
1107
  title: title
1106
- }), jsx(CustomIconButton, {
1107
- "data-testid": "customDialog-close",
1108
+ }) : null, jsx(CustomIconButton, {
1108
1109
  "aria-label": "close",
1110
+ "data-testid": "customDialog-close",
1109
1111
  onClick: function onClick() {
1110
1112
  return onClose('CLOSED');
1111
1113
  },
@@ -1119,41 +1121,41 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
1119
1121
  })
1120
1122
  })]
1121
1123
  }) : jsxs(Grid, {
1124
+ alignItems: "center",
1125
+ "aria-label": "Dialog options header",
1122
1126
  container: true,
1123
1127
  "data-testid": "dialog-action-header",
1124
- alignItems: "center",
1125
1128
  sx: {
1126
1129
  boxShadow: 1,
1127
1130
  py: 0.5,
1128
1131
  px: 1,
1129
1132
  zIndex: 1
1130
1133
  },
1131
- "aria-label": "Dialog options header",
1132
1134
  children: [jsx(Grid, {
1133
1135
  size: 4,
1134
1136
  children: jsx(Button, {
1137
+ "aria-label": "close",
1138
+ "data-testid": "contentdialog-close",
1135
1139
  onClick: function onClick() {
1136
1140
  return onClose('CLOSED');
1137
1141
  },
1138
- variant: "flat",
1139
- "aria-label": "close",
1140
1142
  startIcon: jsx(ChevronLeft, {}),
1141
- "data-testid": "contentdialog-close",
1142
1143
  sx: {
1143
1144
  textTransform: 'uppercase'
1144
1145
  },
1146
+ variant: "flat",
1145
1147
  children: t('shared-customdialog-back')
1146
1148
  })
1147
1149
  }), jsx(Grid, {
1150
+ size: 4,
1148
1151
  sx: {
1149
1152
  display: 'flex',
1150
1153
  justifyContent: 'center',
1151
1154
  textAlign: 'center'
1152
1155
  },
1153
- size: 4,
1154
- children: title && jsx(Title, {
1156
+ children: title ? jsx(Title, {
1155
1157
  title: title
1156
- })
1158
+ }) : null
1157
1159
  }), jsx(Grid, {
1158
1160
  size: 4,
1159
1161
  children: jsx(Box, {
@@ -1177,12 +1179,12 @@ var CustomDialogHeader = function CustomDialogHeader(_ref2) {
1177
1179
  _ref3$isDisabled = _ref3.isDisabled,
1178
1180
  isDisabled = _ref3$isDisabled === void 0 ? false : _ref3$isDisabled;
1179
1181
  return jsx(Button, {
1182
+ disabled: isDisabled,
1180
1183
  onClick: action,
1181
- variant: variant || 'flat',
1182
1184
  sx: {
1183
1185
  minWidth: 96
1184
1186
  },
1185
- disabled: isDisabled,
1187
+ variant: variant != null ? variant : 'flat',
1186
1188
  children: text
1187
1189
  }, text + "-" + variant);
1188
1190
  })
@@ -1227,12 +1229,12 @@ var PaperComponent = function PaperComponent(_ref) {
1227
1229
  var maxWidth = '98%';
1228
1230
  var maxHeight = '98%';
1229
1231
  return jsx(ResizeComponent, Object.assign({
1230
- size: defaultSize,
1231
- maxWidth: maxWidth,
1232
+ className: "custom-dialog-resize",
1232
1233
  maxHeight: maxHeight,
1234
+ maxWidth: maxWidth,
1233
1235
  minHeight: 120,
1234
1236
  minWidth: 280,
1235
- className: "custom-dialog-resize",
1237
+ size: defaultSize,
1236
1238
  style: {
1237
1239
  display: 'flex'
1238
1240
  }
@@ -1293,20 +1295,26 @@ var CustomDialog = function CustomDialog(_ref2) {
1293
1295
  size = _React$useState[0],
1294
1296
  setSize = _React$useState[1];
1295
1297
  return jsx(Dialog, Object.assign({
1298
+ "aria-labelledby": "dialog-title",
1296
1299
  "data-testid": "customDialog",
1297
1300
  // fix for briefly showing default options when closing dialog
1298
- transitionDuration: 0,
1301
+ transitionDuration: 0
1302
+ }, isResizable && {
1303
+ PaperComponent: PaperComponent
1304
+ }, shouldRenderInline && {
1305
+ disablePortal: true
1306
+ }, {
1307
+ disableRestoreFocus: disableRestoreFocus,
1299
1308
  onClose: function onClose() {
1300
1309
  _onClose('CLOSED');
1301
1310
  },
1302
- "aria-labelledby": "dialog-title",
1303
1311
  slotProps: Object.assign({}, slotProps, {
1304
1312
  paper: {
1305
1313
  sx: Object.assign({}, !other.fullWidth && !other.maxWidth && {
1306
1314
  maxWidth: '560px'
1307
1315
  }, other.maxWidth && {
1308
1316
  maxWidth: other.maxWidth
1309
- }, sx)
1317
+ }, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx)
1310
1318
  }
1311
1319
  }, isResizable && {
1312
1320
  paper: {
@@ -1325,32 +1333,26 @@ var CustomDialog = function CustomDialog(_ref2) {
1325
1333
  position: 'absolute'
1326
1334
  }
1327
1335
  }
1328
- })
1329
- }, isResizable && {
1330
- PaperComponent: PaperComponent
1331
- }, shouldRenderInline && {
1332
- disablePortal: true
1333
- }, {
1334
- sx: Object.assign({}, sx, isResizable && {
1336
+ }),
1337
+ sx: Object.assign({}, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx, isResizable && {
1335
1338
  '.custom-dialog-resize': {
1336
1339
  height: 'initial'
1337
1340
  }
1338
- }),
1339
- disableRestoreFocus: disableRestoreFocus
1341
+ })
1340
1342
  }, other, {
1341
1343
  children: hasLayout ? jsxs(Fragment, {
1342
1344
  children: [jsx(CustomDialogHeader, {
1343
- title: title,
1344
1345
  headerActions: headerActions,
1345
- onClose: _onClose
1346
+ onClose: _onClose,
1347
+ title: title
1346
1348
  }), jsxs(DialogContent, {
1347
1349
  sx: {
1348
1350
  padding: '8px 16px'
1349
1351
  },
1350
- children: [description && jsx(Typography, {
1352
+ children: [description ? jsx(Typography, {
1351
1353
  variant: "body1",
1352
1354
  children: description
1353
- }), children]
1355
+ }) : null, children]
1354
1356
  }), !headerActions && jsx(DialogActions, {
1355
1357
  sx: {
1356
1358
  padding: 2,
@@ -1395,7 +1397,9 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
1395
1397
  return jsxs(Fragment, {
1396
1398
  children: [jsx(Button, {
1397
1399
  "data-testid": "confirmationDialog-cancel",
1398
- variant: "tertiary",
1400
+ onClick: function onClick() {
1401
+ return onClose('CANCELLED');
1402
+ },
1399
1403
  sx: function sx(theme) {
1400
1404
  return {
1401
1405
  width: {
@@ -1408,9 +1412,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
1408
1412
  }
1409
1413
  };
1410
1414
  },
1411
- onClick: function onClick() {
1412
- return onClose('CANCELLED');
1413
- },
1415
+ variant: "tertiary",
1414
1416
  children: cancelLabel != null ? cancelLabel : t('shared-confirmation-cancel')
1415
1417
  }), isLoading ? jsx(Box, {
1416
1418
  "data-testid": "confirm-dialog-spinner",
@@ -1421,12 +1423,13 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
1421
1423
  alignItems: 'center'
1422
1424
  }),
1423
1425
  children: jsx(CircularProgress, {
1424
- size: 40,
1425
- color: "secondary"
1426
+ color: "secondary",
1427
+ size: 40
1426
1428
  })
1427
1429
  }) : jsx(Button, {
1430
+ autoFocus: !disableAutoFocus,
1428
1431
  "data-testid": "confirmationDialog-confirm",
1429
- variant: "primary",
1432
+ onClick: onSubmit,
1430
1433
  sx: function sx(theme) {
1431
1434
  return Object.assign({}, confirmStyle, {
1432
1435
  '&:focus': {
@@ -1435,8 +1438,7 @@ var ConfirmationButtons = function ConfirmationButtons(_ref) {
1435
1438
  }
1436
1439
  });
1437
1440
  },
1438
- onClick: onSubmit,
1439
- autoFocus: !disableAutoFocus,
1441
+ variant: "primary",
1440
1442
  children: confirmLabel != null ? confirmLabel : t('shared-confirmation-submit')
1441
1443
  })]
1442
1444
  });
@@ -1464,19 +1466,19 @@ var ConfirmationDialog = function ConfirmationDialog(_ref) {
1464
1466
  var _useSharedTranslation = useSharedTranslation(),
1465
1467
  t = _useSharedTranslation.t;
1466
1468
  return jsx(CustomDialog, Object.assign({
1467
- "data-testid": "confirmationDialog",
1468
- open: open,
1469
- title: title,
1470
- description: description != null ? description : t('shared-confirmation-description'),
1471
- onClose: onClose,
1472
1469
  actions: jsx(ConfirmationButtons, {
1473
- onClose: onClose,
1474
1470
  cancelLabel: cancelLabel,
1475
- isLoading: isLoading,
1476
- onSubmit: onSubmit,
1471
+ confirmLabel: confirmLabel,
1477
1472
  disableAutoFocus: disableAutoFocus,
1478
- confirmLabel: confirmLabel
1479
- })
1473
+ isLoading: isLoading,
1474
+ onClose: onClose,
1475
+ onSubmit: onSubmit
1476
+ }),
1477
+ "data-testid": "confirmationDialog",
1478
+ description: description != null ? description : t('shared-confirmation-description'),
1479
+ onClose: onClose,
1480
+ open: open,
1481
+ title: title
1480
1482
  }, rest, {
1481
1483
  children: content
1482
1484
  }));
@@ -1577,8 +1579,8 @@ var usePoller = function usePoller(deps, callback, pollingInterval) {
1577
1579
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1578
1580
  * */
1579
1581
  function usePrevious(value) {
1580
- var ref = React.useRef();
1581
- React.useEffect(function () {
1582
+ var ref = useRef();
1583
+ useEffect(function () {
1582
1584
  ref.current = value;
1583
1585
  });
1584
1586
  return ref.current;
@@ -1679,7 +1681,7 @@ var adjustPosition = function adjustPosition(bbox, containingView, position, set
1679
1681
  }
1680
1682
  };
1681
1683
  var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
1682
- var onResizeWindow = React__default.useCallback(function () {
1684
+ var onResizeWindow = React.useCallback(function () {
1683
1685
  if (!nodeRef.current) {
1684
1686
  return;
1685
1687
  }
@@ -1687,7 +1689,7 @@ var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysIn
1687
1689
  var containingView = nodeRef.current.parentElement.getBoundingClientRect();
1688
1690
  adjustPosition(bbox, containingView, position, setPosition);
1689
1691
  }, [nodeRef, position, setPosition]);
1690
- React__default.useEffect(function () {
1692
+ React.useEffect(function () {
1691
1693
  var throttledResize = throttle(onResizeWindow, 100);
1692
1694
  window.addEventListener('resize', throttledResize);
1693
1695
  return function () {
@@ -1724,10 +1726,10 @@ var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysIn
1724
1726
  const debouncedName = useDebounce('testing', 2000)
1725
1727
  */
1726
1728
  var useDebounce = function useDebounce(value, timeout) {
1727
- var _React$useState = React.useState(value),
1728
- state = _React$useState[0],
1729
- setState = _React$useState[1];
1730
- React.useEffect(function () {
1729
+ var _useState = useState(value),
1730
+ state = _useState[0],
1731
+ setState = _useState[1];
1732
+ useEffect(function () {
1731
1733
  var handler = setTimeout(function () {
1732
1734
  return setState(value);
1733
1735
  }, timeout);
@@ -1756,8 +1758,8 @@ var useDebounce = function useDebounce(value, timeout) {
1756
1758
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1757
1759
  * */
1758
1760
  var useWheelStopPropagation = function useWheelStopPropagation() {
1759
- var ref = React__default.useRef(null);
1760
- React__default.useEffect(function () {
1761
+ var ref = React.useRef(null);
1762
+ React.useEffect(function () {
1761
1763
  var element = ref.current;
1762
1764
  if (!element) {
1763
1765
  return;
@@ -1800,8 +1802,8 @@ var useWheelStopPropagation = function useWheelStopPropagation() {
1800
1802
  * as calling event.stopPropagation() on syncthetic events does not stop the propagation
1801
1803
  */
1802
1804
  var useScrollingInIsolation = function useScrollingInIsolation(options) {
1803
- var scrollInIsolationRef = React__default.useRef(null);
1804
- React__default.useEffect(function () {
1805
+ var scrollInIsolationRef = React.useRef(null);
1806
+ React.useEffect(function () {
1805
1807
  var element = scrollInIsolationRef.current;
1806
1808
  if (!element) {
1807
1809
  return;
@@ -1839,6 +1841,7 @@ var useDialogActions = function useDialogActions(awaitingPromiseRef, defaultOpti
1839
1841
  var _React$useState = React.useState(defaultOptions),
1840
1842
  confirmationState = _React$useState[0],
1841
1843
  setConfirmationState = _React$useState[1];
1844
+ // eslint-disable-next-line @typescript-eslint/promise-function-async
1842
1845
  var openConfirmation = function openConfirmation(options) {
1843
1846
  setConfirmationState(options);
1844
1847
  return new Promise(function (resolve, reject) {
@@ -1880,12 +1883,40 @@ var useDialogActions = function useDialogActions(awaitingPromiseRef, defaultOpti
1880
1883
  var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
1881
1884
  var children = _ref.children;
1882
1885
  var awaitingPromiseRef = React.useRef({
1883
- resolve: function resolve() {
1884
- return Promise.resolve();
1885
- },
1886
- reject: function reject() {
1887
- return Promise.reject();
1888
- }
1886
+ resolve: function () {
1887
+ var _resolve = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1888
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1889
+ while (1) switch (_context.prev = _context.next) {
1890
+ case 0:
1891
+ return _context.abrupt("return", Promise.resolve());
1892
+ case 1:
1893
+ case "end":
1894
+ return _context.stop();
1895
+ }
1896
+ }, _callee);
1897
+ }));
1898
+ function resolve() {
1899
+ return _resolve.apply(this, arguments);
1900
+ }
1901
+ return resolve;
1902
+ }(),
1903
+ reject: function () {
1904
+ var _reject = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1905
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1906
+ while (1) switch (_context2.prev = _context2.next) {
1907
+ case 0:
1908
+ return _context2.abrupt("return", Promise.reject());
1909
+ case 1:
1910
+ case "end":
1911
+ return _context2.stop();
1912
+ }
1913
+ }, _callee2);
1914
+ }));
1915
+ function reject() {
1916
+ return _reject.apply(this, arguments);
1917
+ }
1918
+ return reject;
1919
+ }()
1889
1920
  });
1890
1921
  var _useDialogActions = useDialogActions(awaitingPromiseRef),
1891
1922
  openConfirmation = _useDialogActions.openConfirmation,
@@ -1895,9 +1926,9 @@ var ConfirmationServiceProvider = function ConfirmationServiceProvider(_ref) {
1895
1926
  return jsxs(ConfirmationServiceContext.Provider, {
1896
1927
  value: openConfirmation,
1897
1928
  children: [children, jsx(ConfirmationDialog, Object.assign({
1898
- open: Boolean(confirmationState),
1929
+ onClose: handleClose,
1899
1930
  onSubmit: handleSubmit,
1900
- onClose: handleClose
1931
+ open: Boolean(confirmationState)
1901
1932
  }, confirmationState))]
1902
1933
  });
1903
1934
  };
@@ -1910,32 +1941,32 @@ var AlertIcon = function AlertIcon(_ref) {
1910
1941
  switch (severity) {
1911
1942
  case 'info':
1912
1943
  return jsx(Info, {
1944
+ "data-testid": dataTestId,
1913
1945
  sx: {
1914
1946
  color: 'geowebColors.functional.notification'
1915
- },
1916
- "data-testid": dataTestId
1947
+ }
1917
1948
  });
1918
1949
  case 'success':
1919
1950
  return jsx(Success, {
1951
+ "data-testid": dataTestId,
1920
1952
  sx: {
1921
1953
  color: 'geowebColors.functional.success'
1922
- },
1923
- "data-testid": dataTestId
1954
+ }
1924
1955
  });
1925
1956
  case 'warning':
1926
1957
  return jsx(Exclamation, {
1958
+ "data-testid": dataTestId,
1927
1959
  sx: {
1928
1960
  color: 'geowebColors.functional.warning'
1929
- },
1930
- "data-testid": dataTestId
1961
+ }
1931
1962
  });
1932
1963
  case 'error':
1933
1964
  default:
1934
1965
  return jsx(Exclamation, {
1966
+ "data-testid": dataTestId,
1935
1967
  sx: {
1936
1968
  color: 'geowebColors.functional.error'
1937
- },
1938
- "data-testid": dataTestId
1969
+ }
1939
1970
  });
1940
1971
  }
1941
1972
  };
@@ -1963,21 +1994,21 @@ var AlertBanner = function AlertBanner(_ref) {
1963
1994
  return null;
1964
1995
  }
1965
1996
  return jsxs(Alert, {
1966
- "data-testid": dataTestId,
1967
- severity: severity,
1968
- icon: jsx(AlertIcon, {
1969
- severity: severity
1970
- }),
1971
1997
  action: shouldClose ? jsx(Button, {
1972
- variant: "flat",
1973
1998
  onClick: function onClick() {
1974
1999
  return setIsOpen(false);
1975
2000
  },
1976
2001
  sx: {
1977
2002
  backgroundColor: 'transparent!important'
1978
2003
  },
2004
+ variant: "flat",
1979
2005
  children: t('shared-close-caps')
1980
2006
  }) : undefined,
2007
+ "data-testid": dataTestId,
2008
+ icon: jsx(AlertIcon, {
2009
+ severity: severity
2010
+ }),
2011
+ severity: severity,
1981
2012
  sx: isCompact ? {
1982
2013
  height: '32px',
1983
2014
  boxSizing: 'border-box',
@@ -2016,7 +2047,7 @@ var AlertBanner = function AlertBanner(_ref) {
2016
2047
  lineHeight: isCompact ? '18px' : '24px'
2017
2048
  },
2018
2049
  children: title
2019
- }), info && jsx(Box, {
2050
+ }), info ? jsx(Box, {
2020
2051
  sx: {
2021
2052
  fontSize: '16px',
2022
2053
  marginTop: 1,
@@ -2024,18 +2055,18 @@ var AlertBanner = function AlertBanner(_ref) {
2024
2055
  lineHeight: '22px'
2025
2056
  },
2026
2057
  children: info
2027
- }), actionButtonProps && jsx(Button, {
2028
- variant: "flat",
2058
+ }) : null, actionButtonProps ? jsx(Button, {
2029
2059
  onClick: function onClick(event) {
2030
2060
  setIsOpen(false);
2031
2061
  actionButtonProps.onClick(event);
2032
2062
  },
2063
+ startIcon: jsx(ChevronRight, {}),
2033
2064
  sx: {
2034
2065
  backgroundColor: 'transparent!important'
2035
2066
  },
2036
- startIcon: jsx(ChevronRight, {}),
2067
+ variant: "flat",
2037
2068
  children: actionButtonProps.title.toUpperCase()
2038
- })]
2069
+ }) : null]
2039
2070
  });
2040
2071
  };
2041
2072
 
@@ -2043,12 +2074,12 @@ var AppLayout = function AppLayout(_ref) {
2043
2074
  var header = _ref.header,
2044
2075
  children = _ref.children;
2045
2076
  return jsxs(Box, {
2077
+ "data-testid": "appLayout",
2046
2078
  sx: {
2047
2079
  height: '100dvh',
2048
2080
  display: 'flex',
2049
2081
  flexDirection: 'column'
2050
2082
  },
2051
- "data-testid": "appLayout",
2052
2083
  children: [header, jsx(Box, {
2053
2084
  component: "main",
2054
2085
  sx: {
@@ -2069,17 +2100,17 @@ var AppHeader = function AppHeader(_ref) {
2069
2100
  title = _ref$title === void 0 ? 'GeoWeb' : _ref$title,
2070
2101
  onClick = _ref.onClick;
2071
2102
  var theme = useTheme();
2072
- var _React$useState = React__default.useState(false),
2103
+ var _React$useState = React.useState(false),
2073
2104
  isDrawerOpen = _React$useState[0],
2074
- toggleDrawer = _React$useState[1];
2105
+ setIsDrawerOpen = _React$useState[1];
2075
2106
  var onToggleDrawer = function onToggleDrawer(isOpen) {
2076
- return toggleDrawer(isOpen);
2107
+ return setIsDrawerOpen(isOpen);
2077
2108
  };
2078
2109
  var onKeyDown = function onKeyDown(event) {
2079
2110
  if (event.key === 'Tab' || event.key === 'Shift') {
2080
2111
  return;
2081
2112
  }
2082
- toggleDrawer(false);
2113
+ setIsDrawerOpen(false);
2083
2114
  };
2084
2115
  return jsxs(Box, {
2085
2116
  component: "header",
@@ -2115,8 +2146,8 @@ var AppHeader = function AppHeader(_ref) {
2115
2146
  cursor: onClick ? 'pointer' : 'auto'
2116
2147
  },
2117
2148
  children: [(_theme$palette$geoweb = theme.palette.geowebColors.logo) != null && _theme$palette$geoweb.image ? jsx("img", {
2118
- src: theme.palette.geowebColors.logo.image,
2119
2149
  alt: "GeoWeb",
2150
+ src: theme.palette.geowebColors.logo.image,
2120
2151
  style: {
2121
2152
  height: '29px',
2122
2153
  width: '47px'
@@ -2128,7 +2159,6 @@ var AppHeader = function AppHeader(_ref) {
2128
2159
  right: '-1px'
2129
2160
  }
2130
2161
  }), jsx(Typography, {
2131
- variant: "h1",
2132
2162
  sx: {
2133
2163
  display: 'none',
2134
2164
  fontSize: '20px',
@@ -2144,9 +2174,10 @@ var AppHeader = function AppHeader(_ref) {
2144
2174
  marginLeft: 1,
2145
2175
  maxWidth: 130
2146
2176
  },
2177
+ variant: "h1",
2147
2178
  children: title
2148
2179
  })]
2149
- }), menu && jsxs(Box, {
2180
+ }), menu ? jsxs(Box, {
2150
2181
  className: "hamburger-btn",
2151
2182
  sx: {
2152
2183
  display: 'flex',
@@ -2155,22 +2186,22 @@ var AppHeader = function AppHeader(_ref) {
2155
2186
  },
2156
2187
  children: [jsx(CustomIconButton, {
2157
2188
  "data-testid": "menuButton",
2189
+ isSelected: isDrawerOpen,
2158
2190
  onClick: function onClick() {
2159
2191
  return onToggleDrawer(true);
2160
2192
  },
2161
- isSelected: isDrawerOpen,
2162
2193
  children: jsx(HamburgerMenu, {})
2163
2194
  }), jsx(Drawer, {
2164
- "data-testid": "app-drawer",
2165
2195
  anchor: "left",
2166
- open: isDrawerOpen,
2167
- onClose: function onClose() {
2196
+ "data-testid": "app-drawer",
2197
+ onClick: function onClick() {
2168
2198
  return onToggleDrawer(false);
2169
2199
  },
2170
- onClick: function onClick() {
2200
+ onClose: function onClose() {
2171
2201
  return onToggleDrawer(false);
2172
2202
  },
2173
2203
  onKeyDown: onKeyDown,
2204
+ open: isDrawerOpen,
2174
2205
  sx: {
2175
2206
  '& .MuiDrawer-paper': {
2176
2207
  top: '40px'
@@ -2185,7 +2216,7 @@ var AppHeader = function AppHeader(_ref) {
2185
2216
  children: menu
2186
2217
  })
2187
2218
  })]
2188
- }), jsx(Box, {
2219
+ }) : null, jsx(Box, {
2189
2220
  className: "workspace-topbar",
2190
2221
  sx: {
2191
2222
  flexGrow: 1,
@@ -2291,20 +2322,20 @@ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
2291
2322
  return jsx(Box, {
2292
2323
  sx: displayOnTop ? displayOnTopStyles : normalStyles,
2293
2324
  children: jsx(AlertBanner, {
2294
- severity: "error",
2295
- title: "Woops, an error has occurred. Please report the error shown below and reload the page if needed.",
2296
2325
  info: jsxs("div", {
2297
- children: [jsx("br", {}), error.toString(), jsx("br", {}), errorInfo && errorInfo.componentStack, jsx("br", {}), jsx("br", {}), jsx(Link, {
2298
- underline: "always",
2299
- style: {
2300
- cursor: 'pointer'
2301
- },
2326
+ children: [jsx("br", {}), error.toString(), jsx("br", {}), errorInfo == null ? void 0 : errorInfo.componentStack, jsx("br", {}), jsx("br", {}), jsx(Link, {
2302
2327
  onClick: function onClick() {
2303
2328
  return window.location.reload();
2304
2329
  },
2330
+ style: {
2331
+ cursor: 'pointer'
2332
+ },
2333
+ underline: "always",
2305
2334
  children: reloadPage
2306
2335
  })]
2307
- })
2336
+ }),
2337
+ severity: "error",
2338
+ title: "Woops, an error has occurred. Please report the error shown below and reload the page if needed."
2308
2339
  })
2309
2340
  });
2310
2341
  }
@@ -2376,9 +2407,10 @@ var UserMenu = function UserMenu(_ref) {
2376
2407
  var toggleRef = useRef(null);
2377
2408
  return jsxs(Fragment, {
2378
2409
  children: [jsx(CustomIconButton, {
2379
- ref: toggleRef,
2380
2410
  "data-testid": "userButton",
2381
2411
  onClick: onToggle,
2412
+ ref: toggleRef,
2413
+ size: "medium",
2382
2414
  sx: {
2383
2415
  '&.MuiButtonBase-root': Object.assign({
2384
2416
  background: 'transparent',
@@ -2393,11 +2425,10 @@ var UserMenu = function UserMenu(_ref) {
2393
2425
  }
2394
2426
  })
2395
2427
  },
2396
- size: "medium",
2397
2428
  children: !isAdmin ? jsx(Avatar, {
2398
2429
  children: initials
2399
2430
  }) : jsxs(Fragment, {
2400
- children: [jsx(Admin, {}), initials && jsx("div", {
2431
+ children: [jsx(Admin, {}), initials ? jsx("div", {
2401
2432
  style: {
2402
2433
  position: 'absolute',
2403
2434
  fontSize: '14px',
@@ -2406,12 +2437,13 @@ var UserMenu = function UserMenu(_ref) {
2406
2437
  fontWeight: 500
2407
2438
  },
2408
2439
  children: initials
2409
- })]
2440
+ }) : null]
2410
2441
  })
2411
- }), isOpen && jsx(Paper, {
2412
- sx: styles$4.container,
2442
+ }), isOpen ? jsx(Paper, {
2413
2443
  "data-testid": "userMenu",
2444
+ sx: styles$4.container,
2414
2445
  children: jsx(ClickAwayListener, {
2446
+ mouseEvent: "onMouseDown",
2415
2447
  onClickAway: function onClickAway(event) {
2416
2448
  var _toggleRef$current;
2417
2449
  if ((_toggleRef$current = toggleRef.current) != null && _toggleRef$current.contains(event.target)) {
@@ -2419,14 +2451,13 @@ var UserMenu = function UserMenu(_ref) {
2419
2451
  }
2420
2452
  onClose();
2421
2453
  },
2422
- mouseEvent: "onMouseDown",
2423
2454
  children: jsx(MenuList, {
2424
2455
  sx: styles$4.userMenu,
2425
2456
  variant: "menu",
2426
2457
  children: children
2427
2458
  })
2428
2459
  })
2429
- })]
2460
+ }) : null]
2430
2461
  });
2431
2462
  };
2432
2463
 
@@ -2451,38 +2482,38 @@ var MenuItemTheme = function MenuItemTheme(_ref) {
2451
2482
  }
2452
2483
  },
2453
2484
  children: [jsx(FormControlLabel, {
2454
- value: ThemeTypes.LIGHT_THEME,
2455
2485
  control: jsx(Radio, {
2456
2486
  checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.LIGHT_THEME
2457
2487
  }),
2458
- label: t('shared-light')
2488
+ label: t('shared-light'),
2489
+ value: ThemeTypes.LIGHT_THEME
2459
2490
  }), jsx(FormControlLabel, {
2460
- value: ThemeTypes.DARK_THEME,
2461
2491
  control: jsx(Radio, {
2462
2492
  checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.DARK_THEME
2463
2493
  }),
2464
- label: t('shared-dark')
2465
- }), enableSpecialThemes && jsxs(Fragment, {
2494
+ label: t('shared-dark'),
2495
+ value: ThemeTypes.DARK_THEME
2496
+ }), enableSpecialThemes ? jsxs(Fragment, {
2466
2497
  children: [jsx(FormControlLabel, {
2467
- value: ThemeTypes.DEMO_THEME,
2468
2498
  control: jsx(Radio, {
2469
2499
  checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.DEMO_THEME
2470
2500
  }),
2471
- label: "Demo"
2501
+ label: "Demo",
2502
+ value: ThemeTypes.DEMO_THEME
2472
2503
  }), jsx(FormControlLabel, {
2473
- value: ThemeTypes.XMAS2024_THEME,
2474
2504
  control: jsx(Radio, {
2475
2505
  checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.XMAS2024_THEME
2476
2506
  }),
2477
- label: t('shared-xmas') + " 2024"
2507
+ label: t('shared-xmas') + " 2024",
2508
+ value: ThemeTypes.XMAS2024_THEME
2478
2509
  }), jsx(FormControlLabel, {
2479
- value: ThemeTypes.EUMETNET_THEME,
2480
2510
  control: jsx(Radio, {
2481
2511
  checked: (namedTheme == null ? void 0 : namedTheme.name) === ThemeTypes.EUMETNET_THEME
2482
2512
  }),
2483
- label: "EUMETNET"
2513
+ label: "EUMETNET",
2514
+ value: ThemeTypes.EUMETNET_THEME
2484
2515
  })]
2485
- })]
2516
+ }) : null]
2486
2517
  })
2487
2518
  })]
2488
2519
  })
@@ -2493,14 +2524,14 @@ var MenuItemTheme = function MenuItemTheme(_ref) {
2493
2524
  var ToolFooter = function ToolFooter() {
2494
2525
  return jsx(Box, {
2495
2526
  component: "footer",
2527
+ role: "contentinfo",
2496
2528
  sx: {
2497
2529
  boxShadow: 1,
2498
2530
  backgroundColor: 'geowebColors.background.surface',
2499
2531
  textAlign: 'right',
2500
2532
  height: 18,
2501
2533
  zIndex: 1
2502
- },
2503
- role: "contentinfo"
2534
+ }
2504
2535
  });
2505
2536
  };
2506
2537
 
@@ -2583,14 +2614,16 @@ var ToolHeader = function ToolHeader(_ref) {
2583
2614
  "data-testid": "CloseIcon"
2584
2615
  }) : _ref$closeIcon;
2585
2616
  var styles = getStyle(size);
2586
- var columnSizeIcon = title && (leftHeaderComponent || rightHeaderComponent) ? 4 : 1;
2587
- var columnSizeTitle = leftHeaderComponent || rightHeaderComponent ? 4 : 10;
2617
+ var columnSizeIcon = title && (leftHeaderComponent != null ? leftHeaderComponent : rightHeaderComponent) ? 4 : 1;
2618
+ var columnSizeTitle = (leftHeaderComponent != null ? leftHeaderComponent : rightHeaderComponent) ? 4 : 10;
2588
2619
  var columnSizeLeft = title ? columnSizeIcon : 12 - columnSizeIcon;
2589
2620
  var _useTranslation = useTranslation(SHARED_NAMESPACE),
2590
2621
  t = _useTranslation.t;
2591
2622
  return jsx(Box, {
2592
- component: "header",
2623
+ "aria-label": "toolheader",
2593
2624
  className: className,
2625
+ component: "header",
2626
+ role: "heading",
2594
2627
  sx: Object.assign({}, rightHeaderComponent ? headerStyle : {}, {
2595
2628
  boxShadow: 1,
2596
2629
  // elevation_01
@@ -2598,35 +2631,33 @@ var ToolHeader = function ToolHeader(_ref) {
2598
2631
  zIndex: 2,
2599
2632
  cursor: isDraggable ? 'move' : null
2600
2633
  }),
2601
- role: "heading",
2602
- "aria-label": "toolheader",
2603
2634
  children: jsxs(Grid, {
2604
- container: true,
2605
2635
  alignItems: "center",
2636
+ container: true,
2637
+ justifyContent: "space-between",
2606
2638
  sx: {
2607
2639
  padding: styles.padding,
2608
2640
  height: styles.height
2609
2641
  },
2610
- justifyContent: "space-between",
2611
2642
  children: [jsx(Grid, {
2612
2643
  className: "header-left",
2644
+ size: columnSizeLeft,
2613
2645
  sx: {
2614
2646
  paddingRight: 1
2615
2647
  },
2616
- size: columnSizeLeft,
2617
- children: leftHeaderComponent && leftHeaderComponent
2648
+ children: leftHeaderComponent != null ? leftHeaderComponent : null
2618
2649
  }), jsx(Grid, {
2650
+ alignItems: "center",
2619
2651
  className: "header-title",
2620
- size: title ? columnSizeTitle : 0,
2621
2652
  container: true,
2622
2653
  justifyContent: "center",
2623
- alignItems: "center",
2654
+ size: title ? columnSizeTitle : 0,
2624
2655
  sx: {
2625
2656
  minHeight: 12
2626
2657
  },
2627
- children: title && jsx(Typography, {
2628
- variant: "h2",
2658
+ children: title ? jsx(Typography, {
2629
2659
  noWrap: true,
2660
+ role: "heading",
2630
2661
  sx: {
2631
2662
  fontSize: styles.fontSize,
2632
2663
  fontWeight: styles.fontWeight,
@@ -2634,20 +2665,20 @@ var ToolHeader = function ToolHeader(_ref) {
2634
2665
  marginTop: styles.marginTop,
2635
2666
  textAlign: 'center'
2636
2667
  },
2637
- role: "heading",
2668
+ variant: "h2",
2638
2669
  children: title
2639
- })
2670
+ }) : null
2640
2671
  }), jsxs(Grid, {
2641
2672
  className: "header-right",
2642
2673
  container: true,
2643
2674
  justifyContent: "flex-end",
2644
2675
  size: columnSizeIcon,
2645
- children: [rightHeaderComponent && rightHeaderComponent, onClose && jsx(CustomTooltip, {
2646
- title: t('shared-close'),
2676
+ children: [rightHeaderComponent != null ? rightHeaderComponent : null, onClose ? jsx(CustomTooltip, {
2647
2677
  placement: "bottom",
2648
2678
  sx: {
2649
2679
  pointerEvents: 'none'
2650
2680
  },
2681
+ title: t('shared-close'),
2651
2682
  children: jsx(CustomIconButton, {
2652
2683
  "data-testid": "closeBtn",
2653
2684
  onClick: onClose,
@@ -2657,7 +2688,7 @@ var ToolHeader = function ToolHeader(_ref) {
2657
2688
  },
2658
2689
  children: closeIcon
2659
2690
  })
2660
- })]
2691
+ }) : null]
2661
2692
  })]
2662
2693
  })
2663
2694
  });
@@ -2709,23 +2740,23 @@ var ToolContainer = function ToolContainer(_ref) {
2709
2740
  }, props, {
2710
2741
  children: [jsx(ErrorBoundary, {
2711
2742
  children: jsx(ToolHeader, {
2712
- title: title,
2713
- size: size,
2714
- isDraggable: isDraggable,
2715
- onClose: onClose,
2716
2743
  className: headerClassName,
2744
+ closeIcon: closeIcon,
2745
+ dragHandleIcon: dragHandleIcon,
2746
+ isDraggable: isDraggable,
2717
2747
  leftHeaderComponent: leftHeaderComponent,
2748
+ onClose: onClose,
2718
2749
  rightHeaderComponent: rightHeaderComponent,
2719
- dragHandleIcon: dragHandleIcon,
2720
- closeIcon: closeIcon
2750
+ size: size,
2751
+ title: title
2721
2752
  })
2722
2753
  }), jsx(Box, {
2723
- sx: styles$3.content,
2724
2754
  style: {
2725
2755
  maxHeight: maxHeight
2726
2756
  },
2757
+ sx: styles$3.content,
2727
2758
  children: children
2728
- }), isResizable && jsx(ToolFooter, {})]
2759
+ }), isResizable ? jsx(ToolFooter, {}) : null]
2729
2760
  }));
2730
2761
  };
2731
2762
 
@@ -2805,7 +2836,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
2805
2836
  isOpen = _ref.isOpen,
2806
2837
  startSize = _ref.startSize,
2807
2838
  onChangeSize = _ref.onChangeSize;
2808
- var updateDomDirectly = React__default.useCallback(function (position, size) {
2839
+ var updateDomDirectly = React.useCallback(function (position, size) {
2809
2840
  if (nodeRef.current) {
2810
2841
  var element = nodeRef.current;
2811
2842
  var firstChild = element.firstChild;
@@ -2814,16 +2845,16 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
2814
2845
  firstChild.style.height = size.height + "px";
2815
2846
  }
2816
2847
  }, [nodeRef]);
2817
- var getBoundsNode = React__default.useCallback(function () {
2848
+ var getBoundsNode = React.useCallback(function () {
2818
2849
  var _nodeRef$current;
2819
2850
  return bounds === 'parent' ? (_nodeRef$current = nodeRef.current) == null ? void 0 : _nodeRef$current.parentNode : document.querySelector(bounds);
2820
2851
  }, [bounds, nodeRef]);
2821
2852
  // store the position as ref so we can access it in another ref
2822
- var refPosition = React__default.useRef(position);
2853
+ var refPosition = React.useRef(position);
2823
2854
  refPosition.current = position;
2824
- var lastSize = React__default.useRef(startSize);
2855
+ var lastSize = React.useRef(startSize);
2825
2856
  // handle size from outside component
2826
- React__default.useEffect(function () {
2857
+ React.useEffect(function () {
2827
2858
  var boundsNode = getBoundsNode();
2828
2859
  if (boundsNode && lastSize.current.width && lastSize.current.height && (lastSize.current.width !== startSize.width || lastSize.current.height !== startSize.height) && typeof startSize.height === 'number' && typeof startSize.width === 'number' && nodeRef.current) {
2829
2860
  var _getNewPositionSize = getNewPositionSize(nodeRef.current, boundsNode, isRightAligned, refPosition.current, startSize),
@@ -2837,7 +2868,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
2837
2868
  }
2838
2869
  }, [startSize, isRightAligned, lastSize, getBoundsNode, nodeRef, updateDomDirectly, onChangeSize]);
2839
2870
  // observe parent div dimensions
2840
- var resizeObserverRef = React__default.useRef(new ResizeObserver(function (entry) {
2871
+ var resizeObserverRef = React.useRef(new ResizeObserver(function (entry) {
2841
2872
  var boundsTarget = entry[0].target;
2842
2873
  var element = nodeRef.current;
2843
2874
  var boundsBbox = boundsTarget.getBoundingClientRect();
@@ -2849,7 +2880,7 @@ var useHandleSizeFromOutsideComponent = function useHandleSizeFromOutsideCompone
2849
2880
  newSize = _getNewPositionSize2.size;
2850
2881
  updateDomDirectly(newPosition, newSize);
2851
2882
  }));
2852
- React__default.useLayoutEffect(function () {
2883
+ React.useLayoutEffect(function () {
2853
2884
  var boundsNode = getBoundsNode();
2854
2885
  if (!boundsNode || !isOpen) {
2855
2886
  return function () {};
@@ -2968,32 +2999,32 @@ var DraggableComponent = function DraggableComponent(_ref) {
2968
2999
  props = _objectWithoutPropertiesLoose(_ref, _excluded$7);
2969
3000
  var zIndex = (source === 'app' ? BASE_Z_INDEX : 1000) + order;
2970
3001
  var elevation = BASE_ELEVATION + order;
2971
- var nodeRef = React__default.useRef(null);
2972
- var _React$useState = React__default.useState({
3002
+ var nodeRef = React.useRef(null);
3003
+ var _React$useState = React.useState({
2973
3004
  x: 0,
2974
3005
  y: 0
2975
3006
  }),
2976
3007
  position = _React$useState[0],
2977
3008
  setPosition = _React$useState[1];
2978
- var _React$useState2 = React__default.useState(startSize),
3009
+ var _React$useState2 = React.useState(startSize),
2979
3010
  size = _React$useState2[0],
2980
3011
  setSize = _React$useState2[1];
2981
- var _React$useState3 = React__default.useState(false),
3012
+ var _React$useState3 = React.useState(false),
2982
3013
  isDragging = _React$useState3[0],
2983
3014
  setIsDragging = _React$useState3[1];
2984
3015
  var isRightAligned = startPosition && startPosition.right !== null && startPosition.right !== undefined;
2985
- var onStopDrag = React__default.useCallback(function (_event, position) {
3016
+ var onStopDrag = React.useCallback(function (_event, position) {
2986
3017
  setPosition(position);
2987
3018
  onDragEnd(position, size);
2988
3019
  }, [setPosition, onDragEnd, size]);
2989
- var _React$useState4 = React__default.useState(defaultInitialMaxHeight),
3020
+ var _React$useState4 = React.useState(defaultInitialMaxHeight),
2990
3021
  initialMaxHeight = _React$useState4[0],
2991
3022
  setInitialMaxHeight = _React$useState4[1];
2992
3023
  var onStartResize = function onStartResize() {
2993
3024
  setIsDragging(true);
2994
3025
  setInitialMaxHeight('initial');
2995
3026
  };
2996
- var onResize = React__default.useCallback(function (_event, handle, node, delta) {
3027
+ var onResize = React.useCallback(function (_event, handle, node, delta) {
2997
3028
  var _node$getBoundingClie = node.getBoundingClientRect(),
2998
3029
  width = _node$getBoundingClie.width,
2999
3030
  height = _node$getBoundingClie.height;
@@ -3010,8 +3041,8 @@ var DraggableComponent = function DraggableComponent(_ref) {
3010
3041
  setPosition(calculateNewPosition(position, isRightAligned, direction, delta));
3011
3042
  onResizeStop(_event, direction, node, delta);
3012
3043
  };
3013
- var toolcontainerId = React__default.useRef(Date.now().toString()).current;
3014
- var headerClassName = "header-" + (className || toolcontainerId);
3044
+ var toolcontainerId = React.useRef(Date.now().toString()).current;
3045
+ var headerClassName = "header-" + (className != null ? className : toolcontainerId);
3015
3046
  useHandleSizeFromOutsideComponent({
3016
3047
  nodeRef: nodeRef,
3017
3048
  bounds: bounds,
@@ -3024,7 +3055,7 @@ var DraggableComponent = function DraggableComponent(_ref) {
3024
3055
  }
3025
3056
  });
3026
3057
  return isOpen ? jsxs(Fragment, {
3027
- children: [isDragging && jsx(Box, {
3058
+ children: [isDragging ? jsx(Box, {
3028
3059
  "data-testid": "dragging-overlay",
3029
3060
  sx: {
3030
3061
  top: 0,
@@ -3034,51 +3065,51 @@ var DraggableComponent = function DraggableComponent(_ref) {
3034
3065
  position: 'absolute',
3035
3066
  zIndex: 999
3036
3067
  }
3037
- }), jsx(DraggableComponent$1, {
3038
- nodeRef: nodeRef,
3068
+ }) : null, jsx(DraggableComponent$1, {
3039
3069
  bounds: bounds,
3040
3070
  cancel: cancel,
3041
- position: position,
3042
- onStop: onStopDrag,
3043
3071
  handle: "." + headerClassName,
3072
+ nodeRef: nodeRef,
3044
3073
  onMouseDown: onMouseDown,
3074
+ onStop: onStopDrag,
3075
+ position: position,
3045
3076
  setIsDragging: setIsDragging,
3046
3077
  children: jsx(Box, {
3047
- tabIndex: -1,
3078
+ "aria-label": title,
3079
+ className: "toolContainerDraggable",
3080
+ ref: nodeRef,
3081
+ role: "dialog",
3048
3082
  sx: Object.assign({
3049
3083
  position: 'absolute',
3050
3084
  pointerEvents: 'all',
3051
3085
  zIndex: zIndex
3052
- }, startPosition, sx, {
3086
+ }, startPosition, Array.isArray(sx) ? Object.assign.apply(Object, [{}].concat(sx)) : sx, {
3053
3087
  '&:hover .resizableHandle': {
3054
3088
  display: 'inline'
3055
3089
  }
3056
3090
  }),
3057
- ref: nodeRef,
3058
- className: "toolContainerDraggable",
3059
- role: "dialog",
3060
- "aria-label": title,
3091
+ tabIndex: -1,
3061
3092
  children: jsx(ResizeComponent, Object.assign({}, props, {
3062
- size: size,
3063
- setSize: setSize,
3093
+ nodeRef: nodeRef,
3094
+ onResize: onResize,
3064
3095
  onResizeStart: onStartResize,
3065
3096
  onResizeStop: onStopResize,
3066
- onResize: onResize,
3067
- nodeRef: nodeRef,
3068
- children: jsx(ToolContainer, {
3069
- maxHeight: initialMaxHeight,
3070
- onClose: onClose,
3071
- title: title,
3072
- size: headerSize,
3073
- isDraggable: true,
3074
- isResizable: true,
3097
+ setSize: setSize,
3098
+ size: size,
3099
+ children: jsx(ToolContainer, {
3100
+ className: className,
3101
+ closeIcon: closeIcon,
3102
+ dragHandleIcon: dragHandleIcon,
3075
3103
  elevation: elevation,
3076
3104
  headerClassName: headerClassName,
3105
+ isDraggable: true,
3106
+ isResizable: true,
3077
3107
  leftHeaderComponent: leftHeaderComponent,
3108
+ maxHeight: initialMaxHeight,
3109
+ onClose: onClose,
3078
3110
  rightHeaderComponent: rightHeaderComponent,
3079
- dragHandleIcon: dragHandleIcon,
3080
- closeIcon: closeIcon,
3081
- className: className,
3111
+ size: headerSize,
3112
+ title: title,
3082
3113
  children: children
3083
3114
  })
3084
3115
  }))
@@ -3118,32 +3149,32 @@ var ShortCutSegment = function ShortCutSegment(_ref) {
3118
3149
  children = _ref.children;
3119
3150
  if (type === 'divider') {
3120
3151
  return jsx(Typography, {
3121
- sx: styles$2.divider,
3122
- "data-testid": "segment-divider",
3123
3152
  component: "span",
3153
+ "data-testid": "segment-divider",
3154
+ sx: styles$2.divider,
3124
3155
  children: children
3125
3156
  });
3126
3157
  }
3127
3158
  if (type === 'icon') {
3128
3159
  return jsx(Typography, {
3129
- sx: styles$2.icon,
3130
- "data-testid": "segment-icon",
3131
3160
  component: "span",
3161
+ "data-testid": "segment-icon",
3162
+ sx: styles$2.icon,
3132
3163
  children: children
3133
3164
  });
3134
3165
  }
3135
3166
  if (type === 'connect') {
3136
3167
  return jsx(Typography, {
3137
- sx: styles$2.connect,
3138
- "data-testid": "segment-connect",
3139
3168
  component: "span",
3169
+ "data-testid": "segment-connect",
3170
+ sx: styles$2.connect,
3140
3171
  children: children
3141
3172
  });
3142
3173
  }
3143
3174
  return jsx(Typography, {
3144
- sx: segmentStyle,
3145
- "data-testid": "segment-text",
3146
3175
  component: "span",
3176
+ "data-testid": "segment-text",
3177
+ sx: segmentStyle,
3147
3178
  children: children
3148
3179
  });
3149
3180
  };
@@ -3472,15 +3503,15 @@ var ShortcutList = function ShortcutList(_ref) {
3472
3503
  "data-testid": "list-" + platform,
3473
3504
  children: shortcuts.map(function (shortcut, index) {
3474
3505
  return jsx(ListItem, {
3506
+ divider: index !== shortcuts.length - 1,
3475
3507
  sx: {
3476
3508
  minHeight: 56
3477
3509
  },
3478
- divider: index !== shortcuts.length - 1,
3479
3510
  children: jsxs(Grid, {
3511
+ alignItems: "center",
3480
3512
  container: true,
3481
3513
  direction: "row",
3482
3514
  justifyContent: "space-between",
3483
- alignItems: "center",
3484
3515
  size: "grow",
3485
3516
  children: [jsx(Grid, {
3486
3517
  sx: {
@@ -3509,10 +3540,10 @@ var TabPanel = function TabPanel(_ref) {
3509
3540
  value = _ref.value,
3510
3541
  index = _ref.index;
3511
3542
  return jsx("div", {
3512
- role: "tabpanel",
3543
+ "aria-labelledby": "tab-" + index,
3513
3544
  hidden: value !== index,
3514
3545
  id: "tabpanel-" + index,
3515
- "aria-labelledby": "tab-" + index,
3546
+ role: "tabpanel",
3516
3547
  children: value === index && children
3517
3548
  });
3518
3549
  };
@@ -3526,32 +3557,32 @@ var styles$1 = {
3526
3557
  }
3527
3558
  };
3528
3559
  var CheatSheet = function CheatSheet() {
3529
- var _React$useState = React__default.useState(0),
3560
+ var _React$useState = React.useState(0),
3530
3561
  activeTab = _React$useState[0],
3531
- onChangeActiveTab = _React$useState[1];
3562
+ setActiveTab = _React$useState[1];
3532
3563
  var onChangeTab = function onChangeTab(_event, newValue) {
3533
- onChangeActiveTab(newValue);
3564
+ setActiveTab(newValue);
3534
3565
  };
3535
3566
  return jsxs(Box, {
3536
3567
  sx: styles$1.container,
3537
3568
  children: [jsxs(Tabs, {
3538
- value: activeTab,
3539
- onChange: onChangeTab,
3540
3569
  "aria-label": "platform",
3570
+ onChange: onChangeTab,
3571
+ value: activeTab,
3541
3572
  children: [jsx(Tab, {
3542
- sx: styles$1.tab,
3543
- label: "Windows"
3573
+ label: "Windows",
3574
+ sx: styles$1.tab
3544
3575
  }), jsx(Tab, {
3545
- sx: styles$1.tab,
3546
- label: "Mac"
3576
+ label: "Mac",
3577
+ sx: styles$1.tab
3547
3578
  })]
3548
3579
  }), jsx(TabPanel, {
3549
- value: activeTab,
3550
3580
  index: 0,
3581
+ value: activeTab,
3551
3582
  children: jsx(ShortcutList, {})
3552
3583
  }), jsx(TabPanel, {
3553
- value: activeTab,
3554
3584
  index: 1,
3585
+ value: activeTab,
3555
3586
  children: jsx(ShortcutList, {
3556
3587
  platform: "mac"
3557
3588
  })
@@ -3560,7 +3591,7 @@ var CheatSheet = function CheatSheet() {
3560
3591
  };
3561
3592
 
3562
3593
  var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
3563
- var _React$useState = React__default.useState(false),
3594
+ var _React$useState = React.useState(false),
3564
3595
  open = _React$useState[0],
3565
3596
  setOpen = _React$useState[1];
3566
3597
  var onClose = function onClose() {
@@ -3574,8 +3605,8 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
3574
3605
  return jsxs(Fragment, {
3575
3606
  children: [jsx(MenuItem, {
3576
3607
  "data-testid": "cheatsheet-btn",
3577
- onClick: onOpen,
3578
3608
  divider: true,
3609
+ onClick: onOpen,
3579
3610
  children: jsx(Grid, {
3580
3611
  container: true,
3581
3612
  children: jsx(Grid, {
@@ -3589,15 +3620,15 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
3589
3620
  zIndex: 1
3590
3621
  },
3591
3622
  children: jsx(DraggableComponent, {
3623
+ bounds: "parent",
3624
+ isOpen: true,
3625
+ minHeight: 300,
3626
+ minWidth: 500,
3627
+ onClose: onClose,
3592
3628
  startSize: {
3593
3629
  width: 700
3594
3630
  },
3595
- minHeight: 300,
3596
- minWidth: 500,
3597
3631
  title: t('shared-cheat-sheet'),
3598
- isOpen: true,
3599
- onClose: onClose,
3600
- bounds: "parent",
3601
3632
  children: jsx(CheatSheet, {})
3602
3633
  })
3603
3634
  })]
@@ -3607,13 +3638,13 @@ var UserMenuItemCheatSheet = function UserMenuItemCheatSheet() {
3607
3638
  var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3608
3639
  var recordButtonEnabled = _ref.recordButtonEnabled,
3609
3640
  setRecordButtonEnabled = _ref.setRecordButtonEnabled;
3610
- var _React$useState = React__default.useState(false),
3641
+ var _React$useState = React.useState(false),
3611
3642
  open = _React$useState[0],
3612
3643
  setOpen = _React$useState[1];
3613
- var _React$useState2 = React__default.useState(false),
3644
+ var _React$useState2 = React.useState(false),
3614
3645
  canvasIntegrationEnabled = _React$useState2[0],
3615
3646
  setCanvasIntegrationEnabled = _React$useState2[1];
3616
- var _React$useState3 = React__default.useState(false),
3647
+ var _React$useState3 = React.useState(false),
3617
3648
  htmlRecordingEnabled = _React$useState3[0],
3618
3649
  setHTMLRecordingEnabled = _React$useState3[1];
3619
3650
  var _useTranslation = useTranslation(SHARED_NAMESPACE),
@@ -3648,11 +3679,11 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3648
3679
  case 7:
3649
3680
  _yield$import = _context.sent;
3650
3681
  replayIntegration = _yield$import.replayIntegration;
3651
- Sentry.addIntegration(replayIntegration({
3682
+ addIntegration(replayIntegration({
3652
3683
  maskAllText: false,
3653
3684
  blockAllMedia: false
3654
3685
  }));
3655
- setRecordButtonEnabled && setRecordButtonEnabled(!recordButtonEnabled);
3686
+ setRecordButtonEnabled == null || setRecordButtonEnabled(!recordButtonEnabled);
3656
3687
  setHTMLRecordingEnabled(true);
3657
3688
  _context.next = 17;
3658
3689
  break;
@@ -3690,13 +3721,13 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3690
3721
  _yield$import2 = _context2.sent;
3691
3722
  replayIntegration = _yield$import2.replayIntegration;
3692
3723
  replayCanvasIntegration = _yield$import2.replayCanvasIntegration;
3693
- Sentry.addIntegration(replayIntegration({
3724
+ addIntegration(replayIntegration({
3694
3725
  maskAllText: false,
3695
3726
  blockAllMedia: false
3696
3727
  }));
3697
- Sentry.addIntegration(replayCanvasIntegration());
3728
+ addIntegration(replayCanvasIntegration());
3698
3729
  setCanvasIntegrationEnabled(!canvasIntegrationEnabled);
3699
- setRecordButtonEnabled && setRecordButtonEnabled(!recordButtonEnabled);
3730
+ setRecordButtonEnabled == null || setRecordButtonEnabled(!recordButtonEnabled);
3700
3731
  _context2.next = 17;
3701
3732
  break;
3702
3733
  case 14:
@@ -3717,8 +3748,8 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3717
3748
  return jsxs(ErrorBoundary, {
3718
3749
  children: [jsx(MenuItem, {
3719
3750
  "data-testid": "sentryRecording-btn",
3720
- onClick: onOpen,
3721
3751
  divider: true,
3752
+ onClick: onOpen,
3722
3753
  children: jsx(Grid, {
3723
3754
  container: true,
3724
3755
  children: jsx(Grid, {
@@ -3732,15 +3763,15 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3732
3763
  zIndex: 1
3733
3764
  },
3734
3765
  children: jsx(DraggableComponent, {
3766
+ bounds: "parent",
3767
+ isOpen: true,
3768
+ minHeight: 300,
3769
+ minWidth: 500,
3770
+ onClose: onClose,
3735
3771
  startSize: {
3736
3772
  width: 700
3737
3773
  },
3738
- minHeight: 300,
3739
- minWidth: 500,
3740
3774
  title: t('shared-sentry-recording'),
3741
- isOpen: true,
3742
- onClose: onClose,
3743
- bounds: "parent",
3744
3775
  children: jsxs(Grid, {
3745
3776
  container: true,
3746
3777
  spacing: 4,
@@ -3767,25 +3798,25 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3767
3798
  children: t('shared-sentry-enable-message')
3768
3799
  })
3769
3800
  }), jsxs(Grid, {
3770
- container: true,
3771
3801
  alignItems: "center",
3802
+ container: true,
3772
3803
  direction: "column",
3773
3804
  children: [jsx(Switch, {
3774
- checked: recordButtonEnabled && !canvasIntegrationEnabled,
3775
- onChange: enableHTMLRecording,
3776
- disabled: htmlRecordingEnabled
3805
+ checked: recordButtonEnabled ? !canvasIntegrationEnabled : undefined,
3806
+ disabled: htmlRecordingEnabled,
3807
+ onChange: enableHTMLRecording
3777
3808
  }), recordButtonEnabled && !canvasIntegrationEnabled ? jsxs(Typography, {
3778
3809
  children: [" ", t('shared-sentry-disable')]
3779
3810
  }) : jsxs(Typography, {
3780
3811
  children: [" ", t('shared-sentry-enable')]
3781
3812
  })]
3782
3813
  }), jsxs(Grid, {
3783
- container: true,
3784
3814
  alignItems: "center",
3815
+ container: true,
3785
3816
  direction: "column",
3786
3817
  children: [jsx(Switch, {
3787
- disabled: true,
3788
3818
  checked: canvasIntegrationEnabled,
3819
+ disabled: true,
3789
3820
  onChange: enableHTMLAndCanvasRecording
3790
3821
  }), canvasIntegrationEnabled ? jsx(Typography, {
3791
3822
  children: t('shared-sentry-disable-both')
@@ -3796,10 +3827,10 @@ var UserMenuItemSentryRecording = function UserMenuItemSentryRecording(_ref) {
3796
3827
  },
3797
3828
  children: t('shared-sentry-enable-both')
3798
3829
  }), jsxs(Typography, {
3799
- textAlign: "center",
3800
3830
  sx: {
3801
3831
  color: 'gray'
3802
3832
  },
3833
+ textAlign: "center",
3803
3834
  children: ["(", t('shared-sentry-cors-wait'), ")"]
3804
3835
  })]
3805
3836
  })]
@@ -3841,14 +3872,14 @@ var useUserMenu = function useUserMenu(open) {
3841
3872
  if (open === void 0) {
3842
3873
  open = false;
3843
3874
  }
3844
- var _React$useState = React__default.useState(open),
3875
+ var _React$useState = React.useState(open),
3845
3876
  isOpen = _React$useState[0],
3846
- setOpen = _React$useState[1];
3877
+ setIsOpen = _React$useState[1];
3847
3878
  var onClose = function onClose() {
3848
- return setOpen(false);
3879
+ return setIsOpen(false);
3849
3880
  };
3850
3881
  var onToggle = function onToggle() {
3851
- return setOpen(!isOpen);
3882
+ return setIsOpen(!isOpen);
3852
3883
  };
3853
3884
  return {
3854
3885
  isOpen: isOpen,
@@ -3978,10 +4009,8 @@ var CustomSlider = function CustomSlider(_ref) {
3978
4009
  }, []);
3979
4010
  var mergedStyles = merge(extraStyles, sliderStyle);
3980
4011
  return jsx(Slider, Object.assign({
3981
- sx: mergedStyles,
3982
- ref: element,
3983
- value: value,
3984
4012
  orientation: orientation,
4013
+ ref: element,
3985
4014
  role: "slider",
3986
4015
  slotProps: {
3987
4016
  thumb: {
@@ -3990,7 +4019,9 @@ var CustomSlider = function CustomSlider(_ref) {
3990
4019
  mark: {
3991
4020
  role: 'listitem'
3992
4021
  }
3993
- }
4022
+ },
4023
+ sx: mergedStyles,
4024
+ value: value
3994
4025
  }, props));
3995
4026
  };
3996
4027
 
@@ -4004,8 +4035,8 @@ var CustomToggleButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
4004
4035
  value = _ref$value === void 0 ? 0 : _ref$value,
4005
4036
  props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
4006
4037
  return jsx(ToggleButton, Object.assign({
4007
- ref: ref,
4008
4038
  className: variant + " " + className,
4039
+ ref: ref,
4009
4040
  value: value
4010
4041
  }, props));
4011
4042
  });
@@ -4076,23 +4107,23 @@ var TooltipSelect = function TooltipSelect(_ref) {
4076
4107
  onWheel: onWheel
4077
4108
  });
4078
4109
  return jsx(CustomTooltip, {
4079
- title: tooltip,
4080
- placement: "top",
4081
4110
  open: tooltipOpen,
4111
+ placement: "top",
4112
+ title: tooltip,
4082
4113
  children: jsx(StyledSelect, Object.assign({
4083
- ref: scrollInIsolationRef,
4084
- variant: variant,
4114
+ additionalStyling: additionalStyling,
4085
4115
  disableUnderline: true,
4086
- onOpen: onOpen,
4116
+ hasBackgroundColor: hasBackgroundColor,
4117
+ isEnabled: isEnabled,
4118
+ onBlur: onBlur,
4087
4119
  onClose: onClose,
4120
+ onFocus: onFocus,
4088
4121
  onMouseEnter: onMouseEnter,
4089
4122
  onMouseLeave: onMouseLeave,
4090
- onFocus: onFocus,
4091
- onBlur: onBlur,
4092
- isEnabled: isEnabled,
4093
- hasBackgroundColor: hasBackgroundColor,
4094
- additionalStyling: additionalStyling,
4095
- skipLocalStyling: skipLocalStyling
4123
+ onOpen: onOpen,
4124
+ ref: scrollInIsolationRef,
4125
+ skipLocalStyling: skipLocalStyling,
4126
+ variant: variant
4096
4127
  }, props))
4097
4128
  });
4098
4129
  };
@@ -4130,8 +4161,8 @@ var StyledSelect = styled(/*#__PURE__*/React.forwardRef(function (_ref3, ref) {
4130
4161
  }
4131
4162
  }
4132
4163
  },
4133
- sx: additionalStyling,
4134
- ref: ref
4164
+ ref: ref,
4165
+ sx: additionalStyling
4135
4166
  }));
4136
4167
  }))(function (_ref4) {
4137
4168
  var theme = _ref4.theme;
@@ -4257,11 +4288,11 @@ var CustomAccordion = function CustomAccordion(_ref) {
4257
4288
  var iconColor = theme.palette.geowebColors.buttons.icon["default"].color;
4258
4289
  return jsxs(Accordion, Object.assign({}, props, {
4259
4290
  defaultExpanded: defaultExpanded,
4291
+ disableGutters: disableGutters,
4260
4292
  elevation: expanded ? expandedElevation : collapsedElevation,
4261
4293
  onChange: function onChange(_event, expanded) {
4262
4294
  return setExpanded(expanded);
4263
4295
  },
4264
- disableGutters: disableGutters,
4265
4296
  slotProps: {
4266
4297
  transition: {
4267
4298
  timeout: transitionDuration
@@ -4346,8 +4377,8 @@ var SearchHighlight = function SearchHighlight(_ref) {
4346
4377
  return part.toLocaleLowerCase().includes(search);
4347
4378
  })) {
4348
4379
  return jsx("mark", {
4349
- style: highlightStyle,
4350
4380
  "data-testid": "mark",
4381
+ style: highlightStyle,
4351
4382
  children: part
4352
4383
  }, key);
4353
4384
  }
@@ -4376,8 +4407,8 @@ var SwitchButton = function SwitchButton(_ref) {
4376
4407
  tooltip = _ref$tooltip === void 0 ? 'Switch mode' : _ref$tooltip,
4377
4408
  props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
4378
4409
  return jsx(CustomTooltip, {
4379
- title: tooltip,
4380
4410
  className: "switch-button",
4411
+ title: tooltip,
4381
4412
  children: jsxs("span", {
4382
4413
  role: "button",
4383
4414
  children: [jsx(FormLabel, {
@@ -4401,9 +4432,9 @@ var ClearButton$1 = function ClearButton(_ref) {
4401
4432
  var _useSharedTranslation = useSharedTranslation(),
4402
4433
  t = _useSharedTranslation.t;
4403
4434
  return jsx(CustomIconButton, {
4404
- tooltipTitle: t('shared-clear'),
4405
- sx: buttonStyle,
4406
4435
  onClick: onClick,
4436
+ sx: buttonStyle,
4437
+ tooltipTitle: t('shared-clear'),
4407
4438
  children: jsx(Clear, {})
4408
4439
  });
4409
4440
  };
@@ -4432,10 +4463,10 @@ var SearchFieldButton = function SearchFieldButton(_ref2) {
4432
4463
  }
4433
4464
  })
4434
4465
  }), jsx(Button, {
4435
- variant: "tertiary",
4436
4466
  onClick: function onClick() {
4437
4467
  return setPopupIsOpen(true);
4438
4468
  },
4469
+ variant: "tertiary",
4439
4470
  children: t('shared-save')
4440
4471
  })]
4441
4472
  });
@@ -4448,8 +4479,8 @@ var SearchFieldButton = function SearchFieldButton(_ref2) {
4448
4479
  });
4449
4480
  }
4450
4481
  return jsx(CustomIconButton, {
4451
- tooltipTitle: t('shared-search'),
4452
4482
  sx: buttonStyle,
4483
+ tooltipTitle: t('shared-search'),
4453
4484
  children: jsx(Search, {})
4454
4485
  });
4455
4486
  };
@@ -4489,7 +4520,7 @@ var SearchField$1 = function SearchField(_ref) {
4489
4520
  setUrlIsValid = _React$useState2[1];
4490
4521
  var _useTranslation = useTranslation(SHARED_NAMESPACE),
4491
4522
  t = _useTranslation.t;
4492
- var translatedLabel = label || (onOpenServicePopup ? t('shared-search-services') : t('shared-search'));
4523
+ var translatedLabel = label != null ? label : onOpenServicePopup ? t('shared-search-services') : t('shared-search');
4493
4524
  // eslint-disable-next-line react-hooks/exhaustive-deps
4494
4525
  var setSearchFilterDebounced = React.useCallback(debounce(setSearchFilter, 300), []);
4495
4526
  var handleChange = function handleChange(text) {
@@ -4529,34 +4560,34 @@ var SearchField$1 = function SearchField(_ref) {
4529
4560
  // eslint-disable-next-line react-hooks/exhaustive-deps
4530
4561
  }, [searchFilter]);
4531
4562
  return jsx(TextField, {
4532
- variant: "filled",
4563
+ autoFocus: true,
4564
+ fullWidth: true,
4533
4565
  label: translatedLabel,
4534
- value: localSearchString,
4535
4566
  onChange: function onChange(e) {
4536
4567
  handleChange(e.target.value);
4537
4568
  },
4538
- autoFocus: true,
4539
- fullWidth: true,
4540
4569
  slotProps: {
4541
4570
  input: {
4542
4571
  endAdornment: jsx(InputAdornment, {
4543
4572
  position: "end",
4544
4573
  children: jsx(SearchFieldButton, {
4545
- setPopupIsOpen: onOpenServicePopup ? function () {
4546
- onOpenServicePopup(localSearchString);
4547
- setLocalSearchString('');
4548
- } : undefined,
4549
4574
  localSearchString: localSearchString,
4550
4575
  onClickClear: function onClickClear() {
4551
4576
  setLocalSearchString('');
4552
4577
  setSearchFilterDebounced('');
4553
4578
  setUrlIsValid(false);
4554
- }
4579
+ },
4580
+ setPopupIsOpen: onOpenServicePopup ? function () {
4581
+ onOpenServicePopup(localSearchString);
4582
+ setLocalSearchString('');
4583
+ } : undefined
4555
4584
  })
4556
4585
  })
4557
4586
  }
4558
4587
  },
4559
- sx: small ? stylesSmall : {}
4588
+ sx: small ? stylesSmall : {},
4589
+ value: localSearchString,
4590
+ variant: "filled"
4560
4591
  });
4561
4592
  };
4562
4593
 
@@ -4584,15 +4615,15 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
4584
4615
  justifyContent: 'flex-end'
4585
4616
  },
4586
4617
  children: [!hideLabel && jsx(Typography, {
4618
+ "data-testid": dataTestId,
4587
4619
  sx: {
4588
4620
  color: 'geowebColors.captions.captionStatus.rgba',
4589
4621
  fontSize: '10px',
4590
4622
  lineHeight: '1.6',
4591
4623
  letterSpacing: '0.33px'
4592
4624
  },
4593
- "data-testid": dataTestId,
4594
4625
  children: getLastUpdateTitle(lastUpdateTime, t)
4595
- }), showRefreshButton && jsx(CustomIconButton, {
4626
+ }), showRefreshButton ? jsx(CustomIconButton, {
4596
4627
  "data-testid": "refresh-button",
4597
4628
  onClick: onPressRefresh,
4598
4629
  sx: {
@@ -4605,7 +4636,7 @@ var LastUpdateTime = function LastUpdateTime(_ref) {
4605
4636
  tooltipTitle: t('shared-click-to-refresh'),
4606
4637
  variant: "tool",
4607
4638
  children: jsx(Cached, {})
4608
- })]
4639
+ }) : null]
4609
4640
  });
4610
4641
  };
4611
4642
 
@@ -4641,14 +4672,15 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4641
4672
  _this._documentKeyDown = _this._documentKeyDown.bind(_this);
4642
4673
  _this._isFocussed = false;
4643
4674
  _this.canvas = null;
4644
- _this.canvascontaineroutside = /*#__PURE__*/React__default.createRef();
4645
- _this.canvascontainer = /*#__PURE__*/React__default.createRef();
4675
+ _this.canvascontaineroutside = /*#__PURE__*/React.createRef();
4676
+ _this.canvascontainer = /*#__PURE__*/React.createRef();
4646
4677
  return _this;
4647
4678
  }
4648
4679
  _inheritsLoose(CanvasComponent, _Component);
4649
4680
  var _proto = CanvasComponent.prototype;
4650
4681
  _proto.componentDidMount = function componentDidMount() {
4651
- var _this2 = this;
4682
+ var _this$canvascontainer,
4683
+ _this2 = this;
4652
4684
  this.mounted = true;
4653
4685
  if (this.canvas) {
4654
4686
  this.canvas.addEventListener('mousemove', this.handleMouseMoveEvent);
@@ -4670,7 +4702,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4670
4702
  window.addEventListener('keyup', this.onKeyUp);
4671
4703
  }
4672
4704
  window.addEventListener('resize', this._handleWindowResize);
4673
- if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
4705
+ if ((_this$canvascontainer = this.canvascontaineroutside) != null && _this$canvascontainer.current && onKeyUp) {
4674
4706
  this.canvascontaineroutside.current.focus();
4675
4707
  }
4676
4708
  this.timer = setInterval(function () {
@@ -4741,16 +4773,19 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4741
4773
  onTouchEnd();
4742
4774
  };
4743
4775
  _proto.handleTouchMoveEvent = function handleTouchMoveEvent(event) {
4776
+ var _event$touches, _touch$target, _target$offsetLeft;
4744
4777
  var _this$props3 = this.props,
4745
4778
  onTouchMove = _this$props3.onTouchMove,
4746
4779
  onCanvasClick = _this$props3.onCanvasClick;
4747
- var touches = event && event.touches && event.touches[0];
4748
- if (touches && touches.clientX && touches.clientY) {
4749
- var x2 = event.touches[0].clientX - event.touches[0].target.offsetLeft;
4750
- var y2 = event.touches[0].clientY;
4751
- onCanvasClick(x2, y2, this.currentWidth, this.currentHeight);
4780
+ var touch = (_event$touches = event.touches) == null ? void 0 : _event$touches[0];
4781
+ var target = (_touch$target = touch == null ? void 0 : touch.target) != null ? _touch$target : null;
4782
+ // Use ?? so 0 is allowed, and optional chaining for safety
4783
+ var x = touch ? touch.clientX - ((_target$offsetLeft = target == null ? void 0 : target.offsetLeft) != null ? _target$offsetLeft : 0) : undefined;
4784
+ var y = touch == null ? void 0 : touch.clientY;
4785
+ if (x != null && y != null) {
4786
+ onCanvasClick == null || onCanvasClick(x, y, this.currentWidth, this.currentHeight);
4752
4787
  }
4753
- onTouchMove(event, this.currentWidth);
4788
+ onTouchMove == null || onTouchMove(event, this.currentWidth);
4754
4789
  };
4755
4790
  _proto.handleClickEvent = function handleClickEvent(event) {
4756
4791
  var onCanvasClick = this.props.onCanvasClick;
@@ -4783,11 +4818,12 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4783
4818
  }
4784
4819
  };
4785
4820
  _proto.onKeyUp = function onKeyUp(event) {
4821
+ var _this$canvascontainer2;
4786
4822
  var onKeyUp = this.props.onKeyUp;
4787
4823
  if (onKeyUp) {
4788
4824
  onKeyUp(event);
4789
4825
  }
4790
- if (this.canvascontaineroutside && this.canvascontaineroutside.current && onKeyUp) {
4826
+ if ((_this$canvascontainer2 = this.canvascontaineroutside) != null && _this$canvascontainer2.current && onKeyUp) {
4791
4827
  if (event.code === 'Escape') {
4792
4828
  this.canvascontaineroutside.current.focus();
4793
4829
  }
@@ -4806,7 +4842,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4806
4842
  };
4807
4843
  _proto.startLoop = function startLoop() {
4808
4844
  var onRenderCanvas = this.props.onRenderCanvas;
4809
- if (this.mounted === false || this.loopHasStarted === false) {
4845
+ if (!this.mounted || !this.loopHasStarted) {
4810
4846
  return;
4811
4847
  }
4812
4848
  if (this.canvas) {
@@ -4834,7 +4870,7 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4834
4870
  if (loop !== true) {
4835
4871
  this.loopHasStarted = false;
4836
4872
  onRenderCanvas(this.ctx, this.currentWidth, this.currentHeight, this.canvas);
4837
- } else if (this.loopHasStarted === false) {
4873
+ } else if (!this.loopHasStarted) {
4838
4874
  this.loopHasStarted = true;
4839
4875
  this.startLoop();
4840
4876
  }
@@ -4842,14 +4878,14 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4842
4878
  _proto.resize = function resize() {
4843
4879
  var canvascontainer = this.canvascontainer,
4844
4880
  resizeCallback = this.props.resizeCallback;
4845
- if (canvascontainer && canvascontainer.current) {
4881
+ if (canvascontainer != null && canvascontainer.current) {
4846
4882
  var newWidth = canvascontainer.current.clientWidth;
4847
4883
  var newHeight = canvascontainer.current.clientHeight;
4848
4884
  if (newWidth !== undefined && newHeight !== undefined && (this.currentWidth !== newWidth || this.currentHeight !== newHeight)) {
4849
4885
  this.currentWidth = newWidth;
4850
4886
  this.currentHeight = newHeight;
4851
4887
  this.updateCanvas();
4852
- resizeCallback && resizeCallback(newWidth);
4888
+ resizeCallback == null || resizeCallback(newWidth);
4853
4889
  }
4854
4890
  }
4855
4891
  };
@@ -4858,11 +4894,10 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4858
4894
  this.updateCanvas();
4859
4895
  this._handleWindowResize();
4860
4896
  return jsx("div", {
4861
- role: "button",
4862
- ref: this.canvascontaineroutside,
4863
- tabIndex: 0,
4864
- onFocus: this.onFocus,
4865
4897
  onBlur: this.onBlur,
4898
+ onFocus: this.onFocus,
4899
+ ref: this.canvascontaineroutside,
4900
+ role: "button",
4866
4901
  style: {
4867
4902
  height: '100%',
4868
4903
  width: '100%',
@@ -4870,7 +4905,9 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4870
4905
  display: 'block',
4871
4906
  overflow: 'hidden'
4872
4907
  },
4908
+ tabIndex: 0,
4873
4909
  children: jsx("div", {
4910
+ "data-testid": "canvas-container",
4874
4911
  ref: this.canvascontainer,
4875
4912
  style: {
4876
4913
  minWidth: 'inherit',
@@ -4881,15 +4918,14 @@ var CanvasComponent = /*#__PURE__*/function (_Component) {
4881
4918
  display: 'block',
4882
4919
  border: 'none'
4883
4920
  },
4884
- "data-testid": "canvas-container",
4885
4921
  children: jsx("div", {
4922
+ "aria-label": "canvas",
4923
+ role: "presentation",
4886
4924
  style: {
4887
4925
  overflow: 'visible',
4888
4926
  width: 0,
4889
4927
  height: 0
4890
4928
  },
4891
- role: "presentation",
4892
- "aria-label": "canvas",
4893
4929
  children: jsx("canvas", {
4894
4930
  "data-testid": "canvas",
4895
4931
  ref: function ref(canvas) {
@@ -4955,13 +4991,15 @@ var FilterChip = function FilterChip(_ref) {
4955
4991
  return onClickIcon == null ? void 0 : onClickIcon(chipRef.current, event);
4956
4992
  };
4957
4993
  return jsx(Chip, {
4958
- ref: chipRef,
4959
- size: size,
4994
+ color: isSelected ? 'secondary' : 'default',
4995
+ deleteIcon: actionIcon,
4996
+ disabled: isDisabled,
4960
4997
  id: id,
4961
4998
  label: label,
4962
- disabled: isDisabled,
4963
- variant: isSelected ? 'filled' : 'outlined',
4964
- color: isSelected ? 'secondary' : 'default',
4999
+ onClick: clickHandler,
5000
+ onDelete: onClickIcon ? clickIconHandler : undefined,
5001
+ ref: chipRef,
5002
+ size: size,
4965
5003
  sx: {
4966
5004
  borderColor: isDisabled ? 'none' : theme.palette.geowebColors.buttons.tertiary["default"].borderColor,
4967
5005
  padding: '0px 4px',
@@ -4979,9 +5017,7 @@ var FilterChip = function FilterChip(_ref) {
4979
5017
  borderColor: 'transparent'
4980
5018
  }
4981
5019
  },
4982
- onClick: clickHandler,
4983
- deleteIcon: actionIcon,
4984
- onDelete: onClickIcon ? clickIconHandler : undefined
5020
+ variant: isSelected ? 'filled' : 'outlined'
4985
5021
  });
4986
5022
  };
4987
5023
 
@@ -4995,32 +5031,32 @@ var FilterList = function FilterList(_ref) {
4995
5031
  var _useSharedTranslation = useSharedTranslation(),
4996
5032
  t = _useSharedTranslation.t;
4997
5033
  return jsxs(Stack, {
4998
- direction: "row",
4999
- "data-testid": "filterList",
5000
5034
  className: "filter-list",
5035
+ "data-testid": "filterList",
5036
+ direction: "row",
5001
5037
  flexWrap: "wrap",
5002
5038
  sx: {
5003
5039
  gap: 1,
5004
5040
  rowGap: 1
5005
5041
  },
5006
5042
  children: [jsx(FilterChip, {
5007
- id: "all",
5008
- label: t('shared-filter-all'),
5009
- isSelected: isAllSelected,
5010
5043
  handleClick: function handleClick(key) {
5011
5044
  return onChipClick(key, !isAllSelected);
5012
- }
5045
+ },
5046
+ id: "all",
5047
+ isSelected: isAllSelected,
5048
+ label: t('shared-filter-all')
5013
5049
  }), filters.map(function (filter) {
5014
5050
  return jsx(FilterChip, {
5015
- id: filter.id,
5016
- label: t(filter.label),
5017
- isSelected: isAllSelected ? false : filter.isSelected,
5018
- isDisabled: filter.isDisabled,
5019
5051
  handleClick: function handleClick(key) {
5020
5052
  // If they are all isSelected ensure that if one is clicked that one will be the only one set to selected
5021
5053
  var selected = isAllSelected ? true : !filter.isSelected;
5022
5054
  onChipClick(key, selected);
5023
- }
5055
+ },
5056
+ id: filter.id,
5057
+ isDisabled: filter.isDisabled,
5058
+ isSelected: isAllSelected ? false : filter.isSelected,
5059
+ label: t(filter.label)
5024
5060
  }, filter.id);
5025
5061
  })]
5026
5062
  });
@@ -5030,19 +5066,19 @@ var DEBOUNCE_TIMEOUT = 300;
5030
5066
  var SearchButton = function SearchButton(_ref) {
5031
5067
  var label = _ref.label;
5032
5068
  return jsx(CustomIconButton, {
5033
- tooltipTitle: label,
5034
5069
  edge: "end",
5035
5070
  size: "large",
5071
+ tooltipTitle: label,
5036
5072
  children: jsx(Search, {})
5037
5073
  });
5038
5074
  };
5039
5075
  var ClearButton = function ClearButton(_ref2) {
5040
5076
  var onClick = _ref2.onClick;
5041
5077
  return jsx(CustomIconButton, {
5042
- tooltipTitle: "Clear",
5043
5078
  edge: "end",
5044
5079
  onClick: onClick,
5045
5080
  size: "large",
5081
+ tooltipTitle: "Clear",
5046
5082
  children: jsx(Clear, {})
5047
5083
  });
5048
5084
  };
@@ -5059,21 +5095,14 @@ var SearchField = function SearchField(_ref3) {
5059
5095
  // eslint-disable-next-line react-hooks/exhaustive-deps
5060
5096
  var handleValueChangeDebounced = React.useCallback(debounce$1(valueChanged, DEBOUNCE_TIMEOUT), []);
5061
5097
  return jsx(TextField, {
5062
- variant: "filled",
5063
- size: "small",
5064
- sx: {
5065
- '& input': {
5066
- paddingTop: '18px'
5067
- }
5068
- },
5069
- label: label,
5070
- value: localValue,
5071
5098
  autoFocus: true,
5072
5099
  fullWidth: true,
5100
+ label: label,
5073
5101
  onChange: function onChange(e) {
5074
5102
  handleValueChangeDebounced(e.target.value);
5075
5103
  setLocalValue(e.target.value);
5076
5104
  },
5105
+ size: "small",
5077
5106
  slotProps: {
5078
5107
  input: {
5079
5108
  endAdornment: jsx(InputAdornment, {
@@ -5088,7 +5117,14 @@ var SearchField = function SearchField(_ref3) {
5088
5117
  })
5089
5118
  })
5090
5119
  }
5091
- }
5120
+ },
5121
+ sx: {
5122
+ '& input': {
5123
+ paddingTop: '18px'
5124
+ }
5125
+ },
5126
+ value: localValue,
5127
+ variant: "filled"
5092
5128
  });
5093
5129
  };
5094
5130
 
@@ -5104,11 +5140,11 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
5104
5140
  searchQuery = _ref.searchQuery,
5105
5141
  props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
5106
5142
  return jsx(Box, {
5143
+ ref: ref,
5107
5144
  sx: Object.assign({
5108
5145
  marginBottom: '8px',
5109
5146
  width: '100%'
5110
- }, props.sx),
5111
- ref: ref,
5147
+ }, Array.isArray(props.sx) ? Object.assign.apply(Object, [{}].concat(props.sx)) : props.sx),
5112
5148
  children: jsxs(Stack, {
5113
5149
  spacing: 1,
5114
5150
  children: [jsx(SearchField, {
@@ -5116,8 +5152,8 @@ var Filter = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
5116
5152
  valueChanged: onSearch
5117
5153
  }), jsx(FilterList, {
5118
5154
  filters: filters,
5119
- onChipClick: onClickFilterChip,
5120
- isAllSelected: isAllSelected
5155
+ isAllSelected: isAllSelected,
5156
+ onChipClick: onClickFilterChip
5121
5157
  })]
5122
5158
  })
5123
5159
  });
@@ -5138,30 +5174,23 @@ var FilterOption = function FilterOption(_ref) {
5138
5174
  return setShowOnly(show);
5139
5175
  }, 100);
5140
5176
  return jsx(ListItem, {
5141
- disablePadding: true,
5142
5177
  dense: true,
5143
- sx: {
5144
- width: '100%',
5145
- minWidth: '300px',
5146
- paddingRight: '0px',
5147
- marginLeft: '-12px',
5148
- fontSize: '12px'
5149
- },
5150
- secondaryAction: showOnly && jsx(CustomIconButton, {
5178
+ disablePadding: true,
5179
+ secondaryAction: showOnly ? jsx(CustomIconButton, {
5151
5180
  "aria-label": "Only " + label,
5152
- style: {
5153
- backgroundColor: 'transparent',
5154
- width: 'auto'
5155
- },
5156
5181
  edge: "end",
5157
5182
  onClick: function onClick() {
5158
5183
  return _onClick(!checked, true);
5159
5184
  },
5185
+ onMouseOut: function onMouseOut() {
5186
+ return updateShowOnly(false);
5187
+ },
5160
5188
  onMouseOver: function onMouseOver() {
5161
5189
  return updateShowOnly(true);
5162
5190
  },
5163
- onMouseOut: function onMouseOut() {
5164
- return updateShowOnly(false);
5191
+ style: {
5192
+ backgroundColor: 'transparent',
5193
+ width: 'auto'
5165
5194
  },
5166
5195
  children: jsx(Typography, {
5167
5196
  sx: {
@@ -5171,20 +5200,27 @@ var FilterOption = function FilterOption(_ref) {
5171
5200
  },
5172
5201
  children: t('shared-only')
5173
5202
  })
5174
- }),
5203
+ }) : null,
5204
+ sx: {
5205
+ width: '100%',
5206
+ minWidth: '300px',
5207
+ paddingRight: '0px',
5208
+ marginLeft: '-12px',
5209
+ fontSize: '12px'
5210
+ },
5175
5211
  children: jsxs(ListItemButton, {
5176
- role: undefined,
5212
+ dense: true,
5213
+ disableGutters: true,
5177
5214
  onClick: function onClick() {
5178
5215
  return _onClick(!checked);
5179
5216
  },
5180
- onMouseOver: function onMouseOver() {
5181
- return updateShowOnly(true);
5182
- },
5183
5217
  onMouseOut: function onMouseOut() {
5184
5218
  return updateShowOnly(false);
5185
5219
  },
5186
- dense: true,
5187
- disableGutters: true,
5220
+ onMouseOver: function onMouseOver() {
5221
+ return updateShowOnly(true);
5222
+ },
5223
+ role: undefined,
5188
5224
  sx: {
5189
5225
  padding: 0
5190
5226
  },
@@ -5194,20 +5230,20 @@ var FilterOption = function FilterOption(_ref) {
5194
5230
  },
5195
5231
  children: jsx(Checkbox, {
5196
5232
  checked: checked,
5197
- tabIndex: -1,
5198
5233
  disableRipple: true,
5234
+ name: optionId,
5199
5235
  slotProps: {
5200
5236
  input: {
5201
5237
  'aria-labelledby': optionId,
5202
5238
  'aria-label': optionId
5203
5239
  }
5204
5240
  },
5205
- name: optionId
5241
+ tabIndex: -1
5206
5242
  })
5207
5243
  }), jsx(ListItemText, {
5208
5244
  id: optionId,
5209
5245
  primary: jsx(Box, {
5210
- sx: Object.assign({}, labelStyle),
5246
+ sx: labelStyle,
5211
5247
  children: label
5212
5248
  })
5213
5249
  })]
@@ -5215,18 +5251,21 @@ var FilterOption = function FilterOption(_ref) {
5215
5251
  });
5216
5252
  };
5217
5253
 
5218
- var _excluded = ["isDark", "children"];
5254
+ var _excluded = ["isDark", "children", "sx"];
5219
5255
  var StorybookDocsWrapper = function StorybookDocsWrapper(_ref) {
5220
5256
  var _ref$isDark = _ref.isDark,
5221
5257
  isDark = _ref$isDark === void 0 ? false : _ref$isDark,
5222
5258
  children = _ref.children,
5259
+ _ref$sx = _ref.sx,
5260
+ sx = _ref$sx === void 0 ? [] : _ref$sx,
5223
5261
  props = _objectWithoutPropertiesLoose(_ref, _excluded);
5224
- return jsx(Box, {
5225
- sx: Object.assign({}, isDark && {
5262
+ return jsx(Box, Object.assign({
5263
+ sx: [].concat(isDark ? [{
5226
5264
  backgroundColor: 'geowebColors.background.surfaceBrowser'
5227
- }, props.sx),
5265
+ }] : [], Array.isArray(sx) ? sx : [sx])
5266
+ }, props, {
5228
5267
  children: children
5229
- });
5268
+ }));
5230
5269
  };
5231
5270
 
5232
5271
  /* *
@@ -5263,7 +5302,7 @@ var getAxiosErrorMessage = function getAxiosErrorMessage(error) {
5263
5302
  if (data && typeof data === 'string') {
5264
5303
  return data;
5265
5304
  }
5266
- if (data && data.message && typeof data.message === 'string') {
5305
+ if (data != null && data.message && typeof data.message === 'string') {
5267
5306
  return data.message;
5268
5307
  }
5269
5308
  if (error.message) {
@@ -5279,7 +5318,7 @@ var getErrorMessage = function getErrorMessage(error) {
5279
5318
  };
5280
5319
  var getAxiosWarningMessage = function getAxiosWarningMessage(error) {
5281
5320
  var data = error.response && error.response.data;
5282
- if (data && data.WarningMessage && typeof data.WarningMessage === 'string') {
5321
+ if (data != null && data.WarningMessage && typeof data.WarningMessage === 'string') {
5283
5322
  return data.WarningMessage;
5284
5323
  }
5285
5324
  return '';
@@ -5289,8 +5328,9 @@ var getWarningMessage = function getWarningMessage(error) {
5289
5328
  return getAxiosWarningMessage(error);
5290
5329
  }
5291
5330
  try {
5331
+ var _message$WarningMessa;
5292
5332
  var message = JSON.parse(error.message);
5293
- return message.WarningMessage || '';
5333
+ return (_message$WarningMessa = message.WarningMessage) != null ? _message$WarningMessa : '';
5294
5334
  } catch (_unused) {
5295
5335
  return '';
5296
5336
  }
@@ -5539,7 +5579,7 @@ var isBetween = function isBetween(date, from, to, inclusivity) {
5539
5579
  if (!['()', '[]', '(]', '[)'].includes(inclusivity)) {
5540
5580
  throw new Error('Inclusivity parameter must be one of (), [], (], [)');
5541
5581
  }
5542
- var isBeforeEqual = inclusivity[0] === '[';
5582
+ var isBeforeEqual = inclusivity.startsWith('[');
5543
5583
  var isAfterEqual = inclusivity[1] === ']';
5544
5584
  return (isBeforeEqual ? isEqual(from, date) || isBefore(from, date) : isBefore(from, date)) && (isAfterEqual ? isEqual(to, date) || isAfter(to, date) : isAfter(to, date));
5545
5585
  };
@@ -5701,13 +5741,15 @@ var isAfter = function isAfter(date, dateToCompare) {
5701
5741
  * @returns {Date} - Date in UTC, or current date when something invalid is passed.
5702
5742
  */
5703
5743
  var utc = function utc(dateStr) {
5744
+ var _isoStringToDate2;
5704
5745
  if (!dateStr) {
5705
5746
  return createDate();
5706
5747
  }
5707
5748
  if (hasOffset(dateStr)) {
5708
- return isoStringToDate(dateStr, false) || createDate();
5749
+ var _isoStringToDate;
5750
+ return (_isoStringToDate = isoStringToDate(dateStr, false)) != null ? _isoStringToDate : createDate();
5709
5751
  }
5710
- return isoStringToDate(dateStr) || createDate();
5752
+ return (_isoStringToDate2 = isoStringToDate(dateStr)) != null ? _isoStringToDate2 : createDate();
5711
5753
  };
5712
5754
  /**
5713
5755
  * Parsing string to a date. Stricter check, will return undefined when dateString is invalid.
@@ -5728,7 +5770,7 @@ var hasOffset = function hasOffset(dateStr) {
5728
5770
  };
5729
5771
  var getOffsetStr = function getOffsetStr(dateStr) {
5730
5772
  var offsetMatcher = /T.*([+-]\d{2}(:?\d{2})?|Z)$/;
5731
- var groups = dateStr.match(offsetMatcher);
5773
+ var groups = offsetMatcher.exec(dateStr);
5732
5774
  return groups ? groups[1] : null;
5733
5775
  };
5734
5776
  /**
@@ -5941,7 +5983,7 @@ var convertNOWFormatToUTC = function convertNOWFormatToUTC(timeValue) {
5941
5983
  var now = new Date();
5942
5984
  var today = startOfDay(now);
5943
5985
  var regex = /(NOW|TODAY)([+-])PT(\d+)H(\d+)M/;
5944
- var matches = timeValue.match(regex);
5986
+ var matches = regex.exec(timeValue);
5945
5987
  if (matches) {
5946
5988
  var base = matches[1] === 'NOW' ? now : today;
5947
5989
  var sign = matches[2] === '+' ? 1 : -1;
@@ -5960,7 +6002,7 @@ var convertNOWandTODAYFormatsToUTC = function convertNOWandTODAYFormatsToUTC(tim
5960
6002
  var now = new Date();
5961
6003
  var today = startOfDayUTC(now);
5962
6004
  var regex = /(NOW|TODAY)([+-])PT(\d+)H(\d+)M/;
5963
- var matches = timeValue.match(regex);
6005
+ var matches = regex.exec(timeValue);
5964
6006
  if (matches) {
5965
6007
  var base = matches[1] === 'NOW' ? now : today;
5966
6008
  var sign = matches[2] === '+' ? 1 : -1;
@@ -6208,7 +6250,8 @@ var RenderCounter = /*#__PURE__*/function () {
6208
6250
  // console.log('numRenders', id, this.get(id));
6209
6251
  };
6210
6252
  _proto.get = function get(id) {
6211
- return this.numRenders.get(id) || 0;
6253
+ var _this$numRenders$get;
6254
+ return (_this$numRenders$get = this.numRenders.get(id)) != null ? _this$numRenders$get : 0;
6212
6255
  };
6213
6256
  return RenderCounter;
6214
6257
  }();
@@ -6245,7 +6288,8 @@ var sessionStorageProvider = {
6245
6288
  return sessionStorage.setItem(SessionStorageKey.CONFIG, JSON.stringify(value));
6246
6289
  },
6247
6290
  getConfig: function getConfig() {
6248
- return JSON.parse(sessionStorage.getItem(SessionStorageKey.CONFIG) || '{}');
6291
+ var _sessionStorage$getIt;
6292
+ return JSON.parse((_sessionStorage$getIt = sessionStorage.getItem(SessionStorageKey.CONFIG)) != null ? _sessionStorage$getIt : '{}');
6249
6293
  },
6250
6294
  setOauthState: function setOauthState(value) {
6251
6295
  return sessionStorage.setItem(SessionStorageKey.OAUTH_STATE, value);