mimir-ui-kit 1.9.1 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. package/README.md +62 -54
  2. package/dist/{NavigationButtons-cTsXB7GS.js → NavigationButtons-B8tMfqrg.js} +18 -18
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/Input.css +1 -1
  5. package/dist/assets/OtpInput.css +1 -1
  6. package/dist/assets/RadioGroup.css +1 -1
  7. package/dist/assets/Slider.css +1 -1
  8. package/dist/assets/index.css +1 -1
  9. package/dist/components/Button/Button.d.ts +1 -0
  10. package/dist/components/Button/Button.js +25 -25
  11. package/dist/components/Input/Input.d.ts +2 -2
  12. package/dist/components/Input/Input.js +15 -15
  13. package/dist/components/InputPassword/InputPassword.js +2 -2
  14. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
  15. package/dist/components/MergedButton/MergedButton.d.ts +1 -1
  16. package/dist/components/MergedButton/MergedButton.js +2 -2
  17. package/dist/components/OtpInput/OtpInput.js +6 -6
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -18
  19. package/dist/components/RadioGroup/RadioGroup.js +1061 -127
  20. package/dist/components/RadioGroup/index.d.ts +1 -1
  21. package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
  22. package/dist/components/Slider/NavigationButtons/index.js +1 -1
  23. package/dist/components/Slider/Slider.js +10 -10
  24. package/dist/components/Tag/Tag.d.ts +79 -0
  25. package/dist/components/Tag/Tag.js +99 -0
  26. package/dist/components/Tag/constants.d.ts +41 -0
  27. package/dist/components/Tag/constants.js +55 -0
  28. package/dist/components/Tag/index.d.ts +3 -0
  29. package/dist/components/Tag/index.js +8 -0
  30. package/dist/components/Tag/types.d.ts +6 -0
  31. package/dist/components/Tag/types.js +1 -0
  32. package/dist/components/index.d.ts +1 -10
  33. package/dist/components/index.js +0 -14
  34. package/dist/hooks/index.d.ts +0 -3
  35. package/dist/hooks/index.js +1 -7
  36. package/dist/index.d.ts +0 -1
  37. package/dist/index.js +1 -23
  38. package/package.json +128 -127
  39. package/dist/DatePickerModal-DUUCHAWF.js +0 -204
  40. package/dist/assets/DatePickerModal.css +0 -1
  41. package/dist/assets/Drawer.css +0 -1
  42. package/dist/assets/SelectSearch.css +0 -1
  43. package/dist/assets/Switch.css +0 -1
  44. package/dist/assets/Timer.css +0 -1
  45. package/dist/components/DatePicker/DatePicker.d.ts +0 -44
  46. package/dist/components/DatePicker/DatePicker.js +0 -69
  47. package/dist/components/DatePicker/DatePickerModal.d.ts +0 -8
  48. package/dist/components/DatePicker/DatePickerModal.js +0 -9
  49. package/dist/components/DatePicker/constants.d.ts +0 -6
  50. package/dist/components/DatePicker/constants.js +0 -11
  51. package/dist/components/DatePicker/index.d.ts +0 -2
  52. package/dist/components/DatePicker/index.js +0 -4
  53. package/dist/components/Drawer/Drawer.d.ts +0 -38
  54. package/dist/components/Drawer/Drawer.js +0 -144
  55. package/dist/components/Drawer/constants.d.ts +0 -5
  56. package/dist/components/Drawer/constants.js +0 -9
  57. package/dist/components/Drawer/index.d.ts +0 -2
  58. package/dist/components/Drawer/index.js +0 -6
  59. package/dist/components/Portal/Portal.d.ts +0 -7
  60. package/dist/components/Portal/Portal.js +0 -10
  61. package/dist/components/Portal/index.d.ts +0 -1
  62. package/dist/components/Portal/index.js +0 -4
  63. package/dist/components/SelectSearch/SelectSearch.d.ts +0 -15
  64. package/dist/components/SelectSearch/SelectSearch.js +0 -3961
  65. package/dist/components/SelectSearch/constants.d.ts +0 -4
  66. package/dist/components/SelectSearch/constants.js +0 -8
  67. package/dist/components/SelectSearch/index.d.ts +0 -2
  68. package/dist/components/SelectSearch/index.js +0 -6
  69. package/dist/components/Switch/Switch.d.ts +0 -294
  70. package/dist/components/Switch/Switch.js +0 -57
  71. package/dist/components/Switch/index.d.ts +0 -2
  72. package/dist/components/Switch/index.js +0 -4
  73. package/dist/components/Timer/Timer.d.ts +0 -24
  74. package/dist/components/Timer/Timer.js +0 -29
  75. package/dist/components/Timer/index.d.ts +0 -1
  76. package/dist/components/Timer/index.js +0 -4
  77. package/dist/focus-management-CFDo6ZSc.js +0 -91
  78. package/dist/hooks/useClickOutside/index.d.ts +0 -1
  79. package/dist/hooks/useClickOutside/index.js +0 -4
  80. package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -7
  81. package/dist/hooks/useClickOutside/useClickOutside.js +0 -25
  82. package/dist/hooks/useInterval/index.d.ts +0 -1
  83. package/dist/hooks/useInterval/index.js +0 -4
  84. package/dist/hooks/useInterval/useInterval.d.ts +0 -1
  85. package/dist/hooks/useInterval/useInterval.js +0 -17
  86. package/dist/hooks/useLockBodyScroll/index.d.ts +0 -1
  87. package/dist/hooks/useLockBodyScroll/index.js +0 -4
  88. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +0 -6
  89. package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +0 -20
  90. package/dist/hooks/useTimer/index.d.ts +0 -18
  91. package/dist/hooks/useTimer/index.js +0 -83
  92. package/dist/hooks/useTimer/useTimer.d.ts +0 -18
  93. package/dist/hooks/useTimer/useTimer.js +0 -87
  94. package/dist/hooks/useTimer/utils.d.ts +0 -24
  95. package/dist/hooks/useTimer/utils.js +0 -88
  96. package/dist/label-BXAcSLy0.js +0 -913
  97. package/dist/use-active-press-9MCrfRZk.js +0 -31
  98. package/dist/utils/formating/Date.d.ts +0 -1
  99. package/dist/utils/formating/Date.js +0 -26
  100. package/dist/utils/formating/Month.d.ts +0 -8
  101. package/dist/utils/formating/Month.js +0 -80
  102. package/dist/utils/formating/Numbers.d.ts +0 -6
  103. package/dist/utils/formating/Numbers.js +0 -8
  104. package/dist/utils/index.d.ts +0 -9
  105. package/dist/utils/index.js +0 -11
@@ -1,172 +1,1106 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { W, K, w, b as a, z as z$1, U, y, l, T, o, j as j$1, H, s, n, $ as $f7dceffc5ad7768b$export$4e328f61c538687f, c as $6179b936705e76d3$export$ae780daf29e6d456, D, d as u$1, I, G, a as u$2, u as u$3, e as o$1, f as p, r } from "../../label-BXAcSLy0.js";
3
- import React__default, { createContext, useId, useReducer, useRef, useMemo, useCallback, useContext, forwardRef } from "react";
4
- import { u, P, F, T as T$1, _ } from "../../focus-management-CFDo6ZSc.js";
1
+ import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
2
+ import React, { useRef, useCallback, useEffect, useState, useMemo, useLayoutEffect, createContext, useContext, forwardRef, Fragment, isValidElement, cloneElement, createElement, useId, useReducer } from "react";
3
+ import { createPortal } from "react-dom";
5
4
  import { c as classNames } from "../../index-CweZ_OcN.js";
