mimir-ui-kit 1.4.0 → 1.5.0

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