@maptiler/geocoding-control 2.0.0 → 2.1.0-rc1

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 (118) hide show
  1. package/MapLibreBasedGeocodingControl.d.ts +3027 -27
  2. package/icons/10pin.svg +4 -1
  3. package/icons/9pin.svg +4 -1
  4. package/icons/alcohol.svg +1 -1
  5. package/icons/alpine_hut.svg +1 -1
  6. package/icons/apartment.svg +4 -1
  7. package/icons/area.svg +1 -5
  8. package/icons/artwork.svg +4 -1
  9. package/icons/beauty.svg +14 -1
  10. package/icons/bicycle_repair_station.svg +18 -1
  11. package/icons/biergarten.svg +4 -1
  12. package/icons/books.svg +14 -1
  13. package/icons/bowl.svg +4 -1
  14. package/icons/bowling_alley.svg +4 -1
  15. package/icons/bus_station.svg +1 -1
  16. package/icons/camping.svg +1 -1
  17. package/icons/car_repair.svg +14 -1
  18. package/icons/car_wash.svg +19 -1
  19. package/icons/cave_entrance.svg +15 -1
  20. package/icons/chalet.svg +1 -1
  21. package/icons/chemist.svg +14 -1
  22. package/icons/church.svg +4 -1
  23. package/icons/community_centre.svg +20 -1
  24. package/icons/firestation.svg +4 -1
  25. package/icons/guest_house.svg +29 -8
  26. package/icons/hotel.svg +1 -1
  27. package/icons/housenumber.svg +19 -14
  28. package/icons/hut.svg +1 -4
  29. package/icons/medical_supply.svg +20 -1
  30. package/icons/memorial.svg +14 -1
  31. package/icons/motel.svg +19 -1
  32. package/icons/post.svg +1 -1
  33. package/icons/post_office.svg +1 -1
  34. package/icons/postal_code.svg +1 -23
  35. package/icons/public_bookcase.svg +14 -1
  36. package/icons/public_building.svg +4 -1
  37. package/icons/shintoist.svg +1 -1
  38. package/icons/street.svg +11 -14
  39. package/icons/vehicle_inspection.svg +18 -1
  40. package/icons/wilderness_hut.svg +1 -1
  41. package/leaflet-controller.d.ts +1 -1
  42. package/leaflet-controller.js +113 -110
  43. package/leaflet-controller.js.map +1 -1
  44. package/leaflet-controller.umd.js +2 -2
  45. package/leaflet-controller.umd.js.map +1 -1
  46. package/leaflet.d.ts +58 -5
  47. package/leaflet.js +1438 -1265
  48. package/leaflet.js.map +1 -1
  49. package/leaflet.umd.js +3 -3
  50. package/leaflet.umd.js.map +1 -1
  51. package/maplibregl-controller.d.ts +1 -1
  52. package/maplibregl-controller.js +483 -469
  53. package/maplibregl-controller.js.map +1 -1
  54. package/maplibregl-controller.umd.js +3 -3
  55. package/maplibregl-controller.umd.js.map +1 -1
  56. package/maplibregl.d.ts +2499 -13
  57. package/maplibregl.js +2435 -2139
  58. package/maplibregl.js.map +1 -1
  59. package/maplibregl.umd.js +3 -3
  60. package/maplibregl.umd.js.map +1 -1
  61. package/maptilersdk.d.ts +2499 -13
  62. package/maptilersdk.js +2432 -2139
  63. package/maptilersdk.js.map +1 -1
  64. package/maptilersdk.umd.js +3 -3
  65. package/maptilersdk.umd.js.map +1 -1
  66. package/openlayers-controller.d.ts +1 -1
  67. package/openlayers-controller.js +66 -63
  68. package/openlayers-controller.js.map +1 -1
  69. package/openlayers-controller.umd.js +2 -2
  70. package/openlayers-controller.umd.js.map +1 -1
  71. package/openlayers.d.ts +53 -1
  72. package/openlayers.js +2046 -1902
  73. package/openlayers.js.map +1 -1
  74. package/openlayers.umd.js +3 -3
  75. package/openlayers.umd.js.map +1 -1
  76. package/package.json +28 -28
  77. package/react.d.ts +31 -5
  78. package/react.js +1252 -1096
  79. package/react.js.map +1 -1
  80. package/react.umd.js +1 -1
  81. package/react.umd.js.map +1 -1
  82. package/style.css +1 -1
  83. package/svelte/FeatureItem.svelte +60 -13
  84. package/svelte/FeatureItem.svelte.d.ts +4 -4
  85. package/svelte/GeocodingControl.svelte +166 -98
  86. package/svelte/GeocodingControl.svelte.d.ts +36 -16
  87. package/svelte/MapLibreBasedGeocodingControl.d.ts +3027 -27
  88. package/svelte/MapLibreBasedGeocodingControl.js +154 -21
  89. package/svelte/leaflet-controller.d.ts +1 -1
  90. package/svelte/leaflet-controller.js +6 -3
  91. package/svelte/leaflet.d.ts +58 -5
  92. package/svelte/leaflet.js +52 -21
  93. package/svelte/maplibregl-controller.d.ts +1 -1
  94. package/svelte/maplibregl-controller.js +47 -38
  95. package/svelte/maplibregl.d.ts +2499 -13
  96. package/svelte/maplibregl.js +11 -3
  97. package/svelte/maptilersdk.d.ts +2499 -13
  98. package/svelte/maptilersdk.js +11 -3
  99. package/svelte/openlayers-controller.d.ts +1 -1
  100. package/svelte/openlayers-controller.js +7 -4
  101. package/svelte/openlayers.d.ts +53 -1
  102. package/svelte/openlayers.js +66 -48
  103. package/svelte/react.d.ts +31 -5
  104. package/svelte/react.js +21 -9
  105. package/svelte/types.d.ts +106 -35
  106. package/svelte/vanilla.d.ts +46 -2
  107. package/svelte/vanilla.js +66 -10
  108. package/types.d.ts +106 -35
  109. package/vanilla.d.ts +46 -2
  110. package/vanilla.js +1260 -1057
  111. package/vanilla.js.map +1 -1
  112. package/vanilla.umd.js +1 -1
  113. package/vanilla.umd.js.map +1 -1
  114. package/icons/aerodrome.12.svg +0 -1
  115. package/icons/bus_stop.12.svg +0 -1
  116. package/icons/elevator.12.svg +0 -1
  117. /package/icons/{helipad.16.svg → helipad.svg} +0 -0
  118. /package/icons/{traffic_light.13.svg → traffic_light.svg} +0 -0
