am-shared-assets 1.1.7 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +1 -1
- package/dist/{CheckIcon-DOBPX5J0.js → CheckIcon-DUoRNL64.js} +189 -69
- package/dist/arrowIcons.js +545 -209
- package/dist/components/Alert.d.ts +1 -1
- package/dist/components/Autocomplete.d.ts +1 -1
- package/dist/components/Badge.d.ts +1 -1
- package/dist/components/Button.d.ts +1 -1
- package/dist/components/Checkbox.d.ts +1 -1
- package/dist/components/Chip.d.ts +1 -1
- package/dist/components/Input.d.ts +1 -1
- package/dist/components/Radio.d.ts +1 -1
- package/dist/components/RangeSlider.d.ts +1 -1
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Switch.d.ts +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components.js +754 -387
- package/dist/essetionalIcons.js +974 -310
- package/dist/icons/components/AddIcon.d.ts +1 -1
- package/dist/icons/components/ArrowDownIcon.d.ts +1 -1
- package/dist/icons/components/ArrowRightIcon.d.ts +1 -1
- package/dist/icons/components/BagIcon.d.ts +1 -1
- package/dist/icons/components/BalloonIcon.d.ts +1 -1
- package/dist/icons/components/BatteryIcon.d.ts +1 -1
- package/dist/icons/components/BoxIcon.d.ts +1 -1
- package/dist/icons/components/BoxTickIcon.d.ts +1 -1
- package/dist/icons/components/BoxTimeIcon.d.ts +1 -1
- package/dist/icons/components/CardTickIcon.d.ts +1 -1
- package/dist/icons/components/CardsIcon.d.ts +1 -1
- package/dist/icons/components/CartIcon.d.ts +1 -1
- package/dist/icons/components/CategoryIcon.d.ts +1 -1
- package/dist/icons/components/CheckIcon.d.ts +1 -1
- package/dist/icons/components/ChevronBottomIcon.d.ts +1 -1
- package/dist/icons/components/ChevronLeftIcon.d.ts +1 -1
- package/dist/icons/components/ChevronRightIcon.d.ts +1 -1
- package/dist/icons/components/ChevronTopIcon.d.ts +1 -1
- package/dist/icons/components/CloseCircleIcon.d.ts +1 -1
- package/dist/icons/components/CloseIcon.d.ts +1 -1
- package/dist/icons/components/CosmeticsIcon.d.ts +1 -1
- package/dist/icons/components/DigitalDevicesIcon.d.ts +1 -1
- package/dist/icons/components/DislikeIcon.d.ts +1 -1
- package/dist/icons/components/EditIcon.d.ts +1 -1
- package/dist/icons/components/EnergyGradeIcon.d.ts +1 -1
- package/dist/icons/components/FillShoppingCartIcon.d.ts +1 -1
- package/dist/icons/components/FireIcon.d.ts +1 -1
- package/dist/icons/components/FlakeIcon.d.ts +1 -1
- package/dist/icons/components/FridgeIcon.d.ts +1 -1
- package/dist/icons/components/GoldIcon.d.ts +1 -1
- package/dist/icons/components/HammerIcon.d.ts +1 -1
- package/dist/icons/components/HeartIcon.d.ts +1 -1
- package/dist/icons/components/HomeIcon.d.ts +1 -1
- package/dist/icons/components/InfoIcon.d.ts +1 -1
- package/dist/icons/components/LaptopIcon.d.ts +1 -1
- package/dist/icons/components/LikeIcon.d.ts +1 -1
- package/dist/icons/components/LocationIcon.d.ts +1 -1
- package/dist/icons/components/LogoutIcon.d.ts +1 -1
- package/dist/icons/components/MessageIcon.d.ts +1 -1
- package/dist/icons/components/MinusIcon.d.ts +1 -1
- package/dist/icons/components/MobileIcon.d.ts +1 -1
- package/dist/icons/components/MobileScreenIcon.d.ts +1 -1
- package/dist/icons/components/MoneyIcon.d.ts +1 -1
- package/dist/icons/components/MoreIcon.d.ts +1 -1
- package/dist/icons/components/MotorcycleIcon.d.ts +1 -1
- package/dist/icons/components/OutlineTickCircleIcon.d.ts +1 -1
- package/dist/icons/components/PetIcon.d.ts +1 -1
- package/dist/icons/components/PhoneSizeIcon.d.ts +1 -1
- package/dist/icons/components/ProcessorIcon.d.ts +1 -1
- package/dist/icons/components/RamIcon.d.ts +1 -1
- package/dist/icons/components/ReceiptIcon.d.ts +1 -1
- package/dist/icons/components/ResolutionIcon.d.ts +1 -1
- package/dist/icons/components/RotateBoxIcon.d.ts +1 -1
- package/dist/icons/components/RotateInfoIcon.d.ts +1 -1
- package/dist/icons/components/RulerPenIcon.d.ts +1 -1
- package/dist/icons/components/ScreenIcon.d.ts +1 -1
- package/dist/icons/components/SearchIcon.d.ts +1 -1
- package/dist/icons/components/SettingIcon.d.ts +1 -1
- package/dist/icons/components/ShareIcon.d.ts +1 -1
- package/dist/icons/components/ShopIcon.d.ts +1 -1
- package/dist/icons/components/ShoppingCartIcon.d.ts +1 -1
- package/dist/icons/components/SofaIcon.d.ts +1 -1
- package/dist/icons/components/SpeakerIcon.d.ts +1 -1
- package/dist/icons/components/SpinnerIcon.d.ts +1 -1
- package/dist/icons/components/StarIcon.d.ts +1 -1
- package/dist/icons/components/TShirtIcon.d.ts +1 -1
- package/dist/icons/components/TVScreenIcon.d.ts +1 -1
- package/dist/icons/components/TickCircleIcon.d.ts +1 -1
- package/dist/icons/components/TrashIcon.d.ts +1 -1
- package/dist/icons/components/TruckIcon.d.ts +1 -1
- package/dist/icons/components/UserIcon.d.ts +1 -1
- package/dist/icons/components/UserSquareIcon.d.ts +1 -1
- package/dist/icons/components/WalletCheckIcon.d.ts +1 -1
- package/dist/icons/components/WalletIcon.d.ts +1 -1
- package/dist/icons/components/WarningIcon.d.ts +1 -1
- package/dist/icons/components/WheelIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownBoldIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownBrokenIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownBulkIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownLinearIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownOutlineIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-down/ChevronDownTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftBoldIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftBrokenIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftBulkIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftLinearIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftOutlineIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-left/ChevronLeftTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpBoldIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpBrokenIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpBulkIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpLinearIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpOutlineIcon.d.ts +1 -1
- package/dist/icons/components/arrow/chevron-up/ChevronUpTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyBoldIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyBrokenIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyBulkIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyLinearIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyOutlineIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-empty/BatteryEmptyTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowBoldIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowBrokenIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowBulkIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowLinearIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowOutlineIcon.d.ts +1 -1
- package/dist/icons/components/essetional/battery-low/BatteryLowTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationBoldIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationBrokenIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationBulkIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationLinearIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationOutlineIcon.d.ts +1 -1
- package/dist/icons/components/essetional/notification/NotificationTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashBoldIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashBrokenIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashBulkIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashLinearIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashOutlineIcon.d.ts +1 -1
- package/dist/icons/components/essetional/trash/TrashTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdBoldIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdBrokenIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdBulkIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdLinearIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdOutlineIcon.d.ts +1 -1
- package/dist/icons/components/money/walletThird/WalletThirdTwotoneIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileBoldIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileBrokenIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileBulkIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileLinearIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileOutlineIcon.d.ts +1 -1
- package/dist/icons/components/users/profile/ProfileTwotoneIcon.d.ts +1 -1
- package/dist/icons.js +3081 -937
- package/dist/moneyIcons.js +341 -101
- package/dist/overlays/Drawer.d.ts +11 -0
- package/dist/overlays/index.d.ts +2 -0
- package/dist/overlays.d.ts +2 -0
- package/dist/overlays.js +2030 -0
- package/dist/styles.css +1 -1
- package/dist/usersIcons.js +219 -75
- package/package.json +7 -2
package/dist/overlays.js
ADDED
|
@@ -0,0 +1,2030 @@
|
|
|
1
|
+
import { jsxDEV as ae } from "react/jsx-dev-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import p, { useMemo as bn, useLayoutEffect as En, useEffect as Dn, useState as Sn } from "react";
|
|
4
|
+
import { jsx as I, Fragment as Rn } from "react/jsx-runtime";
|
|
5
|
+
import * as Pt from "react-dom";
|
|
6
|
+
import { RemoveScroll as Cn } from "react-remove-scroll";
|
|
7
|
+
function re(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
8
|
+
return function(o) {
|
|
9
|
+
if (e?.(o), t === !1 || !o || !o.defaultPrevented)
|
|
10
|
+
return n?.(o);
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function mt(e, n) {
|
|
14
|
+
if (typeof e == "function")
|
|
15
|
+
return e(n);
|
|
16
|
+
e != null && (e.current = n);
|
|
17
|
+
}
|
|
18
|
+
function On(...e) {
|
|
19
|
+
return (n) => {
|
|
20
|
+
let t = !1;
|
|
21
|
+
const r = e.map((o) => {
|
|
22
|
+
const a = mt(o, n);
|
|
23
|
+
return !t && typeof a == "function" && (t = !0), a;
|
|
24
|
+
});
|
|
25
|
+
if (t)
|
|
26
|
+
return () => {
|
|
27
|
+
for (let o = 0; o < r.length; o++) {
|
|
28
|
+
const a = r[o];
|
|
29
|
+
typeof a == "function" ? a() : mt(e[o], null);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function se(...e) {
|
|
35
|
+
return c.useCallback(On(...e), e);
|
|
36
|
+
}
|
|
37
|
+
function Tn(e, n = []) {
|
|
38
|
+
let t = [];
|
|
39
|
+
function r(a, u) {
|
|
40
|
+
const i = c.createContext(u);
|
|
41
|
+
i.displayName = a + "Context";
|
|
42
|
+
const f = t.length;
|
|
43
|
+
t = [...t, u];
|
|
44
|
+
const m = (s) => {
|
|
45
|
+
const { scope: d, children: g, ...D } = s, w = d?.[e]?.[f] || i, C = c.useMemo(() => D, Object.values(D));
|
|
46
|
+
return /* @__PURE__ */ I(w.Provider, { value: C, children: g });
|
|
47
|
+
};
|
|
48
|
+
m.displayName = a + "Provider";
|
|
49
|
+
function l(s, d, g = {}) {
|
|
50
|
+
const { optional: D = !1 } = g, w = d?.[e]?.[f] || i, C = c.useContext(w);
|
|
51
|
+
if (C) return C;
|
|
52
|
+
if (u !== void 0) return u;
|
|
53
|
+
if (!D)
|
|
54
|
+
throw new Error(`\`${s}\` must be used within \`${a}\``);
|
|
55
|
+
}
|
|
56
|
+
return [m, l];
|
|
57
|
+
}
|
|
58
|
+
const o = () => {
|
|
59
|
+
const a = t.map((u) => c.createContext(u));
|
|
60
|
+
return function(i) {
|
|
61
|
+
const f = i?.[e] || a;
|
|
62
|
+
return c.useMemo(
|
|
63
|
+
() => ({ [`__scope${e}`]: { ...i, [e]: f } }),
|
|
64
|
+
[i, f]
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
return o.scopeName = e, [r, Pn(o, ...n)];
|
|
69
|
+
}
|
|
70
|
+
function Pn(...e) {
|
|
71
|
+
const n = e[0];
|
|
72
|
+
if (e.length === 1) return n;
|
|
73
|
+
const t = () => {
|
|
74
|
+
const r = e.map((o) => ({
|
|
75
|
+
useScope: o(),
|
|
76
|
+
scopeName: o.scopeName
|
|
77
|
+
}));
|
|
78
|
+
return function(a) {
|
|
79
|
+
const u = r.reduce((i, { useScope: f, scopeName: m }) => {
|
|
80
|
+
const s = f(a)[`__scope${m}`];
|
|
81
|
+
return { ...i, ...s };
|
|
82
|
+
}, {});
|
|
83
|
+
return c.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
return t.scopeName = n.scopeName, t;
|
|
87
|
+
}
|
|
88
|
+
var Se = globalThis?.document ? c.useLayoutEffect : () => {
|
|
89
|
+
}, Nn = c[" useId ".trim().toString()] || (() => {
|
|
90
|
+
}), An = 0;
|
|
91
|
+
function Ve(e) {
|
|
92
|
+
const [n, t] = c.useState(Nn());
|
|
93
|
+
return Se(() => {
|
|
94
|
+
t((r) => r ?? String(An++));
|
|
95
|
+
}, [e]), e || (n ? `radix-${n}` : "");
|
|
96
|
+
}
|
|
97
|
+
var xn = c[" useInsertionEffect ".trim().toString()] || Se;
|
|
98
|
+
function Mn({
|
|
99
|
+
prop: e,
|
|
100
|
+
defaultProp: n,
|
|
101
|
+
onChange: t = () => {
|
|
102
|
+
},
|
|
103
|
+
caller: r
|
|
104
|
+
}) {
|
|
105
|
+
const [o, a, u] = In({
|
|
106
|
+
defaultProp: n,
|
|
107
|
+
onChange: t
|
|
108
|
+
}), i = e !== void 0, f = i ? e : o;
|
|
109
|
+
{
|
|
110
|
+
const l = c.useRef(e !== void 0);
|
|
111
|
+
c.useEffect(() => {
|
|
112
|
+
const s = l.current;
|
|
113
|
+
s !== i && console.warn(
|
|
114
|
+
`${r} is changing from ${s ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
115
|
+
), l.current = i;
|
|
116
|
+
}, [i, r]);
|
|
117
|
+
}
|
|
118
|
+
const m = c.useCallback(
|
|
119
|
+
(l) => {
|
|
120
|
+
if (i) {
|
|
121
|
+
const s = _n(l) ? l(e) : l;
|
|
122
|
+
s !== e && u.current?.(s);
|
|
123
|
+
} else
|
|
124
|
+
a(l);
|
|
125
|
+
},
|
|
126
|
+
[i, e, a, u]
|
|
127
|
+
);
|
|
128
|
+
return [f, m];
|
|
129
|
+
}
|
|
130
|
+
function In({
|
|
131
|
+
defaultProp: e,
|
|
132
|
+
onChange: n
|
|
133
|
+
}) {
|
|
134
|
+
const [t, r] = c.useState(e), o = c.useRef(t), a = c.useRef(n);
|
|
135
|
+
return xn(() => {
|
|
136
|
+
a.current = n;
|
|
137
|
+
}, [n]), c.useEffect(() => {
|
|
138
|
+
o.current !== t && (a.current?.(t), o.current = t);
|
|
139
|
+
}, [t, o]), [t, r, a];
|
|
140
|
+
}
|
|
141
|
+
function _n(e) {
|
|
142
|
+
return typeof e == "function";
|
|
143
|
+
}
|
|
144
|
+
// @__NO_SIDE_EFFECTS__
|
|
145
|
+
function Nt(e) {
|
|
146
|
+
const n = c.forwardRef((t, r) => {
|
|
147
|
+
let { children: o, ...a } = t, u = null, i = !1;
|
|
148
|
+
const f = [];
|
|
149
|
+
vt(o) && typeof Ne == "function" && (o = Ne(o._payload)), c.Children.forEach(o, (d) => {
|
|
150
|
+
if (Un(d)) {
|
|
151
|
+
i = !0;
|
|
152
|
+
const g = d;
|
|
153
|
+
let D = "child" in g.props ? g.props.child : g.props.children;
|
|
154
|
+
vt(D) && typeof Ne == "function" && (D = Ne(D._payload)), u = Fn(g, D), f.push(u?.props?.children);
|
|
155
|
+
} else
|
|
156
|
+
f.push(d);
|
|
157
|
+
}), u ? u = c.cloneElement(u, void 0, f) : (
|
|
158
|
+
// A `Slottable` was found but it didn't resolve to a single element (e.g.
|
|
159
|
+
// it wrapped multiple elements, text, or a render-prop `child` that
|
|
160
|
+
// wasn't an element). Don't fall back to treating the `Slottable` wrapper
|
|
161
|
+
// itself as the slot target — throw a descriptive error below instead.
|
|
162
|
+
!i && c.Children.count(o) === 1 && c.isValidElement(o) && (u = o)
|
|
163
|
+
);
|
|
164
|
+
const m = u ? $n(u) : void 0, l = se(r, m);
|
|
165
|
+
if (!u) {
|
|
166
|
+
if (o || o === 0)
|
|
167
|
+
throw new Error(
|
|
168
|
+
i ? Vn(e) : Hn(e)
|
|
169
|
+
);
|
|
170
|
+
return o;
|
|
171
|
+
}
|
|
172
|
+
const s = kn(a, u.props ?? {});
|
|
173
|
+
return u.type !== c.Fragment && (s.ref = r ? l : m), c.cloneElement(u, s);
|
|
174
|
+
});
|
|
175
|
+
return n.displayName = `${e}.Slot`, n;
|
|
176
|
+
}
|
|
177
|
+
var Ln = /* @__PURE__ */ Symbol.for("radix.slottable"), Fn = (e, n) => {
|
|
178
|
+
if ("child" in e.props) {
|
|
179
|
+
const t = e.props.child;
|
|
180
|
+
return c.isValidElement(t) ? c.cloneElement(t, void 0, e.props.children(t.props.children)) : null;
|
|
181
|
+
}
|
|
182
|
+
return c.isValidElement(n) ? n : null;
|
|
183
|
+
};
|
|
184
|
+
function kn(e, n) {
|
|
185
|
+
const t = { ...n };
|
|
186
|
+
for (const r in n) {
|
|
187
|
+
const o = e[r], a = n[r];
|
|
188
|
+
/^on[A-Z]/.test(r) ? o && a ? t[r] = (...i) => {
|
|
189
|
+
const f = a(...i);
|
|
190
|
+
return o(...i), f;
|
|
191
|
+
} : o && (t[r] = o) : r === "style" ? t[r] = { ...o, ...a } : r === "className" && (t[r] = [o, a].filter(Boolean).join(" "));
|
|
192
|
+
}
|
|
193
|
+
return { ...e, ...t };
|
|
194
|
+
}
|
|
195
|
+
function $n(e) {
|
|
196
|
+
let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
197
|
+
return t ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
198
|
+
}
|
|
199
|
+
function Un(e) {
|
|
200
|
+
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Ln;
|
|
201
|
+
}
|
|
202
|
+
var Bn = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
203
|
+
function vt(e) {
|
|
204
|
+
return e != null && typeof e == "object" && "$$typeof" in e && e.$$typeof === Bn && "_payload" in e && Wn(e._payload);
|
|
205
|
+
}
|
|
206
|
+
function Wn(e) {
|
|
207
|
+
return typeof e == "object" && e !== null && "then" in e;
|
|
208
|
+
}
|
|
209
|
+
var Hn = (e) => `${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`, Vn = (e) => `${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`, Ne = c[" use ".trim().toString()], zn = [
|
|
210
|
+
"a",
|
|
211
|
+
"button",
|
|
212
|
+
"div",
|
|
213
|
+
"form",
|
|
214
|
+
"h2",
|
|
215
|
+
"h3",
|
|
216
|
+
"img",
|
|
217
|
+
"input",
|
|
218
|
+
"label",
|
|
219
|
+
"li",
|
|
220
|
+
"nav",
|
|
221
|
+
"ol",
|
|
222
|
+
"p",
|
|
223
|
+
"select",
|
|
224
|
+
"span",
|
|
225
|
+
"svg",
|
|
226
|
+
"ul"
|
|
227
|
+
], J = zn.reduce((e, n) => {
|
|
228
|
+
const t = /* @__PURE__ */ Nt(`Primitive.${n}`), r = c.forwardRef((o, a) => {
|
|
229
|
+
const { asChild: u, ...i } = o, f = u ? t : n;
|
|
230
|
+
return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ I(f, { ...i, ref: a });
|
|
231
|
+
});
|
|
232
|
+
return r.displayName = `Primitive.${n}`, { ...e, [n]: r };
|
|
233
|
+
}, {});
|
|
234
|
+
function jn(e, n) {
|
|
235
|
+
e && Pt.flushSync(() => e.dispatchEvent(n));
|
|
236
|
+
}
|
|
237
|
+
function Re(e) {
|
|
238
|
+
const n = c.useRef(e);
|
|
239
|
+
return c.useEffect(() => {
|
|
240
|
+
n.current = e;
|
|
241
|
+
}), c.useMemo(() => ((...t) => n.current?.(...t)), []);
|
|
242
|
+
}
|
|
243
|
+
var Yn = "DismissableLayer", Ze = "dismissableLayer.update", Kn = "dismissableLayer.pointerDownOutside", qn = "dismissableLayer.focusOutside", ht, et = c.createContext({
|
|
244
|
+
layers: /* @__PURE__ */ new Set(),
|
|
245
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
246
|
+
branches: /* @__PURE__ */ new Set(),
|
|
247
|
+
// Outside elements that belong to a layer's own dismiss affordance (eg, a
|
|
248
|
+
// dialog overlay). Pressing them should dismiss the layer regardless of
|
|
249
|
+
// whether or not they stop propagation.
|
|
250
|
+
//
|
|
251
|
+
// See https://github.com/radix-ui/primitives/issues/3346
|
|
252
|
+
dismissableSurfaces: /* @__PURE__ */ new Set()
|
|
253
|
+
}), At = c.forwardRef(
|
|
254
|
+
(e, n) => {
|
|
255
|
+
const {
|
|
256
|
+
disableOutsidePointerEvents: t = !1,
|
|
257
|
+
deferPointerDownOutside: r = !1,
|
|
258
|
+
onEscapeKeyDown: o,
|
|
259
|
+
onPointerDownOutside: a,
|
|
260
|
+
onFocusOutside: u,
|
|
261
|
+
onInteractOutside: i,
|
|
262
|
+
onDismiss: f,
|
|
263
|
+
...m
|
|
264
|
+
} = e, l = c.useContext(et), [s, d] = c.useState(null), g = s?.ownerDocument ?? globalThis?.document, [, D] = c.useState({}), w = se(n, d), C = Array.from(l.layers), [v] = [
|
|
265
|
+
...l.layersWithOutsidePointerEventsDisabled
|
|
266
|
+
].slice(-1), x = v ? C.indexOf(v) : -1, b = s ? C.indexOf(s) : -1, h = l.layersWithOutsidePointerEventsDisabled.size > 0, F = b >= x, j = c.useRef(!1), S = Qn(
|
|
267
|
+
(O) => {
|
|
268
|
+
a?.(O), i?.(O), O.defaultPrevented || f?.();
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
ownerDocument: g,
|
|
272
|
+
deferPointerDownOutside: r,
|
|
273
|
+
isDeferredPointerDownOutsideRef: j,
|
|
274
|
+
dismissableSurfaces: l.dismissableSurfaces,
|
|
275
|
+
shouldHandlePointerDownOutside: c.useCallback(
|
|
276
|
+
(O) => {
|
|
277
|
+
if (!(O instanceof Node))
|
|
278
|
+
return !1;
|
|
279
|
+
const B = [...l.branches].some(
|
|
280
|
+
(y) => y.contains(O)
|
|
281
|
+
);
|
|
282
|
+
return F && !B;
|
|
283
|
+
},
|
|
284
|
+
[l.branches, F]
|
|
285
|
+
)
|
|
286
|
+
}
|
|
287
|
+
), P = er((O) => {
|
|
288
|
+
if (r && j.current)
|
|
289
|
+
return;
|
|
290
|
+
const B = O.target;
|
|
291
|
+
[...l.branches].some((H) => H.contains(B)) || (u?.(O), i?.(O), O.defaultPrevented || f?.());
|
|
292
|
+
}, g), T = s ? b === C.length - 1 : !1, $ = Re((O) => {
|
|
293
|
+
O.key === "Escape" && (o?.(O), !O.defaultPrevented && f && (O.preventDefault(), f()));
|
|
294
|
+
});
|
|
295
|
+
return c.useEffect(() => {
|
|
296
|
+
if (T)
|
|
297
|
+
return g.addEventListener("keydown", $, { capture: !0 }), () => g.removeEventListener("keydown", $, { capture: !0 });
|
|
298
|
+
}, [g, T, $]), c.useEffect(() => {
|
|
299
|
+
if (s)
|
|
300
|
+
return t && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (ht = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(s)), l.layers.add(s), gt(), () => {
|
|
301
|
+
t && (l.layersWithOutsidePointerEventsDisabled.delete(s), l.layersWithOutsidePointerEventsDisabled.size === 0 && (g.body.style.pointerEvents = ht));
|
|
302
|
+
};
|
|
303
|
+
}, [s, g, t, l]), c.useEffect(() => () => {
|
|
304
|
+
s && (l.layers.delete(s), l.layersWithOutsidePointerEventsDisabled.delete(s), gt());
|
|
305
|
+
}, [s, l]), c.useEffect(() => {
|
|
306
|
+
const O = () => D({});
|
|
307
|
+
return document.addEventListener(Ze, O), () => document.removeEventListener(Ze, O);
|
|
308
|
+
}, []), /* @__PURE__ */ I(
|
|
309
|
+
J.div,
|
|
310
|
+
{
|
|
311
|
+
...m,
|
|
312
|
+
ref: w,
|
|
313
|
+
style: {
|
|
314
|
+
pointerEvents: h ? F ? "auto" : "none" : void 0,
|
|
315
|
+
...e.style
|
|
316
|
+
},
|
|
317
|
+
onFocusCapture: re(e.onFocusCapture, P.onFocusCapture),
|
|
318
|
+
onBlurCapture: re(e.onBlurCapture, P.onBlurCapture),
|
|
319
|
+
onPointerDownCapture: re(
|
|
320
|
+
e.onPointerDownCapture,
|
|
321
|
+
S.onPointerDownCapture
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
At.displayName = Yn;
|
|
328
|
+
var Xn = "DismissableLayerBranch", Gn = c.forwardRef((e, n) => {
|
|
329
|
+
const t = c.useContext(et), r = c.useRef(null), o = se(n, r);
|
|
330
|
+
return c.useEffect(() => {
|
|
331
|
+
const a = r.current;
|
|
332
|
+
if (a)
|
|
333
|
+
return t.branches.add(a), () => {
|
|
334
|
+
t.branches.delete(a);
|
|
335
|
+
};
|
|
336
|
+
}, [t.branches]), /* @__PURE__ */ I(J.div, { ...e, ref: o });
|
|
337
|
+
});
|
|
338
|
+
Gn.displayName = Xn;
|
|
339
|
+
function Zn() {
|
|
340
|
+
const e = c.useContext(et), [n, t] = c.useState(null);
|
|
341
|
+
return c.useEffect(() => {
|
|
342
|
+
if (n)
|
|
343
|
+
return e.dismissableSurfaces.add(n), () => {
|
|
344
|
+
e.dismissableSurfaces.delete(n);
|
|
345
|
+
};
|
|
346
|
+
}, [n, e.dismissableSurfaces]), t;
|
|
347
|
+
}
|
|
348
|
+
var Jn = () => !0;
|
|
349
|
+
function Qn(e, n) {
|
|
350
|
+
const {
|
|
351
|
+
ownerDocument: t = globalThis?.document,
|
|
352
|
+
deferPointerDownOutside: r = !1,
|
|
353
|
+
isDeferredPointerDownOutsideRef: o,
|
|
354
|
+
dismissableSurfaces: a,
|
|
355
|
+
shouldHandlePointerDownOutside: u = Jn
|
|
356
|
+
} = n, i = Re(e), f = c.useRef(!1), m = c.useRef(!1), l = c.useRef(/* @__PURE__ */ new Map()), s = c.useRef(() => {
|
|
357
|
+
});
|
|
358
|
+
return c.useEffect(() => {
|
|
359
|
+
function d() {
|
|
360
|
+
m.current = !1, o.current = !1, l.current.clear();
|
|
361
|
+
}
|
|
362
|
+
function g() {
|
|
363
|
+
return Array.from(l.current.values()).some(Boolean);
|
|
364
|
+
}
|
|
365
|
+
function D(b) {
|
|
366
|
+
if (!m.current)
|
|
367
|
+
return;
|
|
368
|
+
const h = b.target;
|
|
369
|
+
h instanceof Node && [...a].some((j) => j.contains(h)) || l.current.set(b.type, !0), b.type === "click" && window.setTimeout(() => {
|
|
370
|
+
m.current && s.current();
|
|
371
|
+
}, 0);
|
|
372
|
+
}
|
|
373
|
+
function w(b) {
|
|
374
|
+
m.current && l.current.set(b.type, !1);
|
|
375
|
+
}
|
|
376
|
+
const C = (b) => {
|
|
377
|
+
if (b.target && !f.current) {
|
|
378
|
+
let h = function() {
|
|
379
|
+
t.removeEventListener("click", s.current);
|
|
380
|
+
const j = g();
|
|
381
|
+
d(), j || xt(
|
|
382
|
+
Kn,
|
|
383
|
+
i,
|
|
384
|
+
F,
|
|
385
|
+
{ discrete: !0 }
|
|
386
|
+
);
|
|
387
|
+
};
|
|
388
|
+
if (!u(b.target)) {
|
|
389
|
+
t.removeEventListener("click", s.current), d(), f.current = !1;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const F = { originalEvent: b };
|
|
393
|
+
m.current = !0, o.current = r && b.button === 0, l.current.clear(), !r || b.button !== 0 ? h() : (t.removeEventListener("click", s.current), s.current = h, t.addEventListener("click", s.current, { once: !0 }));
|
|
394
|
+
} else
|
|
395
|
+
t.removeEventListener("click", s.current), d();
|
|
396
|
+
f.current = !1;
|
|
397
|
+
}, v = [
|
|
398
|
+
"pointerup",
|
|
399
|
+
"mousedown",
|
|
400
|
+
"mouseup",
|
|
401
|
+
"touchstart",
|
|
402
|
+
"touchend",
|
|
403
|
+
"click"
|
|
404
|
+
];
|
|
405
|
+
for (const b of v)
|
|
406
|
+
t.addEventListener(b, D, !0), t.addEventListener(b, w);
|
|
407
|
+
const x = window.setTimeout(() => {
|
|
408
|
+
t.addEventListener("pointerdown", C);
|
|
409
|
+
}, 0);
|
|
410
|
+
return () => {
|
|
411
|
+
window.clearTimeout(x), t.removeEventListener("pointerdown", C), t.removeEventListener("click", s.current);
|
|
412
|
+
for (const b of v)
|
|
413
|
+
t.removeEventListener(b, D, !0), t.removeEventListener(b, w);
|
|
414
|
+
};
|
|
415
|
+
}, [
|
|
416
|
+
t,
|
|
417
|
+
i,
|
|
418
|
+
r,
|
|
419
|
+
o,
|
|
420
|
+
a,
|
|
421
|
+
u
|
|
422
|
+
]), {
|
|
423
|
+
// ensures we check React component tree (not just DOM tree)
|
|
424
|
+
onPointerDownCapture: () => f.current = !0
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function er(e, n = globalThis?.document) {
|
|
428
|
+
const t = Re(e), r = c.useRef(!1);
|
|
429
|
+
return c.useEffect(() => {
|
|
430
|
+
const o = (a) => {
|
|
431
|
+
a.target && !r.current && xt(qn, t, { originalEvent: a }, {
|
|
432
|
+
discrete: !1
|
|
433
|
+
});
|
|
434
|
+
};
|
|
435
|
+
return n.addEventListener("focusin", o), () => n.removeEventListener("focusin", o);
|
|
436
|
+
}, [n, t]), {
|
|
437
|
+
onFocusCapture: () => r.current = !0,
|
|
438
|
+
onBlurCapture: () => r.current = !1
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
function gt() {
|
|
442
|
+
const e = new CustomEvent(Ze);
|
|
443
|
+
document.dispatchEvent(e);
|
|
444
|
+
}
|
|
445
|
+
function xt(e, n, t, { discrete: r }) {
|
|
446
|
+
const o = t.originalEvent.target, a = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: t });
|
|
447
|
+
n && o.addEventListener(e, n, { once: !0 }), r ? jn(o, a) : o.dispatchEvent(a);
|
|
448
|
+
}
|
|
449
|
+
var ze = "focusScope.autoFocusOnMount", je = "focusScope.autoFocusOnUnmount", wt = { bubbles: !1, cancelable: !0 }, tr = "FocusScope", Mt = c.forwardRef((e, n) => {
|
|
450
|
+
const {
|
|
451
|
+
loop: t = !1,
|
|
452
|
+
trapped: r = !1,
|
|
453
|
+
onMountAutoFocus: o,
|
|
454
|
+
onUnmountAutoFocus: a,
|
|
455
|
+
...u
|
|
456
|
+
} = e, [i, f] = c.useState(null), m = Re(o), l = Re(a), s = c.useRef(null), d = se(n, f), g = c.useRef({
|
|
457
|
+
paused: !1,
|
|
458
|
+
pause() {
|
|
459
|
+
this.paused = !0;
|
|
460
|
+
},
|
|
461
|
+
resume() {
|
|
462
|
+
this.paused = !1;
|
|
463
|
+
}
|
|
464
|
+
}).current;
|
|
465
|
+
c.useEffect(() => {
|
|
466
|
+
if (r) {
|
|
467
|
+
let w = function(b) {
|
|
468
|
+
if (g.paused || !i) return;
|
|
469
|
+
const h = b.target;
|
|
470
|
+
i.contains(h) ? s.current = h : ne(s.current, { select: !0 });
|
|
471
|
+
}, C = function(b) {
|
|
472
|
+
if (g.paused || !i) return;
|
|
473
|
+
const h = b.relatedTarget;
|
|
474
|
+
h !== null && (i.contains(h) || ne(s.current, { select: !0 }));
|
|
475
|
+
}, v = function(b) {
|
|
476
|
+
if (document.activeElement === document.body)
|
|
477
|
+
for (const F of b)
|
|
478
|
+
F.removedNodes.length > 0 && ne(i);
|
|
479
|
+
};
|
|
480
|
+
document.addEventListener("focusin", w), document.addEventListener("focusout", C);
|
|
481
|
+
const x = new MutationObserver(v);
|
|
482
|
+
return i && x.observe(i, { childList: !0, subtree: !0 }), () => {
|
|
483
|
+
document.removeEventListener("focusin", w), document.removeEventListener("focusout", C), x.disconnect();
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
}, [r, i, g.paused]), c.useEffect(() => {
|
|
487
|
+
if (i) {
|
|
488
|
+
bt.add(g);
|
|
489
|
+
const w = document.activeElement;
|
|
490
|
+
if (!i.contains(w)) {
|
|
491
|
+
const v = new CustomEvent(ze, wt);
|
|
492
|
+
i.addEventListener(ze, m), i.dispatchEvent(v), v.defaultPrevented || (nr(sr(It(i)), { select: !0 }), document.activeElement === w && ne(i));
|
|
493
|
+
}
|
|
494
|
+
return () => {
|
|
495
|
+
i.removeEventListener(ze, m), setTimeout(() => {
|
|
496
|
+
const v = new CustomEvent(je, wt);
|
|
497
|
+
i.addEventListener(je, l), i.dispatchEvent(v), v.defaultPrevented || ne(w ?? document.body, { select: !0 }), i.removeEventListener(je, l), bt.remove(g);
|
|
498
|
+
}, 0);
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
}, [i, m, l, g]);
|
|
502
|
+
const D = c.useCallback(
|
|
503
|
+
(w) => {
|
|
504
|
+
if (!t && !r || g.paused) return;
|
|
505
|
+
const C = w.key === "Tab" && !w.altKey && !w.ctrlKey && !w.metaKey, v = document.activeElement;
|
|
506
|
+
if (C && v) {
|
|
507
|
+
const x = w.currentTarget, [b, h] = rr(x);
|
|
508
|
+
b && h ? !w.shiftKey && v === h ? (w.preventDefault(), t && ne(b, { select: !0 })) : w.shiftKey && v === b && (w.preventDefault(), t && ne(h, { select: !0 })) : v === x && w.preventDefault();
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
[t, r, g.paused]
|
|
512
|
+
);
|
|
513
|
+
return /* @__PURE__ */ I(J.div, { tabIndex: -1, ...u, ref: d, onKeyDown: D });
|
|
514
|
+
});
|
|
515
|
+
Mt.displayName = tr;
|
|
516
|
+
function nr(e, { select: n = !1 } = {}) {
|
|
517
|
+
const t = document.activeElement;
|
|
518
|
+
for (const r of e)
|
|
519
|
+
if (ne(r, { select: n }), document.activeElement !== t) return;
|
|
520
|
+
}
|
|
521
|
+
function rr(e) {
|
|
522
|
+
const n = It(e), t = yt(n, e), r = yt(n.reverse(), e);
|
|
523
|
+
return [t, r];
|
|
524
|
+
}
|
|
525
|
+
function It(e) {
|
|
526
|
+
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
527
|
+
acceptNode: (r) => {
|
|
528
|
+
const o = r.tagName === "INPUT" && r.type === "hidden";
|
|
529
|
+
return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
for (; t.nextNode(); ) n.push(t.currentNode);
|
|
533
|
+
return n;
|
|
534
|
+
}
|
|
535
|
+
function yt(e, n) {
|
|
536
|
+
const t = typeof n.checkVisibility == "function" && n.checkVisibility({ checkVisibilityCSS: !0 });
|
|
537
|
+
for (const r of e)
|
|
538
|
+
if (!(t ? !r.checkVisibility({ checkVisibilityCSS: !0 }) : or(r, { upTo: n })))
|
|
539
|
+
return r;
|
|
540
|
+
}
|
|
541
|
+
function or(e, { upTo: n }) {
|
|
542
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
543
|
+
for (; e; ) {
|
|
544
|
+
if (n !== void 0 && e === n) return !1;
|
|
545
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
546
|
+
e = e.parentElement;
|
|
547
|
+
}
|
|
548
|
+
return !1;
|
|
549
|
+
}
|
|
550
|
+
function ar(e) {
|
|
551
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
552
|
+
}
|
|
553
|
+
function ne(e, { select: n = !1 } = {}) {
|
|
554
|
+
if (e && e.focus) {
|
|
555
|
+
const t = document.activeElement;
|
|
556
|
+
e.focus({ preventScroll: !0 }), e !== t && ar(e) && n && e.select();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
var bt = ir();
|
|
560
|
+
function ir() {
|
|
561
|
+
let e = [];
|
|
562
|
+
return {
|
|
563
|
+
add(n) {
|
|
564
|
+
const t = e[0];
|
|
565
|
+
n !== t && t?.pause(), e = Et(e, n), e.unshift(n);
|
|
566
|
+
},
|
|
567
|
+
remove(n) {
|
|
568
|
+
e = Et(e, n), e[0]?.resume();
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
function Et(e, n) {
|
|
573
|
+
const t = [...e], r = t.indexOf(n);
|
|
574
|
+
return r !== -1 && t.splice(r, 1), t;
|
|
575
|
+
}
|
|
576
|
+
function sr(e) {
|
|
577
|
+
return e.filter((n) => n.tagName !== "A");
|
|
578
|
+
}
|
|
579
|
+
var ur = "Portal", _t = c.forwardRef((e, n) => {
|
|
580
|
+
const { container: t, ...r } = e, [o, a] = c.useState(!1);
|
|
581
|
+
Se(() => a(!0), []);
|
|
582
|
+
const u = t || o && globalThis?.document?.body;
|
|
583
|
+
return u ? Pt.createPortal(/* @__PURE__ */ I(J.div, { ...r, ref: n }), u) : null;
|
|
584
|
+
});
|
|
585
|
+
_t.displayName = ur;
|
|
586
|
+
function cr(e, n) {
|
|
587
|
+
return c.useReducer((t, r) => n[t][r] ?? t, e);
|
|
588
|
+
}
|
|
589
|
+
var Fe = (e) => {
|
|
590
|
+
const { present: n, children: t } = e, r = lr(n), o = typeof t == "function" ? t({ present: r.isPresent }) : c.Children.only(t), a = dr(r.ref, fr(o));
|
|
591
|
+
return typeof t == "function" || r.isPresent ? c.cloneElement(o, { ref: a }) : null;
|
|
592
|
+
};
|
|
593
|
+
Fe.displayName = "Presence";
|
|
594
|
+
function lr(e) {
|
|
595
|
+
const [n, t] = c.useState(), r = c.useRef(null), o = c.useRef(e), a = c.useRef("none"), u = c.useRef(void 0), i = e ? "mounted" : "unmounted", [f, m] = cr(i, {
|
|
596
|
+
mounted: {
|
|
597
|
+
UNMOUNT: "unmounted",
|
|
598
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
599
|
+
},
|
|
600
|
+
unmountSuspended: {
|
|
601
|
+
MOUNT: "mounted",
|
|
602
|
+
ANIMATION_END: "unmounted"
|
|
603
|
+
},
|
|
604
|
+
unmounted: {
|
|
605
|
+
MOUNT: "mounted"
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
return c.useEffect(() => {
|
|
609
|
+
f === "mounted" ? (a.current = u.current ?? ye(r.current), u.current = void 0) : a.current = "none";
|
|
610
|
+
}, [f]), Se(() => {
|
|
611
|
+
const l = r.current, s = o.current;
|
|
612
|
+
if (s !== e) {
|
|
613
|
+
const g = a.current, D = ye(l);
|
|
614
|
+
e ? (u.current = D, m("MOUNT")) : D === "none" || l?.display === "none" ? m("UNMOUNT") : m(s && g !== D ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
|
|
615
|
+
}
|
|
616
|
+
}, [e, m]), Se(() => {
|
|
617
|
+
if (n) {
|
|
618
|
+
let l;
|
|
619
|
+
const s = n.ownerDocument.defaultView ?? window, d = (D) => {
|
|
620
|
+
const C = ye(r.current).includes(CSS.escape(D.animationName));
|
|
621
|
+
if (D.target === n && C && (m("ANIMATION_END"), !o.current)) {
|
|
622
|
+
const v = n.style.animationFillMode;
|
|
623
|
+
n.style.animationFillMode = "forwards", l = s.setTimeout(() => {
|
|
624
|
+
n.style.animationFillMode === "forwards" && (n.style.animationFillMode = v);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
}, g = (D) => {
|
|
628
|
+
D.target === n && (a.current = ye(r.current));
|
|
629
|
+
};
|
|
630
|
+
return n.addEventListener("animationstart", g), n.addEventListener("animationcancel", d), n.addEventListener("animationend", d), () => {
|
|
631
|
+
s.clearTimeout(l), n.removeEventListener("animationstart", g), n.removeEventListener("animationcancel", d), n.removeEventListener("animationend", d);
|
|
632
|
+
};
|
|
633
|
+
} else
|
|
634
|
+
m("ANIMATION_END");
|
|
635
|
+
}, [n, m]), {
|
|
636
|
+
isPresent: ["mounted", "unmountSuspended"].includes(f),
|
|
637
|
+
ref: c.useCallback((l) => {
|
|
638
|
+
if (l) {
|
|
639
|
+
const s = getComputedStyle(l);
|
|
640
|
+
r.current = s, u.current = ye(s);
|
|
641
|
+
} else
|
|
642
|
+
r.current = null;
|
|
643
|
+
t(l);
|
|
644
|
+
}, [])
|
|
645
|
+
};
|
|
646
|
+
}
|
|
647
|
+
function Dt(e, n) {
|
|
648
|
+
if (typeof e == "function")
|
|
649
|
+
return e(n);
|
|
650
|
+
e != null && (e.current = n);
|
|
651
|
+
}
|
|
652
|
+
function dr(...e) {
|
|
653
|
+
const n = c.useRef(e);
|
|
654
|
+
return n.current = e, c.useCallback((t) => {
|
|
655
|
+
const r = n.current;
|
|
656
|
+
let o = !1;
|
|
657
|
+
const a = r.map((u) => {
|
|
658
|
+
const i = Dt(u, t);
|
|
659
|
+
return !o && typeof i == "function" && (o = !0), i;
|
|
660
|
+
});
|
|
661
|
+
if (o)
|
|
662
|
+
return () => {
|
|
663
|
+
for (let u = 0; u < a.length; u++) {
|
|
664
|
+
const i = a[u];
|
|
665
|
+
typeof i == "function" ? i() : Dt(r[u], null);
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
}, []);
|
|
669
|
+
}
|
|
670
|
+
function ye(e) {
|
|
671
|
+
return e?.animationName || "none";
|
|
672
|
+
}
|
|
673
|
+
function fr(e) {
|
|
674
|
+
let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
675
|
+
return t ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
676
|
+
}
|
|
677
|
+
var Ae = 0, de = null;
|
|
678
|
+
function pr() {
|
|
679
|
+
c.useEffect(() => {
|
|
680
|
+
de || (de = { start: St(), end: St() });
|
|
681
|
+
const { start: e, end: n } = de;
|
|
682
|
+
return document.body.firstElementChild !== e && document.body.insertAdjacentElement("afterbegin", e), document.body.lastElementChild !== n && document.body.insertAdjacentElement("beforeend", n), Ae++, () => {
|
|
683
|
+
Ae === 1 && (de?.start.remove(), de?.end.remove(), de = null), Ae = Math.max(0, Ae - 1);
|
|
684
|
+
};
|
|
685
|
+
}, []);
|
|
686
|
+
}
|
|
687
|
+
function St() {
|
|
688
|
+
const e = document.createElement("span");
|
|
689
|
+
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
690
|
+
}
|
|
691
|
+
var mr = function(e) {
|
|
692
|
+
if (typeof document > "u")
|
|
693
|
+
return null;
|
|
694
|
+
var n = Array.isArray(e) ? e[0] : e;
|
|
695
|
+
return n.ownerDocument.body;
|
|
696
|
+
}, fe = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Me = {}, Ye = 0, Lt = function(e) {
|
|
697
|
+
return e && (e.host || Lt(e.parentNode));
|
|
698
|
+
}, vr = function(e, n) {
|
|
699
|
+
return n.map(function(t) {
|
|
700
|
+
if (e.contains(t))
|
|
701
|
+
return t;
|
|
702
|
+
var r = Lt(t);
|
|
703
|
+
return r && e.contains(r) ? r : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
|
|
704
|
+
}).filter(function(t) {
|
|
705
|
+
return !!t;
|
|
706
|
+
});
|
|
707
|
+
}, hr = function(e, n, t, r) {
|
|
708
|
+
var o = vr(n, Array.isArray(e) ? e : [e]);
|
|
709
|
+
Me[t] || (Me[t] = /* @__PURE__ */ new WeakMap());
|
|
710
|
+
var a = Me[t], u = [], i = /* @__PURE__ */ new Set(), f = new Set(o), m = function(s) {
|
|
711
|
+
!s || i.has(s) || (i.add(s), m(s.parentNode));
|
|
712
|
+
};
|
|
713
|
+
o.forEach(m);
|
|
714
|
+
var l = function(s) {
|
|
715
|
+
!s || f.has(s) || Array.prototype.forEach.call(s.children, function(d) {
|
|
716
|
+
if (i.has(d))
|
|
717
|
+
l(d);
|
|
718
|
+
else
|
|
719
|
+
try {
|
|
720
|
+
var g = d.getAttribute(r), D = g !== null && g !== "false", w = (fe.get(d) || 0) + 1, C = (a.get(d) || 0) + 1;
|
|
721
|
+
fe.set(d, w), a.set(d, C), u.push(d), w === 1 && D && xe.set(d, !0), C === 1 && d.setAttribute(t, "true"), D || d.setAttribute(r, "true");
|
|
722
|
+
} catch (v) {
|
|
723
|
+
console.error("aria-hidden: cannot operate on ", d, v);
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
};
|
|
727
|
+
return l(n), i.clear(), Ye++, function() {
|
|
728
|
+
u.forEach(function(s) {
|
|
729
|
+
var d = fe.get(s) - 1, g = a.get(s) - 1;
|
|
730
|
+
fe.set(s, d), a.set(s, g), d || (xe.has(s) || s.removeAttribute(r), xe.delete(s)), g || s.removeAttribute(t);
|
|
731
|
+
}), Ye--, Ye || (fe = /* @__PURE__ */ new WeakMap(), fe = /* @__PURE__ */ new WeakMap(), xe = /* @__PURE__ */ new WeakMap(), Me = {});
|
|
732
|
+
};
|
|
733
|
+
}, gr = function(e, n, t) {
|
|
734
|
+
t === void 0 && (t = "data-aria-hidden");
|
|
735
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), o = mr(e);
|
|
736
|
+
return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), hr(r, o, t, "aria-hidden")) : function() {
|
|
737
|
+
return null;
|
|
738
|
+
};
|
|
739
|
+
}, ke = "Dialog", [Ft] = Tn(ke), [wr, X] = Ft(ke), kt = (e) => {
|
|
740
|
+
const {
|
|
741
|
+
__scopeDialog: n,
|
|
742
|
+
children: t,
|
|
743
|
+
open: r,
|
|
744
|
+
defaultOpen: o,
|
|
745
|
+
onOpenChange: a,
|
|
746
|
+
modal: u = !0
|
|
747
|
+
} = e, i = c.useRef(null), f = c.useRef(null), [m, l] = Mn({
|
|
748
|
+
prop: r,
|
|
749
|
+
defaultProp: o ?? !1,
|
|
750
|
+
onChange: a,
|
|
751
|
+
caller: ke
|
|
752
|
+
});
|
|
753
|
+
return /* @__PURE__ */ I(
|
|
754
|
+
wr,
|
|
755
|
+
{
|
|
756
|
+
scope: n,
|
|
757
|
+
triggerRef: i,
|
|
758
|
+
contentRef: f,
|
|
759
|
+
contentId: Ve(),
|
|
760
|
+
titleId: Ve(),
|
|
761
|
+
descriptionId: Ve(),
|
|
762
|
+
open: m,
|
|
763
|
+
onOpenChange: l,
|
|
764
|
+
onOpenToggle: c.useCallback(() => l((s) => !s), [l]),
|
|
765
|
+
modal: u,
|
|
766
|
+
children: t
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
};
|
|
770
|
+
kt.displayName = ke;
|
|
771
|
+
var $t = "DialogTrigger", yr = c.forwardRef(
|
|
772
|
+
(e, n) => {
|
|
773
|
+
const { __scopeDialog: t, ...r } = e, o = X($t, t), a = se(n, o.triggerRef);
|
|
774
|
+
return /* @__PURE__ */ I(
|
|
775
|
+
J.button,
|
|
776
|
+
{
|
|
777
|
+
type: "button",
|
|
778
|
+
"aria-haspopup": "dialog",
|
|
779
|
+
"aria-expanded": o.open,
|
|
780
|
+
"aria-controls": o.open ? o.contentId : void 0,
|
|
781
|
+
"data-state": nt(o.open),
|
|
782
|
+
...r,
|
|
783
|
+
ref: a,
|
|
784
|
+
onClick: re(e.onClick, o.onOpenToggle)
|
|
785
|
+
}
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
);
|
|
789
|
+
yr.displayName = $t;
|
|
790
|
+
var tt = "DialogPortal", [br, Ut] = Ft(tt, {
|
|
791
|
+
forceMount: void 0
|
|
792
|
+
}), Bt = (e) => {
|
|
793
|
+
const { __scopeDialog: n, forceMount: t, children: r, container: o } = e, a = X(tt, n);
|
|
794
|
+
return /* @__PURE__ */ I(br, { scope: n, forceMount: t, children: c.Children.map(r, (u) => /* @__PURE__ */ I(Fe, { present: t || a.open, children: /* @__PURE__ */ I(_t, { asChild: !0, container: o, children: u }) })) });
|
|
795
|
+
};
|
|
796
|
+
Bt.displayName = tt;
|
|
797
|
+
var Le = "DialogOverlay", Wt = c.forwardRef(
|
|
798
|
+
(e, n) => {
|
|
799
|
+
const t = Ut(Le, e.__scopeDialog), { forceMount: r = t.forceMount, ...o } = e, a = X(Le, e.__scopeDialog);
|
|
800
|
+
return a.modal ? /* @__PURE__ */ I(Fe, { present: r || a.open, children: /* @__PURE__ */ I(Dr, { ...o, ref: n }) }) : null;
|
|
801
|
+
}
|
|
802
|
+
);
|
|
803
|
+
Wt.displayName = Le;
|
|
804
|
+
var Er = /* @__PURE__ */ Nt("DialogOverlay.RemoveScroll"), Dr = c.forwardRef(
|
|
805
|
+
(e, n) => {
|
|
806
|
+
const { __scopeDialog: t, ...r } = e, o = X(Le, t), a = Zn(), u = se(n, a);
|
|
807
|
+
return (
|
|
808
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
809
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
810
|
+
/* @__PURE__ */ I(Cn, { as: Er, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ I(
|
|
811
|
+
J.div,
|
|
812
|
+
{
|
|
813
|
+
"data-state": nt(o.open),
|
|
814
|
+
...r,
|
|
815
|
+
ref: u,
|
|
816
|
+
style: { pointerEvents: "auto", ...r.style }
|
|
817
|
+
}
|
|
818
|
+
) })
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
), pe = "DialogContent", Ht = c.forwardRef(
|
|
822
|
+
(e, n) => {
|
|
823
|
+
const t = Ut(pe, e.__scopeDialog), { forceMount: r = t.forceMount, ...o } = e, a = X(pe, e.__scopeDialog);
|
|
824
|
+
return /* @__PURE__ */ I(Fe, { present: r || a.open, children: a.modal ? /* @__PURE__ */ I(Sr, { ...o, ref: n }) : /* @__PURE__ */ I(Rr, { ...o, ref: n }) });
|
|
825
|
+
}
|
|
826
|
+
);
|
|
827
|
+
Ht.displayName = pe;
|
|
828
|
+
var Sr = c.forwardRef(
|
|
829
|
+
(e, n) => {
|
|
830
|
+
const t = X(pe, e.__scopeDialog), r = c.useRef(null), o = se(n, t.contentRef, r);
|
|
831
|
+
return c.useEffect(() => {
|
|
832
|
+
const a = r.current;
|
|
833
|
+
if (a) return gr(a);
|
|
834
|
+
}, []), /* @__PURE__ */ I(
|
|
835
|
+
Vt,
|
|
836
|
+
{
|
|
837
|
+
...e,
|
|
838
|
+
ref: o,
|
|
839
|
+
trapFocus: t.open,
|
|
840
|
+
disableOutsidePointerEvents: t.open,
|
|
841
|
+
onCloseAutoFocus: re(e.onCloseAutoFocus, (a) => {
|
|
842
|
+
a.preventDefault(), t.triggerRef.current?.focus();
|
|
843
|
+
}),
|
|
844
|
+
onPointerDownOutside: re(e.onPointerDownOutside, (a) => {
|
|
845
|
+
const u = a.detail.originalEvent, i = u.button === 0 && u.ctrlKey === !0;
|
|
846
|
+
(u.button === 2 || i) && a.preventDefault();
|
|
847
|
+
}),
|
|
848
|
+
onFocusOutside: re(
|
|
849
|
+
e.onFocusOutside,
|
|
850
|
+
(a) => a.preventDefault()
|
|
851
|
+
)
|
|
852
|
+
}
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
), Rr = c.forwardRef(
|
|
856
|
+
(e, n) => {
|
|
857
|
+
const t = X(pe, e.__scopeDialog), r = c.useRef(!1), o = c.useRef(!1);
|
|
858
|
+
return /* @__PURE__ */ I(
|
|
859
|
+
Vt,
|
|
860
|
+
{
|
|
861
|
+
...e,
|
|
862
|
+
ref: n,
|
|
863
|
+
trapFocus: !1,
|
|
864
|
+
disableOutsidePointerEvents: !1,
|
|
865
|
+
onCloseAutoFocus: (a) => {
|
|
866
|
+
e.onCloseAutoFocus?.(a), a.defaultPrevented || (r.current || t.triggerRef.current?.focus(), a.preventDefault()), r.current = !1, o.current = !1;
|
|
867
|
+
},
|
|
868
|
+
onInteractOutside: (a) => {
|
|
869
|
+
e.onInteractOutside?.(a), a.defaultPrevented || (r.current = !0, a.detail.originalEvent.type === "pointerdown" && (o.current = !0));
|
|
870
|
+
const u = a.target;
|
|
871
|
+
t.triggerRef.current?.contains(u) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && o.current && a.preventDefault();
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
), Vt = c.forwardRef(
|
|
877
|
+
(e, n) => {
|
|
878
|
+
const { __scopeDialog: t, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: a, ...u } = e, i = X(pe, t);
|
|
879
|
+
return pr(), /* @__PURE__ */ I(Rn, { children: /* @__PURE__ */ I(
|
|
880
|
+
Mt,
|
|
881
|
+
{
|
|
882
|
+
asChild: !0,
|
|
883
|
+
loop: !0,
|
|
884
|
+
trapped: r,
|
|
885
|
+
onMountAutoFocus: o,
|
|
886
|
+
onUnmountAutoFocus: a,
|
|
887
|
+
children: /* @__PURE__ */ I(
|
|
888
|
+
At,
|
|
889
|
+
{
|
|
890
|
+
role: "dialog",
|
|
891
|
+
id: i.contentId,
|
|
892
|
+
"aria-describedby": i.descriptionId,
|
|
893
|
+
"aria-labelledby": i.titleId,
|
|
894
|
+
"data-state": nt(i.open),
|
|
895
|
+
...u,
|
|
896
|
+
ref: n,
|
|
897
|
+
deferPointerDownOutside: !0,
|
|
898
|
+
onDismiss: () => i.onOpenChange(!1)
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
}
|
|
902
|
+
) });
|
|
903
|
+
}
|
|
904
|
+
), zt = "DialogTitle", Cr = c.forwardRef(
|
|
905
|
+
(e, n) => {
|
|
906
|
+
const { __scopeDialog: t, ...r } = e, o = X(zt, t);
|
|
907
|
+
return /* @__PURE__ */ I(J.h2, { id: o.titleId, ...r, ref: n });
|
|
908
|
+
}
|
|
909
|
+
);
|
|
910
|
+
Cr.displayName = zt;
|
|
911
|
+
var jt = "DialogDescription", Or = c.forwardRef(
|
|
912
|
+
(e, n) => {
|
|
913
|
+
const { __scopeDialog: t, ...r } = e, o = X(jt, t);
|
|
914
|
+
return /* @__PURE__ */ I(J.p, { id: o.descriptionId, ...r, ref: n });
|
|
915
|
+
}
|
|
916
|
+
);
|
|
917
|
+
Or.displayName = jt;
|
|
918
|
+
var Yt = "DialogClose", Tr = c.forwardRef(
|
|
919
|
+
(e, n) => {
|
|
920
|
+
const { __scopeDialog: t, ...r } = e, o = X(Yt, t);
|
|
921
|
+
return /* @__PURE__ */ I(
|
|
922
|
+
J.button,
|
|
923
|
+
{
|
|
924
|
+
type: "button",
|
|
925
|
+
...r,
|
|
926
|
+
ref: n,
|
|
927
|
+
onClick: re(e.onClick, () => o.onOpenChange(!1))
|
|
928
|
+
}
|
|
929
|
+
);
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
Tr.displayName = Yt;
|
|
933
|
+
function nt(e) {
|
|
934
|
+
return e ? "open" : "closed";
|
|
935
|
+
}
|
|
936
|
+
function Pr(e) {
|
|
937
|
+
if (typeof document > "u") return;
|
|
938
|
+
let n = document.head || document.getElementsByTagName("head")[0], t = document.createElement("style");
|
|
939
|
+
t.type = "text/css", n.appendChild(t), t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
|
|
940
|
+
}
|
|
941
|
+
const Kt = p.createContext({
|
|
942
|
+
drawerRef: {
|
|
943
|
+
current: null
|
|
944
|
+
},
|
|
945
|
+
overlayRef: {
|
|
946
|
+
current: null
|
|
947
|
+
},
|
|
948
|
+
onPress: () => {
|
|
949
|
+
},
|
|
950
|
+
onRelease: () => {
|
|
951
|
+
},
|
|
952
|
+
onDrag: () => {
|
|
953
|
+
},
|
|
954
|
+
onNestedDrag: () => {
|
|
955
|
+
},
|
|
956
|
+
onNestedOpenChange: () => {
|
|
957
|
+
},
|
|
958
|
+
onNestedRelease: () => {
|
|
959
|
+
},
|
|
960
|
+
openProp: void 0,
|
|
961
|
+
dismissible: !1,
|
|
962
|
+
isOpen: !1,
|
|
963
|
+
isDragging: !1,
|
|
964
|
+
keyboardIsOpen: {
|
|
965
|
+
current: !1
|
|
966
|
+
},
|
|
967
|
+
snapPointsOffset: null,
|
|
968
|
+
snapPoints: null,
|
|
969
|
+
handleOnly: !1,
|
|
970
|
+
modal: !1,
|
|
971
|
+
shouldFade: !1,
|
|
972
|
+
activeSnapPoint: null,
|
|
973
|
+
onOpenChange: () => {
|
|
974
|
+
},
|
|
975
|
+
setActiveSnapPoint: () => {
|
|
976
|
+
},
|
|
977
|
+
closeDrawer: () => {
|
|
978
|
+
},
|
|
979
|
+
direction: "bottom",
|
|
980
|
+
shouldAnimate: {
|
|
981
|
+
current: !0
|
|
982
|
+
},
|
|
983
|
+
shouldScaleBackground: !1,
|
|
984
|
+
setBackgroundColorOnScale: !0,
|
|
985
|
+
noBodyStyles: !1,
|
|
986
|
+
container: null,
|
|
987
|
+
autoFocus: !1
|
|
988
|
+
}), Ce = () => {
|
|
989
|
+
const e = p.useContext(Kt);
|
|
990
|
+
if (!e)
|
|
991
|
+
throw new Error("useDrawerContext must be used within a Drawer.Root");
|
|
992
|
+
return e;
|
|
993
|
+
};
|
|
994
|
+
Pr(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
995
|
+
[data-state=closed]
|
|
996
|
+
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);
|
|
997
|
+
function Nr() {
|
|
998
|
+
const e = navigator.userAgent;
|
|
999
|
+
return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || // Android Firefox
|
|
1000
|
+
/FxiOS/.test(e));
|
|
1001
|
+
}
|
|
1002
|
+
function Ar() {
|
|
1003
|
+
return rt(/^Mac/);
|
|
1004
|
+
}
|
|
1005
|
+
function xr() {
|
|
1006
|
+
return rt(/^iPhone/);
|
|
1007
|
+
}
|
|
1008
|
+
function Rt() {
|
|
1009
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
1010
|
+
}
|
|
1011
|
+
function Mr() {
|
|
1012
|
+
return rt(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
1013
|
+
Ar() && navigator.maxTouchPoints > 1;
|
|
1014
|
+
}
|
|
1015
|
+
function qt() {
|
|
1016
|
+
return xr() || Mr();
|
|
1017
|
+
}
|
|
1018
|
+
function rt(e) {
|
|
1019
|
+
return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
|
|
1020
|
+
}
|
|
1021
|
+
const Ir = 24, _r = typeof window < "u" ? En : Dn;
|
|
1022
|
+
function Ct(...e) {
|
|
1023
|
+
return (...n) => {
|
|
1024
|
+
for (let t of e)
|
|
1025
|
+
typeof t == "function" && t(...n);
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1028
|
+
const Ke = typeof document < "u" && window.visualViewport;
|
|
1029
|
+
function Ot(e) {
|
|
1030
|
+
let n = window.getComputedStyle(e);
|
|
1031
|
+
return /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY);
|
|
1032
|
+
}
|
|
1033
|
+
function Xt(e) {
|
|
1034
|
+
for (Ot(e) && (e = e.parentElement); e && !Ot(e); )
|
|
1035
|
+
e = e.parentElement;
|
|
1036
|
+
return e || document.scrollingElement || document.documentElement;
|
|
1037
|
+
}
|
|
1038
|
+
const Lr = /* @__PURE__ */ new Set([
|
|
1039
|
+
"checkbox",
|
|
1040
|
+
"radio",
|
|
1041
|
+
"range",
|
|
1042
|
+
"color",
|
|
1043
|
+
"file",
|
|
1044
|
+
"image",
|
|
1045
|
+
"button",
|
|
1046
|
+
"submit",
|
|
1047
|
+
"reset"
|
|
1048
|
+
]);
|
|
1049
|
+
let Ie = 0, qe;
|
|
1050
|
+
function Fr(e = {}) {
|
|
1051
|
+
let { isDisabled: n } = e;
|
|
1052
|
+
_r(() => {
|
|
1053
|
+
if (!n)
|
|
1054
|
+
return Ie++, Ie === 1 && qt() && (qe = kr()), () => {
|
|
1055
|
+
Ie--, Ie === 0 && qe?.();
|
|
1056
|
+
};
|
|
1057
|
+
}, [
|
|
1058
|
+
n
|
|
1059
|
+
]);
|
|
1060
|
+
}
|
|
1061
|
+
function kr() {
|
|
1062
|
+
let e, n = 0, t = (s) => {
|
|
1063
|
+
e = Xt(s.target), !(e === document.documentElement && e === document.body) && (n = s.changedTouches[0].pageY);
|
|
1064
|
+
}, r = (s) => {
|
|
1065
|
+
if (!e || e === document.documentElement || e === document.body) {
|
|
1066
|
+
s.preventDefault();
|
|
1067
|
+
return;
|
|
1068
|
+
}
|
|
1069
|
+
let d = s.changedTouches[0].pageY, g = e.scrollTop, D = e.scrollHeight - e.clientHeight;
|
|
1070
|
+
D !== 0 && ((g <= 0 && d > n || g >= D && d < n) && s.preventDefault(), n = d);
|
|
1071
|
+
}, o = (s) => {
|
|
1072
|
+
let d = s.target;
|
|
1073
|
+
Je(d) && d !== document.activeElement && (s.preventDefault(), d.style.transform = "translateY(-2000px)", d.focus(), requestAnimationFrame(() => {
|
|
1074
|
+
d.style.transform = "";
|
|
1075
|
+
}));
|
|
1076
|
+
}, a = (s) => {
|
|
1077
|
+
let d = s.target;
|
|
1078
|
+
Je(d) && (d.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
1079
|
+
d.style.transform = "", Ke && (Ke.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
1080
|
+
Tt(d);
|
|
1081
|
+
}) : Ke.addEventListener("resize", () => Tt(d), {
|
|
1082
|
+
once: !0
|
|
1083
|
+
}));
|
|
1084
|
+
}));
|
|
1085
|
+
}, u = () => {
|
|
1086
|
+
window.scrollTo(0, 0);
|
|
1087
|
+
}, i = window.pageXOffset, f = window.pageYOffset, m = Ct($r(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
1088
|
+
window.scrollTo(0, 0);
|
|
1089
|
+
let l = Ct(be(document, "touchstart", t, {
|
|
1090
|
+
passive: !1,
|
|
1091
|
+
capture: !0
|
|
1092
|
+
}), be(document, "touchmove", r, {
|
|
1093
|
+
passive: !1,
|
|
1094
|
+
capture: !0
|
|
1095
|
+
}), be(document, "touchend", o, {
|
|
1096
|
+
passive: !1,
|
|
1097
|
+
capture: !0
|
|
1098
|
+
}), be(document, "focus", a, !0), be(window, "scroll", u));
|
|
1099
|
+
return () => {
|
|
1100
|
+
m(), l(), window.scrollTo(i, f);
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1103
|
+
function $r(e, n, t) {
|
|
1104
|
+
let r = e.style[n];
|
|
1105
|
+
return e.style[n] = t, () => {
|
|
1106
|
+
e.style[n] = r;
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
1109
|
+
function be(e, n, t, r) {
|
|
1110
|
+
return e.addEventListener(n, t, r), () => {
|
|
1111
|
+
e.removeEventListener(n, t, r);
|
|
1112
|
+
};
|
|
1113
|
+
}
|
|
1114
|
+
function Tt(e) {
|
|
1115
|
+
let n = document.scrollingElement || document.documentElement;
|
|
1116
|
+
for (; e && e !== n; ) {
|
|
1117
|
+
let t = Xt(e);
|
|
1118
|
+
if (t !== document.documentElement && t !== document.body && t !== e) {
|
|
1119
|
+
let r = t.getBoundingClientRect().top, o = e.getBoundingClientRect().top, a = e.getBoundingClientRect().bottom;
|
|
1120
|
+
const u = t.getBoundingClientRect().bottom + Ir;
|
|
1121
|
+
a > u && (t.scrollTop += o - r);
|
|
1122
|
+
}
|
|
1123
|
+
e = t.parentElement;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
function Je(e) {
|
|
1127
|
+
return e instanceof HTMLInputElement && !Lr.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
|
1128
|
+
}
|
|
1129
|
+
function Ur(e, n) {
|
|
1130
|
+
typeof e == "function" ? e(n) : e != null && (e.current = n);
|
|
1131
|
+
}
|
|
1132
|
+
function Br(...e) {
|
|
1133
|
+
return (n) => e.forEach((t) => Ur(t, n));
|
|
1134
|
+
}
|
|
1135
|
+
function Gt(...e) {
|
|
1136
|
+
return c.useCallback(Br(...e), e);
|
|
1137
|
+
}
|
|
1138
|
+
const Zt = /* @__PURE__ */ new WeakMap();
|
|
1139
|
+
function U(e, n, t = !1) {
|
|
1140
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
1141
|
+
let r = {};
|
|
1142
|
+
Object.entries(n).forEach(([o, a]) => {
|
|
1143
|
+
if (o.startsWith("--")) {
|
|
1144
|
+
e.style.setProperty(o, a);
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
r[o] = e.style[o], e.style[o] = a;
|
|
1148
|
+
}), !t && Zt.set(e, r);
|
|
1149
|
+
}
|
|
1150
|
+
function Wr(e, n) {
|
|
1151
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
1152
|
+
let t = Zt.get(e);
|
|
1153
|
+
t && (e.style[n] = t[n]);
|
|
1154
|
+
}
|
|
1155
|
+
const k = (e) => {
|
|
1156
|
+
switch (e) {
|
|
1157
|
+
case "top":
|
|
1158
|
+
case "bottom":
|
|
1159
|
+
return !0;
|
|
1160
|
+
case "left":
|
|
1161
|
+
case "right":
|
|
1162
|
+
return !1;
|
|
1163
|
+
default:
|
|
1164
|
+
return e;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
function _e(e, n) {
|
|
1168
|
+
if (!e)
|
|
1169
|
+
return null;
|
|
1170
|
+
const t = window.getComputedStyle(e), r = (
|
|
1171
|
+
// @ts-ignore
|
|
1172
|
+
t.transform || t.webkitTransform || t.mozTransform
|
|
1173
|
+
);
|
|
1174
|
+
let o = r.match(/^matrix3d\((.+)\)$/);
|
|
1175
|
+
return o ? parseFloat(o[1].split(", ")[k(n) ? 13 : 12]) : (o = r.match(/^matrix\((.+)\)$/), o ? parseFloat(o[1].split(", ")[k(n) ? 5 : 4]) : null);
|
|
1176
|
+
}
|
|
1177
|
+
function Hr(e) {
|
|
1178
|
+
return 8 * (Math.log(e + 1) - 2);
|
|
1179
|
+
}
|
|
1180
|
+
function Xe(e, n) {
|
|
1181
|
+
if (!e) return () => {
|
|
1182
|
+
};
|
|
1183
|
+
const t = e.style.cssText;
|
|
1184
|
+
return Object.assign(e.style, n), () => {
|
|
1185
|
+
e.style.cssText = t;
|
|
1186
|
+
};
|
|
1187
|
+
}
|
|
1188
|
+
function Vr(...e) {
|
|
1189
|
+
return (...n) => {
|
|
1190
|
+
for (const t of e)
|
|
1191
|
+
typeof t == "function" && t(...n);
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
const _ = {
|
|
1195
|
+
DURATION: 0.5,
|
|
1196
|
+
EASE: [
|
|
1197
|
+
0.32,
|
|
1198
|
+
0.72,
|
|
1199
|
+
0,
|
|
1200
|
+
1
|
|
1201
|
+
]
|
|
1202
|
+
}, Jt = 0.4, zr = 0.25, jr = 100, Qt = 8, ie = 16, Qe = 26, Ge = "vaul-dragging";
|
|
1203
|
+
function en(e) {
|
|
1204
|
+
const n = p.useRef(e);
|
|
1205
|
+
return p.useEffect(() => {
|
|
1206
|
+
n.current = e;
|
|
1207
|
+
}), p.useMemo(() => (...t) => n.current == null ? void 0 : n.current.call(n, ...t), []);
|
|
1208
|
+
}
|
|
1209
|
+
function Yr({ defaultProp: e, onChange: n }) {
|
|
1210
|
+
const t = p.useState(e), [r] = t, o = p.useRef(r), a = en(n);
|
|
1211
|
+
return p.useEffect(() => {
|
|
1212
|
+
o.current !== r && (a(r), o.current = r);
|
|
1213
|
+
}, [
|
|
1214
|
+
r,
|
|
1215
|
+
o,
|
|
1216
|
+
a
|
|
1217
|
+
]), t;
|
|
1218
|
+
}
|
|
1219
|
+
function tn({ prop: e, defaultProp: n, onChange: t = () => {
|
|
1220
|
+
} }) {
|
|
1221
|
+
const [r, o] = Yr({
|
|
1222
|
+
defaultProp: n,
|
|
1223
|
+
onChange: t
|
|
1224
|
+
}), a = e !== void 0, u = a ? e : r, i = en(t), f = p.useCallback((m) => {
|
|
1225
|
+
if (a) {
|
|
1226
|
+
const s = typeof m == "function" ? m(e) : m;
|
|
1227
|
+
s !== e && i(s);
|
|
1228
|
+
} else
|
|
1229
|
+
o(m);
|
|
1230
|
+
}, [
|
|
1231
|
+
a,
|
|
1232
|
+
e,
|
|
1233
|
+
o,
|
|
1234
|
+
i
|
|
1235
|
+
]);
|
|
1236
|
+
return [
|
|
1237
|
+
u,
|
|
1238
|
+
f
|
|
1239
|
+
];
|
|
1240
|
+
}
|
|
1241
|
+
function Kr({ activeSnapPointProp: e, setActiveSnapPointProp: n, snapPoints: t, drawerRef: r, overlayRef: o, fadeFromIndex: a, onSnapPointChange: u, direction: i = "bottom", container: f, snapToSequentialPoint: m }) {
|
|
1242
|
+
const [l, s] = tn({
|
|
1243
|
+
prop: e,
|
|
1244
|
+
defaultProp: t?.[0],
|
|
1245
|
+
onChange: n
|
|
1246
|
+
}), [d, g] = p.useState(typeof window < "u" ? {
|
|
1247
|
+
innerWidth: window.innerWidth,
|
|
1248
|
+
innerHeight: window.innerHeight
|
|
1249
|
+
} : void 0);
|
|
1250
|
+
p.useEffect(() => {
|
|
1251
|
+
function S() {
|
|
1252
|
+
g({
|
|
1253
|
+
innerWidth: window.innerWidth,
|
|
1254
|
+
innerHeight: window.innerHeight
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
1258
|
+
}, []);
|
|
1259
|
+
const D = p.useMemo(() => l === t?.[t.length - 1] || null, [
|
|
1260
|
+
t,
|
|
1261
|
+
l
|
|
1262
|
+
]), w = p.useMemo(() => {
|
|
1263
|
+
var S;
|
|
1264
|
+
return (S = t?.findIndex((P) => P === l)) != null ? S : null;
|
|
1265
|
+
}, [
|
|
1266
|
+
t,
|
|
1267
|
+
l
|
|
1268
|
+
]), C = t && t.length > 0 && (a || a === 0) && !Number.isNaN(a) && t[a] === l || !t, v = p.useMemo(() => {
|
|
1269
|
+
const S = f ? {
|
|
1270
|
+
width: f.getBoundingClientRect().width,
|
|
1271
|
+
height: f.getBoundingClientRect().height
|
|
1272
|
+
} : typeof window < "u" ? {
|
|
1273
|
+
width: window.innerWidth,
|
|
1274
|
+
height: window.innerHeight
|
|
1275
|
+
} : {
|
|
1276
|
+
width: 0,
|
|
1277
|
+
height: 0
|
|
1278
|
+
};
|
|
1279
|
+
var P;
|
|
1280
|
+
return (P = t?.map((T) => {
|
|
1281
|
+
const $ = typeof T == "string";
|
|
1282
|
+
let O = 0;
|
|
1283
|
+
if ($ && (O = parseInt(T, 10)), k(i)) {
|
|
1284
|
+
const y = $ ? O : d ? T * S.height : 0;
|
|
1285
|
+
return d ? i === "bottom" ? S.height - y : -S.height + y : y;
|
|
1286
|
+
}
|
|
1287
|
+
const B = $ ? O : d ? T * S.width : 0;
|
|
1288
|
+
return d ? i === "right" ? S.width - B : -S.width + B : B;
|
|
1289
|
+
})) != null ? P : [];
|
|
1290
|
+
}, [
|
|
1291
|
+
t,
|
|
1292
|
+
d,
|
|
1293
|
+
f
|
|
1294
|
+
]), x = p.useMemo(() => w !== null ? v?.[w] : null, [
|
|
1295
|
+
v,
|
|
1296
|
+
w
|
|
1297
|
+
]), b = p.useCallback((S) => {
|
|
1298
|
+
var P;
|
|
1299
|
+
const T = (P = v?.findIndex(($) => $ === S)) != null ? P : null;
|
|
1300
|
+
u(T), U(r.current, {
|
|
1301
|
+
transition: `transform ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1302
|
+
transform: k(i) ? `translate3d(0, ${S}px, 0)` : `translate3d(${S}px, 0, 0)`
|
|
1303
|
+
}), v && T !== v.length - 1 && a !== void 0 && T !== a && T < a ? U(o.current, {
|
|
1304
|
+
transition: `opacity ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1305
|
+
opacity: "0"
|
|
1306
|
+
}) : U(o.current, {
|
|
1307
|
+
transition: `opacity ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1308
|
+
opacity: "1"
|
|
1309
|
+
}), s(t?.[Math.max(T, 0)]);
|
|
1310
|
+
}, [
|
|
1311
|
+
r.current,
|
|
1312
|
+
t,
|
|
1313
|
+
v,
|
|
1314
|
+
a,
|
|
1315
|
+
o,
|
|
1316
|
+
s
|
|
1317
|
+
]);
|
|
1318
|
+
p.useEffect(() => {
|
|
1319
|
+
if (l || e) {
|
|
1320
|
+
var S;
|
|
1321
|
+
const P = (S = t?.findIndex((T) => T === e || T === l)) != null ? S : -1;
|
|
1322
|
+
v && P !== -1 && typeof v[P] == "number" && b(v[P]);
|
|
1323
|
+
}
|
|
1324
|
+
}, [
|
|
1325
|
+
l,
|
|
1326
|
+
e,
|
|
1327
|
+
t,
|
|
1328
|
+
v,
|
|
1329
|
+
b
|
|
1330
|
+
]);
|
|
1331
|
+
function h({ draggedDistance: S, closeDrawer: P, velocity: T, dismissible: $ }) {
|
|
1332
|
+
if (a === void 0) return;
|
|
1333
|
+
const O = i === "bottom" || i === "right" ? (x ?? 0) - S : (x ?? 0) + S, B = w === a - 1, y = w === 0, H = S > 0;
|
|
1334
|
+
if (B && U(o.current, {
|
|
1335
|
+
transition: `opacity ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`
|
|
1336
|
+
}), !m && T > 2 && !H) {
|
|
1337
|
+
$ ? P() : b(v[0]);
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
if (!m && T > 2 && H && v && t) {
|
|
1341
|
+
b(v[t.length - 1]);
|
|
1342
|
+
return;
|
|
1343
|
+
}
|
|
1344
|
+
const V = v?.reduce((W, Z) => typeof W != "number" || typeof Z != "number" ? W : Math.abs(Z - O) < Math.abs(W - O) ? Z : W), K = k(i) ? window.innerHeight : window.innerWidth;
|
|
1345
|
+
if (T > Jt && Math.abs(S) < K * 0.4) {
|
|
1346
|
+
const W = H ? 1 : -1;
|
|
1347
|
+
if (W > 0 && D && t) {
|
|
1348
|
+
b(v[t.length - 1]);
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
if (y && W < 0 && $ && P(), w === null) return;
|
|
1352
|
+
b(v[w + W]);
|
|
1353
|
+
return;
|
|
1354
|
+
}
|
|
1355
|
+
b(V);
|
|
1356
|
+
}
|
|
1357
|
+
function F({ draggedDistance: S }) {
|
|
1358
|
+
if (x === null) return;
|
|
1359
|
+
const P = i === "bottom" || i === "right" ? x - S : x + S;
|
|
1360
|
+
(i === "bottom" || i === "right") && P < v[v.length - 1] || (i === "top" || i === "left") && P > v[v.length - 1] || U(r.current, {
|
|
1361
|
+
transform: k(i) ? `translate3d(0, ${P}px, 0)` : `translate3d(${P}px, 0, 0)`
|
|
1362
|
+
});
|
|
1363
|
+
}
|
|
1364
|
+
function j(S, P) {
|
|
1365
|
+
if (!t || typeof w != "number" || !v || a === void 0) return null;
|
|
1366
|
+
const T = w === a - 1;
|
|
1367
|
+
if (w >= a && P)
|
|
1368
|
+
return 0;
|
|
1369
|
+
if (T && !P) return 1;
|
|
1370
|
+
if (!C && !T) return null;
|
|
1371
|
+
const O = T ? w + 1 : w - 1, B = T ? v[O] - v[O - 1] : v[O + 1] - v[O], y = S / Math.abs(B);
|
|
1372
|
+
return T ? 1 - y : y;
|
|
1373
|
+
}
|
|
1374
|
+
return {
|
|
1375
|
+
isLastSnapPoint: D,
|
|
1376
|
+
activeSnapPoint: l,
|
|
1377
|
+
shouldFade: C,
|
|
1378
|
+
getPercentageDragged: j,
|
|
1379
|
+
setActiveSnapPoint: s,
|
|
1380
|
+
activeSnapPointIndex: w,
|
|
1381
|
+
onRelease: h,
|
|
1382
|
+
onDrag: F,
|
|
1383
|
+
snapPointsOffset: v
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
const qr = () => () => {
|
|
1387
|
+
};
|
|
1388
|
+
function Xr() {
|
|
1389
|
+
const { direction: e, isOpen: n, shouldScaleBackground: t, setBackgroundColorOnScale: r, noBodyStyles: o } = Ce(), a = p.useRef(null), u = bn(() => document.body.style.backgroundColor, []);
|
|
1390
|
+
function i() {
|
|
1391
|
+
return (window.innerWidth - Qe) / window.innerWidth;
|
|
1392
|
+
}
|
|
1393
|
+
p.useEffect(() => {
|
|
1394
|
+
if (n && t) {
|
|
1395
|
+
a.current && clearTimeout(a.current);
|
|
1396
|
+
const f = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
1397
|
+
if (!f) return;
|
|
1398
|
+
Vr(r && !o ? Xe(document.body, {
|
|
1399
|
+
background: "black"
|
|
1400
|
+
}) : qr, Xe(f, {
|
|
1401
|
+
transformOrigin: k(e) ? "top" : "left",
|
|
1402
|
+
transitionProperty: "transform, border-radius",
|
|
1403
|
+
transitionDuration: `${_.DURATION}s`,
|
|
1404
|
+
transitionTimingFunction: `cubic-bezier(${_.EASE.join(",")})`
|
|
1405
|
+
}));
|
|
1406
|
+
const m = Xe(f, {
|
|
1407
|
+
borderRadius: `${Qt}px`,
|
|
1408
|
+
overflow: "hidden",
|
|
1409
|
+
...k(e) ? {
|
|
1410
|
+
transform: `scale(${i()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
|
|
1411
|
+
} : {
|
|
1412
|
+
transform: `scale(${i()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
|
|
1413
|
+
}
|
|
1414
|
+
});
|
|
1415
|
+
return () => {
|
|
1416
|
+
m(), a.current = window.setTimeout(() => {
|
|
1417
|
+
u ? document.body.style.background = u : document.body.style.removeProperty("background");
|
|
1418
|
+
}, _.DURATION * 1e3);
|
|
1419
|
+
};
|
|
1420
|
+
}
|
|
1421
|
+
}, [
|
|
1422
|
+
n,
|
|
1423
|
+
t,
|
|
1424
|
+
u
|
|
1425
|
+
]);
|
|
1426
|
+
}
|
|
1427
|
+
let Ee = null;
|
|
1428
|
+
function Gr({ isOpen: e, modal: n, nested: t, hasBeenOpened: r, preventScrollRestoration: o, noBodyStyles: a }) {
|
|
1429
|
+
const [u, i] = p.useState(() => typeof window < "u" ? window.location.href : ""), f = p.useRef(0), m = p.useCallback(() => {
|
|
1430
|
+
if (Rt() && Ee === null && e && !a) {
|
|
1431
|
+
Ee = {
|
|
1432
|
+
position: document.body.style.position,
|
|
1433
|
+
top: document.body.style.top,
|
|
1434
|
+
left: document.body.style.left,
|
|
1435
|
+
height: document.body.style.height,
|
|
1436
|
+
right: "unset"
|
|
1437
|
+
};
|
|
1438
|
+
const { scrollX: s, innerHeight: d } = window;
|
|
1439
|
+
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
1440
|
+
top: `${-f.current}px`,
|
|
1441
|
+
left: `${-s}px`,
|
|
1442
|
+
right: "0px",
|
|
1443
|
+
height: "auto"
|
|
1444
|
+
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
1445
|
+
const g = d - window.innerHeight;
|
|
1446
|
+
g && f.current >= d && (document.body.style.top = `${-(f.current + g)}px`);
|
|
1447
|
+
}), 300);
|
|
1448
|
+
}
|
|
1449
|
+
}, [
|
|
1450
|
+
e
|
|
1451
|
+
]), l = p.useCallback(() => {
|
|
1452
|
+
if (Rt() && Ee !== null && !a) {
|
|
1453
|
+
const s = -parseInt(document.body.style.top, 10), d = -parseInt(document.body.style.left, 10);
|
|
1454
|
+
Object.assign(document.body.style, Ee), window.requestAnimationFrame(() => {
|
|
1455
|
+
if (o && u !== window.location.href) {
|
|
1456
|
+
i(window.location.href);
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
window.scrollTo(d, s);
|
|
1460
|
+
}), Ee = null;
|
|
1461
|
+
}
|
|
1462
|
+
}, [
|
|
1463
|
+
u
|
|
1464
|
+
]);
|
|
1465
|
+
return p.useEffect(() => {
|
|
1466
|
+
function s() {
|
|
1467
|
+
f.current = window.scrollY;
|
|
1468
|
+
}
|
|
1469
|
+
return s(), window.addEventListener("scroll", s), () => {
|
|
1470
|
+
window.removeEventListener("scroll", s);
|
|
1471
|
+
};
|
|
1472
|
+
}, []), p.useEffect(() => {
|
|
1473
|
+
if (n)
|
|
1474
|
+
return () => {
|
|
1475
|
+
typeof document > "u" || document.querySelector("[data-vaul-drawer]") || l();
|
|
1476
|
+
};
|
|
1477
|
+
}, [
|
|
1478
|
+
n,
|
|
1479
|
+
l
|
|
1480
|
+
]), p.useEffect(() => {
|
|
1481
|
+
t || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && m(), n || window.setTimeout(() => {
|
|
1482
|
+
l();
|
|
1483
|
+
}, 500)) : l());
|
|
1484
|
+
}, [
|
|
1485
|
+
e,
|
|
1486
|
+
r,
|
|
1487
|
+
u,
|
|
1488
|
+
n,
|
|
1489
|
+
t,
|
|
1490
|
+
m,
|
|
1491
|
+
l
|
|
1492
|
+
]), {
|
|
1493
|
+
restorePositionSetting: l
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
function Zr({ open: e, onOpenChange: n, children: t, onDrag: r, onRelease: o, snapPoints: a, shouldScaleBackground: u = !1, setBackgroundColorOnScale: i = !0, closeThreshold: f = zr, scrollLockTimeout: m = jr, dismissible: l = !0, handleOnly: s = !1, fadeFromIndex: d = a && a.length - 1, activeSnapPoint: g, setActiveSnapPoint: D, fixed: w, modal: C = !0, onClose: v, nested: x, noBodyStyles: b = !1, direction: h = "bottom", defaultOpen: F = !1, disablePreventScroll: j = !0, snapToSequentialPoint: S = !1, preventScrollRestoration: P = !1, repositionInputs: T = !0, onAnimationEnd: $, container: O, autoFocus: B = !1 }) {
|
|
1497
|
+
var y, H;
|
|
1498
|
+
const [V = !1, K] = tn({
|
|
1499
|
+
defaultProp: F,
|
|
1500
|
+
prop: e,
|
|
1501
|
+
onChange: (E) => {
|
|
1502
|
+
n?.(E), !E && !x && fn(), setTimeout(() => {
|
|
1503
|
+
$?.(E);
|
|
1504
|
+
}, _.DURATION * 1e3), E && !C && typeof window < "u" && window.requestAnimationFrame(() => {
|
|
1505
|
+
document.body.style.pointerEvents = "auto";
|
|
1506
|
+
}), E || (document.body.style.pointerEvents = "auto");
|
|
1507
|
+
}
|
|
1508
|
+
}), [W, Z] = p.useState(!1), [Q, me] = p.useState(!1), [an, ot] = p.useState(!1), ue = p.useRef(null), Oe = p.useRef(null), $e = p.useRef(null), Ue = p.useRef(null), ve = p.useRef(null), he = p.useRef(!1), Be = p.useRef(null), We = p.useRef(0), ce = p.useRef(!1), at = p.useRef(!F), it = p.useRef(0), R = p.useRef(null), st = p.useRef(((y = R.current) == null ? void 0 : y.getBoundingClientRect().height) || 0), ut = p.useRef(((H = R.current) == null ? void 0 : H.getBoundingClientRect().width) || 0), He = p.useRef(0), sn = p.useCallback((E) => {
|
|
1509
|
+
a && E === ge.length - 1 && (Oe.current = /* @__PURE__ */ new Date());
|
|
1510
|
+
}, []), { activeSnapPoint: un, activeSnapPointIndex: le, setActiveSnapPoint: ct, onRelease: cn, snapPointsOffset: ge, onDrag: ln, shouldFade: lt, getPercentageDragged: dn } = Kr({
|
|
1511
|
+
snapPoints: a,
|
|
1512
|
+
activeSnapPointProp: g,
|
|
1513
|
+
setActiveSnapPointProp: D,
|
|
1514
|
+
drawerRef: R,
|
|
1515
|
+
fadeFromIndex: d,
|
|
1516
|
+
overlayRef: ue,
|
|
1517
|
+
onSnapPointChange: sn,
|
|
1518
|
+
direction: h,
|
|
1519
|
+
container: O,
|
|
1520
|
+
snapToSequentialPoint: S
|
|
1521
|
+
});
|
|
1522
|
+
Fr({
|
|
1523
|
+
isDisabled: !V || Q || !C || an || !W || !T || !j
|
|
1524
|
+
});
|
|
1525
|
+
const { restorePositionSetting: fn } = Gr({
|
|
1526
|
+
isOpen: V,
|
|
1527
|
+
modal: C,
|
|
1528
|
+
nested: x ?? !1,
|
|
1529
|
+
hasBeenOpened: W,
|
|
1530
|
+
preventScrollRestoration: P,
|
|
1531
|
+
noBodyStyles: b
|
|
1532
|
+
});
|
|
1533
|
+
function Te() {
|
|
1534
|
+
return (window.innerWidth - Qe) / window.innerWidth;
|
|
1535
|
+
}
|
|
1536
|
+
function pn(E) {
|
|
1537
|
+
var A, M;
|
|
1538
|
+
!l && !a || R.current && !R.current.contains(E.target) || (st.current = ((A = R.current) == null ? void 0 : A.getBoundingClientRect().height) || 0, ut.current = ((M = R.current) == null ? void 0 : M.getBoundingClientRect().width) || 0, me(!0), $e.current = /* @__PURE__ */ new Date(), qt() && window.addEventListener("touchend", () => he.current = !1, {
|
|
1539
|
+
once: !0
|
|
1540
|
+
}), E.target.setPointerCapture(E.pointerId), We.current = k(h) ? E.pageY : E.pageX);
|
|
1541
|
+
}
|
|
1542
|
+
function dt(E, A) {
|
|
1543
|
+
var M;
|
|
1544
|
+
let N = E;
|
|
1545
|
+
const L = (M = window.getSelection()) == null ? void 0 : M.toString(), Y = R.current ? _e(R.current, h) : null, z = /* @__PURE__ */ new Date();
|
|
1546
|
+
if (N.tagName === "SELECT" || N.hasAttribute("data-vaul-no-drag") || N.closest("[data-vaul-no-drag]"))
|
|
1547
|
+
return !1;
|
|
1548
|
+
if (h === "right" || h === "left")
|
|
1549
|
+
return !0;
|
|
1550
|
+
if (Oe.current && z.getTime() - Oe.current.getTime() < 500)
|
|
1551
|
+
return !1;
|
|
1552
|
+
if (Y !== null && (h === "bottom" ? Y > 0 : Y < 0))
|
|
1553
|
+
return !0;
|
|
1554
|
+
if (L && L.length > 0)
|
|
1555
|
+
return !1;
|
|
1556
|
+
if (ve.current && z.getTime() - ve.current.getTime() < m && Y === 0 || A)
|
|
1557
|
+
return ve.current = z, !1;
|
|
1558
|
+
for (; N; ) {
|
|
1559
|
+
if (N.scrollHeight > N.clientHeight) {
|
|
1560
|
+
if (N.scrollTop !== 0)
|
|
1561
|
+
return ve.current = /* @__PURE__ */ new Date(), !1;
|
|
1562
|
+
if (N.getAttribute("role") === "dialog")
|
|
1563
|
+
return !0;
|
|
1564
|
+
}
|
|
1565
|
+
N = N.parentNode;
|
|
1566
|
+
}
|
|
1567
|
+
return !0;
|
|
1568
|
+
}
|
|
1569
|
+
function mn(E) {
|
|
1570
|
+
if (R.current && Q) {
|
|
1571
|
+
const A = h === "bottom" || h === "right" ? 1 : -1, M = (We.current - (k(h) ? E.pageY : E.pageX)) * A, N = M > 0, L = a && !l && !N;
|
|
1572
|
+
if (L && le === 0) return;
|
|
1573
|
+
const Y = Math.abs(M), z = document.querySelector("[data-vaul-drawer-wrapper]"), ee = h === "bottom" || h === "top" ? st.current : ut.current;
|
|
1574
|
+
let q = Y / ee;
|
|
1575
|
+
const oe = dn(Y, N);
|
|
1576
|
+
if (oe !== null && (q = oe), L && q >= 1 || !he.current && !dt(E.target, N)) return;
|
|
1577
|
+
if (R.current.classList.add(Ge), he.current = !0, U(R.current, {
|
|
1578
|
+
transition: "none"
|
|
1579
|
+
}), U(ue.current, {
|
|
1580
|
+
transition: "none"
|
|
1581
|
+
}), a && ln({
|
|
1582
|
+
draggedDistance: M
|
|
1583
|
+
}), N && !a) {
|
|
1584
|
+
const G = Hr(M), Pe = Math.min(G * -1, 0) * A;
|
|
1585
|
+
U(R.current, {
|
|
1586
|
+
transform: k(h) ? `translate3d(0, ${Pe}px, 0)` : `translate3d(${Pe}px, 0, 0)`
|
|
1587
|
+
});
|
|
1588
|
+
return;
|
|
1589
|
+
}
|
|
1590
|
+
const te = 1 - q;
|
|
1591
|
+
if ((lt || d && le === d - 1) && (r?.(E, q), U(ue.current, {
|
|
1592
|
+
opacity: `${te}`,
|
|
1593
|
+
transition: "none"
|
|
1594
|
+
}, !0)), z && ue.current && u) {
|
|
1595
|
+
const G = Math.min(Te() + q * (1 - Te()), 1), Pe = 8 - q * 8, pt = Math.max(0, 14 - q * 14);
|
|
1596
|
+
U(z, {
|
|
1597
|
+
borderRadius: `${Pe}px`,
|
|
1598
|
+
transform: k(h) ? `scale(${G}) translate3d(0, ${pt}px, 0)` : `scale(${G}) translate3d(${pt}px, 0, 0)`,
|
|
1599
|
+
transition: "none"
|
|
1600
|
+
}, !0);
|
|
1601
|
+
}
|
|
1602
|
+
if (!a) {
|
|
1603
|
+
const G = Y * A;
|
|
1604
|
+
U(R.current, {
|
|
1605
|
+
transform: k(h) ? `translate3d(0, ${G}px, 0)` : `translate3d(${G}px, 0, 0)`
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
p.useEffect(() => {
|
|
1611
|
+
window.requestAnimationFrame(() => {
|
|
1612
|
+
at.current = !0;
|
|
1613
|
+
});
|
|
1614
|
+
}, []), p.useEffect(() => {
|
|
1615
|
+
var E;
|
|
1616
|
+
function A() {
|
|
1617
|
+
if (!R.current || !T) return;
|
|
1618
|
+
const M = document.activeElement;
|
|
1619
|
+
if (Je(M) || ce.current) {
|
|
1620
|
+
var N;
|
|
1621
|
+
const L = ((N = window.visualViewport) == null ? void 0 : N.height) || 0, Y = window.innerHeight;
|
|
1622
|
+
let z = Y - L;
|
|
1623
|
+
const ee = R.current.getBoundingClientRect().height || 0, q = ee > Y * 0.8;
|
|
1624
|
+
He.current || (He.current = ee);
|
|
1625
|
+
const oe = R.current.getBoundingClientRect().top;
|
|
1626
|
+
if (Math.abs(it.current - z) > 60 && (ce.current = !ce.current), a && a.length > 0 && ge && le) {
|
|
1627
|
+
const te = ge[le] || 0;
|
|
1628
|
+
z += te;
|
|
1629
|
+
}
|
|
1630
|
+
if (it.current = z, ee > L || ce.current) {
|
|
1631
|
+
const te = R.current.getBoundingClientRect().height;
|
|
1632
|
+
let G = te;
|
|
1633
|
+
te > L && (G = L - (q ? oe : Qe)), w ? R.current.style.height = `${te - Math.max(z, 0)}px` : R.current.style.height = `${Math.max(G, L - oe)}px`;
|
|
1634
|
+
} else Nr() || (R.current.style.height = `${He.current}px`);
|
|
1635
|
+
a && a.length > 0 && !ce.current ? R.current.style.bottom = "0px" : R.current.style.bottom = `${Math.max(z, 0)}px`;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
return (E = window.visualViewport) == null || E.addEventListener("resize", A), () => {
|
|
1639
|
+
var M;
|
|
1640
|
+
return (M = window.visualViewport) == null ? void 0 : M.removeEventListener("resize", A);
|
|
1641
|
+
};
|
|
1642
|
+
}, [
|
|
1643
|
+
le,
|
|
1644
|
+
a,
|
|
1645
|
+
ge
|
|
1646
|
+
]);
|
|
1647
|
+
function we(E) {
|
|
1648
|
+
vn(), v?.(), E || K(!1), setTimeout(() => {
|
|
1649
|
+
a && ct(a[0]);
|
|
1650
|
+
}, _.DURATION * 1e3);
|
|
1651
|
+
}
|
|
1652
|
+
function ft() {
|
|
1653
|
+
if (!R.current) return;
|
|
1654
|
+
const E = document.querySelector("[data-vaul-drawer-wrapper]"), A = _e(R.current, h);
|
|
1655
|
+
U(R.current, {
|
|
1656
|
+
transform: "translate3d(0, 0, 0)",
|
|
1657
|
+
transition: `transform ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`
|
|
1658
|
+
}), U(ue.current, {
|
|
1659
|
+
transition: `opacity ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1660
|
+
opacity: "1"
|
|
1661
|
+
}), u && A && A > 0 && V && U(E, {
|
|
1662
|
+
borderRadius: `${Qt}px`,
|
|
1663
|
+
overflow: "hidden",
|
|
1664
|
+
...k(h) ? {
|
|
1665
|
+
transform: `scale(${Te()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
1666
|
+
transformOrigin: "top"
|
|
1667
|
+
} : {
|
|
1668
|
+
transform: `scale(${Te()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
1669
|
+
transformOrigin: "left"
|
|
1670
|
+
},
|
|
1671
|
+
transitionProperty: "transform, border-radius",
|
|
1672
|
+
transitionDuration: `${_.DURATION}s`,
|
|
1673
|
+
transitionTimingFunction: `cubic-bezier(${_.EASE.join(",")})`
|
|
1674
|
+
}, !0);
|
|
1675
|
+
}
|
|
1676
|
+
function vn() {
|
|
1677
|
+
!Q || !R.current || (R.current.classList.remove(Ge), he.current = !1, me(!1), Ue.current = /* @__PURE__ */ new Date());
|
|
1678
|
+
}
|
|
1679
|
+
function hn(E) {
|
|
1680
|
+
if (!Q || !R.current) return;
|
|
1681
|
+
R.current.classList.remove(Ge), he.current = !1, me(!1), Ue.current = /* @__PURE__ */ new Date();
|
|
1682
|
+
const A = _e(R.current, h);
|
|
1683
|
+
if (!E || !dt(E.target, !1) || !A || Number.isNaN(A) || $e.current === null) return;
|
|
1684
|
+
const M = Ue.current.getTime() - $e.current.getTime(), N = We.current - (k(h) ? E.pageY : E.pageX), L = Math.abs(N) / M;
|
|
1685
|
+
if (L > 0.05 && (ot(!0), setTimeout(() => {
|
|
1686
|
+
ot(!1);
|
|
1687
|
+
}, 200)), a) {
|
|
1688
|
+
cn({
|
|
1689
|
+
draggedDistance: N * (h === "bottom" || h === "right" ? 1 : -1),
|
|
1690
|
+
closeDrawer: we,
|
|
1691
|
+
velocity: L,
|
|
1692
|
+
dismissible: l
|
|
1693
|
+
}), o?.(E, !0);
|
|
1694
|
+
return;
|
|
1695
|
+
}
|
|
1696
|
+
if (h === "bottom" || h === "right" ? N > 0 : N < 0) {
|
|
1697
|
+
ft(), o?.(E, !0);
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
if (L > Jt) {
|
|
1701
|
+
we(), o?.(E, !1);
|
|
1702
|
+
return;
|
|
1703
|
+
}
|
|
1704
|
+
var Y;
|
|
1705
|
+
const z = Math.min((Y = R.current.getBoundingClientRect().height) != null ? Y : 0, window.innerHeight);
|
|
1706
|
+
var ee;
|
|
1707
|
+
const q = Math.min((ee = R.current.getBoundingClientRect().width) != null ? ee : 0, window.innerWidth), oe = h === "left" || h === "right";
|
|
1708
|
+
if (Math.abs(A) >= (oe ? q : z) * f) {
|
|
1709
|
+
we(), o?.(E, !1);
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
o?.(E, !0), ft();
|
|
1713
|
+
}
|
|
1714
|
+
p.useEffect(() => (V && (U(document.documentElement, {
|
|
1715
|
+
scrollBehavior: "auto"
|
|
1716
|
+
}), Oe.current = /* @__PURE__ */ new Date()), () => {
|
|
1717
|
+
Wr(document.documentElement, "scrollBehavior");
|
|
1718
|
+
}), [
|
|
1719
|
+
V
|
|
1720
|
+
]);
|
|
1721
|
+
function gn(E) {
|
|
1722
|
+
const A = E ? (window.innerWidth - ie) / window.innerWidth : 1, M = E ? -ie : 0;
|
|
1723
|
+
Be.current && window.clearTimeout(Be.current), U(R.current, {
|
|
1724
|
+
transition: `transform ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1725
|
+
transform: k(h) ? `scale(${A}) translate3d(0, ${M}px, 0)` : `scale(${A}) translate3d(${M}px, 0, 0)`
|
|
1726
|
+
}), !E && R.current && (Be.current = setTimeout(() => {
|
|
1727
|
+
const N = _e(R.current, h);
|
|
1728
|
+
U(R.current, {
|
|
1729
|
+
transition: "none",
|
|
1730
|
+
transform: k(h) ? `translate3d(0, ${N}px, 0)` : `translate3d(${N}px, 0, 0)`
|
|
1731
|
+
});
|
|
1732
|
+
}, 500));
|
|
1733
|
+
}
|
|
1734
|
+
function wn(E, A) {
|
|
1735
|
+
if (A < 0) return;
|
|
1736
|
+
const M = (window.innerWidth - ie) / window.innerWidth, N = M + A * (1 - M), L = -ie + A * ie;
|
|
1737
|
+
U(R.current, {
|
|
1738
|
+
transform: k(h) ? `scale(${N}) translate3d(0, ${L}px, 0)` : `scale(${N}) translate3d(${L}px, 0, 0)`,
|
|
1739
|
+
transition: "none"
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
function yn(E, A) {
|
|
1743
|
+
const M = k(h) ? window.innerHeight : window.innerWidth, N = A ? (M - ie) / M : 1, L = A ? -ie : 0;
|
|
1744
|
+
A && U(R.current, {
|
|
1745
|
+
transition: `transform ${_.DURATION}s cubic-bezier(${_.EASE.join(",")})`,
|
|
1746
|
+
transform: k(h) ? `scale(${N}) translate3d(0, ${L}px, 0)` : `scale(${N}) translate3d(${L}px, 0, 0)`
|
|
1747
|
+
});
|
|
1748
|
+
}
|
|
1749
|
+
return p.useEffect(() => {
|
|
1750
|
+
C || window.requestAnimationFrame(() => {
|
|
1751
|
+
document.body.style.pointerEvents = "auto";
|
|
1752
|
+
});
|
|
1753
|
+
}, [
|
|
1754
|
+
C
|
|
1755
|
+
]), /* @__PURE__ */ p.createElement(kt, {
|
|
1756
|
+
defaultOpen: F,
|
|
1757
|
+
onOpenChange: (E) => {
|
|
1758
|
+
!l && !E || (E ? Z(!0) : we(!0), K(E));
|
|
1759
|
+
},
|
|
1760
|
+
open: V
|
|
1761
|
+
}, /* @__PURE__ */ p.createElement(Kt.Provider, {
|
|
1762
|
+
value: {
|
|
1763
|
+
activeSnapPoint: un,
|
|
1764
|
+
snapPoints: a,
|
|
1765
|
+
setActiveSnapPoint: ct,
|
|
1766
|
+
drawerRef: R,
|
|
1767
|
+
overlayRef: ue,
|
|
1768
|
+
onOpenChange: n,
|
|
1769
|
+
onPress: pn,
|
|
1770
|
+
onRelease: hn,
|
|
1771
|
+
onDrag: mn,
|
|
1772
|
+
dismissible: l,
|
|
1773
|
+
shouldAnimate: at,
|
|
1774
|
+
handleOnly: s,
|
|
1775
|
+
isOpen: V,
|
|
1776
|
+
isDragging: Q,
|
|
1777
|
+
shouldFade: lt,
|
|
1778
|
+
closeDrawer: we,
|
|
1779
|
+
onNestedDrag: wn,
|
|
1780
|
+
onNestedOpenChange: gn,
|
|
1781
|
+
onNestedRelease: yn,
|
|
1782
|
+
keyboardIsOpen: ce,
|
|
1783
|
+
modal: C,
|
|
1784
|
+
snapPointsOffset: ge,
|
|
1785
|
+
activeSnapPointIndex: le,
|
|
1786
|
+
direction: h,
|
|
1787
|
+
shouldScaleBackground: u,
|
|
1788
|
+
setBackgroundColorOnScale: i,
|
|
1789
|
+
noBodyStyles: b,
|
|
1790
|
+
container: O,
|
|
1791
|
+
autoFocus: B
|
|
1792
|
+
}
|
|
1793
|
+
}, t));
|
|
1794
|
+
}
|
|
1795
|
+
const nn = /* @__PURE__ */ p.forwardRef(function({ ...e }, n) {
|
|
1796
|
+
const { overlayRef: t, snapPoints: r, onRelease: o, shouldFade: a, isOpen: u, modal: i, shouldAnimate: f } = Ce(), m = Gt(n, t), l = r && r.length > 0;
|
|
1797
|
+
if (!i)
|
|
1798
|
+
return null;
|
|
1799
|
+
const s = p.useCallback((d) => o(d), [
|
|
1800
|
+
o
|
|
1801
|
+
]);
|
|
1802
|
+
return /* @__PURE__ */ p.createElement(Wt, {
|
|
1803
|
+
onMouseUp: s,
|
|
1804
|
+
ref: m,
|
|
1805
|
+
"data-vaul-overlay": "",
|
|
1806
|
+
"data-vaul-snap-points": u && l ? "true" : "false",
|
|
1807
|
+
"data-vaul-snap-points-overlay": u && a ? "true" : "false",
|
|
1808
|
+
"data-vaul-animate": f?.current ? "true" : "false",
|
|
1809
|
+
...e
|
|
1810
|
+
});
|
|
1811
|
+
});
|
|
1812
|
+
nn.displayName = "Drawer.Overlay";
|
|
1813
|
+
const rn = /* @__PURE__ */ p.forwardRef(function({ onPointerDownOutside: e, style: n, onOpenAutoFocus: t, ...r }, o) {
|
|
1814
|
+
const { drawerRef: a, onPress: u, onRelease: i, onDrag: f, keyboardIsOpen: m, snapPointsOffset: l, activeSnapPointIndex: s, modal: d, isOpen: g, direction: D, snapPoints: w, container: C, handleOnly: v, shouldAnimate: x, autoFocus: b } = Ce(), [h, F] = p.useState(!1), j = Gt(o, a), S = p.useRef(null), P = p.useRef(null), T = p.useRef(!1), $ = w && w.length > 0;
|
|
1815
|
+
Xr();
|
|
1816
|
+
const O = (y, H, V = 0) => {
|
|
1817
|
+
if (T.current) return !0;
|
|
1818
|
+
const K = Math.abs(y.y), W = Math.abs(y.x), Z = W > K, Q = [
|
|
1819
|
+
"bottom",
|
|
1820
|
+
"right"
|
|
1821
|
+
].includes(H) ? 1 : -1;
|
|
1822
|
+
if (H === "left" || H === "right") {
|
|
1823
|
+
if (!(y.x * Q < 0) && W >= 0 && W <= V)
|
|
1824
|
+
return Z;
|
|
1825
|
+
} else if (!(y.y * Q < 0) && K >= 0 && K <= V)
|
|
1826
|
+
return !Z;
|
|
1827
|
+
return T.current = !0, !0;
|
|
1828
|
+
};
|
|
1829
|
+
p.useEffect(() => {
|
|
1830
|
+
$ && window.requestAnimationFrame(() => {
|
|
1831
|
+
F(!0);
|
|
1832
|
+
});
|
|
1833
|
+
}, []);
|
|
1834
|
+
function B(y) {
|
|
1835
|
+
S.current = null, T.current = !1, i(y);
|
|
1836
|
+
}
|
|
1837
|
+
return /* @__PURE__ */ p.createElement(Ht, {
|
|
1838
|
+
"data-vaul-drawer-direction": D,
|
|
1839
|
+
"data-vaul-drawer": "",
|
|
1840
|
+
"data-vaul-delayed-snap-points": h ? "true" : "false",
|
|
1841
|
+
"data-vaul-snap-points": g && $ ? "true" : "false",
|
|
1842
|
+
"data-vaul-custom-container": C ? "true" : "false",
|
|
1843
|
+
"data-vaul-animate": x?.current ? "true" : "false",
|
|
1844
|
+
...r,
|
|
1845
|
+
ref: j,
|
|
1846
|
+
style: l && l.length > 0 ? {
|
|
1847
|
+
"--snap-point-height": `${l[s ?? 0]}px`,
|
|
1848
|
+
...n
|
|
1849
|
+
} : n,
|
|
1850
|
+
onPointerDown: (y) => {
|
|
1851
|
+
v || (r.onPointerDown == null || r.onPointerDown.call(r, y), S.current = {
|
|
1852
|
+
x: y.pageX,
|
|
1853
|
+
y: y.pageY
|
|
1854
|
+
}, u(y));
|
|
1855
|
+
},
|
|
1856
|
+
onOpenAutoFocus: (y) => {
|
|
1857
|
+
t?.(y), b || y.preventDefault();
|
|
1858
|
+
},
|
|
1859
|
+
onPointerDownOutside: (y) => {
|
|
1860
|
+
if (e?.(y), !d || y.defaultPrevented) {
|
|
1861
|
+
y.preventDefault();
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
m.current && (m.current = !1);
|
|
1865
|
+
},
|
|
1866
|
+
onFocusOutside: (y) => {
|
|
1867
|
+
if (!d) {
|
|
1868
|
+
y.preventDefault();
|
|
1869
|
+
return;
|
|
1870
|
+
}
|
|
1871
|
+
},
|
|
1872
|
+
onPointerMove: (y) => {
|
|
1873
|
+
if (P.current = y, v || (r.onPointerMove == null || r.onPointerMove.call(r, y), !S.current)) return;
|
|
1874
|
+
const H = y.pageY - S.current.y, V = y.pageX - S.current.x, K = y.pointerType === "touch" ? 10 : 2;
|
|
1875
|
+
O({
|
|
1876
|
+
x: V,
|
|
1877
|
+
y: H
|
|
1878
|
+
}, D, K) ? f(y) : (Math.abs(V) > K || Math.abs(H) > K) && (S.current = null);
|
|
1879
|
+
},
|
|
1880
|
+
onPointerUp: (y) => {
|
|
1881
|
+
r.onPointerUp == null || r.onPointerUp.call(r, y), S.current = null, T.current = !1, i(y);
|
|
1882
|
+
},
|
|
1883
|
+
onPointerOut: (y) => {
|
|
1884
|
+
r.onPointerOut == null || r.onPointerOut.call(r, y), B(P.current);
|
|
1885
|
+
},
|
|
1886
|
+
onContextMenu: (y) => {
|
|
1887
|
+
r.onContextMenu == null || r.onContextMenu.call(r, y), P.current && B(P.current);
|
|
1888
|
+
}
|
|
1889
|
+
});
|
|
1890
|
+
});
|
|
1891
|
+
rn.displayName = "Drawer.Content";
|
|
1892
|
+
const Jr = 250, Qr = 120, on = /* @__PURE__ */ p.forwardRef(function({ preventCycle: e = !1, children: n, ...t }, r) {
|
|
1893
|
+
const { closeDrawer: o, isDragging: a, snapPoints: u, activeSnapPoint: i, setActiveSnapPoint: f, dismissible: m, handleOnly: l, isOpen: s, onPress: d, onDrag: g } = Ce(), D = p.useRef(null), w = p.useRef(!1);
|
|
1894
|
+
function C() {
|
|
1895
|
+
if (w.current) {
|
|
1896
|
+
b();
|
|
1897
|
+
return;
|
|
1898
|
+
}
|
|
1899
|
+
window.setTimeout(() => {
|
|
1900
|
+
v();
|
|
1901
|
+
}, Qr);
|
|
1902
|
+
}
|
|
1903
|
+
function v() {
|
|
1904
|
+
if (a || e || w.current) {
|
|
1905
|
+
b();
|
|
1906
|
+
return;
|
|
1907
|
+
}
|
|
1908
|
+
if (b(), !u || u.length === 0) {
|
|
1909
|
+
m || o();
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
if (i === u[u.length - 1] && m) {
|
|
1913
|
+
o();
|
|
1914
|
+
return;
|
|
1915
|
+
}
|
|
1916
|
+
const F = u.findIndex((S) => S === i);
|
|
1917
|
+
if (F === -1) return;
|
|
1918
|
+
const j = u[F + 1];
|
|
1919
|
+
f(j);
|
|
1920
|
+
}
|
|
1921
|
+
function x() {
|
|
1922
|
+
D.current = window.setTimeout(() => {
|
|
1923
|
+
w.current = !0;
|
|
1924
|
+
}, Jr);
|
|
1925
|
+
}
|
|
1926
|
+
function b() {
|
|
1927
|
+
D.current && window.clearTimeout(D.current), w.current = !1;
|
|
1928
|
+
}
|
|
1929
|
+
return /* @__PURE__ */ p.createElement("div", {
|
|
1930
|
+
onClick: C,
|
|
1931
|
+
onPointerCancel: b,
|
|
1932
|
+
onPointerDown: (h) => {
|
|
1933
|
+
l && d(h), x();
|
|
1934
|
+
},
|
|
1935
|
+
onPointerMove: (h) => {
|
|
1936
|
+
l && g(h);
|
|
1937
|
+
},
|
|
1938
|
+
// onPointerUp is already handled by the content component
|
|
1939
|
+
ref: r,
|
|
1940
|
+
"data-vaul-drawer-visible": s ? "true" : "false",
|
|
1941
|
+
"data-vaul-handle": "",
|
|
1942
|
+
"aria-hidden": "true",
|
|
1943
|
+
...t
|
|
1944
|
+
}, /* @__PURE__ */ p.createElement("span", {
|
|
1945
|
+
"data-vaul-handle-hitarea": "",
|
|
1946
|
+
"aria-hidden": "true"
|
|
1947
|
+
}, n));
|
|
1948
|
+
});
|
|
1949
|
+
on.displayName = "Drawer.Handle";
|
|
1950
|
+
function eo(e) {
|
|
1951
|
+
const n = Ce(), { container: t = n.container, ...r } = e;
|
|
1952
|
+
return /* @__PURE__ */ p.createElement(Bt, {
|
|
1953
|
+
container: t,
|
|
1954
|
+
...r
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
const De = {
|
|
1958
|
+
Root: Zr,
|
|
1959
|
+
Content: rn,
|
|
1960
|
+
Overlay: nn,
|
|
1961
|
+
Portal: eo,
|
|
1962
|
+
Handle: on
|
|
1963
|
+
}, ao = ({
|
|
1964
|
+
isOpen: e,
|
|
1965
|
+
onClose: n,
|
|
1966
|
+
borderRadius: t = 0,
|
|
1967
|
+
children: r,
|
|
1968
|
+
drawerHeight: o = "fit-content"
|
|
1969
|
+
}) => {
|
|
1970
|
+
const a = o === "fit-content" ? [] : [0.6, 1], [u, i] = Sn(a[0]), f = o === "fit-content" ? {
|
|
1971
|
+
open: e,
|
|
1972
|
+
onClose: n
|
|
1973
|
+
} : {
|
|
1974
|
+
open: e,
|
|
1975
|
+
onClose: n,
|
|
1976
|
+
snapPoints: a,
|
|
1977
|
+
activeSnapPoint: u,
|
|
1978
|
+
setActiveSnapPoint: i,
|
|
1979
|
+
fadeFromIndex: 0
|
|
1980
|
+
};
|
|
1981
|
+
return /* @__PURE__ */ ae(De.Root, { ...f, children: [
|
|
1982
|
+
/* @__PURE__ */ ae(De.Overlay, { className: "fixed inset-0 bg-[#27272ab3]" }, void 0, !1, {
|
|
1983
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
1984
|
+
lineNumber: 39,
|
|
1985
|
+
columnNumber: 7
|
|
1986
|
+
}, void 0),
|
|
1987
|
+
/* @__PURE__ */ ae(De.Portal, { children: /* @__PURE__ */ ae(
|
|
1988
|
+
De.Content,
|
|
1989
|
+
{
|
|
1990
|
+
style: { borderTopLeftRadius: t, borderTopRightRadius: t },
|
|
1991
|
+
className: "fixed bg-content-1 border border-[#11111126] border-b-none bottom-0 left-0 right-0 max-h-screen",
|
|
1992
|
+
children: [
|
|
1993
|
+
o === "full-height" && /* @__PURE__ */ ae("div", { className: "h-11", children: /* @__PURE__ */ ae(De.Handle, { className: "top-4" }, void 0, !1, {
|
|
1994
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
1995
|
+
lineNumber: 47,
|
|
1996
|
+
columnNumber: 15
|
|
1997
|
+
}, void 0) }, void 0, !1, {
|
|
1998
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
1999
|
+
lineNumber: 46,
|
|
2000
|
+
columnNumber: 13
|
|
2001
|
+
}, void 0),
|
|
2002
|
+
/* @__PURE__ */ ae("div", { className: `h-full max-h-screen ${o === "fit-content" || u === 1 ? "overflow-auto" : "overflow-hidden"}`, children: r }, void 0, !1, {
|
|
2003
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
2004
|
+
lineNumber: 50,
|
|
2005
|
+
columnNumber: 11
|
|
2006
|
+
}, void 0)
|
|
2007
|
+
]
|
|
2008
|
+
},
|
|
2009
|
+
void 0,
|
|
2010
|
+
!0,
|
|
2011
|
+
{
|
|
2012
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
2013
|
+
lineNumber: 41,
|
|
2014
|
+
columnNumber: 9
|
|
2015
|
+
},
|
|
2016
|
+
void 0
|
|
2017
|
+
) }, void 0, !1, {
|
|
2018
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
2019
|
+
lineNumber: 40,
|
|
2020
|
+
columnNumber: 7
|
|
2021
|
+
}, void 0)
|
|
2022
|
+
] }, void 0, !0, {
|
|
2023
|
+
fileName: "C:/Users/asus/Desktop/AghsatMarket/shared-assets/src/overlays/Drawer.tsx",
|
|
2024
|
+
lineNumber: 38,
|
|
2025
|
+
columnNumber: 5
|
|
2026
|
+
}, void 0);
|
|
2027
|
+
};
|
|
2028
|
+
export {
|
|
2029
|
+
ao as Drawer
|
|
2030
|
+
};
|