@altinn/altinn-components 0.57.3 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. package/README.md +33 -0
  2. package/dist/Section-DPj8jAL1.js +2225 -0
  3. package/dist/assets/Section.css +1 -1
  4. package/dist/components/AccessAreaListItem/AccessAreaListItem.js +1 -1
  5. package/dist/components/AccessPackageListItem/AccessPackageListItem.js +1 -1
  6. package/dist/components/Account/AccountList.js +1 -1
  7. package/dist/components/Account/AccountListItem.js +1 -1
  8. package/dist/components/Account/AccountListItemControls.js +1 -1
  9. package/dist/components/Account/AccountListItemDetails.js +1 -1
  10. package/dist/components/Account/AccountListVirtual.js +1 -1
  11. package/dist/components/Account/AccountMenu.js +1 -1
  12. package/dist/components/Account/AccountNotificationSettings.js +1 -1
  13. package/dist/components/Account/AccountOrganization.js +1 -1
  14. package/dist/components/AccountSelector/AccountSelector.js +1 -1
  15. package/dist/components/ActivityLog/ActivityLog.js +1 -1
  16. package/dist/components/ActivityLog/ActivityLogItem.js +1 -1
  17. package/dist/components/ActivityLog/ActivityLogSegment.js +1 -1
  18. package/dist/components/Alert/Alert.js +1 -1
  19. package/dist/components/Article/Article.js +1 -1
  20. package/dist/components/Article/ArticleContact.js +1 -1
  21. package/dist/components/Article/ArticleHeader.js +1 -1
  22. package/dist/components/Attachment/AttachmentLink.js +1 -1
  23. package/dist/components/Banner/Banner.js +1 -1
  24. package/dist/components/Bookmarks/BookmarkModal.js +1 -1
  25. package/dist/components/Bookmarks/BookmarkSettingsItem.js +1 -1
  26. package/dist/components/Bookmarks/BookmarkSettingsItemLabel.js +1 -1
  27. package/dist/components/Bookmarks/BookmarkSettingsList.js +1 -1
  28. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  29. package/dist/components/Bulk/BulkButton.js +11 -11
  30. package/dist/components/Bulk/BulkHeader.js +1 -1
  31. package/dist/components/Button/ButtonIcon.js +1 -1
  32. package/dist/components/Button/ComboButton.js +1 -1
  33. package/dist/components/Button/FloatingActionButton.js +1 -1
  34. package/dist/components/Button/IconButton.js +1 -1
  35. package/dist/components/Byline/Byline.js +1 -1
  36. package/dist/components/Byline/index.js +1 -1
  37. package/dist/components/ContextMenu/ContextMenu.js +27 -24
  38. package/dist/components/Dashboard/DashboardCard.js +1 -1
  39. package/dist/components/Dashboard/DashboardHeader.js +1 -1
  40. package/dist/components/Datepicker/Datepicker.js +1 -1
  41. package/dist/components/Datepicker/DatepickerHeader.js +1 -1
  42. package/dist/components/Datepicker/DatepickerTable.js +1 -1
  43. package/dist/components/Dialog/Dialog.js +1 -1
  44. package/dist/components/Dialog/DialogActions.js +1 -1
  45. package/dist/components/Dialog/DialogActivityLog.js +1 -1
  46. package/dist/components/Dialog/DialogAttachments.js +1 -1
  47. package/dist/components/Dialog/DialogBody.js +1 -1
  48. package/dist/components/Dialog/DialogByline.js +1 -1
  49. package/dist/components/Dialog/DialogContact.js +1 -1
  50. package/dist/components/Dialog/DialogHeader.js +1 -1
  51. package/dist/components/Dialog/DialogHistory.js +1 -1
  52. package/dist/components/Dialog/DialogHistoryItem.js +1 -1
  53. package/dist/components/Dialog/DialogHistorySegment.js +1 -1
  54. package/dist/components/Dialog/DialogLayout.js +9 -9
  55. package/dist/components/Dialog/DialogList.js +1 -1
  56. package/dist/components/Dialog/DialogListGroup.js +1 -1
  57. package/dist/components/Dialog/DialogListItem.js +1 -1
  58. package/dist/components/Dialog/DialogMetadata.js +1 -1
  59. package/dist/components/Dialog/DialogSection.js +1 -1
  60. package/dist/components/Dialog/DialogSeenBy.js +1 -1
  61. package/dist/components/Dialog/DialogSelect.js +1 -1
  62. package/dist/components/Dialog/DialogStatus.js +1 -1
  63. package/dist/components/Dialog/DialogTabs.js +1 -1
  64. package/dist/components/Dialog/SeenByLog.js +1 -1
  65. package/dist/components/Dialog/SeenByLogButton.js +1 -1
  66. package/dist/components/Dialog/SeenByLogItem.js +1 -1
  67. package/dist/components/Dialog/index.js +1 -1
  68. package/dist/components/Dropdown/DrawerButton.js +1 -1
  69. package/dist/components/Dropdown/DrawerHeader.js +1 -1
  70. package/dist/components/Dropdown/Dropdown.js +1 -1
  71. package/dist/components/Dropdown/DropdownBase.js +1 -1
  72. package/dist/components/Dropdown/FloatingDropdown.js +1 -1
  73. package/dist/components/Dropdown/index.js +5 -7
  74. package/dist/components/Forms/Checkbox.js +1 -1
  75. package/dist/components/Forms/CheckboxOptions.js +1 -1
  76. package/dist/components/Forms/FieldBase.js +1 -1
  77. package/dist/components/Forms/FieldsetBase.js +1 -1
  78. package/dist/components/Forms/Radio.js +1 -1
  79. package/dist/components/Forms/RadioOptions.js +1 -1
  80. package/dist/components/Forms/SearchField.js +1 -1
  81. package/dist/components/Forms/SelectField.js +1 -1
  82. package/dist/components/Forms/Switch.js +1 -1
  83. package/dist/components/Forms/SwitchOptions.js +1 -1
  84. package/dist/components/Forms/TextField.js +1 -1
  85. package/dist/components/Forms/TextFieldDropdown.js +1 -1
  86. package/dist/components/Forms/TextareaField.js +1 -1
  87. package/dist/components/Forms/index.js +1 -1
  88. package/dist/components/GlobalHeader/GlobalAccountButton.js +1 -1
  89. package/dist/components/GlobalHeader/GlobalHeader.js +1 -1
  90. package/dist/components/GlobalHeader/GlobalMenuButton.js +1 -1
  91. package/dist/components/GlobalHeader/HeaderDrawer.js +1 -1
  92. package/dist/components/GlobalHeader/HeaderDropdown.js +1 -1
  93. package/dist/components/GlobalHeader/HeaderLogo.js +1 -1
  94. package/dist/components/GlobalMenu/GlobalMenu.js +1 -1
  95. package/dist/components/GlobalMenu/LocaleSwitcher.js +1 -1
  96. package/dist/components/GlobalMenu/LogoutButton.js +1 -1
  97. package/dist/components/GlobalMenu_old/BackButton.js +1 -1
  98. package/dist/components/GlobalMenu_old/CurrentAccount.js +1 -1
  99. package/dist/components/GlobalMenu_old/GlobalMenu.js +1 -1
  100. package/dist/components/GlobalMenu_old/GlobalMenuButton.js +1 -1
  101. package/dist/components/GlobalMenu_old/LogoutButton.js +1 -1
  102. package/dist/components/Header/Header.js +1 -1
  103. package/dist/components/Header/HeaderBase.js +1 -1
  104. package/dist/components/Header/HeaderButton.js +1 -1
  105. package/dist/components/Header/LocaleButton.js +1 -1
  106. package/dist/components/Header/LocaleSwitcher.js +1 -1
  107. package/dist/components/Icon/Icon.js +1 -1
  108. package/dist/components/Icon/index.js +1 -1
  109. package/dist/components/Inbox/InboxPage.js +1 -1
  110. package/dist/components/InboxSearch/InboxSearch.js +1 -1
  111. package/dist/components/Item/ItemLabel.js +1 -1
  112. package/dist/components/Item/ItemMedia.js +1 -1
  113. package/dist/components/Item/ItemSelect.js +1 -1
  114. package/dist/components/Item/index.js +1 -1
  115. package/dist/components/Layout/Layout.js +1 -1
  116. package/dist/components/List/List.js +1 -1
  117. package/dist/components/List/ListBase.js +1 -1
  118. package/dist/components/List/ListItem.js +1 -1
  119. package/dist/components/List/ListItemHeader.js +1 -1
  120. package/dist/components/List/ListItemIcon.js +1 -1
  121. package/dist/components/List/ListItemLabel.js +1 -1
  122. package/dist/components/List/index.js +1 -1
  123. package/dist/components/Menu/Menu.js +1 -1
  124. package/dist/components/Menu/MenuItem.js +1 -1
  125. package/dist/components/Menu/MenuItems.js +1 -1
  126. package/dist/components/Menu/MenuListSearch.js +1 -1
  127. package/dist/components/Menu/MenuOption.js +1 -1
  128. package/dist/components/Menu/TabMenu.js +1 -1
  129. package/dist/components/Menu/VirtualizedMenuItems.js +1 -1
  130. package/dist/components/Menu/index.js +1 -1
  131. package/dist/components/Menu/useMenuSearch.js +1 -1
  132. package/dist/components/Metadata/MetaItem.js +1 -1
  133. package/dist/components/Metadata/MetaItemIcon.js +1 -1
  134. package/dist/components/Metadata/MetaProgress.js +1 -1
  135. package/dist/components/Metadata/MetaTimestamp.js +1 -1
  136. package/dist/components/Metadata/Metadata.js +1 -1
  137. package/dist/components/Metadata/index.js +1 -1
  138. package/dist/components/Modal/Modal.js +1 -1
  139. package/dist/components/Modal/ModalBase.js +1 -1
  140. package/dist/components/Modal/ModalHeader.js +1 -1
  141. package/dist/components/Modal/ModalIcon.js +1 -1
  142. package/dist/components/Notifications/NotificationItem.js +1 -1
  143. package/dist/components/Notifications/NotificationItemBase.js +1 -1
  144. package/dist/components/Notifications/NotificationItemControls.js +1 -1
  145. package/dist/components/Notifications/NotificationItemIcon.js +1 -1
  146. package/dist/components/Page/AccordionSection.js +1 -1
  147. package/dist/components/Page/ContactButtons.js +1 -1
  148. package/dist/components/Page/ContactSection.js +1 -1
  149. package/dist/components/Page/PageMenu.js +1 -1
  150. package/dist/components/Page/PageNav.js +1 -1
  151. package/dist/components/Page/Section.js +1 -1
  152. package/dist/components/Page/index.js +1 -1
  153. package/dist/components/ResourceListItem/ResourceListItem.js +1 -1
  154. package/dist/components/RootProvider/RootProvider.js +1 -1
  155. package/dist/components/RootProvider/index.js +1 -1
  156. package/dist/components/Search/SearchItem.js +1 -1
  157. package/dist/components/Searchbar/Autocomplete.js +1 -1
  158. package/dist/components/Searchbar/AutocompleteItem.js +1 -1
  159. package/dist/components/Searchbar/Searchbar.js +1 -1
  160. package/dist/components/Searchbar/SearchbarField.js +1 -1
  161. package/dist/components/Settings/SettingsItem.js +20 -25
  162. package/dist/components/Settings/SettingsItemBase.js +1 -1
  163. package/dist/components/Settings/SettingsList.js +1 -1
  164. package/dist/components/Settings/SettingsModal.js +1 -1
  165. package/dist/components/Settings/SettingsSection.js +1 -1
  166. package/dist/components/Settings/UsedByLog.js +1 -1
  167. package/dist/components/Settings/UsedByLogItem.js +1 -1
  168. package/dist/components/Snackbar/SnackbarItem.js +1 -1
  169. package/dist/components/Timeline/Timeline.js +1 -1
  170. package/dist/components/Timeline/TimelineActivity.js +1 -1
  171. package/dist/components/Timeline/TimelineBase.js +1 -1
  172. package/dist/components/Timeline/TimelineFooter.js +1 -1
  173. package/dist/components/Timeline/TimelineHeader.js +1 -1
  174. package/dist/components/Timeline/TimelineIcon.js +1 -1
  175. package/dist/components/Timeline/TimelineSection.js +1 -1
  176. package/dist/components/Timeline/TimelineSegment.js +1 -1
  177. package/dist/components/Toolbar/DatepickerFilter.js +1 -1
  178. package/dist/components/Toolbar/SelectDateFilter.js +1 -1
  179. package/dist/components/Toolbar/Toolbar.js +1 -1
  180. package/dist/components/Toolbar/ToolbarFilter.js +1 -1
  181. package/dist/components/Toolbar/ToolbarFilterAddMenu.js +1 -1
  182. package/dist/components/Toolbar/ToolbarFilterButton.js +1 -1
  183. package/dist/components/Toolbar/ToolbarFilterMenu.js +1 -1
  184. package/dist/components/Toolbar/ToolbarMenu.js +1 -1
  185. package/dist/components/Toolbar/ToolbarSearch.js +1 -1
  186. package/dist/components/Toolbar/index.js +1 -1
  187. package/dist/components/Transmission/Transmission.js +1 -1
  188. package/dist/components/Transmission/TransmissionList.js +1 -1
  189. package/dist/components/Transmission/TransmissionType.js +1 -1
  190. package/dist/components/Typography/Heading.js +1 -1
  191. package/dist/components/Typography/index.js +1 -1
  192. package/dist/components/UserListItem/UserListItem.js +1 -1
  193. package/dist/components/index.js +330 -332
  194. package/dist/hooks/useAccountSelector.js +1 -1
  195. package/dist/index.js +338 -340
  196. package/dist/types/lib/components/Bulk/Bulk.stories.d.ts +4 -1
  197. package/dist/types/lib/components/Bulk/BulkButton.d.ts +2 -1
  198. package/dist/types/lib/components/ContextMenu/ContextMenu.d.ts +3 -2
  199. package/dist/types/lib/components/Dropdown/Dropdown.d.ts +3 -1
  200. package/dist/types/lib/components/Dropdown/Dropdown.stories.d.ts +1 -2
  201. package/dist/types/lib/components/Dropdown/index.d.ts +0 -1
  202. package/dist/types/lib/components/Forms/SearchField.stories.d.ts +1 -0
  203. package/dist/types/lib/components/Menu/VirtualizedMenu.stories.d.ts +24 -3
  204. package/dist/types/lib/test-utils/screenshot-compare.d.ts +49 -0
  205. package/package.json +10 -3
  206. package/dist/Section-xbt3ft20.js +0 -2265
  207. package/dist/assets/DrawerOrDropdown.css +0 -1
  208. package/dist/components/Dropdown/DrawerOrDropdown.js +0 -42
  209. package/dist/types/lib/components/Dropdown/DrawerOrDropdown.d.ts +0 -11
