@carto/ps-react-maps 2.0.0-alpha.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import
|
|
1
|
+
import nt, { createContext as ee, useContext as te, useCallback as O, useReducer as at, useRef as ce, useMemo as Qt, useEffect as ot } from "react";
|
|
2
2
|
import { EventManager as er } from "mjolnir.js";
|
|
3
3
|
import { EditableGeoJsonLayer as tr, MeasureDistanceMode as rr } from "@deck.gl-community/editable-layers";
|
|
4
4
|
import nr from "convert-units";
|
|
5
5
|
var ar = /* @__PURE__ */ ((t) => (t.Roadmap = "roadmap", t.Satellite = "satellite", t.Hybrid = "hybrid", t))(ar || {}), or = /* @__PURE__ */ ((t) => (t.DarkMatter = "dark-matter", t.Positron = "positron", t.Voyager = "voyager", t))(or || {});
|
|
6
|
-
const
|
|
6
|
+
const be = {
|
|
7
7
|
positron: "https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",
|
|
8
8
|
voyager: "https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",
|
|
9
9
|
"dark-matter": "https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"
|
|
10
10
|
};
|
|
11
|
-
var
|
|
12
|
-
const
|
|
11
|
+
var it = /* @__PURE__ */ ((t) => (t.Maplibre = "maplibre", t.GoogleMaps = "google-maps", t))(it || {});
|
|
12
|
+
const Se = {
|
|
13
13
|
positron: {
|
|
14
|
-
url:
|
|
14
|
+
url: be.positron,
|
|
15
15
|
type: "maplibre"
|
|
16
16
|
/* Maplibre */
|
|
17
17
|
},
|
|
18
18
|
voyager: {
|
|
19
|
-
url:
|
|
19
|
+
url: be.voyager,
|
|
20
20
|
type: "maplibre"
|
|
21
21
|
/* Maplibre */
|
|
22
22
|
},
|
|
23
23
|
"dark-matter": {
|
|
24
|
-
url:
|
|
24
|
+
url: be[
|
|
25
25
|
"dark-matter"
|
|
26
26
|
/* DarkMatter */
|
|
27
27
|
],
|
|
@@ -40,9 +40,9 @@ const Ee = {
|
|
|
40
40
|
type: "google-maps"
|
|
41
41
|
/* GoogleMaps */
|
|
42
42
|
}
|
|
43
|
-
},
|
|
43
|
+
}, K = () => {
|
|
44
44
|
throw new Error("You forgot to wrap your component in <MapProvider>.");
|
|
45
|
-
},
|
|
45
|
+
}, X = {
|
|
46
46
|
state: {
|
|
47
47
|
maps: {}
|
|
48
48
|
// sync: false,
|
|
@@ -52,18 +52,18 @@ const Ee = {
|
|
|
52
52
|
},
|
|
53
53
|
actions: {
|
|
54
54
|
// toggleSync: stub,
|
|
55
|
-
setViewState:
|
|
56
|
-
setBasemap:
|
|
57
|
-
setResize:
|
|
58
|
-
setZoom:
|
|
59
|
-
setLoaded:
|
|
55
|
+
setViewState: K,
|
|
56
|
+
setBasemap: K,
|
|
57
|
+
setResize: K,
|
|
58
|
+
setZoom: K,
|
|
59
|
+
setLoaded: K
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
),
|
|
64
|
-
|
|
61
|
+
}, st = ee(
|
|
62
|
+
X.state
|
|
63
|
+
), ct = ee(X.references), ut = ee(
|
|
64
|
+
X.actions
|
|
65
65
|
);
|
|
66
|
-
var
|
|
66
|
+
var k = /* @__PURE__ */ ((t) => (t.SetViewState = "SetViewState", t.SetBasemap = "SetBasemap", t.SetResize = "SetResize", t.SetZoom = "SetZoom", t.SetLoaded = "SetLoaded", t))(k || {});
|
|
67
67
|
function ir(t, { type: r, payload: a }) {
|
|
68
68
|
return {
|
|
69
69
|
SetViewState: () => {
|
|
@@ -88,11 +88,11 @@ function ir(t, { type: r, payload: a }) {
|
|
|
88
88
|
};
|
|
89
89
|
},
|
|
90
90
|
SetBasemap: () => {
|
|
91
|
-
const { id: o, basemap: l } = a, f = { ...t.maps }, { basemap: y } = f[o], c =
|
|
91
|
+
const { id: o, basemap: l } = a, f = { ...t.maps }, { basemap: y } = f[o], c = Se[y]?.type, m = Se[l]?.type, E = c === m;
|
|
92
92
|
return f[o] = {
|
|
93
93
|
...t.maps[o],
|
|
94
94
|
basemap: l,
|
|
95
|
-
isLoaded:
|
|
95
|
+
isLoaded: E
|
|
96
96
|
}, {
|
|
97
97
|
...t,
|
|
98
98
|
maps: f
|
|
@@ -123,18 +123,18 @@ function ir(t, { type: r, payload: a }) {
|
|
|
123
123
|
}
|
|
124
124
|
}[r]?.() ?? t;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
return
|
|
126
|
+
function Te(t) {
|
|
127
|
+
return te(st).maps[t];
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
const r =
|
|
131
|
-
const
|
|
132
|
-
return
|
|
133
|
-
}, [a]), l =
|
|
134
|
-
(
|
|
129
|
+
function Pe(t) {
|
|
130
|
+
const r = te(ct), { instanceRef: a, overlayRef: s } = r.current[t], o = O(() => {
|
|
131
|
+
const m = a?.current;
|
|
132
|
+
return m?.deck || m?._deck;
|
|
133
|
+
}, [a]), l = O(() => s?.current, [s]), f = O(() => o()?._getViewState(), [o]), y = O(
|
|
134
|
+
(m) => o()?.getViewports(m),
|
|
135
135
|
[o]
|
|
136
|
-
), c =
|
|
137
|
-
(
|
|
136
|
+
), c = O(
|
|
137
|
+
(m = 0, E) => y(E)?.[m],
|
|
138
138
|
[y]
|
|
139
139
|
);
|
|
140
140
|
return {
|
|
@@ -148,7 +148,7 @@ function Re(t) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
function sr(t) {
|
|
151
|
-
const { setBasemap: r, setResize: a, setViewState: s, setZoom: o, setLoaded: l } =
|
|
151
|
+
const { setBasemap: r, setResize: a, setViewState: s, setZoom: o, setLoaded: l } = te(ut), { getViewport: f } = Pe(t);
|
|
152
152
|
return {
|
|
153
153
|
setBasemap: (c) => r(c, t),
|
|
154
154
|
setResize: (c) => a(c, t),
|
|
@@ -156,22 +156,22 @@ function sr(t) {
|
|
|
156
156
|
setZoom: (c) => o(c, t),
|
|
157
157
|
setLoaded: (c) => l(c, t),
|
|
158
158
|
fitBounds: (c, {
|
|
159
|
-
boundsOptions:
|
|
160
|
-
viewStateOptions:
|
|
159
|
+
boundsOptions: m,
|
|
160
|
+
viewStateOptions: E
|
|
161
161
|
} = {}) => {
|
|
162
|
-
const
|
|
162
|
+
const _ = f(), { latitude: b, longitude: v, zoom: h } = _.fitBounds(
|
|
163
163
|
c,
|
|
164
|
-
|
|
164
|
+
m
|
|
165
165
|
);
|
|
166
|
-
s({ ...
|
|
166
|
+
s({ ...E, latitude: b, longitude: v, zoom: h }, t);
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
170
|
function Jr(t) {
|
|
171
|
-
return
|
|
171
|
+
return Te(t);
|
|
172
172
|
}
|
|
173
173
|
function Zr(t) {
|
|
174
|
-
return
|
|
174
|
+
return Pe(t);
|
|
175
175
|
}
|
|
176
176
|
function Xr(t) {
|
|
177
177
|
return sr(t);
|
|
@@ -179,7 +179,7 @@ function Xr(t) {
|
|
|
179
179
|
function cr(t) {
|
|
180
180
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
181
181
|
}
|
|
182
|
-
var
|
|
182
|
+
var _e = { exports: {} }, G = {};
|
|
183
183
|
/**
|
|
184
184
|
* @license React
|
|
185
185
|
* react-jsx-runtime.production.min.js
|
|
@@ -189,25 +189,25 @@ var be = { exports: {} }, K = {};
|
|
|
189
189
|
* This source code is licensed under the MIT license found in the
|
|
190
190
|
* LICENSE file in the root directory of this source tree.
|
|
191
191
|
*/
|
|
192
|
-
var
|
|
192
|
+
var Ze;
|
|
193
193
|
function ur() {
|
|
194
|
-
if (
|
|
195
|
-
return
|
|
196
|
-
|
|
197
|
-
var t =
|
|
198
|
-
function f(y, c,
|
|
199
|
-
var
|
|
200
|
-
|
|
201
|
-
for (
|
|
202
|
-
s.call(c,
|
|
194
|
+
if (Ze)
|
|
195
|
+
return G;
|
|
196
|
+
Ze = 1;
|
|
197
|
+
var t = nt, r = Symbol.for("react.element"), a = Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
198
|
+
function f(y, c, m) {
|
|
199
|
+
var E, _ = {}, b = null, v = null;
|
|
200
|
+
m !== void 0 && (b = "" + m), c.key !== void 0 && (b = "" + c.key), c.ref !== void 0 && (v = c.ref);
|
|
201
|
+
for (E in c)
|
|
202
|
+
s.call(c, E) && !l.hasOwnProperty(E) && (_[E] = c[E]);
|
|
203
203
|
if (y && y.defaultProps)
|
|
204
|
-
for (
|
|
205
|
-
|
|
206
|
-
return { $$typeof: r, type: y, key:
|
|
204
|
+
for (E in c = y.defaultProps, c)
|
|
205
|
+
_[E] === void 0 && (_[E] = c[E]);
|
|
206
|
+
return { $$typeof: r, type: y, key: b, ref: v, props: _, _owner: o.current };
|
|
207
207
|
}
|
|
208
|
-
return
|
|
208
|
+
return G.Fragment = a, G.jsx = f, G.jsxs = f, G;
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var J = {};
|
|
211
211
|
/**
|
|
212
212
|
* @license React
|
|
213
213
|
* react-jsx-runtime.development.js
|
|
@@ -217,57 +217,57 @@ var q = {};
|
|
|
217
217
|
* This source code is licensed under the MIT license found in the
|
|
218
218
|
* LICENSE file in the root directory of this source tree.
|
|
219
219
|
*/
|
|
220
|
-
var
|
|
220
|
+
var Xe;
|
|
221
221
|
function lr() {
|
|
222
|
-
return
|
|
223
|
-
var t =
|
|
224
|
-
function
|
|
222
|
+
return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
223
|
+
var t = nt, r = Symbol.for("react.element"), a = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), y = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), v = Symbol.for("react.offscreen"), h = Symbol.iterator, A = "@@iterator";
|
|
224
|
+
function U(e) {
|
|
225
225
|
if (e === null || typeof e != "object")
|
|
226
226
|
return null;
|
|
227
|
-
var n = h && e[h] || e[
|
|
227
|
+
var n = h && e[h] || e[A];
|
|
228
228
|
return typeof n == "function" ? n : null;
|
|
229
229
|
}
|
|
230
|
-
var
|
|
231
|
-
function
|
|
230
|
+
var j = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
231
|
+
function P(e) {
|
|
232
232
|
{
|
|
233
233
|
for (var n = arguments.length, i = new Array(n > 1 ? n - 1 : 0), u = 1; u < n; u++)
|
|
234
234
|
i[u - 1] = arguments[u];
|
|
235
|
-
|
|
235
|
+
le("error", e, i);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function le(e, n, i) {
|
|
239
239
|
{
|
|
240
|
-
var u =
|
|
241
|
-
|
|
242
|
-
var
|
|
243
|
-
return String(
|
|
240
|
+
var u = j.ReactDebugCurrentFrame, g = u.getStackAddendum();
|
|
241
|
+
g !== "" && (n += "%s", i = i.concat([g]));
|
|
242
|
+
var S = i.map(function(p) {
|
|
243
|
+
return String(p);
|
|
244
244
|
});
|
|
245
|
-
|
|
245
|
+
S.unshift("Warning: " + n), Function.prototype.apply.call(console[e], console, S);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
|
-
var
|
|
248
|
+
var W = !1, re = !1, St = !1, _t = !1, Rt = !1, Me;
|
|
249
249
|
Me = Symbol.for("react.module.reference");
|
|
250
250
|
function Tt(e) {
|
|
251
|
-
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || Rt || e === o || e ===
|
|
251
|
+
return !!(typeof e == "string" || typeof e == "function" || e === s || e === l || Rt || e === o || e === m || e === E || _t || e === v || W || re || St || typeof e == "object" && e !== null && (e.$$typeof === b || e.$$typeof === _ || e.$$typeof === f || e.$$typeof === y || e.$$typeof === c || // This needs to include all possible module reference object
|
|
252
252
|
// types supported by any Flight configuration anywhere since
|
|
253
253
|
// we don't know which Flight build this will end up being used
|
|
254
254
|
// with.
|
|
255
255
|
e.$$typeof === Me || e.getModuleId !== void 0));
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function Pt(e, n, i) {
|
|
258
258
|
var u = e.displayName;
|
|
259
259
|
if (u)
|
|
260
260
|
return u;
|
|
261
|
-
var
|
|
262
|
-
return
|
|
261
|
+
var g = n.displayName || n.name || "";
|
|
262
|
+
return g !== "" ? i + "(" + g + ")" : i;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function Ce(e) {
|
|
265
265
|
return e.displayName || "Context";
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function D(e) {
|
|
268
268
|
if (e == null)
|
|
269
269
|
return null;
|
|
270
|
-
if (typeof e.tag == "number" &&
|
|
270
|
+
if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
271
271
|
return e.displayName || e.name || null;
|
|
272
272
|
if (typeof e == "string")
|
|
273
273
|
return e;
|
|
@@ -280,28 +280,28 @@ function lr() {
|
|
|
280
280
|
return "Profiler";
|
|
281
281
|
case o:
|
|
282
282
|
return "StrictMode";
|
|
283
|
-
case
|
|
283
|
+
case m:
|
|
284
284
|
return "Suspense";
|
|
285
|
-
case
|
|
285
|
+
case E:
|
|
286
286
|
return "SuspenseList";
|
|
287
287
|
}
|
|
288
288
|
if (typeof e == "object")
|
|
289
289
|
switch (e.$$typeof) {
|
|
290
290
|
case y:
|
|
291
291
|
var n = e;
|
|
292
|
-
return
|
|
292
|
+
return Ce(n) + ".Consumer";
|
|
293
293
|
case f:
|
|
294
294
|
var i = e;
|
|
295
|
-
return
|
|
295
|
+
return Ce(i._context) + ".Provider";
|
|
296
296
|
case c:
|
|
297
|
-
return
|
|
298
|
-
case
|
|
297
|
+
return Pt(e, e.render, "ForwardRef");
|
|
298
|
+
case _:
|
|
299
299
|
var u = e.displayName || null;
|
|
300
|
-
return u !== null ? u :
|
|
301
|
-
case
|
|
302
|
-
var
|
|
300
|
+
return u !== null ? u : D(e.type) || "Memo";
|
|
301
|
+
case b: {
|
|
302
|
+
var g = e, S = g._payload, p = g._init;
|
|
303
303
|
try {
|
|
304
|
-
return
|
|
304
|
+
return D(p(S));
|
|
305
305
|
} catch {
|
|
306
306
|
return null;
|
|
307
307
|
}
|
|
@@ -309,18 +309,18 @@ function lr() {
|
|
|
309
309
|
}
|
|
310
310
|
return null;
|
|
311
311
|
}
|
|
312
|
-
var
|
|
313
|
-
function
|
|
312
|
+
var L = Object.assign, H = 0, we, je, xe, Ae, De, ke, Fe;
|
|
313
|
+
function Le() {
|
|
314
314
|
}
|
|
315
|
-
|
|
315
|
+
Le.__reactDisabledLog = !0;
|
|
316
316
|
function Ot() {
|
|
317
317
|
{
|
|
318
|
-
if (
|
|
319
|
-
|
|
318
|
+
if (H === 0) {
|
|
319
|
+
we = console.log, je = console.info, xe = console.warn, Ae = console.error, De = console.group, ke = console.groupCollapsed, Fe = console.groupEnd;
|
|
320
320
|
var e = {
|
|
321
321
|
configurable: !0,
|
|
322
322
|
enumerable: !0,
|
|
323
|
-
value:
|
|
323
|
+
value: Le,
|
|
324
324
|
writable: !0
|
|
325
325
|
};
|
|
326
326
|
Object.defineProperties(console, {
|
|
@@ -333,100 +333,100 @@ function lr() {
|
|
|
333
333
|
groupEnd: e
|
|
334
334
|
});
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
H++;
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
function
|
|
339
|
+
function Mt() {
|
|
340
340
|
{
|
|
341
|
-
if (
|
|
341
|
+
if (H--, H === 0) {
|
|
342
342
|
var e = {
|
|
343
343
|
configurable: !0,
|
|
344
344
|
enumerable: !0,
|
|
345
345
|
writable: !0
|
|
346
346
|
};
|
|
347
347
|
Object.defineProperties(console, {
|
|
348
|
-
log:
|
|
349
|
-
value: Pe
|
|
350
|
-
}),
|
|
351
|
-
info: I({}, e, {
|
|
352
|
-
value: Ce
|
|
353
|
-
}),
|
|
354
|
-
warn: I({}, e, {
|
|
348
|
+
log: L({}, e, {
|
|
355
349
|
value: we
|
|
356
350
|
}),
|
|
357
|
-
|
|
351
|
+
info: L({}, e, {
|
|
358
352
|
value: je
|
|
359
353
|
}),
|
|
360
|
-
|
|
354
|
+
warn: L({}, e, {
|
|
361
355
|
value: xe
|
|
362
356
|
}),
|
|
363
|
-
|
|
357
|
+
error: L({}, e, {
|
|
364
358
|
value: Ae
|
|
365
359
|
}),
|
|
366
|
-
|
|
360
|
+
group: L({}, e, {
|
|
367
361
|
value: De
|
|
362
|
+
}),
|
|
363
|
+
groupCollapsed: L({}, e, {
|
|
364
|
+
value: ke
|
|
365
|
+
}),
|
|
366
|
+
groupEnd: L({}, e, {
|
|
367
|
+
value: Fe
|
|
368
368
|
})
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
|
-
|
|
371
|
+
H < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
var
|
|
375
|
-
function
|
|
374
|
+
var fe = j.ReactCurrentDispatcher, de;
|
|
375
|
+
function ne(e, n, i) {
|
|
376
376
|
{
|
|
377
|
-
if (
|
|
377
|
+
if (de === void 0)
|
|
378
378
|
try {
|
|
379
379
|
throw Error();
|
|
380
|
-
} catch (
|
|
381
|
-
var u =
|
|
382
|
-
|
|
380
|
+
} catch (g) {
|
|
381
|
+
var u = g.stack.trim().match(/\n( *(at )?)/);
|
|
382
|
+
de = u && u[1] || "";
|
|
383
383
|
}
|
|
384
384
|
return `
|
|
385
|
-
` +
|
|
385
|
+
` + de + e;
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
var
|
|
388
|
+
var pe = !1, ae;
|
|
389
389
|
{
|
|
390
390
|
var Ct = typeof WeakMap == "function" ? WeakMap : Map;
|
|
391
|
-
|
|
391
|
+
ae = new Ct();
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
if (!e ||
|
|
393
|
+
function Ie(e, n) {
|
|
394
|
+
if (!e || pe)
|
|
395
395
|
return "";
|
|
396
396
|
{
|
|
397
|
-
var i =
|
|
397
|
+
var i = ae.get(e);
|
|
398
398
|
if (i !== void 0)
|
|
399
399
|
return i;
|
|
400
400
|
}
|
|
401
401
|
var u;
|
|
402
|
-
|
|
403
|
-
var
|
|
402
|
+
pe = !0;
|
|
403
|
+
var g = Error.prepareStackTrace;
|
|
404
404
|
Error.prepareStackTrace = void 0;
|
|
405
|
-
var
|
|
406
|
-
|
|
405
|
+
var S;
|
|
406
|
+
S = fe.current, fe.current = null, Ot();
|
|
407
407
|
try {
|
|
408
408
|
if (n) {
|
|
409
|
-
var
|
|
409
|
+
var p = function() {
|
|
410
410
|
throw Error();
|
|
411
411
|
};
|
|
412
|
-
if (Object.defineProperty(
|
|
412
|
+
if (Object.defineProperty(p.prototype, "props", {
|
|
413
413
|
set: function() {
|
|
414
414
|
throw Error();
|
|
415
415
|
}
|
|
416
416
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
417
417
|
try {
|
|
418
|
-
Reflect.construct(
|
|
418
|
+
Reflect.construct(p, []);
|
|
419
419
|
} catch (w) {
|
|
420
420
|
u = w;
|
|
421
421
|
}
|
|
422
|
-
Reflect.construct(e, [],
|
|
422
|
+
Reflect.construct(e, [], p);
|
|
423
423
|
} else {
|
|
424
424
|
try {
|
|
425
|
-
|
|
425
|
+
p.call();
|
|
426
426
|
} catch (w) {
|
|
427
427
|
u = w;
|
|
428
428
|
}
|
|
429
|
-
e.call(
|
|
429
|
+
e.call(p.prototype);
|
|
430
430
|
}
|
|
431
431
|
} else {
|
|
432
432
|
try {
|
|
@@ -439,93 +439,93 @@ function lr() {
|
|
|
439
439
|
} catch (w) {
|
|
440
440
|
if (w && u && typeof w.stack == "string") {
|
|
441
441
|
for (var d = w.stack.split(`
|
|
442
|
-
`),
|
|
443
|
-
`),
|
|
442
|
+
`), M = u.stack.split(`
|
|
443
|
+
`), R = d.length - 1, T = M.length - 1; R >= 1 && T >= 0 && d[R] !== M[T]; )
|
|
444
444
|
T--;
|
|
445
|
-
for (;
|
|
446
|
-
if (d[
|
|
447
|
-
if (
|
|
445
|
+
for (; R >= 1 && T >= 0; R--, T--)
|
|
446
|
+
if (d[R] !== M[T]) {
|
|
447
|
+
if (R !== 1 || T !== 1)
|
|
448
448
|
do
|
|
449
|
-
if (
|
|
450
|
-
var
|
|
451
|
-
` + d[
|
|
452
|
-
return e.displayName &&
|
|
449
|
+
if (R--, T--, T < 0 || d[R] !== M[T]) {
|
|
450
|
+
var x = `
|
|
451
|
+
` + d[R].replace(" at new ", " at ");
|
|
452
|
+
return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, x), x;
|
|
453
453
|
}
|
|
454
|
-
while (
|
|
454
|
+
while (R >= 1 && T >= 0);
|
|
455
455
|
break;
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
} finally {
|
|
459
|
-
|
|
459
|
+
pe = !1, fe.current = S, Mt(), Error.prepareStackTrace = g;
|
|
460
460
|
}
|
|
461
|
-
var
|
|
462
|
-
return typeof e == "function" &&
|
|
461
|
+
var $ = e ? e.displayName || e.name : "", I = $ ? ne($) : "";
|
|
462
|
+
return typeof e == "function" && ae.set(e, I), I;
|
|
463
463
|
}
|
|
464
464
|
function wt(e, n, i) {
|
|
465
|
-
return
|
|
465
|
+
return Ie(e, !1);
|
|
466
466
|
}
|
|
467
467
|
function jt(e) {
|
|
468
468
|
var n = e.prototype;
|
|
469
469
|
return !!(n && n.isReactComponent);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
471
|
+
function oe(e, n, i) {
|
|
472
472
|
if (e == null)
|
|
473
473
|
return "";
|
|
474
474
|
if (typeof e == "function")
|
|
475
|
-
return
|
|
475
|
+
return Ie(e, jt(e));
|
|
476
476
|
if (typeof e == "string")
|
|
477
|
-
return
|
|
477
|
+
return ne(e);
|
|
478
478
|
switch (e) {
|
|
479
|
+
case m:
|
|
480
|
+
return ne("Suspense");
|
|
479
481
|
case E:
|
|
480
|
-
return
|
|
481
|
-
case p:
|
|
482
|
-
return re("SuspenseList");
|
|
482
|
+
return ne("SuspenseList");
|
|
483
483
|
}
|
|
484
484
|
if (typeof e == "object")
|
|
485
485
|
switch (e.$$typeof) {
|
|
486
486
|
case c:
|
|
487
487
|
return wt(e.render);
|
|
488
|
-
case
|
|
489
|
-
return
|
|
490
|
-
case
|
|
491
|
-
var u = e,
|
|
488
|
+
case _:
|
|
489
|
+
return oe(e.type, n, i);
|
|
490
|
+
case b: {
|
|
491
|
+
var u = e, g = u._payload, S = u._init;
|
|
492
492
|
try {
|
|
493
|
-
return
|
|
493
|
+
return oe(S(g), n, i);
|
|
494
494
|
} catch {
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
return "";
|
|
499
499
|
}
|
|
500
|
-
var
|
|
501
|
-
function
|
|
500
|
+
var z = Object.prototype.hasOwnProperty, Ne = {}, Ue = j.ReactDebugCurrentFrame;
|
|
501
|
+
function ie(e) {
|
|
502
502
|
if (e) {
|
|
503
|
-
var n = e._owner, i =
|
|
504
|
-
|
|
503
|
+
var n = e._owner, i = oe(e.type, e._source, n ? n.type : null);
|
|
504
|
+
Ue.setExtraStackFrame(i);
|
|
505
505
|
} else
|
|
506
|
-
|
|
506
|
+
Ue.setExtraStackFrame(null);
|
|
507
507
|
}
|
|
508
|
-
function xt(e, n, i, u,
|
|
508
|
+
function xt(e, n, i, u, g) {
|
|
509
509
|
{
|
|
510
|
-
var
|
|
511
|
-
for (var
|
|
512
|
-
if (
|
|
510
|
+
var S = Function.call.bind(z);
|
|
511
|
+
for (var p in e)
|
|
512
|
+
if (S(e, p)) {
|
|
513
513
|
var d = void 0;
|
|
514
514
|
try {
|
|
515
|
-
if (typeof e[
|
|
516
|
-
var
|
|
517
|
-
throw
|
|
515
|
+
if (typeof e[p] != "function") {
|
|
516
|
+
var M = Error((u || "React class") + ": " + i + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
517
|
+
throw M.name = "Invariant Violation", M;
|
|
518
518
|
}
|
|
519
|
-
d = e[
|
|
520
|
-
} catch (
|
|
521
|
-
d =
|
|
519
|
+
d = e[p](n, p, u, i, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
520
|
+
} catch (R) {
|
|
521
|
+
d = R;
|
|
522
522
|
}
|
|
523
|
-
d && !(d instanceof Error) && (
|
|
523
|
+
d && !(d instanceof Error) && (ie(g), P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", u || "React class", i, p, typeof d), ie(null)), d instanceof Error && !(d.message in Ne) && (Ne[d.message] = !0, ie(g), P("Failed %s type: %s", i, d.message), ie(null));
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
}
|
|
527
527
|
var At = Array.isArray;
|
|
528
|
-
function
|
|
528
|
+
function me(e) {
|
|
529
529
|
return At(e);
|
|
530
530
|
}
|
|
531
531
|
function Dt(e) {
|
|
@@ -536,27 +536,27 @@ function lr() {
|
|
|
536
536
|
}
|
|
537
537
|
function kt(e) {
|
|
538
538
|
try {
|
|
539
|
-
return
|
|
539
|
+
return Ve(e), !1;
|
|
540
540
|
} catch {
|
|
541
541
|
return !0;
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function Ve(e) {
|
|
545
545
|
return "" + e;
|
|
546
546
|
}
|
|
547
|
-
function
|
|
547
|
+
function $e(e) {
|
|
548
548
|
if (kt(e))
|
|
549
|
-
return
|
|
549
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Dt(e)), Ve(e);
|
|
550
550
|
}
|
|
551
|
-
var
|
|
551
|
+
var q = j.ReactCurrentOwner, Ft = {
|
|
552
552
|
key: !0,
|
|
553
553
|
ref: !0,
|
|
554
554
|
__self: !0,
|
|
555
555
|
__source: !0
|
|
556
|
-
},
|
|
557
|
-
|
|
556
|
+
}, Ye, Be, ve;
|
|
557
|
+
ve = {};
|
|
558
558
|
function Lt(e) {
|
|
559
|
-
if (
|
|
559
|
+
if (z.call(e, "ref")) {
|
|
560
560
|
var n = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
561
561
|
if (n && n.isReactWarning)
|
|
562
562
|
return !1;
|
|
@@ -564,7 +564,7 @@ function lr() {
|
|
|
564
564
|
return e.ref !== void 0;
|
|
565
565
|
}
|
|
566
566
|
function It(e) {
|
|
567
|
-
if (
|
|
567
|
+
if (z.call(e, "key")) {
|
|
568
568
|
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
569
569
|
if (n && n.isReactWarning)
|
|
570
570
|
return !1;
|
|
@@ -572,15 +572,15 @@ function lr() {
|
|
|
572
572
|
return e.key !== void 0;
|
|
573
573
|
}
|
|
574
574
|
function Nt(e, n) {
|
|
575
|
-
if (typeof e.ref == "string" &&
|
|
576
|
-
var i =
|
|
577
|
-
|
|
575
|
+
if (typeof e.ref == "string" && q.current && n && q.current.stateNode !== n) {
|
|
576
|
+
var i = D(q.current.type);
|
|
577
|
+
ve[i] || (P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', D(q.current.type), e.ref), ve[i] = !0);
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
function Ut(e, n) {
|
|
581
581
|
{
|
|
582
582
|
var i = function() {
|
|
583
|
-
|
|
583
|
+
Ye || (Ye = !0, P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
584
584
|
};
|
|
585
585
|
i.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
586
586
|
get: i,
|
|
@@ -591,7 +591,7 @@ function lr() {
|
|
|
591
591
|
function Vt(e, n) {
|
|
592
592
|
{
|
|
593
593
|
var i = function() {
|
|
594
|
-
|
|
594
|
+
Be || (Be = !0, P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", n));
|
|
595
595
|
};
|
|
596
596
|
i.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
597
597
|
get: i,
|
|
@@ -599,7 +599,7 @@ function lr() {
|
|
|
599
599
|
});
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
|
-
var $t = function(e, n, i, u,
|
|
602
|
+
var $t = function(e, n, i, u, g, S, p) {
|
|
603
603
|
var d = {
|
|
604
604
|
// This tag allows us to uniquely identify this as a React Element
|
|
605
605
|
$$typeof: r,
|
|
@@ -607,9 +607,9 @@ function lr() {
|
|
|
607
607
|
type: e,
|
|
608
608
|
key: n,
|
|
609
609
|
ref: i,
|
|
610
|
-
props:
|
|
610
|
+
props: p,
|
|
611
611
|
// Record the component responsible for creating this element.
|
|
612
|
-
_owner:
|
|
612
|
+
_owner: S
|
|
613
613
|
};
|
|
614
614
|
return d._store = {}, Object.defineProperty(d._store, "validated", {
|
|
615
615
|
configurable: !1,
|
|
@@ -625,44 +625,44 @@ function lr() {
|
|
|
625
625
|
configurable: !1,
|
|
626
626
|
enumerable: !1,
|
|
627
627
|
writable: !1,
|
|
628
|
-
value:
|
|
628
|
+
value: g
|
|
629
629
|
}), Object.freeze && (Object.freeze(d.props), Object.freeze(d)), d;
|
|
630
630
|
};
|
|
631
|
-
function Yt(e, n, i, u,
|
|
631
|
+
function Yt(e, n, i, u, g) {
|
|
632
632
|
{
|
|
633
|
-
var
|
|
634
|
-
i !== void 0 && (
|
|
635
|
-
for (
|
|
636
|
-
|
|
633
|
+
var S, p = {}, d = null, M = null;
|
|
634
|
+
i !== void 0 && ($e(i), d = "" + i), It(n) && ($e(n.key), d = "" + n.key), Lt(n) && (M = n.ref, Nt(n, g));
|
|
635
|
+
for (S in n)
|
|
636
|
+
z.call(n, S) && !Ft.hasOwnProperty(S) && (p[S] = n[S]);
|
|
637
637
|
if (e && e.defaultProps) {
|
|
638
|
-
var
|
|
639
|
-
for (
|
|
640
|
-
|
|
638
|
+
var R = e.defaultProps;
|
|
639
|
+
for (S in R)
|
|
640
|
+
p[S] === void 0 && (p[S] = R[S]);
|
|
641
641
|
}
|
|
642
|
-
if (d ||
|
|
642
|
+
if (d || M) {
|
|
643
643
|
var T = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
644
|
-
d && Ut(
|
|
644
|
+
d && Ut(p, T), M && Vt(p, T);
|
|
645
645
|
}
|
|
646
|
-
return $t(e, d,
|
|
646
|
+
return $t(e, d, M, g, u, q.current, p);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
var
|
|
650
|
-
function
|
|
649
|
+
var ge = j.ReactCurrentOwner, We = j.ReactDebugCurrentFrame;
|
|
650
|
+
function V(e) {
|
|
651
651
|
if (e) {
|
|
652
|
-
var n = e._owner, i =
|
|
653
|
-
|
|
652
|
+
var n = e._owner, i = oe(e.type, e._source, n ? n.type : null);
|
|
653
|
+
We.setExtraStackFrame(i);
|
|
654
654
|
} else
|
|
655
|
-
|
|
655
|
+
We.setExtraStackFrame(null);
|
|
656
656
|
}
|
|
657
|
-
var
|
|
658
|
-
|
|
659
|
-
function
|
|
657
|
+
var ye;
|
|
658
|
+
ye = !1;
|
|
659
|
+
function he(e) {
|
|
660
660
|
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
662
|
+
function He() {
|
|
663
663
|
{
|
|
664
|
-
if (
|
|
665
|
-
var e =
|
|
664
|
+
if (ge.current) {
|
|
665
|
+
var e = D(ge.current.type);
|
|
666
666
|
if (e)
|
|
667
667
|
return `
|
|
668
668
|
|
|
@@ -672,20 +672,12 @@ Check the render method of \`` + e + "`.";
|
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
674
|
function Bt(e) {
|
|
675
|
-
|
|
676
|
-
if (e !== void 0) {
|
|
677
|
-
var n = e.fileName.replace(/^.*[\\\/]/, ""), i = e.lineNumber;
|
|
678
|
-
return `
|
|
679
|
-
|
|
680
|
-
Check your code at ` + n + ":" + i + ".";
|
|
681
|
-
}
|
|
682
|
-
return "";
|
|
683
|
-
}
|
|
675
|
+
return "";
|
|
684
676
|
}
|
|
685
|
-
var
|
|
677
|
+
var ze = {};
|
|
686
678
|
function Wt(e) {
|
|
687
679
|
{
|
|
688
|
-
var n =
|
|
680
|
+
var n = He();
|
|
689
681
|
if (!n) {
|
|
690
682
|
var i = typeof e == "string" ? e : e.displayName || e.name;
|
|
691
683
|
i && (n = `
|
|
@@ -695,35 +687,35 @@ Check the top-level render call using <` + i + ">.");
|
|
|
695
687
|
return n;
|
|
696
688
|
}
|
|
697
689
|
}
|
|
698
|
-
function
|
|
690
|
+
function qe(e, n) {
|
|
699
691
|
{
|
|
700
692
|
if (!e._store || e._store.validated || e.key != null)
|
|
701
693
|
return;
|
|
702
694
|
e._store.validated = !0;
|
|
703
695
|
var i = Wt(n);
|
|
704
|
-
if (
|
|
696
|
+
if (ze[i])
|
|
705
697
|
return;
|
|
706
|
-
|
|
698
|
+
ze[i] = !0;
|
|
707
699
|
var u = "";
|
|
708
|
-
e && e._owner && e._owner !==
|
|
700
|
+
e && e._owner && e._owner !== ge.current && (u = " It was passed a child from " + D(e._owner.type) + "."), V(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', i, u), V(null);
|
|
709
701
|
}
|
|
710
702
|
}
|
|
711
|
-
function
|
|
703
|
+
function Ke(e, n) {
|
|
712
704
|
{
|
|
713
705
|
if (typeof e != "object")
|
|
714
706
|
return;
|
|
715
|
-
if (
|
|
707
|
+
if (me(e))
|
|
716
708
|
for (var i = 0; i < e.length; i++) {
|
|
717
709
|
var u = e[i];
|
|
718
|
-
|
|
710
|
+
he(u) && qe(u, n);
|
|
719
711
|
}
|
|
720
|
-
else if (
|
|
712
|
+
else if (he(e))
|
|
721
713
|
e._store && (e._store.validated = !0);
|
|
722
714
|
else if (e) {
|
|
723
|
-
var
|
|
724
|
-
if (typeof
|
|
725
|
-
for (var
|
|
726
|
-
|
|
715
|
+
var g = U(e);
|
|
716
|
+
if (typeof g == "function" && g !== e.entries)
|
|
717
|
+
for (var S = g.call(e), p; !(p = S.next()).done; )
|
|
718
|
+
he(p.value) && qe(p.value, n);
|
|
727
719
|
}
|
|
728
720
|
}
|
|
729
721
|
}
|
|
@@ -737,19 +729,19 @@ Check the top-level render call using <` + i + ">.");
|
|
|
737
729
|
i = n.propTypes;
|
|
738
730
|
else if (typeof n == "object" && (n.$$typeof === c || // Note: Memo only checks outer props here.
|
|
739
731
|
// Inner props are checked in the reconciler.
|
|
740
|
-
n.$$typeof ===
|
|
732
|
+
n.$$typeof === _))
|
|
741
733
|
i = n.propTypes;
|
|
742
734
|
else
|
|
743
735
|
return;
|
|
744
736
|
if (i) {
|
|
745
|
-
var u =
|
|
737
|
+
var u = D(n);
|
|
746
738
|
xt(i, e.props, "prop", u, e);
|
|
747
|
-
} else if (n.PropTypes !== void 0 && !
|
|
748
|
-
|
|
749
|
-
var
|
|
750
|
-
|
|
739
|
+
} else if (n.PropTypes !== void 0 && !ye) {
|
|
740
|
+
ye = !0;
|
|
741
|
+
var g = D(n);
|
|
742
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", g || "Unknown");
|
|
751
743
|
}
|
|
752
|
-
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved &&
|
|
744
|
+
typeof n.getDefaultProps == "function" && !n.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
753
745
|
}
|
|
754
746
|
}
|
|
755
747
|
function zt(e) {
|
|
@@ -757,164 +749,164 @@ Check the top-level render call using <` + i + ">.");
|
|
|
757
749
|
for (var n = Object.keys(e.props), i = 0; i < n.length; i++) {
|
|
758
750
|
var u = n[i];
|
|
759
751
|
if (u !== "children" && u !== "key") {
|
|
760
|
-
|
|
752
|
+
V(e), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), V(null);
|
|
761
753
|
break;
|
|
762
754
|
}
|
|
763
755
|
}
|
|
764
|
-
e.ref !== null && (
|
|
756
|
+
e.ref !== null && (V(e), P("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
765
757
|
}
|
|
766
758
|
}
|
|
767
|
-
var
|
|
768
|
-
function
|
|
759
|
+
var Ge = {};
|
|
760
|
+
function Je(e, n, i, u, g, S) {
|
|
769
761
|
{
|
|
770
|
-
var
|
|
771
|
-
if (!
|
|
762
|
+
var p = Tt(e);
|
|
763
|
+
if (!p) {
|
|
772
764
|
var d = "";
|
|
773
765
|
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (d += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
774
|
-
var
|
|
775
|
-
|
|
776
|
-
var
|
|
777
|
-
e === null ?
|
|
766
|
+
var M = Bt();
|
|
767
|
+
M ? d += M : d += He();
|
|
768
|
+
var R;
|
|
769
|
+
e === null ? R = "null" : me(e) ? R = "array" : e !== void 0 && e.$$typeof === r ? (R = "<" + (D(e.type) || "Unknown") + " />", d = " Did you accidentally export a JSX literal instead of a component?") : R = typeof e, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, d);
|
|
778
770
|
}
|
|
779
|
-
var T = Yt(e, n, i,
|
|
771
|
+
var T = Yt(e, n, i, g, S);
|
|
780
772
|
if (T == null)
|
|
781
773
|
return T;
|
|
782
|
-
if (
|
|
783
|
-
var
|
|
784
|
-
if (
|
|
774
|
+
if (p) {
|
|
775
|
+
var x = n.children;
|
|
776
|
+
if (x !== void 0)
|
|
785
777
|
if (u)
|
|
786
|
-
if (
|
|
787
|
-
for (var
|
|
788
|
-
|
|
789
|
-
Object.freeze && Object.freeze(
|
|
778
|
+
if (me(x)) {
|
|
779
|
+
for (var $ = 0; $ < x.length; $++)
|
|
780
|
+
Ke(x[$], e);
|
|
781
|
+
Object.freeze && Object.freeze(x);
|
|
790
782
|
} else
|
|
791
|
-
|
|
783
|
+
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
792
784
|
else
|
|
793
|
-
|
|
785
|
+
Ke(x, e);
|
|
794
786
|
}
|
|
795
|
-
if (
|
|
796
|
-
var
|
|
787
|
+
if (z.call(n, "key")) {
|
|
788
|
+
var I = D(e), w = Object.keys(n).filter(function(Xt) {
|
|
797
789
|
return Xt !== "key";
|
|
798
|
-
}),
|
|
799
|
-
if (!
|
|
790
|
+
}), Ee = w.length > 0 ? "{key: someKey, " + w.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
791
|
+
if (!Ge[I + Ee]) {
|
|
800
792
|
var Zt = w.length > 0 ? "{" + w.join(": ..., ") + ": ...}" : "{}";
|
|
801
|
-
|
|
793
|
+
P(`A props object containing a "key" prop is being spread into JSX:
|
|
802
794
|
let props = %s;
|
|
803
795
|
<%s {...props} />
|
|
804
796
|
React keys must be passed directly to JSX without using spread:
|
|
805
797
|
let props = %s;
|
|
806
|
-
<%s key={someKey} {...props} />`,
|
|
798
|
+
<%s key={someKey} {...props} />`, Ee, I, Zt, I), Ge[I + Ee] = !0;
|
|
807
799
|
}
|
|
808
800
|
}
|
|
809
801
|
return e === s ? zt(T) : Ht(T), T;
|
|
810
802
|
}
|
|
811
803
|
}
|
|
812
|
-
function Kt(e, n, i) {
|
|
813
|
-
return qe(e, n, i, !0);
|
|
814
|
-
}
|
|
815
804
|
function qt(e, n, i) {
|
|
816
|
-
return
|
|
805
|
+
return Je(e, n, i, !0);
|
|
817
806
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
807
|
+
function Kt(e, n, i) {
|
|
808
|
+
return Je(e, n, i, !1);
|
|
809
|
+
}
|
|
810
|
+
var Gt = Kt, Jt = qt;
|
|
811
|
+
J.Fragment = s, J.jsx = Gt, J.jsxs = Jt;
|
|
812
|
+
}()), J;
|
|
821
813
|
}
|
|
822
|
-
process.env.NODE_ENV === "production" ?
|
|
823
|
-
var
|
|
814
|
+
process.env.NODE_ENV === "production" ? _e.exports = ur() : _e.exports = lr();
|
|
815
|
+
var Z = _e.exports;
|
|
824
816
|
function Qr({
|
|
825
817
|
children: t,
|
|
826
818
|
maps: r,
|
|
827
819
|
externalSync: a
|
|
828
820
|
}) {
|
|
829
|
-
const [s, o] =
|
|
830
|
-
...
|
|
831
|
-
maps: r.reduce((
|
|
821
|
+
const [s, o] = at(ir, {
|
|
822
|
+
...X.state,
|
|
823
|
+
maps: r.reduce((v, h) => (v[h.id] = {
|
|
832
824
|
...h,
|
|
833
825
|
isLoaded: !1
|
|
834
|
-
},
|
|
835
|
-
}), l =
|
|
836
|
-
r.reduce((
|
|
826
|
+
}, v), X.state.maps)
|
|
827
|
+
}), l = ce(
|
|
828
|
+
r.reduce((v, h) => (v[h.id] = {
|
|
837
829
|
instanceRef: {
|
|
838
830
|
current: null
|
|
839
831
|
},
|
|
840
832
|
overlayRef: {
|
|
841
833
|
current: null
|
|
842
834
|
}
|
|
843
|
-
},
|
|
844
|
-
), f =
|
|
845
|
-
(
|
|
846
|
-
r[0].id ===
|
|
835
|
+
}, v), {})
|
|
836
|
+
), f = O(
|
|
837
|
+
(v, h, A) => {
|
|
838
|
+
r[0].id === v && a?.({
|
|
847
839
|
type: h,
|
|
848
|
-
payload:
|
|
840
|
+
payload: A
|
|
849
841
|
});
|
|
850
842
|
},
|
|
851
843
|
[a, r]
|
|
852
|
-
), y =
|
|
853
|
-
(
|
|
844
|
+
), y = O(
|
|
845
|
+
(v, h) => {
|
|
854
846
|
o({
|
|
855
|
-
type:
|
|
847
|
+
type: k.SetViewState,
|
|
856
848
|
payload: {
|
|
857
849
|
id: h,
|
|
858
|
-
viewState:
|
|
850
|
+
viewState: v
|
|
859
851
|
}
|
|
860
|
-
}), f(h,
|
|
852
|
+
}), f(h, k.SetViewState, v);
|
|
861
853
|
},
|
|
862
854
|
[o, f]
|
|
863
|
-
), c =
|
|
864
|
-
({ height:
|
|
855
|
+
), c = O(
|
|
856
|
+
({ height: v, width: h }, A) => {
|
|
865
857
|
o({
|
|
866
|
-
type:
|
|
858
|
+
type: k.SetResize,
|
|
867
859
|
payload: {
|
|
868
|
-
id:
|
|
869
|
-
height:
|
|
860
|
+
id: A,
|
|
861
|
+
height: v,
|
|
870
862
|
width: h
|
|
871
863
|
}
|
|
872
|
-
}), f(
|
|
864
|
+
}), f(A, k.SetResize, { height: v, width: h });
|
|
873
865
|
},
|
|
874
866
|
[o, f]
|
|
875
|
-
),
|
|
876
|
-
(
|
|
867
|
+
), m = O(
|
|
868
|
+
(v, h) => {
|
|
877
869
|
o({
|
|
878
|
-
type:
|
|
870
|
+
type: k.SetBasemap,
|
|
879
871
|
payload: {
|
|
880
872
|
id: h,
|
|
881
|
-
basemap:
|
|
873
|
+
basemap: v
|
|
882
874
|
}
|
|
883
875
|
});
|
|
884
876
|
},
|
|
885
877
|
[o]
|
|
886
|
-
),
|
|
887
|
-
(
|
|
878
|
+
), E = O(
|
|
879
|
+
(v, h) => {
|
|
888
880
|
o({
|
|
889
|
-
type:
|
|
881
|
+
type: k.SetZoom,
|
|
890
882
|
payload: {
|
|
891
883
|
id: h,
|
|
892
|
-
zoom:
|
|
884
|
+
zoom: v
|
|
893
885
|
}
|
|
894
886
|
});
|
|
895
887
|
},
|
|
896
888
|
[o]
|
|
897
|
-
),
|
|
898
|
-
(
|
|
889
|
+
), _ = O(
|
|
890
|
+
(v, h) => {
|
|
899
891
|
o({
|
|
900
|
-
type:
|
|
892
|
+
type: k.SetLoaded,
|
|
901
893
|
payload: {
|
|
902
894
|
id: h,
|
|
903
|
-
value:
|
|
895
|
+
value: v
|
|
904
896
|
}
|
|
905
897
|
});
|
|
906
898
|
},
|
|
907
899
|
[o]
|
|
908
|
-
),
|
|
900
|
+
), b = ce({
|
|
909
901
|
setViewState: y,
|
|
910
|
-
setBasemap:
|
|
902
|
+
setBasemap: m,
|
|
911
903
|
setResize: c,
|
|
912
|
-
setZoom:
|
|
913
|
-
setLoaded:
|
|
904
|
+
setZoom: E,
|
|
905
|
+
setLoaded: _
|
|
914
906
|
});
|
|
915
|
-
return /* @__PURE__ */
|
|
907
|
+
return /* @__PURE__ */ Z.jsx(ut.Provider, { value: b.current, children: /* @__PURE__ */ Z.jsx(ct.Provider, { value: l, children: /* @__PURE__ */ Z.jsx(st.Provider, { value: s, children: t }) }) });
|
|
916
908
|
}
|
|
917
|
-
const
|
|
909
|
+
const lt = {
|
|
918
910
|
NUMBER: {
|
|
919
911
|
style: "decimal",
|
|
920
912
|
maximumFractionDigits: 1,
|
|
@@ -936,27 +928,27 @@ const ct = {
|
|
|
936
928
|
day: "2-digit"
|
|
937
929
|
}
|
|
938
930
|
};
|
|
939
|
-
function
|
|
931
|
+
function ft(t, r, a) {
|
|
940
932
|
return Intl.NumberFormat(r, a).format(t);
|
|
941
933
|
}
|
|
942
|
-
function
|
|
943
|
-
return
|
|
934
|
+
function dt(t, r, a = {}) {
|
|
935
|
+
return ft(t, r, { ...lt.NUMBER, ...a });
|
|
944
936
|
}
|
|
945
937
|
function fr(t, r, a = {}) {
|
|
946
|
-
return
|
|
938
|
+
return ft(t, r, { ...lt.CURRENCY, ...a });
|
|
947
939
|
}
|
|
948
|
-
var
|
|
949
|
-
const
|
|
950
|
-
[
|
|
951
|
-
type:
|
|
940
|
+
var F = /* @__PURE__ */ ((t) => (t.CURRENCY = "CURRENCY", t.DEFAULT = "DEFAULT", t.NUMBER = "NUMBER", t))(F || {});
|
|
941
|
+
const Qe = {
|
|
942
|
+
[F.CURRENCY]: {
|
|
943
|
+
type: F.CURRENCY,
|
|
952
944
|
format: (t, r) => fr(t, r)
|
|
953
945
|
},
|
|
954
|
-
[
|
|
955
|
-
type:
|
|
956
|
-
format: (t, r) =>
|
|
946
|
+
[F.NUMBER]: {
|
|
947
|
+
type: F.NUMBER,
|
|
948
|
+
format: (t, r) => dt(t, r)
|
|
957
949
|
},
|
|
958
|
-
[
|
|
959
|
-
type:
|
|
950
|
+
[F.DEFAULT]: {
|
|
951
|
+
type: F.DEFAULT,
|
|
960
952
|
format: (t) => t.toLocaleString()
|
|
961
953
|
}
|
|
962
954
|
};
|
|
@@ -968,23 +960,23 @@ function en({
|
|
|
968
960
|
showColumnName: o = !0,
|
|
969
961
|
title: l,
|
|
970
962
|
getColumnName: f = gr,
|
|
971
|
-
getFieldHtml: y =
|
|
963
|
+
getFieldHtml: y = pr,
|
|
972
964
|
getTitle: c = dr,
|
|
973
|
-
getValue:
|
|
965
|
+
getValue: m = mr
|
|
974
966
|
}) {
|
|
975
|
-
const
|
|
976
|
-
const
|
|
977
|
-
return
|
|
967
|
+
const E = l ? c(l) : "", b = a.reduce((v, h) => {
|
|
968
|
+
const A = r[h], U = t[h], j = m(U, s, A), P = o ? f(h) : "";
|
|
969
|
+
return v + y(P, j);
|
|
978
970
|
}, "");
|
|
979
|
-
return
|
|
971
|
+
return E + b;
|
|
980
972
|
}
|
|
981
973
|
function dr(t) {
|
|
982
974
|
return `<h3 style="margin: 0"><strong>${t}</strong></h3></br>`;
|
|
983
975
|
}
|
|
984
|
-
function
|
|
976
|
+
function pr(t, r) {
|
|
985
977
|
return `${t}${r}</br>`;
|
|
986
978
|
}
|
|
987
|
-
function
|
|
979
|
+
function mr(t, r, a) {
|
|
988
980
|
try {
|
|
989
981
|
return vr(a)(t, r);
|
|
990
982
|
} catch {
|
|
@@ -992,19 +984,19 @@ function pr(t, r, a) {
|
|
|
992
984
|
}
|
|
993
985
|
}
|
|
994
986
|
function vr(t) {
|
|
995
|
-
return typeof t == "function" ? t : (t &&
|
|
987
|
+
return typeof t == "function" ? t : (t && Qe[t] || Qe[F.DEFAULT]).format;
|
|
996
988
|
}
|
|
997
989
|
function gr(t) {
|
|
998
990
|
return `<strong>${t}</strong>: `;
|
|
999
991
|
}
|
|
1000
992
|
function yr(t) {
|
|
1001
|
-
return
|
|
993
|
+
return Se[t]?.type;
|
|
1002
994
|
}
|
|
1003
995
|
function hr(t) {
|
|
1004
|
-
return yr(t) ===
|
|
996
|
+
return yr(t) === it.GoogleMaps;
|
|
1005
997
|
}
|
|
1006
998
|
function Er({ mapId: t }) {
|
|
1007
|
-
const { isLoaded: r, basemap: a } =
|
|
999
|
+
const { isLoaded: r, basemap: a } = Te(t), { getOverlayInstance: s } = Pe(t);
|
|
1008
1000
|
return Qt(() => {
|
|
1009
1001
|
if (!r || !hr(a))
|
|
1010
1002
|
return null;
|
|
@@ -1012,15 +1004,15 @@ function Er({ mapId: t }) {
|
|
|
1012
1004
|
return new er(l, {});
|
|
1013
1005
|
}, [r, s, a]);
|
|
1014
1006
|
}
|
|
1015
|
-
var C = /* @__PURE__ */ ((t) => (t.milimeter = "milimeter", t.centimeter = "centimeter", t.meter = "meter", t.kilometer = "kilometer", t.mile = "mile", t.feet = "feet", t))(C || {}),
|
|
1016
|
-
const
|
|
1007
|
+
var C = /* @__PURE__ */ ((t) => (t.milimeter = "milimeter", t.centimeter = "centimeter", t.meter = "meter", t.kilometer = "kilometer", t.mile = "mile", t.feet = "feet", t))(C || {}), pt = /* @__PURE__ */ ((t) => (t.meters = "meters", t.kilometer = "kilometers", t.mile = "miles", t))(pt || {}), ue = /* @__PURE__ */ ((t) => (t.AddPosition = "addPosition", t.Finish = "finish", t))(ue || {});
|
|
1008
|
+
const et = [
|
|
1017
1009
|
"anyclick",
|
|
1018
1010
|
"pointermove",
|
|
1019
1011
|
"panstart",
|
|
1020
1012
|
"panmove",
|
|
1021
1013
|
"panend",
|
|
1022
1014
|
"keyup"
|
|
1023
|
-
], br = "mapMeasureLayer",
|
|
1015
|
+
], br = "mapMeasureLayer", Sr = {
|
|
1024
1016
|
id: br,
|
|
1025
1017
|
pickable: !1,
|
|
1026
1018
|
billboard: !1,
|
|
@@ -1046,17 +1038,17 @@ const Xe = [
|
|
|
1046
1038
|
getLineWidth: 2
|
|
1047
1039
|
}
|
|
1048
1040
|
}
|
|
1049
|
-
},
|
|
1041
|
+
}, Re = {
|
|
1050
1042
|
editing: [71, 219, 153, 255],
|
|
1051
1043
|
finished: [49, 153, 107, 255]
|
|
1052
|
-
},
|
|
1044
|
+
}, _r = {
|
|
1053
1045
|
styles: {
|
|
1054
1046
|
colors: {
|
|
1055
|
-
editing:
|
|
1056
|
-
finished:
|
|
1047
|
+
editing: Re.editing,
|
|
1048
|
+
finished: Re.finished
|
|
1057
1049
|
}
|
|
1058
1050
|
}
|
|
1059
|
-
},
|
|
1051
|
+
}, tt = {
|
|
1060
1052
|
[C.kilometer]: "km",
|
|
1061
1053
|
[C.centimeter]: "cm",
|
|
1062
1054
|
[C.milimeter]: "mm",
|
|
@@ -1078,7 +1070,7 @@ class Tr extends tr {
|
|
|
1078
1070
|
}
|
|
1079
1071
|
_addEventHandlers() {
|
|
1080
1072
|
const r = this._getEventManager(), { eventHandler: a } = this.state._editableLayerState;
|
|
1081
|
-
for (const s of
|
|
1073
|
+
for (const s of et)
|
|
1082
1074
|
r.on(s, a, {
|
|
1083
1075
|
// give nebula a higher priority so that it can stop propagation to deck.gl's map panning handlers
|
|
1084
1076
|
priority: 100
|
|
@@ -1086,7 +1078,7 @@ class Tr extends tr {
|
|
|
1086
1078
|
}
|
|
1087
1079
|
_removeEventHandlers(r = void 0) {
|
|
1088
1080
|
const a = r || this._getEventManager(), { eventHandler: s } = this.state._editableLayerState;
|
|
1089
|
-
for (const o of
|
|
1081
|
+
for (const o of et)
|
|
1090
1082
|
a.off(o, s);
|
|
1091
1083
|
}
|
|
1092
1084
|
_getEventManager() {
|
|
@@ -1094,15 +1086,16 @@ class Tr extends tr {
|
|
|
1094
1086
|
this.context.deck.eventManager;
|
|
1095
1087
|
}
|
|
1096
1088
|
}
|
|
1097
|
-
class
|
|
1089
|
+
class Pr extends rr {
|
|
1098
1090
|
handleClick(r, a) {
|
|
1099
1091
|
super.handleClick(r, a), a.onEdit({
|
|
1100
1092
|
// data is the same
|
|
1101
1093
|
updatedData: a.data,
|
|
1102
|
-
editType:
|
|
1094
|
+
editType: ue.AddPosition,
|
|
1103
1095
|
editContext: {
|
|
1104
1096
|
distance: this._currentDistance,
|
|
1105
|
-
finished: this._isMeasuringSessionFinished
|
|
1097
|
+
finished: this._isMeasuringSessionFinished,
|
|
1098
|
+
positions: this._clickSequence
|
|
1106
1099
|
}
|
|
1107
1100
|
});
|
|
1108
1101
|
}
|
|
@@ -1116,7 +1109,7 @@ class Mr extends rr {
|
|
|
1116
1109
|
case "Escape":
|
|
1117
1110
|
this._isMeasuringSessionFinished = !0, o === 1 && (this.resetClickSequence(), this._currentTooltips = []), a.onUpdateCursor("cell"), a.onEdit({
|
|
1118
1111
|
updatedData: a.data,
|
|
1119
|
-
editType:
|
|
1112
|
+
editType: ue.Finish,
|
|
1120
1113
|
editContext: {
|
|
1121
1114
|
finished: this._isMeasuringSessionFinished
|
|
1122
1115
|
}
|
|
@@ -1126,9 +1119,9 @@ class Mr extends rr {
|
|
|
1126
1119
|
}
|
|
1127
1120
|
}
|
|
1128
1121
|
var Or = function(r) {
|
|
1129
|
-
return
|
|
1122
|
+
return Mr(r) && !Cr(r);
|
|
1130
1123
|
};
|
|
1131
|
-
function
|
|
1124
|
+
function Mr(t) {
|
|
1132
1125
|
return !!t && typeof t == "object";
|
|
1133
1126
|
}
|
|
1134
1127
|
function Cr(t) {
|
|
@@ -1142,29 +1135,29 @@ function xr(t) {
|
|
|
1142
1135
|
function Ar(t) {
|
|
1143
1136
|
return Array.isArray(t) ? [] : {};
|
|
1144
1137
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return r.clone !== !1 && r.isMergeableObject(t) ?
|
|
1138
|
+
function Q(t, r) {
|
|
1139
|
+
return r.clone !== !1 && r.isMergeableObject(t) ? B(Ar(t), t, r) : t;
|
|
1147
1140
|
}
|
|
1148
1141
|
function Dr(t, r, a) {
|
|
1149
1142
|
return t.concat(r).map(function(s) {
|
|
1150
|
-
return
|
|
1143
|
+
return Q(s, a);
|
|
1151
1144
|
});
|
|
1152
1145
|
}
|
|
1153
1146
|
function kr(t, r) {
|
|
1154
1147
|
if (!r.customMerge)
|
|
1155
|
-
return
|
|
1148
|
+
return B;
|
|
1156
1149
|
var a = r.customMerge(t);
|
|
1157
|
-
return typeof a == "function" ? a :
|
|
1150
|
+
return typeof a == "function" ? a : B;
|
|
1158
1151
|
}
|
|
1159
1152
|
function Fr(t) {
|
|
1160
1153
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
|
|
1161
1154
|
return Object.propertyIsEnumerable.call(t, r);
|
|
1162
1155
|
}) : [];
|
|
1163
1156
|
}
|
|
1164
|
-
function
|
|
1157
|
+
function rt(t) {
|
|
1165
1158
|
return Object.keys(t).concat(Fr(t));
|
|
1166
1159
|
}
|
|
1167
|
-
function
|
|
1160
|
+
function mt(t, r) {
|
|
1168
1161
|
try {
|
|
1169
1162
|
return r in t;
|
|
1170
1163
|
} catch {
|
|
@@ -1172,57 +1165,59 @@ function dt(t, r) {
|
|
|
1172
1165
|
}
|
|
1173
1166
|
}
|
|
1174
1167
|
function Lr(t, r) {
|
|
1175
|
-
return
|
|
1168
|
+
return mt(t, r) && !(Object.hasOwnProperty.call(t, r) && Object.propertyIsEnumerable.call(t, r));
|
|
1176
1169
|
}
|
|
1177
1170
|
function Ir(t, r, a) {
|
|
1178
1171
|
var s = {};
|
|
1179
|
-
return a.isMergeableObject(t) &&
|
|
1180
|
-
s[o] =
|
|
1181
|
-
}),
|
|
1182
|
-
Lr(t, o) || (
|
|
1172
|
+
return a.isMergeableObject(t) && rt(t).forEach(function(o) {
|
|
1173
|
+
s[o] = Q(t[o], a);
|
|
1174
|
+
}), rt(r).forEach(function(o) {
|
|
1175
|
+
Lr(t, o) || (mt(t, o) && a.isMergeableObject(r[o]) ? s[o] = kr(o, a)(t[o], r[o], a) : s[o] = Q(r[o], a));
|
|
1183
1176
|
}), s;
|
|
1184
1177
|
}
|
|
1185
|
-
function
|
|
1186
|
-
a = a || {}, a.arrayMerge = a.arrayMerge || Dr, a.isMergeableObject = a.isMergeableObject || Or, a.cloneUnlessOtherwiseSpecified =
|
|
1178
|
+
function B(t, r, a) {
|
|
1179
|
+
a = a || {}, a.arrayMerge = a.arrayMerge || Dr, a.isMergeableObject = a.isMergeableObject || Or, a.cloneUnlessOtherwiseSpecified = Q;
|
|
1187
1180
|
var s = Array.isArray(r), o = Array.isArray(t), l = s === o;
|
|
1188
|
-
return l ? s ? a.arrayMerge(t, r, a) : Ir(t, r, a) :
|
|
1181
|
+
return l ? s ? a.arrayMerge(t, r, a) : Ir(t, r, a) : Q(r, a);
|
|
1189
1182
|
}
|
|
1190
|
-
|
|
1183
|
+
B.all = function(r, a) {
|
|
1191
1184
|
if (!Array.isArray(r))
|
|
1192
1185
|
throw new Error("first argument should be an array");
|
|
1193
1186
|
return r.reduce(function(s, o) {
|
|
1194
|
-
return
|
|
1187
|
+
return B(s, o, a);
|
|
1195
1188
|
}, {});
|
|
1196
1189
|
};
|
|
1197
|
-
var Nr =
|
|
1198
|
-
const
|
|
1190
|
+
var Nr = B, Ur = Nr;
|
|
1191
|
+
const se = /* @__PURE__ */ cr(Ur), Y = () => {
|
|
1199
1192
|
throw new Error(
|
|
1200
1193
|
"You forgot to wrap your component in <MeasurementToolsProvider>."
|
|
1201
1194
|
);
|
|
1202
|
-
},
|
|
1195
|
+
}, Oe = {
|
|
1203
1196
|
state: {
|
|
1204
1197
|
enable: !1,
|
|
1205
1198
|
finished: !0,
|
|
1206
1199
|
distance: 0,
|
|
1207
1200
|
locale: "en",
|
|
1208
|
-
unit: C.kilometer
|
|
1201
|
+
unit: C.kilometer,
|
|
1202
|
+
positions: []
|
|
1209
1203
|
},
|
|
1210
1204
|
actions: {
|
|
1211
|
-
setEnable:
|
|
1212
|
-
setFinished:
|
|
1213
|
-
setUnit:
|
|
1214
|
-
setDistance:
|
|
1215
|
-
setLocale:
|
|
1205
|
+
setEnable: Y,
|
|
1206
|
+
setFinished: Y,
|
|
1207
|
+
setUnit: Y,
|
|
1208
|
+
setDistance: Y,
|
|
1209
|
+
setLocale: Y,
|
|
1210
|
+
setPositions: Y
|
|
1216
1211
|
}
|
|
1217
|
-
},
|
|
1218
|
-
function
|
|
1219
|
-
return
|
|
1220
|
-
|
|
1212
|
+
}, vt = ee(Oe.state), gt = ee(Oe.actions);
|
|
1213
|
+
function yt() {
|
|
1214
|
+
return te(
|
|
1215
|
+
vt
|
|
1221
1216
|
);
|
|
1222
1217
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1225
|
-
|
|
1218
|
+
function ht() {
|
|
1219
|
+
return te(
|
|
1220
|
+
gt
|
|
1226
1221
|
);
|
|
1227
1222
|
}
|
|
1228
1223
|
const Vr = {
|
|
@@ -1345,15 +1340,15 @@ const Vr = {
|
|
|
1345
1340
|
}, Br = nr({
|
|
1346
1341
|
length: Yr
|
|
1347
1342
|
});
|
|
1348
|
-
function
|
|
1349
|
-
return Br(t).from(
|
|
1343
|
+
function Et(t, r) {
|
|
1344
|
+
return Br(t).from(tt[C.meter]).to(tt[r]);
|
|
1350
1345
|
}
|
|
1351
|
-
function
|
|
1346
|
+
function bt({
|
|
1352
1347
|
meters: t,
|
|
1353
1348
|
unit: r,
|
|
1354
1349
|
locale: a
|
|
1355
1350
|
}) {
|
|
1356
|
-
return `${
|
|
1351
|
+
return `${dt(Et(t, r), a, {
|
|
1357
1352
|
style: "unit",
|
|
1358
1353
|
unit: Rr[r],
|
|
1359
1354
|
unitDisplay: "short"
|
|
@@ -1366,47 +1361,49 @@ function tn(t, {
|
|
|
1366
1361
|
}
|
|
1367
1362
|
function rn({
|
|
1368
1363
|
mapId: t,
|
|
1369
|
-
defaultProps: { styles: r =
|
|
1364
|
+
defaultProps: { styles: r = _r.styles } = {},
|
|
1370
1365
|
layerProps: a = {}
|
|
1371
1366
|
}) {
|
|
1372
|
-
const { enable: s, unit: o, finished: l, locale: f } =
|
|
1373
|
-
({ editType:
|
|
1374
|
-
|
|
1367
|
+
const { enable: s, unit: o, finished: l, locale: f } = yt(), { setDistance: y, setFinished: c, setPositions: m } = ht(), { isLoaded: E } = Te(t), _ = ce(), b = Er({ mapId: t }), v = l ? r.colors?.finished : r.colors?.editing, h = O(
|
|
1368
|
+
({ editType: le, editContext: W }) => {
|
|
1369
|
+
le === ue.AddPosition && y(W.distance), c(W.finished);
|
|
1370
|
+
const re = W.positions;
|
|
1371
|
+
re?.length && m(re);
|
|
1375
1372
|
},
|
|
1376
|
-
[y, c]
|
|
1373
|
+
[y, c, m]
|
|
1377
1374
|
);
|
|
1378
|
-
if (
|
|
1379
|
-
s || (
|
|
1375
|
+
if (ot(() => {
|
|
1376
|
+
s || (_.current = void 0);
|
|
1380
1377
|
}, [s]), !s || !E)
|
|
1381
1378
|
return null;
|
|
1382
|
-
const { pickable:
|
|
1379
|
+
const { pickable: A, onHover: U, ...j } = Wr(
|
|
1383
1380
|
a,
|
|
1384
1381
|
f,
|
|
1385
1382
|
o,
|
|
1386
|
-
|
|
1387
|
-
|
|
1383
|
+
h,
|
|
1384
|
+
v || Re.guide
|
|
1388
1385
|
);
|
|
1389
|
-
return !
|
|
1390
|
-
...
|
|
1391
|
-
pickable:
|
|
1392
|
-
onHover: l ?
|
|
1393
|
-
mode:
|
|
1386
|
+
return !_.current && !j.mode && (_.current = new Pr()), new Tr({
|
|
1387
|
+
...j,
|
|
1388
|
+
pickable: A || !l,
|
|
1389
|
+
onHover: l ? U : void 0,
|
|
1390
|
+
mode: j?.mode || _.current,
|
|
1394
1391
|
eventManager: b
|
|
1395
1392
|
});
|
|
1396
1393
|
}
|
|
1397
1394
|
function Wr(t, r, a, s, o) {
|
|
1398
|
-
const l =
|
|
1395
|
+
const l = se(t, {
|
|
1399
1396
|
modeConfig: {
|
|
1400
1397
|
// We force distance due to conversion is addressed at feature getText level
|
|
1401
1398
|
formatTooltip: (c) => c,
|
|
1402
1399
|
turfOptions: {
|
|
1403
|
-
units:
|
|
1400
|
+
units: pt.meters
|
|
1404
1401
|
}
|
|
1405
1402
|
},
|
|
1406
1403
|
onEdit: s,
|
|
1407
1404
|
_subLayerProps: {
|
|
1408
1405
|
tooltips: {
|
|
1409
|
-
getText: (c) =>
|
|
1406
|
+
getText: (c) => bt({
|
|
1410
1407
|
...c,
|
|
1411
1408
|
meters: c.text,
|
|
1412
1409
|
locale: r,
|
|
@@ -1417,7 +1414,7 @@ function Wr(t, r, a, s, o) {
|
|
|
1417
1414
|
}
|
|
1418
1415
|
}
|
|
1419
1416
|
}
|
|
1420
|
-
}), f =
|
|
1417
|
+
}), f = se(Sr, {
|
|
1421
1418
|
_subLayerProps: {
|
|
1422
1419
|
guides: {
|
|
1423
1420
|
getLineColor: o,
|
|
@@ -1427,22 +1424,29 @@ function Wr(t, r, a, s, o) {
|
|
|
1427
1424
|
getEditHandlePointColor: o,
|
|
1428
1425
|
getEditHandlePointOutlineColor: o
|
|
1429
1426
|
});
|
|
1430
|
-
return
|
|
1427
|
+
return se(f, l);
|
|
1431
1428
|
}
|
|
1432
1429
|
function nn({ children: t }) {
|
|
1433
|
-
const {
|
|
1434
|
-
|
|
1430
|
+
const {
|
|
1431
|
+
distance: r,
|
|
1432
|
+
enable: a,
|
|
1433
|
+
unit: s,
|
|
1434
|
+
locale: o,
|
|
1435
|
+
positions: l
|
|
1436
|
+
} = yt(), { setDistance: f, setEnable: y } = ht(), c = Et(r, s), m = () => {
|
|
1437
|
+
f(0), y(!a);
|
|
1435
1438
|
};
|
|
1436
1439
|
return t({
|
|
1437
1440
|
enable: a,
|
|
1438
1441
|
meters: r,
|
|
1439
|
-
text:
|
|
1440
|
-
distance:
|
|
1442
|
+
text: bt({ meters: r, unit: s, locale: o }),
|
|
1443
|
+
distance: c,
|
|
1441
1444
|
unit: s,
|
|
1442
|
-
onToggleButton:
|
|
1445
|
+
onToggleButton: m,
|
|
1446
|
+
positions: l
|
|
1443
1447
|
});
|
|
1444
1448
|
}
|
|
1445
|
-
var
|
|
1449
|
+
var N = /* @__PURE__ */ ((t) => (t.SetEnable = "SET_ENABLE", t.SetFinished = "SET_FINISHED", t.SetDistance = "SET_DISTANCE", t.SetUnit = "SET_UNIT", t.SetLocale = "SET_LOCALE", t.SetPositions = "SET_POSITIONS", t))(N || {});
|
|
1446
1450
|
function Hr(t, { type: r, payload: a }) {
|
|
1447
1451
|
return {
|
|
1448
1452
|
SET_ENABLE: () => ({
|
|
@@ -1465,6 +1469,10 @@ function Hr(t, { type: r, payload: a }) {
|
|
|
1465
1469
|
SET_LOCALE: () => ({
|
|
1466
1470
|
...t,
|
|
1467
1471
|
locale: a
|
|
1472
|
+
}),
|
|
1473
|
+
SET_POSITIONS: () => ({
|
|
1474
|
+
...t,
|
|
1475
|
+
positions: a
|
|
1468
1476
|
})
|
|
1469
1477
|
}[r]?.() ?? t;
|
|
1470
1478
|
}
|
|
@@ -1473,89 +1481,95 @@ function an({
|
|
|
1473
1481
|
defaultProps: r = {},
|
|
1474
1482
|
locale: a
|
|
1475
1483
|
}) {
|
|
1476
|
-
const [s, o] =
|
|
1484
|
+
const [s, o] = at(
|
|
1477
1485
|
Hr,
|
|
1478
|
-
|
|
1479
|
-
), l =
|
|
1486
|
+
se(Oe.state, r)
|
|
1487
|
+
), l = O(
|
|
1480
1488
|
(b) => {
|
|
1481
|
-
o({ type:
|
|
1489
|
+
o({ type: N.SetLocale, payload: b });
|
|
1482
1490
|
},
|
|
1483
1491
|
[o]
|
|
1484
1492
|
);
|
|
1485
|
-
|
|
1493
|
+
ot(() => {
|
|
1486
1494
|
a && l(a);
|
|
1487
1495
|
}, [a, l]);
|
|
1488
|
-
const f =
|
|
1496
|
+
const f = O(
|
|
1497
|
+
(b) => {
|
|
1498
|
+
o({ type: N.SetEnable, payload: b });
|
|
1499
|
+
},
|
|
1500
|
+
[o]
|
|
1501
|
+
), y = O(
|
|
1489
1502
|
(b) => {
|
|
1490
|
-
o({ type:
|
|
1503
|
+
o({ type: N.SetFinished, payload: b });
|
|
1491
1504
|
},
|
|
1492
1505
|
[o]
|
|
1493
|
-
),
|
|
1506
|
+
), c = O(
|
|
1494
1507
|
(b) => {
|
|
1495
|
-
o({ type:
|
|
1508
|
+
o({ type: N.SetDistance, payload: b });
|
|
1496
1509
|
},
|
|
1497
1510
|
[o]
|
|
1498
|
-
),
|
|
1511
|
+
), m = O(
|
|
1499
1512
|
(b) => {
|
|
1500
|
-
o({ type:
|
|
1513
|
+
o({ type: N.SetUnit, payload: b });
|
|
1501
1514
|
},
|
|
1502
1515
|
[o]
|
|
1503
|
-
), E =
|
|
1516
|
+
), E = O(
|
|
1504
1517
|
(b) => {
|
|
1505
|
-
o({ type:
|
|
1518
|
+
o({ type: N.SetPositions, payload: b });
|
|
1506
1519
|
},
|
|
1507
1520
|
[o]
|
|
1508
|
-
),
|
|
1521
|
+
), _ = ce({
|
|
1509
1522
|
setEnable: f,
|
|
1510
1523
|
setFinished: y,
|
|
1511
1524
|
setDistance: c,
|
|
1512
|
-
setUnit:
|
|
1513
|
-
setLocale: l
|
|
1525
|
+
setUnit: m,
|
|
1526
|
+
setLocale: l,
|
|
1527
|
+
setPositions: E
|
|
1514
1528
|
});
|
|
1515
|
-
return /* @__PURE__ */
|
|
1529
|
+
return /* @__PURE__ */ Z.jsx(gt.Provider, { value: _.current, children: /* @__PURE__ */ Z.jsx(vt.Provider, { value: s, children: t }) });
|
|
1516
1530
|
}
|
|
1517
1531
|
export {
|
|
1518
|
-
|
|
1519
|
-
|
|
1532
|
+
tt as CONVERSIONS_UNITS,
|
|
1533
|
+
be as CartoBasemapURL,
|
|
1520
1534
|
or as CartoBasemapsNames,
|
|
1521
1535
|
Tr as CustomEditableGeojsonLayer,
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1536
|
+
Pr as CustomMeasureDistanceMode,
|
|
1537
|
+
Re as DEFAULT_COLORS,
|
|
1538
|
+
Sr as DEFAULT_LAYER_PROPS,
|
|
1539
|
+
_r as DEFAULT_PROPS,
|
|
1540
|
+
et as EVENT_MANAGER_EVENT_TYPES,
|
|
1541
|
+
ue as EditType,
|
|
1542
|
+
F as FormatterTypes,
|
|
1529
1543
|
ar as GMapsBasemap,
|
|
1530
1544
|
Rr as INTL_UNITS,
|
|
1531
|
-
|
|
1545
|
+
Se as MAPS_BASEMAP,
|
|
1532
1546
|
br as MAP_MEASURE_LAYER_ID,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1547
|
+
k as MapActions,
|
|
1548
|
+
ut as MapActionsContext,
|
|
1549
|
+
st as MapContext,
|
|
1536
1550
|
nn as MapMeasurementTools,
|
|
1537
1551
|
rn as MapMeasurementToolsLayer,
|
|
1538
1552
|
an as MapMeasurementToolsProvider,
|
|
1539
1553
|
C as MapMeasurementUnit,
|
|
1540
|
-
|
|
1554
|
+
pt as MapMeasurementUnitTurf,
|
|
1541
1555
|
Qr as MapProvider,
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1556
|
+
ct as MapReferencesContext,
|
|
1557
|
+
it as MapsTypes,
|
|
1558
|
+
Et as convertMetersTo,
|
|
1545
1559
|
tn as getDeckController,
|
|
1546
1560
|
yr as getMapType,
|
|
1547
|
-
|
|
1561
|
+
bt as getTextLayerFormattedDistance,
|
|
1548
1562
|
hr as isGmaps,
|
|
1549
1563
|
en as objectToHtml,
|
|
1550
1564
|
ir as reducer,
|
|
1551
1565
|
Er as useEventManager,
|
|
1552
|
-
|
|
1566
|
+
Te as useMap,
|
|
1553
1567
|
sr as useMapActions,
|
|
1554
1568
|
Xr as useMapActionsByID,
|
|
1555
1569
|
Jr as useMapByID,
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1570
|
+
yt as useMapMeasurementTools,
|
|
1571
|
+
ht as useMapMeasurementToolsActions,
|
|
1572
|
+
Pe as useMapRefences,
|
|
1573
|
+
Pe as useMapReferences,
|
|
1560
1574
|
Zr as useMapReferencesByID
|
|
1561
1575
|
};
|