@pismo/marola 1.1.22 → 2.0.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 (173) hide show
  1. package/dist/{Button-BAljjMv3.js → Button-cCziLrIy.js} +2 -2
  2. package/dist/{ClickAwayListener-DbEYZpyh.js → ClickAwayListener-CUayzVlD.js} +3 -3
  3. package/dist/Dialog.module-BtKUNFVu.js +13 -0
  4. package/dist/{Group-BKXO7GzU.js → Group-Cyc1W1kV.js} +1 -1
  5. package/dist/{Popup-Ck3XlWMq.js → Popup-C7AXLoP0.js} +5 -7
  6. package/dist/{Portal-oY3enyAm.js → Portal-CYV5TK_i.js} +2 -2
  7. package/dist/SelectButton-k61YYjLu.js +58 -0
  8. package/dist/Tabs.module-DyJgAZt8.js +28 -0
  9. package/dist/{Toggle-Bkf8bKbA.js → Toggle-DEVeyo2f.js} +3 -3
  10. package/dist/assets/Tabs.css +1 -1
  11. package/dist/assets/Tooltip.css +1 -1
  12. package/dist/clsx-OuTLNxxd.js +16 -0
  13. package/dist/{combineHooksSlotProps-C-zYvfnF.js → combineHooksSlotProps-BCXoX9Nx.js} +20 -21
  14. package/dist/components/Adornment/Adornment.d.ts +2 -3
  15. package/dist/components/Adornment/Adornment.js +1 -1
  16. package/dist/components/Adornment/Adornment.stories.d.ts +0 -1
  17. package/dist/components/Advice/Advice.d.ts +2 -3
  18. package/dist/components/Advice/Advice.js +1 -1
  19. package/dist/components/Advice/Advice.stories.d.ts +0 -1
  20. package/dist/components/Alert/Alert.d.ts +0 -1
  21. package/dist/components/Alert/Alert.js +1 -1
  22. package/dist/components/Alert/Alert.stories.d.ts +0 -1
  23. package/dist/components/Autocomplete/Autocomplete.d.ts +1 -2
  24. package/dist/components/Autocomplete/Autocomplete.js +282 -298
  25. package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -1
  26. package/dist/components/Avatar/Avatar.d.ts +0 -1
  27. package/dist/components/Avatar/Avatar.js +1 -1
  28. package/dist/components/Avatar/Avatar.stories.d.ts +0 -1
  29. package/dist/components/Badge/Badge.d.ts +0 -1
  30. package/dist/components/Badge/Badge.js +1 -1
  31. package/dist/components/Badge/Badge.stories.d.ts +1 -2
  32. package/dist/components/BankCard/BankCard.js +1 -1
  33. package/dist/components/BankCard/BankCard.stories.d.ts +0 -1
  34. package/dist/components/Button/Button.d.ts +2 -3
  35. package/dist/components/Button/Button.js +2 -2
  36. package/dist/components/Button/Button.stories.d.ts +1 -2
  37. package/dist/components/Calendar/Calendar.js +1 -1
  38. package/dist/components/Calendar/Calendar.stories.d.ts +0 -1
  39. package/dist/components/Checkbox/Checkbox.d.ts +0 -1
  40. package/dist/components/Checkbox/Checkbox.js +1 -1
  41. package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -1
  42. package/dist/components/Chip/Chip.d.ts +1 -2
  43. package/dist/components/Chip/Chip.js +4 -4
  44. package/dist/components/Chip/Chip.stories.d.ts +0 -1
  45. package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +0 -1
  46. package/dist/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +1 -2
  47. package/dist/components/Description/Description.d.ts +0 -1
  48. package/dist/components/Description/Description.js +27 -42
  49. package/dist/components/Description/Description.stories.d.ts +0 -1
  50. package/dist/components/Dialog/Actions.d.ts +0 -1
  51. package/dist/components/Dialog/Actions.js +1 -1
  52. package/dist/components/Dialog/Backdrop.d.ts +0 -1
  53. package/dist/components/Dialog/Backdrop.js +2 -2
  54. package/dist/components/Dialog/CloseIconButton.js +2 -2
  55. package/dist/components/Dialog/Content.d.ts +0 -1
  56. package/dist/components/Dialog/Dialog.d.ts +5 -6
  57. package/dist/components/Dialog/Dialog.js +6 -6
  58. package/dist/components/Dialog/Dialog.stories.d.ts +0 -1
  59. package/dist/components/Dialog/DialogTitle.d.ts +1 -2
  60. package/dist/components/Dialog/DialogTitle.js +1 -1
  61. package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -1
  62. package/dist/components/EllipsisTooltip/EllipsisTooltip.js +1 -1
  63. package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +9 -5
  64. package/dist/components/Icon/Icon.d.ts +0 -1
  65. package/dist/components/Icon/Icon.stories.d.ts +1 -2
  66. package/dist/components/IconButton/Icon.stories.d.ts +0 -1
  67. package/dist/components/IconButton/IconButton.d.ts +1 -2
  68. package/dist/components/IconButton/IconButton.js +2 -2
  69. package/dist/components/Input/Input.d.ts +0 -1
  70. package/dist/components/Input/Input.js +259 -274
  71. package/dist/components/Input/Input.stories.d.ts +0 -1
  72. package/dist/components/InputSearch/InputSearch.d.ts +0 -1
  73. package/dist/components/InputSearch/InputSearch.js +1 -1
  74. package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -1
  75. package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
  76. package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -1
  77. package/dist/components/PageHeader/PageHeader.d.ts +1 -2
  78. package/dist/components/PageHeader/PageHeader.js +65 -80
  79. package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -1
  80. package/dist/components/Pagination/Pagination.d.ts +0 -1
  81. package/dist/components/Pagination/Pagination.js +43 -58
  82. package/dist/components/Pagination/Pagination.stories.d.ts +1 -2
  83. package/dist/components/Popover/Popover.d.ts +0 -1
  84. package/dist/components/Popover/Popover.js +3 -3
  85. package/dist/components/Popover/Popover.stories.d.ts +1 -2
  86. package/dist/components/RadioButton/RadioButton.js +1 -1
  87. package/dist/components/RadioButton/RadioButton.stories.d.ts +0 -1
  88. package/dist/components/ResultWithChips/ResultWithChips.d.ts +0 -1
  89. package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
  90. package/dist/components/RowItem/RowItem.d.ts +2 -3
  91. package/dist/components/RowItem/RowItem.js +3 -3
  92. package/dist/components/RowItem/RowItem.stories.d.ts +0 -1
  93. package/dist/components/Select/Select.d.ts +0 -1
  94. package/dist/components/Select/Select.js +21 -21
  95. package/dist/components/Select/Select.stories.d.ts +1 -2
  96. package/dist/components/Select/SelectButton.d.ts +0 -1
  97. package/dist/components/Select/SelectButton.js +2 -2
  98. package/dist/components/Skeleton/Skeleton.js +1 -1
  99. package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -1
  100. package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -1
  101. package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -1
  102. package/dist/components/Snackbar/Snackbar.d.ts +0 -1
  103. package/dist/components/Snackbar/Snackbar.js +7 -8
  104. package/dist/components/Snackbar/Snackbar.stories.d.ts +1 -2
  105. package/dist/components/SortTooltip/SortTooltip.d.ts +0 -1
  106. package/dist/components/SortTooltip/SortTooltip.js +34 -51
  107. package/dist/components/Stepper/Stepper.d.ts +0 -1
  108. package/dist/components/Stepper/Stepper.js +19 -34
  109. package/dist/components/Stepper/Stepper.stories.d.ts +1 -2
  110. package/dist/components/StepperNavigator/StepperNavigator.js +1 -1
  111. package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -1
  112. package/dist/components/Table/Table.d.ts +3 -4
  113. package/dist/components/Table/Table.js +1 -1
  114. package/dist/components/Table/Table.stories.d.ts +0 -1
  115. package/dist/components/Table/TableContext.d.ts +2 -3
  116. package/dist/components/Table/TableContext.js +4 -4
  117. package/dist/components/Table/_Table.TBody.stories.d.ts +1 -2
  118. package/dist/components/Table/_Table.THead.stories.d.ts +1 -2
  119. package/dist/components/Table/_Table.Td.stories.d.ts +1 -2
  120. package/dist/components/Table/_Table.Th.stories.d.ts +1 -2
  121. package/dist/components/Table/_Table.Tr.stories.d.ts +1 -2
  122. package/dist/components/Tabs/Tab.d.ts +4 -2
  123. package/dist/components/Tabs/Tab.js +102 -100
  124. package/dist/components/Tabs/Tab.stories.d.ts +3 -2
  125. package/dist/components/Tabs/TabPanel.d.ts +0 -1
  126. package/dist/components/Tabs/TabPanel.js +3 -3
  127. package/dist/components/Tabs/TabPanel.stories.d.ts +1 -2
  128. package/dist/components/Tabs/Tabs.d.ts +0 -1
  129. package/dist/components/Tabs/Tabs.js +5 -5
  130. package/dist/components/Tabs/Tabs.stories.d.ts +2 -2
  131. package/dist/components/Tag/Tag.d.ts +0 -1
  132. package/dist/components/Tag/Tag.js +1 -1
  133. package/dist/components/Tag/Tag.stories.d.ts +1 -2
  134. package/dist/components/TextDisplay/TextDisplay.d.ts +1 -2
  135. package/dist/components/TextDisplay/TextDisplay.js +1 -1
  136. package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -1
  137. package/dist/components/ToastCard/ToastCard.d.ts +0 -1
  138. package/dist/components/ToastCard/ToastCard.js +1 -1
  139. package/dist/components/ToastCard/ToastCard.stories.d.ts +0 -1
  140. package/dist/components/Toggle/Toggle.d.ts +0 -1
  141. package/dist/components/Toggle/Toggle.js +102 -117
  142. package/dist/components/Toggle/Toggle.stories.d.ts +0 -1
  143. package/dist/components/ToggleGroup/Group.d.ts +1 -2
  144. package/dist/components/ToggleGroup/Group.js +2 -2
  145. package/dist/components/ToggleGroup/Toggle.js +3 -3
  146. package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
  147. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +2 -3
  148. package/dist/components/Tooltip/Tooltip.d.ts +13 -9
  149. package/dist/components/Tooltip/Tooltip.js +146 -105
  150. package/dist/components/Tooltip/Tooltip.stories.d.ts +18 -10
  151. package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
  152. package/dist/components/TransactionRow/TransactionRow.d.ts +0 -1
  153. package/dist/components/TransactionRow/TransactionRow.stories.d.ts +0 -1
  154. package/dist/components/Typography/Typography.d.ts +0 -1
  155. package/dist/components/Typography/Typography.js +1 -1
  156. package/dist/components/Typography/Typography.stories.d.ts +0 -1
  157. package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -1
  158. package/dist/contexts/SnackbarProvider/SnackbarProvider.js +5 -5
  159. package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +1 -2
  160. package/dist/{index-bQFToy-I.js → index-CATDT7fJ.js} +7927 -8368
  161. package/dist/main.js +2 -2
  162. package/dist/{ownerDocument-YGhwAnr1.js → ownerDocument-CAHSRRik.js} +1 -1
  163. package/dist/{useButton-DcihopJG.js → useButton-eF8MXAli.js} +1 -1
  164. package/dist/{useList-B9C55YB7.js → useList-CPY2roI7.js} +3 -4
  165. package/dist/{useSlotProps-C_I1kEHr.js → useSlotProps-DSnfx453.js} +123 -126
  166. package/dist/utils/inputNumberAsText.d.ts +0 -1
  167. package/dist/utils/inputNumberAsText.js +2 -4
  168. package/dist/utils/styleStrings.d.ts +0 -1
  169. package/package.json +1 -1
  170. package/dist/Dialog.module-CE1Q-5tJ.js +0 -28
  171. package/dist/SelectButton-DbiTJagF.js +0 -74
  172. package/dist/Tabs.module-ia-imLti.js +0 -25
  173. package/dist/clsx-DB4S2d7J.js +0 -22
