@pfct/purple 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +2 -2
- package/dist/chunks/Accordion.CxDfMzK1.js +1 -0
- package/dist/chunks/{Accordion.BiAAJwmC.js → Accordion.D8caFIuT.js} +3 -2
- package/dist/chunks/{Divider.k5ROyG2W.js → Divider.CinbGPsa.js} +1 -1
- package/dist/chunks/{Divider.CfGqsPOG.js → Divider.KzhgrMYv.js} +1 -1
- package/dist/chunks/{Switch.clBBQjY3.js → Switch.2ZixJdlG.js} +1 -1
- package/dist/chunks/{Switch.G7d5HjrW.js → Switch.Cf71RNLF.js} +2 -2
- package/dist/chunks/{bottomSheet.CbP1N3-g.js → bottomSheet.B5OrcCXx.js} +1 -1
- package/dist/chunks/{bottomSheet.BHvPqq91.js → bottomSheet.CnYVp9RP.js} +1 -1
- package/dist/chunks/{checkbox.DzMsJDRY.js → checkbox.CYGNBSUO.js} +1 -1
- package/dist/chunks/{checkbox.DjHLBzFe.js → checkbox.Dzvj-4RV.js} +2 -2
- package/dist/chunks/{dist.BbBE9J18.js → dist.6jgaVidM.js} +8 -7
- package/dist/chunks/dist.BixLWWwb.js +71 -0
- package/dist/chunks/dist.BoEBrFAh.js +1 -0
- package/dist/chunks/dist.C4D-6Tcr.js +1 -0
- package/dist/chunks/{dist.D_s4kUUr.js → dist.CDZCWPu4.js} +1 -1
- package/dist/chunks/{dist.COetszRA.js → dist.CJY8LqRA.js} +1 -1
- package/dist/chunks/dist.CT8nUj9V.js +1 -0
- package/dist/chunks/{dist.Cz5xL5vI.js → dist.CpTw9rlm.js} +1 -1
- package/dist/chunks/dist.Crl6KTg_.js +21 -0
- package/dist/chunks/dist.CwWM0zXK.js +25 -0
- package/dist/chunks/dist.DPo6XlLq.js +145 -0
- package/dist/chunks/dist.DTByVKhF.js +193 -0
- package/dist/chunks/dist.Ds9VPbBd.js +194 -0
- package/dist/chunks/dist.DvmdOncE.js +1 -0
- package/dist/chunks/dist.ERrpPEZ4.js +1 -0
- package/dist/chunks/dist.OINbhiqU.js +1 -0
- package/dist/chunks/dist.Xtc44Blp.js +1 -0
- package/dist/chunks/dist.mhQdJ8f2.js +170 -0
- package/dist/chunks/drawer.BewJ2D_w.js +1545 -0
- package/dist/chunks/drawer.Cty9wtvs.js +7 -0
- package/dist/chunks/es2015.ByVyszJo.js +562 -0
- package/dist/chunks/es2015.DoCbPEnP.js +41 -0
- package/dist/chunks/tooltip.Dv33hiJ0.js +1 -0
- package/dist/chunks/{tooltip.Bh_x0SaP.js → tooltip.w3pAhl4A.js} +5 -4
- package/dist/components/Accordion/index.cjs.js +1 -1
- package/dist/components/Accordion/index.esm.js +1 -1
- package/dist/components/Control/Switch/index.cjs.js +1 -1
- package/dist/components/Control/Switch/index.esm.js +1 -1
- package/dist/components/Control/index.cjs.js +1 -1
- package/dist/components/Control/index.esm.js +2 -2
- package/dist/components/DatePicker/RangeDatePickerModal/index.cjs.js +1 -1
- package/dist/components/DatePicker/RangeDatePickerModal/index.esm.js +1 -1
- package/dist/components/DatePicker/SingleDatePickerModal/index.cjs.js +1 -1
- package/dist/components/DatePicker/SingleDatePickerModal/index.esm.js +1 -1
- package/dist/components/Divider/index.cjs.js +1 -1
- package/dist/components/Divider/index.esm.js +1 -1
- package/dist/components/LegacyModal/index.cjs.js +1 -1
- package/dist/components/LegacyModal/index.esm.js +4 -4
- package/dist/components/MiniButton/IconMiniButton/index.cjs.js +1 -1
- package/dist/components/MiniButton/IconMiniButton/index.esm.js +1 -1
- package/dist/components/MiniButton/UnderLineMiniButton/index.cjs.js +1 -1
- package/dist/components/MiniButton/UnderLineMiniButton/index.esm.js +1 -1
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.esm.js +10 -10
- package/dist/components/Pagination/index.cjs.js +1 -1
- package/dist/components/Pagination/index.esm.js +1 -1
- package/dist/components/SelectBox/index.cjs.js +1 -1
- package/dist/components/SelectBox/index.d.ts +6 -0
- package/dist/components/SelectBox/index.d.ts.map +1 -1
- package/dist/components/SelectBox/index.esm.js +42 -70
- package/dist/components/Tag/index.cjs.js +1 -1
- package/dist/components/Tag/index.esm.js +1 -1
- package/dist/components/Terms/index.cjs.js +1 -1
- package/dist/components/Terms/index.esm.js +3 -3
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.esm.js +16 -15
- package/dist/components/ui/bottomSheet.cjs.js +1 -1
- package/dist/components/ui/bottomSheet.esm.js +1 -1
- package/dist/components/ui/button.cjs.js +1 -1
- package/dist/components/ui/button.esm.js +1 -1
- package/dist/components/ui/checkbox.cjs.js +1 -1
- package/dist/components/ui/checkbox.esm.js +1 -1
- package/dist/components/ui/dialog.cjs.js +1 -1
- package/dist/components/ui/dialog.esm.js +10 -10
- package/dist/components/ui/drawer.cjs.js +1 -1
- package/dist/components/ui/drawer.esm.js +1 -1
- package/dist/components/ui/impact-tooltip.cjs.js +1 -1
- package/dist/components/ui/impact-tooltip.esm.js +83 -2
- package/dist/components/ui/select.cjs.js +1 -0
- package/dist/components/ui/select.d.ts +52 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.esm.js +182 -0
- package/dist/components/ui/tooltip.cjs.js +1 -1
- package/dist/components/ui/tooltip.esm.js +1 -1
- package/dist/components/ui/typography.cjs.js +1 -1
- package/dist/components/ui/typography.esm.js +1 -1
- package/dist/icons/src/aliases/prefixed.d.ts +2 -2
- package/dist/icons/src/aliases/prefixed.d.ts.map +1 -1
- package/dist/icons/src/aliases/suffixed.d.ts +3 -3
- package/dist/icons/src/aliases/suffixed.d.ts.map +1 -1
- package/dist/icons/src/icons/index.d.ts +1 -1
- package/dist/icons/src/icons/index.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +19 -18
- package/dist/library/List/BottomSheetItemList/index.cjs.js +1 -1
- package/dist/library/List/BottomSheetItemList/index.esm.js +1 -1
- package/package.json +5 -5
- package/dist/chunks/Accordion.ClCq_Ey8.js +0 -1
- package/dist/chunks/dist.CbqoUpiO.js +0 -5
- package/dist/chunks/dist.CrnGARhp.js +0 -1
- package/dist/chunks/dist.DXWLF1yO.js +0 -137
- package/dist/chunks/dist.DxuGUd9a.js +0 -93
- package/dist/chunks/dist.eT0KQJF1.js +0 -1
- package/dist/chunks/dist.o_suB-Ao.js +0 -217
- package/dist/chunks/drawer.CsTGeQfm.js +0 -987
- package/dist/chunks/drawer.Dl1NBBot.js +0 -3
- package/dist/chunks/es2015.DT_gWqJq.js +0 -705
- package/dist/chunks/es2015.YOXqRYz1.js +0 -41
- package/dist/chunks/impact-tooltip.CqzKZc1i.js +0 -268
- package/dist/chunks/impact-tooltip.MXdAL7_2.js +0 -1
- package/dist/chunks/tooltip.DXsV-PA7.js +0 -1
|
@@ -0,0 +1,1545 @@
|
|
|
1
|
+
import { a as e, i as t, n, r, t as i } from "./dist.CzNkwCpH.js";
|
|
2
|
+
import { t as a } from "./dist.CwWM0zXK.js";
|
|
3
|
+
import { t as o } from "./dist.Ct4Usz2n.js";
|
|
4
|
+
import { t as s } from "./dist.Cfck23KY.js";
|
|
5
|
+
import { t as c } from "./utils.D6DjRYW1.js";
|
|
6
|
+
import { n as l, t as u } from "./dist.Crl6KTg_.js";
|
|
7
|
+
import { n as d, r as f, t as p } from "./es2015.ByVyszJo.js";
|
|
8
|
+
import * as m from "react";
|
|
9
|
+
import h, { useEffect as g, useLayoutEffect as _, useMemo as v } from "react";
|
|
10
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
11
|
+
import * as S from "react-dom";
|
|
12
|
+
//#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
13
|
+
// @__NO_SIDE_EFFECTS__
|
|
14
|
+
function C(e) {
|
|
15
|
+
let t = m.forwardRef((t, n) => {
|
|
16
|
+
let { children: r, ...i } = t, o = null, s = !1, c = [];
|
|
17
|
+
O(r) && typeof k == "function" && (r = k(r._payload)), m.Children.forEach(r, (e) => {
|
|
18
|
+
if (ee(e)) {
|
|
19
|
+
s = !0;
|
|
20
|
+
let t = e, n = "child" in t.props ? t.props.child : t.props.children;
|
|
21
|
+
O(n) && typeof k == "function" && (n = k(n._payload)), o = T(t, n), c.push(o?.props?.children);
|
|
22
|
+
} else c.push(e);
|
|
23
|
+
}), o ? o = m.cloneElement(o, void 0, c) : !s && m.Children.count(r) === 1 && m.isValidElement(r) && (o = r);
|
|
24
|
+
let l = o ? D(o) : void 0, u = a(n, l);
|
|
25
|
+
if (!o) {
|
|
26
|
+
if (r || r === 0) throw Error(s ? ie(e) : re(e));
|
|
27
|
+
return r;
|
|
28
|
+
}
|
|
29
|
+
let d = E(i, o.props ?? {});
|
|
30
|
+
return o.type !== m.Fragment && (d.ref = n ? u : l), m.cloneElement(o, d);
|
|
31
|
+
});
|
|
32
|
+
return t.displayName = `${e}.Slot`, t;
|
|
33
|
+
}
|
|
34
|
+
var w = Symbol.for("radix.slottable"), T = (e, t) => {
|
|
35
|
+
if ("child" in e.props) {
|
|
36
|
+
let t = e.props.child;
|
|
37
|
+
return m.isValidElement(t) ? m.cloneElement(t, void 0, e.props.children(t.props.children)) : null;
|
|
38
|
+
}
|
|
39
|
+
return m.isValidElement(t) ? t : null;
|
|
40
|
+
};
|
|
41
|
+
function E(e, t) {
|
|
42
|
+
let n = { ...t };
|
|
43
|
+
for (let r in t) {
|
|
44
|
+
let i = e[r], a = t[r];
|
|
45
|
+
/^on[A-Z]/.test(r) ? i && a ? n[r] = (...e) => {
|
|
46
|
+
let t = a(...e);
|
|
47
|
+
return i(...e), t;
|
|
48
|
+
} : i && (n[r] = i) : r === "style" ? n[r] = {
|
|
49
|
+
...i,
|
|
50
|
+
...a
|
|
51
|
+
} : r === "className" && (n[r] = [i, a].filter(Boolean).join(" "));
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
...e,
|
|
55
|
+
...n
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function D(e) {
|
|
59
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
60
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
61
|
+
}
|
|
62
|
+
function ee(e) {
|
|
63
|
+
return m.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === w;
|
|
64
|
+
}
|
|
65
|
+
var te = Symbol.for("react.lazy");
|
|
66
|
+
function O(e) {
|
|
67
|
+
return typeof e == "object" && !!e && "$$typeof" in e && e.$$typeof === te && "_payload" in e && ne(e._payload);
|
|
68
|
+
}
|
|
69
|
+
function ne(e) {
|
|
70
|
+
return typeof e == "object" && !!e && "then" in e;
|
|
71
|
+
}
|
|
72
|
+
var re = (e) => `${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`, ie = (e) => `${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`, k = m.use, A = [
|
|
73
|
+
"a",
|
|
74
|
+
"button",
|
|
75
|
+
"div",
|
|
76
|
+
"form",
|
|
77
|
+
"h2",
|
|
78
|
+
"h3",
|
|
79
|
+
"img",
|
|
80
|
+
"input",
|
|
81
|
+
"label",
|
|
82
|
+
"li",
|
|
83
|
+
"nav",
|
|
84
|
+
"ol",
|
|
85
|
+
"p",
|
|
86
|
+
"select",
|
|
87
|
+
"span",
|
|
88
|
+
"svg",
|
|
89
|
+
"ul"
|
|
90
|
+
].reduce((e, t) => {
|
|
91
|
+
let n = /* @__PURE__ */ C(`Primitive.${t}`), r = m.forwardRef((e, r) => {
|
|
92
|
+
let { asChild: i, ...a } = e, o = i ? n : t;
|
|
93
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ b(o, {
|
|
94
|
+
...a,
|
|
95
|
+
ref: r
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
return r.displayName = `Primitive.${t}`, {
|
|
99
|
+
...e,
|
|
100
|
+
[t]: r
|
|
101
|
+
};
|
|
102
|
+
}, {});
|
|
103
|
+
function ae(e, t) {
|
|
104
|
+
e && S.flushSync(() => e.dispatchEvent(t));
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
107
|
+
//#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
108
|
+
var oe = "DismissableLayer", j = "dismissableLayer.update", M = "dismissableLayer.pointerDownOutside", se = "dismissableLayer.focusOutside", N, P = m.createContext({
|
|
109
|
+
layers: /* @__PURE__ */ new Set(),
|
|
110
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
111
|
+
branches: /* @__PURE__ */ new Set()
|
|
112
|
+
}), F = m.forwardRef((e, t) => {
|
|
113
|
+
let { disableOutsidePointerEvents: n = !1, onEscapeKeyDown: i, onPointerDownOutside: o, onFocusOutside: s, onInteractOutside: c, onDismiss: l, ...d } = e, f = m.useContext(P), [p, h] = m.useState(null), g = p?.ownerDocument ?? globalThis?.document, [, _] = m.useState({}), v = a(t, (e) => h(e)), y = Array.from(f.layers), [x] = [...f.layersWithOutsidePointerEventsDisabled].slice(-1), S = y.indexOf(x), C = p ? y.indexOf(p) : -1, w = f.layersWithOutsidePointerEventsDisabled.size > 0, T = C >= S, E = I((e) => {
|
|
114
|
+
let t = e.target, n = [...f.branches].some((e) => e.contains(t));
|
|
115
|
+
!T || n || (o?.(e), c?.(e), e.defaultPrevented || l?.());
|
|
116
|
+
}, g), D = ue((e) => {
|
|
117
|
+
let t = e.target;
|
|
118
|
+
[...f.branches].some((e) => e.contains(t)) || (s?.(e), c?.(e), e.defaultPrevented || l?.());
|
|
119
|
+
}, g);
|
|
120
|
+
return u((e) => {
|
|
121
|
+
C === f.layers.size - 1 && (i?.(e), !e.defaultPrevented && l && (e.preventDefault(), l()));
|
|
122
|
+
}, g), m.useEffect(() => {
|
|
123
|
+
if (p) return n && (f.layersWithOutsidePointerEventsDisabled.size === 0 && (N = g.body.style.pointerEvents, g.body.style.pointerEvents = "none"), f.layersWithOutsidePointerEventsDisabled.add(p)), f.layers.add(p), de(), () => {
|
|
124
|
+
n && (f.layersWithOutsidePointerEventsDisabled.delete(p), f.layersWithOutsidePointerEventsDisabled.size === 0 && (g.body.style.pointerEvents = N));
|
|
125
|
+
};
|
|
126
|
+
}, [
|
|
127
|
+
p,
|
|
128
|
+
g,
|
|
129
|
+
n,
|
|
130
|
+
f
|
|
131
|
+
]), m.useEffect(() => () => {
|
|
132
|
+
p && (f.layers.delete(p), f.layersWithOutsidePointerEventsDisabled.delete(p), de());
|
|
133
|
+
}, [p, f]), m.useEffect(() => {
|
|
134
|
+
let e = () => _({});
|
|
135
|
+
return document.addEventListener(j, e), () => document.removeEventListener(j, e);
|
|
136
|
+
}, []), /* @__PURE__ */ b(A.div, {
|
|
137
|
+
...d,
|
|
138
|
+
ref: v,
|
|
139
|
+
style: {
|
|
140
|
+
pointerEvents: w ? T ? "auto" : "none" : void 0,
|
|
141
|
+
...e.style
|
|
142
|
+
},
|
|
143
|
+
onFocusCapture: r(e.onFocusCapture, D.onFocusCapture),
|
|
144
|
+
onBlurCapture: r(e.onBlurCapture, D.onBlurCapture),
|
|
145
|
+
onPointerDownCapture: r(e.onPointerDownCapture, E.onPointerDownCapture)
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
F.displayName = oe;
|
|
149
|
+
var ce = "DismissableLayerBranch", le = m.forwardRef((e, t) => {
|
|
150
|
+
let n = m.useContext(P), r = m.useRef(null), i = a(t, r);
|
|
151
|
+
return m.useEffect(() => {
|
|
152
|
+
let e = r.current;
|
|
153
|
+
if (e) return n.branches.add(e), () => {
|
|
154
|
+
n.branches.delete(e);
|
|
155
|
+
};
|
|
156
|
+
}, [n.branches]), /* @__PURE__ */ b(A.div, {
|
|
157
|
+
...e,
|
|
158
|
+
ref: i
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
le.displayName = ce;
|
|
162
|
+
function I(e, t = globalThis?.document) {
|
|
163
|
+
let n = l(e), r = m.useRef(!1), i = m.useRef(() => {});
|
|
164
|
+
return m.useEffect(() => {
|
|
165
|
+
let e = (e) => {
|
|
166
|
+
if (e.target && !r.current) {
|
|
167
|
+
let r = function() {
|
|
168
|
+
L(M, n, a, { discrete: !0 });
|
|
169
|
+
}, a = { originalEvent: e };
|
|
170
|
+
e.pointerType === "touch" ? (t.removeEventListener("click", i.current), i.current = r, t.addEventListener("click", i.current, { once: !0 })) : r();
|
|
171
|
+
} else t.removeEventListener("click", i.current);
|
|
172
|
+
r.current = !1;
|
|
173
|
+
}, a = window.setTimeout(() => {
|
|
174
|
+
t.addEventListener("pointerdown", e);
|
|
175
|
+
}, 0);
|
|
176
|
+
return () => {
|
|
177
|
+
window.clearTimeout(a), t.removeEventListener("pointerdown", e), t.removeEventListener("click", i.current);
|
|
178
|
+
};
|
|
179
|
+
}, [t, n]), { onPointerDownCapture: () => r.current = !0 };
|
|
180
|
+
}
|
|
181
|
+
function ue(e, t = globalThis?.document) {
|
|
182
|
+
let n = l(e), r = m.useRef(!1);
|
|
183
|
+
return m.useEffect(() => {
|
|
184
|
+
let e = (e) => {
|
|
185
|
+
e.target && !r.current && L(se, n, { originalEvent: e }, { discrete: !1 });
|
|
186
|
+
};
|
|
187
|
+
return t.addEventListener("focusin", e), () => t.removeEventListener("focusin", e);
|
|
188
|
+
}, [t, n]), {
|
|
189
|
+
onFocusCapture: () => r.current = !0,
|
|
190
|
+
onBlurCapture: () => r.current = !1
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function de() {
|
|
194
|
+
let e = new CustomEvent(j);
|
|
195
|
+
document.dispatchEvent(e);
|
|
196
|
+
}
|
|
197
|
+
function L(e, t, n, { discrete: r }) {
|
|
198
|
+
let i = n.originalEvent.target, a = new CustomEvent(e, {
|
|
199
|
+
bubbles: !1,
|
|
200
|
+
cancelable: !0,
|
|
201
|
+
detail: n
|
|
202
|
+
});
|
|
203
|
+
t && i.addEventListener(e, t, { once: !0 }), r ? ae(i, a) : i.dispatchEvent(a);
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
207
|
+
var R = "focusScope.autoFocusOnMount", fe = "focusScope.autoFocusOnUnmount", pe = {
|
|
208
|
+
bubbles: !1,
|
|
209
|
+
cancelable: !0
|
|
210
|
+
}, me = "FocusScope", z = m.forwardRef((e, t) => {
|
|
211
|
+
let { loop: n = !1, trapped: r = !1, onMountAutoFocus: i, onUnmountAutoFocus: o, ...s } = e, [c, u] = m.useState(null), d = l(i), f = l(o), p = m.useRef(null), h = a(t, (e) => u(e)), g = m.useRef({
|
|
212
|
+
paused: !1,
|
|
213
|
+
pause() {
|
|
214
|
+
this.paused = !0;
|
|
215
|
+
},
|
|
216
|
+
resume() {
|
|
217
|
+
this.paused = !1;
|
|
218
|
+
}
|
|
219
|
+
}).current;
|
|
220
|
+
m.useEffect(() => {
|
|
221
|
+
if (r) {
|
|
222
|
+
let e = function(e) {
|
|
223
|
+
if (g.paused || !c) return;
|
|
224
|
+
let t = e.target;
|
|
225
|
+
c.contains(t) ? p.current = t : V(p.current, { select: !0 });
|
|
226
|
+
}, t = function(e) {
|
|
227
|
+
if (g.paused || !c) return;
|
|
228
|
+
let t = e.relatedTarget;
|
|
229
|
+
t !== null && (c.contains(t) || V(p.current, { select: !0 }));
|
|
230
|
+
}, n = function(e) {
|
|
231
|
+
if (document.activeElement === document.body) for (let t of e) t.removedNodes.length > 0 && V(c);
|
|
232
|
+
};
|
|
233
|
+
document.addEventListener("focusin", e), document.addEventListener("focusout", t);
|
|
234
|
+
let r = new MutationObserver(n);
|
|
235
|
+
return c && r.observe(c, {
|
|
236
|
+
childList: !0,
|
|
237
|
+
subtree: !0
|
|
238
|
+
}), () => {
|
|
239
|
+
document.removeEventListener("focusin", e), document.removeEventListener("focusout", t), r.disconnect();
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}, [
|
|
243
|
+
r,
|
|
244
|
+
c,
|
|
245
|
+
g.paused
|
|
246
|
+
]), m.useEffect(() => {
|
|
247
|
+
if (c) {
|
|
248
|
+
H.add(g);
|
|
249
|
+
let e = document.activeElement;
|
|
250
|
+
if (!c.contains(e)) {
|
|
251
|
+
let t = new CustomEvent(R, pe);
|
|
252
|
+
c.addEventListener(R, d), c.dispatchEvent(t), t.defaultPrevented || (he(Se(B(c)), { select: !0 }), document.activeElement === e && V(c));
|
|
253
|
+
}
|
|
254
|
+
return () => {
|
|
255
|
+
c.removeEventListener(R, d), setTimeout(() => {
|
|
256
|
+
let t = new CustomEvent(fe, pe);
|
|
257
|
+
c.addEventListener(fe, f), c.dispatchEvent(t), t.defaultPrevented || V(e ?? document.body, { select: !0 }), c.removeEventListener(fe, f), H.remove(g);
|
|
258
|
+
}, 0);
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}, [
|
|
262
|
+
c,
|
|
263
|
+
d,
|
|
264
|
+
f,
|
|
265
|
+
g
|
|
266
|
+
]);
|
|
267
|
+
let _ = m.useCallback((e) => {
|
|
268
|
+
if (!n && !r || g.paused) return;
|
|
269
|
+
let t = e.key === "Tab" && !e.altKey && !e.ctrlKey && !e.metaKey, i = document.activeElement;
|
|
270
|
+
if (t && i) {
|
|
271
|
+
let t = e.currentTarget, [r, a] = ge(t);
|
|
272
|
+
r && a ? !e.shiftKey && i === a ? (e.preventDefault(), n && V(r, { select: !0 })) : e.shiftKey && i === r && (e.preventDefault(), n && V(a, { select: !0 })) : i === t && e.preventDefault();
|
|
273
|
+
}
|
|
274
|
+
}, [
|
|
275
|
+
n,
|
|
276
|
+
r,
|
|
277
|
+
g.paused
|
|
278
|
+
]);
|
|
279
|
+
return /* @__PURE__ */ b(A.div, {
|
|
280
|
+
tabIndex: -1,
|
|
281
|
+
...s,
|
|
282
|
+
ref: h,
|
|
283
|
+
onKeyDown: _
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
z.displayName = me;
|
|
287
|
+
function he(e, { select: t = !1 } = {}) {
|
|
288
|
+
let n = document.activeElement;
|
|
289
|
+
for (let r of e) if (V(r, { select: t }), document.activeElement !== n) return;
|
|
290
|
+
}
|
|
291
|
+
function ge(e) {
|
|
292
|
+
let t = B(e);
|
|
293
|
+
return [_e(t, e), _e(t.reverse(), e)];
|
|
294
|
+
}
|
|
295
|
+
function B(e) {
|
|
296
|
+
let t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, { acceptNode: (e) => {
|
|
297
|
+
let t = e.tagName === "INPUT" && e.type === "hidden";
|
|
298
|
+
return e.disabled || e.hidden || t ? NodeFilter.FILTER_SKIP : e.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
299
|
+
} });
|
|
300
|
+
for (; n.nextNode();) t.push(n.currentNode);
|
|
301
|
+
return t;
|
|
302
|
+
}
|
|
303
|
+
function _e(e, t) {
|
|
304
|
+
for (let n of e) if (!ve(n, { upTo: t })) return n;
|
|
305
|
+
}
|
|
306
|
+
function ve(e, { upTo: t }) {
|
|
307
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
308
|
+
for (; e;) {
|
|
309
|
+
if (t !== void 0 && e === t) return !1;
|
|
310
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
311
|
+
e = e.parentElement;
|
|
312
|
+
}
|
|
313
|
+
return !1;
|
|
314
|
+
}
|
|
315
|
+
function ye(e) {
|
|
316
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
317
|
+
}
|
|
318
|
+
function V(e, { select: t = !1 } = {}) {
|
|
319
|
+
if (e && e.focus) {
|
|
320
|
+
let n = document.activeElement;
|
|
321
|
+
e.focus({ preventScroll: !0 }), e !== n && ye(e) && t && e.select();
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
var H = be();
|
|
325
|
+
function be() {
|
|
326
|
+
let e = [];
|
|
327
|
+
return {
|
|
328
|
+
add(t) {
|
|
329
|
+
let n = e[0];
|
|
330
|
+
t !== n && n?.pause(), e = xe(e, t), e.unshift(t);
|
|
331
|
+
},
|
|
332
|
+
remove(t) {
|
|
333
|
+
e = xe(e, t), e[0]?.resume();
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function xe(e, t) {
|
|
338
|
+
let n = [...e], r = n.indexOf(t);
|
|
339
|
+
return r !== -1 && n.splice(r, 1), n;
|
|
340
|
+
}
|
|
341
|
+
function Se(e) {
|
|
342
|
+
return e.filter((e) => e.tagName !== "A");
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region node_modules/vaul/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
346
|
+
var U = "Portal", Ce = m.forwardRef((e, t) => {
|
|
347
|
+
let { container: r, ...i } = e, [a, o] = m.useState(!1);
|
|
348
|
+
n(() => o(!0), []);
|
|
349
|
+
let s = r || a && globalThis?.document?.body;
|
|
350
|
+
return s ? S.createPortal(/* @__PURE__ */ b(A.div, {
|
|
351
|
+
...i,
|
|
352
|
+
ref: t
|
|
353
|
+
}), s) : null;
|
|
354
|
+
});
|
|
355
|
+
Ce.displayName = U;
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
358
|
+
var W = "Dialog", [we, Te] = e(W), [Ee, G] = we(W), De = (e) => {
|
|
359
|
+
let { __scopeDialog: t, children: n, open: r, defaultOpen: a, onOpenChange: o, modal: c = !0 } = e, l = m.useRef(null), u = m.useRef(null), [d, f] = i({
|
|
360
|
+
prop: r,
|
|
361
|
+
defaultProp: a ?? !1,
|
|
362
|
+
onChange: o,
|
|
363
|
+
caller: W
|
|
364
|
+
});
|
|
365
|
+
return /* @__PURE__ */ b(Ee, {
|
|
366
|
+
scope: t,
|
|
367
|
+
triggerRef: l,
|
|
368
|
+
contentRef: u,
|
|
369
|
+
contentId: s(),
|
|
370
|
+
titleId: s(),
|
|
371
|
+
descriptionId: s(),
|
|
372
|
+
open: d,
|
|
373
|
+
onOpenChange: f,
|
|
374
|
+
onOpenToggle: m.useCallback(() => f((e) => !e), [f]),
|
|
375
|
+
modal: c,
|
|
376
|
+
children: n
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
De.displayName = W;
|
|
380
|
+
var Oe = "DialogTrigger", ke = m.forwardRef((e, t) => {
|
|
381
|
+
let { __scopeDialog: n, ...i } = e, o = G(Oe, n), s = a(t, o.triggerRef);
|
|
382
|
+
return /* @__PURE__ */ b(A.button, {
|
|
383
|
+
type: "button",
|
|
384
|
+
"aria-haspopup": "dialog",
|
|
385
|
+
"aria-expanded": o.open,
|
|
386
|
+
"aria-controls": o.open ? o.contentId : void 0,
|
|
387
|
+
"data-state": Je(o.open),
|
|
388
|
+
...i,
|
|
389
|
+
ref: s,
|
|
390
|
+
onClick: r(e.onClick, o.onOpenToggle)
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
ke.displayName = Oe;
|
|
394
|
+
var Ae = "DialogPortal", [je, Me] = we(Ae, { forceMount: void 0 }), Ne = (e) => {
|
|
395
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: i } = e, a = G(Ae, t);
|
|
396
|
+
return /* @__PURE__ */ b(je, {
|
|
397
|
+
scope: t,
|
|
398
|
+
forceMount: n,
|
|
399
|
+
children: m.Children.map(r, (e) => /* @__PURE__ */ b(o, {
|
|
400
|
+
present: n || a.open,
|
|
401
|
+
children: /* @__PURE__ */ b(Ce, {
|
|
402
|
+
asChild: !0,
|
|
403
|
+
container: i,
|
|
404
|
+
children: e
|
|
405
|
+
})
|
|
406
|
+
}))
|
|
407
|
+
});
|
|
408
|
+
};
|
|
409
|
+
Ne.displayName = Ae;
|
|
410
|
+
var Pe = "DialogOverlay", Fe = m.forwardRef((e, t) => {
|
|
411
|
+
let n = Me(Pe, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = G(Pe, e.__scopeDialog);
|
|
412
|
+
return a.modal ? /* @__PURE__ */ b(o, {
|
|
413
|
+
present: r || a.open,
|
|
414
|
+
children: /* @__PURE__ */ b(Le, {
|
|
415
|
+
...i,
|
|
416
|
+
ref: t
|
|
417
|
+
})
|
|
418
|
+
}) : null;
|
|
419
|
+
});
|
|
420
|
+
Fe.displayName = Pe;
|
|
421
|
+
var Ie = /* @__PURE__ */ C("DialogOverlay.RemoveScroll"), Le = m.forwardRef((e, t) => {
|
|
422
|
+
let { __scopeDialog: n, ...r } = e, i = G(Pe, n);
|
|
423
|
+
return /* @__PURE__ */ b(d, {
|
|
424
|
+
as: Ie,
|
|
425
|
+
allowPinchZoom: !0,
|
|
426
|
+
shards: [i.contentRef],
|
|
427
|
+
children: /* @__PURE__ */ b(A.div, {
|
|
428
|
+
"data-state": Je(i.open),
|
|
429
|
+
...r,
|
|
430
|
+
ref: t,
|
|
431
|
+
style: {
|
|
432
|
+
pointerEvents: "auto",
|
|
433
|
+
...r.style
|
|
434
|
+
}
|
|
435
|
+
})
|
|
436
|
+
});
|
|
437
|
+
}), K = "DialogContent", Re = m.forwardRef((e, t) => {
|
|
438
|
+
let n = Me(K, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = G(K, e.__scopeDialog);
|
|
439
|
+
return /* @__PURE__ */ b(o, {
|
|
440
|
+
present: r || a.open,
|
|
441
|
+
children: a.modal ? /* @__PURE__ */ b(ze, {
|
|
442
|
+
...i,
|
|
443
|
+
ref: t
|
|
444
|
+
}) : /* @__PURE__ */ b(Be, {
|
|
445
|
+
...i,
|
|
446
|
+
ref: t
|
|
447
|
+
})
|
|
448
|
+
});
|
|
449
|
+
});
|
|
450
|
+
Re.displayName = K;
|
|
451
|
+
var ze = m.forwardRef((e, t) => {
|
|
452
|
+
let n = G(K, e.__scopeDialog), i = m.useRef(null), o = a(t, n.contentRef, i);
|
|
453
|
+
return m.useEffect(() => {
|
|
454
|
+
let e = i.current;
|
|
455
|
+
if (e) return p(e);
|
|
456
|
+
}, []), /* @__PURE__ */ b(Ve, {
|
|
457
|
+
...e,
|
|
458
|
+
ref: o,
|
|
459
|
+
trapFocus: n.open,
|
|
460
|
+
disableOutsidePointerEvents: n.open,
|
|
461
|
+
onCloseAutoFocus: r(e.onCloseAutoFocus, (e) => {
|
|
462
|
+
e.preventDefault(), n.triggerRef.current?.focus();
|
|
463
|
+
}),
|
|
464
|
+
onPointerDownOutside: r(e.onPointerDownOutside, (e) => {
|
|
465
|
+
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
|
|
466
|
+
(t.button === 2 || n) && e.preventDefault();
|
|
467
|
+
}),
|
|
468
|
+
onFocusOutside: r(e.onFocusOutside, (e) => e.preventDefault())
|
|
469
|
+
});
|
|
470
|
+
}), Be = m.forwardRef((e, t) => {
|
|
471
|
+
let n = G(K, e.__scopeDialog), r = m.useRef(!1), i = m.useRef(!1);
|
|
472
|
+
return /* @__PURE__ */ b(Ve, {
|
|
473
|
+
...e,
|
|
474
|
+
ref: t,
|
|
475
|
+
trapFocus: !1,
|
|
476
|
+
disableOutsidePointerEvents: !1,
|
|
477
|
+
onCloseAutoFocus: (t) => {
|
|
478
|
+
e.onCloseAutoFocus?.(t), t.defaultPrevented || (r.current || n.triggerRef.current?.focus(), t.preventDefault()), r.current = !1, i.current = !1;
|
|
479
|
+
},
|
|
480
|
+
onInteractOutside: (t) => {
|
|
481
|
+
e.onInteractOutside?.(t), t.defaultPrevented || (r.current = !0, t.detail.originalEvent.type === "pointerdown" && (i.current = !0));
|
|
482
|
+
let a = t.target;
|
|
483
|
+
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
}), Ve = m.forwardRef((e, t) => {
|
|
487
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: o, ...s } = e, c = G(K, n), l = m.useRef(null), u = a(t, l);
|
|
488
|
+
return f(), /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(z, {
|
|
489
|
+
asChild: !0,
|
|
490
|
+
loop: !0,
|
|
491
|
+
trapped: r,
|
|
492
|
+
onMountAutoFocus: i,
|
|
493
|
+
onUnmountAutoFocus: o,
|
|
494
|
+
children: /* @__PURE__ */ b(F, {
|
|
495
|
+
role: "dialog",
|
|
496
|
+
id: c.contentId,
|
|
497
|
+
"aria-describedby": c.descriptionId,
|
|
498
|
+
"aria-labelledby": c.titleId,
|
|
499
|
+
"data-state": Je(c.open),
|
|
500
|
+
...s,
|
|
501
|
+
ref: u,
|
|
502
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
503
|
+
})
|
|
504
|
+
}), /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(Qe, { titleId: c.titleId }), /* @__PURE__ */ b(et, {
|
|
505
|
+
contentRef: l,
|
|
506
|
+
descriptionId: c.descriptionId
|
|
507
|
+
})] })] });
|
|
508
|
+
}), He = "DialogTitle", Ue = m.forwardRef((e, t) => {
|
|
509
|
+
let { __scopeDialog: n, ...r } = e, i = G(He, n);
|
|
510
|
+
return /* @__PURE__ */ b(A.h2, {
|
|
511
|
+
id: i.titleId,
|
|
512
|
+
...r,
|
|
513
|
+
ref: t
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
Ue.displayName = He;
|
|
517
|
+
var We = "DialogDescription", Ge = m.forwardRef((e, t) => {
|
|
518
|
+
let { __scopeDialog: n, ...r } = e, i = G(We, n);
|
|
519
|
+
return /* @__PURE__ */ b(A.p, {
|
|
520
|
+
id: i.descriptionId,
|
|
521
|
+
...r,
|
|
522
|
+
ref: t
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
Ge.displayName = We;
|
|
526
|
+
var Ke = "DialogClose", qe = m.forwardRef((e, t) => {
|
|
527
|
+
let { __scopeDialog: n, ...i } = e, a = G(Ke, n);
|
|
528
|
+
return /* @__PURE__ */ b(A.button, {
|
|
529
|
+
type: "button",
|
|
530
|
+
...i,
|
|
531
|
+
ref: t,
|
|
532
|
+
onClick: r(e.onClick, () => a.onOpenChange(!1))
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
qe.displayName = Ke;
|
|
536
|
+
function Je(e) {
|
|
537
|
+
return e ? "open" : "closed";
|
|
538
|
+
}
|
|
539
|
+
var Ye = "DialogTitleWarning", [Xe, Ze] = t(Ye, {
|
|
540
|
+
contentName: K,
|
|
541
|
+
titleName: He,
|
|
542
|
+
docsSlug: "dialog"
|
|
543
|
+
}), Qe = ({ titleId: e }) => {
|
|
544
|
+
let t = Ze(Ye), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
545
|
+
|
|
546
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
547
|
+
|
|
548
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
549
|
+
return m.useEffect(() => {
|
|
550
|
+
e && (document.getElementById(e) || console.error(n));
|
|
551
|
+
}, [n, e]), null;
|
|
552
|
+
}, $e = "DialogDescriptionWarning", et = ({ contentRef: e, descriptionId: t }) => {
|
|
553
|
+
let n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ze($e).contentName}}.`;
|
|
554
|
+
return m.useEffect(() => {
|
|
555
|
+
let r = e.current?.getAttribute("aria-describedby");
|
|
556
|
+
t && r && (document.getElementById(t) || console.warn(n));
|
|
557
|
+
}, [
|
|
558
|
+
n,
|
|
559
|
+
e,
|
|
560
|
+
t
|
|
561
|
+
]), null;
|
|
562
|
+
}, tt = De, nt = ke, rt = Ne, it = Fe, at = Re, ot = Ue, st = Ge, ct = qe;
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region node_modules/vaul/dist/index.mjs
|
|
565
|
+
function lt(e) {
|
|
566
|
+
if (!e || typeof document > "u") return;
|
|
567
|
+
let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
|
|
568
|
+
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
|
|
569
|
+
}
|
|
570
|
+
var ut = h.createContext({
|
|
571
|
+
drawerRef: { current: null },
|
|
572
|
+
overlayRef: { current: null },
|
|
573
|
+
onPress: () => {},
|
|
574
|
+
onRelease: () => {},
|
|
575
|
+
onDrag: () => {},
|
|
576
|
+
onNestedDrag: () => {},
|
|
577
|
+
onNestedOpenChange: () => {},
|
|
578
|
+
onNestedRelease: () => {},
|
|
579
|
+
openProp: void 0,
|
|
580
|
+
dismissible: !1,
|
|
581
|
+
isOpen: !1,
|
|
582
|
+
isDragging: !1,
|
|
583
|
+
keyboardIsOpen: { current: !1 },
|
|
584
|
+
snapPointsOffset: null,
|
|
585
|
+
snapPoints: null,
|
|
586
|
+
handleOnly: !1,
|
|
587
|
+
modal: !1,
|
|
588
|
+
shouldFade: !1,
|
|
589
|
+
activeSnapPoint: null,
|
|
590
|
+
onOpenChange: () => {},
|
|
591
|
+
setActiveSnapPoint: () => {},
|
|
592
|
+
closeDrawer: () => {},
|
|
593
|
+
direction: "bottom",
|
|
594
|
+
shouldAnimate: { current: !0 },
|
|
595
|
+
shouldScaleBackground: !1,
|
|
596
|
+
setBackgroundColorOnScale: !0,
|
|
597
|
+
noBodyStyles: !1,
|
|
598
|
+
container: null,
|
|
599
|
+
autoFocus: !1
|
|
600
|
+
}), q = () => {
|
|
601
|
+
let e = h.useContext(ut);
|
|
602
|
+
if (!e) throw Error("useDrawerContext must be used within a Drawer.Root");
|
|
603
|
+
return e;
|
|
604
|
+
};
|
|
605
|
+
lt("[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(\n[data-state=closed]\n){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)}}");
|
|
606
|
+
function dt() {
|
|
607
|
+
let e = navigator.userAgent;
|
|
608
|
+
return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || /FxiOS/.test(e));
|
|
609
|
+
}
|
|
610
|
+
function ft() {
|
|
611
|
+
return _t(/^Mac/);
|
|
612
|
+
}
|
|
613
|
+
function pt() {
|
|
614
|
+
return _t(/^iPhone/);
|
|
615
|
+
}
|
|
616
|
+
function mt() {
|
|
617
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
618
|
+
}
|
|
619
|
+
function ht() {
|
|
620
|
+
return _t(/^iPad/) || ft() && navigator.maxTouchPoints > 1;
|
|
621
|
+
}
|
|
622
|
+
function gt() {
|
|
623
|
+
return pt() || ht();
|
|
624
|
+
}
|
|
625
|
+
function _t(e) {
|
|
626
|
+
return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
|
|
627
|
+
}
|
|
628
|
+
var vt = 24, yt = typeof window < "u" ? _ : g;
|
|
629
|
+
function bt(...e) {
|
|
630
|
+
return (...t) => {
|
|
631
|
+
for (let n of e) typeof n == "function" && n(...t);
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
var xt = typeof document < "u" && window.visualViewport;
|
|
635
|
+
function St(e) {
|
|
636
|
+
let t = window.getComputedStyle(e);
|
|
637
|
+
return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
|
638
|
+
}
|
|
639
|
+
function Ct(e) {
|
|
640
|
+
for (St(e) && (e = e.parentElement); e && !St(e);) e = e.parentElement;
|
|
641
|
+
return e || document.scrollingElement || document.documentElement;
|
|
642
|
+
}
|
|
643
|
+
var wt = new Set([
|
|
644
|
+
"checkbox",
|
|
645
|
+
"radio",
|
|
646
|
+
"range",
|
|
647
|
+
"color",
|
|
648
|
+
"file",
|
|
649
|
+
"image",
|
|
650
|
+
"button",
|
|
651
|
+
"submit",
|
|
652
|
+
"reset"
|
|
653
|
+
]), Tt = 0, Et;
|
|
654
|
+
function Dt(e = {}) {
|
|
655
|
+
let { isDisabled: t } = e;
|
|
656
|
+
yt(() => {
|
|
657
|
+
if (!t) return Tt++, Tt === 1 && gt() && (Et = Ot()), () => {
|
|
658
|
+
Tt--, Tt === 0 && Et?.();
|
|
659
|
+
};
|
|
660
|
+
}, [t]);
|
|
661
|
+
}
|
|
662
|
+
function Ot() {
|
|
663
|
+
let e, t = 0, n = (n) => {
|
|
664
|
+
e = Ct(n.target), !(e === document.documentElement && e === document.body) && (t = n.changedTouches[0].pageY);
|
|
665
|
+
}, r = (n) => {
|
|
666
|
+
if (!e || e === document.documentElement || e === document.body) {
|
|
667
|
+
n.preventDefault();
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
let r = n.changedTouches[0].pageY, i = e.scrollTop, a = e.scrollHeight - e.clientHeight;
|
|
671
|
+
a !== 0 && ((i <= 0 && r > t || i >= a && r < t) && n.preventDefault(), t = r);
|
|
672
|
+
}, i = (e) => {
|
|
673
|
+
let t = e.target;
|
|
674
|
+
jt(t) && t !== document.activeElement && (e.preventDefault(), t.style.transform = "translateY(-2000px)", t.focus(), requestAnimationFrame(() => {
|
|
675
|
+
t.style.transform = "";
|
|
676
|
+
}));
|
|
677
|
+
}, a = (e) => {
|
|
678
|
+
let t = e.target;
|
|
679
|
+
jt(t) && (t.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
680
|
+
t.style.transform = "", xt && (xt.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
681
|
+
At(t);
|
|
682
|
+
}) : xt.addEventListener("resize", () => At(t), { once: !0 }));
|
|
683
|
+
}));
|
|
684
|
+
}, o = () => {
|
|
685
|
+
window.scrollTo(0, 0);
|
|
686
|
+
}, s = window.pageXOffset, c = window.pageYOffset, l = bt(kt(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
687
|
+
window.scrollTo(0, 0);
|
|
688
|
+
let u = bt(J(document, "touchstart", n, {
|
|
689
|
+
passive: !1,
|
|
690
|
+
capture: !0
|
|
691
|
+
}), J(document, "touchmove", r, {
|
|
692
|
+
passive: !1,
|
|
693
|
+
capture: !0
|
|
694
|
+
}), J(document, "touchend", i, {
|
|
695
|
+
passive: !1,
|
|
696
|
+
capture: !0
|
|
697
|
+
}), J(document, "focus", a, !0), J(window, "scroll", o));
|
|
698
|
+
return () => {
|
|
699
|
+
l(), u(), window.scrollTo(s, c);
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function kt(e, t, n) {
|
|
703
|
+
let r = e.style[t];
|
|
704
|
+
return e.style[t] = n, () => {
|
|
705
|
+
e.style[t] = r;
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
function J(e, t, n, r) {
|
|
709
|
+
return e.addEventListener(t, n, r), () => {
|
|
710
|
+
e.removeEventListener(t, n, r);
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
function At(e) {
|
|
714
|
+
let t = document.scrollingElement || document.documentElement;
|
|
715
|
+
for (; e && e !== t;) {
|
|
716
|
+
let t = Ct(e);
|
|
717
|
+
if (t !== document.documentElement && t !== document.body && t !== e) {
|
|
718
|
+
let n = t.getBoundingClientRect().top, r = e.getBoundingClientRect().top;
|
|
719
|
+
e.getBoundingClientRect().bottom > t.getBoundingClientRect().bottom + vt && (t.scrollTop += r - n);
|
|
720
|
+
}
|
|
721
|
+
e = t.parentElement;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
function jt(e) {
|
|
725
|
+
return e instanceof HTMLInputElement && !wt.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
|
726
|
+
}
|
|
727
|
+
function Mt(e, t) {
|
|
728
|
+
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
729
|
+
}
|
|
730
|
+
function Nt(...e) {
|
|
731
|
+
return (t) => e.forEach((e) => Mt(e, t));
|
|
732
|
+
}
|
|
733
|
+
function Pt(...e) {
|
|
734
|
+
return m.useCallback(Nt(...e), e);
|
|
735
|
+
}
|
|
736
|
+
var Ft = /* @__PURE__ */ new WeakMap();
|
|
737
|
+
function Y(e, t, n = !1) {
|
|
738
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
739
|
+
let r = {};
|
|
740
|
+
Object.entries(t).forEach(([t, n]) => {
|
|
741
|
+
if (t.startsWith("--")) {
|
|
742
|
+
e.style.setProperty(t, n);
|
|
743
|
+
return;
|
|
744
|
+
}
|
|
745
|
+
r[t] = e.style[t], e.style[t] = n;
|
|
746
|
+
}), !n && Ft.set(e, r);
|
|
747
|
+
}
|
|
748
|
+
function It(e, t) {
|
|
749
|
+
if (!e || !(e instanceof HTMLElement)) return;
|
|
750
|
+
let n = Ft.get(e);
|
|
751
|
+
n && (e.style[t] = n[t]);
|
|
752
|
+
}
|
|
753
|
+
var X = (e) => {
|
|
754
|
+
switch (e) {
|
|
755
|
+
case "top":
|
|
756
|
+
case "bottom": return !0;
|
|
757
|
+
case "left":
|
|
758
|
+
case "right": return !1;
|
|
759
|
+
default: return e;
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
function Lt(e, t) {
|
|
763
|
+
if (!e) return null;
|
|
764
|
+
let n = window.getComputedStyle(e), r = n.transform || n.webkitTransform || n.mozTransform, i = r.match(/^matrix3d\((.+)\)$/);
|
|
765
|
+
return i ? parseFloat(i[1].split(", ")[X(t) ? 13 : 12]) : (i = r.match(/^matrix\((.+)\)$/), i ? parseFloat(i[1].split(", ")[X(t) ? 5 : 4]) : null);
|
|
766
|
+
}
|
|
767
|
+
function Rt(e) {
|
|
768
|
+
return 8 * (Math.log(e + 1) - 2);
|
|
769
|
+
}
|
|
770
|
+
function zt(e, t) {
|
|
771
|
+
if (!e) return () => {};
|
|
772
|
+
let n = e.style.cssText;
|
|
773
|
+
return Object.assign(e.style, t), () => {
|
|
774
|
+
e.style.cssText = n;
|
|
775
|
+
};
|
|
776
|
+
}
|
|
777
|
+
var Z = {
|
|
778
|
+
DURATION: .5,
|
|
779
|
+
EASE: [
|
|
780
|
+
.32,
|
|
781
|
+
.72,
|
|
782
|
+
0,
|
|
783
|
+
1
|
|
784
|
+
]
|
|
785
|
+
}, Bt = .4, Vt = .25, Ht = 100, Ut = 8, Wt = 16, Gt = 26, Kt = "vaul-dragging";
|
|
786
|
+
function qt(e) {
|
|
787
|
+
let t = h.useRef(e);
|
|
788
|
+
return h.useEffect(() => {
|
|
789
|
+
t.current = e;
|
|
790
|
+
}), h.useMemo(() => (...e) => t.current == null ? void 0 : t.current.call(t, ...e), []);
|
|
791
|
+
}
|
|
792
|
+
function Jt({ defaultProp: e, onChange: t }) {
|
|
793
|
+
let n = h.useState(e), [r] = n, i = h.useRef(r), a = qt(t);
|
|
794
|
+
return h.useEffect(() => {
|
|
795
|
+
i.current !== r && (a(r), i.current = r);
|
|
796
|
+
}, [
|
|
797
|
+
r,
|
|
798
|
+
i,
|
|
799
|
+
a
|
|
800
|
+
]), n;
|
|
801
|
+
}
|
|
802
|
+
function Yt({ prop: e, defaultProp: t, onChange: n = () => {} }) {
|
|
803
|
+
let [r, i] = Jt({
|
|
804
|
+
defaultProp: t,
|
|
805
|
+
onChange: n
|
|
806
|
+
}), a = e !== void 0, o = a ? e : r, s = qt(n);
|
|
807
|
+
return [o, h.useCallback((t) => {
|
|
808
|
+
if (a) {
|
|
809
|
+
let n = typeof t == "function" ? t(e) : t;
|
|
810
|
+
n !== e && s(n);
|
|
811
|
+
} else i(t);
|
|
812
|
+
}, [
|
|
813
|
+
a,
|
|
814
|
+
e,
|
|
815
|
+
i,
|
|
816
|
+
s
|
|
817
|
+
])];
|
|
818
|
+
}
|
|
819
|
+
function Xt({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n, drawerRef: r, overlayRef: i, fadeFromIndex: a, onSnapPointChange: o, direction: s = "bottom", container: c, snapToSequentialPoint: l }) {
|
|
820
|
+
let [u, d] = Yt({
|
|
821
|
+
prop: e,
|
|
822
|
+
defaultProp: n?.[0],
|
|
823
|
+
onChange: t
|
|
824
|
+
}), [f, p] = h.useState(typeof window < "u" ? {
|
|
825
|
+
innerWidth: window.innerWidth,
|
|
826
|
+
innerHeight: window.innerHeight
|
|
827
|
+
} : void 0);
|
|
828
|
+
h.useEffect(() => {
|
|
829
|
+
function e() {
|
|
830
|
+
p({
|
|
831
|
+
innerWidth: window.innerWidth,
|
|
832
|
+
innerHeight: window.innerHeight
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
836
|
+
}, []);
|
|
837
|
+
let m = h.useMemo(() => u === n?.[n.length - 1] || null, [n, u]), g = h.useMemo(() => n?.findIndex((e) => e === u) ?? null, [n, u]), _ = n && n.length > 0 && (a || a === 0) && !Number.isNaN(a) && n[a] === u || !n, v = h.useMemo(() => {
|
|
838
|
+
let e = c ? {
|
|
839
|
+
width: c.getBoundingClientRect().width,
|
|
840
|
+
height: c.getBoundingClientRect().height
|
|
841
|
+
} : typeof window < "u" ? {
|
|
842
|
+
width: window.innerWidth,
|
|
843
|
+
height: window.innerHeight
|
|
844
|
+
} : {
|
|
845
|
+
width: 0,
|
|
846
|
+
height: 0
|
|
847
|
+
};
|
|
848
|
+
return n?.map((t) => {
|
|
849
|
+
let n = typeof t == "string", r = 0;
|
|
850
|
+
if (n && (r = parseInt(t, 10)), X(s)) {
|
|
851
|
+
let i = n ? r : f ? t * e.height : 0;
|
|
852
|
+
return f ? s === "bottom" ? e.height - i : -e.height + i : i;
|
|
853
|
+
}
|
|
854
|
+
let i = n ? r : f ? t * e.width : 0;
|
|
855
|
+
return f ? s === "right" ? e.width - i : -e.width + i : i;
|
|
856
|
+
}) ?? [];
|
|
857
|
+
}, [
|
|
858
|
+
n,
|
|
859
|
+
f,
|
|
860
|
+
c
|
|
861
|
+
]), y = h.useMemo(() => g === null ? null : v?.[g], [v, g]), b = h.useCallback((e) => {
|
|
862
|
+
let t = v?.findIndex((t) => t === e) ?? null;
|
|
863
|
+
o(t), Y(r.current, {
|
|
864
|
+
transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
865
|
+
transform: X(s) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
|
|
866
|
+
}), v && t !== v.length - 1 && a !== void 0 && t !== a && t < a ? Y(i.current, {
|
|
867
|
+
transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
868
|
+
opacity: "0"
|
|
869
|
+
}) : Y(i.current, {
|
|
870
|
+
transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
871
|
+
opacity: "1"
|
|
872
|
+
}), d(n?.[Math.max(t, 0)]);
|
|
873
|
+
}, [
|
|
874
|
+
r.current,
|
|
875
|
+
n,
|
|
876
|
+
v,
|
|
877
|
+
a,
|
|
878
|
+
i,
|
|
879
|
+
d
|
|
880
|
+
]);
|
|
881
|
+
h.useEffect(() => {
|
|
882
|
+
if (u || e) {
|
|
883
|
+
let t = n?.findIndex((t) => t === e || t === u) ?? -1;
|
|
884
|
+
v && t !== -1 && typeof v[t] == "number" && b(v[t]);
|
|
885
|
+
}
|
|
886
|
+
}, [
|
|
887
|
+
u,
|
|
888
|
+
e,
|
|
889
|
+
n,
|
|
890
|
+
v,
|
|
891
|
+
b
|
|
892
|
+
]);
|
|
893
|
+
function x({ draggedDistance: e, closeDrawer: t, velocity: r, dismissible: o }) {
|
|
894
|
+
if (a === void 0) return;
|
|
895
|
+
let c = s === "bottom" || s === "right" ? (y ?? 0) - e : (y ?? 0) + e, u = g === a - 1, d = g === 0, f = e > 0;
|
|
896
|
+
if (u && Y(i.current, { transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})` }), !l && r > 2 && !f) {
|
|
897
|
+
o ? t() : b(v[0]);
|
|
898
|
+
return;
|
|
899
|
+
}
|
|
900
|
+
if (!l && r > 2 && f && v && n) {
|
|
901
|
+
b(v[n.length - 1]);
|
|
902
|
+
return;
|
|
903
|
+
}
|
|
904
|
+
let p = v?.reduce((e, t) => typeof e != "number" || typeof t != "number" ? e : Math.abs(t - c) < Math.abs(e - c) ? t : e), h = X(s) ? window.innerHeight : window.innerWidth;
|
|
905
|
+
if (r > Bt && Math.abs(e) < h * .4) {
|
|
906
|
+
let e = f ? 1 : -1;
|
|
907
|
+
if (e > 0 && m && n) {
|
|
908
|
+
b(v[n.length - 1]);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
if (d && e < 0 && o && t(), g === null) return;
|
|
912
|
+
b(v[g + e]);
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
b(p);
|
|
916
|
+
}
|
|
917
|
+
function S({ draggedDistance: e }) {
|
|
918
|
+
if (y === null) return;
|
|
919
|
+
let t = s === "bottom" || s === "right" ? y - e : y + e;
|
|
920
|
+
(s === "bottom" || s === "right") && t < v[v.length - 1] || (s === "top" || s === "left") && t > v[v.length - 1] || Y(r.current, { transform: X(s) ? `translate3d(0, ${t}px, 0)` : `translate3d(${t}px, 0, 0)` });
|
|
921
|
+
}
|
|
922
|
+
function C(e, t) {
|
|
923
|
+
if (!n || typeof g != "number" || !v || a === void 0) return null;
|
|
924
|
+
let r = g === a - 1;
|
|
925
|
+
if (g >= a && t) return 0;
|
|
926
|
+
if (r && !t) return 1;
|
|
927
|
+
if (!_ && !r) return null;
|
|
928
|
+
let i = r ? g + 1 : g - 1, o = r ? v[i] - v[i - 1] : v[i + 1] - v[i], s = e / Math.abs(o);
|
|
929
|
+
return r ? 1 - s : s;
|
|
930
|
+
}
|
|
931
|
+
return {
|
|
932
|
+
isLastSnapPoint: m,
|
|
933
|
+
activeSnapPoint: u,
|
|
934
|
+
shouldFade: _,
|
|
935
|
+
getPercentageDragged: C,
|
|
936
|
+
setActiveSnapPoint: d,
|
|
937
|
+
activeSnapPointIndex: g,
|
|
938
|
+
onRelease: x,
|
|
939
|
+
onDrag: S,
|
|
940
|
+
snapPointsOffset: v
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
function Zt() {
|
|
944
|
+
let { direction: e, isOpen: t, shouldScaleBackground: n, setBackgroundColorOnScale: r, noBodyStyles: i } = q(), a = h.useRef(null), o = v(() => document.body.style.backgroundColor, []);
|
|
945
|
+
function s() {
|
|
946
|
+
return (window.innerWidth - Gt) / window.innerWidth;
|
|
947
|
+
}
|
|
948
|
+
h.useEffect(() => {
|
|
949
|
+
if (t && n) {
|
|
950
|
+
a.current && clearTimeout(a.current);
|
|
951
|
+
let t = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
952
|
+
if (!t) return;
|
|
953
|
+
r && !i && zt(document.body, { background: "black" }), zt(t, {
|
|
954
|
+
transformOrigin: X(e) ? "top" : "left",
|
|
955
|
+
transitionProperty: "transform, border-radius",
|
|
956
|
+
transitionDuration: `${Z.DURATION}s`,
|
|
957
|
+
transitionTimingFunction: `cubic-bezier(${Z.EASE.join(",")})`
|
|
958
|
+
});
|
|
959
|
+
let n = zt(t, {
|
|
960
|
+
borderRadius: `${Ut}px`,
|
|
961
|
+
overflow: "hidden",
|
|
962
|
+
...X(e) ? { transform: `scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)` } : { transform: `scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)` }
|
|
963
|
+
});
|
|
964
|
+
return () => {
|
|
965
|
+
n(), a.current = window.setTimeout(() => {
|
|
966
|
+
o ? document.body.style.background = o : document.body.style.removeProperty("background");
|
|
967
|
+
}, Z.DURATION * 1e3);
|
|
968
|
+
};
|
|
969
|
+
}
|
|
970
|
+
}, [
|
|
971
|
+
t,
|
|
972
|
+
n,
|
|
973
|
+
o
|
|
974
|
+
]);
|
|
975
|
+
}
|
|
976
|
+
var Q = null;
|
|
977
|
+
function Qt({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRestoration: i, noBodyStyles: a }) {
|
|
978
|
+
let [o, s] = h.useState(() => typeof window < "u" ? window.location.href : ""), c = h.useRef(0), l = h.useCallback(() => {
|
|
979
|
+
if (mt() && Q === null && e && !a) {
|
|
980
|
+
Q = {
|
|
981
|
+
position: document.body.style.position,
|
|
982
|
+
top: document.body.style.top,
|
|
983
|
+
left: document.body.style.left,
|
|
984
|
+
height: document.body.style.height,
|
|
985
|
+
right: "unset"
|
|
986
|
+
};
|
|
987
|
+
let { scrollX: e, innerHeight: t } = window;
|
|
988
|
+
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
989
|
+
top: `${-c.current}px`,
|
|
990
|
+
left: `${-e}px`,
|
|
991
|
+
right: "0px",
|
|
992
|
+
height: "auto"
|
|
993
|
+
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
994
|
+
let e = t - window.innerHeight;
|
|
995
|
+
e && c.current >= t && (document.body.style.top = `${-(c.current + e)}px`);
|
|
996
|
+
}), 300);
|
|
997
|
+
}
|
|
998
|
+
}, [e]), u = h.useCallback(() => {
|
|
999
|
+
if (mt() && Q !== null && !a) {
|
|
1000
|
+
let e = -parseInt(document.body.style.top, 10), t = -parseInt(document.body.style.left, 10);
|
|
1001
|
+
Object.assign(document.body.style, Q), window.requestAnimationFrame(() => {
|
|
1002
|
+
if (i && o !== window.location.href) {
|
|
1003
|
+
s(window.location.href);
|
|
1004
|
+
return;
|
|
1005
|
+
}
|
|
1006
|
+
window.scrollTo(t, e);
|
|
1007
|
+
}), Q = null;
|
|
1008
|
+
}
|
|
1009
|
+
}, [o]);
|
|
1010
|
+
return h.useEffect(() => {
|
|
1011
|
+
function e() {
|
|
1012
|
+
c.current = window.scrollY;
|
|
1013
|
+
}
|
|
1014
|
+
return e(), window.addEventListener("scroll", e), () => {
|
|
1015
|
+
window.removeEventListener("scroll", e);
|
|
1016
|
+
};
|
|
1017
|
+
}, []), h.useEffect(() => {
|
|
1018
|
+
if (t) return () => {
|
|
1019
|
+
typeof document > "u" || document.querySelector("[data-vaul-drawer]") || u();
|
|
1020
|
+
};
|
|
1021
|
+
}, [t, u]), h.useEffect(() => {
|
|
1022
|
+
n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && l(), t || window.setTimeout(() => {
|
|
1023
|
+
u();
|
|
1024
|
+
}, 500)) : u());
|
|
1025
|
+
}, [
|
|
1026
|
+
e,
|
|
1027
|
+
r,
|
|
1028
|
+
o,
|
|
1029
|
+
t,
|
|
1030
|
+
n,
|
|
1031
|
+
l,
|
|
1032
|
+
u
|
|
1033
|
+
]), { restorePositionSetting: u };
|
|
1034
|
+
}
|
|
1035
|
+
function $t({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: i, snapPoints: a, shouldScaleBackground: o = !1, setBackgroundColorOnScale: s = !0, closeThreshold: c = Vt, scrollLockTimeout: l = Ht, dismissible: u = !0, handleOnly: d = !1, fadeFromIndex: f = a && a.length - 1, activeSnapPoint: p, setActiveSnapPoint: m, fixed: g, modal: _ = !0, onClose: v, nested: y, noBodyStyles: b = !1, direction: x = "bottom", defaultOpen: S = !1, disablePreventScroll: C = !0, snapToSequentialPoint: w = !1, preventScrollRestoration: T = !1, repositionInputs: E = !0, onAnimationEnd: D, container: ee, autoFocus: te = !1 }) {
|
|
1036
|
+
let [O = !1, ne] = Yt({
|
|
1037
|
+
defaultProp: S,
|
|
1038
|
+
prop: e,
|
|
1039
|
+
onChange: (e) => {
|
|
1040
|
+
t?.(e), !e && !y && V(), setTimeout(() => {
|
|
1041
|
+
D?.(e);
|
|
1042
|
+
}, Z.DURATION * 1e3), e && !_ && typeof window < "u" && window.requestAnimationFrame(() => {
|
|
1043
|
+
document.body.style.pointerEvents = "auto";
|
|
1044
|
+
}), e || (document.body.style.pointerEvents = "auto");
|
|
1045
|
+
}
|
|
1046
|
+
}), [re, ie] = h.useState(!1), [k, A] = h.useState(!1), [ae, oe] = h.useState(!1), j = h.useRef(null), M = h.useRef(null), se = h.useRef(null), N = h.useRef(null), P = h.useRef(null), F = h.useRef(!1), ce = h.useRef(null), le = h.useRef(0), I = h.useRef(!1), ue = h.useRef(!S), de = h.useRef(0), L = h.useRef(null), R = h.useRef(L.current?.getBoundingClientRect().height || 0), fe = h.useRef(L.current?.getBoundingClientRect().width || 0), pe = h.useRef(0), { activeSnapPoint: me, activeSnapPointIndex: z, setActiveSnapPoint: he, onRelease: ge, snapPointsOffset: B, onDrag: _e, shouldFade: ve, getPercentageDragged: ye } = Xt({
|
|
1047
|
+
snapPoints: a,
|
|
1048
|
+
activeSnapPointProp: p,
|
|
1049
|
+
setActiveSnapPointProp: m,
|
|
1050
|
+
drawerRef: L,
|
|
1051
|
+
fadeFromIndex: f,
|
|
1052
|
+
overlayRef: j,
|
|
1053
|
+
onSnapPointChange: h.useCallback((e) => {
|
|
1054
|
+
a && e === B.length - 1 && (M.current = /* @__PURE__ */ new Date());
|
|
1055
|
+
}, []),
|
|
1056
|
+
direction: x,
|
|
1057
|
+
container: ee,
|
|
1058
|
+
snapToSequentialPoint: w
|
|
1059
|
+
});
|
|
1060
|
+
Dt({ isDisabled: !O || k || !_ || ae || !re || !E || !C });
|
|
1061
|
+
let { restorePositionSetting: V } = Qt({
|
|
1062
|
+
isOpen: O,
|
|
1063
|
+
modal: _,
|
|
1064
|
+
nested: y ?? !1,
|
|
1065
|
+
hasBeenOpened: re,
|
|
1066
|
+
preventScrollRestoration: T,
|
|
1067
|
+
noBodyStyles: b
|
|
1068
|
+
});
|
|
1069
|
+
function H() {
|
|
1070
|
+
return (window.innerWidth - Gt) / window.innerWidth;
|
|
1071
|
+
}
|
|
1072
|
+
function be(e) {
|
|
1073
|
+
!u && !a || L.current && !L.current.contains(e.target) || (R.current = L.current?.getBoundingClientRect().height || 0, fe.current = L.current?.getBoundingClientRect().width || 0, A(!0), se.current = /* @__PURE__ */ new Date(), gt() && window.addEventListener("touchend", () => F.current = !1, { once: !0 }), e.target.setPointerCapture(e.pointerId), le.current = X(x) ? e.pageY : e.pageX);
|
|
1074
|
+
}
|
|
1075
|
+
function xe(e, t) {
|
|
1076
|
+
let n = e, r = window.getSelection()?.toString(), i = L.current ? Lt(L.current, x) : null, a = /* @__PURE__ */ new Date();
|
|
1077
|
+
if (n.tagName === "SELECT" || n.hasAttribute("data-vaul-no-drag") || n.closest("[data-vaul-no-drag]")) return !1;
|
|
1078
|
+
if (x === "right" || x === "left") return !0;
|
|
1079
|
+
if (M.current && a.getTime() - M.current.getTime() < 500) return !1;
|
|
1080
|
+
if (i !== null && (x === "bottom" ? i > 0 : i < 0)) return !0;
|
|
1081
|
+
if (r && r.length > 0) return !1;
|
|
1082
|
+
if (P.current && a.getTime() - P.current.getTime() < l && i === 0 || t) return P.current = a, !1;
|
|
1083
|
+
for (; n;) {
|
|
1084
|
+
if (n.scrollHeight > n.clientHeight) {
|
|
1085
|
+
if (n.scrollTop !== 0) return P.current = /* @__PURE__ */ new Date(), !1;
|
|
1086
|
+
if (n.getAttribute("role") === "dialog") return !0;
|
|
1087
|
+
}
|
|
1088
|
+
n = n.parentNode;
|
|
1089
|
+
}
|
|
1090
|
+
return !0;
|
|
1091
|
+
}
|
|
1092
|
+
function Se(e) {
|
|
1093
|
+
if (L.current && k) {
|
|
1094
|
+
let t = x === "bottom" || x === "right" ? 1 : -1, n = (le.current - (X(x) ? e.pageY : e.pageX)) * t, i = n > 0, s = a && !u && !i;
|
|
1095
|
+
if (s && z === 0) return;
|
|
1096
|
+
let c = Math.abs(n), l = document.querySelector("[data-vaul-drawer-wrapper]"), d = c / (x === "bottom" || x === "top" ? R.current : fe.current), p = ye(c, i);
|
|
1097
|
+
if (p !== null && (d = p), s && d >= 1 || !F.current && !xe(e.target, i)) return;
|
|
1098
|
+
if (L.current.classList.add(Kt), F.current = !0, Y(L.current, { transition: "none" }), Y(j.current, { transition: "none" }), a && _e({ draggedDistance: n }), i && !a) {
|
|
1099
|
+
let e = Rt(n), r = Math.min(e * -1, 0) * t;
|
|
1100
|
+
Y(L.current, { transform: X(x) ? `translate3d(0, ${r}px, 0)` : `translate3d(${r}px, 0, 0)` });
|
|
1101
|
+
return;
|
|
1102
|
+
}
|
|
1103
|
+
let m = 1 - d;
|
|
1104
|
+
if ((ve || f && z === f - 1) && (r?.(e, d), Y(j.current, {
|
|
1105
|
+
opacity: `${m}`,
|
|
1106
|
+
transition: "none"
|
|
1107
|
+
}, !0)), l && j.current && o) {
|
|
1108
|
+
let e = Math.min(H() + d * (1 - H()), 1), t = 8 - d * 8, n = Math.max(0, 14 - d * 14);
|
|
1109
|
+
Y(l, {
|
|
1110
|
+
borderRadius: `${t}px`,
|
|
1111
|
+
transform: X(x) ? `scale(${e}) translate3d(0, ${n}px, 0)` : `scale(${e}) translate3d(${n}px, 0, 0)`,
|
|
1112
|
+
transition: "none"
|
|
1113
|
+
}, !0);
|
|
1114
|
+
}
|
|
1115
|
+
if (!a) {
|
|
1116
|
+
let e = c * t;
|
|
1117
|
+
Y(L.current, { transform: X(x) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)` });
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
h.useEffect(() => {
|
|
1122
|
+
window.requestAnimationFrame(() => {
|
|
1123
|
+
ue.current = !0;
|
|
1124
|
+
});
|
|
1125
|
+
}, []), h.useEffect(() => {
|
|
1126
|
+
var e;
|
|
1127
|
+
function t() {
|
|
1128
|
+
if (!L.current || !E) return;
|
|
1129
|
+
let e = document.activeElement;
|
|
1130
|
+
if (jt(e) || I.current) {
|
|
1131
|
+
let e = window.visualViewport?.height || 0, t = window.innerHeight, n = t - e, r = L.current.getBoundingClientRect().height || 0, i = r > t * .8;
|
|
1132
|
+
pe.current ||= r;
|
|
1133
|
+
let o = L.current.getBoundingClientRect().top;
|
|
1134
|
+
if (Math.abs(de.current - n) > 60 && (I.current = !I.current), a && a.length > 0 && B && z) {
|
|
1135
|
+
let e = B[z] || 0;
|
|
1136
|
+
n += e;
|
|
1137
|
+
}
|
|
1138
|
+
if (de.current = n, r > e || I.current) {
|
|
1139
|
+
let t = L.current.getBoundingClientRect().height, r = t;
|
|
1140
|
+
t > e && (r = e - (i ? o : Gt)), g ? L.current.style.height = `${t - Math.max(n, 0)}px` : L.current.style.height = `${Math.max(r, e - o)}px`;
|
|
1141
|
+
} else dt() || (L.current.style.height = `${pe.current}px`);
|
|
1142
|
+
a && a.length > 0 && !I.current ? L.current.style.bottom = "0px" : L.current.style.bottom = `${Math.max(n, 0)}px`;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
return (e = window.visualViewport) == null || e.addEventListener("resize", t), () => window.visualViewport?.removeEventListener("resize", t);
|
|
1146
|
+
}, [
|
|
1147
|
+
z,
|
|
1148
|
+
a,
|
|
1149
|
+
B
|
|
1150
|
+
]);
|
|
1151
|
+
function U(e) {
|
|
1152
|
+
W(), v?.(), e || ne(!1), setTimeout(() => {
|
|
1153
|
+
a && he(a[0]);
|
|
1154
|
+
}, Z.DURATION * 1e3);
|
|
1155
|
+
}
|
|
1156
|
+
function Ce() {
|
|
1157
|
+
if (!L.current) return;
|
|
1158
|
+
let e = document.querySelector("[data-vaul-drawer-wrapper]"), t = Lt(L.current, x);
|
|
1159
|
+
Y(L.current, {
|
|
1160
|
+
transform: "translate3d(0, 0, 0)",
|
|
1161
|
+
transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`
|
|
1162
|
+
}), Y(j.current, {
|
|
1163
|
+
transition: `opacity ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
1164
|
+
opacity: "1"
|
|
1165
|
+
}), o && t && t > 0 && O && Y(e, {
|
|
1166
|
+
borderRadius: `${Ut}px`,
|
|
1167
|
+
overflow: "hidden",
|
|
1168
|
+
...X(x) ? {
|
|
1169
|
+
transform: `scale(${H()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
1170
|
+
transformOrigin: "top"
|
|
1171
|
+
} : {
|
|
1172
|
+
transform: `scale(${H()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
1173
|
+
transformOrigin: "left"
|
|
1174
|
+
},
|
|
1175
|
+
transitionProperty: "transform, border-radius",
|
|
1176
|
+
transitionDuration: `${Z.DURATION}s`,
|
|
1177
|
+
transitionTimingFunction: `cubic-bezier(${Z.EASE.join(",")})`
|
|
1178
|
+
}, !0);
|
|
1179
|
+
}
|
|
1180
|
+
function W() {
|
|
1181
|
+
!k || !L.current || (L.current.classList.remove(Kt), F.current = !1, A(!1), N.current = /* @__PURE__ */ new Date());
|
|
1182
|
+
}
|
|
1183
|
+
function we(e) {
|
|
1184
|
+
if (!k || !L.current) return;
|
|
1185
|
+
L.current.classList.remove(Kt), F.current = !1, A(!1), N.current = /* @__PURE__ */ new Date();
|
|
1186
|
+
let t = Lt(L.current, x);
|
|
1187
|
+
if (!e || !xe(e.target, !1) || !t || Number.isNaN(t) || se.current === null) return;
|
|
1188
|
+
let n = N.current.getTime() - se.current.getTime(), r = le.current - (X(x) ? e.pageY : e.pageX), o = Math.abs(r) / n;
|
|
1189
|
+
if (o > .05 && (oe(!0), setTimeout(() => {
|
|
1190
|
+
oe(!1);
|
|
1191
|
+
}, 200)), a) {
|
|
1192
|
+
ge({
|
|
1193
|
+
draggedDistance: r * (x === "bottom" || x === "right" ? 1 : -1),
|
|
1194
|
+
closeDrawer: U,
|
|
1195
|
+
velocity: o,
|
|
1196
|
+
dismissible: u
|
|
1197
|
+
}), i?.(e, !0);
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
if (x === "bottom" || x === "right" ? r > 0 : r < 0) {
|
|
1201
|
+
Ce(), i?.(e, !0);
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
if (o > Bt) {
|
|
1205
|
+
U(), i?.(e, !1);
|
|
1206
|
+
return;
|
|
1207
|
+
}
|
|
1208
|
+
let s = Math.min(L.current.getBoundingClientRect().height ?? 0, window.innerHeight), l = Math.min(L.current.getBoundingClientRect().width ?? 0, window.innerWidth);
|
|
1209
|
+
if (Math.abs(t) >= (x === "left" || x === "right" ? l : s) * c) {
|
|
1210
|
+
U(), i?.(e, !1);
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
i?.(e, !0), Ce();
|
|
1214
|
+
}
|
|
1215
|
+
h.useEffect(() => (O && (Y(document.documentElement, { scrollBehavior: "auto" }), M.current = /* @__PURE__ */ new Date()), () => {
|
|
1216
|
+
It(document.documentElement, "scrollBehavior");
|
|
1217
|
+
}), [O]);
|
|
1218
|
+
function Te(e) {
|
|
1219
|
+
let t = e ? (window.innerWidth - Wt) / window.innerWidth : 1, n = e ? -16 : 0;
|
|
1220
|
+
ce.current && window.clearTimeout(ce.current), Y(L.current, {
|
|
1221
|
+
transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
1222
|
+
transform: X(x) ? `scale(${t}) translate3d(0, ${n}px, 0)` : `scale(${t}) translate3d(${n}px, 0, 0)`
|
|
1223
|
+
}), !e && L.current && (ce.current = setTimeout(() => {
|
|
1224
|
+
let e = Lt(L.current, x);
|
|
1225
|
+
Y(L.current, {
|
|
1226
|
+
transition: "none",
|
|
1227
|
+
transform: X(x) ? `translate3d(0, ${e}px, 0)` : `translate3d(${e}px, 0, 0)`
|
|
1228
|
+
});
|
|
1229
|
+
}, 500));
|
|
1230
|
+
}
|
|
1231
|
+
function Ee(e, t) {
|
|
1232
|
+
if (t < 0) return;
|
|
1233
|
+
let n = (window.innerWidth - Wt) / window.innerWidth, r = n + t * (1 - n), i = -16 + t * Wt;
|
|
1234
|
+
Y(L.current, {
|
|
1235
|
+
transform: X(x) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`,
|
|
1236
|
+
transition: "none"
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
function G(e, t) {
|
|
1240
|
+
let n = X(x) ? window.innerHeight : window.innerWidth, r = t ? (n - Wt) / n : 1, i = t ? -16 : 0;
|
|
1241
|
+
t && Y(L.current, {
|
|
1242
|
+
transition: `transform ${Z.DURATION}s cubic-bezier(${Z.EASE.join(",")})`,
|
|
1243
|
+
transform: X(x) ? `scale(${r}) translate3d(0, ${i}px, 0)` : `scale(${r}) translate3d(${i}px, 0, 0)`
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
return h.useEffect(() => {
|
|
1247
|
+
_ || window.requestAnimationFrame(() => {
|
|
1248
|
+
document.body.style.pointerEvents = "auto";
|
|
1249
|
+
});
|
|
1250
|
+
}, [_]), /*#__PURE__*/ h.createElement(tt, {
|
|
1251
|
+
defaultOpen: S,
|
|
1252
|
+
onOpenChange: (e) => {
|
|
1253
|
+
!u && !e || (e ? ie(!0) : U(!0), ne(e));
|
|
1254
|
+
},
|
|
1255
|
+
open: O
|
|
1256
|
+
}, /*#__PURE__*/ h.createElement(ut.Provider, { value: {
|
|
1257
|
+
activeSnapPoint: me,
|
|
1258
|
+
snapPoints: a,
|
|
1259
|
+
setActiveSnapPoint: he,
|
|
1260
|
+
drawerRef: L,
|
|
1261
|
+
overlayRef: j,
|
|
1262
|
+
onOpenChange: t,
|
|
1263
|
+
onPress: be,
|
|
1264
|
+
onRelease: we,
|
|
1265
|
+
onDrag: Se,
|
|
1266
|
+
dismissible: u,
|
|
1267
|
+
shouldAnimate: ue,
|
|
1268
|
+
handleOnly: d,
|
|
1269
|
+
isOpen: O,
|
|
1270
|
+
isDragging: k,
|
|
1271
|
+
shouldFade: ve,
|
|
1272
|
+
closeDrawer: U,
|
|
1273
|
+
onNestedDrag: Ee,
|
|
1274
|
+
onNestedOpenChange: Te,
|
|
1275
|
+
onNestedRelease: G,
|
|
1276
|
+
keyboardIsOpen: I,
|
|
1277
|
+
modal: _,
|
|
1278
|
+
snapPointsOffset: B,
|
|
1279
|
+
activeSnapPointIndex: z,
|
|
1280
|
+
direction: x,
|
|
1281
|
+
shouldScaleBackground: o,
|
|
1282
|
+
setBackgroundColorOnScale: s,
|
|
1283
|
+
noBodyStyles: b,
|
|
1284
|
+
container: ee,
|
|
1285
|
+
autoFocus: te
|
|
1286
|
+
} }, n));
|
|
1287
|
+
}
|
|
1288
|
+
var en = /*#__PURE__*/ h.forwardRef(function({ ...e }, t) {
|
|
1289
|
+
let { overlayRef: n, snapPoints: r, onRelease: i, shouldFade: a, isOpen: o, modal: s, shouldAnimate: c } = q(), l = Pt(t, n), u = r && r.length > 0;
|
|
1290
|
+
if (!s) return null;
|
|
1291
|
+
let d = h.useCallback((e) => i(e), [i]);
|
|
1292
|
+
return /*#__PURE__*/ h.createElement(it, {
|
|
1293
|
+
onMouseUp: d,
|
|
1294
|
+
ref: l,
|
|
1295
|
+
"data-vaul-overlay": "",
|
|
1296
|
+
"data-vaul-snap-points": o && u ? "true" : "false",
|
|
1297
|
+
"data-vaul-snap-points-overlay": o && a ? "true" : "false",
|
|
1298
|
+
"data-vaul-animate": c?.current ? "true" : "false",
|
|
1299
|
+
...e
|
|
1300
|
+
});
|
|
1301
|
+
});
|
|
1302
|
+
en.displayName = "Drawer.Overlay";
|
|
1303
|
+
var tn = /*#__PURE__*/ h.forwardRef(function({ onPointerDownOutside: e, style: t, onOpenAutoFocus: n, ...r }, i) {
|
|
1304
|
+
let { drawerRef: a, onPress: o, onRelease: s, onDrag: c, keyboardIsOpen: l, snapPointsOffset: u, activeSnapPointIndex: d, modal: f, isOpen: p, direction: m, snapPoints: g, container: _, handleOnly: v, shouldAnimate: y, autoFocus: b } = q(), [x, S] = h.useState(!1), C = Pt(i, a), w = h.useRef(null), T = h.useRef(null), E = h.useRef(!1), D = g && g.length > 0;
|
|
1305
|
+
Zt();
|
|
1306
|
+
let ee = (e, t, n = 0) => {
|
|
1307
|
+
if (E.current) return !0;
|
|
1308
|
+
let r = Math.abs(e.y), i = Math.abs(e.x), a = i > r, o = ["bottom", "right"].includes(t) ? 1 : -1;
|
|
1309
|
+
if (t === "left" || t === "right") {
|
|
1310
|
+
if (!(e.x * o < 0) && i >= 0 && i <= n) return a;
|
|
1311
|
+
} else if (!(e.y * o < 0) && r >= 0 && r <= n) return !a;
|
|
1312
|
+
return E.current = !0, !0;
|
|
1313
|
+
};
|
|
1314
|
+
h.useEffect(() => {
|
|
1315
|
+
D && window.requestAnimationFrame(() => {
|
|
1316
|
+
S(!0);
|
|
1317
|
+
});
|
|
1318
|
+
}, []);
|
|
1319
|
+
function te(e) {
|
|
1320
|
+
w.current = null, E.current = !1, s(e);
|
|
1321
|
+
}
|
|
1322
|
+
return /*#__PURE__*/ h.createElement(at, {
|
|
1323
|
+
"data-vaul-drawer-direction": m,
|
|
1324
|
+
"data-vaul-drawer": "",
|
|
1325
|
+
"data-vaul-delayed-snap-points": x ? "true" : "false",
|
|
1326
|
+
"data-vaul-snap-points": p && D ? "true" : "false",
|
|
1327
|
+
"data-vaul-custom-container": _ ? "true" : "false",
|
|
1328
|
+
"data-vaul-animate": y?.current ? "true" : "false",
|
|
1329
|
+
...r,
|
|
1330
|
+
ref: C,
|
|
1331
|
+
style: u && u.length > 0 ? {
|
|
1332
|
+
"--snap-point-height": `${u[d ?? 0]}px`,
|
|
1333
|
+
...t
|
|
1334
|
+
} : t,
|
|
1335
|
+
onPointerDown: (e) => {
|
|
1336
|
+
v || (r.onPointerDown == null || r.onPointerDown.call(r, e), w.current = {
|
|
1337
|
+
x: e.pageX,
|
|
1338
|
+
y: e.pageY
|
|
1339
|
+
}, o(e));
|
|
1340
|
+
},
|
|
1341
|
+
onOpenAutoFocus: (e) => {
|
|
1342
|
+
n?.(e), b || e.preventDefault();
|
|
1343
|
+
},
|
|
1344
|
+
onPointerDownOutside: (t) => {
|
|
1345
|
+
if (e?.(t), !f || t.defaultPrevented) {
|
|
1346
|
+
t.preventDefault();
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
l.current &&= !1;
|
|
1350
|
+
},
|
|
1351
|
+
onFocusOutside: (e) => {
|
|
1352
|
+
if (!f) {
|
|
1353
|
+
e.preventDefault();
|
|
1354
|
+
return;
|
|
1355
|
+
}
|
|
1356
|
+
},
|
|
1357
|
+
onPointerMove: (e) => {
|
|
1358
|
+
if (T.current = e, v || (r.onPointerMove == null || r.onPointerMove.call(r, e), !w.current)) return;
|
|
1359
|
+
let t = e.pageY - w.current.y, n = e.pageX - w.current.x, i = e.pointerType === "touch" ? 10 : 2;
|
|
1360
|
+
ee({
|
|
1361
|
+
x: n,
|
|
1362
|
+
y: t
|
|
1363
|
+
}, m, i) ? c(e) : (Math.abs(n) > i || Math.abs(t) > i) && (w.current = null);
|
|
1364
|
+
},
|
|
1365
|
+
onPointerUp: (e) => {
|
|
1366
|
+
r.onPointerUp == null || r.onPointerUp.call(r, e), w.current = null, E.current = !1, s(e);
|
|
1367
|
+
},
|
|
1368
|
+
onPointerOut: (e) => {
|
|
1369
|
+
r.onPointerOut == null || r.onPointerOut.call(r, e), te(T.current);
|
|
1370
|
+
},
|
|
1371
|
+
onContextMenu: (e) => {
|
|
1372
|
+
r.onContextMenu == null || r.onContextMenu.call(r, e), T.current && te(T.current);
|
|
1373
|
+
}
|
|
1374
|
+
});
|
|
1375
|
+
});
|
|
1376
|
+
tn.displayName = "Drawer.Content";
|
|
1377
|
+
var nn = 250, rn = 120, an = /*#__PURE__*/ h.forwardRef(function({ preventCycle: e = !1, children: t, ...n }, r) {
|
|
1378
|
+
let { closeDrawer: i, isDragging: a, snapPoints: o, activeSnapPoint: s, setActiveSnapPoint: c, dismissible: l, handleOnly: u, isOpen: d, onPress: f, onDrag: p } = q(), m = h.useRef(null), g = h.useRef(!1);
|
|
1379
|
+
function _() {
|
|
1380
|
+
if (g.current) {
|
|
1381
|
+
b();
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
window.setTimeout(() => {
|
|
1385
|
+
v();
|
|
1386
|
+
}, rn);
|
|
1387
|
+
}
|
|
1388
|
+
function v() {
|
|
1389
|
+
if (a || e || g.current) {
|
|
1390
|
+
b();
|
|
1391
|
+
return;
|
|
1392
|
+
}
|
|
1393
|
+
if (b(), !o || o.length === 0) {
|
|
1394
|
+
l || i();
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
if (s === o[o.length - 1] && l) {
|
|
1398
|
+
i();
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
let t = o.findIndex((e) => e === s);
|
|
1402
|
+
if (t === -1) return;
|
|
1403
|
+
let n = o[t + 1];
|
|
1404
|
+
c(n);
|
|
1405
|
+
}
|
|
1406
|
+
function y() {
|
|
1407
|
+
m.current = window.setTimeout(() => {
|
|
1408
|
+
g.current = !0;
|
|
1409
|
+
}, nn);
|
|
1410
|
+
}
|
|
1411
|
+
function b() {
|
|
1412
|
+
m.current && window.clearTimeout(m.current), g.current = !1;
|
|
1413
|
+
}
|
|
1414
|
+
return /*#__PURE__*/ h.createElement("div", {
|
|
1415
|
+
onClick: _,
|
|
1416
|
+
onPointerCancel: b,
|
|
1417
|
+
onPointerDown: (e) => {
|
|
1418
|
+
u && f(e), y();
|
|
1419
|
+
},
|
|
1420
|
+
onPointerMove: (e) => {
|
|
1421
|
+
u && p(e);
|
|
1422
|
+
},
|
|
1423
|
+
ref: r,
|
|
1424
|
+
"data-vaul-drawer-visible": d ? "true" : "false",
|
|
1425
|
+
"data-vaul-handle": "",
|
|
1426
|
+
"aria-hidden": "true",
|
|
1427
|
+
...n
|
|
1428
|
+
}, /*#__PURE__*/ h.createElement("span", {
|
|
1429
|
+
"data-vaul-handle-hitarea": "",
|
|
1430
|
+
"aria-hidden": "true"
|
|
1431
|
+
}, t));
|
|
1432
|
+
});
|
|
1433
|
+
an.displayName = "Drawer.Handle";
|
|
1434
|
+
function on({ onDrag: e, onOpenChange: t, open: n, ...r }) {
|
|
1435
|
+
let { onNestedDrag: i, onNestedOpenChange: a, onNestedRelease: o } = q();
|
|
1436
|
+
if (!i) throw Error("Drawer.NestedRoot must be placed in another drawer");
|
|
1437
|
+
return /*#__PURE__*/ h.createElement($t, {
|
|
1438
|
+
nested: !0,
|
|
1439
|
+
open: n,
|
|
1440
|
+
onClose: () => {
|
|
1441
|
+
a(!1);
|
|
1442
|
+
},
|
|
1443
|
+
onDrag: (t, n) => {
|
|
1444
|
+
i(t, n), e?.(t, n);
|
|
1445
|
+
},
|
|
1446
|
+
onOpenChange: (e) => {
|
|
1447
|
+
e && a(e), t?.(e);
|
|
1448
|
+
},
|
|
1449
|
+
onRelease: o,
|
|
1450
|
+
...r
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
function sn(e) {
|
|
1454
|
+
let t = q(), { container: n = t.container, ...r } = e;
|
|
1455
|
+
return /*#__PURE__*/ h.createElement(rt, {
|
|
1456
|
+
container: n,
|
|
1457
|
+
...r
|
|
1458
|
+
});
|
|
1459
|
+
}
|
|
1460
|
+
var $ = {
|
|
1461
|
+
Root: $t,
|
|
1462
|
+
NestedRoot: on,
|
|
1463
|
+
Content: tn,
|
|
1464
|
+
Overlay: en,
|
|
1465
|
+
Trigger: nt,
|
|
1466
|
+
Portal: sn,
|
|
1467
|
+
Handle: an,
|
|
1468
|
+
Close: ct,
|
|
1469
|
+
Title: ot,
|
|
1470
|
+
Description: st
|
|
1471
|
+
};
|
|
1472
|
+
//#endregion
|
|
1473
|
+
//#region src/components/ui/drawer.tsx
|
|
1474
|
+
function cn({ ...e }) {
|
|
1475
|
+
return /* @__PURE__ */ b($.Root, {
|
|
1476
|
+
"data-slot": "drawer",
|
|
1477
|
+
...e
|
|
1478
|
+
});
|
|
1479
|
+
}
|
|
1480
|
+
function ln({ ...e }) {
|
|
1481
|
+
return /* @__PURE__ */ b($.Trigger, {
|
|
1482
|
+
"data-slot": "drawer-trigger",
|
|
1483
|
+
...e
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
function un({ ...e }) {
|
|
1487
|
+
return /* @__PURE__ */ b($.Portal, {
|
|
1488
|
+
"data-slot": "drawer-portal",
|
|
1489
|
+
...e
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
function dn({ ...e }) {
|
|
1493
|
+
return /* @__PURE__ */ b($.Close, {
|
|
1494
|
+
"data-slot": "drawer-close",
|
|
1495
|
+
...e
|
|
1496
|
+
});
|
|
1497
|
+
}
|
|
1498
|
+
function fn({ className: e, ...t }) {
|
|
1499
|
+
return /* @__PURE__ */ b($.Overlay, {
|
|
1500
|
+
className: c("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-1000 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in", e),
|
|
1501
|
+
"data-slot": "drawer-overlay",
|
|
1502
|
+
...t
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
function pn({ className: e, children: t, ...n }) {
|
|
1506
|
+
return /* @__PURE__ */ x(un, {
|
|
1507
|
+
"data-slot": "drawer-portal",
|
|
1508
|
+
children: [/* @__PURE__ */ b(fn, {}), /* @__PURE__ */ b($.Content, {
|
|
1509
|
+
className: c("group/drawer-content fixed z-1000 flex h-auto flex-col bg-white", "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b", "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-0", "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm", "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm", e),
|
|
1510
|
+
"data-slot": "drawer-content",
|
|
1511
|
+
...n,
|
|
1512
|
+
children: t
|
|
1513
|
+
})]
|
|
1514
|
+
});
|
|
1515
|
+
}
|
|
1516
|
+
function mn({ className: e, ...t }) {
|
|
1517
|
+
return /* @__PURE__ */ b("div", {
|
|
1518
|
+
className: c("flex flex-col gap-2 p-5", e),
|
|
1519
|
+
"data-slot": "drawer-header",
|
|
1520
|
+
...t
|
|
1521
|
+
});
|
|
1522
|
+
}
|
|
1523
|
+
function hn({ className: e, ...t }) {
|
|
1524
|
+
return /* @__PURE__ */ b("div", {
|
|
1525
|
+
className: c("mt-auto flex flex-col gap-2 p-5", e),
|
|
1526
|
+
"data-slot": "drawer-footer",
|
|
1527
|
+
...t
|
|
1528
|
+
});
|
|
1529
|
+
}
|
|
1530
|
+
function gn({ className: e, ...t }) {
|
|
1531
|
+
return /* @__PURE__ */ b($.Title, {
|
|
1532
|
+
className: c("font-semibold text-foreground", e),
|
|
1533
|
+
"data-slot": "drawer-title",
|
|
1534
|
+
...t
|
|
1535
|
+
});
|
|
1536
|
+
}
|
|
1537
|
+
function _n({ className: e, ...t }) {
|
|
1538
|
+
return /* @__PURE__ */ b($.Description, {
|
|
1539
|
+
className: c("text-muted-foreground text-sm", e),
|
|
1540
|
+
"data-slot": "drawer-description",
|
|
1541
|
+
...t
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
//#endregion
|
|
1545
|
+
export { hn as a, un as c, _n as i, gn as l, dn as n, mn as o, pn as r, fn as s, cn as t, ln as u };
|