@objectifthunes/whiteboard 0.3.0 → 0.5.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,11 +1,11 @@
1
- import { jsx as r, jsxs as m, Fragment as et } from "react/jsx-runtime";
2
- import { useEffect as Y, useRef as M, useCallback as $, memo as Ct, useId as Tt, useState as vt, useLayoutEffect as Rt, Component as Wt, useMemo as bt, forwardRef as dt, createElement as W } from "react";
3
- import { create as Xt } from "zustand";
4
- import { createPortal as Yt } from "react-dom";
5
- const D = (t = 14) => ({
1
+ import { jsx as r, jsxs as d, Fragment as ne } from "react/jsx-runtime";
2
+ import { useEffect as F, useRef as P, useCallback as j, memo as Re, useId as De, useState as we, useLayoutEffect as Ie, Component as Xe, useMemo as be, forwardRef as de, createElement as I } from "react";
3
+ import { create as Ye } from "zustand";
4
+ import { createPortal as Fe } from "react-dom";
5
+ const E = (e = 14) => ({
6
6
  xmlns: "http://www.w3.org/2000/svg",
7
- width: t,
8
- height: t,
7
+ width: e,
8
+ height: e,
9
9
  viewBox: "0 0 24 24",
10
10
  fill: "none",
11
11
  stroke: "currentColor",
@@ -13,17 +13,17 @@ const D = (t = 14) => ({
13
13
  strokeLinecap: "round",
14
14
  strokeLinejoin: "round"
15
15
  });
16
- function Dt({ size: t, ...e }) {
17
- return /* @__PURE__ */ r("svg", { ...D(t), ...e, children: /* @__PURE__ */ r("path", { d: "M5 12h14" }) });
16
+ function We({ size: e, ...t }) {
17
+ return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M5 12h14" }) });
18
18
  }
19
- function It({ size: t, ...e }) {
20
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
19
+ function Ge({ size: e, ...t }) {
20
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
21
21
  /* @__PURE__ */ r("path", { d: "M5 12h14" }),
22
22
  /* @__PURE__ */ r("path", { d: "M12 5v14" })
23
23
  ] });
24
24
  }
25
- function Ft({ size: t, ...e }) {
26
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
25
+ function Ee({ size: e, ...t }) {
26
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
27
27
  /* @__PURE__ */ r("path", { d: "M3 7V5a2 2 0 0 1 2-2h2" }),
28
28
  /* @__PURE__ */ r("path", { d: "M17 3h2a2 2 0 0 1 2 2v2" }),
29
29
  /* @__PURE__ */ r("path", { d: "M21 17v2a2 2 0 0 1-2 2h-2" }),
@@ -32,14 +32,14 @@ function Ft({ size: t, ...e }) {
32
32
  /* @__PURE__ */ r("path", { d: "m16 16-1.9-1.9" })
33
33
  ] });
34
34
  }
35
- function Gt({ size: t, ...e }) {
36
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
35
+ function Le({ size: e, ...t }) {
36
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
37
37
  /* @__PURE__ */ r("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
38
38
  /* @__PURE__ */ r("path", { d: "M3 3v5h5" })
39
39
  ] });
40
40
  }
41
- function Et({ size: t, ...e }) {
42
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
41
+ function Oe({ size: e, ...t }) {
42
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
43
43
  /* @__PURE__ */ r("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
44
44
  /* @__PURE__ */ r("path", { d: "M3 9h18" }),
45
45
  /* @__PURE__ */ r("path", { d: "M3 15h18" }),
@@ -47,38 +47,38 @@ function Et({ size: t, ...e }) {
47
47
  /* @__PURE__ */ r("path", { d: "M15 3v18" })
48
48
  ] });
49
49
  }
50
- function Lt({ size: t, ...e }) {
51
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
50
+ function $e({ size: e, ...t }) {
51
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
52
52
  /* @__PURE__ */ r("polyline", { points: "15 3 21 3 21 9" }),
53
53
  /* @__PURE__ */ r("polyline", { points: "9 21 3 21 3 15" }),
54
54
  /* @__PURE__ */ r("line", { x1: "21", x2: "14", y1: "3", y2: "10" }),
55
55
  /* @__PURE__ */ r("line", { x1: "3", x2: "10", y1: "21", y2: "14" })
56
56
  ] });
57
57
  }
