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