baselode 0.1.20 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/baselode.js CHANGED
@@ -1,33 +1,33 @@
1
- import { _ as gt, w as k, H as _, P as de, F as C, T as M, c as bt, L as se, a as re, D as G, A as j, b as Y, E as pe, N as ye, d as ve, M as Ee, G as le, e as ce, B as _t, f as Qe, g as $e, h as Pe, i as Be, j as Nt, k as et, l as Et, m as Ge, n as At, o as vt } from "./baselode3dScene-qMfVRKxK.js";
2
- import { p as us, q as ds, r as ms, s as fs, t as hs, u as ps, v as ys, x as gs, y as bs, z as _s, C as Ns, I as Es, J as As, K as vs, O as Is, Q as Ss, R as Ls, S as Cs, U as Ts, V as Ms, W as Os, X as Ps, Y as Ds, Z as xs, $ as Rs, a0 as zs, a1 as Fs, a2 as $s, a3 as ks, a4 as ws, a5 as Hs, a6 as Us, a7 as Bs, a8 as Gs, a9 as Vs, aa as js, ab as Ys, ac as Ws, ad as qs, ae as Ks, af as Xs, ag as Zs, ah as Js, ai as Qs, aj as er, ak as tr, al as nr, am as sr, an as rr, ao as or, ap as ir, aq as ar, ar as lr, as as cr, at as ur, au as dr, av as mr, aw as fr, ax as hr, ay as pr, az as yr, aA as gr, aB as br, aC as _r, aD as Nr, aE as Er, aF as Ar, aG as vr, aH as Ir, aI as Sr, aJ as Lr, aK as Cr, aL as Tr, aM as Mr, aN as Or, aO as Pr, aP as Dr, aQ as xr, aR as Rr, aS as zr, aT as Fr, aU as $r, aV as kr, aW as wr, aX as Hr, aY as Ur, aZ as Br, a_ as Gr, a$ as Vr, b0 as jr, b1 as Yr, b2 as Wr, b3 as qr, b4 as Kr, b5 as Xr, b6 as Zr, b7 as Jr, b8 as Qr, b9 as eo, ba as to, bb as no, bc as so, bd as ro, be as oo, bf as io, bg as ao } from "./baselode3dScene-qMfVRKxK.js";
1
+ import { _ as Nt, w as U, H as N, P as de, F as M, T as O, c as vt, L as re, a as oe, D as V, A as Y, b as W, E as pe, N as ge, d as Ee, M as ve, G as le, e as ce, B as Et, f as et, g as $e, h as ze, i as tt, j as Ge, k as At, l as nt, m as St, n as Tt, o as Lt, p as It } from "./baselode3dScene-4nzt80B1.js";
2
+ import { q as vr, r as Er, s as Ar, t as Sr, u as Tr, v as Lr, x as Ir, y as Cr, z as Mr, C as Pr, I as Or, J as xr, K as Dr, O as Rr, Q as zr, R as Fr, S as $r, U as kr, V as wr, W as Ur, X as Hr, Y as Gr, Z as Br, $ as Vr, a0 as jr, a1 as Yr, a2 as Wr, a3 as qr, a4 as Xr, a5 as Kr, a6 as Zr, a7 as Jr, a8 as Qr, a9 as eo, aa as to, ab as no, ac as ro, ad as oo, ae as so, af as io, ag as ao, ah as lo, ai as co, aj as uo, ak as mo, al as fo, am as ho, an as po, ao as go, ap as bo, aq as yo, ar as _o, as as No, at as vo, au as Eo, av as Ao, aw as So, ax as To, ay as Lo, az as Io, aA as Co, aB as Mo, aC as Po, aD as Oo, aE as xo, aF as Do, aG as Ro, aH as zo, aI as Fo, aJ as $o, aK as ko, aL as wo, aM as Uo, aN as Ho, aO as Go, aP as Bo, aQ as Vo, aR as jo, aS as Yo, aT as Wo, aU as qo, aV as Xo, aW as Ko, aX as Zo, aY as Jo, aZ as Qo, a_ as es, a$ as ts, b0 as ns, b1 as rs, b2 as os, b3 as ss, b4 as is, b5 as as, b6 as ls, b7 as cs, b8 as us, b9 as ds, ba as ms, bb as fs, bc as hs, bd as ps, be as gs, bf as bs, bg as ys, bh as _s, bi as Ns, bj as vs, bk as Es, bl as As } from "./baselode3dScene-4nzt80B1.js";
3
3
  import J from "papaparse";
4
- import { jsx as S, jsxs as W } from "react/jsx-runtime";
5
- import { useRef as _e, useState as X, useEffect as ne, useMemo as ee, useCallback as De } from "react";
6
- import Ae from "plotly.js-dist-min";
4
+ import { jsxs as w, jsx as S, Fragment as Ct } from "react/jsx-runtime";
5
+ import { useRef as ye, useState as K, useEffect as te, useMemo as ee, useCallback as Pe } from "react";
6
+ import Oe from "plotly.js-dist-min";
7
7
  import * as Q from "three";
