@vcmap/viewshed 4.0.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,119 @@
1
- var Le = Object.defineProperty;
2
- var Fe = (e, o, t) => o in e ? Le(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
- var C = (e, o, t) => Fe(e, typeof o != "symbol" ? o + "" : o, t);
4
- import { VcsCameraPrimitive as We, VcsObject as je, VcsEvent as te, AbstractInteraction as Ge, EventType as ee, Projection as J, SessionType as Be, CesiumMap as z, startEditFeaturesSession as Ue, startEditGeometrySession as xe, VectorLayer as He, maxZIndex as ze, wgs84Projection as Ke, markVolatile as Ye, Viewpoint as Xe, TransformationMode as Je, Category as Ze, moduleIdSymbol as qe } from "../../../assets/core.js";
5
- import { Color as ie, Matrix4 as Qe, Transforms as et, Primitive as ge, PerInstanceColorAppearance as Ce, GeometryInstance as _e, SphereGeometry as tt, ColorGeometryInstanceAttribute as Ee, SphereOutlineGeometry as it, Math as F, Cartesian3 as x, ShadowMap as ot, Camera as st, HeightReference as nt } from "../../../assets/cesium.js";
6
- import { shallowRef as ae, ref as K, nextTick as at, defineComponent as Me, inject as ce, reactive as oe, watchEffect as rt, watch as Z, onMounted as lt, onUnmounted as ct, computed as dt, resolveComponent as V, openBlock as R, createElementBlock as q, createCommentVNode as Y, createBlock as W, withCtx as m, createTextVNode as H, toDisplayString as j, createVNode as v, createElementVNode as ut, Fragment as ye, renderList as be, toRaw as ht, mergeProps as ft } from "../../../assets/vue.js";
7
- import { ol$Observable$unByKey as pt, Feature as vt, ol$geom$Point as mt, ol$style$Style as wt } from "../../../assets/ol.js";
8
- import { VcsWorkspaceWrapper as gt, VcsTextField as Ct, VcsSelect as Te, VcsLabeledSlider as _t, VcsLabel as Re, VcsHelp as Et, VcsFormSection as Ne, VcsFeatureTransforms as yt, VcsFormButton as bt, makeEditorCollectionComponentClass as Vt, WindowSlot as St, ToolboxType as Ve, createSupportedMapMappingFunction as Ot, createListExportAction as Mt, downloadText as Tt, createListImportAction as Rt, NotificationType as ne, AbstractConfigEditor as Nt } from "../../../assets/ui.js";
9
- import { VRow as Ie, VDivider as It, VCol as Pe, VColorPicker as Pt, VContainer as At } from "../../../assets/vuetify.js";
10
- const Ae = Symbol("isMatcher"), $t = Symbol("Integer"), Dt = Symbol("NonEmptyString"), ve = /* @__PURE__ */ new Map();
1
+ var ze = Object.defineProperty;
2
+ var He = (e, o, t) => o in e ? ze(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
3
+ var C = (e, o, t) => He(e, typeof o != "symbol" ? o + "" : o, t);
4
+ import { VcsCameraPrimitive as Ke, VcsObject as Ye, VcsEvent as se, AbstractInteraction as Xe, EventType as oe, Projection as Z, SessionType as Je, CesiumMap as H, startEditFeaturesSession as Ze, startEditGeometrySession as qe, VectorLayer as Qe, maxZIndex as et, wgs84Projection as tt, markVolatile as it, Viewpoint as ot, TransformationMode as st, Category as nt, moduleIdSymbol as ee } from "../../../assets/core.js";
5
+ import { shallowRef as le, ref as K, nextTick as at, defineComponent as Ae, inject as me, reactive as Q, watchEffect as rt, watch as q, onMounted as lt, onUnmounted as ct, computed as dt, resolveComponent as V, openBlock as N, createElementBlock as te, createCommentVNode as Y, createBlock as W, withCtx as v, createTextVNode as z, toDisplayString as j, createVNode as m, createElementVNode as ut, Fragment as Ve, renderList as Se, toRaw as ht, mergeProps as ft } from "../../../assets/vue.js";
6
+ import { Color as ne, Matrix4 as pt, Transforms as mt, Primitive as Oe, PerInstanceColorAppearance as Te, GeometryInstance as Re, SphereGeometry as vt, ColorGeometryInstanceAttribute as Me, SphereOutlineGeometry as wt, Math as F, Cartesian3 as x, ShadowMap as gt, Camera as Ct, HeightReference as _t } from "../../../assets/cesium.js";
7
+ import { ol$Observable$unByKey as Et, Feature as yt, ol$geom$Point as bt, ol$style$Style as Vt } from "../../../assets/ol.js";
8
+ import { VcsWorkspaceWrapper as St, VcsTextField as Ot, VcsSelect as ke, VcsLabeledSlider as Tt, VcsLabel as De, VcsHelp as Rt, VcsFormSection as $e, VcsFeatureTransforms as Mt, VcsFormButton as Nt, makeEditorCollectionComponentClass as It, WindowSlot as Pt, ToolboxType as Ne, createSupportedMapMappingFunction as At, createListExportAction as kt, downloadText as Dt, createListImportAction as $t, NotificationType as re, AbstractConfigEditor as Lt, VcsCallback as Le } from "../../../assets/ui.js";
9
+ import { VRow as Fe, VDivider as Ft, VCol as We, VColorPicker as Wt, VContainer as jt } from "../../../assets/vuetify.js";
10
+ const b = {
11
+ ERROR: 2,
12
+ WARN: 4,
13
+ INFO: 8,
14
+ DEBUG: 16
15
+ }, G = {
16
+ ERROR: 0,
17
+ WARN: 0,
18
+ INFO: 0,
19
+ DEBUG: 0
20
+ };
21
+ G.ERROR = b.ERROR | b.WARN | b.INFO | b.DEBUG;
22
+ G.WARN = b.WARN | b.INFO | b.DEBUG;
23
+ G.INFO = b.INFO | b.DEBUG;
24
+ G.DEBUG = b.DEBUG;
25
+ const ie = {
26
+ logLevel: b.INFO
27
+ }, ae = /* @__PURE__ */ new Map();
28
+ ae.set(b.ERROR, "error");
29
+ ae.set(b.WARN, "warn");
30
+ ae.set(b.INFO, "info");
31
+ ae.set(b.DEBUG, "log");
32
+ class je {
33
+ /**
34
+ * @param {string=} className
35
+ */
36
+ constructor(o) {
37
+ this.className = o, this.deprecations = /* @__PURE__ */ new Map();
38
+ }
39
+ /**
40
+ * Logs an error message
41
+ * @param {string} msg The message to log.
42
+ * @param {...any} optArgs
43
+ */
44
+ error(o, ...t) {
45
+ ie.logLevel & G.ERROR && this._log(String(o), b.ERROR, t);
46
+ }
47
+ /**
48
+ * Logs a warning message
49
+ * @param {string} msg The message to log.
50
+ * @param {...any} optArgs
51
+ */
52
+ warning(o, ...t) {
53
+ ie.logLevel & G.WARN && this._log(String(o), b.WARN, t);
54
+ }
55
+ /**
56
+ * Deprecate a function. deprecations are stored on the logger
57
+ * @param {string} functionName
58
+ * @param {string=} alternativeFunctionName
59
+ */
60
+ deprecate(o, t) {
61
+ const i = String(o), s = t ? String(t) : null;
62
+ if (!this.deprecations.has(i)) {
63
+ this.deprecations.set(i, s || null);
64
+ let n = `${i} has been deprecated and will be removed`;
65
+ s && (n = `${n}. ${s}`), this.warning(n);
66
+ }
67
+ }
68
+ /**
69
+ * Logs an info message
70
+ * @param {string} msg The message to log.
71
+ * @param {...any} optArgs
72
+ */
73
+ info(o, ...t) {
74
+ ie.logLevel & G.INFO && this._log(String(o), b.INFO, t);
75
+ }
76
+ /**
77
+ * Logs a debug message
78
+ * @param {string} msg The message to log.
79
+ * @param {...any} optArgs
80
+ */
81
+ debug(o, ...t) {
82
+ ie.logLevel & G.DEBUG && this._log(String(o), b.DEBUG, t);
83
+ }
84
+ /**
85
+ * Alias for debug
86
+ * @param {string} msg The message to log.
87
+ * @param {...any} optArgs
88
+ */
89
+ log(o, ...t) {
90
+ ie.logLevel & G.DEBUG && this._log(String(o), b.DEBUG, t);
91
+ }
92
+ /**
93
+ * Logs a message
94
+ * @param {string} msg The message to log.
95
+ * @param {LOG_LEVEL} level
96
+ * @param {Array} optArgs
97
+ * @private
98
+ */
99
+ _log(o, t, i) {
100
+ let s = o;
101
+ this.className && (s = `[${this.className}] ${s}`), console[ae.get(t)](s, ...i), t & b.ERROR && (console.group(), console.trace(), console.groupEnd());
102
+ }
103
+ }
104
+ const ve = /* @__PURE__ */ new Map();
105
+ let ce;
106
+ function Gt() {
107
+ return ce || (ce = new je()), ce;
108
+ }
109
+ function Bt(e) {
110
+ const o = new je(e);
111
+ return ve.set(e, o), o;
112
+ }
113
+ function X(e) {
114
+ return e ? ve.has(e) ? ve.get(e) : Bt(e) : Gt();
115
+ }
116
+ const Ge = Symbol("isMatcher"), Ut = Symbol("Integer"), xt = Symbol("NonEmptyString"), Ee = /* @__PURE__ */ new Map();
11
117
  [
12
118
  [String, "string"],
13
119
  [Number, "number"],
@@ -16,12 +122,12 @@ const Ae = Symbol("isMatcher"), $t = Symbol("Integer"), Dt = Symbol("NonEmptyStr
16
122
  [void 0, "undefined"],
17
123
  [Symbol, "symbol"]
18
124
  ].forEach(([e, o]) => {
19
- ve.set(e, o);
125
+ Ee.set(e, o);
20
126
  });
21
- function kt(e) {
22
- return e == null ? void 0 : e[Ae];
127
+ function zt(e) {
128
+ return e == null ? void 0 : e[Ge];
23
129
  }
24
- function de(e) {
130
+ function we(e) {
25
131
  if (!e || String(e) !== "[object Object]")
26
132
  return !1;
27
133
  const o = Object.getPrototypeOf(e);
@@ -30,7 +136,7 @@ function de(e) {
30
136
  const i = {}.hasOwnProperty.call(o, "constructor") && o.constructor;
31
137
  return typeof i == "function" && String(i) === String(Object);
32
138
  }
33
- function $(e, o) {
139
+ function A(e, o) {
34
140
  if (e === null)
35
141
  return "null";
36
142
  if (typeof e > "u")
@@ -39,7 +145,7 @@ function $(e, o) {
39
145
  return typeof e;
40
146
  let t;
41
147
  if (Array.isArray(e))
42
- t = `[${e.map((s) => $(s, o)).join(",")}]`;
148
+ t = `[${e.map((s) => A(s, o)).join(",")}]`;
43
149
  else
44
150
  try {
45
151
  t = JSON.stringify(e);
@@ -48,46 +154,46 @@ function $(e, o) {
48
154
  }
49
155
  return t = t || typeof e, t.length > 20 ? `${t.substring(0, 20)}...` : t;
50
156
  }
51
- function Lt(e, o) {
52
- return typeof o == "string" || typeof o == "number" || typeof o == "boolean" || typeof o == "symbol" ? e === o ? !1 : `Expected ${$(e)} to equal ${o.toString()}` : null;
157
+ function Ht(e, o) {
158
+ return typeof o == "string" || typeof o == "number" || typeof o == "boolean" || typeof o == "symbol" ? e === o ? !1 : `Expected ${A(e)} to equal ${o.toString()}` : null;
53
159
  }
54
- function Ft(e, o, t) {
160
+ function Kt(e, o, t) {
55
161
  if (Array.isArray(o)) {
56
162
  if (o.length !== 1)
57
163
  throw new Error("Array patterns may only have one type");
58
164
  if (Array.isArray(e)) {
59
165
  let i = !1;
60
- return e.findIndex((n) => (i = t(n, o[0]), i)) > -1 ? `${String(i)} in ${$(e)}` : !1;
166
+ return e.findIndex((n) => (i = t(n, o[0]), i)) > -1 ? `${String(i)} in ${A(e)}` : !1;
61
167
  }
62
- return `Expected ${$(e)} to be an Array`;
168
+ return `Expected ${A(e)} to be an Array`;
63
169
  }
64
170
  return null;
65
171
  }
66
- function ue(e, o, t, i) {
172
+ function ge(e, o, t, i) {
67
173
  const s = i ? `${i}.` : "";
68
- if (!de(e))
69
- return `Expected ${$(e)} to be a plain Object`;
70
- let a = !1;
71
- const l = Object.keys(o).find((u) => {
72
- const d = e[u];
73
- return de(o[u]) ? a = ue(d, o[u], t, s + u) : a = t(d, o[u]), a;
174
+ if (!we(e))
175
+ return `Expected ${A(e)} to be a plain Object`;
176
+ let d = !1;
177
+ const r = Object.keys(o).find((u) => {
178
+ const l = e[u];
179
+ return we(o[u]) ? d = ge(l, o[u], t, s + u) : d = t(l, o[u]), d;
74
180
  });
75
- return l ? `${String(a)} in object.${s}${l}` : !1;
181
+ return r ? `${String(d)} in object.${s}${r}` : !1;
76
182
  }
77
- function Wt(e, o) {
183
+ function Yt(e, o) {
78
184
  if (o === Number)
79
- return Number.isFinite(e) ? !1 : `expected ${$(e)} to be a number, excluding NaN`;
80
- if (o === $t)
81
- return Number.isInteger(e) ? !1 : `expected ${$(e)} to be an integer number`;
82
- if (o === Dt)
83
- return typeof e == "string" && e.length > 0 ? !1 : `expected ${$(e)} to be a non-empty string`;
84
- const t = ve.get(o);
85
- return t ? typeof e === t ? !1 : `expected ${$(e)} to be a ${String(t)}` : null;
185
+ return Number.isFinite(e) ? !1 : `expected ${A(e)} to be a number, excluding NaN`;
186
+ if (o === Ut)
187
+ return Number.isInteger(e) ? !1 : `expected ${A(e)} to be an integer number`;
188
+ if (o === xt)
189
+ return typeof e == "string" && e.length > 0 ? !1 : `expected ${A(e)} to be a non-empty string`;
190
+ const t = Ee.get(o);
191
+ return t ? typeof e === t ? !1 : `expected ${A(e)} to be a ${String(t)}` : null;
86
192
  }
87
- function $e(e) {
193
+ function Be(e) {
88
194
  if (e === null)
89
195
  return "null";
90
- const o = ve.get(e);
196
+ const o = Ee.get(e);
91
197
  if (o)
92
198
  return o;
93
199
  const t = e == null ? void 0 : e.className;
@@ -99,10 +205,10 @@ function $e(e) {
99
205
  const n = e == null ? void 0 : e.name;
100
206
  return n || s[1].substring(0, 20);
101
207
  }
102
- if (de(e)) {
208
+ if (we(e)) {
103
209
  const n = {};
104
- Object.keys(e).forEach((a) => {
105
- n[a] = $e(e[a]);
210
+ Object.keys(e).forEach((d) => {
211
+ n[d] = Be(e[d]);
106
212
  });
107
213
  try {
108
214
  i = `Object of ${JSON.stringify(n)}`;
@@ -112,45 +218,45 @@ function $e(e) {
112
218
  }
113
219
  return i;
114
220
  }
115
- function jt(e, o) {
221
+ function Xt(e, o) {
116
222
  const t = (i, s) => {
117
- if (kt(s))
223
+ if (zt(s))
118
224
  return s(i);
119
225
  if (s == null)
120
- return i === s ? !1 : `Expected ${$(i)} to be ${String(s)}`;
121
- const n = Wt(i, s);
226
+ return i === s ? !1 : `Expected ${A(i)} to be ${String(s)}`;
227
+ const n = Yt(i, s);
122
228
  if (n !== null)
123
229
  return n;
124
- const a = Lt(i, s);
125
- if (a !== null)
126
- return a;
230
+ const d = Ht(i, s);
231
+ if (d !== null)
232
+ return d;
127
233
  if (Array.isArray(s))
128
- return Ft(i, s, t);
234
+ return Kt(i, s, t);
129
235
  if (s === Object)
130
- return ue(i, {}, t);
236
+ return ge(i, {}, t);
131
237
  if (s instanceof Function)
132
- return i instanceof s ? !1 : `Expected ${$(i, !0)} to be of Type ${$e(s)}`;
238
+ return i instanceof s ? !1 : `Expected ${A(i, !0)} to be of Type ${Be(s)}`;
133
239
  if (typeof s == "object") {
134
- const l = ue(i, s, t);
135
- return l || !1;
240
+ const r = ge(i, s, t);
241
+ return r || !1;
136
242
  }
137
243
  throw new Error(`Cannot handle pattern ${String(s)}`);
138
244
  };
139
245
  return t(e, o);
140
246
  }
141
- let Gt = Error;
142
- function me(e, o) {
143
- const t = jt(e, o);
247
+ let Jt = Error;
248
+ function ye(e, o) {
249
+ const t = Xt(e, o);
144
250
  if (t)
145
- throw new Gt(`Match failed: ${t}`);
251
+ throw new Jt(`Match failed: ${t}`);
146
252
  }
147
- function Bt(e, o) {
148
- me(e, Object);
253
+ function Zt(e, o) {
254
+ ye(e, Object);
149
255
  let t = Object.values(e);
150
- const i = (s) => t.includes(s) ? !1 : `expected ${$(s)} to be of enum: ${t.join(", ")}`;
151
- return i[Ae] = !0, i;
256
+ const i = (s) => t.includes(s) ? !1 : `expected ${A(s)} to be of enum: ${t.join(", ")}`;
257
+ return i[Ge] = !0, i;
152
258
  }
153
- function Ut(e, o, t) {
259
+ function Ue(e, o, t) {
154
260
  if (e != null) {
155
261
  const i = Object.values(o).find((s) => s == e);
156
262
  if (i != null)
@@ -158,13 +264,13 @@ function Ut(e, o, t) {
158
264
  }
159
265
  return t;
160
266
  }
161
- const xt = new ie(), re = new Qe();
162
- class Ht extends We {
267
+ const qt = new ne(), de = new pt();
268
+ class Qt extends Ke {
163
269
  constructor(t) {
164
270
  super(t);
165
271
  C(this, "spot");
166
272
  C(this, "_allowPicking");
167
- C(this, "_color", ie.WHITE);
273
+ C(this, "_color", ne.WHITE);
168
274
  C(this, "_camera");
169
275
  C(this, "_planesPrimitives", []);
170
276
  C(this, "_outlinePrimitives", []);
@@ -179,59 +285,59 @@ class Ht extends We {
179
285
  super.update(t);
180
286
  else {
181
287
  const i = this._planesPrimitives, s = this._outlinePrimitives;
182
- i.length === 0 && (et.eastNorthUpToFixedFrame(
288
+ i.length === 0 && (mt.eastNorthUpToFixedFrame(
183
289
  this._camera.positionWC,
184
290
  void 0,
185
- re
186
- ), i[0] = new ge({
291
+ de
292
+ ), i[0] = new Oe({
187
293
  allowPicking: this._allowPicking,
188
- geometryInstances: new _e({
189
- geometry: new tt({
294
+ geometryInstances: new Re({
295
+ geometry: new vt({
190
296
  radius: 2
191
297
  }),
192
298
  attributes: {
193
- color: Ee.fromColor(
194
- ie.fromAlpha(this._color, 0.1, xt)
299
+ color: Me.fromColor(
300
+ ne.fromAlpha(this._color, 0.1, qt)
195
301
  )
196
302
  },
197
- modelMatrix: re
303
+ modelMatrix: de
198
304
  }),
199
- appearance: new Ce({
305
+ appearance: new Te({
200
306
  translucent: !0,
201
307
  flat: !0
202
308
  }),
203
309
  asynchronous: !1
204
- }), s[0] = new ge({
310
+ }), s[0] = new Oe({
205
311
  allowPicking: this._allowPicking,
206
- geometryInstances: new _e({
207
- geometry: new it({
312
+ geometryInstances: new Re({
313
+ geometry: new wt({
208
314
  radius: 2
209
315
  }),
210
316
  attributes: {
211
- color: Ee.fromColor(this._color)
317
+ color: Me.fromColor(this._color)
212
318
  },
213
- modelMatrix: re
319
+ modelMatrix: de
214
320
  }),
215
- appearance: new Ce({
321
+ appearance: new Te({
216
322
  translucent: !1,
217
323
  flat: !0
218
324
  }),
219
325
  asynchronous: !1
220
326
  }));
221
327
  const { length: n } = i;
222
- for (let a = 0; a < n; ++a)
223
- s[a].update(t), i[a].update(t);
328
+ for (let d = 0; d < n; ++d)
329
+ s[d].update(t), i[d].update(t);
224
330
  }
225
331
  }
226
332
  }
227
333
  var _ = /* @__PURE__ */ ((e) => (e.CONE = "cone", e.THREESIXTY = "360", e))(_ || {});
228
- function zt(e, o) {
229
- const t = new st(e), i = t.frustum;
334
+ function ei(e, o) {
335
+ const t = new Ct(e), i = t.frustum;
230
336
  return i.fov = o.fov, i.near = o.near, i.aspectRatio = o.aspectRatio, i.far = o.far, t;
231
337
  }
232
- const P = class P extends je {
338
+ const P = class P extends Ye {
233
339
  constructor(t) {
234
- var i, s, n, a, l, u;
340
+ var i, s, n, d, r, u;
235
341
  super(t);
236
342
  C(this, "_cesiumMap", null);
237
343
  C(this, "_shadowCamera", null);
@@ -248,25 +354,25 @@ const P = class P extends je {
248
354
  C(this, "_shadowMap", null);
249
355
  C(this, "_primitive", null);
250
356
  C(this, "_showPrimitive");
251
- C(this, "_positionChanged", new te());
357
+ C(this, "_positionChanged", new se());
252
358
  C(this, "_active", !1);
253
359
  this._frustumOptions = {
254
360
  fov: ((i = t.frustumOptions) == null ? void 0 : i.fov) || P.getDefaultOptions().frustumOptions.fov,
255
361
  far: ((s = t.frustumOptions) == null ? void 0 : s.far) || P.getDefaultOptions().frustumOptions.far,
256
362
  near: ((n = t.frustumOptions) == null ? void 0 : n.near) || P.getDefaultOptions().frustumOptions.near,
257
- aspectRatio: ((a = t.frustumOptions) == null ? void 0 : a.aspectRatio) || P.getDefaultOptions().frustumOptions.aspectRatio
363
+ aspectRatio: ((d = t.frustumOptions) == null ? void 0 : d.aspectRatio) || P.getDefaultOptions().frustumOptions.aspectRatio
258
364
  }, this._headingPitchRollValues = t.orientation || {
259
365
  ...P.getDefaultOptions().orientation
260
- }, this._position = t.position || P.getDefaultOptions().position, this._viewshedType = Ut(
366
+ }, this._position = t.position || P.getDefaultOptions().position, this._viewshedType = Ue(
261
367
  t.viewshedType,
262
368
  _,
263
369
  "cone"
264
370
  /* CONE */
265
371
  ), this._colors = {
266
- visibleColor: ie.fromCssColorString(
267
- ((l = t.colorOptions) == null ? void 0 : l.visibleColor) || P.getDefaultOptions().colorOptions.visibleColor
372
+ visibleColor: ne.fromCssColorString(
373
+ ((r = t.colorOptions) == null ? void 0 : r.visibleColor) || P.getDefaultOptions().colorOptions.visibleColor
268
374
  ),
269
- shadowColor: ie.fromCssColorString(
375
+ shadowColor: ne.fromCssColorString(
270
376
  ((u = t.colorOptions) == null ? void 0 : u.shadowColor) || P.getDefaultOptions().colorOptions.shadowColor
271
377
  )
272
378
  }, this._heightOffset = t.heightOffset || 0, this._showPrimitive = !!t.showPrimitive;
@@ -292,7 +398,7 @@ const P = class P extends je {
292
398
  * @param coords The new positions coordinates in degrees
293
399
  */
294
400
  set position(t) {
295
- me(t, [Number]), this._position = t, this._shadowCamera && (this._shadowCamera.position = x.fromDegrees(
401
+ ye(t, [Number]), this._position = t, this._shadowCamera && (this._shadowCamera.position = x.fromDegrees(
296
402
  t[0],
297
403
  t[1],
298
404
  t[2] + this._heightOffset
@@ -417,7 +523,7 @@ const P = class P extends je {
417
523
  this._cesiumMap = t;
418
524
  const i = t.getScene();
419
525
  if (i)
420
- this._shadowCamera = zt(i, this._frustumOptions), this._position && (this.position = this._position), this._scene = i;
526
+ this._shadowCamera = ei(i, this._frustumOptions), this._position && (this.position = this._position), this._scene = i;
421
527
  else
422
528
  throw new Error("CesiumMap contains no scene");
423
529
  this._updateShadowMap(), this._updatePrimitive();
@@ -428,7 +534,7 @@ const P = class P extends je {
428
534
  */
429
535
  _updateShadowMap() {
430
536
  var t;
431
- !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((t = this._shadowMap) == null || t.destroy(), this._shadowMap = new ot({
537
+ !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((t = this._shadowMap) == null || t.destroy(), this._shadowMap = new gt({
432
538
  context: this._scene.context,
433
539
  lightCamera: this._shadowCamera,
434
540
  enabled: !0,
@@ -446,7 +552,7 @@ const P = class P extends je {
446
552
  this._primitive && !this._primitive.isDestroyed() && ((t = this._scene) == null || t.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
447
553
  }
448
554
  _updatePrimitive() {
449
- this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new Ht({
555
+ this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new Qt({
450
556
  camera: this._shadowCamera,
451
557
  allowPicking: !1,
452
558
  spot: this._viewshedType === "cone"
@@ -498,115 +604,13 @@ const P = class P extends je {
498
604
  };
499
605
  C(P, "MIN_DISTANCE", 10);
500
606
  let B = P;
501
- const y = {
502
- ERROR: 2,
503
- WARN: 4,
504
- INFO: 8,
505
- DEBUG: 16
506
- }, G = {
507
- ERROR: 0,
508
- WARN: 0,
509
- INFO: 0,
510
- DEBUG: 0
511
- };
512
- G.ERROR = y.ERROR | y.WARN | y.INFO | y.DEBUG;
513
- G.WARN = y.WARN | y.INFO | y.DEBUG;
514
- G.INFO = y.INFO | y.DEBUG;
515
- G.DEBUG = y.DEBUG;
516
- const Q = {
517
- logLevel: y.INFO
518
- }, se = /* @__PURE__ */ new Map();
519
- se.set(y.ERROR, "error");
520
- se.set(y.WARN, "warn");
521
- se.set(y.INFO, "info");
522
- se.set(y.DEBUG, "log");
523
- class Kt {
524
- /**
525
- * @param {string=} className
526
- */
527
- constructor(o) {
528
- this.className = o, this.deprecations = /* @__PURE__ */ new Map();
529
- }
530
- /**
531
- * Logs an error message
532
- * @param {string} msg The message to log.
533
- * @param {...any} optArgs
534
- */
535
- error(o, ...t) {
536
- Q.logLevel & G.ERROR && this._log(String(o), y.ERROR, t);
537
- }
538
- /**
539
- * Logs a warning message
540
- * @param {string} msg The message to log.
541
- * @param {...any} optArgs
542
- */
543
- warning(o, ...t) {
544
- Q.logLevel & G.WARN && this._log(String(o), y.WARN, t);
545
- }
546
- /**
547
- * Deprecate a function. deprecations are stored on the logger
548
- * @param {string} functionName
549
- * @param {string=} alternativeFunctionName
550
- */
551
- deprecate(o, t) {
552
- const i = String(o), s = t ? String(t) : null;
553
- if (!this.deprecations.has(i)) {
554
- this.deprecations.set(i, s || null);
555
- let n = `${i} has been deprecated and will be removed`;
556
- s && (n = `${n}. ${s}`), this.warning(n);
557
- }
558
- }
559
- /**
560
- * Logs an info message
561
- * @param {string} msg The message to log.
562
- * @param {...any} optArgs
563
- */
564
- info(o, ...t) {
565
- Q.logLevel & G.INFO && this._log(String(o), y.INFO, t);
566
- }
567
- /**
568
- * Logs a debug message
569
- * @param {string} msg The message to log.
570
- * @param {...any} optArgs
571
- */
572
- debug(o, ...t) {
573
- Q.logLevel & G.DEBUG && this._log(String(o), y.DEBUG, t);
574
- }
575
- /**
576
- * Alias for debug
577
- * @param {string} msg The message to log.
578
- * @param {...any} optArgs
579
- */
580
- log(o, ...t) {
581
- Q.logLevel & G.DEBUG && this._log(String(o), y.DEBUG, t);
582
- }
583
- /**
584
- * Logs a message
585
- * @param {string} msg The message to log.
586
- * @param {LOG_LEVEL} level
587
- * @param {Array} optArgs
588
- * @private
589
- */
590
- _log(o, t, i) {
591
- let s = o;
592
- this.className && (s = `[${this.className}] ${s}`), console[se.get(t)](s, ...i), t & y.ERROR && (console.group(), console.trace(), console.groupEnd());
593
- }
594
- }
595
- const he = /* @__PURE__ */ new Map();
596
- function Yt(e) {
597
- const o = new Kt(e);
598
- return he.set(e, o), o;
599
- }
600
- function De(e) {
601
- return he.has(e) ? he.get(e) : Yt(e);
602
- }
603
- const A = "@vcmap/viewshed", Xt = "4.0.0", Jt = "^6.3";
604
- class Zt extends Ge {
607
+ const T = "@vcmap/viewshed", ti = "4.1.0", ii = "^6.3";
608
+ class oi extends Xe {
605
609
  constructor(t) {
606
- super(ee.CLICKMOVE);
610
+ super(oe.CLICKMOVE);
607
611
  C(this, "_viewshed");
608
- C(this, "_positioned", new te());
609
- C(this, "_finished", new te());
612
+ C(this, "_positioned", new se());
613
+ C(this, "_finished", new se());
610
614
  C(this, "_position", !1);
611
615
  this._viewshed = t, this.setActive();
612
616
  }
@@ -620,24 +624,24 @@ class Zt extends Ge {
620
624
  return this._positioned;
621
625
  }
622
626
  async pipe(t) {
623
- return t.position && (this._position ? (this._viewshed.lookAt(J.mercatorToWgs84(t.position)), t.type & ee.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = J.mercatorToWgs84(t.position), t.type & ee.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), Promise.resolve(t);
627
+ return t.position && (this._position ? (this._viewshed.lookAt(Z.mercatorToWgs84(t.position)), t.type & oe.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = Z.mercatorToWgs84(t.position), t.type & oe.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), Promise.resolve(t);
624
628
  }
625
629
  destroy() {
626
630
  super.destroy(), this._finished.destroy(), this._positioned.destroy();
627
631
  }
628
632
  }
629
- var X = /* @__PURE__ */ ((e) => (e.ABSOLUTE = "absolute", e.RELATIVE = "relative", e))(X || {}), T = /* @__PURE__ */ ((e) => (e.CREATE = "create", e.VIEW = "view", e.EDIT = "edit", e.MOVE = "move", e.MULTI_SELECT = "multiSelect", e))(T || {});
630
- const Se = 1.8;
631
- function qt(e) {
632
- const o = new He({
633
- projection: Ke.toJSON(),
634
- zIndex: ze - 1
633
+ var J = /* @__PURE__ */ ((e) => (e.ABSOLUTE = "absolute", e.RELATIVE = "relative", e))(J || {}), O = /* @__PURE__ */ ((e) => (e.CREATE = "create", e.VIEW = "view", e.EDIT = "edit", e.MOVE = "move", e.MULTI_SELECT = "multiSelect", e))(O || {});
634
+ const Ie = 1.8;
635
+ function si(e) {
636
+ const o = new Qe({
637
+ projection: tt.toJSON(),
638
+ zIndex: et - 1
635
639
  });
636
- Ye(o), o.activate().catch((i) => {
637
- De(A).error("Failed to activate layer", String(i));
640
+ it(o), o.activate().catch((i) => {
641
+ X(T).error("Failed to activate layer", String(i));
638
642
  });
639
- const t = new vt(new mt(e));
640
- return t.setStyle(new wt({})), o.addFeatures([t]), o.vectorProperties.altitudeMode = nt.NONE, {
643
+ const t = new yt(new bt(e));
644
+ return t.setStyle(new Vt({})), o.addFeatures([t]), o.vectorProperties.altitudeMode = _t.NONE, {
641
645
  layer: o,
642
646
  feature: t,
643
647
  destroy() {
@@ -645,45 +649,45 @@ function qt(e) {
645
649
  }
646
650
  };
647
651
  }
648
- function le(e, o) {
649
- const t = o === "absolute" ? ee.CLICKMOVE : ee.NONE;
652
+ function ue(e, o) {
653
+ const t = o === "absolute" ? oe.CLICKMOVE : oe.NONE;
650
654
  e.setActive(t), e.pickPosition = t, e.pullPickedPosition = 1.8;
651
655
  }
652
- function Qt(e, o, t) {
653
- const i = ae(null), s = K(null), n = K(null), a = K(
656
+ function ni(e, o, t) {
657
+ const i = le(null), s = K(null), n = K(null), d = K(
654
658
  "absolute"
655
659
  /* ABSOLUTE */
656
- ), l = ae(null);
660
+ ), r = le(null);
657
661
  let u = () => {
658
662
  };
659
- const d = ae([]);
663
+ const l = le([]);
660
664
  let c = () => {
661
665
  };
662
666
  function f() {
663
- var r;
664
- s.value && i.value ? (i.value.deactivate(), t.setVisibility(i.value.name, !1)) : (r = i.value) == null || r.destroy();
667
+ var a;
668
+ s.value && i.value ? (i.value.deactivate(), t.setVisibility(i.value.name, !1)) : (a = i.value) == null || a.destroy();
665
669
  }
666
- function h(r = !0) {
667
- c(), u(), f(), i.value = null, r && t.clearSelection(), s.value = null, n.value = null;
670
+ function h(a = !0) {
671
+ c(), u(), f(), i.value = null, a && t.clearSelection(), s.value = null, n.value = null;
668
672
  }
669
- function g(r) {
670
- c(), f(), e.maps.activeMap instanceof z && (i.value = r, r.activate(e.maps.activeMap), c = e.maps.activeMap.shadowMapChanged.addEventListener((p) => {
673
+ function g(a) {
674
+ c(), f(), e.maps.activeMap instanceof H && (i.value = a, a.activate(e.maps.activeMap), c = e.maps.activeMap.shadowMapChanged.addEventListener((p) => {
671
675
  var E;
672
676
  p !== ((E = i.value) == null ? void 0 : E.shadowMap) && h(!1);
673
677
  }));
674
678
  }
675
- async function b(r) {
679
+ async function y(a) {
676
680
  h(), await at();
677
681
  const { eventHandler: p } = e.maps, { featureInteraction: E } = p, S = new B({
678
- viewshedType: r,
682
+ viewshedType: a,
679
683
  colorOptions: {
680
684
  visibleColor: o.visibleColor,
681
685
  shadowColor: o.shadowColor
682
686
  },
683
- heightOffset: a.value === "absolute" ? 0 : Se
687
+ heightOffset: d.value === "absolute" ? 0 : Ie
684
688
  });
685
689
  g(S);
686
- const I = new Zt(i.value);
690
+ const I = new oi(i.value);
687
691
  I.finished.addEventListener(() => {
688
692
  u(), i.value ? (i.value.showPrimitive = !0, n.value = "edit") : h();
689
693
  });
@@ -693,8 +697,8 @@ function Qt(e, o, t) {
693
697
  I.destroy();
694
698
  }
695
699
  );
696
- le(E, a.value), I.positioned.addEventListener(() => {
697
- le(
700
+ ue(E, d.value), I.positioned.addEventListener(() => {
701
+ ue(
698
702
  E,
699
703
  "absolute"
700
704
  /* ABSOLUTE */
@@ -704,68 +708,68 @@ function Qt(e, o, t) {
704
708
  };
705
709
  }, n.value = "create";
706
710
  }
707
- function N(r) {
711
+ function k(a) {
708
712
  var p;
709
- if (i.value && r) {
713
+ if (i.value && a) {
710
714
  u();
711
715
  const {
712
716
  layer: E,
713
717
  feature: S,
714
718
  destroy: I
715
- } = qt(i.value.position);
716
- e.layers.add(E), d.value = [S], a.value === "absolute" ? (l.value = Ue(e, E), l.value.setFeatures([S])) : (l.value = xe(e, E), l.value.setFeature(S)), l.value.stopped.addEventListener(() => {
719
+ } = si(i.value.position);
720
+ e.layers.add(E), l.value = [S], d.value === "absolute" ? (r.value = Ze(e, E), r.value.setFeatures([S])) : (r.value = qe(e, E), r.value.setFeature(S)), r.value.stopped.addEventListener(() => {
717
721
  u();
718
722
  });
719
723
  const w = (p = S.getGeometry()) == null ? void 0 : p.on("change", () => {
720
- i.value ? i.value.position = J.mercatorToWgs84(
724
+ i.value ? i.value.position = Z.mercatorToWgs84(
721
725
  S.getGeometry().getCoordinates()
722
726
  ) : h();
723
727
  });
724
728
  n.value = "move", u = () => {
725
- var M;
729
+ var R;
726
730
  u = () => {
727
- }, w && pt(w), (M = l.value) == null || M.stop(), l.value = null, d.value = [], e.layers.remove(E), I(), n.value = "edit";
731
+ }, w && Et(w), (R = r.value) == null || R.stop(), r.value = null, l.value = [], e.layers.remove(E), I(), n.value = "edit";
728
732
  };
729
733
  } else
730
734
  u();
731
735
  }
732
- function O(r, p) {
733
- u(), i.value !== p && (g(p), a.value = p.heightOffset ? "relative" : "absolute"), s.value = !!p.properties.title, n.value = r, s.value && t.setVisibility(p.name, !0);
736
+ function M(a, p) {
737
+ u(), i.value !== p && (g(p), d.value = p.heightOffset ? "relative" : "absolute"), s.value = !!p.properties.title, n.value = a, s.value && t.setVisibility(p.name, !0);
734
738
  }
735
739
  const U = [
736
740
  t.collectionComponent.collection.removed.addEventListener(
737
- (r) => {
741
+ (a) => {
738
742
  var p;
739
- t.remove(r.name), ((p = i.value) == null ? void 0 : p.name) === r.name && h();
743
+ t.remove(a.name), ((p = i.value) == null ? void 0 : p.name) === a.name && h();
740
744
  }
741
745
  ),
742
- t.renamed.addEventListener(({ item: r, title: p }) => {
746
+ t.renamed.addEventListener(({ item: a, title: p }) => {
743
747
  var S;
744
748
  const E = e.windowManager.get(
745
749
  `${t.collectionComponent.id}-editor`
746
750
  );
747
- E && ((S = i.value) == null ? void 0 : S.name) === r.name && (E.state.headerTitle = p);
751
+ E && ((S = i.value) == null ? void 0 : S.name) === a.name && (E.state.headerTitle = p);
748
752
  }),
749
- t.visibilityChanged.addEventListener(({ item: r }) => {
753
+ t.visibilityChanged.addEventListener(({ item: a }) => {
750
754
  var E;
751
- const p = ((E = i.value) == null ? void 0 : E.name) === r.name;
752
- p ? h() : (O("view", r), t.clearSelection()), t.setVisibility(r.name, !p);
755
+ const p = ((E = i.value) == null ? void 0 : E.name) === a.name;
756
+ p ? h() : (M("view", a), t.clearSelection()), t.setVisibility(a.name, !p);
753
757
  })
754
758
  ];
755
- function k(r) {
756
- if (!(r === a.value || !i.value)) {
757
- if (a.value = r, n.value === "move" && u(), n.value === "create")
758
- le(
759
+ function $(a) {
760
+ if (!(a === d.value || !i.value)) {
761
+ if (d.value = a, n.value === "move" && u(), n.value === "create")
762
+ ue(
759
763
  e.maps.eventHandler.featureInteraction,
760
- r
761
- ), i.value.heightOffset = r === "absolute" ? 0 : Se;
764
+ a
765
+ ), i.value.heightOffset = a === "absolute" ? 0 : Ie;
762
766
  else if (n.value === "edit") {
763
767
  const { position: p, heightOffset: E } = i.value;
764
- r === "relative" ? e.maps.activeMap.getHeightFromTerrain([J.wgs84ToMercator(p)]).then((S) => {
765
- const I = J.mercatorToWgs84(S[0]);
768
+ a === "relative" ? e.maps.activeMap.getHeightFromTerrain([Z.wgs84ToMercator(p)]).then((S) => {
769
+ const I = Z.mercatorToWgs84(S[0]);
766
770
  i.value && (i.value.heightOffset = p[2] - I[2], i.value.position = I);
767
771
  }).catch((S) => {
768
- De(A).error(
772
+ X(T).error(
769
773
  "Failed to get height from terrain",
770
774
  String(S)
771
775
  );
@@ -780,62 +784,62 @@ function Qt(e, o, t) {
780
784
  return {
781
785
  currentViewshed: i,
782
786
  currentIsPersisted: s,
783
- currentEditSession: l,
784
- currentFeatures: d,
785
- createViewshed: b,
786
- viewViewshed(r) {
787
- O("view", r);
787
+ currentEditSession: r,
788
+ currentFeatures: l,
789
+ createViewshed: y,
790
+ viewViewshed(a) {
791
+ M("view", a);
788
792
  },
789
- editViewshed(r) {
790
- O("edit", r), s.value && t.setSelection(r.name);
793
+ editViewshed(a) {
794
+ M("edit", a), s.value && t.setSelection(a.name);
791
795
  },
792
796
  persistCurrent() {
793
797
  i.value && (t.add(i.value), s.value = !0, t.setSelection(i.value.name), t.setVisibility(i.value.name, !0));
794
798
  },
795
- moveCurrentViewshed: N,
799
+ moveCurrentViewshed: k,
796
800
  setupMultiSelect() {
797
801
  u(), n.value = "multiSelect", f(), i.value = null;
798
802
  },
799
803
  mode: n,
800
- heightMode: a,
801
- changeHeightMode: k,
804
+ heightMode: d,
805
+ changeHeightMode: $,
802
806
  async placeCurrentFeaturesOnTerrain() {
803
- var r, p;
804
- if (i.value && ((r = l.value) == null ? void 0 : r.type) === Be.EDIT_FEATURES && e.maps.activeMap instanceof z) {
807
+ var a, p;
808
+ if (i.value && ((a = r.value) == null ? void 0 : a.type) === Je.EDIT_FEATURES && e.maps.activeMap instanceof H) {
805
809
  const S = (await e.maps.activeMap.getHeightFromTerrain([
806
- J.wgs84ToMercator((p = i.value) == null ? void 0 : p.position)
810
+ Z.wgs84ToMercator((p = i.value) == null ? void 0 : p.position)
807
811
  ]))[0][2] - i.value.position[2];
808
- l.value.translate(0, 0, S);
812
+ r.value.translate(0, 0, S);
809
813
  }
810
814
  },
811
815
  stop: h,
812
816
  destroy() {
813
- h(), U.forEach((r) => {
814
- r();
817
+ h(), U.forEach((a) => {
818
+ a();
815
819
  });
816
820
  }
817
821
  };
818
822
  }
819
- const ei = {
823
+ const ai = {
820
824
  distance: [B.MIN_DISTANCE, 2e3],
821
825
  fov: [25, 85],
822
826
  heading: [0, 360],
823
827
  pitch: [-90, 90]
824
- }, ti = Me({
828
+ }, ri = Ae({
825
829
  name: "ViewshedWindow",
826
830
  components: {
827
- VCol: Pe,
828
- VDivider: It,
829
- VRow: Ie,
830
- VcsFormButton: bt,
831
- VcsFeatureTransforms: yt,
832
- VcsFormSection: Ne,
833
- VcsHelp: Et,
834
- VcsLabel: Re,
835
- VcsLabeledSlider: _t,
836
- VcsSelect: Te,
837
- VcsTextField: Ct,
838
- VcsWorkspaceWrapper: gt
831
+ VCol: We,
832
+ VDivider: Ft,
833
+ VRow: Fe,
834
+ VcsFormButton: Nt,
835
+ VcsFeatureTransforms: Mt,
836
+ VcsFormSection: $e,
837
+ VcsHelp: Rt,
838
+ VcsLabel: De,
839
+ VcsLabeledSlider: Tt,
840
+ VcsSelect: ke,
841
+ VcsTextField: Ot,
842
+ VcsWorkspaceWrapper: St
839
843
  },
840
844
  props: {
841
845
  getViewshed: {
@@ -850,89 +854,89 @@ const ei = {
850
854
  }
851
855
  },
852
856
  setup(e) {
853
- var r, p, E, S, I;
854
- const o = ce("manager"), t = ce("vcsApp"), {
857
+ var a, p, E, S, I;
858
+ const o = me("manager"), t = me("vcsApp"), {
855
859
  currentViewshed: i,
856
860
  mode: s,
857
861
  currentIsPersisted: n
858
- } = o, a = K(
859
- ((r = t.maps.activeMap) == null ? void 0 : r.movementApiCallsDisabled) ?? !1
862
+ } = o, d = K(
863
+ ((a = t.maps.activeMap) == null ? void 0 : a.movementApiCallsDisabled) ?? !1
860
864
  );
861
- let l, u = () => {
865
+ let r, u = () => {
862
866
  };
863
- const d = oe({
867
+ const l = Q({
864
868
  X: void 0,
865
869
  Y: void 0,
866
870
  Z: void 0
867
- }), c = ae();
871
+ }), c = le();
868
872
  let f = () => {
869
873
  };
870
- const h = oe({
874
+ const h = Q({
871
875
  showPrimitive: !1,
872
876
  distance: ((p = i.value) == null ? void 0 : p.distance) || 0,
873
877
  fov: ((E = i.value) == null ? void 0 : E.fov) || 0,
874
878
  heading: ((S = i.value) == null ? void 0 : S.heading) || 0,
875
879
  pitch: ((I = i.value) == null ? void 0 : I.pitch) || 0
876
880
  }), g = K();
877
- function b() {
878
- i.value && (d.X = i.value.position[0], d.Y = i.value.position[1], d.Z = o.heightMode.value === X.ABSOLUTE ? i.value.position[2] : i.value.heightOffset);
881
+ function y() {
882
+ i.value && (l.X = i.value.position[0], l.Y = i.value.position[1], l.Z = o.heightMode.value === J.ABSOLUTE ? i.value.position[2] : i.value.heightOffset);
879
883
  }
880
- function N() {
881
- b(), i.value && (h.distance = i.value.distance, h.fov = i.value.fov, h.heading = i.value.heading, h.pitch = i.value.pitch, h.showPrimitive = i.value.showPrimitive, g.value = i.value.type);
884
+ function k() {
885
+ y(), i.value && (h.distance = i.value.distance, h.fov = i.value.fov, h.heading = i.value.heading, h.pitch = i.value.pitch, h.showPrimitive = i.value.showPrimitive, g.value = i.value.type);
882
886
  }
883
887
  rt(() => {
884
- i.value && s.value !== T.CREATE && N();
885
- }), Z(
888
+ i.value && s.value !== O.CREATE && k();
889
+ }), q(
886
890
  i,
887
891
  () => {
888
892
  i.value && (u(), u = i.value.positionChanged.addEventListener(() => {
889
- b(), f();
893
+ y(), f();
890
894
  }));
891
895
  },
892
896
  { immediate: !0 }
893
897
  );
894
- function O() {
898
+ function M() {
895
899
  var D, L;
896
900
  (D = i.value) == null || D.deactivate();
897
- const w = (L = t.maps.activeMap.getScene()) == null ? void 0 : L.camera, M = w == null ? void 0 : w.changed.addEventListener(
901
+ const w = (L = t.maps.activeMap.getScene()) == null ? void 0 : L.camera, R = w == null ? void 0 : w.changed.addEventListener(
898
902
  f
899
903
  );
900
904
  f = () => {
901
- var we;
902
- M == null || M(), c.value = null, (we = i.value) == null || we.activate(t.maps.activeMap), f = () => {
905
+ var be;
906
+ R == null || R(), c.value = null, (be = i.value) == null || be.activate(t.maps.activeMap), f = () => {
903
907
  };
904
908
  };
905
909
  }
906
910
  lt(() => {
907
- var M, D;
908
- const w = (M = e.getViewshed) == null ? void 0 : M.call(e);
909
- w && o.editViewshed(w), l = (D = t.maps.activeMap) == null ? void 0 : D.movementDisabledChanged.addEventListener(
911
+ var R, D;
912
+ const w = (R = e.getViewshed) == null ? void 0 : R.call(e);
913
+ w && o.editViewshed(w), r = (D = t.maps.activeMap) == null ? void 0 : D.movementDisabledChanged.addEventListener(
910
914
  (L) => {
911
- a.value = L.apiCalls;
915
+ d.value = L.apiCalls;
912
916
  }
913
917
  );
914
918
  }), ct(() => {
915
919
  var w;
916
- u(), f(), l == null || l(), n.value || ((s.value === T.EDIT || s.value === T.MOVE) && i.value ? o.viewViewshed(i.value) : s.value === T.CREATE && o.stop()), (w = e.selection) != null && w.value && (e.selection.value.length > 1 ? o.setupMultiSelect() : e.selection.value.length === 1 && i.value ? o.viewViewshed(i.value) : (
920
+ u(), f(), r == null || r(), n.value || ((s.value === O.EDIT || s.value === O.MOVE) && i.value ? o.viewViewshed(i.value) : s.value === O.CREATE && o.stop()), (w = e.selection) != null && w.value && (e.selection.value.length > 1 ? o.setupMultiSelect() : e.selection.value.length === 1 && i.value ? o.viewViewshed(i.value) : (
917
921
  // when a persited viewshed is deselected, stops plugin
918
- !e.selection.value.length && s.value === T.EDIT && o.stop(!1)
922
+ !e.selection.value.length && s.value === O.EDIT && o.stop(!1)
919
923
  ));
920
- }), N();
921
- function U(w, M) {
922
- f(), i.value && (h[w] = M, i.value[w] = M);
924
+ }), k();
925
+ function U(w, R) {
926
+ f(), i.value && (h[w] = R, i.value[w] = R);
923
927
  }
924
- const k = dt(() => {
928
+ const $ = dt(() => {
925
929
  const w = [];
926
930
  return g.value === _.CONE && w.push({
927
931
  name: "jumpToViewpoint",
928
932
  title: c.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
929
933
  icon: "mdi-human-male",
930
934
  active: !!c.value,
931
- disabled: a.value,
935
+ disabled: d.value,
932
936
  async callback() {
933
- var M, D, L;
934
- o.moveCurrentViewshed(!1), i.value && !c.value ? (c.value = await ((M = t.maps.activeMap) == null ? void 0 : M.getViewpoint()), await ((D = t.maps.activeMap) == null ? void 0 : D.gotoViewpoint(
935
- new Xe({
937
+ var R, D, L;
938
+ o.moveCurrentViewshed(!1), i.value && !c.value ? (c.value = await ((R = t.maps.activeMap) == null ? void 0 : R.getViewpoint()), await ((D = t.maps.activeMap) == null ? void 0 : D.gotoViewpoint(
939
+ new ot({
936
940
  groundPosition: [
937
941
  i.value.position[0],
938
942
  i.value.position[1],
@@ -944,16 +948,16 @@ const ei = {
944
948
  animate: !0
945
949
  // if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
946
950
  })
947
- )), O()) : c.value && (await ((L = t.maps.activeMap) == null ? void 0 : L.gotoViewpoint(c.value)), f());
951
+ )), M()) : c.value && (await ((L = t.maps.activeMap) == null ? void 0 : L.gotoViewpoint(c.value)), f());
948
952
  }
949
953
  }), w.push({
950
954
  name: "moveViewshed",
951
955
  title: "viewshed.move",
952
- icon: o.heightMode.value === X.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
953
- active: s.value === T.MOVE,
956
+ icon: o.heightMode.value === J.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
957
+ active: s.value === O.MOVE,
954
958
  callback() {
955
959
  o.moveCurrentViewshed(
956
- s.value !== T.MOVE
960
+ s.value !== O.MOVE
957
961
  );
958
962
  }
959
963
  }), w.unshift({
@@ -967,33 +971,33 @@ const ei = {
967
971
  }), w;
968
972
  });
969
973
  return {
970
- position: d,
971
- setPosition(w, M, D) {
974
+ position: l,
975
+ setPosition(w, R, D) {
972
976
  if (f(), !!i.value) {
973
- if (D === 2 && o.heightMode.value === X.RELATIVE)
977
+ if (D === 2 && o.heightMode.value === J.RELATIVE)
974
978
  i.value.heightOffset = Number(w);
975
979
  else {
976
980
  const L = [...i.value.position];
977
981
  L[D] = Number(w), i.value.position = L;
978
982
  }
979
- d[M] = Number(w);
983
+ l[R] = Number(w);
980
984
  }
981
985
  },
982
986
  parameters: h,
983
987
  setParameter: U,
984
- parameterRanges: ei,
985
- ViewshedPluginModes: T,
988
+ parameterRanges: ai,
989
+ ViewshedPluginModes: O,
986
990
  viewshedMode: s,
987
991
  currentIsPersisted: n,
988
992
  viewshedType: g,
989
993
  ViewshedTypes: _,
990
- HeightModes: X,
994
+ HeightModes: J,
991
995
  heightMode: o.heightMode,
992
- heightModes: Object.values(X).map((w) => ({
996
+ heightModes: Object.values(J).map((w) => ({
993
997
  value: w,
994
998
  title: `viewshed.${w}`
995
999
  })),
996
- TransformationMode: Je,
1000
+ TransformationMode: st,
997
1001
  changeHeightMode: (w) => {
998
1002
  o.changeHeightMode(w);
999
1003
  },
@@ -1006,23 +1010,23 @@ const ei = {
1006
1010
  cancel: () => {
1007
1011
  o.stop();
1008
1012
  },
1009
- headerActions: k
1013
+ headerActions: $
1010
1014
  };
1011
1015
  }
1012
- }), ke = (e, o) => {
1016
+ }), xe = (e, o) => {
1013
1017
  const t = e.__vccOpts || e;
1014
1018
  for (const [i, s] of o)
1015
1019
  t[i] = s;
1016
1020
  return t;
1017
- }, ii = { key: 0 }, oi = { class: "px-1" };
1018
- function si(e, o, t, i, s, n) {
1019
- const a = V("VcsHelp"), l = V("VcsLabel"), u = V("v-col"), d = V("VcsSelect"), c = V("v-row"), f = V("v-divider"), h = V("VcsFormButton"), g = V("VcsFeatureTransforms"), b = V("VcsTextField"), N = V("VcsFormSection"), O = V("VcsLabeledSlider"), U = V("VcsWorkspaceWrapper");
1020
- return R(), q("div", null, [
1021
+ }, li = { key: 0 }, ci = { class: "px-1" };
1022
+ function di(e, o, t, i, s, n) {
1023
+ const d = V("VcsHelp"), r = V("VcsLabel"), u = V("v-col"), l = V("VcsSelect"), c = V("v-row"), f = V("v-divider"), h = V("VcsFormButton"), g = V("VcsFeatureTransforms"), y = V("VcsTextField"), k = V("VcsFormSection"), M = V("VcsLabeledSlider"), U = V("VcsWorkspaceWrapper");
1024
+ return N(), te("div", null, [
1021
1025
  Y(" CREATE "),
1022
- e.viewshedMode === e.ViewshedPluginModes.CREATE ? (R(), q("div", ii, [
1023
- e.viewshedType === e.ViewshedTypes.CONE ? (R(), W(a, { key: 0 }, {
1024
- default: m(() => [
1025
- H(
1026
+ e.viewshedMode === e.ViewshedPluginModes.CREATE ? (N(), te("div", li, [
1027
+ e.viewshedType === e.ViewshedTypes.CONE ? (N(), W(d, { key: 0 }, {
1028
+ default: v(() => [
1029
+ z(
1026
1030
  j(e.$t("viewshed.createDescription")),
1027
1031
  1
1028
1032
  /* TEXT */
@@ -1030,9 +1034,9 @@ function si(e, o, t, i, s, n) {
1030
1034
  ]),
1031
1035
  _: 1
1032
1036
  /* STABLE */
1033
- })) : e.viewshedType === e.ViewshedTypes.THREESIXTY ? (R(), W(a, { key: 1 }, {
1034
- default: m(() => [
1035
- H(
1037
+ })) : e.viewshedType === e.ViewshedTypes.THREESIXTY ? (N(), W(d, { key: 1 }, {
1038
+ default: v(() => [
1039
+ z(
1036
1040
  j(e.$t("viewshed.createThreeSixtyDescription")),
1037
1041
  1
1038
1042
  /* TEXT */
@@ -1041,16 +1045,16 @@ function si(e, o, t, i, s, n) {
1041
1045
  _: 1
1042
1046
  /* STABLE */
1043
1047
  })) : Y("v-if", !0),
1044
- v(c, {
1048
+ m(c, {
1045
1049
  "no-gutters": "",
1046
1050
  class: "px-1"
1047
1051
  }, {
1048
- default: m(() => [
1049
- v(u, null, {
1050
- default: m(() => [
1051
- v(l, { "html-for": "heightMode" }, {
1052
- default: m(() => [
1053
- H(
1052
+ default: v(() => [
1053
+ m(u, null, {
1054
+ default: v(() => [
1055
+ m(r, { "html-for": "heightMode" }, {
1056
+ default: v(() => [
1057
+ z(
1054
1058
  j(e.$t("viewshed.heightMode")),
1055
1059
  1
1056
1060
  /* TEXT */
@@ -1063,9 +1067,9 @@ function si(e, o, t, i, s, n) {
1063
1067
  _: 1
1064
1068
  /* STABLE */
1065
1069
  }),
1066
- v(u, null, {
1067
- default: m(() => [
1068
- v(d, {
1070
+ m(u, null, {
1071
+ default: v(() => [
1072
+ m(l, {
1069
1073
  id: "heightMode",
1070
1074
  items: e.heightModes,
1071
1075
  "model-value": e.heightMode,
@@ -1079,17 +1083,17 @@ function si(e, o, t, i, s, n) {
1079
1083
  _: 1
1080
1084
  /* STABLE */
1081
1085
  }),
1082
- v(f),
1083
- v(c, {
1086
+ m(f),
1087
+ m(c, {
1084
1088
  "no-gutters": "",
1085
1089
  class: "px-2 pt-2 pb-1 d-flex justify-end"
1086
1090
  }, {
1087
- default: m(() => [
1088
- v(h, {
1089
- onClick: o[0] || (o[0] = (k) => e.cancel())
1091
+ default: v(() => [
1092
+ m(h, {
1093
+ onClick: o[0] || (o[0] = ($) => e.cancel())
1090
1094
  }, {
1091
- default: m(() => [
1092
- H(
1095
+ default: v(() => [
1096
+ z(
1093
1097
  j(e.$t("viewshed.cancel")),
1094
1098
  1
1095
1099
  /* TEXT */
@@ -1104,28 +1108,28 @@ function si(e, o, t, i, s, n) {
1104
1108
  })
1105
1109
  ])) : Y("v-if", !0),
1106
1110
  Y(" EDIT AND MOVE "),
1107
- e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (R(), W(U, {
1111
+ e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (N(), W(U, {
1108
1112
  key: 1,
1109
1113
  "disable-add": e.currentIsPersisted,
1110
1114
  class: "wrapper",
1111
1115
  onAddClicked: e.addToMyWorkspace,
1112
1116
  onNewClicked: e.createNewViewshed
1113
1117
  }, {
1114
- default: m(() => [
1115
- v(N, {
1118
+ default: v(() => [
1119
+ m(k, {
1116
1120
  "header-actions": e.headerActions,
1117
1121
  heading: "viewshed.viewpoint",
1118
1122
  "action-button-list-overflow-count": 3
1119
1123
  }, {
1120
- default: m(() => [
1121
- v(c, {
1124
+ default: v(() => [
1125
+ m(c, {
1122
1126
  "no-gutters": "",
1123
1127
  class: "px-1"
1124
1128
  }, {
1125
- default: m(() => [
1129
+ default: v(() => [
1126
1130
  ut(
1127
1131
  "span",
1128
- oi,
1132
+ ci,
1129
1133
  j(e.$t("viewshed.position")),
1130
1134
  1
1131
1135
  /* TEXT */
@@ -1134,13 +1138,13 @@ function si(e, o, t, i, s, n) {
1134
1138
  _: 1
1135
1139
  /* STABLE */
1136
1140
  }),
1137
- e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? (R(), W(c, {
1141
+ e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? (N(), W(c, {
1138
1142
  key: 0,
1139
1143
  "no-gutters": "",
1140
1144
  class: "px-1"
1141
1145
  }, {
1142
- default: m(() => [
1143
- v(g, {
1146
+ default: v(() => [
1147
+ m(g, {
1144
1148
  "transformation-mode": e.TransformationMode.TRANSLATE,
1145
1149
  "feature-properties": { altitudeMode: "absolute" },
1146
1150
  "allow-z-input": !0,
@@ -1149,33 +1153,33 @@ function si(e, o, t, i, s, n) {
1149
1153
  ]),
1150
1154
  _: 1
1151
1155
  /* STABLE */
1152
- })) : (R(), W(c, {
1156
+ })) : (N(), W(c, {
1153
1157
  key: 1,
1154
1158
  "no-gutters": "",
1155
1159
  class: "px-1"
1156
1160
  }, {
1157
- default: m(() => [
1158
- (R(!0), q(
1159
- ye,
1161
+ default: v(() => [
1162
+ (N(!0), te(
1163
+ Ve,
1160
1164
  null,
1161
- be(e.position, (k, r, p) => (R(), W(
1165
+ Se(e.position, ($, a, p) => (N(), W(
1162
1166
  u,
1163
1167
  {
1164
1168
  key: p,
1165
1169
  class: "pb-1"
1166
1170
  },
1167
1171
  {
1168
- default: m(() => [
1169
- v(b, {
1170
- "model-value": k,
1172
+ default: v(() => [
1173
+ m(y, {
1174
+ "model-value": $,
1171
1175
  type: "number",
1172
- prefix: r,
1173
- step: r === "Z" ? 1 : 1e-4,
1174
- unit: r === "Z" ? "m" : "°",
1175
- decimals: r === "Z" ? 2 : 8,
1176
- disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(r === "Z" && e.heightMode === e.HeightModes.RELATIVE),
1176
+ prefix: a,
1177
+ step: a === "Z" ? 1 : 1e-4,
1178
+ unit: a === "Z" ? "m" : "°",
1179
+ decimals: a === "Z" ? 2 : 8,
1180
+ disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(a === "Z" && e.heightMode === e.HeightModes.RELATIVE),
1177
1181
  "hide-spin-buttons": !0,
1178
- "onUpdate:modelValue": (E) => e.setPosition(E, r, p)
1182
+ "onUpdate:modelValue": (E) => e.setPosition(E, a, p)
1179
1183
  }, null, 8, ["model-value", "prefix", "step", "unit", "decimals", "disabled", "onUpdate:modelValue"])
1180
1184
  ]),
1181
1185
  _: 2
@@ -1195,17 +1199,17 @@ function si(e, o, t, i, s, n) {
1195
1199
  _: 1
1196
1200
  /* STABLE */
1197
1201
  }, 8, ["header-actions"]),
1198
- v(f),
1199
- v(c, {
1202
+ m(f),
1203
+ m(c, {
1200
1204
  "no-gutters": "",
1201
1205
  class: "px-1"
1202
1206
  }, {
1203
- default: m(() => [
1204
- v(u, null, {
1205
- default: m(() => [
1206
- v(l, { "html-for": "heightMode" }, {
1207
- default: m(() => [
1208
- H(
1207
+ default: v(() => [
1208
+ m(u, null, {
1209
+ default: v(() => [
1210
+ m(r, { "html-for": "heightMode" }, {
1211
+ default: v(() => [
1212
+ z(
1209
1213
  j(e.$t("viewshed.heightMode")),
1210
1214
  1
1211
1215
  /* TEXT */
@@ -1218,9 +1222,9 @@ function si(e, o, t, i, s, n) {
1218
1222
  _: 1
1219
1223
  /* STABLE */
1220
1224
  }),
1221
- v(u, null, {
1222
- default: m(() => [
1223
- v(d, {
1225
+ m(u, null, {
1226
+ default: v(() => [
1227
+ m(l, {
1224
1228
  id: "heightMode",
1225
1229
  items: e.heightModes,
1226
1230
  "model-value": e.heightMode,
@@ -1234,26 +1238,26 @@ function si(e, o, t, i, s, n) {
1234
1238
  _: 1
1235
1239
  /* STABLE */
1236
1240
  }),
1237
- (R(!0), q(
1238
- ye,
1241
+ (N(!0), te(
1242
+ Ve,
1239
1243
  null,
1240
- be(e.parameters, (k, r) => (R(), q("div", {
1241
- key: r,
1244
+ Se(e.parameters, ($, a) => (N(), te("div", {
1245
+ key: a,
1242
1246
  class: "px-1"
1243
1247
  }, [
1244
- r === "distance" || e.viewshedType === e.ViewshedTypes.CONE && r !== "showPrimitive" ? (R(), W(O, {
1248
+ a === "distance" || e.viewshedType === e.ViewshedTypes.CONE && a !== "showPrimitive" ? (N(), W(M, {
1245
1249
  key: 0,
1246
1250
  class: "pa-0",
1247
- label: `viewshed.${r}`,
1248
- unit: r === "distance" ? "m" : "°",
1249
- min: e.parameterRanges[r][0],
1250
- max: e.parameterRanges[r][1],
1251
+ label: `viewshed.${a}`,
1252
+ unit: a === "distance" ? "m" : "°",
1253
+ min: e.parameterRanges[a][0],
1254
+ max: e.parameterRanges[a][1],
1251
1255
  step: 1,
1252
1256
  "text-input-cols": 3,
1253
1257
  "allow-text-input": "",
1254
1258
  "hide-spin-buttons": "",
1255
- "model-value": Math.round(Number(k)),
1256
- "onUpdate:modelValue": (p) => e.setParameter(r, p)
1259
+ "model-value": Math.round(Number($)),
1260
+ "onUpdate:modelValue": (p) => e.setParameter(a, p)
1257
1261
  }, null, 8, ["label", "unit", "min", "max", "model-value", "onUpdate:modelValue"])) : Y("v-if", !0)
1258
1262
  ]))),
1259
1263
  128
@@ -1265,13 +1269,13 @@ function si(e, o, t, i, s, n) {
1265
1269
  }, 8, ["disable-add", "onAddClicked", "onNewClicked"])) : Y("v-if", !0)
1266
1270
  ]);
1267
1271
  }
1268
- const ni = /* @__PURE__ */ ke(ti, [["render", si]]), fe = {
1272
+ const ui = /* @__PURE__ */ xe(ri, [["render", di]]), Ce = {
1269
1273
  [_.CONE]: "$vcsViewshed",
1270
1274
  [_.THREESIXTY]: "$vcsViewshedCone"
1271
1275
  };
1272
- function ai(e, o, t) {
1273
- const i = K(""), s = K(), n = `${t.id}-editor`, a = {
1274
- component: ni,
1276
+ function hi(e, o, t) {
1277
+ const i = K(""), s = K(), n = `${t.id}-editor`, d = {
1278
+ component: ui,
1275
1279
  provides: { manager: e },
1276
1280
  state: {
1277
1281
  headerTitle: i,
@@ -1280,135 +1284,135 @@ function ai(e, o, t) {
1280
1284
  infoUrlCallback: o.getHelpUrlCallback("tools/viewshed.html")
1281
1285
  }
1282
1286
  };
1283
- Vt(o, t, {
1287
+ It(o, t, {
1284
1288
  editor: (h) => ({
1285
- ...a,
1289
+ ...d,
1286
1290
  props: {
1287
1291
  selection: t.selection,
1288
1292
  getViewshed: () => t.collection.getByKey(h.name)
1289
1293
  }
1290
1294
  })
1291
1295
  });
1292
- function l() {
1293
- e.currentViewshed.value && (s.value = fe[e.currentViewshed.value.type], e.currentIsPersisted.value ? i.value = e.currentViewshed.value.properties.title : e.mode.value === T.CREATE ? i.value = `viewshed.create.${e.currentViewshed.value.type}` : i.value = [
1296
+ function r() {
1297
+ e.currentViewshed.value && (s.value = Ce[e.currentViewshed.value.type], e.currentIsPersisted.value ? i.value = e.currentViewshed.value.properties.title : e.mode.value === O.CREATE ? i.value = `viewshed.create.${e.currentViewshed.value.type}` : i.value = [
1294
1298
  "viewshed.temporary",
1295
1299
  `viewshed.${e.currentViewshed.value.type}`
1296
1300
  ]);
1297
1301
  }
1298
1302
  function u() {
1299
- l(), e.currentViewshed.value && !e.currentIsPersisted.value && (e.mode.value === T.EDIT || e.mode.value === T.MOVE || e.mode.value === T.CREATE) && (o.windowManager.has(n) || o.windowManager.add(
1303
+ r(), e.currentViewshed.value && !e.currentIsPersisted.value && (e.mode.value === O.EDIT || e.mode.value === O.MOVE || e.mode.value === O.CREATE) && (o.windowManager.has(n) || o.windowManager.add(
1300
1304
  {
1301
- ...a,
1305
+ ...d,
1302
1306
  id: n,
1303
1307
  parentId: "category-manager",
1304
- slot: St.DYNAMIC_CHILD
1308
+ slot: Pt.DYNAMIC_CHILD
1305
1309
  },
1306
- A
1310
+ T
1307
1311
  ));
1308
1312
  }
1309
- const d = Z(e.currentViewshed, (h) => {
1313
+ const l = q(e.currentViewshed, (h) => {
1310
1314
  h && u();
1311
- }), c = Z(e.currentIsPersisted, (h) => {
1312
- h && l();
1313
- }), f = Z(e.mode, () => {
1315
+ }), c = q(e.currentIsPersisted, (h) => {
1316
+ h && r();
1317
+ }), f = q(e.mode, () => {
1314
1318
  e.mode.value ? u() : o.windowManager.remove(n);
1315
1319
  });
1316
1320
  return {
1317
1321
  destroy() {
1318
- o.windowManager.remove(n), d(), f(), c();
1322
+ o.windowManager.remove(n), l(), f(), c();
1319
1323
  }
1320
1324
  };
1321
1325
  }
1322
- function ri(e, o, t, i) {
1323
- function s(d) {
1324
- return d === _.CONE ? {
1326
+ function fi(e, o, t, i) {
1327
+ function s(l) {
1328
+ return l === _.CONE ? {
1325
1329
  name: _.CONE,
1326
- icon: fe[_.CONE],
1330
+ icon: Ce[_.CONE],
1327
1331
  title: `viewshed.create.${_.CONE}`
1328
- } : d === _.THREESIXTY ? {
1332
+ } : l === _.THREESIXTY ? {
1329
1333
  name: _.THREESIXTY,
1330
- icon: fe[_.THREESIXTY],
1334
+ icon: Ce[_.THREESIXTY],
1331
1335
  title: `viewshed.create.${_.THREESIXTY}`
1332
1336
  } : void 0;
1333
1337
  }
1334
- let n, a;
1338
+ let n, d;
1335
1339
  if (i.length === 1) {
1336
- const d = s(i[0]);
1340
+ const l = s(i[0]);
1337
1341
  n = {
1338
- type: Ve.SINGLE,
1339
- action: oe({
1340
- ...d,
1342
+ type: Ne.SINGLE,
1343
+ action: Q({
1344
+ ...l,
1341
1345
  active: !1,
1342
1346
  background: !1,
1343
- disabled: !(e.maps.activeMap instanceof z),
1347
+ disabled: !(e.maps.activeMap instanceof H),
1344
1348
  async callback() {
1345
- this.active ? this.background && o.currentViewshed.value ? o.editViewshed(o.currentViewshed.value) : o.stop() : d && await o.createViewshed(d.name);
1349
+ this.active ? this.background && o.currentViewshed.value ? o.editViewshed(o.currentViewshed.value) : o.stop() : l && await o.createViewshed(l.name);
1346
1350
  }
1347
1351
  })
1348
1352
  };
1349
1353
  } else
1350
1354
  n = {
1351
- type: Ve.SELECT,
1352
- action: oe({
1355
+ type: Ne.SELECT,
1356
+ action: Q({
1353
1357
  name: t,
1354
1358
  currentIndex: 0,
1355
1359
  active: !1,
1356
1360
  background: !1,
1357
- disabled: !(e.maps.activeMap instanceof z),
1361
+ disabled: !(e.maps.activeMap instanceof H),
1358
1362
  async callback() {
1359
1363
  if (this.active)
1360
1364
  this.background && o.currentViewshed.value ? o.editViewshed(o.currentViewshed.value) : o.stop();
1361
1365
  else {
1362
- const d = this.tools[this.currentIndex].name;
1363
- await o.createViewshed(d);
1366
+ const l = this.tools[this.currentIndex].name;
1367
+ await o.createViewshed(l);
1364
1368
  }
1365
1369
  },
1366
- async selected(d) {
1367
- d !== this.currentIndex && (this.currentIndex = d);
1370
+ async selected(l) {
1371
+ l !== this.currentIndex && (this.currentIndex = l);
1368
1372
  const c = this.tools[this.currentIndex].name;
1369
1373
  await o.createViewshed(c);
1370
1374
  },
1371
- tools: i.flatMap((d) => s(d))
1375
+ tools: i.flatMap((l) => s(l))
1372
1376
  })
1373
- }, a = Z(
1377
+ }, d = q(
1374
1378
  o.currentViewshed,
1375
- (d) => {
1376
- d && (n.action.currentIndex = n.action.tools.findIndex(
1377
- (c) => c.name === d.type
1379
+ (l) => {
1380
+ l && (n.action.currentIndex = n.action.tools.findIndex(
1381
+ (c) => c.name === l.type
1378
1382
  ));
1379
1383
  }
1380
1384
  );
1381
- const l = Z(o.mode, (d) => {
1382
- d === T.VIEW ? (n.action.background = !0, n.action.active = !0) : d ? (n.action.background = !1, n.action.active = !0) : (n.action.background = !1, n.action.active = !1);
1383
- }), u = e.maps.mapActivated.addEventListener((d) => {
1384
- d instanceof z ? n.action.disabled = !1 : n.action.disabled = !0;
1385
+ const r = q(o.mode, (l) => {
1386
+ l === O.VIEW ? (n.action.background = !0, n.action.active = !0) : l ? (n.action.background = !1, n.action.active = !0) : (n.action.background = !1, n.action.active = !1);
1387
+ }), u = e.maps.mapActivated.addEventListener((l) => {
1388
+ l instanceof H ? n.action.disabled = !1 : n.action.disabled = !0;
1385
1389
  });
1386
1390
  return {
1387
1391
  toolbox: n,
1388
1392
  destroy() {
1389
- l(), a == null || a(), u();
1393
+ r(), d == null || d(), u();
1390
1394
  }
1391
1395
  };
1392
1396
  }
1393
- function li(e, o, t, i) {
1394
- me(i, [Bt(_)]);
1395
- const { toolbox: s, destroy: n } = ri(e, o, t, i), a = e.toolboxManager.add(s, t).id;
1397
+ function pi(e, o, t, i) {
1398
+ ye(i, [Zt(_)]);
1399
+ const { toolbox: s, destroy: n } = fi(e, o, t, i), d = e.toolboxManager.add(s, t).id;
1396
1400
  return () => {
1397
- e.toolboxManager.remove(a), n();
1401
+ e.toolboxManager.remove(d), n();
1398
1402
  };
1399
1403
  }
1400
- class pe extends Ze {
1404
+ class _e extends nt {
1401
1405
  static get className() {
1402
1406
  return "ViewshedCategory";
1403
1407
  }
1404
1408
  async _deserializeItem(o) {
1405
1409
  var i;
1406
- if ((i = this._app) == null ? void 0 : i.maps.getByType(z.className)[0])
1410
+ if ((i = this._app) == null ? void 0 : i.maps.getByType(H.className)[0])
1407
1411
  return Promise.resolve(new B(o));
1408
1412
  throw new Error("No CesiumMap available");
1409
1413
  }
1410
1414
  }
1411
- function ci(e, o) {
1415
+ function mi(e, o) {
1412
1416
  let t, i = 0;
1413
1417
  const s = new Set(
1414
1418
  o.filter((n) => n.type === e).map((n) => n.properties.title)
@@ -1418,28 +1422,28 @@ function ci(e, o) {
1418
1422
  while (!t);
1419
1423
  return t;
1420
1424
  }
1421
- async function di(e) {
1422
- const o = new te(), t = new te(), { collectionComponent: i, category: s } = await e.categoryManager.requestCategory(
1425
+ async function vi(e) {
1426
+ const o = new se(), t = new se(), { collectionComponent: i, category: s } = await e.categoryManager.requestCategory(
1423
1427
  {
1424
- type: pe.className,
1428
+ type: _e.className,
1425
1429
  name: "Viewsheds",
1426
1430
  title: "viewshed.viewshedCategory"
1427
1431
  },
1428
- A,
1432
+ T,
1429
1433
  { selectable: !0, renamable: !0, removable: !0 }
1430
1434
  );
1431
1435
  i.addItemMapping({
1432
- mappingFunction: Ot(
1433
- [z.className],
1436
+ mappingFunction: At(
1437
+ [H.className],
1434
1438
  e.maps
1435
1439
  ),
1436
- owner: A
1440
+ owner: T
1437
1441
  });
1438
1442
  const n = (c, f, h) => {
1439
1443
  h.title = c.properties.title, h.titleChanged = (g) => {
1440
1444
  c.properties.title = g, h.title = g, o.raiseEvent({ item: c, title: g });
1441
1445
  }, h.actions.push(
1442
- oe({
1446
+ Q({
1443
1447
  name: "visibilityAction",
1444
1448
  icon: "$vcsCheckbox",
1445
1449
  callback() {
@@ -1451,60 +1455,60 @@ async function di(e) {
1451
1455
  e.categoryManager.addMappingFunction(
1452
1456
  () => !0,
1453
1457
  n,
1454
- A,
1458
+ T,
1455
1459
  [i.id]
1456
1460
  );
1457
- const { action: a, destroy: l } = Mt(
1461
+ const { action: d, destroy: r } = kt(
1458
1462
  i.selection,
1459
1463
  () => {
1460
1464
  const c = i.selection.value.map(
1461
1465
  (f) => i.collection.getByKey(f.name)
1462
1466
  );
1463
- Tt(JSON.stringify(c), "viewsheds.json");
1467
+ Dt(JSON.stringify(c), "viewsheds.json");
1464
1468
  },
1465
- A
1466
- ), { action: u, destroy: d } = Rt(
1469
+ T
1470
+ ), { action: u, destroy: l } = $t(
1467
1471
  async (c) => {
1468
1472
  const { vueI18n: f } = e, g = (await Promise.all(
1469
- c.map(async (O) => {
1470
- const U = await O.text();
1473
+ c.map(async (M) => {
1474
+ const U = await M.text();
1471
1475
  try {
1472
- return JSON.parse(U).map((r) => new B(r));
1476
+ return JSON.parse(U).map((a) => new B(a));
1473
1477
  } catch {
1474
1478
  e.notifier.add({
1475
- type: ne.ERROR,
1479
+ type: re.ERROR,
1476
1480
  message: f.t("components.import.failure", {
1477
- fileName: O.name
1481
+ fileName: M.name
1478
1482
  })
1479
1483
  });
1480
1484
  }
1481
1485
  return [];
1482
1486
  })
1483
- )).flat(), b = g.map((O) => s.collection.add(O)).filter((O) => O != null), N = g.length - b.length;
1484
- if (N > 0)
1487
+ )).flat(), y = g.map((M) => s.collection.add(M)).filter((M) => M != null), k = g.length - y.length;
1488
+ if (k > 0)
1485
1489
  return e.notifier.add({
1486
- type: ne.WARNING,
1487
- message: f.t("components.import.addFailure", [N])
1490
+ type: re.WARNING,
1491
+ message: f.t("components.import.addFailure", [k])
1488
1492
  }), !1;
1489
- if (b.length > 0)
1493
+ if (y.length > 0)
1490
1494
  e.notifier.add({
1491
- type: ne.SUCCESS,
1495
+ type: re.SUCCESS,
1492
1496
  message: f.t("components.import.featuresAdded", [
1493
- b.length
1497
+ y.length
1494
1498
  ])
1495
1499
  });
1496
1500
  else
1497
1501
  return e.notifier.add({
1498
- type: ne.ERROR,
1502
+ type: re.ERROR,
1499
1503
  message: f.t("components.import.nothingAdded")
1500
1504
  }), !1;
1501
1505
  return !0;
1502
1506
  },
1503
1507
  e.windowManager,
1504
- A,
1508
+ T,
1505
1509
  "category-manager"
1506
1510
  );
1507
- return i.addActions([a, u]), {
1511
+ return i.addActions([d, u]), {
1508
1512
  renamed: o,
1509
1513
  visibilityChanged: t,
1510
1514
  setSelection(c) {
@@ -1519,13 +1523,13 @@ async function di(e) {
1519
1523
  );
1520
1524
  if (h) {
1521
1525
  const g = h.actions.find(
1522
- (b) => b.name === "visibilityAction"
1526
+ (y) => y.name === "visibilityAction"
1523
1527
  );
1524
1528
  g && (g.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
1525
1529
  }
1526
1530
  },
1527
1531
  add(c) {
1528
- c.properties.title = ci(c.type, [
1532
+ c.properties.title = mi(c.type, [
1529
1533
  ...s.collection
1530
1534
  ]), s.collection.add(c);
1531
1535
  },
@@ -1535,21 +1539,21 @@ async function di(e) {
1535
1539
  },
1536
1540
  collectionComponent: i,
1537
1541
  destroy() {
1538
- e.categoryManager.removeOwner(A), o.destroy(), t.destroy(), l(), d();
1542
+ e.categoryManager.removeOwner(T), o.destroy(), t.destroy(), r(), l();
1539
1543
  }
1540
1544
  };
1541
1545
  }
1542
- const ui = Me({
1546
+ const wi = Ae({
1543
1547
  name: "ViewshedConfigEditor",
1544
1548
  components: {
1545
- AbstractConfigEditor: Nt,
1546
- VcsFormSection: Ne,
1547
- VContainer: At,
1548
- VRow: Ie,
1549
- VCol: Pe,
1550
- VcsLabel: Re,
1551
- VcsSelect: Te,
1552
- VColorPicker: Pt
1549
+ AbstractConfigEditor: Lt,
1550
+ VcsFormSection: $e,
1551
+ VContainer: jt,
1552
+ VRow: Fe,
1553
+ VCol: We,
1554
+ VcsLabel: De,
1555
+ VcsSelect: ke,
1556
+ VColorPicker: Wt
1553
1557
  },
1554
1558
  props: {
1555
1559
  getConfig: {
@@ -1562,8 +1566,8 @@ const ui = Me({
1562
1566
  }
1563
1567
  },
1564
1568
  setup(e) {
1565
- const o = ce("vcsUiApp"), { getDefaultOptions: t } = o.plugins.getByKey(
1566
- A
1569
+ const o = me("vcsUiApp"), { getDefaultOptions: t } = o.plugins.getByKey(
1570
+ T
1567
1571
  ), i = K({
1568
1572
  ...t == null ? void 0 : t(),
1569
1573
  ...e.getConfig()
@@ -1582,24 +1586,24 @@ const ui = Me({
1582
1586
  };
1583
1587
  }
1584
1588
  });
1585
- function hi(e, o, t, i, s, n) {
1586
- const a = V("VcsLabel"), l = V("v-col"), u = V("VcsSelect"), d = V("v-row"), c = V("VColorPicker"), f = V("v-container"), h = V("VcsFormSection"), g = V("AbstractConfigEditor");
1587
- return R(), W(g, ft({ ...e.$attrs, ...e.$props }, { onSubmit: e.apply }), {
1588
- default: m(() => [
1589
- e.localConfig ? (R(), W(h, {
1589
+ function gi(e, o, t, i, s, n) {
1590
+ const d = V("VcsLabel"), r = V("v-col"), u = V("VcsSelect"), l = V("v-row"), c = V("VColorPicker"), f = V("v-container"), h = V("VcsFormSection"), g = V("AbstractConfigEditor");
1591
+ return N(), W(g, ft({ ...e.$attrs, ...e.$props }, { onSubmit: e.apply }), {
1592
+ default: v(() => [
1593
+ e.localConfig ? (N(), W(h, {
1590
1594
  key: 0,
1591
1595
  heading: "viewshed.editor.general"
1592
1596
  }, {
1593
- default: m(() => [
1594
- v(f, { class: "px-1 py-0" }, {
1595
- default: m(() => [
1596
- v(d, { "no-gutters": "" }, {
1597
- default: m(() => [
1598
- v(l, null, {
1599
- default: m(() => [
1600
- v(a, { "html-for": "viewshed-editor-tools" }, {
1601
- default: m(() => [
1602
- H(
1597
+ default: v(() => [
1598
+ m(f, { class: "px-1 py-0" }, {
1599
+ default: v(() => [
1600
+ m(l, { "no-gutters": "" }, {
1601
+ default: v(() => [
1602
+ m(r, null, {
1603
+ default: v(() => [
1604
+ m(d, { "html-for": "viewshed-editor-tools" }, {
1605
+ default: v(() => [
1606
+ z(
1603
1607
  j(e.$t("viewshed.editor.tools")),
1604
1608
  1
1605
1609
  /* TEXT */
@@ -1612,12 +1616,12 @@ function hi(e, o, t, i, s, n) {
1612
1616
  _: 1
1613
1617
  /* STABLE */
1614
1618
  }),
1615
- v(l, null, {
1616
- default: m(() => [
1617
- v(u, {
1619
+ m(r, null, {
1620
+ default: v(() => [
1621
+ m(u, {
1618
1622
  id: "viewshed-tools",
1619
1623
  modelValue: e.localConfig.tools,
1620
- "onUpdate:modelValue": o[0] || (o[0] = (b) => e.localConfig.tools = b),
1624
+ "onUpdate:modelValue": o[0] || (o[0] = (y) => e.localConfig.tools = y),
1621
1625
  items: e.toolItems,
1622
1626
  multiple: !0
1623
1627
  }, null, 8, ["modelValue", "items"])
@@ -1629,13 +1633,13 @@ function hi(e, o, t, i, s, n) {
1629
1633
  _: 1
1630
1634
  /* STABLE */
1631
1635
  }),
1632
- v(d, { "no-gutters": "" }, {
1633
- default: m(() => [
1634
- v(l, null, {
1635
- default: m(() => [
1636
- v(a, { "html-for": "viewshed-editor-visible-color" }, {
1637
- default: m(() => [
1638
- H(
1636
+ m(l, { "no-gutters": "" }, {
1637
+ default: v(() => [
1638
+ m(r, null, {
1639
+ default: v(() => [
1640
+ m(d, { "html-for": "viewshed-editor-visible-color" }, {
1641
+ default: v(() => [
1642
+ z(
1639
1643
  j(e.$t("viewshed.editor.visibleColor")),
1640
1644
  1
1641
1645
  /* TEXT */
@@ -1648,11 +1652,11 @@ function hi(e, o, t, i, s, n) {
1648
1652
  _: 1
1649
1653
  /* STABLE */
1650
1654
  }),
1651
- v(l, null, {
1652
- default: m(() => [
1653
- v(c, {
1655
+ m(r, null, {
1656
+ default: v(() => [
1657
+ m(c, {
1654
1658
  modelValue: e.localConfig.visibleColor,
1655
- "onUpdate:modelValue": o[1] || (o[1] = (b) => e.localConfig.visibleColor = b),
1659
+ "onUpdate:modelValue": o[1] || (o[1] = (y) => e.localConfig.visibleColor = y),
1656
1660
  mode: "rgba"
1657
1661
  }, null, 8, ["modelValue"])
1658
1662
  ]),
@@ -1663,13 +1667,13 @@ function hi(e, o, t, i, s, n) {
1663
1667
  _: 1
1664
1668
  /* STABLE */
1665
1669
  }),
1666
- v(d, { "no-gutters": "" }, {
1667
- default: m(() => [
1668
- v(l, null, {
1669
- default: m(() => [
1670
- v(a, { "html-for": "viewshed-editor-shadow-color" }, {
1671
- default: m(() => [
1672
- H(
1670
+ m(l, { "no-gutters": "" }, {
1671
+ default: v(() => [
1672
+ m(r, null, {
1673
+ default: v(() => [
1674
+ m(d, { "html-for": "viewshed-editor-shadow-color" }, {
1675
+ default: v(() => [
1676
+ z(
1673
1677
  j(e.$t("viewshed.editor.shadowColor")),
1674
1678
  1
1675
1679
  /* TEXT */
@@ -1682,11 +1686,11 @@ function hi(e, o, t, i, s, n) {
1682
1686
  _: 1
1683
1687
  /* STABLE */
1684
1688
  }),
1685
- v(l, null, {
1686
- default: m(() => [
1687
- v(c, {
1689
+ m(r, null, {
1690
+ default: v(() => [
1691
+ m(c, {
1688
1692
  modelValue: e.localConfig.shadowColor,
1689
- "onUpdate:modelValue": o[2] || (o[2] = (b) => e.localConfig.shadowColor = b),
1693
+ "onUpdate:modelValue": o[2] || (o[2] = (y) => e.localConfig.shadowColor = y),
1690
1694
  mode: "rgba"
1691
1695
  }, null, 8, ["modelValue"])
1692
1696
  ]),
@@ -1710,81 +1714,156 @@ function hi(e, o, t, i, s, n) {
1710
1714
  /* STABLE */
1711
1715
  }, 16, ["onSubmit"]);
1712
1716
  }
1713
- const fi = /* @__PURE__ */ ke(ui, [["render", hi]]);
1714
- function Oe() {
1717
+ const Ci = /* @__PURE__ */ xe(wi, [["render", gi]]);
1718
+ class he extends Le {
1719
+ constructor(t, i) {
1720
+ super(t, i);
1721
+ C(this, "_mode");
1722
+ C(this, "_viewshedOptions");
1723
+ this._mode = Ue(
1724
+ t.m,
1725
+ O,
1726
+ O.CREATE
1727
+ ), this._viewshedOptions = t.cv || null;
1728
+ }
1729
+ static get className() {
1730
+ return "ActivateViewshedCallback";
1731
+ }
1732
+ callback() {
1733
+ const t = this._app.plugins.getByKey(T);
1734
+ if (!t) {
1735
+ X("ActivateViewshedCallback").warning(
1736
+ `Plugin ${T} not found`
1737
+ );
1738
+ return;
1739
+ }
1740
+ t.state.m = this._mode, t.state.cv = this._viewshedOptions, t.activate();
1741
+ }
1742
+ toJSON() {
1743
+ const t = super.toJSON();
1744
+ return this._mode && (t.m = this._mode), this._viewshedOptions && (t.cv = structuredClone(this._viewshedOptions)), t;
1745
+ }
1746
+ }
1747
+ class fe extends Le {
1748
+ static get className() {
1749
+ return "DeactivateViewshedCallback";
1750
+ }
1751
+ callback() {
1752
+ const o = this._app.plugins.getByKey(T);
1753
+ if (!o) {
1754
+ X("DeactivateShadowCallback").warning(
1755
+ `Plugin ${T} not found`
1756
+ );
1757
+ return;
1758
+ }
1759
+ o.deactivate();
1760
+ }
1761
+ }
1762
+ function Pe() {
1715
1763
  return {
1716
1764
  visibleColor: B.getDefaultOptions().colorOptions.visibleColor,
1717
1765
  shadowColor: B.getDefaultOptions().colorOptions.shadowColor,
1718
1766
  tools: [...Object.values(_)]
1719
1767
  };
1720
1768
  }
1721
- function Ei(e) {
1769
+ function pe(e, o, t) {
1770
+ var i;
1771
+ if (!(!(t != null && t.m) || !(e instanceof H))) {
1772
+ if (t.m === O.CREATE) {
1773
+ const s = ((i = t.cv) == null ? void 0 : i.viewshedType) ?? _.CONE;
1774
+ o == null || o.createViewshed(s).catch((n) => {
1775
+ X(T).error("Failed to create viewshed", String(n));
1776
+ });
1777
+ } else if (t.cv) {
1778
+ const s = new B(t.cv);
1779
+ t.m === O.VIEW ? o == null || o.viewViewshed(s) : o == null || o.editViewshed(s);
1780
+ }
1781
+ }
1782
+ }
1783
+ function Ti(e) {
1722
1784
  let o, t, i = () => {
1723
1785
  };
1724
- const s = Oe(), n = { ...s, ...e };
1786
+ const s = Pe(), n = { ...s, ...e }, d = Q({});
1725
1787
  return {
1726
1788
  get name() {
1727
- return A;
1789
+ return T;
1728
1790
  },
1729
1791
  get version() {
1730
- return Xt;
1792
+ return ti;
1731
1793
  },
1732
1794
  get mapVersion() {
1733
- return Jt;
1795
+ return ii;
1734
1796
  },
1735
- async initialize(a, l) {
1736
- o = a, a.categoryClassRegistry.registerClass(
1737
- this[qe],
1738
- pe.className,
1739
- pe
1797
+ getDefaultOptions: Pe,
1798
+ state: d,
1799
+ async initialize(r, u) {
1800
+ o = r, o.callbackClassRegistry.registerClass(
1801
+ this[ee],
1802
+ he.className,
1803
+ he
1804
+ ), o.callbackClassRegistry.registerClass(
1805
+ this[ee],
1806
+ fe.className,
1807
+ fe
1808
+ ), r.categoryClassRegistry.registerClass(
1809
+ this[ee],
1810
+ _e.className,
1811
+ _e
1740
1812
  );
1741
- const u = await di(a);
1742
- t = Qt(
1743
- a,
1813
+ const l = await vi(r);
1814
+ t = ni(
1815
+ r,
1744
1816
  n,
1745
- u
1817
+ l
1746
1818
  );
1747
- const d = li(
1748
- a,
1819
+ const c = pi(
1820
+ r,
1749
1821
  t,
1750
- A,
1822
+ T,
1751
1823
  n.tools || s.tools
1752
- ), { destroy: c } = ai(
1824
+ ), { destroy: f } = hi(
1753
1825
  t,
1754
- a,
1755
- u.collectionComponent
1756
- ), { activeMap: f } = a.maps;
1757
- function h(N) {
1758
- if (l != null && l.m && l.cv && N instanceof z) {
1759
- const O = new B(l.cv);
1760
- l.m === T.VIEW ? t.viewViewshed(O) : t.editViewshed(O);
1761
- }
1762
- }
1826
+ r,
1827
+ l.collectionComponent
1828
+ ), { activeMap: h } = r.maps;
1763
1829
  let g = !1;
1764
- f && (g = !0, h(f));
1765
- const b = a.maps.mapActivated.addEventListener(
1766
- (N) => {
1767
- t.stop(), g || (h(N), g = !0);
1830
+ h && (g = !0, pe(h, t, u));
1831
+ const y = r.maps.mapActivated.addEventListener(
1832
+ (k) => {
1833
+ t == null || t.stop(), g || (pe(k, t, u), g = !0);
1768
1834
  }
1769
1835
  );
1770
1836
  i = () => {
1771
- b(), d(), c(), u.destroy(), t.destroy();
1837
+ y(), c(), f(), l == null || l.destroy(), t == null || t.destroy();
1772
1838
  };
1773
1839
  },
1774
- getDefaultOptions: Oe,
1840
+ activate() {
1841
+ if (!t || !o) {
1842
+ X(T).error("Cannot activate plugin before initialization");
1843
+ return;
1844
+ }
1845
+ if (!o.maps.activeMap) {
1846
+ X(T).error("Cannot activate plugin without an active map");
1847
+ return;
1848
+ }
1849
+ pe(o.maps.activeMap, t, this.state);
1850
+ },
1851
+ deactivate() {
1852
+ t == null || t.stop();
1853
+ },
1775
1854
  toJSON() {
1776
- const a = {};
1777
- return n.tools && s.tools.length !== n.tools.length && (a.tools = [...n.tools]), n.shadowColor && n.shadowColor !== s.shadowColor && (a.shadowColor = n.shadowColor), n.visibleColor && n.visibleColor !== s.visibleColor && (a.visibleColor = n.visibleColor), a;
1855
+ const r = {};
1856
+ return n.tools && s.tools.length !== n.tools.length && (r.tools = [...n.tools]), n.shadowColor && n.shadowColor !== s.shadowColor && (r.shadowColor = n.shadowColor), n.visibleColor && n.visibleColor !== s.visibleColor && (r.visibleColor = n.visibleColor), r;
1778
1857
  },
1779
- getState(a) {
1780
- var c, f, h, g;
1781
- const l = {}, u = t.mode.value, d = (c = t.currentViewshed.value) == null ? void 0 : c.toJSON();
1782
- return u !== null && u !== T.CREATE && d && (l.m = u, l.cv = d, a && ((h = (f = l.cv) == null ? void 0 : f.properties) != null && h.title) && (Object.keys((g = l.cv) == null ? void 0 : g.properties).length === 1 ? delete l.cv.properties : delete l.cv.properties.title)), l;
1858
+ getState(r) {
1859
+ var f, h, g, y;
1860
+ const u = {}, l = t == null ? void 0 : t.mode.value, c = (f = t == null ? void 0 : t.currentViewshed.value) == null ? void 0 : f.toJSON();
1861
+ return l !== null && l !== O.CREATE && c && (u.m = l, u.cv = c, r && ((g = (h = u.cv) == null ? void 0 : h.properties) != null && g.title) && (Object.keys((y = u.cv) == null ? void 0 : y.properties).length === 1 ? delete u.cv.properties : delete u.cv.properties.title)), u;
1783
1862
  },
1784
1863
  getConfigEditors() {
1785
1864
  return [
1786
1865
  {
1787
- component: fi,
1866
+ component: Ci,
1788
1867
  title: "viewshed.editor.title",
1789
1868
  infoUrlCallback: o == null ? void 0 : o.getHelpUrlCallback(
1790
1869
  "/components/plugins/viewshedToolConfig.html",
@@ -1793,9 +1872,6 @@ function Ei(e) {
1793
1872
  }
1794
1873
  ];
1795
1874
  },
1796
- destroy: () => {
1797
- i();
1798
- },
1799
1875
  i18n: {
1800
1876
  en: {
1801
1877
  viewshed: {
@@ -1869,10 +1945,19 @@ function Ei(e) {
1869
1945
  }
1870
1946
  }
1871
1947
  }
1948
+ },
1949
+ destroy() {
1950
+ o && (o.callbackClassRegistry.unregisterClass(
1951
+ this[ee],
1952
+ he.className
1953
+ ), o.callbackClassRegistry.unregisterClass(
1954
+ this[ee],
1955
+ fe.className
1956
+ )), i();
1872
1957
  }
1873
1958
  };
1874
1959
  }
1875
1960
  export {
1876
- Ei as default,
1877
- Oe as getDefaultOptions
1961
+ Ti as default,
1962
+ Pe as getDefaultOptions
1878
1963
  };