@local-logic/maps 0.0.16 → 0.0.18

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 (32) hide show
  1. package/dist/{index-NEUlLLtm.js → index-Be6RGKzc.js} +3 -3
  2. package/dist/{index-BvnFFiii.js → index-C0nB-ZYI.js} +2 -2
  3. package/dist/{index-CnuTCmRK.js → index-C1QREXT1.js} +2 -2
  4. package/dist/index-C7cTTXxY.js +24 -0
  5. package/dist/{index-DJ1PVoCd.js → index-C9z8YU4t.js} +3 -3
  6. package/dist/{index-Cg3HD19r.js → index-CBfuS_n2.js} +2 -2
  7. package/dist/{index-BUkdAOYF.js → index-C_RtwL3E.js} +5 -5
  8. package/dist/{index-Brp2pz_Z.js → index-DMwjyhBt.js} +3 -3
  9. package/dist/{index-Dzgb7feN.js → index-DUdSU2pv.js} +2 -2
  10. package/dist/{index-_YvDHCeI.js → index-DjQpPQGI.js} +1 -1
  11. package/dist/{index-CTU66ogZ.js → index-DnE7POcz.js} +1 -1
  12. package/dist/{index-3kRdcdZh.js → index-Dvg9jDs5.js} +1 -1
  13. package/dist/{index-x3wrHsPD.js → index-Dz1XJJEv.js} +1 -1
  14. package/dist/{index-DyGtnON3.js → index-gTk5Txmy.js} +2 -2
  15. package/dist/{index-CV_IAyz3.js → index-pztBT1mz.js} +2 -2
  16. package/dist/{index-Yh7bUURu.js → index-r9nwo0R7.js} +1 -1
  17. package/dist/index-t8m-nFSa.js +23 -0
  18. package/dist/index.es.js +1 -1
  19. package/dist/{index.modern-CLRs8JwI.js → index.modern-fpUBOYPT.js} +288 -282
  20. package/dist/index.umd.js +624 -251
  21. package/dist/{logo-control-NE-LlsRy.js → logo-control-BALqfBGo.js} +212 -202
  22. package/dist/mapbox-gl-Coz2msiN.js +34257 -0
  23. package/dist/maplibre-gl-CAHhS7Ky.js +21377 -0
  24. package/dist/{scale-control-CyJd4u6j.js → scale-control-BOI2g14-.js} +183 -173
  25. package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts.map +1 -1
  26. package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts.map +1 -1
  27. package/dist/style.css +1 -1
  28. package/package.json +30 -30
  29. package/dist/index-BFK3wMTT.js +0 -24
  30. package/dist/index-BQRXN0e-.js +0 -23
  31. package/dist/mapbox-gl-D58OubwB.js +0 -32266
  32. package/dist/maplibre-gl-CfOZKUDd.js +0 -20722
@@ -1,9 +1,9 @@
1
- import C, { forwardRef as Y, useMemo as P, useContext as z, useEffect as y, useLayoutEffect as W, useImperativeHandle as Q, useState as A, useRef as N, useReducer as ee, useCallback as te, Children as le } from "react";
1
+ import b, { forwardRef as Y, useMemo as P, useContext as R, useEffect as v, useLayoutEffect as W, useImperativeHandle as Q, useState as A, useRef as z, useReducer as ee, useCallback as te, Children as ue } from "react";
2
2
  import { createPortal as $ } from "react-dom";
