@object-ui/layout 3.0.2 → 3.1.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/.turbo/turbo-build.log +11 -17
- package/CHANGELOG.md +9 -0
- package/dist/index.js +3760 -299
- package/dist/index.umd.cjs +6 -2
- package/dist/layout/src/AppSchemaRenderer.d.ts +68 -0
- package/dist/layout/src/NavigationRenderer.d.ts +104 -0
- package/dist/layout/src/SidebarNav.d.ts +11 -2
- package/dist/layout/src/index.d.ts +2 -0
- package/package.json +11 -8
- package/src/AppSchemaRenderer.tsx +480 -0
- package/src/AppShell.tsx +1 -1
- package/src/NavigationRenderer.tsx +746 -0
- package/src/SidebarNav.tsx +130 -19
- package/src/__tests__/AppSchemaRenderer.test.tsx +408 -0
- package/src/__tests__/NavigationRenderer.test.tsx +562 -0
- package/src/index.ts +26 -0
- package/src/stories/SidebarNav.stories.tsx +223 -0
- package/tsconfig.json +2 -1
- package/dist/layout/src/stories/AppShell.stories.d.ts +0 -24
- package/dist/layout/src/stories/ResponsiveGrid.stories.d.ts +0 -29
package/dist/index.js
CHANGED
|
@@ -1,355 +1,359 @@
|
|
|
1
|
-
import { ComponentRegistry as
|
|
2
|
-
import
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { ComponentRegistry as Ne } from "@object-ui/core";
|
|
2
|
+
import W, { useEffect as k, useRef as P, useMemo as M, useLayoutEffect as ar, useCallback as Q, useState as K, memo as lr, useReducer as cr, createContext as st, useContext as Ee } from "react";
|
|
3
|
+
import { cn as it, SidebarProvider as ur, SidebarInset as dr, SidebarTrigger as fr, SidebarGroup as Pe, SidebarGroupLabel as wt, SidebarGroupContent as _e, SidebarMenu as je, Separator as hr, Collapsible as Rn, CollapsibleTrigger as jn, CollapsibleContent as Dn, SidebarMenuItem as ze, SidebarMenuButton as Fe, Badge as Ke, SidebarMenuAction as on, Sidebar as Nn, SidebarHeader as gr, SidebarInput as pr, SidebarContent as En, SidebarFooter as vr, Input as br, SidebarMenuSub as xr, SidebarMenuSubItem as mr, SidebarMenuSubButton as yr } from "@object-ui/components";
|
|
4
|
+
import { useLocation as zt, Link as An, NavLink as sn } from "react-router-dom";
|
|
5
|
+
import * as X from "lucide-react";
|
|
6
|
+
import { Search as wr, ChevronRight as Sr } from "lucide-react";
|
|
7
|
+
import { unstable_batchedUpdates as ft, createPortal as Cr } from "react-dom";
|
|
8
|
+
import { menuItemToNavigationItem as Rr } from "@object-ui/types";
|
|
9
|
+
import { SchemaRenderer as jr } from "@object-ui/react";
|
|
10
|
+
var ht = { exports: {} }, qe = {};
|
|
11
|
+
var an;
|
|
12
|
+
function Dr() {
|
|
13
|
+
if (an) return qe;
|
|
14
|
+
an = 1;
|
|
15
|
+
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
16
|
+
function n(r, o, s) {
|
|
17
|
+
var i = null;
|
|
18
|
+
if (s !== void 0 && (i = "" + s), o.key !== void 0 && (i = "" + o.key), "key" in o) {
|
|
15
19
|
s = {};
|
|
16
|
-
for (var
|
|
17
|
-
|
|
18
|
-
} else s =
|
|
19
|
-
return
|
|
20
|
-
$$typeof:
|
|
21
|
-
type:
|
|
22
|
-
key:
|
|
23
|
-
ref:
|
|
20
|
+
for (var a in o)
|
|
21
|
+
a !== "key" && (s[a] = o[a]);
|
|
22
|
+
} else s = o;
|
|
23
|
+
return o = s.ref, {
|
|
24
|
+
$$typeof: e,
|
|
25
|
+
type: r,
|
|
26
|
+
key: i,
|
|
27
|
+
ref: o !== void 0 ? o : null,
|
|
24
28
|
props: s
|
|
25
29
|
};
|
|
26
30
|
}
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
function
|
|
32
|
-
return
|
|
33
|
-
function
|
|
34
|
-
if (
|
|
35
|
-
if (typeof
|
|
36
|
-
return
|
|
37
|
-
if (typeof
|
|
38
|
-
switch (
|
|
39
|
-
case
|
|
31
|
+
return qe.Fragment = t, qe.jsx = n, qe.jsxs = n, qe;
|
|
32
|
+
}
|
|
33
|
+
var Je = {};
|
|
34
|
+
var ln;
|
|
35
|
+
function Nr() {
|
|
36
|
+
return ln || (ln = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
37
|
+
function e(d) {
|
|
38
|
+
if (d == null) return null;
|
|
39
|
+
if (typeof d == "function")
|
|
40
|
+
return d.$$typeof === A ? null : d.displayName || d.name || null;
|
|
41
|
+
if (typeof d == "string") return d;
|
|
42
|
+
switch (d) {
|
|
43
|
+
case b:
|
|
40
44
|
return "Fragment";
|
|
41
|
-
case
|
|
45
|
+
case j:
|
|
42
46
|
return "Profiler";
|
|
43
|
-
case
|
|
47
|
+
case w:
|
|
44
48
|
return "StrictMode";
|
|
45
|
-
case
|
|
49
|
+
case N:
|
|
46
50
|
return "Suspense";
|
|
47
|
-
case
|
|
51
|
+
case x:
|
|
48
52
|
return "SuspenseList";
|
|
49
|
-
case
|
|
53
|
+
case _:
|
|
50
54
|
return "Activity";
|
|
51
55
|
}
|
|
52
|
-
if (typeof
|
|
53
|
-
switch (typeof
|
|
56
|
+
if (typeof d == "object")
|
|
57
|
+
switch (typeof d.tag == "number" && console.error(
|
|
54
58
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
|
-
),
|
|
56
|
-
case
|
|
59
|
+
), d.$$typeof) {
|
|
60
|
+
case v:
|
|
57
61
|
return "Portal";
|
|
58
|
-
case
|
|
59
|
-
return
|
|
60
|
-
case
|
|
61
|
-
return (
|
|
62
|
-
case
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
62
|
+
case R:
|
|
63
|
+
return d.displayName || "Context";
|
|
64
|
+
case C:
|
|
65
|
+
return (d._context.displayName || "Context") + ".Consumer";
|
|
66
|
+
case E:
|
|
67
|
+
var m = d.render;
|
|
68
|
+
return d = d.displayName, d || (d = m.displayName || m.name || "", d = d !== "" ? "ForwardRef(" + d + ")" : "ForwardRef"), d;
|
|
69
|
+
case S:
|
|
70
|
+
return m = d.displayName || null, m !== null ? m : e(d.type) || "Memo";
|
|
71
|
+
case D:
|
|
72
|
+
m = d._payload, d = d._init;
|
|
69
73
|
try {
|
|
70
|
-
return
|
|
74
|
+
return e(d(m));
|
|
71
75
|
} catch {
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
return null;
|
|
75
79
|
}
|
|
76
|
-
function
|
|
77
|
-
return "" +
|
|
80
|
+
function t(d) {
|
|
81
|
+
return "" + d;
|
|
78
82
|
}
|
|
79
|
-
function
|
|
83
|
+
function n(d) {
|
|
80
84
|
try {
|
|
81
|
-
|
|
82
|
-
var
|
|
85
|
+
t(d);
|
|
86
|
+
var m = !1;
|
|
83
87
|
} catch {
|
|
84
|
-
|
|
88
|
+
m = !0;
|
|
85
89
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
|
|
90
|
+
if (m) {
|
|
91
|
+
m = console;
|
|
92
|
+
var I = m.error, L = typeof Symbol == "function" && Symbol.toStringTag && d[Symbol.toStringTag] || d.constructor.name || "Object";
|
|
93
|
+
return I.call(
|
|
94
|
+
m,
|
|
91
95
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
|
-
|
|
93
|
-
),
|
|
96
|
+
L
|
|
97
|
+
), t(d);
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
function
|
|
97
|
-
if (
|
|
98
|
-
if (typeof
|
|
100
|
+
function r(d) {
|
|
101
|
+
if (d === b) return "<>";
|
|
102
|
+
if (typeof d == "object" && d !== null && d.$$typeof === D)
|
|
99
103
|
return "<...>";
|
|
100
104
|
try {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
105
|
+
var m = e(d);
|
|
106
|
+
return m ? "<" + m + ">" : "<...>";
|
|
103
107
|
} catch {
|
|
104
108
|
return "<...>";
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
|
-
function
|
|
108
|
-
var
|
|
109
|
-
return
|
|
111
|
+
function o() {
|
|
112
|
+
var d = B.A;
|
|
113
|
+
return d === null ? null : d.getOwner();
|
|
110
114
|
}
|
|
111
115
|
function s() {
|
|
112
116
|
return Error("react-stack-top-frame");
|
|
113
117
|
}
|
|
114
|
-
function
|
|
115
|
-
if (
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
118
|
+
function i(d) {
|
|
119
|
+
if (z.call(d, "key")) {
|
|
120
|
+
var m = Object.getOwnPropertyDescriptor(d, "key").get;
|
|
121
|
+
if (m && m.isReactWarning) return !1;
|
|
118
122
|
}
|
|
119
|
-
return
|
|
123
|
+
return d.key !== void 0;
|
|
120
124
|
}
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
|
|
125
|
+
function a(d, m) {
|
|
126
|
+
function I() {
|
|
127
|
+
le || (le = !0, console.error(
|
|
124
128
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
125
|
-
|
|
129
|
+
m
|
|
126
130
|
));
|
|
127
131
|
}
|
|
128
|
-
|
|
129
|
-
get:
|
|
132
|
+
I.isReactWarning = !0, Object.defineProperty(d, "key", {
|
|
133
|
+
get: I,
|
|
130
134
|
configurable: !0
|
|
131
135
|
});
|
|
132
136
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
return
|
|
137
|
+
function c() {
|
|
138
|
+
var d = e(this.type);
|
|
139
|
+
return H[d] || (H[d] = !0, console.error(
|
|
136
140
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
137
|
-
)),
|
|
138
|
-
}
|
|
139
|
-
function
|
|
140
|
-
var
|
|
141
|
-
return
|
|
142
|
-
$$typeof:
|
|
143
|
-
type:
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
141
|
+
)), d = this.props.ref, d !== void 0 ? d : null;
|
|
142
|
+
}
|
|
143
|
+
function u(d, m, I, L, ue, q) {
|
|
144
|
+
var $ = I.ref;
|
|
145
|
+
return d = {
|
|
146
|
+
$$typeof: y,
|
|
147
|
+
type: d,
|
|
148
|
+
key: m,
|
|
149
|
+
props: I,
|
|
150
|
+
_owner: L
|
|
151
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(d, "ref", {
|
|
148
152
|
enumerable: !1,
|
|
149
|
-
get:
|
|
150
|
-
}) : Object.defineProperty(
|
|
153
|
+
get: c
|
|
154
|
+
}) : Object.defineProperty(d, "ref", { enumerable: !1, value: null }), d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
151
155
|
configurable: !1,
|
|
152
156
|
enumerable: !1,
|
|
153
157
|
writable: !0,
|
|
154
158
|
value: 0
|
|
155
|
-
}), Object.defineProperty(
|
|
159
|
+
}), Object.defineProperty(d, "_debugInfo", {
|
|
156
160
|
configurable: !1,
|
|
157
161
|
enumerable: !1,
|
|
158
162
|
writable: !0,
|
|
159
163
|
value: null
|
|
160
|
-
}), Object.defineProperty(
|
|
164
|
+
}), Object.defineProperty(d, "_debugStack", {
|
|
161
165
|
configurable: !1,
|
|
162
166
|
enumerable: !1,
|
|
163
167
|
writable: !0,
|
|
164
|
-
value:
|
|
165
|
-
}), Object.defineProperty(
|
|
168
|
+
value: ue
|
|
169
|
+
}), Object.defineProperty(d, "_debugTask", {
|
|
166
170
|
configurable: !1,
|
|
167
171
|
enumerable: !1,
|
|
168
172
|
writable: !0,
|
|
169
|
-
value:
|
|
170
|
-
}), Object.freeze && (Object.freeze(
|
|
171
|
-
}
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
173
|
+
value: q
|
|
174
|
+
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
175
|
+
}
|
|
176
|
+
function h(d, m, I, L, ue, q) {
|
|
177
|
+
var $ = m.children;
|
|
178
|
+
if ($ !== void 0)
|
|
179
|
+
if (L)
|
|
180
|
+
if (G($)) {
|
|
181
|
+
for (L = 0; L < $.length; L++)
|
|
182
|
+
f($[L]);
|
|
183
|
+
Object.freeze && Object.freeze($);
|
|
180
184
|
} else
|
|
181
185
|
console.error(
|
|
182
186
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
183
187
|
);
|
|
184
|
-
else
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
188
|
+
else f($);
|
|
189
|
+
if (z.call(m, "key")) {
|
|
190
|
+
$ = e(d);
|
|
191
|
+
var Z = Object.keys(m).filter(function(O) {
|
|
192
|
+
return O !== "key";
|
|
189
193
|
});
|
|
190
|
-
|
|
194
|
+
L = 0 < Z.length ? "{key: someKey, " + Z.join(": ..., ") + ": ...}" : "{key: someKey}", xe[$ + L] || (Z = 0 < Z.length ? "{" + Z.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
191
195
|
`A props object containing a "key" prop is being spread into JSX:
|
|
192
196
|
let props = %s;
|
|
193
197
|
<%s {...props} />
|
|
194
198
|
React keys must be passed directly to JSX without using spread:
|
|
195
199
|
let props = %s;
|
|
196
200
|
<%s key={someKey} {...props} />`,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
),
|
|
202
|
-
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
typeof
|
|
211
|
-
),
|
|
212
|
-
e,
|
|
201
|
+
L,
|
|
202
|
+
$,
|
|
203
|
+
Z,
|
|
204
|
+
$
|
|
205
|
+
), xe[$ + L] = !0);
|
|
206
|
+
}
|
|
207
|
+
if ($ = null, I !== void 0 && (n(I), $ = "" + I), i(m) && (n(m.key), $ = "" + m.key), "key" in m) {
|
|
208
|
+
I = {};
|
|
209
|
+
for (var te in m)
|
|
210
|
+
te !== "key" && (I[te] = m[te]);
|
|
211
|
+
} else I = m;
|
|
212
|
+
return $ && a(
|
|
213
|
+
I,
|
|
214
|
+
typeof d == "function" ? d.displayName || d.name || "Unknown" : d
|
|
215
|
+
), u(
|
|
213
216
|
d,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
217
|
+
$,
|
|
218
|
+
I,
|
|
219
|
+
o(),
|
|
220
|
+
ue,
|
|
221
|
+
q
|
|
218
222
|
);
|
|
219
223
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
224
|
+
function f(d) {
|
|
225
|
+
p(d) ? d._store && (d._store.validated = 1) : typeof d == "object" && d !== null && d.$$typeof === D && (d._payload.status === "fulfilled" ? p(d._payload.value) && d._payload.value._store && (d._payload.value._store.validated = 1) : d._store && (d._store.validated = 1));
|
|
222
226
|
}
|
|
223
|
-
function
|
|
224
|
-
return typeof
|
|
227
|
+
function p(d) {
|
|
228
|
+
return typeof d == "object" && d !== null && d.$$typeof === y;
|
|
225
229
|
}
|
|
226
|
-
var
|
|
230
|
+
var g = W, y = /* @__PURE__ */ Symbol.for("react.transitional.element"), v = /* @__PURE__ */ Symbol.for("react.portal"), b = /* @__PURE__ */ Symbol.for("react.fragment"), w = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), C = /* @__PURE__ */ Symbol.for("react.consumer"), R = /* @__PURE__ */ Symbol.for("react.context"), E = /* @__PURE__ */ Symbol.for("react.forward_ref"), N = /* @__PURE__ */ Symbol.for("react.suspense"), x = /* @__PURE__ */ Symbol.for("react.suspense_list"), S = /* @__PURE__ */ Symbol.for("react.memo"), D = /* @__PURE__ */ Symbol.for("react.lazy"), _ = /* @__PURE__ */ Symbol.for("react.activity"), A = /* @__PURE__ */ Symbol.for("react.client.reference"), B = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, G = Array.isArray, F = console.createTask ? console.createTask : function() {
|
|
227
231
|
return null;
|
|
228
232
|
};
|
|
229
|
-
|
|
230
|
-
react_stack_bottom_frame: function(
|
|
231
|
-
return
|
|
233
|
+
g = {
|
|
234
|
+
react_stack_bottom_frame: function(d) {
|
|
235
|
+
return d();
|
|
232
236
|
}
|
|
233
237
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
238
|
+
var le, H = {}, De = g.react_stack_bottom_frame.bind(
|
|
239
|
+
g,
|
|
236
240
|
s
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
return
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
)(), se = F(r(s)), xe = {};
|
|
242
|
+
Je.Fragment = b, Je.jsx = function(d, m, I) {
|
|
243
|
+
var L = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
244
|
+
return h(
|
|
245
|
+
d,
|
|
246
|
+
m,
|
|
247
|
+
I,
|
|
244
248
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
L ? Error("react-stack-top-frame") : De,
|
|
250
|
+
L ? F(r(d)) : se
|
|
247
251
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
250
|
-
return
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
}, Je.jsxs = function(d, m, I) {
|
|
253
|
+
var L = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return h(
|
|
255
|
+
d,
|
|
256
|
+
m,
|
|
257
|
+
I,
|
|
254
258
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
L ? Error("react-stack-top-frame") : De,
|
|
260
|
+
L ? F(r(d)) : se
|
|
257
261
|
);
|
|
258
262
|
};
|
|
259
|
-
})()),
|
|
260
|
-
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
264
|
-
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
267
|
-
title:
|
|
268
|
-
description:
|
|
269
|
-
action:
|
|
270
|
-
className:
|
|
271
|
-
children:
|
|
263
|
+
})()), Je;
|
|
264
|
+
}
|
|
265
|
+
var cn;
|
|
266
|
+
function Er() {
|
|
267
|
+
return cn || (cn = 1, process.env.NODE_ENV === "production" ? ht.exports = Dr() : ht.exports = Nr()), ht.exports;
|
|
268
|
+
}
|
|
269
|
+
var l = Er();
|
|
270
|
+
function Mt({
|
|
271
|
+
title: e,
|
|
272
|
+
description: t,
|
|
273
|
+
action: n,
|
|
274
|
+
className: r,
|
|
275
|
+
children: o,
|
|
272
276
|
...s
|
|
273
277
|
}) {
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
278
|
+
return /* @__PURE__ */ l.jsx("div", { className: it("flex flex-col gap-4 pb-4 md:pb-8", r), ...s, children: /* @__PURE__ */ l.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
279
|
+
/* @__PURE__ */ l.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
280
|
+
/* @__PURE__ */ l.jsx("h1", { className: "text-2xl font-bold tracking-tight md:text-3xl", children: e }),
|
|
281
|
+
t && /* @__PURE__ */ l.jsx("p", { className: "text-sm text-muted-foreground", children: t })
|
|
278
282
|
] }),
|
|
279
|
-
(
|
|
280
|
-
|
|
281
|
-
|
|
283
|
+
(n || o) && /* @__PURE__ */ l.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
284
|
+
n,
|
|
285
|
+
o
|
|
282
286
|
] })
|
|
283
287
|
] }) });
|
|
284
288
|
}
|
|
285
|
-
function
|
|
286
|
-
const
|
|
287
|
-
if (!
|
|
288
|
-
const
|
|
289
|
-
let
|
|
290
|
-
const
|
|
291
|
-
if (s !==
|
|
292
|
-
const
|
|
293
|
-
switch (
|
|
294
|
-
case
|
|
295
|
-
|
|
289
|
+
function un(e) {
|
|
290
|
+
const t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
291
|
+
if (!t) return null;
|
|
292
|
+
const n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, o = parseInt(t[3], 16) / 255, s = Math.max(n, r, o), i = Math.min(n, r, o);
|
|
293
|
+
let a = 0, c = 0;
|
|
294
|
+
const u = (s + i) / 2;
|
|
295
|
+
if (s !== i) {
|
|
296
|
+
const h = s - i;
|
|
297
|
+
switch (c = u > 0.5 ? h / (2 - s - i) : h / (s + i), s) {
|
|
298
|
+
case n:
|
|
299
|
+
a = ((r - o) / h + (r < o ? 6 : 0)) / 6;
|
|
296
300
|
break;
|
|
297
|
-
case
|
|
298
|
-
|
|
301
|
+
case r:
|
|
302
|
+
a = ((o - n) / h + 2) / 6;
|
|
299
303
|
break;
|
|
300
|
-
case
|
|
301
|
-
|
|
304
|
+
case o:
|
|
305
|
+
a = ((n - r) / h + 4) / 6;
|
|
302
306
|
break;
|
|
303
307
|
}
|
|
304
308
|
}
|
|
305
|
-
return `${Math.round(
|
|
309
|
+
return `${Math.round(a * 360)} ${Math.round(c * 100)}% ${Math.round(u * 100)}%`;
|
|
306
310
|
}
|
|
307
|
-
function
|
|
308
|
-
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
const
|
|
312
|
-
|
|
311
|
+
function Ar(e, t) {
|
|
312
|
+
k(() => {
|
|
313
|
+
const n = document.documentElement;
|
|
314
|
+
if (e?.primaryColor) {
|
|
315
|
+
const r = un(e.primaryColor);
|
|
316
|
+
r && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", r));
|
|
313
317
|
} else
|
|
314
|
-
|
|
315
|
-
if (
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
+
n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl");
|
|
319
|
+
if (e?.accentColor) {
|
|
320
|
+
const r = un(e.accentColor);
|
|
321
|
+
r && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", r));
|
|
318
322
|
} else
|
|
319
|
-
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
+
n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl");
|
|
324
|
+
if (e?.favicon) {
|
|
325
|
+
const r = document.querySelector("#favicon") || document.querySelector('link[rel="icon"]');
|
|
326
|
+
r && (r.href = e.favicon);
|
|
323
327
|
}
|
|
324
|
-
return
|
|
325
|
-
|
|
328
|
+
return t && (document.title = t), () => {
|
|
329
|
+
n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl");
|
|
326
330
|
};
|
|
327
|
-
}, [
|
|
328
|
-
}
|
|
329
|
-
function
|
|
330
|
-
sidebar:
|
|
331
|
-
navbar:
|
|
332
|
-
children:
|
|
333
|
-
className:
|
|
334
|
-
defaultOpen:
|
|
331
|
+
}, [e?.primaryColor, e?.accentColor, e?.favicon, t]);
|
|
332
|
+
}
|
|
333
|
+
function In({
|
|
334
|
+
sidebar: e,
|
|
335
|
+
navbar: t,
|
|
336
|
+
children: n,
|
|
337
|
+
className: r,
|
|
338
|
+
defaultOpen: o = !0,
|
|
335
339
|
branding: s
|
|
336
340
|
}) {
|
|
337
|
-
return
|
|
338
|
-
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
/* @__PURE__ */
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
-
|
|
341
|
+
return Ar(s, s?.title), /* @__PURE__ */ l.jsxs(ur, { defaultOpen: o, children: [
|
|
342
|
+
e,
|
|
343
|
+
/* @__PURE__ */ l.jsxs(dr, { children: [
|
|
344
|
+
/* @__PURE__ */ l.jsxs("header", { className: "flex h-14 sm:h-16 shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4", children: [
|
|
345
|
+
/* @__PURE__ */ l.jsx(fr, { className: "-ml-1" }),
|
|
346
|
+
/* @__PURE__ */ l.jsx("div", { className: "w-px h-4 bg-border mx-1 sm:mx-2" }),
|
|
347
|
+
t
|
|
344
348
|
] }),
|
|
345
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ l.jsx("main", { className: it("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r), children: n })
|
|
346
350
|
] })
|
|
347
351
|
] });
|
|
348
352
|
}
|
|
349
|
-
function
|
|
350
|
-
return /* @__PURE__ */
|
|
353
|
+
function Ir({ className: e, children: t, ...n }) {
|
|
354
|
+
return /* @__PURE__ */ l.jsx("div", { className: it("rounded-xl border bg-card text-card-foreground shadow", e), ...n, children: /* @__PURE__ */ l.jsx("div", { className: "p-6", children: t }) });
|
|
351
355
|
}
|
|
352
|
-
const
|
|
356
|
+
const Tr = {
|
|
353
357
|
xs: { 1: "grid-cols-1", 2: "grid-cols-2", 3: "grid-cols-3", 4: "grid-cols-4", 6: "grid-cols-6", 12: "grid-cols-12" },
|
|
354
358
|
sm: { 1: "sm:grid-cols-1", 2: "sm:grid-cols-2", 3: "sm:grid-cols-3", 4: "sm:grid-cols-4", 6: "sm:grid-cols-6", 12: "sm:grid-cols-12" },
|
|
355
359
|
md: { 1: "md:grid-cols-1", 2: "md:grid-cols-2", 3: "md:grid-cols-3", 4: "md:grid-cols-4", 6: "md:grid-cols-6", 12: "md:grid-cols-12" },
|
|
@@ -357,21 +361,21 @@ const Te = {
|
|
|
357
361
|
xl: { 1: "xl:grid-cols-1", 2: "xl:grid-cols-2", 3: "xl:grid-cols-3", 4: "xl:grid-cols-4", 6: "xl:grid-cols-6", 12: "xl:grid-cols-12" },
|
|
358
362
|
"2xl": { 1: "2xl:grid-cols-1", 2: "2xl:grid-cols-2", 3: "2xl:grid-cols-3", 4: "2xl:grid-cols-4", 6: "2xl:grid-cols-6", 12: "2xl:grid-cols-12" }
|
|
359
363
|
};
|
|
360
|
-
function
|
|
361
|
-
if (!
|
|
362
|
-
const
|
|
363
|
-
for (const [
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
(
|
|
364
|
+
function Or(e) {
|
|
365
|
+
if (!e) return "grid-cols-1";
|
|
366
|
+
const t = [];
|
|
367
|
+
for (const [n, r] of Object.entries(e)) {
|
|
368
|
+
const o = Tr[n];
|
|
369
|
+
if (o && r) {
|
|
370
|
+
const i = Object.keys(o).map(Number).reduce(
|
|
371
|
+
(a, c) => Math.abs(c - r) < Math.abs(a - r) ? c : a
|
|
368
372
|
);
|
|
369
|
-
|
|
373
|
+
t.push(o[i]);
|
|
370
374
|
}
|
|
371
375
|
}
|
|
372
|
-
return
|
|
376
|
+
return t.join(" ") || "grid-cols-1";
|
|
373
377
|
}
|
|
374
|
-
const
|
|
378
|
+
const Mr = {
|
|
375
379
|
0: "gap-0",
|
|
376
380
|
1: "gap-1",
|
|
377
381
|
2: "gap-2",
|
|
@@ -380,55 +384,3489 @@ const ke = {
|
|
|
380
384
|
5: "gap-5",
|
|
381
385
|
6: "gap-6",
|
|
382
386
|
8: "gap-8"
|
|
383
|
-
},
|
|
384
|
-
columns:
|
|
385
|
-
gap:
|
|
386
|
-
className:
|
|
387
|
-
children:
|
|
387
|
+
}, kr = ({
|
|
388
|
+
columns: e,
|
|
389
|
+
gap: t = 4,
|
|
390
|
+
className: n,
|
|
391
|
+
children: r
|
|
388
392
|
}) => {
|
|
389
|
-
const
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
}
|
|
392
|
-
function
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
const o = Or(e), s = typeof t == "number" ? Mr[t] || `gap-${t}` : "";
|
|
394
|
+
return /* @__PURE__ */ l.jsx("div", { className: it("grid", o, s, n), children: r });
|
|
395
|
+
};
|
|
396
|
+
function Lr() {
|
|
397
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
398
|
+
t[n] = arguments[n];
|
|
399
|
+
return M(
|
|
400
|
+
() => (r) => {
|
|
401
|
+
t.forEach((o) => o(r));
|
|
402
|
+
},
|
|
403
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
404
|
+
t
|
|
405
|
+
);
|
|
406
|
+
}
|
|
407
|
+
const St = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
|
|
408
|
+
function Be(e) {
|
|
409
|
+
const t = Object.prototype.toString.call(e);
|
|
410
|
+
return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
|
|
411
|
+
t === "[object global]";
|
|
412
|
+
}
|
|
413
|
+
function Ft(e) {
|
|
414
|
+
return "nodeType" in e;
|
|
415
|
+
}
|
|
416
|
+
function ee(e) {
|
|
417
|
+
var t, n;
|
|
418
|
+
return e ? Be(e) ? e : Ft(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
|
|
419
|
+
}
|
|
420
|
+
function Bt(e) {
|
|
421
|
+
const {
|
|
422
|
+
Document: t
|
|
423
|
+
} = ee(e);
|
|
424
|
+
return e instanceof t;
|
|
425
|
+
}
|
|
426
|
+
function at(e) {
|
|
427
|
+
return Be(e) ? !1 : e instanceof ee(e).HTMLElement;
|
|
428
|
+
}
|
|
429
|
+
function Tn(e) {
|
|
430
|
+
return e instanceof ee(e).SVGElement;
|
|
431
|
+
}
|
|
432
|
+
function Ye(e) {
|
|
433
|
+
return e ? Be(e) ? e.document : Ft(e) ? Bt(e) ? e : at(e) || Tn(e) ? e.ownerDocument : document : document : document;
|
|
434
|
+
}
|
|
435
|
+
const pe = St ? ar : k;
|
|
436
|
+
function Yt(e) {
|
|
437
|
+
const t = P(e);
|
|
438
|
+
return pe(() => {
|
|
439
|
+
t.current = e;
|
|
440
|
+
}), Q(function() {
|
|
441
|
+
for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
|
|
442
|
+
r[o] = arguments[o];
|
|
443
|
+
return t.current == null ? void 0 : t.current(...r);
|
|
444
|
+
}, []);
|
|
445
|
+
}
|
|
446
|
+
function Pr() {
|
|
447
|
+
const e = P(null), t = Q((r, o) => {
|
|
448
|
+
e.current = setInterval(r, o);
|
|
449
|
+
}, []), n = Q(() => {
|
|
450
|
+
e.current !== null && (clearInterval(e.current), e.current = null);
|
|
451
|
+
}, []);
|
|
452
|
+
return [t, n];
|
|
453
|
+
}
|
|
454
|
+
function tt(e, t) {
|
|
455
|
+
t === void 0 && (t = [e]);
|
|
456
|
+
const n = P(e);
|
|
457
|
+
return pe(() => {
|
|
458
|
+
n.current !== e && (n.current = e);
|
|
459
|
+
}, t), n;
|
|
460
|
+
}
|
|
461
|
+
function lt(e, t) {
|
|
462
|
+
const n = P();
|
|
463
|
+
return M(
|
|
464
|
+
() => {
|
|
465
|
+
const r = e(n.current);
|
|
466
|
+
return n.current = r, r;
|
|
467
|
+
},
|
|
468
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
469
|
+
[...t]
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
function bt(e) {
|
|
473
|
+
const t = Yt(e), n = P(null), r = Q(
|
|
474
|
+
(o) => {
|
|
475
|
+
o !== n.current && t?.(o, n.current), n.current = o;
|
|
476
|
+
},
|
|
477
|
+
//eslint-disable-next-line
|
|
478
|
+
[]
|
|
479
|
+
);
|
|
480
|
+
return [n, r];
|
|
481
|
+
}
|
|
482
|
+
function kt(e) {
|
|
483
|
+
const t = P();
|
|
484
|
+
return k(() => {
|
|
485
|
+
t.current = e;
|
|
486
|
+
}, [e]), t.current;
|
|
487
|
+
}
|
|
488
|
+
let Et = {};
|
|
489
|
+
function ct(e, t) {
|
|
490
|
+
return M(() => {
|
|
491
|
+
if (t)
|
|
492
|
+
return t;
|
|
493
|
+
const n = Et[e] == null ? 0 : Et[e] + 1;
|
|
494
|
+
return Et[e] = n, e + "-" + n;
|
|
495
|
+
}, [e, t]);
|
|
496
|
+
}
|
|
497
|
+
function On(e) {
|
|
498
|
+
return function(t) {
|
|
499
|
+
for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
|
|
500
|
+
r[o - 1] = arguments[o];
|
|
501
|
+
return r.reduce((s, i) => {
|
|
502
|
+
const a = Object.entries(i);
|
|
503
|
+
for (const [c, u] of a) {
|
|
504
|
+
const h = s[c];
|
|
505
|
+
h != null && (s[c] = h + e * u);
|
|
506
|
+
}
|
|
507
|
+
return s;
|
|
508
|
+
}, {
|
|
509
|
+
...t
|
|
510
|
+
});
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
const $e = /* @__PURE__ */ On(1), xt = /* @__PURE__ */ On(-1);
|
|
514
|
+
function _r(e) {
|
|
515
|
+
return "clientX" in e && "clientY" in e;
|
|
516
|
+
}
|
|
517
|
+
function Vt(e) {
|
|
518
|
+
if (!e)
|
|
519
|
+
return !1;
|
|
520
|
+
const {
|
|
521
|
+
KeyboardEvent: t
|
|
522
|
+
} = ee(e.target);
|
|
523
|
+
return t && e instanceof t;
|
|
524
|
+
}
|
|
525
|
+
function $r(e) {
|
|
526
|
+
if (!e)
|
|
527
|
+
return !1;
|
|
528
|
+
const {
|
|
529
|
+
TouchEvent: t
|
|
530
|
+
} = ee(e.target);
|
|
531
|
+
return t && e instanceof t;
|
|
532
|
+
}
|
|
533
|
+
function Lt(e) {
|
|
534
|
+
if ($r(e)) {
|
|
535
|
+
if (e.touches && e.touches.length) {
|
|
536
|
+
const {
|
|
537
|
+
clientX: t,
|
|
538
|
+
clientY: n
|
|
539
|
+
} = e.touches[0];
|
|
540
|
+
return {
|
|
541
|
+
x: t,
|
|
542
|
+
y: n
|
|
543
|
+
};
|
|
544
|
+
} else if (e.changedTouches && e.changedTouches.length) {
|
|
545
|
+
const {
|
|
546
|
+
clientX: t,
|
|
547
|
+
clientY: n
|
|
548
|
+
} = e.changedTouches[0];
|
|
549
|
+
return {
|
|
550
|
+
x: t,
|
|
551
|
+
y: n
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return _r(e) ? {
|
|
556
|
+
x: e.clientX,
|
|
557
|
+
y: e.clientY
|
|
558
|
+
} : null;
|
|
559
|
+
}
|
|
560
|
+
const nt = /* @__PURE__ */ Object.freeze({
|
|
561
|
+
Translate: {
|
|
562
|
+
toString(e) {
|
|
563
|
+
if (!e)
|
|
564
|
+
return;
|
|
565
|
+
const {
|
|
566
|
+
x: t,
|
|
567
|
+
y: n
|
|
568
|
+
} = e;
|
|
569
|
+
return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
Scale: {
|
|
573
|
+
toString(e) {
|
|
574
|
+
if (!e)
|
|
575
|
+
return;
|
|
576
|
+
const {
|
|
577
|
+
scaleX: t,
|
|
578
|
+
scaleY: n
|
|
579
|
+
} = e;
|
|
580
|
+
return "scaleX(" + t + ") scaleY(" + n + ")";
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
Transform: {
|
|
584
|
+
toString(e) {
|
|
585
|
+
if (e)
|
|
586
|
+
return [nt.Translate.toString(e), nt.Scale.toString(e)].join(" ");
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
Transition: {
|
|
590
|
+
toString(e) {
|
|
591
|
+
let {
|
|
592
|
+
property: t,
|
|
593
|
+
duration: n,
|
|
594
|
+
easing: r
|
|
595
|
+
} = e;
|
|
596
|
+
return t + " " + n + "ms " + r;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}), dn = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
600
|
+
function zr(e) {
|
|
601
|
+
return e.matches(dn) ? e : e.querySelector(dn);
|
|
602
|
+
}
|
|
603
|
+
const Fr = {
|
|
604
|
+
display: "none"
|
|
605
|
+
};
|
|
606
|
+
function Br(e) {
|
|
607
|
+
let {
|
|
608
|
+
id: t,
|
|
609
|
+
value: n
|
|
610
|
+
} = e;
|
|
611
|
+
return W.createElement("div", {
|
|
612
|
+
id: t,
|
|
613
|
+
style: Fr
|
|
614
|
+
}, n);
|
|
615
|
+
}
|
|
616
|
+
function Yr(e) {
|
|
617
|
+
let {
|
|
618
|
+
id: t,
|
|
619
|
+
announcement: n,
|
|
620
|
+
ariaLiveType: r = "assertive"
|
|
621
|
+
} = e;
|
|
622
|
+
const o = {
|
|
623
|
+
position: "fixed",
|
|
624
|
+
top: 0,
|
|
625
|
+
left: 0,
|
|
626
|
+
width: 1,
|
|
627
|
+
height: 1,
|
|
628
|
+
margin: -1,
|
|
629
|
+
border: 0,
|
|
630
|
+
padding: 0,
|
|
631
|
+
overflow: "hidden",
|
|
632
|
+
clip: "rect(0 0 0 0)",
|
|
633
|
+
clipPath: "inset(100%)",
|
|
634
|
+
whiteSpace: "nowrap"
|
|
635
|
+
};
|
|
636
|
+
return W.createElement("div", {
|
|
637
|
+
id: t,
|
|
638
|
+
style: o,
|
|
639
|
+
role: "status",
|
|
640
|
+
"aria-live": r,
|
|
641
|
+
"aria-atomic": !0
|
|
642
|
+
}, n);
|
|
643
|
+
}
|
|
644
|
+
function Vr() {
|
|
645
|
+
const [e, t] = K("");
|
|
646
|
+
return {
|
|
647
|
+
announce: Q((r) => {
|
|
648
|
+
r != null && t(r);
|
|
649
|
+
}, []),
|
|
650
|
+
announcement: e
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
const Mn = /* @__PURE__ */ st(null);
|
|
654
|
+
function Wr(e) {
|
|
655
|
+
const t = Ee(Mn);
|
|
656
|
+
k(() => {
|
|
657
|
+
if (!t)
|
|
658
|
+
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
659
|
+
return t(e);
|
|
660
|
+
}, [e, t]);
|
|
661
|
+
}
|
|
662
|
+
function Ur() {
|
|
663
|
+
const [e] = K(() => /* @__PURE__ */ new Set()), t = Q((r) => (e.add(r), () => e.delete(r)), [e]);
|
|
664
|
+
return [Q((r) => {
|
|
665
|
+
let {
|
|
666
|
+
type: o,
|
|
667
|
+
event: s
|
|
668
|
+
} = r;
|
|
669
|
+
e.forEach((i) => {
|
|
670
|
+
var a;
|
|
671
|
+
return (a = i[o]) == null ? void 0 : a.call(i, s);
|
|
672
|
+
});
|
|
673
|
+
}, [e]), t];
|
|
674
|
+
}
|
|
675
|
+
const Xr = {
|
|
676
|
+
draggable: `
|
|
677
|
+
To pick up a draggable item, press the space bar.
|
|
678
|
+
While dragging, use the arrow keys to move the item.
|
|
679
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
680
|
+
`
|
|
681
|
+
}, Gr = {
|
|
682
|
+
onDragStart(e) {
|
|
683
|
+
let {
|
|
684
|
+
active: t
|
|
685
|
+
} = e;
|
|
686
|
+
return "Picked up draggable item " + t.id + ".";
|
|
687
|
+
},
|
|
688
|
+
onDragOver(e) {
|
|
689
|
+
let {
|
|
690
|
+
active: t,
|
|
691
|
+
over: n
|
|
692
|
+
} = e;
|
|
693
|
+
return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
|
|
694
|
+
},
|
|
695
|
+
onDragEnd(e) {
|
|
696
|
+
let {
|
|
697
|
+
active: t,
|
|
698
|
+
over: n
|
|
699
|
+
} = e;
|
|
700
|
+
return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
|
|
701
|
+
},
|
|
702
|
+
onDragCancel(e) {
|
|
703
|
+
let {
|
|
704
|
+
active: t
|
|
705
|
+
} = e;
|
|
706
|
+
return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
function Hr(e) {
|
|
710
|
+
let {
|
|
711
|
+
announcements: t = Gr,
|
|
712
|
+
container: n,
|
|
713
|
+
hiddenTextDescribedById: r,
|
|
714
|
+
screenReaderInstructions: o = Xr
|
|
715
|
+
} = e;
|
|
716
|
+
const {
|
|
717
|
+
announce: s,
|
|
718
|
+
announcement: i
|
|
719
|
+
} = Vr(), a = ct("DndLiveRegion"), [c, u] = K(!1);
|
|
720
|
+
if (k(() => {
|
|
721
|
+
u(!0);
|
|
722
|
+
}, []), Wr(M(() => ({
|
|
723
|
+
onDragStart(f) {
|
|
724
|
+
let {
|
|
725
|
+
active: p
|
|
726
|
+
} = f;
|
|
727
|
+
s(t.onDragStart({
|
|
728
|
+
active: p
|
|
729
|
+
}));
|
|
730
|
+
},
|
|
731
|
+
onDragMove(f) {
|
|
732
|
+
let {
|
|
733
|
+
active: p,
|
|
734
|
+
over: g
|
|
735
|
+
} = f;
|
|
736
|
+
t.onDragMove && s(t.onDragMove({
|
|
737
|
+
active: p,
|
|
738
|
+
over: g
|
|
739
|
+
}));
|
|
740
|
+
},
|
|
741
|
+
onDragOver(f) {
|
|
742
|
+
let {
|
|
743
|
+
active: p,
|
|
744
|
+
over: g
|
|
745
|
+
} = f;
|
|
746
|
+
s(t.onDragOver({
|
|
747
|
+
active: p,
|
|
748
|
+
over: g
|
|
749
|
+
}));
|
|
750
|
+
},
|
|
751
|
+
onDragEnd(f) {
|
|
752
|
+
let {
|
|
753
|
+
active: p,
|
|
754
|
+
over: g
|
|
755
|
+
} = f;
|
|
756
|
+
s(t.onDragEnd({
|
|
757
|
+
active: p,
|
|
758
|
+
over: g
|
|
759
|
+
}));
|
|
760
|
+
},
|
|
761
|
+
onDragCancel(f) {
|
|
762
|
+
let {
|
|
763
|
+
active: p,
|
|
764
|
+
over: g
|
|
765
|
+
} = f;
|
|
766
|
+
s(t.onDragCancel({
|
|
767
|
+
active: p,
|
|
768
|
+
over: g
|
|
769
|
+
}));
|
|
770
|
+
}
|
|
771
|
+
}), [s, t])), !c)
|
|
772
|
+
return null;
|
|
773
|
+
const h = W.createElement(W.Fragment, null, W.createElement(Br, {
|
|
774
|
+
id: r,
|
|
775
|
+
value: o.draggable
|
|
776
|
+
}), W.createElement(Yr, {
|
|
777
|
+
id: a,
|
|
778
|
+
announcement: i
|
|
779
|
+
}));
|
|
780
|
+
return n ? Cr(h, n) : h;
|
|
781
|
+
}
|
|
782
|
+
var Y;
|
|
783
|
+
(function(e) {
|
|
784
|
+
e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
|
|
785
|
+
})(Y || (Y = {}));
|
|
786
|
+
function mt() {
|
|
787
|
+
}
|
|
788
|
+
function fn(e, t) {
|
|
789
|
+
return M(
|
|
790
|
+
() => ({
|
|
791
|
+
sensor: e,
|
|
792
|
+
options: t ?? {}
|
|
793
|
+
}),
|
|
794
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
795
|
+
[e, t]
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
function qr() {
|
|
799
|
+
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
800
|
+
t[n] = arguments[n];
|
|
801
|
+
return M(
|
|
802
|
+
() => [...t].filter((r) => r != null),
|
|
803
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
804
|
+
[...t]
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
const ce = /* @__PURE__ */ Object.freeze({
|
|
808
|
+
x: 0,
|
|
809
|
+
y: 0
|
|
810
|
+
});
|
|
811
|
+
function Jr(e, t) {
|
|
812
|
+
return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
|
|
813
|
+
}
|
|
814
|
+
function Kr(e, t) {
|
|
815
|
+
let {
|
|
816
|
+
data: {
|
|
817
|
+
value: n
|
|
818
|
+
}
|
|
819
|
+
} = e, {
|
|
820
|
+
data: {
|
|
821
|
+
value: r
|
|
822
|
+
}
|
|
823
|
+
} = t;
|
|
824
|
+
return n - r;
|
|
825
|
+
}
|
|
826
|
+
function Qr(e, t) {
|
|
827
|
+
let {
|
|
828
|
+
data: {
|
|
829
|
+
value: n
|
|
830
|
+
}
|
|
831
|
+
} = e, {
|
|
832
|
+
data: {
|
|
833
|
+
value: r
|
|
834
|
+
}
|
|
835
|
+
} = t;
|
|
836
|
+
return r - n;
|
|
837
|
+
}
|
|
838
|
+
function Zr(e, t) {
|
|
839
|
+
if (!e || e.length === 0)
|
|
840
|
+
return null;
|
|
841
|
+
const [n] = e;
|
|
842
|
+
return n[t];
|
|
843
|
+
}
|
|
844
|
+
function hn(e, t, n) {
|
|
845
|
+
return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
|
|
846
|
+
x: t + e.width * 0.5,
|
|
847
|
+
y: n + e.height * 0.5
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
const eo = (e) => {
|
|
851
|
+
let {
|
|
852
|
+
collisionRect: t,
|
|
853
|
+
droppableRects: n,
|
|
854
|
+
droppableContainers: r
|
|
855
|
+
} = e;
|
|
856
|
+
const o = hn(t, t.left, t.top), s = [];
|
|
857
|
+
for (const i of r) {
|
|
858
|
+
const {
|
|
859
|
+
id: a
|
|
860
|
+
} = i, c = n.get(a);
|
|
861
|
+
if (c) {
|
|
862
|
+
const u = Jr(hn(c), o);
|
|
863
|
+
s.push({
|
|
864
|
+
id: a,
|
|
865
|
+
data: {
|
|
866
|
+
droppableContainer: i,
|
|
867
|
+
value: u
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return s.sort(Kr);
|
|
873
|
+
};
|
|
874
|
+
function to(e, t) {
|
|
875
|
+
const n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), o = Math.min(t.left + t.width, e.left + e.width), s = Math.min(t.top + t.height, e.top + e.height), i = o - r, a = s - n;
|
|
876
|
+
if (r < o && n < s) {
|
|
877
|
+
const c = t.width * t.height, u = e.width * e.height, h = i * a, f = h / (c + u - h);
|
|
878
|
+
return Number(f.toFixed(4));
|
|
879
|
+
}
|
|
880
|
+
return 0;
|
|
881
|
+
}
|
|
882
|
+
const no = (e) => {
|
|
883
|
+
let {
|
|
884
|
+
collisionRect: t,
|
|
885
|
+
droppableRects: n,
|
|
886
|
+
droppableContainers: r
|
|
887
|
+
} = e;
|
|
888
|
+
const o = [];
|
|
889
|
+
for (const s of r) {
|
|
890
|
+
const {
|
|
891
|
+
id: i
|
|
892
|
+
} = s, a = n.get(i);
|
|
893
|
+
if (a) {
|
|
894
|
+
const c = to(a, t);
|
|
895
|
+
c > 0 && o.push({
|
|
896
|
+
id: i,
|
|
897
|
+
data: {
|
|
898
|
+
droppableContainer: s,
|
|
899
|
+
value: c
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
return o.sort(Qr);
|
|
905
|
+
};
|
|
906
|
+
function ro(e, t, n) {
|
|
907
|
+
return {
|
|
908
|
+
...e,
|
|
909
|
+
scaleX: t && n ? t.width / n.width : 1,
|
|
910
|
+
scaleY: t && n ? t.height / n.height : 1
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
function kn(e, t) {
|
|
914
|
+
return e && t ? {
|
|
915
|
+
x: e.left - t.left,
|
|
916
|
+
y: e.top - t.top
|
|
917
|
+
} : ce;
|
|
918
|
+
}
|
|
919
|
+
function oo(e) {
|
|
920
|
+
return function(n) {
|
|
921
|
+
for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
|
|
922
|
+
o[s - 1] = arguments[s];
|
|
923
|
+
return o.reduce((i, a) => ({
|
|
924
|
+
...i,
|
|
925
|
+
top: i.top + e * a.y,
|
|
926
|
+
bottom: i.bottom + e * a.y,
|
|
927
|
+
left: i.left + e * a.x,
|
|
928
|
+
right: i.right + e * a.x
|
|
929
|
+
}), {
|
|
930
|
+
...n
|
|
931
|
+
});
|
|
932
|
+
};
|
|
933
|
+
}
|
|
934
|
+
const so = /* @__PURE__ */ oo(1);
|
|
935
|
+
function io(e) {
|
|
936
|
+
if (e.startsWith("matrix3d(")) {
|
|
937
|
+
const t = e.slice(9, -1).split(/, /);
|
|
938
|
+
return {
|
|
939
|
+
x: +t[12],
|
|
940
|
+
y: +t[13],
|
|
941
|
+
scaleX: +t[0],
|
|
942
|
+
scaleY: +t[5]
|
|
943
|
+
};
|
|
944
|
+
} else if (e.startsWith("matrix(")) {
|
|
945
|
+
const t = e.slice(7, -1).split(/, /);
|
|
946
|
+
return {
|
|
947
|
+
x: +t[4],
|
|
948
|
+
y: +t[5],
|
|
949
|
+
scaleX: +t[0],
|
|
950
|
+
scaleY: +t[3]
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
return null;
|
|
954
|
+
}
|
|
955
|
+
function ao(e, t, n) {
|
|
956
|
+
const r = io(t);
|
|
957
|
+
if (!r)
|
|
958
|
+
return e;
|
|
959
|
+
const {
|
|
960
|
+
scaleX: o,
|
|
961
|
+
scaleY: s,
|
|
962
|
+
x: i,
|
|
963
|
+
y: a
|
|
964
|
+
} = r, c = e.left - i - (1 - o) * parseFloat(n), u = e.top - a - (1 - s) * parseFloat(n.slice(n.indexOf(" ") + 1)), h = o ? e.width / o : e.width, f = s ? e.height / s : e.height;
|
|
965
|
+
return {
|
|
966
|
+
width: h,
|
|
967
|
+
height: f,
|
|
968
|
+
top: u,
|
|
969
|
+
right: c + h,
|
|
970
|
+
bottom: u + f,
|
|
971
|
+
left: c
|
|
972
|
+
};
|
|
973
|
+
}
|
|
974
|
+
const lo = {
|
|
975
|
+
ignoreTransform: !1
|
|
976
|
+
};
|
|
977
|
+
function Ve(e, t) {
|
|
978
|
+
t === void 0 && (t = lo);
|
|
979
|
+
let n = e.getBoundingClientRect();
|
|
980
|
+
if (t.ignoreTransform) {
|
|
981
|
+
const {
|
|
982
|
+
transform: u,
|
|
983
|
+
transformOrigin: h
|
|
984
|
+
} = ee(e).getComputedStyle(e);
|
|
985
|
+
u && (n = ao(n, u, h));
|
|
986
|
+
}
|
|
987
|
+
const {
|
|
988
|
+
top: r,
|
|
989
|
+
left: o,
|
|
990
|
+
width: s,
|
|
991
|
+
height: i,
|
|
992
|
+
bottom: a,
|
|
993
|
+
right: c
|
|
994
|
+
} = n;
|
|
995
|
+
return {
|
|
996
|
+
top: r,
|
|
997
|
+
left: o,
|
|
998
|
+
width: s,
|
|
999
|
+
height: i,
|
|
1000
|
+
bottom: a,
|
|
1001
|
+
right: c
|
|
1002
|
+
};
|
|
1003
|
+
}
|
|
1004
|
+
function gn(e) {
|
|
1005
|
+
return Ve(e, {
|
|
1006
|
+
ignoreTransform: !0
|
|
1007
|
+
});
|
|
1008
|
+
}
|
|
1009
|
+
function co(e) {
|
|
1010
|
+
const t = e.innerWidth, n = e.innerHeight;
|
|
1011
|
+
return {
|
|
1012
|
+
top: 0,
|
|
1013
|
+
left: 0,
|
|
1014
|
+
right: t,
|
|
1015
|
+
bottom: n,
|
|
1016
|
+
width: t,
|
|
1017
|
+
height: n
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
function uo(e, t) {
|
|
1021
|
+
return t === void 0 && (t = ee(e).getComputedStyle(e)), t.position === "fixed";
|
|
1022
|
+
}
|
|
1023
|
+
function fo(e, t) {
|
|
1024
|
+
t === void 0 && (t = ee(e).getComputedStyle(e));
|
|
1025
|
+
const n = /(auto|scroll|overlay)/;
|
|
1026
|
+
return ["overflow", "overflowX", "overflowY"].some((o) => {
|
|
1027
|
+
const s = t[o];
|
|
1028
|
+
return typeof s == "string" ? n.test(s) : !1;
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
function Wt(e, t) {
|
|
1032
|
+
const n = [];
|
|
1033
|
+
function r(o) {
|
|
1034
|
+
if (t != null && n.length >= t || !o)
|
|
1035
|
+
return n;
|
|
1036
|
+
if (Bt(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
|
|
1037
|
+
return n.push(o.scrollingElement), n;
|
|
1038
|
+
if (!at(o) || Tn(o) || n.includes(o))
|
|
1039
|
+
return n;
|
|
1040
|
+
const s = ee(e).getComputedStyle(o);
|
|
1041
|
+
return o !== e && fo(o, s) && n.push(o), uo(o, s) ? n : r(o.parentNode);
|
|
1042
|
+
}
|
|
1043
|
+
return e ? r(e) : n;
|
|
1044
|
+
}
|
|
1045
|
+
function Ln(e) {
|
|
1046
|
+
const [t] = Wt(e, 1);
|
|
1047
|
+
return t ?? null;
|
|
1048
|
+
}
|
|
1049
|
+
function At(e) {
|
|
1050
|
+
return !St || !e ? null : Be(e) ? e : Ft(e) ? Bt(e) || e === Ye(e).scrollingElement ? window : at(e) ? e : null : null;
|
|
1051
|
+
}
|
|
1052
|
+
function Pn(e) {
|
|
1053
|
+
return Be(e) ? e.scrollX : e.scrollLeft;
|
|
1054
|
+
}
|
|
1055
|
+
function _n(e) {
|
|
1056
|
+
return Be(e) ? e.scrollY : e.scrollTop;
|
|
1057
|
+
}
|
|
1058
|
+
function Pt(e) {
|
|
1059
|
+
return {
|
|
1060
|
+
x: Pn(e),
|
|
1061
|
+
y: _n(e)
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
var V;
|
|
1065
|
+
(function(e) {
|
|
1066
|
+
e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
|
|
1067
|
+
})(V || (V = {}));
|
|
1068
|
+
function $n(e) {
|
|
1069
|
+
return !St || !e ? !1 : e === document.scrollingElement;
|
|
1070
|
+
}
|
|
1071
|
+
function zn(e) {
|
|
1072
|
+
const t = {
|
|
1073
|
+
x: 0,
|
|
1074
|
+
y: 0
|
|
1075
|
+
}, n = $n(e) ? {
|
|
1076
|
+
height: window.innerHeight,
|
|
1077
|
+
width: window.innerWidth
|
|
1078
|
+
} : {
|
|
1079
|
+
height: e.clientHeight,
|
|
1080
|
+
width: e.clientWidth
|
|
1081
|
+
}, r = {
|
|
1082
|
+
x: e.scrollWidth - n.width,
|
|
1083
|
+
y: e.scrollHeight - n.height
|
|
1084
|
+
}, o = e.scrollTop <= t.y, s = e.scrollLeft <= t.x, i = e.scrollTop >= r.y, a = e.scrollLeft >= r.x;
|
|
1085
|
+
return {
|
|
1086
|
+
isTop: o,
|
|
1087
|
+
isLeft: s,
|
|
1088
|
+
isBottom: i,
|
|
1089
|
+
isRight: a,
|
|
1090
|
+
maxScroll: r,
|
|
1091
|
+
minScroll: t
|
|
1092
|
+
};
|
|
1093
|
+
}
|
|
1094
|
+
const ho = {
|
|
1095
|
+
x: 0.2,
|
|
1096
|
+
y: 0.2
|
|
1097
|
+
};
|
|
1098
|
+
function go(e, t, n, r, o) {
|
|
1099
|
+
let {
|
|
1100
|
+
top: s,
|
|
1101
|
+
left: i,
|
|
1102
|
+
right: a,
|
|
1103
|
+
bottom: c
|
|
1104
|
+
} = n;
|
|
1105
|
+
r === void 0 && (r = 10), o === void 0 && (o = ho);
|
|
1106
|
+
const {
|
|
1107
|
+
isTop: u,
|
|
1108
|
+
isBottom: h,
|
|
1109
|
+
isLeft: f,
|
|
1110
|
+
isRight: p
|
|
1111
|
+
} = zn(e), g = {
|
|
1112
|
+
x: 0,
|
|
1113
|
+
y: 0
|
|
1114
|
+
}, y = {
|
|
1115
|
+
x: 0,
|
|
1116
|
+
y: 0
|
|
1117
|
+
}, v = {
|
|
1118
|
+
height: t.height * o.y,
|
|
1119
|
+
width: t.width * o.x
|
|
1120
|
+
};
|
|
1121
|
+
return !u && s <= t.top + v.height ? (g.y = V.Backward, y.y = r * Math.abs((t.top + v.height - s) / v.height)) : !h && c >= t.bottom - v.height && (g.y = V.Forward, y.y = r * Math.abs((t.bottom - v.height - c) / v.height)), !p && a >= t.right - v.width ? (g.x = V.Forward, y.x = r * Math.abs((t.right - v.width - a) / v.width)) : !f && i <= t.left + v.width && (g.x = V.Backward, y.x = r * Math.abs((t.left + v.width - i) / v.width)), {
|
|
1122
|
+
direction: g,
|
|
1123
|
+
speed: y
|
|
1124
|
+
};
|
|
1125
|
+
}
|
|
1126
|
+
function po(e) {
|
|
1127
|
+
if (e === document.scrollingElement) {
|
|
1128
|
+
const {
|
|
1129
|
+
innerWidth: s,
|
|
1130
|
+
innerHeight: i
|
|
1131
|
+
} = window;
|
|
1132
|
+
return {
|
|
1133
|
+
top: 0,
|
|
1134
|
+
left: 0,
|
|
1135
|
+
right: s,
|
|
1136
|
+
bottom: i,
|
|
1137
|
+
width: s,
|
|
1138
|
+
height: i
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
const {
|
|
1142
|
+
top: t,
|
|
1143
|
+
left: n,
|
|
1144
|
+
right: r,
|
|
1145
|
+
bottom: o
|
|
1146
|
+
} = e.getBoundingClientRect();
|
|
1147
|
+
return {
|
|
1148
|
+
top: t,
|
|
1149
|
+
left: n,
|
|
1150
|
+
right: r,
|
|
1151
|
+
bottom: o,
|
|
1152
|
+
width: e.clientWidth,
|
|
1153
|
+
height: e.clientHeight
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
function Fn(e) {
|
|
1157
|
+
return e.reduce((t, n) => $e(t, Pt(n)), ce);
|
|
1158
|
+
}
|
|
1159
|
+
function vo(e) {
|
|
1160
|
+
return e.reduce((t, n) => t + Pn(n), 0);
|
|
1161
|
+
}
|
|
1162
|
+
function bo(e) {
|
|
1163
|
+
return e.reduce((t, n) => t + _n(n), 0);
|
|
1164
|
+
}
|
|
1165
|
+
function xo(e, t) {
|
|
1166
|
+
if (t === void 0 && (t = Ve), !e)
|
|
1167
|
+
return;
|
|
1168
|
+
const {
|
|
1169
|
+
top: n,
|
|
1170
|
+
left: r,
|
|
1171
|
+
bottom: o,
|
|
1172
|
+
right: s
|
|
1173
|
+
} = t(e);
|
|
1174
|
+
Ln(e) && (o <= 0 || s <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
|
|
1175
|
+
block: "center",
|
|
1176
|
+
inline: "center"
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
const mo = [["x", ["left", "right"], vo], ["y", ["top", "bottom"], bo]];
|
|
1180
|
+
class Ut {
|
|
1181
|
+
constructor(t, n) {
|
|
1182
|
+
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;
|
|
1183
|
+
const r = Wt(n), o = Fn(r);
|
|
1184
|
+
this.rect = {
|
|
1185
|
+
...t
|
|
1186
|
+
}, this.width = t.width, this.height = t.height;
|
|
1187
|
+
for (const [s, i, a] of mo)
|
|
1188
|
+
for (const c of i)
|
|
1189
|
+
Object.defineProperty(this, c, {
|
|
1190
|
+
get: () => {
|
|
1191
|
+
const u = a(r), h = o[s] - u;
|
|
1192
|
+
return this.rect[c] + h;
|
|
1193
|
+
},
|
|
1194
|
+
enumerable: !0
|
|
1195
|
+
});
|
|
1196
|
+
Object.defineProperty(this, "rect", {
|
|
1197
|
+
enumerable: !1
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
class Qe {
|
|
1202
|
+
constructor(t) {
|
|
1203
|
+
this.target = void 0, this.listeners = [], this.removeAll = () => {
|
|
1204
|
+
this.listeners.forEach((n) => {
|
|
1205
|
+
var r;
|
|
1206
|
+
return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
|
|
1207
|
+
});
|
|
1208
|
+
}, this.target = t;
|
|
1209
|
+
}
|
|
1210
|
+
add(t, n, r) {
|
|
1211
|
+
var o;
|
|
1212
|
+
(o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
function yo(e) {
|
|
1216
|
+
const {
|
|
1217
|
+
EventTarget: t
|
|
1218
|
+
} = ee(e);
|
|
1219
|
+
return e instanceof t ? e : Ye(e);
|
|
1220
|
+
}
|
|
1221
|
+
function It(e, t) {
|
|
1222
|
+
const n = Math.abs(e.x), r = Math.abs(e.y);
|
|
1223
|
+
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;
|
|
1224
|
+
}
|
|
1225
|
+
var ae;
|
|
1226
|
+
(function(e) {
|
|
1227
|
+
e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
|
|
1228
|
+
})(ae || (ae = {}));
|
|
1229
|
+
function pn(e) {
|
|
1230
|
+
e.preventDefault();
|
|
1231
|
+
}
|
|
1232
|
+
function wo(e) {
|
|
1233
|
+
e.stopPropagation();
|
|
1234
|
+
}
|
|
1235
|
+
var T;
|
|
1236
|
+
(function(e) {
|
|
1237
|
+
e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
|
|
1238
|
+
})(T || (T = {}));
|
|
1239
|
+
const Bn = {
|
|
1240
|
+
start: [T.Space, T.Enter],
|
|
1241
|
+
cancel: [T.Esc],
|
|
1242
|
+
end: [T.Space, T.Enter, T.Tab]
|
|
1243
|
+
}, So = (e, t) => {
|
|
1244
|
+
let {
|
|
1245
|
+
currentCoordinates: n
|
|
1246
|
+
} = t;
|
|
1247
|
+
switch (e.code) {
|
|
1248
|
+
case T.Right:
|
|
1249
|
+
return {
|
|
1250
|
+
...n,
|
|
1251
|
+
x: n.x + 25
|
|
1252
|
+
};
|
|
1253
|
+
case T.Left:
|
|
1254
|
+
return {
|
|
1255
|
+
...n,
|
|
1256
|
+
x: n.x - 25
|
|
1257
|
+
};
|
|
1258
|
+
case T.Down:
|
|
1259
|
+
return {
|
|
1260
|
+
...n,
|
|
1261
|
+
y: n.y + 25
|
|
1262
|
+
};
|
|
1263
|
+
case T.Up:
|
|
1264
|
+
return {
|
|
1265
|
+
...n,
|
|
1266
|
+
y: n.y - 25
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
};
|
|
1270
|
+
class Xt {
|
|
1271
|
+
constructor(t) {
|
|
1272
|
+
this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
|
|
1273
|
+
const {
|
|
1274
|
+
event: {
|
|
1275
|
+
target: n
|
|
1276
|
+
}
|
|
1277
|
+
} = t;
|
|
1278
|
+
this.props = t, this.listeners = new Qe(Ye(n)), this.windowListeners = new Qe(ee(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
1279
|
+
}
|
|
1280
|
+
attach() {
|
|
1281
|
+
this.handleStart(), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(ae.Keydown, this.handleKeyDown));
|
|
1282
|
+
}
|
|
1283
|
+
handleStart() {
|
|
1284
|
+
const {
|
|
1285
|
+
activeNode: t,
|
|
1286
|
+
onStart: n
|
|
1287
|
+
} = this.props, r = t.node.current;
|
|
1288
|
+
r && xo(r), n(ce);
|
|
1289
|
+
}
|
|
1290
|
+
handleKeyDown(t) {
|
|
1291
|
+
if (Vt(t)) {
|
|
1292
|
+
const {
|
|
1293
|
+
active: n,
|
|
1294
|
+
context: r,
|
|
1295
|
+
options: o
|
|
1296
|
+
} = this.props, {
|
|
1297
|
+
keyboardCodes: s = Bn,
|
|
1298
|
+
coordinateGetter: i = So,
|
|
1299
|
+
scrollBehavior: a = "smooth"
|
|
1300
|
+
} = o, {
|
|
1301
|
+
code: c
|
|
1302
|
+
} = t;
|
|
1303
|
+
if (s.end.includes(c)) {
|
|
1304
|
+
this.handleEnd(t);
|
|
1305
|
+
return;
|
|
1306
|
+
}
|
|
1307
|
+
if (s.cancel.includes(c)) {
|
|
1308
|
+
this.handleCancel(t);
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
const {
|
|
1312
|
+
collisionRect: u
|
|
1313
|
+
} = r.current, h = u ? {
|
|
1314
|
+
x: u.left,
|
|
1315
|
+
y: u.top
|
|
1316
|
+
} : ce;
|
|
1317
|
+
this.referenceCoordinates || (this.referenceCoordinates = h);
|
|
1318
|
+
const f = i(t, {
|
|
1319
|
+
active: n,
|
|
1320
|
+
context: r.current,
|
|
1321
|
+
currentCoordinates: h
|
|
1322
|
+
});
|
|
1323
|
+
if (f) {
|
|
1324
|
+
const p = xt(f, h), g = {
|
|
1325
|
+
x: 0,
|
|
1326
|
+
y: 0
|
|
1327
|
+
}, {
|
|
1328
|
+
scrollableAncestors: y
|
|
1329
|
+
} = r.current;
|
|
1330
|
+
for (const v of y) {
|
|
1331
|
+
const b = t.code, {
|
|
1332
|
+
isTop: w,
|
|
1333
|
+
isRight: j,
|
|
1334
|
+
isLeft: C,
|
|
1335
|
+
isBottom: R,
|
|
1336
|
+
maxScroll: E,
|
|
1337
|
+
minScroll: N
|
|
1338
|
+
} = zn(v), x = po(v), S = {
|
|
1339
|
+
x: Math.min(b === T.Right ? x.right - x.width / 2 : x.right, Math.max(b === T.Right ? x.left : x.left + x.width / 2, f.x)),
|
|
1340
|
+
y: Math.min(b === T.Down ? x.bottom - x.height / 2 : x.bottom, Math.max(b === T.Down ? x.top : x.top + x.height / 2, f.y))
|
|
1341
|
+
}, D = b === T.Right && !j || b === T.Left && !C, _ = b === T.Down && !R || b === T.Up && !w;
|
|
1342
|
+
if (D && S.x !== f.x) {
|
|
1343
|
+
const A = v.scrollLeft + p.x, B = b === T.Right && A <= E.x || b === T.Left && A >= N.x;
|
|
1344
|
+
if (B && !p.y) {
|
|
1345
|
+
v.scrollTo({
|
|
1346
|
+
left: A,
|
|
1347
|
+
behavior: a
|
|
1348
|
+
});
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1351
|
+
B ? g.x = v.scrollLeft - A : g.x = b === T.Right ? v.scrollLeft - E.x : v.scrollLeft - N.x, g.x && v.scrollBy({
|
|
1352
|
+
left: -g.x,
|
|
1353
|
+
behavior: a
|
|
1354
|
+
});
|
|
1355
|
+
break;
|
|
1356
|
+
} else if (_ && S.y !== f.y) {
|
|
1357
|
+
const A = v.scrollTop + p.y, B = b === T.Down && A <= E.y || b === T.Up && A >= N.y;
|
|
1358
|
+
if (B && !p.x) {
|
|
1359
|
+
v.scrollTo({
|
|
1360
|
+
top: A,
|
|
1361
|
+
behavior: a
|
|
1362
|
+
});
|
|
1363
|
+
return;
|
|
1364
|
+
}
|
|
1365
|
+
B ? g.y = v.scrollTop - A : g.y = b === T.Down ? v.scrollTop - E.y : v.scrollTop - N.y, g.y && v.scrollBy({
|
|
1366
|
+
top: -g.y,
|
|
1367
|
+
behavior: a
|
|
1368
|
+
});
|
|
1369
|
+
break;
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
this.handleMove(t, $e(xt(f, this.referenceCoordinates), g));
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
handleMove(t, n) {
|
|
1377
|
+
const {
|
|
1378
|
+
onMove: r
|
|
1379
|
+
} = this.props;
|
|
1380
|
+
t.preventDefault(), r(n);
|
|
1381
|
+
}
|
|
1382
|
+
handleEnd(t) {
|
|
1383
|
+
const {
|
|
1384
|
+
onEnd: n
|
|
1385
|
+
} = this.props;
|
|
1386
|
+
t.preventDefault(), this.detach(), n();
|
|
1387
|
+
}
|
|
1388
|
+
handleCancel(t) {
|
|
1389
|
+
const {
|
|
1390
|
+
onCancel: n
|
|
1391
|
+
} = this.props;
|
|
1392
|
+
t.preventDefault(), this.detach(), n();
|
|
1393
|
+
}
|
|
1394
|
+
detach() {
|
|
1395
|
+
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
Xt.activators = [{
|
|
1399
|
+
eventName: "onKeyDown",
|
|
1400
|
+
handler: (e, t, n) => {
|
|
1401
|
+
let {
|
|
1402
|
+
keyboardCodes: r = Bn,
|
|
1403
|
+
onActivation: o
|
|
1404
|
+
} = t, {
|
|
1405
|
+
active: s
|
|
1406
|
+
} = n;
|
|
1407
|
+
const {
|
|
1408
|
+
code: i
|
|
1409
|
+
} = e.nativeEvent;
|
|
1410
|
+
if (r.start.includes(i)) {
|
|
1411
|
+
const a = s.activatorNode.current;
|
|
1412
|
+
return a && e.target !== a ? !1 : (e.preventDefault(), o?.({
|
|
1413
|
+
event: e.nativeEvent
|
|
1414
|
+
}), !0);
|
|
1415
|
+
}
|
|
1416
|
+
return !1;
|
|
1417
|
+
}
|
|
1418
|
+
}];
|
|
1419
|
+
function vn(e) {
|
|
1420
|
+
return !!(e && "distance" in e);
|
|
1421
|
+
}
|
|
1422
|
+
function bn(e) {
|
|
1423
|
+
return !!(e && "delay" in e);
|
|
1424
|
+
}
|
|
1425
|
+
class Gt {
|
|
1426
|
+
constructor(t, n, r) {
|
|
1427
|
+
var o;
|
|
1428
|
+
r === void 0 && (r = yo(t.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 = t, this.events = n;
|
|
1429
|
+
const {
|
|
1430
|
+
event: s
|
|
1431
|
+
} = t, {
|
|
1432
|
+
target: i
|
|
1433
|
+
} = s;
|
|
1434
|
+
this.props = t, this.events = n, this.document = Ye(i), this.documentListeners = new Qe(this.document), this.listeners = new Qe(r), this.windowListeners = new Qe(ee(i)), this.initialCoordinates = (o = Lt(s)) != null ? o : ce, 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();
|
|
1435
|
+
}
|
|
1436
|
+
attach() {
|
|
1437
|
+
const {
|
|
1438
|
+
events: t,
|
|
1439
|
+
props: {
|
|
1440
|
+
options: {
|
|
1441
|
+
activationConstraint: n,
|
|
1442
|
+
bypassActivationConstraint: r
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
} = this;
|
|
1446
|
+
if (this.listeners.add(t.move.name, this.handleMove, {
|
|
1447
|
+
passive: !1
|
|
1448
|
+
}), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(ae.Resize, this.handleCancel), this.windowListeners.add(ae.DragStart, pn), this.windowListeners.add(ae.VisibilityChange, this.handleCancel), this.windowListeners.add(ae.ContextMenu, pn), this.documentListeners.add(ae.Keydown, this.handleKeydown), n) {
|
|
1449
|
+
if (r != null && r({
|
|
1450
|
+
event: this.props.event,
|
|
1451
|
+
activeNode: this.props.activeNode,
|
|
1452
|
+
options: this.props.options
|
|
1453
|
+
}))
|
|
1454
|
+
return this.handleStart();
|
|
1455
|
+
if (bn(n)) {
|
|
1456
|
+
this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
if (vn(n)) {
|
|
1460
|
+
this.handlePending(n);
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
this.handleStart();
|
|
1465
|
+
}
|
|
1466
|
+
detach() {
|
|
1467
|
+
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
1468
|
+
}
|
|
1469
|
+
handlePending(t, n) {
|
|
1470
|
+
const {
|
|
1471
|
+
active: r,
|
|
1472
|
+
onPending: o
|
|
1473
|
+
} = this.props;
|
|
1474
|
+
o(r, t, this.initialCoordinates, n);
|
|
1475
|
+
}
|
|
1476
|
+
handleStart() {
|
|
1477
|
+
const {
|
|
1478
|
+
initialCoordinates: t
|
|
1479
|
+
} = this, {
|
|
1480
|
+
onStart: n
|
|
1481
|
+
} = this.props;
|
|
1482
|
+
t && (this.activated = !0, this.documentListeners.add(ae.Click, wo, {
|
|
1483
|
+
capture: !0
|
|
1484
|
+
}), this.removeTextSelection(), this.documentListeners.add(ae.SelectionChange, this.removeTextSelection), n(t));
|
|
1485
|
+
}
|
|
1486
|
+
handleMove(t) {
|
|
1487
|
+
var n;
|
|
1488
|
+
const {
|
|
1489
|
+
activated: r,
|
|
1490
|
+
initialCoordinates: o,
|
|
1491
|
+
props: s
|
|
1492
|
+
} = this, {
|
|
1493
|
+
onMove: i,
|
|
1494
|
+
options: {
|
|
1495
|
+
activationConstraint: a
|
|
1496
|
+
}
|
|
1497
|
+
} = s;
|
|
1498
|
+
if (!o)
|
|
1499
|
+
return;
|
|
1500
|
+
const c = (n = Lt(t)) != null ? n : ce, u = xt(o, c);
|
|
1501
|
+
if (!r && a) {
|
|
1502
|
+
if (vn(a)) {
|
|
1503
|
+
if (a.tolerance != null && It(u, a.tolerance))
|
|
1504
|
+
return this.handleCancel();
|
|
1505
|
+
if (It(u, a.distance))
|
|
1506
|
+
return this.handleStart();
|
|
1507
|
+
}
|
|
1508
|
+
if (bn(a) && It(u, a.tolerance))
|
|
1509
|
+
return this.handleCancel();
|
|
1510
|
+
this.handlePending(a, u);
|
|
1511
|
+
return;
|
|
1512
|
+
}
|
|
1513
|
+
t.cancelable && t.preventDefault(), i(c);
|
|
1514
|
+
}
|
|
1515
|
+
handleEnd() {
|
|
1516
|
+
const {
|
|
1517
|
+
onAbort: t,
|
|
1518
|
+
onEnd: n
|
|
1519
|
+
} = this.props;
|
|
1520
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
1521
|
+
}
|
|
1522
|
+
handleCancel() {
|
|
1523
|
+
const {
|
|
1524
|
+
onAbort: t,
|
|
1525
|
+
onCancel: n
|
|
1526
|
+
} = this.props;
|
|
1527
|
+
this.detach(), this.activated || t(this.props.active), n();
|
|
1528
|
+
}
|
|
1529
|
+
handleKeydown(t) {
|
|
1530
|
+
t.code === T.Esc && this.handleCancel();
|
|
1531
|
+
}
|
|
1532
|
+
removeTextSelection() {
|
|
1533
|
+
var t;
|
|
1534
|
+
(t = this.document.getSelection()) == null || t.removeAllRanges();
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
const Co = {
|
|
1538
|
+
cancel: {
|
|
1539
|
+
name: "pointercancel"
|
|
1540
|
+
},
|
|
1541
|
+
move: {
|
|
1542
|
+
name: "pointermove"
|
|
1543
|
+
},
|
|
1544
|
+
end: {
|
|
1545
|
+
name: "pointerup"
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
class Ht extends Gt {
|
|
1549
|
+
constructor(t) {
|
|
1550
|
+
const {
|
|
1551
|
+
event: n
|
|
1552
|
+
} = t, r = Ye(n.target);
|
|
1553
|
+
super(t, Co, r);
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
Ht.activators = [{
|
|
1557
|
+
eventName: "onPointerDown",
|
|
1558
|
+
handler: (e, t) => {
|
|
1559
|
+
let {
|
|
1560
|
+
nativeEvent: n
|
|
1561
|
+
} = e, {
|
|
1562
|
+
onActivation: r
|
|
1563
|
+
} = t;
|
|
1564
|
+
return !n.isPrimary || n.button !== 0 ? !1 : (r?.({
|
|
1565
|
+
event: n
|
|
1566
|
+
}), !0);
|
|
1567
|
+
}
|
|
1568
|
+
}];
|
|
1569
|
+
const Ro = {
|
|
1570
|
+
move: {
|
|
1571
|
+
name: "mousemove"
|
|
1572
|
+
},
|
|
1573
|
+
end: {
|
|
1574
|
+
name: "mouseup"
|
|
1575
|
+
}
|
|
1576
|
+
};
|
|
1577
|
+
var _t;
|
|
1578
|
+
(function(e) {
|
|
1579
|
+
e[e.RightClick = 2] = "RightClick";
|
|
1580
|
+
})(_t || (_t = {}));
|
|
1581
|
+
class jo extends Gt {
|
|
1582
|
+
constructor(t) {
|
|
1583
|
+
super(t, Ro, Ye(t.event.target));
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
jo.activators = [{
|
|
1587
|
+
eventName: "onMouseDown",
|
|
1588
|
+
handler: (e, t) => {
|
|
1589
|
+
let {
|
|
1590
|
+
nativeEvent: n
|
|
1591
|
+
} = e, {
|
|
1592
|
+
onActivation: r
|
|
1593
|
+
} = t;
|
|
1594
|
+
return n.button === _t.RightClick ? !1 : (r?.({
|
|
1595
|
+
event: n
|
|
1596
|
+
}), !0);
|
|
1597
|
+
}
|
|
1598
|
+
}];
|
|
1599
|
+
const Tt = {
|
|
1600
|
+
cancel: {
|
|
1601
|
+
name: "touchcancel"
|
|
1602
|
+
},
|
|
1603
|
+
move: {
|
|
1604
|
+
name: "touchmove"
|
|
1605
|
+
},
|
|
1606
|
+
end: {
|
|
1607
|
+
name: "touchend"
|
|
1608
|
+
}
|
|
1609
|
+
};
|
|
1610
|
+
class Do extends Gt {
|
|
1611
|
+
constructor(t) {
|
|
1612
|
+
super(t, Tt);
|
|
1613
|
+
}
|
|
1614
|
+
static setup() {
|
|
1615
|
+
return window.addEventListener(Tt.move.name, t, {
|
|
1616
|
+
capture: !1,
|
|
1617
|
+
passive: !1
|
|
1618
|
+
}), function() {
|
|
1619
|
+
window.removeEventListener(Tt.move.name, t);
|
|
1620
|
+
};
|
|
1621
|
+
function t() {
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
Do.activators = [{
|
|
1626
|
+
eventName: "onTouchStart",
|
|
1627
|
+
handler: (e, t) => {
|
|
1628
|
+
let {
|
|
1629
|
+
nativeEvent: n
|
|
1630
|
+
} = e, {
|
|
1631
|
+
onActivation: r
|
|
1632
|
+
} = t;
|
|
1633
|
+
const {
|
|
1634
|
+
touches: o
|
|
1635
|
+
} = n;
|
|
1636
|
+
return o.length > 1 ? !1 : (r?.({
|
|
1637
|
+
event: n
|
|
1638
|
+
}), !0);
|
|
1639
|
+
}
|
|
1640
|
+
}];
|
|
1641
|
+
var Ze;
|
|
1642
|
+
(function(e) {
|
|
1643
|
+
e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
|
|
1644
|
+
})(Ze || (Ze = {}));
|
|
1645
|
+
var yt;
|
|
1646
|
+
(function(e) {
|
|
1647
|
+
e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
1648
|
+
})(yt || (yt = {}));
|
|
1649
|
+
function No(e) {
|
|
1650
|
+
let {
|
|
1651
|
+
acceleration: t,
|
|
1652
|
+
activator: n = Ze.Pointer,
|
|
1653
|
+
canScroll: r,
|
|
1654
|
+
draggingRect: o,
|
|
1655
|
+
enabled: s,
|
|
1656
|
+
interval: i = 5,
|
|
1657
|
+
order: a = yt.TreeOrder,
|
|
1658
|
+
pointerCoordinates: c,
|
|
1659
|
+
scrollableAncestors: u,
|
|
1660
|
+
scrollableAncestorRects: h,
|
|
1661
|
+
delta: f,
|
|
1662
|
+
threshold: p
|
|
1663
|
+
} = e;
|
|
1664
|
+
const g = Ao({
|
|
1665
|
+
delta: f,
|
|
1666
|
+
disabled: !s
|
|
1667
|
+
}), [y, v] = Pr(), b = P({
|
|
1668
|
+
x: 0,
|
|
1669
|
+
y: 0
|
|
1670
|
+
}), w = P({
|
|
1671
|
+
x: 0,
|
|
1672
|
+
y: 0
|
|
1673
|
+
}), j = M(() => {
|
|
1674
|
+
switch (n) {
|
|
1675
|
+
case Ze.Pointer:
|
|
1676
|
+
return c ? {
|
|
1677
|
+
top: c.y,
|
|
1678
|
+
bottom: c.y,
|
|
1679
|
+
left: c.x,
|
|
1680
|
+
right: c.x
|
|
1681
|
+
} : null;
|
|
1682
|
+
case Ze.DraggableRect:
|
|
1683
|
+
return o;
|
|
1684
|
+
}
|
|
1685
|
+
}, [n, o, c]), C = P(null), R = Q(() => {
|
|
1686
|
+
const N = C.current;
|
|
1687
|
+
if (!N)
|
|
1688
|
+
return;
|
|
1689
|
+
const x = b.current.x * w.current.x, S = b.current.y * w.current.y;
|
|
1690
|
+
N.scrollBy(x, S);
|
|
1691
|
+
}, []), E = M(() => a === yt.TreeOrder ? [...u].reverse() : u, [a, u]);
|
|
1692
|
+
k(
|
|
1693
|
+
() => {
|
|
1694
|
+
if (!s || !u.length || !j) {
|
|
1695
|
+
v();
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
for (const N of E) {
|
|
1699
|
+
if (r?.(N) === !1)
|
|
1700
|
+
continue;
|
|
1701
|
+
const x = u.indexOf(N), S = h[x];
|
|
1702
|
+
if (!S)
|
|
1703
|
+
continue;
|
|
1704
|
+
const {
|
|
1705
|
+
direction: D,
|
|
1706
|
+
speed: _
|
|
1707
|
+
} = go(N, S, j, t, p);
|
|
1708
|
+
for (const A of ["x", "y"])
|
|
1709
|
+
g[A][D[A]] || (_[A] = 0, D[A] = 0);
|
|
1710
|
+
if (_.x > 0 || _.y > 0) {
|
|
1711
|
+
v(), C.current = N, y(R, i), b.current = _, w.current = D;
|
|
1712
|
+
return;
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
b.current = {
|
|
1716
|
+
x: 0,
|
|
1717
|
+
y: 0
|
|
1718
|
+
}, w.current = {
|
|
1719
|
+
x: 0,
|
|
1720
|
+
y: 0
|
|
1721
|
+
}, v();
|
|
1722
|
+
},
|
|
1723
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1724
|
+
[
|
|
1725
|
+
t,
|
|
1726
|
+
R,
|
|
1727
|
+
r,
|
|
1728
|
+
v,
|
|
1729
|
+
s,
|
|
1730
|
+
i,
|
|
1731
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1732
|
+
JSON.stringify(j),
|
|
1733
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1734
|
+
JSON.stringify(g),
|
|
1735
|
+
y,
|
|
1736
|
+
u,
|
|
1737
|
+
E,
|
|
1738
|
+
h,
|
|
1739
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1740
|
+
JSON.stringify(p)
|
|
1741
|
+
]
|
|
1742
|
+
);
|
|
1743
|
+
}
|
|
1744
|
+
const Eo = {
|
|
1745
|
+
x: {
|
|
1746
|
+
[V.Backward]: !1,
|
|
1747
|
+
[V.Forward]: !1
|
|
1748
|
+
},
|
|
1749
|
+
y: {
|
|
1750
|
+
[V.Backward]: !1,
|
|
1751
|
+
[V.Forward]: !1
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
function Ao(e) {
|
|
1755
|
+
let {
|
|
1756
|
+
delta: t,
|
|
1757
|
+
disabled: n
|
|
1758
|
+
} = e;
|
|
1759
|
+
const r = kt(t);
|
|
1760
|
+
return lt((o) => {
|
|
1761
|
+
if (n || !r || !o)
|
|
1762
|
+
return Eo;
|
|
1763
|
+
const s = {
|
|
1764
|
+
x: Math.sign(t.x - r.x),
|
|
1765
|
+
y: Math.sign(t.y - r.y)
|
|
1766
|
+
};
|
|
1767
|
+
return {
|
|
1768
|
+
x: {
|
|
1769
|
+
[V.Backward]: o.x[V.Backward] || s.x === -1,
|
|
1770
|
+
[V.Forward]: o.x[V.Forward] || s.x === 1
|
|
1771
|
+
},
|
|
1772
|
+
y: {
|
|
1773
|
+
[V.Backward]: o.y[V.Backward] || s.y === -1,
|
|
1774
|
+
[V.Forward]: o.y[V.Forward] || s.y === 1
|
|
1775
|
+
}
|
|
1776
|
+
};
|
|
1777
|
+
}, [n, t, r]);
|
|
1778
|
+
}
|
|
1779
|
+
function Io(e, t) {
|
|
1780
|
+
const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
|
|
1781
|
+
return lt((o) => {
|
|
1782
|
+
var s;
|
|
1783
|
+
return t == null ? null : (s = r ?? o) != null ? s : null;
|
|
1784
|
+
}, [r, t]);
|
|
1785
|
+
}
|
|
1786
|
+
function To(e, t) {
|
|
1787
|
+
return M(() => e.reduce((n, r) => {
|
|
1788
|
+
const {
|
|
1789
|
+
sensor: o
|
|
1790
|
+
} = r, s = o.activators.map((i) => ({
|
|
1791
|
+
eventName: i.eventName,
|
|
1792
|
+
handler: t(i.handler, r)
|
|
1793
|
+
}));
|
|
1794
|
+
return [...n, ...s];
|
|
1795
|
+
}, []), [e, t]);
|
|
1796
|
+
}
|
|
1797
|
+
var rt;
|
|
1798
|
+
(function(e) {
|
|
1799
|
+
e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
|
|
1800
|
+
})(rt || (rt = {}));
|
|
1801
|
+
var $t;
|
|
1802
|
+
(function(e) {
|
|
1803
|
+
e.Optimized = "optimized";
|
|
1804
|
+
})($t || ($t = {}));
|
|
1805
|
+
const xn = /* @__PURE__ */ new Map();
|
|
1806
|
+
function Oo(e, t) {
|
|
1807
|
+
let {
|
|
1808
|
+
dragging: n,
|
|
1809
|
+
dependencies: r,
|
|
1810
|
+
config: o
|
|
1811
|
+
} = t;
|
|
1812
|
+
const [s, i] = K(null), {
|
|
1813
|
+
frequency: a,
|
|
1814
|
+
measure: c,
|
|
1815
|
+
strategy: u
|
|
1816
|
+
} = o, h = P(e), f = b(), p = tt(f), g = Q(function(w) {
|
|
1817
|
+
w === void 0 && (w = []), !p.current && i((j) => j === null ? w : j.concat(w.filter((C) => !j.includes(C))));
|
|
1818
|
+
}, [p]), y = P(null), v = lt((w) => {
|
|
1819
|
+
if (f && !n)
|
|
1820
|
+
return xn;
|
|
1821
|
+
if (!w || w === xn || h.current !== e || s != null) {
|
|
1822
|
+
const j = /* @__PURE__ */ new Map();
|
|
1823
|
+
for (let C of e) {
|
|
1824
|
+
if (!C)
|
|
1825
|
+
continue;
|
|
1826
|
+
if (s && s.length > 0 && !s.includes(C.id) && C.rect.current) {
|
|
1827
|
+
j.set(C.id, C.rect.current);
|
|
1828
|
+
continue;
|
|
1829
|
+
}
|
|
1830
|
+
const R = C.node.current, E = R ? new Ut(c(R), R) : null;
|
|
1831
|
+
C.rect.current = E, E && j.set(C.id, E);
|
|
1832
|
+
}
|
|
1833
|
+
return j;
|
|
1834
|
+
}
|
|
1835
|
+
return w;
|
|
1836
|
+
}, [e, s, n, f, c]);
|
|
1837
|
+
return k(() => {
|
|
1838
|
+
h.current = e;
|
|
1839
|
+
}, [e]), k(
|
|
1840
|
+
() => {
|
|
1841
|
+
f || g();
|
|
1842
|
+
},
|
|
1843
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1844
|
+
[n, f]
|
|
1845
|
+
), k(
|
|
1846
|
+
() => {
|
|
1847
|
+
s && s.length > 0 && i(null);
|
|
1848
|
+
},
|
|
1849
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1850
|
+
[JSON.stringify(s)]
|
|
1851
|
+
), k(
|
|
1852
|
+
() => {
|
|
1853
|
+
f || typeof a != "number" || y.current !== null || (y.current = setTimeout(() => {
|
|
1854
|
+
g(), y.current = null;
|
|
1855
|
+
}, a));
|
|
1856
|
+
},
|
|
1857
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1858
|
+
[a, f, g, ...r]
|
|
1859
|
+
), {
|
|
1860
|
+
droppableRects: v,
|
|
1861
|
+
measureDroppableContainers: g,
|
|
1862
|
+
measuringScheduled: s != null
|
|
1863
|
+
};
|
|
1864
|
+
function b() {
|
|
1865
|
+
switch (u) {
|
|
1866
|
+
case rt.Always:
|
|
1867
|
+
return !1;
|
|
1868
|
+
case rt.BeforeDragging:
|
|
1869
|
+
return n;
|
|
1870
|
+
default:
|
|
1871
|
+
return !n;
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
function Yn(e, t) {
|
|
1876
|
+
return lt((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
|
|
1877
|
+
}
|
|
1878
|
+
function Mo(e, t) {
|
|
1879
|
+
return Yn(e, t);
|
|
1880
|
+
}
|
|
1881
|
+
function ko(e) {
|
|
1882
|
+
let {
|
|
1883
|
+
callback: t,
|
|
1884
|
+
disabled: n
|
|
1885
|
+
} = e;
|
|
1886
|
+
const r = Yt(t), o = M(() => {
|
|
1887
|
+
if (n || typeof window > "u" || typeof window.MutationObserver > "u")
|
|
1888
|
+
return;
|
|
1889
|
+
const {
|
|
1890
|
+
MutationObserver: s
|
|
1891
|
+
} = window;
|
|
1892
|
+
return new s(r);
|
|
1893
|
+
}, [r, n]);
|
|
1894
|
+
return k(() => () => o?.disconnect(), [o]), o;
|
|
1895
|
+
}
|
|
1896
|
+
function Ct(e) {
|
|
1897
|
+
let {
|
|
1898
|
+
callback: t,
|
|
1899
|
+
disabled: n
|
|
1900
|
+
} = e;
|
|
1901
|
+
const r = Yt(t), o = M(
|
|
1902
|
+
() => {
|
|
1903
|
+
if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
|
|
1904
|
+
return;
|
|
1905
|
+
const {
|
|
1906
|
+
ResizeObserver: s
|
|
1907
|
+
} = window;
|
|
1908
|
+
return new s(r);
|
|
1909
|
+
},
|
|
1910
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1911
|
+
[n]
|
|
1912
|
+
);
|
|
1913
|
+
return k(() => () => o?.disconnect(), [o]), o;
|
|
1914
|
+
}
|
|
1915
|
+
function Lo(e) {
|
|
1916
|
+
return new Ut(Ve(e), e);
|
|
1917
|
+
}
|
|
1918
|
+
function mn(e, t, n) {
|
|
1919
|
+
t === void 0 && (t = Lo);
|
|
1920
|
+
const [r, o] = K(null);
|
|
1921
|
+
function s() {
|
|
1922
|
+
o((c) => {
|
|
1923
|
+
if (!e)
|
|
1924
|
+
return null;
|
|
1925
|
+
if (e.isConnected === !1) {
|
|
1926
|
+
var u;
|
|
1927
|
+
return (u = c ?? n) != null ? u : null;
|
|
1928
|
+
}
|
|
1929
|
+
const h = t(e);
|
|
1930
|
+
return JSON.stringify(c) === JSON.stringify(h) ? c : h;
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
const i = ko({
|
|
1934
|
+
callback(c) {
|
|
1935
|
+
if (e)
|
|
1936
|
+
for (const u of c) {
|
|
1937
|
+
const {
|
|
1938
|
+
type: h,
|
|
1939
|
+
target: f
|
|
1940
|
+
} = u;
|
|
1941
|
+
if (h === "childList" && f instanceof HTMLElement && f.contains(e)) {
|
|
1942
|
+
s();
|
|
1943
|
+
break;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
}), a = Ct({
|
|
1948
|
+
callback: s
|
|
1949
|
+
});
|
|
1950
|
+
return pe(() => {
|
|
1951
|
+
s(), e ? (a?.observe(e), i?.observe(document.body, {
|
|
1952
|
+
childList: !0,
|
|
1953
|
+
subtree: !0
|
|
1954
|
+
})) : (a?.disconnect(), i?.disconnect());
|
|
1955
|
+
}, [e]), r;
|
|
1956
|
+
}
|
|
1957
|
+
function Po(e) {
|
|
1958
|
+
const t = Yn(e);
|
|
1959
|
+
return kn(e, t);
|
|
1960
|
+
}
|
|
1961
|
+
const yn = [];
|
|
1962
|
+
function _o(e) {
|
|
1963
|
+
const t = P(e), n = lt((r) => e ? r && r !== yn && e && t.current && e.parentNode === t.current.parentNode ? r : Wt(e) : yn, [e]);
|
|
1964
|
+
return k(() => {
|
|
1965
|
+
t.current = e;
|
|
1966
|
+
}, [e]), n;
|
|
1967
|
+
}
|
|
1968
|
+
function $o(e) {
|
|
1969
|
+
const [t, n] = K(null), r = P(e), o = Q((s) => {
|
|
1970
|
+
const i = At(s.target);
|
|
1971
|
+
i && n((a) => a ? (a.set(i, Pt(i)), new Map(a)) : null);
|
|
1972
|
+
}, []);
|
|
1973
|
+
return k(() => {
|
|
1974
|
+
const s = r.current;
|
|
1975
|
+
if (e !== s) {
|
|
1976
|
+
i(s);
|
|
1977
|
+
const a = e.map((c) => {
|
|
1978
|
+
const u = At(c);
|
|
1979
|
+
return u ? (u.addEventListener("scroll", o, {
|
|
1980
|
+
passive: !0
|
|
1981
|
+
}), [u, Pt(u)]) : null;
|
|
1982
|
+
}).filter((c) => c != null);
|
|
1983
|
+
n(a.length ? new Map(a) : null), r.current = e;
|
|
1984
|
+
}
|
|
1985
|
+
return () => {
|
|
1986
|
+
i(e), i(s);
|
|
1987
|
+
};
|
|
1988
|
+
function i(a) {
|
|
1989
|
+
a.forEach((c) => {
|
|
1990
|
+
const u = At(c);
|
|
1991
|
+
u?.removeEventListener("scroll", o);
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
}, [o, e]), M(() => e.length ? t ? Array.from(t.values()).reduce((s, i) => $e(s, i), ce) : Fn(e) : ce, [e, t]);
|
|
1995
|
+
}
|
|
1996
|
+
function wn(e, t) {
|
|
1997
|
+
t === void 0 && (t = []);
|
|
1998
|
+
const n = P(null);
|
|
1999
|
+
return k(
|
|
2000
|
+
() => {
|
|
2001
|
+
n.current = null;
|
|
2002
|
+
},
|
|
2003
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2004
|
+
t
|
|
2005
|
+
), k(() => {
|
|
2006
|
+
const r = e !== ce;
|
|
2007
|
+
r && !n.current && (n.current = e), !r && n.current && (n.current = null);
|
|
2008
|
+
}, [e]), n.current ? xt(e, n.current) : ce;
|
|
2009
|
+
}
|
|
2010
|
+
function zo(e) {
|
|
2011
|
+
k(
|
|
2012
|
+
() => {
|
|
2013
|
+
if (!St)
|
|
2014
|
+
return;
|
|
2015
|
+
const t = e.map((n) => {
|
|
2016
|
+
let {
|
|
2017
|
+
sensor: r
|
|
2018
|
+
} = n;
|
|
2019
|
+
return r.setup == null ? void 0 : r.setup();
|
|
2020
|
+
});
|
|
2021
|
+
return () => {
|
|
2022
|
+
for (const n of t)
|
|
2023
|
+
n?.();
|
|
2024
|
+
};
|
|
2025
|
+
},
|
|
2026
|
+
// TO-DO: Sensors length could theoretically change which would not be a valid dependency
|
|
2027
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2028
|
+
e.map((t) => {
|
|
2029
|
+
let {
|
|
2030
|
+
sensor: n
|
|
2031
|
+
} = t;
|
|
2032
|
+
return n;
|
|
2033
|
+
})
|
|
2034
|
+
);
|
|
2035
|
+
}
|
|
2036
|
+
function Fo(e, t) {
|
|
2037
|
+
return M(() => e.reduce((n, r) => {
|
|
2038
|
+
let {
|
|
2039
|
+
eventName: o,
|
|
2040
|
+
handler: s
|
|
2041
|
+
} = r;
|
|
2042
|
+
return n[o] = (i) => {
|
|
2043
|
+
s(i, t);
|
|
2044
|
+
}, n;
|
|
2045
|
+
}, {}), [e, t]);
|
|
2046
|
+
}
|
|
2047
|
+
function Vn(e) {
|
|
2048
|
+
return M(() => e ? co(e) : null, [e]);
|
|
2049
|
+
}
|
|
2050
|
+
const Sn = [];
|
|
2051
|
+
function Bo(e, t) {
|
|
2052
|
+
t === void 0 && (t = Ve);
|
|
2053
|
+
const [n] = e, r = Vn(n ? ee(n) : null), [o, s] = K(Sn);
|
|
2054
|
+
function i() {
|
|
2055
|
+
s(() => e.length ? e.map((c) => $n(c) ? r : new Ut(t(c), c)) : Sn);
|
|
2056
|
+
}
|
|
2057
|
+
const a = Ct({
|
|
2058
|
+
callback: i
|
|
2059
|
+
});
|
|
2060
|
+
return pe(() => {
|
|
2061
|
+
a?.disconnect(), i(), e.forEach((c) => a?.observe(c));
|
|
2062
|
+
}, [e]), o;
|
|
2063
|
+
}
|
|
2064
|
+
function Yo(e) {
|
|
2065
|
+
if (!e)
|
|
2066
|
+
return null;
|
|
2067
|
+
if (e.children.length > 1)
|
|
2068
|
+
return e;
|
|
2069
|
+
const t = e.children[0];
|
|
2070
|
+
return at(t) ? t : e;
|
|
2071
|
+
}
|
|
2072
|
+
function Vo(e) {
|
|
2073
|
+
let {
|
|
2074
|
+
measure: t
|
|
2075
|
+
} = e;
|
|
2076
|
+
const [n, r] = K(null), o = Q((u) => {
|
|
2077
|
+
for (const {
|
|
2078
|
+
target: h
|
|
2079
|
+
} of u)
|
|
2080
|
+
if (at(h)) {
|
|
2081
|
+
r((f) => {
|
|
2082
|
+
const p = t(h);
|
|
2083
|
+
return f ? {
|
|
2084
|
+
...f,
|
|
2085
|
+
width: p.width,
|
|
2086
|
+
height: p.height
|
|
2087
|
+
} : p;
|
|
2088
|
+
});
|
|
2089
|
+
break;
|
|
2090
|
+
}
|
|
2091
|
+
}, [t]), s = Ct({
|
|
2092
|
+
callback: o
|
|
2093
|
+
}), i = Q((u) => {
|
|
2094
|
+
const h = Yo(u);
|
|
2095
|
+
s?.disconnect(), h && s?.observe(h), r(h ? t(h) : null);
|
|
2096
|
+
}, [t, s]), [a, c] = bt(i);
|
|
2097
|
+
return M(() => ({
|
|
2098
|
+
nodeRef: a,
|
|
2099
|
+
rect: n,
|
|
2100
|
+
setRef: c
|
|
2101
|
+
}), [n, a, c]);
|
|
2102
|
+
}
|
|
2103
|
+
const Wo = [{
|
|
2104
|
+
sensor: Ht,
|
|
2105
|
+
options: {}
|
|
2106
|
+
}, {
|
|
2107
|
+
sensor: Xt,
|
|
2108
|
+
options: {}
|
|
2109
|
+
}], Uo = {
|
|
2110
|
+
current: {}
|
|
2111
|
+
}, vt = {
|
|
2112
|
+
draggable: {
|
|
2113
|
+
measure: gn
|
|
2114
|
+
},
|
|
2115
|
+
droppable: {
|
|
2116
|
+
measure: gn,
|
|
2117
|
+
strategy: rt.WhileDragging,
|
|
2118
|
+
frequency: $t.Optimized
|
|
2119
|
+
},
|
|
2120
|
+
dragOverlay: {
|
|
2121
|
+
measure: Ve
|
|
2122
|
+
}
|
|
2123
|
+
};
|
|
2124
|
+
class et extends Map {
|
|
2125
|
+
get(t) {
|
|
2126
|
+
var n;
|
|
2127
|
+
return t != null && (n = super.get(t)) != null ? n : void 0;
|
|
2128
|
+
}
|
|
2129
|
+
toArray() {
|
|
2130
|
+
return Array.from(this.values());
|
|
2131
|
+
}
|
|
2132
|
+
getEnabled() {
|
|
2133
|
+
return this.toArray().filter((t) => {
|
|
2134
|
+
let {
|
|
2135
|
+
disabled: n
|
|
2136
|
+
} = t;
|
|
2137
|
+
return !n;
|
|
2138
|
+
});
|
|
2139
|
+
}
|
|
2140
|
+
getNodeFor(t) {
|
|
2141
|
+
var n, r;
|
|
2142
|
+
return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
const Xo = {
|
|
2146
|
+
activatorEvent: null,
|
|
2147
|
+
active: null,
|
|
2148
|
+
activeNode: null,
|
|
2149
|
+
activeNodeRect: null,
|
|
2150
|
+
collisions: null,
|
|
2151
|
+
containerNodeRect: null,
|
|
2152
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
2153
|
+
droppableRects: /* @__PURE__ */ new Map(),
|
|
2154
|
+
droppableContainers: /* @__PURE__ */ new et(),
|
|
2155
|
+
over: null,
|
|
2156
|
+
dragOverlay: {
|
|
2157
|
+
nodeRef: {
|
|
2158
|
+
current: null
|
|
2159
|
+
},
|
|
2160
|
+
rect: null,
|
|
2161
|
+
setRef: mt
|
|
2162
|
+
},
|
|
2163
|
+
scrollableAncestors: [],
|
|
2164
|
+
scrollableAncestorRects: [],
|
|
2165
|
+
measuringConfiguration: vt,
|
|
2166
|
+
measureDroppableContainers: mt,
|
|
2167
|
+
windowRect: null,
|
|
2168
|
+
measuringScheduled: !1
|
|
2169
|
+
}, Go = {
|
|
2170
|
+
activatorEvent: null,
|
|
2171
|
+
activators: [],
|
|
2172
|
+
active: null,
|
|
2173
|
+
activeNodeRect: null,
|
|
2174
|
+
ariaDescribedById: {
|
|
2175
|
+
draggable: ""
|
|
2176
|
+
},
|
|
2177
|
+
dispatch: mt,
|
|
2178
|
+
draggableNodes: /* @__PURE__ */ new Map(),
|
|
2179
|
+
over: null,
|
|
2180
|
+
measureDroppableContainers: mt
|
|
2181
|
+
}, Rt = /* @__PURE__ */ st(Go), Wn = /* @__PURE__ */ st(Xo);
|
|
2182
|
+
function Ho() {
|
|
2183
|
+
return {
|
|
2184
|
+
draggable: {
|
|
2185
|
+
active: null,
|
|
2186
|
+
initialCoordinates: {
|
|
2187
|
+
x: 0,
|
|
2188
|
+
y: 0
|
|
2189
|
+
},
|
|
2190
|
+
nodes: /* @__PURE__ */ new Map(),
|
|
2191
|
+
translate: {
|
|
2192
|
+
x: 0,
|
|
2193
|
+
y: 0
|
|
2194
|
+
}
|
|
2195
|
+
},
|
|
2196
|
+
droppable: {
|
|
2197
|
+
containers: new et()
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
}
|
|
2201
|
+
function qo(e, t) {
|
|
2202
|
+
switch (t.type) {
|
|
2203
|
+
case Y.DragStart:
|
|
2204
|
+
return {
|
|
2205
|
+
...e,
|
|
2206
|
+
draggable: {
|
|
2207
|
+
...e.draggable,
|
|
2208
|
+
initialCoordinates: t.initialCoordinates,
|
|
2209
|
+
active: t.active
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2212
|
+
case Y.DragMove:
|
|
2213
|
+
return e.draggable.active == null ? e : {
|
|
2214
|
+
...e,
|
|
2215
|
+
draggable: {
|
|
2216
|
+
...e.draggable,
|
|
2217
|
+
translate: {
|
|
2218
|
+
x: t.coordinates.x - e.draggable.initialCoordinates.x,
|
|
2219
|
+
y: t.coordinates.y - e.draggable.initialCoordinates.y
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
case Y.DragEnd:
|
|
2224
|
+
case Y.DragCancel:
|
|
2225
|
+
return {
|
|
2226
|
+
...e,
|
|
2227
|
+
draggable: {
|
|
2228
|
+
...e.draggable,
|
|
2229
|
+
active: null,
|
|
2230
|
+
initialCoordinates: {
|
|
2231
|
+
x: 0,
|
|
2232
|
+
y: 0
|
|
2233
|
+
},
|
|
2234
|
+
translate: {
|
|
2235
|
+
x: 0,
|
|
2236
|
+
y: 0
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
};
|
|
2240
|
+
case Y.RegisterDroppable: {
|
|
2241
|
+
const {
|
|
2242
|
+
element: n
|
|
2243
|
+
} = t, {
|
|
2244
|
+
id: r
|
|
2245
|
+
} = n, o = new et(e.droppable.containers);
|
|
2246
|
+
return o.set(r, n), {
|
|
2247
|
+
...e,
|
|
2248
|
+
droppable: {
|
|
2249
|
+
...e.droppable,
|
|
2250
|
+
containers: o
|
|
2251
|
+
}
|
|
2252
|
+
};
|
|
2253
|
+
}
|
|
2254
|
+
case Y.SetDroppableDisabled: {
|
|
2255
|
+
const {
|
|
2256
|
+
id: n,
|
|
2257
|
+
key: r,
|
|
2258
|
+
disabled: o
|
|
2259
|
+
} = t, s = e.droppable.containers.get(n);
|
|
2260
|
+
if (!s || r !== s.key)
|
|
2261
|
+
return e;
|
|
2262
|
+
const i = new et(e.droppable.containers);
|
|
2263
|
+
return i.set(n, {
|
|
2264
|
+
...s,
|
|
2265
|
+
disabled: o
|
|
2266
|
+
}), {
|
|
2267
|
+
...e,
|
|
2268
|
+
droppable: {
|
|
2269
|
+
...e.droppable,
|
|
2270
|
+
containers: i
|
|
2271
|
+
}
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
case Y.UnregisterDroppable: {
|
|
2275
|
+
const {
|
|
2276
|
+
id: n,
|
|
2277
|
+
key: r
|
|
2278
|
+
} = t, o = e.droppable.containers.get(n);
|
|
2279
|
+
if (!o || r !== o.key)
|
|
2280
|
+
return e;
|
|
2281
|
+
const s = new et(e.droppable.containers);
|
|
2282
|
+
return s.delete(n), {
|
|
2283
|
+
...e,
|
|
2284
|
+
droppable: {
|
|
2285
|
+
...e.droppable,
|
|
2286
|
+
containers: s
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
}
|
|
2290
|
+
default:
|
|
2291
|
+
return e;
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
function Jo(e) {
|
|
2295
|
+
let {
|
|
2296
|
+
disabled: t
|
|
2297
|
+
} = e;
|
|
2298
|
+
const {
|
|
2299
|
+
active: n,
|
|
2300
|
+
activatorEvent: r,
|
|
2301
|
+
draggableNodes: o
|
|
2302
|
+
} = Ee(Rt), s = kt(r), i = kt(n?.id);
|
|
2303
|
+
return k(() => {
|
|
2304
|
+
if (!t && !r && s && i != null) {
|
|
2305
|
+
if (!Vt(s) || document.activeElement === s.target)
|
|
2306
|
+
return;
|
|
2307
|
+
const a = o.get(i);
|
|
2308
|
+
if (!a)
|
|
2309
|
+
return;
|
|
2310
|
+
const {
|
|
2311
|
+
activatorNode: c,
|
|
2312
|
+
node: u
|
|
2313
|
+
} = a;
|
|
2314
|
+
if (!c.current && !u.current)
|
|
2315
|
+
return;
|
|
2316
|
+
requestAnimationFrame(() => {
|
|
2317
|
+
for (const h of [c.current, u.current]) {
|
|
2318
|
+
if (!h)
|
|
2319
|
+
continue;
|
|
2320
|
+
const f = zr(h);
|
|
2321
|
+
if (f) {
|
|
2322
|
+
f.focus();
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
}
|
|
2326
|
+
});
|
|
2327
|
+
}
|
|
2328
|
+
}, [r, t, o, i, s]), null;
|
|
2329
|
+
}
|
|
2330
|
+
function Ko(e, t) {
|
|
2331
|
+
let {
|
|
2332
|
+
transform: n,
|
|
2333
|
+
...r
|
|
2334
|
+
} = t;
|
|
2335
|
+
return e != null && e.length ? e.reduce((o, s) => s({
|
|
2336
|
+
transform: o,
|
|
2337
|
+
...r
|
|
2338
|
+
}), n) : n;
|
|
2339
|
+
}
|
|
2340
|
+
function Qo(e) {
|
|
2341
|
+
return M(
|
|
2342
|
+
() => ({
|
|
2343
|
+
draggable: {
|
|
2344
|
+
...vt.draggable,
|
|
2345
|
+
...e?.draggable
|
|
2346
|
+
},
|
|
2347
|
+
droppable: {
|
|
2348
|
+
...vt.droppable,
|
|
2349
|
+
...e?.droppable
|
|
2350
|
+
},
|
|
2351
|
+
dragOverlay: {
|
|
2352
|
+
...vt.dragOverlay,
|
|
2353
|
+
...e?.dragOverlay
|
|
2354
|
+
}
|
|
2355
|
+
}),
|
|
2356
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2357
|
+
[e?.draggable, e?.droppable, e?.dragOverlay]
|
|
2358
|
+
);
|
|
2359
|
+
}
|
|
2360
|
+
function Zo(e) {
|
|
2361
|
+
let {
|
|
2362
|
+
activeNode: t,
|
|
2363
|
+
measure: n,
|
|
2364
|
+
initialRect: r,
|
|
2365
|
+
config: o = !0
|
|
2366
|
+
} = e;
|
|
2367
|
+
const s = P(!1), {
|
|
2368
|
+
x: i,
|
|
2369
|
+
y: a
|
|
2370
|
+
} = typeof o == "boolean" ? {
|
|
2371
|
+
x: o,
|
|
2372
|
+
y: o
|
|
2373
|
+
} : o;
|
|
2374
|
+
pe(() => {
|
|
2375
|
+
if (!i && !a || !t) {
|
|
2376
|
+
s.current = !1;
|
|
2377
|
+
return;
|
|
2378
|
+
}
|
|
2379
|
+
if (s.current || !r)
|
|
2380
|
+
return;
|
|
2381
|
+
const u = t?.node.current;
|
|
2382
|
+
if (!u || u.isConnected === !1)
|
|
2383
|
+
return;
|
|
2384
|
+
const h = n(u), f = kn(h, r);
|
|
2385
|
+
if (i || (f.x = 0), a || (f.y = 0), s.current = !0, Math.abs(f.x) > 0 || Math.abs(f.y) > 0) {
|
|
2386
|
+
const p = Ln(u);
|
|
2387
|
+
p && p.scrollBy({
|
|
2388
|
+
top: f.y,
|
|
2389
|
+
left: f.x
|
|
2390
|
+
});
|
|
2391
|
+
}
|
|
2392
|
+
}, [t, i, a, r, n]);
|
|
2393
|
+
}
|
|
2394
|
+
const Un = /* @__PURE__ */ st({
|
|
2395
|
+
...ce,
|
|
2396
|
+
scaleX: 1,
|
|
2397
|
+
scaleY: 1
|
|
2398
|
+
});
|
|
2399
|
+
var Re;
|
|
2400
|
+
(function(e) {
|
|
2401
|
+
e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
|
|
2402
|
+
})(Re || (Re = {}));
|
|
2403
|
+
const es = /* @__PURE__ */ lr(function(t) {
|
|
2404
|
+
var n, r, o, s;
|
|
2405
|
+
let {
|
|
2406
|
+
id: i,
|
|
2407
|
+
accessibility: a,
|
|
2408
|
+
autoScroll: c = !0,
|
|
2409
|
+
children: u,
|
|
2410
|
+
sensors: h = Wo,
|
|
2411
|
+
collisionDetection: f = no,
|
|
2412
|
+
measuring: p,
|
|
2413
|
+
modifiers: g,
|
|
2414
|
+
...y
|
|
2415
|
+
} = t;
|
|
2416
|
+
const v = cr(qo, void 0, Ho), [b, w] = v, [j, C] = Ur(), [R, E] = K(Re.Uninitialized), N = R === Re.Initialized, {
|
|
2417
|
+
draggable: {
|
|
2418
|
+
active: x,
|
|
2419
|
+
nodes: S,
|
|
2420
|
+
translate: D
|
|
2421
|
+
},
|
|
2422
|
+
droppable: {
|
|
2423
|
+
containers: _
|
|
2424
|
+
}
|
|
2425
|
+
} = b, A = x != null ? S.get(x) : null, B = P({
|
|
2426
|
+
initial: null,
|
|
2427
|
+
translated: null
|
|
2428
|
+
}), z = M(() => {
|
|
2429
|
+
var J;
|
|
2430
|
+
return x != null ? {
|
|
2431
|
+
id: x,
|
|
2432
|
+
// It's possible for the active node to unmount while dragging
|
|
2433
|
+
data: (J = A?.data) != null ? J : Uo,
|
|
2434
|
+
rect: B
|
|
2435
|
+
} : null;
|
|
2436
|
+
}, [x, A]), G = P(null), [F, le] = K(null), [H, De] = K(null), se = tt(y, Object.values(y)), xe = ct("DndDescribedBy", i), d = M(() => _.getEnabled(), [_]), m = Qo(p), {
|
|
2437
|
+
droppableRects: I,
|
|
2438
|
+
measureDroppableContainers: L,
|
|
2439
|
+
measuringScheduled: ue
|
|
2440
|
+
} = Oo(d, {
|
|
2441
|
+
dragging: N,
|
|
2442
|
+
dependencies: [D.x, D.y],
|
|
2443
|
+
config: m.droppable
|
|
2444
|
+
}), q = Io(S, x), $ = M(() => H ? Lt(H) : null, [H]), Z = ir(), te = Mo(q, m.draggable.measure);
|
|
2445
|
+
Zo({
|
|
2446
|
+
activeNode: x != null ? S.get(x) : null,
|
|
2447
|
+
config: Z.layoutShiftCompensation,
|
|
2448
|
+
initialRect: te,
|
|
2449
|
+
measure: m.draggable.measure
|
|
2450
|
+
});
|
|
2451
|
+
const O = mn(q, m.draggable.measure, te), We = mn(q ? q.parentElement : null), de = P({
|
|
2452
|
+
activatorEvent: null,
|
|
2453
|
+
active: null,
|
|
2454
|
+
activeNode: q,
|
|
2455
|
+
collisionRect: null,
|
|
2456
|
+
collisions: null,
|
|
2457
|
+
droppableRects: I,
|
|
2458
|
+
draggableNodes: S,
|
|
2459
|
+
draggingNode: null,
|
|
2460
|
+
draggingNodeRect: null,
|
|
2461
|
+
droppableContainers: _,
|
|
2462
|
+
over: null,
|
|
2463
|
+
scrollableAncestors: [],
|
|
2464
|
+
scrollAdjustedTranslate: null
|
|
2465
|
+
}), Ae = _.getNodeFor((n = de.current.over) == null ? void 0 : n.id), ve = Vo({
|
|
2466
|
+
measure: m.dragOverlay.measure
|
|
2467
|
+
}), Ie = (r = ve.nodeRef.current) != null ? r : q, Te = N ? (o = ve.rect) != null ? o : O : null, Jt = !!(ve.nodeRef.current && ve.rect), Kt = Po(Jt ? null : O), jt = Vn(Ie ? ee(Ie) : null), me = _o(N ? Ae ?? q : null), ut = Bo(me), dt = Ko(g, {
|
|
2468
|
+
transform: {
|
|
2469
|
+
x: D.x - Kt.x,
|
|
2470
|
+
y: D.y - Kt.y,
|
|
2471
|
+
scaleX: 1,
|
|
2472
|
+
scaleY: 1
|
|
2473
|
+
},
|
|
2474
|
+
activatorEvent: H,
|
|
2475
|
+
active: z,
|
|
2476
|
+
activeNodeRect: O,
|
|
2477
|
+
containerNodeRect: We,
|
|
2478
|
+
draggingNodeRect: Te,
|
|
2479
|
+
over: de.current.over,
|
|
2480
|
+
overlayNodeRect: ve.rect,
|
|
2481
|
+
scrollableAncestors: me,
|
|
2482
|
+
scrollableAncestorRects: ut,
|
|
2483
|
+
windowRect: jt
|
|
2484
|
+
}), Qt = $ ? $e($, D) : null, Zt = $o(me), Zn = wn(Zt), er = wn(Zt, [O]), Oe = $e(dt, Zn), Me = Te ? so(Te, dt) : null, Ue = z && Me ? f({
|
|
2485
|
+
active: z,
|
|
2486
|
+
collisionRect: Me,
|
|
2487
|
+
droppableRects: I,
|
|
2488
|
+
droppableContainers: d,
|
|
2489
|
+
pointerCoordinates: Qt
|
|
2490
|
+
}) : null, en = Zr(Ue, "id"), [ye, tn] = K(null), tr = Jt ? dt : $e(dt, er), nr = ro(tr, (s = ye?.rect) != null ? s : null, O), Dt = P(null), nn = Q(
|
|
2491
|
+
(J, ne) => {
|
|
2492
|
+
let {
|
|
2493
|
+
sensor: re,
|
|
2494
|
+
options: we
|
|
2495
|
+
} = ne;
|
|
2496
|
+
if (G.current == null)
|
|
2497
|
+
return;
|
|
2498
|
+
const ie = S.get(G.current);
|
|
2499
|
+
if (!ie)
|
|
2500
|
+
return;
|
|
2501
|
+
const oe = J.nativeEvent, fe = new re({
|
|
2502
|
+
active: G.current,
|
|
2503
|
+
activeNode: ie,
|
|
2504
|
+
event: oe,
|
|
2505
|
+
options: we,
|
|
2506
|
+
// Sensors need to be instantiated with refs for arguments that change over time
|
|
2507
|
+
// otherwise they are frozen in time with the stale arguments
|
|
2508
|
+
context: de,
|
|
2509
|
+
onAbort(U) {
|
|
2510
|
+
if (!S.get(U))
|
|
2511
|
+
return;
|
|
2512
|
+
const {
|
|
2513
|
+
onDragAbort: he
|
|
2514
|
+
} = se.current, be = {
|
|
2515
|
+
id: U
|
|
2516
|
+
};
|
|
2517
|
+
he?.(be), j({
|
|
2518
|
+
type: "onDragAbort",
|
|
2519
|
+
event: be
|
|
2520
|
+
});
|
|
2521
|
+
},
|
|
2522
|
+
onPending(U, Se, he, be) {
|
|
2523
|
+
if (!S.get(U))
|
|
2524
|
+
return;
|
|
2525
|
+
const {
|
|
2526
|
+
onDragPending: Ge
|
|
2527
|
+
} = se.current, Ce = {
|
|
2528
|
+
id: U,
|
|
2529
|
+
constraint: Se,
|
|
2530
|
+
initialCoordinates: he,
|
|
2531
|
+
offset: be
|
|
2532
|
+
};
|
|
2533
|
+
Ge?.(Ce), j({
|
|
2534
|
+
type: "onDragPending",
|
|
2535
|
+
event: Ce
|
|
2536
|
+
});
|
|
2537
|
+
},
|
|
2538
|
+
onStart(U) {
|
|
2539
|
+
const Se = G.current;
|
|
2540
|
+
if (Se == null)
|
|
2541
|
+
return;
|
|
2542
|
+
const he = S.get(Se);
|
|
2543
|
+
if (!he)
|
|
2544
|
+
return;
|
|
2545
|
+
const {
|
|
2546
|
+
onDragStart: be
|
|
2547
|
+
} = se.current, Xe = {
|
|
2548
|
+
activatorEvent: oe,
|
|
2549
|
+
active: {
|
|
2550
|
+
id: Se,
|
|
2551
|
+
data: he.data,
|
|
2552
|
+
rect: B
|
|
2553
|
+
}
|
|
2554
|
+
};
|
|
2555
|
+
ft(() => {
|
|
2556
|
+
be?.(Xe), E(Re.Initializing), w({
|
|
2557
|
+
type: Y.DragStart,
|
|
2558
|
+
initialCoordinates: U,
|
|
2559
|
+
active: Se
|
|
2560
|
+
}), j({
|
|
2561
|
+
type: "onDragStart",
|
|
2562
|
+
event: Xe
|
|
2563
|
+
}), le(Dt.current), De(oe);
|
|
2564
|
+
});
|
|
2565
|
+
},
|
|
2566
|
+
onMove(U) {
|
|
2567
|
+
w({
|
|
2568
|
+
type: Y.DragMove,
|
|
2569
|
+
coordinates: U
|
|
2570
|
+
});
|
|
2571
|
+
},
|
|
2572
|
+
onEnd: ke(Y.DragEnd),
|
|
2573
|
+
onCancel: ke(Y.DragCancel)
|
|
2574
|
+
});
|
|
2575
|
+
Dt.current = fe;
|
|
2576
|
+
function ke(U) {
|
|
2577
|
+
return async function() {
|
|
2578
|
+
const {
|
|
2579
|
+
active: he,
|
|
2580
|
+
collisions: be,
|
|
2581
|
+
over: Xe,
|
|
2582
|
+
scrollAdjustedTranslate: Ge
|
|
2583
|
+
} = de.current;
|
|
2584
|
+
let Ce = null;
|
|
2585
|
+
if (he && Ge) {
|
|
2586
|
+
const {
|
|
2587
|
+
cancelDrop: He
|
|
2588
|
+
} = se.current;
|
|
2589
|
+
Ce = {
|
|
2590
|
+
activatorEvent: oe,
|
|
2591
|
+
active: he,
|
|
2592
|
+
collisions: be,
|
|
2593
|
+
delta: Ge,
|
|
2594
|
+
over: Xe
|
|
2595
|
+
}, U === Y.DragEnd && typeof He == "function" && await Promise.resolve(He(Ce)) && (U = Y.DragCancel);
|
|
2596
|
+
}
|
|
2597
|
+
G.current = null, ft(() => {
|
|
2598
|
+
w({
|
|
2599
|
+
type: U
|
|
2600
|
+
}), E(Re.Uninitialized), tn(null), le(null), De(null), Dt.current = null;
|
|
2601
|
+
const He = U === Y.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
2602
|
+
if (Ce) {
|
|
2603
|
+
const Nt = se.current[He];
|
|
2604
|
+
Nt?.(Ce), j({
|
|
2605
|
+
type: He,
|
|
2606
|
+
event: Ce
|
|
2607
|
+
});
|
|
2608
|
+
}
|
|
2609
|
+
});
|
|
2610
|
+
};
|
|
2611
|
+
}
|
|
2612
|
+
},
|
|
2613
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2614
|
+
[S]
|
|
2615
|
+
), rr = Q((J, ne) => (re, we) => {
|
|
2616
|
+
const ie = re.nativeEvent, oe = S.get(we);
|
|
2617
|
+
if (
|
|
2618
|
+
// Another sensor is already instantiating
|
|
2619
|
+
G.current !== null || // No active draggable
|
|
2620
|
+
!oe || // Event has already been captured
|
|
2621
|
+
ie.dndKit || ie.defaultPrevented
|
|
2622
|
+
)
|
|
2623
|
+
return;
|
|
2624
|
+
const fe = {
|
|
2625
|
+
active: oe
|
|
2626
|
+
};
|
|
2627
|
+
J(re, ne.options, fe) === !0 && (ie.dndKit = {
|
|
2628
|
+
capturedBy: ne.sensor
|
|
2629
|
+
}, G.current = we, nn(re, ne));
|
|
2630
|
+
}, [S, nn]), rn = To(h, rr);
|
|
2631
|
+
zo(h), pe(() => {
|
|
2632
|
+
O && R === Re.Initializing && E(Re.Initialized);
|
|
2633
|
+
}, [O, R]), k(
|
|
2634
|
+
() => {
|
|
2635
|
+
const {
|
|
2636
|
+
onDragMove: J
|
|
2637
|
+
} = se.current, {
|
|
2638
|
+
active: ne,
|
|
2639
|
+
activatorEvent: re,
|
|
2640
|
+
collisions: we,
|
|
2641
|
+
over: ie
|
|
2642
|
+
} = de.current;
|
|
2643
|
+
if (!ne || !re)
|
|
2644
|
+
return;
|
|
2645
|
+
const oe = {
|
|
2646
|
+
active: ne,
|
|
2647
|
+
activatorEvent: re,
|
|
2648
|
+
collisions: we,
|
|
2649
|
+
delta: {
|
|
2650
|
+
x: Oe.x,
|
|
2651
|
+
y: Oe.y
|
|
2652
|
+
},
|
|
2653
|
+
over: ie
|
|
2654
|
+
};
|
|
2655
|
+
ft(() => {
|
|
2656
|
+
J?.(oe), j({
|
|
2657
|
+
type: "onDragMove",
|
|
2658
|
+
event: oe
|
|
2659
|
+
});
|
|
2660
|
+
});
|
|
2661
|
+
},
|
|
2662
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2663
|
+
[Oe.x, Oe.y]
|
|
2664
|
+
), k(
|
|
2665
|
+
() => {
|
|
2666
|
+
const {
|
|
2667
|
+
active: J,
|
|
2668
|
+
activatorEvent: ne,
|
|
2669
|
+
collisions: re,
|
|
2670
|
+
droppableContainers: we,
|
|
2671
|
+
scrollAdjustedTranslate: ie
|
|
2672
|
+
} = de.current;
|
|
2673
|
+
if (!J || G.current == null || !ne || !ie)
|
|
2674
|
+
return;
|
|
2675
|
+
const {
|
|
2676
|
+
onDragOver: oe
|
|
2677
|
+
} = se.current, fe = we.get(en), ke = fe && fe.rect.current ? {
|
|
2678
|
+
id: fe.id,
|
|
2679
|
+
rect: fe.rect.current,
|
|
2680
|
+
data: fe.data,
|
|
2681
|
+
disabled: fe.disabled
|
|
2682
|
+
} : null, U = {
|
|
2683
|
+
active: J,
|
|
2684
|
+
activatorEvent: ne,
|
|
2685
|
+
collisions: re,
|
|
2686
|
+
delta: {
|
|
2687
|
+
x: ie.x,
|
|
2688
|
+
y: ie.y
|
|
2689
|
+
},
|
|
2690
|
+
over: ke
|
|
2691
|
+
};
|
|
2692
|
+
ft(() => {
|
|
2693
|
+
tn(ke), oe?.(U), j({
|
|
2694
|
+
type: "onDragOver",
|
|
2695
|
+
event: U
|
|
2696
|
+
});
|
|
2697
|
+
});
|
|
2698
|
+
},
|
|
2699
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2700
|
+
[en]
|
|
2701
|
+
), pe(() => {
|
|
2702
|
+
de.current = {
|
|
2703
|
+
activatorEvent: H,
|
|
2704
|
+
active: z,
|
|
2705
|
+
activeNode: q,
|
|
2706
|
+
collisionRect: Me,
|
|
2707
|
+
collisions: Ue,
|
|
2708
|
+
droppableRects: I,
|
|
2709
|
+
draggableNodes: S,
|
|
2710
|
+
draggingNode: Ie,
|
|
2711
|
+
draggingNodeRect: Te,
|
|
2712
|
+
droppableContainers: _,
|
|
2713
|
+
over: ye,
|
|
2714
|
+
scrollableAncestors: me,
|
|
2715
|
+
scrollAdjustedTranslate: Oe
|
|
2716
|
+
}, B.current = {
|
|
2717
|
+
initial: Te,
|
|
2718
|
+
translated: Me
|
|
2719
|
+
};
|
|
2720
|
+
}, [z, q, Ue, Me, S, Ie, Te, I, _, ye, me, Oe]), No({
|
|
2721
|
+
...Z,
|
|
2722
|
+
delta: D,
|
|
2723
|
+
draggingRect: Me,
|
|
2724
|
+
pointerCoordinates: Qt,
|
|
2725
|
+
scrollableAncestors: me,
|
|
2726
|
+
scrollableAncestorRects: ut
|
|
2727
|
+
});
|
|
2728
|
+
const or = M(() => ({
|
|
2729
|
+
active: z,
|
|
2730
|
+
activeNode: q,
|
|
2731
|
+
activeNodeRect: O,
|
|
2732
|
+
activatorEvent: H,
|
|
2733
|
+
collisions: Ue,
|
|
2734
|
+
containerNodeRect: We,
|
|
2735
|
+
dragOverlay: ve,
|
|
2736
|
+
draggableNodes: S,
|
|
2737
|
+
droppableContainers: _,
|
|
2738
|
+
droppableRects: I,
|
|
2739
|
+
over: ye,
|
|
2740
|
+
measureDroppableContainers: L,
|
|
2741
|
+
scrollableAncestors: me,
|
|
2742
|
+
scrollableAncestorRects: ut,
|
|
2743
|
+
measuringConfiguration: m,
|
|
2744
|
+
measuringScheduled: ue,
|
|
2745
|
+
windowRect: jt
|
|
2746
|
+
}), [z, q, O, H, Ue, We, ve, S, _, I, ye, L, me, ut, m, ue, jt]), sr = M(() => ({
|
|
2747
|
+
activatorEvent: H,
|
|
2748
|
+
activators: rn,
|
|
2749
|
+
active: z,
|
|
2750
|
+
activeNodeRect: O,
|
|
2751
|
+
ariaDescribedById: {
|
|
2752
|
+
draggable: xe
|
|
2753
|
+
},
|
|
2754
|
+
dispatch: w,
|
|
2755
|
+
draggableNodes: S,
|
|
2756
|
+
over: ye,
|
|
2757
|
+
measureDroppableContainers: L
|
|
2758
|
+
}), [H, rn, z, O, w, xe, S, ye, L]);
|
|
2759
|
+
return W.createElement(Mn.Provider, {
|
|
2760
|
+
value: C
|
|
2761
|
+
}, W.createElement(Rt.Provider, {
|
|
2762
|
+
value: sr
|
|
2763
|
+
}, W.createElement(Wn.Provider, {
|
|
2764
|
+
value: or
|
|
2765
|
+
}, W.createElement(Un.Provider, {
|
|
2766
|
+
value: nr
|
|
2767
|
+
}, u)), W.createElement(Jo, {
|
|
2768
|
+
disabled: a?.restoreFocus === !1
|
|
2769
|
+
})), W.createElement(Hr, {
|
|
2770
|
+
...a,
|
|
2771
|
+
hiddenTextDescribedById: xe
|
|
2772
|
+
}));
|
|
2773
|
+
function ir() {
|
|
2774
|
+
const J = F?.autoScrollEnabled === !1, ne = typeof c == "object" ? c.enabled === !1 : c === !1, re = N && !J && !ne;
|
|
2775
|
+
return typeof c == "object" ? {
|
|
2776
|
+
...c,
|
|
2777
|
+
enabled: re
|
|
2778
|
+
} : {
|
|
2779
|
+
enabled: re
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
}), ts = /* @__PURE__ */ st(null), Cn = "button", ns = "Draggable";
|
|
2783
|
+
function rs(e) {
|
|
2784
|
+
let {
|
|
2785
|
+
id: t,
|
|
2786
|
+
data: n,
|
|
2787
|
+
disabled: r = !1,
|
|
2788
|
+
attributes: o
|
|
2789
|
+
} = e;
|
|
2790
|
+
const s = ct(ns), {
|
|
2791
|
+
activators: i,
|
|
2792
|
+
activatorEvent: a,
|
|
2793
|
+
active: c,
|
|
2794
|
+
activeNodeRect: u,
|
|
2795
|
+
ariaDescribedById: h,
|
|
2796
|
+
draggableNodes: f,
|
|
2797
|
+
over: p
|
|
2798
|
+
} = Ee(Rt), {
|
|
2799
|
+
role: g = Cn,
|
|
2800
|
+
roleDescription: y = "draggable",
|
|
2801
|
+
tabIndex: v = 0
|
|
2802
|
+
} = o ?? {}, b = c?.id === t, w = Ee(b ? Un : ts), [j, C] = bt(), [R, E] = bt(), N = Fo(i, t), x = tt(n);
|
|
2803
|
+
pe(
|
|
2804
|
+
() => (f.set(t, {
|
|
2805
|
+
id: t,
|
|
2806
|
+
key: s,
|
|
2807
|
+
node: j,
|
|
2808
|
+
activatorNode: R,
|
|
2809
|
+
data: x
|
|
2810
|
+
}), () => {
|
|
2811
|
+
const D = f.get(t);
|
|
2812
|
+
D && D.key === s && f.delete(t);
|
|
2813
|
+
}),
|
|
2814
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2815
|
+
[f, t]
|
|
2816
|
+
);
|
|
2817
|
+
const S = M(() => ({
|
|
2818
|
+
role: g,
|
|
2819
|
+
tabIndex: v,
|
|
2820
|
+
"aria-disabled": r,
|
|
2821
|
+
"aria-pressed": b && g === Cn ? !0 : void 0,
|
|
2822
|
+
"aria-roledescription": y,
|
|
2823
|
+
"aria-describedby": h.draggable
|
|
2824
|
+
}), [r, g, v, b, y, h.draggable]);
|
|
2825
|
+
return {
|
|
2826
|
+
active: c,
|
|
2827
|
+
activatorEvent: a,
|
|
2828
|
+
activeNodeRect: u,
|
|
2829
|
+
attributes: S,
|
|
2830
|
+
isDragging: b,
|
|
2831
|
+
listeners: r ? void 0 : N,
|
|
2832
|
+
node: j,
|
|
2833
|
+
over: p,
|
|
2834
|
+
setNodeRef: C,
|
|
2835
|
+
setActivatorNodeRef: E,
|
|
2836
|
+
transform: w
|
|
2837
|
+
};
|
|
2838
|
+
}
|
|
2839
|
+
function os() {
|
|
2840
|
+
return Ee(Wn);
|
|
2841
|
+
}
|
|
2842
|
+
const ss = "Droppable", is = {
|
|
2843
|
+
timeout: 25
|
|
2844
|
+
};
|
|
2845
|
+
function as(e) {
|
|
2846
|
+
let {
|
|
2847
|
+
data: t,
|
|
2848
|
+
disabled: n = !1,
|
|
2849
|
+
id: r,
|
|
2850
|
+
resizeObserverConfig: o
|
|
2851
|
+
} = e;
|
|
2852
|
+
const s = ct(ss), {
|
|
2853
|
+
active: i,
|
|
2854
|
+
dispatch: a,
|
|
2855
|
+
over: c,
|
|
2856
|
+
measureDroppableContainers: u
|
|
2857
|
+
} = Ee(Rt), h = P({
|
|
2858
|
+
disabled: n
|
|
2859
|
+
}), f = P(!1), p = P(null), g = P(null), {
|
|
2860
|
+
disabled: y,
|
|
2861
|
+
updateMeasurementsFor: v,
|
|
2862
|
+
timeout: b
|
|
2863
|
+
} = {
|
|
2864
|
+
...is,
|
|
2865
|
+
...o
|
|
2866
|
+
}, w = tt(v ?? r), j = Q(
|
|
2867
|
+
() => {
|
|
2868
|
+
if (!f.current) {
|
|
2869
|
+
f.current = !0;
|
|
2870
|
+
return;
|
|
2871
|
+
}
|
|
2872
|
+
g.current != null && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
2873
|
+
u(Array.isArray(w.current) ? w.current : [w.current]), g.current = null;
|
|
2874
|
+
}, b);
|
|
2875
|
+
},
|
|
2876
|
+
//eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2877
|
+
[b]
|
|
2878
|
+
), C = Ct({
|
|
2879
|
+
callback: j,
|
|
2880
|
+
disabled: y || !i
|
|
2881
|
+
}), R = Q((S, D) => {
|
|
2882
|
+
C && (D && (C.unobserve(D), f.current = !1), S && C.observe(S));
|
|
2883
|
+
}, [C]), [E, N] = bt(R), x = tt(t);
|
|
2884
|
+
return k(() => {
|
|
2885
|
+
!C || !E.current || (C.disconnect(), f.current = !1, C.observe(E.current));
|
|
2886
|
+
}, [E, C]), k(
|
|
2887
|
+
() => (a({
|
|
2888
|
+
type: Y.RegisterDroppable,
|
|
2889
|
+
element: {
|
|
2890
|
+
id: r,
|
|
2891
|
+
key: s,
|
|
2892
|
+
disabled: n,
|
|
2893
|
+
node: E,
|
|
2894
|
+
rect: p,
|
|
2895
|
+
data: x
|
|
2896
|
+
}
|
|
2897
|
+
}), () => a({
|
|
2898
|
+
type: Y.UnregisterDroppable,
|
|
2899
|
+
key: s,
|
|
2900
|
+
id: r
|
|
2901
|
+
})),
|
|
2902
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2903
|
+
[r]
|
|
2904
|
+
), k(() => {
|
|
2905
|
+
n !== h.current.disabled && (a({
|
|
2906
|
+
type: Y.SetDroppableDisabled,
|
|
2907
|
+
id: r,
|
|
2908
|
+
key: s,
|
|
2909
|
+
disabled: n
|
|
2910
|
+
}), h.current.disabled = n);
|
|
2911
|
+
}, [r, s, n, a]), {
|
|
2912
|
+
active: i,
|
|
2913
|
+
rect: p,
|
|
2914
|
+
isOver: c?.id === r,
|
|
2915
|
+
node: E,
|
|
2916
|
+
over: c,
|
|
2917
|
+
setNodeRef: N
|
|
2918
|
+
};
|
|
2919
|
+
}
|
|
2920
|
+
function qt(e, t, n) {
|
|
2921
|
+
const r = e.slice();
|
|
2922
|
+
return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
|
|
2923
|
+
}
|
|
2924
|
+
function ls(e, t) {
|
|
2925
|
+
return e.reduce((n, r, o) => {
|
|
2926
|
+
const s = t.get(r);
|
|
2927
|
+
return s && (n[o] = s), n;
|
|
2928
|
+
}, Array(e.length));
|
|
2929
|
+
}
|
|
2930
|
+
function gt(e) {
|
|
2931
|
+
return e !== null && e >= 0;
|
|
2932
|
+
}
|
|
2933
|
+
function cs(e, t) {
|
|
2934
|
+
if (e === t)
|
|
2935
|
+
return !0;
|
|
2936
|
+
if (e.length !== t.length)
|
|
2937
|
+
return !1;
|
|
2938
|
+
for (let n = 0; n < e.length; n++)
|
|
2939
|
+
if (e[n] !== t[n])
|
|
2940
|
+
return !1;
|
|
2941
|
+
return !0;
|
|
2942
|
+
}
|
|
2943
|
+
function us(e) {
|
|
2944
|
+
return typeof e == "boolean" ? {
|
|
2945
|
+
draggable: e,
|
|
2946
|
+
droppable: e
|
|
2947
|
+
} : e;
|
|
2948
|
+
}
|
|
2949
|
+
const Xn = (e) => {
|
|
2950
|
+
let {
|
|
2951
|
+
rects: t,
|
|
2952
|
+
activeIndex: n,
|
|
2953
|
+
overIndex: r,
|
|
2954
|
+
index: o
|
|
2955
|
+
} = e;
|
|
2956
|
+
const s = qt(t, r, n), i = t[o], a = s[o];
|
|
2957
|
+
return !a || !i ? null : {
|
|
2958
|
+
x: a.left - i.left,
|
|
2959
|
+
y: a.top - i.top,
|
|
2960
|
+
scaleX: a.width / i.width,
|
|
2961
|
+
scaleY: a.height / i.height
|
|
2962
|
+
};
|
|
2963
|
+
}, pt = {
|
|
2964
|
+
scaleX: 1,
|
|
2965
|
+
scaleY: 1
|
|
2966
|
+
}, ds = (e) => {
|
|
2967
|
+
var t;
|
|
2968
|
+
let {
|
|
2969
|
+
activeIndex: n,
|
|
2970
|
+
activeNodeRect: r,
|
|
2971
|
+
index: o,
|
|
2972
|
+
rects: s,
|
|
2973
|
+
overIndex: i
|
|
2974
|
+
} = e;
|
|
2975
|
+
const a = (t = s[n]) != null ? t : r;
|
|
2976
|
+
if (!a)
|
|
2977
|
+
return null;
|
|
2978
|
+
if (o === n) {
|
|
2979
|
+
const u = s[i];
|
|
2980
|
+
return u ? {
|
|
2981
|
+
x: 0,
|
|
2982
|
+
y: n < i ? u.top + u.height - (a.top + a.height) : u.top - a.top,
|
|
2983
|
+
...pt
|
|
2984
|
+
} : null;
|
|
2985
|
+
}
|
|
2986
|
+
const c = fs(s, o, n);
|
|
2987
|
+
return o > n && o <= i ? {
|
|
2988
|
+
x: 0,
|
|
2989
|
+
y: -a.height - c,
|
|
2990
|
+
...pt
|
|
2991
|
+
} : o < n && o >= i ? {
|
|
2992
|
+
x: 0,
|
|
2993
|
+
y: a.height + c,
|
|
2994
|
+
...pt
|
|
2995
|
+
} : {
|
|
2996
|
+
x: 0,
|
|
2997
|
+
y: 0,
|
|
2998
|
+
...pt
|
|
2999
|
+
};
|
|
3000
|
+
};
|
|
3001
|
+
function fs(e, t, n) {
|
|
3002
|
+
const r = e[t], o = e[t - 1], s = e[t + 1];
|
|
3003
|
+
return r ? n < t ? o ? r.top - (o.top + o.height) : s ? s.top - (r.top + r.height) : 0 : s ? s.top - (r.top + r.height) : o ? r.top - (o.top + o.height) : 0 : 0;
|
|
3004
|
+
}
|
|
3005
|
+
const Gn = "Sortable", Hn = /* @__PURE__ */ W.createContext({
|
|
3006
|
+
activeIndex: -1,
|
|
3007
|
+
containerId: Gn,
|
|
3008
|
+
disableTransforms: !1,
|
|
3009
|
+
items: [],
|
|
3010
|
+
overIndex: -1,
|
|
3011
|
+
useDragOverlay: !1,
|
|
3012
|
+
sortedRects: [],
|
|
3013
|
+
strategy: Xn,
|
|
3014
|
+
disabled: {
|
|
3015
|
+
draggable: !1,
|
|
3016
|
+
droppable: !1
|
|
3017
|
+
}
|
|
3018
|
+
});
|
|
3019
|
+
function hs(e) {
|
|
3020
|
+
let {
|
|
3021
|
+
children: t,
|
|
3022
|
+
id: n,
|
|
3023
|
+
items: r,
|
|
3024
|
+
strategy: o = Xn,
|
|
3025
|
+
disabled: s = !1
|
|
3026
|
+
} = e;
|
|
3027
|
+
const {
|
|
3028
|
+
active: i,
|
|
3029
|
+
dragOverlay: a,
|
|
3030
|
+
droppableRects: c,
|
|
3031
|
+
over: u,
|
|
3032
|
+
measureDroppableContainers: h
|
|
3033
|
+
} = os(), f = ct(Gn, n), p = a.rect !== null, g = M(() => r.map((N) => typeof N == "object" && "id" in N ? N.id : N), [r]), y = i != null, v = i ? g.indexOf(i.id) : -1, b = u ? g.indexOf(u.id) : -1, w = P(g), j = !cs(g, w.current), C = b !== -1 && v === -1 || j, R = us(s);
|
|
3034
|
+
pe(() => {
|
|
3035
|
+
j && y && h(g);
|
|
3036
|
+
}, [j, g, y, h]), k(() => {
|
|
3037
|
+
w.current = g;
|
|
3038
|
+
}, [g]);
|
|
3039
|
+
const E = M(
|
|
3040
|
+
() => ({
|
|
3041
|
+
activeIndex: v,
|
|
3042
|
+
containerId: f,
|
|
3043
|
+
disabled: R,
|
|
3044
|
+
disableTransforms: C,
|
|
3045
|
+
items: g,
|
|
3046
|
+
overIndex: b,
|
|
3047
|
+
useDragOverlay: p,
|
|
3048
|
+
sortedRects: ls(g, c),
|
|
3049
|
+
strategy: o
|
|
3050
|
+
}),
|
|
3051
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3052
|
+
[v, f, R.draggable, R.droppable, C, g, b, c, p, o]
|
|
3053
|
+
);
|
|
3054
|
+
return W.createElement(Hn.Provider, {
|
|
3055
|
+
value: E
|
|
3056
|
+
}, t);
|
|
3057
|
+
}
|
|
3058
|
+
const gs = (e) => {
|
|
3059
|
+
let {
|
|
3060
|
+
id: t,
|
|
3061
|
+
items: n,
|
|
3062
|
+
activeIndex: r,
|
|
3063
|
+
overIndex: o
|
|
3064
|
+
} = e;
|
|
3065
|
+
return qt(n, r, o).indexOf(t);
|
|
3066
|
+
}, ps = (e) => {
|
|
3067
|
+
let {
|
|
3068
|
+
containerId: t,
|
|
3069
|
+
isSorting: n,
|
|
3070
|
+
wasDragging: r,
|
|
3071
|
+
index: o,
|
|
3072
|
+
items: s,
|
|
3073
|
+
newIndex: i,
|
|
3074
|
+
previousItems: a,
|
|
3075
|
+
previousContainerId: c,
|
|
3076
|
+
transition: u
|
|
3077
|
+
} = e;
|
|
3078
|
+
return !u || !r || a !== s && o === i ? !1 : n ? !0 : i !== o && t === c;
|
|
3079
|
+
}, vs = {
|
|
3080
|
+
duration: 200,
|
|
3081
|
+
easing: "ease"
|
|
3082
|
+
}, qn = "transform", bs = /* @__PURE__ */ nt.Transition.toString({
|
|
3083
|
+
property: qn,
|
|
3084
|
+
duration: 0,
|
|
3085
|
+
easing: "linear"
|
|
3086
|
+
}), xs = {
|
|
3087
|
+
roleDescription: "sortable"
|
|
3088
|
+
};
|
|
3089
|
+
function ms(e) {
|
|
3090
|
+
let {
|
|
3091
|
+
disabled: t,
|
|
3092
|
+
index: n,
|
|
3093
|
+
node: r,
|
|
3094
|
+
rect: o
|
|
3095
|
+
} = e;
|
|
3096
|
+
const [s, i] = K(null), a = P(n);
|
|
3097
|
+
return pe(() => {
|
|
3098
|
+
if (!t && n !== a.current && r.current) {
|
|
3099
|
+
const c = o.current;
|
|
3100
|
+
if (c) {
|
|
3101
|
+
const u = Ve(r.current, {
|
|
3102
|
+
ignoreTransform: !0
|
|
3103
|
+
}), h = {
|
|
3104
|
+
x: c.left - u.left,
|
|
3105
|
+
y: c.top - u.top,
|
|
3106
|
+
scaleX: c.width / u.width,
|
|
3107
|
+
scaleY: c.height / u.height
|
|
3108
|
+
};
|
|
3109
|
+
(h.x || h.y) && i(h);
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
n !== a.current && (a.current = n);
|
|
3113
|
+
}, [t, n, r, o]), k(() => {
|
|
3114
|
+
s && i(null);
|
|
3115
|
+
}, [s]), s;
|
|
3116
|
+
}
|
|
3117
|
+
function ys(e) {
|
|
3118
|
+
let {
|
|
3119
|
+
animateLayoutChanges: t = ps,
|
|
3120
|
+
attributes: n,
|
|
3121
|
+
disabled: r,
|
|
3122
|
+
data: o,
|
|
3123
|
+
getNewIndex: s = gs,
|
|
3124
|
+
id: i,
|
|
3125
|
+
strategy: a,
|
|
3126
|
+
resizeObserverConfig: c,
|
|
3127
|
+
transition: u = vs
|
|
3128
|
+
} = e;
|
|
3129
|
+
const {
|
|
3130
|
+
items: h,
|
|
3131
|
+
containerId: f,
|
|
3132
|
+
activeIndex: p,
|
|
3133
|
+
disabled: g,
|
|
3134
|
+
disableTransforms: y,
|
|
3135
|
+
sortedRects: v,
|
|
3136
|
+
overIndex: b,
|
|
3137
|
+
useDragOverlay: w,
|
|
3138
|
+
strategy: j
|
|
3139
|
+
} = Ee(Hn), C = ws(r, g), R = h.indexOf(i), E = M(() => ({
|
|
3140
|
+
sortable: {
|
|
3141
|
+
containerId: f,
|
|
3142
|
+
index: R,
|
|
3143
|
+
items: h
|
|
3144
|
+
},
|
|
3145
|
+
...o
|
|
3146
|
+
}), [f, o, R, h]), N = M(() => h.slice(h.indexOf(i)), [h, i]), {
|
|
3147
|
+
rect: x,
|
|
3148
|
+
node: S,
|
|
3149
|
+
isOver: D,
|
|
3150
|
+
setNodeRef: _
|
|
3151
|
+
} = as({
|
|
3152
|
+
id: i,
|
|
3153
|
+
data: E,
|
|
3154
|
+
disabled: C.droppable,
|
|
3155
|
+
resizeObserverConfig: {
|
|
3156
|
+
updateMeasurementsFor: N,
|
|
3157
|
+
...c
|
|
3158
|
+
}
|
|
3159
|
+
}), {
|
|
3160
|
+
active: A,
|
|
3161
|
+
activatorEvent: B,
|
|
3162
|
+
activeNodeRect: z,
|
|
3163
|
+
attributes: G,
|
|
3164
|
+
setNodeRef: F,
|
|
3165
|
+
listeners: le,
|
|
3166
|
+
isDragging: H,
|
|
3167
|
+
over: De,
|
|
3168
|
+
setActivatorNodeRef: se,
|
|
3169
|
+
transform: xe
|
|
3170
|
+
} = rs({
|
|
3171
|
+
id: i,
|
|
3172
|
+
data: E,
|
|
3173
|
+
attributes: {
|
|
3174
|
+
...xs,
|
|
3175
|
+
...n
|
|
3176
|
+
},
|
|
3177
|
+
disabled: C.draggable
|
|
3178
|
+
}), d = Lr(_, F), m = !!A, I = m && !y && gt(p) && gt(b), L = !w && H, ue = L && I ? xe : null, $ = I ? ue ?? (a ?? j)({
|
|
3179
|
+
rects: v,
|
|
3180
|
+
activeNodeRect: z,
|
|
3181
|
+
activeIndex: p,
|
|
3182
|
+
overIndex: b,
|
|
3183
|
+
index: R
|
|
3184
|
+
}) : null, Z = gt(p) && gt(b) ? s({
|
|
3185
|
+
id: i,
|
|
3186
|
+
items: h,
|
|
3187
|
+
activeIndex: p,
|
|
3188
|
+
overIndex: b
|
|
3189
|
+
}) : R, te = A?.id, O = P({
|
|
3190
|
+
activeId: te,
|
|
3191
|
+
items: h,
|
|
3192
|
+
newIndex: Z,
|
|
3193
|
+
containerId: f
|
|
3194
|
+
}), We = h !== O.current.items, de = t({
|
|
3195
|
+
active: A,
|
|
3196
|
+
containerId: f,
|
|
3197
|
+
isDragging: H,
|
|
3198
|
+
isSorting: m,
|
|
3199
|
+
id: i,
|
|
3200
|
+
index: R,
|
|
3201
|
+
items: h,
|
|
3202
|
+
newIndex: O.current.newIndex,
|
|
3203
|
+
previousItems: O.current.items,
|
|
3204
|
+
previousContainerId: O.current.containerId,
|
|
3205
|
+
transition: u,
|
|
3206
|
+
wasDragging: O.current.activeId != null
|
|
3207
|
+
}), Ae = ms({
|
|
3208
|
+
disabled: !de,
|
|
3209
|
+
index: R,
|
|
3210
|
+
node: S,
|
|
3211
|
+
rect: x
|
|
3212
|
+
});
|
|
3213
|
+
return k(() => {
|
|
3214
|
+
m && O.current.newIndex !== Z && (O.current.newIndex = Z), f !== O.current.containerId && (O.current.containerId = f), h !== O.current.items && (O.current.items = h);
|
|
3215
|
+
}, [m, Z, f, h]), k(() => {
|
|
3216
|
+
if (te === O.current.activeId)
|
|
3217
|
+
return;
|
|
3218
|
+
if (te != null && O.current.activeId == null) {
|
|
3219
|
+
O.current.activeId = te;
|
|
3220
|
+
return;
|
|
3221
|
+
}
|
|
3222
|
+
const Ie = setTimeout(() => {
|
|
3223
|
+
O.current.activeId = te;
|
|
3224
|
+
}, 50);
|
|
3225
|
+
return () => clearTimeout(Ie);
|
|
3226
|
+
}, [te]), {
|
|
3227
|
+
active: A,
|
|
3228
|
+
activeIndex: p,
|
|
3229
|
+
attributes: G,
|
|
3230
|
+
data: E,
|
|
3231
|
+
rect: x,
|
|
3232
|
+
index: R,
|
|
3233
|
+
newIndex: Z,
|
|
3234
|
+
items: h,
|
|
3235
|
+
isOver: D,
|
|
3236
|
+
isSorting: m,
|
|
3237
|
+
isDragging: H,
|
|
3238
|
+
listeners: le,
|
|
3239
|
+
node: S,
|
|
3240
|
+
overIndex: b,
|
|
3241
|
+
over: De,
|
|
3242
|
+
setNodeRef: d,
|
|
3243
|
+
setActivatorNodeRef: se,
|
|
3244
|
+
setDroppableNodeRef: _,
|
|
3245
|
+
setDraggableNodeRef: F,
|
|
3246
|
+
transform: Ae ?? $,
|
|
3247
|
+
transition: ve()
|
|
3248
|
+
};
|
|
3249
|
+
function ve() {
|
|
3250
|
+
if (
|
|
3251
|
+
// Temporarily disable transitions for a single frame to set up derived transforms
|
|
3252
|
+
Ae || // Or to prevent items jumping to back to their "new" position when items change
|
|
3253
|
+
We && O.current.newIndex === R
|
|
3254
|
+
)
|
|
3255
|
+
return bs;
|
|
3256
|
+
if (!(L && !Vt(B) || !u) && (m || de))
|
|
3257
|
+
return nt.Transition.toString({
|
|
3258
|
+
...u,
|
|
3259
|
+
property: qn
|
|
3260
|
+
});
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
function ws(e, t) {
|
|
3264
|
+
var n, r;
|
|
3265
|
+
return typeof e == "boolean" ? {
|
|
3266
|
+
draggable: e,
|
|
3267
|
+
// Backwards compatibility
|
|
3268
|
+
droppable: !1
|
|
3269
|
+
} : {
|
|
3270
|
+
draggable: (n = e?.draggable) != null ? n : t.draggable,
|
|
3271
|
+
droppable: (r = e?.droppable) != null ? r : t.droppable
|
|
3272
|
+
};
|
|
3273
|
+
}
|
|
3274
|
+
T.Down, T.Right, T.Up, T.Left;
|
|
3275
|
+
const Ot = /* @__PURE__ */ new Map();
|
|
3276
|
+
function ot(e) {
|
|
3277
|
+
if (!e) return X.FileText;
|
|
3278
|
+
const t = Ot.get(e);
|
|
3279
|
+
if (t) return t;
|
|
3280
|
+
if (X[e])
|
|
3281
|
+
return Ot.set(e, X[e]), X[e];
|
|
3282
|
+
const n = e.split("-").filter(Boolean).map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join("");
|
|
3283
|
+
return X[n] ? (Ot.set(e, X[n]), X[n]) : X.FileText;
|
|
3284
|
+
}
|
|
3285
|
+
function ge(e, t) {
|
|
3286
|
+
if (typeof e == "string") return e;
|
|
3287
|
+
if (t) {
|
|
3288
|
+
const n = t(e.key, { defaultValue: e.defaultValue, ...e.params });
|
|
3289
|
+
if (n && n !== e.key) return n;
|
|
3290
|
+
}
|
|
3291
|
+
return e.defaultValue || e.key;
|
|
3292
|
+
}
|
|
3293
|
+
function Ss(e, t, n) {
|
|
3294
|
+
const r = ge(e.label, n);
|
|
3295
|
+
return t && e.type === "object" && e.objectName && typeof e.label == "string" ? t(e.objectName, r) : r;
|
|
3296
|
+
}
|
|
3297
|
+
const Cs = (e) => !(e === !1 || e === "false"), Rs = () => !0;
|
|
3298
|
+
function js(e, t) {
|
|
3299
|
+
switch (e.type) {
|
|
3300
|
+
case "object": {
|
|
3301
|
+
const n = `${t}/${e.objectName ?? ""}`;
|
|
3302
|
+
return { href: e.viewName ? `${n}/view/${e.viewName}` : n, external: !1 };
|
|
3303
|
+
}
|
|
3304
|
+
case "dashboard":
|
|
3305
|
+
return { href: e.dashboardName ? `${t}/dashboard/${e.dashboardName}` : "#", external: !1 };
|
|
3306
|
+
case "page":
|
|
3307
|
+
return { href: e.pageName ? `${t}/page/${e.pageName}` : "#", external: !1 };
|
|
3308
|
+
case "report":
|
|
3309
|
+
return { href: e.reportName ? `${t}/report/${e.reportName}` : "#", external: !1 };
|
|
3310
|
+
case "url":
|
|
3311
|
+
return { href: e.url ?? "#", external: e.target === "_blank" };
|
|
3312
|
+
default:
|
|
3313
|
+
return { href: "#", external: !1 };
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
function Jn(e, t) {
|
|
3317
|
+
if (!t.trim()) return e;
|
|
3318
|
+
const n = t.toLowerCase().trim();
|
|
3319
|
+
return e.reduce((r, o) => {
|
|
3320
|
+
if (o.type === "separator") return r;
|
|
3321
|
+
if (o.type === "group" && o.children?.length) {
|
|
3322
|
+
const s = Jn(o.children, t);
|
|
3323
|
+
return s.length > 0 && r.push({ ...o, children: s }), r;
|
|
3324
|
+
}
|
|
3325
|
+
return ge(o.label).toLowerCase().includes(n) && r.push(o), r;
|
|
3326
|
+
}, []);
|
|
3327
|
+
}
|
|
3328
|
+
const Ds = 5;
|
|
3329
|
+
function Ns({
|
|
3330
|
+
item: e,
|
|
3331
|
+
basePath: t,
|
|
3332
|
+
evalVis: n,
|
|
3333
|
+
checkPerm: r,
|
|
3334
|
+
onAction: o,
|
|
3335
|
+
enablePinning: s,
|
|
3336
|
+
onPinToggle: i,
|
|
3337
|
+
enableReorder: a,
|
|
3338
|
+
resolveObjectLabel: c,
|
|
3339
|
+
t: u
|
|
3340
|
+
}) {
|
|
3341
|
+
const {
|
|
3342
|
+
attributes: h,
|
|
3343
|
+
listeners: f,
|
|
3344
|
+
setNodeRef: p,
|
|
3345
|
+
transform: g,
|
|
3346
|
+
transition: y,
|
|
3347
|
+
isDragging: v
|
|
3348
|
+
} = ys({ id: e.id, disabled: !a }), b = {
|
|
3349
|
+
transform: nt.Transform.toString(g),
|
|
3350
|
+
transition: y,
|
|
3351
|
+
opacity: v ? 0.5 : void 0,
|
|
3352
|
+
zIndex: v ? 10 : void 0
|
|
3353
|
+
};
|
|
3354
|
+
return /* @__PURE__ */ l.jsx("div", { ref: p, style: b, ...h, children: /* @__PURE__ */ l.jsx(
|
|
3355
|
+
Le,
|
|
3356
|
+
{
|
|
3357
|
+
item: e,
|
|
3358
|
+
basePath: t,
|
|
3359
|
+
evalVis: n,
|
|
3360
|
+
checkPerm: r,
|
|
3361
|
+
onAction: o,
|
|
3362
|
+
enablePinning: s,
|
|
3363
|
+
onPinToggle: i,
|
|
3364
|
+
dragListeners: a ? f : void 0,
|
|
3365
|
+
resolveObjectLabel: c,
|
|
3366
|
+
t: u
|
|
3367
|
+
}
|
|
3368
|
+
) });
|
|
3369
|
+
}
|
|
3370
|
+
function Le({
|
|
3371
|
+
item: e,
|
|
3372
|
+
basePath: t,
|
|
3373
|
+
evalVis: n,
|
|
3374
|
+
checkPerm: r,
|
|
3375
|
+
onAction: o,
|
|
3376
|
+
enablePinning: s,
|
|
3377
|
+
onPinToggle: i,
|
|
3378
|
+
dragListeners: a,
|
|
3379
|
+
resolveObjectLabel: c,
|
|
3380
|
+
t: u
|
|
3381
|
+
}) {
|
|
3382
|
+
const h = zt(), [f, p] = K(e.defaultOpen !== !1);
|
|
3383
|
+
if (!n(e.visible) || e.requiredPermissions?.length && !r(e.requiredPermissions)) return null;
|
|
3384
|
+
if (e.type === "separator")
|
|
3385
|
+
return /* @__PURE__ */ l.jsx(hr, { className: "my-2" });
|
|
3386
|
+
if (e.type === "group") {
|
|
3387
|
+
const C = (e.children ?? []).slice().sort((R, E) => (R.order ?? 0) - (E.order ?? 0));
|
|
3388
|
+
return /* @__PURE__ */ l.jsx(Rn, { open: f, onOpenChange: p, children: /* @__PURE__ */ l.jsxs(Pe, { children: [
|
|
3389
|
+
/* @__PURE__ */ l.jsx(wt, { asChild: !0, children: /* @__PURE__ */ l.jsxs(jn, { className: "flex w-full items-center justify-between", children: [
|
|
3390
|
+
ge(e.label, u),
|
|
3391
|
+
/* @__PURE__ */ l.jsx(
|
|
3392
|
+
X.ChevronRight,
|
|
3393
|
+
{
|
|
3394
|
+
className: `ml-auto h-4 w-4 transition-transform ${f ? "rotate-90" : ""}`
|
|
3395
|
+
}
|
|
3396
|
+
)
|
|
3397
|
+
] }) }),
|
|
3398
|
+
/* @__PURE__ */ l.jsx(Dn, { children: /* @__PURE__ */ l.jsx(_e, { children: /* @__PURE__ */ l.jsx(je, { children: C.map((R) => /* @__PURE__ */ l.jsx(
|
|
3399
|
+
Le,
|
|
3400
|
+
{
|
|
3401
|
+
item: R,
|
|
3402
|
+
basePath: t,
|
|
3403
|
+
evalVis: n,
|
|
3404
|
+
checkPerm: r,
|
|
3405
|
+
onAction: o,
|
|
3406
|
+
enablePinning: s,
|
|
3407
|
+
onPinToggle: i,
|
|
3408
|
+
resolveObjectLabel: c,
|
|
3409
|
+
t: u
|
|
3410
|
+
},
|
|
3411
|
+
R.id
|
|
3412
|
+
)) }) }) })
|
|
3413
|
+
] }) });
|
|
3414
|
+
}
|
|
3415
|
+
if (e.type === "action") {
|
|
3416
|
+
const C = ot(e.icon);
|
|
3417
|
+
return /* @__PURE__ */ l.jsxs(ze, { children: [
|
|
3418
|
+
a && /* @__PURE__ */ l.jsx("span", { className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground", "aria-label": "Drag to reorder", ...a, children: /* @__PURE__ */ l.jsx(X.GripVertical, { className: "h-3.5 w-3.5" }) }),
|
|
3419
|
+
/* @__PURE__ */ l.jsxs(
|
|
3420
|
+
Fe,
|
|
3421
|
+
{
|
|
3422
|
+
tooltip: ge(e.label, u),
|
|
3423
|
+
onClick: () => o?.(e),
|
|
3424
|
+
children: [
|
|
3425
|
+
/* @__PURE__ */ l.jsx(C, { className: "h-4 w-4" }),
|
|
3426
|
+
/* @__PURE__ */ l.jsx("span", { children: ge(e.label, u) }),
|
|
3427
|
+
e.badge != null && /* @__PURE__ */ l.jsx(Ke, { variant: e.badgeVariant ?? "default", className: "ml-auto text-[10px] px-1.5 py-0", children: e.badge })
|
|
3428
|
+
]
|
|
3429
|
+
}
|
|
3430
|
+
),
|
|
3431
|
+
s && i && /* @__PURE__ */ l.jsx(
|
|
3432
|
+
on,
|
|
3433
|
+
{
|
|
3434
|
+
showOnHover: !e.pinned,
|
|
3435
|
+
onClick: () => i(e.id, !e.pinned),
|
|
3436
|
+
"aria-label": e.pinned ? `Unpin ${ge(e.label, u)}` : `Pin ${ge(e.label, u)}`,
|
|
3437
|
+
children: e.pinned ? /* @__PURE__ */ l.jsx(X.PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l.jsx(X.Pin, { className: "h-3.5 w-3.5" })
|
|
3438
|
+
}
|
|
3439
|
+
)
|
|
3440
|
+
] });
|
|
3441
|
+
}
|
|
3442
|
+
const g = ot(e.icon), { href: y, external: v } = js(e, t), b = y !== "#" && h.pathname.startsWith(y), w = Ss(e, c, u), j = /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
3443
|
+
/* @__PURE__ */ l.jsx(g, { className: "h-4 w-4" }),
|
|
3444
|
+
/* @__PURE__ */ l.jsx("span", { children: w }),
|
|
3445
|
+
e.badge != null && /* @__PURE__ */ l.jsx(Ke, { variant: e.badgeVariant ?? "default", className: "ml-auto text-[10px] px-1.5 py-0", children: e.badge })
|
|
3446
|
+
] });
|
|
3447
|
+
return /* @__PURE__ */ l.jsxs(ze, { children: [
|
|
3448
|
+
a && /* @__PURE__ */ l.jsx("span", { className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground", "aria-label": "Drag to reorder", ...a, children: /* @__PURE__ */ l.jsx(X.GripVertical, { className: "h-3.5 w-3.5" }) }),
|
|
3449
|
+
/* @__PURE__ */ l.jsx(Fe, { asChild: !0, isActive: b, tooltip: w, children: v ? /* @__PURE__ */ l.jsx("a", { href: y, target: "_blank", rel: "noopener noreferrer", children: j }) : /* @__PURE__ */ l.jsx(An, { to: y, children: j }) }),
|
|
3450
|
+
s && i && /* @__PURE__ */ l.jsx(
|
|
3451
|
+
on,
|
|
3452
|
+
{
|
|
3453
|
+
showOnHover: !e.pinned,
|
|
3454
|
+
onClick: () => i(e.id, !e.pinned),
|
|
3455
|
+
"aria-label": e.pinned ? `Unpin ${w}` : `Pin ${w}`,
|
|
3456
|
+
children: e.pinned ? /* @__PURE__ */ l.jsx(X.PinOff, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ l.jsx(X.Pin, { className: "h-3.5 w-3.5" })
|
|
3457
|
+
}
|
|
3458
|
+
)
|
|
3459
|
+
] });
|
|
3460
|
+
}
|
|
3461
|
+
function Kn({
|
|
3462
|
+
items: e,
|
|
3463
|
+
basePath: t = "",
|
|
3464
|
+
evaluateVisibility: n = Cs,
|
|
3465
|
+
checkPermission: r = Rs,
|
|
3466
|
+
onAction: o,
|
|
3467
|
+
searchQuery: s,
|
|
3468
|
+
enablePinning: i,
|
|
3469
|
+
onPinToggle: a,
|
|
3470
|
+
enableReorder: c,
|
|
3471
|
+
onReorder: u,
|
|
3472
|
+
resolveObjectLabel: h,
|
|
3473
|
+
t: f
|
|
3474
|
+
}) {
|
|
3475
|
+
const p = M(
|
|
3476
|
+
() => s ? Jn(e, s) : e,
|
|
3477
|
+
[e, s]
|
|
3478
|
+
), g = M(
|
|
3479
|
+
() => Qn(p),
|
|
3480
|
+
[p]
|
|
3481
|
+
), y = p.slice().sort((x, S) => (x.order ?? 0) - (S.order ?? 0)), v = qr(
|
|
3482
|
+
fn(Ht, { activationConstraint: { distance: Ds } }),
|
|
3483
|
+
fn(Xt)
|
|
3484
|
+
), b = (x) => {
|
|
3485
|
+
const { active: S, over: D } = x;
|
|
3486
|
+
if (!D || S.id === D.id || !u) return;
|
|
3487
|
+
const _ = y.findIndex((z) => z.id === S.id), A = y.findIndex((z) => z.id === D.id);
|
|
3488
|
+
if (_ === -1 || A === -1) return;
|
|
3489
|
+
const B = qt(y, _, A).map((z, G) => ({
|
|
3490
|
+
...z,
|
|
3491
|
+
order: G
|
|
3492
|
+
}));
|
|
3493
|
+
u(B);
|
|
3494
|
+
}, w = {
|
|
3495
|
+
basePath: t,
|
|
3496
|
+
evalVis: n,
|
|
3497
|
+
checkPerm: r,
|
|
3498
|
+
onAction: o,
|
|
3499
|
+
enablePinning: i,
|
|
3500
|
+
onPinToggle: a,
|
|
3501
|
+
resolveObjectLabel: h,
|
|
3502
|
+
t: f
|
|
3503
|
+
}, j = y.some((x) => x.type === "group"), C = g.length > 0 && i ? /* @__PURE__ */ l.jsxs(Pe, { children: [
|
|
3504
|
+
/* @__PURE__ */ l.jsxs(wt, { className: "flex items-center gap-1.5", children: [
|
|
3505
|
+
/* @__PURE__ */ l.jsx(X.Star, { className: "h-3.5 w-3.5" }),
|
|
3506
|
+
"Favorites"
|
|
3507
|
+
] }),
|
|
3508
|
+
/* @__PURE__ */ l.jsx(_e, { children: /* @__PURE__ */ l.jsx(je, { children: g.map((x) => /* @__PURE__ */ l.jsx(
|
|
3509
|
+
Le,
|
|
3510
|
+
{
|
|
3511
|
+
item: x,
|
|
3512
|
+
...w
|
|
3513
|
+
},
|
|
3514
|
+
`fav-${x.id}`
|
|
3515
|
+
)) }) })
|
|
3516
|
+
] }) : null;
|
|
3517
|
+
if (!j) {
|
|
3518
|
+
const x = y.filter((D) => D.type !== "group").map((D) => D.id), S = c ? /* @__PURE__ */ l.jsx(es, { sensors: v, collisionDetection: eo, onDragEnd: b, children: /* @__PURE__ */ l.jsx(hs, { items: x, strategy: ds, children: /* @__PURE__ */ l.jsx(je, { children: y.map((D) => /* @__PURE__ */ l.jsx(
|
|
3519
|
+
Ns,
|
|
3520
|
+
{
|
|
3521
|
+
item: D,
|
|
3522
|
+
enableReorder: c,
|
|
3523
|
+
...w
|
|
3524
|
+
},
|
|
3525
|
+
D.id
|
|
3526
|
+
)) }) }) }) : /* @__PURE__ */ l.jsx(je, { children: y.map((D) => /* @__PURE__ */ l.jsx(
|
|
3527
|
+
Le,
|
|
3528
|
+
{
|
|
3529
|
+
item: D,
|
|
3530
|
+
...w
|
|
3531
|
+
},
|
|
3532
|
+
D.id
|
|
3533
|
+
)) });
|
|
3534
|
+
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
3535
|
+
C,
|
|
3536
|
+
/* @__PURE__ */ l.jsx(Pe, { children: /* @__PURE__ */ l.jsx(_e, { children: S }) })
|
|
3537
|
+
] });
|
|
3538
|
+
}
|
|
3539
|
+
const R = [];
|
|
3540
|
+
let E = [];
|
|
3541
|
+
const N = (x) => {
|
|
3542
|
+
if (E.length === 0) return;
|
|
3543
|
+
const S = E;
|
|
3544
|
+
E = [], R.push(
|
|
3545
|
+
/* @__PURE__ */ l.jsx(Pe, { children: /* @__PURE__ */ l.jsx(_e, { children: /* @__PURE__ */ l.jsx(je, { children: S.map((D) => /* @__PURE__ */ l.jsx(
|
|
3546
|
+
Le,
|
|
3547
|
+
{
|
|
3548
|
+
item: D,
|
|
3549
|
+
...w
|
|
3550
|
+
},
|
|
3551
|
+
D.id
|
|
3552
|
+
)) }) }) }, x)
|
|
3553
|
+
);
|
|
3554
|
+
};
|
|
3555
|
+
return y.forEach((x, S) => {
|
|
3556
|
+
x.type === "group" ? (N(`leaf-${S}`), R.push(
|
|
3557
|
+
/* @__PURE__ */ l.jsx(
|
|
3558
|
+
Le,
|
|
3559
|
+
{
|
|
3560
|
+
item: x,
|
|
3561
|
+
...w
|
|
3562
|
+
},
|
|
3563
|
+
x.id
|
|
3564
|
+
)
|
|
3565
|
+
)) : E.push(x);
|
|
3566
|
+
}), N("leaf-end"), /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
3567
|
+
C,
|
|
3568
|
+
R
|
|
3569
|
+
] });
|
|
3570
|
+
}
|
|
3571
|
+
function Qn(e) {
|
|
3572
|
+
const t = [];
|
|
3573
|
+
for (const n of e)
|
|
3574
|
+
n.pinned && n.type !== "group" && n.type !== "separator" && t.push(n), n.children?.length && t.push(...Qn(n.children));
|
|
3575
|
+
return t;
|
|
3576
|
+
}
|
|
3577
|
+
function Es({
|
|
3578
|
+
areas: e,
|
|
3579
|
+
activeAreaId: t,
|
|
3580
|
+
onAreaChange: n,
|
|
3581
|
+
evalVis: r,
|
|
3582
|
+
checkPerm: o
|
|
3583
|
+
}) {
|
|
3584
|
+
const s = e.filter((i) => !(!r(i.visible) || i.requiredPermissions?.length && !o(i.requiredPermissions)));
|
|
3585
|
+
return s.length <= 1 ? null : /* @__PURE__ */ l.jsxs(Pe, { children: [
|
|
3586
|
+
/* @__PURE__ */ l.jsxs(wt, { className: "flex items-center gap-1.5", children: [
|
|
3587
|
+
/* @__PURE__ */ l.jsx(X.Layers, { className: "h-3.5 w-3.5" }),
|
|
3588
|
+
"Area"
|
|
3589
|
+
] }),
|
|
3590
|
+
/* @__PURE__ */ l.jsx(_e, { children: /* @__PURE__ */ l.jsx(je, { children: s.map((i) => {
|
|
3591
|
+
const a = ot(i.icon);
|
|
3592
|
+
return /* @__PURE__ */ l.jsx(ze, { children: /* @__PURE__ */ l.jsxs(
|
|
3593
|
+
Fe,
|
|
3594
|
+
{
|
|
3595
|
+
isActive: i.id === t,
|
|
3596
|
+
tooltip: ge(i.label),
|
|
3597
|
+
onClick: () => n(i.id),
|
|
3598
|
+
children: [
|
|
3599
|
+
/* @__PURE__ */ l.jsx(a, { className: "h-4 w-4" }),
|
|
3600
|
+
/* @__PURE__ */ l.jsx("span", { children: ge(i.label) })
|
|
3601
|
+
]
|
|
3602
|
+
}
|
|
3603
|
+
) }, i.id);
|
|
3604
|
+
}) }) })
|
|
3605
|
+
] });
|
|
3606
|
+
}
|
|
3607
|
+
function As({
|
|
3608
|
+
items: e,
|
|
3609
|
+
basePath: t
|
|
3610
|
+
}) {
|
|
3611
|
+
const n = zt(), r = e.filter((o) => o.type !== "group" && o.type !== "separator").slice(0, 5);
|
|
3612
|
+
return r.length === 0 ? null : /* @__PURE__ */ l.jsx(
|
|
3613
|
+
"div",
|
|
3614
|
+
{
|
|
3615
|
+
className: "fixed bottom-0 left-0 right-0 z-50 flex items-center justify-around border-t bg-background/95 backdrop-blur-sm px-2 py-1 sm:hidden safe-area-bottom",
|
|
3616
|
+
role: "navigation",
|
|
3617
|
+
"aria-label": "Mobile navigation",
|
|
3618
|
+
children: r.map((o) => {
|
|
3619
|
+
const s = ot(o.icon);
|
|
3620
|
+
let i = "#";
|
|
3621
|
+
o.type === "object" ? (i = `${t}/${o.objectName}`, o.viewName && (i += `/view/${o.viewName}`)) : o.type === "dashboard" ? i = o.dashboardName ? `${t}/dashboard/${o.dashboardName}` : "#" : o.type === "page" ? i = o.pageName ? `${t}/page/${o.pageName}` : "#" : o.type === "report" ? i = o.reportName ? `${t}/report/${o.reportName}` : "#" : o.type === "url" && (i = o.url ?? "#");
|
|
3622
|
+
const a = i !== "#" && n.pathname.startsWith(i);
|
|
3623
|
+
return /* @__PURE__ */ l.jsxs(
|
|
3624
|
+
An,
|
|
3625
|
+
{
|
|
3626
|
+
to: i,
|
|
3627
|
+
className: `flex flex-col items-center gap-0.5 px-2 py-1.5 transition-colors min-w-[44px] min-h-[44px] justify-center ${a ? "text-primary" : "text-muted-foreground hover:text-foreground"}`,
|
|
3628
|
+
children: [
|
|
3629
|
+
/* @__PURE__ */ l.jsx(s, { className: "h-5 w-5" }),
|
|
3630
|
+
/* @__PURE__ */ l.jsx("span", { className: "text-[10px] truncate max-w-[60px]", children: ge(o.label) })
|
|
3631
|
+
]
|
|
3632
|
+
},
|
|
3633
|
+
o.id
|
|
3634
|
+
);
|
|
3635
|
+
})
|
|
3636
|
+
}
|
|
3637
|
+
);
|
|
3638
|
+
}
|
|
3639
|
+
function Is({
|
|
3640
|
+
schema: e,
|
|
3641
|
+
basePath: t,
|
|
3642
|
+
evalVis: n,
|
|
3643
|
+
checkPerm: r,
|
|
3644
|
+
onAction: o,
|
|
3645
|
+
sidebarHeader: s,
|
|
3646
|
+
sidebarFooter: i,
|
|
3647
|
+
sidebarExtra: a,
|
|
3648
|
+
activeAreaId: c,
|
|
3649
|
+
setActiveAreaId: u,
|
|
3650
|
+
resolvedNavigation: h,
|
|
3651
|
+
enableSearch: f,
|
|
3652
|
+
enablePinning: p,
|
|
3653
|
+
onPinToggle: g,
|
|
3654
|
+
enableReorder: y,
|
|
3655
|
+
onReorder: v
|
|
3656
|
+
}) {
|
|
3657
|
+
const b = ot(e.logo), w = e.areas ?? [], [j, C] = K("");
|
|
3658
|
+
return /* @__PURE__ */ l.jsxs(Nn, { collapsible: "icon", children: [
|
|
3659
|
+
/* @__PURE__ */ l.jsxs(gr, { children: [
|
|
3660
|
+
s ?? /* @__PURE__ */ l.jsx(je, { children: /* @__PURE__ */ l.jsx(ze, { children: /* @__PURE__ */ l.jsxs(Fe, { size: "lg", tooltip: e.title ?? e.name, children: [
|
|
3661
|
+
/* @__PURE__ */ l.jsx("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground", children: e.logo && e.logo.startsWith("http") ? /* @__PURE__ */ l.jsx(
|
|
3662
|
+
"img",
|
|
3663
|
+
{
|
|
3664
|
+
src: e.logo,
|
|
3665
|
+
alt: e.title ?? "",
|
|
3666
|
+
className: "size-6 object-contain"
|
|
3667
|
+
}
|
|
3668
|
+
) : /* @__PURE__ */ l.jsx(b, { className: "size-4" }) }),
|
|
3669
|
+
/* @__PURE__ */ l.jsxs("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
|
|
3670
|
+
/* @__PURE__ */ l.jsx("span", { className: "truncate font-semibold", children: e.title ?? e.name ?? "App" }),
|
|
3671
|
+
e.description && /* @__PURE__ */ l.jsx("span", { className: "truncate text-xs text-muted-foreground", children: e.description })
|
|
3672
|
+
] })
|
|
3673
|
+
] }) }) }),
|
|
3674
|
+
f && /* @__PURE__ */ l.jsx(
|
|
3675
|
+
pr,
|
|
3676
|
+
{
|
|
3677
|
+
placeholder: "Search navigation…",
|
|
3678
|
+
value: j,
|
|
3679
|
+
onChange: (R) => C(R.target.value),
|
|
3680
|
+
"aria-label": "Search navigation"
|
|
3681
|
+
}
|
|
3682
|
+
)
|
|
3683
|
+
] }),
|
|
3684
|
+
/* @__PURE__ */ l.jsxs(En, { children: [
|
|
3685
|
+
w.length > 1 && c && /* @__PURE__ */ l.jsx(
|
|
3686
|
+
Es,
|
|
3687
|
+
{
|
|
3688
|
+
areas: w,
|
|
3689
|
+
activeAreaId: c,
|
|
3690
|
+
onAreaChange: u,
|
|
3691
|
+
evalVis: n,
|
|
3692
|
+
checkPerm: r
|
|
3693
|
+
}
|
|
3694
|
+
),
|
|
3695
|
+
/* @__PURE__ */ l.jsx(
|
|
3696
|
+
Kn,
|
|
3697
|
+
{
|
|
3698
|
+
items: h,
|
|
3699
|
+
basePath: t,
|
|
3700
|
+
evaluateVisibility: n,
|
|
3701
|
+
checkPermission: r,
|
|
3702
|
+
onAction: o,
|
|
3703
|
+
searchQuery: j,
|
|
3704
|
+
enablePinning: p,
|
|
3705
|
+
onPinToggle: g,
|
|
3706
|
+
enableReorder: y,
|
|
3707
|
+
onReorder: v
|
|
3708
|
+
}
|
|
3709
|
+
),
|
|
3710
|
+
a
|
|
3711
|
+
] }),
|
|
3712
|
+
i && /* @__PURE__ */ l.jsx(vr, { children: i })
|
|
3713
|
+
] });
|
|
3714
|
+
}
|
|
3715
|
+
function Ts({
|
|
3716
|
+
schema: e,
|
|
3717
|
+
basePath: t = "",
|
|
3718
|
+
mobileNavMode: n = "drawer",
|
|
3719
|
+
evaluateVisibility: r,
|
|
3720
|
+
checkPermission: o,
|
|
3721
|
+
onAction: s,
|
|
3722
|
+
navbar: i,
|
|
3723
|
+
sidebarHeader: a,
|
|
3724
|
+
sidebarFooter: c,
|
|
3725
|
+
sidebarExtra: u,
|
|
3726
|
+
children: h,
|
|
3727
|
+
className: f,
|
|
3728
|
+
defaultOpen: p = !0,
|
|
3729
|
+
enableSearch: g,
|
|
3730
|
+
enablePinning: y,
|
|
3731
|
+
onPinToggle: v,
|
|
3732
|
+
enableReorder: b,
|
|
3733
|
+
onReorder: w
|
|
3734
|
+
}) {
|
|
3735
|
+
const j = r ?? ((F) => !(F === !1 || F === "false")), C = o ?? (() => !0), R = M(
|
|
3736
|
+
() => (e.menu ?? []).map((F, le) => Rr(F, le)),
|
|
3737
|
+
[e.menu]
|
|
3738
|
+
), E = e.navigation ?? R, N = e.areas ?? [], [x, S] = K(
|
|
3739
|
+
() => N.length > 0 ? N[0].id : null
|
|
3740
|
+
), D = N.map((F) => F.id).join(",");
|
|
3741
|
+
k(() => {
|
|
3742
|
+
N.length > 0 ? S(
|
|
3743
|
+
(F) => N.some((le) => le.id === F) ? F : N[0].id
|
|
3744
|
+
) : S(null);
|
|
3745
|
+
}, [e.name, D]);
|
|
3746
|
+
const A = N.find((F) => F.id === x)?.navigation ?? E, B = {
|
|
3747
|
+
title: e.title,
|
|
3748
|
+
favicon: e.favicon,
|
|
3749
|
+
logo: e.logo
|
|
3750
|
+
}, z = /* @__PURE__ */ l.jsx(
|
|
3751
|
+
Is,
|
|
3752
|
+
{
|
|
3753
|
+
schema: e,
|
|
3754
|
+
basePath: t,
|
|
3755
|
+
evalVis: j,
|
|
3756
|
+
checkPerm: C,
|
|
3757
|
+
onAction: s,
|
|
3758
|
+
sidebarHeader: a,
|
|
3759
|
+
sidebarFooter: c,
|
|
3760
|
+
sidebarExtra: u,
|
|
3761
|
+
activeAreaId: x,
|
|
3762
|
+
setActiveAreaId: S,
|
|
3763
|
+
resolvedNavigation: A,
|
|
3764
|
+
enableSearch: g,
|
|
3765
|
+
enablePinning: y,
|
|
3766
|
+
onPinToggle: v,
|
|
3767
|
+
enableReorder: b,
|
|
3768
|
+
onReorder: w
|
|
3769
|
+
}
|
|
3770
|
+
), G = n === "bottom_nav";
|
|
3771
|
+
return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
|
|
3772
|
+
/* @__PURE__ */ l.jsx(
|
|
3773
|
+
In,
|
|
3774
|
+
{
|
|
3775
|
+
sidebar: z,
|
|
3776
|
+
navbar: i,
|
|
3777
|
+
className: f,
|
|
3778
|
+
defaultOpen: p,
|
|
3779
|
+
branding: B,
|
|
3780
|
+
children: h
|
|
3781
|
+
}
|
|
3782
|
+
),
|
|
3783
|
+
G && /* @__PURE__ */ l.jsx(As, { items: A, basePath: t })
|
|
3784
|
+
] });
|
|
3785
|
+
}
|
|
3786
|
+
const Os = (e) => e ? Array.isArray(e) ? e : [e] : [];
|
|
3787
|
+
function Ws({ schema: e, className: t, style: n, id: r, ...o }) {
|
|
3788
|
+
const s = Os(e.children);
|
|
3789
|
+
return /* @__PURE__ */ l.jsxs(
|
|
395
3790
|
"div",
|
|
396
3791
|
{
|
|
397
|
-
id:
|
|
398
|
-
className:
|
|
399
|
-
style:
|
|
3792
|
+
id: r || e.id,
|
|
3793
|
+
className: it("flex flex-col h-full space-y-4", t),
|
|
3794
|
+
style: n,
|
|
400
3795
|
children: [
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
|
|
3796
|
+
/* @__PURE__ */ l.jsx(
|
|
3797
|
+
Mt,
|
|
403
3798
|
{
|
|
404
|
-
title:
|
|
405
|
-
description:
|
|
3799
|
+
title: e.title,
|
|
3800
|
+
description: e.description
|
|
406
3801
|
}
|
|
407
3802
|
),
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
-
|
|
3803
|
+
/* @__PURE__ */ l.jsx("div", { className: "flex-1 overflow-auto", children: s.map((i, a) => /* @__PURE__ */ l.jsx(
|
|
3804
|
+
jr,
|
|
410
3805
|
{
|
|
411
|
-
schema:
|
|
412
|
-
...
|
|
3806
|
+
schema: i,
|
|
3807
|
+
...o
|
|
413
3808
|
},
|
|
414
|
-
|
|
3809
|
+
i?.id || a
|
|
415
3810
|
)) })
|
|
416
3811
|
]
|
|
417
3812
|
}
|
|
418
3813
|
);
|
|
419
3814
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
/* @__PURE__ */
|
|
427
|
-
|
|
3815
|
+
function Ms(e) {
|
|
3816
|
+
return "items" in e && !("href" in e);
|
|
3817
|
+
}
|
|
3818
|
+
function ks({ item: e, pathname: t }) {
|
|
3819
|
+
return e.children && e.children.length > 0 ? /* @__PURE__ */ l.jsx(Rn, { asChild: !0, defaultOpen: !0, className: "group/collapsible", children: /* @__PURE__ */ l.jsxs(ze, { children: [
|
|
3820
|
+
/* @__PURE__ */ l.jsx(jn, { asChild: !0, children: /* @__PURE__ */ l.jsxs(Fe, { tooltip: e.title, children: [
|
|
3821
|
+
e.icon && /* @__PURE__ */ l.jsx(e.icon, {}),
|
|
3822
|
+
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
|
3823
|
+
e.badge != null && /* @__PURE__ */ l.jsx(Ke, { variant: e.badgeVariant || "default", className: "ml-auto mr-1 h-5 min-w-5 px-1 text-xs", children: e.badge }),
|
|
3824
|
+
/* @__PURE__ */ l.jsx(Sr, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
|
|
3825
|
+
] }) }),
|
|
3826
|
+
/* @__PURE__ */ l.jsx(Dn, { children: /* @__PURE__ */ l.jsx(xr, { children: e.children.map((n) => /* @__PURE__ */ l.jsx(mr, { children: /* @__PURE__ */ l.jsx(yr, { asChild: !0, isActive: t === n.href, children: /* @__PURE__ */ l.jsxs(sn, { to: n.href, children: [
|
|
3827
|
+
n.icon && /* @__PURE__ */ l.jsx(n.icon, {}),
|
|
3828
|
+
/* @__PURE__ */ l.jsx("span", { children: n.title }),
|
|
3829
|
+
n.badge != null && /* @__PURE__ */ l.jsx(Ke, { variant: n.badgeVariant || "default", className: "ml-auto h-5 min-w-5 px-1 text-xs", children: n.badge })
|
|
3830
|
+
] }) }) }, n.href)) }) })
|
|
3831
|
+
] }) }) : /* @__PURE__ */ l.jsx(ze, { children: /* @__PURE__ */ l.jsx(Fe, { asChild: !0, isActive: t === e.href, tooltip: e.title, children: /* @__PURE__ */ l.jsxs(sn, { to: e.href, children: [
|
|
3832
|
+
e.icon && /* @__PURE__ */ l.jsx(e.icon, {}),
|
|
3833
|
+
/* @__PURE__ */ l.jsx("span", { children: e.title }),
|
|
3834
|
+
e.badge != null && /* @__PURE__ */ l.jsx(Ke, { variant: e.badgeVariant || "default", className: "ml-auto h-5 min-w-5 px-1 text-xs", children: e.badge })
|
|
428
3835
|
] }) }) });
|
|
429
3836
|
}
|
|
430
|
-
function
|
|
431
|
-
|
|
3837
|
+
function Us({ items: e, title: t = "Application", className: n, collapsible: r = "icon", searchEnabled: o = !1, searchPlaceholder: s = "Search..." }) {
|
|
3838
|
+
const i = zt(), [a, c] = W.useState(""), u = W.useMemo(() => e.length === 0 ? [] : Ms(e[0]) ? e.map((f) => ({ groupLabel: f.label, items: f.items })) : [{ items: e }], [e]), h = W.useMemo(() => {
|
|
3839
|
+
if (!a) return u;
|
|
3840
|
+
const f = a.toLowerCase();
|
|
3841
|
+
return u.map((p) => ({
|
|
3842
|
+
...p,
|
|
3843
|
+
items: p.items.filter(
|
|
3844
|
+
(g) => g.title.toLowerCase().includes(f) || g.children?.some((y) => y.title.toLowerCase().includes(f))
|
|
3845
|
+
)
|
|
3846
|
+
})).filter((p) => p.items.length > 0);
|
|
3847
|
+
}, [u, a]);
|
|
3848
|
+
return /* @__PURE__ */ l.jsx(Nn, { className: n, collapsible: r, children: /* @__PURE__ */ l.jsxs(En, { children: [
|
|
3849
|
+
o && /* @__PURE__ */ l.jsx("div", { className: "px-3 py-2", children: /* @__PURE__ */ l.jsxs("div", { className: "relative", children: [
|
|
3850
|
+
/* @__PURE__ */ l.jsx(wr, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }),
|
|
3851
|
+
/* @__PURE__ */ l.jsx(
|
|
3852
|
+
br,
|
|
3853
|
+
{
|
|
3854
|
+
type: "search",
|
|
3855
|
+
placeholder: s,
|
|
3856
|
+
value: a,
|
|
3857
|
+
onChange: (f) => c(f.target.value),
|
|
3858
|
+
className: "pl-8 h-9"
|
|
3859
|
+
}
|
|
3860
|
+
)
|
|
3861
|
+
] }) }),
|
|
3862
|
+
h.map((f, p) => /* @__PURE__ */ l.jsxs(Pe, { children: [
|
|
3863
|
+
/* @__PURE__ */ l.jsx(wt, { children: f.groupLabel || t }),
|
|
3864
|
+
/* @__PURE__ */ l.jsx(_e, { children: /* @__PURE__ */ l.jsx(je, { children: f.items.map((g) => /* @__PURE__ */ l.jsx(ks, { item: g, pathname: i.pathname }, g.href)) }) })
|
|
3865
|
+
] }, f.groupLabel || p))
|
|
3866
|
+
] }) });
|
|
3867
|
+
}
|
|
3868
|
+
function Ls() {
|
|
3869
|
+
Ne.register("page-header", Mt, {
|
|
432
3870
|
namespace: "layout",
|
|
433
3871
|
label: "Page Header",
|
|
434
3872
|
category: "Layout",
|
|
@@ -436,16 +3874,16 @@ function Ne() {
|
|
|
436
3874
|
{ name: "title", type: "string" },
|
|
437
3875
|
{ name: "description", type: "string" }
|
|
438
3876
|
]
|
|
439
|
-
}),
|
|
3877
|
+
}), Ne.register("page:header", Mt, { namespace: "layout" }), Ne.register("page:card", Ir, {
|
|
440
3878
|
namespace: "layout",
|
|
441
3879
|
label: "Page Card",
|
|
442
3880
|
category: "Layout",
|
|
443
3881
|
isContainer: !0
|
|
444
|
-
}),
|
|
3882
|
+
}), Ne.register("app-shell", In, {
|
|
445
3883
|
namespace: "layout",
|
|
446
3884
|
label: "App Shell",
|
|
447
3885
|
category: "Layout"
|
|
448
|
-
}),
|
|
3886
|
+
}), Ne.register("responsive-grid", kr, {
|
|
449
3887
|
namespace: "layout",
|
|
450
3888
|
label: "Responsive Grid",
|
|
451
3889
|
category: "Layout",
|
|
@@ -454,19 +3892,42 @@ function Ne() {
|
|
|
454
3892
|
{ name: "columns", type: "object" },
|
|
455
3893
|
{ name: "gap", type: "number" }
|
|
456
3894
|
]
|
|
3895
|
+
}), Ne.register("navigation-renderer", Kn, {
|
|
3896
|
+
namespace: "layout",
|
|
3897
|
+
label: "Navigation Renderer",
|
|
3898
|
+
category: "Layout",
|
|
3899
|
+
inputs: [
|
|
3900
|
+
{ name: "items", type: "object" },
|
|
3901
|
+
{ name: "basePath", type: "string" }
|
|
3902
|
+
]
|
|
3903
|
+
}), Ne.register("app-schema-renderer", Ts, {
|
|
3904
|
+
namespace: "layout",
|
|
3905
|
+
label: "App Schema Renderer",
|
|
3906
|
+
category: "Layout",
|
|
3907
|
+
isContainer: !0,
|
|
3908
|
+
inputs: [
|
|
3909
|
+
{ name: "schema", type: "object" },
|
|
3910
|
+
{ name: "basePath", type: "string" },
|
|
3911
|
+
{ name: "mobileNavMode", type: "string" }
|
|
3912
|
+
]
|
|
457
3913
|
});
|
|
458
3914
|
}
|
|
459
3915
|
try {
|
|
460
|
-
|
|
3916
|
+
Ls();
|
|
461
3917
|
} catch {
|
|
462
3918
|
}
|
|
463
3919
|
export {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
3920
|
+
Ts as AppSchemaRenderer,
|
|
3921
|
+
In as AppShell,
|
|
3922
|
+
Kn as NavigationRenderer,
|
|
3923
|
+
Ws as Page,
|
|
3924
|
+
Ir as PageCard,
|
|
3925
|
+
Mt as PageHeader,
|
|
3926
|
+
kr as ResponsiveGrid,
|
|
3927
|
+
Us as SidebarNav,
|
|
3928
|
+
Jn as filterNavigationItems,
|
|
3929
|
+
Ls as registerLayout,
|
|
3930
|
+
ot as resolveIcon,
|
|
3931
|
+
ge as resolveLabel,
|
|
3932
|
+
Ar as useAppShellBranding
|
|
472
3933
|
};
|