mimir-ui-kit 1.13.7 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +62 -62
- package/dist/{NavigationButtons-DuOoqaPo.js → NavigationButtons-B8tMfqrg.js} +20 -20
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Input.css +1 -1
- package/dist/assets/MergedButton.css +1 -1
- package/dist/assets/OtpInput.css +1 -1
- package/dist/assets/RadioGroup.css +1 -1
- package/dist/assets/Slider.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.js +25 -26
- package/dist/components/Button/constants.d.ts +1 -2
- package/dist/components/Button/constants.js +0 -1
- package/dist/components/Input/Input.d.ts +2 -2
- package/dist/components/Input/Input.js +16 -17
- package/dist/components/InputPassword/InputPassword.js +2 -2
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MergedButton/MergedButton.d.ts +1 -1
- package/dist/components/MergedButton/MergedButton.js +19 -17
- package/dist/components/OtpInput/OtpInput.js +6 -6
- package/dist/components/RadioGroup/RadioGroup.d.ts +2 -18
- package/dist/components/RadioGroup/RadioGroup.js +1061 -130
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/Slider/NavigationButtons/NavigationButtons.js +1 -1
- package/dist/components/Slider/NavigationButtons/index.js +1 -1
- package/dist/components/Slider/Slider.js +10 -10
- package/dist/components/Tag/Tag.d.ts +57 -19
- package/dist/components/Tag/Tag.js +84 -39
- package/dist/components/Tag/constants.d.ts +37 -5
- package/dist/components/Tag/constants.js +53 -13
- package/dist/components/Tag/index.d.ts +3 -2
- package/dist/components/Tag/index.js +6 -5
- package/dist/components/Tag/types.d.ts +6 -0
- package/dist/components/index.d.ts +1 -15
- package/dist/components/index.js +0 -29
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/index.js +1 -7
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/index.d.ts +0 -1
- package/dist/icons/components/index.js +559 -560
- package/dist/{index-Cxiikb7g.js → index-_ACzPKPw.js} +558 -561
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -38
- package/package.json +128 -128
- package/dist/DatePickerModal-BM0BgzTb.js +0 -204
- package/dist/assets/Accordion.css +0 -1
- package/dist/assets/AccordionItem.css +0 -1
- package/dist/assets/DatePickerModal.css +0 -1
- package/dist/assets/Drawer.css +0 -1
- package/dist/assets/ListPhotos.css +0 -1
- package/dist/assets/SelectSearch.css +0 -1
- package/dist/assets/Switch.css +0 -1
- package/dist/assets/TabTrail.css +0 -1
- package/dist/assets/Tag.css +0 -1
- package/dist/assets/Timer.css +0 -1
- package/dist/assets/Uploader.css +0 -1
- package/dist/assets/UploaderPhotos.css +0 -1
- package/dist/bugs-CSBdWk0R.js +0 -18
- package/dist/components/Accordion/Accordion.d.ts +0 -10
- package/dist/components/Accordion/Accordion.js +0 -176
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +0 -8
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +0 -16
- package/dist/components/Accordion/AccordionItem/index.d.ts +0 -1
- package/dist/components/Accordion/AccordionItem/index.js +0 -4
- package/dist/components/Accordion/constants.d.ts +0 -8
- package/dist/components/Accordion/constants.js +0 -14
- package/dist/components/Accordion/index.d.ts +0 -3
- package/dist/components/Accordion/index.js +0 -8
- package/dist/components/DatePicker/DatePicker.d.ts +0 -44
- package/dist/components/DatePicker/DatePicker.js +0 -69
- package/dist/components/DatePicker/DatePickerModal.d.ts +0 -8
- package/dist/components/DatePicker/DatePickerModal.js +0 -9
- package/dist/components/DatePicker/constants.d.ts +0 -6
- package/dist/components/DatePicker/constants.js +0 -11
- package/dist/components/DatePicker/index.d.ts +0 -2
- package/dist/components/DatePicker/index.js +0 -4
- package/dist/components/Drawer/Drawer.d.ts +0 -38
- package/dist/components/Drawer/Drawer.js +0 -144
- package/dist/components/Drawer/constants.d.ts +0 -5
- package/dist/components/Drawer/constants.js +0 -9
- package/dist/components/Drawer/index.d.ts +0 -2
- package/dist/components/Drawer/index.js +0 -6
- package/dist/components/ListPhotos/ListPhotos.d.ts +0 -23
- package/dist/components/ListPhotos/ListPhotos.js +0 -33
- package/dist/components/ListPhotos/constants.d.ts +0 -3
- package/dist/components/ListPhotos/constants.js +0 -21
- package/dist/components/ListPhotos/index.d.ts +0 -2
- package/dist/components/ListPhotos/index.js +0 -4
- package/dist/components/Portal/Portal.d.ts +0 -7
- package/dist/components/Portal/Portal.js +0 -10
- package/dist/components/Portal/index.d.ts +0 -1
- package/dist/components/Portal/index.js +0 -4
- package/dist/components/SelectSearch/SelectSearch.d.ts +0 -15
- package/dist/components/SelectSearch/SelectSearch.js +0 -3876
- package/dist/components/SelectSearch/constants.d.ts +0 -4
- package/dist/components/SelectSearch/constants.js +0 -8
- package/dist/components/SelectSearch/index.d.ts +0 -2
- package/dist/components/SelectSearch/index.js +0 -6
- package/dist/components/Switch/Switch.d.ts +0 -294
- package/dist/components/Switch/Switch.js +0 -59
- package/dist/components/Switch/index.d.ts +0 -2
- package/dist/components/Switch/index.js +0 -4
- package/dist/components/TabTrail/TabButtons/TabButtons.d.ts +0 -8
- package/dist/components/TabTrail/TabButtons/TabButtons.js +0 -29
- package/dist/components/TabTrail/TabButtons/constants.d.ts +0 -8
- package/dist/components/TabTrail/TabButtons/constants.js +0 -14
- package/dist/components/TabTrail/TabButtons/index.d.ts +0 -1
- package/dist/components/TabTrail/TabButtons/index.js +0 -4
- package/dist/components/TabTrail/TabTrail.d.ts +0 -11
- package/dist/components/TabTrail/TabTrail.js +0 -282
- package/dist/components/TabTrail/constants.d.ts +0 -4
- package/dist/components/TabTrail/constants.js +0 -8
- package/dist/components/TabTrail/index.d.ts +0 -2
- package/dist/components/TabTrail/index.js +0 -6
- package/dist/components/Timer/Timer.d.ts +0 -24
- package/dist/components/Timer/Timer.js +0 -29
- package/dist/components/Timer/index.d.ts +0 -1
- package/dist/components/Timer/index.js +0 -4
- package/dist/components/Uploader/Uploader.d.ts +0 -30
- package/dist/components/Uploader/Uploader.js +0 -90
- package/dist/components/Uploader/constants.d.ts +0 -5
- package/dist/components/Uploader/constants.js +0 -16
- package/dist/components/Uploader/index.d.ts +0 -2
- package/dist/components/Uploader/index.js +0 -4
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +0 -29
- package/dist/components/UploaderPhotos/UploaderPhotos.js +0 -46
- package/dist/components/UploaderPhotos/index.d.ts +0 -2
- package/dist/components/UploaderPhotos/index.js +0 -4
- package/dist/focus-management-1rQPII7Z.js +0 -77
- package/dist/hidden-BuVoeHNy.js +0 -13
- package/dist/hooks/useClickOutside/index.d.ts +0 -1
- package/dist/hooks/useClickOutside/index.js +0 -4
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -7
- package/dist/hooks/useClickOutside/useClickOutside.js +0 -25
- package/dist/hooks/useInterval/index.d.ts +0 -1
- package/dist/hooks/useInterval/index.js +0 -4
- package/dist/hooks/useInterval/useInterval.d.ts +0 -1
- package/dist/hooks/useInterval/useInterval.js +0 -17
- package/dist/hooks/useLockBodyScroll/index.d.ts +0 -1
- package/dist/hooks/useLockBodyScroll/index.js +0 -4
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.d.ts +0 -6
- package/dist/hooks/useLockBodyScroll/useLockBodyScroll.js +0 -20
- package/dist/hooks/useTimer/index.d.ts +0 -18
- package/dist/hooks/useTimer/index.js +0 -83
- package/dist/hooks/useTimer/useTimer.d.ts +0 -18
- package/dist/hooks/useTimer/useTimer.js +0 -87
- package/dist/hooks/useTimer/utils.d.ts +0 -24
- package/dist/hooks/useTimer/utils.js +0 -88
- package/dist/icons/components/12px/Close12px.d.ts +0 -4
- package/dist/icons/components/12px/Close12px.js +0 -18
- package/dist/keyboard-B256ZoM-.js +0 -745
- package/dist/label-C_5Syaoj.js +0 -159
- package/dist/open-closed-CbXq00et.js +0 -93
- package/dist/use-active-press-B6yeSopF.js +0 -31
- package/dist/use-by-comparator-BUO78DGe.js +0 -16
- package/dist/use-resolve-button-type-B6LE6gU3.js +0 -19
- package/dist/utils/UUID4.d.ts +0 -1
- package/dist/utils/UUID4.js +0 -9
- package/dist/utils/formating/Date.d.ts +0 -1
- package/dist/utils/formating/Date.js +0 -26
- package/dist/utils/formating/Month.d.ts +0 -8
- package/dist/utils/formating/Month.js +0 -80
- package/dist/utils/formating/Numbers.d.ts +0 -6
- package/dist/utils/formating/Numbers.js +0 -8
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/index.js +0 -13
@@ -1,175 +1,1106 @@
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import React__default, { createContext, useId, useReducer, useRef, useMemo, useCallback, useContext, forwardRef } from "react";
|
5
|
-
import { u } from "../../use-by-comparator-BUO78DGe.js";
|
6
|
-
import { r } from "../../bugs-CSBdWk0R.js";
|
7
|
-
import { P, F, T as T$1, _ } from "../../focus-management-1rQPII7Z.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";
|
8
4
|
import { c as classNames } from "../../index-CweZ_OcN.js";
|
9
|
-
import '../../assets/RadioGroup.css';
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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 });
|
16
953
|
} }, j = createContext(null);
|
17
954
|
j.displayName = "RadioGroupDataContext";
|
18
|
-
function J(
|
19
|
-
let
|
20
|
-
if (
|
21
|
-
let
|
22
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
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;
|
23
960
|
}
|
24
|
-
return
|
961
|
+
return t2;
|
25
962
|
}
|
26
963
|
let X = createContext(null);
|
27
964
|
X.displayName = "RadioGroupActionsContext";
|
28
|
-
function z(
|
29
|
-
let
|
30
|
-
if (
|
31
|
-
let
|
32
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
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;
|
33
970
|
}
|
34
|
-
return
|
971
|
+
return t2;
|
35
972
|
}
|
36
|
-
function Fe(
|
37
|
-
return u$
|
973
|
+
function Fe(o3, t2) {
|
974
|
+
return u$3(t2.type, ke, o3, t2);
|
38
975
|
}
|
39
976
|
let Ie = "div";
|
40
|
-
function Ue(o$
|
41
|
-
let
|
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) => {
|
42
979
|
var u2;
|
43
|
-
if (
|
44
|
-
let k = (u2 = n2.find((H2) => T$
|
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;
|
45
982
|
return k != null && k.disabled ? false : (_2 == null || _2(r2), true);
|
46
|
-
}), de = o((r2) => {
|
47
|
-
let k =
|
983
|
+
}), de = o$2((r2) => {
|
984
|
+
let k = A2.current;
|
48
985
|
if (!k) return;
|
49
|
-
let u2 = u$
|
986
|
+
let u2 = u$4(k), H2 = n2.filter((g) => g.propsRef.current.disabled === false).map((g) => g.element.current);
|
50
987
|
switch (r2.key) {
|
51
|
-
case
|
52
|
-
p(r2.currentTarget);
|
988
|
+
case o2.Enter:
|
989
|
+
p$1(r2.currentTarget);
|
53
990
|
break;
|
54
|
-
case
|
55
|
-
case
|
56
|
-
if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Previous | F.WrapAround) === T
|
57
|
-
let E = n2.find((
|
58
|
-
E &&
|
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);
|
59
996
|
}
|
60
997
|
break;
|
61
|
-
case
|
62
|
-
case
|
63
|
-
if (r2.preventDefault(), r2.stopPropagation(), P(H2, F.Next | F.WrapAround) === T
|
64
|
-
let E = n2.find((
|
65
|
-
E &&
|
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);
|
66
1003
|
}
|
67
1004
|
break;
|
68
|
-
case
|
1005
|
+
case o2.Space:
|
69
1006
|
{
|
70
1007
|
r2.preventDefault(), r2.stopPropagation();
|
71
1008
|
let g = n2.find((E) => E.element.current === (u2 == null ? void 0 : u2.activeElement));
|
72
|
-
g &&
|
1009
|
+
g && d2(g.propsRef.current.value);
|
73
1010
|
}
|
74
1011
|
break;
|
75
1012
|
}
|
76
|
-
}), q = o((r2) => (
|
77
|
-
if (
|
78
|
-
}, [
|
79
|
-
return
|
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" })))));
|
80
1017
|
}
|
81
1018
|
let Me = "div";
|
82
|
-
function Se(
|
1019
|
+
function Se(o3, t2) {
|
83
1020
|
var R;
|
84
|
-
let
|
85
|
-
n(() => a2.registerOption({ id:
|
86
|
-
let
|
87
|
-
var
|
88
|
-
if (r(
|
89
|
-
a2.change(P2) && ((
|
90
|
-
}),
|
91
|
-
return
|
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" })));
|
92
1029
|
}
|
93
1030
|
let He = "span";
|
94
|
-
function we(
|
1031
|
+
function we(o3, t2) {
|
95
1032
|
var R;
|
96
|
-
let
|
97
|
-
n(() =>
|
98
|
-
let U2 = o((
|
99
|
-
var
|
100
|
-
if (r(
|
101
|
-
|
102
|
-
}), { isFocusVisible:
|
103
|
-
return H({ ourProps:
|
104
|
-
}
|
105
|
-
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 });
|
106
|
-
const group = "
|
107
|
-
const radio = "
|
108
|
-
const disabled = "
|
109
|
-
const label = "
|
110
|
-
const frame = "
|
111
|
-
const checked = "
|
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";
|
112
1049
|
const cls = {
|
113
1050
|
group,
|
114
|
-
"content-wrapper": "_content-
|
115
|
-
"radio-wrapper": "_radio-
|
1051
|
+
"content-wrapper": "_content-wrapper_63bak_11",
|
1052
|
+
"radio-wrapper": "_radio-wrapper_63bak_18",
|
116
1053
|
radio,
|
117
1054
|
disabled,
|
118
1055
|
label,
|
119
1056
|
frame,
|
120
1057
|
checked
|
121
1058
|
};
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
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,
|
129
1073
|
{
|
130
|
-
|
131
|
-
value,
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
/* @__PURE__ */ jsx("div", { className: cls["content-wrapper"], children: options.map(({ label: label22, value: value2 }) => /* @__PURE__ */ jsx(
|
138
|
-
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,
|
139
1081
|
{
|
140
|
-
as: "
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
children:
|
145
|
-
|
146
|
-
|
147
|
-
{
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
),
|
163
|
-
label22
|
164
|
-
] })
|
165
|
-
},
|
166
|
-
label22
|
167
|
-
)) })
|
168
|
-
]
|
169
|
-
}
|
170
|
-
);
|
171
|
-
}
|
172
|
-
);
|
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
|
+
}
|
173
1104
|
export {
|
174
1105
|
RadioGroup
|
175
1106
|
};
|