6
- import '../../assets/RadioGroup.css';var Le = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Le || {});
7
- let ke = { [0](o2, t) {
8
- let e = [...o2.options, { id: t.id, element: t.element, propsRef: t.propsRef }];
9
- return { ...o2, options: _(e, (a2) => a2.element.current) };
10
- }, [1](o2, t) {
11
- let e = o2.options.slice(), a2 = o2.options.findIndex((O) => O.id === t.id);
12
- return a2 === -1 ? o2 : (e.splice(a2, 1), { ...o2, options: e });
5
+ import '../../assets/RadioGroup.css';const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React.useLayoutEffect : () => {
6
+ };
7
+ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
8
+ const ref = useRef(null);
9
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
10
+ ref.current = fn;
11
+ }, [
12
+ fn
13
+ ]);
14
+ return useCallback((...args) => {
15
+ const f2 = ref.current;
16
+ return f2 === null || f2 === void 0 ? void 0 : f2(...args);
17
+ }, []);
18
+ }
19
+ const $431fbd86ca7dc216$export$b204af158042fbac = (el) => {
20
+ var _el_ownerDocument;
21
+ return (_el_ownerDocument = el === null || el === void 0 ? void 0 : el.ownerDocument) !== null && _el_ownerDocument !== void 0 ? _el_ownerDocument : document;
22
+ };
23
+ const $431fbd86ca7dc216$export$f21a1ffae260145a = (el) => {
24
+ if (el && "window" in el && el.window === el) return el;
25
+ const doc = $431fbd86ca7dc216$export$b204af158042fbac(el);
26
+ return doc.defaultView || window;
27
+ };
28
+ function $c87311424ea30a05$var$testUserAgent(re) {
29
+ var _window_navigator_userAgentData;
30
+ if (typeof window === "undefined" || window.navigator == null) return false;
31
+ return ((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands.some((brand) => re.test(brand.brand))) || re.test(window.navigator.userAgent);
32
+ }
33
+ function $c87311424ea30a05$var$testPlatform(re) {
34
+ var _window_navigator_userAgentData;
35
+ return typeof window !== "undefined" && window.navigator != null ? re.test(((_window_navigator_userAgentData = window.navigator["userAgentData"]) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : false;
36
+ }
37
+ function $c87311424ea30a05$export$9ac100e40613ea10() {
38
+ return $c87311424ea30a05$var$testPlatform(/^Mac/i);
39
+ }
40
+ function $c87311424ea30a05$export$a11b0059900ceec8() {
41
+ return $c87311424ea30a05$var$testUserAgent(/Android/i);
42
+ }
43
+ function $6a7db85432448f7f$export$60278871457622de(event) {
44
+ if (event.mozInputSource === 0 && event.isTrusted) return true;
45
+ if ($c87311424ea30a05$export$a11b0059900ceec8() && event.pointerType) return event.type === "click" && event.buttons === 1;
46
+ return event.detail === 0 && !event.pointerType;
47
+ }
48
+ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
49
+ isDefaultPrevented() {
50
+ return this.nativeEvent.defaultPrevented;
51
+ }
52
+ preventDefault() {
53
+ this.defaultPrevented = true;
54
+ this.nativeEvent.preventDefault();
55
+ }
56
+ stopPropagation() {
57
+ this.nativeEvent.stopPropagation();
58
+ this.isPropagationStopped = () => true;
59
+ }
60
+ isPropagationStopped() {
61
+ return false;
62
+ }
63
+ persist() {
64
+ }
65
+ constructor(type, nativeEvent) {
66
+ this.nativeEvent = nativeEvent;
67
+ this.target = nativeEvent.target;
68
+ this.currentTarget = nativeEvent.currentTarget;
69
+ this.relatedTarget = nativeEvent.relatedTarget;
70
+ this.bubbles = nativeEvent.bubbles;
71
+ this.cancelable = nativeEvent.cancelable;
72
+ this.defaultPrevented = nativeEvent.defaultPrevented;
73
+ this.eventPhase = nativeEvent.eventPhase;
74
+ this.isTrusted = nativeEvent.isTrusted;
75
+ this.timeStamp = nativeEvent.timeStamp;
76
+ this.type = type;
77
+ }
78
+ }
79
+ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
80
+ let stateRef = useRef({
81
+ isFocused: false,
82
+ observer: null
83
+ });
84
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
85
+ const state = stateRef.current;
86
+ return () => {
87
+ if (state.observer) {
88
+ state.observer.disconnect();
89
+ state.observer = null;
90
+ }
91
+ };
92
+ }, []);
93
+ let dispatchBlur = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
94
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e2);
95
+ });
96
+ return useCallback((e2) => {
97
+ if (e2.target instanceof HTMLButtonElement || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement || e2.target instanceof HTMLSelectElement) {
98
+ stateRef.current.isFocused = true;
99
+ let target = e2.target;
100
+ let onBlurHandler = (e3) => {
101
+ stateRef.current.isFocused = false;
102
+ if (target.disabled)
103
+ dispatchBlur(new $8a9cb279dc87e130$export$905e7fc544a71f36("blur", e3));
104
+ if (stateRef.current.observer) {
105
+ stateRef.current.observer.disconnect();
106
+ stateRef.current.observer = null;
107
+ }
108
+ };
109
+ target.addEventListener("focusout", onBlurHandler, {
110
+ once: true
111
+ });
112
+ stateRef.current.observer = new MutationObserver(() => {
113
+ if (stateRef.current.isFocused && target.disabled) {
114
+ var _stateRef_current_observer;
115
+ (_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
116
+ let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
117
+ target.dispatchEvent(new FocusEvent("blur", {
118
+ relatedTarget: relatedTargetEl
119
+ }));
120
+ target.dispatchEvent(new FocusEvent("focusout", {
121
+ bubbles: true,
122
+ relatedTarget: relatedTargetEl
123
+ }));
124
+ }
125
+ });
126
+ stateRef.current.observer.observe(target, {
127
+ attributes: true,
128
+ attributeFilter: [
129
+ "disabled"
130
+ ]
131
+ });
132
+ }
133
+ }, [
134
+ dispatchBlur
135
+ ]);
136
+ }
137
+ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
138
+ let { isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange } = props;
139
+ const onBlur = useCallback((e2) => {
140
+ if (e2.target === e2.currentTarget) {
141
+ if (onBlurProp) onBlurProp(e2);
142
+ if (onFocusChange) onFocusChange(false);
143
+ return true;
144
+ }
145
+ }, [
146
+ onBlurProp,
147
+ onFocusChange
148
+ ]);
149
+ const onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
150
+ const onFocus = useCallback((e2) => {
151
+ const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(e2.target);
152
+ if (e2.target === e2.currentTarget && ownerDocument.activeElement === e2.target) {
153
+ if (onFocusProp) onFocusProp(e2);
154
+ if (onFocusChange) onFocusChange(true);
155
+ onSyntheticFocus(e2);
156
+ }
157
+ }, [
158
+ onFocusChange,
159
+ onFocusProp,
160
+ onSyntheticFocus
161
+ ]);
162
+ return {
163
+ focusProps: {
164
+ onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : void 0,
165
+ onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : void 0
166
+ }
167
+ };
168
+ }
169
+ let $507fabe10e71c6fb$var$currentModality = null;
170
+ let $507fabe10e71c6fb$var$changeHandlers = /* @__PURE__ */ new Set();
171
+ let $507fabe10e71c6fb$export$d90243b58daecda7 = /* @__PURE__ */ new Map();
172
+ let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
173
+ let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
174
+ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
175
+ Tab: true,
176
+ Escape: true
177
+ };
178
+ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e2) {
179
+ for (let handler of $507fabe10e71c6fb$var$changeHandlers) handler(modality, e2);
180
+ }
181
+ function $507fabe10e71c6fb$var$isValidKey(e2) {
182
+ return !(e2.metaKey || !$c87311424ea30a05$export$9ac100e40613ea10() && e2.altKey || e2.ctrlKey || e2.key === "Control" || e2.key === "Shift" || e2.key === "Meta");
183
+ }
184
+ function $507fabe10e71c6fb$var$handleKeyboardEvent(e2) {
185
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
186
+ if ($507fabe10e71c6fb$var$isValidKey(e2)) {
187
+ $507fabe10e71c6fb$var$currentModality = "keyboard";
188
+ $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e2);
189
+ }
190
+ }
191
+ function $507fabe10e71c6fb$var$handlePointerEvent(e2) {
192
+ $507fabe10e71c6fb$var$currentModality = "pointer";
193
+ if (e2.type === "mousedown" || e2.type === "pointerdown") {
194
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
195
+ $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e2);
196
+ }
197
+ }
198
+ function $507fabe10e71c6fb$var$handleClickEvent(e2) {
199
+ if ($6a7db85432448f7f$export$60278871457622de(e2)) {
200
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
201
+ $507fabe10e71c6fb$var$currentModality = "virtual";
202
+ }
203
+ }
204
+ function $507fabe10e71c6fb$var$handleFocusEvent(e2) {
205
+ if (e2.target === window || e2.target === document) return;
206
+ if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
207
+ $507fabe10e71c6fb$var$currentModality = "virtual";
208
+ $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e2);
209
+ }
210
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
211
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
212
+ }
213
+ function $507fabe10e71c6fb$var$handleWindowBlur() {
214
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
215
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
216
+ }
217
+ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
218
+ if (typeof window === "undefined" || $507fabe10e71c6fb$export$d90243b58daecda7.get($431fbd86ca7dc216$export$f21a1ffae260145a(element))) return;
219
+ const windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
220
+ const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
221
+ let focus = windowObject.HTMLElement.prototype.focus;
222
+ windowObject.HTMLElement.prototype.focus = function() {
223
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
224
+ focus.apply(this, arguments);
225
+ };
226
+ documentObject.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
227
+ documentObject.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
228
+ documentObject.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
229
+ windowObject.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
230
+ windowObject.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
231
+ if (typeof PointerEvent !== "undefined") {
232
+ documentObject.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
233
+ documentObject.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
234
+ documentObject.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
235
+ } else {
236
+ documentObject.addEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
237
+ documentObject.addEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
238
+ documentObject.addEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
239
+ }
240
+ windowObject.addEventListener("beforeunload", () => {
241
+ $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
242
+ }, {
243
+ once: true
244
+ });
245
+ $507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
246
+ focus
247
+ });
248
+ }
249
+ const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener) => {
250
+ const windowObject = $431fbd86ca7dc216$export$f21a1ffae260145a(element);
251
+ const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
252
+ if (loadListener) documentObject.removeEventListener("DOMContentLoaded", loadListener);
253
+ if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
254
+ windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
255
+ documentObject.removeEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
256
+ documentObject.removeEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
257
+ documentObject.removeEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
258
+ windowObject.removeEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
259
+ windowObject.removeEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
260
+ if (typeof PointerEvent !== "undefined") {
261
+ documentObject.removeEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
262
+ documentObject.removeEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
263
+ documentObject.removeEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
264
+ } else {
265
+ documentObject.removeEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
266
+ documentObject.removeEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
267
+ documentObject.removeEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
268
+ }
269
+ $507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
270
+ };
271
+ function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
272
+ const documentObject = $431fbd86ca7dc216$export$b204af158042fbac(element);
273
+ let loadListener;
274
+ if (documentObject.readyState !== "loading") $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
275
+ else {
276
+ loadListener = () => {
277
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
278
+ };
279
+ documentObject.addEventListener("DOMContentLoaded", loadListener);
280
+ }
281
+ return () => $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
282
+ }
283
+ if (typeof document !== "undefined") $507fabe10e71c6fb$export$2f1888112f558a7d();
284
+ function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
285
+ return $507fabe10e71c6fb$var$currentModality !== "pointer";
286
+ }
287
+ const $507fabe10e71c6fb$var$nonTextInputTypes = /* @__PURE__ */ new Set([
288
+ "checkbox",
289
+ "radio",
290
+ "range",
291
+ "color",
292
+ "file",
293
+ "image",
294
+ "button",
295
+ "submit",
296
+ "reset"
297
+ ]);
298
+ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e2) {
299
+ var _e_target;
300
+ const IHTMLInputElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e2 === null || e2 === void 0 ? void 0 : e2.target).HTMLInputElement : HTMLInputElement;
301
+ const IHTMLTextAreaElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e2 === null || e2 === void 0 ? void 0 : e2.target).HTMLTextAreaElement : HTMLTextAreaElement;
302
+ const IHTMLElement = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e2 === null || e2 === void 0 ? void 0 : e2.target).HTMLElement : HTMLElement;
303
+ const IKeyboardEvent = typeof window !== "undefined" ? $431fbd86ca7dc216$export$f21a1ffae260145a(e2 === null || e2 === void 0 ? void 0 : e2.target).KeyboardEvent : KeyboardEvent;
304
+ isTextInput = isTextInput || (e2 === null || e2 === void 0 ? void 0 : e2.target) instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(e2 === null || e2 === void 0 ? void 0 : (_e_target = e2.target) === null || _e_target === void 0 ? void 0 : _e_target.type) || (e2 === null || e2 === void 0 ? void 0 : e2.target) instanceof IHTMLTextAreaElement || (e2 === null || e2 === void 0 ? void 0 : e2.target) instanceof IHTMLElement && (e2 === null || e2 === void 0 ? void 0 : e2.target.isContentEditable);
305
+ return !(isTextInput && modality === "keyboard" && e2 instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e2.key]);
306
+ }
307
+ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
308
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents();
309
+ useEffect(() => {
310
+ let handler = (modality, e2) => {
311
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e2)) return;
312
+ fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
313
+ };
314
+ $507fabe10e71c6fb$var$changeHandlers.add(handler);
315
+ return () => {
316
+ $507fabe10e71c6fb$var$changeHandlers.delete(handler);
317
+ };
318
+ }, deps);
319
+ }
320
+ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
321
+ let { isDisabled, onBlurWithin, onFocusWithin, onFocusWithinChange } = props;
322
+ let state = useRef({
323
+ isFocusWithin: false
324
+ });
325
+ let onBlur = useCallback((e2) => {
326
+ if (state.current.isFocusWithin && !e2.currentTarget.contains(e2.relatedTarget)) {
327
+ state.current.isFocusWithin = false;
328
+ if (onBlurWithin) onBlurWithin(e2);
329
+ if (onFocusWithinChange) onFocusWithinChange(false);
330
+ }
331
+ }, [
332
+ onBlurWithin,
333
+ onFocusWithinChange,
334
+ state
335
+ ]);
336
+ let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
337
+ let onFocus = useCallback((e2) => {
338
+ if (!state.current.isFocusWithin && document.activeElement === e2.target) {
339
+ if (onFocusWithin) onFocusWithin(e2);
340
+ if (onFocusWithinChange) onFocusWithinChange(true);
341
+ state.current.isFocusWithin = true;
342
+ onSyntheticFocus(e2);
343
+ }
344
+ }, [
345
+ onFocusWithin,
346
+ onFocusWithinChange,
347
+ onSyntheticFocus
348
+ ]);
349
+ if (isDisabled) return {
350
+ focusWithinProps: {
351
+ // These should not have been null, that would conflict in mergeProps
352
+ onFocus: void 0,
353
+ onBlur: void 0
354
+ }
355
+ };
356
+ return {
357
+ focusWithinProps: {
358
+ onFocus,
359
+ onBlur
360
+ }
361
+ };
362
+ }
363
+ let $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
364
+ let $6179b936705e76d3$var$hoverCount = 0;
365
+ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
366
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = true;
367
+ setTimeout(() => {
368
+ $6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents = false;
369
+ }, 50);
370
+ }
371
+ function $6179b936705e76d3$var$handleGlobalPointerEvent(e2) {
372
+ if (e2.pointerType === "touch") $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
373
+ }
374
+ function $6179b936705e76d3$var$setupGlobalTouchEvents() {
375
+ if (typeof document === "undefined") return;
376
+ if (typeof PointerEvent !== "undefined") document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
377
+ else document.addEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
378
+ $6179b936705e76d3$var$hoverCount++;
379
+ return () => {
380
+ $6179b936705e76d3$var$hoverCount--;
381
+ if ($6179b936705e76d3$var$hoverCount > 0) return;
382
+ if (typeof PointerEvent !== "undefined") document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
383
+ else document.removeEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
384
+ };
385
+ }
386
+ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
387
+ let { onHoverStart, onHoverChange, onHoverEnd, isDisabled } = props;
388
+ let [isHovered, setHovered] = useState(false);
389
+ let state = useRef({
390
+ isHovered: false,
391
+ ignoreEmulatedMouseEvents: false,
392
+ pointerType: "",
393
+ target: null
394
+ }).current;
395
+ useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []);
396
+ let { hoverProps, triggerHoverEnd } = useMemo(() => {
397
+ let triggerHoverStart = (event, pointerType) => {
398
+ state.pointerType = pointerType;
399
+ if (isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target)) return;
400
+ state.isHovered = true;
401
+ let target = event.currentTarget;
402
+ state.target = target;
403
+ if (onHoverStart) onHoverStart({
404
+ type: "hoverstart",
405
+ target,
406
+ pointerType
407
+ });
408
+ if (onHoverChange) onHoverChange(true);
409
+ setHovered(true);
410
+ };
411
+ let triggerHoverEnd2 = (event, pointerType) => {
412
+ state.pointerType = "";
413
+ state.target = null;
414
+ if (pointerType === "touch" || !state.isHovered) return;
415
+ state.isHovered = false;
416
+ let target = event.currentTarget;
417
+ if (onHoverEnd) onHoverEnd({
418
+ type: "hoverend",
419
+ target,
420
+ pointerType
421
+ });
422
+ if (onHoverChange) onHoverChange(false);
423
+ setHovered(false);
424
+ };
425
+ let hoverProps2 = {};
426
+ if (typeof PointerEvent !== "undefined") {
427
+ hoverProps2.onPointerEnter = (e2) => {
428
+ if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e2.pointerType === "mouse") return;
429
+ triggerHoverStart(e2, e2.pointerType);
430
+ };
431
+ hoverProps2.onPointerLeave = (e2) => {
432
+ if (!isDisabled && e2.currentTarget.contains(e2.target)) triggerHoverEnd2(e2, e2.pointerType);
433
+ };
434
+ } else {
435
+ hoverProps2.onTouchStart = () => {
436
+ state.ignoreEmulatedMouseEvents = true;
437
+ };
438
+ hoverProps2.onMouseEnter = (e2) => {
439
+ if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e2, "mouse");
440
+ state.ignoreEmulatedMouseEvents = false;
441
+ };
442
+ hoverProps2.onMouseLeave = (e2) => {
443
+ if (!isDisabled && e2.currentTarget.contains(e2.target)) triggerHoverEnd2(e2, "mouse");
444
+ };
445
+ }
446
+ return {
447
+ hoverProps: hoverProps2,
448
+ triggerHoverEnd: triggerHoverEnd2
449
+ };
450
+ }, [
451
+ onHoverStart,
452
+ onHoverChange,
453
+ onHoverEnd,
454
+ isDisabled,
455
+ state
456
+ ]);
457
+ useEffect(() => {
458
+ if (isDisabled) triggerHoverEnd({
459
+ currentTarget: state.target
460
+ }, state.pointerType);
461
+ }, [
462
+ isDisabled
463
+ ]);
464
+ return {
465
+ hoverProps,
466
+ isHovered
467
+ };
468
+ }
469
+ function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
470
+ let { autoFocus = false, isTextInput, within } = props;
471
+ let state = useRef({
472
+ isFocused: false,
473
+ isFocusVisible: autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27()
474
+ });
475
+ let [isFocused, setFocused] = useState(false);
476
+ let [isFocusVisibleState, setFocusVisible] = useState(() => state.current.isFocused && state.current.isFocusVisible);
477
+ let updateState = useCallback(() => setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
478
+ let onFocusChange = useCallback((isFocused2) => {
479
+ state.current.isFocused = isFocused2;
480
+ setFocused(isFocused2);
481
+ updateState();
482
+ }, [
483
+ updateState
484
+ ]);
485
+ $507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible) => {
486
+ state.current.isFocusVisible = isFocusVisible;
487
+ updateState();
488
+ }, [], {
489
+ isTextInput
490
+ });
491
+ let { focusProps } = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6({
492
+ isDisabled: within,
493
+ onFocusChange
494
+ });
495
+ let { focusWithinProps } = $9ab94262bd0047c7$export$420e68273165f4ec({
496
+ isDisabled: !within,
497
+ onFocusWithinChange: onFocusChange
498
+ });
499
+ return {
500
+ isFocused,
501
+ isFocusVisible: isFocusVisibleState,
502
+ focusProps: within ? focusWithinProps : focusProps
503
+ };
504
+ }
505
+ var i$1 = Object.defineProperty;
506
+ var d = (t2, e2, n2) => e2 in t2 ? i$1(t2, e2, { enumerable: true, configurable: true, writable: true, value: n2 }) : t2[e2] = n2;
507
+ var r$1 = (t2, e2, n2) => (d(t2, typeof e2 != "symbol" ? e2 + "" : e2, n2), n2);
508
+ let o$4 = class o {
509
+ constructor() {
510
+ r$1(this, "current", this.detect());
511
+ r$1(this, "handoffState", "pending");
512
+ r$1(this, "currentId", 0);
513
+ }
514
+ set(e2) {
515
+ this.current !== e2 && (this.handoffState = "pending", this.currentId = 0, this.current = e2);
516
+ }
517
+ reset() {
518
+ this.set(this.detect());
519
+ }
520
+ nextId() {
521
+ return ++this.currentId;
522
+ }
523
+ get isServer() {
524
+ return this.current === "server";
525
+ }
526
+ get isClient() {
527
+ return this.current === "client";
528
+ }
529
+ detect() {
530
+ return typeof window == "undefined" || typeof document == "undefined" ? "server" : "client";
531
+ }
532
+ handoff() {
533
+ this.handoffState === "pending" && (this.handoffState = "complete");
534
+ }
535
+ get isHandoffComplete() {
536
+ return this.handoffState === "complete";
537
+ }
538
+ };
539
+ let s$2 = new o$4();
540
+ function u$4(r2) {
541
+ return s$2.isServer ? null : r2 instanceof Node ? r2.ownerDocument : r2 != null && r2.hasOwnProperty("current") && r2.current instanceof Node ? r2.current.ownerDocument : document;
542
+ }
543
+ function t$1(e2) {
544
+ typeof queueMicrotask == "function" ? queueMicrotask(e2) : Promise.resolve().then(e2).catch((o3) => setTimeout(() => {
545
+ throw o3;
546
+ }));
547
+ }
548
+ function o$3() {
549
+ let n2 = [], r2 = { addEventListener(e2, t2, s2, a2) {
550
+ return e2.addEventListener(t2, s2, a2), r2.add(() => e2.removeEventListener(t2, s2, a2));
551
+ }, requestAnimationFrame(...e2) {
552
+ let t2 = requestAnimationFrame(...e2);
553
+ return r2.add(() => cancelAnimationFrame(t2));
554
+ }, nextFrame(...e2) {
555
+ return r2.requestAnimationFrame(() => r2.requestAnimationFrame(...e2));
556
+ }, setTimeout(...e2) {
557
+ let t2 = setTimeout(...e2);
558
+ return r2.add(() => clearTimeout(t2));
559
+ }, microTask(...e2) {
560
+ let t2 = { current: true };
561
+ return t$1(() => {
562
+ t2.current && e2[0]();
563
+ }), r2.add(() => {
564
+ t2.current = false;
565
+ });
566
+ }, style(e2, t2, s2) {
567
+ let a2 = e2.style.getPropertyValue(t2);
568
+ return Object.assign(e2.style, { [t2]: s2 }), this.add(() => {
569
+ Object.assign(e2.style, { [t2]: a2 });
570
+ });
571
+ }, group(e2) {
572
+ let t2 = o$3();
573
+ return e2(t2), this.add(() => t2.dispose());
574
+ }, add(e2) {
575
+ return n2.includes(e2) || n2.push(e2), () => {
576
+ let t2 = n2.indexOf(e2);
577
+ if (t2 >= 0) for (let s2 of n2.splice(t2, 1)) s2();
578
+ };
579
+ }, dispose() {
580
+ for (let e2 of n2.splice(0)) e2();
581
+ } };
582
+ return r2;
583
+ }
584
+ function p$2() {
585
+ let [e2] = useState(o$3);
586
+ return useEffect(() => () => e2.dispose(), [e2]), e2;
587
+ }
588
+ let n = (e2, t2) => {
589
+ s$2.isServer ? useEffect(e2, t2) : useLayoutEffect(e2, t2);
590
+ };
591
+ function s$1(e2) {
592
+ let r2 = useRef(e2);
593
+ return n(() => {
594
+ r2.current = e2;
595
+ }, [e2]), r2;
596
+ }
597
+ let o$2 = function(t2) {
598
+ let e2 = s$1(t2);
599
+ return React.useCallback((...r2) => e2.current(...r2), [e2]);
600
+ };
601
+ let e$2 = createContext(void 0);
602
+ function a$2() {
603
+ return useContext(e$2);
604
+ }
605
+ function t(...r2) {
606
+ return Array.from(new Set(r2.flatMap((n2) => typeof n2 == "string" ? n2.split(" ") : []))).filter(Boolean).join(" ");
607
+ }
608
+ function u$3(r2, n2, ...a2) {
609
+ if (r2 in n2) {
610
+ let e2 = n2[r2];
611
+ return typeof e2 == "function" ? e2(...a2) : e2;
612
+ }
613
+ let t2 = new Error(`Tried to handle "${r2}" but there is no handler defined. Only defined handlers are: ${Object.keys(n2).map((e2) => `"${e2}"`).join(", ")}.`);
614
+ throw Error.captureStackTrace && Error.captureStackTrace(t2, u$3), t2;
615
+ }
616
+ var M = ((a2) => (a2[a2.None = 0] = "None", a2[a2.RenderStrategy = 1] = "RenderStrategy", a2[a2.Static = 2] = "Static", a2))(M || {}), O$1 = ((e2) => (e2[e2.Unmount = 0] = "Unmount", e2[e2.Hidden = 1] = "Hidden", e2))(O$1 || {});
617
+ function H$1({ ourProps: r2, theirProps: n2, slot: e2, defaultTag: a2, features: s2, visible: t2 = true, name: l2, mergeRefs: i2 }) {
618
+ i2 = i2 != null ? i2 : A;
619
+ let o3 = N$1(n2, r2);
620
+ if (t2) return b$1(o3, e2, a2, l2, i2);
621
+ let y2 = s2 != null ? s2 : 0;
622
+ if (y2 & 2) {
623
+ let { static: f2 = false, ...u2 } = o3;
624
+ if (f2) return b$1(u2, e2, a2, l2, i2);
625
+ }
626
+ if (y2 & 1) {
627
+ let { unmount: f2 = true, ...u2 } = o3;
628
+ return u$3(f2 ? 0 : 1, { [0]() {
629
+ return null;
630
+ }, [1]() {
631
+ return b$1({ ...u2, hidden: true, style: { display: "none" } }, e2, a2, l2, i2);
632
+ } });
633
+ }
634
+ return b$1(o3, e2, a2, l2, i2);
635
+ }
636
+ function b$1(r2, n2 = {}, e2, a2, s2) {
637
+ let { as: t$12 = e2, children: l2, refName: i2 = "ref", ...o3 } = h$1(r2, ["unmount", "static"]), y2 = r2.ref !== void 0 ? { [i2]: r2.ref } : {}, f2 = typeof l2 == "function" ? l2(n2) : l2;
638
+ "className" in o3 && o3.className && typeof o3.className == "function" && (o3.className = o3.className(n2)), o3["aria-labelledby"] && o3["aria-labelledby"] === o3.id && (o3["aria-labelledby"] = void 0);
639
+ let u2 = {};
640
+ if (n2) {
641
+ let d2 = false, p2 = [];
642
+ for (let [c2, T2] of Object.entries(n2)) typeof T2 == "boolean" && (d2 = true), T2 === true && p2.push(c2.replace(/([A-Z])/g, (g) => `-${g.toLowerCase()}`));
643
+ if (d2) {
644
+ u2["data-headlessui-state"] = p2.join(" ");
645
+ for (let c2 of p2) u2[`data-${c2}`] = "";
646
+ }
647
+ }
648
+ if (t$12 === Fragment && (Object.keys(m(o3)).length > 0 || Object.keys(m(u2)).length > 0)) if (!isValidElement(f2) || Array.isArray(f2) && f2.length > 1) {
649
+ if (Object.keys(m(o3)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${a2} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(m(o3)).concat(Object.keys(m(u2))).map((d2) => ` - ${d2}`).join(`
650
+ `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((d2) => ` - ${d2}`).join(`
651
+ `)].join(`
652
+ `));
653
+ } else {
654
+ let d2 = f2.props, p2 = d2 == null ? void 0 : d2.className, c2 = typeof p2 == "function" ? (...F2) => t(p2(...F2), o3.className) : t(p2, o3.className), T2 = c2 ? { className: c2 } : {}, g = N$1(f2.props, m(h$1(o3, ["ref"])));
655
+ for (let F2 in u2) F2 in g && delete u2[F2];
656
+ return cloneElement(f2, Object.assign({}, g, u2, y2, { ref: s2(f2.ref, y2.ref) }, T2));
657
+ }
658
+ return createElement(t$12, Object.assign({}, h$1(o3, ["ref"]), t$12 !== Fragment && y2, t$12 !== Fragment && u2), f2);
659
+ }
660
+ function A(...r2) {
661
+ return r2.every((n2) => n2 == null) ? void 0 : (n2) => {
662
+ for (let e2 of r2) e2 != null && (typeof e2 == "function" ? e2(n2) : e2.current = n2);
663
+ };
664
+ }
665
+ function N$1(...r2) {
666
+ if (r2.length === 0) return {};
667
+ if (r2.length === 1) return r2[0];
668
+ let n2 = {}, e2 = {};
669
+ for (let s2 of r2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (e2[t2] != null || (e2[t2] = []), e2[t2].push(s2[t2])) : n2[t2] = s2[t2];
670
+ if (n2.disabled || n2["aria-disabled"]) for (let s2 in e2) /^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(s2) && (e2[s2] = [(t2) => {
671
+ var l2;
672
+ return (l2 = t2 == null ? void 0 : t2.preventDefault) == null ? void 0 : l2.call(t2);
673
+ }]);
674
+ for (let s2 in e2) Object.assign(n2, { [s2](t2, ...l2) {
675
+ let i2 = e2[s2];
676
+ for (let o3 of i2) {
677
+ if ((t2 instanceof Event || (t2 == null ? void 0 : t2.nativeEvent) instanceof Event) && t2.defaultPrevented) return;
678
+ o3(t2, ...l2);
679
+ }
680
+ } });
681
+ return n2;
682
+ }
683
+ function D(...r2) {
684
+ if (r2.length === 0) return {};
685
+ if (r2.length === 1) return r2[0];
686
+ let n2 = {}, e2 = {};
687
+ for (let s2 of r2) for (let t2 in s2) t2.startsWith("on") && typeof s2[t2] == "function" ? (e2[t2] != null || (e2[t2] = []), e2[t2].push(s2[t2])) : n2[t2] = s2[t2];
688
+ for (let s2 in e2) Object.assign(n2, { [s2](...t2) {
689
+ let l2 = e2[s2];
690
+ for (let i2 of l2) i2 == null || i2(...t2);
691
+ } });
692
+ return n2;
693
+ }
694
+ function W(r2) {
695
+ var n2;
696
+ return Object.assign(forwardRef(r2), { displayName: (n2 = r2.displayName) != null ? n2 : r2.name });
697
+ }
698
+ function m(r2) {
699
+ let n2 = Object.assign({}, r2);
700
+ for (let e2 in n2) n2[e2] === void 0 && delete n2[e2];
701
+ return n2;
702
+ }
703
+ function h$1(r2, n2 = []) {
704
+ let e2 = Object.assign({}, r2);
705
+ for (let a2 of n2) a2 in e2 && delete e2[a2];
706
+ return e2;
707
+ }
708
+ function T$2(l2, r2, c2) {
709
+ let [i2, s2] = useState(c2), e2 = l2 !== void 0, t2 = useRef(e2), u2 = useRef(false), d2 = useRef(false);
710
+ return e2 && !t2.current && !u2.current ? (u2.current = true, t2.current = e2, console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")) : !e2 && t2.current && !d2.current && (d2.current = true, t2.current = e2, console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")), [e2 ? l2 : i2, o$2((n2) => (e2 || s2(n2), r2 == null ? void 0 : r2(n2)))];
711
+ }
712
+ function l$2(e2) {
713
+ let [t2] = useState(e2);
714
+ return t2;
715
+ }
716
+ function e$1(i2 = {}, s2 = null, t2 = []) {
717
+ for (let [r2, n2] of Object.entries(i2)) o$1(t2, f$3(s2, r2), n2);
718
+ return t2;
719
+ }
720
+ function f$3(i2, s2) {
721
+ return i2 ? i2 + "[" + s2 + "]" : s2;
722
+ }
723
+ function o$1(i2, s2, t2) {
724
+ if (Array.isArray(t2)) for (let [r2, n2] of t2.entries()) o$1(i2, f$3(s2, r2.toString()), n2);
725
+ else t2 instanceof Date ? i2.push([s2, t2.toISOString()]) : typeof t2 == "boolean" ? i2.push([s2, t2 ? "1" : "0"]) : typeof t2 == "string" ? i2.push([s2, t2]) : typeof t2 == "number" ? i2.push([s2, `${t2}`]) : t2 == null ? i2.push([s2, ""]) : e$1(t2, s2, i2);
726
+ }
727
+ function p$1(i2) {
728
+ var t2, r2;
729
+ let s2 = (t2 = i2 == null ? void 0 : i2.form) != null ? t2 : i2.closest("form");
730
+ if (s2) {
731
+ for (let n2 of s2.elements) if (n2 !== i2 && (n2.tagName === "INPUT" && n2.type === "submit" || n2.tagName === "BUTTON" && n2.type === "submit" || n2.nodeName === "INPUT" && n2.type === "image")) {
732
+ n2.click();
733
+ return;
734
+ }
735
+ (r2 = s2.requestSubmit) == null || r2.call(s2);
736
+ }
737
+ }
738
+ let a$1 = "span";
739
+ var s = ((e2) => (e2[e2.None = 1] = "None", e2[e2.Focusable = 2] = "Focusable", e2[e2.Hidden = 4] = "Hidden", e2))(s || {});
740
+ function l$1(t2, r2) {
741
+ var n2;
742
+ let { features: d2 = 1, ...e2 } = t2, o3 = { ref: r2, "aria-hidden": (d2 & 2) === 2 ? true : (n2 = e2["aria-hidden"]) != null ? n2 : void 0, hidden: (d2 & 4) === 4 ? true : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(d2 & 4) === 4 && (d2 & 2) !== 2 && { display: "none" } } };
743
+ return H$1({ ourProps: o3, theirProps: e2, slot: {}, defaultTag: a$1, name: "Hidden" });
744
+ }
745
+ let T$1 = W(l$1);
746
+ let f$2 = createContext(null);
747
+ function c$1({ children: t2 }) {
748
+ let e2 = useContext(f$2);
749
+ if (!e2) return React.createElement(React.Fragment, null, t2);
750
+ let { target: r2 } = e2;
751
+ return r2 ? createPortal(React.createElement(React.Fragment, null, t2), r2) : null;
752
+ }
753
+ function j$1({ data: t2, form: e2, disabled: r2, onReset: n2, overrides: F2 }) {
754
+ let [i2, a2] = useState(null), p2 = p$2();
755
+ return useEffect(() => {
756
+ if (n2 && i2) return p2.addEventListener(i2, "reset", n2);
757
+ }, [i2, e2, n2]), React.createElement(c$1, null, React.createElement(C$1, { setForm: a2, formId: e2 }), e$1(t2).map(([s$12, v]) => React.createElement(T$1, { features: s.Hidden, ...m({ key: s$12, as: "input", type: "hidden", hidden: true, readOnly: true, form: e2, disabled: r2, name: s$12, value: v, ...F2 }) })));
758
+ }
759
+ function C$1({ setForm: t2, formId: e2 }) {
760
+ return useEffect(() => {
761
+ if (e2) {
762
+ let r2 = document.getElementById(e2);
763
+ r2 && t2(r2);
764
+ }
765
+ }, [t2, e2]), e2 ? null : React.createElement(T$1, { features: s.Hidden, as: "input", type: "hidden", hidden: true, readOnly: true, ref: (r2) => {
766
+ if (!r2) return;
767
+ let n2 = r2.closest("form");
768
+ n2 && t2(n2);
769
+ } });
770
+ }
771
+ let e = createContext(void 0);
772
+ function u$2() {
773
+ return useContext(e);
774
+ }
775
+ function r(n2) {
776
+ let e2 = n2.parentElement, l2 = null;
777
+ for (; e2 && !(e2 instanceof HTMLFieldSetElement); ) e2 instanceof HTMLLegendElement && (l2 = e2), e2 = e2.parentElement;
778
+ let t2 = (e2 == null ? void 0 : e2.getAttribute("disabled")) === "";
779
+ return t2 && i(l2) ? false : t2;
780
+ }
781
+ function i(n2) {
782
+ if (!n2) return false;
783
+ let e2 = n2.previousElementSibling;
784
+ for (; e2 !== null; ) {
785
+ if (e2 instanceof HTMLLegendElement) return false;
786
+ e2 = e2.previousElementSibling;
787
+ }
788
+ return true;
789
+ }
790
+ let u$1 = Symbol();
791
+ function y$1(...t2) {
792
+ let n2 = useRef(t2);
793
+ useEffect(() => {
794
+ n2.current = t2;
795
+ }, [t2]);
796
+ let c2 = o$2((e2) => {
797
+ for (let o3 of n2.current) o3 != null && (typeof o3 == "function" ? o3(e2) : o3.current = e2);
798
+ });
799
+ return t2.every((e2) => e2 == null || (e2 == null ? void 0 : e2[u$1])) ? void 0 : c2;
800
+ }
801
+ let a = createContext(null);
802
+ a.displayName = "DescriptionContext";
803
+ function f$1() {
804
+ let r2 = useContext(a);
805
+ if (r2 === null) {
806
+ let e2 = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
807
+ throw Error.captureStackTrace && Error.captureStackTrace(e2, f$1), e2;
808
+ }
809
+ return r2;
810
+ }
811
+ function G$1() {
812
+ var r2, e2;
813
+ return (e2 = (r2 = useContext(a)) == null ? void 0 : r2.value) != null ? e2 : void 0;
814
+ }
815
+ function U$1() {
816
+ let [r2, e2] = useState([]);
817
+ return [r2.length > 0 ? r2.join(" ") : void 0, useMemo(() => function(t2) {
818
+ let i2 = o$2((n2) => (e2((s2) => [...s2, n2]), () => e2((s2) => {
819
+ let o3 = s2.slice(), p2 = o3.indexOf(n2);
820
+ return p2 !== -1 && o3.splice(p2, 1), o3;
821
+ }))), l2 = useMemo(() => ({ register: i2, slot: t2.slot, name: t2.name, props: t2.props, value: t2.value }), [i2, t2.slot, t2.name, t2.props, t2.value]);
822
+ return React.createElement(a.Provider, { value: l2 }, t2.children);
823
+ }, [e2])];
824
+ }
825
+ let S$1 = "p";
826
+ function C(r2, e2) {
827
+ let d2 = useId(), t2 = a$2(), { id: i2 = `headlessui-description-${d2}`, ...l2 } = r2, n$1 = f$1(), s2 = y$1(e2);
828
+ n(() => n$1.register(i2), [i2, n$1.register]);
829
+ let o3 = t2 || false, p2 = useMemo(() => ({ ...n$1.slot, disabled: o3 }), [n$1.slot, o3]), D2 = { ref: s2, ...n$1.props, id: i2 };
830
+ return H$1({ ourProps: D2, theirProps: l2, slot: p2, defaultTag: S$1, name: n$1.name || "Description" });
831
+ }
832
+ let _$1 = W(C), w$1 = Object.assign(_$1, {});
833
+ var o2 = ((r2) => (r2.Space = " ", r2.Enter = "Enter", r2.Escape = "Escape", r2.Backspace = "Backspace", r2.Delete = "Delete", r2.ArrowLeft = "ArrowLeft", r2.ArrowUp = "ArrowUp", r2.ArrowRight = "ArrowRight", r2.ArrowDown = "ArrowDown", r2.Home = "Home", r2.End = "End", r2.PageUp = "PageUp", r2.PageDown = "PageDown", r2.Tab = "Tab", r2))(o2 || {});
834
+ let c = createContext(null);
835
+ c.displayName = "LabelContext";
836
+ function P$1() {
837
+ let r2 = useContext(c);
838
+ if (r2 === null) {
839
+ let l2 = new Error("You used a <Label /> component, but it is not inside a relevant parent.");
840
+ throw Error.captureStackTrace && Error.captureStackTrace(l2, P$1), l2;
841
+ }
842
+ return r2;
843
+ }
844
+ function I(r2) {
845
+ var a2, e2, o3;
846
+ let l2 = (e2 = (a2 = useContext(c)) == null ? void 0 : a2.value) != null ? e2 : void 0;
847
+ return ((o3 = void 0) != null ? o3 : 0) > 0 ? [l2, ...r2].filter(Boolean).join(" ") : l2;
848
+ }
849
+ function z$1({ inherit: r2 = false } = {}) {
850
+ let l2 = I(), [a2, e2] = useState([]), o3 = r2 ? [l2, ...a2].filter(Boolean) : a2;
851
+ return [o3.length > 0 ? o3.join(" ") : void 0, useMemo(() => function(t2) {
852
+ let s2 = o$2((i2) => (e2((p2) => [...p2, i2]), () => e2((p2) => {
853
+ let u2 = p2.slice(), d2 = u2.indexOf(i2);
854
+ return d2 !== -1 && u2.splice(d2, 1), u2;
855
+ }))), m2 = useMemo(() => ({ register: s2, slot: t2.slot, name: t2.name, props: t2.props, value: t2.value }), [s2, t2.slot, t2.name, t2.props, t2.value]);
856
+ return React.createElement(c.Provider, { value: m2 }, t2.children);
857
+ }, [e2])];
858
+ }
859
+ let N = "label";
860
+ function G(r2, l2) {
861
+ var y2;
862
+ let a2 = useId(), e2 = P$1(), o3 = u$2(), g = a$2(), { id: t2 = `headlessui-label-${a2}`, htmlFor: s2 = o3 != null ? o3 : (y2 = e2.props) == null ? void 0 : y2.htmlFor, passive: m2 = false, ...i2 } = r2, p2 = y$1(l2);
863
+ n(() => e2.register(t2), [t2, e2.register]);
864
+ let u2 = o$2((L) => {
865
+ let b2 = L.currentTarget;
866
+ if (b2 instanceof HTMLLabelElement && L.preventDefault(), e2.props && "onClick" in e2.props && typeof e2.props.onClick == "function" && e2.props.onClick(L), b2 instanceof HTMLLabelElement) {
867
+ let n2 = document.getElementById(b2.htmlFor);
868
+ if (n2) {
869
+ let E = n2.getAttribute("disabled");
870
+ if (E === "true" || E === "") return;
871
+ let x = n2.getAttribute("aria-disabled");
872
+ if (x === "true" || x === "") return;
873
+ (n2 instanceof HTMLInputElement && (n2.type === "radio" || n2.type === "checkbox") || n2.role === "radio" || n2.role === "checkbox" || n2.role === "switch") && n2.click(), n2.focus({ preventScroll: true });
874
+ }
875
+ }
876
+ }), d2 = g || false, C2 = useMemo(() => ({ ...e2.slot, disabled: d2 }), [e2.slot, d2]), f2 = { ref: p2, ...e2.props, id: t2, htmlFor: s2, onClick: u2 };
877
+ return m2 && ("onClick" in f2 && (delete f2.htmlFor, delete f2.onClick), "onClick" in i2 && delete i2.onClick), H$1({ ourProps: f2, theirProps: i2, slot: C2, defaultTag: s2 ? N : "div", name: e2.name || "Label" });
878
+ }
879
+ let U = W(G), K = Object.assign(U, {});
880
+ function l(e2, r2) {
881
+ return e2 !== null && r2 !== null && typeof e2 == "object" && typeof r2 == "object" && "id" in e2 && "id" in r2 ? e2.id === r2.id : e2 === r2;
882
+ }
883
+ function u(e2 = l) {
884
+ return useCallback((r2, t2) => {
885
+ if (typeof e2 == "string") {
886
+ let o3 = e2;
887
+ return (r2 == null ? void 0 : r2[o3]) === (t2 == null ? void 0 : t2[o3]);
888
+ }
889
+ return e2(r2, t2);
890
+ }, [e2]);
891
+ }
892
+ let f = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e2) => `${e2}:not([tabindex='-1'])`).join(","), p = ["[data-autofocus]"].map((e2) => `${e2}:not([tabindex='-1'])`).join(",");
893
+ var F = ((n2) => (n2[n2.First = 1] = "First", n2[n2.Previous = 2] = "Previous", n2[n2.Next = 4] = "Next", n2[n2.Last = 8] = "Last", n2[n2.WrapAround = 16] = "WrapAround", n2[n2.NoScroll = 32] = "NoScroll", n2[n2.AutoFocus = 64] = "AutoFocus", n2))(F || {}), T = ((o3) => (o3[o3.Error = 0] = "Error", o3[o3.Overflow = 1] = "Overflow", o3[o3.Success = 2] = "Success", o3[o3.Underflow = 3] = "Underflow", o3))(T || {}), y = ((t2) => (t2[t2.Previous = -1] = "Previous", t2[t2.Next = 1] = "Next", t2))(y || {});
894
+ function b(e2 = document.body) {
895
+ return e2 == null ? [] : Array.from(e2.querySelectorAll(f)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
896
+ }
897
+ function S(e2 = document.body) {
898
+ return e2 == null ? [] : Array.from(e2.querySelectorAll(p)).sort((r2, t2) => Math.sign((r2.tabIndex || Number.MAX_SAFE_INTEGER) - (t2.tabIndex || Number.MAX_SAFE_INTEGER)));
899
+ }
900
+ var h = ((t2) => (t2[t2.Strict = 0] = "Strict", t2[t2.Loose = 1] = "Loose", t2))(h || {});
901
+ var H = ((t2) => (t2[t2.Keyboard = 0] = "Keyboard", t2[t2.Mouse = 1] = "Mouse", t2))(H || {});
902
+ typeof window != "undefined" && typeof document != "undefined" && (document.addEventListener("keydown", (e2) => {
903
+ e2.metaKey || e2.altKey || e2.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
904
+ }, true), document.addEventListener("click", (e2) => {
905
+ e2.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e2.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
906
+ }, true));
907
+ let w = ["textarea", "input"].join(",");
908
+ function O(e2) {
909
+ var r2, t2;
910
+ return (t2 = (r2 = e2 == null ? void 0 : e2.matches) == null ? void 0 : r2.call(e2, w)) != null ? t2 : false;
911
+ }
912
+ function _(e2, r2 = (t2) => t2) {
913
+ return e2.slice().sort((t2, u2) => {
914
+ let o3 = r2(t2), c2 = r2(u2);
915
+ if (o3 === null || c2 === null) return 0;
916
+ let l2 = o3.compareDocumentPosition(c2);
917
+ return l2 & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : l2 & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
918
+ });
919
+ }
920
+ function P(e2, r2, { sorted: t2 = true, relativeTo: u2 = null, skipElements: o3 = [] } = {}) {
921
+ let c2 = Array.isArray(e2) ? e2.length > 0 ? e2[0].ownerDocument : document : e2.ownerDocument, l2 = Array.isArray(e2) ? t2 ? _(e2) : e2 : r2 & 64 ? S(e2) : b(e2);
922
+ o3.length > 0 && l2.length > 1 && (l2 = l2.filter((s2) => !o3.some((a2) => a2 != null && "current" in a2 ? (a2 == null ? void 0 : a2.current) === s2 : a2 === s2))), u2 = u2 != null ? u2 : c2.activeElement;
923
+ let n2 = (() => {
924
+ if (r2 & 5) return 1;
925
+ if (r2 & 10) return -1;
926
+ throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
927
+ })(), x = (() => {
928
+ if (r2 & 1) return 0;
929
+ if (r2 & 2) return Math.max(0, l2.indexOf(u2)) - 1;
930
+ if (r2 & 4) return Math.max(0, l2.indexOf(u2)) + 1;
931
+ if (r2 & 8) return l2.length - 1;
932
+ throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
933
+ })(), M2 = r2 & 32 ? { preventScroll: true } : {}, m2 = 0, d2 = l2.length, i2;
934
+ do {
935
+ if (m2 >= d2 || m2 + d2 <= 0) return 0;
936
+ let s2 = x + m2;
937
+ if (r2 & 16) s2 = (s2 + d2) % d2;
938
+ else {
939
+ if (s2 < 0) return 3;
940
+ if (s2 >= d2) return 1;
941
+ }
942
+ i2 = l2[s2], i2 == null || i2.focus(M2), m2 += n2;
943
+ } while (i2 !== c2.activeElement);
944
+ return r2 & 6 && O(i2) && i2.select(), 2;
945
+ }
946
+ var Le = ((e2) => (e2[e2.RegisterOption = 0] = "RegisterOption", e2[e2.UnregisterOption = 1] = "UnregisterOption", e2))(Le || {});
947
+ let ke = { [0](o3, t2) {
948
+ let e2 = [...o3.options, { id: t2.id, element: t2.element, propsRef: t2.propsRef }];
949
+ return { ...o3, options: _(e2, (a2) => a2.element.current) };
950
+ }, [1](o3, t2) {
951
+ let e2 = o3.options.slice(), a2 = o3.options.findIndex((O2) => O2.id === t2.id);
952
+ return a2 === -1 ? o3 : (e2.splice(a2, 1), { ...o3, options: e2 });
13
953
  } }, j = createContext(null);
14
954
  j.displayName = "RadioGroupDataContext";
15
- function J(o2) {
16
- let t = useContext(j);
17
- if (t === null) {
18
- let e = new Error(`<${o2} /> is missing a parent <RadioGroup /> component.`);
19
- throw Error.captureStackTrace && Error.captureStackTrace(e, J), e;
955
+ function J(o3) {
956
+ let t2 = useContext(j);
957
+ if (t2 === null) {
958
+ let e2 = new Error(`<${o3} /> is missing a parent <RadioGroup /> component.`);
959
+ throw Error.captureStackTrace && Error.captureStackTrace(e2, J), e2;
20
960
  }
21
- return t;
961
+ return t2;
22
962
  }
23
963
  let X = createContext(null);
24
964
  X.displayName = "RadioGroupActionsContext";
25
- function z(o2) {
26
- let t = useContext(X);
27
- if (t === null) {
28
- let e = new Error(`<${o2} /> is missing a parent <RadioGroup /> component.`);
29
- throw Error.captureStackTrace && Error.captureStackTrace(e, z), e;
965
+ function z(o3) {
966
+ let t2 = useContext(X);
967
+ if (t2 === null) {
968
+ let e2 = new Error(`<${o3} /> is missing a parent <RadioGroup /> component.`);
969
+ throw Error.captureStackTrace && Error.captureStackTrace(e2, z), e2;
30
970
  }
31
- return t;
971
+ return t2;
32
972
  }
33
- function Fe(o2, t) {
34
- return u$2(t.type, ke, o2, t);
973
+ function Fe(o3, t2) {
974
+ return u$3(t2.type, ke, o3, t2);
35
975
  }
36
976
  let Ie = "div";
37
- function Ue(o$2, t) {
38
- let e = useId(), a$1 = a(), { id: O = `headlessui-radiogroup-${e}`, value: m, form: P$1, name: i, onChange: f, by: c, disabled: p$1 = a$1 || false, defaultValue: I2, ...y$1 } = o$2, T$2 = u(c), [v, C] = useReducer(Fe, { options: [] }), n2 = v.options, [U$1, h] = z$1(), [D2, L] = U(), A = useRef(null), M = y(A, t), l$1 = l(I2), [s2, _2] = T(m, f, l$1), R = useMemo(() => n2.find((r2) => !r2.propsRef.current.disabled), [n2]), b = useMemo(() => n2.some((r2) => T$2(r2.propsRef.current.value, s2)), [n2, s2]), d = o((r2) => {
977
+ function Ue(o$12, t2) {
978
+ let e2 = useId(), a2 = a$2(), { id: O2 = `headlessui-radiogroup-${e2}`, value: m2, form: P$12, name: i2, onChange: f2, by: c2, disabled: p2 = a2 || false, defaultValue: I2, ...y2 } = o$12, T$12 = u(c2), [v, C2] = useReducer(Fe, { options: [] }), n2 = v.options, [U2, h2] = z$1(), [D2, L] = U$1(), A2 = useRef(null), M2 = y$1(A2, t2), l2 = l$2(I2), [s2, _2] = T$2(m2, f2, l2), R = useMemo(() => n2.find((r2) => !r2.propsRef.current.disabled), [n2]), b2 = useMemo(() => n2.some((r2) => T$12(r2.propsRef.current.value, s2)), [n2, s2]), d2 = o$2((r2) => {
39
979
  var u2;
40
- if (p$1 || T$2(r2, s2)) return false;
41
- let k = (u2 = n2.find((H2) => T$2(H2.propsRef.current.value, r2))) == null ? void 0 : u2.propsRef.current;
980
+ if (p2 || T$12(r2, s2)) return false;
981
+ let k = (u2 = n2.find((H2) => T$12(H2.propsRef.current.value, r2))) == null ? void 0 : u2.propsRef.current;
42
982
  return k != null && k.disabled ? false : (_2 == null || _2(r2), true);
43
- }), de = o((r2) => {
44
- let k = A.current;
983
+ }), de = o$2((r2) => {
984
+ let k = A2.current;
45
985
  if (!k) return;
46
- let u2 = u$3(k), H2 = n2.filter((g) => g.propsRef.current.disabled === false).map((g) => g.element.current);
986
+ let u2 = u$4(k), H2 = n2.filter((g) => g.propsRef.current.disabled === false).map((g) => g.element.current);
47
987
  switch (r2.key) {
48
- case o$1.Enter:
49
- p(r2.currentTarget);
988
+ case o2.Enter:
989
+ p$1(r2.currentTarget);
50
990
  break;
51
- case o$1.ArrowLeft:
52
- case o$1.ArrowUp:
53
- if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Previous | F.WrapAround) === T$1.Success) {
54
- let E = n2.find((N) => N.element.current === (u2 == null ? void 0 : u2.activeElement));
55
- E && d(E.propsRef.current.value);
991
+ case o2.ArrowLeft:
992
+ case o2.ArrowUp:
993
+ if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Previous | F.WrapAround) === T.Success) {
994
+ let E = n2.find((N2) => N2.element.current === (u2 == null ? void 0 : u2.activeElement));
995
+ E && d2(E.propsRef.current.value);
56
996
  }
57
997
  break;
58
- case o$1.ArrowRight:
59
- case o$1.ArrowDown:
60
- if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Next | F.WrapAround) === T$1.Success) {
61
- let E = n2.find((N) => N.element.current === (u2 == null ? void 0 : u2.activeElement));
62
- E && d(E.propsRef.current.value);
998
+ case o2.ArrowRight:
999
+ case o2.ArrowDown:
1000
+ if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Next | F.WrapAround) === T.Success) {
1001
+ let E = n2.find((N2) => N2.element.current === (u2 == null ? void 0 : u2.activeElement));
1002
+ E && d2(E.propsRef.current.value);
63
1003
  }
64
1004
  break;
65
- case o$1.Space:
1005
+ case o2.Space:
66
1006
  {
67
1007
  r2.preventDefault(), r2.stopPropagation();
68
1008
  let g = n2.find((E) => E.element.current === (u2 == null ? void 0 : u2.activeElement));
69
- g && d(g.propsRef.current.value);
1009
+ g && d2(g.propsRef.current.value);
70
1010
  }
71
1011
  break;
72
1012
  }
73
- }), q = o((r2) => (C({ type: 0, ...r2 }), () => C({ type: 1, id: r2.id }))), ue = useMemo(() => ({ value: s2, firstOption: R, containsCheckedOption: b, disabled: p$1, compare: T$2, ...v }), [s2, R, b, p$1, T$2, v]), ce = useMemo(() => ({ registerOption: q, change: d }), [q, d]), fe = { ref: M, id: O, role: "radiogroup", "aria-labelledby": U$1, "aria-describedby": D2, onKeyDown: de }, Te = useMemo(() => ({ value: s2 }), [s2]), me = useCallback(() => {
74
- if (l$1 !== void 0) return d(l$1);
75
- }, [d, l$1]);
76
- return React__default.createElement(L, { name: "RadioGroup.Description" }, React__default.createElement(h, { name: "RadioGroup.Label" }, React__default.createElement(X.Provider, { value: ce }, React__default.createElement(j.Provider, { value: ue }, i != null && React__default.createElement(j$1, { disabled: p$1, data: { [i]: s2 || "on" }, overrides: { type: "radio", checked: s2 != null }, form: P$1, onReset: me }), H({ ourProps: fe, theirProps: y$1, slot: Te, defaultTag: Ie, name: "RadioGroup" })))));
1013
+ }), q = o$2((r2) => (C2({ type: 0, ...r2 }), () => C2({ type: 1, id: r2.id }))), ue = useMemo(() => ({ value: s2, firstOption: R, containsCheckedOption: b2, disabled: p2, compare: T$12, ...v }), [s2, R, b2, p2, T$12, v]), ce = useMemo(() => ({ registerOption: q, change: d2 }), [q, d2]), fe = { ref: M2, id: O2, role: "radiogroup", "aria-labelledby": U2, "aria-describedby": D2, onKeyDown: de }, Te = useMemo(() => ({ value: s2 }), [s2]), me = useCallback(() => {
1014
+ if (l2 !== void 0) return d2(l2);
1015
+ }, [d2, l2]);
1016
+ return React.createElement(L, { name: "RadioGroup.Description" }, React.createElement(h2, { name: "RadioGroup.Label" }, React.createElement(X.Provider, { value: ce }, React.createElement(j.Provider, { value: ue }, i2 != null && React.createElement(j$1, { disabled: p2, data: { [i2]: s2 || "on" }, overrides: { type: "radio", checked: s2 != null }, form: P$12, onReset: me }), H$1({ ourProps: fe, theirProps: y2, slot: Te, defaultTag: Ie, name: "RadioGroup" })))));
77
1017
  }
78
1018
  let Me = "div";
79
- function Se(o$12, t) {
1019
+ function Se(o3, t2) {
80
1020
  var R;
81
- let e = J("RadioGroup.Option"), a2 = z("RadioGroup.Option"), O = useId(), { id: m = `headlessui-radiogroup-option-${O}`, value: P2, disabled: i = e.disabled || false, autoFocus: f = false, ...c } = o$12, p2 = useRef(null), I2 = y(p2, t), [y$1, T2] = z$1(), [v, C] = U(), n$1 = s({ value: P2, disabled: i });
82
- n(() => a2.registerOption({ id: m, element: p2, propsRef: n$1 }), [m, a2, p2, n$1]);
83
- let U$1 = o((b) => {
84
- var d;
85
- if (r(b.currentTarget)) return b.preventDefault();
86
- a2.change(P2) && ((d = p2.current) == null || d.focus());
87
- }), h = ((R = e.firstOption) == null ? void 0 : R.id) === m, { isFocusVisible: D$1, focusProps: L } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: f }), { isHovered: A, hoverProps: M } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: i }), l2 = e.compare(e.value, P2), s$1 = D({ ref: I2, id: m, role: "radio", "aria-checked": l2 ? "true" : "false", "aria-labelledby": y$1, "aria-describedby": v, "aria-disabled": i ? true : void 0, tabIndex: (() => i ? -1 : l2 || !e.containsCheckedOption && h ? 0 : -1)(), onClick: i ? void 0 : U$1, autoFocus: f }, L, M), _2 = useMemo(() => ({ checked: l2, disabled: i, active: D$1, hover: A, focus: D$1, autofocus: f }), [l2, i, A, D$1, f]);
88
- return React__default.createElement(C, { name: "RadioGroup.Description" }, React__default.createElement(T2, { name: "RadioGroup.Label" }, H({ ourProps: s$1, theirProps: c, slot: _2, defaultTag: Me, name: "RadioGroup.Option" })));
1021
+ let e2 = J("RadioGroup.Option"), a2 = z("RadioGroup.Option"), O2 = useId(), { id: m2 = `headlessui-radiogroup-option-${O2}`, value: P2, disabled: i2 = e2.disabled || false, autoFocus: f2 = false, ...c2 } = o3, p2 = useRef(null), I2 = y$1(p2, t2), [y2, T2] = z$1(), [v, C2] = U$1(), n$1 = s$1({ value: P2, disabled: i2 });
1022
+ n(() => a2.registerOption({ id: m2, element: p2, propsRef: n$1 }), [m2, a2, p2, n$1]);
1023
+ let U2 = o$2((b2) => {
1024
+ var d2;
1025
+ if (r(b2.currentTarget)) return b2.preventDefault();
1026
+ a2.change(P2) && ((d2 = p2.current) == null || d2.focus());
1027
+ }), h2 = ((R = e2.firstOption) == null ? void 0 : R.id) === m2, { isFocusVisible: D$1, focusProps: L } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: f2 }), { isHovered: A2, hoverProps: M2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: i2 }), l2 = e2.compare(e2.value, P2), s2 = D({ ref: I2, id: m2, role: "radio", "aria-checked": l2 ? "true" : "false", "aria-labelledby": y2, "aria-describedby": v, "aria-disabled": i2 ? true : void 0, tabIndex: (() => i2 ? -1 : l2 || !e2.containsCheckedOption && h2 ? 0 : -1)(), onClick: i2 ? void 0 : U2, autoFocus: f2 }, L, M2), _2 = useMemo(() => ({ checked: l2, disabled: i2, active: D$1, hover: A2, focus: D$1, autofocus: f2 }), [l2, i2, A2, D$1, f2]);
1028
+ return React.createElement(C2, { name: "RadioGroup.Description" }, React.createElement(T2, { name: "RadioGroup.Label" }, H$1({ ourProps: s2, theirProps: c2, slot: _2, defaultTag: Me, name: "RadioGroup.Option" })));
89
1029
  }