@@ -1,356 +1,356 @@
1
- import { jsx as Z, jsxs as lt } from "react/jsx-runtime";
1
+ import { jsx as Z, jsxs as it } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
- import { useId as at, useState as ut } from "react";
4
- import { c as ct } from "../../clsx-DB4S2d7J.js";
5
- import { Icon as pt } from "../Icon/Icon.js";
3
+ import { useId as lt, useState as at } from "react";
4
+ import { c as ut } from "../../clsx-OuTLNxxd.js";
5
+ import { Icon as ct } from "../Icon/Icon.js";
6
6
  import { Input as ft } from "../Input/Input.js";
7
- import { b as Ve, s as dt } from "../../useSlotProps-C_I1kEHr.js";
8
- import { u as gt } from "../../useId-BW-oWmul.js";
9
- import { u as Ie } from "../../useControlled-CCMYYdCM.js";
7
+ import { s as dt, b as Me } from "../../useSlotProps-DSnfx453.js";
8
+ import { u as pt } from "../../useId-BW-oWmul.js";
9
+ import { u as Se } from "../../useControlled-CCMYYdCM.js";
10
10
  import { u as ce } from "../../useEventCallback-BAQJJ3ye.js";
11
- import '../../assets/Autocomplete.css';const ht = (c) => {
11
+ import '../../assets/Autocomplete.css';const gt = (c) => {
12
12
  const m = h.useRef({});
13
13
  return h.useEffect(() => {
14
14
  m.current = c;
15
15
  }), m.current;
16
16
  };
17
- function Me(c) {
17
+ function Re(c) {
18
18
  return typeof c.normalize < "u" ? c.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : c;
19
19
  }
20
- function mt(c = {}) {
20
+ function ht(c = {}) {
21
21
  const {
22
22
  ignoreAccents: m = !0,
23
23
  ignoreCase: g = !0,
24
24
  limit: A,
25
25
  matchFrom: J = "any",
26
- stringify: j,
26
+ stringify: V,
27
27
  trim: D = !1
28
28
  } = c;
29
29
  return (C, {
30
- inputValue: q,
30
+ inputValue: j,
31
31
  getOptionLabel: b
32
32
  }) => {
33
- let I = D ? q.trim() : q;
34
- g && (I = I.toLowerCase()), m && (I = Me(I));
35
- const B = I ? C.filter((W) => {
36
- let S = (j || b)(W);
37
- return g && (S = S.toLowerCase()), m && (S = Me(S)), J === "start" ? S.indexOf(I) === 0 : S.indexOf(I) > -1;
33
+ let S = D ? j.trim() : j;
34
+ g && (S = S.toLowerCase()), m && (S = Re(S));
35
+ const B = S ? C.filter((W) => {
36
+ let w = (V || b)(W);
37
+ return g && (w = w.toLowerCase()), m && (w = Re(w)), J === "start" ? w.indexOf(S) === 0 : w.indexOf(S) > -1;
38
38
  }) : C;
39
39
  return typeof A == "number" ? B.slice(0, A) : B;
40
40
  };
41
41
  }
42
- function pe(c, m) {
42
+ function fe(c, m) {
43
43
  for (let g = 0; g < c.length; g += 1)
44
44
  if (m(c[g]))
45
45
  return g;
46
46
  return -1;
47
47
  }
48
- const bt = mt(), Re = 5, yt = (c) => {
48
+ const mt = ht(), bt = 5, xt = (c) => {
49
49
  var m;
50
50
  return c.current !== null && ((m = c.current.parentElement) == null ? void 0 : m.contains(document.activeElement));
51
51
  };
52
- function xt(c) {
52
+ function yt(c) {
53
53
  const {
54
54
  // eslint-disable-next-line @typescript-eslint/naming-convention
55
- unstable_isActiveElementInListbox: m = yt,
55
+ unstable_isActiveElementInListbox: m = xt,
56
56
  // eslint-disable-next-line @typescript-eslint/naming-convention
57
57
  unstable_classNamePrefix: g = "Mui",
58
58
  autoComplete: A = !1,
59
59
  autoHighlight: J = !1,
60
- autoSelect: j = !1,
60
+ autoSelect: V = !1,
61
61
  blurOnSelect: D = !1,
62
62
  clearOnBlur: C = !c.freeSolo,
63
- clearOnEscape: q = !1,
63
+ clearOnEscape: j = !1,
64
64
  componentName: b = "useAutocomplete",
65
- defaultValue: I = c.multiple ? [] : null,
65
+ defaultValue: S = c.multiple ? [] : null,
66
66
  disableClearable: B = !1,
67
67
  disableCloseOnSelect: W = !1,
68
- disabled: S,
69
- disabledItemsFocusable: fe = !1,
68
+ disabled: w,
69
+ disabledItemsFocusable: de = !1,
70
70
  disableListWrap: te = !1,
71
- filterOptions: de = bt,
71
+ filterOptions: pe = mt,
72
72
  filterSelectedOptions: Y = !1,
73
73
  freeSolo: N = !1,
74
74
  getOptionDisabled: U,
75
75
  getOptionKey: i,
76
- getOptionLabel: y = (t) => {
76
+ getOptionLabel: x = (t) => {
77
77
  var e;
78
78
  return (e = t.label) != null ? e : t;
79
79
  },
80
80
  groupBy: L,
81
- handleHomeEndKeys: V = !c.freeSolo,
81
+ handleHomeEndKeys: M = !c.freeSolo,
82
82
  id: v,
83
- includeInputInList: re = !1,
83
+ includeInputInList: ne = !1,
84
84
  inputValue: ge,
85
- isOptionEqualToValue: M = (t, e) => t === e,
85
+ isOptionEqualToValue: R = (t, e) => t === e,
86
86
  multiple: u = !1,
87
- onChange: Se,
88
- onClose: we,
89
- onHighlightChange: ke,
90
- onInputChange: R,
91
- onOpen: Ee,
87
+ onChange: we,
88
+ onClose: ke,
89
+ onHighlightChange: Ee,
90
+ onInputChange: H,
91
+ onOpen: Te,
92
92
  open: He,
93
93
  openOnFocus: Fe = !1,
94
94
  options: he,
95
95
  readOnly: X = !1,
96
96
  selectOnFocus: qe = !c.freeSolo,
97
- value: Be
98
- } = c, k = gt(v);
99
- let _ = y;
100
- _ = (t) => {
101
- const e = y(t);
97
+ value: je
98
+ } = c, E = pt(v);
99
+ let O = x;
100
+ O = (t) => {
101
+ const e = x(t);
102
102
  if (typeof e != "string") {
103
103
  if (process.env.NODE_ENV !== "production") {
104
- const r = e === void 0 ? "undefined" : `${typeof e} (${e})`;
105
- console.error(`MUI: The \`getOptionLabel\` method of ${b} returned ${r} instead of a string for ${JSON.stringify(t)}.`);
104
+ const n = e === void 0 ? "undefined" : `${typeof e} (${e})`;
105
+ console.error(`MUI: The \`getOptionLabel\` method of ${b} returned ${n} instead of a string for ${JSON.stringify(t)}.`);
106
106
  }
107
107
  return String(e);
108
108
  }
109
109
  return e;
110
110
  };
111
- const me = h.useRef(!1), be = h.useRef(!0), f = h.useRef(null), E = h.useRef(null), [oe, Ue] = h.useState(null), [T, ye] = h.useState(-1), Te = J ? 0 : -1, x = h.useRef(Te), [o, Ke] = Ie({
112
- controlled: Be,
113
- default: I,
111
+ const me = h.useRef(!1), be = h.useRef(!0), d = h.useRef(null), T = h.useRef(null), [re, Be] = h.useState(null), [_, xe] = h.useState(-1), _e = J ? 0 : -1, y = h.useRef(_e), [r, Ue] = Se({
112
+ controlled: je,
113
+ default: S,
114
114
  name: b
115
- }), [a, ne] = Ie({
115
+ }), [a, oe] = Se({
116
116
  controlled: ge,
117
117
  default: "",
118
118
  name: b,
119
119
  state: "inputValue"
120
120
  }), [se, $e] = h.useState(!1), ie = h.useCallback((t, e) => {
121
- if (!(u ? o.length < e.length : e !== null) && !C)
121
+ if (!(u ? r.length < e.length : e !== null) && !C)
122
122
  return;
123
- let n;
123
+ let o;
124
124
  if (u)
125
- n = "";
125
+ o = "";
126
126
  else if (e == null)
127
- n = "";
127
+ o = "";
128
128
  else {
129
- const s = _(e);
130
- n = typeof s == "string" ? s : "";
129
+ const s = O(e);
130
+ o = typeof s == "string" ? s : "";
131
131
  }
132
- a !== n && (ne(n), R && R(t, n, "reset"));
133
- }, [_, a, u, R, ne, C, o]), [K, Pe] = Ie({
132
+ a !== o && (oe(o), H && H(t, o, "reset"));
133
+ }, [O, a, u, H, oe, C, r]), [K, Pe] = Se({
134
134
  controlled: He,
135
135
  default: !1,
136
136
  name: b,
137
137
  state: "open"
138
- }), [ze, Ae] = h.useState(!0), De = !u && o != null && a === _(o), w = K && !X, p = w ? de(
139
- he.filter((t) => !(Y && (u ? o : [o]).some((e) => e !== null && M(t, e)))),
138
+ }), [Ke, Ae] = h.useState(!0), De = !u && r != null && a === O(r), k = K && !X, f = k ? pe(
139
+ he.filter((t) => !(Y && (u ? r : [r]).some((e) => e !== null && R(t, e)))),
140
140
  // we use the empty string to manipulate `filterOptions` to not filter any options
141
141
  // i.e. the filter predicate always returns true
142
142
  {
143
- inputValue: De && ze ? "" : a,
144
- getOptionLabel: _
143
+ inputValue: De && Ke ? "" : a,
144
+ getOptionLabel: O
145
145
  }
146
- ) : [], $ = ht({
147
- filteredOptions: p,
148
- value: o,
146
+ ) : [], $ = gt({
147
+ filteredOptions: f,
148
+ value: r,
149
149
  inputValue: a
150
150
  });
151
151
  h.useEffect(() => {
152
- const t = o !== $.value;
153
- se && !t || N && !t || ie(null, o);
154
- }, [o, ie, se, $.value, N]);
155
- const xe = K && p.length > 0 && !X;
156
- if (process.env.NODE_ENV !== "production" && o !== null && !N && he.length > 0) {
157
- const t = (u ? o : [o]).filter((e) => !he.some((r) => M(r, e)));
152
+ const t = r !== $.value;
153
+ se && !t || N && !t || ie(null, r);
154
+ }, [r, ie, se, $.value, N]);
155
+ const ye = K && f.length > 0 && !X;
156
+ if (process.env.NODE_ENV !== "production" && r !== null && !N && he.length > 0) {
157
+ const t = (u ? r : [r]).filter((e) => !he.some((n) => R(n, e)));
158
158
  t.length > 0 && console.warn([`MUI: The value provided to ${b} is invalid.`, `None of the options match with \`${t.length > 1 ? JSON.stringify(t) : JSON.stringify(t[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
159
159
  `));
160
160
  }
161
161
  const le = ce((t) => {
162
- t === -1 ? f.current.focus() : oe.querySelector(`[data-tag-index="${t}"]`).focus();
162
+ t === -1 ? d.current.focus() : re.querySelector(`[data-tag-index="${t}"]`).focus();
163
163
  });
164
164
  h.useEffect(() => {
165
- u && T > o.length - 1 && (ye(-1), le(-1));
166
- }, [o, u, T, le]);
167
- function Je(t, e) {
168
- if (!E.current || t < 0 || t >= p.length)
165
+ u && _ > r.length - 1 && (xe(-1), le(-1));
166
+ }, [r, u, _, le]);
167
+ function ze(t, e) {
168
+ if (!T.current || t < 0 || t >= f.length)
169
169
  return -1;
170
- let r = t;
170
+ let n = t;
171
171
  for (; ; ) {
172
- const n = E.current.querySelector(`[data-option-index="${r}"]`), s = fe ? !1 : !n || n.disabled || n.getAttribute("aria-disabled") === "true";
173
- if (n && n.hasAttribute("tabindex") && !s)
174
- return r;
175
- if (e === "next" ? r = (r + 1) % p.length : r = (r - 1 + p.length) % p.length, r === t)
172
+ const o = T.current.querySelector(`[data-option-index="${n}"]`), s = de ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
173
+ if (o && o.hasAttribute("tabindex") && !s)
174
+ return n;
175
+ if (e === "next" ? n = (n + 1) % f.length : n = (n - 1 + f.length) % f.length, n === t)
176
176
  return -1;
177
177
  }
178
178
  }
179
- const H = ce(({
179
+ const F = ce(({
180
180
  event: t,
181
181
  index: e,
182
- reason: r = "auto"
182
+ reason: n = "auto"
183
183
  }) => {
184
- if (x.current = e, e === -1 ? f.current.removeAttribute("aria-activedescendant") : f.current.setAttribute("aria-activedescendant", `${k}-option-${e}`), ke && ke(t, e === -1 ? null : p[e], r), !E.current)
184
+ if (y.current = e, e === -1 ? d.current.removeAttribute("aria-activedescendant") : d.current.setAttribute("aria-activedescendant", `${E}-option-${e}`), Ee && Ee(t, e === -1 ? null : f[e], n), !T.current)
185
185
  return;
186
- const n = E.current.querySelector(`[role="option"].${g}-focused`);
187
- n && (n.classList.remove(`${g}-focused`), n.classList.remove(`${g}-focusVisible`));
188
- let s = E.current;
189
- if (E.current.getAttribute("role") !== "listbox" && (s = E.current.parentElement.querySelector('[role="listbox"]')), !s)
186
+ const o = T.current.querySelector(`[role="option"].${g}-focused`);
187
+ o && (o.classList.remove(`${g}-focused`), o.classList.remove(`${g}-focusVisible`));
188
+ let s = T.current;
189
+ if (T.current.getAttribute("role") !== "listbox" && (s = T.current.parentElement.querySelector('[role="listbox"]')), !s)
190
190
  return;
191
191
  if (e === -1) {
192
192
  s.scrollTop = 0;
193
193
  return;
194
194
  }
195
- const l = E.current.querySelector(`[data-option-index="${e}"]`);
196
- if (l && (l.classList.add(`${g}-focused`), r === "keyboard" && l.classList.add(`${g}-focusVisible`), s.scrollHeight > s.clientHeight && r !== "mouse" && r !== "touch")) {
197
- const d = l, O = s.clientHeight + s.scrollTop, ue = d.offsetTop + d.offsetHeight;
198
- ue > O ? s.scrollTop = ue - s.clientHeight : d.offsetTop - d.offsetHeight * (L ? 1.3 : 0) < s.scrollTop && (s.scrollTop = d.offsetTop - d.offsetHeight * (L ? 1.3 : 0));
195
+ const l = T.current.querySelector(`[data-option-index="${e}"]`);
196
+ if (l && (l.classList.add(`${g}-focused`), n === "keyboard" && l.classList.add(`${g}-focusVisible`), s.scrollHeight > s.clientHeight && n !== "mouse" && n !== "touch")) {
197
+ const p = l, I = s.clientHeight + s.scrollTop, ue = p.offsetTop + p.offsetHeight;
198
+ ue > I ? s.scrollTop = ue - s.clientHeight : p.offsetTop - p.offsetHeight * (L ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (L ? 1.3 : 0));
199
199
  }
200
200
  }), P = ce(({
201
201
  event: t,
202
202
  diff: e,
203
- direction: r = "next",
204
- reason: n = "auto"
203
+ direction: n = "next",
204
+ reason: o = "auto"
205
205
  }) => {
206
- if (!w)
206
+ if (!k)
207
207
  return;
208
- const l = Je((() => {
209
- const d = p.length - 1;
208
+ const l = ze((() => {
209
+ const p = f.length - 1;
210
210
  if (e === "reset")
211
- return Te;
211
+ return _e;
212
212
  if (e === "start")
213
213
  return 0;
214
214
  if (e === "end")
215
- return d;
216
- const O = x.current + e;
217
- return O < 0 ? O === -1 && re ? -1 : te && x.current !== -1 || Math.abs(e) > 1 ? 0 : d : O > d ? O === d + 1 && re ? -1 : te || Math.abs(e) > 1 ? d : 0 : O;
218
- })(), r);
219
- if (H({
215
+ return p;
216
+ const I = y.current + e;
217
+ return I < 0 ? I === -1 && ne ? -1 : te && y.current !== -1 || Math.abs(e) > 1 ? 0 : p : I > p ? I === p + 1 && ne ? -1 : te || Math.abs(e) > 1 ? p : 0 : I;
218
+ })(), n);
219
+ if (F({
220
220
  index: l,
221
- reason: n,
221
+ reason: o,
222
222
  event: t
223
223
  }), A && e !== "reset")
224
224
  if (l === -1)
225
- f.current.value = a;
225
+ d.current.value = a;
226
226
  else {
227
- const d = _(p[l]);
228
- f.current.value = d, d.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && f.current.setSelectionRange(a.length, d.length);
227
+ const p = O(f[l]);
228
+ d.current.value = p, p.toLowerCase().indexOf(a.toLowerCase()) === 0 && a.length > 0 && d.current.setSelectionRange(a.length, p.length);
229
229
  }
230
- }), We = () => {
231
- const t = (e, r) => {
232
- const n = e ? _(e) : "", s = r ? _(r) : "";
233
- return n === s;
230
+ }), Je = () => {
231
+ const t = (e, n) => {
232
+ const o = e ? O(e) : "", s = n ? O(n) : "";
233
+ return o === s;
234
234
  };
235
- if (x.current !== -1 && $.filteredOptions && $.filteredOptions.length !== p.length && $.inputValue === a && (u ? o.length === $.value.length && $.value.every((e, r) => _(o[r]) === _(e)) : t($.value, o))) {
236
- const e = $.filteredOptions[x.current];
235
+ if (y.current !== -1 && $.filteredOptions && $.filteredOptions.length !== f.length && $.inputValue === a && (u ? r.length === $.value.length && $.value.every((e, n) => O(r[n]) === O(e)) : t($.value, r))) {
236
+ const e = $.filteredOptions[y.current];
237
237
  if (e)
238
- return pe(p, (r) => _(r) === _(e));
238
+ return fe(f, (n) => O(n) === O(e));
239
239
  }
240
240
  return -1;
241
- }, _e = h.useCallback(() => {
242
- if (!w)
241
+ }, Oe = h.useCallback(() => {
242
+ if (!k)
243
243
  return;
244
- const t = We();
244
+ const t = Je();
245
245
  if (t !== -1) {
246
- x.current = t;
246
+ y.current = t;
247
247
  return;
248
248
  }
249
- const e = u ? o[0] : o;
250
- if (p.length === 0 || e == null) {
249
+ const e = u ? r[0] : r;
250
+ if (f.length === 0 || e == null) {
251
251
  P({
252
252
  diff: "reset"
253
253
  });
254
254
  return;
255
255
  }
256
- if (E.current) {
256
+ if (T.current) {
257
257
  if (e != null) {
258
- const r = p[x.current];
259
- if (u && r && pe(o, (s) => M(r, s)) !== -1)
258
+ const n = f[y.current];
259
+ if (u && n && fe(r, (s) => R(n, s)) !== -1)
260
260
  return;
261
- const n = pe(p, (s) => M(s, e));
262
- n === -1 ? P({
261
+ const o = fe(f, (s) => R(s, e));
262
+ o === -1 ? P({
263
263
  diff: "reset"
264
- }) : H({
265
- index: n
264
+ }) : F({
265
+ index: o
266
266
  });
267
267
  return;
268
268
  }
269
- if (x.current >= p.length - 1) {
270
- H({
271
- index: p.length - 1
269
+ if (y.current >= f.length - 1) {
270
+ F({
271
+ index: f.length - 1
272
272
  });
273
273
  return;
274
274
  }
275
- H({
276
- index: x.current
275
+ F({
276
+ index: y.current
277
277
  });
278
278
  }
279
279
  }, [
280
280
  // Only sync the highlighted index when the option switch between empty and not
281
- p.length,
281
+ f.length,
282
282
  // Don't sync the highlighted index with the value when multiple
283
283
  // eslint-disable-next-line react-hooks/exhaustive-deps
284
- u ? !1 : o,
284
+ u ? !1 : r,
285
285
  Y,
286
286
  P,
287
- H,
288
- w,
287
+ F,
288
+ k,
289
289
  a,
290
290
  u
291
- ]), Ye = ce((t) => {
292
- dt(E, t), t && _e();
291
+ ]), We = ce((t) => {
292
+ dt(T, t), t && Oe();
293
293
  });
294
294
  process.env.NODE_ENV !== "production" && h.useEffect(() => {
295
- (!f.current || f.current.nodeName !== "INPUT") && (f.current && f.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${b} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
296
- `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${f.current} while an HTMLInputElement was expected.`, `Instead, ${b} expects an input element.`, "", b === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
295
+ (!d.current || d.current.nodeName !== "INPUT") && (d.current && d.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${b} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
296
+ `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${d.current} while an HTMLInputElement was expected.`, `Instead, ${b} expects an input element.`, "", b === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
297
297
  `)));
298
298
  }, [b]), h.useEffect(() => {
299
- _e();
300
- }, [_e]);
301
- const F = (t) => {
302
- K || (Pe(!0), Ae(!0), Ee && Ee(t));
299
+ Oe();
300
+ }, [Oe]);
301
+ const q = (t) => {
302
+ K || (Pe(!0), Ae(!0), Te && Te(t));
303
303
  }, G = (t, e) => {
304
- K && (Pe(!1), we && we(t, e));
305
- }, z = (t, e, r, n) => {
304
+ K && (Pe(!1), ke && ke(t, e));
305
+ }, z = (t, e, n, o) => {
306
306
  if (u) {
307
- if (o.length === e.length && o.every((s, l) => s === e[l]))
307
+ if (r.length === e.length && r.every((s, l) => s === e[l]))
308
308
  return;
309
- } else if (o === e)
309
+ } else if (r === e)
310
310
  return;
311
- Se && Se(t, e, r, n), Ke(e);
312
- }, ae = h.useRef(!1), Q = (t, e, r = "selectOption", n = "options") => {
313
- let s = r, l = e;
311
+ we && we(t, e, n, o), Ue(e);
312
+ }, ae = h.useRef(!1), Q = (t, e, n = "selectOption", o = "options") => {
313
+ let s = n, l = e;
314
314
  if (u) {
315
- if (l = Array.isArray(o) ? o.slice() : [], process.env.NODE_ENV !== "production") {
316
- const O = l.filter((ue) => M(e, ue));
317
- O.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${b} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${O.length} matches.`].join(`
315
+ if (l = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
316
+ const I = l.filter((ue) => R(e, ue));
317
+ I.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${b} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${I.length} matches.`].join(`
318
318
  `));
319
319
  }
320
- const d = pe(l, (O) => M(e, O));
321
- d === -1 ? l.push(e) : n !== "freeSolo" && (l.splice(d, 1), s = "removeOption");
320
+ const p = fe(l, (I) => R(e, I));
321
+ p === -1 ? l.push(e) : o !== "freeSolo" && (l.splice(p, 1), s = "removeOption");
322
322
  }
323
323
  ie(t, l), z(t, l, s, {
324
324
  option: e
325
- }), !W && (!t || !t.ctrlKey && !t.metaKey) && G(t, s), (D === !0 || D === "touch" && ae.current || D === "mouse" && !ae.current) && f.current.blur();
325
+ }), !W && (!t || !t.ctrlKey && !t.metaKey) && G(t, s), (D === !0 || D === "touch" && ae.current || D === "mouse" && !ae.current) && d.current.blur();
326
326
  };
327
- function Xe(t, e) {
327
+ function Ye(t, e) {
328
328
  if (t === -1)
329
329
  return -1;
330
- let r = t;
330
+ let n = t;
331
331
  for (; ; ) {
332
- if (e === "next" && r === o.length || e === "previous" && r === -1)
332
+ if (e === "next" && n === r.length || e === "previous" && n === -1)
333
333
  return -1;
334
- const n = oe.querySelector(`[data-tag-index="${r}"]`);
335
- if (!n || !n.hasAttribute("tabindex") || n.disabled || n.getAttribute("aria-disabled") === "true")
336
- r += e === "next" ? 1 : -1;
334
+ const o = re.querySelector(`[data-tag-index="${n}"]`);
335
+ if (!o || !o.hasAttribute("tabindex") || o.disabled || o.getAttribute("aria-disabled") === "true")
336
+ n += e === "next" ? 1 : -1;
337
337
  else
338
- return r;
338
+ return n;
339
339
  }
340
340
  }
341
341
  const Ce = (t, e) => {
342
342
  if (!u)
343
343
  return;
344
344
  a === "" && G(t, "toggleInput");
345
- let r = T;
346
- T === -1 ? a === "" && e === "previous" && (r = o.length - 1) : (r += e === "next" ? 1 : -1, r < 0 && (r = 0), r === o.length && (r = -1)), r = Xe(r, e), ye(r), le(r);
345
+ let n = _;
346
+ _ === -1 ? a === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = Ye(n, e), xe(n), le(n);
347
347
  }, Ne = (t) => {
348
- me.current = !0, ne(""), R && R(t, "", "clear"), z(t, u ? [] : null, "clear");
349
- }, Ge = (t) => (e) => {
350
- if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (T !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (ye(-1), le(-1)), e.which !== 229))
348
+ me.current = !0, oe(""), H && H(t, "", "clear"), z(t, u ? [] : null, "clear");
349
+ }, Xe = (t) => (e) => {
350
+ if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (_ !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (xe(-1), le(-1)), e.which !== 229))
351
351
  switch (e.key) {
352
352
  case "Home":
353
- w && V && (e.preventDefault(), P({
353
+ k && M && (e.preventDefault(), P({
354
354
  diff: "start",
355
355
  direction: "next",
356
356
  reason: "keyboard",
@@ -358,7 +358,7 @@ function xt(c) {
358
358
  }));
359
359
  break;
360
360
  case "End":
361
- w && V && (e.preventDefault(), P({
361
+ k && M && (e.preventDefault(), P({
362
362
  diff: "end",
363
363
  direction: "previous",
364
364
  reason: "keyboard",
@@ -367,19 +367,19 @@ function xt(c) {
367
367
  break;
368
368
  case "PageUp":
369
369
  e.preventDefault(), P({
370
- diff: -Re,
370
+ diff: -5,
371
371
  direction: "previous",
372
372
  reason: "keyboard",
373
373
  event: e
374
- }), F(e);
374
+ }), q(e);
375
375
  break;
376
376
  case "PageDown":
377
377
  e.preventDefault(), P({
378
- diff: Re,
378
+ diff: bt,
379
379
  direction: "next",
380
380
  reason: "keyboard",
381
381
  event: e
382
- }), F(e);
382
+ }), q(e);
383
383
  break;
384
384
  case "ArrowDown":
385
385
  e.preventDefault(), P({
@@ -387,7 +387,7 @@ function xt(c) {
387
387
  direction: "next",
388
388
  reason: "keyboard",
389
389
  event: e
390
- }), F(e);
390
+ }), q(e);
391
391
  break;
392
392
  case "ArrowUp":
393
393
  e.preventDefault(), P({
@@ -395,7 +395,7 @@ function xt(c) {
395
395
  direction: "previous",
396
396
  reason: "keyboard",
397
397
  event: e
398
- }), F(e);
398
+ }), q(e);
399
399
  break;
400
400
  case "ArrowLeft":
401
401
  Ce(e, "previous");
@@ -404,124 +404,123 @@ function xt(c) {
404
404
  Ce(e, "next");
405
405
  break;
406
406
  case "Enter":
407
- if (x.current !== -1 && w) {
408
- const r = p[x.current], n = U ? U(r) : !1;
409
- if (e.preventDefault(), n)
407
+ if (y.current !== -1 && k) {
408
+ const n = f[y.current], o = U ? U(n) : !1;
409
+ if (e.preventDefault(), o)
410
410
  return;
411
- Q(e, r, "selectOption"), A && f.current.setSelectionRange(f.current.value.length, f.current.value.length);
412
- } else
413
- N && a !== "" && De === !1 && (u && e.preventDefault(), Q(e, a, "createOption", "freeSolo"));
411
+ Q(e, n, "selectOption"), A && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
412
+ } else N && a !== "" && De === !1 && (u && e.preventDefault(), Q(e, a, "createOption", "freeSolo"));
414
413
  break;
415
414
  case "Escape":
416
- w ? (e.preventDefault(), e.stopPropagation(), G(e, "escape")) : q && (a !== "" || u && o.length > 0) && (e.preventDefault(), e.stopPropagation(), Ne(e));
415
+ k ? (e.preventDefault(), e.stopPropagation(), G(e, "escape")) : j && (a !== "" || u && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Ne(e));
417
416
  break;
418
417
  case "Backspace":
419
- if (u && !X && a === "" && o.length > 0) {
420
- const r = T === -1 ? o.length - 1 : T, n = o.slice();
421
- n.splice(r, 1), z(e, n, "removeOption", {
422
- option: o[r]
418
+ if (u && !X && a === "" && r.length > 0) {
419
+ const n = _ === -1 ? r.length - 1 : _, o = r.slice();
420
+ o.splice(n, 1), z(e, o, "removeOption", {
421
+ option: r[n]
423
422
  });
424
423
  }
425
424
  break;
426
425
  case "Delete":
427
- if (u && !X && a === "" && o.length > 0 && T !== -1) {
428
- const r = T, n = o.slice();
429
- n.splice(r, 1), z(e, n, "removeOption", {
430
- option: o[r]
426
+ if (u && !X && a === "" && r.length > 0 && _ !== -1) {
427
+ const n = _, o = r.slice();
428
+ o.splice(n, 1), z(e, o, "removeOption", {
429
+ option: r[n]
431
430
  });
432
431
  }
433
432
  break;
434
433
  }
435
- }, Qe = (t) => {
436
- $e(!0), Fe && !me.current && F(t);
434
+ }, Ge = (t) => {
435
+ $e(!0), Fe && !me.current && q(t);
437
436
  }, Le = (t) => {
438
- if (m(E)) {
439
- f.current.focus();
437
+ if (m(T)) {
438
+ d.current.focus();
440
439
  return;
441
440
  }
442
- $e(!1), be.current = !0, me.current = !1, j && x.current !== -1 && w ? Q(t, p[x.current], "blur") : j && N && a !== "" ? Q(t, a, "blur", "freeSolo") : C && ie(t, o), G(t, "blur");
443
- }, Ze = (t) => {
441
+ $e(!1), be.current = !0, me.current = !1, V && y.current !== -1 && k ? Q(t, f[y.current], "blur") : V && N && a !== "" ? Q(t, a, "blur", "freeSolo") : C && ie(t, r), G(t, "blur");
442
+ }, Qe = (t) => {
444
443
  const e = t.target.value;
445
- a !== e && (ne(e), Ae(!1), R && R(t, e, "input")), e === "" ? !B && !u && z(t, null, "clear") : F(t);
446
- }, et = (t) => {
444
+ a !== e && (oe(e), Ae(!1), H && H(t, e, "input")), e === "" ? !B && !u && z(t, null, "clear") : q(t);
445
+ }, Ze = (t) => {
447
446
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
448
- x.current !== e && H({
447
+ y.current !== e && F({
449
448
  event: t,
450
449
  index: e,
451
450
  reason: "mouse"
452
451
  });
453
- }, tt = (t) => {
454
- H({
452
+ }, et = (t) => {
453
+ F({
455
454
  event: t,
456
455
  index: Number(t.currentTarget.getAttribute("data-option-index")),
457
456
  reason: "touch"
458
457
  }), ae.current = !0;
459
- }, rt = (t) => {
458
+ }, tt = (t) => {
460
459
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
461
- Q(t, p[e], "selectOption"), ae.current = !1;
462
- }, ot = (t) => (e) => {
463
- const r = o.slice();
464
- r.splice(t, 1), z(e, r, "removeOption", {
465
- option: o[t]
460
+ Q(t, f[e], "selectOption"), ae.current = !1;
461
+ }, nt = (t) => (e) => {
462
+ const n = r.slice();
463
+ n.splice(t, 1), z(e, n, "removeOption", {
464
+ option: r[t]
466
465
  });
467
466
  }, ve = (t) => {
468
- K ? G(t, "toggleInput") : F(t);
469
- }, nt = (t) => {
470
- t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== k && t.preventDefault();
467
+ K ? G(t, "toggleInput") : q(t);
468
+ }, rt = (t) => {
469
+ t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== E && t.preventDefault();
470
+ }, ot = (t) => {
471
+ t.currentTarget.contains(t.target) && (d.current.focus(), qe && be.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), be.current = !1);
471
472
  }, st = (t) => {
472
- t.currentTarget.contains(t.target) && (f.current.focus(), qe && be.current && f.current.selectionEnd - f.current.selectionStart === 0 && f.current.select(), be.current = !1);
473
- }, it = (t) => {
474
- !S && (a === "" || !K) && ve(t);
473
+ !w && (a === "" || !K) && ve(t);
475
474
  };
476
- let Oe = N && a.length > 0;
477
- Oe = Oe || (u ? o.length > 0 : o !== null);
478
- let je = p;
475
+ let Ie = N && a.length > 0;
476
+ Ie = Ie || (u ? r.length > 0 : r !== null);
477
+ let Ve = f;
479
478
  if (L) {
480
479
  const t = /* @__PURE__ */ new Map();
481
480
  let e = !1;
482
- je = p.reduce((r, n, s) => {
483
- const l = L(n);
484
- return r.length > 0 && r[r.length - 1].group === l ? r[r.length - 1].options.push(n) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${b} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), r.push({
481
+ Ve = f.reduce((n, o, s) => {
482
+ const l = L(o);
483
+ return n.length > 0 && n[n.length - 1].group === l ? n[n.length - 1].options.push(o) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${b} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), n.push({
485
484
  key: s,
486
485
  index: s,
487
486
  group: l,
488
- options: [n]
489
- })), r;
487
+ options: [o]
488
+ })), n;
490
489
  }, []);
491
490
  }
492
- return S && se && Le(), {
493
- getRootProps: (t = {}) => Ve({
494
- "aria-owns": xe ? `${k}-listbox` : null
491
+ return w && se && Le(), {
492
+ getRootProps: (t = {}) => Me({
493
+ "aria-owns": ye ? `${E}-listbox` : null
495
494
  }, t, {
496
- onKeyDown: Ge(t),
497
- onMouseDown: nt,
498
- onClick: st
495
+ onKeyDown: Xe(t),
496
+ onMouseDown: rt,
497
+ onClick: ot
499
498
  }),
500
499
  getInputLabelProps: () => ({
501
- id: `${k}-label`,
502
- htmlFor: k
500
+ id: `${E}-label`,
501
+ htmlFor: E
503
502
  }),
504
503
  getInputProps: () => ({
505
- id: k,
504
+ id: E,
506
505
  value: a,
507
506
  onBlur: Le,
508
- onFocus: Qe,
509
- onChange: Ze,
510
- onMouseDown: it,
507
+ onFocus: Ge,
508
+ onChange: Qe,
509
+ onMouseDown: st,
511
510
  // if open then this is handled imperatively so don't let react override
512
511
  // only have an opinion about this when closed
513
- "aria-activedescendant": w ? "" : null,
512
+ "aria-activedescendant": k ? "" : null,
514
513
  "aria-autocomplete": A ? "both" : "list",
515
- "aria-controls": xe ? `${k}-listbox` : void 0,
516
- "aria-expanded": xe,
514
+ "aria-controls": ye ? `${E}-listbox` : void 0,
515
+ "aria-expanded": ye,
517
516
  // Disable browser's suggestion that might overlap with the popup.
518
517
  // Handle autocomplete but not autofill.
519
518
  autoComplete: "off",
520
- ref: f,
519
+ ref: d,
521
520
  autoCapitalize: "none",
522
521
  spellCheck: "false",
523
522
  role: "combobox",
524
- disabled: S
523
+ disabled: w
525
524
  }),
526
525
  getClearProps: () => ({
527
526
  tabIndex: -1,
@@ -535,18 +534,18 @@ function xt(c) {
535
534
  }),
536
535
  getTagProps: ({
537
536
  index: t
538
- }) => Ve({
537
+ }) => Me({
539
538
  key: t,
540
539
  "data-tag-index": t,
541
540
  tabIndex: -1
542
541
  }, !X && {
543
- onDelete: ot(t)
542
+ onDelete: nt(t)
544
543
  }),
545
544
  getListboxProps: () => ({
546
545
  role: "listbox",
547
- id: `${k}-listbox`,
548
- "aria-labelledby": `${k}-label`,
549
- ref: Ye,
546
+ id: `${E}-listbox`,
547
+ "aria-labelledby": `${E}-label`,
548
+ ref: We,
550
549
  onMouseDown: (t) => {
551
550
  t.preventDefault();
552
551
  }
@@ -555,52 +554,37 @@ function xt(c) {
555
554
  index: t,
556
555
  option: e
557
556
  }) => {
558
- var r;
559
- const n = (u ? o : [o]).some((l) => l != null && M(e, l)), s = U ? U(e) : !1;
557
+ var n;
558
+ const o = (u ? r : [r]).some((l) => l != null && R(e, l)), s = U ? U(e) : !1;
560
559
  return {
561
- key: (r = i == null ? void 0 : i(e)) != null ? r : _(e),
560
+ key: (n = i == null ? void 0 : i(e)) != null ? n : O(e),
562
561
  tabIndex: -1,
563
562
  role: "option",
564
- id: `${k}-option-${t}`,
565
- onMouseMove: et,
566
- onClick: rt,
567
- onTouchStart: tt,
563
+ id: `${E}-option-${t}`,
564
+ onMouseMove: Ze,
565
+ onClick: tt,
566
+ onTouchStart: et,
568
567
  "data-option-index": t,
569
568
  "aria-disabled": s,
570
- "aria-selected": n
569
+ "aria-selected": o
571
570
  };
572
571
  },
573
- id: k,
572
+ id: E,
574
573
  inputValue: a,
575
- value: o,
576
- dirty: Oe,
577
- expanded: w && oe,
578
- popupOpen: w,
579
- focused: se || T !== -1,
580
- anchorEl: oe,
581
- setAnchorEl: Ue,
582
- focusedTag: T,
583
- groupedOptions: je
574
+ value: r,
575
+ dirty: Ie,
576
+ expanded: k && re,
577
+ popupOpen: k,
578
+ focused: se || _ !== -1,
579
+ anchorEl: re,
580
+ setAnchorEl: Be,
581
+ focusedTag: _,
582
+ groupedOptions: Ve
584
583
  };
585
584
  }
586
- const _t = "_autocomplete_mj65r_65", ee = {
587
- "u-typography-h1": "_u-typography-h1_mj65r_1",
588
- "u-typography-h2": "_u-typography-h2_mj65r_8",
589
- "u-typography-h3": "_u-typography-h3_mj65r_15",
590
- "u-typography-h4": "_u-typography-h4_mj65r_22",
591
- "u-typography-h5": "_u-typography-h5_mj65r_29",
592
- "u-typography-h6": "_u-typography-h6_mj65r_36",
593
- "u-typography-base": "_u-typography-base_mj65r_43",
594
- "u-typography-base--xxl": "_u-typography-base--xxl_mj65r_49",
595
- "u-typography-base--xl": "_u-typography-base--xl_mj65r_53",
596
- "u-typography-base--lg": "_u-typography-base--lg_mj65r_57",
597
- "u-typography-base--sm": "_u-typography-base--sm_mj65r_61",
598
- "u-typography-base--bold": "_u-typography-base--bold_mj65r_65",
585
+ const Ot = "_autocomplete_mj65r_65", ee = {
599
586
  "autocomplete__dropdown-item": "_autocomplete__dropdown-item_mj65r_65",
600
- "u-typography-base--strikethrough": "_u-typography-base--strikethrough_mj65r_68",
601
- "u-typography-base--underlined": "_u-typography-base--underlined_mj65r_71",
602
- "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_mj65r_74",
603
- autocomplete: _t,
587
+ autocomplete: Ot,
604
588
  "autocomplete__dropdown-list": "_autocomplete__dropdown-list_mj65r_82",
605
589
  "option-focused": "_option-focused_mj65r_106"
606
590
  }, At = ({
@@ -609,62 +593,62 @@ const _t = "_autocomplete_mj65r_65", ee = {
609
593
  options: g,
610
594
  type: A,
611
595
  value: J,
612
- onChange: j,
596
+ onChange: V,
613
597
  onInputChange: D,
614
598
  classNameWrapper: C,
615
- "data-testid-wrapper": q,
599
+ "data-testid-wrapper": j,
616
600
  classNameInputWrapper: b,
617
- ...I
601
+ ...S
618
602
  }) => {
619
- const B = at(), [W, S] = ut("");
603
+ const B = lt(), [W, w] = at("");
620
604
  g != null && g.some((i) => typeof i != "string") && (!c || !m) && console.error(
621
605
  '[autocomplete] When options is a list of objects, you must provide the "labelKey" and "valueKey" parameters.'
622
606
  );
623
- const { getRootProps: fe, getInputProps: te, getOptionProps: de, groupedOptions: Y, getListboxProps: N } = xt({
607
+ const { getRootProps: de, getInputProps: te, getOptionProps: pe, groupedOptions: Y, getListboxProps: N } = yt({
624
608
  id: `autocomplete_${B}`,
625
609
  options: g,
626
610
  getOptionLabel: (i) => typeof i == "string" ? i : String(i[c || "label"]),
627
611
  value: J,
628
612
  inputValue: W,
629
- isOptionEqualToValue: (i, y) => typeof i == "string" ? String(i) === String(y) : String(i[m || "id"]) === String(y[m || "id"]),
613
+ isOptionEqualToValue: (i, x) => typeof i == "string" ? String(i) === String(x) : String(i[m || "id"]) === String(x[m || "id"]),
630
614
  getOptionKey(i) {
631
615
  return String(typeof i == "string" ? i : i[m || "id"]);
632
616
  },
633
- onChange: (i, y) => {
634
- j && j(i, y);
617
+ onChange: (i, x) => {
618
+ V && V(i, x);
635
619
  },
636
- onInputChange: (i, y) => {
637
- D && D(i, y), S(y);
620
+ onInputChange: (i, x) => {
621
+ D && D(i, x), w(x);
638
622
  },
639
- onHighlightChange: (i, y, L) => {
640
- var V;
623
+ onHighlightChange: (i, x, L) => {
624
+ var M;
641
625
  if (L === "keyboard") {
642
- const v = document.querySelector("#autocomplete-list"), re = (i == null ? void 0 : i.target).getAttribute("aria-activedescendant");
643
- v == null || v.querySelectorAll("li").forEach((ge) => ge.classList.remove(ee["option-focused"])), (V = v == null ? void 0 : v.querySelector(`[id="${re}"]`)) == null || V.classList.add(ee["option-focused"]);
626
+ const v = document.querySelector("#autocomplete-list"), ne = (i == null ? void 0 : i.target).getAttribute("aria-activedescendant");
627
+ v == null || v.querySelectorAll("li").forEach((ge) => ge.classList.remove(ee["option-focused"])), (M = v == null ? void 0 : v.querySelector(`[id="${ne}"]`)) == null || M.classList.add(ee["option-focused"]);
644
628
  }
645
629
  }
646
630
  }), U = {
647
631
  ...te(),
648
- ...I,
632
+ ...S,
649
633
  classNameWrapper: b
650
634
  };
651
- return /* @__PURE__ */ Z("div", { className: ct(ee.autocomplete, C), "data-testid": q, children: /* @__PURE__ */ lt("div", { ...fe(), children: [
635
+ return /* @__PURE__ */ Z("div", { className: ut(ee.autocomplete, C), "data-testid": j, children: /* @__PURE__ */ it("div", { ...de(), children: [
652
636
  /* @__PURE__ */ Z(
653
637
  ft,
654
638
  {
655
- rightIcon: A === "search" && /* @__PURE__ */ Z(pt, { color: "var(--accent)", icon: "magnifying-glass" }),
639
+ rightIcon: A === "search" && /* @__PURE__ */ Z(ct, { color: "var(--accent)", icon: "magnifying-glass" }),
656
640
  ...U
657
641
  }
658
642
  ),
659
- Y.length > 0 && !I.disabled && /* @__PURE__ */ Z(
643
+ Y.length > 0 && !S.disabled && /* @__PURE__ */ Z(
660
644
  "ul",
661
645
  {
662
646
  ...N(),
663
647
  id: "autocomplete-list",
664
648
  className: ee["autocomplete__dropdown-list"],
665
- children: Y.map((i, y) => {
666
- const L = de({ option: i, index: y }), V = typeof i == "string" ? i : String(i[c || "label"]);
667
- return /* @__PURE__ */ Z("li", { tabIndex: y, className: ee["autocomplete__dropdown-item"], ...L, children: V });
649
+ children: Y.map((i, x) => {
650
+ const L = pe({ option: i, index: x }), M = typeof i == "string" ? i : String(i[c || "label"]);
651
+ return /* @__PURE__ */ Z("li", { tabIndex: x, className: ee["autocomplete__dropdown-item"], ...L, children: M });
668
652
  })
669
653
  }
670
654
  )