@digital-ai/dot-components 2.5.0 → 2.5.2

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 (64) hide show
  1. package/CHANGE_LOG.md +26 -3
  2. package/README.md +15 -0
  3. package/index.esm.js +1602 -1502
  4. package/index.umd.js +1728 -1627
  5. package/lib/Typography.stories.d.ts +4 -0
  6. package/lib/components/accordion/Accordion.stories.d.ts +8 -0
  7. package/lib/components/action-toolbar/ActionToolbar.stories.d.ts +5 -0
  8. package/lib/components/alert-banner/AlertBanner.stories.d.ts +5 -0
  9. package/lib/components/app-switcher/AppSwitcher.d.ts +2 -1
  10. package/lib/components/app-switcher/utils/helpers.d.ts +15 -5
  11. package/lib/components/app-toolbar/AppToolbar.stories.d.ts +8 -0
  12. package/lib/components/auto-complete/AutoComplete.stories.d.ts +22 -0
  13. package/lib/components/avatar/Avatar.stories.d.ts +7 -0
  14. package/lib/components/avatar-group/AvatarGroup.stories.d.ts +5 -0
  15. package/lib/components/badge/Badge.stories.d.ts +8 -0
  16. package/lib/components/breadcrumbs/Breadcrumbs.stories.d.ts +5 -0
  17. package/lib/components/button/Button.stories.d.ts +11 -0
  18. package/lib/components/button/CopyButton.stories.d.ts +5 -0
  19. package/lib/components/button/IconButton.stories.d.ts +10 -0
  20. package/lib/components/button-toggle/ButtonToggle.stories.d.ts +11 -0
  21. package/lib/components/card/Card.stories.d.ts +6 -0
  22. package/lib/components/checkbox/Checkbox.stories.d.ts +9 -0
  23. package/lib/components/checkbox/CheckboxGroup.stories.d.ts +6 -0
  24. package/lib/components/chip/Chip.stories.d.ts +8 -0
  25. package/lib/components/confirmation-dialog/ConfirmationDialog.stories.d.ts +6 -0
  26. package/lib/components/css-grid/CssGrid.stories.d.ts +7 -0
  27. package/lib/components/dialog/Dialog.stories.d.ts +5 -0
  28. package/lib/components/divider/Divider.stories.d.ts +6 -0
  29. package/lib/components/draggable-list/DraggableList.stories.d.ts +10 -0
  30. package/lib/components/drawer/Drawer.stories.d.ts +9 -0
  31. package/lib/components/dynamic-form/DynamicForm.stories.d.ts +5 -0
  32. package/lib/components/dynamic-form/utils/helpers.d.ts +1 -1
  33. package/lib/components/empty-state/EmptyState.stories.d.ts +5 -0
  34. package/lib/components/file-upload/FileUpload.stories.d.ts +8 -0
  35. package/lib/components/form/Form.stories.d.ts +5 -0
  36. package/lib/components/form-group/FormGroup.stories.d.ts +5 -0
  37. package/lib/components/icon/Icon.stories.d.ts +5 -0
  38. package/lib/components/inline-edit/InlineEdit.stories.d.ts +15 -0
  39. package/lib/components/input-form-fields/InputSelect.stories.d.ts +10 -0
  40. package/lib/components/input-form-fields/InputText.stories.d.ts +14 -0
  41. package/lib/components/linear-progress/LinearProgress.stories.d.ts +13 -0
  42. package/lib/components/link/Link.d.ts +4 -2
  43. package/lib/components/link/Link.stories.d.ts +6 -0
  44. package/lib/components/list/List.stories.d.ts +6 -0
  45. package/lib/components/menu/Menu.stories.d.ts +9 -0
  46. package/lib/components/navigation-rail/NavigationRail.stories.d.ts +7 -0
  47. package/lib/components/pill/Pill.stories.d.ts +5 -0
  48. package/lib/components/popper/Popper.stories.d.ts +6 -0
  49. package/lib/components/progress/Progress.stories.d.ts +9 -0
  50. package/lib/components/progress-button/ProgressButton.stories.d.ts +5 -0
  51. package/lib/components/radio/RadioButton.stories.d.ts +5 -0
  52. package/lib/components/radio/RadioGroup.stories.d.ts +7 -0
  53. package/lib/components/sidebar/Sidebar.stories.d.ts +8 -0
  54. package/lib/components/skeleton/Skeleton.stories.d.ts +5 -0
  55. package/lib/components/snackbar/Snackbar.stories.d.ts +6 -0
  56. package/lib/components/split-button/SplitButton.stories.d.ts +9 -0
  57. package/lib/components/switch/Switch.stories.d.ts +12 -0
  58. package/lib/components/table/Table.stories.d.ts +10 -0
  59. package/lib/components/table/TablePagination.stories.d.ts +5 -0
  60. package/lib/components/tabs/Tabs.stories.d.ts +6 -0
  61. package/lib/components/tooltip/Tooltip.stories.d.ts +5 -0
  62. package/lib/components/truncate-with-tooltip/TruncateWithTooltip.stories.d.ts +8 -0
  63. package/lib/components/typography/Typography.stories.d.ts +7 -0
  64. package/package.json +3 -3
package/index.umd.js CHANGED
@@ -1587,7 +1587,7 @@
1587
1587
  enabled: true,
1588
1588
  created_date: '2022-11-30T23:28:01.662721+00:00',
1589
1589
  modified_date: '2022-11-30T23:28:01.662721+00:00',
1590
- name: 'Agility',
1590
+ name: 'Agility 1',
1591
1591
  url: 'https://digital.ai/products/agility/',
1592
1592
  description: '',
1593
1593
  alternate_label: nullStr,
@@ -1602,7 +1602,7 @@
1602
1602
  enabled: true,
1603
1603
  created_date: '2022-11-30T23:32:00.979159+00:00',
1604
1604
  modified_date: '2022-11-30T23:32:00.979159+00:00',
1605
- name: 'Contininuous Testing',
1605
+ name: 'Continuous Testing 1',
1606
1606
  url: 'https://digital.ai/products/continuous-testing/',
1607
1607
  description: '',
1608
1608
  alternate_label: nullStr,
@@ -1617,7 +1617,7 @@
1617
1617
  enabled: true,
1618
1618
  created_date: '2022-12-30T23:32:00.979159+00:00',
1619
1619
  modified_date: '2022-12-30T23:32:00.979159+00:00',
1620
- name: 'Contininuous Testing 2',
1620
+ name: 'Continuous Testing 2',
1621
1621
  url: 'https://digital.ai/products/continuous-testing/',
1622
1622
  description: '',
1623
1623
  alternate_label: nullStr,
@@ -1996,661 +1996,444 @@
1996
1996
  }), void 0);
1997
1997
  });
1998
1998
 