8
- function Ie(e) {
8
+ function Ae(e) {
9
9
  return (e || "").toString().trim().toLowerCase().replace(/\s+/g, "_");
10
10
  }
11
11
  function ie(e, n = null, t = null) {
12
- const s = { ...gt };
12
+ const r = { ...Nt };
13
13
  if (t) {
14
- for (const [i, o] of Object.entries(t))
15
- if (i != null && o != null) {
16
- const a = Ie(i), l = Ie(o);
17
- s[a] = l;
14
+ for (const [i, s] of Object.entries(t))
15
+ if (i != null && s != null) {
16
+ const a = Ae(i), l = Ae(s);
17
+ r[a] = l;
18
18
  }
19
19
  }
20
- const r = {};
21
- for (const [i, o] of Object.entries(e)) {
22
- const a = Ie(i), l = s[a] || a;
23
- r[l] = o;
20
+ const o = {};
21
+ for (const [i, s] of Object.entries(e)) {
22
+ const a = Ae(i), l = r[a] || a;
23
+ o[l] = s;
24
24
  }
25
- return r;
25
+ return o;
26
26
  }
27
- function _n(e, n = null, t = null) {
28
- return e.map((s) => ie(s, n, t));
27
+ function Pn(e, n = null, t = null) {
28
+ return e.map((r) => ie(r, n, t));
29
29
  }
30
- const It = /* @__PURE__ */ new Set([
30
+ const Mt = /* @__PURE__ */ new Set([
31
31
  "hole_id",
32
32
  "holeid",
33
33
  "id",
@@ -59,84 +59,84 @@ const It = /* @__PURE__ */ new Set([
59
59
  "todepth",
60
60
  "comment",
61
61
  "z"
62
- ]), Te = (e, n = null) => ie(e, null, n);
63
- function St(e) {
64
- return { holeId: e[_] };
65
- }
66
- function tt(e, n = null) {
67
- const t = e[_], s = t !== void 0 ? `${t}`.trim() : "";
68
- if (!s) return null;
69
- const r = e[de] || e.project || e.project_code, i = Number(e[C]), o = Number(e[M]);
70
- return !Number.isFinite(i) || !Number.isFinite(o) || o <= i ? null : {
71
- holeId: s,
72
- project: r,
62
+ ]), Ie = (e, n = null) => ie(e, null, n);
63
+ function Pt(e) {
64
+ return { holeId: e[N] };
65
+ }
66
+ function rt(e, n = null) {
67
+ const t = e[N], r = t !== void 0 ? `${t}`.trim() : "";
68
+ if (!r) return null;
69
+ const o = e[de] || e.project || e.project_code, i = Number(e[M]), s = Number(e[O]);
70
+ return !Number.isFinite(i) || !Number.isFinite(s) || s <= i ? null : {
71
+ holeId: r,
72
+ project: o,
73
73
  from: i,
74
- to: o,
74
+ to: s,
75
75
  ...e
76
76
  };
77
77
  }
78
- function nt(e, n) {
79
- var r;
80
- const t = n.sort((i, o) => i.from - o.from), s = [];
78
+ function ot(e, n) {
79
+ var o;
80
+ const t = n.sort((i, s) => i.from - s.from), r = [];
81
81
  return t.forEach((i) => {
82
- const { from: o, to: a, project: l, ...u } = i, c = {
83
- z: o,
84
- from: o,
82
+ const { from: s, to: a, project: l, ...u } = i, c = {
83
+ z: s,
84
+ from: s,
85
85
  to: a,
86
- [_]: e,
86
+ [N]: e,
87
87
  [de]: l,
88
88
  ...u
89
89
  };
90
- s.push(c), s.push({ ...c, z: a });
91
- }), { id: e, project: (r = t[0]) == null ? void 0 : r.project, points: s };
90
+ r.push(c), r.push({ ...c, z: a });
91
+ }), { id: e, project: (o = t[0]) == null ? void 0 : o.project, points: r };
92
92
  }
93
- function Nn(e, n = null) {
94
- return new Promise((t, s) => {
95
- const r = /* @__PURE__ */ new Set();
93
+ function On(e, n = null) {
94
+ return new Promise((t, r) => {
95
+ const o = /* @__PURE__ */ new Set();
96
96
  J.parse(e, {
97
97
  header: !0,
98
98
  dynamicTyping: !0,
99
99
  skipEmptyLines: !0,
100
100
  step: (i) => {
101
- const a = Te(i.data, n)[_];
102
- a !== void 0 && `${a}`.trim() !== "" && r.add(`${a}`.trim());
101
+ const a = Ie(i.data, n)[N];
102
+ a !== void 0 && `${a}`.trim() !== "" && o.add(`${a}`.trim());
103
103
  },
104
- complete: () => t(Array.from(r)),
105
- error: (i) => s(k("parseAssayHoleIds", i))
104
+ complete: () => t(Array.from(o)),
105
+ error: (i) => r(U("parseAssayHoleIds", i))
106
106
  });
107
107
  });
108
108
  }
109
- function Lt(e) {
110
- return Object.entries(e || {}).some(([n, t]) => !(It.has(n) || t == null || typeof t == "string" && t.trim() === ""));
109
+ function Ot(e) {
110
+ return Object.entries(e || {}).some(([n, t]) => !(Mt.has(n) || t == null || typeof t == "string" && t.trim() === ""));
111
111
  }
112
- function Ct(e, n = null) {
113
- return new Promise((t, s) => {
114
- const r = /* @__PURE__ */ new Map();
112
+ function xt(e, n = null) {
113
+ return new Promise((t, r) => {
114
+ const o = /* @__PURE__ */ new Map();
115
115
  J.parse(e, {
116
116
  header: !0,
117
117
  dynamicTyping: !0,
118
118
  skipEmptyLines: !0,
119
119
  step: (i) => {
120
- const o = Te(i.data, n);
121
- if (!Lt(o)) return;
122
- const l = St(o).holeId;
120
+ const s = Ie(i.data, n);
121
+ if (!Ot(s)) return;
122
+ const l = Pt(s).holeId;
123
123
  if (l !== void 0 && `${l}`.trim() !== "") {
124
124
  const u = `${l}`.trim();
125
- r.has(u) || r.set(u, {
125
+ o.has(u) || o.set(u, {
126
126
  holeId: u
127
127
  });
128
128
  }
129
129
  },
130
- complete: () => t(Array.from(r.values())),
131
- error: (i) => s(k("parseAssayHoleIdsWithAssays", i))
130
+ complete: () => t(Array.from(o.values())),
131
+ error: (i) => r(U("parseAssayHoleIdsWithAssays", i))
132
132
  });
133
133
  });
134
134
  }
135
- function Tt(e, n, t = null, s = null) {
136
- return new Promise((r, i) => {
137
- const o = `${n}`.trim();
138
- if (!o) {
139
- i(k("parseAssayHole", new Error("Missing hole id")));
135
+ function Dt(e, n, t = null, r = null) {
136
+ return new Promise((o, i) => {
137
+ const s = `${n}`.trim();
138
+ if (!s) {
139
+ i(U("parseAssayHole", new Error("Missing hole id")));
140
140
  return;
141
141
  }
142
142
  const a = [];
@@ -145,169 +145,169 @@ function Tt(e, n, t = null, s = null) {
145
145
  dynamicTyping: !0,
146
146
  skipEmptyLines: !0,
147
147
  step: (l) => {
148
- const u = Te(l.data, s), c = tt(u, s);
149
- c && `${c.holeId}`.trim() === o && a.push(c);
148
+ const u = Ie(l.data, r), c = rt(u, r);
149
+ c && `${c.holeId}`.trim() === s && a.push(c);
150
150
  },
151
151
  complete: () => {
152
152
  if (!a.length) {
153
- r(null);
153
+ o(null);
154
154
  return;
155
155
  }
156
- const l = nt(o, a);
157
- r(l);
156
+ const l = ot(s, a);
157
+ o(l);
158
158
  },
159
- error: (l) => i(k("parseAssayHole", l))
159
+ error: (l) => i(U("parseAssayHole", l))
160
160
  });
161
161
  });
162
162
  }
163
- function Mt(e, n = null, t = null) {
164
- return new Promise((s, r) => {
163
+ function Rt(e, n = null, t = null) {
164
+ return new Promise((r, o) => {
165
165
  J.parse(e, {
166
166
  header: !0,
167
167
  dynamicTyping: !0,
168
168
  skipEmptyLines: !0,
169
169
  complete: (i) => {
170
- const o = /* @__PURE__ */ new Map();
170
+ const s = /* @__PURE__ */ new Map();
171
171
  i.data.forEach((l) => {
172
- const u = Te(l, t), c = tt(u, t);
173
- c && (o.has(c.holeId) || o.set(c.holeId, []), o.get(c.holeId).push(c));
172
+ const u = Ie(l, t), c = rt(u, t);
173
+ c && (s.has(c.holeId) || s.set(c.holeId, []), s.get(c.holeId).push(c));
174
174
  });
175
- const a = Array.from(o.entries()).map(([l, u]) => nt(l, u));
176
- s({ holes: a });
175
+ const a = Array.from(s.entries()).map(([l, u]) => ot(l, u));
176
+ r({ holes: a });
177
177
  },
178
- error: (i) => r(k("parseAssaysCSV", i))
178
+ error: (i) => o(U("parseAssaysCSV", i))
179
179
  });
180
180
  });
181
181
  }
182
- function En(e = {}) {
182
+ function xn(e = {}) {
183
183
  const n = {};
184
- return Object.entries(e || {}).forEach(([t, s]) => {
185
- t && (n[Ie(t)] = s);
184
+ return Object.entries(e || {}).forEach(([t, r]) => {
185
+ t && (n[Ae(t)] = r);
186
186
  }), n;
187
187
  }
188
- function An(e = {}, n = [], t) {
189
- for (const s of n) {
190
- const r = e[s];
191
- if (r != null && `${r}`.trim() !== "")
192
- return r;
188
+ function Dn(e = {}, n = [], t) {
189
+ for (const r of n) {
190
+ const o = e[r];
191
+ if (o != null && `${o}`.trim() !== "")
192
+ return o;
193
193
  }
194
194
  return t;
195
195
  }
196
- const Ot = 4;
196
+ const zt = 4;
197
197
  function st(e = [], n = "") {
198
198
  if (!e.length) return [];
199
199
  if (!n) return e;
200
200
  const t = e.findIndex((i) => i === n);
201
201
  if (t === -1) return e;
202
- const s = e[t], r = e.filter((i, o) => o !== t);
203
- return [s, ...r];
202
+ const r = e[t], o = e.filter((i, s) => s !== t);
203
+ return [r, ...o];
204
204
  }
205
205
  function Se({
206
206
  property: e = "",
207
207
  chartType: n = "",
208
208
  categoricalProps: t = [],
209
- commentProps: s = [],
210
- numericDefaultChartType: r = "markers+line"
209
+ commentProps: r = [],
210
+ numericDefaultChartType: o = "markers+line"
211
211
  } = {}) {
212
- return e ? s.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? r : n : n || r;
212
+ return e ? r.includes(e) ? "comment" : t.includes(e) ? "categorical" : e === "dip" ? "tadpole" : !n || n === "categorical" || n === "comment" || n === "tadpole" ? o : n : n || o;
213
213
  }
214
- function rt({
214
+ function it({
215
215
  holeIds: e = [],
216
216
  focusedHoleId: n = "",
217
- plotCount: t = Ot,
218
- defaultProp: s = "",
219
- categoricalProps: r = [],
217
+ plotCount: t = zt,
218
+ defaultProp: r = "",
219
+ categoricalProps: o = [],
220
220
  commentProps: i = [],
221
- numericDefaultChartType: o = "markers+line"
221
+ numericDefaultChartType: s = "markers+line"
222
222
  } = {}) {
223
223
  const a = st(e, n);
224
224
  return Array.from({ length: t }).map((l, u) => {
225
- const c = a[u] || e[u] || "", m = Se({
226
- property: s,
225
+ const c = a[u] || e[u] || "", d = Se({
226
+ property: r,
227
227
  chartType: "",
228
- categoricalProps: r,
228
+ categoricalProps: o,
229
229
  commentProps: i,
230
- numericDefaultChartType: o
230
+ numericDefaultChartType: s
231
231
  });
232
232
  return {
233
233
  holeId: c,
234
- property: s,
235
- chartType: m
234
+ property: r,
235
+ chartType: d
236
236
  };
237
237
  });
238
238
  }
239
- function Le(e = []) {
240
- const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: s, commentCols: r, byType: i } = bt(n), o = t[0] || s[0] || "";
239
+ function Te(e = []) {
240
+ const n = e.flatMap((a) => a.points || []), { numericCols: t, categoricalCols: r, commentCols: o, byType: i } = vt(n), s = t[0] || r[0] || "";
241
241
  return {
242
242
  numericProps: t,
243
- categoricalProps: s,
244
- commentProps: r,
243
+ categoricalProps: r,
244
+ commentProps: o,
245
245
  columnMeta: i,
246
- defaultProp: o
246
+ defaultProp: s
247
247
  };
248
248
  }
249
- async function Pt(e, n = null) {
250
- return await Ct(e);
249
+ async function Ft(e, n = null) {
250
+ return await xt(e);
251
251
  }
252
- async function Dt(e, n, t = null) {
253
- return await Tt(e, n);
252
+ async function $t(e, n, t = null) {
253
+ return await Dt(e, n);
254
254
  }
255
- function xt(e = [], n = "") {
255
+ function kt(e = [], n = "") {
256
256
  if (!e.length) return null;
257
- const { numericProps: t, categoricalProps: s, commentProps: r, columnMeta: i, defaultProp: o } = Le(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = rt({
257
+ const { numericProps: t, categoricalProps: r, commentProps: o, columnMeta: i, defaultProp: s } = Te(e), a = e.map((u) => u.id || u.holeId).filter(Boolean), l = it({
258
258
  holeIds: a,
259
259
  focusedHoleId: n,
260
260
  plotCount: 4,
261
- defaultProp: o,
262
- categoricalProps: s,
263
- commentProps: r,
261
+ defaultProp: s,
262
+ categoricalProps: r,
263
+ commentProps: o,
264
264
  numericDefaultChartType: "line"
265
265
  });
266
266
  return {
267
267
  holes: e,
268
268
  numericProps: t,
269
- categoricalProps: s,
270
- commentProps: r,
269
+ categoricalProps: r,
270
+ commentProps: o,
271
271
  columnMeta: i,
272
- defaultProp: o,
272
+ defaultProp: s,
273
273
  traceConfigs: l
274
274
  };
275
275
  }
276
- async function vn(e, n = "", t = null) {
277
- const { holes: s } = await Mt(e, t), r = xt(s, n);
278
- if (!r) throw new Error("No valid assay intervals found.");
279
- return r;
276
+ async function Rn(e, n = "", t = null) {
277
+ const { holes: r } = await Rt(e, t), o = kt(r, n);
278
+ if (!o) throw new Error("No valid assay intervals found.");
279
+ return o;
280
280
  }
281
- function In(e, n = null) {
282
- return new Promise((t, s) => {
281
+ function zn(e, n = null) {
282
+ return new Promise((t, r) => {
283
283
  J.parse(e, {
284
284
  header: !0,
285
285
  dynamicTyping: !0,
286
286
  skipEmptyLines: !0,
287
- complete: (r) => {
288
- const i = r.data.map((o) => Rt(o, n)).filter((o) => o[_] && Number.isFinite(o[G]) && Number.isFinite(o[Y]) && Number.isFinite(o[j]));
287
+ complete: (o) => {
288
+ const i = o.data.map((s) => wt(s, n)).filter((s) => s[N] && Number.isFinite(s[V]) && Number.isFinite(s[W]) && Number.isFinite(s[Y]));
289
289
  t(i);
290
290
  },
291
- error: (r) => s(k("parseSurveyCSV", r))
291
+ error: (o) => r(U("parseSurveyCSV", o))
292
292
  });
293
293
  });
294
294
  }
295
- function Rt(e, n = null) {
296
- const t = ie(e, null, n), s = t[_], r = t[de] || t.project || t.project_code, i = he(t[se]), o = he(t[re]), a = he(t[G]), l = he(t[Y]), u = he(t[j]), c = he(t.maxdepth);
295
+ function wt(e, n = null) {
296
+ const t = ie(e, null, n), r = t[N], o = t[de] || t.project || t.project_code, i = he(t[re]), s = he(t[oe]), a = he(t[V]), l = he(t[W]), u = he(t[Y]), c = he(t.maxdepth);
297
297
  return {
298
298
  raw: t,
299
- [_]: s,
300
- [de]: r,
301
- [se]: i,
302
- [re]: o,
303
- [G]: a,
304
- [Y]: l,
305
- [j]: u,
299
+ [N]: r,
300
+ [de]: o,
301
+ [re]: i,
302
+ [oe]: s,
303
+ [V]: a,
304
+ [W]: l,
305
+ [Y]: u,
306
306
  maxdepth: c,
307
307
  // Legacy field names for backwards compatibility
308
- project_code: r,
308
+ project_code: o,
309
309
  latitude: i,
310
- longitude: o,
310
+ longitude: s,
311
311
  surveydepth: a
312
312
  };
313
313
  }
@@ -315,251 +315,251 @@ const he = (e) => {
315
315
  const n = Number(e);
316
316
  return Number.isFinite(n) ? n : void 0;
317
317
  };
318
- function Sn(e, n) {
319
- var u, c, m, d;
318
+ function Fn(e, n) {
319
+ var u, c, d, m;
320
320
  const t = /* @__PURE__ */ new Map();
321
321
  e.forEach((f) => {
322
- const g = (f[_] || f.holeId || f.id || "").toString().trim();
323
- if (!g) return;
324
- const y = g.toLowerCase();
325
- t.has(y) || t.set(y, f);
322
+ const b = (f[N] || f.holeId || f.id || "").toString().trim();
323
+ if (!b) return;
324
+ const p = b.toLowerCase();
325
+ t.has(p) || t.set(p, f);
326
326
  });
327
- const s = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[se]) ?? 0, r = ((m = e[0]) == null ? void 0 : m.lng) ?? ((d = e[0]) == null ? void 0 : d[re]) ?? 0, i = 111132, o = 111320 * Math.cos(s * Math.PI / 180), a = /* @__PURE__ */ new Map();
327
+ const r = ((u = e[0]) == null ? void 0 : u.lat) ?? ((c = e[0]) == null ? void 0 : c[re]) ?? 0, o = ((d = e[0]) == null ? void 0 : d.lng) ?? ((m = e[0]) == null ? void 0 : m[oe]) ?? 0, i = 111132, s = 111320 * Math.cos(r * Math.PI / 180), a = /* @__PURE__ */ new Map();
328
328
  n.forEach((f) => {
329
- const g = (f[_] || "").toString().trim();
330
- if (!g) return;
331
- const y = g.toLowerCase();
332
- a.has(y) || a.set(y, []), a.get(y).push(f);
329
+ const b = (f[N] || "").toString().trim();
330
+ if (!b) return;
331
+ const p = b.toLowerCase();
332
+ a.has(p) || a.set(p, []), a.get(p).push(f);
333
333
  });
334
334
  const l = [];
335
- return a.forEach((f, g) => {
336
- const y = t.get(g);
337
- if (!y) return;
338
- const b = f.filter((I) => Number.isFinite(I[G] ?? I.surveydepth)).sort((I, z) => (I[G] ?? I.surveydepth) - (z[G] ?? z.surveydepth));
339
- if (!b.length) return;
340
- const h = y.lat ?? y[se], E = y.lng ?? y[re], A = 111132, x = 111320 * Math.cos(h * Math.PI / 180), H = (E - r) * o, O = (h - s) * i, P = [];
341
- let R = 0, V = 0, p = 0;
342
- for (let I = 0; I < b.length; I += 1) {
343
- const z = b[I], w = b[I - 1], v = z[G] ?? z.surveydepth, N = z[j] ?? z.azimuth, D = z[Y] ?? z.dip;
344
- if (!w) {
345
- P.push({
335
+ return a.forEach((f, b) => {
336
+ const p = t.get(b);
337
+ if (!p) return;
338
+ const v = f.filter((A) => Number.isFinite(A[V] ?? A.surveydepth)).sort((A, z) => (A[V] ?? A.surveydepth) - (z[V] ?? z.surveydepth));
339
+ if (!v.length) return;
340
+ const g = p.lat ?? p[re], L = p.lng ?? p[oe], C = 111132, j = 111320 * Math.cos(g * Math.PI / 180), H = (L - o) * s, $ = (g - r) * i, D = [];
341
+ let R = 0, G = 0, h = 0;
342
+ for (let A = 0; A < v.length; A += 1) {
343
+ const z = v[A], E = v[A - 1], _ = z[V] ?? z.surveydepth, y = z[Y] ?? z.azimuth, I = z[W] ?? z.dip;
344
+ if (!E) {
345
+ D.push({
346
346
  x: H + R,
347
- y: O + V,
347
+ y: $ + G,
348
348
  z: 0,
349
- md: v,
350
- azimuth: N,
351
- dip: D
349
+ md: _,
350
+ azimuth: y,
351
+ dip: I
352
352
  });
353
353
  continue;
354
354
  }
355
- const F = w[G] ?? w.surveydepth, L = w[j] ?? w.azimuth, U = w[Y] ?? w.dip, B = v - F;
355
+ const F = E[V] ?? E.surveydepth, T = E[Y] ?? E.azimuth, x = E[W] ?? E.dip, B = _ - F;
356
356
  if (B <= 0) continue;
357
- const $ = Ve(U), q = Ve(D), K = Fe(L), ae = Fe(N), be = Math.acos(
358
- Math.sin($) * Math.sin(q) * Math.cos(K - ae) + Math.cos($) * Math.cos(q)
359
- ), me = be > 1e-6 ? 2 / be * Math.tan(be / 2) : 1, Oe = 0.5 * B * (Math.sin($) * Math.cos(K) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * B * (Math.sin($) * Math.sin(K) + Math.sin(q) * Math.sin(ae)) * me, yt = 0.5 * B * (Math.cos($) + Math.cos(q)) * me;
360
- R += Oe, V += fe, p += yt, P.push({
357
+ const k = Be(x), q = Be(I), X = Fe(T), ae = Fe(y), _e = Math.acos(
358
+ Math.sin(k) * Math.sin(q) * Math.cos(X - ae) + Math.cos(k) * Math.cos(q)
359
+ ), me = _e > 1e-6 ? 2 / _e * Math.tan(_e / 2) : 1, Me = 0.5 * B * (Math.sin(k) * Math.cos(X) + Math.sin(q) * Math.cos(ae)) * me, fe = 0.5 * B * (Math.sin(k) * Math.sin(X) + Math.sin(q) * Math.sin(ae)) * me, _t = 0.5 * B * (Math.cos(k) + Math.cos(q)) * me;
360
+ R += Me, G += fe, h += _t, D.push({
361
361
  x: H + R,
362
- y: O + V,
363
- z: -p,
362
+ y: $ + G,
363
+ z: -h,
364
364
  // render with z up; depth down
365
- md: v,
366
- azimuth: N,
367
- dip: D
365
+ md: _,
366
+ azimuth: y,
367
+ dip: I
368
368
  });
369
369
  }
370
- const T = P.map((I) => ({
371
- ...I,
372
- lat: h + I.y / A,
373
- lng: E + I.x / x
370
+ const P = D.map((A) => ({
371
+ ...A,
372
+ lat: g + A.y / C,
373
+ lng: L + A.x / j
374
374
  }));
375
375
  l.push({
376
- id: y[_] || y.holeId || g,
377
- project: y[de] || y.project_id || y.project || "",
378
- points: T,
379
- collar: y
376
+ id: p[N] || p.holeId || b,
377
+ project: p[de] || p.project_id || p.project || "",
378
+ points: P,
379
+ collar: p
380
380
  });
381
381
  }), l;
382
382
  }
383
- const Fe = (e) => e * Math.PI / 180, Ve = (e) => {
384
- const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), s = Math.min(180, Math.max(0, t));
385
- return Fe(s);
383
+ const Fe = (e) => e * Math.PI / 180, Be = (e) => {
384
+ const n = Number(e), t = 90 + (Number.isFinite(n) ? n : 0), r = Math.min(180, Math.max(0, t));
385
+ return Fe(r);
386
386
  };
387
- function te(e, n = void 0) {
387
+ function ne(e, n = void 0) {
388
388
  const t = Number(e);
389
389
  return Number.isFinite(t) ? t : n;
390
390
  }
391
- function je(e) {
391
+ function Ve(e) {
392
392
  return e == null ? "" : `${e}`.trim();
393
393
  }
394
- function Ce(e = [], n = null) {
395
- const t = n || "hole_id", r = [t, "hole_id", "holeId", "id"].find((i) => e.some((o) => je(o == null ? void 0 : o[i])));
396
- if (!r)
397
- throw k("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
394
+ function Le(e = [], n = null) {
395
+ const t = n || "hole_id", o = [t, "hole_id", "holeId", "id"].find((i) => e.some((s) => Ve(s == null ? void 0 : s[i])));
396
+ if (!o)
397
+ throw U("canonicalizeHoleIdRows", new Error(`hole id column '${t}' not found`));
398
398
  return {
399
- aliasCol: r,
399
+ aliasCol: o,
400
400
  rows: e.map((i) => ({
401
401
  ...i,
402
- hole_id: je(i == null ? void 0 : i[r])
402
+ hole_id: Ve(i == null ? void 0 : i[o])
403
403
  }))
404
404
  };
405
405
  }
406
- function Ye(e) {
406
+ function je(e) {
407
407
  return Number(e) * Math.PI / 180;
408
408
  }
409
409
  function xe(e, n) {
410
- const t = Ye(e), s = Ye(n), r = Math.cos(s) * Math.sin(t), i = Math.cos(s) * Math.cos(t), o = Math.sin(s) * -1;
411
- return { ca: r, cb: i, cc: o };
410
+ const t = je(e), r = je(n), o = Math.cos(r) * Math.sin(t), i = Math.cos(r) * Math.cos(t), s = Math.sin(r) * -1;
411
+ return { ca: o, cb: i, cc: s };
412
412
  }
413
- function zt(e, n, t, s, r, i = "minimum_curvature") {
414
- const o = xe(n, t), a = xe(s, r);
413
+ function Ut(e, n, t, r, o, i = "minimum_curvature") {
414
+ const s = xe(n, t), a = xe(r, o);
415
415
  if (i === "tangential")
416
416
  return {
417
- dx: e * o.ca,
418
- dy: e * o.cb,
419
- dz: e * o.cc,
417
+ dx: e * s.ca,
418
+ dy: e * s.cb,
419
+ dz: e * s.cc,
420
420
  azimuth: n,
421
421
  dip: t
422
422
  };
423
423
  if (i === "balanced_tangential") {
424
- const m = 0.5 * (n + s), d = 0.5 * (t + r), f = xe(m, d);
424
+ const d = 0.5 * (n + r), m = 0.5 * (t + o), f = xe(d, m);
425
425
  return {
426
426
  dx: e * f.ca,
427
427
  dy: e * f.cb,
428
428
  dz: e * f.cc,
429
- azimuth: m,
430
- dip: d
429
+ azimuth: d,
430
+ dip: m
431
431
  };
432
432
  }
433
- const l = o.ca * a.ca + o.cb * a.cb + o.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
433
+ const l = s.ca * a.ca + s.cb * a.cb + s.cc * a.cc, u = Math.acos(Math.max(-1, Math.min(1, l))), c = u > 1e-6 ? 2 * Math.tan(u / 2) / u : 1;
434
434
  return {
435
- dx: 0.5 * e * (o.ca + a.ca) * c,
436
- dy: 0.5 * e * (o.cb + a.cb) * c,
437
- dz: 0.5 * e * (o.cc + a.cc) * c,
438
- azimuth: s,
439
- dip: r
435
+ dx: 0.5 * e * (s.ca + a.ca) * c,
436
+ dy: 0.5 * e * (s.cb + a.cb) * c,
437
+ dz: 0.5 * e * (s.cc + a.cc) * c,
438
+ azimuth: r,
439
+ dip: o
440
440
  };
441
441
  }
442
442
  function ke(e = [], n = [], t = {}) {
443
443
  const {
444
- step: s = 1,
445
- holeIdCol: r = null,
444
+ step: r = 1,
445
+ holeIdCol: o = null,
446
446
  method: i = "minimum_curvature"
447
- } = t, o = Number.isFinite(Number(s)) && Number(s) > 0 ? Number(s) : 1, a = Ce(e, r), l = Ce(n, r || a.aliasCol);
447
+ } = t, s = Number.isFinite(Number(r)) && Number(r) > 0 ? Number(r) : 1, a = Le(e, o), l = Le(n, o || a.aliasCol);
448
448
  if (!a.rows.length || !l.rows.length) return [];
449
449
  const u = /* @__PURE__ */ new Map();
450
- a.rows.forEach((d) => {
451
- !d.hole_id || u.has(d.hole_id) || u.set(d.hole_id, d);
450
+ a.rows.forEach((m) => {
451
+ !m.hole_id || u.has(m.hole_id) || u.set(m.hole_id, m);
452
452
  });
453
453
  const c = /* @__PURE__ */ new Map();
454
- l.rows.forEach((d) => {
455
- d.hole_id && (c.has(d.hole_id) || c.set(d.hole_id, []), c.get(d.hole_id).push(d));
454
+ l.rows.forEach((m) => {
455
+ m.hole_id && (c.has(m.hole_id) || c.set(m.hole_id, []), c.get(m.hole_id).push(m));
456
456
  });
457
- const m = [];
458
- return c.forEach((d, f) => {
459
- const g = u.get(f);
460
- if (!g) return;
461
- const y = [...d].map((P) => ({
462
- ...P,
463
- from: te(P.from),
464
- azimuth: te(P.azimuth),
465
- dip: te(P.dip)
466
- })).filter((P) => Number.isFinite(P.from) && Number.isFinite(P.azimuth) && Number.isFinite(P.dip)).sort((P, R) => P.from - R.from);
467
- if (!y.length) return;
468
- let b = te(g.x, 0), h = te(g.y, 0), E = te(g.z, 0), A = y[0].from;
469
- const x = y[0].azimuth, H = y[0].dip, O = {
457
+ const d = [];
458
+ return c.forEach((m, f) => {
459
+ const b = u.get(f);
460
+ if (!b) return;
461
+ const p = [...m].map((D) => ({
462
+ ...D,
463
+ from: ne(D.from),
464
+ azimuth: ne(D.azimuth),
465
+ dip: ne(D.dip)
466
+ })).filter((D) => Number.isFinite(D.from) && Number.isFinite(D.azimuth) && Number.isFinite(D.dip)).sort((D, R) => D.from - R.from);
467
+ if (!p.length) return;
468
+ let v = ne(b.x, 0), g = ne(b.y, 0), L = ne(b.z, 0), C = p[0].from;
469
+ const j = p[0].azimuth, H = p[0].dip, $ = {
470
470
  hole_id: f,
471
- md: A,
472
- x: b,
473
- y: h,
474
- z: E,
475
- azimuth: x,
471
+ md: C,
472
+ x: v,
473
+ y: g,
474
+ z: L,
475
+ azimuth: j,
476
476
  dip: H
477
477
  };
478
- a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (O[a.aliasCol] = g[a.aliasCol]), m.push(O);
479
- for (let P = 0; P < y.length - 1; P += 1) {
480
- const R = y[P], V = y[P + 1], p = R.from, I = V.from - p;
481
- if (I <= 0) continue;
482
- const z = Math.max(1, Math.ceil(I / o)), w = I / z;
483
- for (let v = 0; v < z; v += 1) {
484
- A += w;
485
- const N = (A - p) / I, D = R.azimuth + N * (V.azimuth - R.azimuth), F = R.dip + N * (V.dip - R.dip), L = zt(w, R.azimuth, R.dip, V.azimuth, V.dip, i);
486
- b += L.dx, h += L.dy, E += L.dz;
487
- const U = {
478
+ a.aliasCol !== "hole_id" && b[a.aliasCol] !== void 0 && ($[a.aliasCol] = b[a.aliasCol]), d.push($);
479
+ for (let D = 0; D < p.length - 1; D += 1) {
480
+ const R = p[D], G = p[D + 1], h = R.from, A = G.from - h;
481
+ if (A <= 0) continue;
482
+ const z = Math.max(1, Math.ceil(A / s)), E = A / z;
483
+ for (let _ = 0; _ < z; _ += 1) {
484
+ C += E;
485
+ const y = (C - h) / A, I = R.azimuth + y * (G.azimuth - R.azimuth), F = R.dip + y * (G.dip - R.dip), T = Ut(E, R.azimuth, R.dip, G.azimuth, G.dip, i);
486
+ v += T.dx, g += T.dy, L += T.dz;
487
+ const x = {
488
488
  hole_id: f,
489
- md: A,
490
- x: b,
491
- y: h,
492
- z: E,
493
- azimuth: i === "minimum_curvature" ? D : L.azimuth,
494
- dip: i === "minimum_curvature" ? F : L.dip
489
+ md: C,
490
+ x: v,
491
+ y: g,
492
+ z: L,
493
+ azimuth: i === "minimum_curvature" ? I : T.azimuth,
494
+ dip: i === "minimum_curvature" ? F : T.dip
495
495
  };
496
- a.aliasCol !== "hole_id" && g[a.aliasCol] !== void 0 && (U[a.aliasCol] = g[a.aliasCol]), m.push(U);
496
+ a.aliasCol !== "hole_id" && b[a.aliasCol] !== void 0 && (x[a.aliasCol] = b[a.aliasCol]), d.push(x);
497
497
  }
498
498
  }
499
- }), m;
499
+ }), d;
500
500
  }
501
- function Ft(e, n, t = {}) {
501
+ function Ht(e, n, t = {}) {
502
502
  return ke(e, n, { ...t, method: "minimum_curvature" });
503
503
  }
504
- function Ln(e, n, t = {}) {
504
+ function $n(e, n, t = {}) {
505
505
  return ke(e, n, { ...t, method: "tangential" });
506
506
  }
507
- function Cn(e, n, t = {}) {
507
+ function kn(e, n, t = {}) {
508
508
  return ke(e, n, { ...t, method: "balanced_tangential" });
509
509
  }
510
- function Tn(e, n, t = {}) {
511
- return Ft(e, n, t);
510
+ function wn(e, n, t = {}) {
511
+ return Ht(e, n, t);
512
512
  }
513
- function $t(e, n) {
513
+ function Gt(e, n) {
514
514
  if (!e.length || !Number.isFinite(n)) return null;
515
- let t = null, s = 1 / 0;
516
- for (let r = 0; r < e.length; r += 1) {
517
- const i = e[r], o = te(i.md);
518
- if (!Number.isFinite(o)) continue;
519
- const a = Math.abs(o - n);
520
- a < s && (s = a, t = i);
515
+ let t = null, r = 1 / 0;
516
+ for (let o = 0; o < e.length; o += 1) {
517
+ const i = e[o], s = ne(i.md);
518
+ if (!Number.isFinite(s)) continue;
519
+ const a = Math.abs(s - n);
520
+ a < r && (r = a, t = i);
521
521
  }
522
522
  return t;
523
523
  }
524
- function Mn(e = [], n = [], t = {}) {
525
- const s = t.holeIdCol || "hole_id", r = Ce(e, s), i = Ce(n, s);
526
- if (!r.rows.length || !i.rows.length) return [...r.rows];
527
- const o = /* @__PURE__ */ new Map();
524
+ function Un(e = [], n = [], t = {}) {
525
+ const r = t.holeIdCol || "hole_id", o = Le(e, r), i = Le(n, r);
526
+ if (!o.rows.length || !i.rows.length) return [...o.rows];
527
+ const s = /* @__PURE__ */ new Map();
528
528
  return i.rows.forEach((a) => {
529
- a.hole_id && (o.has(a.hole_id) || o.set(a.hole_id, []), o.get(a.hole_id).push(a));
530
- }), o.forEach((a, l) => {
531
- o.set(l, [...a].sort((u, c) => te(u.md, 0) - te(c.md, 0)));
532
- }), r.rows.map((a) => {
533
- const l = te(a.from), u = te(a.to), c = Number.isFinite(l) && Number.isFinite(u) ? 0.5 * (l + u) : void 0;
529
+ a.hole_id && (s.has(a.hole_id) || s.set(a.hole_id, []), s.get(a.hole_id).push(a));
530
+ }), s.forEach((a, l) => {
531
+ s.set(l, [...a].sort((u, c) => ne(u.md, 0) - ne(c.md, 0)));
532
+ }), o.rows.map((a) => {
533
+ const l = ne(a.from), u = ne(a.to), c = Number.isFinite(l) && Number.isFinite(u) ? 0.5 * (l + u) : void 0;
534
534
  if (!a.hole_id || !Number.isFinite(c)) return { ...a };
535
- const m = $t(o.get(a.hole_id) || [], c);
536
- if (!m) return { ...a };
537
- const d = { ...a };
535
+ const d = Gt(s.get(a.hole_id) || [], c);
536
+ if (!d) return { ...a };
537
+ const m = { ...a };
538
538
  return ["md", "x", "y", "z", "azimuth", "dip"].forEach((f) => {
539
- m[f] !== void 0 && (Object.prototype.hasOwnProperty.call(d, f) ? d[`${f}_trace`] = m[f] : d[f] = m[f]);
540
- }), d;
539
+ d[f] !== void 0 && (Object.prototype.hasOwnProperty.call(m, f) ? m[`${f}_trace`] = d[f] : m[f] = d[f]);
540
+ }), m;
541
541
  });
542
542
  }
543
- function On(e, n = null) {
544
- return new Promise((t, s) => {
543
+ function Hn(e, n = null) {
544
+ return new Promise((t, r) => {
545
545
  J.parse(e, {
546
546
  header: !0,
547
547
  dynamicTyping: !0,
548
548
  skipEmptyLines: !0,
549
- complete: (r) => {
549
+ complete: (o) => {
550
550
  const i = /* @__PURE__ */ new Map();
551
- r.data.forEach((a, l) => {
552
- const u = ie(a, null, n), c = u[_], m = c !== void 0 ? `${c}`.trim() : "", d = u[pe] ?? u.x, f = u[ye] ?? u.y, g = u[ve] ?? u.z, y = u.order ?? l;
553
- !m || d === null || d === void 0 || f === null || f === void 0 || g === null || g === void 0 || (i.has(m) || i.set(m, []), i.get(m).push({
551
+ o.data.forEach((a, l) => {
552
+ const u = ie(a, null, n), c = u[N], d = c !== void 0 ? `${c}`.trim() : "", m = u[pe] ?? u.x, f = u[ge] ?? u.y, b = u[Ee] ?? u.z, p = u.order ?? l;
553
+ !d || m === null || m === void 0 || f === null || f === void 0 || b === null || b === void 0 || (i.has(d) || i.set(d, []), i.get(d).push({
554
554
  ...u,
555
- holeId: m,
556
- order: y,
557
- x: Number(d) ?? 0,
555
+ holeId: d,
556
+ order: p,
557
+ x: Number(m) ?? 0,
558
558
  y: Number(f) ?? 0,
559
- z: Number(g) ?? 0
559
+ z: Number(b) ?? 0
560
560
  }));
561
561
  });
562
- const o = Array.from(i.entries()).map(([a, l]) => ({
562
+ const s = Array.from(i.entries()).map(([a, l]) => ({
563
563
  id: a,
564
564
  points: l.sort((u, c) => u.order - c.order).map((u) => ({
565
565
  ...u,
@@ -568,13 +568,13 @@ function On(e, n = null) {
568
568
  z: Number(u.z) || 0
569
569
  }))
570
570
  }));
571
- t({ holes: o });
571
+ t({ holes: s });
572
572
  },
573
- error: (r) => s(k("parseDrillholesCSV", r))
573
+ error: (o) => r(U("parseDrillholesCSV", o))
574
574
  });
575
575
  });
576
576
  }
577
- function ge(e) {
577
+ function be(e) {
578
578
  return e ? Array.isArray(e) ? [...e] : [] : [];
579
579
  }
580
580
  function Z(e) {
@@ -583,311 +583,311 @@ function Z(e) {
583
583
  }
584
584
  function Ne(e = [], n = []) {
585
585
  const t = [...e];
586
- return t.sort((s, r) => {
586
+ return t.sort((r, o) => {
587
587
  for (let i = 0; i < n.length; i += 1) {
588
- const o = n[i], a = s == null ? void 0 : s[o], l = r == null ? void 0 : r[o];
588
+ const s = n[i], a = r == null ? void 0 : r[s], l = o == null ? void 0 : o[s];
589
589
  if (a !== l)
590
590
  return a == null ? 1 : l == null ? -1 : typeof a == "number" && typeof l == "number" ? a - l : `${a}`.localeCompare(`${l}`);
591
591
  }
592
592
  return 0;
593
593
  }), t;
594
594
  }
595
- function kt(e = [], n = "Intervals") {
595
+ function Bt(e = [], n = "Intervals") {
596
596
  if (!e.length) return;
597
- const t = Ne(e, [_, C, M]), s = /* @__PURE__ */ new Map();
598
- t.forEach((r) => {
599
- const i = `${(r == null ? void 0 : r[_]) ?? ""}`.trim(), o = Number(r == null ? void 0 : r[C]), a = Number(r == null ? void 0 : r[M]);
600
- if (!i || !Number.isFinite(o) || !Number.isFinite(a)) return;
601
- const l = s.get(i);
602
- if (Number.isFinite(l) && o < l)
603
- throw k(
597
+ const t = Ne(e, [N, M, O]), r = /* @__PURE__ */ new Map();
598
+ t.forEach((o) => {
599
+ const i = `${(o == null ? void 0 : o[N]) ?? ""}`.trim(), s = Number(o == null ? void 0 : o[M]), a = Number(o == null ? void 0 : o[O]);
600
+ if (!i || !Number.isFinite(s) || !Number.isFinite(a)) return;
601
+ const l = r.get(i);
602
+ if (Number.isFinite(l) && s < l)
603
+ throw U(
604
604
  "validateNoOverlappingIntervals",
605
- new Error(`${n} intervals overlap for hole '${i}': from=${o} is less than previous to=${l}`)
605
+ new Error(`${n} intervals overlap for hole '${i}': from=${s} is less than previous to=${l}`)
606
606
  );
607
- s.set(i, a);
607
+ r.set(i, a);
608
608
  });
609
609
  }
610
- function wt(e, n = {}) {
611
- return new Promise((t, s) => {
610
+ function Vt(e, n = {}) {
611
+ return new Promise((t, r) => {
612
612
  J.parse(e, {
613
613
  header: !0,
614
614
  dynamicTyping: !0,
615
615
  skipEmptyLines: !0,
616
616
  ...n,
617
- complete: (r) => t(Array.isArray(r == null ? void 0 : r.data) ? r.data : []),
618
- error: (r) => s(k("loadTable(csv)", r))
617
+ complete: (o) => t(Array.isArray(o == null ? void 0 : o.data) ? o.data : []),
618
+ error: (o) => r(U("loadTable(csv)", o))
619
619
  });
620
620
  });
621
621
  }
622
- function Ht(e = [], n = null, t = null) {
623
- return e.map((s) => ie(s, n, t));
622
+ function jt(e = [], n = null, t = null) {
623
+ return e.map((r) => ie(r, n, t));
624
624
  }
625
- async function Me(e, n = {}) {
625
+ async function Ce(e, n = {}) {
626
626
  const {
627
627
  kind: t = "csv",
628
- columnMap: s = null,
629
- sourceColumnMap: r = null,
628
+ columnMap: r = null,
629
+ sourceColumnMap: o = null,
630
630
  papaParseConfig: i = {}
631
631
  } = n;
632
- let o;
632
+ let s;
633
633
  if (Array.isArray(e))
634
- o = ge(e);
634
+ s = be(e);
635
635
  else if (t === "csv")
636
- o = await wt(e, i);
637
- else throw t === "parquet" || t === "sql" ? k("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : k("loadTable", new Error(`Unsupported kind: ${t}`));
638
- return Ht(o, s, r);
636
+ s = await Vt(e, i);
637
+ else throw t === "parquet" || t === "sql" ? U("loadTable", new Error(`Unsupported kind in JS runtime: ${t}`)) : U("loadTable", new Error(`Unsupported kind: ${t}`));
638
+ return jt(s, r, o);
639
639
  }
640
- async function Pn(e, n = {}) {
640
+ async function Gn(e, n = {}) {
641
641
  const {
642
642
  crs: t = null,
643
- sourceColumnMap: s = null,
644
- keepAll: r = !0,
643
+ sourceColumnMap: r = null,
644
+ keepAll: o = !0,
645
645
  ...i
646
- } = n, o = await Me(e, { ...i, sourceColumnMap: s });
647
- if (!o.some((d) => _ in d))
648
- throw k("loadCollars", new Error(`Collar table missing column: ${_}`));
649
- const l = o.some((d) => pe in d && ye in d), u = o.some((d) => se in d && re in d);
646
+ } = n, s = await Ce(e, { ...i, sourceColumnMap: r });
647
+ if (!s.some((m) => N in m))
648
+ throw U("loadCollars", new Error(`Collar table missing column: ${N}`));
649
+ const l = s.some((m) => pe in m && ge in m), u = s.some((m) => re in m && oe in m);
650
650
  if (!l && !u)
651
- throw k("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
- const c = o.map((d) => {
653
- const f = { ...d };
654
- if (_ in f) {
655
- const g = f[_];
656
- f[_] = g == null ? "" : `${g}`.trim();
651
+ throw U("loadCollars", new Error("Collar table missing coordinate columns (need easting/northing or latitude/longitude)"));
652
+ const c = s.map((m) => {
653
+ const f = { ...m };
654
+ if (N in f) {
655
+ const b = f[N];
656
+ f[N] = b == null ? "" : `${b}`.trim();
657
657
  }
658
- return se in f && (f[se] = Z(f[se])), re in f && (f[re] = Z(f[re])), ve in f && (f[ve] = Z(f[ve])), pe in f && (f[pe] = Z(f[pe])), ye in f && (f[ye] = Z(f[ye])), !("datasource_hole_id" in f) && _ in f && (f.datasource_hole_id = f[_]), f;
658
+ return re in f && (f[re] = Z(f[re])), oe in f && (f[oe] = Z(f[oe])), Ee in f && (f[Ee] = Z(f[Ee])), pe in f && (f[pe] = Z(f[pe])), ge in f && (f[ge] = Z(f[ge])), !("datasource_hole_id" in f) && N in f && (f.datasource_hole_id = f[N]), f;
659
659
  });
660
- if (!c.every((d) => !(!d[_] || u && (!Number.isFinite(d[se]) || !Number.isFinite(d[re])) || l && !u && (!Number.isFinite(d[pe]) || !Number.isFinite(d[ye])))))
661
- throw k("loadCollars", new Error("Collar table has missing required values"));
660
+ if (!c.every((m) => !(!m[N] || u && (!Number.isFinite(m[re]) || !Number.isFinite(m[oe])) || l && !u && (!Number.isFinite(m[pe]) || !Number.isFinite(m[ge])))))
661
+ throw U("loadCollars", new Error("Collar table has missing required values"));
662
662
  return c;
663
663
  }
664
- async function Dn(e, n = {}) {
664
+ async function Bn(e, n = {}) {
665
665
  const {
666
666
  sourceColumnMap: t = null,
667
- keepAll: s = !0,
668
- ...r
669
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, G, j, Y];
670
- for (const u of o)
671
- if (!i.some((m) => u in m))
672
- throw k("loadSurveys", new Error(`Survey table missing column: ${u}`));
667
+ keepAll: r = !0,
668
+ ...o
669
+ } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, V, Y, W];
670
+ for (const u of s)
671
+ if (!i.some((d) => u in d))
672
+ throw U("loadSurveys", new Error(`Survey table missing column: ${u}`));
673
673
  const a = i.map((u) => {
674
674
  const c = { ...u };
675
- if (_ in c) {
676
- const m = c[_];
677
- c[_] = m == null ? "" : `${m}`.trim();
675
+ if (N in c) {
676
+ const d = c[N];
677
+ c[N] = d == null ? "" : `${d}`.trim();
678
678
  }
679
- return G in c && (c[G] = Z(c[G])), M in c && (c[M] = Z(c[M])), j in c && (c[j] = Z(c[j])), Y in c && (c[Y] = Z(c[Y])), c;
679
+ return V in c && (c[V] = Z(c[V])), O in c && (c[O] = Z(c[O])), Y in c && (c[Y] = Z(c[Y])), W in c && (c[W] = Z(c[W])), c;
680
680
  });
681
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[G]) || !Number.isFinite(u[j]) || !Number.isFinite(u[Y]))))
682
- throw k("loadSurveys", new Error("Survey table has missing required values"));
683
- return Ne(a, [_, G]);
681
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[V]) || !Number.isFinite(u[Y]) || !Number.isFinite(u[W]))))
682
+ throw U("loadSurveys", new Error("Survey table has missing required values"));
683
+ return Ne(a, [N, V]);
684
684
  }
685
- async function xn(e, n = {}) {
685
+ async function Vn(e, n = {}) {
686
686
  const {
687
687
  sourceColumnMap: t = null,
688
- keepAll: s = !0,
689
- ...r
690
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
691
- for (const u of o)
692
- if (!i.some((m) => u in m))
693
- throw k("loadAssays", new Error(`Assay table missing column: ${u}`));
688
+ keepAll: r = !0,
689
+ ...o
690
+ } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, M, O];
691
+ for (const u of s)
692
+ if (!i.some((d) => u in d))
693
+ throw U("loadAssays", new Error(`Assay table missing column: ${u}`));
694
694
  const a = i.map((u) => {
695
695
  const c = { ...u };
696
- if (_ in c) {
697
- const m = c[_];
698
- c[_] = m == null ? "" : `${m}`.trim();
696
+ if (N in c) {
697
+ const d = c[N];
698
+ c[N] = d == null ? "" : `${d}`.trim();
699
699
  }
700
- return C in c && (c[C] = Z(c[C])), M in c && (c[M] = Z(c[M])), C in c && M in c && Number.isFinite(c[C]) && Number.isFinite(c[M]) && (c[Ee] = 0.5 * (c[C] + c[M])), c;
700
+ return M in c && (c[M] = Z(c[M])), O in c && (c[O] = Z(c[O])), M in c && O in c && Number.isFinite(c[M]) && Number.isFinite(c[O]) && (c[ve] = 0.5 * (c[M] + c[O])), c;
701
701
  });
702
- if (!a.every((u) => !(!u[_] || !Number.isFinite(u[C]) || !Number.isFinite(u[M]) || !(u[M] > u[C]))))
703
- throw k("loadAssays", new Error("Assay table has missing required values"));
704
- return Ne(a, [_, C, M]);
702
+ if (!a.every((u) => !(!u[N] || !Number.isFinite(u[M]) || !Number.isFinite(u[O]) || !(u[O] > u[M]))))
703
+ throw U("loadAssays", new Error("Assay table has missing required values"));
704
+ return Ne(a, [N, M, O]);
705
705
  }
706
- async function Rn(e, n = {}) {
706
+ async function jn(e, n = {}) {
707
707
  const {
708
708
  sourceColumnMap: t = null,
709
- keepAll: s = !0,
710
- ...r
711
- } = n, i = await Me(e, { ...r, sourceColumnMap: t }), o = [_, C, M];
712
- for (const c of o)
713
- if (!i.some((d) => c in d))
714
- throw k("loadGeology", new Error(`Geology table missing column: ${c}`));
709
+ keepAll: r = !0,
710
+ ...o
711
+ } = n, i = await Ce(e, { ...o, sourceColumnMap: t }), s = [N, M, O];
712
+ for (const c of s)
713
+ if (!i.some((m) => c in m))
714
+ throw U("loadGeology", new Error(`Geology table missing column: ${c}`));
715
715
  const a = i.map((c) => {
716
- const m = { ...c };
717
- if (_ in m) {
718
- const g = m[_];
719
- m[_] = g == null ? "" : `${g}`.trim();
716
+ const d = { ...c };
717
+ if (N in d) {
718
+ const b = d[N];
719
+ d[N] = b == null ? "" : `${b}`.trim();
720
720
  }
721
- C in m && (m[C] = Z(m[C])), M in m && (m[M] = Z(m[M])), C in m && M in m && Number.isFinite(m[C]) && Number.isFinite(m[M]) && (m[M] === m[C] && (m[C] = Math.round(m[C] * 1e3) / 1e3, m[M] = m[C] + 1e-3), m[Ee] = 0.5 * (m[C] + m[M]));
722
- const d = m[le] !== void 0 && m[le] !== null && `${m[le]}`.trim() !== "", f = m[ce] !== void 0 && m[ce] !== null && `${m[ce]}`.trim() !== "";
723
- return !d && f && (m[le] = m[ce]), d && !f && (m[ce] = m[le]), m;
721
+ M in d && (d[M] = Z(d[M])), O in d && (d[O] = Z(d[O])), M in d && O in d && Number.isFinite(d[M]) && Number.isFinite(d[O]) && (d[O] === d[M] && (d[M] = Math.round(d[M] * 1e3) / 1e3, d[O] = d[M] + 1e-3), d[ve] = 0.5 * (d[M] + d[O]));
722
+ const m = d[le] !== void 0 && d[le] !== null && `${d[le]}`.trim() !== "", f = d[ce] !== void 0 && d[ce] !== null && `${d[ce]}`.trim() !== "";
723
+ return !m && f && (d[le] = d[ce]), m && !f && (d[ce] = d[le]), d;
724
724
  });
725
- if (!a.every((c) => !(!c[_] || !Number.isFinite(c[C]) || !Number.isFinite(c[M]) || !(c[M] > c[C]))))
726
- throw k("loadGeology", new Error("Geology table has missing or invalid interval values"));
725
+ if (!a.every((c) => !(!c[N] || !Number.isFinite(c[M]) || !Number.isFinite(c[O]) || !(c[O] > c[M]))))
726
+ throw U("loadGeology", new Error("Geology table has missing or invalid interval values"));
727
727
  if (!a.some((c) => {
728
- const m = c[le], d = c[ce];
729
- return m != null && `${m}`.trim() !== "" || d != null && `${d}`.trim() !== "";
728
+ const d = c[le], m = c[ce];
729
+ return d != null && `${d}`.trim() !== "" || m != null && `${m}`.trim() !== "";
730
730
  }))
731
- throw k("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
- if (kt(a, "Geology"), !s) {
733
- const c = new Set(Object.keys(_t));
731
+ throw U("loadGeology", new Error(`Geology table missing categorical columns: ${le} or ${ce}`));
732
+ if (Bt(a, "Geology"), !r) {
733
+ const c = new Set(Object.keys(Et));
734
734
  return Ne(
735
- a.map((m) => Object.fromEntries(Object.entries(m).filter(([d]) => c.has(d)))),
736
- [_, C, M]
735
+ a.map((d) => Object.fromEntries(Object.entries(d).filter(([m]) => c.has(m)))),
736
+ [N, M, O]
737
737
  );
738
738
  }
739
- return Ne(a, [_, C, M]);
739
+ return Ne(a, [N, M, O]);
740
740
  }
741
- function zn(e = [], n = [], t = {}) {
742
- const s = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [_];
741
+ function Yn(e = [], n = [], t = {}) {
742
+ const r = Array.isArray(t.onCols) && t.onCols.length ? t.onCols : [N];
743
743
  if (!n.length) return [...e];
744
- const r = (o) => s.map((a) => `${(o == null ? void 0 : o[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
- return n.forEach((o) => {
746
- i.set(r(o), o);
747
- }), e.map((o) => {
748
- const a = i.get(r(o));
749
- if (!a) return { ...o };
750
- const l = { ...o };
744
+ const o = (s) => r.map((a) => `${(s == null ? void 0 : s[a]) ?? ""}`).join("|"), i = /* @__PURE__ */ new Map();
745
+ return n.forEach((s) => {
746
+ i.set(o(s), s);
747
+ }), e.map((s) => {
748
+ const a = i.get(o(s));
749
+ if (!a) return { ...s };
750
+ const l = { ...s };
751
751
  return Object.entries(a).forEach(([u, c]) => {
752
- s.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
752
+ r.includes(u) || (Object.prototype.hasOwnProperty.call(l, u) ? l[`${u}_trace`] = c : l[u] = c);
753
753
  }), l;
754
754
  });
755
755
  }
756
- function Fn(e = [], n = null) {
757
- return n == null ? [...e] : e.length ? e.some((s) => de in s) ? e.filter((s) => (s == null ? void 0 : s[de]) === n) : [...e] : [];
756
+ function Wn(e = [], n = null) {
757
+ return n == null ? [...e] : e.length ? e.some((r) => de in r) ? e.filter((r) => (r == null ? void 0 : r[de]) === n) : [...e] : [];
758
758
  }
759
- function $n(e = [], n = []) {
759
+ function qn(e = [], n = []) {
760
760
  return e.map((t) => {
761
- const s = { ...t };
762
- return n.forEach((r) => {
763
- if (!(r in s)) return;
764
- const i = Z(s[r]);
765
- s[r] = i;
766
- }), s;
761
+ const r = { ...t };
762
+ return n.forEach((o) => {
763
+ if (!(o in r)) return;
764
+ const i = Z(r[o]);
765
+ r[o] = i;
766
+ }), r;
767
767
  });
768
768
  }
769
- function kn({
769
+ function Xn({
770
770
  collars: e = [],
771
771
  surveys: n = [],
772
772
  assays: t = [],
773
- geology: s = [],
774
- structures: r = [],
773
+ geology: r = [],
774
+ structures: o = [],
775
775
  metadata: i = {}
776
776
  } = {}) {
777
777
  return {
778
- collars: ge(e),
779
- surveys: ge(n),
780
- assays: ge(t),
781
- geology: ge(s),
782
- structures: ge(r),
778
+ collars: be(e),
779
+ surveys: be(n),
780
+ assays: be(t),
781
+ geology: be(r),
782
+ structures: be(o),
783
783
  metadata: i || {}
784
784
  };
785
785
  }
786
786
  const we = (e, n = null) => ie(e, null, n);
787
- function Ut(e) {
787
+ function Yt(e) {
788
788
  if (!e.length) return null;
789
- const n = e[0], t = C in n && M in n, s = G in n && !t;
790
- return t ? "interval" : s ? "point" : null;
789
+ const n = e[0], t = M in n && O in n, r = V in n && !t;
790
+ return t ? "interval" : r ? "point" : null;
791
791
  }
792
- function oe(e) {
792
+ function se(e) {
793
793
  const n = Number(e);
794
794
  return Number.isFinite(n) ? n : null;
795
795
  }
796
- function ot(e) {
797
- const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
796
+ function at(e) {
797
+ const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
798
798
  if (!n) return null;
799
- const t = oe(e[G]);
799
+ const t = se(e[V]);
800
800
  return t === null ? null : {
801
- [_]: n,
802
- [G]: t,
803
- [Y]: oe(e[Y]),
804
- [j]: oe(e[j]),
801
+ [N]: n,
802
+ [V]: t,
803
+ [W]: se(e[W]),
804
+ [Y]: se(e[Y]),
805
805
  comments: e.comments != null ? `${e.comments}` : null,
806
806
  ...e
807
807
  };
808
808
  }
809
- function it(e) {
810
- const n = e[_] !== void 0 ? `${e[_]}`.trim() : "";
809
+ function lt(e) {
810
+ const n = e[N] !== void 0 ? `${e[N]}`.trim() : "";
811
811
  if (!n) return null;
812
- const t = oe(e[C]), s = oe(e[M]);
813
- if (t === null || s === null || s <= t) return null;
814
- const r = 0.5 * (t + s);
812
+ const t = se(e[M]), r = se(e[O]);
813
+ if (t === null || r === null || r <= t) return null;
814
+ const o = 0.5 * (t + r);
815
815
  return {
816
- [_]: n,
817
- [C]: t,
818
- [M]: s,
819
- mid: r,
820
- [Y]: oe(e[Y]),
821
- [j]: oe(e[j]),
816
+ [N]: n,
817
+ [M]: t,
818
+ [O]: r,
819
+ mid: o,
820
+ [W]: se(e[W]),
821
+ [Y]: se(e[Y]),
822
822
  classification: e.classification != null ? `${e.classification}` : null,
823
823
  comments: e.comments != null ? `${e.comments}` : null,
824
824
  ...e
825
825
  };
826
826
  }
827
- function wn(e) {
827
+ function Kn(e) {
828
828
  const n = [], t = [];
829
- for (const s of e) {
830
- const r = [], i = oe(s[Y]), o = oe(s[j]);
831
- i !== null && (i < 0 || i > 90) && r.push(`dip ${i} out of range [0, 90]`), o !== null && (o < 0 || o >= 360) && r.push(`azimuth ${o} out of range [0, 360)`), r.length ? t.push({ row: s, message: r.join("; ") }) : n.push(s);
829
+ for (const r of e) {
830
+ const o = [], i = se(r[W]), s = se(r[Y]);
831
+ i !== null && (i < 0 || i > 90) && o.push(`dip ${i} out of range [0, 90]`), s !== null && (s < 0 || s >= 360) && o.push(`azimuth ${s} out of range [0, 360)`), o.length ? t.push({ row: r, message: o.join("; ") }) : n.push(r);
832
832
  }
833
833
  return { valid: n, errors: t };
834
834
  }
835
- function Hn(e, n = null) {
836
- return new Promise((t, s) => {
837
- const r = {
835
+ function Zn(e, n = null) {
836
+ return new Promise((t, r) => {
837
+ const o = {
838
838
  header: !0,
839
839
  dynamicTyping: !0,
840
840
  skipEmptyLines: !0,
841
841
  complete: (i) => {
842
- const o = [];
842
+ const s = [];
843
843
  for (const a of i.data) {
844
- const l = we(a, n), u = ot(l);
845
- u && o.push(u);
844
+ const l = we(a, n), u = at(l);
845
+ u && s.push(u);
846
846
  }
847
- t(o);
847
+ t(s);
848
848
  },
849
- error: (i) => s(k("parseStructuralPointsCSV", i))
849
+ error: (i) => r(U("parseStructuralPointsCSV", i))
850
850
  };
851
851
  typeof e == "string" && !e.startsWith("data:") && e.includes(`
852
- `) ? J.parse(e, r) : J.parse(e, r);
852
+ `) ? J.parse(e, o) : J.parse(e, o);
853
853
  });
854
854
  }
855
- function Un(e, n = null) {
856
- return new Promise((t, s) => {
855
+ function Jn(e, n = null) {
856
+ return new Promise((t, r) => {
857
857
  J.parse(e, {
858
858
  header: !0,
859
859
  dynamicTyping: !0,
860
860
  skipEmptyLines: !0,
861
- complete: (r) => {
861
+ complete: (o) => {
862
862
  const i = [];
863
- for (const o of r.data) {
864
- const a = we(o, n), l = it(a);
863
+ for (const s of o.data) {
864
+ const a = we(s, n), l = lt(a);
865
865
  l && i.push(l);
866
866
  }
867
867
  t(i);
868
868
  },
869
- error: (r) => s(k("parseStructuralIntervalsCSV", r))
869
+ error: (o) => r(U("parseStructuralIntervalsCSV", o))
870
870
  });
871
871
  });
872
872
  }
873
- function Bt(e, n = _) {
873
+ function Wt(e, n = N) {
874
874
  const t = /* @__PURE__ */ new Map();
875
- for (const s of e) {
876
- const r = s[n] != null ? String(s[n]).trim() : "";
877
- r && (t.has(r) || t.set(r, { holeId: r, points: [] }), t.get(r).points.push(s));
875
+ for (const r of e) {
876
+ const o = r[n] != null ? String(r[n]).trim() : "";
877
+ o && (t.has(o) || t.set(o, { holeId: o, points: [] }), t.get(o).points.push(r));
878
878
  }
879
879
  return Array.from(t.values());
880
880
  }
881
- function Gt(e, n = null) {
882
- return new Promise((t, s) => {
881
+ function qt(e, n = null) {
882
+ return new Promise((t, r) => {
883
883
  J.parse(e, {
884
884
  header: !0,
885
885
  dynamicTyping: !0,
886
886
  skipEmptyLines: !0,
887
- complete: (r) => {
888
- const i = r.data.map((l) => we(l, n)), o = Ut(i);
889
- if (!o) {
890
- s(k(
887
+ complete: (o) => {
888
+ const i = o.data.map((l) => we(l, n)), s = Yt(i);
889
+ if (!s) {
890
+ r(U(
891
891
  "parseStructuralCSV",
892
892
  new Error("Structural CSV requires either 'depth' (point) or 'from'/'to' (interval) columns")
893
893
  ));
@@ -895,283 +895,283 @@ function Gt(e, n = null) {
895
895
  }
896
896
  const a = [];
897
897
  for (const l of i) {
898
- const u = o === "interval" ? it(l) : ot(l);
898
+ const u = s === "interval" ? lt(l) : at(l);
899
899
  u && a.push(u);
900
900
  }
901
- t({ schema: o, rows: a });
901
+ t({ schema: s, rows: a });
902
902
  },
903
- error: (r) => s(k("parseStructuralCSV", r))
903
+ error: (o) => r(U("parseStructuralCSV", o))
904
904
  });
905
905
  });
906
906
  }
907
- function Vt(e) {
907
+ function Xt(e) {
908
908
  return new Promise((n) => {
909
909
  J.parse(e, {
910
910
  header: !0,
911
911
  dynamicTyping: !0,
912
912
  skipEmptyLines: !0,
913
913
  complete: (t) => {
914
- const s = /* @__PURE__ */ new Map();
914
+ const r = /* @__PURE__ */ new Map();
915
915
  for (const i of t.data) {
916
- const o = ie(i), a = o[_] != null ? `${o[_]}`.trim() : "";
916
+ const s = ie(i), a = s[N] != null ? `${s[N]}`.trim() : "";
917
917
  if (!a) continue;
918
- const l = Number(o[C]), u = Number(o[M]);
918
+ const l = Number(s[M]), u = Number(s[O]);
919
919
  if (!Number.isFinite(l) || !Number.isFinite(u) || u <= l) continue;
920
- const c = (l + u) / 2, { [Y]: m, [j]: d, ...f } = o, g = {
920
+ const c = (l + u) / 2, { [W]: d, [Y]: m, ...f } = s, b = {
921
921
  ...f,
922
- [_]: a,
923
- [C]: l,
924
- [M]: u,
925
- [Ee]: c,
926
- [G]: c,
922
+ [N]: a,
923
+ [M]: l,
924
+ [O]: u,
925
+ [ve]: c,
926
+ [V]: c,
927
927
  // unified depth field for y-axis rendering
928
928
  _source: "assay"
929
929
  };
930
- s.has(a) || s.set(a, []), s.get(a).push(g);
930
+ r.has(a) || r.set(a, []), r.get(a).push(b);
931
931
  }
932
- const r = Array.from(s.entries()).map(([i, o]) => ({
932
+ const o = Array.from(r.entries()).map(([i, s]) => ({
933
933
  holeId: i,
934
- points: o.sort((a, l) => a[C] - l[C])
934
+ points: s.sort((a, l) => a[M] - l[M])
935
935
  }));
936
- n(r);
936
+ n(o);
937
937
  }
938
938
  });
939
939
  });
940
940
  }
941
- function jt(e) {
941
+ function Kt(e) {
942
942
  return new Promise((n) => {
943
943
  J.parse(e, {
944
944
  header: !0,
945
945
  dynamicTyping: !0,
946
946
  skipEmptyLines: !0,
947
947
  complete: (t) => {
948
- const s = /* @__PURE__ */ new Map();
949
- for (const r of t.data) {
950
- const i = ie(r), o = (i[_] ?? "").toString().trim();
951
- if (!o) continue;
952
- const a = Number(i[C]), l = Number(i[M]);
948
+ const r = /* @__PURE__ */ new Map();
949
+ for (const o of t.data) {
950
+ const i = ie(o), s = (i[N] ?? "").toString().trim();
951
+ if (!s) continue;
952
+ const a = Number(i[M]), l = Number(i[O]);
953
953
  if (!Number.isFinite(a) || !Number.isFinite(l) || l <= a) continue;
954
- const u = (a + l) / 2, { [Y]: c, [j]: m, ...d } = i, f = {
955
- ...d,
956
- [_]: o,
957
- [C]: a,
958
- [M]: l,
959
- [Ee]: u,
960
- [G]: u,
954
+ const u = (a + l) / 2, { [W]: c, [Y]: d, ...m } = i, f = {
955
+ ...m,
956
+ [N]: s,
957
+ [M]: a,
958
+ [O]: l,
959
+ [ve]: u,
960
+ [V]: u,
961
961
  _source: "geology"
962
962
  };
963
- s.has(o) || s.set(o, []), s.get(o).push(f);
963
+ r.has(s) || r.set(s, []), r.get(s).push(f);
964
964
  }
965
965
  n({
966
- holes: Array.from(s.entries()).map(([r, i]) => ({
967
- holeId: r,
968
- points: i.sort((o, a) => o[C] - a[C])
966
+ holes: Array.from(r.entries()).map(([o, i]) => ({
967
+ holeId: o,
968
+ points: i.sort((s, a) => s[M] - a[M])
969
969
  }))
970
970
  });
971
971
  }
972
972
  });
973
973
  });
974
974
  }
975
- async function Bn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
- const [s, r, i] = await Promise.all([
977
- e ? Vt(e) : Promise.resolve([]),
978
- n ? Gt(n).then(
979
- ({ rows: a }) => Bt(a.map((l) => ({ ...l, _source: "structural" })))
975
+ async function Qn({ assayCsv: e, structuralCsv: n, geologyCsv: t } = {}) {
976
+ const [r, o, i] = await Promise.all([
977
+ e ? Xt(e) : Promise.resolve([]),
978
+ n ? qt(n).then(
979
+ ({ rows: a }) => Wt(a.map((l) => ({ ...l, _source: "structural" })))
980
980
  ) : Promise.resolve([]),
981
- t ? jt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
- ]), o = new Map(s.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
- for (const a of [...r, ...i]) {
981
+ t ? Kt(t).then(({ holes: a }) => a) : Promise.resolve([])
982
+ ]), s = new Map(r.map((a) => [a.holeId, { ...a, points: [...a.points] }]));
983
+ for (const a of [...o, ...i]) {
984
984
  const l = a.holeId;
985
985
  if (l)
986
- if (o.has(l)) {
987
- const u = o.get(l);
988
- o.set(l, { ...u, points: [...u.points, ...a.points || []] });
986
+ if (s.has(l)) {
987
+ const u = s.get(l);
988
+ s.set(l, { ...u, points: [...u.points, ...a.points || []] });
989
989
  } else
990
- o.set(l, a);
990
+ s.set(l, a);
991
991
  }
992
- return { holes: Array.from(o.values()) };
992
+ return { holes: Array.from(s.values()) };
993
993
  }
994
- function Gn(e, n, t, s, r = {}) {
995
- const i = r.fromCol || "from", o = r.toCol || "to", a = r.holeCol || "hole_id";
994
+ function er(e, n, t, r, o = {}) {
995
+ const i = o.fromCol || "from", s = o.toCol || "to", a = o.holeCol || "hole_id";
996
996
  if (!e || !e.length) return [];
997
997
  const l = {};
998
998
  for (const c of e) {
999
- const m = c[a];
1000
- m != null && (l[m] || (l[m] = []), l[m].push(c));
999
+ const d = c[a];
1000
+ d != null && (l[d] || (l[d] = []), l[d].push(c));
1001
1001
  }
1002
1002
  const u = [];
1003
- for (const [c, m] of Object.entries(l)) {
1004
- const f = [...m].sort((h, E) => Number(h[i]) - Number(E[i])).filter((h) => {
1005
- const E = Number(h[n]);
1006
- return Number.isFinite(E) && E >= t;
1003
+ for (const [c, d] of Object.entries(l)) {
1004
+ const f = [...d].sort((g, L) => Number(g[i]) - Number(L[i])).filter((g) => {
1005
+ const L = Number(g[n]);
1006
+ return Number.isFinite(L) && L >= t;
1007
1007
  });
1008
1008
  if (!f.length) continue;
1009
- const g = [];
1010
- let y = [], b = null;
1011
- for (const h of f) {
1012
- const E = Number(h[i]), A = Number(h[o]);
1013
- b === null || Math.abs(E - b) > 1e-6 ? (y.length && g.push(y), y = [h]) : y.push(h), b = A;
1009
+ const b = [];
1010
+ let p = [], v = null;
1011
+ for (const g of f) {
1012
+ const L = Number(g[i]), C = Number(g[s]);
1013
+ v === null || Math.abs(L - v) > 1e-6 ? (p.length && b.push(p), p = [g]) : p.push(g), v = C;
1014
1014
  }
1015
- y.length && g.push(y);
1016
- for (const h of g) {
1017
- const E = Number(h[0][i]), A = Number(h[h.length - 1][o]), x = A - E;
1018
- if (x < s) continue;
1019
- let H = 0, O = 0;
1020
- for (const p of h) {
1021
- const T = Number(p[n]), I = Number(p[o]) - Number(p[i]);
1022
- H += T * I, O += I;
1015
+ p.length && b.push(p);
1016
+ for (const g of b) {
1017
+ const L = Number(g[0][i]), C = Number(g[g.length - 1][s]), j = C - L;
1018
+ if (j < r) continue;
1019
+ let H = 0, $ = 0;
1020
+ for (const h of g) {
1021
+ const P = Number(h[n]), A = Number(h[s]) - Number(h[i]);
1022
+ H += P * A, $ += A;
1023
1023
  }
1024
- const P = H / O, R = h.length, V = `${x.toFixed(1)} m @ ${P.toFixed(2)} ${n}`;
1024
+ const D = H / $, R = g.length, G = `${j.toFixed(1)} m @ ${D.toFixed(2)} ${n}`;
1025
1025
  u.push({
1026
1026
  [a]: c,
1027
1027
  assay_field: n,
1028
- [i]: E,
1029
- [o]: A,
1030
- length: x,
1031
- avg_grade: P,
1028
+ [i]: L,
1029
+ [s]: C,
1030
+ length: j,
1031
+ avg_grade: D,
1032
1032
  n_samples: R,
1033
- label: V
1033
+ label: G
1034
1034
  });
1035
1035
  }
1036
1036
  }
1037
1037
  return u;
1038
1038
  }
1039
- const at = ["depth", "md", "measured_depth", "dept", "z"];
1040
- function Yt(e) {
1041
- if (e[G] !== void 0) {
1042
- const s = Number(e[G]);
1043
- if (Number.isFinite(s)) return s;
1039
+ const ct = ["depth", "md", "measured_depth", "dept", "z"];
1040
+ function Zt(e) {
1041
+ if (e[V] !== void 0) {
1042
+ const r = Number(e[V]);
1043
+ if (Number.isFinite(r)) return r;
1044
1044
  }
1045
- for (const s of at)
1046
- if (e[s] !== void 0) {
1047
- const r = Number(e[s]);
1048
- if (Number.isFinite(r)) return r;
1045
+ for (const r of ct)
1046
+ if (e[r] !== void 0) {
1047
+ const o = Number(e[r]);
1048
+ if (Number.isFinite(o)) return o;
1049
1049
  }
1050
- const n = Number(e[C]), t = Number(e[M]);
1050
+ const n = Number(e[M]), t = Number(e[O]);
1051
1051
  return Number.isFinite(n) && Number.isFinite(t) && t >= n ? (n + t) / 2 : null;
1052
1052
  }
1053
- function Wt(e) {
1053
+ function Jt(e) {
1054
1054
  if (e.length === 0) return [];
1055
- const n = /* @__PURE__ */ new Set([_, G, C, M, Ee, ...at]);
1056
- return Object.keys(e[0]).filter((s) => !n.has(s)).filter((s) => {
1057
- let r = 0;
1055
+ const n = /* @__PURE__ */ new Set([N, V, M, O, ve, ...ct]);
1056
+ return Object.keys(e[0]).filter((r) => !n.has(r)).filter((r) => {
1057
+ let o = 0;
1058
1058
  for (const i of e) {
1059
- const o = Number(i[s]);
1060
- Number.isFinite(o) && r++;
1059
+ const s = Number(i[r]);
1060
+ Number.isFinite(s) && o++;
1061
1061
  }
1062
- return r / e.length > 0.5;
1062
+ return o / e.length > 0.5;
1063
1063
  });
1064
1064
  }
1065
- function Vn(e, n = null) {
1066
- const s = J.parse(e, {
1065
+ function tr(e, n = null) {
1066
+ const r = J.parse(e, {
1067
1067
  header: !0,
1068
1068
  skipEmptyLines: !0,
1069
1069
  dynamicTyping: !1
1070
1070
  }).data || [];
1071
- if (s.length === 0) return [];
1072
- const r = s.map((l) => ie(l, null, n)), i = Wt(r), o = /* @__PURE__ */ new Map();
1073
- for (const l of r) {
1074
- const u = l[_] != null ? `${l[_]}`.trim() : "";
1071
+ if (r.length === 0) return [];
1072
+ const o = r.map((l) => ie(l, null, n)), i = Jt(o), s = /* @__PURE__ */ new Map();
1073
+ for (const l of o) {
1074
+ const u = l[N] != null ? `${l[N]}`.trim() : "";
1075
1075
  if (!u) continue;
1076
- const c = Yt(l);
1077
- c === null || c < 0 || (o.has(u) || o.set(u, []), o.get(u).push({ depth: c, row: l }));
1076
+ const c = Zt(l);
1077
+ c === null || c < 0 || (s.has(u) || s.set(u, []), s.get(u).push({ depth: c, row: l }));
1078
1078
  }
1079
1079
  const a = [];
1080
- for (const [l, u] of o) {
1081
- u.sort((m, d) => m.depth - d.depth);
1080
+ for (const [l, u] of s) {
1081
+ u.sort((d, m) => d.depth - m.depth);
1082
1082
  const c = {};
1083
- for (const m of i) {
1084
- const d = [], f = [];
1085
- for (const { depth: g, row: y } of u) {
1086
- const b = Number(y[m]);
1087
- Number.isFinite(b) && b !== Qe && (d.push(g), f.push(b));
1083
+ for (const d of i) {
1084
+ const m = [], f = [];
1085
+ for (const { depth: b, row: p } of u) {
1086
+ const v = Number(p[d]);
1087
+ Number.isFinite(v) && v !== et && (m.push(b), f.push(v));
1088
1088
  }
1089
- d.length >= 2 && (c[m] = { depths: d, values: f });
1089
+ m.length >= 2 && (c[d] = { depths: m, values: f });
1090
1090
  }
1091
1091
  Object.keys(c).length > 0 && a.push({ holeId: l, channels: c });
1092
1092
  }
1093
1093
  return a;
1094
1094
  }
1095
- function jn(e, n = null, t = {}) {
1096
- const s = [];
1097
- for (const { holeId: r, channels: i } of e) {
1098
- const o = n && i[n] ? n : Object.keys(i)[0];
1099
- if (!o) continue;
1100
- const { depths: a, values: l } = i[o];
1101
- s.push({ holeId: r, depths: a, values: l, options: t });
1095
+ function nr(e, n = null, t = {}) {
1096
+ const r = [];
1097
+ for (const { holeId: o, channels: i } of e) {
1098
+ const s = n && i[n] ? n : Object.keys(i)[0];
1099
+ if (!s) continue;
1100
+ const { depths: a, values: l } = i[s];
1101
+ r.push({ holeId: o, depths: a, values: l, options: t });
1102
1102
  }
1103
- return s;
1103
+ return r;
1104
1104
  }
1105
- function lt(e) {
1105
+ function ut(e) {
1106
1106
  const n = e.indexOf(".");
1107
1107
  if (n < 0) return null;
1108
- const t = e.slice(0, n).trim().toUpperCase(), s = e.slice(n + 1), r = s.match(/^(\S*)\s*(.*)/s), i = r ? r[1] : "", o = r ? r[2] : s, a = o.lastIndexOf(":"), l = a >= 0 ? o.slice(0, a).trim() : o.trim(), u = a >= 0 ? o.slice(a + 1).trim() : "";
1108
+ const t = e.slice(0, n).trim().toUpperCase(), r = e.slice(n + 1), o = r.match(/^(\S*)\s*(.*)/s), i = o ? o[1] : "", s = o ? o[2] : r, a = s.lastIndexOf(":"), l = a >= 0 ? s.slice(0, a).trim() : s.trim(), u = a >= 0 ? s.slice(a + 1).trim() : "";
1109
1109
  return { mnem: t, unit: i, value: l, description: u };
1110
1110
  }
1111
- function qt(e) {
1111
+ function Qt(e) {
1112
1112
  const n = [];
1113
1113
  let t = null;
1114
- for (const s of e.split(/\r?\n/)) {
1115
- const r = s.trimEnd();
1116
- r.startsWith("~") ? (t = { type: r.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(r);
1114
+ for (const r of e.split(/\r?\n/)) {
1115
+ const o = r.trimEnd();
1116
+ o.startsWith("~") ? (t = { type: o.slice(1, 2).toUpperCase(), lines: [] }, n.push(t)) : t && t.lines.push(o);
1117
1117
  }
1118
1118
  return n;
1119
1119
  }
1120
- function We(e = []) {
1120
+ function Ye(e = []) {
1121
1121
  const n = {};
1122
1122
  for (const t of e) {
1123
- const s = t.trimStart();
1124
- if (!s || s.startsWith("#")) continue;
1125
- const r = lt(t);
1126
- r && (n[r.mnem] = r);
1123
+ const r = t.trimStart();
1124
+ if (!r || r.startsWith("#")) continue;
1125
+ const o = ut(t);
1126
+ o && (n[o.mnem] = o);
1127
1127
  }
1128
1128
  return n;
1129
1129
  }
1130
- function Yn(e, n = {}) {
1131
- var h, E, A, x, H, O, P, R, V;
1132
- const t = qt(e), s = t.find((p) => p.type === "V"), r = t.find((p) => p.type === "W"), i = t.find((p) => p.type === "C"), o = t.find((p) => p.type === "A");
1133
- if (!o) return [];
1134
- const a = We(s == null ? void 0 : s.lines), l = We(r == null ? void 0 : r.lines), u = [];
1135
- for (const p of (i == null ? void 0 : i.lines) ?? []) {
1136
- const T = p.trimStart();
1137
- if (!T || T.startsWith("#")) continue;
1138
- const I = lt(p);
1139
- I && u.push(I);
1130
+ function rr(e, n = {}) {
1131
+ var g, L, C, j, H, $, D, R, G;
1132
+ const t = Qt(e), r = t.find((h) => h.type === "V"), o = t.find((h) => h.type === "W"), i = t.find((h) => h.type === "C"), s = t.find((h) => h.type === "A");
1133
+ if (!s) return [];
1134
+ const a = Ye(r == null ? void 0 : r.lines), l = Ye(o == null ? void 0 : o.lines), u = [];
1135
+ for (const h of (i == null ? void 0 : i.lines) ?? []) {
1136
+ const P = h.trimStart();
1137
+ if (!P || P.startsWith("#")) continue;
1138
+ const A = ut(h);
1139
+ A && u.push(A);
1140
1140
  }
1141
- (((E = (h = a.WRAP) == null ? void 0 : h.value) == null ? void 0 : E.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1141
+ (((L = (g = a.WRAP) == null ? void 0 : g.value) == null ? void 0 : L.trim().toUpperCase()) ?? "NO") === "YES" && console.warn(
1142
1142
  "parseLasFile: WRAP YES is not supported. Data rows may be read incorrectly."
1143
1143
  );
1144
- const m = n.holeId ?? (((x = (A = l.WELL) == null ? void 0 : A.value) == null ? void 0 : x.trim()) || null) ?? (((O = (H = l.UWI) == null ? void 0 : H.value) == null ? void 0 : O.trim()) || null) ?? (((R = (P = l.API) == null ? void 0 : P.value) == null ? void 0 : R.trim()) || null) ?? "unknown";
1145
- let d = Qe;
1146
- if ((V = l.NULL) != null && V.value) {
1147
- const p = Number(l.NULL.value);
1148
- Number.isFinite(p) && (d = p);
1144
+ const d = n.holeId ?? (((j = (C = l.WELL) == null ? void 0 : C.value) == null ? void 0 : j.trim()) || null) ?? ((($ = (H = l.UWI) == null ? void 0 : H.value) == null ? void 0 : $.trim()) || null) ?? (((R = (D = l.API) == null ? void 0 : D.value) == null ? void 0 : R.trim()) || null) ?? "unknown";
1145
+ let m = et;
1146
+ if ((G = l.NULL) != null && G.value) {
1147
+ const h = Number(l.NULL.value);
1148
+ Number.isFinite(h) && (m = h);
1149
1149
  }
1150
- if (n.nullSentinel !== void 0 && (d = n.nullSentinel), u.length === 0) return [];
1151
- const f = u.slice(1), g = {};
1152
- for (const { mnem: p, unit: T } of f)
1153
- g[p.toLowerCase()] = T;
1154
- const y = {};
1155
- for (const { mnem: p } of f)
1156
- y[p.toLowerCase()] = { depths: [], values: [] };
1157
- for (const p of o.lines) {
1158
- const T = p.trimStart();
1159
- if (!T || T.startsWith("#")) continue;
1160
- const I = T.split(/\s+/);
1161
- if (I.length < 2) continue;
1162
- const z = Number(I[0]);
1163
- if (!(!Number.isFinite(z) || z === d))
1164
- for (let w = 0; w < f.length; w++) {
1165
- const v = f[w].mnem.toLowerCase(), N = Number(I[w + 1]);
1166
- Number.isFinite(N) && N !== d && (y[v].depths.push(z), y[v].values.push(N));
1150
+ if (n.nullSentinel !== void 0 && (m = n.nullSentinel), u.length === 0) return [];
1151
+ const f = u.slice(1), b = {};
1152
+ for (const { mnem: h, unit: P } of f)
1153
+ b[h.toLowerCase()] = P;
1154
+ const p = {};
1155
+ for (const { mnem: h } of f)
1156
+ p[h.toLowerCase()] = { depths: [], values: [] };
1157
+ for (const h of s.lines) {
1158
+ const P = h.trimStart();
1159
+ if (!P || P.startsWith("#")) continue;
1160
+ const A = P.split(/\s+/);
1161
+ if (A.length < 2) continue;
1162
+ const z = Number(A[0]);
1163
+ if (!(!Number.isFinite(z) || z === m))
1164
+ for (let E = 0; E < f.length; E++) {
1165
+ const _ = f[E].mnem.toLowerCase(), y = Number(A[E + 1]);
1166
+ Number.isFinite(y) && y !== m && (p[_].depths.push(z), p[_].values.push(y));
1167
1167
  }
1168
1168
  }
1169
- const b = {};
1170
- for (const [p, T] of Object.entries(y))
1171
- T.depths.length >= 2 && (b[p] = T);
1172
- return Object.keys(b).length === 0 ? [] : [{ holeId: m, units: g, channels: b }];
1169
+ const v = {};
1170
+ for (const [h, P] of Object.entries(p))
1171
+ P.depths.length >= 2 && (v[h] = P);
1172
+ return Object.keys(v).length === 0 ? [] : [{ holeId: d, units: b, channels: v }];
1173
1173
  }
1174
- const ct = [
1174
+ const dt = [
1175
1175
  "#0f172a",
1176
1176
  "#1e3a5f",
1177
1177
  "#7c3aed",
@@ -1182,25 +1182,26 @@ const ct = [
1182
1182
  "#db2777",
1183
1183
  "#65a30d",
1184
1184
  "#9333ea"
1185
- ], Kt = { l: 42, r: 4, t: 4, b: 30 }, qe = 10, Ke = 12;
1186
- function ut(e = {}) {
1185
+ ], en = { l: 42, r: 4, t: 4, b: 36 }, We = 10, qe = 11, tn = 6;
1186
+ function mt(e = {}) {
1187
1187
  return {
1188
1188
  ...e,
1189
- margin: Kt,
1189
+ margin: en,
1190
1190
  autosize: !0,
1191
1191
  width: void 0,
1192
1192
  xaxis: {
1193
1193
  ...e.xaxis || {},
1194
1194
  tickfont: {
1195
1195
  ...e.xaxis && e.xaxis.tickfont || {},
1196
- size: qe
1196
+ size: We
1197
1197
  },
1198
1198
  title: {
1199
1199
  ...e.xaxis && e.xaxis.title || {},
1200
1200
  font: {
1201
1201
  ...e.xaxis && e.xaxis.title && e.xaxis.title.font || {},
1202
- size: Ke
1203
- }
1202
+ size: qe
1203
+ },
1204
+ standoff: (e.xaxis && e.xaxis.title && e.xaxis.title.standoff) ?? tn
1204
1205
  }
1205
1206
  },
1206
1207
  yaxis: {
@@ -1208,67 +1209,67 @@ function ut(e = {}) {
1208
1209
  automargin: !0,
1209
1210
  tickfont: {
1210
1211
  ...e.yaxis && e.yaxis.tickfont || {},
1211
- size: qe
1212
+ size: We
1212
1213
  },
1213
1214
  title: {
1214
1215
  ...e.yaxis && e.yaxis.title || {},
1215
1216
  font: {
1216
1217
  ...e.yaxis && e.yaxis.title && e.yaxis.title.font || {},
1217
- size: Ke
1218
+ size: qe
1218
1219
  }
1219
1220
  }
1220
1221
  }
1221
1222
  };
1222
1223
  }
1223
- function Xt(e, {
1224
+ function nn(e, {
1224
1225
  tailScale: n = 5,
1225
1226
  colorBy: t = null,
1226
- palette: s = ct,
1227
- depthCol: r = G,
1228
- dipCol: i = Y,
1229
- azCol: o = j,
1227
+ palette: r = dt,
1228
+ depthCol: o = V,
1229
+ dipCol: i = W,
1230
+ azCol: s = Y,
1230
1231
  template: a = void 0
1231
1232
  } = {}) {
1232
1233
  const l = e.filter(
1233
- (y) => y[r] != null && y[i] != null && y[o] != null
1234
+ (p) => p[o] != null && p[i] != null && p[s] != null
1234
1235
  );
1235
1236
  if (!l.length)
1236
1237
  return { data: [], layout: {} };
1237
1238
  const u = {};
1238
- t && [...new Set(l.map((b) => b[t]).filter((b) => b != null))].sort().forEach((b, h) => {
1239
- u[b] = s[h % s.length];
1239
+ t && [...new Set(l.map((v) => v[t]).filter((v) => v != null))].sort().forEach((v, g) => {
1240
+ u[v] = r[g % r.length];
1240
1241
  });
1241
- const c = /* @__PURE__ */ new Map(), m = [];
1242
- for (const y of l) {
1243
- const b = Number(y[r]), h = Number(y[i]), E = Number(y[o]), A = t ? y[t] ?? "_default" : "_default", x = t ? u[A] ?? "#0f172a" : "#0f172a";
1244
- c.has(A) || c.set(A, { xs: [], ys: [], dips: [], azs: [], color: x });
1245
- const H = c.get(A);
1246
- H.xs.push(h), H.ys.push(b), H.dips.push(h), H.azs.push(E);
1247
- const O = E * Math.PI / 180, P = n * (Math.abs(h) / 90), R = Math.sin(O) * P, V = Math.cos(O) * P;
1248
- m.push({
1242
+ const c = /* @__PURE__ */ new Map(), d = [];
1243
+ for (const p of l) {
1244
+ const v = Number(p[o]), g = Number(p[i]), L = Number(p[s]), C = t ? p[t] ?? "_default" : "_default", j = t ? u[C] ?? "#0f172a" : "#0f172a";
1245
+ c.has(C) || c.set(C, { xs: [], ys: [], dips: [], azs: [], color: j });
1246
+ const H = c.get(C);
1247
+ H.xs.push(g), H.ys.push(v), H.dips.push(g), H.azs.push(L);
1248
+ const $ = L * Math.PI / 180, D = n * (Math.abs(g) / 90), R = Math.sin($) * D, G = Math.cos($) * D;
1249
+ d.push({
1249
1250
  type: "line",
1250
- x0: h,
1251
- y0: b,
1252
- x1: h + R,
1253
- y1: b + V,
1254
- line: { color: x, width: 2 }
1251
+ x0: g,
1252
+ y0: v,
1253
+ x1: g + R,
1254
+ y1: v + G,
1255
+ line: { color: j, width: 2 }
1255
1256
  });
1256
1257
  }
1257
- const d = [], f = t && c.size > 1;
1258
- for (const [y, b] of c.entries())
1259
- d.push({
1258
+ const m = [], f = t && c.size > 1;
1259
+ for (const [p, v] of c.entries())
1260
+ m.push({
1260
1261
  type: "scatter",
1261
- x: b.xs,
1262
- y: b.ys,
1262
+ x: v.xs,
1263
+ y: v.ys,
1263
1264
  mode: "markers",
1264
- name: y !== "_default" ? String(y) : void 0,
1265
- marker: { size: 8, color: b.color },
1266
- showlegend: f && y !== "_default",
1267
- customdata: b.dips.map((h, E) => [h, b.azs[E]]),
1265
+ name: p !== "_default" ? String(p) : void 0,
1266
+ marker: { size: 8, color: v.color },
1267
+ showlegend: f && p !== "_default",
1268
+ customdata: v.dips.map((g, L) => [g, v.azs[L]]),
1268
1269
  hovertemplate: "Depth: %{y}<br>Dip: %{customdata[0]}<br>Az: %{customdata[1]}<extra></extra>"
1269
1270
  });
1270
- return { data: d, layout: {
1271
- shapes: m,
1271
+ return { data: m, layout: {
1272
+ shapes: d,
1272
1273
  height: 400,
1273
1274
  margin: { l: 40, r: 10, t: 10, b: 40 },
1274
1275
  xaxis: {
@@ -1283,35 +1284,35 @@ function Xt(e, {
1283
1284
  template: a !== void 0 ? a : $e
1284
1285
  } };
1285
1286
  }
1286
- function Wn(e, {
1287
+ function or(e, {
1287
1288
  labelCol: n = "structure_type",
1288
- palette: t = ct,
1289
- fromCol: s = C,
1290
- toCol: r = M,
1289
+ palette: t = dt,
1290
+ fromCol: r = M,
1291
+ toCol: o = O,
1291
1292
  template: i = void 0
1292
1293
  } = {}) {
1293
- const o = e.filter((d) => d[s] != null && d[r] != null && Number(d[r]) > Number(d[s])).filter((d) => {
1294
- const f = d[n];
1294
+ const s = e.filter((m) => m[r] != null && m[o] != null && Number(m[o]) > Number(m[r])).filter((m) => {
1295
+ const f = m[n];
1295
1296
  if (f == null) return !1;
1296
- const g = String(f).trim();
1297
- return g !== "" && !/^(nan|null|none)$/i.test(g);
1298
- }).map((d) => ({ from: Number(d[s]), to: Number(d[r]), label: String(d[n]).trim() })).sort((d, f) => d.from - f.from);
1299
- if (!o.length)
1297
+ const b = String(f).trim();
1298
+ return b !== "" && !/^(nan|null|none)$/i.test(b);
1299
+ }).map((m) => ({ from: Number(m[r]), to: Number(m[o]), label: String(m[n]).trim() })).sort((m, f) => m.from - f.from);
1300
+ if (!s.length)
1300
1301
  return { data: [], layout: {} };
1301
1302
  const a = [], l = [], u = [];
1302
- return o.forEach((d, f) => {
1303
+ return s.forEach((m, f) => {
1303
1304
  a.push({
1304
1305
  type: "rect",
1305
1306
  xref: "x",
1306
1307
  yref: "y",
1307
1308
  x0: 0,
1308
1309
  x1: 1,
1309
- y0: d.from,
1310
- y1: d.to,
1310
+ y0: m.from,
1311
+ y1: m.to,
1311
1312
  fillcolor: t[f % t.length],
1312
1313
  line: { width: 0 },
1313
1314
  layer: "below"
1314
- }), l.push(0.5 * (d.from + d.to)), u.push(d.label);
1315
+ }), l.push(0.5 * (m.from + m.to)), u.push(m.label);
1315
1316
  }), { data: [{
1316
1317
  type: "scatter",
1317
1318
  x: Array(u.length).fill(0.5),
@@ -1321,7 +1322,7 @@ function Wn(e, {
1321
1322
  textposition: "middle center",
1322
1323
  showlegend: !1,
1323
1324
  hoverinfo: "text"
1324
- }], layout: ut({
1325
+ }], layout: mt({
1325
1326
  shapes: a,
1326
1327
  height: 400,
1327
1328
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -1332,56 +1333,56 @@ function Wn(e, {
1332
1333
  }
1333
1334
  function Xe(e, n) {
1334
1335
  if (!e) return "";
1335
- const t = String(e).trim().split(/\s+/), s = [];
1336
- let r = "";
1336
+ const t = String(e).trim().split(/\s+/), r = [];
1337
+ let o = "";
1337
1338
  for (const i of t)
1338
- r && r.length + 1 + i.length > n ? (s.push(r), r = i) : r = r ? `${r} ${i}` : i;
1339
- return r && s.push(r), s.join("<br>");
1339
+ o && o.length + 1 + i.length > n ? (r.push(o), o = i) : o = o ? `${o} ${i}` : i;
1340
+ return o && r.push(o), r.join("<br>");
1340
1341
  }
1341
- function Zt(e, {
1342
+ function rn(e, {
1342
1343
  commentCol: n = "comments",
1343
- fromCol: t = C,
1344
- toCol: s = M,
1345
- bgColor: r = "#f1f5f9",
1344
+ fromCol: t = M,
1345
+ toCol: r = O,
1346
+ bgColor: o = "#f1f5f9",
1346
1347
  borderColor: i = "#cbd5e1",
1347
- textColor: o = "#1e293b",
1348
+ textColor: s = "#1e293b",
1348
1349
  charsPerLine: a = 18,
1349
1350
  template: l = void 0
1350
1351
  } = {}) {
1351
- const u = e.filter((h) => h[t] != null && h[s] != null && Number(h[s]) > Number(h[t])).map((h) => {
1352
- const E = h[n], A = E != null && String(E).trim() !== "" && String(E) !== "null" ? String(E).trim() : "";
1353
- return { from: Number(h[t]), to: Number(h[s]), comment: A };
1354
- }).sort((h, E) => h.from - E.from);
1352
+ const u = e.filter((g) => g[t] != null && g[r] != null && Number(g[r]) > Number(g[t])).map((g) => {
1353
+ const L = g[n], C = L != null && String(L).trim() !== "" && String(L) !== "null" ? String(L).trim() : "";
1354
+ return { from: Number(g[t]), to: Number(g[r]), comment: C };
1355
+ }).sort((g, L) => g.from - L.from);
1355
1356
  if (!u.length)
1356
1357
  return { data: [], layout: {} };
1357
- const c = [], m = [], d = [], f = [], g = [];
1358
- for (const h of u) {
1359
- const E = 0.5 * (h.from + h.to), A = !!h.comment;
1358
+ const c = [], d = [], m = [], f = [], b = [];
1359
+ for (const g of u) {
1360
+ const L = 0.5 * (g.from + g.to), C = !!g.comment;
1360
1361
  c.push({
1361
1362
  type: "rect",
1362
1363
  xref: "x",
1363
1364
  yref: "y",
1364
1365
  x0: 0,
1365
1366
  x1: 1,
1366
- y0: h.from,
1367
- y1: h.to,
1368
- fillcolor: A ? r : "rgba(0,0,0,0)",
1367
+ y0: g.from,
1368
+ y1: g.to,
1369
+ fillcolor: C ? o : "rgba(0,0,0,0)",
1369
1370
  line: { color: i, width: 1 },
1370
1371
  layer: "below"
1371
- }), A && (m.push(0.5), d.push(E), f.push(Xe(h.comment, a)), g.push(`${h.from.toFixed(3)}–${h.to.toFixed(3)} m<br>${Xe(h.comment, 40)}`));
1372
+ }), C && (d.push(0.5), m.push(L), f.push(Xe(g.comment, a)), b.push(`${g.from.toFixed(3)}–${g.to.toFixed(3)} m<br>${Xe(g.comment, 40)}`));
1372
1373
  }
1373
- return { data: m.length ? [{
1374
+ return { data: d.length ? [{
1374
1375
  type: "scatter",
1375
- x: m,
1376
- y: d,
1376
+ x: d,
1377
+ y: m,
1377
1378
  mode: "text",
1378
1379
  text: f,
1379
1380
  textposition: "middle center",
1380
- textfont: { color: o, size: 10 },
1381
- hovertext: g,
1381
+ textfont: { color: s, size: 10 },
1382
+ hovertext: b,
1382
1383
  hoverinfo: "text",
1383
1384
  showlegend: !1
1384
- }] : [], layout: ut({
1385
+ }] : [], layout: mt({
1385
1386
  shapes: c,
1386
1387
  height: 400,
1387
1388
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
@@ -1390,435 +1391,637 @@ function Zt(e, {
1390
1391
  template: l !== void 0 ? l : $e
1391
1392
  }) };
1392
1393
  }
1393
- function qn(e, {
1394
+ function sr(e, {
1394
1395
  symbolSize: n = 10,
1395
1396
  xCol: t = "easting",
1396
- yCol: s = "northing"
1397
+ yCol: r = "northing"
1397
1398
  } = {}) {
1398
- const r = e[t] != null ? Number(e[t]) : null, i = e[s] != null ? Number(e[s]) : null, o = e[Y] != null ? Number(e[Y]) : null, a = e[j] != null ? Number(e[j]) : null;
1399
- if (r === null || i === null || o === null || a === null) return null;
1400
- const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, m = n * Math.sin(u), d = n * Math.cos(u), f = n * 0.4 * (o / 90), g = f * Math.sin(c), y = f * Math.cos(c);
1399
+ const o = e[t] != null ? Number(e[t]) : null, i = e[r] != null ? Number(e[r]) : null, s = e[W] != null ? Number(e[W]) : null, a = e[Y] != null ? Number(e[Y]) : null;
1400
+ if (o === null || i === null || s === null || a === null) return null;
1401
+ const l = (a - 90 + 360) % 360, u = l * Math.PI / 180, c = a * Math.PI / 180, d = n * Math.sin(u), m = n * Math.cos(u), f = n * 0.4 * (s / 90), b = f * Math.sin(c), p = f * Math.cos(c);
1401
1402
  return {
1402
1403
  strike: l,
1403
- dipValue: o,
1404
- x: r,
1404
+ dipValue: s,
1405
+ x: o,
1405
1406
  y: i,
1406
- strikeX0: r - m,
1407
- strikeY0: i - d,
1408
- strikeX1: r + m,
1409
- strikeY1: i + d,
1410
- tickX1: r + g,
1411
- tickY1: i + y
1407
+ strikeX0: o - d,
1408
+ strikeY0: i - m,
1409
+ strikeX1: o + d,
1410
+ strikeY1: i + m,
1411
+ tickX1: o + b,
1412
+ tickY1: i + p
1412
1413
  };
1413
1414
  }
1414
- const dt = "markers+line";
1415
- function Jt(e, n) {
1416
- var s;
1417
- const t = et(e);
1418
- return t.some((r) => r.value === n) ? n : ((s = t[0]) == null ? void 0 : s.value) || dt;
1419
- }
1420
- function Kn({ config: e, graph: n, holeOptions: t = [], propertyOptions: s = [], onConfigChange: r, template: i }) {
1421
- const o = _e(null), a = n == null ? void 0 : n.hole, l = (n == null ? void 0 : n.points) || [], u = (e == null ? void 0 : e.property) || "", c = (e == null ? void 0 : e.chartType) || dt, m = (e == null ? void 0 : e.holeId) || "", d = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? Pe : n != null && n.isCategorical ? Be : Nt), f = et(d), g = Jt(d, c), [y, b] = X("");
1422
- return ne(() => {
1423
- const h = d === Pe, E = d === Ge;
1424
- if (!a || !u || !h && !E && l.length === 0) return;
1425
- const A = o.current;
1426
- if (!A) return;
1427
- let x;
1415
+ function on({
1416
+ holeId: e,
1417
+ hole: n,
1418
+ holeOptions: t,
1419
+ property: r,
1420
+ propertyOptions: o,
1421
+ displayType: i,
1422
+ points: s,
1423
+ renderError: a
1424
+ }) {
1425
+ if (a)
1426
+ return { kind: "placeholder", text: `Plot error: ${a}` };
1427
+ const l = t || [];
1428
+ if (!e)
1429
+ return l.length === 0 ? { kind: "placeholder", text: "No holes loaded" } : { kind: "placeholder", text: "Select a hole" };
1430
+ if (!n)
1431
+ return { kind: "placeholder", text: `Loading ${e}…` };
1432
+ const u = o || [];
1433
+ return r ? !(i === ze) && !(i === tt) && (s || []).length === 0 ? { kind: "placeholder", text: `No values for ${r} in hole ${e}` } : { kind: "chart" } : u.length === 0 ? { kind: "placeholder", text: `No properties available for hole ${e}` } : { kind: "placeholder", text: "Select a property" };
1434
+ }
1435
+ function ft(e, n) {
1436
+ if (typeof n == "function") return n(e);
1437
+ if (!(typeof n != "string" || !n) && !(e == null || typeof e != "object"))
1438
+ return e[n];
1439
+ }
1440
+ function sn(e, n) {
1441
+ const t = [], r = /* @__PURE__ */ new Set();
1442
+ for (const o of e || []) {
1443
+ const i = ft(o, n);
1444
+ i == null || i === "" || r.has(i) || (r.add(i), t.push(i));
1445
+ }
1446
+ return t;
1447
+ }
1448
+ function an(e, n, t) {
1449
+ return t == null || t === "" ? e || [] : (e || []).filter((r) => ft(r, n) === t);
1450
+ }
1451
+ function ln({
1452
+ chartOptions: e,
1453
+ showHoleSelect: n,
1454
+ showPropertySelect: t,
1455
+ showChartTypeSelect: r
1456
+ }) {
1457
+ return {
1458
+ hole: n !== !1,
1459
+ property: t !== !1,
1460
+ chartType: r !== !1 && (e || []).length > 1
1461
+ };
1462
+ }
1463
+ const ht = "markers+line";
1464
+ function cn(e, n) {
1465
+ var r;
1466
+ const t = nt(e);
1467
+ return t.some((o) => o.value === n) ? n : ((r = t[0]) == null ? void 0 : r.value) || ht;
1468
+ }
1469
+ function Ke(e) {
1470
+ const n = typeof e == "string" ? e : e.holeId, t = typeof e == "string" ? e : e.label || e.holeId;
1471
+ return [n, t];
1472
+ }
1473
+ function Ze(e) {
1474
+ const n = typeof e == "string" ? e : e.value, t = typeof e == "string" ? e : e.label ?? e.value;
1475
+ return [n, t];
1476
+ }
1477
+ function un({ selector: e, holeOptions: n, selectedHoleId: t, onConfigChange: r }) {
1478
+ const o = (e == null ? void 0 : e.kind) || "hole";
1479
+ if (o === "field") {
1480
+ const s = e.value ?? "", a = e.options || [], l = e.label || "Selection";
1481
+ return /* @__PURE__ */ w(
1482
+ "select",
1483
+ {
1484
+ className: "plot-select plot-select--field",
1485
+ value: s,
1486
+ onChange: (u) => e.onChange && e.onChange(u.target.value),
1487
+ disabled: a.length === 0,
1488
+ "aria-label": l,
1489
+ children: [
1490
+ a.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "—" }),
1491
+ !s && a.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1492
+ a.map((u) => {
1493
+ const [c, d] = Ze(u);
1494
+ return /* @__PURE__ */ S("option", { value: c, children: d }, c);
1495
+ })
1496
+ ]
1497
+ }
1498
+ );
1499
+ }
1500
+ if (o === "group+hole") {
1501
+ const s = e.groupBy, a = e.groupValue ?? "", l = e.groupLabel || "Group", u = e.groupOptions || sn(n, s), c = an(n, s, a);
1502
+ return /* @__PURE__ */ w(Ct, { children: [
1503
+ /* @__PURE__ */ w(
1504
+ "select",
1505
+ {
1506
+ className: "plot-select plot-select--group",
1507
+ value: a,
1508
+ onChange: (d) => e.onGroupChange && e.onGroupChange(d.target.value),
1509
+ disabled: u.length === 0,
1510
+ "aria-label": l,
1511
+ children: [
1512
+ u.length === 0 && /* @__PURE__ */ w("option", { value: "", children: [
1513
+ "No ",
1514
+ l.toLowerCase(),
1515
+ "s"
1516
+ ] }),
1517
+ !a && u.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: `Select ${l.toLowerCase()}` }),
1518
+ u.map((d) => {
1519
+ const [m, f] = Ze(d);
1520
+ return /* @__PURE__ */ S("option", { value: m, children: f }, m);
1521
+ })
1522
+ ]
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ w(
1526
+ "select",
1527
+ {
1528
+ className: "plot-select plot-select--hole",
1529
+ value: t,
1530
+ onChange: (d) => r && r({ holeId: d.target.value }),
1531
+ disabled: c.length === 0,
1532
+ "aria-label": "Hole",
1533
+ children: [
1534
+ c.length === 0 && /* @__PURE__ */ S("option", { value: "", children: "No holes" }),
1535
+ !t && c.length > 0 && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1536
+ c.map((d) => {
1537
+ const [m, f] = Ke(d);
1538
+ return /* @__PURE__ */ S("option", { value: m, children: f }, m);
1539
+ })
1540
+ ]
1541
+ }
1542
+ )
1543
+ ] });
1544
+ }
1545
+ const i = n.length > 0;
1546
+ return /* @__PURE__ */ w(
1547
+ "select",
1548
+ {
1549
+ className: "plot-select plot-select--hole",
1550
+ value: t,
1551
+ onChange: (s) => r && r({ holeId: s.target.value }),
1552
+ disabled: !i,
1553
+ "aria-label": "Hole",
1554
+ children: [
1555
+ !i && /* @__PURE__ */ S("option", { value: "", children: "No holes loaded" }),
1556
+ !t && i && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a hole" }),
1557
+ n.map((s) => {
1558
+ const [a, l] = Ke(s);
1559
+ return /* @__PURE__ */ S("option", { value: a, children: l }, a);
1560
+ })
1561
+ ]
1562
+ }
1563
+ );
1564
+ }
1565
+ function ir({
1566
+ config: e,
1567
+ graph: n,
1568
+ holeOptions: t = [],
1569
+ propertyOptions: r = [],
1570
+ propertyMeta: o,
1571
+ onConfigChange: i,
1572
+ template: s,
1573
+ showHoleSelect: a = !0,
1574
+ showPropertySelect: l = !0,
1575
+ showChartTypeSelect: u = !0,
1576
+ holeSelector: c
1577
+ }) {
1578
+ const d = ye(null), m = ye(null), f = n == null ? void 0 : n.hole, b = (n == null ? void 0 : n.points) || [], p = (e == null ? void 0 : e.property) || "", v = o == null ? void 0 : o[p], g = (e == null ? void 0 : e.chartType) || ht, L = (e == null ? void 0 : e.holeId) || "", C = (n == null ? void 0 : n.displayType) || (n != null && n.isComment ? ze : n != null && n.isCategorical ? Ge : At), j = nt(C), H = cn(C, g), [$, D] = K(""), [R, G] = K({ width: 0, height: 0 }), h = on({
1579
+ holeId: L,
1580
+ hole: f,
1581
+ holeOptions: t,
1582
+ property: p,
1583
+ propertyOptions: r,
1584
+ displayType: C,
1585
+ points: b,
1586
+ renderError: $
1587
+ }), P = h.kind !== "chart", A = ln({
1588
+ chartOptions: j,
1589
+ showHoleSelect: a,
1590
+ showPropertySelect: l,
1591
+ showChartTypeSelect: u
1592
+ }), z = r.length > 0;
1593
+ return te(() => {
1594
+ const E = d.current;
1595
+ if (!E || typeof ResizeObserver > "u") return;
1596
+ let _ = 0;
1597
+ const y = () => {
1598
+ _ && cancelAnimationFrame(_), _ = requestAnimationFrame(() => {
1599
+ const F = Math.max(0, Math.floor(E.clientWidth)), T = Math.max(0, Math.floor(E.clientHeight));
1600
+ G((x) => x.width === F && x.height === T ? x : { width: F, height: T });
1601
+ });
1602
+ };
1603
+ y();
1604
+ const I = new ResizeObserver(y);
1605
+ return I.observe(E), () => {
1606
+ _ && cancelAnimationFrame(_), I.disconnect();
1607
+ };
1608
+ }, []), te(() => {
1609
+ if (h.kind !== "chart") return;
1610
+ const E = m.current;
1611
+ if (!E || R.width <= 0 || R.height <= 0) return;
1612
+ const _ = C === ze, y = C === tt;
1613
+ let I;
1428
1614
  try {
1429
- h ? x = Zt(l, { commentCol: u, fromCol: "from", toCol: "to" }) : E ? x = Xt(l) : x = Et({
1430
- points: l,
1431
- isCategorical: d === Be,
1432
- property: u,
1433
- chartType: g,
1434
- template: i
1615
+ _ ? I = rn(b, { commentCol: p, fromCol: "from", toCol: "to" }) : y ? I = nn(b) : I = St({
1616
+ points: b,
1617
+ isCategorical: C === Ge,
1618
+ property: p,
1619
+ chartType: H,
1620
+ template: s,
1621
+ meta: v
1435
1622
  });
1436
- } catch (O) {
1437
- console.error("Plot build error", O), b((O == null ? void 0 : O.message) || "Plot build error");
1623
+ } catch (x) {
1624
+ console.error("Plot build error", x), D((x == null ? void 0 : x.message) || "Plot build error");
1438
1625
  return;
1439
1626
  }
1440
- if ((!(x != null && x.data) || x.data.length === 0) && !h)
1627
+ if ((!(I != null && I.data) || I.data.length === 0) && !_)
1441
1628
  return;
1442
- const H = {
1629
+ const F = {
1443
1630
  displayModeBar: !0,
1444
- responsive: !0,
1445
- useResizeHandler: !0,
1631
+ responsive: !1,
1446
1632
  modeBarButtonsToRemove: ["select2d", "lasso2d", "autoScale2d"]
1633
+ }, T = {
1634
+ ...I.layout,
1635
+ autosize: !1,
1636
+ width: R.width,
1637
+ height: R.height
1447
1638
  };
1448
1639
  try {
1449
- b(""), Ae.react(A, x.data, x.layout, H), requestAnimationFrame(() => {
1450
- A && A.parentElement && Ae.Plots.resize(A);
1451
- });
1452
- } catch (O) {
1453
- console.error("Plot render error", O), b((O == null ? void 0 : O.message) || "Plot render error");
1640
+ D(""), Oe.react(E, I.data, T, F);
1641
+ } catch (x) {
1642
+ console.error("Plot render error", x), D((x == null ? void 0 : x.message) || "Plot render error");
1454
1643
  }
1455
1644
  return () => {
1456
- if (A)
1645
+ if (E)
1457
1646
  try {
1458
- Ae.purge(A);
1459
- } catch (O) {
1460
- console.warn("Plot purge error", O);
1647
+ Oe.purge(E);
1648
+ } catch (x) {
1649
+ console.warn("Plot purge error", x);
1461
1650
  }
1462
1651
  };
1463
- }, [a, u, g, d, l, i]), ne(() => {
1464
- const h = o.current;
1465
- if (!h || typeof ResizeObserver > "u") return;
1466
- const E = new ResizeObserver(() => {
1652
+ }, [
1653
+ h.kind,
1654
+ f,
1655
+ p,
1656
+ v,
1657
+ H,
1658
+ C,
1659
+ b,
1660
+ s,
1661
+ R.width,
1662
+ R.height
1663
+ ]), te(() => {
1664
+ const E = m.current;
1665
+ if (!E || typeof ResizeObserver > "u") return;
1666
+ const _ = new ResizeObserver(() => {
1467
1667
  try {
1468
- h && h.data && Ae.Plots.resize(h);
1469
- } catch (A) {
1470
- console.warn("Plot resize error", A);
1668
+ if (E && E.data) {
1669
+ const y = Math.max(0, Math.floor(E.clientWidth)), I = Math.max(0, Math.floor(E.clientHeight));
1670
+ y > 0 && I > 0 && Oe.relayout(E, { width: y, height: I, autosize: !1 });
1671
+ }
1672
+ } catch (y) {
1673
+ console.warn("Plot resize error", y);
1471
1674
  }
1472
1675
  });
1473
- return E.observe(h), () => E.disconnect();
1474
- }, []), !a || !u ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: e != null && e.holeId ? n != null && n.loading ? `Loading ${e.holeId}...` : "Select a property" : "Loading demo data..." }) }) : d !== Pe && d !== Ge && l.length === 0 ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ S("div", { className: "placeholder", children: "No data" }) }) : y ? /* @__PURE__ */ S("div", { className: "plot-card empty", children: /* @__PURE__ */ W("div", { className: "placeholder", children: [
1475
- "Plot error: ",
1476
- y
1477
- ] }) }) : /* @__PURE__ */ W("div", { className: "plot-card", children: [
1478
- /* @__PURE__ */ S("div", { className: "plot-title", children: /* @__PURE__ */ S(
1479
- "select",
1480
- {
1481
- className: "plot-select",
1482
- value: m,
1483
- onChange: (h) => r && r({ holeId: h.target.value }),
1484
- children: t.map((h) => {
1485
- const E = typeof h == "string" ? h : h.holeId, A = typeof h == "string" ? h : h.label || h.holeId;
1486
- return /* @__PURE__ */ S("option", { value: E, children: A }, E);
1487
- })
1488
- }
1489
- ) }),
1490
- /* @__PURE__ */ W("div", { className: "plot-controls column", children: [
1491
- s.length > 0 && /* @__PURE__ */ S(
1492
- "select",
1493
- {
1494
- className: "plot-select",
1495
- value: u,
1496
- onChange: (h) => r && r({ property: h.target.value }),
1497
- children: s.map((h) => /* @__PURE__ */ S("option", { value: h, children: h }, h))
1498
- }
1499
- ),
1500
- f.length > 1 && /* @__PURE__ */ S(
1501
- "select",
1502
- {
1503
- className: "plot-select",
1504
- value: g,
1505
- onChange: (h) => r && r({ chartType: h.target.value }),
1506
- children: f.map((h) => /* @__PURE__ */ S("option", { value: h.value, children: h.label }, h.value))
1507
- }
1508
- )
1676
+ return _.observe(E), () => _.disconnect();
1677
+ }, [h.kind]), /* @__PURE__ */ w("div", { className: `plot-card${P ? " empty" : ""}`, children: [
1678
+ /* @__PURE__ */ w("header", { className: "plot-card__controls", children: [
1679
+ A.hole && /* @__PURE__ */ S("div", { className: "plot-title", children: un({
1680
+ selector: c,
1681
+ holeOptions: t,
1682
+ selectedHoleId: L,
1683
+ onConfigChange: i
1684
+ }) }),
1685
+ (A.property || A.chartType) && /* @__PURE__ */ w("div", { className: "plot-controls column", children: [
1686
+ A.property && /* @__PURE__ */ w(
1687
+ "select",
1688
+ {
1689
+ className: "plot-select plot-select--property",
1690
+ value: p,
1691
+ onChange: (E) => i && i({ property: E.target.value }),
1692
+ disabled: !z,
1693
+ "aria-label": "Property",
1694
+ children: [
1695
+ !z && /* @__PURE__ */ S("option", { value: "", children: "—" }),
1696
+ !p && z && /* @__PURE__ */ S("option", { value: "", disabled: !0, hidden: !0, children: "Select a property" }),
1697
+ r.map((E) => /* @__PURE__ */ S("option", { value: E, children: Tt(E, o == null ? void 0 : o[E]) }, E))
1698
+ ]
1699
+ }
1700
+ ),
1701
+ A.chartType && /* @__PURE__ */ S(
1702
+ "select",
1703
+ {
1704
+ className: "plot-select plot-select--chart-type",
1705
+ value: H,
1706
+ onChange: (E) => i && i({ chartType: E.target.value }),
1707
+ "aria-label": "Chart type",
1708
+ children: j.map((E) => /* @__PURE__ */ S("option", { value: E.value, children: E.label }, E.value))
1709
+ }
1710
+ )
1711
+ ] })
1509
1712
  ] }),
1510
- /* @__PURE__ */ S("div", { className: "plotly-chart", ref: o })
1713
+ /* @__PURE__ */ S("div", { className: "plot-card__body", ref: d, children: h.kind === "chart" ? /* @__PURE__ */ S("div", { className: "plotly-chart", ref: m }) : /* @__PURE__ */ S("div", { className: "placeholder", children: h.text }) })
1511
1714
  ] });
1512
1715
  }
1513
- function Ze(e, n) {
1716
+ function Je(e, n) {
1514
1717
  if (!(n != null && n.length)) return e;
1515
- const t = new Map(e.map((s) => [s.id || s.holeId, { ...s }]));
1516
- for (const s of n) {
1517
- const r = s.id || s.holeId;
1518
- if (r)
1519
- if (t.has(r)) {
1520
- const i = t.get(r);
1521
- t.set(r, { ...i, points: [...i.points || [], ...s.points || []] });
1718
+ const t = new Map(e.map((r) => [r.id || r.holeId, { ...r }]));
1719
+ for (const r of n) {
1720
+ const o = r.id || r.holeId;
1721
+ if (o)
1722
+ if (t.has(o)) {
1723
+ const i = t.get(o);
1724
+ t.set(o, { ...i, points: [...i.points || [], ...r.points || []] });
1522
1725
  } else
1523
- t.set(r, s);
1726
+ t.set(o, r);
1524
1727
  }
1525
1728
  return Array.from(t.values());
1526
1729
  }
1527
- function Qt(e, n) {
1730
+ function dn(e, n) {
1528
1731
  if (!e || !n) return [];
1529
- const t = /* @__PURE__ */ new Set(), s = [];
1530
- for (const r of e.points || []) {
1531
- const i = Number(r.from ?? r.samp_from ?? r.depth_from ?? r.from_depth), o = Number(r.to ?? r.samp_to ?? r.depth_to ?? r.to_depth);
1532
- if (!Number.isFinite(i) || !Number.isFinite(o) || o <= i) continue;
1533
- const a = `${i}-${o}`;
1534
- t.has(a) || (t.add(a), s.push({ from: i, to: o, [n]: r[n] ?? "" }));
1732
+ const t = /* @__PURE__ */ new Set(), r = [];
1733
+ for (const o of e.points || []) {
1734
+ const i = Number(o.from ?? o.samp_from ?? o.depth_from ?? o.from_depth), s = Number(o.to ?? o.samp_to ?? o.depth_to ?? o.to_depth);
1735
+ if (!Number.isFinite(i) || !Number.isFinite(s) || s <= i) continue;
1736
+ const a = `${i}-${s}`;
1737
+ t.has(a) || (t.add(a), r.push({ from: i, to: s, [n]: o[n] ?? "" }));
1535
1738
  }
1536
- return s;
1739
+ return r;
1537
1740
  }
1538
- function Xn({
1741
+ function ar({
1539
1742
  initialFocusedHoleId: e = "",
1540
1743
  sourceFile: n = null,
1541
1744
  extraHoles: t = [],
1542
- plotCount: s = 4
1745
+ plotCount: r = 4
1543
1746
  } = {}) {
1544
- const [r, i] = X([]), [o, a] = X([]), [l, u] = X([]), [c, m] = X([]), [d, f] = X([]), [g, y] = X({}), [b, h] = X(""), [E, A] = X([]), [x, H] = X(""), [O, P] = X(e || ""), [R, V] = X([]), p = _e(null);
1545
- ne(() => {
1546
- !n || p.current === n || (p.current = n, Pt(n).then((v) => {
1547
- if (!v) return;
1548
- const N = Array.from(new Map(v.map((D) => [D.holeId, D])).values());
1549
- a(N), A(rt({
1550
- holeIds: N.map((D) => D.holeId),
1551
- focusedHoleId: O,
1552
- plotCount: s,
1747
+ const [o, i] = K([]), [s, a] = K([]), [l, u] = K([]), [c, d] = K([]), [m, f] = K([]), [b, p] = K({}), [v, g] = K(""), [L, C] = K([]), [j, H] = K(""), [$, D] = K(e || ""), [R, G] = K([]), h = ye(null);
1748
+ te(() => {
1749
+ !n || h.current === n || (h.current = n, Ft(n).then((_) => {
1750
+ if (!_) return;
1751
+ const y = Array.from(new Map(_.map((I) => [I.holeId, I])).values());
1752
+ a(y), C(it({
1753
+ holeIds: y.map((I) => I.holeId),
1754
+ focusedHoleId: $,
1755
+ plotCount: r,
1553
1756
  defaultProp: "",
1554
1757
  categoricalProps: c,
1555
- commentProps: d,
1758
+ commentProps: m,
1556
1759
  numericDefaultChartType: "markers+line"
1557
1760
  }));
1558
- }).catch((v) => {
1559
- console.info("Assay metadata load skipped:", v.message);
1761
+ }).catch((_) => {
1762
+ console.info("Assay metadata load skipped:", _.message);
1560
1763
  }));
1561
- }, [n, O, s, c, d]), ne(() => {
1764
+ }, [n, $, r, c, m]), te(() => {
1562
1765
  if (!(t != null && t.length)) return;
1563
- const v = t.map((N) => ({ holeId: N.id || N.holeId })).filter((N) => N.holeId);
1564
- a((N) => {
1565
- const D = new Set(N.map((L) => L.holeId)), F = v.filter((L) => !D.has(L.holeId));
1566
- return F.length ? [...N, ...F] : N;
1766
+ const _ = t.map((y) => ({ holeId: y.id || y.holeId })).filter((y) => y.holeId);
1767
+ a((y) => {
1768
+ const I = new Set(y.map((T) => T.holeId)), F = _.filter((T) => !I.has(T.holeId));
1769
+ return F.length ? [...y, ...F] : y;
1567
1770
  });
1568
- }, [t]), ne(() => {
1569
- H((v) => v && v.startsWith("Loading ") && v.includes(" for hole ") ? v : "");
1570
- }, [E]), ne(() => {
1571
- if (!o.length) {
1572
- A([]);
1771
+ }, [t]), te(() => {
1772
+ H((_) => _ && _.startsWith("Loading ") && _.includes(" for hole ") ? _ : "");
1773
+ }, [L]), te(() => {
1774
+ if (!s.length) {
1775
+ C([]);
1573
1776
  return;
1574
1777
  }
1575
- const v = st(o.map((N) => N.holeId), O);
1576
- A((N) => Array.from({ length: s }).map((F, L) => {
1577
- var K;
1578
- const U = N[L] || {}, B = o.some((ae) => ae.holeId === U.holeId) ? U.holeId : v[L] || ((K = o[L]) == null ? void 0 : K.holeId) || "", $ = U.property || b, q = Se({
1579
- property: $,
1580
- chartType: U.chartType,
1778
+ const _ = st(s.map((y) => y.holeId), $);
1779
+ C((y) => Array.from({ length: r }).map((F, T) => {
1780
+ var X;
1781
+ const x = y[T] || {}, B = s.some((ae) => ae.holeId === x.holeId) ? x.holeId : _[T] || ((X = s[T]) == null ? void 0 : X.holeId) || "", k = x.property || v, q = Se({
1782
+ property: k,
1783
+ chartType: x.chartType,
1581
1784
  categoricalProps: c,
1582
- commentProps: d,
1785
+ commentProps: m,
1583
1786
  numericDefaultChartType: "markers+line"
1584
1787
  });
1585
- return { holeId: B, property: $, chartType: q };
1788
+ return { holeId: B, property: k, chartType: q };
1586
1789
  }));
1587
- }, [o, O, b, c, d, s]), ne(() => {
1790
+ }, [s, $, v, c, m, r]), te(() => {
1588
1791
  if (!n) return;
1589
- E.map((N) => N.holeId).filter(Boolean).forEach((N) => {
1590
- const D = r.some((L) => (L.id || L.holeId) === N), F = R.includes(N);
1591
- D || F || (V((L) => [...L, N]), Dt(n, N).then((L) => {
1592
- V((U) => U.filter((B) => B !== N)), L && i((U) => {
1593
- const B = Ze(
1594
- [...U.filter((q) => (q.id || q.holeId) !== N), L],
1792
+ L.map((y) => y.holeId).filter(Boolean).forEach((y) => {
1793
+ const I = o.some((T) => (T.id || T.holeId) === y), F = R.includes(y);
1794
+ I || F || (G((T) => [...T, y]), $t(n, y).then((T) => {
1795
+ G((x) => x.filter((B) => B !== y)), T && i((x) => {
1796
+ const B = Je(
1797
+ [...x.filter((q) => (q.id || q.holeId) !== y), T],
1595
1798
  t
1596
- ), $ = Le(B);
1597
- return u($.numericProps), m($.categoricalProps), f($.commentProps), y($.columnMeta), !b && $.defaultProp && (h($.defaultProp), A((q) => q.map((K) => ({
1598
- ...K,
1599
- property: K.property || $.defaultProp,
1799
+ ), k = Te(B);
1800
+ return u(k.numericProps), d(k.categoricalProps), f(k.commentProps), p(k.columnMeta), !v && k.defaultProp && (g(k.defaultProp), C((q) => q.map((X) => ({
1801
+ ...X,
1802
+ property: X.property || k.defaultProp,
1600
1803
  chartType: Se({
1601
- property: K.property || $.defaultProp,
1602
- chartType: K.chartType,
1603
- categoricalProps: $.categoricalProps,
1604
- commentProps: $.commentProps,
1804
+ property: X.property || k.defaultProp,
1805
+ chartType: X.chartType,
1806
+ categoricalProps: k.categoricalProps,
1807
+ commentProps: k.commentProps,
1605
1808
  numericDefaultChartType: "markers+line"
1606
1809
  })
1607
1810
  })))), B;
1608
1811
  });
1609
- }).catch((L) => {
1610
- console.error(L), V((U) => U.filter((B) => B !== N)), H(L.message || `Error loading hole ${N}`);
1812
+ }).catch((T) => {
1813
+ console.error(T), G((x) => x.filter((B) => B !== y)), H(T.message || `Error loading hole ${y}`);
1611
1814
  }));
1612
1815
  });
1613
- }, [E, n, r, R, b, t]), ne(() => {
1614
- t != null && t.length && i((v) => {
1615
- if (!v.length) {
1616
- const F = Le(t);
1617
- return u(F.numericProps), m(F.categoricalProps), f(F.commentProps), y(F.columnMeta), !b && F.defaultProp && h(F.defaultProp), t;
1816
+ }, [L, n, o, R, v, t]), te(() => {
1817
+ t != null && t.length && i((_) => {
1818
+ if (!_.length) {
1819
+ const F = Te(t);
1820
+ return u(F.numericProps), d(F.categoricalProps), f(F.commentProps), p(F.columnMeta), !v && F.defaultProp && g(F.defaultProp), t;
1618
1821
  }
1619
- const N = Ze(v, t), D = Le(N);
1620
- return u(D.numericProps), m(D.categoricalProps), f(D.commentProps), y(D.columnMeta), !b && D.defaultProp && h(D.defaultProp), N;
1822
+ const y = Je(_, t), I = Te(y);
1823
+ return u(I.numericProps), d(I.categoricalProps), f(I.commentProps), p(I.columnMeta), !v && I.defaultProp && g(I.defaultProp), y;
1621
1824
  });
1622
1825
  }, [t]);
1623
- const T = ee(
1624
- () => [...l, ...c, ...d],
1625
- [l, c, d]
1626
- ), I = ee(
1627
- () => o.map((v) => ({ holeId: v.holeId, label: v.holeId })).sort((v, N) => v.label.localeCompare(N.label)),
1628
- [o]
1826
+ const P = ee(
1827
+ () => [...l, ...c, ...m],
1828
+ [l, c, m]
1829
+ ), A = ee(
1830
+ () => s.map((_) => ({ holeId: _.holeId, label: _.holeId })).sort((_, y) => _.label.localeCompare(y.label)),
1831
+ [s]
1629
1832
  ), z = ee(() => {
1630
- const v = [...l, ...c, ...d];
1631
- return Array.from({ length: s }).map((N, D) => {
1632
- const F = E[D] || {}, L = r.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, U = L ? v.filter((fe) => At(L, fe)) : v;
1633
- let B = F.property || b;
1634
- L && !U.includes(B) && (B = U[0] || B);
1635
- const $ = d.includes(B), q = !$ && c.includes(B), K = !$ && !q && B === "dip", ae = $ ? "comment" : K ? "tadpole" : q ? "categorical" : "numeric", be = K ? "tadpole" : F.chartType || ($ ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (L == null ? void 0 : L.id) || (L == null ? void 0 : L.holeId) || "", Oe = K ? (L == null ? void 0 : L.points) || [] : $ ? Qt(L, B) : vt(L, B, q);
1833
+ const _ = [...l, ...c, ...m];
1834
+ return Array.from({ length: r }).map((y, I) => {
1835
+ const F = L[I] || {}, T = o.find((fe) => (fe.id || fe.holeId) === F.holeId) || null, x = T ? _.filter((fe) => Lt(T, fe)) : _;
1836
+ let B = F.property || v;
1837
+ T && !x.includes(B) && (B = x[0] || B);
1838
+ const k = m.includes(B), q = !k && c.includes(B), X = !k && !q && B === "dip", ae = k ? "comment" : X ? "tadpole" : q ? "categorical" : "numeric", _e = X ? "tadpole" : F.chartType || (k ? "comment" : q ? "categorical" : "markers+line"), me = F.holeId || (T == null ? void 0 : T.id) || (T == null ? void 0 : T.holeId) || "", Me = X ? (T == null ? void 0 : T.points) || [] : k ? dn(T, B) : It(T, B, q);
1636
1839
  return {
1637
- config: { holeId: me, property: B, chartType: be },
1638
- hole: L,
1840
+ config: { holeId: me, property: B, chartType: _e },
1841
+ hole: T,
1639
1842
  loading: R.includes(F.holeId),
1640
1843
  isCategorical: q,
1641
- isComment: $,
1642
- isTadpole: K,
1844
+ isComment: k,
1845
+ isTadpole: X,
1643
1846
  displayType: ae,
1644
- points: Oe,
1645
- propertyOptions: U,
1847
+ points: Me,
1848
+ propertyOptions: x,
1646
1849
  label: me
1647
1850
  };
1648
1851
  });
1649
- }, [E, r, b, c, d, R, s, l]), w = (v, N) => {
1650
- A((D) => {
1651
- const F = [...D], U = { ...F[v] || {}, ...N };
1652
- return N.property && (U.chartType = Se({
1653
- property: N.property,
1654
- chartType: U.chartType,
1852
+ }, [L, o, v, c, m, R, r, l]), E = (_, y) => {
1853
+ C((I) => {
1854
+ const F = [...I], x = { ...F[_] || {}, ...y };
1855
+ return y.property && (x.chartType = Se({
1856
+ property: y.property,
1857
+ chartType: x.chartType,
1655
1858
  categoricalProps: c,
1656
- commentProps: d,
1859
+ commentProps: m,
1657
1860
  numericDefaultChartType: "markers+line"
1658
- })), F[v] = U, F;
1861
+ })), F[_] = x, F;
1659
1862
  });
1660
1863
  };
1661
1864
  return {
1662
- error: x,
1663
- focusedHoleId: O,
1664
- setFocusedHoleId: P,
1865
+ error: j,
1866
+ focusedHoleId: $,
1867
+ setFocusedHoleId: D,
1665
1868
  setError: H,
1666
- holeCount: o.length,
1869
+ holeCount: s.length,
1667
1870
  numericProps: l,
1668
1871
  categoricalProps: c,
1669
- commentProps: d,
1670
- columnMeta: g,
1671
- propertyOptions: T,
1672
- labeledHoleOptions: I,
1872
+ commentProps: m,
1873
+ columnMeta: b,
1874
+ propertyOptions: P,
1875
+ labeledHoleOptions: A,
1673
1876
  traceGraphs: z,
1674
- handleConfigChange: w
1877
+ handleConfigChange: E
1675
1878
  };
1676
1879
  }
1677
- function mt(e) {
1880
+ function pt(e) {
1678
1881
  return Array.isArray(e) ? e : [];
1679
1882
  }
1680
- function Re(e) {
1883
+ function De(e) {
1681
1884
  const n = Number(e);
1682
1885
  return Number.isFinite(n) ? n : void 0;
1683
1886
  }
1684
- function ft(e = {}) {
1887
+ function gt(e = {}) {
1685
1888
  return {
1686
1889
  ...e,
1687
- x: Re(e.x),
1688
- y: Re(e.y),
1689
- z: Re(e.z)
1890
+ x: De(e.x),
1891
+ y: De(e.y),
1892
+ z: De(e.z)
1690
1893
  };
1691
1894
  }
1692
- function en(e = [], n = [0, 0], t = 0) {
1693
- const [s, r] = n, i = Number(t) * Math.PI / 180, o = Math.cos(i), a = Math.sin(i);
1694
- return mt(e).map(ft).map((l) => {
1895
+ function mn(e = [], n = [0, 0], t = 0) {
1896
+ const [r, o] = n, i = Number(t) * Math.PI / 180, s = Math.cos(i), a = Math.sin(i);
1897
+ return pt(e).map(gt).map((l) => {
1695
1898
  if (!Number.isFinite(l.x) || !Number.isFinite(l.y)) return { ...l };
1696
- const u = l.x - s, c = l.y - r;
1899
+ const u = l.x - r, c = l.y - o;
1697
1900
  return {
1698
1901
  ...l,
1699
- along: u * a + c * o,
1700
- across: u * o - c * a
1902
+ along: u * a + c * s,
1903
+ across: u * s - c * a
1701
1904
  };
1702
1905
  });
1703
1906
  }
1704
- function tn(e = [], n = [0, 0], t = 0, s = 50) {
1705
- const r = en(e, n, t), i = 0.5 * Number(s || 0);
1706
- return !Number.isFinite(i) || i <= 0 ? r : r.filter((o) => Number.isFinite(o.across) && Math.abs(o.across) <= i);
1907
+ function fn(e = [], n = [0, 0], t = 0, r = 50) {
1908
+ const o = mn(e, n, t), i = 0.5 * Number(r || 0);
1909
+ return !Number.isFinite(i) || i <= 0 ? o : o.filter((s) => Number.isFinite(s.across) && Math.abs(s.across) <= i);
1707
1910
  }
1708
- function Zn(e = [], n = null, t = null) {
1709
- let s = mt(e).map(ft);
1911
+ function lr(e = [], n = null, t = null) {
1912
+ let r = pt(e).map(gt);
1710
1913
  if (Array.isArray(n) && n.length === 2) {
1711
- const [r, i] = n;
1712
- s = s.filter((o) => Number.isFinite(o.z) && o.z <= Number(r) && o.z >= Number(i));
1914
+ const [o, i] = n;
1915
+ r = r.filter((s) => Number.isFinite(s.z) && s.z <= Number(o) && s.z >= Number(i));
1713
1916
  }
1714
- return t && (s = s.map((r) => ({
1715
- ...r,
1716
- color_value: r == null ? void 0 : r[t]
1717
- }))), s;
1718
- }
1719
- function Jn(e = [], n = [0, 0], t = 0, s = 50, r = null) {
1720
- let i = tn(e, n, t, s);
1721
- return r && (i = i.map((o) => ({
1917
+ return t && (r = r.map((o) => ({
1722
1918
  ...o,
1723
- color_value: o == null ? void 0 : o[r]
1919
+ color_value: o == null ? void 0 : o[t]
1920
+ }))), r;
1921
+ }
1922
+ function cr(e = [], n = [0, 0], t = 0, r = 50, o = null) {
1923
+ let i = fn(e, n, t, r);
1924
+ return o && (i = i.map((s) => ({
1925
+ ...s,
1926
+ color_value: s == null ? void 0 : s[o]
1724
1927
  }))), i;
1725
1928
  }
1726
- function He(e) {
1929
+ function Ue(e) {
1727
1930
  return Array.isArray(e) ? e : [];
1728
1931
  }
1729
- function Ue(e = {}) {
1932
+ function He(e = {}) {
1730
1933
  return e.hole_id ?? e.holeId ?? e.id;
1731
1934
  }
1732
1935
  function ue(e, n = void 0) {
1733
1936
  const t = Number(e);
1734
1937
  return Number.isFinite(t) ? t : n;
1735
1938
  }
1736
- function Qn(e = [], n = null) {
1939
+ function ur(e = [], n = null) {
1737
1940
  const t = /* @__PURE__ */ new Map();
1738
- He(e).forEach((r) => {
1739
- const i = Ue(r);
1941
+ Ue(e).forEach((o) => {
1942
+ const i = He(o);
1740
1943
  if (i == null || `${i}`.trim() === "") return;
1741
- const o = `${i}`;
1742
- t.has(o) || t.set(o, []), t.get(o).push(r);
1944
+ const s = `${i}`;
1945
+ t.has(s) || t.set(s, []), t.get(s).push(o);
1743
1946
  });
1744
- const s = [];
1745
- return t.forEach((r, i) => {
1746
- const o = [...r].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1947
+ const r = [];
1948
+ return t.forEach((o, i) => {
1949
+ const s = [...o].sort((l, u) => ue(l.md, 0) - ue(u.md, 0)), a = {
1747
1950
  hole_id: i,
1748
- x: o.map((l) => ue(l.x, 0)),
1749
- y: o.map((l) => ue(l.y, 0)),
1750
- z: o.map((l) => ue(l.z, 0)),
1951
+ x: s.map((l) => ue(l.x, 0)),
1952
+ y: s.map((l) => ue(l.y, 0)),
1953
+ z: s.map((l) => ue(l.z, 0)),
1751
1954
  color: null
1752
1955
  };
1753
- n && (a.color = o.map((l) => l == null ? void 0 : l[n])), s.push(a);
1754
- }), s;
1755
- }
1756
- function es(e = [], n = 1, t = null) {
1757
- return He(e).map((s) => ({
1758
- hole_id: Ue(s),
1759
- from: s == null ? void 0 : s.from,
1760
- to: s == null ? void 0 : s.to,
1956
+ n && (a.color = s.map((l) => l == null ? void 0 : l[n])), r.push(a);
1957
+ }), r;
1958
+ }
1959
+ function dr(e = [], n = 1, t = null) {
1960
+ return Ue(e).map((r) => ({
1961
+ hole_id: He(r),
1962
+ from: r == null ? void 0 : r.from,
1963
+ to: r == null ? void 0 : r.to,
1761
1964
  radius: n,
1762
- color: t ? s == null ? void 0 : s[t] : null,
1763
- value: t ? s == null ? void 0 : s[t] : null
1965
+ color: t ? r == null ? void 0 : r[t] : null,
1966
+ value: t ? r == null ? void 0 : r[t] : null
1764
1967
  }));
1765
1968
  }
1766
- function ts(e = [], n = null) {
1767
- return n ? He(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1768
- hole_id: Ue(t),
1969
+ function mr(e = [], n = null) {
1970
+ return n ? Ue(e).filter((t) => Object.prototype.hasOwnProperty.call(t || {}, n)).map((t) => ({
1971
+ hole_id: He(t),
1769
1972
  label: t == null ? void 0 : t[n],
1770
1973
  depth: 0.5 * (ue(t == null ? void 0 : t.from, 0) + ue(t == null ? void 0 : t.to, 0))
1771
1974
  })) : [];
1772
1975
  }
1773
- function ns({
1976
+ function fr({
1774
1977
  controlMode: e = "orbit",
1775
1978
  onToggleFly: n = () => {
1776
1979
  },
1777
1980
  onRecenter: t = () => {
1778
1981
  },
1779
- onLookDown: s = () => {
1982
+ onLookDown: r = () => {
1780
1983
  },
1781
- onFit: r = () => {
1984
+ onFit: o = () => {
1782
1985
  },
1783
1986
  darkBackground: i = !1,
1784
- onToggleDarkBackground: o = () => {
1987
+ onToggleDarkBackground: s = () => {
1785
1988
  }
1786
1989
  }) {
1787
- return /* @__PURE__ */ W("div", { className: "baselode-3d-controls", children: [
1990
+ return /* @__PURE__ */ w("div", { className: "baselode-3d-controls", children: [
1788
1991
  /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: t, children: "Recenter to (0,0,0)" }),
1789
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: s, children: "Look down" }),
1790
- /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Fit to scene" }),
1992
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: r, children: "Look down" }),
1993
+ /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: o, children: "Fit to scene" }),
1791
1994
  /* @__PURE__ */ S("button", { type: "button", className: "ghost-button", onClick: n, children: e === "orbit" ? "Enable fly controls" : "Disable fly controls" }),
1792
- /* @__PURE__ */ W("label", { className: "baselode-3d-controls-checkbox", children: [
1995
+ /* @__PURE__ */ w("label", { className: "baselode-3d-controls-checkbox", children: [
1793
1996
  /* @__PURE__ */ S(
1794
1997
  "input",
1795
1998
  {
1796
1999
  type: "checkbox",
1797
2000
  checked: i,
1798
- onChange: o
2001
+ onChange: s
1799
2002
  }
1800
2003
  ),
1801
2004
  "Dark background"
1802
2005
  ] })
1803
2006
  ] });
1804
2007
  }
1805
- function ss({
2008
+ function hr({
1806
2009
  properties: e = [],
1807
2010
  selectedProperty: n = "",
1808
2011
  onPropertyChange: t = () => {
1809
2012
  },
1810
- opacity: s = 0.85,
1811
- onOpacityChange: r = () => {
2013
+ opacity: r = 0.85,
2014
+ onOpacityChange: o = () => {
1812
2015
  },
1813
2016
  propertyStats: i = null,
1814
- clickedBlock: o = null,
2017
+ clickedBlock: s = null,
1815
2018
  onPopupClose: a = () => {
1816
2019
  }
1817
2020
  }) {
1818
2021
  var l, u;
1819
- return /* @__PURE__ */ W("div", { className: "bm-widget", children: [
2022
+ return /* @__PURE__ */ w("div", { className: "bm-widget", children: [
1820
2023
  /* @__PURE__ */ S("label", { className: "bm-widget__label", htmlFor: "bm-property-select", children: "Color by" }),
1821
- /* @__PURE__ */ W(
2024
+ /* @__PURE__ */ w(
1822
2025
  "select",
1823
2026
  {
1824
2027
  id: "bm-property-select",
@@ -1831,26 +2034,26 @@ function ss({
1831
2034
  ]
1832
2035
  }
1833
2036
  ),
1834
- i && i.type === "numeric" && /* @__PURE__ */ W("div", { className: "bm-widget__scale", children: [
2037
+ i && i.type === "numeric" && /* @__PURE__ */ w("div", { className: "bm-widget__scale", children: [
1835
2038
  /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--min", children: ((l = i.min) == null ? void 0 : l.toFixed(2)) ?? "—" }),
1836
2039
  /* @__PURE__ */ S("div", { className: "bm-widget__scale-bar" }),
1837
2040
  /* @__PURE__ */ S("span", { className: "bm-widget__scale-label bm-widget__scale-label--max", children: ((u = i.max) == null ? void 0 : u.toFixed(2)) ?? "—" })
1838
2041
  ] }),
1839
- i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, m) => {
1840
- const d = Math.round(m / Math.max(i.categories.length, 1) * 360);
2042
+ i && i.type === "categorical" && /* @__PURE__ */ S("div", { className: "bm-widget__categories", children: (i.categories || []).map((c, d) => {
2043
+ const m = Math.round(d / Math.max(i.categories.length, 1) * 360);
1841
2044
  return /* @__PURE__ */ S(
1842
2045
  "span",
1843
2046
  {
1844
2047
  className: "bm-widget__category-chip",
1845
- style: { background: `hsl(${d},70%,50%)` },
2048
+ style: { background: `hsl(${m},70%,50%)` },
1846
2049
  children: c
1847
2050
  },
1848
2051
  c
1849
2052
  );
1850
2053
  }) }),
1851
- /* @__PURE__ */ W("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
2054
+ /* @__PURE__ */ w("label", { className: "bm-widget__label", htmlFor: "bm-opacity-slider", children: [
1852
2055
  "Opacity (",
1853
- Math.round(s * 100),
2056
+ Math.round(r * 100),
1854
2057
  "%)"
1855
2058
  ] }),
1856
2059
  /* @__PURE__ */ S(
@@ -1862,12 +2065,12 @@ function ss({
1862
2065
  min: "0",
1863
2066
  max: "1",
1864
2067
  step: "0.01",
1865
- value: s,
1866
- onChange: (c) => r(parseFloat(c.target.value))
2068
+ value: r,
2069
+ onChange: (c) => o(parseFloat(c.target.value))
1867
2070
  }
1868
2071
  ),
1869
- o && /* @__PURE__ */ W("div", { className: "bm-widget__popup", children: [
1870
- /* @__PURE__ */ W("div", { className: "bm-widget__popup-header", children: [
2072
+ s && /* @__PURE__ */ w("div", { className: "bm-widget__popup", children: [
2073
+ /* @__PURE__ */ w("div", { className: "bm-widget__popup-header", children: [
1871
2074
  /* @__PURE__ */ S("span", { children: "Block attributes" }),
1872
2075
  /* @__PURE__ */ S(
1873
2076
  "button",
@@ -1880,159 +2083,159 @@ function ss({
1880
2083
  }
1881
2084
  )
1882
2085
  ] }),
1883
- /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(o).map(([c, m]) => /* @__PURE__ */ W("tr", { children: [
2086
+ /* @__PURE__ */ S("table", { className: "bm-widget__popup-table", children: /* @__PURE__ */ S("tbody", { children: Object.entries(s).map(([c, d]) => /* @__PURE__ */ w("tr", { children: [
1884
2087
  /* @__PURE__ */ S("th", { children: c }),
1885
- /* @__PURE__ */ S("td", { children: m == null ? "—" : String(m) })
2088
+ /* @__PURE__ */ S("td", { children: d == null ? "—" : String(d) })
1886
2089
  ] }, c)) }) })
1887
2090
  ] })
1888
2091
  ] });
1889
2092
  }
1890
- const nn = [
2093
+ const hn = [
1891
2094
  { minZoom: 0, lodKey: "thumb" },
1892
2095
  { minZoom: 4, lodKey: "medium" },
1893
2096
  { minZoom: 7, lodKey: "full" }
1894
- ], ht = 50;
1895
- function sn(e, n, t = nn) {
2097
+ ], bt = 50;
2098
+ function pn(e, n, t = hn) {
1896
2099
  var i;
1897
- const s = e.lod_urls;
1898
- if (!s || typeof s != "object" || Array.isArray(s))
2100
+ const r = e.lod_urls;
2101
+ if (!r || typeof r != "object" || Array.isArray(r))
1899
2102
  return e.image_url || "";
1900
- let r = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
1901
- for (const o of t)
1902
- n >= o.minZoom && (r = o.lodKey);
1903
- return s[r] || e.image_url || "";
2103
+ let o = ((i = t[0]) == null ? void 0 : i.lodKey) ?? "thumb";
2104
+ for (const s of t)
2105
+ n >= s.minZoom && (o = s.lodKey);
2106
+ return r[o] || e.image_url || "";
1904
2107
  }
1905
- function rn(e) {
2108
+ function gn(e) {
1906
2109
  return [...e].sort((n, t) => (n.from_depth ?? 0) - (t.from_depth ?? 0));
1907
2110
  }
1908
- function on(e) {
2111
+ function bn(e) {
1909
2112
  const n = {};
1910
2113
  for (const t of e) {
1911
- const s = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
1912
- n[s] || (n[s] = []), n[s].push(t);
2114
+ const r = t.photo_set != null && t.photo_set !== "" ? String(t.photo_set) : "default";
2115
+ n[r] || (n[r] = []), n[r].push(t);
1913
2116
  }
1914
2117
  return n;
1915
2118
  }
1916
- function an(e, n, t = 10) {
1917
- const s = [];
1918
- if (e >= n || t <= 0) return s;
1919
- const r = Math.ceil(e / t) * t, i = t * 1e-9;
1920
- for (let o = r; o <= n + i; o += t) {
1921
- const a = Math.round(o * 1e6) / 1e6;
1922
- s.push({ depth: a, label: `${a} m` });
2119
+ function yn(e, n, t = 10) {
2120
+ const r = [];
2121
+ if (e >= n || t <= 0) return r;
2122
+ const o = Math.ceil(e / t) * t, i = t * 1e-9;
2123
+ for (let s = o; s <= n + i; s += t) {
2124
+ const a = Math.round(s * 1e6) / 1e6;
2125
+ r.push({ depth: a, label: `${a} m` });
1923
2126
  }
1924
- return s;
2127
+ return r;
1925
2128
  }
1926
- function ln(e) {
2129
+ function _n(e) {
1927
2130
  return e >= 9 ? 1 : e >= 7 ? 2 : e >= 5 ? 5 : e >= 3 ? 10 : 20;
1928
2131
  }
1929
- function pt(e) {
2132
+ function yt(e) {
1930
2133
  return `tray_${String(e).padStart(3, "0")}.jpg`;
1931
2134
  }
1932
- function cn(e, n, t, s, r = "Tray Images", i = pt) {
1933
- const o = (t ?? "").replace(/\/$/, ""), a = (s ?? "").replace(/\/$/, "");
2135
+ function Nn(e, n, t, r, o = "Tray Images", i = yt) {
2136
+ const s = (t ?? "").replace(/\/$/, ""), a = (r ?? "").replace(/\/$/, "");
1934
2137
  return n.map((l, u) => {
1935
- const c = l.filename ?? i(u), m = l.photoSet ?? r;
2138
+ const c = l.filename ?? i(u), d = l.photoSet ?? o;
1936
2139
  return {
1937
2140
  hole_id: e,
1938
2141
  from_depth: l.fromDepth,
1939
2142
  to_depth: l.toDepth,
1940
- photo_set: m,
1941
- image_url: `${o}/${c}`,
2143
+ photo_set: d,
2144
+ image_url: `${s}/${c}`,
1942
2145
  lod_urls: {
1943
- thumb: `${o}/${c}`,
2146
+ thumb: `${s}/${c}`,
1944
2147
  full: `${a}/${c}`
1945
2148
  }
1946
2149
  };
1947
2150
  });
1948
2151
  }
1949
- function rs(e, n, t = ht) {
1950
- const s = n / 5;
1951
- return Math.max(1, Math.round(e * t * s));
2152
+ function pr(e, n, t = bt) {
2153
+ const r = n / 5;
2154
+ return Math.max(1, Math.round(e * t * r));
1952
2155
  }
1953
- const ze = 5, Je = 1.12, un = 0.05, dn = 40;
1954
- function mn({
2156
+ const Re = 5, Qe = 1.12, vn = 0.05, En = 40;
2157
+ function An({
1955
2158
  photos: e = [],
1956
2159
  holeId: n = "",
1957
2160
  initialZoom: t = 5,
1958
- transform: s,
1959
- onTransformChange: r
2161
+ transform: r,
2162
+ onTransformChange: o
1960
2163
  }) {
1961
- const [i, o] = X({ scale: 1, tx: 0, ty: 0 }), a = s ?? i, l = _e(a);
2164
+ const [i, s] = K({ scale: 1, tx: 0, ty: 0 }), a = r ?? i, l = ye(a);
1962
2165
  l.current = a;
1963
- const u = De(
1964
- (p) => {
1965
- const T = typeof p == "function" ? p(l.current) : p;
1966
- r ? r(T) : o(T);
2166
+ const u = Pe(
2167
+ (h) => {
2168
+ const P = typeof h == "function" ? h(l.current) : h;
2169
+ o ? o(P) : s(P);
1967
2170
  },
1968
- [r]
1969
- ), [c, m] = X(!1), d = _e(null), f = _e(null), g = ee(() => rn(e), [e]), y = ee(() => on(g), [g]), b = ee(() => {
1970
- const p = /* @__PURE__ */ new Set();
1971
- for (const T of e) {
1972
- const I = T.photo_set != null && T.photo_set !== "" ? String(T.photo_set) : "default";
1973
- p.add(I);
2171
+ [o]
2172
+ ), [c, d] = K(!1), m = ye(null), f = ye(null), b = ee(() => gn(e), [e]), p = ee(() => bn(b), [b]), v = ee(() => {
2173
+ const h = /* @__PURE__ */ new Set();
2174
+ for (const P of e) {
2175
+ const A = P.photo_set != null && P.photo_set !== "" ? String(P.photo_set) : "default";
2176
+ h.add(A);
1974
2177
  }
1975
- return [...p];
1976
- }, [e]), { minDepth: h, maxDepth: E } = ee(() => {
1977
- if (!g.length) return { minDepth: 0, maxDepth: 0 };
1978
- const p = g.map((T) => T.to_depth ?? T.from_depth ?? 0);
2178
+ return [...h];
2179
+ }, [e]), { minDepth: g, maxDepth: L } = ee(() => {
2180
+ if (!b.length) return { minDepth: 0, maxDepth: 0 };
2181
+ const h = b.map((P) => P.to_depth ?? P.from_depth ?? 0);
1979
2182
  return {
1980
- minDepth: g[0].from_depth ?? 0,
1981
- maxDepth: Math.max(...p)
2183
+ minDepth: b[0].from_depth ?? 0,
2184
+ maxDepth: Math.max(...h)
1982
2185
  };
1983
- }, [g]), A = ht * ze / 5, x = ee(
1984
- () => Math.max(1, Math.round((E - h) * A)),
1985
- [h, E, A]
2186
+ }, [b]), C = bt * Re / 5, j = ee(
2187
+ () => Math.max(1, Math.round((L - g) * C)),
2188
+ [g, L, C]
1986
2189
  ), H = ee(() => {
1987
- const p = ln(ze);
1988
- return an(h, E, p);
1989
- }, [h, E]), O = 540 * ze / 5, P = ee(
2190
+ const h = _n(Re);
2191
+ return yn(g, L, h);
2192
+ }, [g, L]), $ = 540 * Re / 5, D = ee(
1990
2193
  () => Math.max(1, Math.min(10, Math.round(t * a.scale))),
1991
2194
  [t, a.scale]
1992
- ), R = De((p) => {
1993
- p.preventDefault();
1994
- const T = p.deltaY < 0 ? Je : 1 / Je, I = f.current.getBoundingClientRect(), z = p.clientX - I.left, w = p.clientY - I.top;
1995
- u((v) => {
1996
- const N = Math.max(un, Math.min(dn, v.scale * T)), D = N / v.scale;
2195
+ ), R = Pe((h) => {
2196
+ h.preventDefault();
2197
+ const P = h.deltaY < 0 ? Qe : 1 / Qe, A = f.current.getBoundingClientRect(), z = h.clientX - A.left, E = h.clientY - A.top;
2198
+ u((_) => {
2199
+ const y = Math.max(vn, Math.min(En, _.scale * P)), I = y / _.scale;
1997
2200
  return {
1998
- scale: N,
1999
- tx: z - (z - v.tx) * D,
2000
- ty: w - (w - v.ty) * D
2201
+ scale: y,
2202
+ tx: z - (z - _.tx) * I,
2203
+ ty: E - (E - _.ty) * I
2001
2204
  };
2002
2205
  });
2003
2206
  }, [u]);
2004
- ne(() => {
2005
- const p = f.current;
2006
- if (p)
2007
- return p.addEventListener("wheel", R, { passive: !1 }), () => p.removeEventListener("wheel", R);
2207
+ te(() => {
2208
+ const h = f.current;
2209
+ if (h)
2210
+ return h.addEventListener("wheel", R, { passive: !1 }), () => h.removeEventListener("wheel", R);
2008
2211
  }, [R]);
2009
- const V = De((p) => {
2010
- p.button === 0 && (p.preventDefault(), d.current = {
2011
- x: p.clientX,
2012
- y: p.clientY,
2212
+ const G = Pe((h) => {
2213
+ h.button === 0 && (h.preventDefault(), m.current = {
2214
+ x: h.clientX,
2215
+ y: h.clientY,
2013
2216
  tx: l.current.tx,
2014
2217
  ty: l.current.ty
2015
- }, m(!0));
2218
+ }, d(!0));
2016
2219
  }, []);
2017
- return ne(() => {
2018
- const p = (I) => {
2019
- if (!d.current) return;
2020
- const { tx: z, ty: w, x: v, y: N } = d.current;
2021
- u((D) => ({
2022
- ...D,
2023
- tx: z + (I.clientX - v),
2024
- ty: w + (I.clientY - N)
2220
+ return te(() => {
2221
+ const h = (A) => {
2222
+ if (!m.current) return;
2223
+ const { tx: z, ty: E, x: _, y } = m.current;
2224
+ u((I) => ({
2225
+ ...I,
2226
+ tx: z + (A.clientX - _),
2227
+ ty: E + (A.clientY - y)
2025
2228
  }));
2026
- }, T = () => {
2027
- d.current = null, m(!1);
2229
+ }, P = () => {
2230
+ m.current = null, d(!1);
2028
2231
  };
2029
- return window.addEventListener("mousemove", p), window.addEventListener("mouseup", T), () => {
2030
- window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", T);
2232
+ return window.addEventListener("mousemove", h), window.addEventListener("mouseup", P), () => {
2233
+ window.removeEventListener("mousemove", h), window.removeEventListener("mouseup", P);
2031
2234
  };
2032
- }, [u]), /* @__PURE__ */ W("div", { className: "core-photo-table", children: [
2033
- /* @__PURE__ */ W("div", { className: "core-photo-controls", children: [
2235
+ }, [u]), /* @__PURE__ */ w("div", { className: "core-photo-table", children: [
2236
+ /* @__PURE__ */ w("div", { className: "core-photo-controls", children: [
2034
2237
  n && /* @__PURE__ */ S("span", { className: "core-photo-hole-id", children: n }),
2035
- /* @__PURE__ */ W("span", { className: "core-photo-zoom-label", children: [
2238
+ /* @__PURE__ */ w("span", { className: "core-photo-zoom-label", children: [
2036
2239
  Math.round(a.scale * 100),
2037
2240
  "%"
2038
2241
  ] }),
@@ -2047,16 +2250,16 @@ function mn({
2047
2250
  }
2048
2251
  )
2049
2252
  ] }),
2050
- e.length > 0 && /* @__PURE__ */ W("div", { className: "core-photo-col-headers", children: [
2253
+ e.length > 0 && /* @__PURE__ */ w("div", { className: "core-photo-col-headers", children: [
2051
2254
  /* @__PURE__ */ S("div", { className: "core-photo-ruler-spacer" }),
2052
- b.map((p) => /* @__PURE__ */ S(
2255
+ v.map((h) => /* @__PURE__ */ S(
2053
2256
  "div",
2054
2257
  {
2055
2258
  className: "core-photo-set-header",
2056
- style: { width: O },
2057
- children: p
2259
+ style: { width: $ },
2260
+ children: h
2058
2261
  },
2059
- p
2262
+ h
2060
2263
  ))
2061
2264
  ] }),
2062
2265
  e.length === 0 ? /* @__PURE__ */ S("div", { className: "core-photo-empty", children: "No photos to display." }) : /* @__PURE__ */ S(
@@ -2064,13 +2267,13 @@ function mn({
2064
2267
  {
2065
2268
  className: `core-photo-scroll${c ? " is-dragging" : ""}`,
2066
2269
  ref: f,
2067
- onMouseDown: V,
2068
- children: /* @__PURE__ */ W(
2270
+ onMouseDown: G,
2271
+ children: /* @__PURE__ */ w(
2069
2272
  "div",
2070
2273
  {
2071
2274
  className: "core-photo-inner",
2072
2275
  style: {
2073
- height: x,
2276
+ height: j,
2074
2277
  transform: `translate(${a.tx}px, ${a.ty}px) scale(${a.scale})`,
2075
2278
  transformOrigin: "0 0"
2076
2279
  },
@@ -2079,60 +2282,60 @@ function mn({
2079
2282
  "div",
2080
2283
  {
2081
2284
  className: "core-photo-depth-ruler",
2082
- style: { height: x },
2083
- children: H.map(({ depth: p, label: T }) => /* @__PURE__ */ S(
2285
+ style: { height: j },
2286
+ children: H.map(({ depth: h, label: P }) => /* @__PURE__ */ S(
2084
2287
  "div",
2085
2288
  {
2086
2289
  className: "core-photo-depth-marker",
2087
2290
  style: {
2088
- top: Math.round((p - h) * A)
2291
+ top: Math.round((h - g) * C)
2089
2292
  },
2090
- children: T
2293
+ children: P
2091
2294
  },
2092
- p
2295
+ h
2093
2296
  ))
2094
2297
  }
2095
2298
  ),
2096
- b.map((p) => /* @__PURE__ */ S(
2299
+ v.map((h) => /* @__PURE__ */ S(
2097
2300
  "div",
2098
2301
  {
2099
2302
  className: "core-photo-col-body",
2100
- style: { height: x, width: O },
2101
- children: y[p].map((T) => {
2102
- const I = T.from_depth ?? 0, z = T.to_depth ?? I, w = Math.round(
2103
- (I - h) * A
2104
- ), v = Math.max(
2303
+ style: { height: j, width: $ },
2304
+ children: p[h].map((P) => {
2305
+ const A = P.from_depth ?? 0, z = P.to_depth ?? A, E = Math.round(
2306
+ (A - g) * C
2307
+ ), _ = Math.max(
2105
2308
  2,
2106
- Math.round((z - I) * A)
2107
- ), N = sn(T, P);
2108
- return /* @__PURE__ */ W(
2309
+ Math.round((z - A) * C)
2310
+ ), y = pn(P, D);
2311
+ return /* @__PURE__ */ w(
2109
2312
  "div",
2110
2313
  {
2111
2314
  className: "core-photo-item",
2112
- style: { top: w, height: v, width: O },
2113
- title: `${I}–${z} m`,
2315
+ style: { top: E, height: _, width: $ },
2316
+ title: `${A}–${z} m`,
2114
2317
  children: [
2115
- N ? /* @__PURE__ */ S(
2318
+ y ? /* @__PURE__ */ S(
2116
2319
  "img",
2117
2320
  {
2118
- src: N,
2119
- alt: `Core ${I}–${z} m`,
2321
+ src: y,
2322
+ alt: `Core ${A}–${z} m`,
2120
2323
  loading: "lazy"
2121
2324
  }
2122
2325
  ) : /* @__PURE__ */ S("div", { className: "core-photo-no-image" }),
2123
- v >= 18 && /* @__PURE__ */ W("span", { className: "core-photo-item-label", children: [
2124
- I,
2326
+ _ >= 18 && /* @__PURE__ */ w("span", { className: "core-photo-item-label", children: [
2327
+ A,
2125
2328
  "–",
2126
2329
  z,
2127
2330
  " m"
2128
2331
  ] })
2129
2332
  ]
2130
2333
  },
2131
- `${T.hole_id ?? ""}-${I}-${z}-${p}`
2334
+ `${P.hole_id ?? ""}-${A}-${z}-${h}`
2132
2335
  );
2133
2336
  })
2134
2337
  },
2135
- p
2338
+ h
2136
2339
  ))
2137
2340
  ]
2138
2341
  }
@@ -2141,33 +2344,33 @@ function mn({
2141
2344
  )
2142
2345
  ] });
2143
2346
  }
2144
- function os({
2347
+ function gr({
2145
2348
  holeId: e = "",
2146
2349
  trays: n = [],
2147
2350
  thumbBaseUrl: t = "",
2148
- fullBaseUrl: s = "",
2149
- photoSet: r = "Tray Images",
2150
- getFilename: i = pt,
2151
- initialZoom: o = 5,
2351
+ fullBaseUrl: r = "",
2352
+ photoSet: o = "Tray Images",
2353
+ getFilename: i = yt,
2354
+ initialZoom: s = 5,
2152
2355
  transform: a,
2153
2356
  onTransformChange: l
2154
2357
  }) {
2155
2358
  const u = ee(
2156
- () => cn(e, n, t, s, r, i),
2157
- [e, n, t, s, r, i]
2359
+ () => Nn(e, n, t, r, o, i),
2360
+ [e, n, t, r, o, i]
2158
2361
  );
2159
2362
  return /* @__PURE__ */ S(
2160
- mn,
2363
+ An,
2161
2364
  {
2162
2365
  photos: u,
2163
2366
  holeId: e,
2164
- initialZoom: o,
2367
+ initialZoom: s,
2165
2368
  transform: a,
2166
2369
  onTransformChange: l
2167
2370
  }
2168
2371
  );
2169
2372
  }
2170
- function is(e) {
2373
+ function br(e) {
2171
2374
  const n = typeof e == "string" ? JSON.parse(e) : e;
2172
2375
  if (n.schema_version !== "1.0")
2173
2376
  throw new Error(
@@ -2175,18 +2378,18 @@ function is(e) {
2175
2378
  );
2176
2379
  if (!Array.isArray(n.blocks))
2177
2380
  throw new Error('"blocks" must be a JSON array.');
2178
- const t = n.blocks.map((s, r) => {
2179
- if (s.id == null) throw new Error(`Block at index ${r} is missing required field "id".`);
2180
- if (s.name == null) throw new Error(`Block "${s.id}" is missing required field "name".`);
2181
- if (!Array.isArray(s.vertices)) throw new Error(`Block "${s.id}" is missing required field "vertices".`);
2182
- if (!Array.isArray(s.triangles)) throw new Error(`Block "${s.id}" is missing required field "triangles".`);
2381
+ const t = n.blocks.map((r, o) => {
2382
+ if (r.id == null) throw new Error(`Block at index ${o} is missing required field "id".`);
2383
+ if (r.name == null) throw new Error(`Block "${r.id}" is missing required field "name".`);
2384
+ if (!Array.isArray(r.vertices)) throw new Error(`Block "${r.id}" is missing required field "vertices".`);
2385
+ if (!Array.isArray(r.triangles)) throw new Error(`Block "${r.id}" is missing required field "triangles".`);
2183
2386
  return {
2184
- id: s.id,
2185
- name: s.name,
2186
- vertices: s.vertices,
2187
- triangles: s.triangles,
2188
- attributes: s.attributes ?? {},
2189
- material: s.material ?? {}
2387
+ id: r.id,
2388
+ name: r.name,
2389
+ vertices: r.vertices,
2390
+ triangles: r.triangles,
2391
+ attributes: r.attributes ?? {},
2392
+ material: r.material ?? {}
2190
2393
  };
2191
2394
  });
2192
2395
  return {
@@ -2195,244 +2398,249 @@ function is(e) {
2195
2398
  blocks: t
2196
2399
  };
2197
2400
  }
2198
- function fn(e) {
2401
+ function Sn(e) {
2199
2402
  const n = new Q.BufferGeometry(), t = new Float32Array(e.vertices.length * 3);
2200
- e.vertices.forEach(([r, i, o], a) => {
2201
- t[a * 3] = r, t[a * 3 + 1] = i, t[a * 3 + 2] = o;
2403
+ e.vertices.forEach(([o, i, s], a) => {
2404
+ t[a * 3] = o, t[a * 3 + 1] = i, t[a * 3 + 2] = s;
2202
2405
  }), n.setAttribute("position", new Q.BufferAttribute(t, 3));
2203
- const s = new Uint32Array(e.triangles.length * 3);
2204
- return e.triangles.forEach(([r, i, o], a) => {
2205
- s[a * 3] = r, s[a * 3 + 1] = i, s[a * 3 + 2] = o;
2206
- }), n.setIndex(new Q.BufferAttribute(s, 1)), n;
2406
+ const r = new Uint32Array(e.triangles.length * 3);
2407
+ return e.triangles.forEach(([o, i, s], a) => {
2408
+ r[a * 3] = o, r[a * 3 + 1] = i, r[a * 3 + 2] = s;
2409
+ }), n.setIndex(new Q.BufferAttribute(r, 1)), n;
2207
2410
  }
2208
- function as(e, n, t = {}) {
2209
- const { defaultOpacity: s = 1 } = t, r = new Q.Group();
2411
+ function yr(e, n, t = {}) {
2412
+ const { defaultOpacity: r = 1 } = t, o = new Q.Group();
2210
2413
  return n.blocks.forEach((i) => {
2211
- var y, b;
2212
- const o = fn(i), a = ((y = i.material) == null ? void 0 : y.color) ?? "#888888", l = ((b = i.material) == null ? void 0 : b.opacity) ?? s, u = l < 1, c = new Q.MeshStandardMaterial({
2414
+ var p, v;
2415
+ const s = Sn(i), a = ((p = i.material) == null ? void 0 : p.color) ?? "#888888", l = ((v = i.material) == null ? void 0 : v.opacity) ?? r, u = l < 1, c = new Q.MeshStandardMaterial({
2213
2416
  color: new Q.Color(a),
2214
2417
  opacity: l,
2215
2418
  transparent: u,
2216
2419
  side: Q.DoubleSide,
2217
2420
  flatShading: !0
2218
- }), m = new Q.Mesh(o, c);
2219
- m.userData = {
2421
+ }), d = new Q.Mesh(s, c);
2422
+ d.userData = {
2220
2423
  id: i.id,
2221
2424
  attributes: i.attributes
2222
2425
  };
2223
- const d = new Q.EdgesGeometry(o, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), g = new Q.LineSegments(d, f);
2224
- g.visible = !1, m.add(g), r.add(m);
2225
- }), e.add(r), r;
2426
+ const m = new Q.EdgesGeometry(s, 15), f = new Q.LineBasicMaterial({ color: "#ffffbb", linewidth: 1 }), b = new Q.LineSegments(m, f);
2427
+ b.visible = !1, d.add(b), o.add(d);
2428
+ }), e.add(o), o;
2226
2429
  }
2227
2430
  export {
2228
- us as ALPHA,
2229
- ds as ASSAY_COLOR_PALETTE_10,
2230
- It as ASSAY_NON_VALUE_FIELDS,
2231
- j as AZIMUTH,
2232
- ms as BASELODE_COLORWAY,
2233
- fs as BASELODE_DARK,
2234
- hs as BASELODE_DARK_TEMPLATE,
2235
- ps as BASELODE_DARK_TEMPLATE_NAME,
2236
- ys as BASELODE_DATA_MODEL_DRILL_ASSAY,
2237
- gs as BASELODE_DATA_MODEL_DRILL_COLLAR,
2238
- _t as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2239
- bs as BASELODE_DATA_MODEL_DRILL_SURVEY,
2240
- _s as BASELODE_DATA_MODEL_GEOPHYSICS,
2241
- Ns as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2242
- Es as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2243
- As as BASELODE_LIGHT,
2244
- vs as BASELODE_LIGHT_TEMPLATE,
2245
- Is as BASELODE_LIGHT_TEMPLATE_NAME,
2431
+ vr as ALPHA,
2432
+ Er as ASSAY_COLOR_PALETTE_10,
2433
+ Mt as ASSAY_NON_VALUE_FIELDS,
2434
+ Y as AZIMUTH,
2435
+ Ar as BASELODE_COLORWAY,
2436
+ Sr as BASELODE_DARK,
2437
+ Tr as BASELODE_DARK_TEMPLATE,
2438
+ Lr as BASELODE_DARK_TEMPLATE_NAME,
2439
+ Ir as BASELODE_DATA_MODEL_DRILL_ASSAY,
2440
+ Cr as BASELODE_DATA_MODEL_DRILL_COLLAR,
2441
+ Et as BASELODE_DATA_MODEL_DRILL_GEOLOGY,
2442
+ Mr as BASELODE_DATA_MODEL_DRILL_SURVEY,
2443
+ Pr as BASELODE_DATA_MODEL_GEOPHYSICS,
2444
+ Or as BASELODE_DATA_MODEL_STRUCTURAL_POINT,
2445
+ xr as BASELODE_DATA_MODEL_SURFACE_SAMPLE,
2446
+ Dr as BASELODE_LIGHT,
2447
+ Rr as BASELODE_LIGHT_TEMPLATE,
2448
+ zr as BASELODE_LIGHT_TEMPLATE_NAME,
2246
2449
  $e as BASELODE_TEMPLATE,
2247
- Ss as BASELODE_TEMPLATE_NAME,
2248
- ht as BASE_PIXELS_PER_METRE,
2249
- Ls as BETA,
2250
- Cs as BUILTIN_COLOUR_MAPS,
2251
- ns as Baselode3DControls,
2252
- Ts as Baselode3DScene,
2253
- ss as BlockModelWidget,
2254
- Ms as CHART_OPTIONS,
2255
- Os as COLLAR_ID,
2256
- Ps as COMMENTS,
2257
- Ds as COMMENT_COLUMN_NAMES,
2258
- xs as COMMODITY_COLOURS,
2259
- Rs as CRS,
2260
- mn as CorePhotoTable,
2261
- os as CorePhotoViewer,
2262
- zs as DATASOURCE,
2263
- Fs as DATASOURCE_HOLE_ID,
2264
- $s as DATASOURCE_SAMPLE_ID,
2265
- ks as DATASOURCE_SURFACE_SAMPLE_ID,
2266
- ws as DATE_END,
2267
- Hs as DATE_START,
2268
- Us as DEFAULT_COLUMN_MAP,
2269
- nn as DEFAULT_LOD_BREAKPOINTS,
2270
- G as DEPTH,
2271
- Y as DIP,
2272
- Be as DISPLAY_CATEGORICAL,
2273
- Pe as DISPLAY_COMMENT,
2274
- Bs as DISPLAY_HIDDEN,
2275
- Nt as DISPLAY_NUMERIC,
2276
- Ge as DISPLAY_TADPOLE,
2450
+ Fr as BASELODE_TEMPLATE_NAME,
2451
+ bt as BASE_PIXELS_PER_METRE,
2452
+ $r as BETA,
2453
+ kr as BUILTIN_COLOUR_MAPS,
2454
+ fr as Baselode3DControls,
2455
+ wr as Baselode3DScene,
2456
+ hr as BlockModelWidget,
2457
+ Ur as CHART_OPTIONS,
2458
+ Hr as COLLAR_ID,
2459
+ Gr as COMMENTS,
2460
+ Br as COMMENT_COLUMN_NAMES,
2461
+ Vr as COMMODITY_COLOURS,
2462
+ jr as CRS,
2463
+ An as CorePhotoTable,
2464
+ gr as CorePhotoViewer,
2465
+ Yr as DATASOURCE,
2466
+ Wr as DATASOURCE_HOLE_ID,
2467
+ qr as DATASOURCE_SAMPLE_ID,
2468
+ Xr as DATASOURCE_SURFACE_SAMPLE_ID,
2469
+ Kr as DATE_END,
2470
+ Zr as DATE_START,
2471
+ Jr as DEFAULT_ATTRIBUTE_COLUMN,
2472
+ Qr as DEFAULT_COLUMN_MAP,
2473
+ hn as DEFAULT_LOD_BREAKPOINTS,
2474
+ eo as DEFAULT_UNIT_COLUMN,
2475
+ V as DEPTH,
2476
+ W as DIP,
2477
+ Ge as DISPLAY_CATEGORICAL,
2478
+ ze as DISPLAY_COMMENT,
2479
+ to as DISPLAY_HIDDEN,
2480
+ At as DISPLAY_NUMERIC,
2481
+ tt as DISPLAY_TADPOLE,
2277
2482
  pe as EASTING,
2278
- ve as ELEVATION,
2279
- Gs as ERROR_COLOR,
2280
- Vs as EXTRA,
2281
- js as FALLBACK_COLOUR,
2282
- Ys as FOV_MAX_DEG,
2283
- Ws as FOV_MIN_DEG,
2284
- C as FROM,
2483
+ Ee as ELEVATION,
2484
+ no as ERROR_COLOR,
2485
+ ro as EXTRA,
2486
+ oo as FALLBACK_COLOUR,
2487
+ so as FOV_MAX_DEG,
2488
+ io as FOV_MIN_DEG,
2489
+ M as FROM,
2285
2490
  le as GEOLOGY_CODE,
2286
2491
  ce as GEOLOGY_DESCRIPTION,
2287
- qs as GEOPHYSICS_NULL,
2288
- Qe as GEOPHYSICS_NULL_SENTINEL,
2289
- Ks as HIDDEN_COLUMNS,
2290
- _ as HOLE_ID,
2291
- Xs as HOLE_TYPE,
2292
- se as LATITUDE,
2293
- Zs as LITHOLOGY_COLOURS,
2294
- re as LONGITUDE,
2295
- Js as MAX_DEPTH,
2296
- Ee as MID,
2297
- ye as NORTHING,
2298
- Qs as NUMERIC_LINE_COLOR,
2299
- er as NUMERIC_MARKER_COLOR,
2492
+ ao as GEOPHYSICS_NULL,
2493
+ et as GEOPHYSICS_NULL_SENTINEL,
2494
+ lo as HIDDEN_COLUMNS,
2495
+ N as HOLE_ID,
2496
+ co as HOLE_TYPE,
2497
+ re as LATITUDE,
2498
+ uo as LITHOLOGY_COLOURS,
2499
+ oe as LONGITUDE,
2500
+ mo as MAX_DEPTH,
2501
+ ve as MID,
2502
+ ge as NORTHING,
2503
+ fo as NUMERIC_LINE_COLOR,
2504
+ ho as NUMERIC_MARKER_COLOR,
2300
2505
  de as PROJECT_ID,
2301
- tr as REPORT_NUMBER,
2302
- nr as SAMPLE_ID,
2303
- sr as STRIKE,
2304
- rr as STRIP_LOG_DEFAULT_COLOR,
2305
- or as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2306
- ir as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2307
- ar as SURFACE_SAMPLE_ID,
2308
- lr as SURFACE_SAMPLE_TYPE,
2309
- cr as SURVEY_TYPE,
2310
- M as TO,
2311
- Kn as TracePlot,
2312
- as as addGradeBlocksToScene,
2313
- ur as addRasterOverlay,
2314
- dr as alphaBetaToNormal,
2315
- ts as annotationsFromIntervals,
2316
- kn as assembleDataset,
2317
- Mn as attachAssayPositions,
2318
- Cn as balancedTangentialDesurvey,
2319
- xt as buildAssayState,
2320
- mr as buildCategoricalStripLogConfig,
2321
- Zt as buildCommentsConfig,
2322
- an as buildDepthMarkers,
2323
- fr as buildEqualRangeColorScale,
2324
- vt as buildIntervalPoints,
2325
- Et as buildPlotConfig,
2326
- qn as buildStrikeDipSymbol,
2327
- hr as buildStripLogGroup,
2328
- pr as buildStripLogLinePoints,
2329
- yr as buildStructuralDiscs,
2330
- Wn as buildStructuralStripConfig,
2331
- Xt as buildTadpoleConfig,
2332
- Tn as buildTraces,
2333
- cn as buildTrayPhotos,
2334
- gr as buildViewSignature,
2335
- br as calculateBlockVolume,
2336
- _r as calculatePropertyStats,
2337
- bt as classifyColumns,
2338
- Nr as clearRasterOverlays,
2339
- Er as clearStripLogs,
2340
- $n as coerceNumeric,
2341
- Ar as computeStructuralPositions,
2342
- vr as createRasterOverlay,
2343
- Ir as defaultChartType,
2344
- pt as defaultTrayFilename,
2345
- rs as depthIntervalToPixels,
2346
- ln as depthMarkerInterval,
2347
- Le as deriveAssayProps,
2348
- Sn as desurveyTraces,
2349
- Sr as dipAzimuthToNormal,
2350
- Lr as dolly,
2351
- Cr as emitViewChangeIfNeeded,
2352
- Tr as filterBlocks,
2353
- Fn as filterByProject,
2354
- Mr as fitCameraToBounds,
2355
- Or as focusOnLastBounds,
2356
- jn as geophysicsToStripLogs,
2357
- Pr as getBlockStats,
2358
- Dr as getCategoryHexColor,
2359
- et as getChartOptions,
2360
- xr as getColorForValue,
2361
- Rr as getColour,
2362
- zr as getEqualRangeBinIndex,
2363
- Fr as getEqualRangeColor,
2364
- $r as getHoleVerticalExtent,
2365
- kr as getRasterOverlay,
2366
- wr as getViewState,
2367
- fn as gradeBlockToThreeGeometry,
2368
- on as groupPhotosBySet,
2369
- Bt as groupRowsByHole,
2370
- At as holeHasData,
2371
- Hr as interpolateTrace,
2372
- es as intervalsAsTubes,
2373
- zn as joinAssaysToTraces,
2374
- Ur as listRasterOverlays,
2375
- vn as loadAssayFile,
2376
- Dt as loadAssayHole,
2377
- Pt as loadAssayMetadata,
2378
- xn as loadAssays,
2379
- Br as loadBlockModelMetadata,
2380
- Pn as loadCollars,
2381
- Rn as loadGeology,
2382
- is as loadGradeBlocksFromJson,
2383
- Dn as loadSurveys,
2384
- Me as loadTable,
2385
- Gr as logDataInfo,
2386
- Vr as logDataWarning,
2387
- jr as lookDown,
2388
- Ft as minimumCurvatureDesurvey,
2389
- Yr as normalizeBlockRow,
2390
- Wr as normalizeBounds,
2391
- En as normalizeCsvRow,
2392
- Ie as normalizeFieldName,
2393
- qr as normalizeStripLogOptions,
2394
- Kr as pan,
2395
- Vt as parseAssayCsvTextToHoles,
2396
- Tt as parseAssayHole,
2397
- Nn as parseAssayHoleIds,
2398
- Ct as parseAssayHoleIdsWithAssays,
2399
- Mt as parseAssaysCSV,
2400
- Xr as parseBlockModelCSV,
2401
- On as parseDrillholesCSV,
2402
- jt as parseGeologyCsvText,
2403
- Vn as parseGeophysicsCSV,
2404
- Yn as parseLasFile,
2405
- Gt as parseStructuralCSV,
2406
- Un as parseStructuralIntervalsCSV,
2407
- Hn as parseStructuralPointsCSV,
2408
- In as parseSurveyCSV,
2409
- Bn as parseUnifiedDataset,
2410
- An as pickFirstPresent,
2411
- Zn as planView,
2412
- en as projectTraceToSection,
2413
- Zr as recenterCameraToOrigin,
2414
- Jr as removeRasterOverlay,
2506
+ po as REPORT_NUMBER,
2507
+ go as SAMPLE_ID,
2508
+ bo as STRIKE,
2509
+ yo as STRIP_LOG_DEFAULT_COLOR,
2510
+ _o as STRIP_LOG_DEFAULT_LATERAL_OFFSET,
2511
+ No as STRIP_LOG_DEFAULT_PANEL_WIDTH,
2512
+ vo as SURFACE_SAMPLE_ID,
2513
+ Eo as SURFACE_SAMPLE_TYPE,
2514
+ Ao as SURVEY_TYPE,
2515
+ O as TO,
2516
+ ir as TracePlot,
2517
+ yr as addGradeBlocksToScene,
2518
+ So as addRasterOverlay,
2519
+ To as alphaBetaToNormal,
2520
+ mr as annotationsFromIntervals,
2521
+ Xn as assembleDataset,
2522
+ Un as attachAssayPositions,
2523
+ kn as balancedTangentialDesurvey,
2524
+ kt as buildAssayState,
2525
+ Lo as buildCategoricalStripLogConfig,
2526
+ rn as buildCommentsConfig,
2527
+ yn as buildDepthMarkers,
2528
+ Io as buildEqualRangeColorScale,
2529
+ It as buildIntervalPoints,
2530
+ St as buildPlotConfig,
2531
+ sr as buildStrikeDipSymbol,
2532
+ Co as buildStripLogGroup,
2533
+ Mo as buildStripLogLinePoints,
2534
+ Po as buildStructuralDiscs,
2535
+ or as buildStructuralStripConfig,
2536
+ nn as buildTadpoleConfig,
2537
+ wn as buildTraces,
2538
+ Nn as buildTrayPhotos,
2539
+ Oo as buildViewSignature,
2540
+ xo as calculateBlockVolume,
2541
+ Do as calculatePropertyStats,
2542
+ vt as classifyColumns,
2543
+ Ro as clearRasterOverlays,
2544
+ zo as clearStripLogs,
2545
+ qn as coerceNumeric,
2546
+ Fo as computeStructuralPositions,
2547
+ $o as createRasterOverlay,
2548
+ ko as defaultChartType,
2549
+ yt as defaultTrayFilename,
2550
+ pr as depthIntervalToPixels,
2551
+ _n as depthMarkerInterval,
2552
+ Te as deriveAssayProps,
2553
+ wo as derivePropertyMeta,
2554
+ Fn as desurveyTraces,
2555
+ Uo as dipAzimuthToNormal,
2556
+ Ho as dolly,
2557
+ Go as emitViewChangeIfNeeded,
2558
+ Bo as filterBlocks,
2559
+ Wn as filterByProject,
2560
+ Vo as fitCameraToBounds,
2561
+ jo as focusOnLastBounds,
2562
+ Tt as formatPropertyLabel,
2563
+ nr as geophysicsToStripLogs,
2564
+ Yo as getBlockStats,
2565
+ Wo as getCategoryHexColor,
2566
+ nt as getChartOptions,
2567
+ qo as getColorForValue,
2568
+ Xo as getColour,
2569
+ Ko as getEqualRangeBinIndex,
2570
+ Zo as getEqualRangeColor,
2571
+ Jo as getHoleVerticalExtent,
2572
+ Qo as getRasterOverlay,
2573
+ es as getViewState,
2574
+ Sn as gradeBlockToThreeGeometry,
2575
+ bn as groupPhotosBySet,
2576
+ Wt as groupRowsByHole,
2577
+ Lt as holeHasData,
2578
+ ts as interpolateTrace,
2579
+ dr as intervalsAsTubes,
2580
+ Yn as joinAssaysToTraces,
2581
+ ns as listRasterOverlays,
2582
+ Rn as loadAssayFile,
2583
+ $t as loadAssayHole,
2584
+ Ft as loadAssayMetadata,
2585
+ Vn as loadAssays,
2586
+ rs as loadBlockModelMetadata,
2587
+ Gn as loadCollars,
2588
+ jn as loadGeology,
2589
+ br as loadGradeBlocksFromJson,
2590
+ Bn as loadSurveys,
2591
+ Ce as loadTable,
2592
+ os as logDataInfo,
2593
+ ss as logDataWarning,
2594
+ is as lookDown,
2595
+ Ht as minimumCurvatureDesurvey,
2596
+ as as normalizeBlockRow,
2597
+ ls as normalizeBounds,
2598
+ xn as normalizeCsvRow,
2599
+ Ae as normalizeFieldName,
2600
+ cs as normalizeStripLogOptions,
2601
+ us as pan,
2602
+ Xt as parseAssayCsvTextToHoles,
2603
+ Dt as parseAssayHole,
2604
+ On as parseAssayHoleIds,
2605
+ xt as parseAssayHoleIdsWithAssays,
2606
+ Rt as parseAssaysCSV,
2607
+ ds as parseBlockModelCSV,
2608
+ Hn as parseDrillholesCSV,
2609
+ Kt as parseGeologyCsvText,
2610
+ tr as parseGeophysicsCSV,
2611
+ rr as parseLasFile,
2612
+ qt as parseStructuralCSV,
2613
+ Jn as parseStructuralIntervalsCSV,
2614
+ Zn as parseStructuralPointsCSV,
2615
+ zn as parseSurveyCSV,
2616
+ Qn as parseUnifiedDataset,
2617
+ Dn as pickFirstPresent,
2618
+ lr as planView,
2619
+ mn as projectTraceToSection,
2620
+ ms as recenterCameraToOrigin,
2621
+ fs as removeRasterOverlay,
2415
2622
  st as reorderHoleIds,
2416
- Qr as resolveColourMap,
2417
- Jn as sectionView,
2418
- tn as sectionWindow,
2419
- sn as selectPhotoLodUrl,
2420
- eo as setControlMode,
2421
- to as setFov,
2422
- no as setRasterOverlayElevation,
2423
- so as setRasterOverlayOpacity,
2424
- ro as setRasterOverlayVisibility,
2425
- oo as setStripLogs,
2426
- io as setViewState,
2427
- Gn as significantIntercepts,
2428
- rn as sortPhotosByDepth,
2623
+ hs as resolveColourMap,
2624
+ ps as resolvePropertyLabelParts,
2625
+ cr as sectionView,
2626
+ fn as sectionWindow,
2627
+ pn as selectPhotoLodUrl,
2628
+ gs as setControlMode,
2629
+ bs as setFov,
2630
+ ys as setRasterOverlayElevation,
2631
+ _s as setRasterOverlayOpacity,
2632
+ Ns as setRasterOverlayVisibility,
2633
+ vs as setStripLogs,
2634
+ Es as setViewState,
2635
+ er as significantIntercepts,
2636
+ gn as sortPhotosByDepth,
2429
2637
  ie as standardizeColumns,
2430
- _n as standardizeRowArray,
2431
- Ln as tangentialDesurvey,
2432
- ao as toError,
2433
- Qn as tracesAsSegments,
2434
- Xn as useDrillholeTraceGrid,
2435
- wn as validateStructuralPoints,
2436
- k as withDataErrorContext
2638
+ Pn as standardizeRowArray,
2639
+ $n as tangentialDesurvey,
2640
+ As as toError,
2641
+ ur as tracesAsSegments,
2642
+ ar as useDrillholeTraceGrid,
2643
+ Kn as validateStructuralPoints,
2644
+ U as withDataErrorContext
2437
2645
  };
2438
2646
  //# sourceMappingURL=baselode.js.map