@edugis-org/webmapx 0.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.
Files changed (84) hide show
  1. package/README.md +149 -0
  2. package/dist-lib/WMTS-DCN4zX0-.js +1169 -0
  3. package/dist-lib/alert-GeHlqlN8.js +310 -0
  4. package/dist-lib/assets/epsg-lookup.worker-J7TVnHDq.js +1 -0
  5. package/dist-lib/assets/shapefile.worker-kQfZj6G2.js +4 -0
  6. package/dist-lib/attribution-format-B4f05_u0.js +62 -0
  7. package/dist-lib/button-DFdGkRPQ.js +741 -0
  8. package/dist-lib/cesium-adapter-BHXNytkU.js +1488 -0
  9. package/dist-lib/checkbox-QoR4S8tV.js +284 -0
  10. package/dist-lib/chunk-HEgqtunE.js +20 -0
  11. package/dist-lib/chunk.36O46B5H-B6ZL7Sm1.js +77 -0
  12. package/dist-lib/chunk.3RPBFEDE-BFO1fHVm.js +138 -0
  13. package/dist-lib/chunk.5JY5FUCG-DTXsslmx.js +1090 -0
  14. package/dist-lib/chunk.6CTB5ZDJ-DjZrBd6Y.js +99 -0
  15. package/dist-lib/chunk.AJ3ENQ5C-Ci7Gm2b6.js +175 -0
  16. package/dist-lib/chunk.LD4M4QGE-CiCfhE8r.js +8 -0
  17. package/dist-lib/chunk.NYIIDP5N-BikXIStD.js +99 -0
  18. package/dist-lib/chunk.RWUUFNUL-DFztA4uV.js +43 -0
  19. package/dist-lib/chunk.SI4ACBFK-CLb9VfMG.js +61 -0
  20. package/dist-lib/chunk.YHLNUJ7P-D-kanrCf.js +503 -0
  21. package/dist-lib/core-CMAlSR68.js +22 -0
  22. package/dist-lib/decorate-CWgUV1hU.js +1139 -0
  23. package/dist-lib/decorators-B35AgiCU.js +351 -0
  24. package/dist-lib/deferred-query-service-BJDcngw6.js +386 -0
  25. package/dist-lib/dist-Dm6b7XCs.js +12318 -0
  26. package/dist-lib/dist-Ha9LQCut.js +244 -0
  27. package/dist-lib/dist-c1PlDAd1.js +2359 -0
  28. package/dist-lib/dist-kKlmcBXq.js +50 -0
  29. package/dist-lib/divider-CPm675yY.js +41 -0
  30. package/dist-lib/dropped-config-C_GyVa8o.js +17 -0
  31. package/dist-lib/dropped-layer-builder-DAaYgUPk.js +396 -0
  32. package/dist-lib/epsg-definitions-BZLZWa8Q.js +668 -0
  33. package/dist-lib/esm-CTuscnN5.js +46 -0
  34. package/dist-lib/file-sniff-Dhxj3KTF.js +251 -0
  35. package/dist-lib/geo-calculations-DbFJAUoI.js +30 -0
  36. package/dist-lib/icon-CEOgWlro.js +9 -0
  37. package/dist-lib/icon-button-Da_nBTy3.js +408 -0
  38. package/dist-lib/input-CeGntPlT.js +590 -0
  39. package/dist-lib/layer-discovery-afWzu5hY.js +2825 -0
  40. package/dist-lib/leaflet-adapter-D9djjrKv.js +1227 -0
  41. package/dist-lib/lib-CdHVicAE.js +4074 -0
  42. package/dist-lib/map-layer-registry-2cmkiRDK.js +62 -0
  43. package/dist-lib/maplibre-adapter-TFc3e0G9.js +1190 -0
  44. package/dist-lib/maplibre-expression-evaluator-DCWUcpwf.js +7233 -0
  45. package/dist-lib/marker-utils-DztWXeop.js +12 -0
  46. package/dist-lib/ol-tilegrid-9VtyxaLG.js +64 -0
  47. package/dist-lib/openlayers-adapter-DVW1KCRv.js +13307 -0
  48. package/dist-lib/option-CBxl1mZP.js +1106 -0
  49. package/dist-lib/papaparse.min-B7v3c0D7.js +501 -0
  50. package/dist-lib/rbush-C8k41T4z.js +254 -0
  51. package/dist-lib/shapefile-SawVY6xg.js +207 -0
  52. package/dist-lib/spinner-DysxdNG9.js +6 -0
  53. package/dist-lib/src-CL94RDe3.js +111 -0
  54. package/dist-lib/throttle-BeneRNYK.js +16 -0
  55. package/dist-lib/toast-Cm28o9U6.js +15 -0
  56. package/dist-lib/togeojson.es-DAgiTBvg.js +579 -0
  57. package/dist-lib/tooltip-Cucn1SiD.js +197 -0
  58. package/dist-lib/webmapx-3d-tool-D4CTD2gB.js +176 -0
  59. package/dist-lib/webmapx-base-tool-Dm9NAWLD.js +75 -0
  60. package/dist-lib/webmapx-config-edit-tool-DCTyxqTk.js +389 -0
  61. package/dist-lib/webmapx-coordinates-tool-jeWohup9.js +648 -0
  62. package/dist-lib/webmapx-core-bundle-BDImi1RE.js +8203 -0
  63. package/dist-lib/webmapx-draw-tool-DooAV8cF.js +4336 -0
  64. package/dist-lib/webmapx-geolocation-tool-Rw3-Iad1.js +788 -0
  65. package/dist-lib/webmapx-import-layer-tool-DRYviHd5.js +250 -0
  66. package/dist-lib/webmapx-info-tool-BJA157cy.js +412 -0
  67. package/dist-lib/webmapx-language-osmvector-M5y_lwOg.js +489 -0
  68. package/dist-lib/webmapx-measure-tool-BXhMJFC6.js +590 -0
  69. package/dist-lib/webmapx-modal-tool-eF6Naluv.js +84 -0
  70. package/dist-lib/webmapx-plugin-tool-D2Hghf9n.js +45 -0
  71. package/dist-lib/webmapx-print-tool-ob1bOsR5.js +348 -0
  72. package/dist-lib/webmapx-search-tool-Cv8BrYvY.js +437 -0
  73. package/dist-lib/webmapx-settings-DDEJ8aoV.js +479 -0
  74. package/dist-lib/webmapx-truearea-tool-CMB4Orm-.js +615 -0
  75. package/dist-lib/webmapx-view-mode-tool-CUpLNjOj.js +106 -0
  76. package/dist-lib/webmapx.css +2 -0
  77. package/dist-lib/webmapx.js +1321 -0
  78. package/dist-lib/wms-feature-info-C0RVMEQC.js +145 -0
  79. package/dist-lib/wms-url-builder-DIJLQ1v2.js +54 -0
  80. package/dist-lib/zip.js-DVhmtjxZ.js +3615 -0
  81. package/package.json +107 -0
  82. package/public/data/country-epsg-codes.json +297 -0
  83. package/public/data/world-countries-simplified.topojson +1 -0
  84. package/src/locales/en/core.json +20 -0
