@plumile/ui 0.1.117 → 0.1.120

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.
Files changed (41) hide show
  1. package/README.md +2 -0
  2. package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js +2 -1
  3. package/lib/esm/admin/organisms/admin_sidebar/AdminSidebar.js.map +1 -1
  4. package/lib/esm/atomic/molecules/markdown/components/MarkdownDelete.css.js +0 -1
  5. package/lib/esm/atomic/molecules/markdown/components/MarkdownFootnoteReference.css.js +1 -0
  6. package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js +90 -94
  7. package/lib/esm/backoffice/molecules/sidebar_nav_item/SidebarNavItem.js.map +1 -1
  8. package/lib/esm/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.js +2 -2
  9. package/lib/esm/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.js.map +1 -1
  10. package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js +159 -62
  11. package/lib/esm/backoffice/molecules/sidebar_nav_section/SidebarNavSection.js.map +1 -1
  12. package/lib/esm/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.js +2 -2
  13. package/lib/esm/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.js.map +1 -1
  14. package/lib/esm/i18n/locales/en/ui.js +12 -6
  15. package/lib/esm/i18n/locales/en/ui.js.map +1 -1
  16. package/lib/esm/i18n/locales/fr/ui.js +12 -6
  17. package/lib/esm/i18n/locales/fr/ui.js.map +1 -1
  18. package/lib/esm/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +46 -0
  19. package/lib/esm/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js.map +1 -0
  20. package/lib/esm/node_modules/@dnd-kit/core/dist/core.esm.js +1966 -0
  21. package/lib/esm/node_modules/@dnd-kit/core/dist/core.esm.js.map +1 -0
  22. package/lib/esm/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +348 -0
  23. package/lib/esm/node_modules/@dnd-kit/sortable/dist/sortable.esm.js.map +1 -0
  24. package/lib/esm/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +157 -0
  25. package/lib/esm/node_modules/@dnd-kit/utilities/dist/utilities.esm.js.map +1 -0
  26. package/lib/esm/style.css +1 -1
  27. package/lib/types/admin/organisms/admin_sidebar/AdminSidebar.d.ts +2 -1
  28. package/lib/types/admin/organisms/admin_sidebar/AdminSidebar.d.ts.map +1 -1
  29. package/lib/types/backoffice/molecules/sidebar_nav_item/SidebarNavItem.d.ts +4 -7
  30. package/lib/types/backoffice/molecules/sidebar_nav_item/SidebarNavItem.d.ts.map +1 -1
  31. package/lib/types/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.d.ts +1 -0
  32. package/lib/types/backoffice/molecules/sidebar_nav_item/sidebarNavItem.css.d.ts.map +1 -1
  33. package/lib/types/backoffice/molecules/sidebar_nav_section/SidebarNavSection.d.ts +6 -1
  34. package/lib/types/backoffice/molecules/sidebar_nav_section/SidebarNavSection.d.ts.map +1 -1
  35. package/lib/types/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.d.ts +6 -0
  36. package/lib/types/backoffice/molecules/sidebar_nav_section/sidebarNavSection.css.d.ts.map +1 -1
  37. package/lib/types/i18n/resources.d.ts +8 -0
  38. package/lib/types/i18n/resources.d.ts.map +1 -1
  39. package/package.json +5 -2
  40. package/src/i18n/locales/en/ui.json +4 -0
  41. package/src/i18n/locales/fr/ui.json +4 -0