1999
- var rootClassName$X = 'dot-icon-btn';
2000
- var StyledIconButton = styled__default["default"](material.IconButton).withConfig({
2001
- displayName: "IconButtonstyles__StyledIconButton",
2002
- componentId: "eko0kb-0"
2003
- })(templateObject_2$Y || (templateObject_2$Y = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2004
- return styled.css(templateObject_1$10 || (templateObject_1$10 = __makeTemplateObject(["\n &.", " {\n font-size: inherit;\n padding: 10px;\n\n .dot-icon.MuiIcon-fontSizeSmall {\n padding: 1px;\n }\n\n &.MuiIconButton-sizeSmall {\n padding: 3px;\n }\n\n &.ripple-disabled {\n &:hover, &:active, &:focus {\n background: ", ";\n }\n }\n "], ["\n &.", " {\n font-size: inherit;\n padding: 10px;\n\n .dot-icon.MuiIcon-fontSizeSmall {\n padding: 1px;\n }\n\n &.MuiIconButton-sizeSmall {\n padding: 3px;\n }\n\n &.ripple-disabled {\n &:hover, &:active, &:focus {\n background: ", ";\n }\n }\n "])), rootClassName$X, hoverGray);
1999
+ var rootClassName$X = 'dot-list';
2000
+ var listItemRootClass = 'dot-list-item';
2001
+ var nestedListClassName = 'dot-nested-list';
2002
+ var nestedDrawerClassName = 'dot-nested-drawer';
2003
+ var StyledList = styled__default["default"](material.List).withConfig({
2004
+ displayName: "Liststyles__StyledList",
2005
+ componentId: "wxwqwr-0"
2006
+ })(templateObject_2$Y || (templateObject_2$Y = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2007
+ var theme = _a.theme;
2008
+ return styled.css(templateObject_1$10 || (templateObject_1$10 = __makeTemplateObject(["\n &.", " {\n background: ", ";\n\n .dot-icon {\n color: ", ";\n }\n\n &.", " .", " {\n padding-left: ", ";\n }\n\n .MuiListSubheader-root {\n padding: 0;\n\n .MuiTypography-root {\n padding: ", ";\n }\n }\n }\n "], ["\n &.", " {\n background: ", ";\n\n .dot-icon {\n color: ", ";\n }\n\n &.", " .", " {\n padding-left: ", ";\n }\n\n .MuiListSubheader-root {\n padding: 0;\n\n .MuiTypography-root {\n padding: ", ";\n }\n }\n }\n "])), rootClassName$X, theme.palette.layer.n0, theme.palette.layer.n700, nestedListClassName, listItemRootClass, theme.spacing(4), theme.spacing(1));
2005
2009
  });
2006
2010
  var templateObject_1$10, templateObject_2$Y;
2007
2011
 
2008
- var DotIconButton = function DotIconButton(_a) {
2012
+ var getChevronIcon = function getChevronIcon(nestedListType, isOpened) {
2013
+ if (nestedListType !== 'expandable') {
2014
+ return 'chevron-right';
2015
+ }
2016
+ if (isOpened) {
2017
+ return 'chevron-up';
2018
+ }
2019
+ return 'chevron-down';
2020
+ };
2021
+
2022
+ var flyoutListItemClassName = 'dot-flyout-list-item';
2023
+ var flyoutItemLinkClassName = 'dot-flyout-item-link';
2024
+ var listItemLinkClassName = 'dot-list-item-link';
2025
+ var StyledListItem = styled__default["default"](material.ListItem).withConfig({
2026
+ displayName: "ListItemstyles__StyledListItem",
2027
+ componentId: "sc-1fawh8v-0"
2028
+ })(templateObject_2$X || (templateObject_2$X = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2029
+ var theme = _a.theme;
2030
+ return styled.css(templateObject_1$$ || (templateObject_1$$ = __makeTemplateObject(["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n p.MuiTypography-root {\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "], ["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n p.MuiTypography-root {\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "])), listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary);
2031
+ });
2032
+ var templateObject_1$$, templateObject_2$X;
2033
+
2034
+ var rootClassName$W = 'dot-progress';
2035
+ var StyledCircularProgress = styled__default["default"](material.CircularProgress).withConfig({
2036
+ displayName: "Progressstyles__StyledCircularProgress",
2037
+ componentId: "sc-1gs77rb-0"
2038
+ })(templateObject_1$_ || (templateObject_1$_ = __makeTemplateObject(["\n &.", " {\n &.MuiCircularProgress-colorSecondary {\n color: #649a3d;\n }\n }\n"], ["\n &.", " {\n &.MuiCircularProgress-colorSecondary {\n color: #649a3d;\n }\n }\n"])), rootClassName$W);
2039
+ var templateObject_1$_;
2040
+
2041
+ var DotProgress = function DotProgress(_a) {
2009
2042
  var ariaLabel = _a.ariaLabel,
2010
- className = _a.className,
2011
2043
  _b = _a.color,
2012
- color = _b === void 0 ? 'inherit' : _b,
2044
+ color = _b === void 0 ? 'secondary' : _b,
2045
+ className = _a.className,
2013
2046
  dataTestId = _a["data-testid"],
2014
- _c = _a.disabled,
2015
- disabled = _c === void 0 ? false : _c,
2016
- _d = _a.disableRipple,
2017
- disableRipple = _d === void 0 ? false : _d,
2018
- iconId = _a.iconId,
2019
- _e = _a.iconSize,
2020
- iconSize = _e === void 0 ? 'small' : _e,
2021
- onClick = _a.onClick,
2022
- tooltip = _a.tooltip,
2023
- _f = _a.size,
2024
- size = _f === void 0 ? 'medium' : _f;
2025
- var rippleClassName = disableRipple ? 'ripple-disabled' : '';
2026
- var rootClasses = useStylesWithRootClass(rootClassName$X, rippleClassName, className);
2047
+ _c = _a.size,
2048
+ size = _c === void 0 ? 40 : _c,
2049
+ _d = _a.thickness,
2050
+ thickness = _d === void 0 ? 3.6 : _d,
2051
+ _e = _a.tooltip,
2052
+ tooltip = _e === void 0 ? 'loading data' : _e,
2053
+ value = _a.value,
2054
+ _f = _a.variant,
2055
+ variant = _f === void 0 ? 'indeterminate' : _f;
2056
+ var rootClasses = useStylesWithRootClass(rootClassName$W, className);
2027
2057
  return jsxRuntime.jsx(DotTooltip, __assign({
2028
- "data-testid": "icon-button-tooltip",
2029
2058
  title: tooltip
2030
2059
  }, {
2031
- children: jsxRuntime.jsx(StyledIconButton, __assign({
2060
+ children: jsxRuntime.jsx(StyledCircularProgress, {
2032
2061
  "aria-label": ariaLabel,
2033
2062
  classes: {
2034
2063
  root: rootClasses
2035
2064
  },
2036
2065
  color: color,
2037
2066
  "data-testid": dataTestId,
2038
- disableRipple: disableRipple,
2039
- disabled: disabled,
2040
- onClick: function (event) {
2041
- return onClick && onClick(event);
2042
- },
2043
- size: size
2044
- }, {
2045
- children: jsxRuntime.jsx(DotIcon, {
2046
- "data-testid": "button-icon",
2047
- fontSize: iconSize,
2048
- iconId: iconId
2049
- }, void 0)
2050
- }), void 0)
2067
+ size: size,
2068
+ thickness: thickness,
2069
+ value: value,
2070
+ variant: variant
2071
+ }, void 0)
2051
2072
  }), void 0);
2052
2073
  };
2053
2074
 
2054
- var DotInputLabel = function DotInputLabel(_a) {
2055
- var dataTestId = _a["data-testid"],
2056
- _b = _a.disabled,
2057
- disabled = _b === void 0 ? false : _b,
2058
- _c = _a.error,
2059
- error = _c === void 0 ? false : _c,
2060
- id = _a.id,
2061
- label = _a.label,
2062
- required = _a.required;
2063
- return jsxRuntime.jsx(StyledInputLabel, __assign({
2064
- "data-testid": dataTestId,
2065
- classes: {
2066
- root: labelClassName
2067
- },
2068
- disabled: disabled,
2069
- error: error,
2070
- htmlFor: id,
2071
- required: required,
2072
- shrink: false,
2073
- variant: "outlined"
2074
- }, {
2075
- children: jsxRuntime.jsx(DotTypography, __assign({
2076
- variant: "subtitle2"
2077
- }, {
2078
- children: label
2079
- }), void 0)
2080
- }), void 0);
2075
+ var levelBottom = -1;
2076
+ var levelFirst = 1;
2077
+ var levelSecond = 10;
2078
+ var levelThird = 100;
2079
+ var levelFourth = 1000;
2080
+ var levelTop = 9999;
2081
+
2082
+ var variables = /*#__PURE__*/Object.freeze({
2083
+ __proto__: null,
2084
+ levelBottom: levelBottom,
2085
+ levelFirst: levelFirst,
2086
+ levelSecond: levelSecond,
2087
+ levelThird: levelThird,
2088
+ levelFourth: levelFourth,
2089
+ levelTop: levelTop
2090
+ });
2091
+
2092
+ var rootClassName$V = 'dot-popper';
2093
+ var StyledPopper$1 = styled__default["default"](material.Popper).withConfig({
2094
+ displayName: "Popperstyles__StyledPopper",
2095
+ componentId: "sd1h8p-0"
2096
+ })(templateObject_2$W || (templateObject_2$W = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2097
+ var theme = _a.theme;
2098
+ return styled.css(templateObject_1$Z || (templateObject_1$Z = __makeTemplateObject(["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n }\n "], ["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n }\n "])), rootClassName$V, theme.typography.fontFamily, theme.typography.body1.fontSize);
2099
+ });
2100
+ var templateObject_1$Z, templateObject_2$W;
2101
+
2102
+ var flyoutMenuClassName = 'dot-flyout-menu';
2103
+ var rootClassName$U = 'dot-menu';
2104
+ var getListMaxHeight = function getListMaxHeight(maxHeight) {
2105
+ return isString$1(maxHeight) ? maxHeight : maxHeight + "px";
2081
2106
  };
2107
+ var StyledPopper = styled__default["default"](material.Popper).withConfig({
2108
+ displayName: "Menustyles__StyledPopper",
2109
+ componentId: "sc-134fmqu-0"
2110
+ })(templateObject_2$V || (templateObject_2$V = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2111
+ var theme = _a.theme;
2112
+ return styled.css(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n z-index: ", ";\n }\n &.", ", &.", " {\n &.loading .MuiPaper-root {\n align-items: center;\n display: flex;\n justify-content: center;\n min-height: 200px;\n min-width: 200px;\n }\n\n ul,\n .dot-action-item {\n .dot-action-item-text {\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n }\n\n ul {\n box-sizing: content-box;\n min-width: 112px;\n overflow: auto;\n\n /* Conditionally setting 'max-height' with transient prop */\n ", "\n\n .dot-li {\n min-height: auto;\n }\n }\n\n .dot-action-item {\n height: ", ";\n border-top: 1px solid ", ";\n line-height: inherit;\n\n button.dot-button {\n border-radius: ", ";\n justify-content: flex-start;\n height: 100%;\n margin: 0;\n\n &:focus-visible {\n background-color: ", ";\n }\n\n .MuiButton-label {\n gap: ", ";\n\n .MuiButton-startIcon {\n margin-left: 0;\n\n .dot-icon {\n flex-shrink: 0;\n }\n }\n }\n }\n }\n }\n "], ["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n z-index: ", ";\n }\n &.", ", &.", " {\n &.loading .MuiPaper-root {\n align-items: center;\n display: flex;\n justify-content: center;\n min-height: 200px;\n min-width: 200px;\n }\n\n ul,\n .dot-action-item {\n .dot-action-item-text {\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n }\n\n ul {\n box-sizing: content-box;\n min-width: 112px;\n overflow: auto;\n\n /* Conditionally setting 'max-height' with transient prop */\n ", "\n\n .dot-li {\n min-height: auto;\n }\n }\n\n .dot-action-item {\n height: ", ";\n border-top: 1px solid ", ";\n line-height: inherit;\n\n button.dot-button {\n border-radius: ", ";\n justify-content: flex-start;\n height: 100%;\n margin: 0;\n\n &:focus-visible {\n background-color: ", ";\n }\n\n .MuiButton-label {\n gap: ", ";\n\n .MuiButton-startIcon {\n margin-left: 0;\n\n .dot-icon {\n flex-shrink: 0;\n }\n }\n }\n }\n }\n }\n "])), rootClassName$V, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$U, rootClassName$V, function (_a) {
2113
+ var $maxHeight = _a.$maxHeight;
2114
+ return $maxHeight !== undefined && "\n max-height: " + getListMaxHeight($maxHeight) + ";\n ";
2115
+ }, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3));
2116
+ });
2117
+ var templateObject_1$Y, templateObject_2$V;
2082
2118
 
2083
- var DELAY_MS = 300;
2084
- var EndAdornment = function EndAdornment(_a) {
2085
- var endAdornmentTooltip = _a.endAdornmentTooltip,
2086
- error = _a.error,
2087
- dataTestId = _a.dataTestId,
2088
- endIcon = _a.endIcon,
2089
- success = _a.success,
2090
- warning = _a.warning;
2091
- var renderIcon = function renderIcon(iconType) {
2092
- return jsxRuntime.jsx(DotIcon, {
2093
- "data-testid": dataTestId && dataTestId + "-" + iconType + "-icon",
2094
- iconId: iconType + "-solid"
2095
- }, void 0);
2096
- };
2097
- var errorIcon = error && renderIcon('error');
2098
- var successIcon = success && renderIcon('check');
2099
- var warningIcon = warning && renderIcon('warning');
2100
- var endAdornmentIcon = endIcon || errorIcon || warningIcon || successIcon;
2101
- var styledAdornment = jsxRuntime.jsx(StyledAdornment, __assign({
2102
- className: adornmentIconClassName + " end",
2103
- position: "end"
2104
- }, {
2105
- children: endAdornmentIcon
2106
- }), void 0);
2107
- return endAdornmentTooltip ? jsxRuntime.jsx(DotTooltip, __assign({
2108
- title: endAdornmentTooltip
2109
- }, {
2110
- children: styledAdornment
2111
- }), void 0) : styledAdornment;
2119
+ var MENU_ITEM_HEIGHT_NORMAL = 48;
2120
+ var MENU_ITEM_HEIGHT_DENSE = 36;
2121
+ var DEFAULT_MAX_VISIBLE_ITEMS = 7;
2122
+
2123
+ var rootClassName$T = 'dot-ul';
2124
+ var listItemClassName$1 = 'dot-li';
2125
+ var listItemWithSubmenuClassName = 'dot-li-with-submenu';
2126
+ var StyledMenuList = styled__default["default"](material.MenuList).withConfig({
2127
+ displayName: "MenuListstyles__StyledMenuList",
2128
+ componentId: "yqdwwg-0"
2129
+ })(templateObject_2$U || (templateObject_2$U = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2130
+ var theme = _a.theme;
2131
+ return styled.css(templateObject_1$X || (templateObject_1$X = __makeTemplateObject(["\n &.", " {\n .dot-li {\n font-size: ", "px;\n justify-content: space-between;\n gap: ", ";\n\n &:hover {\n background: ", ";\n }\n\n &.Mui-selected,\n &.Mui-selected:hover {\n background: ", ";\n }\n\n &.", " {\n padding-right: ", ";\n }\n }\n }\n "], ["\n &.", " {\n .dot-li {\n font-size: ", "px;\n justify-content: space-between;\n gap: ", ";\n\n &:hover {\n background: ", ";\n }\n\n &.Mui-selected,\n &.Mui-selected:hover {\n background: ", ";\n }\n\n &.", " {\n padding-right: ", ";\n }\n }\n }\n "])), rootClassName$T, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5));
2132
+ });
2133
+ var templateObject_1$X, templateObject_2$U;
2134
+
2135
+ var getDefaultItemHeight = function getDefaultItemHeight(isDense) {
2136
+ return isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
2112
2137
  };
2113
- var getInitialState = function getInitialState(value) {
2114
- return {
2115
- inputValue: value || ''
2116
- };
2138
+ var calculateItemHeight = function calculateItemHeight(isDense, customItemHeight, menuItemHeight) {
2139
+ // Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
2140
+ if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
2141
+ return customItemHeight;
2142
+ }
2143
+ var itemHeightType = typeof menuItemHeight;
2144
+ if (itemHeightType === 'number' || itemHeightType === 'string') {
2145
+ return menuItemHeight;
2146
+ } else {
2147
+ return getDefaultItemHeight(isDense);
2148
+ }
2117
2149
  };
2118
- var DotInputText = function DotInputText(_a) {
2119
- var _b = _a.autoComplete,
2120
- autoComplete = _b === void 0 ? 'off' : _b,
2121
- autoFocus = _a.autoFocus,
2122
- className = _a.className,
2123
- defaultValue = _a.defaultValue,
2124
- dataTestId = _a["data-testid"],
2125
- _c = _a.disabled,
2126
- disabled = _c === void 0 ? false : _c,
2127
- _d = _a.error,
2128
- error = _d === void 0 ? false : _d,
2129
- endAdornmentTooltip = _a.endAdornmentTooltip,
2130
- _e = _a.fullWidth,
2131
- fullWidth = _e === void 0 ? true : _e,
2132
- hasDebounce = _a.hasDebounce,
2133
- helperText = _a.helperText,
2134
- endIcon = _a.endIcon,
2135
- id = _a.id,
2136
- inputRef = _a.inputRef,
2137
- label = _a.label,
2138
- maxRows = _a.maxRows,
2139
- minRows = _a.minRows,
2140
- _f = _a.multiline,
2141
- multiline = _f === void 0 ? false : _f,
2142
- name = _a.name,
2143
- onBlur = _a.onBlur,
2144
- onChange = _a.onChange,
2145
- onFocus = _a.onFocus,
2146
- onKeyDown = _a.onKeyDown,
2147
- onMouseUp = _a.onMouseUp,
2148
- persistentLabel = _a.persistentLabel,
2149
- placeholder = _a.placeholder,
2150
- _g = _a.readOnly,
2151
- readOnly = _g === void 0 ? false : _g,
2152
- _h = _a.required,
2153
- required = _h === void 0 ? false : _h,
2154
- shrink = _a.shrink,
2155
- startIcon = _a.startIcon,
2156
- _j = _a.size,
2157
- size = _j === void 0 ? 'small' : _j,
2158
- success = _a.success,
2159
- _k = _a.type,
2160
- type = _k === void 0 ? 'text' : _k,
2161
- value = _a.value,
2162
- _l = _a.warning,
2163
- warning = _l === void 0 ? false : _l;
2164
- var hasError = error && errorClassName;
2165
- var hasWarning = !error && warning && warningClassName;
2166
- var hasSuccess = !error && !warning && success && successClassName;
2167
- var hasEndAdornmentIcon = endIcon || error || hasWarning || hasSuccess;
2168
- // This state is used only with debounce feature enabled
2169
- var _m = React.useState(hasDebounce && getInitialState(value)),
2170
- inputTextState = _m[0],
2171
- setInputTextState = _m[1];
2172
- var rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, readOnly ? 'read-only' : '');
2173
- // Used to control text value from the consumer component
2174
- // when debounce feature is enabled
2175
- React.useEffect(function () {
2176
- if (hasDebounce && value !== inputTextState.inputValue) {
2177
- setInputTextState(getInitialState(value));
2178
- }
2179
- }, [value]);
2180
- // Improve performance by avoiding callback execution
2181
- // on each keystroke (if debounce feature is active)
2182
- React.useEffect(function () {
2183
- // Do not proceed if debounce feature is turned
2184
- // off or there is no event defined
2185
- if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
2186
- var handler = setTimeout(function () {
2187
- onChange(inputTextState.changeEvent);
2188
- }, DELAY_MS);
2189
- return function () {
2190
- return clearTimeout(handler);
2191
- };
2192
- }, [inputTextState]);
2193
- var handleChange = function handleChange(e) {
2194
- // We need to have control over change event and input value separately
2195
- // so that we can set initial state via 'value' prop (if needed)
2196
- hasDebounce ? setInputTextState({
2197
- changeEvent: e,
2198
- inputValue: e.target.value
2199
- }) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
2200
- };
2201
- var inputTextValue = hasDebounce ? inputTextState.inputValue : value;
2202
- // Don't use default value when debounce feature is enabled because
2203
- // in that case component is controlled
2204
- var defaultInputValue = hasDebounce ? undefined : defaultValue;
2205
- var startAdornmentIcon = function startAdornmentIcon() {
2206
- if (!startIcon) return null;
2207
- return jsxRuntime.jsx(StyledAdornment, __assign({
2208
- className: adornmentIconClassName + " start",
2209
- position: "start"
2210
- }, {
2211
- children: startIcon
2212
- }), void 0);
2213
- };
2214
- var endAdornmentIcon = function endAdornmentIcon() {
2215
- if (!hasEndAdornmentIcon) return null;
2216
- return jsxRuntime.jsx(EndAdornment, __assign({}, {
2217
- endAdornmentTooltip: endAdornmentTooltip,
2218
- error: error,
2219
- dataTestId: dataTestId,
2220
- endIcon: endIcon,
2221
- success: success,
2222
- warning: warning
2223
- }), void 0);
2224
- };
2225
- var wrapperClassName = useStylesWithRootClass(fullWidth !== false ? 'dot-input-text--fullwidth' : '', className);
2226
- return jsxRuntime.jsxs(StyledTextFieldContainer, __assign({
2227
- className: wrapperClassName
2228
- }, {
2229
- children: [persistentLabel && jsxRuntime.jsx(DotInputLabel, __assign({}, {
2230
- disabled: disabled,
2231
- error: error,
2232
- id: id,
2233
- label: label,
2234
- required: required
2235
- }), void 0), jsxRuntime.jsx(StyledTextField, {
2236
- InputProps: {
2237
- startAdornment: startAdornmentIcon(),
2238
- endAdornment: endAdornmentIcon()
2239
- },
2240
- "aria-label": name,
2241
- autoComplete: autoComplete,
2242
- autoFocus: autoFocus,
2243
- classes: {
2244
- root: rootStyles
2245
- },
2246
- defaultValue: defaultInputValue,
2247
- disabled: disabled,
2248
- error: error,
2249
- focused: readOnly ? false : undefined,
2250
- fullWidth: fullWidth,
2251
- helperText: helperText,
2252
- id: id,
2253
- InputLabelProps: {
2254
- shrink: type === 'date' ? true : shrink
2255
- },
2256
- inputProps: {
2257
- 'data-testid': dataTestId,
2258
- className: 'dot-input',
2259
- readOnly: readOnly
2260
- },
2261
- inputRef: inputRef,
2262
- label: persistentLabel ? null : label,
2263
- multiline: multiline,
2264
- name: name,
2265
- onBlur: onBlur,
2266
- onChange: hasDebounce ? handleChange : onChange,
2267
- onFocus: onFocus,
2268
- onKeyDown: onKeyDown,
2269
- onMouseUp: onMouseUp,
2270
- placeholder: placeholder,
2271
- required: required,
2272
- minRows: multiline ? minRows : null,
2273
- maxRows: multiline ? maxRows : null,
2274
- size: size,
2275
- type: type,
2276
- value: inputTextValue,
2277
- variant: "outlined"
2278
- }, void 0)]
2279
- }), void 0);
2150
+ var getNumberOfVisibleItems = function getNumberOfVisibleItems(numberOfItems, maxVisibleItems) {
2151
+ if (maxVisibleItems && maxVisibleItems > 0) {
2152
+ return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
2153
+ }
2154
+ return DEFAULT_MAX_VISIBLE_ITEMS;
2280
2155
  };
2281
-
2282
- var rootClassName$W = 'dot-search-input';
2283
- var StyledSearchInput = styled__default["default"].span.withConfig({
2284
- displayName: "SearchInputstyles__StyledSearchInput",
2285
- componentId: "qlwzku-0"
2286
- })(templateObject_2$X || (templateObject_2$X = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2287
- return styled.css(templateObject_1$$ || (templateObject_1$$ = __makeTemplateObject(["\n &.", " {\n }\n "], ["\n &.", " {\n }\n "])), rootClassName$W);
2288
- });
2289
- var templateObject_1$$, templateObject_2$X;
2290
-
2291
- function SearchInput(_a) {
2292
- var dataTestId = _a["data-testid"],
2293
- _b = _a.autoFocus,
2294
- autoFocus = _b === void 0 ? true : _b,
2295
- className = _a.className,
2296
- _c = _a.disabled,
2297
- disabled = _c === void 0 ? false : _c,
2298
- onChange = _a.onChange,
2299
- onClear = _a.onClear,
2300
- _d = _a.placeholder,
2301
- placeholder = _d === void 0 ? 'Search' : _d,
2302
- _e = _a.tooltip,
2303
- tooltip = _e === void 0 ? null : _e,
2304
- value = _a.value;
2305
- var rootClasses = useStylesWithRootClass(rootClassName$W, className);
2306
- var _f = React.useState(value),
2307
- searchText = _f[0],
2308
- setSearchText = _f[1];
2309
- var previousSearchText = '';
2310
- var handleChange = React.useCallback(function (event) {
2311
- previousSearchText = event.target.value;
2312
- setSearchText(event.target.value);
2313
- // Timeout is to give user a chance to finish typing before refreshing data.
2314
- setTimeout(function () {
2315
- if (onChange && event.target.value === previousSearchText) {
2316
- onChange(event.target.value);
2317
- }
2318
- }, 500);
2319
- }, [onChange]);
2320
- var handleClear = React.useCallback(function () {
2321
- setSearchText('');
2322
- onClear && onClear();
2323
- }, [onClear]);
2324
- var searchIcon = jsxRuntime.jsx(DotIcon, {
2325
- className: "search-icon",
2326
- iconId: "search"
2327
- }, void 0);
2328
- var clearSearchIcon = jsxRuntime.jsx(DotIconButton, {
2329
- iconId: "close",
2330
- onClick: handleClear,
2331
- size: "small",
2332
- tooltip: "Clear search text"
2333
- }, void 0);
2334
- return jsxRuntime.jsx(StyledSearchInput, __assign({
2335
- className: rootClasses
2336
- }, {
2337
- children: jsxRuntime.jsx(DotTooltip, __assign({
2338
- placement: "bottom",
2339
- title: tooltip
2340
- }, {
2341
- children: jsxRuntime.jsx(DotInputText, {
2342
- "data-testid": dataTestId,
2343
- autoFocus: autoFocus,
2344
- className: "search-text",
2345
- disabled: disabled,
2346
- endIcon: (searchText === null || searchText === void 0 ? void 0 : searchText.length) > 0 ? clearSearchIcon : null,
2347
- id: "app-instance-search-text",
2348
- name: "app-instance-search-text",
2349
- onChange: handleChange,
2350
- placeholder: placeholder,
2351
- startIcon: searchIcon,
2352
- value: searchText
2353
- }, void 0)
2354
- }), void 0)
2355
- }), void 0);
2356
- }
2357
-
2358
- var rootClassName$V = 'dot-copy-button';
2359
- var StyledCopyButton = styled__default["default"].span.withConfig({
2360
- displayName: "CopyButtonstyles__StyledCopyButton",
2361
- componentId: "sc-18ff0u-0"
2362
- })(templateObject_2$W || (templateObject_2$W = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2363
- var theme = _a.theme;
2364
- return styled.css(templateObject_1$_ || (templateObject_1$_ = __makeTemplateObject(["\n &.", " {\n .copied-to-clipboard {\n color: ", ";\n }\n }\n "], ["\n &.", " {\n .copied-to-clipboard {\n color: ", ";\n }\n }\n "])), rootClassName$V, theme.palette.success[400]);
2365
- });
2366
- var templateObject_1$_, templateObject_2$W;
2367
-
2368
- var DotCopyButton = function DotCopyButton(_a) {
2369
- var _b = _a.ariaLabel,
2370
- ariaLabel = _b === void 0 ? 'Copy to clipboard' : _b,
2371
- _c = _a.copiedTooltip,
2372
- copiedTooltip = _c === void 0 ? 'Copied!' : _c,
2373
- _d = _a.copyTooltip,
2374
- copyTooltip = _d === void 0 ? 'Copy to clipboard' : _d,
2375
- _e = _a["data-testid"],
2376
- dataTestId = _e === void 0 ? 'dot-copy-button' : _e,
2377
- value = _a.value;
2378
- var _f = React.useState(false),
2379
- showCopiedIcon = _f[0],
2380
- setShowCopiedIcon = _f[1];
2381
- var copyToClipboard = function copyToClipboard() {
2382
- // The check for navigator.clipboard.writeText is because this function is
2383
- // only supported in secure contexts (https). This will always be the case in
2384
- // production but not when running locally.
2385
- if (!navigator.clipboard || !navigator.clipboard.writeText) {
2386
- console.warn('Copy to clipboard is only supported in secure context (https)', value);
2387
- } else {
2388
- navigator.clipboard.writeText(value);
2389
- }
2390
- };
2391
- var copy = function copy() {
2392
- copyToClipboard();
2393
- setShowCopiedIcon(true);
2394
- setTimeout(function () {
2395
- setShowCopiedIcon(false);
2396
- }, 3000);
2397
- return false;
2398
- };
2399
- return jsxRuntime.jsxs(StyledCopyButton, __assign({
2400
- className: rootClassName$V,
2401
- "data-testid": dataTestId
2402
- }, {
2403
- children: [!showCopiedIcon && jsxRuntime.jsx(DotIconButton, {
2404
- ariaLabel: ariaLabel,
2405
- "data-testid": dataTestId + "-button",
2406
- iconId: "duplicate",
2407
- onClick: copy,
2408
- size: "small",
2409
- tooltip: copyTooltip
2410
- }, void 0), showCopiedIcon && jsxRuntime.jsx(DotIcon, {
2411
- className: "copied-to-clipboard",
2412
- "data-testid": dataTestId + "-icon",
2413
- fontSize: "small",
2414
- iconId: "check-solid",
2415
- tooltip: copiedTooltip
2416
- }, void 0)]
2417
- }), void 0);
2156
+ var calculateMaxHeight = function calculateMaxHeight(_a) {
2157
+ var isDense = _a.isDense,
2158
+ maxVisibleItems = _a.maxVisibleItems,
2159
+ menuItems = _a.menuItems,
2160
+ menuItemHeight = _a.menuItemHeight;
2161
+ // if menuItemHeight is "auto" set maxHeight as same
2162
+ if (typeof menuItemHeight === 'string') {
2163
+ return menuItemHeight;
2164
+ }
2165
+ // If 'menuItemHeight' is set it will take precedence here
2166
+ var itemHeight = menuItemHeight ? menuItemHeight : getDefaultItemHeight(isDense);
2167
+ var maxHeight = 0;
2168
+ var numberOfVisibleItems = getNumberOfVisibleItems(menuItems.length, maxVisibleItems);
2169
+ var visibleItems = menuItems.slice(0, numberOfVisibleItems);
2170
+ visibleItems.forEach(function (_a) {
2171
+ var height = _a.height;
2172
+ var customItemHeight = height ? height : itemHeight;
2173
+ // + 3 is for bottom margin of menuItem
2174
+ maxHeight += customItemHeight + 3;
2175
+ });
2176
+ return maxHeight;
2177
+ };
2178
+ var checkForSubItems = function checkForSubItems(menuItems) {
2179
+ return menuItems.some(function (menuItem) {
2180
+ return menuItem.items && menuItems.length > 0;
2181
+ });
2182
+ };
2183
+ var checkIfSubmenu = function checkIfSubmenu(anchorElement) {
2184
+ if (!anchorElement) return false;
2185
+ return anchorElement.classList.contains(listItemWithSubmenuClassName);
2186
+ };
2187
+ var checkIfMenuItemSelected = function checkIfMenuItemSelected(key, selectedKey, activeSubmenu) {
2188
+ return selectedKey === key || activeSubmenu === key;
2189
+ };
2190
+ var checkForAutoFocus = function checkForAutoFocus(autoFocusItem, isFirstItem) {
2191
+ return !!(autoFocusItem && isFirstItem);
2418
2192
  };
2419
2193
 
2420
- var rootClassName$U = 'dot-link';
2421
- var StyledLink = styled__default["default"](material.Link).withConfig({
2422
- displayName: "Linkstyles__StyledLink",
2423
- componentId: "sc-1lpmaww-0"
2424
- })(templateObject_2$V || (templateObject_2$V = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2425
- return styled.css(templateObject_1$Z || (templateObject_1$Z = __makeTemplateObject(["\n &.", " {\n cursor: pointer;\n\n &:hover :not(.MuiLink-underlineHover) {\n text-decoration: none;\n }\n }\n "], ["\n &.", " {\n cursor: pointer;\n\n &:hover :not(.MuiLink-underlineHover) {\n text-decoration: none;\n }\n }\n "])), rootClassName$U);
2426
- });
2427
- var templateObject_1$Z, templateObject_2$V;
2428
-
2429
- var DotLink = function DotLink(_a) {
2430
- var ariaLabel = _a.ariaLabel,
2431
- children = _a.children,
2194
+ /**
2195
+ * Since this component is used inside 'ClickAwayListener',
2196
+ * it needs to be contained within 'forwardRef' function
2197
+ */
2198
+ var DotMenuList = /*#__PURE__*/React.forwardRef(function (_a, ref) {
2199
+ var autoFocusItem = _a.autoFocusItem,
2432
2200
  className = _a.className,
2433
- _b = _a.color,
2434
- color = _b === void 0 ? 'primary' : _b,
2435
2201
  dataTestId = _a["data-testid"],
2436
- href = _a.href,
2437
- onClick = _a.onClick,
2438
- onMouseEnter = _a.onMouseEnter,
2439
- _c = _a.rel,
2440
- rel = _c === void 0 ? 'noreferrer' : _c,
2441
- _d = _a.tabIndex,
2442
- tabIndex = _d === void 0 ? 0 : _d,
2443
- target = _a.target,
2444
- tooltip = _a.tooltip,
2445
- underline = _a.underline;
2446
- var rootClasses = useStylesWithRootClass(rootClassName$U, className);
2447
- var handleKeyPress = function handleKeyPress(event) {
2448
- if (onClick && event.key === 'Enter') {
2449
- event.preventDefault();
2450
- onClick(event);
2451
- }
2202
+ dense = _a.dense,
2203
+ id = _a.id,
2204
+ maxVisibleItems = _a.maxVisibleItems,
2205
+ menuItemHeight = _a.menuItemHeight,
2206
+ menuItems = _a.menuItems,
2207
+ onItemSelect = _a.onItemSelect,
2208
+ onKeyDown = _a.onKeyDown,
2209
+ onSubMenuCreate = _a.onSubMenuCreate,
2210
+ selectedKey = _a.selectedKey;
2211
+ var rootClasses = useStylesWithRootClass(rootClassName$T, className);
2212
+ var _b = React.useState(null),
2213
+ activeSubmenu = _b[0],
2214
+ setActiveSubmenu = _b[1];
2215
+ var _c = React.useState(null),
2216
+ subItemAnchorEl = _c[0],
2217
+ setSubItemAnchorEl = _c[1];
2218
+ var openSubmenu = function openSubmenu(target, itemKey) {
2219
+ // Set new anchor for submenu and active submenu key
2220
+ // so that new submenu can be opened
2221
+ setSubItemAnchorEl(target);
2222
+ setActiveSubmenu(itemKey);
2452
2223
  };
2453
- return jsxRuntime.jsx(DotTooltip, __assign({
2454
- title: tooltip
2455
- }, {
2456
- children: jsxRuntime.jsx(StyledLink, __assign({
2457
- "aria-label": ariaLabel,
2458
- classes: {
2459
- root: rootClasses
2460
- },
2461
- color: color,
2462
- "data-testid": dataTestId,
2463
- href: href,
2464
- onClick: onClick,
2465
- onKeyPress: handleKeyPress,
2466
- onMouseEnter: onMouseEnter,
2467
- rel: rel,
2468
- tabIndex: tabIndex,
2469
- target: target,
2470
- underline: underline
2471
- }, {
2472
- children: children
2473
- }), void 0)
2474
- }), void 0);
2475
- };
2476
-
2477
- var img$6 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
2478
-
2479
- var img$5 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
2480
-
2481
- var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
2482
-
2483
- var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
2484
-
2485
- var img$2 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
2486
-
2487
- var img$1 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
2488
-
2489
- var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
2490
-
2491
- // Takes a appType name and returns its logo as a data url.
2492
- // If appType does not exist the Digital.ai logo is returned.
2493
- var getLogoForAppType = function getLogoForAppType(appType) {
2494
- switch (appType) {
2495
- case 'Release':
2496
- {
2497
- return img$6;
2498
- }
2499
- case 'Deploy':
2500
- {
2501
- return img$5;
2502
- }
2503
- case 'Agility':
2504
- {
2505
- return img$4;
2506
- }
2507
- case 'Continuous Testing':
2508
- {
2509
- return img$3;
2510
- }
2511
- case 'Intelligence':
2512
- {
2513
- return img$2;
2514
- }
2515
- case 'Application Protection':
2516
- {
2517
- return img$1;
2518
- }
2519
- default:
2520
- {
2521
- return img;
2522
- }
2523
- }
2524
- };
2525
- var daiAppsHeaderMenuItem = function daiAppsHeaderMenuItem(count) {
2526
- if (count === void 0) {
2527
- count = 0;
2528
- }
2529
- return {
2530
- children: jsxRuntime.jsxs(DotTypography, __assign({
2531
- className: "dai-apps-title"
2532
- }, {
2533
- children: ["DIGITAL.AI APPLICATIONS", count > 0 ? " (" + count + ")" : '']
2534
- }), "menu-item-dai-apps-title"),
2535
- key: 'dai-apps-title',
2536
- disabled: true,
2537
- divider: true,
2538
- height: 32
2224
+ var closeActiveSubmenu = function closeActiveSubmenu() {
2225
+ // We want to clean active submenu state if it exists.
2226
+ // This will make previous submenu disappear when
2227
+ // hovering to item with no submenu items
2228
+ activeSubmenu && setActiveSubmenu(null);
2539
2229
  };
2540
- };
2541
- var createMenuItem = function createMenuItem(url, title, subtitle) {
2542
- if (subtitle === void 0) {
2543
- subtitle = null;
2544
- }
2545
- return jsxRuntime.jsxs("div", __assign({
2546
- className: "app-menu-item"
2547
- }, {
2548
- children: [jsxRuntime.jsx(DotLink, __assign({
2549
- href: url,
2550
- color: "textPrimary",
2551
- target: "_blank"
2552
- }, {
2553
- children: jsxRuntime.jsxs("div", __assign({
2554
- className: "logo-title"
2555
- }, {
2556
- children: [jsxRuntime.jsx(DotIcon, {
2557
- iconId: "open-new-tab"
2558
- }, void 0), jsxRuntime.jsxs("div", __assign({
2559
- className: "dot-app-switcher-app-title"
2560
- }, {
2561
- children: [jsxRuntime.jsx(DotTypography, __assign({
2562
- variant: "body1"
2563
- }, {
2564
- children: title
2565
- }), void 0), subtitle && jsxRuntime.jsx(DotTypography, __assign({
2566
- variant: "body2"
2567
- }, {
2568
- children: subtitle
2569
- }), void 0)]
2570
- }), void 0)]
2571
- }), void 0)
2572
- }), void 0), jsxRuntime.jsx(DotCopyButton, {
2573
- copyTooltip: "Copy application URL",
2574
- value: url
2575
- }, void 0)]
2576
- }), "app-menu-item-" + title);
2577
- };
2578
- var createTopLevelMenuItem = function createTopLevelMenuItem(url, logo, title, openNewTab) {
2579
- if (openNewTab === void 0) {
2580
- openNewTab = true;
2581
- }
2582
- // Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
2583
- // Empty state current application link
2584
- var target = openNewTab ? '_blank' : '_self';
2585
- return jsxRuntime.jsxs(DotLink, __assign({
2586
- href: url,
2587
- color: "textPrimary",
2588
- target: target
2230
+ var getMouseEnterHandler = function getMouseEnterHandler(itemKey, hasSubmenu) {
2231
+ return function (event) {
2232
+ hasSubmenu ? openSubmenu(event.currentTarget, itemKey) : closeActiveSubmenu();
2233
+ };
2234
+ };
2235
+ return jsxRuntime.jsx(StyledMenuList, __assign({
2236
+ classes: {
2237
+ root: rootClasses
2238
+ },
2239
+ "data-testid": dataTestId,
2240
+ dense: dense,
2241
+ id: id,
2242
+ onKeyDown: onKeyDown,
2243
+ style: {
2244
+ height: calculateMaxHeight({
2245
+ isDense: dense,
2246
+ maxVisibleItems: maxVisibleItems,
2247
+ menuItems: menuItems,
2248
+ menuItemHeight: menuItemHeight
2249
+ })
2250
+ }
2589
2251
  }, {
2590
- children: [jsxRuntime.jsxs("div", __assign({
2591
- className: "logo-title"
2592
- }, {
2593
- children: [jsxRuntime.jsx(DotAvatar, {
2594
- alt: "app image",
2595
- imageSrc: logo,
2596
- type: "image",
2597
- variant: "circular"
2598
- }, void 0), jsxRuntime.jsx("div", __assign({
2599
- className: "dot-app-switcher-app-title"
2252
+ children: menuItems.map(function (item, index) {
2253
+ var itemAriaLabel = item.ariaLabel,
2254
+ children = item.children,
2255
+ classes = item.classes,
2256
+ disabled = item.disabled,
2257
+ divider = item.divider,
2258
+ height = item.height,
2259
+ subItems = item.items,
2260
+ key = item.key;
2261
+ var itemHeight = calculateItemHeight(dense, height, menuItemHeight);
2262
+ var isSelected = checkIfMenuItemSelected(key, selectedKey, activeSubmenu);
2263
+ var isFirstItem = index === 0;
2264
+ var hasSubmenu = !!subItems;
2265
+ var hasAutoFocus = checkForAutoFocus(autoFocusItem, isFirstItem);
2266
+ var menuItemClasses = useStylesWithRootClass(listItemClassName$1, hasSubmenu ? listItemWithSubmenuClassName : '', classes ? classes : '');
2267
+ var handleClick = function handleClick(event) {
2268
+ // Execute select callback only for items which does not have
2269
+ // submenu defined. If there is no menu or handler - prevent
2270
+ // further propagation of the current event so that click on
2271
+ // items with submenu does not close the menu
2272
+ !hasSubmenu && onItemSelect ? onItemSelect(event, key) : event.stopPropagation();
2273
+ };
2274
+ /**
2275
+ * If there is submenu, right arrow icon will be added
2276
+ * and sub-menu will be rendered
2277
+ */
2278
+ return jsxRuntime.jsxs(material.MenuItem, __assign({
2279
+ autoFocus: hasAutoFocus,
2280
+ "aria-label": itemAriaLabel,
2281
+ className: menuItemClasses,
2282
+ disabled: disabled,
2283
+ disableRipple: hasSubmenu,
2284
+ divider: divider,
2285
+ onClick: handleClick,
2286
+ onMouseEnter: getMouseEnterHandler(key, hasSubmenu),
2287
+ ref: ref,
2288
+ style: {
2289
+ height: itemHeight
2290
+ },
2291
+ selected: isSelected
2600
2292
  }, {
2601
- children: jsxRuntime.jsx(DotTypography, __assign({
2602
- variant: "body1"
2603
- }, {
2604
- children: title
2605
- }), void 0)
2606
- }), void 0)]
2607
- }), void 0), openNewTab && jsxRuntime.jsx(DotIcon, {
2608
- iconId: "open-new-tab"
2609
- }, void 0)]
2610
- }), "top-menu-item-" + title);
2611
- };
2612
- var createAppTypeLabel = function createAppTypeLabel(appTypeName, logo, appProps) {
2613
- var logoProps = logo ? {
2614
- imageSrc: logo
2615
- } : {
2616
- iconId: 'collection'
2293
+ children: [children, hasSubmenu && jsxRuntime.jsx(DotIcon, {
2294
+ "data-testid": "dot-item-arrow-icon",
2295
+ iconId: "arrow-right"
2296
+ }, void 0), hasSubmenu && onSubMenuCreate({
2297
+ anchorElement: subItemAnchorEl,
2298
+ isOpened: isSelected,
2299
+ subMenuId: key,
2300
+ subMenuItems: subItems
2301
+ })]
2302
+ }), key);
2303
+ })
2304
+ }), void 0);
2305
+ });
2306
+
2307
+ var DotMenu = function DotMenu(_a) {
2308
+ var anchorEl = _a.anchorEl,
2309
+ ariaLabel = _a.ariaLabel,
2310
+ className = _a.className,
2311
+ dataTestId = _a["data-testid"],
2312
+ _b = _a.dense,
2313
+ dense = _b === void 0 ? true : _b,
2314
+ disablePortal = _a.disablePortal,
2315
+ id = _a.id,
2316
+ _c = _a.loading,
2317
+ loading = _c === void 0 ? false : _c,
2318
+ _d = _a.maxVisibleItems,
2319
+ maxVisibleItems = _d === void 0 ? DEFAULT_MAX_VISIBLE_ITEMS : _d,
2320
+ menuItemHeight = _a.menuItemHeight,
2321
+ _e = _a.menuItems,
2322
+ menuItems = _e === void 0 ? [] : _e,
2323
+ _f = _a.menuPlacement,
2324
+ menuPlacement = _f === void 0 ? 'bottom' : _f,
2325
+ onLeave = _a.onLeave,
2326
+ onSelect = _a.onSelect,
2327
+ _g = _a.open,
2328
+ open = _g === void 0 ? false : _g,
2329
+ selectedKey = _a.selectedKey;
2330
+ var rootClasses = useStylesWithRootClass(rootClassName$U, className, loading ? 'loading' : '');
2331
+ var isSubmenu = checkIfSubmenu(anchorEl);
2332
+ var hasSubItems = checkForSubItems(menuItems);
2333
+ // Timeout object is customizable when Menu component is either submenu
2334
+ // (it is opened within parent menu) or it contains at least one item which
2335
+ // has sub-items. This is done because when multi-level menu is closing it
2336
+ // will first close the parent and only then child menus - which looks
2337
+ // a bit weird - so here I'm giving it exit value of 0 so that it looks like
2338
+ // they all close at the same time. For "normal" menus, timeout is unnecessary.
2339
+ var timeout = isSubmenu || hasSubItems ? {
2340
+ exit: 0,
2341
+ enter: 300
2342
+ } : undefined;
2343
+ var handleSelect = function handleSelect(event, itemKey) {
2344
+ onLeave && onLeave(event);
2345
+ onSelect && onSelect(event, id, itemKey);
2617
2346
  };
2618
- return jsxRuntime.jsxs("div", __assign({
2619
- className: "logo-title"
2347
+ var handleListKeyDown = function handleListKeyDown(event) {
2348
+ if (onLeave && event.key === 'Tab') {
2349
+ event.preventDefault();
2350
+ onLeave(event);
2351
+ }
2352
+ };
2353
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2354
+ var handleClickAway = function handleClickAway(event) {
2355
+ if (onLeave && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
2356
+ onLeave(event);
2357
+ }
2358
+ };
2359
+ return jsxRuntime.jsx(StyledPopper, __assign({
2360
+ anchorEl: anchorEl,
2361
+ "aria-label": ariaLabel,
2362
+ className: rootClasses,
2363
+ "data-testid": dataTestId,
2364
+ disablePortal: disablePortal,
2365
+ open: open,
2366
+ placement: menuPlacement,
2367
+ role: undefined,
2368
+ transition: true
2620
2369
  }, {
2621
- children: [jsxRuntime.jsx(DotAvatar, __assign({}, logoProps, {
2622
- alt: "app image",
2623
- type: "image",
2624
- variant: "circular"
2625
- }), void 0), jsxRuntime.jsxs("div", __assign({
2626
- className: "dot-app-switcher-app-title"
2627
- }, {
2628
- children: [jsxRuntime.jsx(DotTypography, __assign({
2629
- variant: "body1"
2630
- }, {
2631
- children: appTypeName
2632
- }), void 0), jsxRuntime.jsxs(DotTypography, __assign({
2633
- variant: "body2"
2370
+ children: function (_a) {
2371
+ var TransitionProps = _a.TransitionProps,
2372
+ placement = _a.placement;
2373
+ return jsxRuntime.jsx(material.Fade, __assign({}, TransitionProps, {
2374
+ style: {
2375
+ transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
2376
+ },
2377
+ timeout: timeout
2634
2378
  }, {
2635
- children: ["Instance (", appProps.length, ")"]
2636
- }), void 0)]
2637
- }), void 0)]
2379
+ children: jsxRuntime.jsx(material.Paper, {
2380
+ children: jsxRuntime.jsx(material.ClickAwayListener, __assign({
2381
+ onClickAway: handleClickAway
2382
+ }, {
2383
+ children: loading ? jsxRuntime.jsx(DotProgress, {
2384
+ "data-testid": "loading-indicator",
2385
+ tooltip: "Loading Data...",
2386
+ value: 20
2387
+ }, void 0) : jsxRuntime.jsx(DotMenuList, {
2388
+ autoFocusItem: open,
2389
+ "data-testid": dataTestId + "-menu",
2390
+ dense: dense,
2391
+ id: id,
2392
+ maxVisibleItems: maxVisibleItems,
2393
+ menuItemHeight: menuItemHeight,
2394
+ menuItems: menuItems,
2395
+ onItemSelect: handleSelect,
2396
+ onKeyDown: handleListKeyDown,
2397
+ onSubMenuCreate: function (_a) {
2398
+ var anchorElement = _a.anchorElement,
2399
+ isOpened = _a.isOpened,
2400
+ subMenuId = _a.subMenuId,
2401
+ subMenuItems = _a.subMenuItems;
2402
+ return jsxRuntime.jsx(DotMenu, {
2403
+ anchorEl: anchorElement,
2404
+ menuPlacement: "right-start",
2405
+ id: subMenuId,
2406
+ menuItems: subMenuItems,
2407
+ open: isOpened,
2408
+ onLeave: onLeave,
2409
+ onSelect: onSelect,
2410
+ selectedKey: selectedKey
2411
+ }, void 0);
2412
+ },
2413
+ selectedKey: selectedKey
2414
+ }, void 0)
2415
+ }), void 0)
2416
+ }, void 0)
2417
+ }), void 0);
2418
+ }
2638
2419
  }), void 0);
2639
2420
  };
2640
- var getInstanceStateText = function getInstanceStateText(application) {
2641
- if (application.instance_state === 1) {
2642
- return 'Production instance';
2643
- }
2644
- return 'Non-production instance';
2421
+
2422
+ var CreateUUID = function CreateUUID() {
2423
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
2424
+ var r = Math.random() * 16 | 0,
2425
+ v = c === 'x' ? r : r & 0x3 | 0x8;
2426
+ return v.toString(16);
2427
+ });
2645
2428
  };
2646
2429
 
2647
- var rootClassName$T = 'dot-drawer';
2430
+ var rootClassName$S = 'dot-drawer';
2648
2431
  var StyledDrawer = styled__default["default"](material.Drawer).withConfig({
2649
2432
  displayName: "Drawerstyles__StyledDrawer",
2650
2433
  componentId: "sc-1uiowy0-0"
2651
- })(templateObject_2$U || (templateObject_2$U = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2434
+ })(templateObject_2$T || (templateObject_2$T = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2652
2435
  var theme = _a.theme;
2653
- return styled.css(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n &.", " .MuiBackdrop-root {\n background-color: ", ";\n }\n\n .dot-drawer-paper {\n height: ", ";\n padding: ", ";\n width: ", ";\n }\n "], ["\n &.", " .MuiBackdrop-root {\n background-color: ", ";\n }\n\n .dot-drawer-paper {\n height: ", ";\n padding: ", ";\n width: ", ";\n }\n "])), rootClassName$T, styles.alpha(theme.palette.grey[900], 0.7), function (_a) {
2436
+ return styled.css(templateObject_1$W || (templateObject_1$W = __makeTemplateObject(["\n &.", " .MuiBackdrop-root {\n background-color: ", ";\n }\n\n .dot-drawer-paper {\n height: ", ";\n padding: ", ";\n width: ", ";\n }\n "], ["\n &.", " .MuiBackdrop-root {\n background-color: ", ";\n }\n\n .dot-drawer-paper {\n height: ", ";\n padding: ", ";\n width: ", ";\n }\n "])), rootClassName$S, styles.alpha(theme.palette.grey[900], 0.7), function (_a) {
2654
2437
  var height = _a.height,
2655
2438
  anchor = _a.anchor;
2656
2439
  return anchor === 'left' || anchor === 'right' ? '100%' : height;
@@ -2660,17 +2443,72 @@
2660
2443
  return anchor === 'bottom' || anchor === 'top' ? 'auto' : width;
2661
2444
  });
2662
2445
  });
2663
- var templateObject_1$Y, templateObject_2$U;
2446
+ var templateObject_1$W, templateObject_2$T;
2664
2447
 
2665
- var rootClassName$S = 'dot-drawer-header';
2448
+ var rootClassName$R = 'dot-drawer-header';
2666
2449
  var StyleDrawerHeader = styled__default["default"].div.withConfig({
2667
2450
  displayName: "DrawerHeaderstyles__StyleDrawerHeader",
2668
2451
  componentId: "sc-2d2xd3-0"
2669
- })(templateObject_2$T || (templateObject_2$T = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2452
+ })(templateObject_2$S || (templateObject_2$S = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2670
2453
  var theme = _a.theme;
2671
- return styled.css(templateObject_1$X || (templateObject_1$X = __makeTemplateObject(["\n &.", " {\n padding: ", ";\n display: flex;\n align-items: center;\n .close-button {\n margin-left: auto;\n }\n }\n "], ["\n &.", " {\n padding: ", ";\n display: flex;\n align-items: center;\n .close-button {\n margin-left: auto;\n }\n }\n "])), rootClassName$S, theme.spacing(0, 0, 2));
2454
+ return styled.css(templateObject_1$V || (templateObject_1$V = __makeTemplateObject(["\n &.", " {\n padding: ", ";\n display: flex;\n align-items: center;\n .close-button {\n margin-left: auto;\n }\n }\n "], ["\n &.", " {\n padding: ", ";\n display: flex;\n align-items: center;\n .close-button {\n margin-left: auto;\n }\n }\n "])), rootClassName$R, theme.spacing(0, 0, 2));
2455
+ });
2456
+ var templateObject_1$V, templateObject_2$S;
2457
+
2458
+ var rootClassName$Q = 'dot-icon-btn';
2459
+ var StyledIconButton = styled__default["default"](material.IconButton).withConfig({
2460
+ displayName: "IconButtonstyles__StyledIconButton",
2461
+ componentId: "eko0kb-0"
2462
+ })(templateObject_2$R || (templateObject_2$R = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2463
+ return styled.css(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n &.", " {\n font-size: inherit;\n padding: 10px;\n\n .dot-icon.MuiIcon-fontSizeSmall {\n padding: 1px;\n }\n\n &.MuiIconButton-sizeSmall {\n padding: 3px;\n }\n\n &.ripple-disabled {\n &:hover, &:active, &:focus {\n background: ", ";\n }\n }\n "], ["\n &.", " {\n font-size: inherit;\n padding: 10px;\n\n .dot-icon.MuiIcon-fontSizeSmall {\n padding: 1px;\n }\n\n &.MuiIconButton-sizeSmall {\n padding: 3px;\n }\n\n &.ripple-disabled {\n &:hover, &:active, &:focus {\n background: ", ";\n }\n }\n "])), rootClassName$Q, hoverGray);
2672
2464
  });
2673
- var templateObject_1$X, templateObject_2$T;
2465
+ var templateObject_1$U, templateObject_2$R;
2466
+
2467
+ var DotIconButton = function DotIconButton(_a) {
2468
+ var ariaLabel = _a.ariaLabel,
2469
+ className = _a.className,
2470
+ _b = _a.color,
2471
+ color = _b === void 0 ? 'inherit' : _b,
2472
+ dataTestId = _a["data-testid"],
2473
+ _c = _a.disabled,
2474
+ disabled = _c === void 0 ? false : _c,
2475
+ _d = _a.disableRipple,
2476
+ disableRipple = _d === void 0 ? false : _d,
2477
+ iconId = _a.iconId,
2478
+ _e = _a.iconSize,
2479
+ iconSize = _e === void 0 ? 'small' : _e,
2480
+ onClick = _a.onClick,
2481
+ tooltip = _a.tooltip,
2482
+ _f = _a.size,
2483
+ size = _f === void 0 ? 'medium' : _f;
2484
+ var rippleClassName = disableRipple ? 'ripple-disabled' : '';
2485
+ var rootClasses = useStylesWithRootClass(rootClassName$Q, rippleClassName, className);
2486
+ return jsxRuntime.jsx(DotTooltip, __assign({
2487
+ "data-testid": "icon-button-tooltip",
2488
+ title: tooltip
2489
+ }, {
2490
+ children: jsxRuntime.jsx(StyledIconButton, __assign({
2491
+ "aria-label": ariaLabel,
2492
+ classes: {
2493
+ root: rootClasses
2494
+ },
2495
+ color: color,
2496
+ "data-testid": dataTestId,
2497
+ disableRipple: disableRipple,
2498
+ disabled: disabled,
2499
+ onClick: function (event) {
2500
+ return onClick && onClick(event);
2501
+ },
2502
+ size: size
2503
+ }, {
2504
+ children: jsxRuntime.jsx(DotIcon, {
2505
+ "data-testid": "button-icon",
2506
+ fontSize: iconSize,
2507
+ iconId: iconId
2508
+ }, void 0)
2509
+ }), void 0)
2510
+ }), void 0);
2511
+ };
2674
2512
 
2675
2513
  var DotDrawerHeader = function DotDrawerHeader(_a) {
2676
2514
  var ariaLabel = _a.ariaLabel,
@@ -2679,7 +2517,7 @@
2679
2517
  dataTestId = _a["data-testid"],
2680
2518
  onClose = _a.onClose,
2681
2519
  variant = _a.variant;
2682
- var rootClasses = useStylesWithRootClass(rootClassName$S, className);
2520
+ var rootClasses = useStylesWithRootClass(rootClassName$R, className);
2683
2521
  return jsxRuntime.jsxs(StyleDrawerHeader, __assign({
2684
2522
  "aria-label": ariaLabel,
2685
2523
  className: rootClasses,
@@ -2693,14 +2531,14 @@
2693
2531
  }), void 0);
2694
2532
  };
2695
2533
 
2696
- var rootClassName$R = 'dot-drawer-body';
2534
+ var rootClassName$P = 'dot-drawer-body';
2697
2535
  var StyleDrawerBody = styled__default["default"].div.withConfig({
2698
2536
  displayName: "DrawerBodystyles__StyleDrawerBody",
2699
2537
  componentId: "sc-1mpmjdk-0"
2700
- })(templateObject_2$S || (templateObject_2$S = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2701
- return styled.css(templateObject_1$W || (templateObject_1$W = __makeTemplateObject(["\n &.", " {\n display: flex;\n .dot-drawer-close-button {\n align-self: self-start;\n padding: 0;\n margin-left: auto;\n }\n }\n "], ["\n &.", " {\n display: flex;\n .dot-drawer-close-button {\n align-self: self-start;\n padding: 0;\n margin-left: auto;\n }\n }\n "])), rootClassName$R);
2538
+ })(templateObject_2$Q || (templateObject_2$Q = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
2539
+ return styled.css(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n &.", " {\n display: flex;\n .dot-drawer-close-button {\n align-self: self-start;\n padding: 0;\n margin-left: auto;\n }\n }\n "], ["\n &.", " {\n display: flex;\n .dot-drawer-close-button {\n align-self: self-start;\n padding: 0;\n margin-left: auto;\n }\n }\n "])), rootClassName$P);
2702
2540
  });
2703
- var templateObject_1$W, templateObject_2$S;
2541
+ var templateObject_1$T, templateObject_2$Q;
2704
2542
 
2705
2543
  var DotDrawerBody = function DotDrawerBody(_a) {
2706
2544
  var ariaLabel = _a.ariaLabel,
@@ -2710,7 +2548,7 @@
2710
2548
  headerExists = _a.headerExists,
2711
2549
  onClose = _a.onClose,
2712
2550
  variant = _a.variant;
2713
- var rootClasses = useStylesWithRootClass(rootClassName$R, className);
2551
+ var rootClasses = useStylesWithRootClass(rootClassName$P, className);
2714
2552
  return jsxRuntime.jsxs(StyleDrawerBody, __assign({
2715
2553
  "aria-label": ariaLabel,
2716
2554
  className: rootClasses,
@@ -2724,22 +2562,22 @@
2724
2562
  }), void 0);
2725
2563
  };
2726
2564
 
2727
- var rootClassName$Q = 'dot-drawer-footer';
2565
+ var rootClassName$O = 'dot-drawer-footer';
2728
2566
  var StyleDrawerFooter = styled__default["default"].div.withConfig({
2729
2567
  displayName: "DrawerFooterstyles__StyleDrawerFooter",
2730
2568
  componentId: "sc-1ki05ze-0"
2731
- })(templateObject_2$R || (templateObject_2$R = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2569
+ })(templateObject_2$P || (templateObject_2$P = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2732
2570
  var theme = _a.theme;
2733
- return styled.css(templateObject_1$V || (templateObject_1$V = __makeTemplateObject(["\n &.", " {\n padding: ", ";\n }\n "], ["\n &.", " {\n padding: ", ";\n }\n "])), rootClassName$Q, theme.spacing(2, 0, 0));
2571
+ return styled.css(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n &.", " {\n padding: ", ";\n }\n "], ["\n &.", " {\n padding: ", ";\n }\n "])), rootClassName$O, theme.spacing(2, 0, 0));
2734
2572
  });
2735
- var templateObject_1$V, templateObject_2$R;
2573
+ var templateObject_1$S, templateObject_2$P;
2736
2574
 
2737
2575
  var DotDrawerFooter = function DotDrawerFooter(_a) {
2738
2576
  var ariaLabel = _a.ariaLabel,
2739
2577
  children = _a.children,
2740
2578
  className = _a.className,
2741
2579
  dataTestId = _a["data-testid"];
2742
- var rootClasses = useStylesWithRootClass(rootClassName$Q, className);
2580
+ var rootClasses = useStylesWithRootClass(rootClassName$O, className);
2743
2581
  return jsxRuntime.jsx(StyleDrawerFooter, __assign({
2744
2582
  "aria-label": ariaLabel,
2745
2583
  className: rootClasses,
@@ -2778,7 +2616,7 @@
2778
2616
  onClose(event);
2779
2617
  }
2780
2618
  };
2781
- var rootClasses = useStylesWithRootClass(rootClassName$T, className);
2619
+ var rootClasses = useStylesWithRootClass(rootClassName$S, className);
2782
2620
  var headerExists = !!drawerHeaderProps;
2783
2621
  var bodyTestId = drawerBodyProps ? drawerBodyProps["data-testid"] : 'drawer-body';
2784
2622
  return jsxRuntime.jsxs(StyledDrawer, __assign({
@@ -2821,1061 +2659,1325 @@
2821
2659
  }), void 0);
2822
2660
  };
2823
2661
 
2824
- var rootClassName$P = 'dot-app-switcher';
2825
- var StyledAppSwitcher = styled__default["default"](DotDrawer).withConfig({
2826
- displayName: "AppSwitcherstyles__StyledAppSwitcher",
2827
- componentId: "hhxfqg-0"
2828
- })(templateObject_2$Q || (templateObject_2$Q = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2829
- var theme = _a.theme;
2830
- return styled.css(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n &.", " {\n .app-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .dot-link,\n .product-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 64px;\n text-decoration: none;\n cursor: pointer;\n }\n .logo-title {\n display: flex;\n align-items: center;\n gap: 24px;\n width: 100%;\n }\n .dot-avatar {\n flex-basis: 40px;\n }\n .dai-apps-title {\n display: flex;\n align-items: center;\n height: 32px;\n padding: ", ";\n background-color: ", ";\n }\n .dot-app-switcher-app-title {\n min-width: 150px;\n }\n .dot-icon {\n flex-basis: content;\n }\n .app-switcher-header {\n .app-switcher-header-title {\n padding-left: ", ";\n display: flex;\n align-items: center;\n }\n display: flex;\n justify-content: space-between;\n align-items: end;\n border-bottom: 1px solid ", ";\n margin: ", ";\n padding-bottom: ", ";\n .app-switcher-label {\n padding-left: ", ";\n }\n }\n .app-switcher-back-button {\n &.dot-button.MuiButton-text {\n padding-left: 0;\n }\n }\n .product-heading {\n display: flex;\n align-items: center;\n gap: 24px;\n padding-bottom: ", ";\n }\n .product-applications {\n width: 100%;\n overflow-y: auto;\n }\n .product-applications-search {\n margin-bottom: ", ";\n }\n }\n "], ["\n &.", " {\n .app-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .dot-link,\n .product-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 64px;\n text-decoration: none;\n cursor: pointer;\n }\n .logo-title {\n display: flex;\n align-items: center;\n gap: 24px;\n width: 100%;\n }\n .dot-avatar {\n flex-basis: 40px;\n }\n .dai-apps-title {\n display: flex;\n align-items: center;\n height: 32px;\n padding: ", ";\n background-color: ", ";\n }\n .dot-app-switcher-app-title {\n min-width: 150px;\n }\n .dot-icon {\n flex-basis: content;\n }\n .app-switcher-header {\n .app-switcher-header-title {\n padding-left: ", ";\n display: flex;\n align-items: center;\n }\n display: flex;\n justify-content: space-between;\n align-items: end;\n border-bottom: 1px solid ", ";\n margin: ", ";\n padding-bottom: ", ";\n .app-switcher-label {\n padding-left: ", ";\n }\n }\n .app-switcher-back-button {\n &.dot-button.MuiButton-text {\n padding-left: 0;\n }\n }\n .product-heading {\n display: flex;\n align-items: center;\n gap: 24px;\n padding-bottom: ", ";\n }\n .product-applications {\n width: 100%;\n overflow-y: auto;\n }\n .product-applications-search {\n margin-bottom: ", ";\n }\n }\n "])), rootClassName$P, theme.spacing(0, 0, 0, 1), theme.palette.grey[50], theme.spacing(2), theme.palette.grey[200], theme.spacing(0, -2, 2), theme.spacing(1), theme.spacing(3), theme.spacing(3), theme.spacing(3));
2662
+ var fadeIn = styled.keyframes(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"], ["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
2663
+ var StyledDotDrawer = styled__default["default"](DotDrawer).withConfig({
2664
+ displayName: "NestedListstyles__StyledDotDrawer",
2665
+ componentId: "sc-1wwoqos-0"
2666
+ })(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
2667
+ var open = _a.open;
2668
+ return styled.css(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n &.", " {\n .dot-drawer-paper {\n z-index: ", ";\n animation: ", ";\n }\n }\n "], ["\n &.", " {\n .dot-drawer-paper {\n z-index: ", ";\n animation: ", ";\n }\n }\n "])), nestedDrawerClassName, open ? levelFirst : levelBottom, open && styled.css(templateObject_2$O || (templateObject_2$O = __makeTemplateObject(["\n ", " 0.2s cubic-bezier(1,0,1,.01);\n "], ["\n ", " 0.2s cubic-bezier(1,0,1,.01);\n "])), fadeIn));
2831
2669
  });
2832
- var templateObject_1$U, templateObject_2$Q;
2670
+ var templateObject_1$R, templateObject_2$O, templateObject_3$8, templateObject_4$6;
2833
2671
 
2834
- var DotAppSwitcherView = function DotAppSwitcherView(_a) {
2835
- var activeApp = _a.activeApp,
2836
- apps = _a.apps,
2837
- className = _a.className,
2838
- _b = _a.noAppTypeLabel,
2839
- noAppTypeLabel = _b === void 0 ? 'Other' : _b,
2840
- platformConsoleUrl = _a.platformConsoleUrl,
2841
- onClose = _a.onClose,
2842
- open = _a.open,
2843
- _c = _a.searchInstancesThreshold,
2844
- searchInstancesThreshold = _c === void 0 ? 5 : _c,
2845
- selectedAppType = _a.selectedAppType,
2846
- _d = _a.yOffset,
2847
- yOffset = _d === void 0 ? 48 : _d,
2848
- _e = _a.zIndex,
2849
- zIndex = _e === void 0 ? 990 : _e;
2850
- var dotCoreApiContext = useDotCoreApiContext();
2851
- var setSelectedAppType = null;
2852
- if (dotCoreApiContext !== null) {
2853
- setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
2854
- }
2855
- var rootClasses = useStylesWithRootClass(rootClassName$P, className);
2856
- var _f = React.useState(),
2857
- appTypeMap = _f[0],
2858
- setAppTypeMap = _f[1];
2859
- var _g = React.useState(),
2860
- appTypeLabels = _g[0],
2861
- setAppTypeLabels = _g[1];
2862
- var _h = React.useState(),
2863
- appTypeMenuItems = _h[0],
2864
- setAppTypeMenuItems = _h[1];
2865
- var _j = React.useState(null),
2866
- selectedAppTypeAlt = _j[0],
2867
- setSelectedAppTypeAlt = _j[1];
2868
- var _k = React.useState(''),
2869
- searchText = _k[0],
2870
- setSearchText = _k[1];
2871
- if (!setSelectedAppType) {
2872
- selectedAppType = selectedAppTypeAlt;
2873
- setSelectedAppType = setSelectedAppTypeAlt;
2672
+ var DEFAULT_TOOLTIP_PLACEMENT = 'top-start';
2673
+ var DotListDivider = function DotListDivider(_a) {
2674
+ var item = _a.item,
2675
+ index = _a.index;
2676
+ if (item.text) {
2677
+ return jsxRuntime.jsx(material.ListSubheader, __assign({
2678
+ disableSticky: true
2679
+ }, {
2680
+ children: jsxRuntime.jsx(DotTypography, __assign({
2681
+ variant: "overline"
2682
+ }, {
2683
+ children: item.text
2684
+ }), void 0)
2685
+ }), void 0);
2874
2686
  }
2875
- var showApps = React.useCallback(function (appType) {
2876
- setSelectedAppType(appType);
2877
- }, []);
2878
- var showAppTypes = React.useCallback(function () {
2879
- setSearchText('');
2880
- setSelectedAppType(null);
2881
- }, []);
2882
- var populateAppTypeMap = React.useCallback(function () {
2883
- var newAppTypeMap = new Map();
2884
- // we'll put Other at the end
2885
- var otherApps = [];
2886
- apps === null || apps === void 0 ? void 0 : apps.forEach(function (app) {
2887
- var instanceStateText = getInstanceStateText(app);
2888
- var children = createMenuItem(app.url, app.name, instanceStateText);
2889
- var searchableContent = app.name + " " + instanceStateText;
2890
- var appTypeName = app.logo_product_name;
2891
- var appTypeApps;
2892
- if (appTypeName) {
2893
- appTypeApps = newAppTypeMap.get(appTypeName);
2894
- if (!appTypeApps) {
2895
- appTypeApps = [];
2896
- newAppTypeMap.set(appTypeName, appTypeApps);
2897
- }
2898
- } else {
2899
- appTypeApps = otherApps;
2900
- }
2901
- appTypeApps.push({
2902
- children: children,
2903
- searchableContent: searchableContent,
2904
- key: app.id,
2905
- height: 64
2906
- });
2907
- });
2908
- var keys = Array.from(newAppTypeMap.keys()).sort();
2909
- var sortedAppTypeMap = new Map();
2910
- for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
2911
- var appType = keys_1[_i];
2912
- sortedAppTypeMap.set(appType, newAppTypeMap.get(appType));
2913
- }
2914
- var appTypeCount = sortedAppTypeMap.size;
2915
- if (platformConsoleUrl) {
2916
- appTypeCount++;
2917
- }
2918
- if (otherApps.length > 0) {
2919
- sortedAppTypeMap.set(noAppTypeLabel, otherApps);
2920
- }
2921
- setAppTypeMap(sortedAppTypeMap);
2922
- var menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
2923
- if (platformConsoleUrl) {
2924
- var children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
2925
- menuItems.push({
2926
- children: children,
2927
- key: 'app-switcher-platform-link',
2928
- height: 64
2929
- });
2930
- }
2931
- var newAppTypeLabels = new Map();
2932
- sortedAppTypeMap.forEach(function (singleTypeApps, appTypeName) {
2933
- if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
2934
- var logo = appTypeName === noAppTypeLabel ? null : getLogoForAppType(appTypeName);
2935
- newAppTypeLabels.set(appTypeName, {
2936
- logo: logo,
2937
- singleTypeApps: singleTypeApps
2938
- });
2939
- menuItems.push({
2940
- children: jsxRuntime.jsxs("div", __assign({
2941
- className: "product-menu-item",
2942
- onClick: function () {
2943
- return showApps(appTypeName);
2944
- }
2945
- }, {
2946
- children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsxRuntime.jsx(DotIcon, {
2947
- iconId: "chevron-right"
2948
- }, void 0)]
2949
- }), "menu-item-" + appTypeName),
2950
- key: appTypeName,
2951
- height: 64
2952
- });
2953
- }
2954
- });
2955
- setAppTypeMenuItems(menuItems);
2956
- setAppTypeLabels(newAppTypeLabels);
2957
- }, [apps]);
2958
- var emptyState = React.useCallback(function () {
2959
- var currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
2960
- setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
2961
- children: currentAppMenuItem,
2962
- key: 'no_applications_configured',
2963
- height: 64,
2964
- disabled: true
2965
- }]);
2966
- }, [activeApp]);
2967
- React.useEffect(function () {
2968
- if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
2969
- populateAppTypeMap();
2970
- } else {
2971
- emptyState();
2687
+ return jsxRuntime.jsx(material.Divider, {
2688
+ "aria-hidden": true,
2689
+ "data-testid": "divider-" + index
2690
+ }, void 0);
2691
+ };
2692
+ var DotList = function DotList(_a) {
2693
+ var ariaLabel = _a.ariaLabel,
2694
+ children = _a.children,
2695
+ className = _a.className,
2696
+ _b = _a.component,
2697
+ component = _b === void 0 ? 'ul' : _b,
2698
+ dataTestId = _a["data-testid"],
2699
+ _c = _a.dense,
2700
+ dense = _c === void 0 ? false : _c,
2701
+ _d = _a.disablePadding,
2702
+ disablePadding = _d === void 0 ? false : _d,
2703
+ _e = _a.items,
2704
+ items = _e === void 0 ? [] : _e,
2705
+ _f = _a.menuPlacement,
2706
+ menuPlacement = _f === void 0 ? 'right-start' : _f,
2707
+ _g = _a.nestedDrawerLeftSpacing,
2708
+ nestedDrawerLeftSpacing = _g === void 0 ? 240 : _g,
2709
+ _h = _a.nestedListType,
2710
+ nestedListType = _h === void 0 ? 'expandable' : _h,
2711
+ _j = _a.width,
2712
+ width = _j === void 0 ? 240 : _j;
2713
+ var rootClasses = useStylesWithRootClass(rootClassName$X, className);
2714
+ var listWidth = typeof width === 'number' ? width + "px" : width;
2715
+ var listRef = React.useRef();
2716
+ var _k = React.useState(null),
2717
+ listItemIndex = _k[0],
2718
+ setListItemIndex = _k[1];
2719
+ var updateSelectedListItem = function updateSelectedListItem(currentIndex) {
2720
+ currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
2721
+ };
2722
+ return jsxRuntime.jsxs(StyledList, __assign({
2723
+ "aria-label": ariaLabel,
2724
+ classes: {
2725
+ root: rootClasses
2726
+ },
2727
+ component: component,
2728
+ "data-testid": dataTestId,
2729
+ dense: dense,
2730
+ disablePadding: disablePadding,
2731
+ ref: listRef,
2732
+ style: {
2733
+ width: listWidth
2972
2734
  }
2973
- }, [apps]);
2974
- var onAppInstanceSearchTextChange = React.useCallback(function (text) {
2975
- setSearchText(text);
2976
- }, []);
2977
- var clearAppInstanceSearchText = React.useCallback(function () {
2978
- setSearchText('');
2979
- }, []);
2980
- var closeHandler = React.useCallback(function (event) {
2981
- setSearchText('');
2982
- onClose && onClose(event);
2983
- }, [onClose]);
2984
- var filteredAppInstances = React.useCallback(function () {
2985
- var _a;
2986
- return (_a = appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
2987
- var isMatch = !searchText;
2988
- if (searchText) {
2989
- var testStr = isLowerCase(searchText) ? item.searchableContent.toLowerCase() : item.searchableContent;
2990
- isMatch = testStr.indexOf(searchText) >= 0;
2991
- }
2992
- return isMatch;
2993
- }).map(function (item) {
2994
- return item.children;
2995
- });
2996
- }, [appTypeMap, selectedAppType, searchText]);
2997
- var content = function content() {
2998
- var _a;
2999
- if (selectedAppType && appTypeMap && appTypeLabels) {
3000
- var labelConfig = appTypeLabels.get(selectedAppType);
3001
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
3002
- children: [jsxRuntime.jsx("span", {
3003
- children: jsxRuntime.jsx(DotButton, __assign({
3004
- className: "app-switcher-back-button",
3005
- type: "text",
3006
- onClick: showAppTypes,
3007
- startIcon: jsxRuntime.jsx(DotIcon, {
3008
- iconId: "back"
3009
- }, void 0)
3010
- }, {
3011
- children: jsxRuntime.jsx("span", {
3012
- children: "Back"
3013
- }, void 0)
3014
- }), void 0)
3015
- }, void 0), jsxRuntime.jsx("div", __assign({
3016
- className: "product-heading"
3017
- }, {
3018
- children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
3019
- }), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= searchInstancesThreshold && jsxRuntime.jsx("div", {
3020
- children: jsxRuntime.jsx(SearchInput, {
3021
- "data-testid": "app-instance-search-input",
3022
- onChange: onAppInstanceSearchTextChange,
3023
- onClear: clearAppInstanceSearchText,
3024
- value: searchText
3025
- }, void 0)
3026
- }, void 0), jsxRuntime.jsx("div", __assign({
3027
- className: "product-applications"
3028
- }, {
3029
- children: filteredAppInstances()
3030
- }), void 0)]
2735
+ }, {
2736
+ children: [items.map(function (item, index) {
2737
+ var handleListItemClick = function handleListItemClick(e) {
2738
+ var _a;
2739
+ updateSelectedListItem(index);
2740
+ (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
2741
+ };
2742
+ var handleMenuLeave = function handleMenuLeave(event) {
2743
+ var _a, _b;
2744
+ // Remove index only if clicked element is not found within the list
2745
+ if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
2746
+ setListItemIndex(null);
2747
+ (_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
2748
+ }
2749
+ };
2750
+ if (item.child) {
2751
+ return jsxRuntime.jsx(React.Fragment, {
2752
+ children: item.child
2753
+ }, "item-child-" + index);
2754
+ }
2755
+ if (item.divider) {
2756
+ return jsxRuntime.jsx(DotListDivider, {
2757
+ index: index,
2758
+ item: item
2759
+ }, "divider-" + index);
2760
+ }
2761
+ return jsxRuntime.jsx(DotListItem, {
2762
+ className: item.className,
2763
+ component: item.component,
2764
+ "data-testid": dataTestId + "-item-" + index,
2765
+ endIcon: item.endIcon,
2766
+ href: item.href,
2767
+ isOpened: listItemIndex === index,
2768
+ items: item.items,
2769
+ menuPlacement: menuPlacement,
2770
+ nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
2771
+ nestedListType: nestedListType,
2772
+ onClick: item.href && !item.onClick ? null : handleListItemClick,
2773
+ onMenuLeave: handleMenuLeave,
2774
+ primaryText: item.primaryText,
2775
+ secondaryText: item.secondaryText,
2776
+ selected: item.selected,
2777
+ startIcon: item.startIcon,
2778
+ target: item.target,
2779
+ text: item.text,
2780
+ tooltip: item.tooltip,
2781
+ tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
2782
+ }, index);
2783
+ }), children]
2784
+ }), void 0);
2785
+ };
2786
+ var DotListItem = function DotListItem(_a) {
2787
+ var ariaLabel = _a.ariaLabel,
2788
+ className = _a.className,
2789
+ _b = _a.component,
2790
+ component = _b === void 0 ? 'li' : _b,
2791
+ dataTestId = _a["data-testid"],
2792
+ _c = _a.divider,
2793
+ divider = _c === void 0 ? false : _c,
2794
+ endIcon = _a.endIcon,
2795
+ href = _a.href,
2796
+ isOpened = _a.isOpened,
2797
+ onClick = _a.onClick,
2798
+ onMenuLeave = _a.onMenuLeave,
2799
+ _d = _a.items,
2800
+ items = _d === void 0 ? [] : _d,
2801
+ menuPlacement = _a.menuPlacement,
2802
+ nestedDrawerLeftSpacing = _a.nestedDrawerLeftSpacing,
2803
+ nestedListType = _a.nestedListType,
2804
+ primaryText = _a.primaryText,
2805
+ secondaryText = _a.secondaryText,
2806
+ selected = _a.selected,
2807
+ startIcon = _a.startIcon,
2808
+ target = _a.target,
2809
+ text = _a.text,
2810
+ tooltip = _a.tooltip,
2811
+ _e = _a.tooltipPlacement,
2812
+ tooltipPlacement = _e === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _e;
2813
+ var hasChildren = items.length > 0;
2814
+ var isFlyout = nestedListType === 'menu' && hasChildren;
2815
+ var _f = React.useState(null),
2816
+ anchorEl = _f[0],
2817
+ setAnchorEl = _f[1];
2818
+ var showEndIcon = endIcon || hasChildren;
2819
+ var rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
2820
+ var toggleOpen = function toggleOpen(event) {
2821
+ return setAnchorEl(event.currentTarget);
2822
+ };
2823
+ var handleClick = function handleClick(event) {
2824
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
2825
+ toggleOpen(event);
2826
+ };
2827
+ var handleMenuLeave = function handleMenuLeave(event) {
2828
+ return onMenuLeave(event);
2829
+ };
2830
+ var renderListItemText = function renderListItemText() {
2831
+ return primaryText && secondaryText ? jsxRuntime.jsx(material.ListItemText, {
2832
+ primary: primaryText,
2833
+ secondary: secondaryText
2834
+ }, void 0) : jsxRuntime.jsx(DotTypography, __assign({
2835
+ variant: "body1"
2836
+ }, {
2837
+ children: text
2838
+ }), void 0);
2839
+ };
2840
+ var renderListItemEndIcon = function renderListItemEndIcon() {
2841
+ if (hasChildren || !endIcon) {
2842
+ return jsxRuntime.jsx(DotIcon, {
2843
+ iconId: hasChildren && getChevronIcon(nestedListType, isOpened)
3031
2844
  }, void 0);
3032
2845
  }
3033
- return appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(function (item) {
3034
- return item.children;
3035
- });
2846
+ return endIcon;
3036
2847
  };
3037
- var header = {
3038
- className: 'app-switcher-header',
3039
- children: jsxRuntime.jsxs("div", __assign({
3040
- className: "app-switcher-header-title",
3041
- style: {
3042
- marginTop: yOffset + 'px',
3043
- width: '80%'
3044
- }
2848
+ return jsxRuntime.jsxs(jsxRuntime.Fragment, {
2849
+ children: [jsxRuntime.jsx(DotTooltip, __assign({
2850
+ "data-testid": dataTestId + "-tooltip",
2851
+ placement: tooltipPlacement,
2852
+ title: tooltip
3045
2853
  }, {
3046
- children: [jsxRuntime.jsx(DotAvatar, {
3047
- iconId: "apps",
3048
- alt: "app image",
3049
- type: "image",
3050
- variant: "circular"
3051
- }, void 0), jsxRuntime.jsx(DotTypography, __assign({
3052
- className: "app-switcher-label"
2854
+ children: jsxRuntime.jsxs(StyledListItem, __assign({
2855
+ "aria-label": ariaLabel,
2856
+ button: true,
2857
+ classes: {
2858
+ root: rootClasses
2859
+ },
2860
+ component: href && !onClick ? 'a' : component,
2861
+ "data-testid": dataTestId,
2862
+ divider: divider,
2863
+ href: onClick ? null : href,
2864
+ onClick: onClick || !href ? handleClick : null,
2865
+ selected: isFlyout ? isOpened : selected,
2866
+ target: target
3053
2867
  }, {
3054
- children: "App switcher"
3055
- }), void 0)]
3056
- }), void 0)
3057
- };
3058
- return jsxRuntime.jsx(StyledAppSwitcher, __assign({
3059
- className: rootClasses,
3060
- ModalProps: {
3061
- style: {
3062
- zIndex: zIndex
3063
- },
3064
- hideBackdrop: true
3065
- },
3066
- drawerHeaderProps: header,
3067
- variant: "temporary",
3068
- width: "340px",
3069
- open: open,
3070
- onClose: closeHandler
3071
- }, {
3072
- children: content()
3073
- }), void 0);
2868
+ children: [jsxRuntime.jsxs("span", __assign({
2869
+ className: listItemLinkClassName
2870
+ }, {
2871
+ children: [startIcon && jsxRuntime.jsx(material.ListItemIcon, {
2872
+ children: startIcon
2873
+ }, void 0), renderListItemText()]
2874
+ }), void 0), showEndIcon && renderListItemEndIcon()]
2875
+ }), void 0)
2876
+ }), void 0), hasChildren && jsxRuntime.jsx(NestedList, {
2877
+ anchorEl: anchorEl,
2878
+ ariaLabel: "nested list",
2879
+ "data-testid": "nestedList",
2880
+ items: items,
2881
+ menuPlacement: menuPlacement,
2882
+ nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
2883
+ onMenuLeave: handleMenuLeave,
2884
+ open: isOpened,
2885
+ type: nestedListType
2886
+ }, void 0)]
2887
+ }, void 0);
3074
2888
  };
3075
- var DotAppSwitcher = function DotAppSwitcher(_a) {
3076
- var accountId = _a.accountId,
3077
- _b = _a.includePlatformConsole,
3078
- includePlatformConsole = _b === void 0 ? true : _b,
3079
- onClose = _a.onClose,
3080
- commonProps = __rest(_a, ["accountId", "includePlatformConsole", "onClose"]);
3081
- var _c = useDotCoreApiContext(),
3082
- applications = _c.applications,
3083
- applicationsLoading = _c.applicationsLoading,
3084
- applicationsError = _c.applicationsError,
3085
- loadApplications = _c.loadApplications,
3086
- open = _c.isAppSwitcherOpen,
3087
- platformConsoleUrl = _c.platformConsoleUrl,
3088
- setOpen = _c.setIsAppSwitcherOpen,
3089
- selectedAppType = _c.selectedAppSwitcherAppType,
3090
- setSelectedAppType = _c.setSelectedAppSwitcherAppType;
3091
- React.useEffect(function () {
3092
- if ((!applications || applications.length === 0) && open) {
3093
- loadApplications(accountId);
3094
- }
3095
- }, [accountId, open]);
3096
- if (applicationsError) {
3097
- console.error('Error loading application list in AppSwitcher', applicationsError);
2889
+ var NestedList = function NestedList(_a) {
2890
+ var ariaLabel = _a.ariaLabel,
2891
+ anchorEl = _a.anchorEl,
2892
+ dataTestId = _a["data-testid"],
2893
+ items = _a.items,
2894
+ menuPlacement = _a.menuPlacement,
2895
+ nestedDrawerLeftSpacing = _a.nestedDrawerLeftSpacing,
2896
+ onMenuLeave = _a.onMenuLeave,
2897
+ open = _a.open,
2898
+ parentItemIndex = _a.parentItemIndex,
2899
+ type = _a.type;
2900
+ var flyoutItemClasses = useStylesWithRootClass(listItemRootClass, flyoutListItemClassName);
2901
+ var flyoutSpanClasses = useStylesWithRootClass(listItemLinkClassName, flyoutItemLinkClassName);
2902
+ if (type === 'expandable') {
2903
+ return jsxRuntime.jsx(material.Collapse, __assign({
2904
+ in: open,
2905
+ timeout: "auto",
2906
+ unmountOnExit: true
2907
+ }, {
2908
+ children: jsxRuntime.jsx(DotList, {
2909
+ ariaLabel: ariaLabel,
2910
+ className: nestedListClassName,
2911
+ component: "div",
2912
+ "data-testid": dataTestId,
2913
+ disablePadding: true,
2914
+ items: items
2915
+ }, parentItemIndex)
2916
+ }), void 0);
2917
+ }
2918
+ if (type === 'menu') {
2919
+ var menuItems = items.map(function (item, index) {
2920
+ var href = item.href,
2921
+ target = item.target,
2922
+ onClick = item.onClick,
2923
+ tooltip = item.tooltip,
2924
+ _a = item.tooltipPlacement,
2925
+ tooltipPlacement = _a === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _a,
2926
+ text = item.text;
2927
+ return {
2928
+ children: jsxRuntime.jsx(DotTooltip, __assign({
2929
+ placement: tooltipPlacement,
2930
+ title: tooltip
2931
+ }, {
2932
+ children: jsxRuntime.jsx(StyledListItem, __assign({
2933
+ className: flyoutItemClasses,
2934
+ component: href && !onClick ? 'a' : null,
2935
+ "data-testid": dataTestId + "-item-" + index,
2936
+ href: href,
2937
+ onClick: onClick,
2938
+ target: target
2939
+ }, {
2940
+ children: jsxRuntime.jsxs("span", __assign({
2941
+ className: flyoutSpanClasses
2942
+ }, {
2943
+ children: [item.startIcon, jsxRuntime.jsx(DotTypography, __assign({
2944
+ variant: "body1"
2945
+ }, {
2946
+ children: text
2947
+ }), void 0)]
2948
+ }), void 0)
2949
+ }), parentItemIndex + "-" + index)
2950
+ }), parentItemIndex + "-" + index + "-tooltip"),
2951
+ classes: '',
2952
+ key: String(index)
2953
+ };
2954
+ });
2955
+ return jsxRuntime.jsx(DotMenu, {
2956
+ anchorEl: anchorEl,
2957
+ ariaLabel: ariaLabel,
2958
+ className: flyoutMenuClassName,
2959
+ "data-testid": dataTestId,
2960
+ id: CreateUUID(),
2961
+ menuItemHeight: "auto",
2962
+ menuItems: menuItems,
2963
+ menuPlacement: menuPlacement,
2964
+ onLeave: onMenuLeave,
2965
+ open: open
2966
+ }, parentItemIndex);
3098
2967
  }
3099
- var closeHandler = React.useCallback(function (event) {
3100
- setOpen(false);
3101
- setSelectedAppType(null);
3102
- onClose && onClose(event);
3103
- }, [onClose]);
3104
- var viewProps = includePlatformConsole ? __assign(__assign({}, commonProps), {
3105
- platformConsoleUrl: platformConsoleUrl
3106
- }) : __assign({}, commonProps);
3107
- if (!applicationsLoading && !applicationsError) {
3108
- return jsxRuntime.jsx(DotAppSwitcherView, __assign({}, viewProps, {
2968
+ if (type === 'drawer') {
2969
+ return jsxRuntime.jsx(StyledDotDrawer, __assign({
2970
+ PaperProps: {
2971
+ style: {
2972
+ left: nestedDrawerLeftSpacing + "px"
2973
+ }
2974
+ },
2975
+ anchor: "left",
2976
+ className: nestedDrawerClassName,
2977
+ "data-testid": "nested-drawer",
3109
2978
  open: open,
3110
- apps: applications,
3111
- selectedAppType: selectedAppType,
3112
- onClose: closeHandler
2979
+ variant: "persistent"
2980
+ }, {
2981
+ children: jsxRuntime.jsx(DotList, {
2982
+ ariaLabel: ariaLabel,
2983
+ className: nestedListClassName,
2984
+ component: "div",
2985
+ "data-testid": dataTestId,
2986
+ disablePadding: true,
2987
+ items: items,
2988
+ width: '100%'
2989
+ }, parentItemIndex)
3113
2990
  }), void 0);
3114
2991
  }
3115
- return null;
3116
2992
  };
3117
2993
 
3118
- var rootClassName$O = 'dot-list';
3119
- var listItemRootClass = 'dot-list-item';
3120
- var nestedListClassName = 'dot-nested-list';
3121
- var nestedDrawerClassName = 'dot-nested-drawer';
3122
- var StyledList = styled__default["default"](material.List).withConfig({
3123
- displayName: "Liststyles__StyledList",
3124
- componentId: "wxwqwr-0"
3125
- })(templateObject_2$P || (templateObject_2$P = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3126
- var theme = _a.theme;
3127
- return styled.css(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n &.", " {\n background: ", ";\n\n .dot-icon {\n color: ", ";\n }\n\n &.", " .", " {\n padding-left: ", ";\n }\n\n .MuiListSubheader-root {\n padding: 0;\n\n .MuiTypography-root {\n padding: ", ";\n }\n }\n }\n "], ["\n &.", " {\n background: ", ";\n\n .dot-icon {\n color: ", ";\n }\n\n &.", " .", " {\n padding-left: ", ";\n }\n\n .MuiListSubheader-root {\n padding: 0;\n\n .MuiTypography-root {\n padding: ", ";\n }\n }\n }\n "])), rootClassName$O, theme.palette.layer.n0, theme.palette.layer.n700, nestedListClassName, listItemRootClass, theme.spacing(4), theme.spacing(1));
3128
- });
3129
- var templateObject_1$T, templateObject_2$P;
3130
-
3131
- var getChevronIcon = function getChevronIcon(nestedListType, isOpened) {
3132
- if (nestedListType !== 'expandable') {
3133
- return 'chevron-right';
3134
- }
3135
- if (isOpened) {
3136
- return 'chevron-up';
3137
- }
3138
- return 'chevron-down';
2994
+ var DotInputLabel = function DotInputLabel(_a) {
2995
+ var dataTestId = _a["data-testid"],
2996
+ _b = _a.disabled,
2997
+ disabled = _b === void 0 ? false : _b,
2998
+ _c = _a.error,
2999
+ error = _c === void 0 ? false : _c,
3000
+ id = _a.id,
3001
+ label = _a.label,
3002
+ required = _a.required;
3003
+ return jsxRuntime.jsx(StyledInputLabel, __assign({
3004
+ "data-testid": dataTestId,
3005
+ classes: {
3006
+ root: labelClassName
3007
+ },
3008
+ disabled: disabled,
3009
+ error: error,
3010
+ htmlFor: id,
3011
+ required: required,
3012
+ shrink: false,
3013
+ variant: "outlined"
3014
+ }, {
3015
+ children: jsxRuntime.jsx(DotTypography, __assign({
3016
+ variant: "subtitle2"
3017
+ }, {
3018
+ children: label
3019
+ }), void 0)
3020
+ }), void 0);
3139
3021
  };
3140
3022
 
3141
- var flyoutListItemClassName = 'dot-flyout-list-item';
3142
- var flyoutItemLinkClassName = 'dot-flyout-item-link';
3143
- var listItemLinkClassName = 'dot-list-item-link';
3144
- var StyledListItem = styled__default["default"](material.ListItem).withConfig({
3145
- displayName: "ListItemstyles__StyledListItem",
3146
- componentId: "sc-1fawh8v-0"
3147
- })(templateObject_2$O || (templateObject_2$O = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3148
- var theme = _a.theme;
3149
- return styled.css(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n p.MuiTypography-root {\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "], ["\n &.", " {\n &.", " {\n padding: 0;\n }\n\n p.MuiTypography-root {\n margin-bottom: 0;\n }\n\n .", " {\n align-items: center;\n display: flex;\n flex-grow: 2;\n }\n\n .", " .MuiIcon-root {\n margin-right: ", ";\n }\n\n .dot-icon i:before {\n color: ", ";\n }\n }\n "])), listItemRootClass, flyoutListItemClassName, listItemLinkClassName, flyoutItemLinkClassName, theme.spacing(4), theme.palette.text.primary);
3150
- });
3151
- var templateObject_1$S, templateObject_2$O;
3152
-
3153
- var rootClassName$N = 'dot-progress';
3154
- var StyledCircularProgress = styled__default["default"](material.CircularProgress).withConfig({
3155
- displayName: "Progressstyles__StyledCircularProgress",
3156
- componentId: "sc-1gs77rb-0"
3157
- })(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n &.", " {\n &.MuiCircularProgress-colorSecondary {\n color: #649a3d;\n }\n }\n"], ["\n &.", " {\n &.MuiCircularProgress-colorSecondary {\n color: #649a3d;\n }\n }\n"])), rootClassName$N);
3158
- var templateObject_1$R;
3159
-
3160
- var DotProgress = function DotProgress(_a) {
3161
- var ariaLabel = _a.ariaLabel,
3162
- _b = _a.color,
3163
- color = _b === void 0 ? 'secondary' : _b,
3023
+ var DELAY_MS = 300;
3024
+ var EndAdornment = function EndAdornment(_a) {
3025
+ var endAdornmentTooltip = _a.endAdornmentTooltip,
3026
+ error = _a.error,
3027
+ dataTestId = _a.dataTestId,
3028
+ endIcon = _a.endIcon,
3029
+ success = _a.success,
3030
+ warning = _a.warning;
3031
+ var renderIcon = function renderIcon(iconType) {
3032
+ return jsxRuntime.jsx(DotIcon, {
3033
+ "data-testid": dataTestId && dataTestId + "-" + iconType + "-icon",
3034
+ iconId: iconType + "-solid"
3035
+ }, void 0);
3036
+ };
3037
+ var errorIcon = error && renderIcon('error');
3038
+ var successIcon = success && renderIcon('check');
3039
+ var warningIcon = warning && renderIcon('warning');
3040
+ var endAdornmentIcon = endIcon || errorIcon || warningIcon || successIcon;
3041
+ var styledAdornment = jsxRuntime.jsx(StyledAdornment, __assign({
3042
+ className: adornmentIconClassName + " end",
3043
+ position: "end"
3044
+ }, {
3045
+ children: endAdornmentIcon
3046
+ }), void 0);
3047
+ return endAdornmentTooltip ? jsxRuntime.jsx(DotTooltip, __assign({
3048
+ title: endAdornmentTooltip
3049
+ }, {
3050
+ children: styledAdornment
3051
+ }), void 0) : styledAdornment;
3052
+ };
3053
+ var getInitialState = function getInitialState(value) {
3054
+ return {
3055
+ inputValue: value || ''
3056
+ };
3057
+ };
3058
+ var DotInputText = function DotInputText(_a) {
3059
+ var _b = _a.autoComplete,
3060
+ autoComplete = _b === void 0 ? 'off' : _b,
3061
+ autoFocus = _a.autoFocus,
3164
3062
  className = _a.className,
3063
+ defaultValue = _a.defaultValue,
3165
3064
  dataTestId = _a["data-testid"],
3166
- _c = _a.size,
3167
- size = _c === void 0 ? 40 : _c,
3168
- _d = _a.thickness,
3169
- thickness = _d === void 0 ? 3.6 : _d,
3170
- _e = _a.tooltip,
3171
- tooltip = _e === void 0 ? 'loading data' : _e,
3065
+ _c = _a.disabled,
3066
+ disabled = _c === void 0 ? false : _c,
3067
+ _d = _a.error,
3068
+ error = _d === void 0 ? false : _d,
3069
+ endAdornmentTooltip = _a.endAdornmentTooltip,
3070
+ _e = _a.fullWidth,
3071
+ fullWidth = _e === void 0 ? true : _e,
3072
+ hasDebounce = _a.hasDebounce,
3073
+ helperText = _a.helperText,
3074
+ endIcon = _a.endIcon,
3075
+ id = _a.id,
3076
+ inputRef = _a.inputRef,
3077
+ label = _a.label,
3078
+ maxRows = _a.maxRows,
3079
+ minRows = _a.minRows,
3080
+ _f = _a.multiline,
3081
+ multiline = _f === void 0 ? false : _f,
3082
+ name = _a.name,
3083
+ onBlur = _a.onBlur,
3084
+ onChange = _a.onChange,
3085
+ onFocus = _a.onFocus,
3086
+ onKeyDown = _a.onKeyDown,
3087
+ onMouseUp = _a.onMouseUp,
3088
+ persistentLabel = _a.persistentLabel,
3089
+ placeholder = _a.placeholder,
3090
+ _g = _a.readOnly,
3091
+ readOnly = _g === void 0 ? false : _g,
3092
+ _h = _a.required,
3093
+ required = _h === void 0 ? false : _h,
3094
+ shrink = _a.shrink,
3095
+ startIcon = _a.startIcon,
3096
+ _j = _a.size,
3097
+ size = _j === void 0 ? 'small' : _j,
3098
+ success = _a.success,
3099
+ _k = _a.type,
3100
+ type = _k === void 0 ? 'text' : _k,
3172
3101
  value = _a.value,
3173
- _f = _a.variant,
3174
- variant = _f === void 0 ? 'indeterminate' : _f;
3175
- var rootClasses = useStylesWithRootClass(rootClassName$N, className);
3176
- return jsxRuntime.jsx(DotTooltip, __assign({
3177
- title: tooltip
3102
+ _l = _a.warning,
3103
+ warning = _l === void 0 ? false : _l;
3104
+ var hasError = error && errorClassName;
3105
+ var hasWarning = !error && warning && warningClassName;
3106
+ var hasSuccess = !error && !warning && success && successClassName;
3107
+ var hasEndAdornmentIcon = endIcon || error || hasWarning || hasSuccess;
3108
+ // This state is used only with debounce feature enabled
3109
+ var _m = React.useState(hasDebounce && getInitialState(value)),
3110
+ inputTextState = _m[0],
3111
+ setInputTextState = _m[1];
3112
+ var rootStyles = useStylesWithRootClass(rootClassName$10, hasError, hasWarning, hasSuccess, readOnly ? 'read-only' : '');
3113
+ // Used to control text value from the consumer component
3114
+ // when debounce feature is enabled
3115
+ React.useEffect(function () {
3116
+ if (hasDebounce && value !== inputTextState.inputValue) {
3117
+ setInputTextState(getInitialState(value));
3118
+ }
3119
+ }, [value]);
3120
+ // Improve performance by avoiding callback execution
3121
+ // on each keystroke (if debounce feature is active)
3122
+ React.useEffect(function () {
3123
+ // Do not proceed if debounce feature is turned
3124
+ // off or there is no event defined
3125
+ if (!hasDebounce || !inputTextState || !inputTextState.changeEvent || !onChange) return;
3126
+ var handler = setTimeout(function () {
3127
+ onChange(inputTextState.changeEvent);
3128
+ }, DELAY_MS);
3129
+ return function () {
3130
+ return clearTimeout(handler);
3131
+ };
3132
+ }, [inputTextState]);
3133
+ var handleChange = function handleChange(e) {
3134
+ // We need to have control over change event and input value separately
3135
+ // so that we can set initial state via 'value' prop (if needed)
3136
+ hasDebounce ? setInputTextState({
3137
+ changeEvent: e,
3138
+ inputValue: e.target.value
3139
+ }) : onChange === null || onChange === void 0 ? void 0 : onChange(e);
3140
+ };
3141
+ var inputTextValue = hasDebounce ? inputTextState.inputValue : value;
3142
+ // Don't use default value when debounce feature is enabled because
3143
+ // in that case component is controlled
3144
+ var defaultInputValue = hasDebounce ? undefined : defaultValue;
3145
+ var startAdornmentIcon = function startAdornmentIcon() {
3146
+ if (!startIcon) return null;
3147
+ return jsxRuntime.jsx(StyledAdornment, __assign({
3148
+ className: adornmentIconClassName + " start",
3149
+ position: "start"
3150
+ }, {
3151
+ children: startIcon
3152
+ }), void 0);
3153
+ };
3154
+ var endAdornmentIcon = function endAdornmentIcon() {
3155
+ if (!hasEndAdornmentIcon) return null;
3156
+ return jsxRuntime.jsx(EndAdornment, __assign({}, {
3157
+ endAdornmentTooltip: endAdornmentTooltip,
3158
+ error: error,
3159
+ dataTestId: dataTestId,
3160
+ endIcon: endIcon,
3161
+ success: success,
3162
+ warning: warning
3163
+ }), void 0);
3164
+ };
3165
+ var wrapperClassName = useStylesWithRootClass(fullWidth !== false ? 'dot-input-text--fullwidth' : '', className);
3166
+ return jsxRuntime.jsxs(StyledTextFieldContainer, __assign({
3167
+ className: wrapperClassName
3178
3168
  }, {
3179
- children: jsxRuntime.jsx(StyledCircularProgress, {
3180
- "aria-label": ariaLabel,
3169
+ children: [persistentLabel && jsxRuntime.jsx(DotInputLabel, __assign({}, {
3170
+ disabled: disabled,
3171
+ error: error,
3172
+ id: id,
3173
+ label: label,
3174
+ required: required
3175
+ }), void 0), jsxRuntime.jsx(StyledTextField, {
3176
+ InputProps: {
3177
+ startAdornment: startAdornmentIcon(),
3178
+ endAdornment: endAdornmentIcon()
3179
+ },
3180
+ "aria-label": name,
3181
+ autoComplete: autoComplete,
3182
+ autoFocus: autoFocus,
3181
3183
  classes: {
3182
- root: rootClasses
3184
+ root: rootStyles
3183
3185
  },
3184
- color: color,
3185
- "data-testid": dataTestId,
3186
+ defaultValue: defaultInputValue,
3187
+ disabled: disabled,
3188
+ error: error,
3189
+ focused: readOnly ? false : undefined,
3190
+ fullWidth: fullWidth,
3191
+ helperText: helperText,
3192
+ id: id,
3193
+ InputLabelProps: {
3194
+ shrink: type === 'date' ? true : shrink
3195
+ },
3196
+ inputProps: {
3197
+ 'data-testid': dataTestId,
3198
+ className: 'dot-input',
3199
+ readOnly: readOnly
3200
+ },
3201
+ inputRef: inputRef,
3202
+ label: persistentLabel ? null : label,
3203
+ multiline: multiline,
3204
+ name: name,
3205
+ onBlur: onBlur,
3206
+ onChange: hasDebounce ? handleChange : onChange,
3207
+ onFocus: onFocus,
3208
+ onKeyDown: onKeyDown,
3209
+ onMouseUp: onMouseUp,
3210
+ placeholder: placeholder,
3211
+ required: required,
3212
+ minRows: multiline ? minRows : null,
3213
+ maxRows: multiline ? maxRows : null,
3186
3214
  size: size,
3187
- thickness: thickness,
3188
- value: value,
3189
- variant: variant
3190
- }, void 0)
3215
+ type: type,
3216
+ value: inputTextValue,
3217
+ variant: "outlined"
3218
+ }, void 0)]
3191
3219
  }), void 0);
3192
3220
  };
3193
3221
 
3194
- var levelBottom = -1;
3195
- var levelFirst = 1;
3196
- var levelSecond = 10;
3197
- var levelThird = 100;
3198
- var levelFourth = 1000;
3199
- var levelTop = 9999;
3200
-
3201
- var variables = /*#__PURE__*/Object.freeze({
3202
- __proto__: null,
3203
- levelBottom: levelBottom,
3204
- levelFirst: levelFirst,
3205
- levelSecond: levelSecond,
3206
- levelThird: levelThird,
3207
- levelFourth: levelFourth,
3208
- levelTop: levelTop
3209
- });
3210
-
3211
- var rootClassName$M = 'dot-popper';
3212
- var StyledPopper$1 = styled__default["default"](material.Popper).withConfig({
3213
- displayName: "Popperstyles__StyledPopper",
3214
- componentId: "sd1h8p-0"
3215
- })(templateObject_2$N || (templateObject_2$N = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3216
- var theme = _a.theme;
3217
- return styled.css(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n }\n "], ["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n }\n "])), rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize);
3222
+ var rootClassName$N = 'dot-search-input';
3223
+ var StyledSearchInput = styled__default["default"].span.withConfig({
3224
+ displayName: "SearchInputstyles__StyledSearchInput",
3225
+ componentId: "qlwzku-0"
3226
+ })(templateObject_2$N || (templateObject_2$N = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
3227
+ return styled.css(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n &.", " {\n }\n "], ["\n &.", " {\n }\n "])), rootClassName$N);
3218
3228
  });
3219
3229
  var templateObject_1$Q, templateObject_2$N;
3220
3230
 
3221
- var flyoutMenuClassName = 'dot-flyout-menu';
3222
- var rootClassName$L = 'dot-menu';
3223
- var getListMaxHeight = function getListMaxHeight(maxHeight) {
3224
- return isString$1(maxHeight) ? maxHeight : maxHeight + "px";
3225
- };
3226
- var StyledPopper = styled__default["default"](material.Popper).withConfig({
3227
- displayName: "Menustyles__StyledPopper",
3228
- componentId: "sc-134fmqu-0"
3229
- })(templateObject_2$M || (templateObject_2$M = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3230
- var theme = _a.theme;
3231
- return styled.css(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n z-index: ", ";\n }\n &.", ", &.", " {\n &.loading .MuiPaper-root {\n align-items: center;\n display: flex;\n justify-content: center;\n min-height: 200px;\n min-width: 200px;\n }\n\n ul,\n .dot-action-item {\n .dot-action-item-text {\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n }\n\n ul {\n box-sizing: content-box;\n min-width: 112px;\n overflow: auto;\n\n /* Conditionally setting 'max-height' with transient prop */\n ", "\n\n .dot-li {\n min-height: auto;\n }\n }\n\n .dot-action-item {\n height: ", ";\n border-top: 1px solid ", ";\n line-height: inherit;\n\n button.dot-button {\n border-radius: ", ";\n justify-content: flex-start;\n height: 100%;\n margin: 0;\n\n &:focus-visible {\n background-color: ", ";\n }\n\n .MuiButton-label {\n gap: ", ";\n\n .MuiButton-startIcon {\n margin-left: 0;\n\n .dot-icon {\n flex-shrink: 0;\n }\n }\n }\n }\n }\n }\n "], ["\n &.", " {\n font-family: ", ";\n font-size: ", "px;\n z-index: ", ";\n }\n &.", ", &.", " {\n &.loading .MuiPaper-root {\n align-items: center;\n display: flex;\n justify-content: center;\n min-height: 200px;\n min-width: 200px;\n }\n\n ul,\n .dot-action-item {\n .dot-action-item-text {\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n }\n }\n\n ul {\n box-sizing: content-box;\n min-width: 112px;\n overflow: auto;\n\n /* Conditionally setting 'max-height' with transient prop */\n ", "\n\n .dot-li {\n min-height: auto;\n }\n }\n\n .dot-action-item {\n height: ", ";\n border-top: 1px solid ", ";\n line-height: inherit;\n\n button.dot-button {\n border-radius: ", ";\n justify-content: flex-start;\n height: 100%;\n margin: 0;\n\n &:focus-visible {\n background-color: ", ";\n }\n\n .MuiButton-label {\n gap: ", ";\n\n .MuiButton-startIcon {\n margin-left: 0;\n\n .dot-icon {\n flex-shrink: 0;\n }\n }\n }\n }\n }\n }\n "])), rootClassName$M, theme.typography.fontFamily, theme.typography.body1.fontSize, levelSecond, rootClassName$L, rootClassName$M, function (_a) {
3232
- var $maxHeight = _a.$maxHeight;
3233
- return $maxHeight !== undefined && "\n max-height: " + getListMaxHeight($maxHeight) + ";\n ";
3234
- }, theme.spacing(7), theme.palette.grey[100], theme.spacing(0, 0, 0.5, 0.5), theme.palette.layer.n100, theme.spacing(3));
3235
- });
3236
- var templateObject_1$P, templateObject_2$M;
3237
-
3238
- var MENU_ITEM_HEIGHT_NORMAL = 48;
3239
- var MENU_ITEM_HEIGHT_DENSE = 36;
3240
- var DEFAULT_MAX_VISIBLE_ITEMS = 7;
3241
-
3242
- var rootClassName$K = 'dot-ul';
3243
- var listItemClassName$1 = 'dot-li';
3244
- var listItemWithSubmenuClassName = 'dot-li-with-submenu';
3245
- var StyledMenuList = styled__default["default"](material.MenuList).withConfig({
3246
- displayName: "MenuListstyles__StyledMenuList",
3247
- componentId: "yqdwwg-0"
3248
- })(templateObject_2$L || (templateObject_2$L = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3249
- var theme = _a.theme;
3250
- return styled.css(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n &.", " {\n .dot-li {\n font-size: ", "px;\n justify-content: space-between;\n gap: ", ";\n\n &:hover {\n background: ", ";\n }\n\n &.Mui-selected,\n &.Mui-selected:hover {\n background: ", ";\n }\n\n &.", " {\n padding-right: ", ";\n }\n }\n }\n "], ["\n &.", " {\n .dot-li {\n font-size: ", "px;\n justify-content: space-between;\n gap: ", ";\n\n &:hover {\n background: ", ";\n }\n\n &.Mui-selected,\n &.Mui-selected:hover {\n background: ", ";\n }\n\n &.", " {\n padding-right: ", ";\n }\n }\n }\n "])), rootClassName$K, theme.typography.body1.fontSize, theme.spacing(3), hoverGray, lightSelectedGray, listItemWithSubmenuClassName, theme.spacing(0.5));
3251
- });
3252
- var templateObject_1$O, templateObject_2$L;
3253
-
3254
- var getDefaultItemHeight = function getDefaultItemHeight(isDense) {
3255
- return isDense ? MENU_ITEM_HEIGHT_DENSE : MENU_ITEM_HEIGHT_NORMAL;
3256
- };
3257
- var calculateItemHeight = function calculateItemHeight(isDense, customItemHeight, menuItemHeight) {
3258
- // Custom item height must NOT be lower than MENU_ITEM_HEIGHT_DENSE value
3259
- if (customItemHeight && customItemHeight >= MENU_ITEM_HEIGHT_DENSE) {
3260
- return customItemHeight;
3261
- }
3262
- var itemHeightType = typeof menuItemHeight;
3263
- if (itemHeightType === 'number' || itemHeightType === 'string') {
3264
- return menuItemHeight;
3265
- } else {
3266
- return getDefaultItemHeight(isDense);
3267
- }
3268
- };
3269
- var getNumberOfVisibleItems = function getNumberOfVisibleItems(numberOfItems, maxVisibleItems) {
3270
- if (maxVisibleItems && maxVisibleItems > 0) {
3271
- return maxVisibleItems <= numberOfItems ? maxVisibleItems : numberOfItems;
3272
- }
3273
- return DEFAULT_MAX_VISIBLE_ITEMS;
3274
- };
3275
- var calculateMaxHeight = function calculateMaxHeight(_a) {
3276
- var isDense = _a.isDense,
3277
- maxVisibleItems = _a.maxVisibleItems,
3278
- menuItems = _a.menuItems,
3279
- menuItemHeight = _a.menuItemHeight;
3280
- // if menuItemHeight is "auto" set maxHeight as same
3281
- if (typeof menuItemHeight === 'string') {
3282
- return menuItemHeight;
3283
- }
3284
- // If 'menuItemHeight' is set it will take precedence here
3285
- var itemHeight = menuItemHeight ? menuItemHeight : getDefaultItemHeight(isDense);
3286
- var maxHeight = 0;
3287
- var numberOfVisibleItems = getNumberOfVisibleItems(menuItems.length, maxVisibleItems);
3288
- var visibleItems = menuItems.slice(0, numberOfVisibleItems);
3289
- visibleItems.forEach(function (_a) {
3290
- var height = _a.height;
3291
- var customItemHeight = height ? height : itemHeight;
3292
- // + 3 is for bottom margin of menuItem
3293
- maxHeight += customItemHeight + 3;
3294
- });
3295
- return maxHeight;
3296
- };
3297
- var checkForSubItems = function checkForSubItems(menuItems) {
3298
- return menuItems.some(function (menuItem) {
3299
- return menuItem.items && menuItems.length > 0;
3300
- });
3301
- };
3302
- var checkIfSubmenu = function checkIfSubmenu(anchorElement) {
3303
- if (!anchorElement) return false;
3304
- return anchorElement.classList.contains(listItemWithSubmenuClassName);
3305
- };
3306
- var checkIfMenuItemSelected = function checkIfMenuItemSelected(key, selectedKey, activeSubmenu) {
3307
- return selectedKey === key || activeSubmenu === key;
3308
- };
3309
- var checkForAutoFocus = function checkForAutoFocus(autoFocusItem, isFirstItem) {
3310
- return !!(autoFocusItem && isFirstItem);
3311
- };
3312
-
3313
- /**
3314
- * Since this component is used inside 'ClickAwayListener',
3315
- * it needs to be contained within 'forwardRef' function
3316
- */
3317
- var DotMenuList = /*#__PURE__*/React.forwardRef(function (_a, ref) {
3318
- var autoFocusItem = _a.autoFocusItem,
3231
+ function SearchInput(_a) {
3232
+ var dataTestId = _a["data-testid"],
3233
+ _b = _a.autoFocus,
3234
+ autoFocus = _b === void 0 ? true : _b,
3319
3235
  className = _a.className,
3320
- dataTestId = _a["data-testid"],
3321
- dense = _a.dense,
3322
- id = _a.id,
3323
- maxVisibleItems = _a.maxVisibleItems,
3324
- menuItemHeight = _a.menuItemHeight,
3325
- menuItems = _a.menuItems,
3326
- onItemSelect = _a.onItemSelect,
3327
- onKeyDown = _a.onKeyDown,
3328
- onSubMenuCreate = _a.onSubMenuCreate,
3329
- selectedKey = _a.selectedKey;
3330
- var rootClasses = useStylesWithRootClass(rootClassName$K, className);
3331
- var _b = React.useState(null),
3332
- activeSubmenu = _b[0],
3333
- setActiveSubmenu = _b[1];
3334
- var _c = React.useState(null),
3335
- subItemAnchorEl = _c[0],
3336
- setSubItemAnchorEl = _c[1];
3337
- var openSubmenu = function openSubmenu(target, itemKey) {
3338
- // Set new anchor for submenu and active submenu key
3339
- // so that new submenu can be opened
3340
- setSubItemAnchorEl(target);
3341
- setActiveSubmenu(itemKey);
3342
- };
3343
- var closeActiveSubmenu = function closeActiveSubmenu() {
3344
- // We want to clean active submenu state if it exists.
3345
- // This will make previous submenu disappear when
3346
- // hovering to item with no submenu items
3347
- activeSubmenu && setActiveSubmenu(null);
3348
- };
3349
- var getMouseEnterHandler = function getMouseEnterHandler(itemKey, hasSubmenu) {
3350
- return function (event) {
3351
- hasSubmenu ? openSubmenu(event.currentTarget, itemKey) : closeActiveSubmenu();
3352
- };
3353
- };
3354
- return jsxRuntime.jsx(StyledMenuList, __assign({
3355
- classes: {
3356
- root: rootClasses
3357
- },
3358
- "data-testid": dataTestId,
3359
- dense: dense,
3360
- id: id,
3361
- onKeyDown: onKeyDown,
3362
- style: {
3363
- height: calculateMaxHeight({
3364
- isDense: dense,
3365
- maxVisibleItems: maxVisibleItems,
3366
- menuItems: menuItems,
3367
- menuItemHeight: menuItemHeight
3368
- })
3369
- }
3236
+ _c = _a.disabled,
3237
+ disabled = _c === void 0 ? false : _c,
3238
+ onChange = _a.onChange,
3239
+ onClear = _a.onClear,
3240
+ _d = _a.placeholder,
3241
+ placeholder = _d === void 0 ? 'Search' : _d,
3242
+ _e = _a.tooltip,
3243
+ tooltip = _e === void 0 ? null : _e,
3244
+ value = _a.value;
3245
+ var rootClasses = useStylesWithRootClass(rootClassName$N, className);
3246
+ var _f = React.useState(value),
3247
+ searchText = _f[0],
3248
+ setSearchText = _f[1];
3249
+ var previousSearchText = '';
3250
+ var handleChange = React.useCallback(function (event) {
3251
+ previousSearchText = event.target.value;
3252
+ setSearchText(event.target.value);
3253
+ // Timeout is to give user a chance to finish typing before refreshing data.
3254
+ setTimeout(function () {
3255
+ if (onChange && event.target.value === previousSearchText) {
3256
+ onChange(event.target.value);
3257
+ }
3258
+ }, 500);
3259
+ }, [onChange]);
3260
+ var handleClear = React.useCallback(function () {
3261
+ setSearchText('');
3262
+ onClear && onClear();
3263
+ }, [onClear]);
3264
+ var searchIcon = jsxRuntime.jsx(DotIcon, {
3265
+ className: "search-icon",
3266
+ iconId: "search"
3267
+ }, void 0);
3268
+ var clearSearchIcon = jsxRuntime.jsx(DotIconButton, {
3269
+ iconId: "close",
3270
+ onClick: handleClear,
3271
+ size: "small",
3272
+ tooltip: "Clear search text"
3273
+ }, void 0);
3274
+ return jsxRuntime.jsx(StyledSearchInput, __assign({
3275
+ className: rootClasses
3370
3276
  }, {
3371
- children: menuItems.map(function (item, index) {
3372
- var itemAriaLabel = item.ariaLabel,
3373
- children = item.children,
3374
- classes = item.classes,
3375
- disabled = item.disabled,
3376
- divider = item.divider,
3377
- height = item.height,
3378
- subItems = item.items,
3379
- key = item.key;
3380
- var itemHeight = calculateItemHeight(dense, height, menuItemHeight);
3381
- var isSelected = checkIfMenuItemSelected(key, selectedKey, activeSubmenu);
3382
- var isFirstItem = index === 0;
3383
- var hasSubmenu = !!subItems;
3384
- var hasAutoFocus = checkForAutoFocus(autoFocusItem, isFirstItem);
3385
- var menuItemClasses = useStylesWithRootClass(listItemClassName$1, hasSubmenu ? listItemWithSubmenuClassName : '', classes ? classes : '');
3386
- var handleClick = function handleClick(event) {
3387
- // Execute select callback only for items which does not have
3388
- // submenu defined. If there is no menu or handler - prevent
3389
- // further propagation of the current event so that click on
3390
- // items with submenu does not close the menu
3391
- !hasSubmenu && onItemSelect ? onItemSelect(event, key) : event.stopPropagation();
3392
- };
3393
- /**
3394
- * If there is submenu, right arrow icon will be added
3395
- * and sub-menu will be rendered
3396
- */
3397
- return jsxRuntime.jsxs(material.MenuItem, __assign({
3398
- autoFocus: hasAutoFocus,
3399
- "aria-label": itemAriaLabel,
3400
- className: menuItemClasses,
3277
+ children: jsxRuntime.jsx(DotTooltip, __assign({
3278
+ placement: "bottom",
3279
+ title: tooltip
3280
+ }, {
3281
+ children: jsxRuntime.jsx(DotInputText, {
3282
+ "data-testid": dataTestId,
3283
+ autoFocus: autoFocus,
3284
+ className: "search-text",
3401
3285
  disabled: disabled,
3402
- disableRipple: hasSubmenu,
3403
- divider: divider,
3404
- onClick: handleClick,
3405
- onMouseEnter: getMouseEnterHandler(key, hasSubmenu),
3406
- ref: ref,
3407
- style: {
3408
- height: itemHeight
3409
- },
3410
- selected: isSelected
3411
- }, {
3412
- children: [children, hasSubmenu && jsxRuntime.jsx(DotIcon, {
3413
- "data-testid": "dot-item-arrow-icon",
3414
- iconId: "arrow-right"
3415
- }, void 0), hasSubmenu && onSubMenuCreate({
3416
- anchorElement: subItemAnchorEl,
3417
- isOpened: isSelected,
3418
- subMenuId: key,
3419
- subMenuItems: subItems
3420
- })]
3421
- }), key);
3422
- })
3286
+ endIcon: (searchText === null || searchText === void 0 ? void 0 : searchText.length) > 0 ? clearSearchIcon : null,
3287
+ id: "app-instance-search-text",
3288
+ name: "app-instance-search-text",
3289
+ onChange: handleChange,
3290
+ placeholder: placeholder,
3291
+ startIcon: searchIcon,
3292
+ value: searchText
3293
+ }, void 0)
3294
+ }), void 0)
3423
3295
  }), void 0);
3296
+ }
3297
+
3298
+ var rootClassName$M = 'dot-copy-button';
3299
+ var StyledCopyButton = styled__default["default"].span.withConfig({
3300
+ displayName: "CopyButtonstyles__StyledCopyButton",
3301
+ componentId: "sc-18ff0u-0"
3302
+ })(templateObject_2$M || (templateObject_2$M = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3303
+ var theme = _a.theme;
3304
+ return styled.css(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n &.", " {\n .copied-to-clipboard {\n color: ", ";\n }\n }\n "], ["\n &.", " {\n .copied-to-clipboard {\n color: ", ";\n }\n }\n "])), rootClassName$M, theme.palette.success[400]);
3424
3305
  });
3306
+ var templateObject_1$P, templateObject_2$M;
3425
3307
 
3426
- var DotMenu = function DotMenu(_a) {
3427
- var anchorEl = _a.anchorEl,
3428
- ariaLabel = _a.ariaLabel,
3429
- className = _a.className,
3430
- dataTestId = _a["data-testid"],
3431
- _b = _a.dense,
3432
- dense = _b === void 0 ? true : _b,
3433
- disablePortal = _a.disablePortal,
3434
- id = _a.id,
3435
- _c = _a.loading,
3436
- loading = _c === void 0 ? false : _c,
3437
- _d = _a.maxVisibleItems,
3438
- maxVisibleItems = _d === void 0 ? DEFAULT_MAX_VISIBLE_ITEMS : _d,
3439
- menuItemHeight = _a.menuItemHeight,
3440
- _e = _a.menuItems,
3441
- menuItems = _e === void 0 ? [] : _e,
3442
- _f = _a.menuPlacement,
3443
- menuPlacement = _f === void 0 ? 'bottom' : _f,
3444
- onLeave = _a.onLeave,
3445
- onSelect = _a.onSelect,
3446
- _g = _a.open,
3447
- open = _g === void 0 ? false : _g,
3448
- selectedKey = _a.selectedKey;
3449
- var rootClasses = useStylesWithRootClass(rootClassName$L, className, loading ? 'loading' : '');
3450
- var isSubmenu = checkIfSubmenu(anchorEl);
3451
- var hasSubItems = checkForSubItems(menuItems);
3452
- // Timeout object is customizable when Menu component is either submenu
3453
- // (it is opened within parent menu) or it contains at least one item which
3454
- // has sub-items. This is done because when multi-level menu is closing it
3455
- // will first close the parent and only then child menus - which looks
3456
- // a bit weird - so here I'm giving it exit value of 0 so that it looks like
3457
- // they all close at the same time. For "normal" menus, timeout is unnecessary.
3458
- var timeout = isSubmenu || hasSubItems ? {
3459
- exit: 0,
3460
- enter: 300
3461
- } : undefined;
3462
- var handleSelect = function handleSelect(event, itemKey) {
3463
- onLeave && onLeave(event);
3464
- onSelect && onSelect(event, id, itemKey);
3465
- };
3466
- var handleListKeyDown = function handleListKeyDown(event) {
3467
- if (onLeave && event.key === 'Tab') {
3468
- event.preventDefault();
3469
- onLeave(event);
3308
+ var DotCopyButton = function DotCopyButton(_a) {
3309
+ var _b = _a.ariaLabel,
3310
+ ariaLabel = _b === void 0 ? 'Copy to clipboard' : _b,
3311
+ _c = _a.copiedTooltip,
3312
+ copiedTooltip = _c === void 0 ? 'Copied!' : _c,
3313
+ _d = _a.copyTooltip,
3314
+ copyTooltip = _d === void 0 ? 'Copy to clipboard' : _d,
3315
+ _e = _a["data-testid"],
3316
+ dataTestId = _e === void 0 ? 'dot-copy-button' : _e,
3317
+ value = _a.value;
3318
+ var _f = React.useState(false),
3319
+ showCopiedIcon = _f[0],
3320
+ setShowCopiedIcon = _f[1];
3321
+ var copyToClipboard = function copyToClipboard() {
3322
+ // The check for navigator.clipboard.writeText is because this function is
3323
+ // only supported in secure contexts (https). This will always be the case in
3324
+ // production but not when running locally.
3325
+ if (!navigator.clipboard || !navigator.clipboard.writeText) {
3326
+ console.warn('Copy to clipboard is only supported in secure context (https)', value);
3327
+ } else {
3328
+ navigator.clipboard.writeText(value);
3470
3329
  }
3471
3330
  };
3472
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3473
- var handleClickAway = function handleClickAway(event) {
3474
- if (onLeave && (!anchorEl || !anchorEl.contains(event.currentTarget))) {
3475
- onLeave(event);
3476
- }
3331
+ var copy = function copy() {
3332
+ copyToClipboard();
3333
+ setShowCopiedIcon(true);
3334
+ setTimeout(function () {
3335
+ setShowCopiedIcon(false);
3336
+ }, 3000);
3337
+ return false;
3477
3338
  };
3478
- return jsxRuntime.jsx(StyledPopper, __assign({
3479
- anchorEl: anchorEl,
3480
- "aria-label": ariaLabel,
3481
- className: rootClasses,
3482
- "data-testid": dataTestId,
3483
- disablePortal: disablePortal,
3484
- open: open,
3485
- placement: menuPlacement,
3486
- role: undefined,
3487
- transition: true
3339
+ return jsxRuntime.jsxs(StyledCopyButton, __assign({
3340
+ className: rootClassName$M,
3341
+ "data-testid": dataTestId
3488
3342
  }, {
3489
- children: function (_a) {
3490
- var TransitionProps = _a.TransitionProps,
3491
- placement = _a.placement;
3492
- return jsxRuntime.jsx(material.Fade, __assign({}, TransitionProps, {
3493
- style: {
3494
- transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
3495
- },
3496
- timeout: timeout
3497
- }, {
3498
- children: jsxRuntime.jsx(material.Paper, {
3499
- children: jsxRuntime.jsx(material.ClickAwayListener, __assign({
3500
- onClickAway: handleClickAway
3501
- }, {
3502
- children: loading ? jsxRuntime.jsx(DotProgress, {
3503
- "data-testid": "loading-indicator",
3504
- tooltip: "Loading Data...",
3505
- value: 20
3506
- }, void 0) : jsxRuntime.jsx(DotMenuList, {
3507
- autoFocusItem: open,
3508
- "data-testid": dataTestId + "-menu",
3509
- dense: dense,
3510
- id: id,
3511
- maxVisibleItems: maxVisibleItems,
3512
- menuItemHeight: menuItemHeight,
3513
- menuItems: menuItems,
3514
- onItemSelect: handleSelect,
3515
- onKeyDown: handleListKeyDown,
3516
- onSubMenuCreate: function (_a) {
3517
- var anchorElement = _a.anchorElement,
3518
- isOpened = _a.isOpened,
3519
- subMenuId = _a.subMenuId,
3520
- subMenuItems = _a.subMenuItems;
3521
- return jsxRuntime.jsx(DotMenu, {
3522
- anchorEl: anchorElement,
3523
- menuPlacement: "right-start",
3524
- id: subMenuId,
3525
- menuItems: subMenuItems,
3526
- open: isOpened,
3527
- onLeave: onLeave,
3528
- onSelect: onSelect,
3529
- selectedKey: selectedKey
3530
- }, void 0);
3531
- },
3532
- selectedKey: selectedKey
3533
- }, void 0)
3534
- }), void 0)
3535
- }, void 0)
3536
- }), void 0);
3343
+ children: [!showCopiedIcon && jsxRuntime.jsx(DotIconButton, {
3344
+ ariaLabel: ariaLabel,
3345
+ "data-testid": dataTestId + "-button",
3346
+ iconId: "duplicate",
3347
+ onClick: copy,
3348
+ size: "small",
3349
+ tooltip: copyTooltip
3350
+ }, void 0), showCopiedIcon && jsxRuntime.jsx(DotIcon, {
3351
+ className: "copied-to-clipboard",
3352
+ "data-testid": dataTestId + "-icon",
3353
+ fontSize: "small",
3354
+ iconId: "check-solid",
3355
+ tooltip: copiedTooltip
3356
+ }, void 0)]
3357
+ }), void 0);
3358
+ };
3359
+
3360
+ var rootClassName$L = 'dot-link';
3361
+ var StyledLink = styled__default["default"](material.Link).withConfig({
3362
+ displayName: "Linkstyles__StyledLink",
3363
+ componentId: "sc-1lpmaww-0"
3364
+ })(templateObject_2$L || (templateObject_2$L = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function () {
3365
+ return styled.css(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n &.", " {\n cursor: pointer;\n\n &:hover :not(.MuiLink-underlineHover) {\n text-decoration: none;\n }\n }\n "], ["\n &.", " {\n cursor: pointer;\n\n &:hover :not(.MuiLink-underlineHover) {\n text-decoration: none;\n }\n }\n "])), rootClassName$L);
3366
+ });
3367
+ var templateObject_1$O, templateObject_2$L;
3368
+
3369
+ var DotLink = function DotLink(_a) {
3370
+ var ariaLabel = _a.ariaLabel,
3371
+ children = _a.children,
3372
+ className = _a.className,
3373
+ _b = _a.color,
3374
+ color = _b === void 0 ? 'primary' : _b,
3375
+ dataTestId = _a["data-testid"],
3376
+ href = _a.href,
3377
+ onClick = _a.onClick,
3378
+ onMouseEnter = _a.onMouseEnter,
3379
+ onPointerDown = _a.onPointerDown,
3380
+ _c = _a.rel,
3381
+ rel = _c === void 0 ? 'noreferrer' : _c,
3382
+ _d = _a.tabIndex,
3383
+ tabIndex = _d === void 0 ? 0 : _d,
3384
+ target = _a.target,
3385
+ tooltip = _a.tooltip,
3386
+ underline = _a.underline;
3387
+ var rootClasses = useStylesWithRootClass(rootClassName$L, className);
3388
+ var handleKeyPress = function handleKeyPress(event) {
3389
+ if (onClick && event.key === 'Enter') {
3390
+ event.preventDefault();
3391
+ onClick(event);
3537
3392
  }
3393
+ };
3394
+ return jsxRuntime.jsx(DotTooltip, __assign({
3395
+ title: tooltip
3396
+ }, {
3397
+ children: jsxRuntime.jsx(StyledLink, __assign({
3398
+ "aria-label": ariaLabel,
3399
+ classes: {
3400
+ root: rootClasses
3401
+ },
3402
+ color: color,
3403
+ "data-testid": dataTestId,
3404
+ href: href,
3405
+ onClick: onClick,
3406
+ onKeyPress: handleKeyPress,
3407
+ onMouseEnter: onMouseEnter,
3408
+ onPointerDown: onPointerDown,
3409
+ rel: rel,
3410
+ tabIndex: tabIndex,
3411
+ target: target,
3412
+ underline: underline
3413
+ }, {
3414
+ children: children
3415
+ }), void 0)
3538
3416
  }), void 0);
3539
3417
  };
3540
3418
 
3541
- var CreateUUID = function CreateUUID() {
3542
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
3543
- var r = Math.random() * 16 | 0,
3544
- v = c === 'x' ? r : r & 0x3 | 0x8;
3545
- return v.toString(16);
3546
- });
3547
- };
3419
+ var img$6 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M12.4332 16.3533V14.8333H11.5665V16.3533L10.7432 15.8933L9.85651 16.4033L11.9998 17.6366L14.1932 16.3733L13.3332 15.8766L12.4332 16.3533Z' fill='white'/%3e%3cpath d='M7.99328 10.1866L9.24661 10.9132L9.67995 10.1399L8.36995 9.4299L9.09328 9.01657V8.03323L7.11328 9.18323L7.11661 11.5532L7.99328 11.0566V10.1866Z' fill='white'/%3e%3cpath d='M14.6934 10.9133L15.9934 10.1733L15.99 11.0566L16.8867 11.5599V9.1766L14.81 7.98993L14.7767 8.9566L15.6167 9.45326L14.29 10.0799L14.6934 10.9133Z' fill='white'/%3e%3cpath d='M16.8801 12.5435L16.0001 12.0402V12.0935V13.7068L12.4167 11.6868V7.61015L13.9667 8.49015V7.51682L12.0001 6.35349L9.95006 7.52348V8.52348L11.4967 7.63015V11.6868L8.00006 13.8168V12.0202L7.12006 12.5235V14.8202L8.96672 15.8502L9.86672 15.3335L8.40006 14.5268L12.0001 12.4368L15.5567 14.5035L14.1301 15.3268L15.0567 15.8701L16.8701 14.8268L16.8801 12.5435Z' fill='white'/%3e%3c/svg%3e";
3548
3420
 
3549
- var fadeIn = styled.keyframes(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"], ["\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n"])));
3550
- var StyledDotDrawer = styled__default["default"](DotDrawer).withConfig({
3551
- displayName: "NestedListstyles__StyledDotDrawer",
3552
- componentId: "sc-1wwoqos-0"
3553
- })(templateObject_4$6 || (templateObject_4$6 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3554
- var open = _a.open;
3555
- return styled.css(templateObject_3$8 || (templateObject_3$8 = __makeTemplateObject(["\n &.", " {\n .dot-drawer-paper {\n z-index: ", ";\n animation: ", ";\n }\n }\n "], ["\n &.", " {\n .dot-drawer-paper {\n z-index: ", ";\n animation: ", ";\n }\n }\n "])), nestedDrawerClassName, open ? levelFirst : levelBottom, open && styled.css(templateObject_2$K || (templateObject_2$K = __makeTemplateObject(["\n ", " 0.2s cubic-bezier(1,0,1,.01);\n "], ["\n ", " 0.2s cubic-bezier(1,0,1,.01);\n "])), fadeIn));
3556
- });
3557
- var templateObject_1$N, templateObject_2$K, templateObject_3$8, templateObject_4$6;
3421
+ var img$5 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M14.1867 11.2667L12.1634 10.0833L10.1367 11.2667V13.62L12.1634 14.7867L14.1867 13.62V11.2667Z' fill='white'/%3e%3cpath d='M8.43666 12.0001L7.47333 11.1501V15.1667L10.41 16.8367V15.7034L8.43666 14.5401V12.0001Z' fill='white'/%3e%3cpath d='M15.8965 12V14.5833L13.9632 15.7033V16.9367L16.8532 15.1533V11.0967L15.8965 12Z' fill='white'/%3e%3cpath d='M12.1565 8.13333L14.7165 9.61333L15.4165 8.89L12.1565 7L8.87988 8.90667L9.57988 9.63333L12.1565 8.13333Z' fill='white'/%3e%3c/svg%3e";
3558
3422
 
3559
- var DEFAULT_TOOLTIP_PLACEMENT = 'top-start';
3560
- var DotListDivider = function DotListDivider(_a) {
3561
- var item = _a.item,
3562
- index = _a.index;
3563
- if (item.text) {
3564
- return jsxRuntime.jsx(material.ListSubheader, __assign({
3565
- disableSticky: true
3423
+ var img$4 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%2333D389'/%3e%3cpath d='M17.0033 7.62322H16.4567C16.3925 7.62863 16.3324 7.65679 16.2871 7.70264C16.2419 7.74848 16.2146 7.80898 16.21 7.87322V9.14322C15.7432 8.43248 15.1064 7.84955 14.3572 7.44732C13.6081 7.04509 12.7703 6.8363 11.92 6.83989C11.0845 6.84475 10.2627 7.05243 9.52515 7.44508C8.78763 7.83772 8.15649 8.40359 7.68598 9.09405C7.21547 9.7845 6.91966 10.5789 6.82398 11.4089C6.72831 12.2389 6.83562 13.0798 7.13669 13.8592C7.43777 14.6386 7.92361 15.3332 8.55245 15.8834C9.18128 16.4335 9.93431 16.8227 10.7468 17.0176C11.5593 17.2124 12.4069 17.207 13.2169 17.0019C14.0269 16.7967 14.7749 16.398 15.3967 15.8399C15.4257 15.8182 15.4492 15.79 15.4654 15.7576C15.4816 15.7252 15.49 15.6894 15.49 15.6532C15.49 15.617 15.4816 15.5813 15.4654 15.5489C15.4492 15.5165 15.4257 15.4883 15.3967 15.4666L14.9833 15.0532C14.9369 15.0135 14.8778 14.9917 14.8167 14.9917C14.7556 14.9917 14.6965 15.0135 14.65 15.0532C13.9076 15.7352 12.9312 16.1052 11.9233 16.0866C11.1892 16.087 10.4684 15.8897 9.83687 15.5154C9.20531 15.141 8.68627 14.6034 8.33429 13.9591C7.98231 13.3148 7.81039 12.5876 7.83662 11.8539C7.86284 11.1202 8.08624 10.4071 8.48332 9.78959C8.8804 9.17207 9.4365 8.67292 10.0932 8.34461C10.7499 8.0163 11.4828 7.87095 12.2151 7.92384C12.9474 7.97674 13.6519 8.22592 14.2545 8.6452C14.8572 9.06448 15.3358 9.63837 15.64 10.3066H14.1467C14.0828 10.3112 14.0227 10.3387 13.9774 10.384C13.9321 10.4293 13.9046 10.4893 13.9 10.5532V11.0466C13.9046 11.1104 13.9321 11.1705 13.9774 11.2158C14.0227 11.2611 14.0828 11.2886 14.1467 11.2932H17C17.0639 11.2886 17.124 11.2611 17.1693 11.2158C17.2146 11.1705 17.242 11.1104 17.2467 11.0466V7.87322C17.2422 7.8095 17.2154 7.74942 17.1708 7.70364C17.1263 7.65787 17.0669 7.62938 17.0033 7.62322Z' fill='white'/%3e%3cpath d='M12.1232 9.39987C12.1667 9.39747 12.2077 9.37914 12.2384 9.34839C12.2692 9.31764 12.2875 9.27662 12.2899 9.2332C12.2899 9.2332 12.3399 8.8332 12.3399 8.69987C12.3399 8.56653 12.2499 8.4932 12.1666 8.48987C11.5045 8.45232 10.8457 8.60791 10.2703 8.93771C9.69497 9.26752 9.22779 9.75734 8.92557 10.3477C8.62335 10.938 8.4991 11.6034 8.56792 12.263C8.63675 12.9226 8.89568 13.548 9.31325 14.0632C9.83849 14.7239 10.5905 15.1658 11.4232 15.3032C11.5166 15.3032 11.5999 15.2632 11.6299 15.1365C11.6299 15.1365 11.6999 14.8032 11.7132 14.6832C11.7233 14.639 11.7157 14.5927 11.692 14.554C11.6684 14.5154 11.6305 14.4876 11.5866 14.4765C11.225 14.4227 10.8806 14.2869 10.5795 14.0795C10.2785 13.8721 10.029 13.5986 9.84992 13.2799C9.64046 12.9274 9.51393 12.5318 9.47992 12.1232C9.44986 11.7648 9.49697 11.4042 9.61806 11.0655C9.73915 10.7269 9.93142 10.4181 10.1819 10.1601C10.4324 9.90199 10.7353 9.70061 11.0702 9.56947C11.405 9.43834 11.7641 9.38051 12.1232 9.39987Z' fill='white'/%3e%3cpath d='M13.9433 13.1568C13.96 13.1389 13.9724 13.1175 13.9796 13.0942C13.9868 13.0708 13.9885 13.0461 13.9846 13.0219C13.9808 12.9978 13.9714 12.9749 13.9573 12.9549C13.9432 12.9349 13.9247 12.9185 13.9033 12.9068L13.6133 12.7001C13.5739 12.6762 13.5272 12.6674 13.4818 12.6754C13.4364 12.6833 13.3955 12.7075 13.3666 12.7434C13.2321 12.9033 13.0642 13.0318 12.8747 13.12C12.6853 13.2082 12.4789 13.2538 12.2699 13.2538C12.061 13.2538 11.8546 13.2082 11.6651 13.12C11.4757 13.0318 11.3078 12.9033 11.1733 12.7434C11.1277 12.6913 11.0864 12.6356 11.0499 12.5768C10.9268 12.3776 10.8582 12.1495 10.8512 11.9155C10.8442 11.6814 10.8989 11.4496 11.0099 11.2434C11.0314 11.2102 11.0389 11.1699 11.0308 11.1312C11.0227 11.0925 10.9996 11.0585 10.9666 11.0368L10.6333 10.7901C10.5891 10.7715 10.5396 10.7697 10.4942 10.7851C10.4487 10.8004 10.4105 10.8319 10.3866 10.8734C10.2376 11.1465 10.153 11.45 10.1391 11.7608C10.1253 12.0716 10.1825 12.3815 10.3066 12.6668C10.4127 12.938 10.5831 13.1794 10.8033 13.3701C11.1902 13.7461 11.7104 13.9534 12.2499 13.9468C12.5743 13.9565 12.8964 13.8902 13.1905 13.753C13.4845 13.6158 13.7424 13.4116 13.9433 13.1568Z' fill='white'/%3e%3c/svg%3e";
3424
+
3425
+ var img$3 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23279FEA'/%3e%3cpath d='M17.6865 10.0334C17.3062 9.49067 16.7772 9.06934 16.1632 8.82008C15.6426 8.61932 15.0801 8.55138 14.5267 8.62237C13.9733 8.69337 13.4462 8.90108 12.9932 9.22674C12.4991 9.62868 12.0519 10.0849 11.6598 10.5867L11.4232 10.8534L13.0198 11.5434L13.1498 11.4067C13.4002 11.1158 13.6697 10.8419 13.9565 10.5867C14.1891 10.4177 14.4599 10.3085 14.7448 10.269C15.0297 10.2294 15.3199 10.2607 15.5898 10.3601C15.916 10.4798 16.1929 10.7051 16.3765 11.0001C16.5305 11.2108 16.6383 11.4516 16.6932 11.7067C16.7448 11.9619 16.7448 12.2249 16.6932 12.4801C16.6319 12.8145 16.4783 13.125 16.2498 13.3767C16.0471 13.5809 15.7972 13.7319 15.5221 13.8162C15.2471 13.9005 14.9554 13.9156 14.6732 13.8601C14.318 13.7558 13.9714 13.6243 13.6365 13.4667L13.4598 13.3967L12.3032 14.6934L12.6365 14.8367C13.196 15.1144 13.7809 15.3376 14.3832 15.5034C14.841 15.5831 15.3102 15.5706 15.7632 15.4667C16.4116 15.3301 17.0012 14.9945 17.4498 14.5067C17.907 14.0252 18.2099 13.4182 18.3198 12.7634C18.4116 12.2979 18.4116 11.8189 18.3198 11.3534C18.186 10.8803 17.9717 10.4338 17.6865 10.0334Z' fill='white'/%3e%3cpath d='M12.8401 13.0499L11.2468 12.3599L11.1168 12.4966C10.8669 12.7942 10.5962 13.0738 10.3068 13.3332C10.0741 13.5023 9.80337 13.6115 9.51849 13.651C9.2336 13.6905 8.94336 13.6593 8.67345 13.5599C8.35219 13.4397 8.07852 13.2187 7.89345 12.9299C7.74251 12.7191 7.63591 12.4798 7.58012 12.2266C7.51653 11.9342 7.52262 11.6311 7.5979 11.3415C7.67318 11.052 7.81553 10.7842 8.01345 10.5599C8.2156 10.3551 8.46564 10.2039 8.74095 10.1201C9.01626 10.0363 9.30813 10.0225 9.59012 10.0799C9.94807 10.1781 10.2971 10.3063 10.6335 10.4632L10.8101 10.5299L11.9668 9.23324L11.6735 9.11324C11.1141 8.8326 10.5278 8.60924 9.92345 8.44657C9.37154 8.32869 8.79848 8.35611 8.26035 8.52614C7.72222 8.69617 7.23744 9.00299 6.85345 9.41657C6.38782 9.89208 6.08347 10.5019 5.98345 11.1599C5.88532 11.6248 5.88532 12.105 5.98345 12.5699C6.08588 13.0347 6.28211 13.4736 6.56012 13.8599C6.92983 14.4125 7.46217 14.8365 8.08345 15.0732C8.69864 15.3134 9.37049 15.369 10.0168 15.2332C10.4725 15.1299 10.9023 14.9348 11.2801 14.6599C11.7741 14.258 12.2214 13.8018 12.6135 13.2999L12.8401 13.0499Z' fill='white'/%3e%3c/svg%3e";
3426
+
3427
+ var img$2 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23F7B731'/%3e%3cpath d='M17.0168 10.4836C16.8598 10.4819 16.704 10.5111 16.5583 10.5697C16.4126 10.6282 16.2799 10.715 16.1679 10.8249C16.0558 10.9348 15.9665 11.0658 15.9051 11.2103C15.8437 11.3548 15.8114 11.51 15.8101 11.667C15.8125 11.8887 15.8759 12.1056 15.9934 12.2936L15.3268 13.0036C15.1062 12.8766 14.8516 12.8214 14.5982 12.8459C14.3449 12.8704 14.1055 12.9733 13.9134 13.1403L13.2168 12.667C13.3204 12.3753 13.3514 12.0627 13.307 11.7564C13.2626 11.45 13.1441 11.1591 12.9619 10.9089C12.7796 10.6587 12.5391 10.4567 12.2611 10.3204C11.9832 10.1842 11.6762 10.1178 11.3668 10.127C10.9257 10.1237 10.4963 10.268 10.1468 10.537L9.2801 9.74364C9.38078 9.56935 9.43368 9.37158 9.43343 9.1703C9.43084 9.01345 9.39725 8.85866 9.33461 8.71484C9.27197 8.57101 9.18151 8.44099 9.06844 8.33225C8.95537 8.22352 8.82191 8.13821 8.67575 8.08124C8.52958 8.02427 8.3736 7.99677 8.21677 8.0003C7.89915 8.00103 7.59426 8.12525 7.36658 8.34671C7.13891 8.56817 7.00628 8.86949 6.99677 9.18697C6.99848 9.34467 7.03153 9.50046 7.09399 9.64528C7.15645 9.7901 7.24707 9.92106 7.36059 10.0305C7.4741 10.14 7.60825 10.2259 7.75524 10.283C7.90222 10.3402 8.0591 10.3676 8.21677 10.3636C8.43906 10.3609 8.65657 10.2987 8.84677 10.1836L9.71343 10.977C9.49991 11.2949 9.3884 11.6704 9.39376 12.0533C9.39912 12.4363 9.5211 12.8085 9.74343 13.1203L9.07677 13.8303C8.87595 13.7162 8.64759 13.6597 8.41677 13.667C8.18607 13.6729 7.96224 13.7467 7.77327 13.8791C7.5843 14.0116 7.43859 14.1968 7.35437 14.4117C7.27015 14.6265 7.25115 14.8615 7.29975 15.087C7.34836 15.3126 7.46241 15.5189 7.62763 15.68C7.79286 15.8411 8.00192 15.9499 8.22867 15.9928C8.45542 16.0357 8.68978 16.0108 8.90244 15.9212C9.11509 15.8315 9.2966 15.6812 9.42425 15.4889C9.5519 15.2967 9.62002 15.0711 9.6201 14.8403C9.61839 14.6452 9.57041 14.4533 9.4801 14.2803L10.1468 13.5703C10.5613 13.8772 11.0792 14.0102 11.5902 13.9411C12.1013 13.872 12.5653 13.6062 12.8834 13.2003L13.5501 13.637C13.5048 13.7597 13.4811 13.8894 13.4801 14.0203C13.4963 14.3289 13.6304 14.6196 13.8546 14.8323C14.0788 15.045 14.376 15.1636 14.6851 15.1636C14.9942 15.1636 15.2914 15.045 15.5156 14.8323C15.7398 14.6196 15.8739 14.3289 15.8901 14.0203C15.8923 13.8081 15.8333 13.5998 15.7201 13.4203L16.3868 12.7103C16.5613 12.81 16.7591 12.8617 16.9601 12.8603C17.1212 12.8706 17.2827 12.8481 17.4348 12.794C17.5869 12.74 17.7264 12.6555 17.8448 12.5458C17.9633 12.4361 18.0581 12.3035 18.1237 12.156C18.1893 12.0085 18.2241 11.8492 18.2261 11.6878C18.2282 11.5264 18.1974 11.3662 18.1356 11.2171C18.0737 11.068 17.9822 10.933 17.8666 10.8203C17.751 10.7077 17.6137 10.6198 17.463 10.5619C17.3123 10.504 17.1514 10.4774 16.9901 10.4836H17.0168ZM11.3501 13.2436C11.1161 13.2377 10.8891 13.163 10.6973 13.0287C10.5056 12.8944 10.3578 12.7065 10.2723 12.4886C10.1868 12.2707 10.1675 12.0325 10.2167 11.8036C10.266 11.5748 10.3816 11.3656 10.5492 11.2021C10.7167 11.0387 10.9288 10.9283 11.1588 10.8848C11.3887 10.8412 11.6264 10.8665 11.8422 10.9574C12.0579 11.0483 12.242 11.2007 12.3714 11.3957C12.5009 11.5907 12.57 11.8196 12.5701 12.0536C12.5657 12.3719 12.4357 12.6756 12.2085 12.8985C11.9812 13.1214 11.6751 13.2454 11.3568 13.2436H11.3501Z' fill='white'/%3e%3c/svg%3e";
3428
+
3429
+ var img$1 = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z' fill='%23205AB7'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0859 8.30868C16.4108 8.42839 16.6831 8.6593 16.8542 8.96074L16.8628 8.97583L16.8705 8.99134C17.0174 9.28464 17.0775 9.61353 17.0441 9.93936C17.0123 11.03 16.8132 12.1093 16.4535 13.1395L16.4528 13.1415C16.1368 14.0377 15.4456 15.1335 14.6589 16.0108C14.2622 16.4533 13.8228 16.8611 13.3705 17.1668C12.9284 17.4656 12.4155 17.7067 11.8835 17.7262L11.8597 17.7271L11.8358 17.7262C11.291 17.7072 10.7708 17.4701 10.3204 17.1682C9.86244 16.8612 9.42376 16.4516 9.03057 16.0079C8.24999 15.1271 7.57941 14.0321 7.26533 13.1415L7.2645 13.1391C6.90532 12.1083 6.70674 11.0285 6.67566 9.93751C6.64229 9.61177 6.70236 9.28297 6.84922 8.98974L6.85684 8.97453L6.86522 8.95974C7.03585 8.65846 7.30747 8.42744 7.63179 8.30728L11.3874 6.76891C11.4429 6.74689 11.4996 6.7281 11.5571 6.71254C11.7538 6.6514 11.9644 6.6514 12.161 6.71254C12.2186 6.7281 12.2753 6.74693 12.3307 6.76895L12.3374 6.77159L16.0859 8.30868ZM11.9735 7.35255C11.8994 7.32695 11.8188 7.32695 11.7447 7.35255C11.7069 7.36213 11.6698 7.37415 11.6335 7.38855L7.87245 8.92913C7.69157 8.99369 7.53996 9.12117 7.44531 9.28828C7.35196 9.47467 7.31578 9.6845 7.34132 9.89139C7.36791 10.9234 7.55437 11.9449 7.89404 12.9198C8.45396 14.5075 10.3737 17.008 11.8591 17.06C13.2749 17.008 15.2642 14.5075 15.8241 12.9198C16.1642 11.9455 16.3512 10.9245 16.3784 9.89299C16.404 9.6861 16.3678 9.47627 16.2745 9.28988C16.1794 9.12247 16.0272 8.99495 15.8457 8.93073L12.0847 7.38855C12.0484 7.37415 12.0113 7.36213 11.9735 7.35255Z' fill='white'/%3e%3cpath d='M11.8631 8.29559L8.22357 9.77059V10.8904L11.8631 9.33705L15.5025 10.8904V9.77059L11.8631 8.29559Z' fill='white'/%3e%3cpath d='M10.6184 15.718C10.7942 16.0092 11.3957 16.4678 11.8633 16.4774C12.3078 16.4678 12.9324 16.0092 13.108 15.718C13.2835 15.4268 10.4426 15.427 10.6184 15.718Z' fill='white'/%3e%3c/svg%3e";
3430
+
3431
+ var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='-8 -8 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M19.7521 0.348161H20.3976V2.23694H20.7722L20.7752 0.351063H21.4208V0.00290065L19.7521 0V0.348161Z' fill='%232B2B2B'/%3e %3cpath d='M22.31 0.00290065H21.7223V2.23114H22.0785L22.0816 0.438104H22.0877L22.718 2.23404H22.9799L23.6224 0.441005H23.6285L23.6255 2.23404H23.997L24 0.00290065H23.4093L22.8642 1.58994H22.8551L22.31 0.00290065Z' fill='%232B2B2B'/%3e %3cpath d='M16.4863 0C15.3048 0 14.5435 0.713733 14.5435 1.81915L14.5374 8.1557C13.3194 6.89362 11.4893 6.20309 9.34245 6.20019C4.36976 6.19729 0.00609663 10.3636 6.37628e-06 15.1219C-0.00608387 19.8453 4.35149 23.9942 9.32114 24C11.5258 24.0029 13.5904 22.9207 14.6836 21.853C14.8968 23.0135 15.6306 23.6489 16.7726 23.6489C17.7165 23.6489 18.4017 22.9584 18.4047 22.0068L18.4291 1.82495C18.4291 0.734042 17.6496 0.00290135 16.4863 0ZM9.28764 20.0803C6.42218 20.0774 4.08961 17.852 4.09266 15.1161C4.0957 12.383 6.43131 10.1605 9.29677 10.1634C12.1622 10.1663 14.4948 12.3917 14.4918 15.1277C14.4887 17.8607 12.1531 20.0832 9.28764 20.0803Z' fill='%232B2B2B'/%3e %3cpath d='M9.29431 11.7998C7.3363 11.7998 5.74979 13.3143 5.74979 15.1799C5.74979 17.0455 7.3363 18.56 9.29431 18.56C11.2523 18.56 12.8419 17.0455 12.8419 15.1799C12.8419 13.3143 11.2523 11.7998 9.29431 11.7998Z' fill='%23517934'/%3e%3c/svg%3e";
3432
+
3433
+ // Takes a appType name and returns its logo as a data url.
3434
+ // If appType does not exist the Digital.ai logo is returned.
3435
+ var getLogoForAppType = function getLogoForAppType(appType) {
3436
+ switch (appType) {
3437
+ case 'Release':
3438
+ {
3439
+ return img$6;
3440
+ }
3441
+ case 'Deploy':
3442
+ {
3443
+ return img$5;
3444
+ }
3445
+ case 'Agility':
3446
+ {
3447
+ return img$4;
3448
+ }
3449
+ case 'Continuous Testing':
3450
+ {
3451
+ return img$3;
3452
+ }
3453
+ case 'Intelligence':
3454
+ {
3455
+ return img$2;
3456
+ }
3457
+ case 'Application Protection':
3458
+ {
3459
+ return img$1;
3460
+ }
3461
+ default:
3462
+ {
3463
+ return img;
3464
+ }
3465
+ }
3466
+ };
3467
+ var daiAppsHeaderMenuItem = function daiAppsHeaderMenuItem(count) {
3468
+ if (count === void 0) {
3469
+ count = 0;
3470
+ }
3471
+ return sectionHeaderMenuItem('DIGITAL.AI APPLICATIONS', count, true);
3472
+ };
3473
+ var sectionHeaderMenuItem = function sectionHeaderMenuItem(title, count, showEmpty) {
3474
+ if (showEmpty === void 0) {
3475
+ showEmpty = false;
3476
+ }
3477
+ var children = showEmpty || count > 0 ? jsxRuntime.jsxs(DotTypography, __assign({
3478
+ className: "dai-apps-title"
3479
+ }, {
3480
+ children: [title, count > 0 ? " (" + count + ")" : '']
3481
+ }), "menu-item-section-title-" + title) : null;
3482
+ return {
3483
+ children: children,
3484
+ key: "dai-apps-section-header-" + title
3485
+ };
3486
+ };
3487
+ var createMenuItem = function createMenuItem(url, title, subtitle, onClick) {
3488
+ return jsxRuntime.jsxs("div", __assign({
3489
+ className: "app-menu-item"
3490
+ }, {
3491
+ children: [jsxRuntime.jsx(DotLink, __assign({
3492
+ href: url,
3493
+ color: "textPrimary",
3494
+ target: "_blank",
3495
+ onClick: onClick,
3496
+ onPointerDown: onClick
3566
3497
  }, {
3567
- children: jsxRuntime.jsx(DotTypography, __assign({
3568
- variant: "overline"
3498
+ children: jsxRuntime.jsxs("div", __assign({
3499
+ className: "logo-title"
3569
3500
  }, {
3570
- children: item.text
3501
+ children: [jsxRuntime.jsx(DotIcon, {
3502
+ iconId: "open-new-tab"
3503
+ }, void 0), jsxRuntime.jsxs("div", __assign({
3504
+ className: "dot-app-switcher-app-title"
3505
+ }, {
3506
+ children: [jsxRuntime.jsx(DotTypography, __assign({
3507
+ variant: "body1"
3508
+ }, {
3509
+ children: title
3510
+ }), void 0), subtitle && jsxRuntime.jsx(DotTypography, __assign({
3511
+ variant: "body2"
3512
+ }, {
3513
+ children: subtitle
3514
+ }), void 0)]
3515
+ }), void 0)]
3571
3516
  }), void 0)
3572
- }), void 0);
3517
+ }), void 0), jsxRuntime.jsx(DotCopyButton, {
3518
+ copyTooltip: "Copy application URL",
3519
+ value: url
3520
+ }, void 0)]
3521
+ }), "app-menu-item-" + title);
3522
+ };
3523
+ var createTopLevelMenuItem = function createTopLevelMenuItem(url, logo, title, openNewTab) {
3524
+ if (openNewTab === void 0) {
3525
+ openNewTab = true;
3573
3526
  }
3574
- return jsxRuntime.jsx(material.Divider, {
3575
- "aria-hidden": true,
3576
- "data-testid": "divider-" + index
3577
- }, void 0);
3527
+ // Creates an entry in the AppSwitcher at the same level as the AppTypeLabels, used for the Platform link and
3528
+ // Empty state current application link
3529
+ var target = openNewTab ? '_blank' : '_self';
3530
+ return jsxRuntime.jsxs(DotLink, __assign({
3531
+ href: url,
3532
+ color: "textPrimary",
3533
+ target: target
3534
+ }, {
3535
+ children: [jsxRuntime.jsxs("div", __assign({
3536
+ className: "logo-title"
3537
+ }, {
3538
+ children: [jsxRuntime.jsx(DotAvatar, {
3539
+ alt: "app image",
3540
+ imageSrc: logo,
3541
+ type: "image",
3542
+ variant: "circular"
3543
+ }, void 0), jsxRuntime.jsx("div", __assign({
3544
+ className: "dot-app-switcher-app-title"
3545
+ }, {
3546
+ children: jsxRuntime.jsx(DotTypography, __assign({
3547
+ variant: "body1"
3548
+ }, {
3549
+ children: title
3550
+ }), void 0)
3551
+ }), void 0)]
3552
+ }), void 0), openNewTab && jsxRuntime.jsx(DotIcon, {
3553
+ iconId: "open-new-tab"
3554
+ }, void 0)]
3555
+ }), "top-menu-item-" + title);
3578
3556
  };
3579
- var DotList = function DotList(_a) {
3580
- var ariaLabel = _a.ariaLabel,
3581
- children = _a.children,
3582
- className = _a.className,
3583
- _b = _a.component,
3584
- component = _b === void 0 ? 'ul' : _b,
3585
- dataTestId = _a["data-testid"],
3586
- _c = _a.dense,
3587
- dense = _c === void 0 ? false : _c,
3588
- _d = _a.disablePadding,
3589
- disablePadding = _d === void 0 ? false : _d,
3590
- _e = _a.items,
3591
- items = _e === void 0 ? [] : _e,
3592
- _f = _a.menuPlacement,
3593
- menuPlacement = _f === void 0 ? 'right-start' : _f,
3594
- _g = _a.nestedDrawerLeftSpacing,
3595
- nestedDrawerLeftSpacing = _g === void 0 ? 240 : _g,
3596
- _h = _a.nestedListType,
3597
- nestedListType = _h === void 0 ? 'expandable' : _h,
3598
- _j = _a.width,
3599
- width = _j === void 0 ? 240 : _j;
3600
- var rootClasses = useStylesWithRootClass(rootClassName$O, className);
3601
- var listWidth = typeof width === 'number' ? width + "px" : width;
3602
- var listRef = React.useRef();
3603
- var _k = React.useState(null),
3604
- listItemIndex = _k[0],
3605
- setListItemIndex = _k[1];
3606
- var updateSelectedListItem = function updateSelectedListItem(currentIndex) {
3607
- currentIndex === listItemIndex ? setListItemIndex(null) : setListItemIndex(currentIndex);
3557
+ var createAppTypeLabel = function createAppTypeLabel(appTypeName, logo, appProps) {
3558
+ var logoProps = logo ? {
3559
+ imageSrc: logo
3560
+ } : {
3561
+ iconId: 'collection'
3608
3562
  };
3609
- return jsxRuntime.jsxs(StyledList, __assign({
3610
- "aria-label": ariaLabel,
3611
- classes: {
3612
- root: rootClasses
3613
- },
3614
- component: component,
3615
- "data-testid": dataTestId,
3616
- dense: dense,
3617
- disablePadding: disablePadding,
3618
- ref: listRef,
3619
- style: {
3620
- width: listWidth
3563
+ return jsxRuntime.jsxs("div", __assign({
3564
+ className: "logo-title"
3565
+ }, {
3566
+ children: [jsxRuntime.jsx(DotAvatar, __assign({}, logoProps, {
3567
+ alt: "app image",
3568
+ type: "image",
3569
+ variant: "circular"
3570
+ }), void 0), jsxRuntime.jsxs("div", __assign({
3571
+ className: "dot-app-switcher-app-title"
3572
+ }, {
3573
+ children: [jsxRuntime.jsx(DotTypography, __assign({
3574
+ variant: "body1"
3575
+ }, {
3576
+ children: appTypeName
3577
+ }), void 0), jsxRuntime.jsxs(DotTypography, __assign({
3578
+ variant: "body2"
3579
+ }, {
3580
+ children: ["Instance (", appProps.length, ")"]
3581
+ }), void 0)]
3582
+ }), void 0)]
3583
+ }), void 0);
3584
+ };
3585
+ var getInstanceStateText = function getInstanceStateText(application) {
3586
+ if (application.instance_state === 1) {
3587
+ return 'Production instance';
3588
+ }
3589
+ return 'Non-production instance';
3590
+ };
3591
+ var sortRecentAppInstancesFn = function sortRecentAppInstancesFn(a, b) {
3592
+ var appA = a.application;
3593
+ var appB = b.application;
3594
+ return sortAppInstancesFn(appA, appB);
3595
+ };
3596
+ var sortAppInstancesFn = function sortAppInstancesFn(a, b) {
3597
+ var result = a.name.localeCompare(b.name);
3598
+ if (result === 0) {
3599
+ if (a.instance_state > b.instance_state) {
3600
+ result = -1;
3601
+ } else if (a.instance_state < b.instance_state) {
3602
+ result = 1;
3621
3603
  }
3622
- }, {
3623
- children: [items.map(function (item, index) {
3624
- var handleListItemClick = function handleListItemClick(e) {
3625
- var _a;
3626
- updateSelectedListItem(index);
3627
- (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, e);
3628
- };
3629
- var handleMenuLeave = function handleMenuLeave(event) {
3630
- var _a, _b;
3631
- // Remove index only if clicked element is not found within the list
3632
- if (!((_a = listRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target))) {
3633
- setListItemIndex(null);
3634
- (_b = item.onMenuLeave) === null || _b === void 0 ? void 0 : _b.call(item, event);
3635
- }
3636
- };
3637
- if (item.child) {
3638
- return jsxRuntime.jsx(React.Fragment, {
3639
- children: item.child
3640
- }, "item-child-" + index);
3604
+ }
3605
+ return result;
3606
+ };
3607
+ var RECENT_INSTANCES_KEY = 'dot-app-switcher-recent-app-instances';
3608
+ var recentAppInstancesSetter = function recentAppInstancesSetter(latestInstance, maxRecentItems
3609
+ //): (RecentAppInstance[]) => RecentAppInstance[])=> {
3610
+ ) {
3611
+ return function (orig) {
3612
+ var lastAccess = Date.now();
3613
+ var isNew = true;
3614
+ var oldestIndex = 0;
3615
+ var oldestAccess = lastAccess;
3616
+ orig.forEach(function (item, index) {
3617
+ if (item.application.id === latestInstance.id) {
3618
+ isNew = false;
3619
+ // don't need to rerender so eventually returning orig
3620
+ item.lastAccess = lastAccess;
3641
3621
  }
3642
- if (item.divider) {
3643
- return jsxRuntime.jsx(DotListDivider, {
3644
- index: index,
3645
- item: item
3646
- }, "divider-" + index);
3622
+ if (item.lastAccess < oldestAccess) {
3623
+ oldestIndex = index;
3624
+ oldestAccess = item.lastAccess;
3647
3625
  }
3648
- return jsxRuntime.jsx(DotListItem, {
3649
- className: item.className,
3650
- component: item.component,
3651
- "data-testid": dataTestId + "-item-" + index,
3652
- endIcon: item.endIcon,
3653
- href: item.href,
3654
- isOpened: listItemIndex === index,
3655
- items: item.items,
3656
- menuPlacement: menuPlacement,
3657
- nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
3658
- nestedListType: nestedListType,
3659
- onClick: item.href && !item.onClick ? null : handleListItemClick,
3660
- onMenuLeave: handleMenuLeave,
3661
- primaryText: item.primaryText,
3662
- secondaryText: item.secondaryText,
3663
- selected: item.selected,
3664
- startIcon: item.startIcon,
3665
- target: item.target,
3666
- text: item.text,
3667
- tooltip: item.tooltip,
3668
- tooltipPlacement: item.tooltipPlacement || DEFAULT_TOOLTIP_PLACEMENT
3669
- }, index);
3670
- }), children]
3671
- }), void 0);
3626
+ });
3627
+ if (isNew) {
3628
+ var newRecentItem = {
3629
+ application: latestInstance,
3630
+ lastAccess: lastAccess
3631
+ };
3632
+ var newRecent = void 0;
3633
+ if (orig.length >= maxRecentItems) {
3634
+ newRecent = __spreadArray([], orig);
3635
+ newRecent.splice(oldestIndex, 1, newRecentItem);
3636
+ } else {
3637
+ newRecent = __spreadArray(__spreadArray([], orig), [newRecentItem]);
3638
+ }
3639
+ newRecent.sort(sortRecentAppInstancesFn);
3640
+ localStorage.setItem(RECENT_INSTANCES_KEY, JSON.stringify(newRecent));
3641
+ return newRecent;
3642
+ }
3643
+ return orig;
3644
+ };
3672
3645
  };
3673
- var DotListItem = function DotListItem(_a) {
3674
- var ariaLabel = _a.ariaLabel,
3646
+
3647
+ var rootClassName$K = 'dot-app-switcher';
3648
+ var StyledAppSwitcher = styled__default["default"](DotDrawer).withConfig({
3649
+ displayName: "AppSwitcherstyles__StyledAppSwitcher",
3650
+ componentId: "hhxfqg-0"
3651
+ })(templateObject_2$K || (templateObject_2$K = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
3652
+ var theme = _a.theme;
3653
+ return styled.css(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n &.", " {\n .dot-drawer-paper {\n padding: 0;\n }\n .content {\n padding: ", ";\n overflow-y: auto;\n }\n .app-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .dot-link,\n .product-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 60px;\n text-decoration: none;\n cursor: pointer;\n }\n .logo-title {\n display: flex;\n align-items: center;\n gap: 24px;\n width: 100%;\n }\n .dot-avatar {\n flex-basis: 40px;\n }\n .dai-apps-title {\n display: flex;\n align-items: center;\n height: 32px;\n padding: ", ";\n margin-top: ", ";\n background-color: ", ";\n }\n .dot-app-switcher-app-title {\n min-width: 150px;\n }\n .dot-icon {\n flex-basis: content;\n }\n .app-switcher-header {\n .app-switcher-header-title {\n display: flex;\n align-items: center;\n }\n display: flex;\n justify-content: space-between;\n align-items: end;\n border-bottom: 1px solid ", ";\n padding: ", ";\n .app-switcher-label {\n padding-left: ", ";\n }\n }\n .app-switcher-back-button {\n &.dot-button.MuiButton-text {\n padding-left: 0;\n }\n }\n .product-heading {\n display: flex;\n align-items: center;\n gap: 24px;\n padding-bottom: ", ";\n }\n .product-applications {\n width: 100%;\n }\n .product-applications-search {\n margin-bottom: ", ";\n }\n }\n "], ["\n &.", " {\n .dot-drawer-paper {\n padding: 0;\n }\n .content {\n padding: ", ";\n overflow-y: auto;\n }\n .app-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n }\n .dot-link,\n .product-menu-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 60px;\n text-decoration: none;\n cursor: pointer;\n }\n .logo-title {\n display: flex;\n align-items: center;\n gap: 24px;\n width: 100%;\n }\n .dot-avatar {\n flex-basis: 40px;\n }\n .dai-apps-title {\n display: flex;\n align-items: center;\n height: 32px;\n padding: ", ";\n margin-top: ", ";\n background-color: ", ";\n }\n .dot-app-switcher-app-title {\n min-width: 150px;\n }\n .dot-icon {\n flex-basis: content;\n }\n .app-switcher-header {\n .app-switcher-header-title {\n display: flex;\n align-items: center;\n }\n display: flex;\n justify-content: space-between;\n align-items: end;\n border-bottom: 1px solid ", ";\n padding: ", ";\n .app-switcher-label {\n padding-left: ", ";\n }\n }\n .app-switcher-back-button {\n &.dot-button.MuiButton-text {\n padding-left: 0;\n }\n }\n .product-heading {\n display: flex;\n align-items: center;\n gap: 24px;\n padding-bottom: ", ";\n }\n .product-applications {\n width: 100%;\n }\n .product-applications-search {\n margin-bottom: ", ";\n }\n }\n "])), rootClassName$K, theme.spacing(0, 2, 1, 2), theme.spacing(0, 0, 0, 1), theme.spacing(1), theme.palette.grey[50], theme.palette.grey[200], theme.spacing(0, 2, 1, 2), theme.spacing(3), theme.spacing(3), theme.spacing(3));
3654
+ });
3655
+ var templateObject_1$N, templateObject_2$K;
3656
+
3657
+ var DotAppSwitcherView = function DotAppSwitcherView(_a) {
3658
+ var activeApp = _a.activeApp,
3659
+ apps = _a.apps,
3675
3660
  className = _a.className,
3676
- _b = _a.component,
3677
- component = _b === void 0 ? 'li' : _b,
3678
- dataTestId = _a["data-testid"],
3679
- _c = _a.divider,
3680
- divider = _c === void 0 ? false : _c,
3681
- endIcon = _a.endIcon,
3682
- href = _a.href,
3683
- isOpened = _a.isOpened,
3684
- onClick = _a.onClick,
3685
- onMenuLeave = _a.onMenuLeave,
3686
- _d = _a.items,
3687
- items = _d === void 0 ? [] : _d,
3688
- menuPlacement = _a.menuPlacement,
3689
- nestedDrawerLeftSpacing = _a.nestedDrawerLeftSpacing,
3690
- nestedListType = _a.nestedListType,
3691
- primaryText = _a.primaryText,
3692
- secondaryText = _a.secondaryText,
3693
- selected = _a.selected,
3694
- startIcon = _a.startIcon,
3695
- target = _a.target,
3696
- text = _a.text,
3697
- tooltip = _a.tooltip,
3698
- _e = _a.tooltipPlacement,
3699
- tooltipPlacement = _e === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _e;
3700
- var hasChildren = items.length > 0;
3701
- var isFlyout = nestedListType === 'menu' && hasChildren;
3702
- var _f = React.useState(null),
3703
- anchorEl = _f[0],
3704
- setAnchorEl = _f[1];
3705
- var showEndIcon = endIcon || hasChildren;
3706
- var rootClasses = useStylesWithRootClass(listItemRootClass, className, isOpened ? 'open' : '');
3707
- var toggleOpen = function toggleOpen(event) {
3708
- return setAnchorEl(event.currentTarget);
3709
- };
3710
- var handleClick = function handleClick(event) {
3711
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
3712
- toggleOpen(event);
3713
- };
3714
- var handleMenuLeave = function handleMenuLeave(event) {
3715
- return onMenuLeave(event);
3716
- };
3717
- var renderListItemText = function renderListItemText() {
3718
- return primaryText && secondaryText ? jsxRuntime.jsx(material.ListItemText, {
3719
- primary: primaryText,
3720
- secondary: secondaryText
3721
- }, void 0) : jsxRuntime.jsx(DotTypography, __assign({
3722
- variant: "body1"
3723
- }, {
3724
- children: text
3725
- }), void 0);
3726
- };
3727
- var renderListItemEndIcon = function renderListItemEndIcon() {
3728
- if (hasChildren || !endIcon) {
3729
- return jsxRuntime.jsx(DotIcon, {
3730
- iconId: hasChildren && getChevronIcon(nestedListType, isOpened)
3731
- }, void 0);
3661
+ _b = _a.maxRecentInstances,
3662
+ maxRecentInstances = _b === void 0 ? 5 : _b,
3663
+ _c = _a.noAppTypeLabel,
3664
+ noAppTypeLabel = _c === void 0 ? 'Other' : _c,
3665
+ platformConsoleUrl = _a.platformConsoleUrl,
3666
+ onClose = _a.onClose,
3667
+ open = _a.open,
3668
+ _d = _a.searchInstancesThreshold,
3669
+ searchInstancesThreshold = _d === void 0 ? 5 : _d,
3670
+ selectedAppType = _a.selectedAppType,
3671
+ _e = _a.yOffset,
3672
+ yOffset = _e === void 0 ? 64 : _e,
3673
+ _f = _a.zIndex,
3674
+ zIndex = _f === void 0 ? 990 : _f;
3675
+ var dotCoreApiContext = useDotCoreApiContext();
3676
+ var setSelectedAppType = null;
3677
+ if (dotCoreApiContext !== null) {
3678
+ setSelectedAppType = dotCoreApiContext.setSelectedAppSwitcherAppType;
3679
+ }
3680
+ var rootClasses = useStylesWithRootClass(rootClassName$K, className);
3681
+ var _g = React.useState(),
3682
+ appTypeMap = _g[0],
3683
+ setAppTypeMap = _g[1];
3684
+ var _h = React.useState(),
3685
+ appTypeLabels = _h[0],
3686
+ setAppTypeLabels = _h[1];
3687
+ var _j = React.useState(),
3688
+ appTypeMenuItems = _j[0],
3689
+ setAppTypeMenuItems = _j[1];
3690
+ var _k = React.useState(null),
3691
+ selectedAppTypeAlt = _k[0],
3692
+ setSelectedAppTypeAlt = _k[1];
3693
+ var _l = React.useState(''),
3694
+ searchText = _l[0],
3695
+ setSearchText = _l[1];
3696
+ var cachedRecentItemsJson = localStorage.getItem(RECENT_INSTANCES_KEY);
3697
+ var _m = React.useState(cachedRecentItemsJson ? JSON.parse(cachedRecentItemsJson) : []),
3698
+ recentAppInstances = _m[0],
3699
+ setRecentAppInstances = _m[1];
3700
+ if (!setSelectedAppType) {
3701
+ selectedAppType = selectedAppTypeAlt;
3702
+ setSelectedAppType = setSelectedAppTypeAlt;
3703
+ }
3704
+ var showApps = React.useCallback(function (appType) {
3705
+ setSelectedAppType(appType);
3706
+ }, []);
3707
+ var showAppTypes = React.useCallback(function () {
3708
+ setSearchText('');
3709
+ setSelectedAppType(null);
3710
+ }, []);
3711
+ var populateAppTypeMap = React.useCallback(function () {
3712
+ var newAppTypeMap = new Map();
3713
+ // we'll put Other at the end
3714
+ var otherApps = [];
3715
+ apps === null || apps === void 0 ? void 0 : apps.forEach(function (app) {
3716
+ var instanceStateText = getInstanceStateText(app);
3717
+ var children = createMenuItem(app.url, app.name, instanceStateText, function (e) {
3718
+ handleRecentInstance(e, app);
3719
+ });
3720
+ var searchableContent = app.name + " " + instanceStateText;
3721
+ var appTypeName = app.logo_product_name;
3722
+ var appTypeApps;
3723
+ if (appTypeName) {
3724
+ appTypeApps = newAppTypeMap.get(appTypeName);
3725
+ if (!appTypeApps) {
3726
+ appTypeApps = [];
3727
+ newAppTypeMap.set(appTypeName, appTypeApps);
3728
+ }
3729
+ } else {
3730
+ appTypeApps = otherApps;
3731
+ }
3732
+ appTypeApps.push({
3733
+ application: app,
3734
+ children: children,
3735
+ searchableContent: searchableContent,
3736
+ key: app.id
3737
+ });
3738
+ });
3739
+ var keys = Array.from(newAppTypeMap.keys()).sort();
3740
+ var sortedAppTypeMap = new Map();
3741
+ for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
3742
+ var appType = keys_1[_i];
3743
+ var appTypeApps = newAppTypeMap.get(appType);
3744
+ appTypeApps.sort(function (a, b) {
3745
+ return sortAppInstancesFn(a.application, b.application);
3746
+ });
3747
+ sortedAppTypeMap.set(appType, appTypeApps);
3748
+ }
3749
+ var appTypeCount = sortedAppTypeMap.size;
3750
+ if (platformConsoleUrl) {
3751
+ appTypeCount++;
3752
+ }
3753
+ if (otherApps.length > 0) {
3754
+ otherApps.sort(function (a, b) {
3755
+ return sortAppInstancesFn(a.application, b.application);
3756
+ });
3757
+ sortedAppTypeMap.set(noAppTypeLabel, otherApps);
3758
+ }
3759
+ setAppTypeMap(sortedAppTypeMap);
3760
+ var menuItems = [daiAppsHeaderMenuItem(appTypeCount)];
3761
+ if (platformConsoleUrl) {
3762
+ var children = createTopLevelMenuItem(platformConsoleUrl, getLogoForAppType('Platform'), 'Digital.ai Platform', !window.location.href.startsWith(platformConsoleUrl));
3763
+ menuItems.push({
3764
+ children: children,
3765
+ key: 'app-switcher-platform-link'
3766
+ });
3767
+ }
3768
+ var newAppTypeLabels = new Map();
3769
+ sortedAppTypeMap.forEach(function (singleTypeApps, appTypeName) {
3770
+ if ((singleTypeApps === null || singleTypeApps === void 0 ? void 0 : singleTypeApps.length) > 0) {
3771
+ var logo = appTypeName === noAppTypeLabel ? null : getLogoForAppType(appTypeName);
3772
+ newAppTypeLabels.set(appTypeName, {
3773
+ logo: logo,
3774
+ singleTypeApps: singleTypeApps
3775
+ });
3776
+ menuItems.push({
3777
+ children: jsxRuntime.jsxs("div", __assign({
3778
+ className: "product-menu-item",
3779
+ onClick: function () {
3780
+ return showApps(appTypeName);
3781
+ },
3782
+ tabIndex: 0
3783
+ }, {
3784
+ children: [createAppTypeLabel(appTypeName, logo, singleTypeApps), jsxRuntime.jsx(DotIcon, {
3785
+ iconId: "chevron-right"
3786
+ }, void 0)]
3787
+ }), "menu-item-" + appTypeName),
3788
+ key: appTypeName
3789
+ });
3790
+ }
3791
+ });
3792
+ setAppTypeMenuItems(menuItems);
3793
+ setAppTypeLabels(newAppTypeLabels);
3794
+ }, [apps]);
3795
+ var emptyState = React.useCallback(function () {
3796
+ var currentAppMenuItem = createTopLevelMenuItem(window.location.href, getLogoForAppType(activeApp.product), activeApp.name, false);
3797
+ setAppTypeMenuItems([daiAppsHeaderMenuItem(), {
3798
+ children: currentAppMenuItem,
3799
+ key: 'no_applications_configured'
3800
+ }]);
3801
+ }, [activeApp]);
3802
+ React.useEffect(function () {
3803
+ if ((apps === null || apps === void 0 ? void 0 : apps.length) > 0) {
3804
+ populateAppTypeMap();
3805
+ } else {
3806
+ emptyState();
3807
+ }
3808
+ }, [apps]);
3809
+ var onAppInstanceSearchTextChange = React.useCallback(function (text) {
3810
+ setSearchText(text);
3811
+ }, []);
3812
+ var clearAppInstanceSearchText = React.useCallback(function () {
3813
+ setSearchText('');
3814
+ }, []);
3815
+ var closeHandler = React.useCallback(function (event) {
3816
+ setSearchText('');
3817
+ onClose && onClose(event);
3818
+ }, [onClose]);
3819
+ var filteredAppInstances = React.useCallback(function () {
3820
+ var _a;
3821
+ return (_a = appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.filter(function (item) {
3822
+ var isMatch = !searchText;
3823
+ if (searchText) {
3824
+ var testStr = isLowerCase(searchText) ? item.searchableContent.toLowerCase() : item.searchableContent;
3825
+ isMatch = testStr.indexOf(searchText) >= 0;
3826
+ }
3827
+ return isMatch;
3828
+ }).map(function (item) {
3829
+ return item.children;
3830
+ });
3831
+ }, [appTypeMap, selectedAppType, searchText]);
3832
+ var handleRecentInstance = React.useCallback(function (event, latestInstance) {
3833
+ // middle button counts; click to open context menu does not
3834
+ if (event.button < 2) {
3835
+ setRecentAppInstances(recentAppInstancesSetter(latestInstance, maxRecentInstances));
3732
3836
  }
3733
- return endIcon;
3734
- };
3735
- return jsxRuntime.jsxs(jsxRuntime.Fragment, {
3736
- children: [jsxRuntime.jsx(DotTooltip, __assign({
3737
- "data-testid": dataTestId + "-tooltip",
3738
- placement: tooltipPlacement,
3739
- title: tooltip
3837
+ }, [recentAppInstances]);
3838
+ var recentAppInstancesSection = jsxRuntime.jsxs(jsxRuntime.Fragment, {
3839
+ children: [sectionHeaderMenuItem('RECENT', recentAppInstances.length).children, jsxRuntime.jsx("div", __assign({
3840
+ className: "product-applications"
3740
3841
  }, {
3741
- children: jsxRuntime.jsxs(StyledListItem, __assign({
3742
- "aria-label": ariaLabel,
3743
- button: true,
3744
- classes: {
3745
- root: rootClasses
3746
- },
3747
- component: href && !onClick ? 'a' : component,
3748
- "data-testid": dataTestId,
3749
- divider: divider,
3750
- href: onClick ? null : href,
3751
- onClick: onClick || !href ? handleClick : null,
3752
- selected: isFlyout ? isOpened : selected,
3753
- target: target
3842
+ children: recentAppInstances.map(function (item) {
3843
+ var app = item.application;
3844
+ return createMenuItem(app.url, app.name, getInstanceStateText(app), function (e) {
3845
+ handleRecentInstance(e, app);
3846
+ });
3847
+ })
3848
+ }), void 0)]
3849
+ }, void 0);
3850
+ var content = function content() {
3851
+ var _a;
3852
+ if (selectedAppType && appTypeMap && appTypeLabels) {
3853
+ var labelConfig = appTypeLabels.get(selectedAppType);
3854
+ return jsxRuntime.jsxs("div", __assign({
3855
+ className: "content"
3754
3856
  }, {
3755
- children: [jsxRuntime.jsxs("span", __assign({
3756
- className: listItemLinkClassName
3857
+ children: [jsxRuntime.jsx("span", {
3858
+ children: jsxRuntime.jsx(DotButton, __assign({
3859
+ className: "app-switcher-back-button",
3860
+ type: "text",
3861
+ onClick: showAppTypes,
3862
+ startIcon: jsxRuntime.jsx(DotIcon, {
3863
+ iconId: "back"
3864
+ }, void 0)
3865
+ }, {
3866
+ children: jsxRuntime.jsx("span", {
3867
+ children: "Back"
3868
+ }, void 0)
3869
+ }), void 0)
3870
+ }, void 0), jsxRuntime.jsx("div", __assign({
3871
+ className: "product-heading"
3757
3872
  }, {
3758
- children: [startIcon && jsxRuntime.jsx(material.ListItemIcon, {
3759
- children: startIcon
3760
- }, void 0), renderListItemText()]
3761
- }), void 0), showEndIcon && renderListItemEndIcon()]
3762
- }), void 0)
3763
- }), void 0), hasChildren && jsxRuntime.jsx(NestedList, {
3764
- anchorEl: anchorEl,
3765
- ariaLabel: "nested list",
3766
- "data-testid": "nestedList",
3767
- items: items,
3768
- menuPlacement: menuPlacement,
3769
- nestedDrawerLeftSpacing: nestedDrawerLeftSpacing,
3770
- onMenuLeave: handleMenuLeave,
3771
- open: isOpened,
3772
- type: nestedListType
3773
- }, void 0)]
3774
- }, void 0);
3775
- };
3776
- var NestedList = function NestedList(_a) {
3777
- var ariaLabel = _a.ariaLabel,
3778
- anchorEl = _a.anchorEl,
3779
- dataTestId = _a["data-testid"],
3780
- items = _a.items,
3781
- menuPlacement = _a.menuPlacement,
3782
- nestedDrawerLeftSpacing = _a.nestedDrawerLeftSpacing,
3783
- onMenuLeave = _a.onMenuLeave,
3784
- open = _a.open,
3785
- parentItemIndex = _a.parentItemIndex,
3786
- type = _a.type;
3787
- var flyoutItemClasses = useStylesWithRootClass(listItemRootClass, flyoutListItemClassName);
3788
- var flyoutSpanClasses = useStylesWithRootClass(listItemLinkClassName, flyoutItemLinkClassName);
3789
- if (type === 'expandable') {
3790
- return jsxRuntime.jsx(material.Collapse, __assign({
3791
- in: open,
3792
- timeout: "auto",
3793
- unmountOnExit: true
3794
- }, {
3795
- children: jsxRuntime.jsx(DotList, {
3796
- ariaLabel: ariaLabel,
3797
- className: nestedListClassName,
3798
- component: "div",
3799
- "data-testid": dataTestId,
3800
- disablePadding: true,
3801
- items: items
3802
- }, parentItemIndex)
3803
- }), void 0);
3804
- }
3805
- if (type === 'menu') {
3806
- var menuItems = items.map(function (item, index) {
3807
- var href = item.href,
3808
- target = item.target,
3809
- onClick = item.onClick,
3810
- tooltip = item.tooltip,
3811
- _a = item.tooltipPlacement,
3812
- tooltipPlacement = _a === void 0 ? DEFAULT_TOOLTIP_PLACEMENT : _a,
3813
- text = item.text;
3814
- return {
3815
- children: jsxRuntime.jsx(DotTooltip, __assign({
3816
- placement: tooltipPlacement,
3817
- title: tooltip
3873
+ children: createAppTypeLabel(selectedAppType, labelConfig.logo, labelConfig.singleTypeApps)
3874
+ }), void 0), ((_a = appTypeMap === null || appTypeMap === void 0 ? void 0 : appTypeMap.get(selectedAppType)) === null || _a === void 0 ? void 0 : _a.length) >= searchInstancesThreshold && jsxRuntime.jsx("div", {
3875
+ children: jsxRuntime.jsx(SearchInput, {
3876
+ "data-testid": "app-instance-search-input",
3877
+ onChange: onAppInstanceSearchTextChange,
3878
+ onClear: clearAppInstanceSearchText,
3879
+ value: searchText
3880
+ }, void 0)
3881
+ }, void 0), jsxRuntime.jsx("div", __assign({
3882
+ className: "product-applications"
3818
3883
  }, {
3819
- children: jsxRuntime.jsx(StyledListItem, __assign({
3820
- className: flyoutItemClasses,
3821
- component: href && !onClick ? 'a' : null,
3822
- "data-testid": dataTestId + "-item-" + index,
3823
- href: href,
3824
- onClick: onClick,
3825
- target: target
3826
- }, {
3827
- children: jsxRuntime.jsxs("span", __assign({
3828
- className: flyoutSpanClasses
3829
- }, {
3830
- children: [item.startIcon, jsxRuntime.jsx(DotTypography, __assign({
3831
- variant: "body1"
3832
- }, {
3833
- children: text
3834
- }), void 0)]
3835
- }), void 0)
3836
- }), parentItemIndex + "-" + index)
3837
- }), parentItemIndex + "-" + index + "-tooltip"),
3838
- classes: '',
3839
- key: String(index)
3840
- };
3841
- });
3842
- return jsxRuntime.jsx(DotMenu, {
3843
- anchorEl: anchorEl,
3844
- ariaLabel: ariaLabel,
3845
- className: flyoutMenuClassName,
3846
- "data-testid": dataTestId,
3847
- id: CreateUUID(),
3848
- menuItemHeight: "auto",
3849
- menuItems: menuItems,
3850
- menuPlacement: menuPlacement,
3851
- onLeave: onMenuLeave,
3852
- open: open
3853
- }, parentItemIndex);
3854
- }
3855
- if (type === 'drawer') {
3856
- return jsxRuntime.jsx(StyledDotDrawer, __assign({
3857
- PaperProps: {
3858
- style: {
3859
- left: nestedDrawerLeftSpacing + "px"
3860
- }
3884
+ children: filteredAppInstances()
3885
+ }), void 0)]
3886
+ }), void 0);
3887
+ } else {
3888
+ return jsxRuntime.jsxs("div", __assign({
3889
+ className: "content"
3890
+ }, {
3891
+ children: [jsxRuntime.jsx(DotList, {
3892
+ items: appTypeMenuItems === null || appTypeMenuItems === void 0 ? void 0 : appTypeMenuItems.map(function (item) {
3893
+ return {
3894
+ child: item.children
3895
+ };
3896
+ }),
3897
+ width: "100%"
3898
+ }, void 0), recentAppInstancesSection]
3899
+ }), void 0);
3900
+ }
3901
+ };
3902
+ var header = {
3903
+ className: 'app-switcher-header',
3904
+ children: jsxRuntime.jsxs("div", __assign({
3905
+ className: "app-switcher-header-title",
3906
+ style: {
3907
+ marginTop: yOffset + 'px',
3908
+ width: '80%'
3909
+ }
3910
+ }, {
3911
+ children: [jsxRuntime.jsx(DotAvatar, {
3912
+ iconId: "apps",
3913
+ alt: "app image",
3914
+ type: "image",
3915
+ variant: "circular"
3916
+ }, void 0), jsxRuntime.jsx(DotTypography, __assign({
3917
+ className: "app-switcher-label"
3918
+ }, {
3919
+ children: "App switcher"
3920
+ }), void 0)]
3921
+ }), void 0)
3922
+ };
3923
+ return jsxRuntime.jsx(StyledAppSwitcher, __assign({
3924
+ className: rootClasses,
3925
+ ModalProps: {
3926
+ style: {
3927
+ zIndex: zIndex
3861
3928
  },
3862
- anchor: "left",
3863
- className: nestedDrawerClassName,
3864
- "data-testid": "nested-drawer",
3929
+ hideBackdrop: true
3930
+ },
3931
+ drawerHeaderProps: header,
3932
+ variant: "temporary",
3933
+ width: "340px",
3934
+ open: open,
3935
+ onClose: closeHandler
3936
+ }, {
3937
+ children: content()
3938
+ }), void 0);
3939
+ };
3940
+ var DotAppSwitcher = function DotAppSwitcher(_a) {
3941
+ var accountId = _a.accountId,
3942
+ _b = _a.includePlatformConsole,
3943
+ includePlatformConsole = _b === void 0 ? true : _b,
3944
+ onClose = _a.onClose,
3945
+ commonProps = __rest(_a, ["accountId", "includePlatformConsole", "onClose"]);
3946
+ var _c = useDotCoreApiContext(),
3947
+ applications = _c.applications,
3948
+ applicationsLoading = _c.applicationsLoading,
3949
+ applicationsError = _c.applicationsError,
3950
+ loadApplications = _c.loadApplications,
3951
+ open = _c.isAppSwitcherOpen,
3952
+ platformConsoleUrl = _c.platformConsoleUrl,
3953
+ setOpen = _c.setIsAppSwitcherOpen,
3954
+ selectedAppType = _c.selectedAppSwitcherAppType,
3955
+ setSelectedAppType = _c.setSelectedAppSwitcherAppType;
3956
+ React.useEffect(function () {
3957
+ if ((!applications || applications.length === 0) && open) {
3958
+ loadApplications(accountId);
3959
+ }
3960
+ }, [accountId, open]);
3961
+ if (applicationsError) {
3962
+ console.error('Error loading application list in AppSwitcher', applicationsError);
3963
+ }
3964
+ var closeHandler = React.useCallback(function (event) {
3965
+ setOpen(false);
3966
+ setSelectedAppType(null);
3967
+ onClose && onClose(event);
3968
+ }, [onClose]);
3969
+ var viewProps = includePlatformConsole ? __assign(__assign({}, commonProps), {
3970
+ platformConsoleUrl: platformConsoleUrl
3971
+ }) : __assign({}, commonProps);
3972
+ if (!applicationsLoading && !applicationsError) {
3973
+ return jsxRuntime.jsx(DotAppSwitcherView, __assign({}, viewProps, {
3865
3974
  open: open,
3866
- variant: "persistent"
3867
- }, {
3868
- children: jsxRuntime.jsx(DotList, {
3869
- ariaLabel: ariaLabel,
3870
- className: nestedListClassName,
3871
- component: "div",
3872
- "data-testid": dataTestId,
3873
- disablePadding: true,
3874
- items: items,
3875
- width: '100%'
3876
- }, parentItemIndex)
3975
+ apps: applications,
3976
+ selectedAppType: selectedAppType,
3977
+ onClose: closeHandler
3877
3978
  }), void 0);
3878
3979
  }
3980
+ return null;
3879
3981
  };
3880
3982
 
3881
3983
  var _path$2, _path2$2, _path3, _path4;
@@ -4465,7 +4567,7 @@
4465
4567
  componentId: "j2sgjy-0"
4466
4568
  })(templateObject_2$F || (templateObject_2$F = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
4467
4569
  var theme = _a.theme;
4468
- return styled.css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n &.", " {\n &.", " .dot-text-field .", " {\n height: 56px;\n padding-left: ", ";\n }\n\n .", " {\n /* Override only top/bottom, but preserve left/right padding */\n padding-top: ", ";\n padding-bottom: ", ";\n }\n\n .dot-chip:first-child {\n margin-left: ", ";\n }\n\n .dot-text-field {\n .", " {\n height: ", ";\n }\n\n .warning-icon {\n color: ", ";\n }\n .error-icon {\n color: ", ";\n }\n }\n }\n "], ["\n &.", " {\n &.", " .dot-text-field .", " {\n height: 56px;\n padding-left: ", ";\n }\n\n .", " {\n /* Override only top/bottom, but preserve left/right padding */\n padding-top: ", ";\n padding-bottom: ", ";\n }\n\n .dot-chip:first-child {\n margin-left: ", ";\n }\n\n .dot-text-field {\n .", " {\n height: ", ";\n }\n\n .warning-icon {\n color: ", ";\n }\n .error-icon {\n color: ", ";\n }\n }\n }\n "])), rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main);
4570
+ return styled.css(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n &.", " {\n &.", " .dot-text-field .", " {\n height: 56px;\n padding-left: ", ";\n }\n\n .", " {\n /* Override only top/bottom, but preserve left/right padding */\n padding-top: ", ";\n padding-bottom: ", ";\n }\n\n .dot-chip:first-child {\n margin-left: ", ";\n }\n\n .dot-text-field {\n .", " {\n min-height: ", ";\n }\n\n .warning-icon {\n color: ", ";\n }\n .error-icon {\n color: ", ";\n }\n }\n }\n "], ["\n &.", " {\n &.", " .dot-text-field .", " {\n height: 56px;\n padding-left: ", ";\n }\n\n .", " {\n /* Override only top/bottom, but preserve left/right padding */\n padding-top: ", ";\n padding-bottom: ", ";\n }\n\n .dot-chip:first-child {\n margin-left: ", ";\n }\n\n .dot-text-field {\n .", " {\n min-height: ", ";\n }\n\n .warning-icon {\n color: ", ";\n }\n .error-icon {\n color: ", ";\n }\n }\n }\n "])), rootClassName$F, inputMediumClassName, inputRootClassName, theme.spacing(2), inputRootClassName, theme.spacing(0), theme.spacing(0), theme.spacing(0), inputRootClassName, theme.spacing(5), theme.palette.warning.main, theme.palette.error.main);
4469
4571
  });
4470
4572
  var templateObject_1$I, templateObject_2$F;
4471
4573
 
@@ -4706,7 +4808,7 @@
4706
4808
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4707
4809
  var DotPopper = function DotPopper(props) {
4708
4810
  if (!isActionItemDefined) return jsxRuntime.jsx(StyledPopper, __assign({}, props, {
4709
- className: rootClassName$M,
4811
+ className: rootClassName$V,
4710
4812
  disablePortal: disablePortal,
4711
4813
  "$maxHeight": maxHeight
4712
4814
  }), void 0);
@@ -4730,7 +4832,7 @@
4730
4832
  var paperProps = props.children.props;
4731
4833
  var paperChildren = paperProps.children;
4732
4834
  return jsxRuntime.jsx(StyledPopper, __assign({}, props, {
4733
- className: rootClassName$M,
4835
+ className: rootClassName$V,
4734
4836
  disablePortal: disablePortal,
4735
4837
  "$maxHeight": maxHeight
4736
4838
  }, {
@@ -7487,13 +7589,12 @@
7487
7589
  var _j = React.useState(value),
7488
7590
  inputValue = _j[0],
7489
7591
  setInputValue = _j[1];
7490
- var isNotReadOnlyOrEditing = !readOnly && !editing;
7491
7592
  var inputRef = React.useRef();
7492
7593
  var inlineEditRef = React.useRef();
7493
7594
  var isSaveDisabled = checkIfEmptyValue(inputValue);
7494
7595
  var rootClasses = useStylesWithRootClass(rootClassName$m, className, editing ? editModeClassName : '');
7495
7596
  var handleShowTooltip = function handleShowTooltip(visible) {
7496
- if (isNotReadOnlyOrEditing) {
7597
+ if (!editing) {
7497
7598
  setShowTooltip(visible);
7498
7599
  }
7499
7600
  };
@@ -9665,7 +9766,7 @@
9665
9766
  onClickAway = _a.onClickAway,
9666
9767
  open = _a.open,
9667
9768
  placement = _a.placement;
9668
- var rootClasses = useStylesWithRootClass(rootClassName$M, className);
9769
+ var rootClasses = useStylesWithRootClass(rootClassName$V, className);
9669
9770
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
9670
9771
  var handleClickAway = function handleClickAway(event) {
9671
9772
  if (onClickAway && (!anchorEl || !anchorEl.contains(event.currentTarget))) {