58
- function ht({ size: t, ...e }) {
59
- return /* @__PURE__ */ r("svg", { ...D(t), ...e, children: /* @__PURE__ */ r("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
58
+ function he({ size: e, ...t }) {
59
+ return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
60
60
  }
61
- function Ot({ size: t, ...e }) {
62
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
61
+ function Ae({ size: e, ...t }) {
62
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
63
63
  /* @__PURE__ */ r("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }),
64
64
  /* @__PURE__ */ r("path", { d: "M12 9v4" }),
65
65
  /* @__PURE__ */ r("path", { d: "M12 17h.01" })
66
66
  ] });
67
67
  }
68
- function At({ size: t, ...e }) {
69
- return /* @__PURE__ */ r("svg", { ...D(t), ...e, children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" }) });
68
+ function Be({ size: e, ...t }) {
69
+ return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M20 6 9 17l-5-5" }) });
70
70
  }
71
- function Nt({ size: t, ...e }) {
72
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
71
+ function Se({ size: e, ...t }) {
72
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
73
73
  /* @__PURE__ */ r("path", { d: "M18 6 6 18" }),
74
74
  /* @__PURE__ */ r("path", { d: "m6 6 12 12" })
75
75
  ] });
76
76
  }
77
- function $t({ size: t, ...e }) {
78
- return /* @__PURE__ */ r("svg", { ...D(t), ...e, children: /* @__PURE__ */ r("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
77
+ function He({ size: e, ...t }) {
78
+ return /* @__PURE__ */ r("svg", { ...E(e), ...t, children: /* @__PURE__ */ r("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
79
79
  }
80
- function Bt({ size: t, ...e }) {
81
- return /* @__PURE__ */ m("svg", { ...D(t), ...e, children: [
80
+ function Ve({ size: e, ...t }) {
81
+ return /* @__PURE__ */ d("svg", { ...E(e), ...t, children: [
82
82
  /* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "4" }),
83
83
  /* @__PURE__ */ r("path", { d: "M12 2v2" }),
84
84
  /* @__PURE__ */ r("path", { d: "M12 20v2" }),
@@ -90,89 +90,89 @@ function Bt({ size: t, ...e }) {
90
90
  /* @__PURE__ */ r("path", { d: "m19.07 4.93-1.41 1.41" })
91
91
  ] });
92
92
  }
93
- const ut = 20;
94
- function ct(t) {
95
- return Math.round(t / ut) * ut;
93
+ const G = 20;
94
+ function le(e) {
95
+ return Math.round(e / G) * G;
96
96
  }
97
- function gt(t, e, n = 60) {
98
- if (t.size === 0) return null;
99
- let s = 1 / 0, a = 1 / 0, u = -1 / 0, h = -1 / 0;
100
- for (const v of t.values())
101
- s = Math.min(s, v.x), a = Math.min(a, v.y), u = Math.max(u, v.x + v.width), h = Math.max(h, v.y + v.height);
102
- const f = u - s + n * 2, p = h - a + n * 2, w = e.width || window.innerWidth, d = e.height || window.innerHeight, N = Math.min(w / f, d / p, 1.5), k = (s + u) / 2, P = (a + h) / 2;
97
+ function ve(e, t, n = 60) {
98
+ if (e.size === 0) return null;
99
+ let a = 1 / 0, s = 1 / 0, c = -1 / 0, m = -1 / 0;
100
+ for (const x of e.values())
101
+ a = Math.min(a, x.x), s = Math.min(s, x.y), c = Math.max(c, x.x + x.width), m = Math.max(m, x.y + x.height);
102
+ const p = c - a + n * 2, f = m - s + n * 2, b = t.width || window.innerWidth, h = t.height || window.innerHeight, w = Math.min(b / p, h / f, 1.5), y = (a + c) / 2, z = (s + m) / 2;
103
103
  return {
104
- scale: Math.min(3, Math.max(0.2, N)),
104
+ scale: Math.min(3, Math.max(0.2, w)),
105
105
  offset: {
106
- x: w / 2 - k * N,
107
- y: d / 2 - P * N
106
+ x: b / 2 - y * w,
107
+ y: h / 2 - z * w
108
108
  }
109
109
  };
110
110
  }
111
- function Ht(t, e, n = 40, s = 1.5) {
112
- const a = e.width || window.innerWidth, u = e.height || window.innerHeight, h = Math.max(1, t.width), f = Math.max(1, t.height), p = Math.min(
113
- (a - n * 2) / h,
114
- (u - n * 2) / f,
115
- s
116
- ), w = Math.min(3, Math.max(0.2, p));
111
+ function je(e, t, n = 40, a = 1.5) {
112
+ const s = t.width || window.innerWidth, c = t.height || window.innerHeight, m = Math.max(1, e.width), p = Math.max(1, e.height), f = Math.min(
113
+ (s - n * 2) / m,
114
+ (c - n * 2) / p,
115
+ a
116
+ ), b = Math.min(3, Math.max(0.2, f));
117
117
  return {
118
- scale: w,
118
+ scale: b,
119
119
  offset: {
120
- x: a / 2 - (t.x + h / 2) * w,
121
- y: u / 2 - (t.y + f / 2) * w
120
+ x: s / 2 - (e.x + m / 2) * b,
121
+ y: c / 2 - (e.y + p / 2) * b
122
122
  }
123
123
  };
124
124
  }
125
- const b = Xt((t, e) => ({
125
+ const g = Ye((e, t) => ({
126
126
  offset: { x: 0, y: 0 },
127
127
  scale: 1,
128
128
  viewportSize: { width: 0, height: 0 },
129
129
  snapToGrid: !1,
130
- snapGridSize: ut,
130
+ snapGridSize: G,
131
131
  panels: /* @__PURE__ */ new Map(),
132
132
  resetFns: /* @__PURE__ */ new Map(),
133
133
  registryVersion: 0,
134
- setOffset: (n) => t((s) => ({ offset: typeof n == "function" ? n(s.offset) : n })),
135
- setScale: (n) => t((s) => ({ scale: typeof n == "function" ? n(s.scale) : n })),
136
- setViewportSize: (n) => t({ viewportSize: n }),
137
- setSnapToGrid: (n) => t((s) => ({ snapToGrid: typeof n == "function" ? n(s.snapToGrid) : n })),
138
- register: (n, s) => {
139
- e().panels.set(n, s), t((a) => ({ registryVersion: a.registryVersion + 1 }));
134
+ setOffset: (n) => e((a) => ({ offset: typeof n == "function" ? n(a.offset) : n })),
135
+ setScale: (n) => e((a) => ({ scale: typeof n == "function" ? n(a.scale) : n })),
136
+ setViewportSize: (n) => e({ viewportSize: n }),
137
+ setSnapToGrid: (n) => e((a) => ({ snapToGrid: typeof n == "function" ? n(a.snapToGrid) : n })),
138
+ register: (n, a) => {
139
+ t().panels.set(n, a), e((s) => ({ registryVersion: s.registryVersion + 1 }));
140
140
  },
141
141
  unregister: (n) => {
142
- e().panels.delete(n), t((s) => ({ registryVersion: s.registryVersion + 1 }));
142
+ t().panels.delete(n), e((a) => ({ registryVersion: a.registryVersion + 1 }));
143
143
  },
144
- registerReset: (n, s) => {
145
- e().resetFns.set(n, s);
144
+ registerReset: (n, a) => {
145
+ t().resetFns.set(n, a);
146
146
  },
147
147
  unregisterReset: (n) => {
148
- e().resetFns.delete(n);
148
+ t().resetFns.delete(n);
149
149
  },
150
150
  fitToContent: () => {
151
- const { panels: n, viewportSize: s } = e(), a = gt(n, s);
152
- a && t({ scale: a.scale, offset: a.offset });
151
+ const { panels: n, viewportSize: a } = t(), s = ve(n, a);
152
+ s && e({ scale: s.scale, offset: s.offset });
153
153
  },
154
- focusPanel: (n, s) => {
155
- const { viewportSize: a } = e(), u = Ht(
154
+ focusPanel: (n, a) => {
155
+ const { viewportSize: s } = t(), c = je(
156
156
  n,
157
- a,
158
- (s == null ? void 0 : s.padding) ?? 40,
159
- (s == null ? void 0 : s.maxScale) ?? 1.5
157
+ s,
158
+ (a == null ? void 0 : a.padding) ?? 40,
159
+ (a == null ? void 0 : a.maxScale) ?? 1.5
160
160
  );
161
- t({ scale: u.scale, offset: u.offset });
161
+ e({ scale: c.scale, offset: c.offset });
162
162
  },
163
163
  resetWidgets: () => {
164
- for (const s of e().resetFns.values()) s();
165
- const n = (s = 0) => {
166
- const { panels: a, viewportSize: u } = e(), h = gt(a, u);
167
- if (h) {
168
- t({ scale: h.scale, offset: h.offset });
164
+ for (const a of t().resetFns.values()) a();
165
+ const n = (a = 0) => {
166
+ const { panels: s, viewportSize: c } = t(), m = ve(s, c);
167
+ if (m) {
168
+ e({ scale: m.scale, offset: m.offset });
169
169
  return;
170
170
  }
171
- s < 6 && requestAnimationFrame(() => n(s + 1));
171
+ a < 6 && requestAnimationFrame(() => n(a + 1));
172
172
  };
173
173
  requestAnimationFrame(() => requestAnimationFrame(() => n()));
174
174
  },
175
- resetSession: () => t({
175
+ resetSession: () => e({
176
176
  offset: { x: 0, y: 0 },
177
177
  scale: 1,
178
178
  viewportSize: { width: 0, height: 0 },
@@ -182,138 +182,138 @@ const b = Xt((t, e) => ({
182
182
  resetFns: /* @__PURE__ */ new Map()
183
183
  })
184
184
  }));
185
- function Vt({ extraActions: t }) {
186
- const e = b((d) => d.scale), n = b((d) => d.viewportSize), s = b((d) => d.snapToGrid), a = b((d) => d.setScale), u = b((d) => d.setOffset), h = b((d) => d.setSnapToGrid), f = b((d) => d.fitToContent), p = b((d) => d.resetWidgets);
187
- Y(() => {
188
- s && window.dispatchEvent(new Event("whiteboard-snap-now"));
189
- }, [s]);
190
- const w = (d) => {
191
- const N = Math.min(3, Math.max(0.2, d)), k = N / e, P = (n.width || window.innerWidth) / 2, v = (n.height || window.innerHeight) / 2;
192
- u((_) => ({
193
- x: P - (P - _.x) * k,
194
- y: v - (v - _.y) * k
195
- })), a(N);
185
+ function Ze({ extraActions: e }) {
186
+ const t = g((h) => h.scale), n = g((h) => h.viewportSize), a = g((h) => h.snapToGrid), s = g((h) => h.setScale), c = g((h) => h.setOffset), m = g((h) => h.setSnapToGrid), p = g((h) => h.fitToContent), f = g((h) => h.resetWidgets);
187
+ F(() => {
188
+ a && window.dispatchEvent(new Event("whiteboard-snap-now"));
189
+ }, [a]);
190
+ const b = (h) => {
191
+ const w = Math.min(3, Math.max(0.2, h)), y = w / t, z = (n.width || window.innerWidth) / 2, x = (n.height || window.innerHeight) / 2;
192
+ c((C) => ({
193
+ x: z - (z - C.x) * y,
194
+ y: x - (x - C.y) * y
195
+ })), s(w);
196
196
  };
197
- return /* @__PURE__ */ m(
197
+ return /* @__PURE__ */ d(
198
198
  "div",
199
199
  {
200
200
  className: "zoom-bar",
201
- onPointerDown: (d) => d.stopPropagation(),
202
- onWheel: (d) => d.stopPropagation(),
201
+ onPointerDown: (h) => h.stopPropagation(),
202
+ onWheel: (h) => h.stopPropagation(),
203
203
  children: [
204
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => w(e * 0.8), title: "Zoom out", "aria-label": "Zoom out", children: /* @__PURE__ */ r(Dt, { size: 14 }) }),
205
- /* @__PURE__ */ m("span", { className: "zoom-bar__value", children: [
206
- Math.round(e * 100),
204
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => b(t * 0.8), title: "Zoom out", "aria-label": "Zoom out", children: /* @__PURE__ */ r(We, { size: 14 }) }),
205
+ /* @__PURE__ */ d("span", { className: "zoom-bar__value", children: [
206
+ Math.round(t * 100),
207
207
  "%"
208
208
  ] }),
209
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => w(e * 1.2), title: "Zoom in", "aria-label": "Zoom in", children: /* @__PURE__ */ r(It, { size: 14 }) }),
210
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: f, title: "Fit camera to all panels", "aria-label": "Fit camera to all panels", children: /* @__PURE__ */ r(Ft, { size: 14 }) }),
211
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: p, title: "Reset panel positions", "aria-label": "Reset panel positions", children: /* @__PURE__ */ r(Gt, { size: 14 }) }),
209
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__icon", onClick: () => b(t * 1.2), title: "Zoom in", "aria-label": "Zoom in", children: /* @__PURE__ */ r(Ge, { size: 14 }) }),
210
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: p, title: "Fit camera to all panels", "aria-label": "Fit camera to all panels", children: /* @__PURE__ */ r(Ee, { size: 14 }) }),
211
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action", onClick: f, title: "Reset panel positions", "aria-label": "Reset panel positions", children: /* @__PURE__ */ r(Le, { size: 14 }) }),
212
212
  /* @__PURE__ */ r(
213
213
  "button",
214
214
  {
215
215
  type: "button",
216
- className: `wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action${s ? " is-active" : ""}`,
217
- onClick: () => h((d) => !d),
218
- title: s ? "Disable snap to grid" : "Enable snap to grid",
219
- "aria-label": s ? "Disable snap to grid" : "Enable snap to grid",
220
- children: /* @__PURE__ */ r(Et, { size: 14 })
216
+ className: `wb-btn wb-btn--secondary wb-btn--icon-only zoom-bar__action${a ? " is-active" : ""}`,
217
+ onClick: () => m((h) => !h),
218
+ title: a ? "Disable snap to grid" : "Enable snap to grid",
219
+ "aria-label": a ? "Disable snap to grid" : "Enable snap to grid",
220
+ children: /* @__PURE__ */ r(Oe, { size: 14 })
221
221
  }
222
222
  ),
223
- t
223
+ e
224
224
  ]
225
225
  }
226
226
  );
227
227
  }
228
- const Q = 200, tt = 150, lt = 40, yt = 1;
229
- function jt({ loading: t = !1 }) {
230
- b((i) => i.registryVersion);
231
- const e = b((i) => i.offset), n = b((i) => i.scale), s = b((i) => i.viewportSize), a = b((i) => i.panels), u = b((i) => i.setOffset), h = b((i) => i.setScale), f = b((i) => i.focusPanel), p = M(null), w = M(!1), d = M(null), k = Array.from(a.entries()).filter(([, i]) => Number.isFinite(i.width) && Number.isFinite(i.height)), P = k.map(([, i]) => i);
232
- if (t || P.length === 0)
233
- return /* @__PURE__ */ r("div", { className: "minimap minimap--loading", style: { width: Q, height: tt }, children: /* @__PURE__ */ r("div", { className: "minimap__loading", children: /* @__PURE__ */ r(ht, { size: 14, className: "icon-spin" }) }) });
234
- const v = s.width || window.innerWidth, _ = s.height || window.innerHeight, E = v / n, B = _ / n, H = -e.x / n, V = -e.y / n;
235
- let I = 1 / 0, c = 1 / 0, T = -1 / 0, R = -1 / 0;
236
- for (const i of P)
237
- I = Math.min(I, i.x), c = Math.min(c, i.y), T = Math.max(T, i.x + i.width), R = Math.max(R, i.y + i.height);
238
- I -= lt, c -= lt, T += lt, R += lt;
239
- const z = Math.max(yt, T - I), A = Math.max(yt, R - c), C = Math.min(Q / z, tt / A), L = z * C, Z = A * C, U = (Q - L) / 2, X = (tt - Z) / 2, q = (i) => U + (i - I) * C, j = (i) => X + (i - c) * C, J = (i, y) => {
240
- if (!p.current) return;
241
- const S = p.current.getBoundingClientRect(), F = Math.min(Q, Math.max(0, i - S.left)), O = Math.min(tt, Math.max(0, y - S.top)), rt = Math.min(L + U, Math.max(U, F)), st = Math.min(Z + X, Math.max(X, O)), at = (rt - U) / C + I, it = (st - X) / C + c;
242
- return { worldX: at, worldY: it };
243
- }, K = (i, y, S) => {
244
- const F = Math.min(3, Math.max(0.2, S));
245
- h(F), u({
246
- x: v / 2 - i * F,
247
- y: _ / 2 - y * F
228
+ const ee = 200, te = 150, ue = 40, Ne = 1;
229
+ function Ue({ loading: e = !1 }) {
230
+ g((o) => o.registryVersion);
231
+ const t = g((o) => o.offset), n = g((o) => o.scale), a = g((o) => o.viewportSize), s = g((o) => o.panels), c = g((o) => o.setOffset), m = g((o) => o.setScale), p = g((o) => o.focusPanel), f = P(null), b = P(!1), h = P(null), y = Array.from(s.entries()).filter(([, o]) => Number.isFinite(o.width) && Number.isFinite(o.height)), z = y.map(([, o]) => o);
232
+ if (e || z.length === 0)
233
+ return /* @__PURE__ */ r("div", { className: "minimap minimap--loading", style: { width: ee, height: te }, children: /* @__PURE__ */ r("div", { className: "minimap__loading", children: /* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }) }) });
234
+ const x = a.width || window.innerWidth, C = a.height || window.innerHeight, L = x / n, N = C / n, v = -t.x / n, T = -t.y / n;
235
+ let O = 1 / 0, u = 1 / 0, X = -1 / 0, Y = -1 / 0;
236
+ for (const o of z)
237
+ O = Math.min(O, o.x), u = Math.min(u, o.y), X = Math.max(X, o.x + o.width), Y = Math.max(Y, o.y + o.height);
238
+ O -= ue, u -= ue, X += ue, Y += ue;
239
+ const R = Math.max(Ne, X - O), V = Math.max(Ne, Y - u), D = Math.min(ee / R, te / V), B = R * D, U = V * D, q = (ee - B) / 2, W = (te - U) / 2, J = (o) => q + (o - O) * D, Z = (o) => W + (o - u) * D, Q = (o, k) => {
240
+ if (!f.current) return;
241
+ const _ = f.current.getBoundingClientRect(), $ = Math.min(ee, Math.max(0, o - _.left)), H = Math.min(te, Math.max(0, k - _.top)), ae = Math.min(B + q, Math.max(q, $)), se = Math.min(U + W, Math.max(W, H)), oe = (ae - q) / D + O, ie = (se - W) / D + u;
242
+ return { worldX: oe, worldY: ie };
243
+ }, K = (o, k, _) => {
244
+ const $ = Math.min(3, Math.max(0.2, _));
245
+ m($), c({
246
+ x: x / 2 - o * $,
247
+ y: C / 2 - k * $
248
248
  });
249
- }, nt = (i, y) => {
250
- const S = J(i, y);
251
- S && K(S.worldX, S.worldY, n);
252
- }, ft = (i) => {
253
- i.stopPropagation(), i.preventDefault(), w.current = !0, i.currentTarget.setPointerCapture(i.pointerId), nt(i.clientX, i.clientY);
254
- }, o = (i) => {
255
- w.current && nt(i.clientX, i.clientY);
256
- }, g = () => {
257
- w.current = !1;
249
+ }, re = (o, k) => {
250
+ const _ = Q(o, k);
251
+ _ && K(_.worldX, _.worldY, n);
252
+ }, pe = (o) => {
253
+ o.stopPropagation(), o.preventDefault(), b.current = !0, o.currentTarget.setPointerCapture(o.pointerId), re(o.clientX, o.clientY);
254
+ }, l = (o) => {
255
+ b.current && re(o.clientX, o.clientY);
256
+ }, S = () => {
257
+ b.current = !1;
258
258
  };
259
- return /* @__PURE__ */ m(
259
+ return /* @__PURE__ */ d(
260
260
  "div",
261
261
  {
262
- ref: p,
263
- onPointerDown: ft,
264
- onPointerMove: o,
265
- onPointerUp: g,
266
- onPointerCancel: g,
267
- onWheel: (i) => {
268
- i.preventDefault(), i.stopPropagation();
269
- const y = J(i.clientX, i.clientY);
270
- if (!y) return;
271
- const S = i.deltaY > 0 ? 0.9 : 1.1;
272
- K(y.worldX, y.worldY, n * S);
262
+ ref: f,
263
+ onPointerDown: pe,
264
+ onPointerMove: l,
265
+ onPointerUp: S,
266
+ onPointerCancel: S,
267
+ onWheel: (o) => {
268
+ o.preventDefault(), o.stopPropagation();
269
+ const k = Q(o.clientX, o.clientY);
270
+ if (!k) return;
271
+ const _ = o.deltaY > 0 ? 0.9 : 1.1;
272
+ K(k.worldX, k.worldY, n * _);
273
273
  },
274
274
  className: "minimap",
275
275
  style: {
276
- width: Q,
277
- height: tt
276
+ width: ee,
277
+ height: te
278
278
  },
279
279
  children: [
280
- k.map(([i, y]) => /* @__PURE__ */ r(
280
+ y.map(([o, k]) => /* @__PURE__ */ r(
281
281
  "div",
282
282
  {
283
283
  className: "minimap__panel",
284
- onPointerDown: (S) => {
285
- S.stopPropagation();
284
+ onPointerDown: (_) => {
285
+ _.stopPropagation();
286
286
  },
287
- onPointerUp: (S) => {
288
- S.stopPropagation();
289
- const F = Date.now(), O = d.current;
290
- if (O && O.id === i && F - O.time < 300) {
291
- S.preventDefault(), f(y, { padding: y.focusPadding, maxScale: y.focusMaxScale }), d.current = null;
287
+ onPointerUp: (_) => {
288
+ _.stopPropagation();
289
+ const $ = Date.now(), H = h.current;
290
+ if (H && H.id === o && $ - H.time < 300) {
291
+ _.preventDefault(), p(k, { padding: k.focusPadding, maxScale: k.focusMaxScale }), h.current = null;
292
292
  return;
293
293
  }
294
- d.current = { id: i, time: F };
294
+ h.current = { id: o, time: $ };
295
295
  },
296
- onDoubleClick: (S) => {
297
- S.preventDefault(), S.stopPropagation(), f(y, { padding: y.focusPadding, maxScale: y.focusMaxScale });
296
+ onDoubleClick: (_) => {
297
+ _.preventDefault(), _.stopPropagation(), p(k, { padding: k.focusPadding, maxScale: k.focusMaxScale });
298
298
  },
299
299
  style: {
300
- left: q(y.x),
301
- top: j(y.y),
302
- width: Math.max(1, y.width * C),
303
- height: Math.max(1, y.height * C)
300
+ left: J(k.x),
301
+ top: Z(k.y),
302
+ width: Math.max(1, k.width * D),
303
+ height: Math.max(1, k.height * D)
304
304
  }
305
305
  },
306
- i
306
+ o
307
307
  )),
308
308
  /* @__PURE__ */ r(
309
309
  "div",
310
310
  {
311
311
  className: "minimap__viewport",
312
312
  style: {
313
- left: q(H),
314
- top: j(V),
315
- width: E * C,
316
- height: B * C
313
+ left: J(v),
314
+ top: Z(T),
315
+ width: L * D,
316
+ height: N * D
317
317
  }
318
318
  }
319
319
  )
@@ -321,262 +321,262 @@ function jt({ loading: t = !1 }) {
321
321
  }
322
322
  );
323
323
  }
324
- function fe({ children: t, showMinimap: e = !0, minimapLoading: n = !1, extraActions: s }) {
325
- const a = b((c) => c.offset), u = b((c) => c.scale), h = b((c) => c.registryVersion), f = b((c) => c.viewportSize), p = b((c) => c.setOffset), w = b((c) => c.setScale), d = b((c) => c.setViewportSize), N = M(null), k = M(!1), P = M({ x: 0, y: 0 }), v = M(null), _ = M(u), E = M(!1);
326
- Y(() => () => {
327
- b.getState().resetSession();
328
- }, []), Y(() => {
329
- _.current = u;
330
- }, [u]), Y(() => {
331
- const c = N.current;
332
- if (!c) return;
333
- const T = () => {
334
- const z = c.getBoundingClientRect();
335
- d({
336
- width: Math.max(0, z.width),
337
- height: Math.max(0, z.height)
324
+ function vt({ children: e, showMinimap: t = !0, minimapLoading: n = !1, extraActions: a }) {
325
+ const s = g((u) => u.offset), c = g((u) => u.scale), m = g((u) => u.registryVersion), p = g((u) => u.viewportSize), f = g((u) => u.setOffset), b = g((u) => u.setScale), h = g((u) => u.setViewportSize), w = P(null), y = P(!1), z = P({ x: 0, y: 0 }), x = P(null), C = P(c), L = P(!1);
326
+ F(() => () => {
327
+ g.getState().resetSession();
328
+ }, []), F(() => {
329
+ C.current = c;
330
+ }, [c]), F(() => {
331
+ const u = w.current;
332
+ if (!u) return;
333
+ const X = () => {
334
+ const R = u.getBoundingClientRect();
335
+ h({
336
+ width: Math.max(0, R.width),
337
+ height: Math.max(0, R.height)
338
338
  });
339
339
  };
340
- if (T(), typeof ResizeObserver > "u") return;
341
- const R = new ResizeObserver(T);
342
- return R.observe(c), () => R.disconnect();
343
- }, [d]), Y(() => {
344
- if (E.current) return;
345
- const { panels: c } = b.getState();
346
- c.size === 0 || f.width <= 0 || f.height <= 0 || (E.current = !0, requestAnimationFrame(() => {
347
- b.getState().fitToContent();
340
+ if (X(), typeof ResizeObserver > "u") return;
341
+ const Y = new ResizeObserver(X);
342
+ return Y.observe(u), () => Y.disconnect();
343
+ }, [h]), F(() => {
344
+ if (L.current) return;
345
+ const { panels: u } = g.getState();
346
+ u.size === 0 || p.width <= 0 || p.height <= 0 || (L.current = !0, requestAnimationFrame(() => {
347
+ g.getState().fitToContent();
348
348
  }));
349
- }, [h, f]);
350
- const B = $((c) => {
351
- c.target === c.currentTarget && (c.button === 0 || c.button === 1) && (k.current = !0, v.current = c.pointerId, P.current = { x: c.clientX, y: c.clientY }, c.currentTarget.setPointerCapture(c.pointerId), c.preventDefault());
352
- }, []), H = $((c) => {
353
- if (!k.current || v.current !== c.pointerId) return;
354
- const T = c.movementX ?? c.clientX - P.current.x, R = c.movementY ?? c.clientY - P.current.y;
355
- p((z) => ({ x: z.x + T, y: z.y + R })), P.current = { x: c.clientX, y: c.clientY };
356
- }, [p]), V = $((c) => {
357
- if (v.current !== null)
349
+ }, [m, p]);
350
+ const N = j((u) => {
351
+ u.target === u.currentTarget && (u.button === 0 || u.button === 1) && (y.current = !0, x.current = u.pointerId, z.current = { x: u.clientX, y: u.clientY }, u.currentTarget.setPointerCapture(u.pointerId), u.preventDefault());
352
+ }, []), v = j((u) => {
353
+ if (!y.current || x.current !== u.pointerId) return;
354
+ const X = u.movementX ?? u.clientX - z.current.x, Y = u.movementY ?? u.clientY - z.current.y;
355
+ f((R) => ({ x: R.x + X, y: R.y + Y })), z.current = { x: u.clientX, y: u.clientY };
356
+ }, [f]), T = j((u) => {
357
+ if (x.current !== null)
358
358
  try {
359
- c.currentTarget.releasePointerCapture(v.current);
359
+ u.currentTarget.releasePointerCapture(x.current);
360
360
  } catch {
361
361
  }
362
- k.current = !1, v.current = null;
363
- }, []), I = $((c) => {
364
- const T = _.current, R = c.currentTarget.getBoundingClientRect(), z = { x: c.clientX - R.left, y: c.clientY - R.top }, A = Math.min(3, Math.max(0.2, T * (c.deltaY > 0 ? 0.9 : 1.1))), C = A / T;
365
- p((L) => ({
366
- x: z.x - (z.x - L.x) * C,
367
- y: z.y - (z.y - L.y) * C
368
- })), w(A);
369
- }, [p, w]);
370
- return /* @__PURE__ */ m(et, { children: [
362
+ y.current = !1, x.current = null;
363
+ }, []), O = j((u) => {
364
+ const X = C.current, Y = u.currentTarget.getBoundingClientRect(), R = { x: u.clientX - Y.left, y: u.clientY - Y.top }, V = Math.min(3, Math.max(0.2, X * (u.deltaY > 0 ? 0.9 : 1.1))), D = V / X;
365
+ f((B) => ({
366
+ x: R.x - (R.x - B.x) * D,
367
+ y: R.y - (R.y - B.y) * D
368
+ })), b(V);
369
+ }, [f, b]);
370
+ return /* @__PURE__ */ d(ne, { children: [
371
371
  /* @__PURE__ */ r(
372
372
  "div",
373
373
  {
374
- ref: N,
375
- onPointerDown: B,
376
- onPointerMove: H,
377
- onPointerUp: V,
378
- onPointerCancel: V,
379
- onWheel: I,
380
- onContextMenu: (c) => c.preventDefault(),
374
+ ref: w,
375
+ onPointerDown: N,
376
+ onPointerMove: v,
377
+ onPointerUp: T,
378
+ onPointerCancel: T,
379
+ onWheel: O,
380
+ onContextMenu: (u) => u.preventDefault(),
381
381
  className: "whiteboard-shell",
382
- children: /* @__PURE__ */ m(
382
+ children: /* @__PURE__ */ d(
383
383
  "div",
384
384
  {
385
385
  className: "whiteboard-canvas",
386
- style: { transform: `translate(${a.x}px, ${a.y}px) scale(${u})` },
386
+ style: { transform: `translate(${s.x}px, ${s.y}px) scale(${c})` },
387
387
  children: [
388
388
  /* @__PURE__ */ r("div", { className: "whiteboard-grid", "aria-hidden": !0 }),
389
- t
389
+ e
390
390
  ]
391
391
  }
392
392
  )
393
393
  }
394
394
  ),
395
- /* @__PURE__ */ r(Vt, { extraActions: s }),
396
- e ? /* @__PURE__ */ r(jt, { loading: n }) : null
395
+ /* @__PURE__ */ r(Ze, { extraActions: a }),
396
+ t ? /* @__PURE__ */ r(Ue, { loading: n }) : null
397
397
  ] });
398
398
  }
399
- const be = Ct(function({
400
- title: e,
399
+ const Nt = Re(function({
400
+ title: t,
401
401
  defaultPosition: n,
402
- width: s = 300,
403
- className: a,
404
- trackRect: u,
405
- focusable: h,
406
- focusPadding: f = 40,
407
- focusMaxScale: p = 1.5,
408
- headerActions: w,
409
- children: d
402
+ width: a = 300,
403
+ className: s,
404
+ trackRect: c,
405
+ focusable: m,
406
+ focusPadding: p = 40,
407
+ focusMaxScale: f = 1.5,
408
+ headerActions: b,
409
+ children: h
410
410
  }) {
411
- const N = Tt(), [k, P] = vt(n), v = M(!1), _ = M(k), E = M(null), B = M(null), H = b((o) => o.scale), V = b((o) => o.snapToGrid), I = b((o) => o.snapGridSize), c = b((o) => o.register), T = b((o) => o.unregister), R = b((o) => o.registerReset), z = b((o) => o.unregisterReset), A = b((o) => o.focusPanel), C = M(H), L = M(!1), Z = M(20), U = M(n), X = M(null), q = M(null);
412
- Y(() => {
413
- C.current = H;
414
- }, [H]), Y(() => {
415
- L.current = V, Z.current = I;
416
- }, [V, I]), Y(() => {
417
- const o = () => {
418
- const g = Z.current;
419
- P((x) => {
420
- const i = {
421
- x: Math.round(x.x / g) * g,
422
- y: Math.round(x.y / g) * g
411
+ const w = De(), [y, z] = we(n), x = P(!1), C = P(y), L = P(null), N = P(null), v = g((l) => l.scale), T = g((l) => l.snapToGrid), O = g((l) => l.snapGridSize), u = g((l) => l.register), X = g((l) => l.unregister), Y = g((l) => l.registerReset), R = g((l) => l.unregisterReset), V = g((l) => l.focusPanel), D = P(v), B = P(!1), U = P(20), q = P(n), W = P(null), J = P(null);
412
+ F(() => {
413
+ D.current = v;
414
+ }, [v]), F(() => {
415
+ B.current = T, U.current = O;
416
+ }, [T, O]), F(() => {
417
+ const l = () => {
418
+ const S = U.current;
419
+ z((M) => {
420
+ const o = {
421
+ x: Math.round(M.x / S) * S,
422
+ y: Math.round(M.y / S) * S
423
423
  };
424
- return i.x === x.x && i.y === x.y ? x : i;
424
+ return o.x === M.x && o.y === M.y ? M : o;
425
425
  });
426
426
  };
427
- return window.addEventListener("whiteboard-snap-now", o), () => window.removeEventListener("whiteboard-snap-now", o);
428
- }, []), Y(() => {
429
- _.current = k;
430
- }, [k]);
431
- const j = $(() => {
432
- const o = E.current;
433
- if (!o) return;
434
- const g = {
435
- x: _.current.x,
436
- y: _.current.y,
437
- width: o.offsetWidth,
438
- height: o.offsetHeight,
439
- focusPadding: f,
440
- focusMaxScale: p
441
- }, x = B.current;
442
- x && x.x === g.x && x.y === g.y && x.width === g.width && x.height === g.height && x.focusPadding === g.focusPadding && x.focusMaxScale === g.focusMaxScale || (B.current = g, c(N, g), u && (u.current = g));
443
- }, [p, f, N, c, u]), J = $(() => {
444
- const o = E.current;
445
- return o ? {
446
- x: _.current.x,
447
- y: _.current.y,
448
- width: o.offsetWidth,
449
- height: o.offsetHeight,
450
- focusPadding: f,
451
- focusMaxScale: p
427
+ return window.addEventListener("whiteboard-snap-now", l), () => window.removeEventListener("whiteboard-snap-now", l);
428
+ }, []), F(() => {
429
+ C.current = y;
430
+ }, [y]);
431
+ const Z = j(() => {
432
+ const l = L.current;
433
+ if (!l) return;
434
+ const S = {
435
+ x: C.current.x,
436
+ y: C.current.y,
437
+ width: l.offsetWidth,
438
+ height: l.offsetHeight,
439
+ focusPadding: p,
440
+ focusMaxScale: f
441
+ }, M = N.current;
442
+ M && M.x === S.x && M.y === S.y && M.width === S.width && M.height === S.height && M.focusPadding === S.focusPadding && M.focusMaxScale === S.focusMaxScale || (N.current = S, u(w, S), c && (c.current = S));
443
+ }, [f, p, w, u, c]), Q = j(() => {
444
+ const l = L.current;
445
+ return l ? {
446
+ x: C.current.x,
447
+ y: C.current.y,
448
+ width: l.offsetWidth,
449
+ height: l.offsetHeight,
450
+ focusPadding: p,
451
+ focusMaxScale: f
452
452
  } : null;
453
- }, [p, f]), K = $(() => {
454
- const o = J();
455
- o && A(o, { padding: f, maxScale: p });
456
- }, [A, f, p, J]);
457
- Y(() => (R(N, () => P(U.current)), () => {
458
- var o;
459
- (o = X.current) == null || o.call(X), T(N), z(N), B.current = null;
460
- }), [N, R, T, z]), Rt(() => {
461
- j();
462
- }, [k.x, k.y, s, j]), Y(() => {
463
- const o = E.current;
464
- if (!o || typeof ResizeObserver > "u") return;
465
- const g = new ResizeObserver(() => {
466
- j();
453
+ }, [f, p]), K = j(() => {
454
+ const l = Q();
455
+ l && V(l, { padding: p, maxScale: f });
456
+ }, [V, p, f, Q]);
457
+ F(() => (Y(w, () => z(q.current)), () => {
458
+ var l;
459
+ (l = W.current) == null || l.call(W), X(w), R(w), N.current = null;
460
+ }), [w, Y, X, R]), Ie(() => {
461
+ Z();
462
+ }, [y.x, y.y, a, Z]), F(() => {
463
+ const l = L.current;
464
+ if (!l || typeof ResizeObserver > "u") return;
465
+ const S = new ResizeObserver(() => {
466
+ Z();
467
467
  });
468
- return g.observe(o), () => g.disconnect();
469
- }, [j]);
470
- const nt = $((o) => {
471
- var rt;
472
- if (o.button !== 0) return;
473
- v.current = !0;
474
- const g = o.clientX, x = o.clientY, i = _.current.x, y = _.current.y, S = C.current;
475
- o.preventDefault(), o.stopPropagation(), o.target.setPointerCapture(o.pointerId);
476
- const F = (st) => {
477
- if (!v.current) return;
478
- const at = i + (st.clientX - g) / S, it = y + (st.clientY - x) / S, ot = Z.current, _t = L.current ? Math.round(at / ot) * ot : at, zt = L.current ? Math.round(it / ot) * ot : it;
479
- P({
480
- x: _t,
481
- y: zt
468
+ return S.observe(l), () => S.disconnect();
469
+ }, [Z]);
470
+ const re = j((l) => {
471
+ var ae;
472
+ if (l.button !== 0) return;
473
+ x.current = !0;
474
+ const S = l.clientX, M = l.clientY, o = C.current.x, k = C.current.y, _ = D.current;
475
+ l.preventDefault(), l.stopPropagation(), l.target.setPointerCapture(l.pointerId);
476
+ const $ = (se) => {
477
+ if (!x.current) return;
478
+ const oe = o + (se.clientX - S) / _, ie = k + (se.clientY - M) / _, ce = U.current, ze = B.current ? Math.round(oe / ce) * ce : oe, Te = B.current ? Math.round(ie / ce) * ce : ie;
479
+ z({
480
+ x: ze,
481
+ y: Te
482
482
  });
483
- }, O = () => {
484
- v.current = !1, window.removeEventListener("pointermove", F), window.removeEventListener("pointerup", O), X.current = null;
483
+ }, H = () => {
484
+ x.current = !1, window.removeEventListener("pointermove", $), window.removeEventListener("pointerup", H), W.current = null;
485
485
  };
486
- (rt = X.current) == null || rt.call(X), window.addEventListener("pointermove", F), window.addEventListener("pointerup", O), X.current = O;
487
- }, []), ft = a ? `floating-panel ${a}` : "floating-panel";
488
- return /* @__PURE__ */ m(
486
+ (ae = W.current) == null || ae.call(W), window.addEventListener("pointermove", $), window.addEventListener("pointerup", H), W.current = H;
487
+ }, []), pe = s ? `floating-panel ${s}` : "floating-panel";
488
+ return /* @__PURE__ */ d(
489
489
  "div",
490
490
  {
491
- ref: E,
492
- className: ft,
493
- style: { left: k.x, top: k.y, width: s },
494
- onPointerDown: (o) => o.stopPropagation(),
495
- onPointerUp: (o) => {
496
- if (v.current) return;
497
- const g = Date.now(), x = q.current;
498
- if (x && g - x.time < 300) {
499
- const i = o.clientX - x.x, y = o.clientY - x.y;
500
- if (i * i + y * y < 100) {
501
- o.stopPropagation(), K(), q.current = null;
491
+ ref: L,
492
+ className: pe,
493
+ style: { left: y.x, top: y.y, width: a },
494
+ onPointerDown: (l) => l.stopPropagation(),
495
+ onPointerUp: (l) => {
496
+ if (x.current) return;
497
+ const S = Date.now(), M = J.current;
498
+ if (M && S - M.time < 300) {
499
+ const o = l.clientX - M.x, k = l.clientY - M.y;
500
+ if (o * o + k * k < 100) {
501
+ l.stopPropagation(), K(), J.current = null;
502
502
  return;
503
503
  }
504
504
  }
505
- q.current = { time: g, x: o.clientX, y: o.clientY };
505
+ J.current = { time: S, x: l.clientX, y: l.clientY };
506
506
  },
507
- onWheel: (o) => o.stopPropagation(),
508
- onDoubleClick: (o) => {
509
- o.stopPropagation(), K();
507
+ onWheel: (l) => l.stopPropagation(),
508
+ onDoubleClick: (l) => {
509
+ l.stopPropagation(), K();
510
510
  },
511
511
  children: [
512
- /* @__PURE__ */ m("div", { onPointerDown: nt, className: "floating-panel__header", children: [
513
- /* @__PURE__ */ r("strong", { className: "floating-panel__title", children: e }),
514
- w,
515
- h && /* @__PURE__ */ r(
512
+ /* @__PURE__ */ d("div", { onPointerDown: re, className: "floating-panel__header", children: [
513
+ /* @__PURE__ */ r("strong", { className: "floating-panel__title", children: t }),
514
+ b,
515
+ m && /* @__PURE__ */ r(
516
516
  "button",
517
517
  {
518
518
  type: "button",
519
519
  className: "wb-btn wb-btn--secondary wb-btn--icon-only floating-panel__focus",
520
520
  onClick: K,
521
- onPointerDown: (o) => o.stopPropagation(),
521
+ onPointerDown: (l) => l.stopPropagation(),
522
522
  title: "Focus on this panel",
523
523
  "aria-label": "Focus on this panel",
524
- children: /* @__PURE__ */ r(Lt, { size: 14 })
524
+ children: /* @__PURE__ */ r($e, { size: 14 })
525
525
  }
526
526
  )
527
527
  ] }),
528
- /* @__PURE__ */ r("div", { className: "floating-panel__body", children: d })
528
+ /* @__PURE__ */ r("div", { className: "floating-panel__body", children: h })
529
529
  ]
530
530
  }
531
531
  );
532
532
  });
533
- function we(t) {
534
- return M({ ...t, width: 0, height: 0 });
533
+ function xt(e) {
534
+ return P({ ...e, width: 0, height: 0 });
535
535
  }
536
- function ge(t, e = ut) {
537
- return { x: t.x, y: t.y + t.height + e };
536
+ function St(e, t = G) {
537
+ return { x: e.x, y: e.y + e.height + t };
538
538
  }
539
- function ye({
540
- open: t,
541
- title: e,
539
+ function kt({
540
+ open: e,
541
+ title: t,
542
542
  message: n,
543
- onConfirm: s,
544
- onCancel: a,
545
- confirmLabel: u = "Confirm",
546
- loadingLabel: h,
547
- loading: f,
548
- error: p
543
+ onConfirm: a,
544
+ onCancel: s,
545
+ confirmLabel: c = "Confirm",
546
+ loadingLabel: m,
547
+ loading: p,
548
+ error: f
549
549
  }) {
550
- return Y(() => {
551
- if (!t) return;
552
- const w = (d) => {
553
- d.key === "Escape" && a();
550
+ return F(() => {
551
+ if (!e) return;
552
+ const b = (h) => {
553
+ h.key === "Escape" && s();
554
554
  };
555
- return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
556
- }, [t, a]), !t || typeof document > "u" ? null : Yt(
557
- /* @__PURE__ */ r("div", { className: "confirm-modal-overlay", onMouseDown: a, children: /* @__PURE__ */ m(
555
+ return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
556
+ }, [e, s]), !e || typeof document > "u" ? null : Fe(
557
+ /* @__PURE__ */ r("div", { className: "confirm-modal-overlay", onMouseDown: s, children: /* @__PURE__ */ d(
558
558
  "div",
559
559
  {
560
560
  className: "confirm-modal",
561
561
  role: "dialog",
562
562
  "aria-modal": "true",
563
- "aria-label": e,
564
- onMouseDown: (w) => w.stopPropagation(),
563
+ "aria-label": t,
564
+ onMouseDown: (b) => b.stopPropagation(),
565
565
  children: [
566
- /* @__PURE__ */ m("div", { className: "confirm-modal__header", children: [
567
- /* @__PURE__ */ m("span", { className: "confirm-modal__title", children: [
568
- /* @__PURE__ */ r(Ot, { size: 16 }),
569
- e
566
+ /* @__PURE__ */ d("div", { className: "confirm-modal__header", children: [
567
+ /* @__PURE__ */ d("span", { className: "confirm-modal__title", children: [
568
+ /* @__PURE__ */ r(Ae, { size: 16 }),
569
+ t
570
570
  ] }),
571
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick: a, "aria-label": "Close dialog", children: /* @__PURE__ */ r(Nt, { size: 14 }) })
571
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary wb-btn--icon-only", onClick: s, "aria-label": "Close dialog", children: /* @__PURE__ */ r(Se, { size: 14 }) })
572
572
  ] }),
573
573
  /* @__PURE__ */ r("p", { className: "confirm-modal__message", children: n }),
574
- p && /* @__PURE__ */ r("div", { className: "wb-alert wb-alert--error", children: p }),
575
- /* @__PURE__ */ m("div", { className: "wb-btn-row", children: [
576
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary", onClick: a, children: "Cancel" }),
577
- /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--danger", onClick: s, disabled: f, children: f ? h ?? `${u}…` : /* @__PURE__ */ m(et, { children: [
578
- /* @__PURE__ */ r(At, { size: 14 }),
579
- u
574
+ f && /* @__PURE__ */ r("div", { className: "wb-alert wb-alert--error", children: f }),
575
+ /* @__PURE__ */ d("div", { className: "wb-btn-row", children: [
576
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--secondary", onClick: s, children: "Cancel" }),
577
+ /* @__PURE__ */ r("button", { type: "button", className: "wb-btn wb-btn--danger", onClick: a, disabled: p, children: p ? m ?? `${c}…` : /* @__PURE__ */ d(ne, { children: [
578
+ /* @__PURE__ */ r(Be, { size: 14 }),
579
+ c
580
580
  ] }) })
581
581
  ] })
582
582
  ]
@@ -585,15 +585,15 @@ function ye({
585
585
  document.body
586
586
  );
587
587
  }
588
- class ve extends Wt {
588
+ class Mt extends Xe {
589
589
  constructor() {
590
590
  super(...arguments), this.state = { error: null };
591
591
  }
592
- static getDerivedStateFromError(e) {
593
- return { error: e };
592
+ static getDerivedStateFromError(t) {
593
+ return { error: t };
594
594
  }
595
595
  render() {
596
- return this.state.error ? /* @__PURE__ */ m("div", { className: "wb-stack wb-stack--sm", children: [
596
+ return this.state.error ? /* @__PURE__ */ d("div", { className: "wb-stack wb-stack--sm", children: [
597
597
  /* @__PURE__ */ r("div", { className: "wb-alert wb-alert--error", children: this.props.fallbackMessage ?? "This panel crashed." }),
598
598
  /* @__PURE__ */ r(
599
599
  "button",
@@ -607,604 +607,850 @@ class ve extends Wt {
607
607
  ] }) : this.props.children;
608
608
  }
609
609
  }
610
- function Ne({
611
- widths: t,
612
- startX: e = 20,
610
+ function _t({
611
+ widths: e,
612
+ startX: t = 20,
613
613
  y: n = 40,
614
- gap: s = 20
614
+ gap: a = 20
615
615
  }) {
616
- const a = bt(() => {
617
- const f = {};
618
- for (const [p, w] of Object.entries(t))
619
- f[p] = ct(w);
620
- return f;
621
- }, [t]), u = bt(
616
+ const s = be(() => {
617
+ const p = {};
618
+ for (const [f, b] of Object.entries(e))
619
+ p[f] = le(b);
620
+ return p;
621
+ }, [e]), c = be(
622
622
  () => ({
623
- startX: ct(e),
624
- y: ct(n),
625
- gap: ct(s)
623
+ startX: le(t),
624
+ y: le(n),
625
+ gap: le(a)
626
626
  }),
627
- [e, n, s]
628
- ), h = bt(() => {
629
- const f = {};
630
- let p = u.startX;
631
- for (const [w, d] of Object.entries(a))
632
- f[w] = { x: p, y: u.y }, p += d + u.gap;
633
- return f;
634
- }, [u.gap, u.startX, u.y, a]);
635
- return { layout: u, panelWidth: a, positions: h };
636
- }
637
- function l(...t) {
638
- return t.filter(Boolean).join(" ");
639
- }
640
- const Zt = {
627
+ [t, n, a]
628
+ ), m = be(() => {
629
+ const p = {};
630
+ let f = c.startX;
631
+ for (const [b, h] of Object.entries(s))
632
+ p[b] = { x: f, y: c.y }, f += h + c.gap;
633
+ return p;
634
+ }, [c.gap, c.startX, c.y, s]);
635
+ return { layout: c, panelWidth: s, positions: m };
636
+ }
637
+ function i(...e) {
638
+ return e.filter(Boolean).join(" ");
639
+ }
640
+ const qe = {
641
641
  error: "wb-alert wb-alert--error",
642
642
  muted: "wb-alert wb-alert--muted",
643
643
  info: "wb-alert wb-alert--info",
644
644
  success: "wb-alert wb-alert--success"
645
645
  };
646
- function xe({ tone: t = "info", className: e, ...n }) {
647
- return /* @__PURE__ */ r("p", { className: l(Zt[t], e), ...n });
646
+ function Pt({ tone: e = "info", className: t, ...n }) {
647
+ return /* @__PURE__ */ r("p", { className: i(qe[e], t), ...n });
648
648
  }
649
- function Se({ className: t, ...e }) {
650
- return /* @__PURE__ */ r("span", { className: l("avatar-badge", t), ...e });
649
+ function Ct({ className: e, ...t }) {
650
+ return /* @__PURE__ */ r("span", { className: i("avatar-badge", e), ...t });
651
651
  }
652
- const Ut = {
652
+ const Je = {
653
653
  primary: "",
654
654
  secondary: "wb-btn--secondary",
655
655
  danger: "wb-btn--danger"
656
- }, xt = dt(function({
657
- variant: e = "primary",
656
+ }, ke = de(function({
657
+ variant: t = "primary",
658
658
  fullWidth: n = !1,
659
- iconOnly: s = !1,
660
- loading: a = !1,
661
- type: u = "button",
662
- disabled: h,
663
- className: f,
664
- children: p,
665
- loadingText: w,
666
- ...d
667
- }, N) {
659
+ iconOnly: a = !1,
660
+ loading: s = !1,
661
+ type: c = "button",
662
+ disabled: m,
663
+ className: p,
664
+ children: f,
665
+ loadingText: b,
666
+ ...h
667
+ }, w) {
668
668
  return /* @__PURE__ */ r(
669
669
  "button",
670
670
  {
671
- ref: N,
672
- type: u,
673
- className: l("wb-btn", Ut[e], n && "wb-btn--full-width", s && "wb-btn--icon-only", f),
674
- disabled: h || a,
675
- ...d,
676
- children: a ? /* @__PURE__ */ m(et, { children: [
677
- /* @__PURE__ */ r(ht, { size: 14, className: "icon-spin" }),
678
- w || p
679
- ] }) : p
671
+ ref: w,
672
+ type: c,
673
+ className: i("wb-btn", Je[t], n && "wb-btn--full-width", a && "wb-btn--icon-only", p),
674
+ disabled: m || s,
675
+ ...h,
676
+ children: s ? /* @__PURE__ */ d(ne, { children: [
677
+ /* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }),
678
+ b || f
679
+ ] }) : f
680
680
  }
681
681
  );
682
682
  });
683
- function qt({ as: t = "div", className: e, ...n }) {
684
- return W(t, {
685
- className: l("button-row", e),
683
+ function Ke({ as: e = "div", className: t, ...n }) {
684
+ return I(e, {
685
+ className: i("button-row", t),
686
686
  ...n
687
687
  });
688
688
  }
689
- function Me({ children: t, hint: e, className: n, ...s }) {
690
- return /* @__PURE__ */ r("div", { className: "canvas-wrap", children: /* @__PURE__ */ m("div", { className: l("canvas-stage", n), ...s, children: [
691
- t,
692
- e && /* @__PURE__ */ r("p", { className: "canvas-hint", children: e })
689
+ function zt({ children: e, hint: t, className: n, ...a }) {
690
+ return /* @__PURE__ */ r("div", { className: "canvas-wrap", children: /* @__PURE__ */ d("div", { className: i("canvas-stage", n), ...a, children: [
691
+ e,
692
+ t && /* @__PURE__ */ r("p", { className: "canvas-hint", children: t })
693
693
  ] }) });
694
694
  }
695
- function ke({ className: t, ...e }) {
696
- return /* @__PURE__ */ r("span", { className: l("chip", t), ...e });
695
+ function Tt({ label: e, hint: t, className: n, ...a }) {
696
+ return /* @__PURE__ */ d("label", { className: i("checkbox", n), children: [
697
+ /* @__PURE__ */ r("input", { type: "checkbox", className: "checkbox__input", ...a }),
698
+ e != null && /* @__PURE__ */ d("span", { className: "checkbox__text", children: [
699
+ e,
700
+ t != null && /* @__PURE__ */ d("span", { className: "checkbox__hint", children: [
701
+ " ",
702
+ t
703
+ ] })
704
+ ] })
705
+ ] });
706
+ }
707
+ function Rt({ label: e, hint: t, className: n, ...a }) {
708
+ return /* @__PURE__ */ d("label", { className: i("checkbox", "switch", n), children: [
709
+ /* @__PURE__ */ r("input", { type: "checkbox", role: "switch", className: "switch__input", ...a }),
710
+ /* @__PURE__ */ r("span", { className: "switch__track", "aria-hidden": "true", children: /* @__PURE__ */ r("span", { className: "switch__thumb" }) }),
711
+ e != null && /* @__PURE__ */ d("span", { className: "checkbox__text", children: [
712
+ e,
713
+ t != null && /* @__PURE__ */ d("span", { className: "checkbox__hint", children: [
714
+ " ",
715
+ t
716
+ ] })
717
+ ] })
718
+ ] });
719
+ }
720
+ function Dt({ className: e, ...t }) {
721
+ return /* @__PURE__ */ r("span", { className: i("chip", e), ...t });
697
722
  }
698
- function Kt({ active: t = !1, className: e, ...n }) {
723
+ function Qe({ active: e = !1, className: t, ...n }) {
699
724
  return /* @__PURE__ */ r(
700
725
  "button",
701
726
  {
702
727
  type: "button",
703
- className: l("choice-card", e),
704
- "data-active": t,
728
+ className: i("choice-card", t),
729
+ "data-active": e,
705
730
  ...n
706
731
  }
707
732
  );
708
733
  }
709
- function mt({ as: t = "ul", reset: e = !0, className: n, ...s }) {
710
- return W(t, {
711
- className: l(e && "list-reset", n),
712
- ...s
734
+ function me({ as: e = "ul", reset: t = !0, className: n, ...a }) {
735
+ return I(e, {
736
+ className: i(t && "list-reset", n),
737
+ ...a
713
738
  });
714
739
  }
715
- const Jt = {
740
+ const et = {
716
741
  sm: "",
717
742
  md: "skeleton--md",
718
743
  pill: "skeleton--pill"
719
744
  };
720
- function G({ as: t = "div", radius: e = "sm", className: n, ...s }) {
721
- return W(t, {
722
- className: l("skeleton", Jt[e], n),
745
+ function A({ as: e = "div", radius: t = "sm", className: n, ...a }) {
746
+ return I(e, {
747
+ className: i("skeleton", et[t], n),
723
748
  "aria-hidden": !0,
724
- ...s
749
+ ...a
725
750
  });
726
751
  }
727
- function Qt(t) {
728
- const { className: e, ...n } = t;
729
- return /* @__PURE__ */ r(G, { className: l("skeleton-input", e), ...n });
752
+ function tt(e) {
753
+ const { className: t, ...n } = e;
754
+ return /* @__PURE__ */ r(A, { className: i("skeleton-input", t), ...n });
730
755
  }
731
- function St(t) {
732
- const { className: e, ...n } = t;
733
- return /* @__PURE__ */ r(G, { className: l("skeleton-btn", e), ...n });
756
+ function Me(e) {
757
+ const { className: t, ...n } = e;
758
+ return /* @__PURE__ */ r(A, { className: i("skeleton-btn", t), ...n });
734
759
  }
735
- function Pe(t) {
736
- const { className: e, ...n } = t;
737
- return /* @__PURE__ */ r(G, { className: l("skeleton-icon-btn", e), ...n });
760
+ function It(e) {
761
+ const { className: t, ...n } = e;
762
+ return /* @__PURE__ */ r(A, { className: i("skeleton-icon-btn", t), ...n });
738
763
  }
739
- function _e(t) {
740
- const { className: e, ...n } = t;
741
- return /* @__PURE__ */ r(G, { className: l("skeleton-select", e), ...n });
764
+ function Xt(e) {
765
+ const { className: t, ...n } = e;
766
+ return /* @__PURE__ */ r(A, { className: i("skeleton-select", t), ...n });
742
767
  }
743
- function ze(t) {
744
- const { className: e, ...n } = t;
745
- return /* @__PURE__ */ r(G, { className: l("skeleton-textarea", e), ...n });
768
+ function Yt(e) {
769
+ const { className: t, ...n } = e;
770
+ return /* @__PURE__ */ r(A, { className: i("skeleton-textarea", t), ...n });
746
771
  }
747
- function Mt(t) {
748
- const { className: e, ...n } = t;
749
- return /* @__PURE__ */ r(G, { className: l("skeleton-thumb", e), ...n });
772
+ function _e(e) {
773
+ const { className: t, ...n } = e;
774
+ return /* @__PURE__ */ r(A, { className: i("skeleton-thumb", t), ...n });
750
775
  }
751
- function te(t) {
752
- const { className: e, ...n } = t;
753
- return /* @__PURE__ */ r(G, { radius: "pill", className: l("skeleton-chip", e), ...n });
776
+ function nt(e) {
777
+ const { className: t, ...n } = e;
778
+ return /* @__PURE__ */ r(A, { radius: "pill", className: i("skeleton-chip", t), ...n });
754
779
  }
755
- function kt(t) {
756
- const { className: e, ...n } = t;
757
- return /* @__PURE__ */ r(G, { className: l("skeleton-title", e), ...n });
780
+ function Pe(e) {
781
+ const { className: t, ...n } = e;
782
+ return /* @__PURE__ */ r(A, { className: i("skeleton-title", t), ...n });
758
783
  }
759
- function wt({ short: t = !1, className: e, ...n }) {
760
- return /* @__PURE__ */ r(G, { className: l("skeleton-line", t && "skeleton-line--short", e), ...n });
784
+ function ye({ short: e = !1, className: t, ...n }) {
785
+ return /* @__PURE__ */ r(A, { className: i("skeleton-line", e && "skeleton-line--short", t), ...n });
761
786
  }
762
- function Ce(t) {
763
- const { className: e, ...n } = t;
764
- return /* @__PURE__ */ r(G, { radius: "pill", className: l("skeleton-avatar", e), ...n });
787
+ function Ft(e) {
788
+ const { className: t, ...n } = e;
789
+ return /* @__PURE__ */ r(A, { radius: "pill", className: i("skeleton-avatar", t), ...n });
765
790
  }
766
- function Te(t) {
767
- const { className: e, ...n } = t;
768
- return /* @__PURE__ */ r(G, { className: l("skeleton-canvas", e), ...n });
791
+ function Wt(e) {
792
+ const { className: t, ...n } = e;
793
+ return /* @__PURE__ */ r(A, { className: i("skeleton-canvas", t), ...n });
769
794
  }
770
- function Re({
771
- options: t,
772
- value: e,
795
+ function Gt({
796
+ options: e,
797
+ value: t,
773
798
  onChange: n,
774
- className: s
799
+ className: a
775
800
  }) {
776
- return /* @__PURE__ */ r(mt, { className: l("choice-list", s), children: t.map((a) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
777
- Kt,
801
+ return /* @__PURE__ */ r(me, { className: i("choice-list", a), children: e.map((s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(
802
+ Qe,
778
803
  {
779
- active: e === a.value,
780
- onClick: () => n(a.value),
781
- disabled: a.disabled,
782
- "data-has-description": a.description ? "true" : "false",
783
- children: a.description ? /* @__PURE__ */ m("span", { className: "choice-card__row", children: [
784
- /* @__PURE__ */ r("span", { className: "choice-card__label", children: a.label }),
785
- /* @__PURE__ */ r("span", { className: "choice-card__description", children: a.description })
786
- ] }) : /* @__PURE__ */ r("span", { className: "choice-card__label", children: a.label })
804
+ active: t === s.value,
805
+ onClick: () => n(s.value),
806
+ disabled: s.disabled,
807
+ "data-has-description": s.description ? "true" : "false",
808
+ children: s.description ? /* @__PURE__ */ d("span", { className: "choice-card__row", children: [
809
+ /* @__PURE__ */ r("span", { className: "choice-card__label", children: s.label }),
810
+ /* @__PURE__ */ r("span", { className: "choice-card__description", children: s.description })
811
+ ] }) : /* @__PURE__ */ r("span", { className: "choice-card__label", children: s.label })
787
812
  }
788
- ) }, a.value)) });
813
+ ) }, s.value)) });
789
814
  }
790
- function We({ count: t = 4, className: e, withDescription: n = !1 }) {
791
- return /* @__PURE__ */ r(mt, { className: l("choice-list", e), "aria-hidden": !0, children: Array.from({ length: t }).map((s, a) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ m("div", { className: "choice-card", children: [
792
- /* @__PURE__ */ r(kt, { className: l("skeleton-title--sm", !n && "skeleton-choice-label") }),
793
- n ? /* @__PURE__ */ r(wt, { short: !0 }) : null
794
- ] }) }, `choice-skeleton-${a}`)) });
815
+ function Et({ count: e = 4, className: t, withDescription: n = !1 }) {
816
+ return /* @__PURE__ */ r(me, { className: i("choice-list", t), "aria-hidden": !0, children: Array.from({ length: e }).map((a, s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ d("div", { className: "choice-card", children: [
817
+ /* @__PURE__ */ r(Pe, { className: i("skeleton-title--sm", !n && "skeleton-choice-label") }),
818
+ n ? /* @__PURE__ */ r(ye, { short: !0 }) : null
819
+ ] }) }, `choice-skeleton-${s}`)) });
795
820
  }
796
- function Xe({ className: t, ...e }) {
797
- return /* @__PURE__ */ r("div", { className: l("coord-grid", t), ...e });
821
+ function Lt({ className: e, ...t }) {
822
+ return /* @__PURE__ */ r("div", { className: i("coord-grid", e), ...t });
798
823
  }
799
- function Ye({ axis: t, className: e, ...n }) {
800
- return /* @__PURE__ */ m("label", { className: l("coord-input", e), children: [
801
- t,
824
+ function Ot({ axis: e, className: t, ...n }) {
825
+ return /* @__PURE__ */ d("label", { className: i("coord-input", t), children: [
826
+ e,
802
827
  " ",
803
828
  /* @__PURE__ */ r("input", { type: "number", step: "0.01", ...n })
804
829
  ] });
805
830
  }
806
- function pt({
807
- as: t,
808
- size: e = "md",
831
+ function $t({ orientation: e = "horizontal", className: t, ...n }) {
832
+ return e === "vertical" ? /* @__PURE__ */ r(
833
+ "span",
834
+ {
835
+ role: "separator",
836
+ "aria-orientation": "vertical",
837
+ className: i("divider", "divider--vertical", t),
838
+ ...n
839
+ }
840
+ ) : /* @__PURE__ */ r("hr", { className: i("divider", t), ...n });
841
+ }
842
+ const xe = "button, input, select, textarea, canvas, a, label, audio, video, [contenteditable], [data-wb-nodrag]", ge = /* @__PURE__ */ new Map();
843
+ function At() {
844
+ for (const e of ge.values()) e();
845
+ }
846
+ function rt({
847
+ id: e,
848
+ snap: t = !0,
849
+ persist: n = !0,
850
+ disabled: a = !1,
851
+ className: s,
852
+ style: c,
853
+ children: m,
854
+ ...p
855
+ }) {
856
+ const [f, b] = we({ x: 0, y: 0 }), h = P(null), w = `wb-draggable:${e}`;
857
+ F(() => {
858
+ if (n)
859
+ try {
860
+ const N = localStorage.getItem(w);
861
+ if (N) {
862
+ const v = JSON.parse(N);
863
+ Number.isFinite(v == null ? void 0 : v.x) && Number.isFinite(v == null ? void 0 : v.y) && b(v);
864
+ }
865
+ } catch {
866
+ }
867
+ }, [w, n]);
868
+ const y = (N) => {
869
+ if (b(N), !!n)
870
+ try {
871
+ N.x === 0 && N.y === 0 ? localStorage.removeItem(w) : localStorage.setItem(w, JSON.stringify(N));
872
+ } catch {
873
+ }
874
+ };
875
+ F(() => {
876
+ const N = () => y({ x: 0, y: 0 });
877
+ ge.set(e, N);
878
+ const v = () => {
879
+ b((T) => ({
880
+ x: Math.round(T.x / G) * G,
881
+ y: Math.round(T.y / G) * G
882
+ }));
883
+ };
884
+ return window.addEventListener("whiteboard-snap-now", v), () => {
885
+ ge.delete(e), window.removeEventListener("whiteboard-snap-now", v);
886
+ };
887
+ }, [e, w]);
888
+ const z = (N) => {
889
+ var v, T;
890
+ a || N.button !== 0 || N.target.closest(xe) || (h.current = { sx: N.clientX, sy: N.clientY, bx: f.x, by: f.y }, (T = (v = N.currentTarget).setPointerCapture) == null || T.call(v, N.pointerId));
891
+ }, x = (N) => {
892
+ const v = h.current;
893
+ v && b({ x: v.bx + (N.clientX - v.sx), y: v.by + (N.clientY - v.sy) });
894
+ }, C = () => {
895
+ h.current && (h.current = null, b((v) => {
896
+ const T = t ? {
897
+ x: Math.round(v.x / G) * G,
898
+ y: Math.round(v.y / G) * G
899
+ } : v;
900
+ if (n)
901
+ try {
902
+ T.x === 0 && T.y === 0 ? localStorage.removeItem(w) : localStorage.setItem(w, JSON.stringify(T));
903
+ } catch {
904
+ }
905
+ return T;
906
+ }));
907
+ }, L = (N) => {
908
+ N.target.closest(xe) || y({ x: 0, y: 0 });
909
+ };
910
+ return /* @__PURE__ */ r(
911
+ "div",
912
+ {
913
+ className: i("draggable", a && "draggable--disabled", s),
914
+ style: {
915
+ ...c,
916
+ transform: `translate(${f.x}px, ${f.y}px)`
917
+ },
918
+ onPointerDown: z,
919
+ onPointerMove: x,
920
+ onPointerUp: C,
921
+ onPointerCancel: C,
922
+ onDoubleClick: L,
923
+ ...p,
924
+ children: m
925
+ }
926
+ );
927
+ }
928
+ function Bt({ padding: e = "md", className: t, ...n }) {
929
+ return /* @__PURE__ */ r(
930
+ rt,
931
+ {
932
+ className: i(
933
+ "surface",
934
+ e === "sm" && "surface--pad-sm",
935
+ e === "none" && "surface--pad-none",
936
+ t
937
+ ),
938
+ ...n
939
+ }
940
+ );
941
+ }
942
+ function fe({
943
+ as: e,
944
+ size: t = "md",
809
945
  className: n,
810
- ...s
946
+ ...a
811
947
  }) {
812
- return W(t ?? "div", {
813
- className: l(e === "sm" ? "panel-stack-sm" : "panel-stack", n),
814
- ...s
948
+ return I(e ?? "div", {
949
+ className: i(t === "sm" ? "panel-stack-sm" : "panel-stack", n),
950
+ ...a
815
951
  });
816
952
  }
817
- const ee = {
953
+ const at = {
818
954
  xs: "text-xs",
819
955
  sm: "text-sm",
820
956
  md: ""
821
957
  };
822
- function ne({ as: t = "p", clamp: e = !1, className: n, ...s }) {
823
- return W(t, {
824
- className: l("card-title", e && "card-title--clamp", n),
825
- ...s
958
+ function st({ as: e = "p", clamp: t = !1, className: n, ...a }) {
959
+ return I(e, {
960
+ className: i("card-title", t && "card-title--clamp", n),
961
+ ...a
826
962
  });
827
963
  }
828
- function De({ as: t = "h1", className: e, ...n }) {
829
- return W(t, {
830
- className: l("page-title", e),
964
+ function Ht({ as: e = "h1", className: t, ...n }) {
965
+ return I(e, {
966
+ className: i("page-title", t),
831
967
  ...n
832
968
  });
833
969
  }
834
- function re({ as: t = "span", className: e, ...n }) {
835
- return W(t, {
836
- className: l("widget-section__title", e),
970
+ function ot({ as: e = "span", className: t, ...n }) {
971
+ return I(e, {
972
+ className: i("widget-section__title", t),
837
973
  ...n
838
974
  });
839
975
  }
840
- function se({ as: t = "p", className: e, ...n }) {
841
- return W(t, {
842
- className: l("widget-section__description", e),
976
+ function it({ as: e = "p", className: t, ...n }) {
977
+ return I(e, {
978
+ className: i("widget-section__description", t),
843
979
  ...n
844
980
  });
845
981
  }
846
- function Pt({ as: t = "p", size: e = "sm", className: n, ...s }) {
847
- return W(t, {
848
- className: l(ee[e], "text-muted", n),
849
- ...s
982
+ function Ce({ as: e = "p", size: t = "sm", className: n, ...a }) {
983
+ return I(e, {
984
+ className: i(at[t], "text-muted", n),
985
+ ...a
850
986
  });
851
987
  }
852
- function Ie({ title: t, description: e, action: n }) {
853
- return /* @__PURE__ */ m(pt, { size: "sm", children: [
854
- /* @__PURE__ */ r(ne, { children: t }),
855
- e ? /* @__PURE__ */ r(Pt, { children: e }) : null,
988
+ function Vt({ title: e, description: t, action: n }) {
989
+ return /* @__PURE__ */ d(fe, { size: "sm", children: [
990
+ /* @__PURE__ */ r(st, { children: e }),
991
+ t ? /* @__PURE__ */ r(Ce, { children: t }) : null,
856
992
  n
857
993
  ] });
858
994
  }
859
- function ae({ className: t, ...e }) {
860
- return /* @__PURE__ */ r("label", { className: l("widget-label", t), ...e });
995
+ function ct({ className: e, ...t }) {
996
+ return /* @__PURE__ */ r("label", { className: i("widget-label", e), ...t });
861
997
  }
862
- function Fe({
863
- as: t,
864
- label: e,
998
+ function lt({
999
+ as: e,
1000
+ label: t,
865
1001
  htmlFor: n,
866
- hint: s,
867
- error: a,
868
- layout: u = "stack",
869
- className: h,
870
- children: f,
871
- ...p
1002
+ hint: a,
1003
+ error: s,
1004
+ layout: c = "stack",
1005
+ className: m,
1006
+ children: p,
1007
+ ...f
872
1008
  }) {
873
- return W(
874
- t ?? "div",
1009
+ return I(
1010
+ e ?? "div",
875
1011
  {
876
- className: l(u === "control" ? "widget-control" : "panel-stack-sm", h),
877
- ...p
1012
+ className: i(c === "control" ? "widget-control" : "panel-stack-sm", m),
1013
+ ...f
878
1014
  },
879
- /* @__PURE__ */ m(et, { children: [
880
- e ? /* @__PURE__ */ r(ae, { htmlFor: n, children: e }) : null,
881
- f,
882
- s ? /* @__PURE__ */ r(Pt, { size: "xs", children: s }) : null,
883
- a ? /* @__PURE__ */ r("p", { className: "field-error", children: a }) : null
1015
+ /* @__PURE__ */ d(ne, { children: [
1016
+ t ? /* @__PURE__ */ r(ct, { htmlFor: n, children: t }) : null,
1017
+ p,
1018
+ a ? /* @__PURE__ */ r(Ce, { size: "xs", children: a }) : null,
1019
+ s ? /* @__PURE__ */ r("p", { className: "field-error", children: s }) : null
884
1020
  ] })
885
1021
  );
886
1022
  }
887
- function Ge({ isGenerating: t, children: e, message: n }) {
888
- return /* @__PURE__ */ m("div", { className: "generating-overlay-wrap", children: [
889
- e,
890
- t && /* @__PURE__ */ m("div", { className: "generating-overlay", "aria-live": "polite", children: [
891
- /* @__PURE__ */ r(ht, { size: 20, className: "icon-spin" }),
1023
+ function jt({ isGenerating: e, children: t, message: n }) {
1024
+ return /* @__PURE__ */ d("div", { className: "generating-overlay-wrap", children: [
1025
+ t,
1026
+ e && /* @__PURE__ */ d("div", { className: "generating-overlay", "aria-live": "polite", children: [
1027
+ /* @__PURE__ */ r(he, { size: 20, className: "icon-spin" }),
892
1028
  /* @__PURE__ */ r("span", { children: n ?? "Generating, please wait…" })
893
1029
  ] })
894
1030
  ] });
895
1031
  }
896
- function Ee({ as: t = "span", icon: e, className: n, children: s, ...a }) {
897
- return W(
898
- t,
1032
+ function Zt({ as: e = "span", icon: t, className: n, children: a, ...s }) {
1033
+ return I(
1034
+ e,
899
1035
  {
900
- className: l("inline-row", n),
901
- ...a
1036
+ className: i("inline-row", n),
1037
+ ...s
902
1038
  },
903
- /* @__PURE__ */ m(et, { children: [
904
- e,
905
- s
1039
+ /* @__PURE__ */ d(ne, { children: [
1040
+ t,
1041
+ a
906
1042
  ] })
907
1043
  );
908
1044
  }
909
- function Le({
910
- src: t,
911
- alt: e,
1045
+ function Ut({
1046
+ src: e,
1047
+ alt: t,
912
1048
  placeholder: n = "No image",
913
- size: s = "md",
914
- fit: a = "contain",
915
- onImageError: u,
916
- className: h,
917
- ...f
1049
+ size: a = "md",
1050
+ fit: s = "contain",
1051
+ onImageError: c,
1052
+ className: m,
1053
+ ...p
918
1054
  }) {
919
- const [p, w] = vt(null), d = !!(t && p === t), N = l("image-thumb", `image-thumb--${s}`, `image-thumb--fit-${a}`, h);
920
- return /* @__PURE__ */ r("div", { className: N, ...f, children: t && !d ? /* @__PURE__ */ r(
1055
+ const [f, b] = we(null), h = !!(e && f === e), w = i("image-thumb", `image-thumb--${a}`, `image-thumb--fit-${s}`, m);
1056
+ return /* @__PURE__ */ r("div", { className: w, ...p, children: e && !h ? /* @__PURE__ */ r(
921
1057
  "img",
922
1058
  {
923
- src: t,
924
- alt: e,
1059
+ src: e,
1060
+ alt: t,
925
1061
  className: "image-thumb__img",
926
- style: { objectFit: a, objectPosition: "center" },
1062
+ style: { objectFit: s, objectPosition: "center" },
927
1063
  onError: () => {
928
- w(t), u == null || u();
1064
+ b(e), c == null || c();
929
1065
  }
930
1066
  }
931
1067
  ) : /* @__PURE__ */ r("span", { className: "image-thumb__placeholder", children: n }) });
932
1068
  }
933
- function Oe({
934
- as: t,
935
- justify: e = "start",
1069
+ function qt({
1070
+ as: e,
1071
+ justify: t = "start",
936
1072
  className: n,
937
- ...s
1073
+ ...a
938
1074
  }) {
939
- return W(t ?? "div", {
940
- className: l(e === "between" ? "space-between" : e === "end" ? "space-end" : "inline-row", n),
941
- ...s
1075
+ return I(e ?? "div", {
1076
+ className: i(t === "between" ? "space-between" : t === "end" ? "space-end" : "inline-row", n),
1077
+ ...a
942
1078
  });
943
1079
  }
944
- const Ae = dt(function({ className: e, ...n }, s) {
945
- return /* @__PURE__ */ r("input", { ref: s, className: l(e), ...n });
1080
+ const ut = de(function({ className: t, ...n }, a) {
1081
+ return /* @__PURE__ */ r("input", { ref: a, className: i(t), ...n });
946
1082
  });
947
- function ie({ as: t = "div", className: e, ...n }) {
948
- return W(t, {
949
- className: l("item-card", e),
1083
+ function dt({ as: e = "div", className: t, ...n }) {
1084
+ return I(e, {
1085
+ className: i("item-card", t),
950
1086
  ...n
951
1087
  });
952
1088
  }
953
- function $e({ as: t = "div", className: e, ...n }) {
954
- return W(t, {
955
- className: l("item-list", e),
1089
+ function Jt({ className: e, ...t }) {
1090
+ return /* @__PURE__ */ r("kbd", { className: i("kbd", e), ...t });
1091
+ }
1092
+ function Kt({ as: e = "div", className: t, ...n }) {
1093
+ return I(e, {
1094
+ className: i("item-list", t),
956
1095
  ...n
957
1096
  });
958
1097
  }
959
- function Be({ label: t = "Loading...", className: e }) {
960
- return /* @__PURE__ */ m("span", { className: l("status-inline", e), children: [
961
- /* @__PURE__ */ r(ht, { size: 14, className: "icon-spin" }),
962
- t
1098
+ function Qt({ label: e = "Loading...", className: t }) {
1099
+ return /* @__PURE__ */ d("span", { className: i("status-inline", t), children: [
1100
+ /* @__PURE__ */ r(he, { size: 14, className: "icon-spin" }),
1101
+ e
963
1102
  ] });
964
1103
  }
965
- function He({
966
- className: t,
967
- placement: e,
1104
+ function en({
1105
+ label: e,
1106
+ hint: t,
1107
+ value: n,
1108
+ onChange: a,
1109
+ min: s,
1110
+ max: c,
1111
+ step: m,
1112
+ id: p,
1113
+ className: f,
1114
+ ...b
1115
+ }) {
1116
+ const h = (w) => {
1117
+ let y = w;
1118
+ return s !== void 0 && (y = Math.max(Number(s), y)), c !== void 0 && (y = Math.min(Number(c), y)), y;
1119
+ };
1120
+ return /* @__PURE__ */ r(lt, { label: e, hint: t, htmlFor: p, className: i(f), children: /* @__PURE__ */ r(
1121
+ ut,
1122
+ {
1123
+ id: p,
1124
+ type: "number",
1125
+ inputMode: "decimal",
1126
+ min: s,
1127
+ max: c,
1128
+ step: m,
1129
+ value: n,
1130
+ onChange: (w) => {
1131
+ const y = Number(w.target.value);
1132
+ Number.isFinite(y) && a(h(y));
1133
+ },
1134
+ ...b
1135
+ }
1136
+ ) });
1137
+ }
1138
+ function tn({
1139
+ className: e,
1140
+ placement: t,
968
1141
  onPointerDown: n,
969
- onWheel: s,
970
- onContextMenu: a,
971
- ...u
1142
+ onWheel: a,
1143
+ onContextMenu: s,
1144
+ ...c
972
1145
  }) {
973
1146
  return /* @__PURE__ */ r(
974
- xt,
1147
+ ke,
975
1148
  {
976
1149
  variant: "secondary",
977
1150
  iconOnly: !0,
978
- className: l("overlay-icon-btn", e && `overlay-icon-btn--${e}`, t),
979
- onPointerDown: (h) => {
980
- h.stopPropagation(), n == null || n(h);
1151
+ className: i("overlay-icon-btn", t && `overlay-icon-btn--${t}`, e),
1152
+ onPointerDown: (m) => {
1153
+ m.stopPropagation(), n == null || n(m);
981
1154
  },
982
- onWheel: (h) => {
983
- h.stopPropagation(), s == null || s(h);
1155
+ onWheel: (m) => {
1156
+ m.stopPropagation(), a == null || a(m);
984
1157
  },
985
- onContextMenu: (h) => {
986
- h.stopPropagation(), a == null || a(h);
1158
+ onContextMenu: (m) => {
1159
+ m.stopPropagation(), s == null || s(m);
987
1160
  },
988
- ...u
1161
+ ...c
989
1162
  }
990
1163
  );
991
1164
  }
992
- function Ve({ children: t, className: e, ...n }) {
993
- return /* @__PURE__ */ r("main", { className: l("page-shell", e), ...n, children: t });
1165
+ function nn({ children: e, className: t, ...n }) {
1166
+ return /* @__PURE__ */ r("main", { className: i("page-shell", t), ...n, children: e });
994
1167
  }
995
- function je({ children: t, className: e, ...n }) {
996
- return /* @__PURE__ */ r("div", { className: l("page-card", e), ...n, children: t });
1168
+ function rn({ children: e, className: t, ...n }) {
1169
+ return /* @__PURE__ */ r("div", { className: i("page-card", t), ...n, children: e });
997
1170
  }
998
- function Ze({ onClick: t, label: e = "Close" }) {
999
- return /* @__PURE__ */ m(xt, { variant: "secondary", className: "panel-close-btn", onClick: t, children: [
1000
- /* @__PURE__ */ r(Nt, { size: 14 }),
1001
- e
1171
+ function an({ onClick: e, label: t = "Close" }) {
1172
+ return /* @__PURE__ */ d(ke, { variant: "secondary", className: "panel-close-btn", onClick: e, children: [
1173
+ /* @__PURE__ */ r(Se, { size: 14 }),
1174
+ t
1002
1175
  ] });
1003
1176
  }
1004
- function Ue({ heading: t, description: e, actions: n, className: s, children: a, ...u }) {
1005
- return /* @__PURE__ */ m("section", { className: l("widget-section", s), ...u, children: [
1006
- t || n ? /* @__PURE__ */ m("header", { className: n ? "title-row" : void 0, children: [
1007
- t ? /* @__PURE__ */ r(re, { children: t }) : null,
1177
+ function sn({ heading: e, description: t, actions: n, className: a, children: s, ...c }) {
1178
+ return /* @__PURE__ */ d("section", { className: i("widget-section", a), ...c, children: [
1179
+ e || n ? /* @__PURE__ */ d("header", { className: n ? "title-row" : void 0, children: [
1180
+ e ? /* @__PURE__ */ r(ot, { children: e }) : null,
1008
1181
  n
1009
1182
  ] }) : null,
1010
- e ? /* @__PURE__ */ r(se, { children: e }) : null,
1011
- a
1183
+ t ? /* @__PURE__ */ r(it, { children: t }) : null,
1184
+ s
1012
1185
  ] });
1013
1186
  }
1014
- function qe({ icon: t, label: e }) {
1015
- return /* @__PURE__ */ m("span", { className: "panel-title-with-icon", children: [
1016
- /* @__PURE__ */ r(t, { size: 13, className: "panel-title-icon" }),
1017
- /* @__PURE__ */ r("span", { children: e })
1187
+ function on({ icon: e, label: t }) {
1188
+ return /* @__PURE__ */ d("span", { className: "panel-title-with-icon", children: [
1189
+ /* @__PURE__ */ r(e, { size: 13, className: "panel-title-icon" }),
1190
+ /* @__PURE__ */ r("span", { children: t })
1018
1191
  ] });
1019
1192
  }
1020
- function oe({ as: t = "button", className: e, ...n }) {
1021
- return W(t, {
1022
- className: l("picker-card", e),
1193
+ function ht({ as: e = "button", className: t, ...n }) {
1194
+ return I(e, {
1195
+ className: i("picker-card", t),
1023
1196
  ...n
1024
1197
  });
1025
1198
  }
1026
- function Ke({ minItemWidth: t = 120, className: e, style: n, ...s }) {
1027
- const a = {
1028
- gridTemplateColumns: `repeat(auto-fill, minmax(${t}px, 1fr))`,
1199
+ function cn({ minItemWidth: e = 120, className: t, style: n, ...a }) {
1200
+ const s = {
1201
+ gridTemplateColumns: `repeat(auto-fill, minmax(${e}px, 1fr))`,
1029
1202
  ...n
1030
1203
  };
1031
- return /* @__PURE__ */ r(mt, { className: l("picker-grid", e), style: a, ...s });
1204
+ return /* @__PURE__ */ r(me, { className: i("picker-grid", t), style: s, ...a });
1032
1205
  }
1033
- const ce = {
1206
+ const mt = {
1034
1207
  default: "",
1035
1208
  success: "success",
1036
1209
  warning: "warning",
1037
1210
  danger: "danger"
1038
1211
  };
1039
- function Je({ tone: t = "default", className: e, ...n }) {
1040
- return /* @__PURE__ */ r("span", { className: l("pill", ce[t], e), ...n });
1212
+ function ln({ tone: e = "default", className: t, ...n }) {
1213
+ return /* @__PURE__ */ r("span", { className: i("pill", mt[e], t), ...n });
1214
+ }
1215
+ const un = de(function({ className: t, ...n }, a) {
1216
+ return /* @__PURE__ */ r("select", { ref: a, className: i(t), ...n });
1217
+ });
1218
+ function dn({ label: e, display: t, value: n, onChange: a, className: s, ...c }) {
1219
+ return /* @__PURE__ */ d("div", { className: i("slider", s), children: [
1220
+ (e != null || t != null) && /* @__PURE__ */ d("div", { className: "slider__head", children: [
1221
+ /* @__PURE__ */ r("span", { className: "widget-label", children: e }),
1222
+ /* @__PURE__ */ r("span", { className: "slider__value", children: t ?? n })
1223
+ ] }),
1224
+ /* @__PURE__ */ r(
1225
+ "input",
1226
+ {
1227
+ type: "range",
1228
+ className: "slider__input",
1229
+ value: n,
1230
+ onChange: (m) => a(Number(m.target.value)),
1231
+ ...c
1232
+ }
1233
+ )
1234
+ ] });
1041
1235
  }
1042
- const Qe = dt(function({ className: e, ...n }, s) {
1043
- return /* @__PURE__ */ r("select", { ref: s, className: l(e), ...n });
1044
- }), le = {
1236
+ const ft = {
1045
1237
  "media-content": "split-layout--media-content",
1046
1238
  single: "split-layout--single",
1047
1239
  "media-content-actions": "split-layout--media-content-actions"
1048
1240
  };
1049
- function tn({ variant: t, className: e, ...n }) {
1050
- return /* @__PURE__ */ r("div", { className: l("split-layout", le[t], e), ...n });
1241
+ function hn({ variant: e, className: t, ...n }) {
1242
+ return /* @__PURE__ */ r("div", { className: i("split-layout", ft[e], t), ...n });
1243
+ }
1244
+ function mn({ as: e, padding: t = "md", className: n, ...a }) {
1245
+ return I(e ?? "div", {
1246
+ className: i(
1247
+ "surface",
1248
+ t === "sm" && "surface--pad-sm",
1249
+ t === "none" && "surface--pad-none",
1250
+ n
1251
+ ),
1252
+ ...a
1253
+ });
1051
1254
  }
1052
- function ue({ className: t, ...e }) {
1053
- return /* @__PURE__ */ r("div", { className: l("tag-row", t), ...e });
1255
+ function pt({ className: e, ...t }) {
1256
+ return /* @__PURE__ */ r("div", { className: i("tag-row", e), ...t });
1054
1257
  }
1055
- const en = dt(function({ className: e, ...n }, s) {
1056
- return /* @__PURE__ */ r("textarea", { ref: s, className: l(e), ...n });
1258
+ const fn = de(function({ className: t, ...n }, a) {
1259
+ return /* @__PURE__ */ r("textarea", { ref: a, className: i(t), ...n });
1057
1260
  });
1058
- function nn({ className: t, theme: e = "light", onToggle: n, lightIcon: s, darkIcon: a }) {
1261
+ function pn({ className: e, theme: t = "light", onToggle: n, lightIcon: a, darkIcon: s }) {
1059
1262
  return /* @__PURE__ */ r(
1060
1263
  "button",
1061
1264
  {
1062
1265
  type: "button",
1063
- className: l("wb-btn", "wb-btn--secondary", "wb-btn--icon-only", t),
1266
+ className: i("wb-btn", "wb-btn--secondary", "wb-btn--icon-only", e),
1064
1267
  onClick: n,
1065
- title: `Switch to ${e === "light" ? "dark" : "light"} mode`,
1268
+ title: `Switch to ${t === "light" ? "dark" : "light"} mode`,
1066
1269
  "aria-label": "Toggle theme",
1067
- children: e === "light" ? a ?? /* @__PURE__ */ r($t, { size: 14 }) : s ?? /* @__PURE__ */ r(Bt, { size: 14 })
1270
+ children: t === "light" ? s ?? /* @__PURE__ */ r(He, { size: 14 }) : a ?? /* @__PURE__ */ r(Ve, { size: 14 })
1271
+ }
1272
+ );
1273
+ }
1274
+ function bn({ children: e, end: t, position: n = "top", className: a, ...s }) {
1275
+ return /* @__PURE__ */ d(
1276
+ "nav",
1277
+ {
1278
+ className: i(
1279
+ "toolbar",
1280
+ n === "bottom" && "toolbar--bottom",
1281
+ n === "static" && "toolbar--static",
1282
+ a
1283
+ ),
1284
+ ...s,
1285
+ children: [
1286
+ /* @__PURE__ */ r("div", { className: "toolbar__items", children: e }),
1287
+ t != null && /* @__PURE__ */ r("div", { className: "toolbar__end", children: t })
1288
+ ]
1068
1289
  }
1069
1290
  );
1070
1291
  }
1071
- function rn({ className: t, ...e }) {
1072
- return /* @__PURE__ */ r("div", { className: l("title-row", t), ...e });
1292
+ function gn({ label: e, placement: t = "top", className: n, children: a, ...s }) {
1293
+ return /* @__PURE__ */ d(
1294
+ "span",
1295
+ {
1296
+ className: i("tooltip", t === "bottom" && "tooltip--bottom", n),
1297
+ ...s,
1298
+ children: [
1299
+ a,
1300
+ /* @__PURE__ */ r("span", { role: "tooltip", className: "tooltip__bubble", children: e })
1301
+ ]
1302
+ }
1303
+ );
1304
+ }
1305
+ function wn({ className: e, ...t }) {
1306
+ return /* @__PURE__ */ r("div", { className: i("title-row", e), ...t });
1073
1307
  }
1074
- function sn({
1075
- children: t,
1076
- bottom: e,
1308
+ function yn({
1309
+ children: e,
1310
+ bottom: t,
1077
1311
  position: n = "left",
1078
- className: s,
1079
- ...a
1312
+ className: a,
1313
+ ...s
1080
1314
  }) {
1081
- return /* @__PURE__ */ m(
1315
+ return /* @__PURE__ */ d(
1082
1316
  "nav",
1083
1317
  {
1084
- className: l(
1318
+ className: i(
1085
1319
  "vertical-toolbar",
1086
1320
  n === "right" && "vertical-toolbar--right",
1087
1321
  n === "static" && "vertical-toolbar--static",
1088
- s
1322
+ a
1089
1323
  ),
1090
- ...a,
1324
+ ...s,
1091
1325
  children: [
1092
- /* @__PURE__ */ r("div", { className: "vertical-toolbar__links", children: t }),
1093
- e
1326
+ /* @__PURE__ */ r("div", { className: "vertical-toolbar__links", children: e }),
1327
+ t
1094
1328
  ]
1095
1329
  }
1096
1330
  );
1097
1331
  }
1098
- function an({ inputs: t = 1, showButton: e = !0, className: n, ...s }) {
1099
- return /* @__PURE__ */ m(pt, { className: n, ...s, children: [
1100
- Array.from({ length: t }).map((a, u) => /* @__PURE__ */ r(Qt, {}, `panel-form-input-${u}`)),
1101
- e && /* @__PURE__ */ r(St, {})
1332
+ function vn({ inputs: e = 1, showButton: t = !0, className: n, ...a }) {
1333
+ return /* @__PURE__ */ d(fe, { className: n, ...a, children: [
1334
+ Array.from({ length: e }).map((s, c) => /* @__PURE__ */ r(tt, {}, `panel-form-input-${c}`)),
1335
+ t && /* @__PURE__ */ r(Me, {})
1102
1336
  ] });
1103
1337
  }
1104
- function on({
1105
- withThumb: t = !0,
1106
- chipCount: e = 0,
1338
+ function Nn({
1339
+ withThumb: e = !0,
1340
+ chipCount: t = 0,
1107
1341
  actionCount: n = 0,
1108
- className: s,
1109
- ...a
1342
+ className: a,
1343
+ ...s
1110
1344
  }) {
1111
- return /* @__PURE__ */ m(ie, { as: "li", className: s, ...a, children: [
1112
- /* @__PURE__ */ m(pt, { size: "sm", children: [
1113
- t ? /* @__PURE__ */ r(Mt, {}) : null,
1114
- e > 0 ? /* @__PURE__ */ r(ue, { children: Array.from({ length: e }).map((u, h) => /* @__PURE__ */ r(te, {}, `card-skeleton-chip-${h}`)) }) : null,
1115
- /* @__PURE__ */ r(kt, {}),
1116
- /* @__PURE__ */ r(wt, { short: !0 })
1345
+ return /* @__PURE__ */ d(dt, { as: "li", className: a, ...s, children: [
1346
+ /* @__PURE__ */ d(fe, { size: "sm", children: [
1347
+ e ? /* @__PURE__ */ r(_e, {}) : null,
1348
+ t > 0 ? /* @__PURE__ */ r(pt, { children: Array.from({ length: t }).map((c, m) => /* @__PURE__ */ r(nt, {}, `card-skeleton-chip-${m}`)) }) : null,
1349
+ /* @__PURE__ */ r(Pe, {}),
1350
+ /* @__PURE__ */ r(ye, { short: !0 })
1117
1351
  ] }),
1118
- n > 0 ? /* @__PURE__ */ r(qt, { children: Array.from({ length: n }).map((u, h) => /* @__PURE__ */ r(St, {}, `card-skeleton-btn-${h}`)) }) : null
1352
+ n > 0 ? /* @__PURE__ */ r(Ke, { children: Array.from({ length: n }).map((c, m) => /* @__PURE__ */ r(Me, {}, `card-skeleton-btn-${m}`)) }) : null
1119
1353
  ] });
1120
1354
  }
1121
- function cn({ count: t = 8, minItemWidth: e = 120 }) {
1355
+ function xn({ count: e = 8, minItemWidth: t = 120 }) {
1122
1356
  return /* @__PURE__ */ r(
1123
- mt,
1357
+ me,
1124
1358
  {
1125
1359
  className: "picker-grid",
1126
- style: { gridTemplateColumns: `repeat(auto-fill, minmax(${e}px, 1fr))` },
1127
- children: Array.from({ length: t }).map((n, s) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(oe, { as: "div", className: "picker-card--skeleton", children: /* @__PURE__ */ m(pt, { size: "sm", children: [
1128
- /* @__PURE__ */ r(Mt, {}),
1129
- /* @__PURE__ */ r(wt, { short: !0 })
1130
- ] }) }) }, `picker-skeleton-${s}`))
1360
+ style: { gridTemplateColumns: `repeat(auto-fill, minmax(${t}px, 1fr))` },
1361
+ children: Array.from({ length: e }).map((n, a) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(ht, { as: "div", className: "picker-card--skeleton", children: /* @__PURE__ */ d(fe, { size: "sm", children: [
1362
+ /* @__PURE__ */ r(_e, {}),
1363
+ /* @__PURE__ */ r(ye, { short: !0 })
1364
+ ] }) }) }, `picker-skeleton-${a}`))
1131
1365
  }
1132
1366
  );
1133
1367
  }
1134
1368
  export {
1135
- xe as Alert,
1136
- Se as AvatarBadge,
1137
- Ce as AvatarSkeleton,
1138
- xt as Button,
1139
- qt as ButtonRow,
1140
- St as ButtonSkeleton,
1141
- Te as CanvasSkeleton,
1142
- Me as CanvasStage,
1143
- on as CardSkeleton,
1144
- ne as CardTitle,
1145
- ke as Chip,
1146
- te as ChipSkeleton,
1147
- Kt as ChoiceCard,
1148
- Re as ChoiceGroup,
1149
- We as ChoiceGroupSkeleton,
1150
- ye as ConfirmDialog,
1151
- Xe as CoordGrid,
1152
- Ye as CoordInput,
1153
- Ie as EmptyState,
1154
- Fe as Field,
1155
- be as FloatingPanel,
1156
- Ge as GeneratingOverlay,
1157
- Pe as IconButtonSkeleton,
1158
- Ee as IconText,
1159
- Le as ImageThumb,
1160
- Oe as Inline,
1161
- Ae as Input,
1162
- Qt as InputSkeleton,
1163
- ie as ItemCard,
1164
- $e as ItemList,
1165
- ae as Label,
1166
- wt as LineSkeleton,
1167
- mt as List,
1168
- Be as LoadingState,
1169
- jt as Minimap,
1170
- Pt as MutedText,
1171
- He as OverlayIconButton,
1172
- je as PageCard,
1173
- Ve as PageShell,
1174
- De as PageTitle,
1175
- Ze as PanelCloseButton,
1176
- ve as PanelErrorBoundary,
1177
- an as PanelFormSkeleton,
1178
- Ue as PanelSection,
1179
- qe as PanelTitle,
1180
- oe as PickerCard,
1181
- Ke as PickerGrid,
1182
- cn as PickerGridSkeleton,
1183
- Je as Pill,
1184
- se as SectionDescription,
1185
- re as SectionTitle,
1186
- Qe as Select,
1187
- _e as SelectSkeleton,
1188
- G as Skeleton,
1189
- tn as SplitLayout,
1190
- pt as Stack,
1191
- ue as TagRow,
1192
- en as Textarea,
1193
- ze as TextareaSkeleton,
1194
- nn as ThemeToggle,
1195
- Mt as ThumbSkeleton,
1196
- rn as TitleRow,
1197
- kt as TitleSkeleton,
1198
- sn as VerticalToolbar,
1199
- ut as WHITEBOARD_GRID,
1200
- fe as WhiteboardShell,
1201
- Vt as ZoomBar,
1202
- ge as belowPanel,
1203
- l as cn,
1204
- gt as computeWhiteboardFit,
1205
- Ht as computeWhiteboardRectFocus,
1206
- ct as snapToWhiteboardGrid,
1207
- we as usePanelRect,
1208
- Ne as useWhiteboardLayout,
1209
- b as useWhiteboardStore
1369
+ Pt as Alert,
1370
+ Ct as AvatarBadge,
1371
+ Ft as AvatarSkeleton,
1372
+ ke as Button,
1373
+ Ke as ButtonRow,
1374
+ Me as ButtonSkeleton,
1375
+ Wt as CanvasSkeleton,
1376
+ zt as CanvasStage,
1377
+ Nn as CardSkeleton,
1378
+ st as CardTitle,
1379
+ Tt as Checkbox,
1380
+ Dt as Chip,
1381
+ nt as ChipSkeleton,
1382
+ Qe as ChoiceCard,
1383
+ Gt as ChoiceGroup,
1384
+ Et as ChoiceGroupSkeleton,
1385
+ kt as ConfirmDialog,
1386
+ Lt as CoordGrid,
1387
+ Ot as CoordInput,
1388
+ $t as Divider,
1389
+ rt as Draggable,
1390
+ Bt as DraggableSurface,
1391
+ Vt as EmptyState,
1392
+ lt as Field,
1393
+ Nt as FloatingPanel,
1394
+ jt as GeneratingOverlay,
1395
+ It as IconButtonSkeleton,
1396
+ Zt as IconText,
1397
+ Ut as ImageThumb,
1398
+ qt as Inline,
1399
+ ut as Input,
1400
+ tt as InputSkeleton,
1401
+ dt as ItemCard,
1402
+ Kt as ItemList,
1403
+ Jt as Kbd,
1404
+ ct as Label,
1405
+ ye as LineSkeleton,
1406
+ me as List,
1407
+ Qt as LoadingState,
1408
+ Ue as Minimap,
1409
+ Ce as MutedText,
1410
+ en as NumberField,
1411
+ tn as OverlayIconButton,
1412
+ rn as PageCard,
1413
+ nn as PageShell,
1414
+ Ht as PageTitle,
1415
+ an as PanelCloseButton,
1416
+ Mt as PanelErrorBoundary,
1417
+ vn as PanelFormSkeleton,
1418
+ sn as PanelSection,
1419
+ on as PanelTitle,
1420
+ ht as PickerCard,
1421
+ cn as PickerGrid,
1422
+ xn as PickerGridSkeleton,
1423
+ ln as Pill,
1424
+ it as SectionDescription,
1425
+ ot as SectionTitle,
1426
+ un as Select,
1427
+ Xt as SelectSkeleton,
1428
+ A as Skeleton,
1429
+ dn as Slider,
1430
+ hn as SplitLayout,
1431
+ fe as Stack,
1432
+ mn as Surface,
1433
+ Rt as Switch,
1434
+ pt as TagRow,
1435
+ fn as Textarea,
1436
+ Yt as TextareaSkeleton,
1437
+ pn as ThemeToggle,
1438
+ _e as ThumbSkeleton,
1439
+ wn as TitleRow,
1440
+ Pe as TitleSkeleton,
1441
+ bn as Toolbar,
1442
+ gn as Tooltip,
1443
+ yn as VerticalToolbar,
1444
+ G as WHITEBOARD_GRID,
1445
+ vt as WhiteboardShell,
1446
+ Ze as ZoomBar,
1447
+ St as belowPanel,
1448
+ i as cn,
1449
+ ve as computeWhiteboardFit,
1450
+ je as computeWhiteboardRectFocus,
1451
+ At as resetDraggables,
1452
+ le as snapToWhiteboardGrid,
1453
+ xt as usePanelRect,
1454
+ _t as useWhiteboardLayout,
1455
+ g as useWhiteboardStore
1210
1456
  };