@@ -1,11 +1,11 @@
1
- var Kt = Object.defineProperty;
2
- var Ht = (i, t, e) => t in i ? Kt(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
- var it = (i, t, e) => Ht(i, typeof t != "symbol" ? t + "" : t, e);
1
+ var te = Object.defineProperty;
2
+ var ee = (i, t, e) => t in i ? te(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var rt = (i, t, e) => ee(i, typeof t != "symbol" ? t + "" : t, e);
4
4
  function X(i, t, e = {}) {
5
5
  const n = { type: "Feature" };
6
6
  return (e.id === 0 || e.id) && (n.id = e.id), e.bbox && (n.bbox = e.bbox), n.properties = t || {}, n.geometry = i, n;
7
7
  }
8
- function pt(i, t, e = {}) {
8
+ function yt(i, t, e = {}) {
9
9
  for (const r of i) {
10
10
  if (r.length < 4)
11
11
  throw new Error(
@@ -54,15 +54,15 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
54
54
  See the Apache Version 2.0 License for specific language governing permissions
55
55
  and limitations under the License.
56
56
  ***************************************************************************** */
57
- function te(i, t) {
57
+ function ne(i, t) {
58
58
  var e = { label: 0, sent: function() {
59
59
  if (o[0] & 1) throw o[1];
60
60
  return o[1];
61
61
  }, trys: [], ops: [] }, n, r, o, f;
62
- return f = { next: s(0), throw: s(1), return: s(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
62
+ return f = { next: l(0), throw: l(1), return: l(2) }, typeof Symbol == "function" && (f[Symbol.iterator] = function() {
63
63
  return this;
64
64
  }), f;
65
- function s(u) {
65
+ function l(u) {
66
66
  return function(g) {
67
67
  return c([u, g]);
68
68
  };
@@ -123,7 +123,7 @@ var G = (
123
123
  return i;
124
124
  }()
125
125
  );
126
- function ee(i, t) {
126
+ function ie(i, t) {
127
127
  return i > t ? 1 : i < t ? -1 : 0;
128
128
  }
129
129
  function B(i, t, e) {
@@ -133,8 +133,8 @@ function B(i, t, e) {
133
133
  if (t.left === null)
134
134
  break;
135
135
  if (e(i, t.left.key) < 0) {
136
- var s = t.left;
137
- if (t.left = s.right, s.right = t, t = s, t.left === null)
136
+ var l = t.left;
137
+ if (t.left = l.right, l.right = t, t = l, t.left === null)
138
138
  break;
139
139
  }
140
140
  o.left = t, o = t, t = t.left;
@@ -142,8 +142,8 @@ function B(i, t, e) {
142
142
  if (t.right === null)
143
143
  break;
144
144
  if (e(i, t.right.key) > 0) {
145
- var s = t.right;
146
- if (t.right = s.left, s.left = t, t = s, t.right === null)
145
+ var l = t.right;
146
+ if (t.right = l.left, l.left = t, t = l, t.right === null)
147
147
  break;
148
148
  }
149
149
  r.right = t, r = t, t = t.right;
@@ -152,7 +152,7 @@ function B(i, t, e) {
152
152
  }
153
153
  return r.right = t.left, o.left = t.right, t.left = n.right, t.right = n.left, t;
154
154
  }
155
- function rt(i, t, e, n) {
155
+ function ot(i, t, e, n) {
156
156
  var r = new G(i, t);
157
157
  if (e === null)
158
158
  return r.left = r.right = null, r;
@@ -160,7 +160,7 @@ function rt(i, t, e, n) {
160
160
  var o = n(i, e.key);
161
161
  return o < 0 ? (r.left = e.left, r.right = e, e.left = null) : o >= 0 && (r.right = e.right, r.left = e, e.right = null), r;
162
162
  }
163
- function vt(i, t, e) {
163
+ function Et(i, t, e) {
164
164
  var n = null, r = null;
165
165
  if (t) {
166
166
  t = B(i, t, e);
@@ -169,25 +169,25 @@ function vt(i, t, e) {
169
169
  }
170
170
  return { left: n, right: r };
171
171
  }
172
- function ne(i, t, e) {
172
+ function re(i, t, e) {
173
173
  return t === null ? i : (i === null || (t = B(i.key, t, e), t.left = i), t);
174
174
  }
175
- function lt(i, t, e, n, r) {
175
+ function ut(i, t, e, n, r) {
176
176
  if (i) {
177
177
  n("" + t + (e ? "└── " : "├── ") + r(i) + `
178
178
  `);
179
179
  var o = t + (e ? " " : "│ ");
180
- i.left && lt(i.left, o, !1, n, r), i.right && lt(i.right, o, !0, n, r);
180
+ i.left && ut(i.left, o, !1, n, r), i.right && ut(i.right, o, !0, n, r);
181
181
  }
182
182
  }
183
- var yt = (
183
+ var dt = (
184
184
  /** @class */
185
185
  function() {
186
186
  function i(t) {
187
- t === void 0 && (t = ee), this._root = null, this._size = 0, this._comparator = t;
187
+ t === void 0 && (t = ie), this._root = null, this._size = 0, this._comparator = t;
188
188
  }
189
189
  return i.prototype.insert = function(t, e) {
190
- return this._size++, this._root = rt(t, e, this._root, this._comparator);
190
+ return this._size++, this._root = ot(t, e, this._root, this._comparator);
191
191
  }, i.prototype.add = function(t, e) {
192
192
  var n = new G(t, e);
193
193
  this._root === null && (n.left = n.right = null, this._size++, this._root = n);
@@ -233,15 +233,15 @@ var yt = (
233
233
  n !== null ? (r.push(n), n = n.left) : r.length !== 0 ? (n = r.pop(), t.call(e, n), n = n.right) : o = !0;
234
234
  return this;
235
235
  }, i.prototype.range = function(t, e, n, r) {
236
- for (var o = [], f = this._comparator, s = this._root, c; o.length !== 0 || s; )
237
- if (s)
238
- o.push(s), s = s.left;
236
+ for (var o = [], f = this._comparator, l = this._root, c; o.length !== 0 || l; )
237
+ if (l)
238
+ o.push(l), l = l.left;
239
239
  else {
240
- if (s = o.pop(), c = f(s.key, e), c > 0)
240
+ if (l = o.pop(), c = f(l.key, e), c > 0)
241
241
  break;
242
- if (f(s.key, t) >= 0 && n.call(r, s))
242
+ if (f(l.key, t) >= 0 && n.call(r, l))
243
243
  return this;
244
- s = s.right;
244
+ l = l.right;
245
245
  }
246
246
  return this;
247
247
  }, i.prototype.keys = function() {
@@ -312,15 +312,15 @@ var yt = (
312
312
  }, i.prototype.clear = function() {
313
313
  return this._root = null, this._size = 0, this;
314
314
  }, i.prototype.toList = function() {
315
- return re(this._root);
315
+ return se(this._root);
316
316
  }, i.prototype.load = function(t, e, n) {
317
317
  e === void 0 && (e = []), n === void 0 && (n = !1);
318
318
  var r = t.length, o = this._comparator;
319
- if (n && ct(t, e, 0, r - 1, o), this._root === null)
320
- this._root = ut(t, e, 0, r), this._size = r;
319
+ if (n && ht(t, e, 0, r - 1, o), this._root === null)
320
+ this._root = ft(t, e, 0, r), this._size = r;
321
321
  else {
322
- var f = oe(this.toList(), ie(t, e), o);
323
- r = this._size + r, this._root = ft({ head: f }, 0, r);
322
+ var f = le(this.toList(), oe(t, e), o);
323
+ r = this._size + r, this._root = ct({ head: f }, 0, r);
324
324
  }
325
325
  return this;
326
326
  }, i.prototype.isEmpty = function() {
@@ -342,17 +342,17 @@ var yt = (
342
342
  return String(n.key);
343
343
  });
344
344
  var e = [];
345
- return lt(this._root, "", !0, function(n) {
345
+ return ut(this._root, "", !0, function(n) {
346
346
  return e.push(n);
347
347
  }, t), e.join("");
348
348
  }, i.prototype.update = function(t, e, n) {
349
- var r = this._comparator, o = vt(t, this._root, r), f = o.left, s = o.right;
350
- r(t, e) < 0 ? s = rt(e, n, s, r) : f = rt(e, n, f, r), this._root = ne(f, s, r);
349
+ var r = this._comparator, o = Et(t, this._root, r), f = o.left, l = o.right;
350
+ r(t, e) < 0 ? l = ot(e, n, l, r) : f = ot(e, n, f, r), this._root = re(f, l, r);
351
351
  }, i.prototype.split = function(t) {
352
- return vt(t, this._root, this._comparator);
352
+ return Et(t, this._root, this._comparator);
353
353
  }, i.prototype[Symbol.iterator] = function() {
354
354
  var t, e, n;
355
- return te(this, function(r) {
355
+ return ne(this, function(r) {
356
356
  switch (r.label) {
357
357
  case 0:
358
358
  t = this._root, e = [], n = !1, r.label = 1;
@@ -376,69 +376,69 @@ var yt = (
376
376
  }, i;
377
377
  }()
378
378
  );
379
- function ut(i, t, e, n) {
379
+ function ft(i, t, e, n) {
380
380
  var r = n - e;
381
381
  if (r > 0) {
382
- var o = e + Math.floor(r / 2), f = i[o], s = t[o], c = new G(f, s);
383
- return c.left = ut(i, t, e, o), c.right = ut(i, t, o + 1, n), c;
382
+ var o = e + Math.floor(r / 2), f = i[o], l = t[o], c = new G(f, l);
383
+ return c.left = ft(i, t, e, o), c.right = ft(i, t, o + 1, n), c;
384
384
  }
385
385
  return null;
386
386
  }
387
- function ie(i, t) {
387
+ function oe(i, t) {
388
388
  for (var e = new G(null, null), n = e, r = 0; r < i.length; r++)
389
389
  n = n.next = new G(i[r], t[r]);
390
390
  return n.next = null, e.next;
391
391
  }
392
- function re(i) {
392
+ function se(i) {
393
393
  for (var t = i, e = [], n = !1, r = new G(null, null), o = r; !n; )
394
394
  t ? (e.push(t), t = t.left) : e.length > 0 ? (t = o = o.next = e.pop(), t = t.right) : n = !0;
395
395
  return o.next = null, r.next;
396
396
  }
397
- function ft(i, t, e) {
397
+ function ct(i, t, e) {
398
398
  var n = e - t;
399
399
  if (n > 0) {
400
- var r = t + Math.floor(n / 2), o = ft(i, t, r), f = i.head;
401
- return f.left = o, i.head = i.head.next, f.right = ft(i, r + 1, e), f;
400
+ var r = t + Math.floor(n / 2), o = ct(i, t, r), f = i.head;
401
+ return f.left = o, i.head = i.head.next, f.right = ct(i, r + 1, e), f;
402
402
  }
403
403
  return null;
404
404
  }
405
- function oe(i, t, e) {
405
+ function le(i, t, e) {
406
406
  for (var n = new G(null, null), r = n, o = i, f = t; o !== null && f !== null; )
407
407
  e(o.key, f.key) < 0 ? (r.next = o, o = o.next) : (r.next = f, f = f.next), r = r.next;
408
408
  return o !== null ? r.next = o : f !== null && (r.next = f), n.next;
409
409
  }
410
- function ct(i, t, e, n, r) {
410
+ function ht(i, t, e, n, r) {
411
411
  if (!(e >= n)) {
412
- for (var o = i[e + n >> 1], f = e - 1, s = n + 1; ; ) {
412
+ for (var o = i[e + n >> 1], f = e - 1, l = n + 1; ; ) {
413
413
  do
414
414
  f++;
415
415
  while (r(i[f], o) < 0);
416
416
  do
417
- s--;
418
- while (r(i[s], o) > 0);
419
- if (f >= s)
417
+ l--;
418
+ while (r(i[l], o) > 0);
419
+ if (f >= l)
420
420
  break;
421
421
  var c = i[f];
422
- i[f] = i[s], i[s] = c, c = t[f], t[f] = t[s], t[s] = c;
422
+ i[f] = i[l], i[l] = c, c = t[f], t[f] = t[l], t[l] = c;
423
423
  }
424
- ct(i, t, e, s, r), ct(i, t, s + 1, n, r);
424
+ ht(i, t, e, l, r), ht(i, t, l + 1, n, r);
425
425
  }
426
426
  }
427
- const O = 11102230246251565e-32, S = 134217729, se = (3 + 8 * O) * O;
428
- function ot(i, t, e, n, r) {
429
- let o, f, s, c, u = t[0], g = n[0], l = 0, h = 0;
430
- g > u == g > -u ? (o = u, u = t[++l]) : (o = g, g = n[++h]);
427
+ const O = 11102230246251565e-32, S = 134217729, ue = (3 + 8 * O) * O;
428
+ function st(i, t, e, n, r) {
429
+ let o, f, l, c, u = t[0], g = n[0], s = 0, h = 0;
430
+ g > u == g > -u ? (o = u, u = t[++s]) : (o = g, g = n[++h]);
431
431
  let a = 0;
432
- if (l < i && h < e)
433
- for (g > u == g > -u ? (f = u + o, s = o - (f - u), u = t[++l]) : (f = g + o, s = o - (f - g), g = n[++h]), o = f, s !== 0 && (r[a++] = s); l < i && h < e; )
434
- g > u == g > -u ? (f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l]) : (f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h]), o = f, s !== 0 && (r[a++] = s);
435
- for (; l < i; )
436
- f = o + u, c = f - o, s = o - (f - c) + (u - c), u = t[++l], o = f, s !== 0 && (r[a++] = s);
432
+ if (s < i && h < e)
433
+ for (g > u == g > -u ? (f = u + o, l = o - (f - u), u = t[++s]) : (f = g + o, l = o - (f - g), g = n[++h]), o = f, l !== 0 && (r[a++] = l); s < i && h < e; )
434
+ g > u == g > -u ? (f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s]) : (f = o + g, c = f - o, l = o - (f - c) + (g - c), g = n[++h]), o = f, l !== 0 && (r[a++] = l);
435
+ for (; s < i; )
436
+ f = o + u, c = f - o, l = o - (f - c) + (u - c), u = t[++s], o = f, l !== 0 && (r[a++] = l);
437
437
  for (; h < e; )
438
- f = o + g, c = f - o, s = o - (f - c) + (g - c), g = n[++h], o = f, s !== 0 && (r[a++] = s);
438
+ f = o + g, c = f - o, l = o - (f - c) + (g - c), g = n[++h], o = f, l !== 0 && (r[a++] = l);
439
439
  return (o !== 0 || a === 0) && (r[a++] = o), a;
440
440
  }
441
- function le(i, t) {
441
+ function fe(i, t) {
442
442
  let e = t[0];
443
443
  for (let n = 1; n < i; n++) e += t[n];
444
444
  return e;
@@ -446,26 +446,26 @@ function le(i, t) {
446
446
  function J(i) {
447
447
  return new Float64Array(i);
448
448
  }
449
- const ue = (3 + 16 * O) * O, fe = (2 + 12 * O) * O, ce = (9 + 64 * O) * O * O, j = J(4), mt = J(8), Et = J(12), wt = J(16), P = J(4);
450
- function he(i, t, e, n, r, o, f) {
451
- let s, c, u, g, l, h, a, d, x, p, y, v, m, E, w, b, M, _;
452
- const R = i - r, k = e - r, C = t - o, I = n - o;
453
- E = R * I, h = S * R, a = h - (h - R), d = R - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = C * k, h = S * C, a = h - (h - C), d = C - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, j[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, j[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, j[2] = v - (_ - l) + (y - l), j[3] = _;
454
- let A = le(4, j), Y = fe * f;
455
- if (A >= Y || -A >= Y || (l = i - R, s = i - (R + l) + (l - r), l = e - k, u = e - (k + l) + (l - r), l = t - C, c = t - (C + l) + (l - o), l = n - I, g = n - (I + l) + (l - o), s === 0 && c === 0 && u === 0 && g === 0) || (Y = ce * f + se * Math.abs(A), A += R * g + I * s - (C * u + k * c), A >= Y || -A >= Y)) return A;
456
- E = s * I, h = S * s, a = h - (h - s), d = s - a, h = S * I, x = h - (h - I), p = I - x, w = d * p - (E - a * x - d * x - a * p), b = c * k, h = S * c, a = h - (h - c), d = c - a, h = S * k, x = h - (h - k), p = k - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
457
- const Zt = ot(4, j, 4, P, mt);
458
- E = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = C * u, h = S * C, a = h - (h - C), d = C - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
459
- const Wt = ot(Zt, mt, 4, P, Et);
460
- E = s * g, h = S * s, a = h - (h - s), d = s - a, h = S * g, x = h - (h - g), p = g - x, w = d * p - (E - a * x - d * x - a * p), b = c * u, h = S * c, a = h - (h - c), d = c - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = w - M, l = w - y, P[0] = w - (y + l) + (l - M), v = E + y, l = v - E, m = E - (v - l) + (y - l), y = m - b, l = m - y, P[1] = m - (y + l) + (l - b), _ = v + y, l = _ - v, P[2] = v - (_ - l) + (y - l), P[3] = _;
461
- const Jt = ot(Wt, Et, 4, P, wt);
462
- return wt[Jt - 1];
463
- }
464
- function ae(i, t, e, n, r, o) {
465
- const f = (t - o) * (e - r), s = (i - r) * (n - o), c = f - s, u = Math.abs(f + s);
466
- return Math.abs(c) >= ue * u ? c : -he(i, t, e, n, r, o, u);
467
- }
468
- const F = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, ht = (i, t) => {
449
+ const ce = (3 + 16 * O) * O, he = (2 + 12 * O) * O, ae = (9 + 64 * O) * O * O, U = J(4), mt = J(8), wt = J(12), bt = J(16), P = J(4);
450
+ function ge(i, t, e, n, r, o, f) {
451
+ let l, c, u, g, s, h, a, d, x, p, y, w, v, E, m, b, M, _;
452
+ const R = i - r, I = e - r, C = t - o, k = n - o;
453
+ E = R * k, h = S * R, a = h - (h - R), d = R - a, h = S * k, x = h - (h - k), p = k - x, m = d * p - (E - a * x - d * x - a * p), b = C * I, h = S * C, a = h - (h - C), d = C - a, h = S * I, x = h - (h - I), p = I - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, U[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, U[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, U[2] = w - (_ - s) + (y - s), U[3] = _;
454
+ let A = fe(4, U), F = he * f;
455
+ if (A >= F || -A >= F || (s = i - R, l = i - (R + s) + (s - r), s = e - I, u = e - (I + s) + (s - r), s = t - C, c = t - (C + s) + (s - o), s = n - k, g = n - (k + s) + (s - o), l === 0 && c === 0 && u === 0 && g === 0) || (F = ae * f + ue * Math.abs(A), A += R * g + k * l - (C * u + I * c), A >= F || -A >= F)) return A;
456
+ E = l * k, h = S * l, a = h - (h - l), d = l - a, h = S * k, x = h - (h - k), p = k - x, m = d * p - (E - a * x - d * x - a * p), b = c * I, h = S * c, a = h - (h - c), d = c - a, h = S * I, x = h - (h - I), p = I - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, P[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, P[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, P[2] = w - (_ - s) + (y - s), P[3] = _;
457
+ const Jt = st(4, U, 4, P, mt);
458
+ E = R * g, h = S * R, a = h - (h - R), d = R - a, h = S * g, x = h - (h - g), p = g - x, m = d * p - (E - a * x - d * x - a * p), b = C * u, h = S * C, a = h - (h - C), d = C - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, P[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, P[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, P[2] = w - (_ - s) + (y - s), P[3] = _;
459
+ const Kt = st(Jt, mt, 4, P, wt);
460
+ E = l * g, h = S * l, a = h - (h - l), d = l - a, h = S * g, x = h - (h - g), p = g - x, m = d * p - (E - a * x - d * x - a * p), b = c * u, h = S * c, a = h - (h - c), d = c - a, h = S * u, x = h - (h - u), p = u - x, M = d * p - (b - a * x - d * x - a * p), y = m - M, s = m - y, P[0] = m - (y + s) + (s - M), w = E + y, s = w - E, v = E - (w - s) + (y - s), y = v - b, s = v - y, P[1] = v - (y + s) + (s - b), _ = w + y, s = _ - w, P[2] = w - (_ - s) + (y - s), P[3] = _;
461
+ const Ht = st(Kt, wt, 4, P, bt);
462
+ return bt[Ht - 1];
463
+ }
464
+ function pe(i, t, e, n, r, o) {
465
+ const f = (t - o) * (e - r), l = (i - r) * (n - o), c = f - l, u = Math.abs(f + l);
466
+ return Math.abs(c) >= ce * u ? c : -ge(i, t, e, n, r, o, u);
467
+ }
468
+ const Q = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.ur.y, at = (i, t) => {
469
469
  if (t.ur.x < i.ll.x || i.ur.x < t.ll.x || t.ur.y < i.ll.y || i.ur.y < t.ll.y) return null;
470
470
  const e = i.ll.x < t.ll.x ? t.ll.x : i.ll.x, n = i.ur.x < t.ur.x ? i.ur.x : t.ur.x, r = i.ll.y < t.ll.y ? t.ll.y : i.ll.y, o = i.ur.y < t.ur.y ? i.ur.y : t.ur.y;
471
471
  return {
@@ -479,20 +479,20 @@ const F = (i, t) => i.ll.x <= t.x && t.x <= i.ur.x && i.ll.y <= t.y && t.y <= i.
479
479
  }
480
480
  };
481
481
  };
482
- let z = Number.EPSILON;
483
- z === void 0 && (z = Math.pow(2, -52));
484
- const ge = z * z, bt = (i, t) => {
485
- if (-z < i && i < z && -z < t && t < z)
482
+ let T = Number.EPSILON;
483
+ T === void 0 && (T = Math.pow(2, -52));
484
+ const ye = T * T, _t = (i, t) => {
485
+ if (-T < i && i < T && -T < t && t < T)
486
486
  return 0;
487
487
  const e = i - t;
488
- return e * e < ge * i * t ? 0 : i < t ? -1 : 1;
488
+ return e * e < ye * i * t ? 0 : i < t ? -1 : 1;
489
489
  };
490
- class pe {
490
+ class de {
491
491
  constructor() {
492
492
  this.reset();
493
493
  }
494
494
  reset() {
495
- this.xRounder = new _t(), this.yRounder = new _t();
495
+ this.xRounder = new St(), this.yRounder = new St();
496
496
  }
497
497
  round(t, e) {
498
498
  return {
@@ -501,9 +501,9 @@ class pe {
501
501
  };
502
502
  }
503
503
  }
504
- class _t {
504
+ class St {
505
505
  constructor() {
506
- this.tree = new yt(), this.round(0);
506
+ this.tree = new dt(), this.round(0);
507
507
  }
508
508
  // Note: this can rounds input values backwards or forwards.
509
509
  // You might ask, why not restrict this to just rounding
@@ -514,16 +514,16 @@ class _t {
514
514
  // angle for t-intersections).
515
515
  round(t) {
516
516
  const e = this.tree.add(t), n = this.tree.prev(e);
517
- if (n !== null && bt(e.key, n.key) === 0)
517
+ if (n !== null && _t(e.key, n.key) === 0)
518
518
  return this.tree.remove(t), n.key;
519
519
  const r = this.tree.next(e);
520
- return r !== null && bt(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
520
+ return r !== null && _t(e.key, r.key) === 0 ? (this.tree.remove(t), r.key) : t;
521
521
  }
522
522
  }
523
- const Z = new pe(), H = (i, t) => i.x * t.y - i.y * t.x, qt = (i, t) => i.x * t.x + i.y * t.y, St = (i, t, e) => {
524
- const n = ae(i.x, i.y, t.x, t.y, e.x, e.y);
523
+ const Z = new de(), tt = (i, t) => i.x * t.y - i.y * t.x, Yt = (i, t) => i.x * t.x + i.y * t.y, Pt = (i, t, e) => {
524
+ const n = pe(i.x, i.y, t.x, t.y, e.x, e.y);
525
525
  return n > 0 ? -1 : n < 0 ? 1 : 0;
526
- }, tt = (i) => Math.sqrt(qt(i, i)), ye = (i, t, e) => {
526
+ }, et = (i) => Math.sqrt(Yt(i, i)), xe = (i, t, e) => {
527
527
  const n = {
528
528
  x: t.x - i.x,
529
529
  y: t.y - i.y
@@ -531,8 +531,8 @@ const Z = new pe(), H = (i, t) => i.x * t.y - i.y * t.x, qt = (i, t) => i.x * t.
531
531
  x: e.x - i.x,
532
532
  y: e.y - i.y
533
533
  };
534
- return H(r, n) / tt(r) / tt(n);
535
- }, de = (i, t, e) => {
534
+ return tt(r, n) / et(r) / et(n);
535
+ }, ve = (i, t, e) => {
536
536
  const n = {
537
537
  x: t.x - i.x,
538
538
  y: t.y - i.y
@@ -540,24 +540,24 @@ const Z = new pe(), H = (i, t) => i.x * t.y - i.y * t.x, qt = (i, t) => i.x * t.
540
540
  x: e.x - i.x,
541
541
  y: e.y - i.y
542
542
  };
543
- return qt(r, n) / tt(r) / tt(n);
544
- }, Pt = (i, t, e) => t.y === 0 ? null : {
543
+ return Yt(r, n) / et(r) / et(n);
544
+ }, Mt = (i, t, e) => t.y === 0 ? null : {
545
545
  x: i.x + t.x / t.y * (e - i.y),
546
546
  y: e
547
- }, Mt = (i, t, e) => t.x === 0 ? null : {
547
+ }, Lt = (i, t, e) => t.x === 0 ? null : {
548
548
  x: e,
549
549
  y: i.y + t.y / t.x * (e - i.x)
550
- }, xe = (i, t, e, n) => {
551
- if (t.x === 0) return Mt(e, n, i.x);
552
- if (n.x === 0) return Mt(i, t, e.x);
553
- if (t.y === 0) return Pt(e, n, i.y);
554
- if (n.y === 0) return Pt(i, t, e.y);
555
- const r = H(t, n);
550
+ }, Ee = (i, t, e, n) => {
551
+ if (t.x === 0) return Lt(e, n, i.x);
552
+ if (n.x === 0) return Lt(i, t, e.x);
553
+ if (t.y === 0) return Mt(e, n, i.y);
554
+ if (n.y === 0) return Mt(i, t, e.y);
555
+ const r = tt(t, n);
556
556
  if (r == 0) return null;
557
557
  const o = {
558
558
  x: e.x - i.x,
559
559
  y: e.y - i.y
560
- }, f = H(o, t) / r, s = H(o, n) / r, c = i.x + s * t.x, u = e.x + f * n.x, g = i.y + s * t.y, l = e.y + f * n.y, h = (c + u) / 2, a = (g + l) / 2;
560
+ }, f = tt(o, t) / r, l = tt(o, n) / r, c = i.x + l * t.x, u = e.x + f * n.x, g = i.y + l * t.y, s = e.y + f * n.y, h = (c + u) / 2, a = (g + s) / 2;
561
561
  return {
562
562
  x: h,
563
563
  y: a
@@ -567,7 +567,7 @@ class L {
567
567
  // for ordering sweep events in the sweep event queue
568
568
  static compare(t, e) {
569
569
  const n = L.comparePoints(t.point, e.point);
570
- return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 : T.compare(t.segment, e.segment));
570
+ return n !== 0 ? n : (t.point !== e.point && t.link(e), t.isLeft !== e.isLeft ? t.isLeft ? 1 : -1 : z.compare(t.segment, e.segment));
571
571
  }
572
572
  // for ordering points in sweep line order
573
573
  static comparePoints(t, e) {
@@ -622,25 +622,25 @@ class L {
622
622
  const e = /* @__PURE__ */ new Map(), n = (r) => {
623
623
  const o = r.otherSE;
624
624
  e.set(r, {
625
- sine: ye(this.point, t.point, o.point),
626
- cosine: de(this.point, t.point, o.point)
625
+ sine: xe(this.point, t.point, o.point),
626
+ cosine: ve(this.point, t.point, o.point)
627
627
  });
628
628
  };
629
629
  return (r, o) => {
630
630
  e.has(r) || n(r), e.has(o) || n(o);
631
631
  const {
632
632
  sine: f,
633
- cosine: s
633
+ cosine: l
634
634
  } = e.get(r), {
635
635
  sine: c,
636
636
  cosine: u
637
637
  } = e.get(o);
638
- return f >= 0 && c >= 0 ? s < u ? 1 : s > u ? -1 : 0 : f < 0 && c < 0 ? s < u ? -1 : s > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
638
+ return f >= 0 && c >= 0 ? l < u ? 1 : l > u ? -1 : 0 : f < 0 && c < 0 ? l < u ? -1 : l > u ? 1 : 0 : c < f ? -1 : c > f ? 1 : 0;
639
639
  };
640
640
  }
641
641
  }
642
- let ve = 0;
643
- class T {
642
+ let me = 0;
643
+ class z {
644
644
  /* This compare() function is for ordering segments in the sweep
645
645
  * line tree, and does so according to the following criteria:
646
646
  *
@@ -658,57 +658,57 @@ class T {
658
658
  const n = t.leftSE.point.x, r = e.leftSE.point.x, o = t.rightSE.point.x, f = e.rightSE.point.x;
659
659
  if (f < n) return 1;
660
660
  if (o < r) return -1;
661
- const s = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
661
+ const l = t.leftSE.point.y, c = e.leftSE.point.y, u = t.rightSE.point.y, g = e.rightSE.point.y;
662
662
  if (n < r) {
663
- if (c < s && c < u) return 1;
664
- if (c > s && c > u) return -1;
665
- const l = t.comparePoint(e.leftSE.point);
666
- if (l < 0) return 1;
667
- if (l > 0) return -1;
663
+ if (c < l && c < u) return 1;
664
+ if (c > l && c > u) return -1;
665
+ const s = t.comparePoint(e.leftSE.point);
666
+ if (s < 0) return 1;
667
+ if (s > 0) return -1;
668
668
  const h = e.comparePoint(t.rightSE.point);
669
669
  return h !== 0 ? h : -1;
670
670
  }
671
671
  if (n > r) {
672
- if (s < c && s < g) return -1;
673
- if (s > c && s > g) return 1;
674
- const l = e.comparePoint(t.leftSE.point);
675
- if (l !== 0) return l;
672
+ if (l < c && l < g) return -1;
673
+ if (l > c && l > g) return 1;
674
+ const s = e.comparePoint(t.leftSE.point);
675
+ if (s !== 0) return s;
676
676
  const h = t.comparePoint(e.rightSE.point);
677
677
  return h < 0 ? 1 : h > 0 ? -1 : 1;
678
678
  }
679
- if (s < c) return -1;
680
- if (s > c) return 1;
679
+ if (l < c) return -1;
680
+ if (l > c) return 1;
681
681
  if (o < f) {
682
- const l = e.comparePoint(t.rightSE.point);
683
- if (l !== 0) return l;
682
+ const s = e.comparePoint(t.rightSE.point);
683
+ if (s !== 0) return s;
684
684
  }
685
685
  if (o > f) {
686
- const l = t.comparePoint(e.rightSE.point);
687
- if (l < 0) return 1;
688
- if (l > 0) return -1;
686
+ const s = t.comparePoint(e.rightSE.point);
687
+ if (s < 0) return 1;
688
+ if (s > 0) return -1;
689
689
  }
690
690
  if (o !== f) {
691
- const l = u - s, h = o - n, a = g - c, d = f - r;
692
- if (l > h && a < d) return 1;
693
- if (l < h && a > d) return -1;
691
+ const s = u - l, h = o - n, a = g - c, d = f - r;
692
+ if (s > h && a < d) return 1;
693
+ if (s < h && a > d) return -1;
694
694
  }
695
695
  return o > f ? 1 : o < f || u < g ? -1 : u > g ? 1 : t.id < e.id ? -1 : t.id > e.id ? 1 : 0;
696
696
  }
697
697
  /* Warning: a reference to ringWindings input will be stored,
698
698
  * and possibly will be later modified */
699
699
  constructor(t, e, n, r) {
700
- this.id = ++ve, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
700
+ this.id = ++me, this.leftSE = t, t.segment = this, t.otherSE = e, this.rightSE = e, e.segment = this, e.otherSE = t, this.rings = n, this.windings = r;
701
701
  }
702
702
  static fromRing(t, e, n) {
703
703
  let r, o, f;
704
- const s = L.comparePoints(t, e);
705
- if (s < 0)
704
+ const l = L.comparePoints(t, e);
705
+ if (l < 0)
706
706
  r = t, o = e, f = 1;
707
- else if (s > 0)
707
+ else if (l > 0)
708
708
  r = e, o = t, f = -1;
709
709
  else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);
710
710
  const c = new L(r, !0), u = new L(o, !1);
711
- return new T(c, u, [n], [f]);
711
+ return new z(c, u, [n], [f]);
712
712
  }
713
713
  /* When a segment is split, the rightSE is replaced with a new sweep event */
714
714
  replaceRightSE(t) {
@@ -757,7 +757,7 @@ class T {
757
757
  return t.x === e.x ? 0 : t.x < e.x ? 1 : -1;
758
758
  const o = (t.y - e.y) / r.y, f = e.x + o * r.x;
759
759
  if (t.x === f) return 0;
760
- const s = (t.x - e.x) / r.x, c = e.y + s * r.y;
760
+ const l = (t.x - e.x) / r.x, c = e.y + l * r.y;
761
761
  return t.y === c ? 0 : t.y < c ? -1 : 1;
762
762
  }
763
763
  /**
@@ -776,20 +776,20 @@ class T {
776
776
  * Else, return null.
777
777
  */
778
778
  getIntersection(t) {
779
- const e = this.bbox(), n = t.bbox(), r = ht(e, n);
779
+ const e = this.bbox(), n = t.bbox(), r = at(e, n);
780
780
  if (r === null) return null;
781
- const o = this.leftSE.point, f = this.rightSE.point, s = t.leftSE.point, c = t.rightSE.point, u = F(e, s) && this.comparePoint(s) === 0, g = F(n, o) && t.comparePoint(o) === 0, l = F(e, c) && this.comparePoint(c) === 0, h = F(n, f) && t.comparePoint(f) === 0;
781
+ const o = this.leftSE.point, f = this.rightSE.point, l = t.leftSE.point, c = t.rightSE.point, u = Q(e, l) && this.comparePoint(l) === 0, g = Q(n, o) && t.comparePoint(o) === 0, s = Q(e, c) && this.comparePoint(c) === 0, h = Q(n, f) && t.comparePoint(f) === 0;
782
782
  if (g && u)
783
- return h && !l ? f : !h && l ? c : null;
783
+ return h && !s ? f : !h && s ? c : null;
784
784
  if (g)
785
- return l && o.x === c.x && o.y === c.y ? null : o;
785
+ return s && o.x === c.x && o.y === c.y ? null : o;
786
786
  if (u)
787
- return h && f.x === s.x && f.y === s.y ? null : s;
788
- if (h && l) return null;
787
+ return h && f.x === l.x && f.y === l.y ? null : l;
788
+ if (h && s) return null;
789
789
  if (h) return f;
790
- if (l) return c;
791
- const a = xe(o, this.vector(), s, t.vector());
792
- return a === null || !F(r, a) ? null : Z.round(a.x, a.y);
790
+ if (s) return c;
791
+ const a = Ee(o, this.vector(), l, t.vector());
792
+ return a === null || !Q(r, a) ? null : Z.round(a.x, a.y);
793
793
  }
794
794
  /**
795
795
  * Split the given segment into multiple segments on the given points.
@@ -806,8 +806,8 @@ class T {
806
806
  split(t) {
807
807
  const e = [], n = t.events !== void 0, r = new L(t, !0), o = new L(t, !1), f = this.rightSE;
808
808
  this.replaceRightSE(o), e.push(o), e.push(r);
809
- const s = new T(r, f, this.rings.slice(), this.windings.slice());
810
- return L.comparePoints(s.leftSE.point, s.rightSE.point) > 0 && s.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), o.checkForConsuming()), e;
809
+ const l = new z(r, f, this.rings.slice(), this.windings.slice());
810
+ return L.comparePoints(l.leftSE.point, l.rightSE.point) > 0 && l.swapEvents(), L.comparePoints(this.leftSE.point, this.rightSE.point) > 0 && this.swapEvents(), n && (r.checkForConsuming(), o.checkForConsuming()), e;
811
811
  }
812
812
  /* Swap which event is left and right */
813
813
  swapEvents() {
@@ -822,7 +822,7 @@ class T {
822
822
  let e = this, n = t;
823
823
  for (; e.consumedBy; ) e = e.consumedBy;
824
824
  for (; n.consumedBy; ) n = n.consumedBy;
825
- const r = T.compare(e, n);
825
+ const r = z.compare(e, n);
826
826
  if (r !== 0) {
827
827
  if (r > 0) {
828
828
  const o = e;
@@ -833,8 +833,8 @@ class T {
833
833
  e = n, n = o;
834
834
  }
835
835
  for (let o = 0, f = n.rings.length; o < f; o++) {
836
- const s = n.rings[o], c = n.windings[o], u = e.rings.indexOf(s);
837
- u === -1 ? (e.rings.push(s), e.windings.push(c)) : e.windings[u] += c;
836
+ const l = n.rings[o], c = n.windings[o], u = e.rings.indexOf(l);
837
+ u === -1 ? (e.rings.push(l), e.windings.push(c)) : e.windings[u] += c;
838
838
  }
839
839
  n.rings = null, n.windings = null, n.consumedBy = e, n.leftSE.consumedBy = e.leftSE, n.rightSE.consumedBy = e.rightSE;
840
840
  }
@@ -865,24 +865,24 @@ class T {
865
865
  multiPolys: []
866
866
  };
867
867
  const e = this._afterState.rings, n = this._afterState.windings, r = this._afterState.multiPolys;
868
- for (let s = 0, c = this.rings.length; s < c; s++) {
869
- const u = this.rings[s], g = this.windings[s], l = e.indexOf(u);
870
- l === -1 ? (e.push(u), n.push(g)) : n[l] += g;
868
+ for (let l = 0, c = this.rings.length; l < c; l++) {
869
+ const u = this.rings[l], g = this.windings[l], s = e.indexOf(u);
870
+ s === -1 ? (e.push(u), n.push(g)) : n[s] += g;
871
871
  }
872
872
  const o = [], f = [];
873
- for (let s = 0, c = e.length; s < c; s++) {
874
- if (n[s] === 0) continue;
875
- const u = e[s], g = u.poly;
873
+ for (let l = 0, c = e.length; l < c; l++) {
874
+ if (n[l] === 0) continue;
875
+ const u = e[l], g = u.poly;
876
876
  if (f.indexOf(g) === -1)
877
877
  if (u.isExterior) o.push(g);
878
878
  else {
879
879
  f.indexOf(g) === -1 && f.push(g);
880
- const l = o.indexOf(u.poly);
881
- l !== -1 && o.splice(l, 1);
880
+ const s = o.indexOf(u.poly);
881
+ s !== -1 && o.splice(s, 1);
882
882
  }
883
883
  }
884
- for (let s = 0, c = o.length; s < c; s++) {
885
- const u = o[s].multiPoly;
884
+ for (let l = 0, c = o.length; l < c; l++) {
885
+ const u = o[l].multiPoly;
886
886
  r.indexOf(u) === -1 && r.push(u);
887
887
  }
888
888
  return this._afterState;
@@ -919,7 +919,7 @@ class T {
919
919
  return this._isInResult;
920
920
  }
921
921
  }
922
- class Lt {
922
+ class Rt {
923
923
  constructor(t, e, n) {
924
924
  if (!Array.isArray(t) || t.length === 0)
925
925
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
@@ -937,13 +937,13 @@ class Lt {
937
937
  }
938
938
  };
939
939
  let o = r;
940
- for (let f = 1, s = t.length; f < s; f++) {
940
+ for (let f = 1, l = t.length; f < l; f++) {
941
941
  if (typeof t[f][0] != "number" || typeof t[f][1] != "number")
942
942
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
943
943
  let c = Z.round(t[f][0], t[f][1]);
944
- c.x === o.x && c.y === o.y || (this.segments.push(T.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
944
+ c.x === o.x && c.y === o.y || (this.segments.push(z.fromRing(o, c, this)), c.x < this.bbox.ll.x && (this.bbox.ll.x = c.x), c.y < this.bbox.ll.y && (this.bbox.ll.y = c.y), c.x > this.bbox.ur.x && (this.bbox.ur.x = c.x), c.y > this.bbox.ur.y && (this.bbox.ur.y = c.y), o = c);
945
945
  }
946
- (r.x !== o.x || r.y !== o.y) && this.segments.push(T.fromRing(o, r, this));
946
+ (r.x !== o.x || r.y !== o.y) && this.segments.push(z.fromRing(o, r, this));
947
947
  }
948
948
  getSweepEvents() {
949
949
  const t = [];
@@ -954,11 +954,11 @@ class Lt {
954
954
  return t;
955
955
  }
956
956
  }
957
- class me {
957
+ class we {
958
958
  constructor(t, e) {
959
959
  if (!Array.isArray(t))
960
960
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
961
- this.exteriorRing = new Lt(t[0], this, !0), this.bbox = {
961
+ this.exteriorRing = new Rt(t[0], this, !0), this.bbox = {
962
962
  ll: {
963
963
  x: this.exteriorRing.bbox.ll.x,
964
964
  y: this.exteriorRing.bbox.ll.y
@@ -969,7 +969,7 @@ class me {
969
969
  }
970
970
  }, this.interiorRings = [];
971
971
  for (let n = 1, r = t.length; n < r; n++) {
972
- const o = new Lt(t[n], this, !1);
972
+ const o = new Rt(t[n], this, !1);
973
973
  o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.interiorRings.push(o);
974
974
  }
975
975
  this.multiPoly = e;
@@ -984,7 +984,7 @@ class me {
984
984
  return t;
985
985
  }
986
986
  }
987
- class Rt {
987
+ class It {
988
988
  constructor(t, e) {
989
989
  if (!Array.isArray(t))
990
990
  throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
@@ -1003,7 +1003,7 @@ class Rt {
1003
1003
  }
1004
1004
  };
1005
1005
  for (let n = 0, r = t.length; n < r; n++) {
1006
- const o = new me(t[n], this);
1006
+ const o = new we(t[n], this);
1007
1007
  o.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = o.bbox.ll.x), o.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = o.bbox.ll.y), o.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = o.bbox.ur.x), o.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = o.bbox.ur.y), this.polys.push(o);
1008
1008
  }
1009
1009
  this.isSubject = e;
@@ -1018,7 +1018,7 @@ class Rt {
1018
1018
  return t;
1019
1019
  }
1020
1020
  }
1021
- class et {
1021
+ class nt {
1022
1022
  /* Given the segments from the sweep line pass, compute & return a series
1023
1023
  * of closed rings from all the segments marked to be part of the result */
1024
1024
  static factory(t) {
@@ -1026,11 +1026,11 @@ class et {
1026
1026
  for (let n = 0, r = t.length; n < r; n++) {
1027
1027
  const o = t[n];
1028
1028
  if (!o.isInResult() || o.ringOut) continue;
1029
- let f = null, s = o.leftSE, c = o.rightSE;
1030
- const u = [s], g = s.point, l = [];
1031
- for (; f = s, s = c, u.push(s), s.point !== g; )
1029
+ let f = null, l = o.leftSE, c = o.rightSE;
1030
+ const u = [l], g = l.point, s = [];
1031
+ for (; f = l, l = c, u.push(l), l.point !== g; )
1032
1032
  for (; ; ) {
1033
- const h = s.getAvailableLinkedEvents();
1033
+ const h = l.getAvailableLinkedEvents();
1034
1034
  if (h.length === 0) {
1035
1035
  const x = u[0].point, p = u[u.length - 1].point;
1036
1036
  throw new Error(`Unable to complete output ring starting at [${x.x}, ${x.y}]. Last matching segment found ends at [${p.x}, ${p.y}].`);
@@ -1040,25 +1040,25 @@ class et {
1040
1040
  break;
1041
1041
  }
1042
1042
  let a = null;
1043
- for (let x = 0, p = l.length; x < p; x++)
1044
- if (l[x].point === s.point) {
1043
+ for (let x = 0, p = s.length; x < p; x++)
1044
+ if (s[x].point === l.point) {
1045
1045
  a = x;
1046
1046
  break;
1047
1047
  }
1048
1048
  if (a !== null) {
1049
- const x = l.splice(a)[0], p = u.splice(x.index);
1050
- p.unshift(p[0].otherSE), e.push(new et(p.reverse()));
1049
+ const x = s.splice(a)[0], p = u.splice(x.index);
1050
+ p.unshift(p[0].otherSE), e.push(new nt(p.reverse()));
1051
1051
  continue;
1052
1052
  }
1053
- l.push({
1053
+ s.push({
1054
1054
  index: u.length,
1055
- point: s.point
1055
+ point: l.point
1056
1056
  });
1057
- const d = s.getLeftmostComparator(f);
1057
+ const d = l.getLeftmostComparator(f);
1058
1058
  c = h.sort(d)[0].otherSE;
1059
1059
  break;
1060
1060
  }
1061
- e.push(new et(u));
1061
+ e.push(new nt(u));
1062
1062
  }
1063
1063
  return e;
1064
1064
  }
@@ -1072,14 +1072,14 @@ class et {
1072
1072
  let t = this.events[0].point;
1073
1073
  const e = [t];
1074
1074
  for (let u = 1, g = this.events.length - 1; u < g; u++) {
1075
- const l = this.events[u].point, h = this.events[u + 1].point;
1076
- St(l, t, h) !== 0 && (e.push(l), t = l);
1075
+ const s = this.events[u].point, h = this.events[u + 1].point;
1076
+ Pt(s, t, h) !== 0 && (e.push(s), t = s);
1077
1077
  }
1078
1078
  if (e.length === 1) return null;
1079
1079
  const n = e[0], r = e[1];
1080
- St(n, t, r) === 0 && e.shift(), e.push(e[0]);
1081
- const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, s = this.isExteriorRing() ? e.length : -1, c = [];
1082
- for (let u = f; u != s; u += o) c.push([e[u].x, e[u].y]);
1080
+ Pt(n, t, r) === 0 && e.shift(), e.push(e[0]);
1081
+ const o = this.isExteriorRing() ? 1 : -1, f = this.isExteriorRing() ? 0 : e.length - 1, l = this.isExteriorRing() ? e.length : -1, c = [];
1082
+ for (let u = f; u != l; u += o) c.push([e[u].x, e[u].y]);
1083
1083
  return c;
1084
1084
  }
1085
1085
  isExteriorRing() {
@@ -1109,7 +1109,7 @@ class et {
1109
1109
  }
1110
1110
  }
1111
1111
  }
1112
- class kt {
1112
+ class Ct {
1113
1113
  constructor(t) {
1114
1114
  this.exteriorRing = t, t.poly = this, this.interiorRings = [];
1115
1115
  }
@@ -1126,7 +1126,7 @@ class kt {
1126
1126
  return t;
1127
1127
  }
1128
1128
  }
1129
- class Ee {
1129
+ class be {
1130
1130
  constructor(t) {
1131
1131
  this.rings = t, this.polys = this._composePolys(t);
1132
1132
  }
@@ -1143,19 +1143,19 @@ class Ee {
1143
1143
  for (let n = 0, r = t.length; n < r; n++) {
1144
1144
  const o = t[n];
1145
1145
  if (!o.poly)
1146
- if (o.isExteriorRing()) e.push(new kt(o));
1146
+ if (o.isExteriorRing()) e.push(new Ct(o));
1147
1147
  else {
1148
1148
  const f = o.enclosingRing();
1149
- f.poly || e.push(new kt(f)), f.poly.addInterior(o);
1149
+ f.poly || e.push(new Ct(f)), f.poly.addInterior(o);
1150
1150
  }
1151
1151
  }
1152
1152
  return e;
1153
1153
  }
1154
1154
  }
1155
- class we {
1155
+ class _e {
1156
1156
  constructor(t) {
1157
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : T.compare;
1158
- this.queue = t, this.tree = new yt(e), this.segments = [];
1157
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : z.compare;
1158
+ this.queue = t, this.tree = new dt(e), this.segments = [];
1159
1159
  }
1160
1160
  process(t) {
1161
1161
  const e = t.segment, n = [];
@@ -1163,51 +1163,51 @@ class we {
1163
1163
  return t.isLeft ? this.queue.remove(t.otherSE) : this.tree.remove(e), n;
1164
1164
  const r = t.isLeft ? this.tree.add(e) : this.tree.find(e);
1165
1165
  if (!r) throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);
1166
- let o = r, f = r, s, c;
1167
- for (; s === void 0; )
1168
- o = this.tree.prev(o), o === null ? s = null : o.key.consumedBy === void 0 && (s = o.key);
1166
+ let o = r, f = r, l, c;
1167
+ for (; l === void 0; )
1168
+ o = this.tree.prev(o), o === null ? l = null : o.key.consumedBy === void 0 && (l = o.key);
1169
1169
  for (; c === void 0; )
1170
1170
  f = this.tree.next(f), f === null ? c = null : f.key.consumedBy === void 0 && (c = f.key);
1171
1171
  if (t.isLeft) {
1172
1172
  let u = null;
1173
- if (s) {
1174
- const l = s.getIntersection(e);
1175
- if (l !== null && (e.isAnEndpoint(l) || (u = l), !s.isAnEndpoint(l))) {
1176
- const h = this._splitSafely(s, l);
1173
+ if (l) {
1174
+ const s = l.getIntersection(e);
1175
+ if (s !== null && (e.isAnEndpoint(s) || (u = s), !l.isAnEndpoint(s))) {
1176
+ const h = this._splitSafely(l, s);
1177
1177
  for (let a = 0, d = h.length; a < d; a++)
1178
1178
  n.push(h[a]);
1179
1179
  }
1180
1180
  }
1181
1181
  let g = null;
1182
1182
  if (c) {
1183
- const l = c.getIntersection(e);
1184
- if (l !== null && (e.isAnEndpoint(l) || (g = l), !c.isAnEndpoint(l))) {
1185
- const h = this._splitSafely(c, l);
1183
+ const s = c.getIntersection(e);
1184
+ if (s !== null && (e.isAnEndpoint(s) || (g = s), !c.isAnEndpoint(s))) {
1185
+ const h = this._splitSafely(c, s);
1186
1186
  for (let a = 0, d = h.length; a < d; a++)
1187
1187
  n.push(h[a]);
1188
1188
  }
1189
1189
  }
1190
1190
  if (u !== null || g !== null) {
1191
- let l = null;
1192
- u === null ? l = g : g === null ? l = u : l = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
1193
- const h = e.split(l);
1191
+ let s = null;
1192
+ u === null ? s = g : g === null ? s = u : s = L.comparePoints(u, g) <= 0 ? u : g, this.queue.remove(e.rightSE), n.push(e.rightSE);
1193
+ const h = e.split(s);
1194
1194
  for (let a = 0, d = h.length; a < d; a++)
1195
1195
  n.push(h[a]);
1196
1196
  }
1197
- n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = s);
1197
+ n.length > 0 ? (this.tree.remove(e), n.push(t)) : (this.segments.push(e), e.prev = l);
1198
1198
  } else {
1199
- if (s && c) {
1200
- const u = s.getIntersection(c);
1199
+ if (l && c) {
1200
+ const u = l.getIntersection(c);
1201
1201
  if (u !== null) {
1202
- if (!s.isAnEndpoint(u)) {
1203
- const g = this._splitSafely(s, u);
1204
- for (let l = 0, h = g.length; l < h; l++)
1205
- n.push(g[l]);
1202
+ if (!l.isAnEndpoint(u)) {
1203
+ const g = this._splitSafely(l, u);
1204
+ for (let s = 0, h = g.length; s < h; s++)
1205
+ n.push(g[s]);
1206
1206
  }
1207
1207
  if (!c.isAnEndpoint(u)) {
1208
1208
  const g = this._splitSafely(c, u);
1209
- for (let l = 0, h = g.length; l < h; l++)
1210
- n.push(g[l]);
1209
+ for (let s = 0, h = g.length; s < h; s++)
1210
+ n.push(g[s]);
1211
1211
  }
1212
1212
  }
1213
1213
  }
@@ -1225,116 +1225,116 @@ class we {
1225
1225
  return r.push(n), t.consumedBy === void 0 && this.tree.add(t), r;
1226
1226
  }
1227
1227
  }
1228
- const Ct = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, be = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
1229
- class _e {
1228
+ const kt = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE || 1e6, Se = typeof process < "u" && process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS || 1e6;
1229
+ class Pe {
1230
1230
  run(t, e, n) {
1231
1231
  $.type = t, Z.reset();
1232
- const r = [new Rt(e, !0)];
1233
- for (let l = 0, h = n.length; l < h; l++)
1234
- r.push(new Rt(n[l], !1));
1232
+ const r = [new It(e, !0)];
1233
+ for (let s = 0, h = n.length; s < h; s++)
1234
+ r.push(new It(n[s], !1));
1235
1235
  if ($.numMultiPolys = r.length, $.type === "difference") {
1236
- const l = r[0];
1236
+ const s = r[0];
1237
1237
  let h = 1;
1238
1238
  for (; h < r.length; )
1239
- ht(r[h].bbox, l.bbox) !== null ? h++ : r.splice(h, 1);
1239
+ at(r[h].bbox, s.bbox) !== null ? h++ : r.splice(h, 1);
1240
1240
  }
1241
1241
  if ($.type === "intersection")
1242
- for (let l = 0, h = r.length; l < h; l++) {
1243
- const a = r[l];
1244
- for (let d = l + 1, x = r.length; d < x; d++)
1245
- if (ht(a.bbox, r[d].bbox) === null) return [];
1242
+ for (let s = 0, h = r.length; s < h; s++) {
1243
+ const a = r[s];
1244
+ for (let d = s + 1, x = r.length; d < x; d++)
1245
+ if (at(a.bbox, r[d].bbox) === null) return [];
1246
1246
  }
1247
- const o = new yt(L.compare);
1248
- for (let l = 0, h = r.length; l < h; l++) {
1249
- const a = r[l].getSweepEvents();
1247
+ const o = new dt(L.compare);
1248
+ for (let s = 0, h = r.length; s < h; s++) {
1249
+ const a = r[s].getSweepEvents();
1250
1250
  for (let d = 0, x = a.length; d < x; d++)
1251
- if (o.insert(a[d]), o.size > Ct)
1251
+ if (o.insert(a[d]), o.size > kt)
1252
1252
  throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).");
1253
1253
  }
1254
- const f = new we(o);
1255
- let s = o.size, c = o.pop();
1254
+ const f = new _e(o);
1255
+ let l = o.size, c = o.pop();
1256
1256
  for (; c; ) {
1257
- const l = c.key;
1258
- if (o.size === s) {
1259
- const a = l.segment;
1260
- throw new Error(`Unable to pop() ${l.isLeft ? "left" : "right"} SweepEvent [${l.point.x}, ${l.point.y}] from segment #${a.id} [${a.leftSE.point.x}, ${a.leftSE.point.y}] -> [${a.rightSE.point.x}, ${a.rightSE.point.y}] from queue.`);
1257
+ const s = c.key;
1258
+ if (o.size === l) {
1259
+ const a = s.segment;
1260
+ throw new Error(`Unable to pop() ${s.isLeft ? "left" : "right"} SweepEvent [${s.point.x}, ${s.point.y}] from segment #${a.id} [${a.leftSE.point.x}, ${a.leftSE.point.y}] -> [${a.rightSE.point.x}, ${a.rightSE.point.y}] from queue.`);
1261
1261
  }
1262
- if (o.size > Ct)
1262
+ if (o.size > kt)
1263
1263
  throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");
1264
- if (f.segments.length > be)
1264
+ if (f.segments.length > Se)
1265
1265
  throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");
1266
- const h = f.process(l);
1266
+ const h = f.process(s);
1267
1267
  for (let a = 0, d = h.length; a < d; a++) {
1268
1268
  const x = h[a];
1269
1269
  x.consumedBy === void 0 && o.insert(x);
1270
1270
  }
1271
- s = o.size, c = o.pop();
1271
+ l = o.size, c = o.pop();
1272
1272
  }
1273
1273
  Z.reset();
1274
- const u = et.factory(f.segments);
1275
- return new Ee(u).getGeom();
1274
+ const u = nt.factory(f.segments);
1275
+ return new be(u).getGeom();
1276
1276
  }
1277
1277
  }
1278
- const $ = new _e(), Se = function(i) {
1278
+ const $ = new Pe(), Me = function(i) {
1279
1279
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1280
1280
  e[n - 1] = arguments[n];
1281
1281
  return $.run("union", i, e);
1282
- }, Pe = function(i) {
1282
+ }, Le = function(i) {
1283
1283
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1284
1284
  e[n - 1] = arguments[n];
1285
1285
  return $.run("intersection", i, e);
1286
- }, Me = function(i) {
1286
+ }, Re = function(i) {
1287
1287
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1288
1288
  e[n - 1] = arguments[n];
1289
1289
  return $.run("xor", i, e);
1290
- }, Le = function(i) {
1290
+ }, Ie = function(i) {
1291
1291
  for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
1292
1292
  e[n - 1] = arguments[n];
1293
1293
  return $.run("difference", i, e);
1294
1294
  };
1295
- var Qt = {
1296
- union: Se,
1297
- intersection: Pe,
1298
- xor: Me,
1299
- difference: Le
1295
+ var Ft = {
1296
+ union: Me,
1297
+ intersection: Le,
1298
+ xor: Re,
1299
+ difference: Ie
1300
1300
  };
1301
- function Ut(i, t, e) {
1301
+ function Qt(i, t, e) {
1302
1302
  if (i !== null)
1303
- for (var n, r, o, f, s, c, u, g = 0, l = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", p = d ? i.features.length : 1, y = 0; y < p; y++) {
1304
- u = d ? i.features[y].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, s = h ? u.geometries.length : 1;
1305
- for (var v = 0; v < s; v++) {
1306
- var m = 0, E = 0;
1307
- if (f = h ? u.geometries[v] : u, f !== null) {
1303
+ for (var n, r, o, f, l, c, u, g = 0, s = 0, h, a = i.type, d = a === "FeatureCollection", x = a === "Feature", p = d ? i.features.length : 1, y = 0; y < p; y++) {
1304
+ u = d ? i.features[y].geometry : x ? i.geometry : i, h = u ? u.type === "GeometryCollection" : !1, l = h ? u.geometries.length : 1;
1305
+ for (var w = 0; w < l; w++) {
1306
+ var v = 0, E = 0;
1307
+ if (f = h ? u.geometries[w] : u, f !== null) {
1308
1308
  c = f.coordinates;
1309
- var w = f.type;
1310
- switch (g = 0, w) {
1309
+ var m = f.type;
1310
+ switch (g = 0, m) {
1311
1311
  case null:
1312
1312
  break;
1313
1313
  case "Point":
1314
1314
  if (t(
1315
1315
  c,
1316
- l,
1316
+ s,
1317
1317
  y,
1318
- m,
1318
+ v,
1319
1319
  E
1320
1320
  ) === !1)
1321
1321
  return !1;
1322
- l++, m++;
1322
+ s++, v++;
1323
1323
  break;
1324
1324
  case "LineString":
1325
1325
  case "MultiPoint":
1326
1326
  for (n = 0; n < c.length; n++) {
1327
1327
  if (t(
1328
1328
  c[n],
1329
- l,
1329
+ s,
1330
1330
  y,
1331
- m,
1331
+ v,
1332
1332
  E
1333
1333
  ) === !1)
1334
1334
  return !1;
1335
- l++, w === "MultiPoint" && m++;
1335
+ s++, m === "MultiPoint" && v++;
1336
1336
  }
1337
- w === "LineString" && m++;
1337
+ m === "LineString" && v++;
1338
1338
  break;
1339
1339
  case "Polygon":
1340
1340
  case "MultiLineString":
@@ -1342,17 +1342,17 @@ function Ut(i, t, e) {
1342
1342
  for (r = 0; r < c[n].length - g; r++) {
1343
1343
  if (t(
1344
1344
  c[n][r],
1345
- l,
1345
+ s,
1346
1346
  y,
1347
- m,
1347
+ v,
1348
1348
  E
1349
1349
  ) === !1)
1350
1350
  return !1;
1351
- l++;
1351
+ s++;
1352
1352
  }
1353
- w === "MultiLineString" && m++, w === "Polygon" && E++;
1353
+ m === "MultiLineString" && v++, m === "Polygon" && E++;
1354
1354
  }
1355
- w === "Polygon" && m++;
1355
+ m === "Polygon" && v++;
1356
1356
  break;
1357
1357
  case "MultiPolygon":
1358
1358
  for (n = 0; n < c.length; n++) {
@@ -1360,22 +1360,22 @@ function Ut(i, t, e) {
1360
1360
  for (o = 0; o < c[n][r].length - g; o++) {
1361
1361
  if (t(
1362
1362
  c[n][r][o],
1363
- l,
1363
+ s,
1364
1364
  y,
1365
- m,
1365
+ v,
1366
1366
  E
1367
1367
  ) === !1)
1368
1368
  return !1;
1369
- l++;
1369
+ s++;
1370
1370
  }
1371
1371
  E++;
1372
1372
  }
1373
- m++;
1373
+ v++;
1374
1374
  }
1375
1375
  break;
1376
1376
  case "GeometryCollection":
1377
1377
  for (n = 0; n < f.geometries.length; n++)
1378
- if (Ut(f.geometries[n], t) === !1)
1378
+ if (Qt(f.geometries[n], t) === !1)
1379
1379
  return !1;
1380
1380
  break;
1381
1381
  default:
@@ -1385,17 +1385,17 @@ function Ut(i, t, e) {
1385
1385
  }
1386
1386
  }
1387
1387
  }
1388
- function dt(i, t) {
1389
- var e, n, r, o, f, s, c, u, g, l, h = 0, a = i.type === "FeatureCollection", d = i.type === "Feature", x = a ? i.features.length : 1;
1388
+ function xt(i, t) {
1389
+ var e, n, r, o, f, l, c, u, g, s, h = 0, a = i.type === "FeatureCollection", d = i.type === "Feature", x = a ? i.features.length : 1;
1390
1390
  for (e = 0; e < x; e++) {
1391
- for (s = a ? i.features[e].geometry : d ? i.geometry : i, u = a ? i.features[e].properties : d ? i.properties : {}, g = a ? i.features[e].bbox : d ? i.bbox : void 0, l = a ? i.features[e].id : d ? i.id : void 0, c = s ? s.type === "GeometryCollection" : !1, f = c ? s.geometries.length : 1, r = 0; r < f; r++) {
1392
- if (o = c ? s.geometries[r] : s, o === null) {
1391
+ for (l = a ? i.features[e].geometry : d ? i.geometry : i, u = a ? i.features[e].properties : d ? i.properties : {}, g = a ? i.features[e].bbox : d ? i.bbox : void 0, s = a ? i.features[e].id : d ? i.id : void 0, c = l ? l.type === "GeometryCollection" : !1, f = c ? l.geometries.length : 1, r = 0; r < f; r++) {
1392
+ if (o = c ? l.geometries[r] : l, o === null) {
1393
1393
  if (t(
1394
1394
  null,
1395
1395
  h,
1396
1396
  u,
1397
1397
  g,
1398
- l
1398
+ s
1399
1399
  ) === !1)
1400
1400
  return !1;
1401
1401
  continue;
@@ -1412,7 +1412,7 @@ function dt(i, t) {
1412
1412
  h,
1413
1413
  u,
1414
1414
  g,
1415
- l
1415
+ s
1416
1416
  ) === !1)
1417
1417
  return !1;
1418
1418
  break;
@@ -1424,7 +1424,7 @@ function dt(i, t) {
1424
1424
  h,
1425
1425
  u,
1426
1426
  g,
1427
- l
1427
+ s
1428
1428
  ) === !1)
1429
1429
  return !1;
1430
1430
  break;
@@ -1436,10 +1436,10 @@ function dt(i, t) {
1436
1436
  h++;
1437
1437
  }
1438
1438
  }
1439
- function Re(i, t) {
1440
- dt(i, function(e, n, r, o, f) {
1441
- var s = e === null ? null : e.type;
1442
- switch (s) {
1439
+ function Ce(i, t) {
1440
+ xt(i, function(e, n, r, o, f) {
1441
+ var l = e === null ? null : e.type;
1442
+ switch (l) {
1443
1443
  case null:
1444
1444
  case "Point":
1445
1445
  case "LineString":
@@ -1451,7 +1451,7 @@ function Re(i, t) {
1451
1451
  ) === !1 ? !1 : void 0;
1452
1452
  }
1453
1453
  var c;
1454
- switch (s) {
1454
+ switch (l) {
1455
1455
  case "MultiPoint":
1456
1456
  c = "Point";
1457
1457
  break;
@@ -1463,137 +1463,137 @@ function Re(i, t) {
1463
1463
  break;
1464
1464
  }
1465
1465
  for (var u = 0; u < e.coordinates.length; u++) {
1466
- var g = e.coordinates[u], l = {
1466
+ var g = e.coordinates[u], s = {
1467
1467
  type: c,
1468
1468
  coordinates: g
1469
1469
  };
1470
- if (t(X(l, r), n, u) === !1)
1470
+ if (t(X(s, r), n, u) === !1)
1471
1471
  return !1;
1472
1472
  }
1473
1473
  });
1474
1474
  }
1475
1475
  function ke(i, t = {}) {
1476
1476
  const e = [];
1477
- if (dt(i, (r) => {
1477
+ if (xt(i, (r) => {
1478
1478
  e.push(r.coordinates);
1479
1479
  }), e.length < 2)
1480
1480
  throw new Error("Must have at least 2 geometries");
1481
- const n = Qt.union(e[0], ...e.slice(1));
1482
- return n.length === 0 ? null : n.length === 1 ? pt(n[0], t.properties) : jt(n, t.properties);
1481
+ const n = Ft.union(e[0], ...e.slice(1));
1482
+ return n.length === 0 ? null : n.length === 1 ? yt(n[0], t.properties) : jt(n, t.properties);
1483
1483
  }
1484
- var Yt = ke;
1484
+ var Dt = ke;
1485
1485
  function W() {
1486
1486
  }
1487
- function Ft(i) {
1487
+ function Xt(i) {
1488
1488
  return i();
1489
1489
  }
1490
- function It() {
1490
+ function $t() {
1491
1491
  return /* @__PURE__ */ Object.create(null);
1492
1492
  }
1493
- function nt(i) {
1494
- i.forEach(Ft);
1493
+ function it(i) {
1494
+ i.forEach(Xt);
1495
1495
  }
1496
- function Dt(i) {
1496
+ function Vt(i) {
1497
1497
  return typeof i == "function";
1498
1498
  }
1499
- function Ce(i, t) {
1499
+ function $e(i, t) {
1500
1500
  return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
1501
1501
  }
1502
- function Ie(i) {
1502
+ function Ae(i) {
1503
1503
  return Object.keys(i).length === 0;
1504
1504
  }
1505
- function $e(i, t) {
1505
+ function Oe(i, t) {
1506
1506
  i.appendChild(t);
1507
1507
  }
1508
- function Ae(i, t, e) {
1508
+ function Ne(i, t, e) {
1509
1509
  i.insertBefore(t, e || null);
1510
1510
  }
1511
- function Xt(i) {
1511
+ function Zt(i) {
1512
1512
  i.parentNode && i.parentNode.removeChild(i);
1513
1513
  }
1514
- function $t(i) {
1514
+ function At(i) {
1515
1515
  return document.createElementNS("http://www.w3.org/2000/svg", i);
1516
1516
  }
1517
1517
  function N(i, t, e) {
1518
1518
  e == null ? i.removeAttribute(t) : i.getAttribute(t) !== e && i.setAttribute(t, e);
1519
1519
  }
1520
- function Oe(i) {
1520
+ function Be(i) {
1521
1521
  return Array.from(i.childNodes);
1522
1522
  }
1523
1523
  function K(i, t, e) {
1524
1524
  i.classList.toggle(t, !!e);
1525
1525
  }
1526
- let xt;
1526
+ let vt;
1527
1527
  function D(i) {
1528
- xt = i;
1528
+ vt = i;
1529
1529
  }
1530
- const Q = [], At = [];
1531
- let U = [];
1532
- const Ot = [], Ne = /* @__PURE__ */ Promise.resolve();
1533
- let at = !1;
1534
- function Be() {
1535
- at || (at = !0, Ne.then(Vt));
1530
+ const j = [], Ot = [];
1531
+ let Y = [];
1532
+ const Nt = [], Te = /* @__PURE__ */ Promise.resolve();
1533
+ let gt = !1;
1534
+ function ze() {
1535
+ gt || (gt = !0, Te.then(Wt));
1536
1536
  }
1537
- function gt(i) {
1538
- U.push(i);
1537
+ function pt(i) {
1538
+ Y.push(i);
1539
1539
  }
1540
- const st = /* @__PURE__ */ new Set();
1540
+ const lt = /* @__PURE__ */ new Set();
1541
1541
  let q = 0;
1542
- function Vt() {
1542
+ function Wt() {
1543
1543
  if (q !== 0)
1544
1544
  return;
1545
- const i = xt;
1545
+ const i = vt;
1546
1546
  do {
1547
1547
  try {
1548
- for (; q < Q.length; ) {
1549
- const t = Q[q];
1550
- q++, D(t), ze(t.$$);
1548
+ for (; q < j.length; ) {
1549
+ const t = j[q];
1550
+ q++, D(t), Ge(t.$$);
1551
1551
  }
1552
1552
  } catch (t) {
1553
- throw Q.length = 0, q = 0, t;
1553
+ throw j.length = 0, q = 0, t;
1554
1554
  }
1555
- for (D(null), Q.length = 0, q = 0; At.length; ) At.pop()();
1556
- for (let t = 0; t < U.length; t += 1) {
1557
- const e = U[t];
1558
- st.has(e) || (st.add(e), e());
1555
+ for (D(null), j.length = 0, q = 0; Ot.length; ) Ot.pop()();
1556
+ for (let t = 0; t < Y.length; t += 1) {
1557
+ const e = Y[t];
1558
+ lt.has(e) || (lt.add(e), e());
1559
1559
  }
1560
- U.length = 0;
1561
- } while (Q.length);
1562
- for (; Ot.length; )
1563
- Ot.pop()();
1564
- at = !1, st.clear(), D(i);
1560
+ Y.length = 0;
1561
+ } while (j.length);
1562
+ for (; Nt.length; )
1563
+ Nt.pop()();
1564
+ gt = !1, lt.clear(), D(i);
1565
1565
  }
1566
- function ze(i) {
1566
+ function Ge(i) {
1567
1567
  if (i.fragment !== null) {
1568
- i.update(), nt(i.before_update);
1568
+ i.update(), it(i.before_update);
1569
1569
  const t = i.dirty;
1570
- i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(gt);
1570
+ i.dirty = [-1], i.fragment && i.fragment.p(i.ctx, t), i.after_update.forEach(pt);
1571
1571
  }
1572
1572
  }
1573
- function Te(i) {
1573
+ function Ue(i) {
1574
1574
  const t = [], e = [];
1575
- U.forEach((n) => i.indexOf(n) === -1 ? t.push(n) : e.push(n)), e.forEach((n) => n()), U = t;
1575
+ Y.forEach((n) => i.indexOf(n) === -1 ? t.push(n) : e.push(n)), e.forEach((n) => n()), Y = t;
1576
1576
  }
1577
- const Ge = /* @__PURE__ */ new Set();
1577
+ const qe = /* @__PURE__ */ new Set();
1578
1578
  function je(i, t) {
1579
- i && i.i && (Ge.delete(i), i.i(t));
1579
+ i && i.i && (qe.delete(i), i.i(t));
1580
1580
  }
1581
- function qe(i, t, e) {
1581
+ function Ye(i, t, e) {
1582
1582
  const { fragment: n, after_update: r } = i.$$;
1583
- n && n.m(t, e), gt(() => {
1584
- const o = i.$$.on_mount.map(Ft).filter(Dt);
1585
- i.$$.on_destroy ? i.$$.on_destroy.push(...o) : nt(o), i.$$.on_mount = [];
1586
- }), r.forEach(gt);
1583
+ n && n.m(t, e), pt(() => {
1584
+ const o = i.$$.on_mount.map(Xt).filter(Vt);
1585
+ i.$$.on_destroy ? i.$$.on_destroy.push(...o) : it(o), i.$$.on_mount = [];
1586
+ }), r.forEach(pt);
1587
1587
  }
1588
- function Qe(i, t) {
1588
+ function Fe(i, t) {
1589
1589
  const e = i.$$;
1590
- e.fragment !== null && (Te(e.after_update), nt(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
1590
+ e.fragment !== null && (Ue(e.after_update), it(e.on_destroy), e.fragment && e.fragment.d(t), e.on_destroy = e.fragment = null, e.ctx = []);
1591
1591
  }
1592
- function Ue(i, t) {
1593
- i.$$.dirty[0] === -1 && (Q.push(i), Be(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
1592
+ function Qe(i, t) {
1593
+ i.$$.dirty[0] === -1 && (j.push(i), ze(), i.$$.dirty.fill(0)), i.$$.dirty[t / 31 | 0] |= 1 << t % 31;
1594
1594
  }
1595
- function Ye(i, t, e, n, r, o, f = null, s = [-1]) {
1596
- const c = xt;
1595
+ function De(i, t, e, n, r, o, f = null, l = [-1]) {
1596
+ const c = vt;
1597
1597
  D(i);
1598
1598
  const u = i.$$ = {
1599
1599
  fragment: null,
@@ -1602,7 +1602,7 @@ function Ye(i, t, e, n, r, o, f = null, s = [-1]) {
1602
1602
  props: o,
1603
1603
  update: W,
1604
1604
  not_equal: r,
1605
- bound: It(),
1605
+ bound: $t(),
1606
1606
  // lifecycle
1607
1607
  on_mount: [],
1608
1608
  on_destroy: [],
@@ -1611,27 +1611,27 @@ function Ye(i, t, e, n, r, o, f = null, s = [-1]) {
1611
1611
  after_update: [],
1612
1612
  context: new Map(t.context || (c ? c.$$.context : [])),
1613
1613
  // everything else
1614
- callbacks: It(),
1615
- dirty: s,
1614
+ callbacks: $t(),
1615
+ dirty: l,
1616
1616
  skip_bound: !1,
1617
1617
  root: t.target || c.$$.root
1618
1618
  };
1619
1619
  f && f(u.root);
1620
1620
  let g = !1;
1621
- if (u.ctx = e ? e(i, t.props || {}, (l, h, ...a) => {
1621
+ if (u.ctx = e ? e(i, t.props || {}, (s, h, ...a) => {
1622
1622
  const d = a.length ? a[0] : h;
1623
- return u.ctx && r(u.ctx[l], u.ctx[l] = d) && (!u.skip_bound && u.bound[l] && u.bound[l](d), g && Ue(i, l)), h;
1624
- }) : [], u.update(), g = !0, nt(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
1623
+ return u.ctx && r(u.ctx[s], u.ctx[s] = d) && (!u.skip_bound && u.bound[s] && u.bound[s](d), g && Qe(i, s)), h;
1624
+ }) : [], u.update(), g = !0, it(u.before_update), u.fragment = n ? n(u.ctx) : !1, t.target) {
1625
1625
  if (t.hydrate) {
1626
- const l = Oe(t.target);
1627
- u.fragment && u.fragment.l(l), l.forEach(Xt);
1626
+ const s = Be(t.target);
1627
+ u.fragment && u.fragment.l(s), s.forEach(Zt);
1628
1628
  } else
1629
1629
  u.fragment && u.fragment.c();
1630
- t.intro && je(i.$$.fragment), qe(i, t.target, t.anchor), Vt();
1630
+ t.intro && je(i.$$.fragment), Ye(i, t.target, t.anchor), Wt();
1631
1631
  }
1632
1632
  D(c);
1633
1633
  }
1634
- class Fe {
1634
+ class Xe {
1635
1635
  constructor() {
1636
1636
  /**
1637
1637
  * ### PRIVATE API
@@ -1640,7 +1640,7 @@ class Fe {
1640
1640
  *
1641
1641
  * @type {any}
1642
1642
  */
1643
- it(this, "$$");
1643
+ rt(this, "$$");
1644
1644
  /**
1645
1645
  * ### PRIVATE API
1646
1646
  *
@@ -1648,11 +1648,11 @@ class Fe {
1648
1648
  *
1649
1649
  * @type {any}
1650
1650
  */
1651
- it(this, "$$set");
1651
+ rt(this, "$$set");
1652
1652
  }
1653
1653
  /** @returns {void} */
1654
1654
  $destroy() {
1655
- Qe(this, 1), this.$destroy = W;
1655
+ Fe(this, 1), this.$destroy = W;
1656
1656
  }
1657
1657
  /**
1658
1658
  * @template {Extract<keyof Events, string>} K
@@ -1661,7 +1661,7 @@ class Fe {
1661
1661
  * @returns {() => void}
1662
1662
  */
1663
1663
  $on(t, e) {
1664
- if (!Dt(e))
1664
+ if (!Vt(e))
1665
1665
  return W;
1666
1666
  const n = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
1667
1667
  return n.push(e), () => {
@@ -1674,16 +1674,16 @@ class Fe {
1674
1674
  * @returns {void}
1675
1675
  */
1676
1676
  $set(t) {
1677
- this.$$set && !Ie(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
1677
+ this.$$set && !Ae(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
1678
1678
  }
1679
1679
  }
1680
- const De = "4";
1681
- typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(De);
1682
- function Xe(i) {
1680
+ const Ve = "4";
1681
+ typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ve);
1682
+ function Ze(i) {
1683
1683
  let t, e, n;
1684
1684
  return {
1685
1685
  c() {
1686
- t = $t("svg"), e = $t("path"), N(e, "stroke-width", "4"), N(e, "d", "M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"), N(e, "class", "svelte-gzo3ar"), N(t, "width", n = /*displayIn*/
1686
+ t = At("svg"), e = At("path"), N(e, "stroke-width", "4"), N(e, "d", "M 5,33.103579 C 5,17.607779 18.457,5 35,5 C 51.543,5 65,17.607779 65,33.103579 C 65,56.388679 40.4668,76.048179 36.6112,79.137779 C 36.3714,79.329879 36.2116,79.457979 36.1427,79.518879 C 35.8203,79.800879 35.4102,79.942779 35,79.942779 C 34.5899,79.942779 34.1797,79.800879 33.8575,79.518879 C 33.7886,79.457979 33.6289,79.330079 33.3893,79.138079 C 29.5346,76.049279 5,56.389379 5,33.103579 Z M 35.0001,49.386379 C 43.1917,49.386379 49.8323,42.646079 49.8323,34.331379 C 49.8323,26.016779 43.1917,19.276479 35.0001,19.276479 C 26.8085,19.276479 20.1679,26.016779 20.1679,34.331379 C 20.1679,42.646079 26.8085,49.386379 35.0001,49.386379 Z"), N(e, "class", "svelte-gzo3ar"), N(t, "width", n = /*displayIn*/
1687
1687
  i[0] === "list" ? 20 : void 0), N(t, "viewBox", "0 0 70 85"), N(t, "fill", "none"), N(t, "class", "svelte-gzo3ar"), K(
1688
1688
  t,
1689
1689
  "in-map",
@@ -1697,7 +1697,7 @@ function Xe(i) {
1697
1697
  );
1698
1698
  },
1699
1699
  m(r, o) {
1700
- Ae(r, t, o), $e(t, e);
1700
+ Ne(r, t, o), Oe(t, e);
1701
1701
  },
1702
1702
  p(r, [o]) {
1703
1703
  o & /*displayIn*/
@@ -1719,57 +1719,57 @@ function Xe(i) {
1719
1719
  i: W,
1720
1720
  o: W,
1721
1721
  d(r) {
1722
- r && Xt(t);
1722
+ r && Zt(t);
1723
1723
  }
1724
1724
  };
1725
1725
  }
1726
- function Ve(i, t, e) {
1726
+ function We(i, t, e) {
1727
1727
  let { displayIn: n } = t;
1728
1728
  return i.$$set = (r) => {
1729
1729
  "displayIn" in r && e(0, n = r.displayIn);
1730
1730
  }, [n];
1731
1731
  }
1732
- class Ze extends Fe {
1732
+ class Je extends Xe {
1733
1733
  constructor(t) {
1734
- super(), Ye(this, t, Ve, Xe, Ce, { displayIn: 0 });
1734
+ super(), De(this, t, We, Ze, $e, { displayIn: 0 });
1735
1735
  }
1736
1736
  }
1737
- function We(i, t = {}) {
1737
+ function Ke(i, t = {}) {
1738
1738
  if (i.bbox != null && t.recompute !== !0)
1739
1739
  return i.bbox;
1740
1740
  const e = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
1741
- return Ut(i, (n) => {
1741
+ return Qt(i, (n) => {
1742
1742
  e[0] > n[0] && (e[0] = n[0]), e[1] > n[1] && (e[1] = n[1]), e[2] < n[0] && (e[2] = n[0]), e[3] < n[1] && (e[3] = n[1]);
1743
1743
  }), e;
1744
1744
  }
1745
- var Nt = We;
1746
- function Je(i) {
1745
+ var Bt = Ke;
1746
+ function He(i) {
1747
1747
  const t = [];
1748
- if (dt(i, (r) => {
1748
+ if (xt(i, (r) => {
1749
1749
  t.push(r.coordinates);
1750
1750
  }), t.length < 2)
1751
1751
  throw new Error("Must have at least two features");
1752
- const e = i.features[0].properties || {}, n = Qt.difference(t[0], ...t.slice(1));
1753
- return n.length === 0 ? null : n.length === 1 ? pt(n[0], e) : jt(n, e);
1752
+ const e = i.features[0].properties || {}, n = Ft.difference(t[0], ...t.slice(1));
1753
+ return n.length === 0 ? null : n.length === 1 ? yt(n[0], e) : jt(n, e);
1754
1754
  }
1755
- var Ke = Je;
1756
- function He(i) {
1755
+ var tn = He;
1756
+ function en(i) {
1757
1757
  if (!i)
1758
1758
  throw new Error("geojson is required");
1759
1759
  var t = [];
1760
- return Re(i, function(e) {
1760
+ return Ce(i, function(e) {
1761
1761
  t.push(e);
1762
1762
  }), V(t);
1763
1763
  }
1764
- var tn = He;
1765
- function Bt(i) {
1764
+ var nn = en;
1765
+ function Tt(i) {
1766
1766
  const t = [...i];
1767
1767
  return t[2] < t[0] && (Math.abs((t[0] + t[2] + 360) / 2) > Math.abs((t[0] - 360 + t[2]) / 2) ? t[0] -= 360 : t[2] += 360), t;
1768
1768
  }
1769
1769
  function zt(i, t) {
1770
- const e = Ke(
1770
+ const e = tn(
1771
1771
  V([
1772
- pt([
1772
+ yt([
1773
1773
  [
1774
1774
  [180, 90],
1775
1775
  [-180, 90],
@@ -1784,27 +1784,27 @@ function zt(i, t) {
1784
1784
  if (!e)
1785
1785
  return;
1786
1786
  e.properties = { isMask: !0 };
1787
- const n = Bt(Nt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, s = tn(i);
1788
- if (s.features.length > 1 && (o || f))
1789
- for (const c of s.features) {
1790
- const u = Bt(Nt(c));
1787
+ const n = Tt(Bt(i)), r = (n[2] - n[0]) / 360 / 1e3, o = n[0] < -180, f = n[2] > 180, l = nn(i);
1788
+ if (l.features.length > 1 && (o || f))
1789
+ for (const c of l.features) {
1790
+ const u = Tt(Bt(c));
1791
1791
  if (f && u[0] < -180 + r)
1792
1792
  for (const g of c.geometry.coordinates)
1793
- for (const l of g)
1794
- l[0] += 360 - r;
1793
+ for (const s of g)
1794
+ s[0] += 360 - r;
1795
1795
  if (o && u[2] > 180 - r)
1796
1796
  for (const g of c.geometry.coordinates)
1797
- for (const l of g)
1798
- l[0] -= 360 - r;
1797
+ for (const s of g)
1798
+ s[0] -= 360 - r;
1799
1799
  }
1800
1800
  t(
1801
1801
  V([
1802
- s.features.length < 2 ? i : Yt(s) ?? i,
1802
+ l.features.length < 2 ? i : Dt(l) ?? i,
1803
1803
  e
1804
1804
  ])
1805
1805
  );
1806
1806
  }
1807
- const Tt = V([]), Gt = {
1807
+ const Gt = {
1808
1808
  fill: {
1809
1809
  paint: {
1810
1810
  "fill-color": "#000",
@@ -1823,132 +1823,146 @@ const Tt = V([]), Gt = {
1823
1823
  },
1824
1824
  filter: ["!", ["has", "isMask"]]
1825
1825
  }
1826
- };
1827
- function nn(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
1828
- let s;
1826
+ }, H = "mtlr-gc-full-geom", Ut = "mtlr-gc-full-geom-fill", qt = "mtlr-gc-full-geom-line";
1827
+ function on(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
1828
+ let l;
1829
1829
  const c = [];
1830
- let u, g, l;
1830
+ let u, g, s;
1831
1831
  function h() {
1832
+ if (!i.loaded) {
1833
+ i.once("load", h);
1834
+ return;
1835
+ }
1832
1836
  const p = f ? f === !0 ? Gt : f : void 0;
1833
- !i.getSource("full-geom") && (p != null && p.fill || p != null && p.line) && i.addSource("full-geom", {
1834
- type: "geojson",
1835
- data: Tt
1836
- }), !i.getLayer("full-geom-fill") && (p != null && p.fill) && i.addLayer({
1837
+ if (!(p != null && p.fill) && !(p != null && p.line))
1838
+ return;
1839
+ const y = i.getSource(H);
1840
+ if (y)
1841
+ y.setData(s ?? V([]));
1842
+ else if (s)
1843
+ i.addSource(H, {
1844
+ type: "geojson",
1845
+ data: s
1846
+ });
1847
+ else
1848
+ return;
1849
+ !i.getLayer(Ut) && (p != null && p.fill) && i.addLayer({
1837
1850
  ...p == null ? void 0 : p.fill,
1838
- id: "full-geom-fill",
1851
+ id: Ut,
1839
1852
  type: "fill",
1840
- source: "full-geom"
1841
- }), !i.getLayer("full-geom-line") && (p != null && p.line) && i.addLayer({
1853
+ source: H
1854
+ }), !i.getLayer(qt) && (p != null && p.line) && i.addLayer({
1842
1855
  ...p == null ? void 0 : p.line,
1843
- id: "full-geom-line",
1856
+ id: qt,
1844
1857
  type: "line",
1845
- source: "full-geom"
1846
- }), l && x(l);
1858
+ source: H
1859
+ });
1847
1860
  }
1848
- i.loaded() ? h() : i.once("load", () => {
1849
- h();
1850
- }), i.on("styledata", () => {
1851
- h();
1861
+ function a(p) {
1862
+ s = p, h();
1863
+ }
1864
+ i.on("styledata", () => {
1865
+ setTimeout(() => {
1866
+ s && h();
1867
+ });
1852
1868
  });
1853
- const a = (p) => {
1854
- s == null || s({
1869
+ const d = (p) => {
1870
+ l == null || l({
1855
1871
  type: "mapClick",
1856
1872
  coordinates: [p.lngLat.lng, p.lngLat.lat]
1857
1873
  });
1858
1874
  };
1859
- function d(p = !1) {
1875
+ function x(p = !1) {
1860
1876
  if (!t)
1861
1877
  throw new Error();
1862
1878
  const y = document.createElement("div");
1863
- return p && y.classList.add("marker-interactive"), new Ze({
1879
+ return p && y.classList.add("marker-interactive"), new Je({
1864
1880
  props: { displayIn: "maplibre" },
1865
1881
  target: y
1866
1882
  }), new t.Marker({ element: y, offset: [1, -13] });
1867
1883
  }
1868
- function x(p) {
1869
- var y;
1870
- l = p, p && ((y = i.getSource("full-geom")) == null || y.setData(p));
1871
- }
1872
1884
  return {
1873
1885
  setEventHandler(p) {
1874
- p ? (s = p, i.on("click", a)) : (s = void 0, i.off("click", a));
1886
+ p ? (l = p, i.on("click", d)) : (l = void 0, i.off("click", d));
1875
1887
  },
1876
1888
  flyTo(p, y) {
1877
1889
  i.flyTo({ center: p, ...y ? { zoom: y } : {}, ...r });
1878
1890
  },
1879
- fitBounds(p, y, v) {
1891
+ fitBounds(p, y, w) {
1880
1892
  i.fitBounds(
1881
1893
  [
1882
1894
  [p[0], p[1]],
1883
1895
  [p[2], p[3]]
1884
1896
  ],
1885
- { padding: y, ...v ? { maxZoom: v } : {}, ...o }
1897
+ { padding: y, ...w ? { maxZoom: w } : {}, ...o }
1886
1898
  );
1887
1899
  },
1888
1900
  indicateReverse(p) {
1889
1901
  i.getCanvasContainer().style.cursor = p ? "crosshair" : "";
1890
1902
  },
1891
1903
  setReverseMarker(p) {
1892
- !t || !e || (g ? p ? g.setLngLat(p) : (g.remove(), g = void 0) : p && (e instanceof Function ? g = e(i) ?? void 0 : (g = (typeof e == "object" ? new t.Marker(e) : d()).setLngLat(p).addTo(i), g.getElement().classList.add("marker-reverse"))));
1904
+ !t || !e || (g ? p ? g.setLngLat(p) : (g.remove(), g = void 0) : p && (e instanceof Function ? g = e(i) ?? void 0 : (g = (typeof e == "object" ? new t.Marker(e) : x()).setLngLat(p).addTo(i), g.getElement().classList.add("marker-reverse"))));
1893
1905
  },
1894
- setMarkers(p, y) {
1906
+ setFeatures(p, y, w) {
1895
1907
  for (const v of c)
1896
1908
  v.remove();
1897
- if (c.length = 0, x(Tt), !!t) {
1898
- if (y) {
1909
+ if (c.length = 0, a(void 0), !!t) {
1910
+ t: if (y) {
1899
1911
  let v = !1;
1900
1912
  if (y.geometry.type === "GeometryCollection") {
1901
- const m = y.geometry.geometries.filter(
1902
- (E) => E.type === "Polygon" || E.type === "MultiPolygon"
1913
+ const E = y.geometry.geometries.filter(
1914
+ (m) => m.type === "Polygon" || m.type === "MultiPolygon"
1903
1915
  );
1904
- t: if (m.length > 0) {
1905
- const E = Yt(
1906
- V(m.map((w) => X(w)))
1916
+ e: if (E.length > 0) {
1917
+ const m = Dt(
1918
+ V(E.map((b) => X(b)))
1907
1919
  );
1908
- if (!E)
1909
- break t;
1920
+ if (!m)
1921
+ break e;
1910
1922
  zt(
1911
1923
  {
1912
1924
  ...y,
1913
- geometry: E.geometry
1925
+ geometry: m.geometry
1914
1926
  },
1915
- x
1927
+ a
1916
1928
  ), v = !0;
1917
1929
  } else {
1918
- const E = y.geometry.geometries.filter(
1919
- (w) => w.type === "LineString" || w.type === "MultiLineString"
1930
+ const m = y.geometry.geometries.filter(
1931
+ (b) => b.type === "LineString" || b.type === "MultiLineString"
1920
1932
  );
1921
- E.length > 0 && (x({
1933
+ m.length > 0 && (a({
1922
1934
  ...y,
1923
- geometry: { type: "GeometryCollection", geometries: E }
1935
+ geometry: { type: "GeometryCollection", geometries: m }
1924
1936
  }), v = !0);
1925
1937
  }
1926
1938
  }
1927
1939
  if (!v) {
1928
1940
  if (y.geometry.type === "Polygon" || y.geometry.type === "MultiPolygon")
1929
- zt(y, x);
1941
+ zt(y, a);
1930
1942
  else if (y.geometry.type === "LineString" || y.geometry.type === "MultiLineString") {
1931
- x(y);
1932
- return;
1943
+ a(y);
1944
+ break t;
1933
1945
  }
1934
1946
  }
1947
+ if (!w && y.geometry.type !== "Point")
1948
+ break t;
1935
1949
  if (e instanceof Function) {
1936
- const m = e(i, y);
1937
- m && c.push(m);
1950
+ const E = e(i, y);
1951
+ E && c.push(E);
1938
1952
  } else e && c.push(
1939
- typeof e == "object" ? new t.Marker(e) : d().setLngLat(y.center).addTo(i)
1953
+ typeof e == "object" ? new t.Marker(e) : x().setLngLat(y.center).addTo(i)
1940
1954
  );
1941
1955
  }
1942
1956
  if (n)
1943
1957
  for (const v of p ?? []) {
1944
1958
  if (v === y)
1945
1959
  continue;
1946
- let m;
1960
+ let E;
1947
1961
  if (n instanceof Function) {
1948
- if (m = n(i, v), !m)
1962
+ if (E = n(i, v), !E)
1949
1963
  continue;
1950
1964
  } else
1951
- m = (typeof n == "object" ? new t.Marker(n) : d(!0)).setLngLat(v.center).setPopup(
1965
+ E = (typeof n == "object" ? new t.Marker(n) : x(!0)).setLngLat(v.center).setPopup(
1952
1966
  new t.Popup({
1953
1967
  offset: [1, -27],
1954
1968
  closeButton: !1,
@@ -1958,14 +1972,14 @@ function nn(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
1958
1972
  v.place_type[0] === "reverse" ? v.place_name : v.place_name.replace(/,.*/, "")
1959
1973
  )
1960
1974
  ).addTo(i);
1961
- const E = m.getElement();
1962
- E.addEventListener("click", (w) => {
1963
- w.stopPropagation(), s == null || s({ type: "markerClick", id: v.id });
1964
- }), E.addEventListener("mouseenter", () => {
1965
- s == null || s({ type: "markerMouseEnter", id: v.id }), m.togglePopup();
1966
- }), E.addEventListener("mouseleave", () => {
1967
- s == null || s({ type: "markerMouseLeave", id: v.id }), m.togglePopup();
1968
- }), c.push(m);
1975
+ const m = E.getElement();
1976
+ m.addEventListener("click", (b) => {
1977
+ b.stopPropagation(), l == null || l({ type: "markerClick", id: v.id });
1978
+ }), m.addEventListener("mouseenter", () => {
1979
+ l == null || l({ type: "markerMouseEnter", id: v.id }), E.togglePopup();
1980
+ }), m.addEventListener("mouseleave", () => {
1981
+ l == null || l({ type: "markerMouseLeave", id: v.id }), E.togglePopup();
1982
+ }), c.push(E);
1969
1983
  }
1970
1984
  }
1971
1985
  },
@@ -1979,6 +1993,6 @@ function nn(i, t, e = !0, n = !0, r = {}, o = {}, f = Gt) {
1979
1993
  };
1980
1994
  }
1981
1995
  export {
1982
- nn as createMapLibreGlMapController
1996
+ on as createMapLibreGlMapController
1983
1997
  };
1984
1998
  //# sourceMappingURL=maplibregl-controller.js.map