vue3-google-map 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,9 +1,9 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var d=document.createElement("style");d.appendChild(document.createTextNode(".mapdiv[data-v-7d660dd5]{width:100%;height:100%}.info-window-wrapper[data-v-45a4606d]{display:none}.mapdiv .info-window-wrapper[data-v-45a4606d]{display:inline-block}.custom-marker-wrapper[data-v-c7599d50]{display:none}.mapdiv .custom-marker-wrapper[data-v-c7599d50]{display:inline-block}")),document.head.appendChild(d)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- var Oe = Object.defineProperty;
3
- var xe = (o, e, t) => e in o ? Oe(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
4
- var V = (o, e, t) => (xe(o, typeof e != "symbol" ? e + "" : e, t), t);
5
- import { defineComponent as k, ref as v, provide as q, watch as b, onMounted as ge, onBeforeUnmount as S, markRaw as M, toRef as L, openBlock as F, createElementBlock as G, createElementVNode as Y, renderSlot as U, normalizeProps as Pe, guardReactiveProps as Se, inject as y, computed as z, withDirectives as Le, vShow as Ie, Comment as ve, mergeProps as ye, createCommentVNode as Ce } from "vue";
6
- const I = Symbol("map"), E = Symbol("api"), _e = Symbol("marker"), ke = Symbol("markerCluster"), H = Symbol("CustomMarker"), we = Symbol("mapTilesLoaded"), P = [
2
+ var Be = Object.defineProperty;
3
+ var qe = (o, e, t) => e in o ? Be(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
4
+ var te = (o, e, t) => (qe(o, typeof e != "symbol" ? e + "" : e, t), t);
5
+ import { defineComponent as M, ref as v, provide as z, watch as O, onMounted as Me, onBeforeUnmount as j, markRaw as E, toRef as B, openBlock as J, createElementBlock as Y, createElementVNode as ie, renderSlot as X, normalizeProps as Re, guardReactiveProps as Ze, inject as _, computed as K, withDirectives as Ne, vShow as Fe, Comment as be, mergeProps as Oe, createCommentVNode as Pe } from "vue";
6
+ const q = Symbol("map"), R = Symbol("api"), xe = Symbol("marker"), Ee = Symbol("markerCluster"), Q = Symbol("CustomMarker"), Le = Symbol("mapTilesLoaded"), $ = [
7
7
  "click",
8
8
  "dblclick",
9
9
  "drag",
@@ -16,18 +16,18 @@ const I = Symbol("map"), E = Symbol("api"), _e = Symbol("marker"), ke = Symbol("
16
16
  "mouseup",
17
17
  "rightclick"
18
18
  ];
19
- var Ee = function o(e, t) {
19
+ var De = function o(e, t) {
20
20
  if (e === t)
21
21
  return !0;
22
22
  if (e && t && typeof e == "object" && typeof t == "object") {
23
23
  if (e.constructor !== t.constructor)
24
24
  return !1;
25
- var n, s, r;
25
+ var s, r, n;
26
26
  if (Array.isArray(e)) {
27
- if (n = e.length, n != t.length)
27
+ if (s = e.length, s != t.length)
28
28
  return !1;
29
- for (s = n; s-- !== 0; )
30
- if (!o(e[s], t[s]))
29
+ for (r = s; r-- !== 0; )
30
+ if (!o(e[r], t[r]))
31
31
  return !1;
32
32
  return !0;
33
33
  }
@@ -37,13 +37,13 @@ var Ee = function o(e, t) {
37
37
  return e.valueOf() === t.valueOf();
38
38
  if (e.toString !== Object.prototype.toString)
39
39
  return e.toString() === t.toString();
40
- if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
40
+ if (n = Object.keys(e), s = n.length, s !== Object.keys(t).length)
41
41
  return !1;
42
- for (s = n; s-- !== 0; )
43
- if (!Object.prototype.hasOwnProperty.call(t, r[s]))
42
+ for (r = s; r-- !== 0; )
43
+ if (!Object.prototype.hasOwnProperty.call(t, n[r]))
44
44
  return !1;
45
- for (s = n; s-- !== 0; ) {
46
- var a = r[s];
45
+ for (r = s; r-- !== 0; ) {
46
+ var a = n[r];
47
47
  if (!o(e[a], t[a]))
48
48
  return !1;
49
49
  }
@@ -51,8 +51,8 @@ var Ee = function o(e, t) {
51
51
  }
52
52
  return e !== e && t !== t;
53
53
  };
54
- const ne = "__googleMapsScriptId";
55
- class O {
54
+ const ue = "__googleMapsScriptId";
55
+ class S {
56
56
  /**
57
57
  * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set
58
58
  * using this library, instead the defaults are set by the Google Maps
@@ -62,13 +62,13 @@ class O {
62
62
  * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});
63
63
  * ```
64
64
  */
65
- constructor({ apiKey: e, channel: t, client: n, id: s = ne, libraries: r = [], language: a, region: l, version: i, mapIds: p, nonce: u, retries: c = 3, url: h = "https://maps.googleapis.com/maps/api/js" }) {
66
- if (this.CALLBACK = "__googleMapsCallback", this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.version = i, this.apiKey = e, this.channel = t, this.client = n, this.id = s || ne, this.libraries = r, this.language = a, this.region = l, this.mapIds = p, this.nonce = u, this.retries = c, this.url = h, O.instance) {
67
- if (!Ee(this.options, O.instance.options))
68
- throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(O.instance.options)}`);
69
- return O.instance;
65
+ constructor({ apiKey: e, channel: t, client: s, id: r = ue, libraries: n = [], language: a, region: c, version: i, mapIds: d, nonce: u, retries: l = 3, url: h = "https://maps.googleapis.com/maps/api/js" }) {
66
+ if (this.CALLBACK = "__googleMapsCallback", this.callbacks = [], this.done = !1, this.loading = !1, this.errors = [], this.version = i, this.apiKey = e, this.channel = t, this.client = s, this.id = r || ue, this.libraries = n, this.language = a, this.region = c, this.mapIds = d, this.nonce = u, this.retries = l, this.url = h, S.instance) {
67
+ if (!De(this.options, S.instance.options))
68
+ throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(S.instance.options)}`);
69
+ return S.instance;
70
70
  }
71
- O.instance = this;
71
+ S.instance = this;
72
72
  }
73
73
  get options() {
74
74
  return {
@@ -114,8 +114,8 @@ class O {
114
114
  */
115
115
  loadPromise() {
116
116
  return new Promise((e, t) => {
117
- this.loadCallback((n) => {
118
- n ? t(n.error) : e(window.google);
117
+ this.loadCallback((s) => {
118
+ s ? t(s.error) : e(window.google);
119
119
  });
120
120
  });
121
121
  }
@@ -174,14 +174,14 @@ class O {
174
174
  }
175
175
  }
176
176
  }
177
- function $e(o) {
177
+ function Ue(o) {
178
178
  return class extends o.OverlayView {
179
- constructor(n) {
179
+ constructor(s) {
180
180
  super();
181
- V(this, "element");
182
- V(this, "opts");
183
- const { element: s, ...r } = n;
184
- this.element = s, this.opts = r, this.opts.map && this.setMap(this.opts.map);
181
+ te(this, "element");
182
+ te(this, "opts");
183
+ const { element: r, ...n } = s;
184
+ this.element = r, this.opts = n, this.opts.map && this.setMap(this.opts.map);
185
185
  }
186
186
  getPosition() {
187
187
  return this.opts.position ? this.opts.position instanceof o.LatLng ? this.opts.position : new o.LatLng(this.opts.position) : null;
@@ -189,64 +189,64 @@ function $e(o) {
189
189
  getVisible() {
190
190
  if (!this.element)
191
191
  return !1;
192
- const n = this.element;
193
- return n.style.display !== "none" && n.style.visibility !== "hidden" && (n.style.opacity === "" || Number(n.style.opacity) > 0.01);
192
+ const s = this.element;
193
+ return s.style.display !== "none" && s.style.visibility !== "hidden" && (s.style.opacity === "" || Number(s.style.opacity) > 0.01);
194
194
  }
195
195
  onAdd() {
196
196
  if (!this.element)
197
197
  return;
198
- const n = this.getPanes();
199
- n && n.overlayMouseTarget.appendChild(this.element);
198
+ const s = this.getPanes();
199
+ s && s.overlayMouseTarget.appendChild(this.element);
200
200
  }
201
201
  draw() {
202
202
  if (!this.element)
203
203
  return;
204
- const s = this.getProjection().fromLatLngToDivPixel(this.getPosition());
205
- if (s) {
204
+ const r = this.getProjection().fromLatLngToDivPixel(this.getPosition());
205
+ if (r) {
206
206
  this.element.style.position = "absolute";
207
- const r = this.element.offsetHeight, a = this.element.offsetWidth;
208
- let l, i;
207
+ const n = this.element.offsetHeight, a = this.element.offsetWidth;
208
+ let c, i;
209
209
  switch (this.opts.anchorPoint) {
210
210
  case "TOP_CENTER":
211
- l = s.x - a / 2, i = s.y;
211
+ c = r.x - a / 2, i = r.y;
212
212
  break;
213
213
  case "BOTTOM_CENTER":
214
- l = s.x - a / 2, i = s.y - r;
214
+ c = r.x - a / 2, i = r.y - n;
215
215
  break;
216
216
  case "LEFT_CENTER":
217
- l = s.x, i = s.y - r / 2;
217
+ c = r.x, i = r.y - n / 2;
218
218
  break;
219
219
  case "RIGHT_CENTER":
220
- l = s.x - a, i = s.y - r / 2;
220
+ c = r.x - a, i = r.y - n / 2;
221
221
  break;
222
222
  case "TOP_LEFT":
223
- l = s.x, i = s.y;
223
+ c = r.x, i = r.y;
224
224
  break;
225
225
  case "TOP_RIGHT":
226
- l = s.x - a, i = s.y;
226
+ c = r.x - a, i = r.y;
227
227
  break;
228
228
  case "BOTTOM_LEFT":
229
- l = s.x, i = s.y - r;
229
+ c = r.x, i = r.y - n;
230
230
  break;
231
231
  case "BOTTOM_RIGHT":
232
- l = s.x - a, i = s.y - r;
232
+ c = r.x - a, i = r.y - n;
233
233
  break;
234
234
  default:
235
- l = s.x - a / 2, i = s.y - r / 2;
235
+ c = r.x - a / 2, i = r.y - n / 2;
236
236
  }
237
- this.element.style.left = l + "px", this.element.style.top = i + "px", this.element.style.transform = `translateX(${this.opts.offsetX || 0}px) translateY(${this.opts.offsetY || 0}px)`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
237
+ this.element.style.left = c + "px", this.element.style.top = i + "px", this.element.style.transform = `translateX(${this.opts.offsetX || 0}px) translateY(${this.opts.offsetY || 0}px)`, this.opts.zIndex && (this.element.style.zIndex = this.opts.zIndex.toString());
238
238
  }
239
239
  }
240
240
  onRemove() {
241
241
  this.element && this.element.remove();
242
242
  }
243
- setOptions(n) {
244
- this.opts = n, this.draw();
243
+ setOptions(s) {
244
+ this.opts = s, this.draw();
245
245
  }
246
246
  };
247
247
  }
248
- let oe;
249
- const re = [
248
+ let de;
249
+ const he = [
250
250
  "bounds_changed",
251
251
  "center_changed",
252
252
  "click",
@@ -266,7 +266,7 @@ const re = [
266
266
  "tilesloaded",
267
267
  "tilt_changed",
268
268
  "zoom_changed"
269
- ], je = k({
269
+ ], ze = M({
270
270
  props: {
271
271
  apiPromise: {
272
272
  type: Promise
@@ -454,104 +454,104 @@ const re = [
454
454
  required: !1
455
455
  }
456
456
  },
457
- emits: re,
457
+ emits: he,
458
458
  setup(o, { emit: e }) {
459
- const t = v(), n = v(!1), s = v(), r = v(), a = v(!1);
460
- q(I, s), q(E, r), q(we, a);
461
- const l = () => {
462
- const c = { ...o };
463
- Object.keys(c).forEach((m) => {
464
- c[m] === void 0 && delete c[m];
459
+ const t = v(), s = v(!1), r = v(), n = v(), a = v(!1);
460
+ z(q, r), z(R, n), z(Le, a);
461
+ const c = () => {
462
+ const l = { ...o };
463
+ Object.keys(l).forEach((m) => {
464
+ l[m] === void 0 && delete l[m];
465
465
  });
466
- const f = (m) => {
466
+ const p = (m) => {
467
467
  var g;
468
- return m ? { position: (g = r.value) == null ? void 0 : g.ControlPosition[m] } : {};
469
- }, d = {
468
+ return m ? { position: (g = n.value) == null ? void 0 : g.ControlPosition[m] } : {};
469
+ }, f = {
470
470
  scaleControlOptions: o.scaleControlStyle ? { style: o.scaleControlStyle } : {},
471
- panControlOptions: f(o.panControlPosition),
472
- zoomControlOptions: f(o.zoomControlPosition),
473
- rotateControlOptions: f(o.rotateControlPosition),
474
- streetViewControlOptions: f(o.streetViewControlPosition),
475
- fullscreenControlOptions: f(o.fullscreenControlPosition),
471
+ panControlOptions: p(o.panControlPosition),
472
+ zoomControlOptions: p(o.zoomControlPosition),
473
+ rotateControlOptions: p(o.rotateControlPosition),
474
+ streetViewControlOptions: p(o.streetViewControlPosition),
475
+ fullscreenControlOptions: p(o.fullscreenControlPosition),
476
476
  disableDefaultUI: o.disableDefaultUi
477
477
  };
478
- return { ...c, ...d };
479
- }, i = b(
480
- [r, s],
481
- ([c, h]) => {
482
- const f = c, d = h;
483
- f && d && (f.event.addListenerOnce(d, "tilesloaded", () => {
478
+ return { ...l, ...f };
479
+ }, i = O(
480
+ [n, r],
481
+ ([l, h]) => {
482
+ const p = l, f = h;
483
+ p && f && (p.event.addListenerOnce(f, "tilesloaded", () => {
484
484
  a.value = !0;
485
485
  }), setTimeout(i, 0));
486
486
  },
487
487
  { immediate: !0 }
488
- ), p = () => {
488
+ ), d = () => {
489
489
  try {
490
- const { apiKey: c, region: h, version: f, language: d, libraries: m } = o;
491
- oe = new O({ apiKey: c, region: h, version: f, language: d, libraries: m });
492
- } catch (c) {
493
- console.error(c);
490
+ const { apiKey: l, region: h, version: p, language: f, libraries: m } = o;
491
+ de = new S({ apiKey: l, region: h, version: p, language: f, libraries: m });
492
+ } catch (l) {
493
+ console.error(l);
494
494
  }
495
- }, u = (c) => {
496
- r.value = M(c.maps), s.value = M(new c.maps.Map(t.value, l()));
497
- const h = $e(r.value);
498
- r.value[H] = h, re.forEach((d) => {
495
+ }, u = (l) => {
496
+ n.value = E(l.maps), r.value = E(new l.maps.Map(t.value, c()));
497
+ const h = Ue(n.value);
498
+ n.value[Q] = h, he.forEach((f) => {
499
499
  var m;
500
- (m = s.value) == null || m.addListener(d, (g) => e(d, g));
501
- }), n.value = !0;
502
- const f = Object.keys(o).filter(
503
- (d) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(d)
504
- ).map((d) => L(o, d));
505
- b(
506
- [() => o.center, () => o.zoom, ...f],
507
- ([d, m], [g, C]) => {
508
- var ee, te, se;
509
- const { center: w, zoom: j, ..._ } = l();
510
- (ee = s.value) == null || ee.setOptions(_), m !== void 0 && m !== C && ((te = s.value) == null || te.setZoom(m));
511
- const Z = !g || d.lng !== g.lng || d.lat !== g.lat;
512
- d && Z && ((se = s.value) == null || se.panTo(d));
500
+ (m = r.value) == null || m.addListener(f, (g) => e(f, g));
501
+ }), s.value = !0;
502
+ const p = Object.keys(o).filter(
503
+ (f) => !["apiPromise", "apiKey", "version", "libraries", "region", "language", "center", "zoom"].includes(f)
504
+ ).map((f) => B(o, f));
505
+ O(
506
+ [() => o.center, () => o.zoom, ...p],
507
+ ([f, m], [g, y]) => {
508
+ var G, b, F;
509
+ const { center: w, zoom: C, ...T } = c();
510
+ (G = r.value) == null || G.setOptions(T), m !== void 0 && m !== y && ((b = r.value) == null || b.setZoom(m));
511
+ const N = !g || f.lng !== g.lng || f.lat !== g.lat;
512
+ f && N && ((F = r.value) == null || F.panTo(f));
513
513
  }
514
514
  );
515
515
  };
516
- return ge(() => {
517
- o.apiPromise && o.apiPromise instanceof Promise ? o.apiPromise.then(u) : (p(), oe.load().then(u));
518
- }), S(() => {
519
- var c;
520
- a.value = !1, s.value && ((c = r.value) == null || c.event.clearInstanceListeners(s.value));
521
- }), { mapRef: t, ready: n, map: s, api: r, mapTilesLoaded: a };
516
+ return Me(() => {
517
+ o.apiPromise && o.apiPromise instanceof Promise ? o.apiPromise.then(u) : (d(), de.load().then(u));
518
+ }), j(() => {
519
+ var l;
520
+ a.value = !1, r.value && ((l = n.value) == null || l.event.clearInstanceListeners(r.value));
521
+ }), { mapRef: t, ready: s, map: r, api: n, mapTilesLoaded: a };
522
522
  }
523
523
  });
524
- const K = (o, e) => {
524
+ const ee = (o, e) => {
525
525
  const t = o.__vccOpts || o;
526
- for (const [n, s] of e)
527
- t[n] = s;
526
+ for (const [s, r] of e)
527
+ t[s] = r;
528
528
  return t;
529
- }, Te = {
529
+ }, Ve = {
530
530
  ref: "mapRef",
531
531
  class: "mapdiv"
532
532
  };
533
- function qe(o, e, t, n, s, r) {
534
- return F(), G("div", null, [
535
- Y("div", Te, null, 512),
536
- U(o.$slots, "default", Pe(Se({ ready: o.ready, map: o.map, api: o.api, mapTilesLoaded: o.mapTilesLoaded })), void 0, !0)
533
+ function Ge(o, e, t, s, r, n) {
534
+ return J(), Y("div", null, [
535
+ ie("div", Ve, null, 512),
536
+ X(o.$slots, "default", Re(Ze({ ready: o.ready, map: o.map, api: o.api, mapTilesLoaded: o.mapTilesLoaded })), void 0, !0)
537
537
  ]);
538
538
  }
539
- const vt = /* @__PURE__ */ K(je, [["render", qe], ["__scopeId", "data-v-7d660dd5"]]);
540
- function Re(o) {
539
+ const Ot = /* @__PURE__ */ ee(ze, [["render", Ge], ["__scopeId", "data-v-7d660dd5"]]);
540
+ function He(o) {
541
541
  return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
542
542
  }
543
- var Ae = function o(e, t) {
543
+ var We = function o(e, t) {
544
544
  if (e === t)
545
545
  return !0;
546
546
  if (e && t && typeof e == "object" && typeof t == "object") {
547
547
  if (e.constructor !== t.constructor)
548
548
  return !1;
549
- var n, s, r;
549
+ var s, r, n;
550
550
  if (Array.isArray(e)) {
551
- if (n = e.length, n != t.length)
551
+ if (s = e.length, s != t.length)
552
552
  return !1;
553
- for (s = n; s-- !== 0; )
554
- if (!o(e[s], t[s]))
553
+ for (r = s; r-- !== 0; )
554
+ if (!o(e[r], t[r]))
555
555
  return !1;
556
556
  return !0;
557
557
  }
@@ -561,13 +561,13 @@ var Ae = function o(e, t) {
561
561
  return e.valueOf() === t.valueOf();
562
562
  if (e.toString !== Object.prototype.toString)
563
563
  return e.toString() === t.toString();
564
- if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
564
+ if (n = Object.keys(e), s = n.length, s !== Object.keys(t).length)
565
565
  return !1;
566
- for (s = n; s-- !== 0; )
567
- if (!Object.prototype.hasOwnProperty.call(t, r[s]))
566
+ for (r = s; r-- !== 0; )
567
+ if (!Object.prototype.hasOwnProperty.call(t, n[r]))
568
568
  return !1;
569
- for (s = n; s-- !== 0; ) {
570
- var a = r[s];
569
+ for (r = s; r-- !== 0; ) {
570
+ var a = n[r];
571
571
  if (!o(e[a], t[a]))
572
572
  return !1;
573
573
  }
@@ -575,37 +575,37 @@ var Ae = function o(e, t) {
575
575
  }
576
576
  return e !== e && t !== t;
577
577
  };
578
- const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o === H, $ = (o, e, t, n) => {
579
- const s = v(), r = y(I, v()), a = y(E, v()), l = y(ke, v()), i = z(
580
- () => !!(l.value && a.value && (s.value instanceof a.value.Marker || s.value instanceof a.value[H]))
578
+ const A = /* @__PURE__ */ He(We), Ke = (o) => o === "Marker", Je = (o) => o === Q, Z = (o, e, t, s) => {
579
+ const r = v(), n = _(q, v()), a = _(R, v()), c = _(Ee, v()), i = K(
580
+ () => !!(c.value && a.value && (r.value instanceof a.value.Marker || r.value instanceof a.value[Q]))
581
581
  );
582
- return b(
583
- [r, t],
584
- (p, [u, c]) => {
585
- var f, d, m;
586
- const h = !A(t.value, c) || r.value !== u;
587
- !r.value || !a.value || !h || (s.value ? (s.value.setOptions(t.value), i.value && ((f = l.value) == null || f.removeMarker(s.value), (d = l.value) == null || d.addMarker(s.value))) : (Ze(o) ? s.value = M(
582
+ return O(
583
+ [n, t],
584
+ (d, [u, l]) => {
585
+ var p, f, m;
586
+ const h = !A(t.value, l) || n.value !== u;
587
+ !n.value || !a.value || !h || (r.value ? (r.value.setOptions(t.value), i.value && ((p = c.value) == null || p.removeMarker(r.value), (f = c.value) == null || f.addMarker(r.value))) : (Ke(o) ? r.value = E(
588
588
  new a.value[o](t.value)
589
- ) : Be(o) ? s.value = M(
589
+ ) : Je(o) ? r.value = E(
590
590
  new a.value[o](t.value)
591
- ) : s.value = M(
591
+ ) : r.value = E(
592
592
  new a.value[o]({
593
593
  ...t.value,
594
- map: r.value
594
+ map: n.value
595
595
  })
596
- ), i.value ? (m = l.value) == null || m.addMarker(s.value) : s.value.setMap(r.value), e.forEach((g) => {
597
- var C;
598
- (C = s.value) == null || C.addListener(g, (w) => n(g, w));
596
+ ), i.value ? (m = c.value) == null || m.addMarker(r.value) : r.value.setMap(n.value), e.forEach((g) => {
597
+ var y;
598
+ (y = r.value) == null || y.addListener(g, (w) => s(g, w));
599
599
  })));
600
600
  },
601
601
  {
602
602
  immediate: !0
603
603
  }
604
- ), S(() => {
605
- var p, u;
606
- s.value && ((p = a.value) == null || p.event.clearInstanceListeners(s.value), i.value ? (u = l.value) == null || u.removeMarker(s.value) : s.value.setMap(null));
607
- }), s;
608
- }, ie = [
604
+ ), j(() => {
605
+ var d, u;
606
+ r.value && ((d = a.value) == null || d.event.clearInstanceListeners(r.value), i.value ? (u = c.value) == null || u.removeMarker(r.value) : r.value.setMap(null));
607
+ }), r;
608
+ }, pe = [
609
609
  "animation_changed",
610
610
  "click",
611
611
  "dblclick",
@@ -629,7 +629,7 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
629
629
  "shape_changed",
630
630
  "title_changed",
631
631
  "visible_changed"
632
- ], yt = k({
632
+ ], Pt = M({
633
633
  name: "Marker",
634
634
  props: {
635
635
  options: {
@@ -637,15 +637,15 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
637
637
  required: !0
638
638
  }
639
639
  },
640
- emits: ie,
641
- setup(o, { emit: e, expose: t, slots: n }) {
642
- const s = L(o, "options"), r = $("Marker", ie, s, e);
643
- return q(_e, r), t({ marker: r }), () => {
640
+ emits: pe,
641
+ setup(o, { emit: e, expose: t, slots: s }) {
642
+ const r = B(o, "options"), n = Z("Marker", pe, r, e);
643
+ return z(xe, n), t({ marker: n }), () => {
644
644
  var a;
645
- return (a = n.default) == null ? void 0 : a.call(n);
645
+ return (a = s.default) == null ? void 0 : a.call(s);
646
646
  };
647
647
  }
648
- }), Ct = k({
648
+ }), xt = M({
649
649
  name: "Polyline",
650
650
  props: {
651
651
  options: {
@@ -653,13 +653,13 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
653
653
  required: !0
654
654
  }
655
655
  },
656
- emits: P,
656
+ emits: $,
657
657
  setup(o, { emit: e }) {
658
- const t = L(o, "options");
659
- return { polyline: $("Polyline", P, t, e) };
658
+ const t = B(o, "options");
659
+ return { polyline: Z("Polyline", $, t, e) };
660
660
  },
661
661
  render: () => null
662
- }), _t = k({
662
+ }), Et = M({
663
663
  name: "Polygon",
664
664
  props: {
665
665
  options: {
@@ -667,13 +667,13 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
667
667
  required: !0
668
668
  }
669
669
  },
670
- emits: P,
670
+ emits: $,
671
671
  setup(o, { emit: e }) {
672
- const t = L(o, "options");
673
- return { polygon: $("Polygon", P, t, e) };
672
+ const t = B(o, "options");
673
+ return { polygon: Z("Polygon", $, t, e) };
674
674
  },
675
675
  render: () => null
676
- }), ae = P.concat(["bounds_changed"]), kt = k({
676
+ }), fe = $.concat(["bounds_changed"]), Lt = M({
677
677
  name: "Rectangle",
678
678
  props: {
679
679
  options: {
@@ -681,13 +681,13 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
681
681
  required: !0
682
682
  }
683
683
  },
684
- emits: ae,
684
+ emits: fe,
685
685
  setup(o, { emit: e }) {
686
- const t = L(o, "options");
687
- return { rectangle: $("Rectangle", ae, t, e) };
686
+ const t = B(o, "options");
687
+ return { rectangle: Z("Rectangle", fe, t, e) };
688
688
  },
689
689
  render: () => null
690
- }), le = P.concat(["center_changed", "radius_changed"]), wt = k({
690
+ }), me = $.concat(["center_changed", "radius_changed"]), St = M({
691
691
  name: "Circle",
692
692
  props: {
693
693
  options: {
@@ -695,13 +695,13 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
695
695
  required: !0
696
696
  }
697
697
  },
698
- emits: le,
698
+ emits: me,
699
699
  setup(o, { emit: e }) {
700
- const t = L(o, "options");
701
- return { circle: $("Circle", le, t, e) };
700
+ const t = B(o, "options");
701
+ return { circle: Z("Circle", me, t, e) };
702
702
  },
703
703
  render: () => null
704
- }), Ne = k({
704
+ }), Ye = M({
705
705
  props: {
706
706
  position: {
707
707
  type: String,
@@ -714,47 +714,47 @@ const A = /* @__PURE__ */ Re(Ae), Ze = (o) => o === "Marker", Be = (o) => o ===
714
714
  },
715
715
  emits: ["content:loaded"],
716
716
  setup(o, { emit: e }) {
717
- const t = v(null), n = y(I, v()), s = y(E, v()), r = y(we, v(!1)), a = v(!1), l = b(
718
- [r, s, t],
719
- ([u, c, h]) => {
720
- c && u && h && (i(o.position), a.value = !0, e("content:loaded"), setTimeout(l, 0));
717
+ const t = v(null), s = _(q, v()), r = _(R, v()), n = _(Le, v(!1)), a = v(!1), c = O(
718
+ [n, r, t],
719
+ ([u, l, h]) => {
720
+ l && u && h && (i(o.position), a.value = !0, e("content:loaded"), setTimeout(c, 0));
721
721
  },
722
722
  { immediate: !0 }
723
723
  ), i = (u) => {
724
- if (n.value && s.value && t.value) {
725
- const c = s.value.ControlPosition[u];
726
- n.value.controls[c].push(t.value);
724
+ if (s.value && r.value && t.value) {
725
+ const l = r.value.ControlPosition[u];
726
+ s.value.controls[l].push(t.value);
727
727
  }
728
- }, p = (u) => {
729
- if (n.value && s.value) {
730
- let c = null;
731
- const h = s.value.ControlPosition[u];
732
- n.value.controls[h].forEach((f, d) => {
733
- f === t.value && (c = d);
734
- }), c !== null && n.value.controls[h].removeAt(c);
728
+ }, d = (u) => {
729
+ if (s.value && r.value) {
730
+ let l = null;
731
+ const h = r.value.ControlPosition[u];
732
+ s.value.controls[h].forEach((p, f) => {
733
+ p === t.value && (l = f);
734
+ }), l !== null && s.value.controls[h].removeAt(l);
735
735
  }
736
736
  };
737
- return S(() => p(o.position)), b(
737
+ return j(() => d(o.position)), O(
738
738
  () => o.position,
739
- (u, c) => {
740
- p(c), i(u);
739
+ (u, l) => {
740
+ d(l), i(u);
741
741
  }
742
- ), b(
742
+ ), O(
743
743
  () => o.index,
744
744
  (u) => {
745
745
  u && t.value && (t.value.index = o.index);
746
746
  }
747
747
  ), { controlRef: t, showContent: a };
748
748
  }
749
- }), ze = { ref: "controlRef" };
750
- function De(o, e, t, n, s, r) {
751
- return Le((F(), G("div", ze, [
752
- U(o.$slots, "default")
749
+ }), Xe = { ref: "controlRef" };
750
+ function Qe(o, e, t, s, r, n) {
751
+ return Ne((J(), Y("div", Xe, [
752
+ X(o.$slots, "default")
753
753
  ], 512)), [
754
- [Ie, o.showContent]
754
+ [Fe, o.showContent]
755
755
  ]);
756
756
  }
757
- const bt = /* @__PURE__ */ K(Ne, [["render", De]]), ce = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], Fe = k({
757
+ const At = /* @__PURE__ */ ee(Ye, [["render", Qe]]), ge = ["closeclick", "content_changed", "domready", "position_changed", "visible", "zindex_changed"], et = M({
758
758
  inheritAttrs: !1,
759
759
  props: {
760
760
  options: {
@@ -762,146 +762,212 @@ const bt = /* @__PURE__ */ K(Ne, [["render", De]]), ce = ["closeclick", "content
762
762
  default: () => ({})
763
763
  }
764
764
  },
765
- emits: ce,
766
- setup(o, { slots: e, emit: t, expose: n }) {
767
- const s = v(), r = v(), a = y(I, v()), l = y(E, v()), i = y(_e, v());
768
- let p;
769
- const u = z(() => {
765
+ emits: ge,
766
+ setup(o, { slots: e, emit: t, expose: s }) {
767
+ const r = v(), n = v(), a = _(q, v()), c = _(R, v()), i = _(xe, v());
768
+ let d;
769
+ const u = K(() => {
770
+ var p;
771
+ return (p = e.default) == null ? void 0 : p.call(e).some((f) => f.type !== be);
772
+ }), l = (p) => {
770
773
  var f;
771
- return (f = e.default) == null ? void 0 : f.call(e).some((d) => d.type !== ve);
772
- }), c = (f) => {
773
- var d;
774
- return (d = s.value) == null ? void 0 : d.open({ map: a.value, anchor: i.value, ...f });
774
+ return (f = r.value) == null ? void 0 : f.open({ map: a.value, anchor: i.value, ...p });
775
775
  }, h = () => {
776
- var f;
777
- return (f = s.value) == null ? void 0 : f.close();
776
+ var p;
777
+ return (p = r.value) == null ? void 0 : p.close();
778
778
  };
779
- return ge(() => {
780
- b(
779
+ return Me(() => {
780
+ O(
781
781
  [a, () => o.options],
782
- ([f, d], [m, g]) => {
783
- const C = !A(d, g) || a.value !== m;
784
- a.value && l.value && C && (s.value ? (s.value.setOptions({
785
- ...d,
786
- content: u.value ? r.value : d.content
787
- }), i.value || c()) : (s.value = M(
788
- new l.value.InfoWindow({
789
- ...d,
790
- content: u.value ? r.value : d.content
782
+ ([p, f], [m, g]) => {
783
+ const y = !A(f, g) || a.value !== m;
784
+ a.value && c.value && y && (r.value ? (r.value.setOptions({
785
+ ...f,
786
+ content: u.value ? n.value : f.content
787
+ }), i.value || l()) : (r.value = E(
788
+ new c.value.InfoWindow({
789
+ ...f,
790
+ content: u.value ? n.value : f.content
791
791
  })
792
- ), i.value ? p = i.value.addListener("click", () => {
793
- c();
794
- }) : c(), ce.forEach((w) => {
795
- var j;
796
- (j = s.value) == null || j.addListener(w, (_) => t(w, _));
792
+ ), i.value ? d = i.value.addListener("click", () => {
793
+ l();
794
+ }) : l(), ge.forEach((w) => {
795
+ var C;
796
+ (C = r.value) == null || C.addListener(w, (T) => t(w, T));
797
797
  })));
798
798
  },
799
799
  {
800
800
  immediate: !0
801
801
  }
802
802
  );
803
- }), S(() => {
804
- var f;
805
- p && p.remove(), s.value && ((f = l.value) == null || f.event.clearInstanceListeners(s.value), h());
806
- }), n({ infoWindow: s, open: c, close: h }), { infoWindow: s, infoWindowRef: r, hasSlotContent: u, open: c, close: h };
803
+ }), j(() => {
804
+ var p;
805
+ d && d.remove(), r.value && ((p = c.value) == null || p.event.clearInstanceListeners(r.value), h());
806
+ }), s({ infoWindow: r, open: l, close: h }), { infoWindow: r, infoWindowRef: n, hasSlotContent: u, open: l, close: h };
807
807
  }
808
808
  });
809
- const Ge = {
809
+ const tt = {
810
810
  key: 0,
811
811
  class: "info-window-wrapper"
812
812
  };
813
- function Ue(o, e, t, n, s, r) {
814
- return o.hasSlotContent ? (F(), G("div", Ge, [
815
- Y("div", ye({ ref: "infoWindowRef" }, o.$attrs), [
816
- U(o.$slots, "default", {}, void 0, !0)
813
+ function st(o, e, t, s, r, n) {
814
+ return o.hasSlotContent ? (J(), Y("div", tt, [
815
+ ie("div", Oe({ ref: "infoWindowRef" }, o.$attrs), [
816
+ X(o.$slots, "default", {}, void 0, !0)
817
817
  ], 16)
818
- ])) : Ce("", !0);
819
- }
820
- const Mt = /* @__PURE__ */ K(Fe, [["render", Ue], ["__scopeId", "data-v-45a4606d"]]);
821
- function J(o, e, t, n, s, r) {
822
- if (s - n <= t)
823
- return;
824
- const a = n + s >> 1;
825
- be(o, e, a, n, s, r % 2), J(o, e, t, n, a - 1, r + 1), J(o, e, t, a + 1, s, r + 1);
818
+ ])) : Pe("", !0);
826
819
  }
827
- function be(o, e, t, n, s, r) {
828
- for (; s > n; ) {
829
- if (s - n > 600) {
830
- const p = s - n + 1, u = t - n + 1, c = Math.log(p), h = 0.5 * Math.exp(2 * c / 3), f = 0.5 * Math.sqrt(c * h * (p - h) / p) * (u - p / 2 < 0 ? -1 : 1), d = Math.max(n, Math.floor(t - u * h / p + f)), m = Math.min(s, Math.floor(t + (p - u) * h / p + f));
831
- be(o, e, t, d, m, r);
820
+ const Tt = /* @__PURE__ */ ee(et, [["render", st], ["__scopeId", "data-v-45a4606d"]]), ve = [
821
+ Int8Array,
822
+ Uint8Array,
823
+ Uint8ClampedArray,
824
+ Int16Array,
825
+ Uint16Array,
826
+ Int32Array,
827
+ Uint32Array,
828
+ Float32Array,
829
+ Float64Array
830
+ ], se = 1, D = 8;
831
+ class ae {
832
+ /**
833
+ * Creates an index from raw `ArrayBuffer` data.
834
+ * @param {ArrayBuffer} data
835
+ */
836
+ static from(e) {
837
+ if (!(e instanceof ArrayBuffer))
838
+ throw new Error("Data must be an instance of ArrayBuffer.");
839
+ const [t, s] = new Uint8Array(e, 0, 2);
840
+ if (t !== 219)
841
+ throw new Error("Data does not appear to be in a KDBush format.");
842
+ const r = s >> 4;
843
+ if (r !== se)
844
+ throw new Error(`Got v${r} data when expected v${se}.`);
845
+ const n = ve[s & 15];
846
+ if (!n)
847
+ throw new Error("Unrecognized array type.");
848
+ const [a] = new Uint16Array(e, 2, 1), [c] = new Uint32Array(e, 4, 1);
849
+ return new ae(c, a, n, e);
850
+ }
851
+ /**
852
+ * Creates an index that will hold a given number of items.
853
+ * @param {number} numItems
854
+ * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).
855
+ * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).
856
+ * @param {ArrayBuffer} [data] (For internal use only)
857
+ */
858
+ constructor(e, t = 64, s = Float64Array, r) {
859
+ if (isNaN(e) || e < 0)
860
+ throw new Error(`Unpexpected numItems value: ${e}.`);
861
+ this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = s, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
862
+ const n = ve.indexOf(this.ArrayType), a = e * 2 * this.ArrayType.BYTES_PER_ELEMENT, c = e * this.IndexArrayType.BYTES_PER_ELEMENT, i = (8 - c % 8) % 8;
863
+ if (n < 0)
864
+ throw new Error(`Unexpected typed array class: ${s}.`);
865
+ r && r instanceof ArrayBuffer ? (this.data = r, this.ids = new this.IndexArrayType(this.data, D, e), this.coords = new this.ArrayType(this.data, D + c + i, e * 2), this._pos = e * 2, this._finished = !0) : (this.data = new ArrayBuffer(D + a + c + i), this.ids = new this.IndexArrayType(this.data, D, e), this.coords = new this.ArrayType(this.data, D + c + i, e * 2), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, (se << 4) + n]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
866
+ }
867
+ /**
868
+ * Add a point to the index.
869
+ * @param {number} x
870
+ * @param {number} y
871
+ * @returns {number} An incremental index associated with the added item (starting from `0`).
872
+ */
873
+ add(e, t) {
874
+ const s = this._pos >> 1;
875
+ return this.ids[s] = s, this.coords[this._pos++] = e, this.coords[this._pos++] = t, s;
876
+ }
877
+ /**
878
+ * Perform indexing of the added points.
879
+ */
880
+ finish() {
881
+ const e = this._pos >> 1;
882
+ if (e !== this.numItems)
883
+ throw new Error(`Added ${e} items when expected ${this.numItems}.`);
884
+ return ne(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
885
+ }
886
+ /**
887
+ * Search the index for items within a given bounding box.
888
+ * @param {number} minX
889
+ * @param {number} minY
890
+ * @param {number} maxX
891
+ * @param {number} maxY
892
+ * @returns {number[]} An array of indices correponding to the found items.
893
+ */
894
+ range(e, t, s, r) {
895
+ if (!this._finished)
896
+ throw new Error("Data not yet indexed - call index.finish().");
897
+ const { ids: n, coords: a, nodeSize: c } = this, i = [0, n.length - 1, 0], d = [];
898
+ for (; i.length; ) {
899
+ const u = i.pop() || 0, l = i.pop() || 0, h = i.pop() || 0;
900
+ if (l - h <= c) {
901
+ for (let g = h; g <= l; g++) {
902
+ const y = a[2 * g], w = a[2 * g + 1];
903
+ y >= e && y <= s && w >= t && w <= r && d.push(n[g]);
904
+ }
905
+ continue;
906
+ }
907
+ const p = h + l >> 1, f = a[2 * p], m = a[2 * p + 1];
908
+ f >= e && f <= s && m >= t && m <= r && d.push(n[p]), (u === 0 ? e <= f : t <= m) && (i.push(h), i.push(p - 1), i.push(1 - u)), (u === 0 ? s >= f : r >= m) && (i.push(p + 1), i.push(l), i.push(1 - u));
832
909
  }
833
- const a = e[2 * t + r];
834
- let l = n, i = s;
835
- for (T(o, e, n, t), e[2 * s + r] > a && T(o, e, n, s); l < i; ) {
836
- for (T(o, e, l, i), l++, i--; e[2 * l + r] < a; )
837
- l++;
838
- for (; e[2 * i + r] > a; )
839
- i--;
910
+ return d;
911
+ }
912
+ /**
913
+ * Search the index for items within a given radius.
914
+ * @param {number} qx
915
+ * @param {number} qy
916
+ * @param {number} r Query radius.
917
+ * @returns {number[]} An array of indices correponding to the found items.
918
+ */
919
+ within(e, t, s) {
920
+ if (!this._finished)
921
+ throw new Error("Data not yet indexed - call index.finish().");
922
+ const { ids: r, coords: n, nodeSize: a } = this, c = [0, r.length - 1, 0], i = [], d = s * s;
923
+ for (; c.length; ) {
924
+ const u = c.pop() || 0, l = c.pop() || 0, h = c.pop() || 0;
925
+ if (l - h <= a) {
926
+ for (let g = h; g <= l; g++)
927
+ ye(n[2 * g], n[2 * g + 1], e, t) <= d && i.push(r[g]);
928
+ continue;
929
+ }
930
+ const p = h + l >> 1, f = n[2 * p], m = n[2 * p + 1];
931
+ ye(f, m, e, t) <= d && i.push(r[p]), (u === 0 ? e - s <= f : t - s <= m) && (c.push(h), c.push(p - 1), c.push(1 - u)), (u === 0 ? e + s >= f : t + s >= m) && (c.push(p + 1), c.push(l), c.push(1 - u));
840
932
  }
841
- e[2 * n + r] === a ? T(o, e, n, i) : (i++, T(o, e, i, s)), i <= t && (n = i + 1), t <= i && (s = i - 1);
933
+ return i;
842
934
  }
843
935
  }
844
- function T(o, e, t, n) {
845
- W(o, t, n), W(e, 2 * t, 2 * n), W(e, 2 * t + 1, 2 * n + 1);
846
- }
847
- function W(o, e, t) {
848
- const n = o[e];
849
- o[e] = o[t], o[t] = n;
936
+ function ne(o, e, t, s, r, n) {
937
+ if (r - s <= t)
938
+ return;
939
+ const a = s + r >> 1;
940
+ Se(o, e, a, s, r, n), ne(o, e, t, s, a - 1, 1 - n), ne(o, e, t, a + 1, r, 1 - n);
850
941
  }
851
- function He(o, e, t, n, s, r, a) {
852
- const l = [0, o.length - 1, 0], i = [];
853
- let p, u;
854
- for (; l.length; ) {
855
- const c = l.pop(), h = l.pop(), f = l.pop();
856
- if (h - f <= a) {
857
- for (let g = f; g <= h; g++)
858
- p = e[2 * g], u = e[2 * g + 1], p >= t && p <= s && u >= n && u <= r && i.push(o[g]);
859
- continue;
942
+ function Se(o, e, t, s, r, n) {
943
+ for (; r > s; ) {
944
+ if (r - s > 600) {
945
+ const d = r - s + 1, u = t - s + 1, l = Math.log(d), h = 0.5 * Math.exp(2 * l / 3), p = 0.5 * Math.sqrt(l * h * (d - h) / d) * (u - d / 2 < 0 ? -1 : 1), f = Math.max(s, Math.floor(t - u * h / d + p)), m = Math.min(r, Math.floor(t + (d - u) * h / d + p));
946
+ Se(o, e, t, f, m, n);
860
947
  }
861
- const d = Math.floor((f + h) / 2);
862
- p = e[2 * d], u = e[2 * d + 1], p >= t && p <= s && u >= n && u <= r && i.push(o[d]);
863
- const m = (c + 1) % 2;
864
- (c === 0 ? t <= p : n <= u) && (l.push(f), l.push(d - 1), l.push(m)), (c === 0 ? s >= p : r >= u) && (l.push(d + 1), l.push(h), l.push(m));
865
- }
866
- return i;
867
- }
868
- function Ke(o, e, t, n, s, r) {
869
- const a = [0, o.length - 1, 0], l = [], i = s * s;
870
- for (; a.length; ) {
871
- const p = a.pop(), u = a.pop(), c = a.pop();
872
- if (u - c <= r) {
873
- for (let g = c; g <= u; g++)
874
- ue(e[2 * g], e[2 * g + 1], t, n) <= i && l.push(o[g]);
875
- continue;
948
+ const a = e[2 * t + n];
949
+ let c = s, i = r;
950
+ for (U(o, e, s, t), e[2 * r + n] > a && U(o, e, s, r); c < i; ) {
951
+ for (U(o, e, c, i), c++, i--; e[2 * c + n] < a; )
952
+ c++;
953
+ for (; e[2 * i + n] > a; )
954
+ i--;
876
955
  }
877
- const h = Math.floor((c + u) / 2), f = e[2 * h], d = e[2 * h + 1];
878
- ue(f, d, t, n) <= i && l.push(o[h]);
879
- const m = (p + 1) % 2;
880
- (p === 0 ? t - s <= f : n - s <= d) && (a.push(c), a.push(h - 1), a.push(m)), (p === 0 ? t + s >= f : n + s >= d) && (a.push(h + 1), a.push(u), a.push(m));
956
+ e[2 * s + n] === a ? U(o, e, s, i) : (i++, U(o, e, i, r)), i <= t && (s = i + 1), t <= i && (r = i - 1);
881
957
  }
882
- return l;
883
958
  }
884
- function ue(o, e, t, n) {
885
- const s = o - t, r = e - n;
886
- return s * s + r * r;
959
+ function U(o, e, t, s) {
960
+ re(o, t, s), re(e, 2 * t, 2 * s), re(e, 2 * t + 1, 2 * s + 1);
887
961
  }
888
- const Ve = (o) => o[0], We = (o) => o[1];
889
- class pe {
890
- constructor(e, t = Ve, n = We, s = 64, r = Float64Array) {
891
- this.nodeSize = s, this.points = e;
892
- const a = e.length < 65536 ? Uint16Array : Uint32Array, l = this.ids = new a(e.length), i = this.coords = new r(e.length * 2);
893
- for (let p = 0; p < e.length; p++)
894
- l[p] = p, i[2 * p] = t(e[p]), i[2 * p + 1] = n(e[p]);
895
- J(l, i, s, 0, l.length - 1, 0);
896
- }
897
- range(e, t, n, s) {
898
- return He(this.ids, this.coords, e, t, n, s, this.nodeSize);
899
- }
900
- within(e, t, n) {
901
- return Ke(this.ids, this.coords, e, t, n, this.nodeSize);
902
- }
962
+ function re(o, e, t) {
963
+ const s = o[e];
964
+ o[e] = o[t], o[t] = s;
903
965
  }
904
- const Je = {
966
+ function ye(o, e, t, s) {
967
+ const r = o - t, n = e - s;
968
+ return r * r + n * n;
969
+ }
970
+ const rt = {
905
971
  minZoom: 0,
906
972
  // min zoom to generate clusters on
907
973
  maxZoom: 16,
@@ -924,168 +990,201 @@ const Je = {
924
990
  // properties to use for individual points when running the reducer
925
991
  map: (o) => o
926
992
  // props => ({sum: props.my_value})
927
- }, D = Math.fround || ((o) => (e) => (o[0] = +e, o[0]))(new Float32Array(1));
928
- class Xe {
993
+ }, we = Math.fround || ((o) => (e) => (o[0] = +e, o[0]))(new Float32Array(1)), L = 2, x = 3, oe = 4, P = 5, Ae = 6;
994
+ class Te {
929
995
  constructor(e) {
930
- this.options = R(Object.create(Je), e), this.trees = new Array(this.options.maxZoom + 1);
996
+ this.options = Object.assign(Object.create(rt), e), this.trees = new Array(this.options.maxZoom + 1), this.stride = this.options.reduce ? 7 : 6, this.clusterProps = [];
931
997
  }
932
998
  load(e) {
933
- const { log: t, minZoom: n, maxZoom: s, nodeSize: r } = this.options;
999
+ const { log: t, minZoom: s, maxZoom: r } = this.options;
934
1000
  t && console.time("total time");
935
- const a = `prepare ${e.length} points`;
936
- t && console.time(a), this.points = e;
937
- let l = [];
938
- for (let i = 0; i < e.length; i++)
939
- e[i].geometry && l.push(Qe(e[i], i));
940
- this.trees[s + 1] = new pe(l, he, fe, r, Float32Array), t && console.timeEnd(a);
941
- for (let i = s; i >= n; i--) {
942
- const p = +Date.now();
943
- l = this._cluster(l, i), this.trees[i] = new pe(l, he, fe, r, Float32Array), t && console.log("z%d: %d clusters in %dms", i, l.length, +Date.now() - p);
1001
+ const n = `prepare ${e.length} points`;
1002
+ t && console.time(n), this.points = e;
1003
+ const a = [];
1004
+ for (let i = 0; i < e.length; i++) {
1005
+ const d = e[i];
1006
+ if (!d.geometry)
1007
+ continue;
1008
+ const [u, l] = d.geometry.coordinates, h = we(H(u)), p = we(W(l));
1009
+ a.push(
1010
+ h,
1011
+ p,
1012
+ // projected point coordinates
1013
+ 1 / 0,
1014
+ // the last zoom the point was processed at
1015
+ i,
1016
+ // index of the source feature in the original input array
1017
+ -1,
1018
+ // parent cluster id
1019
+ 1
1020
+ // number of points in a cluster
1021
+ ), this.options.reduce && a.push(0);
1022
+ }
1023
+ let c = this.trees[r + 1] = this._createTree(a);
1024
+ t && console.timeEnd(n);
1025
+ for (let i = r; i >= s; i--) {
1026
+ const d = +Date.now();
1027
+ c = this.trees[i] = this._createTree(this._cluster(c, i)), t && console.log("z%d: %d clusters in %dms", i, c.numItems, +Date.now() - d);
944
1028
  }
945
1029
  return t && console.timeEnd("total time"), this;
946
1030
  }
947
1031
  getClusters(e, t) {
948
- let n = ((e[0] + 180) % 360 + 360) % 360 - 180;
949
- const s = Math.max(-90, Math.min(90, e[1]));
950
- let r = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
1032
+ let s = ((e[0] + 180) % 360 + 360) % 360 - 180;
1033
+ const r = Math.max(-90, Math.min(90, e[1]));
1034
+ let n = e[2] === 180 ? 180 : ((e[2] + 180) % 360 + 360) % 360 - 180;
951
1035
  const a = Math.max(-90, Math.min(90, e[3]));
952
1036
  if (e[2] - e[0] >= 360)
953
- n = -180, r = 180;
954
- else if (n > r) {
955
- const u = this.getClusters([n, s, 180, a], t), c = this.getClusters([-180, s, r, a], t);
956
- return u.concat(c);
1037
+ s = -180, n = 180;
1038
+ else if (s > n) {
1039
+ const l = this.getClusters([s, r, 180, a], t), h = this.getClusters([-180, r, n, a], t);
1040
+ return l.concat(h);
957
1041
  }
958
- const l = this.trees[this._limitZoom(t)], i = l.range(B(n), N(a), B(r), N(s)), p = [];
959
- for (const u of i) {
960
- const c = l.points[u];
961
- p.push(c.numPoints ? de(c) : this.points[c.index]);
1042
+ const c = this.trees[this._limitZoom(t)], i = c.range(H(s), W(a), H(n), W(r)), d = c.data, u = [];
1043
+ for (const l of i) {
1044
+ const h = this.stride * l;
1045
+ u.push(d[h + P] > 1 ? ke(d, h, this.clusterProps) : this.points[d[h + x]]);
962
1046
  }
963
- return p;
1047
+ return u;
964
1048
  }
965
1049
  getChildren(e) {
966
- const t = this._getOriginId(e), n = this._getOriginZoom(e), s = "No cluster with the specified id.", r = this.trees[n];
967
- if (!r)
968
- throw new Error(s);
969
- const a = r.points[t];
970
- if (!a)
971
- throw new Error(s);
972
- const l = this.options.radius / (this.options.extent * Math.pow(2, n - 1)), i = r.within(a.x, a.y, l), p = [];
973
- for (const u of i) {
974
- const c = r.points[u];
975
- c.parentId === e && p.push(c.numPoints ? de(c) : this.points[c.index]);
1050
+ const t = this._getOriginId(e), s = this._getOriginZoom(e), r = "No cluster with the specified id.", n = this.trees[s];
1051
+ if (!n)
1052
+ throw new Error(r);
1053
+ const a = n.data;
1054
+ if (t * this.stride >= a.length)
1055
+ throw new Error(r);
1056
+ const c = this.options.radius / (this.options.extent * Math.pow(2, s - 1)), i = a[t * this.stride], d = a[t * this.stride + 1], u = n.within(i, d, c), l = [];
1057
+ for (const h of u) {
1058
+ const p = h * this.stride;
1059
+ a[p + oe] === e && l.push(a[p + P] > 1 ? ke(a, p, this.clusterProps) : this.points[a[p + x]]);
976
1060
  }
977
- if (p.length === 0)
978
- throw new Error(s);
979
- return p;
1061
+ if (l.length === 0)
1062
+ throw new Error(r);
1063
+ return l;
980
1064
  }
981
- getLeaves(e, t, n) {
982
- t = t || 10, n = n || 0;
983
- const s = [];
984
- return this._appendLeaves(s, e, t, n, 0), s;
1065
+ getLeaves(e, t, s) {
1066
+ t = t || 10, s = s || 0;
1067
+ const r = [];
1068
+ return this._appendLeaves(r, e, t, s, 0), r;
985
1069
  }
986
- getTile(e, t, n) {
987
- const s = this.trees[this._limitZoom(e)], r = Math.pow(2, e), { extent: a, radius: l } = this.options, i = l / a, p = (n - i) / r, u = (n + 1 + i) / r, c = {
1070
+ getTile(e, t, s) {
1071
+ const r = this.trees[this._limitZoom(e)], n = Math.pow(2, e), { extent: a, radius: c } = this.options, i = c / a, d = (s - i) / n, u = (s + 1 + i) / n, l = {
988
1072
  features: []
989
1073
  };
990
1074
  return this._addTileFeatures(
991
- s.range((t - i) / r, p, (t + 1 + i) / r, u),
992
- s.points,
1075
+ r.range((t - i) / n, d, (t + 1 + i) / n, u),
1076
+ r.data,
993
1077
  t,
1078
+ s,
994
1079
  n,
995
- r,
996
- c
1080
+ l
997
1081
  ), t === 0 && this._addTileFeatures(
998
- s.range(1 - i / r, p, 1, u),
999
- s.points,
1000
- r,
1082
+ r.range(1 - i / n, d, 1, u),
1083
+ r.data,
1001
1084
  n,
1002
- r,
1003
- c
1004
- ), t === r - 1 && this._addTileFeatures(
1005
- s.range(0, p, i / r, u),
1006
- s.points,
1085
+ s,
1086
+ n,
1087
+ l
1088
+ ), t === n - 1 && this._addTileFeatures(
1089
+ r.range(0, d, i / n, u),
1090
+ r.data,
1007
1091
  -1,
1092
+ s,
1008
1093
  n,
1009
- r,
1010
- c
1011
- ), c.features.length ? c : null;
1094
+ l
1095
+ ), l.features.length ? l : null;
1012
1096
  }
1013
1097
  getClusterExpansionZoom(e) {
1014
1098
  let t = this._getOriginZoom(e) - 1;
1015
1099
  for (; t <= this.options.maxZoom; ) {
1016
- const n = this.getChildren(e);
1017
- if (t++, n.length !== 1)
1100
+ const s = this.getChildren(e);
1101
+ if (t++, s.length !== 1)
1018
1102
  break;
1019
- e = n[0].properties.cluster_id;
1103
+ e = s[0].properties.cluster_id;
1020
1104
  }
1021
1105
  return t;
1022
1106
  }
1023
- _appendLeaves(e, t, n, s, r) {
1107
+ _appendLeaves(e, t, s, r, n) {
1024
1108
  const a = this.getChildren(t);
1025
- for (const l of a) {
1026
- const i = l.properties;
1027
- if (i && i.cluster ? r + i.point_count <= s ? r += i.point_count : r = this._appendLeaves(e, i.cluster_id, n, s, r) : r < s ? r++ : e.push(l), e.length === n)
1109
+ for (const c of a) {
1110
+ const i = c.properties;
1111
+ if (i && i.cluster ? n + i.point_count <= r ? n += i.point_count : n = this._appendLeaves(e, i.cluster_id, s, r, n) : n < r ? n++ : e.push(c), e.length === s)
1028
1112
  break;
1029
1113
  }
1030
- return r;
1031
- }
1032
- _addTileFeatures(e, t, n, s, r, a) {
1033
- for (const l of e) {
1034
- const i = t[l], p = i.numPoints;
1035
- let u, c, h;
1036
- if (p)
1037
- u = Me(i), c = i.x, h = i.y;
1114
+ return n;
1115
+ }
1116
+ _createTree(e) {
1117
+ const t = new ae(e.length / this.stride | 0, this.options.nodeSize, Float32Array);
1118
+ for (let s = 0; s < e.length; s += this.stride)
1119
+ t.add(e[s], e[s + 1]);
1120
+ return t.finish(), t.data = e, t;
1121
+ }
1122
+ _addTileFeatures(e, t, s, r, n, a) {
1123
+ for (const c of e) {
1124
+ const i = c * this.stride, d = t[i + P] > 1;
1125
+ let u, l, h;
1126
+ if (d)
1127
+ u = Ie(t, i, this.clusterProps), l = t[i], h = t[i + 1];
1038
1128
  else {
1039
- const m = this.points[i.index];
1040
- u = m.properties, c = B(m.geometry.coordinates[0]), h = N(m.geometry.coordinates[1]);
1129
+ const m = this.points[t[i + x]];
1130
+ u = m.properties;
1131
+ const [g, y] = m.geometry.coordinates;
1132
+ l = H(g), h = W(y);
1041
1133
  }
1042
- const f = {
1134
+ const p = {
1043
1135
  type: 1,
1044
1136
  geometry: [[
1045
- Math.round(this.options.extent * (c * r - n)),
1046
- Math.round(this.options.extent * (h * r - s))
1137
+ Math.round(this.options.extent * (l * n - s)),
1138
+ Math.round(this.options.extent * (h * n - r))
1047
1139
  ]],
1048
1140
  tags: u
1049
1141
  };
1050
- let d;
1051
- p ? d = i.id : this.options.generateId ? d = i.index : this.points[i.index].id && (d = this.points[i.index].id), d !== void 0 && (f.id = d), a.features.push(f);
1142
+ let f;
1143
+ d || this.options.generateId ? f = t[i + x] : f = this.points[t[i + x]].id, f !== void 0 && (p.id = f), a.features.push(p);
1052
1144
  }
1053
1145
  }
1054
1146
  _limitZoom(e) {
1055
1147
  return Math.max(this.options.minZoom, Math.min(Math.floor(+e), this.options.maxZoom + 1));
1056
1148
  }
1057
1149
  _cluster(e, t) {
1058
- const n = [], { radius: s, extent: r, reduce: a, minPoints: l } = this.options, i = s / (r * Math.pow(2, t));
1059
- for (let p = 0; p < e.length; p++) {
1060
- const u = e[p];
1061
- if (u.zoom <= t)
1150
+ const { radius: s, extent: r, reduce: n, minPoints: a } = this.options, c = s / (r * Math.pow(2, t)), i = e.data, d = [], u = this.stride;
1151
+ for (let l = 0; l < i.length; l += u) {
1152
+ if (i[l + L] <= t)
1062
1153
  continue;
1063
- u.zoom = t;
1064
- const c = this.trees[t + 1], h = c.within(u.x, u.y, i), f = u.numPoints || 1;
1065
- let d = f;
1066
- for (const m of h) {
1067
- const g = c.points[m];
1068
- g.zoom > t && (d += g.numPoints || 1);
1154
+ i[l + L] = t;
1155
+ const h = i[l], p = i[l + 1], f = e.within(i[l], i[l + 1], c), m = i[l + P];
1156
+ let g = m;
1157
+ for (const y of f) {
1158
+ const w = y * u;
1159
+ i[w + L] > t && (g += i[w + P]);
1069
1160
  }
1070
- if (d > f && d >= l) {
1071
- let m = u.x * f, g = u.y * f, C = a && f > 1 ? this._map(u, !0) : null;
1072
- const w = (p << 5) + (t + 1) + this.points.length;
1073
- for (const j of h) {
1074
- const _ = c.points[j];
1075
- if (_.zoom <= t)
1161
+ if (g > m && g >= a) {
1162
+ let y = h * m, w = p * m, C, T = -1;
1163
+ const N = ((l / u | 0) << 5) + (t + 1) + this.points.length;
1164
+ for (const G of f) {
1165
+ const b = G * u;
1166
+ if (i[b + L] <= t)
1076
1167
  continue;
1077
- _.zoom = t;
1078
- const Z = _.numPoints || 1;
1079
- m += _.x * Z, g += _.y * Z, _.parentId = w, a && (C || (C = this._map(u, !0)), a(C, this._map(_)));
1080
- }
1081
- u.parentId = w, n.push(Ye(m / d, g / d, w, d, C));
1082
- } else if (n.push(u), d > 1)
1083
- for (const m of h) {
1084
- const g = c.points[m];
1085
- g.zoom <= t || (g.zoom = t, n.push(g));
1168
+ i[b + L] = t;
1169
+ const F = i[b + P];
1170
+ y += i[b] * F, w += i[b + 1] * F, i[b + oe] = N, n && (C || (C = this._map(i, l, !0), T = this.clusterProps.length, this.clusterProps.push(C)), n(C, this._map(i, b)));
1086
1171
  }
1172
+ i[l + oe] = N, d.push(y / g, w / g, 1 / 0, N, -1, g), n && d.push(T);
1173
+ } else {
1174
+ for (let y = 0; y < u; y++)
1175
+ d.push(i[l + y]);
1176
+ if (g > 1)
1177
+ for (const y of f) {
1178
+ const w = y * u;
1179
+ if (!(i[w + L] <= t)) {
1180
+ i[w + L] = t;
1181
+ for (let C = 0; C < u; C++)
1182
+ d.push(i[w + C]);
1183
+ }
1184
+ }
1185
+ }
1087
1186
  }
1088
- return n;
1187
+ return d;
1089
1188
  }
1090
1189
  // get index of the point from which the cluster originated
1091
1190
  _getOriginId(e) {
@@ -1095,87 +1194,49 @@ class Xe {
1095
1194
  _getOriginZoom(e) {
1096
1195
  return (e - this.points.length) % 32;
1097
1196
  }
1098
- _map(e, t) {
1099
- if (e.numPoints)
1100
- return t ? R({}, e.properties) : e.properties;
1101
- const n = this.points[e.index].properties, s = this.options.map(n);
1102
- return t && s === n ? R({}, s) : s;
1197
+ _map(e, t, s) {
1198
+ if (e[t + P] > 1) {
1199
+ const a = this.clusterProps[e[t + Ae]];
1200
+ return s ? Object.assign({}, a) : a;
1201
+ }
1202
+ const r = this.points[e[t + x]].properties, n = this.options.map(r);
1203
+ return s && n === r ? Object.assign({}, n) : n;
1103
1204
  }
1104
1205
  }
1105
- function Ye(o, e, t, n, s) {
1106
- return {
1107
- x: D(o),
1108
- // weighted cluster center; round for consistency with Float32Array index
1109
- y: D(e),
1110
- zoom: 1 / 0,
1111
- // the last zoom the cluster was processed at
1112
- id: t,
1113
- // encodes index of the first child of the cluster and its zoom level
1114
- parentId: -1,
1115
- // parent cluster id
1116
- numPoints: n,
1117
- properties: s
1118
- };
1119
- }
1120
- function Qe(o, e) {
1121
- const [t, n] = o.geometry.coordinates;
1122
- return {
1123
- x: D(B(t)),
1124
- // projected point coordinates
1125
- y: D(N(n)),
1126
- zoom: 1 / 0,
1127
- // the last zoom the point was processed at
1128
- index: e,
1129
- // index of the source feature in the original input array,
1130
- parentId: -1
1131
- // parent cluster id
1132
- };
1133
- }
1134
- function de(o) {
1206
+ function ke(o, e, t) {
1135
1207
  return {
1136
1208
  type: "Feature",
1137
- id: o.id,
1138
- properties: Me(o),
1209
+ id: o[e + x],
1210
+ properties: Ie(o, e, t),
1139
1211
  geometry: {
1140
1212
  type: "Point",
1141
- coordinates: [et(o.x), tt(o.y)]
1213
+ coordinates: [ot(o[e]), nt(o[e + 1])]
1142
1214
  }
1143
1215
  };
1144
1216
  }
1145
- function Me(o) {
1146
- const e = o.numPoints, t = e >= 1e4 ? `${Math.round(e / 1e3)}k` : e >= 1e3 ? `${Math.round(e / 100) / 10}k` : e;
1147
- return R(R({}, o.properties), {
1217
+ function Ie(o, e, t) {
1218
+ const s = o[e + P], r = s >= 1e4 ? `${Math.round(s / 1e3)}k` : s >= 1e3 ? `${Math.round(s / 100) / 10}k` : s, n = o[e + Ae], a = n === -1 ? {} : Object.assign({}, t[n]);
1219
+ return Object.assign(a, {
1148
1220
  cluster: !0,
1149
- cluster_id: o.id,
1150
- point_count: e,
1151
- point_count_abbreviated: t
1221
+ cluster_id: o[e + x],
1222
+ point_count: s,
1223
+ point_count_abbreviated: r
1152
1224
  });
1153
1225
  }
1154
- function B(o) {
1226
+ function H(o) {
1155
1227
  return o / 360 + 0.5;
1156
1228
  }
1157
- function N(o) {
1229
+ function W(o) {
1158
1230
  const e = Math.sin(o * Math.PI / 180), t = 0.5 - 0.25 * Math.log((1 + e) / (1 - e)) / Math.PI;
1159
1231
  return t < 0 ? 0 : t > 1 ? 1 : t;
1160
1232
  }
1161
- function et(o) {
1233
+ function ot(o) {
1162
1234
  return (o - 0.5) * 360;
1163
1235
  }
1164
- function tt(o) {
1236
+ function nt(o) {
1165
1237
  const e = (180 - o * 360) * Math.PI / 180;
1166
1238
  return 360 * Math.atan(Math.exp(e)) / Math.PI - 90;
1167
1239
  }
1168
- function R(o, e) {
1169
- for (const t in e)
1170
- o[t] = e[t];
1171
- return o;
1172
- }
1173
- function he(o) {
1174
- return o.x;
1175
- }
1176
- function fe(o) {
1177
- return o.y;
1178
- }
1179
1240
  /*! *****************************************************************************
1180
1241
  Copyright (c) Microsoft Corporation.
1181
1242
 
@@ -1190,22 +1251,52 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
1190
1251
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
1191
1252
  PERFORMANCE OF THIS SOFTWARE.
1192
1253
  ***************************************************************************** */
1193
- function st(o, e) {
1254
+ function le(o, e) {
1194
1255
  var t = {};
1195
- for (var n in o)
1196
- Object.prototype.hasOwnProperty.call(o, n) && e.indexOf(n) < 0 && (t[n] = o[n]);
1256
+ for (var s in o)
1257
+ Object.prototype.hasOwnProperty.call(o, s) && e.indexOf(s) < 0 && (t[s] = o[s]);
1197
1258
  if (o != null && typeof Object.getOwnPropertySymbols == "function")
1198
- for (var s = 0, n = Object.getOwnPropertySymbols(o); s < n.length; s++)
1199
- e.indexOf(n[s]) < 0 && Object.prototype.propertyIsEnumerable.call(o, n[s]) && (t[n[s]] = o[n[s]]);
1259
+ for (var r = 0, s = Object.getOwnPropertySymbols(o); r < s.length; r++)
1260
+ e.indexOf(s[r]) < 0 && Object.prototype.propertyIsEnumerable.call(o, s[r]) && (t[s[r]] = o[s[r]]);
1200
1261
  return t;
1201
1262
  }
1202
- class X {
1263
+ class k {
1264
+ static isAdvancedMarkerAvailable(e) {
1265
+ return google.maps.marker && e.getMapCapabilities().isAdvancedMarkersAvailable === !0;
1266
+ }
1267
+ static isAdvancedMarker(e) {
1268
+ return google.maps.marker && e instanceof google.maps.marker.AdvancedMarkerElement;
1269
+ }
1270
+ static setMap(e, t) {
1271
+ this.isAdvancedMarker(e) ? e.map = t : e.setMap(t);
1272
+ }
1273
+ static getPosition(e) {
1274
+ if (this.isAdvancedMarker(e)) {
1275
+ if (e.position) {
1276
+ if (e.position instanceof google.maps.LatLng)
1277
+ return e.position;
1278
+ if (e.position.lat && e.position.lng)
1279
+ return new google.maps.LatLng(e.position.lat, e.position.lng);
1280
+ }
1281
+ return new google.maps.LatLng(null);
1282
+ }
1283
+ return e.getPosition();
1284
+ }
1285
+ static getVisible(e) {
1286
+ return this.isAdvancedMarker(e) ? !0 : e.getVisible();
1287
+ }
1288
+ }
1289
+ class V {
1203
1290
  constructor({ markers: e, position: t }) {
1204
1291
  this.markers = e, t && (t instanceof google.maps.LatLng ? this._position = t : this._position = new google.maps.LatLng(t));
1205
1292
  }
1206
1293
  get bounds() {
1207
- if (!(this.markers.length === 0 && !this._position))
1208
- return this.markers.reduce((e, t) => e.extend(t.getPosition()), new google.maps.LatLngBounds(this._position, this._position));
1294
+ if (this.markers.length === 0 && !this._position)
1295
+ return;
1296
+ const e = new google.maps.LatLngBounds(this._position, this._position);
1297
+ for (const t of this.markers)
1298
+ e.extend(k.getPosition(t));
1299
+ return e;
1209
1300
  }
1210
1301
  get position() {
1211
1302
  return this._position || this.bounds.getCenter();
@@ -1214,7 +1305,7 @@ class X {
1214
1305
  * Get the count of **visible** markers.
1215
1306
  */
1216
1307
  get count() {
1217
- return this.markers.filter((e) => e.getVisible()).length;
1308
+ return this.markers.filter((e) => k.getVisible(e)).length;
1218
1309
  }
1219
1310
  /**
1220
1311
  * Add a marker to the cluster.
@@ -1226,10 +1317,26 @@ class X {
1226
1317
  * Cleanup references and remove marker from map.
1227
1318
  */
1228
1319
  delete() {
1229
- this.marker && (this.marker.setMap(null), delete this.marker), this.markers.length = 0;
1320
+ this.marker && (k.setMap(this.marker, null), this.marker = void 0), this.markers.length = 0;
1230
1321
  }
1231
1322
  }
1232
- class nt {
1323
+ const it = (o, e, t, s) => {
1324
+ const r = $e(o.getBounds(), e, s);
1325
+ return t.filter((n) => r.contains(k.getPosition(n)));
1326
+ }, $e = (o, e, t) => {
1327
+ const { northEast: s, southWest: r } = at(o, e), n = lt({ northEast: s, southWest: r }, t);
1328
+ return ct(n, e);
1329
+ }, _e = (o, e, t) => {
1330
+ const s = $e(o, e, t), r = s.getNorthEast(), n = s.getSouthWest();
1331
+ return [n.lng(), n.lat(), r.lng(), r.lat()];
1332
+ }, at = (o, e) => ({
1333
+ northEast: e.fromLatLngToDivPixel(o.getNorthEast()),
1334
+ southWest: e.fromLatLngToDivPixel(o.getSouthWest())
1335
+ }), lt = ({ northEast: o, southWest: e }, t) => (o.x += t, o.y -= t, e.x -= t, e.y += t, { northEast: o, southWest: e }), ct = ({ northEast: o, southWest: e }, t) => {
1336
+ const s = t.fromDivPixelToLatLng(e), r = t.fromDivPixelToLatLng(o);
1337
+ return new google.maps.LatLngBounds(s, r);
1338
+ };
1339
+ class je {
1233
1340
  constructor({ maxZoom: e = 16 }) {
1234
1341
  this.maxZoom = e;
1235
1342
  }
@@ -1240,78 +1347,144 @@ class nt {
1240
1347
  * ```typescript
1241
1348
  * cluster({markers, map}: AlgorithmInput): Cluster[] {
1242
1349
  * if (shouldBypassClustering(map)) {
1243
- * return this.noop({markers, map})
1350
+ * return this.noop({markers})
1244
1351
  * }
1245
1352
  * }
1246
1353
  * ```
1247
1354
  */
1248
1355
  noop({ markers: e }) {
1249
- return ot(e);
1356
+ return dt(e);
1357
+ }
1358
+ }
1359
+ class ut extends je {
1360
+ constructor(e) {
1361
+ var { viewportPadding: t = 60 } = e, s = le(e, ["viewportPadding"]);
1362
+ super(s), this.viewportPadding = 60, this.viewportPadding = t;
1363
+ }
1364
+ calculate({ markers: e, map: t, mapCanvasProjection: s }) {
1365
+ return t.getZoom() >= this.maxZoom ? {
1366
+ clusters: this.noop({
1367
+ markers: e
1368
+ }),
1369
+ changed: !1
1370
+ } : {
1371
+ clusters: this.cluster({
1372
+ markers: it(t, s, e, this.viewportPadding),
1373
+ map: t,
1374
+ mapCanvasProjection: s
1375
+ })
1376
+ };
1250
1377
  }
1251
1378
  }
1252
- const ot = (o) => o.map((t) => new X({
1253
- position: t.getPosition(),
1379
+ const dt = (o) => o.map((t) => new V({
1380
+ position: k.getPosition(t),
1254
1381
  markers: [t]
1255
1382
  }));
1256
- class rt extends nt {
1383
+ class ht extends je {
1257
1384
  constructor(e) {
1258
- var { maxZoom: t, radius: n = 60 } = e, s = st(e, ["maxZoom", "radius"]);
1259
- super({ maxZoom: t }), this.superCluster = new Xe(Object.assign({ maxZoom: this.maxZoom, radius: n }, s)), this.state = { zoom: null };
1385
+ var { maxZoom: t, radius: s = 60 } = e, r = le(e, ["maxZoom", "radius"]);
1386
+ super({ maxZoom: t }), this.state = { zoom: -1 }, this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, r));
1260
1387
  }
1261
1388
  calculate(e) {
1262
1389
  let t = !1;
1390
+ const s = { zoom: e.map.getZoom() };
1263
1391
  if (!A(e.markers, this.markers)) {
1264
1392
  t = !0, this.markers = [...e.markers];
1265
- const s = this.markers.map((r) => ({
1266
- type: "Feature",
1267
- geometry: {
1268
- type: "Point",
1269
- coordinates: [
1270
- r.getPosition().lng(),
1271
- r.getPosition().lat()
1272
- ]
1273
- },
1274
- properties: { marker: r }
1275
- }));
1276
- this.superCluster.load(s);
1393
+ const r = this.markers.map((n) => {
1394
+ const a = k.getPosition(n);
1395
+ return {
1396
+ type: "Feature",
1397
+ geometry: {
1398
+ type: "Point",
1399
+ coordinates: [a.lng(), a.lat()]
1400
+ },
1401
+ properties: { marker: n }
1402
+ };
1403
+ });
1404
+ this.superCluster.load(r);
1277
1405
  }
1278
- const n = { zoom: e.map.getZoom() };
1279
- return t || this.state.zoom > this.maxZoom && n.zoom > this.maxZoom || (t = t || !A(this.state, n)), this.state = n, t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t };
1406
+ return t || (this.state.zoom <= this.maxZoom || s.zoom <= this.maxZoom) && (t = !A(this.state, s)), this.state = s, t && (this.clusters = this.cluster(e)), { clusters: this.clusters, changed: t };
1280
1407
  }
1281
1408
  cluster({ map: e }) {
1282
- return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(e.getZoom())).map(this.transformCluster.bind(this));
1409
+ return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(e.getZoom())).map((t) => this.transformCluster(t));
1283
1410
  }
1284
- transformCluster({ geometry: { coordinates: [e, t] }, properties: n }) {
1285
- if (n.cluster)
1286
- return new X({
1287
- markers: this.superCluster.getLeaves(n.cluster_id, 1 / 0).map((s) => s.properties.marker),
1288
- position: new google.maps.LatLng({ lat: t, lng: e })
1411
+ transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1412
+ if (s.cluster)
1413
+ return new V({
1414
+ markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((n) => n.properties.marker),
1415
+ position: { lat: t, lng: e }
1289
1416
  });
1290
- {
1291
- const s = n.marker;
1292
- return new X({
1293
- markers: [s],
1294
- position: s.getPosition()
1417
+ const r = s.marker;
1418
+ return new V({
1419
+ markers: [r],
1420
+ position: k.getPosition(r)
1421
+ });
1422
+ }
1423
+ }
1424
+ class pt extends ut {
1425
+ constructor(e) {
1426
+ var { maxZoom: t, radius: s = 60, viewportPadding: r = 60 } = e, n = le(e, ["maxZoom", "radius", "viewportPadding"]);
1427
+ super({ maxZoom: t, viewportPadding: r }), this.superCluster = new Te(Object.assign({ maxZoom: this.maxZoom, radius: s }, n)), this.state = { zoom: -1, view: [0, 0, 0, 0] };
1428
+ }
1429
+ calculate(e) {
1430
+ const t = {
1431
+ zoom: Math.round(e.map.getZoom()),
1432
+ view: _e(e.map.getBounds(), e.mapCanvasProjection, this.viewportPadding)
1433
+ };
1434
+ let s = !A(this.state, t);
1435
+ if (!A(e.markers, this.markers)) {
1436
+ s = !0, this.markers = [...e.markers];
1437
+ const r = this.markers.map((n) => {
1438
+ const a = k.getPosition(n);
1439
+ return {
1440
+ type: "Feature",
1441
+ geometry: {
1442
+ type: "Point",
1443
+ coordinates: [a.lng(), a.lat()]
1444
+ },
1445
+ properties: { marker: n }
1446
+ };
1295
1447
  });
1448
+ this.superCluster.load(r);
1296
1449
  }
1450
+ return s && (this.clusters = this.cluster(e), this.state = t), { clusters: this.clusters, changed: s };
1451
+ }
1452
+ cluster({ map: e, mapCanvasProjection: t }) {
1453
+ const s = {
1454
+ zoom: Math.round(e.getZoom()),
1455
+ view: _e(e.getBounds(), t, this.viewportPadding)
1456
+ };
1457
+ return this.superCluster.getClusters(s.view, s.zoom).map((r) => this.transformCluster(r));
1458
+ }
1459
+ transformCluster({ geometry: { coordinates: [e, t] }, properties: s }) {
1460
+ if (s.cluster)
1461
+ return new V({
1462
+ markers: this.superCluster.getLeaves(s.cluster_id, 1 / 0).map((n) => n.properties.marker),
1463
+ position: { lat: t, lng: e }
1464
+ });
1465
+ const r = s.marker;
1466
+ return new V({
1467
+ markers: [r],
1468
+ position: k.getPosition(r)
1469
+ });
1297
1470
  }
1298
1471
  }
1299
- class it {
1472
+ class ft {
1300
1473
  constructor(e, t) {
1301
1474
  this.markers = { sum: e.length };
1302
- const n = t.map((r) => r.count), s = n.reduce((r, a) => r + a, 0);
1475
+ const s = t.map((n) => n.count), r = s.reduce((n, a) => n + a, 0);
1303
1476
  this.clusters = {
1304
1477
  count: t.length,
1305
1478
  markers: {
1306
- mean: s / t.length,
1307
- sum: s,
1308
- min: Math.min(...n),
1309
- max: Math.max(...n)
1479
+ mean: r / t.length,
1480
+ sum: r,
1481
+ min: Math.min(...s),
1482
+ max: Math.max(...s)
1310
1483
  }
1311
1484
  };
1312
1485
  }
1313
1486
  }
1314
- class at {
1487
+ class mt {
1315
1488
  /**
1316
1489
  * The default render function for the library used by {@link MarkerClusterer}.
1317
1490
  *
@@ -1350,67 +1523,76 @@ class at {
1350
1523
  * });
1351
1524
  * ```
1352
1525
  */
1353
- render({ count: e, position: t }, n) {
1354
- const s = e > Math.max(10, n.clusters.markers.mean) ? "#ff0000" : "#0000ff", r = window.btoa(`
1355
- <svg fill="${s}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
1356
- <circle cx="120" cy="120" opacity=".6" r="70" />
1357
- <circle cx="120" cy="120" opacity=".3" r="90" />
1358
- <circle cx="120" cy="120" opacity=".2" r="110" />
1359
- </svg>`);
1360
- return new google.maps.Marker({
1526
+ render({ count: e, position: t }, s, r) {
1527
+ const a = `<svg fill="${e > Math.max(10, s.clusters.markers.mean) ? "#ff0000" : "#0000ff"}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240" width="50" height="50">
1528
+ <circle cx="120" cy="120" opacity=".6" r="70" />
1529
+ <circle cx="120" cy="120" opacity=".3" r="90" />
1530
+ <circle cx="120" cy="120" opacity=".2" r="110" />
1531
+ <text x="50%" y="50%" style="fill:#fff" text-anchor="middle" font-size="50" dominant-baseline="middle" font-family="roboto,arial,sans-serif">${e}</text>
1532
+ </svg>`, c = `Cluster of ${e} markers`, i = Number(google.maps.Marker.MAX_ZINDEX) + e;
1533
+ if (k.isAdvancedMarkerAvailable(r)) {
1534
+ const u = document.createElement("div");
1535
+ u.innerHTML = a;
1536
+ const l = u.firstElementChild;
1537
+ l.setAttribute("transform", "translate(0 25)");
1538
+ const h = {
1539
+ map: r,
1540
+ position: t,
1541
+ zIndex: i,
1542
+ title: c,
1543
+ content: l
1544
+ };
1545
+ return new google.maps.marker.AdvancedMarkerElement(h);
1546
+ }
1547
+ const d = {
1361
1548
  position: t,
1549
+ zIndex: i,
1550
+ title: c,
1362
1551
  icon: {
1363
- url: `data:image/svg+xml;base64,${r}`,
1364
- scaledSize: new google.maps.Size(45, 45)
1365
- },
1366
- label: {
1367
- text: String(e),
1368
- color: "rgba(255,255,255,0.9)",
1369
- fontSize: "12px"
1370
- },
1371
- title: `Cluster of ${e} markers`,
1372
- // adjust zIndex to be above other markers
1373
- zIndex: Number(google.maps.Marker.MAX_ZINDEX) + e
1374
- });
1552
+ url: `data:image/svg+xml;base64,${btoa(a)}`,
1553
+ anchor: new google.maps.Point(25, 25)
1554
+ }
1555
+ };
1556
+ return new google.maps.Marker(d);
1375
1557
  }
1376
1558
  }
1377
- function lt(o, e) {
1559
+ function gt(o, e) {
1378
1560
  for (let t in e.prototype)
1379
1561
  o.prototype[t] = e.prototype[t];
1380
1562
  }
1381
- class Q {
1563
+ class ce {
1382
1564
  constructor() {
1383
- lt(Q, google.maps.OverlayView);
1565
+ gt(ce, google.maps.OverlayView);
1384
1566
  }
1385
1567
  }
1386
- var x;
1568
+ var I;
1387
1569
  (function(o) {
1388
1570
  o.CLUSTERING_BEGIN = "clusteringbegin", o.CLUSTERING_END = "clusteringend", o.CLUSTER_CLICK = "click";
1389
- })(x || (x = {}));
1390
- const ct = (o, e, t) => {
1571
+ })(I || (I = {}));
1572
+ const vt = (o, e, t) => {
1391
1573
  t.fitBounds(e.bounds);
1392
1574
  };
1393
- class ut extends Q {
1394
- constructor({ map: e, markers: t = [], algorithm: n = new rt({}), renderer: s = new at(), onClusterClick: r = ct }) {
1395
- super(), this.markers = [...t], this.clusters = [], this.algorithm = n, this.renderer = s, this.onClusterClick = r, e && this.setMap(e);
1575
+ class yt extends ce {
1576
+ constructor({ map: e, markers: t = [], algorithmOptions: s = {}, algorithm: r = new ht(s), renderer: n = new mt(), onClusterClick: a = vt }) {
1577
+ super(), this.markers = [...t], this.clusters = [], this.algorithm = r, this.renderer = n, this.onClusterClick = a, e && this.setMap(e);
1396
1578
  }
1397
1579
  addMarker(e, t) {
1398
1580
  this.markers.includes(e) || (this.markers.push(e), t || this.render());
1399
1581
  }
1400
1582
  addMarkers(e, t) {
1401
- e.forEach((n) => {
1402
- this.addMarker(n, !0);
1583
+ e.forEach((s) => {
1584
+ this.addMarker(s, !0);
1403
1585
  }), t || this.render();
1404
1586
  }
1405
1587
  removeMarker(e, t) {
1406
- const n = this.markers.indexOf(e);
1407
- return n === -1 ? !1 : (e.setMap(null), this.markers.splice(n, 1), t || this.render(), !0);
1588
+ const s = this.markers.indexOf(e);
1589
+ return s === -1 ? !1 : (k.setMap(e, null), this.markers.splice(s, 1), t || this.render(), !0);
1408
1590
  }
1409
1591
  removeMarkers(e, t) {
1410
- let n = !1;
1411
- return e.forEach((s) => {
1412
- n = this.removeMarker(s, !0) || n;
1413
- }), n && !t && this.render(), n;
1592
+ let s = !1;
1593
+ return e.forEach((r) => {
1594
+ s = this.removeMarker(r, !0) || s;
1595
+ }), s && !t && this.render(), s;
1414
1596
  }
1415
1597
  clearMarkers(e) {
1416
1598
  this.markers.length = 0, e || this.render();
@@ -1420,14 +1602,23 @@ class ut extends Q {
1420
1602
  */
1421
1603
  render() {
1422
1604
  const e = this.getMap();
1423
- if (e instanceof google.maps.Map && this.getProjection()) {
1424
- google.maps.event.trigger(this, x.CLUSTERING_BEGIN, this);
1425
- const { clusters: t, changed: n } = this.algorithm.calculate({
1605
+ if (e instanceof google.maps.Map && e.getProjection()) {
1606
+ google.maps.event.trigger(this, I.CLUSTERING_BEGIN, this);
1607
+ const { clusters: t, changed: s } = this.algorithm.calculate({
1426
1608
  markers: this.markers,
1427
1609
  map: e,
1428
1610
  mapCanvasProjection: this.getProjection()
1429
1611
  });
1430
- (n || n == null) && (this.reset(), this.clusters = t, this.renderClusters()), google.maps.event.trigger(this, x.CLUSTERING_END, this);
1612
+ if (s || s == null) {
1613
+ const r = /* @__PURE__ */ new Set();
1614
+ for (const a of t)
1615
+ a.markers.length == 1 && r.add(a.markers[0]);
1616
+ const n = [];
1617
+ for (const a of this.clusters)
1618
+ a.marker != null && (a.markers.length == 1 ? r.has(a.marker) || k.setMap(a.marker, null) : n.push(a.marker));
1619
+ this.clusters = t, this.renderClusters(), requestAnimationFrame(() => n.forEach((a) => k.setMap(a, null)));
1620
+ }
1621
+ google.maps.event.trigger(this, I.CLUSTERING_END, this);
1431
1622
  }
1432
1623
  }
1433
1624
  onAdd() {
@@ -1437,22 +1628,22 @@ class ut extends Q {
1437
1628
  google.maps.event.removeListener(this.idleListener), this.reset();
1438
1629
  }
1439
1630
  reset() {
1440
- this.markers.forEach((e) => e.setMap(null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
1631
+ this.markers.forEach((e) => k.setMap(e, null)), this.clusters.forEach((e) => e.delete()), this.clusters = [];
1441
1632
  }
1442
1633
  renderClusters() {
1443
- const e = new it(this.markers, this.clusters), t = this.getMap();
1444
- this.clusters.forEach((n) => {
1445
- n.markers.length === 1 ? n.marker = n.markers[0] : (n.marker = this.renderer.render(n, e), this.onClusterClick && n.marker.addListener(
1634
+ const e = new ft(this.markers, this.clusters), t = this.getMap();
1635
+ this.clusters.forEach((s) => {
1636
+ s.markers.length === 1 ? s.marker = s.markers[0] : (s.marker = this.renderer.render(s, e, t), s.markers.forEach((r) => k.setMap(r, null)), this.onClusterClick && s.marker.addListener(
1446
1637
  "click",
1447
1638
  /* istanbul ignore next */
1448
- (s) => {
1449
- google.maps.event.trigger(this, x.CLUSTER_CLICK, n), this.onClusterClick(s, n, t);
1639
+ (r) => {
1640
+ google.maps.event.trigger(this, I.CLUSTER_CLICK, s), this.onClusterClick(r, s, t);
1450
1641
  }
1451
- )), n.marker.setMap(t);
1642
+ )), k.setMap(s.marker, t);
1452
1643
  });
1453
1644
  }
1454
1645
  }
1455
- const me = Object.values(x), Ot = k({
1646
+ const Ce = Object.values(I), It = M({
1456
1647
  name: "MarkerCluster",
1457
1648
  props: {
1458
1649
  options: {
@@ -1460,29 +1651,37 @@ const me = Object.values(x), Ot = k({
1460
1651
  default: () => ({})
1461
1652
  }
1462
1653
  },
1463
- emits: me,
1464
- setup(o, { emit: e, expose: t, slots: n }) {
1465
- const s = v(), r = y(I, v()), a = y(E, v());
1466
- return q(ke, s), b(
1467
- r,
1654
+ emits: Ce,
1655
+ setup(o, { emit: e, expose: t, slots: s }) {
1656
+ const r = v(), n = _(q, v()), a = _(R, v());
1657
+ return z(Ee, r), O(
1658
+ n,
1468
1659
  () => {
1469
- r.value && (s.value = M(new ut({ map: r.value, ...o.options })), me.forEach((l) => {
1660
+ n.value && (r.value = E(
1661
+ new yt({
1662
+ map: n.value,
1663
+ // Better perf than the default `SuperClusterAlgorithm`. See:
1664
+ // https://github.com/googlemaps/js-markerclusterer/pull/640
1665
+ algorithm: new pt(o.options.algorithmOptions ?? {}),
1666
+ ...o.options
1667
+ })
1668
+ ), Ce.forEach((c) => {
1470
1669
  var i;
1471
- (i = s.value) == null || i.addListener(l, (p) => e(l, p));
1670
+ (i = r.value) == null || i.addListener(c, (d) => e(c, d));
1472
1671
  }));
1473
1672
  },
1474
1673
  {
1475
1674
  immediate: !0
1476
1675
  }
1477
- ), S(() => {
1478
- var l;
1479
- s.value && ((l = a.value) == null || l.event.clearInstanceListeners(s.value), s.value.clearMarkers(), s.value.setMap(null));
1480
- }), t({ markerCluster: s }), () => {
1481
- var l;
1482
- return (l = n.default) == null ? void 0 : l.call(n);
1676
+ ), j(() => {
1677
+ var c;
1678
+ r.value && ((c = a.value) == null || c.event.clearInstanceListeners(r.value), r.value.clearMarkers(), r.value.setMap(null));
1679
+ }), t({ markerCluster: r }), () => {
1680
+ var c;
1681
+ return (c = s.default) == null ? void 0 : c.call(s);
1483
1682
  };
1484
1683
  }
1485
- }), pt = k({
1684
+ }), wt = M({
1486
1685
  inheritAttrs: !1,
1487
1686
  props: {
1488
1687
  options: {
@@ -1490,34 +1689,34 @@ const me = Object.values(x), Ot = k({
1490
1689
  required: !0
1491
1690
  }
1492
1691
  },
1493
- setup(o, { slots: e, emit: t, expose: n }) {
1494
- const s = v(), r = z(() => {
1692
+ setup(o, { slots: e, emit: t, expose: s }) {
1693
+ const r = v(), n = K(() => {
1495
1694
  var i;
1496
- return (i = e.default) == null ? void 0 : i.call(e).some((p) => p.type !== ve);
1497
- }), a = z(() => ({
1695
+ return (i = e.default) == null ? void 0 : i.call(e).some((d) => d.type !== be);
1696
+ }), a = K(() => ({
1498
1697
  ...o.options,
1499
- element: s.value
1500
- })), l = $(H, [], a, t);
1501
- return n({
1502
- customMarker: l
1503
- }), { customMarkerRef: s, customMarker: l, hasSlotContent: r };
1698
+ element: r.value
1699
+ })), c = Z(Q, [], a, t);
1700
+ return s({
1701
+ customMarker: c
1702
+ }), { customMarkerRef: r, customMarker: c, hasSlotContent: n };
1504
1703
  }
1505
1704
  });
1506
- const dt = {
1705
+ const kt = {
1507
1706
  key: 0,
1508
1707
  class: "custom-marker-wrapper"
1509
1708
  };
1510
- function ht(o, e, t, n, s, r) {
1511
- return o.hasSlotContent ? (F(), G("div", dt, [
1512
- Y("div", ye({
1709
+ function _t(o, e, t, s, r, n) {
1710
+ return o.hasSlotContent ? (J(), Y("div", kt, [
1711
+ ie("div", Oe({
1513
1712
  ref: "customMarkerRef",
1514
1713
  style: { cursor: o.$attrs.onClick ? "pointer" : void 0 }
1515
1714
  }, o.$attrs), [
1516
- U(o.$slots, "default", {}, void 0, !0)
1715
+ X(o.$slots, "default", {}, void 0, !0)
1517
1716
  ], 16)
1518
- ])) : Ce("", !0);
1717
+ ])) : Pe("", !0);
1519
1718
  }
1520
- const xt = /* @__PURE__ */ K(pt, [["render", ht], ["__scopeId", "data-v-c7599d50"]]), Pt = k({
1719
+ const $t = /* @__PURE__ */ ee(wt, [["render", _t], ["__scopeId", "data-v-c7599d50"]]), jt = M({
1521
1720
  name: "HeatmapLayer",
1522
1721
  props: {
1523
1722
  options: {
@@ -1526,20 +1725,20 @@ const xt = /* @__PURE__ */ K(pt, [["render", ht], ["__scopeId", "data-v-c7599d50
1526
1725
  }
1527
1726
  },
1528
1727
  setup(o) {
1529
- const e = v(), t = y(I, v()), n = y(E, v());
1530
- return b(
1728
+ const e = v(), t = _(q, v()), s = _(R, v());
1729
+ return O(
1531
1730
  [t, () => o.options],
1532
- ([s, r], [a, l]) => {
1533
- var p;
1534
- const i = !A(r, l) || t.value !== a;
1535
- if (t.value && n.value && i) {
1536
- const u = structuredClone(r);
1537
- if (u.data && !(u.data instanceof n.value.MVCArray)) {
1538
- const c = n.value.LatLng;
1539
- u.data = (p = u.data) == null ? void 0 : p.map((h) => h instanceof c || "location" in h && (h.location instanceof c || h.location === null) ? h : "location" in h ? { ...h, location: new c(h.location) } : new c(h));
1731
+ ([r, n], [a, c]) => {
1732
+ var d;
1733
+ const i = !A(n, c) || t.value !== a;
1734
+ if (t.value && s.value && i) {
1735
+ const u = structuredClone(n);
1736
+ if (u.data && !(u.data instanceof s.value.MVCArray)) {
1737
+ const l = s.value.LatLng;
1738
+ u.data = (d = u.data) == null ? void 0 : d.map((h) => h instanceof l || "location" in h && (h.location instanceof l || h.location === null) ? h : "location" in h ? { ...h, location: new l(h.location) } : new l(h));
1540
1739
  }
1541
- e.value ? e.value.setOptions(u) : e.value = M(
1542
- new n.value.visualization.HeatmapLayer({
1740
+ e.value ? e.value.setOptions(u) : e.value = E(
1741
+ new s.value.visualization.HeatmapLayer({
1543
1742
  ...u,
1544
1743
  map: t.value
1545
1744
  })
@@ -1547,22 +1746,22 @@ const xt = /* @__PURE__ */ K(pt, [["render", ht], ["__scopeId", "data-v-c7599d50
1547
1746
  }
1548
1747
  },
1549
1748
  { immediate: !0 }
1550
- ), S(() => {
1749
+ ), j(() => {
1551
1750
  e.value && e.value.setMap(null);
1552
1751
  }), { heatmapLayer: e };
1553
1752
  },
1554
1753
  render: () => null
1555
1754
  });
1556
1755
  export {
1557
- wt as Circle,
1558
- bt as CustomControl,
1559
- xt as CustomMarker,
1560
- vt as GoogleMap,
1561
- Pt as HeatmapLayer,
1562
- Mt as InfoWindow,
1563
- yt as Marker,
1564
- Ot as MarkerCluster,
1565
- _t as Polygon,
1566
- Ct as Polyline,
1567
- kt as Rectangle
1756
+ St as Circle,
1757
+ At as CustomControl,
1758
+ $t as CustomMarker,
1759
+ Ot as GoogleMap,
1760
+ jt as HeatmapLayer,
1761
+ Tt as InfoWindow,
1762
+ Pt as Marker,
1763
+ It as MarkerCluster,
1764
+ Et as Polygon,
1765
+ xt as Polyline,
1766
+ Lt as Rectangle
1568
1767
  };