@vcmap/viewshed 3.0.2 → 3.0.5

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,13 @@
1
- var Oe = Object.defineProperty;
2
- var Ie = (i, t, o) => t in i ? Oe(i, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[t] = o;
3
- var de = (i, t, o) => Ie(i, typeof t != "symbol" ? t + "" : t, o);
4
- import { VcsCameraPrimitive as Pe, VcsObject as Ae, VcsEvent as Y, AbstractInteraction as Re, EventType as K, Projection as z, SessionType as Ne, CesiumMap as $, startEditFeaturesSession as De, startEditGeometrySession as xe, VectorLayer as ke, wgs84Projection as Le, maxZIndex as Fe, markVolatile as je, Viewpoint as We, TransformationMode as Be, Category as Ue, moduleIdSymbol as $e } from "../../../assets/core.js";
5
- import { Color as Z, Matrix4 as He, Transforms as ze, Primitive as ce, GeometryInstance as ue, SphereGeometry as Ge, ColorGeometryInstanceAttribute as he, PerInstanceColorAppearance as fe, SphereOutlineGeometry as Ke, Math as k, Cartesian3 as W, ShadowMap as Ye, Camera as Xe, HeightReference as Je } from "../../../assets/cesium.js";
6
- import { shallowRef as te, ref as U, nextTick as Ze, inject as me, computed as ve, reactive as q, watchEffect as qe, watch as G, onMounted as Qe, onUnmounted as et, resolveComponent as b, openBlock as M, createElementBlock as B, createBlock as D, withCtx as f, createTextVNode as F, toDisplayString as A, createCommentVNode as H, createVNode as m, createElementVNode as tt, Fragment as pe, renderList as we, mergeProps as it } from "../../../assets/vue.js";
7
- import { ol$Observable$unByKey as ot, Feature as st, ol$geom$Point as nt, ol$style$Style as at } from "../../../assets/ol.js";
8
- import { VcsTextField as rt, VcsSlider as lt, VcsLabel as _e, VcsFormSection as Ce, VcsSelect as Ee, VcsFormButton as dt, VcsFeatureTransforms as ct, VcsHelp as ut, makeEditorCollectionComponentClass as ht, WindowSlot as ft, ToolboxType as mt, createSupportedMapMappingFunction as vt, createListExportAction as pt, downloadText as wt, createListImportAction as gt, NotificationType as X, AbstractConfigEditor as _t } from "../../../assets/ui.js";
9
- import { VContainer as ye, VRow as Ve, VCol as be, VDivider as Ct, VColorPicker as Et } from "../../../assets/vuetify.js";
10
- const Me = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyString"), ae = /* @__PURE__ */ new Map();
1
+ var Ie = Object.defineProperty;
2
+ var Pe = (i, e, o) => e in i ? Ie(i, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : i[e] = o;
3
+ var de = (i, e, o) => Pe(i, typeof e != "symbol" ? e + "" : e, o);
4
+ import { VcsCameraPrimitive as Ae, VcsObject as Re, VcsEvent as X, AbstractInteraction as Ne, EventType as Y, Projection as z, SessionType as De, CesiumMap as U, startEditFeaturesSession as ke, startEditGeometrySession as xe, VectorLayer as Le, wgs84Projection as Fe, maxZIndex as je, markVolatile as We, Viewpoint as Be, TransformationMode as Ue, Category as $e, moduleIdSymbol as He } from "../../../assets/core.js";
5
+ import { Color as ee, Matrix4 as ze, Transforms as Ge, Primitive as ce, GeometryInstance as ue, SphereGeometry as Ke, ColorGeometryInstanceAttribute as he, PerInstanceColorAppearance as fe, SphereOutlineGeometry as Ye, Math as k, Cartesian3 as W, ShadowMap as Xe, Camera as Je, HeightReference as Ze } from "../../../assets/cesium.js";
6
+ import { shallowRef as q, ref as $, nextTick as qe, inject as me, computed as ve, reactive as J, watchEffect as Qe, watch as G, onMounted as et, onUnmounted as tt, resolveComponent as b, openBlock as M, createElementBlock as B, createBlock as N, withCtx as h, createTextVNode as F, toDisplayString as A, createCommentVNode as H, createVNode as p, createElementVNode as it, Fragment as pe, renderList as we, mergeProps as ot } from "../../../assets/vue.js";
7
+ import { ol$Observable$unByKey as st, Feature as nt, ol$geom$Point as at, ol$style$Style as rt } from "../../../assets/ol.js";
8
+ import { VcsTextField as lt, VcsSlider as dt, VcsLabel as Ce, VcsFormSection as Ee, VcsSelect as ye, VcsFormButton as ct, VcsFeatureTransforms as ut, VcsHelp as ht, makeEditorCollectionComponentClass as ft, WindowSlot as mt, ToolboxType as ge, createSupportedMapMappingFunction as vt, createListExportAction as pt, downloadText as wt, createListImportAction as gt, NotificationType as Z, AbstractConfigEditor as _t } from "../../../assets/ui.js";
9
+ import { VContainer as Ve, VRow as be, VCol as Me, VDivider as Ct, VColorPicker as Et } from "../../../assets/vuetify.js";
10
+ const Te = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyString"), re = /* @__PURE__ */ new Map();
11
11
  [
12
12
  [String, "string"],
13
13
  [Number, "number"],
@@ -15,31 +15,31 @@ const Me = Symbol("isMatcher"), yt = Symbol("Integer"), Vt = Symbol("NonEmptyStr
15
15
  [Function, "function"],
16
16
  [void 0, "undefined"],
17
17
  [Symbol, "symbol"]
18
- ].forEach(([i, t]) => {
19
- ae.set(i, t);
18
+ ].forEach(([i, e]) => {
19
+ re.set(i, e);
20
20
  });
21
21
  function bt(i) {
22
- return i == null ? void 0 : i[Me];
22
+ return i == null ? void 0 : i[Te];
23
23
  }
24
- function ie(i) {
24
+ function oe(i) {
25
25
  if (!i || String(i) !== "[object Object]")
26
26
  return !1;
27
- const t = Object.getPrototypeOf(i);
28
- if (!t)
27
+ const e = Object.getPrototypeOf(i);
28
+ if (!e)
29
29
  return !0;
30
- const e = {}.hasOwnProperty.call(t, "constructor") && t.constructor;
31
- return typeof e == "function" && String(e) === String(Object);
30
+ const t = {}.hasOwnProperty.call(e, "constructor") && e.constructor;
31
+ return typeof t == "function" && String(t) === String(Object);
32
32
  }
33
- function R(i, t) {
33
+ function R(i, e) {
34
34
  if (i === null)
35
35
  return "null";
36
36
  if (typeof i > "u")
37
37
  return "undefined";
38
- if (t)
38
+ if (e)
39
39
  return typeof i;
40
40
  let o;
41
41
  if (Array.isArray(i))
42
- o = `[${i.map((s) => R(s, t)).join(",")}]`;
42
+ o = `[${i.map((s) => R(s, e)).join(",")}]`;
43
43
  else
44
44
  try {
45
45
  o = JSON.stringify(i);
@@ -48,162 +48,162 @@ function R(i, t) {
48
48
  }
49
49
  return o = o || typeof i, o.length > 20 ? `${o.substring(0, 20)}...` : o;
50
50
  }
51
- function Mt(i, t) {
52
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "symbol" ? i === t ? !1 : `Expected ${R(i)} to equal ${t.toString()}` : null;
51
+ function Mt(i, e) {
52
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" ? i === e ? !1 : `Expected ${R(i)} to equal ${e.toString()}` : null;
53
53
  }
54
- function Tt(i, t, o) {
55
- if (Array.isArray(t)) {
56
- if (t.length !== 1)
54
+ function Tt(i, e, o) {
55
+ if (Array.isArray(e)) {
56
+ if (e.length !== 1)
57
57
  throw new Error("Array patterns may only have one type");
58
58
  if (Array.isArray(i)) {
59
- let e = !1;
60
- return i.findIndex((n) => (e = o(n, t[0]), e)) > -1 ? `${String(e)} in ${R(i)}` : !1;
59
+ let t = !1;
60
+ return i.findIndex((n) => (t = o(n, e[0]), t)) > -1 ? `${String(t)} in ${R(i)}` : !1;
61
61
  }
62
62
  return `Expected ${R(i)} to be an Array`;
63
63
  }
64
64
  return null;
65
65
  }
66
- function oe(i, t, o, e) {
67
- const s = e ? `${e}.` : "";
68
- if (!ie(i))
66
+ function se(i, e, o, t) {
67
+ const s = t ? `${t}.` : "";
68
+ if (!oe(i))
69
69
  return `Expected ${R(i)} to be a plain Object`;
70
- let d = !1;
71
- const l = Object.keys(t).find((c) => {
72
- const C = i[c];
73
- return ie(t[c]) ? d = oe(C, t[c], o, s + c) : d = o(C, t[c]), d;
70
+ let r = !1;
71
+ const l = Object.keys(e).find((w) => {
72
+ const c = i[w];
73
+ return oe(e[w]) ? r = se(c, e[w], o, s + w) : r = o(c, e[w]), r;
74
74
  });
75
- return l ? `${String(d)} in object.${s}${l}` : !1;
75
+ return l ? `${String(r)} in object.${s}${l}` : !1;
76
76
  }
77
- function St(i, t) {
78
- if (t === Number)
77
+ function St(i, e) {
78
+ if (e === Number)
79
79
  return Number.isFinite(i) ? !1 : `expected ${R(i)} to be a number, excluding NaN`;
80
- if (t === yt)
80
+ if (e === yt)
81
81
  return Number.isInteger(i) ? !1 : `expected ${R(i)} to be an integer number`;
82
- if (t === Vt)
82
+ if (e === Vt)
83
83
  return typeof i == "string" && i.length > 0 ? !1 : `expected ${R(i)} to be a non-empty string`;
84
- const o = ae.get(t);
84
+ const o = re.get(e);
85
85
  return o ? typeof i === o ? !1 : `expected ${R(i)} to be a ${String(o)}` : null;
86
86
  }
87
- function Te(i) {
87
+ function Se(i) {
88
88
  if (i === null)
89
89
  return "null";
90
- const t = ae.get(i);
91
- if (t)
92
- return t;
90
+ const e = re.get(i);
91
+ if (e)
92
+ return e;
93
93
  const o = i == null ? void 0 : i.className;
94
94
  if (o)
95
95
  return o;
96
- let e = String(i);
97
- const s = e.match(/function (.*)\(/);
96
+ let t = String(i);
97
+ const s = t.match(/function (.*)\(/);
98
98
  if (s && s.length > 1) {
99
99
  const n = i == null ? void 0 : i.name;
100
100
  return n || s[1].substring(0, 20);
101
101
  }
102
- if (ie(i)) {
102
+ if (oe(i)) {
103
103
  const n = {};
104
- Object.keys(i).forEach((d) => {
105
- n[d] = Te(i[d]);
104
+ Object.keys(i).forEach((r) => {
105
+ n[r] = Se(i[r]);
106
106
  });
107
107
  try {
108
- e = `Object of ${JSON.stringify(n)}`;
108
+ t = `Object of ${JSON.stringify(n)}`;
109
109
  } catch {
110
- e = "Object";
110
+ t = "Object";
111
111
  }
112
112
  }
113
- return e;
113
+ return t;
114
114
  }
115
- function Ot(i, t) {
116
- const o = (e, s) => {
115
+ function Ot(i, e) {
116
+ const o = (t, s) => {
117
117
  if (bt(s))
118
- return s(e);
118
+ return s(t);
119
119
  if (s == null)
120
- return e === s ? !1 : `Expected ${R(e)} to be ${String(s)}`;
121
- const n = St(e, s);
120
+ return t === s ? !1 : `Expected ${R(t)} to be ${String(s)}`;
121
+ const n = St(t, s);
122
122
  if (n !== null)
123
123
  return n;
124
- const d = Mt(e, s);
125
- if (d !== null)
126
- return d;
124
+ const r = Mt(t, s);
125
+ if (r !== null)
126
+ return r;
127
127
  if (Array.isArray(s))
128
- return Tt(e, s, o);
128
+ return Tt(t, s, o);
129
129
  if (s === Object)
130
- return oe(e, {}, o);
130
+ return se(t, {}, o);
131
131
  if (s instanceof Function)
132
- return e instanceof s ? !1 : `Expected ${R(e, !0)} to be of Type ${Te(s)}`;
132
+ return t instanceof s ? !1 : `Expected ${R(t, !0)} to be of Type ${Se(s)}`;
133
133
  if (typeof s == "object") {
134
- const l = oe(e, s, o);
134
+ const l = se(t, s, o);
135
135
  return l || !1;
136
136
  }
137
137
  throw new Error(`Cannot handle pattern ${String(s)}`);
138
138
  };
139
- return o(i, t);
139
+ return o(i, e);
140
140
  }
141
141
  let It = Error;
142
- function re(i, t) {
143
- const o = Ot(i, t);
142
+ function le(i, e) {
143
+ const o = Ot(i, e);
144
144
  if (o)
145
145
  throw new It(`Match failed: ${o}`);
146
146
  }
147
147
  function Pt(i) {
148
- re(i, Object);
149
- const t = Object.values(i), o = (e) => t.includes(e) ? !1 : `expected ${R(e)} to be of enum: ${t.join(", ")}`;
150
- return o[Me] = !0, o;
148
+ le(i, Object);
149
+ const e = Object.values(i), o = (t) => e.includes(t) ? !1 : `expected ${R(t)} to be of enum: ${e.join(", ")}`;
150
+ return o[Te] = !0, o;
151
151
  }
152
- function At(i, t, o) {
152
+ function At(i, e, o) {
153
153
  if (i != null) {
154
- const e = Object.values(t).find((s) => s == i);
155
- if (e != null)
156
- return e;
154
+ const t = Object.values(e).find((s) => s == i);
155
+ if (t != null)
156
+ return t;
157
157
  }
158
158
  return o;
159
159
  }
160
- const Rt = new Z(), Q = new He();
161
- class Nt extends Pe {
162
- constructor(t) {
163
- super(t), this.spot = t.spot;
160
+ const Rt = new ee(), te = new ze();
161
+ class Nt extends Ae {
162
+ constructor(e) {
163
+ super(e), this.spot = e.spot;
164
164
  }
165
165
  /**
166
166
  * Updates the camera primitive.
167
167
  * @param {unknown} frameState
168
168
  */
169
- update(t) {
169
+ update(e) {
170
170
  if (this.show)
171
171
  if (this.spot)
172
- super.update(t);
172
+ super.update(e);
173
173
  else {
174
- const o = this._planesPrimitives, e = this._outlinePrimitives;
175
- o.length === 0 && (ze.eastNorthUpToFixedFrame(
174
+ const o = this._planesPrimitives, t = this._outlinePrimitives;
175
+ o.length === 0 && (Ge.eastNorthUpToFixedFrame(
176
176
  this._camera.positionWC,
177
177
  void 0,
178
- Q
178
+ te
179
179
  ), o[0] = new ce({
180
180
  allowPicking: this.allowPicking,
181
181
  geometryInstances: new ue({
182
- geometry: new Ge({
182
+ geometry: new Ke({
183
183
  radius: 2
184
184
  }),
185
185
  attributes: {
186
186
  color: he.fromColor(
187
- Z.fromAlpha(this._color, 0.1, Rt)
187
+ ee.fromAlpha(this._color, 0.1, Rt)
188
188
  )
189
189
  },
190
- modelMatrix: Q
190
+ modelMatrix: te
191
191
  }),
192
192
  appearance: new fe({
193
193
  translucent: !0,
194
194
  flat: !0
195
195
  }),
196
196
  asynchronous: !1
197
- }), e[0] = new ce({
197
+ }), t[0] = new ce({
198
198
  allowPicking: this.allowPicking,
199
199
  geometryInstances: new ue({
200
- geometry: new Ke({
200
+ geometry: new Ye({
201
201
  radius: 2
202
202
  }),
203
203
  attributes: {
204
204
  color: he.fromColor(this._color)
205
205
  },
206
- modelMatrix: Q
206
+ modelMatrix: te
207
207
  }),
208
208
  appearance: new fe({
209
209
  translucent: !1,
@@ -213,22 +213,22 @@ class Nt extends Pe {
213
213
  }));
214
214
  const { length: s } = o;
215
215
  for (let n = 0; n < s; ++n)
216
- e[n].update(t), o[n].update(t);
216
+ t[n].update(e), o[n].update(e);
217
217
  }
218
218
  }
219
219
  }
220
- const p = {
220
+ const g = {
221
221
  CONE: "cone",
222
222
  THREESIXTY: "360"
223
223
  };
224
- function Dt(i, t) {
225
- const o = new Xe(i), e = (
224
+ function Dt(i, e) {
225
+ const o = new Je(i), t = (
226
226
  /** @type {import("@vcmap-cesium/engine").PerspectiveFrustum} */
227
227
  o.frustum
228
228
  );
229
- return e.fov = t.fov, e.near = t.near, e.aspectRatio = t.aspectRatio, e.far = t.far, o;
229
+ return t.fov = e.fov, t.near = e.near, t.aspectRatio = e.aspectRatio, t.far = e.far, o;
230
230
  }
231
- const I = class I extends Ae {
231
+ const I = class I extends Re {
232
232
  static get className() {
233
233
  return "Viewshed";
234
234
  }
@@ -257,34 +257,34 @@ const I = class I extends Ae {
257
257
  /**
258
258
  * @param {ViewshedOptions} options The options for the viewshed.
259
259
  */
260
- constructor(t) {
261
- var o, e, s, n, d, l;
262
- super(t), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
263
- fov: ((o = t.frustumOptions) == null ? void 0 : o.fov) || I.getDefaultOptions().frustum.fov,
264
- far: ((e = t.frustumOptions) == null ? void 0 : e.far) || I.getDefaultOptions().frustum.far,
265
- near: ((s = t.frustumOptions) == null ? void 0 : s.near) || I.getDefaultOptions().frustum.near,
266
- aspectRatio: ((n = t.frustumOptions) == null ? void 0 : n.aspectRatio) || I.getDefaultOptions().frustum.aspectRatio
267
- }, this._headingPitchRollValues = t.orientation || {
260
+ constructor(e) {
261
+ var o, t, s, n, r, l;
262
+ super(e), this._cesiumMap = null, this._shadowCamera = null, this._scene = null, this._frustumOptions = {
263
+ fov: ((o = e.frustumOptions) == null ? void 0 : o.fov) || I.getDefaultOptions().frustum.fov,
264
+ far: ((t = e.frustumOptions) == null ? void 0 : t.far) || I.getDefaultOptions().frustum.far,
265
+ near: ((s = e.frustumOptions) == null ? void 0 : s.near) || I.getDefaultOptions().frustum.near,
266
+ aspectRatio: ((n = e.frustumOptions) == null ? void 0 : n.aspectRatio) || I.getDefaultOptions().frustum.aspectRatio
267
+ }, this._headingPitchRollValues = e.orientation || {
268
268
  ...I.getDefaultOptions().orientation
269
- }, this._position = t.position || I.getDefaultOptions().position, this._viewshedType = At(t.viewshedType, p), this._colors = {
270
- visibleColor: Z.fromCssColorString(
271
- ((d = t.colorOptions) == null ? void 0 : d.visibleColor) || I.getDefaultOptions().visibleColor
269
+ }, this._position = e.position || I.getDefaultOptions().position, this._viewshedType = At(e.viewshedType, g), this._colors = {
270
+ visibleColor: ee.fromCssColorString(
271
+ ((r = e.colorOptions) == null ? void 0 : r.visibleColor) || I.getDefaultOptions().visibleColor
272
272
  ),
273
- shadowColor: Z.fromCssColorString(
274
- ((l = t.colorOptions) == null ? void 0 : l.shadowColor) || I.getDefaultOptions().shadowColor
273
+ shadowColor: ee.fromCssColorString(
274
+ ((l = e.colorOptions) == null ? void 0 : l.shadowColor) || I.getDefaultOptions().shadowColor
275
275
  )
276
- }, this._heightOffset = t.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!t.showPrimitive, this._positionChanged = new Y(), this._active = !1;
276
+ }, this._heightOffset = e.heightOffset || 0, this._shadowMap = null, this._primitive = null, this._showPrimitive = !!e.showPrimitive, this._positionChanged = new X(), this._active = !1;
277
277
  }
278
278
  /**
279
279
  * Sets a new position for the shadow map. If no shadow map was created yet, due to missing position, this method triggers the creation of a shadow map.
280
280
  * @param {import("ol/coordinate").Coordinate} coords The new positions coordinates in degrees
281
281
  */
282
- set position(t) {
283
- re(t, [Number]), this._position = t, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
284
- t[0],
285
- t[1],
286
- t[2] + this._heightOffset
287
- ), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(t);
282
+ set position(e) {
283
+ le(e, [Number]), this._position = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
284
+ e[0],
285
+ e[1],
286
+ e[2] + this._heightOffset
287
+ ), this._shadowCamera.setView({ orientation: this._headingPitchRollValues }), this._updatePrimitive()), this._positionChanged.raiseEvent(e);
288
288
  }
289
289
  /**
290
290
  * @returns {import("ol/coordinate").Coordinate} The current position of the viewshed source.
@@ -303,11 +303,11 @@ const I = class I extends Ae {
303
303
  * Sets the height offset of the viewshed.
304
304
  * @param {number} value the offset that is added to the position height.
305
305
  */
306
- set heightOffset(t) {
307
- this._heightOffset = t, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
306
+ set heightOffset(e) {
307
+ this._heightOffset = e, this._shadowCamera && (this._shadowCamera.position = W.fromDegrees(
308
308
  this.position[0],
309
309
  this.position[1],
310
- this.position[2] + t
310
+ this.position[2] + e
311
311
  ), this._updatePrimitive());
312
312
  }
313
313
  /**
@@ -321,8 +321,8 @@ const I = class I extends Ae {
321
321
  * Sets the reach of the viewshed.
322
322
  * @param {number} value The distance in meters.
323
323
  */
324
- set distance(t) {
325
- this._frustumOptions.far = t > I.MIN_DISTANCE ? t : I.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === p.THREESIXTY && this._updateShadowMap(), this._viewshedType === p.CONE && this._updatePrimitive());
324
+ set distance(e) {
325
+ this._frustumOptions.far = e > I.MIN_DISTANCE ? e : I.MIN_DISTANCE, this._shadowCamera && (this._shadowCamera.frustum.far = this._frustumOptions.far, this._viewshedType === g.THREESIXTY && this._updateShadowMap(), this._viewshedType === g.CONE && this._updatePrimitive());
326
326
  }
327
327
  /**
328
328
  * Returns the reach of the viewshed.
@@ -335,8 +335,8 @@ const I = class I extends Ae {
335
335
  * Sets the field of view of a cone viewshed. Does not have a impact on 360 viewshed.
336
336
  * @param {number} value The field of view in degrees.
337
337
  */
338
- set fov(t) {
339
- this._frustumOptions.fov = t * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = t * k.RADIANS_PER_DEGREE, this._viewshedType === p.CONE && (this._updateShadowMap(), this._updatePrimitive()));
338
+ set fov(e) {
339
+ this._frustumOptions.fov = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.frustum.fov = e * k.RADIANS_PER_DEGREE, this._viewshedType === g.CONE && (this._updateShadowMap(), this._updatePrimitive()));
340
340
  }
341
341
  /**
342
342
  * Returns the field of view.
@@ -349,14 +349,14 @@ const I = class I extends Ae {
349
349
  * Sets the heading of a cone viewshed. Does not have impact on 360 viewshed.
350
350
  * @param {number} value Heading in degrees.
351
351
  */
352
- set heading(t) {
353
- this._headingPitchRollValues.heading = t * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
352
+ set heading(e) {
353
+ this._headingPitchRollValues.heading = e * k.RADIANS_PER_DEGREE, this._shadowCamera && (this._shadowCamera.setView({
354
354
  orientation: {
355
- heading: t * k.RADIANS_PER_DEGREE,
355
+ heading: e * k.RADIANS_PER_DEGREE,
356
356
  pitch: this._shadowCamera.pitch,
357
357
  roll: 0
358
358
  }
359
- }), this._viewshedType === p.CONE && this._updatePrimitive());
359
+ }), this._viewshedType === g.CONE && this._updatePrimitive());
360
360
  }
361
361
  /**
362
362
  * Getter for the heading of a cone viewshed.
@@ -369,10 +369,10 @@ const I = class I extends Ae {
369
369
  * Sets the pitch of a cone viewshed. 0 is horizontal. Does not have impact on 360 viewshed.
370
370
  * @param {number} value The pitch in degrees.
371
371
  */
372
- set pitch(t) {
373
- if (this._headingPitchRollValues.pitch = t * k.RADIANS_PER_DEGREE, this._shadowCamera) {
374
- const o = t * k.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
375
- this._shadowCamera.lookUp(o), this._viewshedType === p.CONE && this._updatePrimitive();
372
+ set pitch(e) {
373
+ if (this._headingPitchRollValues.pitch = e * k.RADIANS_PER_DEGREE, this._shadowCamera) {
374
+ const o = e * k.RADIANS_PER_DEGREE - this._shadowCamera.pitch;
375
+ this._shadowCamera.lookUp(o), this._viewshedType === g.CONE && this._updatePrimitive();
376
376
  }
377
377
  }
378
378
  /**
@@ -386,8 +386,8 @@ const I = class I extends Ae {
386
386
  * Sets whether the primitive of the viewshed should be shown or not.
387
387
  * @param {boolean} value
388
388
  */
389
- set showPrimitive(t) {
390
- this._showPrimitive = t, this._updatePrimitive();
389
+ set showPrimitive(e) {
390
+ this._showPrimitive = e, this._updatePrimitive();
391
391
  }
392
392
  /**
393
393
  * Gets if the primitive of the viewshed is shown or not.
@@ -413,17 +413,17 @@ const I = class I extends Ae {
413
413
  * Deactivates the viewshed by removing primitive and removing shadowMap.
414
414
  */
415
415
  deactivate() {
416
- var t;
417
- this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (t = this._shadowMap) == null || t.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
416
+ var e;
417
+ this._active && (this._removePrimitive(), this._shadowMap.enabled = !1, (e = this._shadowMap) == null || e.destroy(), this._shadowCamera = null, this._scene = null, this._cesiumMap = null, this._shadowMap = null, this._active = !1);
418
418
  }
419
419
  /**
420
420
  * Activates viewshed.
421
421
  * @param {import("@vcmap/core").CesiumMap} cesiumMap The cesium map to which the shadow map of the viewshed is applied to.
422
422
  */
423
- activate(t) {
424
- if (this._active || (this._active = !0), t !== this._cesiumMap) {
425
- this._cesiumMap = t;
426
- const o = t.getScene();
423
+ activate(e) {
424
+ if (this._active || (this._active = !0), e !== this._cesiumMap) {
425
+ this._cesiumMap = e;
426
+ const o = e.getScene();
427
427
  if (o)
428
428
  this._shadowCamera = Dt(o, this._frustumOptions), this._position && (this.position = this._position), this._scene = o;
429
429
  else
@@ -435,13 +435,13 @@ const I = class I extends Ae {
435
435
  * Updates the shadow map by creating a new one and applying all the current parameters.
436
436
  */
437
437
  _updateShadowMap() {
438
- var t;
439
- !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((t = this._shadowMap) == null || t.destroy(), this._shadowMap = new Ye({
438
+ var e;
439
+ !this._active || !this._shadowCamera || !this._cesiumMap || !this._scene || ((e = this._shadowMap) == null || e.destroy(), this._shadowMap = new Xe({
440
440
  // @ts-ignore
441
441
  context: this._scene.context,
442
442
  lightCamera: this._shadowCamera,
443
443
  enabled: !0,
444
- isPointLight: this._viewshedType === p.THREESIXTY,
444
+ isPointLight: this._viewshedType === g.THREESIXTY,
445
445
  softShadows: !0,
446
446
  fromLightSource: !0,
447
447
  cascadesEnabled: !1,
@@ -451,30 +451,30 @@ const I = class I extends Ae {
451
451
  }), this._shadowMap.viewshed = this._colors, this._cesiumMap.setShadowMap(this._shadowMap));
452
452
  }
453
453
  _removePrimitive() {
454
- var t;
455
- this._primitive && !this._primitive.isDestroyed() && ((t = this._scene) == null || t.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
454
+ var e;
455
+ this._primitive && !this._primitive.isDestroyed() && ((e = this._scene) == null || e.primitives.remove(this._primitive), this._primitive.destroy(), this._primitive = null);
456
456
  }
457
457
  _updatePrimitive() {
458
458
  this._showPrimitive && this._active && this._scene ? (this._removePrimitive(), this._primitive = new Nt({
459
459
  camera: this._shadowCamera,
460
460
  allowPicking: !1,
461
- spot: this._viewshedType === p.CONE
461
+ spot: this._viewshedType === g.CONE
462
462
  }), this._scene.primitives.add(this._primitive)) : this._removePrimitive();
463
463
  }
464
464
  /**
465
465
  * Sets distance and, in case of cone viewsheds, also heading and pitch. Only works when viewshed is **active**.
466
466
  * @param {number[]} target Point to calculate distance, heading and pitch from.
467
467
  */
468
- lookAt(t) {
468
+ lookAt(e) {
469
469
  if (!this._shadowCamera)
470
470
  return;
471
- const o = W.fromDegrees(t[0], t[1], t[2]);
472
- if (this.distance = W.distance(this._shadowCamera.position, o), this.type === p.CONE && !o.equals(this._shadowCamera.position)) {
473
- const e = new W();
474
- W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position, e), this._shadowCamera.setView({
471
+ const o = W.fromDegrees(e[0], e[1], e[2]);
472
+ if (this.distance = W.distance(this._shadowCamera.position, o), this.type === g.CONE && !o.equals(this._shadowCamera.position)) {
473
+ const t = new W();
474
+ W.subtract(o, this._shadowCamera.position, o), W.normalize(o, o), W.normalize(this._shadowCamera.position, t), this._shadowCamera.setView({
475
475
  orientation: {
476
476
  direction: o,
477
- up: e
477
+ up: t
478
478
  }
479
479
  }), this._headingPitchRollValues.heading = this._shadowCamera.heading, this._headingPitchRollValues.pitch = this._shadowCamera.pitch;
480
480
  }
@@ -503,20 +503,20 @@ const I = class I extends Ae {
503
503
  * Destroys the viewshed.
504
504
  */
505
505
  destroy() {
506
- var e;
507
- const t = this._cesiumMap, o = this._shadowMap;
508
- this.deactivate(), ((e = t == null ? void 0 : t.getScene()) == null ? void 0 : e.shadowMap) === o && t.setDefaultShadowMap();
506
+ var t;
507
+ const e = this._cesiumMap, o = this._shadowMap;
508
+ this.deactivate(), ((t = e == null ? void 0 : e.getScene()) == null ? void 0 : t.shadowMap) === o && e.setDefaultShadowMap();
509
509
  }
510
510
  };
511
511
  de(I, "MIN_DISTANCE", 10);
512
- let x = I;
513
- class xt extends Re {
512
+ let D = I;
513
+ class kt extends Ne {
514
514
  /**
515
515
  *
516
516
  * @param {import("./viewshed").default} viewshed
517
517
  */
518
- constructor(t) {
519
- super(K.CLICKMOVE), this._viewshed = t, this._positioned = new Y(), this._finished = new Y(), this._position = !1, this.setActive();
518
+ constructor(e) {
519
+ super(Y.CLICKMOVE), this._viewshed = e, this._positioned = new X(), this._finished = new X(), this._position = !1, this.setActive();
520
520
  }
521
521
  get finished() {
522
522
  return this._finished;
@@ -524,8 +524,8 @@ class xt extends Re {
524
524
  get positioned() {
525
525
  return this._positioned;
526
526
  }
527
- async pipe(t) {
528
- return t.position && (this._position ? (this._viewshed.lookAt(z.mercatorToWgs84(t.position)), t.type & K.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = z.mercatorToWgs84(t.position), t.type & K.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), t;
527
+ async pipe(e) {
528
+ return e.position && (this._position ? (this._viewshed.lookAt(z.mercatorToWgs84(e.position)), e.type & Y.CLICK && (this.setActive(!1), this._finished.raiseEvent(null))) : (this._viewshed.position = z.mercatorToWgs84(e.position), e.type & Y.CLICK && (this._position = !0, this._positioned.raiseEvent(null)))), e;
529
529
  }
530
530
  destroy() {
531
531
  super.destroy(), this._finished.destroy(), this._positioned.destroy();
@@ -534,209 +534,210 @@ class xt extends Re {
534
534
  const P = {
535
535
  ABSOLUTE: "absolute",
536
536
  RELATIVE: "relative"
537
- }, y = {
537
+ }, E = {
538
538
  CREATE: "create",
539
539
  VIEW: "view",
540
540
  EDIT: "edit",
541
541
  MOVE: "move",
542
542
  MULTI_SELECT: "multiSelect"
543
- }, ge = 1.8;
544
- function kt(i) {
545
- const t = new ke({
546
- projection: Le.toJSON(),
547
- zIndex: Fe - 1
543
+ }, _e = 1.8;
544
+ function xt(i) {
545
+ const e = new Le({
546
+ projection: Fe.toJSON(),
547
+ zIndex: je - 1
548
548
  });
549
- je(t), t.activate();
550
- const o = new st(new nt(i));
551
- return o.setStyle(new at({})), t.addFeatures([o]), t.vectorProperties.altitudeMode = Je.NONE, {
552
- layer: t,
549
+ We(e), e.activate();
550
+ const o = new nt(new at(i));
551
+ return o.setStyle(new rt({})), e.addFeatures([o]), e.vectorProperties.altitudeMode = Ze.NONE, {
552
+ layer: e,
553
553
  feature: o,
554
554
  destroy() {
555
- o.dispose(), t.destroy();
555
+ o.dispose(), e.destroy();
556
556
  }
557
557
  };
558
558
  }
559
- function ee(i, t) {
560
- const o = t === P.ABSOLUTE ? K.CLICKMOVE : K.NONE;
559
+ function ie(i, e) {
560
+ const o = e === P.ABSOLUTE ? Y.CLICKMOVE : Y.NONE;
561
561
  i.setActive(o), i.pickPosition = o, i.pullPickedPosition = 1.8;
562
562
  }
563
- function Lt(i, t, o) {
564
- const e = te(null), s = U(null), n = U(null), d = U(P.ABSOLUTE);
563
+ function Lt(i, e, o) {
564
+ const t = q(null), s = $(null), n = $(null), r = $(P.ABSOLUTE);
565
565
  let l = () => {
566
566
  };
567
- const c = te(null);
568
- let C = () => {
567
+ const w = q(null), c = q([]);
568
+ let d = () => {
569
569
  };
570
- function u() {
570
+ function f() {
571
571
  var a;
572
- s.value && e.value ? (e.value.deactivate(), o.setVisibility(e.value.name, !1)) : (a = e.value) == null || a.destroy();
572
+ s.value && t.value ? (t.value.deactivate(), o.setVisibility(t.value.name, !1)) : (a = t.value) == null || a.destroy();
573
573
  }
574
- function h(a = !0) {
575
- C(), l(), u(), e.value = null, a && o.clearSelection(), s.value = null, n.value = null;
574
+ function m(a = !0) {
575
+ d(), l(), f(), t.value = null, a && o.clearSelection(), s.value = null, n.value = null;
576
576
  }
577
- function w(a) {
578
- C(), u(), i.maps.activeMap instanceof $ && (e.value = a, a.activate(i.maps.activeMap), C = i.maps.activeMap.shadowMapChanged.addEventListener((r) => {
579
- var _;
580
- r !== ((_ = e.value) == null ? void 0 : _.shadowMap) && h(!1);
577
+ function _(a) {
578
+ d(), f(), i.maps.activeMap instanceof U && (t.value = a, a.activate(i.maps.activeMap), d = i.maps.activeMap.shadowMapChanged.addEventListener((v) => {
579
+ var u;
580
+ v !== ((u = t.value) == null ? void 0 : u.shadowMap) && m(!1);
581
581
  }));
582
582
  }
583
- async function g(a) {
584
- h(), await Ze();
585
- const { eventHandler: r } = i.maps, { featureInteraction: _ } = r, v = new x({
583
+ async function y(a) {
584
+ m(), await qe();
585
+ const { eventHandler: v } = i.maps, { featureInteraction: u } = v, C = new D({
586
586
  viewshedType: a,
587
587
  colorOptions: {
588
- visibleColor: t.visibleColor,
589
- shadowColor: t.shadowColor
588
+ visibleColor: e.visibleColor,
589
+ shadowColor: e.shadowColor
590
590
  },
591
- heightOffset: d.value === P.ABSOLUTE ? 0 : ge
591
+ heightOffset: r.value === P.ABSOLUTE ? 0 : _e
592
592
  });
593
- w(v);
594
- const E = new xt(e.value);
595
- E.finished.addEventListener(() => {
596
- l(), e.value ? (e.value.showPrimitive = !0, n.value = y.EDIT) : h();
593
+ _(C);
594
+ const V = new kt(t.value);
595
+ V.finished.addEventListener(() => {
596
+ l(), t.value ? (t.value.showPrimitive = !0, n.value = E.EDIT) : m();
597
597
  });
598
- const T = r.addExclusiveInteraction(
599
- E,
598
+ const O = v.addExclusiveInteraction(
599
+ V,
600
600
  () => {
601
- E.destroy();
601
+ V.destroy();
602
602
  }
603
603
  );
604
- ee(_, d.value), E.positioned.addEventListener(() => {
605
- ee(_, P.ABSOLUTE);
604
+ ie(u, r.value), V.positioned.addEventListener(() => {
605
+ ie(u, P.ABSOLUTE);
606
606
  }), l = () => {
607
- T(), E.destroy(), _.setActive(), l = () => {
607
+ O(), V.destroy(), u.setActive(), l = () => {
608
608
  };
609
- }, n.value = y.CREATE;
609
+ }, n.value = E.CREATE;
610
610
  }
611
- function V(a) {
612
- var r;
613
- if (e.value && a) {
611
+ function x(a) {
612
+ var v;
613
+ if (t.value && a) {
614
614
  l();
615
615
  const {
616
- layer: _,
617
- feature: v,
618
- destroy: E
619
- } = kt(e.value.position);
620
- i.layers.add(_), d.value === P.ABSOLUTE ? (c.value = De(i, _), c.value.setFeatures([v])) : (c.value = xe(i, _), c.value.setFeature(v)), c.value.stopped.addEventListener(() => {
616
+ layer: u,
617
+ feature: C,
618
+ destroy: V
619
+ } = xt(t.value.position);
620
+ i.layers.add(u), c.value = [C], r.value === P.ABSOLUTE ? (w.value = ke(i, u), w.value.setFeatures([C])) : (w.value = xe(i, u), w.value.setFeature(C)), w.value.stopped.addEventListener(() => {
621
621
  l();
622
622
  });
623
- const T = (r = v.getGeometry()) == null ? void 0 : r.on("change", () => {
624
- e.value ? e.value.position = z.mercatorToWgs84(
623
+ const O = (v = C.getGeometry()) == null ? void 0 : v.on("change", () => {
624
+ t.value ? t.value.position = z.mercatorToWgs84(
625
625
  /** @type {import("ol/geom").Point} */
626
- v.getGeometry().getCoordinates()
627
- ) : h();
626
+ C.getGeometry().getCoordinates()
627
+ ) : m();
628
628
  });
629
- n.value = y.MOVE, l = () => {
630
- var O;
629
+ n.value = E.MOVE, l = () => {
630
+ var K;
631
631
  l = () => {
632
- }, T && ot(T), (O = c.value) == null || O.stop(), c.value = null, i.layers.remove(_), E(), n.value = y.EDIT;
632
+ }, O && st(O), (K = w.value) == null || K.stop(), w.value = null, c.value = [], i.layers.remove(u), V(), n.value = E.EDIT;
633
633
  };
634
634
  } else
635
635
  l();
636
636
  }
637
- function N(a, r) {
638
- l(), e.value !== r && (w(r), d.value = r.heightOffset ? P.RELATIVE : P.ABSOLUTE), s.value = !!r.properties.title, n.value = a, s.value && o.setVisibility(r.name, !0);
637
+ function S(a, v) {
638
+ l(), t.value !== v && (_(v), r.value = v.heightOffset ? P.RELATIVE : P.ABSOLUTE), s.value = !!v.properties.title, n.value = a, s.value && o.setVisibility(v.name, !0);
639
639
  }
640
- const S = [
640
+ const L = [
641
641
  o.collectionComponent.collection.removed.addEventListener(
642
642
  (a) => {
643
- var r;
644
- o.remove(a.name), ((r = e.value) == null ? void 0 : r.name) === a.name && h();
643
+ var v;
644
+ o.remove(a.name), ((v = t.value) == null ? void 0 : v.name) === a.name && m();
645
645
  }
646
646
  ),
647
- o.renamed.addEventListener(({ item: a, title: r }) => {
648
- var v;
649
- const _ = i.windowManager.get(
647
+ o.renamed.addEventListener(({ item: a, title: v }) => {
648
+ var C;
649
+ const u = i.windowManager.get(
650
650
  `${o.collectionComponent.id}-editor`
651
651
  );
652
- _ && ((v = e.value) == null ? void 0 : v.name) === a.name && (_.state.headerTitle = r);
652
+ u && ((C = t.value) == null ? void 0 : C.name) === a.name && (u.state.headerTitle = v);
653
653
  }),
654
654
  o.visibilityChanged.addEventListener((a) => {
655
- var _;
656
- const r = ((_ = e.value) == null ? void 0 : _.name) === a.name;
657
- r ? h() : (N(y.VIEW, a), o.clearSelection()), o.setVisibility(a.name, !r);
655
+ var u;
656
+ const v = ((u = t.value) == null ? void 0 : u.name) === a.name;
657
+ v ? m() : (S(E.VIEW, a), o.clearSelection()), o.setVisibility(a.name, !v);
658
658
  })
659
659
  ];
660
- function L(a) {
661
- if (!(a === d.value || !e.value)) {
662
- if (d.value = a, n.value === y.MOVE && l(), n.value === y.CREATE)
663
- ee(
660
+ function T(a) {
661
+ if (!(a === r.value || !t.value)) {
662
+ if (r.value = a, n.value === E.MOVE && l(), n.value === E.CREATE)
663
+ ie(
664
664
  i.maps.eventHandler.featureInteraction,
665
665
  a
666
- ), e.value.heightOffset = a === P.ABSOLUTE ? 0 : ge;
667
- else if (n.value === y.EDIT) {
668
- const { position: r, heightOffset: _ } = e.value;
669
- a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(r)]).then((v) => {
670
- const E = z.mercatorToWgs84(v[0]);
671
- e.value && (e.value.heightOffset = r[2] - E[2], e.value.position = E);
672
- }) : (e.value.position = [
673
- r[0],
674
- r[1],
675
- r[2] + _
676
- ], e.value.heightOffset = 0);
666
+ ), t.value.heightOffset = a === P.ABSOLUTE ? 0 : _e;
667
+ else if (n.value === E.EDIT) {
668
+ const { position: v, heightOffset: u } = t.value;
669
+ a === P.RELATIVE ? i.maps.activeMap.getHeightFromTerrain([z.wgs84ToMercator(v)]).then((C) => {
670
+ const V = z.mercatorToWgs84(C[0]);
671
+ t.value && (t.value.heightOffset = v[2] - V[2], t.value.position = V);
672
+ }) : (t.value.position = [
673
+ v[0],
674
+ v[1],
675
+ v[2] + u
676
+ ], t.value.heightOffset = 0);
677
677
  }
678
678
  }
679
679
  }
680
680
  return {
681
- currentViewshed: e,
681
+ currentViewshed: t,
682
682
  currentIsPersisted: s,
683
- currentEditSession: c,
684
- createViewshed: g,
683
+ currentEditSession: w,
684
+ currentFeatures: c,
685
+ createViewshed: y,
685
686
  viewViewshed(a) {
686
- N(y.VIEW, a);
687
+ S(E.VIEW, a);
687
688
  },
688
689
  editViewshed(a) {
689
- N(y.EDIT, a), s.value && (o.setSelection(a.name), o.collectionComponent.openEditorWindow(a));
690
+ S(E.EDIT, a), s.value && (o.setSelection(a.name), o.collectionComponent.openEditorWindow(a));
690
691
  },
691
692
  persistCurrent() {
692
- e.value && (o.add(e.value), s.value = !0, o.setSelection(e.value.name), o.setVisibility(e.value.name, !0));
693
+ t.value && (o.add(t.value), s.value = !0, o.setSelection(t.value.name), o.setVisibility(t.value.name, !0));
693
694
  },
694
- moveCurrentViewshed: V,
695
+ moveCurrentViewshed: x,
695
696
  setupMultiSelect() {
696
- l(), n.value = y.MULTI_SELECT, u(), e.value = null;
697
+ l(), n.value = E.MULTI_SELECT, f(), t.value = null;
697
698
  },
698
699
  mode: n,
699
- heightMode: d,
700
- changeHeightMode: L,
700
+ heightMode: r,
701
+ changeHeightMode: T,
701
702
  async placeCurrentFeaturesOnTerrain() {
702
- var a, r;
703
- if (e.value && ((a = c.value) == null ? void 0 : a.type) === Ne.EDIT_FEATURES && i.maps.activeMap instanceof $) {
704
- const v = (await i.maps.activeMap.getHeightFromTerrain([
705
- z.wgs84ToMercator((r = e.value) == null ? void 0 : r.position)
706
- ]))[0][2] - e.value.position[2];
707
- c.value.translate(0, 0, v);
703
+ var a, v;
704
+ if (t.value && ((a = w.value) == null ? void 0 : a.type) === De.EDIT_FEATURES && i.maps.activeMap instanceof U) {
705
+ const C = (await i.maps.activeMap.getHeightFromTerrain([
706
+ z.wgs84ToMercator((v = t.value) == null ? void 0 : v.position)
707
+ ]))[0][2] - t.value.position[2];
708
+ w.value.translate(0, 0, C);
708
709
  }
709
710
  },
710
- stop: h,
711
+ stop: m,
711
712
  destroy() {
712
- h(), S.forEach((a) => a());
713
+ m(), L.forEach((a) => a());
713
714
  }
714
715
  };
715
716
  }
716
- const Se = (i, t) => {
717
+ const Oe = (i, e) => {
717
718
  const o = i.__vccOpts || i;
718
- for (const [e, s] of t)
719
- o[e] = s;
719
+ for (const [t, s] of e)
720
+ o[t] = s;
720
721
  return o;
721
722
  }, Ft = {
722
- distance: [x.MIN_DISTANCE, 2e3],
723
+ distance: [D.MIN_DISTANCE, 2e3],
723
724
  fov: [25, 85],
724
725
  heading: [0, 360],
725
726
  pitch: [-90, 90]
726
727
  }, jt = {
727
728
  components: {
728
- VcsTextField: rt,
729
- VContainer: ye,
730
- VRow: Ve,
731
- VCol: be,
732
- VcsSlider: lt,
733
- VcsLabel: _e,
734
- VcsFormSection: Ce,
729
+ VcsTextField: lt,
730
+ VContainer: Ve,
731
+ VRow: be,
732
+ VCol: Me,
733
+ VcsSlider: dt,
734
+ VcsLabel: Ce,
735
+ VcsFormSection: Ee,
735
736
  VDivider: Ct,
736
- VcsSelect: Ee,
737
- VcsFormButton: dt,
738
- VcsFeatureTransforms: ct,
739
- VcsHelp: ut
737
+ VcsSelect: ye,
738
+ VcsFormButton: ct,
739
+ VcsFeatureTransforms: ut,
740
+ VcsHelp: ht
740
741
  },
741
742
  name: "ViewshedWindow",
742
743
  props: {
@@ -752,164 +753,164 @@ const Se = (i, t) => {
752
753
  }
753
754
  },
754
755
  setup(i) {
755
- var _;
756
- const t = (
756
+ var v;
757
+ const e = (
757
758
  /** @type {import("./viewshedManager.js").ViewshedManager} */
758
759
  me("manager")
759
760
  ), o = (
760
761
  /** @type {import("@vcmap/ui").VcsUiApp} */
761
762
  me("vcsApp")
762
763
  ), {
763
- currentViewshed: e,
764
+ currentViewshed: t,
764
765
  mode: s,
765
766
  currentIsPersisted: n
766
- } = t, d = U(
767
- ((_ = o.maps.activeMap) == null ? void 0 : _.movementApiCallsDisabled) ?? !1
767
+ } = e, r = $(
768
+ ((v = o.maps.activeMap) == null ? void 0 : v.movementApiCallsDisabled) ?? !1
768
769
  );
769
770
  let l = () => {
770
771
  };
771
- const c = ve(() => i.selection);
772
- let C = () => {
772
+ const w = ve(() => i.selection);
773
+ let c = () => {
773
774
  };
774
- const u = q({
775
+ const d = J({
775
776
  X: void 0,
776
777
  Y: void 0,
777
778
  Z: void 0
778
- }), h = te();
779
- let w = () => {
779
+ }), f = q();
780
+ let m = () => {
780
781
  };
781
- const g = q({
782
+ const _ = J({
782
783
  showPrimitive: !1,
783
784
  distance: void 0,
784
785
  fov: void 0,
785
786
  heading: void 0,
786
787
  pitch: void 0
787
- }), V = U();
788
- function N() {
789
- e.value && (u.X = e.value.position[0], u.Y = e.value.position[1], u.Z = t.heightMode.value === P.ABSOLUTE ? e.value.position[2] : e.value.heightOffset);
788
+ }), y = $();
789
+ function x() {
790
+ t.value && (d.X = t.value.position[0], d.Y = t.value.position[1], d.Z = e.heightMode.value === P.ABSOLUTE ? t.value.position[2] : t.value.heightOffset);
790
791
  }
791
792
  function S() {
792
- N(), e.value && (g.distance = e.value.distance, g.fov = e.value.fov, g.heading = e.value.heading, g.pitch = e.value.pitch, g.showPrimitive = e.value.showPrimitive, V.value = e.value.type);
793
+ x(), t.value && (_.distance = t.value.distance, _.fov = t.value.fov, _.heading = t.value.heading, _.pitch = t.value.pitch, _.showPrimitive = t.value.showPrimitive, y.value = t.value.type);
793
794
  }
794
- qe(() => {
795
- e.value && s.value !== y.CREATE && S();
795
+ Qe(() => {
796
+ t.value && s.value !== E.CREATE && S();
796
797
  }), G(
797
- e,
798
+ t,
798
799
  () => {
799
- e.value && (C(), C = e.value.positionChanged.addEventListener(() => {
800
- N(), w();
800
+ t.value && (c(), c = t.value.positionChanged.addEventListener(() => {
801
+ x(), m();
801
802
  }));
802
803
  },
803
804
  { immediate: !0 }
804
805
  );
805
806
  async function L() {
806
- var T, O;
807
- (T = e.value) == null || T.deactivate();
808
- const v = (
807
+ var V, O;
808
+ (V = t.value) == null || V.deactivate();
809
+ const u = (
809
810
  /** @type {import("@vcmap/core").CesiumMap} */
810
811
  (O = o.maps.activeMap.getScene()) == null ? void 0 : O.camera
811
- ), E = v == null ? void 0 : v.changed.addEventListener(() => {
812
- w();
812
+ ), C = u == null ? void 0 : u.changed.addEventListener(() => {
813
+ m();
813
814
  });
814
- w = () => {
815
- var le;
816
- E == null || E(), h.value = null, (le = e.value) == null || le.activate(o.maps.activeMap), w = () => {
815
+ m = () => {
816
+ var K;
817
+ C == null || C(), f.value = null, (K = t.value) == null || K.activate(o.maps.activeMap), m = () => {
817
818
  };
818
819
  };
819
820
  }
820
- Qe(() => {
821
- var E, T;
822
- const v = (E = i.getViewshed) == null ? void 0 : E.call(i);
823
- v && t.editViewshed(v), l = (T = o.maps.activeMap) == null ? void 0 : T.movementDisabledChanged.addEventListener(
821
+ et(() => {
822
+ var C, V;
823
+ const u = (C = i.getViewshed) == null ? void 0 : C.call(i);
824
+ u && e.editViewshed(u), l = (V = o.maps.activeMap) == null ? void 0 : V.movementDisabledChanged.addEventListener(
824
825
  (O) => {
825
- d.value = O.apiCalls;
826
+ r.value = O.apiCalls;
826
827
  }
827
828
  );
828
- }), et(() => {
829
- C(), w(), l(), n.value || ((s.value === y.EDIT || s.value === y.MOVE) && e.value ? t.viewViewshed(e.value) : s.value === y.CREATE && t.stop()), c.value && (c.value.length > 1 ? t.setupMultiSelect() : c.value.length === 1 && e.value ? t.viewViewshed(e.value) : (
829
+ }), tt(() => {
830
+ c(), m(), l(), n.value || ((s.value === E.EDIT || s.value === E.MOVE) && t.value ? e.viewViewshed(t.value) : s.value === E.CREATE && e.stop()), w.value && (w.value.length > 1 ? e.setupMultiSelect() : w.value.length === 1 && t.value ? e.viewViewshed(t.value) : (
830
831
  // when a persited viewshed is deselected, stops plugin
831
- !c.value.length && s.value === y.EDIT && t.stop(!1)
832
+ !w.value.length && s.value === E.EDIT && e.stop(!1)
832
833
  ));
833
834
  }), S();
834
- function a(v, E) {
835
- w(), e.value && (g[v] = E, e.value[v] = E);
835
+ function T(u, C) {
836
+ m(), t.value && (_[u] = C, t.value[u] = C);
836
837
  }
837
- const r = ve(() => {
838
- const v = [];
839
- return V.value === p.CONE && v.push({
838
+ const a = ve(() => {
839
+ const u = [];
840
+ return y.value === g.CONE && u.push({
840
841
  name: "jumpToViewpoint",
841
- title: h.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
842
+ title: f.value ? "viewshed.returnToViewpoint" : "viewshed.jumpToViewpoint",
842
843
  icon: "mdi-human-male",
843
- active: !!h.value,
844
- disabled: d.value,
844
+ active: !!f.value,
845
+ disabled: r.value,
845
846
  async callback() {
846
- var E, T, O;
847
- t.moveCurrentViewshed(!1), e.value && !h.value ? (h.value = await ((E = o.maps.activeMap) == null ? void 0 : E.getViewpoint()), await ((T = o.maps.activeMap) == null ? void 0 : T.gotoViewpoint(
848
- new We({
847
+ var C, V, O;
848
+ e.moveCurrentViewshed(!1), t.value && !f.value ? (f.value = await ((C = o.maps.activeMap) == null ? void 0 : C.getViewpoint()), await ((V = o.maps.activeMap) == null ? void 0 : V.gotoViewpoint(
849
+ new Be({
849
850
  groundPosition: [
850
- e.value.position[0],
851
- e.value.position[1],
852
- e.value.position[2] + e.value.heightOffset
851
+ t.value.position[0],
852
+ t.value.position[1],
853
+ t.value.position[2] + t.value.heightOffset
853
854
  ],
854
- heading: e.value.heading,
855
- pitch: e.value.pitch,
855
+ heading: t.value.heading,
856
+ pitch: t.value.pitch,
856
857
  distance: 0,
857
858
  animate: !0
858
859
  // if not animate, async does not work and the cameraChanged listener is triggered immediately. alternatively set timeout
859
860
  })
860
- )), L()) : h.value && ((O = o.maps.activeMap) == null || O.gotoViewpoint(h.value), w());
861
+ )), L()) : f.value && ((O = o.maps.activeMap) == null || O.gotoViewpoint(f.value), m());
861
862
  }
862
- }), v.push({
863
+ }), u.push({
863
864
  name: "moveViewshed",
864
865
  title: "viewshed.move",
865
- icon: t.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
866
- active: s.value === y.MOVE,
866
+ icon: e.heightMode.value === P.RELATIVE ? "$vcsEditVertices" : "mdi-axis-arrow",
867
+ active: s.value === E.MOVE,
867
868
  callback() {
868
- t.moveCurrentViewshed(
869
- s.value !== y.MOVE
869
+ e.moveCurrentViewshed(
870
+ s.value !== E.MOVE
870
871
  );
871
872
  }
872
- }), v.unshift({
873
+ }), u.unshift({
873
874
  name: "showPrimitive",
874
875
  title: "viewshed.showPrimitive",
875
876
  icon: "mdi-eye",
876
- active: g.showPrimitive,
877
+ active: _.showPrimitive,
877
878
  callback() {
878
- this.active = !this.active, a("showPrimitive", this.active);
879
+ this.active = !this.active, T("showPrimitive", this.active);
879
880
  }
880
- }), v;
881
+ }), u;
881
882
  });
882
883
  return {
883
- position: u,
884
- setPosition(v, E, T) {
885
- if (w(), !!e.value) {
886
- if (T === 2 && t.heightMode.value === P.RELATIVE)
887
- e.value.heightOffset = Number(v);
884
+ position: d,
885
+ setPosition(u, C, V) {
886
+ if (m(), !!t.value) {
887
+ if (V === 2 && e.heightMode.value === P.RELATIVE)
888
+ t.value.heightOffset = Number(u);
888
889
  else {
889
- const O = [...e.value.position];
890
- O[T] = Number(v), e.value.position = O;
890
+ const O = [...t.value.position];
891
+ O[V] = Number(u), t.value.position = O;
891
892
  }
892
- u[E] = Number(v);
893
+ d[C] = Number(u);
893
894
  }
894
895
  },
895
- parameters: g,
896
- setParameter: a,
896
+ parameters: _,
897
+ setParameter: T,
897
898
  parameterRanges: Ft,
898
- ViewshedPluginModes: y,
899
+ ViewshedPluginModes: E,
899
900
  viewshedMode: s,
900
901
  currentIsPersisted: n,
901
- viewshedType: V,
902
- ViewshedTypes: p,
902
+ viewshedType: y,
903
+ ViewshedTypes: g,
903
904
  HeightModes: P,
904
- heightMode: t.heightMode,
905
- TransformationMode: Be,
906
- changeHeightMode: t.changeHeightMode,
905
+ heightMode: e.heightMode,
906
+ TransformationMode: Ue,
907
+ changeHeightMode: e.changeHeightMode,
907
908
  async createNewViewshed() {
908
- await t.createViewshed(V.value);
909
+ await e.createViewshed(y.value);
909
910
  },
910
- addToMyWorkspace: () => t.persistCurrent(),
911
- cancel: () => t.stop(),
912
- headerActions: r
911
+ addToMyWorkspace: () => e.persistCurrent(),
912
+ cancel: () => e.stop(),
913
+ headerActions: a
913
914
  };
914
915
  }
915
916
  }, Wt = { key: 0 }, Bt = { class: "px-1 py-0" }, Ut = { key: 0 }, $t = { key: 1 }, Ht = {
@@ -919,12 +920,12 @@ const Se = (i, t) => {
919
920
  key: 4,
920
921
  class: "d-flex w-full justify-end px-2 pt-2 pb-1"
921
922
  };
922
- function Gt(i, t, o, e, s, n) {
923
- const d = b("VcsHelp"), l = b("v-row"), c = b("VcsFeatureTransforms"), C = b("VcsTextField"), u = b("v-col"), h = b("v-container"), w = b("VcsFormSection"), g = b("v-divider"), V = b("VcsLabel"), N = b("VcsSelect"), S = b("VcsSlider"), L = b("VcsFormButton");
923
+ function Gt(i, e, o, t, s, n) {
924
+ const r = b("VcsHelp"), l = b("v-row"), w = b("VcsFeatureTransforms"), c = b("VcsTextField"), d = b("v-col"), f = b("v-container"), m = b("VcsFormSection"), _ = b("v-divider"), y = b("VcsLabel"), x = b("VcsSelect"), S = b("VcsSlider"), L = b("VcsFormButton");
924
925
  return M(), B("div", null, [
925
- e.viewshedMode === e.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
926
- e.viewshedType === e.ViewshedTypes.CONE ? (M(), D(d, { key: 0 }, {
927
- default: f(() => [
926
+ t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", Wt, [
927
+ t.viewshedType === t.ViewshedTypes.CONE ? (M(), N(r, { key: 0 }, {
928
+ default: h(() => [
928
929
  F(
929
930
  A(i.$t("viewshed.createDescription")),
930
931
  1
@@ -933,8 +934,8 @@ function Gt(i, t, o, e, s, n) {
933
934
  ]),
934
935
  _: 1
935
936
  /* STABLE */
936
- })) : e.viewshedType === e.ViewshedTypes.THREESIXTY ? (M(), D(d, { key: 1 }, {
937
- default: f(() => [
937
+ })) : t.viewshedType === t.ViewshedTypes.THREESIXTY ? (M(), N(r, { key: 1 }, {
938
+ default: h(() => [
938
939
  F(
939
940
  A(i.$t("viewshed.createThreeSixtyDescription")),
940
941
  1
@@ -944,18 +945,18 @@ function Gt(i, t, o, e, s, n) {
944
945
  _: 1
945
946
  /* STABLE */
946
947
  })) : H("v-if", !0)
947
- ])) : e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), D(w, {
948
+ ])) : t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(m, {
948
949
  key: 1,
949
- "header-actions": e.headerActions,
950
+ "header-actions": t.headerActions,
950
951
  heading: "viewshed.viewpoint",
951
952
  "action-button-list-overflow-count": 3
952
953
  }, {
953
- default: f(() => [
954
- m(h, { class: "px-1 py-0" }, {
955
- default: f(() => [
956
- m(l, { "no-gutters": "" }, {
957
- default: f(() => [
958
- tt(
954
+ default: h(() => [
955
+ p(f, { class: "px-1 py-0" }, {
956
+ default: h(() => [
957
+ p(l, { "no-gutters": "" }, {
958
+ default: h(() => [
959
+ it(
959
960
  "span",
960
961
  Bt,
961
962
  A(i.$t("viewshed.position")),
@@ -966,13 +967,13 @@ function Gt(i, t, o, e, s, n) {
966
967
  _: 1
967
968
  /* STABLE */
968
969
  }),
969
- e.viewshedMode === e.ViewshedPluginModes.MOVE && e.heightMode === e.HeightModes.ABSOLUTE ? (M(), D(l, {
970
+ t.viewshedMode === t.ViewshedPluginModes.MOVE && t.heightMode === t.HeightModes.ABSOLUTE ? (M(), N(l, {
970
971
  key: 0,
971
972
  "no-gutters": ""
972
973
  }, {
973
- default: f(() => [
974
- m(c, {
975
- "transformation-mode": e.TransformationMode.TRANSLATE,
974
+ default: h(() => [
975
+ p(w, {
976
+ "transformation-mode": t.TransformationMode.TRANSLATE,
976
977
  "feature-properties": { altitudeMode: "absolute" },
977
978
  "allow-z-input": !0,
978
979
  class: "w-100"
@@ -980,31 +981,31 @@ function Gt(i, t, o, e, s, n) {
980
981
  ]),
981
982
  _: 1
982
983
  /* STABLE */
983
- })) : (M(), D(l, {
984
+ })) : (M(), N(l, {
984
985
  key: 1,
985
986
  "no-gutters": ""
986
987
  }, {
987
- default: f(() => [
988
+ default: h(() => [
988
989
  (M(!0), B(
989
990
  pe,
990
991
  null,
991
- we(e.position, (a, r, _) => (M(), D(
992
- u,
992
+ we(t.position, (T, a, v) => (M(), N(
993
+ d,
993
994
  {
994
- key: _,
995
+ key: v,
995
996
  class: "pb-1"
996
997
  },
997
998
  {
998
- default: f(() => [
999
- m(C, {
1000
- "model-value": a,
1001
- "onUpdate:modelValue": (v) => e.setPosition(v, r, _),
999
+ default: h(() => [
1000
+ p(c, {
1001
+ "model-value": T,
1002
+ "onUpdate:modelValue": (u) => t.setPosition(u, a, v),
1002
1003
  type: "number",
1003
- prefix: r,
1004
- step: r === "Z" ? 1 : 1e-4,
1005
- unit: r === "Z" ? "m" : "°",
1006
- decimals: r === "Z" ? 2 : 8,
1007
- disabled: e.viewshedMode === e.ViewshedPluginModes.MOVE && !(r === "Z" && e.heightMode === e.HeightModes.RELATIVE),
1004
+ prefix: a,
1005
+ step: a === "Z" ? 1 : 1e-4,
1006
+ unit: a === "Z" ? "m" : "°",
1007
+ decimals: a === "Z" ? 2 : 8,
1008
+ disabled: t.viewshedMode === t.ViewshedPluginModes.MOVE && !(a === "Z" && t.heightMode === t.HeightModes.RELATIVE),
1008
1009
  "hide-spin-buttons": !0
1009
1010
  }, null, 8, ["model-value", "onUpdate:modelValue", "prefix", "step", "unit", "decimals", "disabled"])
1010
1011
  ]),
@@ -1029,15 +1030,15 @@ function Gt(i, t, o, e, s, n) {
1029
1030
  _: 1
1030
1031
  /* STABLE */
1031
1032
  }, 8, ["header-actions"])) : H("v-if", !0),
1032
- m(g),
1033
- m(h, { class: "px-1 py-0" }, {
1034
- default: f(() => [
1035
- m(l, { "no-gutters": "" }, {
1036
- default: f(() => [
1037
- m(u, null, {
1038
- default: f(() => [
1039
- m(V, { "html-for": "heightMode" }, {
1040
- default: f(() => [
1033
+ p(_),
1034
+ p(f, { class: "px-1 py-0" }, {
1035
+ default: h(() => [
1036
+ p(l, { "no-gutters": "" }, {
1037
+ default: h(() => [
1038
+ p(d, null, {
1039
+ default: h(() => [
1040
+ p(y, { "html-for": "heightMode" }, {
1041
+ default: h(() => [
1041
1042
  F(
1042
1043
  A(i.$t("viewshed.heightMode")),
1043
1044
  1
@@ -1051,16 +1052,16 @@ function Gt(i, t, o, e, s, n) {
1051
1052
  _: 1
1052
1053
  /* STABLE */
1053
1054
  }),
1054
- m(u, null, {
1055
- default: f(() => [
1056
- m(N, {
1055
+ p(d, null, {
1056
+ default: h(() => [
1057
+ p(x, {
1057
1058
  id: "heightMode",
1058
- items: Object.values(e.HeightModes).map((a) => ({
1059
- value: a,
1060
- title: `viewshed.${a}`
1059
+ items: Object.values(t.HeightModes).map((T) => ({
1060
+ value: T,
1061
+ title: `viewshed.${T}`
1061
1062
  })),
1062
- "model-value": e.heightMode,
1063
- "onUpdate:modelValue": e.changeHeightMode
1063
+ "model-value": t.heightMode,
1064
+ "onUpdate:modelValue": t.changeHeightMode
1064
1065
  }, null, 8, ["items", "model-value", "onUpdate:modelValue"])
1065
1066
  ]),
1066
1067
  _: 1
@@ -1074,47 +1075,47 @@ function Gt(i, t, o, e, s, n) {
1074
1075
  _: 1
1075
1076
  /* STABLE */
1076
1077
  }),
1077
- e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), D(h, {
1078
+ t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), N(f, {
1078
1079
  key: 2,
1079
1080
  class: "px-1 pt-0 pb-2"
1080
1081
  }, {
1081
- default: f(() => [
1082
+ default: h(() => [
1082
1083
  (M(!0), B(
1083
1084
  pe,
1084
1085
  null,
1085
- we(e.parameters, (a, r) => (M(), D(
1086
+ we(t.parameters, (T, a) => (M(), N(
1086
1087
  l,
1087
1088
  {
1088
1089
  "no-gutters": "",
1089
- key: r
1090
+ key: a
1090
1091
  },
1091
1092
  {
1092
- default: f(() => [
1093
- r === "distance" || e.viewshedType === e.ViewshedTypes.CONE && r !== "showPrimitive" ? (M(), D(
1094
- u,
1093
+ default: h(() => [
1094
+ a === "distance" || t.viewshedType === t.ViewshedTypes.CONE && a !== "showPrimitive" ? (M(), N(
1095
+ d,
1095
1096
  { key: 0 },
1096
1097
  {
1097
- default: f(() => [
1098
- m(
1098
+ default: h(() => [
1099
+ p(
1099
1100
  l,
1100
1101
  {
1101
1102
  "no-gutters": "",
1102
1103
  class: "px-1"
1103
1104
  },
1104
1105
  {
1105
- default: f(() => [
1106
- m(
1107
- u,
1106
+ default: h(() => [
1107
+ p(
1108
+ d,
1108
1109
  null,
1109
1110
  {
1110
- default: f(() => [
1111
- m(V, {
1112
- "html-for": r,
1111
+ default: h(() => [
1112
+ p(y, {
1113
+ "html-for": a,
1113
1114
  class: "py-0"
1114
1115
  }, {
1115
- default: f(() => [
1116
+ default: h(() => [
1116
1117
  F(
1117
- A(i.$t(`viewshed.${r}`)),
1118
+ A(i.$t(`viewshed.${a}`)),
1118
1119
  1
1119
1120
  /* TEXT */
1120
1121
  )
@@ -1129,21 +1130,21 @@ function Gt(i, t, o, e, s, n) {
1129
1130
  1024
1130
1131
  /* DYNAMIC_SLOTS */
1131
1132
  ),
1132
- m(
1133
- u,
1133
+ p(
1134
+ d,
1134
1135
  { class: "d-flex justify-end align-center" },
1135
1136
  {
1136
- default: f(() => [
1137
- r === "distance" ? (M(), B(
1137
+ default: h(() => [
1138
+ a === "distance" ? (M(), B(
1138
1139
  "span",
1139
1140
  Ut,
1140
- A(`${Math.round(a)} m`),
1141
+ A(`${Math.round(T)} m`),
1141
1142
  1
1142
1143
  /* TEXT */
1143
1144
  )) : (M(), B(
1144
1145
  "span",
1145
1146
  $t,
1146
- A(`${Math.round(a)} °`),
1147
+ A(`${Math.round(T)} °`),
1147
1148
  1
1148
1149
  /* TEXT */
1149
1150
  ))
@@ -1161,25 +1162,25 @@ function Gt(i, t, o, e, s, n) {
1161
1162
  1024
1162
1163
  /* DYNAMIC_SLOTS */
1163
1164
  ),
1164
- m(
1165
+ p(
1165
1166
  l,
1166
1167
  { "no-gutters": "" },
1167
1168
  {
1168
- default: f(() => [
1169
- m(
1170
- u,
1169
+ default: h(() => [
1170
+ p(
1171
+ d,
1171
1172
  null,
1172
1173
  {
1173
- default: f(() => [
1174
- m(S, {
1175
- id: r,
1174
+ default: h(() => [
1175
+ p(S, {
1176
+ id: a,
1176
1177
  class: "pa-0",
1177
- "model-value": a,
1178
- "onUpdate:modelValue": (_) => e.setParameter(r, _),
1178
+ "model-value": T,
1179
+ "onUpdate:modelValue": (v) => t.setParameter(a, v),
1179
1180
  type: "number",
1180
1181
  step: "1",
1181
- min: e.parameterRanges[r][0],
1182
- max: e.parameterRanges[r][1]
1182
+ min: t.parameterRanges[a][0],
1183
+ max: t.parameterRanges[a][1]
1183
1184
  }, null, 8, ["id", "model-value", "onUpdate:modelValue", "min", "max"])
1184
1185
  ]),
1185
1186
  _: 2
@@ -1216,19 +1217,19 @@ function Gt(i, t, o, e, s, n) {
1216
1217
  _: 1
1217
1218
  /* STABLE */
1218
1219
  })) : H("v-if", !0),
1219
- m(g),
1220
- e.viewshedMode === e.ViewshedPluginModes.EDIT || e.viewshedMode === e.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
1221
- m(L, {
1222
- onClick: t[0] || (t[0] = (a) => e.addToMyWorkspace()),
1220
+ p(_),
1221
+ t.viewshedMode === t.ViewshedPluginModes.EDIT || t.viewshedMode === t.ViewshedPluginModes.MOVE ? (M(), B("div", Ht, [
1222
+ p(L, {
1223
+ onClick: e[0] || (e[0] = (T) => t.addToMyWorkspace()),
1223
1224
  tooltip: "viewshed.addToMyWorkspace",
1224
1225
  icon: "$vcsComponentsPlus",
1225
- disabled: e.currentIsPersisted || void 0
1226
+ disabled: t.currentIsPersisted || void 0
1226
1227
  }, null, 8, ["disabled"]),
1227
- m(L, {
1228
- onClick: t[1] || (t[1] = (a) => e.createNewViewshed()),
1228
+ p(L, {
1229
+ onClick: e[1] || (e[1] = (T) => t.createNewViewshed()),
1229
1230
  variant: "filled"
1230
1231
  }, {
1231
- default: f(() => [
1232
+ default: h(() => [
1232
1233
  F(
1233
1234
  A(i.$t("viewshed.new")),
1234
1235
  1
@@ -1238,12 +1239,12 @@ function Gt(i, t, o, e, s, n) {
1238
1239
  _: 1
1239
1240
  /* STABLE */
1240
1241
  })
1241
- ])) : e.viewshedMode === e.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
1242
- m(L, {
1243
- onClick: t[2] || (t[2] = (a) => e.cancel()),
1242
+ ])) : t.viewshedMode === t.ViewshedPluginModes.CREATE ? (M(), B("div", zt, [
1243
+ p(L, {
1244
+ onClick: e[2] || (e[2] = (T) => t.cancel()),
1244
1245
  variant: "outlined"
1245
1246
  }, {
1246
- default: f(() => [
1247
+ default: h(() => [
1247
1248
  F(
1248
1249
  A(i.$t("viewshed.cancel")),
1249
1250
  1
@@ -1256,148 +1257,168 @@ function Gt(i, t, o, e, s, n) {
1256
1257
  ])) : H("v-if", !0)
1257
1258
  ]);
1258
1259
  }
1259
- const Kt = /* @__PURE__ */ Se(jt, [["render", Gt]]), j = "@vcmap/viewshed", Yt = "3.0.2", Xt = "^6.0", se = {
1260
- [p.CONE]: "$vcsViewshed",
1261
- [p.THREESIXTY]: "$vcsViewshedCone"
1260
+ const Kt = /* @__PURE__ */ Oe(jt, [["render", Gt]]), j = "@vcmap/viewshed", Yt = "3.0.5", Xt = "^6.0", ne = {
1261
+ [g.CONE]: "$vcsViewshed",
1262
+ [g.THREESIXTY]: "$vcsViewshedCone"
1262
1263
  };
1263
- function Jt(i, t, o) {
1264
- const e = U(), s = U(), n = `${o.id}-editor`, d = {
1264
+ function Jt(i, e, o) {
1265
+ const t = $(), s = $(), n = `${o.id}-editor`, r = {
1265
1266
  component: Kt,
1266
1267
  provides: {
1267
1268
  manager: i
1268
1269
  },
1269
1270
  state: {
1270
- headerTitle: e,
1271
+ headerTitle: t,
1271
1272
  headerIcon: s,
1272
1273
  styles: { width: "280px", height: "auto" },
1273
- infoUrlCallback: t.getHelpUrlCallback("tools/viewshed.html")
1274
+ infoUrlCallback: e.getHelpUrlCallback("tools/viewshed.html")
1274
1275
  }
1275
1276
  };
1276
- ht(t, o, {
1277
- editor: (w) => ({
1278
- ...d,
1277
+ ft(e, o, {
1278
+ editor: (m) => ({
1279
+ ...r,
1279
1280
  props: {
1280
1281
  selection: o.selection,
1281
- getViewshed: () => o.collection.getByKey(w.name)
1282
+ getViewshed: () => o.collection.getByKey(m.name)
1282
1283
  }
1283
1284
  })
1284
1285
  });
1285
1286
  function l() {
1286
- i.currentViewshed.value && (s.value = se[i.currentViewshed.value.type], i.currentIsPersisted.value ? e.value = i.currentViewshed.value.properties.title : i.mode.value === y.CREATE ? e.value = `viewshed.create.${i.currentViewshed.value.type}` : e.value = [
1287
+ i.currentViewshed.value && (s.value = ne[i.currentViewshed.value.type], i.currentIsPersisted.value ? t.value = i.currentViewshed.value.properties.title : i.mode.value === E.CREATE ? t.value = `viewshed.create.${i.currentViewshed.value.type}` : t.value = [
1287
1288
  "viewshed.temporary",
1288
1289
  `viewshed.${i.currentViewshed.value.type}`
1289
1290
  ]);
1290
1291
  }
1291
- function c() {
1292
- l(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value === y.EDIT || i.mode.value === y.MOVE || i.mode.value === y.CREATE) && (t.windowManager.has(n) || t.windowManager.add(
1292
+ function w() {
1293
+ l(), i.currentViewshed.value && !i.currentIsPersisted.value && (i.mode.value === E.EDIT || i.mode.value === E.MOVE || i.mode.value === E.CREATE) && (e.windowManager.has(n) || e.windowManager.add(
1293
1294
  {
1294
- ...d,
1295
+ ...r,
1295
1296
  id: n,
1296
1297
  parentId: "category-manager",
1297
- slot: ft.DYNAMIC_CHILD
1298
+ slot: mt.DYNAMIC_CHILD
1298
1299
  },
1299
1300
  j
1300
1301
  ));
1301
1302
  }
1302
- const C = G(i.currentViewshed, (w) => {
1303
- w && c();
1304
- }), u = G(i.currentIsPersisted, (w) => {
1305
- w && l();
1306
- }), h = G(i.mode, () => {
1307
- i.mode.value ? c() : t.windowManager.remove(n);
1303
+ const c = G(i.currentViewshed, (m) => {
1304
+ m && w();
1305
+ }), d = G(i.currentIsPersisted, (m) => {
1306
+ m && l();
1307
+ }), f = G(i.mode, () => {
1308
+ i.mode.value ? w() : e.windowManager.remove(n);
1308
1309
  });
1309
1310
  return {
1310
1311
  destroy() {
1311
- t.windowManager.remove(n), C(), h(), u();
1312
+ e.windowManager.remove(n), c(), f(), d();
1312
1313
  }
1313
1314
  };
1314
1315
  }
1315
- function Zt(i, t, o, e) {
1316
- const s = {
1317
- type: mt.SELECT,
1318
- action: q({
1319
- name: o,
1320
- currentIndex: 0,
1321
- active: !1,
1322
- background: !1,
1323
- disabled: !(i.maps.activeMap instanceof $),
1324
- callback() {
1325
- if (this.active)
1326
- this.background && t.currentViewshed.value ? t.editViewshed(t.currentViewshed.value) : t.stop();
1327
- else {
1328
- const c = this.tools[this.currentIndex].name;
1329
- t.createViewshed(c);
1316
+ function Zt(i, e, o, t) {
1317
+ function s(c) {
1318
+ return c === g.CONE ? {
1319
+ name: g.CONE,
1320
+ icon: ne[g.CONE],
1321
+ title: `viewshed.create.${g.CONE}`
1322
+ } : c === g.THREESIXTY ? {
1323
+ name: g.THREESIXTY,
1324
+ icon: ne[g.THREESIXTY],
1325
+ title: `viewshed.create.${g.THREESIXTY}`
1326
+ } : void 0;
1327
+ }
1328
+ let n, r;
1329
+ if (t.length === 1) {
1330
+ const c = s(t[0]);
1331
+ n = {
1332
+ type: ge.SINGLE,
1333
+ action: J({
1334
+ ...c,
1335
+ active: !1,
1336
+ background: !1,
1337
+ disabled: !(i.maps.activeMap instanceof U),
1338
+ callback() {
1339
+ this.active ? this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop() : e.createViewshed(c.name);
1330
1340
  }
1331
- },
1332
- selected(c) {
1333
- c !== this.currentIndex && (this.currentIndex = c);
1334
- const C = this.tools[this.currentIndex].name;
1335
- t.createViewshed(C);
1336
- },
1337
- tools: e.flatMap((c) => c === p.CONE ? {
1338
- name: p.CONE,
1339
- icon: se[p.CONE],
1340
- title: `viewshed.create.${p.CONE}`
1341
- } : c === p.THREESIXTY ? {
1342
- name: p.THREESIXTY,
1343
- icon: se[p.THREESIXTY],
1344
- title: `viewshed.create.${p.THREESIXTY}`
1345
- } : [])
1346
- })
1347
- }, n = G(t.mode, (c) => {
1348
- c === y.VIEW ? (s.action.background = !0, s.action.active = !0) : c ? (s.action.background = !1, s.action.active = !0) : (s.action.background = !1, s.action.active = !1);
1349
- }), d = G(
1350
- t.currentViewshed,
1351
- (c) => {
1352
- c && (s.action.currentIndex = s.action.tools.findIndex(
1353
- (C) => C.name === c.type
1354
- ));
1355
- }
1356
- ), l = i.maps.mapActivated.addEventListener((c) => {
1357
- c instanceof $ ? s.action.disabled = !1 : s.action.disabled = !0;
1341
+ })
1342
+ };
1343
+ } else
1344
+ n = {
1345
+ type: ge.SELECT,
1346
+ action: J({
1347
+ name: o,
1348
+ currentIndex: 0,
1349
+ active: !1,
1350
+ background: !1,
1351
+ disabled: !(i.maps.activeMap instanceof U),
1352
+ callback() {
1353
+ if (this.active)
1354
+ this.background && e.currentViewshed.value ? e.editViewshed(e.currentViewshed.value) : e.stop();
1355
+ else {
1356
+ const c = this.tools[this.currentIndex].name;
1357
+ e.createViewshed(c);
1358
+ }
1359
+ },
1360
+ selected(c) {
1361
+ c !== this.currentIndex && (this.currentIndex = c);
1362
+ const d = this.tools[this.currentIndex].name;
1363
+ e.createViewshed(d);
1364
+ },
1365
+ tools: t.flatMap(s)
1366
+ })
1367
+ }, r = G(
1368
+ e.currentViewshed,
1369
+ (c) => {
1370
+ c && (n.action.currentIndex = n.action.tools.findIndex(
1371
+ (d) => d.name === c.type
1372
+ ));
1373
+ }
1374
+ );
1375
+ const l = G(e.mode, (c) => {
1376
+ c === E.VIEW ? (n.action.background = !0, n.action.active = !0) : c ? (n.action.background = !1, n.action.active = !0) : (n.action.background = !1, n.action.active = !1);
1377
+ }), w = i.maps.mapActivated.addEventListener((c) => {
1378
+ c instanceof U ? n.action.disabled = !1 : n.action.disabled = !0;
1358
1379
  });
1359
1380
  return {
1360
1381
  destroy() {
1361
- n(), d(), l();
1382
+ l(), r == null || r(), w();
1362
1383
  },
1363
- toolbox: s
1384
+ toolbox: n
1364
1385
  };
1365
1386
  }
1366
- function qt(i, t, o, e) {
1367
- re(e, [Pt(p)]);
1368
- const { toolbox: s, destroy: n } = Zt(i, t, o, e), d = i.toolboxManager.add(s, o).id;
1387
+ function qt(i, e, o, t) {
1388
+ le(t, [Pt(g)]);
1389
+ const { toolbox: s, destroy: n } = Zt(i, e, o, t), r = i.toolboxManager.add(s, o).id;
1369
1390
  return () => {
1370
- i.toolboxManager.remove(d), n();
1391
+ i.toolboxManager.remove(r), n();
1371
1392
  };
1372
1393
  }
1373
- class ne extends Ue {
1394
+ class ae extends $e {
1374
1395
  static get className() {
1375
1396
  return "ViewshedCategory";
1376
1397
  }
1377
- async _deserializeItem(t) {
1378
- var e;
1398
+ async _deserializeItem(e) {
1399
+ var t;
1379
1400
  if (
1380
1401
  /** @type {import("@vcmap/core").CesiumMap | undefined} */
1381
- (e = this._app) == null ? void 0 : e.maps.getByType($.className)[0]
1402
+ (t = this._app) == null ? void 0 : t.maps.getByType(U.className)[0]
1382
1403
  )
1383
- return new x(t);
1404
+ return new D(e);
1384
1405
  throw new Error("No CesiumMap available");
1385
1406
  }
1386
1407
  }
1387
- function Qt(i, t) {
1388
- let o, e = 0;
1408
+ function Qt(i, e) {
1409
+ let o, t = 0;
1389
1410
  const s = new Set(
1390
- t.filter((n) => n.type === i).map((n) => n.properties.title)
1411
+ e.filter((n) => n.type === i).map((n) => n.properties.title)
1391
1412
  );
1392
1413
  do
1393
- e += 1, s.has(`${i}-${e}`) || (o = `${i}-${e}`);
1414
+ t += 1, s.has(`${i}-${t}`) || (o = `${i}-${t}`);
1394
1415
  while (!o);
1395
1416
  return o;
1396
1417
  }
1397
1418
  async function ei(i) {
1398
- const t = new Y(), o = new Y(), { collectionComponent: e, category: s } = await i.categoryManager.requestCategory(
1419
+ const e = new X(), o = new X(), { collectionComponent: t, category: s } = await i.categoryManager.requestCategory(
1399
1420
  {
1400
- type: ne.className,
1421
+ type: ae.className,
1401
1422
  name: "Viewsheds",
1402
1423
  title: "viewshed.viewshedCategory"
1403
1424
  },
@@ -1408,22 +1429,22 @@ async function ei(i) {
1408
1429
  removable: !0
1409
1430
  }
1410
1431
  );
1411
- e.addItemMapping({
1432
+ t.addItemMapping({
1412
1433
  mappingFunction: vt(
1413
- [$.className],
1434
+ [U.className],
1414
1435
  i.maps
1415
1436
  ),
1416
1437
  owner: j
1417
1438
  });
1418
- const n = (u, h, w) => {
1419
- w.title = u.properties.title, w.titleChanged = (g) => {
1420
- u.properties.title = g, w.title = g, t.raiseEvent({ item: u, title: g });
1421
- }, w.actions.push(
1422
- q({
1439
+ const n = (d, f, m) => {
1440
+ m.title = d.properties.title, m.titleChanged = (_) => {
1441
+ d.properties.title = _, m.title = _, e.raiseEvent({ item: d, title: _ });
1442
+ }, m.actions.push(
1443
+ J({
1423
1444
  name: "visibilityAction",
1424
1445
  icon: "$vcsCheckbox",
1425
1446
  callback() {
1426
- o.raiseEvent(u);
1447
+ o.raiseEvent(d);
1427
1448
  }
1428
1449
  })
1429
1450
  );
@@ -1432,51 +1453,51 @@ async function ei(i) {
1432
1453
  () => !0,
1433
1454
  n,
1434
1455
  j,
1435
- [e.id]
1456
+ [t.id]
1436
1457
  );
1437
- const { action: d, destroy: l } = pt(
1438
- e.selection,
1458
+ const { action: r, destroy: l } = pt(
1459
+ t.selection,
1439
1460
  () => {
1440
- const u = e.selection.value.map(
1441
- (h) => e.collection.getByKey(h.name)
1461
+ const d = t.selection.value.map(
1462
+ (f) => t.collection.getByKey(f.name)
1442
1463
  );
1443
- wt(JSON.stringify(u), "viewsheds.json");
1464
+ wt(JSON.stringify(d), "viewsheds.json");
1444
1465
  },
1445
1466
  j
1446
- ), { action: c, destroy: C } = gt(
1447
- async (u) => {
1448
- const { vueI18n: h } = i, g = (await Promise.all(
1449
- u.map(async (S) => {
1467
+ ), { action: w, destroy: c } = gt(
1468
+ async (d) => {
1469
+ const { vueI18n: f } = i, _ = (await Promise.all(
1470
+ d.map(async (S) => {
1450
1471
  const L = await S.text();
1451
1472
  try {
1452
- return JSON.parse(L).map((r) => new x(r));
1473
+ return JSON.parse(L).map((a) => new D(a));
1453
1474
  } catch {
1454
1475
  i.notifier.add({
1455
- type: X.ERROR,
1456
- message: h.t("components.import.failure", {
1476
+ type: Z.ERROR,
1477
+ message: f.t("components.import.failure", {
1457
1478
  fileName: S.name
1458
1479
  })
1459
1480
  });
1460
1481
  }
1461
1482
  return [];
1462
1483
  })
1463
- )).flat(), V = g.map((S) => s.collection.add(S)).filter((S) => S != null), N = g.length - V.length;
1464
- if (N > 0)
1484
+ )).flat(), y = _.map((S) => s.collection.add(S)).filter((S) => S != null), x = _.length - y.length;
1485
+ if (x > 0)
1465
1486
  return i.notifier.add({
1466
- type: X.WARNING,
1467
- message: h.t("components.import.addFailure", [N])
1487
+ type: Z.WARNING,
1488
+ message: f.t("components.import.addFailure", [x])
1468
1489
  }), !1;
1469
- if (V.length > 0)
1490
+ if (y.length > 0)
1470
1491
  i.notifier.add({
1471
- type: X.SUCCESS,
1472
- message: h.t("components.import.featuresAdded", [
1473
- V.length
1492
+ type: Z.SUCCESS,
1493
+ message: f.t("components.import.featuresAdded", [
1494
+ y.length
1474
1495
  ])
1475
1496
  });
1476
1497
  else
1477
1498
  return i.notifier.add({
1478
- type: X.ERROR,
1479
- message: h.t("components.import.nothingAdded")
1499
+ type: Z.ERROR,
1500
+ message: f.t("components.import.nothingAdded")
1480
1501
  }), !1;
1481
1502
  return !0;
1482
1503
  },
@@ -1484,62 +1505,62 @@ async function ei(i) {
1484
1505
  j,
1485
1506
  "category-manager"
1486
1507
  );
1487
- return e.addActions([d, c]), {
1488
- renamed: t,
1508
+ return t.addActions([r, w]), {
1509
+ renamed: e,
1489
1510
  visibilityChanged: o,
1490
- setSelection(u) {
1491
- u && (e.selection.value = e.items.value.filter((h) => u === h.name));
1511
+ setSelection(d) {
1512
+ d && (t.selection.value = t.items.value.filter((f) => d === f.name));
1492
1513
  },
1493
1514
  clearSelection() {
1494
- e.selection.value.length && (e.selection.value = []);
1515
+ t.selection.value.length && (t.selection.value = []);
1495
1516
  },
1496
- setVisibility(u, h) {
1497
- const w = e.items.value.find(
1498
- (g) => u === g.name
1517
+ setVisibility(d, f) {
1518
+ const m = t.items.value.find(
1519
+ (_) => d === _.name
1499
1520
  );
1500
- if (w) {
1501
- const g = w.actions.find(
1502
- (V) => V.name === "visibilityAction"
1521
+ if (m) {
1522
+ const _ = m.actions.find(
1523
+ (y) => y.name === "visibilityAction"
1503
1524
  );
1504
- g && (g.icon = h ? "$vcsCheckboxChecked" : "$vcsCheckbox");
1525
+ _ && (_.icon = f ? "$vcsCheckboxChecked" : "$vcsCheckbox");
1505
1526
  }
1506
1527
  },
1507
- add(u) {
1508
- u.properties.title = Qt(
1509
- u.type,
1528
+ add(d) {
1529
+ d.properties.title = Qt(
1530
+ d.type,
1510
1531
  /** @type {import("./viewshed.js").default[]} */
1511
1532
  [
1512
1533
  ...s.collection
1513
1534
  ]
1514
- ), s.collection.add(u);
1535
+ ), s.collection.add(d);
1515
1536
  },
1516
- remove(u) {
1517
- const h = s.collection.getByKey(u);
1518
- h && s.collection.remove(h);
1537
+ remove(d) {
1538
+ const f = s.collection.getByKey(d);
1539
+ f && s.collection.remove(f);
1519
1540
  },
1520
- collectionComponent: e,
1541
+ collectionComponent: t,
1521
1542
  destroy() {
1522
- i.categoryManager.removeOwner(j), t.destroy(), o.destroy(), l(), C();
1543
+ i.categoryManager.removeOwner(j), e.destroy(), o.destroy(), l(), c();
1523
1544
  }
1524
1545
  };
1525
1546
  }
1526
- function J() {
1547
+ function Q() {
1527
1548
  return {
1528
- visibleColor: x.getDefaultOptions().visibleColor,
1529
- shadowColor: x.getDefaultOptions().shadowColor,
1530
- tools: [...Object.values(p)]
1549
+ visibleColor: D.getDefaultOptions().visibleColor,
1550
+ shadowColor: D.getDefaultOptions().shadowColor,
1551
+ tools: [...Object.values(g)]
1531
1552
  };
1532
1553
  }
1533
1554
  const ti = {
1534
1555
  name: "ViewshedConfigEditor",
1535
1556
  components: {
1536
1557
  AbstractConfigEditor: _t,
1537
- VcsFormSection: Ce,
1538
- VContainer: ye,
1539
- VRow: Ve,
1540
- VCol: be,
1541
- VcsLabel: _e,
1542
- VcsSelect: Ee,
1558
+ VcsFormSection: Ee,
1559
+ VContainer: Ve,
1560
+ VRow: be,
1561
+ VCol: Me,
1562
+ VcsLabel: Ce,
1563
+ VcsSelect: ye,
1543
1564
  VColorPicker: Et
1544
1565
  },
1545
1566
  props: {
@@ -1553,38 +1574,38 @@ const ti = {
1553
1574
  }
1554
1575
  },
1555
1576
  setup(i) {
1556
- const t = i.getConfig(), o = U({ ...J(), ...t });
1557
- function e() {
1577
+ const e = i.getConfig(), o = $({ ...Q(), ...e });
1578
+ function t() {
1558
1579
  i.setConfig(o.value);
1559
1580
  }
1560
1581
  return {
1561
1582
  localConfig: o,
1562
- ViewshedTypes: p,
1563
- apply: e,
1564
- toolItems: Object.values(p).map((s) => ({
1583
+ ViewshedTypes: g,
1584
+ apply: t,
1585
+ toolItems: Object.values(g).map((s) => ({
1565
1586
  value: s,
1566
1587
  title: `viewshed.${s}`
1567
1588
  }))
1568
1589
  };
1569
1590
  }
1570
1591
  };
1571
- function ii(i, t, o, e, s, n) {
1572
- const d = b("VcsLabel"), l = b("v-col"), c = b("VcsSelect"), C = b("v-row"), u = b("VColorPicker"), h = b("v-container"), w = b("VcsFormSection"), g = b("AbstractConfigEditor");
1573
- return M(), D(g, it({ onSubmit: e.apply }, { ...i.$attrs, ...i.$props }), {
1574
- default: f(() => [
1575
- e.localConfig ? (M(), D(w, {
1592
+ function ii(i, e, o, t, s, n) {
1593
+ const r = b("VcsLabel"), l = b("v-col"), w = b("VcsSelect"), c = b("v-row"), d = b("VColorPicker"), f = b("v-container"), m = b("VcsFormSection"), _ = b("AbstractConfigEditor");
1594
+ return M(), N(_, ot({ onSubmit: t.apply }, { ...i.$attrs, ...i.$props }), {
1595
+ default: h(() => [
1596
+ t.localConfig ? (M(), N(m, {
1576
1597
  key: 0,
1577
1598
  heading: "viewshed.editor.general"
1578
1599
  }, {
1579
- default: f(() => [
1580
- m(h, { class: "px-1 py-0" }, {
1581
- default: f(() => [
1582
- m(C, { "no-gutters": "" }, {
1583
- default: f(() => [
1584
- m(l, null, {
1585
- default: f(() => [
1586
- m(d, { "html-for": "viewshed-editor-tools" }, {
1587
- default: f(() => [
1600
+ default: h(() => [
1601
+ p(f, { class: "px-1 py-0" }, {
1602
+ default: h(() => [
1603
+ p(c, { "no-gutters": "" }, {
1604
+ default: h(() => [
1605
+ p(l, null, {
1606
+ default: h(() => [
1607
+ p(r, { "html-for": "viewshed-editor-tools" }, {
1608
+ default: h(() => [
1588
1609
  F(
1589
1610
  A(i.$t("viewshed.editor.tools")),
1590
1611
  1
@@ -1598,13 +1619,13 @@ function ii(i, t, o, e, s, n) {
1598
1619
  _: 1
1599
1620
  /* STABLE */
1600
1621
  }),
1601
- m(l, null, {
1602
- default: f(() => [
1603
- m(c, {
1622
+ p(l, null, {
1623
+ default: h(() => [
1624
+ p(w, {
1604
1625
  id: "viewshed-tools",
1605
- items: e.toolItems,
1606
- modelValue: e.localConfig.tools,
1607
- "onUpdate:modelValue": t[0] || (t[0] = (V) => e.localConfig.tools = V),
1626
+ items: t.toolItems,
1627
+ modelValue: t.localConfig.tools,
1628
+ "onUpdate:modelValue": e[0] || (e[0] = (y) => t.localConfig.tools = y),
1608
1629
  multiple: !0
1609
1630
  }, null, 8, ["items", "modelValue"])
1610
1631
  ]),
@@ -1615,12 +1636,12 @@ function ii(i, t, o, e, s, n) {
1615
1636
  _: 1
1616
1637
  /* STABLE */
1617
1638
  }),
1618
- m(C, { "no-gutters": "" }, {
1619
- default: f(() => [
1620
- m(l, null, {
1621
- default: f(() => [
1622
- m(d, { "html-for": "viewshed-editor-visible-color" }, {
1623
- default: f(() => [
1639
+ p(c, { "no-gutters": "" }, {
1640
+ default: h(() => [
1641
+ p(l, null, {
1642
+ default: h(() => [
1643
+ p(r, { "html-for": "viewshed-editor-visible-color" }, {
1644
+ default: h(() => [
1624
1645
  F(
1625
1646
  A(i.$t("viewshed.editor.visibleColor")),
1626
1647
  1
@@ -1634,11 +1655,11 @@ function ii(i, t, o, e, s, n) {
1634
1655
  _: 1
1635
1656
  /* STABLE */
1636
1657
  }),
1637
- m(l, null, {
1638
- default: f(() => [
1639
- m(u, {
1640
- modelValue: e.localConfig.visibleColor,
1641
- "onUpdate:modelValue": t[1] || (t[1] = (V) => e.localConfig.visibleColor = V),
1658
+ p(l, null, {
1659
+ default: h(() => [
1660
+ p(d, {
1661
+ modelValue: t.localConfig.visibleColor,
1662
+ "onUpdate:modelValue": e[1] || (e[1] = (y) => t.localConfig.visibleColor = y),
1642
1663
  mode: "rgba"
1643
1664
  }, null, 8, ["modelValue"])
1644
1665
  ]),
@@ -1649,12 +1670,12 @@ function ii(i, t, o, e, s, n) {
1649
1670
  _: 1
1650
1671
  /* STABLE */
1651
1672
  }),
1652
- m(C, { "no-gutters": "" }, {
1653
- default: f(() => [
1654
- m(l, null, {
1655
- default: f(() => [
1656
- m(d, { "html-for": "viewshed-editor-shadow-color" }, {
1657
- default: f(() => [
1673
+ p(c, { "no-gutters": "" }, {
1674
+ default: h(() => [
1675
+ p(l, null, {
1676
+ default: h(() => [
1677
+ p(r, { "html-for": "viewshed-editor-shadow-color" }, {
1678
+ default: h(() => [
1658
1679
  F(
1659
1680
  A(i.$t("viewshed.editor.shadowColor")),
1660
1681
  1
@@ -1668,11 +1689,11 @@ function ii(i, t, o, e, s, n) {
1668
1689
  _: 1
1669
1690
  /* STABLE */
1670
1691
  }),
1671
- m(l, null, {
1672
- default: f(() => [
1673
- m(u, {
1674
- modelValue: e.localConfig.shadowColor,
1675
- "onUpdate:modelValue": t[2] || (t[2] = (V) => e.localConfig.shadowColor = V),
1692
+ p(l, null, {
1693
+ default: h(() => [
1694
+ p(d, {
1695
+ modelValue: t.localConfig.shadowColor,
1696
+ "onUpdate:modelValue": e[2] || (e[2] = (y) => t.localConfig.shadowColor = y),
1676
1697
  mode: "rgba"
1677
1698
  }, null, 8, ["modelValue"])
1678
1699
  ]),
@@ -1696,9 +1717,9 @@ function ii(i, t, o, e, s, n) {
1696
1717
  /* STABLE */
1697
1718
  }, 16, ["onSubmit"]);
1698
1719
  }
1699
- const oi = /* @__PURE__ */ Se(ti, [["render", ii]]);
1720
+ const oi = /* @__PURE__ */ Oe(ti, [["render", ii]]);
1700
1721
  function ui(i) {
1701
- let t, o, e = () => {
1722
+ let e, o, t = () => {
1702
1723
  };
1703
1724
  return {
1704
1725
  get name() {
@@ -1717,65 +1738,65 @@ function ui(i) {
1717
1738
  */
1718
1739
  async initialize(s, n) {
1719
1740
  o = s, s.categoryClassRegistry.registerClass(
1720
- this[$e],
1721
- ne.className,
1722
- ne
1741
+ this[He],
1742
+ ae.className,
1743
+ ae
1723
1744
  );
1724
- const d = await ei(s);
1725
- t = Lt(
1745
+ const r = await ei(s);
1746
+ e = Lt(
1726
1747
  s,
1727
1748
  i,
1728
- d
1749
+ r
1729
1750
  );
1730
1751
  const l = qt(
1731
1752
  s,
1732
- t,
1753
+ e,
1733
1754
  j,
1734
- i.tools || J().tools
1735
- ), { destroy: c } = Jt(
1736
- t,
1755
+ i.tools || Q().tools
1756
+ ), { destroy: w } = Jt(
1757
+ e,
1737
1758
  s,
1738
- d.collectionComponent
1739
- ), { activeMap: C } = s.maps;
1740
- function u(g) {
1741
- if (n != null && n.m && n.cv && g instanceof $) {
1742
- n.cv.properties.title && delete n.cv.properties.title;
1743
- const V = new x(n.cv);
1744
- n.m === y.VIEW ? t.viewViewshed(V) : t.editViewshed(V);
1759
+ r.collectionComponent
1760
+ ), { activeMap: c } = s.maps;
1761
+ function d(_) {
1762
+ if (n != null && n.m && n.cv && _ instanceof U) {
1763
+ const y = new D(n.cv);
1764
+ n.m === E.VIEW ? e.viewViewshed(y) : e.editViewshed(y);
1745
1765
  }
1746
1766
  }
1747
- let h = !1;
1748
- C && (h = !0, u(C));
1749
- const w = s.maps.mapActivated.addEventListener(
1750
- (g) => {
1751
- t.stop(), h || (u(g), h = !0);
1767
+ let f = !1;
1768
+ c && (f = !0, d(c));
1769
+ const m = s.maps.mapActivated.addEventListener(
1770
+ (_) => {
1771
+ e.stop(), f || (d(_), f = !0);
1752
1772
  }
1753
1773
  );
1754
- e = () => {
1755
- w(), l(), c(), d.destroy(), t.destroy();
1774
+ t = () => {
1775
+ m(), l(), w(), r.destroy(), e.destroy();
1756
1776
  };
1757
1777
  },
1758
1778
  /**
1759
1779
  * should return all default values of the configuration
1760
1780
  * @returns {ViewshedPluginOptions}
1761
1781
  */
1762
- getDefaultOptions: J,
1782
+ getDefaultOptions: Q,
1763
1783
  /**
1764
1784
  * should return the plugin's serialization excluding all default values
1765
1785
  * @returns {ViewshedPluginOptions}
1766
1786
  */
1767
1787
  toJSON() {
1768
1788
  const s = {};
1769
- return i.tools && J().tools.length !== i.tools.length && (s.tools = [...i.tools]), i.shadowColor && i.shadowColor !== x.getDefaultOptions().shadowColor && (s.shadowColor = i.shadowColor), i.visibleColor && i.visibleColor !== x.getDefaultOptions().visibleColor && (s.visibleColor = i.visibleColor), s;
1789
+ return i.tools && Q().tools.length !== i.tools.length && (s.tools = [...i.tools]), i.shadowColor && i.shadowColor !== D.getDefaultOptions().shadowColor && (s.shadowColor = i.shadowColor), i.visibleColor && i.visibleColor !== D.getDefaultOptions().visibleColor && (s.visibleColor = i.visibleColor), s;
1770
1790
  },
1771
1791
  /**
1772
1792
  * should return the plugins state
1793
+ * @param {boolean} forUrl
1773
1794
  * @returns {ViewshedPluginState}
1774
1795
  */
1775
- getState() {
1776
- var l;
1777
- const s = {}, n = t.mode.value, d = (l = t.currentViewshed.value) == null ? void 0 : l.toJSON();
1778
- return n !== null && n !== "create" && d && (s.m = n, s.cv = d), s;
1796
+ getState(s) {
1797
+ var w, c;
1798
+ const n = {}, r = e.mode.value, l = (w = e.currentViewshed.value) == null ? void 0 : w.toJSON();
1799
+ return r !== null && r !== "create" && l && (n.m = r, n.cv = l, s && ((c = n.cv.properties) != null && c.title) && (Object.keys(n.properties).length === 1 ? delete n.cv.properties : delete n.cv.properties.title)), n;
1779
1800
  },
1780
1801
  /**
1781
1802
  * components for configuring the plugin and/ or custom items defined by the plugin
@@ -1793,7 +1814,7 @@ function ui(i) {
1793
1814
  }
1794
1815
  ];
1795
1816
  },
1796
- destroy: () => e(),
1817
+ destroy: () => t(),
1797
1818
  i18n: {
1798
1819
  en: {
1799
1820
  viewshed: {
@@ -1810,11 +1831,11 @@ function ui(i) {
1810
1831
  absolute: "Absolute",
1811
1832
  new: "New",
1812
1833
  cancel: "Cancel",
1813
- [p.CONE]: "Cone viewshed analysis",
1814
- [p.THREESIXTY]: "360° viewshed analysis",
1834
+ [g.CONE]: "Cone viewshed analysis",
1835
+ [g.THREESIXTY]: "360° viewshed analysis",
1815
1836
  create: {
1816
- [p.CONE]: "Create cone viewshed analysis",
1817
- [p.THREESIXTY]: "Create 360° viewshed analysis"
1837
+ [g.CONE]: "Create cone viewshed analysis",
1838
+ [g.THREESIXTY]: "Create 360° viewshed analysis"
1818
1839
  },
1819
1840
  addToMyWorkspace: "Add to My Workspace",
1820
1841
  temporary: "Temporary",
@@ -1848,11 +1869,11 @@ function ui(i) {
1848
1869
  absolute: "Absolut",
1849
1870
  new: "Neu",
1850
1871
  cancel: "Abbrechen",
1851
- [p.CONE]: "Sichtkegelanalyse",
1852
- [p.THREESIXTY]: "360° Sichtsanalyse",
1872
+ [g.CONE]: "Sichtkegelanalyse",
1873
+ [g.THREESIXTY]: "360° Sichtsanalyse",
1853
1874
  create: {
1854
- [p.CONE]: "Sichtkegelanalyse erstellen",
1855
- [p.THREESIXTY]: "360° Sichtanalyse erstellen"
1875
+ [g.CONE]: "Sichtkegelanalyse erstellen",
1876
+ [g.THREESIXTY]: "360° Sichtanalyse erstellen"
1856
1877
  },
1857
1878
  addToMyWorkspace: "Zu Mein Arbeitsbereich hinzufügen",
1858
1879
  temporary: "Temporäre",