@@ -1,2265 +0,0 @@
1
- "use client";
2
- import { jsx as a, jsxs as _, Fragment as pe } from "react/jsx-runtime";
3
- import { c as K } from "./index-p1eeF8LQ.js";
4
- import * as T from "react";
5
- import C, { forwardRef as V, useRef as te, useState as se, useMemo as ce, useEffect as X, Fragment as gt, useLayoutEffect as Me, createContext as yt, useContext as _t, isValidElement as we, useId as Ne, useCallback as Ze, memo as Ie, createElement as ze } from "react";
6
- import { useEscapeKey as wt } from "./hooks/useEscapeKey.js";
7
- import { Button as de } from "./components/Button/Button.js";
8
- import { createPortal as It } from "react-dom";
9
- import { useMenu as Le } from "./hooks/useMenu.js";
10
- import { Typography as et } from "./components/Typography/Typography.js";
11
- import { Skeleton as ke } from "./components/Skeleton/Skeleton.js";
12
- import { useHighlightedText as xt } from "./components/Typography/useHighlightedText.js";
13
- import { Badge as ye } from "./components/Badge/Badge.js";
14
- import { isAvatarGroupProps as Ce, AvatarGroup as he } from "./components/Avatar/AvatarGroup.js";
15
- import { ItemControls as De } from "./components/Item/ItemControls.js";
16
- import { ItemBase as Ot } from "./components/Item/ItemBase.js";
17
- import { ItemLink as Nt } from "./components/Item/ItemLink.js";
18
- import { Tooltip as kt } from "./components/Tooltip/Tooltip.js";
19
- import { MetaBase as Ct } from "./components/Metadata/MetaBase.js";
20
- import { MetaItemBase as Fe } from "./components/Metadata/MetaItemBase.js";
21
- import { SnackbarProvider as Et } from "./components/Snackbar/useSnackbar.js";
22
- import { Input as Ae } from "./components/Forms/Input.js";
23
- import { Field as Pt } from "./components/Forms/Field.js";
24
- import { Label as St } from "./components/Forms/Label.js";
25
- import { TypingIcon as jt } from "./components/Icon/TypingIcon.js";
26
- import { u as W } from "./useId-BVFxCjkq.js";
27
- import { isAvatarProps as Ee, Avatar as je } from "./components/Avatar/Avatar.js";
28
- import { pickAriaProps as $t } from "./components/Menu/aria.js";
29
- import { MenuList as Pe } from "./components/Menu/MenuList.js";
30
- import { MenuListItem as tt } from "./components/Menu/MenuListItem.js";
31
- import { MenuListGroup as rt } from "./components/Menu/MenuListGroup.js";
32
- import { MenuListDivider as nt } from "./components/Menu/MenuListDivider.js";
33
- import { MenuListHeading as ot } from "./components/Menu/MenuListHeading.js";
34
- import { a as Rt } from "./useMenuVirtualization-Cs426RCN.js";
35
- import { S as Mt, a as zt, b as Dt, d as At, c as Bt } from "./Trash-BG9YcGIl.js";
36
- import { useDropdownMenuController as Lt } from "./components/Menu/useDropdownMenuController.js";
37
- import { ProgressIcon as Ft } from "./components/Icon/ProgressIcon.js";
38
- import { MetaItemLabel as Te } from "./components/Metadata/MetaItemLabel.js";
39
- import { ListItemBase as Tt } from "./components/List/ListItemBase.js";
40
- import { ListItemLink as Gt } from "./components/List/ListItemLink.js";
41
- import { ListItemControls as Ht } from "./components/List/ListItemControls.js";
42
- import { Flex as Ge } from "./components/Page/Flex.js";
43
- import './assets/Section.css';var Kt = function(e, o) {
44
- var r = {};
45
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
46
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
47
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
48
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
49
- return r;
50
- };
51
- const qt = V((e, o) => {
52
- var { title: r, titleId: t } = e, n = Kt(e, ["title", "titleId"]);
53
- let s = W();
54
- return s = r ? t || "title-" + s : void 0, C.createElement(
55
- "svg",
56
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
57
- r ? C.createElement("title", { id: s }, r) : null,
58
- C.createElement("path", { fill: "currentColor", d: "M12.75 5a.75.75 0 0 0-1.5 0v12.19l-3.22-3.22a.75.75 0 0 0-1.06 1.06l4.5 4.5a.75.75 0 0 0 1.06 0l4.5-4.5a.75.75 0 1 0-1.06-1.06l-3.22 3.22z" })
59
- );
60
- });
61
- var Ut = function(e, o) {
62
- var r = {};
63
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
64
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
65
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
66
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
67
- return r;
68
- };
69
- const at = V((e, o) => {
70
- var { title: r, titleId: t } = e, n = Ut(e, ["title", "titleId"]);
71
- let s = W();
72
- return s = r ? t || "title-" + s : void 0, C.createElement(
73
- "svg",
74
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
75
- r ? C.createElement("title", { id: s }, r) : null,
76
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M18.998 6.94a.75.75 0 0 1 .063 1.058l-8 9a.75.75 0 0 1-1.091.032l-5-5a.75.75 0 1 1 1.06-1.06l4.438 4.437 7.471-8.405A.75.75 0 0 1 19 6.939", clipRule: "evenodd" })
77
- );
78
- });
79
- var Vt = function(e, o) {
80
- var r = {};
81
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
82
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
83
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
84
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
85
- return r;
86
- };
87
- const Wt = V((e, o) => {
88
- var { title: r, titleId: t } = e, n = Vt(e, ["title", "titleId"]);
89
- let s = W();
90
- return s = r ? t || "title-" + s : void 0, C.createElement(
91
- "svg",
92
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
93
- r ? C.createElement("title", { id: s }, r) : null,
94
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M5.97 9.47a.75.75 0 0 1 1.06 0L12 14.44l4.97-4.97a.75.75 0 1 1 1.06 1.06l-5.5 5.5a.75.75 0 0 1-1.06 0l-5.5-5.5a.75.75 0 0 1 0-1.06", clipRule: "evenodd" })
95
- );
96
- });
97
- var Yt = function(e, o) {
98
- var r = {};
99
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
100
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
101
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
102
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
103
- return r;
104
- };
105
- const st = V((e, o) => {
106
- var { title: r, titleId: t } = e, n = Yt(e, ["title", "titleId"]);
107
- let s = W();
108
- return s = r ? t || "title-" + s : void 0, C.createElement(
109
- "svg",
110
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
111
- r ? C.createElement("title", { id: s }, r) : null,
112
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M9.47 5.97a.75.75 0 0 1 1.06 0l5.5 5.5a.75.75 0 0 1 0 1.06l-5.5 5.5a.75.75 0 1 1-1.06-1.06L14.44 12 9.47 7.03a.75.75 0 0 1 0-1.06", clipRule: "evenodd" })
113
- );
114
- });
115
- var Qt = function(e, o) {
116
- var r = {};
117
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
118
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
119
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
120
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
121
- return r;
122
- };
123
- const Xt = V((e, o) => {
124
- var { title: r, titleId: t } = e, n = Qt(e, ["title", "titleId"]);
125
- let s = W();
126
- return s = r ? t || "title-" + s : void 0, C.createElement(
127
- "svg",
128
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
129
- r ? C.createElement("title", { id: s }, r) : null,
130
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M11.47 7.97a.75.75 0 0 1 1.06 0l5.5 5.5a.75.75 0 1 1-1.06 1.06L12 9.56l-4.97 4.97a.75.75 0 0 1-1.06-1.06z", clipRule: "evenodd" })
131
- );
132
- });
133
- var Jt = function(e, o) {
134
- var r = {};
135
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
136
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
137
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
138
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
139
- return r;
140
- };
141
- const Ke = V((e, o) => {
142
- var { title: r, titleId: t } = e, n = Jt(e, ["title", "titleId"]);
143
- let s = W();
144
- return s = r ? t || "title-" + s : void 0, C.createElement(
145
- "svg",
146
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
147
- r ? C.createElement("title", { id: s }, r) : null,
148
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M12.53 4.47a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06L12 6.06l2.97 2.97a.75.75 0 1 0 1.06-1.06zm-3.5 10.5a.75.75 0 0 0-1.06 1.06l3.5 3.5a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 1 0-1.06-1.06L12 17.94z", clipRule: "evenodd" })
149
- );
150
- });
151
- var Zt = function(e, o) {
152
- var r = {};
153
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
154
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
155
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
156
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
157
- return r;
158
- };
159
- const er = V((e, o) => {
160
- var { title: r, titleId: t } = e, n = Zt(e, ["title", "titleId"]);
161
- let s = W();
162
- return s = r ? t || "title-" + s : void 0, C.createElement(
163
- "svg",
164
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
165
- r ? C.createElement("title", { id: s }, r) : null,
166
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.5 1.75a.75.75 0 0 1 .75.75v2.464a9.75 9.75 0 1 1 12.342 15.023.75.75 0 1 1-.86-1.229A8.251 8.251 0 1 0 6.084 6.25H9a.75.75 0 0 1 0 1.5H4.5A.75.75 0 0 1 3.75 7V2.5a.75.75 0 0 1 .75-.75M12.75 6a.75.75 0 0 0-1.5 0v6c0 .199.079.39.22.53l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28zM3 11.25a.75.75 0 0 1 .75.75q0 .66.105 1.31a.75.75 0 0 1-1.481.24A10 10 0 0 1 2.25 12a.75.75 0 0 1 .75-.75m1.855 4.875a.75.75 0 0 0-1.299.75q.39.675.882 1.28a.75.75 0 1 0 1.163-.947 8 8 0 0 1-.746-1.083m1.995 3.294a.75.75 0 0 1 1.025-.274q.57.33 1.188.564a.75.75 0 1 1-.535 1.402 10 10 0 0 1-1.403-.667.75.75 0 0 1-.275-1.025m6.7 2.207a.75.75 0 1 0-.24-1.48q-.65.104-1.31.104a.75.75 0 0 0 0 1.5q.78 0 1.55-.124", clipRule: "evenodd" })
167
- );
168
- });
169
- var tr = function(e, o) {
170
- var r = {};
171
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
172
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
173
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
174
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
175
- return r;
176
- };
177
- const rr = V((e, o) => {
178
- var { title: r, titleId: t } = e, n = tr(e, ["title", "titleId"]);
179
- let s = W();
180
- return s = r ? t || "title-" + s : void 0, C.createElement(
181
- "svg",
182
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
183
- r ? C.createElement("title", { id: s }, r) : null,
184
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M8.25 3.5c0-.69.56-1.25 1.25-1.25H14a.75.75 0 0 1 .53.22l5 5c.141.14.22.331.22.53v8.5c0 .69-.56 1.25-1.25 1.25h-9c-.69 0-1.25-.56-1.25-1.25zm6.25 5.25c-.69 0-1.25-.56-1.25-1.25V3.75h-3.5v12.5h8.5v-7.5zm.25-3.94 2.44 2.44h-2.44zM6.502 7.75H5.75v12.5h8.5v-.748a.75.75 0 0 1 1.5 0v.998c0 .69-.56 1.25-1.25 1.25h-9c-.69 0-1.25-.56-1.25-1.25v-13c0-.69.56-1.25 1.25-1.25h1.002a.75.75 0 1 1 0 1.5", clipRule: "evenodd" })
185
- );
186
- });
187
- var nr = function(e, o) {
188
- var r = {};
189
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
190
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
191
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
192
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
193
- return r;
194
- };
195
- const or = V((e, o) => {
196
- var { title: r, titleId: t } = e, n = nr(e, ["title", "titleId"]);
197
- let s = W();
198
- return s = r ? t || "title-" + s : void 0, C.createElement(
199
- "svg",
200
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
201
- r ? C.createElement("title", { id: s }, r) : null,
202
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M6 3.25a.75.75 0 0 0 0 1.5h.315c.109 1.966.642 3.846 1.546 5.302.502.81 1.116 1.479 1.81 1.948-.694.47-1.308 1.138-1.81 1.948-.904 1.456-1.437 3.336-1.546 5.302H6a.75.75 0 0 0 0 1.5h12a.75.75 0 0 0 0-1.5h-.298c-.109-1.966-.643-3.846-1.546-5.302-.503-.81-1.116-1.479-1.81-1.948.694-.47 1.307-1.138 1.81-1.948.904-1.456 1.437-3.336 1.546-5.302H18a.75.75 0 0 0 0-1.5zm6.008 8c.972 0 2.027-.624 2.873-1.989.738-1.189 1.211-2.785 1.318-4.511H7.818c.107 1.726.58 3.322 1.318 4.511.846 1.365 1.901 1.989 2.872 1.989m0 1.5c-.971 0-2.026.624-2.872 1.989-.738 1.189-1.211 2.784-1.318 4.511h8.381c-.107-1.727-.58-3.322-1.318-4.511-.846-1.365-1.901-1.989-2.873-1.989", clipRule: "evenodd" })
203
- );
204
- });
205
- var ar = function(e, o) {
206
- var r = {};
207
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
208
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
209
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
210
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
211
- return r;
212
- };
213
- const qe = V((e, o) => {
214
- var { title: r, titleId: t } = e, n = ar(e, ["title", "titleId"]);
215
- let s = W();
216
- return s = r ? t || "title-" + s : void 0, C.createElement(
217
- "svg",
218
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
219
- r ? C.createElement("title", { id: s }, r) : null,
220
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M10.5 3.25a7.25 7.25 0 1 0 4.569 12.88l5.411 5.41a.75.75 0 1 0 1.06-1.06l-5.41-5.411A7.25 7.25 0 0 0 10.5 3.25M4.75 10.5a5.75 5.75 0 1 1 11.5 0 5.75 5.75 0 0 1-11.5 0", clipRule: "evenodd" })
221
- );
222
- });
223
- var sr = function(e, o) {
224
- var r = {};
225
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
226
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
227
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
228
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
229
- return r;
230
- };
231
- const lr = V((e, o) => {
232
- var { title: r, titleId: t } = e, n = sr(e, ["title", "titleId"]);
233
- let s = W();
234
- return s = r ? t || "title-" + s : void 0, C.createElement(
235
- "svg",
236
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
237
- r ? C.createElement("title", { id: s }, r) : null,
238
- C.createElement("path", { fill: "currentColor", fillRule: "evenodd", d: "M4.75 12a.75.75 0 0 1 .75-.75h13a.75.75 0 1 1 0 1.5h-13a.75.75 0 0 1-.75-.75", clipRule: "evenodd" })
239
- );
240
- });
241
- var ir = function(e, o) {
242
- var r = {};
243
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && o.indexOf(t) < 0 && (r[t] = e[t]);
244
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
245
- for (var n = 0, t = Object.getOwnPropertySymbols(e); n < t.length; n++)
246
- o.indexOf(t[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[n]) && (r[t[n]] = e[t[n]]);
247
- return r;
248
- };
249
- const _e = V((e, o) => {
250
- var { title: r, titleId: t } = e, n = ir(e, ["title", "titleId"]);
251
- let s = W();
252
- return s = r ? t || "title-" + s : void 0, C.createElement(
253
- "svg",
254
- Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", fill: "none", viewBox: "0 0 24 24", focusable: !1, role: "img", ref: o, "aria-labelledby": s }, n),
255
- r ? C.createElement("title", { id: s }, r) : null,
256
- C.createElement("path", { fill: "currentColor", d: "M6.53 5.47a.75.75 0 0 0-1.06 1.06L10.94 12l-5.47 5.47a.75.75 0 1 0 1.06 1.06L12 13.06l5.47 5.47a.75.75 0 1 0 1.06-1.06L13.06 12l5.47-5.47a.75.75 0 0 0-1.06-1.06L12 10.94z" })
257
- );
258
- }), cr = "_icon_1y3dz_1", dr = "_shape_1y3dz_9", ur = "_svg_1y3dz_14", mr = "_image_1y3dz_15", ve = {
259
- icon: cr,
260
- shape: dr,
261
- svg: ur,
262
- image: mr
263
- }, Se = (e) => typeof e == "object" && e !== null && ("svgElement" in e || "iconUrl" in e), J = ({
264
- loading: e,
265
- altText: o,
266
- svgElement: r,
267
- size: t,
268
- color: n,
269
- iconUrl: s,
270
- className: c,
271
- style: u,
272
- children: d
273
- }) => /* @__PURE__ */ a("span", { "data-ui": "icon", "data-size": t, "data-color": n, className: K(ve.icon, c), style: u, children: /* @__PURE__ */ _(ke, { loading: e, variant: "circle", className: ve.shape, children: [
274
- /* @__PURE__ */ a("span", { className: ve.shape }),
275
- r && /* @__PURE__ */ a(r, { "aria-hidden": "true", "alt-label": o, className: ve.svg }),
276
- s && /* @__PURE__ */ a("img", { src: s, alt: o, className: ve.image }),
277
- d
278
- ] }) }), Ue = ({ size: e, color: o, label: r, helperText: t, children: n, ...s }) => /* @__PURE__ */ _(Pt, { size: e, color: o, ...s, children: [
279
- r && /* @__PURE__ */ a(St, { size: e, children: r }),
280
- n,
281
- t && /* @__PURE__ */ a(et, { size: "xs", children: t })
282
- ] }), fr = "_search_18jfe_1", pr = "_searchInput_18jfe_8", Re = {
283
- search: fr,
284
- searchInput: pr
285
- }, lt = ({
286
- style: e,
287
- index: o,
288
- name: r,
289
- value: t,
290
- placeholder: n = "Search",
291
- clearButtonAltText: s = "Clear search",
292
- onChange: c,
293
- onClear: u,
294
- onNavigate: d,
295
- combobox: l = !1,
296
- listId: f,
297
- "aria-activedescendant": i,
298
- onKeyDown: g,
299
- onInput: v,
300
- onFocus: y,
301
- ...w
302
- }) => /* @__PURE__ */ a("li", { className: Re.search, style: e, "data-index": o, "data-menu-search": "true", children: l ? (
303
- // biome-ignore lint/a11y/useFocusableInteractive: <explanation>
304
- // biome-ignore lint/a11y/useAriaPropsForRole: <explanation>
305
- // biome-ignore lint/a11y/useSemanticElements: <explanation>
306
- /* @__PURE__ */ a("div", { role: "combobox", "aria-expanded": !0, "aria-haspopup": "listbox", "aria-owns": f, children: /* @__PURE__ */ a(
307
- Be,
308
- {
309
- size: "xs",
310
- className: Re.searchInput,
311
- name: r,
312
- value: t,
313
- placeholder: n,
314
- onChange: c,
315
- onClear: u,
316
- clearButtonAltText: s,
317
- autoComplete: "off",
318
- autoCorrect: "off",
319
- autoCapitalize: "off",
320
- "aria-autocomplete": "list",
321
- "aria-controls": f,
322
- "aria-activedescendant": i,
323
- autoFocus: !0,
324
- onKeyDown: (I) => {
325
- (I.key === "ArrowUp" || I.key === "ArrowDown") && (I.preventDefault(), d?.()), g?.(I);
326
- },
327
- onInput: v,
328
- onFocus: y,
329
- ...w
330
- }
331
- ) })
332
- ) : /* @__PURE__ */ a(
333
- Be,
334
- {
335
- size: "xs",
336
- className: Re.searchInput,
337
- name: r,
338
- value: t,
339
- placeholder: n,
340
- onChange: c,
341
- onClear: u,
342
- clearButtonAltText: s,
343
- autoComplete: "off",
344
- autoCorrect: "off",
345
- autoCapitalize: "off",
346
- autoFocus: !0,
347
- onKeyDown: (I) => {
348
- (I.key === "ArrowUp" || I.key === "ArrowDown") && (I.preventDefault(), d?.()), g?.(I);
349
- },
350
- onInput: v,
351
- onFocus: y,
352
- ...w
353
- }
354
- ) }), it = ({
355
- level: e = 0,
356
- maxLevels: o,
357
- expanded: r,
358
- a11yMode: t = "menu",
359
- open: n,
360
- scrollToTopOnOpen: s = !1,
361
- autoActivateFirstItem: c = !0,
362
- autoFocusList: u = !0,
363
- announceNoResults: d = !1,
364
- search: l,
365
- items: f,
366
- groups: i = {},
367
- size: g,
368
- id: v,
369
- color: y,
370
- variant: w,
371
- scrollRefStyles: I = {},
372
- keyboardEvents: N = !1,
373
- onSelect: $ = () => {
374
- },
375
- onActiveItemIdChange: k
376
- }) => {
377
- if (o && e >= o)
378
- return null;
379
- const m = t === "combobox", O = m && v ? `${v}-listbox` : v, E = te(n), D = te(n), [M, b] = se(!1), A = ce(
380
- () => f.map((h, S) => ({
381
- ...h,
382
- id: h.id || `${v}-item-${S}`
383
- })),
384
- [f, v]
385
- ), R = te(null), { menu: p, setActiveIndex: z, activeItem: P } = Le({
386
- items: A,
387
- groups: i,
388
- groupByKey: "groupId",
389
- keyboardEvents: N,
390
- autoActivateFirstItem: c,
391
- onSelect: $,
392
- ref: R
393
- });
394
- return X(() => {
395
- k?.(P?.id);
396
- }, [P?.id, k]), X(() => {
397
- if (!s) {
398
- E.current = n;
399
- return;
400
- }
401
- const h = E.current;
402
- E.current = n, n && !h && R.current?.scrollTo({ top: 0 });
403
- }, [n, s]), X(() => {
404
- const h = D.current;
405
- D.current = n, !(!N || l || !u) && n && !h && requestAnimationFrame(() => R.current?.focus?.({ preventScroll: !0 }));
406
- }, [n, N, l]), X(() => {
407
- if (m && d) {
408
- z(0), b(!0);
409
- return;
410
- }
411
- }, [d, m, z]), /* @__PURE__ */ _(
412
- Pe,
413
- {
414
- variant: w,
415
- expanded: r,
416
- ref: R,
417
- style: I,
418
- id: O,
419
- role: m ? "listbox" : void 0,
420
- tabIndex: N ? -1 : void 0,
421
- children: [
422
- l && /* @__PURE__ */ a(
423
- lt,
424
- {
425
- ...l,
426
- combobox: m,
427
- listId: O,
428
- "aria-activedescendant": m && M ? P?.id : void 0,
429
- onNavigate: m ? () => b(!0) : void 0,
430
- onChange: (h) => {
431
- b(!1), l.onChange?.(h);
432
- },
433
- onFocus: (h) => {
434
- b(!1), l.onFocus?.(h);
435
- },
436
- onInput: (h) => {
437
- b(!1), l.onInput?.(h);
438
- },
439
- onKeyDown: (h) => {
440
- const S = h.key === "ArrowUp" || h.key === "ArrowDown", G = h.key.length === 1 || h.key === "Backspace" || h.key === "Delete";
441
- m && !S && G && b(!1), l.onKeyDown?.(h);
442
- }
443
- }
444
- ),
445
- p.map((h, S) => {
446
- const G = h?.props || {}, { title: H, hidden: F = !1, divider: Y = !0 } = G;
447
- return /* @__PURE__ */ _(gt, { children: [
448
- (e > 0 || S) && Y ? /* @__PURE__ */ a(nt, {}) : "",
449
- /* @__PURE__ */ a(rt, { hidden: F, children: /* @__PURE__ */ _(Pe, { role: "presentation", children: [
450
- H && /* @__PURE__ */ a(ot, { title: H, level: e }),
451
- h?.items.filter((Z) => !Z.props?.hidden).map((Z, x) => {
452
- const { active: j, onMouseEnter: L } = Z, { groupId: re, ...B } = Z.props || {}, { expanded: ae } = B, ue = Array.isArray(B?.items) && B.items.length > 0, xe = B.role === "checkbox" || B.role === "radio", $e = m && !xe ? "option" : B.role;
453
- return /* @__PURE__ */ _(
454
- tt,
455
- {
456
- expanded: ae,
457
- onMouseLeave: () => z(-1),
458
- role: m || xe ? "presentation" : void 0,
459
- children: [
460
- /* @__PURE__ */ a(
461
- ut,
462
- {
463
- ...B,
464
- size: B?.size || G?.size || g,
465
- color: B?.color || G?.color || y,
466
- variant: B?.variant || G?.variant || w,
467
- active: j,
468
- role: $e,
469
- selected: B.selected,
470
- tabIndex: B?.disabled || N ? -1 : B.tabIndex ?? 0,
471
- onMouseEnter: L,
472
- "aria-haspopup": ue ? "menu" : void 0,
473
- "aria-expanded": ue ? ae : void 0,
474
- "aria-controls": ue ? B.id + "-menu" : void 0
475
- }
476
- ),
477
- ae && B?.items && /* @__PURE__ */ a(
478
- it,
479
- {
480
- id: B.id + "-menu",
481
- expanded: ae,
482
- level: e + 1,
483
- maxLevels: o,
484
- items: B?.items,
485
- groups: i,
486
- size: g,
487
- color: y,
488
- variant: w
489
- }
490
- )
491
- ]
492
- },
493
- x
494
- );
495
- })
496
- ] }) }, S)
497
- ] }, S);
498
- })
499
- ]
500
- }
501
- );
502
- }, hr = (e) => {
503
- const o = te(null), r = te(null), [t, n] = se(0), {
504
- search: s,
505
- items: c,
506
- groups: u = {},
507
- size: d,
508
- color: l,
509
- variant: f,
510
- keyboardEvents: i,
511
- scrollRefStyles: g = {},
512
- id: v,
513
- expanded: y,
514
- a11yMode: w = "menu",
515
- open: I,
516
- scrollToTopOnOpen: N = !1,
517
- autoActivateFirstItem: $ = !0,
518
- announceNoResults: k = !1,
519
- onActiveItemIdChange: m
520
- } = e, O = w === "combobox", E = O && v ? `${v}-listbox` : v, D = te(I), [M, b] = se(!1), A = ce(
521
- () => c.map((x, j) => ({
522
- ...x,
523
- id: x.id || `${v}-item-${j}`
524
- })),
525
- [c, v]
526
- ), { menu: R, activeItem: p, setActiveIndex: z, activeIndex: P } = Le({
527
- items: A,
528
- groups: u,
529
- groupByKey: "groupId",
530
- keyboardEvents: i,
531
- autoActivateFirstItem: $,
532
- ref: o
533
- }), { flatMenu: h, virtualizer: S, scrollMaxHeight: G } = Rt({
534
- menu: R,
535
- scrollRef: o
536
- });
537
- Me(() => {
538
- const x = r.current;
539
- if (!x) return;
540
- const j = Math.round(x.offsetTop);
541
- n((L) => L === j ? L : j);
542
- });
543
- const H = ce(() => {
544
- const x = p?.id;
545
- if (x)
546
- return h.findIndex((L) => L.type === "item" && L.itemProps?.id === x);
547
- if (P < 0) return -1;
548
- let j = -1;
549
- for (let L = 0; L < h.length; L++)
550
- if (h[L]?.type === "item" && (j += 1, j === P))
551
- return L;
552
- return -1;
553
- }, [p?.id, P, h]), F = te(null);
554
- Me(() => {
555
- const x = F?.current, j = typeof x == "number" ? H <= x : !1;
556
- F.current = H;
557
- const L = j ? H : H + 2;
558
- if (!j) {
559
- const ue = S.getOffsetForIndex(L, "auto");
560
- if (!ue) return;
561
- const [xe, $e] = ue;
562
- if ($e === "auto") return;
563
- S.scrollToOffset(xe + t + 10, { align: "start" });
564
- return;
565
- }
566
- if (H <= 3) {
567
- S.scrollToOffset(0);
568
- return;
569
- }
570
- const re = S.getOffsetForIndex(H - 1, "auto");
571
- if (!re) return;
572
- const [B, ae] = re;
573
- ae !== "auto" && S.scrollToOffset(B + t + 10, { align: "start" });
574
- }, [H, t, S, F]);
575
- const Y = ce(() => {
576
- const x = /* @__PURE__ */ new Map();
577
- let j = 0;
578
- return h.forEach((L, re) => {
579
- L.type === "item" && (j += 1, x.set(re, j));
580
- }), { positions: x, total: j };
581
- }, [h]);
582
- X(() => {
583
- m?.(p?.id);
584
- }, [p?.id, m]), X(() => {
585
- if (O && k) {
586
- z(0), b(!0);
587
- return;
588
- }
589
- }, [k, O, z]), X(() => {
590
- if (!N) {
591
- D.current = I;
592
- return;
593
- }
594
- const x = D.current;
595
- D.current = I, I && !x && o.current?.scrollTo({ top: 0 });
596
- }, [I, N]);
597
- const Z = {
598
- position: "relative",
599
- maxHeight: g?.maxHeight || G,
600
- margin: "-0.5rem",
601
- padding: "0.5rem",
602
- minWidth: g?.minWidth ?? "20rem",
603
- overflowY: "auto",
604
- ...g
605
- };
606
- return /* @__PURE__ */ _(
607
- Pe,
608
- {
609
- ref: o,
610
- style: Z,
611
- variant: f,
612
- color: l,
613
- expanded: y,
614
- id: E,
615
- role: O ? "listbox" : void 0,
616
- children: [
617
- s && /* @__PURE__ */ a(
618
- lt,
619
- {
620
- ...s,
621
- combobox: O,
622
- listId: E,
623
- "aria-activedescendant": O && M ? p?.id : void 0,
624
- onNavigate: O ? () => b(!0) : void 0,
625
- onChange: (x) => {
626
- b(!1), s.onChange?.(x);
627
- },
628
- onFocus: (x) => {
629
- b(!1), s.onFocus?.(x);
630
- },
631
- onInput: (x) => {
632
- b(!1), s.onInput?.(x);
633
- },
634
- onKeyDown: (x) => {
635
- const j = x.key === "ArrowUp" || x.key === "ArrowDown", L = x.key.length === 1 || x.key === "Backspace" || x.key === "Delete";
636
- O && !j && L && b(!1), s.onKeyDown?.(x);
637
- }
638
- }
639
- ),
640
- /* @__PURE__ */ a(
641
- rt,
642
- {
643
- ref: r,
644
- style: {
645
- position: "relative",
646
- height: `${S.getTotalSize()}px`,
647
- width: "100%"
648
- },
649
- children: /* @__PURE__ */ a(Pe, { style: { width: "100%", minWidth: "100%" }, children: S.getVirtualItems().map((x) => {
650
- const j = h[x.index];
651
- if (!j) return null;
652
- const L = {
653
- position: "absolute",
654
- top: 0,
655
- left: 0,
656
- width: "100%",
657
- transform: `translateY(${x.start}px)`
658
- }, re = {
659
- style: L,
660
- index: x.index,
661
- "data-index": x.index,
662
- ref: S.measureElement
663
- };
664
- switch (j.type) {
665
- case "divider":
666
- return /* @__PURE__ */ a(
667
- nt,
668
- {
669
- ...re,
670
- style: { ...L, padding: "0.25rem 0" }
671
- },
672
- x.key
673
- );
674
- case "header":
675
- return /* @__PURE__ */ a(ot, { ...re, title: j.title || "", level: 1 }, x.key);
676
- default: {
677
- const B = j.itemProps?.role === "checkbox" || j.itemProps?.role === "radio", ae = O && !B ? "option" : j.itemProps?.role;
678
- return /* @__PURE__ */ a(
679
- tt,
680
- {
681
- ...re,
682
- role: O || B ? "presentation" : "menuitem",
683
- children: /* @__PURE__ */ a(
684
- ut,
685
- {
686
- ...j.itemProps || {},
687
- size: j.itemProps?.size || d,
688
- color: j.itemProps?.color || l,
689
- variant: j.itemProps?.variant || f,
690
- active: j.active,
691
- role: ae,
692
- selected: j.itemProps?.selected,
693
- "aria-posinset": O ? Y.positions.get(x.index) : void 0,
694
- "aria-setsize": O ? Y.total : void 0,
695
- tabIndex: j.itemProps?.disabled || i ? -1 : 0
696
- }
697
- )
698
- },
699
- x.key
700
- );
701
- }
702
- }
703
- }) })
704
- }
705
- )
706
- ]
707
- }
708
- );
709
- }, vr = {
710
- currentId: "",
711
- previousId: "",
712
- debug: !1,
713
- setCurrentId: () => {
714
- console.warn("setCurrentId called outside of RootProvider context");
715
- },
716
- setPreviousId: () => {
717
- console.warn("setPreviousId called outside of RootProvider context");
718
- },
719
- languageCode: "nb"
720
- }, ct = yt(vr), Lo = ({ children: e, initialValue: o, debug: r, languageCode: t }) => {
721
- const [n, s] = se(o?.currentId || ""), [c, u] = se(o?.previousId || "");
722
- return /* @__PURE__ */ a(
723
- ct.Provider,
724
- {
725
- value: {
726
- currentId: n,
727
- setCurrentId: s,
728
- setPreviousId: u,
729
- previousId: c,
730
- debug: r,
731
- languageCode: t
732
- },
733
- children: /* @__PURE__ */ a(Et, { children: e })
734
- }
735
- );
736
- }, br = () => {
737
- const e = _t(ct);
738
- if (!e)
739
- throw new Error("useRootContext must be used within a RootProvider.");
740
- const { currentId: o, setCurrentId: r, debug: t, setPreviousId: n, previousId: s, languageCode: c } = e, u = (i) => {
741
- o && n(o), r(i);
742
- }, d = (i) => {
743
- t && console.debug(`useRootContext: toggleId called with value: ${i}`), u(o === i ? "" : i);
744
- }, l = () => {
745
- t && console.debug("useRootContext: closeAll called"), u("");
746
- };
747
- return wt(l), {
748
- currentId: o,
749
- previousId: s,
750
- toggleId: d,
751
- closeAll: l,
752
- openId: (i) => {
753
- t && console.debug(`useRootContext: openId called with value: ${i}`), u(i);
754
- },
755
- languageCode: c
756
- };
757
- }, gr = (e) => {
758
- switch (e) {
759
- case "nn":
760
- return {
761
- placeholder: "Søk ...",
762
- hits: (o) => `${o} treff`,
763
- selected: (o) => `${o} valt`,
764
- noResults: "Ingen treff"
765
- };
766
- case "en":
767
- return {
768
- placeholder: "Search ...",
769
- hits: (o) => `${o} hit${o === 1 ? "" : "s"}`,
770
- selected: (o) => `${o} selected`,
771
- noResults: "No results"
772
- };
773
- default:
774
- return {
775
- placeholder: "Søk ...",
776
- hits: (o) => `${o} treff`,
777
- selected: (o) => `${o} valgt`,
778
- noResults: "Ingen treff"
779
- };
780
- }
781
- }, yr = (e) => {
782
- const o = /* @__PURE__ */ new Set(), r = [];
783
- for (const t of e) {
784
- const n = t.id;
785
- if (!n) {
786
- r.push(t);
787
- continue;
788
- }
789
- o.has(n) || (o.add(n), r.push(t));
790
- }
791
- return r;
792
- }, _r = ({
793
- placeholder: e,
794
- name: o,
795
- onChange: r,
796
- onClear: t,
797
- clearButtonAltText: n,
798
- items: s = [],
799
- groups: c = {}
800
- }) => {
801
- const { languageCode: u } = br(), d = T.useMemo(() => gr(u), [u]), [l, f] = T.useState(""), i = T.useCallback(
802
- (P) => {
803
- f(P.target.value), r?.(P);
804
- },
805
- [r]
806
- ), g = T.useCallback(() => {
807
- f(""), t?.();
808
- }, [t]), v = T.useMemo(() => l.trim().replace(/\s+/g, " "), [l]), y = v.length > 0, w = T.useMemo(() => v.toLowerCase(), [v]), I = T.useMemo(() => v ? v.split(" ") : [], [v]), N = T.useMemo(
809
- () => ({
810
- placeholder: e ?? d.placeholder,
811
- name: o ?? "search",
812
- value: l,
813
- onChange: i,
814
- onClear: g,
815
- clearButtonAltText: n
816
- }),
817
- [e, d.placeholder, o, l, i, g, n]
818
- ), $ = T.useMemo(
819
- () => s.map((P) => {
820
- const h = P?.searchWords?.length ? P.searchWords : [P?.title, P?.description].filter(Boolean);
821
- return {
822
- ...P,
823
- searchWords: h ?? []
824
- };
825
- }),
826
- [s]
827
- ), k = T.useMemo(
828
- () => [
829
- {
830
- id: "emptySearch",
831
- "aria-disabled": !0,
832
- title: d.noResults,
833
- groupId: "emptySearch",
834
- icon: Mt,
835
- size: "sm",
836
- as: "div"
837
- }
838
- ],
839
- [d.noResults]
840
- ), m = T.useMemo(() => {
841
- const P = s.filter((h) => h.groupId === "emptySearch").map((h) => ({ ...h, hidden: !1 }));
842
- return P.length ? P : k;
843
- }, [s, k]), { selectedItems: O, results: E } = T.useMemo(() => {
844
- if (!y) return { selectedItems: [], results: [] };
845
- const P = [], h = [];
846
- for (const S of $)
847
- S.checked === !0 && P.push({ ...S, groupId: "selected" }), (S.searchWords ?? []).some((F) => String(F).toLowerCase().includes(w)) && h.push({
848
- ...S,
849
- groupId: "search",
850
- highlightWords: I
851
- });
852
- return { selectedItems: P, results: h };
853
- }, [y, $, w, I]), D = E.length, M = O.length, b = T.useMemo(
854
- () => ({
855
- search: {
856
- hidden: !0,
857
- title: d.hits(D)
858
- },
859
- selected: {
860
- hidden: !0,
861
- title: d.selected(M)
862
- },
863
- emptySearch: {
864
- hidden: !0,
865
- title: d.noResults
866
- },
867
- ...c
868
- }),
869
- [d, D, M, c]
870
- ), A = T.useMemo(
871
- () => ({
872
- ...b,
873
- search: {
874
- hidden: !y,
875
- title: d.hits(D)
876
- },
877
- selected: {
878
- hidden: M === 0,
879
- title: d.selected(M)
880
- },
881
- emptySearch: {
882
- hidden: y && (D > 0 || M > 0),
883
- title: d.noResults
884
- }
885
- }),
886
- [b, y, d, D, M]
887
- ), R = T.useMemo(() => y ? yr([...E, ...O]) : [], [y, E, O]), p = T.useMemo(() => [...m || [], ...O || []], [m, O]), z = T.useMemo(() => y ? D ? R : p : s, [y, s, D, R, p]);
888
- return {
889
- search: N,
890
- results: E,
891
- resultCount: D,
892
- hasQuery: y,
893
- items: z,
894
- groups: A
895
- };
896
- }, dt = ({
897
- searchable: e,
898
- search: o,
899
- items: r = [],
900
- groups: t = {},
901
- variant: n = "default",
902
- size: s,
903
- level: c = 0,
904
- maxLevels: u = 3,
905
- virtualized: d = !1,
906
- keyboardEvents: l = !1,
907
- scrollRefStyles: f = {},
908
- onActiveItemIdChange: i,
909
- a11yMode: g = "menu",
910
- open: v,
911
- scrollToTopOnOpen: y,
912
- autoFocusList: w,
913
- id: I
914
- }) => {
915
- const N = _r({ ...o, items: r, groups: t }), $ = e ? N.search : o, k = e && N.hasQuery && N.resultCount === 0, m = e ? N.items : r, O = e ? { ...t, ...N.groups } : t, E = g !== "combobox";
916
- return d ? /* @__PURE__ */ a(
917
- hr,
918
- {
919
- id: I,
920
- search: $,
921
- announceNoResults: k,
922
- items: m,
923
- groups: O,
924
- variant: n,
925
- size: s,
926
- level: c,
927
- maxLevels: u,
928
- keyboardEvents: l,
929
- scrollRefStyles: f,
930
- onActiveItemIdChange: i,
931
- a11yMode: g,
932
- open: v,
933
- scrollToTopOnOpen: y,
934
- autoActivateFirstItem: E,
935
- autoFocusList: w
936
- }
937
- ) : /* @__PURE__ */ a(
938
- it,
939
- {
940
- id: I,
941
- search: $,
942
- announceNoResults: k,
943
- items: m,
944
- groups: O,
945
- variant: n,
946
- size: s,
947
- level: c,
948
- maxLevels: u,
949
- keyboardEvents: l,
950
- scrollRefStyles: f,
951
- onActiveItemIdChange: i,
952
- a11yMode: g,
953
- open: v,
954
- scrollToTopOnOpen: y,
955
- autoActivateFirstItem: E,
956
- autoFocusList: w
957
- }
958
- );
959
- }, wr = "_media_1089b_3", Ir = "_icon_1089b_10", xr = "_avatar_1089b_14", Or = "_avatarGroup_1089b_18", le = {
960
- media: wr,
961
- icon: Ir,
962
- avatar: xr,
963
- avatarGroup: Or
964
- };
965
- function Nr(e) {
966
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null || we(e);
967
- }
968
- const Ve = ({ className: e, loading: o, icon: r, children: t }) => {
969
- if (!r)
970
- return null;
971
- if (o)
972
- return /* @__PURE__ */ a("div", { className: K(le.icon, e), children: /* @__PURE__ */ a(J, { svgElement: _e, loading: !0 }) });
973
- const n = Ee(r) ? "avatar" : Ce(r) ? "avatarGroup" : (Se(r), "icon");
974
- return /* @__PURE__ */ _("div", { className: K(le.media, e), "data-variant": n, children: [
975
- Ee(r) && /* @__PURE__ */ a(je, { ...r, className: le.avatar }) || Ce(r) && /* @__PURE__ */ a(he, { ...r, className: le.avatarGroup }) || Se(r) && /* @__PURE__ */ a(J, { ...r, className: le.icon }) || Nr(r) && /* @__PURE__ */ a(J, { className: le.icon, children: r }) || /* @__PURE__ */ a(J, { className: le.icon, svgElement: r }),
976
- t
977
- ] });
978
- }, kr = "_heading_1dyne_1", Cr = {
979
- heading: kr
980
- }, oe = ({
981
- id: e,
982
- loading: o,
983
- highlightWords: r = [],
984
- as: t = "h2",
985
- size: n,
986
- leading: s = "tight",
987
- weight: c = "medium",
988
- color: u,
989
- variant: d,
990
- maxRows: l,
991
- className: f,
992
- style: i,
993
- children: g
994
- }) => {
995
- const v = t, y = xt(g, r || []);
996
- return /* @__PURE__ */ a(
997
- v,
998
- {
999
- id: e,
1000
- className: K(Cr.heading, f),
1001
- style: i,
1002
- "data-size": n,
1003
- "data-leading": s,
1004
- "data-weight": c,
1005
- "data-color": u,
1006
- "data-variant": n === "xxs" && "default" || d,
1007
- "data-max-rows": l,
1008
- children: /* @__PURE__ */ a(ke, { loading: o, children: y })
1009
- }
1010
- );
1011
- }, Er = "_label_e5q28_3", Pr = {
1012
- label: Er
1013
- }, We = ({
1014
- className: e,
1015
- title: o,
1016
- titleProps: r = {},
1017
- description: t,
1018
- descriptionProps: n = {},
1019
- highlightWords: s,
1020
- loading: c,
1021
- children: u
1022
- }) => /* @__PURE__ */ a("span", { className: K(Pr.label, e), children: u || /* @__PURE__ */ _(pe, { children: [
1023
- o && /* @__PURE__ */ a(oe, { ...r, as: "span", loading: c, highlightWords: s, maxRows: 2, children: o }),
1024
- t && /* @__PURE__ */ a(
1025
- oe,
1026
- {
1027
- ...n,
1028
- as: "span",
1029
- weight: "normal",
1030
- leading: "inherit",
1031
- loading: c,
1032
- highlightWords: s,
1033
- maxRows: 2,
1034
- children: t
1035
- }
1036
- )
1037
- ] }) }), Sr = ({ className: e, onClick: o, checked: r, onChange: t, ...n }) => /* @__PURE__ */ a(de, { className: e, size: "xs", variant: "ghost", icon: !0, rounded: !0, onClick: o, children: /* @__PURE__ */ a(Ae, { ...n, type: "checkbox", size: "xs", checked: r, onChange: t }) }), jr = "_item_h7sxa_3", $r = "_media_h7sxa_136", Rr = "_label_h7sxa_157", Mr = "_title_h7sxa_172", zr = "_description_h7sxa_176", Dr = "_count_h7sxa_188", Ar = "_linkIcon_h7sxa_196", q = {
1038
- item: jr,
1039
- media: $r,
1040
- label: Rr,
1041
- title: Mr,
1042
- description: zr,
1043
- count: Dr,
1044
- linkIcon: Ar
1045
- }, ut = ({
1046
- id: e,
1047
- groupId: o,
1048
- role: r = "menuItem",
1049
- as: t,
1050
- href: n,
1051
- onClick: s,
1052
- onChange: c,
1053
- onKeyPress: u,
1054
- onMouseEnter: d,
1055
- size: l = "sm",
1056
- variant: f,
1057
- color: i,
1058
- name: g,
1059
- value: v,
1060
- checked: y,
1061
- icon: w,
1062
- label: I,
1063
- badge: N,
1064
- controls: $,
1065
- title: k,
1066
- description: m,
1067
- highlightWords: O,
1068
- count: E,
1069
- linkIcon: D = !1,
1070
- disabled: M,
1071
- selected: b,
1072
- active: A,
1073
- tabIndex: R = 0,
1074
- className: p,
1075
- "data-testid": z,
1076
- ...P
1077
- }) => {
1078
- const h = typeof I == "function" ? I() : I, S = $t(P);
1079
- if (r === "checkbox" || r === "radio") {
1080
- const F = w || (y ? at : lr);
1081
- return /* @__PURE__ */ _(
1082
- "label",
1083
- {
1084
- ...S,
1085
- className: K(q.item, p),
1086
- id: e,
1087
- "data-id": e,
1088
- "data-group-id": o,
1089
- "data-size": l,
1090
- "data-variant": f,
1091
- "data-color": i,
1092
- "data-active": A,
1093
- role: r,
1094
- "aria-disabled": M,
1095
- "aria-checked": y,
1096
- "aria-selected": y,
1097
- "data-selected": y,
1098
- "aria-label": k,
1099
- "data-testid": z,
1100
- onKeyUp: (Y) => {
1101
- M || (Y.key === "Enter" && s?.(), u?.(Y));
1102
- },
1103
- onClick: s,
1104
- onMouseEnter: d,
1105
- tabIndex: R,
1106
- children: [
1107
- /* @__PURE__ */ a(
1108
- "input",
1109
- {
1110
- name: g,
1111
- value: v,
1112
- type: r,
1113
- checked: !!y,
1114
- onChange: c,
1115
- readOnly: !c,
1116
- style: { opacity: 0, position: "absolute" },
1117
- tabIndex: -1
1118
- }
1119
- ),
1120
- /* @__PURE__ */ a(Ve, { icon: F, className: q.media }),
1121
- /* @__PURE__ */ a(
1122
- We,
1123
- {
1124
- className: q.label,
1125
- highlightWords: O,
1126
- title: /* @__PURE__ */ _(pe, { children: [
1127
- k,
1128
- " ",
1129
- E && /* @__PURE__ */ a("i", { className: q.count, children: E })
1130
- ] }),
1131
- titleProps: {
1132
- weight: "medium",
1133
- className: q.title
1134
- },
1135
- description: m,
1136
- descriptionProps: {
1137
- weight: "normal",
1138
- variant: "subtle",
1139
- className: q.description
1140
- },
1141
- children: h
1142
- }
1143
- ),
1144
- /* @__PURE__ */ _(De, { children: [
1145
- N && /* @__PURE__ */ a(ye, { ...N }),
1146
- !M && $
1147
- ] })
1148
- ]
1149
- }
1150
- );
1151
- }
1152
- const G = t || (n ? "a" : "button"), H = D && st;
1153
- return /* @__PURE__ */ _(
1154
- G,
1155
- {
1156
- href: n,
1157
- className: K(q.item, p),
1158
- id: e,
1159
- "data-id": e,
1160
- "data-group-id": o,
1161
- "data-size": l,
1162
- "data-variant": f,
1163
- "data-color": i,
1164
- "data-active": A,
1165
- "aria-disabled": M,
1166
- ...M ? { disabled: M } : {},
1167
- "aria-selected": b,
1168
- "data-selected": b,
1169
- "aria-label": k,
1170
- "data-testid": z,
1171
- onKeyUp: (F) => {
1172
- M || (F.key === "Enter" && s?.(), u?.(F));
1173
- },
1174
- onClick: s,
1175
- onMouseEnter: d,
1176
- tabIndex: M ? -1 : R ?? 0,
1177
- role: r === "menuItem" ? "menuitem" : r,
1178
- ...S,
1179
- children: [
1180
- w && /* @__PURE__ */ a(Ve, { icon: w, className: q.media }),
1181
- /* @__PURE__ */ a(
1182
- We,
1183
- {
1184
- className: q.label,
1185
- highlightWords: O,
1186
- title: /* @__PURE__ */ _(pe, { children: [
1187
- k,
1188
- " ",
1189
- E && /* @__PURE__ */ a("i", { className: q.count, children: E })
1190
- ] }),
1191
- titleProps: {
1192
- weight: "medium",
1193
- className: q.title
1194
- },
1195
- description: m,
1196
- descriptionProps: {
1197
- variant: "subtle",
1198
- className: q.description
1199
- },
1200
- children: h
1201
- }
1202
- ),
1203
- /* @__PURE__ */ _(De, { children: [
1204
- N && /* @__PURE__ */ a(ye, { ...N }),
1205
- !M && $,
1206
- D && /* @__PURE__ */ a(J, { svgElement: H, className: q.linkIcon })
1207
- ] })
1208
- ]
1209
- }
1210
- );
1211
- }, Br = "_fieldContainer_1986v_1", Lr = "_field_1986v_1", Fr = "_icon_1986v_15", Tr = "_input_1986v_9", Gr = "_clear_1986v_61", Hr = "_clearButton_1986v_74", Kr = "_autocomplete_1986v_103", U = {
1212
- fieldContainer: Br,
1213
- field: Lr,
1214
- icon: Fr,
1215
- input: Tr,
1216
- clear: Gr,
1217
- clearButton: Hr,
1218
- autocomplete: Kr
1219
- }, Be = ({
1220
- className: e,
1221
- collapsible: o,
1222
- loading: r,
1223
- loadingLabel: t = "Loading ...",
1224
- size: n,
1225
- color: s = "neutral",
1226
- label: c,
1227
- value: u,
1228
- onClear: d,
1229
- clearButtonAltText: l = "Clear search",
1230
- menu: f,
1231
- minLength: i,
1232
- ...g
1233
- }) => {
1234
- const v = Ne(), [y, w] = se(!1), I = g.id || `search-field-${v}`, N = `${I}-listbox`, [$, k] = se(void 0), m = "searchfield-clear-button-" + Ne(), O = ce(() => !f || !u || typeof i == "number" && typeof u == "string" && u.length < i ? !1 : y, [f, y, i, u]), E = ce(() => (f?.items ?? []).map((p) => ({
1235
- ...p,
1236
- onClick: () => {
1237
- p.onClick?.(), w(!1);
1238
- }
1239
- })), [f]), D = (p) => {
1240
- if (p.key === "Enter" && O) {
1241
- f?.items?.[0]?.onClick?.(), w(!1);
1242
- return;
1243
- }
1244
- if (p.key === "Escape" && O) {
1245
- p.preventDefault(), p.stopPropagation(), w(!1), f?.onClose(), document.getElementById(I)?.focus();
1246
- return;
1247
- }
1248
- g.onKeyDown?.(p), w(!0);
1249
- }, M = () => {
1250
- w(!0);
1251
- }, b = (p) => {
1252
- if (!y) return;
1253
- const z = p.relatedTarget;
1254
- z && p.currentTarget.contains(z) || w(!1);
1255
- }, A = (p) => {
1256
- p.preventDefault();
1257
- }, R = (p) => {
1258
- p.relatedTarget?.id === m && k(void 0), g.onBlur?.(p);
1259
- };
1260
- return f ? /* @__PURE__ */ _("div", { className: U.fieldContainer, children: [
1261
- /* @__PURE__ */ _(
1262
- Ue,
1263
- {
1264
- size: n,
1265
- color: s,
1266
- label: c,
1267
- className: K(U.field, e),
1268
- onBlurCapture: b,
1269
- children: [
1270
- /* @__PURE__ */ a(
1271
- Ae,
1272
- {
1273
- ...g,
1274
- id: I,
1275
- type: "search",
1276
- value: u,
1277
- className: U.input,
1278
- "data-collapsible": o,
1279
- autoCapitalize: "off",
1280
- autoComplete: "off",
1281
- minLength: i,
1282
- onKeyDown: D,
1283
- onBlur: R,
1284
- ...f && {
1285
- role: "combobox",
1286
- "aria-autocomplete": "list",
1287
- "aria-expanded": !!O,
1288
- "aria-haspopup": "listbox",
1289
- "aria-controls": N,
1290
- "aria-activedescendant": O ? $ : void 0,
1291
- onFocus: M
1292
- }
1293
- }
1294
- ),
1295
- /* @__PURE__ */ a(qe, { className: U.icon }),
1296
- d && !!u && /* @__PURE__ */ a("span", { className: U.clear, children: /* @__PURE__ */ a(
1297
- de,
1298
- {
1299
- id: m,
1300
- "data-testid": "clear-button",
1301
- size: "xs",
1302
- rounded: !0,
1303
- icon: !0,
1304
- variant: "tinted",
1305
- className: U.clearButton,
1306
- onClick: () => {
1307
- d?.(), document.getElementById(I)?.focus();
1308
- },
1309
- "aria-label": l,
1310
- "data-action": "clear-input",
1311
- children: /* @__PURE__ */ a(_e, {})
1312
- }
1313
- ) })
1314
- ]
1315
- }
1316
- ),
1317
- f && O && /* @__PURE__ */ a("div", { className: U.autocomplete, "aria-hidden": !O, onMouseDown: A, children: /* @__PURE__ */ a(
1318
- dt,
1319
- {
1320
- ...f,
1321
- id: N,
1322
- items: E,
1323
- groups: f?.groups,
1324
- keyboardEvents: !0,
1325
- a11yMode: "combobox",
1326
- open: O,
1327
- autoFocusList: !1,
1328
- onActiveItemIdChange: k
1329
- }
1330
- ) })
1331
- ] }) : /* @__PURE__ */ _(
1332
- Ue,
1333
- {
1334
- size: n,
1335
- color: s,
1336
- label: c,
1337
- className: K(U.field, e),
1338
- onBlurCapture: b,
1339
- children: [
1340
- /* @__PURE__ */ a(
1341
- Ae,
1342
- {
1343
- ...g,
1344
- id: I,
1345
- type: "search",
1346
- value: u,
1347
- className: U.input,
1348
- "data-collapsible": o,
1349
- autoCapitalize: "off",
1350
- autoComplete: "off",
1351
- minLength: i,
1352
- onKeyDown: D,
1353
- onBlur: R
1354
- }
1355
- ),
1356
- r ? /* @__PURE__ */ a(jt, { "aria-hidden": !0, className: U.icon }) : /* @__PURE__ */ a(qe, { "aria-hidden": !0, className: U.icon }),
1357
- d && !!u && /* @__PURE__ */ a("span", { className: U.clear, children: /* @__PURE__ */ a(
1358
- de,
1359
- {
1360
- id: m,
1361
- "data-testid": "clear-button",
1362
- size: "xs",
1363
- rounded: !0,
1364
- icon: !0,
1365
- variant: "tinted",
1366
- className: U.clearButton,
1367
- onClick: () => {
1368
- d?.(), document.getElementById(I)?.focus();
1369
- },
1370
- "aria-label": l,
1371
- "data-action": "clear-input",
1372
- children: /* @__PURE__ */ a(_e, {})
1373
- }
1374
- ) })
1375
- ]
1376
- }
1377
- );
1378
- }, qr = "_byline_fzp7k_1", Ur = "_avatar_fzp7k_7", Vr = "_avatarGroup_fzp7k_12", Wr = "_label_fzp7k_26", be = {
1379
- byline: qr,
1380
- avatar: Ur,
1381
- avatarGroup: Vr,
1382
- label: Wr
1383
- }, Yr = ({
1384
- loading: e,
1385
- color: o = "neutral",
1386
- size: r = "xs",
1387
- avatar: t,
1388
- avatarGroup: n,
1389
- datetime: s,
1390
- children: c,
1391
- as: u,
1392
- ...d
1393
- }) => {
1394
- const l = u || "div", f = s ? "time" : "span";
1395
- return /* @__PURE__ */ _(l, { ...d, className: be.byline, "data-color": o, "data-size": r, children: [
1396
- (n || t) && /* @__PURE__ */ a(ke, { variant: "circle", className: be.avatar, loading: e, children: n ? /* @__PURE__ */ a(he, { ...n, size: r, className: be.avatarGroup }) : t && /* @__PURE__ */ a(je, { ...t, size: r, className: be.avatar }) }),
1397
- /* @__PURE__ */ a(f, { "data-size": r, dateTime: s, className: be.label, children: /* @__PURE__ */ a(ke, { loading: e, children: c }) })
1398
- ] });
1399
- }, Qr = "_dropdown_1mtdm_1", Xr = "_content_1mtdm_17", Jr = "_backdrop_1mtdm_47", Zr = "_header_1mtdm_76", en = "_footer_1mtdm_77", tn = "_title_1mtdm_148", me = {
1400
- dropdown: Qr,
1401
- content: Xr,
1402
- backdrop: Jr,
1403
- header: Zr,
1404
- footer: en,
1405
- title: tn
1406
- }, rn = "data-focus-guard", mt = (e) => {
1407
- const o = [
1408
- "a[href]",
1409
- "button:not([disabled])",
1410
- "input:not([disabled])",
1411
- "select:not([disabled])",
1412
- "textarea:not([disabled])",
1413
- '[tabindex]:not([tabindex="-1"])',
1414
- '[contenteditable="true"]'
1415
- ].join(",");
1416
- return Array.from(e.querySelectorAll(o)).filter((r) => !r.hasAttribute(rn)).filter((r) => !r.hasAttribute("disabled")).filter((r) => r.getAttribute("aria-hidden") !== "true").filter((r) => r.tabIndex !== -1).filter((r) => {
1417
- const t = r.getClientRects();
1418
- return t.length > 0 && t[0].width > 0 && t[0].height > 0;
1419
- });
1420
- }, nn = (e) => {
1421
- mt(e)[0]?.focus({ preventScroll: !0 });
1422
- }, on = ({
1423
- id: e = "dropdown",
1424
- size: o = "sm",
1425
- className: r,
1426
- backdrop: t = !0,
1427
- placement: n = "bottom-left",
1428
- variant: s = "dropdown",
1429
- title: c = "Title",
1430
- closeLabel: u = "Close",
1431
- submitLabel: d,
1432
- trigger: l,
1433
- children: f,
1434
- open: i,
1435
- onClose: g,
1436
- onSubmit: v,
1437
- activeDescendantId: y,
1438
- useFixedPosition: w = !1,
1439
- expanded: I = !1
1440
- }) => {
1441
- const N = te(null), $ = te(null), k = te(i);
1442
- X(() => {
1443
- k.current = i;
1444
- }, [i]);
1445
- const [m, O] = se({
1446
- yDir: n.includes("top") ? "top" : "bottom",
1447
- xDir: n.includes("right") ? "right" : "left",
1448
- maxHeight: 300
1449
- }), E = Ze(() => {
1450
- if (i && N.current && $.current) {
1451
- const b = N.current.getBoundingClientRect(), A = $.current.getBoundingClientRect(), R = window.innerHeight, p = window.innerWidth, z = 16, P = R - b.bottom, h = b.top, S = p - b.right - A.width, G = P < 250 && h > P, H = G ? "top" : "bottom", F = (G ? h : P) - z, Z = S < z ? "right" : "left";
1452
- O((x) => ({
1453
- ...x,
1454
- yDir: H,
1455
- maxHeight: F,
1456
- xDir: Z,
1457
- triggerRect: w ? b : void 0
1458
- }));
1459
- }
1460
- }, [i, w]);
1461
- Me(() => (E(), window.addEventListener("resize", E), w && window.addEventListener("scroll", E, !0), () => {
1462
- window.removeEventListener("resize", E), w && window.removeEventListener("scroll", E, !0);
1463
- }), [E, w]), X(() => {
1464
- if (!i) return;
1465
- const b = requestAnimationFrame(() => {
1466
- const A = $.current;
1467
- if (!A) return;
1468
- const R = A.querySelector(
1469
- 'input[type="search"]:not([disabled]), input[role="searchbox"]:not([disabled]), input[data-dropdown-search]:not([disabled])'
1470
- );
1471
- if (R) {
1472
- const p = R.value.length;
1473
- R.focus({ preventScroll: !0 });
1474
- try {
1475
- R.setSelectionRange(p, p);
1476
- } catch {
1477
- }
1478
- return;
1479
- }
1480
- A.focus?.({ preventScroll: !0 });
1481
- });
1482
- return () => cancelAnimationFrame(b);
1483
- }, [i]), X(() => {
1484
- const b = (R) => {
1485
- R.key === "Escape" && g();
1486
- }, A = (R) => {
1487
- const p = R.target, z = N.current?.contains(p), P = $.current?.contains(p);
1488
- !z && !P && g();
1489
- };
1490
- return i && (document.addEventListener("mousedown", A), document.addEventListener("keydown", b)), () => {
1491
- document.removeEventListener("mousedown", A), document.removeEventListener("keydown", b);
1492
- };
1493
- }, [i, g]), X(() => {
1494
- if (!i) return;
1495
- const b = $.current;
1496
- if (!b) return;
1497
- const A = (p) => {
1498
- if (!k.current)
1499
- return;
1500
- const z = p.target;
1501
- z && !b.contains(z) && nn(b);
1502
- }, R = (p) => {
1503
- if (p.key !== "Tab") return;
1504
- const z = mt(b);
1505
- if (z.length === 0) {
1506
- p.preventDefault(), b.focus?.({ preventScroll: !0 });
1507
- return;
1508
- }
1509
- const P = z[0], h = z[z.length - 1], S = document.activeElement;
1510
- p.shiftKey ? S === P && (p.preventDefault(), h.focus({ preventScroll: !0 })) : S === h && (p.preventDefault(), P.focus({ preventScroll: !0 }));
1511
- };
1512
- return document.addEventListener("focusin", A), document.addEventListener("keydown", R), () => {
1513
- document.removeEventListener("focusin", A), document.removeEventListener("keydown", R);
1514
- };
1515
- }, [i]);
1516
- const D = w && m.triggerRect ? {
1517
- position: "fixed",
1518
- zIndex: 1e3,
1519
- width: "max-content",
1520
- maxHeight: `${m.maxHeight}px`,
1521
- overflowY: "auto",
1522
- [m.xDir === "left" ? "left" : "right"]: m.xDir === "left" ? m.triggerRect.left : window.innerWidth - m.triggerRect.right,
1523
- [m.yDir === "bottom" ? "top" : "bottom"]: m.yDir === "bottom" ? m.triggerRect.bottom + 8 : window.innerHeight - m.triggerRect.top + 8
1524
- } : {
1525
- position: "absolute",
1526
- zIndex: 50,
1527
- width: "max-content",
1528
- maxHeight: `${m.maxHeight}px`,
1529
- overflowY: "auto",
1530
- [m.xDir]: 0,
1531
- [m.yDir === "bottom" ? "top" : "bottom"]: "100%"
1532
- }, M = /* @__PURE__ */ _(
1533
- "div",
1534
- {
1535
- ref: $,
1536
- className: K(me.dropdown, r),
1537
- style: D,
1538
- "aria-hidden": !i,
1539
- "data-variant": s,
1540
- "data-expanded": I,
1541
- "data-size": o,
1542
- tabIndex: -1,
1543
- role: "menu",
1544
- "aria-modal": s === "drawer-dropdown" ? !0 : void 0,
1545
- "aria-activedescendant": y,
1546
- children: [
1547
- /* @__PURE__ */ _("header", { className: me.header, children: [
1548
- /* @__PURE__ */ a("h2", { className: me.title, children: c }),
1549
- /* @__PURE__ */ a(de, { size: "sm", variant: "outline", onClick: g, "aria-label": u, children: /* @__PURE__ */ a(_e, {}) })
1550
- ] }),
1551
- /* @__PURE__ */ a("div", { className: me.content, children: f }),
1552
- d && /* @__PURE__ */ a("footer", { className: me.footer, children: /* @__PURE__ */ a(de, { size: "lg", variant: "solid", onClick: v || g, rounded: !0, children: /* @__PURE__ */ a("span", { "data-size": "md", children: d }) }) })
1553
- ]
1554
- }
1555
- );
1556
- return /* @__PURE__ */ _(pe, { children: [
1557
- t && /* @__PURE__ */ a("div", { className: me.backdrop, "aria-hidden": !i }),
1558
- /* @__PURE__ */ _("div", { id: e + "-root", ref: N, style: { position: "relative", display: "inline-block" }, children: [
1559
- l,
1560
- w ? It(M, document.body) : M
1561
- ] })
1562
- ] });
1563
- }, an = Ie(({ items: e, groups: o = {}, sortGroupBy: r, highlightWords: t, isLoading: n }) => {
1564
- const { menu: s } = Le({
1565
- items: e,
1566
- groups: o,
1567
- groupByKey: "groupId",
1568
- keyboardEvents: !1,
1569
- sortGroupBy: r
1570
- });
1571
- return /* @__PURE__ */ a(bt, { spacing: 6, "aria-busy": n, children: s?.map((c, u) => {
1572
- const d = c.props || {};
1573
- return /* @__PURE__ */ ze(ft, { ...d, key: "dialog-list-item" + u }, c?.items.map((l, f) => {
1574
- const i = l.props || {};
1575
- return /* @__PURE__ */ ze(pt, { ...i, highlightWords: t, key: "dialog-list-item" + f });
1576
- }));
1577
- }) });
1578
- });
1579
- an.displayName = "DialogList";
1580
- const ft = Ie(({ title: e, description: o, children: r }) => /* @__PURE__ */ _(bt, { spacing: 4, children: [
1581
- /* @__PURE__ */ _(Ge, { direction: "col", spacing: 2, children: [
1582
- e && /* @__PURE__ */ a(oe, { size: "lg", children: e }),
1583
- o && /* @__PURE__ */ a(et, { size: "sm", style: { marginBottom: ".5em" }, children: o })
1584
- ] }),
1585
- /* @__PURE__ */ a(Un, { spacing: 3, children: r })
1586
- ] }));
1587
- ft.displayName = "DialogListGroup";
1588
- const sn = "_item_e034j_3", ln = "_border_e034j_58", cn = "_header_e034j_69", dn = "_summary_e034j_85", un = "_controls_e034j_99", mn = "_footer_e034j_106", fn = "_seenBy_e034j_111", pn = "_link_e034j_121", hn = "_title_e034j_126", vn = "_badge_e034j_140", Q = {
1589
- item: sn,
1590
- border: ln,
1591
- header: cn,
1592
- summary: dn,
1593
- controls: un,
1594
- footer: mn,
1595
- seenBy: fn,
1596
- link: pn,
1597
- title: hn,
1598
- badge: vn
1599
- }, pt = Ie(
1600
- ({
1601
- as: e = "a",
1602
- size: o = "xl",
1603
- variant: r = "default",
1604
- color: t,
1605
- loading: n,
1606
- controls: s,
1607
- selectable: c,
1608
- selected: u,
1609
- status: d,
1610
- extendedStatusLabel: l,
1611
- sender: f,
1612
- recipient: i,
1613
- recipientLabel: g = "to",
1614
- grouped: v = !1,
1615
- updatedAt: y,
1616
- updatedAtLabel: w,
1617
- archived: I,
1618
- archivedAt: N,
1619
- archivedAtLabel: $,
1620
- trashed: k,
1621
- trashedAt: m,
1622
- trashedAtLabel: O,
1623
- badge: E,
1624
- dueAt: D,
1625
- dueAtLabel: M,
1626
- unread: b,
1627
- seenByLog: A,
1628
- draftsLabel: R,
1629
- sentCount: p,
1630
- receivedCount: z,
1631
- attachmentsCount: P,
1632
- attachmentsLabel: h,
1633
- tooltips: S = {},
1634
- title: G,
1635
- description: H,
1636
- summary: F,
1637
- highlightWords: Y,
1638
- id: Z,
1639
- ...x
1640
- }) => {
1641
- const j = c ? "select" : r;
1642
- return /* @__PURE__ */ _(
1643
- Ot,
1644
- {
1645
- as: "li",
1646
- id: Z,
1647
- className: Q.item,
1648
- size: o,
1649
- color: t,
1650
- variant: j,
1651
- "data-unread": b ? "true" : "false",
1652
- "data-selected": u,
1653
- "data-trashed": k,
1654
- "data-archived": I,
1655
- "data-loading": n,
1656
- children: [
1657
- /* @__PURE__ */ a(Nt, { ...x, className: Q.link, as: e, children: /* @__PURE__ */ _("div", { className: Q.border, children: [
1658
- /* @__PURE__ */ _("header", { className: Q.header, children: [
1659
- /* @__PURE__ */ _(
1660
- oe,
1661
- {
1662
- as: "h2",
1663
- highlightWords: Y,
1664
- weight: b ? "bold" : "normal",
1665
- loading: n,
1666
- maxRows: 2,
1667
- className: Q.title,
1668
- children: [
1669
- G,
1670
- E && /* @__PURE__ */ a(ye, { className: Q.badge, variant: "tinted", size: "xs", ...E })
1671
- ]
1672
- }
1673
- ),
1674
- /* @__PURE__ */ a(
1675
- gn,
1676
- {
1677
- size: "xs",
1678
- loading: n,
1679
- sender: f,
1680
- recipient: i,
1681
- recipientLabel: g,
1682
- grouped: v
1683
- }
1684
- ),
1685
- F && /* @__PURE__ */ a(
1686
- oe,
1687
- {
1688
- as: "h3",
1689
- highlightWords: Y,
1690
- weight: "normal",
1691
- className: Q.summary,
1692
- loading: n,
1693
- maxRows: 2,
1694
- children: F
1695
- }
1696
- )
1697
- ] }),
1698
- /* @__PURE__ */ a(
1699
- bn,
1700
- {
1701
- className: Q.footer,
1702
- loading: n,
1703
- status: d,
1704
- extendedStatusLabel: l,
1705
- draftsLabel: R,
1706
- sentCount: p,
1707
- receivedCount: z,
1708
- updatedAt: y,
1709
- updatedAtLabel: w,
1710
- archivedAt: N,
1711
- archivedAtLabel: $,
1712
- trashedAt: m,
1713
- trashedAtLabel: O,
1714
- dueAt: D,
1715
- dueAtLabel: M,
1716
- attachmentsCount: P,
1717
- attachmentsLabel: h,
1718
- tooltips: S
1719
- }
1720
- ),
1721
- A && S?.seenBy ? /* @__PURE__ */ a(kt, { placement: "bottom", content: S?.seenBy, children: /* @__PURE__ */ a("span", { className: Q.seenBy, children: /* @__PURE__ */ a(he, { items: A.items }) }) }) : A && /* @__PURE__ */ a(he, { items: A.items, className: Q.seenBy })
1722
- ] }) }),
1723
- /* @__PURE__ */ a(De, { className: Q.controls, children: s })
1724
- ]
1725
- }
1726
- );
1727
- }
1728
- );
1729
- pt.displayName = "DialogListItem";
1730
- const bn = ({
1731
- className: e,
1732
- loading: o,
1733
- status: r,
1734
- sender: t,
1735
- updatedAt: n,
1736
- updatedAtLabel: s,
1737
- dueAt: c,
1738
- dueAtLabel: u,
1739
- archivedAt: d,
1740
- archivedAtLabel: l,
1741
- trashedAt: f,
1742
- trashedAtLabel: i,
1743
- draftsLabel: g,
1744
- sentCount: v = 0,
1745
- receivedCount: y = 0,
1746
- attachmentsCount: w = 0,
1747
- attachmentsLabel: I,
1748
- transmissionsLabel: N,
1749
- activityLog: $,
1750
- extendedStatusLabel: k,
1751
- tooltips: m = {}
1752
- }) => /* @__PURE__ */ _(Ct, { className: e, size: "xs", children: [
1753
- r && /* @__PURE__ */ a(On, { tooltip: m.status, loading: o, size: "xs", ...r }),
1754
- k && /* @__PURE__ */ a(ee, { tooltip: m.extendedStatus, size: "xs", variant: "outline", children: k }),
1755
- g && /* @__PURE__ */ a(ee, { tooltip: m.drafts, size: "xs", variant: "dotted", children: g }),
1756
- v > 0 && /* @__PURE__ */ a(ee, { tooltip: m.sent, size: "xs", variant: "outline", icon: at, children: v }),
1757
- y > 0 && /* @__PURE__ */ a(ee, { tooltip: m.received, size: "xs", variant: "outline", icon: qt, children: y }),
1758
- n && /* @__PURE__ */ _(Oe, { tooltip: m.updatedAt, loading: o, datetime: n, size: "xs", children: [
1759
- /* @__PURE__ */ a("strong", { children: t && t.name + ", " }),
1760
- s
1761
- ] }),
1762
- c && u && /* @__PURE__ */ a(Oe, { tooltip: m.dueAt, loading: o, datetime: c, size: "xs", icon: zt, children: u }),
1763
- w > 0 && /* @__PURE__ */ a(ee, { tooltip: m.attachments, loading: o, size: "xs", icon: Dt, children: I || w }),
1764
- N && /* @__PURE__ */ a(ee, { tooltip: m.transmissions, loading: o, size: "xs", icon: rr, children: N }),
1765
- f && i && /* @__PURE__ */ a(Oe, { tooltip: m.trashedAt, loading: o, datetime: f, size: "xs", icon: At, children: i }) || d && l && /* @__PURE__ */ a(
1766
- Oe,
1767
- {
1768
- tooltip: m.archivedAt,
1769
- loading: o,
1770
- datetime: d,
1771
- size: "xs",
1772
- icon: Bt,
1773
- children: l
1774
- }
1775
- ),
1776
- $ && /* @__PURE__ */ a(
1777
- ee,
1778
- {
1779
- tooltip: m.activityLog,
1780
- loading: o,
1781
- size: "xs",
1782
- icon: er,
1783
- as: $?.onClick ? "button" : "span",
1784
- onClick: $?.onClick,
1785
- children: $?.label || "Activity log"
1786
- }
1787
- )
1788
- ] }), gn = ({
1789
- sender: e,
1790
- recipient: o,
1791
- recipientLabel: r = "to",
1792
- grouped: t = !1,
1793
- loading: n,
1794
- size: s = "xs"
1795
- }) => !e && !o ? null : /* @__PURE__ */ _(Yr, { loading: n, size: s, avatar: e, avatarGroup: !n && t && e && o ? {
1796
- items: [o, e]
1797
- } : void 0, children: [
1798
- /* @__PURE__ */ a("strong", { children: e?.name }),
1799
- " ",
1800
- o && r + " " + o?.name
1801
- ] }), yn = "_media_1x8z9_1", _n = "_icon_1x8z9_10", wn = "_avatarGroup_1x8z9_17", fe = {
1802
- media: yn,
1803
- icon: _n,
1804
- avatarGroup: wn
1805
- };
1806
- function In(e) {
1807
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null || we(e);
1808
- }
1809
- const He = ({ size: e = "xs", icon: o, progress: r }) => !o && typeof r != "number" ? !1 : /* @__PURE__ */ _("span", { className: fe.media, "data-size": e, children: [
1810
- Ee(o) && /* @__PURE__ */ a(je, { ...o, className: fe.avatar }) || Ce(o) && /* @__PURE__ */ a(he, { ...o, className: fe.avatarGroup }) || Se(o) && /* @__PURE__ */ a(J, { ...o, className: fe.icon }) || In(o) && o || /* @__PURE__ */ a(J, { svgElement: o, className: fe.icon }),
1811
- r && /* @__PURE__ */ a(Ft, { value: r, className: fe.icon })
1812
- ] }), ee = ({
1813
- loading: e,
1814
- reverse: o,
1815
- size: r = "xs",
1816
- variant: t = "text",
1817
- icon: n,
1818
- children: s,
1819
- tooltip: c,
1820
- ...u
1821
- }) => /* @__PURE__ */ _(Fe, { loading: e, reverse: o, variant: t, tooltip: c, size: r, ...u, children: [
1822
- !e && n && /* @__PURE__ */ a(He, { icon: n }),
1823
- /* @__PURE__ */ a(Te, { variant: t, size: r, children: s })
1824
- ] }), Ye = ({ size: e = "xs", variant: o = "text", progress: r = 0, tooltip: t, children: n }) => /* @__PURE__ */ _(Fe, { variant: o, size: e, tooltip: t, children: [
1825
- /* @__PURE__ */ a(He, { size: e, progress: r }),
1826
- /* @__PURE__ */ a(Te, { variant: o, size: e, children: n })
1827
- ] }), Oe = ({
1828
- loading: e,
1829
- size: o = "xs",
1830
- variant: r = "text",
1831
- datetime: t,
1832
- icon: n,
1833
- tooltip: s,
1834
- children: c
1835
- }) => /* @__PURE__ */ _(Fe, { tooltip: s, loading: e, as: "time", variant: r, datetime: t, size: o, children: [
1836
- !e && n && /* @__PURE__ */ a(He, { size: o, icon: n }),
1837
- /* @__PURE__ */ a(Te, { variant: r, size: o, children: c })
1838
- ] });
1839
- var xn = /* @__PURE__ */ ((e) => (e["not-applicable"] = "NOT_APPLICABLE", e.draft = "DRAFT", e.awaiting = "AWAITING", e.completed = "COMPLETED", e["in-progress"] = "IN_PROGRESS", e["requires-attention"] = "REQUIRES_ATTENTION", e))(xn || {});
1840
- const On = ({ loading: e, size: o = "xs", value: r = "not-applicable", label: t, tooltip: n }) => {
1841
- if (e)
1842
- return null;
1843
- switch (r) {
1844
- case "draft":
1845
- return /* @__PURE__ */ a(ee, { tooltip: n, size: o, variant: "dotted", children: t || r });
1846
- case "requires-attention":
1847
- return /* @__PURE__ */ a(ee, { tooltip: n, variant: "solid", children: t || r });
1848
- case "awaiting":
1849
- return /* @__PURE__ */ a(ee, { tooltip: n, size: o, variant: "outline", icon: or, children: t || r });
1850
- case "in-progress":
1851
- return /* @__PURE__ */ a(Ye, { tooltip: n, size: o, variant: "outline", progress: 75, children: t || r });
1852
- case "completed":
1853
- return /* @__PURE__ */ a(Ye, { tooltip: n, size: o, variant: "outline", progress: 100, children: t || r });
1854
- default:
1855
- return null;
1856
- }
1857
- }, Nn = "_header_29hv7_1", kn = "_label_29hv7_27", Cn = "_link_29hv7_43", En = "_badge_29hv7_47", Pn = "_linkIcon_29hv7_51", Sn = "_linkFocus_29hv7_61", jn = "_controls_29hv7_69", ne = {
1858
- header: Nn,
1859
- label: kn,
1860
- link: Cn,
1861
- badge: En,
1862
- linkIcon: Pn,
1863
- linkFocus: Sn,
1864
- controls: jn
1865
- }, $n = ({
1866
- as: e,
1867
- highlightWords: o,
1868
- interactive: r = !0,
1869
- color: t,
1870
- loading: n,
1871
- disabled: s,
1872
- collapsible: c,
1873
- linkIcon: u,
1874
- expanded: d,
1875
- select: l,
1876
- href: f,
1877
- onClick: i,
1878
- onKeyPress: g,
1879
- tabIndex: v,
1880
- size: y,
1881
- title: w,
1882
- description: I,
1883
- icon: N,
1884
- active: $,
1885
- badge: k,
1886
- controls: m,
1887
- className: O,
1888
- children: E,
1889
- ariaLabel: D,
1890
- ariaControlsId: M
1891
- }) => {
1892
- const b = c ? d ? Xt : Wt : u ? st : void 0, A = () => k && !n && typeof k == "object" && "label" in k ? /* @__PURE__ */ a(ye, { ...k, className: ne.badge }) : we(k) ? k : null, R = D !== void 0 ? D : typeof w == "string" ? w : void 0, p = Ne();
1893
- return /* @__PURE__ */ _(
1894
- "div",
1895
- {
1896
- className: K(ne.header, O),
1897
- "data-color": t,
1898
- "data-interactive": r,
1899
- "data-size": y,
1900
- "data-has-active-child": $,
1901
- "aria-disabled": s,
1902
- children: [
1903
- /* @__PURE__ */ _(
1904
- Gt,
1905
- {
1906
- as: e,
1907
- href: f,
1908
- onClick: i,
1909
- onKeyPress: g,
1910
- tabIndex: v,
1911
- loading: n,
1912
- disabled: s || n,
1913
- active: $,
1914
- ariaLabel: R,
1915
- className: ne.link,
1916
- expanded: d,
1917
- ariaControlsId: M,
1918
- collapsible: c,
1919
- children: [
1920
- r && /* @__PURE__ */ a("div", { className: ne.linkFocus, "aria-hidden": "true" }),
1921
- l && /* @__PURE__ */ a(Sr, { ...l, className: ne.select }),
1922
- /* @__PURE__ */ a(Fn, { loading: n, icon: N }),
1923
- /* @__PURE__ */ a(
1924
- Mn,
1925
- {
1926
- size: y,
1927
- loading: n,
1928
- highlightWords: o,
1929
- title: w,
1930
- description: I,
1931
- id: p,
1932
- className: ne.label,
1933
- children: E
1934
- }
1935
- )
1936
- ]
1937
- }
1938
- ),
1939
- /* @__PURE__ */ _(Ht, { className: ne.controls, children: [
1940
- m && !n && /* @__PURE__ */ a("span", { className: ne.customControls, children: m }),
1941
- A(),
1942
- b && !s && /* @__PURE__ */ a("span", { className: ne.linkIcon, children: /* @__PURE__ */ a(
1943
- J,
1944
- {
1945
- svgElement: b,
1946
- style: {
1947
- fontSize: "1.5rem"
1948
- }
1949
- }
1950
- ) })
1951
- ] })
1952
- ]
1953
- }
1954
- );
1955
- }, Rn = "_label_1tmg6_1", Qe = {
1956
- label: Rn
1957
- }, ht = (e) => typeof e == "object" && e !== null && "children" in e;
1958
- function vt(e) {
1959
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null || we(e);
1960
- }
1961
- const Xe = (e) => {
1962
- const o = {
1963
- as: "h3",
1964
- size: "sm"
1965
- };
1966
- return ht(e) ? { ...o, ...e } : vt(e) ? {
1967
- ...o,
1968
- children: e
1969
- } : null;
1970
- }, Je = (e) => {
1971
- const o = {
1972
- as: "span",
1973
- size: "xs",
1974
- weight: "normal",
1975
- variant: "subtle"
1976
- };
1977
- return ht(e) ? { ...o, ...e } : vt(e) ? {
1978
- ...o,
1979
- children: e
1980
- } : null;
1981
- }, Mn = ({
1982
- loading: e = !1,
1983
- highlightWords: o,
1984
- size: r,
1985
- title: t,
1986
- value: n,
1987
- description: s,
1988
- children: c,
1989
- id: u,
1990
- className: d
1991
- }) => {
1992
- if (t && n) {
1993
- const i = t && Je(t), g = n && Xe(n);
1994
- return /* @__PURE__ */ a("span", { className: K(Qe.label, d), id: u, "data-size": r, children: c || /* @__PURE__ */ _(pe, { children: [
1995
- i && /* @__PURE__ */ a(oe, { ...i, loading: e, highlightWords: o }),
1996
- g && /* @__PURE__ */ a(oe, { ...g, loading: e, highlightWords: o })
1997
- ] }) });
1998
- }
1999
- const l = t && Xe(t), f = s && Je(s);
2000
- return /* @__PURE__ */ a("span", { className: K(Qe.label, d), id: u, "data-size": r, children: c || /* @__PURE__ */ _(pe, { children: [
2001
- l && /* @__PURE__ */ a(oe, { ...l, loading: e, highlightWords: o }),
2002
- f && /* @__PURE__ */ a(oe, { ...f, loading: e, highlightWords: o })
2003
- ] }) });
2004
- }, zn = "_wrapper_rcjve_1", Dn = "_icon_rcjve_11", An = "_avatar_rcjve_19", Bn = "_avatarGroup_rcjve_23", ie = {
2005
- wrapper: zn,
2006
- icon: Dn,
2007
- avatar: An,
2008
- avatarGroup: Bn
2009
- };
2010
- function Ln(e) {
2011
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null || we(e);
2012
- }
2013
- const Fn = ({ loading: e, size: o, icon: r, theme: t, badge: n }) => r ? e ? /* @__PURE__ */ a(J, { className: ie.wrapper, svgElement: _e, loading: !0 }) : /* @__PURE__ */ _("div", { className: ie.wrapper, "data-size": o, children: [
2014
- Ee(r) && /* @__PURE__ */ a(je, { ...r, className: ie.avatar }) || Ce(r) && /* @__PURE__ */ a(he, { ...r, className: ie.avatarGroup }) || Se(r) && /* @__PURE__ */ a(J, { ...r, theme: r.theme || t, className: ie.icon }) || Ln(r) && r || /* @__PURE__ */ a(J, { theme: t, svgElement: r, className: ie.icon }),
2015
- n && /* @__PURE__ */ a(ye, { ...n, className: ie.badge })
2016
- ] }) : null, Tn = "_item_1nwey_3", Gn = {
2017
- item: Tn
2018
- }, Hn = ({
2019
- className: e,
2020
- color: o,
2021
- variant: r = "default",
2022
- shadow: t = "xs",
2023
- border: n = "none",
2024
- loading: s,
2025
- disabled: c,
2026
- collapsible: u,
2027
- expanded: d,
2028
- size: l,
2029
- icon: f,
2030
- label: i,
2031
- title: g,
2032
- description: v,
2033
- badge: y,
2034
- linkIcon: w = !1,
2035
- select: I,
2036
- selected: N,
2037
- controls: $,
2038
- children: k,
2039
- interactive: m,
2040
- id: O,
2041
- containerAs: E,
2042
- ...D
2043
- }) => {
2044
- const M = typeof i == "function" ? i() : i, b = Ne();
2045
- return /* @__PURE__ */ _(
2046
- Tt,
2047
- {
2048
- className: K(Gn.item, e),
2049
- size: l,
2050
- color: o,
2051
- variant: r,
2052
- shadow: t,
2053
- border: n,
2054
- disabled: c,
2055
- selected: N,
2056
- expanded: d,
2057
- loading: s,
2058
- interactive: m,
2059
- id: O,
2060
- as: E,
2061
- children: [
2062
- /* @__PURE__ */ a(
2063
- $n,
2064
- {
2065
- color: o,
2066
- loading: s,
2067
- linkIcon: w,
2068
- disabled: c,
2069
- collapsible: u,
2070
- expanded: d,
2071
- select: I,
2072
- title: g,
2073
- size: l,
2074
- description: v,
2075
- icon: f,
2076
- badge: y,
2077
- controls: $,
2078
- interactive: m,
2079
- ariaControlsId: d ? b : void 0,
2080
- ...D,
2081
- children: M
2082
- }
2083
- ),
2084
- d ? /* @__PURE__ */ a("div", { id: b, children: k }) : null
2085
- ]
2086
- }
2087
- );
2088
- }, Kn = "_list_14rag_1", qn = {
2089
- list: Kn
2090
- }, Un = ({ children: e, className: o, spacing: r, items: t = [], ...n }) => /* @__PURE__ */ a(Ge, { direction: "col", as: "ul", spacing: r, className: K(qn.list, o), ...n, children: e || t.map((s, c) => /* @__PURE__ */ ze(Hn, { ...s, key: `item-${s.id ?? c}` })) }), Vn = "_menu_16mue_4", Wn = "_button_16mue_12", Yn = "_label_16mue_16", ge = {
2091
- menu: Vn,
2092
- button: Wn,
2093
- label: Yn
2094
- }, Fo = Ie(
2095
- ({
2096
- disabled: e,
2097
- label: o = "Label",
2098
- variant: r = "solid",
2099
- title: t = "Title",
2100
- items: n = [],
2101
- dropdownSize: s = "sm",
2102
- id: c = "toolbar-menu",
2103
- onSelectId: u,
2104
- ...d
2105
- }) => {
2106
- const l = Lt({ id: c, returnFocusOnClose: !0 }), f = d.searchable ? "combobox" : "menu", i = Ze(
2107
- (v) => {
2108
- u?.(v?.id ?? ""), v?.role !== "checkbox" && l.setOpen(!1);
2109
- },
2110
- [u, l]
2111
- ), g = ce(
2112
- () => n.map((v) => ({
2113
- ...v,
2114
- onClick: () => i(v)
2115
- })),
2116
- [n, i]
2117
- );
2118
- return e ? /* @__PURE__ */ _(de, { className: ge.button, variant: r, disabled: !0, children: [
2119
- /* @__PURE__ */ a("span", { className: ge.label, children: o }),
2120
- /* @__PURE__ */ a(Ke, { "aria-hidden": "true", focusable: "false" })
2121
- ] }) : /* @__PURE__ */ a("span", { className: ge.menu, children: /* @__PURE__ */ a(
2122
- on,
2123
- {
2124
- id: c,
2125
- variant: "drawer-dropdown",
2126
- title: t,
2127
- size: s,
2128
- trigger: /* @__PURE__ */ _(
2129
- de,
2130
- {
2131
- className: ge.button,
2132
- variant: r,
2133
- onClick: l.toggleMenu,
2134
- "aria-expanded": l.open,
2135
- "aria-haspopup": "menu",
2136
- "aria-controls": l.open ? l.menuId : void 0,
2137
- ref: l.triggerRef,
2138
- children: [
2139
- /* @__PURE__ */ a("span", { className: ge.label, children: o }),
2140
- /* @__PURE__ */ a(Ke, { "aria-hidden": "true", focusable: "false" })
2141
- ]
2142
- }
2143
- ),
2144
- open: l.open,
2145
- onClose: () => l.setOpen(!1),
2146
- ...d?.searchable ? {} : l.dropdownA11yProps,
2147
- children: /* @__PURE__ */ a(
2148
- dt,
2149
- {
2150
- ...d,
2151
- items: g,
2152
- keyboardEvents: l.open,
2153
- a11yMode: f,
2154
- open: l.open,
2155
- scrollToTopOnOpen: d.virtualized,
2156
- ...f === "combobox" ? { id: l.menuId } : l.menuA11yProps
2157
- }
2158
- )
2159
- }
2160
- ) });
2161
- }
2162
- ), To = Ie(
2163
- ({
2164
- value: e,
2165
- name: o,
2166
- placeholder: r = "Search",
2167
- loading: t,
2168
- collapsible: n,
2169
- clearButtonAltText: s = "Clear search",
2170
- onChange: c,
2171
- onClear: u,
2172
- onKeyDown: d,
2173
- menu: l,
2174
- minLength: f,
2175
- disabled: i
2176
- }) => /* @__PURE__ */ a(
2177
- Be,
2178
- {
2179
- size: "xs",
2180
- value: e,
2181
- name: o,
2182
- placeholder: r,
2183
- clearButtonAltText: s,
2184
- onChange: c,
2185
- onClear: u,
2186
- onKeyDown: d,
2187
- collapsible: n,
2188
- autoComplete: "off",
2189
- autoCapitalize: "off",
2190
- type: "search",
2191
- minLength: f,
2192
- loading: t,
2193
- menu: l,
2194
- disabled: i
2195
- }
2196
- )
2197
- ), Qn = "_section_1w6kc_1", Xn = {
2198
- section: Qn
2199
- }, bt = ({
2200
- as: e = "section",
2201
- direction: o = "col",
2202
- align: r = "initial",
2203
- variant: t,
2204
- className: n,
2205
- children: s,
2206
- ...c
2207
- }) => /* @__PURE__ */ a(
2208
- Ge,
2209
- {
2210
- as: e,
2211
- align: r,
2212
- direction: o,
2213
- theme: t,
2214
- className: K(Xn.section, n),
2215
- ...c,
2216
- children: s
2217
- }
2218
- );
2219
- export {
2220
- qe as A,
2221
- Yr as B,
2222
- at as C,
2223
- an as D,
2224
- _e as E,
2225
- Ue as F,
2226
- Ke as G,
2227
- oe as H,
2228
- J as I,
2229
- Xt as J,
2230
- Wt as K,
2231
- $n as L,
2232
- dt as M,
2233
- st as N,
2234
- _r as O,
2235
- Lo as R,
2236
- bt as S,
2237
- To as T,
2238
- hr as V,
2239
- ft as a,
2240
- pt as b,
2241
- bn as c,
2242
- gn as d,
2243
- xn as e,
2244
- On as f,
2245
- on as g,
2246
- Ve as h,
2247
- Se as i,
2248
- We as j,
2249
- Sr as k,
2250
- ht as l,
2251
- Mn as m,
2252
- Fn as n,
2253
- Hn as o,
2254
- Un as p,
2255
- ut as q,
2256
- it as r,
2257
- lt as s,
2258
- He as t,
2259
- ee as u,
2260
- Ye as v,
2261
- Oe as w,
2262
- br as x,
2263
- Fo as y,
2264
- Be as z
2265
- };