@sps-woodland/tabs 8.2.1 → 8.3.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/lib/index.cjs.js +3 -3
- package/lib/index.es.js +1233 -871
- package/lib/style.css +1 -1
- package/package.json +5 -5
package/lib/index.es.js
CHANGED
@@ -1,34 +1,41 @@
|
|
1
|
-
import * as
|
2
|
-
import
|
3
|
-
import { useCollection as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
let
|
11
|
-
|
1
|
+
import * as B from "react";
|
2
|
+
import U, { useState as R, useRef as k, useEffect as z, useCallback as q, useMemo as V, useContext as le, createContext as Ut } from "react";
|
3
|
+
import { compareNodeOrder as Te, getFirstItem as Wt, getChildNodes as Ht, useCollection as jt } from "@react-stately/collections";
|
4
|
+
import { flushSync as Vt } from "react-dom";
|
5
|
+
import { Metadata as ae, modChildren as Gt, cl as ut, Content as Xt, useChildTestIdAttrBuilder as qt } from "@sps-woodland/core";
|
6
|
+
import { code as He } from "@spscommerce/utils";
|
7
|
+
function dt(t, e, r) {
|
8
|
+
let [n, i] = R(t || e), o = k(t !== void 0), s = t !== void 0;
|
9
|
+
z(() => {
|
10
|
+
let b = o.current;
|
11
|
+
b !== s && console.warn(`WARN: A component changed from ${b ? "controlled" : "uncontrolled"} to ${s ? "controlled" : "uncontrolled"}.`), o.current = s;
|
12
|
+
}, [
|
13
|
+
s
|
14
|
+
]);
|
15
|
+
let u = s ? t : n, f = q((b, ...v) => {
|
16
|
+
let T = (h, ...g) => {
|
17
|
+
r && (Object.is(u, h) || r(h, ...g)), s || (u = h);
|
12
18
|
};
|
13
|
-
typeof
|
14
|
-
let P =
|
15
|
-
return
|
16
|
-
})) : (
|
19
|
+
typeof b == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), i((g, ...L) => {
|
20
|
+
let P = b(s ? u : g, ...L);
|
21
|
+
return T(P, ...v), s ? g : P;
|
22
|
+
})) : (s || i(b), T(b, ...v));
|
17
23
|
}, [
|
18
|
-
|
24
|
+
s,
|
25
|
+
u,
|
19
26
|
r
|
20
27
|
]);
|
21
|
-
return
|
22
|
-
|
23
|
-
|
28
|
+
return [
|
29
|
+
u,
|
30
|
+
f
|
24
31
|
];
|
25
32
|
}
|
26
|
-
class
|
33
|
+
class N extends Set {
|
27
34
|
constructor(e, r, n) {
|
28
|
-
super(e), e instanceof
|
35
|
+
super(e), e instanceof N ? (this.anchorKey = r || e.anchorKey, this.currentKey = n || e.currentKey) : (this.anchorKey = r, this.currentKey = n);
|
29
36
|
}
|
30
37
|
}
|
31
|
-
function
|
38
|
+
function Yt(t, e) {
|
32
39
|
if (t.size !== e.size)
|
33
40
|
return !1;
|
34
41
|
for (let r of t)
|
@@ -36,52 +43,52 @@ function gt(t, e) {
|
|
36
43
|
return !1;
|
37
44
|
return !0;
|
38
45
|
}
|
39
|
-
function
|
40
|
-
let { selectionMode: e = "none", disallowEmptySelection: r, allowDuplicateSelectionEvents: n, selectionBehavior: i = "toggle", disabledBehavior:
|
46
|
+
function Jt(t) {
|
47
|
+
let { selectionMode: e = "none", disallowEmptySelection: r, allowDuplicateSelectionEvents: n, selectionBehavior: i = "toggle", disabledBehavior: o = "all" } = t, s = k(!1), [, u] = R(!1), f = k(null), b = k(null), [, v] = R(null), T = V(() => je(t.selectedKeys), [
|
41
48
|
t.selectedKeys
|
42
|
-
]),
|
49
|
+
]), h = V(() => je(t.defaultSelectedKeys, new N()), [
|
43
50
|
t.defaultSelectedKeys
|
44
|
-
]), [
|
51
|
+
]), [g, L] = dt(T, h, t.onSelectionChange), P = V(() => t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set(), [
|
45
52
|
t.disabledKeys
|
46
|
-
]), [
|
47
|
-
i === "replace" &&
|
48
|
-
let
|
49
|
-
return
|
50
|
-
i !==
|
53
|
+
]), [K, M] = R(i);
|
54
|
+
i === "replace" && K === "toggle" && typeof g == "object" && g.size === 0 && M("replace");
|
55
|
+
let x = k(i);
|
56
|
+
return z(() => {
|
57
|
+
i !== x.current && (M(i), x.current = i);
|
51
58
|
}, [
|
52
59
|
i
|
53
60
|
]), {
|
54
61
|
selectionMode: e,
|
55
62
|
disallowEmptySelection: r,
|
56
|
-
selectionBehavior:
|
57
|
-
setSelectionBehavior:
|
63
|
+
selectionBehavior: K,
|
64
|
+
setSelectionBehavior: M,
|
58
65
|
get isFocused() {
|
59
|
-
return
|
66
|
+
return s.current;
|
60
67
|
},
|
61
|
-
setFocused(
|
62
|
-
|
68
|
+
setFocused(E) {
|
69
|
+
s.current = E, u(E);
|
63
70
|
},
|
64
71
|
get focusedKey() {
|
65
|
-
return
|
72
|
+
return f.current;
|
66
73
|
},
|
67
74
|
get childFocusStrategy() {
|
68
|
-
return
|
75
|
+
return b.current;
|
69
76
|
},
|
70
|
-
setFocusedKey(
|
71
|
-
|
77
|
+
setFocusedKey(E, C = "first") {
|
78
|
+
f.current = E, b.current = C, v(E);
|
72
79
|
},
|
73
|
-
selectedKeys:
|
74
|
-
setSelectedKeys(
|
75
|
-
(n || !
|
80
|
+
selectedKeys: g,
|
81
|
+
setSelectedKeys(E) {
|
82
|
+
(n || !Yt(E, g)) && L(E);
|
76
83
|
},
|
77
|
-
disabledKeys:
|
78
|
-
disabledBehavior:
|
84
|
+
disabledKeys: P,
|
85
|
+
disabledBehavior: o
|
79
86
|
};
|
80
87
|
}
|
81
|
-
function
|
82
|
-
return t ? t === "all" ? "all" : new
|
88
|
+
function je(t, e) {
|
89
|
+
return t ? t === "all" ? "all" : new N(t) : e;
|
83
90
|
}
|
84
|
-
class
|
91
|
+
class Zt {
|
85
92
|
get selectionMode() {
|
86
93
|
return this.state.selectionMode;
|
87
94
|
}
|
@@ -135,7 +142,7 @@ class vt {
|
|
135
142
|
let e = null;
|
136
143
|
for (let r of this.state.selectedKeys) {
|
137
144
|
let n = this.collection.getItem(r);
|
138
|
-
(!e ||
|
145
|
+
(!e || n && Te(this.collection, n, e) < 0) && (e = n);
|
139
146
|
}
|
140
147
|
return e == null ? void 0 : e.key;
|
141
148
|
}
|
@@ -143,7 +150,7 @@ class vt {
|
|
143
150
|
let e = null;
|
144
151
|
for (let r of this.state.selectedKeys) {
|
145
152
|
let n = this.collection.getItem(r);
|
146
|
-
(!e ||
|
153
|
+
(!e || n && Te(this.collection, n, e) > 0) && (e = n);
|
147
154
|
}
|
148
155
|
return e == null ? void 0 : e.key;
|
149
156
|
}
|
@@ -163,28 +170,28 @@ class vt {
|
|
163
170
|
e = this.getKey(e);
|
164
171
|
let r;
|
165
172
|
if (this.state.selectedKeys === "all")
|
166
|
-
r = new
|
173
|
+
r = new N([
|
167
174
|
e
|
168
175
|
], e, e);
|
169
176
|
else {
|
170
177
|
let n = this.state.selectedKeys, i = n.anchorKey || e;
|
171
|
-
r = new
|
172
|
-
for (let
|
173
|
-
r.delete(
|
174
|
-
for (let
|
175
|
-
this.canSelectItem(
|
178
|
+
r = new N(n, i, e);
|
179
|
+
for (let o of this.getKeyRange(i, n.currentKey || e))
|
180
|
+
r.delete(o);
|
181
|
+
for (let o of this.getKeyRange(e, i))
|
182
|
+
this.canSelectItem(o) && r.add(o);
|
176
183
|
}
|
177
184
|
this.state.setSelectedKeys(r);
|
178
185
|
}
|
179
186
|
getKeyRange(e, r) {
|
180
187
|
let n = this.collection.getItem(e), i = this.collection.getItem(r);
|
181
|
-
return n && i ?
|
188
|
+
return n && i ? Te(this.collection, n, i) <= 0 ? this.getKeyRangeInternal(e, r) : this.getKeyRangeInternal(r, e) : [];
|
182
189
|
}
|
183
190
|
getKeyRangeInternal(e, r) {
|
184
191
|
let n = [], i = e;
|
185
192
|
for (; i; ) {
|
186
|
-
let
|
187
|
-
if ((
|
193
|
+
let o = this.collection.getItem(i);
|
194
|
+
if ((o && o.type === "item" || o.type === "cell" && this.allowsCellSelection) && n.push(i), i === r)
|
188
195
|
return n;
|
189
196
|
i = this.collection.getKeyAfter(i);
|
190
197
|
}
|
@@ -207,21 +214,21 @@ class vt {
|
|
207
214
|
}
|
208
215
|
if (e = this.getKey(e), e == null)
|
209
216
|
return;
|
210
|
-
let r = new
|
217
|
+
let r = new N(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
|
211
218
|
r.has(e) ? r.delete(e) : this.canSelectItem(e) && (r.add(e), r.anchorKey = e, r.currentKey = e), !(this.disallowEmptySelection && r.size === 0) && this.state.setSelectedKeys(r);
|
212
219
|
}
|
213
220
|
replaceSelection(e) {
|
214
221
|
if (this.selectionMode === "none" || (e = this.getKey(e), e == null))
|
215
222
|
return;
|
216
|
-
let r = this.canSelectItem(e) ? new
|
223
|
+
let r = this.canSelectItem(e) ? new N([
|
217
224
|
e
|
218
|
-
], e, e) : new
|
225
|
+
], e, e) : new N();
|
219
226
|
this.state.setSelectedKeys(r);
|
220
227
|
}
|
221
228
|
setSelectedKeys(e) {
|
222
229
|
if (this.selectionMode === "none")
|
223
230
|
return;
|
224
|
-
let r = new
|
231
|
+
let r = new N();
|
225
232
|
for (let n of e)
|
226
233
|
if (n = this.getKey(n), n != null && (r.add(n), this.selectionMode === "single"))
|
227
234
|
break;
|
@@ -232,9 +239,7 @@ class vt {
|
|
232
239
|
for (; n; ) {
|
233
240
|
if (this.canSelectItem(n)) {
|
234
241
|
let i = this.collection.getItem(n);
|
235
|
-
i.type === "item" && e.push(n), i.hasChildNodes && (this.allowsCellSelection || i.type !== "item") && r(
|
236
|
-
...i.childNodes
|
237
|
-
][0].key);
|
242
|
+
i.type === "item" && e.push(n), i.hasChildNodes && (this.allowsCellSelection || i.type !== "item") && r(Wt(Ht(i, this.collection)).key);
|
238
243
|
}
|
239
244
|
n = this.collection.getKeyAfter(n);
|
240
245
|
}
|
@@ -242,10 +247,10 @@ class vt {
|
|
242
247
|
return r(this.collection.getFirstKey()), e;
|
243
248
|
}
|
244
249
|
selectAll() {
|
245
|
-
this.selectionMode === "multiple" && this.state.setSelectedKeys("all");
|
250
|
+
!this.isSelectAll && this.selectionMode === "multiple" && this.state.setSelectedKeys("all");
|
246
251
|
}
|
247
252
|
clearSelection() {
|
248
|
-
!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0) && this.state.setSelectedKeys(new
|
253
|
+
!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0) && this.state.setSelectedKeys(new N());
|
249
254
|
}
|
250
255
|
toggleSelectAll() {
|
251
256
|
this.isSelectAll ? this.clearSelection() : this.selectAll();
|
@@ -276,23 +281,18 @@ class vt {
|
|
276
281
|
isDisabled(e) {
|
277
282
|
return this.state.disabledKeys.has(e) && this.state.disabledBehavior === "all";
|
278
283
|
}
|
284
|
+
isLink(e) {
|
285
|
+
var r, n;
|
286
|
+
return !!(!((n = this.collection.getItem(e)) === null || n === void 0 || (r = n.props) === null || r === void 0) && r.href);
|
287
|
+
}
|
279
288
|
constructor(e, r, n) {
|
280
289
|
this.collection = e, this.state = r;
|
281
290
|
var i;
|
282
291
|
this.allowsCellSelection = (i = n == null ? void 0 : n.allowsCellSelection) !== null && i !== void 0 ? i : !1, this._isSelectAll = null;
|
283
292
|
}
|
284
293
|
}
|
285
|
-
|
286
|
-
|
287
|
-
value: r,
|
288
|
-
enumerable: !0,
|
289
|
-
configurable: !0,
|
290
|
-
writable: !0
|
291
|
-
}) : t[e] = r, t;
|
292
|
-
}
|
293
|
-
let mt = Symbol.iterator;
|
294
|
-
class Ee {
|
295
|
-
*[mt]() {
|
294
|
+
class Ve {
|
295
|
+
*[Symbol.iterator]() {
|
296
296
|
yield* this.iterable;
|
297
297
|
}
|
298
298
|
get size() {
|
@@ -324,223 +324,302 @@ class Ee {
|
|
324
324
|
];
|
325
325
|
return this.getItem(r[e]);
|
326
326
|
}
|
327
|
+
getChildren(e) {
|
328
|
+
let r = this.keyMap.get(e);
|
329
|
+
return (r == null ? void 0 : r.childNodes) || [];
|
330
|
+
}
|
327
331
|
constructor(e) {
|
328
|
-
|
329
|
-
let r = (
|
330
|
-
if (this.keyMap.set(
|
331
|
-
for (let
|
332
|
-
r(
|
332
|
+
this.keyMap = /* @__PURE__ */ new Map(), this.iterable = e;
|
333
|
+
let r = (o) => {
|
334
|
+
if (this.keyMap.set(o.key, o), o.childNodes && o.type === "section")
|
335
|
+
for (let s of o.childNodes)
|
336
|
+
r(s);
|
333
337
|
};
|
334
|
-
for (let
|
335
|
-
r(
|
338
|
+
for (let o of e)
|
339
|
+
r(o);
|
336
340
|
let n, i = 0;
|
337
|
-
for (let [
|
338
|
-
n ? (n.nextKey =
|
341
|
+
for (let [o, s] of this.keyMap)
|
342
|
+
n ? (n.nextKey = o, s.prevKey = n.key) : (this.firstKey = o, s.prevKey = void 0), s.type === "item" && (s.index = i++), n = s, n.nextKey = void 0;
|
339
343
|
this.lastKey = n == null ? void 0 : n.key;
|
340
344
|
}
|
341
345
|
}
|
342
|
-
function
|
343
|
-
let { filter: e } = t, r =
|
346
|
+
function Qt(t) {
|
347
|
+
let { filter: e } = t, r = Jt(t), n = V(() => t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set(), [
|
344
348
|
t.disabledKeys
|
345
|
-
]), i = (
|
349
|
+
]), i = q((b) => e ? new Ve(e(b)) : new Ve(b), [
|
350
|
+
e
|
351
|
+
]), o = V(() => ({
|
346
352
|
suppressTextValueWarning: t.suppressTextValueWarning
|
347
353
|
}), [
|
348
354
|
t.suppressTextValueWarning
|
349
|
-
]),
|
350
|
-
|
351
|
-
]), f = z(() => new vt(l, r), [
|
352
|
-
l,
|
355
|
+
]), s = jt(t, i, o), u = V(() => new Zt(s, r), [
|
356
|
+
s,
|
353
357
|
r
|
354
358
|
]);
|
355
|
-
const
|
356
|
-
return
|
357
|
-
if (r.focusedKey != null && !
|
358
|
-
const
|
359
|
-
...
|
360
|
-
].map((
|
361
|
-
const
|
362
|
-
return
|
363
|
-
}).filter((
|
364
|
-
...
|
365
|
-
].map((
|
366
|
-
const
|
367
|
-
return
|
368
|
-
}).filter((
|
369
|
-
let
|
370
|
-
for (;
|
371
|
-
if (!
|
372
|
-
|
359
|
+
const f = k(null);
|
360
|
+
return z(() => {
|
361
|
+
if (r.focusedKey != null && !s.getItem(r.focusedKey)) {
|
362
|
+
const b = f.current.getItem(r.focusedKey), v = [
|
363
|
+
...f.current.getKeys()
|
364
|
+
].map((P) => {
|
365
|
+
const K = f.current.getItem(P);
|
366
|
+
return K.type === "item" ? K : null;
|
367
|
+
}).filter((P) => P !== null), T = [
|
368
|
+
...s.getKeys()
|
369
|
+
].map((P) => {
|
370
|
+
const K = s.getItem(P);
|
371
|
+
return K.type === "item" ? K : null;
|
372
|
+
}).filter((P) => P !== null), h = v.length - T.length;
|
373
|
+
let g = Math.min(h > 1 ? Math.max(b.index - h + 1, 0) : b.index, T.length - 1), L;
|
374
|
+
for (; g >= 0; ) {
|
375
|
+
if (!u.isDisabled(T[g].key)) {
|
376
|
+
L = T[g];
|
373
377
|
break;
|
374
378
|
}
|
375
|
-
|
379
|
+
g < T.length - 1 ? g++ : (g > b.index && (g = b.index), g--);
|
376
380
|
}
|
377
|
-
r.setFocusedKey(
|
381
|
+
r.setFocusedKey(L ? L.key : null);
|
378
382
|
}
|
379
|
-
|
383
|
+
f.current = s;
|
380
384
|
}, [
|
381
|
-
|
382
|
-
|
385
|
+
s,
|
386
|
+
u,
|
383
387
|
r,
|
384
388
|
r.focusedKey
|
385
389
|
]), {
|
386
|
-
collection:
|
390
|
+
collection: s,
|
387
391
|
disabledKeys: n,
|
388
|
-
selectionManager:
|
392
|
+
selectionManager: u
|
389
393
|
};
|
390
394
|
}
|
391
|
-
function
|
395
|
+
function _t(t) {
|
392
396
|
var e;
|
393
|
-
let [r, n] =
|
397
|
+
let [r, n] = dt(t.selectedKey, (e = t.defaultSelectedKey) !== null && e !== void 0 ? e : null, t.onSelectionChange), i = V(() => r != null ? [
|
394
398
|
r
|
395
399
|
] : [], [
|
396
400
|
r
|
397
|
-
]), { collection:
|
401
|
+
]), { collection: o, disabledKeys: s, selectionManager: u } = Qt({
|
398
402
|
...t,
|
399
403
|
selectionMode: "single",
|
400
404
|
disallowEmptySelection: !0,
|
401
405
|
allowDuplicateSelectionEvents: !0,
|
402
406
|
selectedKeys: i,
|
403
|
-
onSelectionChange: (
|
404
|
-
|
405
|
-
|
407
|
+
onSelectionChange: (b) => {
|
408
|
+
var v;
|
409
|
+
let T = (v = b.values().next().value) !== null && v !== void 0 ? v : null;
|
410
|
+
T === r && t.onSelectionChange && t.onSelectionChange(T), n(T);
|
406
411
|
}
|
407
|
-
}),
|
412
|
+
}), f = r != null ? o.getItem(r) : null;
|
408
413
|
return {
|
409
|
-
collection:
|
410
|
-
disabledKeys:
|
411
|
-
selectionManager:
|
414
|
+
collection: o,
|
415
|
+
disabledKeys: s,
|
416
|
+
selectionManager: u,
|
412
417
|
selectedKey: r,
|
413
418
|
setSelectedKey: n,
|
414
|
-
selectedItem:
|
419
|
+
selectedItem: f
|
415
420
|
};
|
416
421
|
}
|
417
|
-
function
|
418
|
-
|
422
|
+
function er(t) {
|
423
|
+
var e;
|
424
|
+
let r = _t({
|
419
425
|
...t,
|
420
|
-
suppressTextValueWarning: !0
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
]);
|
428
|
-
}
|
429
|
-
|
430
|
-
...e,
|
426
|
+
suppressTextValueWarning: !0,
|
427
|
+
defaultSelectedKey: (e = t.defaultSelectedKey) !== null && e !== void 0 ? e : Ge(t.collection, t.disabledKeys ? new Set(t.disabledKeys) : /* @__PURE__ */ new Set())
|
428
|
+
}), { selectionManager: n, collection: i, selectedKey: o } = r, s = k(o);
|
429
|
+
return z(() => {
|
430
|
+
let u = o;
|
431
|
+
(n.isEmpty || !i.getItem(u)) && (u = Ge(i, r.disabledKeys), u != null && n.setSelectedKeys([
|
432
|
+
u
|
433
|
+
])), (u != null && n.focusedKey == null || !n.isFocused && u !== s.current) && n.setFocusedKey(u), s.current = u;
|
434
|
+
}), {
|
435
|
+
...r,
|
431
436
|
isDisabled: t.isDisabled || !1
|
432
437
|
};
|
433
438
|
}
|
434
|
-
|
439
|
+
function Ge(t, e) {
|
440
|
+
let r = null;
|
441
|
+
if (t) {
|
442
|
+
for (r = t.getFirstKey(); e.has(r) && r !== t.getLastKey(); )
|
443
|
+
r = t.getKeyAfter(r);
|
444
|
+
e.has(r) && r === t.getLastKey() && (r = t.getFirstKey());
|
445
|
+
}
|
446
|
+
return r;
|
447
|
+
}
|
448
|
+
const ve = {
|
435
449
|
prefix: String(Math.round(Math.random() * 1e10)),
|
436
450
|
current: 0
|
437
|
-
},
|
438
|
-
let
|
439
|
-
function
|
440
|
-
let e =
|
441
|
-
|
442
|
-
|
443
|
-
|
451
|
+
}, ft = /* @__PURE__ */ U.createContext(ve), tr = /* @__PURE__ */ U.createContext(!1);
|
452
|
+
let rr = Boolean(typeof window < "u" && window.document && window.document.createElement), we = /* @__PURE__ */ new WeakMap();
|
453
|
+
function nr(t = !1) {
|
454
|
+
let e = le(ft), r = k(null);
|
455
|
+
if (r.current === null && !t) {
|
456
|
+
var n, i;
|
457
|
+
let o = (i = U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || i === void 0 || (n = i.ReactCurrentOwner) === null || n === void 0 ? void 0 : n.current;
|
458
|
+
if (o) {
|
459
|
+
let s = we.get(o);
|
460
|
+
s == null ? we.set(o, {
|
461
|
+
id: e.current,
|
462
|
+
state: o.memoizedState
|
463
|
+
}) : o.memoizedState !== s.state && (e.current = s.id, we.delete(o));
|
464
|
+
}
|
465
|
+
r.current = ++e.current;
|
466
|
+
}
|
467
|
+
return r.current;
|
468
|
+
}
|
469
|
+
function ir(t) {
|
470
|
+
let e = le(ft);
|
471
|
+
e === ve && !rr && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
472
|
+
let r = nr(!!t), n = e === ve && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${e.prefix}`;
|
473
|
+
return t || `${n}-${r}`;
|
474
|
+
}
|
475
|
+
function lr(t) {
|
476
|
+
let e = U.useId(), [r] = R(pt()), n = r || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${ve.prefix}`;
|
477
|
+
return t || `${n}-${e}`;
|
444
478
|
}
|
445
|
-
function
|
446
|
-
|
447
|
-
return
|
448
|
-
|
449
|
-
|
479
|
+
const or = typeof U.useId == "function" ? lr : ir;
|
480
|
+
function sr() {
|
481
|
+
return !1;
|
482
|
+
}
|
483
|
+
function ar() {
|
484
|
+
return !0;
|
485
|
+
}
|
486
|
+
function cr(t) {
|
487
|
+
return () => {
|
488
|
+
};
|
450
489
|
}
|
451
|
-
function
|
490
|
+
function pt() {
|
491
|
+
return typeof U.useSyncExternalStore == "function" ? U.useSyncExternalStore(cr, sr, ar) : le(tr);
|
492
|
+
}
|
493
|
+
function yt(t) {
|
452
494
|
var e, r, n = "";
|
453
495
|
if (typeof t == "string" || typeof t == "number")
|
454
496
|
n += t;
|
455
497
|
else if (typeof t == "object")
|
456
|
-
if (Array.isArray(t))
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
498
|
+
if (Array.isArray(t)) {
|
499
|
+
var i = t.length;
|
500
|
+
for (e = 0; e < i; e++)
|
501
|
+
t[e] && (r = yt(t[e])) && (n && (n += " "), n += r);
|
502
|
+
} else
|
503
|
+
for (r in t)
|
504
|
+
t[r] && (n && (n += " "), n += r);
|
462
505
|
return n;
|
463
506
|
}
|
464
|
-
function
|
465
|
-
for (var t, e, r = 0, n = ""
|
466
|
-
(t = arguments[r
|
507
|
+
function ur() {
|
508
|
+
for (var t, e, r = 0, n = "", i = arguments.length; r < i; r++)
|
509
|
+
(t = arguments[r]) && (e = yt(t)) && (n && (n += " "), n += e);
|
467
510
|
return n;
|
468
511
|
}
|
469
|
-
const
|
512
|
+
const ce = typeof document < "u" ? U.useLayoutEffect : () => {
|
470
513
|
};
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
514
|
+
function te(t) {
|
515
|
+
const e = k(null);
|
516
|
+
return ce(() => {
|
517
|
+
e.current = t;
|
518
|
+
}, [
|
519
|
+
t
|
520
|
+
]), q((...r) => {
|
521
|
+
const n = e.current;
|
522
|
+
return n == null ? void 0 : n(...r);
|
523
|
+
}, []);
|
524
|
+
}
|
525
|
+
let dr = Boolean(typeof window < "u" && window.document && window.document.createElement), ge = /* @__PURE__ */ new Map();
|
526
|
+
function bt(t) {
|
527
|
+
let [e, r] = R(t), n = k(null), i = or(e), o = q((s) => {
|
528
|
+
n.current = s;
|
475
529
|
}, []);
|
476
|
-
return
|
477
|
-
let
|
530
|
+
return dr && ge.set(i, o), ce(() => {
|
531
|
+
let s = i;
|
478
532
|
return () => {
|
479
|
-
|
533
|
+
ge.delete(s);
|
480
534
|
};
|
481
535
|
}, [
|
482
536
|
i
|
483
|
-
]),
|
484
|
-
let
|
485
|
-
|
537
|
+
]), z(() => {
|
538
|
+
let s = n.current;
|
539
|
+
s && (n.current = null, r(s));
|
486
540
|
}), i;
|
487
541
|
}
|
488
|
-
function
|
542
|
+
function fr(t, e) {
|
489
543
|
if (t === e)
|
490
544
|
return t;
|
491
|
-
let r =
|
545
|
+
let r = ge.get(t);
|
492
546
|
if (r)
|
493
547
|
return r(e), e;
|
494
|
-
let n =
|
548
|
+
let n = ge.get(e);
|
495
549
|
return n ? (n(t), t) : e;
|
496
550
|
}
|
497
|
-
function
|
551
|
+
function vt(...t) {
|
498
552
|
return (...e) => {
|
499
553
|
for (let r of t)
|
500
554
|
typeof r == "function" && r(...e);
|
501
555
|
};
|
502
556
|
}
|
503
|
-
|
557
|
+
const D = (t) => {
|
558
|
+
var e;
|
559
|
+
return (e = t == null ? void 0 : t.ownerDocument) !== null && e !== void 0 ? e : document;
|
560
|
+
}, Y = (t) => t && "window" in t && t.window === t ? t : D(t).defaultView || window;
|
561
|
+
function G(...t) {
|
504
562
|
let e = {
|
505
563
|
...t[0]
|
506
564
|
};
|
507
565
|
for (let r = 1; r < t.length; r++) {
|
508
566
|
let n = t[r];
|
509
567
|
for (let i in n) {
|
510
|
-
let
|
511
|
-
typeof
|
568
|
+
let o = e[i], s = n[i];
|
569
|
+
typeof o == "function" && typeof s == "function" && i[0] === "o" && i[1] === "n" && i.charCodeAt(2) >= 65 && i.charCodeAt(2) <= 90 ? e[i] = vt(o, s) : (i === "className" || i === "UNSAFE_className") && typeof o == "string" && typeof s == "string" ? e[i] = ur(o, s) : i === "id" && o && s ? e.id = fr(o, s) : e[i] = s !== void 0 ? s : o;
|
512
570
|
}
|
513
571
|
}
|
514
572
|
return e;
|
515
573
|
}
|
516
|
-
|
517
|
-
|
574
|
+
const pr = /* @__PURE__ */ new Set([
|
575
|
+
"id"
|
576
|
+
]), yr = /* @__PURE__ */ new Set([
|
577
|
+
"aria-label",
|
578
|
+
"aria-labelledby",
|
579
|
+
"aria-describedby",
|
580
|
+
"aria-details"
|
581
|
+
]), br = /* @__PURE__ */ new Set([
|
582
|
+
"href",
|
583
|
+
"target",
|
584
|
+
"rel",
|
585
|
+
"download",
|
586
|
+
"ping",
|
587
|
+
"referrerPolicy"
|
588
|
+
]), vr = /^(data-.*)$/;
|
589
|
+
function gr(t, e = {}) {
|
590
|
+
let { labelable: r, isLink: n, propNames: i } = e, o = {};
|
591
|
+
for (const s in t)
|
592
|
+
Object.prototype.hasOwnProperty.call(t, s) && (pr.has(s) || r && yr.has(s) || n && br.has(s) || (i == null ? void 0 : i.has(s)) || vr.test(s)) && (o[s] = t[s]);
|
593
|
+
return o;
|
594
|
+
}
|
595
|
+
function j(t) {
|
596
|
+
if (hr())
|
518
597
|
t.focus({
|
519
598
|
preventScroll: !0
|
520
599
|
});
|
521
600
|
else {
|
522
|
-
let e =
|
523
|
-
t.focus(),
|
601
|
+
let e = $r(t);
|
602
|
+
t.focus(), mr(e);
|
524
603
|
}
|
525
604
|
}
|
526
|
-
let
|
527
|
-
function
|
528
|
-
if (
|
529
|
-
|
605
|
+
let de = null;
|
606
|
+
function hr() {
|
607
|
+
if (de == null) {
|
608
|
+
de = !1;
|
530
609
|
try {
|
531
|
-
|
532
|
-
t.focus({
|
610
|
+
document.createElement("div").focus({
|
533
611
|
get preventScroll() {
|
534
|
-
return
|
612
|
+
return de = !0, !0;
|
535
613
|
}
|
536
614
|
});
|
537
615
|
} catch {
|
538
616
|
}
|
539
617
|
}
|
540
|
-
return
|
618
|
+
return de;
|
541
619
|
}
|
542
|
-
function
|
543
|
-
|
620
|
+
function $r(t) {
|
621
|
+
let e = t.parentNode, r = [], n = document.scrollingElement || document.documentElement;
|
622
|
+
for (; e instanceof HTMLElement && e !== n; )
|
544
623
|
(e.offsetHeight < e.scrollHeight || e.offsetWidth < e.scrollWidth) && r.push({
|
545
624
|
element: e,
|
546
625
|
scrollTop: e.scrollTop,
|
@@ -552,56 +631,139 @@ function kt(t) {
|
|
552
631
|
scrollLeft: n.scrollLeft
|
553
632
|
}), r;
|
554
633
|
}
|
555
|
-
function
|
634
|
+
function mr(t) {
|
556
635
|
for (let { element: e, scrollTop: r, scrollLeft: n } of t)
|
557
636
|
e.scrollTop = r, e.scrollLeft = n;
|
558
637
|
}
|
559
|
-
|
560
|
-
|
638
|
+
function me(t) {
|
639
|
+
var e;
|
640
|
+
return typeof window > "u" || window.navigator == null ? !1 : ((e = window.navigator.userAgentData) === null || e === void 0 ? void 0 : e.brands.some((r) => t.test(r.brand))) || t.test(window.navigator.userAgent);
|
641
|
+
}
|
642
|
+
function Oe(t) {
|
643
|
+
var e;
|
644
|
+
return typeof window < "u" && window.navigator != null ? t.test(((e = window.navigator.userAgentData) === null || e === void 0 ? void 0 : e.platform) || window.navigator.platform) : !1;
|
645
|
+
}
|
646
|
+
function J() {
|
647
|
+
return Oe(/^Mac/i);
|
648
|
+
}
|
649
|
+
function Kr() {
|
650
|
+
return Oe(/^iPhone/i);
|
651
|
+
}
|
652
|
+
function gt() {
|
653
|
+
return Oe(/^iPad/i) || J() && navigator.maxTouchPoints > 1;
|
654
|
+
}
|
655
|
+
function ze() {
|
656
|
+
return Kr() || gt();
|
657
|
+
}
|
658
|
+
function Sr() {
|
659
|
+
return J() || ze();
|
660
|
+
}
|
661
|
+
function Tr() {
|
662
|
+
return me(/AppleWebKit/i) && !wr();
|
663
|
+
}
|
664
|
+
function wr() {
|
665
|
+
return me(/Chrome/i);
|
666
|
+
}
|
667
|
+
function ht() {
|
668
|
+
return me(/Android/i);
|
669
|
+
}
|
670
|
+
function Pr() {
|
671
|
+
return me(/Firefox/i);
|
672
|
+
}
|
673
|
+
const Er = /* @__PURE__ */ Ut({
|
674
|
+
isNative: !0,
|
675
|
+
open: kr
|
676
|
+
});
|
677
|
+
function $t() {
|
678
|
+
return le(Er);
|
679
|
+
}
|
680
|
+
function Z(t, e, r = !0) {
|
681
|
+
var n, i;
|
682
|
+
let { metaKey: o, ctrlKey: s, altKey: u, shiftKey: f } = e;
|
683
|
+
Pr() && ((i = window.event) === null || i === void 0 || (n = i.type) === null || n === void 0 ? void 0 : n.startsWith("key")) && t.target === "_blank" && (J() ? o = !0 : s = !0);
|
684
|
+
let b = Tr() && J() && !gt() ? new KeyboardEvent("keydown", {
|
685
|
+
keyIdentifier: "Enter",
|
686
|
+
metaKey: o,
|
687
|
+
ctrlKey: s,
|
688
|
+
altKey: u,
|
689
|
+
shiftKey: f
|
690
|
+
}) : new MouseEvent("click", {
|
691
|
+
metaKey: o,
|
692
|
+
ctrlKey: s,
|
693
|
+
altKey: u,
|
694
|
+
shiftKey: f,
|
695
|
+
bubbles: !0,
|
696
|
+
cancelable: !0
|
697
|
+
});
|
698
|
+
Z.isOpening = r, j(t), t.dispatchEvent(b), Z.isOpening = !1;
|
699
|
+
}
|
700
|
+
Z.isOpening = !1;
|
701
|
+
function xr(t, e) {
|
702
|
+
if (t instanceof HTMLAnchorElement)
|
703
|
+
e(t);
|
704
|
+
else if (t.hasAttribute("data-href")) {
|
705
|
+
let r = document.createElement("a");
|
706
|
+
r.href = t.getAttribute("data-href"), t.hasAttribute("data-target") && (r.target = t.getAttribute("data-target")), t.hasAttribute("data-rel") && (r.rel = t.getAttribute("data-rel")), t.hasAttribute("data-download") && (r.download = t.getAttribute("data-download")), t.hasAttribute("data-ping") && (r.ping = t.getAttribute("data-ping")), t.hasAttribute("data-referrer-policy") && (r.referrerPolicy = t.getAttribute("data-referrer-policy")), t.appendChild(r), e(r), t.removeChild(r);
|
707
|
+
}
|
708
|
+
}
|
709
|
+
function kr(t, e) {
|
710
|
+
xr(t, (r) => Z(r, e));
|
711
|
+
}
|
712
|
+
let re = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Set();
|
713
|
+
function Xe() {
|
561
714
|
if (typeof window > "u")
|
562
715
|
return;
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
716
|
+
function t(n) {
|
717
|
+
return "propertyName" in n;
|
718
|
+
}
|
719
|
+
let e = (n) => {
|
720
|
+
if (!t(n) || !n.target)
|
721
|
+
return;
|
722
|
+
let i = re.get(n.target);
|
723
|
+
i || (i = /* @__PURE__ */ new Set(), re.set(n.target, i), n.target.addEventListener("transitioncancel", r, {
|
724
|
+
once: !0
|
725
|
+
})), i.add(n.propertyName);
|
726
|
+
}, r = (n) => {
|
727
|
+
if (!t(n) || !n.target)
|
728
|
+
return;
|
729
|
+
let i = re.get(n.target);
|
730
|
+
if (!!i && (i.delete(n.propertyName), i.size === 0 && (n.target.removeEventListener("transitioncancel", r), re.delete(n.target)), re.size === 0)) {
|
731
|
+
for (let o of ke)
|
732
|
+
o();
|
733
|
+
ke.clear();
|
572
734
|
}
|
573
735
|
};
|
574
|
-
document.body.addEventListener("transitionrun",
|
736
|
+
document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", r);
|
575
737
|
}
|
576
|
-
typeof document < "u" && (document.readyState !== "loading" ?
|
577
|
-
function
|
738
|
+
typeof document < "u" && (document.readyState !== "loading" ? Xe() : document.addEventListener("DOMContentLoaded", Xe));
|
739
|
+
function mt(t) {
|
578
740
|
requestAnimationFrame(() => {
|
579
|
-
|
741
|
+
re.size === 0 ? t() : ke.add(t);
|
580
742
|
});
|
581
743
|
}
|
582
|
-
function
|
583
|
-
let t =
|
584
|
-
let
|
585
|
-
t.current.delete(
|
586
|
-
} :
|
587
|
-
t.current.set(
|
588
|
-
type:
|
744
|
+
function Kt() {
|
745
|
+
let t = k(/* @__PURE__ */ new Map()), e = q((i, o, s, u) => {
|
746
|
+
let f = u != null && u.once ? (...b) => {
|
747
|
+
t.current.delete(s), s(...b);
|
748
|
+
} : s;
|
749
|
+
t.current.set(s, {
|
750
|
+
type: o,
|
589
751
|
eventTarget: i,
|
590
|
-
fn:
|
591
|
-
options:
|
592
|
-
}), i.addEventListener(
|
593
|
-
}, []), r =
|
594
|
-
var
|
595
|
-
let
|
596
|
-
i.removeEventListener(
|
597
|
-
}, []), n =
|
598
|
-
t.current.forEach((i,
|
599
|
-
r(i.eventTarget, i.type,
|
752
|
+
fn: f,
|
753
|
+
options: u
|
754
|
+
}), i.addEventListener(o, s, u);
|
755
|
+
}, []), r = q((i, o, s, u) => {
|
756
|
+
var f;
|
757
|
+
let b = ((f = t.current.get(s)) === null || f === void 0 ? void 0 : f.fn) || s;
|
758
|
+
i.removeEventListener(o, b, u), t.current.delete(s);
|
759
|
+
}, []), n = q(() => {
|
760
|
+
t.current.forEach((i, o) => {
|
761
|
+
r(i.eventTarget, i.type, o, i.options);
|
600
762
|
});
|
601
763
|
}, [
|
602
764
|
r
|
603
765
|
]);
|
604
|
-
return
|
766
|
+
return z(() => n, [
|
605
767
|
n
|
606
768
|
]), {
|
607
769
|
addGlobalListener: e,
|
@@ -609,12 +771,12 @@ function Ye() {
|
|
609
771
|
removeAllGlobalListeners: n
|
610
772
|
};
|
611
773
|
}
|
612
|
-
function
|
774
|
+
function St(t, e) {
|
613
775
|
let { id: r, "aria-label": n, "aria-labelledby": i } = t;
|
614
|
-
return r =
|
776
|
+
return r = bt(r), i && n ? i = [
|
615
777
|
.../* @__PURE__ */ new Set([
|
616
|
-
|
617
|
-
|
778
|
+
r,
|
779
|
+
...i.trim().split(/\s+/)
|
618
780
|
])
|
619
781
|
].join(" ") : i && (i = i.trim().split(/\s+/).join(" ")), !n && !i && e && (n = e), {
|
620
782
|
id: r,
|
@@ -622,38 +784,45 @@ function qe(t, e) {
|
|
622
784
|
"aria-labelledby": i
|
623
785
|
};
|
624
786
|
}
|
625
|
-
function
|
626
|
-
|
787
|
+
function Lr(t, e) {
|
788
|
+
ce(() => {
|
627
789
|
if (t && t.ref && e)
|
628
790
|
return t.ref.current = e.current, () => {
|
629
|
-
t.ref.current = null;
|
791
|
+
t.ref && (t.ref.current = null);
|
630
792
|
};
|
631
|
-
}
|
632
|
-
t,
|
633
|
-
e
|
634
|
-
]);
|
793
|
+
});
|
635
794
|
}
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
return
|
795
|
+
function qe(t, e) {
|
796
|
+
let r = t;
|
797
|
+
for (Ye(r, e) && (r = r.parentElement); r && !Ye(r, e); )
|
798
|
+
r = r.parentElement;
|
799
|
+
return r || document.scrollingElement || document.documentElement;
|
800
|
+
}
|
801
|
+
function Ye(t, e) {
|
802
|
+
let r = window.getComputedStyle(t), n = /(auto|scroll)/.test(r.overflow + r.overflowX + r.overflowY);
|
803
|
+
return n && e && (n = t.scrollHeight !== t.clientHeight || t.scrollWidth !== t.clientWidth), n;
|
804
|
+
}
|
805
|
+
let Mr = 0;
|
806
|
+
const Pe = /* @__PURE__ */ new Map();
|
807
|
+
function Cr(t) {
|
808
|
+
let [e, r] = R();
|
809
|
+
return ce(() => {
|
641
810
|
if (!t)
|
642
811
|
return;
|
643
|
-
let n =
|
812
|
+
let n = Pe.get(t);
|
644
813
|
if (n)
|
645
814
|
r(n.element.id);
|
646
815
|
else {
|
647
|
-
let i = `react-aria-description-${
|
816
|
+
let i = `react-aria-description-${Mr++}`;
|
648
817
|
r(i);
|
649
|
-
let
|
650
|
-
|
818
|
+
let o = document.createElement("div");
|
819
|
+
o.id = i, o.style.display = "none", o.textContent = t, document.body.appendChild(o), n = {
|
651
820
|
refCount: 0,
|
652
|
-
element:
|
653
|
-
},
|
821
|
+
element: o
|
822
|
+
}, Pe.set(t, n);
|
654
823
|
}
|
655
824
|
return n.refCount++, () => {
|
656
|
-
--n.refCount === 0 && (n.element.remove(),
|
825
|
+
n && --n.refCount === 0 && (n.element.remove(), Pe.delete(t));
|
657
826
|
};
|
658
827
|
}, [
|
659
828
|
t
|
@@ -661,55 +830,28 @@ function Ft(t) {
|
|
661
830
|
"aria-describedby": t ? e : void 0
|
662
831
|
};
|
663
832
|
}
|
664
|
-
function
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
function he(t) {
|
669
|
-
var e;
|
670
|
-
return typeof window < "u" && window.navigator != null ? t.test(((e = window.navigator.userAgentData) === null || e === void 0 ? void 0 : e.platform) || window.navigator.platform) : !1;
|
671
|
-
}
|
672
|
-
function le() {
|
673
|
-
return he(/^Mac/i);
|
674
|
-
}
|
675
|
-
function At() {
|
676
|
-
return he(/^iPhone/i);
|
677
|
-
}
|
678
|
-
function Ot() {
|
679
|
-
return he(/^iPad/i) || le() && navigator.maxTouchPoints > 1;
|
680
|
-
}
|
681
|
-
function ve() {
|
682
|
-
return At() || Ot();
|
683
|
-
}
|
684
|
-
function Rt() {
|
685
|
-
return le() || ve();
|
686
|
-
}
|
687
|
-
function Nt() {
|
688
|
-
return zt(/Android/i);
|
689
|
-
}
|
690
|
-
function Bt(t, e, r, n) {
|
691
|
-
let i = E(r);
|
692
|
-
i.current = r;
|
693
|
-
let a = r == null;
|
694
|
-
A(() => {
|
695
|
-
if (a)
|
833
|
+
function Ir(t, e, r, n) {
|
834
|
+
let i = te(r), o = r == null;
|
835
|
+
z(() => {
|
836
|
+
if (o || !t.current)
|
696
837
|
return;
|
697
|
-
let
|
698
|
-
return
|
699
|
-
|
838
|
+
let s = t.current;
|
839
|
+
return s.addEventListener(e, i, n), () => {
|
840
|
+
s.removeEventListener(e, i, n);
|
700
841
|
};
|
701
842
|
}, [
|
702
843
|
t,
|
703
844
|
e,
|
704
845
|
n,
|
705
|
-
|
846
|
+
o,
|
847
|
+
i
|
706
848
|
]);
|
707
849
|
}
|
708
|
-
function
|
709
|
-
let r =
|
710
|
-
r <=
|
850
|
+
function Tt(t, e) {
|
851
|
+
let r = Je(t, e, "left"), n = Je(t, e, "top"), i = e.offsetWidth, o = e.offsetHeight, s = t.scrollLeft, u = t.scrollTop, { borderTopWidth: f, borderLeftWidth: b } = getComputedStyle(t), v = t.scrollLeft + parseInt(b, 10), T = t.scrollTop + parseInt(f, 10), h = v + t.clientWidth, g = T + t.clientHeight;
|
852
|
+
r <= s ? s = r - parseInt(b, 10) : r + i > h && (s += r + i - h), n <= T ? u = n - parseInt(f, 10) : n + o > g && (u += n + o - g), t.scrollLeft = s, t.scrollTop = u;
|
711
853
|
}
|
712
|
-
function
|
854
|
+
function Je(t, e, r) {
|
713
855
|
const n = r === "left" ? "offsetLeft" : "offsetTop";
|
714
856
|
let i = 0;
|
715
857
|
for (; e.offsetParent && (i += e[n], e.offsetParent !== t); ) {
|
@@ -721,238 +863,368 @@ function Le(t, e, r) {
|
|
721
863
|
}
|
722
864
|
return i;
|
723
865
|
}
|
724
|
-
function
|
725
|
-
|
866
|
+
function Ze(t, e) {
|
867
|
+
if (document.contains(t)) {
|
868
|
+
let s = document.scrollingElement || document.documentElement;
|
869
|
+
if (window.getComputedStyle(s).overflow === "hidden") {
|
870
|
+
let f = qe(t);
|
871
|
+
for (; t && f && t !== s && f !== s; )
|
872
|
+
Tt(f, t), t = f, f = qe(t);
|
873
|
+
} else {
|
874
|
+
var r;
|
875
|
+
let { left: f, top: b } = t.getBoundingClientRect();
|
876
|
+
t == null || (r = t.scrollIntoView) === null || r === void 0 || r.call(t, {
|
877
|
+
block: "nearest"
|
878
|
+
});
|
879
|
+
let { left: v, top: T } = t.getBoundingClientRect();
|
880
|
+
if (Math.abs(f - v) > 1 || Math.abs(b - T) > 1) {
|
881
|
+
var n, i, o;
|
882
|
+
e == null || (i = e.containingElement) === null || i === void 0 || (n = i.scrollIntoView) === null || n === void 0 || n.call(i, {
|
883
|
+
block: "center",
|
884
|
+
inline: "center"
|
885
|
+
}), (o = t.scrollIntoView) === null || o === void 0 || o.call(t, {
|
886
|
+
block: "nearest"
|
887
|
+
});
|
888
|
+
}
|
889
|
+
}
|
890
|
+
}
|
891
|
+
}
|
892
|
+
function Le(t) {
|
893
|
+
return t.mozInputSource === 0 && t.isTrusted ? !0 : ht() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
|
894
|
+
}
|
895
|
+
function Dr(t) {
|
896
|
+
return !ht() && t.width === 0 && t.height === 0 || t.width === 1 && t.height === 1 && t.pressure === 0 && t.detail === 0 && t.pointerType === "mouse";
|
897
|
+
}
|
898
|
+
function Ar(t, e) {
|
899
|
+
return e.get ? e.get.call(t) : e.value;
|
726
900
|
}
|
727
|
-
function
|
728
|
-
|
901
|
+
function wt(t, e, r) {
|
902
|
+
if (!e.has(t))
|
903
|
+
throw new TypeError("attempted to " + r + " private field on non-instance");
|
904
|
+
return e.get(t);
|
729
905
|
}
|
730
|
-
|
731
|
-
|
732
|
-
|
906
|
+
function Fr(t, e) {
|
907
|
+
var r = wt(t, e, "get");
|
908
|
+
return Ar(t, r);
|
733
909
|
}
|
734
|
-
function
|
735
|
-
if (
|
736
|
-
|
910
|
+
function Or(t, e) {
|
911
|
+
if (e.has(t))
|
912
|
+
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
913
|
+
}
|
914
|
+
function zr(t, e, r) {
|
915
|
+
Or(t, e), e.set(t, r);
|
916
|
+
}
|
917
|
+
function Nr(t, e, r) {
|
918
|
+
if (e.set)
|
919
|
+
e.set.call(t, r);
|
920
|
+
else {
|
921
|
+
if (!e.writable)
|
922
|
+
throw new TypeError("attempted to set read only private field");
|
923
|
+
e.value = r;
|
924
|
+
}
|
925
|
+
}
|
926
|
+
function Qe(t, e, r) {
|
927
|
+
var n = wt(t, e, "set");
|
928
|
+
return Nr(t, n, r), r;
|
929
|
+
}
|
930
|
+
let ie = "default", Me = "", be = /* @__PURE__ */ new WeakMap();
|
931
|
+
function _e(t) {
|
932
|
+
if (ze()) {
|
933
|
+
if (ie === "default") {
|
934
|
+
const e = D(t);
|
935
|
+
Me = e.documentElement.style.webkitUserSelect, e.documentElement.style.webkitUserSelect = "none";
|
936
|
+
}
|
937
|
+
ie = "disabled";
|
938
|
+
} else
|
939
|
+
(t instanceof HTMLElement || t instanceof SVGElement) && (be.set(t, t.style.userSelect), t.style.userSelect = "none");
|
940
|
+
}
|
941
|
+
function fe(t) {
|
942
|
+
if (ze()) {
|
943
|
+
if (ie !== "disabled")
|
737
944
|
return;
|
738
|
-
|
739
|
-
|
740
|
-
|
945
|
+
ie = "restoring", setTimeout(() => {
|
946
|
+
mt(() => {
|
947
|
+
if (ie === "restoring") {
|
948
|
+
const e = D(t);
|
949
|
+
e.documentElement.style.webkitUserSelect === "none" && (e.documentElement.style.webkitUserSelect = Me || ""), Me = "", ie = "default";
|
950
|
+
}
|
741
951
|
});
|
742
952
|
}, 300);
|
743
|
-
} else if ((t instanceof HTMLElement || t instanceof SVGElement) && t &&
|
744
|
-
let e =
|
745
|
-
t.style.userSelect === "none" && (t.style.userSelect = e), t.getAttribute("style") === "" && t.removeAttribute("style"),
|
953
|
+
} else if ((t instanceof HTMLElement || t instanceof SVGElement) && t && be.has(t)) {
|
954
|
+
let e = be.get(t);
|
955
|
+
t.style.userSelect === "none" && (t.style.userSelect = e), t.getAttribute("style") === "" && t.removeAttribute("style"), be.delete(t);
|
746
956
|
}
|
747
957
|
}
|
748
|
-
const
|
749
|
-
|
750
|
-
|
751
|
-
|
958
|
+
const Pt = U.createContext({
|
959
|
+
register: () => {
|
960
|
+
}
|
961
|
+
});
|
962
|
+
Pt.displayName = "PressResponderContext";
|
963
|
+
function Br(t) {
|
964
|
+
let e = le(Pt);
|
752
965
|
if (e) {
|
753
966
|
let { register: r, ...n } = e;
|
754
|
-
t =
|
967
|
+
t = G(n, t), r();
|
968
|
+
}
|
969
|
+
return Lr(e, t.ref), t;
|
970
|
+
}
|
971
|
+
var pe = /* @__PURE__ */ new WeakMap();
|
972
|
+
class ye {
|
973
|
+
continuePropagation() {
|
974
|
+
Qe(this, pe, !1);
|
975
|
+
}
|
976
|
+
get shouldStopPropagation() {
|
977
|
+
return Fr(this, pe);
|
978
|
+
}
|
979
|
+
constructor(e, r, n) {
|
980
|
+
zr(this, pe, {
|
981
|
+
writable: !0,
|
982
|
+
value: void 0
|
983
|
+
}), Qe(this, pe, !0), this.type = e, this.pointerType = r, this.target = n.currentTarget, this.shiftKey = n.shiftKey, this.metaKey = n.metaKey, this.ctrlKey = n.ctrlKey, this.altKey = n.altKey;
|
755
984
|
}
|
756
|
-
return Dt(e, t.ref), t;
|
757
985
|
}
|
758
|
-
|
986
|
+
const et = Symbol("linkClicked");
|
987
|
+
function Et(t) {
|
759
988
|
let {
|
760
989
|
onPress: e,
|
761
990
|
onPressChange: r,
|
762
991
|
onPressStart: n,
|
763
992
|
onPressEnd: i,
|
764
|
-
onPressUp:
|
765
|
-
isDisabled:
|
766
|
-
isPressed:
|
767
|
-
preventFocusOnPress:
|
768
|
-
shouldCancelOnPointerExit:
|
769
|
-
allowTextSelectionOnPress:
|
770
|
-
ref:
|
771
|
-
...
|
772
|
-
} =
|
773
|
-
b.current = {
|
774
|
-
onPress: e,
|
775
|
-
onPressChange: r,
|
776
|
-
onPressStart: n,
|
777
|
-
onPressEnd: i,
|
778
|
-
onPressUp: a,
|
779
|
-
isDisabled: l,
|
780
|
-
shouldCancelOnPointerExit: g
|
781
|
-
};
|
782
|
-
let [w, S] = F(!1), P = E({
|
993
|
+
onPressUp: o,
|
994
|
+
isDisabled: s,
|
995
|
+
isPressed: u,
|
996
|
+
preventFocusOnPress: f,
|
997
|
+
shouldCancelOnPointerExit: b,
|
998
|
+
allowTextSelectionOnPress: v,
|
999
|
+
ref: T,
|
1000
|
+
...h
|
1001
|
+
} = Br(t), [g, L] = R(!1), P = k({
|
783
1002
|
isPressed: !1,
|
784
1003
|
ignoreEmulatedMouseEvents: !1,
|
785
1004
|
ignoreClickAfterPress: !1,
|
786
1005
|
didFirePressStart: !1,
|
1006
|
+
isTriggeringEvent: !1,
|
787
1007
|
activePointerId: null,
|
788
1008
|
target: null,
|
789
1009
|
isOverTarget: !1,
|
790
1010
|
pointerType: null
|
791
|
-
}), { addGlobalListener:
|
792
|
-
let
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
1011
|
+
}), { addGlobalListener: K, removeAllGlobalListeners: M } = Kt(), x = te((l, $) => {
|
1012
|
+
let p = P.current;
|
1013
|
+
if (s || p.didFirePressStart)
|
1014
|
+
return !1;
|
1015
|
+
let d = !0;
|
1016
|
+
if (p.isTriggeringEvent = !0, n) {
|
1017
|
+
let S = new ye("pressstart", $, l);
|
1018
|
+
n(S), d = S.shouldStopPropagation;
|
1019
|
+
}
|
1020
|
+
return r && r(!0), p.isTriggeringEvent = !1, p.didFirePressStart = !0, L(!0), d;
|
1021
|
+
}), E = te((l, $, p = !0) => {
|
1022
|
+
let d = P.current;
|
1023
|
+
if (!d.didFirePressStart)
|
1024
|
+
return !1;
|
1025
|
+
d.ignoreClickAfterPress = !0, d.didFirePressStart = !1, d.isTriggeringEvent = !0;
|
1026
|
+
let S = !0;
|
1027
|
+
if (i) {
|
1028
|
+
let a = new ye("pressend", $, l);
|
1029
|
+
i(a), S = a.shouldStopPropagation;
|
1030
|
+
}
|
1031
|
+
if (r && r(!1), L(!1), e && p && !s) {
|
1032
|
+
let a = new ye("press", $, l);
|
1033
|
+
e(a), S && (S = a.shouldStopPropagation);
|
1034
|
+
}
|
1035
|
+
return d.isTriggeringEvent = !1, S;
|
1036
|
+
}), C = te((l, $) => {
|
1037
|
+
let p = P.current;
|
1038
|
+
if (s)
|
1039
|
+
return !1;
|
1040
|
+
if (o) {
|
1041
|
+
p.isTriggeringEvent = !0;
|
1042
|
+
let d = new ye("pressup", $, l);
|
1043
|
+
return o(d), p.isTriggeringEvent = !1, d.shouldStopPropagation;
|
1044
|
+
}
|
1045
|
+
return !0;
|
1046
|
+
}), I = te((l) => {
|
1047
|
+
let $ = P.current;
|
1048
|
+
$.isPressed && $.target && ($.isOverTarget && $.pointerType != null && E(H($.target, l), $.pointerType, !1), $.isPressed = !1, $.isOverTarget = !1, $.activePointerId = null, $.pointerType = null, M(), v || fe($.target));
|
1049
|
+
}), A = te((l) => {
|
1050
|
+
b && I(l);
|
1051
|
+
}), W = V(() => {
|
1052
|
+
let l = P.current, $ = {
|
1053
|
+
onKeyDown(d) {
|
1054
|
+
if (Ee(d.nativeEvent, d.currentTarget) && d.currentTarget.contains(d.target)) {
|
1055
|
+
var S;
|
1056
|
+
rt(d.target, d.key) && d.preventDefault();
|
1057
|
+
let a = !0;
|
1058
|
+
if (!l.isPressed && !d.repeat) {
|
1059
|
+
l.target = d.currentTarget, l.isPressed = !0, a = x(d, "keyboard");
|
1060
|
+
let c = d.currentTarget, w = (F) => {
|
1061
|
+
Ee(F, c) && !F.repeat && c.contains(F.target) && l.target && C(H(l.target, F), "keyboard");
|
1062
|
+
};
|
1063
|
+
K(D(d.currentTarget), "keyup", vt(w, p), !0);
|
1064
|
+
}
|
1065
|
+
a && d.stopPropagation(), d.metaKey && J() && ((S = l.metaKeyEvents) === null || S === void 0 || S.set(d.key, d.nativeEvent));
|
1066
|
+
} else
|
1067
|
+
d.key === "Meta" && (l.metaKeyEvents = /* @__PURE__ */ new Map());
|
841
1068
|
},
|
842
|
-
onClick(
|
843
|
-
|
1069
|
+
onClick(d) {
|
1070
|
+
if (!(d && !d.currentTarget.contains(d.target)) && d && d.button === 0 && !l.isTriggeringEvent && !Z.isOpening) {
|
1071
|
+
let S = !0;
|
1072
|
+
if (s && d.preventDefault(), !l.ignoreClickAfterPress && !l.ignoreEmulatedMouseEvents && !l.isPressed && (l.pointerType === "virtual" || Le(d.nativeEvent))) {
|
1073
|
+
!s && !f && j(d.currentTarget);
|
1074
|
+
let a = x(d, "virtual"), c = C(d, "virtual"), w = E(d, "virtual");
|
1075
|
+
S = a && c && w;
|
1076
|
+
}
|
1077
|
+
l.ignoreEmulatedMouseEvents = !1, l.ignoreClickAfterPress = !1, S && d.stopPropagation();
|
1078
|
+
}
|
844
1079
|
}
|
845
|
-
},
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
1080
|
+
}, p = (d) => {
|
1081
|
+
var S;
|
1082
|
+
if (l.isPressed && l.target && Ee(d, l.target)) {
|
1083
|
+
var a;
|
1084
|
+
rt(d.target, d.key) && d.preventDefault();
|
1085
|
+
let w = d.target;
|
1086
|
+
E(H(l.target, d), "keyboard", l.target.contains(w)), M(), d.key !== "Enter" && Ne(l.target) && l.target.contains(w) && !d[et] && (d[et] = !0, Z(l.target, d, !1)), l.isPressed = !1, (a = l.metaKeyEvents) === null || a === void 0 || a.delete(d.key);
|
1087
|
+
} else if (d.key === "Meta" && ((S = l.metaKeyEvents) === null || S === void 0 ? void 0 : S.size)) {
|
1088
|
+
var c;
|
1089
|
+
let w = l.metaKeyEvents;
|
1090
|
+
l.metaKeyEvents = void 0;
|
1091
|
+
for (let F of w.values())
|
1092
|
+
(c = l.target) === null || c === void 0 || c.dispatchEvent(new KeyboardEvent("keyup", F));
|
850
1093
|
}
|
851
1094
|
};
|
852
1095
|
if (typeof PointerEvent < "u") {
|
853
|
-
|
854
|
-
if (
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
ce(d.currentTarget) && d.preventDefault(), s.pointerType = d.pointerType, d.stopPropagation(), s.isPressed || (s.isPressed = !0, s.isOverTarget = !0, s.activePointerId = d.pointerId, s.target = d.currentTarget, !l && !u && N(d.currentTarget), h || ke(s.target), I(d, s.pointerType), x(document, "pointermove", c, !1), x(document, "pointerup", p, !1), x(document, "pointercancel", o, !1));
|
1096
|
+
$.onPointerDown = (c) => {
|
1097
|
+
if (c.button !== 0 || !c.currentTarget.contains(c.target))
|
1098
|
+
return;
|
1099
|
+
if (Dr(c.nativeEvent)) {
|
1100
|
+
l.pointerType = "virtual";
|
1101
|
+
return;
|
860
1102
|
}
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
1103
|
+
xe(c.currentTarget) && c.preventDefault(), l.pointerType = c.pointerType;
|
1104
|
+
let w = !0;
|
1105
|
+
l.isPressed || (l.isPressed = !0, l.isOverTarget = !0, l.activePointerId = c.pointerId, l.target = c.currentTarget, !s && !f && j(c.currentTarget), v || _e(l.target), w = x(c, l.pointerType), K(D(c.currentTarget), "pointermove", d, !1), K(D(c.currentTarget), "pointerup", S, !1), K(D(c.currentTarget), "pointercancel", a, !1)), w && c.stopPropagation();
|
1106
|
+
}, $.onMouseDown = (c) => {
|
1107
|
+
!c.currentTarget.contains(c.target) || c.button === 0 && (xe(c.currentTarget) && c.preventDefault(), c.stopPropagation());
|
1108
|
+
}, $.onPointerUp = (c) => {
|
1109
|
+
!c.currentTarget.contains(c.target) || l.pointerType === "virtual" || c.button === 0 && ee(c, c.currentTarget) && C(c, l.pointerType || c.pointerType);
|
865
1110
|
};
|
866
|
-
let
|
867
|
-
|
868
|
-
},
|
869
|
-
|
870
|
-
},
|
871
|
-
|
1111
|
+
let d = (c) => {
|
1112
|
+
c.pointerId === l.activePointerId && (l.target && ee(c, l.target) ? !l.isOverTarget && l.pointerType != null && (l.isOverTarget = !0, x(H(l.target, c), l.pointerType)) : l.target && l.isOverTarget && l.pointerType != null && (l.isOverTarget = !1, E(H(l.target, c), l.pointerType, !1), A(c)));
|
1113
|
+
}, S = (c) => {
|
1114
|
+
c.pointerId === l.activePointerId && l.isPressed && c.button === 0 && l.target && (ee(c, l.target) && l.pointerType != null ? E(H(l.target, c), l.pointerType) : l.isOverTarget && l.pointerType != null && E(H(l.target, c), l.pointerType, !1), l.isPressed = !1, l.isOverTarget = !1, l.activePointerId = null, l.pointerType = null, M(), v || fe(l.target));
|
1115
|
+
}, a = (c) => {
|
1116
|
+
I(c);
|
872
1117
|
};
|
873
|
-
|
874
|
-
!
|
1118
|
+
$.onDragStart = (c) => {
|
1119
|
+
!c.currentTarget.contains(c.target) || I(c);
|
875
1120
|
};
|
876
1121
|
} else {
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
!
|
1122
|
+
$.onMouseDown = (a) => {
|
1123
|
+
if (a.button !== 0 || !a.currentTarget.contains(a.target))
|
1124
|
+
return;
|
1125
|
+
if (xe(a.currentTarget) && a.preventDefault(), l.ignoreEmulatedMouseEvents) {
|
1126
|
+
a.stopPropagation();
|
1127
|
+
return;
|
1128
|
+
}
|
1129
|
+
l.isPressed = !0, l.isOverTarget = !0, l.target = a.currentTarget, l.pointerType = Le(a.nativeEvent) ? "virtual" : "mouse", !s && !f && j(a.currentTarget), x(a, l.pointerType) && a.stopPropagation(), K(D(a.currentTarget), "mouseup", d, !1);
|
1130
|
+
}, $.onMouseEnter = (a) => {
|
1131
|
+
if (!a.currentTarget.contains(a.target))
|
1132
|
+
return;
|
1133
|
+
let c = !0;
|
1134
|
+
l.isPressed && !l.ignoreEmulatedMouseEvents && l.pointerType != null && (l.isOverTarget = !0, c = x(a, l.pointerType)), c && a.stopPropagation();
|
1135
|
+
}, $.onMouseLeave = (a) => {
|
1136
|
+
if (!a.currentTarget.contains(a.target))
|
1137
|
+
return;
|
1138
|
+
let c = !0;
|
1139
|
+
l.isPressed && !l.ignoreEmulatedMouseEvents && l.pointerType != null && (l.isOverTarget = !1, c = E(a, l.pointerType, !1), A(a)), c && a.stopPropagation();
|
1140
|
+
}, $.onMouseUp = (a) => {
|
1141
|
+
!a.currentTarget.contains(a.target) || !l.ignoreEmulatedMouseEvents && a.button === 0 && C(a, l.pointerType || "mouse");
|
885
1142
|
};
|
886
|
-
let
|
887
|
-
if (
|
888
|
-
if (
|
889
|
-
|
1143
|
+
let d = (a) => {
|
1144
|
+
if (a.button === 0) {
|
1145
|
+
if (l.isPressed = !1, M(), l.ignoreEmulatedMouseEvents) {
|
1146
|
+
l.ignoreEmulatedMouseEvents = !1;
|
890
1147
|
return;
|
891
1148
|
}
|
892
|
-
|
1149
|
+
l.target && ee(a, l.target) && l.pointerType != null ? E(H(l.target, a), l.pointerType) : l.target && l.isOverTarget && l.pointerType != null && E(H(l.target, a), l.pointerType, !1), l.isOverTarget = !1;
|
893
1150
|
}
|
894
1151
|
};
|
895
|
-
|
896
|
-
if (!
|
1152
|
+
$.onTouchStart = (a) => {
|
1153
|
+
if (!a.currentTarget.contains(a.target))
|
897
1154
|
return;
|
898
|
-
|
899
|
-
|
900
|
-
!d || (s.activePointerId = d.identifier, s.ignoreEmulatedMouseEvents = !0, s.isOverTarget = !0, s.isPressed = !0, s.target = o.currentTarget, s.pointerType = "touch", !l && !u && N(o.currentTarget), h || ke(s.target), I(o, s.pointerType), x(window, "scroll", p, !0));
|
901
|
-
}, T.onTouchMove = (o) => {
|
902
|
-
if (!o.currentTarget.contains(o.target) || (o.stopPropagation(), !s.isPressed))
|
1155
|
+
let c = Rr(a.nativeEvent);
|
1156
|
+
if (!c)
|
903
1157
|
return;
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
if (!o.currentTarget.contains(o.target) || (o.stopPropagation(), !s.isPressed))
|
1158
|
+
l.activePointerId = c.identifier, l.ignoreEmulatedMouseEvents = !0, l.isOverTarget = !0, l.isPressed = !0, l.target = a.currentTarget, l.pointerType = "touch", !s && !f && j(a.currentTarget), v || _e(l.target), x(a, l.pointerType) && a.stopPropagation(), K(Y(a.currentTarget), "scroll", S, !0);
|
1159
|
+
}, $.onTouchMove = (a) => {
|
1160
|
+
if (!a.currentTarget.contains(a.target))
|
908
1161
|
return;
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
1162
|
+
if (!l.isPressed) {
|
1163
|
+
a.stopPropagation();
|
1164
|
+
return;
|
1165
|
+
}
|
1166
|
+
let c = tt(a.nativeEvent, l.activePointerId), w = !0;
|
1167
|
+
c && ee(c, a.currentTarget) ? !l.isOverTarget && l.pointerType != null && (l.isOverTarget = !0, w = x(a, l.pointerType)) : l.isOverTarget && l.pointerType != null && (l.isOverTarget = !1, w = E(a, l.pointerType, !1), A(a)), w && a.stopPropagation();
|
1168
|
+
}, $.onTouchEnd = (a) => {
|
1169
|
+
if (!a.currentTarget.contains(a.target))
|
1170
|
+
return;
|
1171
|
+
if (!l.isPressed) {
|
1172
|
+
a.stopPropagation();
|
1173
|
+
return;
|
1174
|
+
}
|
1175
|
+
let c = tt(a.nativeEvent, l.activePointerId), w = !0;
|
1176
|
+
c && ee(c, a.currentTarget) && l.pointerType != null ? (C(a, l.pointerType), w = E(a, l.pointerType)) : l.isOverTarget && l.pointerType != null && (w = E(a, l.pointerType, !1)), w && a.stopPropagation(), l.isPressed = !1, l.activePointerId = null, l.isOverTarget = !1, l.ignoreEmulatedMouseEvents = !0, l.target && !v && fe(l.target), M();
|
1177
|
+
}, $.onTouchCancel = (a) => {
|
1178
|
+
!a.currentTarget.contains(a.target) || (a.stopPropagation(), l.isPressed && I(a));
|
913
1179
|
};
|
914
|
-
let
|
915
|
-
|
916
|
-
currentTarget:
|
1180
|
+
let S = (a) => {
|
1181
|
+
l.isPressed && a.target.contains(l.target) && I({
|
1182
|
+
currentTarget: l.target,
|
917
1183
|
shiftKey: !1,
|
918
1184
|
ctrlKey: !1,
|
919
1185
|
metaKey: !1,
|
920
1186
|
altKey: !1
|
921
1187
|
});
|
922
1188
|
};
|
923
|
-
|
924
|
-
!
|
1189
|
+
$.onDragStart = (a) => {
|
1190
|
+
!a.currentTarget.contains(a.target) || I(a);
|
925
1191
|
};
|
926
1192
|
}
|
927
|
-
return
|
1193
|
+
return $;
|
928
1194
|
}, [
|
1195
|
+
K,
|
1196
|
+
s,
|
1197
|
+
f,
|
1198
|
+
M,
|
1199
|
+
v,
|
1200
|
+
I,
|
1201
|
+
A,
|
1202
|
+
E,
|
929
1203
|
x,
|
930
|
-
|
931
|
-
u,
|
932
|
-
L,
|
933
|
-
h
|
1204
|
+
C
|
934
1205
|
]);
|
935
|
-
return
|
936
|
-
|
1206
|
+
return z(() => () => {
|
1207
|
+
var l;
|
1208
|
+
v || fe((l = P.current.target) !== null && l !== void 0 ? l : void 0);
|
937
1209
|
}, [
|
938
|
-
|
1210
|
+
v
|
939
1211
|
]), {
|
940
|
-
isPressed:
|
941
|
-
pressProps:
|
1212
|
+
isPressed: u || g,
|
1213
|
+
pressProps: G(h, W)
|
942
1214
|
};
|
943
1215
|
}
|
944
|
-
function
|
1216
|
+
function Ne(t) {
|
945
1217
|
return t.tagName === "A" && t.hasAttribute("href");
|
946
1218
|
}
|
947
|
-
function
|
948
|
-
const { key: r, code: n } = t, i = e,
|
949
|
-
return (r === "Enter" || r === " " || r === "Spacebar" || n === "Space") && !(i instanceof HTMLInputElement && !
|
1219
|
+
function Ee(t, e) {
|
1220
|
+
const { key: r, code: n } = t, i = e, o = i.getAttribute("role");
|
1221
|
+
return (r === "Enter" || r === " " || r === "Spacebar" || n === "Space") && !(i instanceof Y(i).HTMLInputElement && !xt(i, r) || i instanceof Y(i).HTMLTextAreaElement || i.isContentEditable) && !((o === "link" || !o && Ne(i)) && r !== "Enter");
|
950
1222
|
}
|
951
|
-
function
|
1223
|
+
function Rr(t) {
|
952
1224
|
const { targetTouches: e } = t;
|
953
1225
|
return e.length > 0 ? e[0] : null;
|
954
1226
|
}
|
955
|
-
function
|
1227
|
+
function tt(t, e) {
|
956
1228
|
const r = t.changedTouches;
|
957
1229
|
for (let n = 0; n < r.length; n++) {
|
958
1230
|
const i = r[n];
|
@@ -961,7 +1233,7 @@ function Ie(t, e) {
|
|
961
1233
|
}
|
962
1234
|
return null;
|
963
1235
|
}
|
964
|
-
function
|
1236
|
+
function H(t, e) {
|
965
1237
|
return {
|
966
1238
|
currentTarget: t,
|
967
1239
|
shiftKey: e.shiftKey,
|
@@ -970,29 +1242,29 @@ function R(t, e) {
|
|
970
1242
|
altKey: e.altKey
|
971
1243
|
};
|
972
1244
|
}
|
973
|
-
function
|
974
|
-
let e =
|
975
|
-
return {
|
1245
|
+
function Ur(t) {
|
1246
|
+
let e = 0, r = 0;
|
1247
|
+
return t.width !== void 0 ? e = t.width / 2 : t.radiusX !== void 0 && (e = t.radiusX), t.height !== void 0 ? r = t.height / 2 : t.radiusY !== void 0 && (r = t.radiusY), {
|
976
1248
|
top: t.clientY - r,
|
977
1249
|
right: t.clientX + e,
|
978
1250
|
bottom: t.clientY + r,
|
979
1251
|
left: t.clientX - e
|
980
1252
|
};
|
981
1253
|
}
|
982
|
-
function
|
1254
|
+
function Wr(t, e) {
|
983
1255
|
return !(t.left > e.right || e.left > t.right || t.top > e.bottom || e.top > t.bottom);
|
984
1256
|
}
|
985
|
-
function
|
986
|
-
let r = e.getBoundingClientRect(), n =
|
987
|
-
return
|
1257
|
+
function ee(t, e) {
|
1258
|
+
let r = e.getBoundingClientRect(), n = Ur(t);
|
1259
|
+
return Wr(r, n);
|
988
1260
|
}
|
989
|
-
function
|
990
|
-
return !(t instanceof HTMLElement) || !t.draggable;
|
1261
|
+
function xe(t) {
|
1262
|
+
return !(t instanceof HTMLElement) || !t.hasAttribute("draggable");
|
991
1263
|
}
|
992
|
-
function
|
993
|
-
return t instanceof HTMLInputElement ? !
|
1264
|
+
function rt(t, e) {
|
1265
|
+
return t instanceof HTMLInputElement ? !xt(t, e) : t instanceof HTMLButtonElement ? t.type !== "submit" && t.type !== "reset" : !Ne(t);
|
994
1266
|
}
|
995
|
-
const
|
1267
|
+
const Hr = /* @__PURE__ */ new Set([
|
996
1268
|
"checkbox",
|
997
1269
|
"radio",
|
998
1270
|
"range",
|
@@ -1003,114 +1275,134 @@ const _t = /* @__PURE__ */ new Set([
|
|
1003
1275
|
"submit",
|
1004
1276
|
"reset"
|
1005
1277
|
]);
|
1006
|
-
function
|
1007
|
-
return t.type === "checkbox" || t.type === "radio" ? e === " " :
|
1278
|
+
function xt(t, e) {
|
1279
|
+
return t.type === "checkbox" || t.type === "radio" ? e === " " : Hr.has(t.type);
|
1008
1280
|
}
|
1009
|
-
let
|
1010
|
-
function
|
1011
|
-
for (let r of
|
1281
|
+
let ue = null, jr = /* @__PURE__ */ new Set(), se = /* @__PURE__ */ new Map(), Q = !1, Ce = !1;
|
1282
|
+
function Be(t, e) {
|
1283
|
+
for (let r of jr)
|
1012
1284
|
r(t, e);
|
1013
1285
|
}
|
1014
|
-
function
|
1015
|
-
return !(t.metaKey || !
|
1286
|
+
function Vr(t) {
|
1287
|
+
return !(t.metaKey || !J() && t.altKey || t.ctrlKey || t.key === "Control" || t.key === "Shift" || t.key === "Meta");
|
1016
1288
|
}
|
1017
|
-
function
|
1018
|
-
|
1289
|
+
function he(t) {
|
1290
|
+
Q = !0, Vr(t) && (ue = "keyboard", Be("keyboard", t));
|
1019
1291
|
}
|
1020
|
-
function
|
1021
|
-
|
1292
|
+
function O(t) {
|
1293
|
+
ue = "pointer", (t.type === "mousedown" || t.type === "pointerdown") && (Q = !0, Be("pointer", t));
|
1022
1294
|
}
|
1023
|
-
function
|
1024
|
-
|
1295
|
+
function kt(t) {
|
1296
|
+
Le(t) && (Q = !0, ue = "virtual");
|
1025
1297
|
}
|
1026
|
-
function
|
1027
|
-
t.target === window || t.target === document || (!
|
1298
|
+
function Lt(t) {
|
1299
|
+
t.target === window || t.target === document || (!Q && !Ce && (ue = "virtual", Be("virtual", t)), Q = !1, Ce = !1);
|
1028
1300
|
}
|
1029
|
-
function
|
1030
|
-
|
1301
|
+
function Mt() {
|
1302
|
+
Q = !1, Ce = !0;
|
1031
1303
|
}
|
1032
|
-
function
|
1033
|
-
if (typeof window > "u" ||
|
1304
|
+
function nt(t) {
|
1305
|
+
if (typeof window > "u" || se.get(Y(t)))
|
1034
1306
|
return;
|
1035
|
-
|
1036
|
-
HTMLElement.prototype.focus
|
1037
|
-
|
1038
|
-
|
1039
|
-
}
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1307
|
+
const e = Y(t), r = D(t);
|
1308
|
+
let n = e.HTMLElement.prototype.focus;
|
1309
|
+
e.HTMLElement.prototype.focus = function() {
|
1310
|
+
Q = !0, n.apply(this, arguments);
|
1311
|
+
}, r.addEventListener("keydown", he, !0), r.addEventListener("keyup", he, !0), r.addEventListener("click", kt, !0), e.addEventListener("focus", Lt, !0), e.addEventListener("blur", Mt, !1), typeof PointerEvent < "u" ? (r.addEventListener("pointerdown", O, !0), r.addEventListener("pointermove", O, !0), r.addEventListener("pointerup", O, !0)) : (r.addEventListener("mousedown", O, !0), r.addEventListener("mousemove", O, !0), r.addEventListener("mouseup", O, !0)), e.addEventListener("beforeunload", () => {
|
1312
|
+
Ct(t);
|
1313
|
+
}, {
|
1314
|
+
once: !0
|
1315
|
+
}), se.set(e, {
|
1316
|
+
focus: n
|
1317
|
+
});
|
1043
1318
|
}
|
1044
|
-
const
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1319
|
+
const Ct = (t, e) => {
|
1320
|
+
const r = Y(t), n = D(t);
|
1321
|
+
e && n.removeEventListener("DOMContentLoaded", e), se.has(r) && (r.HTMLElement.prototype.focus = se.get(r).focus, n.removeEventListener("keydown", he, !0), n.removeEventListener("keyup", he, !0), n.removeEventListener("click", kt, !0), r.removeEventListener("focus", Lt, !0), r.removeEventListener("blur", Mt, !1), typeof PointerEvent < "u" ? (n.removeEventListener("pointerdown", O, !0), n.removeEventListener("pointermove", O, !0), n.removeEventListener("pointerup", O, !0)) : (n.removeEventListener("mousedown", O, !0), n.removeEventListener("mousemove", O, !0), n.removeEventListener("mouseup", O, !0)), se.delete(r));
|
1322
|
+
};
|
1323
|
+
function Gr(t) {
|
1324
|
+
const e = D(t);
|
1325
|
+
let r;
|
1326
|
+
return e.readyState !== "loading" ? nt(t) : (r = () => {
|
1327
|
+
nt(t);
|
1328
|
+
}, e.addEventListener("DOMContentLoaded", r)), () => Ct(t, r);
|
1329
|
+
}
|
1330
|
+
typeof document < "u" && Gr();
|
1331
|
+
function Ie() {
|
1332
|
+
return ue;
|
1333
|
+
}
|
1334
|
+
const Xr = 500;
|
1335
|
+
function qr(t) {
|
1336
|
+
let { isDisabled: e, onLongPressStart: r, onLongPressEnd: n, onLongPress: i, threshold: o = Xr, accessibilityDescription: s } = t;
|
1337
|
+
const u = k();
|
1338
|
+
let { addGlobalListener: f, removeGlobalListener: b } = Kt(), { pressProps: v } = Et({
|
1049
1339
|
isDisabled: e,
|
1050
|
-
onPressStart(
|
1051
|
-
if ((
|
1052
|
-
...
|
1340
|
+
onPressStart(h) {
|
1341
|
+
if (h.continuePropagation(), (h.pointerType === "mouse" || h.pointerType === "touch") && (r && r({
|
1342
|
+
...h,
|
1053
1343
|
type: "longpressstart"
|
1054
|
-
}),
|
1055
|
-
|
1344
|
+
}), u.current = setTimeout(() => {
|
1345
|
+
h.target.dispatchEvent(new PointerEvent("pointercancel", {
|
1056
1346
|
bubbles: !0
|
1057
1347
|
})), i && i({
|
1058
|
-
...
|
1348
|
+
...h,
|
1059
1349
|
type: "longpress"
|
1060
|
-
}),
|
1061
|
-
},
|
1062
|
-
let
|
1063
|
-
|
1350
|
+
}), u.current = void 0;
|
1351
|
+
}, o), h.pointerType === "touch")) {
|
1352
|
+
let g = (L) => {
|
1353
|
+
L.preventDefault();
|
1064
1354
|
};
|
1065
|
-
|
1355
|
+
f(h.target, "contextmenu", g, {
|
1066
1356
|
once: !0
|
1067
|
-
}),
|
1357
|
+
}), f(window, "pointerup", () => {
|
1068
1358
|
setTimeout(() => {
|
1069
|
-
|
1359
|
+
b(h.target, "contextmenu", g);
|
1070
1360
|
}, 30);
|
1071
1361
|
}, {
|
1072
1362
|
once: !0
|
1073
1363
|
});
|
1074
1364
|
}
|
1075
1365
|
},
|
1076
|
-
onPressEnd(
|
1077
|
-
|
1078
|
-
...
|
1366
|
+
onPressEnd(h) {
|
1367
|
+
u.current && clearTimeout(u.current), n && (h.pointerType === "mouse" || h.pointerType === "touch") && n({
|
1368
|
+
...h,
|
1079
1369
|
type: "longpressend"
|
1080
1370
|
});
|
1081
1371
|
}
|
1082
|
-
}),
|
1372
|
+
}), T = Cr(i && !e ? s : void 0);
|
1083
1373
|
return {
|
1084
|
-
longPressProps:
|
1374
|
+
longPressProps: G(v, T)
|
1085
1375
|
};
|
1086
1376
|
}
|
1087
|
-
function
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1377
|
+
function De(t) {
|
1378
|
+
const e = D(t);
|
1379
|
+
if (Ie() === "virtual") {
|
1380
|
+
let r = e.activeElement;
|
1381
|
+
mt(() => {
|
1382
|
+
e.activeElement === r && t.isConnected && j(t);
|
1092
1383
|
});
|
1093
1384
|
} else
|
1094
|
-
|
1385
|
+
j(t);
|
1095
1386
|
}
|
1096
|
-
function
|
1097
|
-
|
1387
|
+
function Yr(t) {
|
1388
|
+
const e = Y(t);
|
1389
|
+
if (!(t instanceof e.HTMLElement) && !(t instanceof e.SVGElement))
|
1098
1390
|
return !1;
|
1099
|
-
let { display:
|
1100
|
-
if (
|
1101
|
-
const { getComputedStyle:
|
1102
|
-
let { display:
|
1103
|
-
|
1391
|
+
let { display: r, visibility: n } = t.style, i = r !== "none" && n !== "hidden" && n !== "collapse";
|
1392
|
+
if (i) {
|
1393
|
+
const { getComputedStyle: o } = t.ownerDocument.defaultView;
|
1394
|
+
let { display: s, visibility: u } = o(t);
|
1395
|
+
i = s !== "none" && u !== "hidden" && u !== "collapse";
|
1104
1396
|
}
|
1105
|
-
return
|
1397
|
+
return i;
|
1106
1398
|
}
|
1107
|
-
function
|
1399
|
+
function Jr(t, e) {
|
1108
1400
|
return !t.hasAttribute("hidden") && (t.nodeName === "DETAILS" && e && e.nodeName !== "SUMMARY" ? t.hasAttribute("open") : !0);
|
1109
1401
|
}
|
1110
|
-
function
|
1111
|
-
return t.nodeName !== "#comment" &&
|
1402
|
+
function It(t, e) {
|
1403
|
+
return t.nodeName !== "#comment" && Yr(t) && Jr(t, e) && (!t.parentElement || It(t.parentElement, t));
|
1112
1404
|
}
|
1113
|
-
const
|
1405
|
+
const Re = [
|
1114
1406
|
"input:not([disabled]):not([type=hidden])",
|
1115
1407
|
"select:not([disabled])",
|
1116
1408
|
"textarea:not([disabled])",
|
@@ -1124,22 +1416,22 @@ const $e = [
|
|
1124
1416
|
"audio[controls]",
|
1125
1417
|
"video[controls]",
|
1126
1418
|
"[contenteditable]"
|
1127
|
-
],
|
1128
|
-
|
1129
|
-
const
|
1130
|
-
function
|
1131
|
-
return e.some((r) => r.contains(t));
|
1419
|
+
], Zr = Re.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
1420
|
+
Re.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
1421
|
+
const Qr = Re.join(':not([hidden]):not([tabindex="-1"]),');
|
1422
|
+
function Dt(t, e) {
|
1423
|
+
return !t || !e ? !1 : e.some((r) => r.contains(t));
|
1132
1424
|
}
|
1133
|
-
function
|
1134
|
-
let n = e != null && e.tabbable ?
|
1135
|
-
acceptNode(
|
1136
|
-
var
|
1137
|
-
return !(e == null || (
|
1425
|
+
function At(t, e, r) {
|
1426
|
+
let n = e != null && e.tabbable ? Qr : Zr, i = D(t).createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
|
1427
|
+
acceptNode(o) {
|
1428
|
+
var s;
|
1429
|
+
return !(e == null || (s = e.from) === null || s === void 0) && s.contains(o) ? NodeFilter.FILTER_REJECT : o.matches(n) && It(o) && (!r || Dt(o, r)) && (!(e != null && e.accept) || e.accept(o)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
1138
1430
|
}
|
1139
1431
|
});
|
1140
1432
|
return e != null && e.from && (i.currentNode = e.from), i;
|
1141
1433
|
}
|
1142
|
-
class
|
1434
|
+
class Ue {
|
1143
1435
|
get size() {
|
1144
1436
|
return this.fastMap.size;
|
1145
1437
|
}
|
@@ -1147,50 +1439,89 @@ class Ke {
|
|
1147
1439
|
return this.fastMap.get(e);
|
1148
1440
|
}
|
1149
1441
|
addTreeNode(e, r, n) {
|
1150
|
-
let i = this.fastMap.get(r != null ? r : null)
|
1442
|
+
let i = this.fastMap.get(r != null ? r : null);
|
1443
|
+
if (!i)
|
1444
|
+
return;
|
1445
|
+
let o = new it({
|
1151
1446
|
scopeRef: e
|
1152
1447
|
});
|
1153
|
-
i.addChild(
|
1448
|
+
i.addChild(o), o.parent = i, this.fastMap.set(e, o), n && (o.nodeToRestore = n);
|
1449
|
+
}
|
1450
|
+
addNode(e) {
|
1451
|
+
this.fastMap.set(e.scopeRef, e);
|
1154
1452
|
}
|
1155
1453
|
removeTreeNode(e) {
|
1156
1454
|
if (e === null)
|
1157
1455
|
return;
|
1158
|
-
let r = this.fastMap.get(e)
|
1159
|
-
|
1160
|
-
|
1456
|
+
let r = this.fastMap.get(e);
|
1457
|
+
if (!r)
|
1458
|
+
return;
|
1459
|
+
let n = r.parent;
|
1460
|
+
for (let o of this.traverse())
|
1461
|
+
o !== r && r.nodeToRestore && o.nodeToRestore && r.scopeRef && r.scopeRef.current && Dt(o.nodeToRestore, r.scopeRef.current) && (o.nodeToRestore = r.nodeToRestore);
|
1161
1462
|
let i = r.children;
|
1162
|
-
n.removeChild(r), i.
|
1463
|
+
n && (n.removeChild(r), i.size > 0 && i.forEach((o) => n && n.addChild(o))), this.fastMap.delete(r.scopeRef);
|
1163
1464
|
}
|
1164
1465
|
*traverse(e = this.root) {
|
1165
|
-
if (e.scopeRef != null && (yield e), e.children.
|
1466
|
+
if (e.scopeRef != null && (yield e), e.children.size > 0)
|
1166
1467
|
for (let r of e.children)
|
1167
1468
|
yield* this.traverse(r);
|
1168
1469
|
}
|
1169
1470
|
clone() {
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1471
|
+
var e;
|
1472
|
+
let r = new Ue();
|
1473
|
+
var n;
|
1474
|
+
for (let i of this.traverse())
|
1475
|
+
r.addTreeNode(i.scopeRef, (n = (e = i.parent) === null || e === void 0 ? void 0 : e.scopeRef) !== null && n !== void 0 ? n : null, i.nodeToRestore);
|
1476
|
+
return r;
|
1174
1477
|
}
|
1175
1478
|
constructor() {
|
1176
|
-
|
1479
|
+
this.fastMap = /* @__PURE__ */ new Map(), this.root = new it({
|
1177
1480
|
scopeRef: null
|
1178
1481
|
}), this.fastMap.set(null, this.root);
|
1179
1482
|
}
|
1180
1483
|
}
|
1181
|
-
class
|
1484
|
+
class it {
|
1182
1485
|
addChild(e) {
|
1183
|
-
this.children.
|
1486
|
+
this.children.add(e), e.parent = this;
|
1184
1487
|
}
|
1185
1488
|
removeChild(e) {
|
1186
|
-
this.children.
|
1489
|
+
this.children.delete(e), e.parent = void 0;
|
1187
1490
|
}
|
1188
1491
|
constructor(e) {
|
1189
|
-
|
1190
|
-
}
|
1492
|
+
this.children = /* @__PURE__ */ new Set(), this.contain = !1, this.scopeRef = e.scopeRef;
|
1493
|
+
}
|
1494
|
+
}
|
1495
|
+
new Ue();
|
1496
|
+
function _r(t, e) {
|
1497
|
+
let r = e == null ? void 0 : e.isDisabled, [n, i] = R(!1);
|
1498
|
+
return ce(() => {
|
1499
|
+
if ((t == null ? void 0 : t.current) && !r) {
|
1500
|
+
let o = () => {
|
1501
|
+
if (t.current) {
|
1502
|
+
let u = At(t.current, {
|
1503
|
+
tabbable: !0
|
1504
|
+
});
|
1505
|
+
i(!!u.nextNode());
|
1506
|
+
}
|
1507
|
+
};
|
1508
|
+
o();
|
1509
|
+
let s = new MutationObserver(o);
|
1510
|
+
return s.observe(t.current, {
|
1511
|
+
subtree: !0,
|
1512
|
+
childList: !0,
|
1513
|
+
attributes: !0,
|
1514
|
+
attributeFilter: [
|
1515
|
+
"tabIndex",
|
1516
|
+
"disabled"
|
1517
|
+
]
|
1518
|
+
}), () => {
|
1519
|
+
s.disconnect();
|
1520
|
+
};
|
1521
|
+
}
|
1522
|
+
}), r ? !1 : n;
|
1191
1523
|
}
|
1192
|
-
new
|
1193
|
-
const sr = /* @__PURE__ */ new Set([
|
1524
|
+
const en = /* @__PURE__ */ new Set([
|
1194
1525
|
"Arab",
|
1195
1526
|
"Syrc",
|
1196
1527
|
"Samr",
|
@@ -1201,7 +1532,7 @@ const sr = /* @__PURE__ */ new Set([
|
|
1201
1532
|
"Adlm",
|
1202
1533
|
"Rohg",
|
1203
1534
|
"Hebr"
|
1204
|
-
]),
|
1535
|
+
]), tn = /* @__PURE__ */ new Set([
|
1205
1536
|
"ae",
|
1206
1537
|
"ar",
|
1207
1538
|
"arc",
|
@@ -1222,16 +1553,20 @@ const sr = /* @__PURE__ */ new Set([
|
|
1222
1553
|
"ur",
|
1223
1554
|
"yi"
|
1224
1555
|
]);
|
1225
|
-
function
|
1556
|
+
function rn(t) {
|
1226
1557
|
if (Intl.Locale) {
|
1227
|
-
let r = new Intl.Locale(t).maximize().
|
1228
|
-
|
1558
|
+
let r = new Intl.Locale(t).maximize(), n = typeof r.getTextInfo == "function" ? r.getTextInfo() : r.textInfo;
|
1559
|
+
if (n)
|
1560
|
+
return n.direction === "rtl";
|
1561
|
+
if (r.script)
|
1562
|
+
return en.has(r.script);
|
1229
1563
|
}
|
1230
1564
|
let e = t.split("-")[0];
|
1231
|
-
return
|
1565
|
+
return tn.has(e);
|
1232
1566
|
}
|
1233
|
-
|
1234
|
-
|
1567
|
+
const nn = Symbol.for("react-aria.i18n.locale");
|
1568
|
+
function Ft() {
|
1569
|
+
let t = typeof window < "u" && window[nn] || typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
|
1235
1570
|
try {
|
1236
1571
|
Intl.DateTimeFormat.supportedLocalesOf([
|
1237
1572
|
t
|
@@ -1241,352 +1576,378 @@ function nt() {
|
|
1241
1576
|
}
|
1242
1577
|
return {
|
1243
1578
|
locale: t,
|
1244
|
-
direction:
|
1579
|
+
direction: rn(t) ? "rtl" : "ltr"
|
1245
1580
|
};
|
1246
1581
|
}
|
1247
|
-
let
|
1248
|
-
function
|
1249
|
-
|
1250
|
-
for (let t of
|
1251
|
-
t(
|
1582
|
+
let Ae = Ft(), oe = /* @__PURE__ */ new Set();
|
1583
|
+
function lt() {
|
1584
|
+
Ae = Ft();
|
1585
|
+
for (let t of oe)
|
1586
|
+
t(Ae);
|
1252
1587
|
}
|
1253
|
-
function
|
1254
|
-
let t =
|
1255
|
-
return
|
1256
|
-
|
1588
|
+
function ln() {
|
1589
|
+
let t = pt(), [e, r] = R(Ae);
|
1590
|
+
return z(() => (oe.size === 0 && window.addEventListener("languagechange", lt), oe.add(r), () => {
|
1591
|
+
oe.delete(r), oe.size === 0 && window.removeEventListener("languagechange", lt);
|
1257
1592
|
}), []), t ? {
|
1258
1593
|
locale: "en-US",
|
1259
1594
|
direction: "ltr"
|
1260
1595
|
} : e;
|
1261
1596
|
}
|
1262
|
-
const
|
1263
|
-
function
|
1264
|
-
let t =
|
1265
|
-
return
|
1597
|
+
const on = /* @__PURE__ */ U.createContext(null);
|
1598
|
+
function Ot() {
|
1599
|
+
let t = ln();
|
1600
|
+
return le(on) || t;
|
1266
1601
|
}
|
1267
|
-
function
|
1268
|
-
return
|
1602
|
+
function Fe(t) {
|
1603
|
+
return Sr() ? t.altKey : t.ctrlKey;
|
1269
1604
|
}
|
1270
|
-
function
|
1271
|
-
return
|
1605
|
+
function ne(t) {
|
1606
|
+
return J() ? t.metaKey : t.ctrlKey;
|
1272
1607
|
}
|
1273
|
-
const
|
1274
|
-
function
|
1275
|
-
let { keyboardDelegate: e, selectionManager: r, onTypeSelect: n } = t, i =
|
1608
|
+
const sn = 1e3;
|
1609
|
+
function an(t) {
|
1610
|
+
let { keyboardDelegate: e, selectionManager: r, onTypeSelect: n } = t, i = k({
|
1276
1611
|
search: "",
|
1277
1612
|
timeout: null
|
1278
|
-
}).current,
|
1279
|
-
let
|
1280
|
-
if (!
|
1613
|
+
}).current, o = (s) => {
|
1614
|
+
let u = cn(s.key);
|
1615
|
+
if (!u || s.ctrlKey || s.metaKey || !s.currentTarget.contains(s.target))
|
1281
1616
|
return;
|
1282
|
-
|
1283
|
-
let
|
1284
|
-
|
1617
|
+
u === " " && i.search.trim().length > 0 && (s.preventDefault(), "continuePropagation" in s || s.stopPropagation()), i.search += u;
|
1618
|
+
let f = e.getKeyForSearch(i.search, r.focusedKey);
|
1619
|
+
f == null && (f = e.getKeyForSearch(i.search)), f != null && (r.setFocusedKey(f), n && n(f)), clearTimeout(i.timeout), i.timeout = setTimeout(() => {
|
1285
1620
|
i.search = "";
|
1286
|
-
},
|
1621
|
+
}, sn);
|
1287
1622
|
};
|
1288
1623
|
return {
|
1289
1624
|
typeSelectProps: {
|
1290
|
-
onKeyDownCapture: e.getKeyForSearch ?
|
1625
|
+
onKeyDownCapture: e.getKeyForSearch ? o : null
|
1291
1626
|
}
|
1292
1627
|
};
|
1293
1628
|
}
|
1294
|
-
function
|
1629
|
+
function cn(t) {
|
1295
1630
|
return t.length === 1 || !/^[A-Z]/i.test(t) ? t : "";
|
1296
1631
|
}
|
1297
|
-
function
|
1298
|
-
let { selectionManager: e, keyboardDelegate: r, ref: n, autoFocus: i = !1, shouldFocusWrap:
|
1299
|
-
if (
|
1632
|
+
function un(t) {
|
1633
|
+
let { selectionManager: e, keyboardDelegate: r, ref: n, autoFocus: i = !1, shouldFocusWrap: o = !1, disallowEmptySelection: s = !1, disallowSelectAll: u = !1, selectOnFocus: f = e.selectionBehavior === "replace", disallowTypeAhead: b = !1, shouldUseVirtualFocus: v, allowsTabNavigation: T = !1, isVirtualized: h, scrollRef: g = n, linkBehavior: L = "action" } = t, { direction: P } = Ot(), K = $t(), M = (p) => {
|
1634
|
+
if (p.altKey && p.key === "Tab" && p.preventDefault(), !n.current.contains(p.target))
|
1300
1635
|
return;
|
1301
|
-
const
|
1302
|
-
|
1636
|
+
const d = (m, X) => {
|
1637
|
+
if (m != null) {
|
1638
|
+
if (e.isLink(m) && L === "selection" && f && !Fe(p)) {
|
1639
|
+
Vt(() => {
|
1640
|
+
e.setFocusedKey(m, X);
|
1641
|
+
});
|
1642
|
+
let _ = g.current.querySelector(`[data-key="${CSS.escape(m.toString())}"]`);
|
1643
|
+
K.open(_, p);
|
1644
|
+
return;
|
1645
|
+
}
|
1646
|
+
if (e.setFocusedKey(m, X), e.isLink(m) && L === "override")
|
1647
|
+
return;
|
1648
|
+
p.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(m) : f && !Fe(p) && e.replaceSelection(m);
|
1649
|
+
}
|
1303
1650
|
};
|
1304
|
-
switch (
|
1651
|
+
switch (p.key) {
|
1305
1652
|
case "ArrowDown":
|
1306
1653
|
if (r.getKeyBelow) {
|
1307
|
-
var
|
1308
|
-
|
1309
|
-
let
|
1310
|
-
|
1654
|
+
var S, a;
|
1655
|
+
p.preventDefault();
|
1656
|
+
let m = e.focusedKey != null ? r.getKeyBelow(e.focusedKey) : (S = r.getFirstKey) === null || S === void 0 ? void 0 : S.call(r);
|
1657
|
+
m == null && o && (m = (a = r.getFirstKey) === null || a === void 0 ? void 0 : a.call(r, e.focusedKey)), d(m);
|
1311
1658
|
}
|
1312
1659
|
break;
|
1313
1660
|
case "ArrowUp":
|
1314
1661
|
if (r.getKeyAbove) {
|
1315
|
-
var c,
|
1316
|
-
|
1317
|
-
let
|
1318
|
-
|
1662
|
+
var c, w;
|
1663
|
+
p.preventDefault();
|
1664
|
+
let m = e.focusedKey != null ? r.getKeyAbove(e.focusedKey) : (c = r.getLastKey) === null || c === void 0 ? void 0 : c.call(r);
|
1665
|
+
m == null && o && (m = (w = r.getLastKey) === null || w === void 0 ? void 0 : w.call(r, e.focusedKey)), d(m);
|
1319
1666
|
}
|
1320
1667
|
break;
|
1321
1668
|
case "ArrowLeft":
|
1322
1669
|
if (r.getKeyLeftOf) {
|
1323
|
-
y
|
1324
|
-
|
1325
|
-
|
1670
|
+
var F, y;
|
1671
|
+
p.preventDefault();
|
1672
|
+
let m = r.getKeyLeftOf(e.focusedKey);
|
1673
|
+
m == null && o && (m = P === "rtl" ? (F = r.getFirstKey) === null || F === void 0 ? void 0 : F.call(r, e.focusedKey) : (y = r.getLastKey) === null || y === void 0 ? void 0 : y.call(r, e.focusedKey)), d(m, P === "rtl" ? "first" : "last");
|
1326
1674
|
}
|
1327
1675
|
break;
|
1328
1676
|
case "ArrowRight":
|
1329
1677
|
if (r.getKeyRightOf) {
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1678
|
+
var Ke, Se;
|
1679
|
+
p.preventDefault();
|
1680
|
+
let m = r.getKeyRightOf(e.focusedKey);
|
1681
|
+
m == null && o && (m = P === "rtl" ? (Ke = r.getLastKey) === null || Ke === void 0 ? void 0 : Ke.call(r, e.focusedKey) : (Se = r.getFirstKey) === null || Se === void 0 ? void 0 : Se.call(r, e.focusedKey)), d(m, P === "rtl" ? "last" : "first");
|
1333
1682
|
}
|
1334
1683
|
break;
|
1335
1684
|
case "Home":
|
1336
1685
|
if (r.getFirstKey) {
|
1337
|
-
|
1338
|
-
let
|
1339
|
-
e.setFocusedKey(
|
1686
|
+
p.preventDefault();
|
1687
|
+
let m = r.getFirstKey(e.focusedKey, ne(p));
|
1688
|
+
e.setFocusedKey(m), ne(p) && p.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(m) : f && e.replaceSelection(m);
|
1340
1689
|
}
|
1341
1690
|
break;
|
1342
1691
|
case "End":
|
1343
1692
|
if (r.getLastKey) {
|
1344
|
-
|
1345
|
-
let
|
1346
|
-
e.setFocusedKey(
|
1693
|
+
p.preventDefault();
|
1694
|
+
let m = r.getLastKey(e.focusedKey, ne(p));
|
1695
|
+
e.setFocusedKey(m), ne(p) && p.shiftKey && e.selectionMode === "multiple" ? e.extendSelection(m) : f && e.replaceSelection(m);
|
1347
1696
|
}
|
1348
1697
|
break;
|
1349
1698
|
case "PageDown":
|
1350
1699
|
if (r.getKeyPageBelow) {
|
1351
|
-
|
1352
|
-
let
|
1353
|
-
|
1700
|
+
p.preventDefault();
|
1701
|
+
let m = r.getKeyPageBelow(e.focusedKey);
|
1702
|
+
d(m);
|
1354
1703
|
}
|
1355
1704
|
break;
|
1356
1705
|
case "PageUp":
|
1357
1706
|
if (r.getKeyPageAbove) {
|
1358
|
-
|
1359
|
-
let
|
1360
|
-
|
1707
|
+
p.preventDefault();
|
1708
|
+
let m = r.getKeyPageAbove(e.focusedKey);
|
1709
|
+
d(m);
|
1361
1710
|
}
|
1362
1711
|
break;
|
1363
1712
|
case "a":
|
1364
|
-
|
1713
|
+
ne(p) && e.selectionMode === "multiple" && u !== !0 && (p.preventDefault(), e.selectAll());
|
1365
1714
|
break;
|
1366
1715
|
case "Escape":
|
1367
|
-
|
1716
|
+
p.preventDefault(), s || e.clearSelection();
|
1368
1717
|
break;
|
1369
1718
|
case "Tab":
|
1370
|
-
if (!
|
1371
|
-
if (
|
1719
|
+
if (!T) {
|
1720
|
+
if (p.shiftKey)
|
1372
1721
|
n.current.focus();
|
1373
1722
|
else {
|
1374
|
-
let
|
1723
|
+
let m = At(n.current, {
|
1375
1724
|
tabbable: !0
|
1376
|
-
}),
|
1725
|
+
}), X, _;
|
1377
1726
|
do
|
1378
|
-
|
1379
|
-
while (
|
1380
|
-
|
1727
|
+
_ = m.lastChild(), _ && (X = _);
|
1728
|
+
while (_);
|
1729
|
+
X && !X.contains(document.activeElement) && j(X);
|
1381
1730
|
}
|
1382
1731
|
break;
|
1383
1732
|
}
|
1384
1733
|
}
|
1385
|
-
},
|
1734
|
+
}, x = k({
|
1386
1735
|
top: 0,
|
1387
1736
|
left: 0
|
1388
1737
|
});
|
1389
|
-
|
1390
|
-
|
1391
|
-
top:
|
1392
|
-
left:
|
1738
|
+
Ir(g, "scroll", h ? null : () => {
|
1739
|
+
x.current = {
|
1740
|
+
top: g.current.scrollTop,
|
1741
|
+
left: g.current.scrollLeft
|
1393
1742
|
};
|
1394
1743
|
});
|
1395
|
-
let
|
1744
|
+
let E = (p) => {
|
1396
1745
|
if (e.isFocused) {
|
1397
|
-
|
1746
|
+
p.currentTarget.contains(p.target) || e.setFocused(!1);
|
1398
1747
|
return;
|
1399
1748
|
}
|
1400
|
-
if (!!
|
1749
|
+
if (!!p.currentTarget.contains(p.target)) {
|
1401
1750
|
if (e.setFocused(!0), e.focusedKey == null) {
|
1402
|
-
let
|
1403
|
-
|
1404
|
-
}, c =
|
1405
|
-
var
|
1406
|
-
c &&
|
1407
|
-
} else
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1751
|
+
let a = (w) => {
|
1752
|
+
w != null && (e.setFocusedKey(w), f && e.replaceSelection(w));
|
1753
|
+
}, c = p.relatedTarget;
|
1754
|
+
var d, S;
|
1755
|
+
c && p.currentTarget.compareDocumentPosition(c) & Node.DOCUMENT_POSITION_FOLLOWING ? a((d = e.lastSelectedKey) !== null && d !== void 0 ? d : r.getLastKey()) : a((S = e.firstSelectedKey) !== null && S !== void 0 ? S : r.getFirstKey());
|
1756
|
+
} else
|
1757
|
+
h || (g.current.scrollTop = x.current.top, g.current.scrollLeft = x.current.left);
|
1758
|
+
if (!h && e.focusedKey != null) {
|
1759
|
+
let a = g.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);
|
1760
|
+
a && (a.contains(document.activeElement) || j(a), Ie() === "keyboard" && Ze(a, {
|
1761
|
+
containingElement: n.current
|
1762
|
+
}));
|
1411
1763
|
}
|
1412
1764
|
}
|
1413
|
-
},
|
1414
|
-
|
1765
|
+
}, C = (p) => {
|
1766
|
+
p.currentTarget.contains(p.relatedTarget) || e.setFocused(!1);
|
1415
1767
|
};
|
1416
|
-
const
|
1417
|
-
|
1418
|
-
if (
|
1419
|
-
let
|
1420
|
-
i === "first" && (
|
1421
|
-
let
|
1422
|
-
|
1768
|
+
const I = k(i);
|
1769
|
+
z(() => {
|
1770
|
+
if (I.current) {
|
1771
|
+
let p = null;
|
1772
|
+
i === "first" && (p = r.getFirstKey()), i === "last" && (p = r.getLastKey());
|
1773
|
+
let d = e.selectedKeys;
|
1774
|
+
if (d.size) {
|
1775
|
+
for (let S of d)
|
1776
|
+
if (e.canSelectItem(S)) {
|
1777
|
+
p = S;
|
1778
|
+
break;
|
1779
|
+
}
|
1780
|
+
}
|
1781
|
+
e.setFocused(!0), e.setFocusedKey(p), p == null && !v && De(n.current);
|
1423
1782
|
}
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1783
|
+
}, []);
|
1784
|
+
let A = k(e.focusedKey);
|
1785
|
+
z(() => {
|
1786
|
+
let p = Ie();
|
1787
|
+
if (e.isFocused && e.focusedKey != null && (g == null ? void 0 : g.current)) {
|
1788
|
+
let d = g.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);
|
1789
|
+
d && (p === "keyboard" || I.current) && (h || Tt(g.current, d), p !== "virtual" && Ze(d, {
|
1790
|
+
containingElement: n.current
|
1791
|
+
}));
|
1429
1792
|
}
|
1793
|
+
e.isFocused && e.focusedKey == null && A.current != null && De(n.current), A.current = e.focusedKey, I.current = !1;
|
1430
1794
|
}, [
|
1431
|
-
|
1432
|
-
|
1433
|
-
e.focusedKey
|
1795
|
+
h,
|
1796
|
+
g,
|
1797
|
+
e.focusedKey,
|
1798
|
+
e.isFocused,
|
1799
|
+
n
|
1434
1800
|
]);
|
1435
|
-
let
|
1436
|
-
onKeyDown:
|
1437
|
-
onFocus:
|
1438
|
-
onBlur:
|
1439
|
-
onMouseDown(
|
1440
|
-
|
1801
|
+
let W = {
|
1802
|
+
onKeyDown: M,
|
1803
|
+
onFocus: E,
|
1804
|
+
onBlur: C,
|
1805
|
+
onMouseDown(p) {
|
1806
|
+
g.current === p.target && p.preventDefault();
|
1441
1807
|
}
|
1442
|
-
}, { typeSelectProps:
|
1808
|
+
}, { typeSelectProps: l } = an({
|
1443
1809
|
keyboardDelegate: r,
|
1444
1810
|
selectionManager: e
|
1445
1811
|
});
|
1446
|
-
|
1812
|
+
b || (W = G(l, W));
|
1447
1813
|
let $;
|
1448
|
-
return
|
1814
|
+
return v || ($ = e.focusedKey == null ? 0 : -1), {
|
1449
1815
|
collectionProps: {
|
1450
|
-
...
|
1816
|
+
...W,
|
1451
1817
|
tabIndex: $
|
1452
1818
|
}
|
1453
1819
|
};
|
1454
1820
|
}
|
1455
|
-
function
|
1456
|
-
let { selectionManager: e, key: r, ref: n, shouldSelectOnPressUp: i,
|
1457
|
-
if (
|
1821
|
+
function dn(t) {
|
1822
|
+
let { selectionManager: e, key: r, ref: n, shouldSelectOnPressUp: i, shouldUseVirtualFocus: o, focus: s, isDisabled: u, onAction: f, allowsDifferentPressOrigin: b, linkBehavior: v = "action" } = t, T = $t(), h = (y) => {
|
1823
|
+
if (y.pointerType === "keyboard" && Fe(y))
|
1458
1824
|
e.toggleSelection(r);
|
1459
1825
|
else {
|
1460
1826
|
if (e.selectionMode === "none")
|
1461
1827
|
return;
|
1462
|
-
|
1828
|
+
if (e.isLink(r)) {
|
1829
|
+
if (v === "selection") {
|
1830
|
+
T.open(n.current, y), e.setSelectedKeys(e.selectedKeys);
|
1831
|
+
return;
|
1832
|
+
} else if (v === "override" || v === "none")
|
1833
|
+
return;
|
1834
|
+
}
|
1835
|
+
e.selectionMode === "single" ? e.isSelected(r) && !e.disallowEmptySelection ? e.toggleSelection(r) : e.replaceSelection(r) : y && y.shiftKey ? e.extendSelection(r) : e.selectionBehavior === "toggle" || y && (ne(y) || y.pointerType === "touch" || y.pointerType === "virtual") ? e.toggleSelection(r) : e.replaceSelection(r);
|
1463
1836
|
}
|
1464
1837
|
};
|
1465
|
-
|
1466
|
-
r === e.focusedKey && e.isFocused && !
|
1838
|
+
z(() => {
|
1839
|
+
r === e.focusedKey && e.isFocused && !o && (s ? s() : document.activeElement !== n.current && De(n.current));
|
1467
1840
|
}, [
|
1468
1841
|
n,
|
1469
1842
|
r,
|
1470
1843
|
e.focusedKey,
|
1471
1844
|
e.childFocusStrategy,
|
1472
1845
|
e.isFocused,
|
1473
|
-
|
1846
|
+
o
|
1474
1847
|
]), u = u || e.isDisabled(r);
|
1475
|
-
let
|
1476
|
-
!
|
1848
|
+
let g = {};
|
1849
|
+
!o && !u ? g = {
|
1477
1850
|
tabIndex: r === e.focusedKey ? 0 : -1,
|
1478
|
-
onFocus(
|
1479
|
-
|
1851
|
+
onFocus(y) {
|
1852
|
+
y.target === n.current && e.setFocusedKey(r);
|
1480
1853
|
}
|
1481
|
-
} : u && (
|
1482
|
-
|
1854
|
+
} : u && (g.onMouseDown = (y) => {
|
1855
|
+
y.preventDefault();
|
1483
1856
|
});
|
1484
|
-
let
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
},
|
1490
|
-
|
1491
|
-
|
1857
|
+
let L = e.isLink(r) && v === "override", P = e.isLink(r) && v !== "selection" && v !== "none", K = !u && e.canSelectItem(r) && !L, M = (f || P) && !u, x = M && (e.selectionBehavior === "replace" ? !K : !K || e.isEmpty), E = M && K && e.selectionBehavior === "replace", C = x || E, I = k(null), A = C && K, W = k(!1), l = k(!1), $ = (y) => {
|
1858
|
+
f && f(), P && T.open(n.current, y);
|
1859
|
+
}, p = {};
|
1860
|
+
i ? (p.onPressStart = (y) => {
|
1861
|
+
I.current = y.pointerType, W.current = A, y.pointerType === "keyboard" && (!C || st()) && h(y);
|
1862
|
+
}, b ? (p.onPressUp = x ? null : (y) => {
|
1863
|
+
y.pointerType !== "keyboard" && K && h(y);
|
1864
|
+
}, p.onPress = x ? $ : null) : p.onPress = (y) => {
|
1865
|
+
if (x || E && y.pointerType !== "mouse") {
|
1866
|
+
if (y.pointerType === "keyboard" && !ot())
|
1492
1867
|
return;
|
1493
|
-
|
1868
|
+
$(y);
|
1494
1869
|
} else
|
1495
|
-
|
1496
|
-
}) : (
|
1497
|
-
|
1498
|
-
},
|
1499
|
-
(
|
1500
|
-
}),
|
1501
|
-
let { pressProps:
|
1502
|
-
|
1503
|
-
} : void 0, { longPressProps:
|
1504
|
-
isDisabled: !
|
1505
|
-
onLongPress(
|
1506
|
-
|
1870
|
+
y.pointerType !== "keyboard" && K && h(y);
|
1871
|
+
}) : (p.onPressStart = (y) => {
|
1872
|
+
I.current = y.pointerType, W.current = A, l.current = x, K && (y.pointerType === "mouse" && !x || y.pointerType === "keyboard" && (!M || st())) && h(y);
|
1873
|
+
}, p.onPress = (y) => {
|
1874
|
+
(y.pointerType === "touch" || y.pointerType === "pen" || y.pointerType === "virtual" || y.pointerType === "keyboard" && C && ot() || y.pointerType === "mouse" && l.current) && (C ? $(y) : K && h(y));
|
1875
|
+
}), g["data-key"] = r, p.preventFocusOnPress = o;
|
1876
|
+
let { pressProps: d, isPressed: S } = Et(p), a = E ? (y) => {
|
1877
|
+
I.current === "mouse" && (y.stopPropagation(), y.preventDefault(), $(y));
|
1878
|
+
} : void 0, { longPressProps: c } = qr({
|
1879
|
+
isDisabled: !A,
|
1880
|
+
onLongPress(y) {
|
1881
|
+
y.pointerType === "touch" && (h(y), e.setSelectionBehavior("toggle"));
|
1507
1882
|
}
|
1508
|
-
})
|
1883
|
+
}), w = (y) => {
|
1884
|
+
I.current === "touch" && W.current && y.preventDefault();
|
1885
|
+
}, F = e.isLink(r) ? (y) => {
|
1886
|
+
Z.isOpening || y.preventDefault();
|
1887
|
+
} : void 0;
|
1509
1888
|
return {
|
1510
|
-
itemProps:
|
1511
|
-
onDoubleClick:
|
1512
|
-
onDragStartCapture:
|
1513
|
-
|
1514
|
-
}
|
1889
|
+
itemProps: G(g, K || x ? d : {}, A ? c : {}, {
|
1890
|
+
onDoubleClick: a,
|
1891
|
+
onDragStartCapture: w,
|
1892
|
+
onClick: F
|
1515
1893
|
}),
|
1516
|
-
isPressed:
|
1894
|
+
isPressed: S,
|
1517
1895
|
isSelected: e.isSelected(r),
|
1896
|
+
isFocused: e.isFocused && e.focusedKey === r,
|
1518
1897
|
isDisabled: u,
|
1519
|
-
allowsSelection:
|
1520
|
-
hasAction:
|
1898
|
+
allowsSelection: K,
|
1899
|
+
hasAction: C
|
1521
1900
|
};
|
1522
1901
|
}
|
1523
|
-
function
|
1902
|
+
function ot() {
|
1524
1903
|
let t = window.event;
|
1525
1904
|
return (t == null ? void 0 : t.key) === "Enter";
|
1526
1905
|
}
|
1527
|
-
function
|
1906
|
+
function st() {
|
1528
1907
|
let t = window.event;
|
1529
1908
|
return (t == null ? void 0 : t.key) === " " || (t == null ? void 0 : t.code) === "Space";
|
1530
1909
|
}
|
1531
|
-
const
|
1532
|
-
function
|
1533
|
-
return typeof e == "string" && (e = e.replace(/\s+/g, "")), `${
|
1910
|
+
const zt = /* @__PURE__ */ new WeakMap();
|
1911
|
+
function $e(t, e, r) {
|
1912
|
+
return typeof e == "string" && (e = e.replace(/\s+/g, "")), `${zt.get(t)}-${r}-${e}`;
|
1534
1913
|
}
|
1535
|
-
function
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1914
|
+
function fn(t, e, r) {
|
1915
|
+
var n;
|
1916
|
+
let { key: i, isDisabled: o, shouldSelectOnPressUp: s } = t, { selectionManager: u, selectedKey: f } = e, b = i === f, v = o || e.isDisabled || e.disabledKeys.has(i), { itemProps: T, isPressed: h } = dn({
|
1917
|
+
selectionManager: u,
|
1918
|
+
key: i,
|
1539
1919
|
ref: r,
|
1540
|
-
isDisabled:
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1920
|
+
isDisabled: v,
|
1921
|
+
shouldSelectOnPressUp: s,
|
1922
|
+
linkBehavior: "selection"
|
1923
|
+
}), g = $e(e, i, "tab"), L = $e(e, i, "tabpanel"), { tabIndex: P } = T, K = e.collection.getItem(i), M = gr(K == null ? void 0 : K.props, {
|
1924
|
+
isLink: !!(!(K == null || (n = K.props) === null || n === void 0) && n.href),
|
1925
|
+
labelable: !0
|
1926
|
+
});
|
1927
|
+
return delete M.id, {
|
1928
|
+
tabProps: G(M, T, {
|
1929
|
+
id: g,
|
1930
|
+
"aria-selected": b,
|
1931
|
+
"aria-disabled": v || void 0,
|
1932
|
+
"aria-controls": b ? L : void 0,
|
1933
|
+
tabIndex: v ? void 0 : P,
|
1550
1934
|
role: "tab"
|
1551
|
-
},
|
1552
|
-
isSelected:
|
1553
|
-
isDisabled:
|
1935
|
+
}),
|
1936
|
+
isSelected: b,
|
1937
|
+
isDisabled: v,
|
1938
|
+
isPressed: h
|
1554
1939
|
};
|
1555
1940
|
}
|
1556
|
-
function
|
1557
|
-
let
|
1558
|
-
|
1559
|
-
|
1560
|
-
let f = () => {
|
1561
|
-
let g = rt(r.current, {
|
1562
|
-
tabbable: !0
|
1563
|
-
});
|
1564
|
-
i(g.nextNode() ? void 0 : 0);
|
1565
|
-
};
|
1566
|
-
f();
|
1567
|
-
let u = new MutationObserver(f);
|
1568
|
-
return u.observe(r.current, {
|
1569
|
-
subtree: !0,
|
1570
|
-
childList: !0,
|
1571
|
-
attributes: !0,
|
1572
|
-
attributeFilter: [
|
1573
|
-
"tabIndex",
|
1574
|
-
"disabled"
|
1575
|
-
]
|
1576
|
-
}), () => {
|
1577
|
-
u.disconnect();
|
1578
|
-
};
|
1579
|
-
}
|
1580
|
-
}, [
|
1581
|
-
r
|
1582
|
-
]);
|
1583
|
-
const a = re(e, e == null ? void 0 : e.selectedKey, "tabpanel"), l = qe({
|
1941
|
+
function pn(t, e, r) {
|
1942
|
+
let n = _r(r) ? void 0 : 0;
|
1943
|
+
var i;
|
1944
|
+
const o = $e(e, (i = t.id) !== null && i !== void 0 ? i : e == null ? void 0 : e.selectedKey, "tabpanel"), s = St({
|
1584
1945
|
...t,
|
1585
|
-
id:
|
1586
|
-
"aria-labelledby":
|
1946
|
+
id: o,
|
1947
|
+
"aria-labelledby": $e(e, e == null ? void 0 : e.selectedKey, "tab")
|
1587
1948
|
});
|
1588
1949
|
return {
|
1589
|
-
tabPanelProps:
|
1950
|
+
tabPanelProps: G(s, {
|
1590
1951
|
tabIndex: n,
|
1591
1952
|
role: "tabpanel",
|
1592
1953
|
"aria-describedby": t["aria-describedby"],
|
@@ -1594,26 +1955,26 @@ function gr(t, e, r) {
|
|
1594
1955
|
})
|
1595
1956
|
};
|
1596
1957
|
}
|
1597
|
-
class
|
1958
|
+
class yn {
|
1598
1959
|
getKeyLeftOf(e) {
|
1599
|
-
return this.flipDirection ? this.getNextKey(e) : this.
|
1960
|
+
return this.flipDirection ? this.getNextKey(e) : this.getPreviousKey(e);
|
1600
1961
|
}
|
1601
1962
|
getKeyRightOf(e) {
|
1602
|
-
return this.flipDirection ? this.getPreviousKey(e) : this.
|
1963
|
+
return this.flipDirection ? this.getPreviousKey(e) : this.getNextKey(e);
|
1603
1964
|
}
|
1604
1965
|
getKeyAbove(e) {
|
1605
|
-
return this.
|
1966
|
+
return this.getPreviousKey(e);
|
1606
1967
|
}
|
1607
1968
|
getKeyBelow(e) {
|
1608
|
-
return this.
|
1969
|
+
return this.getNextKey(e);
|
1609
1970
|
}
|
1610
1971
|
getFirstKey() {
|
1611
1972
|
let e = this.collection.getFirstKey();
|
1612
|
-
return this.disabledKeys.has(e) && (e = this.getNextKey(e)), e;
|
1973
|
+
return e != null && this.disabledKeys.has(e) && (e = this.getNextKey(e)), e;
|
1613
1974
|
}
|
1614
1975
|
getLastKey() {
|
1615
1976
|
let e = this.collection.getLastKey();
|
1616
|
-
return this.disabledKeys.has(e) && (e = this.getPreviousKey(e)), e;
|
1977
|
+
return e != null && this.disabledKeys.has(e) && (e = this.getPreviousKey(e)), e;
|
1617
1978
|
}
|
1618
1979
|
getNextKey(e) {
|
1619
1980
|
do
|
@@ -1628,38 +1989,39 @@ class hr {
|
|
1628
1989
|
return e;
|
1629
1990
|
}
|
1630
1991
|
constructor(e, r, n, i = /* @__PURE__ */ new Set()) {
|
1631
|
-
this.collection = e, this.flipDirection = r === "rtl" && n === "horizontal", this.
|
1992
|
+
this.collection = e, this.flipDirection = r === "rtl" && n === "horizontal", this.disabledKeys = i;
|
1632
1993
|
}
|
1633
1994
|
}
|
1634
|
-
function
|
1635
|
-
let { orientation: n = "horizontal", keyboardActivation: i = "automatic" } = t, { collection:
|
1636
|
-
|
1637
|
-
|
1995
|
+
function bn(t, e, r) {
|
1996
|
+
let { orientation: n = "horizontal", keyboardActivation: i = "automatic" } = t, { collection: o, selectionManager: s, disabledKeys: u } = e, { direction: f } = Ot(), b = V(() => new yn(o, f, n, u), [
|
1997
|
+
o,
|
1998
|
+
u,
|
1638
1999
|
n,
|
1639
|
-
|
1640
|
-
]), { collectionProps:
|
2000
|
+
f
|
2001
|
+
]), { collectionProps: v } = un({
|
1641
2002
|
ref: r,
|
1642
|
-
selectionManager:
|
1643
|
-
keyboardDelegate:
|
2003
|
+
selectionManager: s,
|
2004
|
+
keyboardDelegate: b,
|
1644
2005
|
selectOnFocus: i === "automatic",
|
1645
2006
|
disallowEmptySelection: !0,
|
1646
|
-
scrollRef: r
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
2007
|
+
scrollRef: r,
|
2008
|
+
linkBehavior: "selection"
|
2009
|
+
}), T = bt();
|
2010
|
+
zt.set(e, T);
|
2011
|
+
let h = St({
|
1650
2012
|
...t,
|
1651
|
-
id:
|
2013
|
+
id: T
|
1652
2014
|
});
|
1653
2015
|
return {
|
1654
2016
|
tabListProps: {
|
1655
|
-
...
|
2017
|
+
...G(v, h),
|
1656
2018
|
role: "tablist",
|
1657
2019
|
"aria-orientation": n,
|
1658
2020
|
tabIndex: void 0
|
1659
2021
|
}
|
1660
2022
|
};
|
1661
2023
|
}
|
1662
|
-
function
|
2024
|
+
function vn(t, e, r) {
|
1663
2025
|
return e in t ? Object.defineProperty(t, e, {
|
1664
2026
|
value: r,
|
1665
2027
|
enumerable: !0,
|
@@ -1667,7 +2029,7 @@ function mr(t, e, r) {
|
|
1667
2029
|
writable: !0
|
1668
2030
|
}) : t[e] = r, t;
|
1669
2031
|
}
|
1670
|
-
function
|
2032
|
+
function at(t, e) {
|
1671
2033
|
var r = Object.keys(t);
|
1672
2034
|
if (Object.getOwnPropertySymbols) {
|
1673
2035
|
var n = Object.getOwnPropertySymbols(t);
|
@@ -1677,126 +2039,126 @@ function Be(t, e) {
|
|
1677
2039
|
}
|
1678
2040
|
return r;
|
1679
2041
|
}
|
1680
|
-
function
|
2042
|
+
function ct(t) {
|
1681
2043
|
for (var e = 1; e < arguments.length; e++) {
|
1682
2044
|
var r = arguments[e] != null ? arguments[e] : {};
|
1683
|
-
e % 2 ?
|
1684
|
-
|
1685
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) :
|
2045
|
+
e % 2 ? at(Object(r), !0).forEach(function(n) {
|
2046
|
+
vn(t, n, r[n]);
|
2047
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : at(Object(r)).forEach(function(n) {
|
1686
2048
|
Object.defineProperty(t, n, Object.getOwnPropertyDescriptor(r, n));
|
1687
2049
|
});
|
1688
2050
|
}
|
1689
2051
|
return t;
|
1690
2052
|
}
|
1691
|
-
var
|
2053
|
+
var gn = (t, e, r) => {
|
1692
2054
|
for (var n of Object.keys(t)) {
|
1693
2055
|
var i;
|
1694
2056
|
if (t[n] !== ((i = e[n]) !== null && i !== void 0 ? i : r[n]))
|
1695
2057
|
return !1;
|
1696
2058
|
}
|
1697
2059
|
return !0;
|
1698
|
-
},
|
1699
|
-
var r = t.defaultClassName, n =
|
2060
|
+
}, We = (t) => (e) => {
|
2061
|
+
var r = t.defaultClassName, n = ct(ct({}, t.defaultVariants), e);
|
1700
2062
|
for (var i in n) {
|
1701
|
-
var
|
1702
|
-
if (
|
1703
|
-
var
|
1704
|
-
typeof
|
1705
|
-
var
|
1706
|
-
|
2063
|
+
var o, s = (o = n[i]) !== null && o !== void 0 ? o : t.defaultVariants[i];
|
2064
|
+
if (s != null) {
|
2065
|
+
var u = s;
|
2066
|
+
typeof u == "boolean" && (u = u === !0 ? "true" : "false");
|
2067
|
+
var f = t.variantClassNames[i][u];
|
2068
|
+
f && (r += " " + f);
|
1707
2069
|
}
|
1708
2070
|
}
|
1709
|
-
for (var [
|
1710
|
-
|
2071
|
+
for (var [b, v] of t.compoundVariants)
|
2072
|
+
gn(b, n, t.defaultVariants) && (r += " " + v);
|
1711
2073
|
return r;
|
1712
|
-
},
|
1713
|
-
function
|
2074
|
+
}, hn = We({ defaultClassName: "kz6kzz0", variantClassNames: { context: { container: "kz6kzz1", navigation: "kz6kzz2" }, active: { true: "kz6kzz3", false: "kz6kzz4" }, disabled: { true: "kz6kzz5", false: "kz6kzz6" } }, defaultVariants: {}, compoundVariants: [[{ context: "container", active: !0 }, "kz6kzz7"], [{ context: "container", active: !1 }, "kz6kzz8"], [{ context: "container", active: !1, disabled: !1 }, "kz6kzz9"], [{ context: "navigation", active: !0 }, "kz6kzza"], [{ context: "navigation", active: !1 }, "kz6kzzb"], [{ context: "navigation", active: !1, disabled: !1 }, "kz6kzzc"], [{ context: "navigation", active: !1, disabled: !0 }, "kz6kzzd"]] }), $n = We({ defaultClassName: "", variantClassNames: { active: { true: "kz6kzze", false: "kz6kzzf" }, disabled: { true: "kz6kzzg", false: "kz6kzzh" }, context: { navigation: "kz6kzzi", container: "kz6kzzj" } }, defaultVariants: {}, compoundVariants: [[{ context: "navigation", active: !0 }, "kz6kzzk"]] });
|
2075
|
+
function Nt({
|
1714
2076
|
context: t,
|
1715
2077
|
item: e,
|
1716
2078
|
state: r,
|
1717
2079
|
...n
|
1718
2080
|
}) {
|
1719
|
-
const { key: i } = e,
|
1720
|
-
className:
|
2081
|
+
const { key: i } = e, o = B.useRef(null), { tabProps: s } = fn({ key: i }, r, o), u = r.selectedKey === i, f = r.disabledKeys.has(i), b = Gt(e.rendered, (v) => v.type.displayName === "SpsTag" || ae.isWoodlandComponent(v.type) && ae.get(v.type).name === "Tag" ? [{
|
2082
|
+
className: ut(v.props.className, $n({ active: u, disabled: f, context: t }))
|
1721
2083
|
}] : [{}]);
|
1722
|
-
return /* @__PURE__ */
|
2084
|
+
return /* @__PURE__ */ B.createElement(
|
1723
2085
|
"div",
|
1724
2086
|
{
|
1725
|
-
...
|
1726
|
-
ref:
|
1727
|
-
className:
|
2087
|
+
...s,
|
2088
|
+
ref: o,
|
2089
|
+
className: hn({ active: u, disabled: f, context: t }),
|
1728
2090
|
...n
|
1729
2091
|
},
|
1730
|
-
|
2092
|
+
b
|
1731
2093
|
);
|
1732
2094
|
}
|
1733
|
-
|
1734
|
-
function
|
2095
|
+
ae.set(Nt, { name: "Tab" });
|
2096
|
+
function Bt({
|
1735
2097
|
context: t,
|
1736
2098
|
"data-testid": e,
|
1737
2099
|
state: r,
|
1738
2100
|
...n
|
1739
2101
|
}) {
|
1740
|
-
const i =
|
1741
|
-
return /* @__PURE__ */
|
1742
|
-
|
2102
|
+
const i = B.useRef(null), { tabPanelProps: o } = pn(n, r, i), s = t === "container" ? Xt : "div";
|
2103
|
+
return /* @__PURE__ */ B.createElement(
|
2104
|
+
s,
|
1743
2105
|
{
|
1744
|
-
...
|
2106
|
+
...o,
|
1745
2107
|
ref: i,
|
1746
2108
|
"data-testid": e
|
1747
2109
|
},
|
1748
2110
|
r.selectedItem ? r.selectedItem.props.children : null
|
1749
2111
|
);
|
1750
2112
|
}
|
1751
|
-
|
1752
|
-
var
|
1753
|
-
function
|
2113
|
+
ae.set(Bt, { name: "TabPanel" });
|
2114
|
+
var mn = We({ defaultClassName: "fy26er0", variantClassNames: { context: { container: "fy26er1", navigation: "fy26er2" } }, defaultVariants: {}, compoundVariants: [] });
|
2115
|
+
function Rt({
|
1754
2116
|
className: t,
|
1755
2117
|
context: e = "navigation",
|
1756
2118
|
"data-testid": r,
|
1757
2119
|
...n
|
1758
2120
|
}) {
|
1759
|
-
const i =
|
1760
|
-
return /* @__PURE__ */
|
2121
|
+
const i = er(n), o = B.useRef(null), { tabListProps: s } = bn(n, i, o), u = qt({ "data-testid": r });
|
2122
|
+
return /* @__PURE__ */ B.createElement(B.Fragment, null, /* @__PURE__ */ B.createElement(
|
1761
2123
|
"div",
|
1762
2124
|
{
|
1763
|
-
...
|
1764
|
-
ref:
|
1765
|
-
className:
|
2125
|
+
...s,
|
2126
|
+
ref: o,
|
2127
|
+
className: ut(mn({ context: e }), t),
|
1766
2128
|
"data-testid": r
|
1767
2129
|
},
|
1768
|
-
[...i.collection].map((
|
1769
|
-
|
2130
|
+
[...i.collection].map((f) => /* @__PURE__ */ B.createElement(
|
2131
|
+
Nt,
|
1770
2132
|
{
|
1771
|
-
key:
|
1772
|
-
item:
|
2133
|
+
key: f.key,
|
2134
|
+
item: f,
|
1773
2135
|
state: i,
|
1774
2136
|
context: e,
|
1775
|
-
...
|
2137
|
+
...u(`tab-${String(f.key)}`)
|
1776
2138
|
}
|
1777
2139
|
))
|
1778
|
-
), /* @__PURE__ */
|
1779
|
-
|
2140
|
+
), /* @__PURE__ */ B.createElement(
|
2141
|
+
Bt,
|
1780
2142
|
{
|
1781
2143
|
key: i.selectedItem ? i.selectedItem.key : null,
|
1782
2144
|
state: i,
|
1783
2145
|
context: e,
|
1784
|
-
...
|
2146
|
+
...u("tab-panel")
|
1785
2147
|
}
|
1786
2148
|
));
|
1787
2149
|
}
|
1788
|
-
|
1789
|
-
const
|
1790
|
-
components: [
|
2150
|
+
ae.set(Rt, { name: "Tabs" });
|
2151
|
+
const Kn = {
|
2152
|
+
components: [Rt],
|
1791
2153
|
examples: {
|
1792
2154
|
basic: {
|
1793
2155
|
label: "Basic Navigation Tabs",
|
1794
|
-
description:
|
2156
|
+
description: He`
|
1795
2157
|
<p>Navigation tabs</p>
|
1796
2158
|
`,
|
1797
2159
|
examples: {
|
1798
2160
|
basic: {
|
1799
|
-
react:
|
2161
|
+
react: He`
|
1800
2162
|
import { Item } from "@react-stately/collections";
|
1801
2163
|
import { Box, Icon } from "@sps-woodland/core";
|
1802
2164
|
import { Tabs } from "@sps-woodland/tabs";
|
@@ -1862,10 +2224,10 @@ const Pr = {
|
|
1862
2224
|
}
|
1863
2225
|
}
|
1864
2226
|
}
|
1865
|
-
},
|
1866
|
-
"Tabbed Navigation":
|
2227
|
+
}, xn = {
|
2228
|
+
"Tabbed Navigation": Kn
|
1867
2229
|
};
|
1868
2230
|
export {
|
1869
|
-
|
1870
|
-
|
2231
|
+
xn as MANIFEST,
|
2232
|
+
Rt as Tabs
|
1871
2233
|
};
|