@diamondlightsource/davidia 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +40 -2
  2. package/dist/index.js +1276 -1277
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,42 +1,42 @@
1
- var Qt = Object.defineProperty;
2
- var Jt = (e, o, t) => o in e ? Qt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
- var A = (e, o, t) => Jt(e, typeof o != "symbol" ? o + "" : o, t);
4
- import { jsx as l, Fragment as te, jsxs as S } from "react/jsx-runtime";
5
- import wt from "afterframe";
6
- import { useRef as Z, useCallback as ne, useMemo as F, useEffect as E, useState as M, createContext as en, useContext as tn, Fragment as ye } from "react";
7
- import { useVisCanvasContext as it, useModifierKeyPressed as nn, useInteraction as on, MouseButton as an, useCanvasEvent as je, assertDefined as Xe, Box as sn, SvgElement as Ze, DataToHtml as ln, ScaleType as Te, ToggleBtn as Re, ToggleGroup as Y, useVisDomain as rn, useSafeDomain as cn, DomainSlider as un, Histogram as dn, DomainControls as hn, ScaleSelector as mn, ColorMapSelector as fn, ColorMapGradient as gn, Btn as He, Selector as yn, AXIS_SCALE_TYPES as ht, Separator as Le, COLOR_SCALE_TYPES as pn, Toolbar as at, HeatmapVis as bn, getVisDomain as Oe, RgbVis as Sn, VisCanvas as Cn, DefaultInteractions as vn, TooltipMesh as xn, ResetZoomButton as Pn, CurveType as Qe, DataCurve as wn, GlyphType as Dn, ScatterVis as Mn, SurfaceVis as _n, CellWidthInput as Tn, MatrixVis as Ln } from "@h5web/lib";
8
- import { GlyphType as La, ScaleType as ka } from "@h5web/lib";
1
+ var Jt = Object.defineProperty;
2
+ var en = (e, n, t) => n in e ? Jt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var A = (e, n, t) => en(e, typeof n != "symbol" ? n + "" : n, t);
4
+ import { jsx as l, Fragment as ee, jsxs as S } from "react/jsx-runtime";
5
+ import Dt from "afterframe";
6
+ import { useRef as X, useCallback as te, useMemo as F, useEffect as z, useState as D, createContext as tn, useContext as nn, Fragment as ye } from "react";
7
+ import { useVisCanvasContext as at, useModifierKeyPressed as on, useInteraction as an, MouseButton as sn, useCanvasEvent as je, assertDefined as Xe, Box as ln, SvgElement as Ze, DataToHtml as rn, ScaleType as _e, ToggleBtn as Re, ToggleGroup as W, useVisDomain as cn, useSafeDomain as un, DomainSlider as dn, Histogram as hn, DomainControls as mn, ScaleSelector as fn, ColorMapSelector as gn, ColorMapGradient as yn, Btn as He, Selector as pn, AXIS_SCALE_TYPES as mt, Separator as Te, COLOR_SCALE_TYPES as bn, Toolbar as st, HeatmapVis as Sn, getVisDomain as Oe, RgbVis as vn, VisCanvas as Cn, DefaultInteractions as xn, TooltipMesh as Pn, ResetZoomButton as wn, CurveType as Qe, DataCurve as Dn, GlyphType as Mn, ScatterVis as _n, SurfaceVis as Tn, CellWidthInput as Ln, MatrixVis as kn } from "@h5web/lib";
8
+ import { GlyphType as ka, ScaleType as Aa } from "@h5web/lib";
9
9
  import ze from "ndarray";
10
- import mt from "ndarray-concat-rows";
11
- import kn from "cwise";
12
- import { bin as An } from "d3-array";
13
- import { scaleLinear as Vn } from "d3-scale";
14
- import { Vector3 as D, Matrix3 as $e } from "three";
15
- import { useThree as st } from "@react-three/fiber";
16
- import { useSyncedRef as _e, useRafState as In, useKeyboardEvent as Be, usePrevious as ft, useToggle as Fe, useClickOutside as Dt } from "@react-hookz/web";
10
+ import ft from "ndarray-concat-rows";
11
+ import An from "cwise";
12
+ import { bin as Vn } from "d3-array";
13
+ import { scaleLinear as In } from "d3-scale";
14
+ import { Vector3 as w, Matrix3 as Ne } from "three";
15
+ import { useThree as lt } from "@react-three/fiber";
16
+ import { useSyncedRef as Me, useRafState as $n, useKeyboardEvent as Be, usePrevious as gt, useToggle as Fe, useClickOutside as Mt } from "@react-hookz/web";
17
17
  import { Drag as Nn } from "@visx/drag";
18
- import { BsSlashLg as $n, BsCardHeading as Fn } from "react-icons/bs";
19
- import { MdAspectRatio as On, MdHorizontalRule as Bn, MdOutlineRectangle as zn, MdOutlinePolyline as En, MdOutlineShapeLine as Rn, MdGridOn as Hn } from "react-icons/md";
20
- import { TbZoomPan as Kn, TbZoomInArea as Un, TbPolygon as qn, TbCircle as Gn, TbOvalVertical as Wn, TbQuestionMark as Yn, TbAxisX as jn, TbAxisY as Xn, TbGridDots as Zn } from "react-icons/tb";
18
+ import { BsSlashLg as Fn, BsCardHeading as On } from "react-icons/bs";
19
+ import { MdAspectRatio as Bn, MdHorizontalRule as zn, MdOutlineRectangle as En, MdOutlinePolyline as Rn, MdOutlineShapeLine as Hn, MdGridOn as Kn } from "react-icons/md";
20
+ import { TbZoomPan as Un, TbZoomInArea as qn, TbPolygon as Gn, TbCircle as Wn, TbOvalVertical as Yn, TbQuestionMark as jn, TbAxisX as Xn, TbAxisY as Zn, TbGridDots as Qn } from "react-icons/tb";
21
21
  import "@h5web/lib/dist/styles.css";
22
- import { IoMdUndo as Qn } from "react-icons/io";
23
- import Mt from "react-draggable";
24
- import { format as Jn } from "d3-format";
25
- import { HiCursorClick as eo } from "react-icons/hi";
26
- import { IoShapesOutline as to } from "react-icons/io5";
27
- import { HexColorPicker as _t } from "react-colorful";
28
- import { FaCircle as no } from "react-icons/fa";
29
- import { RxCross1 as oo } from "react-icons/rx";
30
- import { FaSquareFull as io } from "react-icons/fa6";
31
- import Tt from "react-select";
32
- import { AiOutlineColumnWidth as ao, AiOutlineColumnHeight as so } from "react-icons/ai";
33
- import { BiCircleQuarter as lo } from "react-icons/bi";
34
- import { ArcballControls as ro } from "@react-three/drei";
35
- import { encode as co, decode as uo } from "messagepack";
36
- import ho, { ReadyState as Ne } from "react-use-websocket";
37
- import { toast as gt } from "react-toastify";
22
+ import { IoMdUndo as Jn } from "react-icons/io";
23
+ import _t from "react-draggable";
24
+ import { format as eo } from "d3-format";
25
+ import { HiCursorClick as to } from "react-icons/hi";
26
+ import { IoShapesOutline as no } from "react-icons/io5";
27
+ import { HexColorPicker as Tt } from "react-colorful";
28
+ import { FaCircle as oo } from "react-icons/fa";
29
+ import { RxCross1 as io } from "react-icons/rx";
30
+ import { FaSquareFull as ao } from "react-icons/fa6";
31
+ import Lt from "react-select";
32
+ import { AiOutlineColumnWidth as so, AiOutlineColumnHeight as lo } from "react-icons/ai";
33
+ import { BiCircleQuarter as ro } from "react-icons/bi";
34
+ import { ArcballControls as co } from "@react-three/drei";
35
+ import { encode as uo, decode as ho } from "messagepack";
36
+ import mo, { ReadyState as $e } from "react-use-websocket";
37
+ import { toast as yt } from "react-toastify";
38
38
  import "react-toastify/dist/ReactToastify.css";
