@giro3d/piero 1.0.0-beta.2 → 1.0.0-beta.3

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,71 +1,76 @@
1
- var xt = Object.defineProperty;
2
- var Ct = (l, e, t) => e in l ? xt(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
3
- var m = (l, e, t) => Ct(l, typeof e != "symbol" ? e + "" : e, t);
4
- import { V as Y, N as rt, i as lt, a2 as et, F as R, s as It, P as Pt, o as Z, n as ct, j as $, G as ut, f as K, M as St, u as Tt, q as Et, r as Ft, U as nt, X, Y as Bt, _ as dt, w as Mt, Z as kt, a3 as pt, a4 as Dt, a5 as Nt, z as At, b as L, C as ht, a6 as st, a7 as Lt, a8 as zt, h as Ot } from "./Components.es.js";
5
- import { a9 as xn } from "./Components.es.js";
6
- import { ref as O, defineComponent as q, createElementBlock as N, openBlock as D, createElementVNode as v, createVNode as A, unref as M, Fragment as tt, resolveComponent as Rt, createCommentVNode as H, createBlock as ot, normalizeClass as it, toDisplayString as jt, withCtx as at, renderList as ft } from "vue";
7
- import { defineStore as mt } from "pinia";
8
- import Ut from "@giro3d/giro3d/core/geographic/Coordinates";
9
- import gt, { isEntity3D as Vt } from "@giro3d/giro3d/entities/Entity3D";
10
- import Yt from "@giro3d/giro3d/gui/EntityPanel";
11
- import { Components as $t, SimpleScene as Gt, SimpleRenderer as Ht, SimpleCamera as Wt, SimpleRaycaster as qt, IfcPropertiesUtils as z, FragmentBoundingBox as Xt, FragmentManager as Zt, FragmentClassifier as Qt, FragmentIfcLoader as Jt, toCompositeID as Kt, IfcCategoryMap as te } from "openbim-components";
12
- import ee from "@giro3d/giro3d/gui/EntityInspector";
13
- import ne from "@giro3d/giro3d/entities/PointCloud";
14
- import se from "@giro3d/giro3d/sources/PotreeSource";
1
+ var Ie = Object.defineProperty;
2
+ var Se = (a, t, e) => t in a ? Ie(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var p = (a, t, e) => Se(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { V as j, J as ue, i as de, $ as se, F as A, s as Te, P as Ee, o as X, n as pe, j as G, G as me, f as ee, M as Fe, u as Me, q as Be, r as Le, L as oe, T as J, U as ke, _ as te, w as De, W as Ne, a0 as he, a1 as Ae, a2 as ze, a3 as Oe, b as z, C as fe, a4 as ie, a5 as Re, a6 as je, h as Ve } from "./Components.es.js";
5
+ import { a7 as qn } from "./Components.es.js";
6
+ import { ref as R, defineComponent as Y, createElementBlock as D, openBlock as k, createElementVNode as x, createVNode as N, unref as B, Fragment as ne, resolveComponent as Ue, createCommentVNode as W, createBlock as ae, normalizeClass as re, toDisplayString as $e, withCtx as le, renderList as ge, shallowRef as Ge, onMounted as Ye, onUnmounted as He } from "vue";
7
+ import { defineStore as ye } from "pinia";
8
+ import Z from "@giro3d/giro3d/core/geographic/Coordinates";
9
+ import be, { isEntity3D as ve } from "@giro3d/giro3d/entities/Entity3D";
10
+ import { HttpError as We } from "@giro3d/giro3d/utils/Fetcher";
11
+ import qe from "@giro3d/giro3d/gui/EntityPanel";
12
+ import { Components as Ze, SimpleScene as Je, SimpleRenderer as Xe, SimpleCamera as Qe, SimpleRaycaster as Ke, IfcPropertiesUtils as O, FragmentBoundingBox as et, FragmentManager as tt, FragmentClassifier as nt, FragmentIfcLoader as st, toCompositeID as ot, IfcCategoryMap as it } from "openbim-components";
13
+ import at from "@giro3d/giro3d/gui/EntityInspector";
14
+ import { Map as rt, View as lt } from "ol";
15
+ import ct from "ol/layer/Tile";
16
+ import { fromLonLat as ce } from "ol/proj";
17
+ import { OSM as ut } from "ol/source";
18
+ import dt from "@giro3d/giro3d/entities/PointCloud";
19
+ import pt from "@giro3d/giro3d/sources/PotreeSource";
15
20
  import F from "shepherd.js";
16
- const yt = mt("crossSection", () => {
17
- const l = O(0), e = O(new Y(0, 0, 0)), t = O(!1);
18
- function s(n) {
19
- t.value = n;
21
+ const _e = ye("crossSection", () => {
22
+ const a = R(0), t = R(new j(0, 0, 0)), e = R(!1);
23
+ function n(s) {
24
+ e.value = s;
20
25
  }
21
- function o(n) {
22
- l.value = n;
26
+ function o(s) {
27
+ a.value = s;
23
28
  }
24
- function i(n) {
25
- e.value = n;
29
+ function i(s) {
30
+ t.value = s;
26
31
  }
27
32
  return {
28
- center: e,
29
- enable: t,
30
- orientation: l,
33
+ center: t,
34
+ enable: e,
35
+ orientation: a,
31
36
  setCenter: i,
32
- setEnabled: s,
37
+ setEnabled: n,
33
38
  setOrientation: o
34
39
  };
35
- }), oe = { class: "input-group mb-3" }, ie = { class: "input-group mb-3" }, ae = ["value"], re = { class: "input-group mb-3" }, le = ["value"], ce = { class: "input-group" }, ue = { class: "input-group" }, de = ["value"], pe = ["value"], he = /* @__PURE__ */ q({
40
+ }), mt = { class: "input-group mb-3" }, ht = { class: "input-group mb-3" }, ft = ["value"], gt = { class: "input-group mb-3" }, yt = ["value"], bt = { class: "input-group" }, vt = { class: "input-group" }, _t = ["value"], wt = ["value"], xt = /* @__PURE__ */ Y({
36
41
  __name: "CrossSection",
37
- setup(l) {
38
- const e = yt();
39
- function t(i) {
40
- e.setOrientation(i);
42
+ setup(a) {
43
+ const t = _e();
44
+ function e(i) {
45
+ t.setOrientation(i);
41
46
  }
42
- function s(i) {
43
- const n = e.center.clone();
44
- n.setX(i), e.setCenter(n);
47
+ function n(i) {
48
+ const s = t.center.clone();
49
+ s.setX(i), t.setCenter(s);
45
50
  }
46
51
  function o(i) {
47
- const n = e.center.clone();
48
- n.setY(i), e.setCenter(n);
52
+ const s = t.center.clone();
53
+ s.setY(i), t.setCenter(s);
49
54
  }
50
- return (i, n) => (D(), N("div", null, [
51
- v("div", oe, [
52
- A(rt, {
53
- "model-value": M(e).enable,
54
- "onUpdate:modelValue": n[0] || (n[0] = (r) => M(e).setEnabled(r)),
55
+ return (i, s) => (k(), D("div", null, [
56
+ x("div", mt, [
57
+ N(ue, {
58
+ "model-value": B(t).enable,
59
+ "onUpdate:modelValue": s[0] || (s[0] = (l) => B(t).setEnabled(l)),
55
60
  id: "cross-section-enable",
56
61
  title: "foo"
57
62
  }, null, 8, ["model-value"]),
58
- n[5] || (n[5] = v("label", {
63
+ s[5] || (s[5] = x("label", {
59
64
  for: "cross-section-enable",
60
65
  class: "form-label"
61
66
  }, "Enable cross section", -1))
62
67
  ]),
63
- v("div", ie, [
64
- n[6] || (n[6] = v("label", {
68
+ x("div", ht, [
69
+ s[6] || (s[6] = x("label", {
65
70
  for: "plane-orientation-range",
66
71
  class: "form-label"
67
72
  }, "Plane orientation (0-360°)", -1)),
68
- v("input", {
73
+ x("input", {
69
74
  id: "plane-orientation-range",
70
75
  title: "Altitude",
71
76
  type: "range",
@@ -73,55 +78,55 @@ const yt = mt("crossSection", () => {
73
78
  min: "0",
74
79
  step: "0.1",
75
80
  max: "360",
76
- value: M(e).orientation,
77
- onInput: n[1] || (n[1] = (r) => t(Number.parseFloat(r.target.value)))
78
- }, null, 40, ae)
81
+ value: B(t).orientation,
82
+ onInput: s[1] || (s[1] = (l) => e(Number.parseFloat(l.target.value)))
83
+ }, null, 40, ft)
79
84
  ]),
80
- v("div", re, [
81
- v("input", {
85
+ x("div", gt, [
86
+ x("input", {
82
87
  type: "number",
83
88
  class: "form-control",
84
89
  id: "plane-orientation-number",
85
90
  step: "0.1",
86
- value: M(e).orientation,
87
- onInput: n[2] || (n[2] = (r) => t(Number.parseFloat(r.target.value)))
88
- }, null, 40, le)
91
+ value: B(t).orientation,
92
+ onInput: s[2] || (s[2] = (l) => e(Number.parseFloat(l.target.value)))
93
+ }, null, 40, yt)
89
94
  ]),
90
- n[8] || (n[8] = v("hr", null, null, -1)),
91
- v("div", ce, [
92
- n[7] || (n[7] = v("label", { class: "form-label" }, "Center (x, y)", -1)),
93
- v("div", ue, [
94
- v("input", {
95
+ s[8] || (s[8] = x("hr", null, null, -1)),
96
+ x("div", bt, [
97
+ s[7] || (s[7] = x("label", { class: "form-label" }, "Center (x, y)", -1)),
98
+ x("div", vt, [
99
+ x("input", {
95
100
  type: "number",
96
101
  class: "form-control",
97
102
  id: "plane-center-x",
98
- value: M(e).center.x,
99
- onInput: n[3] || (n[3] = (r) => s(Number.parseFloat(r.target.value)))
100
- }, null, 40, de),
101
- v("input", {
103
+ value: B(t).center.x,
104
+ onInput: s[3] || (s[3] = (l) => n(Number.parseFloat(l.target.value)))
105
+ }, null, 40, _t),
106
+ x("input", {
102
107
  type: "number",
103
108
  class: "form-control",
104
109
  id: "plane-center-y",
105
- value: M(e).center.y,
106
- onInput: n[4] || (n[4] = (r) => o(Number.parseFloat(r.target.value)))
107
- }, null, 40, pe)
110
+ value: B(t).center.y,
111
+ onInput: s[4] || (s[4] = (l) => o(Number.parseFloat(l.target.value)))
112
+ }, null, 40, wt)
108
113
  ])
109
114
  ])
110
115
  ]));
111
116
  }
112
117
  });
113
- class fe {
114
- constructor(e) {
115
- m(this, "_store", yt());
116
- this.context = e, e.events.addEventListener("ready", () => {
117
- const t = e.configuration.default_crs, s = e.configuration.analysis.cross_section;
118
- this._store.setOrientation(s.orientation);
119
- const o = s.pivot, i = new Ut(o.crs ?? t, o.x, o.y, 0).as(
120
- t
118
+ class Ct {
119
+ constructor(t) {
120
+ p(this, "_store", _e());
121
+ this.context = t, t.events.addEventListener("ready", () => {
122
+ const e = t.configuration.default_crs, n = t.configuration.analysis.cross_section;
123
+ this._store.setOrientation(n.orientation);
124
+ const o = n.pivot, i = new Z(o.crs ?? e, o.x, o.y, 0).as(
125
+ e
121
126
  );
122
- this._store.setCenter(i.toVector3()), this._store.$onAction(({ after: n, name: r }) => {
123
- n(() => {
124
- switch (r) {
127
+ this._store.setCenter(i.toVector3()), this._store.$onAction(({ after: s, name: l }) => {
128
+ s(() => {
129
+ switch (l) {
125
130
  case "setCenter":
126
131
  case "setEnabled":
127
132
  case "setOrientation":
@@ -135,124 +140,124 @@ class fe {
135
140
  dispose() {
136
141
  }
137
142
  updateCrossSection() {
138
- const e = [];
143
+ const t = [];
139
144
  if (this._store.enable) {
140
- const s = lt.DEG2RAD * this._store.orientation, o = Math.cos(s), i = Math.sin(s), n = new Y(o, i, 0), r = new et(n, 0).distanceToPoint(this._store.center), g = new et(n, -r);
141
- e.push(g);
145
+ const n = de.DEG2RAD * this._store.orientation, o = Math.cos(n), i = Math.sin(n), s = new j(o, i, 0), l = new se(s, 0).distanceToPoint(this._store.center), f = new se(s, -l);
146
+ t.push(f);
142
147
  }
143
- const t = this.context.view.getInstance();
144
- t.renderer.clippingPlanes = e;
145
- for (const s of this.context.view.getInstance().getEntities())
146
- Vt(s) && s.dispatchEvent({
147
- clippingPlanes: e,
148
+ const e = this.context.view.getInstance();
149
+ e.renderer.clippingPlanes = t;
150
+ for (const n of this.context.view.getInstance().getEntities())
151
+ ve(n) && n.dispatchEvent({
152
+ clippingPlanes: t,
148
153
  type: "clippingPlanes-property-changed"
149
154
  });
150
- t.notifyChange();
155
+ e.notifyChange();
151
156
  }
152
157
  }
153
- class pn {
158
+ class Dn {
154
159
  constructor() {
155
- m(this, "id", "builtin-cross-section-analysis");
156
- m(this, "name", "Cross section");
157
- m(this, "_manager", null);
160
+ p(this, "id", "builtin-cross-section-analysis");
161
+ p(this, "name", "Cross section");
162
+ p(this, "_manager", null);
158
163
  }
159
- initialize(e) {
160
- e.analysis.registerTool({
161
- component: he,
164
+ initialize(t) {
165
+ t.analysis.registerTool({
166
+ component: xt,
162
167
  icon: "bi-circle-half",
163
168
  name: "Cross section"
164
- }), this._manager = new fe(e);
169
+ }), this._manager = new Ct(t);
165
170
  }
166
171
  }
167
- function Q(l) {
168
- if ("url" in l.config && typeof l.config.url == "string")
169
- return l.config.url;
170
- if ("source" in l.config && typeof l.config.source == "object" && "url" in l.config.source && typeof l.config.source.url == "string")
171
- return l.config.source.url;
172
+ function Q(a) {
173
+ if ("url" in a.config && typeof a.config.url == "string")
174
+ return a.config.url;
175
+ if ("source" in a.config && typeof a.config.source == "object" && "url" in a.config.source && typeof a.config.source.url == "string")
176
+ return a.config.source.url;
172
177
  }
173
- function me(l) {
174
- return Q(l) != null;
178
+ function Pt(a) {
179
+ return Q(a) != null;
175
180
  }
176
- class hn {
181
+ class Nn {
177
182
  constructor() {
178
- m(this, "id", "builtin-download-dataset");
179
- m(this, "name", "Download dataset");
180
- m(this, "_context", null);
183
+ p(this, "id", "builtin-download-dataset");
184
+ p(this, "name", "Download dataset");
185
+ p(this, "_context", null);
181
186
  }
182
- initialize(e) {
183
- this._context = e, e.datasets.registerDatasetAction({
187
+ initialize(t) {
188
+ this._context = t, t.datasets.registerDatasetAction({
184
189
  action: this.download.bind(this),
185
190
  icon: "bi-download",
186
- predicate: me,
191
+ predicate: Pt,
187
192
  title: "Download dataset"
188
193
  });
189
194
  }
190
- download(e) {
191
- const t = Q(e);
192
- if (t == null) {
195
+ download(t) {
196
+ const e = Q(t);
197
+ if (e == null) {
193
198
  console.warn("invalid");
194
199
  return;
195
200
  }
196
- const s = this._context, o = new URL(t).pathname.split("/"), i = o[o.length - 1];
197
- console.info(`download ${Q(e)}`), R.fetch(t).then((n) => {
198
- if (!n.ok)
199
- throw new Error(`${n.status} ${n.statusText}`);
200
- return n.blob();
201
- }).then((n) => {
202
- It.downloadBlob(n, i), s.notifications.pushNotification({
201
+ const n = this._context, o = new URL(e).pathname.split("/"), i = o[o.length - 1];
202
+ console.info(`download ${Q(t)}`), A.fetch(e).then((s) => {
203
+ if (!s.ok)
204
+ throw new Error(`${s.status} ${s.statusText}`);
205
+ return s.blob();
206
+ }).then((s) => {
207
+ Te.downloadBlob(s, i), n.notifications.pushNotification({
203
208
  level: "success",
204
209
  text: i,
205
210
  title: "Download successful"
206
211
  });
207
- }).catch((n) => {
208
- console.error(n);
209
- const r = n instanceof Error ? n.message : "Download failed";
210
- s.notifications.pushNotification({
212
+ }).catch((s) => {
213
+ console.error(s);
214
+ const l = s instanceof Error ? s.message : "Download failed";
215
+ n.notifications.pushNotification({
211
216
  level: "error",
212
- text: r,
213
- title: e.name
217
+ text: l,
218
+ title: t.name
214
219
  });
215
220
  });
216
221
  }
217
222
  }
218
- const bt = mt("floodingPlane", () => {
219
- const l = O(0), e = O(!1);
220
- function t() {
221
- return l.value;
223
+ const we = ye("floodingPlane", () => {
224
+ const a = R(0), t = R(!1);
225
+ function e() {
226
+ return a.value;
222
227
  }
223
- function s(i) {
224
- l.value = i;
228
+ function n(i) {
229
+ a.value = i;
225
230
  }
226
231
  function o(i) {
227
- e.value = i;
232
+ t.value = i;
228
233
  }
229
- return { enable: e, getHeight: t, setEnabled: o, setHeight: s };
230
- }), ge = { class: "input-group mb-3" }, ye = { class: "input-group mb-3" }, be = ["value"], _e = { class: "input-group mb-3" }, we = ["value"], ve = /* @__PURE__ */ q({
234
+ return { enable: t, getHeight: e, setEnabled: o, setHeight: n };
235
+ }), It = { class: "input-group mb-3" }, St = { class: "input-group mb-3" }, Tt = ["value"], Et = { class: "input-group mb-3" }, Ft = ["value"], Mt = /* @__PURE__ */ Y({
231
236
  __name: "FloodingPlane",
232
- setup(l) {
233
- const e = bt();
234
- function t(s) {
235
- e.setHeight(s);
237
+ setup(a) {
238
+ const t = we();
239
+ function e(n) {
240
+ t.setHeight(n);
236
241
  }
237
- return (s, o) => (D(), N(tt, null, [
238
- v("div", ge, [
239
- A(rt, {
240
- "model-value": M(e).enable,
241
- "onUpdate:modelValue": o[0] || (o[0] = (i) => M(e).setEnabled(i)),
242
+ return (n, o) => (k(), D(ne, null, [
243
+ x("div", It, [
244
+ N(ue, {
245
+ "model-value": B(t).enable,
246
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => B(t).setEnabled(i)),
242
247
  id: "flooding-plane-enable",
243
248
  title: "foo"
244
249
  }, null, 8, ["model-value"]),
245
- o[3] || (o[3] = v("label", {
250
+ o[3] || (o[3] = x("label", {
246
251
  for: "flooding-plane-enable",
247
252
  class: "form-label"
248
253
  }, "Enable flooding plane", -1))
249
254
  ]),
250
- v("div", ye, [
251
- o[5] || (o[5] = v("label", {
255
+ x("div", St, [
256
+ o[5] || (o[5] = x("label", {
252
257
  for: "flooding-altitude-range",
253
258
  class: "form-label"
254
259
  }, "Altitude", -1)),
255
- v("input", {
260
+ x("input", {
256
261
  id: "flooding-altitude-range",
257
262
  title: "Altitude",
258
263
  type: "range",
@@ -260,40 +265,40 @@ const bt = mt("floodingPlane", () => {
260
265
  min: "0",
261
266
  step: "0.1",
262
267
  max: "500",
263
- value: M(e).getHeight(),
264
- onInput: o[1] || (o[1] = (i) => t(Number.parseFloat(i.target.value)))
265
- }, null, 40, be),
266
- v("div", _e, [
267
- v("input", {
268
+ value: B(t).getHeight(),
269
+ onInput: o[1] || (o[1] = (i) => e(Number.parseFloat(i.target.value)))
270
+ }, null, 40, Tt),
271
+ x("div", Et, [
272
+ x("input", {
268
273
  type: "number",
269
274
  class: "form-control",
270
275
  id: "flooding-altitude-number",
271
276
  step: "0.1",
272
- value: M(e).getHeight(),
273
- onInput: o[2] || (o[2] = (i) => t(Number.parseFloat(i.target.value)))
274
- }, null, 40, we),
275
- o[4] || (o[4] = v("span", { class: "input-group-text" }, "m", -1))
277
+ value: B(t).getHeight(),
278
+ onInput: o[2] || (o[2] = (i) => e(Number.parseFloat(i.target.value)))
279
+ }, null, 40, Ft),
280
+ o[4] || (o[4] = x("span", { class: "input-group-text" }, "m", -1))
276
281
  ])
277
282
  ])
278
283
  ], 64));
279
284
  }
280
285
  });
281
- class xe {
286
+ class Bt {
282
287
  constructor() {
283
- m(this, "geometry");
284
- m(this, "material");
285
- m(this, "object3D");
286
- m(this, "_height");
287
- this.geometry = new Pt(1, 1, 1, 1), this.material = new Z({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new ct(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
288
+ p(this, "geometry");
289
+ p(this, "material");
290
+ p(this, "object3D");
291
+ p(this, "_height");
292
+ this.geometry = new Ee(1, 1, 1, 1), this.material = new X({ color: 43690, opacity: 0.5, transparent: !0 }), this.object3D = new pe(this.geometry, this.material), this.object3D.renderOrder = 2, this.visible = !1, this._height = 0;
288
293
  }
289
- set height(e) {
290
- this._height = e;
294
+ set height(t) {
295
+ this._height = t;
291
296
  }
292
297
  get height() {
293
298
  return this._height;
294
299
  }
295
- set visible(e) {
296
- this.object3D.visible = e;
300
+ set visible(t) {
301
+ this.object3D.visible = t;
297
302
  }
298
303
  get visible() {
299
304
  return this.object3D.visible;
@@ -301,19 +306,19 @@ class xe {
301
306
  dispose() {
302
307
  this.object3D.removeFromParent(), this.geometry.dispose(), this.material.dispose();
303
308
  }
304
- setPosition(e, t, s, o, i) {
305
- this.object3D.scale.set(o, i, 1), this.object3D.position.set(e, t, s), this.object3D.updateMatrixWorld();
309
+ setPosition(t, e, n, o, i) {
310
+ this.object3D.scale.set(o, i, 1), this.object3D.position.set(t, e, n), this.object3D.updateMatrixWorld();
306
311
  }
307
312
  }
308
- class Ce {
309
- constructor(e) {
310
- m(this, "_context");
311
- m(this, "_plane");
312
- m(this, "_store", bt());
313
- this._context = e, this._plane = null, e.events.addEventListener("ready", () => {
314
- this._store.$onAction(({ after: t, name: s }) => {
315
- t(() => {
316
- switch (s) {
313
+ class Lt {
314
+ constructor(t) {
315
+ p(this, "_context");
316
+ p(this, "_plane");
317
+ p(this, "_store", we());
318
+ this._context = t, this._plane = null, t.events.addEventListener("ready", () => {
319
+ this._store.$onAction(({ after: e, name: n }) => {
320
+ e(() => {
321
+ switch (n) {
317
322
  case "setEnabled":
318
323
  this.updatePlane();
319
324
  break;
@@ -329,180 +334,251 @@ class Ce {
329
334
  this._plane && (this._context.view.getInstance().remove(this._plane.object3D), this._plane.dispose());
330
335
  }
331
336
  async updatePlane() {
332
- this._plane || (this._plane = new xe(), await this._context.view.getInstance().add(this._plane.object3D));
333
- const e = this._context.view.getBoundingBox(), t = e.getCenter(new Y()), s = e.getSize(new Y());
334
- this._plane.visible = this._store.enable, this._plane.setPosition(t.x, t.y, this._store.getHeight(), s.x, s.y), this._context.view.getInstance().notifyChange();
337
+ this._plane || (this._plane = new Bt(), await this._context.view.getInstance().add(this._plane.object3D));
338
+ const t = this._context.view.getBoundingBox(), e = t.getCenter(new j()), n = t.getSize(new j());
339
+ this._plane.visible = this._store.enable, this._plane.setPosition(e.x, e.y, this._store.getHeight(), n.x, n.y), this._context.view.getInstance().notifyChange();
335
340
  }
336
341
  }
337
- class fn {
342
+ class An {
338
343
  constructor() {
339
- m(this, "id", "builtin-flooding-plane-analysis");
340
- m(this, "name", "Flooding plane");
341
- m(this, "_manager", null);
344
+ p(this, "id", "builtin-flooding-plane-analysis");
345
+ p(this, "name", "Flooding plane");
346
+ p(this, "_manager", null);
342
347
  }
343
- initialize(e) {
344
- e.analysis.registerTool({
345
- component: ve,
348
+ initialize(t) {
349
+ t.analysis.registerTool({
350
+ component: Mt,
346
351
  icon: "bi-layers-half",
347
352
  name: "Flooding plane"
348
- }), this._manager = new Ce(e);
353
+ }), this._manager = new Lt(t);
354
+ }
355
+ }
356
+ const kt = /^(\d+\.\d+)\s*,\s*(\d+\.\d+)$/;
357
+ class Dt {
358
+ constructor() {
359
+ p(this, "name", "Go to coordinates");
360
+ }
361
+ search(t) {
362
+ const e = kt.exec(t);
363
+ if (e) {
364
+ const n = Number.parseFloat(e[1]), o = Number.parseFloat(e[2]), s = {
365
+ coordinates: Z.WGS84(n, o),
366
+ label: `${n.toFixed(6)}, ${o.toFixed(6)}`,
367
+ provider: this
368
+ };
369
+ return Promise.resolve([s]);
370
+ } else
371
+ return Promise.resolve([]);
349
372
  }
350
373
  }
351
- const j = new St(), Ie = {
352
- bbox: new Z({
374
+ class zn {
375
+ constructor() {
376
+ p(this, "id", "builtin-coordinates-search");
377
+ p(this, "name", "Coordinates search");
378
+ }
379
+ initialize(t) {
380
+ t.search.registerProvider(new Dt());
381
+ }
382
+ }
383
+ const Nt = /[a-z]{3}/;
384
+ class At {
385
+ constructor() {
386
+ p(this, "name", "Base adresse nationale (BAN)");
387
+ }
388
+ async search(t) {
389
+ if (!Nt.test(t))
390
+ return [];
391
+ try {
392
+ const n = (await A.fetchJson(
393
+ `https://api-adresse.data.gouv.fr/search/?q=${t}`
394
+ )).features.map((o) => {
395
+ const i = o.properties, s = o.geometry, [l, f] = s.coordinates;
396
+ return {
397
+ coordinates: new Z("EPSG:4326", l, f, 0),
398
+ label: i.label,
399
+ provider: this
400
+ };
401
+ });
402
+ return await zt(n.map((o) => o.coordinates)), n;
403
+ } catch (e) {
404
+ if (e instanceof We)
405
+ return [];
406
+ throw e;
407
+ }
408
+ }
409
+ }
410
+ async function zt(a) {
411
+ const t = new URL("https://data.geopf.fr/altimetrie/1.0/calcul/alti/rest/elevation.json");
412
+ t.searchParams.append("lon", a.map((n) => n.longitude).join("|")), t.searchParams.append("lat", a.map((n) => n.latitude).join("|")), t.searchParams.append("zonly", "true"), t.searchParams.append("resource", "ign_rge_alti_wld"), t.searchParams.append("delimiter", "|"), t.searchParams.append("indent", "false");
413
+ const e = await A.fetchJson(t.toString());
414
+ for (let n = 0; n < a.length; n++)
415
+ a[n].setAltitude(e.elevations[n]);
416
+ return e;
417
+ }
418
+ class On {
419
+ constructor() {
420
+ p(this, "id", "builtin-geocoding-ban");
421
+ p(this, "name", "Base adresse nationale");
422
+ }
423
+ initialize(t) {
424
+ t.search.registerProvider(new At());
425
+ }
426
+ }
427
+ const V = new Fe(), Ot = {
428
+ bbox: new X({
353
429
  color: "#FFFF00",
354
430
  depthTest: !0,
355
431
  opacity: 0.2,
356
432
  transparent: !0
357
433
  }),
358
- selection: new Z({
434
+ selection: new X({
359
435
  color: "#FF0000",
360
436
  depthTest: !1,
361
437
  opacity: 0.6,
362
438
  transparent: !0
363
439
  })
364
- }, Pe = 4186316022, Se = 781010003, Te = 2655215786, Ee = 3242617779, Fe = 919958153, Be = 1307041759, _t = 1451395588, wt = 1883228015, Me = [_t, wt], ke = [
365
- Pe,
366
- Se,
367
- Te,
368
- Ee,
369
- Fe,
370
- Be
371
- ], vt = (l) => $(l) && l.isIFCPickResult, U = class U extends gt {
372
- constructor(t) {
373
- super(new ut());
374
- m(this, "isIfcEntity", !0);
375
- m(this, "isPickableFeatures", !0);
376
- m(this, "type", "IfcEntity");
377
- m(this, "_classificationCache");
378
- m(this, "_components");
379
- m(this, "_fragmentBoundingBox");
380
- m(this, "_fragmentClassifier");
381
- m(this, "_fragmentManager");
382
- m(this, "_ifcSelection");
440
+ }, Rt = 4186316022, jt = 781010003, Vt = 2655215786, Ut = 3242617779, $t = 919958153, Gt = 1307041759, xe = 1451395588, Ce = 1883228015, Yt = [xe, Ce], Ht = [
441
+ Rt,
442
+ jt,
443
+ Vt,
444
+ Ut,
445
+ $t,
446
+ Gt
447
+ ], Pe = (a) => G(a) && a.isIFCPickResult, U = class U extends be {
448
+ constructor(e) {
449
+ super(new me());
450
+ p(this, "isIfcEntity", !0);
451
+ p(this, "isPickableFeatures", !0);
452
+ p(this, "type", "IfcEntity");
453
+ p(this, "_classificationCache");
454
+ p(this, "_components");
455
+ p(this, "_fragmentBoundingBox");
456
+ p(this, "_fragmentClassifier");
457
+ p(this, "_fragmentManager");
458
+ p(this, "_ifcSelection");
383
459
  // Currently selected fragments
384
- m(this, "_indexMap");
460
+ p(this, "_indexMap");
385
461
  // Properties relationships
386
- m(this, "_model");
387
- m(this, "_source");
388
- this._source = t, this._components = new $t(), this._components.ui.enabled = !1, this._components.scene = new Gt(this._components), this._components.renderer = new Ht(
462
+ p(this, "_model");
463
+ p(this, "_source");
464
+ this._source = e, this._components = new Ze(), this._components.ui.enabled = !1, this._components.scene = new Je(this._components), this._components.renderer = new Xe(
389
465
  this._components,
390
466
  document.createElement("div")
391
- ), this._components.camera = new Wt(this._components), this._components.raycaster = new qt(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
467
+ ), this._components.camera = new Qe(this._components), this._components.raycaster = new Ke(this._components), this._components.init(), this._ifcSelection = { bbox: {}, selection: {} }, this._indexMap = {}, this._classificationCache = null, this._fragmentBoundingBox = null;
392
468
  }
393
- clearHighlight(t = "selection") {
394
- for (const s of Object.keys(this._ifcSelection[t])) {
395
- const o = this._fragmentManager.list[s], i = o == null ? void 0 : o.fragments[t];
469
+ clearHighlight(e = "selection") {
470
+ for (const n of Object.keys(this._ifcSelection[e])) {
471
+ const o = this._fragmentManager.list[n], i = o == null ? void 0 : o.fragments[e];
396
472
  i != null && i.mesh.removeFromParent();
397
473
  }
398
- this.notifyChange(this), this._ifcSelection[t] = {};
474
+ this.notifyChange(this), this._ifcSelection[e] = {};
399
475
  }
400
- getBoundingBoxById(t) {
401
- this.clearHighlight("bbox"), this.highlightById(t, "bbox");
402
- const s = this._fragmentBoundingBox;
403
- if (s === null)
476
+ getBoundingBoxById(e) {
477
+ this.clearHighlight("bbox"), this.highlightById(e, "bbox");
478
+ const n = this._fragmentBoundingBox;
479
+ if (n === null)
404
480
  throw new Error("Must call initClassification before getBoundingBoxById");
405
481
  const o = this._fragmentManager;
406
- s.reset();
482
+ n.reset();
407
483
  const i = this._ifcSelection.bbox;
408
484
  if (!Object.keys(i).length)
409
485
  return;
410
- for (const f of Object.keys(i)) {
411
- const P = o.list[f].fragments.bbox;
412
- s.addMesh(P.mesh);
486
+ for (const m of Object.keys(i)) {
487
+ const I = o.list[m].fragments.bbox;
488
+ n.addMesh(I.mesh);
413
489
  }
414
- const n = s.get(), { y: r, z: g } = n.min, { y: w, z: u } = n.max;
415
- return n.min.y = -u, n.max.y = -g, n.min.z = r, n.max.z = w, n.translate(this._model.position), this.clearHighlight("bbox"), n;
490
+ const s = n.get(), { y: l, z: f } = s.min, { y: v, z: c } = s.max;
491
+ return s.min.y = -c, s.max.y = -f, s.min.z = l, s.max.z = v, s.translate(this._model.position), this.clearHighlight("bbox"), s;
416
492
  }
417
493
  getClassification() {
418
494
  if (this._classificationCache === null)
419
495
  throw new Error("Must call initClassification before getClassification");
420
496
  return this._classificationCache;
421
497
  }
422
- getProperties(t) {
423
- const s = [], o = this._model.properties;
498
+ getProperties(e) {
499
+ const n = [], o = this._model.properties;
424
500
  if (!o)
425
501
  return [];
426
- for (const i of this._indexMap[t]) {
427
- const n = o[i];
428
- if (n == null)
502
+ for (const i of this._indexMap[e]) {
503
+ const s = o[i];
504
+ if (s == null)
429
505
  continue;
430
- const { name: r } = z.getEntityName(o, i);
431
- if (r !== null) {
432
- if (n.type === _t) {
433
- const g = z.getPsetProps(o, i);
434
- if (g !== null)
435
- for (const w of g) {
436
- if (o[w] == null)
506
+ const { name: l } = O.getEntityName(o, i);
507
+ if (l !== null) {
508
+ if (s.type === xe) {
509
+ const f = O.getPsetProps(o, i);
510
+ if (f !== null)
511
+ for (const v of f) {
512
+ if (o[v] == null)
437
513
  continue;
438
- const f = this.getProperty(w);
439
- f !== null && s.push({
440
- parentName: r,
441
- ...f
514
+ const m = this.getProperty(v);
515
+ m !== null && n.push({
516
+ parentName: l,
517
+ ...m
442
518
  });
443
519
  }
444
- } else if (n.type === wt) {
445
- const g = z.getQsetQuantities(
520
+ } else if (s.type === Ce) {
521
+ const f = O.getQsetQuantities(
446
522
  o,
447
523
  i
448
524
  );
449
- if (g !== null)
450
- for (const w of g) {
451
- const { key: u } = z.getQuantityValue(
525
+ if (f !== null)
526
+ for (const v of f) {
527
+ const { key: c } = O.getQuantityValue(
452
528
  o,
453
- w
529
+ v
454
530
  );
455
- if (u === null)
531
+ if (c === null)
456
532
  continue;
457
- const f = this.getProperty(w);
458
- f !== null && s.push({
459
- parentName: r,
460
- ...f
533
+ const m = this.getProperty(v);
534
+ m !== null && n.push({
535
+ parentName: l,
536
+ ...m
461
537
  });
462
538
  }
463
539
  }
464
540
  }
465
541
  }
466
- return s;
542
+ return n;
467
543
  }
468
- getProperty(t) {
469
- const s = this._model.properties;
470
- if (s === void 0)
544
+ getProperty(e) {
545
+ const n = this._model.properties;
546
+ if (n === void 0)
471
547
  return null;
472
- const { name: o } = z.getEntityName(s, t);
548
+ const { name: o } = O.getEntityName(n, e);
473
549
  if (o === null)
474
550
  return null;
475
- const { value: i } = z.getQuantityValue(s, t);
551
+ const { value: i } = O.getQuantityValue(n, e);
476
552
  return { name: o, value: i };
477
553
  }
478
- highlight(t, s, o) {
479
- this._ifcSelection[t][s.uuid] = /* @__PURE__ */ new Set();
554
+ highlight(e, n, o) {
555
+ this._ifcSelection[e][n.uuid] = /* @__PURE__ */ new Set();
480
556
  const i = parseInt(o, 10);
481
- this._ifcSelection[t][s.uuid].add(o), this.addComposites(t, s, i), this.regenerate(t, s.uuid);
482
- const n = s.fragment.group;
483
- if (n) {
484
- const r = n.data[i][0];
485
- for (let g = 0; g < r.length; g++) {
486
- const w = r[g], u = n.keyFragments[w], f = this._fragmentManager.list[u];
487
- u in this._ifcSelection[t] || (this._ifcSelection[t][u] = /* @__PURE__ */ new Set()), this._ifcSelection[t][u].add(o), this.addComposites(t, f.mesh, i), this.regenerate(t, u);
557
+ this._ifcSelection[e][n.uuid].add(o), this.addComposites(e, n, i), this.regenerate(e, n.uuid);
558
+ const s = n.fragment.group;
559
+ if (s) {
560
+ const l = s.data[i][0];
561
+ for (let f = 0; f < l.length; f++) {
562
+ const v = l[f], c = s.keyFragments[v], m = this._fragmentManager.list[c];
563
+ c in this._ifcSelection[e] || (this._ifcSelection[e][c] = /* @__PURE__ */ new Set()), this._ifcSelection[e][c].add(o), this.addComposites(e, m.mesh, i), this.regenerate(e, c);
488
564
  }
489
565
  }
490
566
  this.notifyChange(this);
491
567
  }
492
- highlightById(t, s = "selection") {
493
- for (const o of Object.keys(t)) {
494
- o in this._ifcSelection[s] || (this._ifcSelection[s][o] = /* @__PURE__ */ new Set());
495
- const i = this._fragmentManager.list[o], n = /* @__PURE__ */ new Set();
496
- for (const r of t[o])
497
- this._ifcSelection[s][o].add(r), n.add(parseInt(r, 10));
498
- for (const r of n)
499
- this.addComposites(s, i.mesh, r);
500
- this.regenerate(s, o);
568
+ highlightById(e, n = "selection") {
569
+ for (const o of Object.keys(e)) {
570
+ o in this._ifcSelection[n] || (this._ifcSelection[n][o] = /* @__PURE__ */ new Set());
571
+ const i = this._fragmentManager.list[o], s = /* @__PURE__ */ new Set();
572
+ for (const l of e[o])
573
+ this._ifcSelection[n][o].add(l), s.add(parseInt(l, 10));
574
+ for (const l of s)
575
+ this.addComposites(n, i.mesh, l);
576
+ this.regenerate(n, o);
501
577
  }
502
578
  this.notifyChange(this);
503
579
  }
504
- pick(t, s) {
505
- return super.pick(t, s).map((o) => ({
580
+ pick(e, n) {
581
+ return super.pick(e, n).map((o) => ({
506
582
  ...o,
507
583
  entity: this,
508
584
  features: o.features,
@@ -510,14 +586,14 @@ const j = new St(), Ie = {
510
586
  object: o.object
511
587
  }));
512
588
  }
513
- pickFeaturesFrom(t) {
514
- var o, i, n;
515
- const s = t.object;
516
- if (s.fragment != null && t.instanceId != null && t.face) {
517
- const r = s.fragment.getVertexBlockID(s.geometry, t.face.a), g = (o = s.fragment.getItemID(t.instanceId, r)) == null ? void 0 : o.replace(/\..*/, "");
518
- if (g && ((n = (i = s.fragment.group) == null ? void 0 : i.properties) == null ? void 0 : n[g]) != null) {
519
- const u = s.fragment.group.properties[g], C = [{ ifcProperties: this.getProperties(g), itemProperties: u }];
520
- return t.features = C, C;
589
+ pickFeaturesFrom(e) {
590
+ var o, i, s;
591
+ const n = e.object;
592
+ if (n.fragment != null && e.instanceId != null && e.face) {
593
+ const l = n.fragment.getVertexBlockID(n.geometry, e.face.a), f = (o = n.fragment.getItemID(e.instanceId, l)) == null ? void 0 : o.replace(/\..*/, "");
594
+ if (f && ((s = (i = n.fragment.group) == null ? void 0 : i.properties) == null ? void 0 : s[f]) != null) {
595
+ const c = n.fragment.group.properties[f], w = [{ ifcProperties: this.getProperties(f), itemProperties: c }];
596
+ return e.features = w, w;
521
597
  }
522
598
  }
523
599
  return [];
@@ -530,351 +606,424 @@ const j = new St(), Ie = {
530
606
  ]), this._classificationCache.length === 0 && (this._classificationCache = await this.regenerateClassification([
531
607
  "entities"
532
608
  /* ENTITY */
533
- ])), this._fragmentBoundingBox = await this._components.tools.get(Xt);
609
+ ])), this._fragmentBoundingBox = await this._components.tools.get(et);
534
610
  }
535
611
  async preprocess() {
536
- const t = await R.fetchArrayBuffer(this._source.url);
537
- this._fragmentManager = await this._components.tools.get(Zt), this._fragmentClassifier = await this._components.tools.get(Qt);
538
- const s = new Jt(this._components);
539
- s.settings.webIfc.COORDINATE_TO_ORIGIN = !0, s.settings.webIfc.OPTIMIZE_PROFILES = !0;
540
- const o = new Uint8Array(t);
541
- this._model = await s.load(o, this._source.name), this._model.rotateX(Math.PI / 2);
542
- const i = new Y();
612
+ const e = await A.fetchArrayBuffer(this._source.url);
613
+ this._fragmentManager = await this._components.tools.get(tt), this._fragmentClassifier = await this._components.tools.get(nt);
614
+ const n = new st(this._components);
615
+ n.settings.webIfc.COORDINATE_TO_ORIGIN = !0, n.settings.webIfc.OPTIMIZE_PROFILES = !0;
616
+ const o = new Uint8Array(e);
617
+ this._model = await n.load(o, this._source.name), this._model.rotateX(Math.PI / 2);
618
+ const i = new j();
543
619
  if (this._source.at)
544
620
  this._source.at.toVector3(i), this._model.position.copy(i);
545
621
  else {
546
- const r = this._model.coordinationMatrix.clone().invert();
547
- i.applyMatrix4(r), this._model.position.set(i.x, -i.z, i.y);
622
+ const l = this._model.coordinationMatrix.clone().invert();
623
+ i.applyMatrix4(l), this._model.position.set(i.x, -i.z, i.y);
548
624
  }
549
625
  this._model.updateWorldMatrix(!0, !0), this._model.updateMatrix(), this._model.updateMatrixWorld(!0), this.initializeEntityIndexes(), this._fragmentClassifier.byStorey(this._model), this._fragmentClassifier.byEntity(this._model), await this.initClassification(), this.object3d.add(this._model), this.onObjectCreated(this._model);
550
- const n = R.getContext(this._source.url);
551
- K(this, { filename: n.filename }), this.notifyChange(this.object3d);
626
+ const s = A.getContext(this._source.url);
627
+ ee(this, { filename: s.filename }), this.notifyChange(this.object3d);
552
628
  }
553
- addComposites(t, s, o) {
554
- this.addHighlightToFragment(t, s.fragment);
555
- const i = s.fragment.composites[o];
629
+ addComposites(e, n, o) {
630
+ this.addHighlightToFragment(e, n.fragment);
631
+ const i = n.fragment.composites[o];
556
632
  if (i)
557
- for (let n = 1; n < i; n++) {
558
- const r = Kt(o, n);
559
- this._ifcSelection[t][s.uuid].add(r);
633
+ for (let s = 1; s < i; s++) {
634
+ const l = ot(o, s);
635
+ this._ifcSelection[e][n.uuid].add(l);
560
636
  }
561
637
  }
562
- addHighlightToFragment(t, s) {
563
- if (!(t in s.fragments)) {
564
- const o = s.addFragment(t, [Ie[t]]);
565
- s.blocks.count > 1 && (o.setInstance(0, {
566
- ids: Array.from(s.ids),
567
- transform: j
568
- }), o.blocks.setVisibility(!1)), this._model.add(o.mesh), o.mesh.renderOrder = 30, o.mesh.frustumCulled = !1, o.mesh.name = t, o.mesh.updateMatrixWorld(!0);
638
+ addHighlightToFragment(e, n) {
639
+ if (!(e in n.fragments)) {
640
+ const o = n.addFragment(e, [Ot[e]]);
641
+ n.blocks.count > 1 && (o.setInstance(0, {
642
+ ids: Array.from(n.ids),
643
+ transform: V
644
+ }), o.blocks.setVisibility(!1)), this._model.add(o.mesh), o.mesh.renderOrder = 30, o.mesh.frustumCulled = !1, o.mesh.name = e, o.mesh.updateMatrixWorld(!0);
569
645
  }
570
646
  }
571
647
  initializeEntityIndexes() {
572
648
  this._indexMap = {};
573
- const t = this._model.properties;
574
- if (t !== void 0)
575
- for (const s of ke)
576
- z.getRelationMap(t, s, (o, i) => {
577
- const n = t[o];
578
- Me.includes(n.type) || this.setEntityIndex(o);
579
- for (const r of i)
580
- this.setEntityIndex(r).add(o);
649
+ const e = this._model.properties;
650
+ if (e !== void 0)
651
+ for (const n of Ht)
652
+ O.getRelationMap(e, n, (o, i) => {
653
+ const s = e[o];
654
+ Yt.includes(s.type) || this.setEntityIndex(o);
655
+ for (const l of i)
656
+ this.setEntityIndex(l).add(o);
581
657
  });
582
658
  }
583
- regenerate(t, s) {
584
- this.updateFragmentFill(t, s);
659
+ regenerate(e, n) {
660
+ this.updateFragmentFill(e, n);
585
661
  }
586
- async regenerateClassification(t, s = {}) {
587
- const o = this._fragmentClassifier.get(), i = [], n = t[0], r = o[n];
588
- if (n == null || r == null)
662
+ async regenerateClassification(e, n = {}) {
663
+ const o = this._fragmentClassifier.get(), i = [], s = e[0], l = o[s];
664
+ if (s == null || l == null)
589
665
  return i;
590
- for (const g of Object.keys(r)) {
591
- const w = { ...s, [n]: [g] }, u = await this._fragmentClassifier.find(w);
592
- if (Object.keys(u).length > 0) {
593
- const P = n[0].toUpperCase() + n.slice(1), I = await this.regenerateClassification(
594
- t.slice(1),
595
- w
666
+ for (const f of Object.keys(l)) {
667
+ const v = { ...n, [s]: [f] }, c = await this._fragmentClassifier.find(v);
668
+ if (Object.keys(c).length > 0) {
669
+ const I = s[0].toUpperCase() + s.slice(1), P = await this.regenerateClassification(
670
+ e.slice(1),
671
+ v
596
672
  );
597
- i.push({ children: I, fragments: u, name: g, treeItemName: P });
673
+ i.push({ children: P, fragments: c, name: f, treeItemName: I });
598
674
  }
599
675
  }
600
676
  return i;
601
677
  }
602
- setEntityIndex(t) {
603
- return t in this._indexMap || (this._indexMap[t] = /* @__PURE__ */ new Set()), this._indexMap[t];
678
+ setEntityIndex(e) {
679
+ return e in this._indexMap || (this._indexMap[e] = /* @__PURE__ */ new Set()), this._indexMap[e];
604
680
  }
605
- updateFragmentFill(t, s) {
606
- const o = this._ifcSelection[t][s], i = this._fragmentManager.list[s];
681
+ updateFragmentFill(e, n) {
682
+ const o = this._ifcSelection[e][n], i = this._fragmentManager.list[n];
607
683
  if (i == null)
608
684
  return;
609
- const n = i.fragments[t];
610
- if (n == null)
685
+ const s = i.fragments[e];
686
+ if (s == null)
611
687
  return;
612
- const r = i.mesh.parent;
613
- if (r == null)
688
+ const l = i.mesh.parent;
689
+ if (l == null)
614
690
  return;
615
- if (r.add(n.mesh), n.blocks.count > 1)
616
- i.getInstance(0, j), n.setInstance(0, {
691
+ if (l.add(s.mesh), s.blocks.count > 1)
692
+ i.getInstance(0, V), s.setInstance(0, {
617
693
  ids: Array.from(i.ids),
618
- transform: j
619
- }), n.blocks.setVisibility(!0, o, !0);
694
+ transform: V
695
+ }), s.blocks.setVisibility(!0, o, !0);
620
696
  else {
621
- let w = 0;
622
- for (const u of o) {
623
- n.mesh.count = w + 1;
624
- const { instanceID: f } = i.getInstanceAndBlockID(u);
625
- i.getInstance(f, j), n.setInstance(w, { ids: [u], transform: j }), w++;
697
+ let v = 0;
698
+ for (const c of o) {
699
+ s.mesh.count = v + 1;
700
+ const { instanceID: m } = i.getInstanceAndBlockID(c);
701
+ i.getInstance(m, V), s.setInstance(v, { ids: [c], transform: V }), v++;
626
702
  }
627
703
  }
628
704
  }
629
705
  };
630
- m(U, "isIFCEntity", (t) => $(t) && t.isIfcEntity), m(U, "isIFCPickResult", (t) => $(t) && U.isIFCEntity(t.entity));
631
- let J = U;
632
- class De extends ee {
633
- constructor(e, t, s) {
634
- super(e, t, s, { visibility: !0 });
706
+ p(U, "isIFCEntity", (e) => G(e) && e.isIfcEntity), p(U, "isIFCPickResult", (e) => G(e) && U.isIFCEntity(e.entity));
707
+ let K = U;
708
+ class Wt extends at {
709
+ constructor(t, e, n) {
710
+ super(t, e, n, { visibility: !0 });
635
711
  }
636
712
  }
637
- const Ne = { class: "d-flex" }, Ae = ["title"], Le = ["id"], ze = { class: "list-unstyled border-start" }, Oe = /* @__PURE__ */ q({
713
+ const qt = { class: "d-flex" }, Zt = ["title"], Jt = ["id"], Xt = { class: "list-unstyled border-start" }, Qt = /* @__PURE__ */ Y({
638
714
  __name: "IfcSubtree",
639
715
  props: {
640
716
  classificationElement: {},
641
717
  ifcEntity: {}
642
718
  },
643
- setup(l) {
644
- const e = l, t = lt.generateUUID(), s = `#${t}`, o = O(!1), i = Tt(), r = Et().getModule(Ft);
645
- function g() {
646
- if (r == null) {
719
+ setup(a) {
720
+ const t = a, e = de.generateUUID(), n = `#${e}`, o = R(!1), i = Me(), l = Be().getModule(Le);
721
+ function f() {
722
+ if (l == null) {
647
723
  console.warn("Cannot clip IFC element, ClippingBoxAnalysis module is not present");
648
724
  return;
649
725
  }
650
- const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
651
- f && !f.isEmpty() && r.setClippingBox(f);
726
+ const m = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
727
+ m && !m.isEmpty() && l.setClippingBox(m);
652
728
  }
653
- function w() {
654
- o.value = !0, e.ifcEntity.clearHighlight(), e.ifcEntity.highlightById(e.classificationElement.fragments), setTimeout(() => o.value = !1, 2e3);
729
+ function v() {
730
+ o.value = !0, t.ifcEntity.clearHighlight(), t.ifcEntity.highlightById(t.classificationElement.fragments), setTimeout(() => o.value = !1, 2e3);
655
731
  }
656
- function u() {
657
- const f = e.ifcEntity.getBoundingBoxById(e.classificationElement.fragments);
658
- f && !f.isEmpty() && i.lookTopDownAt(f);
732
+ function c() {
733
+ const m = t.ifcEntity.getBoundingBoxById(t.classificationElement.fragments);
734
+ m && !m.isEmpty() && i.lookTopDownAt(m);
659
735
  }
660
- return (f, C) => {
661
- const P = Rt("IfcSubtree", !0);
662
- return D(), N("div", null, [
663
- v("div", Ne, [
664
- v("span", {
665
- class: it([
736
+ return (m, w) => {
737
+ const I = Ue("IfcSubtree", !0);
738
+ return k(), D("div", null, [
739
+ x("div", qt, [
740
+ x("span", {
741
+ class: re([
666
742
  "border rounded px-1 py-0 fw-normal",
667
743
  o.value ? "text-danger border-danger" : "text-secondary border-secondary"
668
744
  ]),
669
- title: f.classificationElement.treeItemName
670
- }, jt(f.classificationElement.treeItemName), 11, Ae),
671
- f.classificationElement.children.length > 0 ? (D(), ot(nt, { key: 0 }, {
672
- default: at(() => [
673
- A(X, {
745
+ title: m.classificationElement.treeItemName
746
+ }, $e(m.classificationElement.treeItemName), 11, Zt),
747
+ m.classificationElement.children.length > 0 ? (k(), ae(oe, { key: 0 }, {
748
+ default: le(() => [
749
+ N(J, {
674
750
  title: "Expand group",
675
751
  icon: "bi-chevron-down",
676
752
  "data-bs-toggle": "collapse",
677
- "data-bs-target": s,
678
- "aria-controls": M(t),
753
+ "data-bs-target": n,
754
+ "aria-controls": B(e),
679
755
  "aria-expanded": "true"
680
756
  }, null, 8, ["aria-controls"])
681
757
  ]),
682
758
  _: 1
683
- })) : H("", !0),
684
- A(Bt, {
685
- class: it(["label", o.value ? "text-danger-emphasis" : "text-muted"]),
686
- text: f.classificationElement.name,
687
- title: `Zoom to ${f.classificationElement.name}`,
688
- onClick: u
759
+ })) : W("", !0),
760
+ N(ke, {
761
+ class: re(["label", o.value ? "text-danger-emphasis" : "text-muted"]),
762
+ text: m.classificationElement.name,
763
+ title: `Zoom to ${m.classificationElement.name}`,
764
+ onClick: c
689
765
  }, null, 8, ["class", "text", "title"]),
690
- A(nt, { class: "ms-1" }, {
691
- default: at(() => [
692
- A(X, {
766
+ N(oe, { class: "ms-1" }, {
767
+ default: le(() => [
768
+ N(J, {
693
769
  title: "Highlight",
694
770
  icon: "bi-highlighter",
695
- onClick: w
771
+ onClick: v
696
772
  }),
697
- M(r) != null ? (D(), ot(X, {
773
+ B(l) != null ? (k(), ae(J, {
698
774
  key: 0,
699
775
  title: "Clip to",
700
776
  icon: "bi-bounding-box",
701
- onClick: g
702
- })) : H("", !0)
777
+ onClick: f
778
+ })) : W("", !0)
703
779
  ]),
704
780
  _: 1
705
781
  })
706
782
  ]),
707
- f.classificationElement.children.length > 0 ? (D(), N("div", {
783
+ m.classificationElement.children.length > 0 ? (k(), D("div", {
708
784
  key: 0,
709
- id: M(t),
785
+ id: B(e),
710
786
  class: "collapse show"
711
787
  }, [
712
- v("ul", ze, [
713
- (D(!0), N(tt, null, ft(f.classificationElement.children, (I, T) => (D(), N("li", { key: T }, [
714
- A(P, {
715
- "ifc-entity": e.ifcEntity,
716
- "classification-element": I
788
+ x("ul", Xt, [
789
+ (k(!0), D(ne, null, ge(m.classificationElement.children, (P, T) => (k(), D("li", { key: T }, [
790
+ N(I, {
791
+ "ifc-entity": t.ifcEntity,
792
+ "classification-element": P
717
793
  }, null, 8, ["ifc-entity", "classification-element"])
718
794
  ]))), 128))
719
795
  ])
720
- ], 8, Le)) : H("", !0)
796
+ ], 8, Jt)) : W("", !0)
721
797
  ]);
722
798
  };
723
799
  }
724
- }), Re = /* @__PURE__ */ dt(Oe, [["__scopeId", "data-v-804ca598"]]), je = { key: 0 }, Ue = /* @__PURE__ */ q({
800
+ }), Kt = /* @__PURE__ */ te(Qt, [["__scopeId", "data-v-804ca598"]]), en = { key: 0 }, tn = /* @__PURE__ */ Y({
725
801
  __name: "IfcPropertyView",
726
802
  props: {
727
803
  dataset: {}
728
804
  },
729
- setup(l) {
730
- const e = Mt(), t = l, s = kt(t.dataset, "isPreloaded");
805
+ setup(a) {
806
+ const t = De(), e = a, n = Ne(e.dataset, "isPreloaded");
731
807
  function o() {
732
- const n = i();
733
- return n == null ? null : n.getClassification();
808
+ const s = i();
809
+ return s == null ? null : s.getClassification();
734
810
  }
735
811
  function i() {
736
- const n = e.getEntity(t.dataset);
737
- return n ?? null;
812
+ const s = t.getEntity(e.dataset);
813
+ return s ?? null;
738
814
  }
739
- return (n, r) => M(s) ? (D(), N("div", je, [
740
- v("ul", null, [
741
- (D(!0), N(tt, null, ft(o(), (g, w) => (D(), N("li", { key: w }, [
742
- A(Re, {
815
+ return (s, l) => B(n) ? (k(), D("div", en, [
816
+ x("ul", null, [
817
+ (k(!0), D(ne, null, ge(o(), (f, v) => (k(), D("li", { key: v }, [
818
+ N(Kt, {
743
819
  "ifc-entity": i(),
744
- "classification-element": g
820
+ "classification-element": f
745
821
  }, null, 8, ["ifc-entity", "classification-element"])
746
822
  ]))), 128))
747
823
  ])
748
- ])) : H("", !0);
749
- }
750
- }), Ve = /* @__PURE__ */ dt(Ue, [["__scopeId", "data-v-d2d82ae7"]]), Ye = (l) => {
751
- if (vt(l)) {
752
- const e = l.object;
753
- if (e.fragment != null && l.face && l.instanceId != null) {
754
- const t = e.fragment.getVertexBlockID(e.geometry, l.face.a), s = e.fragment.getItemID(l.instanceId, t).replace(/\..*/, "");
755
- return l.entity.highlight("selection", e, s), () => l.entity.clearHighlight();
824
+ ])) : W("", !0);
825
+ }
826
+ }), nn = /* @__PURE__ */ te(tn, [["__scopeId", "data-v-d2d82ae7"]]), sn = (a) => {
827
+ if (Pe(a)) {
828
+ const t = a.object;
829
+ if (t.fragment != null && a.face && a.instanceId != null) {
830
+ const e = t.fragment.getVertexBlockID(t.geometry, a.face.a), n = t.fragment.getItemID(a.instanceId, e).replace(/\..*/, "");
831
+ return a.entity.highlight("selection", t, n), () => a.entity.clearHighlight();
756
832
  }
757
833
  }
758
834
  return null;
759
- }, $e = (l) => ({
760
- name: l.filename,
835
+ }, on = (a) => ({
836
+ name: a.filename,
761
837
  source: {
762
- url: l.file
838
+ url: a.file
763
839
  },
764
840
  type: "ifc",
765
841
  visible: !0
766
- }), Ge = (l, e) => {
767
- var g, w, u, f, C, P, I, T, a;
768
- if (!vt(l))
842
+ }), an = (a, t) => {
843
+ var f, v, c, m, w, I, P, T, r;
844
+ if (!Pe(a))
769
845
  return;
770
- const t = (g = l.features) == null ? void 0 : g.at(0);
771
- if (!t)
846
+ const e = (f = a.features) == null ? void 0 : f.at(0);
847
+ if (!e)
772
848
  return;
773
- e.has("IFC") || e.set("IFC", []);
774
- const s = e.get("IFC"), { ifcProperties: o, itemProperties: i } = t, n = "NULL", r = ((w = i.Name) == null ? void 0 : w.value) ?? n;
775
- s.push({
849
+ t.has("IFC") || t.set("IFC", []);
850
+ const n = t.get("IFC"), { ifcProperties: o, itemProperties: i } = e, s = "NULL", l = ((v = i.Name) == null ? void 0 : v.value) ?? s;
851
+ n.push({
776
852
  key: "Site",
777
- value: ((f = (u = l.entity.object3d.userData) == null ? void 0 : u.dataset) == null ? void 0 : f.name) ?? n
778
- }), s.push({
853
+ value: ((m = (c = a.entity.object3d.userData) == null ? void 0 : c.dataset) == null ? void 0 : m.name) ?? s
854
+ }), n.push({
779
855
  key: "IFCType",
780
- value: te[i.type] ?? n
781
- }), s.push({ key: "Name", value: r }), s.push({ key: "ID", value: i.expressID }), s.push({ key: "GlobalId", value: ((C = i.GlobalId) == null ? void 0 : C.value) ?? n }), ((P = i.Description) == null ? void 0 : P.value) != null && s.push({ key: "Description", value: i.Description.value }), ((I = i.PredefinedType) == null ? void 0 : I.value) != null && s.push({ key: "PredefinedType", value: i.PredefinedType.value }), ((T = i.ObjectType) == null ? void 0 : T.value) != null && s.push({ key: "ObjectType", value: i.ObjectType.value });
782
- for (const { name: p, parentName: d, value: c } of o)
783
- e.has(d) || e.set(d, []), (a = e.get(d)) == null || a.push({ key: p, value: c });
784
- }, He = (l) => {
785
- const e = l.dataset, t = e.config, s = pt(t.source.position ?? e.get("position")), o = new J({
786
- ...t.source,
787
- at: s,
788
- name: e.name
856
+ value: it[i.type] ?? s
857
+ }), n.push({ key: "Name", value: l }), n.push({ key: "ID", value: i.expressID }), n.push({ key: "GlobalId", value: ((w = i.GlobalId) == null ? void 0 : w.value) ?? s }), ((I = i.Description) == null ? void 0 : I.value) != null && n.push({ key: "Description", value: i.Description.value }), ((P = i.PredefinedType) == null ? void 0 : P.value) != null && n.push({ key: "PredefinedType", value: i.PredefinedType.value }), ((T = i.ObjectType) == null ? void 0 : T.value) != null && n.push({ key: "ObjectType", value: i.ObjectType.value });
858
+ for (const { name: h, parentName: d, value: u } of o)
859
+ t.has(d) || t.set(d, []), (r = t.get(d)) == null || r.push({ key: h, value: u });
860
+ }, rn = (a) => {
861
+ const t = a.dataset, e = t.config, n = he(e.source.position ?? t.get("position")), o = new K({
862
+ ...e.source,
863
+ at: n,
864
+ name: t.name
789
865
  });
790
866
  return Promise.resolve(o);
791
867
  };
792
- class mn {
868
+ class Rn {
793
869
  constructor() {
794
- m(this, "id", "builtin-ifc-loader");
795
- m(this, "name", "IFC");
870
+ p(this, "id", "builtin-ifc-loader");
871
+ p(this, "name", "IFC");
796
872
  }
797
- async initialize(e) {
798
- e.datasets.registerDatasetType("ifc", {
799
- attributeExtractor: Ge,
800
- entityBuilder: He,
873
+ async initialize(t) {
874
+ t.datasets.registerDatasetType("ifc", {
875
+ attributeExtractor: an,
876
+ entityBuilder: rn,
801
877
  fileExtensions: ["ifc"],
802
- highlight: Ye,
878
+ highlight: sn,
803
879
  icon: "bi-building",
804
- loader: $e,
880
+ loader: on,
805
881
  name: "IFC",
806
- propertyView: Ve
807
- }), Yt.registerInspector("IfcEntity", De), await R.fetch("web-ifc.wasm").catch((t) => {
808
- console.warn("Could not load web-ifc.wasm", t);
882
+ propertyView: nn
883
+ }), qe.registerInspector("IfcEntity", Wt), await A.fetch("web-ifc.wasm").catch((e) => {
884
+ console.warn("Could not load web-ifc.wasm", e);
809
885
  });
810
886
  }
811
887
  }
812
- const B = new ht();
813
- let We = class extends Dt {
814
- constructor(e) {
815
- super(e), this.propertyNameMapping = {}, this.customPropertyMapping = {};
888
+ const ln = /* @__PURE__ */ Y({
889
+ __name: "OpenLayersMinimapComponent",
890
+ props: {
891
+ context: {}
892
+ },
893
+ setup(a) {
894
+ const t = R(), e = Ge(), n = a, o = [
895
+ [3e4, 12],
896
+ [5e4, 10],
897
+ [1e5, 8],
898
+ [4e5, 6],
899
+ [8e5, 4]
900
+ ];
901
+ function i(s) {
902
+ for (const [l, f] of o)
903
+ if (s < l)
904
+ return f;
905
+ return o[o.length - 1][1];
906
+ }
907
+ return Ye(() => {
908
+ e.value = new rt({
909
+ controls: [],
910
+ layers: [new ct({ source: new ut() })],
911
+ target: t.value,
912
+ view: new lt({
913
+ center: ce([4, 44]),
914
+ projection: "EPSG:3857",
915
+ zoom: 5
916
+ })
917
+ });
918
+ let s = new j();
919
+ const l = () => {
920
+ var I;
921
+ const v = n.context.view.getInstance(), m = n.context.view.getCameraController().getCameraPosition(), w = m.camera.z;
922
+ if (!m.camera.equals(s)) {
923
+ s = m.camera.clone();
924
+ const P = new Z(
925
+ v.referenceCrs,
926
+ s.x,
927
+ s.y
928
+ ).as("EPSG:4326"), T = i(w), r = (I = e.value) == null ? void 0 : I.getView();
929
+ r == null || r.setCenter(ce([P.longitude, P.latitude])), r == null || r.setZoom(T);
930
+ }
931
+ };
932
+ n.context.events.addEventListener("updated", l);
933
+ let f = !1;
934
+ t.value && (t.value.onclick = () => {
935
+ var v, c, m, w;
936
+ f = !f, f ? ((v = t.value) == null || v.classList.add("collapsed"), (c = t.value) == null || c.classList.remove("expanded")) : ((m = t.value) == null || m.classList.remove("collapsed"), (w = t.value) == null || w.classList.add("expanded"));
937
+ });
938
+ }), He(() => {
939
+ var s;
940
+ (s = e.value) == null || s.dispose(), e.value = void 0;
941
+ }), (s, l) => (k(), D("div", {
942
+ ref_key: "target",
943
+ ref: t,
944
+ title: "Toggle minimap",
945
+ class: "minimap expanded"
946
+ }, null, 512));
947
+ }
948
+ }), cn = /* @__PURE__ */ te(ln, [["__scopeId", "data-v-38ee3c04"]]);
949
+ class jn {
950
+ constructor() {
951
+ p(this, "id", "builtin-minimap-openlayers");
952
+ p(this, "name", "Minimap");
953
+ }
954
+ initialize(t) {
955
+ t.widgets.addWidget({
956
+ component: cn,
957
+ id: "minimap-ol"
958
+ });
959
+ }
960
+ }
961
+ const M = new fe();
962
+ let un = class extends Ae {
963
+ constructor(t) {
964
+ super(t), this.propertyNameMapping = {}, this.customPropertyMapping = {};
816
965
  }
817
- load(e, t, s, o) {
818
- const i = this, n = new Nt(this.manager);
819
- n.setPath(this.path), n.setResponseType("arraybuffer"), n.setRequestHeader(this.requestHeader), n.setWithCredentials(this.withCredentials), n.load(e, function(r) {
966
+ load(t, e, n, o) {
967
+ const i = this, s = new ze(this.manager);
968
+ s.setPath(this.path), s.setResponseType("arraybuffer"), s.setRequestHeader(this.requestHeader), s.setWithCredentials(this.withCredentials), s.load(t, function(l) {
820
969
  try {
821
- t(i.parse(r));
822
- } catch (g) {
823
- o ? o(g) : console.error(g), i.manager.itemError(e);
970
+ e(i.parse(l));
971
+ } catch (f) {
972
+ o ? o(f) : console.error(f), i.manager.itemError(t);
824
973
  }
825
- }, s, o);
974
+ }, n, o);
826
975
  }
827
- setPropertyNameMapping(e) {
828
- this.propertyNameMapping = e;
976
+ setPropertyNameMapping(t) {
977
+ this.propertyNameMapping = t;
829
978
  }
830
- setCustomPropertyNameMapping(e) {
831
- this.customPropertyMapping = e;
979
+ setCustomPropertyNameMapping(t) {
980
+ this.customPropertyMapping = t;
832
981
  }
833
- parse(e) {
834
- function t(a, p = 0) {
982
+ parse(t) {
983
+ function e(r, h = 0) {
835
984
  const d = /^ply([\s\S]*)end_header(\r\n|\r|\n)/;
836
- let c = "";
837
- const h = d.exec(a);
838
- h !== null && (c = h[1]);
985
+ let u = "";
986
+ const g = d.exec(r);
987
+ g !== null && (u = g[1]);
839
988
  const y = {
840
989
  comments: [],
841
990
  elements: [],
842
- headerLength: p,
991
+ headerLength: h,
843
992
  objInfo: ""
844
- }, _ = c.split(/\r\n|\r|\n/);
993
+ }, _ = u.split(/\r\n|\r|\n/);
845
994
  let b;
846
- function k(S, E) {
847
- const x = { type: S[0] };
848
- return x.type === "list" ? (x.name = S[3], x.countType = S[1], x.itemType = S[2]) : x.name = S[1], x.name in E && (x.name = E[x.name]), x;
995
+ function L(S, E) {
996
+ const C = { type: S[0] };
997
+ return C.type === "list" ? (C.name = S[3], C.countType = S[1], C.itemType = S[2]) : C.name = S[1], C.name in E && (C.name = E[C.name]), C;
849
998
  }
850
999
  for (let S = 0; S < _.length; S++) {
851
1000
  let E = _[S];
852
1001
  if (E = E.trim(), E === "") continue;
853
- const x = E.split(/\s+/), G = x.shift();
854
- switch (E = x.join(" "), G) {
1002
+ const C = E.split(/\s+/), H = C.shift();
1003
+ switch (E = C.join(" "), H) {
855
1004
  case "format":
856
- y.format = x[0], y.version = x[1];
1005
+ y.format = C[0], y.version = C[1];
857
1006
  break;
858
1007
  case "comment":
859
1008
  y.comments.push(E);
860
1009
  break;
861
1010
  case "element":
862
- b !== void 0 && y.elements.push(b), b = {}, b.name = x[0], b.count = parseInt(x[1]), b.properties = [];
1011
+ b !== void 0 && y.elements.push(b), b = {}, b.name = C[0], b.count = parseInt(C[1]), b.properties = [];
863
1012
  break;
864
1013
  case "property":
865
- b.properties.push(k(x, T.propertyNameMapping));
1014
+ b.properties.push(L(C, T.propertyNameMapping));
866
1015
  break;
867
1016
  case "obj_info":
868
1017
  y.objInfo = E;
869
1018
  break;
870
1019
  default:
871
- console.log("unhandled", G, x);
1020
+ console.log("unhandled", H, C);
872
1021
  }
873
1022
  }
874
1023
  return b !== void 0 && y.elements.push(b), y;
875
1024
  }
876
- function s(a, p) {
877
- switch (p) {
1025
+ function n(r, h) {
1026
+ switch (h) {
878
1027
  case "char":
879
1028
  case "uchar":
880
1029
  case "short":
@@ -887,32 +1036,32 @@ let We = class extends Dt {
887
1036
  case "uint16":
888
1037
  case "int32":
889
1038
  case "uint32":
890
- return parseInt(a);
1039
+ return parseInt(r);
891
1040
  case "float":
892
1041
  case "double":
893
1042
  case "float32":
894
1043
  case "float64":
895
- return parseFloat(a);
1044
+ return parseFloat(r);
896
1045
  }
897
1046
  }
898
- function o(a, p) {
1047
+ function o(r, h) {
899
1048
  const d = {};
900
- for (let c = 0; c < a.length; c++) {
901
- if (p.empty()) return null;
902
- if (a[c].type === "list") {
903
- const h = [], y = s(p.next(), a[c].countType);
1049
+ for (let u = 0; u < r.length; u++) {
1050
+ if (h.empty()) return null;
1051
+ if (r[u].type === "list") {
1052
+ const g = [], y = n(h.next(), r[u].countType);
904
1053
  for (let _ = 0; _ < y; _++) {
905
- if (p.empty()) return null;
906
- h.push(s(p.next(), a[c].itemType));
1054
+ if (h.empty()) return null;
1055
+ g.push(n(h.next(), r[u].itemType));
907
1056
  }
908
- d[a[c].name] = h;
1057
+ d[r[u].name] = g;
909
1058
  } else
910
- d[a[c].name] = s(p.next(), a[c].type);
1059
+ d[r[u].name] = n(h.next(), r[u].type);
911
1060
  }
912
1061
  return d;
913
1062
  }
914
1063
  function i() {
915
- const a = {
1064
+ const r = {
916
1065
  indices: [],
917
1066
  vertices: [],
918
1067
  normals: [],
@@ -921,16 +1070,16 @@ let We = class extends Dt {
921
1070
  colors: [],
922
1071
  faceVertexColors: []
923
1072
  };
924
- for (const p of Object.keys(T.customPropertyMapping))
925
- a[p] = [];
926
- return a;
1073
+ for (const h of Object.keys(T.customPropertyMapping))
1074
+ r[h] = [];
1075
+ return r;
927
1076
  }
928
- function n(a) {
929
- const p = a.map((c) => c.name);
930
- function d(c) {
931
- for (let h = 0, y = c.length; h < y; h++) {
932
- const _ = c[h];
933
- if (p.includes(_)) return _;
1077
+ function s(r) {
1078
+ const h = r.map((u) => u.name);
1079
+ function d(u) {
1080
+ for (let g = 0, y = u.length; g < y; g++) {
1081
+ const _ = u[g];
1082
+ if (h.includes(_)) return _;
934
1083
  }
935
1084
  return null;
936
1085
  }
@@ -948,147 +1097,147 @@ let We = class extends Dt {
948
1097
  attrB: d(["blue", "diffuse_blue", "b", "diffuse_b"])
949
1098
  };
950
1099
  }
951
- function r(a, p) {
952
- const d = i(), c = /end_header\s+(\S[\s\S]*\S|\S)\s*$/;
953
- let h, y;
954
- (y = c.exec(a)) !== null ? h = y[1].split(/\s+/) : h = [];
955
- const _ = new qe(h);
956
- t: for (let b = 0; b < p.elements.length; b++) {
957
- const k = p.elements[b], S = n(k.properties);
958
- for (let E = 0; E < k.count; E++) {
959
- const x = o(k.properties, _);
960
- if (!x) break t;
961
- w(d, k.name, x, S);
1100
+ function l(r, h) {
1101
+ const d = i(), u = /end_header\s+(\S[\s\S]*\S|\S)\s*$/;
1102
+ let g, y;
1103
+ (y = u.exec(r)) !== null ? g = y[1].split(/\s+/) : g = [];
1104
+ const _ = new dn(g);
1105
+ e: for (let b = 0; b < h.elements.length; b++) {
1106
+ const L = h.elements[b], S = s(L.properties);
1107
+ for (let E = 0; E < L.count; E++) {
1108
+ const C = o(L.properties, _);
1109
+ if (!C) break e;
1110
+ v(d, L.name, C, S);
962
1111
  }
963
1112
  }
964
- return g(d);
1113
+ return f(d);
965
1114
  }
966
- function g(a) {
967
- let p = new At();
968
- a.indices.length > 0 && p.setIndex(a.indices), p.setAttribute("position", new L(a.vertices, 3)), a.normals.length > 0 && p.setAttribute("normal", new L(a.normals, 3)), a.uvs.length > 0 && p.setAttribute("uv", new L(a.uvs, 2)), a.colors.length > 0 && p.setAttribute("color", new L(a.colors, 3)), (a.faceVertexUvs.length > 0 || a.faceVertexColors.length > 0) && (p = p.toNonIndexed(), a.faceVertexUvs.length > 0 && p.setAttribute("uv", new L(a.faceVertexUvs, 2)), a.faceVertexColors.length > 0 && p.setAttribute("color", new L(a.faceVertexColors, 3)));
1115
+ function f(r) {
1116
+ let h = new Oe();
1117
+ r.indices.length > 0 && h.setIndex(r.indices), h.setAttribute("position", new z(r.vertices, 3)), r.normals.length > 0 && h.setAttribute("normal", new z(r.normals, 3)), r.uvs.length > 0 && h.setAttribute("uv", new z(r.uvs, 2)), r.colors.length > 0 && h.setAttribute("color", new z(r.colors, 3)), (r.faceVertexUvs.length > 0 || r.faceVertexColors.length > 0) && (h = h.toNonIndexed(), r.faceVertexUvs.length > 0 && h.setAttribute("uv", new z(r.faceVertexUvs, 2)), r.faceVertexColors.length > 0 && h.setAttribute("color", new z(r.faceVertexColors, 3)));
969
1118
  for (const d of Object.keys(T.customPropertyMapping))
970
- a[d].length > 0 && p.setAttribute(
1119
+ r[d].length > 0 && h.setAttribute(
971
1120
  d,
972
- new L(
973
- a[d],
1121
+ new z(
1122
+ r[d],
974
1123
  T.customPropertyMapping[d].length
975
1124
  )
976
1125
  );
977
- return p.computeBoundingSphere(), p;
1126
+ return h.computeBoundingSphere(), h;
978
1127
  }
979
- function w(a, p, d, c) {
980
- if (p === "vertex") {
981
- a.vertices.push(d[c.attrX], d[c.attrY], d[c.attrZ]), c.attrNX !== null && c.attrNY !== null && c.attrNZ !== null && a.normals.push(d[c.attrNX], d[c.attrNY], d[c.attrNZ]), c.attrS !== null && c.attrT !== null && a.uvs.push(d[c.attrS], d[c.attrT]), c.attrR !== null && c.attrG !== null && c.attrB !== null && (B.setRGB(
982
- d[c.attrR] / 255,
983
- d[c.attrG] / 255,
984
- d[c.attrB] / 255,
985
- st
986
- ), a.colors.push(B.r, B.g, B.b));
987
- for (const h of Object.keys(T.customPropertyMapping))
988
- for (const y of T.customPropertyMapping[h])
989
- a[h].push(d[y]);
990
- } else if (p === "face") {
991
- const h = d.vertex_indices || d.vertex_index, y = d.texcoord;
992
- h.length === 3 ? (a.indices.push(h[0], h[1], h[2]), y && y.length === 6 && (a.faceVertexUvs.push(y[0], y[1]), a.faceVertexUvs.push(y[2], y[3]), a.faceVertexUvs.push(y[4], y[5]))) : h.length === 4 && (a.indices.push(h[0], h[1], h[3]), a.indices.push(h[1], h[2], h[3])), c.attrR !== null && c.attrG !== null && c.attrB !== null && (B.setRGB(
993
- d[c.attrR] / 255,
994
- d[c.attrG] / 255,
995
- d[c.attrB] / 255,
996
- st
997
- ), a.faceVertexColors.push(B.r, B.g, B.b), a.faceVertexColors.push(B.r, B.g, B.b), a.faceVertexColors.push(B.r, B.g, B.b));
1128
+ function v(r, h, d, u) {
1129
+ if (h === "vertex") {
1130
+ r.vertices.push(d[u.attrX], d[u.attrY], d[u.attrZ]), u.attrNX !== null && u.attrNY !== null && u.attrNZ !== null && r.normals.push(d[u.attrNX], d[u.attrNY], d[u.attrNZ]), u.attrS !== null && u.attrT !== null && r.uvs.push(d[u.attrS], d[u.attrT]), u.attrR !== null && u.attrG !== null && u.attrB !== null && (M.setRGB(
1131
+ d[u.attrR] / 255,
1132
+ d[u.attrG] / 255,
1133
+ d[u.attrB] / 255,
1134
+ ie
1135
+ ), r.colors.push(M.r, M.g, M.b));
1136
+ for (const g of Object.keys(T.customPropertyMapping))
1137
+ for (const y of T.customPropertyMapping[g])
1138
+ r[g].push(d[y]);
1139
+ } else if (h === "face") {
1140
+ const g = d.vertex_indices || d.vertex_index, y = d.texcoord;
1141
+ g.length === 3 ? (r.indices.push(g[0], g[1], g[2]), y && y.length === 6 && (r.faceVertexUvs.push(y[0], y[1]), r.faceVertexUvs.push(y[2], y[3]), r.faceVertexUvs.push(y[4], y[5]))) : g.length === 4 && (r.indices.push(g[0], g[1], g[3]), r.indices.push(g[1], g[2], g[3])), u.attrR !== null && u.attrG !== null && u.attrB !== null && (M.setRGB(
1142
+ d[u.attrR] / 255,
1143
+ d[u.attrG] / 255,
1144
+ d[u.attrB] / 255,
1145
+ ie
1146
+ ), r.faceVertexColors.push(M.r, M.g, M.b), r.faceVertexColors.push(M.r, M.g, M.b), r.faceVertexColors.push(M.r, M.g, M.b));
998
1147
  }
999
1148
  }
1000
- function u(a, p) {
1149
+ function c(r, h) {
1001
1150
  const d = {};
1002
- let c = 0;
1003
- for (let h = 0; h < p.length; h++) {
1004
- const y = p[h], _ = y.valueReader;
1151
+ let u = 0;
1152
+ for (let g = 0; g < h.length; g++) {
1153
+ const y = h[g], _ = y.valueReader;
1005
1154
  if (y.type === "list") {
1006
- const b = [], k = y.countReader.read(a + c);
1007
- c += y.countReader.size;
1008
- for (let S = 0; S < k; S++)
1009
- b.push(_.read(a + c)), c += _.size;
1155
+ const b = [], L = y.countReader.read(r + u);
1156
+ u += y.countReader.size;
1157
+ for (let S = 0; S < L; S++)
1158
+ b.push(_.read(r + u)), u += _.size;
1010
1159
  d[y.name] = b;
1011
1160
  } else
1012
- d[y.name] = _.read(a + c), c += _.size;
1161
+ d[y.name] = _.read(r + u), u += _.size;
1013
1162
  }
1014
- return [d, c];
1163
+ return [d, u];
1015
1164
  }
1016
- function f(a, p, d) {
1017
- function c(h, y, _) {
1165
+ function m(r, h, d) {
1166
+ function u(g, y, _) {
1018
1167
  switch (y) {
1019
1168
  // corespondences for non-specific length types here match rply:
1020
1169
  case "int8":
1021
1170
  case "char":
1022
- return { read: (b) => h.getInt8(b), size: 1 };
1171
+ return { read: (b) => g.getInt8(b), size: 1 };
1023
1172
  case "uint8":
1024
1173
  case "uchar":
1025
- return { read: (b) => h.getUint8(b), size: 1 };
1174
+ return { read: (b) => g.getUint8(b), size: 1 };
1026
1175
  case "int16":
1027
1176
  case "short":
1028
- return { read: (b) => h.getInt16(b, _), size: 2 };
1177
+ return { read: (b) => g.getInt16(b, _), size: 2 };
1029
1178
  case "uint16":
1030
1179
  case "ushort":
1031
- return { read: (b) => h.getUint16(b, _), size: 2 };
1180
+ return { read: (b) => g.getUint16(b, _), size: 2 };
1032
1181
  case "int32":
1033
1182
  case "int":
1034
- return { read: (b) => h.getInt32(b, _), size: 4 };
1183
+ return { read: (b) => g.getInt32(b, _), size: 4 };
1035
1184
  case "uint32":
1036
1185
  case "uint":
1037
- return { read: (b) => h.getUint32(b, _), size: 4 };
1186
+ return { read: (b) => g.getUint32(b, _), size: 4 };
1038
1187
  case "float32":
1039
1188
  case "float":
1040
- return { read: (b) => h.getFloat32(b, _), size: 4 };
1189
+ return { read: (b) => g.getFloat32(b, _), size: 4 };
1041
1190
  case "float64":
1042
1191
  case "double":
1043
- return { read: (b) => h.getFloat64(b, _), size: 8 };
1192
+ return { read: (b) => g.getFloat64(b, _), size: 8 };
1044
1193
  }
1045
1194
  }
1046
- for (let h = 0, y = a.length; h < y; h++) {
1047
- const _ = a[h];
1048
- _.type === "list" ? (_.countReader = c(p, _.countType, d), _.valueReader = c(p, _.itemType, d)) : _.valueReader = c(p, _.type, d);
1195
+ for (let g = 0, y = r.length; g < y; g++) {
1196
+ const _ = r[g];
1197
+ _.type === "list" ? (_.countReader = u(h, _.countType, d), _.valueReader = u(h, _.itemType, d)) : _.valueReader = u(h, _.type, d);
1049
1198
  }
1050
1199
  }
1051
- function C(a, p) {
1052
- const d = i(), c = p.format === "binary_little_endian", h = new DataView(a, p.headerLength);
1200
+ function w(r, h) {
1201
+ const d = i(), u = h.format === "binary_little_endian", g = new DataView(r, h.headerLength);
1053
1202
  let y, _ = 0;
1054
- for (let b = 0; b < p.elements.length; b++) {
1055
- const k = p.elements[b], S = k.properties, E = n(S);
1056
- f(S, h, c);
1057
- for (let x = 0; x < k.count; x++) {
1058
- y = u(_, S), _ += y[1];
1059
- const G = y[0];
1060
- w(d, k.name, G, E);
1203
+ for (let b = 0; b < h.elements.length; b++) {
1204
+ const L = h.elements[b], S = L.properties, E = s(S);
1205
+ m(S, g, u);
1206
+ for (let C = 0; C < L.count; C++) {
1207
+ y = c(_, S), _ += y[1];
1208
+ const H = y[0];
1209
+ v(d, L.name, H, E);
1061
1210
  }
1062
1211
  }
1063
- return g(d);
1212
+ return f(d);
1064
1213
  }
1065
- function P(a) {
1066
- let p = 0, d = !0, c = "";
1067
- const h = [], y = new TextDecoder().decode(a.subarray(0, 5)), _ = /^ply\r\n/.test(y);
1214
+ function I(r) {
1215
+ let h = 0, d = !0, u = "";
1216
+ const g = [], y = new TextDecoder().decode(r.subarray(0, 5)), _ = /^ply\r\n/.test(y);
1068
1217
  do {
1069
- const b = String.fromCharCode(a[p++]);
1218
+ const b = String.fromCharCode(r[h++]);
1070
1219
  b !== `
1071
- ` && b !== "\r" ? c += b : (c === "end_header" && (d = !1), c !== "" && (h.push(c), c = ""));
1072
- } while (d && p < a.length);
1073
- return _ === !0 && p++, { headerText: h.join("\r") + "\r", headerLength: p };
1220
+ ` && b !== "\r" ? u += b : (u === "end_header" && (d = !1), u !== "" && (g.push(u), u = ""));
1221
+ } while (d && h < r.length);
1222
+ return _ === !0 && h++, { headerText: g.join("\r") + "\r", headerLength: h };
1074
1223
  }
1075
- let I;
1224
+ let P;
1076
1225
  const T = this;
1077
- if (e instanceof ArrayBuffer) {
1078
- const a = new Uint8Array(e), { headerText: p, headerLength: d } = P(a), c = t(p, d);
1079
- if (c.format === "ascii") {
1080
- const h = new TextDecoder().decode(a);
1081
- I = r(h, c);
1226
+ if (t instanceof ArrayBuffer) {
1227
+ const r = new Uint8Array(t), { headerText: h, headerLength: d } = I(r), u = e(h, d);
1228
+ if (u.format === "ascii") {
1229
+ const g = new TextDecoder().decode(r);
1230
+ P = l(g, u);
1082
1231
  } else
1083
- I = C(e, c);
1232
+ P = w(t, u);
1084
1233
  } else
1085
- I = r(e, t(e));
1086
- return I;
1234
+ P = l(t, e(t));
1235
+ return P;
1087
1236
  }
1088
1237
  };
1089
- class qe {
1090
- constructor(e) {
1091
- this.arr = e, this.i = 0;
1238
+ class dn {
1239
+ constructor(t) {
1240
+ this.arr = t, this.i = 0;
1092
1241
  }
1093
1242
  empty() {
1094
1243
  return this.i >= this.arr.length;
@@ -1097,112 +1246,143 @@ class qe {
1097
1246
  return this.arr[this.i++];
1098
1247
  }
1099
1248
  }
1100
- const V = class V extends ct {
1249
+ const $ = class $ extends pe {
1101
1250
  constructor() {
1102
1251
  super(...arguments);
1103
- m(this, "isPickableFeatures", !0);
1104
- m(this, "isPlyMesh", !0);
1105
- }
1106
- pickFeaturesFrom(t) {
1107
- if (this.geometry.hasAttribute("color") && t.face) {
1108
- const s = this.geometry.getAttribute("color").array, o = t.face, n = [{ color: new ht(
1109
- s[o.a * 3],
1110
- s[o.a * 3 + 1],
1111
- s[o.a * 3 + 2]
1252
+ p(this, "isPickableFeatures", !0);
1253
+ p(this, "isPlyMesh", !0);
1254
+ }
1255
+ pickFeaturesFrom(e) {
1256
+ if (this.geometry.hasAttribute("color") && e.face) {
1257
+ const n = this.geometry.getAttribute("color").array, o = e.face, s = [{ color: new fe(
1258
+ n[o.a * 3],
1259
+ n[o.a * 3 + 1],
1260
+ n[o.a * 3 + 2]
1112
1261
  ) }];
1113
- return t.features = n, n;
1262
+ return e.features = s, s;
1114
1263
  }
1115
1264
  return [];
1116
1265
  }
1117
1266
  };
1118
- m(V, "isPlyMesh", (t) => $(t) && t.isPlyMesh), m(V, "isPlyPickResult", (t) => $(t) && V.isPlyMesh(t == null ? void 0 : t.object));
1119
- let W = V;
1120
- class Xe extends gt {
1121
- constructor(t) {
1122
- super(new ut());
1123
- m(this, "isPlyEntity", !0);
1124
- m(this, "source");
1125
- this.source = t;
1267
+ p($, "isPlyMesh", (e) => G(e) && e.isPlyMesh), p($, "isPlyPickResult", (e) => G(e) && $.isPlyMesh(e == null ? void 0 : e.object));
1268
+ let q = $;
1269
+ class pn extends be {
1270
+ constructor(e) {
1271
+ super(new me());
1272
+ p(this, "isPlyEntity", !0);
1273
+ p(this, "source");
1274
+ this.source = e;
1126
1275
  }
1127
1276
  async preprocess() {
1128
- const t = await R.fetchArrayBuffer(this.source.url), s = this.source.at.as(this.source.featureProjection).toVector3(), i = new We().parse(t), n = new Lt({
1129
- side: zt
1277
+ const e = await A.fetchArrayBuffer(this.source.url), n = this.source.at.as(this.source.featureProjection).toVector3(), i = new un().parse(e), s = new Re({
1278
+ side: je
1130
1279
  });
1131
- i.hasAttribute("color") && (n.vertexColors = !0), i.computeVertexNormals();
1132
- const r = new W(i, n);
1133
- r.name = "plyModel", i.computeBoundingBox(), r.position.copy(s), r.updateWorldMatrix(!0, !0), this.object3d.add(r), this.onObjectCreated(r);
1134
- const g = R.getContext(this.source.url);
1135
- K(this, { filename: g.filename }), this.notifyChange(this.object3d);
1280
+ i.hasAttribute("color") && (s.vertexColors = !0), i.computeVertexNormals();
1281
+ const l = new q(i, s);
1282
+ l.name = "plyModel", i.computeBoundingBox(), l.position.copy(n), l.updateWorldMatrix(!0, !0), this.object3d.add(l), this.onObjectCreated(l);
1283
+ const f = A.getContext(this.source.url);
1284
+ ee(this, { filename: f.filename }), this.notifyChange(this.object3d);
1136
1285
  }
1137
1286
  }
1138
- const Ze = (l) => {
1139
- const { dataset: e, instance: t } = l, s = e.config, o = pt(s.source.position ?? e.get("position")), i = new Xe({
1140
- ...s.source,
1287
+ const mn = (a) => {
1288
+ const { dataset: t, instance: e } = a, n = t.config, o = he(n.source.position ?? t.get("position")), i = new pn({
1289
+ ...n.source,
1141
1290
  at: o,
1142
- featureProjection: t.referenceCrs
1291
+ featureProjection: e.referenceCrs
1143
1292
  });
1144
1293
  return Promise.resolve(i);
1145
- }, Qe = (l, e) => {
1294
+ }, hn = (a, t) => {
1146
1295
  var o;
1147
- if (!W.isPlyPickResult(l))
1296
+ if (!q.isPlyPickResult(a))
1148
1297
  return;
1149
- const t = (o = l.features) == null ? void 0 : o.at(0);
1150
- if (!t)
1298
+ const e = (o = a.features) == null ? void 0 : o.at(0);
1299
+ if (!e)
1151
1300
  return;
1152
- e.has("PLY") || e.set("PLY", []), e.get("PLY").push({ key: "Color", value: t.color });
1301
+ t.has("PLY") || t.set("PLY", []), t.get("PLY").push({ key: "Color", value: e.color });
1153
1302
  };
1154
- class yn {
1303
+ class Un {
1155
1304
  constructor() {
1156
- m(this, "id", "builtin-ply-loader");
1157
- m(this, "name", "PLY");
1305
+ p(this, "id", "builtin-ply-loader");
1306
+ p(this, "name", "PLY");
1158
1307
  }
1159
- initialize(e) {
1160
- e.datasets.registerDatasetType("ply", {
1161
- attributeExtractor: Qe,
1162
- entityBuilder: Ze,
1308
+ initialize(t) {
1309
+ t.datasets.registerDatasetType("ply", {
1310
+ attributeExtractor: hn,
1311
+ entityBuilder: mn,
1163
1312
  icon: "bi-file-earmark-binary",
1164
1313
  name: "PLY"
1165
1314
  });
1166
1315
  }
1167
1316
  }
1168
- const Je = (l) => {
1169
- const e = l.dataset.config, t = new ne({
1170
- source: new se({ url: `${e.source.url}/${e.source.filename}` })
1317
+ const fn = (a) => {
1318
+ a.addEventListener("object-created", (t) => {
1319
+ t.obj.traverse((n) => {
1320
+ var o;
1321
+ ((o = n.userData) == null ? void 0 : o.class) === "IfcSpace" && (n.visible = !1);
1322
+ });
1323
+ });
1324
+ };
1325
+ class $n {
1326
+ constructor() {
1327
+ p(this, "id", "builtin-post-process-entities");
1328
+ p(this, "name", "Post-process 3D Tiles");
1329
+ p(this, "_alreadyProcessedEntities", /* @__PURE__ */ new Set());
1330
+ p(this, "_processings", [fn]);
1331
+ }
1332
+ initialize(t) {
1333
+ t.events.addEventListener("ready", () => {
1334
+ const e = t.view.getInstance();
1335
+ e.addEventListener("entity-added", () => this.processEntities(e)), this.processEntities(e);
1336
+ });
1337
+ }
1338
+ processEntities(t) {
1339
+ for (const e of t.getEntities())
1340
+ this._alreadyProcessedEntities.has(e.id) || (ve(e) && this.processEntity(e, t), this._alreadyProcessedEntities.add(e.id));
1341
+ }
1342
+ processEntity(t, e) {
1343
+ const n = { instance: e };
1344
+ for (const o of this._processings)
1345
+ o(t, n);
1346
+ }
1347
+ }
1348
+ const gn = (a) => {
1349
+ const t = a.dataset.config, e = new dt({
1350
+ source: new pt({ url: `${t.source.url}/${t.source.filename}` })
1171
1351
  });
1172
- return K(t, {
1173
- filename: e.source.url
1174
- }), Promise.resolve(t);
1352
+ return ee(e, {
1353
+ filename: t.source.url
1354
+ }), Promise.resolve(e);
1175
1355
  };
1176
- class bn {
1356
+ class Gn {
1177
1357
  constructor() {
1178
- m(this, "id", "builtin-potree-loader");
1179
- m(this, "name", "Potree");
1358
+ p(this, "id", "builtin-potree-loader");
1359
+ p(this, "name", "Potree");
1180
1360
  }
1181
- initialize(e) {
1182
- e.datasets.registerDatasetType("potree", {
1183
- entityBuilder: Je,
1361
+ initialize(t) {
1362
+ t.datasets.registerDatasetType("potree", {
1363
+ entityBuilder: gn,
1184
1364
  icon: "fg-multipoint",
1185
1365
  name: "Potree Point Cloud"
1186
1366
  });
1187
1367
  }
1188
1368
  }
1189
- class _n {
1369
+ class Yn {
1190
1370
  constructor() {
1191
- m(this, "id", "builtin-tour");
1192
- m(this, "name", "Tour");
1193
- m(this, "_camera", null);
1194
- m(this, "_cameraCallback", null);
1195
- m(this, "_context", null);
1196
- m(this, "_tours", null);
1371
+ p(this, "id", "builtin-tour");
1372
+ p(this, "name", "Tour");
1373
+ p(this, "_camera", null);
1374
+ p(this, "_cameraCallback", null);
1375
+ p(this, "_context", null);
1376
+ p(this, "_tours", null);
1197
1377
  }
1198
- initialize(e) {
1199
- this._context = e, e.events.addEventListener("ready", this.start.bind(this));
1378
+ initialize(t) {
1379
+ this._context = t, t.events.addEventListener("ready", this.start.bind(this));
1200
1380
  }
1201
1381
  buildTours() {
1202
- const e = this._camera, t = new F.Tour({
1382
+ const t = this._camera, e = new F.Tour({
1203
1383
  tourName: "main",
1204
1384
  useModalOverlay: !0
1205
- }), s = new F.Tour({
1385
+ }), n = new F.Tour({
1206
1386
  tourName: "navigating",
1207
1387
  useModalOverlay: !0
1208
1388
  }), o = new F.Tour({
@@ -1210,54 +1390,54 @@ class _n {
1210
1390
  useModalOverlay: !0
1211
1391
  }), i = [
1212
1392
  { action: () => {
1213
- var u;
1214
- return (u = F.activeTour) == null ? void 0 : u.next();
1393
+ var c;
1394
+ return (c = F.activeTour) == null ? void 0 : c.next();
1215
1395
  }, text: "Next" },
1216
1396
  { action: () => {
1217
- var u;
1218
- return (u = F.activeTour) == null ? void 0 : u.cancel();
1397
+ var c;
1398
+ return (c = F.activeTour) == null ? void 0 : c.cancel();
1219
1399
  }, secondary: !0, text: "Exit" }
1220
- ], n = () => {
1221
- var a, p;
1222
- const u = (a = F.activeTour) == null ? void 0 : a.getCurrentStep(), f = u == null ? void 0 : u.getElement(), C = f == null ? void 0 : f.querySelector(".shepherd-text"), P = (p = F.activeTour) == null ? void 0 : p.steps;
1223
- if (u == null || f == null || C == null || P == null)
1400
+ ], s = () => {
1401
+ var r, h;
1402
+ const c = (r = F.activeTour) == null ? void 0 : r.getCurrentStep(), m = c == null ? void 0 : c.getElement(), w = m == null ? void 0 : m.querySelector(".shepherd-text"), I = (h = F.activeTour) == null ? void 0 : h.steps;
1403
+ if (c == null || m == null || w == null || I == null)
1224
1404
  return;
1225
- const I = document.createElement("div");
1226
- I.className = "progress mt-3", I.setAttribute("role", "progressbar"), I.style.height = "2px";
1405
+ const P = document.createElement("div");
1406
+ P.className = "progress mt-3", P.setAttribute("role", "progressbar"), P.style.height = "2px";
1227
1407
  const T = document.createElement("div");
1228
- T.className = "progress-bar bg-success", T.style.width = `${100 * (P.indexOf(u) / P.length)}%`, I.appendChild(T), C.appendChild(I);
1229
- }, r = async (u, f) => new Promise((C) => {
1230
- const P = document.getElementById(u);
1231
- if (P && !P.classList.contains("active") && P.click(), document.querySelector(f))
1232
- return C(document.querySelector(f));
1233
- const I = new MutationObserver(() => {
1234
- document.querySelector(f) && (I.disconnect(), C(document.querySelector(f)));
1408
+ T.className = "progress-bar bg-success", T.style.width = `${100 * (I.indexOf(c) / I.length)}%`, P.appendChild(T), w.appendChild(P);
1409
+ }, l = async (c, m) => new Promise((w) => {
1410
+ const I = document.getElementById(c);
1411
+ if (I && !I.classList.contains("active") && I.click(), document.querySelector(m))
1412
+ return w(document.querySelector(m));
1413
+ const P = new MutationObserver(() => {
1414
+ document.querySelector(m) && (P.disconnect(), w(document.querySelector(m)));
1235
1415
  });
1236
- I.observe(document.body, {
1416
+ P.observe(document.body, {
1237
1417
  childList: !0,
1238
1418
  subtree: !0
1239
1419
  });
1240
1420
  });
1241
- t.addStep({
1421
+ e.addStep({
1242
1422
  buttons: [
1243
1423
  {
1244
1424
  action: () => {
1245
- var u;
1246
- (u = F.activeTour) == null || u.complete(), s.show(0);
1425
+ var c;
1426
+ (c = F.activeTour) == null || c.complete(), n.show(0);
1247
1427
  },
1248
1428
  text: "Navigating"
1249
1429
  },
1250
1430
  {
1251
1431
  action: () => {
1252
- var u;
1253
- (u = F.activeTour) == null || u.complete(), o.show(0);
1432
+ var c;
1433
+ (c = F.activeTour) == null || c.complete(), o.show(0);
1254
1434
  },
1255
1435
  text: "Analyzing data"
1256
1436
  },
1257
1437
  {
1258
1438
  action: () => {
1259
- var u;
1260
- return (u = F.activeTour) == null ? void 0 : u.cancel();
1439
+ var c;
1440
+ return (c = F.activeTour) == null ? void 0 : c.cancel();
1261
1441
  },
1262
1442
  secondary: !0,
1263
1443
  text: "Exit"
@@ -1268,9 +1448,9 @@ class _n {
1268
1448
  text: "<p>Welcome to <strong>Piero</strong>, the Giro3D application.<br/>We can guide you through the different features.</p>",
1269
1449
  title: "Welcome!",
1270
1450
  when: {
1271
- show: n
1451
+ show: s
1272
1452
  }
1273
- }), s.addStep({
1453
+ }), n.addStep({
1274
1454
  attachTo: {
1275
1455
  element: "#main-view",
1276
1456
  on: "bottom"
@@ -1279,9 +1459,9 @@ class _n {
1279
1459
  id: "view",
1280
1460
  text: "<p>This is the <b>main view</b>.</p><p>Giro3D natively supports a broad range of data sources, from 2D raster and vector data, to 3D point clouds and tilesets.</p><p>Piero adds support for CityJSON and IFC files.</p>",
1281
1461
  when: {
1282
- show: n
1462
+ show: s
1283
1463
  }
1284
- }), s.addStep({
1464
+ }), n.addStep({
1285
1465
  attachTo: {
1286
1466
  element: "#main-view",
1287
1467
  on: "bottom"
@@ -1291,77 +1471,77 @@ class _n {
1291
1471
  text: '<p>This application integrates <a href="https://github.com/yomotsu/camera-controls">camera-controls</a>, a camera control for three.js.</p><p><b>Click</b> to move the camera. <b>Right-click</b> to rotate around a point. <b>Scroll</b> to zoom in or out.</p>',
1292
1472
  when: {
1293
1473
  hide: () => {
1294
- this._cameraCallback && e.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
1474
+ this._cameraCallback && t.removeEventListener("interaction-end", this._cameraCallback), this._cameraCallback = null;
1295
1475
  },
1296
1476
  show: () => {
1297
- let u = 0;
1477
+ let c = 0;
1298
1478
  this._cameraCallback = () => {
1299
- var f;
1300
- u += 1, u > 2 && ((f = F.activeTour) == null || f.next());
1301
- }, e.addEventListener("interaction-end", this._cameraCallback), n();
1479
+ var m;
1480
+ c += 1, c > 2 && ((m = F.activeTour) == null || m.next());
1481
+ }, t.addEventListener("interaction-end", this._cameraCallback), s();
1302
1482
  }
1303
1483
  }
1304
- }), s.addStep({
1484
+ }), n.addStep({
1305
1485
  attachTo: {
1306
1486
  element: "#toolbar",
1307
1487
  on: "right"
1308
1488
  },
1309
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1489
+ beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1310
1490
  buttons: i,
1311
1491
  id: "toolbar-layers",
1312
1492
  text: "<p>Giro3D supports multiple datasets.</p><p>You can toggle datasets as you wish with the <b>Datasets</b> panel.</p>",
1313
1493
  when: {
1314
- show: n
1494
+ show: s
1315
1495
  }
1316
- }), s.addStep({
1496
+ }), n.addStep({
1317
1497
  attachTo: {
1318
1498
  element: "#basemap-list",
1319
1499
  on: "right"
1320
1500
  },
1321
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1501
+ beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1322
1502
  buttons: i,
1323
1503
  id: "basemaps",
1324
1504
  text: "<p><b>Basemaps</b> are color and elevation layers that make the basic shape and aspect of the <b>Map</b>.</p>",
1325
1505
  when: {
1326
- show: n
1506
+ show: s
1327
1507
  }
1328
- }), s.addStep({
1508
+ }), n.addStep({
1329
1509
  attachTo: {
1330
1510
  element: "#overlay-list",
1331
1511
  on: "right"
1332
1512
  },
1333
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1513
+ beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1334
1514
  buttons: i,
1335
1515
  id: "overlays",
1336
1516
  text: "<p><b>Overlays</b> are vector layers in various formats (WFS, GML, GeoJSON...).</p>",
1337
1517
  when: {
1338
- show: n
1518
+ show: s
1339
1519
  }
1340
- }), s.addStep({
1520
+ }), n.addStep({
1341
1521
  attachTo: {
1342
1522
  element: "#dataset-list",
1343
1523
  on: "right"
1344
1524
  },
1345
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1525
+ beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1346
1526
  buttons: i,
1347
1527
  id: "layers",
1348
1528
  text: "<p>The <b>Datasets</b> panel contains all 3D objects in the scene.</><p>You can toggle their visibility and delete them.<p><p>Most objects leverage Giro3D's adaptive resolution to optimize their display.</p>",
1349
1529
  when: {
1350
- show: n
1530
+ show: s
1351
1531
  }
1352
- }), s.addStep({
1532
+ }), n.addStep({
1353
1533
  attachTo: {
1354
1534
  element: "#datasets-drop-zone",
1355
1535
  on: "right"
1356
1536
  },
1357
- beforeShowPromise: () => r("toolbar-datasets", "#datasets-drop-zone"),
1537
+ beforeShowPromise: () => l("toolbar-datasets", "#datasets-drop-zone"),
1358
1538
  buttons: i,
1359
1539
  id: "adddata",
1360
1540
  text: "<p>You can add your own data from your computer by <b>dragging the file</b> into this page.</p><p>While you won't benefit from Giro3D's tiling mechanism, this can be a great way to quickly visualize datasets up to 100MB.</p><p>This application supports CityJSONs, IFCs, LAS/LAZs, CSV pointclouds, and simple GeoJSON features.</p>",
1361
1541
  when: {
1362
- show: n
1542
+ show: s
1363
1543
  }
1364
- }), s.addStep({
1544
+ }), n.addStep({
1365
1545
  attachTo: {
1366
1546
  element: "#main-view",
1367
1547
  on: "bottom"
@@ -1370,9 +1550,9 @@ class _n {
1370
1550
  id: "attributes",
1371
1551
  text: "<p>By clicking on any feature on the map, you can see its <strong>Attribute table</strong>. Clickable features display a cursor when hovered.</p>",
1372
1552
  when: {
1373
- show: n
1553
+ show: s
1374
1554
  }
1375
- }), s.addStep({
1555
+ }), n.addStep({
1376
1556
  attachTo: {
1377
1557
  element: "#search-place-autocomplete",
1378
1558
  on: "bottom"
@@ -1380,15 +1560,15 @@ class _n {
1380
1560
  buttons: [
1381
1561
  {
1382
1562
  action: () => {
1383
- var u;
1384
- (u = F.activeTour) == null || u.complete(), o.show(0);
1563
+ var c;
1564
+ (c = F.activeTour) == null || c.complete(), o.show(0);
1385
1565
  },
1386
1566
  text: "Analyzing data"
1387
1567
  },
1388
1568
  {
1389
1569
  action: () => {
1390
- var u;
1391
- return (u = F.activeTour) == null ? void 0 : u.complete();
1570
+ var c;
1571
+ return (c = F.activeTour) == null ? void 0 : c.complete();
1392
1572
  },
1393
1573
  secondary: !0,
1394
1574
  text: "Exit"
@@ -1397,97 +1577,101 @@ class _n {
1397
1577
  id: "widgets",
1398
1578
  text: "Giro3D is highly extensible. Here we added a widget to search and navigate to locations based on the French address database.",
1399
1579
  when: {
1400
- show: n
1580
+ show: s
1401
1581
  }
1402
1582
  }), o.addStep({
1403
1583
  attachTo: {
1404
1584
  element: "#annotations-fieldset",
1405
1585
  on: "right"
1406
1586
  },
1407
- beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1587
+ beforeShowPromise: () => l("toolbar-annotations", "#annotations-fieldset"),
1408
1588
  buttons: i,
1409
1589
  id: "annotation",
1410
1590
  text: "<p>You can <strong>annotate</strong> any data displayed using Giro3D native tools.<br>Select the <strong>geometry</strong> of your annotation, and <strong>click</strong> on the scene to add points. <strong>Right-click</strong> to end the shape.</p>",
1411
1591
  when: {
1412
- show: n
1592
+ show: s
1413
1593
  }
1414
1594
  }), o.addStep({
1415
1595
  attachTo: {
1416
1596
  element: "#annotations-fieldset",
1417
1597
  on: "right"
1418
1598
  },
1419
- beforeShowPromise: () => r("toolbar-annotations", "#annotations-fieldset"),
1599
+ beforeShowPromise: () => l("toolbar-annotations", "#annotations-fieldset"),
1420
1600
  buttons: i,
1421
1601
  id: "annotations",
1422
1602
  text: "You can download your annotations as GeoJSON files. You can also upload your own by dragging them into this panel.",
1423
1603
  when: {
1424
- show: n
1604
+ show: s
1425
1605
  }
1426
- }), Ot("measurements") && o.addStep({
1606
+ }), Ve("measurements") && o.addStep({
1427
1607
  attachTo: {
1428
1608
  element: "#panel-container",
1429
1609
  on: "right"
1430
1610
  },
1431
- beforeShowPromise: () => r("toolbar-measures", "#measures-fieldset"),
1611
+ beforeShowPromise: () => l("toolbar-measures", "#measures-fieldset"),
1432
1612
  buttons: i,
1433
1613
  id: "measurements",
1434
1614
  text: "You can add <strong>measurements</strong> to easily get distances betwween objects.<br>Once started, moving the mouse will display the measure. <strong>Click</strong> to save the measurement. <strong>Right-click</strong> to end.",
1435
1615
  when: {
1436
- show: n
1616
+ show: s
1437
1617
  }
1438
1618
  }), o.addStep({
1439
1619
  attachTo: {
1440
1620
  element: "#panel-container",
1441
1621
  on: "right"
1442
1622
  },
1443
- beforeShowPromise: () => r("toolbar-analysis", "#panel-container .card"),
1623
+ beforeShowPromise: () => l("toolbar-analysis", "#panel-container .card"),
1444
1624
  buttons: [{ action: () => {
1445
- var u;
1446
- return (u = F.activeTour) == null ? void 0 : u.complete();
1625
+ var c;
1626
+ return (c = F.activeTour) == null ? void 0 : c.complete();
1447
1627
  }, text: "Done!" }],
1448
1628
  id: "analysis",
1449
1629
  text: "In the <strong>Analysis</strong> panel you'll find some advanced analysis tools.",
1450
1630
  when: {
1451
- show: n
1631
+ show: s
1452
1632
  }
1453
1633
  });
1454
- const g = () => {
1455
- const u = new URL(document.URL);
1456
- u.searchParams.delete("tourStep"), u.searchParams.set("tour", "none"), window.history.replaceState({}, "", u.toString());
1457
- }, w = (u) => {
1458
- const f = new URL(document.URL);
1459
- let C = "main";
1460
- u.tour.id.startsWith("navigating") ? C = "navigating" : u.tour.id.startsWith("analyzing") && (C = "analyzing"), f.searchParams.set("tour", C), f.searchParams.set("tourStep", u.step.id), window.history.replaceState({}, "", f.toString());
1634
+ const f = () => {
1635
+ const c = new URL(document.URL);
1636
+ c.searchParams.delete("tourStep"), c.searchParams.set("tour", "none"), window.history.replaceState({}, "", c.toString());
1637
+ }, v = (c) => {
1638
+ const m = new URL(document.URL);
1639
+ let w = "main";
1640
+ c.tour.id.startsWith("navigating") ? w = "navigating" : c.tour.id.startsWith("analyzing") && (w = "analyzing"), m.searchParams.set("tour", w), m.searchParams.set("tourStep", c.step.id), window.history.replaceState({}, "", m.toString());
1461
1641
  };
1462
- return t.on("cancel", g), t.on("complete", g), t.on("show", w), s.on("cancel", g), s.on("complete", g), s.on("show", w), o.on("cancel", g), o.on("complete", g), o.on("show", w), { analyzingTour: o, mainTour: t, navigatingTour: s };
1642
+ return e.on("cancel", f), e.on("complete", f), e.on("show", v), n.on("cancel", f), n.on("complete", f), n.on("show", v), o.on("cancel", f), o.on("complete", f), o.on("show", v), { analyzingTour: o, mainTour: e, navigatingTour: n };
1463
1643
  }
1464
1644
  getTours() {
1465
1645
  return this._tours || (this._tours = this.buildTours()), this._tours;
1466
1646
  }
1467
1647
  restart() {
1468
- const { mainTour: e } = this.getTours();
1469
- e.show(0);
1648
+ const { mainTour: t } = this.getTours();
1649
+ t.show(0);
1470
1650
  }
1471
1651
  start() {
1472
1652
  if (!this._context)
1473
1653
  throw new Error("module is not initialized");
1474
- const { analyzingTour: e, mainTour: t, navigatingTour: s } = this.getTours();
1654
+ const { analyzingTour: t, mainTour: e, navigatingTour: n } = this.getTours();
1475
1655
  this._camera = this._context.view.getCameraController();
1476
1656
  const o = new URL(document.URL), i = o.searchParams.get("tour") ?? "main";
1477
1657
  if (i !== "none") {
1478
- const n = o.searchParams.get("tourStep") ?? 0;
1479
- i === "navigating" ? s.show(n) : i === "analyzing" ? e.show(n) : t.show(n);
1658
+ const s = o.searchParams.get("tourStep") ?? 0;
1659
+ i === "navigating" ? n.show(s) : i === "analyzing" ? t.show(s) : e.show(s);
1480
1660
  }
1481
1661
  }
1482
1662
  }
1483
1663
  export {
1484
- xn as ClippingBoxAnalysis,
1485
- pn as CrossSectionAnalysis,
1486
- hn as DownloadDataset,
1487
- fn as FloodingPlaneAnalysis,
1488
- mn as IFCLoader,
1489
- yn as PLYLoader,
1490
- bn as PotreeLoader,
1491
- _n as Tour
1664
+ qn as ClippingBoxAnalysis,
1665
+ zn as CoordinatesSearch,
1666
+ Dn as CrossSectionAnalysis,
1667
+ Nn as DownloadDataset,
1668
+ An as FloodingPlaneAnalysis,
1669
+ On as FrenchBanGeocoder,
1670
+ Rn as IFCLoader,
1671
+ jn as OpenLayersMinimap,
1672
+ Un as PLYLoader,
1673
+ $n as PostProcessEntities,
1674
+ Gn as PotreeLoader,
1675
+ Yn as Tour
1492
1676
  };
1493
1677
  //# sourceMappingURL=modules.es.js.map