@@ -0,0 +1,1966 @@
1
+ import { CSS as e, add as t, canUseDOM as n, findFirstFocusableNode as r, getEventCoordinates as i, getOwnerDocument as a, getWindow as o, isDocument as s, isHTMLElement as c, isKeyboardEvent as l, isNode as u, isSVGElement as d, isWindow as f, subtract as p, useEvent as m, useInterval as h, useIsomorphicLayoutEffect as g, useLatestValue as _, useLazyMemo as v, useNodeRef as y, usePrevious as b, useUniqueId as x } from "../../utilities/dist/utilities.esm.js";
2
+ import { HiddenText as S, LiveRegion as C, useAnnouncement as w } from "../../accessibility/dist/accessibility.esm.js";
3
+ import T, { cloneElement as E, createContext as D, forwardRef as ee, memo as te, useCallback as O, useContext as k, useEffect as A, useMemo as j, useReducer as ne, useRef as M, useState as N } from "react";
4
+ import { createPortal as P, unstable_batchedUpdates as re } from "react-dom";
5
+ //#region ../../node_modules/@dnd-kit/core/dist/core.esm.js
6
+ var ie = /* @__PURE__ */ D(null);
7
+ function ae(e) {
8
+ let t = k(ie);
9
+ A(() => {
10
+ if (!t) throw Error("useDndMonitor must be used within a children of <DndContext>");
11
+ return t(e);
12
+ }, [e, t]);
13
+ }
14
+ function oe() {
15
+ let [e] = N(() => /* @__PURE__ */ new Set()), t = O((t) => (e.add(t), () => e.delete(t)), [e]);
16
+ return [O((t) => {
17
+ let { type: n, event: r } = t;
18
+ e.forEach((e) => e[n]?.call(e, r));
19
+ }, [e]), t];
20
+ }
21
+ var se = { draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " }, F = {
22
+ onDragStart(e) {
23
+ let { active: t } = e;
24
+ return "Picked up draggable item " + t.id + ".";
25
+ },
26
+ onDragOver(e) {
27
+ let { active: t, over: n } = e;
28
+ return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
29
+ },
30
+ onDragEnd(e) {
31
+ let { active: t, over: n } = e;
32
+ return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
33
+ },
34
+ onDragCancel(e) {
35
+ let { active: t } = e;
36
+ return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
37
+ }
38
+ };
39
+ function ce(e) {
40
+ let { announcements: t = F, container: n, hiddenTextDescribedById: r, screenReaderInstructions: i = se } = e, { announce: a, announcement: o } = w(), s = x("DndLiveRegion"), [c, l] = N(!1);
41
+ if (A(() => {
42
+ l(!0);
43
+ }, []), ae(j(() => ({
44
+ onDragStart(e) {
45
+ let { active: n } = e;
46
+ a(t.onDragStart({ active: n }));
47
+ },
48
+ onDragMove(e) {
49
+ let { active: n, over: r } = e;
50
+ t.onDragMove && a(t.onDragMove({
51
+ active: n,
52
+ over: r
53
+ }));
54
+ },
55
+ onDragOver(e) {
56
+ let { active: n, over: r } = e;
57
+ a(t.onDragOver({
58
+ active: n,
59
+ over: r
60
+ }));
61
+ },
62
+ onDragEnd(e) {
63
+ let { active: n, over: r } = e;
64
+ a(t.onDragEnd({
65
+ active: n,
66
+ over: r
67
+ }));
68
+ },
69
+ onDragCancel(e) {
70
+ let { active: n, over: r } = e;
71
+ a(t.onDragCancel({
72
+ active: n,
73
+ over: r
74
+ }));
75
+ }
76
+ }), [a, t])), !c) return null;
77
+ let u = T.createElement(T.Fragment, null, T.createElement(S, {
78
+ id: r,
79
+ value: i.draggable
80
+ }), T.createElement(C, {
81
+ id: s,
82
+ announcement: o
83
+ }));
84
+ return n ? P(u, n) : u;
85
+ }
86
+ var I;
87
+ (function(e) {
88
+ e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
89
+ })(I ||= {});
90
+ function le() {}
91
+ function L(e, t) {
92
+ return j(() => ({
93
+ sensor: e,
94
+ options: t ?? {}
95
+ }), [e, t]);
96
+ }
97
+ function ue() {
98
+ var e = [...arguments];
99
+ return j(() => [...e].filter((e) => e != null), [...e]);
100
+ }
101
+ var R = /* @__PURE__ */ Object.freeze({
102
+ x: 0,
103
+ y: 0
104
+ });
105
+ function z(e, t) {
106
+ return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
107
+ }
108
+ function B(e, t) {
109
+ let n = i(e);
110
+ if (!n) return "0 0";
111
+ let r = {
112
+ x: (n.x - t.left) / t.width * 100,
113
+ y: (n.y - t.top) / t.height * 100
114
+ };
115
+ return r.x + "% " + r.y + "%";
116
+ }
117
+ function de(e, t) {
118
+ let { data: { value: n } } = e, { data: { value: r } } = t;
119
+ return n - r;
120
+ }
121
+ function fe(e, t) {
122
+ let { data: { value: n } } = e, { data: { value: r } } = t;
123
+ return r - n;
124
+ }
125
+ function V(e) {
126
+ let { left: t, top: n, height: r, width: i } = e;
127
+ return [
128
+ {
129
+ x: t,
130
+ y: n
131
+ },
132
+ {
133
+ x: t + i,
134
+ y: n
135
+ },
136
+ {
137
+ x: t,
138
+ y: n + r
139
+ },
140
+ {
141
+ x: t + i,
142
+ y: n + r
143
+ }
144
+ ];
145
+ }
146
+ function pe(e, t) {
147
+ if (!e || e.length === 0) return null;
148
+ let [n] = e;
149
+ return t ? n[t] : n;
150
+ }
151
+ function me(e, t, n) {
152
+ return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
153
+ x: t + e.width * .5,
154
+ y: n + e.height * .5
155
+ };
156
+ }
157
+ var he = (e) => {
158
+ let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = me(t, t.left, t.top), a = [];
159
+ for (let e of r) {
160
+ let { id: t } = e, r = n.get(t);
161
+ if (r) {
162
+ let n = z(me(r), i);
163
+ a.push({
164
+ id: t,
165
+ data: {
166
+ droppableContainer: e,
167
+ value: n
168
+ }
169
+ });
170
+ }
171
+ }
172
+ return a.sort(de);
173
+ }, ge = (e) => {
174
+ let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = V(t), a = [];
175
+ for (let e of r) {
176
+ let { id: t } = e, r = n.get(t);
177
+ if (r) {
178
+ let n = V(r), o = i.reduce((e, t, r) => e + z(n[r], t), 0), s = Number((o / 4).toFixed(4));
179
+ a.push({
180
+ id: t,
181
+ data: {
182
+ droppableContainer: e,
183
+ value: s
184
+ }
185
+ });
186
+ }
187
+ }
188
+ return a.sort(de);
189
+ };
190
+ function H(e, t) {
191
+ let n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), i = Math.min(t.left + t.width, e.left + e.width), a = Math.min(t.top + t.height, e.top + e.height), o = i - r, s = a - n;
192
+ if (r < i && n < a) {
193
+ let n = t.width * t.height, r = e.width * e.height, i = o * s, a = i / (n + r - i);
194
+ return Number(a.toFixed(4));
195
+ }
196
+ return 0;
197
+ }
198
+ var _e = (e) => {
199
+ let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = [];
200
+ for (let e of r) {
201
+ let { id: r } = e, a = n.get(r);
202
+ if (a) {
203
+ let n = H(a, t);
204
+ n > 0 && i.push({
205
+ id: r,
206
+ data: {
207
+ droppableContainer: e,
208
+ value: n
209
+ }
210
+ });
211
+ }
212
+ }
213
+ return i.sort(fe);
214
+ };
215
+ function ve(e, t, n) {
216
+ return {
217
+ ...e,
218
+ scaleX: t && n ? t.width / n.width : 1,
219
+ scaleY: t && n ? t.height / n.height : 1
220
+ };
221
+ }
222
+ function ye(e, t) {
223
+ return e && t ? {
224
+ x: e.left - t.left,
225
+ y: e.top - t.top
226
+ } : R;
227
+ }
228
+ function U(e) {
229
+ return function(t) {
230
+ return [...arguments].slice(1).reduce((t, n) => ({
231
+ ...t,
232
+ top: t.top + e * n.y,
233
+ bottom: t.bottom + e * n.y,
234
+ left: t.left + e * n.x,
235
+ right: t.right + e * n.x
236
+ }), { ...t });
237
+ };
238
+ }
239
+ var be = /* @__PURE__ */ U(1);
240
+ function xe(e) {
241
+ if (e.startsWith("matrix3d(")) {
242
+ let t = e.slice(9, -1).split(/, /);
243
+ return {
244
+ x: +t[12],
245
+ y: +t[13],
246
+ scaleX: +t[0],
247
+ scaleY: +t[5]
248
+ };
249
+ } else if (e.startsWith("matrix(")) {
250
+ let t = e.slice(7, -1).split(/, /);
251
+ return {
252
+ x: +t[4],
253
+ y: +t[5],
254
+ scaleX: +t[0],
255
+ scaleY: +t[3]
256
+ };
257
+ }
258
+ return null;
259
+ }
260
+ function W(e, t, n) {
261
+ let r = xe(t);
262
+ if (!r) return e;
263
+ let { scaleX: i, scaleY: a, x: o, y: s } = r, c = e.left - o - (1 - i) * parseFloat(n), l = e.top - s - (1 - a) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = i ? e.width / i : e.width, d = a ? e.height / a : e.height;
264
+ return {
265
+ width: u,
266
+ height: d,
267
+ top: l,
268
+ right: c + u,
269
+ bottom: l + d,
270
+ left: c
271
+ };
272
+ }
273
+ var Se = { ignoreTransform: !1 };
274
+ function G(e, t) {
275
+ t === void 0 && (t = Se);
276
+ let n = e.getBoundingClientRect();
277
+ if (t.ignoreTransform) {
278
+ let { transform: t, transformOrigin: r } = o(e).getComputedStyle(e);
279
+ t && (n = W(n, t, r));
280
+ }
281
+ let { top: r, left: i, width: a, height: s, bottom: c, right: l } = n;
282
+ return {
283
+ top: r,
284
+ left: i,
285
+ width: a,
286
+ height: s,
287
+ bottom: c,
288
+ right: l
289
+ };
290
+ }
291
+ function Ce(e) {
292
+ return G(e, { ignoreTransform: !0 });
293
+ }
294
+ function we(e) {
295
+ let t = e.innerWidth, n = e.innerHeight;
296
+ return {
297
+ top: 0,
298
+ left: 0,
299
+ right: t,
300
+ bottom: n,
301
+ width: t,
302
+ height: n
303
+ };
304
+ }
305
+ function Te(e, t) {
306
+ return t === void 0 && (t = o(e).getComputedStyle(e)), t.position === "fixed";
307
+ }
308
+ function K(e, t) {
309
+ t === void 0 && (t = o(e).getComputedStyle(e));
310
+ let n = /(auto|scroll|overlay)/;
311
+ return [
312
+ "overflow",
313
+ "overflowX",
314
+ "overflowY"
315
+ ].some((e) => {
316
+ let r = t[e];
317
+ return typeof r == "string" ? n.test(r) : !1;
318
+ });
319
+ }
320
+ function q(e, t) {
321
+ let n = [];
322
+ function r(i) {
323
+ if (t != null && n.length >= t || !i) return n;
324
+ if (s(i) && i.scrollingElement != null && !n.includes(i.scrollingElement)) return n.push(i.scrollingElement), n;
325
+ if (!c(i) || d(i) || n.includes(i)) return n;
326
+ let a = o(e).getComputedStyle(i);
327
+ return i !== e && K(i, a) && n.push(i), Te(i, a) ? n : r(i.parentNode);
328
+ }
329
+ return e ? r(e) : n;
330
+ }
331
+ function Ee(e) {
332
+ let [t] = q(e, 1);
333
+ return t ?? null;
334
+ }
335
+ function De(e) {
336
+ return !n || !e ? null : f(e) ? e : u(e) ? s(e) || e === a(e).scrollingElement ? window : c(e) ? e : null : null;
337
+ }
338
+ function Oe(e) {
339
+ return f(e) ? e.scrollX : e.scrollLeft;
340
+ }
341
+ function ke(e) {
342
+ return f(e) ? e.scrollY : e.scrollTop;
343
+ }
344
+ function Ae(e) {
345
+ return {
346
+ x: Oe(e),
347
+ y: ke(e)
348
+ };
349
+ }
350
+ var J;
351
+ (function(e) {
352
+ e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
353
+ })(J ||= {});
354
+ function Y(e) {
355
+ return !n || !e ? !1 : e === document.scrollingElement;
356
+ }
357
+ function je(e) {
358
+ let t = {
359
+ x: 0,
360
+ y: 0
361
+ }, n = Y(e) ? {
362
+ height: window.innerHeight,
363
+ width: window.innerWidth
364
+ } : {
365
+ height: e.clientHeight,
366
+ width: e.clientWidth
367
+ }, r = {
368
+ x: e.scrollWidth - n.width,
369
+ y: e.scrollHeight - n.height
370
+ };
371
+ return {
372
+ isTop: e.scrollTop <= t.y,
373
+ isLeft: e.scrollLeft <= t.x,
374
+ isBottom: e.scrollTop >= r.y,
375
+ isRight: e.scrollLeft >= r.x,
376
+ maxScroll: r,
377
+ minScroll: t
378
+ };
379
+ }
380
+ var Me = {
381
+ x: .2,
382
+ y: .2
383
+ };
384
+ function X(e, t, n, r, i) {
385
+ let { top: a, left: o, right: s, bottom: c } = n;
386
+ r === void 0 && (r = 10), i === void 0 && (i = Me);
387
+ let { isTop: l, isBottom: u, isLeft: d, isRight: f } = je(e), p = {
388
+ x: 0,
389
+ y: 0
390
+ }, m = {
391
+ x: 0,
392
+ y: 0
393
+ }, h = {
394
+ height: t.height * i.y,
395
+ width: t.width * i.x
396
+ };
397
+ return !l && a <= t.top + h.height ? (p.y = J.Backward, m.y = r * Math.abs((t.top + h.height - a) / h.height)) : !u && c >= t.bottom - h.height && (p.y = J.Forward, m.y = r * Math.abs((t.bottom - h.height - c) / h.height)), !f && s >= t.right - h.width ? (p.x = J.Forward, m.x = r * Math.abs((t.right - h.width - s) / h.width)) : !d && o <= t.left + h.width && (p.x = J.Backward, m.x = r * Math.abs((t.left + h.width - o) / h.width)), {
398
+ direction: p,
399
+ speed: m
400
+ };
401
+ }
402
+ function Ne(e) {
403
+ if (e === document.scrollingElement) {
404
+ let { innerWidth: e, innerHeight: t } = window;
405
+ return {
406
+ top: 0,
407
+ left: 0,
408
+ right: e,
409
+ bottom: t,
410
+ width: e,
411
+ height: t
412
+ };
413
+ }
414
+ let { top: t, left: n, right: r, bottom: i } = e.getBoundingClientRect();
415
+ return {
416
+ top: t,
417
+ left: n,
418
+ right: r,
419
+ bottom: i,
420
+ width: e.clientWidth,
421
+ height: e.clientHeight
422
+ };
423
+ }
424
+ function Pe(e) {
425
+ return e.reduce((e, n) => t(e, Ae(n)), R);
426
+ }
427
+ function Fe(e) {
428
+ return e.reduce((e, t) => e + Oe(t), 0);
429
+ }
430
+ function Ie(e) {
431
+ return e.reduce((e, t) => e + ke(t), 0);
432
+ }
433
+ function Le(e, t) {
434
+ if (t === void 0 && (t = G), !e) return;
435
+ let { top: n, left: r, bottom: i, right: a } = t(e);
436
+ Ee(e) && (i <= 0 || a <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
437
+ block: "center",
438
+ inline: "center"
439
+ });
440
+ }
441
+ var Re = [[
442
+ "x",
443
+ ["left", "right"],
444
+ Fe
445
+ ], [
446
+ "y",
447
+ ["top", "bottom"],
448
+ Ie
449
+ ]], ze = class {
450
+ constructor(e, t) {
451
+ this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
452
+ let n = q(t), r = Pe(n);
453
+ this.rect = { ...e }, this.width = e.width, this.height = e.height;
454
+ for (let [e, t, i] of Re) for (let a of t) Object.defineProperty(this, a, {
455
+ get: () => {
456
+ let t = i(n), o = r[e] - t;
457
+ return this.rect[a] + o;
458
+ },
459
+ enumerable: !0
460
+ });
461
+ Object.defineProperty(this, "rect", { enumerable: !1 });
462
+ }
463
+ }, Be = class {
464
+ constructor(e) {
465
+ this.target = void 0, this.listeners = [], this.removeAll = () => {
466
+ this.listeners.forEach((e) => this.target?.removeEventListener(...e));
467
+ }, this.target = e;
468
+ }
469
+ add(e, t, n) {
470
+ var r;
471
+ (r = this.target) == null || r.addEventListener(e, t, n), this.listeners.push([
472
+ e,
473
+ t,
474
+ n
475
+ ]);
476
+ }
477
+ };
478
+ function Ve(e) {
479
+ let { EventTarget: t } = o(e);
480
+ return e instanceof t ? e : a(e);
481
+ }
482
+ function He(e, t) {
483
+ let n = Math.abs(e.x), r = Math.abs(e.y);
484
+ return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
485
+ }
486
+ var Z;
487
+ (function(e) {
488
+ e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
489
+ })(Z ||= {});
490
+ function Ue(e) {
491
+ e.preventDefault();
492
+ }
493
+ function We(e) {
494
+ e.stopPropagation();
495
+ }
496
+ var Q;
497
+ (function(e) {
498
+ e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
499
+ })(Q ||= {});
500
+ var Ge = {
501
+ start: [Q.Space, Q.Enter],
502
+ cancel: [Q.Esc],
503
+ end: [
504
+ Q.Space,
505
+ Q.Enter,
506
+ Q.Tab
507
+ ]
508
+ }, Ke = (e, t) => {
509
+ let { currentCoordinates: n } = t;
510
+ switch (e.code) {
511
+ case Q.Right: return {
512
+ ...n,
513
+ x: n.x + 25
514
+ };
515
+ case Q.Left: return {
516
+ ...n,
517
+ x: n.x - 25
518
+ };
519
+ case Q.Down: return {
520
+ ...n,
521
+ y: n.y + 25
522
+ };
523
+ case Q.Up: return {
524
+ ...n,
525
+ y: n.y - 25
526
+ };
527
+ }
528
+ }, qe = class {
529
+ constructor(e) {
530
+ this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = e;
531
+ let { event: { target: t } } = e;
532
+ this.props = e, this.listeners = new Be(a(t)), this.windowListeners = new Be(o(t)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
533
+ }
534
+ attach() {
535
+ this.handleStart(), this.windowListeners.add(Z.Resize, this.handleCancel), this.windowListeners.add(Z.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Z.Keydown, this.handleKeyDown));
536
+ }
537
+ handleStart() {
538
+ let { activeNode: e, onStart: t } = this.props, n = e.node.current;
539
+ n && Le(n), t(R);
540
+ }
541
+ handleKeyDown(e) {
542
+ if (l(e)) {
543
+ let { active: n, context: r, options: i } = this.props, { keyboardCodes: a = Ge, coordinateGetter: o = Ke, scrollBehavior: s = "smooth" } = i, { code: c } = e;
544
+ if (a.end.includes(c)) {
545
+ this.handleEnd(e);
546
+ return;
547
+ }
548
+ if (a.cancel.includes(c)) {
549
+ this.handleCancel(e);
550
+ return;
551
+ }
552
+ let { collisionRect: l } = r.current, u = l ? {
553
+ x: l.left,
554
+ y: l.top
555
+ } : R;
556
+ this.referenceCoordinates ||= u;
557
+ let d = o(e, {
558
+ active: n,
559
+ context: r.current,
560
+ currentCoordinates: u
561
+ });
562
+ if (d) {
563
+ let n = p(d, u), i = {
564
+ x: 0,
565
+ y: 0
566
+ }, { scrollableAncestors: a } = r.current;
567
+ for (let t of a) {
568
+ let r = e.code, { isTop: a, isRight: o, isLeft: c, isBottom: l, maxScroll: u, minScroll: f } = je(t), p = Ne(t), m = {
569
+ x: Math.min(r === Q.Right ? p.right - p.width / 2 : p.right, Math.max(r === Q.Right ? p.left : p.left + p.width / 2, d.x)),
570
+ y: Math.min(r === Q.Down ? p.bottom - p.height / 2 : p.bottom, Math.max(r === Q.Down ? p.top : p.top + p.height / 2, d.y))
571
+ }, h = r === Q.Right && !o || r === Q.Left && !c, g = r === Q.Down && !l || r === Q.Up && !a;
572
+ if (h && m.x !== d.x) {
573
+ let e = t.scrollLeft + n.x, a = r === Q.Right && e <= u.x || r === Q.Left && e >= f.x;
574
+ if (a && !n.y) {
575
+ t.scrollTo({
576
+ left: e,
577
+ behavior: s
578
+ });
579
+ return;
580
+ }
581
+ a ? i.x = t.scrollLeft - e : i.x = r === Q.Right ? t.scrollLeft - u.x : t.scrollLeft - f.x, i.x && t.scrollBy({
582
+ left: -i.x,
583
+ behavior: s
584
+ });
585
+ break;
586
+ } else if (g && m.y !== d.y) {
587
+ let e = t.scrollTop + n.y, a = r === Q.Down && e <= u.y || r === Q.Up && e >= f.y;
588
+ if (a && !n.x) {
589
+ t.scrollTo({
590
+ top: e,
591
+ behavior: s
592
+ });
593
+ return;
594
+ }
595
+ a ? i.y = t.scrollTop - e : i.y = r === Q.Down ? t.scrollTop - u.y : t.scrollTop - f.y, i.y && t.scrollBy({
596
+ top: -i.y,
597
+ behavior: s
598
+ });
599
+ break;
600
+ }
601
+ }
602
+ this.handleMove(e, t(p(d, this.referenceCoordinates), i));
603
+ }
604
+ }
605
+ }
606
+ handleMove(e, t) {
607
+ let { onMove: n } = this.props;
608
+ e.preventDefault(), n(t);
609
+ }
610
+ handleEnd(e) {
611
+ let { onEnd: t } = this.props;
612
+ e.preventDefault(), this.detach(), t();
613
+ }
614
+ handleCancel(e) {
615
+ let { onCancel: t } = this.props;
616
+ e.preventDefault(), this.detach(), t();
617
+ }
618
+ detach() {
619
+ this.listeners.removeAll(), this.windowListeners.removeAll();
620
+ }
621
+ };
622
+ qe.activators = [{
623
+ eventName: "onKeyDown",
624
+ handler: (e, t, n) => {
625
+ let { keyboardCodes: r = Ge, onActivation: i } = t, { active: a } = n, { code: o } = e.nativeEvent;
626
+ if (r.start.includes(o)) {
627
+ let t = a.activatorNode.current;
628
+ return t && e.target !== t ? !1 : (e.preventDefault(), i?.({ event: e.nativeEvent }), !0);
629
+ }
630
+ return !1;
631
+ }
632
+ }];
633
+ function Je(e) {
634
+ return !!(e && "distance" in e);
635
+ }
636
+ function Ye(e) {
637
+ return !!(e && "delay" in e);
638
+ }
639
+ var Xe = class {
640
+ constructor(e, t, n) {
641
+ n === void 0 && (n = Ve(e.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = e, this.events = t;
642
+ let { event: r } = e, { target: s } = r;
643
+ this.props = e, this.events = t, this.document = a(s), this.documentListeners = new Be(this.document), this.listeners = new Be(n), this.windowListeners = new Be(o(s)), this.initialCoordinates = i(r) ?? R, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
644
+ }
645
+ attach() {
646
+ let { events: e, props: { options: { activationConstraint: t, bypassActivationConstraint: n } } } = this;
647
+ if (this.listeners.add(e.move.name, this.handleMove, { passive: !1 }), this.listeners.add(e.end.name, this.handleEnd), e.cancel && this.listeners.add(e.cancel.name, this.handleCancel), this.windowListeners.add(Z.Resize, this.handleCancel), this.windowListeners.add(Z.DragStart, Ue), this.windowListeners.add(Z.VisibilityChange, this.handleCancel), this.windowListeners.add(Z.ContextMenu, Ue), this.documentListeners.add(Z.Keydown, this.handleKeydown), t) {
648
+ if (n != null && n({
649
+ event: this.props.event,
650
+ activeNode: this.props.activeNode,
651
+ options: this.props.options
652
+ })) return this.handleStart();
653
+ if (Ye(t)) {
654
+ this.timeoutId = setTimeout(this.handleStart, t.delay), this.handlePending(t);
655
+ return;
656
+ }
657
+ if (Je(t)) {
658
+ this.handlePending(t);
659
+ return;
660
+ }
661
+ }
662
+ this.handleStart();
663
+ }
664
+ detach() {
665
+ this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
666
+ }
667
+ handlePending(e, t) {
668
+ let { active: n, onPending: r } = this.props;
669
+ r(n, e, this.initialCoordinates, t);
670
+ }
671
+ handleStart() {
672
+ let { initialCoordinates: e } = this, { onStart: t } = this.props;
673
+ e && (this.activated = !0, this.documentListeners.add(Z.Click, We, { capture: !0 }), this.removeTextSelection(), this.documentListeners.add(Z.SelectionChange, this.removeTextSelection), t(e));
674
+ }
675
+ handleMove(e) {
676
+ let { activated: t, initialCoordinates: n, props: r } = this, { onMove: a, options: { activationConstraint: o } } = r;
677
+ if (!n) return;
678
+ let s = i(e) ?? R, c = p(n, s);
679
+ if (!t && o) {
680
+ if (Je(o)) {
681
+ if (o.tolerance != null && He(c, o.tolerance)) return this.handleCancel();
682
+ if (He(c, o.distance)) return this.handleStart();
683
+ }
684
+ if (Ye(o) && He(c, o.tolerance)) return this.handleCancel();
685
+ this.handlePending(o, c);
686
+ return;
687
+ }
688
+ e.cancelable && e.preventDefault(), a(s);
689
+ }
690
+ handleEnd() {
691
+ let { onAbort: e, onEnd: t } = this.props;
692
+ this.detach(), this.activated || e(this.props.active), t();
693
+ }
694
+ handleCancel() {
695
+ let { onAbort: e, onCancel: t } = this.props;
696
+ this.detach(), this.activated || e(this.props.active), t();
697
+ }
698
+ handleKeydown(e) {
699
+ e.code === Q.Esc && this.handleCancel();
700
+ }
701
+ removeTextSelection() {
702
+ var e;
703
+ (e = this.document.getSelection()) == null || e.removeAllRanges();
704
+ }
705
+ }, Ze = {
706
+ cancel: { name: "pointercancel" },
707
+ move: { name: "pointermove" },
708
+ end: { name: "pointerup" }
709
+ }, Qe = class extends Xe {
710
+ constructor(e) {
711
+ let { event: t } = e, n = a(t.target);
712
+ super(e, Ze, n);
713
+ }
714
+ };
715
+ Qe.activators = [{
716
+ eventName: "onPointerDown",
717
+ handler: (e, t) => {
718
+ let { nativeEvent: n } = e, { onActivation: r } = t;
719
+ return !n.isPrimary || n.button !== 0 ? !1 : (r?.({ event: n }), !0);
720
+ }
721
+ }];
722
+ var $e = {
723
+ move: { name: "mousemove" },
724
+ end: { name: "mouseup" }
725
+ }, et;
726
+ (function(e) {
727
+ e[e.RightClick = 2] = "RightClick";
728
+ })(et ||= {});
729
+ var tt = class extends Xe {
730
+ constructor(e) {
731
+ super(e, $e, a(e.event.target));
732
+ }
733
+ };
734
+ tt.activators = [{
735
+ eventName: "onMouseDown",
736
+ handler: (e, t) => {
737
+ let { nativeEvent: n } = e, { onActivation: r } = t;
738
+ return n.button === et.RightClick ? !1 : (r?.({ event: n }), !0);
739
+ }
740
+ }];
741
+ var nt = {
742
+ cancel: { name: "touchcancel" },
743
+ move: { name: "touchmove" },
744
+ end: { name: "touchend" }
745
+ }, rt = class extends Xe {
746
+ constructor(e) {
747
+ super(e, nt);
748
+ }
749
+ static setup() {
750
+ return window.addEventListener(nt.move.name, e, {
751
+ capture: !1,
752
+ passive: !1
753
+ }), function() {
754
+ window.removeEventListener(nt.move.name, e);
755
+ };
756
+ function e() {}
757
+ }
758
+ };
759
+ rt.activators = [{
760
+ eventName: "onTouchStart",
761
+ handler: (e, t) => {
762
+ let { nativeEvent: n } = e, { onActivation: r } = t, { touches: i } = n;
763
+ return i.length > 1 ? !1 : (r?.({ event: n }), !0);
764
+ }
765
+ }];
766
+ var it;
767
+ (function(e) {
768
+ e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
769
+ })(it ||= {});
770
+ var at;
771
+ (function(e) {
772
+ e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
773
+ })(at ||= {});
774
+ function ot(e) {
775
+ let { acceleration: t, activator: n = it.Pointer, canScroll: r, draggingRect: i, enabled: a, interval: o = 5, order: s = at.TreeOrder, pointerCoordinates: c, scrollableAncestors: l, scrollableAncestorRects: u, delta: d, threshold: f } = e, p = ct({
776
+ delta: d,
777
+ disabled: !a
778
+ }), [m, g] = h(), _ = M({
779
+ x: 0,
780
+ y: 0
781
+ }), v = M({
782
+ x: 0,
783
+ y: 0
784
+ }), y = j(() => {
785
+ switch (n) {
786
+ case it.Pointer: return c ? {
787
+ top: c.y,
788
+ bottom: c.y,
789
+ left: c.x,
790
+ right: c.x
791
+ } : null;
792
+ case it.DraggableRect: return i;
793
+ }
794
+ }, [
795
+ n,
796
+ i,
797
+ c
798
+ ]), b = M(null), x = O(() => {
799
+ let e = b.current;
800
+ if (!e) return;
801
+ let t = _.current.x * v.current.x, n = _.current.y * v.current.y;
802
+ e.scrollBy(t, n);
803
+ }, []), S = j(() => s === at.TreeOrder ? [...l].reverse() : l, [s, l]);
804
+ A(() => {
805
+ if (!a || !l.length || !y) {
806
+ g();
807
+ return;
808
+ }
809
+ for (let e of S) {
810
+ if (r?.(e) === !1) continue;
811
+ let n = u[l.indexOf(e)];
812
+ if (!n) continue;
813
+ let { direction: i, speed: a } = X(e, n, y, t, f);
814
+ for (let e of ["x", "y"]) p[e][i[e]] || (a[e] = 0, i[e] = 0);
815
+ if (a.x > 0 || a.y > 0) {
816
+ g(), b.current = e, m(x, o), _.current = a, v.current = i;
817
+ return;
818
+ }
819
+ }
820
+ _.current = {
821
+ x: 0,
822
+ y: 0
823
+ }, v.current = {
824
+ x: 0,
825
+ y: 0
826
+ }, g();
827
+ }, [
828
+ t,
829
+ x,
830
+ r,
831
+ g,
832
+ a,
833
+ o,
834
+ JSON.stringify(y),
835
+ JSON.stringify(p),
836
+ m,
837
+ l,
838
+ S,
839
+ u,
840
+ JSON.stringify(f)
841
+ ]);
842
+ }
843
+ var st = {
844
+ x: {
845
+ [J.Backward]: !1,
846
+ [J.Forward]: !1
847
+ },
848
+ y: {
849
+ [J.Backward]: !1,
850
+ [J.Forward]: !1
851
+ }
852
+ };
853
+ function ct(e) {
854
+ let { delta: t, disabled: n } = e, r = b(t);
855
+ return v((e) => {
856
+ if (n || !r || !e) return st;
857
+ let i = {
858
+ x: Math.sign(t.x - r.x),
859
+ y: Math.sign(t.y - r.y)
860
+ };
861
+ return {
862
+ x: {
863
+ [J.Backward]: e.x[J.Backward] || i.x === -1,
864
+ [J.Forward]: e.x[J.Forward] || i.x === 1
865
+ },
866
+ y: {
867
+ [J.Backward]: e.y[J.Backward] || i.y === -1,
868
+ [J.Forward]: e.y[J.Forward] || i.y === 1
869
+ }
870
+ };
871
+ }, [
872
+ n,
873
+ t,
874
+ r
875
+ ]);
876
+ }
877
+ function lt(e, t) {
878
+ let n = t == null ? void 0 : e.get(t), r = n ? n.node.current : null;
879
+ return v((e) => t == null ? null : r ?? e ?? null, [r, t]);
880
+ }
881
+ function ut(e, t) {
882
+ return j(() => e.reduce((e, n) => {
883
+ let { sensor: r } = n, i = r.activators.map((e) => ({
884
+ eventName: e.eventName,
885
+ handler: t(e.handler, n)
886
+ }));
887
+ return [...e, ...i];
888
+ }, []), [e, t]);
889
+ }
890
+ var dt;
891
+ (function(e) {
892
+ e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
893
+ })(dt ||= {});
894
+ var ft;
895
+ (function(e) {
896
+ e.Optimized = "optimized";
897
+ })(ft ||= {});
898
+ var pt = /* @__PURE__ */ new Map();
899
+ function mt(e, t) {
900
+ let { dragging: n, dependencies: r, config: i } = t, [a, o] = N(null), { frequency: s, measure: c, strategy: l } = i, u = M(e), d = g(), f = _(d), p = O(function(e) {
901
+ e === void 0 && (e = []), !f.current && o((t) => t === null ? e : t.concat(e.filter((e) => !t.includes(e))));
902
+ }, [f]), m = M(null), h = v((t) => {
903
+ if (d && !n) return pt;
904
+ if (!t || t === pt || u.current !== e || a != null) {
905
+ let t = /* @__PURE__ */ new Map();
906
+ for (let n of e) {
907
+ if (!n) continue;
908
+ if (a && a.length > 0 && !a.includes(n.id) && n.rect.current) {
909
+ t.set(n.id, n.rect.current);
910
+ continue;
911
+ }
912
+ let e = n.node.current, r = e ? new ze(c(e), e) : null;
913
+ n.rect.current = r, r && t.set(n.id, r);
914
+ }
915
+ return t;
916
+ }
917
+ return t;
918
+ }, [
919
+ e,
920
+ a,
921
+ n,
922
+ d,
923
+ c
924
+ ]);
925
+ return A(() => {
926
+ u.current = e;
927
+ }, [e]), A(() => {
928
+ d || p();
929
+ }, [n, d]), A(() => {
930
+ a && a.length > 0 && o(null);
931
+ }, [JSON.stringify(a)]), A(() => {
932
+ d || typeof s != "number" || m.current !== null || (m.current = setTimeout(() => {
933
+ p(), m.current = null;
934
+ }, s));
935
+ }, [
936
+ s,
937
+ d,
938
+ p,
939
+ ...r
940
+ ]), {
941
+ droppableRects: h,
942
+ measureDroppableContainers: p,
943
+ measuringScheduled: a != null
944
+ };
945
+ function g() {
946
+ switch (l) {
947
+ case dt.Always: return !1;
948
+ case dt.BeforeDragging: return n;
949
+ default: return !n;
950
+ }
951
+ }
952
+ }
953
+ function ht(e, t) {
954
+ return v((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
955
+ }
956
+ function gt(e, t) {
957
+ return ht(e, t);
958
+ }
959
+ function _t(e) {
960
+ let { callback: t, disabled: n } = e, r = m(t), i = j(() => {
961
+ if (n || typeof window > "u" || window.MutationObserver === void 0) return;
962
+ let { MutationObserver: e } = window;
963
+ return new e(r);
964
+ }, [r, n]);
965
+ return A(() => () => i?.disconnect(), [i]), i;
966
+ }
967
+ function vt(e) {
968
+ let { callback: t, disabled: n } = e, r = m(t), i = j(() => {
969
+ if (n || typeof window > "u" || window.ResizeObserver === void 0) return;
970
+ let { ResizeObserver: e } = window;
971
+ return new e(r);
972
+ }, [n]);
973
+ return A(() => () => i?.disconnect(), [i]), i;
974
+ }
975
+ function yt(e) {
976
+ return new ze(G(e), e);
977
+ }
978
+ function bt(e, t, n) {
979
+ t === void 0 && (t = yt);
980
+ let [r, i] = N(null);
981
+ function a() {
982
+ i((r) => {
983
+ if (!e) return null;
984
+ if (e.isConnected === !1) return r ?? n ?? null;
985
+ let i = t(e);
986
+ return JSON.stringify(r) === JSON.stringify(i) ? r : i;
987
+ });
988
+ }
989
+ let o = _t({ callback(t) {
990
+ if (e) for (let n of t) {
991
+ let { type: t, target: r } = n;
992
+ if (t === "childList" && r instanceof HTMLElement && r.contains(e)) {
993
+ a();
994
+ break;
995
+ }
996
+ }
997
+ } }), s = vt({ callback: a });
998
+ return g(() => {
999
+ a(), e ? (s?.observe(e), o?.observe(document.body, {
1000
+ childList: !0,
1001
+ subtree: !0
1002
+ })) : (s?.disconnect(), o?.disconnect());
1003
+ }, [e]), r;
1004
+ }
1005
+ function xt(e) {
1006
+ return ye(e, ht(e));
1007
+ }
1008
+ var St = [];
1009
+ function Ct(e) {
1010
+ let t = M(e), n = v((n) => e ? n && n !== St && e && t.current && e.parentNode === t.current.parentNode ? n : q(e) : St, [e]);
1011
+ return A(() => {
1012
+ t.current = e;
1013
+ }, [e]), n;
1014
+ }
1015
+ function wt(e) {
1016
+ let [n, r] = N(null), i = M(e), a = O((e) => {
1017
+ let t = De(e.target);
1018
+ t && r((e) => e ? (e.set(t, Ae(t)), new Map(e)) : null);
1019
+ }, []);
1020
+ return A(() => {
1021
+ let t = i.current;
1022
+ if (e !== t) {
1023
+ n(t);
1024
+ let o = e.map((e) => {
1025
+ let t = De(e);
1026
+ return t ? (t.addEventListener("scroll", a, { passive: !0 }), [t, Ae(t)]) : null;
1027
+ }).filter((e) => e != null);
1028
+ r(o.length ? new Map(o) : null), i.current = e;
1029
+ }
1030
+ return () => {
1031
+ n(e), n(t);
1032
+ };
1033
+ function n(e) {
1034
+ e.forEach((e) => {
1035
+ De(e)?.removeEventListener("scroll", a);
1036
+ });
1037
+ }
1038
+ }, [a, e]), j(() => e.length ? n ? Array.from(n.values()).reduce((e, n) => t(e, n), R) : Pe(e) : R, [e, n]);
1039
+ }
1040
+ function Tt(e, t) {
1041
+ t === void 0 && (t = []);
1042
+ let n = M(null);
1043
+ return A(() => {
1044
+ n.current = null;
1045
+ }, t), A(() => {
1046
+ let t = e !== R;
1047
+ t && !n.current && (n.current = e), !t && n.current && (n.current = null);
1048
+ }, [e]), n.current ? p(e, n.current) : R;
1049
+ }
1050
+ function Et(e) {
1051
+ A(() => {
1052
+ if (!n) return;
1053
+ let t = e.map((e) => {
1054
+ let { sensor: t } = e;
1055
+ return t.setup == null ? void 0 : t.setup();
1056
+ });
1057
+ return () => {
1058
+ for (let e of t) e?.();
1059
+ };
1060
+ }, e.map((e) => {
1061
+ let { sensor: t } = e;
1062
+ return t;
1063
+ }));
1064
+ }
1065
+ function Dt(e, t) {
1066
+ return j(() => e.reduce((e, n) => {
1067
+ let { eventName: r, handler: i } = n;
1068
+ return e[r] = (e) => {
1069
+ i(e, t);
1070
+ }, e;
1071
+ }, {}), [e, t]);
1072
+ }
1073
+ function Ot(e) {
1074
+ return j(() => e ? we(e) : null, [e]);
1075
+ }
1076
+ var kt = [];
1077
+ function At(e, t) {
1078
+ t === void 0 && (t = G);
1079
+ let [n] = e, r = Ot(n ? o(n) : null), [i, a] = N(kt);
1080
+ function s() {
1081
+ a(() => e.length ? e.map((e) => Y(e) ? r : new ze(t(e), e)) : kt);
1082
+ }
1083
+ let c = vt({ callback: s });
1084
+ return g(() => {
1085
+ c?.disconnect(), s(), e.forEach((e) => c?.observe(e));
1086
+ }, [e]), i;
1087
+ }
1088
+ function jt(e) {
1089
+ if (!e) return null;
1090
+ if (e.children.length > 1) return e;
1091
+ let t = e.children[0];
1092
+ return c(t) ? t : e;
1093
+ }
1094
+ function Mt(e) {
1095
+ let { measure: t } = e, [n, r] = N(null), i = vt({ callback: O((e) => {
1096
+ for (let { target: n } of e) if (c(n)) {
1097
+ r((e) => {
1098
+ let r = t(n);
1099
+ return e ? {
1100
+ ...e,
1101
+ width: r.width,
1102
+ height: r.height
1103
+ } : r;
1104
+ });
1105
+ break;
1106
+ }
1107
+ }, [t]) }), [a, o] = y(O((e) => {
1108
+ let n = jt(e);
1109
+ i?.disconnect(), n && i?.observe(n), r(n ? t(n) : null);
1110
+ }, [t, i]));
1111
+ return j(() => ({
1112
+ nodeRef: a,
1113
+ rect: n,
1114
+ setRef: o
1115
+ }), [
1116
+ n,
1117
+ a,
1118
+ o
1119
+ ]);
1120
+ }
1121
+ var Nt = [{
1122
+ sensor: Qe,
1123
+ options: {}
1124
+ }, {
1125
+ sensor: qe,
1126
+ options: {}
1127
+ }], Pt = { current: {} }, Ft = {
1128
+ draggable: { measure: Ce },
1129
+ droppable: {
1130
+ measure: Ce,
1131
+ strategy: dt.WhileDragging,
1132
+ frequency: ft.Optimized
1133
+ },
1134
+ dragOverlay: { measure: G }
1135
+ }, It = class extends Map {
1136
+ get(e) {
1137
+ return e == null ? void 0 : super.get(e) ?? void 0;
1138
+ }
1139
+ toArray() {
1140
+ return Array.from(this.values());
1141
+ }
1142
+ getEnabled() {
1143
+ return this.toArray().filter((e) => {
1144
+ let { disabled: t } = e;
1145
+ return !t;
1146
+ });
1147
+ }
1148
+ getNodeFor(e) {
1149
+ return this.get(e)?.node.current ?? void 0;
1150
+ }
1151
+ }, Lt = {
1152
+ activatorEvent: null,
1153
+ active: null,
1154
+ activeNode: null,
1155
+ activeNodeRect: null,
1156
+ collisions: null,
1157
+ containerNodeRect: null,
1158
+ draggableNodes: /* @__PURE__ */ new Map(),
1159
+ droppableRects: /* @__PURE__ */ new Map(),
1160
+ droppableContainers: /* @__PURE__ */ new It(),
1161
+ over: null,
1162
+ dragOverlay: {
1163
+ nodeRef: { current: null },
1164
+ rect: null,
1165
+ setRef: le
1166
+ },
1167
+ scrollableAncestors: [],
1168
+ scrollableAncestorRects: [],
1169
+ measuringConfiguration: Ft,
1170
+ measureDroppableContainers: le,
1171
+ windowRect: null,
1172
+ measuringScheduled: !1
1173
+ }, Rt = {
1174
+ activatorEvent: null,
1175
+ activators: [],
1176
+ active: null,
1177
+ activeNodeRect: null,
1178
+ ariaDescribedById: { draggable: "" },
1179
+ dispatch: le,
1180
+ draggableNodes: /* @__PURE__ */ new Map(),
1181
+ over: null,
1182
+ measureDroppableContainers: le
1183
+ }, zt = /* @__PURE__ */ D(Rt), Bt = /* @__PURE__ */ D(Lt);
1184
+ function Vt() {
1185
+ return {
1186
+ draggable: {
1187
+ active: null,
1188
+ initialCoordinates: {
1189
+ x: 0,
1190
+ y: 0
1191
+ },
1192
+ nodes: /* @__PURE__ */ new Map(),
1193
+ translate: {
1194
+ x: 0,
1195
+ y: 0
1196
+ }
1197
+ },
1198
+ droppable: { containers: new It() }
1199
+ };
1200
+ }
1201
+ function Ht(e, t) {
1202
+ switch (t.type) {
1203
+ case I.DragStart: return {
1204
+ ...e,
1205
+ draggable: {
1206
+ ...e.draggable,
1207
+ initialCoordinates: t.initialCoordinates,
1208
+ active: t.active
1209
+ }
1210
+ };
1211
+ case I.DragMove: return e.draggable.active == null ? e : {
1212
+ ...e,
1213
+ draggable: {
1214
+ ...e.draggable,
1215
+ translate: {
1216
+ x: t.coordinates.x - e.draggable.initialCoordinates.x,
1217
+ y: t.coordinates.y - e.draggable.initialCoordinates.y
1218
+ }
1219
+ }
1220
+ };
1221
+ case I.DragEnd:
1222
+ case I.DragCancel: return {
1223
+ ...e,
1224
+ draggable: {
1225
+ ...e.draggable,
1226
+ active: null,
1227
+ initialCoordinates: {
1228
+ x: 0,
1229
+ y: 0
1230
+ },
1231
+ translate: {
1232
+ x: 0,
1233
+ y: 0
1234
+ }
1235
+ }
1236
+ };
1237
+ case I.RegisterDroppable: {
1238
+ let { element: n } = t, { id: r } = n, i = new It(e.droppable.containers);
1239
+ return i.set(r, n), {
1240
+ ...e,
1241
+ droppable: {
1242
+ ...e.droppable,
1243
+ containers: i
1244
+ }
1245
+ };
1246
+ }
1247
+ case I.SetDroppableDisabled: {
1248
+ let { id: n, key: r, disabled: i } = t, a = e.droppable.containers.get(n);
1249
+ if (!a || r !== a.key) return e;
1250
+ let o = new It(e.droppable.containers);
1251
+ return o.set(n, {
1252
+ ...a,
1253
+ disabled: i
1254
+ }), {
1255
+ ...e,
1256
+ droppable: {
1257
+ ...e.droppable,
1258
+ containers: o
1259
+ }
1260
+ };
1261
+ }
1262
+ case I.UnregisterDroppable: {
1263
+ let { id: n, key: r } = t, i = e.droppable.containers.get(n);
1264
+ if (!i || r !== i.key) return e;
1265
+ let a = new It(e.droppable.containers);
1266
+ return a.delete(n), {
1267
+ ...e,
1268
+ droppable: {
1269
+ ...e.droppable,
1270
+ containers: a
1271
+ }
1272
+ };
1273
+ }
1274
+ default: return e;
1275
+ }
1276
+ }
1277
+ function Ut(e) {
1278
+ let { disabled: t } = e, { active: n, activatorEvent: i, draggableNodes: a } = k(zt), o = b(i), s = b(n?.id);
1279
+ return A(() => {
1280
+ if (!t && !i && o && s != null) {
1281
+ if (!l(o) || document.activeElement === o.target) return;
1282
+ let e = a.get(s);
1283
+ if (!e) return;
1284
+ let { activatorNode: t, node: n } = e;
1285
+ if (!t.current && !n.current) return;
1286
+ requestAnimationFrame(() => {
1287
+ for (let e of [t.current, n.current]) {
1288
+ if (!e) continue;
1289
+ let t = r(e);
1290
+ if (t) {
1291
+ t.focus();
1292
+ break;
1293
+ }
1294
+ }
1295
+ });
1296
+ }
1297
+ }, [
1298
+ i,
1299
+ t,
1300
+ a,
1301
+ s,
1302
+ o
1303
+ ]), null;
1304
+ }
1305
+ function Wt(e, t) {
1306
+ let { transform: n, ...r } = t;
1307
+ return e != null && e.length ? e.reduce((e, t) => t({
1308
+ transform: e,
1309
+ ...r
1310
+ }), n) : n;
1311
+ }
1312
+ function Gt(e) {
1313
+ return j(() => ({
1314
+ draggable: {
1315
+ ...Ft.draggable,
1316
+ ...e?.draggable
1317
+ },
1318
+ droppable: {
1319
+ ...Ft.droppable,
1320
+ ...e?.droppable
1321
+ },
1322
+ dragOverlay: {
1323
+ ...Ft.dragOverlay,
1324
+ ...e?.dragOverlay
1325
+ }
1326
+ }), [
1327
+ e?.draggable,
1328
+ e?.droppable,
1329
+ e?.dragOverlay
1330
+ ]);
1331
+ }
1332
+ function Kt(e) {
1333
+ let { activeNode: t, measure: n, initialRect: r, config: i = !0 } = e, a = M(!1), { x: o, y: s } = typeof i == "boolean" ? {
1334
+ x: i,
1335
+ y: i
1336
+ } : i;
1337
+ g(() => {
1338
+ if (!o && !s || !t) {
1339
+ a.current = !1;
1340
+ return;
1341
+ }
1342
+ if (a.current || !r) return;
1343
+ let e = t?.node.current;
1344
+ if (!e || e.isConnected === !1) return;
1345
+ let i = ye(n(e), r);
1346
+ if (o || (i.x = 0), s || (i.y = 0), a.current = !0, Math.abs(i.x) > 0 || Math.abs(i.y) > 0) {
1347
+ let t = Ee(e);
1348
+ t && t.scrollBy({
1349
+ top: i.y,
1350
+ left: i.x
1351
+ });
1352
+ }
1353
+ }, [
1354
+ t,
1355
+ o,
1356
+ s,
1357
+ r,
1358
+ n
1359
+ ]);
1360
+ }
1361
+ var qt = /* @__PURE__ */ D({
1362
+ ...R,
1363
+ scaleX: 1,
1364
+ scaleY: 1
1365
+ }), $;
1366
+ (function(e) {
1367
+ e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
1368
+ })($ ||= {});
1369
+ var Jt = /* @__PURE__ */ te(function(e) {
1370
+ let { id: n, accessibility: r, autoScroll: a = !0, children: s, sensors: c = Nt, collisionDetection: l = _e, measuring: u, modifiers: d, ...f } = e, [p, m] = ne(Ht, void 0, Vt), [h, v] = oe(), [y, b] = N($.Uninitialized), S = y === $.Initialized, { draggable: { active: C, nodes: w, translate: E }, droppable: { containers: D } } = p, ee = C == null ? null : w.get(C), te = M({
1371
+ initial: null,
1372
+ translated: null
1373
+ }), k = j(() => C == null ? null : {
1374
+ id: C,
1375
+ data: ee?.data ?? Pt,
1376
+ rect: te
1377
+ }, [C, ee]), P = M(null), [ae, se] = N(null), [F, le] = N(null), L = _(f, Object.values(f)), ue = x("DndDescribedBy", n), R = j(() => D.getEnabled(), [D]), z = Gt(u), { droppableRects: B, measureDroppableContainers: de, measuringScheduled: fe } = mt(R, {
1378
+ dragging: S,
1379
+ dependencies: [E.x, E.y],
1380
+ config: z.droppable
1381
+ }), V = lt(w, C), me = j(() => F ? i(F) : null, [F]), he = Be(), ge = gt(V, z.draggable.measure);
1382
+ Kt({
1383
+ activeNode: C == null ? null : w.get(C),
1384
+ config: he.layoutShiftCompensation,
1385
+ initialRect: ge,
1386
+ measure: z.draggable.measure
1387
+ });
1388
+ let H = bt(V, z.draggable.measure, ge), ye = bt(V ? V.parentElement : null), U = M({
1389
+ activatorEvent: null,
1390
+ active: null,
1391
+ activeNode: V,
1392
+ collisionRect: null,
1393
+ collisions: null,
1394
+ droppableRects: B,
1395
+ draggableNodes: w,
1396
+ draggingNode: null,
1397
+ draggingNodeRect: null,
1398
+ droppableContainers: D,
1399
+ over: null,
1400
+ scrollableAncestors: [],
1401
+ scrollAdjustedTranslate: null
1402
+ }), xe = D.getNodeFor(U.current.over?.id), W = Mt({ measure: z.dragOverlay.measure }), Se = W.nodeRef.current ?? V, G = S ? W.rect ?? H : null, Ce = !!(W.nodeRef.current && W.rect), we = xt(Ce ? null : H), Te = Ot(Se ? o(Se) : null), K = Ct(S ? xe ?? V : null), q = At(K), Ee = Wt(d, {
1403
+ transform: {
1404
+ x: E.x - we.x,
1405
+ y: E.y - we.y,
1406
+ scaleX: 1,
1407
+ scaleY: 1
1408
+ },
1409
+ activatorEvent: F,
1410
+ active: k,
1411
+ activeNodeRect: H,
1412
+ containerNodeRect: ye,
1413
+ draggingNodeRect: G,
1414
+ over: U.current.over,
1415
+ overlayNodeRect: W.rect,
1416
+ scrollableAncestors: K,
1417
+ scrollableAncestorRects: q,
1418
+ windowRect: Te
1419
+ }), De = me ? t(me, E) : null, Oe = wt(K), ke = Tt(Oe), Ae = Tt(Oe, [H]), J = t(Ee, ke), Y = G ? be(G, Ee) : null, je = k && Y ? l({
1420
+ active: k,
1421
+ collisionRect: Y,
1422
+ droppableRects: B,
1423
+ droppableContainers: R,
1424
+ pointerCoordinates: De
1425
+ }) : null, Me = pe(je, "id"), [X, Ne] = N(null), Pe = ve(Ce ? Ee : t(Ee, Ae), X?.rect ?? null, H), Fe = M(null), Ie = O((e, t) => {
1426
+ let { sensor: n, options: r } = t;
1427
+ if (P.current == null) return;
1428
+ let i = w.get(P.current);
1429
+ if (!i) return;
1430
+ let a = e.nativeEvent;
1431
+ Fe.current = new n({
1432
+ active: P.current,
1433
+ activeNode: i,
1434
+ event: a,
1435
+ options: r,
1436
+ context: U,
1437
+ onAbort(e) {
1438
+ if (!w.get(e)) return;
1439
+ let { onDragAbort: t } = L.current, n = { id: e };
1440
+ t?.(n), h({
1441
+ type: "onDragAbort",
1442
+ event: n
1443
+ });
1444
+ },
1445
+ onPending(e, t, n, r) {
1446
+ if (!w.get(e)) return;
1447
+ let { onDragPending: i } = L.current, a = {
1448
+ id: e,
1449
+ constraint: t,
1450
+ initialCoordinates: n,
1451
+ offset: r
1452
+ };
1453
+ i?.(a), h({
1454
+ type: "onDragPending",
1455
+ event: a
1456
+ });
1457
+ },
1458
+ onStart(e) {
1459
+ let t = P.current;
1460
+ if (t == null) return;
1461
+ let n = w.get(t);
1462
+ if (!n) return;
1463
+ let { onDragStart: r } = L.current, i = {
1464
+ activatorEvent: a,
1465
+ active: {
1466
+ id: t,
1467
+ data: n.data,
1468
+ rect: te
1469
+ }
1470
+ };
1471
+ re(() => {
1472
+ r?.(i), b($.Initializing), m({
1473
+ type: I.DragStart,
1474
+ initialCoordinates: e,
1475
+ active: t
1476
+ }), h({
1477
+ type: "onDragStart",
1478
+ event: i
1479
+ }), se(Fe.current), le(a);
1480
+ });
1481
+ },
1482
+ onMove(e) {
1483
+ m({
1484
+ type: I.DragMove,
1485
+ coordinates: e
1486
+ });
1487
+ },
1488
+ onEnd: o(I.DragEnd),
1489
+ onCancel: o(I.DragCancel)
1490
+ });
1491
+ function o(e) {
1492
+ return async function() {
1493
+ let { active: t, collisions: n, over: r, scrollAdjustedTranslate: i } = U.current, o = null;
1494
+ if (t && i) {
1495
+ let { cancelDrop: s } = L.current;
1496
+ o = {
1497
+ activatorEvent: a,
1498
+ active: t,
1499
+ collisions: n,
1500
+ delta: i,
1501
+ over: r
1502
+ }, e === I.DragEnd && typeof s == "function" && await Promise.resolve(s(o)) && (e = I.DragCancel);
1503
+ }
1504
+ P.current = null, re(() => {
1505
+ m({ type: e }), b($.Uninitialized), Ne(null), se(null), le(null), Fe.current = null;
1506
+ let t = e === I.DragEnd ? "onDragEnd" : "onDragCancel";
1507
+ if (o) {
1508
+ let e = L.current[t];
1509
+ e?.(o), h({
1510
+ type: t,
1511
+ event: o
1512
+ });
1513
+ }
1514
+ });
1515
+ };
1516
+ }
1517
+ }, [w]), Le = ut(c, O((e, t) => (n, r) => {
1518
+ let i = n.nativeEvent, a = w.get(r);
1519
+ if (P.current !== null || !a || i.dndKit || i.defaultPrevented) return;
1520
+ let o = { active: a };
1521
+ e(n, t.options, o) === !0 && (i.dndKit = { capturedBy: t.sensor }, P.current = r, Ie(n, t));
1522
+ }, [w, Ie]));
1523
+ Et(c), g(() => {
1524
+ H && y === $.Initializing && b($.Initialized);
1525
+ }, [H, y]), A(() => {
1526
+ let { onDragMove: e } = L.current, { active: t, activatorEvent: n, collisions: r, over: i } = U.current;
1527
+ if (!t || !n) return;
1528
+ let a = {
1529
+ active: t,
1530
+ activatorEvent: n,
1531
+ collisions: r,
1532
+ delta: {
1533
+ x: J.x,
1534
+ y: J.y
1535
+ },
1536
+ over: i
1537
+ };
1538
+ re(() => {
1539
+ e?.(a), h({
1540
+ type: "onDragMove",
1541
+ event: a
1542
+ });
1543
+ });
1544
+ }, [J.x, J.y]), A(() => {
1545
+ let { active: e, activatorEvent: t, collisions: n, droppableContainers: r, scrollAdjustedTranslate: i } = U.current;
1546
+ if (!e || P.current == null || !t || !i) return;
1547
+ let { onDragOver: a } = L.current, o = r.get(Me), s = o && o.rect.current ? {
1548
+ id: o.id,
1549
+ rect: o.rect.current,
1550
+ data: o.data,
1551
+ disabled: o.disabled
1552
+ } : null, c = {
1553
+ active: e,
1554
+ activatorEvent: t,
1555
+ collisions: n,
1556
+ delta: {
1557
+ x: i.x,
1558
+ y: i.y
1559
+ },
1560
+ over: s
1561
+ };
1562
+ re(() => {
1563
+ Ne(s), a?.(c), h({
1564
+ type: "onDragOver",
1565
+ event: c
1566
+ });
1567
+ });
1568
+ }, [Me]), g(() => {
1569
+ U.current = {
1570
+ activatorEvent: F,
1571
+ active: k,
1572
+ activeNode: V,
1573
+ collisionRect: Y,
1574
+ collisions: je,
1575
+ droppableRects: B,
1576
+ draggableNodes: w,
1577
+ draggingNode: Se,
1578
+ draggingNodeRect: G,
1579
+ droppableContainers: D,
1580
+ over: X,
1581
+ scrollableAncestors: K,
1582
+ scrollAdjustedTranslate: J
1583
+ }, te.current = {
1584
+ initial: G,
1585
+ translated: Y
1586
+ };
1587
+ }, [
1588
+ k,
1589
+ V,
1590
+ je,
1591
+ Y,
1592
+ w,
1593
+ Se,
1594
+ G,
1595
+ B,
1596
+ D,
1597
+ X,
1598
+ K,
1599
+ J
1600
+ ]), ot({
1601
+ ...he,
1602
+ delta: E,
1603
+ draggingRect: Y,
1604
+ pointerCoordinates: De,
1605
+ scrollableAncestors: K,
1606
+ scrollableAncestorRects: q
1607
+ });
1608
+ let Re = j(() => ({
1609
+ active: k,
1610
+ activeNode: V,
1611
+ activeNodeRect: H,
1612
+ activatorEvent: F,
1613
+ collisions: je,
1614
+ containerNodeRect: ye,
1615
+ dragOverlay: W,
1616
+ draggableNodes: w,
1617
+ droppableContainers: D,
1618
+ droppableRects: B,
1619
+ over: X,
1620
+ measureDroppableContainers: de,
1621
+ scrollableAncestors: K,
1622
+ scrollableAncestorRects: q,
1623
+ measuringConfiguration: z,
1624
+ measuringScheduled: fe,
1625
+ windowRect: Te
1626
+ }), [
1627
+ k,
1628
+ V,
1629
+ H,
1630
+ F,
1631
+ je,
1632
+ ye,
1633
+ W,
1634
+ w,
1635
+ D,
1636
+ B,
1637
+ X,
1638
+ de,
1639
+ K,
1640
+ q,
1641
+ z,
1642
+ fe,
1643
+ Te
1644
+ ]), ze = j(() => ({
1645
+ activatorEvent: F,
1646
+ activators: Le,
1647
+ active: k,
1648
+ activeNodeRect: H,
1649
+ ariaDescribedById: { draggable: ue },
1650
+ dispatch: m,
1651
+ draggableNodes: w,
1652
+ over: X,
1653
+ measureDroppableContainers: de
1654
+ }), [
1655
+ F,
1656
+ Le,
1657
+ k,
1658
+ H,
1659
+ m,
1660
+ ue,
1661
+ w,
1662
+ X,
1663
+ de
1664
+ ]);
1665
+ return T.createElement(ie.Provider, { value: v }, T.createElement(zt.Provider, { value: ze }, T.createElement(Bt.Provider, { value: Re }, T.createElement(qt.Provider, { value: Pe }, s)), T.createElement(Ut, { disabled: r?.restoreFocus === !1 })), T.createElement(ce, {
1666
+ ...r,
1667
+ hiddenTextDescribedById: ue
1668
+ }));
1669
+ function Be() {
1670
+ let e = ae?.autoScrollEnabled === !1, t = typeof a == "object" ? a.enabled === !1 : a === !1, n = S && !e && !t;
1671
+ return typeof a == "object" ? {
1672
+ ...a,
1673
+ enabled: n
1674
+ } : { enabled: n };
1675
+ }
1676
+ }), Yt = /* @__PURE__ */ D(null), Xt = "button", Zt = "Draggable";
1677
+ function Qt(e) {
1678
+ let { id: t, data: n, disabled: r = !1, attributes: i } = e, a = x(Zt), { activators: o, activatorEvent: s, active: c, activeNodeRect: l, ariaDescribedById: u, draggableNodes: d, over: f } = k(zt), { role: p = Xt, roleDescription: m = "draggable", tabIndex: h = 0 } = i ?? {}, v = c?.id === t, b = k(v ? qt : Yt), [S, C] = y(), [w, T] = y(), E = Dt(o, t), D = _(n);
1679
+ return g(() => (d.set(t, {
1680
+ id: t,
1681
+ key: a,
1682
+ node: S,
1683
+ activatorNode: w,
1684
+ data: D
1685
+ }), () => {
1686
+ let e = d.get(t);
1687
+ e && e.key === a && d.delete(t);
1688
+ }), [d, t]), {
1689
+ active: c,
1690
+ activatorEvent: s,
1691
+ activeNodeRect: l,
1692
+ attributes: j(() => ({
1693
+ role: p,
1694
+ tabIndex: h,
1695
+ "aria-disabled": r,
1696
+ "aria-pressed": v && p === Xt ? !0 : void 0,
1697
+ "aria-roledescription": m,
1698
+ "aria-describedby": u.draggable
1699
+ }), [
1700
+ r,
1701
+ p,
1702
+ h,
1703
+ v,
1704
+ m,
1705
+ u.draggable
1706
+ ]),
1707
+ isDragging: v,
1708
+ listeners: r ? void 0 : E,
1709
+ node: S,
1710
+ over: f,
1711
+ setNodeRef: C,
1712
+ setActivatorNodeRef: T,
1713
+ transform: b
1714
+ };
1715
+ }
1716
+ function $t() {
1717
+ return k(Bt);
1718
+ }
1719
+ var en = "Droppable", tn = { timeout: 25 };
1720
+ function nn(e) {
1721
+ let { data: t, disabled: n = !1, id: r, resizeObserverConfig: i } = e, a = x(en), { active: o, dispatch: s, over: c, measureDroppableContainers: l } = k(zt), u = M({ disabled: n }), d = M(!1), f = M(null), p = M(null), { disabled: m, updateMeasurementsFor: h, timeout: g } = {
1722
+ ...tn,
1723
+ ...i
1724
+ }, v = _(h ?? r), b = vt({
1725
+ callback: O(() => {
1726
+ if (!d.current) {
1727
+ d.current = !0;
1728
+ return;
1729
+ }
1730
+ p.current != null && clearTimeout(p.current), p.current = setTimeout(() => {
1731
+ l(Array.isArray(v.current) ? v.current : [v.current]), p.current = null;
1732
+ }, g);
1733
+ }, [g]),
1734
+ disabled: m || !o
1735
+ }), [S, C] = y(O((e, t) => {
1736
+ b && (t && (b.unobserve(t), d.current = !1), e && b.observe(e));
1737
+ }, [b])), w = _(t);
1738
+ return A(() => {
1739
+ !b || !S.current || (b.disconnect(), d.current = !1, b.observe(S.current));
1740
+ }, [S, b]), A(() => (s({
1741
+ type: I.RegisterDroppable,
1742
+ element: {
1743
+ id: r,
1744
+ key: a,
1745
+ disabled: n,
1746
+ node: S,
1747
+ rect: f,
1748
+ data: w
1749
+ }
1750
+ }), () => s({
1751
+ type: I.UnregisterDroppable,
1752
+ key: a,
1753
+ id: r
1754
+ })), [r]), A(() => {
1755
+ n !== u.current.disabled && (s({
1756
+ type: I.SetDroppableDisabled,
1757
+ id: r,
1758
+ key: a,
1759
+ disabled: n
1760
+ }), u.current.disabled = n);
1761
+ }, [
1762
+ r,
1763
+ a,
1764
+ n,
1765
+ s
1766
+ ]), {
1767
+ active: o,
1768
+ rect: f,
1769
+ isOver: c?.id === r,
1770
+ node: S,
1771
+ over: c,
1772
+ setNodeRef: C
1773
+ };
1774
+ }
1775
+ function rn(e) {
1776
+ let { animation: t, children: n } = e, [r, i] = N(null), [a, o] = N(null), s = b(n);
1777
+ return !n && !r && s && i(s), g(() => {
1778
+ if (!a) return;
1779
+ let e = r?.key, n = r?.props.id;
1780
+ if (e == null || n == null) {
1781
+ i(null);
1782
+ return;
1783
+ }
1784
+ Promise.resolve(t(n, a)).then(() => {
1785
+ i(null);
1786
+ });
1787
+ }, [
1788
+ t,
1789
+ r,
1790
+ a
1791
+ ]), T.createElement(T.Fragment, null, n, r ? E(r, { ref: o }) : null);
1792
+ }
1793
+ var an = {
1794
+ x: 0,
1795
+ y: 0,
1796
+ scaleX: 1,
1797
+ scaleY: 1
1798
+ };
1799
+ function on(e) {
1800
+ let { children: t } = e;
1801
+ return T.createElement(zt.Provider, { value: Rt }, T.createElement(qt.Provider, { value: an }, t));
1802
+ }
1803
+ var sn = {
1804
+ position: "fixed",
1805
+ touchAction: "none"
1806
+ }, cn = (e) => l(e) ? "transform 250ms ease" : void 0, ln = /* @__PURE__ */ ee((t, n) => {
1807
+ let { as: r, activatorEvent: i, adjustScale: a, children: o, className: s, rect: c, style: l, transform: u, transition: d = cn } = t;
1808
+ if (!c) return null;
1809
+ let f = a ? u : {
1810
+ ...u,
1811
+ scaleX: 1,
1812
+ scaleY: 1
1813
+ }, p = {
1814
+ ...sn,
1815
+ width: c.width,
1816
+ height: c.height,
1817
+ top: c.top,
1818
+ left: c.left,
1819
+ transform: e.Transform.toString(f),
1820
+ transformOrigin: a && i ? B(i, c) : void 0,
1821
+ transition: typeof d == "function" ? d(i) : d,
1822
+ ...l
1823
+ };
1824
+ return T.createElement(r, {
1825
+ className: s,
1826
+ style: p,
1827
+ ref: n
1828
+ }, o);
1829
+ }), un = {
1830
+ duration: 250,
1831
+ easing: "ease",
1832
+ keyframes: (t) => {
1833
+ let { transform: { initial: n, final: r } } = t;
1834
+ return [{ transform: e.Transform.toString(n) }, { transform: e.Transform.toString(r) }];
1835
+ },
1836
+ sideEffects: /* @__PURE__ */ ((e) => (t) => {
1837
+ let { active: n, dragOverlay: r } = t, i = {}, { styles: a, className: o } = e;
1838
+ if (a != null && a.active) for (let [e, t] of Object.entries(a.active)) t !== void 0 && (i[e] = n.node.style.getPropertyValue(e), n.node.style.setProperty(e, t));
1839
+ if (a != null && a.dragOverlay) for (let [e, t] of Object.entries(a.dragOverlay)) t !== void 0 && r.node.style.setProperty(e, t);
1840
+ return o != null && o.active && n.node.classList.add(o.active), o != null && o.dragOverlay && r.node.classList.add(o.dragOverlay), function() {
1841
+ for (let [e, t] of Object.entries(i)) n.node.style.setProperty(e, t);
1842
+ o != null && o.active && n.node.classList.remove(o.active);
1843
+ };
1844
+ })({ styles: { active: { opacity: "0" } } })
1845
+ };
1846
+ function dn(e) {
1847
+ let { config: t, draggableNodes: n, droppableContainers: r, measuringConfiguration: i } = e;
1848
+ return m((e, a) => {
1849
+ if (t === null) return;
1850
+ let s = n.get(e);
1851
+ if (!s) return;
1852
+ let c = s.node.current;
1853
+ if (!c) return;
1854
+ let l = jt(a);
1855
+ if (!l) return;
1856
+ let { transform: u } = o(a).getComputedStyle(a), d = xe(u);
1857
+ if (!d) return;
1858
+ let f = typeof t == "function" ? t : fn(t);
1859
+ return Le(c, i.draggable.measure), f({
1860
+ active: {
1861
+ id: e,
1862
+ data: s.data,
1863
+ node: c,
1864
+ rect: i.draggable.measure(c)
1865
+ },
1866
+ draggableNodes: n,
1867
+ dragOverlay: {
1868
+ node: a,
1869
+ rect: i.dragOverlay.measure(l)
1870
+ },
1871
+ droppableContainers: r,
1872
+ measuringConfiguration: i,
1873
+ transform: d
1874
+ });
1875
+ });
1876
+ }
1877
+ function fn(e) {
1878
+ let { duration: t, easing: n, sideEffects: r, keyframes: i } = {
1879
+ ...un,
1880
+ ...e
1881
+ };
1882
+ return (e) => {
1883
+ let { active: a, dragOverlay: o, transform: s, ...c } = e;
1884
+ if (!t) return;
1885
+ let l = {
1886
+ x: o.rect.left - a.rect.left,
1887
+ y: o.rect.top - a.rect.top
1888
+ }, u = {
1889
+ scaleX: s.scaleX === 1 ? 1 : a.rect.width * s.scaleX / o.rect.width,
1890
+ scaleY: s.scaleY === 1 ? 1 : a.rect.height * s.scaleY / o.rect.height
1891
+ }, d = {
1892
+ x: s.x - l.x,
1893
+ y: s.y - l.y,
1894
+ ...u
1895
+ }, f = i({
1896
+ ...c,
1897
+ active: a,
1898
+ dragOverlay: o,
1899
+ transform: {
1900
+ initial: s,
1901
+ final: d
1902
+ }
1903
+ }), [p] = f, m = f[f.length - 1];
1904
+ if (JSON.stringify(p) === JSON.stringify(m)) return;
1905
+ let h = r?.({
1906
+ active: a,
1907
+ dragOverlay: o,
1908
+ ...c
1909
+ }), g = o.node.animate(f, {
1910
+ duration: t,
1911
+ easing: n,
1912
+ fill: "forwards"
1913
+ });
1914
+ return new Promise((e) => {
1915
+ g.onfinish = () => {
1916
+ h?.(), e();
1917
+ };
1918
+ });
1919
+ };
1920
+ }
1921
+ var pn = 0;
1922
+ function mn(e) {
1923
+ return j(() => {
1924
+ if (e != null) return pn++, pn;
1925
+ }, [e]);
1926
+ }
1927
+ var hn = /* @__PURE__ */ T.memo((e) => {
1928
+ let { adjustScale: t = !1, children: n, dropAnimation: r, style: i, transition: a, modifiers: o, wrapperElement: s = "div", className: c, zIndex: l = 999 } = e, { activatorEvent: u, active: d, activeNodeRect: f, containerNodeRect: p, draggableNodes: m, droppableContainers: h, dragOverlay: g, over: _, measuringConfiguration: v, scrollableAncestors: y, scrollableAncestorRects: b, windowRect: x } = $t(), S = k(qt), C = mn(d?.id), w = Wt(o, {
1929
+ activatorEvent: u,
1930
+ active: d,
1931
+ activeNodeRect: f,
1932
+ containerNodeRect: p,
1933
+ draggingNodeRect: g.rect,
1934
+ over: _,
1935
+ overlayNodeRect: g.rect,
1936
+ scrollableAncestors: y,
1937
+ scrollableAncestorRects: b,
1938
+ transform: S,
1939
+ windowRect: x
1940
+ }), E = ht(f), D = dn({
1941
+ config: r,
1942
+ draggableNodes: m,
1943
+ droppableContainers: h,
1944
+ measuringConfiguration: v
1945
+ }), ee = E ? g.setRef : void 0;
1946
+ return T.createElement(on, null, T.createElement(rn, { animation: D }, d && C ? T.createElement(ln, {
1947
+ key: C,
1948
+ id: d.id,
1949
+ ref: ee,
1950
+ as: s,
1951
+ activatorEvent: u,
1952
+ adjustScale: t,
1953
+ className: c,
1954
+ transition: a,
1955
+ rect: E,
1956
+ style: {
1957
+ zIndex: l,
1958
+ ...i
1959
+ },
1960
+ transform: w
1961
+ }, n) : null));
1962
+ });
1963
+ //#endregion
1964
+ export { Jt as DndContext, hn as DragOverlay, Q as KeyboardCode, qe as KeyboardSensor, Qe as PointerSensor, rt as TouchSensor, he as closestCenter, ge as closestCorners, G as getClientRect, pe as getFirstCollision, q as getScrollableAncestors, $t as useDndContext, Qt as useDraggable, nn as useDroppable, L as useSensor, ue as useSensors };
1965
+
1966
+ //# sourceMappingURL=core.esm.js.map