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.
@@ -1,121 +1,121 @@
1
- import * as f from "three";
2
- import { OrbitControls as it } from "three/examples/jsm/controls/OrbitControls";
3
- import { FlyControls as st } from "three/examples/jsm/controls/FlyControls";
4
- import { ViewportGizmo as at } from "three-viewport-gizmo";
5
- import { EffectComposer as lt } from "three/examples/jsm/postprocessing/EffectComposer.js";
6
- import { RenderPass as ct } from "three/examples/jsm/postprocessing/RenderPass.js";
7
- import { OutlinePass as ut } from "three/examples/jsm/postprocessing/OutlinePass.js";
8
- import mt from "papaparse";
9
- const ar = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole_id", lr = "hole_type", cr = "max_depth", ur = "surface_sample_id", ft = "surface_sample_type", ht = "datasource_surface_sample_id", xe = "project_id", bt = "report_number", ue = "latitude", me = "longitude", de = "elevation", fe = "easting", he = "northing", be = "crs", mr = "date_start", dr = "date_end", W = "azimuth", K = "dip", fr = "survey_type", pt = "sample_id", hr = "datasource_sample_id", ne = "from", Q = "to", pe = "mid", ge = "depth", gt = "strike", Fe = "alpha", ve = "beta", Ce = "geology_code", Ie = "geology_description", yt = "comments", G = "extra", br = -999.25, pr = -999.25, gr = {
1
+ import * as d from "three";
2
+ import { OrbitControls as ct } from "three/examples/jsm/controls/OrbitControls";
3
+ import { FlyControls as ut } from "three/examples/jsm/controls/FlyControls";
4
+ import { ViewportGizmo as mt } from "three-viewport-gizmo";
5
+ import { EffectComposer as dt } from "three/examples/jsm/postprocessing/EffectComposer.js";
6
+ import { RenderPass as ft } from "three/examples/jsm/postprocessing/RenderPass.js";
7
+ import { OutlinePass as ht } from "three/examples/jsm/postprocessing/OutlinePass.js";
8
+ import bt from "papaparse";
9
+ const hr = "datasource", H = "hole_id", pt = "_collar_id", xe = "datasource_hole_id", br = "hole_type", pr = "max_depth", gr = "surface_sample_id", gt = "surface_sample_type", yt = "datasource_surface_sample_id", ve = "project_id", _t = "report_number", me = "latitude", de = "longitude", fe = "elevation", he = "easting", be = "northing", pe = "crs", yr = "date_start", _r = "date_end", K = "azimuth", J = "dip", Mr = "survey_type", Mt = "sample_id", Er = "datasource_sample_id", re = "from", ee = "to", ge = "mid", ye = "depth", Et = "strike", Fe = "alpha", Ce = "beta", Ie = "geology_code", Te = "geology_description", zt = "comments", G = "extra", zr = -999.25, Nr = -999.25, Or = {
10
10
  // A unique hole identifier across the entire dataset and all future data sets
11
11
  [H]: "string",
12
12
  // The hole ID from the original collar source
13
- [we]: "string",
14
- // The project ID or project code from the original collar source, if available
15
13
  [xe]: "string",
14
+ // The project ID or project code from the original collar source, if available
15
+ [ve]: "string",
16
16
  // The latitude of the collar, in decimal degrees (WGS84)
17
- [ue]: "number",
18
- // The longitude of the collar, in decimal degrees (WGS84)
19
17
  [me]: "number",
20
- // The elevation of the collar, in meters above sea level (WGS84)
18
+ // The longitude of the collar, in decimal degrees (WGS84)
21
19
  [de]: "number",
22
- // The easting coordinate of the collar, in meters (projected CRS)
20
+ // The elevation of the collar, in meters above sea level (WGS84)
23
21
  [fe]: "number",
24
- // The northing coordinate of the collar, in meters (projected CRS)
22
+ // The easting coordinate of the collar, in meters (projected CRS)
25
23
  [he]: "number",
24
+ // The northing coordinate of the collar, in meters (projected CRS)
25
+ [be]: "number",
26
26
  // The coordinate reference system of the collar coordinates for easting/northing,
27
27
  // as an EPSG code or proj string
28
- [be]: "string",
28
+ [pe]: "string",
29
29
  // Internal join key used by source schemas (e.g. raw_gswa) — distinct from
30
30
  // the public hole_id.
31
- [dt]: "string",
31
+ [pt]: "string",
32
32
  // Per-row dict of source-specific fields outside the canonical schema
33
33
  // (populated by `bundleExtras`; empty object when the source had nothing extra).
34
34
  [G]: "object"
35
- }, yr = {
35
+ }, Lr = {
36
36
  // The unique hole id that maps to the collar and any other data tables
37
37
  [H]: "string",
38
38
  // The depth along the hole where the survey measurement was taken / started
39
- [ge]: "number",
39
+ [ye]: "number",
40
40
  // The depth along the hole where the survey measurement ended, if applicable
41
41
  // (some surveys are point measurements and may not have a 'to' depth)
42
- [Q]: "number",
42
+ [ee]: "number",
43
43
  // The azimuth of the hole at the survey depth, in degrees from north
44
- [W]: "number",
44
+ [K]: "number",
45
45
  // The dip of the hole at the survey depth, in degrees from horizontal
46
46
  // (negative values indicate downward inclination)
47
- [K]: "number",
47
+ [J]: "number",
48
48
  // Per-row dict of source-specific fields outside the canonical schema.
49
49
  [G]: "object"
50
- }, _r = {
50
+ }, Ar = {
51
51
  // The unique hole id that maps to the collar and any other data tables
52
52
  [H]: "string",
53
53
  // The depth along the hole where the assay interval starts
54
- [ne]: "number",
54
+ [re]: "number",
55
55
  // The depth along the hole where the assay interval ends
56
- [Q]: "number",
56
+ [ee]: "number",
57
57
  // The midpoint depth of the assay interval
58
- [pe]: "number",
58
+ [ge]: "number",
59
59
  // assay value columns are variable and not standardized here.
60
60
  // Assays may be flattened (one column per assay type) or long
61
61
  // (one row per assay type with an additional 'assay_type' column).
62
62
  // Per-row dict of source-specific fields outside the canonical schema
63
63
  // (sample identifiers, lab metadata, detection-limit flags, etc.).
64
64
  [G]: "object"
65
- }, Mr = {
65
+ }, kr = {
66
66
  [H]: "string",
67
- [ne]: "number",
68
- [Q]: "number",
69
- [pe]: "number",
70
- [Ce]: "string",
67
+ [re]: "number",
68
+ [ee]: "number",
69
+ [ge]: "number",
71
70
  [Ie]: "string",
71
+ [Te]: "string",
72
72
  // Per-row dict of source-specific fields outside the canonical schema.
73
73
  [G]: "object"
74
- }, Er = {
74
+ }, Dr = {
75
75
  [H]: "string",
76
- [ge]: "number",
76
+ [ye]: "number",
77
+ [J]: "number",
77
78
  [K]: "number",
78
- [W]: "number",
79
79
  [Fe]: "number",
80
- [ve]: "number",
81
- [yt]: "string",
80
+ [Ce]: "number",
81
+ [zt]: "string",
82
82
  // Per-row dict of source-specific fields outside the canonical schema.
83
83
  [G]: "object"
84
- }, zr = {
84
+ }, Sr = {
85
85
  [H]: "string",
86
- [ne]: "number",
87
- [Q]: "number",
88
- [pe]: "number",
86
+ [re]: "number",
87
+ [ee]: "number",
88
+ [ge]: "number",
89
89
  // value columns are variable — not standardized here
90
90
  // Per-row dict of source-specific fields outside the canonical schema.
91
91
  [G]: "object"
92
- }, Nr = {
93
- [pt]: "string",
94
- [ht]: "string",
95
- [bt]: "string",
96
- [ue]: "number",
92
+ }, wr = {
93
+ [Mt]: "string",
94
+ [yt]: "string",
95
+ [_t]: "string",
97
96
  [me]: "number",
98
97
  [de]: "number",
99
98
  [fe]: "number",
100
99
  [he]: "number",
101
- [be]: "string",
102
- [ft]: "string",
100
+ [be]: "number",
101
+ [pe]: "string",
102
+ [gt]: "string",
103
103
  // Per-row dict of source-specific fields outside the canonical schema
104
104
  // (analyte values, lab metadata, detection-limit flags, anumber, ...).
105
105
  [G]: "object"
106
- }, _t = {
106
+ }, Nt = {
107
107
  [H]: ["hole_id", "holeid", "hole id", "hole-id"],
108
- [we]: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
109
- [xe]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
110
- [ue]: ["latitude", "lat"],
111
- [me]: ["longitude", "lon"],
112
- [de]: ["elevation", "rl", "elev", "z"],
113
- [fe]: ["easting", "x"],
114
- [he]: ["northing", "y"],
115
- [be]: ["crs", "epsg", "projection"],
116
- [ne]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
117
- [Q]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
118
- [Ce]: [
108
+ [xe]: ["datasource_hole_id", "datasourceholeid", "datasource hole id", "datasource-hole-id", "company_hole_id", "companyholeid", "company hole id", "company-hole-id"],
109
+ [ve]: ["project_id", "projectid", "project id", "project-id", "project_code", "projectcode", "project code", "project-code", "companyId", "company_id", "companyid", "company id", "company-id", "dataset", "project"],
110
+ [me]: ["latitude", "lat"],
111
+ [de]: ["longitude", "lon"],
112
+ [fe]: ["elevation", "rl", "elev", "z"],
113
+ [he]: ["easting", "x"],
114
+ [be]: ["northing", "y"],
115
+ [pe]: ["crs", "epsg", "projection"],
116
+ [re]: ["from", "depth_from", "from_depth", "samp_from", "sample_from", "sampfrom", "fromdepth"],
117
+ [ee]: ["to", "depth_to", "to_depth", "samp_to", "sample_to", "sampto", "todepth"],
118
+ [Ie]: [
119
119
  "geology_code",
120
120
  "geologycode",
121
121
  "lith1",
@@ -125,7 +125,7 @@ const ar = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole
125
125
  "plot_lithology",
126
126
  "rock1"
127
127
  ],
128
- [Ie]: [
128
+ [Te]: [
129
129
  "geology_description",
130
130
  "geologydescription",
131
131
  "geology_comment",
@@ -136,57 +136,57 @@ const ar = "datasource", H = "hole_id", dt = "_collar_id", we = "datasource_hole
136
136
  "description",
137
137
  "comments"
138
138
  ],
139
- [W]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
140
- [K]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
139
+ [K]: ["azimuth", "az", "dip_direction", "dipdir", "dip direction", "dipdrn", "dipdirection", "dip_dir", "computed_plane_azimuth", "calc_dipdir", "calc_dipdir_deg", "dipdir_calc", "dipdirect_calc"],
140
+ [J]: ["dip", "computed_plane_dip", "calc_dip", "calc_dip_deg", "dip_calc"],
141
141
  [Fe]: ["alpha", "alpha_angle", "alpha_angle_deg", "alpha_2"],
142
- [ve]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
142
+ [Ce]: ["beta", "beta_angle", "beta_angle_deg", "beta_2"],
143
143
  declination: ["declination", "dec"],
144
- [ge]: ["depth", "survey_depth", "surveydepth", "md", "measured_depth", "dept"],
145
- [gt]: ["strike", "str"]
146
- }, Mt = {};
147
- for (const [e, t] of Object.entries(_t))
144
+ [ye]: ["depth", "survey_depth", "surveydepth", "md", "measured_depth", "dept"],
145
+ [Et]: ["strike", "str"]
146
+ }, Ot = {};
147
+ for (const [e, t] of Object.entries(Nt))
148
148
  for (const n of t) {
149
149
  const r = n.toLowerCase().trim();
150
- Mt[r] = e;
150
+ Ot[r] = e;
151
151
  }
152
- const ie = "[baselode:data]";
153
- function Et(e, t = "Unknown error") {
152
+ const se = "[baselode:data]";
153
+ function Lt(e, t = "Unknown error") {
154
154
  if (e instanceof Error) return e;
155
155
  const n = typeof e == "string" && e.trim() ? e : t;
156
156
  return new Error(n);
157
157
  }
158
- function se(e, t, n = "Operation failed") {
159
- const r = Et(t, n), o = new Error(`${e}: ${r.message}`);
158
+ function ae(e, t, n = "Operation failed") {
159
+ const r = Lt(t, n), o = new Error(`${e}: ${r.message}`);
160
160
  return o.cause = r, o;
161
161
  }
162
- function Or(e, t) {
162
+ function xr(e, t) {
163
163
  if (t !== void 0) {
164
- console.warn(`${ie} ${e}`, t);
164
+ console.warn(`${se} ${e}`, t);
165
165
  return;
166
166
  }
167
- console.warn(`${ie} ${e}`);
167
+ console.warn(`${se} ${e}`);
168
168
  }
169
- function kr(e) {
170
- console.info(`${ie} ${e}`);
169
+ function vr(e) {
170
+ console.info(`${se} ${e}`);
171
171
  }
172
- const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "tadpole", ze = {
173
- [J]: [
172
+ const Q = "numeric", le = "categorical", ce = "comment", te = "hidden", At = "tadpole", Ne = {
173
+ [Q]: [
174
174
  { value: "bar", label: "Bars" },
175
175
  { value: "markers", label: "Markers" },
176
176
  { value: "markers+line", label: "Markers + Line" },
177
177
  { value: "line", label: "Line only" }
178
178
  ],
179
- [ae]: [
179
+ [le]: [
180
180
  { value: "categorical", label: "Categorical bands" }
181
181
  ],
182
- [le]: [
182
+ [ce]: [
183
183
  { value: "comment", label: "Comments" }
184
184
  ],
185
- [zt]: [
185
+ [At]: [
186
186
  { value: "tadpole", label: "Tadpole" }
187
187
  ],
188
- [ee]: []
189
- }, Ne = /* @__PURE__ */ new Set([
188
+ [te]: []
189
+ }, Oe = /* @__PURE__ */ new Set([
190
190
  // Hole identifiers
191
191
  "hole_id",
192
192
  "holeid",
@@ -241,7 +241,7 @@ const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "ta
241
241
  "data_source",
242
242
  "_hole_key",
243
243
  "_hole_id_key"
244
- ]), Nt = /* @__PURE__ */ new Set([
244
+ ]), kt = /* @__PURE__ */ new Set([
245
245
  "comments",
246
246
  "comment",
247
247
  "notes",
@@ -254,49 +254,49 @@ const J = "numeric", ae = "categorical", le = "comment", ee = "hidden", zt = "ta
254
254
  "structcomment",
255
255
  "geology_description"
256
256
  ]);
257
- function Ar(e) {
257
+ function Fr(e) {
258
258
  if (!(e != null && e.length))
259
259
  return { byType: {}, numericCols: [], categoricalCols: [], commentCols: [] };
260
260
  const t = new Set(e.flatMap((r) => Object.keys(r || {}))), n = {};
261
261
  for (const r of t) {
262
262
  const o = r.toLowerCase().trim();
263
- if (Ne.has(o) || Ne.has(r)) {
264
- n[r] = ee;
263
+ if (Oe.has(o) || Oe.has(r)) {
264
+ n[r] = te;
265
265
  continue;
266
266
  }
267
- if (Nt.has(o)) {
268
- const c = e.some((l) => {
269
- const s = l[r];
267
+ if (kt.has(o)) {
268
+ const l = e.some((c) => {
269
+ const s = c[r];
270
270
  return s != null && String(s).trim() !== "" && String(s) !== "null";
271
271
  });
272
- n[r] = c ? le : ee;
272
+ n[r] = l ? ce : te;
273
273
  continue;
274
274
  }
275
275
  let i = !1, a = !1;
276
- for (const c of e) {
277
- const l = c[r];
278
- if (!(l == null || typeof l == "string" && l.trim() === "") && (a = !0, typeof l == "number" && Number.isFinite(l))) {
276
+ for (const l of e) {
277
+ const c = l[r];
278
+ if (!(c == null || typeof c == "string" && c.trim() === "") && (a = !0, typeof c == "number" && Number.isFinite(c))) {
279
279
  i = !0;
280
280
  break;
281
281
  }
282
282
  }
283
- a ? i ? n[r] = J : n[r] = ae : n[r] = ee;
283
+ a ? i ? n[r] = Q : n[r] = le : n[r] = te;
284
284
  }
285
285
  return {
286
286
  byType: n,
287
- numericCols: Object.entries(n).filter(([, r]) => r === J).map(([r]) => r),
288
- categoricalCols: Object.entries(n).filter(([, r]) => r === ae).map(([r]) => r),
289
- commentCols: Object.entries(n).filter(([, r]) => r === le).map(([r]) => r)
287
+ numericCols: Object.entries(n).filter(([, r]) => r === Q).map(([r]) => r),
288
+ categoricalCols: Object.entries(n).filter(([, r]) => r === le).map(([r]) => r),
289
+ commentCols: Object.entries(n).filter(([, r]) => r === ce).map(([r]) => r)
290
290
  };
291
291
  }
292
- function Ot(e) {
293
- return ze[e] ?? ze[J];
292
+ function Dt(e) {
293
+ return Ne[e] ?? Ne[Q];
294
294
  }
295
- function Lr(e) {
296
- const t = Ot(e);
297
- return t.length ? e === J ? "line" : t[0].value : "markers+line";
295
+ function Cr(e) {
296
+ const t = Dt(e);
297
+ return t.length ? e === Q ? "line" : t[0].value : "markers+line";
298
298
  }
299
- const Te = ["x", "y", "z", "dx", "dy", "dz"], kt = {
299
+ const Pe = ["x", "y", "z", "dx", "dy", "dz"], St = {
300
300
  x: ["x", "easting", "center_x", "xc", "xcentre", "xcenter", "x_centre", "x_center", "cx"],
301
301
  y: ["y", "northing", "center_y", "yc", "ycentre", "ycenter", "y_centre", "y_center", "cy"],
302
302
  z: ["z", "elevation", "center_z", "zc", "zcentre", "zcenter", "z_centre", "z_center", "cz"],
@@ -304,49 +304,49 @@ const Te = ["x", "y", "z", "dx", "dy", "dz"], kt = {
304
304
  dy: ["dy", "size_y", "sy", "sizey", "dim_y", "block_size_y"],
305
305
  dz: ["dz", "size_z", "sz", "sizez", "dim_z", "block_size_z"]
306
306
  }, Be = {};
307
- Object.entries(kt).forEach(([e, t]) => {
307
+ Object.entries(St).forEach(([e, t]) => {
308
308
  t.forEach((n) => {
309
309
  Be[n.toLowerCase()] = e;
310
310
  });
311
311
  });
312
- function At(e) {
312
+ function wt(e) {
313
313
  const t = {};
314
314
  return Object.entries(e).forEach(([n, r]) => {
315
315
  const o = Be[n.toLowerCase().trim()] || n;
316
316
  t[o] = r;
317
317
  }), t;
318
318
  }
319
- function Dr(e) {
319
+ function Ir(e) {
320
320
  return new Promise((t, n) => {
321
- mt.parse(e, {
321
+ bt.parse(e, {
322
322
  header: !0,
323
323
  dynamicTyping: !0,
324
324
  skipEmptyLines: !0,
325
325
  complete: (r) => {
326
- const i = (r.data || []).map(At).filter(
327
- (c) => c.x !== null && c.y !== null && c.z !== null
326
+ const i = (r.data || []).map(wt).filter(
327
+ (l) => l.x !== null && l.y !== null && l.z !== null
328
328
  ), a = Object.keys(i[0] || {}).filter(
329
- (c) => !Te.includes(c)
329
+ (l) => !Pe.includes(l)
330
330
  );
331
331
  t({ data: i, properties: a });
332
332
  },
333
333
  error: (r) => {
334
- n(se("parseBlockModelCSV", r));
334
+ n(ae("parseBlockModelCSV", r));
335
335
  }
336
336
  });
337
337
  });
338
338
  }
339
- function Sr(e) {
339
+ function Tr(e) {
340
340
  if (typeof e == "string")
341
341
  try {
342
342
  return JSON.parse(e);
343
343
  } catch (t) {
344
- throw se("loadBlockModelMetadata", t);
344
+ throw ae("loadBlockModelMetadata", t);
345
345
  }
346
346
  if (e && typeof e == "object") return e;
347
- throw se("loadBlockModelMetadata", new Error("Invalid metadata source"));
347
+ throw ae("loadBlockModelMetadata", new Error("Invalid metadata source"));
348
348
  }
349
- function Lt(e, t) {
349
+ function xt(e, t) {
350
350
  const n = e.map((i) => i[t]).filter((i) => i != null);
351
351
  if (n.length > 0 && n.every((i) => typeof i == "number")) {
352
352
  const i = Math.min(...n), a = Math.max(...n);
@@ -354,16 +354,16 @@ function Lt(e, t) {
354
354
  }
355
355
  return { type: "categorical", categories: [...new Set(n)], values: n };
356
356
  }
357
- function wr(e) {
357
+ function Pr(e) {
358
358
  if (!e || e.length === 0) return {};
359
359
  const t = Object.keys(e[0]).filter(
360
- (r) => !Te.includes(r)
360
+ (r) => !Pe.includes(r)
361
361
  ), n = {};
362
362
  return t.forEach((r) => {
363
- n[r] = Lt(e, r);
363
+ n[r] = xt(e, r);
364
364
  }), n;
365
365
  }
366
- function Dt(e, t) {
366
+ function vt(e, t) {
367
367
  return !t || typeof t != "object" ? e : e.filter(
368
368
  (n) => Object.entries(t).every(([r, o]) => {
369
369
  const i = n[r];
@@ -371,85 +371,85 @@ function Dt(e, t) {
371
371
  })
372
372
  );
373
373
  }
374
- function xr(e, t = null) {
375
- return (t ? Dt(e, t) : e).reduce((r, o) => {
376
- const i = Number(o.dx) || 0, a = Number(o.dy) || 0, c = Number(o.dz) || 0;
377
- return r + i * a * c;
374
+ function Br(e, t = null) {
375
+ return (t ? vt(e, t) : e).reduce((r, o) => {
376
+ const i = Number(o.dx) || 0, a = Number(o.dy) || 0, l = Number(o.dz) || 0;
377
+ return r + i * a * l;
378
378
  }, 0);
379
379
  }
380
- function St(e, t, n) {
380
+ function Ft(e, t, n) {
381
381
  if (!t) return new n.Color("#888888");
382
382
  if (t.type === "numeric") {
383
- const i = t.max - t.min, c = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
384
- return new n.Color().setHSL(c / 360, 0.8, 0.5);
383
+ const i = t.max - t.min, l = (1 - (i === 0 ? 0.5 : (e - t.min) / i)) * 240;
384
+ return new n.Color().setHSL(l / 360, 0.8, 0.5);
385
385
  }
386
386
  const o = t.categories.indexOf(e) / Math.max(t.categories.length, 1) * 360;
387
387
  return new n.Color().setHSL(o / 360, 0.7, 0.5);
388
388
  }
389
- function wt(e, t) {
389
+ function Ct(e, t) {
390
390
  if (!e || e.length === 0 || !Number.isFinite(t)) return null;
391
391
  const n = e.length;
392
392
  if (n === 1) {
393
- const b = e[0];
394
- return { x: Number(b.x), y: Number(b.y), z: Number(b.z), dx: 0, dy: 0, dz: -1 };
393
+ const f = e[0];
394
+ return { x: Number(f.x), y: Number(f.y), z: Number(f.z), dx: 0, dy: 0, dz: -1 };
395
395
  }
396
396
  let r = -1;
397
- for (let b = 0; b < n - 1; b++) {
398
- const A = Number(e[b].md), y = Number(e[b + 1].md);
399
- if (t >= A && t <= y) {
400
- r = b;
397
+ for (let f = 0; f < n - 1; f++) {
398
+ const A = Number(e[f].md), _ = Number(e[f + 1].md);
399
+ if (t >= A && t <= _) {
400
+ r = f;
401
401
  break;
402
402
  }
403
403
  }
404
404
  let o, i, a;
405
405
  if (r === -1) {
406
406
  t < Number(e[0].md) ? (o = e[0], i = e[1]) : (o = e[n - 2], i = e[n - 1]);
407
- const b = Number(o.md), y = Number(i.md) - b;
408
- a = y > 0 ? (t - b) / y : t < b ? 0 : 1;
407
+ const f = Number(o.md), _ = Number(i.md) - f;
408
+ a = _ > 0 ? (t - f) / _ : t < f ? 0 : 1;
409
409
  } else {
410
410
  o = e[r], i = e[r + 1];
411
- const b = Number(o.md), y = Number(i.md) - b;
412
- a = y > 0 ? (t - b) / y : 0;
413
- }
414
- const c = Number(o.x) + a * (Number(i.x) - Number(o.x)), l = Number(o.y) + a * (Number(i.y) - Number(o.y)), s = Number(o.z) + a * (Number(i.z) - Number(o.z));
415
- let u, p, m;
416
- const h = Number(o.azimuth), d = Number(o.dip), g = Number(i.azimuth), N = Number(i.dip);
417
- if (Number.isFinite(h) && Number.isFinite(d)) {
418
- const b = Number.isFinite(g) && Number.isFinite(N) ? h + a * (g - h) : h, A = Number.isFinite(g) && Number.isFinite(N) ? d + a * (N - d) : d, y = b * Math.PI / 180, E = A * Math.PI / 180;
419
- u = Math.cos(E) * Math.sin(y), p = Math.cos(E) * Math.cos(y), m = -Math.sin(E);
411
+ const f = Number(o.md), _ = Number(i.md) - f;
412
+ a = _ > 0 ? (t - f) / _ : 0;
413
+ }
414
+ const l = Number(o.x) + a * (Number(i.x) - Number(o.x)), c = Number(o.y) + a * (Number(i.y) - Number(o.y)), s = Number(o.z) + a * (Number(i.z) - Number(o.z));
415
+ let u, h, p;
416
+ const b = Number(o.azimuth), m = Number(o.dip), g = Number(i.azimuth), y = Number(i.dip);
417
+ if (Number.isFinite(b) && Number.isFinite(m)) {
418
+ const f = Number.isFinite(g) && Number.isFinite(y) ? b + a * (g - b) : b, A = Number.isFinite(g) && Number.isFinite(y) ? m + a * (y - m) : m, _ = f * Math.PI / 180, z = A * Math.PI / 180;
419
+ u = Math.cos(z) * Math.sin(_), h = Math.cos(z) * Math.cos(_), p = -Math.sin(z);
420
420
  } else {
421
- const b = Number(i.x) - Number(o.x), A = Number(i.y) - Number(o.y), y = Number(i.z) - Number(o.z), E = Math.sqrt(b * b + A * A + y * y);
422
- if (E < 1e-10) return { x: c, y: l, z: s, dx: 0, dy: 0, dz: -1 };
423
- u = b / E, p = A / E, m = y / E;
421
+ const f = Number(i.x) - Number(o.x), A = Number(i.y) - Number(o.y), _ = Number(i.z) - Number(o.z), z = Math.sqrt(f * f + A * A + _ * _);
422
+ if (z < 1e-10) return { x: l, y: c, z: s, dx: 0, dy: 0, dz: -1 };
423
+ u = f / z, h = A / z, p = _ / z;
424
424
  }
425
- const O = Math.sqrt(u * u + p * p + m * m);
426
- return O < 1e-10 ? { x: c, y: l, z: s, dx: 0, dy: 0, dz: -1 } : { x: c, y: l, z: s, dx: u / O, dy: p / O, dz: m / O };
425
+ const O = Math.sqrt(u * u + h * h + p * p);
426
+ return O < 1e-10 ? { x: l, y: c, z: s, dx: 0, dy: 0, dz: -1 } : { x: l, y: c, z: s, dx: u / O, dy: h / O, dz: p / O };
427
427
  }
428
- function xt(e, t, n, r = {}) {
429
- const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: a, dy: c, dz: l } = n, s = [a, c, l];
428
+ function It(e, t, n, r = {}) {
429
+ const { betaZeroAxis: o = "B", betaHandedness: i = 1 } = r, { dx: a, dy: l, dz: c } = n, s = [a, l, c];
430
430
  let u = [0, 0, 1];
431
- const p = s[0] * u[0] + s[1] * u[1] + s[2] * u[2];
432
- Math.abs(p) > 0.99 && (u = [0, 1, 0]);
433
- const m = [
431
+ const h = s[0] * u[0] + s[1] * u[1] + s[2] * u[2];
432
+ Math.abs(h) > 0.99 && (u = [0, 1, 0]);
433
+ const p = [
434
434
  u[1] * s[2] - u[2] * s[1],
435
435
  u[2] * s[0] - u[0] * s[2],
436
436
  u[0] * s[1] - u[1] * s[0]
437
- ], h = Math.sqrt(m[0] ** 2 + m[1] ** 2 + m[2] ** 2), d = h > 1e-10 ? [m[0] / h, m[1] / h, m[2] / h] : [1, 0, 0], g = [
438
- s[1] * d[2] - s[2] * d[1],
439
- s[2] * d[0] - s[0] * d[2],
440
- s[0] * d[1] - s[1] * d[0]
441
- ], N = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), O = N > 1e-10 ? [g[0] / N, g[1] / N, g[2] / N] : [0, 1, 0], b = o === "R" ? d : O, A = t * Math.PI / 180 * i, y = Math.cos(A), E = Math.sin(A), k = b[0] * s[0] + b[1] * s[1] + b[2] * s[2], D = [
442
- s[1] * b[2] - s[2] * b[1],
443
- s[2] * b[0] - s[0] * b[2],
444
- s[0] * b[1] - s[1] * b[0]
437
+ ], b = Math.sqrt(p[0] ** 2 + p[1] ** 2 + p[2] ** 2), m = b > 1e-10 ? [p[0] / b, p[1] / b, p[2] / b] : [1, 0, 0], g = [
438
+ s[1] * m[2] - s[2] * m[1],
439
+ s[2] * m[0] - s[0] * m[2],
440
+ s[0] * m[1] - s[1] * m[0]
441
+ ], y = Math.sqrt(g[0] ** 2 + g[1] ** 2 + g[2] ** 2), O = y > 1e-10 ? [g[0] / y, g[1] / y, g[2] / y] : [0, 1, 0], f = o === "R" ? m : O, A = t * Math.PI / 180 * i, _ = Math.cos(A), z = Math.sin(A), L = f[0] * s[0] + f[1] * s[1] + f[2] * s[2], D = [
442
+ s[1] * f[2] - s[2] * f[1],
443
+ s[2] * f[0] - s[0] * f[2],
444
+ s[0] * f[1] - s[1] * f[0]
445
445
  ], w = [
446
- b[0] * y + D[0] * E + s[0] * k * (1 - y),
447
- b[1] * y + D[1] * E + s[1] * k * (1 - y),
448
- b[2] * y + D[2] * E + s[2] * k * (1 - y)
449
- ], L = (90 - e) * Math.PI / 180, x = Math.cos(L), S = Math.sin(L), v = x * w[0] + S * s[0], I = x * w[1] + S * s[1], C = x * w[2] + S * s[2], B = Math.sqrt(v * v + I * I + C * C);
450
- return B < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: v / B, ny: I / B, nz: C / B };
446
+ f[0] * _ + D[0] * z + s[0] * L * (1 - _),
447
+ f[1] * _ + D[1] * z + s[1] * L * (1 - _),
448
+ f[2] * _ + D[2] * z + s[2] * L * (1 - _)
449
+ ], k = (90 - e) * Math.PI / 180, x = Math.cos(k), S = Math.sin(k), F = x * w[0] + S * s[0], I = x * w[1] + S * s[1], C = x * w[2] + S * s[2], P = Math.sqrt(F * F + I * I + C * C);
450
+ return P < 1e-10 ? { nx: 0, ny: 0, nz: 1 } : { nx: F / P, ny: I / P, nz: C / P };
451
451
  }
452
- function Ft(e, t, n = {}) {
452
+ function Tt(e, t, n = {}) {
453
453
  if (!(e != null && e.length) || !(t != null && t.length)) return [];
454
454
  const r = /* @__PURE__ */ new Map();
455
455
  for (const i of t) {
@@ -457,34 +457,34 @@ function Ft(e, t, n = {}) {
457
457
  a && (r.has(a) || r.set(a, []), r.get(a).push(i));
458
458
  }
459
459
  for (const [, i] of r)
460
- i.sort((a, c) => Number(a.md) - Number(c.md));
460
+ i.sort((a, l) => Number(a.md) - Number(l.md));
461
461
  const o = [];
462
462
  for (const i of e) {
463
463
  const a = i.hole_id != null ? `${i.hole_id}`.trim().toLowerCase() : "";
464
464
  if (!a) continue;
465
- const c = r.get(a);
466
- if (!c || c.length === 0) continue;
467
- const l = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
468
- if (!Number.isFinite(l)) continue;
469
- const s = wt(c, l);
465
+ const l = r.get(a);
466
+ if (!l || l.length === 0) continue;
467
+ const c = i.depth != null ? Number(i.depth) : i.mid != null ? Number(i.mid) : null;
468
+ if (!Number.isFinite(c)) continue;
469
+ const s = Ct(l, c);
470
470
  if (!s) continue;
471
- const { x: u, y: p, z: m, dx: h, dy: d, dz: g } = s;
472
- let N, O, b;
473
- const A = i.alpha != null ? Number(i.alpha) : null, y = i.beta != null ? Number(i.beta) : null;
471
+ const { x: u, y: h, z: p, dx: b, dy: m, dz: g } = s;
472
+ let y, O, f;
473
+ const A = i.alpha != null ? Number(i.alpha) : null, _ = i.beta != null ? Number(i.beta) : null;
474
474
  if (Number.isFinite(A)) {
475
- const E = Number.isFinite(y) ? y : 0, k = xt(A, E, { dx: h, dy: d, dz: g }, n);
476
- N = k.nx, O = k.ny, b = k.nz;
475
+ const z = Number.isFinite(_) ? _ : 0, L = It(A, z, { dx: b, dy: m, dz: g }, n);
476
+ y = L.nx, O = L.ny, f = L.nz;
477
477
  } else {
478
- const E = i.dip != null ? Number(i.dip) : null, k = i.azimuth != null ? Number(i.azimuth) : null;
479
- if (!Number.isFinite(E) || !Number.isFinite(k)) continue;
480
- const D = E * Math.PI / 180, w = k * Math.PI / 180;
481
- N = Math.sin(w) * Math.sin(D), O = Math.cos(w) * Math.sin(D), b = Math.cos(D);
478
+ const z = i.dip != null ? Number(i.dip) : null, L = i.azimuth != null ? Number(i.azimuth) : null;
479
+ if (!Number.isFinite(z) || !Number.isFinite(L)) continue;
480
+ const D = z * Math.PI / 180, w = L * Math.PI / 180;
481
+ y = Math.sin(w) * Math.sin(D), O = Math.cos(w) * Math.sin(D), f = Math.cos(D);
482
482
  }
483
- o.push({ ...i, x: u, y: p, z: m, nx: N, ny: O, nz: b });
483
+ o.push({ ...i, x: u, y: h, z: p, nx: y, ny: O, nz: f });
484
484
  }
485
485
  return o;
486
486
  }
487
- const vt = "baselode", Fr = vt, Ct = [
487
+ const Pt = "baselode", Rr = Pt, Bt = [
488
488
  "#8b1e3f",
489
489
  "#2563eb",
490
490
  "#16a34a",
@@ -495,7 +495,7 @@ const vt = "baselode", Fr = vt, Ct = [
495
495
  "#10b981",
496
496
  "#f97316",
497
497
  "#8b5cf6"
498
- ], M = {
498
+ ], E = {
499
499
  bg: "#ffffff",
500
500
  panel: "#f8fafc",
501
501
  ink: "#1e293b",
@@ -509,31 +509,31 @@ const vt = "baselode", Fr = vt, Ct = [
509
509
  muted_3: "#e2e8f0",
510
510
  primary: "#8b1e3f",
511
511
  primary_2: "#a8324f"
512
- }, ye = {
512
+ }, _e = {
513
513
  layout: {
514
- paper_bgcolor: M.bg,
515
- plot_bgcolor: M.bg,
516
- colorway: Ct,
514
+ paper_bgcolor: E.bg,
515
+ plot_bgcolor: E.bg,
516
+ colorway: Bt,
517
517
  font: {
518
518
  family: "Inter, system-ui, sans-serif",
519
519
  size: 12,
520
- color: M.ink
520
+ color: E.ink
521
521
  },
522
522
  title: {
523
- font: { size: 14, color: M.ink },
523
+ font: { size: 14, color: E.ink },
524
524
  x: 0.05
525
525
  },
526
526
  hovermode: "x unified",
527
527
  hoverlabel: {
528
- bgcolor: M.bg,
529
- bordercolor: M.line,
530
- font: { size: 12, color: M.ink }
528
+ bgcolor: E.bg,
529
+ bordercolor: E.line,
530
+ font: { size: 12, color: E.ink }
531
531
  },
532
532
  legend: {
533
533
  bgcolor: "rgba(255,255,255,0.9)",
534
- bordercolor: M.muted_3,
534
+ bordercolor: E.muted_3,
535
535
  borderwidth: 1,
536
- font: { size: 11, color: M.ink },
536
+ font: { size: 11, color: E.ink },
537
537
  orientation: "h",
538
538
  yanchor: "bottom",
539
539
  y: 1.02,
@@ -543,34 +543,34 @@ const vt = "baselode", Fr = vt, Ct = [
543
543
  xaxis: {
544
544
  showline: !0,
545
545
  linewidth: 1,
546
- linecolor: M.line,
546
+ linecolor: E.line,
547
547
  mirror: !1,
548
548
  ticks: "outside",
549
549
  tickwidth: 1,
550
- tickcolor: M.line,
550
+ tickcolor: E.line,
551
551
  ticklen: 4,
552
552
  showgrid: !0,
553
- gridcolor: M.grid,
553
+ gridcolor: E.grid,
554
554
  gridwidth: 1,
555
555
  zeroline: !1,
556
- title_font: { color: M.ink, size: 12 },
557
- tickfont: { color: M.ink_soft, size: 10 }
556
+ title_font: { color: E.ink, size: 12 },
557
+ tickfont: { color: E.ink_soft, size: 10 }
558
558
  },
559
559
  yaxis: {
560
560
  showline: !0,
561
561
  linewidth: 1,
562
- linecolor: M.line,
562
+ linecolor: E.line,
563
563
  mirror: !1,
564
564
  ticks: "outside",
565
565
  tickwidth: 1,
566
- tickcolor: M.line,
566
+ tickcolor: E.line,
567
567
  ticklen: 4,
568
568
  showgrid: !0,
569
- gridcolor: M.grid,
569
+ gridcolor: E.grid,
570
570
  gridwidth: 1,
571
571
  zeroline: !1,
572
- title_font: { color: M.ink, size: 12 },
573
- tickfont: { color: M.ink_soft, size: 10 }
572
+ title_font: { color: E.ink, size: 12 },
573
+ tickfont: { color: E.ink_soft, size: 10 }
574
574
  },
575
575
  modebar: {
576
576
  remove: ["select2d", "lasso2d", "autoScale2d"]
@@ -581,34 +581,34 @@ const vt = "baselode", Fr = vt, Ct = [
581
581
  data: {
582
582
  scatter: [{
583
583
  mode: "lines+markers",
584
- line: { width: 2, color: M.primary },
584
+ line: { width: 2, color: E.primary },
585
585
  marker: {
586
586
  size: 7,
587
- color: M.primary_2,
588
- line: { width: 1.5, color: M.bg }
587
+ color: E.primary_2,
588
+ line: { width: 1.5, color: E.bg }
589
589
  }
590
590
  }],
591
591
  bar: [{
592
592
  marker: {
593
- color: M.primary,
594
- line: { color: M.bg, width: 0 }
593
+ color: E.primary,
594
+ line: { color: E.bg, width: 0 }
595
595
  }
596
596
  }],
597
597
  histogram: [{
598
598
  marker: {
599
- color: M.primary,
600
- line: { color: M.bg, width: 0 }
599
+ color: E.primary,
600
+ line: { color: E.bg, width: 0 }
601
601
  }
602
602
  }],
603
603
  box: [{
604
- fillcolor: M.accent,
605
- line: { color: M.ink, width: 1.5 },
606
- marker: { color: M.ink }
604
+ fillcolor: E.accent,
605
+ line: { color: E.ink, width: 1.5 },
606
+ marker: { color: E.ink }
607
607
  }],
608
608
  violin: [{
609
- fillcolor: M.accent,
610
- line: { color: M.ink, width: 1.5 },
611
- marker: { color: M.ink }
609
+ fillcolor: E.accent,
610
+ line: { color: E.ink, width: 1.5 },
611
+ marker: { color: E.ink }
612
612
  }],
613
613
  heatmap: [{
614
614
  colorscale: [
@@ -620,9 +620,9 @@ const vt = "baselode", Fr = vt, Ct = [
620
620
  [1, "#1e293b"]
621
621
  ],
622
622
  colorbar: {
623
- outlinecolor: M.line,
624
- tickcolor: M.line,
625
- tickfont: { color: M.ink_soft }
623
+ outlinecolor: E.line,
624
+ tickcolor: E.line,
625
+ tickfont: { color: E.ink_soft }
626
626
  }
627
627
  }],
628
628
  contour: [{
@@ -634,13 +634,13 @@ const vt = "baselode", Fr = vt, Ct = [
634
634
  [1, "#1e293b"]
635
635
  ],
636
636
  colorbar: {
637
- outlinecolor: M.line,
638
- tickcolor: M.line,
639
- tickfont: { color: M.ink_soft }
637
+ outlinecolor: E.line,
638
+ tickcolor: E.line,
639
+ tickfont: { color: E.ink_soft }
640
640
  }
641
641
  }]
642
642
  }
643
- }, vr = ye, _ = {
643
+ }, Vr = _e, M = {
644
644
  bg: "#1b1b1f",
645
645
  panel: "#25252a",
646
646
  ink: "#f0f0e4",
@@ -652,51 +652,50 @@ const vt = "baselode", Fr = vt, Ct = [
652
652
  muted_1: "#8a8a80",
653
653
  muted_2: "#5e5e56",
654
654
  muted_3: "#3a3a34"
655
- }, Cr = "baselode-dark", Ir = {
655
+ }, Hr = "baselode-dark", Gr = {
656
656
  layout: {
657
657
  font: {
658
- family: "Inter, Arial, sans-serif",
659
- color: _.ink,
660
- size: 14
658
+ family: "Inter, system-ui, sans-serif",
659
+ color: M.ink,
660
+ size: 12
661
661
  },
662
662
  title: {
663
- x: 0.02,
664
- xanchor: "left",
663
+ x: 0.05,
665
664
  font: {
666
- family: "Inter, Arial, sans-serif",
667
- size: 22,
668
- color: _.ink
665
+ family: "Inter, system-ui, sans-serif",
666
+ size: 14,
667
+ color: M.ink
669
668
  }
670
669
  },
671
- paper_bgcolor: _.bg,
672
- plot_bgcolor: _.bg,
670
+ paper_bgcolor: M.bg,
671
+ plot_bgcolor: M.bg,
673
672
  colorway: [
674
- _.ink,
675
- _.accent,
676
- _.muted_1,
677
- _.accent_2,
678
- _.muted_2,
679
- _.muted_3
673
+ M.ink,
674
+ M.accent,
675
+ M.muted_1,
676
+ M.accent_2,
677
+ M.muted_2,
678
+ M.muted_3
680
679
  ],
681
680
  margin: { l: 70, r: 30, t: 70, b: 60 },
682
681
  hovermode: "x unified",
683
682
  hoverlabel: {
684
- bgcolor: _.panel,
685
- bordercolor: _.accent,
683
+ bgcolor: M.panel,
684
+ bordercolor: M.accent,
686
685
  font: {
687
- family: "Inter, Arial, sans-serif",
688
- color: _.ink,
689
- size: 13
686
+ family: "Inter, system-ui, sans-serif",
687
+ color: M.ink,
688
+ size: 12
690
689
  }
691
690
  },
692
691
  legend: {
693
692
  bgcolor: "rgba(37,37,42,0.88)",
694
- bordercolor: _.line,
693
+ bordercolor: M.line,
695
694
  borderwidth: 1,
696
695
  font: {
697
- family: "Inter, Arial, sans-serif",
698
- color: _.ink,
699
- size: 12
696
+ family: "Inter, system-ui, sans-serif",
697
+ color: M.ink,
698
+ size: 11
700
699
  },
701
700
  orientation: "h",
702
701
  yanchor: "bottom",
@@ -705,30 +704,36 @@ const vt = "baselode", Fr = vt, Ct = [
705
704
  x: 0
706
705
  },
707
706
  xaxis: {
708
- showline: !1,
707
+ showline: !0,
708
+ linewidth: 1,
709
+ linecolor: M.line,
710
+ mirror: !1,
709
711
  ticks: "outside",
710
712
  tickwidth: 1,
711
- tickcolor: _.muted_1,
713
+ tickcolor: M.muted_1,
712
714
  ticklen: 6,
713
715
  showgrid: !0,
714
- gridcolor: _.grid,
716
+ gridcolor: M.grid,
715
717
  gridwidth: 1,
716
718
  zeroline: !1,
717
- title_font: { color: _.ink },
718
- tickfont: { color: _.ink_soft }
719
+ title_font: { color: M.ink, size: 12 },
720
+ tickfont: { color: M.ink_soft, size: 10 }
719
721
  },
720
722
  yaxis: {
721
- showline: !1,
723
+ showline: !0,
724
+ linewidth: 1,
725
+ linecolor: M.line,
726
+ mirror: !1,
722
727
  ticks: "outside",
723
728
  tickwidth: 1,
724
- tickcolor: _.muted_1,
729
+ tickcolor: M.muted_1,
725
730
  ticklen: 6,
726
731
  showgrid: !0,
727
- gridcolor: _.grid,
732
+ gridcolor: M.grid,
728
733
  gridwidth: 1,
729
734
  zeroline: !1,
730
- title_font: { color: _.ink },
731
- tickfont: { color: _.ink_soft }
735
+ title_font: { color: M.ink, size: 12 },
736
+ tickfont: { color: M.ink_soft, size: 10 }
732
737
  },
733
738
  bargap: 0.18,
734
739
  bargroupgap: 0.08
@@ -736,34 +741,34 @@ const vt = "baselode", Fr = vt, Ct = [
736
741
  data: {
737
742
  scatter: [{
738
743
  mode: "lines+markers",
739
- line: { width: 2.5, color: _.ink },
744
+ line: { width: 2.5, color: M.ink },
740
745
  marker: {
741
746
  size: 7,
742
- color: _.ink,
743
- line: { width: 1.5, color: _.bg }
747
+ color: M.ink,
748
+ line: { width: 1.5, color: M.bg }
744
749
  }
745
750
  }],
746
751
  bar: [{
747
752
  marker: {
748
- color: _.ink,
749
- line: { color: _.bg, width: 0 }
753
+ color: M.ink,
754
+ line: { color: M.bg, width: 0 }
750
755
  }
751
756
  }],
752
757
  histogram: [{
753
758
  marker: {
754
- color: _.ink,
755
- line: { color: _.bg, width: 0 }
759
+ color: M.ink,
760
+ line: { color: M.bg, width: 0 }
756
761
  }
757
762
  }],
758
763
  box: [{
759
- fillcolor: _.accent,
760
- line: { color: _.ink, width: 1.5 },
761
- marker: { color: _.ink }
764
+ fillcolor: M.accent,
765
+ line: { color: M.ink, width: 1.5 },
766
+ marker: { color: M.ink }
762
767
  }],
763
768
  violin: [{
764
- fillcolor: _.accent,
765
- line: { color: _.ink, width: 1.5 },
766
- marker: { color: _.ink }
769
+ fillcolor: M.accent,
770
+ line: { color: M.ink, width: 1.5 },
771
+ marker: { color: M.ink }
767
772
  }],
768
773
  heatmap: [{
769
774
  colorscale: [
@@ -775,9 +780,9 @@ const vt = "baselode", Fr = vt, Ct = [
775
780
  [1, "#ffffbb"]
776
781
  ],
777
782
  colorbar: {
778
- outlinecolor: _.ink,
779
- tickcolor: _.ink,
780
- tickfont: { color: _.ink_soft }
783
+ outlinecolor: M.ink,
784
+ tickcolor: M.ink,
785
+ tickfont: { color: M.ink_soft }
781
786
  }
782
787
  }],
783
788
  contour: [{
@@ -789,13 +794,13 @@ const vt = "baselode", Fr = vt, Ct = [
789
794
  [1, "#ffffbb"]
790
795
  ],
791
796
  colorbar: {
792
- outlinecolor: _.ink,
793
- tickcolor: _.ink,
794
- tickfont: { color: _.ink_soft }
797
+ outlinecolor: M.ink,
798
+ tickcolor: M.ink,
799
+ tickfont: { color: M.ink_soft }
795
800
  }
796
801
  }]
797
802
  }
798
- }, It = "#7f7f7f", te = {
803
+ }, Rt = "#7f7f7f", ne = {
799
804
  Au: "#FFD700",
800
805
  // gold
801
806
  Ag: "#C0C0C0",
@@ -832,7 +837,7 @@ const vt = "baselode", Fr = vt, Ct = [
832
837
  // aluminium / yellow
833
838
  U: "#8BC34A"
834
839
  // uranium / lime green
835
- }, Tt = {
840
+ }, Vt = {
836
841
  // Sedimentary
837
842
  shale: "#607D8B",
838
843
  mudstone: "#78909C",
@@ -871,11 +876,11 @@ const vt = "baselode", Fr = vt, Ct = [
871
876
  calcite: "#F9FBE7",
872
877
  vein: "#FFFFFF",
873
878
  unknown: "#9E9E9E"
874
- }, re = {
875
- commodity: te,
876
- lithology: Tt
879
+ }, oe = {
880
+ commodity: ne,
881
+ lithology: Vt
877
882
  };
878
- function Bt(e, t, n = It) {
883
+ function Ht(e, t, n = Rt) {
879
884
  if (!t || e == null) return n;
880
885
  const r = String(e).trim();
881
886
  if (Object.prototype.hasOwnProperty.call(t, r)) return t[r];
@@ -884,13 +889,13 @@ function Bt(e, t, n = It) {
884
889
  if (String(i).trim().toLowerCase() === o) return a;
885
890
  return n;
886
891
  }
887
- function Pt(e) {
892
+ function Gt(e) {
888
893
  if (e == null) return {};
889
894
  if (typeof e == "string") {
890
895
  const t = e.trim().toLowerCase();
891
- if (Object.prototype.hasOwnProperty.call(re, t))
892
- return re[t];
893
- const n = Object.keys(re).sort().join(", ");
896
+ if (Object.prototype.hasOwnProperty.call(oe, t))
897
+ return oe[t];
898
+ const n = Object.keys(oe).sort().join(", ");
894
899
  throw new RangeError(
895
900
  `Unknown built-in colour map '${e}'. Available maps: ${n}`
896
901
  );
@@ -900,39 +905,96 @@ function Pt(e) {
900
905
  `colourMap must be null, a string, or a plain object; got ${Array.isArray(e) ? "Array" : Object.prototype.toString.call(e)}`
901
906
  );
902
907
  }
903
- const Rt = "#8b1e3f", Vt = "#a8324f";
904
- function Ht(e) {
908
+ const jt = "analysis_uom", Ut = "analyte_attribute";
909
+ function $(e) {
910
+ if (e == null) return null;
911
+ const t = `${e}`.trim();
912
+ return t === "" ? null : t;
913
+ }
914
+ function Re(e, t) {
915
+ const n = $(t == null ? void 0 : t.label) ?? $(e) ?? "", r = $(t == null ? void 0 : t.unit), o = $(t == null ? void 0 : t.sourceAttribute), i = o && o.toLowerCase() !== n.toLowerCase() ? o : null;
916
+ return { label: n, unit: r, source: i };
917
+ }
918
+ function Ve(e, t) {
919
+ const { label: n, unit: r, source: o } = Re(e, t);
920
+ return n && (r && o ? `${n} (${r}, source: ${o})` : r ? `${n} (${r})` : o ? `${n} (source: ${o})` : n);
921
+ }
922
+ function jr(e, t, {
923
+ unitColumn: n = jt,
924
+ attributeColumn: r = Ut
925
+ } = {}) {
926
+ const o = {};
927
+ if (!Array.isArray(e) || !Array.isArray(t)) return o;
928
+ const i = t.filter(Boolean);
929
+ if (!i.length) return o;
930
+ const a = new Map(
931
+ i.map((l) => [l, { units: /* @__PURE__ */ new Set(), attributes: /* @__PURE__ */ new Set() }])
932
+ );
933
+ return e.forEach((l) => {
934
+ if (!l || typeof l != "object") return;
935
+ let c = null, s = !1;
936
+ for (const b of i) {
937
+ const m = l[b];
938
+ if (!(m == null || m === "")) {
939
+ if (c !== null) {
940
+ s = !0;
941
+ break;
942
+ }
943
+ c = b;
944
+ }
945
+ }
946
+ if (!c || s) return;
947
+ const u = a.get(c), h = $(l[n]);
948
+ h && u.units.add(h);
949
+ const p = $(l[r]);
950
+ p && u.attributes.add(p);
951
+ }), a.forEach((l, c) => {
952
+ const s = {};
953
+ l.units.size === 1 && ([s.unit] = l.units), l.attributes.size === 1 && ([s.sourceAttribute] = l.attributes), (s.unit || s.sourceAttribute) && (o[c] = s);
954
+ }), o;
955
+ }
956
+ function He(e, t) {
957
+ const { label: n, unit: r, source: o } = Re(e, t);
958
+ return {
959
+ label: n,
960
+ unitSuffix: r ? ` ${r}` : "",
961
+ sourceLine: o ? `Source: ${o}<br>` : ""
962
+ };
963
+ }
964
+ const $t = "#8b1e3f", Yt = "#a8324f";
965
+ function Xt(e) {
905
966
  if (!e) return null;
906
967
  const t = e.split(/[_\-/\s]+/);
907
968
  for (const n of t) {
908
- if (Object.prototype.hasOwnProperty.call(te, n))
909
- return te[n];
969
+ if (Object.prototype.hasOwnProperty.call(ne, n))
970
+ return ne[n];
910
971
  const r = n.toLowerCase();
911
- for (const [o, i] of Object.entries(te))
972
+ for (const [o, i] of Object.entries(ne))
912
973
  if (o.toLowerCase() === r) return i;
913
974
  }
914
975
  return null;
915
976
  }
916
- const Gt = "#6b7280", jt = { l: 42, r: 4, t: 4, b: 30 }, Oe = 10, ke = 12;
917
- function Ae(e) {
977
+ const qt = "#6b7280", Zt = { l: 42, r: 4, t: 4, b: 36 }, Le = 10, Ae = 11, Wt = 6;
978
+ function ke(e) {
918
979
  return e ? typeof e == "string" ? { text: e } : e : {};
919
980
  }
920
- function Pe(e = {}) {
921
- const t = Ae(e.xaxis && e.xaxis.title), n = Ae(e.yaxis && e.yaxis.title);
981
+ function Ge(e = {}) {
982
+ const t = ke(e.xaxis && e.xaxis.title), n = ke(e.yaxis && e.yaxis.title);
922
983
  return {
923
984
  ...e,
924
- margin: jt,
985
+ margin: Zt,
925
986
  autosize: !0,
926
987
  width: void 0,
927
988
  xaxis: {
928
989
  ...e.xaxis || {},
929
990
  tickfont: {
930
991
  ...e.xaxis && e.xaxis.tickfont || {},
931
- size: Oe
992
+ size: Le
932
993
  },
933
994
  title: {
934
995
  ...t,
935
- font: { ...t.font || {}, size: ke }
996
+ font: { ...t.font || {}, size: Ae },
997
+ standoff: t.standoff ?? Wt
936
998
  }
937
999
  },
938
1000
  yaxis: {
@@ -940,16 +1002,16 @@ function Pe(e = {}) {
940
1002
  automargin: !0,
941
1003
  tickfont: {
942
1004
  ...e.yaxis && e.yaxis.tickfont || {},
943
- size: Oe
1005
+ size: Le
944
1006
  },
945
1007
  title: {
946
1008
  ...n,
947
- font: { ...n.font || {}, size: ke }
1009
+ font: { ...n.font || {}, size: Ae }
948
1010
  }
949
1011
  }
950
1012
  };
951
1013
  }
952
- function Tr(e, t) {
1014
+ function Ur(e, t) {
953
1015
  var r;
954
1016
  if (!e || !t) return !1;
955
1017
  const n = e.points || [];
@@ -960,40 +1022,40 @@ function Tr(e, t) {
960
1022
  }
961
1023
  return !1;
962
1024
  }
963
- function Br(e, t, n) {
1025
+ function $r(e, t, n) {
964
1026
  if (!e || !t) return [];
965
1027
  const r = (e == null ? void 0 : e.points) || [], o = [], i = /* @__PURE__ */ new Set();
966
1028
  return r.forEach((a) => {
967
- let c = Number(
1029
+ let l = Number(
968
1030
  a.from ?? a.samp_from ?? a.sample_from ?? a.fromdepth ?? a.from_depth ?? a.depth_from
969
- ), l = Number(
1031
+ ), c = Number(
970
1032
  a.to ?? a.samp_to ?? a.sample_to ?? a.todepth ?? a.to_depth ?? a.depth_to
971
1033
  );
972
- if (!Number.isFinite(c) || !Number.isFinite(l)) {
973
- const h = Number(a.depth ?? a.md);
974
- Number.isFinite(h) && (c = h, l = h);
1034
+ if (!Number.isFinite(l) || !Number.isFinite(c)) {
1035
+ const b = Number(a.depth ?? a.md);
1036
+ Number.isFinite(b) && (l = b, c = b);
975
1037
  }
976
1038
  const s = a == null ? void 0 : a[t];
977
- if (!Number.isFinite(c) || !Number.isFinite(l) || l < c || s == null || s === "" || n && typeof s == "string" && /^(nan|null|none)$/i.test(s.trim())) return;
978
- const u = `${t}:${c}-${l}:${String(s)}`;
1039
+ if (!Number.isFinite(l) || !Number.isFinite(c) || c < l || s == null || s === "" || n && typeof s == "string" && /^(nan|null|none)$/i.test(s.trim())) return;
1040
+ const u = `${t}:${l}-${c}:${String(s)}`;
979
1041
  if (i.has(u)) return;
980
1042
  i.add(u);
981
- const p = (c + l) / 2, m = n ? s : Number(s);
982
- !n && !Number.isFinite(m) || o.push({
983
- z: p,
984
- val: m,
985
- from: c,
986
- to: l,
987
- errorPlus: l - p,
988
- errorMinus: p - c
1043
+ const h = (l + c) / 2, p = n ? s : Number(s);
1044
+ !n && !Number.isFinite(p) || o.push({
1045
+ z: h,
1046
+ val: p,
1047
+ from: l,
1048
+ to: c,
1049
+ errorPlus: c - h,
1050
+ errorMinus: h - l
989
1051
  });
990
- }), o.sort((a, c) => c.z - a.z);
1052
+ }), o.sort((a, l) => l.z - a.z);
991
1053
  }
992
- function Ut(e, t, n, r) {
1054
+ function Kt(e, t, n, r, o) {
993
1055
  if (!e.length) return { data: [], layout: {} };
994
- const o = e.filter((m) => Number.isFinite(m == null ? void 0 : m.from) && Number.isFinite(m == null ? void 0 : m.to) && m.to > m.from).map((m) => ({ ...m, category: `${(m == null ? void 0 : m.val) ?? ""}`.trim() })).filter((m) => m.category !== "" && !/^(nan|null|none)$/i.test(m.category)).sort((m, h) => m.from - h.from || m.to - h.to);
995
- if (!o.length) return { data: [], layout: {} };
996
- const i = Pt(n), a = [
1056
+ const i = e.filter((m) => Number.isFinite(m == null ? void 0 : m.from) && Number.isFinite(m == null ? void 0 : m.to) && m.to > m.from).map((m) => ({ ...m, category: `${(m == null ? void 0 : m.val) ?? ""}`.trim() })).filter((m) => m.category !== "" && !/^(nan|null|none)$/i.test(m.category)).sort((m, g) => m.from - g.from || m.to - g.to);
1057
+ if (!i.length) return { data: [], layout: {} };
1058
+ const a = Gt(n), l = [
997
1059
  "#1f77b4",
998
1060
  // blue
999
1061
  "#ff7f0e",
@@ -1022,86 +1084,86 @@ function Ut(e, t, n, r) {
1022
1084
  // violet
1023
1085
  "#636363"
1024
1086
  // dark gray
1025
- ], c = [...new Set(o.map((m) => m.category))];
1026
- function l(m, h) {
1027
- if (i && Object.keys(i).length > 0) {
1028
- const d = Bt(m, i, null);
1029
- if (d !== null) return d;
1087
+ ], c = [...new Set(i.map((m) => m.category))];
1088
+ function s(m, g) {
1089
+ if (a && Object.keys(a).length > 0) {
1090
+ const y = Ht(m, a, null);
1091
+ if (y !== null) return y;
1030
1092
  }
1031
- return a[h % a.length];
1093
+ return l[g % l.length];
1032
1094
  }
1033
- const s = new Map(
1034
- c.map((m, h) => [m, l(m, h)])
1035
- );
1036
- return { data: c.map((m) => {
1037
- const h = o.filter((d) => d.category === m);
1095
+ const u = new Map(
1096
+ c.map((m, g) => [m, s(m, g)])
1097
+ ), h = He(t, o), p = c.map((m) => {
1098
+ const g = i.filter((y) => y.category === m);
1038
1099
  return {
1039
1100
  type: "bar",
1040
- x: h.map(() => 0.5),
1041
- y: h.map((d) => d.to - d.from),
1042
- base: h.map((d) => d.from),
1101
+ x: g.map(() => 0.5),
1102
+ y: g.map((y) => y.to - y.from),
1103
+ base: g.map((y) => y.from),
1043
1104
  width: 1,
1044
- marker: { color: s.get(m), line: { width: 0 } },
1105
+ marker: { color: u.get(m), line: { width: 0 } },
1045
1106
  name: m,
1046
1107
  showlegend: !1,
1047
- customdata: h.map((d) => [d.from, d.to]),
1048
- hovertemplate: `${t}: ${m}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1108
+ customdata: g.map((y) => [y.from, y.to]),
1109
+ hovertemplate: `${h.label}: ${m}<br>${h.sourceLine}from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`
1049
1110
  };
1050
- }), layout: Pe({
1111
+ }), b = {
1051
1112
  barmode: "overlay",
1052
1113
  bargap: 0,
1053
1114
  xaxis: { range: [0, 1], visible: !1, fixedrange: !0 },
1054
1115
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
1055
1116
  showlegend: !1,
1056
- title: t || void 0,
1057
- template: r !== void 0 ? r : ye
1058
- }) };
1117
+ title: Ve(t, o) || void 0,
1118
+ template: r !== void 0 ? r : _e
1119
+ };
1120
+ return { data: p, layout: Ge(b) };
1059
1121
  }
1060
- function Yt(e, t, n, r, o) {
1122
+ function Jt(e, t, n, r, o, i) {
1061
1123
  if (!e.length) return { data: [], layout: {} };
1062
- const i = n === "bar", a = n === "markers", c = n === "line", l = r || Rt, s = r || Vt, u = {
1063
- x: e.map((d) => d.val),
1064
- y: e.map((d) => d.z),
1065
- hovertemplate: `${t}: %{x}<br>from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
1066
- customdata: e.map((d) => [Math.min(d.from, d.to), Math.max(d.from, d.to)])
1067
- }, p = {
1124
+ const a = n === "bar", l = n === "markers", c = n === "line", s = r || $t, u = r || Yt, h = He(t, i), p = {
1125
+ x: e.map((y) => y.val),
1126
+ y: e.map((y) => y.z),
1127
+ hovertemplate: `${h.label}: %{x}${h.unitSuffix}<br>${h.sourceLine}from: %{customdata[0]:.3f} to: %{customdata[1]:.3f}<extra></extra>`,
1128
+ customdata: e.map((y) => [Math.min(y.from, y.to), Math.max(y.from, y.to)])
1129
+ }, b = {
1068
1130
  type: "data",
1069
1131
  symmetric: !1,
1070
- array: e.map((d) => d.errorPlus),
1071
- arrayminus: e.map((d) => d.errorMinus),
1132
+ array: e.map((y) => y.errorPlus),
1133
+ arrayminus: e.map((y) => y.errorMinus),
1072
1134
  thickness: 1.5,
1073
1135
  width: 2,
1074
- color: Gt
1075
- };
1076
- return { data: [i ? {
1077
- ...u,
1136
+ color: qt
1137
+ }, m = a ? {
1138
+ ...p,
1078
1139
  type: "bar",
1079
1140
  orientation: "h",
1080
- marker: { color: l },
1081
- error_y: p
1141
+ marker: { color: s },
1142
+ error_y: b
1082
1143
  } : {
1083
- ...u,
1144
+ ...p,
1084
1145
  type: "scatter",
1085
- mode: a ? "markers" : c ? "lines" : "lines+markers",
1086
- line: { color: l, width: 2 },
1087
- marker: { size: 7, color: s },
1088
- error_y: c ? void 0 : p
1089
- }], layout: Pe({
1090
- xaxis: { title: t, zeroline: !1 },
1146
+ mode: l ? "markers" : c ? "lines" : "lines+markers",
1147
+ line: { color: s, width: 2 },
1148
+ marker: { size: 7, color: u },
1149
+ error_y: c ? void 0 : b
1150
+ }, g = {
1151
+ xaxis: { title: Ve(t, i), zeroline: !1 },
1091
1152
  yaxis: { title: "Depth (m)", autorange: "reversed", zeroline: !1 },
1092
1153
  barmode: "overlay",
1093
1154
  showlegend: !1,
1094
- template: o !== void 0 ? o : ye
1095
- }) };
1155
+ template: o !== void 0 ? o : _e
1156
+ };
1157
+ return { data: [m], layout: Ge(g) };
1096
1158
  }
1097
- function $t({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i }) {
1159
+ function Qt({ points: e, isCategorical: t, property: n, chartType: r, colourMap: o, template: i, meta: a }) {
1098
1160
  if (!e || !e.length || !n) return { data: [], layout: {} };
1099
1161
  if (t || r === "categorical")
1100
- return Ut(e, n, o, i);
1101
- const a = Ht(n);
1102
- return Yt(e, n, r, a, i);
1162
+ return Kt(e, n, o, i, a);
1163
+ const l = Xt(n);
1164
+ return Jt(e, n, r, l, i, a);
1103
1165
  }
1104
- function Pr(e = [], {
1166
+ function Yr(e = [], {
1105
1167
  fromCol: t = "from",
1106
1168
  toCol: n = "to",
1107
1169
  categoryCol: r = "geology_code",
@@ -1109,19 +1171,19 @@ function Pr(e = [], {
1109
1171
  template: i = void 0
1110
1172
  } = {}) {
1111
1173
  const a = [];
1112
- return e.forEach((c) => {
1113
- const l = Number(c == null ? void 0 : c[t]), s = Number(c == null ? void 0 : c[n]), u = c == null ? void 0 : c[r];
1114
- if (!Number.isFinite(l) || !Number.isFinite(s) || s <= l || u == null || `${u}`.trim() === "") return;
1115
- const p = (l + s) / 2;
1174
+ return e.forEach((l) => {
1175
+ const c = Number(l == null ? void 0 : l[t]), s = Number(l == null ? void 0 : l[n]), u = l == null ? void 0 : l[r];
1176
+ if (!Number.isFinite(c) || !Number.isFinite(s) || s <= c || u == null || `${u}`.trim() === "") return;
1177
+ const h = (c + s) / 2;
1116
1178
  a.push({
1117
- z: p,
1179
+ z: h,
1118
1180
  val: `${u}`,
1119
- from: l,
1181
+ from: c,
1120
1182
  to: s,
1121
- errorPlus: s - p,
1122
- errorMinus: p - l
1183
+ errorPlus: s - h,
1184
+ errorMinus: h - c
1123
1185
  });
1124
- }), a.sort((c, l) => l.z - c.z), $t({
1186
+ }), a.sort((l, c) => c.z - l.z), Qt({
1125
1187
  points: a,
1126
1188
  isCategorical: !0,
1127
1189
  property: r,
@@ -1130,7 +1192,7 @@ function Pr(e = [], {
1130
1192
  template: i
1131
1193
  });
1132
1194
  }
1133
- const Xt = [
1195
+ const en = [
1134
1196
  "#313695",
1135
1197
  "#4575b4",
1136
1198
  "#74add1",
@@ -1142,7 +1204,7 @@ const Xt = [
1142
1204
  "#d73027",
1143
1205
  "#a50026"
1144
1206
  ];
1145
- function qt(e = [], t = Xt) {
1207
+ function tn(e = [], t = en) {
1146
1208
  const n = e.filter((s) => Number.isFinite(s));
1147
1209
  if (!n.length)
1148
1210
  return {
@@ -1154,8 +1216,8 @@ function qt(e = [], t = Xt) {
1154
1216
  };
1155
1217
  const r = n.slice().sort((s, u) => s - u), o = r[0], i = r[r.length - 1], a = t.length;
1156
1218
  if (i === o) {
1157
- const s = t.map((u, p) => ({
1158
- index: p,
1219
+ const s = t.map((u, h) => ({
1220
+ index: h,
1159
1221
  min: o,
1160
1222
  max: i,
1161
1223
  label: `${o}`
@@ -1168,28 +1230,28 @@ function qt(e = [], t = Xt) {
1168
1230
  colors: t
1169
1231
  };
1170
1232
  }
1171
- const c = t.map((s, u) => {
1172
- const p = u / a, m = (u + 1) / a, h = Math.floor(p * r.length), d = Math.min(r.length - 1, Math.floor(m * r.length)), g = r[h], N = u === a - 1 ? i : r[d];
1233
+ const l = t.map((s, u) => {
1234
+ const h = u / a, p = (u + 1) / a, b = Math.floor(h * r.length), m = Math.min(r.length - 1, Math.floor(p * r.length)), g = r[b], y = u === a - 1 ? i : r[m];
1173
1235
  return {
1174
1236
  index: u,
1175
1237
  min: g,
1176
- max: N,
1177
- label: Zt(g, N)
1238
+ max: y,
1239
+ label: nn(g, y)
1178
1240
  };
1179
- }), l = (i - o) / a;
1241
+ }), c = (i - o) / a;
1180
1242
  return {
1181
1243
  min: o,
1182
1244
  max: i,
1183
- step: l,
1184
- bins: c,
1245
+ step: c,
1246
+ bins: l,
1185
1247
  colors: t
1186
1248
  };
1187
1249
  }
1188
- function Zt(e, t) {
1250
+ function nn(e, t) {
1189
1251
  const n = (r) => Number.isFinite(r) ? Math.abs(r) >= 1e3 ? r.toFixed(0) : Math.abs(r) >= 10 ? r.toFixed(1) : Math.abs(r) >= 0.1 ? r.toFixed(2) : r.toFixed(3) : "n/a";
1190
1252
  return `${n(e)} – ${n(t)}`;
1191
1253
  }
1192
- function Re(e, t) {
1254
+ function je(e, t) {
1193
1255
  if (!Number.isFinite(e) || !t || !Array.isArray(t.bins) || !t.bins.length)
1194
1256
  return -1;
1195
1257
  if (t.max === t.min)
@@ -1201,8 +1263,8 @@ function Re(e, t) {
1201
1263
  }
1202
1264
  return -1;
1203
1265
  }
1204
- function Wt(e, t, n = "#8b1e3f") {
1205
- const r = Re(e, t);
1266
+ function rn(e, t, n = "#8b1e3f") {
1267
+ const r = je(e, t);
1206
1268
  return r < 0 ? n : t.colors[r] || n;
1207
1269
  }
1208
1270
  function j(e) {
@@ -1212,7 +1274,7 @@ function j(e) {
1212
1274
  ...e.structuralMeshes
1213
1275
  ];
1214
1276
  }
1215
- const Kt = {
1277
+ const on = {
1216
1278
  bedding: "#2563eb",
1217
1279
  foliation: "#16a34a",
1218
1280
  joint: "#9333ea",
@@ -1221,13 +1283,13 @@ const Kt = {
1221
1283
  "shear zone": "#0ea5e9",
1222
1284
  "fault zone": "#ef4444"
1223
1285
  };
1224
- function Jt(e, t) {
1225
- const n = t || Kt, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
1226
- return new f.Color(o).getHex();
1286
+ function sn(e, t) {
1287
+ const n = t || on, r = (e || "").toLowerCase().trim(), o = n[r] || "#888888";
1288
+ return new d.Color(o).getHex();
1227
1289
  }
1228
- function Qt(e, t) {
1290
+ function an(e, t) {
1229
1291
  const n = e * Math.PI / 180, r = t * Math.PI / 180;
1230
- return new f.Vector3(
1292
+ return new d.Vector3(
1231
1293
  Math.sin(r) * Math.sin(n),
1232
1294
  // East component
1233
1295
  Math.cos(r) * Math.sin(n),
@@ -1236,72 +1298,72 @@ function Qt(e, t) {
1236
1298
  // Up component
1237
1299
  ).normalize();
1238
1300
  }
1239
- function en(e, t = {}) {
1301
+ function ln(e, t = {}) {
1240
1302
  const {
1241
1303
  radius: n = 5,
1242
1304
  discThickness: r = 0.2,
1243
1305
  opacity: o = 0.7,
1244
1306
  segments: i = 32,
1245
1307
  colorMap: a = null
1246
- } = t, c = new f.Group(), l = new f.Vector3(0, 1, 0);
1308
+ } = t, l = new d.Group(), c = new d.Vector3(0, 1, 0);
1247
1309
  for (const s of e) {
1248
- const u = s.x != null ? s.x : s.easting != null ? s.easting : null, p = s.y != null ? s.y : s.northing != null ? s.northing : null, m = s.z != null ? s.z : s.elevation != null ? s.elevation : null;
1249
- if (u == null || p == null || m == null || !Number.isFinite(u) || !Number.isFinite(p) || !Number.isFinite(m)) continue;
1250
- const h = s[K] != null ? Number(s[K]) : null, d = s[W] != null ? Number(s[W]) : null;
1310
+ const u = s.x != null ? s.x : s.easting != null ? s.easting : null, h = s.y != null ? s.y : s.northing != null ? s.northing : null, p = s.z != null ? s.z : s.elevation != null ? s.elevation : null;
1311
+ if (u == null || h == null || p == null || !Number.isFinite(u) || !Number.isFinite(h) || !Number.isFinite(p)) continue;
1312
+ const b = s[J] != null ? Number(s[J]) : null, m = s[K] != null ? Number(s[K]) : null;
1251
1313
  let g;
1252
1314
  if (s.nx != null && Number.isFinite(s.nx) && s.ny != null && Number.isFinite(s.ny) && s.nz != null && Number.isFinite(s.nz))
1253
- g = new f.Vector3(s.nx, s.ny, s.nz).normalize();
1315
+ g = new d.Vector3(s.nx, s.ny, s.nz).normalize();
1254
1316
  else {
1255
- if (h == null || d == null || !Number.isFinite(h) || !Number.isFinite(d)) continue;
1256
- g = Qt(h, d);
1317
+ if (b == null || m == null || !Number.isFinite(b) || !Number.isFinite(m)) continue;
1318
+ g = an(b, m);
1257
1319
  }
1258
- const N = new f.CylinderGeometry(n, n, r, i, 1, !1), O = new f.MeshStandardMaterial({
1259
- color: Jt(s.structure_type, a),
1320
+ const y = new d.CylinderGeometry(n, n, r, i, 1, !1), O = new d.MeshStandardMaterial({
1321
+ color: sn(s.structure_type, a),
1260
1322
  transparent: !0,
1261
1323
  opacity: o,
1262
- side: f.DoubleSide
1263
- }), b = new f.Mesh(N, O);
1264
- b.position.set(u, p, m), b.quaternion.setFromUnitVectors(l, g), b.userData = {
1324
+ side: d.DoubleSide
1325
+ }), f = new d.Mesh(y, O);
1326
+ f.position.set(u, h, p), f.quaternion.setFromUnitVectors(c, g), f.userData = {
1265
1327
  type: "structure",
1266
1328
  hole_id: s.hole_id,
1267
1329
  depth: s.depth ?? s.mid,
1268
1330
  structure_type: s.structure_type,
1269
- dip: h,
1270
- azimuth: d,
1331
+ dip: b,
1332
+ azimuth: m,
1271
1333
  comments: s.comments
1272
- }, c.add(b);
1334
+ }, l.add(f);
1273
1335
  }
1274
- return c;
1336
+ return l;
1275
1337
  }
1276
- function tn(e, t, n, r = {}) {
1277
- if (!e.scene || (Ve(e), !(t != null && t.length) || !(n != null && n.length))) return;
1338
+ function cn(e, t, n, r = {}) {
1339
+ if (!e.scene || (Ue(e), !(t != null && t.length) || !(n != null && n.length))) return;
1278
1340
  const { maxDiscs: o = 3e3 } = r;
1279
1341
  let i = t;
1280
1342
  if (i.length > o) {
1281
- const l = i.length / o, s = [];
1343
+ const c = i.length / o, s = [];
1282
1344
  for (let u = 0; u < o; u++)
1283
- s.push(i[Math.floor(u * l)]);
1345
+ s.push(i[Math.floor(u * c)]);
1284
1346
  i = s;
1285
1347
  }
1286
- const a = n.flatMap((l) => (l.points || []).map((s) => ({ ...s, hole_id: l.id }))), c = Ft(i, a, r);
1287
- c.length && (e.structuralGroup = en(c, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((l) => {
1288
- l.isMesh && e.structuralMeshes.push(l);
1348
+ const a = n.flatMap((c) => (c.points || []).map((s) => ({ ...s, hole_id: c.id }))), l = Tt(i, a, r);
1349
+ l.length && (e.structuralGroup = ln(l, r), e.scene.add(e.structuralGroup), e.structuralGroup.traverse((c) => {
1350
+ c.isMesh && e.structuralMeshes.push(c);
1289
1351
  }), j(e));
1290
1352
  }
1291
- function Ve(e) {
1353
+ function Ue(e) {
1292
1354
  e.structuralGroup && (e.scene.remove(e.structuralGroup), e.structuralGroup.traverse((t) => {
1293
1355
  t.isMesh && (t.geometry.dispose(), t.material.dispose());
1294
1356
  }), e.structuralGroup = null), e.structuralMeshes = [], j(e);
1295
1357
  }
1296
- function nn(e, t) {
1358
+ function un(e, t) {
1297
1359
  e.structuralGroup && (e.structuralGroup.visible = !!t);
1298
1360
  }
1299
- let rn = 0;
1300
- function on(e) {
1361
+ let mn = 0;
1362
+ function dn(e) {
1301
1363
  let t, n, r, o;
1302
1364
  if ("width" in e || "height" in e || "x" in e && !("maxX" in e)) {
1303
- const i = Number(e.x ?? 0), a = Number(e.y ?? 0), c = Number(e.width ?? 0), l = Number(e.height ?? 0);
1304
- t = i, n = a, r = i + c, o = a + l;
1365
+ const i = Number(e.x ?? 0), a = Number(e.y ?? 0), l = Number(e.width ?? 0), c = Number(e.height ?? 0);
1366
+ t = i, n = a, r = i + l, o = a + c;
1305
1367
  } else
1306
1368
  t = Number(e.minX), n = Number(e.minY), r = Number(e.maxX), o = Number(e.maxY);
1307
1369
  if (r - t <= 0)
@@ -1314,7 +1376,7 @@ function on(e) {
1314
1376
  );
1315
1377
  return { minX: t, minY: n, maxX: r, maxY: o };
1316
1378
  }
1317
- function sn(e) {
1379
+ function fn(e) {
1318
1380
  if (e.type === "texture")
1319
1381
  return Promise.resolve(e.texture);
1320
1382
  let t, n = !1;
@@ -1327,7 +1389,7 @@ function sn(e) {
1327
1389
  new Error(`Unsupported raster source type: "${e.type}"`)
1328
1390
  );
1329
1391
  return new Promise((r, o) => {
1330
- new f.TextureLoader().load(
1392
+ new d.TextureLoader().load(
1331
1393
  t,
1332
1394
  (a) => {
1333
1395
  n && URL.revokeObjectURL(t), r(a);
@@ -1343,71 +1405,71 @@ function sn(e) {
1343
1405
  );
1344
1406
  });
1345
1407
  }
1346
- async function Rr(e) {
1347
- const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, a = e.id ?? `raster-overlay-${++rn}`, c = e.name ?? a;
1348
- let l = e.opacity ?? 1;
1349
- if ((l < 0 || l > 1) && (console.warn(
1350
- `[baselode] raster overlay "${a}": opacity ${l} is outside [0, 1] — clamped`
1351
- ), l = Math.max(0, Math.min(1, l))), !t) throw new Error("raster overlay: options.source is required");
1408
+ async function Xr(e) {
1409
+ const { source: t, bounds: n, elevation: r = 0, visible: o = !0, renderOrder: i = 0 } = e, a = e.id ?? `raster-overlay-${++mn}`, l = e.name ?? a;
1410
+ let c = e.opacity ?? 1;
1411
+ if ((c < 0 || c > 1) && (console.warn(
1412
+ `[baselode] raster overlay "${a}": opacity ${c} is outside [0, 1] — clamped`
1413
+ ), c = Math.max(0, Math.min(1, c))), !t) throw new Error("raster overlay: options.source is required");
1352
1414
  if (!n) throw new Error("raster overlay: options.bounds is required");
1353
- const s = on(n), { minX: u, minY: p, maxX: m, maxY: h } = s, d = m - u, g = h - p, N = (u + m) / 2, O = (p + h) / 2, b = await sn(t), A = new f.PlaneGeometry(d, g), y = new f.MeshBasicMaterial({
1354
- map: b,
1415
+ const s = dn(n), { minX: u, minY: h, maxX: p, maxY: b } = s, m = p - u, g = b - h, y = (u + p) / 2, O = (h + b) / 2, f = await fn(t), A = new d.PlaneGeometry(m, g), _ = new d.MeshBasicMaterial({
1416
+ map: f,
1355
1417
  transparent: !0,
1356
- opacity: l,
1357
- side: f.DoubleSide,
1418
+ opacity: c,
1419
+ side: d.DoubleSide,
1358
1420
  depthWrite: !1
1359
- }), E = new f.Mesh(A, y);
1360
- return E.position.set(N, O, r), E.renderOrder = i, E.visible = o, { id: a, name: c, mesh: E, texture: b, bounds: s, elevation: r, opacity: l, visible: o };
1421
+ }), z = new d.Mesh(A, _);
1422
+ return z.position.set(y, O, r), z.renderOrder = i, z.visible = o, { id: a, name: l, mesh: z, texture: f, bounds: s, elevation: r, opacity: c, visible: o };
1361
1423
  }
1362
- function an(e, t) {
1363
- e.scene && (e.rasterOverlays.has(t.id) && _e(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
1424
+ function hn(e, t) {
1425
+ e.scene && (e.rasterOverlays.has(t.id) && Me(e, t.id), e.rasterOverlays.set(t.id, t), e.scene.add(t.mesh));
1364
1426
  }
1365
- function _e(e, t) {
1427
+ function Me(e, t) {
1366
1428
  var r;
1367
1429
  const n = e.rasterOverlays.get(t);
1368
1430
  n && ((r = e.scene) == null || r.remove(n.mesh), n.mesh.geometry.dispose(), n.mesh.material.dispose(), n.texture && n.texture.dispose(), e.rasterOverlays.delete(t));
1369
1431
  }
1370
- function ln(e, t, n) {
1432
+ function bn(e, t, n) {
1371
1433
  const r = e.rasterOverlays.get(t);
1372
1434
  if (!r) return;
1373
1435
  const o = Math.max(0, Math.min(1, Number(n)));
1374
1436
  r.opacity = o, r.mesh.material.opacity = o, r.mesh.material.needsUpdate = !0;
1375
1437
  }
1376
- function cn(e, t, n) {
1438
+ function pn(e, t, n) {
1377
1439
  const r = e.rasterOverlays.get(t);
1378
1440
  r && (r.visible = !!n, r.mesh.visible = r.visible);
1379
1441
  }
1380
- function un(e, t, n) {
1442
+ function gn(e, t, n) {
1381
1443
  const r = e.rasterOverlays.get(t);
1382
1444
  r && (r.elevation = Number(n), r.mesh.position.setZ(r.elevation));
1383
1445
  }
1384
- function mn(e, t) {
1446
+ function yn(e, t) {
1385
1447
  return e.rasterOverlays.get(t);
1386
1448
  }
1387
- function dn(e) {
1449
+ function _n(e) {
1388
1450
  return Array.from(e.rasterOverlays.values());
1389
1451
  }
1390
- function fn(e) {
1452
+ function Mn(e) {
1391
1453
  for (const t of [...e.rasterOverlays.keys()])
1392
- _e(e, t);
1454
+ Me(e, t);
1393
1455
  }
1394
- function Me(e) {
1395
- var n, r, o, i, a, c, l, s, u;
1456
+ function Ee(e) {
1457
+ var n, r, o, i, a, l, c, s, u;
1396
1458
  if (!e) return "";
1397
- const t = (p) => Number.isFinite(p) ? p.toFixed(3) : "nan";
1459
+ const t = (h) => Number.isFinite(h) ? h.toFixed(3) : "nan";
1398
1460
  return [
1399
1461
  t((n = e.camera) == null ? void 0 : n.x),
1400
1462
  t((r = e.camera) == null ? void 0 : r.y),
1401
1463
  t((o = e.camera) == null ? void 0 : o.z),
1402
1464
  t((i = e.target) == null ? void 0 : i.x),
1403
1465
  t((a = e.target) == null ? void 0 : a.y),
1404
- t((c = e.target) == null ? void 0 : c.z),
1405
- t((l = e.up) == null ? void 0 : l.x),
1466
+ t((l = e.target) == null ? void 0 : l.z),
1467
+ t((c = e.up) == null ? void 0 : c.x),
1406
1468
  t((s = e.up) == null ? void 0 : s.y),
1407
1469
  t((u = e.up) == null ? void 0 : u.z)
1408
1470
  ].join("|");
1409
1471
  }
1410
- function He(e) {
1472
+ function $e(e) {
1411
1473
  return !e.camera || !e.controls ? null : {
1412
1474
  camera: {
1413
1475
  x: e.camera.position.x,
@@ -1426,37 +1488,37 @@ function He(e) {
1426
1488
  }
1427
1489
  };
1428
1490
  }
1429
- function hn(e, t) {
1491
+ function En(e, t) {
1430
1492
  if (!e.camera || !e.controls || !t) return !1;
1431
1493
  const n = t.camera || {}, r = t.target || {}, o = t.up || {};
1432
- return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Me(t), !0) : !1;
1494
+ return [n.x, n.y, n.z, r.x, r.y, r.z, o.x, o.y, o.z].every(Number.isFinite) ? (e.camera.position.set(n.x, n.y, n.z), e.controls.target.set(r.x, r.y, r.z), e.camera.up.set(o.x, o.y, o.z), e.camera.lookAt(r.x, r.y, r.z), e.controls.update(), e._lastViewSignature = Ee(t), !0) : !1;
1433
1495
  }
1434
- function bn(e) {
1496
+ function zn(e) {
1435
1497
  if (!e.viewChangeHandler) return;
1436
1498
  const t = Date.now();
1437
1499
  if (t - e._lastViewEmitMs < 250) return;
1438
- const n = He(e);
1500
+ const n = $e(e);
1439
1501
  if (!n) return;
1440
- const r = Me(n);
1502
+ const r = Ee(n);
1441
1503
  r !== e._lastViewSignature && (e._lastViewSignature = r, e._lastViewEmitMs = t, e.viewChangeHandler(n));
1442
1504
  }
1443
- function Ee(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
1444
- const c = (t + n) / 2, l = (r + o) / 2, s = (i + a) / 2, u = n - t, p = o - r, m = a - i, d = Math.max(u, p, m, 1) * 2;
1445
- e.controls.target.set(c, l, s), e.camera.position.set(c + d, l + d, s + d), e.camera.lookAt(c, l, s), e.controls.update();
1505
+ function ze(e, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
1506
+ const l = (t + n) / 2, c = (r + o) / 2, s = (i + a) / 2, u = n - t, h = o - r, p = a - i, m = Math.max(u, h, p, 1) * 2;
1507
+ e.controls.target.set(l, c, s), e.camera.position.set(l + m, c + m, s + m), e.camera.lookAt(l, c, s), e.controls.update();
1446
1508
  }
1447
- function pn(e, t = 1e3) {
1509
+ function Nn(e, t = 1e3) {
1448
1510
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(t, t, t), e.camera.lookAt(0, 0, 0), e.controls.update());
1449
1511
  }
1450
- function gn(e, t = 2e3) {
1512
+ function On(e, t = 2e3) {
1451
1513
  !e.camera || !e.controls || (e.controls.target.set(0, 0, 0), e.camera.position.set(0, 0, t), e.camera.up.set(0, 1, 0), e.camera.lookAt(0, 0, 0), e.controls.update());
1452
1514
  }
1453
- function yn(e, t = 0, n = 0) {
1515
+ function Ln(e, t = 0, n = 0) {
1454
1516
  e.controls && typeof e.controls.pan == "function" && (e.controls.pan(t, n), e.controls.update());
1455
1517
  }
1456
- function _n(e, t = 1.1) {
1518
+ function An(e, t = 1.1) {
1457
1519
  !e.controls || typeof e.controls.dollyIn != "function" || typeof e.controls.dollyOut != "function" || (t > 1 ? e.controls.dollyOut(t) : e.controls.dollyIn(1 / t), e.controls.update());
1458
1520
  }
1459
- function Mn(e, t = 1.2) {
1521
+ function kn(e, t = 1.2) {
1460
1522
  if (!e.lastBounds) return;
1461
1523
  const {
1462
1524
  minX: n,
@@ -1464,17 +1526,17 @@ function Mn(e, t = 1.2) {
1464
1526
  minY: o,
1465
1527
  maxY: i,
1466
1528
  minZ: a,
1467
- maxZ: c
1468
- } = e.lastBounds, l = (r - n) * t, s = (i - o) * t, u = (c - a) * t, p = (n + r) / 2, m = (o + i) / 2, h = (a + c) / 2, g = Math.max(l, s, u, 1) * 2;
1469
- e.controls.target.set(p, m, h), e.camera.position.set(p + g, m + g, h + g), e.camera.lookAt(p, m, h), e.controls.update();
1529
+ maxZ: l
1530
+ } = e.lastBounds, c = (r - n) * t, s = (i - o) * t, u = (l - a) * t, h = (n + r) / 2, p = (o + i) / 2, b = (a + l) / 2, g = Math.max(c, s, u, 1) * 2;
1531
+ e.controls.target.set(h, p, b), e.camera.position.set(h + g, p + g, b + g), e.camera.lookAt(h, p, b), e.controls.update();
1470
1532
  }
1471
- const En = 1, zn = 120;
1472
- function Nn(e, t) {
1533
+ const Dn = 1, Sn = 120;
1534
+ function wn(e, t) {
1473
1535
  if (!e.camera || !e.controls || !Number.isFinite(t)) return !1;
1474
- const n = Math.min(zn, Math.max(En, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, a = 2 * o * Math.tan(i / 2), c = n * Math.PI / 180, l = a / (2 * Math.tan(c / 2)), s = e.camera.position.clone().sub(r).normalize();
1475
- return e.camera.position.copy(r).addScaledVector(s, l), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
1536
+ const n = Math.min(Sn, Math.max(Dn, t)), r = e.controls.target, o = e.camera.position.distanceTo(r), i = e.camera.fov * Math.PI / 180, a = 2 * o * Math.tan(i / 2), l = n * Math.PI / 180, c = a / (2 * Math.tan(l / 2)), s = e.camera.position.clone().sub(r).normalize();
1537
+ return e.camera.position.copy(r).addScaledVector(s, c), e.camera.fov = n, e.camera.updateProjectionMatrix(), e.controls.update(), !0;
1476
1538
  }
1477
- function On(e, t = "orbit") {
1539
+ function xn(e, t = "orbit") {
1478
1540
  if (e.controlMode = t === "fly" ? "fly" : "orbit", e.controlMode === "fly")
1479
1541
  e.controls && (e.controls.enabled = !1), e.flyControls && (e.flyControls.enabled = !0);
1480
1542
  else if (e.flyControls && (e.flyControls.enabled = !1), e.controls) {
@@ -1484,36 +1546,36 @@ function On(e, t = "orbit") {
1484
1546
  }
1485
1547
  }
1486
1548
  const T = "#9ca3af";
1487
- function Le(e, t) {
1549
+ function De(e, t) {
1488
1550
  const n = Number(e == null ? void 0 : e.md), r = Number(t == null ? void 0 : t.md);
1489
1551
  if (!Number.isFinite(n) || !Number.isFinite(r)) return null;
1490
1552
  const o = Math.min(n, r), i = Math.max(n, r);
1491
1553
  return i <= o ? null : { segStart: o, segEnd: i };
1492
1554
  }
1493
- function kn(e, t, n) {
1555
+ function vn(e, t, n) {
1494
1556
  let r = 0, o = 0;
1495
1557
  for (let a = 0; a < e.length; a += 1) {
1496
- const c = e[a], l = Number(c == null ? void 0 : c.from), s = Number(c == null ? void 0 : c.to), u = Number(c == null ? void 0 : c.value);
1497
- if (!Number.isFinite(l) || !Number.isFinite(s) || !Number.isFinite(u) || s <= l) continue;
1498
- const p = Math.max(t, l), h = Math.min(n, s) - p;
1499
- h <= 0 || (r += u * h, o += h);
1558
+ const l = e[a], c = Number(l == null ? void 0 : l.from), s = Number(l == null ? void 0 : l.to), u = Number(l == null ? void 0 : l.value);
1559
+ if (!Number.isFinite(c) || !Number.isFinite(s) || !Number.isFinite(u) || s <= c) continue;
1560
+ const h = Math.max(t, c), b = Math.min(n, s) - h;
1561
+ b <= 0 || (r += u * b, o += b);
1500
1562
  }
1501
1563
  if (o <= 0) return null;
1502
1564
  const i = r / o;
1503
1565
  return Number.isFinite(i) ? i : null;
1504
1566
  }
1505
- function An(e, t) {
1506
- if (!Number.isFinite(e)) return new f.Color(T);
1507
- if (Re(e, t) < 0) return new f.Color(T);
1508
- const r = Wt(e, t, T);
1509
- return new f.Color(r);
1567
+ function Fn(e, t) {
1568
+ if (!Number.isFinite(e)) return new d.Color(T);
1569
+ if (je(e, t) < 0) return new d.Color(T);
1570
+ const r = rn(e, t, T);
1571
+ return new d.Color(r);
1510
1572
  }
1511
- function Ln(e) {
1573
+ function Cn(e) {
1512
1574
  if (!e || !String(e).trim()) return T;
1513
- const t = Ge(String(e).toLowerCase().trim());
1514
- return "#" + new f.Color().setHSL(t, 0.7, 0.5).getHexString();
1575
+ const t = Ye(String(e).toLowerCase().trim());
1576
+ return "#" + new d.Color().setHSL(t, 0.7, 0.5).getHexString();
1515
1577
  }
1516
- function Dn(e = {}) {
1578
+ function In(e = {}) {
1517
1579
  return {
1518
1580
  preserveView: !!e.preserveView,
1519
1581
  assayIntervalsByHole: e.assayIntervalsByHole || null,
@@ -1521,7 +1583,7 @@ function Dn(e = {}) {
1521
1583
  isCategoricalVariable: !!e.isCategoricalVariable
1522
1584
  };
1523
1585
  }
1524
- function Sn(e, t) {
1586
+ function Tn(e, t) {
1525
1587
  if (!e || !t) return [];
1526
1588
  const n = [];
1527
1589
  return Object.values(e).forEach((r) => {
@@ -1531,138 +1593,138 @@ function Sn(e, t) {
1531
1593
  });
1532
1594
  }), n;
1533
1595
  }
1534
- function oe(e) {
1596
+ function ie(e) {
1535
1597
  return {
1536
1598
  holeId: e.id,
1537
1599
  project: e.project
1538
1600
  };
1539
1601
  }
1540
- function wn(e) {
1602
+ function Pn(e) {
1541
1603
  return `${e ?? ""}`.trim().toLowerCase();
1542
1604
  }
1543
- function xn(e, t) {
1544
- const n = `${e ?? ""}:${t ?? 0}`, r = Ge(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, a = new f.Color();
1605
+ function Bn(e, t) {
1606
+ const n = `${e ?? ""}:${t ?? 0}`, r = Ye(n), o = (t ?? 0) % 14 / 14, i = (r * 0.15 + o * 0.85) % 1, a = new d.Color();
1545
1607
  return a.setHSL(i, 1, 0.5), a;
1546
1608
  }
1547
- function Ge(e) {
1609
+ function Ye(e) {
1548
1610
  const t = `${e ?? ""}`;
1549
1611
  let n = 2166136261;
1550
1612
  for (let r = 0; r < t.length; r += 1)
1551
1613
  n ^= t.charCodeAt(r), n = Math.imul(n, 16777619);
1552
1614
  return (n >>> 0) / 4294967295;
1553
1615
  }
1554
- function Fn(e, t, n) {
1616
+ function Rn(e, t, n) {
1555
1617
  let r = null, o = 0;
1556
1618
  for (const i of e) {
1557
- const a = Number(i == null ? void 0 : i.from), c = Number(i == null ? void 0 : i.to);
1558
- if (!Number.isFinite(a) || !Number.isFinite(c)) continue;
1559
- const l = Math.min(n, c) - Math.max(t, a);
1560
- l > o && (o = l, r = i == null ? void 0 : i.value);
1619
+ const a = Number(i == null ? void 0 : i.from), l = Number(i == null ? void 0 : i.to);
1620
+ if (!Number.isFinite(a) || !Number.isFinite(l)) continue;
1621
+ const c = Math.min(n, l) - Math.max(t, a);
1622
+ c > o && (o = c, r = i == null ? void 0 : i.value);
1561
1623
  }
1562
1624
  return r;
1563
1625
  }
1564
- function vn(e, t) {
1626
+ function Vn(e, t) {
1565
1627
  if (!t || !e) return [];
1566
1628
  const n = e.id || e.holeId;
1567
1629
  if (!n) return [];
1568
1630
  const r = t[n];
1569
1631
  if (Array.isArray(r) && r.length) return r;
1570
- const o = wn(n);
1632
+ const o = Pn(n);
1571
1633
  if (o) {
1572
1634
  const i = t[o];
1573
1635
  if (Array.isArray(i) && i.length) return i;
1574
1636
  }
1575
1637
  return [];
1576
1638
  }
1577
- function Cn({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: a, isCategorical: c }) {
1639
+ function Hn({ selectedAssayVariable: e, assayIntervals: t, assayScale: n, holeId: r, segmentIndex: o, p1: i, p2: a, isCategorical: l }) {
1578
1640
  if (!e)
1579
- return xn(r, o);
1641
+ return Bn(r, o);
1580
1642
  if (e === "__HAS_ASSAY__") {
1581
- if (!(t != null && t.length)) return new f.Color(T);
1582
- const u = Le(i, a);
1583
- return u ? t.some((m) => {
1584
- const h = Number(m == null ? void 0 : m.from), d = Number(m == null ? void 0 : m.to);
1585
- if (!Number.isFinite(h) || !Number.isFinite(d)) return !1;
1586
- const g = Math.max(u.segStart, h);
1587
- return Math.min(u.segEnd, d) > g;
1588
- }) ? new f.Color("#ff8c42") : new f.Color(T) : new f.Color(T);
1589
- }
1590
- if (!(t != null && t.length)) return new f.Color(T);
1591
- const l = Le(i, a);
1592
- if (!l) return new f.Color(T);
1593
- if (c) {
1594
- const u = Fn(t, l.segStart, l.segEnd);
1595
- return new f.Color(Ln(u));
1596
- }
1597
- const s = kn(t, l.segStart, l.segEnd);
1598
- return An(s, n);
1599
- }
1600
- function In(e, t, n = {}) {
1601
- if (!e.scene || (je(e), !t || t.length === 0)) return;
1602
- const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: a } = Dn(n), c = a ? [] : Sn(o, i), l = qt(c);
1603
- let s = 1 / 0, u = -1 / 0, p = 1 / 0, m = -1 / 0, h = 1 / 0, d = -1 / 0;
1604
- const g = new f.Vector3(), N = new f.Vector3(0, 1, 0);
1605
- t.forEach((O, b) => {
1606
- const y = b * 137.5 % 360 / 360, E = new f.Color().setHSL(y, 0.75, 0.55), k = (O.points || []).map((L) => {
1607
- s = Math.min(s, L.x), u = Math.max(u, L.x), p = Math.min(p, L.y), m = Math.max(m, L.y), h = Math.min(h, L.z), d = Math.max(d, L.z);
1608
- const x = new f.Vector3(L.x, L.y, L.z);
1609
- return x.md = L.md, x;
1643
+ if (!(t != null && t.length)) return new d.Color(T);
1644
+ const u = De(i, a);
1645
+ return u ? t.some((p) => {
1646
+ const b = Number(p == null ? void 0 : p.from), m = Number(p == null ? void 0 : p.to);
1647
+ if (!Number.isFinite(b) || !Number.isFinite(m)) return !1;
1648
+ const g = Math.max(u.segStart, b);
1649
+ return Math.min(u.segEnd, m) > g;
1650
+ }) ? new d.Color("#ff8c42") : new d.Color(T) : new d.Color(T);
1651
+ }
1652
+ if (!(t != null && t.length)) return new d.Color(T);
1653
+ const c = De(i, a);
1654
+ if (!c) return new d.Color(T);
1655
+ if (l) {
1656
+ const u = Rn(t, c.segStart, c.segEnd);
1657
+ return new d.Color(Cn(u));
1658
+ }
1659
+ const s = vn(t, c.segStart, c.segEnd);
1660
+ return Fn(s, n);
1661
+ }
1662
+ function Gn(e, t, n = {}) {
1663
+ if (!e.scene || (Xe(e), !t || t.length === 0)) return;
1664
+ const { preserveView: r, assayIntervalsByHole: o, selectedAssayVariable: i, isCategoricalVariable: a } = In(n), l = a ? [] : Tn(o, i), c = tn(l);
1665
+ let s = 1 / 0, u = -1 / 0, h = 1 / 0, p = -1 / 0, b = 1 / 0, m = -1 / 0;
1666
+ const g = new d.Vector3(), y = new d.Vector3(0, 1, 0);
1667
+ t.forEach((O, f) => {
1668
+ const _ = f * 137.5 % 360 / 360, z = new d.Color().setHSL(_, 0.75, 0.55), L = (O.points || []).map((k) => {
1669
+ s = Math.min(s, k.x), u = Math.max(u, k.x), h = Math.min(h, k.y), p = Math.max(p, k.y), b = Math.min(b, k.z), m = Math.max(m, k.z);
1670
+ const x = new d.Vector3(k.x, k.y, k.z);
1671
+ return x.md = k.md, x;
1610
1672
  });
1611
- if (k.length < 2) {
1612
- if (k.length === 1) {
1613
- const L = new f.SphereGeometry(5, 12, 12), x = new f.MeshLambertMaterial({
1614
- color: E,
1615
- emissive: E,
1673
+ if (L.length < 2) {
1674
+ if (L.length === 1) {
1675
+ const k = new d.SphereGeometry(5, 12, 12), x = new d.MeshLambertMaterial({
1676
+ color: z,
1677
+ emissive: z,
1616
1678
  emissiveIntensity: 0.2
1617
- }), S = new f.Mesh(L, x);
1618
- S.position.copy(k[0]), S.userData = oe(O), e.scene.add(S), e.drillLines.push(S), e.drillMeshes.push(S);
1679
+ }), S = new d.Mesh(k, x);
1680
+ S.position.copy(L[0]), S.userData = ie(O), e.scene.add(S), e.drillLines.push(S), e.drillMeshes.push(S);
1619
1681
  }
1620
1682
  return;
1621
1683
  }
1622
- const D = new f.Group();
1623
- D.userData = oe(O);
1624
- const w = i ? vn(O, o) : [];
1625
- for (let L = 0; L < k.length - 1; L += 1) {
1626
- const x = k[L], S = k[L + 1], v = g.subVectors(S, x), I = v.length();
1684
+ const D = new d.Group();
1685
+ D.userData = ie(O);
1686
+ const w = i ? Vn(O, o) : [];
1687
+ for (let k = 0; k < L.length - 1; k += 1) {
1688
+ const x = L[k], S = L[k + 1], F = g.subVectors(S, x), I = F.length();
1627
1689
  if (I <= 1e-3) continue;
1628
- const C = 2.2, B = new f.CylinderGeometry(C, C, I, 6, 1, !0), P = Cn({
1690
+ const C = 2.2, P = new d.CylinderGeometry(C, C, I, 6, 1, !0), B = Hn({
1629
1691
  selectedAssayVariable: i,
1630
1692
  assayIntervals: w,
1631
- assayScale: l,
1693
+ assayScale: c,
1632
1694
  holeId: O.id,
1633
- segmentIndex: L,
1695
+ segmentIndex: k,
1634
1696
  p1: x,
1635
1697
  p2: S,
1636
1698
  isCategorical: a
1637
- }), z = new f.MeshLambertMaterial({
1638
- color: P,
1699
+ }), N = new d.MeshLambertMaterial({
1700
+ color: B,
1639
1701
  flatShading: !0,
1640
- emissive: P,
1702
+ emissive: B,
1641
1703
  emissiveIntensity: 0.15
1642
- }), F = new f.Mesh(B, z);
1643
- F.position.copy(x.clone().addScaledVector(v, 0.5)), F.quaternion.setFromUnitVectors(N, v.clone().normalize()), F.userData = oe(O), D.add(F), e.drillMeshes.push(F);
1704
+ }), v = new d.Mesh(P, N);
1705
+ v.position.copy(x.clone().addScaledVector(F, 0.5)), v.quaternion.setFromUnitVectors(y, F.clone().normalize()), v.userData = ie(O), D.add(v), e.drillMeshes.push(v);
1644
1706
  }
1645
1707
  e.scene.add(D), e.drillLines.push(D);
1646
- }), e.camera && e.controls && (e.lastBounds = { minX: s, maxX: u, minY: p, maxY: m, minZ: h, maxZ: d }, r || Ee(e, { minX: s, maxX: u, minY: p, maxY: m, minZ: h, maxZ: d })), j(e);
1708
+ }), e.camera && e.controls && (e.lastBounds = { minX: s, maxX: u, minY: h, maxY: p, minZ: b, maxZ: m }, r || ze(e, { minX: s, maxX: u, minY: h, maxY: p, minZ: b, maxZ: m })), j(e);
1647
1709
  }
1648
- function je(e) {
1710
+ function Xe(e) {
1649
1711
  e.drillLines.forEach((t) => {
1650
1712
  e.scene.remove(t), t.isGroup ? t.traverse((n) => {
1651
1713
  n.isMesh && (n.geometry.dispose(), n.material.dispose());
1652
1714
  }) : t.isMesh && (t.geometry.dispose(), t.material.dispose());
1653
1715
  }), e.drillLines = [], e.drillMeshes = [], j(e);
1654
1716
  }
1655
- const Tn = 20, Bn = 15, Pn = "#00bcd4";
1656
- function Rn(e = {}) {
1717
+ const jn = 20, Un = 15, $n = "#00bcd4";
1718
+ function Yn(e = {}) {
1657
1719
  return {
1658
- panelWidth: e.panelWidth != null ? Number(e.panelWidth) : Tn,
1659
- lateralOffset: e.lateralOffset != null ? Number(e.lateralOffset) : Bn,
1660
- color: e.color || Pn,
1720
+ panelWidth: e.panelWidth != null ? Number(e.panelWidth) : jn,
1721
+ lateralOffset: e.lateralOffset != null ? Number(e.lateralOffset) : Un,
1722
+ color: e.color || $n,
1661
1723
  valueMin: e.valueMin != null ? Number(e.valueMin) : null,
1662
1724
  valueMax: e.valueMax != null ? Number(e.valueMax) : null
1663
1725
  };
1664
1726
  }
1665
- function Vr(e) {
1727
+ function qr(e) {
1666
1728
  if (!e || e.length < 2) return null;
1667
1729
  let t = -1 / 0, n = 1 / 0;
1668
1730
  for (const o of e)
@@ -1670,116 +1732,116 @@ function Vr(e) {
1670
1732
  const r = t - n;
1671
1733
  return r < 1e-3 ? null : { topZ: t, botZ: n, height: r };
1672
1734
  }
1673
- function Vn(e, t, n, r, o, i, a) {
1735
+ function Xn(e, t, n, r, o, i, a) {
1674
1736
  if (!Array.isArray(e) || !Array.isArray(t)) return [];
1675
- const c = Math.min(e.length, t.length), l = [];
1676
- for (let b = 0; b < c; b++)
1677
- Number.isFinite(e[b]) && Number.isFinite(t[b]) && l.push({ d: e[b], v: t[b] });
1678
- if (l.length < 2) return [];
1679
- const s = a != null && a > 0 ? a : null, u = s != null ? 0 : Math.min(...l.map((b) => b.d)), m = (s ?? Math.max(...l.map((b) => b.d))) - u || 1, h = Math.min(...l.map((b) => b.v)), d = Math.max(...l.map((b) => b.v)), g = o ?? h, O = (i ?? d) - g || 1;
1680
- return l.map(({ d: b, v: A }) => {
1681
- const y = (b - u) / m, E = Math.max(0, Math.min(1, (A - g) / O)), k = -n / 2 + E * n, D = y * r;
1682
- return new f.Vector3(k, D, 0.01);
1737
+ const l = Math.min(e.length, t.length), c = [];
1738
+ for (let f = 0; f < l; f++)
1739
+ Number.isFinite(e[f]) && Number.isFinite(t[f]) && c.push({ d: e[f], v: t[f] });
1740
+ if (c.length < 2) return [];
1741
+ const s = a != null && a > 0 ? a : null, u = s != null ? 0 : Math.min(...c.map((f) => f.d)), p = (s ?? Math.max(...c.map((f) => f.d))) - u || 1, b = Math.min(...c.map((f) => f.v)), m = Math.max(...c.map((f) => f.v)), g = o ?? b, O = (i ?? m) - g || 1;
1742
+ return c.map(({ d: f, v: A }) => {
1743
+ const _ = (f - u) / p, z = Math.max(0, Math.min(1, (A - g) / O)), L = -n / 2 + z * n, D = _ * r;
1744
+ return new d.Vector3(L, D, 0.01);
1683
1745
  });
1684
1746
  }
1685
- function Hn(e, t) {
1747
+ function qn(e, t) {
1686
1748
  const n = e.length;
1687
1749
  if (n < 2) return null;
1688
1750
  const r = [], o = [];
1689
1751
  let i = 0;
1690
- for (let c = 0; c < n - 1; c++) {
1691
- const l = e[c], s = e[c + 1], u = s.x - l.x, p = s.y - l.y, m = Math.sqrt(u * u + p * p);
1692
- if (m < 1e-6) continue;
1693
- const h = -p / m * t, d = u / m * t, g = 0.01;
1752
+ for (let l = 0; l < n - 1; l++) {
1753
+ const c = e[l], s = e[l + 1], u = s.x - c.x, h = s.y - c.y, p = Math.sqrt(u * u + h * h);
1754
+ if (p < 1e-6) continue;
1755
+ const b = -h / p * t, m = u / p * t, g = 0.01;
1694
1756
  r.push(
1695
- l.x + h,
1696
- l.y + d,
1757
+ c.x + b,
1758
+ c.y + m,
1697
1759
  g,
1698
- l.x - h,
1699
- l.y - d,
1760
+ c.x - b,
1761
+ c.y - m,
1700
1762
  g,
1701
- s.x + h,
1702
- s.y + d,
1763
+ s.x + b,
1764
+ s.y + m,
1703
1765
  g,
1704
- s.x - h,
1705
- s.y - d,
1766
+ s.x - b,
1767
+ s.y - m,
1706
1768
  g
1707
1769
  ), o.push(i, i + 1, i + 2, i + 1, i + 3, i + 2), i += 4;
1708
1770
  }
1709
1771
  if (r.length === 0) return null;
1710
- const a = new f.BufferGeometry();
1711
- return a.setAttribute("position", new f.Float32BufferAttribute(r, 3)), a.setIndex(o), a;
1772
+ const a = new d.BufferGeometry();
1773
+ return a.setAttribute("position", new d.Float32BufferAttribute(r, 3)), a.setIndex(o), a;
1712
1774
  }
1713
- function Gn(e, t) {
1775
+ function Zn(e, t) {
1714
1776
  const n = e.points || [];
1715
1777
  if (n.length < 2) return null;
1716
- const r = n[0], o = n[n.length - 1], i = new f.Vector3(
1778
+ const r = n[0], o = n[n.length - 1], i = new d.Vector3(
1717
1779
  o.x - r.x,
1718
1780
  o.y - r.y,
1719
1781
  o.z - r.z
1720
1782
  ), a = i.length();
1721
1783
  if (a < 1e-3) return null;
1722
- const c = i.clone().normalize(), l = Rn(t.options), { panelWidth: s, lateralOffset: u, color: p, valueMin: m, valueMax: h } = l, d = new f.Vector3(0, 0, 1);
1723
- let g = new f.Vector3().crossVectors(c, d);
1784
+ const l = i.clone().normalize(), c = Yn(t.options), { panelWidth: s, lateralOffset: u, color: h, valueMin: p, valueMax: b } = c, m = new d.Vector3(0, 0, 1);
1785
+ let g = new d.Vector3().crossVectors(l, m);
1724
1786
  g.lengthSq() < 1e-6 ? g.set(1, 0, 0) : g.normalize();
1725
- const N = new f.Vector3().crossVectors(g, c).normalize(), O = new f.Vector3(r.x, r.y, r.z).addScaledVector(g, u), b = new f.Matrix4().makeBasis(g, c, N), A = new f.Quaternion().setFromRotationMatrix(b), y = n.map((v) => v.md).filter(Number.isFinite), E = y.length > 0 ? Math.max(...y) : a, k = Vn(
1787
+ const y = new d.Vector3().crossVectors(g, l).normalize(), O = new d.Vector3(r.x, r.y, r.z).addScaledVector(g, u), f = new d.Matrix4().makeBasis(g, l, y), A = new d.Quaternion().setFromRotationMatrix(f), _ = n.map((F) => F.md).filter(Number.isFinite), z = _.length > 0 ? Math.max(..._) : a, L = Xn(
1726
1788
  t.depths,
1727
1789
  t.values,
1728
1790
  s,
1729
1791
  a,
1730
- m,
1731
- h,
1732
- E
1792
+ p,
1793
+ b,
1794
+ z
1733
1795
  );
1734
- if (k.length < 2) return null;
1735
- const D = new f.Group();
1796
+ if (L.length < 2) return null;
1797
+ const D = new d.Group();
1736
1798
  D.userData = { holeId: e.id, isStripLog: !0 };
1737
- const w = s * 0.025, L = Hn(k, w);
1738
- if (!L) return null;
1739
- const x = new f.MeshBasicMaterial({
1740
- color: new f.Color(p),
1741
- side: f.DoubleSide
1742
- }), S = new f.Mesh(L, x);
1799
+ const w = s * 0.025, k = qn(L, w);
1800
+ if (!k) return null;
1801
+ const x = new d.MeshBasicMaterial({
1802
+ color: new d.Color(h),
1803
+ side: d.DoubleSide
1804
+ }), S = new d.Mesh(k, x);
1743
1805
  return S.position.copy(O), S.quaternion.copy(A), D.add(S), D;
1744
1806
  }
1745
- function jn(e, t, n) {
1746
- if (!e.scene || (ce(e), !n || n.length === 0) || !t || t.length === 0) return;
1807
+ function Wn(e, t, n) {
1808
+ if (!e.scene || (ue(e), !n || n.length === 0) || !t || t.length === 0) return;
1747
1809
  const r = /* @__PURE__ */ new Map();
1748
1810
  t.forEach((o) => {
1749
1811
  o.id != null && r.set(o.id, o);
1750
1812
  }), n.forEach((o) => {
1751
1813
  const i = r.get(o.holeId);
1752
1814
  if (!i) return;
1753
- const a = Gn(i, o);
1815
+ const a = Zn(i, o);
1754
1816
  a && (e.scene.add(a), e.stripLogGroups.push(a));
1755
1817
  });
1756
1818
  }
1757
- function ce(e) {
1819
+ function ue(e) {
1758
1820
  e.stripLogGroups && (e.stripLogGroups.forEach((t) => {
1759
1821
  e.scene && e.scene.remove(t), t.traverse((n) => {
1760
1822
  n.geometry && n.geometry.dispose(), n.material && n.material.dispose();
1761
1823
  });
1762
1824
  }), e.stripLogGroups = []);
1763
1825
  }
1764
- const De = "#ffffbb", Un = 2, Yn = 1.5, $n = 1;
1765
- function Xn(e) {
1826
+ const Se = "#ffffbb", Kn = 2, Jn = 1.5, Qn = 1;
1827
+ function er(e) {
1766
1828
  const { renderer: t, scene: n, camera: r, container: o } = e;
1767
1829
  if (!t || !n || !r) return;
1768
- const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, a = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, c = new lt(t), l = new ct(n, r);
1769
- c.addPass(l);
1770
- const s = new f.Vector2(i, a), u = new ut(s, n, r);
1771
- u.visibleEdgeColor.set(De), u.hiddenEdgeColor.set(De), u.edgeStrength = Un, u.edgeThickness = Yn, u.edgeGlow = $n, u.pulsePeriod = 0, u.selectedObjects = [], c.addPass(u), c.setSize(i, a), e._composer = c, e._outlinePass = u;
1830
+ const i = (o == null ? void 0 : o.clientWidth) || t.domElement.clientWidth || 1, a = (o == null ? void 0 : o.clientHeight) || t.domElement.clientHeight || 1, l = new dt(t), c = new ft(n, r);
1831
+ l.addPass(c);
1832
+ const s = new d.Vector2(i, a), u = new ht(s, n, r);
1833
+ u.visibleEdgeColor.set(Se), u.hiddenEdgeColor.set(Se), u.edgeStrength = Kn, u.edgeThickness = Jn, u.edgeGlow = Qn, u.pulsePeriod = 0, u.selectedObjects = [], l.addPass(u), l.setSize(i, a), e._composer = l, e._outlinePass = u;
1772
1834
  }
1773
- function qn(e, t, n) {
1835
+ function tr(e, t, n) {
1774
1836
  !e._composer || !e._outlinePass || (e._composer.setSize(t, n), e._outlinePass.resolution.set(t, n));
1775
1837
  }
1776
- function Z(e, t) {
1838
+ function W(e, t) {
1777
1839
  e._outlinePass && (e._outlinePass.selectedObjects = t ? [t] : [], e._selectedObject = t || null);
1778
1840
  }
1779
- function Se(e) {
1841
+ function we(e) {
1780
1842
  e._composer && (e._composer.dispose(), e._composer = null), e._outlinePass = null, e._selectedObject = null, e.selectables = [];
1781
1843
  }
1782
- const Zn = [
1844
+ const nr = [
1783
1845
  { normal: [1, 0, 0], neibDir: [1, 0, 0], verts: [[1, -1, -1], [1, 1, -1], [1, 1, 1], [1, -1, 1]] },
1784
1846
  { normal: [-1, 0, 0], neibDir: [-1, 0, 0], verts: [[-1, -1, 1], [-1, 1, 1], [-1, 1, -1], [-1, -1, -1]] },
1785
1847
  { normal: [0, 1, 0], neibDir: [0, 1, 0], verts: [[-1, 1, 1], [1, 1, 1], [1, 1, -1], [-1, 1, -1]] },
@@ -1787,181 +1849,181 @@ const Zn = [
1787
1849
  { normal: [0, 0, 1], neibDir: [0, 0, 1], verts: [[-1, -1, 1], [1, -1, 1], [1, 1, 1], [-1, 1, 1]] },
1788
1850
  { normal: [0, 0, -1], neibDir: [0, 0, -1], verts: [[1, -1, -1], [-1, -1, -1], [-1, 1, -1], [1, 1, -1]] }
1789
1851
  ];
1790
- function Wn(e, t, n, r, o = {}) {
1791
- if (!e.scene || (Ue(e), !t || !n || !r)) return;
1852
+ function rr(e, t, n, r, o = {}) {
1853
+ if (!e.scene || (qe(e), !t || !n || !r)) return;
1792
1854
  const { autoCenter: i = !0, opacity: a = 1 } = o;
1793
- let c = 1 / 0, l = -1 / 0, s = 1 / 0, u = -1 / 0, p = 1 / 0, m = -1 / 0;
1794
- t.forEach((z) => {
1795
- const F = Number(z.x ?? z.center_x ?? 0), R = Number(z.y ?? z.center_y ?? 0), Y = Number(z.z ?? z.center_z ?? 0), $ = Number(z.dx ?? z.size_x ?? 1), X = Number(z.dy ?? z.size_y ?? 1), q = Number(z.dz ?? z.size_z ?? 1);
1796
- c = Math.min(c, F - $ / 2), l = Math.max(l, F + $ / 2), s = Math.min(s, R - X / 2), u = Math.max(u, R + X / 2), p = Math.min(p, Y - q / 2), m = Math.max(m, Y + q / 2);
1855
+ let l = 1 / 0, c = -1 / 0, s = 1 / 0, u = -1 / 0, h = 1 / 0, p = -1 / 0;
1856
+ t.forEach((N) => {
1857
+ const v = Number(N.x ?? N.center_x ?? 0), R = Number(N.y ?? N.center_y ?? 0), Y = Number(N.z ?? N.center_z ?? 0), X = Number(N.dx ?? N.size_x ?? 1), q = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1);
1858
+ l = Math.min(l, v - X / 2), c = Math.max(c, v + X / 2), s = Math.min(s, R - q / 2), u = Math.max(u, R + q / 2), h = Math.min(h, Y - Z / 2), p = Math.max(p, Y + Z / 2);
1797
1859
  });
1798
- let h = 0, d = 0, g = 0;
1799
- o.offset ? (h = Number(o.offset.x ?? 0), d = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (h = -((c + l) / 2), d = -((s + u) / 2), g = -((p + m) / 2));
1800
- const N = c + h, O = l + h, b = s + d, A = u + d, y = p + g, E = m + g, k = (z, F, R) => `${Math.round(z)},${Math.round(F)},${Math.round(R)}`, D = new Set(
1801
- t.map((z) => k(Number(z.x ?? 0), Number(z.y ?? 0), Number(z.z ?? 0)))
1802
- ), w = [], L = [], x = [], S = [], v = [];
1860
+ let b = 0, m = 0, g = 0;
1861
+ o.offset ? (b = Number(o.offset.x ?? 0), m = Number(o.offset.y ?? 0), g = Number(o.offset.z ?? 0)) : i && (b = -((l + c) / 2), m = -((s + u) / 2), g = -((h + p) / 2));
1862
+ const y = l + b, O = c + b, f = s + m, A = u + m, _ = h + g, z = p + g, L = (N, v, R) => `${Math.round(N)},${Math.round(v)},${Math.round(R)}`, D = new Set(
1863
+ t.map((N) => L(Number(N.x ?? 0), Number(N.y ?? 0), Number(N.z ?? 0)))
1864
+ ), w = [], k = [], x = [], S = [], F = [];
1803
1865
  let I = 0;
1804
- if (t.forEach((z) => {
1805
- const F = Number(z.x ?? z.center_x ?? 0), R = Number(z.y ?? z.center_y ?? 0), Y = Number(z.z ?? z.center_z ?? 0), $ = Number(z.dx ?? z.size_x ?? 1), X = Number(z.dy ?? z.size_y ?? 1), q = Number(z.dz ?? z.size_z ?? 1), $e = F + h, Xe = R + d, qe = Y + g, Ze = St(z[n], r, f), { r: We, g: Ke, b: Je } = Ze;
1806
- Zn.forEach((V) => {
1807
- const Qe = F + V.neibDir[0] * $, et = R + V.neibDir[1] * X, tt = Y + V.neibDir[2] * q;
1808
- if (D.has(k(Qe, et, tt))) return;
1866
+ if (t.forEach((N) => {
1867
+ const v = Number(N.x ?? N.center_x ?? 0), R = Number(N.y ?? N.center_y ?? 0), Y = Number(N.z ?? N.center_z ?? 0), X = Number(N.dx ?? N.size_x ?? 1), q = Number(N.dy ?? N.size_y ?? 1), Z = Number(N.dz ?? N.size_z ?? 1), We = v + b, Ke = R + m, Je = Y + g, Qe = Ft(N[n], r, d), { r: et, g: tt, b: nt } = Qe;
1868
+ nr.forEach((V) => {
1869
+ const rt = v + V.neibDir[0] * X, ot = R + V.neibDir[1] * q, it = Y + V.neibDir[2] * Z;
1870
+ if (D.has(L(rt, ot, it))) return;
1809
1871
  const U = I;
1810
- V.verts.forEach(([nt, rt, ot]) => {
1811
- w.push($e + nt * $ / 2, Xe + rt * X / 2, qe + ot * q / 2), L.push(V.normal[0], V.normal[1], V.normal[2]), x.push(We, Ke, Je), I++;
1812
- }), S.push(U, U + 1, U + 2, U, U + 2, U + 3), v.push(z);
1872
+ V.verts.forEach(([st, at, lt]) => {
1873
+ w.push(We + st * X / 2, Ke + at * q / 2, Je + lt * Z / 2), k.push(V.normal[0], V.normal[1], V.normal[2]), x.push(et, tt, nt), I++;
1874
+ }), S.push(U, U + 1, U + 2, U, U + 2, U + 3), F.push(N);
1813
1875
  });
1814
1876
  }), w.length === 0) return;
1815
- const C = new f.BufferGeometry();
1816
- C.setAttribute("position", new f.Float32BufferAttribute(w, 3)), C.setAttribute("normal", new f.Float32BufferAttribute(L, 3)), C.setAttribute("color", new f.Float32BufferAttribute(x, 3)), C.setIndex(S);
1817
- const B = new f.MeshLambertMaterial({
1877
+ const C = new d.BufferGeometry();
1878
+ C.setAttribute("position", new d.Float32BufferAttribute(w, 3)), C.setAttribute("normal", new d.Float32BufferAttribute(k, 3)), C.setAttribute("color", new d.Float32BufferAttribute(x, 3)), C.setIndex(S);
1879
+ const P = new d.MeshLambertMaterial({
1818
1880
  vertexColors: !0,
1819
1881
  transparent: a < 1,
1820
1882
  opacity: a,
1821
- side: f.DoubleSide
1822
- }), P = new f.Mesh(C, B);
1823
- P.userData._isMergedBlocks = !0, P.userData._quadToBlock = v, P.userData._offset = { x: h, y: d, z: g }, e.scene.add(P), e.blocks.push(P), j(e), e.camera && e.controls && (e.lastBounds = { minX: N, maxX: O, minY: b, maxY: A, minZ: y, maxZ: E }, Ee(e, { minX: N, maxX: O, minY: b, maxY: A, minZ: y, maxZ: E }));
1883
+ side: d.DoubleSide
1884
+ }), B = new d.Mesh(C, P);
1885
+ B.userData._isMergedBlocks = !0, B.userData._quadToBlock = F, B.userData._offset = { x: b, y: m, z: g }, e.scene.add(B), e.blocks.push(B), j(e), e.camera && e.controls && (e.lastBounds = { minX: y, maxX: O, minY: f, maxY: A, minZ: _, maxZ: z }, ze(e, { minX: y, maxX: O, minY: f, maxY: A, minZ: _, maxZ: z }));
1824
1886
  }
1825
- function Ue(e) {
1887
+ function qe(e) {
1826
1888
  var t;
1827
1889
  e.blocks.forEach((n) => {
1828
1890
  e.scene.remove(n), n.geometry.dispose(), n.material.dispose();
1829
1891
  }), e.blocks = [], e._blockHighlightMesh && ((t = e.scene) == null || t.remove(e._blockHighlightMesh), e._blockHighlightMesh.geometry.dispose(), e._blockHighlightMesh.material.dispose(), e._blockHighlightMesh = null), j(e);
1830
1892
  }
1831
- function Kn(e, t) {
1893
+ function or(e, t) {
1832
1894
  const n = Math.max(0, Math.min(1, Number(t)));
1833
1895
  e.blocks.forEach((r) => {
1834
1896
  r.material && (r.material.opacity = n, r.material.transparent = n < 1, r.material.needsUpdate = !0);
1835
1897
  });
1836
1898
  }
1837
- function Jn(e, t, n) {
1838
- const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, a = Number(t.x ?? t.center_x ?? 0) + r, c = Number(t.y ?? t.center_y ?? 0) + o, l = Number(t.z ?? t.center_z ?? 0) + i, s = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), p = Number(t.dz ?? t.size_z ?? 1);
1899
+ function ir(e, t, n) {
1900
+ const r = (n == null ? void 0 : n.x) ?? 0, o = (n == null ? void 0 : n.y) ?? 0, i = (n == null ? void 0 : n.z) ?? 0, a = Number(t.x ?? t.center_x ?? 0) + r, l = Number(t.y ?? t.center_y ?? 0) + o, c = Number(t.z ?? t.center_z ?? 0) + i, s = Number(t.dx ?? t.size_x ?? 1), u = Number(t.dy ?? t.size_y ?? 1), h = Number(t.dz ?? t.size_z ?? 1);
1839
1901
  if (!e._blockHighlightMesh) {
1840
- const m = new f.BoxGeometry(1, 1, 1), h = new f.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
1841
- e._blockHighlightMesh = new f.Mesh(m, h), e.scene.add(e._blockHighlightMesh);
1902
+ const p = new d.BoxGeometry(1, 1, 1), b = new d.MeshBasicMaterial({ transparent: !0, opacity: 0, depthWrite: !1 });
1903
+ e._blockHighlightMesh = new d.Mesh(p, b), e.scene.add(e._blockHighlightMesh);
1842
1904
  }
1843
- return e._blockHighlightMesh.position.set(a, c, l), e._blockHighlightMesh.scale.set(s, u, p), e._blockHighlightMesh;
1905
+ return e._blockHighlightMesh.position.set(a, l, c), e._blockHighlightMesh.scale.set(s, u, h), e._blockHighlightMesh;
1844
1906
  }
1845
- function Ye(e) {
1907
+ function Ze(e) {
1846
1908
  var o, i;
1847
1909
  if (!e._outlinePass || e.selectables.length === 0) {
1848
- e._outlinePass && Z(e, null);
1910
+ e._outlinePass && W(e, null);
1849
1911
  return;
1850
1912
  }
1851
1913
  const t = e.raycaster.intersectObjects(e.selectables, !0);
1852
1914
  if (t.length === 0) {
1853
- Z(e, null);
1915
+ W(e, null);
1854
1916
  return;
1855
1917
  }
1856
1918
  const n = t[0], r = n.object;
1857
1919
  if ((o = r == null ? void 0 : r.userData) != null && o._isMergedBlocks) {
1858
- const a = Math.floor(n.faceIndex / 2), c = (i = r.userData._quadToBlock) == null ? void 0 : i[a];
1859
- if (c) {
1860
- Z(e, Jn(e, c, r.userData._offset));
1920
+ const a = Math.floor(n.faceIndex / 2), l = (i = r.userData._quadToBlock) == null ? void 0 : i[a];
1921
+ if (l) {
1922
+ W(e, ir(e, l, r.userData._offset));
1861
1923
  return;
1862
1924
  }
1863
1925
  }
1864
- Z(e, r);
1926
+ W(e, r);
1865
1927
  }
1866
- function Qn(e) {
1928
+ function sr(e) {
1867
1929
  const t = e.renderer;
1868
1930
  t && (e.handleCanvasClick = (n) => {
1869
- var h, d, g, N, O, b, A;
1931
+ var b, m, g, y, O, f, A;
1870
1932
  if (n.button !== 0) return;
1871
- if ((h = e.gizmo) != null && h.domElement) {
1872
- const y = e.gizmo.domElement.getBoundingClientRect();
1873
- if (n.clientX >= y.left && n.clientX <= y.right && n.clientY >= y.top && n.clientY <= y.bottom)
1933
+ if ((b = e.gizmo) != null && b.domElement) {
1934
+ const _ = e.gizmo.domElement.getBoundingClientRect();
1935
+ if (n.clientX >= _.left && n.clientX <= _.right && n.clientY >= _.top && n.clientY <= _.bottom)
1874
1936
  return;
1875
1937
  }
1876
1938
  const r = t.domElement.getBoundingClientRect(), o = n.clientX - r.left, i = n.clientY - r.top;
1877
- if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Ye(e), e.blocks.length > 0) {
1878
- const y = e.raycaster.intersectObjects(e.blocks, !1);
1879
- if (y.length > 0) {
1880
- const E = y[0], k = E.object;
1881
- if ((d = k == null ? void 0 : k.userData) != null && d._isMergedBlocks && e.blockClickHandler) {
1882
- const D = Math.floor(E.faceIndex / 2), w = k.userData._quadToBlock[D];
1939
+ if (e.pointer.x = o / r.width * 2 - 1, e.pointer.y = -(i / r.height * 2) + 1, e.raycaster.setFromCamera(e.pointer, e.camera), Ze(e), e.blocks.length > 0) {
1940
+ const _ = e.raycaster.intersectObjects(e.blocks, !1);
1941
+ if (_.length > 0) {
1942
+ const z = _[0], L = z.object;
1943
+ if ((m = L == null ? void 0 : L.userData) != null && m._isMergedBlocks && e.blockClickHandler) {
1944
+ const D = Math.floor(z.faceIndex / 2), w = L.userData._quadToBlock[D];
1883
1945
  w && e.blockClickHandler(w);
1884
1946
  }
1885
1947
  return;
1886
1948
  }
1887
1949
  }
1888
- const a = e.raycaster.intersectObjects(e.drillMeshes, !0), c = e.raycaster.intersectObjects(e.structuralMeshes, !0), l = ((g = a[0]) == null ? void 0 : g.distance) ?? 1 / 0;
1889
- if ((((N = c[0]) == null ? void 0 : N.distance) ?? 1 / 0) < l && c.length > 0) {
1890
- const y = c[0].object;
1891
- e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ...y.userData });
1950
+ const a = e.raycaster.intersectObjects(e.drillMeshes, !0), l = e.raycaster.intersectObjects(e.structuralMeshes, !0), c = ((g = a[0]) == null ? void 0 : g.distance) ?? 1 / 0;
1951
+ if ((((y = l[0]) == null ? void 0 : y.distance) ?? 1 / 0) < c && l.length > 0) {
1952
+ const _ = l[0].object;
1953
+ e.drillholeClickHandler && e.drillholeClickHandler({ type: "structure", ..._.userData });
1892
1954
  return;
1893
1955
  }
1894
1956
  if (a.length === 0) return;
1895
1957
  let u = a[0].object;
1896
1958
  for (; u && u.parent && !((O = u.userData) != null && O.holeId); )
1897
1959
  u = u.parent;
1898
- const p = (b = u == null ? void 0 : u.userData) == null ? void 0 : b.holeId, m = (A = u == null ? void 0 : u.userData) == null ? void 0 : A.project;
1899
- p && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: p, project: m });
1960
+ const h = (f = u == null ? void 0 : u.userData) == null ? void 0 : f.holeId, p = (A = u == null ? void 0 : u.userData) == null ? void 0 : A.project;
1961
+ h && e.drillholeClickHandler && e.drillholeClickHandler({ holeId: h, project: p });
1900
1962
  }, t.domElement.addEventListener("click", e.handleCanvasClick));
1901
1963
  }
1902
- class Hr {
1964
+ class Zr {
1903
1965
  constructor() {
1904
- this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.stripLogGroups = [], this.frameId = null, this.clock = new f.Clock(), this.handleCanvasClick = null, this.raycaster = new f.Raycaster(), this.pointer = new f.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new f.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
1966
+ this.container = null, this.scene = null, this.camera = null, this.renderer = null, this.controls = null, this.flyControls = null, this.gizmo = null, this.blocks = [], this.drillLines = [], this.drillMeshes = [], this.structuralGroup = null, this.structuralMeshes = [], this.stripLogGroups = [], this.frameId = null, this.clock = new d.Clock(), this.handleCanvasClick = null, this.raycaster = new d.Raycaster(), this.pointer = new d.Vector2(), this.drillholeClickHandler = null, this.blockClickHandler = null, this.controlMode = "orbit", this._tmpDir = new d.Vector3(), this.viewChangeHandler = null, this._lastViewSignature = "", this._lastViewEmitMs = 0, this.selectables = [], this._selectedObject = null, this._composer = null, this._blockHighlightMesh = null, this._outlinePass = null, this.rasterOverlays = /* @__PURE__ */ new Map();
1905
1967
  }
1906
1968
  init(t) {
1907
1969
  if (!t) return;
1908
1970
  this.container = t;
1909
1971
  const n = t.clientWidth, r = t.clientHeight;
1910
- this.scene = new f.Scene(), this.scene.background = new f.Color(16777215), this.camera = new f.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new f.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
1911
- const o = new f.AmbientLight(16777215, 1.2);
1972
+ this.scene = new d.Scene(), this.scene.background = new d.Color(16777215), this.camera = new d.PerspectiveCamera(28, n / r, 1e-3, 1e7), this.camera.up.set(0, 0, 1), this.camera.position.set(50, 50, 50), this.camera.lookAt(0, 0, 0), this.renderer = new d.WebGLRenderer({ antialias: !0 }), this.renderer.setSize(n, r), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.autoClear = !1, t.appendChild(this.renderer.domElement);
1973
+ const o = new d.AmbientLight(16777215, 1.2);
1912
1974
  this.scene.add(o);
1913
- const i = new f.DirectionalLight(16777215, 1.5);
1975
+ const i = new d.DirectionalLight(16777215, 1.5);
1914
1976
  i.position.set(10, 10, 5), this.scene.add(i);
1915
- const a = new f.AxesHelper(20);
1916
- this.scene.add(a), this.controls = new it(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 10, this.controls.minDistance = 1e-4, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
1917
- LEFT: f.MOUSE.PAN,
1918
- MIDDLE: f.MOUSE.DOLLY,
1919
- RIGHT: f.MOUSE.ROTATE
1977
+ const a = new d.AxesHelper(20);
1978
+ this.scene.add(a), this.controls = new ct(this.camera, this.renderer.domElement), this.controls.enableDamping = !1, this.controls.screenSpacePanning = !0, this.controls.enableZoom = !0, this.controls.zoomSpeed = 10, this.controls.minDistance = 1e-4, this.controls.maxDistance = 5e6, this.controls.mouseButtons = {
1979
+ LEFT: d.MOUSE.PAN,
1980
+ MIDDLE: d.MOUSE.DOLLY,
1981
+ RIGHT: d.MOUSE.ROTATE
1920
1982
  }, this.controls.touches = {
1921
- ONE: f.TOUCH.ROTATE,
1922
- TWO: f.TOUCH.DOLLY_PAN
1923
- }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new st(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new at(this.camera, this.renderer, {
1983
+ ONE: d.TOUCH.ROTATE,
1984
+ TWO: d.TOUCH.DOLLY_PAN
1985
+ }, this.controls.maxPolarAngle = Math.PI, this.flyControls = new ut(this.camera, this.renderer.domElement), this.flyControls.movementSpeed = 2e3, this.flyControls.rollSpeed = Math.PI / 12, this.flyControls.dragToLook = !0, this.flyControls.enabled = !1, this.gizmo = new mt(this.camera, this.renderer, {
1924
1986
  container: this.container,
1925
1987
  placement: "top-right",
1926
1988
  size: 110,
1927
1989
  offset: { top: 12, right: 12 },
1928
1990
  animated: !0,
1929
1991
  speed: 1.5
1930
- }), this.gizmo.attachControls(this.controls), Qn(this), this._wheelRelay = (l) => {
1931
- l.target !== this.renderer.domElement && (l.preventDefault(), this.renderer.domElement.dispatchEvent(new WheelEvent("wheel", {
1932
- clientX: l.clientX,
1933
- clientY: l.clientY,
1934
- deltaX: l.deltaX,
1935
- deltaY: l.deltaY,
1936
- deltaZ: l.deltaZ,
1937
- deltaMode: l.deltaMode,
1938
- ctrlKey: l.ctrlKey,
1939
- shiftKey: l.shiftKey,
1940
- altKey: l.altKey,
1992
+ }), this.gizmo.attachControls(this.controls), sr(this), this._wheelRelay = (c) => {
1993
+ c.target !== this.renderer.domElement && (c.preventDefault(), this.renderer.domElement.dispatchEvent(new WheelEvent("wheel", {
1994
+ clientX: c.clientX,
1995
+ clientY: c.clientY,
1996
+ deltaX: c.deltaX,
1997
+ deltaY: c.deltaY,
1998
+ deltaZ: c.deltaZ,
1999
+ deltaMode: c.deltaMode,
2000
+ ctrlKey: c.ctrlKey,
2001
+ shiftKey: c.shiftKey,
2002
+ altKey: c.altKey,
1941
2003
  bubbles: !1
1942
2004
  })));
1943
- }, this.container.addEventListener("wheel", this._wheelRelay, { passive: !1 }), Xn(this);
1944
- const c = () => {
2005
+ }, this.container.addEventListener("wheel", this._wheelRelay, { passive: !1 }), er(this);
2006
+ const l = () => {
1945
2007
  var s;
1946
- this.frameId = requestAnimationFrame(c);
1947
- const l = this.clock.getDelta();
1948
- this.renderer.clear(), this.controlMode === "fly" && ((s = this.flyControls) != null && s.enabled) ? this.flyControls.update(l) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(l) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
2008
+ this.frameId = requestAnimationFrame(l);
2009
+ const c = this.clock.getDelta();
2010
+ this.renderer.clear(), this.controlMode === "fly" && ((s = this.flyControls) != null && s.enabled) ? this.flyControls.update(c) : this.controls && this.controls.update(), this._emitViewChangeIfNeeded(), this._composer ? this._composer.render(c) : this.renderer.render(this.scene, this.camera), this.gizmo && this.gizmo.render();
1949
2011
  };
1950
- c();
2012
+ l();
1951
2013
  }
1952
2014
  resize() {
1953
2015
  if (!this.container || !this.camera || !this.renderer) return;
1954
2016
  const t = this.container.clientWidth, n = this.container.clientHeight;
1955
- this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), qn(this, t, n);
2017
+ this.camera.aspect = t / n, this.camera.updateProjectionMatrix(), this.renderer.setSize(t, n), this.gizmo && this.gizmo.update(), tr(this, t, n);
1956
2018
  }
1957
2019
  dispose() {
1958
- this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, Ue(this), je(this), ce(this), Ve(this), fn(this), Se(this), this.container && this._wheelRelay && this.container.removeEventListener("wheel", this._wheelRelay), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
2020
+ this.frameId && cancelAnimationFrame(this.frameId), this.renderer && this.handleCanvasClick && this.renderer.domElement.removeEventListener("click", this.handleCanvasClick), this.gizmo && (this.gizmo.dispose(), this.gizmo = null), this.viewChangeHandler = null, qe(this), Xe(this), ue(this), Ue(this), Mn(this), we(this), this.container && this._wheelRelay && this.container.removeEventListener("wheel", this._wheelRelay), this.controls && this.controls.dispose(), this.flyControls && this.flyControls.dispose(), this.renderer && (this.renderer.dispose(), this.container && this.renderer.domElement && this.container.removeChild(this.renderer.domElement));
1959
2021
  }
1960
2022
  // ---------------------------------------------------------------------------
1961
2023
  // Data renderers — delegate to domain modules
1962
2024
  // ---------------------------------------------------------------------------
1963
2025
  setDrillholes(t, n = {}) {
1964
- In(this, t, n);
2026
+ Gn(this, t, n);
1965
2027
  }
1966
2028
  /**
1967
2029
  * Add floating 2D strip log panels beside drillholes in the 3D scene.
@@ -1976,13 +2038,13 @@ class Hr {
1976
2038
  * - `options` {object} — optional: panelWidth, lateralOffset, color, valueMin, valueMax
1977
2039
  */
1978
2040
  setStripLogs(t, n) {
1979
- jn(this, t, n);
2041
+ Wn(this, t, n);
1980
2042
  }
1981
2043
  /**
1982
2044
  * Remove all strip log panels from the scene and free GPU resources.
1983
2045
  */
1984
2046
  clearStripLogs() {
1985
- ce(this);
2047
+ ue(this);
1986
2048
  }
1987
2049
  /**
1988
2050
  * Render block model data as a single merged mesh of exterior faces only.
@@ -1992,20 +2054,20 @@ class Hr {
1992
2054
  * @param {Object} [options]
1993
2055
  */
1994
2056
  setBlocks(t, n, r, o = {}) {
1995
- Wn(this, t, n, r, o);
2057
+ rr(this, t, n, r, o);
1996
2058
  }
1997
2059
  /**
1998
2060
  * Update the opacity of all currently rendered blocks.
1999
2061
  * @param {number} opacity - New opacity value between 0 and 1
2000
2062
  */
2001
2063
  setBlockOpacity(t) {
2002
- Kn(this, t);
2064
+ or(this, t);
2003
2065
  }
2004
2066
  setStructuralDiscs(t, n, r = {}) {
2005
- tn(this, t, n, r);
2067
+ cn(this, t, n, r);
2006
2068
  }
2007
2069
  setStructuralDiscsVisible(t) {
2008
- nn(this, t);
2070
+ un(this, t);
2009
2071
  }
2010
2072
  // ---------------------------------------------------------------------------
2011
2073
  // Click handlers
@@ -2027,51 +2089,51 @@ class Hr {
2027
2089
  this.viewChangeHandler = typeof t == "function" ? t : null;
2028
2090
  }
2029
2091
  getViewState() {
2030
- return He(this);
2092
+ return $e(this);
2031
2093
  }
2032
2094
  setViewState(t) {
2033
- return hn(this, t);
2095
+ return En(this, t);
2034
2096
  }
2035
2097
  _buildViewSignature(t) {
2036
- return Me(t);
2098
+ return Ee(t);
2037
2099
  }
2038
2100
  _emitViewChangeIfNeeded() {
2039
- bn(this);
2101
+ zn(this);
2040
2102
  }
2041
2103
  _fitCameraToBounds({ minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a }) {
2042
- Ee(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a });
2104
+ ze(this, { minX: t, maxX: n, minY: r, maxY: o, minZ: i, maxZ: a });
2043
2105
  }
2044
2106
  recenterCameraToOrigin(t = 1e3) {
2045
- pn(this, t);
2107
+ Nn(this, t);
2046
2108
  }
2047
2109
  lookDown(t = 2e3) {
2048
- gn(this, t);
2110
+ On(this, t);
2049
2111
  }
2050
2112
  pan(t = 0, n = 0) {
2051
- yn(this, t, n);
2113
+ Ln(this, t, n);
2052
2114
  }
2053
2115
  dolly(t = 1.1) {
2054
- _n(this, t);
2116
+ An(this, t);
2055
2117
  }
2056
2118
  focusOnLastBounds(t = 1.2) {
2057
- Mn(this, t);
2119
+ kn(this, t);
2058
2120
  }
2059
2121
  /**
2060
2122
  * Change the camera field-of-view while keeping the visible scene the same apparent size.
2061
2123
  * @param {number} fovDeg - Desired FOV in degrees
2062
2124
  */
2063
2125
  setCameraFov(t) {
2064
- Nn(this, t);
2126
+ wn(this, t);
2065
2127
  }
2066
2128
  /**
2067
2129
  * Set the scene background colour.
2068
2130
  * @param {'white'|'black'} colour
2069
2131
  */
2070
2132
  setBackground(t) {
2071
- this.scene && (this.scene.background = new f.Color(t === "black" ? 0 : 16777215));
2133
+ this.scene && (this.scene.background = new d.Color(t === "black" ? 0 : 16777215));
2072
2134
  }
2073
2135
  setControlMode(t = "orbit") {
2074
- On(this, t);
2136
+ xn(this, t);
2075
2137
  }
2076
2138
  // ---------------------------------------------------------------------------
2077
2139
  // Selection glow public API
@@ -2091,7 +2153,7 @@ class Hr {
2091
2153
  * @param {THREE.Object3D|null} object
2092
2154
  */
2093
2155
  selectObject(t) {
2094
- Z(this, t || null);
2156
+ W(this, t || null);
2095
2157
  }
2096
2158
  /**
2097
2159
  * Return the currently selected object, or null if nothing is selected.
@@ -2104,11 +2166,11 @@ class Hr {
2104
2166
  * Dispose the effect composer and all GPU resources used by the selection glow.
2105
2167
  */
2106
2168
  disposeGlow() {
2107
- Se(this);
2169
+ we(this);
2108
2170
  }
2109
2171
  /** @private */
2110
2172
  _updateSelectionFromPointer() {
2111
- Ye(this);
2173
+ Ze(this);
2112
2174
  }
2113
2175
  // ---------------------------------------------------------------------------
2114
2176
  // Raster overlay API — delegate to rasterOverlayScene
@@ -2118,14 +2180,14 @@ class Hr {
2118
2180
  * @param {object} layer - Layer descriptor returned by createRasterOverlay()
2119
2181
  */
2120
2182
  addRasterOverlay(t) {
2121
- an(this, t);
2183
+ hn(this, t);
2122
2184
  }
2123
2185
  /**
2124
2186
  * Remove a raster overlay from the scene and dispose its GPU resources.
2125
2187
  * @param {string} id - Overlay id
2126
2188
  */
2127
2189
  removeRasterOverlay(t) {
2128
- _e(this, t);
2190
+ Me(this, t);
2129
2191
  }
2130
2192
  /**
2131
2193
  * Set the opacity of a raster overlay at runtime.
@@ -2133,7 +2195,7 @@ class Hr {
2133
2195
  * @param {number} opacity - New opacity [0, 1]
2134
2196
  */
2135
2197
  setRasterOverlayOpacity(t, n) {
2136
- ln(this, t, n);
2198
+ bn(this, t, n);
2137
2199
  }
2138
2200
  /**
2139
2201
  * Show or hide a raster overlay.
@@ -2141,7 +2203,7 @@ class Hr {
2141
2203
  * @param {boolean} visible
2142
2204
  */
2143
2205
  setRasterOverlayVisibility(t, n) {
2144
- cn(this, t, n);
2206
+ pn(this, t, n);
2145
2207
  }
2146
2208
  /**
2147
2209
  * Update the elevation (Z position) of a raster overlay.
@@ -2149,7 +2211,7 @@ class Hr {
2149
2211
  * @param {number} elevation
2150
2212
  */
2151
2213
  setRasterOverlayElevation(t, n) {
2152
- un(this, t, n);
2214
+ gn(this, t, n);
2153
2215
  }
2154
2216
  /**
2155
2217
  * Return a raster overlay by id, or undefined if not found.
@@ -2157,151 +2219,156 @@ class Hr {
2157
2219
  * @returns {object|undefined}
2158
2220
  */
2159
2221
  getRasterOverlay(t) {
2160
- return mn(this, t);
2222
+ return yn(this, t);
2161
2223
  }
2162
2224
  /**
2163
2225
  * Return all raster overlay layers in insertion order.
2164
2226
  * @returns {object[]}
2165
2227
  */
2166
2228
  listRasterOverlays() {
2167
- return dn(this);
2229
+ return _n(this);
2168
2230
  }
2169
2231
  }
2170
2232
  export {
2171
- be as $,
2172
- W as A,
2173
- Mr as B,
2174
- Er as C,
2175
- ge as D,
2176
- fe as E,
2177
- ne as F,
2178
- Ce as G,
2233
+ ne as $,
2234
+ K as A,
2235
+ kr as B,
2236
+ Sr as C,
2237
+ ye as D,
2238
+ he as E,
2239
+ re as F,
2240
+ Ie as G,
2179
2241
  H,
2180
- Nr as I,
2181
- M as J,
2182
- vr as K,
2183
- ue as L,
2184
- pe as M,
2185
- he as N,
2186
- Fr as O,
2187
- xe as P,
2188
- vt as Q,
2189
- ve as R,
2190
- re as S,
2191
- Q as T,
2192
- Hr as U,
2193
- ze as V,
2194
- dt as W,
2195
- yt as X,
2196
- Nt as Y,
2197
- te as Z,
2198
- Mt as _,
2199
- me as a,
2200
- Or as a$,
2201
- ar as a0,
2202
- we as a1,
2203
- hr as a2,
2204
- ht as a3,
2205
- dr as a4,
2206
- mr as a5,
2207
- _t as a6,
2208
- ee as a7,
2209
- Gt as a8,
2210
- G as a9,
2211
- Me as aA,
2212
- xr as aB,
2213
- Lt as aC,
2214
- fn as aD,
2215
- ce as aE,
2216
- Ft as aF,
2217
- Rr as aG,
2218
- Lr as aH,
2219
- Qt as aI,
2220
- _n as aJ,
2221
- bn as aK,
2222
- Dt as aL,
2223
- Ee as aM,
2224
- Mn as aN,
2225
- wr as aO,
2226
- Ln as aP,
2227
- St as aQ,
2228
- Bt as aR,
2229
- Re as aS,
2230
- Wt as aT,
2231
- Vr as aU,
2232
- mn as aV,
2233
- He as aW,
2234
- wt as aX,
2235
- dn as aY,
2236
- Sr as aZ,
2237
- kr as a_,
2238
- It as aa,
2239
- zn as ab,
2240
- En as ac,
2241
- pr as ad,
2242
- Ne as ae,
2243
- lr as af,
2244
- Tt as ag,
2245
- cr as ah,
2246
- Rt as ai,
2242
+ Dr as I,
2243
+ wr as J,
2244
+ E as K,
2245
+ me as L,
2246
+ ge as M,
2247
+ be as N,
2248
+ Vr as O,
2249
+ ve as P,
2250
+ Rr as Q,
2251
+ Pt as R,
2252
+ Ce as S,
2253
+ ee as T,
2254
+ oe as U,
2255
+ Zr as V,
2256
+ Ne as W,
2257
+ pt as X,
2258
+ zt as Y,
2259
+ kt as Z,
2260
+ Ot as _,
2261
+ de as a,
2262
+ Ct as a$,
2263
+ pe as a0,
2264
+ hr as a1,
2265
+ xe as a2,
2266
+ Er as a3,
2267
+ yt as a4,
2268
+ _r as a5,
2269
+ yr as a6,
2270
+ Ut as a7,
2271
+ Nt as a8,
2272
+ jt as a9,
2273
+ Zn as aA,
2274
+ Xn as aB,
2275
+ ln as aC,
2276
+ Ee as aD,
2277
+ Br as aE,
2278
+ xt as aF,
2279
+ Mn as aG,
2280
+ ue as aH,
2281
+ Tt as aI,
2282
+ Xr as aJ,
2283
+ Cr as aK,
2284
+ jr as aL,
2285
+ an as aM,
2286
+ An as aN,
2287
+ zn as aO,
2288
+ vt as aP,
2289
+ ze as aQ,
2290
+ kn as aR,
2291
+ Pr as aS,
2292
+ Cn as aT,
2293
+ Ft as aU,
2294
+ Ht as aV,
2295
+ je as aW,
2296
+ rn as aX,
2297
+ qr as aY,
2298
+ yn as aZ,
2299
+ $e as a_,
2300
+ te as aa,
2301
+ qt as ab,
2302
+ G as ac,
2303
+ Rt as ad,
2304
+ Sn as ae,
2305
+ Dn as af,
2306
+ Nr as ag,
2307
+ Oe as ah,
2308
+ br as ai,
2247
2309
  Vt as aj,
2248
- bt as ak,
2249
- pt as al,
2250
- gt as am,
2251
- Pn as an,
2252
- Bn as ao,
2253
- Tn as ap,
2254
- ur as aq,
2255
- ft as ar,
2256
- fr as as,
2257
- an as at,
2258
- xt as au,
2259
- Pr as av,
2260
- qt as aw,
2261
- Gn as ax,
2262
- Vn as ay,
2263
- en as az,
2264
- K as b,
2265
- gn as b0,
2266
- At as b1,
2267
- on as b2,
2268
- Rn as b3,
2269
- yn as b4,
2270
- Dr as b5,
2271
- pn as b6,
2272
- _e as b7,
2273
- Pt as b8,
2274
- On as b9,
2310
+ pr as ak,
2311
+ $t as al,
2312
+ Yt as am,
2313
+ _t as an,
2314
+ Mt as ao,
2315
+ Et as ap,
2316
+ $n as aq,
2317
+ Un as ar,
2318
+ jn as as,
2319
+ gr as at,
2320
+ gt as au,
2321
+ Mr as av,
2322
+ hn as aw,
2323
+ It as ax,
2324
+ Yr as ay,
2325
+ tn as az,
2326
+ J as b,
2327
+ _n as b0,
2328
+ Tr as b1,
2329
+ vr as b2,
2330
+ xr as b3,
2331
+ On as b4,
2332
+ wt as b5,
2333
+ dn as b6,
2334
+ Yn as b7,
2335
+ Ln as b8,
2336
+ Ir as b9,
2275
2337
  Nn as ba,
2276
- un as bb,
2277
- ln as bc,
2278
- cn as bd,
2279
- jn as be,
2280
- hn as bf,
2281
- Et as bg,
2282
- Ar as c,
2283
- de as d,
2284
- Ie as e,
2285
- br as f,
2286
- ye as g,
2287
- le as h,
2288
- ae as i,
2289
- J as j,
2290
- Ot as k,
2291
- $t as l,
2292
- zt as m,
2293
- Tr as n,
2294
- Br as o,
2295
- Fe as p,
2296
- Xt as q,
2297
- Ct as r,
2298
- _ as s,
2299
- Ir as t,
2300
- Cr as u,
2301
- _r as v,
2302
- se as w,
2303
- gr as x,
2304
- yr as y,
2305
- zr as z
2338
+ Me as bb,
2339
+ Gt as bc,
2340
+ Re as bd,
2341
+ xn as be,
2342
+ wn as bf,
2343
+ gn as bg,
2344
+ bn as bh,
2345
+ pn as bi,
2346
+ Wn as bj,
2347
+ En as bk,
2348
+ Lt as bl,
2349
+ Fr as c,
2350
+ fe as d,
2351
+ Te as e,
2352
+ zr as f,
2353
+ _e as g,
2354
+ ce as h,
2355
+ At as i,
2356
+ le as j,
2357
+ Q as k,
2358
+ Dt as l,
2359
+ Qt as m,
2360
+ Ve as n,
2361
+ Ur as o,
2362
+ $r as p,
2363
+ Fe as q,
2364
+ en as r,
2365
+ Bt as s,
2366
+ M as t,
2367
+ Gr as u,
2368
+ Hr as v,
2369
+ ae as w,
2370
+ Ar as x,
2371
+ Or as y,
2372
+ Lr as z
2306
2373
  };
2307
- //# sourceMappingURL=baselode3dScene-qMfVRKxK.js.map
2374
+ //# sourceMappingURL=baselode3dScene-4nzt80B1.js.map