@m4l/gclick 0.33.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/components/DevicesPicker/slots/DevicesPickerSlots.d.ts +2 -2
  2. package/components/ReportsViewer/subcomponents/ReportsViewerTabStrip/slots/ReportsViewerTabStripSlots.d.ts +1 -1
  3. package/components/ReportsViewer/subcomponents/ReportsViewerTabStrip/slots/ReportsViewerTabStripSlots.d.ts.map +1 -1
  4. package/components/TimelineCardsViewer/presets/journey/JourneyTimeline.styles.d.ts +1 -1
  5. package/components/VideoTimeLineSelector/slots/VideoTimeLineSelectorSlots.d.ts +2 -2
  6. package/components/maps/components/GpsMap/contexts/MapContext/helpers/createViewportNavigationRuntime.d.ts +13 -0
  7. package/components/maps/components/GpsMap/contexts/MapContext/helpers/createViewportNavigationRuntime.d.ts.map +1 -0
  8. package/components/maps/components/GpsMap/contexts/MapContext/helpers/createViewportNavigationRuntime.js +96 -0
  9. package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts +9 -0
  10. package/components/maps/components/GpsMap/contexts/MapContext/helpers/helpers.d.ts.map +1 -1
  11. package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts +1 -1
  12. package/components/maps/components/GpsMap/contexts/MapContext/index.d.ts.map +1 -1
  13. package/components/maps/components/GpsMap/contexts/MapContext/store.d.ts.map +1 -1
  14. package/components/maps/components/GpsMap/contexts/MapContext/store.js +214 -189
  15. package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts +36 -1
  16. package/components/maps/components/GpsMap/contexts/MapContext/types.d.ts.map +1 -1
  17. package/components/maps/components/GpsMap/dictionary.d.ts +10 -0
  18. package/components/maps/components/GpsMap/dictionary.d.ts.map +1 -1
  19. package/components/maps/components/GpsMap/dictionary.js +10 -0
  20. package/components/maps/components/GpsMap/featureRenders/MyPositionFeatureRender/MyPositionFeatureRender.d.ts +4 -0
  21. package/components/maps/components/GpsMap/featureRenders/MyPositionFeatureRender/MyPositionFeatureRender.d.ts.map +1 -0
  22. package/components/maps/components/GpsMap/featureRenders/MyPositionFeatureRender/MyPositionFeatureRender.js +56 -0
  23. package/components/maps/components/GpsMap/hooks/index.d.ts +1 -0
  24. package/components/maps/components/GpsMap/hooks/index.d.ts.map +1 -1
  25. package/components/maps/components/GpsMap/hooks/useMapCameraSignal.d.ts +4 -0
  26. package/components/maps/components/GpsMap/hooks/useMapCameraSignal.d.ts.map +1 -0
  27. package/components/maps/components/GpsMap/hooks/useMapCameraSignal.js +11 -0
  28. package/components/maps/components/GpsMap/index.d.ts +1 -0
  29. package/components/maps/components/GpsMap/index.d.ts.map +1 -1
  30. package/components/maps/components/GpsMap/slots/styled.d.ts +1 -1
  31. package/components/maps/components/GpsMap/subcomponents/Controls/hooks/useControls.d.ts +5 -4
  32. package/components/maps/components/GpsMap/subcomponents/Controls/hooks/useControls.d.ts.map +1 -1
  33. package/components/maps/components/GpsMap/subcomponents/Controls/hooks/useControls.js +9 -8
  34. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/constants.d.ts +2 -1
  35. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/constants.d.ts.map +1 -1
  36. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/constants.js +24 -17
  37. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/hooks/usePopupToolRuntime.d.ts.map +1 -1
  38. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/hooks/usePopupToolRuntime.js +43 -40
  39. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.d.ts +1 -1
  40. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.d.ts.map +1 -1
  41. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MeasureTool/subcomponents/MyActions/MyActions.js +26 -24
  42. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/MyPositionTool.d.ts +3 -0
  43. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/MyPositionTool.d.ts.map +1 -0
  44. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/MyPositionTool.js +38 -0
  45. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/constants.d.ts +12 -0
  46. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/constants.d.ts.map +1 -0
  47. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/constants.js +39 -0
  48. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/createMyPositionSession.d.ts +4 -0
  49. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/createMyPositionSession.d.ts.map +1 -0
  50. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/createMyPositionSession.js +128 -0
  51. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/labels.d.ts +4 -0
  52. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/labels.d.ts.map +1 -0
  53. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/labels.js +10 -0
  54. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/types.d.ts +20 -0
  55. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/types.d.ts.map +1 -0
  56. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/useMyPositionTool.d.ts +10 -0
  57. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/useMyPositionTool.d.ts.map +1 -0
  58. package/components/maps/components/GpsMap/subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MyPositionTool/useMyPositionTool.js +39 -0
  59. package/components/maps/components/GpsMap/types.d.ts +1 -1
  60. package/components/maps/components/GpsMap/types.d.ts.map +1 -1
  61. package/index.js +303 -296
  62. package/package.json +1 -1
