@archbase/layout 3.0.23 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,31 +1,33 @@
1
- import { Menu as at, ActionIcon as Zt } from "@mantine/core";
2
- import { Card as gi, Container as bi, Group as pi, Stack as zi } from "@mantine/core";
3
- import { jsx as c, jsxs as G, Fragment as Nt } from "react/jsx-runtime";
4
- import * as d from "prop-types";
5
- import * as M from "react";
6
- import J, { useRef as it, useState as V, useEffect as et, useMemo as kt, useCallback as Gt } from "react";
7
- import { ResizeSensor as Yt } from "css-element-queries";
8
- import { useWindowSize as Kt } from "usehooks-ts";
9
- import { useArchbaseTranslation as Ht } from "@archbase/core";
10
- import { useElementSize as Qt } from "@mantine/hooks";
11
- import { Split as Bt } from "@gfazioli/mantine-split-pane";
12
- import { IconPinnedOff as te, IconPinned as ee } from "@tabler/icons-react";
13
- import { DockviewReact as ie } from "dockview-react";
14
- function ei({ children: t }) {
15
- return /* @__PURE__ */ c("form", { children: t });
1
+ import { Menu as at, useMantineTheme as Qt, useComputedColorScheme as te, Box as ee, ActionIcon as ie, useMantineColorScheme as oe } from "@mantine/core";
2
+ import { Card as $i, Container as Mi, Group as ji, Stack as Bi } from "@mantine/core";
3
+ import { jsx as a, jsxs as F, Fragment as Et } from "react/jsx-runtime";
4
+ import * as h from "prop-types";
5
+ import * as O from "react";
6
+ import W, { useRef as it, useState as U, useEffect as et, useCallback as kt, useMemo as Ht } from "react";
7
+ import { ResizeSensor as ne } from "css-element-queries";
8
+ import { useWindowSize as re } from "usehooks-ts";
9
+ import { useArchbaseTranslation as Wt } from "@archbase/core";
10
+ import { useElementSize as se } from "@mantine/hooks";
11
+ import { PanelGroup as Ft, Panel as Mt, PanelResizeHandle as Vt } from "react-resizable-panels";
12
+ import { IconPinnedOff as le, IconPinned as ae } from "@tabler/icons-react";
13
+ import { MosaicWindow as de, Mosaic as ce } from "react-mosaic-component";
14
+ import "react-mosaic-component/react-mosaic-component.css";
15
+ import { DockviewReact as he } from "dockview-react";
16
+ function bi({ children: t }) {
17
+ return /* @__PURE__ */ a("form", { children: t });
16
18
  }
17
- var A = /* @__PURE__ */ ((t) => (t.ViewPort = "viewport", t.Fixed = "fixed", t.Fill = "fill", t.Positioned = "positioned", t.Anchored = "anchored", t.Custom = "custom", t))(A || {}), C = /* @__PURE__ */ ((t) => (t.Left = "anchor-left", t.Right = "anchor-right", t.Top = "anchor-top", t.Bottom = "anchor-bottom", t))(C || {}), mt = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(mt || {}), p = /* @__PURE__ */ ((t) => (t.All = "resize-all", t.Left = "resize-left", t.Right = "resize-right", t.Top = "resize-top", t.Bottom = "resize-bottom", t.TopLeft = "resize-topleft", t.TopRight = "resize-topright", t.BottomLeft = "resize-bottomleft", t.BottomRight = "resize-bottomright", t))(p || {}), rt = /* @__PURE__ */ ((t) => (t.OverlayInside = "overlay-inside", t.Inside = "inside", t.OverlayBoundary = "overlay-boundary", t))(rt || {}), st = /* @__PURE__ */ ((t) => (t.None = "none", t.Vertical = "vertical", t.HorizontalVertical = "horizontalVertical", t))(st || {}), zt = /* @__PURE__ */ ((t) => (t.Mouse = "mousemove", t.Touch = "touchmove", t))(zt || {}), wt = /* @__PURE__ */ ((t) => (t.Mouse = "mouseup", t.Touch = "touchend", t))(wt || {});
18
- function oe(t, ...i) {
19
+ var A = /* @__PURE__ */ ((t) => (t.ViewPort = "viewport", t.Fixed = "fixed", t.Fill = "fill", t.Positioned = "positioned", t.Anchored = "anchored", t.Custom = "custom", t))(A || {}), C = /* @__PURE__ */ ((t) => (t.Left = "anchor-left", t.Right = "anchor-right", t.Top = "anchor-top", t.Bottom = "anchor-bottom", t))(C || {}), mt = /* @__PURE__ */ ((t) => (t[t.Horizontal = 0] = "Horizontal", t[t.Vertical = 1] = "Vertical", t))(mt || {}), y = /* @__PURE__ */ ((t) => (t.All = "resize-all", t.Left = "resize-left", t.Right = "resize-right", t.Top = "resize-top", t.Bottom = "resize-bottom", t.TopLeft = "resize-topleft", t.TopRight = "resize-topright", t.BottomLeft = "resize-bottomleft", t.BottomRight = "resize-bottomright", t))(y || {}), rt = /* @__PURE__ */ ((t) => (t.OverlayInside = "overlay-inside", t.Inside = "inside", t.OverlayBoundary = "overlay-boundary", t))(rt || {}), st = /* @__PURE__ */ ((t) => (t.None = "none", t.Vertical = "vertical", t.HorizontalVertical = "horizontalVertical", t))(st || {}), zt = /* @__PURE__ */ ((t) => (t.Mouse = "mousemove", t.Touch = "touchmove", t))(zt || {}), wt = /* @__PURE__ */ ((t) => (t.Mouse = "mouseup", t.Touch = "touchend", t))(wt || {});
20
+ function ue(t, ...i) {
19
21
  const o = /* @__PURE__ */ Object.create(null);
20
- i.forEach((f) => {
21
- o[f] = !0;
22
+ i.forEach((u) => {
23
+ o[u] = !0;
22
24
  });
23
25
  const n = /* @__PURE__ */ Object.create(null);
24
- return Object.keys(t).forEach((f) => {
25
- o[f] || (n[f] = t[f]);
26
+ return Object.keys(t).forEach((u) => {
27
+ o[u] || (n[u] = t[u]);
26
28
  }), n;
27
29
  }
28
- function ne() {
30
+ function fe() {
29
31
  let t = Math.random() * 46656 | 0, i = Math.random() * 46656 | 0;
30
32
  return ("000" + t.toString(36)).slice(-3) + ("000" + i.toString(36)).slice(-3);
31
33
  }
@@ -50,7 +52,7 @@ function Ct(t, i) {
50
52
  return !1;
51
53
  return !0;
52
54
  }
53
- function re(t, i) {
55
+ function me(t, i) {
54
56
  var o = !1;
55
57
  return function(...n) {
56
58
  o || (t(...n), o = !0, setTimeout(function() {
@@ -58,7 +60,7 @@ function re(t, i) {
58
60
  }, i));
59
61
  };
60
62
  }
61
- function se(t) {
63
+ function ge(t) {
62
64
  const i = [], o = {
63
65
  position: t.position,
64
66
  left: v(t.left),
@@ -70,160 +72,160 @@ function se(t) {
70
72
  zIndex: t.zIndex
71
73
  }, n = [];
72
74
  o.position && n.push(`position: ${o.position};`), o.left && n.push(`left: ${o.left};`), o.top && n.push(`top: ${o.top};`), o.right && n.push(`right: ${o.right};`), o.bottom && n.push(`bottom: ${o.bottom};`), o.width && n.push(`width: ${o.width};`), o.height && n.push(`height: ${o.height};`), o.zIndex && n.push(`z-index: ${o.zIndex};`), t.allowOverflow && n.push("overflow: visible;"), n.length > 0 && i.push(`#${t.id} { ${n.join(" ")} }`), t.scrollable && i.push(`#${t.id} > .spaces-space-inner { overflow: auto; touch-action: auto; }`);
73
- let f = 0;
74
- const h = `${t.handleSize}px`, s = `-${t.touchHandleSize / 2 - t.handleSize / 2}px`, y = `${t.touchHandleSize / 2 - t.handleSize / 2}px`;
75
+ let u = 0;
76
+ const d = `${t.handleSize}px`, r = `-${t.touchHandleSize / 2 - t.handleSize / 2}px`, b = `${t.touchHandleSize / 2 - t.handleSize / 2}px`;
75
77
  switch (t.handlePlacement) {
76
78
  case rt.Inside:
77
79
  case rt.OverlayInside:
78
- f = t.handleSize, t.type === A.Positioned && (f = 0);
80
+ u = t.handleSize, t.type === A.Positioned && (u = 0);
79
81
  break;
80
82
  case rt.OverlayBoundary:
81
- f = t.handleSize / 2;
83
+ u = t.handleSize / 2;
82
84
  break;
83
85
  }
84
- const e = `${f}px`, a = (r, g) => {
85
- const u = [];
86
- g.left && u.push(`left: ${g.left}`), g.top && u.push(`top: ${g.top}`), g.right && u.push(`right: ${g.right}`), g.bottom && u.push(`bottom: ${g.bottom}`), g.width && u.push(`width: ${g.width}`), g.height && u.push(`height: ${g.height}`), i.push(`#${t.id}-${r} { ${u.join("; ")}}`);
87
- }, b = () => t.type === A.Positioned ? t.width.size && t.height.size : t.orientation == mt.Horizontal ? t.width.size : t.height.size;
88
- return t.canResizeLeft && (t.anchor ? a("ml", {
86
+ const e = `${u}px`, l = (s, f) => {
87
+ const g = [];
88
+ f.left && g.push(`left: ${f.left}`), f.top && g.push(`top: ${f.top}`), f.right && g.push(`right: ${f.right}`), f.bottom && g.push(`bottom: ${f.bottom}`), f.width && g.push(`width: ${f.width}`), f.height && g.push(`height: ${f.height}`), i.push(`#${t.id}-${s} { ${g.join("; ")}}`);
89
+ }, p = () => t.type === A.Positioned ? t.width.size && t.height.size : t.orientation == mt.Horizontal ? t.width.size : t.height.size;
90
+ return t.canResizeLeft && (t.anchor ? l("ml", {
89
91
  right: `calc(${v(t.right, !0)} + ${v(t.width)} - ${e})`,
90
92
  top: "0",
91
93
  bottom: "0",
92
- width: h
93
- }) : a("ml", {
94
+ width: d
95
+ }) : l("ml", {
94
96
  left: `calc(${v(t.left, !0)} - ${e})`,
95
97
  top: v(t.top),
96
98
  bottom: v(t.bottom),
97
- width: h,
99
+ width: d,
98
100
  height: v(t.height)
99
- }), a("ml:after", {
100
- left: s,
101
- right: s,
102
- top: s,
103
- bottom: s
104
- })), t.canResizeTop && (t.anchor ? (a("mt", {
101
+ }), l("ml:after", {
102
+ left: r,
103
+ right: r,
104
+ top: r,
105
+ bottom: r
106
+ })), t.canResizeTop && (t.anchor ? (l("mt", {
105
107
  left: "0",
106
108
  right: "0",
107
109
  bottom: `calc(${v(t.bottom)} + ${v(t.height)} - ${e})`,
108
- height: h
109
- }), a("mt:after", {
110
- top: s,
111
- bottom: s,
112
- left: s,
110
+ height: d
111
+ }), l("mt:after", {
112
+ top: r,
113
+ bottom: r,
114
+ left: r,
113
115
  width: v(t.width),
114
- right: s
115
- })) : (a("mt", {
116
+ right: r
117
+ })) : (l("mt", {
116
118
  top: `calc(${v(t.top, !0)} - ${e})`,
117
119
  left: v(t.left),
118
120
  right: v(t.right),
119
121
  width: v(t.width),
120
- height: h
121
- }), b() ? a("mt:after", {
122
- top: s,
123
- bottom: s,
124
- left: s,
125
- width: `calc(${v(t.width, !0)} - ${e}) + ${y}`,
126
- right: s
127
- }) : a("mt:after", {
128
- top: s,
129
- bottom: s,
130
- left: s,
122
+ height: d
123
+ }), p() ? l("mt:after", {
124
+ top: r,
125
+ bottom: r,
126
+ left: r,
127
+ width: `calc(${v(t.width, !0)} - ${e}) + ${b}`,
128
+ right: r
129
+ }) : l("mt:after", {
130
+ top: r,
131
+ bottom: r,
132
+ left: r,
131
133
  width: v(t.width),
132
- right: s
133
- }))), t.canResizeRight && (b() ? a("mr", {
134
- left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${h} + ${e})`,
134
+ right: r
135
+ }))), t.canResizeRight && (p() ? l("mr", {
136
+ left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${d} + ${e})`,
135
137
  top: v(t.top),
136
138
  bottom: v(t.bottom),
137
- width: h,
139
+ width: d,
138
140
  height: v(t.height)
139
- }) : a("mr", {
141
+ }) : l("mr", {
140
142
  right: `calc(${v(t.right, !0)} - ${e})`,
141
143
  top: v(t.top),
142
144
  bottom: v(t.bottom),
143
- width: h,
145
+ width: d,
144
146
  height: v(t.height)
145
- }), a("mr:after", {
146
- left: s,
147
- right: s,
148
- top: s,
149
- bottom: s
150
- })), t.canResizeBottom && (b() ? a("mb", {
151
- top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${h} + ${e})`,
147
+ }), l("mr:after", {
148
+ left: r,
149
+ right: r,
150
+ top: r,
151
+ bottom: r
152
+ })), t.canResizeBottom && (p() ? l("mb", {
153
+ top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${d} + ${e})`,
152
154
  left: v(t.left),
153
155
  right: v(t.right),
154
156
  width: v(t.width),
155
- height: h
156
- }) : a("mb", {
157
+ height: d
158
+ }) : l("mb", {
157
159
  bottom: `calc(${v(t.bottom, !0)} - ${e})`,
158
160
  left: v(t.left),
159
161
  right: v(t.right),
160
162
  width: v(t.width),
161
- height: h
162
- }), a("mb:after", {
163
- top: s,
164
- bottom: s,
165
- left: s,
166
- right: s
167
- })), t.canResizeTopLeft && (a("mtl", {
163
+ height: d
164
+ }), l("mb:after", {
165
+ top: r,
166
+ bottom: r,
167
+ left: r,
168
+ right: r
169
+ })), t.canResizeTopLeft && (l("mtl", {
168
170
  left: `calc(${v(t.left, !0)} - ${e})`,
169
171
  top: v(t.top),
170
- width: h,
171
- height: h
172
- }), a("mtl:after", {
173
- top: s,
174
- bottom: s,
175
- left: s,
176
- right: s
177
- })), t.canResizeTopRight && (b() ? a("mtr", {
178
- left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${h} + ${e})`,
172
+ width: d,
173
+ height: d
174
+ }), l("mtl:after", {
175
+ top: r,
176
+ bottom: r,
177
+ left: r,
178
+ right: r
179
+ })), t.canResizeTopRight && (p() ? l("mtr", {
180
+ left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${d} + ${e})`,
179
181
  top: v(t.top),
180
- width: h,
181
- height: h
182
- }) : a("mtr", {
182
+ width: d,
183
+ height: d
184
+ }) : l("mtr", {
183
185
  right: `calc(${v(t.right, !0)} - ${e})`,
184
186
  top: v(t.top),
185
- width: h,
186
- height: h
187
- }), a("mtr:after", {
188
- top: s,
189
- bottom: s,
190
- left: s,
191
- right: s
192
- })), t.canResizeBottomLeft && (b() ? a("mbl", {
193
- top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${h} + ${e})`,
187
+ width: d,
188
+ height: d
189
+ }), l("mtr:after", {
190
+ top: r,
191
+ bottom: r,
192
+ left: r,
193
+ right: r
194
+ })), t.canResizeBottomLeft && (p() ? l("mbl", {
195
+ top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${d} + ${e})`,
194
196
  left: v(t.left),
195
- width: h,
196
- height: h
197
- }) : a("mbl", {
197
+ width: d,
198
+ height: d
199
+ }) : l("mbl", {
198
200
  bottom: `calc(${v(t.bottom, !0)} - ${e})`,
199
201
  left: v(t.left),
200
- width: h,
201
- height: h
202
- }), a("mbl:after", {
203
- top: s,
204
- bottom: s,
205
- left: s,
206
- right: s
207
- })), t.canResizeBottomRight && (b() ? a("mbr", {
208
- left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${h} + ${e})`,
209
- top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${h} + ${e})`,
210
- width: h,
211
- height: h
212
- }) : a("mbr", {
202
+ width: d,
203
+ height: d
204
+ }), l("mbl:after", {
205
+ top: r,
206
+ bottom: r,
207
+ left: r,
208
+ right: r
209
+ })), t.canResizeBottomRight && (p() ? l("mbr", {
210
+ left: `calc(${v(t.left, !0)} + ${v(t.width, !0)} - ${d} + ${e})`,
211
+ top: `calc(${v(t.top, !0)} + ${v(t.height, !0)} - ${d} + ${e})`,
212
+ width: d,
213
+ height: d
214
+ }) : l("mbr", {
213
215
  right: `calc(${v(t.right, !0)} - ${e})`,
214
216
  bottom: `calc(${v(t.bottom, !0)} - ${e})`,
215
- width: h,
216
- height: h
217
- }), a("mbr:after", {
218
- top: s,
219
- bottom: s,
220
- left: s,
221
- right: s
217
+ width: d,
218
+ height: d
219
+ }), l("mbr:after", {
220
+ top: r,
221
+ bottom: r,
222
+ left: r,
223
+ right: r
222
224
  })), i.join(" ");
223
225
  }
224
- function Rt(t) {
225
- const i = se(t);
226
- if (Wt())
226
+ function yt(t) {
227
+ const i = ge(t);
228
+ if (qt())
227
229
  t.ssrStyle = i;
228
230
  else {
229
231
  const o = document.getElementById(`style_${t.id}`);
@@ -235,122 +237,122 @@ function Rt(t) {
235
237
  }
236
238
  }
237
239
  }
238
- function le(t) {
240
+ function be(t) {
239
241
  const i = document.getElementById(`style_${t.id}`);
240
242
  i && document.head.removeChild(i);
241
243
  }
242
- function Wt() {
244
+ function qt() {
243
245
  return !(typeof document < "u" && document);
244
246
  }
245
- function vt(t) {
246
- return t === p.Left || t === p.Right;
247
+ function Rt(t) {
248
+ return t === y.Left || t === y.Right;
247
249
  }
248
- function Q(t, i, o, n, f, h) {
249
- const s = i === p.Right || i === p.Bottom ? (u) => -u : (u) => u, y = vt(i) ? n.width : n.height, e = o.resized, a = y.resized, b = vt(i) ? t.width : t.height, r = Z(n.minimumSize, 20) - b + 0, g = n.maximumSize ? n.maximumSize - b + 0 : void 0;
250
- return (u, z) => {
251
- let l = (vt(i) ? f : h) - (vt(i) ? u : z), m = s(l);
252
- n.type !== A.Positioned && (m = Math.max(s(l), r), m < r && (m = r), typeof g == "number" && m > g && (m = g)), o.size !== void 0 ? (o.resized = s(-l) + e, y.size && (y.resized = s(l) + a)) : y.resized = m + a;
250
+ function Q(t, i, o, n, u, d) {
251
+ const r = i === y.Right || i === y.Bottom ? (g) => -g : (g) => g, b = Rt(i) ? n.width : n.height, e = o.resized, l = b.resized, p = Rt(i) ? t.width : t.height, s = Z(n.minimumSize, 20) - p + 0, f = n.maximumSize ? n.maximumSize - p + 0 : void 0;
252
+ return (g, z) => {
253
+ let c = (Rt(i) ? u : d) - (Rt(i) ? g : z), m = r(c);
254
+ n.type !== A.Positioned && (m = Math.max(r(c), s), m < s && (m = s), typeof f == "number" && m > f && (m = f)), o.size !== void 0 ? (o.resized = r(-c) + e, b.size && (b.resized = r(c) + l)) : b.resized = m + l;
253
255
  };
254
256
  }
255
- function ae(t, i, o, n) {
256
- const f = i.element.getBoundingClientRect();
257
+ function pe(t, i, o, n) {
258
+ const u = i.element.getBoundingClientRect();
257
259
  switch (t) {
258
- case p.Left:
259
- return Q(f, t, i.left, i, o, n);
260
- case p.Right:
261
- return Q(f, t, i.right, i, o, n);
262
- case p.Bottom:
263
- return Q(f, t, i.bottom, i, o, n);
264
- case p.Top:
265
- return Q(f, t, i.top, i, o, n);
266
- case p.TopLeft:
267
- const h = Q(f, p.Top, i.top, i, o, n), s = Q(f, p.Left, i.left, i, o, n);
268
- return (u, z) => {
269
- h(u, z), s(u, z);
260
+ case y.Left:
261
+ return Q(u, t, i.left, i, o, n);
262
+ case y.Right:
263
+ return Q(u, t, i.right, i, o, n);
264
+ case y.Bottom:
265
+ return Q(u, t, i.bottom, i, o, n);
266
+ case y.Top:
267
+ return Q(u, t, i.top, i, o, n);
268
+ case y.TopLeft:
269
+ const d = Q(u, y.Top, i.top, i, o, n), r = Q(u, y.Left, i.left, i, o, n);
270
+ return (g, z) => {
271
+ d(g, z), r(g, z);
270
272
  };
271
- case p.TopRight:
272
- const y = Q(f, p.Top, i.top, i, o, n), e = Q(f, p.Right, i.right, i, o, n);
273
- return (u, z) => {
274
- y(u, z), e(u, z);
273
+ case y.TopRight:
274
+ const b = Q(u, y.Top, i.top, i, o, n), e = Q(u, y.Right, i.right, i, o, n);
275
+ return (g, z) => {
276
+ b(g, z), e(g, z);
275
277
  };
276
- case p.BottomLeft:
277
- const a = Q(f, p.Bottom, i.bottom, i, o, n), b = Q(f, p.Left, i.left, i, o, n);
278
- return (u, z) => {
279
- a(u, z), b(u, z);
278
+ case y.BottomLeft:
279
+ const l = Q(u, y.Bottom, i.bottom, i, o, n), p = Q(u, y.Left, i.left, i, o, n);
280
+ return (g, z) => {
281
+ l(g, z), p(g, z);
280
282
  };
281
- case p.BottomRight:
282
- const r = Q(f, p.Bottom, i.bottom, i, o, n), g = Q(f, p.Right, i.right, i, o, n);
283
- return (u, z) => {
284
- r(u, z), g(u, z);
283
+ case y.BottomRight:
284
+ const s = Q(u, y.Bottom, i.bottom, i, o, n), f = Q(u, y.Right, i.right, i, o, n);
285
+ return (g, z) => {
286
+ s(g, z), f(g, z);
285
287
  };
286
288
  default:
287
289
  throw `Resize type ${t} not supported`;
288
290
  }
289
291
  }
290
- function de(t) {
292
+ function ze(t) {
291
293
  return {
292
- startResize(i, o, n, f, h, s, y) {
294
+ startResize(i, o, n, u, d, r, b) {
293
295
  if (n.onResizeStart) {
294
296
  const m = n.onResizeStart(o);
295
297
  if (typeof m == "boolean" && !m)
296
298
  return;
297
299
  }
298
- const e = s(i), a = ae(o, n, e.x, e.y);
300
+ const e = r(i), l = pe(o, n, e.x, e.y);
299
301
  n.resizing = !0, n.updateParent();
300
- let b = 0, r = 0, g = !1;
301
- const u = (m, R) => {
302
- a(m, R), t.updateStyles(n);
302
+ let p = 0, s = 0, f = !1;
303
+ const g = (m, R) => {
304
+ l(m, R), t.updateStyles(n);
303
305
  }, z = (m) => {
304
- g = !0;
305
- const R = s(m);
306
- b = R.x, r = R.y, m.preventDefault(), window.requestAnimationFrame(() => {
307
- n.resizing && u(b, r);
306
+ f = !0;
307
+ const R = r(m);
308
+ p = R.x, s = R.y, m.preventDefault(), window.requestAnimationFrame(() => {
309
+ n.resizing && g(p, s);
308
310
  });
309
- }, l = () => {
310
- n.resizing = !1, g && u(b, r), window.removeEventListener(h, z), window.removeEventListener(f, l), n.updateParent();
311
- const m = y || n.onResizeEnd;
311
+ }, c = () => {
312
+ n.resizing = !1, f && g(p, s), window.removeEventListener(d, z), window.removeEventListener(u, c), n.updateParent();
313
+ const m = b || n.onResizeEnd;
312
314
  if (m) {
313
315
  const R = n.element.getBoundingClientRect();
314
- m(Math.floor(vt(o) ? R.width : R.height), R, o);
316
+ m(Math.floor(Rt(o) ? R.width : R.height), R, o);
315
317
  }
316
318
  };
317
- window.addEventListener(h, z), window.addEventListener(f, l);
319
+ window.addEventListener(d, z), window.addEventListener(u, c);
318
320
  }
319
321
  };
320
322
  }
321
- function ce(t) {
322
- function i(o, n, f, h, s) {
323
- const y = -(n - h), e = -(f - s);
324
- o.left.adjusted = [y], o.top.adjusted = [e], o.right.size && (o.right.adjusted = [-y]), o.bottom.size && (o.bottom.adjusted = [-e]), t.updateStyles(o);
323
+ function we(t) {
324
+ function i(o, n, u, d, r) {
325
+ const b = -(n - d), e = -(u - r);
326
+ o.left.adjusted = [b], o.top.adjusted = [e], o.right.size && (o.right.adjusted = [-b]), o.bottom.size && (o.bottom.adjusted = [-e]), t.updateStyles(o);
325
327
  }
326
328
  return {
327
- startDrag(o, n, f, h, s, y) {
329
+ startDrag(o, n, u, d, r, b) {
328
330
  if (n.element) {
329
- const e = s(o), a = n.left.adjusted.length === 0 ? 0 : n.left.adjusted[0], b = n.top.adjusted.length === 0 ? 0 : n.top.adjusted[0], r = e.x - a, g = e.y - b;
330
- let u = 0, z = 0, l = !1;
331
- const m = (I, B) => i(n, r, g, I, B), R = re(m, 5), S = (I) => {
332
- l = !0;
333
- const B = s(I);
334
- u = B.x, z = B.y, I.preventDefault(), R(u, z);
331
+ const e = r(o), l = n.left.adjusted.length === 0 ? 0 : n.left.adjusted[0], p = n.top.adjusted.length === 0 ? 0 : n.top.adjusted[0], s = e.x - l, f = e.y - p;
332
+ let g = 0, z = 0, c = !1;
333
+ const m = (I, M) => i(n, s, f, I, M), R = me(m, 5), S = (I) => {
334
+ c = !0;
335
+ const M = r(I);
336
+ g = M.x, z = M.y, I.preventDefault(), R(g, z);
335
337
  }, w = () => {
336
- if (l && m(u, z), window.removeEventListener(h, S), window.removeEventListener(f, w), y) {
338
+ if (c && m(g, z), window.removeEventListener(d, S), window.removeEventListener(u, w), b) {
337
339
  const I = n.parentId && t.getSpace(n.parentId)?.element.getBoundingClientRect() || {
338
340
  left: 0,
339
341
  top: 0
340
- }, B = (({ left: P, top: x, right: T, bottom: _, width: k, height: N }) => ({ left: P, top: x, right: T, bottom: _, width: k, height: N }))(
342
+ }, M = (({ left: N, top: x, right: T, bottom: P, width: k, height: E }) => ({ left: N, top: x, right: T, bottom: P, width: k, height: E }))(
341
343
  n.element.getBoundingClientRect()
342
344
  );
343
- y(
345
+ b(
344
346
  {
345
- ...B,
346
- left: B.left - I.left,
347
- top: B.top - I.top
347
+ ...M,
348
+ left: M.left - I.left,
349
+ top: M.top - I.top
348
350
  },
349
- l
351
+ c
350
352
  );
351
353
  }
352
354
  };
353
- window.addEventListener(h, S), window.addEventListener(f, w);
355
+ window.addEventListener(d, S), window.addEventListener(u, w);
354
356
  }
355
357
  }
356
358
  };
@@ -372,14 +374,14 @@ const bt = {
372
374
  adjustBottom: () => !1,
373
375
  adjustEdge: () => !1,
374
376
  anchoredChildren: () => []
375
- }, he = [C.Left, C.Top, C.Right, C.Bottom];
376
- function Et(t) {
377
+ }, ye = [C.Left, C.Top, C.Right, C.Bottom];
378
+ function _t(t) {
377
379
  return t === A.ViewPort ? "fixed" : t === A.Fixed ? "relative" : "absolute";
378
380
  }
379
- function Pt(t) {
381
+ function Nt(t) {
380
382
  return t === C.Bottom || t === C.Top ? mt.Vertical : mt.Horizontal;
381
383
  }
382
- function ue(t) {
384
+ function Re(t) {
383
385
  return [
384
386
  {
385
387
  anchor: C.Left,
@@ -402,87 +404,87 @@ function ue(t) {
402
404
  function ut(t) {
403
405
  return { size: t, adjusted: [], resized: 0 };
404
406
  }
405
- function fe() {
407
+ function ve() {
406
408
  let t = [];
407
409
  const i = (e) => {
408
410
  t = e;
409
- }, o = (e) => n().find((a) => a.id === e), n = () => t, f = (e) => {
410
- const a = (z, l, m) => m.indexOf(z) === l, r = ((z) => {
411
- let l = [];
412
- return he.forEach((m) => {
411
+ }, o = (e) => n().find((l) => l.id === e), n = () => t, u = (e) => {
412
+ const l = (z, c, m) => m.indexOf(z) === c, s = ((z) => {
413
+ let c = [];
414
+ return ye.forEach((m) => {
413
415
  const R = z.filter((w) => w.anchor !== void 0 && w.anchor === m);
414
- R.map((w) => w.zIndex).filter(a).forEach((w) => {
415
- const I = R.filter((T) => T.zIndex === w), B = I.filter((T) => T.order !== void 0), P = I.filter((T) => T.order === void 0);
416
- var x = B.length > 0 ? B.map((T) => T.order).reduce((T, _) => Math.max(T, _)) : 0;
417
- l = [...l, ...B, ...P.map((T, _) => ({ ...T, order: x + _ + 1 }))];
416
+ R.map((w) => w.zIndex).filter(l).forEach((w) => {
417
+ const I = R.filter((T) => T.zIndex === w), M = I.filter((T) => T.order !== void 0), N = I.filter((T) => T.order === void 0);
418
+ var x = M.length > 0 ? M.map((T) => T.order).reduce((T, P) => Math.max(T, P)) : 0;
419
+ c = [...c, ...M, ...N.map((T, P) => ({ ...T, order: x + P + 1 }))];
418
420
  });
419
- }), [...l, ...z.filter((m) => m.anchor === void 0)];
421
+ }), [...c, ...z.filter((m) => m.anchor === void 0)];
420
422
  })(e.children);
421
- for (var g = 0, u = r.length; g < u; g++) {
422
- const z = r[g];
423
- let l = !1;
423
+ for (var f = 0, g = s.length; f < g; f++) {
424
+ const z = s[f];
425
+ let c = !1;
424
426
  if (z.type === A.Fill)
425
- ue(z).forEach((m) => {
427
+ Re(z).forEach((m) => {
426
428
  const R = [];
427
- e.anchoredChildren(r, m.anchor, z.zIndex).forEach((w) => {
429
+ e.anchoredChildren(s, m.anchor, z.zIndex).forEach((w) => {
428
430
  w.orientation === mt.Vertical ? (w.height.size && R.push(w.height.size), w.height.resized && R.push(w.height.resized)) : (w.width.size && R.push(w.width.size), w.width.resized && R.push(w.width.resized));
429
- }), m.update(R) && (l = !0);
431
+ }), m.update(R) && (c = !0);
430
432
  });
431
433
  else if (z.type === A.Anchored) {
432
434
  const m = [];
433
- e.anchoredChildren(r, z.anchor, z.zIndex).filter((S) => S.id !== z.id && S.order <= z.order).forEach((S) => {
435
+ e.anchoredChildren(s, z.anchor, z.zIndex).filter((S) => S.id !== z.id && S.order <= z.order).forEach((S) => {
434
436
  S.orientation === mt.Vertical ? (S.height.size && m.push(S.height.size), S.height.resized && m.push(S.height.resized)) : (S.width.size && m.push(S.width.size), S.width.resized && m.push(S.width.resized));
435
- }), z.adjustEdge(m) && (l = !0);
437
+ }), z.adjustEdge(m) && (c = !0);
436
438
  }
437
- l && Rt(z);
439
+ c && yt(z);
438
440
  }
439
- }, h = {
441
+ }, d = {
440
442
  getSpaces: n,
441
443
  getSpace: o,
442
444
  addSpace: (e) => {
443
445
  if (n().push(e), e.parentId) {
444
- const a = o(e.parentId);
445
- a && (a.children.push(e), f(a));
446
+ const l = o(e.parentId);
447
+ l && (l.children.push(e), u(l));
446
448
  }
447
- Rt(e);
449
+ yt(e);
448
450
  },
449
451
  removeSpace: (e) => {
450
- if (i(n().filter((a) => a.id !== e.id)), e.parentId) {
451
- const a = o(e.parentId);
452
- a && (a.children = a.children.filter((b) => b.id !== e.id), f(a));
452
+ if (i(n().filter((l) => l.id !== e.id)), e.parentId) {
453
+ const l = o(e.parentId);
454
+ l && (l.children = l.children.filter((p) => p.id !== e.id), u(l));
453
455
  }
454
- le(e);
456
+ be(e);
455
457
  },
456
458
  updateStyles: (e) => {
457
459
  if (e.parentId) {
458
- const a = o(e.parentId);
459
- a && f(a);
460
+ const l = o(e.parentId);
461
+ l && u(l);
460
462
  }
461
- Rt(e);
463
+ yt(e);
462
464
  },
463
- updateSpace: (e, a) => {
465
+ updateSpace: (e, l) => {
464
466
  const {
465
- type: b,
466
- anchor: r,
467
- order: g,
468
- zIndex: u,
467
+ type: p,
468
+ anchor: s,
469
+ order: f,
470
+ zIndex: g,
469
471
  scrollable: z,
470
- position: l,
472
+ position: c,
471
473
  centerContent: m,
472
474
  minimumSize: R,
473
475
  maximumSize: S,
474
476
  handleSize: w,
475
477
  touchHandleSize: I,
476
- handlePlacement: B,
477
- allowOverflow: P
478
- } = a, x = l && l.leftResizable || !1, T = l && l.rightResizable || !1, _ = l && l.topResizable || !1, k = l && l.bottomResizable || !1, N = l && l.topLeftResizable || !1, q = l && l.topRightResizable || !1, D = l && l.bottomLeftResizable || !1, ot = l && l.bottomRightResizable || !1;
478
+ handlePlacement: M,
479
+ allowOverflow: N
480
+ } = l, x = c && c.leftResizable || !1, T = c && c.rightResizable || !1, P = c && c.topResizable || !1, k = c && c.bottomResizable || !1, E = c && c.topLeftResizable || !1, X = c && c.topRightResizable || !1, D = c && c.bottomLeftResizable || !1, ot = c && c.bottomRightResizable || !1;
479
481
  let L = !1;
480
- if (e.type !== b && (e.type = b, e.position = Et(b), L = !0), e.anchor !== r && (e.anchor = r, e.orientation = Pt(r), L = !0, b === A.Anchored && (r === C.Left ? e.adjustEdge = e.adjustLeft : r === C.Top ? e.adjustEdge = e.adjustTop : r === C.Right ? e.adjustEdge = e.adjustRight : r === C.Bottom && (e.adjustEdge = e.adjustBottom))), e.left.size !== (l && l.left) && (e.left.size = l && l.left, e.left.resized = 0, e.left.adjusted = [], L = !0), e.right.size !== (l && l.right) && (e.right.size = l && l.right, e.right.resized = 0, e.right.adjusted = [], L = !0), e.top.size !== (l && l.top) && (e.top.size = l && l.top, e.top.resized = 0, e.top.adjusted = [], L = !0), e.bottom.size !== (l && l.bottom) && (e.bottom.size = l && l.bottom, e.bottom.resized = 0, e.bottom.adjusted = [], L = !0), e.width.size !== (l && l.width) && (e.width.size = l && l.width, e.width.resized = 0, e.width.adjusted = [], L = !0), e.height.size !== (l && l.height) && (e.height.size = l && l.height, e.height.resized = 0, e.height.adjusted = [], L = !0), Z(e.order, 0) !== Z(g, 0) && (e.order = Z(g, 0), L = !0), Z(e.zIndex, 0) !== Z(u, 0) && (e.zIndex = Z(u, 0), L = !0), Z(e.scrollable, !1) !== Z(z, !1) && (e.scrollable = Z(z, !1), L = !0), e.minimumSize !== R && (e.minimumSize = R, L = !0), e.maximumSize !== S && (e.maximumSize = S, L = !0), Z(e.centerContent, st.None) !== Z(m, st.None) && (e.centerContent = Z(m, st.None), L = !0), e.handleSize !== w && (e.handleSize = w || bt.handleSize, L = !0), e.touchHandleSize !== I && (e.touchHandleSize = I || bt.touchHandleSize, L = !0), e.handlePlacement !== B && (e.handlePlacement = B || bt.handlePlacement, L = !0), e.canResizeBottom !== k && (e.canResizeBottom = k, L = !0), e.canResizeTop !== _ && (e.canResizeTop = _, L = !0), e.canResizeLeft !== x && (e.canResizeLeft = x, L = !0), e.canResizeRight !== T && (e.canResizeRight = T, L = !0), e.canResizeTopLeft !== N && (e.canResizeTopLeft = N, L = !0), e.canResizeTopRight !== q && (e.canResizeTopRight = q, L = !0), e.canResizeBottomLeft !== D && (e.canResizeBottomLeft = D, L = !0), e.canResizeBottomRight !== ot && (e.canResizeBottomRight = ot, L = !0), e.allowOverflow !== P && (e.allowOverflow = P || bt.allowOverflow, L = !0), L) {
482
+ if (e.type !== p && (e.type = p, e.position = _t(p), L = !0), e.anchor !== s && (e.anchor = s, e.orientation = Nt(s), L = !0, p === A.Anchored && (s === C.Left ? e.adjustEdge = e.adjustLeft : s === C.Top ? e.adjustEdge = e.adjustTop : s === C.Right ? e.adjustEdge = e.adjustRight : s === C.Bottom && (e.adjustEdge = e.adjustBottom))), e.left.size !== (c && c.left) && (e.left.size = c && c.left, e.left.resized = 0, e.left.adjusted = [], L = !0), e.right.size !== (c && c.right) && (e.right.size = c && c.right, e.right.resized = 0, e.right.adjusted = [], L = !0), e.top.size !== (c && c.top) && (e.top.size = c && c.top, e.top.resized = 0, e.top.adjusted = [], L = !0), e.bottom.size !== (c && c.bottom) && (e.bottom.size = c && c.bottom, e.bottom.resized = 0, e.bottom.adjusted = [], L = !0), e.width.size !== (c && c.width) && (e.width.size = c && c.width, e.width.resized = 0, e.width.adjusted = [], L = !0), e.height.size !== (c && c.height) && (e.height.size = c && c.height, e.height.resized = 0, e.height.adjusted = [], L = !0), Z(e.order, 0) !== Z(f, 0) && (e.order = Z(f, 0), L = !0), Z(e.zIndex, 0) !== Z(g, 0) && (e.zIndex = Z(g, 0), L = !0), Z(e.scrollable, !1) !== Z(z, !1) && (e.scrollable = Z(z, !1), L = !0), e.minimumSize !== R && (e.minimumSize = R, L = !0), e.maximumSize !== S && (e.maximumSize = S, L = !0), Z(e.centerContent, st.None) !== Z(m, st.None) && (e.centerContent = Z(m, st.None), L = !0), e.handleSize !== w && (e.handleSize = w || bt.handleSize, L = !0), e.touchHandleSize !== I && (e.touchHandleSize = I || bt.touchHandleSize, L = !0), e.handlePlacement !== M && (e.handlePlacement = M || bt.handlePlacement, L = !0), e.canResizeBottom !== k && (e.canResizeBottom = k, L = !0), e.canResizeTop !== P && (e.canResizeTop = P, L = !0), e.canResizeLeft !== x && (e.canResizeLeft = x, L = !0), e.canResizeRight !== T && (e.canResizeRight = T, L = !0), e.canResizeTopLeft !== E && (e.canResizeTopLeft = E, L = !0), e.canResizeTopRight !== X && (e.canResizeTopRight = X, L = !0), e.canResizeBottomLeft !== D && (e.canResizeBottomLeft = D, L = !0), e.canResizeBottomRight !== ot && (e.canResizeBottomRight = ot, L = !0), e.allowOverflow !== N && (e.allowOverflow = N || bt.allowOverflow, L = !0), L) {
481
483
  if (e.parentId) {
482
- const F = o(e.parentId);
483
- F && f(F);
484
+ const q = o(e.parentId);
485
+ q && u(q);
484
486
  }
485
- Rt(e);
487
+ yt(e);
486
488
  }
487
489
  },
488
490
  createSpace: () => ({}),
@@ -490,332 +492,332 @@ function fe() {
490
492
  startTouchResize: () => null,
491
493
  startMouseDrag: () => null,
492
494
  startTouchDrag: () => null
493
- }, s = de(h), y = ce(h);
494
- return h.createSpace = (e, a, b) => {
495
- const { position: r, anchor: g, type: u, ...z } = a, l = r && r.rightResizable || !1, m = r && r.leftResizable || !1, R = r && r.bottomResizable || !1, S = r && r.topResizable || !1, w = r && r.topLeftResizable || !1, I = r && r.topRightResizable || !1, B = r && r.bottomLeftResizable || !1, P = r && r.bottomRightResizable || !1, x = {
495
+ }, r = ze(d), b = we(d);
496
+ return d.createSpace = (e, l, p) => {
497
+ const { position: s, anchor: f, type: g, ...z } = l, c = s && s.rightResizable || !1, m = s && s.leftResizable || !1, R = s && s.bottomResizable || !1, S = s && s.topResizable || !1, w = s && s.topLeftResizable || !1, I = s && s.topRightResizable || !1, M = s && s.bottomLeftResizable || !1, N = s && s.bottomRightResizable || !1, x = {
496
498
  ...bt,
497
499
  ...z,
498
- store: h,
499
- update: b,
500
+ store: d,
501
+ update: p,
500
502
  updateParent: () => {
501
503
  if (e) {
502
- const T = h.getSpace(e);
504
+ const T = d.getSpace(e);
503
505
  T && T.update();
504
506
  }
505
507
  },
506
508
  parentId: e,
507
509
  children: [],
508
- anchor: g,
509
- type: u,
510
- orientation: Pt(g),
511
- position: Et(u),
512
- left: ut(r && r.left),
513
- right: ut(r && r.right),
514
- top: ut(r && r.top),
515
- bottom: ut(r && r.bottom),
516
- width: ut(r && r.width),
517
- height: ut(r && r.height),
518
- canResizeLeft: l,
510
+ anchor: f,
511
+ type: g,
512
+ orientation: Nt(f),
513
+ position: _t(g),
514
+ left: ut(s && s.left),
515
+ right: ut(s && s.right),
516
+ top: ut(s && s.top),
517
+ bottom: ut(s && s.bottom),
518
+ width: ut(s && s.width),
519
+ height: ut(s && s.height),
520
+ canResizeLeft: c,
519
521
  canResizeRight: m,
520
522
  canResizeTop: R,
521
523
  canResizeBottom: S,
522
524
  canResizeTopLeft: w,
523
525
  canResizeTopRight: I,
524
- canResizeBottomLeft: B,
525
- canResizeBottomRight: P
526
+ canResizeBottomLeft: M,
527
+ canResizeBottomRight: N
526
528
  };
527
- return x.anchoredChildren = (T, _, k) => T.filter((N) => N.type === A.Anchored && N.anchor === _ && N.zIndex === k), x.adjustLeft = (T) => Ct(x.left.adjusted, T) ? !1 : (x.left.adjusted = T, !0), x.adjustRight = (T) => Ct(x.right.adjusted, T) ? !1 : (x.right.adjusted = T, !0), x.adjustTop = (T) => Ct(x.top.adjusted, T) ? !1 : (x.top.adjusted = T, !0), x.adjustBottom = (T) => Ct(x.bottom.adjusted, T) ? !1 : (x.bottom.adjusted = T, !0), u === A.Anchored && (g === C.Left ? x.adjustEdge = x.adjustLeft : g === C.Top ? x.adjustEdge = x.adjustTop : g === C.Right ? x.adjustEdge = x.adjustRight : g === C.Bottom && (x.adjustEdge = x.adjustBottom)), x;
528
- }, h.startMouseResize = (e, a, b, r) => {
529
- s.startResize(
530
- b,
529
+ return x.anchoredChildren = (T, P, k) => T.filter((E) => E.type === A.Anchored && E.anchor === P && E.zIndex === k), x.adjustLeft = (T) => Ct(x.left.adjusted, T) ? !1 : (x.left.adjusted = T, !0), x.adjustRight = (T) => Ct(x.right.adjusted, T) ? !1 : (x.right.adjusted = T, !0), x.adjustTop = (T) => Ct(x.top.adjusted, T) ? !1 : (x.top.adjusted = T, !0), x.adjustBottom = (T) => Ct(x.bottom.adjusted, T) ? !1 : (x.bottom.adjusted = T, !0), g === A.Anchored && (f === C.Left ? x.adjustEdge = x.adjustLeft : f === C.Top ? x.adjustEdge = x.adjustTop : f === C.Right ? x.adjustEdge = x.adjustRight : f === C.Bottom && (x.adjustEdge = x.adjustBottom)), x;
530
+ }, d.startMouseResize = (e, l, p, s) => {
531
+ r.startResize(
532
+ p,
531
533
  e,
532
- a,
534
+ l,
533
535
  wt.Mouse,
534
536
  zt.Mouse,
535
- (g) => ({
536
- x: g.clientX,
537
- y: g.clientY
537
+ (f) => ({
538
+ x: f.clientX,
539
+ y: f.clientY
538
540
  }),
539
- r
541
+ s
540
542
  );
541
- }, h.startTouchResize = (e, a, b, r) => {
542
- s.startResize(
543
- b,
543
+ }, d.startTouchResize = (e, l, p, s) => {
544
+ r.startResize(
545
+ p,
544
546
  e,
545
- a,
547
+ l,
546
548
  wt.Touch,
547
549
  zt.Touch,
548
- (g) => ({
549
- x: g.touches[0].clientX,
550
- y: g.touches[0].clientY
550
+ (f) => ({
551
+ x: f.touches[0].clientX,
552
+ y: f.touches[0].clientY
551
553
  }),
552
- r
554
+ s
553
555
  );
554
- }, h.startMouseDrag = (e, a, b) => {
555
- y.startDrag(
556
- a,
556
+ }, d.startMouseDrag = (e, l, p) => {
557
+ b.startDrag(
558
+ l,
557
559
  e,
558
560
  wt.Mouse,
559
561
  zt.Mouse,
560
- (r) => ({
561
- x: r.clientX,
562
- y: r.clientY
562
+ (s) => ({
563
+ x: s.clientX,
564
+ y: s.clientY
563
565
  }),
564
- b
566
+ p
565
567
  );
566
- }, h.startTouchDrag = (e, a, b) => {
567
- y.startDrag(
568
- a,
568
+ }, d.startTouchDrag = (e, l, p) => {
569
+ b.startDrag(
570
+ l,
569
571
  e,
570
572
  wt.Touch,
571
573
  zt.Touch,
572
- (r) => ({
573
- x: r.touches[0].clientX,
574
- y: r.touches[0].clientY
574
+ (s) => ({
575
+ x: s.touches[0].clientX,
576
+ y: s.touches[0].clientY
575
577
  }),
576
- b
578
+ p
577
579
  );
578
- }, h;
580
+ }, d;
579
581
  }
580
- const Ft = (t) => {
581
- const i = it(void 0), o = it(!1), n = it(!1), [f, h] = V(0);
582
- o.current && (n.current = !0), et(() => (o.current || (i.current = t(), o.current = !0), h((s) => s + 1), () => {
582
+ const Ut = (t) => {
583
+ const i = it(void 0), o = it(!1), n = it(!1), [u, d] = U(0);
584
+ o.current && (n.current = !0), et(() => (o.current || (i.current = t(), o.current = !0), d((r) => r + 1), () => {
583
585
  n.current && i.current && i.current();
584
586
  }), []);
585
- }, jt = M.createContext(void 0), Ot = M.createContext(void 0), At = M.createContext(void 0), Vt = M.createContext({}), qt = fe(), yt = {
586
- id: d.string,
587
- className: d.string,
588
- style: d.oneOfType([d.object, d.array]),
589
- as: d.any,
590
- centerContent: d.oneOf([st.None, st.Vertical, st.HorizontalVertical]),
591
- zIndex: d.number,
592
- scrollable: d.bool,
593
- trackSize: d.bool,
594
- allowOverflow: d.bool,
595
- handleRender: d.func,
596
- onClick: d.func,
597
- onDoubleClick: d.func,
598
- onMouseDown: d.func,
599
- onMouseEnter: d.func,
600
- onMouseLeave: d.func,
601
- onMouseMove: d.func,
602
- onTouchStart: d.func,
603
- onTouchMove: d.func,
604
- onTouchEnd: d.func
587
+ }, jt = O.createContext(void 0), Bt = O.createContext(void 0), At = O.createContext(void 0), Xt = O.createContext({}), Gt = ve(), vt = {
588
+ id: h.string,
589
+ className: h.string,
590
+ style: h.oneOfType([h.object, h.array]),
591
+ as: h.any,
592
+ centerContent: h.oneOf([st.None, st.Vertical, st.HorizontalVertical]),
593
+ zIndex: h.number,
594
+ scrollable: h.bool,
595
+ trackSize: h.bool,
596
+ allowOverflow: h.bool,
597
+ handleRender: h.func,
598
+ onClick: h.func,
599
+ onDoubleClick: h.func,
600
+ onMouseDown: h.func,
601
+ onMouseEnter: h.func,
602
+ onMouseLeave: h.func,
603
+ onMouseMove: h.func,
604
+ onTouchStart: h.func,
605
+ onTouchMove: h.func,
606
+ onTouchEnd: h.func
605
607
  };
606
- function me() {
607
- const [, t] = M.useState(0);
608
- return M.useCallback(() => {
608
+ function Se() {
609
+ const [, t] = O.useState(0);
610
+ return O.useCallback(() => {
609
611
  t((i) => i + 1);
610
612
  }, []);
611
613
  }
612
- function Ut() {
614
+ function Jt() {
613
615
  if (ft) {
614
- if (M.version && M.version.startsWith("18"))
615
- return `s${M.useId().replace(/\:/g, "")}`;
616
- if (typeof M.useId == "function")
617
- return `s${M.useId().replace(/\:/g, "")}`;
616
+ if (O.version && O.version.startsWith("18"))
617
+ return `s${O.useId().replace(/\:/g, "")}`;
618
+ if (typeof O.useId == "function")
619
+ return `s${O.useId().replace(/\:/g, "")}`;
618
620
  }
619
- return `s${ne()}`;
621
+ return `s${fe()}`;
620
622
  }
621
- function ge(t) {
622
- const i = qt, o = me(), n = M.useContext(jt), f = M.useContext(At), { debug: h } = M.useContext(Vt), s = Ut(), [y] = M.useState(t.id || s), e = M.useRef(null), a = M.useRef(void 0), [b, r] = M.useState();
623
- let g = i.getSpace(y);
624
- h && console.table(i.getSpaces());
625
- const u = {
623
+ function Te(t) {
624
+ const i = Gt, o = Se(), n = O.useContext(jt), u = O.useContext(At), { debug: d } = O.useContext(Xt), r = Jt(), [b] = O.useState(t.id || r), e = O.useRef(null), l = O.useRef(void 0), [p, s] = O.useState();
625
+ let f = i.getSpace(b);
626
+ d && console.table(i.getSpaces());
627
+ const g = {
626
628
  ...t,
627
- id: y,
628
- zIndex: Z(t.zIndex, f)
629
+ id: b,
630
+ zIndex: Z(t.zIndex, u)
629
631
  };
630
- g ? i.updateSpace(g, u) : (g = i.createSpace(n, u, o), i.addSpace(g));
631
- const z = pe(i, g);
632
- return Ft(() => {
633
- const l = e.current ? e.current.getBoundingClientRect() : new DOMRect();
634
- return g.dimension = {
635
- ...l,
636
- left: Math.floor(l.left),
637
- top: Math.floor(l.top),
638
- right: Math.floor(l.right),
639
- bottom: Math.floor(l.bottom),
640
- width: Math.floor(l.width),
641
- height: Math.floor(l.height),
642
- x: Math.floor(l.x),
643
- y: Math.floor(l.y)
644
- }, r(g.dimension), t.trackSize && (a.current = new Yt(e.current, (m) => {
645
- g.dimension = {
646
- ...l,
632
+ f ? i.updateSpace(f, g) : (f = i.createSpace(n, g, o), i.addSpace(f));
633
+ const z = Ce(i, f);
634
+ return Ut(() => {
635
+ const c = e.current ? e.current.getBoundingClientRect() : new DOMRect();
636
+ return f.dimension = {
637
+ ...c,
638
+ left: Math.floor(c.left),
639
+ top: Math.floor(c.top),
640
+ right: Math.floor(c.right),
641
+ bottom: Math.floor(c.bottom),
642
+ width: Math.floor(c.width),
643
+ height: Math.floor(c.height),
644
+ x: Math.floor(c.x),
645
+ y: Math.floor(c.y)
646
+ }, s(f.dimension), t.trackSize && (l.current = new ne(e.current, (m) => {
647
+ f.dimension = {
648
+ ...c,
647
649
  width: Math.floor(m.width),
648
650
  height: Math.floor(m.height)
649
- }, r(g.dimension);
651
+ }, s(f.dimension);
650
652
  })), () => {
651
- a.current && a.current.detach(), i.removeSpace(g);
653
+ l.current && l.current.detach(), i.removeSpace(f);
652
654
  };
653
- }), { space: g, resizeHandles: z, domRect: b, elementRef: e };
655
+ }), { space: f, resizeHandles: z, domRect: p, elementRef: e };
654
656
  }
655
- const be = [
656
- { id: "ml", className: "resize-left", resizeType: p.Left, condition: (t) => t.canResizeLeft },
657
- { id: "mr", className: "resize-right", resizeType: p.Right, condition: (t) => t.canResizeRight },
658
- { id: "mt", className: "resize-top", resizeType: p.Top, condition: (t) => t.canResizeTop },
659
- { id: "mb", className: "resize-bottom", resizeType: p.Bottom, condition: (t) => t.canResizeBottom },
660
- { id: "mtl", className: "resize-top-left", resizeType: p.TopLeft, condition: (t) => t.canResizeTopLeft },
661
- { id: "mtr", className: "resize-top-right", resizeType: p.TopRight, condition: (t) => t.canResizeTopRight },
657
+ const xe = [
658
+ { id: "ml", className: "resize-left", resizeType: y.Left, condition: (t) => t.canResizeLeft },
659
+ { id: "mr", className: "resize-right", resizeType: y.Right, condition: (t) => t.canResizeRight },
660
+ { id: "mt", className: "resize-top", resizeType: y.Top, condition: (t) => t.canResizeTop },
661
+ { id: "mb", className: "resize-bottom", resizeType: y.Bottom, condition: (t) => t.canResizeBottom },
662
+ { id: "mtl", className: "resize-top-left", resizeType: y.TopLeft, condition: (t) => t.canResizeTopLeft },
663
+ { id: "mtr", className: "resize-top-right", resizeType: y.TopRight, condition: (t) => t.canResizeTopRight },
662
664
  {
663
665
  id: "mbl",
664
666
  className: "resize-bottom-left",
665
- resizeType: p.BottomLeft,
667
+ resizeType: y.BottomLeft,
666
668
  condition: (t) => t.canResizeBottomLeft
667
669
  },
668
670
  {
669
671
  id: "mbr",
670
672
  className: "resize-bottom-right",
671
- resizeType: p.BottomRight,
673
+ resizeType: y.BottomRight,
672
674
  condition: (t) => t.canResizeBottomRight
673
675
  }
674
676
  ];
675
- function pe(t, i) {
676
- const o = [], n = (f, h, s) => {
677
+ function Ce(t, i) {
678
+ const o = [], n = (u, d, r) => {
677
679
  o.push({
678
- id: `${i.id}-${f}`,
679
- key: f,
680
- className: `spaces-resize-handle ${h}`,
681
- onMouseDown: (y) => t.startMouseResize(s, i, y),
682
- onTouchStart: (y) => t.startTouchResize(s, i, y)
680
+ id: `${i.id}-${u}`,
681
+ key: u,
682
+ className: `spaces-resize-handle ${d}`,
683
+ onMouseDown: (b) => t.startMouseResize(r, i, b),
684
+ onTouchStart: (b) => t.startTouchResize(r, i, b)
683
685
  });
684
686
  };
685
- return be.forEach((f) => {
686
- f.condition(i) && n(f.id, f.className, f.resizeType);
687
+ return xe.forEach((u) => {
688
+ u.condition(i) && n(u.id, u.className, u.resizeType);
687
689
  }), {
688
690
  mouseHandles: o
689
691
  };
690
692
  }
691
- function ii() {
692
- const t = qt, i = M.useContext(jt), o = i ? t.getSpace(i) : void 0, n = M.useContext(Ot), f = M.useContext(At), h = M.useCallback(
693
- (b, r) => o ? t.startMouseDrag(o, b, r) : null,
693
+ function pi() {
694
+ const t = Gt, i = O.useContext(jt), o = i ? t.getSpace(i) : void 0, n = O.useContext(Bt), u = O.useContext(At), d = O.useCallback(
695
+ (p, s) => o ? t.startMouseDrag(o, p, s) : null,
694
696
  [i]
695
- ), s = M.useCallback(
696
- (b, r) => o ? t.startTouchDrag(o, b, r) : null,
697
+ ), r = O.useCallback(
698
+ (p, s) => o ? t.startTouchDrag(o, p, s) : null,
697
699
  [i]
698
- ), y = M.useCallback(() => o ? t.updateStyles(o) : null, [i]);
700
+ ), b = O.useCallback(() => o ? t.updateStyles(o) : null, [i]);
699
701
  return {
700
702
  size: {
701
703
  ...{ width: 0, height: 0, x: 0, y: 0 },
702
704
  ...n
703
705
  },
704
- layer: f || 0,
705
- startMouseDrag: h,
706
- startTouchDrag: s,
707
- forceUpdate: y
706
+ layer: u || 0,
707
+ startMouseDrag: d,
708
+ startTouchDrag: r,
709
+ forceUpdate: b
708
710
  };
709
711
  }
710
712
  let ft = !1;
711
- function oi() {
713
+ function zi() {
712
714
  ft = !0;
713
715
  }
714
- const ze = (t) => /* @__PURE__ */ c("div", { className: "spaces-centered", children: t.children }), we = (t) => /* @__PURE__ */ c("div", { className: "spaces-centered-vertically", children: t.children });
715
- function Re(t, i) {
716
+ const Ae = (t) => /* @__PURE__ */ a("div", { className: "spaces-centered", children: t.children }), Le = (t) => /* @__PURE__ */ a("div", { className: "spaces-centered-vertically", children: t.children });
717
+ function $e(t, i) {
716
718
  switch (i) {
717
719
  case st.Vertical:
718
- return /* @__PURE__ */ c(we, { children: t });
720
+ return /* @__PURE__ */ a(Le, { children: t });
719
721
  case st.HorizontalVertical:
720
- return /* @__PURE__ */ c(ze, { children: t });
722
+ return /* @__PURE__ */ a(Ae, { children: t });
721
723
  }
722
724
  return t;
723
725
  }
724
- class K extends M.Component {
726
+ class K extends O.Component {
725
727
  _react_spaces_uniqueid;
726
728
  render() {
727
- return /* @__PURE__ */ c(ve, { ...this.props, wrapperInstance: this });
729
+ return /* @__PURE__ */ a(Me, { ...this.props, wrapperInstance: this });
728
730
  }
729
731
  }
730
- const ve = (t) => {
732
+ const Me = (t) => {
731
733
  let i = t.id ?? t.wrapperInstance._react_spaces_uniqueid;
732
- const [o, n] = M.useState(!!ft), f = Ut();
733
- i || (t.wrapperInstance._react_spaces_uniqueid = f, i = t.wrapperInstance._react_spaces_uniqueid);
734
+ const [o, n] = O.useState(!!ft), u = Jt();
735
+ i || (t.wrapperInstance._react_spaces_uniqueid = u, i = t.wrapperInstance._react_spaces_uniqueid);
734
736
  const {
735
- style: h,
736
- className: s,
737
- onClick: y,
737
+ style: d,
738
+ className: r,
739
+ onClick: b,
738
740
  onDoubleClick: e,
739
- onMouseDown: a,
740
- onMouseEnter: b,
741
- onMouseLeave: r,
742
- onMouseMove: g,
743
- onTouchStart: u,
741
+ onMouseDown: l,
742
+ onMouseEnter: p,
743
+ onMouseLeave: s,
744
+ onMouseMove: f,
745
+ onTouchStart: g,
744
746
  onTouchMove: z,
745
- onTouchEnd: l,
747
+ onTouchEnd: c,
746
748
  children: m,
747
749
  handleRender: R
748
750
  } = t, S = {
749
- onClick: y,
751
+ onClick: b,
750
752
  onDoubleClick: e,
751
- onMouseDown: a,
752
- onMouseEnter: b,
753
- onMouseLeave: r,
754
- onMouseMove: g,
755
- onTouchStart: u,
753
+ onMouseDown: l,
754
+ onMouseEnter: p,
755
+ onMouseLeave: s,
756
+ onMouseMove: f,
757
+ onTouchStart: g,
756
758
  onTouchMove: z,
757
- onTouchEnd: l
758
- }, { space: w, domRect: I, elementRef: B, resizeHandles: P } = ge({
759
+ onTouchEnd: c
760
+ }, { space: w, domRect: I, elementRef: M, resizeHandles: N } = Te({
759
761
  ...t,
760
762
  id: i
761
763
  });
762
- if (ft && !Wt()) {
764
+ if (ft && !qt()) {
763
765
  const D = document.getElementById(`style_${i}_ssr`);
764
- D && (w.ssrStyle = D.innerHTML), Rt(w);
766
+ D && (w.ssrStyle = D.innerHTML), yt(w);
765
767
  }
766
- Ft(() => {
767
- w.element = B.current, ft && o && n(!1);
768
+ Ut(() => {
769
+ w.element = M.current, ft && o && n(!1);
768
770
  });
769
- const x = s ? s.split(" ").map((D) => D.trim()) : [], T = [
771
+ const x = r ? r.split(" ").map((D) => D.trim()) : [], T = [
770
772
  "spaces-space",
771
773
  w.children.find((D) => D.resizing) ? "spaces-resizing" : void 0,
772
774
  w.type === A.Fixed ? "spaces-fixedsize-layout" : void 0,
773
775
  w.type === A.ViewPort ? "spaces-fullpage-layout" : void 0,
774
776
  ...x.map((D) => `${D}-container`)
775
- ].filter((D) => D), _ = ["spaces-space-inner", ...x];
776
- let k = h;
777
+ ].filter((D) => D), P = ["spaces-space-inner", ...x];
778
+ let k = d;
777
779
  w.handlePlacement === rt.Inside && (k = {
778
- ...h,
780
+ ...d,
779
781
  left: w.anchor === C.Right ? w.handleSize : void 0,
780
782
  right: w.anchor === C.Left ? w.handleSize : void 0,
781
783
  top: w.anchor === C.Bottom ? w.handleSize : void 0,
782
784
  bottom: w.anchor === C.Top ? w.handleSize : void 0
783
785
  });
784
- const N = Re(m, t.centerContent), q = {
786
+ const E = $e(m, t.centerContent), X = {
785
787
  id: w.id,
786
- ref: B,
788
+ ref: M,
787
789
  className: T.join(" "),
788
790
  ...S
789
791
  };
790
- return /* @__PURE__ */ G(Nt, { children: [
791
- P.mouseHandles.map((D) => R?.(D) || /* @__PURE__ */ c("div", { ...D })),
792
- ft && w.ssrStyle && o && /* @__PURE__ */ c("style", { id: `style_${w.id}_ssr`, children: w.ssrStyle }),
793
- M.createElement(
792
+ return /* @__PURE__ */ F(Et, { children: [
793
+ N.mouseHandles.map((D) => R?.(D) || /* @__PURE__ */ a("div", { ...D })),
794
+ ft && w.ssrStyle && o && /* @__PURE__ */ a("style", { id: `style_${w.id}_ssr`, children: w.ssrStyle }),
795
+ O.createElement(
794
796
  t.as || "div",
795
- q,
796
- /* @__PURE__ */ c("div", { className: _.join(" "), style: k, children: /* @__PURE__ */ c(jt.Provider, { value: w.id, children: /* @__PURE__ */ c(At.Provider, { value: void 0, children: /* @__PURE__ */ c(Ot.Provider, { value: I, children: N }) }) }) })
797
+ X,
798
+ /* @__PURE__ */ a("div", { className: P.join(" "), style: k, children: /* @__PURE__ */ a(jt.Provider, { value: w.id, children: /* @__PURE__ */ a(At.Provider, { value: void 0, children: /* @__PURE__ */ a(Bt.Provider, { value: I, children: E }) }) }) })
797
799
  )
798
800
  ] });
799
801
  }, St = {
800
- ...yt,
801
- size: d.oneOfType([d.string, d.number]).isRequired,
802
- order: d.number,
803
- handleSize: d.number,
804
- touchHandleSize: d.number,
805
- handlePlacement: d.oneOf([
802
+ ...vt,
803
+ size: h.oneOfType([h.string, h.number]).isRequired,
804
+ order: h.number,
805
+ handleSize: h.number,
806
+ touchHandleSize: h.number,
807
+ handlePlacement: h.oneOf([
806
808
  rt.Inside,
807
809
  rt.OverlayBoundary,
808
810
  rt.OverlayInside
809
811
  ]),
810
- handleRender: d.func,
811
- minimumSize: d.number,
812
- maximumSize: d.number,
813
- onResizeStart: d.func,
814
- onResizeEnd: d.func
812
+ handleRender: h.func,
813
+ minimumSize: h.number,
814
+ maximumSize: h.number,
815
+ onResizeStart: h.func,
816
+ onResizeEnd: h.func
815
817
  }, Tt = {
816
818
  ...St,
817
- resizable: d.bool
818
- }, ye = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
819
+ resizable: h.bool
820
+ }, je = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
819
821
  K,
820
822
  {
821
823
  ...o,
@@ -825,8 +827,8 @@ const ve = (t) => {
825
827
  children: t
826
828
  }
827
829
  );
828
- ye.propTypes = St;
829
- const Se = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
830
+ je.propTypes = St;
831
+ const Be = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
830
832
  K,
831
833
  {
832
834
  ...n,
@@ -836,8 +838,8 @@ const Se = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
836
838
  children: i
837
839
  }
838
840
  );
839
- Se.propTypes = Tt;
840
- const Te = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
841
+ Be.propTypes = Tt;
842
+ const Ie = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
841
843
  K,
842
844
  {
843
845
  ...o,
@@ -847,8 +849,8 @@ const Te = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
847
849
  children: t
848
850
  }
849
851
  );
850
- Te.propTypes = St;
851
- const xe = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
852
+ Ie.propTypes = St;
853
+ const Oe = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
852
854
  K,
853
855
  {
854
856
  ...n,
@@ -858,8 +860,8 @@ const xe = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
858
860
  children: i
859
861
  }
860
862
  );
861
- xe.propTypes = Tt;
862
- const Ce = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
863
+ Oe.propTypes = Tt;
864
+ const De = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
863
865
  K,
864
866
  {
865
867
  ...o,
@@ -869,8 +871,8 @@ const Ce = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
869
871
  children: t
870
872
  }
871
873
  );
872
- Ce.propTypes = St;
873
- const Ae = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
874
+ De.propTypes = St;
875
+ const _e = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
874
876
  K,
875
877
  {
876
878
  ...n,
@@ -880,8 +882,8 @@ const Ae = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
880
882
  children: i
881
883
  }
882
884
  );
883
- Ae.propTypes = Tt;
884
- const Le = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
885
+ _e.propTypes = Tt;
886
+ const Ne = ({ children: t, size: i, ...o }) => /* @__PURE__ */ a(
885
887
  K,
886
888
  {
887
889
  ...o,
@@ -891,8 +893,8 @@ const Le = ({ children: t, size: i, ...o }) => /* @__PURE__ */ c(
891
893
  children: t
892
894
  }
893
895
  );
894
- Le.propTypes = St;
895
- const $e = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
896
+ Ne.propTypes = St;
897
+ const Pe = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ a(
896
898
  K,
897
899
  {
898
900
  ...n,
@@ -902,297 +904,297 @@ const $e = ({ size: t, children: i, resizable: o, ...n }) => /* @__PURE__ */ c(
902
904
  children: i
903
905
  }
904
906
  );
905
- $e.propTypes = Tt;
906
- const Be = oe(
907
+ Pe.propTypes = Tt;
908
+ const Ee = ue(
907
909
  {
908
910
  ...Tt,
909
- type: d.oneOf([A.Positioned, A.Fill, A.Anchored]),
910
- anchor: d.oneOf([C.Left, C.Top, C.Right, C.Bottom]),
911
- anchorSize: d.oneOfType([d.string, d.number]),
912
- left: d.oneOfType([d.string, d.number]),
913
- top: d.oneOfType([d.string, d.number]),
914
- right: d.oneOfType([d.string, d.number]),
915
- bottom: d.oneOfType([d.string, d.number]),
916
- width: d.oneOfType([d.string, d.number]),
917
- height: d.oneOfType([d.string, d.number]),
918
- resizeTypes: d.array
911
+ type: h.oneOf([A.Positioned, A.Fill, A.Anchored]),
912
+ anchor: h.oneOf([C.Left, C.Top, C.Right, C.Bottom]),
913
+ anchorSize: h.oneOfType([h.string, h.number]),
914
+ left: h.oneOfType([h.string, h.number]),
915
+ top: h.oneOfType([h.string, h.number]),
916
+ right: h.oneOfType([h.string, h.number]),
917
+ bottom: h.oneOfType([h.string, h.number]),
918
+ width: h.oneOfType([h.string, h.number]),
919
+ height: h.oneOfType([h.string, h.number]),
920
+ resizeTypes: h.array
919
921
  },
920
922
  "size"
921
- ), je = ({
923
+ ), ke = ({
922
924
  children: t,
923
925
  type: i,
924
926
  left: o,
925
927
  top: n,
926
- right: f,
927
- bottom: h,
928
- width: s,
929
- height: y,
928
+ right: u,
929
+ bottom: d,
930
+ width: r,
931
+ height: b,
930
932
  anchorSize: e,
931
- anchor: a,
932
- resizable: b,
933
- resizeTypes: r,
934
- ...g
933
+ anchor: l,
934
+ resizable: p,
935
+ resizeTypes: s,
936
+ ...f
935
937
  }) => {
936
- let u;
937
- return i = i || A.Fill, i === A.Positioned ? u = {
938
+ let g;
939
+ return i = i || A.Fill, i === A.Positioned ? g = {
938
940
  left: o,
939
941
  top: n,
940
- right: f,
941
- bottom: h,
942
- width: s,
943
- height: y,
944
- leftResizable: r && (r.includes(p.Left) || r.includes(p.All)),
945
- topResizable: r && (r.includes(p.Top) || r.includes(p.All)),
946
- rightResizable: r && (r.includes(p.Right) || r.includes(p.All)),
947
- bottomResizable: r && (r.includes(p.Bottom) || r.includes(p.All)),
948
- topLeftResizable: r && (r.includes(p.TopLeft) || r.includes(p.All)),
949
- topRightResizable: r && (r.includes(p.TopRight) || r.includes(p.All)),
950
- bottomLeftResizable: r && (r.includes(p.BottomLeft) || r.includes(p.All)),
951
- bottomRightResizable: r && (r.includes(p.BottomRight) || r.includes(p.All))
952
- } : a === C.Left ? (u = { left: 0, top: 0, bottom: 0, width: e, rightResizable: b }, i = A.Anchored) : a === C.Right ? (u = { right: 0, top: 0, bottom: 0, width: e, leftResizable: b }, i = A.Anchored) : a === C.Top ? (u = { left: 0, top: 0, right: 0, height: e, bottomResizable: b }, i = A.Anchored) : a === C.Bottom ? (u = { left: 0, bottom: 0, right: 0, height: e, topResizable: b }, i = A.Anchored) : (u = {
942
+ right: u,
943
+ bottom: d,
944
+ width: r,
945
+ height: b,
946
+ leftResizable: s && (s.includes(y.Left) || s.includes(y.All)),
947
+ topResizable: s && (s.includes(y.Top) || s.includes(y.All)),
948
+ rightResizable: s && (s.includes(y.Right) || s.includes(y.All)),
949
+ bottomResizable: s && (s.includes(y.Bottom) || s.includes(y.All)),
950
+ topLeftResizable: s && (s.includes(y.TopLeft) || s.includes(y.All)),
951
+ topRightResizable: s && (s.includes(y.TopRight) || s.includes(y.All)),
952
+ bottomLeftResizable: s && (s.includes(y.BottomLeft) || s.includes(y.All)),
953
+ bottomRightResizable: s && (s.includes(y.BottomRight) || s.includes(y.All))
954
+ } : l === C.Left ? (g = { left: 0, top: 0, bottom: 0, width: e, rightResizable: p }, i = A.Anchored) : l === C.Right ? (g = { right: 0, top: 0, bottom: 0, width: e, leftResizable: p }, i = A.Anchored) : l === C.Top ? (g = { left: 0, top: 0, right: 0, height: e, bottomResizable: p }, i = A.Anchored) : l === C.Bottom ? (g = { left: 0, bottom: 0, right: 0, height: e, topResizable: p }, i = A.Anchored) : (g = {
953
955
  left: 0,
954
956
  top: 0,
955
957
  bottom: 0,
956
958
  right: 0
957
- }, i = A.Fill), /* @__PURE__ */ c(K, { ...g, type: i, anchor: a, position: u, children: t });
959
+ }, i = A.Fill), /* @__PURE__ */ a(K, { ...f, type: i, anchor: l, position: g, children: t });
958
960
  };
959
- je.propTypes = Be;
960
- const Oe = (t) => /* @__PURE__ */ c(K, { ...t, type: A.Fill, position: { left: 0, top: 0, right: 0, bottom: 0 }, children: t.children });
961
- Oe.propTypes = yt;
962
- const Me = ({ width: t, height: i, children: o, ...n }) => /* @__PURE__ */ c(K, { ...n, type: A.Fixed, position: { width: t, height: i }, children: o });
963
- Me.propTypes = {
964
- ...yt,
965
- width: d.oneOfType([d.string, d.number]),
966
- height: d.oneOfType([d.string, d.number]).isRequired
961
+ ke.propTypes = Ee;
962
+ const He = (t) => /* @__PURE__ */ a(K, { ...t, type: A.Fill, position: { left: 0, top: 0, right: 0, bottom: 0 }, children: t.children });
963
+ He.propTypes = vt;
964
+ const We = ({ width: t, height: i, children: o, ...n }) => /* @__PURE__ */ a(K, { ...n, type: A.Fixed, position: { width: t, height: i }, children: o });
965
+ We.propTypes = {
966
+ ...vt,
967
+ width: h.oneOfType([h.string, h.number]),
968
+ height: h.oneOfType([h.string, h.number]).isRequired
967
969
  };
968
- const Ie = (t) => /* @__PURE__ */ c(At.Provider, { value: t.zIndex, children: t.children });
969
- Ie.propTypes = {
970
- zIndex: d.number.isRequired
970
+ const Fe = (t) => /* @__PURE__ */ a(At.Provider, { value: t.zIndex, children: t.children });
971
+ Fe.propTypes = {
972
+ zIndex: h.number.isRequired
971
973
  };
972
- const De = ({ left: t, top: i, right: o, bottom: n, width: f, height: h, resizable: s, ...y }) => {
973
- const e = s || [];
974
- return /* @__PURE__ */ c(
974
+ const Ve = ({ left: t, top: i, right: o, bottom: n, width: u, height: d, resizable: r, ...b }) => {
975
+ const e = r || [];
976
+ return /* @__PURE__ */ a(
975
977
  K,
976
978
  {
977
- ...y,
979
+ ...b,
978
980
  type: A.Positioned,
979
981
  position: {
980
982
  left: t,
981
983
  top: i,
982
984
  right: o,
983
985
  bottom: n,
984
- leftResizable: e.includes(p.Left) || e.includes(p.All),
985
- topResizable: e.includes(p.Top) || e.includes(p.All),
986
- rightResizable: e.includes(p.Right) || e.includes(p.All),
987
- bottomResizable: e.includes(p.Bottom) || e.includes(p.All),
988
- topLeftResizable: e.includes(p.TopLeft) || e.includes(p.All),
989
- topRightResizable: e.includes(p.TopRight) || e.includes(p.All),
990
- bottomLeftResizable: e.includes(p.BottomLeft) || e.includes(p.All),
991
- bottomRightResizable: e.includes(p.BottomRight) || e.includes(p.All),
992
- width: f,
993
- height: h
986
+ leftResizable: e.includes(y.Left) || e.includes(y.All),
987
+ topResizable: e.includes(y.Top) || e.includes(y.All),
988
+ rightResizable: e.includes(y.Right) || e.includes(y.All),
989
+ bottomResizable: e.includes(y.Bottom) || e.includes(y.All),
990
+ topLeftResizable: e.includes(y.TopLeft) || e.includes(y.All),
991
+ topRightResizable: e.includes(y.TopRight) || e.includes(y.All),
992
+ bottomLeftResizable: e.includes(y.BottomLeft) || e.includes(y.All),
993
+ bottomRightResizable: e.includes(y.BottomRight) || e.includes(y.All),
994
+ width: u,
995
+ height: d
994
996
  },
995
- children: y.children
997
+ children: b.children
996
998
  }
997
999
  );
998
1000
  };
999
- De.propTypes = {
1000
- ...yt,
1001
- left: d.oneOfType([d.string, d.number]),
1002
- top: d.oneOfType([d.string, d.number]),
1003
- right: d.oneOfType([d.string, d.number]),
1004
- bottom: d.oneOfType([d.string, d.number]),
1005
- width: d.oneOfType([d.string, d.number]),
1006
- height: d.oneOfType([d.string, d.number]),
1007
- resizable: d.array
1001
+ Ve.propTypes = {
1002
+ ...vt,
1003
+ left: h.oneOfType([h.string, h.number]),
1004
+ top: h.oneOfType([h.string, h.number]),
1005
+ right: h.oneOfType([h.string, h.number]),
1006
+ bottom: h.oneOfType([h.string, h.number]),
1007
+ width: h.oneOfType([h.string, h.number]),
1008
+ height: h.oneOfType([h.string, h.number]),
1009
+ resizable: h.array
1008
1010
  };
1009
- const ni = (t) => {
1010
- const i = M.useContext(Ot);
1011
+ const wi = (t) => {
1012
+ const i = O.useContext(Bt);
1011
1013
  return i ? t.children(i) : t.children({ left: 0, top: 0, right: 0, bottom: 0, width: 0, height: 0, x: 0, y: 0, toJSON: () => "" });
1012
- }, Ee = ({ left: t, top: i, right: o, bottom: n, children: f, ...h }) => /* @__PURE__ */ c(K, { ...h, type: A.ViewPort, position: { left: t || 0, top: i || 0, right: o || 0, bottom: n || 0 }, children: f });
1013
- Ee.propTypes = {
1014
- ...yt,
1015
- left: d.oneOfType([d.string, d.number]),
1016
- top: d.oneOfType([d.string, d.number]),
1017
- right: d.oneOfType([d.string, d.number]),
1018
- bottom: d.oneOfType([d.string, d.number])
1014
+ }, qe = ({ left: t, top: i, right: o, bottom: n, children: u, ...d }) => /* @__PURE__ */ a(K, { ...d, type: A.ViewPort, position: { left: t || 0, top: i || 0, right: o || 0, bottom: n || 0 }, children: u });
1015
+ qe.propTypes = {
1016
+ ...vt,
1017
+ left: h.oneOfType([h.string, h.number]),
1018
+ top: h.oneOfType([h.string, h.number]),
1019
+ right: h.oneOfType([h.string, h.number]),
1020
+ bottom: h.oneOfType([h.string, h.number])
1019
1021
  };
1020
- const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i, children: t }), Pe = (t) => {
1022
+ const yi = ({ children: t, ...i }) => /* @__PURE__ */ a(Xt.Provider, { value: i, children: t }), Ue = (t) => {
1021
1023
  const {
1022
1024
  favicon: i,
1023
1025
  title: o,
1024
1026
  customTitle: n,
1025
- activeTab: f,
1026
- position: h,
1027
- contentWidth: s,
1028
- onClick: y,
1027
+ activeTab: u,
1028
+ position: d,
1029
+ contentWidth: r,
1030
+ onClick: b,
1029
1031
  onClose: e,
1030
- setDragging: a,
1031
- tabsContentWidth: b,
1032
- animateTabMove: r,
1033
- isDragging: g,
1034
- index: u,
1032
+ setDragging: l,
1033
+ tabsContentWidth: p,
1034
+ animateTabMove: s,
1035
+ isDragging: f,
1036
+ index: g,
1035
1037
  sorting: z,
1036
- showButtonClose: l,
1038
+ showButtonClose: c,
1037
1039
  onCloseAllTabs: m,
1038
1040
  onCloseLeftTabs: R,
1039
1041
  onCloseRightTabs: S,
1040
1042
  onCloseOtherTabs: w,
1041
1043
  totalTabs: I
1042
- } = t, { t: B } = Ht("archbase"), [P, x] = V(0), [T, _] = V(!1), [k, N] = V(null), [q, D] = V(null), [ot, L] = V(!1), [F, tt] = V(0), [nt, U] = V(!1), lt = it(null), $ = 9, E = 84, H = 60, W = 48;
1043
- et(() => (document.addEventListener("mousemove", j), document.addEventListener("mouseup", O), () => {
1044
- document.removeEventListener("mousemove", j), document.addEventListener("mouseup", O);
1044
+ } = t, { t: M } = Wt("archbase"), [N, x] = U(0), [T, P] = U(!1), [k, E] = U(null), [X, D] = U(null), [ot, L] = U(!1), [q, tt] = U(0), [nt, G] = U(!1), lt = it(null), $ = 9, _ = 84, H = 60, V = 48;
1045
+ et(() => (document.addEventListener("mousemove", j), document.addEventListener("mouseup", B), () => {
1046
+ document.removeEventListener("mousemove", j), document.addEventListener("mouseup", B);
1045
1047
  })), et(() => {
1046
- T || setTimeout(() => _(!0), 500);
1048
+ T || setTimeout(() => P(!0), 500);
1047
1049
  }, [T]), et(() => {
1048
- x(s + 2 * $);
1049
- }, [s]);
1050
- const X = (Y) => {
1051
- Y.button === 0 && (a(!0), D(Y.pageX), L(!1), tt(h));
1050
+ x(r + 2 * $);
1051
+ }, [r]);
1052
+ const J = (Y) => {
1053
+ Y.button === 0 && (l(!0), D(Y.pageX), L(!1), tt(d));
1052
1054
  }, j = (Y) => {
1053
- if (q != null && g) {
1054
- let ht = F - $ + (Y.pageX - q);
1055
- ht < 0 && (ht = 0), ht > b - P && (ht = b - P), N(ht), !z && r(ht);
1055
+ if (X != null && f) {
1056
+ let ht = q - $ + (Y.pageX - X);
1057
+ ht < 0 && (ht = 0), ht > p - N && (ht = p - N), E(ht), !z && s(ht);
1056
1058
  }
1057
- }, O = (Y) => {
1058
- q != null && g && (D(null), N(null), a(!1), L(!0));
1059
- }, [dt, ct] = V(h - $);
1059
+ }, B = (Y) => {
1060
+ X != null && f && (D(null), E(null), l(!1), L(!0));
1061
+ }, [dt, ct] = U(d - $);
1060
1062
  et(() => {
1061
- ct(h ? h - $ : 0);
1062
- }, [u, h]);
1063
+ ct(d ? d - $ : 0);
1064
+ }, [g, d]);
1063
1065
  const gt = () => {
1064
- w && w(t.id), U(!1);
1066
+ w && w(t.id), G(!1);
1065
1067
  }, xt = () => {
1066
- R && R(t.id), U(!1);
1068
+ R && R(t.id), G(!1);
1067
1069
  }, Lt = () => {
1068
- S && S(t.id), U(!1);
1069
- }, Xt = () => {
1070
- m && m(), U(!1);
1071
- }, Jt = (Y) => {
1072
- Y.preventDefault(), U(!0);
1073
- }, Mt = u > 0, It = I !== void 0 && u < I - 1, Dt = (I || 0) > 1;
1074
- return /* @__PURE__ */ G(
1070
+ S && S(t.id), G(!1);
1071
+ }, Yt = () => {
1072
+ m && m(), G(!1);
1073
+ }, Kt = (Y) => {
1074
+ Y.preventDefault(), G(!0);
1075
+ }, It = g > 0, Ot = I !== void 0 && g < I - 1, Dt = (I || 0) > 1;
1076
+ return /* @__PURE__ */ F(
1075
1077
  "div",
1076
1078
  {
1077
- className: `archbase_tab ${T ? "" : " archbase_tab-was-just-added"}${q == null && !f ? " archbase_tab-was-just-dragged" : ""}`,
1079
+ className: `archbase_tab ${T ? "" : " archbase_tab-was-just-added"}${X == null && !u ? " archbase_tab-was-just-dragged" : ""}`,
1078
1080
  style: {
1079
1081
  transform: `translate3d(${k ?? dt}px, 0, 0)`,
1080
- width: `${P}px`
1082
+ width: `${N}px`
1081
1083
  },
1082
- "tab-active": f !== !1 ? "" : null,
1083
- "is-small": s < E ? "" : null,
1084
- "is-smaller": s < H ? "" : null,
1085
- "is-mini": s < W ? "" : null,
1084
+ "tab-active": u !== !1 ? "" : null,
1085
+ "is-small": r < _ ? "" : null,
1086
+ "is-smaller": r < H ? "" : null,
1087
+ "is-mini": r < V ? "" : null,
1086
1088
  ref: lt,
1087
- onContextMenu: Jt,
1089
+ onContextMenu: Kt,
1088
1090
  children: [
1089
- /* @__PURE__ */ c("div", { className: "archbase_tab-dividers" }),
1090
- /* @__PURE__ */ c("div", { className: "archbase_tab-background", children: /* @__PURE__ */ G("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: [
1091
- /* @__PURE__ */ G("defs", { children: [
1092
- /* @__PURE__ */ c("symbol", { id: "archbase_tab-geometry-left", viewBox: "0 0 214 36", children: /* @__PURE__ */ c("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }) }),
1093
- /* @__PURE__ */ c("symbol", { id: "archbase_tab-geometry-right", viewBox: "0 0 214 36", children: /* @__PURE__ */ c("use", { xlinkHref: "#archbase_tab-geometry-left" }) }),
1094
- /* @__PURE__ */ c("clipPath", { id: "crop", children: /* @__PURE__ */ c("rect", { className: "mask", width: "100%", height: "100%", x: "0" }) })
1091
+ /* @__PURE__ */ a("div", { className: "archbase_tab-dividers" }),
1092
+ /* @__PURE__ */ a("div", { className: "archbase_tab-background", children: /* @__PURE__ */ F("svg", { version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: [
1093
+ /* @__PURE__ */ F("defs", { children: [
1094
+ /* @__PURE__ */ a("symbol", { id: "archbase_tab-geometry-left", viewBox: "0 0 214 36", children: /* @__PURE__ */ a("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }) }),
1095
+ /* @__PURE__ */ a("symbol", { id: "archbase_tab-geometry-right", viewBox: "0 0 214 36", children: /* @__PURE__ */ a("use", { xlinkHref: "#archbase_tab-geometry-left" }) }),
1096
+ /* @__PURE__ */ a("clipPath", { id: "crop", children: /* @__PURE__ */ a("rect", { className: "mask", width: "100%", height: "100%", x: "0" }) })
1095
1097
  ] }),
1096
- /* @__PURE__ */ c("svg", { width: "52%", height: "100%", children: /* @__PURE__ */ c("use", { xlinkHref: "#archbase_tab-geometry-left", width: "214", height: "36", className: "archbase_tab-geometry" }) }),
1097
- /* @__PURE__ */ c("g", { transform: "scale(-1, 1)", children: /* @__PURE__ */ c("svg", { width: "52%", height: "100%", x: "-100%", y: "0", children: /* @__PURE__ */ c("use", { xlinkHref: "#archbase_tab-geometry-right", width: "214", height: "36", className: "archbase_tab-geometry" }) }) })
1098
+ /* @__PURE__ */ a("svg", { width: "52%", height: "100%", children: /* @__PURE__ */ a("use", { xlinkHref: "#archbase_tab-geometry-left", width: "214", height: "36", className: "archbase_tab-geometry" }) }),
1099
+ /* @__PURE__ */ a("g", { transform: "scale(-1, 1)", children: /* @__PURE__ */ a("svg", { width: "52%", height: "100%", x: "-100%", y: "0", children: /* @__PURE__ */ a("use", { xlinkHref: "#archbase_tab-geometry-right", width: "214", height: "36", className: "archbase_tab-geometry" }) }) })
1098
1100
  ] }) }),
1099
- /* @__PURE__ */ G("div", { className: "archbase_tab-content", children: [
1100
- !!i && /* @__PURE__ */ c("div", { className: "archbase_tab-favicon", style: { backgroundImage: `url(${i})` } }),
1101
- /* @__PURE__ */ c("div", { className: "archbase_tab-title", children: n ?? o }),
1102
- /* @__PURE__ */ c("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick: y, onPointerDown: (Y) => y(Y), onMouseUp: O, onMouseMove: j, onMouseDown: X }),
1103
- (m || R || S || w) && /* @__PURE__ */ G(at, { shadow: "md", width: 200, opened: nt, onChange: U, position: "bottom-end", children: [
1104
- /* @__PURE__ */ c(at.Target, { children: /* @__PURE__ */ c("div", { className: "archbase_tab-dropdown", onClick: (Y) => {
1105
- Y.stopPropagation(), U(!nt);
1101
+ /* @__PURE__ */ F("div", { className: "archbase_tab-content", children: [
1102
+ !!i && /* @__PURE__ */ a("div", { className: "archbase_tab-favicon", style: { backgroundImage: `url(${i})` } }),
1103
+ /* @__PURE__ */ a("div", { className: "archbase_tab-title", children: n ?? o }),
1104
+ /* @__PURE__ */ a("div", { className: "archbase_tab-drag-handle", title: n ?? o, onClick: b, onPointerDown: (Y) => b(Y), onMouseUp: B, onMouseMove: j, onMouseDown: J }),
1105
+ (m || R || S || w) && /* @__PURE__ */ F(at, { shadow: "md", width: 200, opened: nt, onChange: G, position: "bottom-end", children: [
1106
+ /* @__PURE__ */ a(at.Target, { children: /* @__PURE__ */ a("div", { className: "archbase_tab-dropdown", onClick: (Y) => {
1107
+ Y.stopPropagation(), G(!nt);
1106
1108
  } }) }),
1107
- /* @__PURE__ */ G(at.Dropdown, { children: [
1108
- Dt && /* @__PURE__ */ c(at.Item, { onClick: gt, children: String(B("tabs.closeOthers")) }),
1109
- Mt && /* @__PURE__ */ c(at.Item, { onClick: xt, children: String(B("tabs.closeLeft")) }),
1110
- It && /* @__PURE__ */ c(at.Item, { onClick: Lt, children: String(B("tabs.closeRight")) }),
1111
- (Dt || Mt || It) && /* @__PURE__ */ c(at.Divider, {}),
1112
- /* @__PURE__ */ c(at.Item, { onClick: Xt, children: String(B("tabs.closeAll")) })
1109
+ /* @__PURE__ */ F(at.Dropdown, { children: [
1110
+ Dt && /* @__PURE__ */ a(at.Item, { onClick: gt, children: String(M("tabs.closeOthers")) }),
1111
+ It && /* @__PURE__ */ a(at.Item, { onClick: xt, children: String(M("tabs.closeLeft")) }),
1112
+ Ot && /* @__PURE__ */ a(at.Item, { onClick: Lt, children: String(M("tabs.closeRight")) }),
1113
+ (Dt || It || Ot) && /* @__PURE__ */ a(at.Divider, {}),
1114
+ /* @__PURE__ */ a(at.Item, { onClick: Yt, children: String(M("tabs.closeAll")) })
1113
1115
  ] })
1114
1116
  ] }),
1115
- l ? /* @__PURE__ */ c("div", { className: "archbase_tab-close", onClick: (Y) => {
1117
+ c ? /* @__PURE__ */ a("div", { className: "archbase_tab-close", onClick: (Y) => {
1116
1118
  e(Y);
1117
1119
  } }) : null
1118
1120
  ] })
1119
1121
  ]
1120
1122
  }
1121
1123
  );
1122
- }, si = (t) => {
1123
- const { currentTabs: i, onTabChange: o, activeTab: n, onTabClose: f, className: h, style: s, dark: y, onClick: e, buttonCloseOnlyActiveTab: a = !1, onCloseAllTabs: b, onCloseLeftTabs: r, onCloseRightTabs: g, onCloseOtherTabs: u } = t, [z, l] = V([]), [m, R] = V([]), [S, w] = V(i || []), [I, B] = V(!1), [P, x] = V(!1), T = it(null), { width: _, height: k } = Kt(), N = 9, q = 1, D = 24, ot = 240;
1124
+ }, Ri = (t) => {
1125
+ const { currentTabs: i, onTabChange: o, activeTab: n, onTabClose: u, className: d, style: r, dark: b, onClick: e, buttonCloseOnlyActiveTab: l = !1, onCloseAllTabs: p, onCloseLeftTabs: s, onCloseRightTabs: f, onCloseOtherTabs: g } = t, [z, c] = U([]), [m, R] = U([]), [S, w] = U(i || []), [I, M] = U(!1), [N, x] = U(!1), T = it(null), { width: P, height: k } = re(), E = 9, X = 1, D = 24, ot = 240;
1124
1126
  et(() => {
1125
- l(F()), R(tt(F()));
1127
+ c(q()), R(tt(q()));
1126
1128
  }, []), et(() => {
1127
1129
  L();
1128
- }, [JSON.stringify(S), _, k]), et(() => {
1130
+ }, [JSON.stringify(S), P, k]), et(() => {
1129
1131
  i && w(i);
1130
1132
  }, [JSON.stringify(i)]);
1131
1133
  const L = () => {
1132
- const $ = F();
1133
- $ && (l($), R(tt($)));
1134
- }, F = () => {
1134
+ const $ = q();
1135
+ $ && (c($), R(tt($)));
1136
+ }, q = () => {
1135
1137
  const $ = [];
1136
1138
  if (T.current) {
1137
- const E = S.length, H = T.current.clientWidth, W = (E - 1) * q, X = (H - 2 * N + W) / E, j = Math.max(D, Math.min(ot, X)), O = Math.floor(j), dt = O * E + 2 * N - W;
1139
+ const _ = S.length, H = T.current.clientWidth, V = (_ - 1) * X, J = (H - 2 * E + V) / _, j = Math.max(D, Math.min(ot, J)), B = Math.floor(j), dt = B * _ + 2 * E - V;
1138
1140
  let gt = H - dt;
1139
- for (let xt = 0; xt < E; xt += 1) {
1140
- const Lt = O < ot && gt > 0 ? 1 : 0;
1141
- $.push(O + Lt), gt > 0 && (gt -= 1);
1141
+ for (let xt = 0; xt < _; xt += 1) {
1142
+ const Lt = B < ot && gt > 0 ? 1 : 0;
1143
+ $.push(B + Lt), gt > 0 && (gt -= 1);
1142
1144
  }
1143
1145
  }
1144
1146
  return $;
1145
1147
  }, tt = ($) => {
1146
- const E = [], H = $ || z;
1147
- let W = N;
1148
- return H.forEach((X, j) => {
1149
- const O = j * q;
1150
- E.push(W - O), W += X;
1151
- }), E;
1152
- }, nt = ($, E) => {
1153
- B(!0);
1154
- let H = 1 / 0, W = -1, X = [];
1155
- m.forEach((j, O) => {
1156
- Math.abs($ - j) < H && (H = Math.abs($ - j), W = O);
1157
- }), W = Math.max(0, Math.min(m.length, W)), E != W && (m.forEach((j, O) => {
1158
- O == E ? X[O] = S[W > E ? O + 1 : O - 1] : E > O && O >= W ? X[O] = S[O + 1] : E < O && O <= W ? X[O] = S[O - 1] : X[O] = S[O];
1159
- }), U(X) && o(X)), B(!1);
1160
- }, U = ($) => new Set($).size === $.length, lt = ($) => {
1161
- f ? f($) : o(S.filter((E, H) => H != $));
1148
+ const _ = [], H = $ || z;
1149
+ let V = E;
1150
+ return H.forEach((J, j) => {
1151
+ const B = j * X;
1152
+ _.push(V - B), V += J;
1153
+ }), _;
1154
+ }, nt = ($, _) => {
1155
+ M(!0);
1156
+ let H = 1 / 0, V = -1, J = [];
1157
+ m.forEach((j, B) => {
1158
+ Math.abs($ - j) < H && (H = Math.abs($ - j), V = B);
1159
+ }), V = Math.max(0, Math.min(m.length, V)), _ != V && (m.forEach((j, B) => {
1160
+ B == _ ? J[B] = S[V > _ ? B + 1 : B - 1] : _ > B && B >= V ? J[B] = S[B + 1] : _ < B && B <= V ? J[B] = S[B - 1] : J[B] = S[B];
1161
+ }), G(J) && o(J)), M(!1);
1162
+ }, G = ($) => new Set($).size === $.length, lt = ($) => {
1163
+ u ? u($) : o(S.filter((_, H) => H != $));
1162
1164
  };
1163
- return /* @__PURE__ */ c("div", { className: h, style: s, children: /* @__PURE__ */ G(
1165
+ return /* @__PURE__ */ a("div", { className: d, style: r, children: /* @__PURE__ */ F(
1164
1166
  "div",
1165
1167
  {
1166
- className: `archbase_tabs${y ? " archbase_tabs-dark-theme" : ""}${P ? "" : " archbase_tabs-is-sorting"}`,
1168
+ className: `archbase_tabs${b ? " archbase_tabs-dark-theme" : ""}${N ? "" : " archbase_tabs-is-sorting"}`,
1167
1169
  children: [
1168
- /* @__PURE__ */ c("div", { className: "archbase_tabs_content", ref: T, children: !!S && S.map(($, E) => !!m[E] && /* @__PURE__ */ c(
1169
- Pe,
1170
+ /* @__PURE__ */ a("div", { className: "archbase_tabs_content", ref: T, children: !!S && S.map(($, _) => !!m[_] && /* @__PURE__ */ a(
1171
+ Ue,
1170
1172
  {
1171
1173
  favicon: $.favicon,
1172
1174
  title: $.title,
1173
1175
  customTitle: $.customTitle,
1174
1176
  activeTab: n === $.key,
1175
- position: m[E],
1176
- contentWidth: z[E],
1177
+ position: m[_],
1178
+ contentWidth: z[_],
1177
1179
  onClick: (H) => e($.key),
1178
1180
  onClose: (H) => lt($.key),
1179
1181
  setDragging: x,
1180
- showButtonClose: a ? n === $.key : !0,
1182
+ showButtonClose: l ? n === $.key : !0,
1181
1183
  tabsContentWidth: T.current && T.current.clientWidth,
1182
- animateTabMove: (H) => nt(H, E),
1183
- isDragging: P,
1184
+ animateTabMove: (H) => nt(H, _),
1185
+ isDragging: N,
1184
1186
  id: $.key,
1185
- index: E,
1187
+ index: _,
1186
1188
  sorting: I,
1187
- onCloseAllTabs: b,
1188
- onCloseLeftTabs: r,
1189
- onCloseRightTabs: g,
1190
- onCloseOtherTabs: u,
1189
+ onCloseAllTabs: p,
1190
+ onCloseLeftTabs: s,
1191
+ onCloseRightTabs: f,
1192
+ onCloseOtherTabs: g,
1191
1193
  totalTabs: S.length
1192
1194
  },
1193
1195
  $.key
1194
1196
  )) }),
1195
- /* @__PURE__ */ c("div", { className: "archbase_tabs-bottom-bar" })
1197
+ /* @__PURE__ */ a("div", { className: "archbase_tabs-bottom-bar" })
1196
1198
  ]
1197
1199
  }
1198
1200
  ) });
@@ -1202,7 +1204,7 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1202
1204
  const n = parseInt(o.style.zIndex);
1203
1205
  t = Math.max(isNaN(n) ? 0 : n, t);
1204
1206
  }), t + 1;
1205
- }, li = (t) => {
1207
+ }, vi = (t) => {
1206
1208
  const i = Object.assign(
1207
1209
  {
1208
1210
  id: t.id && t.id.length ? t.id : Date.now().toString(),
@@ -1232,55 +1234,55 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1232
1234
  t
1233
1235
  );
1234
1236
  i.id || (i.id = Date.now().toString()), Object.freeze(i);
1235
- const [o, n] = J.useState(i.height), [f, h] = J.useState(i.width), [s, y] = J.useState(i.top || 0), [e, a] = J.useState(i.left || 0), [b, r] = J.useState(0), [g, u] = J.useState(0), [z, l] = J.useState(!1), [m, R] = J.useState(!1), [S, w] = J.useState("▁"), [I, B] = J.useState("□"), [P, x] = J.useState(""), [T, _] = J.useState(pt()), [k, N] = J.useState(1), { ref: q, width: D, height: ot } = Qt(), L = J.useRef(null), F = it(o), tt = it(f), nt = it(s), U = it(e), lt = 500, $ = (j) => {
1236
- u(j.clientY - s), r(j.clientX - e), _(pt()), N(0.5);
1237
- }, E = (j) => {
1238
- a((j.clientX || j.screenX || e + b) - b), y((j.clientY || j.screenY || s + g) - g);
1237
+ const [o, n] = W.useState(i.height), [u, d] = W.useState(i.width), [r, b] = W.useState(i.top || 0), [e, l] = W.useState(i.left || 0), [p, s] = W.useState(0), [f, g] = W.useState(0), [z, c] = W.useState(!1), [m, R] = W.useState(!1), [S, w] = W.useState("▁"), [I, M] = W.useState("□"), [N, x] = W.useState(""), [T, P] = W.useState(pt()), [k, E] = W.useState(1), { ref: X, width: D, height: ot } = se(), L = W.useRef(null), q = it(o), tt = it(u), nt = it(r), G = it(e), lt = 500, $ = (j) => {
1238
+ g(j.clientY - r), s(j.clientX - e), P(pt()), E(0.5);
1239
+ }, _ = (j) => {
1240
+ l((j.clientX || j.screenX || e + p) - p), b((j.clientY || j.screenY || r + f) - f);
1239
1241
  }, H = (j) => {
1240
- a((j.clientX || j.screenX) - b), y((j.clientY || j.screenY) - g), N(1);
1241
- }, W = () => {
1242
+ l((j.clientX || j.screenX) - p), b((j.clientY || j.screenY) - f), E(1);
1243
+ }, V = () => {
1242
1244
  if (x(`${lt}ms ease-in-out`), z)
1243
- F.current = o, y(nt.current || 0), a(U.current || 0), l(!1), w("▁"), R(!1);
1245
+ q.current = o, b(nt.current || 0), l(G.current || 0), c(!1), w("▁"), R(!1);
1244
1246
  else {
1245
- F.current = 32, m || (U.current = e, nt.current = s);
1247
+ q.current = 32, m || (G.current = e, nt.current = r);
1246
1248
  const j = document.getElementById(i.id)?.parentElement;
1247
- tt.current = f;
1248
- let O = (j?.clientHeight || window.innerHeight) - F.current - 4;
1249
+ tt.current = u;
1250
+ let B = (j?.clientHeight || window.innerHeight) - q.current - 4;
1249
1251
  const dt = (j?.clientWidth || window.innerWidth) - tt.current - 4, ct = document.elementFromPoint(
1250
1252
  dt + tt.current / 2,
1251
- O + F.current / 2
1253
+ B + q.current / 2
1252
1254
  );
1253
- ct && ["archbase-window-container", "windowTitle"].includes(ct?.className || "") && (O -= ct?.clientHeight + 4), y(O), a(dt), l(!0), w("◰"), R(!1);
1255
+ ct && ["archbase-window-container", "windowTitle"].includes(ct?.className || "") && (B -= ct?.clientHeight + 4), b(B), l(dt), c(!0), w("◰"), R(!1);
1254
1256
  }
1255
- _(pt()), setTimeout(x, lt + 1, "");
1256
- }, X = () => {
1257
+ P(pt()), setTimeout(x, lt + 1, "");
1258
+ }, J = () => {
1257
1259
  x(`${lt}ms ease-in-out`);
1258
1260
  const j = document.getElementById(i.id)?.parentElement;
1259
- m ? (F.current = o, tt.current = f, y(nt.current || 0), a(U.current || 0), R(!1), B("□"), l(!1), w("▁")) : (F.current = j?.clientHeight || window.innerHeight, tt.current = j?.clientWidth || window.innerWidth, z || (U.current = e, nt.current = s), y(j?.offsetTop || 0), a(j?.offsetLeft || 0), R(!0), B("❐"), l(!1), w("▁")), _(pt()), setTimeout(x, lt + 1, "");
1261
+ m ? (q.current = o, tt.current = u, b(nt.current || 0), l(G.current || 0), R(!1), M("□"), c(!1), w("▁")) : (q.current = j?.clientHeight || window.innerHeight, tt.current = j?.clientWidth || window.innerWidth, z || (G.current = e, nt.current = r), b(j?.offsetTop || 0), l(j?.offsetLeft || 0), R(!0), M("❐"), c(!1), w("▁")), P(pt()), setTimeout(x, lt + 1, "");
1260
1262
  };
1261
1263
  return et(() => {
1262
- !m && !z && (h(D), n(ot));
1263
- }, [D, ot, m, z]), /* @__PURE__ */ G(
1264
+ !m && !z && (d(D), n(ot));
1265
+ }, [D, ot, m, z]), /* @__PURE__ */ F(
1264
1266
  "div",
1265
1267
  {
1266
1268
  id: i.id,
1267
1269
  className: "archbase-window-container",
1268
1270
  style: {
1269
- height: F.current,
1271
+ height: q.current,
1270
1272
  width: tt.current,
1271
- top: s,
1273
+ top: r,
1272
1274
  left: e,
1273
1275
  resize: i.resizable ? "both" : "none",
1274
- transition: P,
1276
+ transition: N,
1275
1277
  zIndex: T,
1276
1278
  opacity: k
1277
1279
  },
1278
- ref: q,
1280
+ ref: X,
1279
1281
  onClick: () => {
1280
- _(pt());
1282
+ P(pt());
1281
1283
  },
1282
1284
  children: [
1283
- i.titleBar && /* @__PURE__ */ G(
1285
+ i.titleBar && /* @__PURE__ */ F(
1284
1286
  "div",
1285
1287
  {
1286
1288
  className: "title-bar",
@@ -1289,29 +1291,29 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1289
1291
  opacity: k
1290
1292
  },
1291
1293
  children: [
1292
- i.titleBar.icon && /* @__PURE__ */ c("span", { className: "icon", children: i.titleBar.icon }),
1293
- /* @__PURE__ */ c(
1294
+ i.titleBar.icon && /* @__PURE__ */ a("span", { className: "icon", children: i.titleBar.icon }),
1295
+ /* @__PURE__ */ a(
1294
1296
  "span",
1295
1297
  {
1296
1298
  className: "windowTitle",
1297
1299
  draggable: !0,
1298
1300
  onDragStart: $,
1299
- onDrag: E,
1301
+ onDrag: _,
1300
1302
  onDragEnd: H,
1301
1303
  style: { opacity: Math.floor(k) },
1302
1304
  ref: L,
1303
1305
  children: i.titleBar.title
1304
1306
  }
1305
1307
  ),
1306
- i.titleBar.buttons && /* @__PURE__ */ G("span", { className: "buttonContainer", children: [
1307
- i.titleBar.buttons.minimize && /* @__PURE__ */ c("span", { className: "windowButton", onClick: W, children: S }),
1308
- i.titleBar.buttons.maximize && /* @__PURE__ */ c("span", { className: "windowButton", onClick: X, children: I }),
1309
- !!i.titleBar.buttons.close && /* @__PURE__ */ c("span", { className: "windowButton", onClick: i.titleBar.buttons.close, children: "⨯" })
1308
+ i.titleBar.buttons && /* @__PURE__ */ F("span", { className: "buttonContainer", children: [
1309
+ i.titleBar.buttons.minimize && /* @__PURE__ */ a("span", { className: "windowButton", onClick: V, children: S }),
1310
+ i.titleBar.buttons.maximize && /* @__PURE__ */ a("span", { className: "windowButton", onClick: J, children: I }),
1311
+ !!i.titleBar.buttons.close && /* @__PURE__ */ a("span", { className: "windowButton", onClick: i.titleBar.buttons.close, children: "⨯" })
1310
1312
  ] })
1311
1313
  ]
1312
1314
  }
1313
1315
  ),
1314
- /* @__PURE__ */ c(
1316
+ /* @__PURE__ */ a(
1315
1317
  "div",
1316
1318
  {
1317
1319
  className: "content",
@@ -1328,91 +1330,128 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1328
1330
  ]
1329
1331
  }
1330
1332
  );
1331
- }, ai = ({
1333
+ }, Si = ({
1332
1334
  children: t,
1333
1335
  direction: i = "row",
1334
- splitterSize: o = 4,
1336
+ splitterSize: o,
1335
1337
  splitterColor: n,
1336
- splitterHoverColor: f,
1337
- splitterRadius: h,
1338
- withKnob: s = !1,
1339
- opacity: y,
1340
- style: e,
1341
- className: a
1342
- }) => /* @__PURE__ */ c(
1343
- Bt,
1344
- {
1345
- orientation: i === "row" ? "horizontal" : "vertical",
1346
- size: o,
1347
- color: n,
1348
- hoverColor: f,
1349
- radius: h,
1350
- withKnob: s,
1351
- opacity: y,
1352
- style: e,
1353
- className: a,
1354
- children: t
1355
- }
1356
- ), di = ({
1338
+ splitterHoverColor: u,
1339
+ style: d,
1340
+ className: r,
1341
+ autoSaveId: b
1342
+ }) => {
1343
+ const e = i === "row" ? "horizontal" : "vertical";
1344
+ return /* @__PURE__ */ a(
1345
+ Ft,
1346
+ {
1347
+ direction: e,
1348
+ autoSaveId: b,
1349
+ style: { height: "100%", ...d },
1350
+ className: r,
1351
+ children: W.Children.map(t, (l) => W.isValidElement(l) && l.type === Xe ? W.cloneElement(l, {
1352
+ _splitterSize: o,
1353
+ _splitterColor: n,
1354
+ _splitterHoverColor: u,
1355
+ _direction: e
1356
+ }) : l)
1357
+ }
1358
+ );
1359
+ }, Ti = ({
1357
1360
  children: t,
1358
1361
  minSize: i,
1359
1362
  maxSize: o,
1360
1363
  defaultSize: n,
1361
- style: f,
1362
- className: h
1363
- }) => /* @__PURE__ */ c(
1364
- Bt.Pane,
1365
- {
1366
- initialWidth: n,
1367
- initialHeight: n,
1368
- minWidth: i,
1369
- minHeight: i,
1370
- maxWidth: o,
1371
- maxHeight: o,
1372
- style: f,
1373
- className: h,
1374
- children: t
1375
- }
1376
- ), ci = ({
1364
+ collapsible: u = !1,
1365
+ style: d,
1366
+ className: r
1367
+ }) => {
1368
+ const b = (e) => {
1369
+ if (e !== void 0)
1370
+ return typeof e == "string" ? parseFloat(e) : e;
1371
+ };
1372
+ return /* @__PURE__ */ a(
1373
+ Mt,
1374
+ {
1375
+ defaultSize: b(n),
1376
+ minSize: b(i),
1377
+ maxSize: b(o),
1378
+ collapsible: u,
1379
+ style: d,
1380
+ className: r,
1381
+ children: t
1382
+ }
1383
+ );
1384
+ }, Xe = ({
1377
1385
  style: t,
1378
- className: i
1379
- }) => /* @__PURE__ */ c(Bt.Resizer, { style: t, className: i }), hi = ({
1386
+ className: i,
1387
+ ...o
1388
+ }) => {
1389
+ const n = Qt(), d = te() === "dark", r = o._splitterSize ?? 4, b = o._splitterColor ?? (d ? n.colors.dark[4] : n.colors.gray[3]);
1390
+ o._splitterHoverColor ?? n.colors.blue[5];
1391
+ const l = (o._direction ?? "horizontal") === "horizontal";
1392
+ return /* @__PURE__ */ a(
1393
+ Vt,
1394
+ {
1395
+ className: i,
1396
+ style: {
1397
+ display: "flex",
1398
+ alignItems: "center",
1399
+ justifyContent: "center",
1400
+ backgroundColor: b,
1401
+ transition: "background-color 150ms ease",
1402
+ ...l ? { width: Number(r), cursor: "col-resize" } : { height: Number(r), cursor: "row-resize" },
1403
+ ...t
1404
+ },
1405
+ onDragging: () => {
1406
+ },
1407
+ children: /* @__PURE__ */ a(
1408
+ ee,
1409
+ {
1410
+ style: {
1411
+ ...l ? { width: 2, height: 20, borderRadius: 1 } : { width: 20, height: 2, borderRadius: 1 },
1412
+ backgroundColor: d ? n.colors.dark[2] : n.colors.gray[5]
1413
+ }
1414
+ }
1415
+ )
1416
+ }
1417
+ );
1418
+ }, xi = ({
1380
1419
  children: t,
1381
1420
  title: i,
1382
1421
  reducedTitle: o,
1383
1422
  containerWidth: n = "300px",
1384
- backgroundColor: f = "transparent",
1385
- hiddenBackgroundColor: h = "#ccc",
1386
- withBorder: s = !1,
1387
- hiddenWidth: y = "30px",
1423
+ backgroundColor: u = "transparent",
1424
+ hiddenBackgroundColor: d = "#ccc",
1425
+ withBorder: r = !1,
1426
+ hiddenWidth: b = "30px",
1388
1427
  position: e = "right",
1389
- onShow: a,
1390
- onHide: b,
1391
- defaultIsDocked: r = !1,
1392
- defaultIsVisible: g = !1
1428
+ onShow: l,
1429
+ onHide: p,
1430
+ defaultIsDocked: s = !1,
1431
+ defaultIsVisible: f = !1
1393
1432
  }) => {
1394
- const [u, z] = V(r), [l, m] = V(g), R = () => z(!u), S = () => {
1395
- !u && !l && (m(!0), a && a());
1433
+ const [g, z] = U(s), [c, m] = U(f), R = () => z(!g), S = () => {
1434
+ !g && !c && (m(!0), l && l());
1396
1435
  }, w = () => {
1397
- !u && l && (m(!1), b && b());
1436
+ !g && c && (m(!1), p && p());
1398
1437
  };
1399
1438
  et(() => {
1400
- g ? S() : w();
1401
- }, [g]);
1439
+ f ? S() : w();
1440
+ }, [f]);
1402
1441
  const I = {
1403
1442
  writingMode: "vertical-rl",
1404
1443
  transform: "rotate(360deg)",
1405
1444
  margin: "10px 0",
1406
1445
  alignSelf: "flex-center",
1407
1446
  cursor: "pointer"
1408
- }, B = {
1447
+ }, M = {
1409
1448
  writingMode: "vertical-rl",
1410
1449
  transform: "rotate(180deg)",
1411
1450
  margin: "10px 0",
1412
1451
  alignSelf: "flex-center",
1413
1452
  cursor: "pointer"
1414
- }, P = s ? "1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4))" : "none";
1415
- return /* @__PURE__ */ G(
1453
+ }, N = r ? "1px solid light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-4))" : "none";
1454
+ return /* @__PURE__ */ F(
1416
1455
  "div",
1417
1456
  {
1418
1457
  style: {
@@ -1424,40 +1463,40 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1424
1463
  flexDirection: e === "left" ? "row-reverse" : "row"
1425
1464
  },
1426
1465
  children: [
1427
- /* @__PURE__ */ c(
1466
+ /* @__PURE__ */ a(
1428
1467
  "div",
1429
1468
  {
1430
1469
  onMouseOver: S,
1431
1470
  style: {
1432
- width: l || u ? "0px" : y,
1471
+ width: c || g ? "0px" : b,
1433
1472
  height: "100%",
1434
- backgroundColor: h,
1473
+ backgroundColor: d,
1435
1474
  cursor: "pointer",
1436
- border: P,
1475
+ border: N,
1437
1476
  display: "flex",
1438
1477
  flexDirection: "column",
1439
1478
  justifyContent: "flex-start",
1440
1479
  alignItems: "center"
1441
1480
  },
1442
- children: !l && !u && // @ts-ignore
1443
- /* @__PURE__ */ c("span", { style: e === "right" ? I : B, children: o })
1481
+ children: !c && !g && // @ts-ignore
1482
+ /* @__PURE__ */ a("span", { style: e === "right" ? I : M, children: o })
1444
1483
  }
1445
1484
  ),
1446
- /* @__PURE__ */ c(
1485
+ /* @__PURE__ */ a(
1447
1486
  "div",
1448
1487
  {
1449
1488
  onMouseLeave: w,
1450
1489
  style: {
1451
- width: l || u ? n : "0px",
1490
+ width: c || g ? n : "0px",
1452
1491
  height: "100%",
1453
1492
  overflow: "hidden",
1454
1493
  transition: "width 0.3s ease-in-out",
1455
- backgroundColor: f,
1456
- padding: l || u ? "10px" : "0px",
1457
- border: l || u ? P : 0
1494
+ backgroundColor: u,
1495
+ padding: c || g ? "10px" : "0px",
1496
+ border: c || g ? N : 0
1458
1497
  },
1459
- children: l || u ? /* @__PURE__ */ G(Nt, { children: [
1460
- /* @__PURE__ */ G(
1498
+ children: c || g ? /* @__PURE__ */ F(Et, { children: [
1499
+ /* @__PURE__ */ F(
1461
1500
  "div",
1462
1501
  {
1463
1502
  style: {
@@ -1467,8 +1506,8 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1467
1506
  marginBottom: "10px"
1468
1507
  },
1469
1508
  children: [
1470
- /* @__PURE__ */ c("span", { children: i }),
1471
- /* @__PURE__ */ c(Zt, { onClick: R, children: u ? /* @__PURE__ */ c(te, { size: 16 }) : /* @__PURE__ */ c(ee, { size: 16 }) })
1509
+ /* @__PURE__ */ a("span", { children: i }),
1510
+ /* @__PURE__ */ a(ie, { onClick: R, children: g ? /* @__PURE__ */ a(le, { size: 16 }) : /* @__PURE__ */ a(ae, { size: 16 }) })
1472
1511
  ]
1473
1512
  }
1474
1513
  ),
@@ -1479,35 +1518,230 @@ const ri = ({ children: t, ...i }) => /* @__PURE__ */ c(Vt.Provider, { value: i,
1479
1518
  ]
1480
1519
  }
1481
1520
  );
1521
+ }, Ge = ({
1522
+ panels: t,
1523
+ initialLayout: i,
1524
+ onChange: o,
1525
+ onPanelClose: n,
1526
+ zeroStateView: u,
1527
+ resize: d = { minimumPaneSizePercentage: 10 },
1528
+ style: r,
1529
+ className: b,
1530
+ height: e,
1531
+ width: l
1532
+ }) => {
1533
+ const { colorScheme: p } = oe(), s = p === "dark", f = kt(
1534
+ (z, c) => {
1535
+ const m = t[z];
1536
+ if (!m)
1537
+ return /* @__PURE__ */ F("div", { children: [
1538
+ "Panel not found: ",
1539
+ z
1540
+ ] });
1541
+ const R = m.closable !== !1, S = /* @__PURE__ */ F("span", { style: { display: "flex", alignItems: "center", gap: 6 }, children: [
1542
+ m.icon && /* @__PURE__ */ a("span", { style: { display: "inline-flex" }, children: m.icon }),
1543
+ /* @__PURE__ */ a("span", { children: m.title })
1544
+ ] }), w = [];
1545
+ m.toolbarControls && w.push(...m.toolbarControls), R && w.push(
1546
+ /* @__PURE__ */ a(
1547
+ "button",
1548
+ {
1549
+ onClick: () => n?.(z),
1550
+ title: "Close",
1551
+ style: {
1552
+ background: "none",
1553
+ border: "none",
1554
+ cursor: "pointer",
1555
+ fontSize: 16,
1556
+ lineHeight: 1,
1557
+ padding: "0 4px",
1558
+ color: "inherit"
1559
+ },
1560
+ children: "×"
1561
+ },
1562
+ "close"
1563
+ )
1564
+ );
1565
+ const I = typeof m.component == "function" ? m.component() : m.component;
1566
+ return /* @__PURE__ */ a(
1567
+ de,
1568
+ {
1569
+ path: c,
1570
+ title: S,
1571
+ toolbarControls: w.length > 0 ? w : void 0,
1572
+ children: I
1573
+ }
1574
+ );
1575
+ },
1576
+ [t, n]
1577
+ ), g = {
1578
+ position: "relative",
1579
+ height: e ?? "100%",
1580
+ width: l ?? "100%",
1581
+ ...r
1582
+ };
1583
+ return /* @__PURE__ */ a("div", { style: g, className: b, children: /* @__PURE__ */ a(
1584
+ ce,
1585
+ {
1586
+ renderTile: f,
1587
+ value: i,
1588
+ onChange: (z) => o?.(z ?? null),
1589
+ zeroStateView: u || void 0,
1590
+ resize: d,
1591
+ className: s ? "mosaic-blueprint-theme bp4-dark" : "mosaic-blueprint-theme"
1592
+ }
1593
+ ) });
1594
+ };
1595
+ Ge.displayName = "ArchbaseMosaicLayout";
1596
+ const Je = ({
1597
+ children: t,
1598
+ id: i,
1599
+ defaultSize: o,
1600
+ minSize: n = 10,
1601
+ maxSize: u,
1602
+ collapsible: d = !1,
1603
+ collapsedSize: r = 0,
1604
+ order: b,
1605
+ style: e,
1606
+ className: l
1607
+ }) => /* @__PURE__ */ a(
1608
+ Mt,
1609
+ {
1610
+ id: i,
1611
+ defaultSize: o,
1612
+ minSize: n,
1613
+ maxSize: u,
1614
+ collapsible: d,
1615
+ collapsedSize: r,
1616
+ order: b,
1617
+ style: e,
1618
+ className: l,
1619
+ children: t
1620
+ }
1621
+ );
1622
+ Je.displayName = "ArchbaseResizablePanel";
1623
+ const Zt = ({
1624
+ direction: t = "horizontal",
1625
+ size: i = 4,
1626
+ className: o,
1627
+ showGrip: n = !0
1628
+ }) => {
1629
+ const u = t === "vertical", d = {
1630
+ display: "flex",
1631
+ alignItems: "center",
1632
+ justifyContent: "center",
1633
+ flexShrink: 0,
1634
+ transition: "background-color 150ms ease",
1635
+ ...u ? { height: `${i}px`, width: "100%", cursor: "row-resize" } : { width: `${i}px`, height: "100%", cursor: "col-resize" }
1636
+ }, r = {
1637
+ display: "flex",
1638
+ gap: "2px",
1639
+ flexDirection: u ? "row" : "column",
1640
+ alignItems: "center",
1641
+ justifyContent: "center"
1642
+ }, b = {
1643
+ width: 3,
1644
+ height: 3,
1645
+ borderRadius: "50%",
1646
+ backgroundColor: "var(--archbase-resizable-grip-color, #adb5bd)",
1647
+ transition: "background-color 150ms ease"
1648
+ };
1649
+ return /* @__PURE__ */ a(
1650
+ Vt,
1651
+ {
1652
+ className: o,
1653
+ style: d,
1654
+ children: n && /* @__PURE__ */ F("span", { style: r, "aria-hidden": !0, children: [
1655
+ /* @__PURE__ */ a("span", { style: b }),
1656
+ /* @__PURE__ */ a("span", { style: b }),
1657
+ /* @__PURE__ */ a("span", { style: b })
1658
+ ] })
1659
+ }
1660
+ );
1661
+ };
1662
+ Zt.displayName = "ArchbaseResizableHandle";
1663
+ const Ze = ({
1664
+ direction: t = "horizontal",
1665
+ panels: i,
1666
+ onLayout: o,
1667
+ autoSaveId: n,
1668
+ handleSize: u = 4,
1669
+ handleClassName: d,
1670
+ showHandleGrip: r = !0,
1671
+ style: b,
1672
+ className: e,
1673
+ height: l,
1674
+ width: p
1675
+ }) => {
1676
+ const s = {
1677
+ height: l ?? "100%",
1678
+ width: p ?? "100%",
1679
+ ...b
1680
+ };
1681
+ return /* @__PURE__ */ a(
1682
+ Ft,
1683
+ {
1684
+ direction: t,
1685
+ onLayout: o,
1686
+ autoSaveId: n,
1687
+ style: s,
1688
+ className: e,
1689
+ children: i.map((f, g) => /* @__PURE__ */ F(W.Fragment, { children: [
1690
+ /* @__PURE__ */ a(
1691
+ Mt,
1692
+ {
1693
+ id: f.id,
1694
+ defaultSize: f.defaultSize,
1695
+ minSize: f.minSize ?? 10,
1696
+ maxSize: f.maxSize,
1697
+ collapsible: f.collapsible ?? !1,
1698
+ collapsedSize: f.collapsedSize ?? 0,
1699
+ order: f.order,
1700
+ children: f.children
1701
+ }
1702
+ ),
1703
+ g < i.length - 1 && /* @__PURE__ */ a(
1704
+ Zt,
1705
+ {
1706
+ direction: t,
1707
+ size: u,
1708
+ className: d,
1709
+ showGrip: r
1710
+ }
1711
+ )
1712
+ ] }, f.id))
1713
+ }
1714
+ );
1482
1715
  };
1483
- function _e({
1716
+ Ze.displayName = "ArchbaseResizableLayout";
1717
+ function Ye({
1484
1718
  components: t,
1485
1719
  defaultLayout: i,
1486
1720
  watermark: o,
1487
1721
  hideBorders: n = !1,
1488
- autoHideHeaders: f = !1,
1489
- onLayoutChange: h,
1490
- onPanelClose: s,
1491
- onPanelOpen: y,
1722
+ autoHideHeaders: u = !1,
1723
+ onLayoutChange: d,
1724
+ onPanelClose: r,
1725
+ onPanelOpen: b,
1492
1726
  style: e,
1493
- className: a,
1494
- height: b = "600px",
1495
- disabled: r = !1
1727
+ className: l,
1728
+ height: p = "600px",
1729
+ disabled: s = !1
1496
1730
  }) {
1497
- const { t: g } = Ht(), u = it(null), z = kt(() => {
1731
+ const { t: f } = Wt(), g = it(null), z = Ht(() => {
1498
1732
  const m = {};
1499
1733
  for (const R of Object.values(t))
1500
- m[R.id] = (S) => /* @__PURE__ */ c(
1501
- Ne,
1734
+ m[R.id] = (S) => /* @__PURE__ */ a(
1735
+ Ke,
1502
1736
  {
1503
1737
  component: R,
1504
1738
  api: S.api,
1505
- onClose: () => s?.(R.id)
1739
+ onClose: () => r?.(R.id)
1506
1740
  }
1507
1741
  );
1508
1742
  return m;
1509
- }, [t, s]), l = Gt((m) => {
1510
- if (u.current = m.api, i && typeof i != "string")
1743
+ }, [t, r]), c = kt((m) => {
1744
+ if (g.current = m.api, i && typeof i != "string")
1511
1745
  try {
1512
1746
  m.api.fromJSON(i);
1513
1747
  } catch (R) {
@@ -1527,40 +1761,40 @@ function _e({
1527
1761
  }
1528
1762
  }, [i, t]);
1529
1763
  return et(() => {
1530
- if (!u.current)
1764
+ if (!g.current)
1531
1765
  return;
1532
1766
  const m = [];
1533
- if (h) {
1534
- const R = u.current.onDidLayoutChange(() => {
1535
- h(u.current.toJSON());
1767
+ if (d) {
1768
+ const R = g.current.onDidLayoutChange(() => {
1769
+ d(g.current.toJSON());
1536
1770
  });
1537
1771
  m.push(R);
1538
1772
  }
1539
- if (s) {
1540
- const R = u.current.onDidRemovePanel((S) => {
1541
- s(S.panel.id);
1773
+ if (r) {
1774
+ const R = g.current.onDidRemovePanel((S) => {
1775
+ r(S.panel.id);
1542
1776
  });
1543
1777
  m.push(R);
1544
1778
  }
1545
1779
  return () => {
1546
1780
  m.forEach((R) => R.dispose());
1547
1781
  };
1548
- }, [h, s]), /* @__PURE__ */ c(
1782
+ }, [d, r]), /* @__PURE__ */ a(
1549
1783
  "div",
1550
1784
  {
1551
1785
  style: {
1552
1786
  width: "100%",
1553
- height: b,
1787
+ height: p,
1554
1788
  ...e
1555
1789
  },
1556
- className: a,
1557
- children: /* @__PURE__ */ c(
1558
- ie,
1790
+ className: l,
1791
+ children: /* @__PURE__ */ a(
1792
+ he,
1559
1793
  {
1560
1794
  components: z,
1561
- onReady: l,
1795
+ onReady: c,
1562
1796
  hideBorders: n,
1563
- watermarkComponent: o ? () => /* @__PURE__ */ c("div", { style: {
1797
+ watermarkComponent: o ? () => /* @__PURE__ */ a("div", { style: {
1564
1798
  display: "flex",
1565
1799
  alignItems: "center",
1566
1800
  justifyContent: "center",
@@ -1574,9 +1808,9 @@ function _e({
1574
1808
  }
1575
1809
  );
1576
1810
  }
1577
- function Ne({ component: t, api: i, onClose: o }) {
1811
+ function Ke({ component: t, api: i, onClose: o }) {
1578
1812
  const n = t.component;
1579
- return /* @__PURE__ */ c("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ c(
1813
+ return /* @__PURE__ */ a("div", { style: { height: "100%", overflow: "auto" }, children: /* @__PURE__ */ a(
1580
1814
  n,
1581
1815
  {
1582
1816
  api: i,
@@ -1585,131 +1819,131 @@ function Ne({ component: t, api: i, onClose: o }) {
1585
1819
  }
1586
1820
  ) });
1587
1821
  }
1588
- function ui({
1822
+ function Ci({
1589
1823
  preset: t,
1590
1824
  components: i = {},
1591
1825
  onPanelClose: o,
1592
1826
  onPanelOpen: n,
1593
- style: f,
1594
- className: h,
1595
- height: s
1827
+ style: u,
1828
+ className: d,
1829
+ height: r
1596
1830
  }) {
1597
- const { layout: y, components: e } = kt(() => ke(t, i), [t, i]);
1598
- return /* @__PURE__ */ c(
1599
- _e,
1831
+ const { layout: b, components: e } = Ht(() => Qe(t, i), [t, i]);
1832
+ return /* @__PURE__ */ a(
1833
+ Ye,
1600
1834
  {
1601
1835
  components: e,
1602
- defaultLayout: y,
1836
+ defaultLayout: b,
1603
1837
  onPanelClose: o,
1604
1838
  onPanelOpen: n,
1605
- style: f,
1606
- className: h,
1607
- height: s
1839
+ style: u,
1840
+ className: d,
1841
+ height: r
1608
1842
  }
1609
1843
  );
1610
1844
  }
1611
- function ke(t, i) {
1845
+ function Qe(t, i) {
1612
1846
  const o = {
1613
- ...He(),
1847
+ ...ti(),
1614
1848
  ...i
1615
1849
  };
1616
1850
  let n;
1617
1851
  switch (t) {
1618
1852
  case "dashboard":
1619
- n = _t(o);
1853
+ n = Pt(o);
1620
1854
  break;
1621
1855
  case "ide":
1622
- n = We(o);
1856
+ n = ei(o);
1623
1857
  break;
1624
1858
  case "explorer":
1625
- n = Fe(o);
1859
+ n = ii(o);
1626
1860
  break;
1627
1861
  case "analytics":
1628
- n = Ve(o);
1862
+ n = oi(o);
1629
1863
  break;
1630
1864
  default:
1631
- n = _t(o);
1865
+ n = Pt(o);
1632
1866
  }
1633
1867
  return { layout: n, components: o };
1634
1868
  }
1635
- function He() {
1869
+ function ti() {
1636
1870
  return {
1637
1871
  // Dashboard
1638
1872
  overview: {
1639
1873
  id: "overview",
1640
1874
  title: "Overview",
1641
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Overview Panel" })
1875
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Overview Panel" })
1642
1876
  },
1643
1877
  charts: {
1644
1878
  id: "charts",
1645
1879
  title: "Charts",
1646
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Charts Panel" })
1880
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Charts Panel" })
1647
1881
  },
1648
1882
  details: {
1649
1883
  id: "details",
1650
1884
  title: "Details",
1651
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Details Panel" })
1885
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Details Panel" })
1652
1886
  },
1653
1887
  recent: {
1654
1888
  id: "recent",
1655
1889
  title: "Recent Activity",
1656
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Recent Activity" })
1890
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Recent Activity" })
1657
1891
  },
1658
1892
  // IDE
1659
1893
  explorer: {
1660
1894
  id: "explorer",
1661
1895
  title: "Explorer",
1662
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "File Explorer" })
1896
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "File Explorer" })
1663
1897
  },
1664
1898
  search: {
1665
1899
  id: "search",
1666
1900
  title: "Search",
1667
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Search Panel" })
1901
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Search Panel" })
1668
1902
  },
1669
1903
  editor: {
1670
1904
  id: "editor",
1671
1905
  title: "Editor",
1672
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Code Editor" })
1906
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Code Editor" })
1673
1907
  },
1674
1908
  terminal: {
1675
1909
  id: "terminal",
1676
1910
  title: "Terminal",
1677
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Terminal" })
1911
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Terminal" })
1678
1912
  },
1679
1913
  output: {
1680
1914
  id: "output",
1681
1915
  title: "Output",
1682
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Output" })
1916
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Output" })
1683
1917
  },
1684
1918
  problems: {
1685
1919
  id: "problems",
1686
1920
  title: "Problems",
1687
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Problems Panel" })
1921
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Problems Panel" })
1688
1922
  },
1689
1923
  // Analytics
1690
1924
  metrics: {
1691
1925
  id: "metrics",
1692
1926
  title: "Metrics",
1693
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Metrics Dashboard" })
1927
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Metrics Dashboard" })
1694
1928
  },
1695
1929
  reports: {
1696
1930
  id: "reports",
1697
1931
  title: "Reports",
1698
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Reports Panel" })
1932
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Reports Panel" })
1699
1933
  },
1700
1934
  data: {
1701
1935
  id: "data",
1702
1936
  title: "Data Source",
1703
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Data Configuration" })
1937
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Data Configuration" })
1704
1938
  },
1705
1939
  filters: {
1706
1940
  id: "filters",
1707
1941
  title: "Filters",
1708
- component: () => /* @__PURE__ */ c("div", { style: { padding: 16 }, children: "Filter Panel" })
1942
+ component: () => /* @__PURE__ */ a("div", { style: { padding: 16 }, children: "Filter Panel" })
1709
1943
  }
1710
1944
  };
1711
1945
  }
1712
- function _t(t) {
1946
+ function Pt(t) {
1713
1947
  return {
1714
1948
  root: {
1715
1949
  type: "branch",
@@ -1768,7 +2002,7 @@ function _t(t) {
1768
2002
  }
1769
2003
  };
1770
2004
  }
1771
- function We(t) {
2005
+ function ei(t) {
1772
2006
  return {
1773
2007
  root: {
1774
2008
  type: "branch",
@@ -1849,7 +2083,7 @@ function We(t) {
1849
2083
  }
1850
2084
  };
1851
2085
  }
1852
- function Fe(t) {
2086
+ function ii(t) {
1853
2087
  return {
1854
2088
  root: {
1855
2089
  type: "branch",
@@ -1880,7 +2114,7 @@ function Fe(t) {
1880
2114
  }
1881
2115
  };
1882
2116
  }
1883
- function Ve(t) {
2117
+ function oi(t) {
1884
2118
  return {
1885
2119
  root: {
1886
2120
  type: "branch",
@@ -1935,43 +2169,47 @@ function Ve(t) {
1935
2169
  }
1936
2170
  export {
1937
2171
  C as AnchorType,
1938
- si as ArchbaseAdvancedTabs,
1939
- gi as ArchbaseCard,
1940
- bi as ArchbaseContainer,
1941
- _e as ArchbaseDockLayout,
1942
- ui as ArchbaseDockLayoutPreset,
1943
- hi as ArchbaseDockableContainer,
1944
- li as ArchbaseFloatingWindow,
1945
- ei as ArchbaseForm,
1946
- pi as ArchbaseGroup,
1947
- $e as ArchbaseSpaceBottom,
1948
- Le as ArchbaseSpaceBottomResizable,
1949
- ze as ArchbaseSpaceCentered,
1950
- we as ArchbaseSpaceCenteredVertically,
1951
- je as ArchbaseSpaceCustom,
1952
- Oe as ArchbaseSpaceFill,
1953
- Me as ArchbaseSpaceFixed,
1954
- ni as ArchbaseSpaceInfo,
1955
- Ie as ArchbaseSpaceLayer,
1956
- Se as ArchbaseSpaceLeft,
1957
- ye as ArchbaseSpaceLeftResizable,
1958
- ri as ArchbaseSpaceOptions,
1959
- De as ArchbaseSpacePositioned,
1960
- Ae as ArchbaseSpaceRight,
1961
- Ce as ArchbaseSpaceRightResizable,
1962
- xe as ArchbaseSpaceTop,
1963
- Te as ArchbaseSpaceTopResizable,
1964
- Ee as ArchbaseSpaceViewPort,
1965
- ai as ArchbaseSplitPane,
1966
- di as ArchbaseSplitPanePane,
1967
- ci as ArchbaseSplitPaneResizer,
1968
- zi as ArchbaseStack,
2172
+ Ri as ArchbaseAdvancedTabs,
2173
+ $i as ArchbaseCard,
2174
+ Mi as ArchbaseContainer,
2175
+ Ye as ArchbaseDockLayout,
2176
+ Ci as ArchbaseDockLayoutPreset,
2177
+ xi as ArchbaseDockableContainer,
2178
+ vi as ArchbaseFloatingWindow,
2179
+ bi as ArchbaseForm,
2180
+ ji as ArchbaseGroup,
2181
+ Ge as ArchbaseMosaicLayout,
2182
+ Zt as ArchbaseResizableHandle,
2183
+ Ze as ArchbaseResizableLayout,
2184
+ Je as ArchbaseResizablePanel,
2185
+ Pe as ArchbaseSpaceBottom,
2186
+ Ne as ArchbaseSpaceBottomResizable,
2187
+ Ae as ArchbaseSpaceCentered,
2188
+ Le as ArchbaseSpaceCenteredVertically,
2189
+ ke as ArchbaseSpaceCustom,
2190
+ He as ArchbaseSpaceFill,
2191
+ We as ArchbaseSpaceFixed,
2192
+ wi as ArchbaseSpaceInfo,
2193
+ Fe as ArchbaseSpaceLayer,
2194
+ Be as ArchbaseSpaceLeft,
2195
+ je as ArchbaseSpaceLeftResizable,
2196
+ yi as ArchbaseSpaceOptions,
2197
+ Ve as ArchbaseSpacePositioned,
2198
+ _e as ArchbaseSpaceRight,
2199
+ De as ArchbaseSpaceRightResizable,
2200
+ Oe as ArchbaseSpaceTop,
2201
+ Ie as ArchbaseSpaceTopResizable,
2202
+ qe as ArchbaseSpaceViewPort,
2203
+ Si as ArchbaseSplitPane,
2204
+ Ti as ArchbaseSplitPanePane,
2205
+ Xe as ArchbaseSplitPaneResizer,
2206
+ Bi as ArchbaseStack,
1969
2207
  st as CenterType,
1970
2208
  rt as ResizeHandlePlacement,
1971
- p as ResizeType,
2209
+ y as ResizeType,
1972
2210
  A as Type,
1973
2211
  Tt as anchoredProps,
1974
- oi as enabledSsrSupport,
2212
+ zi as enabledSsrSupport,
1975
2213
  St as resizableProps,
1976
- ii as useArchbaseCurrentSpace
2214
+ pi as useArchbaseCurrentSpace
1977
2215
  };