@@ -0,0 +1,579 @@
1
+ //#region node_modules/@tmcw/togeojson/dist/togeojson.es.mjs
2
+ function e(e, t) {
3
+ return Array.from(e.getElementsByTagName(t));
4
+ }
5
+ function t(e) {
6
+ return e[0] === "#" ? e : `#${e}`;
7
+ }
8
+ function n(e, t, n) {
9
+ return Array.from(e.getElementsByTagNameNS(n, t));
10
+ }
11
+ function r(e) {
12
+ return e?.normalize(), e?.textContent || "";
13
+ }
14
+ function i(e, t, n) {
15
+ let r = e.getElementsByTagName(t), i = r.length ? r[0] : null;
16
+ return i && n && n(i), i;
17
+ }
18
+ function a(e, t, n) {
19
+ let r = {};
20
+ if (!e) return r;
21
+ let i = e.getElementsByTagName(t), a = i.length ? i[0] : null;
22
+ return a && n ? n(a, r) : r;
23
+ }
24
+ function o(e, t, n) {
25
+ let a = r(i(e, t));
26
+ return a && n && n(a) || {};
27
+ }
28
+ function s(e, t, n) {
29
+ let a = Number.parseFloat(r(i(e, t)));
30
+ if (!Number.isNaN(a)) return a && n && n(a) || {};
31
+ }
32
+ function c(e, t, n) {
33
+ let a = Number.parseFloat(r(i(e, t)));
34
+ if (!Number.isNaN(a)) return n && n(a), a;
35
+ }
36
+ function l(e, t) {
37
+ let n = {};
38
+ for (let r of t) o(e, r, (e) => {
39
+ n[r] = e;
40
+ });
41
+ return n;
42
+ }
43
+ function u(e) {
44
+ return e?.nodeType === 1;
45
+ }
46
+ function d(e) {
47
+ let t = [];
48
+ if (e === null) return t;
49
+ for (let n of Array.from(e.childNodes)) {
50
+ if (!u(n)) continue;
51
+ let e = f(n.nodeName);
52
+ if (e === "gpxtpx:TrackPointExtension") t = t.concat(d(n));
53
+ else {
54
+ let i = r(n);
55
+ t.push([e, p(i)]);
56
+ }
57
+ }
58
+ return t;
59
+ }
60
+ function f(e) {
61
+ return [
62
+ "heart",
63
+ "gpxtpx:hr",
64
+ "hr"
65
+ ].includes(e) ? "heart" : e;
66
+ }
67
+ function p(e) {
68
+ let t = Number.parseFloat(e);
69
+ return Number.isNaN(t) ? e : t;
70
+ }
71
+ function m(e) {
72
+ let t = [Number.parseFloat(e.getAttribute("lon") || ""), Number.parseFloat(e.getAttribute("lat") || "")];
73
+ if (Number.isNaN(t[0]) || Number.isNaN(t[1])) return null;
74
+ c(e, "ele", (e) => {
75
+ t.push(e);
76
+ });
77
+ let n = i(e, "time");
78
+ return {
79
+ coordinates: t,
80
+ time: n ? r(n) : null,
81
+ extendedValues: d(i(e, "extensions"))
82
+ };
83
+ }
84
+ function h(e) {
85
+ return a(e, "line", (e) => Object.assign({}, o(e, "color", (e) => ({ stroke: `#${e}` })), s(e, "opacity", (e) => ({ "stroke-opacity": e })), s(e, "width", (e) => ({ "stroke-width": e * 96 / 25.4 }))));
86
+ }
87
+ function g(t, n) {
88
+ let i = l(n, [
89
+ "name",
90
+ "cmt",
91
+ "desc",
92
+ "type",
93
+ "time",
94
+ "keywords"
95
+ ]);
96
+ for (let [e, a] of t) for (let e of Array.from(n.getElementsByTagNameNS(a, "*"))) i[e.tagName.replace(":", "_")] = r(e)?.trim();
97
+ let a = e(n, "link");
98
+ return a.length && (i.links = a.map((e) => Object.assign({ href: e.getAttribute("href") }, l(e, ["text", "type"])))), i;
99
+ }
100
+ function _(t, n) {
101
+ let r = e(t, n), i = [], a = [], o = {};
102
+ for (let e = 0; e < r.length; e++) {
103
+ let t = m(r[e]);
104
+ if (t) {
105
+ i.push(t.coordinates), t.time && a.push(t.time);
106
+ for (let [n, i] of t.extendedValues) {
107
+ let t = n === "heart" ? n : `${n.replace("gpxtpx:", "")}s`;
108
+ o[t] || (o[t] = Array(r.length).fill(null)), o[t][e] = i;
109
+ }
110
+ }
111
+ }
112
+ if (!(i.length < 2)) return {
113
+ line: i,
114
+ times: a,
115
+ extendedValues: o
116
+ };
117
+ }
118
+ function v(e, t) {
119
+ let n = _(t, "rtept");
120
+ if (n) return {
121
+ type: "Feature",
122
+ properties: Object.assign({ _gpxType: "rte" }, g(e, t), h(i(t, "extensions"))),
123
+ geometry: {
124
+ type: "LineString",
125
+ coordinates: n.line
126
+ }
127
+ };
128
+ }
129
+ function y(t, n) {
130
+ let r = e(n, "trkseg"), a = [], o = [], s = [];
131
+ for (let e of r) {
132
+ let t = _(e, "trkpt");
133
+ t && (s.push(t), t.times?.length && o.push(t.times));
134
+ }
135
+ if (s.length === 0) return null;
136
+ let c = s.length > 1, l = Object.assign({ _gpxType: "trk" }, g(t, n), h(i(n, "extensions")), o.length ? { coordinateProperties: { times: c ? o : o[0] } } : {});
137
+ for (let e = 0; e < s.length; e++) {
138
+ let t = s[e];
139
+ a.push(t.line), l.coordinateProperties ||= {};
140
+ let n = l.coordinateProperties;
141
+ for (let [r, i] of Object.entries(t.extendedValues)) c ? (n[r] || (n[r] = s.map((e) => Array(e.line.length).fill(null))), n[r][e] = i) : n[r] = i;
142
+ }
143
+ return {
144
+ type: "Feature",
145
+ properties: l,
146
+ geometry: c ? {
147
+ type: "MultiLineString",
148
+ coordinates: a
149
+ } : {
150
+ type: "LineString",
151
+ coordinates: a[0]
152
+ }
153
+ };
154
+ }
155
+ function b(e, t) {
156
+ let n = Object.assign(g(e, t), l(t, ["sym"])), r = m(t);
157
+ return r ? {
158
+ type: "Feature",
159
+ properties: n,
160
+ geometry: {
161
+ type: "Point",
162
+ coordinates: r.coordinates
163
+ }
164
+ } : null;
165
+ }
166
+ function* x(t) {
167
+ let n = t, r = "http://www.garmin.com/xmlschemas/GpxExtensions/v3", i = [["gpxx", r]], a = n.getElementsByTagName("gpx")[0]?.attributes;
168
+ if (a) for (let e of Array.from(a)) e.name?.startsWith("xmlns:") && e.value !== r && i.push([e.name, e.value]);
169
+ for (let t of e(n, "trk")) {
170
+ let e = y(i, t);
171
+ e && (yield e);
172
+ }
173
+ for (let t of e(n, "rte")) {
174
+ let e = v(i, t);
175
+ e && (yield e);
176
+ }
177
+ for (let t of e(n, "wpt")) {
178
+ let e = b(i, t);
179
+ e && (yield e);
180
+ }
181
+ }
182
+ function S(e) {
183
+ return {
184
+ type: "FeatureCollection",
185
+ features: Array.from(x(e))
186
+ };
187
+ }
188
+ function C(e, t) {
189
+ let n = {}, r = t === "stroke" || t === "fill" ? t : `${t}-color`;
190
+ return e[0] === "#" && (e = e.substring(1)), e.length === 6 || e.length === 3 ? n[r] = `#${e}` : e.length === 8 && (n[`${t}-opacity`] = Number.parseInt(e.substring(0, 2), 16) / 255, n[r] = `#${e.substring(6, 8)}${e.substring(4, 6)}${e.substring(2, 4)}`), n;
191
+ }
192
+ function w(e, t, n) {
193
+ let r = {};
194
+ return c(e, t, (e) => {
195
+ r[n] = e;
196
+ }), r;
197
+ }
198
+ function T(e, t) {
199
+ return a(e, "color", (e) => C(r(e), t));
200
+ }
201
+ function E(e) {
202
+ return a(e, "Icon", (e, t) => (o(e, "href", (e) => {
203
+ t.icon = e;
204
+ }), t));
205
+ }
206
+ function D(e) {
207
+ return a(e, "IconStyle", (e) => Object.assign(T(e, "icon"), w(e, "scale", "icon-scale"), w(e, "heading", "icon-heading"), a(e, "hotSpot", (e) => {
208
+ let t = Number.parseFloat(e.getAttribute("x") || ""), n = Number.parseFloat(e.getAttribute("y") || ""), r = e.getAttribute("xunits") || "", i = e.getAttribute("yunits") || "";
209
+ return !Number.isNaN(t) && !Number.isNaN(n) ? {
210
+ "icon-offset": [t, n],
211
+ "icon-offset-units": [r, i]
212
+ } : {};
213
+ }), E(e)));
214
+ }
215
+ function O(e) {
216
+ return a(e, "LabelStyle", (e) => Object.assign(T(e, "label"), w(e, "scale", "label-scale")));
217
+ }
218
+ function k(e) {
219
+ return a(e, "LineStyle", (e) => Object.assign(T(e, "stroke"), w(e, "width", "stroke-width")));
220
+ }
221
+ function ee(e) {
222
+ return a(e, "PolyStyle", (e, t) => Object.assign(t, a(e, "color", (e) => C(r(e), "fill")), o(e, "fill", (e) => {
223
+ if (e === "0") return { "fill-opacity": 0 };
224
+ }), o(e, "outline", (e) => {
225
+ if (e === "0") return { "stroke-opacity": 0 };
226
+ })));
227
+ }
228
+ function A(e) {
229
+ return Object.assign({}, ee(e), k(e), O(e), D(e));
230
+ }
231
+ var j = /\s*/g, M = /^\s*|\s*$/g, N = /\s+/;
232
+ function P(e) {
233
+ return e.replace(j, "").split(",").map(Number.parseFloat).filter((e) => !Number.isNaN(e)).slice(0, 3);
234
+ }
235
+ function F(e) {
236
+ return e.replace(M, "").split(N).map(P).filter((e) => e.length >= 2);
237
+ }
238
+ function I(t) {
239
+ let i = e(t, "coord");
240
+ i.length === 0 && (i = n(t, "coord", "*"));
241
+ let a = i.map((e) => r(e).split(" ").map(Number.parseFloat));
242
+ return a.length === 0 ? null : {
243
+ geometry: a.length > 2 ? {
244
+ type: "LineString",
245
+ coordinates: a
246
+ } : {
247
+ type: "Point",
248
+ coordinates: a[0]
249
+ },
250
+ times: e(t, "when").map((e) => r(e))
251
+ };
252
+ }
253
+ function L(e) {
254
+ if (e.length === 0) return e;
255
+ let t = e[0], n = e[e.length - 1], r = !0;
256
+ for (let e = 0; e < Math.max(t.length, n.length); e++) if (t[e] !== n[e]) {
257
+ r = !1;
258
+ break;
259
+ }
260
+ return r ? e : e.concat([e[0]]);
261
+ }
262
+ function R(e) {
263
+ return r(i(e, "coordinates"));
264
+ }
265
+ function z(t) {
266
+ let n = [], r = [];
267
+ for (let i = 0; i < t.childNodes.length; i++) {
268
+ let a = t.childNodes.item(i);
269
+ if (u(a)) switch (a.tagName) {
270
+ case "MultiGeometry":
271
+ case "MultiTrack":
272
+ case "gx:MultiTrack": {
273
+ let e = z(a);
274
+ n = n.concat(e.geometries), r = r.concat(e.coordTimes);
275
+ break;
276
+ }
277
+ case "Point": {
278
+ let e = P(R(a));
279
+ e.length >= 2 && n.push({
280
+ type: "Point",
281
+ coordinates: e
282
+ });
283
+ break;
284
+ }
285
+ case "LinearRing":
286
+ case "LineString": {
287
+ let e = F(R(a));
288
+ e.length >= 2 && n.push({
289
+ type: "LineString",
290
+ coordinates: e
291
+ });
292
+ break;
293
+ }
294
+ case "Polygon": {
295
+ let t = [];
296
+ for (let n of e(a, "LinearRing")) {
297
+ let e = L(F(R(n)));
298
+ e.length >= 4 && t.push(e);
299
+ }
300
+ t.length && n.push({
301
+ type: "Polygon",
302
+ coordinates: t
303
+ });
304
+ break;
305
+ }
306
+ case "Track":
307
+ case "gx:Track": {
308
+ let e = I(a);
309
+ if (!e) break;
310
+ let { times: t, geometry: i } = e;
311
+ n.push(i), t.length && r.push(t);
312
+ break;
313
+ }
314
+ }
315
+ }
316
+ return {
317
+ geometries: n,
318
+ coordTimes: r
319
+ };
320
+ }
321
+ var B = (e) => Number(e), V = {
322
+ string: (e) => e,
323
+ int: B,
324
+ uint: B,
325
+ short: B,
326
+ ushort: B,
327
+ float: B,
328
+ double: B,
329
+ bool: (e) => !!e
330
+ };
331
+ function H(t, n) {
332
+ return a(t, "ExtendedData", (t, a) => {
333
+ for (let n of e(t, "Data")) a[n.getAttribute("name") || ""] = r(i(n, "value"));
334
+ for (let i of e(t, "SimpleData")) {
335
+ let e = i.getAttribute("name") || "";
336
+ a[e] = (n[e] || V.string)(r(i));
337
+ }
338
+ return a;
339
+ });
340
+ }
341
+ function U(e) {
342
+ let t = i(e, "description");
343
+ for (let e of Array.from(t?.childNodes || [])) if (e.nodeType === 4) return { description: {
344
+ "@type": "html",
345
+ value: r(e)
346
+ } };
347
+ return {};
348
+ }
349
+ function W(e) {
350
+ return a(e, "TimeSpan", (e) => ({ timespan: {
351
+ begin: r(i(e, "begin")),
352
+ end: r(i(e, "end"))
353
+ } }));
354
+ }
355
+ function G(e) {
356
+ return a(e, "TimeStamp", (e) => ({ timestamp: r(i(e, "when")) }));
357
+ }
358
+ function K(e, n) {
359
+ return o(e, "styleUrl", (e) => (e = t(e), n[e] ? Object.assign({ styleUrl: e }, n[e]) : { styleUrl: e }));
360
+ }
361
+ var q;
362
+ (function(e) {
363
+ e.ABSOLUTE = "absolute", e.RELATIVE_TO_GROUND = "relativeToGround", e.CLAMP_TO_GROUND = "clampToGround", e.CLAMP_TO_SEAFLOOR = "clampToSeaFloor", e.RELATIVE_TO_SEAFLOOR = "relativeToSeaFloor";
364
+ })(q ||= {});
365
+ function J(e) {
366
+ switch (e?.textContent) {
367
+ case q.ABSOLUTE: return q.ABSOLUTE;
368
+ case q.CLAMP_TO_GROUND: return q.CLAMP_TO_GROUND;
369
+ case q.CLAMP_TO_SEAFLOOR: return q.CLAMP_TO_SEAFLOOR;
370
+ case q.RELATIVE_TO_GROUND: return q.RELATIVE_TO_GROUND;
371
+ case q.RELATIVE_TO_SEAFLOOR: return q.RELATIVE_TO_SEAFLOOR;
372
+ }
373
+ return null;
374
+ }
375
+ function Y(e) {
376
+ return i(e, "gx:LatLonQuad") ? { geometry: {
377
+ type: "Polygon",
378
+ coordinates: [L(F(R(e)))]
379
+ } } : Q(e);
380
+ }
381
+ var X = Math.PI / 180;
382
+ function Z(e, t, n) {
383
+ let r = [(e[0] + e[2]) / 2, (e[1] + e[3]) / 2];
384
+ return [t[0].map((e) => {
385
+ let t = e[1] - r[1], i = e[0] - r[0], a = Math.sqrt(t ** 2 + i ** 2), o = Math.atan2(t, i) + n * X;
386
+ return [r[0] + Math.cos(o) * a, r[1] + Math.sin(o) * a];
387
+ })];
388
+ }
389
+ function Q(e) {
390
+ let t = i(e, "LatLonBox");
391
+ if (t) {
392
+ let e = c(t, "north"), n = c(t, "west"), r = c(t, "east"), i = c(t, "south"), a = c(t, "rotation");
393
+ if (typeof e == "number" && typeof i == "number" && typeof n == "number" && typeof r == "number") {
394
+ let t = [
395
+ n,
396
+ i,
397
+ r,
398
+ e
399
+ ], o = [[
400
+ [n, e],
401
+ [r, e],
402
+ [r, i],
403
+ [n, i],
404
+ [n, e]
405
+ ]];
406
+ return typeof a == "number" && (o = Z(t, o, a)), {
407
+ bbox: t,
408
+ geometry: {
409
+ type: "Polygon",
410
+ coordinates: o
411
+ }
412
+ };
413
+ }
414
+ }
415
+ return null;
416
+ }
417
+ function te(e, t, n, r) {
418
+ let i = Y(e), a = i?.geometry || null;
419
+ if (!a && r.skipNullGeometry) return null;
420
+ let o = {
421
+ type: "Feature",
422
+ geometry: a,
423
+ properties: Object.assign({ "@geometry-type": "groundoverlay" }, l(e, [
424
+ "name",
425
+ "address",
426
+ "visibility",
427
+ "open",
428
+ "phoneNumber",
429
+ "description"
430
+ ]), U(e), K(e, t), A(e), E(e), H(e, n), W(e), G(e))
431
+ };
432
+ i?.bbox && (o.bbox = i.bbox), o.properties?.visibility !== void 0 && (o.properties.visibility = o.properties.visibility !== "0");
433
+ let s = e.getAttribute("id");
434
+ return s !== null && s !== "" && (o.id = s), o;
435
+ }
436
+ function ne(e) {
437
+ let t = i(e, "Region");
438
+ return t ? {
439
+ coordinateBox: ie(t),
440
+ lod: re(e)
441
+ } : null;
442
+ }
443
+ function re(e) {
444
+ let t = i(e, "Lod");
445
+ return t ? [
446
+ c(t, "minLodPixels") ?? -1,
447
+ c(t, "maxLodPixels") ?? -1,
448
+ c(t, "minFadeExtent") ?? null,
449
+ c(t, "maxFadeExtent") ?? null
450
+ ] : null;
451
+ }
452
+ function ie(e) {
453
+ let t = i(e, "LatLonAltBox");
454
+ if (t) {
455
+ let e = c(t, "north"), n = c(t, "west"), r = c(t, "east"), a = c(t, "south");
456
+ if (J(i(t, "altitudeMode") || i(t, "gx:altitudeMode")) && console.debug("Encountered an unsupported feature of KML for togeojson: please contact developers for support of altitude mode."), typeof e == "number" && typeof a == "number" && typeof n == "number" && typeof r == "number") return {
457
+ bbox: [
458
+ n,
459
+ a,
460
+ r,
461
+ e
462
+ ],
463
+ geometry: {
464
+ type: "Polygon",
465
+ coordinates: [[
466
+ [n, e],
467
+ [r, e],
468
+ [r, a],
469
+ [n, a],
470
+ [n, e]
471
+ ]]
472
+ }
473
+ };
474
+ }
475
+ return null;
476
+ }
477
+ function ae(e) {
478
+ let t = i(e, "Link");
479
+ return t ? l(t, [
480
+ "href",
481
+ "refreshMode",
482
+ "refreshInterval",
483
+ "viewRefreshMode",
484
+ "viewRefreshTime",
485
+ "viewBoundScale",
486
+ "viewFormat",
487
+ "httpQuery"
488
+ ]) : {};
489
+ }
490
+ function oe(e, t, n, r) {
491
+ let i = ne(e), a = i?.coordinateBox?.geometry || null;
492
+ if (!a && r.skipNullGeometry) return null;
493
+ let o = {
494
+ type: "Feature",
495
+ geometry: a,
496
+ properties: Object.assign({ "@geometry-type": "networklink" }, l(e, [
497
+ "name",
498
+ "address",
499
+ "visibility",
500
+ "open",
501
+ "phoneNumber",
502
+ "styleUrl",
503
+ "refreshVisibility",
504
+ "flyToView",
505
+ "description"
506
+ ]), U(e), K(e, t), A(e), E(e), H(e, n), W(e), G(e), ae(e), i?.lod ? { lod: i.lod } : {})
507
+ };
508
+ i?.coordinateBox?.bbox && (o.bbox = i.coordinateBox.bbox), o.properties?.visibility !== void 0 && (o.properties.visibility = o.properties.visibility !== "0");
509
+ let s = e.getAttribute("id");
510
+ return s !== null && s !== "" && (o.id = s), o;
511
+ }
512
+ function se(e) {
513
+ return e.length === 0 ? null : e.length === 1 ? e[0] : {
514
+ type: "GeometryCollection",
515
+ geometries: e
516
+ };
517
+ }
518
+ function ce(e, t, n, r) {
519
+ let { coordTimes: i, geometries: a } = z(e), o = se(a);
520
+ if (!o && r.skipNullGeometry) return null;
521
+ let s = {
522
+ type: "Feature",
523
+ geometry: o,
524
+ properties: Object.assign(l(e, [
525
+ "name",
526
+ "address",
527
+ "visibility",
528
+ "open",
529
+ "phoneNumber",
530
+ "description"
531
+ ]), U(e), K(e, t), A(e), H(e, n), W(e), G(e), i.length ? { coordinateProperties: { times: i.length === 1 ? i[0] : i } } : {})
532
+ };
533
+ s.properties?.visibility !== void 0 && (s.properties.visibility = s.properties.visibility !== "0");
534
+ let c = e.getAttribute("id");
535
+ return c !== null && c !== "" && (s.id = c), s;
536
+ }
537
+ function $(e) {
538
+ let n = e.getAttribute("id"), r = e.parentNode;
539
+ return !n && u(r) && r.localName === "CascadingStyle" && (n = r.getAttribute("kml:id") || r.getAttribute("id")), t(n || "");
540
+ }
541
+ function le(n) {
542
+ let r = {};
543
+ for (let t of e(n, "Style")) r[$(t)] = A(t);
544
+ for (let i of e(n, "StyleMap")) {
545
+ let e = t(i.getAttribute("id") || "");
546
+ o(i, "styleUrl", (n) => {
547
+ n = t(n), r[n] && (r[e] = r[n]);
548
+ });
549
+ }
550
+ return r;
551
+ }
552
+ function ue(t) {
553
+ let n = {};
554
+ for (let r of e(t, "SimpleField")) n[r.getAttribute("name") || ""] = V[r.getAttribute("type") || ""] || V.string;
555
+ return n;
556
+ }
557
+ function* de(t, n = { skipNullGeometry: !1 }) {
558
+ let r = t, i = le(r), a = ue(r);
559
+ for (let t of e(r, "Placemark")) {
560
+ let e = ce(t, i, a, n);
561
+ e && (yield e);
562
+ }
563
+ for (let t of e(r, "GroundOverlay")) {
564
+ let e = te(t, i, a, n);
565
+ e && (yield e);
566
+ }
567
+ for (let t of e(r, "NetworkLink")) {
568
+ let e = oe(t, i, a, n);
569
+ e && (yield e);
570
+ }
571
+ }
572
+ function fe(e, t = { skipNullGeometry: !1 }) {
573
+ return {
574
+ type: "FeatureCollection",
575
+ features: Array.from(de(e, t))
576
+ };
577
+ }
578
+ //#endregion
579
+ export { S as gpx, fe as kml };