@@ -1,28 +1,29 @@
1
- import { createStore as Y } from "zustand";
2
- import { immer as K } from "zustand/middleware/immer";
3
- import { INTERACTION_CHANNELS as D } from "./types.js";
4
- import { createDevtools as Q, isValidViewportBounds as U, createViewportActionResult as h, resolveMoveToBoundsOptions as X, getAllowedViewportMap as C, runViewportActionSafely as T, isValidViewportPoint as M, resolveSmartMoveToPointOptions as ee, resolveMoveToPointOptions as re, areInteractionChannelsAvailable as P, releaseOwnedInteractionChannels as R, invalidateViewportSizeIfNeeded as E, isBoundsViewportAlreadyApplied as te, isPointViewportAlreadyApplied as J } from "./helpers/helpers.js";
5
- import { runToolCommand as j, unregisterToolController as ae, registerToolController as oe } from "./helpers/toolControllerRegistry.js";
6
- import I from "lodash-es/cloneDeep";
7
- import N from "lodash-es/merge";
8
- import { TILE_LAYER_OTHERS as ne } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/others.js";
9
- import { TILE_SORCE_GOOGLE as se } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/google.js";
10
- import { TILE_LAYER_BING as ue } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/bing.js";
11
- import { refreshLayerDataBounds as O, areLayerDataBoundsEqual as W } from "./helpers/layerDataBounds.js";
12
- import { getFeatureFromLayer as x, syncLayerFeatureIndex as b, getFeatureCollectionFeatureIndex as V, createFeatureIndexKey as k } from "./helpers/featureLookup.js";
13
- import { normalizeLayerClusterState as G } from "./helpers/layerClusterState.js";
14
- import { resolveObservableFeatureSnapTarget as ie, resolveObservableFeaturePick as de, resolveObservableFeatureAnchor as le, isObservableFeatureEventEnabled as ce } from "./helpers/featureObservability.js";
15
- import { sanitizeLayerFeatureCollectionGeoJsonObject as z, isLeafletSafePointGeometry as fe, sanitizeFeatureCollectionGeoJsonObject as Z } from "./helpers/pointGeometryRuntime.js";
16
- function pe(d, s, y) {
17
- const c = N({}, d ?? {}, s);
1
+ import { createStore as K } from "zustand";
2
+ import { immer as Q } from "zustand/middleware/immer";
3
+ import { INTERACTION_CHANNELS as V } from "./types.js";
4
+ import { createViewportNavigationRuntime as U } from "./helpers/createViewportNavigationRuntime.js";
5
+ import { createDevtools as X, isValidViewportBounds as ee, createViewportActionResult as h, resolveMoveToBoundsOptions as re, getAllowedViewportMap as T, runViewportActionSafely as g, isValidViewportPoint as D, resolveSmartMoveToPointOptions as te, resolveMoveToPointOptions as oe, areInteractionChannelsAvailable as M, releaseOwnedInteractionChannels as P, invalidateViewportSizeIfNeeded as j, isBoundsViewportAlreadyApplied as ae, isPointViewportAlreadyApplied as J } from "./helpers/helpers.js";
6
+ import { runToolCommand as E, resolveToolController as ne, unregisterToolController as se, registerToolController as ie } from "./helpers/toolControllerRegistry.js";
7
+ import B from "lodash-es/cloneDeep";
8
+ import W from "lodash-es/merge";
9
+ import { TILE_LAYER_OTHERS as ue } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/others.js";
10
+ import { TILE_SORCE_GOOGLE as de } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/google.js";
11
+ import { TILE_LAYER_BING as le } from "../../subcomponents/Controls/subcomponents/ButtonsToolsList/subcomponents/MapSourcesTool/sourceTypes/bing.js";
12
+ import { refreshLayerDataBounds as b, areLayerDataBoundsEqual as k } from "./helpers/layerDataBounds.js";
13
+ import { getFeatureFromLayer as x, syncLayerFeatureIndex as w, getFeatureCollectionFeatureIndex as G, createFeatureIndexKey as H } from "./helpers/featureLookup.js";
14
+ import { normalizeLayerClusterState as z } from "./helpers/layerClusterState.js";
15
+ import { resolveObservableFeatureSnapTarget as ce, resolveObservableFeaturePick as fe, resolveObservableFeatureAnchor as pe, isObservableFeatureEventEnabled as he } from "./helpers/featureObservability.js";
16
+ import { sanitizeLayerFeatureCollectionGeoJsonObject as _, isLeafletSafePointGeometry as ye, sanitizeFeatureCollectionGeoJsonObject as Z } from "./helpers/pointGeometryRuntime.js";
17
+ function me(d, u, y) {
18
+ const c = W({}, d ?? {}, u);
18
19
  return y?.length && y.forEach((f) => {
19
- if (Object.prototype.hasOwnProperty.call(s, f)) {
20
- const v = s[f];
21
- if (v === void 0) {
20
+ if (Object.prototype.hasOwnProperty.call(u, f)) {
21
+ const O = u[f];
22
+ if (O === void 0) {
22
23
  delete c[f];
23
24
  return;
24
25
  }
25
- c[f] = I(v);
26
+ c[f] = B(O);
26
27
  return;
27
28
  }
28
29
  delete c[f];
@@ -30,30 +31,30 @@ function pe(d, s, y) {
30
31
  }
31
32
  function q(d) {
32
33
  const {
33
- hadExistingFeature: s,
34
+ hadExistingFeature: u,
34
35
  previousGeometryType: y,
35
36
  nextGeometryType: c,
36
37
  previousDataBoundsOverride: f,
37
- nextDataBoundsOverride: v
38
+ nextDataBoundsOverride: O
38
39
  } = d;
39
- return !W(f, v) || !s ? !0 : y !== "Point" || c !== "Point";
40
+ return !k(f, O) || !u ? !0 : y !== "Point" || c !== "Point";
40
41
  }
41
- function _(d) {
42
- return d.reduce((s, y) => (s[k(y)] = !0, s), {});
42
+ function N(d) {
43
+ return d.reduce((u, y) => (u[H(y)] = !0, u), {});
43
44
  }
44
- function $(d, s) {
45
- return d.length !== s.length ? !1 : d.every((y, c) => y === s[c]);
45
+ function $(d, u) {
46
+ return d.length !== u.length ? !1 : d.every((y, c) => y === u[c]);
46
47
  }
47
- function he(d, s) {
48
- return !d || d.featureCount !== s.featureCount || d.bufferedFeatureCount !== s.bufferedFeatureCount || d.bufferedViewportPx !== s.bufferedViewportPx || d.zoom !== s.zoom ? !1 : $(d.featureIds, s.featureIds) && $(d.bufferedFeatureIds, s.bufferedFeatureIds);
48
+ function ve(d, u) {
49
+ return !d || d.featureCount !== u.featureCount || d.bufferedFeatureCount !== u.bufferedFeatureCount || d.bufferedViewportPx !== u.bufferedViewportPx || d.zoom !== u.zoom ? !1 : $(d.featureIds, u.featureIds) && $(d.bufferedFeatureIds, u.bufferedFeatureIds);
49
50
  }
50
- const xe = (d, s = !1) => {
51
+ const Ve = (d, u = !1) => {
51
52
  const y = {
52
53
  currentMapSourceLayer: {
53
54
  mapSourceId: "google",
54
55
  mapSourceLayerId: "streets"
55
56
  },
56
- mapSources: [se, ue, ne],
57
+ mapSources: [de, le, ue],
57
58
  layersIds: [],
58
59
  hashLayers: {},
59
60
  autoFocusLayers: !0,
@@ -65,27 +66,28 @@ const xe = (d, s = !1) => {
65
66
  ...d
66
67
  };
67
68
  let c = null;
68
- const f = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
69
- let S = 0;
70
- return Y(
71
- Q(
72
- K((u, i) => ({
69
+ const f = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Map();
70
+ let A = 0;
71
+ const m = U();
72
+ return K(
73
+ X(
74
+ Q((i, s) => ({
73
75
  ...y,
74
76
  mapActions: {
75
77
  /**
76
78
  * TODO: Documentar
77
79
  */
78
80
  init: (e) => {
79
- u((t) => {
81
+ i((t) => {
80
82
  for (let r = 0; r < e.length; r++)
81
- t.hashLayers[e[r].layerId] = I(e[r]), z(t.hashLayers[e[r].layerId]), G(t.hashLayers[e[r].layerId]), b(t.hashLayers[e[r].layerId]), O(t.hashLayers[e[r].layerId]), t.layersIds.push(e[r].layerId);
83
+ t.hashLayers[e[r].layerId] = B(e[r]), _(t.hashLayers[e[r].layerId]), z(t.hashLayers[e[r].layerId]), w(t.hashLayers[e[r].layerId]), b(t.hashLayers[e[r].layerId]), t.layersIds.push(e[r].layerId);
82
84
  });
83
85
  },
84
86
  /**
85
87
  * Actualiza el ref del mapa
86
88
  */
87
89
  setMapRef: (e) => {
88
- c = e;
90
+ c !== e && m.dispose(), c = e;
89
91
  },
90
92
  /**
91
93
  * Retorna el ref del mapa
@@ -95,7 +97,7 @@ const xe = (d, s = !1) => {
95
97
  * Actualiza la información transversal a todas las capas.
96
98
  */
97
99
  setMapData: (e) => {
98
- u((t) => {
100
+ i((t) => {
99
101
  t.hasMapData = { ...t.hasMapData, ...e };
100
102
  });
101
103
  },
@@ -103,113 +105,113 @@ const xe = (d, s = !1) => {
103
105
  * Modifica toda la capa, reemplanzando todo el geoJson
104
106
  */
105
107
  setDataLayer: (e, t, r) => {
106
- if (!i().hashLayers[e])
108
+ if (!s().hashLayers[e])
107
109
  throw new Error(`Layer with id ${e} not found`);
108
- u((a) => {
109
- const o = a.hashLayers[e];
110
- o.geoJsonObject = Z(t), o.dataBoundsOverride = r?.dataBoundsOverride, b(o), O(o);
110
+ i((o) => {
111
+ const a = o.hashLayers[e];
112
+ a.geoJsonObject = Z(t), a.dataBoundsOverride = r?.dataBoundsOverride, w(a), b(a);
111
113
  });
112
114
  },
113
115
  /**
114
116
  * Modifica la capa, mezclando el geoJson actual con el nuevo
115
117
  */
116
118
  mergeDataLayer: (e, t, r) => {
117
- if (!i().hashLayers[e])
119
+ if (!s().hashLayers[e])
118
120
  throw new Error(`Layer with id ${e} not found`);
119
- u((a) => {
120
- const o = a.hashLayers[e];
121
- o.geoJsonObject = Z(
122
- N(o.geoJsonObject, t)
123
- ), o.dataBoundsOverride = r?.dataBoundsOverride, b(o), O(o);
121
+ i((o) => {
122
+ const a = o.hashLayers[e];
123
+ a.geoJsonObject = Z(
124
+ W(a.geoJsonObject, t)
125
+ ), a.dataBoundsOverride = r?.dataBoundsOverride, w(a), b(a);
124
126
  });
125
127
  },
126
128
  /**
127
129
  * TODO: Documentar
128
130
  */
129
131
  getFeatureIds: (e) => {
130
- if (!i().hashLayers[e])
132
+ if (!s().hashLayers[e])
131
133
  throw new Error(`Layer with id ${e} not found`);
132
- const t = i().hashLayers[e]?.geoJsonObject;
134
+ const t = s().hashLayers[e]?.geoJsonObject;
133
135
  return t && t.object.type === "Feature" ? [t.object.id] : t && t.object.type === "FeatureCollection" ? t.object.features.map((r) => r.id) : [];
134
136
  },
135
137
  /**
136
138
  * TODO: Documentar
137
139
  */
138
- setFeatureData: (e, t, r, a, o, n) => {
139
- if (!i().hashLayers[e])
140
+ setFeatureData: (e, t, r, o, a, n) => {
141
+ if (!s().hashLayers[e])
140
142
  throw new Error(`Layer with id ${e} not found`);
141
- u((p) => {
142
- const l = p.hashLayers[e], w = l.dataBoundsOverride;
143
- let m = !W(
144
- w,
143
+ i((p) => {
144
+ const l = p.hashLayers[e], I = l.dataBoundsOverride;
145
+ let v = !k(
146
+ I,
145
147
  n?.dataBoundsOverride
146
148
  );
147
- const A = r.type === "Point" && !fe(r);
149
+ const R = r.type === "Point" && !ye(r);
148
150
  if (l.geoJsonObject?.object.type === "FeatureCollection") {
149
- const L = l.geoJsonObject?.object, B = V(l, t), g = typeof B == "number";
150
- let F = g ? L.features[B] : void 0;
151
- const H = F?.geometry?.type;
152
- if (A) {
153
- g && (L.features.splice(B, 1), b(l), m = !0, p.selectedFeature?.layerId === e && p.selectedFeature.featureId === t && (p.selectedFeature = null)), l.dataBoundsOverride = n?.dataBoundsOverride, m && O(l);
151
+ const L = l.geoJsonObject?.object, C = G(l, t), S = typeof C == "number";
152
+ let F = S ? L.features[C] : void 0;
153
+ const Y = F?.geometry?.type;
154
+ if (R) {
155
+ S && (L.features.splice(C, 1), w(l), v = !0, p.selectedFeature?.layerId === e && p.selectedFeature.featureId === t && (p.selectedFeature = null)), l.dataBoundsOverride = n?.dataBoundsOverride, v && b(l);
154
156
  return;
155
157
  }
156
- F ? (F.geometry = I(r), F.properties = pe(
158
+ F ? (F.geometry = B(r), F.properties = me(
157
159
  F.properties,
158
- a,
160
+ o,
159
161
  n?.replacePropertyKeys
160
162
  )) : (F = {
161
163
  type: "Feature",
162
164
  geometry: r,
163
165
  id: t,
164
- properties: a
165
- }, L.features.push(F), l.featureIndexById ??= {}, l.featureIndexById[k(t)] = L.features.length - 1), m = q({
166
- hadExistingFeature: g,
167
- previousGeometryType: H,
166
+ properties: o
167
+ }, L.features.push(F), l.featureIndexById ??= {}, l.featureIndexById[H(t)] = L.features.length - 1), v = q({
168
+ hadExistingFeature: S,
169
+ previousGeometryType: Y,
168
170
  nextGeometryType: r.type,
169
- previousDataBoundsOverride: w,
171
+ previousDataBoundsOverride: I,
170
172
  nextDataBoundsOverride: n?.dataBoundsOverride
171
173
  });
172
174
  } else if (l.geoJsonObject?.object.type === "Feature") {
173
- const L = l.geoJsonObject?.object, B = L.geometry?.type;
174
- if (A) {
175
- l.dataBoundsOverride = n?.dataBoundsOverride, m && O(l);
175
+ const L = l.geoJsonObject?.object, C = L.geometry?.type;
176
+ if (R) {
177
+ l.dataBoundsOverride = n?.dataBoundsOverride, v && b(l);
176
178
  return;
177
179
  }
178
- L.id = t, L.geometry = I(r), L.properties = I(a), b(l), m = q({
180
+ L.id = t, L.geometry = B(r), L.properties = B(o), w(l), v = q({
179
181
  hadExistingFeature: !0,
180
- previousGeometryType: B,
182
+ previousGeometryType: C,
181
183
  nextGeometryType: r.type,
182
- previousDataBoundsOverride: w,
184
+ previousDataBoundsOverride: I,
183
185
  nextDataBoundsOverride: n?.dataBoundsOverride
184
186
  });
185
187
  }
186
- l.dataBoundsOverride = n?.dataBoundsOverride, m && O(l);
188
+ l.dataBoundsOverride = n?.dataBoundsOverride, v && b(l);
187
189
  });
188
190
  },
189
191
  /**
190
192
  * TODO: Documentar
191
193
  */
192
194
  removeFeature: (e, t) => {
193
- if (!i().hashLayers[e])
195
+ if (!s().hashLayers[e])
194
196
  throw new Error(`Layer with id ${e} not found`);
195
- u((r) => {
196
- const a = r.hashLayers[e];
197
- let o = !1;
198
- if (a.geoJsonObject?.object.type === "FeatureCollection") {
199
- const n = a.geoJsonObject?.object, p = V(a, t);
200
- typeof p == "number" && (n.features.splice(p, 1), b(a), o = !0);
201
- } else if (a.geoJsonObject?.object.type === "Feature") {
202
- const n = a.geoJsonObject?.object;
203
- n.geometry = { type: "Point", coordinates: [0, 0] }, n.properties = { subType: "Marker" }, b(a), o = !0;
197
+ i((r) => {
198
+ const o = r.hashLayers[e];
199
+ let a = !1;
200
+ if (o.geoJsonObject?.object.type === "FeatureCollection") {
201
+ const n = o.geoJsonObject?.object, p = G(o, t);
202
+ typeof p == "number" && (n.features.splice(p, 1), w(o), a = !0);
203
+ } else if (o.geoJsonObject?.object.type === "Feature") {
204
+ const n = o.geoJsonObject?.object;
205
+ n.geometry = { type: "Point", coordinates: [0, 0] }, n.properties = { subType: "Marker" }, w(o), a = !0;
204
206
  }
205
- r.selectedFeature?.layerId === e && r.selectedFeature.featureId === t && (r.selectedFeature = null), o && O(a);
207
+ r.selectedFeature?.layerId === e && r.selectedFeature.featureId === t && (r.selectedFeature = null), a && b(o);
206
208
  });
207
209
  },
208
210
  /**
209
211
  * TODO: Documentar
210
212
  */
211
213
  setLayerRenderProp: (e, t) => {
212
- u((r) => {
214
+ i((r) => {
213
215
  r.hashLayers[e].renderFeature = t;
214
216
  });
215
217
  },
@@ -217,17 +219,17 @@ const xe = (d, s = !1) => {
217
219
  * Stores one reactive snapshot of the features currently rendered for the layer.
218
220
  */
219
221
  setLayerRenderedFeatureSnapshot: (e, t) => {
220
- i().hashLayers[e] && u((r) => {
221
- const a = r.hashLayers[e];
222
- he(
223
- a.renderedFeatureSnapshot,
222
+ s().hashLayers[e] && i((r) => {
223
+ const o = r.hashLayers[e];
224
+ ve(
225
+ o.renderedFeatureSnapshot,
224
226
  t
225
- ) || (a.renderedFeatureSnapshot = {
227
+ ) || (o.renderedFeatureSnapshot = {
226
228
  ...t,
227
229
  bufferedFeatureIds: [...t.bufferedFeatureIds],
228
- bufferedFeatureIdsLookup: _(t.bufferedFeatureIds),
230
+ bufferedFeatureIdsLookup: N(t.bufferedFeatureIds),
229
231
  featureIds: [...t.featureIds],
230
- featureIdsLookup: _(t.featureIds)
232
+ featureIdsLookup: N(t.featureIds)
231
233
  });
232
234
  });
233
235
  },
@@ -235,17 +237,24 @@ const xe = (d, s = !1) => {
235
237
  * TODO: Documentar
236
238
  */
237
239
  addLayer: (e) => {
238
- if (i().hashLayers[e.layerId])
240
+ if (s().hashLayers[e.layerId])
239
241
  throw new Error(`Layer with id ${e.layerId} already exists`);
240
- u((t) => {
241
- t.hashLayers[e.layerId] = I(e), z(t.hashLayers[e.layerId]), b(t.hashLayers[e.layerId]), O(t.hashLayers[e.layerId]), t.layersIds.push(e.layerId), e.visible !== !1 && (t.hashLayers[e.layerId].visible = !0), e.autoFocus !== !1 && (t.hashLayers[e.layerId].autoFocus = !0), G(t.hashLayers[e.layerId]);
242
+ i((t) => {
243
+ t.hashLayers[e.layerId] = B(e), _(t.hashLayers[e.layerId]), w(t.hashLayers[e.layerId]), b(t.hashLayers[e.layerId]), t.layersIds.push(e.layerId), e.visible !== !1 && (t.hashLayers[e.layerId].visible = !0), e.autoFocus !== !1 && (t.hashLayers[e.layerId].autoFocus = !0), z(t.hashLayers[e.layerId]);
244
+ });
245
+ },
246
+ /** Update only the translated layer name, preserving its runtime data. */
247
+ setLayerName: (e, t) => {
248
+ i((r) => {
249
+ const o = r.hashLayers[e];
250
+ o && (o.name = t);
242
251
  });
243
252
  },
244
253
  /**
245
254
  * TODO: Documentar
246
255
  */
247
256
  removeLayer: (e) => {
248
- i().hashLayers[e] && u((t) => {
257
+ s().hashLayers[e] && i((t) => {
249
258
  t.layersIds.splice(t.layersIds.indexOf(e), 1), delete t.hashLayers[e], t.selectedFeature?.layerId === e && (t.selectedFeature = null);
250
259
  });
251
260
  },
@@ -253,13 +262,13 @@ const xe = (d, s = !1) => {
253
262
  * Stores external feature-selection intent so renderers can react declaratively.
254
263
  */
255
264
  selectFeature: (e, t, r) => {
256
- u((a) => {
257
- a.selectedFeature = {
265
+ i((o) => {
266
+ o.selectedFeature = {
258
267
  layerId: e,
259
268
  featureId: t,
260
269
  openPopup: r?.openPopup ?? !1,
261
270
  source: r?.source ?? "external",
262
- requestId: (a.selectedFeature?.requestId ?? 0) + 1
271
+ requestId: (o.selectedFeature?.requestId ?? 0) + 1
263
272
  };
264
273
  });
265
274
  },
@@ -267,7 +276,7 @@ const xe = (d, s = !1) => {
267
276
  * Clears external feature-selection intent.
268
277
  */
269
278
  clearSelectedFeature: () => {
270
- u((e) => {
279
+ i((e) => {
271
280
  e.selectedFeature = null;
272
281
  });
273
282
  },
@@ -275,21 +284,21 @@ const xe = (d, s = !1) => {
275
284
  * Dispatches one normalized observable-feature event to registered consumers.
276
285
  */
277
286
  dispatchObservableFeatureEvent: (e) => {
278
- const t = i().hashLayers[e.layerId];
279
- if (!ce(t, e.type))
287
+ const t = s().hashLayers[e.layerId];
288
+ if (!he(t, e.type))
280
289
  return !1;
281
290
  let r = !1;
282
- return v.forEach(({ consumer: a, options: o }) => {
283
- a(e), o?.captureOriginalEvent && (o.eventTypes && !o.eventTypes.includes(e.type) || (r = !0));
291
+ return O.forEach(({ consumer: o, options: a }) => {
292
+ a?.eventTypes && !a.eventTypes.includes(e.type) || (o(e), a?.captureOriginalEvent && (r = !0));
284
293
  }), r;
285
294
  },
286
295
  /**
287
296
  * Registers one observable-feature consumer callback.
288
297
  */
289
298
  subscribeObservableFeatureEvents: (e, t) => {
290
- S += 1;
291
- const r = `observable-feature-consumer-${S}`;
292
- return v.set(r, {
299
+ A += 1;
300
+ const r = `observable-feature-consumer-${A}`;
301
+ return O.set(r, {
293
302
  consumer: e,
294
303
  options: t
295
304
  }), r;
@@ -298,20 +307,20 @@ const xe = (d, s = !1) => {
298
307
  * Removes one observable-feature consumer callback.
299
308
  */
300
309
  unsubscribeObservableFeatureEvents: (e) => {
301
- v.delete(e);
310
+ O.delete(e);
302
311
  },
303
312
  /**
304
313
  * Resolves one normalized anchor for an observable feature.
305
314
  */
306
315
  resolveObservableFeatureAnchor: (e, t, r) => {
307
- const a = i().hashLayers[e];
308
- if (!a)
316
+ const o = s().hashLayers[e];
317
+ if (!o)
309
318
  return;
310
- const o = x(a, t);
311
- if (o)
312
- return le(
313
- a,
319
+ const a = x(o, t);
320
+ if (a)
321
+ return pe(
314
322
  o,
323
+ a,
315
324
  r?.purpose
316
325
  );
317
326
  },
@@ -319,197 +328,213 @@ const xe = (d, s = !1) => {
319
328
  * Resolves one normalized pick payload from an observable feature event.
320
329
  */
321
330
  resolveObservableFeaturePick: (e, t) => {
322
- const r = i().hashLayers[e.layerId];
331
+ const r = s().hashLayers[e.layerId];
323
332
  if (!r)
324
333
  return;
325
- const a = x(r, e.featureId);
326
- if (a)
327
- return de(r, a, e, t?.purpose);
334
+ const o = x(r, e.featureId);
335
+ if (o)
336
+ return fe(r, o, e, t?.purpose);
328
337
  },
329
338
  /**
330
339
  * Resolves one normalized snap target for an observable feature.
331
340
  */
332
341
  resolveObservableFeatureSnapTarget: (e, t) => {
333
- const r = i().hashLayers[e];
342
+ const r = s().hashLayers[e];
334
343
  if (!r)
335
344
  return;
336
- const a = x(r, t);
337
- if (a)
338
- return ie(r, a);
345
+ const o = x(r, t);
346
+ if (o)
347
+ return ce(r, o);
339
348
  },
340
349
  /**
341
350
  * Atomically captures one or more interaction channels for an owner.
342
351
  */
343
- requestInteractionCapture: (e, t) => t.length === 0 ? !0 : P(i().interactionOwnership, t, e) ? (u((r) => {
344
- t.forEach((a) => {
345
- const n = r.interactionOwnership.ownersByChannel[a] === e ? r.interactionOwnership.captureDepthByChannel?.[a] ?? 1 : 0;
346
- r.interactionOwnership.ownersByChannel[a] = e, r.interactionOwnership.captureDepthByChannel = {
352
+ requestInteractionCapture: (e, t) => t.length === 0 ? !0 : M(s().interactionOwnership, t, e) ? (t.includes("viewport_control") && s().interactionOwnership.ownersByChannel.viewport_control !== e && m.invalidate(), i((r) => {
353
+ t.forEach((o) => {
354
+ const n = r.interactionOwnership.ownersByChannel[o] === e ? r.interactionOwnership.captureDepthByChannel?.[o] ?? 1 : 0;
355
+ r.interactionOwnership.ownersByChannel[o] = e, r.interactionOwnership.captureDepthByChannel = {
347
356
  ...r.interactionOwnership.captureDepthByChannel,
348
- [a]: n + 1
357
+ [o]: n + 1
349
358
  };
350
359
  });
351
360
  }), !0) : !1,
352
361
  /**
353
362
  * Releases one or more channels for the owner that currently holds them.
354
363
  */
355
- releaseInteractionCapture: (e, t = D.slice()) => {
356
- u((r) => {
357
- R(r.interactionOwnership, e, t);
364
+ releaseInteractionCapture: (e, t = V.slice()) => {
365
+ i((r) => {
366
+ P(r.interactionOwnership, e, t);
358
367
  });
359
368
  },
360
369
  /**
361
370
  * Releases every channel currently owned by the given owner.
362
371
  */
363
372
  releaseAllInteractionCapture: (e) => {
364
- u((t) => {
365
- R(
373
+ i((t) => {
374
+ P(
366
375
  t.interactionOwnership,
367
376
  e,
368
- D.slice()
377
+ V.slice()
369
378
  );
370
379
  });
371
380
  },
372
381
  /**
373
382
  * Returns whether all requested channels are currently available.
374
383
  */
375
- isInteractionAvailable: (e, t) => P(i().interactionOwnership, e, t),
384
+ isInteractionAvailable: (e, t) => M(s().interactionOwnership, e, t),
376
385
  /**
377
386
  * Returns the current owner for the requested interaction channel.
378
387
  */
379
- getInteractionOwner: (e) => i().interactionOwnership.ownersByChannel[e],
388
+ getInteractionOwner: (e) => s().interactionOwnership.ownersByChannel[e],
380
389
  /**
381
390
  * Invalidates the current viewport size through the host API.
382
391
  */
383
392
  invalidateViewportSize: (e = {}) => {
384
- const { map: t, result: r } = C(
393
+ const { map: t, result: r } = T(
385
394
  c,
386
- i().interactionOwnership,
395
+ s().interactionOwnership,
387
396
  e.ownerId
388
397
  );
389
- return t ? T(() => (t.invalidateSize(), h("success"))) : r;
390
- },
391
- /**
392
- * Moves the viewport to one serializable point.
393
- */
398
+ return t ? g(() => (t.invalidateSize(), h("success"))) : r;
399
+ },
400
+ /** Subscribe to accepted camera intents for this map instance. */
401
+ subscribeCameraSignals: m.subscribe,
402
+ /** Request conditional restoration without making any consumer follow decision. */
403
+ requestAutofollowResume: m.requestAutofollowResume,
404
+ /** Read the latest foreground navigation revision. */
405
+ getViewportRevision: m.getRevision,
406
+ /** Cancel only this owner's tracked camera request. */
407
+ cancelViewportAction: m.cancel,
408
+ /** Moves the viewport to one serializable point. */
394
409
  moveToPoint: (e, t = {}) => {
395
- if (!M(e))
410
+ if (!D(e))
396
411
  return h("invalid-target");
397
- const r = re(t), { map: a, result: o } = C(
412
+ const r = oe(t), { map: o, result: a } = T(
398
413
  c,
399
- i().interactionOwnership,
414
+ s().interactionOwnership,
400
415
  r.ownerId,
401
416
  r.force
402
417
  );
403
- return a ? T(() => (E(a, r), J(
404
- a,
418
+ return o ? g(() => (j(o, r), m.run(o, r, () => J(
419
+ o,
405
420
  e,
406
421
  r.mode === "fly" ? r.zoom : void 0
407
- ) ? h("noop") : r.mode === "fly" ? (a.flyTo([e.lat, e.lng], r.zoom ?? a.getZoom(), {
422
+ ) ? h("noop") : r.mode === "fly" ? (o.flyTo([e.lat, e.lng], r.zoom ?? o.getZoom(), {
408
423
  animate: r.animate,
409
424
  duration: r.duration
410
- }), h("success")) : (a.panTo([e.lat, e.lng], {
425
+ }), h("success")) : (o.panTo([e.lat, e.lng], {
411
426
  animate: r.animate,
412
427
  duration: r.duration
413
- }), h("success")))) : o;
428
+ }), h("success"))))) : a;
414
429
  },
415
430
  /**
416
431
  * Uses the shared zoom heuristic to decide between pan and fly.
417
432
  */
418
433
  smartMoveToPoint: (e, t = {}) => {
419
- if (!M(e))
434
+ if (!D(e))
420
435
  return h("invalid-target");
421
- const r = ee(t), { map: a, result: o } = C(
436
+ const r = te(t), { map: o, result: a } = T(
422
437
  c,
423
- i().interactionOwnership,
438
+ s().interactionOwnership,
424
439
  r.ownerId,
425
440
  r.force
426
441
  );
427
- return a ? T(() => {
428
- E(a, r);
429
- const n = r.minZoom, p = r.zoomThreshold, l = a.getZoom(), w = l >= n - p, m = w ? void 0 : Math.max(l, n);
430
- return J(a, e, m) ? h("noop") : w ? (a.panTo([e.lat, e.lng], {
442
+ return o ? g(() => (j(o, r), m.run(o, r, () => {
443
+ const n = r.minZoom, p = r.zoomThreshold, l = o.getZoom(), I = l >= n - p, v = I ? void 0 : Math.max(l, n);
444
+ return J(o, e, v) ? h("noop") : I ? (o.panTo([e.lat, e.lng], {
431
445
  animate: r.animate,
432
446
  duration: r.duration
433
- }), h("success")) : (a.flyTo([e.lat, e.lng], m, {
447
+ }), h("success")) : (o.flyTo([e.lat, e.lng], v, {
434
448
  animate: r.animate,
435
449
  duration: r.duration
436
450
  }), h("success"));
437
- }) : o;
451
+ }))) : a;
438
452
  },
439
453
  /**
440
454
  * Moves the viewport to one serializable bounds object.
441
455
  */
442
456
  moveToBounds: (e, t = {}) => {
443
- if (!U(e))
457
+ if (!ee(e))
444
458
  return h("invalid-target");
445
- const r = X(t), { map: a, result: o } = C(
459
+ const r = re(t), { map: o, result: a } = T(
446
460
  c,
447
- i().interactionOwnership,
461
+ s().interactionOwnership,
448
462
  r.ownerId
449
463
  );
450
- return a ? T(() => {
451
- if (E(a, r), te(a, e))
464
+ return o ? g(() => (j(o, r), m.run(o, r, () => {
465
+ if (ae(o, e))
452
466
  return h("noop");
453
467
  const n = [
454
468
  [e.southWest.lat, e.southWest.lng],
455
469
  [e.northEast.lat, e.northEast.lng]
456
470
  ];
457
- return r.mode === "fly" ? (a.flyToBounds(n, {
471
+ return r.mode === "fly" ? (o.flyToBounds(n, {
458
472
  animate: r.animate,
459
473
  duration: r.duration,
460
474
  maxZoom: r.maxZoom,
461
475
  padding: r.padding
462
- }), h("success")) : (a.fitBounds(n, {
476
+ }), h("success")) : (o.fitBounds(n, {
477
+ ...t.duration !== void 0 ? { duration: r.duration } : {},
463
478
  animate: r.animate,
464
479
  maxZoom: r.maxZoom,
465
480
  padding: r.padding
466
481
  }), h("success"));
467
- }) : o;
482
+ }))) : a;
468
483
  },
469
484
  /**
470
485
  * Registers a tool controller without forcing controller state into the
471
486
  * reactive map store.
472
487
  */
473
488
  registerToolController: (e, t, r = "runtime") => {
474
- oe(f, e, t, r);
489
+ ie(f, e, t, r);
475
490
  },
476
491
  /**
477
492
  * Removes a previously registered tool controller.
478
493
  */
479
494
  unregisterToolController: (e, t = "runtime") => {
480
- ae(f, e, t);
495
+ se(f, e, t);
481
496
  },
482
497
  /**
483
498
  * Delegates an external open command to the resolved tool controller.
484
499
  */
485
500
  openTool: (e) => {
486
- j(f, e, "open");
501
+ E(f, e, "open");
502
+ },
503
+ /** Query the current opaque tool owner without knowing its feature or business purpose. */
504
+ canSuspendViewportTool: (e) => {
505
+ const t = s().interactionOwnership.ownersByChannel.viewport_control;
506
+ return !!(t && t !== e && ne(f, t)?.suspendViewport);
507
+ },
508
+ /** Request voluntary camera suspension; ordinary exclusive owners remain untouched. */
509
+ suspendViewportTool: (e) => {
510
+ const t = s().interactionOwnership.ownersByChannel.viewport_control;
511
+ t && t !== e && E(f, t, "suspendViewport");
487
512
  },
488
513
  /**
489
514
  * Delegates an external close command to the resolved tool controller.
490
515
  */
491
516
  closeTool: (e) => {
492
- j(f, e, "close");
517
+ E(f, e, "close");
493
518
  },
494
519
  /**
495
520
  * Delegates an external toggle command to the resolved tool controller.
496
521
  */
497
522
  toggleTool: (e) => {
498
- j(f, e, "toggle");
523
+ E(f, e, "toggle");
499
524
  },
500
525
  /**
501
526
  * TODO: Documentar
502
527
  */
503
528
  setCheckedLayers: (e, t, r) => {
504
- u((a) => {
505
- a.hashLayers[e] && (a.hashLayers[e][t] = r);
529
+ i((o) => {
530
+ o.hashLayers[e] && (o.hashLayers[e][t] = r);
506
531
  });
507
532
  },
508
533
  /**
509
534
  * Updates the runtime cluster gate without mutating the requested cluster intent.
510
535
  */
511
536
  setLayerClusterRuntimeEnabled: (e, t) => {
512
- u((r) => {
537
+ i((r) => {
513
538
  r.hashLayers[e] && (r.hashLayers[e].clusterRuntimeEnabled = t);
514
539
  });
515
540
  },
@@ -517,7 +542,7 @@ const xe = (d, s = !1) => {
517
542
  * Updates the feature ids that should bypass the cluster wrapper while the layer stays clustered.
518
543
  */
519
544
  setLayerClusterBypassFeatureIds: (e, t) => {
520
- u((r) => {
545
+ i((r) => {
521
546
  r.hashLayers[e] && (r.hashLayers[e].clusterBypassFeatureIds = [...t]);
522
547
  });
523
548
  },
@@ -525,9 +550,9 @@ const xe = (d, s = !1) => {
525
550
  * Actualizar la capa actual del mapa
526
551
  */
527
552
  setCurrentMapSourceLayer: (e, t) => {
528
- u((r) => {
529
- const a = r.mapSources.find((o) => o.id === e);
530
- a && a.layers.find((o) => o.id === t) && (r.currentMapSourceLayer = {
553
+ i((r) => {
554
+ const o = r.mapSources.find((a) => a.id === e);
555
+ o && o.layers.find((a) => a.id === t) && (r.currentMapSourceLayer = {
531
556
  mapSourceId: e,
532
557
  mapSourceLayerId: t
533
558
  });
@@ -537,8 +562,8 @@ const xe = (d, s = !1) => {
537
562
  * TODO: Documentar
538
563
  */
539
564
  setMapSourceLayerRoadOptions: (e, t, r) => {
540
- u((a) => {
541
- const n = a.mapSources.find((p) => p.id === e)?.layers.find((p) => p.id === t);
565
+ i((o) => {
566
+ const n = o.mapSources.find((p) => p.id === e)?.layers.find((p) => p.id === t);
542
567
  n && (n.roadSelectedOptions = {
543
568
  bicyclingLayer: n.roadSelectedOptions?.bicyclingLayer || !1,
544
569
  trafficLayer: n.roadSelectedOptions?.trafficLayer || !1,
@@ -549,10 +574,10 @@ const xe = (d, s = !1) => {
549
574
  }
550
575
  }
551
576
  })),
552
- { name: `Map store: ${d.storeId}`, enabled: s }
577
+ { name: `Map store: ${d.storeId}`, enabled: u }
553
578
  )
554
579
  );
555
580
  };
556
581
  export {
557
- xe as createMapStore
582
+ Ve as createMapStore
558
583
  };