39
- const Lt = kn({
39
+ const kt = An({
40
40
  funcName: "nanMinMax",
41
41
  args: ["array"],
42
42
  pre: function() {
@@ -51,26 +51,26 @@ const Lt = kn({
51
51
  return [this.min, this.max];
52
52
  }
53
53
  });
54
- function mo(e, o) {
55
- if (o == null) {
54
+ function fo(e, n) {
55
+ if (n == null) {
56
56
  if (e === void 0)
57
57
  throw Error("Cannot call with both arguments falsy");
58
58
  return e;
59
59
  }
60
60
  if (e === void 0)
61
- return o;
61
+ return n;
62
62
  let t;
63
- const n = o.x.size, i = o.y.size;
64
- if (n === i || n === i + 1)
65
- t = mt([e.x, o.x]);
63
+ const o = n.x.size, i = n.y.size;
64
+ if (o === i || o === i + 1)
65
+ t = ft([e.x, n.x]);
66
66
  else
67
67
  return console.log(
68
68
  "x ({$xLength}) and y ({$yLength}) axes must be same length",
69
- o
69
+ n
70
70
  ), e;
71
- const a = mt([e.y, o.y]), s = Lt(t), u = [
72
- Math.min(e.yDomain[0], o.yDomain[0]),
73
- Math.max(e.yDomain[1], o.yDomain[1])
71
+ const a = ft([e.y, n.y]), s = kt(t), u = [
72
+ Math.min(e.yDomain[0], n.yDomain[0]),
73
+ Math.max(e.yDomain[1], n.yDomain[1])
74
74
  ];
75
75
  return {
76
76
  key: e.key,
@@ -82,23 +82,23 @@ function mo(e, o) {
82
82
  yDomain: u
83
83
  };
84
84
  }
85
- function fo(e) {
86
- const o = e.map((n) => n.xDomain[0]), t = e.map((n) => n.xDomain[1]);
87
- return o.length == 1 ? [o[0], t[0]] : [Math.min(...o), Math.max(...t)];
88
- }
89
85
  function go(e) {
90
- const o = e.map((n) => n.yDomain[0]), t = e.map((n) => n.yDomain[1]);
91
- return o.length == 1 ? [o[0], t[0]] : [Math.min(...o), Math.max(...t)];
86
+ const n = e.map((o) => o.xDomain[0]), t = e.map((o) => o.xDomain[1]);
87
+ return n.length == 1 ? [n[0], t[0]] : [Math.min(...n), Math.max(...t)];
92
88
  }
93
89
  function yo(e) {
94
- const o = e.values, t = re(o);
95
- if (kt(e)) {
96
- const n = e;
90
+ const n = e.map((o) => o.yDomain[0]), t = e.map((o) => o.yDomain[1]);
91
+ return n.length == 1 ? [n[0], t[0]] : [Math.min(...n), Math.max(...t)];
92
+ }
93
+ function po(e) {
94
+ const n = e.values, t = re(n);
95
+ if (At(e)) {
96
+ const o = e;
97
97
  return {
98
- domain: n.domain,
99
- heatmapScale: n.heatmapScale,
100
- colourMap: n.colourMap ?? void 0,
101
- aspect: n.aspect ?? void 0,
98
+ domain: o.domain,
99
+ heatmapScale: o.heatmapScale,
100
+ colourMap: o.colourMap ?? void 0,
101
+ aspect: o.aspect ?? void 0,
102
102
  values: t[0]
103
103
  };
104
104
  } else
@@ -108,16 +108,16 @@ function yo(e) {
108
108
  values: t[0]
109
109
  };
110
110
  }
111
- function po(e) {
112
- const o = e.heightValues, t = re(o);
111
+ function bo(e) {
112
+ const n = e.heightValues, t = re(n);
113
113
  return {
114
114
  ...e,
115
115
  surfaceScale: e.surfaceScale ?? void 0,
116
116
  heightValues: t[0]
117
117
  };
118
118
  }
119
- function bo(e) {
120
- const o = e.cellValues, t = re(o);
119
+ function So(e) {
120
+ const n = e.cellValues, t = re(n);
121
121
  return {
122
122
  ...e,
123
123
  displayParams: e.displayParams ?? void 0,
@@ -125,15 +125,15 @@ function bo(e) {
125
125
  };
126
126
  }
127
127
  function Ee(e) {
128
- let o, t;
129
- return (e == null ? void 0 : e.xValues) != null && (o = re(e.xValues)[0]), (e == null ? void 0 : e.yValues) != null && (t = re(e.yValues)[0]), {
128
+ let n, t;
129
+ return (e == null ? void 0 : e.xValues) != null && (n = re(e.xValues)[0]), (e == null ? void 0 : e.yValues) != null && (t = re(e.yValues)[0]), {
130
130
  ...e,
131
- xValues: o,
131
+ xValues: n,
132
132
  yValues: t
133
133
  };
134
134
  }
135
- function yt(e) {
136
- const o = e.x, t = re(o, !0), n = e.y, i = re(n, !0);
135
+ function pt(e) {
136
+ const n = e.x, t = re(n, !0), o = e.y, i = re(o, !0);
137
137
  return i[0].size == 0 ? null : {
138
138
  key: e.key,
139
139
  lineParams: e.lineParams,
@@ -143,8 +143,8 @@ function yt(e) {
143
143
  yDomain: i[1]
144
144
  };
145
145
  }
146
- function So(e) {
147
- const o = e.pointValues, t = re(o), n = e.x, i = re(n), a = e.y, s = re(a);
146
+ function vo(e) {
147
+ const n = e.pointValues, t = re(n), o = e.x, i = re(o), a = e.y, s = re(a);
148
148
  return {
149
149
  ...e,
150
150
  x: i[0],
@@ -152,12 +152,12 @@ function So(e) {
152
152
  pointValues: t[0]
153
153
  };
154
154
  }
155
- function re(e, o = !1) {
155
+ function re(e, n = !1) {
156
156
  if (e.shape.length === 0 || e.shape[0] === 0)
157
157
  return [ze(new Int8Array()), [0, 0]];
158
158
  const t = e.dtype;
159
159
  if (t === "<i8" || t === "<u8") {
160
- if (!o) {
160
+ if (!n) {
161
161
  const d = t === "<i8" ? new BigInt64Array(e.data) : new BigUint64Array(e.data), h = new Float64Array(d);
162
162
  return [ze(h, e.shape), [0, 0]];
163
163
  }
@@ -186,85 +186,85 @@ function re(e, o = !1) {
186
186
  [Number(s[0]), Number(s[1])]
187
187
  ];
188
188
  }
189
- let n;
189
+ let o;
190
190
  switch (t) {
191
191
  case "|i1":
192
- n = new Int8Array(e.data);
192
+ o = new Int8Array(e.data);
193
193
  break;
194
194
  case "<i2":
195
- n = new Int16Array(e.data);
195
+ o = new Int16Array(e.data);
196
196
  break;
197
197
  case "<i4":
198
- n = new Int32Array(e.data);
198
+ o = new Int32Array(e.data);
199
199
  break;
200
200
  case "|u1":
201
- n = new Uint8Array(e.data);
201
+ o = new Uint8Array(e.data);
202
202
  break;
203
203
  case "<u2":
204
- n = new Uint16Array(e.data);
204
+ o = new Uint16Array(e.data);
205
205
  break;
206
206
  case "<u4":
207
- n = new Uint32Array(e.data);
207
+ o = new Uint32Array(e.data);
208
208
  break;
209
209
  case "<f4":
210
- n = new Float32Array(e.data);
210
+ o = new Float32Array(e.data);
211
211
  break;
212
212
  default:
213
213
  case "<f8":
214
- n = new Float64Array(e.data);
214
+ o = new Float64Array(e.data);
215
215
  break;
216
216
  }
217
- const i = ze(n, e.shape);
218
- return [i, o ? Lt(i) : [0, 0]];
217
+ const i = ze(o, e.shape);
218
+ return [i, n ? kt(i) : [0, 0]];
219
219
  }
220
- function kt(e) {
220
+ function At(e) {
221
221
  return "domain" in e && "heatmapScale" in e;
222
222
  }
223
223
  function Co(e) {
224
- return kt(e);
224
+ return At(e);
225
225
  }
226
- function vo(e) {
226
+ function xo(e) {
227
227
  return e === "equal" || e === "auto" ? e : "number";
228
228
  }
229
229
  function he(e) {
230
- const o = parseFloat(e);
231
- return [Number.isFinite(o), o];
230
+ const n = parseFloat(e);
231
+ return [Number.isFinite(n), n];
232
232
  }
233
- function xo(e, o, t, n) {
233
+ function Po(e, n, t, o) {
234
234
  const i = parseFloat(e);
235
235
  return [
236
- Number.isFinite(i) && i >= o && (n ? i <= t : i < t),
236
+ Number.isFinite(i) && i >= n && (o ? i <= t : i < t),
237
237
  i
238
238
  ];
239
239
  }
240
- function At(e, o, t) {
241
- const n = parseFloat(e);
240
+ function Vt(e, n, t) {
241
+ const o = parseFloat(e);
242
242
  return [
243
- Number.isFinite(n) && n > 0 && (t ? n <= o : n < o),
244
- n
243
+ Number.isFinite(o) && o > 0 && (t ? o <= n : o < n),
244
+ o
245
245
  ];
246
246
  }
247
- function Vt(e, o) {
247
+ function It(e, n) {
248
248
  const t = parseFloat(e);
249
- return [Number.isFinite(t) && t >= 0 && !(t === 0 && !o), t];
249
+ return [Number.isFinite(t) && t >= 0 && !(t === 0 && !n), t];
250
250
  }
251
251
  function qe(e) {
252
- const o = e === "panAndWheelZoom", t = e === "selectToZoom";
252
+ const n = e === "panAndWheelZoom", t = e === "selectToZoom";
253
253
  return {
254
- pan: o ? {} : !1,
255
- zoom: o ? {} : !1,
256
- xAxisZoom: o ? {} : !1,
257
- yAxisZoom: o ? {} : !1,
254
+ pan: n ? {} : !1,
255
+ zoom: n ? {} : !1,
256
+ xAxisZoom: n ? {} : !1,
257
+ yAxisZoom: n ? {} : !1,
258
258
  selectToZoom: t ? { modifierKey: [] } : !1,
259
259
  xSelectToZoom: t ? { modifierKey: "Alt" } : !1,
260
260
  ySelectToZoom: t ? { modifierKey: "Shift" } : !1
261
261
  };
262
262
  }
263
- function lt(e, o) {
263
+ function rt(e, n) {
264
264
  if (e && e.length != 0) {
265
- const t = An(), n = o === void 0 ? null : Vn().domain(o).nice(), i = e.length;
265
+ const t = Vn(), o = n === void 0 ? null : In().domain(n).nice(), i = e.length;
266
266
  let a;
267
- n !== null && i > 0 && (a = n.ticks(Math.min(i, 20)), t.thresholds(a));
267
+ o !== null && i > 0 && (a = o.ticks(Math.min(i, 20)), t.thresholds(a));
268
268
  const s = t(e), u = s.map((r) => r.length);
269
269
  if (a === void 0) {
270
270
  const r = s.map((c) => c.x0);
@@ -276,25 +276,25 @@ function lt(e, o) {
276
276
  };
277
277
  }
278
278
  }
279
- function It() {
279
+ function $t() {
280
280
  const e = performance.now();
281
281
  return {
282
282
  end() {
283
- const o = performance.now() - e;
284
- return console.log(`The interaction took ${o}ms`), o;
283
+ const n = performance.now() - e;
284
+ return console.log(`The interaction took ${n}ms`), n;
285
285
  }
286
286
  };
287
287
  }
288
- var ee = /* @__PURE__ */ ((e) => (e.panAndWheelZoom = "panAndWheelZoom", e.selectToZoom = "selectToZoom", e.selectRegion = "selectRegion", e))(ee || {});
289
- function Po(e) {
288
+ var J = /* @__PURE__ */ ((e) => (e.panAndWheelZoom = "panAndWheelZoom", e.selectToZoom = "selectToZoom", e.selectRegion = "selectRegion", e))(J || {});
289
+ function wo(e) {
290
290
  const {
291
- id: o = "MulticlickSelection",
291
+ id: n = "MulticlickSelection",
292
292
  minPoints: t = 2,
293
- maxPoints: n = t,
293
+ maxPoints: o = t,
294
294
  maxMovement: i = 1,
295
295
  modifierKey: a,
296
296
  disabled: s,
297
- transform: u = (N) => N,
297
+ transform: u = (I) => I,
298
298
  validate: r = () => !0,
299
299
  onSelectionStart: c,
300
300
  onSelectionChange: m,
@@ -304,57 +304,57 @@ function Po(e) {
304
304
  } = e;
305
305
  if (t < 1)
306
306
  throw new RangeError(`minPoints must be >= 1, ${t}`);
307
- if (n < t && n !== -1)
307
+ if (o < t && o !== -1)
308
308
  throw new RangeError(
309
- `maxPoints must be -1 or >= minPoints, ${n} cf ${t}`
309
+ `maxPoints must be -1 or >= minPoints, ${o} cf ${t}`
310
310
  );
311
- const p = _e(u), b = _e(r), C = _e(c), T = _e(m), V = _e(d), k = _e(h), w = st((N) => N.camera), L = it(), { canvasBox: R, htmlToWorld: O, worldToData: j } = L, [x, _] = In(), K = Z(), W = Z(!0), Q = Z(!1), B = Z(!1), J = nn(a), ae = on(o, {
312
- button: an.Left,
311
+ const p = Me(u), b = Me(r), v = Me(c), T = Me(m), V = Me(d), k = Me(h), P = lt((I) => I.camera), L = at(), { canvasBox: E, htmlToWorld: O, worldToData: Y } = L, [x, _] = $n(), K = X(), G = X(!0), Z = X(!1), B = X(!1), Q = on(a), ae = an(n, {
312
+ button: sn.Left,
313
313
  modifierKey: a,
314
314
  disabled: s
315
- }), se = ne(
316
- (N) => {
317
- const $ = N.map((I) => O(w, I)), U = $.map(j);
318
- _({ html: N, world: $, data: U });
315
+ }), ne = te(
316
+ (I) => {
317
+ const $ = I.map((f) => O(P, f)), N = $.map(Y);
318
+ _({ html: I, world: $, data: N });
319
319
  },
320
- [w, O, _, j]
321
- ), Ce = ne(
322
- (N, $, U) => {
323
- W.current ? (K.current = [U], Q.current = !1, N.setPointerCapture($), n === 1 && se([U])) : W.current = !0;
320
+ [P, O, _, Y]
321
+ ), xe = te(
322
+ (I, $, N) => {
323
+ G.current ? (K.current = [N], Z.current = !1, I.setPointerCapture($), o === 1 && ne([N])) : G.current = !0;
324
324
  },
325
- [n, se]
326
- ), we = ne(
327
- (N, $, U, I) => {
328
- N.releasePointerCapture($), W.current = !U, B.current = I, K.current = void 0;
325
+ [o, ne]
326
+ ), Pe = te(
327
+ (I, $, N, f) => {
328
+ I.releasePointerCapture($), G.current = !N, B.current = f, K.current = void 0;
329
329
  },
330
330
  []
331
331
  );
332
- function De(N) {
333
- const { sourceEvent: $ } = N, U = $.type === "pointerdown", I = ae($);
334
- if (U && !I)
332
+ function we(I) {
333
+ const { sourceEvent: $ } = I, N = $.type === "pointerdown", f = ae($);
334
+ if (N && !f)
335
335
  return;
336
- const { target: y, pointerId: f } = $, v = y, P = K.current, z = R.clampPoint(N.htmlPt);
337
- if (P === void 0) {
338
- Ce(v, f, z);
336
+ const { target: y, pointerId: C } = $, M = y, R = K.current, H = E.clampPoint(I.htmlPt);
337
+ if (R === void 0) {
338
+ xe(M, C, H);
339
339
  return;
340
340
  }
341
- const H = P.length;
342
- let pe = !1;
343
- if (W.current) {
344
- const ve = P[H - 1];
345
- (H === 1 ? 0 : Math.max(Math.abs(ve.x - z.x), Math.abs(ve.y - z.y))) <= i ? pe = U && Q.current : (P.push(z), W.current = !1);
341
+ const se = R.length;
342
+ let Se = !1;
343
+ if (G.current) {
344
+ const Ve = R[se - 1];
345
+ (se === 1 ? 0 : Math.max(Math.abs(Ve.x - H.x), Math.abs(Ve.y - H.y))) <= i ? Se = N && Z.current : (R.push(H), G.current = !1);
346
346
  } else
347
- W.current = !0;
348
- (pe || H >= t && n > 0 && H === n) && (_(void 0), we(v, f, U, I));
347
+ G.current = !0;
348
+ (Se || se >= t && o > 0 && se === o) && (_(void 0), Pe(M, C, N, f));
349
349
  }
350
- function Me(N) {
350
+ function De(I) {
351
351
  const $ = K.current;
352
352
  if ($ === void 0)
353
353
  return;
354
- const U = $.length, I = R.clampPoint(N.htmlPt);
355
- W.current ? ($.push(I), W.current = !1) : $[U - 1] = I, se([...$]);
354
+ const N = $.length, f = E.clampPoint(I.htmlPt);
355
+ G.current ? ($.push(f), G.current = !1) : $[N - 1] = f, ne([...$]);
356
356
  }
357
- je("pointerdown", De), je("pointermove", Me), je("pointerup", De), Be(
357
+ je("pointerdown", we), je("pointermove", De), je("pointerup", we), Be(
358
358
  "Escape",
359
359
  () => {
360
360
  K.current = void 0, _(void 0);
@@ -364,56 +364,56 @@ function Po(e) {
364
364
  ), Be(
365
365
  "Enter",
366
366
  () => {
367
- Q.current && (B.current = !0, K.current = void 0, _(void 0));
367
+ Z.current && (B.current = !0, K.current = void 0, _(void 0));
368
368
  },
369
369
  [],
370
370
  { event: "keydown" }
371
371
  );
372
- const X = F(
373
- () => x && p.current(x, w, L),
374
- [x, p, w, L]
372
+ const j = F(
373
+ () => x && p.current(x, P, L),
374
+ [x, p, P, L]
375
375
  ), fe = F(() => {
376
- const N = !!X && b.current(X);
377
- if (N) {
378
- const $ = X.html.length;
379
- Q.current = $ >= t;
376
+ const I = !!j && b.current(j);
377
+ if (I) {
378
+ const $ = j.html.length;
379
+ Z.current = $ >= t;
380
380
  }
381
- return N;
382
- }, [Q, t, X, b]), oe = ft(X), ge = ft(fe);
383
- return E(() => {
384
- var N, $, U, I;
385
- if (X) {
386
- Xe(x), oe || (N = C.current) == null || N.call(C), ($ = T.current) == null || $.call(
381
+ return I;
382
+ }, [Z, t, j, b]), oe = gt(j), ge = gt(fe);
383
+ return z(() => {
384
+ var I, $, N, f;
385
+ if (j) {
386
+ Xe(x), oe || (I = v.current) == null || I.call(v), ($ = T.current) == null || $.call(
387
387
  T,
388
- J ? X : void 0,
388
+ Q ? j : void 0,
389
389
  // don't pass selection object if user is not pressing modifier key
390
390
  x,
391
391
  fe
392
392
  );
393
393
  return;
394
394
  }
395
- oe && (Xe(ge), (U = V.current) == null || U.call(
395
+ oe && (Xe(ge), (N = V.current) == null || N.call(
396
396
  V,
397
397
  B.current ? oe : void 0,
398
398
  // pass `undefined` if Escape pressed or modifier key released
399
399
  ge
400
- ), ge && B.current && ((I = k.current) == null || I.call(k, oe)), B.current = !1);
400
+ ), ge && B.current && ((f = k.current) == null || f.call(k, oe)), B.current = !1);
401
401
  }, [
402
- X,
402
+ j,
403
403
  oe,
404
404
  x,
405
405
  fe,
406
406
  ge,
407
- J,
408
- C,
407
+ Q,
408
+ v,
409
409
  T,
410
410
  V,
411
411
  k
412
- ]), !X || !J ? null : (Xe(x), /* @__PURE__ */ l(te, { children: g(X, x, fe, Q.current) }));
412
+ ]), !j || !Q ? null : (Xe(x), /* @__PURE__ */ l(ee, { children: g(j, x, fe, Z.current) }));
413
413
  }
414
414
  const nt = 8;
415
- function wo(e) {
416
- const { n: o, nx: t, ny: n, i, drag: a, ...s } = e, u = F(
415
+ function Do(e) {
416
+ const { n, nx: t, ny: o, i, drag: a, ...s } = e, u = F(
417
417
  () => ({
418
418
  onPointerMove: a == null ? void 0 : a.dragMove,
419
419
  onPointerUp: a && ((c) => {
@@ -442,7 +442,7 @@ function wo(e) {
442
442
  "circle",
443
443
  {
444
444
  cx: t,
445
- cy: n,
445
+ cy: o,
446
446
  r: nt,
447
447
  pointerEvents: "visibleFill",
448
448
  ...r,
@@ -450,19 +450,19 @@ function wo(e) {
450
450
  fillOpacity: a != null && a.isDragging ? 0.3 : 1,
451
451
  strokeWidth: 1
452
452
  },
453
- `${o}-handle-${i}`
453
+ `${n}-handle-${i}`
454
454
  ),
455
455
  /* @__PURE__ */ l(
456
456
  "circle",
457
457
  {
458
458
  cx: t,
459
- cy: n,
459
+ cy: o,
460
460
  r: 2 * nt,
461
461
  fill: "transparent",
462
462
  fillOpacity: 0,
463
463
  stroke: "none"
464
464
  },
465
- `${o}-handle-surround-${i}`
465
+ `${n}-handle-surround-${i}`
466
466
  )
467
467
  ]
468
468
  }
@@ -470,9 +470,9 @@ function wo(e) {
470
470
  }
471
471
  function Nt(e) {
472
472
  const {
473
- name: o,
473
+ name: n,
474
474
  size: t,
475
- i: n,
475
+ i: o,
476
476
  nx: i,
477
477
  ny: a,
478
478
  onHandleChange: s,
@@ -490,17 +490,17 @@ function Nt(e) {
490
490
  y: a,
491
491
  captureDragArea: !0,
492
492
  onDragMove: ({ x: d, y: h, dx: g, dy: p }) => {
493
- s == null || s(n, [(d ?? 0) + g, (h ?? 0) + p]);
493
+ s == null || s(o, [(d ?? 0) + g, (h ?? 0) + p]);
494
494
  },
495
495
  onDragEnd: ({ x: d, y: h, dx: g, dy: p, isDragging: b }) => {
496
- console.debug("DE:", d, h, "; delta:", g, p, "; drag:", b), s == null || s(n, [(d ?? 0) + g, (h ?? 0) + p], !1);
496
+ console.debug("DE:", d, h, "; delta:", g, p, "; drag:", b), s == null || s(o, [(d ?? 0) + g, (h ?? 0) + p], !1);
497
497
  },
498
498
  restrict: m,
499
499
  children: (d) => /* @__PURE__ */ l(
500
- wo,
500
+ Do,
501
501
  {
502
- n: o,
503
- i: n,
502
+ n,
503
+ i: o,
504
504
  nx: i,
505
505
  ny: a,
506
506
  drag: s && d,
@@ -510,29 +510,29 @@ function Nt(e) {
510
510
  }
511
511
  );
512
512
  }
513
- function Do(e) {
514
- const { size: o, coords: t, isFixed: n, axis: i, onHandleChange: a, ...s } = e, u = [t[0].getComponent(i), t[1].getComponent(i)], r = Math.min(u[0], u[1]), c = Math.max(u[0], u[1]);
513
+ function Mo(e) {
514
+ const { size: n, coords: t, isFixed: o, axis: i, onHandleChange: a, ...s } = e, u = [t[0].getComponent(i), t[1].getComponent(i)], r = Math.min(u[0], u[1]), c = Math.max(u[0], u[1]);
515
515
  let m;
516
516
  i === 0 ? m = [
517
- new D(r, o.height),
518
- new D(r, 0),
519
- new D(c, 0),
520
- new D(c, o.height),
521
- new D((r + c) / 2, o.height / 2)
517
+ new w(r, n.height),
518
+ new w(r, 0),
519
+ new w(c, 0),
520
+ new w(c, n.height),
521
+ new w((r + c) / 2, n.height / 2)
522
522
  ] : m = [
523
- new D(0, c),
524
- new D(o.width, c),
525
- new D(o.width, r),
526
- new D(0, r),
527
- new D(o.width / 2, (r + c) / 2)
523
+ new w(0, c),
524
+ new w(n.width, c),
525
+ new w(n.width, r),
526
+ new w(0, r),
527
+ new w(n.width / 2, (r + c) / 2)
528
528
  ];
529
529
  const d = F(() => m.map((p, b) => {
530
- const C = `'axisbox-drag-${b}`;
530
+ const v = `'axisbox-drag-${b}`;
531
531
  return /* @__PURE__ */ l(
532
532
  Nt,
533
533
  {
534
- name: C,
535
- size: o,
534
+ name: v,
535
+ size: n,
536
536
  i: b,
537
537
  nx: p.x,
538
538
  ny: p.y,
@@ -541,25 +541,25 @@ function Do(e) {
541
541
  restrictY: i === 0,
542
542
  ...s
543
543
  },
544
- C
544
+ v
545
545
  );
546
- }), [m, o, a, i, s]);
546
+ }), [m, n, a, i, s]);
547
547
  m.pop();
548
548
  const h = F(
549
549
  () => m.map((g) => `${g.x},${g.y}`).join(" "),
550
550
  [m]
551
551
  );
552
- return /* @__PURE__ */ S(te, { children: [
552
+ return /* @__PURE__ */ S(ee, { children: [
553
553
  /* @__PURE__ */ l("polygon", { points: h, ...s, stroke: "none" }),
554
- !n && d,
555
- i === 0 && /* @__PURE__ */ S(te, { children: [
554
+ !o && d,
555
+ i === 0 && /* @__PURE__ */ S(ee, { children: [
556
556
  /* @__PURE__ */ l(
557
557
  "line",
558
558
  {
559
559
  x1: r,
560
560
  y1: 0,
561
561
  x2: r,
562
- y2: o.height,
562
+ y2: n.height,
563
563
  stroke: s.fill,
564
564
  strokeDasharray: s.strokeDasharray
565
565
  }
@@ -570,19 +570,19 @@ function Do(e) {
570
570
  x1: c,
571
571
  y1: 0,
572
572
  x2: c,
573
- y2: o.height,
573
+ y2: n.height,
574
574
  stroke: s.fill,
575
575
  strokeDasharray: s.strokeDasharray
576
576
  }
577
577
  )
578
578
  ] }),
579
- i !== 0 && /* @__PURE__ */ S(te, { children: [
579
+ i !== 0 && /* @__PURE__ */ S(ee, { children: [
580
580
  /* @__PURE__ */ l(
581
581
  "line",
582
582
  {
583
583
  x1: 0,
584
584
  y1: r,
585
- x2: o.width,
585
+ x2: n.width,
586
586
  y2: r,
587
587
  stroke: s.fill,
588
588
  strokeDasharray: s.strokeDasharray
@@ -593,7 +593,7 @@ function Do(e) {
593
593
  {
594
594
  x1: 0,
595
595
  y1: c,
596
- x2: o.width,
596
+ x2: n.width,
597
597
  y2: c,
598
598
  stroke: s.fill,
599
599
  strokeDasharray: s.strokeDasharray
@@ -602,34 +602,34 @@ function Do(e) {
602
602
  ] })
603
603
  ] });
604
604
  }
605
- const pt = 10, Mo = nt * 2 + 4, _o = new $e().identity().rotate(Math.PI / 2).multiplyScalar(Math.sin(Math.PI / 3));
606
- function To(e, o) {
607
- const t = new D().subVectors(o, e), n = Math.hypot(t.x, t.y), i = t.clone().multiplyScalar(0.5 + Mo / n);
608
- t.multiplyScalar(pt / n);
605
+ const bt = 10, _o = nt * 2 + 4, To = new Ne().identity().rotate(Math.PI / 2).multiplyScalar(Math.sin(Math.PI / 3));
606
+ function Lo(e, n) {
607
+ const t = new w().subVectors(n, e), o = Math.hypot(t.x, t.y), i = t.clone().multiplyScalar(0.5 + _o / o);
608
+ t.multiplyScalar(bt / o);
609
609
  let a, s;
610
- if (n > 4 * pt) {
611
- const r = new D().addVectors(e, i);
612
- a = new D().subVectors(r, t), s = r.add(t);
610
+ if (o > 4 * bt) {
611
+ const r = new w().addVectors(e, i);
612
+ a = new w().subVectors(r, t), s = r.add(t);
613
613
  } else
614
- a = o, s = new D().addVectors(o, t);
615
- const u = t.applyMatrix3(_o).add(a);
614
+ a = n, s = new w().addVectors(n, t);
615
+ const u = t.applyMatrix3(To).add(a);
616
616
  return [a, s, u].map((r) => `${r.x},${r.y}`).join(" ");
617
617
  }
618
- function bt(e) {
618
+ function St(e) {
619
619
  const {
620
- size: o,
620
+ size: n,
621
621
  coords: t,
622
- isClosed: n = !1,
622
+ isClosed: o = !1,
623
623
  isFixed: i,
624
624
  onHandleChange: a,
625
625
  ...s
626
626
  } = e, u = t.slice(0, -1), r = F(() => t.map((h, g) => {
627
- const p = `${n ? "polygon" : "polyline"}-drag-${g}`;
627
+ const p = `${o ? "polygon" : "polyline"}-drag-${g}`;
628
628
  return /* @__PURE__ */ l(
629
629
  Nt,
630
630
  {
631
631
  name: p,
632
- size: o,
632
+ size: n,
633
633
  i: g,
634
634
  nx: h.x,
635
635
  ny: h.y,
@@ -638,18 +638,18 @@ function bt(e) {
638
638
  },
639
639
  p
640
640
  );
641
- }), [t, n, o, a, s]), c = F(
641
+ }), [t, o, n, a, s]), c = F(
642
642
  () => u.map((d) => `${d.x},${d.y}`).join(" "),
643
643
  [u]
644
- ), m = F(() => To(t[0], t[1]), [t]);
645
- return /* @__PURE__ */ S(te, { children: [
646
- n ? /* @__PURE__ */ l("polygon", { points: c, ...s }) : /* @__PURE__ */ l("polyline", { points: c, ...s, fill: "none" }),
644
+ ), m = F(() => Lo(t[0], t[1]), [t]);
645
+ return /* @__PURE__ */ S(ee, { children: [
646
+ o ? /* @__PURE__ */ l("polygon", { points: c, ...s }) : /* @__PURE__ */ l("polyline", { points: c, ...s, fill: "none" }),
647
647
  /* @__PURE__ */ l("polygon", { points: m, ...s, fill: s.stroke }),
648
648
  !i && r
649
649
  ] });
650
650
  }
651
- class be {
652
- constructor(o) {
651
+ class pe {
652
+ constructor(n) {
653
653
  A(this, "id");
654
654
  A(this, "name", "");
655
655
  A(this, "defaultColour", "#000000");
@@ -661,39 +661,39 @@ class be {
661
661
  A(this, "asDashed");
662
662
  /** Vector3 copy of start coordinate */
663
663
  A(this, "vStart");
664
- this.id = crypto.randomUUID().slice(-8), this.start = o, this.vStart = new D(...o);
664
+ this.id = crypto.randomUUID().slice(-8), this.start = n, this.vStart = new w(...n);
665
665
  }
666
666
  toString() {
667
667
  return "";
668
668
  }
669
- setStart(o, t) {
670
- this.start[o] = t, o == 0 ? this.vStart.x = t : o == 1 ? this.vStart.y = t : o == 2 ? this.vStart.z = t : console.log("Index error (%i > 2) on setting start", o);
669
+ setStart(n, t) {
670
+ this.start[n] = t, n == 0 ? this.vStart.x = t : n == 1 ? this.vStart.y = t : n == 2 ? this.vStart.z = t : console.log("Index error (%i > 2) on setting start", n);
671
671
  }
672
672
  getPoints() {
673
673
  return [this.vStart.clone()];
674
674
  }
675
- setProperties(o) {
676
- this.id = o.id, this.name = o.name, this.colour = o.colour, this.alpha = o.alpha, this.asDashed = o.asDashed, this.fixed = o.fixed;
675
+ setProperties(n) {
676
+ this.id = n.id, this.name = n.name, this.colour = n.colour, this.alpha = n.alpha, this.asDashed = n.asDashed, this.fixed = n.fixed;
677
677
  }
678
- static createFromSelection(o) {
679
- const t = new be([...o.start]);
680
- return t.setProperties(o), t;
678
+ static createFromSelection(n) {
679
+ const t = new pe([...n.start]);
680
+ return t.setProperties(n), t;
681
681
  }
682
- onHandleChange(o, t, n) {
683
- if (console.debug("base: oHC", o, t, n), o === 0) {
684
- const i = be.createFromSelection(this), a = t[0];
682
+ onHandleChange(n, t, o) {
683
+ if (console.debug("base: oHC", n, t, o), n === 0) {
684
+ const i = pe.createFromSelection(this), a = t[0];
685
685
  a !== void 0 && (i.start[0] = a, i.vStart.x = a);
686
686
  const s = t[1];
687
687
  return s !== void 0 && (i.start[1] = s, i.vStart.y = s), i;
688
688
  }
689
689
  return this;
690
690
  }
691
- static isShape(o) {
692
- return "vStart" in o;
691
+ static isShape(n) {
692
+ return "vStart" in n;
693
693
  }
694
694
  }
695
- class ce extends be {
696
- constructor(t, n, i) {
695
+ class ce extends pe {
696
+ constructor(t, o, i) {
697
697
  super(t);
698
698
  A(this, "defaultColour", "#882255");
699
699
  // wine
@@ -701,18 +701,18 @@ class ce extends be {
701
701
  A(this, "length");
702
702
  /** dimension (x=0, y=1) */
703
703
  A(this, "dimension");
704
- this.length = n, this.dimension = i, this.colour = this.defaultColour;
704
+ this.length = o, this.dimension = i, this.colour = this.defaultColour;
705
705
  }
706
706
  _getPoint(t = 1) {
707
- const n = new D(0, 0, 1);
708
- return n.setComponent(this.dimension, this.length * t), n.add(this.vStart);
707
+ const o = new w(0, 0, 1);
708
+ return o.setComponent(this.dimension, this.length * t), o.add(this.vStart);
709
709
  }
710
710
  getPoints() {
711
711
  return [this.vStart.clone(), this._getPoint()];
712
712
  }
713
713
  toString() {
714
- const t = this._getPoint(), n = this.dimension;
715
- return `Axis: ${this.start[n]}; ${this.length}; to ${t.getComponent(n)}`;
714
+ const t = this._getPoint(), o = this.dimension;
715
+ return `Axis: ${this.start[o]}; ${this.length}; to ${t.getComponent(o)}`;
716
716
  }
717
717
  static clicks() {
718
718
  return [2, 2];
@@ -721,24 +721,24 @@ class ce extends be {
721
721
  return "dimension" in t;
722
722
  }
723
723
  _setFromPoints(t) {
724
- const n = t[0], i = t[1], a = this.dimension, s = n.getComponent(a), u = i.getComponent(a);
724
+ const o = t[0], i = t[1], a = this.dimension, s = o.getComponent(a), u = i.getComponent(a);
725
725
  this.start = [0, 0], s < u ? (this.start[a] = s, this.length = u - s) : (this.start[a] = u, this.length = s - u), this.vStart.setComponent(a, this.start[a]);
726
726
  }
727
- static createFromPoints(t, n) {
728
- const i = t[0].getComponent(n), a = t[1].getComponent(n), s = a - i, u = [0, 0];
729
- return u[n] = s > 0 ? i : a, new ce(u, Math.abs(s), n);
727
+ static createFromPoints(t, o) {
728
+ const i = t[0].getComponent(o), a = t[1].getComponent(o), s = a - i, u = [0, 0];
729
+ return u[o] = s > 0 ? i : a, new ce(u, Math.abs(s), o);
730
730
  }
731
731
  static createFromSelection(t) {
732
- const n = new ce([...t.start], t.length, t.dimension);
733
- return n.setProperties(t), n;
732
+ const o = new ce([...t.start], t.length, t.dimension);
733
+ return o.setProperties(t), o;
734
734
  }
735
- onHandleChange(t, n) {
735
+ onHandleChange(t, o) {
736
736
  const i = ce.createFromSelection(this), a = this.dimension;
737
737
  if (t === 4) {
738
- const u = n[a] ?? 0, r = this._getPoint(0.5), c = u - r.getComponent(a), m = i.start[a] + c;
738
+ const u = o[a] ?? 0, r = this._getPoint(0.5), c = u - r.getComponent(a), m = i.start[a] + c;
739
739
  return i.start[a] = m, i.vStart.setComponent(a, m), i;
740
740
  }
741
- const s = n[a] ?? 0;
741
+ const s = o[a] ?? 0;
742
742
  if (t < 2) {
743
743
  const u = i.start[a] + i.length - s;
744
744
  u >= 0 && (i.start[a] = s, i.vStart.setComponent(a, s), i.length = u);
@@ -749,14 +749,14 @@ class ce extends be {
749
749
  return i;
750
750
  }
751
751
  }
752
- class me extends be {
753
- constructor(t, n) {
752
+ class me extends pe {
753
+ constructor(t, o) {
754
754
  super(t);
755
755
  A(this, "defaultColour", "#332288");
756
756
  // indigo
757
757
  /** radius of circle */
758
758
  A(this, "radius");
759
- this.radius = n, this.colour = this.defaultColour;
759
+ this.radius = o, this.colour = this.defaultColour;
760
760
  }
761
761
  static clicks() {
762
762
  return [2, 2];
@@ -765,16 +765,16 @@ class me extends be {
765
765
  return "radius" in t;
766
766
  }
767
767
  static createFromPoints(t) {
768
- const [n, i] = t;
769
- return new me([n.x, n.y], Math.hypot(i.x, i.y));
768
+ const [o, i] = t;
769
+ return new me([o.x, o.y], Math.hypot(i.x, i.y));
770
770
  }
771
771
  static createFromSelection(t) {
772
- const n = new me([...t.start], t.radius);
773
- return n.setProperties(t), n;
772
+ const o = new me([...t.start], t.radius);
773
+ return o.setProperties(t), o;
774
774
  }
775
775
  }
776
- class Se extends be {
777
- constructor(t, n, i) {
776
+ class be extends pe {
777
+ constructor(t, o, i) {
778
778
  super(t);
779
779
  A(this, "defaultColour", "#117733");
780
780
  // green
@@ -782,7 +782,7 @@ class Se extends be {
782
782
  A(this, "radii");
783
783
  /** start and end angles (radians) */
784
784
  A(this, "angles");
785
- this.radii = n, this.angles = i, this.colour = this.defaultColour;
785
+ this.radii = o, this.angles = i, this.colour = this.defaultColour;
786
786
  }
787
787
  static clicks() {
788
788
  return [2, 3];
@@ -791,52 +791,52 @@ class Se extends be {
791
791
  return "radii" in t;
792
792
  }
793
793
  static createFromPoints(t) {
794
- const n = t[0], i = new D().subVectors(t[1], n), a = Ke(i), s = a[0], u = a[1];
794
+ const o = t[0], i = new w().subVectors(t[1], o), a = Ke(i), s = a[0], u = a[1];
795
795
  let r = s, c = u;
796
796
  if (t.length > 2) {
797
- const h = new D().subVectors(t[2], n), g = Ke(h);
797
+ const h = new w().subVectors(t[2], o), g = Ke(h);
798
798
  r = g[0], c = g[1];
799
799
  }
800
800
  const m = s < r ? [s, r] : [r, s], d = u < c ? [u, c] : [c, u];
801
- return new Se(
802
- [n.x, n.y],
801
+ return new be(
802
+ [o.x, o.y],
803
803
  m,
804
804
  d
805
805
  );
806
806
  }
807
807
  static createFromSelection(t) {
808
- const n = new Se(
808
+ const o = new be(
809
809
  [...t.start],
810
810
  [...t.radii],
811
811
  [...t.angles]
812
812
  );
813
- return n.setProperties(t), n;
813
+ return o.setProperties(t), o;
814
814
  }
815
815
  }
816
- class rt extends be {
817
- constructor(t, n = 0) {
816
+ class ct extends pe {
817
+ constructor(t, o = 0) {
818
818
  super(t);
819
819
  /** angle of selection (radians) */
820
820
  A(this, "angle");
821
821
  A(this, "transform");
822
822
  A(this, "invTransform");
823
- this.angle = n, this.transform = new $e().identity().rotate(-this.angle), this.invTransform = new $e().identity().rotate(this.angle);
823
+ this.angle = o, this.transform = new Ne().identity().rotate(-this.angle), this.invTransform = new Ne().identity().rotate(this.angle);
824
824
  }
825
825
  setAngle(t) {
826
- this.angle = t, this.transform = new $e().identity().rotate(-this.angle), this.invTransform = new $e().identity().rotate(this.angle);
826
+ this.angle = t, this.transform = new Ne().identity().rotate(-this.angle), this.invTransform = new Ne().identity().rotate(this.angle);
827
827
  }
828
828
  static isShape(t) {
829
829
  return "transform" in t;
830
830
  }
831
831
  }
832
- class Pe extends rt {
833
- constructor(t, n, i = 0) {
832
+ class Ce extends ct {
833
+ constructor(t, o, i = 0) {
834
834
  super(t, i);
835
835
  A(this, "defaultColour", "#999933");
836
836
  // olive
837
837
  /** lengths of major and minor semi-axes */
838
838
  A(this, "semiAxes");
839
- this.semiAxes = n, this.colour = this.defaultColour;
839
+ this.semiAxes = o, this.colour = this.defaultColour;
840
840
  }
841
841
  static clicks() {
842
842
  return [2, 3];
@@ -845,31 +845,31 @@ class Pe extends rt {
845
845
  return "semiAxes" in t;
846
846
  }
847
847
  static createFromPoints(t) {
848
- const n = t[0], i = new D().subVectors(t[1], n);
848
+ const o = t[0], i = new w().subVectors(t[1], o);
849
849
  if (t.length < 3)
850
- return new Pe(
851
- [n.x, n.y],
850
+ return new Ce(
851
+ [o.x, o.y],
852
852
  [Math.abs(i.x), Math.abs(i.y)]
853
853
  );
854
- const a = Ke(i), s = a[0], u = new D().subVectors(t[2], n), r = Math.hypot(u.x, u.y), c = s < r ? [s, r] : [r, s];
855
- return new Pe([n.x, n.y], c, a[1]);
854
+ const a = Ke(i), s = a[0], u = new w().subVectors(t[2], o), r = Math.hypot(u.x, u.y), c = s < r ? [s, r] : [r, s];
855
+ return new Ce([o.x, o.y], c, a[1]);
856
856
  }
857
857
  static createFromSelection(t) {
858
- const n = new Pe([...t.start], [...t.semiAxes]);
859
- return n.setProperties(t), n;
858
+ const o = new Ce([...t.start], [...t.semiAxes]);
859
+ return o.setProperties(t), o;
860
860
  }
861
861
  }
862
- class ue extends rt {
863
- constructor(t = [0, 0], n = 1, i = 0) {
862
+ class ue extends ct {
863
+ constructor(t = [0, 0], o = 1, i = 0) {
864
864
  super(t, i);
865
865
  A(this, "defaultColour", "#44aa99");
866
866
  // teal
867
867
  /** length of line */
868
868
  A(this, "length");
869
- this.length = n, this.colour = this.defaultColour;
869
+ this.length = o, this.colour = this.defaultColour;
870
870
  }
871
871
  _getPoint(t = 1) {
872
- return new D(this.length * t, 0, 1).applyMatrix3(this.transform).add(this.vStart);
872
+ return new w(this.length * t, 0, 1).applyMatrix3(this.transform).add(this.vStart);
873
873
  }
874
874
  getPoints() {
875
875
  return [this.vStart.clone(), this._getPoint(), this._getPoint(0.5)];
@@ -885,38 +885,38 @@ class ue extends rt {
885
885
  return "length" in t;
886
886
  }
887
887
  _setFromPoints(t) {
888
- const n = t[0];
889
- this.start = [n.x, n.y], this.vStart.x = n.x, this.vStart.y = n.y;
890
- const i = new D().subVectors(t[1], n), a = Ke(i);
888
+ const o = t[0];
889
+ this.start = [o.x, o.y], this.vStart.x = o.x, this.vStart.y = o.y;
890
+ const i = new w().subVectors(t[1], o), a = Ke(i);
891
891
  this.length = a[0], this.setAngle(a[1]);
892
892
  }
893
893
  static createFromPoints(t) {
894
- const n = new ue();
895
- return n._setFromPoints(t), n;
894
+ const o = new ue();
895
+ return o._setFromPoints(t), o;
896
896
  }
897
897
  static createFromSelection(t) {
898
- const n = new ue([...t.start], t.length, t.angle);
899
- return n.setProperties(t), n;
898
+ const o = new ue([...t.start], t.length, t.angle);
899
+ return o.setProperties(t), o;
900
900
  }
901
- onHandleChange(t, n) {
901
+ onHandleChange(t, o) {
902
902
  const i = ue.createFromSelection(this), a = i.vStart;
903
903
  let s;
904
904
  switch (t) {
905
905
  case 0:
906
- s = i._getPoint(), a.x = n[0] ?? a.x, a.y = n[1] ?? a.y, i._setFromPoints([a, s]);
906
+ s = i._getPoint(), a.x = o[0] ?? a.x, a.y = o[1] ?? a.y, i._setFromPoints([a, s]);
907
907
  break;
908
908
  case 1:
909
- s = i._getPoint(), s.x = n[0] ?? s.x, s.y = n[1] ?? s.y, i._setFromPoints([a, s]);
909
+ s = i._getPoint(), s.x = o[0] ?? s.x, s.y = o[1] ?? s.y, i._setFromPoints([a, s]);
910
910
  break;
911
911
  case 2:
912
- s = i._getPoint(0.5), a.x += (n[0] ?? 0) - s.x, a.y += (n[1] ?? 0) - s.y, i.start[0] = a.x, i.start[1] = a.y;
912
+ s = i._getPoint(0.5), a.x += (o[0] ?? 0) - s.x, a.y += (o[1] ?? 0) - s.y, i.start[0] = a.x, i.start[1] = a.y;
913
913
  break;
914
914
  }
915
915
  return i;
916
916
  }
917
917
  }
918
- class ie extends be {
919
- constructor(t, n) {
918
+ class ie extends pe {
919
+ constructor(t, o) {
920
920
  super(t[0]);
921
921
  A(this, "defaultOpenColour", "#88ccee");
922
922
  // cyan
@@ -927,24 +927,24 @@ class ie extends be {
927
927
  A(this, "points");
928
928
  /** if true, polygon is closed by joining last and first point */
929
929
  A(this, "closed");
930
- this.points = t, this.closed = !!n, this.colour = this.closed ? this.defaultClosedColour : this.defaultOpenColour;
930
+ this.points = t, this.closed = !!o, this.colour = this.closed ? this.defaultClosedColour : this.defaultOpenColour;
931
931
  }
932
932
  getPoints() {
933
- const t = this.points.map((a) => new D(...a)), n = new D();
933
+ const t = this.points.map((a) => new w(...a)), o = new w();
934
934
  return t.forEach((a) => {
935
- n.add(a);
936
- }), n.divideScalar(t.length), [...t, n];
935
+ o.add(a);
936
+ }), o.divideScalar(t.length), [...t, o];
937
937
  }
938
938
  getPoint(t) {
939
- const n = this.points.length;
940
- if (t < n) {
939
+ const o = this.points.length;
940
+ if (t < o) {
941
941
  const i = this.points[t];
942
- return new D(i[0], i[1]);
943
- } else if (t == n) {
944
- const i = new D();
942
+ return new w(i[0], i[1]);
943
+ } else if (t == o) {
944
+ const i = new w();
945
945
  return this.points.forEach((a) => {
946
- i.add(new D(a[0], a[1]));
947
- }), i.divideScalar(n), i;
946
+ i.add(new w(a[0], a[1]));
947
+ }), i.divideScalar(o), i;
948
948
  }
949
949
  return null;
950
950
  }
@@ -954,28 +954,28 @@ class ie extends be {
954
954
  static isShape(t) {
955
955
  return "points" in t;
956
956
  }
957
- static createFromPoints(t, n) {
957
+ static createFromPoints(t, o) {
958
958
  return new ie(
959
- n.map((a) => [a.x, a.y]),
959
+ o.map((a) => [a.x, a.y]),
960
960
  t
961
961
  );
962
962
  }
963
963
  static createFromSelection(t) {
964
- const n = new ie(
964
+ const o = new ie(
965
965
  t.points.map((i) => [...i]),
966
966
  t.closed
967
967
  );
968
- return n.setProperties(t), n;
968
+ return o.setProperties(t), o;
969
969
  }
970
- onHandleChange(t, n) {
970
+ onHandleChange(t, o) {
971
971
  const i = ie.createFromSelection(this), a = this.points.length;
972
972
  if (t < a) {
973
973
  const s = this.points[t];
974
- i.points[t] = [n[0] ?? s[0], n[1] ?? s[1]];
974
+ i.points[t] = [o[0] ?? s[0], o[1] ?? s[1]];
975
975
  } else if (t == a) {
976
976
  const s = this.getPoint(t);
977
977
  if (s) {
978
- const u = [(n[0] ?? s.x) - s.x, (n[1] ?? s.y) - s.y];
978
+ const u = [(o[0] ?? s.x) - s.x, (o[1] ?? s.y) - s.y];
979
979
  i.points.forEach((r, c) => {
980
980
  i.points[c] = [r[0] + u[0], r[1] + u[1]];
981
981
  });
@@ -984,40 +984,40 @@ class ie extends be {
984
984
  return i;
985
985
  }
986
986
  }
987
- class de extends rt {
988
- constructor(t, n, i = 0) {
987
+ class de extends ct {
988
+ constructor(t, o, i = 0) {
989
989
  super(t, i);
990
990
  A(this, "defaultColour", "#ddcc77");
991
991
  // sand
992
992
  /** lengths of major and minor sides */
993
993
  A(this, "lengths");
994
- this.lengths = [...n], this.colour = this.defaultColour;
994
+ this.lengths = [...o], this.colour = this.defaultColour;
995
995
  }
996
996
  getPoints() {
997
- return new Array(5).fill(null, 0, 5).map((n, i) => this.getPoint(i));
997
+ return new Array(5).fill(null, 0, 5).map((o, i) => this.getPoint(i));
998
998
  }
999
999
  getPoint(t) {
1000
- let n = null;
1000
+ let o = null;
1001
1001
  switch (t) {
1002
1002
  case 0:
1003
- n = new D(0, 0, 1);
1003
+ o = new w(0, 0, 1);
1004
1004
  break;
1005
1005
  case 1:
1006
- n = new D(this.lengths[0], 0, 1);
1006
+ o = new w(this.lengths[0], 0, 1);
1007
1007
  break;
1008
1008
  case 2:
1009
- n = new D(...this.lengths, 1);
1009
+ o = new w(...this.lengths, 1);
1010
1010
  break;
1011
1011
  case 3:
1012
- n = new D(0, this.lengths[1], 1);
1012
+ o = new w(0, this.lengths[1], 1);
1013
1013
  break;
1014
1014
  case 4:
1015
- n = new D(this.lengths[0] * 0.5, this.lengths[1] * 0.5, 1);
1015
+ o = new w(this.lengths[0] * 0.5, this.lengths[1] * 0.5, 1);
1016
1016
  break;
1017
1017
  default:
1018
1018
  return null;
1019
1019
  }
1020
- return n.applyMatrix3(this.transform).add(this.vStart);
1020
+ return o.applyMatrix3(this.transform).add(this.vStart);
1021
1021
  }
1022
1022
  toString() {
1023
1023
  const t = this.getPoint(2);
@@ -1030,39 +1030,39 @@ class de extends rt {
1030
1030
  static isShape(t) {
1031
1031
  return "lengths" in t;
1032
1032
  }
1033
- static createFromPoints(t, n) {
1034
- const i = n[0].clone(), a = new D().subVectors(n[1], i);
1033
+ static createFromPoints(t, o) {
1034
+ const i = o[0].clone(), a = new w().subVectors(o[1], i);
1035
1035
  let s = 0;
1036
1036
  const u = a.x, r = a.y;
1037
1037
  return u < 0 !== t[0] ? (a.x = -u, r < 0 !== t[1] ? (s = Math.PI, a.y = -r) : (s = Math.PI / 2, a.y = a.x, a.x = r)) : r < 0 !== t[1] && (s = -Math.PI / 2, a.y = a.x, a.x = -r), new de([i.x, i.y], [a.x, a.y], s);
1038
1038
  }
1039
1039
  static createFromSelection(t) {
1040
- const n = new de([...t.start], [...t.lengths], t.angle);
1041
- return n.setProperties(t), n;
1040
+ const o = new de([...t.start], [...t.lengths], t.angle);
1041
+ return o.setProperties(t), o;
1042
1042
  }
1043
- onHandleChange(t, n) {
1043
+ onHandleChange(t, o) {
1044
1044
  const i = de.createFromSelection(this), a = this.getPoint(t);
1045
1045
  if (a !== null) {
1046
- const s = n[0] ?? 0, u = n[1] ?? 0;
1046
+ const s = o[0] ?? 0, u = o[1] ?? 0;
1047
1047
  if (t === 4) {
1048
- const p = new D(s, u).sub(a), b = i.vStart;
1048
+ const p = new w(s, u).sub(a), b = i.vStart;
1049
1049
  return b.x += p.x, b.y += p.y, i.start[0] = b.x, i.start[1] = b.y, i;
1050
1050
  }
1051
- const r = new D(s, u).sub(a).applyMatrix3(this.invTransform), [c, m] = i.lengths;
1051
+ const r = new w(s, u).sub(a).applyMatrix3(this.invTransform), [c, m] = i.lengths;
1052
1052
  let d, h;
1053
1053
  t !== 2 ? (d = Math.max(0, c - r.x), h = Math.max(0, m - r.y)) : (d = Math.max(0, c + r.x), h = Math.max(0, m + r.y));
1054
1054
  let g;
1055
1055
  switch (t) {
1056
1056
  case 0:
1057
- g = new D(c - d, m - h);
1057
+ g = new w(c - d, m - h);
1058
1058
  break;
1059
1059
  case 1:
1060
- g = new D(0, m - h), d = Math.max(0, c + r.x);
1060
+ g = new w(0, m - h), d = Math.max(0, c + r.x);
1061
1061
  break;
1062
1062
  case 2:
1063
1063
  break;
1064
1064
  case 3:
1065
- g = new D(c - d), h = Math.max(0, m + r.y);
1065
+ g = new w(c - d), h = Math.max(0, m + r.y);
1066
1066
  break;
1067
1067
  }
1068
1068
  g !== void 0 && (g.applyMatrix3(this.transform).add(this.vStart), i.start[0] = g.x, i.start[1] = g.y, i.vStart.x = g.x, i.vStart.y = g.y), i.lengths[0] = d, i.lengths[1] = h;
@@ -1070,23 +1070,23 @@ class de extends rt {
1070
1070
  return i;
1071
1071
  }
1072
1072
  }
1073
- var G = /* @__PURE__ */ ((e) => (e.line = "line", e.rectangle = "rectangle", e.polyline = "polyline", e.polygon = "polygon", e.circle = "circle", e.ellipse = "ellipse", e.sector = "sector", e.horizontalAxis = "horizontalAxis", e.verticalAxis = "verticalAxis", e.unknown = "unknown", e))(G || {});
1073
+ var q = /* @__PURE__ */ ((e) => (e.line = "line", e.rectangle = "rectangle", e.polyline = "polyline", e.polygon = "polygon", e.circle = "circle", e.ellipse = "ellipse", e.sector = "sector", e.horizontalAxis = "horizontalAxis", e.verticalAxis = "verticalAxis", e.unknown = "unknown", e))(q || {});
1074
1074
  function Ke(e) {
1075
- const o = e.x, t = e.y;
1076
- return [Math.hypot(t, o), Math.atan2(t, o)];
1075
+ const n = e.x, t = e.y;
1076
+ return [Math.hypot(t, n), Math.atan2(t, n)];
1077
1077
  }
1078
- function $t(e) {
1079
- return ce.isShape(e) ? e.dimension === 0 ? "horizontalAxis" : "verticalAxis" : de.isShape(e) ? "rectangle" : ue.isShape(e) ? "line" : ie.isShape(e) ? e.closed ? "polygon" : "polyline" : Pe.isShape(e) ? "ellipse" : me.isShape(e) ? "circle" : Se.isShape(e) ? "sector" : "unknown";
1078
+ function Ft(e) {
1079
+ return ce.isShape(e) ? e.dimension === 0 ? "horizontalAxis" : "verticalAxis" : de.isShape(e) ? "rectangle" : ue.isShape(e) ? "line" : ie.isShape(e) ? e.closed ? "polygon" : "polyline" : Ce.isShape(e) ? "ellipse" : me.isShape(e) ? "circle" : be.isShape(e) ? "sector" : "unknown";
1080
1080
  }
1081
- function St(e) {
1082
- return ce.isShape(e) ? ce.createFromSelection(e) : de.isShape(e) ? de.createFromSelection(e) : ue.isShape(e) ? ue.createFromSelection(e) : ie.isShape(e) ? ie.createFromSelection(e) : Pe.isShape(e) ? Pe.createFromSelection(e) : me.isShape(e) ? me.createFromSelection(e) : Se.isShape(e) ? Se.createFromSelection(e) : null;
1081
+ function vt(e) {
1082
+ return ce.isShape(e) ? ce.createFromSelection(e) : de.isShape(e) ? de.createFromSelection(e) : ue.isShape(e) ? ue.createFromSelection(e) : ie.isShape(e) ? ie.createFromSelection(e) : Ce.isShape(e) ? Ce.createFromSelection(e) : me.isShape(e) ? me.createFromSelection(e) : be.isShape(e) ? be.createFromSelection(e) : null;
1083
1083
  }
1084
- function Ft(e, o, t) {
1084
+ function Ot(e, n, t) {
1085
1085
  switch (e) {
1086
1086
  case "rectangle":
1087
- return de.createFromPoints(o, t);
1087
+ return de.createFromPoints(n, t);
1088
1088
  case "sector":
1089
- return Se.createFromPoints(t);
1089
+ return be.createFromPoints(t);
1090
1090
  case "horizontalAxis":
1091
1091
  case "verticalAxis":
1092
1092
  return ce.createFromPoints(
@@ -1107,12 +1107,12 @@ function Ft(e, o, t) {
1107
1107
  return ue.createFromPoints(t);
1108
1108
  }
1109
1109
  }
1110
- function Lo(e) {
1110
+ function ko(e) {
1111
1111
  switch (e) {
1112
1112
  case "rectangle":
1113
1113
  return de.clicks();
1114
1114
  case "sector":
1115
- return Se.clicks();
1115
+ return be.clicks();
1116
1116
  case "horizontalAxis":
1117
1117
  case "verticalAxis":
1118
1118
  return ce.clicks();
@@ -1129,18 +1129,18 @@ function Lo(e) {
1129
1129
  return ue.clicks();
1130
1130
  }
1131
1131
  }
1132
- function ko(e, o, t, n, i) {
1133
- console.debug("Points", o, t);
1134
- const a = Ft(o, [!1, !1], t);
1135
- a.alpha = n;
1132
+ function Ao(e, n, t, o, i) {
1133
+ console.debug("Points", n, t);
1134
+ const a = Ot(n, [!1, !1], t);
1135
+ a.alpha = o;
1136
1136
  const s = e.map((c) => c.name);
1137
1137
  let u, r = -1;
1138
1138
  do
1139
- r++, u = `${o}${r}`;
1139
+ r++, u = `${n}${r}`;
1140
1140
  while (s.includes(u));
1141
1141
  return a.name = u, a;
1142
1142
  }
1143
- function Ot(e, o, t, n, i, a, s, u) {
1143
+ function Bt(e, n, t, o, i, a, s, u) {
1144
1144
  const r = {
1145
1145
  fill: i,
1146
1146
  fillOpacity: t,
@@ -1151,10 +1151,10 @@ function Ot(e, o, t, n, i, a, s, u) {
1151
1151
  case "rectangle":
1152
1152
  case "polygon":
1153
1153
  return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
1154
- bt,
1154
+ St,
1155
1155
  {
1156
- size: n,
1157
- coords: o,
1156
+ size: o,
1157
+ coords: n,
1158
1158
  isClosed: !0,
1159
1159
  strokeDasharray: a ? "10, 10" : void 0,
1160
1160
  isFixed: s,
@@ -1165,10 +1165,10 @@ function Ot(e, o, t, n, i, a, s, u) {
1165
1165
  case "horizontalAxis":
1166
1166
  case "verticalAxis":
1167
1167
  return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
1168
- Do,
1168
+ Mo,
1169
1169
  {
1170
- size: n,
1171
- coords: o,
1170
+ size: o,
1171
+ coords: n,
1172
1172
  strokeDasharray: a ? "10, 10" : void 0,
1173
1173
  isFixed: s,
1174
1174
  axis: e === "horizontalAxis" ? 0 : 1,
@@ -1179,10 +1179,10 @@ function Ot(e, o, t, n, i, a, s, u) {
1179
1179
  case "line":
1180
1180
  case "polyline":
1181
1181
  return /* @__PURE__ */ l(Ze, { children: /* @__PURE__ */ l(
1182
- bt,
1182
+ St,
1183
1183
  {
1184
- size: n,
1185
- coords: o,
1184
+ size: o,
1185
+ coords: n,
1186
1186
  strokeDasharray: a ? "10, 10" : void 0,
1187
1187
  isFixed: s,
1188
1188
  onHandleChange: u,
@@ -1197,44 +1197,44 @@ function Ot(e, o, t, n, i, a, s, u) {
1197
1197
  return null;
1198
1198
  }
1199
1199
  }
1200
- function Ao(e, o, t, n, i, a) {
1201
- const s = Ft(e, t, o);
1202
- return Ot(
1200
+ function Vo(e, n, t, o, i, a) {
1201
+ const s = Ot(e, t, n);
1202
+ return Bt(
1203
1203
  e,
1204
1204
  s.getPoints(),
1205
- n,
1205
+ o,
1206
1206
  i,
1207
1207
  a ?? s.colour ?? s.defaultColour,
1208
1208
  void 0,
1209
1209
  !0
1210
1210
  );
1211
1211
  }
1212
- function Vo(e) {
1213
- const { size: o, selection: t, updateSelection: n, showHandles: i } = e, a = $t(t), s = it(), { htmlToData: u } = s, r = st((d) => d.camera), c = ne(
1212
+ function Io(e) {
1213
+ const { size: n, selection: t, updateSelection: o, showHandles: i } = e, a = Ft(t), s = at(), { htmlToData: u } = s, r = lt((d) => d.camera), c = te(
1214
1214
  (d, h) => {
1215
- const g = u(r, new D(d, h));
1215
+ const g = u(r, new w(d, h));
1216
1216
  return [g.x, g.y];
1217
1217
  },
1218
1218
  [u, r]
1219
- ), m = ne(
1219
+ ), m = te(
1220
1220
  (d) => {
1221
1221
  const h = d.onHandleChange.bind(d);
1222
- return (p, b, C = !0) => {
1222
+ return (p, b, v = !0) => {
1223
1223
  const T = c(b[0], b[1]);
1224
1224
  console.debug("UH:", p, b, T);
1225
1225
  const V = h(p, T);
1226
- return n(V, !C), V;
1226
+ return o(V, v), V;
1227
1227
  };
1228
1228
  },
1229
- [n, c]
1229
+ [o, c]
1230
1230
  );
1231
1231
  if (a !== "unknown") {
1232
1232
  const d = t.getPoints();
1233
- return /* @__PURE__ */ l(ln, { points: d, children: (...h) => Ot(
1233
+ return /* @__PURE__ */ l(rn, { points: d, children: (...h) => Bt(
1234
1234
  a,
1235
1235
  h,
1236
1236
  t.alpha,
1237
- o,
1237
+ n,
1238
1238
  t.colour ?? t.defaultColour,
1239
1239
  t.asDashed,
1240
1240
  t.fixed || !i,
@@ -1243,101 +1243,102 @@ function Vo(e) {
1243
1243
  }
1244
1244
  return console.error("Unknown selection type or has no points getter", t), null;
1245
1245
  }
1246
- function Io(e, o, t, n) {
1247
- return n && o.map((i) => /* @__PURE__ */ l(
1248
- Vo,
1246
+ function $o(e, n, t, o) {
1247
+ return o && n.map((i) => /* @__PURE__ */ l(
1248
+ Io,
1249
1249
  {
1250
1250
  size: e,
1251
1251
  selection: i,
1252
- updateSelection: n,
1252
+ updateSelection: o,
1253
1253
  showHandles: t
1254
1254
  },
1255
1255
  i.id
1256
1256
  ));
1257
1257
  }
1258
- function Bt(e, o) {
1259
- return e !== null ? `${o ? o[$t(e)] : ""} ${e.name} ${e.id}` : "No selection chosen";
1258
+ function zt(e, n) {
1259
+ return e !== null ? `${n ? n[Ft(e)] : ""} ${e.name} ${e.id}` : "No selection chosen";
1260
1260
  }
1261
- function Ct(e, o, t) {
1262
- const n = e.find((i) => i.id === o) ?? null;
1263
- return Bt(n, t);
1261
+ function Ct(e, n, t) {
1262
+ const o = e.find((i) => i.id === n) ?? null;
1263
+ return zt(o, t);
1264
1264
  }
1265
- function No(e, o) {
1266
- return sn.fromPoints(...e).hasMinSize(
1267
- o === "horizontalAxis" || o === "verticalAxis" ? 0 : 20
1265
+ function No(e, n) {
1266
+ return ln.fromPoints(...e).hasMinSize(
1267
+ n === "horizontalAxis" || n === "verticalAxis" ? 0 : 20
1268
1268
  );
1269
1269
  }
1270
- function zt(e) {
1271
- const [o, t] = M(
1270
+ var ot = /* @__PURE__ */ ((e) => (e.created = "created", e.removed = "removed", e.updated = "updated", e))(ot || {});
1271
+ function Et(e, n) {
1272
+ const [t, o] = D(
1272
1273
  e ?? []
1273
- ), n = Z(!1), [i, a] = M(!0), s = ne(
1274
- (u, r = !1, c = !1) => {
1275
- let m = null;
1276
- return u ? (m = u.id, c ? (console.debug("Clearing selection:", m), t(
1277
- (d) => d.filter((h) => h.id !== m)
1278
- )) : t((d) => {
1279
- const h = d.findIndex((p) => p.id === m);
1280
- if (n.current = h === -1, n.current)
1281
- return [...d, u];
1282
- const g = [...d];
1283
- return console.debug("Replacing", g[h], "with", u), g[h] = u, g;
1284
- })) : c && (console.debug("Clearing selections"), t([])), m;
1274
+ ), i = X(!1), [a, s] = D(!0), u = te(
1275
+ (r, c = !1, m = !1) => {
1276
+ let d = null;
1277
+ return r ? (d = r.id, m ? (console.debug("Clearing selection:", d), o(
1278
+ (h) => h.filter((g) => g.id !== d)
1279
+ ), n == null || n("removed", c, r)) : o((h) => {
1280
+ const g = h.findIndex((b) => b.id === d);
1281
+ if (i.current = g === -1, i.current)
1282
+ return n == null || n("created", c, r), [...h, r];
1283
+ const p = [...h];
1284
+ return console.debug("Replacing", p[g], "with", r), p[g] = r, n == null || n("updated", c, r), p;
1285
+ })) : m && (console.debug("Clearing selections"), o([])), d;
1285
1286
  },
1286
- [t]
1287
+ [n]
1287
1288
  );
1288
1289
  return {
1289
- selections: o,
1290
- setSelections: t,
1291
- isNewSelection: n,
1292
- updateSelection: s,
1293
- canSelect: i,
1294
- enableSelect: a
1290
+ selections: t,
1291
+ setSelections: o,
1292
+ isNewSelection: i,
1293
+ updateSelection: u,
1294
+ canSelect: a,
1295
+ enableSelect: s
1295
1296
  };
1296
1297
  }
1297
- function $o(e) {
1298
+ function Fo(e) {
1298
1299
  e.asDashed = !1;
1299
1300
  }
1300
- function vt(e) {
1301
+ function xt(e) {
1301
1302
  e.asDashed = !0;
1302
1303
  }
1303
1304
  function Ge(e) {
1304
1305
  const {
1305
- disabled: o = !1,
1306
- selectionType: t = G.rectangle,
1307
- selections: n = [],
1306
+ disabled: n = !1,
1307
+ selectionType: t = q.rectangle,
1308
+ selections: o = [],
1308
1309
  updateSelection: i,
1309
1310
  batonProps: a
1310
- } = e, s = 0.3, { canvasBox: u, dataToHtml: r } = it(), c = u.size, m = F(() => {
1311
+ } = e, s = 0.3, { canvasBox: u, dataToHtml: r } = at(), c = u.size, m = F(() => {
1311
1312
  if (i != null)
1312
- return Io(
1313
+ return $o(
1313
1314
  c,
1314
- n,
1315
+ o,
1315
1316
  (a == null ? void 0 : a.hasBaton) ?? !0,
1316
1317
  i
1317
1318
  );
1318
- }, [c, n, i, a == null ? void 0 : a.hasBaton]), d = st((p) => p.camera), h = F(() => {
1319
- const p = r(d, new D(0, 0)), b = r(d, new D(1, 1)).sub(p);
1319
+ }, [c, o, i, a == null ? void 0 : a.hasBaton]), d = lt((p) => p.camera), h = F(() => {
1320
+ const p = r(d, new w(0, 0)), b = r(d, new w(1, 1)).sub(p);
1320
1321
  return [b.x < 0, b.y < 0];
1321
- }, [d, r]), g = Lo(t);
1322
- return /* @__PURE__ */ S(te, { children: [
1323
- i && ((a == null ? void 0 : a.hasBaton) ?? !0) && !o && /* @__PURE__ */ l(
1324
- Po,
1322
+ }, [d, r]), g = ko(t);
1323
+ return /* @__PURE__ */ S(ee, { children: [
1324
+ i && ((a == null ? void 0 : a.hasBaton) ?? !0) && !n && /* @__PURE__ */ l(
1325
+ wo,
1325
1326
  {
1326
1327
  modifierKey: e.modifierKey,
1327
1328
  validate: ({ html: p }) => No(p, t),
1328
1329
  onValidSelection: ({ data: p }) => {
1329
- const b = ko(n, t, p, s);
1330
+ const b = Ao(o, t, p, s);
1330
1331
  return i(b);
1331
1332
  },
1332
1333
  minPoints: g[0],
1333
1334
  maxPoints: g[1],
1334
- children: ({ html: p }, b, C) => Ao(
1335
+ children: ({ html: p }, b, v) => Vo(
1335
1336
  t,
1336
1337
  p,
1337
1338
  h,
1338
1339
  s,
1339
1340
  c,
1340
- C ? void 0 : "#cc6677"
1341
+ v ? void 0 : "#cc6677"
1341
1342
  // orangered,
1342
1343
  )
1343
1344
  }
@@ -1345,7 +1346,7 @@ function Ge(e) {
1345
1346
  m
1346
1347
  ] });
1347
1348
  }
1348
- const Fo = {
1349
+ const Oo = {
1349
1350
  uuid: "",
1350
1351
  batonUuid: "",
1351
1352
  others: [],
@@ -1354,176 +1355,176 @@ const Fo = {
1354
1355
  },
1355
1356
  offerBaton: (e) => {
1356
1357
  }
1357
- }, Et = en(
1358
+ }, Rt = tn(
1358
1359
  {}
1359
1360
  );
1360
- function ke() {
1361
- return tn(Et);
1361
+ function Le() {
1362
+ return nn(Rt);
1362
1363
  }
1363
1364
  const Je = [0, 1];
1364
- function Ae(e) {
1365
- const [o, t] = Fe(), [n, i] = M(""), [a, s] = M(
1366
- ee.panAndWheelZoom
1367
- ), [u, r] = M(
1368
- G.line
1369
- ), [c, m] = M([
1365
+ function ke(e) {
1366
+ const [n, t] = Fe(), [o, i] = D(""), [a, s] = D(
1367
+ J.panAndWheelZoom
1368
+ ), [u, r] = D(
1369
+ q.line
1370
+ ), [c, m] = D([
1370
1371
  null,
1371
1372
  null
1372
- ]), [d, h] = M([
1373
+ ]), [d, h] = D([
1373
1374
  null,
1374
1375
  null
1375
- ]), [g, p] = M(""), [b, C] = M(""), [T, V] = M(Te.Linear), [k, w] = M(Te.Linear), [L, R] = M([
1376
+ ]), [g, p] = D(""), [b, v] = D(""), [T, V] = D(_e.Linear), [k, P] = D(_e.Linear), [L, E] = D([
1376
1377
  null,
1377
1378
  null
1378
- ]), [O, j] = M(
1379
- Te.Linear
1380
- ), [x, _] = M("equal"), [K, W] = M("Greys"), [Q, B] = Fe(), [J, ae] = Fe(), [se, Ce] = M(
1379
+ ]), [O, Y] = D(
1380
+ _e.Linear
1381
+ ), [x, _] = D("equal"), [K, G] = D("Greys"), [Z, B] = Fe(), [Q, ae] = Fe(), [ne, xe] = D(
1381
1382
  /* @__PURE__ */ new Map()
1382
- ), [we, De] = M(null), [Me, X] = M(), [fe, oe] = M(10);
1383
- E(() => {
1383
+ ), [Pe, we] = D(null), [De, j] = D(), [fe, oe] = D(10);
1384
+ z(() => {
1384
1385
  e.plotConfig.title && i(e.plotConfig.title);
1385
- }, [e.plotConfig.title, i]), E(() => {
1386
+ }, [e.plotConfig.title, i]), z(() => {
1386
1387
  e.plotConfig.xLabel && p(e.plotConfig.xLabel);
1387
- }, [e.plotConfig.xLabel, p]), E(() => {
1388
- e.plotConfig.yLabel && C(e.plotConfig.yLabel);
1389
- }, [e.plotConfig.yLabel, C]), E(() => {
1388
+ }, [e.plotConfig.xLabel, p]), z(() => {
1389
+ e.plotConfig.yLabel && v(e.plotConfig.yLabel);
1390
+ }, [e.plotConfig.yLabel, v]), z(() => {
1390
1391
  e.plotConfig.xScale && V(e.plotConfig.xScale);
1391
- }, [e.plotConfig.xScale, V]), E(() => {
1392
- e.plotConfig.yScale && w(e.plotConfig.yScale);
1393
- }, [e.plotConfig.yScale, w]);
1392
+ }, [e.plotConfig.xScale, V]), z(() => {
1393
+ e.plotConfig.yScale && P(e.plotConfig.yScale);
1394
+ }, [e.plotConfig.yScale, P]);
1394
1395
  const ge = F(
1395
- () => e.batonProps ?? Fo,
1396
+ () => e.batonProps ?? Oo,
1396
1397
  [e.batonProps]
1397
- ), N = F(
1398
+ ), I = F(
1398
1399
  () => e.xDomain ?? Je,
1399
1400
  [e.xDomain]
1400
1401
  ), $ = F(
1401
1402
  () => e.yDomain ?? Je,
1402
1403
  [e.yDomain]
1403
- ), U = F(() => e.domain ?? Je, [e.domain]);
1404
- let I = "Line";
1405
- "values" in e ? I = e.heatmapScale ? "Heatmap" : "Image" : "pointValues" in e ? I = "Scatter" : "heightValues" in e && (I = "Surface"), E(() => {
1406
- I !== "Line" && (e.heatmapScale && j(e.heatmapScale), e.surfaceScale && j(e.surfaceScale), e.showPoints !== void 0 && ae(e.showPoints), e.aspect !== void 0 && _(e.aspect), e.colourMap && W(e.colourMap));
1404
+ ), N = F(() => e.domain ?? Je, [e.domain]);
1405
+ let f = "Line";
1406
+ "values" in e ? f = e.heatmapScale ? "Heatmap" : "Image" : "pointValues" in e ? f = "Scatter" : "heightValues" in e && (f = "Surface"), z(() => {
1407
+ f !== "Line" && (e.heatmapScale && Y(e.heatmapScale), e.surfaceScale && Y(e.surfaceScale), e.showPoints !== void 0 && ae(e.showPoints), e.aspect !== void 0 && _(e.aspect), e.colourMap && G(e.colourMap));
1407
1408
  }, [
1408
- I,
1409
+ f,
1409
1410
  e.aspect,
1410
1411
  e.colourMap,
1411
1412
  e.heatmapScale,
1412
1413
  e.surfaceScale,
1413
1414
  e.showPoints,
1414
1415
  _,
1415
- W,
1416
- j,
1416
+ G,
1417
+ Y,
1417
1418
  ae
1418
1419
  ]);
1419
1420
  const {
1420
1421
  selections: y,
1421
- updateSelection: f,
1422
- setSelections: v,
1423
- canSelect: P,
1424
- enableSelect: z
1425
- } = zt([]), H = I === "Surface";
1426
- E(() => {
1427
- e.selections && v(e.selections);
1428
- }, [e.selections, v]);
1429
- const pe = F(() => {
1430
- if (H)
1431
- z(!1);
1422
+ updateSelection: C,
1423
+ setSelections: M,
1424
+ canSelect: R,
1425
+ enableSelect: H
1426
+ } = Et([], e.selectionsListener), se = f === "Surface";
1427
+ z(() => {
1428
+ e.selections && M(e.selections);
1429
+ }, [e.selections, M]);
1430
+ const Se = F(() => {
1431
+ if (se)
1432
+ H(!1);
1432
1433
  else {
1433
1434
  const Ie = e.updateSelection;
1434
- if (z(Ie !== null), Ie)
1435
+ if (H(Ie !== null), Ie)
1435
1436
  return Ie;
1436
1437
  }
1437
- return f;
1438
- }, [z, H, e.updateSelection, f]), ve = I === "Scatter";
1439
- E(() => {
1440
- ve && e.pointSize !== void 0 && oe(e.pointSize);
1441
- }, [e.pointSize, ve, oe]);
1442
- const Ye = ne(
1443
- (Ie, Zt) => {
1444
- const dt = new Map(se);
1445
- dt.set(Ie, { ...Zt }), Ce(dt);
1438
+ return C;
1439
+ }, [H, se, e.updateSelection, C]), Ve = f === "Scatter";
1440
+ z(() => {
1441
+ Ve && e.pointSize !== void 0 && oe(e.pointSize);
1442
+ }, [e.pointSize, Ve, oe]);
1443
+ const Ye = te(
1444
+ (Ie, Qt) => {
1445
+ const ht = new Map(ne);
1446
+ ht.set(Ie, { ...Qt }), xe(ht);
1446
1447
  },
1447
- [se]
1448
- ), Xt = F(() => ({
1449
- showGrid: o,
1448
+ [ne]
1449
+ ), Zt = F(() => ({
1450
+ showGrid: n,
1450
1451
  toggleShowGrid: t,
1451
- title: n,
1452
+ title: o,
1452
1453
  setTitle: i,
1453
1454
  mode: a,
1454
1455
  setMode: s,
1455
1456
  xLabel: g,
1456
1457
  setXLabel: p,
1457
1458
  yLabel: b,
1458
- setYLabel: C,
1459
+ setYLabel: v,
1459
1460
  batonProps: ge,
1460
1461
  xScaleType: T,
1461
1462
  setXScaleType: V,
1462
1463
  yScaleType: k,
1463
- setYScaleType: w,
1464
- xDomain: N,
1464
+ setYScaleType: P,
1465
+ xDomain: I,
1465
1466
  xCustomDomain: c,
1466
1467
  setXCustomDomain: m,
1467
1468
  yDomain: $,
1468
1469
  yCustomDomain: d,
1469
1470
  setYCustomDomain: h,
1470
- dDomain: U,
1471
+ dDomain: N,
1471
1472
  dCustomDomain: L,
1472
- setDCustomDomain: R,
1473
+ setDCustomDomain: E,
1473
1474
  selectionType: u,
1474
1475
  setSelectionType: r,
1475
- setHistogram: X,
1476
+ setHistogram: j,
1476
1477
  selections: y,
1477
- setSelections: v,
1478
- updateSelection: pe,
1479
- allLineParams: se,
1480
- setAllLineParams: Ce,
1478
+ setSelections: M,
1479
+ updateSelection: Se,
1480
+ allLineParams: ne,
1481
+ setAllLineParams: xe,
1481
1482
  updateLineParams: Ye,
1482
- currentLineKey: we,
1483
- setCurrentLineKey: De,
1483
+ currentLineKey: Pe,
1484
+ setCurrentLineKey: we,
1484
1485
  aspect: x,
1485
1486
  setAspect: _,
1486
1487
  dScaleType: O,
1487
- setDScaleType: j,
1488
+ setDScaleType: Y,
1488
1489
  colourMap: K,
1489
- setColourMap: W,
1490
- invertColourMap: Q,
1490
+ setColourMap: G,
1491
+ invertColourMap: Z,
1491
1492
  toggleInvertColourMap: B,
1492
- histogram: Me,
1493
+ histogram: De,
1493
1494
  scatterPointSize: fe,
1494
1495
  setScatterPointSize: oe,
1495
- showPoints: J,
1496
+ showPoints: Q,
1496
1497
  toggleShowPoints: ae,
1497
- canSelect: P,
1498
- plotType: I
1498
+ canSelect: R,
1499
+ plotType: f
1499
1500
  }), [
1500
- se,
1501
+ ne,
1501
1502
  x,
1502
1503
  ge,
1503
- P,
1504
+ R,
1504
1505
  K,
1505
- we,
1506
+ Pe,
1506
1507
  L,
1507
- U,
1508
+ N,
1508
1509
  O,
1509
- Me,
1510
- Q,
1510
+ De,
1511
+ Z,
1511
1512
  a,
1512
- pe,
1513
- I,
1513
+ Se,
1514
+ f,
1514
1515
  fe,
1515
1516
  u,
1516
1517
  y,
1517
- v,
1518
- o,
1519
- J,
1518
+ M,
1520
1519
  n,
1520
+ Q,
1521
+ o,
1521
1522
  B,
1522
1523
  t,
1523
1524
  ae,
1524
1525
  Ye,
1525
1526
  c,
1526
- N,
1527
+ I,
1527
1528
  g,
1528
1529
  T,
1529
1530
  d,
@@ -1531,66 +1532,66 @@ function Ae(e) {
1531
1532
  b,
1532
1533
  k
1533
1534
  ]);
1534
- return /* @__PURE__ */ l(Et.Provider, { value: Xt, children: e.children });
1535
+ return /* @__PURE__ */ l(Rt.Provider, { value: Zt, children: e.children });
1535
1536
  }
1536
- const Oo = "_top_cq7uz_1", Bo = "_error_cq7uz_6", zo = "_label_cq7uz_14", et = {
1537
- top: Oo,
1538
- error: Bo,
1539
- label: zo
1537
+ const Bo = "_top_cq7uz_1", zo = "_error_cq7uz_6", Eo = "_label_cq7uz_14", et = {
1538
+ top: Bo,
1539
+ error: zo,
1540
+ label: Eo
1540
1541
  };
1541
- function q(e) {
1542
- const [o, t] = M(
1542
+ function U(e) {
1543
+ const [n, t] = D(
1543
1544
  2
1544
1545
  /* VALID */
1545
- ), [n, i] = M(null), [a, s] = M(e.input), [u, r] = M(
1546
+ ), [o, i] = D(null), [a, s] = D(e.input), [u, r] = D(
1546
1547
  String(e.input)
1547
- ), c = e.submitLabel === void 0, m = e.resetButton !== !1, d = e.enableEnterKey !== !1, h = Z(null), g = c && !d, p = g && o === 1 || !g && o === 0 || c && o === 1 || !c && o === 0;
1548
+ ), c = e.submitLabel === void 0, m = e.resetButton !== !1, d = e.enableEnterKey !== !1, h = X(null), g = c && !d, p = g && n === 1 || !g && n === 0 || c && n === 1 || !c && n === 0;
1548
1549
  function b(k) {
1549
1550
  t(
1550
1551
  0
1551
1552
  /* PENDING */
1552
1553
  );
1553
- const w = k.currentTarget.value;
1554
- r(w), g && C(w);
1554
+ const P = k.currentTarget.value;
1555
+ r(P), g && v(P);
1555
1556
  }
1556
- function C(k) {
1557
+ function v(k) {
1557
1558
  if (t(
1558
1559
  0
1559
1560
  /* PENDING */
1560
1561
  ), e.isValid !== void 0) {
1561
- const [w, L] = e.isValid(k ?? u);
1562
- if (w) {
1562
+ const [P, L] = e.isValid(k ?? u);
1563
+ if (P) {
1563
1564
  t(
1564
1565
  2
1565
1566
  /* VALID */
1566
1567
  );
1567
- const R = a;
1568
- e.updateValue(L), s(L), i(R);
1568
+ const E = a;
1569
+ e.updateValue(L), s(L), i(E);
1569
1570
  } else
1570
1571
  t(
1571
1572
  1
1572
1573
  /* ERROR */
1573
1574
  );
1574
1575
  } else {
1575
- const w = k, L = a;
1576
- e.updateValue(w), s(w), i(L);
1576
+ const P = k, L = a;
1577
+ e.updateValue(P), s(P), i(L);
1577
1578
  }
1578
1579
  }
1579
1580
  const T = (k) => {
1580
- var w;
1581
- d && k.key === "Enter" && C((w = h.current) == null ? void 0 : w.value);
1581
+ var P;
1582
+ d && k.key === "Enter" && v((P = h.current) == null ? void 0 : P.value);
1582
1583
  };
1583
1584
  function V() {
1584
1585
  t(
1585
1586
  0
1586
1587
  /* PENDING */
1587
- ), console.log("previous value is ", n), n !== null && (t(
1588
+ ), console.log("previous value is ", o), o !== null && (t(
1588
1589
  2
1589
1590
  /* VALID */
1590
- ), e.updateValue(n), s(n), console.log("setting value, ", n));
1591
+ ), e.updateValue(o), s(o), console.log("setting value, ", o));
1591
1592
  }
1592
- return /* @__PURE__ */ l(te, { children: /* @__PURE__ */ S("div", { className: et.top, children: [
1593
- o === 1 && /* @__PURE__ */ S("div", { className: et.error, children: [
1593
+ return /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S("div", { className: et.top, children: [
1594
+ n === 1 && /* @__PURE__ */ S("div", { className: et.error, children: [
1594
1595
  '"',
1595
1596
  u,
1596
1597
  '" is invalid'
@@ -1599,7 +1600,7 @@ function q(e) {
1599
1600
  e.label,
1600
1601
  ":"
1601
1602
  ] }),
1602
- m && /* @__PURE__ */ l("button", { onClick: V, disabled: e.disabled, children: /* @__PURE__ */ l(Qn, {}) }),
1603
+ m && /* @__PURE__ */ l("button", { onClick: V, disabled: e.disabled, children: /* @__PURE__ */ l(Jn, {}) }),
1603
1604
  /* @__PURE__ */ l(
1604
1605
  "input",
1605
1606
  {
@@ -1614,7 +1615,7 @@ function q(e) {
1614
1615
  disabled: e.disabled,
1615
1616
  onBlur: () => {
1616
1617
  var k;
1617
- C((k = h.current) == null ? void 0 : k.value);
1618
+ v((k = h.current) == null ? void 0 : k.value);
1618
1619
  },
1619
1620
  ...e.inputAttribs
1620
1621
  }
@@ -1623,7 +1624,7 @@ function q(e) {
1623
1624
  "button",
1624
1625
  {
1625
1626
  onClick: () => {
1626
- C(void 0);
1627
+ v(void 0);
1627
1628
  },
1628
1629
  disabled: e.disabled,
1629
1630
  children: e.submitLabel
@@ -1631,30 +1632,30 @@ function q(e) {
1631
1632
  )
1632
1633
  ] }) });
1633
1634
  }
1634
- const Eo = "_modal_ftojl_1", Ro = "_modal_content_ftojl_7", Ho = "_modal_header_ftojl_16", Ko = "_modal_footer_ftojl_17", Uo = "_modal_title_ftojl_22", qo = "_modal_body_ftojl_26", Go = "_close_button_ftojl_32", Wo = "_aspect_ftojl_38", Yo = "_btn_ftojl_44", le = {
1635
- modal: Eo,
1636
- modal_content: Ro,
1637
- modal_header: Ho,
1638
- modal_footer: Ko,
1639
- modal_title: Uo,
1640
- modal_body: qo,
1641
- close_button: Go,
1642
- aspect: Wo,
1643
- btn: Yo
1635
+ const Ro = "_modal_ftojl_1", Ho = "_modal_content_ftojl_7", Ko = "_modal_header_ftojl_16", Uo = "_modal_footer_ftojl_17", qo = "_modal_title_ftojl_22", Go = "_modal_body_ftojl_26", Wo = "_close_button_ftojl_32", Yo = "_aspect_ftojl_38", jo = "_btn_ftojl_44", le = {
1636
+ modal: Ro,
1637
+ modal_content: Ho,
1638
+ modal_header: Ko,
1639
+ modal_footer: Uo,
1640
+ modal_title: qo,
1641
+ modal_body: Go,
1642
+ close_button: Wo,
1643
+ aspect: Yo,
1644
+ btn: jo
1644
1645
  };
1645
1646
  function We(e) {
1646
- const o = Z(null), [t, n] = M(!1);
1647
- Dt(o, (r) => {
1647
+ const n = X(null), [t, o] = D(!1);
1648
+ Mt(n, (r) => {
1648
1649
  r.stopPropagation();
1649
1650
  }), Be("Escape", () => {
1650
- n(!1);
1651
+ o(!1);
1651
1652
  });
1652
1653
  const i = e.title, a = i + "-toggle", s = e.hideToggle ?? !1, u = e.button ? /* @__PURE__ */ l(
1653
1654
  "button",
1654
1655
  {
1655
1656
  title: i,
1656
1657
  className: le.btn,
1657
- onClick: () => n(!0),
1658
+ onClick: () => o(!0),
1658
1659
  hidden: s,
1659
1660
  children: e.button
1660
1661
  },
@@ -1665,7 +1666,7 @@ function We(e) {
1665
1666
  label: i,
1666
1667
  icon: e.icon,
1667
1668
  onToggle: () => {
1668
- n(!0);
1669
+ o(!0);
1669
1670
  },
1670
1671
  value: !1,
1671
1672
  hidden: s
@@ -1674,7 +1675,7 @@ function We(e) {
1674
1675
  );
1675
1676
  return /* @__PURE__ */ S(ye, { children: [
1676
1677
  !s && u,
1677
- t && /* @__PURE__ */ l(Mt, { handle: "strong", nodeRef: o, children: /* @__PURE__ */ l("div", { hidden: !t, className: le.modal, ref: o, children: /* @__PURE__ */ S(
1678
+ t && /* @__PURE__ */ l(_t, { handle: "strong", nodeRef: n, children: /* @__PURE__ */ l("div", { hidden: !t, className: le.modal, ref: n, children: /* @__PURE__ */ S(
1678
1679
  "div",
1679
1680
  {
1680
1681
  className: le.modal_content,
@@ -1686,7 +1687,7 @@ function We(e) {
1686
1687
  "button",
1687
1688
  {
1688
1689
  onClick: () => {
1689
- n(!1);
1690
+ o(!1);
1690
1691
  },
1691
1692
  className: le.close_button,
1692
1693
  children: "X"
@@ -1704,27 +1705,27 @@ function We(e) {
1704
1705
  ) }) }, i)
1705
1706
  ] }, "Modal-" + i);
1706
1707
  }
1707
- function jo(e) {
1708
- const { aspect: o, setAspect: t, children: n } = e, i = Z("number"), [a, s] = M(2);
1709
- E(() => {
1710
- const r = vo(o);
1711
- console.log("Set initial type", r, o), i.current = r, s(r === "number" ? o : 2);
1712
- }, [o]);
1708
+ function Xo(e) {
1709
+ const { aspect: n, setAspect: t, children: o } = e, i = X("number"), [a, s] = D(2);
1710
+ z(() => {
1711
+ const r = xo(n);
1712
+ console.log("Set initial type", r, n), i.current = r, s(r === "number" ? n : 2);
1713
+ }, [n]);
1713
1714
  function u(r) {
1714
1715
  i.current = r, t(r === "number" ? a : r);
1715
1716
  }
1716
1717
  return We({
1717
1718
  title: "Aspect ratio",
1718
- icon: On,
1719
+ icon: Bn,
1719
1720
  hideToggle: e.hideToggle,
1720
- children: /* @__PURE__ */ S(te, { children: [
1721
+ children: /* @__PURE__ */ S(ee, { children: [
1721
1722
  /* @__PURE__ */ l("div", { className: le.aspect, children: /* @__PURE__ */ l(
1722
- q,
1723
+ U,
1723
1724
  {
1724
1725
  disabled: i.current !== "number",
1725
1726
  label: "aspect ratio",
1726
1727
  input: a,
1727
- isValid: (r) => At(r, 10),
1728
+ isValid: (r) => Vt(r, 10),
1728
1729
  inputAttribs: {
1729
1730
  name: "digits",
1730
1731
  pattern: "^\\d+|\\d+.\\d*$",
@@ -1739,88 +1740,88 @@ function jo(e) {
1739
1740
  ) }),
1740
1741
  /* @__PURE__ */ S("div", { className: le.aspect, children: [
1741
1742
  /* @__PURE__ */ S(
1742
- Y,
1743
+ W,
1743
1744
  {
1744
1745
  role: "radiogroup",
1745
1746
  ariaLabel: "aspect",
1746
1747
  value: i.current,
1747
1748
  onChange: u,
1748
1749
  children: [
1749
- /* @__PURE__ */ l(Y.Btn, { label: "number", value: "number" }),
1750
- /* @__PURE__ */ l(Y.Btn, { label: "auto", value: "auto" }),
1751
- /* @__PURE__ */ l(Y.Btn, { label: "equal", value: "equal" })
1750
+ /* @__PURE__ */ l(W.Btn, { label: "number", value: "number" }),
1751
+ /* @__PURE__ */ l(W.Btn, { label: "auto", value: "auto" }),
1752
+ /* @__PURE__ */ l(W.Btn, { label: "equal", value: "equal" })
1752
1753
  ]
1753
1754
  }
1754
1755
  ),
1755
- n
1756
+ o
1756
1757
  ] })
1757
1758
  ] })
1758
1759
  });
1759
1760
  }
1760
- const Xo = "_root_h18us_1", Zo = "_sliderContainer_h18us_8", Qo = "_slider_h18us_8", Jo = "_tools_h18us_27", ei = "_toolsInner_h18us_37", Ue = {
1761
- root: Xo,
1762
- sliderContainer: Zo,
1763
- slider: Qo,
1764
- tools: Jo,
1765
- toolsInner: ei
1761
+ const Zo = "_root_h18us_1", Qo = "_sliderContainer_h18us_8", Jo = "_slider_h18us_8", ei = "_tools_h18us_27", ti = "_toolsInner_h18us_37", Ue = {
1762
+ root: Zo,
1763
+ sliderContainer: Qo,
1764
+ slider: Jo,
1765
+ tools: ei,
1766
+ toolsInner: ti
1766
1767
  };
1767
- Jn(".3~e");
1768
- function ti(e) {
1769
- const { id: o, domainProps: t, children: n } = e;
1768
+ eo(".3~e");
1769
+ function ni(e) {
1770
+ const { id: n, domainProps: t, children: o } = e;
1770
1771
  return /* @__PURE__ */ l(
1771
1772
  "div",
1772
1773
  {
1773
- id: o,
1774
+ id: n,
1774
1775
  className: Ue.tools,
1775
1776
  role: "dialog",
1776
1777
  "aria-label": "Edit domain",
1777
1778
  children: /* @__PURE__ */ S("div", { className: Ue.toolsInner, children: [
1778
- n,
1779
- /* @__PURE__ */ l(hn, { ...t })
1779
+ o,
1780
+ /* @__PURE__ */ l(mn, { ...t })
1780
1781
  ] })
1781
1782
  }
1782
1783
  );
1783
1784
  }
1784
- const ni = "domain-tools";
1785
- function Rt(e) {
1786
- const { dataDomain: o, customDomain: t, scaleType: n } = e, { onCustomDomainChange: i, histogram: a } = e, [s, u] = M(!1), r = rn(t, o), c = F(() => s ? t : r, [s, t, r]);
1787
- E(() => {
1788
- s || i(o);
1789
- }, [o, s, i]);
1790
- const [m, d] = cn(
1785
+ const oi = "domain-tools";
1786
+ function Ht(e) {
1787
+ const { dataDomain: n, customDomain: t, scaleType: o } = e, { onCustomDomainChange: i, histogram: a } = e, [s, u] = D(!1), r = cn(t, n), c = F(() => s ? t : r, [s, t, r]);
1788
+ z(() => {
1789
+ s || i(n);
1790
+ }, [n, s, i]);
1791
+ const [m, d] = un(
1791
1792
  r,
1792
- o,
1793
- n ?? Te.Linear
1794
- ), [h, g] = M(r);
1795
- E(() => {
1793
+ n,
1794
+ o ?? _e.Linear
1795
+ ), [h, g] = D(r);
1796
+ z(() => {
1796
1797
  g(r);
1797
1798
  }, [r]);
1798
- const p = c[0] === null, b = c[1] === null, [C, T] = Fe(!1), [V, k] = Fe(!1), w = C || V;
1799
+ const p = c[0] === null, b = c[1] === null, [v, T] = Fe(!1), [V, k] = Fe(!1), P = v || V;
1799
1800
  function L(x) {
1800
1801
  T(x), k(x);
1801
1802
  }
1802
- function R() {
1803
- w && L(!1);
1803
+ function E() {
1804
+ P && L(!1);
1804
1805
  }
1805
- const O = Z(null);
1806
- Dt(O, R), Be("Escape", () => {
1807
- R();
1806
+ const O = X(null);
1807
+ Mt(O, E), Be("Escape", () => {
1808
+ E();
1808
1809
  });
1809
- const j = {
1810
+ const Y = {
1810
1811
  sliderDomain: h,
1811
- dataDomain: o,
1812
+ dataDomain: n,
1812
1813
  errors: d,
1813
1814
  isAutoMin: p,
1814
1815
  isAutoMax: b,
1815
1816
  onAutoMinToggle: () => {
1816
- const x = p ? o[0] : null;
1817
+ const x = p ? n[0] : null;
1817
1818
  i([x, c[1]]), p || T(!1);
1818
1819
  },
1819
1820
  onAutoMaxToggle: () => {
1820
- const x = b ? o[1] : null;
1821
+ const x = b ? n[1] : null;
1821
1822
  i([c[0], x]), b || k(!1);
1822
1823
  },
1823
- isEditingMin: C,
1824
+ isEditingMin: v,
1824
1825
  isEditingMax: V,
1825
1826
  onEditMin: T,
1826
1827
  onEditMax: k,
@@ -1830,12 +1831,12 @@ function Rt(e) {
1830
1831
  };
1831
1832
  return /* @__PURE__ */ S("div", { ref: O, className: Ue.root, children: [
1832
1833
  !a && /* @__PURE__ */ l("div", { className: Ue.sliderContainer, children: /* @__PURE__ */ l(
1833
- un,
1834
+ dn,
1834
1835
  {
1835
1836
  value: h,
1836
1837
  safeVisDomain: m,
1837
- dataDomain: o,
1838
- scaleType: n ?? Te.Linear,
1838
+ dataDomain: n,
1839
+ scaleType: o ?? _e.Linear,
1839
1840
  errors: d,
1840
1841
  isAutoMin: p,
1841
1842
  isAutoMax: b,
@@ -1850,12 +1851,12 @@ function Rt(e) {
1850
1851
  }
1851
1852
  }
1852
1853
  ) }),
1853
- /* @__PURE__ */ l(ti, { id: ni, domainProps: j, children: a && /* @__PURE__ */ l(
1854
- dn,
1854
+ /* @__PURE__ */ l(ni, { id: oi, domainProps: Y, children: a && /* @__PURE__ */ l(
1855
+ hn,
1855
1856
  {
1856
- dataDomain: o,
1857
+ dataDomain: n,
1857
1858
  value: h,
1858
- scaleType: n ?? Te.Linear,
1859
+ scaleType: o ?? _e.Linear,
1859
1860
  onChangeMin: (x) => i([x, c[1]]),
1860
1861
  onChangeMax: (x) => i([c[0], x]),
1861
1862
  ...a
@@ -1876,10 +1877,10 @@ function Rt(e) {
1876
1877
  ] })
1877
1878
  ] });
1878
1879
  }
1879
- Rt.displayName = "DomainConfig";
1880
+ Ht.displayName = "DomainConfig";
1880
1881
  function tt(e) {
1881
- const o = e.label && e.setLabel && /* @__PURE__ */ l(
1882
- q,
1882
+ const n = e.label && e.setLabel && /* @__PURE__ */ l(
1883
+ U,
1883
1884
  {
1884
1885
  label: "label",
1885
1886
  input: e.label,
@@ -1888,15 +1889,15 @@ function tt(e) {
1888
1889
  },
1889
1890
  "label"
1890
1891
  ), t = e.scaleType && e.setScaleType && /* @__PURE__ */ l(
1891
- mn,
1892
+ fn,
1892
1893
  {
1893
1894
  label: "scale",
1894
1895
  value: e.scaleType,
1895
1896
  onScaleChange: e.setScaleType,
1896
1897
  options: e.scaleOptions
1897
1898
  }
1898
- ), n = e.colourMap && e.setColourMap && e.invertColourMap !== void 0 && e.toggleColourMapInversion !== void 0 && /* @__PURE__ */ l(
1899
- fn,
1899
+ ), o = e.colourMap && e.setColourMap && e.invertColourMap !== void 0 && e.toggleColourMapInversion !== void 0 && /* @__PURE__ */ l(
1900
+ gn,
1900
1901
  {
1901
1902
  value: e.colourMap,
1902
1903
  onValueChange: e.setColourMap,
@@ -1904,7 +1905,7 @@ function tt(e) {
1904
1905
  onInversionChange: e.toggleColourMapInversion
1905
1906
  }
1906
1907
  ), i = e.domain && e.histogram && e.customDomain && e.setCustomDomain && /* @__PURE__ */ l(
1907
- Rt,
1908
+ Ht,
1908
1909
  {
1909
1910
  dataDomain: e.domain,
1910
1911
  customDomain: e.customDomain,
@@ -1913,13 +1914,13 @@ function tt(e) {
1913
1914
  histogram: e.histogram
1914
1915
  }
1915
1916
  ), a = e.scatterPointSize !== void 0 && e.setScatterPointSize && /* @__PURE__ */ l(
1916
- q,
1917
+ U,
1917
1918
  {
1918
1919
  label: "point size",
1919
1920
  input: e.scatterPointSize,
1920
1921
  updateValue: e.setScatterPointSize,
1921
1922
  decimalPlaces: 2,
1922
- isValid: (s) => Vt(s, !1),
1923
+ isValid: (s) => It(s, !1),
1923
1924
  disabled: !(e != null && e.hasBaton)
1924
1925
  },
1925
1926
  "point size"
@@ -1927,25 +1928,25 @@ function tt(e) {
1927
1928
  return We({
1928
1929
  title: e.title,
1929
1930
  icon: e.icon,
1930
- button: e.colourMap ? /* @__PURE__ */ l(gn, { colorMap: e.colourMap }) : null,
1931
+ button: e.colourMap ? /* @__PURE__ */ l(yn, { colorMap: e.colourMap }) : null,
1931
1932
  hideToggle: e.hideToggle,
1932
- children: /* @__PURE__ */ S(te, { children: [
1933
- o,
1934
- t,
1933
+ children: /* @__PURE__ */ S(ee, { children: [
1935
1934
  n,
1935
+ t,
1936
+ o,
1936
1937
  i,
1937
1938
  a,
1938
1939
  e.children
1939
1940
  ] })
1940
1941
  });
1941
1942
  }
1942
- function oi(e) {
1943
- const { batonUuid: o, uuid: t, others: n, hasBaton: i, offerBaton: a, requestBaton: s } = e, u = o + "*", r = F(() => i ? n.map((c) => /* @__PURE__ */ l("div", { title: "Pass baton on", children: /* @__PURE__ */ l(He, { label: c, onClick: () => a(c) }, c) }, c)) : n.map(
1944
- (c) => o == c ? /* @__PURE__ */ l("div", { title: "Request baton", children: /* @__PURE__ */ l(He, { label: u, onClick: () => s() }) }, o) : /* @__PURE__ */ l("p", { children: c }, c)
1945
- ), [u, o, i, a, n, s]);
1943
+ function ii(e) {
1944
+ const { batonUuid: n, uuid: t, others: o, hasBaton: i, offerBaton: a, requestBaton: s } = e, u = n + "*", r = F(() => i ? o.map((c) => /* @__PURE__ */ l("div", { title: "Pass baton on", children: /* @__PURE__ */ l(He, { label: c, onClick: () => a(c) }, c) }, c)) : o.map(
1945
+ (c) => n == c ? /* @__PURE__ */ l("div", { title: "Request baton", children: /* @__PURE__ */ l(He, { label: u, onClick: () => s() }) }, n) : /* @__PURE__ */ l("p", { children: c }, c)
1946
+ ), [u, n, i, a, o, s]);
1946
1947
  return We({
1947
1948
  title: "Baton info",
1948
- icon: eo,
1949
+ icon: to,
1949
1950
  hideToggle: !t,
1950
1951
  children: /* @__PURE__ */ S("div", { style: { lineHeight: "80%", width: "10em" }, children: [
1951
1952
  /* @__PURE__ */ l("p", { children: /* @__PURE__ */ S("strong", { children: [
@@ -1953,80 +1954,80 @@ function oi(e) {
1953
1954
  i ? u : t,
1954
1955
  ")"
1955
1956
  ] }) }),
1956
- !i && r && /* @__PURE__ */ S(te, { children: [
1957
+ !i && r && /* @__PURE__ */ S(ee, { children: [
1957
1958
  /* @__PURE__ */ S("p", { children: [
1958
1959
  "Other client",
1959
1960
  r.length > 1 ? "s" : ""
1960
1961
  ] }),
1961
1962
  r
1962
1963
  ] }),
1963
- i && o && r
1964
+ i && n && r
1964
1965
  ] })
1965
1966
  });
1966
1967
  }
1967
- function ii(e) {
1968
- function o() {
1969
- e.updateSelection && e.updateSelection(null, !0, !0), e.updateCurrentSelectionID(null);
1968
+ function ai(e) {
1969
+ function n() {
1970
+ e.updateSelection && e.updateSelection(null, !1, !0), e.updateCurrentSelectionID(null);
1970
1971
  }
1971
1972
  return /* @__PURE__ */ l(
1972
1973
  He,
1973
1974
  {
1974
1975
  label: "Clear all selections",
1975
1976
  onClick: () => {
1976
- window.confirm("Clear all selections?") && o();
1977
+ window.confirm("Clear all selections?") && n();
1977
1978
  },
1978
1979
  disabled: e.disabled
1979
1980
  }
1980
1981
  );
1981
1982
  }
1982
- function ai(e) {
1983
- const { value: o, onModeChange: t, hasBaton: n } = e;
1984
- return E(() => {
1985
- !n && o === ee.selectRegion && t(ee.panAndWheelZoom);
1986
- }, [o, t, n]), /* @__PURE__ */ l(te, { children: /* @__PURE__ */ S(
1987
- Y,
1983
+ function si(e) {
1984
+ const { value: n, onModeChange: t, hasBaton: o } = e;
1985
+ return z(() => {
1986
+ !o && n === J.selectRegion && t(J.panAndWheelZoom);
1987
+ }, [n, t, o]), /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S(
1988
+ W,
1988
1989
  {
1989
1990
  role: "radiogroup",
1990
1991
  ariaLabel: "mode",
1991
- value: o,
1992
+ value: n,
1992
1993
  onChange: (i) => t(i),
1993
1994
  children: [
1994
1995
  /* @__PURE__ */ l(
1995
- Y.Btn,
1996
+ W.Btn,
1996
1997
  {
1997
1998
  label: decodeURI(
1998
1999
  "pan & wheel zoom%0A alt: x-only%0A shift: y-only"
1999
2000
  ),
2000
2001
  iconOnly: !0,
2001
- icon: Kn,
2002
- value: ee.panAndWheelZoom
2002
+ icon: Un,
2003
+ value: J.panAndWheelZoom
2003
2004
  }
2004
2005
  ),
2005
2006
  /* @__PURE__ */ l(
2006
- Y.Btn,
2007
+ W.Btn,
2007
2008
  {
2008
2009
  label: decodeURI("select to zoom%0A alt: x-only%0A shift: y-only"),
2009
2010
  iconOnly: !0,
2010
- icon: Un,
2011
- value: ee.selectToZoom
2011
+ icon: qn,
2012
+ value: J.selectToZoom
2012
2013
  }
2013
2014
  ),
2014
2015
  /* @__PURE__ */ l(
2015
2016
  "div",
2016
2017
  {
2017
2018
  style: {
2018
- pointerEvents: n ? "inherit" : "auto",
2019
+ pointerEvents: o ? "inherit" : "auto",
2019
2020
  display: "inline-flex"
2020
2021
  },
2021
- title: n ? "" : "need baton",
2022
+ title: o ? "" : "need baton",
2022
2023
  children: /* @__PURE__ */ l(
2023
- Y.Btn,
2024
+ W.Btn,
2024
2025
  {
2025
2026
  label: "select region",
2026
2027
  iconOnly: !0,
2027
- icon: to,
2028
- value: ee.selectRegion,
2029
- disabled: !n
2028
+ icon: no,
2029
+ value: J.selectRegion,
2030
+ disabled: !o
2030
2031
  }
2031
2032
  )
2032
2033
  }
@@ -2035,34 +2036,34 @@ function ai(e) {
2035
2036
  }
2036
2037
  ) });
2037
2038
  }
2038
- const si = "_modeless_1im3t_1", li = "_modeless_content_1im3t_7", ri = "_modeless_header_1im3t_16", ci = "_modeless_footer_1im3t_17", ui = "_modeless_title_1im3t_22", di = "_modeless_body_1im3t_26", hi = "_close_button_1im3t_34", mi = "_aspect_1im3t_40", fi = "_btn_1im3t_46", xe = {
2039
- modeless: si,
2040
- modeless_content: li,
2041
- modeless_header: ri,
2042
- modeless_footer: ci,
2043
- modeless_title: ui,
2044
- modeless_body: di,
2045
- close_button: hi,
2046
- aspect: mi,
2047
- btn: fi
2039
+ const li = "_modeless_1im3t_1", ri = "_modeless_content_1im3t_7", ci = "_modeless_header_1im3t_16", ui = "_modeless_footer_1im3t_17", di = "_modeless_title_1im3t_22", hi = "_modeless_body_1im3t_26", mi = "_close_button_1im3t_34", fi = "_aspect_1im3t_40", gi = "_btn_1im3t_46", ve = {
2040
+ modeless: li,
2041
+ modeless_content: ri,
2042
+ modeless_header: ci,
2043
+ modeless_footer: ui,
2044
+ modeless_title: di,
2045
+ modeless_body: hi,
2046
+ close_button: mi,
2047
+ aspect: fi,
2048
+ btn: gi
2048
2049
  };
2049
- function Ht(e) {
2050
- const o = Z(null);
2050
+ function Kt(e) {
2051
+ const n = X(null);
2051
2052
  return Be("Escape", () => {
2052
2053
  e.setShowModeless(!1);
2053
- }), [e.showModeless ? /* @__PURE__ */ l(Mt, { handle: "strong", nodeRef: o, children: /* @__PURE__ */ l(
2054
+ }), [e.showModeless ? /* @__PURE__ */ l(_t, { handle: "strong", nodeRef: n, children: /* @__PURE__ */ l(
2054
2055
  "div",
2055
2056
  {
2056
2057
  hidden: !e.showModeless,
2057
- ref: o,
2058
- className: xe.modeless,
2058
+ ref: n,
2059
+ className: ve.modeless,
2059
2060
  children: /* @__PURE__ */ S(
2060
2061
  "div",
2061
2062
  {
2062
- className: xe.modeless_content,
2063
- onClick: (n) => n.stopPropagation(),
2063
+ className: ve.modeless_content,
2064
+ onClick: (o) => o.stopPropagation(),
2064
2065
  children: [
2065
- /* @__PURE__ */ l("strong", { className: "cursor", children: /* @__PURE__ */ l("div", { className: xe.modeless_header, children: /* @__PURE__ */ S("h4", { className: xe.modeless_title, children: [
2066
+ /* @__PURE__ */ l("strong", { className: "cursor", children: /* @__PURE__ */ l("div", { className: ve.modeless_header, children: /* @__PURE__ */ S("h4", { className: ve.modeless_title, children: [
2066
2067
  e.title,
2067
2068
  /* @__PURE__ */ l(
2068
2069
  "button",
@@ -2070,82 +2071,82 @@ function Ht(e) {
2070
2071
  onClick: () => {
2071
2072
  e.setShowModeless(!1);
2072
2073
  },
2073
- className: xe.close_button,
2074
+ className: ve.close_button,
2074
2075
  children: "X"
2075
2076
  }
2076
2077
  )
2077
2078
  ] }) }) }),
2078
- /* @__PURE__ */ S("div", { className: xe.modeless_body, children: [
2079
+ /* @__PURE__ */ S("div", { className: ve.modeless_body, children: [
2079
2080
  " ",
2080
2081
  e.children,
2081
2082
  " "
2082
2083
  ] }),
2083
- /* @__PURE__ */ l("div", { className: xe.modeless_footer })
2084
+ /* @__PURE__ */ l("div", { className: ve.modeless_footer })
2084
2085
  ]
2085
2086
  }
2086
2087
  )
2087
2088
  }
2088
2089
  ) }, e.title) : null];
2089
2090
  }
2090
- const gi = "_colourLabel_1evqd_1", Kt = {
2091
- colourLabel: gi
2091
+ const yi = "_colourLabel_1evqd_1", Ut = {
2092
+ colourLabel: yi
2092
2093
  };
2093
- function yi(e) {
2094
- const o = e.value ?? "Circle", t = e.onGlyphTypeChange, n = e.hasBaton;
2095
- return /* @__PURE__ */ l(te, { children: /* @__PURE__ */ S(
2096
- Y,
2094
+ function pi(e) {
2095
+ const n = e.value ?? "Circle", t = e.onGlyphTypeChange, o = e.hasBaton;
2096
+ return /* @__PURE__ */ l(ee, { children: /* @__PURE__ */ S(
2097
+ W,
2097
2098
  {
2098
2099
  role: "radiogroup",
2099
2100
  ariaLabel: "mode",
2100
- value: o,
2101
+ value: n,
2101
2102
  onChange: (i) => t(i),
2102
2103
  children: [
2103
2104
  /* @__PURE__ */ l(
2104
- Y.Btn,
2105
+ W.Btn,
2105
2106
  {
2106
2107
  label: "Circle",
2107
2108
  iconOnly: !0,
2108
- icon: no,
2109
+ icon: oo,
2109
2110
  value: "Circle",
2110
- disabled: !n
2111
+ disabled: !o
2111
2112
  }
2112
2113
  ),
2113
2114
  /* @__PURE__ */ l(
2114
- Y.Btn,
2115
+ W.Btn,
2115
2116
  {
2116
2117
  label: "Cross",
2117
2118
  iconOnly: !0,
2118
- icon: oo,
2119
+ icon: io,
2119
2120
  value: "Cross",
2120
- disabled: !n
2121
+ disabled: !o
2121
2122
  }
2122
2123
  ),
2123
2124
  /* @__PURE__ */ l(
2124
- Y.Btn,
2125
+ W.Btn,
2125
2126
  {
2126
2127
  label: "Square",
2127
2128
  iconOnly: !0,
2128
- icon: io,
2129
+ icon: ao,
2129
2130
  value: "Square",
2130
- disabled: !n
2131
+ disabled: !o
2131
2132
  }
2132
2133
  ),
2133
2134
  /* @__PURE__ */ l(
2134
2135
  "div",
2135
2136
  {
2136
2137
  style: {
2137
- pointerEvents: n ? "inherit" : "auto",
2138
+ pointerEvents: o ? "inherit" : "auto",
2138
2139
  display: "inline-flex"
2139
2140
  },
2140
- title: n ? "" : "need baton",
2141
+ title: o ? "" : "need baton",
2141
2142
  children: /* @__PURE__ */ l(
2142
- Y.Btn,
2143
+ W.Btn,
2143
2144
  {
2144
2145
  label: "Cap",
2145
2146
  iconOnly: !0,
2146
- icon: Bn,
2147
+ icon: zn,
2147
2148
  value: "Cap",
2148
- disabled: !n
2149
+ disabled: !o
2149
2150
  }
2150
2151
  )
2151
2152
  }
@@ -2154,12 +2155,12 @@ function yi(e) {
2154
2155
  }
2155
2156
  ) });
2156
2157
  }
2157
- function pi(e) {
2158
- const { currentLineKey: o, allLineParams: t, updateLineParams: n, hasBaton: i } = e;
2159
- console.log("currentLineKey is ", o);
2158
+ function bi(e) {
2159
+ const { currentLineKey: n, allLineParams: t, updateLineParams: o, hasBaton: i } = e;
2160
+ console.log("currentLineKey is ", n);
2160
2161
  const a = [];
2161
- if (o !== null && t.has(o)) {
2162
- const s = t.get(o);
2162
+ if (n !== null && t.has(n)) {
2163
+ const s = t.get(n);
2163
2164
  if (s) {
2164
2165
  const u = s.colour ?? "#000000";
2165
2166
  a.push(
@@ -2167,7 +2168,7 @@ function pi(e) {
2167
2168
  /* @__PURE__ */ l(
2168
2169
  "div",
2169
2170
  {
2170
- className: Kt.colourLabel,
2171
+ className: Ut.colourLabel,
2171
2172
  style: { borderLeftColor: u },
2172
2173
  children: u
2173
2174
  },
@@ -2175,11 +2176,11 @@ function pi(e) {
2175
2176
  ),
2176
2177
  /* @__PURE__ */ l("br", {}, "colour spacer"),
2177
2178
  i && /* @__PURE__ */ l(
2178
- _t,
2179
+ Tt,
2179
2180
  {
2180
2181
  color: u,
2181
2182
  onChange: (r) => {
2182
- s.colour = r, n(o, s);
2183
+ s.colour = r, o(n, s);
2183
2184
  }
2184
2185
  },
2185
2186
  "colour picker"
@@ -2187,12 +2188,12 @@ function pi(e) {
2187
2188
  ] }, "line colour")
2188
2189
  ), a.push(
2189
2190
  /* @__PURE__ */ l(
2190
- q,
2191
+ U,
2191
2192
  {
2192
2193
  label: "colour",
2193
2194
  input: s.colour ?? "",
2194
2195
  updateValue: (r) => {
2195
- s.colour = r, n(o, s);
2196
+ s.colour = r, o(n, s);
2196
2197
  },
2197
2198
  disabled: !i
2198
2199
  },
@@ -2200,12 +2201,12 @@ function pi(e) {
2200
2201
  )
2201
2202
  ), a.push(
2202
2203
  /* @__PURE__ */ l(
2203
- q,
2204
+ U,
2204
2205
  {
2205
2206
  label: "name",
2206
2207
  input: s.name,
2207
2208
  updateValue: (r) => {
2208
- s.name = r, n(o, s);
2209
+ s.name = r, o(n, s);
2209
2210
  },
2210
2211
  disabled: !i
2211
2212
  },
@@ -2218,7 +2219,7 @@ function pi(e) {
2218
2219
  label: "Line on",
2219
2220
  value: s.lineOn,
2220
2221
  onToggle: () => {
2221
- (s.pointSize || !s.lineOn) && (s.lineOn = !s.lineOn, n(o, s));
2222
+ (s.pointSize || !s.lineOn) && (s.lineOn = !s.lineOn, o(n, s));
2222
2223
  },
2223
2224
  disabled: !i || s.pointSize == null || s.pointSize == 0
2224
2225
  },
@@ -2226,14 +2227,14 @@ function pi(e) {
2226
2227
  )
2227
2228
  ), a.push(
2228
2229
  /* @__PURE__ */ l(
2229
- yi,
2230
+ pi,
2230
2231
  {
2231
2232
  value: s.glyphType,
2232
2233
  onGlyphTypeChange: (r) => {
2233
2234
  console.log(
2234
2235
  "calling onGlyphTypeChange with cLine ",
2235
- o
2236
- ), s.glyphType = r, n(o, s);
2236
+ n
2237
+ ), s.glyphType = r, o(n, s);
2237
2238
  },
2238
2239
  hasBaton: i
2239
2240
  },
@@ -2241,15 +2242,15 @@ function pi(e) {
2241
2242
  )
2242
2243
  ), a.push(
2243
2244
  /* @__PURE__ */ l(
2244
- q,
2245
+ U,
2245
2246
  {
2246
2247
  label: "point size",
2247
2248
  input: s.pointSize ?? 0,
2248
2249
  updateValue: (r) => {
2249
- r == 0 && s.lineOn ? (s.pointSize = void 0, n(o, s)) : r >= 0 && (s.pointSize = r, n(o, s));
2250
+ r == 0 && s.lineOn ? (s.pointSize = void 0, o(n, s)) : r >= 0 && (s.pointSize = r, o(n, s));
2250
2251
  },
2251
2252
  decimalPlaces: 2,
2252
- isValid: (r) => Vt(r, s.lineOn),
2253
+ isValid: (r) => It(r, s.lineOn),
2253
2254
  disabled: !i
2254
2255
  },
2255
2256
  "point size"
@@ -2257,26 +2258,26 @@ function pi(e) {
2257
2258
  );
2258
2259
  }
2259
2260
  }
2260
- return Ht({
2261
+ return Kt({
2261
2262
  title: "Line",
2262
2263
  showModeless: e.showLineConfig,
2263
2264
  setShowModeless: e.updateShowLineConfig,
2264
2265
  children: a
2265
2266
  });
2266
2267
  }
2267
- function bi(e) {
2268
- const { allLineParams: o, lineKey: t, onLineKeyChange: n } = e, i = [...o.keys()];
2268
+ function Si(e) {
2269
+ const { allLineParams: n, lineKey: t, onLineKeyChange: o } = e, i = [...n.keys()];
2269
2270
  function a() {
2270
- t === "" && i.length > 0 && n(i[0]);
2271
+ t === "" && i.length > 0 && o(i[0]);
2271
2272
  }
2272
2273
  a();
2273
2274
  const s = "#ffffff";
2274
2275
  function u(h) {
2275
- const g = o.get(h);
2276
+ const g = n.get(h);
2276
2277
  return (g == null ? void 0 : g.colour) ?? s;
2277
2278
  }
2278
2279
  function r(h) {
2279
- const g = o.get(h);
2280
+ const g = n.get(h);
2280
2281
  return (g == null ? void 0 : g.name) ?? "Line";
2281
2282
  }
2282
2283
  function c(h) {
@@ -2296,7 +2297,7 @@ function bi(e) {
2296
2297
  })
2297
2298
  );
2298
2299
  return /* @__PURE__ */ l(
2299
- Tt,
2300
+ Lt,
2300
2301
  {
2301
2302
  styles: m,
2302
2303
  value: {
@@ -2309,150 +2310,150 @@ function bi(e) {
2309
2310
  t || a();
2310
2311
  },
2311
2312
  onChange: (h) => {
2312
- h !== null && n(h.value);
2313
+ h !== null && o(h.value);
2313
2314
  }
2314
2315
  }
2315
2316
  );
2316
2317
  }
2317
- const Si = "_option_1qhtz_1", Ci = "_icon_1qhtz_6", xt = {
2318
- option: Si,
2318
+ const vi = "_option_1qhtz_1", Ci = "_icon_1qhtz_6", Pt = {
2319
+ option: vi,
2319
2320
  icon: Ci
2320
- }, vi = {
2321
- [G.line]: {
2322
- Icon: $n,
2321
+ }, xi = {
2322
+ [q.line]: {
2323
+ Icon: Fn,
2323
2324
  label: "Line"
2324
2325
  },
2325
- [G.rectangle]: {
2326
- Icon: zn,
2326
+ [q.rectangle]: {
2327
+ Icon: En,
2327
2328
  label: "Rectangle"
2328
2329
  },
2329
- [G.polyline]: {
2330
- Icon: En,
2330
+ [q.polyline]: {
2331
+ Icon: Rn,
2331
2332
  label: "Polyline"
2332
2333
  },
2333
- [G.polygon]: {
2334
- Icon: qn,
2334
+ [q.polygon]: {
2335
+ Icon: Gn,
2335
2336
  label: "Polygon"
2336
2337
  },
2337
- [G.circle]: {
2338
- Icon: Gn,
2338
+ [q.circle]: {
2339
+ Icon: Wn,
2339
2340
  label: "Circle"
2340
2341
  },
2341
- [G.ellipse]: {
2342
- Icon: Wn,
2342
+ [q.ellipse]: {
2343
+ Icon: Yn,
2343
2344
  label: "Ellipse"
2344
2345
  },
2345
- [G.sector]: {
2346
- Icon: lo,
2346
+ [q.sector]: {
2347
+ Icon: ro,
2347
2348
  label: "Sector"
2348
2349
  },
2349
- [G.horizontalAxis]: {
2350
- Icon: ao,
2350
+ [q.horizontalAxis]: {
2351
+ Icon: so,
2351
2352
  label: "Horizontal Axis"
2352
2353
  },
2353
- [G.verticalAxis]: {
2354
- Icon: so,
2354
+ [q.verticalAxis]: {
2355
+ Icon: lo,
2355
2356
  label: "Vertical Axis"
2356
2357
  },
2357
- [G.unknown]: {
2358
- Icon: Yn,
2358
+ [q.unknown]: {
2359
+ Icon: jn,
2359
2360
  label: "Unknown"
2360
2361
  }
2361
2362
  };
2362
- function xi(e) {
2363
- const { option: o } = e, { Icon: t, label: n } = vi[o];
2364
- return /* @__PURE__ */ S("div", { className: xt.option, children: [
2365
- /* @__PURE__ */ l(t, { className: xt.icon }),
2366
- /* @__PURE__ */ l("span", { children: n })
2363
+ function Pi(e) {
2364
+ const { option: n } = e, { Icon: t, label: o } = xi[n];
2365
+ return /* @__PURE__ */ S("div", { className: Pt.option, children: [
2366
+ /* @__PURE__ */ l(t, { className: Pt.icon }),
2367
+ /* @__PURE__ */ l("span", { children: o })
2367
2368
  ] });
2368
2369
  }
2369
- function Pi(e) {
2370
+ function wi(e) {
2370
2371
  const {
2371
- value: o,
2372
+ value: n,
2372
2373
  onSelectionTypeChange: t,
2373
- disabled: n,
2374
+ disabled: o,
2374
2375
  options: i = [
2375
- G.line,
2376
- G.rectangle,
2377
- G.horizontalAxis,
2378
- G.verticalAxis,
2379
- G.polygon,
2380
- G.polyline
2376
+ q.line,
2377
+ q.rectangle,
2378
+ q.horizontalAxis,
2379
+ q.verticalAxis,
2380
+ q.polygon,
2381
+ q.polyline
2381
2382
  ]
2382
2383
  } = e;
2383
2384
  return /* @__PURE__ */ l(
2384
- yn,
2385
+ pn,
2385
2386
  {
2386
- value: o,
2387
+ value: n,
2387
2388
  onChange: t,
2388
2389
  options: i,
2389
- renderOption: (a) => /* @__PURE__ */ l(xi, { option: a }),
2390
- disabled: n
2390
+ renderOption: (a) => /* @__PURE__ */ l(Pi, { option: a }),
2391
+ disabled: o
2391
2392
  }
2392
2393
  );
2393
2394
  }
2394
- function Ut(e) {
2395
- const { selection: o, updateSelection: t, disabled: n } = e;
2395
+ function qt(e) {
2396
+ const { selection: n, updateSelection: t, disabled: o } = e;
2396
2397
  return /* @__PURE__ */ l(
2397
- q,
2398
+ U,
2398
2399
  {
2399
2400
  label: "angle",
2400
- input: o.angle * 180 / Math.PI,
2401
+ input: n.angle * 180 / Math.PI,
2401
2402
  decimalPlaces: 5,
2402
2403
  updateValue: (i) => {
2403
2404
  const a = i * (Math.PI / 180);
2404
- o.setAngle(a), t && t(o);
2405
+ n.setAngle(a), t && t(n);
2405
2406
  },
2406
2407
  isValid: (i) => he(i),
2407
- disabled: n
2408
+ disabled: o
2408
2409
  },
2409
2410
  "angle"
2410
2411
  );
2411
2412
  }
2412
- function ct(e) {
2413
- const { selection: o, updateSelection: t, disabled: n } = e;
2413
+ function ut(e) {
2414
+ const { selection: n, updateSelection: t, disabled: o } = e;
2414
2415
  return /* @__PURE__ */ l(
2415
- q,
2416
+ U,
2416
2417
  {
2417
2418
  label: "x",
2418
- input: o.start[0],
2419
+ input: n.start[0],
2419
2420
  decimalPlaces: 8,
2420
2421
  updateValue: (i) => {
2421
- o.setStart(0, i), t && t(o);
2422
+ n.setStart(0, i), t && t(n);
2422
2423
  },
2423
2424
  isValid: (i) => he(i),
2424
- disabled: n
2425
+ disabled: o
2425
2426
  },
2426
2427
  "x"
2427
2428
  );
2428
2429
  }
2429
- function ut(e) {
2430
- const { selection: o, updateSelection: t, disabled: n } = e;
2430
+ function dt(e) {
2431
+ const { selection: n, updateSelection: t, disabled: o } = e;
2431
2432
  return /* @__PURE__ */ l(
2432
- q,
2433
+ U,
2433
2434
  {
2434
2435
  label: "y",
2435
- input: o.start[1],
2436
+ input: n.start[1],
2436
2437
  decimalPlaces: 8,
2437
2438
  updateValue: (i) => {
2438
- o.setStart(1, i), t && t(o);
2439
+ n.setStart(1, i), t && t(n);
2439
2440
  },
2440
2441
  isValid: (i) => he(i),
2441
- disabled: n
2442
+ disabled: o
2442
2443
  },
2443
2444
  "y"
2444
2445
  );
2445
2446
  }
2446
- function wi(e) {
2447
- const { i: o, point: t, updatePoint: n, disabled: i } = e, a = `x${o}`;
2447
+ function Di(e) {
2448
+ const { i: n, point: t, updatePoint: o, disabled: i } = e, a = `x${n}`;
2448
2449
  return /* @__PURE__ */ l(
2449
- q,
2450
+ U,
2450
2451
  {
2451
2452
  label: a,
2452
2453
  input: t[0],
2453
2454
  decimalPlaces: 8,
2454
2455
  updateValue: (s) => {
2455
- t[0] = s, n(t);
2456
+ t[0] = s, o(t);
2456
2457
  },
2457
2458
  isValid: (s) => he(s),
2458
2459
  disabled: i
@@ -2460,16 +2461,16 @@ function wi(e) {
2460
2461
  a
2461
2462
  );
2462
2463
  }
2463
- function Di(e) {
2464
- const { i: o, point: t, updatePoint: n, disabled: i } = e, a = `y${o}`;
2464
+ function Mi(e) {
2465
+ const { i: n, point: t, updatePoint: o, disabled: i } = e, a = `y${n}`;
2465
2466
  return /* @__PURE__ */ l(
2466
- q,
2467
+ U,
2467
2468
  {
2468
2469
  label: a,
2469
2470
  input: t[1],
2470
2471
  decimalPlaces: 8,
2471
2472
  updateValue: (s) => {
2472
- t[1] = s, n(t);
2473
+ t[1] = s, o(t);
2473
2474
  },
2474
2475
  isValid: (s) => he(s),
2475
2476
  disabled: i
@@ -2477,197 +2478,197 @@ function Di(e) {
2477
2478
  a
2478
2479
  );
2479
2480
  }
2480
- function Mi(e) {
2481
- const { selection: o, updateSelection: t, disabled: n } = e;
2482
- return o.dimension === 0 ? /* @__PURE__ */ S(ye, { children: [
2481
+ function _i(e) {
2482
+ const { selection: n, updateSelection: t, disabled: o } = e;
2483
+ return n.dimension === 0 ? /* @__PURE__ */ S(ye, { children: [
2483
2484
  /* @__PURE__ */ l(
2484
- ct,
2485
+ ut,
2485
2486
  {
2486
- selection: o,
2487
+ selection: n,
2487
2488
  updateSelection: t,
2488
- disabled: n
2489
+ disabled: o
2489
2490
  },
2490
- `XInput${o.vStart.x}`
2491
+ `XInput${n.vStart.x}`
2491
2492
  ),
2492
2493
  /* @__PURE__ */ l(
2493
- q,
2494
+ U,
2494
2495
  {
2495
2496
  label: "x length",
2496
- input: o.length,
2497
+ input: n.length,
2497
2498
  updateValue: (i) => {
2498
- o.length = i, t && t(o);
2499
+ n.length = i, t && t(n);
2499
2500
  },
2500
2501
  decimalPlaces: 8,
2501
2502
  isValid: (i) => he(i),
2502
- disabled: n
2503
+ disabled: o
2503
2504
  },
2504
- `XLength${o.length}`
2505
+ `XLength${n.length}`
2505
2506
  )
2506
2507
  ] }, "axis x") : /* @__PURE__ */ S(ye, { children: [
2507
2508
  /* @__PURE__ */ l(
2508
- ut,
2509
+ dt,
2509
2510
  {
2510
- selection: o,
2511
+ selection: n,
2511
2512
  updateSelection: t,
2512
- disabled: n
2513
+ disabled: o
2513
2514
  },
2514
- `YInput${o.vStart.y}`
2515
+ `YInput${n.vStart.y}`
2515
2516
  ),
2516
2517
  /* @__PURE__ */ l(
2517
- q,
2518
+ U,
2518
2519
  {
2519
2520
  label: "y length",
2520
- input: o.length,
2521
+ input: n.length,
2521
2522
  updateValue: (i) => {
2522
- o.length = i, t && t(o);
2523
+ n.length = i, t && t(n);
2523
2524
  },
2524
2525
  decimalPlaces: 8,
2525
2526
  isValid: (i) => he(i),
2526
- disabled: n
2527
+ disabled: o
2527
2528
  },
2528
- `YLength${o.length}`
2529
+ `YLength${n.length}`
2529
2530
  )
2530
2531
  ] }, "axis y");
2531
2532
  }
2532
- function _i(e) {
2533
- const { selection: o, updateSelection: t, disabled: n } = e;
2533
+ function Ti(e) {
2534
+ const { selection: n, updateSelection: t, disabled: o } = e;
2534
2535
  return /* @__PURE__ */ S(ye, { children: [
2535
2536
  /* @__PURE__ */ l(
2536
- ct,
2537
+ ut,
2537
2538
  {
2538
- selection: o,
2539
+ selection: n,
2539
2540
  updateSelection: t,
2540
- disabled: n
2541
+ disabled: o
2541
2542
  },
2542
- `XInput${o.vStart.x}`
2543
+ `XInput${n.vStart.x}`
2543
2544
  ),
2544
2545
  /* @__PURE__ */ l(
2545
- ut,
2546
+ dt,
2546
2547
  {
2547
- selection: o,
2548
+ selection: n,
2548
2549
  updateSelection: t,
2549
- disabled: n
2550
+ disabled: o
2550
2551
  },
2551
- `YInput${o.vStart.y}`
2552
+ `YInput${n.vStart.y}`
2552
2553
  ),
2553
2554
  /* @__PURE__ */ l(
2554
- Ut,
2555
+ qt,
2555
2556
  {
2556
- selection: o,
2557
+ selection: n,
2557
2558
  updateSelection: t,
2558
- disabled: n
2559
+ disabled: o
2559
2560
  },
2560
- `Angle${o.angle}`
2561
+ `Angle${n.angle}`
2561
2562
  ),
2562
2563
  /* @__PURE__ */ l(
2563
- q,
2564
+ U,
2564
2565
  {
2565
2566
  label: "length",
2566
- input: o.length,
2567
+ input: n.length,
2567
2568
  updateValue: (i) => {
2568
- o.length = i, t && t(o);
2569
+ n.length = i, t && t(n);
2569
2570
  },
2570
2571
  decimalPlaces: 8,
2571
2572
  isValid: (i) => he(i),
2572
- disabled: n
2573
+ disabled: o
2573
2574
  },
2574
- `Length${o.length}`
2575
+ `Length${n.length}`
2575
2576
  )
2576
2577
  ] }, "line");
2577
2578
  }
2578
- function Ti(e) {
2579
- const { selection: o, updateSelection: t, disabled: n } = e;
2579
+ function Li(e) {
2580
+ const { selection: n, updateSelection: t, disabled: o } = e;
2580
2581
  return /* @__PURE__ */ S(ye, { children: [
2581
2582
  /* @__PURE__ */ l(
2582
- ct,
2583
+ ut,
2583
2584
  {
2584
- selection: o,
2585
+ selection: n,
2585
2586
  updateSelection: t,
2586
- disabled: n
2587
+ disabled: o
2587
2588
  },
2588
- `XInput${o.vStart.x}`
2589
+ `XInput${n.vStart.x}`
2589
2590
  ),
2590
2591
  /* @__PURE__ */ l(
2591
- ut,
2592
+ dt,
2592
2593
  {
2593
- selection: o,
2594
+ selection: n,
2594
2595
  updateSelection: t,
2595
- disabled: n
2596
+ disabled: o
2596
2597
  },
2597
- `YInput${o.vStart.y}`
2598
+ `YInput${n.vStart.y}`
2598
2599
  ),
2599
2600
  /* @__PURE__ */ l(
2600
- Ut,
2601
+ qt,
2601
2602
  {
2602
- selection: o,
2603
+ selection: n,
2603
2604
  updateSelection: t,
2604
- disabled: n
2605
+ disabled: o
2605
2606
  },
2606
- `Angle${o.angle}`
2607
+ `Angle${n.angle}`
2607
2608
  ),
2608
2609
  /* @__PURE__ */ l(
2609
- q,
2610
+ U,
2610
2611
  {
2611
2612
  label: "x length",
2612
- input: o.lengths[0],
2613
+ input: n.lengths[0],
2613
2614
  updateValue: (i) => {
2614
- o.lengths[0] = i, t && t(o);
2615
+ n.lengths[0] = i, t && t(n);
2615
2616
  },
2616
2617
  decimalPlaces: 8,
2617
2618
  isValid: (i) => he(i),
2618
- disabled: n
2619
+ disabled: o
2619
2620
  },
2620
- `XLength${o.lengths[0]}`
2621
+ `XLength${n.lengths[0]}`
2621
2622
  ),
2622
2623
  /* @__PURE__ */ l(
2623
- q,
2624
+ U,
2624
2625
  {
2625
2626
  label: "y length",
2626
- input: o.lengths[1],
2627
+ input: n.lengths[1],
2627
2628
  updateValue: (i) => {
2628
- o.lengths[1] = i, t && t(o);
2629
+ n.lengths[1] = i, t && t(n);
2629
2630
  },
2630
2631
  decimalPlaces: 8,
2631
2632
  isValid: (i) => he(i),
2632
- disabled: n
2633
+ disabled: o
2633
2634
  },
2634
- `YLength${o.lengths[1]}`
2635
+ `YLength${n.lengths[1]}`
2635
2636
  )
2636
2637
  ] }, "rectangle");
2637
2638
  }
2638
- const Li = "_scrollContainer_a4950_1", ki = {
2639
- scrollContainer: Li
2639
+ const ki = "_scrollContainer_a4950_1", Ai = {
2640
+ scrollContainer: ki
2640
2641
  };
2641
- function Ai(e) {
2642
- const { selection: o, updateSelection: t, disabled: n } = e;
2642
+ function Vi(e) {
2643
+ const { selection: n, updateSelection: t, disabled: o } = e;
2643
2644
  function i(s, u) {
2644
- o.points[u] = s, t && t(o);
2645
+ n.points[u] = s, t && t(n);
2645
2646
  }
2646
- const a = o.points.map((s, u) => [
2647
+ const a = n.points.map((s, u) => [
2647
2648
  /* @__PURE__ */ l(
2648
- wi,
2649
+ Di,
2649
2650
  {
2650
2651
  i: u,
2651
2652
  point: s,
2652
2653
  updatePoint: (r) => i(r, u),
2653
- disabled: n
2654
+ disabled: o
2654
2655
  },
2655
2656
  `px${u}${s[0]}`
2656
2657
  ),
2657
2658
  /* @__PURE__ */ l(
2658
- Di,
2659
+ Mi,
2659
2660
  {
2660
2661
  i: u,
2661
2662
  point: s,
2662
2663
  updatePoint: (r) => i(r, u),
2663
- disabled: n
2664
+ disabled: o
2664
2665
  },
2665
2666
  `py${u}${s[1]}`
2666
2667
  )
2667
2668
  ]);
2668
- return /* @__PURE__ */ l("div", { className: ki.scrollContainer, children: a.flat() }, "polygon");
2669
+ return /* @__PURE__ */ l("div", { className: Ai.scrollContainer, children: a.flat() }, "polygon");
2669
2670
  }
2670
- const ot = {
2671
+ const it = {
2671
2672
  line: "—",
2672
2673
  rectangle: "▭",
2673
2674
  polyline: "⦚",
@@ -2679,46 +2680,46 @@ const ot = {
2679
2680
  verticalAxis: "↕",
2680
2681
  unknown: " "
2681
2682
  };
2682
- function Vi(e) {
2683
+ function Ii(e) {
2683
2684
  const {
2684
- currentSelectionID: o,
2685
+ currentSelectionID: n,
2685
2686
  updateCurrentSelectionID: t,
2686
- selections: n,
2687
+ selections: o,
2687
2688
  updateSelection: i,
2688
2689
  hasBaton: a
2689
- } = e, [s, u] = M(null);
2690
- E(() => {
2691
- if (n.length > 0) {
2692
- const m = n.find((d) => d.id === o) ?? n[0];
2690
+ } = e, [s, u] = D(null);
2691
+ z(() => {
2692
+ if (o.length > 0) {
2693
+ const m = o.find((d) => d.id === n) ?? o[0];
2693
2694
  u(m);
2694
2695
  }
2695
- }, [o, n]);
2696
- const r = ne(() => {
2697
- if (o) {
2698
- const m = n.find((d) => d.id === o);
2696
+ }, [n, o]);
2697
+ const r = te(() => {
2698
+ if (n) {
2699
+ const m = o.find((d) => d.id === n);
2699
2700
  if (m) {
2700
2701
  let d;
2701
- if (Object.hasOwn(n, "findLast"))
2702
- d = n.findLast(
2703
- (h) => h.id !== o
2702
+ if (Object.hasOwn(o, "findLast"))
2703
+ d = o.findLast(
2704
+ (h) => h.id !== n
2704
2705
  );
2705
2706
  else {
2706
- const h = n.filter(
2707
- (p) => p.id !== o
2707
+ const h = o.filter(
2708
+ (p) => p.id !== n
2708
2709
  ), g = h.length - 1;
2709
2710
  g >= 0 && (d = h[g]);
2710
2711
  }
2711
- i && i(m, !0, !0), d && t(d.id);
2712
+ i && i(m, !1, !0), d && t(d.id);
2712
2713
  }
2713
2714
  }
2714
2715
  }, [
2715
- o,
2716
2716
  n,
2717
+ o,
2717
2718
  t,
2718
2719
  i
2719
2720
  ]), c = [];
2720
2721
  if (c.push(
2721
- /* @__PURE__ */ l("h4", { children: Bt(s, ot) }, `ID${o}`)
2722
+ /* @__PURE__ */ l("h4", { children: zt(s, it) }, `ID${n}`)
2722
2723
  ), s !== null) {
2723
2724
  const m = s;
2724
2725
  c.push(
@@ -2726,7 +2727,7 @@ function Vi(e) {
2726
2727
  /* @__PURE__ */ l(
2727
2728
  "div",
2728
2729
  {
2729
- className: Kt.colourLabel,
2730
+ className: Ut.colourLabel,
2730
2731
  style: { borderLeftColor: s.colour },
2731
2732
  children: s.colour
2732
2733
  },
@@ -2734,7 +2735,7 @@ function Vi(e) {
2734
2735
  ),
2735
2736
  /* @__PURE__ */ l("br", {}, "colour spacer"),
2736
2737
  a && /* @__PURE__ */ l(
2737
- _t,
2738
+ Tt,
2738
2739
  {
2739
2740
  color: s.colour,
2740
2741
  onChange: (h) => {
@@ -2748,7 +2749,7 @@ function Vi(e) {
2748
2749
  const d = !a;
2749
2750
  c.push(
2750
2751
  /* @__PURE__ */ l(
2751
- q,
2752
+ U,
2752
2753
  {
2753
2754
  label: "name",
2754
2755
  input: s.name,
@@ -2761,7 +2762,7 @@ function Vi(e) {
2761
2762
  )
2762
2763
  ), c.push(
2763
2764
  /* @__PURE__ */ l(
2764
- q,
2765
+ U,
2765
2766
  {
2766
2767
  label: "alpha",
2767
2768
  input: s.alpha,
@@ -2769,31 +2770,31 @@ function Vi(e) {
2769
2770
  h <= 1 && h >= 0 && (m.alpha = h, i && i(m));
2770
2771
  },
2771
2772
  decimalPlaces: 2,
2772
- isValid: (h) => At(h, 1, !0),
2773
+ isValid: (h) => Vt(h, 1, !0),
2773
2774
  disabled: d
2774
2775
  },
2775
2776
  `Alpha${s.alpha}`
2776
2777
  )
2777
2778
  ), ce.isShape(m) ? c.push(
2778
- Mi({
2779
+ _i({
2779
2780
  selection: m,
2780
2781
  updateSelection: i,
2781
2782
  disabled: d
2782
2783
  })
2783
2784
  ) : ue.isShape(m) ? c.push(
2784
- _i({
2785
+ Ti({
2785
2786
  selection: m,
2786
2787
  updateSelection: i,
2787
2788
  disabled: d
2788
2789
  })
2789
2790
  ) : de.isShape(m) ? c.push(
2790
- Ti({
2791
+ Li({
2791
2792
  selection: m,
2792
2793
  updateSelection: i,
2793
2794
  disabled: d
2794
2795
  })
2795
2796
  ) : ie.isShape(m) && c.push(
2796
- Ai({
2797
+ Vi({
2797
2798
  selection: m,
2798
2799
  updateSelection: i,
2799
2800
  disabled: d
@@ -2812,20 +2813,20 @@ function Vi(e) {
2812
2813
  )
2813
2814
  );
2814
2815
  }
2815
- return Ht({
2816
+ return Kt({
2816
2817
  title: "Selections",
2817
2818
  showModeless: e.showSelectionConfig,
2818
2819
  setShowModeless: e.updateShowSelectionConfig,
2819
2820
  children: c
2820
2821
  });
2821
2822
  }
2822
- function Ii(e) {
2823
+ function $i(e) {
2823
2824
  const {
2824
- selectionID: o,
2825
+ selectionID: n,
2825
2826
  onSelectionIDChange: t,
2826
- options: n = e.selections.map((r) => r.id)
2827
+ options: o = e.selections.map((r) => r.id)
2827
2828
  } = e;
2828
- o === "" && e.selections.length > 0 && (console.log(
2829
+ n === "" && e.selections.length > 0 && (console.log(
2829
2830
  "Setting selectionID to default selection: ",
2830
2831
  e.selections[0]
2831
2832
  ), t(e.selections[0].id));
@@ -2840,25 +2841,25 @@ function Ii(e) {
2840
2841
  // eslint-disable-next-line react/prop-types
2841
2842
  backgroundColor: c.data.bgcolour
2842
2843
  })
2843
- }, u = n.map(
2844
+ }, u = o.map(
2844
2845
  (r) => ({
2845
2846
  value: r,
2846
- label: Ct(e.selections, r, ot),
2847
+ label: Ct(e.selections, r, it),
2847
2848
  bgcolour: a(r)
2848
2849
  })
2849
2850
  );
2850
2851
  return /* @__PURE__ */ l(
2851
- Tt,
2852
+ Lt,
2852
2853
  {
2853
2854
  styles: s,
2854
2855
  value: {
2855
- value: o,
2856
+ value: n,
2856
2857
  label: Ct(
2857
2858
  e.selections,
2858
- o,
2859
- ot
2859
+ n,
2860
+ it
2860
2861
  ),
2861
- bgcolour: a(o ?? "")
2862
+ bgcolour: a(n ?? "")
2862
2863
  },
2863
2864
  options: u,
2864
2865
  onChange: (r) => {
@@ -2870,9 +2871,9 @@ function Ii(e) {
2870
2871
  function Ni(e) {
2871
2872
  return We({
2872
2873
  title: "Set title",
2873
- icon: Fn,
2874
+ icon: On,
2874
2875
  children: /* @__PURE__ */ l(
2875
- q,
2876
+ U,
2876
2877
  {
2877
2878
  label: "title-label",
2878
2879
  input: e.label ?? "",
@@ -2882,35 +2883,35 @@ function Ni(e) {
2882
2883
  )
2883
2884
  });
2884
2885
  }
2885
- function $i(e) {
2886
- const { children: o } = e, t = ke(), { plotType: n, updateSelection: i } = t, { selections: a, canSelect: s, setCurrentLineKey: u } = t, [r, c] = M(
2886
+ function Fi(e) {
2887
+ const { children: n } = e, t = Le(), { plotType: o, updateSelection: i } = t, { selections: a, canSelect: s, setCurrentLineKey: u } = t, [r, c] = D(
2887
2888
  null
2888
2889
  ), m = F(() => s && a.length > 0 ? a[a.length - 1].id : null, [s, a]);
2889
- E(() => {
2890
+ z(() => {
2890
2891
  m && r === null && (console.log("Setting first selection", m), c(m));
2891
2892
  }, [m, r]);
2892
- const [d, h] = M(!1), [g, p] = M(!1), b = t.batonProps.hasBaton, C = s && b;
2893
- E(() => {
2893
+ const [d, h] = D(!1), [g, p] = D(!1), b = t.batonProps.hasBaton, v = s && b;
2894
+ z(() => {
2894
2895
  if (s) {
2895
- if (a.map((B) => $o(B)), r === null) {
2896
+ if (a.map((B) => Fo(B)), r === null) {
2896
2897
  if (a.length > 0) {
2897
2898
  const B = a[a.length - 1];
2898
- console.log("Setting current selection", B.id), c(B.id), d && vt(B);
2899
+ console.log("Setting current selection", B.id), c(B.id), d && xt(B);
2899
2900
  }
2900
2901
  } else if (d) {
2901
- const B = a.find((J) => J.id === r);
2902
- B && vt(B);
2902
+ const B = a.find((Q) => Q.id === r);
2903
+ B && xt(B);
2903
2904
  }
2904
2905
  }
2905
2906
  }, [s, r, a, d]);
2906
- const T = n === "Line", V = n === "Heatmap", k = V || n === "Image", w = n === "Surface", L = n === "Scatter", R = L || V || w, O = [
2907
+ const T = o === "Line", V = o === "Heatmap", k = V || o === "Image", P = o === "Surface", L = o === "Scatter", E = L || V || P, O = [
2907
2908
  tt({
2908
2909
  title: "X axis",
2909
- icon: jn,
2910
+ icon: Xn,
2910
2911
  label: t.xLabel,
2911
2912
  setLabel: t.setXLabel,
2912
2913
  scaleType: t.xScaleType,
2913
- scaleOptions: ht,
2914
+ scaleOptions: mt,
2914
2915
  setScaleType: t.setXScaleType,
2915
2916
  domain: t.xDomain,
2916
2917
  customDomain: t.xCustomDomain,
@@ -2918,17 +2919,17 @@ function $i(e) {
2918
2919
  }),
2919
2920
  tt({
2920
2921
  title: "Y axis",
2921
- icon: Xn,
2922
+ icon: Zn,
2922
2923
  label: t.yLabel,
2923
2924
  setLabel: t.setYLabel,
2924
2925
  scaleType: t.yScaleType,
2925
- scaleOptions: ht,
2926
+ scaleOptions: mt,
2926
2927
  setScaleType: t.setYScaleType,
2927
2928
  domain: t.yDomain,
2928
2929
  customDomain: t.yCustomDomain,
2929
2930
  setCustomDomain: t.setYCustomDomain
2930
2931
  }),
2931
- jo({
2932
+ Xo({
2932
2933
  aspect: t.aspect,
2933
2934
  setAspect: t.setAspect,
2934
2935
  hideToggle: !k
@@ -2937,30 +2938,30 @@ function $i(e) {
2937
2938
  label: t.title,
2938
2939
  setLabel: t.setTitle
2939
2940
  })
2940
- ], j = Vi({
2941
+ ], Y = Ii({
2941
2942
  selections: a,
2942
2943
  updateSelection: i,
2943
2944
  currentSelectionID: r,
2944
2945
  updateCurrentSelectionID: c,
2945
- icon: Rn,
2946
+ icon: Hn,
2946
2947
  domain: t.dDomain,
2947
2948
  customDomain: t.dCustomDomain,
2948
2949
  showSelectionConfig: d,
2949
2950
  updateShowSelectionConfig: h,
2950
- hasBaton: C
2951
+ hasBaton: v
2951
2952
  }), x = [];
2952
2953
  s && t.selectionType !== void 0 && x.push(
2953
2954
  /* @__PURE__ */ l(
2954
- Pi,
2955
+ wi,
2955
2956
  {
2956
2957
  value: t.selectionType,
2957
2958
  onSelectionTypeChange: t.setSelectionType,
2958
- disabled: t.mode !== ee.selectRegion
2959
+ disabled: t.mode !== J.selectRegion
2959
2960
  },
2960
2961
  "Selection type"
2961
2962
  )
2962
2963
  );
2963
- const _ = t.allLineParams, K = pi({
2964
+ const _ = t.allLineParams, K = bi({
2964
2965
  allLineParams: _,
2965
2966
  updateLineParams: t.updateLineParams,
2966
2967
  currentLineKey: t.currentLineKey,
@@ -2973,20 +2974,20 @@ function $i(e) {
2973
2974
  Re,
2974
2975
  {
2975
2976
  label: "show points",
2976
- icon: Zn,
2977
+ icon: Qn,
2977
2978
  iconOnly: !0,
2978
2979
  value: t.showPoints,
2979
2980
  onToggle: t.toggleShowPoints,
2980
- hidden: !w
2981
+ hidden: !P
2981
2982
  },
2982
2983
  "show points"
2983
2984
  )
2984
- ), w && x.push(/* @__PURE__ */ l(Le, {}, "Show point separator")), x.push(
2985
+ ), P && x.push(/* @__PURE__ */ l(Te, {}, "Show point separator")), x.push(
2985
2986
  tt({
2986
2987
  title: "Colour mapping",
2987
2988
  scaleType: t.dScaleType,
2988
2989
  setScaleType: t.setDScaleType,
2989
- scaleOptions: pn,
2990
+ scaleOptions: bn,
2990
2991
  colourMap: t.colourMap,
2991
2992
  setColourMap: t.setColourMap,
2992
2993
  invertColourMap: t.invertColourMap,
@@ -2998,21 +2999,21 @@ function $i(e) {
2998
2999
  scatterPointSize: L ? t.scatterPointSize : void 0,
2999
3000
  setScatterPointSize: t.setScatterPointSize,
3000
3001
  hasBaton: b,
3001
- hideToggle: !R
3002
+ hideToggle: !E
3002
3003
  })
3003
- ), R && x.push(/* @__PURE__ */ l(Le, {}, "Colour mapping separator")), O.push(
3004
+ ), E && x.push(/* @__PURE__ */ l(Te, {}, "Colour mapping separator")), O.push(
3004
3005
  /* @__PURE__ */ l(
3005
3006
  Re,
3006
3007
  {
3007
3008
  label: "Grid toggle",
3008
- icon: Hn,
3009
+ icon: Kn,
3009
3010
  value: t.showGrid,
3010
3011
  onToggle: t.toggleShowGrid
3011
3012
  },
3012
3013
  "Grid toggle"
3013
3014
  )
3014
- ), O.push(oi({ ...t.batonProps }));
3015
- const W = ne(
3015
+ ), O.push(ii({ ...t.batonProps }));
3016
+ const G = te(
3016
3017
  (B) => {
3017
3018
  _.has(B) && u(B), p(!0);
3018
3019
  },
@@ -3020,67 +3021,67 @@ function $i(e) {
3020
3021
  );
3021
3022
  _.size && (console.log("Add line key dropdown", [..._.keys()]), O.push(
3022
3023
  /* @__PURE__ */ l(
3023
- bi,
3024
+ Si,
3024
3025
  {
3025
3026
  allLineParams: _,
3026
3027
  lineKey: t.currentLineKey,
3027
- onLineKeyChange: W
3028
+ onLineKeyChange: G
3028
3029
  },
3029
3030
  "key dropdown"
3030
3031
  )
3031
3032
  ));
3032
- const Q = ne(
3033
+ const Z = te(
3033
3034
  (B) => {
3034
3035
  if (s) {
3035
- const J = a.find((ae) => ae.id === B);
3036
- J !== void 0 && (c(B), s && i(J)), h(!0);
3036
+ const Q = a.find((ae) => ae.id === B);
3037
+ Q !== void 0 && (c(B), s && i(Q)), h(!0);
3037
3038
  }
3038
3039
  },
3039
3040
  [s, a, i]
3040
3041
  );
3041
3042
  return s && a.length > 0 && (O.push(
3042
3043
  /* @__PURE__ */ l(
3043
- Ii,
3044
+ $i,
3044
3045
  {
3045
3046
  selections: a,
3046
3047
  selectionID: r,
3047
- onSelectionIDChange: Q
3048
+ onSelectionIDChange: Z
3048
3049
  },
3049
3050
  "ID dropdown"
3050
3051
  )
3051
3052
  ), O.push(
3052
3053
  /* @__PURE__ */ l(
3053
- ii,
3054
+ ai,
3054
3055
  {
3055
3056
  updateSelection: i,
3056
3057
  updateCurrentSelectionID: c,
3057
- disabled: !C
3058
+ disabled: !v
3058
3059
  },
3059
3060
  "Clear all selections"
3060
3061
  )
3061
- )), /* @__PURE__ */ S(at, { overflowChildren: O, children: [
3062
+ )), /* @__PURE__ */ S(st, { overflowChildren: O, children: [
3062
3063
  /* @__PURE__ */ l(
3063
- ai,
3064
+ si,
3064
3065
  {
3065
3066
  value: t.mode,
3066
3067
  onModeChange: t.setMode,
3067
- hasBaton: C
3068
+ hasBaton: v
3068
3069
  },
3069
3070
  "Interaction toggle"
3070
3071
  ),
3071
- s && /* @__PURE__ */ l(Le, {}, "Interaction separator"),
3072
+ s && /* @__PURE__ */ l(Te, {}, "Interaction separator"),
3072
3073
  x,
3073
- s && /* @__PURE__ */ l(ye, { children: j }, "Selection config"),
3074
+ s && /* @__PURE__ */ l(ye, { children: Y }, "Selection config"),
3074
3075
  T && /* @__PURE__ */ l(ye, { children: K }, "Line config"),
3075
- o
3076
+ n
3076
3077
  ] });
3077
3078
  }
3078
- function Ve(e) {
3079
- return e.children !== null && (e.children === void 0 ? /* @__PURE__ */ l($i, { children: e.extraChildren }) : /* @__PURE__ */ l(at, { children: e.children }));
3079
+ function Ae(e) {
3080
+ return e.children !== null && (e.children === void 0 ? /* @__PURE__ */ l(Fi, { children: e.extraChildren }) : /* @__PURE__ */ l(st, { children: e.children }));
3080
3081
  }
3081
- function qt({ xValues: e, yValues: o, values: t }) {
3082
+ function Gt({ xValues: e, yValues: n, values: t }) {
3082
3083
  const {
3083
- title: n,
3084
+ title: o,
3084
3085
  showGrid: i,
3085
3086
  xLabel: a,
3086
3087
  yLabel: s,
@@ -3093,46 +3094,46 @@ function qt({ xValues: e, yValues: o, values: t }) {
3093
3094
  selections: g,
3094
3095
  dDomain: p,
3095
3096
  dCustomDomain: b,
3096
- colourMap: C,
3097
+ colourMap: v,
3097
3098
  invertColourMap: T,
3098
3099
  dScaleType: V,
3099
3100
  setHistogram: k
3100
- } = ke(), w = qe(u), L = F(
3101
- () => lt(t.data, p),
3101
+ } = Le(), P = qe(u), L = F(
3102
+ () => rt(t.data, p),
3102
3103
  [p, t]
3103
3104
  );
3104
- return E(() => {
3105
+ return z(() => {
3105
3106
  L && k({
3106
3107
  ...L,
3107
- colorMap: C,
3108
+ colorMap: v,
3108
3109
  invertColorMap: T
3109
3110
  });
3110
- }, [C, T, L, k]), /* @__PURE__ */ l(
3111
- bn,
3111
+ }, [v, T, L, k]), /* @__PURE__ */ l(
3112
+ Sn,
3112
3113
  {
3113
3114
  dataArray: t,
3114
3115
  domain: Oe(b, p),
3115
- colorMap: C,
3116
+ colorMap: v,
3116
3117
  invertColorMap: T,
3117
3118
  scaleType: V,
3118
3119
  aspect: r,
3119
3120
  showGrid: i,
3120
- title: n,
3121
+ title: o,
3121
3122
  abscissaParams: {
3122
3123
  label: a,
3123
3124
  value: e == null ? void 0 : e.data
3124
3125
  },
3125
3126
  ordinateParams: {
3126
3127
  label: s,
3127
- value: o == null ? void 0 : o.data
3128
+ value: n == null ? void 0 : n.data
3128
3129
  },
3129
- interactions: w,
3130
+ interactions: P,
3130
3131
  flipYAxis: !0,
3131
3132
  children: m && /* @__PURE__ */ l(
3132
3133
  Ge,
3133
3134
  {
3134
3135
  modifierKey: [],
3135
- disabled: u !== ee.selectRegion,
3136
+ disabled: u !== J.selectRegion,
3136
3137
  selectionType: d,
3137
3138
  batonProps: c,
3138
3139
  updateSelection: h,
@@ -3142,7 +3143,7 @@ function qt({ xValues: e, yValues: o, values: t }) {
3142
3143
  }
3143
3144
  );
3144
3145
  }
3145
- function va(e) {
3146
+ function xa(e) {
3146
3147
  return /* @__PURE__ */ l(
3147
3148
  "div",
3148
3149
  {
@@ -3150,10 +3151,10 @@ function va(e) {
3150
3151
  display: "grid",
3151
3152
  position: "relative"
3152
3153
  },
3153
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3154
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3154
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3155
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3155
3156
  /* @__PURE__ */ l(
3156
- qt,
3157
+ Gt,
3157
3158
  {
3158
3159
  xValues: e.plotConfig.xValues,
3159
3160
  yValues: e.plotConfig.yValues,
@@ -3164,9 +3165,9 @@ function va(e) {
3164
3165
  }
3165
3166
  );
3166
3167
  }
3167
- function Gt({ xValues: e, yValues: o, values: t }) {
3168
+ function Wt({ xValues: e, yValues: n, values: t }) {
3168
3169
  const {
3169
- title: n,
3170
+ title: o,
3170
3171
  showGrid: i,
3171
3172
  xLabel: a,
3172
3173
  yLabel: s,
@@ -3177,21 +3178,21 @@ function Gt({ xValues: e, yValues: o, values: t }) {
3177
3178
  selectionType: d,
3178
3179
  updateSelection: h,
3179
3180
  selections: g
3180
- } = ke(), p = qe(u);
3181
+ } = Le(), p = qe(u);
3181
3182
  return /* @__PURE__ */ l(
3182
- Sn,
3183
+ vn,
3183
3184
  {
3184
3185
  dataArray: t,
3185
3186
  aspect: r,
3186
3187
  showGrid: i,
3187
- title: n,
3188
+ title: o,
3188
3189
  abscissaParams: {
3189
3190
  label: a,
3190
3191
  value: e == null ? void 0 : e.data
3191
3192
  },
3192
3193
  ordinateParams: {
3193
3194
  label: s,
3194
- value: o == null ? void 0 : o.data
3195
+ value: n == null ? void 0 : n.data
3195
3196
  },
3196
3197
  interactions: p,
3197
3198
  flipYAxis: !0,
@@ -3199,7 +3200,7 @@ function Gt({ xValues: e, yValues: o, values: t }) {
3199
3200
  Ge,
3200
3201
  {
3201
3202
  modifierKey: [],
3202
- disabled: u !== ee.selectRegion,
3203
+ disabled: u !== J.selectRegion,
3203
3204
  selectionType: d,
3204
3205
  batonProps: c,
3205
3206
  updateSelection: h,
@@ -3209,7 +3210,7 @@ function Gt({ xValues: e, yValues: o, values: t }) {
3209
3210
  }
3210
3211
  );
3211
3212
  }
3212
- function xa(e) {
3213
+ function Pa(e) {
3213
3214
  return /* @__PURE__ */ l(
3214
3215
  "div",
3215
3216
  {
@@ -3217,10 +3218,10 @@ function xa(e) {
3217
3218
  display: "grid",
3218
3219
  position: "relative"
3219
3220
  },
3220
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3221
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3221
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3222
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3222
3223
  /* @__PURE__ */ l(
3223
- Gt,
3224
+ Wt,
3224
3225
  {
3225
3226
  xValues: e.plotConfig.xValues,
3226
3227
  yValues: e.plotConfig.yValues,
@@ -3231,8 +3232,8 @@ function xa(e) {
3231
3232
  }
3232
3233
  );
3233
3234
  }
3234
- function Fi(e, o, t) {
3235
- const n = [
3235
+ function Oi(e, n, t) {
3236
+ const o = [
3236
3237
  "rgb(0, 0, 0)",
3237
3238
  // #000000, black
3238
3239
  "rgb(0, 158, 115)",
@@ -3251,27 +3252,27 @@ function Fi(e, o, t) {
3251
3252
  // #cc79a7, pink
3252
3253
  ];
3253
3254
  let i = !0, a = Qe.LineAndGlyphs;
3254
- o.pointSize ? o.lineOn || (a = Qe.GlyphsOnly) : (o.pointSize = 0, o.lineOn ? a = Qe.LineOnly : i = !1);
3255
- const s = o.colour ?? n[t % n.length];
3255
+ n.pointSize ? n.lineOn || (a = Qe.GlyphsOnly) : (n.pointSize = 0, n.lineOn ? a = Qe.LineOnly : i = !1);
3256
+ const s = n.colour ?? o[t % o.length];
3256
3257
  return /* @__PURE__ */ l(
3257
- wn,
3258
+ Dn,
3258
3259
  {
3259
3260
  abscissas: e.x.data,
3260
3261
  ordinates: e.y.data,
3261
3262
  color: s,
3262
3263
  curveType: a,
3263
- glyphType: o.glyphType ?? Dn.Circle,
3264
- glyphSize: o.pointSize,
3264
+ glyphType: n.glyphType ?? Mn.Circle,
3265
+ glyphSize: n.pointSize,
3265
3266
  visible: i
3266
3267
  },
3267
3268
  `data_curve_${t}`
3268
3269
  );
3269
3270
  }
3270
- function Wt(e) {
3271
+ function Yt(e) {
3271
3272
  const {
3272
- title: o,
3273
+ title: n,
3273
3274
  showGrid: t,
3274
- xCustomDomain: n,
3275
+ xCustomDomain: o,
3275
3276
  xDomain: i,
3276
3277
  xScaleType: a,
3277
3278
  xLabel: s,
@@ -3284,34 +3285,34 @@ function Wt(e) {
3284
3285
  currentLineKey: g,
3285
3286
  setCurrentLineKey: p,
3286
3287
  batonProps: b,
3287
- canSelect: C,
3288
+ canSelect: v,
3288
3289
  selectionType: T,
3289
3290
  updateSelection: V,
3290
3291
  selections: k
3291
- } = ke(), w = e.lineData, L = F(() => {
3292
+ } = Le(), P = e.lineData, L = F(() => {
3292
3293
  const _ = /* @__PURE__ */ new Map();
3293
- return w.forEach((K) => {
3294
+ return P.forEach((K) => {
3294
3295
  _.set(K.key, K.lineParams);
3295
3296
  }), _;
3296
- }, [w]);
3297
- E(() => {
3297
+ }, [P]);
3298
+ z(() => {
3298
3299
  if (g == null && L.size) {
3299
3300
  const _ = L.keys().next().value;
3300
3301
  p(_);
3301
3302
  }
3302
3303
  h(L);
3303
3304
  }, [g, L, h, p]);
3304
- const R = qe(d), O = (_, K) => /* @__PURE__ */ S("p", { children: [
3305
+ const E = qe(d), O = (_, K) => /* @__PURE__ */ S("p", { children: [
3305
3306
  _.toPrecision(8),
3306
3307
  ", ",
3307
3308
  K.toPrecision(8)
3308
- ] }), j = F(() => Oe(n, i), [n, i]), x = F(() => Oe(u, r), [u, r]);
3309
+ ] }), Y = F(() => Oe(o, i), [o, i]), x = F(() => Oe(u, r), [u, r]);
3309
3310
  return /* @__PURE__ */ S(
3310
3311
  Cn,
3311
3312
  {
3312
- title: o ?? "",
3313
+ title: n ?? "",
3313
3314
  abscissaConfig: {
3314
- visDomain: j,
3315
+ visDomain: Y,
3315
3316
  showGrid: t,
3316
3317
  scaleType: a,
3317
3318
  label: s,
@@ -3325,19 +3326,19 @@ function Wt(e) {
3325
3326
  nice: !0
3326
3327
  },
3327
3328
  children: [
3328
- /* @__PURE__ */ l(vn, { ...R }),
3329
- w.map((_, K) => {
3330
- const W = (L == null ? void 0 : L.get(_.key)) ?? _.lineParams;
3331
- return Fi(_, W, K);
3329
+ /* @__PURE__ */ l(xn, { ...E }),
3330
+ P.map((_, K) => {
3331
+ const G = (L == null ? void 0 : L.get(_.key)) ?? _.lineParams;
3332
+ return Oi(_, G, K);
3332
3333
  }),
3333
- /* @__PURE__ */ l(xn, { renderTooltip: O }),
3334
- /* @__PURE__ */ l(Pn, {}),
3335
- C && /* @__PURE__ */ l(
3334
+ /* @__PURE__ */ l(Pn, { renderTooltip: O }),
3335
+ /* @__PURE__ */ l(wn, {}),
3336
+ v && /* @__PURE__ */ l(
3336
3337
  Ge,
3337
3338
  {
3338
3339
  modifierKey: [],
3339
3340
  batonProps: b,
3340
- disabled: d !== ee.selectRegion,
3341
+ disabled: d !== J.selectRegion,
3341
3342
  selectionType: T,
3342
3343
  updateSelection: V,
3343
3344
  selections: k
@@ -3347,7 +3348,7 @@ function Wt(e) {
3347
3348
  }
3348
3349
  );
3349
3350
  }
3350
- function Pa(e) {
3351
+ function wa(e) {
3351
3352
  return /* @__PURE__ */ l(
3352
3353
  "div",
3353
3354
  {
@@ -3355,16 +3356,16 @@ function Pa(e) {
3355
3356
  display: "grid",
3356
3357
  position: "relative"
3357
3358
  },
3358
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3359
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3360
- /* @__PURE__ */ l(Wt, { lineData: e.lineData })
3359
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3360
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3361
+ /* @__PURE__ */ l(Yt, { lineData: e.lineData })
3361
3362
  ] })
3362
3363
  }
3363
3364
  );
3364
3365
  }
3365
- function Yt({ x: e, y: o, values: t }) {
3366
+ function jt({ x: e, y: n, values: t }) {
3366
3367
  const {
3367
- title: n,
3368
+ title: o,
3368
3369
  showGrid: i,
3369
3370
  xLabel: a,
3370
3371
  xScaleType: s,
@@ -3377,33 +3378,33 @@ function Yt({ x: e, y: o, values: t }) {
3377
3378
  updateSelection: g,
3378
3379
  selections: p,
3379
3380
  dDomain: b,
3380
- dCustomDomain: C,
3381
+ dCustomDomain: v,
3381
3382
  colourMap: T,
3382
3383
  invertColourMap: V,
3383
3384
  dScaleType: k,
3384
- scatterPointSize: w,
3385
+ scatterPointSize: P,
3385
3386
  setHistogram: L
3386
- } = ke(), R = qe(c), O = F(
3387
- () => lt(t.data, b),
3387
+ } = Le(), E = qe(c), O = F(
3388
+ () => rt(t.data, b),
3388
3389
  [b, t]
3389
3390
  );
3390
- return E(() => {
3391
+ return z(() => {
3391
3392
  O && L({
3392
3393
  ...O,
3393
3394
  colorMap: T,
3394
3395
  invertColorMap: V
3395
3396
  });
3396
3397
  }, [T, V, O, L]), /* @__PURE__ */ l(
3397
- Mn,
3398
+ _n,
3398
3399
  {
3399
3400
  dataArray: t,
3400
- domain: Oe(C, b),
3401
+ domain: Oe(v, b),
3401
3402
  colorMap: T,
3402
3403
  invertColorMap: V,
3403
3404
  scaleType: k,
3404
3405
  showGrid: i,
3405
- size: w,
3406
- title: n,
3406
+ size: P,
3407
+ title: o,
3407
3408
  abscissaParams: {
3408
3409
  label: a,
3409
3410
  value: e.data,
@@ -3411,15 +3412,15 @@ function Yt({ x: e, y: o, values: t }) {
3411
3412
  },
3412
3413
  ordinateParams: {
3413
3414
  label: u,
3414
- value: o.data,
3415
+ value: n.data,
3415
3416
  scaleType: r
3416
3417
  },
3417
- interactions: R,
3418
+ interactions: E,
3418
3419
  children: d && /* @__PURE__ */ l(
3419
3420
  Ge,
3420
3421
  {
3421
3422
  modifierKey: [],
3422
- disabled: c !== ee.selectRegion,
3423
+ disabled: c !== J.selectRegion,
3423
3424
  selectionType: h,
3424
3425
  batonProps: m,
3425
3426
  updateSelection: g,
@@ -3429,7 +3430,7 @@ function Yt({ x: e, y: o, values: t }) {
3429
3430
  }
3430
3431
  );
3431
3432
  }
3432
- function wa(e) {
3433
+ function Da(e) {
3433
3434
  return /* @__PURE__ */ l(
3434
3435
  "div",
3435
3436
  {
@@ -3437,50 +3438,50 @@ function wa(e) {
3437
3438
  display: "grid",
3438
3439
  position: "relative"
3439
3440
  },
3440
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3441
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3442
- /* @__PURE__ */ l(Yt, { x: e.x, y: e.y, values: e.pointValues })
3441
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3442
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3443
+ /* @__PURE__ */ l(jt, { x: e.x, y: e.y, values: e.pointValues })
3443
3444
  ] })
3444
3445
  }
3445
3446
  );
3446
3447
  }
3447
- function jt(e) {
3448
- const { values: o, children: t } = e, {
3449
- dDomain: n,
3448
+ function Xt(e) {
3449
+ const { values: n, children: t } = e, {
3450
+ dDomain: o,
3450
3451
  dCustomDomain: i,
3451
3452
  colourMap: a,
3452
3453
  invertColourMap: s,
3453
3454
  dScaleType: u,
3454
3455
  showPoints: r,
3455
3456
  setHistogram: c
3456
- } = ke(), m = F(
3457
- () => Oe(i, n),
3458
- [i, n]
3457
+ } = Le(), m = F(
3458
+ () => Oe(i, o),
3459
+ [i, o]
3459
3460
  );
3460
- return E(() => {
3461
- const d = lt(o.data, n);
3461
+ return z(() => {
3462
+ const d = rt(n.data, o);
3462
3463
  d && (console.log("Set histogram:", d, a, s), c({
3463
3464
  ...d,
3464
3465
  colorMap: a,
3465
3466
  invertColorMap: s
3466
3467
  }));
3467
- }, [n, o, a, s, c]), /* @__PURE__ */ S(
3468
- _n,
3468
+ }, [o, n, a, s, c]), /* @__PURE__ */ S(
3469
+ Tn,
3469
3470
  {
3470
- dataArray: o,
3471
+ dataArray: n,
3471
3472
  domain: m,
3472
3473
  colorMap: a,
3473
3474
  invertColorMap: s,
3474
3475
  scaleType: u,
3475
3476
  showPoints: r,
3476
3477
  children: [
3477
- /* @__PURE__ */ l(ro, {}),
3478
+ /* @__PURE__ */ l(co, {}),
3478
3479
  t
3479
3480
  ]
3480
3481
  }
3481
3482
  );
3482
3483
  }
3483
- function Da(e) {
3484
+ function Ma(e) {
3484
3485
  return /* @__PURE__ */ l(
3485
3486
  "div",
3486
3487
  {
@@ -3488,40 +3489,40 @@ function Da(e) {
3488
3489
  display: "grid",
3489
3490
  position: "relative"
3490
3491
  },
3491
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3492
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3493
- /* @__PURE__ */ l(jt, { values: e.heightValues })
3492
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3493
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3494
+ /* @__PURE__ */ l(Xt, { values: e.heightValues })
3494
3495
  ] })
3495
3496
  }
3496
3497
  );
3497
3498
  }
3498
- function Oi(e) {
3499
+ function Bi(e) {
3499
3500
  var g, p;
3500
- function o(b, C) {
3501
+ function n(b, v) {
3501
3502
  const T = b === "standard";
3502
3503
  return new Intl.NumberFormat("en", {
3503
3504
  notation: b,
3504
- maximumFractionDigits: T ? Math.max(C, 0) : void 0,
3505
- maximumSignificantDigits: T ? void 0 : Math.max(C, 1)
3505
+ maximumFractionDigits: T ? Math.max(v, 0) : void 0,
3506
+ maximumSignificantDigits: T ? void 0 : Math.max(v, 1)
3506
3507
  });
3507
3508
  }
3508
- const [t, n] = M(
3509
+ const [t, o] = D(
3509
3510
  ((g = e.displayParams) == null ? void 0 : g.displayType) ?? "standard"
3510
- ), [i, a] = M(
3511
+ ), [i, a] = D(
3511
3512
  ((p = e.displayParams) == null ? void 0 : p.numberDigits) ?? 2
3512
- ), [s, u] = M(
3513
+ ), [s, u] = D(
3513
3514
  e.cellWidth
3514
- ), [r, c] = M(
3515
- o(t, i)
3515
+ ), [r, c] = D(
3516
+ n(t, i)
3516
3517
  ), m = 120;
3517
- E(() => {
3518
- console.log("numberDigits is ", i), c(o(t, i));
3518
+ z(() => {
3519
+ console.log("numberDigits is ", i), c(n(t, i));
3519
3520
  }, [t, i]);
3520
3521
  function d(b) {
3521
- n(b);
3522
+ o(b);
3522
3523
  }
3523
- const h = (b, C) => {
3524
- const T = e.cellValues.get(b, C);
3524
+ const h = (b, v) => {
3525
+ const T = e.cellValues.get(b, v);
3525
3526
  return r.format(T);
3526
3527
  };
3527
3528
  return /* @__PURE__ */ S(
@@ -3532,9 +3533,9 @@ function Oi(e) {
3532
3533
  position: "relative"
3533
3534
  },
3534
3535
  children: [
3535
- /* @__PURE__ */ S(at, { children: [
3536
+ /* @__PURE__ */ S(st, { children: [
3536
3537
  /* @__PURE__ */ l(
3537
- Tn,
3538
+ Ln,
3538
3539
  {
3539
3540
  value: s,
3540
3541
  defaultValue: m,
@@ -3542,28 +3543,28 @@ function Oi(e) {
3542
3543
  },
3543
3544
  "cell width input"
3544
3545
  ),
3545
- /* @__PURE__ */ l(Le, {}),
3546
+ /* @__PURE__ */ l(Te, {}),
3546
3547
  /* @__PURE__ */ S(
3547
- Y,
3548
+ W,
3548
3549
  {
3549
3550
  role: "radiogroup",
3550
3551
  ariaLabel: "displayStyle",
3551
3552
  value: t,
3552
3553
  onChange: d,
3553
3554
  children: [
3554
- /* @__PURE__ */ l(Y.Btn, { label: "standard", value: "standard" }),
3555
- /* @__PURE__ */ l(Y.Btn, { label: "scientific", value: "scientific" })
3555
+ /* @__PURE__ */ l(W.Btn, { label: "standard", value: "standard" }),
3556
+ /* @__PURE__ */ l(W.Btn, { label: "scientific", value: "scientific" })
3556
3557
  ]
3557
3558
  },
3558
3559
  "display style toggle"
3559
3560
  ),
3560
- /* @__PURE__ */ l(Le, {}),
3561
+ /* @__PURE__ */ l(Te, {}),
3561
3562
  /* @__PURE__ */ l(
3562
- q,
3563
+ U,
3563
3564
  {
3564
3565
  label: "digits",
3565
3566
  input: i,
3566
- isValid: (b) => xo(b, t === "standard" ? 0 : 1, 10),
3567
+ isValid: (b) => Po(b, t === "standard" ? 0 : 1, 10),
3567
3568
  inputAttribs: {
3568
3569
  name: "digits",
3569
3570
  pattern: "^\\d$",
@@ -3573,10 +3574,10 @@ function Oi(e) {
3573
3574
  },
3574
3575
  "0"
3575
3576
  ),
3576
- /* @__PURE__ */ l(Le, {})
3577
+ /* @__PURE__ */ l(Te, {})
3577
3578
  ] }),
3578
3579
  /* @__PURE__ */ l(
3579
- Ln,
3580
+ kn,
3580
3581
  {
3581
3582
  cellWidth: s ?? m,
3582
3583
  dims: e.cellValues.shape,
@@ -3587,43 +3588,43 @@ function Oi(e) {
3587
3588
  }
3588
3589
  );
3589
3590
  }
3590
- function Bi(e) {
3591
- let o = null;
3592
- return "lineData" in e && e.lineData.length !== 0 ? o = /* @__PURE__ */ l(Wt, { lineData: e.lineData }) : "values" in e ? "heatmapScale" in e ? o = /* @__PURE__ */ l(
3593
- qt,
3591
+ function zi(e) {
3592
+ let n = null;
3593
+ return "lineData" in e && e.lineData.length !== 0 ? n = /* @__PURE__ */ l(Yt, { lineData: e.lineData }) : "values" in e ? "heatmapScale" in e ? n = /* @__PURE__ */ l(
3594
+ Gt,
3594
3595
  {
3595
3596
  xValues: e.plotConfig.xValues,
3596
3597
  yValues: e.plotConfig.yValues,
3597
3598
  values: e.values
3598
3599
  }
3599
- ) : o = /* @__PURE__ */ l(
3600
- Gt,
3600
+ ) : n = /* @__PURE__ */ l(
3601
+ Wt,
3601
3602
  {
3602
3603
  xValues: e.plotConfig.xValues,
3603
3604
  yValues: e.plotConfig.yValues,
3604
3605
  values: e.values
3605
3606
  }
3606
- ) : "heightValues" in e ? o = /* @__PURE__ */ l(jt, { values: e.heightValues }) : "pointValues" in e && (o = /* @__PURE__ */ l(Yt, { x: e.x, y: e.y, values: e.pointValues })), o;
3607
+ ) : "heightValues" in e ? n = /* @__PURE__ */ l(Xt, { values: e.heightValues }) : "pointValues" in e && (n = /* @__PURE__ */ l(jt, { x: e.x, y: e.y, values: e.pointValues })), n;
3607
3608
  }
3608
- function zi(e) {
3609
- const o = Z(0), t = It();
3610
- return wt(() => {
3611
- o.current = t.end();
3612
- }), "cellWidth" in e ? /* @__PURE__ */ l(Oi, { ...e }) : /* @__PURE__ */ l(
3609
+ function Ei(e) {
3610
+ const n = X(0), t = $t();
3611
+ return Dt(() => {
3612
+ n.current = t.end();
3613
+ }), "cellWidth" in e ? /* @__PURE__ */ l(Bi, { ...e }) : /* @__PURE__ */ l(
3613
3614
  "div",
3614
3615
  {
3615
3616
  style: {
3616
3617
  display: "grid",
3617
3618
  position: "relative"
3618
3619
  },
3619
- children: /* @__PURE__ */ S(Ae, { ...e, children: [
3620
- /* @__PURE__ */ l(Ve, { children: e.customToolbarChildren }),
3621
- /* @__PURE__ */ l(Bi, { ...e })
3620
+ children: /* @__PURE__ */ S(ke, { ...e, children: [
3621
+ /* @__PURE__ */ l(Ae, { children: e.customToolbarChildren }),
3622
+ /* @__PURE__ */ l(zi, { ...e })
3622
3623
  ] })
3623
3624
  }
3624
3625
  );
3625
3626
  }
3626
- const Pt = {
3627
+ const wt = {
3627
3628
  xScale: void 0,
3628
3629
  yScale: void 0,
3629
3630
  xLabel: void 0,
@@ -3632,18 +3633,25 @@ const Pt = {
3632
3633
  yValues: void 0,
3633
3634
  title: void 0
3634
3635
  };
3635
- function Ma({
3636
+ function _a({
3636
3637
  plotId: e = "plot_0",
3637
- hostname: o = "127.0.0.1",
3638
+ hostname: n = "127.0.0.1",
3638
3639
  port: t = "8000",
3639
- uuid: n
3640
+ uuid: o
3640
3641
  }) {
3641
- const [i, a] = M(), s = Z([]), [u, r] = M(Pt), [c, m] = M(), {
3642
- selections: d,
3643
- setSelections: h,
3644
- isNewSelection: g,
3645
- updateSelection: p
3646
- } = zt(), b = Z(0), C = Z(""), T = `ws://${o}:${t}/plot/${n}/${e}`, { sendMessage: V, lastMessage: k, readyState: w, getWebSocket: L } = ho(
3642
+ const [i, a] = D(), s = X([]), [u, r] = D(wt), [c, m] = D(), d = (f, y, C) => {
3643
+ y || (f === ot.removed ? E("clear_selection_data", {
3644
+ selectionIds: C ? [C.id] : []
3645
+ }) : E(
3646
+ f === ot.created ? "client_new_selection" : "client_update_selection",
3647
+ {
3648
+ selection: C
3649
+ }
3650
+ ));
3651
+ }, { selections: h, updateSelection: g, setSelections: p } = Et(
3652
+ void 0,
3653
+ d
3654
+ ), b = X(0), v = X(""), T = `ws://${n}:${t}/plot/${o}/${e}`, { sendMessage: V, lastMessage: k, readyState: P, getWebSocket: L } = mo(
3647
3655
  T,
3648
3656
  {
3649
3657
  onOpen: () => {
@@ -3654,74 +3662,74 @@ function Ma({
3654
3662
  },
3655
3663
  reconnectAttempts: 5,
3656
3664
  reconnectInterval: 5e3,
3657
- shouldReconnect: (y) => C.current !== "unmounted"
3665
+ shouldReconnect: (f) => v.current !== "unmounted"
3658
3666
  }
3659
3667
  );
3660
- E(() => (C.current = "initial", () => {
3661
- C.current = "unmounted";
3668
+ z(() => (v.current = "initial", () => {
3669
+ v.current = "unmounted";
3662
3670
  }), []);
3663
- const R = ne(
3664
- (y, f) => {
3665
- console.log("%s: sending", e, f), V(co({
3671
+ const E = te(
3672
+ (f, y) => {
3673
+ console.log("%s: sending", e, y), V(uo({
3666
3674
  plotId: e,
3667
- type: y,
3668
- params: f
3675
+ type: f,
3676
+ params: y
3669
3677
  }));
3670
3678
  },
3671
3679
  [e, V]
3672
- ), O = ne(
3673
- (y) => {
3674
- R("status", y);
3680
+ ), O = te(
3681
+ (f) => {
3682
+ E("status", f);
3675
3683
  },
3676
- [R]
3677
- ), j = () => {
3678
- R("baton_request", n);
3679
- }, x = (y) => {
3680
- R("baton_offer", y);
3681
- }, [_, K] = M({
3682
- uuid: n,
3684
+ [E]
3685
+ ), Y = () => {
3686
+ E("baton_request", o);
3687
+ }, x = (f) => {
3688
+ E("baton_offer", f);
3689
+ }, [_, K] = D({
3690
+ uuid: o,
3683
3691
  batonUuid: "",
3684
3692
  others: [],
3685
3693
  hasBaton: !1,
3686
- requestBaton: j,
3694
+ requestBaton: Y,
3687
3695
  offerBaton: x
3688
3696
  });
3689
- E(() => {
3690
- if (w === Ne.OPEN) {
3691
- const y = L();
3692
- y && y.binaryType !== "arraybuffer" && (y.binaryType = "arraybuffer", console.log("%s: WebSocket set binaryType", e)), O("ready");
3697
+ z(() => {
3698
+ if (P === $e.OPEN) {
3699
+ const f = L();
3700
+ f && f.binaryType !== "arraybuffer" && (f.binaryType = "arraybuffer", console.log("%s: WebSocket set binaryType", e)), O("ready");
3693
3701
  }
3694
- }, [L, e, w, O]);
3695
- const W = () => {
3696
- Q(), console.log("%s: data cleared", e, Object.keys(u));
3697
- }, Q = () => {
3698
- s.current = [], r(Pt), a(null), h([]);
3702
+ }, [L, e, P, O]);
3703
+ const G = () => {
3704
+ Z(), console.log("%s: data cleared", e, Object.keys(u));
3705
+ }, Z = () => {
3706
+ s.current = [], r(wt), a(null), p([]);
3699
3707
  };
3700
- E(() => {
3708
+ z(() => {
3701
3709
  if (_.batonUuid) {
3702
- let y = _.hasBaton ? "Baton gained" : "Baton lost";
3703
- C.current === "initial" && (y = _.hasBaton ? "Taken baton" : "Another client has baton", C.current = ""), gt(y, {
3704
- toastId: n,
3710
+ let f = _.hasBaton ? "Baton gained" : "Baton lost";
3711
+ v.current === "initial" && (f = _.hasBaton ? "Taken baton" : "Another client has baton", v.current = ""), yt(f, {
3712
+ toastId: o,
3705
3713
  position: "bottom-center",
3706
3714
  autoClose: 2e3,
3707
3715
  theme: "light"
3708
3716
  });
3709
3717
  }
3710
- }, [_.hasBaton, _.batonUuid, n]);
3711
- const B = (y) => {
3712
- gt(/* @__PURE__ */ l(() => {
3713
- const v = () => {
3714
- x(y.requester);
3718
+ }, [_.hasBaton, _.batonUuid, o]);
3719
+ const B = (f) => {
3720
+ yt(/* @__PURE__ */ l(() => {
3721
+ const C = () => {
3722
+ x(f.requester);
3715
3723
  };
3716
3724
  return /* @__PURE__ */ l("div", { children: /* @__PURE__ */ S("h3", { children: [
3717
3725
  "Baton requested from ",
3718
- y.requester,
3726
+ f.requester,
3719
3727
  " ",
3720
3728
  /* @__PURE__ */ l("br", {}),
3721
- /* @__PURE__ */ l("button", { onClick: v, children: "Approve" })
3729
+ /* @__PURE__ */ l("button", { onClick: C, children: "Approve" })
3722
3730
  ] }) });
3723
3731
  }, {}), {
3724
- toastId: y.requester,
3732
+ toastId: f.requester,
3725
3733
  position: "bottom-center",
3726
3734
  autoClose: !1,
3727
3735
  hideProgressBar: !1,
@@ -3731,171 +3739,162 @@ function Ma({
3731
3739
  progress: void 0,
3732
3740
  theme: "light"
3733
3741
  });
3734
- }, J = (y, f = !0, v = !1) => {
3735
- const P = p(y, f, v);
3736
- return f && (v ? R("clear_selection_data", {
3737
- selectionIds: P ? [P] : []
3738
- }) : R(
3739
- g.current ? "client_new_selection" : "client_update_selection",
3740
- {
3741
- selection: y
3742
- }
3743
- )), P;
3744
- }, ae = (y, f, v = !0) => {
3745
- const P = s.current;
3746
- console.log("Finding old line with key", y);
3747
- const z = P.findIndex((H) => H.key === y);
3748
- if (z === -1)
3749
- return console.log("Line with key", y, "cannot be found"), P;
3742
+ }, Q = (f, y, C = !0) => {
3743
+ const M = s.current;
3744
+ console.log("Finding old line with key", f);
3745
+ const R = M.findIndex((H) => H.key === f);
3746
+ if (R === -1)
3747
+ return console.log("Line with key", f, "cannot be found"), M;
3750
3748
  {
3751
- const H = [...P];
3752
- return console.debug("Replacing old line params with", f), H[z] = { ...H[z], ...f }, H;
3749
+ const H = [...M];
3750
+ return console.debug("Replacing old line params with", y), H[R] = { ...H[R], ...y }, H;
3753
3751
  }
3754
- }, se = (y, f = !0) => {
3755
- c != null && m({ ...c, pointSize: y }), f && R("client_update_scatter_parameters", {
3756
- pointSize: y
3752
+ }, ae = (f, y = !0) => {
3753
+ c != null && m({ ...c, pointSize: f }), y && E("client_update_scatter_parameters", {
3754
+ pointSize: f
3757
3755
  });
3758
- }, Ce = (y, f) => {
3759
- const v = fo(y), P = go(y);
3756
+ }, ne = (f, y) => {
3757
+ const C = go(f), M = yo(f);
3760
3758
  console.log(
3761
3759
  "%s: setting line state with domains",
3762
3760
  e,
3763
- v,
3764
- P
3761
+ C,
3762
+ M
3765
3763
  );
3766
- const z = f ?? u;
3767
- s.current = y, r(z), a({
3768
- lineData: y,
3769
- xDomain: v,
3770
- yDomain: P,
3771
- plotConfig: z,
3772
- updateLineParams: ae
3764
+ const R = y ?? u;
3765
+ s.current = f, r(R), a({
3766
+ lineData: f,
3767
+ xDomain: C,
3768
+ yDomain: M,
3769
+ plotConfig: R,
3770
+ updateLineParams: Q
3773
3771
  });
3774
- }, we = (y) => {
3775
- const f = y.alData.map((H) => yt(H));
3776
- console.log("%s: appending line data", e, Object.keys(f));
3777
- const v = s.current, P = Math.max(v.length, f.length), z = [];
3778
- for (let H = 0; H < P; H++)
3779
- z.push(mo(v[H], f[H]));
3780
- Ce(z);
3781
- }, De = (y) => {
3782
- const f = Ee(y.plotConfig), v = y.mlData.map((P) => yt(P)).filter((P) => P !== null);
3772
+ }, xe = (f) => {
3773
+ const y = f.alData.map((H) => pt(H));
3774
+ console.log("%s: appending line data", e, Object.keys(y));
3775
+ const C = s.current, M = Math.max(C.length, y.length), R = [];
3776
+ for (let H = 0; H < M; H++)
3777
+ R.push(fo(C[H], y[H]));
3778
+ ne(R);
3779
+ }, Pe = (f) => {
3780
+ const y = Ee(f.plotConfig), C = f.mlData.map((M) => pt(M)).filter((M) => M !== null);
3783
3781
  console.log(
3784
3782
  "%s: new line data",
3785
3783
  e,
3786
- v.map((P) => P.key)
3787
- ), Ce(v, f);
3788
- }, Me = (y) => {
3789
- const f = yo(y.imData), v = Ee(y.plotConfig);
3790
- if (Co(f)) {
3791
- const P = f;
3792
- console.log("%s: new heatmap data", e, Object.keys(P)), a({
3793
- ...P,
3794
- plotConfig: v
3784
+ C.map((M) => M.key)
3785
+ ), ne(C, y);
3786
+ }, we = (f) => {
3787
+ const y = po(f.imData), C = Ee(f.plotConfig);
3788
+ if (Co(y)) {
3789
+ const M = y;
3790
+ console.log("%s: new heatmap data", e, Object.keys(M)), a({
3791
+ ...M,
3792
+ plotConfig: C
3795
3793
  });
3796
3794
  } else
3797
- console.log("%s: new image data", e, Object.keys(f)), a({
3798
- ...f,
3799
- plotConfig: v
3795
+ console.log("%s: new image data", e, Object.keys(y)), a({
3796
+ ...y,
3797
+ plotConfig: C
3800
3798
  });
3801
- }, X = (y) => {
3802
- const f = So(y.scData);
3803
- console.log("%s: new scatter data", e, Object.keys(f));
3804
- const v = Ee(y.plotConfig);
3805
- m(f), a({
3806
- ...f,
3807
- plotConfig: v,
3808
- setPointSize: se
3799
+ }, De = (f) => {
3800
+ const y = vo(f.scData);
3801
+ console.log("%s: new scatter data", e, Object.keys(y));
3802
+ const C = Ee(f.plotConfig);
3803
+ m(y), a({
3804
+ ...y,
3805
+ plotConfig: C,
3806
+ setPointSize: ae
3809
3807
  });
3810
- }, fe = (y) => {
3811
- const f = po(y.suData);
3812
- console.log("%s: new surface data", e, Object.keys(f));
3813
- const v = Ee(y.plotConfig);
3808
+ }, j = (f) => {
3809
+ const y = bo(f.suData);
3810
+ console.log("%s: new surface data", e, Object.keys(y));
3811
+ const C = Ee(f.plotConfig);
3814
3812
  a({
3815
- ...f,
3816
- plotConfig: v
3813
+ ...y,
3814
+ plotConfig: C
3817
3815
  });
3818
- }, oe = (y) => {
3819
- const f = bo(y.taData);
3820
- console.log("%s: new table data", e, Object.keys(f)), a({
3821
- ...f
3816
+ }, fe = (f) => {
3817
+ const y = So(f.taData);
3818
+ console.log("%s: new table data", e, Object.keys(y)), a({
3819
+ ...y
3822
3820
  });
3823
- }, ge = (y) => {
3824
- const f = y.updateSelections.map((v) => St(v)).filter((v) => v !== null);
3825
- console.log("%s: update selections", e, f), h((v) => {
3826
- const P = [...v];
3827
- for (const z of f) {
3828
- const H = z.id, pe = P.findIndex((ve) => ve.id === H);
3829
- pe === -1 ? P.push(z) : P[pe] = z;
3821
+ }, oe = (f) => {
3822
+ const y = f.updateSelections.map((C) => vt(C)).filter((C) => C !== null);
3823
+ console.log("%s: update selections", e, y), p((C) => {
3824
+ const M = [...C];
3825
+ for (const R of y) {
3826
+ const H = R.id, se = M.findIndex((Se) => Se.id === H);
3827
+ se === -1 ? M.push(R) : M[se] = R;
3830
3828
  }
3831
- return P;
3829
+ return M;
3832
3830
  });
3833
- }, N = (y) => {
3834
- const f = y.selectionIds;
3835
- console.log("%s: clear selections", e, f), f.length === 0 ? h(() => []) : h((v) => {
3836
- const P = [];
3837
- for (const z of v)
3838
- f.includes(z.id) || P.push(z);
3839
- return P;
3831
+ }, ge = (f) => {
3832
+ const y = f.selectionIds;
3833
+ console.log("%s: clear selections", e, y), y.length === 0 ? p(() => []) : p((C) => {
3834
+ const M = [];
3835
+ for (const R of C)
3836
+ y.includes(R.id) || M.push(R);
3837
+ return M;
3840
3838
  });
3841
- }, $ = (y) => {
3842
- const f = y.setSelections.map((v) => St(v)).filter((v) => v !== null);
3843
- console.log("%s: new selections", e, f), h(f);
3844
- }, U = (y) => {
3845
- console.log("%s: updating baton with msg:", e, y, "for", n);
3846
- const f = y.baton;
3847
- K((v) => ({
3848
- ...v,
3849
- batonUuid: f,
3850
- others: y.uuids.filter((P) => P !== n),
3851
- hasBaton: f === n
3839
+ }, I = (f) => {
3840
+ const y = f.setSelections.map((C) => vt(C)).filter((C) => C !== null);
3841
+ console.log("%s: new selections", e, y), p(y);
3842
+ }, $ = (f) => {
3843
+ console.log("%s: updating baton with msg:", e, f, "for", o);
3844
+ const y = f.baton;
3845
+ K((C) => ({
3846
+ ...C,
3847
+ batonUuid: y,
3848
+ others: f.uuids.filter((M) => M !== o),
3849
+ hasBaton: y === o
3852
3850
  }));
3853
3851
  };
3854
- E(() => {
3852
+ z(() => {
3855
3853
  if (!k)
3856
3854
  return;
3857
- w !== Ne.OPEN && console.log("%s: still not open", e);
3858
- const y = k.data;
3859
- if (y instanceof Blob) {
3860
- console.log("Message was a blob:", y);
3855
+ P !== $e.OPEN && console.log("%s: still not open", e);
3856
+ const f = k.data;
3857
+ if (f instanceof Blob) {
3858
+ console.log("Message was a blob:", f);
3861
3859
  return;
3862
3860
  }
3863
- const f = uo(y);
3864
- console.log("%s: decodedMessage", e, Object.keys(f));
3865
- const v = It();
3866
- wt(() => {
3867
- b.current = v.end();
3861
+ const y = ho(f);
3862
+ console.log("%s: decodedMessage", e, Object.keys(y));
3863
+ const C = $t();
3864
+ Dt(() => {
3865
+ b.current = C.end();
3868
3866
  });
3869
- let P = !0;
3870
- "mlData" in f ? De(f) : "alData" in f ? we(f) : "imData" in f ? Me(f) : "scData" in f ? X(f) : "suData" in f ? fe(f) : "taData" in f ? oe(f) : "updateSelections" in f ? ge(f) : "selectionIds" in f ? N(f) : "setSelections" in f ? $(f) : "baton" in f ? U(f) : "requester" in f ? B(f) : "plotId" in f ? W() : (P = !1, console.log("%s: new message type unknown", e)), P && O(`ready ${b.current}`);
3867
+ let M = !0;
3868
+ "mlData" in y ? Pe(y) : "alData" in y ? xe(y) : "imData" in y ? we(y) : "scData" in y ? De(y) : "suData" in y ? j(y) : "taData" in y ? fe(y) : "updateSelections" in y ? oe(y) : "selectionIds" in y ? ge(y) : "setSelections" in y ? I(y) : "baton" in y ? $(y) : "requester" in y ? B(y) : "plotId" in y ? G() : (M = !1, console.log("%s: new message type unknown", e)), M && O(`ready ${b.current}`);
3871
3869
  }, [k, e]);
3872
- let I = i;
3873
- return I && (I = { ...I, batonProps: _, updateSelection: J, selections: d }), I && console.log("%s: plotprops", e, Object.keys(I)), d.length && console.log("%s: selections", e, d.length), !w || w === Ne.UNINSTANTIATED ? /* @__PURE__ */ l("h2", { children: "Waiting for plot server connection" }) : w === Ne.CLOSING ? /* @__PURE__ */ l("h2", { children: "Closing plot server connection" }) : w === Ne.CLOSED ? /* @__PURE__ */ l("h2", { children: "Plot server connection closed" }) : I ? /* @__PURE__ */ l(zi, { ...I }) : /* @__PURE__ */ l("h2", { children: "Awaiting command from plot server" });
3870
+ let N = i;
3871
+ return N && (N = { ...N, batonProps: _, updateSelection: g, selections: h }), N && console.log("%s: plotprops", e, Object.keys(N)), h.length && console.log("%s: selections", e, h.length), !P || P === $e.UNINSTANTIATED ? /* @__PURE__ */ l("h2", { children: "Waiting for plot server connection" }) : P === $e.CLOSING ? /* @__PURE__ */ l("h2", { children: "Closing plot server connection" }) : P === $e.CLOSED ? /* @__PURE__ */ l("h2", { children: "Plot server connection closed" }) : N ? /* @__PURE__ */ l(Ei, { ...N }) : /* @__PURE__ */ l("h2", { children: "Awaiting command from plot server" });
3874
3872
  }
3875
3873
  export {
3876
- zi as AnyPlot,
3877
- Ve as AnyToolbar,
3874
+ Ei as AnyPlot,
3875
+ Ae as AnyToolbar,
3878
3876
  ce as AxialSelection,
3879
- be as BaseSelection,
3880
- Se as CircularSectorialSelection,
3877
+ pe as BaseSelection,
3878
+ be as CircularSectorialSelection,
3881
3879
  me as CircularSelection,
3882
- Ma as ConnectedPlot,
3883
- Pe as EllipticalSelection,
3884
- La as GlyphType,
3885
- va as HeatmapPlot,
3886
- xa as ImagePlot,
3887
- ee as InteractionModeType,
3888
- Pa as LinePlot,
3880
+ _a as ConnectedPlot,
3881
+ Ce as EllipticalSelection,
3882
+ ka as GlyphType,
3883
+ xa as HeatmapPlot,
3884
+ Pa as ImagePlot,
3885
+ J as InteractionModeType,
3886
+ wa as LinePlot,
3889
3887
  ue as LinearSelection,
3890
- rt as OrientableSelection,
3891
- Ae as PlotCustomizationContextProvider,
3892
- $i as PlotToolbar,
3888
+ ct as OrientableSelection,
3889
+ ke as PlotCustomizationContextProvider,
3890
+ Fi as PlotToolbar,
3893
3891
  ie as PolygonalSelection,
3894
3892
  de as RectangularSelection,
3895
- ka as ScaleType,
3896
- wa as ScatterPlot,
3897
- G as SelectionType,
3898
- Da as SurfacePlot,
3899
- Oi as TableDisplay,
3900
- ke as usePlotCustomizationContext
3893
+ Aa as ScaleType,
3894
+ Da as ScatterPlot,
3895
+ q as SelectionType,
3896
+ Ma as SurfacePlot,
3897
+ Bi as TableDisplay,
3898
+ Le as usePlotCustomizationContext,
3899
+ Et as useSelections
3901
3900
  };