90
1030
  let He = "span";
91
- function we(o$12, t) {
1031
+ function we(o3, t2) {
92
1032
  var R;
93
- let e = J("Radio"), a$1 = z("Radio"), O = useId(), m = u$1(), P2 = a(), { id: i = m || `headlessui-radio-${O}`, value: f, disabled: c = e.disabled || P2 || false, autoFocus: p2 = false, ...I$1 } = o$12, y$1 = useRef(null), T2 = y(y$1, t), v = I(), C = G(), n$1 = s({ value: f, disabled: c });
94
- n(() => a$1.registerOption({ id: i, element: y$1, propsRef: n$1 }), [i, a$1, y$1, n$1]);
95
- let U2 = o((b) => {
96
- var d;
97
- if (r(b.currentTarget)) return b.preventDefault();
98
- a$1.change(f) && ((d = y$1.current) == null || d.focus());
99
- }), { isFocusVisible: h, focusProps: D$1 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: p2 }), { isHovered: L, hoverProps: A } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: c }), M = ((R = e.firstOption) == null ? void 0 : R.id) === i, l2 = e.compare(e.value, f), s$1 = D({ ref: T2, id: i, role: "radio", "aria-checked": l2 ? "true" : "false", "aria-labelledby": v, "aria-describedby": C, "aria-disabled": c ? true : void 0, tabIndex: (() => c ? -1 : l2 || !e.containsCheckedOption && M ? 0 : -1)(), autoFocus: p2, onClick: c ? void 0 : U2 }, D$1, A), _2 = useMemo(() => ({ checked: l2, disabled: c, hover: L, focus: h, autofocus: p2 }), [l2, c, L, h, p2]);
100
- return H({ ourProps: s$1, theirProps: I$1, slot: _2, defaultTag: He, name: "Radio" });
101
- }
102
- let Ne = W(Ue), We = W(Se), Be = W(we), Ve = K, Ke = w, Tt = Object.assign(Ne, { Option: We, Radio: Be, Label: Ve, Description: Ke });
103
- const group = "_group_1944i_3";
104
- const radio = "_radio_1944i_18";
105
- const disabled = "_disabled_1944i_40";
106
- const label = "_label_1944i_51";
107
- const frame = "_frame_1944i_64";
108
- const checked = "_checked_1944i_73";
1033
+ let e2 = J("Radio"), a2 = z("Radio"), O2 = useId(), m2 = u$2(), P2 = a$2(), { id: i2 = m2 || `headlessui-radio-${O2}`, value: f2, disabled: c2 = e2.disabled || P2 || false, autoFocus: p2 = false, ...I$1 } = o3, y2 = useRef(null), T2 = y$1(y2, t2), v = I(), C2 = G$1(), n$1 = s$1({ value: f2, disabled: c2 });
1034
+ n(() => a2.registerOption({ id: i2, element: y2, propsRef: n$1 }), [i2, a2, y2, n$1]);
1035
+ let U2 = o$2((b2) => {
1036
+ var d2;
1037
+ if (r(b2.currentTarget)) return b2.preventDefault();
1038
+ a2.change(f2) && ((d2 = y2.current) == null || d2.focus());
1039
+ }), { isFocusVisible: h2, focusProps: D$1 } = $f7dceffc5ad7768b$export$4e328f61c538687f({ autoFocus: p2 }), { isHovered: L, hoverProps: A2 } = $6179b936705e76d3$export$ae780daf29e6d456({ isDisabled: c2 }), M2 = ((R = e2.firstOption) == null ? void 0 : R.id) === i2, l2 = e2.compare(e2.value, f2), s2 = D({ ref: T2, id: i2, role: "radio", "aria-checked": l2 ? "true" : "false", "aria-labelledby": v, "aria-describedby": C2, "aria-disabled": c2 ? true : void 0, tabIndex: (() => c2 ? -1 : l2 || !e2.containsCheckedOption && M2 ? 0 : -1)(), autoFocus: p2, onClick: c2 ? void 0 : U2 }, D$1, A2), _2 = useMemo(() => ({ checked: l2, disabled: c2, hover: L, focus: h2, autofocus: p2 }), [l2, c2, L, h2, p2]);
1040
+ return H$1({ ourProps: s2, theirProps: I$1, slot: _2, defaultTag: He, name: "Radio" });
1041
+ }
1042
+ let Ne = W(Ue), We = W(Se), Be = W(we), Ve = K, Ke = w$1, Tt = Object.assign(Ne, { Option: We, Radio: Be, Label: Ve, Description: Ke });
1043
+ const group = "_group_63bak_3";
1044
+ const radio = "_radio_63bak_18";
1045
+ const disabled = "_disabled_63bak_40";
1046
+ const label = "_label_63bak_51";
1047
+ const frame = "_frame_63bak_64";
1048
+ const checked = "_checked_63bak_73";
109
1049
  const cls = {
110
1050
  group,
111
- "content-wrapper": "_content-wrapper_1944i_11",
112
- "radio-wrapper": "_radio-wrapper_1944i_18",
1051
+ "content-wrapper": "_content-wrapper_63bak_11",
1052
+ "radio-wrapper": "_radio-wrapper_63bak_18",
113
1053
  radio,
114
1054
  disabled,
115
1055
  label,
116
1056
  frame,
117
1057
  checked
118
1058
  };