3
- import { g as ce } from "./_commonjsHelpers-C6fGbg64.js";
4
- var j, J;
5
- function ue() {
6
- return J || (J = 1, j = function t(e, n) {
3
+ import { g as de } from "./_commonjsHelpers-C6fGbg64.js";
4
+ var j, q;
5
+ function fe() {
6
+ return q || (q = 1, j = function t(e, n) {
7
7
  if (e === n) return !0;
8
8
  if (e && n && typeof e == "object" && typeof n == "object") {
9
9
  if (e.constructor !== n.constructor) return !1;
@@ -29,16 +29,16 @@ function ue() {
29
29
  return e !== e && n !== n;
30
30
  }), j;
31
31
  }
32
- var de = ue();
33
- const fe = /* @__PURE__ */ ce(de);
34
- function k() {
35
- return k = Object.assign ? Object.assign.bind() : function(t) {
32
+ var ge = fe();
33
+ const ne = /* @__PURE__ */ de(ge);
34
+ function _() {
35
+ return _ = Object.assign ? Object.assign.bind() : function(t) {
36
36
  for (var e = 1; e < arguments.length; e++) {
37
37
  var n = arguments[e];
38
38
  for (var o in n) ({}).hasOwnProperty.call(n, o) && (t[o] = n[o]);
39
39
  }
40
40
  return t;
41
- }, k.apply(null, arguments);
41
+ }, _.apply(null, arguments);
42
42
  }
43
43
  function D(t, e) {
44
44
  if (t == null) return {};
@@ -49,7 +49,7 @@ function D(t, e) {
49
49
  }
50
50
  return n;
51
51
  }
52
- function ge(t, e) {
52
+ function me(t, e) {
53
53
  if (typeof t != "object" || !t) return t;
54
54
  var n = t[Symbol.toPrimitive];
55
55
  if (n !== void 0) {
@@ -59,8 +59,8 @@ function ge(t, e) {
59
59
  }
60
60
  return String(t);
61
61
  }
62
- function me(t) {
63
- var e = ge(t, "string");
62
+ function pe(t) {
63
+ var e = me(t, "string");
64
64
  return typeof e == "symbol" ? e : e + "";
65
65
  }
66
66
  const x = {
@@ -69,8 +69,8 @@ const x = {
69
69
  LOADED: "LOADED",
70
70
  FAILED: "FAILED",
71
71
  AUTH_FAILURE: "AUTH_FAILURE"
72
- }, pe = "https://maps.googleapis.com/maps/api/js";
73
- class R {
72
+ }, he = "https://maps.googleapis.com/maps/api/js";
73
+ class B {
74
74
  /**
75
75
  * Loads the Maps JavaScript API with the specified parameters.
76
76
  * Since the Maps library can only be loaded once per page, this will
@@ -112,12 +112,12 @@ class R {
112
112
  let n = null;
113
113
  const o = () => n || (n = new Promise((r, i) => {
114
114
  var a;
115
- const s = document.createElement("script"), u = new URLSearchParams();
116
- for (const [d, c] of Object.entries(e)) {
117
- const p = d.replace(/[A-Z]/g, (f) => "_" + f[0].toLowerCase());
118
- u.set(p, String(c));
115
+ const s = document.createElement("script"), c = new URLSearchParams();
116
+ for (const [u, d] of Object.entries(e)) {
117
+ const p = u.replace(/[A-Z]/g, (f) => "_" + f[0].toLowerCase());
118
+ c.set(p, String(d));
119
119
  }
120
- u.set("loading", "async"), u.set("callback", "__googleMapsCallback__"), s.async = !0, s.src = pe + "?" + u.toString(), s.nonce = ((a = document.querySelector("script[nonce]")) == null ? void 0 : a.nonce) || "", s.onerror = () => {
120
+ c.set("loading", "async"), c.set("callback", "__googleMapsCallback__"), s.async = !0, s.src = he + "?" + c.toString(), s.nonce = ((a = document.querySelector("script[nonce]")) == null ? void 0 : a.nonce) || "", s.onerror = () => {
121
121
  this.loadingStatus = x.FAILED, this.notifyLoadingStatusListeners(), i(new Error("The Google Maps JavaScript API could not load."));
122
122
  }, window.__googleMapsCallback__ = () => {
123
123
  this.loadingStatus = x.LOADED, this.notifyLoadingStatusListeners(), r();
@@ -135,59 +135,59 @@ class R {
135
135
  e(this.loadingStatus);
136
136
  }
137
137
  }
138
- R.loadingStatus = x.NOT_LOADED;
139
- R.serializedApiParams = void 0;
140
- R.listeners = [];
141
- const he = ["onLoad", "onError", "apiKey", "version", "libraries"], ve = ["children"], Ce = "GMP_visgl_rgmlibrary_v1_default", B = C.createContext(null);
142
- function ye() {
138
+ B.loadingStatus = x.NOT_LOADED;
139
+ B.serializedApiParams = void 0;
140
+ B.listeners = [];
141
+ const ve = ["onLoad", "onError", "apiKey", "version", "libraries"], Ce = ["children"], ye = "GMP_visgl_rgmlibrary_v1_default", G = b.createContext(null);
142
+ function be() {
143
143
  const [t, e] = A({});
144
144
  return {
145
145
  mapInstances: t,
146
146
  addMapInstance: (i, a = "default") => {
147
- e((s) => k({}, s, {
147
+ e((s) => _({}, s, {
148
148
  [a]: i
149
149
  }));
150
150
  },
151
151
  removeMapInstance: (i = "default") => {
152
- e((a) => D(a, [i].map(me)));
152
+ e((a) => D(a, [i].map(pe)));
153
153
  },
154
154
  clearMapInstances: () => {
155
155
  e({});
156
156
  }
157
157
  };
158
158
  }
159
- function be(t) {
159
+ function Oe(t) {
160
160
  const {
161
161
  onLoad: e,
162
162
  onError: n,
163
163
  apiKey: o,
164
164
  version: r,
165
165
  libraries: i = []
166
- } = t, a = D(t, he), [s, u] = A(R.loadingStatus), [d, c] = ee((l, g) => l[g.name] ? l : k({}, l, {
166
+ } = t, a = D(t, ve), [s, c] = A(B.loadingStatus), [u, d] = ee((l, g) => l[g.name] ? l : _({}, l, {
167
167
  [g.name]: g.value
168
- }), {}), p = P(() => i == null ? void 0 : i.join(","), [i]), f = P(() => JSON.stringify(k({
168
+ }), {}), p = P(() => i == null ? void 0 : i.join(","), [i]), f = P(() => JSON.stringify(_({
169
169
  apiKey: o,
170
170
  version: r
171
171
  }, a)), [o, r, a]), m = te(async (l) => {
172
172
  var g;
173
- if (d[l])
174
- return d[l];
173
+ if (u[l])
174
+ return u[l];
175
175
  if (!((g = google) != null && (g = g.maps) != null && g.importLibrary))
176
176
  throw new Error("[api-provider-internal] importLibrary was called before google.maps.importLibrary was defined.");
177
- const L = await window.google.maps.importLibrary(l);
178
- return c({
177
+ const C = await window.google.maps.importLibrary(l);
178
+ return d({
179
179
  name: l,
180
- value: L
181
- }), L;
182
- }, [d]);
183
- return y(
180
+ value: C
181
+ }), C;
182
+ }, [u]);
183
+ return v(
184
184
  () => {
185
185
  (async () => {
186
186
  try {
187
- const l = k({
187
+ const l = _({
188
188
  key: o
189
189
  }, a);
190
- r && (l.v = r), (p == null ? void 0 : p.length) > 0 && (l.libraries = p), (l.channel === void 0 || l.channel < 0 || l.channel > 999) && delete l.channel, l.solutionChannel === void 0 ? l.solutionChannel = Ce : l.solutionChannel === "" && delete l.solutionChannel, await R.load(l, (g) => u(g));
190
+ r && (l.v = r), (p == null ? void 0 : p.length) > 0 && (l.libraries = p), (l.channel === void 0 || l.channel < 0 || l.channel > 999) && delete l.channel, l.solutionChannel === void 0 ? l.solutionChannel = ye : l.solutionChannel === "" && delete l.solutionChannel, await B.load(l, (g) => c(g));
191
191
  for (const g of ["core", "maps", ...i])
192
192
  await m(g);
193
193
  e && e();
@@ -200,48 +200,48 @@ function be(t) {
200
200
  [o, p, f]
201
201
  ), {
202
202
  status: s,
203
- loadedLibraries: d,
203
+ loadedLibraries: u,
204
204
  importLibrary: m
205
205
  };
206
206
  }
207
- const nt = (t) => {
207
+ const rt = (t) => {
208
208
  const {
209
209
  children: e
210
- } = t, n = D(t, ve), {
210
+ } = t, n = D(t, Ce), {
211
211
  mapInstances: o,
212
212
  addMapInstance: r,
213
213
  removeMapInstance: i,
214
214
  clearMapInstances: a
215
- } = ye(), {
215
+ } = be(), {
216
216
  status: s,
217
- loadedLibraries: u,
218
- importLibrary: d
219
- } = be(n), c = P(() => ({
217
+ loadedLibraries: c,
218
+ importLibrary: u
219
+ } = Oe(n), d = P(() => ({
220
220
  mapInstances: o,
221
221
  addMapInstance: r,
222
222
  removeMapInstance: i,
223
223
  clearMapInstances: a,
224
224
  status: s,
225
- loadedLibraries: u,
226
- importLibrary: d
227
- }), [o, r, i, a, s, u, d]);
228
- return /* @__PURE__ */ C.createElement(B.Provider, {
229
- value: c
225
+ loadedLibraries: c,
226
+ importLibrary: u
227
+ }), [o, r, i, a, s, c, u]);
228
+ return /* @__PURE__ */ b.createElement(G.Provider, {
229
+ value: d
230
230
  }, e);
231
231
  };
232
- function Oe(t, e) {
233
- for (const n of Me) {
234
- const o = e[n], r = ne[n];
235
- y(() => {
232
+ function we(t, e) {
233
+ for (const n of Ie) {
234
+ const o = e[n], r = oe[n];
235
+ v(() => {
236
236
  if (!t || !o) return;
237
237
  const i = google.maps.event.addListener(t, r, (a) => {
238
- o(we(r, t, a));
238
+ o(Ee(r, t, a));
239
239
  });
240
240
  return () => i.remove();
241
241
  }, [t, r, o]);
242
242
  }
243
243
  }
244
- function we(t, e, n) {
244
+ function Ee(t, e, n) {
245
245
  const o = {
246
246
  type: t,
247
247
  map: e,
@@ -250,24 +250,24 @@ function we(t, e, n) {
250
250
  stop: () => {
251
251
  }
252
252
  };
253
- if (Ee.includes(t)) {
254
- const i = o, a = e.getCenter(), s = e.getZoom(), u = e.getHeading() || 0, d = e.getTilt() || 0, c = e.getBounds();
255
- return (!a || !c || !Number.isFinite(s)) && console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"), i.detail = {
253
+ if (Le.includes(t)) {
254
+ const i = o, a = e.getCenter(), s = e.getZoom(), c = e.getHeading() || 0, u = e.getTilt() || 0, d = e.getBounds();
255
+ return (!a || !d || !Number.isFinite(s)) && console.warn("[createEvent] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"), i.detail = {
256
256
  center: (a == null ? void 0 : a.toJSON()) || {
257
257
  lat: 0,
258
258
  lng: 0
259
259
  },
260
260
  zoom: s || 0,
261
- heading: u,
262
- tilt: d,
263
- bounds: (c == null ? void 0 : c.toJSON()) || {
261
+ heading: c,
262
+ tilt: u,
263
+ bounds: (d == null ? void 0 : d.toJSON()) || {
264
264
  north: 90,
265
265
  east: 180,
266
266
  south: -90,
267
267
  west: -180
268
268
  }
269
269
  }, i;
270
- } else if (Le.includes(t)) {
270
+ } else if (Me.includes(t)) {
271
271
  var r;
272
272
  if (!n) throw new Error("[createEvent] mouse events must provide a srcEvent");
273
273
  const i = o;
@@ -278,7 +278,7 @@ function we(t, e, n) {
278
278
  }
279
279
  return o;
280
280
  }
281
- const ne = {
281
+ const oe = {
282
282
  onBoundsChanged: "bounds_changed",
283
283
  onCenterChanged: "center_changed",
284
284
  onClick: "click",
@@ -304,25 +304,31 @@ const ne = {
304
304
  // since that is going to be fired in every situation where the camera is
305
305
  // updated.
306
306
  onCameraChanged: "bounds_changed"
307
- }, Ee = ["bounds_changed", "center_changed", "heading_changed", "tilt_changed", "zoom_changed"], Le = ["click", "contextmenu", "dblclick", "mousemove", "mouseout", "mouseover"], Me = Object.keys(ne);
308
- function Z(t, e) {
309
- const n = N(void 0);
310
- (!n.current || !fe(e, n.current)) && (n.current = e), y(t, n.current);
307
+ }, Le = ["bounds_changed", "center_changed", "heading_changed", "tilt_changed", "zoom_changed"], Me = ["click", "contextmenu", "dblclick", "mousemove", "mouseout", "mouseover"], Ie = Object.keys(oe);
308
+ function re(t, e) {
309
+ const n = z(t);
310
+ return e(t, n.current) || (n.current = t), n.current;
311
+ }
312
+ function Se(t, e, n) {
313
+ v(t, [re(e, n)]);
311
314
  }
312
- const Ie = /* @__PURE__ */ new Set(["backgroundColor", "clickableIcons", "controlSize", "disableDefaultUI", "disableDoubleClickZoom", "draggable", "draggableCursor", "draggingCursor", "fullscreenControl", "fullscreenControlOptions", "gestureHandling", "headingInteractionEnabled", "isFractionalZoomEnabled", "keyboardShortcuts", "mapTypeControl", "mapTypeControlOptions", "mapTypeId", "maxZoom", "minZoom", "noClear", "panControl", "panControlOptions", "restriction", "rotateControl", "rotateControlOptions", "scaleControl", "scaleControlOptions", "scrollwheel", "streetView", "streetViewControl", "streetViewControlOptions", "styles", "tiltInteractionEnabled", "zoomControl", "zoomControlOptions"]);
313
- function Se(t, e) {
315
+ function _e(t, e) {
316
+ Se(t, e, ne);
317
+ }
318
+ const ke = /* @__PURE__ */ new Set(["backgroundColor", "clickableIcons", "controlSize", "disableDefaultUI", "disableDoubleClickZoom", "draggable", "draggableCursor", "draggingCursor", "fullscreenControl", "fullscreenControlOptions", "gestureHandling", "headingInteractionEnabled", "isFractionalZoomEnabled", "keyboardShortcuts", "mapTypeControl", "mapTypeControlOptions", "mapTypeId", "maxZoom", "minZoom", "noClear", "panControl", "panControlOptions", "restriction", "rotateControl", "rotateControlOptions", "scaleControl", "scaleControlOptions", "scrollwheel", "streetView", "streetViewControl", "streetViewControlOptions", "styles", "tiltInteractionEnabled", "zoomControl", "zoomControlOptions"]);
319
+ function xe(t, e) {
314
320
  const n = {}, o = Object.keys(e);
315
321
  for (const r of o)
316
- Ie.has(r) && (n[r] = e[r]);
317
- Z(() => {
322
+ ke.has(r) && (n[r] = e[r]);
323
+ _e(() => {
318
324
  t && t.setOptions(n);
319
325
  }, [n]);
320
326
  }
321
- function oe() {
327
+ function ie() {
322
328
  var t;
323
- return ((t = z(B)) == null ? void 0 : t.status) || x.NOT_LOADED;
329
+ return ((t = R(G)) == null ? void 0 : t.status) || x.NOT_LOADED;
324
330
  }
325
- function _e(t, e) {
331
+ function Ae(t, e) {
326
332
  const {
327
333
  viewport: n,
328
334
  viewState: o
@@ -333,8 +339,8 @@ function _e(t, e) {
333
339
  latitude: i,
334
340
  longitude: a,
335
341
  bearing: s,
336
- pitch: u,
337
- zoom: d
342
+ pitch: c,
343
+ zoom: u
338
344
  } = o;
339
345
  t.moveCamera({
340
346
  center: {
@@ -342,33 +348,33 @@ function _e(t, e) {
342
348
  lng: a
343
349
  },
344
350
  heading: s,
345
- tilt: u,
346
- zoom: d + 1
351
+ tilt: c,
352
+ zoom: u + 1
347
353
  });
348
354
  }, [t, o]), r;
349
355
  }
350
- function ke(t) {
356
+ function Pe(t) {
351
357
  return !t || typeof t != "object" || !("lat" in t && "lng" in t) ? !1 : Number.isFinite(t.lat) && Number.isFinite(t.lng);
352
358
  }
353
- function re(t) {
354
- return ke(t) ? t : t.toJSON();
359
+ function ae(t) {
360
+ return Pe(t) ? t : t.toJSON();
355
361
  }
356
- function xe(t, e, n) {
357
- const o = n.center ? re(n.center) : null;
362
+ function De(t, e, n) {
363
+ const o = n.center ? ae(n.center) : null;
358
364
  let r = null, i = null;
359
365
  o && Number.isFinite(o.lat) && Number.isFinite(o.lng) && (r = o.lat, i = o.lng);
360
- const a = Number.isFinite(n.zoom) ? n.zoom : null, s = Number.isFinite(n.heading) ? n.heading : null, u = Number.isFinite(n.tilt) ? n.tilt : null;
366
+ const a = Number.isFinite(n.zoom) ? n.zoom : null, s = Number.isFinite(n.heading) ? n.heading : null, c = Number.isFinite(n.tilt) ? n.tilt : null;
361
367
  W(() => {
362
368
  if (!t) return;
363
- const d = {};
364
- let c = !1;
365
- r !== null && i !== null && (e.current.center.lat !== r || e.current.center.lng !== i) && (d.center = {
369
+ const u = {};
370
+ let d = !1;
371
+ r !== null && i !== null && (e.current.center.lat !== r || e.current.center.lng !== i) && (u.center = {
366
372
  lat: r,
367
373
  lng: i
368
- }, c = !0), a !== null && e.current.zoom !== a && (d.zoom = a, c = !0), s !== null && e.current.heading !== s && (d.heading = s, c = !0), u !== null && e.current.tilt !== u && (d.tilt = u, c = !0), c && t.moveCamera(d);
374
+ }, d = !0), a !== null && e.current.zoom !== a && (u.zoom = a, d = !0), s !== null && e.current.heading !== s && (u.heading = s, d = !0), c !== null && e.current.tilt !== c && (u.tilt = c, d = !0), d && t.moveCamera(u);
369
375
  });
370
376
  }
371
- const Ae = () => {
377
+ const Te = () => {
372
378
  const t = {
373
379
  position: "absolute",
374
380
  top: 0,
@@ -385,22 +391,22 @@ const Ae = () => {
385
391
  background: "#dddddd",
386
392
  padding: "1rem 1.5rem"
387
393
  };
388
- return /* @__PURE__ */ C.createElement("div", {
394
+ return /* @__PURE__ */ b.createElement("div", {
389
395
  style: t
390
- }, /* @__PURE__ */ C.createElement("h2", null, "Error: AuthFailure"), /* @__PURE__ */ C.createElement("p", null, "A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ", /* @__PURE__ */ C.createElement("code", null, "APIProvider.apiKey"), " prop is correct. Check the error-message in the console for further details."));
396
+ }, /* @__PURE__ */ b.createElement("h2", null, "Error: AuthFailure"), /* @__PURE__ */ b.createElement("p", null, "A problem with your API key prevents the map from rendering correctly. Please make sure the value of the ", /* @__PURE__ */ b.createElement("code", null, "APIProvider.apiKey"), " prop is correct. Check the error-message in the console for further details."));
391
397
  };
392
- function Pe() {
398
+ function Fe() {
393
399
  const [t, e] = A(null), n = te((o) => e(o), [e]);
394
400
  return [t, n];
395
401
  }
396
- function ie() {
397
- return oe() === x.LOADED;
402
+ function se() {
403
+ return ie() === x.LOADED;
398
404
  }
399
- function De() {
405
+ function Ne() {
400
406
  const [, t] = ee((e) => e + 1, 0);
401
407
  return t;
402
408
  }
403
- function Te(t, e) {
409
+ function ze(t, e) {
404
410
  const n = t.getCenter(), o = t.getZoom(), r = t.getHeading() || 0, i = t.getTilt() || 0, a = t.getBounds();
405
411
  (!n || !a || !Number.isFinite(o)) && console.warn("[useTrackedCameraState] at least one of the values from the map returned undefined. This is not expected to happen. Please report an issue at https://github.com/visgl/react-google-maps/issues/new"), Object.assign(e.current, {
406
412
  center: (n == null ? void 0 : n.toJSON()) || {
@@ -412,8 +418,8 @@ function Te(t, e) {
412
418
  tilt: i
413
419
  });
414
420
  }
415
- function Fe(t) {
416
- const e = De(), n = N({
421
+ function Re(t) {
422
+ const e = Ne(), n = z({
417
423
  center: {
418
424
  lat: 0,
419
425
  lng: 0
@@ -422,16 +428,16 @@ function Fe(t) {
422
428
  tilt: 0,
423
429
  zoom: 0
424
430
  });
425
- return y(() => {
431
+ return v(() => {
426
432
  if (!t) return;
427
433
  const o = google.maps.event.addListener(t, "bounds_changed", () => {
428
- Te(t, n), e();
434
+ ze(t, n), e();
429
435
  });
430
436
  return () => o.remove();
431
437
  }, [t, e]), n;
432
438
  }
433
- const Ne = ["id", "defaultBounds", "defaultCenter", "defaultZoom", "defaultHeading", "defaultTilt", "reuseMaps", "renderingType", "colorScheme"], ze = ["padding"];
434
- class H {
439
+ const Be = ["id", "defaultBounds", "defaultCenter", "defaultZoom", "defaultHeading", "defaultTilt", "reuseMaps", "renderingType", "colorScheme"], Ge = ["padding"];
440
+ class U {
435
441
  static has(e) {
436
442
  return this.entries[e] && this.entries[e].length > 0;
437
443
  }
@@ -442,60 +448,60 @@ class H {
442
448
  this.entries[e] || (this.entries[e] = []), this.entries[e].push(n);
443
449
  }
444
450
  }
445
- H.entries = {};
446
- function Re(t, e) {
447
- const n = ie(), [o, r] = A(null), [i, a] = Pe(), s = Fe(o), {
448
- id: u,
449
- defaultBounds: d,
450
- defaultCenter: c,
451
+ U.entries = {};
452
+ function He(t, e) {
453
+ const n = se(), [o, r] = A(null), [i, a] = Fe(), s = Re(o), {
454
+ id: c,
455
+ defaultBounds: u,
456
+ defaultCenter: d,
451
457
  defaultZoom: p,
452
458
  defaultHeading: f,
453
459
  defaultTilt: m,
454
460
  reuseMaps: l,
455
461
  renderingType: g,
456
- colorScheme: L
457
- } = t, h = D(t, Ne), b = t.zoom !== void 0 || t.defaultZoom !== void 0, w = t.center !== void 0 || t.defaultCenter !== void 0;
458
- !d && (!b || !w) && console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"), !h.center && c && (h.center = c), !h.zoom && Number.isFinite(p) && (h.zoom = p), !h.heading && Number.isFinite(f) && (h.heading = f), !h.tilt && Number.isFinite(m) && (h.tilt = m);
459
- for (const v of Object.keys(h)) h[v] === void 0 && delete h[v];
460
- const M = N(void 0);
461
- return y(
462
+ colorScheme: C
463
+ } = t, h = D(t, Be), I = t.zoom !== void 0 || t.defaultZoom !== void 0, O = t.center !== void 0 || t.defaultCenter !== void 0;
464
+ !u && (!I || !O) && console.warn("<Map> component is missing configuration. You have to provide zoom and center (via the `zoom`/`defaultZoom` and `center`/`defaultCenter` props) or specify the region to show using `defaultBounds`. See https://visgl.github.io/react-google-maps/docs/api-reference/components/map#required"), !h.center && d && (h.center = d), !h.zoom && Number.isFinite(p) && (h.zoom = p), !h.heading && Number.isFinite(f) && (h.heading = f), !h.tilt && Number.isFinite(m) && (h.tilt = m);
465
+ for (const w of Object.keys(h)) h[w] === void 0 && delete h[w];
466
+ const E = z(void 0);
467
+ return v(
462
468
  () => {
463
469
  if (!i || !n) return;
464
470
  const {
465
- addMapInstance: v,
466
- removeMapInstance: O
471
+ addMapInstance: w,
472
+ removeMapInstance: y
467
473
  } = e, {
468
- mapId: I
469
- } = t, S = `${I || "default"}:${g || "default"}:${L || "LIGHT"}`;
470
- let _, E;
471
- if (l && H.has(S) ? (E = H.pop(S), _ = E.getDiv(), i.appendChild(_), E.setOptions(h), setTimeout(() => E.setCenter(E.getCenter()), 0)) : (_ = document.createElement("div"), _.style.height = "100%", i.appendChild(_), E = new google.maps.Map(_, k({}, h, g ? {
474
+ mapId: M
475
+ } = t, k = `${M || "default"}:${g || "default"}:${C || "LIGHT"}`;
476
+ let S, L;
477
+ if (l && U.has(k) ? (L = U.pop(k), S = L.getDiv(), i.appendChild(S), L.setOptions(h), setTimeout(() => L.setCenter(L.getCenter()), 0)) : (S = document.createElement("div"), S.style.height = "100%", i.appendChild(S), L = new google.maps.Map(S, _({}, h, g ? {
472
478
  renderingType: g
473
- } : {}, L ? {
474
- colorScheme: L
475
- } : {}))), r(E), v(E, u), d) {
479
+ } : {}, C ? {
480
+ colorScheme: C
481
+ } : {}))), r(L), w(L, c), u) {
476
482
  const {
477
483
  padding: T
478
- } = d, U = D(d, ze);
479
- E.fitBounds(U, T);
480
- } else (!b || !w) && E.fitBounds({
484
+ } = u, F = D(u, Ge);
485
+ L.fitBounds(F, T);
486
+ } else (!I || !O) && L.fitBounds({
481
487
  east: 180,
482
488
  west: -180,
483
489
  south: -90,
484
490
  north: 90
485
491
  });
486
- if (M.current) {
492
+ if (E.current) {
487
493
  const {
488
494
  mapId: T,
489
- cameraState: U
490
- } = M.current;
491
- T !== I && E.setOptions(U);
495
+ cameraState: F
496
+ } = E.current;
497
+ T !== M && L.setOptions(F);
492
498
  }
493
499
  return () => {
494
- M.current = {
495
- mapId: I,
500
+ E.current = {
501
+ mapId: M,
496
502
  // eslint-disable-next-line react-hooks/exhaustive-deps
497
503
  cameraState: s.current
498
- }, _.remove(), l ? H.push(S, E) : google.maps.event.clearInstanceListeners(E), r(null), O(u);
504
+ }, S.remove(), l ? U.push(k, L) : google.maps.event.clearInstanceListeners(L), r(null), y(c);
499
505
  };
500
506
  },
501
507
  // some dependencies are ignored in the list below:
@@ -506,7 +512,7 @@ function Re(t, e) {
506
512
  [
507
513
  i,
508
514
  n,
509
- u,
515
+ c,
510
516
  // these props can't be changed after initialization and require a new
511
517
  // instance to be created
512
518
  t.mapId,
@@ -515,23 +521,23 @@ function Re(t, e) {
515
521
  ]
516
522
  ), [o, a, s];
517
523
  }
518
- const ae = C.createContext(null), Be = (t) => {
524
+ const le = b.createContext(null), Ue = (t) => {
519
525
  const {
520
526
  children: e,
521
527
  id: n,
522
528
  className: o,
523
529
  style: r
524
- } = t, i = z(B), a = oe();
530
+ } = t, i = R(G), a = ie();
525
531
  if (!i)
526
532
  throw new Error("<Map> can only be used inside an <ApiProvider> component.");
527
- const [s, u, d] = Re(t, i);
528
- xe(s, d, t), Oe(s, t), Se(s, t);
529
- const c = _e(s, t), p = !!t.controlled;
530
- y(() => {
533
+ const [s, c, u] = He(t, i);
534
+ De(s, u, t), we(s, t), xe(s, t);
535
+ const d = Ae(s, t), p = !!t.controlled;
536
+ v(() => {
531
537
  if (s)
532
- return c && s.setOptions({
538
+ return d && s.setOptions({
533
539
  disableDefaultUI: !0
534
- }), (c || p) && s.setOptions({
540
+ }), (d || p) && s.setOptions({
535
541
  gestureHandling: "none",
536
542
  keyboardShortcuts: !1
537
543
  }), () => {
@@ -540,180 +546,180 @@ const ae = C.createContext(null), Be = (t) => {
540
546
  keyboardShortcuts: t.keyboardShortcuts
541
547
  });
542
548
  };
543
- }, [s, c, p, t.gestureHandling, t.keyboardShortcuts]);
544
- const f = t.center ? re(t.center) : null;
549
+ }, [s, d, p, t.gestureHandling, t.keyboardShortcuts]);
550
+ const f = t.center ? ae(t.center) : null;
545
551
  let m = null, l = null;
546
552
  f && Number.isFinite(f.lat) && Number.isFinite(f.lng) && (m = f.lat, l = f.lng);
547
553
  const g = P(() => {
548
- var b, w, M, v, O;
554
+ var I, O, E, w, y;
549
555
  return {
550
556
  center: {
551
- lat: (b = m) != null ? b : 0,
552
- lng: (w = l) != null ? w : 0
557
+ lat: (I = m) != null ? I : 0,
558
+ lng: (O = l) != null ? O : 0
553
559
  },
554
- zoom: (M = t.zoom) != null ? M : 0,
555
- heading: (v = t.heading) != null ? v : 0,
556
- tilt: (O = t.tilt) != null ? O : 0
560
+ zoom: (E = t.zoom) != null ? E : 0,
561
+ heading: (w = t.heading) != null ? w : 0,
562
+ tilt: (y = t.tilt) != null ? y : 0
557
563
  };
558
564
  }, [m, l, t.zoom, t.heading, t.tilt]);
559
565
  W(() => {
560
566
  if (!s || !p) return;
561
567
  s.moveCamera(g);
562
- const b = s.addListener("bounds_changed", () => {
568
+ const I = s.addListener("bounds_changed", () => {
563
569
  s.moveCamera(g);
564
570
  });
565
- return () => b.remove();
571
+ return () => I.remove();
566
572
  }, [s, p, g]);
567
- const L = P(() => k({
573
+ const C = P(() => _({
568
574
  width: "100%",
569
575
  height: "100%",
570
576
  position: "relative",
571
577
  // when using deckgl, the map should be sent to the back
572
- zIndex: c ? -1 : 0
573
- }, r), [r, c]), h = P(() => ({
578
+ zIndex: d ? -1 : 0
579
+ }, r), [r, d]), h = P(() => ({
574
580
  map: s
575
581
  }), [s]);
576
- return a === x.AUTH_FAILURE ? /* @__PURE__ */ C.createElement("div", {
577
- style: k({
582
+ return a === x.AUTH_FAILURE ? /* @__PURE__ */ b.createElement("div", {
583
+ style: _({
578
584
  position: "relative"
579
- }, o ? {} : L),
585
+ }, o ? {} : C),
580
586
  className: o
581
- }, /* @__PURE__ */ C.createElement(Ae, null)) : /* @__PURE__ */ C.createElement("div", k({
582
- ref: u,
587
+ }, /* @__PURE__ */ b.createElement(Te, null)) : /* @__PURE__ */ b.createElement("div", _({
588
+ ref: c,
583
589
  "data-testid": "map",
584
- style: o ? void 0 : L,
590
+ style: o ? void 0 : C,
585
591
  className: o
586
592
  }, n ? {
587
593
  id: n
588
- } : {}), s ? /* @__PURE__ */ C.createElement(ae.Provider, {
594
+ } : {}), s ? /* @__PURE__ */ b.createElement(le.Provider, {
589
595
  value: h
590
596
  }, e) : null);
591
597
  };
592
- Be.deckGLViewProps = !0;
593
- const V = /* @__PURE__ */ new Set();
594
- function Ge(...t) {
598
+ Ue.deckGLViewProps = !0;
599
+ const J = /* @__PURE__ */ new Set();
600
+ function je(...t) {
595
601
  const e = JSON.stringify(t);
596
- V.has(e) || (V.add(e), console.error(...t));
602
+ J.has(e) || (J.add(e), console.error(...t));
597
603
  }
598
- const q = (t = null) => {
599
- const e = z(B), {
604
+ const Z = (t = null) => {
605
+ const e = R(G), {
600
606
  map: n
601
- } = z(ae) || {};
607
+ } = R(le) || {};
602
608
  if (e === null)
603
- return Ge("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."), null;
609
+ return je("useMap(): failed to retrieve APIProviderContext. Make sure that the <APIProvider> component exists and that the component you are calling `useMap()` from is a sibling of the <APIProvider>."), null;
604
610
  const {
605
611
  mapInstances: o
606
612
  } = e;
607
613
  return t !== null ? o[t] || null : n || o.default || null;
608
614
  };
609
- function se(t) {
610
- const e = ie(), n = z(B);
611
- return y(() => {
615
+ function ce(t) {
616
+ const e = se(), n = R(G);
617
+ return v(() => {
612
618
  !e || !n || n.importLibrary(t);
613
619
  }, [e, n, t]), (n == null ? void 0 : n.loadedLibraries[t]) || null;
614
620
  }
615
- function F(t, e, n) {
616
- y(() => {
621
+ function N(t, e, n) {
622
+ v(() => {
617
623
  if (!t || !e || !n) return;
618
624
  const o = google.maps.event.addListener(t, e, n);
619
625
  return () => o.remove();
620
626
  }, [t, e, n]);
621
627
  }
622
- function G(t, e, n) {
623
- y(() => {
628
+ function H(t, e, n) {
629
+ v(() => {
624
630
  t && (t[e] = n);
625
631
  }, [t, e, n]);
626
632
  }
627
- function K(t, e, n) {
628
- y(() => {
633
+ function V(t, e, n) {
634
+ v(() => {
629
635
  if (!(!t || !e || !n))
630
636
  return t.addEventListener(e, n), () => t.removeEventListener(e, n);
631
637
  }, [t, e, n]);
632
638
  }
633
- function He(t) {
639
+ function $e(t) {
634
640
  return t.content !== void 0;
635
641
  }
636
- function Ue(t) {
642
+ function K(t) {
637
643
  return t.nodeType === Node.ELEMENT_NODE;
638
644
  }
639
- const je = C.createContext(null), $e = {
645
+ const We = b.createContext(null), Ze = {
640
646
  BOTTOM: ["50%", "100%"]
641
- }, Ze = ({
647
+ }, qe = ({
642
648
  children: t,
643
649
  styles: e,
644
650
  className: n,
645
651
  anchorPoint: o
646
652
  }) => {
647
- const [r, i] = o ?? $e.BOTTOM;
653
+ const [r, i] = o ?? Ze.BOTTOM;
648
654
  let a = `-${r}`, s = `-${i}`;
649
655
  r.trimStart().startsWith("-") && (a = r.substring(1)), i.trimStart().startsWith("-") && (s = i.substring(1));
650
- const u = `translate(50%, 100%) translate(${a}, ${s})`;
656
+ const c = `translate(50%, 100%) translate(${a}, ${s})`;
651
657
  return (
652
658
  // anchoring container
653
- /* @__PURE__ */ C.createElement("div", {
659
+ /* @__PURE__ */ b.createElement("div", {
654
660
  style: {
655
- transform: u
661
+ transform: c
656
662
  }
657
- }, /* @__PURE__ */ C.createElement("div", {
663
+ }, /* @__PURE__ */ b.createElement("div", {
658
664
  className: n,
659
665
  style: e
660
666
  }, t))
661
667
  );
662
668
  };
663
- function We(t) {
664
- const [e, n] = A(null), [o, r] = A(null), i = q(), a = se("marker"), {
669
+ function Je(t) {
670
+ const [e, n] = A(null), [o, r] = A(null), i = Z(), a = ce("marker"), {
665
671
  children: s,
666
- onClick: u,
667
- className: d,
668
- onMouseEnter: c,
672
+ onClick: c,
673
+ className: u,
674
+ onMouseEnter: d,
669
675
  onMouseLeave: p,
670
676
  onDrag: f,
671
677
  onDragStart: m,
672
678
  onDragEnd: l,
673
679
  collisionBehavior: g,
674
- clickable: L,
680
+ clickable: C,
675
681
  draggable: h,
676
- position: b,
677
- title: w,
678
- zIndex: M
679
- } = t, v = le.count(s);
680
- return y(() => {
682
+ position: I,
683
+ title: O,
684
+ zIndex: E
685
+ } = t, w = ue.count(s);
686
+ return v(() => {
681
687
  if (!i || !a) return;
682
- const O = new a.AdvancedMarkerElement();
683
- O.map = i, n(O);
684
- let I = null;
685
- return v > 0 && (I = document.createElement("div"), I.isCustomMarker = !0, O.content = I, r(I)), () => {
686
- var S;
687
- O.map = null, (S = I) == null || S.remove(), n(null), r(null);
688
+ const y = new a.AdvancedMarkerElement();
689
+ y.map = i, n(y);
690
+ let M = null;
691
+ return w > 0 && (M = document.createElement("div"), M.isCustomMarker = !0, y.content = M, r(M)), () => {
692
+ var k;
693
+ y.map = null, (k = M) == null || k.remove(), n(null), r(null);
688
694
  };
689
- }, [i, a, v]), y(() => {
690
- !e || !e.content || v > 0 || (e.content.className = d || "");
691
- }, [e, d, v]), G(e, "position", b), G(e, "title", w ?? ""), G(e, "zIndex", M), G(e, "collisionBehavior", g), y(() => {
695
+ }, [i, a, w]), v(() => {
696
+ !(e != null && e.content) || !K(e.content) || w > 0 || (e.content.className = u ?? "");
697
+ }, [e, u, w]), H(e, "position", I), H(e, "title", O ?? ""), H(e, "zIndex", E), H(e, "collisionBehavior", g), v(() => {
692
698
  e && (h !== void 0 ? e.gmpDraggable = h : f || m || l ? e.gmpDraggable = !0 : e.gmpDraggable = !1);
693
- }, [e, h, f, l, m]), y(() => {
699
+ }, [e, h, f, l, m]), v(() => {
694
700
  if (!e) return;
695
- const O = L !== void 0 || !!u || !!c || !!p;
696
- e.gmpClickable = O, O && e != null && e.content && Ue(e.content) && (e.content.style.pointerEvents = "none", e.content.firstElementChild && (e.content.firstElementChild.style.pointerEvents = "all"));
697
- }, [e, L, u, c, p]), F(e, "click", u), F(e, "drag", f), F(e, "dragstart", m), F(e, "dragend", l), K(e == null ? void 0 : e.element, "mouseenter", c), K(e == null ? void 0 : e.element, "mouseleave", p), [e, o];
701
+ const y = C !== void 0 || !!c || !!d || !!p;
702
+ e.gmpClickable = y, y && e != null && e.content && K(e.content) && (e.content.style.pointerEvents = "none", e.content.firstElementChild && (e.content.firstElementChild.style.pointerEvents = "all"));
703
+ }, [e, C, c, d, p]), N(e, "click", c), N(e, "drag", f), N(e, "dragstart", m), N(e, "dragend", l), V(e == null ? void 0 : e.element, "mouseenter", d), V(e == null ? void 0 : e.element, "mouseleave", p), [e, o];
698
704
  }
699
- const ot = Y((t, e) => {
705
+ const it = Y((t, e) => {
700
706
  const {
701
707
  children: n,
702
708
  style: o,
703
709
  className: r,
704
710
  anchorPoint: i
705
- } = t, [a, s] = We(t), u = P(() => a ? {
711
+ } = t, [a, s] = Je(t), c = P(() => a ? {
706
712
  marker: a
707
713
  } : null, [a]);
708
- return Q(e, () => a, [a]), s ? /* @__PURE__ */ C.createElement(je.Provider, {
709
- value: u
710
- }, $(/* @__PURE__ */ C.createElement(Ze, {
714
+ return Q(e, () => a, [a]), s ? /* @__PURE__ */ b.createElement(We.Provider, {
715
+ value: c
716
+ }, $(/* @__PURE__ */ b.createElement(qe, {
711
717
  anchorPoint: i,
712
718
  styles: o,
713
719
  className: r
714
720
  }, n), s)) : null;
715
721
  });
716
- function qe(t, e, n) {
722
+ function Ve(t, e, n) {
717
723
  if (e != null && typeof e != "object")
718
724
  throw new Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");
719
725
  const o = t.style;
@@ -733,9 +739,9 @@ function qe(t, e, n) {
733
739
  }
734
740
  function X(t, e, n) {
735
741
  const o = e.indexOf("--") === 0;
736
- n == null || typeof n == "boolean" || n === "" ? o ? t.setProperty(e, "") : e === "float" ? t.cssFloat = "" : t[e] = "" : o ? t.setProperty(e, n) : typeof n == "number" && n !== 0 && !Ve(e) ? t[e] = n + "px" : e === "float" ? t.cssFloat = n : t[e] = ("" + n).trim();
742
+ n == null || typeof n == "boolean" || n === "" ? o ? t.setProperty(e, "") : e === "float" ? t.cssFloat = "" : t[e] = "" : o ? t.setProperty(e, n) : typeof n == "number" && n !== 0 && !Xe(e) ? t[e] = n + "px" : e === "float" ? t.cssFloat = n : t[e] = ("" + n).trim();
737
743
  }
738
- const Je = /* @__PURE__ */ new Set([
744
+ const Ke = /* @__PURE__ */ new Set([
739
745
  "animationIterationCount",
740
746
  "aspectRatio",
741
747
  "borderImageOutset",
@@ -782,10 +788,10 @@ const Je = /* @__PURE__ */ new Set([
782
788
  "strokeOpacity",
783
789
  "strokeWidth"
784
790
  ]);
785
- function Ve(t) {
786
- return Je.has(t);
791
+ function Xe(t) {
792
+ return Ke.has(t);
787
793
  }
788
- const Ke = ["children", "headerContent", "style", "className", "pixelOffset", "anchor", "shouldFocus", "onClose", "onCloseClick"], rt = (t) => {
794
+ const Ye = ["children", "headerContent", "style", "className", "pixelOffset", "anchor", "shouldFocus", "onClose", "onCloseClick"], at = (t) => {
789
795
  const {
790
796
  // content options
791
797
  children: e,
@@ -797,20 +803,20 @@ const Ke = ["children", "headerContent", "style", "className", "pixelOffset", "a
797
803
  anchor: a,
798
804
  shouldFocus: s,
799
805
  // events
800
- onClose: u,
801
- onCloseClick: d
806
+ onClose: c,
807
+ onCloseClick: u
802
808
  // other options
803
- } = t, c = D(t, Ke), p = se("maps"), [f, m] = A(null), l = N(null), g = N(null);
804
- y(
809
+ } = t, d = D(t, Ye), p = ce("maps"), [f, m] = A(null), l = z(null), g = z(null), C = re(d, ne);
810
+ v(
805
811
  () => {
806
812
  if (!p) return;
807
813
  l.current = document.createElement("div"), g.current = document.createElement("div");
808
- const b = c;
809
- i && (b.pixelOffset = new google.maps.Size(i[0], i[1])), n && (b.headerContent = typeof n == "string" ? n : g.current);
810
- const w = new google.maps.InfoWindow(c);
811
- return w.setContent(l.current), m(w), () => {
812
- var M, v;
813
- w.setContent(null), (M = l.current) == null || M.remove(), (v = g.current) == null || v.remove(), l.current = null, g.current = null, m(null);
814
+ const O = C;
815
+ i && (O.pixelOffset = new google.maps.Size(i[0], i[1])), n && (O.headerContent = typeof n == "string" ? n : g.current);
816
+ const E = new google.maps.InfoWindow(C);
817
+ return E.setContent(l.current), m(E), () => {
818
+ var w, y;
819
+ E.setContent(null), (w = l.current) == null || w.remove(), (y = g.current) == null || y.remove(), l.current = null, g.current = null, m(null);
814
820
  };
815
821
  },
816
822
  // `infoWindowOptions` and other props are missing from dependencies:
@@ -822,87 +828,87 @@ const Ke = ["children", "headerContent", "style", "className", "pixelOffset", "a
822
828
  // eslint-disable-next-line react-hooks/exhaustive-deps
823
829
  [p]
824
830
  );
825
- const L = N(null);
826
- y(() => {
827
- !f || !l.current || (qe(l.current, o || null, L.current), L.current = o || null, r !== l.current.className && (l.current.className = r || ""));
828
- }, [f, r, o]), Z(
831
+ const h = z(null);
832
+ v(() => {
833
+ !f || !l.current || (Ve(l.current, o || null, h.current), h.current = o || null, r !== l.current.className && (l.current.className = r || ""));
834
+ }, [f, r, o]), v(
829
835
  () => {
830
836
  if (!f) return;
831
- const b = c;
832
- i ? b.pixelOffset = new google.maps.Size(i[0], i[1]) : b.pixelOffset = null, n ? b.headerContent = typeof n == "string" ? n : g.current : b.headerContent = null, f.setOptions(c);
837
+ const O = C;
838
+ i ? O.pixelOffset = new google.maps.Size(i[0], i[1]) : O.pixelOffset = null, n ? O.headerContent = typeof n == "string" ? n : g.current : O.headerContent = null, f.setOptions(C);
833
839
  },
834
840
  // dependency `infoWindow` isn't needed since options are also passed
835
841
  // to the constructor when a new infoWindow is created.
836
842
  // eslint-disable-next-line react-hooks/exhaustive-deps
837
- [c, i, n]
838
- ), F(f, "close", u), F(f, "closeclick", d);
839
- const h = q();
840
- return Z(() => {
841
- if (!h || !f || a === null) return;
842
- const b = !!a, w = {
843
- map: h
843
+ [C, i, n]
844
+ ), N(f, "close", c), N(f, "closeclick", u);
845
+ const I = Z();
846
+ return v(() => {
847
+ if (!I || !f || a === null) return;
848
+ const O = !!a, E = {
849
+ map: I
844
850
  };
845
- if (a && (w.anchor = a, He(a) && a.content instanceof Element)) {
846
- const v = a.content, O = v == null ? void 0 : v.getBoundingClientRect();
847
- if (O && v != null && v.isCustomMarker) {
848
- var M;
849
- const I = (M = a.content.firstElementChild) == null ? void 0 : M.firstElementChild, S = I == null ? void 0 : I.getBoundingClientRect(), _ = S.x - O.x + (S.width - O.width) / 2, E = S.y - O.y, T = c;
850
- T.pixelOffset = new google.maps.Size(i ? i[0] + _ : _, i ? i[1] + E : E), f.setOptions(T);
851
+ if (a && (E.anchor = a, $e(a) && a.content instanceof Element)) {
852
+ const y = a.content, M = y == null ? void 0 : y.getBoundingClientRect();
853
+ if (M && y != null && y.isCustomMarker) {
854
+ var w;
855
+ const k = (w = a.content.firstElementChild) == null ? void 0 : w.firstElementChild, S = k == null ? void 0 : k.getBoundingClientRect(), L = S.x - M.x + (S.width - M.width) / 2, T = S.y - M.y, F = C;
856
+ F.pixelOffset = new google.maps.Size(i ? i[0] + L : L, i ? i[1] + T : T), f.setOptions(F);
851
857
  }
852
858
  }
853
- return s !== void 0 && (w.shouldFocus = s), f.open(w), () => {
854
- b && f.set("anchor", null), f.close();
859
+ return s !== void 0 && (E.shouldFocus = s), f.open(E), () => {
860
+ O && f.set("anchor", null), f.close();
855
861
  };
856
- }, [f, a, h, s, c, i]), /* @__PURE__ */ C.createElement(C.Fragment, null, l.current && $(e, l.current), g.current !== null && $(n, g.current));
857
- }, it = {
862
+ }, [f, a, I, s, C, i]), /* @__PURE__ */ b.createElement(b.Fragment, null, l.current && $(e, l.current), g.current !== null && $(n, g.current));
863
+ }, st = {
858
864
  LEFT_TOP: 5,
859
865
  LEFT_BOTTOM: 6,
860
866
  RIGHT_TOP: 7,
861
867
  RIGHT_BOTTOM: 9
862
- }, Xe = ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut"];
863
- function Ye(t) {
864
- const [e, n] = A(null), o = q(), {
868
+ }, Qe = ["onClick", "onDrag", "onDragStart", "onDragEnd", "onMouseOver", "onMouseOut"];
869
+ function et(t) {
870
+ const [e, n] = A(null), o = Z(), {
865
871
  onClick: r,
866
872
  onDrag: i,
867
873
  onDragStart: a,
868
874
  onDragEnd: s,
869
- onMouseOver: u,
870
- onMouseOut: d
871
- } = t, c = D(t, Xe), {
875
+ onMouseOver: c,
876
+ onMouseOut: u
877
+ } = t, d = D(t, Qe), {
872
878
  position: p,
873
879
  draggable: f
874
- } = c;
875
- return y(() => {
880
+ } = d;
881
+ return v(() => {
876
882
  if (!o) {
877
883
  o === void 0 && console.error("<Marker> has to be inside a Map component.");
878
884
  return;
879
885
  }
880
- const m = new google.maps.Marker(c);
886
+ const m = new google.maps.Marker(d);
881
887
  return m.setMap(o), n(m), () => {
882
888
  m.setMap(null), n(null);
883
889
  };
884
- }, [o]), y(() => {
890
+ }, [o]), v(() => {
885
891
  if (!e) return;
886
892
  const m = e, l = google.maps.event;
887
- return r && l.addListener(m, "click", r), i && l.addListener(m, "drag", i), a && l.addListener(m, "dragstart", a), s && l.addListener(m, "dragend", s), u && l.addListener(m, "mouseover", u), d && l.addListener(m, "mouseout", d), e.setDraggable(!!f), () => {
893
+ return r && l.addListener(m, "click", r), i && l.addListener(m, "drag", i), a && l.addListener(m, "dragstart", a), s && l.addListener(m, "dragend", s), c && l.addListener(m, "mouseover", c), u && l.addListener(m, "mouseout", u), e.setDraggable(!!f), () => {
888
894
  l.clearInstanceListeners(m);
889
895
  };
890
- }, [e, f, r, i, a, s, u, d]), y(() => {
891
- e && c && e.setOptions(c);
892
- }, [e, c]), y(() => {
896
+ }, [e, f, r, i, a, s, c, u]), v(() => {
897
+ e && d && e.setOptions(d);
898
+ }, [e, d]), v(() => {
893
899
  f || !p || !e || e.setPosition(p);
894
900
  }, [f, p, e]), e;
895
901
  }
896
902
  Y((t, e) => {
897
- const n = Ye(t);
898
- return Q(e, () => n, [n]), /* @__PURE__ */ C.createElement(C.Fragment, null);
903
+ const n = et(t);
904
+ return Q(e, () => n, [n]), /* @__PURE__ */ b.createElement(b.Fragment, null);
899
905
  });
900
906
  export {
901
- nt as A,
902
- it as C,
903
- ae as G,
904
- rt as I,
905
- Be as M,
906
- ot as a,
907
- q as u
907
+ rt as A,
908
+ st as C,
909
+ le as G,
910
+ at as I,
911
+ Ue as M,
912
+ it as a,
913
+ Z as u
908
914
  };