@ogc-maps/storybook-components 0.12.1 → 0.12.3
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/components/LayerEditor/LayerEditor.d.ts.map +1 -1
- package/dist/components/LegendEditor/LegendEditor.d.ts +2 -1
- package/dist/components/LegendEditor/LegendEditor.d.ts.map +1 -1
- package/dist/components/SelectionPanel/SelectionPanel.d.ts.map +1 -1
- package/dist/main.js +902 -900
- package/dist/utils/selection.d.ts +1 -1
- package/dist/utils/selection.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as
|
|
3
|
-
import { C as
|
|
4
|
-
import { E as
|
|
1
|
+
import { B as Ri } from "./BasemapSwitcher-BW7lyZ2Y.js";
|
|
2
|
+
import { C as zi } from "./CollapsibleControl-qo9daiD8.js";
|
|
3
|
+
import { C as Gi, f as qi, a as Wi } from "./CoordinateDisplay-PxPmVjpm.js";
|
|
4
|
+
import { E as Vi } from "./ExportButton-BsNrOvRE.js";
|
|
5
5
|
import { jsx as a, jsxs as l, Fragment as z } from "react/jsx-runtime";
|
|
6
6
|
import { useState as T, useEffect as q, useRef as H, useCallback as Be, useId as ze, useMemo as Ue } from "react";
|
|
7
|
-
import { F as
|
|
8
|
-
import { F as
|
|
9
|
-
import { L as
|
|
10
|
-
import { L as
|
|
11
|
-
import { LuRuler as Ke, LuPentagon as Qe, LuTrash2 as be, LuMousePointer2 as ea, LuSquareDashedMousePointer as aa,
|
|
12
|
-
import { Y as
|
|
13
|
-
import { a as
|
|
14
|
-
import { S as
|
|
15
|
-
import { s as
|
|
16
|
-
import { B as
|
|
17
|
-
import './style.css';function
|
|
7
|
+
import { F as Yi } from "./FeatureDetailPanel-CkFpdEKW.js";
|
|
8
|
+
import { F as Zi } from "./FeatureTooltip-DxzN-jnp.js";
|
|
9
|
+
import { L as Ki } from "./LayerPanel-SCdJ8948.js";
|
|
10
|
+
import { L as et } from "./Legend-BLWBzD7Y.js";
|
|
11
|
+
import { LuRuler as Ke, LuPentagon as Qe, LuTrash2 as be, LuMousePointer2 as ea, LuSquareDashedMousePointer as aa, LuPenTool as ia, LuList as ta, LuGripHorizontal as ra, LuDownload as la, LuX as pa, LuInfo as na } from "react-icons/lu";
|
|
12
|
+
import { Y as ua, Z as oa, _ as xe, U as Ge, o as qe, n as ye, W as ma, k as sa } from "./geo--Ta-t__y.js";
|
|
13
|
+
import { a as it, b as tt, c as rt, d as lt, $ as pt, a0 as nt, a1 as ut, a2 as ot, a3 as mt, a4 as st, e as ct, a5 as dt, f as ht, g as gt, h as bt, i as yt, j as ft, l as xt, m as wt, a6 as Nt, a7 as vt, p as kt, q as Ct, r as St, s as Tt, t as Dt, u as Lt, v as At, w as Et, x as It, y as Mt, z as Ft, A as Pt, B as Ot, C as jt, D as $t, E as Rt, F as Bt, G as zt, a8 as Ut, H as Gt, I as qt, J as Wt, K as _t, L as Vt, a9 as Ht, M as Yt, N as Xt, O as Zt, P as Jt, Q as Kt, R as Qt, S as er, T as ar, V as ir, X as tr } from "./geo--Ta-t__y.js";
|
|
14
|
+
import { S as lr } from "./SearchPanel-4Y12jfuP.js";
|
|
15
|
+
import { s as ca } from "./index-CtbLVsqD.js";
|
|
16
|
+
import { B as nr, a as ur, C as or, b as mr, c as sr, D as cr, d as dr, F as hr, e as gr, f as br, g as yr, G as fr, L as xr, h as wr, i as Nr, j as vr, k as kr, l as Cr, M as Sr, N as Tr, O as Dr, P as Lr, m as Ar, S as Er, n as Ir, o as Mr, p as Fr, q as Pr, r as Or, t as jr, u as $r, T as Rr, U as Br, V as zr, v as Ur } from "./index-CtbLVsqD.js";
|
|
17
|
+
import './style.css';function wi({
|
|
18
18
|
open: e,
|
|
19
19
|
layers: i,
|
|
20
20
|
availableFormats: t,
|
|
21
21
|
hasActiveFilter: r,
|
|
22
22
|
loading: p = !1,
|
|
23
|
-
progress:
|
|
23
|
+
progress: m,
|
|
24
24
|
error: n,
|
|
25
|
-
onExport:
|
|
25
|
+
onExport: f,
|
|
26
26
|
onClose: s
|
|
27
27
|
}) {
|
|
28
|
-
const [
|
|
28
|
+
const [h, d] = T(""), [x, v] = T(""), [u, c] = T(!0);
|
|
29
29
|
if (q(() => {
|
|
30
|
-
e && (d(i.length === 1 ? i[0].id : ""),
|
|
30
|
+
e && (d(i.length === 1 ? i[0].id : ""), v(t.length > 0 ? t[0].id : ""), c(!0));
|
|
31
31
|
}, [e, i, t]), !e) return null;
|
|
32
|
-
const
|
|
33
|
-
!
|
|
34
|
-
layer:
|
|
35
|
-
format:
|
|
36
|
-
filtered: C ?
|
|
32
|
+
const w = i.find((o) => o.id === h), N = t.find((o) => o.id === x), C = w != null && r(w.id), E = w != null && N != null && !p, O = () => {
|
|
33
|
+
!w || !N || f({
|
|
34
|
+
layer: w,
|
|
35
|
+
format: N,
|
|
36
|
+
filtered: C ? u : !1
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
return /* @__PURE__ */ a(
|
|
@@ -65,19 +65,19 @@ import './style.css';function xi({
|
|
|
65
65
|
"select",
|
|
66
66
|
{
|
|
67
67
|
id: "export-layer-select",
|
|
68
|
-
value:
|
|
69
|
-
onChange: (
|
|
68
|
+
value: h,
|
|
69
|
+
onChange: (o) => d(o.target.value),
|
|
70
70
|
className: "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-700",
|
|
71
71
|
children: [
|
|
72
72
|
/* @__PURE__ */ a("option", { value: "", disabled: !0, children: "Select a layer..." }),
|
|
73
|
-
i.map((
|
|
73
|
+
i.map((o) => /* @__PURE__ */ a("option", { value: o.id, children: o.label }, o.id))
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
] }),
|
|
78
78
|
/* @__PURE__ */ l("fieldset", { className: "mapui:mb-4", children: [
|
|
79
79
|
/* @__PURE__ */ a("legend", { className: "mapui:mb-1 mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Format" }),
|
|
80
|
-
/* @__PURE__ */ a("div", { className: "mapui:space-y-1", children: t.map((
|
|
80
|
+
/* @__PURE__ */ a("div", { className: "mapui:space-y-1", children: t.map((o) => /* @__PURE__ */ l(
|
|
81
81
|
"label",
|
|
82
82
|
{
|
|
83
83
|
className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2 mapui:rounded mapui:px-2 mapui:py-1.5 hover:mapui:bg-gray-50",
|
|
@@ -87,22 +87,22 @@ import './style.css';function xi({
|
|
|
87
87
|
{
|
|
88
88
|
type: "radio",
|
|
89
89
|
name: "export-format",
|
|
90
|
-
value:
|
|
91
|
-
checked:
|
|
92
|
-
onChange: () =>
|
|
90
|
+
value: o.id,
|
|
91
|
+
checked: x === o.id,
|
|
92
|
+
onChange: () => v(o.id),
|
|
93
93
|
className: "mapui:accent-blue-600"
|
|
94
94
|
}
|
|
95
95
|
),
|
|
96
96
|
/* @__PURE__ */ l("span", { className: "mapui:text-sm mapui:text-gray-700", children: [
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
o.label,
|
|
98
|
+
o.description && /* @__PURE__ */ l("span", { className: "mapui:ml-1 mapui:text-gray-400", children: [
|
|
99
99
|
"— ",
|
|
100
|
-
|
|
100
|
+
o.description
|
|
101
101
|
] })
|
|
102
102
|
] })
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
|
-
|
|
105
|
+
o.id
|
|
106
106
|
)) })
|
|
107
107
|
] }),
|
|
108
108
|
C && /* @__PURE__ */ l("label", { className: "mapui:mb-4 mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-2", children: [
|
|
@@ -110,14 +110,14 @@ import './style.css';function xi({
|
|
|
110
110
|
"input",
|
|
111
111
|
{
|
|
112
112
|
type: "checkbox",
|
|
113
|
-
checked:
|
|
114
|
-
onChange: (
|
|
113
|
+
checked: u,
|
|
114
|
+
onChange: (o) => c(o.target.checked),
|
|
115
115
|
className: "mapui:accent-blue-600"
|
|
116
116
|
}
|
|
117
117
|
),
|
|
118
118
|
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: "Apply current filters" })
|
|
119
119
|
] }),
|
|
120
|
-
p &&
|
|
120
|
+
p && m && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-blue-600", children: m }),
|
|
121
121
|
n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-sm mapui:text-red-600", children: n }),
|
|
122
122
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:justify-end mapui:gap-2", children: [
|
|
123
123
|
/* @__PURE__ */ a(
|
|
@@ -148,66 +148,66 @@ import './style.css';function xi({
|
|
|
148
148
|
}
|
|
149
149
|
);
|
|
150
150
|
}
|
|
151
|
-
const
|
|
151
|
+
const da = [
|
|
152
152
|
{ mode: "distance", icon: Ke, label: "Distance" },
|
|
153
153
|
{ mode: "area", icon: Qe, label: "Area" }
|
|
154
154
|
];
|
|
155
|
-
function
|
|
155
|
+
function ha(e, i) {
|
|
156
156
|
return e ? i === 0 ? "Click on the map to start measuring" : e === "distance" ? "Click to add points, double-click to finish" : i < 3 ? "Click to add points (min 3 for area)" : "Click to add points, double-click to close" : "Select a measurement mode";
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function Ni({
|
|
159
159
|
mode: e,
|
|
160
160
|
onModeChange: i,
|
|
161
161
|
points: t,
|
|
162
162
|
measurement: r,
|
|
163
163
|
unit: p,
|
|
164
|
-
onUnitChange:
|
|
164
|
+
onUnitChange: m,
|
|
165
165
|
onClear: n,
|
|
166
|
-
className:
|
|
166
|
+
className: f
|
|
167
167
|
}) {
|
|
168
|
-
const s = e ?
|
|
169
|
-
return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${
|
|
170
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children:
|
|
171
|
-
const
|
|
168
|
+
const s = e ? ua[e] : [];
|
|
169
|
+
return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${f ?? ""}`, children: [
|
|
170
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: da.map(({ mode: h, icon: d, label: x }) => {
|
|
171
|
+
const v = e === h;
|
|
172
172
|
return /* @__PURE__ */ l(
|
|
173
173
|
"button",
|
|
174
174
|
{
|
|
175
175
|
type: "button",
|
|
176
|
-
onClick: () => i(
|
|
177
|
-
"aria-label":
|
|
178
|
-
"aria-pressed":
|
|
176
|
+
onClick: () => i(v ? null : h),
|
|
177
|
+
"aria-label": x,
|
|
178
|
+
"aria-pressed": v,
|
|
179
179
|
className: [
|
|
180
180
|
"mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:transition-colors",
|
|
181
|
-
|
|
181
|
+
v ? "mapui:bg-blue-600 mapui:text-white" : "mapui:bg-gray-100 mapui:text-gray-700 hover:mapui:bg-gray-200"
|
|
182
182
|
].join(" "),
|
|
183
183
|
children: [
|
|
184
184
|
/* @__PURE__ */ a(d, { size: 16 }),
|
|
185
|
-
|
|
185
|
+
x
|
|
186
186
|
]
|
|
187
187
|
},
|
|
188
|
-
|
|
188
|
+
h
|
|
189
189
|
);
|
|
190
190
|
}) }),
|
|
191
191
|
e && /* @__PURE__ */ l(z, { children: [
|
|
192
|
-
/* @__PURE__ */ a("div", { className: "mapui:text-center", children: /* @__PURE__ */ a("div", { className: "mapui:text-2xl mapui:font-semibold mapui:text-gray-900", children: r ?
|
|
193
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: s.map((
|
|
194
|
-
const d = p ===
|
|
192
|
+
/* @__PURE__ */ a("div", { className: "mapui:text-center", children: /* @__PURE__ */ a("div", { className: "mapui:text-2xl mapui:font-semibold mapui:text-gray-900", children: r ? oa(r) : "—" }) }),
|
|
193
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: s.map((h) => {
|
|
194
|
+
const d = p === h;
|
|
195
195
|
return /* @__PURE__ */ a(
|
|
196
196
|
"button",
|
|
197
197
|
{
|
|
198
198
|
type: "button",
|
|
199
|
-
onClick: () =>
|
|
200
|
-
"aria-label": `Unit: ${xe[
|
|
199
|
+
onClick: () => m(h),
|
|
200
|
+
"aria-label": `Unit: ${xe[h]}`,
|
|
201
201
|
className: [
|
|
202
202
|
"mapui:flex-1 mapui:rounded mapui:px-2 mapui:py-1 mapui:text-xs mapui:font-medium mapui:transition-colors",
|
|
203
203
|
d ? "mapui:bg-blue-100 mapui:text-blue-700" : "mapui:bg-gray-50 mapui:text-gray-500 hover:mapui:bg-gray-100"
|
|
204
204
|
].join(" "),
|
|
205
|
-
children: xe[
|
|
205
|
+
children: xe[h]
|
|
206
206
|
},
|
|
207
|
-
|
|
207
|
+
h
|
|
208
208
|
);
|
|
209
209
|
}) }),
|
|
210
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children:
|
|
210
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children: ha(e, t.length) }),
|
|
211
211
|
t.length > 0 && /* @__PURE__ */ l(
|
|
212
212
|
"button",
|
|
213
213
|
{
|
|
@@ -223,25 +223,26 @@ function wi({
|
|
|
223
223
|
] })
|
|
224
224
|
] });
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const ga = [
|
|
227
227
|
{ mode: "click", icon: ea, label: "Click" },
|
|
228
|
-
{ mode: "box", icon: aa, label: "Box" }
|
|
228
|
+
{ mode: "box", icon: aa, label: "Box" },
|
|
229
|
+
{ mode: "polygon", icon: ia, label: "Polygon" }
|
|
229
230
|
];
|
|
230
|
-
function
|
|
231
|
-
return i ? e ? t === 0 ? e === "click" ? "Click on features to select them" : "Click and drag to draw a selection box" : `${t} feature${t !== 1 ? "s" : ""} selected` : "Choose a selection mode" : "Select a layer to begin";
|
|
231
|
+
function ba(e, i, t) {
|
|
232
|
+
return i ? e ? t === 0 ? e === "click" ? "Click on features to select them" : e === "box" ? "Click and drag to draw a selection box" : e === "polygon" ? "Click to add points, double-click to finish" : "Choose a selection mode" : `${t} feature${t !== 1 ? "s" : ""} selected` : "Choose a selection mode" : "Select a layer to begin";
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
+
function vi({
|
|
234
235
|
mode: e,
|
|
235
236
|
onModeChange: i,
|
|
236
237
|
layers: t,
|
|
237
238
|
activeLayerId: r,
|
|
238
239
|
onActiveLayerChange: p,
|
|
239
|
-
selectedCount:
|
|
240
|
+
selectedCount: m,
|
|
240
241
|
onClear: n,
|
|
241
|
-
onViewResults:
|
|
242
|
+
onViewResults: f,
|
|
242
243
|
className: s
|
|
243
244
|
}) {
|
|
244
|
-
const
|
|
245
|
+
const h = t.filter((d) => d.visible);
|
|
245
246
|
return /* @__PURE__ */ l("div", { className: `mapui:flex mapui:flex-col mapui:gap-3 ${s ?? ""}`, children: [
|
|
246
247
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
247
248
|
/* @__PURE__ */ a("label", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Layer" }),
|
|
@@ -253,43 +254,43 @@ function Ni({
|
|
|
253
254
|
className: "mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1.5 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500",
|
|
254
255
|
children: [
|
|
255
256
|
/* @__PURE__ */ a("option", { value: "", children: "Select a layer…" }),
|
|
256
|
-
|
|
257
|
+
h.map((d) => /* @__PURE__ */ a("option", { value: d.id, children: d.label }, d.id))
|
|
257
258
|
]
|
|
258
259
|
}
|
|
259
260
|
)
|
|
260
261
|
] }),
|
|
261
262
|
r && /* @__PURE__ */ l(z, { children: [
|
|
262
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children:
|
|
263
|
-
const
|
|
263
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: ga.map(({ mode: d, icon: x, label: v }) => {
|
|
264
|
+
const u = e === d;
|
|
264
265
|
return /* @__PURE__ */ l(
|
|
265
266
|
"button",
|
|
266
267
|
{
|
|
267
268
|
type: "button",
|
|
268
|
-
onClick: () => i(
|
|
269
|
-
"aria-label":
|
|
270
|
-
"aria-pressed":
|
|
269
|
+
onClick: () => i(u ? null : d),
|
|
270
|
+
"aria-label": v,
|
|
271
|
+
"aria-pressed": u,
|
|
271
272
|
className: [
|
|
272
273
|
"mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:transition-colors",
|
|
273
|
-
|
|
274
|
+
u ? "mapui:bg-blue-600 mapui:text-white" : "mapui:bg-gray-100 mapui:text-gray-700 hover:mapui:bg-gray-200"
|
|
274
275
|
].join(" "),
|
|
275
276
|
children: [
|
|
276
|
-
/* @__PURE__ */ a(
|
|
277
|
-
|
|
277
|
+
/* @__PURE__ */ a(x, { size: 16 }),
|
|
278
|
+
v
|
|
278
279
|
]
|
|
279
280
|
},
|
|
280
281
|
d
|
|
281
282
|
);
|
|
282
283
|
}) }),
|
|
283
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children:
|
|
284
|
-
|
|
284
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-center mapui:text-xs mapui:text-gray-500", children: ba(e, r, m) }),
|
|
285
|
+
m > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
285
286
|
/* @__PURE__ */ l(
|
|
286
287
|
"button",
|
|
287
288
|
{
|
|
288
289
|
type: "button",
|
|
289
|
-
onClick:
|
|
290
|
+
onClick: f,
|
|
290
291
|
className: "mapui:flex mapui:flex-1 mapui:items-center mapui:justify-center mapui:gap-1.5 mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1.5 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
291
292
|
children: [
|
|
292
|
-
/* @__PURE__ */ a(
|
|
293
|
+
/* @__PURE__ */ a(ta, { size: 14 }),
|
|
293
294
|
"View Results"
|
|
294
295
|
]
|
|
295
296
|
}
|
|
@@ -310,37 +311,37 @@ function Ni({
|
|
|
310
311
|
] })
|
|
311
312
|
] });
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function ya(e) {
|
|
314
315
|
return e == null ? "--" : typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "object" ? JSON.stringify(e) : String(e);
|
|
315
316
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
317
|
+
const fa = 200, xa = 0.6, wa = 300;
|
|
318
|
+
function ki({
|
|
318
319
|
open: e,
|
|
319
320
|
features: i,
|
|
320
321
|
columns: t,
|
|
321
322
|
title: r = "Results",
|
|
322
323
|
onClose: p,
|
|
323
|
-
onExport:
|
|
324
|
+
onExport: m,
|
|
324
325
|
onFeatureClick: n,
|
|
325
|
-
onClearSelection:
|
|
326
|
+
onClearSelection: f
|
|
326
327
|
}) {
|
|
327
|
-
const [s,
|
|
328
|
-
|
|
328
|
+
const [s, h] = T(wa), d = H(!1), x = H(0), v = H(0), u = Be((w) => {
|
|
329
|
+
w.preventDefault(), d.current = !0, x.current = w.clientY, v.current = s;
|
|
329
330
|
}, [s]);
|
|
330
331
|
if (q(() => {
|
|
331
332
|
if (!e) return;
|
|
332
|
-
const
|
|
333
|
+
const w = (C) => {
|
|
333
334
|
if (!d.current) return;
|
|
334
|
-
const E = window.innerHeight *
|
|
335
|
-
|
|
336
|
-
},
|
|
335
|
+
const E = window.innerHeight * xa, O = x.current - C.clientY, o = Math.min(E, Math.max(fa, v.current + O));
|
|
336
|
+
h(o);
|
|
337
|
+
}, N = () => {
|
|
337
338
|
d.current = !1;
|
|
338
339
|
};
|
|
339
|
-
return window.addEventListener("mousemove",
|
|
340
|
-
window.removeEventListener("mousemove",
|
|
340
|
+
return window.addEventListener("mousemove", w), window.addEventListener("mouseup", N), () => {
|
|
341
|
+
window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", N);
|
|
341
342
|
};
|
|
342
343
|
}, [e]), !e) return null;
|
|
343
|
-
const
|
|
344
|
+
const c = t ?? (i.length > 0 ? Object.keys(i[0].properties).filter((w) => w !== "geometry") : []);
|
|
344
345
|
return /* @__PURE__ */ l(
|
|
345
346
|
"div",
|
|
346
347
|
{
|
|
@@ -351,8 +352,8 @@ function vi({
|
|
|
351
352
|
"div",
|
|
352
353
|
{
|
|
353
354
|
className: "mapui:flex mapui:items-center mapui:justify-center mapui:h-3 mapui:cursor-ns-resize mapui:bg-gray-100 mapui:border-b mapui:border-gray-200 hover:mapui:bg-gray-200",
|
|
354
|
-
onMouseDown:
|
|
355
|
-
children: /* @__PURE__ */ a(
|
|
355
|
+
onMouseDown: u,
|
|
356
|
+
children: /* @__PURE__ */ a(ra, { size: 14, className: "mapui:text-gray-400" })
|
|
356
357
|
}
|
|
357
358
|
),
|
|
358
359
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:px-4 mapui:py-2 mapui:border-b mapui:border-gray-200 mapui:shrink-0", children: [
|
|
@@ -361,21 +362,21 @@ function vi({
|
|
|
361
362
|
/* @__PURE__ */ a("span", { className: "mapui:rounded-full mapui:bg-blue-100 mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:font-medium mapui:text-blue-700", children: i.length })
|
|
362
363
|
] }),
|
|
363
364
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
364
|
-
|
|
365
|
+
m && /* @__PURE__ */ a(
|
|
365
366
|
"button",
|
|
366
367
|
{
|
|
367
368
|
type: "button",
|
|
368
|
-
onClick:
|
|
369
|
+
onClick: m,
|
|
369
370
|
title: "Export",
|
|
370
371
|
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
371
|
-
children: /* @__PURE__ */ a(
|
|
372
|
+
children: /* @__PURE__ */ a(la, { size: 16 })
|
|
372
373
|
}
|
|
373
374
|
),
|
|
374
|
-
|
|
375
|
+
f && /* @__PURE__ */ a(
|
|
375
376
|
"button",
|
|
376
377
|
{
|
|
377
378
|
type: "button",
|
|
378
|
-
onClick:
|
|
379
|
+
onClick: f,
|
|
379
380
|
title: "Clear selection",
|
|
380
381
|
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
381
382
|
children: /* @__PURE__ */ a(be, { size: 16 })
|
|
@@ -388,7 +389,7 @@ function vi({
|
|
|
388
389
|
onClick: p,
|
|
389
390
|
title: "Close",
|
|
390
391
|
className: "mapui:flex mapui:items-center mapui:justify-center mapui:w-7 mapui:h-7 mapui:rounded hover:mapui:bg-gray-100 mapui:text-gray-500",
|
|
391
|
-
children: /* @__PURE__ */ a(
|
|
392
|
+
children: /* @__PURE__ */ a(pa, { size: 16 })
|
|
392
393
|
}
|
|
393
394
|
)
|
|
394
395
|
] })
|
|
@@ -396,44 +397,44 @@ function vi({
|
|
|
396
397
|
/* @__PURE__ */ a("div", { className: "mapui:overflow-auto mapui:flex-1", children: i.length === 0 ? /* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-center mapui:h-full mapui:text-sm mapui:text-gray-400", children: "No features to display" }) : /* @__PURE__ */ l("table", { className: "mapui:w-full mapui:text-xs mapui:border-collapse", children: [
|
|
397
398
|
/* @__PURE__ */ a("thead", { children: /* @__PURE__ */ l("tr", { className: "mapui:bg-gray-50 mapui:sticky mapui:top-0", children: [
|
|
398
399
|
/* @__PURE__ */ a("th", { className: "mapui:px-3 mapui:py-2 mapui:text-left mapui:font-medium mapui:text-gray-600 mapui:border-b mapui:border-gray-200", children: "#" }),
|
|
399
|
-
|
|
400
|
+
c.map((w) => /* @__PURE__ */ a(
|
|
400
401
|
"th",
|
|
401
402
|
{
|
|
402
403
|
className: "mapui:px-3 mapui:py-2 mapui:text-left mapui:font-medium mapui:text-gray-600 mapui:border-b mapui:border-gray-200 mapui:whitespace-nowrap",
|
|
403
|
-
children:
|
|
404
|
+
children: w
|
|
404
405
|
},
|
|
405
|
-
|
|
406
|
+
w
|
|
406
407
|
))
|
|
407
408
|
] }) }),
|
|
408
|
-
/* @__PURE__ */ a("tbody", { children: i.map((
|
|
409
|
+
/* @__PURE__ */ a("tbody", { children: i.map((w, N) => /* @__PURE__ */ l(
|
|
409
410
|
"tr",
|
|
410
411
|
{
|
|
411
|
-
onClick: () => n == null ? void 0 : n(
|
|
412
|
+
onClick: () => n == null ? void 0 : n(N),
|
|
412
413
|
className: [
|
|
413
414
|
n ? "mapui:cursor-pointer" : "",
|
|
414
|
-
|
|
415
|
+
N % 2 === 0 ? "mapui:bg-white" : "mapui:bg-gray-50",
|
|
415
416
|
"hover:mapui:bg-blue-50"
|
|
416
417
|
].join(" "),
|
|
417
418
|
children: [
|
|
418
|
-
/* @__PURE__ */ a("td", { className: "mapui:px-3 mapui:py-1.5 mapui:text-gray-400 mapui:border-b mapui:border-gray-100", children:
|
|
419
|
-
|
|
419
|
+
/* @__PURE__ */ a("td", { className: "mapui:px-3 mapui:py-1.5 mapui:text-gray-400 mapui:border-b mapui:border-gray-100", children: N + 1 }),
|
|
420
|
+
c.map((C) => /* @__PURE__ */ a(
|
|
420
421
|
"td",
|
|
421
422
|
{
|
|
422
423
|
className: "mapui:px-3 mapui:py-1.5 mapui:text-gray-700 mapui:border-b mapui:border-gray-100 mapui:whitespace-nowrap",
|
|
423
|
-
children:
|
|
424
|
+
children: ya(w.properties[C])
|
|
424
425
|
},
|
|
425
426
|
C
|
|
426
427
|
))
|
|
427
428
|
]
|
|
428
429
|
},
|
|
429
|
-
|
|
430
|
+
N
|
|
430
431
|
)) })
|
|
431
432
|
] }) })
|
|
432
433
|
]
|
|
433
434
|
}
|
|
434
435
|
);
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function Na({ text: e, id: i }) {
|
|
437
438
|
const t = ze(), r = i ?? t;
|
|
438
439
|
return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
|
|
439
440
|
/* @__PURE__ */ a(
|
|
@@ -443,7 +444,7 @@ function wa({ text: e, id: i }) {
|
|
|
443
444
|
"aria-label": "Info",
|
|
444
445
|
"aria-describedby": r,
|
|
445
446
|
className: "mapui:inline-flex mapui:items-center mapui:text-gray-400 mapui:cursor-default hover:mapui:text-gray-600 focus:mapui:text-gray-600 focus:mapui:outline-none",
|
|
446
|
-
children: /* @__PURE__ */ a(
|
|
447
|
+
children: /* @__PURE__ */ a(na, { className: "mapui:h-3.5 mapui:w-3.5" })
|
|
447
448
|
}
|
|
448
449
|
),
|
|
449
450
|
/* @__PURE__ */ l(
|
|
@@ -460,16 +461,16 @@ function wa({ text: e, id: i }) {
|
|
|
460
461
|
)
|
|
461
462
|
] });
|
|
462
463
|
}
|
|
463
|
-
function S({ label: e, error: i, required: t, description: r, htmlFor: p, children:
|
|
464
|
+
function S({ label: e, error: i, required: t, description: r, htmlFor: p, children: m }) {
|
|
464
465
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
465
466
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
|
|
466
467
|
/* @__PURE__ */ l("label", { htmlFor: p, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
|
|
467
468
|
e,
|
|
468
469
|
t && /* @__PURE__ */ a("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
|
|
469
470
|
] }),
|
|
470
|
-
r && /* @__PURE__ */ a(
|
|
471
|
+
r && /* @__PURE__ */ a(Na, { text: r })
|
|
471
472
|
] }),
|
|
472
|
-
|
|
473
|
+
m,
|
|
473
474
|
i && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: i })
|
|
474
475
|
] });
|
|
475
476
|
}
|
|
@@ -550,13 +551,13 @@ function X({
|
|
|
550
551
|
defaultOpen: t = !1,
|
|
551
552
|
badge: r
|
|
552
553
|
}) {
|
|
553
|
-
const [p,
|
|
554
|
+
const [p, m] = T(t);
|
|
554
555
|
return /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-200", children: [
|
|
555
556
|
/* @__PURE__ */ l(
|
|
556
557
|
"button",
|
|
557
558
|
{
|
|
558
559
|
type: "button",
|
|
559
|
-
onClick: () =>
|
|
560
|
+
onClick: () => m((n) => !n),
|
|
560
561
|
className: "mapui:flex mapui:w-full mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:rounded mapui:border-none mapui:bg-gray-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-100",
|
|
561
562
|
children: [
|
|
562
563
|
/* @__PURE__ */ l("span", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -578,14 +579,14 @@ function we({
|
|
|
578
579
|
testStatus: r = "idle",
|
|
579
580
|
testError: p
|
|
580
581
|
}) {
|
|
581
|
-
const
|
|
582
|
+
const m = (n) => i({ ...e, ...n });
|
|
582
583
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
583
584
|
/* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
|
|
584
585
|
"input",
|
|
585
586
|
{
|
|
586
587
|
type: "text",
|
|
587
588
|
value: e.id,
|
|
588
|
-
onChange: (n) =>
|
|
589
|
+
onChange: (n) => m({ id: n.target.value }),
|
|
589
590
|
placeholder: "my-source",
|
|
590
591
|
className: ee
|
|
591
592
|
}
|
|
@@ -597,7 +598,7 @@ function we({
|
|
|
597
598
|
{
|
|
598
599
|
type: "url",
|
|
599
600
|
value: e.url,
|
|
600
|
-
onChange: (n) =>
|
|
601
|
+
onChange: (n) => m({ url: n.target.value }),
|
|
601
602
|
placeholder: "https://example.com/ogcapi",
|
|
602
603
|
className: `${ee} mapui:flex-1`
|
|
603
604
|
}
|
|
@@ -621,7 +622,7 @@ function we({
|
|
|
621
622
|
{
|
|
622
623
|
type: "text",
|
|
623
624
|
value: e.label ?? "",
|
|
624
|
-
onChange: (n) =>
|
|
625
|
+
onChange: (n) => m({ label: n.target.value || void 0 }),
|
|
625
626
|
placeholder: "My OGC API Source",
|
|
626
627
|
className: ee
|
|
627
628
|
}
|
|
@@ -631,7 +632,7 @@ function we({
|
|
|
631
632
|
{
|
|
632
633
|
type: "text",
|
|
633
634
|
value: e.tileMatrixSetId ?? "WebMercatorQuad",
|
|
634
|
-
onChange: (n) =>
|
|
635
|
+
onChange: (n) => m({ tileMatrixSetId: n.target.value || void 0 }),
|
|
635
636
|
placeholder: "WebMercatorQuad",
|
|
636
637
|
className: ee
|
|
637
638
|
}
|
|
@@ -644,21 +645,21 @@ const le = () => ({
|
|
|
644
645
|
label: void 0,
|
|
645
646
|
tileMatrixSetId: "WebMercatorQuad"
|
|
646
647
|
});
|
|
647
|
-
function
|
|
648
|
-
const [t, r] = T(null), [p,
|
|
649
|
-
|
|
648
|
+
function Ci({ sources: e, onChange: i }) {
|
|
649
|
+
const [t, r] = T(null), [p, m] = T(null), [n, f] = T(!1), [s, h] = T(le()), [d, x] = T({}), [v, u] = T({}), [c, w] = T(null), N = async (o, D) => {
|
|
650
|
+
x((F) => ({ ...F, [o]: "loading" }));
|
|
650
651
|
try {
|
|
651
|
-
const F = await fetch(`${
|
|
652
|
-
F.ok ?
|
|
652
|
+
const F = await fetch(`${D}/conformance`);
|
|
653
|
+
F.ok ? x((g) => ({ ...g, [o]: "success" })) : (x((g) => ({ ...g, [o]: "error" })), u((g) => ({ ...g, [o]: `HTTP ${F.status}` })));
|
|
653
654
|
} catch (F) {
|
|
654
|
-
|
|
655
|
+
x((g) => ({ ...g, [o]: "error" })), u((g) => ({ ...g, [o]: F instanceof Error ? F.message : "Network error" }));
|
|
655
656
|
}
|
|
656
657
|
}, C = () => {
|
|
657
|
-
p && (i(e.map((
|
|
658
|
+
p && (i(e.map((o) => o.id === t ? p : o)), r(null), m(null));
|
|
658
659
|
}, E = () => {
|
|
659
|
-
i([...e, s]),
|
|
660
|
-
}, O = (
|
|
661
|
-
i(e.filter((
|
|
660
|
+
i([...e, s]), f(!1), h(le());
|
|
661
|
+
}, O = (o) => {
|
|
662
|
+
i(e.filter((D) => D.id !== o)), w(null);
|
|
662
663
|
};
|
|
663
664
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
664
665
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -668,7 +669,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
668
669
|
{
|
|
669
670
|
type: "button",
|
|
670
671
|
onClick: () => {
|
|
671
|
-
|
|
672
|
+
f(!0), h(le());
|
|
672
673
|
},
|
|
673
674
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
674
675
|
children: "+ Add Source"
|
|
@@ -676,19 +677,19 @@ function ki({ sources: e, onChange: i }) {
|
|
|
676
677
|
)
|
|
677
678
|
] }),
|
|
678
679
|
e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
|
|
679
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
680
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((o) => /* @__PURE__ */ a(
|
|
680
681
|
"li",
|
|
681
682
|
{
|
|
682
683
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white mapui:p-3",
|
|
683
|
-
children: t ===
|
|
684
|
+
children: t === o.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
684
685
|
/* @__PURE__ */ a(
|
|
685
686
|
we,
|
|
686
687
|
{
|
|
687
|
-
value: p ??
|
|
688
|
-
onChange:
|
|
689
|
-
onTestConnection: (
|
|
690
|
-
testStatus: d[`edit-${
|
|
691
|
-
testError:
|
|
688
|
+
value: p ?? o,
|
|
689
|
+
onChange: m,
|
|
690
|
+
onTestConnection: (D) => N(`edit-${o.id}`, D),
|
|
691
|
+
testStatus: d[`edit-${o.id}`],
|
|
692
|
+
testError: v[`edit-${o.id}`]
|
|
692
693
|
}
|
|
693
694
|
),
|
|
694
695
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
@@ -707,7 +708,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
707
708
|
{
|
|
708
709
|
type: "button",
|
|
709
710
|
onClick: () => {
|
|
710
|
-
r(null),
|
|
711
|
+
r(null), m(null);
|
|
711
712
|
},
|
|
712
713
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
713
714
|
children: "Cancel"
|
|
@@ -716,11 +717,11 @@ function ki({ sources: e, onChange: i }) {
|
|
|
716
717
|
] })
|
|
717
718
|
] }) : /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-start mapui:justify-between mapui:gap-2", children: [
|
|
718
719
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
719
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
720
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
721
|
-
|
|
720
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: o.label ?? o.id }),
|
|
721
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: o.url }),
|
|
722
|
+
o.tileMatrixSetId && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-gray-400", children: [
|
|
722
723
|
"TMS: ",
|
|
723
|
-
|
|
724
|
+
o.tileMatrixSetId
|
|
724
725
|
] })
|
|
725
726
|
] }),
|
|
726
727
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
|
|
@@ -729,7 +730,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
729
730
|
{
|
|
730
731
|
type: "button",
|
|
731
732
|
onClick: () => {
|
|
732
|
-
r(
|
|
733
|
+
r(o.id), m(o);
|
|
733
734
|
},
|
|
734
735
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
735
736
|
children: "Edit"
|
|
@@ -739,7 +740,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
739
740
|
"button",
|
|
740
741
|
{
|
|
741
742
|
type: "button",
|
|
742
|
-
onClick: () =>
|
|
743
|
+
onClick: () => w(o.id),
|
|
743
744
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
744
745
|
children: "Remove"
|
|
745
746
|
}
|
|
@@ -747,7 +748,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
747
748
|
] })
|
|
748
749
|
] })
|
|
749
750
|
},
|
|
750
|
-
|
|
751
|
+
o.id
|
|
751
752
|
)) }),
|
|
752
753
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
753
754
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
|
|
@@ -755,10 +756,10 @@ function ki({ sources: e, onChange: i }) {
|
|
|
755
756
|
we,
|
|
756
757
|
{
|
|
757
758
|
value: s,
|
|
758
|
-
onChange:
|
|
759
|
-
onTestConnection: (
|
|
759
|
+
onChange: h,
|
|
760
|
+
onTestConnection: (o) => N("new", o),
|
|
760
761
|
testStatus: d.new,
|
|
761
|
-
testError:
|
|
762
|
+
testError: v.new
|
|
762
763
|
}
|
|
763
764
|
),
|
|
764
765
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
@@ -776,7 +777,7 @@ function ki({ sources: e, onChange: i }) {
|
|
|
776
777
|
"button",
|
|
777
778
|
{
|
|
778
779
|
type: "button",
|
|
779
|
-
onClick: () =>
|
|
780
|
+
onClick: () => f(!1),
|
|
780
781
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
781
782
|
children: "Cancel"
|
|
782
783
|
}
|
|
@@ -786,30 +787,30 @@ function ki({ sources: e, onChange: i }) {
|
|
|
786
787
|
/* @__PURE__ */ a(
|
|
787
788
|
re,
|
|
788
789
|
{
|
|
789
|
-
open:
|
|
790
|
+
open: c !== null,
|
|
790
791
|
title: "Remove Source",
|
|
791
792
|
description: "Are you sure you want to remove this source? Any layers using it will be affected.",
|
|
792
|
-
onConfirm: () =>
|
|
793
|
-
onCancel: () =>
|
|
793
|
+
onConfirm: () => c && O(c),
|
|
794
|
+
onCancel: () => w(null)
|
|
794
795
|
}
|
|
795
796
|
)
|
|
796
797
|
] });
|
|
797
798
|
}
|
|
798
|
-
function
|
|
799
|
+
function Si({
|
|
799
800
|
sourceUrl: e,
|
|
800
801
|
selectedCollectionIds: i,
|
|
801
802
|
onSelect: t,
|
|
802
803
|
onDeselect: r
|
|
803
804
|
}) {
|
|
804
|
-
const { collections: p, loading:
|
|
805
|
-
return
|
|
805
|
+
const { collections: p, loading: m, error: n } = Ge(e || null);
|
|
806
|
+
return m ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
|
|
806
807
|
/* @__PURE__ */ a("span", { className: "mapui:inline-block mapui:h-4 mapui:w-4 mapui:animate-spin mapui:rounded-full mapui:border-2 mapui:border-gray-300 mapui:border-t-blue-600" }),
|
|
807
808
|
"Loading collections…"
|
|
808
809
|
] }) : n ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
|
|
809
810
|
"Failed to load collections: ",
|
|
810
811
|
n.message
|
|
811
|
-
] }) : p.length === 0 ? /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: p.map((
|
|
812
|
-
const s = i.includes(
|
|
812
|
+
] }) : p.length === 0 ? /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: p.map((f) => {
|
|
813
|
+
const s = i.includes(f.id);
|
|
813
814
|
return /* @__PURE__ */ l(
|
|
814
815
|
"li",
|
|
815
816
|
{
|
|
@@ -819,63 +820,63 @@ function Ci({
|
|
|
819
820
|
"input",
|
|
820
821
|
{
|
|
821
822
|
type: "checkbox",
|
|
822
|
-
id: `collection-${
|
|
823
|
+
id: `collection-${f.id}`,
|
|
823
824
|
checked: s,
|
|
824
|
-
onChange: () => s ? r(
|
|
825
|
+
onChange: () => s ? r(f.id) : t(f.id),
|
|
825
826
|
className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
|
|
826
827
|
}
|
|
827
828
|
),
|
|
828
829
|
/* @__PURE__ */ l(
|
|
829
830
|
"label",
|
|
830
831
|
{
|
|
831
|
-
htmlFor: `collection-${
|
|
832
|
+
htmlFor: `collection-${f.id}`,
|
|
832
833
|
className: "mapui:flex mapui:cursor-pointer mapui:flex-col mapui:gap-0.5",
|
|
833
834
|
children: [
|
|
834
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
835
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
836
|
-
|
|
835
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: f.title ?? f.id }),
|
|
836
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: f.id }),
|
|
837
|
+
f.description && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: f.description })
|
|
837
838
|
]
|
|
838
839
|
}
|
|
839
840
|
)
|
|
840
841
|
]
|
|
841
842
|
},
|
|
842
|
-
|
|
843
|
+
f.id
|
|
843
844
|
);
|
|
844
845
|
}) });
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
-
const [r, p] = T(!1), [
|
|
847
|
+
function va({ value: e, onChange: i, availableIcons: t }) {
|
|
848
|
+
const [r, p] = T(!1), [m, n] = T(-1), f = H(null), s = ze(), h = m >= 0 ? `${s}-option-${m}` : void 0, d = Ue(() => {
|
|
848
849
|
if (!t || t.length === 0) return [];
|
|
849
850
|
if (!e) return t;
|
|
850
|
-
const
|
|
851
|
-
return t.filter((C) => C.toLowerCase().includes(
|
|
852
|
-
}, [t, e]),
|
|
853
|
-
(
|
|
854
|
-
i(
|
|
851
|
+
const N = e.toLowerCase();
|
|
852
|
+
return t.filter((C) => C.toLowerCase().includes(N));
|
|
853
|
+
}, [t, e]), x = r && d.length > 0, v = Be(
|
|
854
|
+
(N) => {
|
|
855
|
+
i(N), p(!1), n(-1);
|
|
855
856
|
},
|
|
856
857
|
[i]
|
|
857
|
-
),
|
|
858
|
-
i(
|
|
859
|
-
},
|
|
860
|
-
|
|
858
|
+
), u = (N) => {
|
|
859
|
+
i(N.target.value), p(!0), n(-1);
|
|
860
|
+
}, c = (N) => {
|
|
861
|
+
x && (N.key === "ArrowDown" ? (N.preventDefault(), n((C) => Math.min(C + 1, d.length - 1))) : N.key === "ArrowUp" ? (N.preventDefault(), n((C) => Math.max(C - 1, 0))) : N.key === "Enter" && m >= 0 ? (N.preventDefault(), v(d[m])) : N.key === "Escape" && (p(!1), n(-1)));
|
|
861
862
|
};
|
|
862
863
|
q(() => {
|
|
863
|
-
const
|
|
864
|
-
|
|
864
|
+
const N = (C) => {
|
|
865
|
+
f.current && !f.current.contains(C.target) && (p(!1), n(-1));
|
|
865
866
|
};
|
|
866
|
-
return document.addEventListener("mousedown",
|
|
867
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
867
868
|
}, []);
|
|
868
|
-
const
|
|
869
|
+
const w = "mapui:w-full mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
869
870
|
return !t || t.length === 0 ? /* @__PURE__ */ a(
|
|
870
871
|
"input",
|
|
871
872
|
{
|
|
872
873
|
type: "text",
|
|
873
874
|
value: e,
|
|
874
|
-
onChange: (
|
|
875
|
+
onChange: (N) => i(N.target.value || ""),
|
|
875
876
|
placeholder: "icon-name",
|
|
876
|
-
className:
|
|
877
|
+
className: w
|
|
877
878
|
}
|
|
878
|
-
) : /* @__PURE__ */ l("div", { ref:
|
|
879
|
+
) : /* @__PURE__ */ l("div", { ref: f, className: "mapui:relative", children: [
|
|
879
880
|
/* @__PURE__ */ a(
|
|
880
881
|
"input",
|
|
881
882
|
{
|
|
@@ -883,35 +884,35 @@ function Na({ value: e, onChange: i, availableIcons: t }) {
|
|
|
883
884
|
value: e,
|
|
884
885
|
placeholder: "Search icons…",
|
|
885
886
|
role: "combobox",
|
|
886
|
-
"aria-expanded":
|
|
887
|
+
"aria-expanded": x,
|
|
887
888
|
"aria-autocomplete": "list",
|
|
888
889
|
"aria-controls": s,
|
|
889
|
-
"aria-activedescendant":
|
|
890
|
-
onChange:
|
|
890
|
+
"aria-activedescendant": h,
|
|
891
|
+
onChange: u,
|
|
891
892
|
onFocus: () => p(!0),
|
|
892
|
-
onKeyDown:
|
|
893
|
-
className:
|
|
893
|
+
onKeyDown: c,
|
|
894
|
+
className: w
|
|
894
895
|
}
|
|
895
896
|
),
|
|
896
|
-
|
|
897
|
+
x && /* @__PURE__ */ a(
|
|
897
898
|
"ul",
|
|
898
899
|
{
|
|
899
900
|
id: s,
|
|
900
901
|
role: "listbox",
|
|
901
902
|
className: "mapui:absolute mapui:z-10 mapui:mt-1 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:shadow-lg mapui:max-h-48 mapui:overflow-y-auto mapui:p-0 mapui:m-0 mapui:list-none",
|
|
902
|
-
children: d.map((
|
|
903
|
+
children: d.map((N, C) => /* @__PURE__ */ a(
|
|
903
904
|
"li",
|
|
904
905
|
{
|
|
905
906
|
id: `${s}-option-${C}`,
|
|
906
907
|
role: "option",
|
|
907
|
-
"aria-selected": C ===
|
|
908
|
+
"aria-selected": C === m,
|
|
908
909
|
onMouseDown: (E) => {
|
|
909
|
-
E.preventDefault(),
|
|
910
|
+
E.preventDefault(), v(N);
|
|
910
911
|
},
|
|
911
|
-
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${C ===
|
|
912
|
-
children:
|
|
912
|
+
className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${C === m ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
|
|
913
|
+
children: N
|
|
913
914
|
},
|
|
914
|
-
`${C}-${
|
|
915
|
+
`${C}-${N}`
|
|
915
916
|
))
|
|
916
917
|
}
|
|
917
918
|
)
|
|
@@ -932,10 +933,10 @@ const Ne = [
|
|
|
932
933
|
function pe(e) {
|
|
933
934
|
return Ne[e % Ne.length];
|
|
934
935
|
}
|
|
935
|
-
function
|
|
936
|
+
function ka(e) {
|
|
936
937
|
return e[0] === "interpolate" ? "interpolate" : "match";
|
|
937
938
|
}
|
|
938
|
-
function
|
|
939
|
+
function Ca(e) {
|
|
939
940
|
const i = Array.isArray(e[1]) ? e[1][1] ?? "" : "", t = e[e.length - 1] ?? "#000000", r = [];
|
|
940
941
|
for (let p = 2; p < e.length - 1; p += 2)
|
|
941
942
|
r.push({ value: String(e[p] ?? ""), color: e[p + 1] ?? "#000000" });
|
|
@@ -965,7 +966,7 @@ function ke(e, i) {
|
|
|
965
966
|
function Ce(e) {
|
|
966
967
|
return e.map((i) => ({ stopText: String(i.stop), color: i.color }));
|
|
967
968
|
}
|
|
968
|
-
function
|
|
969
|
+
function Sa(e) {
|
|
969
970
|
return e.map((i, t) => {
|
|
970
971
|
if (i.stopText.trim() === "") return "Value required";
|
|
971
972
|
const r = parseFloat(i.stopText);
|
|
@@ -977,7 +978,7 @@ function Ca(e) {
|
|
|
977
978
|
return "";
|
|
978
979
|
});
|
|
979
980
|
}
|
|
980
|
-
function
|
|
981
|
+
function Ta(e) {
|
|
981
982
|
const i = [];
|
|
982
983
|
for (const t of e) {
|
|
983
984
|
const r = parseFloat(t.stopText);
|
|
@@ -987,117 +988,117 @@ function Sa(e) {
|
|
|
987
988
|
return i;
|
|
988
989
|
}
|
|
989
990
|
const ae = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", ue = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50", Se = "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50";
|
|
990
|
-
function
|
|
991
|
+
function Da({
|
|
991
992
|
value: e,
|
|
992
993
|
onChange: i,
|
|
993
994
|
availableProperties: t = [],
|
|
994
995
|
onFetchDistinctValues: r
|
|
995
996
|
}) {
|
|
996
|
-
const [p,
|
|
997
|
-
const
|
|
998
|
-
return Ce(
|
|
999
|
-
}), [
|
|
997
|
+
const [p, m] = T(() => ka(e)), [n, f] = T(!1), s = Ca(e), h = p === "match" ? s.property : "", d = p === "match" ? s.pairs : [], x = p === "match" ? s.fallback : "#000000", [v, u] = T(() => {
|
|
998
|
+
const y = ne(e);
|
|
999
|
+
return Ce(y.stops);
|
|
1000
|
+
}), [c, w] = T(() => p === "interpolate" ? ne(e).property : ""), [N, C] = T([]), E = H(e);
|
|
1000
1001
|
q(() => {
|
|
1001
1002
|
if (E.current !== e && p === "interpolate") {
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1003
|
+
const y = ne(e);
|
|
1004
|
+
u(Ce(y.stops)), w(y.property), C([]);
|
|
1004
1005
|
}
|
|
1005
1006
|
E.current = e;
|
|
1006
1007
|
}, [e, p]);
|
|
1007
1008
|
const O = t.filter(
|
|
1008
|
-
(
|
|
1009
|
-
),
|
|
1010
|
-
(
|
|
1011
|
-
),
|
|
1012
|
-
i(ve(
|
|
1013
|
-
}, F = (
|
|
1014
|
-
|
|
1015
|
-
},
|
|
1016
|
-
|
|
1017
|
-
}, M = (
|
|
1018
|
-
const I = d.map((A, B) => B ===
|
|
1019
|
-
|
|
1020
|
-
}, P = (
|
|
1021
|
-
const I = d.map((A, B) => B ===
|
|
1022
|
-
|
|
1023
|
-
},
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1009
|
+
(y) => !y.type || y.type === "string"
|
|
1010
|
+
), o = t.filter(
|
|
1011
|
+
(y) => y.type === "number" || y.type === "integer"
|
|
1012
|
+
), D = (y, L, I) => {
|
|
1013
|
+
i(ve(y, L, I));
|
|
1014
|
+
}, F = (y) => {
|
|
1015
|
+
D(y, d, x);
|
|
1016
|
+
}, g = (y) => {
|
|
1017
|
+
D(h, d, y);
|
|
1018
|
+
}, M = (y, L) => {
|
|
1019
|
+
const I = d.map((A, B) => B === y ? { ...A, value: L } : A);
|
|
1020
|
+
D(h, I, x);
|
|
1021
|
+
}, P = (y, L) => {
|
|
1022
|
+
const I = d.map((A, B) => B === y ? { ...A, color: L } : A);
|
|
1023
|
+
D(h, I, x);
|
|
1024
|
+
}, b = (y) => {
|
|
1025
|
+
const L = d.filter((I, A) => A !== y);
|
|
1026
|
+
D(h, L, x);
|
|
1026
1027
|
}, k = () => {
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1028
|
+
const y = [...d, { value: "", color: pe(d.length) }];
|
|
1029
|
+
D(h, y, x);
|
|
1029
1030
|
}, j = async () => {
|
|
1030
|
-
if (!(!r || !
|
|
1031
|
-
|
|
1031
|
+
if (!(!r || !h)) {
|
|
1032
|
+
f(!0);
|
|
1032
1033
|
try {
|
|
1033
|
-
const
|
|
1034
|
+
const L = (await r(h)).map((I, A) => ({
|
|
1034
1035
|
value: I,
|
|
1035
1036
|
color: pe(A)
|
|
1036
1037
|
}));
|
|
1037
|
-
|
|
1038
|
+
D(h, L, x);
|
|
1038
1039
|
} finally {
|
|
1039
|
-
|
|
1040
|
+
f(!1);
|
|
1040
1041
|
}
|
|
1041
1042
|
}
|
|
1042
|
-
}, R = (
|
|
1043
|
-
const I =
|
|
1044
|
-
if (C(I),
|
|
1045
|
-
const A =
|
|
1046
|
-
A && i(ke(
|
|
1043
|
+
}, R = (y, L) => {
|
|
1044
|
+
const I = Sa(L);
|
|
1045
|
+
if (C(I), y && L.length >= 2 && I.every((A) => !A)) {
|
|
1046
|
+
const A = Ta(L);
|
|
1047
|
+
A && i(ke(y, A));
|
|
1047
1048
|
}
|
|
1048
|
-
}, W = (
|
|
1049
|
-
|
|
1050
|
-
}, U = (
|
|
1051
|
-
const I =
|
|
1052
|
-
|
|
1053
|
-
}, G = (
|
|
1054
|
-
const I =
|
|
1055
|
-
|
|
1056
|
-
}, J = (
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1049
|
+
}, W = (y) => {
|
|
1050
|
+
w(y), R(y, v);
|
|
1051
|
+
}, U = (y, L) => {
|
|
1052
|
+
const I = v.map((A, B) => B === y ? { ...A, stopText: L } : A);
|
|
1053
|
+
u(I), R(c, I);
|
|
1054
|
+
}, G = (y, L) => {
|
|
1055
|
+
const I = v.map((A, B) => B === y ? { ...A, color: L } : A);
|
|
1056
|
+
u(I), R(c, I);
|
|
1057
|
+
}, J = (y) => {
|
|
1058
|
+
const L = v.filter((I, A) => A !== y);
|
|
1059
|
+
u(L), R(c, L);
|
|
1059
1060
|
}, K = () => {
|
|
1060
1061
|
var B;
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
}, Q = (
|
|
1064
|
-
|
|
1062
|
+
const y = ((B = v[v.length - 1]) == null ? void 0 : B.stopText) ?? "0", L = parseFloat(y), I = isNaN(L) ? 0 : L + 10, A = [...v, { stopText: String(I), color: pe(v.length) }];
|
|
1063
|
+
u(A), R(c, A);
|
|
1064
|
+
}, Q = (y) => {
|
|
1065
|
+
m(y), y === "match" ? i(ve("", [], "#000000")) : (u([]), w(""), C([]), i(ke("", [])));
|
|
1065
1066
|
};
|
|
1066
1067
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1067
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((
|
|
1068
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((y) => /* @__PURE__ */ a(
|
|
1068
1069
|
"button",
|
|
1069
1070
|
{
|
|
1070
1071
|
type: "button",
|
|
1071
|
-
onClick: () => Q(
|
|
1072
|
+
onClick: () => Q(y),
|
|
1072
1073
|
className: [
|
|
1073
1074
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-xs mapui:capitalize mapui:outline-none",
|
|
1074
1075
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
1075
|
-
p ===
|
|
1076
|
+
p === y ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
1076
1077
|
].join(" "),
|
|
1077
|
-
children:
|
|
1078
|
+
children: y === "match" ? "Categorical" : "Gradient"
|
|
1078
1079
|
},
|
|
1079
|
-
|
|
1080
|
+
y
|
|
1080
1081
|
)) }),
|
|
1081
1082
|
p === "match" && /* @__PURE__ */ l(z, { children: [
|
|
1082
1083
|
/* @__PURE__ */ l(
|
|
1083
1084
|
"select",
|
|
1084
1085
|
{
|
|
1085
|
-
value:
|
|
1086
|
-
onChange: (
|
|
1086
|
+
value: h,
|
|
1087
|
+
onChange: (y) => F(y.target.value),
|
|
1087
1088
|
className: ae,
|
|
1088
1089
|
children: [
|
|
1089
1090
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
1090
|
-
O.map((
|
|
1091
|
+
O.map((y) => /* @__PURE__ */ a("option", { value: y.name, children: y.title ?? y.name }, y.name))
|
|
1091
1092
|
]
|
|
1092
1093
|
}
|
|
1093
1094
|
),
|
|
1094
|
-
d.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: d.map((
|
|
1095
|
+
d.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: d.map((y, L) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1095
1096
|
/* @__PURE__ */ a(
|
|
1096
1097
|
"input",
|
|
1097
1098
|
{
|
|
1098
1099
|
type: "text",
|
|
1099
|
-
value:
|
|
1100
|
-
onChange: (I) => M(
|
|
1100
|
+
value: y.value,
|
|
1101
|
+
onChange: (I) => M(L, I.target.value),
|
|
1101
1102
|
placeholder: "value",
|
|
1102
1103
|
className: `${ae} mapui:flex-1`
|
|
1103
1104
|
}
|
|
@@ -1105,20 +1106,20 @@ function Ta({
|
|
|
1105
1106
|
/* @__PURE__ */ a(
|
|
1106
1107
|
Z,
|
|
1107
1108
|
{
|
|
1108
|
-
value:
|
|
1109
|
-
onChange: (I) => P(
|
|
1110
|
-
label: `Color for "${
|
|
1109
|
+
value: y.color,
|
|
1110
|
+
onChange: (I) => P(L, I),
|
|
1111
|
+
label: `Color for "${y.value}"`
|
|
1111
1112
|
}
|
|
1112
1113
|
),
|
|
1113
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () =>
|
|
1114
|
-
] },
|
|
1114
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => b(L), className: Se, children: "×" })
|
|
1115
|
+
] }, L)) }),
|
|
1115
1116
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1116
1117
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500 mapui:shrink-0", children: "Fallback:" }),
|
|
1117
|
-
/* @__PURE__ */ a(Z, { value:
|
|
1118
|
+
/* @__PURE__ */ a(Z, { value: x, onChange: g, label: "Fallback color" })
|
|
1118
1119
|
] }),
|
|
1119
1120
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
1120
1121
|
/* @__PURE__ */ a("button", { type: "button", onClick: k, className: ue, children: "+ Add value" }),
|
|
1121
|
-
r &&
|
|
1122
|
+
r && h && /* @__PURE__ */ a(
|
|
1122
1123
|
"button",
|
|
1123
1124
|
{
|
|
1124
1125
|
type: "button",
|
|
@@ -1134,17 +1135,17 @@ function Ta({
|
|
|
1134
1135
|
/* @__PURE__ */ l(
|
|
1135
1136
|
"select",
|
|
1136
1137
|
{
|
|
1137
|
-
value:
|
|
1138
|
-
onChange: (
|
|
1138
|
+
value: c,
|
|
1139
|
+
onChange: (y) => W(y.target.value),
|
|
1139
1140
|
className: ae,
|
|
1140
1141
|
children: [
|
|
1141
1142
|
/* @__PURE__ */ a("option", { value: "", children: "Select a numeric property…" }),
|
|
1142
|
-
|
|
1143
|
+
o.map((y) => /* @__PURE__ */ a("option", { value: y.name, children: y.title ?? y.name }, y.name))
|
|
1143
1144
|
]
|
|
1144
1145
|
}
|
|
1145
1146
|
),
|
|
1146
|
-
|
|
1147
|
-
const I =
|
|
1147
|
+
v.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: v.map((y, L) => {
|
|
1148
|
+
const I = N[L];
|
|
1148
1149
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
1149
1150
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
1150
1151
|
/* @__PURE__ */ a(
|
|
@@ -1152,8 +1153,8 @@ function Ta({
|
|
|
1152
1153
|
{
|
|
1153
1154
|
type: "text",
|
|
1154
1155
|
inputMode: "numeric",
|
|
1155
|
-
value:
|
|
1156
|
-
onChange: (A) => U(
|
|
1156
|
+
value: y.stopText,
|
|
1157
|
+
onChange: (A) => U(L, A.target.value),
|
|
1157
1158
|
placeholder: "stop",
|
|
1158
1159
|
className: `${ae} mapui:w-24`
|
|
1159
1160
|
}
|
|
@@ -1161,22 +1162,22 @@ function Ta({
|
|
|
1161
1162
|
/* @__PURE__ */ a(
|
|
1162
1163
|
Z,
|
|
1163
1164
|
{
|
|
1164
|
-
value:
|
|
1165
|
-
onChange: (A) => G(
|
|
1166
|
-
label: `Color at stop ${
|
|
1165
|
+
value: y.color,
|
|
1166
|
+
onChange: (A) => G(L, A),
|
|
1167
|
+
label: `Color at stop ${y.stopText}`
|
|
1167
1168
|
}
|
|
1168
1169
|
),
|
|
1169
|
-
/* @__PURE__ */ a("button", { type: "button", onClick: () => J(
|
|
1170
|
+
/* @__PURE__ */ a("button", { type: "button", onClick: () => J(L), className: Se, children: "×" })
|
|
1170
1171
|
] }),
|
|
1171
1172
|
I && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-500", children: I })
|
|
1172
|
-
] },
|
|
1173
|
+
] }, L);
|
|
1173
1174
|
}) }),
|
|
1174
1175
|
/* @__PURE__ */ a("button", { type: "button", onClick: K, className: ue, children: "+ Add stop" })
|
|
1175
1176
|
] })
|
|
1176
1177
|
] });
|
|
1177
1178
|
}
|
|
1178
1179
|
const Y = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
1179
|
-
function
|
|
1180
|
+
function La({
|
|
1180
1181
|
value: e,
|
|
1181
1182
|
onChange: i
|
|
1182
1183
|
}) {
|
|
@@ -1208,7 +1209,7 @@ function Da({
|
|
|
1208
1209
|
)
|
|
1209
1210
|
] });
|
|
1210
1211
|
}
|
|
1211
|
-
function
|
|
1212
|
+
function Aa({
|
|
1212
1213
|
value: e,
|
|
1213
1214
|
onChange: i
|
|
1214
1215
|
}) {
|
|
@@ -1235,12 +1236,12 @@ function Te({
|
|
|
1235
1236
|
onChange: t,
|
|
1236
1237
|
availableIcons: r,
|
|
1237
1238
|
availableProperties: p,
|
|
1238
|
-
onFetchDistinctValues:
|
|
1239
|
+
onFetchDistinctValues: m
|
|
1239
1240
|
}) {
|
|
1240
|
-
var n,
|
|
1241
|
+
var n, f;
|
|
1241
1242
|
switch (e.widget) {
|
|
1242
1243
|
case "color": {
|
|
1243
|
-
const s = Array.isArray(i),
|
|
1244
|
+
const s = Array.isArray(i), h = s ? i[i.length - 1] ?? "#000000" : "#000000";
|
|
1244
1245
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:w-full", children: [
|
|
1245
1246
|
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-end", children: /* @__PURE__ */ a(
|
|
1246
1247
|
"button",
|
|
@@ -1248,7 +1249,7 @@ function Te({
|
|
|
1248
1249
|
type: "button",
|
|
1249
1250
|
title: s ? "Switch to static color" : "Switch to data-driven color",
|
|
1250
1251
|
onClick: () => {
|
|
1251
|
-
t(s ?
|
|
1252
|
+
t(s ? h : ["match", ["get", ""], h]);
|
|
1252
1253
|
},
|
|
1253
1254
|
className: [
|
|
1254
1255
|
"mapui:cursor-pointer mapui:rounded mapui:border mapui:px-1.5 mapui:py-0.5 mapui:font-mono mapui:text-xs mapui:outline-none",
|
|
@@ -1259,12 +1260,12 @@ function Te({
|
|
|
1259
1260
|
}
|
|
1260
1261
|
) }),
|
|
1261
1262
|
s ? /* @__PURE__ */ a(
|
|
1262
|
-
|
|
1263
|
+
Da,
|
|
1263
1264
|
{
|
|
1264
1265
|
value: i,
|
|
1265
1266
|
onChange: (d) => t(d),
|
|
1266
1267
|
availableProperties: p,
|
|
1267
|
-
onFetchDistinctValues:
|
|
1268
|
+
onFetchDistinctValues: m
|
|
1268
1269
|
}
|
|
1269
1270
|
) : /* @__PURE__ */ a(
|
|
1270
1271
|
Z,
|
|
@@ -1278,7 +1279,7 @@ function Te({
|
|
|
1278
1279
|
}
|
|
1279
1280
|
case "opacity":
|
|
1280
1281
|
return /* @__PURE__ */ a(
|
|
1281
|
-
|
|
1282
|
+
Aa,
|
|
1282
1283
|
{
|
|
1283
1284
|
value: i,
|
|
1284
1285
|
onChange: t
|
|
@@ -1314,12 +1315,12 @@ function Te({
|
|
|
1314
1315
|
value: i ?? ((n = e.options) == null ? void 0 : n[0]) ?? "",
|
|
1315
1316
|
onChange: (s) => t(s.target.value),
|
|
1316
1317
|
className: Y,
|
|
1317
|
-
children: (
|
|
1318
|
+
children: (f = e.options) == null ? void 0 : f.map((s) => /* @__PURE__ */ a("option", { value: s, children: s }, s))
|
|
1318
1319
|
}
|
|
1319
1320
|
);
|
|
1320
1321
|
case "translate":
|
|
1321
1322
|
return /* @__PURE__ */ a(
|
|
1322
|
-
|
|
1323
|
+
La,
|
|
1323
1324
|
{
|
|
1324
1325
|
value: i,
|
|
1325
1326
|
onChange: t
|
|
@@ -1327,24 +1328,24 @@ function Te({
|
|
|
1327
1328
|
);
|
|
1328
1329
|
case "dasharray":
|
|
1329
1330
|
case "stringArray": {
|
|
1330
|
-
const s = i,
|
|
1331
|
+
const s = i, h = s ? s.join(", ") : "";
|
|
1331
1332
|
return /* @__PURE__ */ a(
|
|
1332
1333
|
"input",
|
|
1333
1334
|
{
|
|
1334
1335
|
type: "text",
|
|
1335
|
-
value:
|
|
1336
|
+
value: h,
|
|
1336
1337
|
onChange: (d) => {
|
|
1337
|
-
const
|
|
1338
|
-
if (!
|
|
1338
|
+
const x = d.target.value.trim();
|
|
1339
|
+
if (!x) {
|
|
1339
1340
|
t(void 0);
|
|
1340
1341
|
return;
|
|
1341
1342
|
}
|
|
1342
1343
|
if (e.widget === "dasharray") {
|
|
1343
|
-
const
|
|
1344
|
-
t(
|
|
1344
|
+
const v = x.split(",").map((u) => parseFloat(u.trim())).filter((u) => !isNaN(u));
|
|
1345
|
+
t(v.length > 0 ? v : void 0);
|
|
1345
1346
|
} else {
|
|
1346
|
-
const
|
|
1347
|
-
t(
|
|
1347
|
+
const v = x.split(",").map((u) => u.trim()).filter(Boolean);
|
|
1348
|
+
t(v.length > 0 ? v : void 0);
|
|
1348
1349
|
}
|
|
1349
1350
|
},
|
|
1350
1351
|
placeholder: e.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
|
|
@@ -1364,7 +1365,7 @@ function Te({
|
|
|
1364
1365
|
);
|
|
1365
1366
|
case "icon-image":
|
|
1366
1367
|
return /* @__PURE__ */ a(
|
|
1367
|
-
|
|
1368
|
+
va,
|
|
1368
1369
|
{
|
|
1369
1370
|
value: i ?? "",
|
|
1370
1371
|
onChange: (s) => t(s ?? void 0),
|
|
@@ -1375,8 +1376,8 @@ function Te({
|
|
|
1375
1376
|
return null;
|
|
1376
1377
|
}
|
|
1377
1378
|
}
|
|
1378
|
-
function
|
|
1379
|
-
const n = e.enableDefault !== void 0,
|
|
1379
|
+
function Ea({ def: e, value: i, onChange: t, availableIcons: r, availableProperties: p, onFetchDistinctValues: m }) {
|
|
1380
|
+
const n = e.enableDefault !== void 0, f = i !== void 0;
|
|
1380
1381
|
if (n && e.widget === "boolean") {
|
|
1381
1382
|
const s = !e.enableDefault;
|
|
1382
1383
|
return /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
@@ -1384,8 +1385,8 @@ function Aa({ def: e, value: i, onChange: t, availableIcons: r, availablePropert
|
|
|
1384
1385
|
{
|
|
1385
1386
|
type: "checkbox",
|
|
1386
1387
|
checked: i === s,
|
|
1387
|
-
onChange: (
|
|
1388
|
-
t(e.key,
|
|
1388
|
+
onChange: (h) => {
|
|
1389
|
+
t(e.key, h.target.checked ? s : void 0);
|
|
1389
1390
|
},
|
|
1390
1391
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1391
1392
|
}
|
|
@@ -1396,14 +1397,14 @@ function Aa({ def: e, value: i, onChange: t, availableIcons: r, availablePropert
|
|
|
1396
1397
|
"input",
|
|
1397
1398
|
{
|
|
1398
1399
|
type: "checkbox",
|
|
1399
|
-
checked:
|
|
1400
|
+
checked: f,
|
|
1400
1401
|
onChange: (s) => {
|
|
1401
1402
|
t(e.key, s.target.checked ? e.enableDefault : void 0);
|
|
1402
1403
|
},
|
|
1403
1404
|
className: "mapui:h-4 mapui:w-4 mapui:shrink-0 mapui:accent-blue-600"
|
|
1404
1405
|
}
|
|
1405
1406
|
),
|
|
1406
|
-
|
|
1407
|
+
f && /* @__PURE__ */ a(
|
|
1407
1408
|
Te,
|
|
1408
1409
|
{
|
|
1409
1410
|
def: e,
|
|
@@ -1411,7 +1412,7 @@ function Aa({ def: e, value: i, onChange: t, availableIcons: r, availablePropert
|
|
|
1411
1412
|
onChange: (s) => t(e.key, s),
|
|
1412
1413
|
availableIcons: r,
|
|
1413
1414
|
availableProperties: p,
|
|
1414
|
-
onFetchDistinctValues:
|
|
1415
|
+
onFetchDistinctValues: m
|
|
1415
1416
|
}
|
|
1416
1417
|
)
|
|
1417
1418
|
] }) }) : /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
|
|
@@ -1422,7 +1423,7 @@ function Aa({ def: e, value: i, onChange: t, availableIcons: r, availablePropert
|
|
|
1422
1423
|
onChange: (s) => t(e.key, s),
|
|
1423
1424
|
availableIcons: r,
|
|
1424
1425
|
availableProperties: p,
|
|
1425
|
-
onFetchDistinctValues:
|
|
1426
|
+
onFetchDistinctValues: m
|
|
1426
1427
|
}
|
|
1427
1428
|
) });
|
|
1428
1429
|
}
|
|
@@ -1432,30 +1433,30 @@ function De({
|
|
|
1432
1433
|
values: t,
|
|
1433
1434
|
onChange: r,
|
|
1434
1435
|
defaultOpen: p = !1,
|
|
1435
|
-
availableIcons:
|
|
1436
|
+
availableIcons: m,
|
|
1436
1437
|
availableProperties: n,
|
|
1437
|
-
onFetchDistinctValues:
|
|
1438
|
+
onFetchDistinctValues: f
|
|
1438
1439
|
}) {
|
|
1439
1440
|
const s = i.filter(
|
|
1440
|
-
(
|
|
1441
|
+
(h) => h.enableDefault !== void 0 && t[h.key] !== void 0
|
|
1441
1442
|
).length;
|
|
1442
|
-
return /* @__PURE__ */ a(X, { title: e, defaultOpen: p, badge: s || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: i.map((
|
|
1443
|
-
|
|
1443
|
+
return /* @__PURE__ */ a(X, { title: e, defaultOpen: p, badge: s || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: i.map((h) => /* @__PURE__ */ a(
|
|
1444
|
+
Ea,
|
|
1444
1445
|
{
|
|
1445
|
-
def:
|
|
1446
|
-
value: t[
|
|
1446
|
+
def: h,
|
|
1447
|
+
value: t[h.key],
|
|
1447
1448
|
onChange: r,
|
|
1448
|
-
availableIcons:
|
|
1449
|
+
availableIcons: m,
|
|
1449
1450
|
availableProperties: n,
|
|
1450
|
-
onFetchDistinctValues:
|
|
1451
|
+
onFetchDistinctValues: f
|
|
1451
1452
|
},
|
|
1452
|
-
|
|
1453
|
+
h.key
|
|
1453
1454
|
)) }) });
|
|
1454
1455
|
}
|
|
1455
1456
|
function V(e) {
|
|
1456
1457
|
return Array.isArray(e);
|
|
1457
1458
|
}
|
|
1458
|
-
function
|
|
1459
|
+
function Ia(e) {
|
|
1459
1460
|
return e[0] === "match" ? "match" : e[0] === "interpolate" ? "interpolate" : null;
|
|
1460
1461
|
}
|
|
1461
1462
|
function We(e) {
|
|
@@ -1474,12 +1475,12 @@ function We(e) {
|
|
|
1474
1475
|
}
|
|
1475
1476
|
return [];
|
|
1476
1477
|
}
|
|
1477
|
-
function
|
|
1478
|
+
function Ma(e) {
|
|
1478
1479
|
if (e[0] === "match") {
|
|
1479
1480
|
const i = [];
|
|
1480
1481
|
for (let r = 2; r < e.length - 1; r += 2) {
|
|
1481
|
-
const p = String(e[r]),
|
|
1482
|
-
typeof
|
|
1482
|
+
const p = String(e[r]), m = e[r + 1];
|
|
1483
|
+
typeof m == "string" && i.push({ label: p, color: m });
|
|
1483
1484
|
}
|
|
1484
1485
|
const t = e[e.length - 1];
|
|
1485
1486
|
return typeof t == "string" && i.push({ label: "Other", color: t }), i;
|
|
@@ -1494,7 +1495,7 @@ function Ia(e) {
|
|
|
1494
1495
|
}
|
|
1495
1496
|
return [];
|
|
1496
1497
|
}
|
|
1497
|
-
function
|
|
1498
|
+
function Fa(e) {
|
|
1498
1499
|
const i = e[0] === "match" ? e[1] : e[0] === "interpolate" ? e[2] : null;
|
|
1499
1500
|
if (Array.isArray(i)) {
|
|
1500
1501
|
if (i[0] === "get" && typeof i[1] == "string") return i[1];
|
|
@@ -1503,7 +1504,7 @@ function Ma(e) {
|
|
|
1503
1504
|
}
|
|
1504
1505
|
return null;
|
|
1505
1506
|
}
|
|
1506
|
-
function
|
|
1507
|
+
function Pa(e) {
|
|
1507
1508
|
switch (e.type) {
|
|
1508
1509
|
case "fill":
|
|
1509
1510
|
return e.paint["fill-color"] ?? "#000000";
|
|
@@ -1515,7 +1516,7 @@ function Fa(e) {
|
|
|
1515
1516
|
return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
|
|
1516
1517
|
}
|
|
1517
1518
|
}
|
|
1518
|
-
function
|
|
1519
|
+
function Oa(e) {
|
|
1519
1520
|
switch (e.type) {
|
|
1520
1521
|
case "fill":
|
|
1521
1522
|
return "square";
|
|
@@ -1536,7 +1537,7 @@ function oe({ expr: e, height: i }) {
|
|
|
1536
1537
|
title: "Expression (no preview)"
|
|
1537
1538
|
}
|
|
1538
1539
|
);
|
|
1539
|
-
const r = e[0] === "interpolate", p = r ? `linear-gradient(to right, ${t.join(", ")})` : t.map((
|
|
1540
|
+
const r = e[0] === "interpolate", p = r ? `linear-gradient(to right, ${t.join(", ")})` : t.map((m, n) => `${m} ${n / t.length * 100}% ${(n + 1) / t.length * 100}%`).join(", ");
|
|
1540
1541
|
return /* @__PURE__ */ a(
|
|
1541
1542
|
"div",
|
|
1542
1543
|
{
|
|
@@ -1553,7 +1554,7 @@ function oe({ expr: e, height: i }) {
|
|
|
1553
1554
|
function Le(e, i) {
|
|
1554
1555
|
return typeof e == "string" ? e : V(e) ? We(e)[0] ?? i : i;
|
|
1555
1556
|
}
|
|
1556
|
-
function
|
|
1557
|
+
function ja({ style: e }) {
|
|
1557
1558
|
if (e.type === "fill") {
|
|
1558
1559
|
const r = e.paint["fill-color"];
|
|
1559
1560
|
return /* @__PURE__ */ a(
|
|
@@ -1640,7 +1641,7 @@ function Oa({ style: e }) {
|
|
|
1640
1641
|
}
|
|
1641
1642
|
);
|
|
1642
1643
|
}
|
|
1643
|
-
const
|
|
1644
|
+
const $a = [
|
|
1644
1645
|
// Appearance (paint)
|
|
1645
1646
|
{ key: "fill-color", label: "Fill Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1646
1647
|
{ key: "fill-opacity", label: "Fill Opacity", widget: "opacity", group: "Appearance", category: "paint" },
|
|
@@ -1652,7 +1653,7 @@ const ja = [
|
|
|
1652
1653
|
{ key: "fill-translate-anchor", label: "Translate Anchor", widget: "enum", group: "Transform", category: "paint", options: ["map", "viewport"], enableDefault: "map", description: '"map" moves the fill with the map when panning; "viewport" keeps the offset fixed on screen.' },
|
|
1653
1654
|
// Sorting (layout)
|
|
1654
1655
|
{ key: "fill-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1655
|
-
],
|
|
1656
|
+
], Ra = [
|
|
1656
1657
|
// Appearance (paint)
|
|
1657
1658
|
{ key: "line-color", label: "Line Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1658
1659
|
{ key: "line-width", label: "Line Width", widget: "number", group: "Appearance", category: "paint", min: 0, step: 0.5 },
|
|
@@ -1673,7 +1674,7 @@ const ja = [
|
|
|
1673
1674
|
{ key: "line-round-limit", label: "Round Limit", widget: "number", group: "Cap & Join", category: "layout", step: 0.1, enableDefault: 1.05, description: 'When line-join is "round", angles sharper than this threshold (in radians) are bevelled instead of rounded.' },
|
|
1674
1675
|
// Sorting (layout)
|
|
1675
1676
|
{ key: "line-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1676
|
-
],
|
|
1677
|
+
], Ba = [
|
|
1677
1678
|
// Appearance (paint)
|
|
1678
1679
|
{ key: "circle-color", label: "Circle Color", widget: "color", group: "Appearance", category: "paint" },
|
|
1679
1680
|
{ key: "circle-radius", label: "Radius", widget: "number", group: "Appearance", category: "paint", min: 0, step: 1 },
|
|
@@ -1691,7 +1692,7 @@ const ja = [
|
|
|
1691
1692
|
{ key: "circle-pitch-alignment", label: "Pitch Alignment", widget: "enum", group: "Alignment", category: "paint", options: ["map", "viewport"], enableDefault: "viewport", description: '"map" orients circles flat on the map surface; "viewport" keeps circles facing the screen (default).' },
|
|
1692
1693
|
// Sorting (layout)
|
|
1693
1694
|
{ key: "circle-sort-key", label: "Sort Key", widget: "number", group: "Sorting", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are drawn on top of features with a lower sort key within this layer." }
|
|
1694
|
-
],
|
|
1695
|
+
], za = [
|
|
1695
1696
|
// Icon Appearance (paint)
|
|
1696
1697
|
{ key: "icon-color", label: "Icon Color", widget: "color", group: "Icon Appearance", category: "paint", enableDefault: "#000000" },
|
|
1697
1698
|
{ key: "icon-opacity", label: "Icon Opacity", widget: "opacity", group: "Icon Appearance", category: "paint", enableDefault: 1 },
|
|
@@ -1740,14 +1741,14 @@ const ja = [
|
|
|
1740
1741
|
{ key: "symbol-avoid-edges", label: "Avoid Edges", widget: "boolean", group: "Placement", category: "layout", enableDefault: !1, description: "When enabled, symbols near tile edges are hidden to avoid being clipped or doubled at tile boundaries." },
|
|
1741
1742
|
{ key: "symbol-sort-key", label: "Sort Key", widget: "number", group: "Placement", category: "layout", step: 1, enableDefault: 0, description: "Features with a higher sort key are prioritised in collision detection and drawn on top within this layer." },
|
|
1742
1743
|
{ key: "symbol-z-order", label: "Z-Order", widget: "enum", group: "Placement", category: "layout", options: ["auto", "viewport-y", "source"], enableDefault: "auto", description: '"viewport-y" renders symbols in top-to-bottom screen order (closer = higher); "source" preserves data source order; "auto" uses "viewport-y" when sort-key is unset.' }
|
|
1743
|
-
],
|
|
1744
|
-
fill:
|
|
1745
|
-
line:
|
|
1746
|
-
circle:
|
|
1747
|
-
symbol:
|
|
1744
|
+
], Ua = {
|
|
1745
|
+
fill: $a,
|
|
1746
|
+
line: Ra,
|
|
1747
|
+
circle: Ba,
|
|
1748
|
+
symbol: za
|
|
1748
1749
|
};
|
|
1749
|
-
function
|
|
1750
|
-
return
|
|
1750
|
+
function Ga(e) {
|
|
1751
|
+
return Ua[e] ?? [];
|
|
1751
1752
|
}
|
|
1752
1753
|
function Ae(e) {
|
|
1753
1754
|
const i = {};
|
|
@@ -1758,17 +1759,17 @@ function Ae(e) {
|
|
|
1758
1759
|
const ge = {
|
|
1759
1760
|
type: "fill",
|
|
1760
1761
|
paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 }
|
|
1761
|
-
},
|
|
1762
|
+
}, qa = {
|
|
1762
1763
|
type: "line",
|
|
1763
1764
|
paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
|
|
1764
1765
|
}, _e = {
|
|
1765
1766
|
type: "circle",
|
|
1766
1767
|
paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
|
|
1767
|
-
},
|
|
1768
|
+
}, Wa = {
|
|
1768
1769
|
type: "symbol",
|
|
1769
1770
|
paint: { "text-color": "#333333" },
|
|
1770
1771
|
layout: { "text-field": "{name}", "text-size": 14 }
|
|
1771
|
-
},
|
|
1772
|
+
}, _a = {
|
|
1772
1773
|
layout: { "icon-image": "" }
|
|
1773
1774
|
};
|
|
1774
1775
|
function Ee(e) {
|
|
@@ -1776,133 +1777,133 @@ function Ee(e) {
|
|
|
1776
1777
|
const i = e.layout ?? {}, t = "icon-image" in i, r = "text-field" in i;
|
|
1777
1778
|
return t && r ? "both" : t ? "icon" : "text";
|
|
1778
1779
|
}
|
|
1779
|
-
const
|
|
1780
|
+
const Va = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", ie = {
|
|
1780
1781
|
fill: "Fill",
|
|
1781
1782
|
line: "Line",
|
|
1782
1783
|
circle: "Circle",
|
|
1783
1784
|
symbol: "Symbol"
|
|
1784
|
-
},
|
|
1785
|
-
function
|
|
1786
|
-
const
|
|
1785
|
+
}, Ha = ["text", "icon", "both"];
|
|
1786
|
+
function Ya({ value: e, onChange: i, suggestedType: t, suggestedTypes: r, availableIcons: p, availableProperties: m, onFetchDistinctValues: n }) {
|
|
1787
|
+
const f = r ?? (t ? [t] : []), [s, h] = T(() => Ee(e));
|
|
1787
1788
|
q(() => {
|
|
1788
|
-
|
|
1789
|
+
h(Ee(e));
|
|
1789
1790
|
}, [e.type]);
|
|
1790
|
-
const d = (
|
|
1791
|
-
i(
|
|
1792
|
-
},
|
|
1793
|
-
if (
|
|
1791
|
+
const d = (g) => {
|
|
1792
|
+
i(g === "fill" ? ge : g === "line" ? qa : g === "circle" ? _e : Wa);
|
|
1793
|
+
}, x = (g) => {
|
|
1794
|
+
if (g === s) return;
|
|
1794
1795
|
const M = e.paint ?? {}, P = e.layout ?? {};
|
|
1795
|
-
let
|
|
1796
|
-
|
|
1796
|
+
let b = { ...M }, k = { ...P };
|
|
1797
|
+
g === "icon" ? (b = Object.fromEntries(Object.entries(b).filter(([j]) => !j.startsWith("text-"))), k = Object.fromEntries(Object.entries(k).filter(([j]) => !j.startsWith("text-"))), "icon-image" in k || (k["icon-image"] = _a.layout["icon-image"])) : g === "text" && (b = Object.fromEntries(Object.entries(b).filter(([j]) => !j.startsWith("icon-"))), k = Object.fromEntries(Object.entries(k).filter(([j]) => !j.startsWith("icon-"))), "text-field" in k || (k["text-field"] = "{name}"), "text-size" in k || (k["text-size"] = 14), "text-color" in b || (b["text-color"] = "#333333")), h(g), i({
|
|
1797
1798
|
...e,
|
|
1798
|
-
paint:
|
|
1799
|
+
paint: b,
|
|
1799
1800
|
layout: Object.keys(k).length > 0 ? k : void 0
|
|
1800
1801
|
});
|
|
1801
|
-
},
|
|
1802
|
-
const P = { ...e.paint, [
|
|
1803
|
-
for (const
|
|
1804
|
-
P[
|
|
1802
|
+
}, v = (g, M) => {
|
|
1803
|
+
const P = { ...e.paint, [g]: M };
|
|
1804
|
+
for (const b of Object.keys(P))
|
|
1805
|
+
P[b] === void 0 && delete P[b];
|
|
1805
1806
|
i({ ...e, paint: P });
|
|
1806
|
-
},
|
|
1807
|
-
const
|
|
1808
|
-
for (const k of Object.keys(
|
|
1809
|
-
|
|
1807
|
+
}, u = (g, M) => {
|
|
1808
|
+
const b = { ...e.layout ?? {}, [g]: M };
|
|
1809
|
+
for (const k of Object.keys(b))
|
|
1810
|
+
b[k] === void 0 && delete b[k];
|
|
1810
1811
|
i({
|
|
1811
1812
|
...e,
|
|
1812
|
-
layout: Object.keys(
|
|
1813
|
+
layout: Object.keys(b).length > 0 ? b : void 0
|
|
1813
1814
|
});
|
|
1814
1815
|
};
|
|
1815
|
-
let
|
|
1816
|
-
e.type === "symbol" && (s === "text" ?
|
|
1817
|
-
const
|
|
1816
|
+
let c = Ga(e.type);
|
|
1817
|
+
e.type === "symbol" && (s === "text" ? c = c.filter((g) => !g.key.startsWith("icon-")) : s === "icon" && (c = c.filter((g) => !g.key.startsWith("text-"))));
|
|
1818
|
+
const w = c.filter((g) => g.category === "paint"), N = c.filter((g) => g.category === "layout"), C = Ae(w), E = Ae(N), O = e.paint, o = e.layout ?? {}, D = Object.keys(C), F = Object.keys(E);
|
|
1818
1819
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1819
|
-
|
|
1820
|
+
f.length > 0 && !f.includes(e.type) && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-blue-800", children: [
|
|
1820
1821
|
/* @__PURE__ */ l("span", { children: [
|
|
1821
1822
|
"Detected geometry is suitable for",
|
|
1822
1823
|
" ",
|
|
1823
|
-
|
|
1824
|
-
M > 0 && (M ===
|
|
1825
|
-
/* @__PURE__ */ a("strong", { children: ie[
|
|
1826
|
-
] },
|
|
1824
|
+
f.map((g, M) => /* @__PURE__ */ l("span", { children: [
|
|
1825
|
+
M > 0 && (M === f.length - 1 ? " or " : ", "),
|
|
1826
|
+
/* @__PURE__ */ a("strong", { children: ie[g] })
|
|
1827
|
+
] }, g)),
|
|
1827
1828
|
" ",
|
|
1828
1829
|
"style."
|
|
1829
1830
|
] }),
|
|
1830
|
-
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children:
|
|
1831
|
+
/* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: f.map((g) => /* @__PURE__ */ a(
|
|
1831
1832
|
"button",
|
|
1832
1833
|
{
|
|
1833
1834
|
type: "button",
|
|
1834
|
-
onClick: () => d(
|
|
1835
|
+
onClick: () => d(g),
|
|
1835
1836
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-400 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
1836
|
-
children: ie[
|
|
1837
|
+
children: ie[g]
|
|
1837
1838
|
},
|
|
1838
|
-
|
|
1839
|
+
g
|
|
1839
1840
|
)) })
|
|
1840
1841
|
] }),
|
|
1841
1842
|
/* @__PURE__ */ a(S, { label: "Style Type", children: /* @__PURE__ */ a(
|
|
1842
1843
|
"select",
|
|
1843
1844
|
{
|
|
1844
1845
|
value: e.type,
|
|
1845
|
-
onChange: (
|
|
1846
|
-
className:
|
|
1847
|
-
children: Object.keys(ie).map((
|
|
1846
|
+
onChange: (g) => d(g.target.value),
|
|
1847
|
+
className: Va,
|
|
1848
|
+
children: Object.keys(ie).map((g) => /* @__PURE__ */ a("option", { value: g, children: ie[g] }, g))
|
|
1848
1849
|
}
|
|
1849
1850
|
) }),
|
|
1850
|
-
e.type === "symbol" && /* @__PURE__ */ a(S, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children:
|
|
1851
|
+
e.type === "symbol" && /* @__PURE__ */ a(S, { label: "Symbol Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: Ha.map((g) => /* @__PURE__ */ a(
|
|
1851
1852
|
"button",
|
|
1852
1853
|
{
|
|
1853
1854
|
type: "button",
|
|
1854
|
-
onClick: () =>
|
|
1855
|
+
onClick: () => x(g),
|
|
1855
1856
|
className: [
|
|
1856
1857
|
"mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-sm mapui:capitalize mapui:outline-none",
|
|
1857
1858
|
"focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
|
|
1858
|
-
s ===
|
|
1859
|
+
s === g ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
|
|
1859
1860
|
].join(" "),
|
|
1860
|
-
children:
|
|
1861
|
+
children: g === "both" ? "Both" : g.charAt(0).toUpperCase() + g.slice(1)
|
|
1861
1862
|
},
|
|
1862
|
-
|
|
1863
|
+
g
|
|
1863
1864
|
)) }) }),
|
|
1864
1865
|
/* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
|
|
1865
1866
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
|
|
1866
|
-
/* @__PURE__ */ a(
|
|
1867
|
+
/* @__PURE__ */ a(ja, { style: e })
|
|
1867
1868
|
] }),
|
|
1868
1869
|
F.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1869
1870
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
|
|
1870
|
-
F.map((
|
|
1871
|
+
F.map((g, M) => /* @__PURE__ */ a(
|
|
1871
1872
|
De,
|
|
1872
1873
|
{
|
|
1873
|
-
title:
|
|
1874
|
-
properties: E[
|
|
1875
|
-
values:
|
|
1876
|
-
onChange:
|
|
1874
|
+
title: g,
|
|
1875
|
+
properties: E[g],
|
|
1876
|
+
values: o,
|
|
1877
|
+
onChange: u,
|
|
1877
1878
|
defaultOpen: M === 0,
|
|
1878
1879
|
availableIcons: p,
|
|
1879
|
-
availableProperties:
|
|
1880
|
+
availableProperties: m,
|
|
1880
1881
|
onFetchDistinctValues: n
|
|
1881
1882
|
},
|
|
1882
|
-
|
|
1883
|
+
g
|
|
1883
1884
|
))
|
|
1884
1885
|
] }),
|
|
1885
|
-
|
|
1886
|
+
D.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1886
1887
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
|
|
1887
|
-
|
|
1888
|
+
D.map((g) => /* @__PURE__ */ a(
|
|
1888
1889
|
De,
|
|
1889
1890
|
{
|
|
1890
|
-
title:
|
|
1891
|
-
properties: C[
|
|
1891
|
+
title: g,
|
|
1892
|
+
properties: C[g],
|
|
1892
1893
|
values: O,
|
|
1893
|
-
onChange:
|
|
1894
|
+
onChange: v,
|
|
1894
1895
|
defaultOpen: !1,
|
|
1895
1896
|
availableIcons: p,
|
|
1896
|
-
availableProperties:
|
|
1897
|
+
availableProperties: m,
|
|
1897
1898
|
onFetchDistinctValues: n
|
|
1898
1899
|
},
|
|
1899
|
-
|
|
1900
|
+
g
|
|
1900
1901
|
))
|
|
1901
1902
|
] })
|
|
1902
1903
|
] });
|
|
1903
1904
|
}
|
|
1904
1905
|
const Ie = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
1905
|
-
function
|
|
1906
|
+
function Xa({ value: e, onChange: i }) {
|
|
1906
1907
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
1907
1908
|
/* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
|
|
1908
1909
|
"input",
|
|
@@ -1938,42 +1939,42 @@ function Ya({ value: e, onChange: i }) {
|
|
|
1938
1939
|
] });
|
|
1939
1940
|
}
|
|
1940
1941
|
const Me = () => ({ label: "", color: "#4a90d9", shape: "square" }), me = 8, Fe = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
1941
|
-
function
|
|
1942
|
-
const
|
|
1942
|
+
function Za({ value: e, onChange: i, styles: t, layerLabel: r }) {
|
|
1943
|
+
const p = (e == null ? void 0 : e.entries) ?? [], m = (e == null ? void 0 : e.displayMode) ?? "simple", n = Ue(() => {
|
|
1943
1944
|
if (!t || t.length === 0) return null;
|
|
1944
|
-
const
|
|
1945
|
-
let
|
|
1945
|
+
const u = [];
|
|
1946
|
+
let c = "simple", w = null;
|
|
1946
1947
|
for (const N of t) {
|
|
1947
|
-
const
|
|
1948
|
-
if (V(
|
|
1949
|
-
const
|
|
1950
|
-
if (!
|
|
1951
|
-
const
|
|
1952
|
-
|
|
1953
|
-
} else typeof
|
|
1948
|
+
const C = Pa(N), E = Oa(N);
|
|
1949
|
+
if (V(C)) {
|
|
1950
|
+
const O = Ia(C);
|
|
1951
|
+
if (!O) continue;
|
|
1952
|
+
const o = Ma(C).map((D) => ({ label: D.label, color: D.color, shape: E }));
|
|
1953
|
+
u.push(...o), O === "interpolate" ? (c = "gradient", w || (w = Fa(C))) : c === "simple" && (c = "categorical");
|
|
1954
|
+
} else typeof C == "string" && u.length === 0 && u.push({ label: r || N.type, color: C, shape: E });
|
|
1954
1955
|
}
|
|
1955
|
-
return
|
|
1956
|
-
}, [t]),
|
|
1957
|
-
i({ ...e, entries: [...
|
|
1958
|
-
},
|
|
1959
|
-
const
|
|
1960
|
-
i({ ...e, entries:
|
|
1961
|
-
},
|
|
1962
|
-
const
|
|
1963
|
-
i(
|
|
1964
|
-
},
|
|
1965
|
-
i(
|
|
1966
|
-
},
|
|
1967
|
-
|
|
1968
|
-
entries:
|
|
1969
|
-
displayMode:
|
|
1970
|
-
...
|
|
1971
|
-
...
|
|
1956
|
+
return u.length === 0 ? null : { entries: u, mode: c, property: w };
|
|
1957
|
+
}, [t, r]), f = () => {
|
|
1958
|
+
i({ ...e, entries: [...p, Me()] });
|
|
1959
|
+
}, s = (u, c) => {
|
|
1960
|
+
const w = p.map((N, C) => C === u ? c : N);
|
|
1961
|
+
i({ ...e, entries: w });
|
|
1962
|
+
}, h = (u) => {
|
|
1963
|
+
const c = p.filter((w, N) => N !== u);
|
|
1964
|
+
i(c.length > 0 ? { ...e, entries: c } : void 0);
|
|
1965
|
+
}, d = (u) => {
|
|
1966
|
+
i(u ? { entries: [Me()] } : void 0);
|
|
1967
|
+
}, x = () => {
|
|
1968
|
+
n && i({
|
|
1969
|
+
entries: n.entries,
|
|
1970
|
+
displayMode: n.mode,
|
|
1971
|
+
...n.mode === "gradient" && n.property ? { gradientProperty: n.property } : {},
|
|
1972
|
+
...n.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
|
|
1972
1973
|
});
|
|
1973
|
-
},
|
|
1974
|
+
}, v = (u) => {
|
|
1974
1975
|
if (!e) return;
|
|
1975
|
-
const
|
|
1976
|
-
|
|
1976
|
+
const c = { ...e, displayMode: u };
|
|
1977
|
+
u !== "categorical" && delete c.showLabelsCollapsed, u !== "categorical" && u !== "gradient" && delete c.showColorBar, u !== "gradient" && delete c.gradientProperty, u === "simple" && delete c.showDisclosureArrow, i(c);
|
|
1977
1978
|
};
|
|
1978
1979
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
1979
1980
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
@@ -1983,36 +1984,36 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
1983
1984
|
type: "checkbox",
|
|
1984
1985
|
id: "legend-enabled",
|
|
1985
1986
|
checked: e !== void 0,
|
|
1986
|
-
onChange: (
|
|
1987
|
+
onChange: (u) => d(u.target.checked),
|
|
1987
1988
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
1988
1989
|
}
|
|
1989
1990
|
),
|
|
1990
1991
|
/* @__PURE__ */ a("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
|
|
1991
1992
|
] }),
|
|
1992
|
-
e === void 0 &&
|
|
1993
|
-
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children:
|
|
1993
|
+
e === void 0 && n && n.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
1994
|
+
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: n.mode !== "simple" ? `This layer uses data-driven colors (${n.entries.length} ${n.entries.length === 1 ? "category" : "categories"})` : `This layer has ${n.entries.length} style ${n.entries.length === 1 ? "color" : "colors"}` }),
|
|
1994
1995
|
/* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
|
|
1995
|
-
|
|
1996
|
+
n.entries.slice(0, me).map((u, c) => /* @__PURE__ */ l(
|
|
1996
1997
|
"div",
|
|
1997
1998
|
{
|
|
1998
1999
|
className: "mapui:flex mapui:items-center mapui:gap-1",
|
|
1999
|
-
title:
|
|
2000
|
+
title: u.label,
|
|
2000
2001
|
children: [
|
|
2001
2002
|
/* @__PURE__ */ a(
|
|
2002
2003
|
"span",
|
|
2003
2004
|
{
|
|
2004
2005
|
className: "mapui:inline-block mapui:h-3 mapui:w-3 mapui:rounded-sm mapui:shrink-0",
|
|
2005
|
-
style: { backgroundColor:
|
|
2006
|
+
style: { backgroundColor: u.color }
|
|
2006
2007
|
}
|
|
2007
2008
|
),
|
|
2008
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children:
|
|
2009
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children: u.label })
|
|
2009
2010
|
]
|
|
2010
2011
|
},
|
|
2011
|
-
`${
|
|
2012
|
+
`${u.label}-${c}`
|
|
2012
2013
|
)),
|
|
2013
|
-
|
|
2014
|
+
n.entries.length > me && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
|
|
2014
2015
|
"+",
|
|
2015
|
-
|
|
2016
|
+
n.entries.length - me,
|
|
2016
2017
|
" more"
|
|
2017
2018
|
] })
|
|
2018
2019
|
] }),
|
|
@@ -2020,7 +2021,7 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
2020
2021
|
"button",
|
|
2021
2022
|
{
|
|
2022
2023
|
type: "button",
|
|
2023
|
-
onClick:
|
|
2024
|
+
onClick: x,
|
|
2024
2025
|
className: "mapui:mt-2 mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
2025
2026
|
children: "Generate from Style"
|
|
2026
2027
|
}
|
|
@@ -2033,8 +2034,8 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
2033
2034
|
"select",
|
|
2034
2035
|
{
|
|
2035
2036
|
id: "legend-display-mode",
|
|
2036
|
-
value:
|
|
2037
|
-
onChange: (
|
|
2037
|
+
value: m,
|
|
2038
|
+
onChange: (u) => v(u.target.value),
|
|
2038
2039
|
className: Fe,
|
|
2039
2040
|
children: [
|
|
2040
2041
|
/* @__PURE__ */ a("option", { value: "simple", children: "Simple" }),
|
|
@@ -2044,46 +2045,46 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
2044
2045
|
}
|
|
2045
2046
|
)
|
|
2046
2047
|
] }),
|
|
2047
|
-
|
|
2048
|
+
m === "categorical" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2048
2049
|
/* @__PURE__ */ a(
|
|
2049
2050
|
"input",
|
|
2050
2051
|
{
|
|
2051
2052
|
type: "checkbox",
|
|
2052
2053
|
id: "legend-show-labels-collapsed",
|
|
2053
2054
|
checked: e.showLabelsCollapsed ?? !1,
|
|
2054
|
-
onChange: (
|
|
2055
|
+
onChange: (u) => i({ ...e, showLabelsCollapsed: u.target.checked }),
|
|
2055
2056
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2056
2057
|
}
|
|
2057
2058
|
),
|
|
2058
2059
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-labels-collapsed", className: "mapui:text-sm mapui:text-gray-700", children: "Show labels in collapsed view" })
|
|
2059
2060
|
] }),
|
|
2060
|
-
(
|
|
2061
|
+
(m === "categorical" || m === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2061
2062
|
/* @__PURE__ */ a(
|
|
2062
2063
|
"input",
|
|
2063
2064
|
{
|
|
2064
2065
|
type: "checkbox",
|
|
2065
2066
|
id: "legend-show-color-bar",
|
|
2066
2067
|
checked: e.showColorBar !== !1,
|
|
2067
|
-
onChange: (
|
|
2068
|
+
onChange: (u) => i({ ...e, showColorBar: u.target.checked }),
|
|
2068
2069
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2069
2070
|
}
|
|
2070
2071
|
),
|
|
2071
2072
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-color-bar", className: "mapui:text-sm mapui:text-gray-700", children: "Show color bar" })
|
|
2072
2073
|
] }),
|
|
2073
|
-
(
|
|
2074
|
+
(m === "categorical" || m === "gradient") && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2074
2075
|
/* @__PURE__ */ a(
|
|
2075
2076
|
"input",
|
|
2076
2077
|
{
|
|
2077
2078
|
type: "checkbox",
|
|
2078
2079
|
id: "legend-show-disclosure-arrow",
|
|
2079
2080
|
checked: e.showDisclosureArrow !== !1,
|
|
2080
|
-
onChange: (
|
|
2081
|
+
onChange: (u) => i({ ...e, showDisclosureArrow: u.target.checked }),
|
|
2081
2082
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2082
2083
|
}
|
|
2083
2084
|
),
|
|
2084
2085
|
/* @__PURE__ */ a("label", { htmlFor: "legend-show-disclosure-arrow", className: "mapui:text-sm mapui:text-gray-700", children: "Show disclosure arrow" })
|
|
2085
2086
|
] }),
|
|
2086
|
-
|
|
2087
|
+
m === "gradient" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2087
2088
|
/* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Label" }),
|
|
2088
2089
|
/* @__PURE__ */ a(
|
|
2089
2090
|
"input",
|
|
@@ -2091,13 +2092,13 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
2091
2092
|
type: "text",
|
|
2092
2093
|
id: "legend-gradient-property",
|
|
2093
2094
|
value: e.gradientProperty ?? "",
|
|
2094
|
-
onChange: (
|
|
2095
|
+
onChange: (u) => i({ ...e, gradientProperty: u.target.value || void 0 }),
|
|
2095
2096
|
placeholder: "e.g. Population",
|
|
2096
2097
|
className: Fe
|
|
2097
2098
|
}
|
|
2098
2099
|
)
|
|
2099
2100
|
] }),
|
|
2100
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children:
|
|
2101
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: p.map((u, c) => /* @__PURE__ */ l(
|
|
2101
2102
|
"li",
|
|
2102
2103
|
{
|
|
2103
2104
|
className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:p-3",
|
|
@@ -2105,48 +2106,48 @@ function Xa({ value: e, onChange: i, styles: t }) {
|
|
|
2105
2106
|
/* @__PURE__ */ l("div", { className: "mapui:mb-2 mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
2106
2107
|
/* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: [
|
|
2107
2108
|
"Entry ",
|
|
2108
|
-
|
|
2109
|
+
c + 1
|
|
2109
2110
|
] }),
|
|
2110
2111
|
/* @__PURE__ */ a(
|
|
2111
2112
|
"button",
|
|
2112
2113
|
{
|
|
2113
2114
|
type: "button",
|
|
2114
|
-
onClick: () =>
|
|
2115
|
+
onClick: () => h(c),
|
|
2115
2116
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2116
2117
|
children: "Remove"
|
|
2117
2118
|
}
|
|
2118
2119
|
)
|
|
2119
2120
|
] }),
|
|
2120
2121
|
/* @__PURE__ */ a(
|
|
2121
|
-
|
|
2122
|
+
Xa,
|
|
2122
2123
|
{
|
|
2123
|
-
value:
|
|
2124
|
-
onChange: (
|
|
2124
|
+
value: u,
|
|
2125
|
+
onChange: (w) => s(c, w)
|
|
2125
2126
|
}
|
|
2126
2127
|
)
|
|
2127
2128
|
]
|
|
2128
2129
|
},
|
|
2129
|
-
|
|
2130
|
+
c
|
|
2130
2131
|
)) }),
|
|
2131
2132
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
|
|
2132
2133
|
/* @__PURE__ */ a(
|
|
2133
2134
|
"button",
|
|
2134
2135
|
{
|
|
2135
2136
|
type: "button",
|
|
2136
|
-
onClick:
|
|
2137
|
+
onClick: f,
|
|
2137
2138
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
2138
2139
|
children: "+ Add Entry"
|
|
2139
2140
|
}
|
|
2140
2141
|
),
|
|
2141
|
-
|
|
2142
|
+
n && n.entries.length > 0 && /* @__PURE__ */ l(
|
|
2142
2143
|
"button",
|
|
2143
2144
|
{
|
|
2144
2145
|
type: "button",
|
|
2145
|
-
onClick:
|
|
2146
|
+
onClick: x,
|
|
2146
2147
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-white mapui:px-3 mapui:py-2 mapui:text-sm mapui:font-medium mapui:text-blue-700 hover:mapui:bg-blue-50",
|
|
2147
2148
|
children: [
|
|
2148
2149
|
"Populate from Style (",
|
|
2149
|
-
|
|
2150
|
+
n.entries.length,
|
|
2150
2151
|
" entries)"
|
|
2151
2152
|
]
|
|
2152
2153
|
}
|
|
@@ -2161,34 +2162,34 @@ function Pe({
|
|
|
2161
2162
|
placeholder: t,
|
|
2162
2163
|
className: r
|
|
2163
2164
|
}) {
|
|
2164
|
-
const [p,
|
|
2165
|
+
const [p, m] = T(() => (e == null ? void 0 : e.join(", ")) ?? "");
|
|
2165
2166
|
return q(() => {
|
|
2166
|
-
|
|
2167
|
+
m((e == null ? void 0 : e.join(", ")) ?? "");
|
|
2167
2168
|
}, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
|
|
2168
2169
|
"input",
|
|
2169
2170
|
{
|
|
2170
2171
|
type: "text",
|
|
2171
2172
|
value: p,
|
|
2172
|
-
onChange: (
|
|
2173
|
+
onChange: (f) => m(f.target.value),
|
|
2173
2174
|
onBlur: () => {
|
|
2174
|
-
const
|
|
2175
|
-
i(s),
|
|
2175
|
+
const f = p.trim(), s = f ? f.split(",").map((h) => h.trim()).filter(Boolean) : void 0;
|
|
2176
|
+
i(s), m((s == null ? void 0 : s.join(", ")) ?? "");
|
|
2176
2177
|
},
|
|
2177
2178
|
placeholder: t,
|
|
2178
2179
|
className: r
|
|
2179
2180
|
}
|
|
2180
2181
|
);
|
|
2181
2182
|
}
|
|
2182
|
-
const $ = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500",
|
|
2183
|
+
const $ = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500", Ja = {
|
|
2183
2184
|
text: { type: "text", property: "", label: "", autocomplete: !1 },
|
|
2184
2185
|
number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
|
|
2185
2186
|
datetime: { type: "datetime", property: "", label: "", range: !1 },
|
|
2186
2187
|
select: { type: "select", property: "", label: "" }
|
|
2187
2188
|
};
|
|
2188
|
-
function
|
|
2189
|
+
function Ka({ value: e, onChange: i, availableProperties: t }) {
|
|
2189
2190
|
const r = (n) => {
|
|
2190
|
-
i({ ...
|
|
2191
|
-
}, p = (n) => i({ ...e, ...n }),
|
|
2191
|
+
i({ ...Ja[n], property: e.property, label: e.label });
|
|
2192
|
+
}, p = (n) => i({ ...e, ...n }), m = t && t.length > 0;
|
|
2192
2193
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2193
2194
|
/* @__PURE__ */ a(S, { label: "Field Type", children: /* @__PURE__ */ l(
|
|
2194
2195
|
"select",
|
|
@@ -2204,7 +2205,7 @@ function Ja({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2204
2205
|
]
|
|
2205
2206
|
}
|
|
2206
2207
|
) }),
|
|
2207
|
-
/* @__PURE__ */ a(S, { label: "Property", required: !0, children:
|
|
2208
|
+
/* @__PURE__ */ a(S, { label: "Property", required: !0, children: m ? /* @__PURE__ */ l(
|
|
2208
2209
|
"select",
|
|
2209
2210
|
{
|
|
2210
2211
|
value: e.property,
|
|
@@ -2449,40 +2450,40 @@ function Ja({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2449
2450
|
] })
|
|
2450
2451
|
] });
|
|
2451
2452
|
}
|
|
2452
|
-
const
|
|
2453
|
+
const Qa = () => ({
|
|
2453
2454
|
type: "text",
|
|
2454
2455
|
property: "",
|
|
2455
2456
|
label: "",
|
|
2456
2457
|
autocomplete: !1
|
|
2457
2458
|
});
|
|
2458
|
-
function
|
|
2459
|
-
const [r, p] = T(null),
|
|
2460
|
-
const d = [...e,
|
|
2459
|
+
function ei({ fields: e, onChange: i, availableProperties: t }) {
|
|
2460
|
+
const [r, p] = T(null), m = () => {
|
|
2461
|
+
const d = [...e, Qa()];
|
|
2461
2462
|
i(d), p(d.length - 1);
|
|
2462
|
-
}, n = (d,
|
|
2463
|
-
i(e.map((
|
|
2464
|
-
},
|
|
2465
|
-
i(e.filter((
|
|
2463
|
+
}, n = (d, x) => {
|
|
2464
|
+
i(e.map((v, u) => u === d ? x : v));
|
|
2465
|
+
}, f = (d) => {
|
|
2466
|
+
i(e.filter((x, v) => v !== d)), p(null);
|
|
2466
2467
|
}, s = (d) => {
|
|
2467
2468
|
if (d === 0) return;
|
|
2468
|
-
const
|
|
2469
|
-
[
|
|
2470
|
-
},
|
|
2469
|
+
const x = [...e];
|
|
2470
|
+
[x[d - 1], x[d]] = [x[d], x[d - 1]], i(x), p(d - 1);
|
|
2471
|
+
}, h = (d) => {
|
|
2471
2472
|
if (d === e.length - 1) return;
|
|
2472
|
-
const
|
|
2473
|
-
[
|
|
2473
|
+
const x = [...e];
|
|
2474
|
+
[x[d], x[d + 1]] = [x[d + 1], x[d]], i(x), p(d + 1);
|
|
2474
2475
|
};
|
|
2475
2476
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2476
2477
|
e.length === 0 && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
|
|
2477
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((d,
|
|
2478
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((d, x) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
|
|
2478
2479
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
|
|
2479
2480
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
2480
2481
|
/* @__PURE__ */ a(
|
|
2481
2482
|
"button",
|
|
2482
2483
|
{
|
|
2483
2484
|
type: "button",
|
|
2484
|
-
onClick: () => s(
|
|
2485
|
-
disabled:
|
|
2485
|
+
onClick: () => s(x),
|
|
2486
|
+
disabled: x === 0,
|
|
2486
2487
|
"aria-label": "Move up",
|
|
2487
2488
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2488
2489
|
children: "▲"
|
|
@@ -2492,8 +2493,8 @@ function Qa({ fields: e, onChange: i, availableProperties: t }) {
|
|
|
2492
2493
|
"button",
|
|
2493
2494
|
{
|
|
2494
2495
|
type: "button",
|
|
2495
|
-
onClick: () =>
|
|
2496
|
-
disabled:
|
|
2496
|
+
onClick: () => h(x),
|
|
2497
|
+
disabled: x === e.length - 1,
|
|
2497
2498
|
"aria-label": "Move down",
|
|
2498
2499
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2499
2500
|
children: "▼"
|
|
@@ -2504,7 +2505,7 @@ function Qa({ fields: e, onChange: i, availableProperties: t }) {
|
|
|
2504
2505
|
"button",
|
|
2505
2506
|
{
|
|
2506
2507
|
type: "button",
|
|
2507
|
-
onClick: () => p(r ===
|
|
2508
|
+
onClick: () => p(r === x ? null : x),
|
|
2508
2509
|
className: "mapui:flex-1 mapui:cursor-pointer mapui:border-none mapui:bg-transparent mapui:text-left mapui:text-sm mapui:font-medium mapui:text-gray-800",
|
|
2509
2510
|
children: [
|
|
2510
2511
|
/* @__PURE__ */ a("span", { className: "mapui:mr-1 mapui:rounded mapui:bg-gray-100 mapui:px-1 mapui:py-0.5 mapui:text-xs mapui:font-mono mapui:text-gray-500", children: d.type }),
|
|
@@ -2516,41 +2517,41 @@ function Qa({ fields: e, onChange: i, availableProperties: t }) {
|
|
|
2516
2517
|
"button",
|
|
2517
2518
|
{
|
|
2518
2519
|
type: "button",
|
|
2519
|
-
onClick: () => x
|
|
2520
|
+
onClick: () => f(x),
|
|
2520
2521
|
"aria-label": "Remove field",
|
|
2521
2522
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2522
2523
|
children: "Remove"
|
|
2523
2524
|
}
|
|
2524
2525
|
)
|
|
2525
2526
|
] }),
|
|
2526
|
-
r ===
|
|
2527
|
-
|
|
2527
|
+
r === x && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
2528
|
+
Ka,
|
|
2528
2529
|
{
|
|
2529
2530
|
value: d,
|
|
2530
|
-
onChange: (
|
|
2531
|
+
onChange: (v) => n(x, v),
|
|
2531
2532
|
availableProperties: t
|
|
2532
2533
|
}
|
|
2533
2534
|
) })
|
|
2534
|
-
] },
|
|
2535
|
+
] }, x)) }),
|
|
2535
2536
|
/* @__PURE__ */ a(
|
|
2536
2537
|
"button",
|
|
2537
2538
|
{
|
|
2538
2539
|
type: "button",
|
|
2539
|
-
onClick:
|
|
2540
|
+
onClick: m,
|
|
2540
2541
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-dashed mapui:border-gray-300 mapui:px-3 mapui:py-2 mapui:text-sm mapui:text-gray-600 hover:mapui:border-blue-400 hover:mapui:text-blue-600",
|
|
2541
2542
|
children: "+ Add Search Field"
|
|
2542
2543
|
}
|
|
2543
2544
|
)
|
|
2544
2545
|
] });
|
|
2545
2546
|
}
|
|
2546
|
-
function
|
|
2547
|
+
function ai(e) {
|
|
2547
2548
|
return Object.entries(e).map(([i, t]) => ({
|
|
2548
2549
|
key: i,
|
|
2549
2550
|
label: t.label ?? "",
|
|
2550
2551
|
visible: t.visible ?? !0
|
|
2551
2552
|
}));
|
|
2552
2553
|
}
|
|
2553
|
-
function
|
|
2554
|
+
function ii(e) {
|
|
2554
2555
|
const i = {};
|
|
2555
2556
|
for (const t of e)
|
|
2556
2557
|
i[t.key] = {
|
|
@@ -2560,32 +2561,32 @@ function ai(e) {
|
|
|
2560
2561
|
return i;
|
|
2561
2562
|
}
|
|
2562
2563
|
const se = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
2563
|
-
function
|
|
2564
|
-
const r =
|
|
2565
|
-
|
|
2566
|
-
},
|
|
2567
|
-
|
|
2568
|
-
}, s = (
|
|
2569
|
-
|
|
2570
|
-
},
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
}, d = (
|
|
2574
|
-
if (
|
|
2575
|
-
const
|
|
2576
|
-
[
|
|
2577
|
-
},
|
|
2578
|
-
if (
|
|
2579
|
-
const
|
|
2580
|
-
[
|
|
2581
|
-
},
|
|
2564
|
+
function ti({ value: e, onChange: i, availableProperties: t }) {
|
|
2565
|
+
const r = ai(e), p = t && t.length > 0, m = (u) => i(ii(u)), n = () => {
|
|
2566
|
+
m([...r, { key: "", label: "", visible: !0 }]);
|
|
2567
|
+
}, f = (u) => {
|
|
2568
|
+
m(r.filter((c, w) => w !== u));
|
|
2569
|
+
}, s = (u, c) => {
|
|
2570
|
+
m(r.map((w, N) => N === u ? { ...w, ...c } : w));
|
|
2571
|
+
}, h = (u, c) => {
|
|
2572
|
+
const w = t == null ? void 0 : t.find((C) => C.name === c), N = (w == null ? void 0 : w.title) ?? r[u].label;
|
|
2573
|
+
m(r.map((C, E) => E === u ? { ...C, key: c, label: N } : C));
|
|
2574
|
+
}, d = (u) => {
|
|
2575
|
+
if (u === 0) return;
|
|
2576
|
+
const c = [...r];
|
|
2577
|
+
[c[u - 1], c[u]] = [c[u], c[u - 1]], m(c);
|
|
2578
|
+
}, x = (u) => {
|
|
2579
|
+
if (u === r.length - 1) return;
|
|
2580
|
+
const c = [...r];
|
|
2581
|
+
[c[u], c[u + 1]] = [c[u + 1], c[u]], m(c);
|
|
2582
|
+
}, v = () => {
|
|
2582
2583
|
if (!t) return;
|
|
2583
|
-
const
|
|
2584
|
-
key:
|
|
2585
|
-
label:
|
|
2584
|
+
const u = t.map((c) => ({
|
|
2585
|
+
key: c.name,
|
|
2586
|
+
label: c.title ?? "",
|
|
2586
2587
|
visible: !0
|
|
2587
2588
|
}));
|
|
2588
|
-
u
|
|
2589
|
+
m(u);
|
|
2589
2590
|
};
|
|
2590
2591
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
2591
2592
|
r.length === 0 ? /* @__PURE__ */ l(z, { children: [
|
|
@@ -2594,7 +2595,7 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2594
2595
|
"button",
|
|
2595
2596
|
{
|
|
2596
2597
|
type: "button",
|
|
2597
|
-
onClick:
|
|
2598
|
+
onClick: v,
|
|
2598
2599
|
className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-blue-300 mapui:bg-blue-50 mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:text-blue-700 hover:mapui:bg-blue-100",
|
|
2599
2600
|
children: "Populate from API metadata"
|
|
2600
2601
|
}
|
|
@@ -2605,14 +2606,14 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2605
2606
|
/* @__PURE__ */ a(S, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
|
|
2606
2607
|
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
|
|
2607
2608
|
] }),
|
|
2608
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((
|
|
2609
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: r.map((u, c) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1.5", children: [
|
|
2609
2610
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
2610
2611
|
/* @__PURE__ */ a(
|
|
2611
2612
|
"button",
|
|
2612
2613
|
{
|
|
2613
2614
|
type: "button",
|
|
2614
|
-
onClick: () => d(
|
|
2615
|
-
disabled:
|
|
2615
|
+
onClick: () => d(c),
|
|
2616
|
+
disabled: c === 0,
|
|
2616
2617
|
"aria-label": "Move up",
|
|
2617
2618
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2618
2619
|
children: "▲"
|
|
@@ -2622,8 +2623,8 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2622
2623
|
"button",
|
|
2623
2624
|
{
|
|
2624
2625
|
type: "button",
|
|
2625
|
-
onClick: () =>
|
|
2626
|
-
disabled:
|
|
2626
|
+
onClick: () => x(c),
|
|
2627
|
+
disabled: c === r.length - 1,
|
|
2627
2628
|
"aria-label": "Move down",
|
|
2628
2629
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
2629
2630
|
children: "▼"
|
|
@@ -2634,21 +2635,21 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2634
2635
|
p ? /* @__PURE__ */ l(
|
|
2635
2636
|
"select",
|
|
2636
2637
|
{
|
|
2637
|
-
value:
|
|
2638
|
-
onChange: (
|
|
2638
|
+
value: u.key,
|
|
2639
|
+
onChange: (w) => h(c, w.target.value),
|
|
2639
2640
|
"aria-label": "Property key",
|
|
2640
2641
|
className: se,
|
|
2641
2642
|
children: [
|
|
2642
2643
|
/* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
|
|
2643
|
-
t.map((
|
|
2644
|
+
t.map((w) => /* @__PURE__ */ a("option", { value: w.name, children: w.title ?? w.name }, w.name))
|
|
2644
2645
|
]
|
|
2645
2646
|
}
|
|
2646
2647
|
) : /* @__PURE__ */ a(
|
|
2647
2648
|
"input",
|
|
2648
2649
|
{
|
|
2649
2650
|
type: "text",
|
|
2650
|
-
value:
|
|
2651
|
-
onChange: (
|
|
2651
|
+
value: u.key,
|
|
2652
|
+
onChange: (w) => s(c, { key: w.target.value }),
|
|
2652
2653
|
placeholder: "property_name",
|
|
2653
2654
|
"aria-label": "Property key",
|
|
2654
2655
|
className: se
|
|
@@ -2658,8 +2659,8 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2658
2659
|
"input",
|
|
2659
2660
|
{
|
|
2660
2661
|
type: "text",
|
|
2661
|
-
value:
|
|
2662
|
-
onChange: (
|
|
2662
|
+
value: u.label,
|
|
2663
|
+
onChange: (w) => s(c, { label: w.target.value }),
|
|
2663
2664
|
placeholder: "Friendly name",
|
|
2664
2665
|
"aria-label": "Display label",
|
|
2665
2666
|
className: se
|
|
@@ -2669,8 +2670,8 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2669
2670
|
"input",
|
|
2670
2671
|
{
|
|
2671
2672
|
type: "checkbox",
|
|
2672
|
-
checked:
|
|
2673
|
-
onChange: (
|
|
2673
|
+
checked: u.visible,
|
|
2674
|
+
onChange: (w) => s(c, { visible: w.target.checked }),
|
|
2674
2675
|
"aria-label": "Visible",
|
|
2675
2676
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2676
2677
|
}
|
|
@@ -2679,14 +2680,14 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2679
2680
|
"button",
|
|
2680
2681
|
{
|
|
2681
2682
|
type: "button",
|
|
2682
|
-
onClick: () =>
|
|
2683
|
+
onClick: () => f(c),
|
|
2683
2684
|
"aria-label": "Remove property",
|
|
2684
2685
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-0.5 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
2685
2686
|
children: "Remove"
|
|
2686
2687
|
}
|
|
2687
2688
|
)
|
|
2688
2689
|
] })
|
|
2689
|
-
] },
|
|
2690
|
+
] }, c)) })
|
|
2690
2691
|
] }),
|
|
2691
2692
|
/* @__PURE__ */ a(
|
|
2692
2693
|
"button",
|
|
@@ -2700,7 +2701,7 @@ function ii({ value: e, onChange: i, availableProperties: t }) {
|
|
|
2700
2701
|
] });
|
|
2701
2702
|
}
|
|
2702
2703
|
const Ve = /geojson\.org\/schema\/(\w+)\.json/;
|
|
2703
|
-
function
|
|
2704
|
+
function ri(e) {
|
|
2704
2705
|
return !!e.$ref && Ve.test(e.$ref);
|
|
2705
2706
|
}
|
|
2706
2707
|
function He(e) {
|
|
@@ -2715,7 +2716,7 @@ function fe(e) {
|
|
|
2715
2716
|
const i = e.toLowerCase();
|
|
2716
2717
|
return i.includes("polygon") ? ["fill", "line"] : i.includes("linestring") ? ["line"] : i.includes("point") ? ["circle", "symbol"] : [];
|
|
2717
2718
|
}
|
|
2718
|
-
function
|
|
2719
|
+
function li(e) {
|
|
2719
2720
|
for (const i of Object.values(e.properties))
|
|
2720
2721
|
if (i.$ref) {
|
|
2721
2722
|
const t = He(i.$ref);
|
|
@@ -2731,8 +2732,8 @@ function Xe(e) {
|
|
|
2731
2732
|
}
|
|
2732
2733
|
return [];
|
|
2733
2734
|
}
|
|
2734
|
-
function
|
|
2735
|
-
return Object.entries(e.properties).filter(([, i]) => !
|
|
2735
|
+
function pi(e) {
|
|
2736
|
+
return Object.entries(e.properties).filter(([, i]) => !ri(i)).map(([i, t]) => ({
|
|
2736
2737
|
name: i,
|
|
2737
2738
|
title: t.title,
|
|
2738
2739
|
type: t.type,
|
|
@@ -2749,11 +2750,11 @@ function Ze(e) {
|
|
|
2749
2750
|
(t = r.geometry) != null && t.type && i.add(r.geometry.type);
|
|
2750
2751
|
return Array.from(i);
|
|
2751
2752
|
}
|
|
2752
|
-
function
|
|
2753
|
+
function ni(e) {
|
|
2753
2754
|
const i = /* @__PURE__ */ new Set();
|
|
2754
2755
|
for (const p of e) {
|
|
2755
|
-
const
|
|
2756
|
-
|
|
2756
|
+
const m = p.toLowerCase();
|
|
2757
|
+
m.includes("polygon") ? i.add("polygon") : m.includes("linestring") ? i.add("line") : m.includes("point") && i.add("point");
|
|
2757
2758
|
}
|
|
2758
2759
|
const t = i.size > 1, r = [];
|
|
2759
2760
|
return i.has("polygon") && r.push({
|
|
@@ -2770,21 +2771,21 @@ function pi(e) {
|
|
|
2770
2771
|
...t ? { geometryFilter: ["Point", "MultiPoint"] } : {}
|
|
2771
2772
|
}), r;
|
|
2772
2773
|
}
|
|
2773
|
-
async function
|
|
2774
|
+
async function Ti(e, i) {
|
|
2774
2775
|
var t, r;
|
|
2775
2776
|
try {
|
|
2776
|
-
const p = await qe(e, i),
|
|
2777
|
-
if (
|
|
2777
|
+
const p = await qe(e, i), m = li(p);
|
|
2778
|
+
if (m) return m;
|
|
2778
2779
|
} catch {
|
|
2779
2780
|
}
|
|
2780
2781
|
try {
|
|
2781
|
-
const
|
|
2782
|
-
if (typeof
|
|
2782
|
+
const m = (r = (t = (await ye(e, i, { limit: 1 })).features[0]) == null ? void 0 : t.geometry) == null ? void 0 : r.type;
|
|
2783
|
+
if (typeof m == "string") return Ye(m);
|
|
2783
2784
|
} catch {
|
|
2784
2785
|
}
|
|
2785
2786
|
return null;
|
|
2786
2787
|
}
|
|
2787
|
-
async function
|
|
2788
|
+
async function Di(e, i) {
|
|
2788
2789
|
try {
|
|
2789
2790
|
const t = await qe(e, i), r = Xe(t);
|
|
2790
2791
|
if (r.length > 0) return r;
|
|
@@ -2792,79 +2793,79 @@ async function Ti(e, i) {
|
|
|
2792
2793
|
}
|
|
2793
2794
|
try {
|
|
2794
2795
|
const t = await ye(e, i, { limit: 20 }), r = Ze(t.features), p = /* @__PURE__ */ new Set();
|
|
2795
|
-
for (const
|
|
2796
|
-
for (const n of fe(
|
|
2796
|
+
for (const m of r)
|
|
2797
|
+
for (const n of fe(m))
|
|
2797
2798
|
p.add(n);
|
|
2798
2799
|
return Array.from(p);
|
|
2799
2800
|
} catch {
|
|
2800
2801
|
}
|
|
2801
2802
|
return [];
|
|
2802
2803
|
}
|
|
2803
|
-
function
|
|
2804
|
+
function Li(e) {
|
|
2804
2805
|
return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (i) => i.toUpperCase());
|
|
2805
2806
|
}
|
|
2806
|
-
function
|
|
2807
|
+
function ui(e, i, t) {
|
|
2807
2808
|
const r = [...e ?? []];
|
|
2808
2809
|
return r[i] = t, r;
|
|
2809
2810
|
}
|
|
2810
|
-
function
|
|
2811
|
+
function oi(e, i) {
|
|
2811
2812
|
return (e ?? []).filter((t, r) => r !== i);
|
|
2812
2813
|
}
|
|
2813
2814
|
const _ = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
2814
2815
|
function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
2815
2816
|
var O;
|
|
2816
|
-
const p = (
|
|
2817
|
-
|
|
2817
|
+
const p = (o) => i({ ...e, ...o }), m = H(e);
|
|
2818
|
+
m.current = e;
|
|
2818
2819
|
const n = H(i);
|
|
2819
2820
|
n.current = i;
|
|
2820
|
-
const
|
|
2821
|
+
const f = t.find((o) => o.id === e.sourceId), s = (f == null ? void 0 : f.url) ?? null, h = e.collection || null, { collections: d, loading: x } = Ge(s), { queryables: v, loading: u } = ma(s, h), c = v ? pi(v) : [], [w, N] = T([]), [C, E] = T([]);
|
|
2821
2822
|
return q(() => {
|
|
2822
|
-
if (!
|
|
2823
|
-
|
|
2823
|
+
if (!v) {
|
|
2824
|
+
N([]), E([]);
|
|
2824
2825
|
return;
|
|
2825
2826
|
}
|
|
2826
|
-
const
|
|
2827
|
-
var
|
|
2828
|
-
const P =
|
|
2829
|
-
|
|
2830
|
-
},
|
|
2831
|
-
if (
|
|
2832
|
-
const
|
|
2833
|
-
for (const M of
|
|
2834
|
-
M === "fill" ?
|
|
2835
|
-
|
|
2827
|
+
const o = (g, M) => {
|
|
2828
|
+
var b;
|
|
2829
|
+
const P = ni(g);
|
|
2830
|
+
N(P), E(M), P.length > 0 && !((b = m.current.styles) != null && b.length) && n.current({ ...m.current, styles: P });
|
|
2831
|
+
}, D = Xe(v);
|
|
2832
|
+
if (D.length > 0) {
|
|
2833
|
+
const g = [];
|
|
2834
|
+
for (const M of D)
|
|
2835
|
+
M === "fill" ? g.push("Polygon") : M === "line" ? g.push("LineString") : (M === "circle" || M === "symbol") && g.push("Point");
|
|
2836
|
+
o(g, D);
|
|
2836
2837
|
return;
|
|
2837
2838
|
}
|
|
2838
|
-
if (!s || !
|
|
2839
|
-
|
|
2839
|
+
if (!s || !h) {
|
|
2840
|
+
N([]), E([]);
|
|
2840
2841
|
return;
|
|
2841
2842
|
}
|
|
2842
2843
|
let F = !1;
|
|
2843
|
-
return ye(s,
|
|
2844
|
+
return ye(s, h, { limit: 20 }).then((g) => {
|
|
2844
2845
|
if (F) return;
|
|
2845
|
-
const M = Ze(
|
|
2846
|
+
const M = Ze(g.features);
|
|
2846
2847
|
if (M.length > 0) {
|
|
2847
2848
|
const P = /* @__PURE__ */ new Set();
|
|
2848
|
-
for (const
|
|
2849
|
-
for (const k of fe(
|
|
2850
|
-
|
|
2849
|
+
for (const b of M)
|
|
2850
|
+
for (const k of fe(b)) P.add(k);
|
|
2851
|
+
o(M, Array.from(P));
|
|
2851
2852
|
} else
|
|
2852
|
-
|
|
2853
|
+
N([]), E([]);
|
|
2853
2854
|
}).catch(() => {
|
|
2854
|
-
F || (
|
|
2855
|
+
F || (N([]), E([]));
|
|
2855
2856
|
}), () => {
|
|
2856
2857
|
F = !0;
|
|
2857
2858
|
};
|
|
2858
|
-
}, [
|
|
2859
|
-
|
|
2860
|
-
}, [s,
|
|
2859
|
+
}, [v, s, h]), q(() => {
|
|
2860
|
+
N([]), E([]);
|
|
2861
|
+
}, [s, h]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
2861
2862
|
/* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
|
|
2862
2863
|
/* @__PURE__ */ a(S, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
|
|
2863
2864
|
"input",
|
|
2864
2865
|
{
|
|
2865
2866
|
type: "text",
|
|
2866
2867
|
value: e.id,
|
|
2867
|
-
onChange: (
|
|
2868
|
+
onChange: (o) => p({ id: o.target.value }),
|
|
2868
2869
|
placeholder: "my-layer",
|
|
2869
2870
|
className: _
|
|
2870
2871
|
}
|
|
@@ -2874,7 +2875,7 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2874
2875
|
{
|
|
2875
2876
|
type: "text",
|
|
2876
2877
|
value: e.label,
|
|
2877
|
-
onChange: (
|
|
2878
|
+
onChange: (o) => p({ label: o.target.value }),
|
|
2878
2879
|
placeholder: "My Layer",
|
|
2879
2880
|
className: _
|
|
2880
2881
|
}
|
|
@@ -2884,11 +2885,11 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2884
2885
|
"select",
|
|
2885
2886
|
{
|
|
2886
2887
|
value: e.sourceId,
|
|
2887
|
-
onChange: (
|
|
2888
|
+
onChange: (o) => p({ sourceId: o.target.value }),
|
|
2888
2889
|
className: _,
|
|
2889
2890
|
children: [
|
|
2890
2891
|
/* @__PURE__ */ a("option", { value: "", children: "Select a source…" }),
|
|
2891
|
-
t.map((
|
|
2892
|
+
t.map((o) => /* @__PURE__ */ a("option", { value: o.id, children: o.label ?? o.id }, o.id))
|
|
2892
2893
|
]
|
|
2893
2894
|
}
|
|
2894
2895
|
) }),
|
|
@@ -2897,11 +2898,11 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2897
2898
|
"select",
|
|
2898
2899
|
{
|
|
2899
2900
|
value: e.collection,
|
|
2900
|
-
onChange: (
|
|
2901
|
+
onChange: (o) => p({ collection: o.target.value }),
|
|
2901
2902
|
className: _,
|
|
2902
2903
|
children: [
|
|
2903
2904
|
/* @__PURE__ */ a("option", { value: "", children: "Select a collection…" }),
|
|
2904
|
-
d.map((
|
|
2905
|
+
d.map((o) => /* @__PURE__ */ a("option", { value: o.id, children: o.title ?? o.id }, o.id))
|
|
2905
2906
|
]
|
|
2906
2907
|
}
|
|
2907
2908
|
) : /* @__PURE__ */ a(
|
|
@@ -2909,27 +2910,27 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2909
2910
|
{
|
|
2910
2911
|
type: "text",
|
|
2911
2912
|
value: e.collection,
|
|
2912
|
-
onChange: (
|
|
2913
|
-
placeholder:
|
|
2913
|
+
onChange: (o) => p({ collection: o.target.value }),
|
|
2914
|
+
placeholder: x ? "Loading collections…" : "collection-id",
|
|
2914
2915
|
className: _
|
|
2915
2916
|
}
|
|
2916
2917
|
),
|
|
2917
|
-
|
|
2918
|
+
u && /* @__PURE__ */ a("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
|
|
2918
2919
|
] }),
|
|
2919
|
-
/* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((
|
|
2920
|
+
/* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((o) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
|
|
2920
2921
|
/* @__PURE__ */ a(
|
|
2921
2922
|
"input",
|
|
2922
2923
|
{
|
|
2923
2924
|
type: "radio",
|
|
2924
2925
|
name: `data-mode-${e.id}`,
|
|
2925
|
-
value:
|
|
2926
|
-
checked: e.dataMode ===
|
|
2927
|
-
onChange: () => p({ dataMode:
|
|
2926
|
+
value: o,
|
|
2927
|
+
checked: e.dataMode === o,
|
|
2928
|
+
onChange: () => p({ dataMode: o }),
|
|
2928
2929
|
className: "mapui:accent-blue-600"
|
|
2929
2930
|
}
|
|
2930
2931
|
),
|
|
2931
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children:
|
|
2932
|
-
] },
|
|
2932
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: o })
|
|
2933
|
+
] }, o)) }) }),
|
|
2933
2934
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
2934
2935
|
/* @__PURE__ */ a(
|
|
2935
2936
|
"input",
|
|
@@ -2937,7 +2938,7 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2937
2938
|
type: "checkbox",
|
|
2938
2939
|
id: "layer-visible",
|
|
2939
2940
|
checked: e.visible,
|
|
2940
|
-
onChange: (
|
|
2941
|
+
onChange: (o) => p({ visible: o.target.checked }),
|
|
2941
2942
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2942
2943
|
}
|
|
2943
2944
|
),
|
|
@@ -2950,7 +2951,7 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2950
2951
|
type: "checkbox",
|
|
2951
2952
|
id: `layer-tooltip-${e.id}`,
|
|
2952
2953
|
checked: e.showTooltip ?? !0,
|
|
2953
|
-
onChange: (
|
|
2954
|
+
onChange: (o) => p({ showTooltip: o.target.checked }),
|
|
2954
2955
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2955
2956
|
}
|
|
2956
2957
|
),
|
|
@@ -2963,7 +2964,7 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2963
2964
|
type: "checkbox",
|
|
2964
2965
|
id: `layer-detail-${e.id}`,
|
|
2965
2966
|
checked: e.showDetailPanel ?? !0,
|
|
2966
|
-
onChange: (
|
|
2967
|
+
onChange: (o) => p({ showDetailPanel: o.target.checked }),
|
|
2967
2968
|
className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
|
|
2968
2969
|
}
|
|
2969
2970
|
),
|
|
@@ -2978,9 +2979,9 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2978
2979
|
max: 24,
|
|
2979
2980
|
step: 1,
|
|
2980
2981
|
value: e.minZoom ?? "",
|
|
2981
|
-
onChange: (
|
|
2982
|
-
const
|
|
2983
|
-
p({ minZoom: isNaN(
|
|
2982
|
+
onChange: (o) => {
|
|
2983
|
+
const D = o.target.valueAsNumber;
|
|
2984
|
+
p({ minZoom: isNaN(D) ? void 0 : D });
|
|
2984
2985
|
},
|
|
2985
2986
|
placeholder: "0",
|
|
2986
2987
|
className: _
|
|
@@ -2994,9 +2995,9 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
2994
2995
|
max: 24,
|
|
2995
2996
|
step: 1,
|
|
2996
2997
|
value: e.maxZoom ?? "",
|
|
2997
|
-
onChange: (
|
|
2998
|
-
const
|
|
2999
|
-
p({ maxZoom: isNaN(
|
|
2998
|
+
onChange: (o) => {
|
|
2999
|
+
const D = o.target.valueAsNumber;
|
|
3000
|
+
p({ maxZoom: isNaN(D) ? void 0 : D });
|
|
3000
3001
|
},
|
|
3001
3002
|
placeholder: "24",
|
|
3002
3003
|
className: _
|
|
@@ -3004,38 +3005,38 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
3004
3005
|
) })
|
|
3005
3006
|
] }),
|
|
3006
3007
|
/* @__PURE__ */ a(X, { title: "Style", children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-4", children: [
|
|
3007
|
-
(e.styles ?? [ge]).map((
|
|
3008
|
+
(e.styles ?? [ge]).map((o, D) => {
|
|
3008
3009
|
var F;
|
|
3009
3010
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
|
|
3010
|
-
|
|
3011
|
+
o.geometryFilter && o.geometryFilter.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-wrap mapui:gap-1", children: o.geometryFilter.map((g) => /* @__PURE__ */ a(
|
|
3011
3012
|
"span",
|
|
3012
3013
|
{
|
|
3013
3014
|
className: "mapui:rounded mapui:bg-indigo-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-indigo-700",
|
|
3014
|
-
children:
|
|
3015
|
+
children: g
|
|
3015
3016
|
},
|
|
3016
|
-
|
|
3017
|
+
g
|
|
3017
3018
|
)) }),
|
|
3018
3019
|
/* @__PURE__ */ a(
|
|
3019
|
-
|
|
3020
|
+
Ya,
|
|
3020
3021
|
{
|
|
3021
|
-
value:
|
|
3022
|
-
onChange: (
|
|
3022
|
+
value: o,
|
|
3023
|
+
onChange: (g) => p({ styles: ui(e.styles, D, g) }),
|
|
3023
3024
|
suggestedTypes: C,
|
|
3024
3025
|
availableIcons: r,
|
|
3025
|
-
availableProperties:
|
|
3026
|
-
onFetchDistinctValues: s &&
|
|
3026
|
+
availableProperties: c,
|
|
3027
|
+
onFetchDistinctValues: s && h ? (g) => sa(s, h, g, { fetchAll: !0 }) : void 0
|
|
3027
3028
|
}
|
|
3028
3029
|
),
|
|
3029
3030
|
(((F = e.styles) == null ? void 0 : F.length) ?? 0) > 0 && /* @__PURE__ */ a(
|
|
3030
3031
|
"button",
|
|
3031
3032
|
{
|
|
3032
3033
|
type: "button",
|
|
3033
|
-
onClick: () => p({ styles:
|
|
3034
|
+
onClick: () => p({ styles: oi(e.styles, D) }),
|
|
3034
3035
|
className: "mapui:cursor-pointer mapui:self-start mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
3035
3036
|
children: "Remove style"
|
|
3036
3037
|
}
|
|
3037
3038
|
)
|
|
3038
|
-
] },
|
|
3039
|
+
] }, D);
|
|
3039
3040
|
}),
|
|
3040
3041
|
/* @__PURE__ */ a(
|
|
3041
3042
|
"button",
|
|
@@ -3048,27 +3049,28 @@ function Oe({ value: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
|
3048
3049
|
)
|
|
3049
3050
|
] }) }),
|
|
3050
3051
|
/* @__PURE__ */ a(X, { title: "Legend", children: /* @__PURE__ */ a(
|
|
3051
|
-
|
|
3052
|
+
Za,
|
|
3052
3053
|
{
|
|
3053
3054
|
value: e.legend,
|
|
3054
|
-
onChange: (
|
|
3055
|
-
styles: e.styles
|
|
3055
|
+
onChange: (o) => p({ legend: o }),
|
|
3056
|
+
styles: e.styles,
|
|
3057
|
+
layerLabel: e.label
|
|
3056
3058
|
}
|
|
3057
3059
|
) }),
|
|
3058
3060
|
/* @__PURE__ */ a(X, { title: "Search Fields", children: /* @__PURE__ */ a(
|
|
3059
|
-
|
|
3061
|
+
ei,
|
|
3060
3062
|
{
|
|
3061
3063
|
fields: ((O = e.search) == null ? void 0 : O.fields) ?? [],
|
|
3062
|
-
onChange: (
|
|
3063
|
-
availableProperties:
|
|
3064
|
+
onChange: (o) => p({ search: o.length > 0 ? { fields: o } : void 0 }),
|
|
3065
|
+
availableProperties: c
|
|
3064
3066
|
}
|
|
3065
3067
|
) }),
|
|
3066
3068
|
/* @__PURE__ */ a(X, { title: "Property Display", children: /* @__PURE__ */ a(
|
|
3067
|
-
|
|
3069
|
+
ti,
|
|
3068
3070
|
{
|
|
3069
3071
|
value: e.propertyDisplay ?? {},
|
|
3070
|
-
onChange: (
|
|
3071
|
-
availableProperties:
|
|
3072
|
+
onChange: (o) => p({ propertyDisplay: Object.keys(o).length > 0 ? o : void 0 }),
|
|
3073
|
+
availableProperties: c
|
|
3072
3074
|
}
|
|
3073
3075
|
) })
|
|
3074
3076
|
] });
|
|
@@ -3081,37 +3083,37 @@ const ce = () => ({
|
|
|
3081
3083
|
visible: !0,
|
|
3082
3084
|
dataMode: "vector-tiles"
|
|
3083
3085
|
});
|
|
3084
|
-
function
|
|
3085
|
-
const [p,
|
|
3086
|
-
i([...e, s]),
|
|
3087
|
-
}, C = (
|
|
3088
|
-
i(e.map((k) => k.id === p ?
|
|
3089
|
-
}, E = (
|
|
3090
|
-
i(e.filter((k) => k.id !==
|
|
3091
|
-
}, O = (
|
|
3092
|
-
if (
|
|
3086
|
+
function Ai({ layers: e, onChange: i, availableSources: t, availableIcons: r }) {
|
|
3087
|
+
const [p, m] = T(null), [n, f] = T(!1), [s, h] = T(ce()), [d, x] = T(null), [v, u] = T(null), [c, w] = T(null), N = () => {
|
|
3088
|
+
i([...e, s]), f(!1), h(ce());
|
|
3089
|
+
}, C = (b) => {
|
|
3090
|
+
i(e.map((k) => k.id === p ? b : k));
|
|
3091
|
+
}, E = (b) => {
|
|
3092
|
+
i(e.filter((k) => k.id !== b)), x(null), p === b && m(null);
|
|
3093
|
+
}, O = (b) => {
|
|
3094
|
+
if (b === 0) return;
|
|
3093
3095
|
const k = [...e];
|
|
3094
|
-
[k[
|
|
3095
|
-
},
|
|
3096
|
-
if (
|
|
3096
|
+
[k[b - 1], k[b]] = [k[b], k[b - 1]], i(k);
|
|
3097
|
+
}, o = (b) => {
|
|
3098
|
+
if (b === e.length - 1) return;
|
|
3097
3099
|
const k = [...e];
|
|
3098
|
-
[k[
|
|
3099
|
-
},
|
|
3100
|
-
|
|
3101
|
-
}, F = (
|
|
3102
|
-
|
|
3103
|
-
},
|
|
3104
|
-
|
|
3105
|
-
}, M = (
|
|
3106
|
-
|
|
3107
|
-
const j =
|
|
3108
|
-
if (
|
|
3100
|
+
[k[b], k[b + 1]] = [k[b + 1], k[b]], i(k);
|
|
3101
|
+
}, D = (b, k) => {
|
|
3102
|
+
u(k), b.dataTransfer.effectAllowed = "move", b.dataTransfer.setData("text/plain", k);
|
|
3103
|
+
}, F = (b, k) => {
|
|
3104
|
+
b.preventDefault(), b.dataTransfer.dropEffect = "move", w(k);
|
|
3105
|
+
}, g = () => {
|
|
3106
|
+
w(null);
|
|
3107
|
+
}, M = (b, k) => {
|
|
3108
|
+
b.preventDefault(), w(null);
|
|
3109
|
+
const j = v;
|
|
3110
|
+
if (u(null), !j || j === k) return;
|
|
3109
3111
|
const R = e.findIndex((G) => G.id === j), W = e.findIndex((G) => G.id === k);
|
|
3110
3112
|
if (R === -1 || W === -1) return;
|
|
3111
3113
|
const U = [...e];
|
|
3112
3114
|
U.splice(R, 1), U.splice(W, 0, e[R]), i(U);
|
|
3113
3115
|
}, P = () => {
|
|
3114
|
-
|
|
3116
|
+
u(null), w(null);
|
|
3115
3117
|
};
|
|
3116
3118
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3117
3119
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -3121,7 +3123,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3121
3123
|
{
|
|
3122
3124
|
type: "button",
|
|
3123
3125
|
onClick: () => {
|
|
3124
|
-
|
|
3126
|
+
f(!0), h(ce());
|
|
3125
3127
|
},
|
|
3126
3128
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
3127
3129
|
children: "+ Add Layer"
|
|
@@ -3129,17 +3131,17 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3129
3131
|
)
|
|
3130
3132
|
] }),
|
|
3131
3133
|
e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
|
|
3132
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
3134
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((b, k) => {
|
|
3133
3135
|
var U, G, J, K, Q;
|
|
3134
|
-
const j =
|
|
3136
|
+
const j = v === b.id, R = c === b.id, W = p === b.id;
|
|
3135
3137
|
return /* @__PURE__ */ l(
|
|
3136
3138
|
"li",
|
|
3137
3139
|
{
|
|
3138
3140
|
draggable: !W,
|
|
3139
|
-
onDragStart: W ? void 0 : (
|
|
3140
|
-
onDragOver: (
|
|
3141
|
-
onDragLeave:
|
|
3142
|
-
onDrop: (
|
|
3141
|
+
onDragStart: W ? void 0 : (y) => D(y, b.id),
|
|
3142
|
+
onDragOver: (y) => F(y, b.id),
|
|
3143
|
+
onDragLeave: g,
|
|
3144
|
+
onDrop: (y) => M(y, b.id),
|
|
3143
3145
|
onDragEnd: P,
|
|
3144
3146
|
className: [
|
|
3145
3147
|
"mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
|
|
@@ -3165,7 +3167,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3165
3167
|
"button",
|
|
3166
3168
|
{
|
|
3167
3169
|
type: "button",
|
|
3168
|
-
onClick: () =>
|
|
3170
|
+
onClick: () => o(k),
|
|
3169
3171
|
disabled: k === e.length - 1,
|
|
3170
3172
|
"aria-label": "Move layer down",
|
|
3171
3173
|
className: "mapui:cursor-pointer mapui:rounded mapui:border-none mapui:bg-transparent mapui:px-1 mapui:text-xs mapui:text-gray-400 hover:mapui:text-gray-600 disabled:mapui:opacity-30",
|
|
@@ -3182,24 +3184,24 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3182
3184
|
}
|
|
3183
3185
|
),
|
|
3184
3186
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
|
|
3185
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3186
|
-
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3187
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: b.label || b.id }),
|
|
3188
|
+
/* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: b.collection }),
|
|
3187
3189
|
/* @__PURE__ */ l("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
|
|
3188
|
-
/* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children:
|
|
3189
|
-
(((U =
|
|
3190
|
-
|
|
3191
|
-
(((J = (G =
|
|
3192
|
-
|
|
3190
|
+
/* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-slate-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-slate-700", children: b.dataMode }),
|
|
3191
|
+
(((U = b.styles) == null ? void 0 : U.length) ?? 0) > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-purple-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-purple-700", children: b.styles.map((y) => y.type).join(" · ") }),
|
|
3192
|
+
b.visible === !1 && /* @__PURE__ */ a("span", { className: "mapui:rounded mapui:bg-amber-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-amber-700", children: "hidden" }),
|
|
3193
|
+
(((J = (G = b.search) == null ? void 0 : G.fields) == null ? void 0 : J.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-blue-700", children: [
|
|
3194
|
+
b.search.fields.length,
|
|
3193
3195
|
" search fields"
|
|
3194
3196
|
] }),
|
|
3195
|
-
(
|
|
3197
|
+
(b.minZoom != null || b.maxZoom != null) && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-cyan-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-cyan-700", children: [
|
|
3196
3198
|
"z",
|
|
3197
|
-
|
|
3199
|
+
b.minZoom ?? 0,
|
|
3198
3200
|
"–",
|
|
3199
|
-
|
|
3201
|
+
b.maxZoom ?? 24
|
|
3200
3202
|
] }),
|
|
3201
|
-
(((Q = (K =
|
|
3202
|
-
|
|
3203
|
+
(((Q = (K = b.legend) == null ? void 0 : K.entries) == null ? void 0 : Q.length) ?? 0) > 0 && /* @__PURE__ */ l("span", { className: "mapui:rounded mapui:bg-green-100 mapui:px-1.5 mapui:py-0.5 mapui:text-[10px] mapui:font-medium mapui:text-green-700", children: [
|
|
3204
|
+
b.legend.entries.length,
|
|
3203
3205
|
" legend entries"
|
|
3204
3206
|
] })
|
|
3205
3207
|
] })
|
|
@@ -3210,26 +3212,26 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3210
3212
|
"button",
|
|
3211
3213
|
{
|
|
3212
3214
|
type: "button",
|
|
3213
|
-
onClick: () =>
|
|
3215
|
+
onClick: () => m(p === b.id ? null : b.id),
|
|
3214
3216
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
3215
|
-
children: p ===
|
|
3217
|
+
children: p === b.id ? "Close" : "Edit"
|
|
3216
3218
|
}
|
|
3217
3219
|
),
|
|
3218
3220
|
/* @__PURE__ */ a(
|
|
3219
3221
|
"button",
|
|
3220
3222
|
{
|
|
3221
3223
|
type: "button",
|
|
3222
|
-
onClick: () =>
|
|
3224
|
+
onClick: () => x(b.id),
|
|
3223
3225
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
3224
3226
|
children: "Remove"
|
|
3225
3227
|
}
|
|
3226
3228
|
)
|
|
3227
3229
|
] })
|
|
3228
3230
|
] }),
|
|
3229
|
-
p ===
|
|
3231
|
+
p === b.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
|
|
3230
3232
|
Oe,
|
|
3231
3233
|
{
|
|
3232
|
-
value:
|
|
3234
|
+
value: b,
|
|
3233
3235
|
onChange: C,
|
|
3234
3236
|
availableSources: t,
|
|
3235
3237
|
availableIcons: r
|
|
@@ -3237,7 +3239,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3237
3239
|
) })
|
|
3238
3240
|
]
|
|
3239
3241
|
},
|
|
3240
|
-
|
|
3242
|
+
b.id
|
|
3241
3243
|
);
|
|
3242
3244
|
}) }),
|
|
3243
3245
|
n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
@@ -3246,7 +3248,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3246
3248
|
Oe,
|
|
3247
3249
|
{
|
|
3248
3250
|
value: s,
|
|
3249
|
-
onChange:
|
|
3251
|
+
onChange: h,
|
|
3250
3252
|
availableSources: t,
|
|
3251
3253
|
availableIcons: r
|
|
3252
3254
|
}
|
|
@@ -3256,7 +3258,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3256
3258
|
"button",
|
|
3257
3259
|
{
|
|
3258
3260
|
type: "button",
|
|
3259
|
-
onClick:
|
|
3261
|
+
onClick: N,
|
|
3260
3262
|
disabled: !s.id || !s.sourceId || !s.collection,
|
|
3261
3263
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
3262
3264
|
children: "Save"
|
|
@@ -3266,7 +3268,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3266
3268
|
"button",
|
|
3267
3269
|
{
|
|
3268
3270
|
type: "button",
|
|
3269
|
-
onClick: () =>
|
|
3271
|
+
onClick: () => f(!1),
|
|
3270
3272
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
3271
3273
|
children: "Cancel"
|
|
3272
3274
|
}
|
|
@@ -3280,7 +3282,7 @@ function Li({ layers: e, onChange: i, availableSources: t, availableIcons: r })
|
|
|
3280
3282
|
title: "Remove Layer",
|
|
3281
3283
|
description: "Are you sure you want to remove this layer from the configuration?",
|
|
3282
3284
|
onConfirm: () => d && E(d),
|
|
3283
|
-
onCancel: () =>
|
|
3285
|
+
onCancel: () => x(null)
|
|
3284
3286
|
}
|
|
3285
3287
|
)
|
|
3286
3288
|
] });
|
|
@@ -3342,13 +3344,13 @@ function je({ value: e, onChange: i }) {
|
|
|
3342
3344
|
] });
|
|
3343
3345
|
}
|
|
3344
3346
|
const de = () => ({ id: "", label: "", url: "" });
|
|
3345
|
-
function
|
|
3346
|
-
const [t, r] = T(null), [p,
|
|
3347
|
-
i(e.map((
|
|
3348
|
-
},
|
|
3349
|
-
i([...e, n]),
|
|
3350
|
-
},
|
|
3351
|
-
i(e.filter((
|
|
3347
|
+
function Ei({ basemaps: e, onChange: i }) {
|
|
3348
|
+
const [t, r] = T(null), [p, m] = T(!1), [n, f] = T(de()), [s, h] = T(null), d = (u) => {
|
|
3349
|
+
i(e.map((c) => c.id === t ? u : c));
|
|
3350
|
+
}, x = () => {
|
|
3351
|
+
i([...e, n]), m(!1), f(de());
|
|
3352
|
+
}, v = (u) => {
|
|
3353
|
+
i(e.filter((c) => c.id !== u)), h(null);
|
|
3352
3354
|
};
|
|
3353
3355
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3354
3356
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -3358,7 +3360,7 @@ function Ai({ basemaps: e, onChange: i }) {
|
|
|
3358
3360
|
{
|
|
3359
3361
|
type: "button",
|
|
3360
3362
|
onClick: () => {
|
|
3361
|
-
|
|
3363
|
+
m(!0), f(de());
|
|
3362
3364
|
},
|
|
3363
3365
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
3364
3366
|
children: "+ Add Basemap"
|
|
@@ -3366,59 +3368,59 @@ function Ai({ basemaps: e, onChange: i }) {
|
|
|
3366
3368
|
)
|
|
3367
3369
|
] }),
|
|
3368
3370
|
e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No basemaps configured." }),
|
|
3369
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
3371
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((u) => /* @__PURE__ */ l(
|
|
3370
3372
|
"li",
|
|
3371
3373
|
{
|
|
3372
3374
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
|
|
3373
3375
|
children: [
|
|
3374
3376
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
|
|
3375
|
-
|
|
3377
|
+
u.thumbnail && /* @__PURE__ */ a(
|
|
3376
3378
|
"img",
|
|
3377
3379
|
{
|
|
3378
|
-
src:
|
|
3380
|
+
src: u.thumbnail,
|
|
3379
3381
|
alt: "",
|
|
3380
3382
|
className: "mapui:h-10 mapui:w-14 mapui:shrink-0 mapui:rounded mapui:object-cover"
|
|
3381
3383
|
}
|
|
3382
3384
|
),
|
|
3383
3385
|
/* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
|
|
3384
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3385
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3386
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: u.label || u.id }),
|
|
3387
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: u.url })
|
|
3386
3388
|
] }),
|
|
3387
3389
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
|
|
3388
3390
|
/* @__PURE__ */ a(
|
|
3389
3391
|
"button",
|
|
3390
3392
|
{
|
|
3391
3393
|
type: "button",
|
|
3392
|
-
onClick: () => r(t ===
|
|
3394
|
+
onClick: () => r(t === u.id ? null : u.id),
|
|
3393
3395
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
3394
|
-
children: t ===
|
|
3396
|
+
children: t === u.id ? "Close" : "Edit"
|
|
3395
3397
|
}
|
|
3396
3398
|
),
|
|
3397
3399
|
/* @__PURE__ */ a(
|
|
3398
3400
|
"button",
|
|
3399
3401
|
{
|
|
3400
3402
|
type: "button",
|
|
3401
|
-
onClick: () =>
|
|
3403
|
+
onClick: () => h(u.id),
|
|
3402
3404
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
3403
3405
|
children: "Remove"
|
|
3404
3406
|
}
|
|
3405
3407
|
)
|
|
3406
3408
|
] })
|
|
3407
3409
|
] }),
|
|
3408
|
-
t ===
|
|
3410
|
+
t === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(je, { value: u, onChange: d }) })
|
|
3409
3411
|
]
|
|
3410
3412
|
},
|
|
3411
|
-
|
|
3413
|
+
u.id
|
|
3412
3414
|
)) }),
|
|
3413
3415
|
p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
3414
3416
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
|
|
3415
|
-
/* @__PURE__ */ a(je, { value: n, onChange:
|
|
3417
|
+
/* @__PURE__ */ a(je, { value: n, onChange: f }),
|
|
3416
3418
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
3417
3419
|
/* @__PURE__ */ a(
|
|
3418
3420
|
"button",
|
|
3419
3421
|
{
|
|
3420
3422
|
type: "button",
|
|
3421
|
-
onClick:
|
|
3423
|
+
onClick: x,
|
|
3422
3424
|
disabled: !n.id || !n.url,
|
|
3423
3425
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
3424
3426
|
children: "Save"
|
|
@@ -3428,7 +3430,7 @@ function Ai({ basemaps: e, onChange: i }) {
|
|
|
3428
3430
|
"button",
|
|
3429
3431
|
{
|
|
3430
3432
|
type: "button",
|
|
3431
|
-
onClick: () =>
|
|
3433
|
+
onClick: () => m(!1),
|
|
3432
3434
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
3433
3435
|
children: "Cancel"
|
|
3434
3436
|
}
|
|
@@ -3441,8 +3443,8 @@ function Ai({ basemaps: e, onChange: i }) {
|
|
|
3441
3443
|
open: s !== null,
|
|
3442
3444
|
title: "Remove Basemap",
|
|
3443
3445
|
description: "Are you sure you want to remove this basemap from the configuration?",
|
|
3444
|
-
onConfirm: () => s &&
|
|
3445
|
-
onCancel: () =>
|
|
3446
|
+
onConfirm: () => s && v(s),
|
|
3447
|
+
onCancel: () => h(null)
|
|
3446
3448
|
}
|
|
3447
3449
|
)
|
|
3448
3450
|
] });
|
|
@@ -3482,21 +3484,21 @@ function Re({ value: e, onChange: i }) {
|
|
|
3482
3484
|
] })
|
|
3483
3485
|
] });
|
|
3484
3486
|
}
|
|
3485
|
-
const he = () => ({ id: "", url: "" }),
|
|
3487
|
+
const he = () => ({ id: "", url: "" }), mi = (e) => {
|
|
3486
3488
|
try {
|
|
3487
3489
|
return new URL(e), !0;
|
|
3488
3490
|
} catch {
|
|
3489
3491
|
return !1;
|
|
3490
3492
|
}
|
|
3491
3493
|
};
|
|
3492
|
-
function
|
|
3493
|
-
const [t, r] = T(null), [p,
|
|
3494
|
-
i(e.map((
|
|
3495
|
-
},
|
|
3496
|
-
i([...e, n]),
|
|
3497
|
-
},
|
|
3498
|
-
const
|
|
3499
|
-
i(e.filter((
|
|
3494
|
+
function Ii({ sprites: e, onChange: i }) {
|
|
3495
|
+
const [t, r] = T(null), [p, m] = T(!1), [n, f] = T(he()), [s, h] = T(null), d = (u) => {
|
|
3496
|
+
i(e.map((c, w) => w === t ? u : c));
|
|
3497
|
+
}, x = () => {
|
|
3498
|
+
i([...e, n]), m(!1), f(he());
|
|
3499
|
+
}, v = (u) => {
|
|
3500
|
+
const c = e.findIndex((w) => w.id === u);
|
|
3501
|
+
i(e.filter((w) => w.id !== u)), t !== null && (c === t ? r(null) : c < t && r(t - 1)), h(null);
|
|
3500
3502
|
};
|
|
3501
3503
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3502
3504
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
|
|
@@ -3506,7 +3508,7 @@ function Ei({ sprites: e, onChange: i }) {
|
|
|
3506
3508
|
{
|
|
3507
3509
|
type: "button",
|
|
3508
3510
|
onClick: () => {
|
|
3509
|
-
|
|
3511
|
+
m(!0), f(he());
|
|
3510
3512
|
},
|
|
3511
3513
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700",
|
|
3512
3514
|
children: "+ Add Sprite Sheet"
|
|
@@ -3514,52 +3516,52 @@ function Ei({ sprites: e, onChange: i }) {
|
|
|
3514
3516
|
)
|
|
3515
3517
|
] }),
|
|
3516
3518
|
e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No custom sprite sheets. Basemap icons are available automatically." }),
|
|
3517
|
-
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((
|
|
3519
|
+
/* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((u, c) => /* @__PURE__ */ l(
|
|
3518
3520
|
"li",
|
|
3519
3521
|
{
|
|
3520
3522
|
className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
|
|
3521
3523
|
children: [
|
|
3522
3524
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
|
|
3523
3525
|
/* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
|
|
3524
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children:
|
|
3525
|
-
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children:
|
|
3526
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: u.id }),
|
|
3527
|
+
/* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: u.url })
|
|
3526
3528
|
] }),
|
|
3527
3529
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
|
|
3528
3530
|
/* @__PURE__ */ a(
|
|
3529
3531
|
"button",
|
|
3530
3532
|
{
|
|
3531
3533
|
type: "button",
|
|
3532
|
-
onClick: () => r(t ===
|
|
3534
|
+
onClick: () => r(t === c ? null : c),
|
|
3533
3535
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-gray-600 hover:mapui:bg-gray-50",
|
|
3534
|
-
children: t ===
|
|
3536
|
+
children: t === c ? "Close" : "Edit"
|
|
3535
3537
|
}
|
|
3536
3538
|
),
|
|
3537
3539
|
/* @__PURE__ */ a(
|
|
3538
3540
|
"button",
|
|
3539
3541
|
{
|
|
3540
3542
|
type: "button",
|
|
3541
|
-
onClick: () =>
|
|
3543
|
+
onClick: () => h(u.id),
|
|
3542
3544
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-red-200 mapui:bg-white mapui:px-2 mapui:py-1 mapui:text-xs mapui:text-red-600 hover:mapui:bg-red-50",
|
|
3543
3545
|
children: "Remove"
|
|
3544
3546
|
}
|
|
3545
3547
|
)
|
|
3546
3548
|
] })
|
|
3547
3549
|
] }),
|
|
3548
|
-
t ===
|
|
3550
|
+
t === c && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Re, { value: u, onChange: d }) })
|
|
3549
3551
|
]
|
|
3550
3552
|
},
|
|
3551
|
-
|
|
3553
|
+
c
|
|
3552
3554
|
)) }),
|
|
3553
3555
|
p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
|
|
3554
3556
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
|
|
3555
|
-
/* @__PURE__ */ a(Re, { value: n, onChange:
|
|
3557
|
+
/* @__PURE__ */ a(Re, { value: n, onChange: f }),
|
|
3556
3558
|
/* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
|
|
3557
3559
|
/* @__PURE__ */ a(
|
|
3558
3560
|
"button",
|
|
3559
3561
|
{
|
|
3560
3562
|
type: "button",
|
|
3561
|
-
onClick:
|
|
3562
|
-
disabled: !n.id || !n.url || !
|
|
3563
|
+
onClick: x,
|
|
3564
|
+
disabled: !n.id || !n.url || !mi(n.url) || e.some((u) => u.id === n.id),
|
|
3563
3565
|
className: "mapui:cursor-pointer mapui:rounded mapui:bg-blue-600 mapui:px-3 mapui:py-1 mapui:text-xs mapui:font-medium mapui:text-white hover:mapui:bg-blue-700 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
|
|
3564
3566
|
children: "Save"
|
|
3565
3567
|
}
|
|
@@ -3568,7 +3570,7 @@ function Ei({ sprites: e, onChange: i }) {
|
|
|
3568
3570
|
"button",
|
|
3569
3571
|
{
|
|
3570
3572
|
type: "button",
|
|
3571
|
-
onClick: () =>
|
|
3573
|
+
onClick: () => m(!1),
|
|
3572
3574
|
className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-xs mapui:text-gray-700 hover:mapui:bg-gray-50",
|
|
3573
3575
|
children: "Cancel"
|
|
3574
3576
|
}
|
|
@@ -3581,13 +3583,13 @@ function Ei({ sprites: e, onChange: i }) {
|
|
|
3581
3583
|
open: s !== null,
|
|
3582
3584
|
title: "Remove Sprite Sheet",
|
|
3583
3585
|
description: "Are you sure you want to remove this sprite sheet from the configuration?",
|
|
3584
|
-
onConfirm: () => s &&
|
|
3585
|
-
onCancel: () =>
|
|
3586
|
+
onConfirm: () => s && v(s),
|
|
3587
|
+
onCancel: () => h(null)
|
|
3586
3588
|
}
|
|
3587
3589
|
)
|
|
3588
3590
|
] });
|
|
3589
3591
|
}
|
|
3590
|
-
const
|
|
3592
|
+
const si = [
|
|
3591
3593
|
{ key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
|
|
3592
3594
|
{ key: "showLegend", label: "Legend", description: "Map legend" },
|
|
3593
3595
|
{ key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
|
|
@@ -3600,13 +3602,13 @@ const mi = [
|
|
|
3600
3602
|
{ key: "showMeasureTool", label: "Measure Tool", description: "Measure distances and areas on the map" },
|
|
3601
3603
|
{ key: "showSelectionTool", label: "Selection Tool", description: "Select features by click or box draw" }
|
|
3602
3604
|
];
|
|
3603
|
-
function
|
|
3605
|
+
function Mi({ value: e, onChange: i }) {
|
|
3604
3606
|
const t = (r, p) => {
|
|
3605
3607
|
i({ ...e, [r]: p });
|
|
3606
3608
|
};
|
|
3607
3609
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
|
|
3608
3610
|
/* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-2 mapui:text-xs mapui:text-gray-500", children: "Enable or disable UI panels and controls." }),
|
|
3609
|
-
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children:
|
|
3611
|
+
/* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: si.map(({ key: r, label: p, description: m }) => {
|
|
3610
3612
|
const n = e[r];
|
|
3611
3613
|
return /* @__PURE__ */ l(
|
|
3612
3614
|
"label",
|
|
@@ -3615,7 +3617,7 @@ function Ii({ value: e, onChange: i }) {
|
|
|
3615
3617
|
children: [
|
|
3616
3618
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
|
|
3617
3619
|
/* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: p }),
|
|
3618
|
-
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children:
|
|
3620
|
+
/* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: m })
|
|
3619
3621
|
] }),
|
|
3620
3622
|
/* @__PURE__ */ l("div", { className: "mapui:relative mapui:flex mapui:shrink-0 mapui:items-center", children: [
|
|
3621
3623
|
/* @__PURE__ */ a(
|
|
@@ -3623,7 +3625,7 @@ function Ii({ value: e, onChange: i }) {
|
|
|
3623
3625
|
{
|
|
3624
3626
|
type: "checkbox",
|
|
3625
3627
|
checked: n,
|
|
3626
|
-
onChange: (
|
|
3628
|
+
onChange: (f) => t(r, f.target.checked),
|
|
3627
3629
|
className: "mapui:sr-only",
|
|
3628
3630
|
"aria-label": p
|
|
3629
3631
|
}
|
|
@@ -3661,7 +3663,7 @@ const Je = [
|
|
|
3661
3663
|
{ key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
|
|
3662
3664
|
{ key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
|
|
3663
3665
|
];
|
|
3664
|
-
function
|
|
3666
|
+
function ci(e, i) {
|
|
3665
3667
|
const t = Je.find((r) => r.key === e);
|
|
3666
3668
|
if (t) {
|
|
3667
3669
|
if (isNaN(i)) return "Must be a number";
|
|
@@ -3669,31 +3671,31 @@ function si(e, i) {
|
|
|
3669
3671
|
if (i > t.max) return `Must be at most ${t.max}`;
|
|
3670
3672
|
}
|
|
3671
3673
|
}
|
|
3672
|
-
const
|
|
3673
|
-
function
|
|
3674
|
+
const di = "mapui:rounded mapui:border mapui:border-gray-300 mapui:px-2 mapui:py-1 mapui:text-sm mapui:outline-none focus:mapui:border-blue-500 focus:mapui:ring-1 focus:mapui:ring-blue-500";
|
|
3675
|
+
function Fi({ value: e, onChange: i }) {
|
|
3674
3676
|
const t = (r, p) => {
|
|
3675
|
-
const
|
|
3676
|
-
i({ ...e, [r]: isNaN(
|
|
3677
|
+
const m = parseFloat(p);
|
|
3678
|
+
i({ ...e, [r]: isNaN(m) ? 0 : m });
|
|
3677
3679
|
};
|
|
3678
|
-
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Je.map(({ key: r, label: p, min:
|
|
3679
|
-
const
|
|
3680
|
-
return /* @__PURE__ */ a(S, { label: p, error:
|
|
3680
|
+
return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Je.map(({ key: r, label: p, min: m, max: n, step: f, placeholder: s }) => {
|
|
3681
|
+
const h = ci(r, e[r]);
|
|
3682
|
+
return /* @__PURE__ */ a(S, { label: p, error: h, children: /* @__PURE__ */ a(
|
|
3681
3683
|
"input",
|
|
3682
3684
|
{
|
|
3683
3685
|
type: "number",
|
|
3684
|
-
min:
|
|
3686
|
+
min: m,
|
|
3685
3687
|
max: n,
|
|
3686
|
-
step:
|
|
3688
|
+
step: f,
|
|
3687
3689
|
value: e[r],
|
|
3688
3690
|
placeholder: s,
|
|
3689
3691
|
onChange: (d) => t(r, d.target.value),
|
|
3690
|
-
className: `${
|
|
3692
|
+
className: `${di} ${h ? "mapui:border-red-400" : ""}`
|
|
3691
3693
|
}
|
|
3692
3694
|
) }, r);
|
|
3693
3695
|
}) });
|
|
3694
3696
|
}
|
|
3695
|
-
function
|
|
3696
|
-
const i =
|
|
3697
|
+
function Pi({ config: e }) {
|
|
3698
|
+
const i = ca(e);
|
|
3697
3699
|
return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
|
|
3698
3700
|
/* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
|
|
3699
3701
|
/* @__PURE__ */ a(
|
|
@@ -3718,188 +3720,188 @@ function Fi({ config: e }) {
|
|
|
3718
3720
|
/* @__PURE__ */ a("div", { className: "mapui:overflow-auto mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-gray-50", children: /* @__PURE__ */ a("pre", { className: "mapui:m-0 mapui:p-3 mapui:text-xs mapui:text-gray-800 mapui:whitespace-pre", children: JSON.stringify(e, null, 2) }) })
|
|
3719
3721
|
] });
|
|
3720
3722
|
}
|
|
3721
|
-
function
|
|
3722
|
-
const [t, r] = e, [p,
|
|
3723
|
+
function hi(e, i) {
|
|
3724
|
+
const [t, r] = e, [p, m] = i;
|
|
3723
3725
|
return {
|
|
3724
3726
|
type: "Polygon",
|
|
3725
3727
|
coordinates: [[
|
|
3726
3728
|
[t, r],
|
|
3727
3729
|
[p, r],
|
|
3728
|
-
[p,
|
|
3729
|
-
[t,
|
|
3730
|
+
[p, m],
|
|
3731
|
+
[t, m],
|
|
3730
3732
|
[t, r]
|
|
3731
3733
|
]]
|
|
3732
3734
|
};
|
|
3733
3735
|
}
|
|
3734
|
-
function
|
|
3736
|
+
function Oi(e, i) {
|
|
3735
3737
|
return {
|
|
3736
3738
|
type: "Feature",
|
|
3737
3739
|
properties: {},
|
|
3738
|
-
geometry:
|
|
3740
|
+
geometry: hi(e, i)
|
|
3739
3741
|
};
|
|
3740
3742
|
}
|
|
3741
3743
|
export {
|
|
3742
|
-
|
|
3744
|
+
nr as BasemapConfigSchema,
|
|
3743
3745
|
je as BasemapEditor,
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3746
|
+
Ei as BasemapList,
|
|
3747
|
+
Ri as BasemapSwitcher,
|
|
3748
|
+
ur as BrandingConfigSchema,
|
|
3749
|
+
or as CircleLayoutSchema,
|
|
3750
|
+
mr as CirclePaintSchema,
|
|
3751
|
+
sr as CircleStyleSchema,
|
|
3752
|
+
zi as CollapsibleControl,
|
|
3751
3753
|
X as CollapsibleSection,
|
|
3752
|
-
|
|
3754
|
+
Si as CollectionBrowser,
|
|
3753
3755
|
Z as ColorPicker,
|
|
3754
|
-
|
|
3756
|
+
Pi as ConfigPreview,
|
|
3755
3757
|
re as ConfirmDialog,
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3758
|
+
Gi as CoordinateDisplay,
|
|
3759
|
+
cr as DEFAULT_HEADER_COLOR,
|
|
3760
|
+
dr as DatetimeSearchFieldSchema,
|
|
3761
|
+
Vi as ExportButton,
|
|
3762
|
+
wi as ExportModal,
|
|
3763
|
+
Yi as FeatureDetailPanel,
|
|
3764
|
+
Zi as FeatureTooltip,
|
|
3765
|
+
hr as FillLayoutSchema,
|
|
3766
|
+
gr as FillPaintSchema,
|
|
3767
|
+
br as FillStyleSchema,
|
|
3768
|
+
yr as FilterConfigSchema,
|
|
3767
3769
|
S as FormField,
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
+
fr as GeometryTypeSchema,
|
|
3771
|
+
xr as LayerConfigSchema,
|
|
3770
3772
|
Oe as LayerEditor,
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3773
|
+
Ai as LayerList,
|
|
3774
|
+
Ki as LayerPanel,
|
|
3775
|
+
et as Legend,
|
|
3776
|
+
wr as LegendConfigSchema,
|
|
3777
|
+
Za as LegendEditor,
|
|
3778
|
+
Xa as LegendEntryEditor,
|
|
3779
|
+
Nr as LegendEntrySchema,
|
|
3780
|
+
vr as LineLayoutSchema,
|
|
3781
|
+
kr as LinePaintSchema,
|
|
3782
|
+
Cr as LineStyleSchema,
|
|
3783
|
+
Sr as MapConfigSchema,
|
|
3784
|
+
Ni as MeasurePanel,
|
|
3785
|
+
Tr as NumberSearchFieldSchema,
|
|
3786
|
+
Dr as OgcApiSourceSchema,
|
|
3787
|
+
Lr as PropertyDisplayConfigSchema,
|
|
3788
|
+
ti as PropertyDisplayEditor,
|
|
3789
|
+
Ar as PropertyDisplaySchema,
|
|
3790
|
+
ki as ResultsDrawer,
|
|
3791
|
+
Er as SearchConfigSchema,
|
|
3792
|
+
Ka as SearchFieldEditor,
|
|
3793
|
+
ei as SearchFieldList,
|
|
3794
|
+
Ir as SearchFieldSchema,
|
|
3795
|
+
lr as SearchPanel,
|
|
3796
|
+
Mr as SelectSearchFieldSchema,
|
|
3797
|
+
vi as SelectionPanel,
|
|
3796
3798
|
we as SourceEditor,
|
|
3797
|
-
|
|
3799
|
+
Ci as SourceList,
|
|
3798
3800
|
Re as SpriteSourceEditor,
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3801
|
+
Ii as SpriteSourceList,
|
|
3802
|
+
Fr as SpriteSourceSchema,
|
|
3803
|
+
Pr as StyleConfigSchema,
|
|
3804
|
+
Ya as StyleEditor,
|
|
3805
|
+
Or as SymbolLayoutSchema,
|
|
3806
|
+
jr as SymbolPaintSchema,
|
|
3807
|
+
$r as SymbolStyleSchema,
|
|
3808
|
+
Rr as TextSearchFieldSchema,
|
|
3809
|
+
Mi as UIConfigEditor,
|
|
3810
|
+
Br as UIConfigSchema,
|
|
3811
|
+
ua as UNITS_FOR_MODE,
|
|
3810
3812
|
xe as UNIT_LABELS,
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3813
|
+
zr as ViewConfigSchema,
|
|
3814
|
+
Fi as ViewEditor,
|
|
3815
|
+
it as and,
|
|
3816
|
+
tt as bboxFromGeometry,
|
|
3817
|
+
rt as between,
|
|
3818
|
+
Oi as buildBoxDrawData,
|
|
3819
|
+
hi as buildBoxPolygon,
|
|
3820
|
+
ni as buildDefaultStylesForGeometryTypes,
|
|
3821
|
+
lt as buildGeometryFilter,
|
|
3822
|
+
pt as buildMeasureGeometryData,
|
|
3823
|
+
nt as buildMeasurePointsData,
|
|
3824
|
+
ut as calculateArea,
|
|
3825
|
+
ot as calculateDistance,
|
|
3826
|
+
mt as calculateMeasurement,
|
|
3825
3827
|
_e as defaultCircle,
|
|
3826
3828
|
ge as defaultFill,
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3829
|
+
qa as defaultLine,
|
|
3830
|
+
Wa as defaultSymbol,
|
|
3831
|
+
st as defaultUnitForMode,
|
|
3830
3832
|
Xe as detectGeometryStyleTypesFromQueryables,
|
|
3831
|
-
|
|
3833
|
+
li as detectGeometryTypeFromQueryables,
|
|
3832
3834
|
Ze as detectGeometryTypesFromFeatures,
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3835
|
+
Ti as detectStyleTypeForCollection,
|
|
3836
|
+
Di as detectStyleTypesForCollection,
|
|
3837
|
+
ct as downloadBlob,
|
|
3838
|
+
dt as downloadCsv,
|
|
3839
|
+
ht as eq,
|
|
3838
3840
|
We as expressionColors,
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3841
|
+
Ma as expressionEntries,
|
|
3842
|
+
Fa as expressionPropertyName,
|
|
3843
|
+
Ia as expressionType,
|
|
3842
3844
|
He as extractGeometryType,
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3845
|
+
gt as featuresToCsv,
|
|
3846
|
+
bt as fetchCollectionDetail,
|
|
3847
|
+
yt as fetchCollections,
|
|
3848
|
+
ft as fetchConformance,
|
|
3849
|
+
sa as fetchDistinctValues,
|
|
3850
|
+
xt as fetchFeatureById,
|
|
3851
|
+
wt as fetchFeatureCount,
|
|
3850
3852
|
ye as fetchFeatures,
|
|
3851
3853
|
qe as fetchQueryables,
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3854
|
+
Nt as fetchSpriteNames,
|
|
3855
|
+
vt as fetchSpriteUrlFromStyle,
|
|
3856
|
+
kt as fetchTileJson,
|
|
3857
|
+
qi as formatDMS,
|
|
3858
|
+
Wi as formatDecimal,
|
|
3859
|
+
oa as formatMeasurement,
|
|
3860
|
+
Ct as fromSimpleFilters,
|
|
3861
|
+
St as fromStructuredFilters,
|
|
3860
3862
|
Ye as geometryTypeToStyleType,
|
|
3861
3863
|
fe as geometryTypeToStyleTypes,
|
|
3862
3864
|
pe as getColorFromPalette,
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3865
|
+
Tt as getCql2FilteredVectorTileUrl,
|
|
3866
|
+
Dt as getFilteredVectorTileUrl,
|
|
3867
|
+
Pa as getPrimaryColor,
|
|
3868
|
+
Oa as getShapeForStyleType,
|
|
3869
|
+
Lt as getTileJsonUrl,
|
|
3870
|
+
At as getVectorTileSourceKey,
|
|
3871
|
+
Et as getVectorTileUrl,
|
|
3872
|
+
It as gt,
|
|
3873
|
+
Mt as gte,
|
|
3874
|
+
Li as humanizePropertyName,
|
|
3875
|
+
Ft as inList,
|
|
3874
3876
|
V as isExpression,
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3877
|
+
ri as isGeometryProperty,
|
|
3878
|
+
Pt as isNull,
|
|
3879
|
+
Ot as like,
|
|
3880
|
+
jt as lt,
|
|
3881
|
+
$t as lte,
|
|
3882
|
+
Rt as neq,
|
|
3883
|
+
Bt as not,
|
|
3884
|
+
zt as or,
|
|
3885
|
+
Ut as resolveAvailableIcons,
|
|
3886
|
+
Gt as resolvePropertyDisplay,
|
|
3887
|
+
qt as resolveStyleWithSprites,
|
|
3888
|
+
Wt as sDwithin,
|
|
3889
|
+
_t as sIntersects,
|
|
3890
|
+
Vt as sWithin,
|
|
3891
|
+
ca as safeValidateMapConfig,
|
|
3892
|
+
Ht as selectedFeatureKey,
|
|
3893
|
+
Yt as serializeCql2,
|
|
3894
|
+
Xt as tAfter,
|
|
3895
|
+
Zt as tBefore,
|
|
3896
|
+
Jt as tDuring,
|
|
3897
|
+
pi as toAvailableProperties,
|
|
3898
|
+
Kt as useCsvExport,
|
|
3899
|
+
Qt as useExport,
|
|
3900
|
+
er as useMeasure,
|
|
3901
|
+
ar as useOgcCollectionDetail,
|
|
3900
3902
|
Ge as useOgcCollections,
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3903
|
+
ir as useOgcFeatures,
|
|
3904
|
+
ma as useOgcQueryables,
|
|
3905
|
+
tr as useSelection,
|
|
3906
|
+
Ur as validateMapConfig
|
|
3905
3907
|
};
|