119
- const RadioGroup = forwardRef(
120
- ({ options, value, onChange, label: label2, ...props }, ref) => {
121
- const radioClasses = classNames(cls["radio-wrapper"], {
122
- [cls.disabled]: props.disabled
123
- });
124
- return /* @__PURE__ */ jsxs(
125
- Tt,
1059
+ function RadioGroup({
1060
+ options,
1061
+ value,
1062
+ onChange,
1063
+ label: label2,
1064
+ ...props
1065
+ }) {
1066
+ const radioClasses = classNames(cls["radio-wrapper"], {
1067
+ [cls.disabled]: props.disabled
1068
+ });
1069
+ return /* @__PURE__ */ jsxs(Tt, { value, className: cls.group, onChange, ...props, children: [
1070
+ label2 && /* @__PURE__ */ jsx(K, { as: "p", className: cls.label, children: label2 }),
1071
+ /* @__PURE__ */ jsx("div", { className: cls["content-wrapper"], children: options.map(({ label: label22, value: value2 }) => /* @__PURE__ */ jsx(
1072
+ Be,
126
1073
  {
127
- ref,
128
- value,
129
- className: cls.group,
130
- onChange,
131
- ...props,
132
- children: [
133
- label2 && /* @__PURE__ */ jsx(K, { as: "p", className: cls.label, children: label2 }),
134
- /* @__PURE__ */ jsx("div", { className: cls["content-wrapper"], children: options.map(({ label: label22, value: value2 }) => /* @__PURE__ */ jsx(
135
- Be,
1074
+ as: "span",
1075
+ value: value2,
1076
+ disabled: props.disabled,
1077
+ className: radioClasses,
1078
+ children: ({ checked: checked2, disabled: disabled2 }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [
1079
+ /* @__PURE__ */ jsx(
1080
+ K,
136
1081
  {
137
- as: "span",
138
- value: value2,
139
- disabled: props.disabled,
140
- className: radioClasses,
141
- children: ({ checked: checked2, disabled: disabled2 }) => /* @__PURE__ */ jsxs(Fragment, { children: [
142
- /* @__PURE__ */ jsx(
143
- K,
144
- {
145
- as: "button",
146
- className: classNames(cls.radio, {
147
- [cls.disabled]: props.disabled
148
- }),
149
- children: /* @__PURE__ */ jsx(
150
- "span",
151
- {
152
- className: classNames(cls.frame, {
153
- [cls.checked]: checked2,
154
- [cls.disabled]: disabled2
155
- })
156
- }
157
- )
158
- }
159
- ),
160
- label22
161
- ] })
162
- },
163
- label22
164
- )) })
165
- ]
166
- }
167
- );
168
- }
169
- );
1082
+ as: "button",
1083
+ className: classNames(cls.radio, {
1084
+ [cls.disabled]: props.disabled
1085
+ }),
1086
+ children: /* @__PURE__ */ jsx(
1087
+ "span",
1088
+ {
1089
+ className: classNames(cls.frame, {
1090
+ [cls.checked]: checked2,
1091
+ [cls.disabled]: disabled2
1092
+ })
1093
+ }
1094
+ )
1095
+ }
1096
+ ),
1097
+ label22
1098
+ ] })
1099
+ },
1100
+ label22
1101
+ )) })
1102
+ ] });
1103
+ }
170
1104
  export {
171
1105
  RadioGroup
172
1106
  };