@object-ui/layout 4.0.1 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,207 +1,31 @@
1
1
  import { ComponentRegistry as e } from "@object-ui/core";
2
- import t, { createContext as n, memo as r, useCallback as i, useContext as a, useEffect as o, useLayoutEffect as s, useMemo as c, useReducer as l, useRef as u, useState as d } from "react";
3
- import { Badge as f, Collapsible as p, CollapsibleContent as m, CollapsibleTrigger as h, Input as g, Separator as _, Sidebar as v, SidebarContent as y, SidebarFooter as b, SidebarGroup as x, SidebarGroupContent as S, SidebarGroupLabel as C, SidebarHeader as w, SidebarInput as T, SidebarInset as E, SidebarMenu as D, SidebarMenuAction as O, SidebarMenuButton as k, SidebarMenuItem as A, SidebarMenuSub as j, SidebarMenuSubButton as M, SidebarMenuSubItem as ee, SidebarProvider as N, cn as P, getLazyIcon as F } from "@object-ui/components";
4
- import { Link as I, NavLink as te, useLocation as L } from "react-router-dom";
5
- import { ChevronRight as R, FileText as ne, GripVertical as z, Layers as B, Pin as re, PinOff as ie, Search as ae, Star as V } from "lucide-react";
6
- import { createPortal as H, unstable_batchedUpdates as oe } from "react-dom";
7
- import { menuItemToNavigationItem as U } from "@object-ui/types";
8
- import { SchemaRenderer as se } from "@object-ui/react";
9
- //#region \0rolldown/runtime.js
10
- var W = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ce = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (e, t) => (typeof require < "u" ? require : e)[t] }) : e)(function(e) {
11
- if (typeof require < "u") return require.apply(this, arguments);
12
- throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
13
- }), le = /* @__PURE__ */ W(((e) => {
14
- var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
15
- function r(e, n, r) {
16
- var i = null;
17
- if (r !== void 0 && (i = "" + r), n.key !== void 0 && (i = "" + n.key), "key" in n) for (var a in r = {}, n) a !== "key" && (r[a] = n[a]);
18
- else r = n;
19
- return n = r.ref, {
20
- $$typeof: t,
21
- type: e,
22
- key: i,
23
- ref: n === void 0 ? null : n,
24
- props: r
25
- };
26
- }
27
- e.Fragment = n, e.jsx = r, e.jsxs = r;
28
- })), ue = /* @__PURE__ */ W(((e) => {
29
- process.env.NODE_ENV !== "production" && (function() {
30
- function t(e) {
31
- if (e == null) return null;
32
- if (typeof e == "function") return e.$$typeof === O ? null : e.displayName || e.name || null;
33
- if (typeof e == "string") return e;
34
- switch (e) {
35
- case _: return "Fragment";
36
- case y: return "Profiler";
37
- case v: return "StrictMode";
38
- case C: return "Suspense";
39
- case w: return "SuspenseList";
40
- case D: return "Activity";
41
- }
42
- if (typeof e == "object") switch (typeof e.tag == "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), e.$$typeof) {
43
- case g: return "Portal";
44
- case x: return e.displayName || "Context";
45
- case b: return (e._context.displayName || "Context") + ".Consumer";
46
- case S:
47
- var n = e.render;
48
- return e = e.displayName, e ||= (e = n.displayName || n.name || "", e === "" ? "ForwardRef" : "ForwardRef(" + e + ")"), e;
49
- case T: return n = e.displayName || null, n === null ? t(e.type) || "Memo" : n;
50
- case E:
51
- n = e._payload, e = e._init;
52
- try {
53
- return t(e(n));
54
- } catch {}
55
- }
56
- return null;
57
- }
58
- function n(e) {
59
- return "" + e;
60
- }
61
- function r(e) {
62
- try {
63
- n(e);
64
- var t = !1;
65
- } catch {
66
- t = !0;
67
- }
68
- if (t) {
69
- t = console;
70
- var r = t.error, i = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
71
- return r.call(t, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", i), n(e);
72
- }
73
- }
74
- function i(e) {
75
- if (e === _) return "<>";
76
- if (typeof e == "object" && e && e.$$typeof === E) return "<...>";
77
- try {
78
- var n = t(e);
79
- return n ? "<" + n + ">" : "<...>";
80
- } catch {
81
- return "<...>";
82
- }
83
- }
84
- function a() {
85
- var e = k.A;
86
- return e === null ? null : e.getOwner();
87
- }
88
- function o() {
89
- return Error("react-stack-top-frame");
90
- }
91
- function s(e) {
92
- if (A.call(e, "key")) {
93
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
94
- if (t && t.isReactWarning) return !1;
95
- }
96
- return e.key !== void 0;
97
- }
98
- function c(e, t) {
99
- function n() {
100
- ee || (ee = !0, console.error("%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)", t));
101
- }
102
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
103
- get: n,
104
- configurable: !0
105
- });
106
- }
107
- function l() {
108
- var e = t(this.type);
109
- return N[e] || (N[e] = !0, console.error("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.")), e = this.props.ref, e === void 0 ? null : e;
110
- }
111
- function u(e, t, n, r, i, a) {
112
- var o = n.ref;
113
- return e = {
114
- $$typeof: h,
115
- type: e,
116
- key: t,
117
- props: n,
118
- _owner: r
119
- }, (o === void 0 ? null : o) === null ? Object.defineProperty(e, "ref", {
120
- enumerable: !1,
121
- value: null
122
- }) : Object.defineProperty(e, "ref", {
123
- enumerable: !1,
124
- get: l
125
- }), e._store = {}, Object.defineProperty(e._store, "validated", {
126
- configurable: !1,
127
- enumerable: !1,
128
- writable: !0,
129
- value: 0
130
- }), Object.defineProperty(e, "_debugInfo", {
131
- configurable: !1,
132
- enumerable: !1,
133
- writable: !0,
134
- value: null
135
- }), Object.defineProperty(e, "_debugStack", {
136
- configurable: !1,
137
- enumerable: !1,
138
- writable: !0,
139
- value: i
140
- }), Object.defineProperty(e, "_debugTask", {
141
- configurable: !1,
142
- enumerable: !1,
143
- writable: !0,
144
- value: a
145
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
146
- }
147
- function d(e, n, i, o, l, d) {
148
- var p = n.children;
149
- if (p !== void 0) if (o) if (j(p)) {
150
- for (o = 0; o < p.length; o++) f(p[o]);
151
- Object.freeze && Object.freeze(p);
152
- } else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
153
- else f(p);
154
- if (A.call(n, "key")) {
155
- p = t(e);
156
- var m = Object.keys(n).filter(function(e) {
157
- return e !== "key";
158
- });
159
- o = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", I[p + o] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error("A props object containing a \"key\" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />", o, p, m, p), I[p + o] = !0);
160
- }
161
- if (p = null, i !== void 0 && (r(i), p = "" + i), s(n) && (r(n.key), p = "" + n.key), "key" in n) for (var h in i = {}, n) h !== "key" && (i[h] = n[h]);
162
- else i = n;
163
- return p && c(i, typeof e == "function" ? e.displayName || e.name || "Unknown" : e), u(e, p, i, a(), l, d);
164
- }
165
- function f(e) {
166
- p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e && e.$$typeof === E && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
167
- }
168
- function p(e) {
169
- return typeof e == "object" && !!e && e.$$typeof === h;
170
- }
171
- var m = ce("react"), h = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), _ = Symbol.for("react.fragment"), v = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), x = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), T = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), O = Symbol.for("react.client.reference"), k = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, j = Array.isArray, M = console.createTask ? console.createTask : function() {
172
- return null;
173
- };
174
- m = { react_stack_bottom_frame: function(e) {
175
- return e();
176
- } };
177
- var ee, N = {}, P = m.react_stack_bottom_frame.bind(m, o)(), F = M(i(o)), I = {};
178
- e.Fragment = _, e.jsx = function(e, t, n) {
179
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
180
- return d(e, t, n, !1, r ? Error("react-stack-top-frame") : P, r ? M(i(e)) : F);
181
- }, e.jsxs = function(e, t, n) {
182
- var r = 1e4 > k.recentlyCreatedOwnerStacks++;
183
- return d(e, t, n, !0, r ? Error("react-stack-top-frame") : P, r ? M(i(e)) : F);
184
- };
185
- })();
186
- })), G = (/* @__PURE__ */ W(((e, t) => {
187
- process.env.NODE_ENV === "production" ? t.exports = le() : t.exports = ue();
188
- })))();
189
- function de({ title: e, description: t, action: n, className: r, children: i, ...a }) {
190
- return /* @__PURE__ */ (0, G.jsx)("div", {
191
- className: P("flex flex-col gap-4 pb-4 md:pb-8", r),
2
+ import t, { useEffect as n, useMemo as r, useState as i } from "react";
3
+ import { Badge as a, Collapsible as o, CollapsibleContent as s, CollapsibleTrigger as c, Input as l, Separator as u, Sidebar as d, SidebarContent as f, SidebarFooter as p, SidebarGroup as m, SidebarGroupContent as h, SidebarGroupLabel as g, SidebarHeader as _, SidebarInput as v, SidebarInset as y, SidebarMenu as b, SidebarMenuAction as x, SidebarMenuButton as S, SidebarMenuItem as C, SidebarMenuSub as w, SidebarMenuSubButton as T, SidebarMenuSubItem as E, SidebarProvider as D, cn as O, getLazyIcon as k } from "@object-ui/components";
4
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
5
+ import { Link as N, NavLink as P, useLocation as F } from "react-router-dom";
6
+ import { ChevronRight as I, FileText as L, GripVertical as R, Layers as z, Pin as B, PinOff as V, Search as H, Star as ee } from "lucide-react";
7
+ import { DndContext as te, KeyboardSensor as ne, PointerSensor as re, closestCenter as ie, useSensor as U, useSensors as ae } from "@dnd-kit/core";
8
+ import { SortableContext as oe, arrayMove as se, useSortable as ce, verticalListSortingStrategy as le } from "@dnd-kit/sortable";
9
+ import { CSS as ue } from "@dnd-kit/utilities";
10
+ import { menuItemToNavigationItem as de } from "@object-ui/types";
11
+ import { SchemaRenderer as fe } from "@object-ui/react";
12
+ //#region src/PageHeader.tsx
13
+ function W({ title: e, description: t, action: n, className: r, children: i, ...a }) {
14
+ return /* @__PURE__ */ j("div", {
15
+ className: O("flex flex-col gap-4 pb-4 md:pb-8", r),
192
16
  ...a,
193
- children: /* @__PURE__ */ (0, G.jsxs)("div", {
17
+ children: /* @__PURE__ */ M("div", {
194
18
  className: "flex flex-wrap items-end gap-x-4 gap-y-2",
195
- children: [/* @__PURE__ */ (0, G.jsxs)("div", {
19
+ children: [/* @__PURE__ */ M("div", {
196
20
  className: "flex flex-col gap-1 min-w-0",
197
- children: [/* @__PURE__ */ (0, G.jsx)("h1", {
21
+ children: [/* @__PURE__ */ j("h1", {
198
22
  className: "text-2xl font-bold tracking-tight md:text-3xl truncate",
199
23
  children: e
200
- }), t && /* @__PURE__ */ (0, G.jsx)("p", {
24
+ }), t && /* @__PURE__ */ j("p", {
201
25
  className: "text-sm text-muted-foreground",
202
26
  children: t
203
27
  })]
204
- }), (n || i) && /* @__PURE__ */ (0, G.jsxs)("div", {
28
+ }), (n || i) && /* @__PURE__ */ M("div", {
205
29
  className: "flex items-center gap-2 ml-auto sm:ml-0",
206
30
  children: [n, i]
207
31
  })]
@@ -210,7 +34,7 @@ function de({ title: e, description: t, action: n, className: r, children: i, ..
210
34
  }
211
35
  //#endregion
212
36
  //#region src/AppShell.tsx
213
- function K(e) {
37
+ function G(e) {
214
38
  let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
215
39
  if (!t) return null;
216
40
  let n = parseInt(t[1], 16) / 255, r = parseInt(t[2], 16) / 255, i = parseInt(t[3], 16) / 255, a = Math.max(n, r, i), o = Math.min(n, r, i), s = 0, c = 0, l = (a + o) / 2;
@@ -234,17 +58,17 @@ function K(e) {
234
58
  l: l * 100
235
59
  };
236
60
  }
237
- function fe(e) {
238
- let t = K(e);
61
+ function K(e) {
62
+ let t = G(e);
239
63
  return t ? `${Math.round(t.h)} ${Math.round(t.s)}% ${Math.round(t.l)}%` : null;
240
64
  }
241
- function pe(e) {
242
- let t = K(e);
65
+ function q(e) {
66
+ let t = G(e);
243
67
  if (!t) return null;
244
68
  let n = Math.max(t.l, 65), r = t.s > 80 ? Math.max(t.s - 10, 70) : t.s;
245
69
  return `${Math.round(t.h)} ${Math.round(r)}% ${Math.round(n)}%`;
246
70
  }
247
- function me(e) {
71
+ function pe(e) {
248
72
  let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
249
73
  if (!t) return "0 0% 100%";
250
74
  let n = (e) => {
@@ -253,16 +77,16 @@ function me(e) {
253
77
  }, r = n(parseInt(t[1], 16)), i = n(parseInt(t[2], 16)), a = n(parseInt(t[3], 16));
254
78
  return .2126 * r + .7152 * i + .0722 * a > .6 ? "222 47% 11%" : "0 0% 100%";
255
79
  }
256
- function he(e, t) {
257
- o(() => {
80
+ function me(e, t) {
81
+ n(() => {
258
82
  let n = document.documentElement, r = () => n.classList.contains("dark"), i = () => {
259
83
  if (e?.primaryColor) {
260
- let t = fe(e.primaryColor), i = pe(e.primaryColor), a = r() && i || t;
261
- a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : me(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
84
+ let t = K(e.primaryColor), i = q(e.primaryColor), a = r() && i || t;
85
+ a && (n.style.setProperty("--brand-primary", e.primaryColor), n.style.setProperty("--brand-primary-hsl", t || a), n.style.setProperty("--primary", a), n.style.setProperty("--primary-foreground", r() ? "222 47% 11%" : pe(e.primaryColor)), n.style.setProperty("--ring", a), n.style.setProperty("--sidebar-primary", a), n.style.setProperty("--sidebar-ring", a));
262
86
  } else n.style.removeProperty("--brand-primary"), n.style.removeProperty("--brand-primary-hsl"), n.style.removeProperty("--primary"), n.style.removeProperty("--primary-foreground"), n.style.removeProperty("--ring"), n.style.removeProperty("--sidebar-primary"), n.style.removeProperty("--sidebar-ring");
263
87
  if (e?.accentColor) {
264
- let t = fe(e.accentColor), i = pe(e.accentColor), a = r() && i || t;
265
- a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : me(e.accentColor)));
88
+ let t = K(e.accentColor), i = q(e.accentColor), a = r() && i || t;
89
+ a && (n.style.setProperty("--brand-accent", e.accentColor), n.style.setProperty("--brand-accent-hsl", t || a), n.style.setProperty("--accent", a), n.style.setProperty("--accent-foreground", r() ? "222 47% 11%" : pe(e.accentColor)));
266
90
  } else n.style.removeProperty("--brand-accent"), n.style.removeProperty("--brand-accent-hsl"), n.style.removeProperty("--accent"), n.style.removeProperty("--accent-foreground");
267
91
  };
268
92
  i();
@@ -289,19 +113,19 @@ function he(e, t) {
289
113
  t
290
114
  ]);
291
115
  }
292
- function ge({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a }) {
293
- return he(a, a?.title), /* @__PURE__ */ (0, G.jsxs)(N, {
116
+ function J({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i = !0, branding: a }) {
117
+ return me(a, a?.title), /* @__PURE__ */ M(D, {
294
118
  defaultOpen: i,
295
119
  className: "!flex-col",
296
- children: [/* @__PURE__ */ (0, G.jsx)("header", {
120
+ children: [/* @__PURE__ */ j("header", {
297
121
  className: "sticky top-0 z-30 flex h-14 w-full shrink-0 items-center gap-2 border-b bg-background px-2 sm:px-4",
298
122
  children: t
299
- }), /* @__PURE__ */ (0, G.jsxs)("div", {
123
+ }), /* @__PURE__ */ M("div", {
300
124
  className: "flex flex-1 min-h-0 w-full",
301
- children: [e, /* @__PURE__ */ (0, G.jsx)(E, {
125
+ children: [e, /* @__PURE__ */ j(y, {
302
126
  className: "min-w-0",
303
- children: /* @__PURE__ */ (0, G.jsx)("main", {
304
- className: P("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r),
127
+ children: /* @__PURE__ */ j("main", {
128
+ className: O("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", r),
305
129
  children: n
306
130
  })
307
131
  })]
@@ -310,11 +134,11 @@ function ge({ sidebar: e, navbar: t, children: n, className: r, defaultOpen: i =
310
134
  }
311
135
  //#endregion
312
136
  //#region src/PageCard.tsx
313
- function _e({ className: e, children: t, ...n }) {
314
- return /* @__PURE__ */ (0, G.jsx)("div", {
315
- className: P("rounded-xl border bg-card text-card-foreground shadow", e),
137
+ function he({ className: e, children: t, ...n }) {
138
+ return /* @__PURE__ */ j("div", {
139
+ className: O("rounded-xl border bg-card text-card-foreground shadow", e),
316
140
  ...n,
317
- children: /* @__PURE__ */ (0, G.jsx)("div", {
141
+ children: /* @__PURE__ */ j("div", {
318
142
  className: "p-6",
319
143
  children: t
320
144
  })
@@ -322,7 +146,7 @@ function _e({ className: e, children: t, ...n }) {
322
146
  }
323
147
  //#endregion
324
148
  //#region src/ResponsiveGrid.tsx
325
- var ve = {
149
+ var ge = {
326
150
  xs: {
327
151
  1: "grid-cols-1",
328
152
  2: "grid-cols-2",
@@ -372,11 +196,11 @@ var ve = {
372
196
  12: "2xl:grid-cols-12"
373
197
  }
374
198
  };
375
- function ye(e) {
199
+ function _e(e) {
376
200
  if (!e) return "grid-cols-1";
377
201
  let t = [];
378
202
  for (let [n, r] of Object.entries(e)) {
379
- let e = ve[n];
203
+ let e = ge[n];
380
204
  if (e && r) {
381
205
  let n = Object.keys(e).map(Number).reduce((e, t) => Math.abs(t - r) < Math.abs(e - r) ? t : e);
382
206
  t.push(e[n]);
@@ -384,7 +208,7 @@ function ye(e) {
384
208
  }
385
209
  return t.join(" ") || "grid-cols-1";
386
210
  }
387
- var be = {
211
+ var ve = {
388
212
  0: "gap-0",
389
213
  1: "gap-1",
390
214
  2: "gap-2",
@@ -393,2215 +217,16 @@ var be = {
393
217
  5: "gap-5",
394
218
  6: "gap-6",
395
219
  8: "gap-8"
396
- }, xe = ({ columns: e, gap: t = 4, className: n, children: r }) => /* @__PURE__ */ (0, G.jsx)("div", {
397
- className: P("grid", ye(e), typeof t == "number" ? be[t] || `gap-${t}` : "", n),
220
+ }, ye = ({ columns: e, gap: t = 4, className: n, children: r }) => /* @__PURE__ */ j("div", {
221
+ className: O("grid", _e(e), typeof t == "number" ? ve[t] || `gap-${t}` : "", n),
398
222
  children: r
399
223
  });
400
224
  //#endregion
401
- //#region ../../node_modules/.pnpm/@dnd-kit+utilities@3.2.2_react@19.2.5/node_modules/@dnd-kit/utilities/dist/utilities.esm.js
402
- function Se() {
403
- var e = [...arguments];
404
- return c(() => (t) => {
405
- e.forEach((e) => e(t));
406
- }, e);
407
- }
408
- var Ce = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
409
- function we(e) {
410
- let t = Object.prototype.toString.call(e);
411
- return t === "[object Window]" || t === "[object global]";
412
- }
413
- function Te(e) {
414
- return "nodeType" in e;
415
- }
416
- function q(e) {
417
- return e ? we(e) ? e : Te(e) ? e.ownerDocument?.defaultView ?? window : window : window;
418
- }
419
- function Ee(e) {
420
- let { Document: t } = q(e);
421
- return e instanceof t;
422
- }
423
- function De(e) {
424
- return we(e) ? !1 : e instanceof q(e).HTMLElement;
425
- }
426
- function Oe(e) {
427
- return e instanceof q(e).SVGElement;
428
- }
429
- function ke(e) {
430
- return e ? we(e) ? e.document : Te(e) ? Ee(e) ? e : De(e) || Oe(e) ? e.ownerDocument : document : document : document;
431
- }
432
- var J = Ce ? s : o;
433
- function Ae(e) {
434
- let t = u(e);
435
- return J(() => {
436
- t.current = e;
437
- }), i(function() {
438
- var e = [...arguments];
439
- return t.current == null ? void 0 : t.current(...e);
440
- }, []);
441
- }
442
- function je() {
443
- let e = u(null);
444
- return [i((t, n) => {
445
- e.current = setInterval(t, n);
446
- }, []), i(() => {
447
- e.current !== null && (clearInterval(e.current), e.current = null);
448
- }, [])];
449
- }
450
- function Me(e, t) {
451
- t === void 0 && (t = [e]);
452
- let n = u(e);
453
- return J(() => {
454
- n.current !== e && (n.current = e);
455
- }, t), n;
456
- }
457
- function Ne(e, t) {
458
- let n = u();
459
- return c(() => {
460
- let t = e(n.current);
461
- return n.current = t, t;
462
- }, [...t]);
463
- }
464
- function Pe(e) {
465
- let t = Ae(e), n = u(null);
466
- return [n, i((e) => {
467
- e !== n.current && t?.(e, n.current), n.current = e;
468
- }, [])];
469
- }
470
- function Fe(e) {
471
- let t = u();
472
- return o(() => {
473
- t.current = e;
474
- }, [e]), t.current;
475
- }
476
- var Ie = {};
477
- function Le(e, t) {
478
- return c(() => {
479
- if (t) return t;
480
- let n = Ie[e] == null ? 0 : Ie[e] + 1;
481
- return Ie[e] = n, e + "-" + n;
482
- }, [e, t]);
483
- }
484
- function Re(e) {
485
- return function(t) {
486
- return [...arguments].slice(1).reduce((t, n) => {
487
- let r = Object.entries(n);
488
- for (let [n, i] of r) {
489
- let r = t[n];
490
- r != null && (t[n] = r + e * i);
491
- }
492
- return t;
493
- }, { ...t });
494
- };
495
- }
496
- var ze = /* @__PURE__ */ Re(1), Be = /* @__PURE__ */ Re(-1);
497
- function Ve(e) {
498
- return "clientX" in e && "clientY" in e;
499
- }
500
- function He(e) {
501
- if (!e) return !1;
502
- let { KeyboardEvent: t } = q(e.target);
503
- return t && e instanceof t;
504
- }
505
- function Ue(e) {
506
- if (!e) return !1;
507
- let { TouchEvent: t } = q(e.target);
508
- return t && e instanceof t;
509
- }
510
- function We(e) {
511
- if (Ue(e)) {
512
- if (e.touches && e.touches.length) {
513
- let { clientX: t, clientY: n } = e.touches[0];
514
- return {
515
- x: t,
516
- y: n
517
- };
518
- } else if (e.changedTouches && e.changedTouches.length) {
519
- let { clientX: t, clientY: n } = e.changedTouches[0];
520
- return {
521
- x: t,
522
- y: n
523
- };
524
- }
525
- }
526
- return Ve(e) ? {
527
- x: e.clientX,
528
- y: e.clientY
529
- } : null;
530
- }
531
- var Ge = /* @__PURE__ */ Object.freeze({
532
- Translate: { toString(e) {
533
- if (!e) return;
534
- let { x: t, y: n } = e;
535
- return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
536
- } },
537
- Scale: { toString(e) {
538
- if (!e) return;
539
- let { scaleX: t, scaleY: n } = e;
540
- return "scaleX(" + t + ") scaleY(" + n + ")";
541
- } },
542
- Transform: { toString(e) {
543
- if (e) return [Ge.Translate.toString(e), Ge.Scale.toString(e)].join(" ");
544
- } },
545
- Transition: { toString(e) {
546
- let { property: t, duration: n, easing: r } = e;
547
- return t + " " + n + "ms " + r;
548
- } }
549
- }), Ke = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
550
- function qe(e) {
551
- return e.matches(Ke) ? e : e.querySelector(Ke);
552
- }
553
- //#endregion
554
- //#region ../../node_modules/.pnpm/@dnd-kit+accessibility@3.1.1_react@19.2.5/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js
555
- var Je = { display: "none" };
556
- function Ye(e) {
557
- let { id: n, value: r } = e;
558
- return t.createElement("div", {
559
- id: n,
560
- style: Je
561
- }, r);
562
- }
563
- function Xe(e) {
564
- let { id: n, announcement: r, ariaLiveType: i = "assertive" } = e;
565
- return t.createElement("div", {
566
- id: n,
567
- style: {
568
- position: "fixed",
569
- top: 0,
570
- left: 0,
571
- width: 1,
572
- height: 1,
573
- margin: -1,
574
- border: 0,
575
- padding: 0,
576
- overflow: "hidden",
577
- clip: "rect(0 0 0 0)",
578
- clipPath: "inset(100%)",
579
- whiteSpace: "nowrap"
580
- },
581
- role: "status",
582
- "aria-live": i,
583
- "aria-atomic": !0
584
- }, r);
585
- }
586
- function Ze() {
587
- let [e, t] = d("");
588
- return {
589
- announce: i((e) => {
590
- e != null && t(e);
591
- }, []),
592
- announcement: e
593
- };
594
- }
595
- //#endregion
596
- //#region ../../node_modules/.pnpm/@dnd-kit+core@6.3.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/@dnd-kit/core/dist/core.esm.js
597
- var Qe = /* @__PURE__ */ n(null);
598
- function $e(e) {
599
- let t = a(Qe);
600
- o(() => {
601
- if (!t) throw Error("useDndMonitor must be used within a children of <DndContext>");
602
- return t(e);
603
- }, [e, t]);
604
- }
605
- function et() {
606
- let [e] = d(() => /* @__PURE__ */ new Set()), t = i((t) => (e.add(t), () => e.delete(t)), [e]);
607
- return [i((t) => {
608
- let { type: n, event: r } = t;
609
- e.forEach((e) => e[n]?.call(e, r));
610
- }, [e]), t];
611
- }
612
- var tt = { draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " }, nt = {
613
- onDragStart(e) {
614
- let { active: t } = e;
615
- return "Picked up draggable item " + t.id + ".";
616
- },
617
- onDragOver(e) {
618
- let { active: t, over: n } = e;
619
- return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
620
- },
621
- onDragEnd(e) {
622
- let { active: t, over: n } = e;
623
- return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
624
- },
625
- onDragCancel(e) {
626
- let { active: t } = e;
627
- return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
628
- }
629
- };
630
- function rt(e) {
631
- let { announcements: n = nt, container: r, hiddenTextDescribedById: i, screenReaderInstructions: a = tt } = e, { announce: s, announcement: l } = Ze(), u = Le("DndLiveRegion"), [f, p] = d(!1);
632
- if (o(() => {
633
- p(!0);
634
- }, []), $e(c(() => ({
635
- onDragStart(e) {
636
- let { active: t } = e;
637
- s(n.onDragStart({ active: t }));
638
- },
639
- onDragMove(e) {
640
- let { active: t, over: r } = e;
641
- n.onDragMove && s(n.onDragMove({
642
- active: t,
643
- over: r
644
- }));
645
- },
646
- onDragOver(e) {
647
- let { active: t, over: r } = e;
648
- s(n.onDragOver({
649
- active: t,
650
- over: r
651
- }));
652
- },
653
- onDragEnd(e) {
654
- let { active: t, over: r } = e;
655
- s(n.onDragEnd({
656
- active: t,
657
- over: r
658
- }));
659
- },
660
- onDragCancel(e) {
661
- let { active: t, over: r } = e;
662
- s(n.onDragCancel({
663
- active: t,
664
- over: r
665
- }));
666
- }
667
- }), [s, n])), !f) return null;
668
- let m = t.createElement(t.Fragment, null, t.createElement(Ye, {
669
- id: i,
670
- value: a.draggable
671
- }), t.createElement(Xe, {
672
- id: u,
673
- announcement: l
674
- }));
675
- return r ? H(m, r) : m;
676
- }
677
- var Y;
678
- (function(e) {
679
- e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
680
- })(Y ||= {});
681
- function it() {}
682
- function at(e, t) {
683
- return c(() => ({
684
- sensor: e,
685
- options: t ?? {}
686
- }), [e, t]);
687
- }
688
- function ot() {
689
- var e = [...arguments];
690
- return c(() => [...e].filter((e) => e != null), [...e]);
691
- }
692
- var X = /* @__PURE__ */ Object.freeze({
693
- x: 0,
694
- y: 0
695
- });
696
- function st(e, t) {
697
- return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
698
- }
699
- function ct(e, t) {
700
- let { data: { value: n } } = e, { data: { value: r } } = t;
701
- return n - r;
702
- }
703
- function lt(e, t) {
704
- let { data: { value: n } } = e, { data: { value: r } } = t;
705
- return r - n;
706
- }
707
- function ut(e, t) {
708
- if (!e || e.length === 0) return null;
709
- let [n] = e;
710
- return t ? n[t] : n;
711
- }
712
- function dt(e, t, n) {
713
- return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
714
- x: t + e.width * .5,
715
- y: n + e.height * .5
716
- };
717
- }
718
- var ft = (e) => {
719
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = dt(t, t.left, t.top), a = [];
720
- for (let e of r) {
721
- let { id: t } = e, r = n.get(t);
722
- if (r) {
723
- let n = st(dt(r), i);
724
- a.push({
725
- id: t,
726
- data: {
727
- droppableContainer: e,
728
- value: n
729
- }
730
- });
731
- }
732
- }
733
- return a.sort(ct);
734
- };
735
- function pt(e, t) {
736
- let n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), i = Math.min(t.left + t.width, e.left + e.width), a = Math.min(t.top + t.height, e.top + e.height), o = i - r, s = a - n;
737
- if (r < i && n < a) {
738
- let n = t.width * t.height, r = e.width * e.height, i = o * s, a = i / (n + r - i);
739
- return Number(a.toFixed(4));
740
- }
741
- return 0;
742
- }
743
- var mt = (e) => {
744
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = [];
745
- for (let e of r) {
746
- let { id: r } = e, a = n.get(r);
747
- if (a) {
748
- let n = pt(a, t);
749
- n > 0 && i.push({
750
- id: r,
751
- data: {
752
- droppableContainer: e,
753
- value: n
754
- }
755
- });
756
- }
757
- }
758
- return i.sort(lt);
759
- };
760
- function ht(e, t, n) {
761
- return {
762
- ...e,
763
- scaleX: t && n ? t.width / n.width : 1,
764
- scaleY: t && n ? t.height / n.height : 1
765
- };
766
- }
767
- function gt(e, t) {
768
- return e && t ? {
769
- x: e.left - t.left,
770
- y: e.top - t.top
771
- } : X;
772
- }
773
- function _t(e) {
774
- return function(t) {
775
- return [...arguments].slice(1).reduce((t, n) => ({
776
- ...t,
777
- top: t.top + e * n.y,
778
- bottom: t.bottom + e * n.y,
779
- left: t.left + e * n.x,
780
- right: t.right + e * n.x
781
- }), { ...t });
782
- };
783
- }
784
- var vt = /* @__PURE__ */ _t(1);
785
- function yt(e) {
786
- if (e.startsWith("matrix3d(")) {
787
- let t = e.slice(9, -1).split(/, /);
788
- return {
789
- x: +t[12],
790
- y: +t[13],
791
- scaleX: +t[0],
792
- scaleY: +t[5]
793
- };
794
- } else if (e.startsWith("matrix(")) {
795
- let t = e.slice(7, -1).split(/, /);
796
- return {
797
- x: +t[4],
798
- y: +t[5],
799
- scaleX: +t[0],
800
- scaleY: +t[3]
801
- };
802
- }
803
- return null;
804
- }
805
- function bt(e, t, n) {
806
- let r = yt(t);
807
- if (!r) return e;
808
- let { scaleX: i, scaleY: a, x: o, y: s } = r, c = e.left - o - (1 - i) * parseFloat(n), l = e.top - s - (1 - a) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = i ? e.width / i : e.width, d = a ? e.height / a : e.height;
809
- return {
810
- width: u,
811
- height: d,
812
- top: l,
813
- right: c + u,
814
- bottom: l + d,
815
- left: c
816
- };
817
- }
818
- var xt = { ignoreTransform: !1 };
819
- function St(e, t) {
820
- t === void 0 && (t = xt);
821
- let n = e.getBoundingClientRect();
822
- if (t.ignoreTransform) {
823
- let { transform: t, transformOrigin: r } = q(e).getComputedStyle(e);
824
- t && (n = bt(n, t, r));
825
- }
826
- let { top: r, left: i, width: a, height: o, bottom: s, right: c } = n;
827
- return {
828
- top: r,
829
- left: i,
830
- width: a,
831
- height: o,
832
- bottom: s,
833
- right: c
834
- };
835
- }
836
- function Ct(e) {
837
- return St(e, { ignoreTransform: !0 });
838
- }
839
- function wt(e) {
840
- let t = e.innerWidth, n = e.innerHeight;
841
- return {
842
- top: 0,
843
- left: 0,
844
- right: t,
845
- bottom: n,
846
- width: t,
847
- height: n
848
- };
849
- }
850
- function Tt(e, t) {
851
- return t === void 0 && (t = q(e).getComputedStyle(e)), t.position === "fixed";
852
- }
853
- function Et(e, t) {
854
- t === void 0 && (t = q(e).getComputedStyle(e));
855
- let n = /(auto|scroll|overlay)/;
856
- return [
857
- "overflow",
858
- "overflowX",
859
- "overflowY"
860
- ].some((e) => {
861
- let r = t[e];
862
- return typeof r == "string" ? n.test(r) : !1;
863
- });
864
- }
865
- function Dt(e, t) {
866
- let n = [];
867
- function r(i) {
868
- if (t != null && n.length >= t || !i) return n;
869
- if (Ee(i) && i.scrollingElement != null && !n.includes(i.scrollingElement)) return n.push(i.scrollingElement), n;
870
- if (!De(i) || Oe(i) || n.includes(i)) return n;
871
- let a = q(e).getComputedStyle(i);
872
- return i !== e && Et(i, a) && n.push(i), Tt(i, a) ? n : r(i.parentNode);
873
- }
874
- return e ? r(e) : n;
875
- }
876
- function Ot(e) {
877
- let [t] = Dt(e, 1);
878
- return t ?? null;
879
- }
880
- function kt(e) {
881
- return !Ce || !e ? null : we(e) ? e : Te(e) ? Ee(e) || e === ke(e).scrollingElement ? window : De(e) ? e : null : null;
882
- }
883
- function At(e) {
884
- return we(e) ? e.scrollX : e.scrollLeft;
885
- }
886
- function jt(e) {
887
- return we(e) ? e.scrollY : e.scrollTop;
888
- }
889
- function Mt(e) {
890
- return {
891
- x: At(e),
892
- y: jt(e)
893
- };
894
- }
895
- var Z;
896
- (function(e) {
897
- e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
898
- })(Z ||= {});
899
- function Nt(e) {
900
- return !Ce || !e ? !1 : e === document.scrollingElement;
901
- }
902
- function Pt(e) {
903
- let t = {
904
- x: 0,
905
- y: 0
906
- }, n = Nt(e) ? {
907
- height: window.innerHeight,
908
- width: window.innerWidth
909
- } : {
910
- height: e.clientHeight,
911
- width: e.clientWidth
912
- }, r = {
913
- x: e.scrollWidth - n.width,
914
- y: e.scrollHeight - n.height
915
- };
916
- return {
917
- isTop: e.scrollTop <= t.y,
918
- isLeft: e.scrollLeft <= t.x,
919
- isBottom: e.scrollTop >= r.y,
920
- isRight: e.scrollLeft >= r.x,
921
- maxScroll: r,
922
- minScroll: t
923
- };
924
- }
925
- var Ft = {
926
- x: .2,
927
- y: .2
928
- };
929
- function It(e, t, n, r, i) {
930
- let { top: a, left: o, right: s, bottom: c } = n;
931
- r === void 0 && (r = 10), i === void 0 && (i = Ft);
932
- let { isTop: l, isBottom: u, isLeft: d, isRight: f } = Pt(e), p = {
933
- x: 0,
934
- y: 0
935
- }, m = {
936
- x: 0,
937
- y: 0
938
- }, h = {
939
- height: t.height * i.y,
940
- width: t.width * i.x
941
- };
942
- return !l && a <= t.top + h.height ? (p.y = Z.Backward, m.y = r * Math.abs((t.top + h.height - a) / h.height)) : !u && c >= t.bottom - h.height && (p.y = Z.Forward, m.y = r * Math.abs((t.bottom - h.height - c) / h.height)), !f && s >= t.right - h.width ? (p.x = Z.Forward, m.x = r * Math.abs((t.right - h.width - s) / h.width)) : !d && o <= t.left + h.width && (p.x = Z.Backward, m.x = r * Math.abs((t.left + h.width - o) / h.width)), {
943
- direction: p,
944
- speed: m
945
- };
946
- }
947
- function Lt(e) {
948
- if (e === document.scrollingElement) {
949
- let { innerWidth: e, innerHeight: t } = window;
950
- return {
951
- top: 0,
952
- left: 0,
953
- right: e,
954
- bottom: t,
955
- width: e,
956
- height: t
957
- };
958
- }
959
- let { top: t, left: n, right: r, bottom: i } = e.getBoundingClientRect();
960
- return {
961
- top: t,
962
- left: n,
963
- right: r,
964
- bottom: i,
965
- width: e.clientWidth,
966
- height: e.clientHeight
967
- };
968
- }
969
- function Rt(e) {
970
- return e.reduce((e, t) => ze(e, Mt(t)), X);
971
- }
972
- function zt(e) {
973
- return e.reduce((e, t) => e + At(t), 0);
974
- }
975
- function Bt(e) {
976
- return e.reduce((e, t) => e + jt(t), 0);
977
- }
978
- function Vt(e, t) {
979
- if (t === void 0 && (t = St), !e) return;
980
- let { top: n, left: r, bottom: i, right: a } = t(e);
981
- Ot(e) && (i <= 0 || a <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
982
- block: "center",
983
- inline: "center"
984
- });
985
- }
986
- var Ht = [[
987
- "x",
988
- ["left", "right"],
989
- zt
990
- ], [
991
- "y",
992
- ["top", "bottom"],
993
- Bt
994
- ]], Ut = class {
995
- constructor(e, t) {
996
- 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;
997
- let n = Dt(t), r = Rt(n);
998
- this.rect = { ...e }, this.width = e.width, this.height = e.height;
999
- for (let [e, t, i] of Ht) for (let a of t) Object.defineProperty(this, a, {
1000
- get: () => {
1001
- let t = i(n), o = r[e] - t;
1002
- return this.rect[a] + o;
1003
- },
1004
- enumerable: !0
1005
- });
1006
- Object.defineProperty(this, "rect", { enumerable: !1 });
1007
- }
1008
- }, Wt = class {
1009
- constructor(e) {
1010
- this.target = void 0, this.listeners = [], this.removeAll = () => {
1011
- this.listeners.forEach((e) => this.target?.removeEventListener(...e));
1012
- }, this.target = e;
1013
- }
1014
- add(e, t, n) {
1015
- var r;
1016
- (r = this.target) == null || r.addEventListener(e, t, n), this.listeners.push([
1017
- e,
1018
- t,
1019
- n
1020
- ]);
1021
- }
1022
- };
1023
- function Gt(e) {
1024
- let { EventTarget: t } = q(e);
1025
- return e instanceof t ? e : ke(e);
1026
- }
1027
- function Kt(e, t) {
1028
- let n = Math.abs(e.x), r = Math.abs(e.y);
1029
- 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;
1030
- }
1031
- var Q;
1032
- (function(e) {
1033
- e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
1034
- })(Q ||= {});
1035
- function qt(e) {
1036
- e.preventDefault();
1037
- }
1038
- function Jt(e) {
1039
- e.stopPropagation();
1040
- }
1041
- var $;
1042
- (function(e) {
1043
- e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
1044
- })($ ||= {});
1045
- var Yt = {
1046
- start: [$.Space, $.Enter],
1047
- cancel: [$.Esc],
1048
- end: [
1049
- $.Space,
1050
- $.Enter,
1051
- $.Tab
1052
- ]
1053
- }, Xt = (e, t) => {
1054
- let { currentCoordinates: n } = t;
1055
- switch (e.code) {
1056
- case $.Right: return {
1057
- ...n,
1058
- x: n.x + 25
1059
- };
1060
- case $.Left: return {
1061
- ...n,
1062
- x: n.x - 25
1063
- };
1064
- case $.Down: return {
1065
- ...n,
1066
- y: n.y + 25
1067
- };
1068
- case $.Up: return {
1069
- ...n,
1070
- y: n.y - 25
1071
- };
1072
- }
1073
- }, Zt = class {
1074
- constructor(e) {
1075
- this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = e;
1076
- let { event: { target: t } } = e;
1077
- this.props = e, this.listeners = new Wt(ke(t)), this.windowListeners = new Wt(q(t)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
1078
- }
1079
- attach() {
1080
- this.handleStart(), this.windowListeners.add(Q.Resize, this.handleCancel), this.windowListeners.add(Q.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Q.Keydown, this.handleKeyDown));
1081
- }
1082
- handleStart() {
1083
- let { activeNode: e, onStart: t } = this.props, n = e.node.current;
1084
- n && Vt(n), t(X);
1085
- }
1086
- handleKeyDown(e) {
1087
- if (He(e)) {
1088
- let { active: t, context: n, options: r } = this.props, { keyboardCodes: i = Yt, coordinateGetter: a = Xt, scrollBehavior: o = "smooth" } = r, { code: s } = e;
1089
- if (i.end.includes(s)) {
1090
- this.handleEnd(e);
1091
- return;
1092
- }
1093
- if (i.cancel.includes(s)) {
1094
- this.handleCancel(e);
1095
- return;
1096
- }
1097
- let { collisionRect: c } = n.current, l = c ? {
1098
- x: c.left,
1099
- y: c.top
1100
- } : X;
1101
- this.referenceCoordinates ||= l;
1102
- let u = a(e, {
1103
- active: t,
1104
- context: n.current,
1105
- currentCoordinates: l
1106
- });
1107
- if (u) {
1108
- let t = Be(u, l), r = {
1109
- x: 0,
1110
- y: 0
1111
- }, { scrollableAncestors: i } = n.current;
1112
- for (let n of i) {
1113
- let i = e.code, { isTop: a, isRight: s, isLeft: c, isBottom: l, maxScroll: d, minScroll: f } = Pt(n), p = Lt(n), m = {
1114
- x: Math.min(i === $.Right ? p.right - p.width / 2 : p.right, Math.max(i === $.Right ? p.left : p.left + p.width / 2, u.x)),
1115
- y: Math.min(i === $.Down ? p.bottom - p.height / 2 : p.bottom, Math.max(i === $.Down ? p.top : p.top + p.height / 2, u.y))
1116
- }, h = i === $.Right && !s || i === $.Left && !c, g = i === $.Down && !l || i === $.Up && !a;
1117
- if (h && m.x !== u.x) {
1118
- let e = n.scrollLeft + t.x, a = i === $.Right && e <= d.x || i === $.Left && e >= f.x;
1119
- if (a && !t.y) {
1120
- n.scrollTo({
1121
- left: e,
1122
- behavior: o
1123
- });
1124
- return;
1125
- }
1126
- a ? r.x = n.scrollLeft - e : r.x = i === $.Right ? n.scrollLeft - d.x : n.scrollLeft - f.x, r.x && n.scrollBy({
1127
- left: -r.x,
1128
- behavior: o
1129
- });
1130
- break;
1131
- } else if (g && m.y !== u.y) {
1132
- let e = n.scrollTop + t.y, a = i === $.Down && e <= d.y || i === $.Up && e >= f.y;
1133
- if (a && !t.x) {
1134
- n.scrollTo({
1135
- top: e,
1136
- behavior: o
1137
- });
1138
- return;
1139
- }
1140
- a ? r.y = n.scrollTop - e : r.y = i === $.Down ? n.scrollTop - d.y : n.scrollTop - f.y, r.y && n.scrollBy({
1141
- top: -r.y,
1142
- behavior: o
1143
- });
1144
- break;
1145
- }
1146
- }
1147
- this.handleMove(e, ze(Be(u, this.referenceCoordinates), r));
1148
- }
1149
- }
1150
- }
1151
- handleMove(e, t) {
1152
- let { onMove: n } = this.props;
1153
- e.preventDefault(), n(t);
1154
- }
1155
- handleEnd(e) {
1156
- let { onEnd: t } = this.props;
1157
- e.preventDefault(), this.detach(), t();
1158
- }
1159
- handleCancel(e) {
1160
- let { onCancel: t } = this.props;
1161
- e.preventDefault(), this.detach(), t();
1162
- }
1163
- detach() {
1164
- this.listeners.removeAll(), this.windowListeners.removeAll();
1165
- }
1166
- };
1167
- Zt.activators = [{
1168
- eventName: "onKeyDown",
1169
- handler: (e, t, n) => {
1170
- let { keyboardCodes: r = Yt, onActivation: i } = t, { active: a } = n, { code: o } = e.nativeEvent;
1171
- if (r.start.includes(o)) {
1172
- let t = a.activatorNode.current;
1173
- return t && e.target !== t ? !1 : (e.preventDefault(), i?.({ event: e.nativeEvent }), !0);
1174
- }
1175
- return !1;
1176
- }
1177
- }];
1178
- function Qt(e) {
1179
- return !!(e && "distance" in e);
1180
- }
1181
- function $t(e) {
1182
- return !!(e && "delay" in e);
1183
- }
1184
- var en = class {
1185
- constructor(e, t, n) {
1186
- n === void 0 && (n = Gt(e.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = e, this.events = t;
1187
- let { event: r } = e, { target: i } = r;
1188
- this.props = e, this.events = t, this.document = ke(i), this.documentListeners = new Wt(this.document), this.listeners = new Wt(n), this.windowListeners = new Wt(q(i)), this.initialCoordinates = We(r) ?? X, 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();
1189
- }
1190
- attach() {
1191
- let { events: e, props: { options: { activationConstraint: t, bypassActivationConstraint: n } } } = this;
1192
- if (this.listeners.add(e.move.name, this.handleMove, { passive: !1 }), this.listeners.add(e.end.name, this.handleEnd), e.cancel && this.listeners.add(e.cancel.name, this.handleCancel), this.windowListeners.add(Q.Resize, this.handleCancel), this.windowListeners.add(Q.DragStart, qt), this.windowListeners.add(Q.VisibilityChange, this.handleCancel), this.windowListeners.add(Q.ContextMenu, qt), this.documentListeners.add(Q.Keydown, this.handleKeydown), t) {
1193
- if (n != null && n({
1194
- event: this.props.event,
1195
- activeNode: this.props.activeNode,
1196
- options: this.props.options
1197
- })) return this.handleStart();
1198
- if ($t(t)) {
1199
- this.timeoutId = setTimeout(this.handleStart, t.delay), this.handlePending(t);
1200
- return;
1201
- }
1202
- if (Qt(t)) {
1203
- this.handlePending(t);
1204
- return;
1205
- }
1206
- }
1207
- this.handleStart();
1208
- }
1209
- detach() {
1210
- this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
1211
- }
1212
- handlePending(e, t) {
1213
- let { active: n, onPending: r } = this.props;
1214
- r(n, e, this.initialCoordinates, t);
1215
- }
1216
- handleStart() {
1217
- let { initialCoordinates: e } = this, { onStart: t } = this.props;
1218
- e && (this.activated = !0, this.documentListeners.add(Q.Click, Jt, { capture: !0 }), this.removeTextSelection(), this.documentListeners.add(Q.SelectionChange, this.removeTextSelection), t(e));
1219
- }
1220
- handleMove(e) {
1221
- let { activated: t, initialCoordinates: n, props: r } = this, { onMove: i, options: { activationConstraint: a } } = r;
1222
- if (!n) return;
1223
- let o = We(e) ?? X, s = Be(n, o);
1224
- if (!t && a) {
1225
- if (Qt(a)) {
1226
- if (a.tolerance != null && Kt(s, a.tolerance)) return this.handleCancel();
1227
- if (Kt(s, a.distance)) return this.handleStart();
1228
- }
1229
- if ($t(a) && Kt(s, a.tolerance)) return this.handleCancel();
1230
- this.handlePending(a, s);
1231
- return;
1232
- }
1233
- e.cancelable && e.preventDefault(), i(o);
1234
- }
1235
- handleEnd() {
1236
- let { onAbort: e, onEnd: t } = this.props;
1237
- this.detach(), this.activated || e(this.props.active), t();
1238
- }
1239
- handleCancel() {
1240
- let { onAbort: e, onCancel: t } = this.props;
1241
- this.detach(), this.activated || e(this.props.active), t();
1242
- }
1243
- handleKeydown(e) {
1244
- e.code === $.Esc && this.handleCancel();
1245
- }
1246
- removeTextSelection() {
1247
- var e;
1248
- (e = this.document.getSelection()) == null || e.removeAllRanges();
1249
- }
1250
- }, tn = {
1251
- cancel: { name: "pointercancel" },
1252
- move: { name: "pointermove" },
1253
- end: { name: "pointerup" }
1254
- }, nn = class extends en {
1255
- constructor(e) {
1256
- let { event: t } = e, n = ke(t.target);
1257
- super(e, tn, n);
1258
- }
1259
- };
1260
- nn.activators = [{
1261
- eventName: "onPointerDown",
1262
- handler: (e, t) => {
1263
- let { nativeEvent: n } = e, { onActivation: r } = t;
1264
- return !n.isPrimary || n.button !== 0 ? !1 : (r?.({ event: n }), !0);
1265
- }
1266
- }];
1267
- var rn = {
1268
- move: { name: "mousemove" },
1269
- end: { name: "mouseup" }
1270
- }, an;
1271
- (function(e) {
1272
- e[e.RightClick = 2] = "RightClick";
1273
- })(an ||= {});
1274
- var on = class extends en {
1275
- constructor(e) {
1276
- super(e, rn, ke(e.event.target));
1277
- }
1278
- };
1279
- on.activators = [{
1280
- eventName: "onMouseDown",
1281
- handler: (e, t) => {
1282
- let { nativeEvent: n } = e, { onActivation: r } = t;
1283
- return n.button === an.RightClick ? !1 : (r?.({ event: n }), !0);
1284
- }
1285
- }];
1286
- var sn = {
1287
- cancel: { name: "touchcancel" },
1288
- move: { name: "touchmove" },
1289
- end: { name: "touchend" }
1290
- }, cn = class extends en {
1291
- constructor(e) {
1292
- super(e, sn);
1293
- }
1294
- static setup() {
1295
- return window.addEventListener(sn.move.name, e, {
1296
- capture: !1,
1297
- passive: !1
1298
- }), function() {
1299
- window.removeEventListener(sn.move.name, e);
1300
- };
1301
- function e() {}
1302
- }
1303
- };
1304
- cn.activators = [{
1305
- eventName: "onTouchStart",
1306
- handler: (e, t) => {
1307
- let { nativeEvent: n } = e, { onActivation: r } = t, { touches: i } = n;
1308
- return i.length > 1 ? !1 : (r?.({ event: n }), !0);
1309
- }
1310
- }];
1311
- var ln;
1312
- (function(e) {
1313
- e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
1314
- })(ln ||= {});
1315
- var un;
1316
- (function(e) {
1317
- e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
1318
- })(un ||= {});
1319
- function dn(e) {
1320
- let { acceleration: t, activator: n = ln.Pointer, canScroll: r, draggingRect: a, enabled: s, interval: l = 5, order: d = un.TreeOrder, pointerCoordinates: f, scrollableAncestors: p, scrollableAncestorRects: m, delta: h, threshold: g } = e, _ = pn({
1321
- delta: h,
1322
- disabled: !s
1323
- }), [v, y] = je(), b = u({
1324
- x: 0,
1325
- y: 0
1326
- }), x = u({
1327
- x: 0,
1328
- y: 0
1329
- }), S = c(() => {
1330
- switch (n) {
1331
- case ln.Pointer: return f ? {
1332
- top: f.y,
1333
- bottom: f.y,
1334
- left: f.x,
1335
- right: f.x
1336
- } : null;
1337
- case ln.DraggableRect: return a;
1338
- }
1339
- }, [
1340
- n,
1341
- a,
1342
- f
1343
- ]), C = u(null), w = i(() => {
1344
- let e = C.current;
1345
- if (!e) return;
1346
- let t = b.current.x * x.current.x, n = b.current.y * x.current.y;
1347
- e.scrollBy(t, n);
1348
- }, []), T = c(() => d === un.TreeOrder ? [...p].reverse() : p, [d, p]);
1349
- o(() => {
1350
- if (!s || !p.length || !S) {
1351
- y();
1352
- return;
1353
- }
1354
- for (let e of T) {
1355
- if (r?.(e) === !1) continue;
1356
- let n = m[p.indexOf(e)];
1357
- if (!n) continue;
1358
- let { direction: i, speed: a } = It(e, n, S, t, g);
1359
- for (let e of ["x", "y"]) _[e][i[e]] || (a[e] = 0, i[e] = 0);
1360
- if (a.x > 0 || a.y > 0) {
1361
- y(), C.current = e, v(w, l), b.current = a, x.current = i;
1362
- return;
1363
- }
1364
- }
1365
- b.current = {
1366
- x: 0,
1367
- y: 0
1368
- }, x.current = {
1369
- x: 0,
1370
- y: 0
1371
- }, y();
1372
- }, [
1373
- t,
1374
- w,
1375
- r,
1376
- y,
1377
- s,
1378
- l,
1379
- JSON.stringify(S),
1380
- JSON.stringify(_),
1381
- v,
1382
- p,
1383
- T,
1384
- m,
1385
- JSON.stringify(g)
1386
- ]);
1387
- }
1388
- var fn = {
1389
- x: {
1390
- [Z.Backward]: !1,
1391
- [Z.Forward]: !1
1392
- },
1393
- y: {
1394
- [Z.Backward]: !1,
1395
- [Z.Forward]: !1
1396
- }
1397
- };
1398
- function pn(e) {
1399
- let { delta: t, disabled: n } = e, r = Fe(t);
1400
- return Ne((e) => {
1401
- if (n || !r || !e) return fn;
1402
- let i = {
1403
- x: Math.sign(t.x - r.x),
1404
- y: Math.sign(t.y - r.y)
1405
- };
1406
- return {
1407
- x: {
1408
- [Z.Backward]: e.x[Z.Backward] || i.x === -1,
1409
- [Z.Forward]: e.x[Z.Forward] || i.x === 1
1410
- },
1411
- y: {
1412
- [Z.Backward]: e.y[Z.Backward] || i.y === -1,
1413
- [Z.Forward]: e.y[Z.Forward] || i.y === 1
1414
- }
1415
- };
1416
- }, [
1417
- n,
1418
- t,
1419
- r
1420
- ]);
1421
- }
1422
- function mn(e, t) {
1423
- let n = t == null ? void 0 : e.get(t), r = n ? n.node.current : null;
1424
- return Ne((e) => t == null ? null : r ?? e ?? null, [r, t]);
1425
- }
1426
- function hn(e, t) {
1427
- return c(() => e.reduce((e, n) => {
1428
- let { sensor: r } = n, i = r.activators.map((e) => ({
1429
- eventName: e.eventName,
1430
- handler: t(e.handler, n)
1431
- }));
1432
- return [...e, ...i];
1433
- }, []), [e, t]);
1434
- }
1435
- var gn;
1436
- (function(e) {
1437
- e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1438
- })(gn ||= {});
1439
- var _n;
1440
- (function(e) {
1441
- e.Optimized = "optimized";
1442
- })(_n ||= {});
1443
- var vn = /* @__PURE__ */ new Map();
1444
- function yn(e, t) {
1445
- let { dragging: n, dependencies: r, config: a } = t, [s, c] = d(null), { frequency: l, measure: f, strategy: p } = a, m = u(e), h = b(), g = Me(h), _ = i(function(e) {
1446
- e === void 0 && (e = []), !g.current && c((t) => t === null ? e : t.concat(e.filter((e) => !t.includes(e))));
1447
- }, [g]), v = u(null), y = Ne((t) => {
1448
- if (h && !n) return vn;
1449
- if (!t || t === vn || m.current !== e || s != null) {
1450
- let t = /* @__PURE__ */ new Map();
1451
- for (let n of e) {
1452
- if (!n) continue;
1453
- if (s && s.length > 0 && !s.includes(n.id) && n.rect.current) {
1454
- t.set(n.id, n.rect.current);
1455
- continue;
1456
- }
1457
- let e = n.node.current, r = e ? new Ut(f(e), e) : null;
1458
- n.rect.current = r, r && t.set(n.id, r);
1459
- }
1460
- return t;
1461
- }
1462
- return t;
1463
- }, [
1464
- e,
1465
- s,
1466
- n,
1467
- h,
1468
- f
1469
- ]);
1470
- return o(() => {
1471
- m.current = e;
1472
- }, [e]), o(() => {
1473
- h || _();
1474
- }, [n, h]), o(() => {
1475
- s && s.length > 0 && c(null);
1476
- }, [JSON.stringify(s)]), o(() => {
1477
- h || typeof l != "number" || v.current !== null || (v.current = setTimeout(() => {
1478
- _(), v.current = null;
1479
- }, l));
1480
- }, [
1481
- l,
1482
- h,
1483
- _,
1484
- ...r
1485
- ]), {
1486
- droppableRects: y,
1487
- measureDroppableContainers: _,
1488
- measuringScheduled: s != null
1489
- };
1490
- function b() {
1491
- switch (p) {
1492
- case gn.Always: return !1;
1493
- case gn.BeforeDragging: return n;
1494
- default: return !n;
1495
- }
1496
- }
1497
- }
1498
- function bn(e, t) {
1499
- return Ne((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
1500
- }
1501
- function xn(e, t) {
1502
- return bn(e, t);
1503
- }
1504
- function Sn(e) {
1505
- let { callback: t, disabled: n } = e, r = Ae(t), i = c(() => {
1506
- if (n || typeof window > "u" || window.MutationObserver === void 0) return;
1507
- let { MutationObserver: e } = window;
1508
- return new e(r);
1509
- }, [r, n]);
1510
- return o(() => () => i?.disconnect(), [i]), i;
1511
- }
1512
- function Cn(e) {
1513
- let { callback: t, disabled: n } = e, r = Ae(t), i = c(() => {
1514
- if (n || typeof window > "u" || window.ResizeObserver === void 0) return;
1515
- let { ResizeObserver: e } = window;
1516
- return new e(r);
1517
- }, [n]);
1518
- return o(() => () => i?.disconnect(), [i]), i;
1519
- }
1520
- function wn(e) {
1521
- return new Ut(St(e), e);
1522
- }
1523
- function Tn(e, t, n) {
1524
- t === void 0 && (t = wn);
1525
- let [r, i] = d(null);
1526
- function a() {
1527
- i((r) => {
1528
- if (!e) return null;
1529
- if (e.isConnected === !1) return r ?? n ?? null;
1530
- let i = t(e);
1531
- return JSON.stringify(r) === JSON.stringify(i) ? r : i;
1532
- });
1533
- }
1534
- let o = Sn({ callback(t) {
1535
- if (e) for (let n of t) {
1536
- let { type: t, target: r } = n;
1537
- if (t === "childList" && r instanceof HTMLElement && r.contains(e)) {
1538
- a();
1539
- break;
1540
- }
1541
- }
1542
- } }), s = Cn({ callback: a });
1543
- return J(() => {
1544
- a(), e ? (s?.observe(e), o?.observe(document.body, {
1545
- childList: !0,
1546
- subtree: !0
1547
- })) : (s?.disconnect(), o?.disconnect());
1548
- }, [e]), r;
1549
- }
1550
- function En(e) {
1551
- return gt(e, bn(e));
1552
- }
1553
- var Dn = [];
1554
- function On(e) {
1555
- let t = u(e), n = Ne((n) => e ? n && n !== Dn && e && t.current && e.parentNode === t.current.parentNode ? n : Dt(e) : Dn, [e]);
1556
- return o(() => {
1557
- t.current = e;
1558
- }, [e]), n;
1559
- }
1560
- function kn(e) {
1561
- let [t, n] = d(null), r = u(e), a = i((e) => {
1562
- let t = kt(e.target);
1563
- t && n((e) => e ? (e.set(t, Mt(t)), new Map(e)) : null);
1564
- }, []);
1565
- return o(() => {
1566
- let t = r.current;
1567
- if (e !== t) {
1568
- i(t);
1569
- let o = e.map((e) => {
1570
- let t = kt(e);
1571
- return t ? (t.addEventListener("scroll", a, { passive: !0 }), [t, Mt(t)]) : null;
1572
- }).filter((e) => e != null);
1573
- n(o.length ? new Map(o) : null), r.current = e;
1574
- }
1575
- return () => {
1576
- i(e), i(t);
1577
- };
1578
- function i(e) {
1579
- e.forEach((e) => {
1580
- kt(e)?.removeEventListener("scroll", a);
1581
- });
1582
- }
1583
- }, [a, e]), c(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => ze(e, t), X) : Rt(e) : X, [e, t]);
1584
- }
1585
- function An(e, t) {
1586
- t === void 0 && (t = []);
1587
- let n = u(null);
1588
- return o(() => {
1589
- n.current = null;
1590
- }, t), o(() => {
1591
- let t = e !== X;
1592
- t && !n.current && (n.current = e), !t && n.current && (n.current = null);
1593
- }, [e]), n.current ? Be(e, n.current) : X;
1594
- }
1595
- function jn(e) {
1596
- o(() => {
1597
- if (!Ce) return;
1598
- let t = e.map((e) => {
1599
- let { sensor: t } = e;
1600
- return t.setup == null ? void 0 : t.setup();
1601
- });
1602
- return () => {
1603
- for (let e of t) e?.();
1604
- };
1605
- }, e.map((e) => {
1606
- let { sensor: t } = e;
1607
- return t;
1608
- }));
1609
- }
1610
- function Mn(e, t) {
1611
- return c(() => e.reduce((e, n) => {
1612
- let { eventName: r, handler: i } = n;
1613
- return e[r] = (e) => {
1614
- i(e, t);
1615
- }, e;
1616
- }, {}), [e, t]);
1617
- }
1618
- function Nn(e) {
1619
- return c(() => e ? wt(e) : null, [e]);
1620
- }
1621
- var Pn = [];
1622
- function Fn(e, t) {
1623
- t === void 0 && (t = St);
1624
- let [n] = e, r = Nn(n ? q(n) : null), [i, a] = d(Pn);
1625
- function o() {
1626
- a(() => e.length ? e.map((e) => Nt(e) ? r : new Ut(t(e), e)) : Pn);
1627
- }
1628
- let s = Cn({ callback: o });
1629
- return J(() => {
1630
- s?.disconnect(), o(), e.forEach((e) => s?.observe(e));
1631
- }, [e]), i;
1632
- }
1633
- function In(e) {
1634
- if (!e) return null;
1635
- if (e.children.length > 1) return e;
1636
- let t = e.children[0];
1637
- return De(t) ? t : e;
1638
- }
1639
- function Ln(e) {
1640
- let { measure: t } = e, [n, r] = d(null), a = Cn({ callback: i((e) => {
1641
- for (let { target: n } of e) if (De(n)) {
1642
- r((e) => {
1643
- let r = t(n);
1644
- return e ? {
1645
- ...e,
1646
- width: r.width,
1647
- height: r.height
1648
- } : r;
1649
- });
1650
- break;
1651
- }
1652
- }, [t]) }), [o, s] = Pe(i((e) => {
1653
- let n = In(e);
1654
- a?.disconnect(), n && a?.observe(n), r(n ? t(n) : null);
1655
- }, [t, a]));
1656
- return c(() => ({
1657
- nodeRef: o,
1658
- rect: n,
1659
- setRef: s
1660
- }), [
1661
- n,
1662
- o,
1663
- s
1664
- ]);
1665
- }
1666
- var Rn = [{
1667
- sensor: nn,
1668
- options: {}
1669
- }, {
1670
- sensor: Zt,
1671
- options: {}
1672
- }], zn = { current: {} }, Bn = {
1673
- draggable: { measure: Ct },
1674
- droppable: {
1675
- measure: Ct,
1676
- strategy: gn.WhileDragging,
1677
- frequency: _n.Optimized
1678
- },
1679
- dragOverlay: { measure: St }
1680
- }, Vn = class extends Map {
1681
- get(e) {
1682
- return e == null ? void 0 : super.get(e) ?? void 0;
1683
- }
1684
- toArray() {
1685
- return Array.from(this.values());
1686
- }
1687
- getEnabled() {
1688
- return this.toArray().filter((e) => {
1689
- let { disabled: t } = e;
1690
- return !t;
1691
- });
1692
- }
1693
- getNodeFor(e) {
1694
- return this.get(e)?.node.current ?? void 0;
1695
- }
1696
- }, Hn = {
1697
- activatorEvent: null,
1698
- active: null,
1699
- activeNode: null,
1700
- activeNodeRect: null,
1701
- collisions: null,
1702
- containerNodeRect: null,
1703
- draggableNodes: /* @__PURE__ */ new Map(),
1704
- droppableRects: /* @__PURE__ */ new Map(),
1705
- droppableContainers: /* @__PURE__ */ new Vn(),
1706
- over: null,
1707
- dragOverlay: {
1708
- nodeRef: { current: null },
1709
- rect: null,
1710
- setRef: it
1711
- },
1712
- scrollableAncestors: [],
1713
- scrollableAncestorRects: [],
1714
- measuringConfiguration: Bn,
1715
- measureDroppableContainers: it,
1716
- windowRect: null,
1717
- measuringScheduled: !1
1718
- }, Un = /* @__PURE__ */ n({
1719
- activatorEvent: null,
1720
- activators: [],
1721
- active: null,
1722
- activeNodeRect: null,
1723
- ariaDescribedById: { draggable: "" },
1724
- dispatch: it,
1725
- draggableNodes: /* @__PURE__ */ new Map(),
1726
- over: null,
1727
- measureDroppableContainers: it
1728
- }), Wn = /* @__PURE__ */ n(Hn);
1729
- function Gn() {
1730
- return {
1731
- draggable: {
1732
- active: null,
1733
- initialCoordinates: {
1734
- x: 0,
1735
- y: 0
1736
- },
1737
- nodes: /* @__PURE__ */ new Map(),
1738
- translate: {
1739
- x: 0,
1740
- y: 0
1741
- }
1742
- },
1743
- droppable: { containers: new Vn() }
1744
- };
1745
- }
1746
- function Kn(e, t) {
1747
- switch (t.type) {
1748
- case Y.DragStart: return {
1749
- ...e,
1750
- draggable: {
1751
- ...e.draggable,
1752
- initialCoordinates: t.initialCoordinates,
1753
- active: t.active
1754
- }
1755
- };
1756
- case Y.DragMove: return e.draggable.active == null ? e : {
1757
- ...e,
1758
- draggable: {
1759
- ...e.draggable,
1760
- translate: {
1761
- x: t.coordinates.x - e.draggable.initialCoordinates.x,
1762
- y: t.coordinates.y - e.draggable.initialCoordinates.y
1763
- }
1764
- }
1765
- };
1766
- case Y.DragEnd:
1767
- case Y.DragCancel: return {
1768
- ...e,
1769
- draggable: {
1770
- ...e.draggable,
1771
- active: null,
1772
- initialCoordinates: {
1773
- x: 0,
1774
- y: 0
1775
- },
1776
- translate: {
1777
- x: 0,
1778
- y: 0
1779
- }
1780
- }
1781
- };
1782
- case Y.RegisterDroppable: {
1783
- let { element: n } = t, { id: r } = n, i = new Vn(e.droppable.containers);
1784
- return i.set(r, n), {
1785
- ...e,
1786
- droppable: {
1787
- ...e.droppable,
1788
- containers: i
1789
- }
1790
- };
1791
- }
1792
- case Y.SetDroppableDisabled: {
1793
- let { id: n, key: r, disabled: i } = t, a = e.droppable.containers.get(n);
1794
- if (!a || r !== a.key) return e;
1795
- let o = new Vn(e.droppable.containers);
1796
- return o.set(n, {
1797
- ...a,
1798
- disabled: i
1799
- }), {
1800
- ...e,
1801
- droppable: {
1802
- ...e.droppable,
1803
- containers: o
1804
- }
1805
- };
1806
- }
1807
- case Y.UnregisterDroppable: {
1808
- let { id: n, key: r } = t, i = e.droppable.containers.get(n);
1809
- if (!i || r !== i.key) return e;
1810
- let a = new Vn(e.droppable.containers);
1811
- return a.delete(n), {
1812
- ...e,
1813
- droppable: {
1814
- ...e.droppable,
1815
- containers: a
1816
- }
1817
- };
1818
- }
1819
- default: return e;
1820
- }
1821
- }
1822
- function qn(e) {
1823
- let { disabled: t } = e, { active: n, activatorEvent: r, draggableNodes: i } = a(Un), s = Fe(r), c = Fe(n?.id);
1824
- return o(() => {
1825
- if (!t && !r && s && c != null) {
1826
- if (!He(s) || document.activeElement === s.target) return;
1827
- let e = i.get(c);
1828
- if (!e) return;
1829
- let { activatorNode: t, node: n } = e;
1830
- if (!t.current && !n.current) return;
1831
- requestAnimationFrame(() => {
1832
- for (let e of [t.current, n.current]) {
1833
- if (!e) continue;
1834
- let t = qe(e);
1835
- if (t) {
1836
- t.focus();
1837
- break;
1838
- }
1839
- }
1840
- });
1841
- }
1842
- }, [
1843
- r,
1844
- t,
1845
- i,
1846
- c,
1847
- s
1848
- ]), null;
1849
- }
1850
- function Jn(e, t) {
1851
- let { transform: n, ...r } = t;
1852
- return e != null && e.length ? e.reduce((e, t) => t({
1853
- transform: e,
1854
- ...r
1855
- }), n) : n;
1856
- }
1857
- function Yn(e) {
1858
- return c(() => ({
1859
- draggable: {
1860
- ...Bn.draggable,
1861
- ...e?.draggable
1862
- },
1863
- droppable: {
1864
- ...Bn.droppable,
1865
- ...e?.droppable
1866
- },
1867
- dragOverlay: {
1868
- ...Bn.dragOverlay,
1869
- ...e?.dragOverlay
1870
- }
1871
- }), [
1872
- e?.draggable,
1873
- e?.droppable,
1874
- e?.dragOverlay
1875
- ]);
1876
- }
1877
- function Xn(e) {
1878
- let { activeNode: t, measure: n, initialRect: r, config: i = !0 } = e, a = u(!1), { x: o, y: s } = typeof i == "boolean" ? {
1879
- x: i,
1880
- y: i
1881
- } : i;
1882
- J(() => {
1883
- if (!o && !s || !t) {
1884
- a.current = !1;
1885
- return;
1886
- }
1887
- if (a.current || !r) return;
1888
- let e = t?.node.current;
1889
- if (!e || e.isConnected === !1) return;
1890
- let i = gt(n(e), r);
1891
- if (o || (i.x = 0), s || (i.y = 0), a.current = !0, Math.abs(i.x) > 0 || Math.abs(i.y) > 0) {
1892
- let t = Ot(e);
1893
- t && t.scrollBy({
1894
- top: i.y,
1895
- left: i.x
1896
- });
1897
- }
1898
- }, [
1899
- t,
1900
- o,
1901
- s,
1902
- r,
1903
- n
1904
- ]);
1905
- }
1906
- var Zn = /* @__PURE__ */ n({
1907
- ...X,
1908
- scaleX: 1,
1909
- scaleY: 1
1910
- }), Qn;
1911
- (function(e) {
1912
- e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
1913
- })(Qn ||= {});
1914
- var $n = /* @__PURE__ */ r(function(e) {
1915
- let { id: n, accessibility: r, autoScroll: a = !0, children: s, sensors: f = Rn, collisionDetection: p = mt, measuring: m, modifiers: h, ...g } = e, [_, v] = l(Kn, void 0, Gn), [y, b] = et(), [x, S] = d(Qn.Uninitialized), C = x === Qn.Initialized, { draggable: { active: w, nodes: T, translate: E }, droppable: { containers: D } } = _, O = w == null ? null : T.get(w), k = u({
1916
- initial: null,
1917
- translated: null
1918
- }), A = c(() => w == null ? null : {
1919
- id: w,
1920
- data: O?.data ?? zn,
1921
- rect: k
1922
- }, [w, O]), j = u(null), [M, ee] = d(null), [N, P] = d(null), F = Me(g, Object.values(g)), I = Le("DndDescribedBy", n), te = c(() => D.getEnabled(), [D]), L = Yn(m), { droppableRects: R, measureDroppableContainers: ne, measuringScheduled: z } = yn(te, {
1923
- dragging: C,
1924
- dependencies: [E.x, E.y],
1925
- config: L.droppable
1926
- }), B = mn(T, w), re = c(() => N ? We(N) : null, [N]), ie = Ae(), ae = xn(B, L.draggable.measure);
1927
- Xn({
1928
- activeNode: w == null ? null : T.get(w),
1929
- config: ie.layoutShiftCompensation,
1930
- initialRect: ae,
1931
- measure: L.draggable.measure
1932
- });
1933
- let V = Tn(B, L.draggable.measure, ae), H = Tn(B ? B.parentElement : null), U = u({
1934
- activatorEvent: null,
1935
- active: null,
1936
- activeNode: B,
1937
- collisionRect: null,
1938
- collisions: null,
1939
- droppableRects: R,
1940
- draggableNodes: T,
1941
- draggingNode: null,
1942
- draggingNodeRect: null,
1943
- droppableContainers: D,
1944
- over: null,
1945
- scrollableAncestors: [],
1946
- scrollAdjustedTranslate: null
1947
- }), se = D.getNodeFor(U.current.over?.id), W = Ln({ measure: L.dragOverlay.measure }), ce = W.nodeRef.current ?? B, le = C ? W.rect ?? V : null, ue = !!(W.nodeRef.current && W.rect), G = En(ue ? null : V), de = Nn(ce ? q(ce) : null), K = On(C ? se ?? B : null), fe = Fn(K), pe = Jn(h, {
1948
- transform: {
1949
- x: E.x - G.x,
1950
- y: E.y - G.y,
1951
- scaleX: 1,
1952
- scaleY: 1
1953
- },
1954
- activatorEvent: N,
1955
- active: A,
1956
- activeNodeRect: V,
1957
- containerNodeRect: H,
1958
- draggingNodeRect: le,
1959
- over: U.current.over,
1960
- overlayNodeRect: W.rect,
1961
- scrollableAncestors: K,
1962
- scrollableAncestorRects: fe,
1963
- windowRect: de
1964
- }), me = re ? ze(re, E) : null, he = kn(K), ge = An(he), _e = An(he, [V]), ve = ze(pe, ge), ye = le ? vt(le, pe) : null, be = A && ye ? p({
1965
- active: A,
1966
- collisionRect: ye,
1967
- droppableRects: R,
1968
- droppableContainers: te,
1969
- pointerCoordinates: me
1970
- }) : null, xe = ut(be, "id"), [Se, Ce] = d(null), we = ht(ue ? pe : ze(pe, _e), Se?.rect ?? null, V), Te = u(null), Ee = i((e, t) => {
1971
- let { sensor: n, options: r } = t;
1972
- if (j.current == null) return;
1973
- let i = T.get(j.current);
1974
- if (!i) return;
1975
- let a = e.nativeEvent;
1976
- Te.current = new n({
1977
- active: j.current,
1978
- activeNode: i,
1979
- event: a,
1980
- options: r,
1981
- context: U,
1982
- onAbort(e) {
1983
- if (!T.get(e)) return;
1984
- let { onDragAbort: t } = F.current, n = { id: e };
1985
- t?.(n), y({
1986
- type: "onDragAbort",
1987
- event: n
1988
- });
1989
- },
1990
- onPending(e, t, n, r) {
1991
- if (!T.get(e)) return;
1992
- let { onDragPending: i } = F.current, a = {
1993
- id: e,
1994
- constraint: t,
1995
- initialCoordinates: n,
1996
- offset: r
1997
- };
1998
- i?.(a), y({
1999
- type: "onDragPending",
2000
- event: a
2001
- });
2002
- },
2003
- onStart(e) {
2004
- let t = j.current;
2005
- if (t == null) return;
2006
- let n = T.get(t);
2007
- if (!n) return;
2008
- let { onDragStart: r } = F.current, i = {
2009
- activatorEvent: a,
2010
- active: {
2011
- id: t,
2012
- data: n.data,
2013
- rect: k
2014
- }
2015
- };
2016
- oe(() => {
2017
- r?.(i), S(Qn.Initializing), v({
2018
- type: Y.DragStart,
2019
- initialCoordinates: e,
2020
- active: t
2021
- }), y({
2022
- type: "onDragStart",
2023
- event: i
2024
- }), ee(Te.current), P(a);
2025
- });
2026
- },
2027
- onMove(e) {
2028
- v({
2029
- type: Y.DragMove,
2030
- coordinates: e
2031
- });
2032
- },
2033
- onEnd: o(Y.DragEnd),
2034
- onCancel: o(Y.DragCancel)
2035
- });
2036
- function o(e) {
2037
- return async function() {
2038
- let { active: t, collisions: n, over: r, scrollAdjustedTranslate: i } = U.current, o = null;
2039
- if (t && i) {
2040
- let { cancelDrop: s } = F.current;
2041
- o = {
2042
- activatorEvent: a,
2043
- active: t,
2044
- collisions: n,
2045
- delta: i,
2046
- over: r
2047
- }, e === Y.DragEnd && typeof s == "function" && await Promise.resolve(s(o)) && (e = Y.DragCancel);
2048
- }
2049
- j.current = null, oe(() => {
2050
- v({ type: e }), S(Qn.Uninitialized), Ce(null), ee(null), P(null), Te.current = null;
2051
- let t = e === Y.DragEnd ? "onDragEnd" : "onDragCancel";
2052
- if (o) {
2053
- let e = F.current[t];
2054
- e?.(o), y({
2055
- type: t,
2056
- event: o
2057
- });
2058
- }
2059
- });
2060
- };
2061
- }
2062
- }, [T]), De = hn(f, i((e, t) => (n, r) => {
2063
- let i = n.nativeEvent, a = T.get(r);
2064
- if (j.current !== null || !a || i.dndKit || i.defaultPrevented) return;
2065
- let o = { active: a };
2066
- e(n, t.options, o) === !0 && (i.dndKit = { capturedBy: t.sensor }, j.current = r, Ee(n, t));
2067
- }, [T, Ee]));
2068
- jn(f), J(() => {
2069
- V && x === Qn.Initializing && S(Qn.Initialized);
2070
- }, [V, x]), o(() => {
2071
- let { onDragMove: e } = F.current, { active: t, activatorEvent: n, collisions: r, over: i } = U.current;
2072
- if (!t || !n) return;
2073
- let a = {
2074
- active: t,
2075
- activatorEvent: n,
2076
- collisions: r,
2077
- delta: {
2078
- x: ve.x,
2079
- y: ve.y
2080
- },
2081
- over: i
2082
- };
2083
- oe(() => {
2084
- e?.(a), y({
2085
- type: "onDragMove",
2086
- event: a
2087
- });
2088
- });
2089
- }, [ve.x, ve.y]), o(() => {
2090
- let { active: e, activatorEvent: t, collisions: n, droppableContainers: r, scrollAdjustedTranslate: i } = U.current;
2091
- if (!e || j.current == null || !t || !i) return;
2092
- let { onDragOver: a } = F.current, o = r.get(xe), s = o && o.rect.current ? {
2093
- id: o.id,
2094
- rect: o.rect.current,
2095
- data: o.data,
2096
- disabled: o.disabled
2097
- } : null, c = {
2098
- active: e,
2099
- activatorEvent: t,
2100
- collisions: n,
2101
- delta: {
2102
- x: i.x,
2103
- y: i.y
2104
- },
2105
- over: s
2106
- };
2107
- oe(() => {
2108
- Ce(s), a?.(c), y({
2109
- type: "onDragOver",
2110
- event: c
2111
- });
2112
- });
2113
- }, [xe]), J(() => {
2114
- U.current = {
2115
- activatorEvent: N,
2116
- active: A,
2117
- activeNode: B,
2118
- collisionRect: ye,
2119
- collisions: be,
2120
- droppableRects: R,
2121
- draggableNodes: T,
2122
- draggingNode: ce,
2123
- draggingNodeRect: le,
2124
- droppableContainers: D,
2125
- over: Se,
2126
- scrollableAncestors: K,
2127
- scrollAdjustedTranslate: ve
2128
- }, k.current = {
2129
- initial: le,
2130
- translated: ye
2131
- };
2132
- }, [
2133
- A,
2134
- B,
2135
- be,
2136
- ye,
2137
- T,
2138
- ce,
2139
- le,
2140
- R,
2141
- D,
2142
- Se,
2143
- K,
2144
- ve
2145
- ]), dn({
2146
- ...ie,
2147
- delta: E,
2148
- draggingRect: ye,
2149
- pointerCoordinates: me,
2150
- scrollableAncestors: K,
2151
- scrollableAncestorRects: fe
2152
- });
2153
- let Oe = c(() => ({
2154
- active: A,
2155
- activeNode: B,
2156
- activeNodeRect: V,
2157
- activatorEvent: N,
2158
- collisions: be,
2159
- containerNodeRect: H,
2160
- dragOverlay: W,
2161
- draggableNodes: T,
2162
- droppableContainers: D,
2163
- droppableRects: R,
2164
- over: Se,
2165
- measureDroppableContainers: ne,
2166
- scrollableAncestors: K,
2167
- scrollableAncestorRects: fe,
2168
- measuringConfiguration: L,
2169
- measuringScheduled: z,
2170
- windowRect: de
2171
- }), [
2172
- A,
2173
- B,
2174
- V,
2175
- N,
2176
- be,
2177
- H,
2178
- W,
2179
- T,
2180
- D,
2181
- R,
2182
- Se,
2183
- ne,
2184
- K,
2185
- fe,
2186
- L,
2187
- z,
2188
- de
2189
- ]), ke = c(() => ({
2190
- activatorEvent: N,
2191
- activators: De,
2192
- active: A,
2193
- activeNodeRect: V,
2194
- ariaDescribedById: { draggable: I },
2195
- dispatch: v,
2196
- draggableNodes: T,
2197
- over: Se,
2198
- measureDroppableContainers: ne
2199
- }), [
2200
- N,
2201
- De,
2202
- A,
2203
- V,
2204
- v,
2205
- I,
2206
- T,
2207
- Se,
2208
- ne
2209
- ]);
2210
- return t.createElement(Qe.Provider, { value: b }, t.createElement(Un.Provider, { value: ke }, t.createElement(Wn.Provider, { value: Oe }, t.createElement(Zn.Provider, { value: we }, s)), t.createElement(qn, { disabled: r?.restoreFocus === !1 })), t.createElement(rt, {
2211
- ...r,
2212
- hiddenTextDescribedById: I
2213
- }));
2214
- function Ae() {
2215
- let e = M?.autoScrollEnabled === !1, t = typeof a == "object" ? a.enabled === !1 : a === !1, n = C && !e && !t;
2216
- return typeof a == "object" ? {
2217
- ...a,
2218
- enabled: n
2219
- } : { enabled: n };
2220
- }
2221
- }), er = /* @__PURE__ */ n(null), tr = "button", nr = "Draggable";
2222
- function rr(e) {
2223
- let { id: t, data: n, disabled: r = !1, attributes: i } = e, o = Le(nr), { activators: s, activatorEvent: l, active: u, activeNodeRect: d, ariaDescribedById: f, draggableNodes: p, over: m } = a(Un), { role: h = tr, roleDescription: g = "draggable", tabIndex: _ = 0 } = i ?? {}, v = u?.id === t, y = a(v ? Zn : er), [b, x] = Pe(), [S, C] = Pe(), w = Mn(s, t), T = Me(n);
2224
- return J(() => (p.set(t, {
2225
- id: t,
2226
- key: o,
2227
- node: b,
2228
- activatorNode: S,
2229
- data: T
2230
- }), () => {
2231
- let e = p.get(t);
2232
- e && e.key === o && p.delete(t);
2233
- }), [p, t]), {
2234
- active: u,
2235
- activatorEvent: l,
2236
- activeNodeRect: d,
2237
- attributes: c(() => ({
2238
- role: h,
2239
- tabIndex: _,
2240
- "aria-disabled": r,
2241
- "aria-pressed": v && h === tr ? !0 : void 0,
2242
- "aria-roledescription": g,
2243
- "aria-describedby": f.draggable
2244
- }), [
2245
- r,
2246
- h,
2247
- _,
2248
- v,
2249
- g,
2250
- f.draggable
2251
- ]),
2252
- isDragging: v,
2253
- listeners: r ? void 0 : w,
2254
- node: b,
2255
- over: m,
2256
- setNodeRef: x,
2257
- setActivatorNodeRef: C,
2258
- transform: y
2259
- };
2260
- }
2261
- function ir() {
2262
- return a(Wn);
2263
- }
2264
- var ar = "Droppable", or = { timeout: 25 };
2265
- function sr(e) {
2266
- let { data: t, disabled: n = !1, id: r, resizeObserverConfig: s } = e, c = Le(ar), { active: l, dispatch: d, over: f, measureDroppableContainers: p } = a(Un), m = u({ disabled: n }), h = u(!1), g = u(null), _ = u(null), { disabled: v, updateMeasurementsFor: y, timeout: b } = {
2267
- ...or,
2268
- ...s
2269
- }, x = Me(y ?? r), S = Cn({
2270
- callback: i(() => {
2271
- if (!h.current) {
2272
- h.current = !0;
2273
- return;
2274
- }
2275
- _.current != null && clearTimeout(_.current), _.current = setTimeout(() => {
2276
- p(Array.isArray(x.current) ? x.current : [x.current]), _.current = null;
2277
- }, b);
2278
- }, [b]),
2279
- disabled: v || !l
2280
- }), [C, w] = Pe(i((e, t) => {
2281
- S && (t && (S.unobserve(t), h.current = !1), e && S.observe(e));
2282
- }, [S])), T = Me(t);
2283
- return o(() => {
2284
- !S || !C.current || (S.disconnect(), h.current = !1, S.observe(C.current));
2285
- }, [C, S]), o(() => (d({
2286
- type: Y.RegisterDroppable,
2287
- element: {
2288
- id: r,
2289
- key: c,
2290
- disabled: n,
2291
- node: C,
2292
- rect: g,
2293
- data: T
2294
- }
2295
- }), () => d({
2296
- type: Y.UnregisterDroppable,
2297
- key: c,
2298
- id: r
2299
- })), [r]), o(() => {
2300
- n !== m.current.disabled && (d({
2301
- type: Y.SetDroppableDisabled,
2302
- id: r,
2303
- key: c,
2304
- disabled: n
2305
- }), m.current.disabled = n);
2306
- }, [
2307
- r,
2308
- c,
2309
- n,
2310
- d
2311
- ]), {
2312
- active: l,
2313
- rect: g,
2314
- isOver: f?.id === r,
2315
- node: C,
2316
- over: f,
2317
- setNodeRef: w
2318
- };
2319
- }
2320
- //#endregion
2321
- //#region ../../node_modules/.pnpm/@dnd-kit+sortable@10.0.0_@dnd-kit+core@6.3.1_react-dom@19.2.5_react@19.2.5__react@19.2.5__react@19.2.5/node_modules/@dnd-kit/sortable/dist/sortable.esm.js
2322
- function cr(e, t, n) {
2323
- let r = e.slice();
2324
- return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
2325
- }
2326
- function lr(e, t) {
2327
- return e.reduce((e, n, r) => {
2328
- let i = t.get(n);
2329
- return i && (e[r] = i), e;
2330
- }, Array(e.length));
2331
- }
2332
- function ur(e) {
2333
- return e !== null && e >= 0;
2334
- }
2335
- function dr(e, t) {
2336
- if (e === t) return !0;
2337
- if (e.length !== t.length) return !1;
2338
- for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
2339
- return !0;
2340
- }
2341
- function fr(e) {
2342
- return typeof e == "boolean" ? {
2343
- draggable: e,
2344
- droppable: e
2345
- } : e;
2346
- }
2347
- var pr = (e) => {
2348
- let { rects: t, activeIndex: n, overIndex: r, index: i } = e, a = cr(t, r, n), o = t[i], s = a[i];
2349
- return !s || !o ? null : {
2350
- x: s.left - o.left,
2351
- y: s.top - o.top,
2352
- scaleX: s.width / o.width,
2353
- scaleY: s.height / o.height
2354
- };
2355
- }, mr = {
2356
- scaleX: 1,
2357
- scaleY: 1
2358
- }, hr = (e) => {
2359
- let { activeIndex: t, activeNodeRect: n, index: r, rects: i, overIndex: a } = e, o = i[t] ?? n;
2360
- if (!o) return null;
2361
- if (r === t) {
2362
- let e = i[a];
2363
- return e ? {
2364
- x: 0,
2365
- y: t < a ? e.top + e.height - (o.top + o.height) : e.top - o.top,
2366
- ...mr
2367
- } : null;
2368
- }
2369
- let s = gr(i, r, t);
2370
- return r > t && r <= a ? {
2371
- x: 0,
2372
- y: -o.height - s,
2373
- ...mr
2374
- } : r < t && r >= a ? {
2375
- x: 0,
2376
- y: o.height + s,
2377
- ...mr
2378
- } : {
2379
- x: 0,
2380
- y: 0,
2381
- ...mr
2382
- };
2383
- };
2384
- function gr(e, t, n) {
2385
- let r = e[t], i = e[t - 1], a = e[t + 1];
2386
- return r ? n < t ? i ? r.top - (i.top + i.height) : a ? a.top - (r.top + r.height) : 0 : a ? a.top - (r.top + r.height) : i ? r.top - (i.top + i.height) : 0 : 0;
2387
- }
2388
- var _r = "Sortable", vr = /* @__PURE__ */ t.createContext({
2389
- activeIndex: -1,
2390
- containerId: _r,
2391
- disableTransforms: !1,
2392
- items: [],
2393
- overIndex: -1,
2394
- useDragOverlay: !1,
2395
- sortedRects: [],
2396
- strategy: pr,
2397
- disabled: {
2398
- draggable: !1,
2399
- droppable: !1
2400
- }
2401
- });
2402
- function yr(e) {
2403
- let { children: n, id: r, items: i, strategy: a = pr, disabled: s = !1 } = e, { active: l, dragOverlay: d, droppableRects: f, over: p, measureDroppableContainers: m } = ir(), h = Le(_r, r), g = d.rect !== null, _ = c(() => i.map((e) => typeof e == "object" && "id" in e ? e.id : e), [i]), v = l != null, y = l ? _.indexOf(l.id) : -1, b = p ? _.indexOf(p.id) : -1, x = u(_), S = !dr(_, x.current), C = b !== -1 && y === -1 || S, w = fr(s);
2404
- J(() => {
2405
- S && v && m(_);
2406
- }, [
2407
- S,
2408
- _,
2409
- v,
2410
- m
2411
- ]), o(() => {
2412
- x.current = _;
2413
- }, [_]);
2414
- let T = c(() => ({
2415
- activeIndex: y,
2416
- containerId: h,
2417
- disabled: w,
2418
- disableTransforms: C,
2419
- items: _,
2420
- overIndex: b,
2421
- useDragOverlay: g,
2422
- sortedRects: lr(_, f),
2423
- strategy: a
2424
- }), [
2425
- y,
2426
- h,
2427
- w.draggable,
2428
- w.droppable,
2429
- C,
2430
- _,
2431
- b,
2432
- f,
2433
- g,
2434
- a
2435
- ]);
2436
- return t.createElement(vr.Provider, { value: T }, n);
2437
- }
2438
- var br = (e) => {
2439
- let { id: t, items: n, activeIndex: r, overIndex: i } = e;
2440
- return cr(n, r, i).indexOf(t);
2441
- }, xr = (e) => {
2442
- let { containerId: t, isSorting: n, wasDragging: r, index: i, items: a, newIndex: o, previousItems: s, previousContainerId: c, transition: l } = e;
2443
- return !l || !r || s !== a && i === o ? !1 : n ? !0 : o !== i && t === c;
2444
- }, Sr = {
2445
- duration: 200,
2446
- easing: "ease"
2447
- }, Cr = "transform", wr = /* @__PURE__ */ Ge.Transition.toString({
2448
- property: Cr,
2449
- duration: 0,
2450
- easing: "linear"
2451
- }), Tr = { roleDescription: "sortable" };
2452
- function Er(e) {
2453
- let { disabled: t, index: n, node: r, rect: i } = e, [a, s] = d(null), c = u(n);
2454
- return J(() => {
2455
- if (!t && n !== c.current && r.current) {
2456
- let e = i.current;
2457
- if (e) {
2458
- let t = St(r.current, { ignoreTransform: !0 }), n = {
2459
- x: e.left - t.left,
2460
- y: e.top - t.top,
2461
- scaleX: e.width / t.width,
2462
- scaleY: e.height / t.height
2463
- };
2464
- (n.x || n.y) && s(n);
2465
- }
2466
- }
2467
- n !== c.current && (c.current = n);
2468
- }, [
2469
- t,
2470
- n,
2471
- r,
2472
- i
2473
- ]), o(() => {
2474
- a && s(null);
2475
- }, [a]), a;
2476
- }
2477
- function Dr(e) {
2478
- let { animateLayoutChanges: t = xr, attributes: n, disabled: r, data: i, getNewIndex: s = br, id: l, strategy: d, resizeObserverConfig: f, transition: p = Sr } = e, { items: m, containerId: h, activeIndex: g, disabled: _, disableTransforms: v, sortedRects: y, overIndex: b, useDragOverlay: x, strategy: S } = a(vr), C = Or(r, _), w = m.indexOf(l), T = c(() => ({
2479
- sortable: {
2480
- containerId: h,
2481
- index: w,
2482
- items: m
2483
- },
2484
- ...i
2485
- }), [
2486
- h,
2487
- i,
2488
- w,
2489
- m
2490
- ]), E = c(() => m.slice(m.indexOf(l)), [m, l]), { rect: D, node: O, isOver: k, setNodeRef: A } = sr({
2491
- id: l,
2492
- data: T,
2493
- disabled: C.droppable,
2494
- resizeObserverConfig: {
2495
- updateMeasurementsFor: E,
2496
- ...f
2497
- }
2498
- }), { active: j, activatorEvent: M, activeNodeRect: ee, attributes: N, setNodeRef: P, listeners: F, isDragging: I, over: te, setActivatorNodeRef: L, transform: R } = rr({
2499
- id: l,
2500
- data: T,
2501
- attributes: {
2502
- ...Tr,
2503
- ...n
2504
- },
2505
- disabled: C.draggable
2506
- }), ne = Se(A, P), z = !!j, B = z && !v && ur(g) && ur(b), re = !x && I, ie = B ? (re && B ? R : null) ?? (d ?? S)({
2507
- rects: y,
2508
- activeNodeRect: ee,
2509
- activeIndex: g,
2510
- overIndex: b,
2511
- index: w
2512
- }) : null, ae = ur(g) && ur(b) ? s({
2513
- id: l,
2514
- items: m,
2515
- activeIndex: g,
2516
- overIndex: b
2517
- }) : w, V = j?.id, H = u({
2518
- activeId: V,
2519
- items: m,
2520
- newIndex: ae,
2521
- containerId: h
2522
- }), oe = m !== H.current.items, U = t({
2523
- active: j,
2524
- containerId: h,
2525
- isDragging: I,
2526
- isSorting: z,
2527
- id: l,
2528
- index: w,
2529
- items: m,
2530
- newIndex: H.current.newIndex,
2531
- previousItems: H.current.items,
2532
- previousContainerId: H.current.containerId,
2533
- transition: p,
2534
- wasDragging: H.current.activeId != null
2535
- }), se = Er({
2536
- disabled: !U,
2537
- index: w,
2538
- node: O,
2539
- rect: D
2540
- });
2541
- return o(() => {
2542
- z && H.current.newIndex !== ae && (H.current.newIndex = ae), h !== H.current.containerId && (H.current.containerId = h), m !== H.current.items && (H.current.items = m);
2543
- }, [
2544
- z,
2545
- ae,
2546
- h,
2547
- m
2548
- ]), o(() => {
2549
- if (V === H.current.activeId) return;
2550
- if (V != null && H.current.activeId == null) {
2551
- H.current.activeId = V;
2552
- return;
2553
- }
2554
- let e = setTimeout(() => {
2555
- H.current.activeId = V;
2556
- }, 50);
2557
- return () => clearTimeout(e);
2558
- }, [V]), {
2559
- active: j,
2560
- activeIndex: g,
2561
- attributes: N,
2562
- data: T,
2563
- rect: D,
2564
- index: w,
2565
- newIndex: ae,
2566
- items: m,
2567
- isOver: k,
2568
- isSorting: z,
2569
- isDragging: I,
2570
- listeners: F,
2571
- node: O,
2572
- overIndex: b,
2573
- over: te,
2574
- setNodeRef: ne,
2575
- setActivatorNodeRef: L,
2576
- setDroppableNodeRef: A,
2577
- setDraggableNodeRef: P,
2578
- transform: se ?? ie,
2579
- transition: W()
2580
- };
2581
- function W() {
2582
- if (se || oe && H.current.newIndex === w) return wr;
2583
- if (!(re && !He(M) || !p) && (z || U)) return Ge.Transition.toString({
2584
- ...p,
2585
- property: Cr
2586
- });
2587
- }
2588
- }
2589
- function Or(e, t) {
2590
- return typeof e == "boolean" ? {
2591
- draggable: e,
2592
- droppable: !1
2593
- } : {
2594
- draggable: e?.draggable ?? t.draggable,
2595
- droppable: e?.droppable ?? t.droppable
2596
- };
2597
- }
2598
- $.Down, $.Right, $.Up, $.Left;
2599
- //#endregion
2600
225
  //#region src/NavigationRenderer.tsx
2601
- function kr(e) {
2602
- return e ? F(e) : ne;
226
+ function Y(e) {
227
+ return e ? k(e) : L;
2603
228
  }
2604
- function Ar(e, t) {
229
+ function X(e, t) {
2605
230
  if (typeof e == "string") return e;
2606
231
  if (t) {
2607
232
  let n = t(e.key, {
@@ -2612,12 +237,12 @@ function Ar(e, t) {
2612
237
  }
2613
238
  return e.defaultValue || e.key;
2614
239
  }
2615
- function jr(e, t, n, r, i) {
2616
- let a = Ar(e.label, n);
240
+ function be(e, t, n, r, i) {
241
+ let a = X(e.label, n);
2617
242
  return typeof e.label == "string" ? t && e.type === "object" && e.objectName ? t(e.objectName, a) : r && e.type === "dashboard" && e.dashboardName ? r(e.dashboardName, a) : i && e.type === "group" && e.id ? i(e.id, a) : a : a;
2618
243
  }
2619
- var Mr = (e) => !(e === !1 || e === "false"), Nr = () => !0;
2620
- function Pr(e, t) {
244
+ var xe = (e) => !(e === !1 || e === "false"), Se = () => !0;
245
+ function Ce(e, t) {
2621
246
  switch (e.type) {
2622
247
  case "object": {
2623
248
  let n = `${t}/${e.objectName ?? ""}`;
@@ -2648,37 +273,37 @@ function Pr(e, t) {
2648
273
  };
2649
274
  }
2650
275
  }
2651
- function Fr(e, t) {
276
+ function Z(e, t) {
2652
277
  if (!t.trim()) return e;
2653
278
  let n = t.toLowerCase().trim();
2654
279
  return e.reduce((e, r) => {
2655
280
  if (r.type === "separator") return e;
2656
281
  if (r.type === "group" && r.children?.length) {
2657
- let n = Fr(r.children, t);
282
+ let n = Z(r.children, t);
2658
283
  return n.length > 0 && e.push({
2659
284
  ...r,
2660
285
  children: n
2661
286
  }), e;
2662
287
  }
2663
- return Ar(r.label).toLowerCase().includes(n) && e.push(r), e;
288
+ return X(r.label).toLowerCase().includes(n) && e.push(r), e;
2664
289
  }, []);
2665
290
  }
2666
- var Ir = 5;
2667
- function Lr({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enablePinning: a, onPinToggle: o, enableReorder: s, resolveObjectLabel: c, resolveDashboardLabel: l, resolveGroupLabel: u, t: d }) {
2668
- let { attributes: f, listeners: p, setNodeRef: m, transform: h, transition: g, isDragging: _ } = Dr({
291
+ var we = 5;
292
+ function Te({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enablePinning: a, onPinToggle: o, enableReorder: s, resolveObjectLabel: c, resolveDashboardLabel: l, resolveGroupLabel: u, t: d }) {
293
+ let { attributes: f, listeners: p, setNodeRef: m, transform: h, transition: g, isDragging: _ } = ce({
2669
294
  id: e.id,
2670
295
  disabled: !s
2671
296
  });
2672
- return /* @__PURE__ */ (0, G.jsx)("div", {
297
+ return /* @__PURE__ */ j("div", {
2673
298
  ref: m,
2674
299
  style: {
2675
- transform: Ge.Transform.toString(h),
300
+ transform: ue.Transform.toString(h),
2676
301
  transition: g,
2677
302
  opacity: _ ? .5 : void 0,
2678
303
  zIndex: _ ? 10 : void 0
2679
304
  },
2680
305
  ...f,
2681
- children: /* @__PURE__ */ (0, G.jsx)(Rr, {
306
+ children: /* @__PURE__ */ j(Q, {
2682
307
  item: e,
2683
308
  basePath: t,
2684
309
  evalVis: n,
@@ -2694,291 +319,291 @@ function Lr({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enabl
2694
319
  })
2695
320
  });
2696
321
  }
2697
- function Rr({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, enablePinning: a, onPinToggle: o, dragListeners: s, resolveObjectLabel: c, resolveDashboardLabel: l, resolveGroupLabel: u, t: g }) {
2698
- let v = L(), [y, b] = d(e.defaultOpen !== !1);
322
+ function Q({ item: e, basePath: t, evalVis: n, checkPerm: r, onAction: l, enablePinning: d, onPinToggle: f, dragListeners: p, resolveObjectLabel: _, resolveDashboardLabel: v, resolveGroupLabel: y, t: w }) {
323
+ let T = F(), [E, D] = i(e.defaultOpen !== !1);
2699
324
  if (!n(e.visible) || e.requiredPermissions?.length && !r(e.requiredPermissions)) return null;
2700
- if (e.type === "separator") return /* @__PURE__ */ (0, G.jsx)(_, { className: "my-2" });
325
+ if (e.type === "separator") return /* @__PURE__ */ j(u, { className: "my-2" });
2701
326
  if (e.type === "group") {
2702
- let s = (e.children ?? []).slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
2703
- return /* @__PURE__ */ (0, G.jsx)(p, {
2704
- open: y,
2705
- onOpenChange: b,
2706
- children: /* @__PURE__ */ (0, G.jsxs)(x, { children: [/* @__PURE__ */ (0, G.jsx)(C, {
327
+ let i = (e.children ?? []).slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0));
328
+ return /* @__PURE__ */ j(o, {
329
+ open: E,
330
+ onOpenChange: D,
331
+ children: /* @__PURE__ */ M(m, { children: [/* @__PURE__ */ j(g, {
2707
332
  asChild: !0,
2708
- children: /* @__PURE__ */ (0, G.jsxs)(h, {
333
+ children: /* @__PURE__ */ M(c, {
2709
334
  className: "flex w-full items-center justify-between",
2710
- children: [jr(e, c, g, l, u), /* @__PURE__ */ (0, G.jsx)(R, { className: `ml-auto h-4 w-4 transition-transform ${y ? "rotate-90" : ""}` })]
335
+ children: [be(e, _, w, v, y), /* @__PURE__ */ j(I, { className: `ml-auto h-4 w-4 transition-transform ${E ? "rotate-90" : ""}` })]
2711
336
  })
2712
- }), /* @__PURE__ */ (0, G.jsx)(m, { children: /* @__PURE__ */ (0, G.jsx)(S, { children: /* @__PURE__ */ (0, G.jsx)(D, { children: s.map((e) => /* @__PURE__ */ (0, G.jsx)(Rr, {
337
+ }), /* @__PURE__ */ j(s, { children: /* @__PURE__ */ j(h, { children: /* @__PURE__ */ j(b, { children: i.map((e) => /* @__PURE__ */ j(Q, {
2713
338
  item: e,
2714
339
  basePath: t,
2715
340
  evalVis: n,
2716
341
  checkPerm: r,
2717
- onAction: i,
2718
- enablePinning: a,
2719
- onPinToggle: o,
2720
- resolveObjectLabel: c,
2721
- resolveDashboardLabel: l,
2722
- resolveGroupLabel: u,
2723
- t: g
342
+ onAction: l,
343
+ enablePinning: d,
344
+ onPinToggle: f,
345
+ resolveObjectLabel: _,
346
+ resolveDashboardLabel: v,
347
+ resolveGroupLabel: y,
348
+ t: w
2724
349
  }, e.id)) }) }) })] })
2725
350
  });
2726
351
  }
2727
352
  if (e.type === "action") {
2728
- let t = kr(e.icon), n = Ar(e.label, g);
2729
- return /* @__PURE__ */ (0, G.jsxs)(A, { children: [
2730
- s && /* @__PURE__ */ (0, G.jsx)("span", {
353
+ let t = Y(e.icon), n = X(e.label, w);
354
+ return /* @__PURE__ */ M(C, { children: [
355
+ p && /* @__PURE__ */ j("span", {
2731
356
  className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground",
2732
- "aria-label": g ? g("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
2733
- ...s,
2734
- children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-3.5 w-3.5" })
357
+ "aria-label": w ? w("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
358
+ ...p,
359
+ children: /* @__PURE__ */ j(R, { className: "h-3.5 w-3.5" })
2735
360
  }),
2736
- /* @__PURE__ */ (0, G.jsxs)(k, {
361
+ /* @__PURE__ */ M(S, {
2737
362
  tooltip: n,
2738
- onClick: () => i?.(e),
363
+ onClick: () => l?.(e),
2739
364
  children: [
2740
- /* @__PURE__ */ (0, G.jsx)(t, { className: "h-4 w-4" }),
2741
- /* @__PURE__ */ (0, G.jsx)("span", { children: n }),
2742
- e.badge != null && /* @__PURE__ */ (0, G.jsx)(f, {
365
+ /* @__PURE__ */ j(t, { className: "h-4 w-4" }),
366
+ /* @__PURE__ */ j("span", { children: n }),
367
+ e.badge != null && /* @__PURE__ */ j(a, {
2743
368
  variant: e.badgeVariant ?? "default",
2744
369
  className: "ml-auto text-[10px] px-1.5 py-0",
2745
370
  children: e.badge
2746
371
  })
2747
372
  ]
2748
373
  }),
2749
- a && o && /* @__PURE__ */ (0, G.jsx)(O, {
374
+ d && f && /* @__PURE__ */ j(x, {
2750
375
  showOnHover: !0,
2751
- onClick: () => o(e.id, !e.pinned),
2752
- "aria-label": g ? g(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
376
+ onClick: () => f(e.id, !e.pinned),
377
+ "aria-label": w ? w(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
2753
378
  defaultValue: e.pinned ? `Unpin ${n}` : `Pin ${n}`,
2754
379
  name: n
2755
380
  }) : e.pinned ? `Unpin ${n}` : `Pin ${n}`,
2756
- children: e.pinned ? /* @__PURE__ */ (0, G.jsx)(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, G.jsx)(re, { className: "h-3.5 w-3.5" })
381
+ children: e.pinned ? /* @__PURE__ */ j(V, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ j(B, { className: "h-3.5 w-3.5" })
2757
382
  })
2758
383
  ] });
2759
384
  }
2760
- let w = kr(e.icon), { href: T, external: E } = Pr(e, t), j = T !== "#" && v.pathname.startsWith(T), M = jr(e, c, g, l, u), ee = /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [
2761
- /* @__PURE__ */ (0, G.jsx)(w, { className: "h-4 w-4" }),
2762
- /* @__PURE__ */ (0, G.jsx)("span", { children: M }),
2763
- e.badge != null && /* @__PURE__ */ (0, G.jsx)(f, {
385
+ let O = Y(e.icon), { href: k, external: P } = Ce(e, t), L = k !== "#" && T.pathname.startsWith(k), z = be(e, _, w, v, y), H = /* @__PURE__ */ M(A, { children: [
386
+ /* @__PURE__ */ j(O, { className: "h-4 w-4" }),
387
+ /* @__PURE__ */ j("span", { children: z }),
388
+ e.badge != null && /* @__PURE__ */ j(a, {
2764
389
  variant: e.badgeVariant ?? "default",
2765
390
  className: "ml-auto text-[10px] px-1.5 py-0",
2766
391
  children: e.badge
2767
392
  })
2768
393
  ] });
2769
- return /* @__PURE__ */ (0, G.jsxs)(A, { children: [
2770
- s && /* @__PURE__ */ (0, G.jsx)("span", {
394
+ return /* @__PURE__ */ M(C, { children: [
395
+ p && /* @__PURE__ */ j("span", {
2771
396
  className: "absolute left-0.5 top-1/2 -translate-y-1/2 cursor-grab text-muted-foreground",
2772
- "aria-label": g ? g("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
2773
- ...s,
2774
- children: /* @__PURE__ */ (0, G.jsx)(z, { className: "h-3.5 w-3.5" })
397
+ "aria-label": w ? w("console.nav.dragToReorder", { defaultValue: "Drag to reorder" }) : "Drag to reorder",
398
+ ...p,
399
+ children: /* @__PURE__ */ j(R, { className: "h-3.5 w-3.5" })
2775
400
  }),
2776
- /* @__PURE__ */ (0, G.jsx)(k, {
401
+ /* @__PURE__ */ j(S, {
2777
402
  asChild: !0,
2778
- isActive: j,
2779
- tooltip: M,
2780
- children: E ? /* @__PURE__ */ (0, G.jsx)("a", {
2781
- href: T,
403
+ isActive: L,
404
+ tooltip: z,
405
+ children: P ? /* @__PURE__ */ j("a", {
406
+ href: k,
2782
407
  target: "_blank",
2783
408
  rel: "noopener noreferrer",
2784
- children: ee
2785
- }) : /* @__PURE__ */ (0, G.jsx)(I, {
2786
- to: T,
2787
- children: ee
409
+ children: H
410
+ }) : /* @__PURE__ */ j(N, {
411
+ to: k,
412
+ children: H
2788
413
  })
2789
414
  }),
2790
- a && o && /* @__PURE__ */ (0, G.jsx)(O, {
415
+ d && f && /* @__PURE__ */ j(x, {
2791
416
  showOnHover: !0,
2792
- onClick: () => o(e.id, !e.pinned),
2793
- "aria-label": g ? g(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
2794
- defaultValue: e.pinned ? `Unpin ${M}` : `Pin ${M}`,
2795
- name: M
2796
- }) : e.pinned ? `Unpin ${M}` : `Pin ${M}`,
2797
- children: e.pinned ? /* @__PURE__ */ (0, G.jsx)(ie, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ (0, G.jsx)(re, { className: "h-3.5 w-3.5" })
417
+ onClick: () => f(e.id, !e.pinned),
418
+ "aria-label": w ? w(e.pinned ? "console.nav.unpinItem" : "console.nav.pinItem", {
419
+ defaultValue: e.pinned ? `Unpin ${z}` : `Pin ${z}`,
420
+ name: z
421
+ }) : e.pinned ? `Unpin ${z}` : `Pin ${z}`,
422
+ children: e.pinned ? /* @__PURE__ */ j(V, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ j(B, { className: "h-3.5 w-3.5" })
2798
423
  })
2799
424
  ] });
2800
425
  }
2801
- function zr({ items: e, basePath: t = "", evaluateVisibility: n = Mr, checkPermission: r = Nr, onAction: i, searchQuery: a, enablePinning: o, onPinToggle: s, enableReorder: l, onReorder: u, resolveObjectLabel: d, resolveDashboardLabel: f, resolveGroupLabel: p, t: m }) {
2802
- let h = c(() => a ? Fr(e, a) : e, [e, a]), g = c(() => Br(h), [h]), _ = h.slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), v = ot(at(nn, { activationConstraint: { distance: Ir } }), at(Zt)), y = (e) => {
426
+ function $({ items: e, basePath: t = "", evaluateVisibility: n = xe, checkPermission: i = Se, onAction: a, searchQuery: o, enablePinning: s, onPinToggle: c, enableReorder: l, onReorder: u, resolveObjectLabel: d, resolveDashboardLabel: f, resolveGroupLabel: p, t: _ }) {
427
+ let v = r(() => o ? Z(e, o) : e, [e, o]), y = r(() => Ee(v), [v]), x = v.slice().sort((e, t) => (e.order ?? 0) - (t.order ?? 0)), S = ae(U(re, { activationConstraint: { distance: we } }), U(ne)), C = (e) => {
2803
428
  let { active: t, over: n } = e;
2804
429
  if (!n || t.id === n.id || !u) return;
2805
- let r = _.findIndex((e) => e.id === t.id), i = _.findIndex((e) => e.id === n.id);
2806
- r === -1 || i === -1 || u(cr(_, r, i).map((e, t) => ({
430
+ let r = x.findIndex((e) => e.id === t.id), i = x.findIndex((e) => e.id === n.id);
431
+ r === -1 || i === -1 || u(se(x, r, i).map((e, t) => ({
2807
432
  ...e,
2808
433
  order: t
2809
434
  })));
2810
- }, b = {
435
+ }, w = {
2811
436
  basePath: t,
2812
437
  evalVis: n,
2813
- checkPerm: r,
2814
- onAction: i,
2815
- enablePinning: o,
2816
- onPinToggle: s,
438
+ checkPerm: i,
439
+ onAction: a,
440
+ enablePinning: s,
441
+ onPinToggle: c,
2817
442
  resolveObjectLabel: d,
2818
443
  resolveDashboardLabel: f,
2819
444
  resolveGroupLabel: p,
2820
- t: m
2821
- }, w = _.some((e) => e.type === "group"), T = g.length > 0 && o ? /* @__PURE__ */ (0, G.jsxs)(x, { children: [/* @__PURE__ */ (0, G.jsxs)(C, {
445
+ t: _
446
+ }, T = x.some((e) => e.type === "group"), E = y.length > 0 && s ? /* @__PURE__ */ M(m, { children: [/* @__PURE__ */ M(g, {
2822
447
  className: "flex items-center gap-1.5",
2823
- children: [/* @__PURE__ */ (0, G.jsx)(V, { className: "h-3.5 w-3.5" }), m ? m("console.nav.favorites", { defaultValue: "Favorites" }) : "Favorites"]
2824
- }), /* @__PURE__ */ (0, G.jsx)(S, { children: /* @__PURE__ */ (0, G.jsx)(D, { children: g.map((e) => /* @__PURE__ */ (0, G.jsx)(Rr, {
448
+ children: [/* @__PURE__ */ j(ee, { className: "h-3.5 w-3.5" }), _ ? _("console.nav.favorites", { defaultValue: "Favorites" }) : "Favorites"]
449
+ }), /* @__PURE__ */ j(h, { children: /* @__PURE__ */ j(b, { children: y.map((e) => /* @__PURE__ */ j(Q, {
2825
450
  item: e,
2826
- ...b
451
+ ...w
2827
452
  }, `fav-${e.id}`)) }) })] }) : null;
2828
- if (!w) {
2829
- let e = _.filter((e) => e.type !== "group").map((e) => e.id);
2830
- return /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [T, /* @__PURE__ */ (0, G.jsx)(x, { children: /* @__PURE__ */ (0, G.jsx)(S, { children: l ? /* @__PURE__ */ (0, G.jsx)($n, {
2831
- sensors: v,
2832
- collisionDetection: ft,
2833
- onDragEnd: y,
2834
- children: /* @__PURE__ */ (0, G.jsx)(yr, {
453
+ if (!T) {
454
+ let e = x.filter((e) => e.type !== "group").map((e) => e.id);
455
+ return /* @__PURE__ */ M(A, { children: [E, /* @__PURE__ */ j(m, { children: /* @__PURE__ */ j(h, { children: l ? /* @__PURE__ */ j(te, {
456
+ sensors: S,
457
+ collisionDetection: ie,
458
+ onDragEnd: C,
459
+ children: /* @__PURE__ */ j(oe, {
2835
460
  items: e,
2836
- strategy: hr,
2837
- children: /* @__PURE__ */ (0, G.jsx)(D, { children: _.map((e) => /* @__PURE__ */ (0, G.jsx)(Lr, {
461
+ strategy: le,
462
+ children: /* @__PURE__ */ j(b, { children: x.map((e) => /* @__PURE__ */ j(Te, {
2838
463
  item: e,
2839
464
  enableReorder: l,
2840
- ...b
465
+ ...w
2841
466
  }, e.id)) })
2842
467
  })
2843
- }) : /* @__PURE__ */ (0, G.jsx)(D, { children: _.map((e) => /* @__PURE__ */ (0, G.jsx)(Rr, {
468
+ }) : /* @__PURE__ */ j(b, { children: x.map((e) => /* @__PURE__ */ j(Q, {
2844
469
  item: e,
2845
- ...b
470
+ ...w
2846
471
  }, e.id)) }) }) })] });
2847
472
  }
2848
- let E = [], O = [], k = (e) => {
473
+ let D = [], O = [], k = (e) => {
2849
474
  if (O.length === 0) return;
2850
475
  let t = O;
2851
- O = [], E.push(/* @__PURE__ */ (0, G.jsx)(x, { children: /* @__PURE__ */ (0, G.jsx)(S, { children: /* @__PURE__ */ (0, G.jsx)(D, { children: t.map((e) => /* @__PURE__ */ (0, G.jsx)(Rr, {
476
+ O = [], D.push(/* @__PURE__ */ j(m, { children: /* @__PURE__ */ j(h, { children: /* @__PURE__ */ j(b, { children: t.map((e) => /* @__PURE__ */ j(Q, {
2852
477
  item: e,
2853
- ...b
478
+ ...w
2854
479
  }, e.id)) }) }) }, e));
2855
480
  };
2856
- return _.forEach((e, t) => {
2857
- e.type === "group" ? (k(`leaf-${t}`), E.push(/* @__PURE__ */ (0, G.jsx)(Rr, {
481
+ return x.forEach((e, t) => {
482
+ e.type === "group" ? (k(`leaf-${t}`), D.push(/* @__PURE__ */ j(Q, {
2858
483
  item: e,
2859
- ...b
484
+ ...w
2860
485
  }, e.id))) : O.push(e);
2861
- }), k("leaf-end"), /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [T, E] });
486
+ }), k("leaf-end"), /* @__PURE__ */ M(A, { children: [E, D] });
2862
487
  }
2863
- function Br(e) {
488
+ function Ee(e) {
2864
489
  let t = [];
2865
- for (let n of e) n.pinned && n.type !== "group" && n.type !== "separator" && t.push(n), n.children?.length && t.push(...Br(n.children));
490
+ for (let n of e) n.pinned && n.type !== "group" && n.type !== "separator" && t.push(n), n.children?.length && t.push(...Ee(n.children));
2866
491
  return t;
2867
492
  }
2868
493
  //#endregion
2869
494
  //#region src/AppSchemaRenderer.tsx
2870
- function Vr({ areas: e, activeAreaId: t, onAreaChange: n, evalVis: r, checkPerm: i }) {
495
+ function De({ areas: e, activeAreaId: t, onAreaChange: n, evalVis: r, checkPerm: i }) {
2871
496
  let a = e.filter((e) => !(!r(e.visible) || e.requiredPermissions?.length && !i(e.requiredPermissions)));
2872
- return a.length <= 1 ? null : /* @__PURE__ */ (0, G.jsxs)(x, { children: [/* @__PURE__ */ (0, G.jsxs)(C, {
497
+ return a.length <= 1 ? null : /* @__PURE__ */ M(m, { children: [/* @__PURE__ */ M(g, {
2873
498
  className: "flex items-center gap-1.5",
2874
- children: [/* @__PURE__ */ (0, G.jsx)(B, { className: "h-3.5 w-3.5" }), "Area"]
2875
- }), /* @__PURE__ */ (0, G.jsx)(S, { children: /* @__PURE__ */ (0, G.jsx)(D, { children: a.map((e) => {
2876
- let r = kr(e.icon);
2877
- return /* @__PURE__ */ (0, G.jsx)(A, { children: /* @__PURE__ */ (0, G.jsxs)(k, {
499
+ children: [/* @__PURE__ */ j(z, { className: "h-3.5 w-3.5" }), "Area"]
500
+ }), /* @__PURE__ */ j(h, { children: /* @__PURE__ */ j(b, { children: a.map((e) => {
501
+ let r = Y(e.icon);
502
+ return /* @__PURE__ */ j(C, { children: /* @__PURE__ */ M(S, {
2878
503
  isActive: e.id === t,
2879
- tooltip: Ar(e.label),
504
+ tooltip: X(e.label),
2880
505
  onClick: () => n(e.id),
2881
- children: [/* @__PURE__ */ (0, G.jsx)(r, { className: "h-4 w-4" }), /* @__PURE__ */ (0, G.jsx)("span", { children: Ar(e.label) })]
506
+ children: [/* @__PURE__ */ j(r, { className: "h-4 w-4" }), /* @__PURE__ */ j("span", { children: X(e.label) })]
2882
507
  }) }, e.id);
2883
508
  }) }) })] });
2884
509
  }
2885
- function Hr({ items: e, basePath: t }) {
2886
- let n = L(), r = e.filter((e) => e.type !== "group" && e.type !== "separator").slice(0, 5);
2887
- return r.length === 0 ? null : /* @__PURE__ */ (0, G.jsx)("div", {
510
+ function Oe({ items: e, basePath: t }) {
511
+ let n = F(), r = e.filter((e) => e.type !== "group" && e.type !== "separator").slice(0, 5);
512
+ return r.length === 0 ? null : /* @__PURE__ */ j("div", {
2888
513
  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",
2889
514
  role: "navigation",
2890
515
  "aria-label": "Mobile navigation",
2891
516
  children: r.map((e) => {
2892
- let r = kr(e.icon), i = "#";
517
+ let r = Y(e.icon), i = "#";
2893
518
  e.type === "object" ? (i = `${t}/${e.objectName}`, e.viewName && (i += `/view/${e.viewName}`)) : e.type === "dashboard" ? i = e.dashboardName ? `${t}/dashboard/${e.dashboardName}` : "#" : e.type === "page" ? i = e.pageName ? `${t}/page/${e.pageName}` : "#" : e.type === "report" ? i = e.reportName ? `${t}/report/${e.reportName}` : "#" : e.type === "url" && (i = e.url ?? "#");
2894
519
  let a = i !== "#" && n.pathname.startsWith(i);
2895
- return /* @__PURE__ */ (0, G.jsxs)(I, {
520
+ return /* @__PURE__ */ M(N, {
2896
521
  to: i,
2897
522
  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"}`,
2898
- children: [/* @__PURE__ */ (0, G.jsx)(r, { className: "h-5 w-5" }), /* @__PURE__ */ (0, G.jsx)("span", {
523
+ children: [/* @__PURE__ */ j(r, { className: "h-5 w-5" }), /* @__PURE__ */ j("span", {
2899
524
  className: "text-[10px] truncate max-w-[60px]",
2900
- children: Ar(e.label)
525
+ children: X(e.label)
2901
526
  })]
2902
527
  }, e.id);
2903
528
  })
2904
529
  });
2905
530
  }
2906
- function Ur({ schema: e, basePath: t, evalVis: n, checkPerm: r, onAction: i, sidebarHeader: a, sidebarFooter: o, sidebarExtra: s, activeAreaId: c, setActiveAreaId: l, resolvedNavigation: u, enableSearch: f, enablePinning: p, onPinToggle: m, enableReorder: h, onReorder: g }) {
2907
- let _ = kr(e.logo), x = e.areas ?? [], [S, C] = d("");
2908
- return /* @__PURE__ */ (0, G.jsxs)(v, {
531
+ function ke({ schema: e, basePath: t, evalVis: n, checkPerm: r, onAction: a, sidebarHeader: o, sidebarFooter: s, sidebarExtra: c, activeAreaId: l, setActiveAreaId: u, resolvedNavigation: m, enableSearch: h, enablePinning: g, onPinToggle: y, enableReorder: x, onReorder: w }) {
532
+ let T = Y(e.logo), E = e.areas ?? [], [D, O] = i("");
533
+ return /* @__PURE__ */ M(d, {
2909
534
  collapsible: "icon",
2910
535
  children: [
2911
- /* @__PURE__ */ (0, G.jsxs)(w, { children: [a ?? /* @__PURE__ */ (0, G.jsx)(D, { children: /* @__PURE__ */ (0, G.jsx)(A, { children: /* @__PURE__ */ (0, G.jsxs)(k, {
536
+ /* @__PURE__ */ M(_, { children: [o ?? /* @__PURE__ */ j(b, { children: /* @__PURE__ */ j(C, { children: /* @__PURE__ */ M(S, {
2912
537
  size: "lg",
2913
538
  tooltip: e.title ?? e.name,
2914
- children: [/* @__PURE__ */ (0, G.jsx)("div", {
539
+ children: [/* @__PURE__ */ j("div", {
2915
540
  className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-primary text-primary-foreground",
2916
- children: e.logo && e.logo.startsWith("http") ? /* @__PURE__ */ (0, G.jsx)("img", {
541
+ children: e.logo && e.logo.startsWith("http") ? /* @__PURE__ */ j("img", {
2917
542
  src: e.logo,
2918
543
  alt: e.title ?? "",
2919
544
  className: "size-6 object-contain"
2920
- }) : /* @__PURE__ */ (0, G.jsx)(_, { className: "size-4" })
2921
- }), /* @__PURE__ */ (0, G.jsxs)("div", {
545
+ }) : /* @__PURE__ */ j(T, { className: "size-4" })
546
+ }), /* @__PURE__ */ M("div", {
2922
547
  className: "grid flex-1 text-left text-sm leading-tight",
2923
- children: [/* @__PURE__ */ (0, G.jsx)("span", {
548
+ children: [/* @__PURE__ */ j("span", {
2924
549
  className: "truncate font-semibold",
2925
550
  children: e.title ?? e.name ?? "App"
2926
- }), e.description && /* @__PURE__ */ (0, G.jsx)("span", {
551
+ }), e.description && /* @__PURE__ */ j("span", {
2927
552
  className: "truncate text-xs text-muted-foreground",
2928
553
  children: e.description
2929
554
  })]
2930
555
  })]
2931
- }) }) }), f && /* @__PURE__ */ (0, G.jsx)(T, {
556
+ }) }) }), h && /* @__PURE__ */ j(v, {
2932
557
  placeholder: "Search navigation…",
2933
- value: S,
2934
- onChange: (e) => C(e.target.value),
558
+ value: D,
559
+ onChange: (e) => O(e.target.value),
2935
560
  "aria-label": "Search navigation"
2936
561
  })] }),
2937
- /* @__PURE__ */ (0, G.jsxs)(y, { children: [
2938
- x.length > 1 && c && /* @__PURE__ */ (0, G.jsx)(Vr, {
2939
- areas: x,
2940
- activeAreaId: c,
2941
- onAreaChange: l,
562
+ /* @__PURE__ */ M(f, { children: [
563
+ E.length > 1 && l && /* @__PURE__ */ j(De, {
564
+ areas: E,
565
+ activeAreaId: l,
566
+ onAreaChange: u,
2942
567
  evalVis: n,
2943
568
  checkPerm: r
2944
569
  }),
2945
- /* @__PURE__ */ (0, G.jsx)(zr, {
2946
- items: u,
570
+ /* @__PURE__ */ j($, {
571
+ items: m,
2947
572
  basePath: t,
2948
573
  evaluateVisibility: n,
2949
574
  checkPermission: r,
2950
- onAction: i,
2951
- searchQuery: S,
2952
- enablePinning: p,
2953
- onPinToggle: m,
2954
- enableReorder: h,
2955
- onReorder: g
575
+ onAction: a,
576
+ searchQuery: D,
577
+ enablePinning: g,
578
+ onPinToggle: y,
579
+ enableReorder: x,
580
+ onReorder: w
2956
581
  }),
2957
- s
582
+ c
2958
583
  ] }),
2959
- o && /* @__PURE__ */ (0, G.jsx)(b, { children: o })
584
+ s && /* @__PURE__ */ j(p, { children: s })
2960
585
  ]
2961
586
  });
2962
587
  }
2963
- function Wr({ schema: e, basePath: t = "", mobileNavMode: n = "drawer", evaluateVisibility: r, checkPermission: i, onAction: a, navbar: s, sidebarHeader: l, sidebarFooter: u, sidebarExtra: f, children: p, className: m, defaultOpen: h = !0, enableSearch: g, enablePinning: _, onPinToggle: v, enableReorder: y, onReorder: b }) {
2964
- let x = r ?? ((e) => !(e === !1 || e === "false")), S = i ?? (() => !0), C = c(() => (e.menu ?? []).map((e, t) => U(e, t)), [e.menu]), w = e.navigation ?? C, T = e.areas ?? [], [E, D] = d(() => T.length > 0 ? T[0].id : null), O = T.map((e) => e.id).join(",");
2965
- o(() => {
588
+ function Ae({ schema: e, basePath: t = "", mobileNavMode: a = "drawer", evaluateVisibility: o, checkPermission: s, onAction: c, navbar: l, sidebarHeader: u, sidebarFooter: d, sidebarExtra: f, children: p, className: m, defaultOpen: h = !0, enableSearch: g, enablePinning: _, onPinToggle: v, enableReorder: y, onReorder: b }) {
589
+ let x = o ?? ((e) => !(e === !1 || e === "false")), S = s ?? (() => !0), C = r(() => (e.menu ?? []).map((e, t) => de(e, t)), [e.menu]), w = e.navigation ?? C, T = e.areas ?? [], [E, D] = i(() => T.length > 0 ? T[0].id : null), O = T.map((e) => e.id).join(",");
590
+ n(() => {
2966
591
  T.length > 0 ? D((e) => T.some((t) => t.id === e) ? e : T[0].id) : D(null);
2967
592
  }, [e.name, O]);
2968
- let k = T.find((e) => e.id === E)?.navigation ?? w, A = {
593
+ let k = T.find((e) => e.id === E)?.navigation ?? w, N = {
2969
594
  title: e.title,
2970
595
  favicon: e.favicon,
2971
596
  logo: e.logo
2972
597
  };
2973
- return /* @__PURE__ */ (0, G.jsxs)(G.Fragment, { children: [/* @__PURE__ */ (0, G.jsx)(ge, {
2974
- sidebar: /* @__PURE__ */ (0, G.jsx)(Ur, {
598
+ return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(J, {
599
+ sidebar: /* @__PURE__ */ j(ke, {
2975
600
  schema: e,
2976
601
  basePath: t,
2977
602
  evalVis: x,
2978
603
  checkPerm: S,
2979
- onAction: a,
2980
- sidebarHeader: l,
2981
- sidebarFooter: u,
604
+ onAction: c,
605
+ sidebarHeader: u,
606
+ sidebarFooter: d,
2982
607
  sidebarExtra: f,
2983
608
  activeAreaId: E,
2984
609
  setActiveAreaId: D,
@@ -2989,31 +614,31 @@ function Wr({ schema: e, basePath: t = "", mobileNavMode: n = "drawer", evaluate
2989
614
  enableReorder: y,
2990
615
  onReorder: b
2991
616
  }),
2992
- navbar: s,
617
+ navbar: l,
2993
618
  className: m,
2994
619
  defaultOpen: h,
2995
- branding: A,
620
+ branding: N,
2996
621
  children: p
2997
- }), n === "bottom_nav" && /* @__PURE__ */ (0, G.jsx)(Hr, {
622
+ }), a === "bottom_nav" && /* @__PURE__ */ j(Oe, {
2998
623
  items: k,
2999
624
  basePath: t
3000
625
  })] });
3001
626
  }
3002
627
  //#endregion
3003
628
  //#region src/Page.tsx
3004
- var Gr = (e) => e ? Array.isArray(e) ? e : [e] : [];
3005
- function Kr({ schema: e, className: t, style: n, id: r, ...i }) {
3006
- let a = Gr(e.children);
3007
- return /* @__PURE__ */ (0, G.jsxs)("div", {
629
+ var je = (e) => e ? Array.isArray(e) ? e : [e] : [];
630
+ function Me({ schema: e, className: t, style: n, id: r, ...i }) {
631
+ let a = je(e.children);
632
+ return /* @__PURE__ */ M("div", {
3008
633
  id: r || e.id,
3009
- className: P("flex flex-col h-full space-y-4", t),
634
+ className: O("flex flex-col h-full space-y-4", t),
3010
635
  style: n,
3011
- children: [/* @__PURE__ */ (0, G.jsx)(de, {
636
+ children: [/* @__PURE__ */ j(W, {
3012
637
  title: e.title,
3013
638
  description: e.description
3014
- }), /* @__PURE__ */ (0, G.jsx)("div", {
639
+ }), /* @__PURE__ */ j("div", {
3015
640
  className: "flex-1 overflow-auto",
3016
- children: a.map((e, t) => /* @__PURE__ */ (0, G.jsx)(se, {
641
+ children: a.map((e, t) => /* @__PURE__ */ j(fe, {
3017
642
  schema: e,
3018
643
  ...i
3019
644
  }, e?.id || t))
@@ -3022,38 +647,38 @@ function Kr({ schema: e, className: t, style: n, id: r, ...i }) {
3022
647
  }
3023
648
  //#endregion
3024
649
  //#region src/SidebarNav.tsx
3025
- function qr(e) {
650
+ function Ne(e) {
3026
651
  return "items" in e && !("href" in e);
3027
652
  }
3028
- function Jr({ item: e, pathname: t }) {
3029
- return e.children && e.children.length > 0 ? /* @__PURE__ */ (0, G.jsx)(p, {
653
+ function Pe({ item: e, pathname: t }) {
654
+ return e.children && e.children.length > 0 ? /* @__PURE__ */ j(o, {
3030
655
  asChild: !0,
3031
656
  defaultOpen: !0,
3032
657
  className: "group/collapsible",
3033
- children: /* @__PURE__ */ (0, G.jsxs)(A, { children: [/* @__PURE__ */ (0, G.jsx)(h, {
658
+ children: /* @__PURE__ */ M(C, { children: [/* @__PURE__ */ j(c, {
3034
659
  asChild: !0,
3035
- children: /* @__PURE__ */ (0, G.jsxs)(k, {
660
+ children: /* @__PURE__ */ M(S, {
3036
661
  tooltip: e.title,
3037
662
  children: [
3038
- e.icon && /* @__PURE__ */ (0, G.jsx)(e.icon, {}),
3039
- /* @__PURE__ */ (0, G.jsx)("span", { children: e.title }),
3040
- e.badge != null && /* @__PURE__ */ (0, G.jsx)(f, {
663
+ e.icon && /* @__PURE__ */ j(e.icon, {}),
664
+ /* @__PURE__ */ j("span", { children: e.title }),
665
+ e.badge != null && /* @__PURE__ */ j(a, {
3041
666
  variant: e.badgeVariant || "default",
3042
667
  className: "ml-auto mr-1 h-5 min-w-5 px-1 text-xs",
3043
668
  children: e.badge
3044
669
  }),
3045
- /* @__PURE__ */ (0, G.jsx)(R, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
670
+ /* @__PURE__ */ j(I, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })
3046
671
  ]
3047
672
  })
3048
- }), /* @__PURE__ */ (0, G.jsx)(m, { children: /* @__PURE__ */ (0, G.jsx)(j, { children: e.children.map((e) => /* @__PURE__ */ (0, G.jsx)(ee, { children: /* @__PURE__ */ (0, G.jsx)(M, {
673
+ }), /* @__PURE__ */ j(s, { children: /* @__PURE__ */ j(w, { children: e.children.map((e) => /* @__PURE__ */ j(E, { children: /* @__PURE__ */ j(T, {
3049
674
  asChild: !0,
3050
675
  isActive: t === e.href,
3051
- children: /* @__PURE__ */ (0, G.jsxs)(te, {
676
+ children: /* @__PURE__ */ M(P, {
3052
677
  to: e.href,
3053
678
  children: [
3054
- e.icon && /* @__PURE__ */ (0, G.jsx)(e.icon, {}),
3055
- /* @__PURE__ */ (0, G.jsx)("span", { children: e.title }),
3056
- e.badge != null && /* @__PURE__ */ (0, G.jsx)(f, {
679
+ e.icon && /* @__PURE__ */ j(e.icon, {}),
680
+ /* @__PURE__ */ j("span", { children: e.title }),
681
+ e.badge != null && /* @__PURE__ */ j(a, {
3057
682
  variant: e.badgeVariant || "default",
3058
683
  className: "ml-auto h-5 min-w-5 px-1 text-xs",
3059
684
  children: e.badge
@@ -3061,16 +686,16 @@ function Jr({ item: e, pathname: t }) {
3061
686
  ]
3062
687
  })
3063
688
  }) }, e.href)) }) })] })
3064
- }) : /* @__PURE__ */ (0, G.jsx)(A, { children: /* @__PURE__ */ (0, G.jsx)(k, {
689
+ }) : /* @__PURE__ */ j(C, { children: /* @__PURE__ */ j(S, {
3065
690
  asChild: !0,
3066
691
  isActive: t === e.href,
3067
692
  tooltip: e.title,
3068
- children: /* @__PURE__ */ (0, G.jsxs)(te, {
693
+ children: /* @__PURE__ */ M(P, {
3069
694
  to: e.href,
3070
695
  children: [
3071
- e.icon && /* @__PURE__ */ (0, G.jsx)(e.icon, {}),
3072
- /* @__PURE__ */ (0, G.jsx)("span", { children: e.title }),
3073
- e.badge != null && /* @__PURE__ */ (0, G.jsx)(f, {
696
+ e.icon && /* @__PURE__ */ j(e.icon, {}),
697
+ /* @__PURE__ */ j("span", { children: e.title }),
698
+ e.badge != null && /* @__PURE__ */ j(a, {
3074
699
  variant: e.badgeVariant || "default",
3075
700
  className: "ml-auto h-5 min-w-5 px-1 text-xs",
3076
701
  children: e.badge
@@ -3079,43 +704,43 @@ function Jr({ item: e, pathname: t }) {
3079
704
  })
3080
705
  }) });
3081
706
  }
3082
- function Yr({ items: e, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search..." }) {
3083
- let s = L(), [c, l] = t.useState(""), u = t.useMemo(() => e.length === 0 ? [] : qr(e[0]) ? e.map((e) => ({
707
+ function Fe({ items: e, title: n = "Application", className: r, collapsible: i = "icon", searchEnabled: a = !1, searchPlaceholder: o = "Search..." }) {
708
+ let s = F(), [c, u] = t.useState(""), p = t.useMemo(() => e.length === 0 ? [] : Ne(e[0]) ? e.map((e) => ({
3084
709
  groupLabel: e.label,
3085
710
  items: e.items
3086
- })) : [{ items: e }], [e]), d = t.useMemo(() => {
3087
- if (!c) return u;
711
+ })) : [{ items: e }], [e]), _ = t.useMemo(() => {
712
+ if (!c) return p;
3088
713
  let e = c.toLowerCase();
3089
- return u.map((t) => ({
714
+ return p.map((t) => ({
3090
715
  ...t,
3091
716
  items: t.items.filter((t) => t.title.toLowerCase().includes(e) || t.children?.some((t) => t.title.toLowerCase().includes(e)))
3092
717
  })).filter((e) => e.items.length > 0);
3093
- }, [u, c]);
3094
- return /* @__PURE__ */ (0, G.jsx)(v, {
718
+ }, [p, c]);
719
+ return /* @__PURE__ */ j(d, {
3095
720
  className: r,
3096
721
  collapsible: i,
3097
- children: /* @__PURE__ */ (0, G.jsxs)(y, { children: [a && /* @__PURE__ */ (0, G.jsx)("div", {
722
+ children: /* @__PURE__ */ M(f, { children: [a && /* @__PURE__ */ j("div", {
3098
723
  className: "px-3 py-2",
3099
- children: /* @__PURE__ */ (0, G.jsxs)("div", {
724
+ children: /* @__PURE__ */ M("div", {
3100
725
  className: "relative",
3101
- children: [/* @__PURE__ */ (0, G.jsx)(ae, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ (0, G.jsx)(g, {
726
+ children: [/* @__PURE__ */ j(H, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ j(l, {
3102
727
  type: "search",
3103
728
  placeholder: o,
3104
729
  value: c,
3105
- onChange: (e) => l(e.target.value),
730
+ onChange: (e) => u(e.target.value),
3106
731
  className: "pl-8 h-9"
3107
732
  })]
3108
733
  })
3109
- }), d.map((e, t) => /* @__PURE__ */ (0, G.jsxs)(x, { children: [
3110
- t > 0 && /* @__PURE__ */ (0, G.jsx)("div", {
734
+ }), _.map((e, t) => /* @__PURE__ */ M(m, { children: [
735
+ t > 0 && /* @__PURE__ */ j("div", {
3111
736
  className: "mx-3 mb-1 h-px bg-sidebar-border/60",
3112
737
  "aria-hidden": !0
3113
738
  }),
3114
- /* @__PURE__ */ (0, G.jsx)(C, {
739
+ /* @__PURE__ */ j(g, {
3115
740
  className: "text-[10px] font-semibold uppercase tracking-wider text-sidebar-foreground/60",
3116
741
  children: e.groupLabel || n
3117
742
  }),
3118
- /* @__PURE__ */ (0, G.jsx)(S, { children: /* @__PURE__ */ (0, G.jsx)(D, { children: e.items.map((e) => /* @__PURE__ */ (0, G.jsx)(Jr, {
743
+ /* @__PURE__ */ j(h, { children: /* @__PURE__ */ j(b, { children: e.items.map((e) => /* @__PURE__ */ j(Pe, {
3119
744
  item: e,
3120
745
  pathname: s.pathname
3121
746
  }, e.href)) }) })
@@ -3124,8 +749,8 @@ function Yr({ items: e, title: n = "Application", className: r, collapsible: i =
3124
749
  }
3125
750
  //#endregion
3126
751
  //#region src/index.ts
3127
- function Xr() {
3128
- e.register("page-header", de, {
752
+ function Ie() {
753
+ e.register("page-header", W, {
3129
754
  namespace: "layout",
3130
755
  label: "Page Header",
3131
756
  category: "Layout",
@@ -3136,16 +761,16 @@ function Xr() {
3136
761
  name: "description",
3137
762
  type: "string"
3138
763
  }]
3139
- }), e.register("page:header", de, { namespace: "layout" }), e.register("page:card", _e, {
764
+ }), e.register("page:header", W, { namespace: "layout" }), e.register("page:card", he, {
3140
765
  namespace: "layout",
3141
766
  label: "Page Card",
3142
767
  category: "Layout",
3143
768
  isContainer: !0
3144
- }), e.register("app-shell", ge, {
769
+ }), e.register("app-shell", J, {
3145
770
  namespace: "layout",
3146
771
  label: "App Shell",
3147
772
  category: "Layout"
3148
- }), e.register("responsive-grid", xe, {
773
+ }), e.register("responsive-grid", ye, {
3149
774
  namespace: "layout",
3150
775
  label: "Responsive Grid",
3151
776
  category: "Layout",
@@ -3157,7 +782,7 @@ function Xr() {
3157
782
  name: "gap",
3158
783
  type: "number"
3159
784
  }]
3160
- }), e.register("navigation-renderer", zr, {
785
+ }), e.register("navigation-renderer", $, {
3161
786
  namespace: "layout",
3162
787
  label: "Navigation Renderer",
3163
788
  category: "Layout",
@@ -3168,7 +793,7 @@ function Xr() {
3168
793
  name: "basePath",
3169
794
  type: "string"
3170
795
  }]
3171
- }), e.register("app-schema-renderer", Wr, {
796
+ }), e.register("app-schema-renderer", Ae, {
3172
797
  namespace: "layout",
3173
798
  label: "App Schema Renderer",
3174
799
  category: "Layout",
@@ -3190,7 +815,7 @@ function Xr() {
3190
815
  });
3191
816
  }
3192
817
  try {
3193
- Xr();
818
+ Ie();
3194
819
  } catch {}
3195
820
  //#endregion
3196
- export { Wr as AppSchemaRenderer, ge as AppShell, zr as NavigationRenderer, Kr as Page, _e as PageCard, de as PageHeader, xe as ResponsiveGrid, Yr as SidebarNav, Fr as filterNavigationItems, Xr as registerLayout, kr as resolveIcon, Ar as resolveLabel, he as useAppShellBranding };
821
+ export { Ae as AppSchemaRenderer, J as AppShell, $ as NavigationRenderer, Me as Page, he as PageCard, W as PageHeader, ye as ResponsiveGrid, Fe as SidebarNav, Z as filterNavigationItems, Ie as registerLayout, Y as resolveIcon, X as resolveLabel, me as useAppShellBranding };