@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,15 +1,15 @@
1
1
  import * as M from "react";
2
- import { useContext as w, useMemo as x, useLayoutEffect as q, useEffect as d, useState as B, useRef as b, useImperativeHandle as T, memo as _, forwardRef as k } from "react";
3
- import { createPortal as j } from "react-dom";
4
- const H = M.createContext(null);
5
- function mt() {
6
- var r;
7
- const t = (r = w(H)) == null ? void 0 : r.maps, n = w(R);
2
+ import { useContext as w, useMemo as x, useLayoutEffect as $, useEffect as d, useState as J, useRef as b, useImperativeHandle as k, memo as _, forwardRef as z } from "react";
3
+ import { createPortal as H } from "react-dom";
4
+ const V = M.createContext(null);
5
+ function pt() {
6
+ var i;
7
+ const t = (i = w(V)) == null ? void 0 : i.maps, n = w(R);
8
8
  return x(() => ({ ...t, current: n == null ? void 0 : n.map }), [t, n]);
9
9
  }
10
- function G(t, n) {
11
- const e = Array.isArray(t) ? t[0] : t ? t.x : 0, r = Array.isArray(t) ? t[1] : t ? t.y : 0, i = Array.isArray(n) ? n[0] : n ? n.x : 0, o = Array.isArray(n) ? n[1] : n ? n.y : 0;
12
- return e === i && r === o;
10
+ function K(t, n) {
11
+ const e = Array.isArray(t) ? t[0] : t ? t.x : 0, i = Array.isArray(t) ? t[1] : t ? t.y : 0, r = Array.isArray(n) ? n[0] : n ? n.x : 0, o = Array.isArray(n) ? n[1] : n ? n.y : 0;
12
+ return e === r && i === o;
13
13
  }
14
14
  function y(t, n) {
15
15
  if (t === n)
@@ -26,17 +26,17 @@ function y(t, n) {
26
26
  } else if (Array.isArray(n))
27
27
  return !1;
28
28
  if (typeof t == "object" && typeof n == "object") {
29
- const e = Object.keys(t), r = Object.keys(n);
30
- if (e.length !== r.length)
29
+ const e = Object.keys(t), i = Object.keys(n);
30
+ if (e.length !== i.length)
31
31
  return !1;
32
- for (const i of e)
33
- if (!n.hasOwnProperty(i) || !y(t[i], n[i]))
32
+ for (const r of e)
33
+ if (!n.hasOwnProperty(r) || !y(t[r], n[r]))
34
34
  return !1;
35
35
  return !0;
36
36
  }
37
37
  return !1;
38
38
  }
39
- function O(t) {
39
+ function A(t) {
40
40
  return {
41
41
  longitude: t.center.lng,
42
42
  latitude: t.center.lat,
@@ -46,37 +46,37 @@ function O(t) {
46
46
  padding: t.padding
47
47
  };
48
48
  }
49
- function A(t, n) {
50
- const e = n.viewState || n, r = {};
49
+ function U(t, n) {
50
+ const e = n.viewState || n, i = {};
51
51
  if ("longitude" in e && "latitude" in e && (e.longitude !== t.center.lng || e.latitude !== t.center.lat)) {
52
- const i = t.center.constructor;
53
- r.center = new i(e.longitude, e.latitude);
52
+ const r = t.center.constructor;
53
+ i.center = new r(e.longitude, e.latitude);
54
54
  }
55
- return "zoom" in e && e.zoom !== t.zoom && (r.zoom = e.zoom), "bearing" in e && e.bearing !== t.bearing && (r.bearing = e.bearing), "pitch" in e && e.pitch !== t.pitch && (r.pitch = e.pitch), e.padding && t.padding && !y(e.padding, t.padding) && (r.padding = e.padding), r;
55
+ return "zoom" in e && e.zoom !== t.zoom && (i.zoom = e.zoom), "bearing" in e && e.bearing !== t.bearing && (i.bearing = e.bearing), "pitch" in e && e.pitch !== t.pitch && (i.pitch = e.pitch), e.padding && t.padding && !y(e.padding, t.padding) && (i.padding = e.padding), i;
56
56
  }
57
- const $ = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
58
- function U(t) {
57
+ const Y = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
58
+ function I(t) {
59
59
  if (!t)
60
60
  return null;
61
61
  if (typeof t == "string" || ("toJS" in t && (t = t.toJS()), !t.layers))
62
62
  return t;
63
63
  const n = {};
64
- for (const r of t.layers)
65
- n[r.id] = r;
66
- const e = t.layers.map((r) => {
67
- let i = null;
68
- "interactive" in r && (i = Object.assign({}, r), delete i.interactive);
69
- const o = n[r.ref];
64
+ for (const i of t.layers)
65
+ n[i.id] = i;
66
+ const e = t.layers.map((i) => {
67
+ let r = null;
68
+ "interactive" in i && (r = Object.assign({}, i), delete r.interactive);
69
+ const o = n[i.ref];
70
70
  if (o) {
71
- i = i || Object.assign({}, r), delete i.ref;
72
- for (const s of $)
73
- s in o && (i[s] = o[s]);
71
+ r = r || Object.assign({}, i), delete r.ref;
72
+ for (const s of Y)
73
+ s in o && (r[s] = o[s]);
74
74
  }
75
- return i || r;
75
+ return r || i;
76
76
  });
77
77
  return { ...t, layers: e };
78
78
  }
79
- const I = { version: 8, sources: {}, layers: [] }, F = {
79
+ const F = { version: 8, sources: {}, layers: [] }, D = {
80
80
  mousedown: "onMouseDown",
81
81
  mouseup: "onMouseUp",
82
82
  mouseover: "onMouseOver",
@@ -91,7 +91,7 @@ const I = { version: 8, sources: {}, layers: [] }, F = {
91
91
  touchend: "onTouchEnd",
92
92
  touchmove: "onTouchMove",
93
93
  touchcancel: "onTouchCancel"
94
- }, D = {
94
+ }, W = {
95
95
  movestart: "onMoveStart",
96
96
  move: "onMove",
97
97
  moveend: "onMoveEnd",
@@ -107,7 +107,7 @@ const I = { version: 8, sources: {}, layers: [] }, F = {
107
107
  pitchstart: "onPitchStart",
108
108
  pitch: "onPitch",
109
109
  pitchend: "onPitchEnd"
110
- }, W = {
110
+ }, Z = {
111
111
  wheel: "onWheel",
112
112
  boxzoomstart: "onBoxZoomStart",
113
113
  boxzoomend: "onBoxZoomEnd",
@@ -121,7 +121,7 @@ const I = { version: 8, sources: {}, layers: [] }, F = {
121
121
  styledata: "onStyleData",
122
122
  sourcedata: "onSourceData",
123
123
  error: "onError"
124
- }, J = [
124
+ }, Q = [
125
125
  "minZoom",
126
126
  "maxZoom",
127
127
  "minPitch",
@@ -129,7 +129,7 @@ const I = { version: 8, sources: {}, layers: [] }, F = {
129
129
  "maxBounds",
130
130
  "projection",
131
131
  "renderWorldCopies"
132
- ], K = [
132
+ ], X = [
133
133
  "scrollZoom",
134
134
  "boxZoom",
135
135
  "dragRotate",
@@ -140,21 +140,21 @@ const I = { version: 8, sources: {}, layers: [] }, F = {
140
140
  "touchPitch"
141
141
  ];
142
142
  class P {
143
- constructor(n, e, r) {
144
- this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (i) => {
145
- const o = this.props[W[i.type]];
146
- o ? o(i) : i.type === "error" && console.error(i.error);
147
- }, this._onCameraEvent = (i) => {
143
+ constructor(n, e, i) {
144
+ this._map = null, this._internalUpdate = !1, this._hoveredFeatures = null, this._propsedCameraUpdate = null, this._styleComponents = {}, this._onEvent = (r) => {
145
+ const o = this.props[Z[r.type]];
146
+ o ? o(r) : r.type === "error" && console.error(r.error);
147
+ }, this._onCameraEvent = (r) => {
148
148
  if (this._internalUpdate)
149
149
  return;
150
- i.viewState = this._propsedCameraUpdate || O(this._map.transform);
151
- const o = this.props[D[i.type]];
152
- o && o(i);
153
- }, this._onCameraUpdate = (i) => this._internalUpdate ? i : (this._propsedCameraUpdate = O(i), A(i, this.props)), this._onPointerEvent = (i) => {
154
- (i.type === "mousemove" || i.type === "mouseout") && this._updateHover(i);
155
- const o = this.props[F[i.type]];
156
- o && (this.props.interactiveLayerIds && i.type !== "mouseover" && i.type !== "mouseout" && (i.features = this._hoveredFeatures || this._queryRenderedFeatures(i.point)), o(i), delete i.features);
157
- }, this._MapClass = n, this.props = e, this._initialize(r);
150
+ r.viewState = this._propsedCameraUpdate || A(this._map.transform);
151
+ const o = this.props[W[r.type]];
152
+ o && o(r);
153
+ }, this._onCameraUpdate = (r) => this._internalUpdate ? r : (this._propsedCameraUpdate = A(r), U(r, this.props)), this._onPointerEvent = (r) => {
154
+ (r.type === "mousemove" || r.type === "mouseout") && this._updateHover(r);
155
+ const o = this.props[D[r.type]];
156
+ o && (this.props.interactiveLayerIds && r.type !== "mouseover" && r.type !== "mouseout" && (r.features = this._hoveredFeatures || this._queryRenderedFeatures(r.point)), o(r), delete r.features);
157
+ }, this._MapClass = n, this.props = e, this._initialize(i);
158
158
  }
159
159
  get map() {
160
160
  return this._map;
@@ -162,31 +162,31 @@ class P {
162
162
  setProps(n) {
163
163
  const e = this.props;
164
164
  this.props = n;
165
- const r = this._updateSettings(n, e), i = this._updateSize(n), o = this._updateViewState(n);
166
- this._updateStyle(n, e), this._updateStyleComponents(n), this._updateHandlers(n, e), (r || i || o && !this._map.isMoving()) && this.redraw();
165
+ const i = this._updateSettings(n, e), r = this._updateSize(n), o = this._updateViewState(n);
166
+ this._updateStyle(n, e), this._updateStyleComponents(n), this._updateHandlers(n, e), (i || r || o && !this._map.isMoving()) && this.redraw();
167
167
  }
168
168
  static reuse(n, e) {
169
- const r = P.savedMaps.pop();
170
- if (!r)
169
+ const i = P.savedMaps.pop();
170
+ if (!i)
171
171
  return null;
172
- const i = r.map, o = i.getContainer();
172
+ const r = i.map, o = r.getContainer();
173
173
  for (e.className = o.className; o.childNodes.length > 0; )
174
174
  e.appendChild(o.childNodes[0]);
175
- i._container = e;
176
- const s = i._resizeObserver;
177
- s && (s.disconnect(), s.observe(e)), r.setProps({ ...n, styleDiffing: !1 }), i.resize();
175
+ r._container = e;
176
+ const s = r._resizeObserver;
177
+ s && (s.disconnect(), s.observe(e)), i.setProps({ ...n, styleDiffing: !1 }), r.resize();
178
178
  const { initialViewState: a } = n;
179
- return a && (a.bounds ? i.fitBounds(a.bounds, { ...a.fitBoundsOptions, duration: 0 }) : r._updateViewState(a)), i.isStyleLoaded() ? i.fire("load") : i.once("style.load", () => i.fire("load")), i._update(), r;
179
+ return a && (a.bounds ? r.fitBounds(a.bounds, { ...a.fitBoundsOptions, duration: 0 }) : i._updateViewState(a)), r.isStyleLoaded() ? r.fire("load") : r.once("style.load", () => r.fire("load")), r._update(), i;
180
180
  }
181
181
  /* eslint-disable complexity,max-statements */
182
182
  _initialize(n) {
183
- const { props: e } = this, { mapStyle: r = I } = e, i = {
183
+ const { props: e } = this, { mapStyle: i = F } = e, r = {
184
184
  ...e,
185
185
  ...e.initialViewState,
186
186
  container: n,
187
- style: U(r)
188
- }, o = i.initialViewState || i.viewState || i;
189
- if (Object.assign(i, {
187
+ style: I(i)
188
+ }, o = r.initialViewState || r.viewState || r;
189
+ if (Object.assign(r, {
190
190
  center: [o.longitude || 0, o.latitude || 0],
191
191
  zoom: o.zoom || 0,
192
192
  pitch: o.pitch || 0,
@@ -195,7 +195,7 @@ class P {
195
195
  const a = HTMLCanvasElement.prototype.getContext;
196
196
  HTMLCanvasElement.prototype.getContext = () => (HTMLCanvasElement.prototype.getContext = a, e.gl);
197
197
  }
198
- const s = new this._MapClass(i);
198
+ const s = new this._MapClass(r);
199
199
  o.padding && s.setPadding(o.padding), e.cursor && (s.getCanvas().style.cursor = e.cursor), s.transformCameraUpdate = this._onCameraUpdate, s.on("style.load", () => {
200
200
  var a;
201
201
  this._styleComponents = {
@@ -208,11 +208,11 @@ class P {
208
208
  }), s.on("sourcedata", () => {
209
209
  this._updateStyleComponents(this.props);
210
210
  });
211
- for (const a in F)
212
- s.on(a, this._onPointerEvent);
213
211
  for (const a in D)
214
- s.on(a, this._onCameraEvent);
212
+ s.on(a, this._onPointerEvent);
215
213
  for (const a in W)
214
+ s.on(a, this._onCameraEvent);
215
+ for (const a in Z)
216
216
  s.on(a, this._onEvent);
217
217
  this._map = s;
218
218
  }
@@ -238,9 +238,9 @@ class P {
238
238
  _updateSize(n) {
239
239
  const { viewState: e } = n;
240
240
  if (e) {
241
- const r = this._map;
242
- if (e.width !== r.transform.width || e.height !== r.transform.height)
243
- return r.resize(), !0;
241
+ const i = this._map;
242
+ if (e.width !== i.transform.width || e.height !== i.transform.height)
243
+ return i.resize(), !0;
244
244
  }
245
245
  return !1;
246
246
  }
@@ -251,9 +251,9 @@ class P {
251
251
  @returns {bool} true if anything is changed
252
252
  */
253
253
  _updateViewState(n) {
254
- const e = this._map, r = e.transform;
254
+ const e = this._map, i = e.transform;
255
255
  if (!e.isMoving()) {
256
- const o = A(r, n);
256
+ const o = U(i, n);
257
257
  if (Object.keys(o).length > 0)
258
258
  return this._internalUpdate = !0, e.jumpTo(o), this._internalUpdate = !1, !0;
259
259
  }
@@ -265,23 +265,23 @@ class P {
265
265
  @returns {bool} true if anything is changed
266
266
  */
267
267
  _updateSettings(n, e) {
268
- const r = this._map;
269
- let i = !1;
270
- for (const o of J)
268
+ const i = this._map;
269
+ let r = !1;
270
+ for (const o of Q)
271
271
  if (o in n && !y(n[o], e[o])) {
272
- i = !0;
273
- const s = r[`set${o[0].toUpperCase()}${o.slice(1)}`];
274
- s == null || s.call(r, n[o]);
272
+ r = !0;
273
+ const s = i[`set${o[0].toUpperCase()}${o.slice(1)}`];
274
+ s == null || s.call(i, n[o]);
275
275
  }
276
- return i;
276
+ return r;
277
277
  }
278
278
  /* Update map style to match props */
279
279
  _updateStyle(n, e) {
280
280
  if (n.cursor !== e.cursor && (this._map.getCanvas().style.cursor = n.cursor || ""), n.mapStyle !== e.mapStyle) {
281
- const { mapStyle: r = I, styleDiffing: i = !0 } = n, o = {
282
- diff: i
281
+ const { mapStyle: i = F, styleDiffing: r = !0 } = n, o = {
282
+ diff: r
283
283
  };
284
- "localIdeographFontFamily" in n && (o.localIdeographFontFamily = n.localIdeographFontFamily), this._map.setStyle(U(r), o);
284
+ "localIdeographFontFamily" in n && (o.localIdeographFontFamily = n.localIdeographFontFamily), this._map.setStyle(I(i), o);
285
285
  }
286
286
  }
287
287
  /* Update fog, light, projection and terrain to match props
@@ -289,41 +289,41 @@ class P {
289
289
  * 1. They can not be applied right away. Certain conditions (style loaded, source loaded, etc.) must be met
290
290
  * 2. They can be overwritten by mapStyle
291
291
  */
292
- _updateStyleComponents({ light: n, projection: e, sky: r, terrain: i }) {
292
+ _updateStyleComponents({ light: n, projection: e, sky: i, terrain: r }) {
293
293
  var a, c;
294
294
  const o = this._map, s = this._styleComponents;
295
- o.style._loaded && (n && !y(n, s.light) && (s.light = n, o.setLight(n)), e && !y(e, s.projection) && e !== ((a = s.projection) == null ? void 0 : a.type) && (s.projection = typeof e == "string" ? { type: e } : e, (c = o.setProjection) == null || c.call(o, s.projection)), r && !y(r, s.sky) && (s.sky = r, o.setSky(r)), i !== void 0 && !y(i, s.terrain) && (!i || o.getSource(i.source)) && (s.terrain = i, o.setTerrain(i)));
295
+ o.style._loaded && (n && !y(n, s.light) && (s.light = n, o.setLight(n)), e && !y(e, s.projection) && e !== ((a = s.projection) == null ? void 0 : a.type) && (s.projection = typeof e == "string" ? { type: e } : e, (c = o.setProjection) == null || c.call(o, s.projection)), i && !y(i, s.sky) && (s.sky = i, o.setSky(i)), r !== void 0 && !y(r, s.terrain) && (!r || o.getSource(r.source)) && (s.terrain = r, o.setTerrain(r)));
296
296
  }
297
297
  /* Update interaction handlers to match props */
298
298
  _updateHandlers(n, e) {
299
- const r = this._map;
300
- for (const i of K) {
301
- const o = n[i] ?? !0, s = e[i] ?? !0;
302
- y(o, s) || (o ? r[i].enable(o) : r[i].disable());
299
+ const i = this._map;
300
+ for (const r of X) {
301
+ const o = n[r] ?? !0, s = e[r] ?? !0;
302
+ y(o, s) || (o ? i[r].enable(o) : i[r].disable());
303
303
  }
304
304
  }
305
305
  _queryRenderedFeatures(n) {
306
- const e = this._map, { interactiveLayerIds: r = [] } = this.props;
306
+ const e = this._map, { interactiveLayerIds: i = [] } = this.props;
307
307
  try {
308
308
  return e.queryRenderedFeatures(n, {
309
- layers: r.filter(e.getLayer.bind(e))
309
+ layers: i.filter(e.getLayer.bind(e))
310
310
  });
311
311
  } catch {
312
312
  return [];
313
313
  }
314
314
  }
315
315
  _updateHover(n) {
316
- var i;
316
+ var r;
317
317
  const { props: e } = this;
318
318
  if (e.interactiveLayerIds && (e.onMouseMove || e.onMouseEnter || e.onMouseLeave)) {
319
- const o = n.type, s = ((i = this._hoveredFeatures) == null ? void 0 : i.length) > 0, a = this._queryRenderedFeatures(n.point), c = a.length > 0;
319
+ const o = n.type, s = ((r = this._hoveredFeatures) == null ? void 0 : r.length) > 0, a = this._queryRenderedFeatures(n.point), c = a.length > 0;
320
320
  !c && s && (n.type = "mouseleave", this._onPointerEvent(n)), this._hoveredFeatures = a, c && !s && (n.type = "mouseenter", this._onPointerEvent(n)), n.type = o;
321
321
  } else
322
322
  this._hoveredFeatures = null;
323
323
  }
324
324
  }
325
325
  P.savedMaps = [];
326
- const Y = [
326
+ const tt = [
327
327
  "setMaxBounds",
328
328
  "setMinZoom",
329
329
  "setMaxZoom",
@@ -345,69 +345,66 @@ const Y = [
345
345
  "setFog",
346
346
  "remove"
347
347
  ];
348
- function Q(t) {
348
+ function et(t) {
349
349
  if (!t)
350
350
  return null;
351
351
  const n = t.map, e = {
352
352
  getMap: () => n
353
353
  };
354
- for (const r of X(n))
355
- !(r in e) && !Y.includes(r) && (e[r] = n[r].bind(n));
354
+ for (const i of nt(n))
355
+ !(i in e) && !tt.includes(i) && (e[i] = n[i].bind(n));
356
356
  return e;
357
357
  }
358
- function X(t) {
358
+ function nt(t) {
359
359
  const n = /* @__PURE__ */ new Set();
360
360
  let e = t;
361
361
  for (; e; ) {
362
- for (const r of Object.getOwnPropertyNames(e))
363
- r[0] !== "_" && typeof t[r] == "function" && r !== "fire" && r !== "setEventedParent" && n.add(r);
362
+ for (const i of Object.getOwnPropertyNames(e))
363
+ i[0] !== "_" && typeof t[i] == "function" && i !== "fire" && i !== "setEventedParent" && n.add(i);
364
364
  e = Object.getPrototypeOf(e);
365
365
  }
366
366
  return Array.from(n);
367
367
  }
368
- const tt = typeof document < "u" ? q : d;
369
- function et(t, n) {
370
- const { RTLTextPlugin: e, maxParallelImageRequests: r, workerCount: i, workerUrl: o } = n;
368
+ const ot = typeof document < "u" ? $ : d;
369
+ function rt(t, n) {
370
+ const { RTLTextPlugin: e, maxParallelImageRequests: i, workerCount: r, workerUrl: o } = n;
371
371
  if (e && t.getRTLTextPluginStatus && t.getRTLTextPluginStatus() === "unavailable") {
372
372
  const { pluginUrl: s, lazy: a = !0 } = typeof e == "string" ? { pluginUrl: e } : e;
373
373
  t.setRTLTextPlugin(s, (c) => {
374
374
  c && console.error(c);
375
375
  }, a);
376
376
  }
377
- r !== void 0 && t.setMaxParallelImageRequests(r), i !== void 0 && t.setWorkerCount(i), o !== void 0 && t.setWorkerUrl(o);
377
+ i !== void 0 && t.setMaxParallelImageRequests(i), r !== void 0 && t.setWorkerCount(r), o !== void 0 && t.setWorkerUrl(o);
378
378
  }
379
379
  const R = M.createContext(null);
380
- function nt(t, n) {
381
- const e = w(H), [r, i] = B(null), o = b(), { current: s } = b({ mapLib: null, map: null });
380
+ function it(t, n) {
381
+ const e = w(V), [i, r] = J(null), o = b(), { current: s } = b({ mapLib: null, map: null });
382
382
  d(() => {
383
383
  const l = t.mapLib;
384
- let h = !0, u;
385
- return Promise.resolve(l || import("./maplibre-gl-CfOZKUDd.js").then((f) => f.m)).then((f) => {
386
- if (!h)
384
+ let m = !0, u;
385
+ return Promise.resolve(l || import("./maplibre-gl-CAHhS7Ky.js").then((f) => f.m)).then((f) => {
386
+ if (!m)
387
387
  return;
388
388
  if (!f)
389
389
  throw new Error("Invalid mapLib");
390
- const m = "Map" in f ? f : f.default;
391
- if (!m.Map)
390
+ const p = "Map" in f ? f : f.default;
391
+ if (!p.Map)
392
392
  throw new Error("Invalid mapLib");
393
- if (et(m, t), !m.supported || m.supported(t))
394
- t.reuseMaps && (u = P.reuse(t, o.current)), u || (u = new P(m.Map, t, o.current)), s.map = Q(u), s.mapLib = m, i(u), e == null || e.onMapMount(s.map, t.id);
395
- else
396
- throw new Error("Map is not supported by this browser");
393
+ rt(p, t), t.reuseMaps && (u = P.reuse(t, o.current)), u || (u = new P(p.Map, t, o.current)), s.map = et(u), s.mapLib = p, r(u), e == null || e.onMapMount(s.map, t.id);
397
394
  }).catch((f) => {
398
- const { onError: m } = t;
399
- m ? m({
395
+ const { onError: p } = t;
396
+ p ? p({
400
397
  type: "error",
401
398
  target: null,
402
399
  originalEvent: null,
403
400
  error: f
404
401
  }) : console.error(f);
405
402
  }), () => {
406
- h = !1, u && (e == null || e.onMapUnmount(t.id), t.reuseMaps ? u.recycle() : u.destroy());
403
+ m = !1, u && (e == null || e.onMapUnmount(t.id), t.reuseMaps ? u.recycle() : u.destroy());
407
404
  };
408
- }, []), tt(() => {
409
- r && r.setProps(t);
410
- }), T(n, () => s.map, [r]);
405
+ }, []), ot(() => {
406
+ i && i.setProps(t);
407
+ }), k(n, () => s.map, [i]);
411
408
  const a = x(() => ({
412
409
  position: "relative",
413
410
  width: "100%",
@@ -416,106 +413,119 @@ function nt(t, n) {
416
413
  }), [t.style]), c = {
417
414
  height: "100%"
418
415
  };
419
- return M.createElement("div", { id: t.id, ref: o, style: a }, r && M.createElement(
416
+ return M.createElement("div", { id: t.id, ref: o, style: a }, i && M.createElement(
420
417
  R.Provider,
421
418
  { value: s },
422
419
  M.createElement("div", { "mapboxgl-children": "", style: c }, t.children)
423
420
  ));
424
421
  }
425
- const ht = M.forwardRef(nt), ot = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
422
+ const yt = M.forwardRef(it), st = /box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;
426
423
  function C(t, n) {
427
424
  if (!t || !n)
428
425
  return;
429
426
  const e = t.style;
430
- for (const r in n) {
431
- const i = n[r];
432
- Number.isFinite(i) && !ot.test(r) ? e[r] = `${i}px` : e[r] = i;
427
+ for (const i in n) {
428
+ const r = n[i];
429
+ Number.isFinite(r) && !st.test(i) ? e[i] = `${r}px` : e[i] = r;
433
430
  }
434
431
  }
435
- const gt = _(k((t, n) => {
436
- const { map: e, mapLib: r } = w(R), i = b({ props: t });
437
- i.current.props = t;
438
- const o = x(() => {
439
- let N = !1;
432
+ function q(t, n) {
433
+ if (t === n)
434
+ return null;
435
+ const e = j(t), i = j(n), r = [];
436
+ for (const o of i)
437
+ e.has(o) || r.push(o);
438
+ for (const o of e)
439
+ i.has(o) || r.push(o);
440
+ return r.length === 0 ? null : r;
441
+ }
442
+ function j(t) {
443
+ return new Set(t ? t.trim().split(/\s+/) : []);
444
+ }
445
+ const vt = _(z((t, n) => {
446
+ const { map: e, mapLib: i } = w(R), r = b({ props: t }), o = x(() => {
447
+ let T = !1;
440
448
  M.Children.forEach(t.children, (v) => {
441
- v && (N = !0);
449
+ v && (T = !0);
442
450
  });
443
- const V = {
451
+ const G = {
444
452
  ...t,
445
- element: N ? document.createElement("div") : null
446
- }, S = new r.Marker(V);
453
+ element: T ? document.createElement("div") : void 0
454
+ }, S = new i.Marker(G);
447
455
  return S.setLngLat([t.longitude, t.latitude]), S.getElement().addEventListener("click", (v) => {
448
- var g, p;
449
- (p = (g = i.current.props).onClick) == null || p.call(g, {
456
+ var h, g;
457
+ (g = (h = r.current.props).onClick) == null || g.call(h, {
450
458
  type: "click",
451
459
  target: S,
452
460
  originalEvent: v
453
461
  });
454
462
  }), S.on("dragstart", (v) => {
455
- var p, L;
456
- const g = v;
457
- g.lngLat = o.getLngLat(), (L = (p = i.current.props).onDragStart) == null || L.call(p, g);
463
+ var g, L;
464
+ const h = v;
465
+ h.lngLat = o.getLngLat(), (L = (g = r.current.props).onDragStart) == null || L.call(g, h);
458
466
  }), S.on("drag", (v) => {
459
- var p, L;
460
- const g = v;
461
- g.lngLat = o.getLngLat(), (L = (p = i.current.props).onDrag) == null || L.call(p, g);
467
+ var g, L;
468
+ const h = v;
469
+ h.lngLat = o.getLngLat(), (L = (g = r.current.props).onDrag) == null || L.call(g, h);
462
470
  }), S.on("dragend", (v) => {
463
- var p, L;
464
- const g = v;
465
- g.lngLat = o.getLngLat(), (L = (p = i.current.props).onDragEnd) == null || L.call(p, g);
471
+ var g, L;
472
+ const h = v;
473
+ h.lngLat = o.getLngLat(), (L = (g = r.current.props).onDragEnd) == null || L.call(g, h);
466
474
  }), S;
467
475
  }, []);
468
476
  d(() => (o.addTo(e.getMap()), () => {
469
477
  o.remove();
470
478
  }), []);
471
- const { longitude: s, latitude: a, offset: c, style: l, draggable: h = !1, popup: u = null, rotation: f = 0, rotationAlignment: m = "auto", pitchAlignment: z = "auto" } = t;
472
- return d(() => {
479
+ const { longitude: s, latitude: a, offset: c, style: l, draggable: m = !1, popup: u = null, rotation: f = 0, rotationAlignment: p = "auto", pitchAlignment: N = "auto" } = t;
480
+ d(() => {
473
481
  C(o.getElement(), l);
474
- }, [l]), T(n, () => o, []), (o.getLngLat().lng !== s || o.getLngLat().lat !== a) && o.setLngLat([s, a]), c && !G(o.getOffset(), c) && o.setOffset(c), o.isDraggable() !== h && o.setDraggable(h), o.getRotation() !== f && o.setRotation(f), o.getRotationAlignment() !== m && o.setRotationAlignment(m), o.getPitchAlignment() !== z && o.setPitchAlignment(z), o.getPopup() !== u && o.setPopup(u), j(t.children, o.getElement());
475
- }));
476
- function Z(t) {
477
- return new Set(t ? t.trim().split(/\s+/) : []);
478
- }
479
- const pt = _(k((t, n) => {
480
- const { map: e, mapLib: r } = w(R), i = x(() => document.createElement("div"), []), o = b({ props: t });
481
- o.current.props = t;
482
- const s = x(() => {
483
- const a = { ...t }, c = new r.Popup(a);
482
+ }, [l]), k(n, () => o, []);
483
+ const B = r.current.props;
484
+ (o.getLngLat().lng !== s || o.getLngLat().lat !== a) && o.setLngLat([s, a]), c && !K(o.getOffset(), c) && o.setOffset(c), o.isDraggable() !== m && o.setDraggable(m), o.getRotation() !== f && o.setRotation(f), o.getRotationAlignment() !== p && o.setRotationAlignment(p), o.getPitchAlignment() !== N && o.setPitchAlignment(N), o.getPopup() !== u && o.setPopup(u);
485
+ const O = q(B.className, t.className);
486
+ if (O)
487
+ for (const T of O)
488
+ o.toggleClassName(T);
489
+ return r.current.props = t, H(t.children, o.getElement());
490
+ })), _t = _(z((t, n) => {
491
+ const { map: e, mapLib: i } = w(R), r = x(() => document.createElement("div"), []), o = b({ props: t }), s = x(() => {
492
+ const a = { ...t }, c = new i.Popup(a);
484
493
  return c.setLngLat([t.longitude, t.latitude]), c.once("open", (l) => {
485
- var h, u;
486
- (u = (h = o.current.props).onOpen) == null || u.call(h, l);
494
+ var m, u;
495
+ (u = (m = o.current.props).onOpen) == null || u.call(m, l);
487
496
  }), c;
488
497
  }, []);
489
498
  if (d(() => {
490
499
  const a = (c) => {
491
- var l, h;
492
- (h = (l = o.current.props).onClose) == null || h.call(l, c);
500
+ var l, m;
501
+ (m = (l = o.current.props).onClose) == null || m.call(l, c);
493
502
  };
494
- return s.on("close", a), s.setDOMContent(i).addTo(e.getMap()), () => {
503
+ return s.on("close", a), s.setDOMContent(r).addTo(e.getMap()), () => {
495
504
  s.off("close", a), s.isOpen() && s.remove();
496
505
  };
497
506
  }, []), d(() => {
498
507
  C(s.getElement(), t.style);
499
- }, [t.style]), T(n, () => s, []), s.isOpen() && ((s.getLngLat().lng !== t.longitude || s.getLngLat().lat !== t.latitude) && s.setLngLat([t.longitude, t.latitude]), t.offset && !y(s.options.offset, t.offset) && s.setOffset(t.offset), (s.options.anchor !== t.anchor || s.options.maxWidth !== t.maxWidth) && (s.options.anchor = t.anchor, s.setMaxWidth(t.maxWidth)), s.options.className !== t.className)) {
500
- const a = Z(s.options.className), c = Z(t.className);
501
- for (const l of a)
502
- c.has(l) || s.removeClassName(l);
503
- for (const l of c)
504
- a.has(l) || s.addClassName(l);
505
- s.options.className = t.className;
508
+ }, [t.style]), k(n, () => s, []), s.isOpen()) {
509
+ const a = o.current.props;
510
+ (s.getLngLat().lng !== t.longitude || s.getLngLat().lat !== t.latitude) && s.setLngLat([t.longitude, t.latitude]), t.offset && !y(a.offset, t.offset) && s.setOffset(t.offset), (a.anchor !== t.anchor || a.maxWidth !== t.maxWidth) && (s.options.anchor = t.anchor, s.setMaxWidth(t.maxWidth));
511
+ const c = q(a.className, t.className);
512
+ if (c)
513
+ for (const l of c)
514
+ s.toggleClassName(l);
515
+ o.current.props = t;
506
516
  }
507
- return j(t.children, i);
517
+ return H(t.children, r);
508
518
  }));
509
- function E(t, n, e, r) {
510
- const i = w(R), o = x(() => t(i), []);
519
+ function E(t, n, e, i) {
520
+ const r = w(R), o = x(() => t(r), []);
511
521
  return d(() => {
512
- const s = n, a = null, c = typeof n == "function" ? n : null, { map: l } = i;
513
- return l.hasControl(o) || (l.addControl(o, s == null ? void 0 : s.position), a && a(i)), () => {
514
- c && c(i), l.hasControl(o) && l.removeControl(o);
522
+ const s = n, a = null, c = typeof n == "function" ? n : null, { map: l } = r;
523
+ return l.hasControl(o) || (l.addControl(o, s == null ? void 0 : s.position), a && a(r)), () => {
524
+ c && c(r), l.hasControl(o) && l.removeControl(o);
515
525
  };
516
526
  }, []), o;
517
527
  }
518
- function it(t) {
528
+ function at(t) {
519
529
  const n = E(({ mapLib: e }) => new e.AttributionControl(t), {
520
530
  position: t.position
521
531
  });
@@ -523,8 +533,8 @@ function it(t) {
523
533
  C(n._container, t.style);
524
534
  }, [t.style]), null;
525
535
  }
526
- _(it);
527
- function rt(t) {
536
+ _(at);
537
+ function ct(t) {
528
538
  const n = E(({ mapLib: e }) => new e.FullscreenControl({
529
539
  container: t.containerId && document.getElementById(t.containerId)
530
540
  }), { position: t.position });
@@ -532,10 +542,10 @@ function rt(t) {
532
542
  C(n._controlContainer, t.style);
533
543
  }, [t.style]), null;
534
544
  }
535
- _(rt);
536
- function st(t, n) {
537
- const e = b({ props: t }), r = E(({ mapLib: i }) => {
538
- const o = new i.GeolocateControl(t), s = o._setupUI;
545
+ _(ct);
546
+ function lt(t, n) {
547
+ const e = b({ props: t }), i = E(({ mapLib: r }) => {
548
+ const o = new r.GeolocateControl(t), s = o._setupUI;
539
549
  return o._setupUI = () => {
540
550
  o._container.hasChildNodes() || s();
541
551
  }, o.on("geolocate", (a) => {
@@ -555,12 +565,12 @@ function st(t, n) {
555
565
  (l = (c = e.current.props).onTrackUserLocationEnd) == null || l.call(c, a);
556
566
  }), o;
557
567
  }, { position: t.position });
558
- return e.current.props = t, T(n, () => r, []), d(() => {
559
- C(r._container, t.style);
568
+ return e.current.props = t, k(n, () => i, []), d(() => {
569
+ C(i._container, t.style);
560
570
  }, [t.style]), null;
561
571
  }
562
- _(k(st));
563
- function at(t) {
572
+ _(z(lt));
573
+ function ut(t) {
564
574
  const n = E(({ mapLib: e }) => new e.NavigationControl(t), {
565
575
  position: t.position
566
576
  });
@@ -568,19 +578,19 @@ function at(t) {
568
578
  C(n._container, t.style);
569
579
  }, [t.style]), null;
570
580
  }
571
- const yt = _(at);
572
- function ct(t) {
581
+ const Ct = _(ut);
582
+ function dt(t) {
573
583
  const n = E(({ mapLib: o }) => new o.ScaleControl(t), {
574
584
  position: t.position
575
- }), e = b(t), r = e.current;
585
+ }), e = b(t), i = e.current;
576
586
  e.current = t;
577
- const { style: i } = t;
578
- return t.maxWidth !== void 0 && t.maxWidth !== r.maxWidth && (n.options.maxWidth = t.maxWidth), t.unit !== void 0 && t.unit !== r.unit && n.setUnit(t.unit), d(() => {
579
- C(n._container, i);
580
- }, [i]), null;
587
+ const { style: r } = t;
588
+ return t.maxWidth !== void 0 && t.maxWidth !== i.maxWidth && (n.options.maxWidth = t.maxWidth), t.unit !== void 0 && t.unit !== i.unit && n.setUnit(t.unit), d(() => {
589
+ C(n._container, r);
590
+ }, [r]), null;
581
591
  }
582
- _(ct);
583
- function lt(t) {
592
+ _(dt);
593
+ function ft(t) {
584
594
  const n = E(({ mapLib: e }) => new e.TerrainControl(t), {
585
595
  position: t.position
586
596
  });
@@ -588,20 +598,20 @@ function lt(t) {
588
598
  C(n._container, t.style);
589
599
  }, [t.style]), null;
590
600
  }
591
- _(lt);
592
- function ut(t) {
601
+ _(ft);
602
+ function mt(t) {
593
603
  const n = E(({ mapLib: e }) => new e.LogoControl(t), { position: t.position });
594
604
  return d(() => {
595
605
  C(n._container, t.style);
596
606
  }, [t.style]), null;
597
607
  }
598
- _(ut);
608
+ _(mt);
599
609
  export {
600
- ht as M,
601
- yt as N,
602
- pt as P,
603
- gt as a,
610
+ yt as M,
611
+ Ct as N,
612
+ _t as P,
613
+ vt as a,
604
614
  R as b,
605
615
  y as d,
606
- mt as u
616
+ pt as u
607
617
  };