@withgus/debug 1.1.0 โ 1.2.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/components/DebugDrawer/DebugDrawer.d.ts +1 -6
- package/dist/debug.css +1 -1
- package/dist/hooks/useRegisterMockEndpoints.d.ts +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.d.ts +5 -5
- package/dist/index.js +1035 -983
- package/dist/mocks/types.d.ts +3 -3
- package/dist/store/debugDrawerStore.d.ts +2 -2
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as c from "react";
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { create as
|
|
2
|
+
import b, { useState as mt, useMemo as ir, useLayoutEffect as cr, useEffect as wt, useCallback as lr, useRef as ur } from "react";
|
|
3
|
+
import * as dr from "react-dom";
|
|
4
|
+
import fr from "react-dom";
|
|
5
|
+
import { create as mr } from "zustand";
|
|
6
6
|
var Fe = { exports: {} }, De = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
@@ -13,10 +13,10 @@ var Fe = { exports: {} }, De = {};
|
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
16
|
+
var At;
|
|
17
|
+
function pr() {
|
|
18
|
+
if (At) return De;
|
|
19
|
+
At = 1;
|
|
20
20
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
21
21
|
function n(r, a, o) {
|
|
22
22
|
var i = null;
|
|
@@ -35,7 +35,7 @@ function ur() {
|
|
|
35
35
|
}
|
|
36
36
|
return De.Fragment = t, De.jsx = n, De.jsxs = n, De;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var _e = {};
|
|
39
39
|
/**
|
|
40
40
|
* @license React
|
|
41
41
|
* react-jsx-runtime.development.js
|
|
@@ -46,12 +46,12 @@ var Ae = {};
|
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
47
|
*/
|
|
48
48
|
var kt;
|
|
49
|
-
function
|
|
49
|
+
function vr() {
|
|
50
50
|
return kt || (kt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
51
51
|
function e(u) {
|
|
52
52
|
if (u == null) return null;
|
|
53
53
|
if (typeof u == "function")
|
|
54
|
-
return u.$$typeof ===
|
|
54
|
+
return u.$$typeof === U ? null : u.displayName || u.name || null;
|
|
55
55
|
if (typeof u == "string") return u;
|
|
56
56
|
switch (u) {
|
|
57
57
|
case S:
|
|
@@ -64,25 +64,25 @@ function dr() {
|
|
|
64
64
|
return "Suspense";
|
|
65
65
|
case w:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
67
|
+
case W:
|
|
68
68
|
return "Activity";
|
|
69
69
|
}
|
|
70
70
|
if (typeof u == "object")
|
|
71
71
|
switch (typeof u.tag == "number" && console.error(
|
|
72
72
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
73
|
), u.$$typeof) {
|
|
74
|
-
case
|
|
74
|
+
case m:
|
|
75
75
|
return "Portal";
|
|
76
76
|
case y:
|
|
77
77
|
return u.displayName || "Context";
|
|
78
78
|
case P:
|
|
79
79
|
return (u._context.displayName || "Context") + ".Consumer";
|
|
80
|
-
case
|
|
80
|
+
case E:
|
|
81
81
|
var D = u.render;
|
|
82
82
|
return u = u.displayName, u || (u = D.displayName || D.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
83
|
-
case
|
|
83
|
+
case A:
|
|
84
84
|
return D = u.displayName || null, D !== null ? D : e(u.type) || "Memo";
|
|
85
|
-
case
|
|
85
|
+
case N:
|
|
86
86
|
D = u._payload, u = u._init;
|
|
87
87
|
try {
|
|
88
88
|
return e(u(D));
|
|
@@ -103,17 +103,17 @@ function dr() {
|
|
|
103
103
|
}
|
|
104
104
|
if (D) {
|
|
105
105
|
D = console;
|
|
106
|
-
var
|
|
107
|
-
return
|
|
106
|
+
var I = D.error, L = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
107
|
+
return I.call(
|
|
108
108
|
D,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
110
|
+
L
|
|
111
111
|
), t(u);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
function r(u) {
|
|
115
115
|
if (u === S) return "<>";
|
|
116
|
-
if (typeof u == "object" && u !== null && u.$$typeof ===
|
|
116
|
+
if (typeof u == "object" && u !== null && u.$$typeof === N)
|
|
117
117
|
return "<...>";
|
|
118
118
|
try {
|
|
119
119
|
var D = e(u);
|
|
@@ -123,28 +123,28 @@ function dr() {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
function a() {
|
|
126
|
-
var u =
|
|
126
|
+
var u = V.A;
|
|
127
127
|
return u === null ? null : u.getOwner();
|
|
128
128
|
}
|
|
129
129
|
function o() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
132
|
function i(u) {
|
|
133
|
-
if (
|
|
133
|
+
if (x.call(u, "key")) {
|
|
134
134
|
var D = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
135
135
|
if (D && D.isReactWarning) return !1;
|
|
136
136
|
}
|
|
137
137
|
return u.key !== void 0;
|
|
138
138
|
}
|
|
139
139
|
function s(u, D) {
|
|
140
|
-
function
|
|
141
|
-
|
|
140
|
+
function I() {
|
|
141
|
+
K || (K = !0, console.error(
|
|
142
142
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
143
|
D
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
I.isReactWarning = !0, Object.defineProperty(u, "key", {
|
|
147
|
+
get: I,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -154,15 +154,15 @@ function dr() {
|
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
155
|
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
157
|
+
function p(u, D, I, L, le, ve) {
|
|
158
|
+
var $ = I.ref;
|
|
159
159
|
return u = {
|
|
160
|
-
$$typeof:
|
|
160
|
+
$$typeof: O,
|
|
161
161
|
type: u,
|
|
162
162
|
key: D,
|
|
163
|
-
props:
|
|
164
|
-
_owner:
|
|
165
|
-
}, (
|
|
163
|
+
props: I,
|
|
164
|
+
_owner: L
|
|
165
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(u, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: v
|
|
168
168
|
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
@@ -187,61 +187,61 @@ function dr() {
|
|
|
187
187
|
value: ve
|
|
188
188
|
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
for (
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
190
|
+
function f(u, D, I, L, le, ve) {
|
|
191
|
+
var $ = D.children;
|
|
192
|
+
if ($ !== void 0)
|
|
193
|
+
if (L)
|
|
194
|
+
if (G($)) {
|
|
195
|
+
for (L = 0; L < $.length; L++)
|
|
196
|
+
l($[L]);
|
|
197
|
+
Object.freeze && Object.freeze($);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
200
200
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
201
|
);
|
|
202
|
-
else
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
var
|
|
202
|
+
else l($);
|
|
203
|
+
if (x.call(D, "key")) {
|
|
204
|
+
$ = e(u);
|
|
205
|
+
var ee = Object.keys(D).filter(function(Pe) {
|
|
206
206
|
return Pe !== "key";
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
L = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", ce[$ + L] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
212
212
|
React keys must be passed directly to JSX without using spread:
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
W,
|
|
216
215
|
L,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
$,
|
|
217
|
+
ee,
|
|
218
|
+
$
|
|
219
|
+
), ce[$ + L] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
221
|
+
if ($ = null, I !== void 0 && (n(I), $ = "" + I), i(D) && (n(D.key), $ = "" + D.key), "key" in D) {
|
|
222
|
+
I = {};
|
|
223
223
|
for (var he in D)
|
|
224
|
-
he !== "key" && (
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
|
|
224
|
+
he !== "key" && (I[he] = D[he]);
|
|
225
|
+
} else I = D;
|
|
226
|
+
return $ && s(
|
|
227
|
+
I,
|
|
228
228
|
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
229
|
-
),
|
|
229
|
+
), p(
|
|
230
230
|
u,
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
$,
|
|
232
|
+
I,
|
|
233
233
|
a(),
|
|
234
234
|
le,
|
|
235
235
|
ve
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
h(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof ===
|
|
238
|
+
function l(u) {
|
|
239
|
+
h(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === N && (u._payload.status === "fulfilled" ? h(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
|
|
240
240
|
}
|
|
241
241
|
function h(u) {
|
|
242
|
-
return typeof u == "object" && u !== null && u.$$typeof ===
|
|
242
|
+
return typeof u == "object" && u !== null && u.$$typeof === O;
|
|
243
243
|
}
|
|
244
|
-
var R =
|
|
244
|
+
var R = b, O = Symbol.for("react.transitional.element"), m = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), P = Symbol.for("react.consumer"), y = Symbol.for("react.context"), E = Symbol.for("react.forward_ref"), F = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), N = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), U = Symbol.for("react.client.reference"), V = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, x = Object.prototype.hasOwnProperty, G = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
R = {
|
|
@@ -249,69 +249,69 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
return u();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var
|
|
252
|
+
var K, q = {}, Q = R.react_stack_bottom_frame.bind(
|
|
253
253
|
R,
|
|
254
254
|
o
|
|
255
|
-
)(),
|
|
256
|
-
|
|
257
|
-
var
|
|
258
|
-
return
|
|
255
|
+
)(), te = z(r(o)), ce = {};
|
|
256
|
+
_e.Fragment = S, _e.jsx = function(u, D, I) {
|
|
257
|
+
var L = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return f(
|
|
259
259
|
u,
|
|
260
260
|
D,
|
|
261
|
-
|
|
261
|
+
I,
|
|
262
262
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
L ? Error("react-stack-top-frame") : Q,
|
|
264
|
+
L ? z(r(u)) : te
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var
|
|
268
|
-
return
|
|
266
|
+
}, _e.jsxs = function(u, D, I) {
|
|
267
|
+
var L = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return f(
|
|
269
269
|
u,
|
|
270
270
|
D,
|
|
271
|
-
|
|
271
|
+
I,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
L ? Error("react-stack-top-frame") : Q,
|
|
274
|
+
L ? z(r(u)) : te
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), _e;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
279
|
+
var It;
|
|
280
|
+
function hr() {
|
|
281
|
+
return It || (It = 1, process.env.NODE_ENV === "production" ? Fe.exports = pr() : Fe.exports = vr()), Fe.exports;
|
|
282
282
|
}
|
|
283
|
-
var d =
|
|
283
|
+
var d = hr();
|
|
284
284
|
function pe(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
285
285
|
return function(a) {
|
|
286
286
|
if (e == null || e(a), n === !1 || !a.defaultPrevented)
|
|
287
287
|
return t == null ? void 0 : t(a);
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function Mt(e, t) {
|
|
291
291
|
if (typeof e == "function")
|
|
292
292
|
return e(t);
|
|
293
293
|
e != null && (e.current = t);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function nn(...e) {
|
|
296
296
|
return (t) => {
|
|
297
297
|
let n = !1;
|
|
298
298
|
const r = e.map((a) => {
|
|
299
|
-
const o =
|
|
299
|
+
const o = Mt(a, t);
|
|
300
300
|
return !n && typeof o == "function" && (n = !0), o;
|
|
301
301
|
});
|
|
302
302
|
if (n)
|
|
303
303
|
return () => {
|
|
304
304
|
for (let a = 0; a < r.length; a++) {
|
|
305
305
|
const o = r[a];
|
|
306
|
-
typeof o == "function" ? o() :
|
|
306
|
+
typeof o == "function" ? o() : Mt(e[a], null);
|
|
307
307
|
}
|
|
308
308
|
};
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
function ye(...e) {
|
|
312
|
-
return c.useCallback(
|
|
312
|
+
return c.useCallback(nn(...e), e);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
314
|
+
function gr(e, t) {
|
|
315
315
|
const n = c.createContext(t), r = (o) => {
|
|
316
316
|
const { children: i, ...s } = o, v = c.useMemo(() => s, Object.values(s));
|
|
317
317
|
return /* @__PURE__ */ d.jsx(n.Provider, { value: v, children: i });
|
|
@@ -325,25 +325,25 @@ function mr(e, t) {
|
|
|
325
325
|
}
|
|
326
326
|
return [r, a];
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function wr(e, t = []) {
|
|
329
329
|
let n = [];
|
|
330
330
|
function r(o, i) {
|
|
331
331
|
const s = c.createContext(i), v = n.length;
|
|
332
332
|
n = [...n, i];
|
|
333
|
-
const
|
|
333
|
+
const p = (l) => {
|
|
334
334
|
var g;
|
|
335
|
-
const { scope: h, children: R, ...
|
|
336
|
-
return /* @__PURE__ */ d.jsx(
|
|
335
|
+
const { scope: h, children: R, ...O } = l, m = ((g = h == null ? void 0 : h[e]) == null ? void 0 : g[v]) || s, S = c.useMemo(() => O, Object.values(O));
|
|
336
|
+
return /* @__PURE__ */ d.jsx(m.Provider, { value: S, children: R });
|
|
337
337
|
};
|
|
338
|
-
|
|
339
|
-
function
|
|
340
|
-
var
|
|
341
|
-
const R = ((
|
|
342
|
-
if (
|
|
338
|
+
p.displayName = o + "Provider";
|
|
339
|
+
function f(l, h) {
|
|
340
|
+
var m;
|
|
341
|
+
const R = ((m = h == null ? void 0 : h[e]) == null ? void 0 : m[v]) || s, O = c.useContext(R);
|
|
342
|
+
if (O) return O;
|
|
343
343
|
if (i !== void 0) return i;
|
|
344
|
-
throw new Error(`\`${
|
|
344
|
+
throw new Error(`\`${l}\` must be used within \`${o}\``);
|
|
345
345
|
}
|
|
346
|
-
return [
|
|
346
|
+
return [p, f];
|
|
347
347
|
}
|
|
348
348
|
const a = () => {
|
|
349
349
|
const o = n.map((i) => c.createContext(i));
|
|
@@ -355,9 +355,9 @@ function pr(e, t = []) {
|
|
|
355
355
|
);
|
|
356
356
|
};
|
|
357
357
|
};
|
|
358
|
-
return a.scopeName = e, [r,
|
|
358
|
+
return a.scopeName = e, [r, br(a, ...t)];
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function br(...e) {
|
|
361
361
|
const t = e[0];
|
|
362
362
|
if (e.length === 1) return t;
|
|
363
363
|
const n = () => {
|
|
@@ -366,102 +366,102 @@ function vr(...e) {
|
|
|
366
366
|
scopeName: a.scopeName
|
|
367
367
|
}));
|
|
368
368
|
return function(o) {
|
|
369
|
-
const i = r.reduce((s, { useScope: v, scopeName:
|
|
370
|
-
const
|
|
371
|
-
return { ...s, ...
|
|
369
|
+
const i = r.reduce((s, { useScope: v, scopeName: p }) => {
|
|
370
|
+
const l = v(o)[`__scope${p}`];
|
|
371
|
+
return { ...s, ...l };
|
|
372
372
|
}, {});
|
|
373
373
|
return c.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
|
|
374
374
|
};
|
|
375
375
|
};
|
|
376
376
|
return n.scopeName = t.scopeName, n;
|
|
377
377
|
}
|
|
378
|
-
var
|
|
379
|
-
},
|
|
380
|
-
}),
|
|
381
|
-
function
|
|
382
|
-
const [t, n] = c.useState(
|
|
383
|
-
return
|
|
384
|
-
n((r) => r ?? String(
|
|
378
|
+
var Ie = globalThis != null && globalThis.document ? c.useLayoutEffect : () => {
|
|
379
|
+
}, yr = c[" useId ".trim().toString()] || (() => {
|
|
380
|
+
}), Er = 0;
|
|
381
|
+
function et(e) {
|
|
382
|
+
const [t, n] = c.useState(yr());
|
|
383
|
+
return Ie(() => {
|
|
384
|
+
n((r) => r ?? String(Er++));
|
|
385
385
|
}, [e]), e || (t ? `radix-${t}` : "");
|
|
386
386
|
}
|
|
387
|
-
var
|
|
388
|
-
function
|
|
387
|
+
var Sr = c[" useInsertionEffect ".trim().toString()] || Ie;
|
|
388
|
+
function Rr({
|
|
389
389
|
prop: e,
|
|
390
390
|
defaultProp: t,
|
|
391
391
|
onChange: n = () => {
|
|
392
392
|
},
|
|
393
393
|
caller: r
|
|
394
394
|
}) {
|
|
395
|
-
const [a, o, i] =
|
|
395
|
+
const [a, o, i] = xr({
|
|
396
396
|
defaultProp: t,
|
|
397
397
|
onChange: n
|
|
398
398
|
}), s = e !== void 0, v = s ? e : a;
|
|
399
399
|
{
|
|
400
|
-
const
|
|
400
|
+
const f = c.useRef(e !== void 0);
|
|
401
401
|
c.useEffect(() => {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
`${r} is changing from ${
|
|
405
|
-
),
|
|
402
|
+
const l = f.current;
|
|
403
|
+
l !== s && console.warn(
|
|
404
|
+
`${r} is changing from ${l ? "controlled" : "uncontrolled"} to ${s ? "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.`
|
|
405
|
+
), f.current = s;
|
|
406
406
|
}, [s, r]);
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
(
|
|
410
|
-
var
|
|
408
|
+
const p = c.useCallback(
|
|
409
|
+
(f) => {
|
|
410
|
+
var l;
|
|
411
411
|
if (s) {
|
|
412
|
-
const h =
|
|
413
|
-
h !== e && ((
|
|
412
|
+
const h = Cr(f) ? f(e) : f;
|
|
413
|
+
h !== e && ((l = i.current) == null || l.call(i, h));
|
|
414
414
|
} else
|
|
415
|
-
o(
|
|
415
|
+
o(f);
|
|
416
416
|
},
|
|
417
417
|
[s, e, o, i]
|
|
418
418
|
);
|
|
419
|
-
return [v,
|
|
419
|
+
return [v, p];
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function xr({
|
|
422
422
|
defaultProp: e,
|
|
423
423
|
onChange: t
|
|
424
424
|
}) {
|
|
425
425
|
const [n, r] = c.useState(e), a = c.useRef(n), o = c.useRef(t);
|
|
426
|
-
return
|
|
426
|
+
return Sr(() => {
|
|
427
427
|
o.current = t;
|
|
428
428
|
}, [t]), c.useEffect(() => {
|
|
429
429
|
var i;
|
|
430
430
|
a.current !== n && ((i = o.current) == null || i.call(o, n), a.current = n);
|
|
431
431
|
}, [n, a]), [n, r, o];
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function Cr(e) {
|
|
434
434
|
return typeof e == "function";
|
|
435
435
|
}
|
|
436
436
|
// @__NO_SIDE_EFFECTS__
|
|
437
|
-
function
|
|
438
|
-
const t = /* @__PURE__ */
|
|
439
|
-
const { children: o, ...i } = r, s = c.Children.toArray(o), v = s.find(
|
|
437
|
+
function rn(e) {
|
|
438
|
+
const t = /* @__PURE__ */ Tr(e), n = c.forwardRef((r, a) => {
|
|
439
|
+
const { children: o, ...i } = r, s = c.Children.toArray(o), v = s.find(Or);
|
|
440
440
|
if (v) {
|
|
441
|
-
const
|
|
442
|
-
return /* @__PURE__ */ d.jsx(t, { ...i, ref: a, children: c.isValidElement(
|
|
441
|
+
const p = v.props.children, f = s.map((l) => l === v ? c.Children.count(p) > 1 ? c.Children.only(null) : c.isValidElement(p) ? p.props.children : null : l);
|
|
442
|
+
return /* @__PURE__ */ d.jsx(t, { ...i, ref: a, children: c.isValidElement(p) ? c.cloneElement(p, void 0, f) : null });
|
|
443
443
|
}
|
|
444
444
|
return /* @__PURE__ */ d.jsx(t, { ...i, ref: a, children: o });
|
|
445
445
|
});
|
|
446
446
|
return n.displayName = `${e}.Slot`, n;
|
|
447
447
|
}
|
|
448
448
|
// @__NO_SIDE_EFFECTS__
|
|
449
|
-
function
|
|
449
|
+
function Tr(e) {
|
|
450
450
|
const t = c.forwardRef((n, r) => {
|
|
451
451
|
const { children: a, ...o } = n;
|
|
452
452
|
if (c.isValidElement(a)) {
|
|
453
|
-
const i =
|
|
454
|
-
return a.type !== c.Fragment && (s.ref = r ?
|
|
453
|
+
const i = Dr(a), s = Nr(o, a.props);
|
|
454
|
+
return a.type !== c.Fragment && (s.ref = r ? nn(r, i) : i), c.cloneElement(a, s);
|
|
455
455
|
}
|
|
456
456
|
return c.Children.count(a) > 1 ? c.Children.only(null) : null;
|
|
457
457
|
});
|
|
458
458
|
return t.displayName = `${e}.SlotClone`, t;
|
|
459
459
|
}
|
|
460
|
-
var
|
|
461
|
-
function
|
|
462
|
-
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
460
|
+
var Pr = Symbol("radix.slottable");
|
|
461
|
+
function Or(e) {
|
|
462
|
+
return c.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Pr;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Nr(e, t) {
|
|
465
465
|
const n = { ...t };
|
|
466
466
|
for (const r in t) {
|
|
467
467
|
const a = e[r], o = t[r];
|
|
@@ -472,12 +472,12 @@ function xr(e, t) {
|
|
|
472
472
|
}
|
|
473
473
|
return { ...e, ...n };
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function Dr(e) {
|
|
476
476
|
var r, a;
|
|
477
477
|
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
478
478
|
return n ? e.ref : (t = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
479
479
|
}
|
|
480
|
-
var
|
|
480
|
+
var _r = [
|
|
481
481
|
"a",
|
|
482
482
|
"button",
|
|
483
483
|
"div",
|
|
@@ -495,17 +495,17 @@ var Pr = [
|
|
|
495
495
|
"span",
|
|
496
496
|
"svg",
|
|
497
497
|
"ul"
|
|
498
|
-
], ie =
|
|
499
|
-
const n = /* @__PURE__ */
|
|
498
|
+
], ie = _r.reduce((e, t) => {
|
|
499
|
+
const n = /* @__PURE__ */ rn(`Primitive.${t}`), r = c.forwardRef((a, o) => {
|
|
500
500
|
const { asChild: i, ...s } = a, v = i ? n : t;
|
|
501
501
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d.jsx(v, { ...s, ref: o });
|
|
502
502
|
});
|
|
503
503
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
504
504
|
}, {});
|
|
505
|
-
function
|
|
506
|
-
e &&
|
|
505
|
+
function Ar(e, t) {
|
|
506
|
+
e && dr.flushSync(() => e.dispatchEvent(t));
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Me(e) {
|
|
509
509
|
const t = c.useRef(e);
|
|
510
510
|
return c.useEffect(() => {
|
|
511
511
|
t.current = e;
|
|
@@ -514,8 +514,8 @@ function Ie(e) {
|
|
|
514
514
|
return (r = t.current) == null ? void 0 : r.call(t, ...n);
|
|
515
515
|
}, []);
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
const n =
|
|
517
|
+
function kr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
518
|
+
const n = Me(e);
|
|
519
519
|
c.useEffect(() => {
|
|
520
520
|
const r = (a) => {
|
|
521
521
|
a.key === "Escape" && n(a);
|
|
@@ -523,11 +523,11 @@ function Or(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
523
523
|
return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
|
|
524
524
|
}, [n, t]);
|
|
525
525
|
}
|
|
526
|
-
var
|
|
526
|
+
var Ir = "DismissableLayer", pt = "dismissableLayer.update", Mr = "dismissableLayer.pointerDownOutside", jr = "dismissableLayer.focusOutside", jt, an = c.createContext({
|
|
527
527
|
layers: /* @__PURE__ */ new Set(),
|
|
528
528
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
529
529
|
branches: /* @__PURE__ */ new Set()
|
|
530
|
-
}),
|
|
530
|
+
}), on = c.forwardRef(
|
|
531
531
|
(e, t) => {
|
|
532
532
|
const {
|
|
533
533
|
disableOutsidePointerEvents: n = !1,
|
|
@@ -537,30 +537,30 @@ var Dr = "DismissableLayer", pt = "dismissableLayer.update", Ar = "dismissableLa
|
|
|
537
537
|
onInteractOutside: i,
|
|
538
538
|
onDismiss: s,
|
|
539
539
|
...v
|
|
540
|
-
} = e,
|
|
541
|
-
const
|
|
542
|
-
!y ||
|
|
543
|
-
}, h), F =
|
|
544
|
-
const
|
|
545
|
-
[...
|
|
540
|
+
} = e, p = c.useContext(an), [f, l] = c.useState(null), h = (f == null ? void 0 : f.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, R] = c.useState({}), O = ye(t, (w) => l(w)), m = Array.from(p.layers), [S] = [...p.layersWithOutsidePointerEventsDisabled].slice(-1), g = m.indexOf(S), T = f ? m.indexOf(f) : -1, P = p.layersWithOutsidePointerEventsDisabled.size > 0, y = T >= g, E = Fr((w) => {
|
|
541
|
+
const A = w.target, N = [...p.branches].some((W) => W.contains(A));
|
|
542
|
+
!y || N || (a == null || a(w), i == null || i(w), w.defaultPrevented || s == null || s());
|
|
543
|
+
}, h), F = Wr((w) => {
|
|
544
|
+
const A = w.target;
|
|
545
|
+
[...p.branches].some((W) => W.contains(A)) || (o == null || o(w), i == null || i(w), w.defaultPrevented || s == null || s());
|
|
546
546
|
}, h);
|
|
547
|
-
return
|
|
548
|
-
T ===
|
|
547
|
+
return kr((w) => {
|
|
548
|
+
T === p.layers.size - 1 && (r == null || r(w), !w.defaultPrevented && s && (w.preventDefault(), s()));
|
|
549
549
|
}, h), c.useEffect(() => {
|
|
550
|
-
if (
|
|
551
|
-
return n && (
|
|
552
|
-
n &&
|
|
550
|
+
if (f)
|
|
551
|
+
return n && (p.layersWithOutsidePointerEventsDisabled.size === 0 && (jt = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), p.layersWithOutsidePointerEventsDisabled.add(f)), p.layers.add(f), $t(), () => {
|
|
552
|
+
n && p.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = jt);
|
|
553
553
|
};
|
|
554
|
-
}, [
|
|
555
|
-
|
|
556
|
-
}, [
|
|
554
|
+
}, [f, h, n, p]), c.useEffect(() => () => {
|
|
555
|
+
f && (p.layers.delete(f), p.layersWithOutsidePointerEventsDisabled.delete(f), $t());
|
|
556
|
+
}, [f, p]), c.useEffect(() => {
|
|
557
557
|
const w = () => R({});
|
|
558
558
|
return document.addEventListener(pt, w), () => document.removeEventListener(pt, w);
|
|
559
559
|
}, []), /* @__PURE__ */ d.jsx(
|
|
560
560
|
ie.div,
|
|
561
561
|
{
|
|
562
562
|
...v,
|
|
563
|
-
ref:
|
|
563
|
+
ref: O,
|
|
564
564
|
style: {
|
|
565
565
|
pointerEvents: P ? y ? "auto" : "none" : void 0,
|
|
566
566
|
...e.style
|
|
@@ -569,15 +569,15 @@ var Dr = "DismissableLayer", pt = "dismissableLayer.update", Ar = "dismissableLa
|
|
|
569
569
|
onBlurCapture: pe(e.onBlurCapture, F.onBlurCapture),
|
|
570
570
|
onPointerDownCapture: pe(
|
|
571
571
|
e.onPointerDownCapture,
|
|
572
|
-
|
|
572
|
+
E.onPointerDownCapture
|
|
573
573
|
)
|
|
574
574
|
}
|
|
575
575
|
);
|
|
576
576
|
}
|
|
577
577
|
);
|
|
578
|
-
|
|
579
|
-
var
|
|
580
|
-
const n = c.useContext(
|
|
578
|
+
on.displayName = Ir;
|
|
579
|
+
var $r = "DismissableLayerBranch", Lr = c.forwardRef((e, t) => {
|
|
580
|
+
const n = c.useContext(an), r = c.useRef(null), a = ye(t, r);
|
|
581
581
|
return c.useEffect(() => {
|
|
582
582
|
const o = r.current;
|
|
583
583
|
if (o)
|
|
@@ -586,22 +586,22 @@ var kr = "DismissableLayerBranch", Mr = c.forwardRef((e, t) => {
|
|
|
586
586
|
};
|
|
587
587
|
}, [n.branches]), /* @__PURE__ */ d.jsx(ie.div, { ...e, ref: a });
|
|
588
588
|
});
|
|
589
|
-
|
|
590
|
-
function
|
|
591
|
-
const n =
|
|
589
|
+
Lr.displayName = $r;
|
|
590
|
+
function Fr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
591
|
+
const n = Me(e), r = c.useRef(!1), a = c.useRef(() => {
|
|
592
592
|
});
|
|
593
593
|
return c.useEffect(() => {
|
|
594
594
|
const o = (s) => {
|
|
595
595
|
if (s.target && !r.current) {
|
|
596
596
|
let v = function() {
|
|
597
|
-
|
|
598
|
-
|
|
597
|
+
sn(
|
|
598
|
+
Mr,
|
|
599
599
|
n,
|
|
600
|
-
|
|
600
|
+
p,
|
|
601
601
|
{ discrete: !0 }
|
|
602
602
|
);
|
|
603
603
|
};
|
|
604
|
-
const
|
|
604
|
+
const p = { originalEvent: s };
|
|
605
605
|
s.pointerType === "touch" ? (t.removeEventListener("click", a.current), a.current = v, t.addEventListener("click", a.current, { once: !0 })) : v();
|
|
606
606
|
} else
|
|
607
607
|
t.removeEventListener("click", a.current);
|
|
@@ -617,11 +617,11 @@ function Ir(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
|
617
617
|
onPointerDownCapture: () => r.current = !0
|
|
618
618
|
};
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
const n =
|
|
620
|
+
function Wr(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
621
|
+
const n = Me(e), r = c.useRef(!1);
|
|
622
622
|
return c.useEffect(() => {
|
|
623
623
|
const a = (o) => {
|
|
624
|
-
o.target && !r.current &&
|
|
624
|
+
o.target && !r.current && sn(jr, n, { originalEvent: o }, {
|
|
625
625
|
discrete: !1
|
|
626
626
|
});
|
|
627
627
|
};
|
|
@@ -635,18 +635,18 @@ function $t() {
|
|
|
635
635
|
const e = new CustomEvent(pt);
|
|
636
636
|
document.dispatchEvent(e);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function sn(e, t, n, { discrete: r }) {
|
|
639
639
|
const a = n.originalEvent.target, o = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
|
|
640
|
-
t && a.addEventListener(e, t, { once: !0 }), r ?
|
|
640
|
+
t && a.addEventListener(e, t, { once: !0 }), r ? Ar(a, o) : a.dispatchEvent(o);
|
|
641
641
|
}
|
|
642
|
-
var
|
|
642
|
+
var tt = "focusScope.autoFocusOnMount", nt = "focusScope.autoFocusOnUnmount", Lt = { bubbles: !1, cancelable: !0 }, Ur = "FocusScope", cn = c.forwardRef((e, t) => {
|
|
643
643
|
const {
|
|
644
644
|
loop: n = !1,
|
|
645
645
|
trapped: r = !1,
|
|
646
646
|
onMountAutoFocus: a,
|
|
647
647
|
onUnmountAutoFocus: o,
|
|
648
648
|
...i
|
|
649
|
-
} = e, [s, v] = c.useState(null),
|
|
649
|
+
} = e, [s, v] = c.useState(null), p = Me(a), f = Me(o), l = c.useRef(null), h = ye(t, (m) => v(m)), R = c.useRef({
|
|
650
650
|
paused: !1,
|
|
651
651
|
pause() {
|
|
652
652
|
this.paused = !0;
|
|
@@ -657,65 +657,65 @@ var nt = "focusScope.autoFocusOnMount", rt = "focusScope.autoFocusOnUnmount", Lt
|
|
|
657
657
|
}).current;
|
|
658
658
|
c.useEffect(() => {
|
|
659
659
|
if (r) {
|
|
660
|
-
let
|
|
660
|
+
let m = function(P) {
|
|
661
661
|
if (R.paused || !s) return;
|
|
662
662
|
const y = P.target;
|
|
663
|
-
s.contains(y) ?
|
|
663
|
+
s.contains(y) ? l.current = y : me(l.current, { select: !0 });
|
|
664
664
|
}, S = function(P) {
|
|
665
665
|
if (R.paused || !s) return;
|
|
666
666
|
const y = P.relatedTarget;
|
|
667
|
-
y !== null && (s.contains(y) || me(
|
|
667
|
+
y !== null && (s.contains(y) || me(l.current, { select: !0 }));
|
|
668
668
|
}, g = function(P) {
|
|
669
669
|
if (document.activeElement === document.body)
|
|
670
|
-
for (const
|
|
671
|
-
|
|
670
|
+
for (const E of P)
|
|
671
|
+
E.removedNodes.length > 0 && me(s);
|
|
672
672
|
};
|
|
673
|
-
document.addEventListener("focusin",
|
|
673
|
+
document.addEventListener("focusin", m), document.addEventListener("focusout", S);
|
|
674
674
|
const T = new MutationObserver(g);
|
|
675
675
|
return s && T.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
676
|
-
document.removeEventListener("focusin",
|
|
676
|
+
document.removeEventListener("focusin", m), document.removeEventListener("focusout", S), T.disconnect();
|
|
677
677
|
};
|
|
678
678
|
}
|
|
679
679
|
}, [r, s, R.paused]), c.useEffect(() => {
|
|
680
680
|
if (s) {
|
|
681
681
|
Wt.add(R);
|
|
682
|
-
const
|
|
683
|
-
if (!s.contains(
|
|
684
|
-
const g = new CustomEvent(
|
|
685
|
-
s.addEventListener(
|
|
682
|
+
const m = document.activeElement;
|
|
683
|
+
if (!s.contains(m)) {
|
|
684
|
+
const g = new CustomEvent(tt, Lt);
|
|
685
|
+
s.addEventListener(tt, p), s.dispatchEvent(g), g.defaultPrevented || (Br(qr(ln(s)), { select: !0 }), document.activeElement === m && me(s));
|
|
686
686
|
}
|
|
687
687
|
return () => {
|
|
688
|
-
s.removeEventListener(
|
|
689
|
-
const g = new CustomEvent(
|
|
690
|
-
s.addEventListener(
|
|
688
|
+
s.removeEventListener(tt, p), setTimeout(() => {
|
|
689
|
+
const g = new CustomEvent(nt, Lt);
|
|
690
|
+
s.addEventListener(nt, f), s.dispatchEvent(g), g.defaultPrevented || me(m ?? document.body, { select: !0 }), s.removeEventListener(nt, f), Wt.remove(R);
|
|
691
691
|
}, 0);
|
|
692
692
|
};
|
|
693
693
|
}
|
|
694
|
-
}, [s,
|
|
695
|
-
const
|
|
696
|
-
(
|
|
694
|
+
}, [s, p, f, R]);
|
|
695
|
+
const O = c.useCallback(
|
|
696
|
+
(m) => {
|
|
697
697
|
if (!n && !r || R.paused) return;
|
|
698
|
-
const S =
|
|
698
|
+
const S = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, g = document.activeElement;
|
|
699
699
|
if (S && g) {
|
|
700
|
-
const T =
|
|
701
|
-
P && y ? !
|
|
700
|
+
const T = m.currentTarget, [P, y] = Hr(T);
|
|
701
|
+
P && y ? !m.shiftKey && g === y ? (m.preventDefault(), n && me(P, { select: !0 })) : m.shiftKey && g === P && (m.preventDefault(), n && me(y, { select: !0 })) : g === T && m.preventDefault();
|
|
702
702
|
}
|
|
703
703
|
},
|
|
704
704
|
[n, r, R.paused]
|
|
705
705
|
);
|
|
706
|
-
return /* @__PURE__ */ d.jsx(ie.div, { tabIndex: -1, ...i, ref: h, onKeyDown:
|
|
706
|
+
return /* @__PURE__ */ d.jsx(ie.div, { tabIndex: -1, ...i, ref: h, onKeyDown: O });
|
|
707
707
|
});
|
|
708
|
-
|
|
709
|
-
function
|
|
708
|
+
cn.displayName = Ur;
|
|
709
|
+
function Br(e, { select: t = !1 } = {}) {
|
|
710
710
|
const n = document.activeElement;
|
|
711
711
|
for (const r of e)
|
|
712
712
|
if (me(r, { select: t }), document.activeElement !== n) return;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
const t =
|
|
714
|
+
function Hr(e) {
|
|
715
|
+
const t = ln(e), n = Ft(t, e), r = Ft(t.reverse(), e);
|
|
716
716
|
return [n, r];
|
|
717
717
|
}
|
|
718
|
-
function
|
|
718
|
+
function ln(e) {
|
|
719
719
|
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
720
720
|
acceptNode: (r) => {
|
|
721
721
|
const a = r.tagName === "INPUT" && r.type === "hidden";
|
|
@@ -727,9 +727,9 @@ function an(e) {
|
|
|
727
727
|
}
|
|
728
728
|
function Ft(e, t) {
|
|
729
729
|
for (const n of e)
|
|
730
|
-
if (!
|
|
730
|
+
if (!Yr(n, { upTo: t })) return n;
|
|
731
731
|
}
|
|
732
|
-
function
|
|
732
|
+
function Yr(e, { upTo: t }) {
|
|
733
733
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
734
734
|
for (; e; ) {
|
|
735
735
|
if (t !== void 0 && e === t) return !1;
|
|
@@ -738,54 +738,54 @@ function Wr(e, { upTo: t }) {
|
|
|
738
738
|
}
|
|
739
739
|
return !1;
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Vr(e) {
|
|
742
742
|
return e instanceof HTMLInputElement && "select" in e;
|
|
743
743
|
}
|
|
744
744
|
function me(e, { select: t = !1 } = {}) {
|
|
745
745
|
if (e && e.focus) {
|
|
746
746
|
const n = document.activeElement;
|
|
747
|
-
e.focus({ preventScroll: !0 }), e !== n &&
|
|
747
|
+
e.focus({ preventScroll: !0 }), e !== n && Vr(e) && t && e.select();
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
var Wt =
|
|
751
|
-
function
|
|
750
|
+
var Wt = zr();
|
|
751
|
+
function zr() {
|
|
752
752
|
let e = [];
|
|
753
753
|
return {
|
|
754
754
|
add(t) {
|
|
755
755
|
const n = e[0];
|
|
756
|
-
t !== n && (n == null || n.pause()), e =
|
|
756
|
+
t !== n && (n == null || n.pause()), e = Ut(e, t), e.unshift(t);
|
|
757
757
|
},
|
|
758
758
|
remove(t) {
|
|
759
759
|
var n;
|
|
760
|
-
e =
|
|
760
|
+
e = Ut(e, t), (n = e[0]) == null || n.resume();
|
|
761
761
|
}
|
|
762
762
|
};
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function Ut(e, t) {
|
|
765
765
|
const n = [...e], r = n.indexOf(t);
|
|
766
766
|
return r !== -1 && n.splice(r, 1), n;
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function qr(e) {
|
|
769
769
|
return e.filter((t) => t.tagName !== "A");
|
|
770
770
|
}
|
|
771
|
-
var
|
|
771
|
+
var Xr = "Portal", un = c.forwardRef((e, t) => {
|
|
772
772
|
var s;
|
|
773
773
|
const { container: n, ...r } = e, [a, o] = c.useState(!1);
|
|
774
|
-
|
|
774
|
+
Ie(() => o(!0), []);
|
|
775
775
|
const i = n || a && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
|
|
776
|
-
return i ?
|
|
776
|
+
return i ? fr.createPortal(/* @__PURE__ */ d.jsx(ie.div, { ...r, ref: t }), i) : null;
|
|
777
777
|
});
|
|
778
|
-
|
|
779
|
-
function
|
|
778
|
+
un.displayName = Xr;
|
|
779
|
+
function Gr(e, t) {
|
|
780
780
|
return c.useReducer((n, r) => t[n][r] ?? n, e);
|
|
781
781
|
}
|
|
782
|
-
var
|
|
783
|
-
const { present: t, children: n } = e, r =
|
|
782
|
+
var Ke = (e) => {
|
|
783
|
+
const { present: t, children: n } = e, r = Kr(t), a = typeof n == "function" ? n({ present: r.isPresent }) : c.Children.only(n), o = ye(r.ref, Jr(a));
|
|
784
784
|
return typeof n == "function" || r.isPresent ? c.cloneElement(a, { ref: o }) : null;
|
|
785
785
|
};
|
|
786
|
-
|
|
787
|
-
function
|
|
788
|
-
const [t, n] = c.useState(), r = c.useRef(null), a = c.useRef(e), o = c.useRef("none"), i = e ? "mounted" : "unmounted", [s, v] =
|
|
786
|
+
Ke.displayName = "Presence";
|
|
787
|
+
function Kr(e) {
|
|
788
|
+
const [t, n] = c.useState(), r = c.useRef(null), a = c.useRef(e), o = c.useRef("none"), i = e ? "mounted" : "unmounted", [s, v] = Gr(i, {
|
|
789
789
|
mounted: {
|
|
790
790
|
UNMOUNT: "unmounted",
|
|
791
791
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -799,58 +799,58 @@ function zr(e) {
|
|
|
799
799
|
}
|
|
800
800
|
});
|
|
801
801
|
return c.useEffect(() => {
|
|
802
|
-
const
|
|
803
|
-
o.current = s === "mounted" ?
|
|
804
|
-
}, [s]),
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
const h = o.current, R = We(
|
|
808
|
-
e ? v("MOUNT") : R === "none" || (
|
|
802
|
+
const p = We(r.current);
|
|
803
|
+
o.current = s === "mounted" ? p : "none";
|
|
804
|
+
}, [s]), Ie(() => {
|
|
805
|
+
const p = r.current, f = a.current;
|
|
806
|
+
if (f !== e) {
|
|
807
|
+
const h = o.current, R = We(p);
|
|
808
|
+
e ? v("MOUNT") : R === "none" || (p == null ? void 0 : p.display) === "none" ? v("UNMOUNT") : v(f && h !== R ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
809
809
|
}
|
|
810
|
-
}, [e, v]),
|
|
810
|
+
}, [e, v]), Ie(() => {
|
|
811
811
|
if (t) {
|
|
812
|
-
let
|
|
813
|
-
const
|
|
814
|
-
const
|
|
815
|
-
if (R.target === t &&
|
|
812
|
+
let p;
|
|
813
|
+
const f = t.ownerDocument.defaultView ?? window, l = (R) => {
|
|
814
|
+
const m = We(r.current).includes(CSS.escape(R.animationName));
|
|
815
|
+
if (R.target === t && m && (v("ANIMATION_END"), !a.current)) {
|
|
816
816
|
const S = t.style.animationFillMode;
|
|
817
|
-
t.style.animationFillMode = "forwards",
|
|
817
|
+
t.style.animationFillMode = "forwards", p = f.setTimeout(() => {
|
|
818
818
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = S);
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
821
|
}, h = (R) => {
|
|
822
822
|
R.target === t && (o.current = We(r.current));
|
|
823
823
|
};
|
|
824
|
-
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel",
|
|
825
|
-
|
|
824
|
+
return t.addEventListener("animationstart", h), t.addEventListener("animationcancel", l), t.addEventListener("animationend", l), () => {
|
|
825
|
+
f.clearTimeout(p), t.removeEventListener("animationstart", h), t.removeEventListener("animationcancel", l), t.removeEventListener("animationend", l);
|
|
826
826
|
};
|
|
827
827
|
} else
|
|
828
828
|
v("ANIMATION_END");
|
|
829
829
|
}, [t, v]), {
|
|
830
830
|
isPresent: ["mounted", "unmountSuspended"].includes(s),
|
|
831
|
-
ref: c.useCallback((
|
|
832
|
-
r.current =
|
|
831
|
+
ref: c.useCallback((p) => {
|
|
832
|
+
r.current = p ? getComputedStyle(p) : null, n(p);
|
|
833
833
|
}, [])
|
|
834
834
|
};
|
|
835
835
|
}
|
|
836
836
|
function We(e) {
|
|
837
837
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function Jr(e) {
|
|
840
840
|
var r, a;
|
|
841
841
|
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
842
842
|
return n ? e.ref : (t = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
843
843
|
}
|
|
844
|
-
var
|
|
845
|
-
function
|
|
844
|
+
var rt = 0;
|
|
845
|
+
function Zr() {
|
|
846
846
|
c.useEffect(() => {
|
|
847
847
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
848
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ??
|
|
849
|
-
|
|
848
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Bt()), document.body.insertAdjacentElement("beforeend", e[1] ?? Bt()), rt++, () => {
|
|
849
|
+
rt === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), rt--;
|
|
850
850
|
};
|
|
851
851
|
}, []);
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function Bt() {
|
|
854
854
|
const e = document.createElement("span");
|
|
855
855
|
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;
|
|
856
856
|
}
|
|
@@ -863,7 +863,7 @@ var se = function() {
|
|
|
863
863
|
return t;
|
|
864
864
|
}, se.apply(this, arguments);
|
|
865
865
|
};
|
|
866
|
-
function
|
|
866
|
+
function dn(e, t) {
|
|
867
867
|
var n = {};
|
|
868
868
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
869
869
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -871,17 +871,17 @@ function sn(e, t) {
|
|
|
871
871
|
t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
|
|
872
872
|
return n;
|
|
873
873
|
}
|
|
874
|
-
function
|
|
874
|
+
function Qr(e, t, n) {
|
|
875
875
|
if (n || arguments.length === 2) for (var r = 0, a = t.length, o; r < a; r++)
|
|
876
876
|
(o || !(r in t)) && (o || (o = Array.prototype.slice.call(t, 0, r)), o[r] = t[r]);
|
|
877
877
|
return e.concat(o || Array.prototype.slice.call(t));
|
|
878
878
|
}
|
|
879
|
-
var
|
|
880
|
-
function
|
|
879
|
+
var qe = "right-scroll-bar-position", Xe = "width-before-scroll-bar", ea = "with-scroll-bars-hidden", ta = "--removed-body-scroll-bar-size";
|
|
880
|
+
function at(e, t) {
|
|
881
881
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
884
|
-
var n =
|
|
883
|
+
function na(e, t) {
|
|
884
|
+
var n = mt(function() {
|
|
885
885
|
return {
|
|
886
886
|
// value
|
|
887
887
|
value: e,
|
|
@@ -901,31 +901,31 @@ function Zr(e, t) {
|
|
|
901
901
|
})[0];
|
|
902
902
|
return n.callback = t, n.facade;
|
|
903
903
|
}
|
|
904
|
-
var
|
|
905
|
-
function
|
|
906
|
-
var n =
|
|
904
|
+
var ra = typeof window < "u" ? c.useLayoutEffect : c.useEffect, Ht = /* @__PURE__ */ new WeakMap();
|
|
905
|
+
function aa(e, t) {
|
|
906
|
+
var n = na(null, function(r) {
|
|
907
907
|
return e.forEach(function(a) {
|
|
908
|
-
return
|
|
908
|
+
return at(a, r);
|
|
909
909
|
});
|
|
910
910
|
});
|
|
911
|
-
return
|
|
911
|
+
return ra(function() {
|
|
912
912
|
var r = Ht.get(n);
|
|
913
913
|
if (r) {
|
|
914
914
|
var a = new Set(r), o = new Set(e), i = n.current;
|
|
915
915
|
a.forEach(function(s) {
|
|
916
|
-
o.has(s) ||
|
|
916
|
+
o.has(s) || at(s, null);
|
|
917
917
|
}), o.forEach(function(s) {
|
|
918
|
-
a.has(s) ||
|
|
918
|
+
a.has(s) || at(s, i);
|
|
919
919
|
});
|
|
920
920
|
}
|
|
921
921
|
Ht.set(n, e);
|
|
922
922
|
}, [e]), n;
|
|
923
923
|
}
|
|
924
|
-
function
|
|
924
|
+
function oa(e) {
|
|
925
925
|
return e;
|
|
926
926
|
}
|
|
927
|
-
function
|
|
928
|
-
t === void 0 && (t =
|
|
927
|
+
function sa(e, t) {
|
|
928
|
+
t === void 0 && (t = oa);
|
|
929
929
|
var n = [], r = !1, a = {
|
|
930
930
|
read: function() {
|
|
931
931
|
if (r)
|
|
@@ -962,30 +962,30 @@ function na(e, t) {
|
|
|
962
962
|
n = [], s.forEach(o), i = n;
|
|
963
963
|
}
|
|
964
964
|
var v = function() {
|
|
965
|
-
var
|
|
966
|
-
i = [],
|
|
967
|
-
},
|
|
965
|
+
var f = i;
|
|
966
|
+
i = [], f.forEach(o);
|
|
967
|
+
}, p = function() {
|
|
968
968
|
return Promise.resolve().then(v);
|
|
969
969
|
};
|
|
970
|
-
|
|
971
|
-
push: function(
|
|
972
|
-
i.push(
|
|
970
|
+
p(), n = {
|
|
971
|
+
push: function(f) {
|
|
972
|
+
i.push(f), p();
|
|
973
973
|
},
|
|
974
|
-
filter: function(
|
|
975
|
-
return i = i.filter(
|
|
974
|
+
filter: function(f) {
|
|
975
|
+
return i = i.filter(f), n;
|
|
976
976
|
}
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
979
|
};
|
|
980
980
|
return a;
|
|
981
981
|
}
|
|
982
|
-
function
|
|
982
|
+
function ia(e) {
|
|
983
983
|
e === void 0 && (e = {});
|
|
984
|
-
var t =
|
|
984
|
+
var t = sa(null);
|
|
985
985
|
return t.options = se({ async: !0, ssr: !1 }, e), t;
|
|
986
986
|
}
|
|
987
|
-
var
|
|
988
|
-
var t = e.sideCar, n =
|
|
987
|
+
var fn = function(e) {
|
|
988
|
+
var t = e.sideCar, n = dn(e, ["sideCar"]);
|
|
989
989
|
if (!t)
|
|
990
990
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
991
991
|
var r = t.read();
|
|
@@ -993,64 +993,64 @@ var cn = function(e) {
|
|
|
993
993
|
throw new Error("Sidecar medium not found");
|
|
994
994
|
return c.createElement(r, se({}, n));
|
|
995
995
|
};
|
|
996
|
-
|
|
997
|
-
function
|
|
998
|
-
return e.useMedium(t),
|
|
996
|
+
fn.isSideCarExport = !0;
|
|
997
|
+
function ca(e, t) {
|
|
998
|
+
return e.useMedium(t), fn;
|
|
999
999
|
}
|
|
1000
|
-
var
|
|
1001
|
-
},
|
|
1000
|
+
var mn = ia(), ot = function() {
|
|
1001
|
+
}, Je = c.forwardRef(function(e, t) {
|
|
1002
1002
|
var n = c.useRef(null), r = c.useState({
|
|
1003
|
-
onScrollCapture:
|
|
1004
|
-
onWheelCapture:
|
|
1005
|
-
onTouchMoveCapture:
|
|
1006
|
-
}), a = r[0], o = r[1], i = e.forwardProps, s = e.children, v = e.className,
|
|
1003
|
+
onScrollCapture: ot,
|
|
1004
|
+
onWheelCapture: ot,
|
|
1005
|
+
onTouchMoveCapture: ot
|
|
1006
|
+
}), a = r[0], o = r[1], i = e.forwardProps, s = e.children, v = e.className, p = e.removeScrollBar, f = e.enabled, l = e.shards, h = e.sideCar, R = e.noRelative, O = e.noIsolation, m = e.inert, S = e.allowPinchZoom, g = e.as, T = g === void 0 ? "div" : g, P = e.gapMode, y = dn(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = h, F = aa([n, t]), w = se(se({}, y), a);
|
|
1007
1007
|
return c.createElement(
|
|
1008
1008
|
c.Fragment,
|
|
1009
1009
|
null,
|
|
1010
|
-
|
|
1010
|
+
f && c.createElement(E, { sideCar: mn, removeScrollBar: p, shards: l, noRelative: R, noIsolation: O, inert: m, setCallbacks: o, allowPinchZoom: !!S, lockRef: n, gapMode: P }),
|
|
1011
1011
|
i ? c.cloneElement(c.Children.only(s), se(se({}, w), { ref: F })) : c.createElement(T, se({}, w, { className: v, ref: F }), s)
|
|
1012
1012
|
);
|
|
1013
1013
|
});
|
|
1014
|
-
|
|
1014
|
+
Je.defaultProps = {
|
|
1015
1015
|
enabled: !0,
|
|
1016
1016
|
removeScrollBar: !0,
|
|
1017
1017
|
inert: !1
|
|
1018
1018
|
};
|
|
1019
|
-
|
|
1020
|
-
fullWidth:
|
|
1021
|
-
zeroRight:
|
|
1019
|
+
Je.classNames = {
|
|
1020
|
+
fullWidth: Xe,
|
|
1021
|
+
zeroRight: qe
|
|
1022
1022
|
};
|
|
1023
|
-
var
|
|
1023
|
+
var la = function() {
|
|
1024
1024
|
if (typeof __webpack_nonce__ < "u")
|
|
1025
1025
|
return __webpack_nonce__;
|
|
1026
1026
|
};
|
|
1027
|
-
function
|
|
1027
|
+
function ua() {
|
|
1028
1028
|
if (!document)
|
|
1029
1029
|
return null;
|
|
1030
1030
|
var e = document.createElement("style");
|
|
1031
1031
|
e.type = "text/css";
|
|
1032
|
-
var t =
|
|
1032
|
+
var t = la();
|
|
1033
1033
|
return t && e.setAttribute("nonce", t), e;
|
|
1034
1034
|
}
|
|
1035
|
-
function
|
|
1035
|
+
function da(e, t) {
|
|
1036
1036
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function fa(e) {
|
|
1039
1039
|
var t = document.head || document.getElementsByTagName("head")[0];
|
|
1040
1040
|
t.appendChild(e);
|
|
1041
1041
|
}
|
|
1042
|
-
var
|
|
1042
|
+
var ma = function() {
|
|
1043
1043
|
var e = 0, t = null;
|
|
1044
1044
|
return {
|
|
1045
1045
|
add: function(n) {
|
|
1046
|
-
e == 0 && (t =
|
|
1046
|
+
e == 0 && (t = ua()) && (da(t, n), fa(t)), e++;
|
|
1047
1047
|
},
|
|
1048
1048
|
remove: function() {
|
|
1049
1049
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
1050
1050
|
}
|
|
1051
1051
|
};
|
|
1052
|
-
},
|
|
1053
|
-
var e =
|
|
1052
|
+
}, pa = function() {
|
|
1053
|
+
var e = ma();
|
|
1054
1054
|
return function(t, n) {
|
|
1055
1055
|
c.useEffect(function() {
|
|
1056
1056
|
return e.add(t), function() {
|
|
@@ -1058,36 +1058,36 @@ var la = function() {
|
|
|
1058
1058
|
};
|
|
1059
1059
|
}, [t && n]);
|
|
1060
1060
|
};
|
|
1061
|
-
},
|
|
1062
|
-
var e =
|
|
1061
|
+
}, pn = function() {
|
|
1062
|
+
var e = pa(), t = function(n) {
|
|
1063
1063
|
var r = n.styles, a = n.dynamic;
|
|
1064
1064
|
return e(r, a), null;
|
|
1065
1065
|
};
|
|
1066
1066
|
return t;
|
|
1067
|
-
},
|
|
1067
|
+
}, va = {
|
|
1068
1068
|
left: 0,
|
|
1069
1069
|
top: 0,
|
|
1070
1070
|
right: 0,
|
|
1071
1071
|
gap: 0
|
|
1072
|
-
},
|
|
1072
|
+
}, st = function(e) {
|
|
1073
1073
|
return parseInt(e || "", 10) || 0;
|
|
1074
|
-
},
|
|
1074
|
+
}, ha = function(e) {
|
|
1075
1075
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], a = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
1076
|
-
return [
|
|
1077
|
-
},
|
|
1076
|
+
return [st(n), st(r), st(a)];
|
|
1077
|
+
}, ga = function(e) {
|
|
1078
1078
|
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
1079
|
-
return
|
|
1080
|
-
var t =
|
|
1079
|
+
return va;
|
|
1080
|
+
var t = ha(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
1081
1081
|
return {
|
|
1082
1082
|
left: t[0],
|
|
1083
1083
|
top: t[1],
|
|
1084
1084
|
right: t[2],
|
|
1085
1085
|
gap: Math.max(0, r - n + t[2] - t[0])
|
|
1086
1086
|
};
|
|
1087
|
-
},
|
|
1087
|
+
}, wa = pn(), Te = "data-scroll-locked", ba = function(e, t, n, r) {
|
|
1088
1088
|
var a = e.left, o = e.top, i = e.right, s = e.gap;
|
|
1089
1089
|
return n === void 0 && (n = "margin"), `
|
|
1090
|
-
.`.concat(
|
|
1090
|
+
.`.concat(ea, ` {
|
|
1091
1091
|
overflow: hidden `).concat(r, `;
|
|
1092
1092
|
padding-right: `).concat(s, "px ").concat(r, `;
|
|
1093
1093
|
}
|
|
@@ -1108,110 +1108,110 @@ var la = function() {
|
|
|
1108
1108
|
].filter(Boolean).join(""), `
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
|
-
.`).concat(
|
|
1111
|
+
.`).concat(qe, ` {
|
|
1112
1112
|
right: `).concat(s, "px ").concat(r, `;
|
|
1113
1113
|
}
|
|
1114
1114
|
|
|
1115
|
-
.`).concat(
|
|
1115
|
+
.`).concat(Xe, ` {
|
|
1116
1116
|
margin-right: `).concat(s, "px ").concat(r, `;
|
|
1117
1117
|
}
|
|
1118
1118
|
|
|
1119
|
-
.`).concat(
|
|
1119
|
+
.`).concat(qe, " .").concat(qe, ` {
|
|
1120
1120
|
right: 0 `).concat(r, `;
|
|
1121
1121
|
}
|
|
1122
1122
|
|
|
1123
|
-
.`).concat(
|
|
1123
|
+
.`).concat(Xe, " .").concat(Xe, ` {
|
|
1124
1124
|
margin-right: 0 `).concat(r, `;
|
|
1125
1125
|
}
|
|
1126
1126
|
|
|
1127
1127
|
body[`).concat(Te, `] {
|
|
1128
|
-
`).concat(
|
|
1128
|
+
`).concat(ta, ": ").concat(s, `px;
|
|
1129
1129
|
}
|
|
1130
1130
|
`);
|
|
1131
|
-
},
|
|
1131
|
+
}, Yt = function() {
|
|
1132
1132
|
var e = parseInt(document.body.getAttribute(Te) || "0", 10);
|
|
1133
1133
|
return isFinite(e) ? e : 0;
|
|
1134
|
-
},
|
|
1134
|
+
}, ya = function() {
|
|
1135
1135
|
c.useEffect(function() {
|
|
1136
|
-
return document.body.setAttribute(Te, (
|
|
1137
|
-
var e =
|
|
1136
|
+
return document.body.setAttribute(Te, (Yt() + 1).toString()), function() {
|
|
1137
|
+
var e = Yt() - 1;
|
|
1138
1138
|
e <= 0 ? document.body.removeAttribute(Te) : document.body.setAttribute(Te, e.toString());
|
|
1139
1139
|
};
|
|
1140
1140
|
}, []);
|
|
1141
|
-
},
|
|
1141
|
+
}, Ea = function(e) {
|
|
1142
1142
|
var t = e.noRelative, n = e.noImportant, r = e.gapMode, a = r === void 0 ? "margin" : r;
|
|
1143
|
-
|
|
1143
|
+
ya();
|
|
1144
1144
|
var o = c.useMemo(function() {
|
|
1145
|
-
return
|
|
1145
|
+
return ga(a);
|
|
1146
1146
|
}, [a]);
|
|
1147
|
-
return c.createElement(
|
|
1147
|
+
return c.createElement(wa, { styles: ba(o, !t, a, n ? "" : "!important") });
|
|
1148
1148
|
}, vt = !1;
|
|
1149
1149
|
if (typeof window < "u")
|
|
1150
1150
|
try {
|
|
1151
|
-
var
|
|
1151
|
+
var Ue = Object.defineProperty({}, "passive", {
|
|
1152
1152
|
get: function() {
|
|
1153
1153
|
return vt = !0, !0;
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
1156
|
-
window.addEventListener("test",
|
|
1156
|
+
window.addEventListener("test", Ue, Ue), window.removeEventListener("test", Ue, Ue);
|
|
1157
1157
|
} catch {
|
|
1158
1158
|
vt = !1;
|
|
1159
1159
|
}
|
|
1160
|
-
var Re = vt ? { passive: !1 } : !1,
|
|
1160
|
+
var Re = vt ? { passive: !1 } : !1, Sa = function(e) {
|
|
1161
1161
|
return e.tagName === "TEXTAREA";
|
|
1162
|
-
},
|
|
1162
|
+
}, vn = function(e, t) {
|
|
1163
1163
|
if (!(e instanceof Element))
|
|
1164
1164
|
return !1;
|
|
1165
1165
|
var n = window.getComputedStyle(e);
|
|
1166
1166
|
return (
|
|
1167
1167
|
// not-not-scrollable
|
|
1168
1168
|
n[t] !== "hidden" && // contains scroll inside self
|
|
1169
|
-
!(n.overflowY === n.overflowX && !
|
|
1169
|
+
!(n.overflowY === n.overflowX && !Sa(e) && n[t] === "visible")
|
|
1170
1170
|
);
|
|
1171
|
-
},
|
|
1172
|
-
return
|
|
1173
|
-
},
|
|
1174
|
-
return
|
|
1175
|
-
},
|
|
1171
|
+
}, Ra = function(e) {
|
|
1172
|
+
return vn(e, "overflowY");
|
|
1173
|
+
}, xa = function(e) {
|
|
1174
|
+
return vn(e, "overflowX");
|
|
1175
|
+
}, Vt = function(e, t) {
|
|
1176
1176
|
var n = t.ownerDocument, r = t;
|
|
1177
1177
|
do {
|
|
1178
1178
|
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
1179
|
-
var a =
|
|
1179
|
+
var a = hn(e, r);
|
|
1180
1180
|
if (a) {
|
|
1181
|
-
var o =
|
|
1181
|
+
var o = gn(e, r), i = o[1], s = o[2];
|
|
1182
1182
|
if (i > s)
|
|
1183
1183
|
return !0;
|
|
1184
1184
|
}
|
|
1185
1185
|
r = r.parentNode;
|
|
1186
1186
|
} while (r && r !== n.body);
|
|
1187
1187
|
return !1;
|
|
1188
|
-
},
|
|
1188
|
+
}, Ca = function(e) {
|
|
1189
1189
|
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
1190
1190
|
return [
|
|
1191
1191
|
t,
|
|
1192
1192
|
n,
|
|
1193
1193
|
r
|
|
1194
1194
|
];
|
|
1195
|
-
},
|
|
1195
|
+
}, Ta = function(e) {
|
|
1196
1196
|
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
1197
1197
|
return [
|
|
1198
1198
|
t,
|
|
1199
1199
|
n,
|
|
1200
1200
|
r
|
|
1201
1201
|
];
|
|
1202
|
-
},
|
|
1203
|
-
return e === "v" ?
|
|
1204
|
-
},
|
|
1205
|
-
return e === "v" ?
|
|
1206
|
-
},
|
|
1202
|
+
}, hn = function(e, t) {
|
|
1203
|
+
return e === "v" ? Ra(t) : xa(t);
|
|
1204
|
+
}, gn = function(e, t) {
|
|
1205
|
+
return e === "v" ? Ca(t) : Ta(t);
|
|
1206
|
+
}, Pa = function(e, t) {
|
|
1207
1207
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
1208
|
-
},
|
|
1209
|
-
var o =
|
|
1208
|
+
}, Oa = function(e, t, n, r, a) {
|
|
1209
|
+
var o = Pa(e, window.getComputedStyle(t).direction), i = o * r, s = n.target, v = t.contains(s), p = !1, f = i > 0, l = 0, h = 0;
|
|
1210
1210
|
do {
|
|
1211
1211
|
if (!s)
|
|
1212
1212
|
break;
|
|
1213
|
-
var R =
|
|
1214
|
-
(
|
|
1213
|
+
var R = gn(e, s), O = R[0], m = R[1], S = R[2], g = m - S - o * O;
|
|
1214
|
+
(O || g) && hn(e, s) && (l += g, h += O);
|
|
1215
1215
|
var T = s.parentNode;
|
|
1216
1216
|
s = T && T.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? T.host : T;
|
|
1217
1217
|
} while (
|
|
@@ -1219,165 +1219,165 @@ var Re = vt ? { passive: !1 } : !1, wa = function(e) {
|
|
|
1219
1219
|
!v && s !== document.body || // self content
|
|
1220
1220
|
v && (t.contains(s) || t === s)
|
|
1221
1221
|
);
|
|
1222
|
-
return (
|
|
1223
|
-
},
|
|
1222
|
+
return (f && Math.abs(l) < 1 || !f && Math.abs(h) < 1) && (p = !0), p;
|
|
1223
|
+
}, Be = function(e) {
|
|
1224
1224
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
1225
1225
|
}, zt = function(e) {
|
|
1226
1226
|
return [e.deltaX, e.deltaY];
|
|
1227
1227
|
}, qt = function(e) {
|
|
1228
1228
|
return e && "current" in e ? e.current : e;
|
|
1229
|
-
},
|
|
1229
|
+
}, Na = function(e, t) {
|
|
1230
1230
|
return e[0] === t[0] && e[1] === t[1];
|
|
1231
|
-
},
|
|
1231
|
+
}, Da = function(e) {
|
|
1232
1232
|
return `
|
|
1233
1233
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
1234
1234
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
1235
1235
|
`);
|
|
1236
|
-
},
|
|
1237
|
-
function
|
|
1238
|
-
var t = c.useRef([]), n = c.useRef([0, 0]), r = c.useRef(), a = c.useState(
|
|
1236
|
+
}, _a = 0, xe = [];
|
|
1237
|
+
function Aa(e) {
|
|
1238
|
+
var t = c.useRef([]), n = c.useRef([0, 0]), r = c.useRef(), a = c.useState(_a++)[0], o = c.useState(pn)[0], i = c.useRef(e);
|
|
1239
1239
|
c.useEffect(function() {
|
|
1240
1240
|
i.current = e;
|
|
1241
1241
|
}, [e]), c.useEffect(function() {
|
|
1242
1242
|
if (e.inert) {
|
|
1243
1243
|
document.body.classList.add("block-interactivity-".concat(a));
|
|
1244
|
-
var
|
|
1245
|
-
return
|
|
1244
|
+
var m = Qr([e.lockRef.current], (e.shards || []).map(qt), !0).filter(Boolean);
|
|
1245
|
+
return m.forEach(function(S) {
|
|
1246
1246
|
return S.classList.add("allow-interactivity-".concat(a));
|
|
1247
1247
|
}), function() {
|
|
1248
|
-
document.body.classList.remove("block-interactivity-".concat(a)),
|
|
1248
|
+
document.body.classList.remove("block-interactivity-".concat(a)), m.forEach(function(S) {
|
|
1249
1249
|
return S.classList.remove("allow-interactivity-".concat(a));
|
|
1250
1250
|
});
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
1253
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
1254
|
-
var s = c.useCallback(function(
|
|
1255
|
-
if ("touches" in
|
|
1254
|
+
var s = c.useCallback(function(m, S) {
|
|
1255
|
+
if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
|
|
1256
1256
|
return !i.current.allowPinchZoom;
|
|
1257
|
-
var g =
|
|
1258
|
-
if ("touches" in
|
|
1257
|
+
var g = Be(m), T = n.current, P = "deltaX" in m ? m.deltaX : T[0] - g[0], y = "deltaY" in m ? m.deltaY : T[1] - g[1], E, F = m.target, w = Math.abs(P) > Math.abs(y) ? "h" : "v";
|
|
1258
|
+
if ("touches" in m && w === "h" && F.type === "range")
|
|
1259
1259
|
return !1;
|
|
1260
|
-
var
|
|
1261
|
-
if (
|
|
1260
|
+
var A = window.getSelection(), N = A && A.anchorNode, W = N ? N === F || N.contains(F) : !1;
|
|
1261
|
+
if (W)
|
|
1262
1262
|
return !1;
|
|
1263
|
-
var
|
|
1264
|
-
if (!
|
|
1263
|
+
var U = Vt(w, F);
|
|
1264
|
+
if (!U)
|
|
1265
1265
|
return !0;
|
|
1266
|
-
if (
|
|
1266
|
+
if (U ? E = w : (E = w === "v" ? "h" : "v", U = Vt(w, F)), !U)
|
|
1267
1267
|
return !1;
|
|
1268
|
-
if (!r.current && "changedTouches" in
|
|
1268
|
+
if (!r.current && "changedTouches" in m && (P || y) && (r.current = E), !E)
|
|
1269
1269
|
return !0;
|
|
1270
|
-
var
|
|
1271
|
-
return
|
|
1272
|
-
}, []), v = c.useCallback(function(
|
|
1273
|
-
var S =
|
|
1274
|
-
if (!(!
|
|
1275
|
-
var g = "deltaY" in S ? zt(S) :
|
|
1276
|
-
return
|
|
1270
|
+
var V = r.current || E;
|
|
1271
|
+
return Oa(V, S, m, V === "h" ? P : y);
|
|
1272
|
+
}, []), v = c.useCallback(function(m) {
|
|
1273
|
+
var S = m;
|
|
1274
|
+
if (!(!xe.length || xe[xe.length - 1] !== o)) {
|
|
1275
|
+
var g = "deltaY" in S ? zt(S) : Be(S), T = t.current.filter(function(E) {
|
|
1276
|
+
return E.name === S.type && (E.target === S.target || S.target === E.shadowParent) && Na(E.delta, g);
|
|
1277
1277
|
})[0];
|
|
1278
1278
|
if (T && T.should) {
|
|
1279
1279
|
S.cancelable && S.preventDefault();
|
|
1280
1280
|
return;
|
|
1281
1281
|
}
|
|
1282
1282
|
if (!T) {
|
|
1283
|
-
var P = (i.current.shards || []).map(qt).filter(Boolean).filter(function(
|
|
1284
|
-
return
|
|
1283
|
+
var P = (i.current.shards || []).map(qt).filter(Boolean).filter(function(E) {
|
|
1284
|
+
return E.contains(S.target);
|
|
1285
1285
|
}), y = P.length > 0 ? s(S, P[0]) : !i.current.noIsolation;
|
|
1286
1286
|
y && S.cancelable && S.preventDefault();
|
|
1287
1287
|
}
|
|
1288
1288
|
}
|
|
1289
|
-
}, []),
|
|
1290
|
-
var P = { name:
|
|
1289
|
+
}, []), p = c.useCallback(function(m, S, g, T) {
|
|
1290
|
+
var P = { name: m, delta: S, target: g, should: T, shadowParent: ka(g) };
|
|
1291
1291
|
t.current.push(P), setTimeout(function() {
|
|
1292
1292
|
t.current = t.current.filter(function(y) {
|
|
1293
1293
|
return y !== P;
|
|
1294
1294
|
});
|
|
1295
1295
|
}, 1);
|
|
1296
|
-
}, []),
|
|
1297
|
-
n.current =
|
|
1298
|
-
}, []),
|
|
1299
|
-
|
|
1300
|
-
}, []), h = c.useCallback(function(
|
|
1301
|
-
|
|
1296
|
+
}, []), f = c.useCallback(function(m) {
|
|
1297
|
+
n.current = Be(m), r.current = void 0;
|
|
1298
|
+
}, []), l = c.useCallback(function(m) {
|
|
1299
|
+
p(m.type, zt(m), m.target, s(m, e.lockRef.current));
|
|
1300
|
+
}, []), h = c.useCallback(function(m) {
|
|
1301
|
+
p(m.type, Be(m), m.target, s(m, e.lockRef.current));
|
|
1302
1302
|
}, []);
|
|
1303
1303
|
c.useEffect(function() {
|
|
1304
|
-
return
|
|
1305
|
-
onScrollCapture:
|
|
1306
|
-
onWheelCapture:
|
|
1304
|
+
return xe.push(o), e.setCallbacks({
|
|
1305
|
+
onScrollCapture: l,
|
|
1306
|
+
onWheelCapture: l,
|
|
1307
1307
|
onTouchMoveCapture: h
|
|
1308
|
-
}), document.addEventListener("wheel", v, Re), document.addEventListener("touchmove", v, Re), document.addEventListener("touchstart",
|
|
1309
|
-
|
|
1310
|
-
return
|
|
1311
|
-
}), document.removeEventListener("wheel", v, Re), document.removeEventListener("touchmove", v, Re), document.removeEventListener("touchstart",
|
|
1308
|
+
}), document.addEventListener("wheel", v, Re), document.addEventListener("touchmove", v, Re), document.addEventListener("touchstart", f, Re), function() {
|
|
1309
|
+
xe = xe.filter(function(m) {
|
|
1310
|
+
return m !== o;
|
|
1311
|
+
}), document.removeEventListener("wheel", v, Re), document.removeEventListener("touchmove", v, Re), document.removeEventListener("touchstart", f, Re);
|
|
1312
1312
|
};
|
|
1313
1313
|
}, []);
|
|
1314
|
-
var R = e.removeScrollBar,
|
|
1314
|
+
var R = e.removeScrollBar, O = e.inert;
|
|
1315
1315
|
return c.createElement(
|
|
1316
1316
|
c.Fragment,
|
|
1317
1317
|
null,
|
|
1318
|
-
|
|
1319
|
-
R ? c.createElement(
|
|
1318
|
+
O ? c.createElement(o, { styles: Da(a) }) : null,
|
|
1319
|
+
R ? c.createElement(Ea, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
1320
1320
|
);
|
|
1321
1321
|
}
|
|
1322
|
-
function
|
|
1322
|
+
function ka(e) {
|
|
1323
1323
|
for (var t = null; e !== null; )
|
|
1324
1324
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
1325
1325
|
return t;
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1328
|
-
var
|
|
1329
|
-
return c.createElement(
|
|
1327
|
+
const Ia = ca(mn, Aa);
|
|
1328
|
+
var wn = c.forwardRef(function(e, t) {
|
|
1329
|
+
return c.createElement(Je, se({}, e, { ref: t, sideCar: Ia }));
|
|
1330
1330
|
});
|
|
1331
|
-
|
|
1332
|
-
var
|
|
1331
|
+
wn.classNames = Je.classNames;
|
|
1332
|
+
var Ma = function(e) {
|
|
1333
1333
|
if (typeof document > "u")
|
|
1334
1334
|
return null;
|
|
1335
1335
|
var t = Array.isArray(e) ? e[0] : e;
|
|
1336
1336
|
return t.ownerDocument.body;
|
|
1337
|
-
},
|
|
1338
|
-
return e && (e.host ||
|
|
1339
|
-
},
|
|
1337
|
+
}, Ce = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), Ye = {}, it = 0, bn = function(e) {
|
|
1338
|
+
return e && (e.host || bn(e.parentNode));
|
|
1339
|
+
}, ja = function(e, t) {
|
|
1340
1340
|
return t.map(function(n) {
|
|
1341
1341
|
if (e.contains(n))
|
|
1342
1342
|
return n;
|
|
1343
|
-
var r =
|
|
1343
|
+
var r = bn(n);
|
|
1344
1344
|
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
1345
1345
|
}).filter(function(n) {
|
|
1346
1346
|
return !!n;
|
|
1347
1347
|
});
|
|
1348
|
-
},
|
|
1349
|
-
var a =
|
|
1350
|
-
|
|
1351
|
-
var o =
|
|
1352
|
-
!
|
|
1348
|
+
}, $a = function(e, t, n, r) {
|
|
1349
|
+
var a = ja(t, Array.isArray(e) ? e : [e]);
|
|
1350
|
+
Ye[n] || (Ye[n] = /* @__PURE__ */ new WeakMap());
|
|
1351
|
+
var o = Ye[n], i = [], s = /* @__PURE__ */ new Set(), v = new Set(a), p = function(l) {
|
|
1352
|
+
!l || s.has(l) || (s.add(l), p(l.parentNode));
|
|
1353
1353
|
};
|
|
1354
|
-
a.forEach(
|
|
1355
|
-
var
|
|
1356
|
-
!
|
|
1354
|
+
a.forEach(p);
|
|
1355
|
+
var f = function(l) {
|
|
1356
|
+
!l || v.has(l) || Array.prototype.forEach.call(l.children, function(h) {
|
|
1357
1357
|
if (s.has(h))
|
|
1358
|
-
|
|
1358
|
+
f(h);
|
|
1359
1359
|
else
|
|
1360
1360
|
try {
|
|
1361
|
-
var R = h.getAttribute(r),
|
|
1362
|
-
|
|
1361
|
+
var R = h.getAttribute(r), O = R !== null && R !== "false", m = (Ce.get(h) || 0) + 1, S = (o.get(h) || 0) + 1;
|
|
1362
|
+
Ce.set(h, m), o.set(h, S), i.push(h), m === 1 && O && He.set(h, !0), S === 1 && h.setAttribute(n, "true"), O || h.setAttribute(r, "true");
|
|
1363
1363
|
} catch (g) {
|
|
1364
1364
|
console.error("aria-hidden: cannot operate on ", h, g);
|
|
1365
1365
|
}
|
|
1366
1366
|
});
|
|
1367
1367
|
};
|
|
1368
|
-
return
|
|
1369
|
-
i.forEach(function(
|
|
1370
|
-
var h =
|
|
1371
|
-
|
|
1372
|
-
}),
|
|
1368
|
+
return f(t), s.clear(), it++, function() {
|
|
1369
|
+
i.forEach(function(l) {
|
|
1370
|
+
var h = Ce.get(l) - 1, R = o.get(l) - 1;
|
|
1371
|
+
Ce.set(l, h), o.set(l, R), h || (He.has(l) || l.removeAttribute(r), He.delete(l)), R || l.removeAttribute(n);
|
|
1372
|
+
}), it--, it || (Ce = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), Ye = {});
|
|
1373
1373
|
};
|
|
1374
|
-
},
|
|
1374
|
+
}, La = function(e, t, n) {
|
|
1375
1375
|
n === void 0 && (n = "data-aria-hidden");
|
|
1376
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), a =
|
|
1377
|
-
return a ? (r.push.apply(r, Array.from(a.querySelectorAll("[aria-live], script"))),
|
|
1376
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), a = Ma(e);
|
|
1377
|
+
return a ? (r.push.apply(r, Array.from(a.querySelectorAll("[aria-live], script"))), $a(r, a, n, "aria-hidden")) : function() {
|
|
1378
1378
|
return null;
|
|
1379
1379
|
};
|
|
1380
|
-
},
|
|
1380
|
+
}, Ze = "Dialog", [yn] = wr(Ze), [Fa, ae] = yn(Ze), En = (e) => {
|
|
1381
1381
|
const {
|
|
1382
1382
|
__scopeDialog: t,
|
|
1383
1383
|
children: n,
|
|
@@ -1385,33 +1385,33 @@ var Aa = function(e) {
|
|
|
1385
1385
|
defaultOpen: a,
|
|
1386
1386
|
onOpenChange: o,
|
|
1387
1387
|
modal: i = !0
|
|
1388
|
-
} = e, s = c.useRef(null), v = c.useRef(null), [
|
|
1388
|
+
} = e, s = c.useRef(null), v = c.useRef(null), [p, f] = Rr({
|
|
1389
1389
|
prop: r,
|
|
1390
1390
|
defaultProp: a ?? !1,
|
|
1391
1391
|
onChange: o,
|
|
1392
|
-
caller:
|
|
1392
|
+
caller: Ze
|
|
1393
1393
|
});
|
|
1394
1394
|
return /* @__PURE__ */ d.jsx(
|
|
1395
|
-
|
|
1395
|
+
Fa,
|
|
1396
1396
|
{
|
|
1397
1397
|
scope: t,
|
|
1398
1398
|
triggerRef: s,
|
|
1399
1399
|
contentRef: v,
|
|
1400
|
-
contentId:
|
|
1401
|
-
titleId:
|
|
1402
|
-
descriptionId:
|
|
1403
|
-
open:
|
|
1404
|
-
onOpenChange:
|
|
1405
|
-
onOpenToggle: c.useCallback(() =>
|
|
1400
|
+
contentId: et(),
|
|
1401
|
+
titleId: et(),
|
|
1402
|
+
descriptionId: et(),
|
|
1403
|
+
open: p,
|
|
1404
|
+
onOpenChange: f,
|
|
1405
|
+
onOpenToggle: c.useCallback(() => f((l) => !l), [f]),
|
|
1406
1406
|
modal: i,
|
|
1407
1407
|
children: n
|
|
1408
1408
|
}
|
|
1409
1409
|
);
|
|
1410
1410
|
};
|
|
1411
|
-
|
|
1412
|
-
var
|
|
1411
|
+
En.displayName = Ze;
|
|
1412
|
+
var Sn = "DialogTrigger", Rn = c.forwardRef(
|
|
1413
1413
|
(e, t) => {
|
|
1414
|
-
const { __scopeDialog: n, ...r } = e, a = ae(
|
|
1414
|
+
const { __scopeDialog: n, ...r } = e, a = ae(Sn, n), o = ye(t, a.triggerRef);
|
|
1415
1415
|
return /* @__PURE__ */ d.jsx(
|
|
1416
1416
|
ie.button,
|
|
1417
1417
|
{
|
|
@@ -1427,28 +1427,28 @@ var wn = "DialogTrigger", bn = c.forwardRef(
|
|
|
1427
1427
|
);
|
|
1428
1428
|
}
|
|
1429
1429
|
);
|
|
1430
|
-
|
|
1431
|
-
var bt = "DialogPortal", [
|
|
1430
|
+
Rn.displayName = Sn;
|
|
1431
|
+
var bt = "DialogPortal", [Wa, xn] = yn(bt, {
|
|
1432
1432
|
forceMount: void 0
|
|
1433
|
-
}),
|
|
1433
|
+
}), Cn = (e) => {
|
|
1434
1434
|
const { __scopeDialog: t, forceMount: n, children: r, container: a } = e, o = ae(bt, t);
|
|
1435
|
-
return /* @__PURE__ */ d.jsx(
|
|
1435
|
+
return /* @__PURE__ */ d.jsx(Wa, { scope: t, forceMount: n, children: c.Children.map(r, (i) => /* @__PURE__ */ d.jsx(Ke, { present: n || o.open, children: /* @__PURE__ */ d.jsx(un, { asChild: !0, container: a, children: i }) })) });
|
|
1436
1436
|
};
|
|
1437
|
-
|
|
1438
|
-
var
|
|
1437
|
+
Cn.displayName = bt;
|
|
1438
|
+
var Ge = "DialogOverlay", Tn = c.forwardRef(
|
|
1439
1439
|
(e, t) => {
|
|
1440
|
-
const n =
|
|
1441
|
-
return o.modal ? /* @__PURE__ */ d.jsx(
|
|
1440
|
+
const n = xn(Ge, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = ae(Ge, e.__scopeDialog);
|
|
1441
|
+
return o.modal ? /* @__PURE__ */ d.jsx(Ke, { present: r || o.open, children: /* @__PURE__ */ d.jsx(Ba, { ...a, ref: t }) }) : null;
|
|
1442
1442
|
}
|
|
1443
1443
|
);
|
|
1444
|
-
|
|
1445
|
-
var
|
|
1444
|
+
Tn.displayName = Ge;
|
|
1445
|
+
var Ua = /* @__PURE__ */ rn("DialogOverlay.RemoveScroll"), Ba = c.forwardRef(
|
|
1446
1446
|
(e, t) => {
|
|
1447
|
-
const { __scopeDialog: n, ...r } = e, a = ae(
|
|
1447
|
+
const { __scopeDialog: n, ...r } = e, a = ae(Ge, n);
|
|
1448
1448
|
return (
|
|
1449
1449
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
1450
1450
|
// ie. when `Overlay` and `Content` are siblings
|
|
1451
|
-
/* @__PURE__ */ d.jsx(
|
|
1451
|
+
/* @__PURE__ */ d.jsx(wn, { as: Ua, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ d.jsx(
|
|
1452
1452
|
ie.div,
|
|
1453
1453
|
{
|
|
1454
1454
|
"data-state": Et(a.open),
|
|
@@ -1459,21 +1459,21 @@ var $a = /* @__PURE__ */ Qt("DialogOverlay.RemoveScroll"), La = c.forwardRef(
|
|
|
1459
1459
|
) })
|
|
1460
1460
|
);
|
|
1461
1461
|
}
|
|
1462
|
-
), be = "DialogContent",
|
|
1462
|
+
), be = "DialogContent", Pn = c.forwardRef(
|
|
1463
1463
|
(e, t) => {
|
|
1464
|
-
const n =
|
|
1465
|
-
return /* @__PURE__ */ d.jsx(
|
|
1464
|
+
const n = xn(be, e.__scopeDialog), { forceMount: r = n.forceMount, ...a } = e, o = ae(be, e.__scopeDialog);
|
|
1465
|
+
return /* @__PURE__ */ d.jsx(Ke, { present: r || o.open, children: o.modal ? /* @__PURE__ */ d.jsx(Ha, { ...a, ref: t }) : /* @__PURE__ */ d.jsx(Ya, { ...a, ref: t }) });
|
|
1466
1466
|
}
|
|
1467
1467
|
);
|
|
1468
|
-
|
|
1469
|
-
var
|
|
1468
|
+
Pn.displayName = be;
|
|
1469
|
+
var Ha = c.forwardRef(
|
|
1470
1470
|
(e, t) => {
|
|
1471
1471
|
const n = ae(be, e.__scopeDialog), r = c.useRef(null), a = ye(t, n.contentRef, r);
|
|
1472
1472
|
return c.useEffect(() => {
|
|
1473
1473
|
const o = r.current;
|
|
1474
|
-
if (o) return
|
|
1474
|
+
if (o) return La(o);
|
|
1475
1475
|
}, []), /* @__PURE__ */ d.jsx(
|
|
1476
|
-
|
|
1476
|
+
On,
|
|
1477
1477
|
{
|
|
1478
1478
|
...e,
|
|
1479
1479
|
ref: a,
|
|
@@ -1494,11 +1494,11 @@ var Fa = c.forwardRef(
|
|
|
1494
1494
|
}
|
|
1495
1495
|
);
|
|
1496
1496
|
}
|
|
1497
|
-
),
|
|
1497
|
+
), Ya = c.forwardRef(
|
|
1498
1498
|
(e, t) => {
|
|
1499
1499
|
const n = ae(be, e.__scopeDialog), r = c.useRef(!1), a = c.useRef(!1);
|
|
1500
1500
|
return /* @__PURE__ */ d.jsx(
|
|
1501
|
-
|
|
1501
|
+
On,
|
|
1502
1502
|
{
|
|
1503
1503
|
...e,
|
|
1504
1504
|
ref: t,
|
|
@@ -1509,20 +1509,20 @@ var Fa = c.forwardRef(
|
|
|
1509
1509
|
(i = e.onCloseAutoFocus) == null || i.call(e, o), o.defaultPrevented || (r.current || (s = n.triggerRef.current) == null || s.focus(), o.preventDefault()), r.current = !1, a.current = !1;
|
|
1510
1510
|
},
|
|
1511
1511
|
onInteractOutside: (o) => {
|
|
1512
|
-
var v,
|
|
1512
|
+
var v, p;
|
|
1513
1513
|
(v = e.onInteractOutside) == null || v.call(e, o), o.defaultPrevented || (r.current = !0, o.detail.originalEvent.type === "pointerdown" && (a.current = !0));
|
|
1514
1514
|
const i = o.target;
|
|
1515
|
-
((
|
|
1515
|
+
((p = n.triggerRef.current) == null ? void 0 : p.contains(i)) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && a.current && o.preventDefault();
|
|
1516
1516
|
}
|
|
1517
1517
|
}
|
|
1518
1518
|
);
|
|
1519
1519
|
}
|
|
1520
|
-
),
|
|
1520
|
+
), On = c.forwardRef(
|
|
1521
1521
|
(e, t) => {
|
|
1522
|
-
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: a, onCloseAutoFocus: o, ...i } = e, s = ae(be, n), v = c.useRef(null),
|
|
1523
|
-
return
|
|
1522
|
+
const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: a, onCloseAutoFocus: o, ...i } = e, s = ae(be, n), v = c.useRef(null), p = ye(t, v);
|
|
1523
|
+
return Zr(), /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1524
1524
|
/* @__PURE__ */ d.jsx(
|
|
1525
|
-
|
|
1525
|
+
cn,
|
|
1526
1526
|
{
|
|
1527
1527
|
asChild: !0,
|
|
1528
1528
|
loop: !0,
|
|
@@ -1530,7 +1530,7 @@ var Fa = c.forwardRef(
|
|
|
1530
1530
|
onMountAutoFocus: a,
|
|
1531
1531
|
onUnmountAutoFocus: o,
|
|
1532
1532
|
children: /* @__PURE__ */ d.jsx(
|
|
1533
|
-
|
|
1533
|
+
on,
|
|
1534
1534
|
{
|
|
1535
1535
|
role: "dialog",
|
|
1536
1536
|
id: s.contentId,
|
|
@@ -1538,35 +1538,35 @@ var Fa = c.forwardRef(
|
|
|
1538
1538
|
"aria-labelledby": s.titleId,
|
|
1539
1539
|
"data-state": Et(s.open),
|
|
1540
1540
|
...i,
|
|
1541
|
-
ref:
|
|
1541
|
+
ref: p,
|
|
1542
1542
|
onDismiss: () => s.onOpenChange(!1)
|
|
1543
1543
|
}
|
|
1544
1544
|
)
|
|
1545
1545
|
}
|
|
1546
1546
|
),
|
|
1547
1547
|
/* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
1548
|
-
/* @__PURE__ */ d.jsx(
|
|
1549
|
-
/* @__PURE__ */ d.jsx(
|
|
1548
|
+
/* @__PURE__ */ d.jsx(za, { titleId: s.titleId }),
|
|
1549
|
+
/* @__PURE__ */ d.jsx(Xa, { contentRef: v, descriptionId: s.descriptionId })
|
|
1550
1550
|
] })
|
|
1551
1551
|
] });
|
|
1552
1552
|
}
|
|
1553
|
-
), yt = "DialogTitle",
|
|
1553
|
+
), yt = "DialogTitle", Nn = c.forwardRef(
|
|
1554
1554
|
(e, t) => {
|
|
1555
1555
|
const { __scopeDialog: n, ...r } = e, a = ae(yt, n);
|
|
1556
1556
|
return /* @__PURE__ */ d.jsx(ie.h2, { id: a.titleId, ...r, ref: t });
|
|
1557
1557
|
}
|
|
1558
1558
|
);
|
|
1559
|
-
|
|
1560
|
-
var
|
|
1559
|
+
Nn.displayName = yt;
|
|
1560
|
+
var Dn = "DialogDescription", Va = c.forwardRef(
|
|
1561
1561
|
(e, t) => {
|
|
1562
|
-
const { __scopeDialog: n, ...r } = e, a = ae(
|
|
1562
|
+
const { __scopeDialog: n, ...r } = e, a = ae(Dn, n);
|
|
1563
1563
|
return /* @__PURE__ */ d.jsx(ie.p, { id: a.descriptionId, ...r, ref: t });
|
|
1564
1564
|
}
|
|
1565
1565
|
);
|
|
1566
|
-
|
|
1567
|
-
var
|
|
1566
|
+
Va.displayName = Dn;
|
|
1567
|
+
var _n = "DialogClose", An = c.forwardRef(
|
|
1568
1568
|
(e, t) => {
|
|
1569
|
-
const { __scopeDialog: n, ...r } = e, a = ae(
|
|
1569
|
+
const { __scopeDialog: n, ...r } = e, a = ae(_n, n);
|
|
1570
1570
|
return /* @__PURE__ */ d.jsx(
|
|
1571
1571
|
ie.button,
|
|
1572
1572
|
{
|
|
@@ -1578,16 +1578,16 @@ var Pn = "DialogClose", Nn = c.forwardRef(
|
|
|
1578
1578
|
);
|
|
1579
1579
|
}
|
|
1580
1580
|
);
|
|
1581
|
-
|
|
1581
|
+
An.displayName = _n;
|
|
1582
1582
|
function Et(e) {
|
|
1583
1583
|
return e ? "open" : "closed";
|
|
1584
1584
|
}
|
|
1585
|
-
var
|
|
1585
|
+
var kn = "DialogTitleWarning", [zo, In] = gr(kn, {
|
|
1586
1586
|
contentName: be,
|
|
1587
1587
|
titleName: yt,
|
|
1588
1588
|
docsSlug: "dialog"
|
|
1589
|
-
}),
|
|
1590
|
-
const t =
|
|
1589
|
+
}), za = ({ titleId: e }) => {
|
|
1590
|
+
const t = In(kn), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
1591
1591
|
|
|
1592
1592
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
1593
1593
|
|
|
@@ -1595,20 +1595,20 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
1595
1595
|
return c.useEffect(() => {
|
|
1596
1596
|
e && (document.getElementById(e) || console.error(n));
|
|
1597
1597
|
}, [n, e]), null;
|
|
1598
|
-
},
|
|
1599
|
-
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${
|
|
1598
|
+
}, qa = "DialogDescriptionWarning", Xa = ({ contentRef: e, descriptionId: t }) => {
|
|
1599
|
+
const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${In(qa).contentName}}.`;
|
|
1600
1600
|
return c.useEffect(() => {
|
|
1601
1601
|
var o;
|
|
1602
1602
|
const a = (o = e.current) == null ? void 0 : o.getAttribute("aria-describedby");
|
|
1603
1603
|
t && a && (document.getElementById(t) || console.warn(r));
|
|
1604
1604
|
}, [r, e, t]), null;
|
|
1605
|
-
},
|
|
1606
|
-
function
|
|
1605
|
+
}, Ga = En, Ka = Rn, Ja = Cn, Za = Tn, Qa = Pn, eo = Nn, to = An;
|
|
1606
|
+
function no(e) {
|
|
1607
1607
|
if (typeof document > "u") return;
|
|
1608
1608
|
let t = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
|
|
1609
1609
|
n.type = "text/css", t.appendChild(n), n.styleSheet ? n.styleSheet.cssText = e : n.appendChild(document.createTextNode(e));
|
|
1610
1610
|
}
|
|
1611
|
-
const
|
|
1611
|
+
const Mn = b.createContext({
|
|
1612
1612
|
drawerRef: {
|
|
1613
1613
|
current: null
|
|
1614
1614
|
},
|
|
@@ -1656,56 +1656,56 @@ const An = E.createContext({
|
|
|
1656
1656
|
container: null,
|
|
1657
1657
|
autoFocus: !1
|
|
1658
1658
|
}), je = () => {
|
|
1659
|
-
const e =
|
|
1659
|
+
const e = b.useContext(Mn);
|
|
1660
1660
|
if (!e)
|
|
1661
1661
|
throw new Error("useDrawerContext must be used within a Drawer.Root");
|
|
1662
1662
|
return e;
|
|
1663
1663
|
};
|
|
1664
|
-
|
|
1664
|
+
no(`[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(
|
|
1665
1665
|
[data-state=closed]
|
|
1666
1666
|
){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)}}`);
|
|
1667
|
-
function
|
|
1667
|
+
function ro() {
|
|
1668
1668
|
const e = navigator.userAgent;
|
|
1669
1669
|
return typeof window < "u" && (/Firefox/.test(e) && /Mobile/.test(e) || // Android Firefox
|
|
1670
1670
|
/FxiOS/.test(e));
|
|
1671
1671
|
}
|
|
1672
|
-
function
|
|
1672
|
+
function ao() {
|
|
1673
1673
|
return St(/^Mac/);
|
|
1674
1674
|
}
|
|
1675
|
-
function
|
|
1675
|
+
function oo() {
|
|
1676
1676
|
return St(/^iPhone/);
|
|
1677
1677
|
}
|
|
1678
1678
|
function Xt() {
|
|
1679
1679
|
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function so() {
|
|
1682
1682
|
return St(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
1683
|
-
|
|
1683
|
+
ao() && navigator.maxTouchPoints > 1;
|
|
1684
1684
|
}
|
|
1685
|
-
function
|
|
1686
|
-
return
|
|
1685
|
+
function jn() {
|
|
1686
|
+
return oo() || so();
|
|
1687
1687
|
}
|
|
1688
1688
|
function St(e) {
|
|
1689
1689
|
return typeof window < "u" && window.navigator != null ? e.test(window.navigator.platform) : void 0;
|
|
1690
1690
|
}
|
|
1691
|
-
const
|
|
1691
|
+
const io = 24, co = typeof window < "u" ? cr : wt;
|
|
1692
1692
|
function Gt(...e) {
|
|
1693
1693
|
return (...t) => {
|
|
1694
1694
|
for (let n of e)
|
|
1695
1695
|
typeof n == "function" && n(...t);
|
|
1696
1696
|
};
|
|
1697
1697
|
}
|
|
1698
|
-
const
|
|
1698
|
+
const ct = typeof document < "u" && window.visualViewport;
|
|
1699
1699
|
function Kt(e) {
|
|
1700
1700
|
let t = window.getComputedStyle(e);
|
|
1701
1701
|
return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
|
|
1702
1702
|
}
|
|
1703
|
-
function
|
|
1703
|
+
function $n(e) {
|
|
1704
1704
|
for (Kt(e) && (e = e.parentElement); e && !Kt(e); )
|
|
1705
1705
|
e = e.parentElement;
|
|
1706
1706
|
return e || document.scrollingElement || document.documentElement;
|
|
1707
1707
|
}
|
|
1708
|
-
const
|
|
1708
|
+
const lo = /* @__PURE__ */ new Set([
|
|
1709
1709
|
"checkbox",
|
|
1710
1710
|
"radio",
|
|
1711
1711
|
"range",
|
|
@@ -1716,67 +1716,67 @@ const oo = /* @__PURE__ */ new Set([
|
|
|
1716
1716
|
"submit",
|
|
1717
1717
|
"reset"
|
|
1718
1718
|
]);
|
|
1719
|
-
let
|
|
1720
|
-
function
|
|
1719
|
+
let Ve = 0, lt;
|
|
1720
|
+
function uo(e = {}) {
|
|
1721
1721
|
let { isDisabled: t } = e;
|
|
1722
|
-
|
|
1722
|
+
co(() => {
|
|
1723
1723
|
if (!t)
|
|
1724
|
-
return
|
|
1725
|
-
|
|
1724
|
+
return Ve++, Ve === 1 && jn() && (lt = fo()), () => {
|
|
1725
|
+
Ve--, Ve === 0 && (lt == null || lt());
|
|
1726
1726
|
};
|
|
1727
1727
|
}, [
|
|
1728
1728
|
t
|
|
1729
1729
|
]);
|
|
1730
1730
|
}
|
|
1731
|
-
function
|
|
1732
|
-
let e, t = 0, n = (
|
|
1733
|
-
e =
|
|
1734
|
-
}, r = (
|
|
1731
|
+
function fo() {
|
|
1732
|
+
let e, t = 0, n = (l) => {
|
|
1733
|
+
e = $n(l.target), !(e === document.documentElement && e === document.body) && (t = l.changedTouches[0].pageY);
|
|
1734
|
+
}, r = (l) => {
|
|
1735
1735
|
if (!e || e === document.documentElement || e === document.body) {
|
|
1736
|
-
|
|
1736
|
+
l.preventDefault();
|
|
1737
1737
|
return;
|
|
1738
1738
|
}
|
|
1739
|
-
let h =
|
|
1740
|
-
|
|
1741
|
-
}, a = (
|
|
1742
|
-
let h =
|
|
1743
|
-
ht(h) && h !== document.activeElement && (
|
|
1739
|
+
let h = l.changedTouches[0].pageY, R = e.scrollTop, O = e.scrollHeight - e.clientHeight;
|
|
1740
|
+
O !== 0 && ((R <= 0 && h > t || R >= O && h < t) && l.preventDefault(), t = h);
|
|
1741
|
+
}, a = (l) => {
|
|
1742
|
+
let h = l.target;
|
|
1743
|
+
ht(h) && h !== document.activeElement && (l.preventDefault(), h.style.transform = "translateY(-2000px)", h.focus(), requestAnimationFrame(() => {
|
|
1744
1744
|
h.style.transform = "";
|
|
1745
1745
|
}));
|
|
1746
|
-
}, o = (
|
|
1747
|
-
let h =
|
|
1746
|
+
}, o = (l) => {
|
|
1747
|
+
let h = l.target;
|
|
1748
1748
|
ht(h) && (h.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
|
|
1749
|
-
h.style.transform = "",
|
|
1749
|
+
h.style.transform = "", ct && (ct.height < window.innerHeight ? requestAnimationFrame(() => {
|
|
1750
1750
|
Jt(h);
|
|
1751
|
-
}) :
|
|
1751
|
+
}) : ct.addEventListener("resize", () => Jt(h), {
|
|
1752
1752
|
once: !0
|
|
1753
1753
|
}));
|
|
1754
1754
|
}));
|
|
1755
1755
|
}, i = () => {
|
|
1756
1756
|
window.scrollTo(0, 0);
|
|
1757
|
-
}, s = window.pageXOffset, v = window.pageYOffset,
|
|
1757
|
+
}, s = window.pageXOffset, v = window.pageYOffset, p = Gt(mo(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
1758
1758
|
window.scrollTo(0, 0);
|
|
1759
|
-
let
|
|
1759
|
+
let f = Gt(Ae(document, "touchstart", n, {
|
|
1760
1760
|
passive: !1,
|
|
1761
1761
|
capture: !0
|
|
1762
|
-
}),
|
|
1762
|
+
}), Ae(document, "touchmove", r, {
|
|
1763
1763
|
passive: !1,
|
|
1764
1764
|
capture: !0
|
|
1765
|
-
}),
|
|
1765
|
+
}), Ae(document, "touchend", a, {
|
|
1766
1766
|
passive: !1,
|
|
1767
1767
|
capture: !0
|
|
1768
|
-
}),
|
|
1768
|
+
}), Ae(document, "focus", o, !0), Ae(window, "scroll", i));
|
|
1769
1769
|
return () => {
|
|
1770
|
-
|
|
1770
|
+
p(), f(), window.scrollTo(s, v);
|
|
1771
1771
|
};
|
|
1772
1772
|
}
|
|
1773
|
-
function
|
|
1773
|
+
function mo(e, t, n) {
|
|
1774
1774
|
let r = e.style[t];
|
|
1775
1775
|
return e.style[t] = n, () => {
|
|
1776
1776
|
e.style[t] = r;
|
|
1777
1777
|
};
|
|
1778
1778
|
}
|
|
1779
|
-
function
|
|
1779
|
+
function Ae(e, t, n, r) {
|
|
1780
1780
|
return e.addEventListener(t, n, r), () => {
|
|
1781
1781
|
e.removeEventListener(t, n, r);
|
|
1782
1782
|
};
|
|
@@ -1784,28 +1784,28 @@ function _e(e, t, n, r) {
|
|
|
1784
1784
|
function Jt(e) {
|
|
1785
1785
|
let t = document.scrollingElement || document.documentElement;
|
|
1786
1786
|
for (; e && e !== t; ) {
|
|
1787
|
-
let n =
|
|
1787
|
+
let n = $n(e);
|
|
1788
1788
|
if (n !== document.documentElement && n !== document.body && n !== e) {
|
|
1789
1789
|
let r = n.getBoundingClientRect().top, a = e.getBoundingClientRect().top, o = e.getBoundingClientRect().bottom;
|
|
1790
|
-
const i = n.getBoundingClientRect().bottom +
|
|
1790
|
+
const i = n.getBoundingClientRect().bottom + io;
|
|
1791
1791
|
o > i && (n.scrollTop += a - r);
|
|
1792
1792
|
}
|
|
1793
1793
|
e = n.parentElement;
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
function ht(e) {
|
|
1797
|
-
return e instanceof HTMLInputElement && !
|
|
1797
|
+
return e instanceof HTMLInputElement && !lo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
|
|
1798
1798
|
}
|
|
1799
|
-
function
|
|
1799
|
+
function po(e, t) {
|
|
1800
1800
|
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
1801
1801
|
}
|
|
1802
|
-
function
|
|
1803
|
-
return (t) => e.forEach((n) =>
|
|
1802
|
+
function vo(...e) {
|
|
1803
|
+
return (t) => e.forEach((n) => po(n, t));
|
|
1804
1804
|
}
|
|
1805
|
-
function
|
|
1806
|
-
return c.useCallback(
|
|
1805
|
+
function Ln(...e) {
|
|
1806
|
+
return c.useCallback(vo(...e), e);
|
|
1807
1807
|
}
|
|
1808
|
-
const
|
|
1808
|
+
const Fn = /* @__PURE__ */ new WeakMap();
|
|
1809
1809
|
function X(e, t, n = !1) {
|
|
1810
1810
|
if (!e || !(e instanceof HTMLElement)) return;
|
|
1811
1811
|
let r = {};
|
|
@@ -1815,14 +1815,14 @@ function X(e, t, n = !1) {
|
|
|
1815
1815
|
return;
|
|
1816
1816
|
}
|
|
1817
1817
|
r[a] = e.style[a], e.style[a] = o;
|
|
1818
|
-
}), !n &&
|
|
1818
|
+
}), !n && Fn.set(e, r);
|
|
1819
1819
|
}
|
|
1820
|
-
function
|
|
1820
|
+
function ho(e, t) {
|
|
1821
1821
|
if (!e || !(e instanceof HTMLElement)) return;
|
|
1822
|
-
let n =
|
|
1822
|
+
let n = Fn.get(e);
|
|
1823
1823
|
n && (e.style[t] = n[t]);
|
|
1824
1824
|
}
|
|
1825
|
-
const
|
|
1825
|
+
const Y = (e) => {
|
|
1826
1826
|
switch (e) {
|
|
1827
1827
|
case "top":
|
|
1828
1828
|
case "bottom":
|
|
@@ -1842,12 +1842,12 @@ function ze(e, t) {
|
|
|
1842
1842
|
n.transform || n.webkitTransform || n.mozTransform
|
|
1843
1843
|
);
|
|
1844
1844
|
let a = r.match(/^matrix3d\((.+)\)$/);
|
|
1845
|
-
return a ? parseFloat(a[1].split(", ")[
|
|
1845
|
+
return a ? parseFloat(a[1].split(", ")[Y(t) ? 13 : 12]) : (a = r.match(/^matrix\((.+)\)$/), a ? parseFloat(a[1].split(", ")[Y(t) ? 5 : 4]) : null);
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function go(e) {
|
|
1848
1848
|
return 8 * (Math.log(e + 1) - 2);
|
|
1849
1849
|
}
|
|
1850
|
-
function
|
|
1850
|
+
function ut(e, t) {
|
|
1851
1851
|
if (!e) return () => {
|
|
1852
1852
|
};
|
|
1853
1853
|
const n = e.style.cssText;
|
|
@@ -1855,13 +1855,13 @@ function dt(e, t) {
|
|
|
1855
1855
|
e.style.cssText = n;
|
|
1856
1856
|
};
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function wo(...e) {
|
|
1859
1859
|
return (...t) => {
|
|
1860
1860
|
for (const n of e)
|
|
1861
1861
|
typeof n == "function" && n(...t);
|
|
1862
1862
|
};
|
|
1863
1863
|
}
|
|
1864
|
-
const
|
|
1864
|
+
const B = {
|
|
1865
1865
|
DURATION: 0.5,
|
|
1866
1866
|
EASE: [
|
|
1867
1867
|
0.32,
|
|
@@ -1869,16 +1869,16 @@ const U = {
|
|
|
1869
1869
|
0,
|
|
1870
1870
|
1
|
|
1871
1871
|
]
|
|
1872
|
-
},
|
|
1873
|
-
function
|
|
1874
|
-
const t =
|
|
1875
|
-
return
|
|
1872
|
+
}, Wn = 0.4, bo = 0.25, yo = 100, Un = 8, we = 16, gt = 26, dt = "vaul-dragging";
|
|
1873
|
+
function Bn(e) {
|
|
1874
|
+
const t = b.useRef(e);
|
|
1875
|
+
return b.useEffect(() => {
|
|
1876
1876
|
t.current = e;
|
|
1877
|
-
}),
|
|
1877
|
+
}), b.useMemo(() => (...n) => t.current == null ? void 0 : t.current.call(t, ...n), []);
|
|
1878
1878
|
}
|
|
1879
|
-
function
|
|
1880
|
-
const n =
|
|
1881
|
-
return
|
|
1879
|
+
function Eo({ defaultProp: e, onChange: t }) {
|
|
1880
|
+
const n = b.useState(e), [r] = n, a = b.useRef(r), o = Bn(t);
|
|
1881
|
+
return b.useEffect(() => {
|
|
1882
1882
|
a.current !== r && (o(r), a.current = r);
|
|
1883
1883
|
}, [
|
|
1884
1884
|
r,
|
|
@@ -1886,17 +1886,17 @@ function go({ defaultProp: e, onChange: t }) {
|
|
|
1886
1886
|
o
|
|
1887
1887
|
]), n;
|
|
1888
1888
|
}
|
|
1889
|
-
function
|
|
1889
|
+
function Hn({ prop: e, defaultProp: t, onChange: n = () => {
|
|
1890
1890
|
} }) {
|
|
1891
|
-
const [r, a] =
|
|
1891
|
+
const [r, a] = Eo({
|
|
1892
1892
|
defaultProp: t,
|
|
1893
1893
|
onChange: n
|
|
1894
|
-
}), o = e !== void 0, i = o ? e : r, s =
|
|
1894
|
+
}), o = e !== void 0, i = o ? e : r, s = Bn(n), v = b.useCallback((p) => {
|
|
1895
1895
|
if (o) {
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1896
|
+
const l = typeof p == "function" ? p(e) : p;
|
|
1897
|
+
l !== e && s(l);
|
|
1898
1898
|
} else
|
|
1899
|
-
a(
|
|
1899
|
+
a(p);
|
|
1900
1900
|
}, [
|
|
1901
1901
|
o,
|
|
1902
1902
|
e,
|
|
@@ -1908,16 +1908,16 @@ function Fn({ prop: e, defaultProp: t, onChange: n = () => {
|
|
|
1908
1908
|
v
|
|
1909
1909
|
];
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1912
|
-
const [
|
|
1911
|
+
function So({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n, drawerRef: r, overlayRef: a, fadeFromIndex: o, onSnapPointChange: i, direction: s = "bottom", container: v, snapToSequentialPoint: p }) {
|
|
1912
|
+
const [f, l] = Hn({
|
|
1913
1913
|
prop: e,
|
|
1914
1914
|
defaultProp: n == null ? void 0 : n[0],
|
|
1915
1915
|
onChange: t
|
|
1916
|
-
}), [h, R] =
|
|
1916
|
+
}), [h, R] = b.useState(typeof window < "u" ? {
|
|
1917
1917
|
innerWidth: window.innerWidth,
|
|
1918
1918
|
innerHeight: window.innerHeight
|
|
1919
1919
|
} : void 0);
|
|
1920
|
-
|
|
1920
|
+
b.useEffect(() => {
|
|
1921
1921
|
function w() {
|
|
1922
1922
|
R({
|
|
1923
1923
|
innerWidth: window.innerWidth,
|
|
@@ -1926,16 +1926,16 @@ function wo({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n,
|
|
|
1926
1926
|
}
|
|
1927
1927
|
return window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
|
|
1928
1928
|
}, []);
|
|
1929
|
-
const
|
|
1929
|
+
const O = b.useMemo(() => f === (n == null ? void 0 : n[n.length - 1]) || null, [
|
|
1930
1930
|
n,
|
|
1931
|
-
|
|
1932
|
-
]),
|
|
1931
|
+
f
|
|
1932
|
+
]), m = b.useMemo(() => {
|
|
1933
1933
|
var w;
|
|
1934
|
-
return (w = n == null ? void 0 : n.findIndex((
|
|
1934
|
+
return (w = n == null ? void 0 : n.findIndex((A) => A === f)) != null ? w : null;
|
|
1935
1935
|
}, [
|
|
1936
1936
|
n,
|
|
1937
|
-
|
|
1938
|
-
]), S = n && n.length > 0 && (o || o === 0) && !Number.isNaN(o) && n[o] ===
|
|
1937
|
+
f
|
|
1938
|
+
]), S = n && n.length > 0 && (o || o === 0) && !Number.isNaN(o) && n[o] === f || !n, g = b.useMemo(() => {
|
|
1939
1939
|
const w = v ? {
|
|
1940
1940
|
width: v.getBoundingClientRect().width,
|
|
1941
1941
|
height: v.getBoundingClientRect().height
|
|
@@ -1946,146 +1946,146 @@ function wo({ activeSnapPointProp: e, setActiveSnapPointProp: t, snapPoints: n,
|
|
|
1946
1946
|
width: 0,
|
|
1947
1947
|
height: 0
|
|
1948
1948
|
};
|
|
1949
|
-
var
|
|
1950
|
-
return (
|
|
1951
|
-
const
|
|
1952
|
-
let
|
|
1953
|
-
if (
|
|
1954
|
-
const
|
|
1955
|
-
return h ? s === "bottom" ? w.height -
|
|
1949
|
+
var A;
|
|
1950
|
+
return (A = n == null ? void 0 : n.map((N) => {
|
|
1951
|
+
const W = typeof N == "string";
|
|
1952
|
+
let U = 0;
|
|
1953
|
+
if (W && (U = parseInt(N, 10)), Y(s)) {
|
|
1954
|
+
const x = W ? U : h ? N * w.height : 0;
|
|
1955
|
+
return h ? s === "bottom" ? w.height - x : -w.height + x : x;
|
|
1956
1956
|
}
|
|
1957
|
-
const
|
|
1958
|
-
return h ? s === "right" ? w.width -
|
|
1959
|
-
})) != null ?
|
|
1957
|
+
const V = W ? U : h ? N * w.width : 0;
|
|
1958
|
+
return h ? s === "right" ? w.width - V : -w.width + V : V;
|
|
1959
|
+
})) != null ? A : [];
|
|
1960
1960
|
}, [
|
|
1961
1961
|
n,
|
|
1962
1962
|
h,
|
|
1963
1963
|
v
|
|
1964
|
-
]), T =
|
|
1964
|
+
]), T = b.useMemo(() => m !== null ? g == null ? void 0 : g[m] : null, [
|
|
1965
1965
|
g,
|
|
1966
|
-
|
|
1967
|
-
]), P =
|
|
1968
|
-
var
|
|
1969
|
-
const
|
|
1970
|
-
i(
|
|
1971
|
-
transition: `transform ${
|
|
1972
|
-
transform:
|
|
1973
|
-
}), g &&
|
|
1974
|
-
transition: `opacity ${
|
|
1966
|
+
m
|
|
1967
|
+
]), P = b.useCallback((w) => {
|
|
1968
|
+
var A;
|
|
1969
|
+
const N = (A = g == null ? void 0 : g.findIndex((W) => W === w)) != null ? A : null;
|
|
1970
|
+
i(N), X(r.current, {
|
|
1971
|
+
transition: `transform ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
1972
|
+
transform: Y(s) ? `translate3d(0, ${w}px, 0)` : `translate3d(${w}px, 0, 0)`
|
|
1973
|
+
}), g && N !== g.length - 1 && o !== void 0 && N !== o && N < o ? X(a.current, {
|
|
1974
|
+
transition: `opacity ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
1975
1975
|
opacity: "0"
|
|
1976
1976
|
}) : X(a.current, {
|
|
1977
|
-
transition: `opacity ${
|
|
1977
|
+
transition: `opacity ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
1978
1978
|
opacity: "1"
|
|
1979
|
-
}),
|
|
1979
|
+
}), l(n == null ? void 0 : n[Math.max(N, 0)]);
|
|
1980
1980
|
}, [
|
|
1981
1981
|
r.current,
|
|
1982
1982
|
n,
|
|
1983
1983
|
g,
|
|
1984
1984
|
o,
|
|
1985
1985
|
a,
|
|
1986
|
-
|
|
1986
|
+
l
|
|
1987
1987
|
]);
|
|
1988
|
-
|
|
1989
|
-
if (
|
|
1988
|
+
b.useEffect(() => {
|
|
1989
|
+
if (f || e) {
|
|
1990
1990
|
var w;
|
|
1991
|
-
const
|
|
1992
|
-
g &&
|
|
1991
|
+
const A = (w = n == null ? void 0 : n.findIndex((N) => N === e || N === f)) != null ? w : -1;
|
|
1992
|
+
g && A !== -1 && typeof g[A] == "number" && P(g[A]);
|
|
1993
1993
|
}
|
|
1994
1994
|
}, [
|
|
1995
|
-
|
|
1995
|
+
f,
|
|
1996
1996
|
e,
|
|
1997
1997
|
n,
|
|
1998
1998
|
g,
|
|
1999
1999
|
P
|
|
2000
2000
|
]);
|
|
2001
|
-
function y({ draggedDistance: w, closeDrawer:
|
|
2001
|
+
function y({ draggedDistance: w, closeDrawer: A, velocity: N, dismissible: W }) {
|
|
2002
2002
|
if (o === void 0) return;
|
|
2003
|
-
const
|
|
2004
|
-
if (
|
|
2005
|
-
transition: `opacity ${
|
|
2006
|
-
}), !
|
|
2007
|
-
|
|
2003
|
+
const U = s === "bottom" || s === "right" ? (T ?? 0) - w : (T ?? 0) + w, V = m === o - 1, x = m === 0, G = w > 0;
|
|
2004
|
+
if (V && X(a.current, {
|
|
2005
|
+
transition: `opacity ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`
|
|
2006
|
+
}), !p && N > 2 && !G) {
|
|
2007
|
+
W ? A() : P(g[0]);
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
|
-
if (!
|
|
2010
|
+
if (!p && N > 2 && G && g && n) {
|
|
2011
2011
|
P(g[n.length - 1]);
|
|
2012
2012
|
return;
|
|
2013
2013
|
}
|
|
2014
|
-
const z = g == null ? void 0 : g.reduce((q,
|
|
2015
|
-
if (
|
|
2016
|
-
const q =
|
|
2017
|
-
if (q > 0 &&
|
|
2014
|
+
const z = g == null ? void 0 : g.reduce((q, Q) => typeof q != "number" || typeof Q != "number" ? q : Math.abs(Q - U) < Math.abs(q - U) ? Q : q), K = Y(s) ? window.innerHeight : window.innerWidth;
|
|
2015
|
+
if (N > Wn && Math.abs(w) < K * 0.4) {
|
|
2016
|
+
const q = G ? 1 : -1;
|
|
2017
|
+
if (q > 0 && O && n) {
|
|
2018
2018
|
P(g[n.length - 1]);
|
|
2019
2019
|
return;
|
|
2020
2020
|
}
|
|
2021
|
-
if (
|
|
2022
|
-
P(g[
|
|
2021
|
+
if (x && q < 0 && W && A(), m === null) return;
|
|
2022
|
+
P(g[m + q]);
|
|
2023
2023
|
return;
|
|
2024
2024
|
}
|
|
2025
2025
|
P(z);
|
|
2026
2026
|
}
|
|
2027
|
-
function
|
|
2027
|
+
function E({ draggedDistance: w }) {
|
|
2028
2028
|
if (T === null) return;
|
|
2029
|
-
const
|
|
2030
|
-
(s === "bottom" || s === "right") &&
|
|
2031
|
-
transform:
|
|
2029
|
+
const A = s === "bottom" || s === "right" ? T - w : T + w;
|
|
2030
|
+
(s === "bottom" || s === "right") && A < g[g.length - 1] || (s === "top" || s === "left") && A > g[g.length - 1] || X(r.current, {
|
|
2031
|
+
transform: Y(s) ? `translate3d(0, ${A}px, 0)` : `translate3d(${A}px, 0, 0)`
|
|
2032
2032
|
});
|
|
2033
2033
|
}
|
|
2034
|
-
function F(w,
|
|
2035
|
-
if (!n || typeof
|
|
2036
|
-
const
|
|
2037
|
-
if (
|
|
2034
|
+
function F(w, A) {
|
|
2035
|
+
if (!n || typeof m != "number" || !g || o === void 0) return null;
|
|
2036
|
+
const N = m === o - 1;
|
|
2037
|
+
if (m >= o && A)
|
|
2038
2038
|
return 0;
|
|
2039
|
-
if (
|
|
2040
|
-
if (!S && !
|
|
2041
|
-
const
|
|
2042
|
-
return
|
|
2039
|
+
if (N && !A) return 1;
|
|
2040
|
+
if (!S && !N) return null;
|
|
2041
|
+
const U = N ? m + 1 : m - 1, V = N ? g[U] - g[U - 1] : g[U + 1] - g[U], x = w / Math.abs(V);
|
|
2042
|
+
return N ? 1 - x : x;
|
|
2043
2043
|
}
|
|
2044
2044
|
return {
|
|
2045
|
-
isLastSnapPoint:
|
|
2046
|
-
activeSnapPoint:
|
|
2045
|
+
isLastSnapPoint: O,
|
|
2046
|
+
activeSnapPoint: f,
|
|
2047
2047
|
shouldFade: S,
|
|
2048
2048
|
getPercentageDragged: F,
|
|
2049
|
-
setActiveSnapPoint:
|
|
2050
|
-
activeSnapPointIndex:
|
|
2049
|
+
setActiveSnapPoint: l,
|
|
2050
|
+
activeSnapPointIndex: m,
|
|
2051
2051
|
onRelease: y,
|
|
2052
|
-
onDrag:
|
|
2052
|
+
onDrag: E,
|
|
2053
2053
|
snapPointsOffset: g
|
|
2054
2054
|
};
|
|
2055
2055
|
}
|
|
2056
|
-
const
|
|
2056
|
+
const Ro = () => () => {
|
|
2057
2057
|
};
|
|
2058
|
-
function
|
|
2059
|
-
const { direction: e, isOpen: t, shouldScaleBackground: n, setBackgroundColorOnScale: r, noBodyStyles: a } = je(), o =
|
|
2058
|
+
function xo() {
|
|
2059
|
+
const { direction: e, isOpen: t, shouldScaleBackground: n, setBackgroundColorOnScale: r, noBodyStyles: a } = je(), o = b.useRef(null), i = ir(() => document.body.style.backgroundColor, []);
|
|
2060
2060
|
function s() {
|
|
2061
2061
|
return (window.innerWidth - gt) / window.innerWidth;
|
|
2062
2062
|
}
|
|
2063
|
-
|
|
2063
|
+
b.useEffect(() => {
|
|
2064
2064
|
if (t && n) {
|
|
2065
2065
|
o.current && clearTimeout(o.current);
|
|
2066
2066
|
const v = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
|
|
2067
2067
|
if (!v) return;
|
|
2068
|
-
|
|
2068
|
+
wo(r && !a ? ut(document.body, {
|
|
2069
2069
|
background: "black"
|
|
2070
|
-
}) :
|
|
2071
|
-
transformOrigin:
|
|
2070
|
+
}) : Ro, ut(v, {
|
|
2071
|
+
transformOrigin: Y(e) ? "top" : "left",
|
|
2072
2072
|
transitionProperty: "transform, border-radius",
|
|
2073
|
-
transitionDuration: `${
|
|
2074
|
-
transitionTimingFunction: `cubic-bezier(${
|
|
2073
|
+
transitionDuration: `${B.DURATION}s`,
|
|
2074
|
+
transitionTimingFunction: `cubic-bezier(${B.EASE.join(",")})`
|
|
2075
2075
|
}));
|
|
2076
|
-
const
|
|
2077
|
-
borderRadius: `${
|
|
2076
|
+
const p = ut(v, {
|
|
2077
|
+
borderRadius: `${Un}px`,
|
|
2078
2078
|
overflow: "hidden",
|
|
2079
|
-
...
|
|
2079
|
+
...Y(e) ? {
|
|
2080
2080
|
transform: `scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
|
|
2081
2081
|
} : {
|
|
2082
2082
|
transform: `scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
|
|
2083
2083
|
}
|
|
2084
2084
|
});
|
|
2085
2085
|
return () => {
|
|
2086
|
-
|
|
2086
|
+
p(), o.current = window.setTimeout(() => {
|
|
2087
2087
|
i ? document.body.style.background = i : document.body.style.removeProperty("background");
|
|
2088
|
-
},
|
|
2088
|
+
}, B.DURATION * 1e3);
|
|
2089
2089
|
};
|
|
2090
2090
|
}
|
|
2091
2091
|
}, [
|
|
@@ -2095,8 +2095,8 @@ function yo() {
|
|
|
2095
2095
|
]);
|
|
2096
2096
|
}
|
|
2097
2097
|
let ke = null;
|
|
2098
|
-
function
|
|
2099
|
-
const [i, s] =
|
|
2098
|
+
function Co({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRestoration: a, noBodyStyles: o }) {
|
|
2099
|
+
const [i, s] = b.useState(() => typeof window < "u" ? window.location.href : ""), v = b.useRef(0), p = b.useCallback(() => {
|
|
2100
2100
|
if (Xt() && ke === null && e && !o) {
|
|
2101
2101
|
ke = {
|
|
2102
2102
|
position: document.body.style.position,
|
|
@@ -2105,10 +2105,10 @@ function Eo({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRes
|
|
|
2105
2105
|
height: document.body.style.height,
|
|
2106
2106
|
right: "unset"
|
|
2107
2107
|
};
|
|
2108
|
-
const { scrollX:
|
|
2108
|
+
const { scrollX: l, innerHeight: h } = window;
|
|
2109
2109
|
document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
|
|
2110
2110
|
top: `${-v.current}px`,
|
|
2111
|
-
left: `${-
|
|
2111
|
+
left: `${-l}px`,
|
|
2112
2112
|
right: "0px",
|
|
2113
2113
|
height: "auto"
|
|
2114
2114
|
}), window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
@@ -2118,117 +2118,117 @@ function Eo({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRes
|
|
|
2118
2118
|
}
|
|
2119
2119
|
}, [
|
|
2120
2120
|
e
|
|
2121
|
-
]),
|
|
2121
|
+
]), f = b.useCallback(() => {
|
|
2122
2122
|
if (Xt() && ke !== null && !o) {
|
|
2123
|
-
const
|
|
2123
|
+
const l = -parseInt(document.body.style.top, 10), h = -parseInt(document.body.style.left, 10);
|
|
2124
2124
|
Object.assign(document.body.style, ke), window.requestAnimationFrame(() => {
|
|
2125
2125
|
if (a && i !== window.location.href) {
|
|
2126
2126
|
s(window.location.href);
|
|
2127
2127
|
return;
|
|
2128
2128
|
}
|
|
2129
|
-
window.scrollTo(h,
|
|
2129
|
+
window.scrollTo(h, l);
|
|
2130
2130
|
}), ke = null;
|
|
2131
2131
|
}
|
|
2132
2132
|
}, [
|
|
2133
2133
|
i
|
|
2134
2134
|
]);
|
|
2135
|
-
return
|
|
2136
|
-
function
|
|
2135
|
+
return b.useEffect(() => {
|
|
2136
|
+
function l() {
|
|
2137
2137
|
v.current = window.scrollY;
|
|
2138
2138
|
}
|
|
2139
|
-
return
|
|
2140
|
-
window.removeEventListener("scroll",
|
|
2139
|
+
return l(), window.addEventListener("scroll", l), () => {
|
|
2140
|
+
window.removeEventListener("scroll", l);
|
|
2141
2141
|
};
|
|
2142
|
-
}, []),
|
|
2142
|
+
}, []), b.useEffect(() => {
|
|
2143
2143
|
if (t)
|
|
2144
2144
|
return () => {
|
|
2145
|
-
typeof document > "u" || document.querySelector("[data-vaul-drawer]") ||
|
|
2145
|
+
typeof document > "u" || document.querySelector("[data-vaul-drawer]") || f();
|
|
2146
2146
|
};
|
|
2147
2147
|
}, [
|
|
2148
2148
|
t,
|
|
2149
|
-
|
|
2150
|
-
]),
|
|
2151
|
-
n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches &&
|
|
2152
|
-
|
|
2153
|
-
}, 500)) :
|
|
2149
|
+
f
|
|
2150
|
+
]), b.useEffect(() => {
|
|
2151
|
+
n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && p(), t || window.setTimeout(() => {
|
|
2152
|
+
f();
|
|
2153
|
+
}, 500)) : f());
|
|
2154
2154
|
}, [
|
|
2155
2155
|
e,
|
|
2156
2156
|
r,
|
|
2157
2157
|
i,
|
|
2158
2158
|
t,
|
|
2159
2159
|
n,
|
|
2160
|
-
|
|
2161
|
-
|
|
2160
|
+
p,
|
|
2161
|
+
f
|
|
2162
2162
|
]), {
|
|
2163
|
-
restorePositionSetting:
|
|
2163
|
+
restorePositionSetting: f
|
|
2164
2164
|
};
|
|
2165
2165
|
}
|
|
2166
|
-
function
|
|
2167
|
-
var
|
|
2168
|
-
const [z = !1,
|
|
2169
|
-
defaultProp:
|
|
2166
|
+
function To({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: a, snapPoints: o, shouldScaleBackground: i = !1, setBackgroundColorOnScale: s = !0, closeThreshold: v = bo, scrollLockTimeout: p = yo, dismissible: f = !0, handleOnly: l = !1, fadeFromIndex: h = o && o.length - 1, activeSnapPoint: R, setActiveSnapPoint: O, fixed: m, modal: S = !0, onClose: g, nested: T, noBodyStyles: P = !1, direction: y = "bottom", defaultOpen: E = !1, disablePreventScroll: F = !0, snapToSequentialPoint: w = !1, preventScrollRestoration: A = !1, repositionInputs: N = !0, onAnimationEnd: W, container: U, autoFocus: V = !1 }) {
|
|
2167
|
+
var x, G;
|
|
2168
|
+
const [z = !1, K] = Hn({
|
|
2169
|
+
defaultProp: E,
|
|
2170
2170
|
prop: e,
|
|
2171
|
-
onChange: (
|
|
2172
|
-
t == null || t(
|
|
2173
|
-
|
|
2174
|
-
},
|
|
2171
|
+
onChange: (C) => {
|
|
2172
|
+
t == null || t(C), !C && !T && Qn(), setTimeout(() => {
|
|
2173
|
+
W == null || W(C);
|
|
2174
|
+
}, B.DURATION * 1e3), C && !S && typeof window < "u" && window.requestAnimationFrame(() => {
|
|
2175
2175
|
document.body.style.pointerEvents = "auto";
|
|
2176
|
-
}),
|
|
2176
|
+
}), C || (document.body.style.pointerEvents = "auto");
|
|
2177
2177
|
}
|
|
2178
|
-
}), [q,
|
|
2179
|
-
o &&
|
|
2180
|
-
}, []), { activeSnapPoint:
|
|
2178
|
+
}), [q, Q] = b.useState(!1), [te, ce] = b.useState(!1), [u, D] = b.useState(!1), I = b.useRef(null), L = b.useRef(null), le = b.useRef(null), ve = b.useRef(null), $ = b.useRef(null), ee = b.useRef(!1), he = b.useRef(null), Pe = b.useRef(0), Ee = b.useRef(!1), Rt = b.useRef(!E), xt = b.useRef(0), _ = b.useRef(null), Ct = b.useRef(((x = _.current) == null ? void 0 : x.getBoundingClientRect().height) || 0), Tt = b.useRef(((G = _.current) == null ? void 0 : G.getBoundingClientRect().width) || 0), Qe = b.useRef(0), Xn = b.useCallback((C) => {
|
|
2179
|
+
o && C === Oe.length - 1 && (L.current = /* @__PURE__ */ new Date());
|
|
2180
|
+
}, []), { activeSnapPoint: Gn, activeSnapPointIndex: Se, setActiveSnapPoint: Pt, onRelease: Kn, snapPointsOffset: Oe, onDrag: Jn, shouldFade: Ot, getPercentageDragged: Zn } = So({
|
|
2181
2181
|
snapPoints: o,
|
|
2182
2182
|
activeSnapPointProp: R,
|
|
2183
|
-
setActiveSnapPointProp:
|
|
2184
|
-
drawerRef:
|
|
2183
|
+
setActiveSnapPointProp: O,
|
|
2184
|
+
drawerRef: _,
|
|
2185
2185
|
fadeFromIndex: h,
|
|
2186
|
-
overlayRef:
|
|
2187
|
-
onSnapPointChange:
|
|
2186
|
+
overlayRef: I,
|
|
2187
|
+
onSnapPointChange: Xn,
|
|
2188
2188
|
direction: y,
|
|
2189
|
-
container:
|
|
2189
|
+
container: U,
|
|
2190
2190
|
snapToSequentialPoint: w
|
|
2191
2191
|
});
|
|
2192
|
-
|
|
2193
|
-
isDisabled: !z ||
|
|
2192
|
+
uo({
|
|
2193
|
+
isDisabled: !z || te || !S || u || !q || !N || !F
|
|
2194
2194
|
});
|
|
2195
|
-
const { restorePositionSetting:
|
|
2195
|
+
const { restorePositionSetting: Qn } = Co({
|
|
2196
2196
|
isOpen: z,
|
|
2197
2197
|
modal: S,
|
|
2198
2198
|
nested: T ?? !1,
|
|
2199
2199
|
hasBeenOpened: q,
|
|
2200
|
-
preventScrollRestoration:
|
|
2200
|
+
preventScrollRestoration: A,
|
|
2201
2201
|
noBodyStyles: P
|
|
2202
2202
|
});
|
|
2203
2203
|
function $e() {
|
|
2204
2204
|
return (window.innerWidth - gt) / window.innerWidth;
|
|
2205
2205
|
}
|
|
2206
|
-
function
|
|
2207
|
-
var
|
|
2208
|
-
!
|
|
2206
|
+
function er(C) {
|
|
2207
|
+
var M, j;
|
|
2208
|
+
!f && !o || _.current && !_.current.contains(C.target) || (Ct.current = ((M = _.current) == null ? void 0 : M.getBoundingClientRect().height) || 0, Tt.current = ((j = _.current) == null ? void 0 : j.getBoundingClientRect().width) || 0, ce(!0), le.current = /* @__PURE__ */ new Date(), jn() && window.addEventListener("touchend", () => ee.current = !1, {
|
|
2209
2209
|
once: !0
|
|
2210
|
-
}),
|
|
2210
|
+
}), C.target.setPointerCapture(C.pointerId), Pe.current = Y(y) ? C.pageY : C.pageX);
|
|
2211
2211
|
}
|
|
2212
|
-
function
|
|
2212
|
+
function Nt(C, M) {
|
|
2213
2213
|
var j;
|
|
2214
|
-
let k =
|
|
2215
|
-
const H = (j = window.getSelection()) == null ? void 0 : j.toString(),
|
|
2214
|
+
let k = C;
|
|
2215
|
+
const H = (j = window.getSelection()) == null ? void 0 : j.toString(), Z = _.current ? ze(_.current, y) : null, J = /* @__PURE__ */ new Date();
|
|
2216
2216
|
if (k.tagName === "SELECT" || k.hasAttribute("data-vaul-no-drag") || k.closest("[data-vaul-no-drag]"))
|
|
2217
2217
|
return !1;
|
|
2218
2218
|
if (y === "right" || y === "left")
|
|
2219
2219
|
return !0;
|
|
2220
|
-
if (
|
|
2220
|
+
if (L.current && J.getTime() - L.current.getTime() < 500)
|
|
2221
2221
|
return !1;
|
|
2222
|
-
if (
|
|
2222
|
+
if (Z !== null && (y === "bottom" ? Z > 0 : Z < 0))
|
|
2223
2223
|
return !0;
|
|
2224
2224
|
if (H && H.length > 0)
|
|
2225
2225
|
return !1;
|
|
2226
|
-
if (
|
|
2227
|
-
return
|
|
2226
|
+
if ($.current && J.getTime() - $.current.getTime() < p && Z === 0 || M)
|
|
2227
|
+
return $.current = J, !1;
|
|
2228
2228
|
for (; k; ) {
|
|
2229
2229
|
if (k.scrollHeight > k.clientHeight) {
|
|
2230
2230
|
if (k.scrollTop !== 0)
|
|
2231
|
-
return
|
|
2231
|
+
return $.current = /* @__PURE__ */ new Date(), !1;
|
|
2232
2232
|
if (k.getAttribute("role") === "dialog")
|
|
2233
2233
|
return !0;
|
|
2234
2234
|
}
|
|
@@ -2236,102 +2236,102 @@ function So({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: a, sn
|
|
|
2236
2236
|
}
|
|
2237
2237
|
return !0;
|
|
2238
2238
|
}
|
|
2239
|
-
function
|
|
2240
|
-
if (
|
|
2241
|
-
const
|
|
2239
|
+
function tr(C) {
|
|
2240
|
+
if (_.current && te) {
|
|
2241
|
+
const M = y === "bottom" || y === "right" ? 1 : -1, j = (Pe.current - (Y(y) ? C.pageY : C.pageX)) * M, k = j > 0, H = o && !f && !k;
|
|
2242
2242
|
if (H && Se === 0) return;
|
|
2243
|
-
const
|
|
2244
|
-
let
|
|
2245
|
-
const ge =
|
|
2246
|
-
if (ge !== null && (
|
|
2247
|
-
if (
|
|
2243
|
+
const Z = Math.abs(j), J = document.querySelector("[data-vaul-drawer-wrapper]"), ue = y === "bottom" || y === "top" ? Ct.current : Tt.current;
|
|
2244
|
+
let ne = Z / ue;
|
|
2245
|
+
const ge = Zn(Z, k);
|
|
2246
|
+
if (ge !== null && (ne = ge), H && ne >= 1 || !ee.current && !Nt(C.target, k)) return;
|
|
2247
|
+
if (_.current.classList.add(dt), ee.current = !0, X(_.current, {
|
|
2248
2248
|
transition: "none"
|
|
2249
|
-
}), X(
|
|
2249
|
+
}), X(I.current, {
|
|
2250
2250
|
transition: "none"
|
|
2251
|
-
}), o &&
|
|
2251
|
+
}), o && Jn({
|
|
2252
2252
|
draggedDistance: j
|
|
2253
2253
|
}), k && !o) {
|
|
2254
|
-
const oe =
|
|
2255
|
-
X(
|
|
2256
|
-
transform:
|
|
2254
|
+
const oe = go(j), Le = Math.min(oe * -1, 0) * M;
|
|
2255
|
+
X(_.current, {
|
|
2256
|
+
transform: Y(y) ? `translate3d(0, ${Le}px, 0)` : `translate3d(${Le}px, 0, 0)`
|
|
2257
2257
|
});
|
|
2258
2258
|
return;
|
|
2259
2259
|
}
|
|
2260
|
-
const de = 1 -
|
|
2261
|
-
if ((
|
|
2260
|
+
const de = 1 - ne;
|
|
2261
|
+
if ((Ot || h && Se === h - 1) && (r == null || r(C, ne), X(I.current, {
|
|
2262
2262
|
opacity: `${de}`,
|
|
2263
2263
|
transition: "none"
|
|
2264
|
-
}, !0)),
|
|
2265
|
-
const oe = Math.min($e() +
|
|
2266
|
-
X(
|
|
2264
|
+
}, !0)), J && I.current && i) {
|
|
2265
|
+
const oe = Math.min($e() + ne * (1 - $e()), 1), Le = 8 - ne * 8, _t = Math.max(0, 14 - ne * 14);
|
|
2266
|
+
X(J, {
|
|
2267
2267
|
borderRadius: `${Le}px`,
|
|
2268
|
-
transform:
|
|
2268
|
+
transform: Y(y) ? `scale(${oe}) translate3d(0, ${_t}px, 0)` : `scale(${oe}) translate3d(${_t}px, 0, 0)`,
|
|
2269
2269
|
transition: "none"
|
|
2270
2270
|
}, !0);
|
|
2271
2271
|
}
|
|
2272
2272
|
if (!o) {
|
|
2273
|
-
const oe =
|
|
2274
|
-
X(
|
|
2275
|
-
transform:
|
|
2273
|
+
const oe = Z * M;
|
|
2274
|
+
X(_.current, {
|
|
2275
|
+
transform: Y(y) ? `translate3d(0, ${oe}px, 0)` : `translate3d(${oe}px, 0, 0)`
|
|
2276
2276
|
});
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
2279
|
}
|
|
2280
|
-
|
|
2280
|
+
b.useEffect(() => {
|
|
2281
2281
|
window.requestAnimationFrame(() => {
|
|
2282
2282
|
Rt.current = !0;
|
|
2283
2283
|
});
|
|
2284
|
-
}, []),
|
|
2285
|
-
var
|
|
2286
|
-
function
|
|
2287
|
-
if (!
|
|
2284
|
+
}, []), b.useEffect(() => {
|
|
2285
|
+
var C;
|
|
2286
|
+
function M() {
|
|
2287
|
+
if (!_.current || !N) return;
|
|
2288
2288
|
const j = document.activeElement;
|
|
2289
2289
|
if (ht(j) || Ee.current) {
|
|
2290
2290
|
var k;
|
|
2291
|
-
const H = ((k = window.visualViewport) == null ? void 0 : k.height) || 0,
|
|
2292
|
-
let
|
|
2293
|
-
const ue =
|
|
2294
|
-
|
|
2295
|
-
const ge =
|
|
2296
|
-
if (Math.abs(
|
|
2297
|
-
const de =
|
|
2298
|
-
|
|
2291
|
+
const H = ((k = window.visualViewport) == null ? void 0 : k.height) || 0, Z = window.innerHeight;
|
|
2292
|
+
let J = Z - H;
|
|
2293
|
+
const ue = _.current.getBoundingClientRect().height || 0, ne = ue > Z * 0.8;
|
|
2294
|
+
Qe.current || (Qe.current = ue);
|
|
2295
|
+
const ge = _.current.getBoundingClientRect().top;
|
|
2296
|
+
if (Math.abs(xt.current - J) > 60 && (Ee.current = !Ee.current), o && o.length > 0 && Oe && Se) {
|
|
2297
|
+
const de = Oe[Se] || 0;
|
|
2298
|
+
J += de;
|
|
2299
2299
|
}
|
|
2300
|
-
if (
|
|
2301
|
-
const de =
|
|
2300
|
+
if (xt.current = J, ue > H || Ee.current) {
|
|
2301
|
+
const de = _.current.getBoundingClientRect().height;
|
|
2302
2302
|
let oe = de;
|
|
2303
|
-
de > H && (oe = H - (
|
|
2304
|
-
} else
|
|
2305
|
-
o && o.length > 0 && !Ee.current ?
|
|
2303
|
+
de > H && (oe = H - (ne ? ge : gt)), m ? _.current.style.height = `${de - Math.max(J, 0)}px` : _.current.style.height = `${Math.max(oe, H - ge)}px`;
|
|
2304
|
+
} else ro() || (_.current.style.height = `${Qe.current}px`);
|
|
2305
|
+
o && o.length > 0 && !Ee.current ? _.current.style.bottom = "0px" : _.current.style.bottom = `${Math.max(J, 0)}px`;
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
|
-
return (
|
|
2308
|
+
return (C = window.visualViewport) == null || C.addEventListener("resize", M), () => {
|
|
2309
2309
|
var j;
|
|
2310
|
-
return (j = window.visualViewport) == null ? void 0 : j.removeEventListener("resize",
|
|
2310
|
+
return (j = window.visualViewport) == null ? void 0 : j.removeEventListener("resize", M);
|
|
2311
2311
|
};
|
|
2312
2312
|
}, [
|
|
2313
2313
|
Se,
|
|
2314
2314
|
o,
|
|
2315
|
-
|
|
2315
|
+
Oe
|
|
2316
2316
|
]);
|
|
2317
|
-
function
|
|
2318
|
-
|
|
2317
|
+
function Ne(C) {
|
|
2318
|
+
nr(), g == null || g(), C || K(!1), setTimeout(() => {
|
|
2319
2319
|
o && Pt(o[0]);
|
|
2320
|
-
},
|
|
2320
|
+
}, B.DURATION * 1e3);
|
|
2321
2321
|
}
|
|
2322
2322
|
function Dt() {
|
|
2323
|
-
if (!
|
|
2324
|
-
const
|
|
2325
|
-
X(
|
|
2323
|
+
if (!_.current) return;
|
|
2324
|
+
const C = document.querySelector("[data-vaul-drawer-wrapper]"), M = ze(_.current, y);
|
|
2325
|
+
X(_.current, {
|
|
2326
2326
|
transform: "translate3d(0, 0, 0)",
|
|
2327
|
-
transition: `transform ${
|
|
2328
|
-
}), X(
|
|
2329
|
-
transition: `opacity ${
|
|
2327
|
+
transition: `transform ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`
|
|
2328
|
+
}), X(I.current, {
|
|
2329
|
+
transition: `opacity ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
2330
2330
|
opacity: "1"
|
|
2331
|
-
}), i &&
|
|
2332
|
-
borderRadius: `${
|
|
2331
|
+
}), i && M && M > 0 && z && X(C, {
|
|
2332
|
+
borderRadius: `${Un}px`,
|
|
2333
2333
|
overflow: "hidden",
|
|
2334
|
-
...
|
|
2334
|
+
...Y(y) ? {
|
|
2335
2335
|
transform: `scale(${$e()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
2336
2336
|
transformOrigin: "top"
|
|
2337
2337
|
} : {
|
|
@@ -2339,317 +2339,319 @@ function So({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: a, sn
|
|
|
2339
2339
|
transformOrigin: "left"
|
|
2340
2340
|
},
|
|
2341
2341
|
transitionProperty: "transform, border-radius",
|
|
2342
|
-
transitionDuration: `${
|
|
2343
|
-
transitionTimingFunction: `cubic-bezier(${
|
|
2342
|
+
transitionDuration: `${B.DURATION}s`,
|
|
2343
|
+
transitionTimingFunction: `cubic-bezier(${B.EASE.join(",")})`
|
|
2344
2344
|
}, !0);
|
|
2345
2345
|
}
|
|
2346
|
-
function
|
|
2347
|
-
!
|
|
2346
|
+
function nr() {
|
|
2347
|
+
!te || !_.current || (_.current.classList.remove(dt), ee.current = !1, ce(!1), ve.current = /* @__PURE__ */ new Date());
|
|
2348
2348
|
}
|
|
2349
|
-
function
|
|
2350
|
-
if (!
|
|
2351
|
-
|
|
2352
|
-
const
|
|
2353
|
-
if (!
|
|
2354
|
-
const j = ve.current.getTime() - le.current.getTime(), k = Pe.current - (
|
|
2349
|
+
function rr(C) {
|
|
2350
|
+
if (!te || !_.current) return;
|
|
2351
|
+
_.current.classList.remove(dt), ee.current = !1, ce(!1), ve.current = /* @__PURE__ */ new Date();
|
|
2352
|
+
const M = ze(_.current, y);
|
|
2353
|
+
if (!C || !Nt(C.target, !1) || !M || Number.isNaN(M) || le.current === null) return;
|
|
2354
|
+
const j = ve.current.getTime() - le.current.getTime(), k = Pe.current - (Y(y) ? C.pageY : C.pageX), H = Math.abs(k) / j;
|
|
2355
2355
|
if (H > 0.05 && (D(!0), setTimeout(() => {
|
|
2356
2356
|
D(!1);
|
|
2357
2357
|
}, 200)), o) {
|
|
2358
|
-
|
|
2358
|
+
Kn({
|
|
2359
2359
|
draggedDistance: k * (y === "bottom" || y === "right" ? 1 : -1),
|
|
2360
|
-
closeDrawer:
|
|
2360
|
+
closeDrawer: Ne,
|
|
2361
2361
|
velocity: H,
|
|
2362
|
-
dismissible:
|
|
2363
|
-
}), a == null || a(
|
|
2362
|
+
dismissible: f
|
|
2363
|
+
}), a == null || a(C, !0);
|
|
2364
2364
|
return;
|
|
2365
2365
|
}
|
|
2366
2366
|
if (y === "bottom" || y === "right" ? k > 0 : k < 0) {
|
|
2367
|
-
Dt(), a == null || a(
|
|
2367
|
+
Dt(), a == null || a(C, !0);
|
|
2368
2368
|
return;
|
|
2369
2369
|
}
|
|
2370
|
-
if (H >
|
|
2371
|
-
|
|
2370
|
+
if (H > Wn) {
|
|
2371
|
+
Ne(), a == null || a(C, !1);
|
|
2372
2372
|
return;
|
|
2373
2373
|
}
|
|
2374
|
-
var
|
|
2375
|
-
const
|
|
2374
|
+
var Z;
|
|
2375
|
+
const J = Math.min((Z = _.current.getBoundingClientRect().height) != null ? Z : 0, window.innerHeight);
|
|
2376
2376
|
var ue;
|
|
2377
|
-
const
|
|
2378
|
-
if (Math.abs(
|
|
2379
|
-
|
|
2377
|
+
const ne = Math.min((ue = _.current.getBoundingClientRect().width) != null ? ue : 0, window.innerWidth), ge = y === "left" || y === "right";
|
|
2378
|
+
if (Math.abs(M) >= (ge ? ne : J) * v) {
|
|
2379
|
+
Ne(), a == null || a(C, !1);
|
|
2380
2380
|
return;
|
|
2381
2381
|
}
|
|
2382
|
-
a == null || a(
|
|
2382
|
+
a == null || a(C, !0), Dt();
|
|
2383
2383
|
}
|
|
2384
|
-
|
|
2384
|
+
b.useEffect(() => (z && (X(document.documentElement, {
|
|
2385
2385
|
scrollBehavior: "auto"
|
|
2386
|
-
}),
|
|
2387
|
-
|
|
2386
|
+
}), L.current = /* @__PURE__ */ new Date()), () => {
|
|
2387
|
+
ho(document.documentElement, "scrollBehavior");
|
|
2388
2388
|
}), [
|
|
2389
2389
|
z
|
|
2390
2390
|
]);
|
|
2391
|
-
function
|
|
2392
|
-
const
|
|
2393
|
-
he.current && window.clearTimeout(he.current), X(
|
|
2394
|
-
transition: `transform ${
|
|
2395
|
-
transform:
|
|
2396
|
-
}), !
|
|
2397
|
-
const k = ze(
|
|
2398
|
-
X(
|
|
2391
|
+
function ar(C) {
|
|
2392
|
+
const M = C ? (window.innerWidth - we) / window.innerWidth : 1, j = C ? -we : 0;
|
|
2393
|
+
he.current && window.clearTimeout(he.current), X(_.current, {
|
|
2394
|
+
transition: `transform ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
2395
|
+
transform: Y(y) ? `scale(${M}) translate3d(0, ${j}px, 0)` : `scale(${M}) translate3d(${j}px, 0, 0)`
|
|
2396
|
+
}), !C && _.current && (he.current = setTimeout(() => {
|
|
2397
|
+
const k = ze(_.current, y);
|
|
2398
|
+
X(_.current, {
|
|
2399
2399
|
transition: "none",
|
|
2400
|
-
transform:
|
|
2400
|
+
transform: Y(y) ? `translate3d(0, ${k}px, 0)` : `translate3d(${k}px, 0, 0)`
|
|
2401
2401
|
});
|
|
2402
2402
|
}, 500));
|
|
2403
2403
|
}
|
|
2404
|
-
function
|
|
2405
|
-
if (
|
|
2406
|
-
const j = (window.innerWidth - we) / window.innerWidth, k = j +
|
|
2407
|
-
X(
|
|
2408
|
-
transform:
|
|
2404
|
+
function or(C, M) {
|
|
2405
|
+
if (M < 0) return;
|
|
2406
|
+
const j = (window.innerWidth - we) / window.innerWidth, k = j + M * (1 - j), H = -we + M * we;
|
|
2407
|
+
X(_.current, {
|
|
2408
|
+
transform: Y(y) ? `scale(${k}) translate3d(0, ${H}px, 0)` : `scale(${k}) translate3d(${H}px, 0, 0)`,
|
|
2409
2409
|
transition: "none"
|
|
2410
2410
|
});
|
|
2411
2411
|
}
|
|
2412
|
-
function
|
|
2413
|
-
const j =
|
|
2414
|
-
|
|
2415
|
-
transition: `transform ${
|
|
2416
|
-
transform:
|
|
2412
|
+
function sr(C, M) {
|
|
2413
|
+
const j = Y(y) ? window.innerHeight : window.innerWidth, k = M ? (j - we) / j : 1, H = M ? -we : 0;
|
|
2414
|
+
M && X(_.current, {
|
|
2415
|
+
transition: `transform ${B.DURATION}s cubic-bezier(${B.EASE.join(",")})`,
|
|
2416
|
+
transform: Y(y) ? `scale(${k}) translate3d(0, ${H}px, 0)` : `scale(${k}) translate3d(${H}px, 0, 0)`
|
|
2417
2417
|
});
|
|
2418
2418
|
}
|
|
2419
|
-
return
|
|
2419
|
+
return b.useEffect(() => {
|
|
2420
2420
|
S || window.requestAnimationFrame(() => {
|
|
2421
2421
|
document.body.style.pointerEvents = "auto";
|
|
2422
2422
|
});
|
|
2423
2423
|
}, [
|
|
2424
2424
|
S
|
|
2425
|
-
]), /* @__PURE__ */
|
|
2426
|
-
defaultOpen:
|
|
2427
|
-
onOpenChange: (
|
|
2428
|
-
!
|
|
2425
|
+
]), /* @__PURE__ */ b.createElement(Ga, {
|
|
2426
|
+
defaultOpen: E,
|
|
2427
|
+
onOpenChange: (C) => {
|
|
2428
|
+
!f && !C || (C ? Q(!0) : Ne(!0), K(C));
|
|
2429
2429
|
},
|
|
2430
2430
|
open: z
|
|
2431
|
-
}, /* @__PURE__ */
|
|
2431
|
+
}, /* @__PURE__ */ b.createElement(Mn.Provider, {
|
|
2432
2432
|
value: {
|
|
2433
|
-
activeSnapPoint:
|
|
2433
|
+
activeSnapPoint: Gn,
|
|
2434
2434
|
snapPoints: o,
|
|
2435
2435
|
setActiveSnapPoint: Pt,
|
|
2436
|
-
drawerRef:
|
|
2437
|
-
overlayRef:
|
|
2436
|
+
drawerRef: _,
|
|
2437
|
+
overlayRef: I,
|
|
2438
2438
|
onOpenChange: t,
|
|
2439
|
-
onPress:
|
|
2440
|
-
onRelease:
|
|
2441
|
-
onDrag:
|
|
2442
|
-
dismissible:
|
|
2439
|
+
onPress: er,
|
|
2440
|
+
onRelease: rr,
|
|
2441
|
+
onDrag: tr,
|
|
2442
|
+
dismissible: f,
|
|
2443
2443
|
shouldAnimate: Rt,
|
|
2444
|
-
handleOnly:
|
|
2444
|
+
handleOnly: l,
|
|
2445
2445
|
isOpen: z,
|
|
2446
|
-
isDragging:
|
|
2447
|
-
shouldFade:
|
|
2448
|
-
closeDrawer:
|
|
2449
|
-
onNestedDrag:
|
|
2450
|
-
onNestedOpenChange:
|
|
2451
|
-
onNestedRelease:
|
|
2446
|
+
isDragging: te,
|
|
2447
|
+
shouldFade: Ot,
|
|
2448
|
+
closeDrawer: Ne,
|
|
2449
|
+
onNestedDrag: or,
|
|
2450
|
+
onNestedOpenChange: ar,
|
|
2451
|
+
onNestedRelease: sr,
|
|
2452
2452
|
keyboardIsOpen: Ee,
|
|
2453
2453
|
modal: S,
|
|
2454
|
-
snapPointsOffset:
|
|
2454
|
+
snapPointsOffset: Oe,
|
|
2455
2455
|
activeSnapPointIndex: Se,
|
|
2456
2456
|
direction: y,
|
|
2457
2457
|
shouldScaleBackground: i,
|
|
2458
2458
|
setBackgroundColorOnScale: s,
|
|
2459
2459
|
noBodyStyles: P,
|
|
2460
|
-
container:
|
|
2461
|
-
autoFocus:
|
|
2460
|
+
container: U,
|
|
2461
|
+
autoFocus: V
|
|
2462
2462
|
}
|
|
2463
2463
|
}, n));
|
|
2464
2464
|
}
|
|
2465
|
-
const
|
|
2466
|
-
const { overlayRef: n, snapPoints: r, onRelease: a, shouldFade: o, isOpen: i, modal: s, shouldAnimate: v } = je(),
|
|
2465
|
+
const Yn = /* @__PURE__ */ b.forwardRef(function({ ...e }, t) {
|
|
2466
|
+
const { overlayRef: n, snapPoints: r, onRelease: a, shouldFade: o, isOpen: i, modal: s, shouldAnimate: v } = je(), p = Ln(t, n), f = r && r.length > 0;
|
|
2467
2467
|
if (!s)
|
|
2468
2468
|
return null;
|
|
2469
|
-
const
|
|
2469
|
+
const l = b.useCallback((h) => a(h), [
|
|
2470
2470
|
a
|
|
2471
2471
|
]);
|
|
2472
|
-
return /* @__PURE__ */
|
|
2473
|
-
onMouseUp:
|
|
2474
|
-
ref:
|
|
2472
|
+
return /* @__PURE__ */ b.createElement(Za, {
|
|
2473
|
+
onMouseUp: l,
|
|
2474
|
+
ref: p,
|
|
2475
2475
|
"data-vaul-overlay": "",
|
|
2476
|
-
"data-vaul-snap-points": i &&
|
|
2476
|
+
"data-vaul-snap-points": i && f ? "true" : "false",
|
|
2477
2477
|
"data-vaul-snap-points-overlay": i && o ? "true" : "false",
|
|
2478
2478
|
"data-vaul-animate": v != null && v.current ? "true" : "false",
|
|
2479
2479
|
...e
|
|
2480
2480
|
});
|
|
2481
2481
|
});
|
|
2482
|
-
|
|
2483
|
-
const
|
|
2484
|
-
const { drawerRef: o, onPress: i, onRelease: s, onDrag: v, keyboardIsOpen:
|
|
2485
|
-
|
|
2486
|
-
const
|
|
2487
|
-
if (
|
|
2488
|
-
const
|
|
2482
|
+
Yn.displayName = "Drawer.Overlay";
|
|
2483
|
+
const Vn = /* @__PURE__ */ b.forwardRef(function({ onPointerDownOutside: e, style: t, onOpenAutoFocus: n, ...r }, a) {
|
|
2484
|
+
const { drawerRef: o, onPress: i, onRelease: s, onDrag: v, keyboardIsOpen: p, snapPointsOffset: f, activeSnapPointIndex: l, modal: h, isOpen: R, direction: O, snapPoints: m, container: S, handleOnly: g, shouldAnimate: T, autoFocus: P } = je(), [y, E] = b.useState(!1), F = Ln(a, o), w = b.useRef(null), A = b.useRef(null), N = b.useRef(!1), W = m && m.length > 0;
|
|
2485
|
+
xo();
|
|
2486
|
+
const U = (x, G, z = 0) => {
|
|
2487
|
+
if (N.current) return !0;
|
|
2488
|
+
const K = Math.abs(x.y), q = Math.abs(x.x), Q = q > K, te = [
|
|
2489
2489
|
"bottom",
|
|
2490
2490
|
"right"
|
|
2491
|
-
].includes(
|
|
2492
|
-
if (
|
|
2493
|
-
if (!(
|
|
2494
|
-
return
|
|
2495
|
-
} else if (!(
|
|
2496
|
-
return !
|
|
2497
|
-
return
|
|
2491
|
+
].includes(G) ? 1 : -1;
|
|
2492
|
+
if (G === "left" || G === "right") {
|
|
2493
|
+
if (!(x.x * te < 0) && q >= 0 && q <= z)
|
|
2494
|
+
return Q;
|
|
2495
|
+
} else if (!(x.y * te < 0) && K >= 0 && K <= z)
|
|
2496
|
+
return !Q;
|
|
2497
|
+
return N.current = !0, !0;
|
|
2498
2498
|
};
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2499
|
+
b.useEffect(() => {
|
|
2500
|
+
W && window.requestAnimationFrame(() => {
|
|
2501
|
+
E(!0);
|
|
2502
2502
|
});
|
|
2503
2503
|
}, []);
|
|
2504
|
-
function
|
|
2505
|
-
w.current = null,
|
|
2504
|
+
function V(x) {
|
|
2505
|
+
w.current = null, N.current = !1, s(x);
|
|
2506
2506
|
}
|
|
2507
|
-
return /* @__PURE__ */
|
|
2508
|
-
"data-vaul-drawer-direction":
|
|
2507
|
+
return /* @__PURE__ */ b.createElement(Qa, {
|
|
2508
|
+
"data-vaul-drawer-direction": O,
|
|
2509
2509
|
"data-vaul-drawer": "",
|
|
2510
2510
|
"data-vaul-delayed-snap-points": y ? "true" : "false",
|
|
2511
|
-
"data-vaul-snap-points": R &&
|
|
2511
|
+
"data-vaul-snap-points": R && W ? "true" : "false",
|
|
2512
2512
|
"data-vaul-custom-container": S ? "true" : "false",
|
|
2513
2513
|
"data-vaul-animate": T != null && T.current ? "true" : "false",
|
|
2514
2514
|
...r,
|
|
2515
2515
|
ref: F,
|
|
2516
|
-
style:
|
|
2517
|
-
"--snap-point-height": `${
|
|
2516
|
+
style: f && f.length > 0 ? {
|
|
2517
|
+
"--snap-point-height": `${f[l ?? 0]}px`,
|
|
2518
2518
|
...t
|
|
2519
2519
|
} : t,
|
|
2520
|
-
onPointerDown: (
|
|
2521
|
-
g || (r.onPointerDown == null || r.onPointerDown.call(r,
|
|
2522
|
-
x:
|
|
2523
|
-
y:
|
|
2524
|
-
}, i(
|
|
2520
|
+
onPointerDown: (x) => {
|
|
2521
|
+
g || (r.onPointerDown == null || r.onPointerDown.call(r, x), w.current = {
|
|
2522
|
+
x: x.pageX,
|
|
2523
|
+
y: x.pageY
|
|
2524
|
+
}, i(x));
|
|
2525
2525
|
},
|
|
2526
|
-
onOpenAutoFocus: (
|
|
2527
|
-
n == null || n(
|
|
2526
|
+
onOpenAutoFocus: (x) => {
|
|
2527
|
+
n == null || n(x), P || x.preventDefault();
|
|
2528
2528
|
},
|
|
2529
|
-
onPointerDownOutside: (
|
|
2530
|
-
if (e == null || e(
|
|
2531
|
-
|
|
2529
|
+
onPointerDownOutside: (x) => {
|
|
2530
|
+
if (e == null || e(x), !h || x.defaultPrevented) {
|
|
2531
|
+
x.preventDefault();
|
|
2532
2532
|
return;
|
|
2533
2533
|
}
|
|
2534
|
-
|
|
2534
|
+
p.current && (p.current = !1);
|
|
2535
2535
|
},
|
|
2536
|
-
onFocusOutside: (
|
|
2536
|
+
onFocusOutside: (x) => {
|
|
2537
2537
|
if (!h) {
|
|
2538
|
-
|
|
2538
|
+
x.preventDefault();
|
|
2539
2539
|
return;
|
|
2540
2540
|
}
|
|
2541
2541
|
},
|
|
2542
|
-
onPointerMove: (
|
|
2543
|
-
if (
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2542
|
+
onPointerMove: (x) => {
|
|
2543
|
+
if (A.current = x, g || (r.onPointerMove == null || r.onPointerMove.call(r, x), !w.current)) return;
|
|
2544
|
+
const G = x.pageY - w.current.y, z = x.pageX - w.current.x, K = x.pointerType === "touch" ? 10 : 2;
|
|
2545
|
+
U({
|
|
2546
2546
|
x: z,
|
|
2547
|
-
y:
|
|
2548
|
-
},
|
|
2547
|
+
y: G
|
|
2548
|
+
}, O, K) ? v(x) : (Math.abs(z) > K || Math.abs(G) > K) && (w.current = null);
|
|
2549
2549
|
},
|
|
2550
|
-
onPointerUp: (
|
|
2551
|
-
r.onPointerUp == null || r.onPointerUp.call(r,
|
|
2550
|
+
onPointerUp: (x) => {
|
|
2551
|
+
r.onPointerUp == null || r.onPointerUp.call(r, x), w.current = null, N.current = !1, s(x);
|
|
2552
2552
|
},
|
|
2553
|
-
onPointerOut: (
|
|
2554
|
-
r.onPointerOut == null || r.onPointerOut.call(r,
|
|
2553
|
+
onPointerOut: (x) => {
|
|
2554
|
+
r.onPointerOut == null || r.onPointerOut.call(r, x), V(A.current);
|
|
2555
2555
|
},
|
|
2556
|
-
onContextMenu: (
|
|
2557
|
-
r.onContextMenu == null || r.onContextMenu.call(r,
|
|
2556
|
+
onContextMenu: (x) => {
|
|
2557
|
+
r.onContextMenu == null || r.onContextMenu.call(r, x), A.current && V(A.current);
|
|
2558
2558
|
}
|
|
2559
2559
|
});
|
|
2560
2560
|
});
|
|
2561
|
-
|
|
2562
|
-
const
|
|
2563
|
-
const { closeDrawer: a, isDragging: o, snapPoints: i, activeSnapPoint: s, setActiveSnapPoint: v, dismissible:
|
|
2561
|
+
Vn.displayName = "Drawer.Content";
|
|
2562
|
+
const Po = 250, Oo = 120, zn = /* @__PURE__ */ b.forwardRef(function({ preventCycle: e = !1, children: t, ...n }, r) {
|
|
2563
|
+
const { closeDrawer: a, isDragging: o, snapPoints: i, activeSnapPoint: s, setActiveSnapPoint: v, dismissible: p, handleOnly: f, isOpen: l, onPress: h, onDrag: R } = je(), O = b.useRef(null), m = b.useRef(!1);
|
|
2564
2564
|
function S() {
|
|
2565
|
-
if (
|
|
2565
|
+
if (m.current) {
|
|
2566
2566
|
P();
|
|
2567
2567
|
return;
|
|
2568
2568
|
}
|
|
2569
2569
|
window.setTimeout(() => {
|
|
2570
2570
|
g();
|
|
2571
|
-
},
|
|
2571
|
+
}, Oo);
|
|
2572
2572
|
}
|
|
2573
2573
|
function g() {
|
|
2574
|
-
if (o || e ||
|
|
2574
|
+
if (o || e || m.current) {
|
|
2575
2575
|
P();
|
|
2576
2576
|
return;
|
|
2577
2577
|
}
|
|
2578
2578
|
if (P(), !i || i.length === 0) {
|
|
2579
|
-
|
|
2579
|
+
p || a();
|
|
2580
2580
|
return;
|
|
2581
2581
|
}
|
|
2582
|
-
if (s === i[i.length - 1] &&
|
|
2582
|
+
if (s === i[i.length - 1] && p) {
|
|
2583
2583
|
a();
|
|
2584
2584
|
return;
|
|
2585
2585
|
}
|
|
2586
|
-
const
|
|
2587
|
-
if (
|
|
2588
|
-
const F = i[
|
|
2586
|
+
const E = i.findIndex((w) => w === s);
|
|
2587
|
+
if (E === -1) return;
|
|
2588
|
+
const F = i[E + 1];
|
|
2589
2589
|
v(F);
|
|
2590
2590
|
}
|
|
2591
2591
|
function T() {
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
},
|
|
2592
|
+
O.current = window.setTimeout(() => {
|
|
2593
|
+
m.current = !0;
|
|
2594
|
+
}, Po);
|
|
2595
2595
|
}
|
|
2596
2596
|
function P() {
|
|
2597
|
-
|
|
2597
|
+
O.current && window.clearTimeout(O.current), m.current = !1;
|
|
2598
2598
|
}
|
|
2599
|
-
return /* @__PURE__ */
|
|
2599
|
+
return /* @__PURE__ */ b.createElement("div", {
|
|
2600
2600
|
onClick: S,
|
|
2601
2601
|
onPointerCancel: P,
|
|
2602
2602
|
onPointerDown: (y) => {
|
|
2603
|
-
|
|
2603
|
+
f && h(y), T();
|
|
2604
2604
|
},
|
|
2605
2605
|
onPointerMove: (y) => {
|
|
2606
|
-
|
|
2606
|
+
f && R(y);
|
|
2607
2607
|
},
|
|
2608
2608
|
// onPointerUp is already handled by the content component
|
|
2609
2609
|
ref: r,
|
|
2610
|
-
"data-vaul-drawer-visible":
|
|
2610
|
+
"data-vaul-drawer-visible": l ? "true" : "false",
|
|
2611
2611
|
"data-vaul-handle": "",
|
|
2612
2612
|
"aria-hidden": "true",
|
|
2613
2613
|
...n
|
|
2614
|
-
}, /* @__PURE__ */
|
|
2614
|
+
}, /* @__PURE__ */ b.createElement("span", {
|
|
2615
2615
|
"data-vaul-handle-hitarea": "",
|
|
2616
2616
|
"aria-hidden": "true"
|
|
2617
2617
|
}, t));
|
|
2618
2618
|
});
|
|
2619
|
-
|
|
2620
|
-
function
|
|
2619
|
+
zn.displayName = "Drawer.Handle";
|
|
2620
|
+
function No(e) {
|
|
2621
2621
|
const t = je(), { container: n = t.container, ...r } = e;
|
|
2622
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ b.createElement(Ja, {
|
|
2623
2623
|
container: n,
|
|
2624
2624
|
...r
|
|
2625
2625
|
});
|
|
2626
2626
|
}
|
|
2627
2627
|
const fe = {
|
|
2628
|
-
Root:
|
|
2629
|
-
Content:
|
|
2630
|
-
Overlay:
|
|
2631
|
-
Trigger:
|
|
2632
|
-
Portal:
|
|
2633
|
-
Handle:
|
|
2634
|
-
Close:
|
|
2635
|
-
Title:
|
|
2636
|
-
};
|
|
2637
|
-
function
|
|
2628
|
+
Root: To,
|
|
2629
|
+
Content: Vn,
|
|
2630
|
+
Overlay: Yn,
|
|
2631
|
+
Trigger: Ka,
|
|
2632
|
+
Portal: No,
|
|
2633
|
+
Handle: zn,
|
|
2634
|
+
Close: to,
|
|
2635
|
+
Title: eo
|
|
2636
|
+
}, Zt = [];
|
|
2637
|
+
function ft(e, t) {
|
|
2638
2638
|
e.resetHandlers(), t.endpoints.forEach((n) => {
|
|
2639
2639
|
var a;
|
|
2640
2640
|
const r = (a = t.handlers[n.id]) == null ? void 0 : a[n.selectedScenario];
|
|
2641
2641
|
r && e.use(r());
|
|
2642
2642
|
});
|
|
2643
2643
|
}
|
|
2644
|
-
const
|
|
2644
|
+
const re = mr((e, t) => ({
|
|
2645
2645
|
pages: {},
|
|
2646
2646
|
currentPageId: null,
|
|
2647
|
-
expandedIds:
|
|
2647
|
+
expandedIds: {},
|
|
2648
2648
|
globalPreset: null,
|
|
2649
2649
|
pendingChanges: !1,
|
|
2650
2650
|
mockEnabled: !0,
|
|
2651
2651
|
_worker: null,
|
|
2652
|
-
_setWorker: (n) =>
|
|
2652
|
+
_setWorker: (n) => {
|
|
2653
|
+
t()._worker !== n && e({ _worker: n });
|
|
2654
|
+
},
|
|
2653
2655
|
registerPage: (n) => {
|
|
2654
2656
|
e((r) => {
|
|
2655
2657
|
const a = r.pages[n.pageId], o = a ? n.endpoints.map((i) => {
|
|
@@ -2671,19 +2673,22 @@ const G = lr((e, t) => ({
|
|
|
2671
2673
|
});
|
|
2672
2674
|
},
|
|
2673
2675
|
setCurrentPage: (n) => {
|
|
2674
|
-
|
|
2676
|
+
var v;
|
|
2677
|
+
const { pages: r, mockEnabled: a, _worker: o } = t(), i = r[n], s = (v = i == null ? void 0 : i.endpoints[0]) == null ? void 0 : v.id;
|
|
2675
2678
|
e({
|
|
2676
2679
|
currentPageId: n,
|
|
2677
|
-
expandedIds:
|
|
2680
|
+
expandedIds: s ? { [s]: !0 } : {},
|
|
2678
2681
|
globalPreset: null,
|
|
2679
2682
|
pendingChanges: !1
|
|
2680
|
-
}), a && i && o &&
|
|
2683
|
+
}), a && i && o && ft(o, i);
|
|
2681
2684
|
},
|
|
2682
2685
|
toggleEndpoint: (n) => {
|
|
2683
|
-
e((r) => {
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2686
|
+
e((r) => ({
|
|
2687
|
+
expandedIds: {
|
|
2688
|
+
...r.expandedIds,
|
|
2689
|
+
[n]: !r.expandedIds[n]
|
|
2690
|
+
}
|
|
2691
|
+
}));
|
|
2687
2692
|
},
|
|
2688
2693
|
selectScenario: (n, r) => {
|
|
2689
2694
|
const { currentPageId: a } = t();
|
|
@@ -2731,7 +2736,7 @@ const G = lr((e, t) => ({
|
|
|
2731
2736
|
const { currentPageId: n, pages: r, mockEnabled: a, _worker: o } = t();
|
|
2732
2737
|
if (!n || !a || !o) return;
|
|
2733
2738
|
const i = r[n];
|
|
2734
|
-
i &&
|
|
2739
|
+
i && ft(o, i), e({ pendingChanges: !1 });
|
|
2735
2740
|
},
|
|
2736
2741
|
resetCurrentPage: () => {
|
|
2737
2742
|
const { currentPageId: n, pages: r, _worker: a } = t();
|
|
@@ -2762,41 +2767,41 @@ const G = lr((e, t) => ({
|
|
|
2762
2767
|
serviceWorker: { url: "/mockServiceWorker.js" }
|
|
2763
2768
|
});
|
|
2764
2769
|
const i = r ? a[r] : null;
|
|
2765
|
-
i &&
|
|
2770
|
+
i && ft(o, i), e({ mockEnabled: !0 });
|
|
2766
2771
|
}
|
|
2767
2772
|
}
|
|
2768
|
-
})),
|
|
2773
|
+
})), qn = (e) => {
|
|
2769
2774
|
var t;
|
|
2770
|
-
return e.currentPageId ? ((t = e.pages[e.currentPageId]) == null ? void 0 : t.endpoints) ??
|
|
2771
|
-
},
|
|
2775
|
+
return e.currentPageId ? ((t = e.pages[e.currentPageId]) == null ? void 0 : t.endpoints) ?? Zt : Zt;
|
|
2776
|
+
}, Do = (e) => {
|
|
2772
2777
|
if (!e.mockEnabled) return "off";
|
|
2773
|
-
const t =
|
|
2778
|
+
const t = qn(e);
|
|
2774
2779
|
return t.some(
|
|
2775
2780
|
(n) => ["error", "not_found", "forbidden", "network_error"].includes(
|
|
2776
2781
|
n.selectedScenario
|
|
2777
2782
|
)
|
|
2778
2783
|
) ? "error" : t.some((n) => n.selectedScenario === "loading") ? "warn" : "ok";
|
|
2779
2784
|
};
|
|
2780
|
-
function
|
|
2785
|
+
function _o(e) {
|
|
2781
2786
|
return e.scenario === "loading" ? "// pending..." : e.scenario === "network_error" ? "// network error" : e.payload ? JSON.stringify(e.payload, null, 2) : "{}";
|
|
2782
2787
|
}
|
|
2783
|
-
function
|
|
2788
|
+
function Ao(e) {
|
|
2784
2789
|
return e ? e < 300 ? "mswd-sc-badge mswd-sc-badge--2xx" : e < 500 ? "mswd-sc-badge mswd-sc-badge--4xx" : "mswd-sc-badge mswd-sc-badge--5xx" : "mswd-sc-badge mswd-sc-badge--err";
|
|
2785
2790
|
}
|
|
2786
|
-
function
|
|
2791
|
+
function ko(e, t) {
|
|
2787
2792
|
return t ? e === "loading" ? "mswd-radio mswd-radio--loading" : `mswd-radio ${["error", "not_found", "forbidden", "network_error"].includes(
|
|
2788
2793
|
e
|
|
2789
2794
|
) ? "mswd-radio--error" : "mswd-radio--success"}` : "mswd-radio";
|
|
2790
2795
|
}
|
|
2791
|
-
function
|
|
2796
|
+
function Io(e) {
|
|
2792
2797
|
return e === "loading" ? "mswd-radio-dot mswd-radio-dot--loading" : `mswd-radio-dot ${["error", "not_found", "forbidden", "network_error"].includes(
|
|
2793
2798
|
e
|
|
2794
2799
|
) ? "mswd-radio-dot--error" : "mswd-radio-dot--success"}`;
|
|
2795
2800
|
}
|
|
2796
|
-
function
|
|
2801
|
+
function Mo(e) {
|
|
2797
2802
|
return e === "success" ? "mswd-ep-status mswd-ep-status--success" : e === "loading" ? "mswd-ep-status mswd-ep-status--loading" : "mswd-ep-status mswd-ep-status--error";
|
|
2798
2803
|
}
|
|
2799
|
-
function
|
|
2804
|
+
function jo({
|
|
2800
2805
|
endpoint: e,
|
|
2801
2806
|
expanded: t,
|
|
2802
2807
|
onToggle: n,
|
|
@@ -2807,7 +2812,7 @@ function _o({
|
|
|
2807
2812
|
/* @__PURE__ */ d.jsxs("button", { className: "mswd-ep-header", onClick: n, children: [
|
|
2808
2813
|
/* @__PURE__ */ d.jsx("span", { className: `mswd-method mswd-method--${e.method}`, children: e.method }),
|
|
2809
2814
|
/* @__PURE__ */ d.jsx("span", { className: "mswd-ep-path", children: e.path }),
|
|
2810
|
-
/* @__PURE__ */ d.jsx("span", { className:
|
|
2815
|
+
/* @__PURE__ */ d.jsx("span", { className: Mo(e.selectedScenario), children: (a == null ? void 0 : a.statusCode) ?? (e.selectedScenario === "loading" ? "โฆ" : "ERR") }),
|
|
2811
2816
|
/* @__PURE__ */ d.jsx(
|
|
2812
2817
|
"span",
|
|
2813
2818
|
{
|
|
@@ -2827,12 +2832,12 @@ function _o({
|
|
|
2827
2832
|
className: `mswd-option ${s ? "mswd-option--selected" : ""}`,
|
|
2828
2833
|
onClick: () => r(o.scenario),
|
|
2829
2834
|
children: [
|
|
2830
|
-
/* @__PURE__ */ d.jsx("div", { className:
|
|
2835
|
+
/* @__PURE__ */ d.jsx("div", { className: ko(o.scenario, s), children: s && /* @__PURE__ */ d.jsx("div", { className: Io(o.scenario) }) }),
|
|
2831
2836
|
/* @__PURE__ */ d.jsxs("div", { className: "mswd-opt-info", children: [
|
|
2832
2837
|
/* @__PURE__ */ d.jsx("p", { className: "mswd-opt-label", children: o.label }),
|
|
2833
2838
|
/* @__PURE__ */ d.jsx("p", { className: "mswd-opt-desc", children: o.description })
|
|
2834
2839
|
] }),
|
|
2835
|
-
o.scenario === "loading" ? /* @__PURE__ */ d.jsx("span", { className: "mswd-sc-spinner" }) : /* @__PURE__ */ d.jsx("span", { className:
|
|
2840
|
+
o.scenario === "loading" ? /* @__PURE__ */ d.jsx("span", { className: "mswd-sc-spinner" }) : /* @__PURE__ */ d.jsx("span", { className: Ao(o.statusCode), children: o.statusCode ?? "ERR" })
|
|
2836
2841
|
]
|
|
2837
2842
|
}
|
|
2838
2843
|
)
|
|
@@ -2840,12 +2845,46 @@ function _o({
|
|
|
2840
2845
|
}),
|
|
2841
2846
|
/* @__PURE__ */ d.jsxs("div", { className: "mswd-payload", children: [
|
|
2842
2847
|
/* @__PURE__ */ d.jsx("p", { className: "mswd-payload-label", children: "Response preview" }),
|
|
2843
|
-
/* @__PURE__ */ d.jsx("pre", { className: "mswd-payload-code", children:
|
|
2848
|
+
/* @__PURE__ */ d.jsx("pre", { className: "mswd-payload-code", children: _o(a) })
|
|
2844
2849
|
] })
|
|
2845
2850
|
] })
|
|
2846
2851
|
] });
|
|
2847
2852
|
}
|
|
2848
|
-
|
|
2853
|
+
const Qt = (e) => Symbol.iterator in e, en = (e) => (
|
|
2854
|
+
// HACK: avoid checking entries type
|
|
2855
|
+
"entries" in e
|
|
2856
|
+
), tn = (e, t) => {
|
|
2857
|
+
const n = e instanceof Map ? e : new Map(e.entries()), r = t instanceof Map ? t : new Map(t.entries());
|
|
2858
|
+
if (n.size !== r.size)
|
|
2859
|
+
return !1;
|
|
2860
|
+
for (const [a, o] of n)
|
|
2861
|
+
if (!r.has(a) || !Object.is(o, r.get(a)))
|
|
2862
|
+
return !1;
|
|
2863
|
+
return !0;
|
|
2864
|
+
}, $o = (e, t) => {
|
|
2865
|
+
const n = e[Symbol.iterator](), r = t[Symbol.iterator]();
|
|
2866
|
+
let a = n.next(), o = r.next();
|
|
2867
|
+
for (; !a.done && !o.done; ) {
|
|
2868
|
+
if (!Object.is(a.value, o.value))
|
|
2869
|
+
return !1;
|
|
2870
|
+
a = n.next(), o = r.next();
|
|
2871
|
+
}
|
|
2872
|
+
return !!a.done && !!o.done;
|
|
2873
|
+
};
|
|
2874
|
+
function Lo(e, t) {
|
|
2875
|
+
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null || Object.getPrototypeOf(e) !== Object.getPrototypeOf(t) ? !1 : Qt(e) && Qt(t) ? en(e) && en(t) ? tn(e, t) : $o(e, t) : tn(
|
|
2876
|
+
{ entries: () => Object.entries(e) },
|
|
2877
|
+
{ entries: () => Object.entries(t) }
|
|
2878
|
+
);
|
|
2879
|
+
}
|
|
2880
|
+
function Fo(e) {
|
|
2881
|
+
const t = b.useRef(void 0);
|
|
2882
|
+
return (n) => {
|
|
2883
|
+
const r = e(n);
|
|
2884
|
+
return Lo(t.current, r) ? t.current : t.current = r;
|
|
2885
|
+
};
|
|
2886
|
+
}
|
|
2887
|
+
function Wo({
|
|
2849
2888
|
status: e,
|
|
2850
2889
|
onClick: t
|
|
2851
2890
|
}) {
|
|
@@ -2876,7 +2915,7 @@ function ko({
|
|
|
2876
2915
|
}
|
|
2877
2916
|
);
|
|
2878
2917
|
}
|
|
2879
|
-
function
|
|
2918
|
+
function Uo({
|
|
2880
2919
|
enabled: e,
|
|
2881
2920
|
onToggle: t
|
|
2882
2921
|
}) {
|
|
@@ -2895,7 +2934,7 @@ function Mo({
|
|
|
2895
2934
|
/* @__PURE__ */ d.jsx("span", { className: `mswd-dot ${e ? "mswd-dot--on" : ""}` })
|
|
2896
2935
|
] });
|
|
2897
2936
|
}
|
|
2898
|
-
function
|
|
2937
|
+
function Bo({
|
|
2899
2938
|
active: e,
|
|
2900
2939
|
disabled: t,
|
|
2901
2940
|
onSelect: n
|
|
@@ -2933,38 +2972,48 @@ function Io({
|
|
|
2933
2972
|
}
|
|
2934
2973
|
);
|
|
2935
2974
|
}
|
|
2936
|
-
function
|
|
2937
|
-
|
|
2938
|
-
enabled: t = !0,
|
|
2939
|
-
snapPoints: n = ["500px", 1]
|
|
2940
|
-
}) {
|
|
2941
|
-
const [r, a] = qe(!1), [o, i] = qe(!1), [s, v] = qe(
|
|
2942
|
-
n[0]
|
|
2943
|
-
), f = or(!1), p = G((b) => b._setWorker);
|
|
2975
|
+
function qo({ worker: e, enabled: t = !0 }) {
|
|
2976
|
+
const [n, r] = mt(!1), [a, o] = mt(!1), i = re((E) => E._setWorker);
|
|
2944
2977
|
wt(() => {
|
|
2945
|
-
|
|
2946
|
-
}, [e
|
|
2947
|
-
const
|
|
2948
|
-
|
|
2949
|
-
|
|
2978
|
+
i(e);
|
|
2979
|
+
}, [e]);
|
|
2980
|
+
const {
|
|
2981
|
+
endpoints: s,
|
|
2982
|
+
expandedIds: v,
|
|
2983
|
+
globalPreset: p,
|
|
2984
|
+
pendingChanges: f,
|
|
2985
|
+
mockEnabled: l,
|
|
2986
|
+
currentPageId: h,
|
|
2987
|
+
fabStatus: R
|
|
2988
|
+
} = re(
|
|
2989
|
+
Fo((E) => ({
|
|
2990
|
+
endpoints: qn(E),
|
|
2991
|
+
expandedIds: E.expandedIds,
|
|
2992
|
+
globalPreset: E.globalPreset,
|
|
2993
|
+
pendingChanges: E.pendingChanges,
|
|
2994
|
+
mockEnabled: E.mockEnabled,
|
|
2995
|
+
currentPageId: E.currentPageId,
|
|
2996
|
+
fabStatus: Do(E)
|
|
2997
|
+
}))
|
|
2998
|
+
), O = re((E) => E.toggleMockEnabled), m = re((E) => E.toggleEndpoint), S = re((E) => E.selectScenario), g = re((E) => E.applyGlobalPreset), T = re((E) => E.applyChanges), P = re((E) => E.resetCurrentPage), y = lr(() => {
|
|
2999
|
+
T(), o(!0), setTimeout(() => o(!1), 1200);
|
|
3000
|
+
}, [T]);
|
|
2950
3001
|
return t ? /* @__PURE__ */ d.jsx(d.Fragment, { children: /* @__PURE__ */ d.jsxs(
|
|
2951
3002
|
fe.Root,
|
|
2952
3003
|
{
|
|
2953
|
-
open:
|
|
2954
|
-
onOpenChange:
|
|
2955
|
-
snapPoints: n,
|
|
2956
|
-
activeSnapPoint: s,
|
|
2957
|
-
setActiveSnapPoint: v,
|
|
3004
|
+
open: n,
|
|
3005
|
+
onOpenChange: r,
|
|
2958
3006
|
shouldScaleBackground: !1,
|
|
2959
3007
|
modal: !0,
|
|
2960
3008
|
children: [
|
|
2961
|
-
/* @__PURE__ */ d.jsx(fe.Trigger, { asChild: !0, children: /* @__PURE__ */ d.jsx(
|
|
3009
|
+
/* @__PURE__ */ d.jsx(fe.Trigger, { asChild: !0, children: /* @__PURE__ */ d.jsx(Wo, { status: R, onClick: () => r(!0) }) }),
|
|
2962
3010
|
/* @__PURE__ */ d.jsxs(fe.Portal, { children: [
|
|
2963
3011
|
/* @__PURE__ */ d.jsx(fe.Overlay, { className: "mswd-vaul-overlay" }),
|
|
2964
3012
|
/* @__PURE__ */ d.jsxs(
|
|
2965
3013
|
fe.Content,
|
|
2966
3014
|
{
|
|
2967
3015
|
className: "mswd-vaul-content",
|
|
3016
|
+
"aria-modal": !0,
|
|
2968
3017
|
"aria-describedby": void 0,
|
|
2969
3018
|
children: [
|
|
2970
3019
|
/* @__PURE__ */ d.jsx(fe.Handle, { className: "mswd-vaul-handle" }),
|
|
@@ -2974,7 +3023,7 @@ function Wo({
|
|
|
2974
3023
|
/* @__PURE__ */ d.jsx("div", { className: "mswd-header-icon", "aria-hidden": "true", children: "โก" }),
|
|
2975
3024
|
/* @__PURE__ */ d.jsxs("div", { children: [
|
|
2976
3025
|
/* @__PURE__ */ d.jsx("p", { className: "mswd-header-title", children: "Debug" }),
|
|
2977
|
-
|
|
3026
|
+
h ? /* @__PURE__ */ d.jsx("p", { className: "mswd-header-sub mswd-header-sub--page", children: h }) : /* @__PURE__ */ d.jsx("p", { className: "mswd-header-sub", children: "mock service worker" })
|
|
2978
3027
|
] })
|
|
2979
3028
|
] }),
|
|
2980
3029
|
/* @__PURE__ */ d.jsx(
|
|
@@ -2986,8 +3035,8 @@ function Wo({
|
|
|
2986
3035
|
}
|
|
2987
3036
|
)
|
|
2988
3037
|
] }),
|
|
2989
|
-
/* @__PURE__ */ d.jsx(
|
|
2990
|
-
|
|
3038
|
+
/* @__PURE__ */ d.jsx(Uo, { enabled: l, onToggle: O }),
|
|
3039
|
+
s.length === 0 ? /* @__PURE__ */ d.jsxs("div", { className: "mswd-empty", children: [
|
|
2991
3040
|
/* @__PURE__ */ d.jsx("div", { className: "mswd-empty-icon", "aria-hidden": "true", children: "๐ญ" }),
|
|
2992
3041
|
/* @__PURE__ */ d.jsx("p", { className: "mswd-empty-title", children: "Nenhum endpoint registrado" }),
|
|
2993
3042
|
/* @__PURE__ */ d.jsxs("p", { className: "mswd-empty-desc", children: [
|
|
@@ -2998,11 +3047,11 @@ function Wo({
|
|
|
2998
3047
|
] })
|
|
2999
3048
|
] }) : /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
3000
3049
|
/* @__PURE__ */ d.jsx(
|
|
3001
|
-
|
|
3050
|
+
Bo,
|
|
3002
3051
|
{
|
|
3003
|
-
active:
|
|
3052
|
+
active: p,
|
|
3004
3053
|
disabled: !l,
|
|
3005
|
-
onSelect:
|
|
3054
|
+
onSelect: g
|
|
3006
3055
|
}
|
|
3007
3056
|
),
|
|
3008
3057
|
/* @__PURE__ */ d.jsxs(
|
|
@@ -3012,9 +3061,9 @@ function Wo({
|
|
|
3012
3061
|
children: [
|
|
3013
3062
|
/* @__PURE__ */ d.jsxs("span", { className: "mswd-section-text", children: [
|
|
3014
3063
|
"endpoints ยท ",
|
|
3015
|
-
|
|
3064
|
+
s.length
|
|
3016
3065
|
] }),
|
|
3017
|
-
|
|
3066
|
+
f && l && /* @__PURE__ */ d.jsx("span", { className: "mswd-unsaved", children: "unsaved" })
|
|
3018
3067
|
]
|
|
3019
3068
|
}
|
|
3020
3069
|
),
|
|
@@ -3023,15 +3072,15 @@ function Wo({
|
|
|
3023
3072
|
{
|
|
3024
3073
|
className: `mswd-list ${l ? "" : "mswd-list--disabled"}`,
|
|
3025
3074
|
"data-vaul-no-drag": !0,
|
|
3026
|
-
children:
|
|
3027
|
-
|
|
3075
|
+
children: s.map((E) => /* @__PURE__ */ d.jsx(
|
|
3076
|
+
jo,
|
|
3028
3077
|
{
|
|
3029
|
-
endpoint:
|
|
3030
|
-
expanded:
|
|
3031
|
-
onToggle: () =>
|
|
3032
|
-
onSelectScenario: (
|
|
3078
|
+
endpoint: E,
|
|
3079
|
+
expanded: !!v[E.id],
|
|
3080
|
+
onToggle: () => m(E.id),
|
|
3081
|
+
onSelectScenario: (F) => S(E.id, F)
|
|
3033
3082
|
},
|
|
3034
|
-
|
|
3083
|
+
E.id
|
|
3035
3084
|
))
|
|
3036
3085
|
}
|
|
3037
3086
|
),
|
|
@@ -3040,7 +3089,7 @@ function Wo({
|
|
|
3040
3089
|
"button",
|
|
3041
3090
|
{
|
|
3042
3091
|
type: "button",
|
|
3043
|
-
onClick:
|
|
3092
|
+
onClick: P,
|
|
3044
3093
|
className: "mswd-btn-reset",
|
|
3045
3094
|
children: "Reset"
|
|
3046
3095
|
}
|
|
@@ -3049,10 +3098,10 @@ function Wo({
|
|
|
3049
3098
|
"button",
|
|
3050
3099
|
{
|
|
3051
3100
|
type: "button",
|
|
3052
|
-
onClick:
|
|
3053
|
-
disabled: !
|
|
3054
|
-
className: `mswd-btn-apply ${
|
|
3055
|
-
children:
|
|
3101
|
+
onClick: y,
|
|
3102
|
+
disabled: !f || !l,
|
|
3103
|
+
className: `mswd-btn-apply ${a ? "mswd-btn-apply--applied" : f && l ? "mswd-btn-apply--active" : "mswd-btn-apply--disabled"}`,
|
|
3104
|
+
children: a ? "Applied โ" : "Apply & reload"
|
|
3056
3105
|
}
|
|
3057
3106
|
)
|
|
3058
3107
|
] })
|
|
@@ -3065,14 +3114,17 @@ function Wo({
|
|
|
3065
3114
|
}
|
|
3066
3115
|
) }) : null;
|
|
3067
3116
|
}
|
|
3068
|
-
function
|
|
3069
|
-
const t =
|
|
3070
|
-
wt(() => {
|
|
3071
|
-
|
|
3072
|
-
|
|
3117
|
+
function Xo(e) {
|
|
3118
|
+
const t = re((o) => o.registerPage), n = re((o) => o.unregisterPage), r = re((o) => o.setCurrentPage), a = ur(e);
|
|
3119
|
+
a.current = e, wt(() => {
|
|
3120
|
+
const { pageId: o } = a.current;
|
|
3121
|
+
return t(a.current), r(o), () => {
|
|
3122
|
+
n(o);
|
|
3123
|
+
};
|
|
3124
|
+
}, [t, n, r, e.pageId]);
|
|
3073
3125
|
}
|
|
3074
3126
|
export {
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3127
|
+
qo as DebugDrawer,
|
|
3128
|
+
re as useDebugDrawerStore,
|
|
3129
|
+
Xo as useRegisterMockEndpoints
|
|
3078
3130
|
};
|