@ogc-maps/storybook-components 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/Legend-B6uIqOSw.js +239 -0
  2. package/dist/components/LayerEditor/LayerEditor.d.ts.map +1 -1
  3. package/dist/components/Legend/Legend.d.ts +2 -1
  4. package/dist/components/Legend/Legend.d.ts.map +1 -1
  5. package/dist/components/Legend/index.js +1 -1
  6. package/dist/components/LegendEditor/LegendEditor.d.ts +3 -2
  7. package/dist/components/LegendEditor/LegendEditor.d.ts.map +1 -1
  8. package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts +9 -0
  9. package/dist/components/StyleEditor/DataDrivenColorEditor.d.ts.map +1 -0
  10. package/dist/components/StyleEditor/PropertyField.d.ts +4 -1
  11. package/dist/components/StyleEditor/PropertyField.d.ts.map +1 -1
  12. package/dist/components/StyleEditor/PropertyGroup.d.ts +4 -1
  13. package/dist/components/StyleEditor/PropertyGroup.d.ts.map +1 -1
  14. package/dist/components/StyleEditor/StyleEditor.d.ts +5 -2
  15. package/dist/components/StyleEditor/StyleEditor.d.ts.map +1 -1
  16. package/dist/components/StyleEditor/StylePreview.d.ts.map +1 -1
  17. package/dist/components/StyleEditor/index.d.ts +2 -0
  18. package/dist/components/StyleEditor/index.d.ts.map +1 -1
  19. package/dist/components/UIConfigEditor/UIConfigEditor.d.ts.map +1 -1
  20. package/dist/components/index.d.ts +1 -1
  21. package/dist/components/index.d.ts.map +1 -1
  22. package/dist/{index-B2DIcC-4.js → index-B4i0zJXf.js} +330 -326
  23. package/dist/main.js +1803 -1242
  24. package/dist/schemas/config.d.ts +353 -288
  25. package/dist/schemas/config.d.ts.map +1 -1
  26. package/dist/schemas/index.js +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/types/index.js +1 -1
  29. package/dist/utils/__tests__/expressionColors.test.d.ts +2 -0
  30. package/dist/utils/__tests__/expressionColors.test.d.ts.map +1 -0
  31. package/dist/utils/colorPalettes.d.ts +5 -0
  32. package/dist/utils/colorPalettes.d.ts.map +1 -0
  33. package/dist/utils/expressionColors.d.ts +20 -0
  34. package/dist/utils/expressionColors.d.ts.map +1 -0
  35. package/dist/utils/index.d.ts +2 -0
  36. package/dist/utils/index.d.ts.map +1 -1
  37. package/dist/utils/queryableHelpers.d.ts +17 -0
  38. package/dist/utils/queryableHelpers.d.ts.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/Legend-TTWWpWDT.js +0 -97
package/dist/main.js CHANGED
@@ -1,82 +1,82 @@
1
- import { B as La } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
- import { C as Ia } from "./CollapsibleControl-VFUTWb_5.js";
3
- import { C as Ea, f as Fa, a as Oa } from "./CoordinateDisplay-PxPmVjpm.js";
4
- import { E as Pa } from "./ExportButton-CLsWoW4m.js";
5
- import { F as Ra } from "./FeatureDetailPanel-CkFpdEKW.js";
6
- import { F as Ba } from "./FeatureTooltip-Db1LgLQV.js";
7
- import { L as qa } from "./LayerPanel-SCdJ8948.js";
8
- import { L as za } from "./Legend-TTWWpWDT.js";
9
- import { S as Ga } from "./SearchPanel-DCY01Wa-.js";
10
- import { jsxs as l, jsx as e, Fragment as P } from "react/jsx-runtime";
11
- import { useId as be, useState as L, useRef as K, useMemo as De, useCallback as Le, useEffect as W } from "react";
12
- import { LuInfo as Te } from "react-icons/lu";
13
- import { J as he, j as Ie, i as ye, L as Ae } from "./cql2-onoyCbps.js";
14
- import { a as Xa, b as _a, M as Ha, e as Ja, N as Ka, f as Qa, c as Za, d as ei, g as ai, h as ii, O as ti, P as ri, k as li, l as pi, m as ui, n as ni, o as oi, p as mi, q as si, r as ci, s as di, t as gi, u as bi, v as hi, w as yi, x as fi, y as xi, z as wi, A as vi, Q as Ni, B as ki, C as Ci, D as Si, E as Di, F as Li, G as Ti, H as Ii, I as Ai, K as Ei } from "./cql2-onoyCbps.js";
15
- import { s as Ee } from "./index-B2DIcC-4.js";
16
- import { B as Oi, C as Mi, a as Pi, b as ji, D as Ri, F as $i, c as Bi, d as Ui, e as qi, L as Wi, f as zi, g as Vi, h as Gi, i as Yi, j as Xi, M as _i, N as Hi, O as Ji, P as Ki, k as Qi, S as Zi, l as et, m as at, n as it, o as tt, p as rt, q as lt, r as pt, T as ut, U as nt, V as ot, v as mt } from "./index-B2DIcC-4.js";
17
- import './style.css';function Fe({ text: a, id: i }) {
18
- const t = be(), p = i ?? t;
1
+ import { B as et } from "./BasemapSwitcher-BW7lyZ2Y.js";
2
+ import { C as tt } from "./CollapsibleControl-VFUTWb_5.js";
3
+ import { C as rt, f as lt, a as nt } from "./CoordinateDisplay-PxPmVjpm.js";
4
+ import { E as ot } from "./ExportButton-CLsWoW4m.js";
5
+ import { F as mt } from "./FeatureDetailPanel-CkFpdEKW.js";
6
+ import { F as ct } from "./FeatureTooltip-Db1LgLQV.js";
7
+ import { L as ht } from "./LayerPanel-SCdJ8948.js";
8
+ import { L as bt } from "./Legend-B6uIqOSw.js";
9
+ import { S as ft } from "./SearchPanel-DCY01Wa-.js";
10
+ import { jsxs as l, jsx as a, Fragment as B } from "react/jsx-runtime";
11
+ import { useId as Ee, useState as L, useRef as ue, useMemo as Pe, useCallback as ze, useEffect as X } from "react";
12
+ import { LuInfo as Ve } from "react-icons/lu";
13
+ import { J as Fe, j as Me, i as se, L as _e, g as Ye } from "./cql2-onoyCbps.js";
14
+ import { a as wt, b as vt, M as Nt, e as kt, N as Ct, f as St, c as Dt, d as Tt, h as Lt, O as It, P as At, k as Et, l as Pt, m as Ft, n as Mt, o as Ot, p as jt, q as $t, r as Rt, s as Bt, t as qt, u as Ut, v as Wt, w as Gt, x as zt, y as Vt, z as _t, A as Yt, Q as Xt, B as Ht, C as Jt, D as Kt, E as Qt, F as Zt, G as ei, H as ai, I as ti, K as ii } from "./cql2-onoyCbps.js";
15
+ import { s as Xe } from "./index-B4i0zJXf.js";
16
+ import { B as li, C as ni, a as pi, b as oi, D as ui, F as mi, c as si, d as ci, e as di, L as hi, f as gi, g as bi, h as yi, i as fi, j as xi, M as wi, N as vi, O as Ni, P as ki, k as Ci, S as Si, l as Di, m as Ti, n as Li, o as Ii, p as Ai, q as Ei, r as Pi, T as Fi, U as Mi, V as Oi, v as ji } from "./index-B4i0zJXf.js";
17
+ import './style.css';function He({ text: e, id: t }) {
18
+ const i = Ee(), r = t ?? i;
19
19
  return /* @__PURE__ */ l("span", { className: "mapui:relative mapui:inline-flex mapui:group", children: [
20
- /* @__PURE__ */ e(
20
+ /* @__PURE__ */ a(
21
21
  "span",
22
22
  {
23
23
  tabIndex: 0,
24
24
  "aria-label": "Info",
25
- "aria-describedby": p,
25
+ "aria-describedby": r,
26
26
  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",
27
- children: /* @__PURE__ */ e(Te, { className: "mapui:h-3.5 mapui:w-3.5" })
27
+ children: /* @__PURE__ */ a(Ve, { className: "mapui:h-3.5 mapui:w-3.5" })
28
28
  }
29
29
  ),
30
30
  /* @__PURE__ */ l(
31
31
  "span",
32
32
  {
33
- id: p,
33
+ id: r,
34
34
  role: "tooltip",
35
35
  className: "mapui:pointer-events-none mapui:absolute mapui:bottom-full mapui:left-1/2 mapui:-translate-x-1/2 mapui:mb-1.5 mapui:w-48 mapui:rounded mapui:bg-gray-900 mapui:px-2 mapui:py-1.5 mapui:text-xs mapui:text-white mapui:shadow-lg mapui:opacity-0 mapui:group-hover:opacity-100 mapui:group-focus-within:opacity-100 mapui:transition-opacity mapui:z-50",
36
36
  children: [
37
- a,
38
- /* @__PURE__ */ e("span", { className: "mapui:absolute mapui:top-full mapui:left-1/2 mapui:-translate-x-1/2 mapui:border-4 mapui:border-transparent mapui:border-t-gray-900" })
37
+ e,
38
+ /* @__PURE__ */ a("span", { className: "mapui:absolute mapui:top-full mapui:left-1/2 mapui:-translate-x-1/2 mapui:border-4 mapui:border-transparent mapui:border-t-gray-900" })
39
39
  ]
40
40
  }
41
41
  )
42
42
  ] });
43
43
  }
44
- function N({ label: a, error: i, required: t, description: p, htmlFor: u, children: n }) {
44
+ function S({ label: e, error: t, required: i, description: r, htmlFor: n, children: o }) {
45
45
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
46
46
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1", children: [
47
- /* @__PURE__ */ l("label", { htmlFor: u, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
48
- a,
49
- t && /* @__PURE__ */ e("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
47
+ /* @__PURE__ */ l("label", { htmlFor: n, className: "mapui:flex mapui:items-center mapui:gap-1 mapui:text-xs mapui:font-medium mapui:text-gray-700", children: [
48
+ e,
49
+ i && /* @__PURE__ */ a("span", { className: "mapui:ml-0.5 mapui:text-red-500", "aria-hidden": "true", children: "*" })
50
50
  ] }),
51
- p && /* @__PURE__ */ e(Fe, { text: p })
51
+ r && /* @__PURE__ */ a(He, { text: r })
52
52
  ] }),
53
- n,
54
- i && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: i })
53
+ o,
54
+ t && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:text-red-600", role: "alert", children: t })
55
55
  ] });
56
56
  }
57
- function fe({ value: a, onChange: i, label: t }) {
57
+ function Y({ value: e, onChange: t, label: i }) {
58
58
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
59
- /* @__PURE__ */ e(
59
+ /* @__PURE__ */ a(
60
60
  "input",
61
61
  {
62
62
  type: "color",
63
- value: a,
64
- onChange: (p) => i(p.target.value),
65
- "aria-label": t ?? "Color",
63
+ value: e,
64
+ onChange: (r) => t(r.target.value),
65
+ "aria-label": i ?? "Color",
66
66
  className: "mapui:h-8 mapui:w-10 mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:p-0.5"
67
67
  }
68
68
  ),
69
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-600", children: a })
69
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-600", children: e })
70
70
  ] });
71
71
  }
72
- function G({
73
- open: a,
74
- title: i,
75
- description: t,
76
- onConfirm: p,
77
- onCancel: u
72
+ function Z({
73
+ open: e,
74
+ title: t,
75
+ description: i,
76
+ onConfirm: r,
77
+ onCancel: n
78
78
  }) {
79
- return a ? /* @__PURE__ */ e(
79
+ return e ? /* @__PURE__ */ a(
80
80
  "div",
81
81
  {
82
82
  className: "mapui:fixed mapui:inset-0 mapui:z-50 mapui:flex mapui:items-center mapui:justify-center mapui:bg-black/50",
@@ -85,37 +85,37 @@ function G({
85
85
  "aria-labelledby": "confirm-dialog-title",
86
86
  "aria-describedby": "confirm-dialog-description",
87
87
  children: /* @__PURE__ */ l("div", { className: "mapui:w-full mapui:max-w-sm mapui:rounded-lg mapui:bg-white mapui:p-6 mapui:shadow-xl", children: [
88
- /* @__PURE__ */ e(
88
+ /* @__PURE__ */ a(
89
89
  "h2",
90
90
  {
91
91
  id: "confirm-dialog-title",
92
92
  className: "mapui:m-0 mapui:mb-2 mapui:text-base mapui:font-semibold mapui:text-gray-900",
93
- children: i
93
+ children: t
94
94
  }
95
95
  ),
96
- /* @__PURE__ */ e(
96
+ /* @__PURE__ */ a(
97
97
  "p",
98
98
  {
99
99
  id: "confirm-dialog-description",
100
100
  className: "mapui:m-0 mapui:mb-6 mapui:text-sm mapui:text-gray-600",
101
- children: t
101
+ children: i
102
102
  }
103
103
  ),
104
104
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:justify-end mapui:gap-2", children: [
105
- /* @__PURE__ */ e(
105
+ /* @__PURE__ */ a(
106
106
  "button",
107
107
  {
108
108
  type: "button",
109
- onClick: u,
109
+ onClick: n,
110
110
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-gray-300 mapui:bg-white mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-gray-700 hover:mapui:bg-gray-50",
111
111
  children: "Cancel"
112
112
  }
113
113
  ),
114
- /* @__PURE__ */ e(
114
+ /* @__PURE__ */ a(
115
115
  "button",
116
116
  {
117
117
  type: "button",
118
- onClick: p,
118
+ onClick: r,
119
119
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-transparent mapui:bg-red-600 mapui:px-3 mapui:py-1.5 mapui:text-sm mapui:font-medium mapui:text-white hover:mapui:bg-red-700",
120
120
  children: "Confirm"
121
121
  }
@@ -125,170 +125,170 @@ function G({
125
125
  }
126
126
  ) : null;
127
127
  }
128
- function q({
129
- title: a,
130
- children: i,
131
- defaultOpen: t = !1,
132
- badge: p
128
+ function _({
129
+ title: e,
130
+ children: t,
131
+ defaultOpen: i = !1,
132
+ badge: r
133
133
  }) {
134
- const [u, n] = L(t);
134
+ const [n, o] = L(i);
135
135
  return /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-200", children: [
136
136
  /* @__PURE__ */ l(
137
137
  "button",
138
138
  {
139
139
  type: "button",
140
- onClick: () => n((r) => !r),
140
+ onClick: () => o((p) => !p),
141
141
  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",
142
142
  children: [
143
143
  /* @__PURE__ */ l("span", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
144
- a,
145
- p !== void 0 && p > 0 && /* @__PURE__ */ e("span", { className: "mapui:rounded-full mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: p })
144
+ e,
145
+ r !== void 0 && r > 0 && /* @__PURE__ */ a("span", { className: "mapui:rounded-full mapui:bg-blue-100 mapui:px-1.5 mapui:py-0.5 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: r })
146
146
  ] }),
147
- /* @__PURE__ */ e("span", { "aria-hidden": "true", children: u ? "▲" : "▼" })
147
+ /* @__PURE__ */ a("span", { "aria-hidden": "true", children: n ? "▲" : "▼" })
148
148
  ]
149
149
  }
150
150
  ),
151
- u && /* @__PURE__ */ e("div", { className: "mapui:p-3", children: i })
151
+ n && /* @__PURE__ */ a("div", { className: "mapui:p-3", children: t })
152
152
  ] });
153
153
  }
154
- const z = "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";
155
- function ie({
156
- value: a,
157
- onChange: i,
158
- onTestConnection: t,
159
- testStatus: p = "idle",
160
- testError: u
154
+ const H = "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";
155
+ function de({
156
+ value: e,
157
+ onChange: t,
158
+ onTestConnection: i,
159
+ testStatus: r = "idle",
160
+ testError: n
161
161
  }) {
162
- const n = (r) => i({ ...a, ...r });
162
+ const o = (p) => t({ ...e, ...p });
163
163
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
164
- /* @__PURE__ */ e(N, { label: "ID", required: !0, children: /* @__PURE__ */ e(
164
+ /* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
165
165
  "input",
166
166
  {
167
167
  type: "text",
168
- value: a.id,
169
- onChange: (r) => n({ id: r.target.value }),
168
+ value: e.id,
169
+ onChange: (p) => o({ id: p.target.value }),
170
170
  placeholder: "my-source",
171
- className: z
171
+ className: H
172
172
  }
173
173
  ) }),
174
- /* @__PURE__ */ l(N, { label: "URL", required: !0, children: [
174
+ /* @__PURE__ */ l(S, { label: "URL", required: !0, children: [
175
175
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
176
- /* @__PURE__ */ e(
176
+ /* @__PURE__ */ a(
177
177
  "input",
178
178
  {
179
179
  type: "url",
180
- value: a.url,
181
- onChange: (r) => n({ url: r.target.value }),
180
+ value: e.url,
181
+ onChange: (p) => o({ url: p.target.value }),
182
182
  placeholder: "https://example.com/ogcapi",
183
- className: `${z} mapui:flex-1`
183
+ className: `${H} mapui:flex-1`
184
184
  }
185
185
  ),
186
- t && /* @__PURE__ */ e(
186
+ i && /* @__PURE__ */ a(
187
187
  "button",
188
188
  {
189
189
  type: "button",
190
- onClick: () => t(a.url),
191
- disabled: p === "loading" || !a.url,
190
+ onClick: () => i(e.url),
191
+ disabled: r === "loading" || !e.url,
192
192
  className: "mapui:cursor-pointer mapui:rounded mapui:border mapui:border-blue-500 mapui:bg-white mapui:px-3 mapui:py-1 mapui:text-sm mapui:text-blue-600 hover:mapui:bg-blue-50 disabled:mapui:cursor-not-allowed disabled:mapui:opacity-50",
193
- children: p === "loading" ? "Testing…" : "Test Connection"
193
+ children: r === "loading" ? "Testing…" : "Test Connection"
194
194
  }
195
195
  )
196
196
  ] }),
197
- p === "success" && /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-green-600", children: "Connection successful" }),
198
- p === "error" && /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-red-600", children: u ?? "Connection failed" })
197
+ r === "success" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-green-600", children: "Connection successful" }),
198
+ r === "error" && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-600", children: n ?? "Connection failed" })
199
199
  ] }),
200
- /* @__PURE__ */ e(N, { label: "Label", children: /* @__PURE__ */ e(
200
+ /* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
201
201
  "input",
202
202
  {
203
203
  type: "text",
204
- value: a.label ?? "",
205
- onChange: (r) => n({ label: r.target.value || void 0 }),
204
+ value: e.label ?? "",
205
+ onChange: (p) => o({ label: p.target.value || void 0 }),
206
206
  placeholder: "My OGC API Source",
207
- className: z
207
+ className: H
208
208
  }
209
209
  ) }),
210
- /* @__PURE__ */ e(N, { label: "Tile Matrix Set ID", children: /* @__PURE__ */ e(
210
+ /* @__PURE__ */ a(S, { label: "Tile Matrix Set ID", children: /* @__PURE__ */ a(
211
211
  "input",
212
212
  {
213
213
  type: "text",
214
- value: a.tileMatrixSetId ?? "WebMercatorQuad",
215
- onChange: (r) => n({ tileMatrixSetId: r.target.value || void 0 }),
214
+ value: e.tileMatrixSetId ?? "WebMercatorQuad",
215
+ onChange: (p) => o({ tileMatrixSetId: p.target.value || void 0 }),
216
216
  placeholder: "WebMercatorQuad",
217
- className: z
217
+ className: H
218
218
  }
219
219
  ) })
220
220
  ] });
221
221
  }
222
- const Y = () => ({
222
+ const ee = () => ({
223
223
  id: "",
224
224
  url: "",
225
225
  label: void 0,
226
226
  tileMatrixSetId: "WebMercatorQuad"
227
227
  });
228
- function ba({ sources: a, onChange: i }) {
229
- const [t, p] = L(null), [u, n] = L(null), [r, m] = L(!1), [d, f] = L(Y()), [s, g] = L({}), [D, o] = L({}), [c, x] = L(null), v = async (w, I) => {
230
- g((k) => ({ ...k, [w]: "loading" }));
228
+ function Ua({ sources: e, onChange: t }) {
229
+ const [i, r] = L(null), [n, o] = L(null), [p, b] = L(!1), [m, w] = L(ee()), [d, f] = L({}), [c, u] = L({}), [s, v] = L(null), k = async (C, P) => {
230
+ f((E) => ({ ...E, [C]: "loading" }));
231
231
  try {
232
- const k = await fetch(`${I}/conformance`);
233
- k.ok ? g((C) => ({ ...C, [w]: "success" })) : (g((C) => ({ ...C, [w]: "error" })), o((C) => ({ ...C, [w]: `HTTP ${k.status}` })));
234
- } catch (k) {
235
- g((C) => ({ ...C, [w]: "error" })), o((C) => ({ ...C, [w]: k instanceof Error ? k.message : "Network error" }));
232
+ const E = await fetch(`${P}/conformance`);
233
+ E.ok ? f((y) => ({ ...y, [C]: "success" })) : (f((y) => ({ ...y, [C]: "error" })), u((y) => ({ ...y, [C]: `HTTP ${E.status}` })));
234
+ } catch (E) {
235
+ f((y) => ({ ...y, [C]: "error" })), u((y) => ({ ...y, [C]: E instanceof Error ? E.message : "Network error" }));
236
236
  }
237
- }, T = () => {
238
- u && (i(a.map((w) => w.id === t ? u : w)), p(null), n(null));
239
- }, b = () => {
240
- i([...a, d]), m(!1), f(Y());
241
- }, y = (w) => {
242
- i(a.filter((I) => I.id !== w)), x(null);
237
+ }, D = () => {
238
+ n && (t(e.map((C) => C.id === i ? n : C)), r(null), o(null));
239
+ }, x = () => {
240
+ t([...e, m]), b(!1), w(ee());
241
+ }, $ = (C) => {
242
+ t(e.filter((P) => P.id !== C)), v(null);
243
243
  };
244
244
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
245
245
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
246
- /* @__PURE__ */ e("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Sources" }),
247
- /* @__PURE__ */ e(
246
+ /* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Sources" }),
247
+ /* @__PURE__ */ a(
248
248
  "button",
249
249
  {
250
250
  type: "button",
251
251
  onClick: () => {
252
- m(!0), f(Y());
252
+ b(!0), w(ee());
253
253
  },
254
254
  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",
255
255
  children: "+ Add Source"
256
256
  }
257
257
  )
258
258
  ] }),
259
- a.length === 0 && !r && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
260
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((w) => /* @__PURE__ */ e(
259
+ e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No sources configured." }),
260
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((C) => /* @__PURE__ */ a(
261
261
  "li",
262
262
  {
263
263
  className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white mapui:p-3",
264
- children: t === w.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
265
- /* @__PURE__ */ e(
266
- ie,
264
+ children: i === C.id ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
265
+ /* @__PURE__ */ a(
266
+ de,
267
267
  {
268
- value: u ?? w,
269
- onChange: n,
270
- onTestConnection: (I) => v(`edit-${w.id}`, I),
271
- testStatus: s[`edit-${w.id}`],
272
- testError: D[`edit-${w.id}`]
268
+ value: n ?? C,
269
+ onChange: o,
270
+ onTestConnection: (P) => k(`edit-${C.id}`, P),
271
+ testStatus: d[`edit-${C.id}`],
272
+ testError: c[`edit-${C.id}`]
273
273
  }
274
274
  ),
275
275
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
276
- /* @__PURE__ */ e(
276
+ /* @__PURE__ */ a(
277
277
  "button",
278
278
  {
279
279
  type: "button",
280
- onClick: T,
281
- disabled: !(u != null && u.id) || !(u != null && u.url),
280
+ onClick: D,
281
+ disabled: !(n != null && n.id) || !(n != null && n.url),
282
282
  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",
283
283
  children: "Save"
284
284
  }
285
285
  ),
286
- /* @__PURE__ */ e(
286
+ /* @__PURE__ */ a(
287
287
  "button",
288
288
  {
289
289
  type: "button",
290
290
  onClick: () => {
291
- p(null), n(null);
291
+ r(null), o(null);
292
292
  },
293
293
  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",
294
294
  children: "Cancel"
@@ -297,30 +297,30 @@ function ba({ sources: a, onChange: i }) {
297
297
  ] })
298
298
  ] }) : /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-start mapui:justify-between mapui:gap-2", children: [
299
299
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
300
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: w.label ?? w.id }),
301
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: w.url }),
302
- w.tileMatrixSetId && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-gray-400", children: [
300
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: C.label ?? C.id }),
301
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: C.url }),
302
+ C.tileMatrixSetId && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-gray-400", children: [
303
303
  "TMS: ",
304
- w.tileMatrixSetId
304
+ C.tileMatrixSetId
305
305
  ] })
306
306
  ] }),
307
307
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
308
- /* @__PURE__ */ e(
308
+ /* @__PURE__ */ a(
309
309
  "button",
310
310
  {
311
311
  type: "button",
312
312
  onClick: () => {
313
- p(w.id), n(w);
313
+ r(C.id), o(C);
314
314
  },
315
315
  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",
316
316
  children: "Edit"
317
317
  }
318
318
  ),
319
- /* @__PURE__ */ e(
319
+ /* @__PURE__ */ a(
320
320
  "button",
321
321
  {
322
322
  type: "button",
323
- onClick: () => x(w.id),
323
+ onClick: () => v(C.id),
324
324
  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",
325
325
  children: "Remove"
326
326
  }
@@ -328,456 +328,836 @@ function ba({ sources: a, onChange: i }) {
328
328
  ] })
329
329
  ] })
330
330
  },
331
- w.id
331
+ C.id
332
332
  )) }),
333
- r && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
334
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
335
- /* @__PURE__ */ e(
336
- ie,
333
+ p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
334
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Source" }),
335
+ /* @__PURE__ */ a(
336
+ de,
337
337
  {
338
- value: d,
339
- onChange: f,
340
- onTestConnection: (w) => v("new", w),
341
- testStatus: s.new,
342
- testError: D.new
338
+ value: m,
339
+ onChange: w,
340
+ onTestConnection: (C) => k("new", C),
341
+ testStatus: d.new,
342
+ testError: c.new
343
343
  }
344
344
  ),
345
345
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
346
- /* @__PURE__ */ e(
346
+ /* @__PURE__ */ a(
347
347
  "button",
348
348
  {
349
349
  type: "button",
350
- onClick: b,
351
- disabled: !d.id || !d.url,
350
+ onClick: x,
351
+ disabled: !m.id || !m.url,
352
352
  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",
353
353
  children: "Save"
354
354
  }
355
355
  ),
356
- /* @__PURE__ */ e(
356
+ /* @__PURE__ */ a(
357
357
  "button",
358
358
  {
359
359
  type: "button",
360
- onClick: () => m(!1),
360
+ onClick: () => b(!1),
361
361
  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",
362
362
  children: "Cancel"
363
363
  }
364
364
  )
365
365
  ] })
366
366
  ] }),
367
- /* @__PURE__ */ e(
368
- G,
367
+ /* @__PURE__ */ a(
368
+ Z,
369
369
  {
370
- open: c !== null,
370
+ open: s !== null,
371
371
  title: "Remove Source",
372
372
  description: "Are you sure you want to remove this source? Any layers using it will be affected.",
373
- onConfirm: () => c && y(c),
374
- onCancel: () => x(null)
373
+ onConfirm: () => s && $(s),
374
+ onCancel: () => v(null)
375
375
  }
376
376
  )
377
377
  ] });
378
378
  }
379
- function ha({
380
- sourceUrl: a,
381
- selectedCollectionIds: i,
382
- onSelect: t,
383
- onDeselect: p
379
+ function Wa({
380
+ sourceUrl: e,
381
+ selectedCollectionIds: t,
382
+ onSelect: i,
383
+ onDeselect: r
384
384
  }) {
385
- const { collections: u, loading: n, error: r } = he(a || null);
386
- return n ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
387
- /* @__PURE__ */ e("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" }),
385
+ const { collections: n, loading: o, error: p } = Fe(e || null);
386
+ return o ? /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2 mapui:py-4 mapui:text-sm mapui:text-gray-500", children: [
387
+ /* @__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" }),
388
388
  "Loading collections…"
389
- ] }) : r ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
389
+ ] }) : p ? /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3 mapui:text-sm mapui:text-red-700", children: [
390
390
  "Failed to load collections: ",
391
- r.message
392
- ] }) : u.length === 0 ? /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No collections found at this source." }) : /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: u.map((m) => {
393
- const d = i.includes(m.id);
391
+ p.message
392
+ ] }) : n.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: n.map((b) => {
393
+ const m = t.includes(b.id);
394
394
  return /* @__PURE__ */ l(
395
395
  "li",
396
396
  {
397
397
  className: "mapui:flex mapui:items-start mapui:gap-3 mapui:rounded mapui:border mapui:border-gray-200 mapui:p-2 hover:mapui:bg-gray-50",
398
398
  children: [
399
- /* @__PURE__ */ e(
399
+ /* @__PURE__ */ a(
400
400
  "input",
401
401
  {
402
402
  type: "checkbox",
403
- id: `collection-${m.id}`,
404
- checked: d,
405
- onChange: () => d ? p(m.id) : t(m.id),
403
+ id: `collection-${b.id}`,
404
+ checked: m,
405
+ onChange: () => m ? r(b.id) : i(b.id),
406
406
  className: "mapui:mt-0.5 mapui:h-4 mapui:w-4 mapui:cursor-pointer mapui:accent-blue-600"
407
407
  }
408
408
  ),
409
409
  /* @__PURE__ */ l(
410
410
  "label",
411
411
  {
412
- htmlFor: `collection-${m.id}`,
412
+ htmlFor: `collection-${b.id}`,
413
413
  className: "mapui:flex mapui:cursor-pointer mapui:flex-col mapui:gap-0.5",
414
414
  children: [
415
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: m.title ?? m.id }),
416
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: m.id }),
417
- m.description && /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: m.description })
415
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: b.title ?? b.id }),
416
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: b.id }),
417
+ b.description && /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-400 mapui:line-clamp-2", children: b.description })
418
418
  ]
419
419
  }
420
420
  )
421
421
  ]
422
422
  },
423
- m.id
423
+ b.id
424
424
  );
425
425
  }) });
426
426
  }
427
- function Oe({ value: a, onChange: i, availableIcons: t }) {
428
- const [p, u] = L(!1), [n, r] = L(-1), m = K(null), d = be(), f = n >= 0 ? `${d}-option-${n}` : void 0, s = De(() => {
429
- if (!t || t.length === 0) return [];
430
- if (!a) return t;
431
- const v = a.toLowerCase();
432
- return t.filter((T) => T.toLowerCase().includes(v));
433
- }, [t, a]), g = p && s.length > 0, D = Le(
434
- (v) => {
435
- i(v), u(!1), r(-1);
427
+ function Je({ value: e, onChange: t, availableIcons: i }) {
428
+ const [r, n] = L(!1), [o, p] = L(-1), b = ue(null), m = Ee(), w = o >= 0 ? `${m}-option-${o}` : void 0, d = Pe(() => {
429
+ if (!i || i.length === 0) return [];
430
+ if (!e) return i;
431
+ const k = e.toLowerCase();
432
+ return i.filter((D) => D.toLowerCase().includes(k));
433
+ }, [i, e]), f = r && d.length > 0, c = ze(
434
+ (k) => {
435
+ t(k), n(!1), p(-1);
436
436
  },
437
- [i]
438
- ), o = (v) => {
439
- i(v.target.value), u(!0), r(-1);
440
- }, c = (v) => {
441
- g && (v.key === "ArrowDown" ? (v.preventDefault(), r((T) => Math.min(T + 1, s.length - 1))) : v.key === "ArrowUp" ? (v.preventDefault(), r((T) => Math.max(T - 1, 0))) : v.key === "Enter" && n >= 0 ? (v.preventDefault(), D(s[n])) : v.key === "Escape" && (u(!1), r(-1)));
437
+ [t]
438
+ ), u = (k) => {
439
+ t(k.target.value), n(!0), p(-1);
440
+ }, s = (k) => {
441
+ f && (k.key === "ArrowDown" ? (k.preventDefault(), p((D) => Math.min(D + 1, d.length - 1))) : k.key === "ArrowUp" ? (k.preventDefault(), p((D) => Math.max(D - 1, 0))) : k.key === "Enter" && o >= 0 ? (k.preventDefault(), c(d[o])) : k.key === "Escape" && (n(!1), p(-1)));
442
442
  };
443
- W(() => {
444
- const v = (T) => {
445
- m.current && !m.current.contains(T.target) && (u(!1), r(-1));
443
+ X(() => {
444
+ const k = (D) => {
445
+ b.current && !b.current.contains(D.target) && (n(!1), p(-1));
446
446
  };
447
- return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
447
+ return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
448
448
  }, []);
449
- const x = "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";
450
- return !t || t.length === 0 ? /* @__PURE__ */ e(
449
+ const v = "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";
450
+ return !i || i.length === 0 ? /* @__PURE__ */ a(
451
451
  "input",
452
452
  {
453
453
  type: "text",
454
- value: a,
455
- onChange: (v) => i(v.target.value || ""),
454
+ value: e,
455
+ onChange: (k) => t(k.target.value || ""),
456
456
  placeholder: "icon-name",
457
- className: x
457
+ className: v
458
458
  }
459
- ) : /* @__PURE__ */ l("div", { ref: m, className: "mapui:relative", children: [
460
- /* @__PURE__ */ e(
459
+ ) : /* @__PURE__ */ l("div", { ref: b, className: "mapui:relative", children: [
460
+ /* @__PURE__ */ a(
461
461
  "input",
462
462
  {
463
463
  type: "text",
464
- value: a,
464
+ value: e,
465
465
  placeholder: "Search icons…",
466
466
  role: "combobox",
467
- "aria-expanded": g,
467
+ "aria-expanded": f,
468
468
  "aria-autocomplete": "list",
469
- "aria-controls": d,
470
- "aria-activedescendant": f,
471
- onChange: o,
472
- onFocus: () => u(!0),
473
- onKeyDown: c,
474
- className: x
469
+ "aria-controls": m,
470
+ "aria-activedescendant": w,
471
+ onChange: u,
472
+ onFocus: () => n(!0),
473
+ onKeyDown: s,
474
+ className: v
475
475
  }
476
476
  ),
477
- g && /* @__PURE__ */ e(
477
+ f && /* @__PURE__ */ a(
478
478
  "ul",
479
479
  {
480
- id: d,
480
+ id: m,
481
481
  role: "listbox",
482
482
  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",
483
- children: s.map((v, T) => /* @__PURE__ */ e(
483
+ children: d.map((k, D) => /* @__PURE__ */ a(
484
484
  "li",
485
485
  {
486
- id: `${d}-option-${T}`,
486
+ id: `${m}-option-${D}`,
487
487
  role: "option",
488
- "aria-selected": T === n,
489
- onMouseDown: (b) => {
490
- b.preventDefault(), D(v);
488
+ "aria-selected": D === o,
489
+ onMouseDown: (x) => {
490
+ x.preventDefault(), c(k);
491
491
  },
492
- className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${T === n ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
493
- children: v
492
+ className: `mapui:cursor-pointer mapui:px-2 mapui:py-1 mapui:text-sm mapui:font-mono ${D === o ? "mapui:bg-blue-100" : "hover:mapui:bg-gray-50"}`,
493
+ children: k
494
494
  },
495
- `${T}-${v}`
495
+ `${D}-${k}`
496
496
  ))
497
497
  }
498
498
  )
499
499
  ] });
500
500
  }
501
- const M = "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";
502
- function Me({
503
- value: a,
504
- onChange: i
501
+ const he = [
502
+ "#4e79a7",
503
+ "#f28e2b",
504
+ "#e15759",
505
+ "#76b7b2",
506
+ "#59a14f",
507
+ "#edc948",
508
+ "#b07aa1",
509
+ "#ff9da7",
510
+ "#9c755f",
511
+ "#bab0ac"
512
+ ];
513
+ function ae(e) {
514
+ return he[e % he.length];
515
+ }
516
+ function Ke(e) {
517
+ return e[0] === "interpolate" ? "interpolate" : "match";
518
+ }
519
+ function Qe(e) {
520
+ const t = Array.isArray(e[1]) ? e[1][1] ?? "" : "", i = e[e.length - 1] ?? "#000000", r = [];
521
+ for (let n = 2; n < e.length - 1; n += 2)
522
+ r.push({ value: String(e[n] ?? ""), color: e[n + 1] ?? "#000000" });
523
+ return { property: t, pairs: r, fallback: i };
524
+ }
525
+ function ge(e, t, i) {
526
+ const r = ["match", ["get", e]];
527
+ for (const n of t)
528
+ r.push(n.value, n.color);
529
+ return r.push(i), r;
530
+ }
531
+ function Ze(e) {
532
+ const t = Array.isArray(e[2]) ? e[2][1] ?? "" : "", i = [];
533
+ for (let r = 3; r < e.length; r += 2)
534
+ i.push({ stop: Number(e[r] ?? 0), color: e[r + 1] ?? "#000000" });
535
+ return { property: t, stops: i };
536
+ }
537
+ function be(e, t) {
538
+ const i = ["interpolate", ["linear"], ["get", e]];
539
+ for (const r of t)
540
+ i.push(r.stop, r.color);
541
+ return i;
542
+ }
543
+ const J = "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", te = "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", ye = "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";
544
+ function ea({
545
+ value: e,
546
+ onChange: t,
547
+ availableProperties: i = [],
548
+ onFetchDistinctValues: r
505
549
  }) {
506
- const t = (a == null ? void 0 : a[0]) ?? 0, p = (a == null ? void 0 : a[1]) ?? 0;
550
+ const [n, o] = L(() => Ke(e)), [p, b] = L(!1), m = Qe(e), w = Ze(e), d = n === "match" ? m.property : "", f = n === "match" ? m.pairs : [], c = n === "match" ? m.fallback : "#000000", u = n === "interpolate" ? w.property : "", s = n === "interpolate" ? w.stops : [], v = i.filter(
551
+ (h) => !h.type || h.type === "string"
552
+ ), k = i.filter(
553
+ (h) => h.type === "number" || h.type === "integer"
554
+ ), D = (h, T, I) => {
555
+ t(ge(h, T, I));
556
+ }, x = (h) => {
557
+ D(h, f, c);
558
+ }, $ = (h) => {
559
+ D(d, f, h);
560
+ }, C = (h, T) => {
561
+ const I = f.map((A, W) => W === h ? { ...A, value: T } : A);
562
+ D(d, I, c);
563
+ }, P = (h, T) => {
564
+ const I = f.map((A, W) => W === h ? { ...A, color: T } : A);
565
+ D(d, I, c);
566
+ }, E = (h) => {
567
+ const T = f.filter((I, A) => A !== h);
568
+ D(d, T, c);
569
+ }, y = () => {
570
+ const h = [...f, { value: "", color: ae(f.length) }];
571
+ D(d, h, c);
572
+ }, F = async () => {
573
+ if (!(!r || !d)) {
574
+ b(!0);
575
+ try {
576
+ const T = (await r(d)).map((I, A) => ({
577
+ value: I,
578
+ color: ae(A)
579
+ }));
580
+ D(d, T, c);
581
+ } finally {
582
+ b(!1);
583
+ }
584
+ }
585
+ }, M = (h, T) => {
586
+ t(be(h, T));
587
+ }, g = (h) => {
588
+ M(h, s);
589
+ }, N = (h, T) => {
590
+ const I = s.map((A, W) => W === h ? { ...A, stop: T } : A);
591
+ M(u, I);
592
+ }, O = (h, T) => {
593
+ const I = s.map((A, W) => W === h ? { ...A, color: T } : A);
594
+ M(u, I);
595
+ }, q = (h) => {
596
+ const T = s.filter((I, A) => A !== h);
597
+ M(u, T);
598
+ }, U = () => {
599
+ var I;
600
+ const h = ((I = s[s.length - 1]) == null ? void 0 : I.stop) ?? 0, T = [...s, { stop: h + 10, color: ae(s.length) }];
601
+ M(u, T);
602
+ }, R = (h) => {
603
+ o(h), t(h === "match" ? ge("", [], "#000000") : be("", []));
604
+ };
605
+ return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
606
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: ["match", "interpolate"].map((h) => /* @__PURE__ */ a(
607
+ "button",
608
+ {
609
+ type: "button",
610
+ onClick: () => R(h),
611
+ className: [
612
+ "mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-xs mapui:capitalize mapui:outline-none",
613
+ "focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
614
+ n === h ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
615
+ ].join(" "),
616
+ children: h === "match" ? "Categorical" : "Gradient"
617
+ },
618
+ h
619
+ )) }),
620
+ n === "match" && /* @__PURE__ */ l(B, { children: [
621
+ /* @__PURE__ */ l(
622
+ "select",
623
+ {
624
+ value: d,
625
+ onChange: (h) => x(h.target.value),
626
+ className: J,
627
+ children: [
628
+ /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
629
+ v.map((h) => /* @__PURE__ */ a("option", { value: h.name, children: h.title ?? h.name }, h.name))
630
+ ]
631
+ }
632
+ ),
633
+ f.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: f.map((h, T) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
634
+ /* @__PURE__ */ a(
635
+ "input",
636
+ {
637
+ type: "text",
638
+ value: h.value,
639
+ onChange: (I) => C(T, I.target.value),
640
+ placeholder: "value",
641
+ className: `${J} mapui:flex-1`
642
+ }
643
+ ),
644
+ /* @__PURE__ */ a(
645
+ Y,
646
+ {
647
+ value: h.color,
648
+ onChange: (I) => P(T, I),
649
+ label: `Color for "${h.value}"`
650
+ }
651
+ ),
652
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => E(T), className: ye, children: "×" })
653
+ ] }, T)) }),
654
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
655
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500 mapui:shrink-0", children: "Fallback:" }),
656
+ /* @__PURE__ */ a(Y, { value: c, onChange: $, label: "Fallback color" })
657
+ ] }),
658
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
659
+ /* @__PURE__ */ a("button", { type: "button", onClick: y, className: te, children: "+ Add value" }),
660
+ r && d && /* @__PURE__ */ a(
661
+ "button",
662
+ {
663
+ type: "button",
664
+ onClick: F,
665
+ disabled: p,
666
+ className: te,
667
+ children: p ? "Loading…" : "Auto-populate"
668
+ }
669
+ )
670
+ ] })
671
+ ] }),
672
+ n === "interpolate" && /* @__PURE__ */ l(B, { children: [
673
+ /* @__PURE__ */ l(
674
+ "select",
675
+ {
676
+ value: u,
677
+ onChange: (h) => g(h.target.value),
678
+ className: J,
679
+ children: [
680
+ /* @__PURE__ */ a("option", { value: "", children: "Select a numeric property…" }),
681
+ k.map((h) => /* @__PURE__ */ a("option", { value: h.name, children: h.title ?? h.name }, h.name))
682
+ ]
683
+ }
684
+ ),
685
+ s.length > 0 && /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: s.map((h, T) => /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
686
+ /* @__PURE__ */ a(
687
+ "input",
688
+ {
689
+ type: "number",
690
+ value: h.stop,
691
+ onChange: (I) => N(T, parseFloat(I.target.value) || 0),
692
+ placeholder: "stop",
693
+ className: `${J} mapui:w-24`
694
+ }
695
+ ),
696
+ /* @__PURE__ */ a(
697
+ Y,
698
+ {
699
+ value: h.color,
700
+ onChange: (I) => O(T, I),
701
+ label: `Color at stop ${h.stop}`
702
+ }
703
+ ),
704
+ /* @__PURE__ */ a("button", { type: "button", onClick: () => q(T), className: ye, children: "×" })
705
+ ] }, T)) }),
706
+ /* @__PURE__ */ a("button", { type: "button", onClick: U, className: te, children: "+ Add stop" })
707
+ ] })
708
+ ] });
709
+ }
710
+ const z = "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";
711
+ function aa({
712
+ value: e,
713
+ onChange: t
714
+ }) {
715
+ const i = (e == null ? void 0 : e[0]) ?? 0, r = (e == null ? void 0 : e[1]) ?? 0;
507
716
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
508
- /* @__PURE__ */ e(
717
+ /* @__PURE__ */ a(
509
718
  "input",
510
719
  {
511
720
  type: "number",
512
721
  step: 0.5,
513
- value: t,
514
- onChange: (u) => i([parseFloat(u.target.value) || 0, p]),
515
- className: `${M} mapui:w-20`,
722
+ value: i,
723
+ onChange: (n) => t([parseFloat(n.target.value) || 0, r]),
724
+ className: `${z} mapui:w-20`,
516
725
  "aria-label": "X",
517
726
  placeholder: "X"
518
727
  }
519
728
  ),
520
- /* @__PURE__ */ e(
729
+ /* @__PURE__ */ a(
521
730
  "input",
522
731
  {
523
732
  type: "number",
524
733
  step: 0.5,
525
- value: p,
526
- onChange: (u) => i([t, parseFloat(u.target.value) || 0]),
527
- className: `${M} mapui:w-20`,
734
+ value: r,
735
+ onChange: (n) => t([i, parseFloat(n.target.value) || 0]),
736
+ className: `${z} mapui:w-20`,
528
737
  "aria-label": "Y",
529
738
  placeholder: "Y"
530
739
  }
531
740
  )
532
741
  ] });
533
742
  }
534
- function Pe({
535
- value: a,
536
- onChange: i
743
+ function ta({
744
+ value: e,
745
+ onChange: t
537
746
  }) {
538
- const t = a ?? 1;
747
+ const i = e ?? 1;
539
748
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
540
- /* @__PURE__ */ e(
749
+ /* @__PURE__ */ a(
541
750
  "input",
542
751
  {
543
752
  type: "range",
544
753
  min: 0,
545
754
  max: 1,
546
755
  step: 0.01,
547
- value: t,
548
- onChange: (p) => i(parseFloat(p.target.value)),
756
+ value: i,
757
+ onChange: (r) => t(parseFloat(r.target.value)),
549
758
  className: "mapui:flex-1"
550
759
  }
551
760
  ),
552
- /* @__PURE__ */ e("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children: t.toFixed(2) })
761
+ /* @__PURE__ */ a("span", { className: "mapui:w-8 mapui:text-right mapui:text-xs mapui:text-gray-600", children: i.toFixed(2) })
553
762
  ] });
554
763
  }
555
- function te({
556
- def: a,
557
- value: i,
558
- onChange: t,
559
- availableIcons: p
764
+ function fe({
765
+ def: e,
766
+ value: t,
767
+ onChange: i,
768
+ availableIcons: r,
769
+ availableProperties: n,
770
+ onFetchDistinctValues: o
560
771
  }) {
561
- var u, n;
562
- switch (a.widget) {
563
- case "color":
564
- return /* @__PURE__ */ e(
565
- fe,
566
- {
567
- value: i ?? "#000000",
568
- onChange: t,
569
- label: a.label
570
- }
571
- );
772
+ var p, b;
773
+ switch (e.widget) {
774
+ case "color": {
775
+ const m = Array.isArray(t), w = m ? t[t.length - 1] ?? "#000000" : "#000000";
776
+ return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1 mapui:w-full", children: [
777
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:items-center mapui:justify-end", children: /* @__PURE__ */ a(
778
+ "button",
779
+ {
780
+ type: "button",
781
+ title: m ? "Switch to static color" : "Switch to data-driven color",
782
+ onClick: () => {
783
+ i(m ? w : ["match", ["get", ""], w]);
784
+ },
785
+ className: [
786
+ "mapui:cursor-pointer mapui:rounded mapui:border mapui:px-1.5 mapui:py-0.5 mapui:font-mono mapui:text-xs mapui:outline-none",
787
+ "focus:mapui:ring-1 focus:mapui:ring-blue-400",
788
+ m ? "mapui:border-blue-400 mapui:bg-blue-50 mapui:text-blue-700" : "mapui:border-gray-300 mapui:bg-white mapui:text-gray-500 hover:mapui:border-blue-400 hover:mapui:text-blue-600"
789
+ ].join(" "),
790
+ children: "fx"
791
+ }
792
+ ) }),
793
+ m ? /* @__PURE__ */ a(
794
+ ea,
795
+ {
796
+ value: t,
797
+ onChange: (d) => i(d),
798
+ availableProperties: n,
799
+ onFetchDistinctValues: o
800
+ }
801
+ ) : /* @__PURE__ */ a(
802
+ Y,
803
+ {
804
+ value: t ?? "#000000",
805
+ onChange: i,
806
+ label: e.label
807
+ }
808
+ )
809
+ ] });
810
+ }
572
811
  case "opacity":
573
- return /* @__PURE__ */ e(
574
- Pe,
812
+ return /* @__PURE__ */ a(
813
+ ta,
575
814
  {
576
- value: i,
577
- onChange: t
815
+ value: t,
816
+ onChange: i
578
817
  }
579
818
  );
580
819
  case "number":
581
- return /* @__PURE__ */ e(
820
+ return /* @__PURE__ */ a(
582
821
  "input",
583
822
  {
584
823
  type: "number",
585
- min: a.min,
586
- max: a.max,
587
- step: a.step ?? 1,
588
- value: i ?? a.min ?? 0,
589
- onChange: (r) => t(parseFloat(r.target.value) || 0),
590
- className: M
824
+ min: e.min,
825
+ max: e.max,
826
+ step: e.step ?? 1,
827
+ value: t ?? e.min ?? 0,
828
+ onChange: (m) => i(parseFloat(m.target.value) || 0),
829
+ className: z
591
830
  }
592
831
  );
593
832
  case "boolean":
594
- return /* @__PURE__ */ e(
833
+ return /* @__PURE__ */ a(
595
834
  "input",
596
835
  {
597
836
  type: "checkbox",
598
- checked: i ?? !1,
599
- onChange: (r) => t(r.target.checked),
837
+ checked: t ?? !1,
838
+ onChange: (m) => i(m.target.checked),
600
839
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
601
840
  }
602
841
  );
603
842
  case "enum":
604
- return /* @__PURE__ */ e(
843
+ return /* @__PURE__ */ a(
605
844
  "select",
606
845
  {
607
- value: i ?? ((u = a.options) == null ? void 0 : u[0]) ?? "",
608
- onChange: (r) => t(r.target.value),
609
- className: M,
610
- children: (n = a.options) == null ? void 0 : n.map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
846
+ value: t ?? ((p = e.options) == null ? void 0 : p[0]) ?? "",
847
+ onChange: (m) => i(m.target.value),
848
+ className: z,
849
+ children: (b = e.options) == null ? void 0 : b.map((m) => /* @__PURE__ */ a("option", { value: m, children: m }, m))
611
850
  }
612
851
  );
613
852
  case "translate":
614
- return /* @__PURE__ */ e(
615
- Me,
853
+ return /* @__PURE__ */ a(
854
+ aa,
616
855
  {
617
- value: i,
618
- onChange: t
856
+ value: t,
857
+ onChange: i
619
858
  }
620
859
  );
621
860
  case "dasharray":
622
861
  case "stringArray": {
623
- const r = i, m = r ? r.join(", ") : "";
624
- return /* @__PURE__ */ e(
862
+ const m = t, w = m ? m.join(", ") : "";
863
+ return /* @__PURE__ */ a(
625
864
  "input",
626
865
  {
627
866
  type: "text",
628
- value: m,
867
+ value: w,
629
868
  onChange: (d) => {
630
869
  const f = d.target.value.trim();
631
870
  if (!f) {
632
- t(void 0);
871
+ i(void 0);
633
872
  return;
634
873
  }
635
- if (a.widget === "dasharray") {
636
- const s = f.split(",").map((g) => parseFloat(g.trim())).filter((g) => !isNaN(g));
637
- t(s.length > 0 ? s : void 0);
874
+ if (e.widget === "dasharray") {
875
+ const c = f.split(",").map((u) => parseFloat(u.trim())).filter((u) => !isNaN(u));
876
+ i(c.length > 0 ? c : void 0);
638
877
  } else {
639
- const s = f.split(",").map((g) => g.trim()).filter(Boolean);
640
- t(s.length > 0 ? s : void 0);
878
+ const c = f.split(",").map((u) => u.trim()).filter(Boolean);
879
+ i(c.length > 0 ? c : void 0);
641
880
  }
642
881
  },
643
- placeholder: a.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
644
- className: M
882
+ placeholder: e.widget === "dasharray" ? "e.g. 2, 4" : "comma-separated",
883
+ className: z
645
884
  }
646
885
  );
647
886
  }
648
887
  case "text":
649
- return /* @__PURE__ */ e(
888
+ return /* @__PURE__ */ a(
650
889
  "input",
651
890
  {
652
891
  type: "text",
653
- value: i ?? "",
654
- onChange: (r) => t(r.target.value || void 0),
655
- className: M
892
+ value: t ?? "",
893
+ onChange: (m) => i(m.target.value || void 0),
894
+ className: z
656
895
  }
657
896
  );
658
897
  case "icon-image":
659
- return /* @__PURE__ */ e(
660
- Oe,
898
+ return /* @__PURE__ */ a(
899
+ Je,
661
900
  {
662
- value: i ?? "",
663
- onChange: (r) => t(r ?? void 0),
664
- availableIcons: p
901
+ value: t ?? "",
902
+ onChange: (m) => i(m ?? void 0),
903
+ availableIcons: r
665
904
  }
666
905
  );
667
906
  default:
668
907
  return null;
669
908
  }
670
909
  }
671
- function je({ def: a, value: i, onChange: t, availableIcons: p }) {
672
- const u = a.enableDefault !== void 0, n = i !== void 0;
673
- if (u && a.widget === "boolean") {
674
- const r = !a.enableDefault;
675
- return /* @__PURE__ */ e(N, { label: a.label, description: a.description, children: /* @__PURE__ */ e(
910
+ function ia({ def: e, value: t, onChange: i, availableIcons: r, availableProperties: n, onFetchDistinctValues: o }) {
911
+ const p = e.enableDefault !== void 0, b = t !== void 0;
912
+ if (p && e.widget === "boolean") {
913
+ const m = !e.enableDefault;
914
+ return /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
676
915
  "input",
677
916
  {
678
917
  type: "checkbox",
679
- checked: i === r,
680
- onChange: (m) => {
681
- t(a.key, m.target.checked ? r : void 0);
918
+ checked: t === m,
919
+ onChange: (w) => {
920
+ i(e.key, w.target.checked ? m : void 0);
682
921
  },
683
922
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
684
923
  }
685
924
  ) });
686
925
  }
687
- return u ? /* @__PURE__ */ e(N, { label: a.label, description: a.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
688
- /* @__PURE__ */ e(
926
+ return p ? /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
927
+ /* @__PURE__ */ a(
689
928
  "input",
690
929
  {
691
930
  type: "checkbox",
692
- checked: n,
693
- onChange: (r) => {
694
- t(a.key, r.target.checked ? a.enableDefault : void 0);
931
+ checked: b,
932
+ onChange: (m) => {
933
+ i(e.key, m.target.checked ? e.enableDefault : void 0);
695
934
  },
696
935
  className: "mapui:h-4 mapui:w-4 mapui:shrink-0 mapui:accent-blue-600"
697
936
  }
698
937
  ),
699
- n && /* @__PURE__ */ e(
700
- te,
938
+ b && /* @__PURE__ */ a(
939
+ fe,
701
940
  {
702
- def: a,
703
- value: i,
704
- onChange: (r) => t(a.key, r),
705
- availableIcons: p
941
+ def: e,
942
+ value: t,
943
+ onChange: (m) => i(e.key, m),
944
+ availableIcons: r,
945
+ availableProperties: n,
946
+ onFetchDistinctValues: o
706
947
  }
707
948
  )
708
- ] }) }) : /* @__PURE__ */ e(N, { label: a.label, description: a.description, children: /* @__PURE__ */ e(te, { def: a, value: i, onChange: (r) => t(a.key, r), availableIcons: p }) });
949
+ ] }) }) : /* @__PURE__ */ a(S, { label: e.label, description: e.description, children: /* @__PURE__ */ a(
950
+ fe,
951
+ {
952
+ def: e,
953
+ value: t,
954
+ onChange: (m) => i(e.key, m),
955
+ availableIcons: r,
956
+ availableProperties: n,
957
+ onFetchDistinctValues: o
958
+ }
959
+ ) });
709
960
  }
710
- function re({
711
- title: a,
712
- properties: i,
713
- values: t,
714
- onChange: p,
715
- defaultOpen: u = !1,
716
- availableIcons: n
961
+ function xe({
962
+ title: e,
963
+ properties: t,
964
+ values: i,
965
+ onChange: r,
966
+ defaultOpen: n = !1,
967
+ availableIcons: o,
968
+ availableProperties: p,
969
+ onFetchDistinctValues: b
717
970
  }) {
718
- const r = i.filter(
719
- (m) => m.enableDefault !== void 0 && t[m.key] !== void 0
971
+ const m = t.filter(
972
+ (w) => w.enableDefault !== void 0 && i[w.key] !== void 0
720
973
  ).length;
721
- return /* @__PURE__ */ e(q, { title: a, defaultOpen: u, badge: r || void 0, children: /* @__PURE__ */ e("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: i.map((m) => /* @__PURE__ */ e(je, { def: m, value: t[m.key], onChange: p, availableIcons: n }, m.key)) }) });
974
+ return /* @__PURE__ */ a(_, { title: e, defaultOpen: n, badge: m || void 0, children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: t.map((w) => /* @__PURE__ */ a(
975
+ ia,
976
+ {
977
+ def: w,
978
+ value: i[w.key],
979
+ onChange: r,
980
+ availableIcons: o,
981
+ availableProperties: p,
982
+ onFetchDistinctValues: b
983
+ },
984
+ w.key
985
+ )) }) });
986
+ }
987
+ function G(e) {
988
+ return Array.isArray(e);
989
+ }
990
+ function ra(e) {
991
+ return e[0] === "match" ? "match" : e[0] === "interpolate" ? "interpolate" : null;
992
+ }
993
+ function Oe(e) {
994
+ if (e[0] === "match") {
995
+ const t = [];
996
+ for (let r = 3; r < e.length; r += 2)
997
+ typeof e[r] == "string" && t.push(e[r]);
998
+ const i = e[e.length - 1];
999
+ return typeof i == "string" && t.push(i), t;
1000
+ }
1001
+ if (e[0] === "interpolate") {
1002
+ const t = [];
1003
+ for (let i = 4; i < e.length; i += 2)
1004
+ typeof e[i] == "string" && t.push(e[i]);
1005
+ return t;
1006
+ }
1007
+ return [];
1008
+ }
1009
+ function la(e) {
1010
+ if (e[0] === "match") {
1011
+ const t = [];
1012
+ for (let r = 2; r < e.length - 1; r += 2) {
1013
+ const n = String(e[r]), o = e[r + 1];
1014
+ typeof o == "string" && t.push({ label: n, color: o });
1015
+ }
1016
+ const i = e[e.length - 1];
1017
+ return typeof i == "string" && t.push({ label: "Other", color: i }), t;
1018
+ }
1019
+ if (e[0] === "interpolate") {
1020
+ const t = [];
1021
+ for (let i = 3; i < e.length; i += 2) {
1022
+ const r = String(e[i]), n = e[i + 1];
1023
+ typeof n == "string" && t.push({ label: r, color: n });
1024
+ }
1025
+ return t;
1026
+ }
1027
+ return [];
1028
+ }
1029
+ function na(e) {
1030
+ const t = e[0] === "match" ? e[1] : e[0] === "interpolate" ? e[2] : null;
1031
+ return Array.isArray(t) && t[0] === "get" && typeof t[1] == "string" ? t[1] : null;
1032
+ }
1033
+ function pa(e) {
1034
+ switch (e.type) {
1035
+ case "fill":
1036
+ return e.paint["fill-color"] ?? "#000000";
1037
+ case "line":
1038
+ return e.paint["line-color"] ?? "#000000";
1039
+ case "circle":
1040
+ return e.paint["circle-color"] ?? "#000000";
1041
+ case "symbol":
1042
+ return e.paint["text-color"] ?? e.paint["icon-color"] ?? "#000000";
1043
+ }
722
1044
  }
723
- function Re({ style: a }) {
724
- return a.type === "fill" ? /* @__PURE__ */ e(
1045
+ function oa(e) {
1046
+ switch (e.type) {
1047
+ case "fill":
1048
+ return "square";
1049
+ case "line":
1050
+ return "line";
1051
+ case "circle":
1052
+ case "symbol":
1053
+ return "circle";
1054
+ }
1055
+ }
1056
+ function ie({ expr: e, height: t }) {
1057
+ const i = Oe(e);
1058
+ if (i.length === 0)
1059
+ return /* @__PURE__ */ a(
1060
+ "div",
1061
+ {
1062
+ style: { width: "100%", height: t ?? 32, background: "#e5e7eb", borderRadius: 4 },
1063
+ title: "Expression (no preview)"
1064
+ }
1065
+ );
1066
+ const r = e[0] === "interpolate", n = r ? `linear-gradient(to right, ${i.join(", ")})` : i.map((o, p) => `${o} ${p / i.length * 100}% ${(p + 1) / i.length * 100}%`).join(", ");
1067
+ return /* @__PURE__ */ a(
725
1068
  "div",
726
1069
  {
727
- className: "mapui:h-8 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200",
728
1070
  style: {
729
- backgroundColor: a.paint["fill-color"],
730
- opacity: a.paint["fill-opacity"],
731
- outline: a.paint["fill-outline-color"] ? `2px solid ${a.paint["fill-outline-color"]}` : void 0
1071
+ width: "100%",
1072
+ height: t ?? 32,
1073
+ background: r ? n : `linear-gradient(to right, ${n})`,
1074
+ borderRadius: 4
732
1075
  },
733
- "aria-label": "Style preview"
1076
+ title: "Data-driven color expression"
734
1077
  }
735
- ) : a.type === "line" ? /* @__PURE__ */ e(
736
- "div",
737
- {
738
- className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:rounded mapui:border mapui:border-gray-200 mapui:px-2",
739
- "aria-label": "Style preview",
740
- children: /* @__PURE__ */ e(
741
- "div",
742
- {
743
- style: {
744
- width: "100%",
745
- height: a.paint["line-width"],
746
- backgroundColor: a.paint["line-color"],
747
- opacity: a.paint["line-opacity"]
1078
+ );
1079
+ }
1080
+ function we(e, t) {
1081
+ return typeof e == "string" ? e : G(e) ? Oe(e)[0] ?? t : t;
1082
+ }
1083
+ function ua({ style: e }) {
1084
+ if (e.type === "fill") {
1085
+ const r = e.paint["fill-color"];
1086
+ return /* @__PURE__ */ a(
1087
+ "div",
1088
+ {
1089
+ className: "mapui:h-8 mapui:w-full mapui:rounded mapui:border mapui:border-gray-200 mapui:overflow-hidden",
1090
+ "aria-label": "Style preview",
1091
+ children: G(r) ? /* @__PURE__ */ a(ie, { expr: r, height: 32 }) : /* @__PURE__ */ a(
1092
+ "div",
1093
+ {
1094
+ style: {
1095
+ width: "100%",
1096
+ height: "100%",
1097
+ backgroundColor: r,
1098
+ opacity: e.paint["fill-opacity"],
1099
+ outline: e.paint["fill-outline-color"] && !G(e.paint["fill-outline-color"]) ? `2px solid ${e.paint["fill-outline-color"]}` : void 0
1100
+ }
748
1101
  }
749
- }
750
- )
751
- }
752
- ) : a.type === "circle" ? /* @__PURE__ */ e(
753
- "div",
754
- {
755
- className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
756
- "aria-label": "Style preview",
757
- children: /* @__PURE__ */ e(
758
- "div",
759
- {
760
- style: {
761
- width: a.paint["circle-radius"] * 2,
762
- height: a.paint["circle-radius"] * 2,
763
- backgroundColor: a.paint["circle-color"],
764
- opacity: a.paint["circle-opacity"],
765
- borderRadius: "50%",
766
- border: a.paint["circle-stroke-color"] ? `${a.paint["circle-stroke-width"] ?? 1}px solid ${a.paint["circle-stroke-color"]}` : void 0
1102
+ )
1103
+ }
1104
+ );
1105
+ }
1106
+ if (e.type === "line") {
1107
+ const r = e.paint["line-color"];
1108
+ return /* @__PURE__ */ a(
1109
+ "div",
1110
+ {
1111
+ className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:rounded mapui:border mapui:border-gray-200 mapui:px-2",
1112
+ "aria-label": "Style preview",
1113
+ children: G(r) ? /* @__PURE__ */ a(ie, { expr: r, height: e.paint["line-width"] }) : /* @__PURE__ */ a(
1114
+ "div",
1115
+ {
1116
+ style: {
1117
+ width: "100%",
1118
+ height: e.paint["line-width"],
1119
+ backgroundColor: r,
1120
+ opacity: e.paint["line-opacity"]
1121
+ }
767
1122
  }
768
- }
769
- )
770
- }
771
- ) : /* @__PURE__ */ e(
1123
+ )
1124
+ }
1125
+ );
1126
+ }
1127
+ if (e.type === "circle") {
1128
+ const r = e.paint["circle-color"], n = e.paint["circle-radius"] * 2;
1129
+ return /* @__PURE__ */ a(
1130
+ "div",
1131
+ {
1132
+ className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
1133
+ "aria-label": "Style preview",
1134
+ children: G(r) ? /* @__PURE__ */ a("div", { style: { width: n, height: n, borderRadius: "50%", overflow: "hidden" }, children: /* @__PURE__ */ a(ie, { expr: r, height: n }) }) : /* @__PURE__ */ a(
1135
+ "div",
1136
+ {
1137
+ style: {
1138
+ width: n,
1139
+ height: n,
1140
+ backgroundColor: r,
1141
+ opacity: e.paint["circle-opacity"],
1142
+ borderRadius: "50%",
1143
+ border: e.paint["circle-stroke-color"] && !G(e.paint["circle-stroke-color"]) ? `${e.paint["circle-stroke-width"] ?? 1}px solid ${e.paint["circle-stroke-color"]}` : void 0
1144
+ }
1145
+ }
1146
+ )
1147
+ }
1148
+ );
1149
+ }
1150
+ const t = we(e.paint["text-color"], "#333333"), i = we(e.paint["icon-color"], "#333333");
1151
+ return /* @__PURE__ */ a(
772
1152
  "div",
773
1153
  {
774
1154
  className: "mapui:flex mapui:h-8 mapui:w-full mapui:items-center mapui:justify-center mapui:rounded mapui:border mapui:border-gray-200",
775
1155
  "aria-label": "Style preview",
776
- children: /* @__PURE__ */ e(
1156
+ children: /* @__PURE__ */ a(
777
1157
  "span",
778
1158
  {
779
1159
  style: {
780
- color: a.paint["text-color"] ?? a.paint["icon-color"] ?? "#333333",
1160
+ color: t ?? i ?? "#333333",
781
1161
  fontSize: "1.1rem",
782
1162
  fontWeight: 600
783
1163
  },
@@ -787,7 +1167,7 @@ function Re({ style: a }) {
787
1167
  }
788
1168
  );
789
1169
  }
790
- const $e = [
1170
+ const ma = [
791
1171
  // Appearance (paint)
792
1172
  { key: "fill-color", label: "Fill Color", widget: "color", group: "Appearance", category: "paint" },
793
1173
  { key: "fill-opacity", label: "Fill Opacity", widget: "opacity", group: "Appearance", category: "paint" },
@@ -799,7 +1179,7 @@ const $e = [
799
1179
  { 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.' },
800
1180
  // Sorting (layout)
801
1181
  { 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." }
802
- ], Be = [
1182
+ ], sa = [
803
1183
  // Appearance (paint)
804
1184
  { key: "line-color", label: "Line Color", widget: "color", group: "Appearance", category: "paint" },
805
1185
  { key: "line-width", label: "Line Width", widget: "number", group: "Appearance", category: "paint", min: 0, step: 0.5 },
@@ -820,7 +1200,7 @@ const $e = [
820
1200
  { 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.' },
821
1201
  // Sorting (layout)
822
1202
  { 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." }
823
- ], Ue = [
1203
+ ], ca = [
824
1204
  // Appearance (paint)
825
1205
  { key: "circle-color", label: "Circle Color", widget: "color", group: "Appearance", category: "paint" },
826
1206
  { key: "circle-radius", label: "Radius", widget: "number", group: "Appearance", category: "paint", min: 0, step: 1 },
@@ -838,7 +1218,7 @@ const $e = [
838
1218
  { 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).' },
839
1219
  // Sorting (layout)
840
1220
  { 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." }
841
- ], qe = [
1221
+ ], da = [
842
1222
  // Icon Appearance (paint)
843
1223
  { key: "icon-color", label: "Icon Color", widget: "color", group: "Icon Appearance", category: "paint", enableDefault: "#000000" },
844
1224
  { key: "icon-opacity", label: "Icon Opacity", widget: "opacity", group: "Icon Appearance", category: "paint", enableDefault: 1 },
@@ -887,222 +1267,346 @@ const $e = [
887
1267
  { 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." },
888
1268
  { 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." },
889
1269
  { 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.' }
890
- ], We = {
891
- fill: $e,
892
- line: Be,
893
- circle: Ue,
894
- symbol: qe
1270
+ ], ha = {
1271
+ fill: ma,
1272
+ line: sa,
1273
+ circle: ca,
1274
+ symbol: da
895
1275
  };
896
- function ze(a) {
897
- return We[a] ?? [];
1276
+ function ga(e) {
1277
+ return ha[e] ?? [];
898
1278
  }
899
- function le(a) {
900
- const i = {};
901
- for (const t of a)
902
- i[t.group] || (i[t.group] = []), i[t.group].push(t);
903
- return i;
1279
+ function ve(e) {
1280
+ const t = {};
1281
+ for (const i of e)
1282
+ t[i.group] || (t[i.group] = []), t[i.group].push(i);
1283
+ return t;
904
1284
  }
905
- const Q = {
1285
+ const me = {
906
1286
  type: "fill",
907
1287
  paint: { "fill-color": "#4a90d9", "fill-opacity": 0.6, "fill-outline-color": "transparent", "fill-antialias": !0 }
908
- }, xe = {
1288
+ }, je = {
909
1289
  type: "line",
910
1290
  paint: { "line-color": "#2980b9", "line-width": 2, "line-opacity": 1 }
911
- }, we = {
1291
+ }, $e = {
912
1292
  type: "circle",
913
1293
  paint: { "circle-color": "#e74c3c", "circle-radius": 5, "circle-opacity": 0.9 }
914
- }, ve = {
1294
+ }, Re = {
915
1295
  type: "symbol",
916
1296
  paint: { "text-color": "#333333" },
917
1297
  layout: { "text-field": "{name}", "text-size": 14 }
918
- }, Ve = {
1298
+ }, ba = {
919
1299
  layout: { "icon-image": "" }
920
1300
  };
921
- function pe(a) {
922
- if (a.type !== "symbol") return "text";
923
- const i = a.layout ?? {}, t = "icon-image" in i, p = "text-field" in i;
924
- return t && p ? "both" : t ? "icon" : "text";
1301
+ function Ne(e) {
1302
+ if (e.type !== "symbol") return "text";
1303
+ const t = e.layout ?? {}, i = "icon-image" in t, r = "text-field" in t;
1304
+ return i && r ? "both" : i ? "icon" : "text";
925
1305
  }
926
- const Ge = "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 = {
1306
+ const ya = "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", K = {
927
1307
  fill: "Fill",
928
1308
  line: "Line",
929
1309
  circle: "Circle",
930
1310
  symbol: "Symbol"
931
- }, Ye = ["text", "icon", "both"];
932
- function Xe({ value: a, onChange: i, suggestedType: t, availableIcons: p }) {
933
- const [u, n] = L(() => pe(a));
934
- W(() => {
935
- n(pe(a));
936
- }, [a.type]);
937
- const r = (y) => {
938
- i(y === "fill" ? Q : y === "line" ? xe : y === "circle" ? we : ve);
939
- }, m = (y) => {
940
- if (y === u) return;
941
- const w = a.paint ?? {}, I = a.layout ?? {};
942
- let k = { ...w }, C = { ...I };
943
- y === "icon" ? (k = Object.fromEntries(Object.entries(k).filter(([A]) => !A.startsWith("text-"))), C = Object.fromEntries(Object.entries(C).filter(([A]) => !A.startsWith("text-"))), "icon-image" in C || (C["icon-image"] = Ve.layout["icon-image"])) : y === "text" && (k = Object.fromEntries(Object.entries(k).filter(([A]) => !A.startsWith("icon-"))), C = Object.fromEntries(Object.entries(C).filter(([A]) => !A.startsWith("icon-"))), "text-field" in C || (C["text-field"] = "{name}"), "text-size" in C || (C["text-size"] = 14), "text-color" in k || (k["text-color"] = "#333333")), n(y), i({
944
- ...a,
945
- paint: k,
946
- layout: Object.keys(C).length > 0 ? C : void 0
1311
+ }, fa = ["text", "icon", "both"];
1312
+ function xa({ value: e, onChange: t, suggestedType: i, suggestedTypes: r, availableIcons: n, availableProperties: o, onFetchDistinctValues: p }) {
1313
+ const b = r ?? (i ? [i] : []), [m, w] = L(() => Ne(e));
1314
+ X(() => {
1315
+ w(Ne(e));
1316
+ }, [e.type]);
1317
+ const d = (y) => {
1318
+ t(y === "fill" ? me : y === "line" ? je : y === "circle" ? $e : Re);
1319
+ }, f = (y) => {
1320
+ if (y === m) return;
1321
+ const F = e.paint ?? {}, M = e.layout ?? {};
1322
+ let g = { ...F }, N = { ...M };
1323
+ y === "icon" ? (g = Object.fromEntries(Object.entries(g).filter(([O]) => !O.startsWith("text-"))), N = Object.fromEntries(Object.entries(N).filter(([O]) => !O.startsWith("text-"))), "icon-image" in N || (N["icon-image"] = ba.layout["icon-image"])) : y === "text" && (g = Object.fromEntries(Object.entries(g).filter(([O]) => !O.startsWith("icon-"))), N = Object.fromEntries(Object.entries(N).filter(([O]) => !O.startsWith("icon-"))), "text-field" in N || (N["text-field"] = "{name}"), "text-size" in N || (N["text-size"] = 14), "text-color" in g || (g["text-color"] = "#333333")), w(y), t({
1324
+ ...e,
1325
+ paint: g,
1326
+ layout: Object.keys(N).length > 0 ? N : void 0
947
1327
  });
948
- }, d = (y, w) => {
949
- const I = { ...a.paint, [y]: w };
950
- for (const k of Object.keys(I))
951
- I[k] === void 0 && delete I[k];
952
- i({ ...a, paint: I });
953
- }, f = (y, w) => {
954
- const k = { ...a.layout ?? {}, [y]: w };
955
- for (const C of Object.keys(k))
956
- k[C] === void 0 && delete k[C];
957
- i({
958
- ...a,
959
- layout: Object.keys(k).length > 0 ? k : void 0
1328
+ }, c = (y, F) => {
1329
+ const M = { ...e.paint, [y]: F };
1330
+ for (const g of Object.keys(M))
1331
+ M[g] === void 0 && delete M[g];
1332
+ t({ ...e, paint: M });
1333
+ }, u = (y, F) => {
1334
+ const g = { ...e.layout ?? {}, [y]: F };
1335
+ for (const N of Object.keys(g))
1336
+ g[N] === void 0 && delete g[N];
1337
+ t({
1338
+ ...e,
1339
+ layout: Object.keys(g).length > 0 ? g : void 0
960
1340
  });
961
1341
  };
962
- let s = ze(a.type);
963
- a.type === "symbol" && (u === "text" ? s = s.filter((y) => !y.key.startsWith("icon-")) : u === "icon" && (s = s.filter((y) => !y.key.startsWith("text-"))));
964
- const g = s.filter((y) => y.category === "paint"), D = s.filter((y) => y.category === "layout"), o = le(g), c = le(D), x = a.paint, v = a.layout ?? {}, T = Object.keys(o), b = Object.keys(c);
1342
+ let s = ga(e.type);
1343
+ e.type === "symbol" && (m === "text" ? s = s.filter((y) => !y.key.startsWith("icon-")) : m === "icon" && (s = s.filter((y) => !y.key.startsWith("text-"))));
1344
+ const v = s.filter((y) => y.category === "paint"), k = s.filter((y) => y.category === "layout"), D = ve(v), x = ve(k), $ = e.paint, C = e.layout ?? {}, P = Object.keys(D), E = Object.keys(x);
965
1345
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
966
- t && t !== a.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: [
1346
+ b.length > 0 && !b.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: [
967
1347
  /* @__PURE__ */ l("span", { children: [
968
- "Detected geometry suggests ",
969
- /* @__PURE__ */ e("strong", { children: t }),
970
- " style."
1348
+ "Detected geometry is suitable for",
1349
+ " ",
1350
+ b.map((y, F) => /* @__PURE__ */ l("span", { children: [
1351
+ F > 0 && (F === b.length - 1 ? " or " : ", "),
1352
+ /* @__PURE__ */ a("strong", { children: K[y] })
1353
+ ] }, y)),
1354
+ " ",
1355
+ "style."
971
1356
  ] }),
972
- /* @__PURE__ */ e(
1357
+ /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-1", children: b.map((y) => /* @__PURE__ */ a(
973
1358
  "button",
974
1359
  {
975
1360
  type: "button",
976
- onClick: () => r(t),
1361
+ onClick: () => d(y),
977
1362
  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",
978
- children: "Apply"
979
- }
980
- )
1363
+ children: K[y]
1364
+ },
1365
+ y
1366
+ )) })
981
1367
  ] }),
982
- /* @__PURE__ */ e(N, { label: "Style Type", children: /* @__PURE__ */ e(
1368
+ /* @__PURE__ */ a(S, { label: "Style Type", children: /* @__PURE__ */ a(
983
1369
  "select",
984
1370
  {
985
- value: a.type,
986
- onChange: (y) => r(y.target.value),
987
- className: Ge,
988
- children: Object.keys(ue).map((y) => /* @__PURE__ */ e("option", { value: y, children: ue[y] }, y))
1371
+ value: e.type,
1372
+ onChange: (y) => d(y.target.value),
1373
+ className: ya,
1374
+ children: Object.keys(K).map((y) => /* @__PURE__ */ a("option", { value: y, children: K[y] }, y))
989
1375
  }
990
1376
  ) }),
991
- a.type === "symbol" && /* @__PURE__ */ e(N, { label: "Symbol Mode", children: /* @__PURE__ */ e("div", { className: "mapui:flex mapui:overflow-hidden mapui:rounded mapui:border mapui:border-gray-300", children: Ye.map((y) => /* @__PURE__ */ e(
1377
+ 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: fa.map((y) => /* @__PURE__ */ a(
992
1378
  "button",
993
1379
  {
994
1380
  type: "button",
995
- onClick: () => m(y),
1381
+ onClick: () => f(y),
996
1382
  className: [
997
1383
  "mapui:flex-1 mapui:cursor-pointer mapui:border-0 mapui:px-3 mapui:py-1 mapui:text-sm mapui:capitalize mapui:outline-none",
998
1384
  "focus:mapui:ring-1 focus:mapui:ring-inset focus:mapui:ring-blue-400",
999
- u === y ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
1385
+ m === y ? "mapui:bg-blue-500 mapui:text-white" : "mapui:bg-white mapui:text-gray-700 hover:mapui:bg-gray-50"
1000
1386
  ].join(" "),
1001
1387
  children: y === "both" ? "Both" : y.charAt(0).toUpperCase() + y.slice(1)
1002
1388
  },
1003
1389
  y
1004
1390
  )) }) }),
1005
1391
  /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-gray-100 mapui:p-2", children: [
1006
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
1007
- /* @__PURE__ */ e(Re, { style: a })
1392
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:text-gray-500", children: "Preview" }),
1393
+ /* @__PURE__ */ a(ua, { style: e })
1008
1394
  ] }),
1009
- b.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1010
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
1011
- b.map((y, w) => /* @__PURE__ */ e(
1012
- re,
1395
+ E.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1396
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Layout" }),
1397
+ E.map((y, F) => /* @__PURE__ */ a(
1398
+ xe,
1013
1399
  {
1014
1400
  title: y,
1015
- properties: c[y],
1016
- values: v,
1017
- onChange: f,
1018
- defaultOpen: w === 0,
1019
- availableIcons: p
1401
+ properties: x[y],
1402
+ values: C,
1403
+ onChange: u,
1404
+ defaultOpen: F === 0,
1405
+ availableIcons: n,
1406
+ availableProperties: o,
1407
+ onFetchDistinctValues: p
1020
1408
  },
1021
1409
  y
1022
1410
  ))
1023
1411
  ] }),
1024
- T.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1025
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
1026
- T.map((y) => /* @__PURE__ */ e(
1027
- re,
1412
+ P.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1413
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-xs mapui:font-medium mapui:uppercase mapui:tracking-wide mapui:text-gray-500", children: "Paint" }),
1414
+ P.map((y) => /* @__PURE__ */ a(
1415
+ xe,
1028
1416
  {
1029
1417
  title: y,
1030
- properties: o[y],
1031
- values: x,
1032
- onChange: d,
1418
+ properties: D[y],
1419
+ values: $,
1420
+ onChange: c,
1033
1421
  defaultOpen: !1,
1034
- availableIcons: p
1422
+ availableIcons: n,
1423
+ availableProperties: o,
1424
+ onFetchDistinctValues: p
1035
1425
  },
1036
1426
  y
1037
1427
  ))
1038
1428
  ] })
1039
1429
  ] });
1040
1430
  }
1041
- const ne = "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";
1042
- function _e({ value: a, onChange: i }) {
1431
+ const ke = "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";
1432
+ function wa({ value: e, onChange: t }) {
1043
1433
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1044
- /* @__PURE__ */ e(N, { label: "Label", children: /* @__PURE__ */ e(
1434
+ /* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
1045
1435
  "input",
1046
1436
  {
1047
1437
  type: "text",
1048
- value: a.label,
1049
- onChange: (t) => i({ ...a, label: t.target.value }),
1438
+ value: e.label,
1439
+ onChange: (i) => t({ ...e, label: i.target.value }),
1050
1440
  placeholder: "Legend entry label",
1051
- className: ne
1441
+ className: ke
1052
1442
  }
1053
1443
  ) }),
1054
- /* @__PURE__ */ e(N, { label: "Color", children: /* @__PURE__ */ e(
1055
- fe,
1444
+ /* @__PURE__ */ a(S, { label: "Color", children: /* @__PURE__ */ a(
1445
+ Y,
1056
1446
  {
1057
- value: a.color,
1058
- onChange: (t) => i({ ...a, color: t }),
1447
+ value: e.color,
1448
+ onChange: (i) => t({ ...e, color: i }),
1059
1449
  label: "Entry color"
1060
1450
  }
1061
1451
  ) }),
1062
- /* @__PURE__ */ e(N, { label: "Shape", children: /* @__PURE__ */ l(
1452
+ /* @__PURE__ */ a(S, { label: "Shape", children: /* @__PURE__ */ l(
1063
1453
  "select",
1064
1454
  {
1065
- value: a.shape ?? "square",
1066
- onChange: (t) => i({ ...a, shape: t.target.value }),
1067
- className: ne,
1455
+ value: e.shape ?? "square",
1456
+ onChange: (i) => t({ ...e, shape: i.target.value }),
1457
+ className: ke,
1068
1458
  children: [
1069
- /* @__PURE__ */ e("option", { value: "square", children: "Square" }),
1070
- /* @__PURE__ */ e("option", { value: "circle", children: "Circle" }),
1071
- /* @__PURE__ */ e("option", { value: "line", children: "Line" })
1459
+ /* @__PURE__ */ a("option", { value: "square", children: "Square" }),
1460
+ /* @__PURE__ */ a("option", { value: "circle", children: "Circle" }),
1461
+ /* @__PURE__ */ a("option", { value: "line", children: "Line" })
1072
1462
  ]
1073
1463
  }
1074
1464
  ) })
1075
1465
  ] });
1076
1466
  }
1077
- const oe = () => ({ label: "", color: "#4a90d9", shape: "square" });
1078
- function He({ value: a, onChange: i }) {
1079
- const t = (a == null ? void 0 : a.entries) ?? [], p = () => {
1080
- i({ entries: [...t, oe()] });
1081
- }, u = (m, d) => {
1082
- const f = t.map((s, g) => g === m ? d : s);
1083
- i({ entries: f });
1084
- }, n = (m) => {
1085
- const d = t.filter((f, s) => s !== m);
1086
- i(d.length > 0 ? { entries: d } : void 0);
1087
- }, r = (m) => {
1088
- i(m ? { entries: [oe()] } : void 0);
1467
+ const Ce = () => ({ label: "", color: "#4a90d9", shape: "square" }), re = 8, 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";
1468
+ function va({ value: e, onChange: t, style: i }) {
1469
+ const r = (e == null ? void 0 : e.entries) ?? [], n = (e == null ? void 0 : e.displayMode) ?? "simple", o = Pe(() => {
1470
+ if (!i) return null;
1471
+ const c = pa(i);
1472
+ if (!G(c)) return null;
1473
+ const u = ra(c);
1474
+ if (!u) return null;
1475
+ const s = oa(i);
1476
+ return {
1477
+ entries: la(c).map((k) => ({
1478
+ label: k.label,
1479
+ color: k.color,
1480
+ shape: s
1481
+ })),
1482
+ mode: u === "interpolate" ? "gradient" : "categorical",
1483
+ property: na(c)
1484
+ };
1485
+ }, [i]), p = () => {
1486
+ t({ ...e, entries: [...r, Ce()] });
1487
+ }, b = (c, u) => {
1488
+ const s = r.map((v, k) => k === c ? u : v);
1489
+ t({ ...e, entries: s });
1490
+ }, m = (c) => {
1491
+ const u = r.filter((s, v) => v !== c);
1492
+ t(u.length > 0 ? { ...e, entries: u } : void 0);
1493
+ }, w = (c) => {
1494
+ t(c ? { entries: [Ce()] } : void 0);
1495
+ }, d = () => {
1496
+ o && t({
1497
+ entries: o.entries,
1498
+ displayMode: o.mode,
1499
+ ...o.mode === "gradient" && o.property ? { gradientProperty: o.property } : {},
1500
+ ...o.mode === "categorical" ? { showLabelsCollapsed: !1 } : {}
1501
+ });
1502
+ }, f = (c) => {
1503
+ if (!e) return;
1504
+ const u = { ...e, displayMode: c };
1505
+ c !== "categorical" && delete u.showLabelsCollapsed, c !== "gradient" && delete u.gradientProperty, t(u);
1089
1506
  };
1090
1507
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1091
1508
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1092
- /* @__PURE__ */ e(
1509
+ /* @__PURE__ */ a(
1093
1510
  "input",
1094
1511
  {
1095
1512
  type: "checkbox",
1096
1513
  id: "legend-enabled",
1097
- checked: a !== void 0,
1098
- onChange: (m) => r(m.target.checked),
1514
+ checked: e !== void 0,
1515
+ onChange: (c) => w(c.target.checked),
1099
1516
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1100
1517
  }
1101
1518
  ),
1102
- /* @__PURE__ */ e("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
1519
+ /* @__PURE__ */ a("label", { htmlFor: "legend-enabled", className: "mapui:text-sm mapui:font-medium mapui:text-gray-700", children: "Enable Legend" })
1103
1520
  ] }),
1104
- a !== void 0 && /* @__PURE__ */ l(P, { children: [
1105
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: t.map((m, d) => /* @__PURE__ */ l(
1521
+ e === void 0 && o && o.entries.length > 0 && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
1522
+ /* @__PURE__ */ l("p", { className: "mapui:m-0 mapui:text-sm mapui:text-blue-800", children: [
1523
+ "This layer uses data-driven colors (",
1524
+ o.entries.length,
1525
+ " ",
1526
+ o.entries.length === 1 ? "category" : "categories",
1527
+ ")"
1528
+ ] }),
1529
+ /* @__PURE__ */ l("div", { className: "mapui:mt-2 mapui:flex mapui:flex-wrap mapui:items-center mapui:gap-1.5", children: [
1530
+ o.entries.slice(0, re).map((c, u) => /* @__PURE__ */ l(
1531
+ "div",
1532
+ {
1533
+ className: "mapui:flex mapui:items-center mapui:gap-1",
1534
+ title: c.label,
1535
+ children: [
1536
+ /* @__PURE__ */ a(
1537
+ "span",
1538
+ {
1539
+ className: "mapui:inline-block mapui:h-3 mapui:w-3 mapui:rounded-sm mapui:shrink-0",
1540
+ style: { backgroundColor: c.color }
1541
+ }
1542
+ ),
1543
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-blue-700 mapui:truncate mapui:max-w-16", children: c.label })
1544
+ ]
1545
+ },
1546
+ `${c.label}-${u}`
1547
+ )),
1548
+ o.entries.length > re && /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:text-blue-600", children: [
1549
+ "+",
1550
+ o.entries.length - re,
1551
+ " more"
1552
+ ] })
1553
+ ] }),
1554
+ /* @__PURE__ */ a(
1555
+ "button",
1556
+ {
1557
+ type: "button",
1558
+ onClick: d,
1559
+ 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",
1560
+ children: "Generate from Style"
1561
+ }
1562
+ )
1563
+ ] }),
1564
+ e !== void 0 && /* @__PURE__ */ l(B, { children: [
1565
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1566
+ /* @__PURE__ */ a("label", { htmlFor: "legend-display-mode", className: "mapui:text-sm mapui:text-gray-700", children: "Display Mode" }),
1567
+ /* @__PURE__ */ l(
1568
+ "select",
1569
+ {
1570
+ id: "legend-display-mode",
1571
+ value: n,
1572
+ onChange: (c) => f(c.target.value),
1573
+ className: Se,
1574
+ children: [
1575
+ /* @__PURE__ */ a("option", { value: "simple", children: "Simple" }),
1576
+ /* @__PURE__ */ a("option", { value: "categorical", children: "Categorical" }),
1577
+ /* @__PURE__ */ a("option", { value: "gradient", children: "Gradient" })
1578
+ ]
1579
+ }
1580
+ )
1581
+ ] }),
1582
+ n === "categorical" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1583
+ /* @__PURE__ */ a(
1584
+ "input",
1585
+ {
1586
+ type: "checkbox",
1587
+ id: "legend-show-labels-collapsed",
1588
+ checked: e.showLabelsCollapsed ?? !1,
1589
+ onChange: (c) => t({ ...e, showLabelsCollapsed: c.target.checked }),
1590
+ className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1591
+ }
1592
+ ),
1593
+ /* @__PURE__ */ a("label", { htmlFor: "legend-show-labels-collapsed", className: "mapui:text-sm mapui:text-gray-700", children: "Show labels in collapsed view" })
1594
+ ] }),
1595
+ n === "gradient" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1596
+ /* @__PURE__ */ a("label", { htmlFor: "legend-gradient-property", className: "mapui:text-sm mapui:text-gray-700", children: "Gradient Property" }),
1597
+ /* @__PURE__ */ a(
1598
+ "input",
1599
+ {
1600
+ type: "text",
1601
+ id: "legend-gradient-property",
1602
+ value: e.gradientProperty ?? "",
1603
+ onChange: (c) => t({ ...e, gradientProperty: c.target.value || void 0 }),
1604
+ placeholder: "e.g. POP_EST",
1605
+ className: Se
1606
+ }
1607
+ )
1608
+ ] }),
1609
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: r.map((c, u) => /* @__PURE__ */ l(
1106
1610
  "li",
1107
1611
  {
1108
1612
  className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:p-3",
@@ -1110,326 +1614,341 @@ function He({ value: a, onChange: i }) {
1110
1614
  /* @__PURE__ */ l("div", { className: "mapui:mb-2 mapui:flex mapui:items-center mapui:justify-between", children: [
1111
1615
  /* @__PURE__ */ l("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: [
1112
1616
  "Entry ",
1113
- d + 1
1617
+ u + 1
1114
1618
  ] }),
1115
- /* @__PURE__ */ e(
1619
+ /* @__PURE__ */ a(
1116
1620
  "button",
1117
1621
  {
1118
1622
  type: "button",
1119
- onClick: () => n(d),
1623
+ onClick: () => m(u),
1120
1624
  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",
1121
1625
  children: "Remove"
1122
1626
  }
1123
1627
  )
1124
1628
  ] }),
1125
- /* @__PURE__ */ e(
1126
- _e,
1629
+ /* @__PURE__ */ a(
1630
+ wa,
1127
1631
  {
1128
- value: m,
1129
- onChange: (f) => u(d, f)
1632
+ value: c,
1633
+ onChange: (s) => b(u, s)
1130
1634
  }
1131
1635
  )
1132
1636
  ]
1133
1637
  },
1134
- d
1638
+ u
1135
1639
  )) }),
1136
- /* @__PURE__ */ e(
1137
- "button",
1138
- {
1139
- type: "button",
1140
- onClick: p,
1141
- 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",
1142
- children: "+ Add Entry"
1143
- }
1144
- )
1640
+ /* @__PURE__ */ l("div", { className: "mapui:flex mapui:gap-2", children: [
1641
+ /* @__PURE__ */ a(
1642
+ "button",
1643
+ {
1644
+ type: "button",
1645
+ onClick: p,
1646
+ 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",
1647
+ children: "+ Add Entry"
1648
+ }
1649
+ ),
1650
+ o && o.entries.length > 0 && /* @__PURE__ */ l(
1651
+ "button",
1652
+ {
1653
+ type: "button",
1654
+ onClick: d,
1655
+ 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",
1656
+ children: [
1657
+ "Populate from Style (",
1658
+ o.entries.length,
1659
+ " entries)"
1660
+ ]
1661
+ }
1662
+ )
1663
+ ] })
1145
1664
  ] })
1146
1665
  ] });
1147
1666
  }
1148
- function me({
1149
- options: a,
1150
- onChange: i,
1151
- placeholder: t,
1152
- className: p
1667
+ function De({
1668
+ options: e,
1669
+ onChange: t,
1670
+ placeholder: i,
1671
+ className: r
1153
1672
  }) {
1154
- const [u, n] = L(() => (a == null ? void 0 : a.join(", ")) ?? "");
1155
- return W(() => {
1156
- n((a == null ? void 0 : a.join(", ")) ?? "");
1157
- }, [a == null ? void 0 : a.join(",")]), /* @__PURE__ */ e(
1673
+ const [n, o] = L(() => (e == null ? void 0 : e.join(", ")) ?? "");
1674
+ return X(() => {
1675
+ o((e == null ? void 0 : e.join(", ")) ?? "");
1676
+ }, [e == null ? void 0 : e.join(",")]), /* @__PURE__ */ a(
1158
1677
  "input",
1159
1678
  {
1160
1679
  type: "text",
1161
- value: u,
1162
- onChange: (m) => n(m.target.value),
1680
+ value: n,
1681
+ onChange: (b) => o(b.target.value),
1163
1682
  onBlur: () => {
1164
- const m = u.trim(), d = m ? m.split(",").map((f) => f.trim()).filter(Boolean) : void 0;
1165
- i(d), n((d == null ? void 0 : d.join(", ")) ?? "");
1683
+ const b = n.trim(), m = b ? b.split(",").map((w) => w.trim()).filter(Boolean) : void 0;
1684
+ t(m), o((m == null ? void 0 : m.join(", ")) ?? "");
1166
1685
  },
1167
- placeholder: t,
1168
- className: p
1686
+ placeholder: i,
1687
+ className: r
1169
1688
  }
1170
1689
  );
1171
1690
  }
1172
- const E = "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", Je = {
1691
+ const j = "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", Na = {
1173
1692
  text: { type: "text", property: "", label: "", autocomplete: !1 },
1174
1693
  number: { type: "number", property: "", label: "", inputMode: "input", operator: "eq" },
1175
1694
  datetime: { type: "datetime", property: "", label: "", range: !1 },
1176
1695
  select: { type: "select", property: "", label: "" }
1177
1696
  };
1178
- function Ke({ value: a, onChange: i, availableProperties: t }) {
1179
- const p = (r) => {
1180
- i({ ...Je[r], property: a.property, label: a.label });
1181
- }, u = (r) => i({ ...a, ...r }), n = t && t.length > 0;
1697
+ function ka({ value: e, onChange: t, availableProperties: i }) {
1698
+ const r = (p) => {
1699
+ t({ ...Na[p], property: e.property, label: e.label });
1700
+ }, n = (p) => t({ ...e, ...p }), o = i && i.length > 0;
1182
1701
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1183
- /* @__PURE__ */ e(N, { label: "Field Type", children: /* @__PURE__ */ l(
1702
+ /* @__PURE__ */ a(S, { label: "Field Type", children: /* @__PURE__ */ l(
1184
1703
  "select",
1185
1704
  {
1186
- value: a.type,
1187
- onChange: (r) => p(r.target.value),
1188
- className: E,
1705
+ value: e.type,
1706
+ onChange: (p) => r(p.target.value),
1707
+ className: j,
1189
1708
  children: [
1190
- /* @__PURE__ */ e("option", { value: "text", children: "Text" }),
1191
- /* @__PURE__ */ e("option", { value: "number", children: "Number" }),
1192
- /* @__PURE__ */ e("option", { value: "datetime", children: "Date/Time" }),
1193
- /* @__PURE__ */ e("option", { value: "select", children: "Select" })
1709
+ /* @__PURE__ */ a("option", { value: "text", children: "Text" }),
1710
+ /* @__PURE__ */ a("option", { value: "number", children: "Number" }),
1711
+ /* @__PURE__ */ a("option", { value: "datetime", children: "Date/Time" }),
1712
+ /* @__PURE__ */ a("option", { value: "select", children: "Select" })
1194
1713
  ]
1195
1714
  }
1196
1715
  ) }),
1197
- /* @__PURE__ */ e(N, { label: "Property", required: !0, children: n ? /* @__PURE__ */ l(
1716
+ /* @__PURE__ */ a(S, { label: "Property", required: !0, children: o ? /* @__PURE__ */ l(
1198
1717
  "select",
1199
1718
  {
1200
- value: a.property,
1201
- onChange: (r) => u({ property: r.target.value }),
1202
- className: E,
1719
+ value: e.property,
1720
+ onChange: (p) => n({ property: p.target.value }),
1721
+ className: j,
1203
1722
  children: [
1204
- /* @__PURE__ */ e("option", { value: "", children: "Select a property…" }),
1205
- t.map((r) => /* @__PURE__ */ e("option", { value: r.name, children: r.title ?? r.name }, r.name))
1723
+ /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
1724
+ i.map((p) => /* @__PURE__ */ a("option", { value: p.name, children: p.title ?? p.name }, p.name))
1206
1725
  ]
1207
1726
  }
1208
- ) : /* @__PURE__ */ e(
1727
+ ) : /* @__PURE__ */ a(
1209
1728
  "input",
1210
1729
  {
1211
1730
  type: "text",
1212
- value: a.property,
1213
- onChange: (r) => u({ property: r.target.value }),
1731
+ value: e.property,
1732
+ onChange: (p) => n({ property: p.target.value }),
1214
1733
  placeholder: "e.g. name",
1215
- className: E
1734
+ className: j
1216
1735
  }
1217
1736
  ) }),
1218
- /* @__PURE__ */ e(N, { label: "Label", children: /* @__PURE__ */ e(
1737
+ /* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
1219
1738
  "input",
1220
1739
  {
1221
1740
  type: "text",
1222
- value: a.label,
1223
- onChange: (r) => u({ label: r.target.value }),
1741
+ value: e.label,
1742
+ onChange: (p) => n({ label: p.target.value }),
1224
1743
  placeholder: "Display label",
1225
- className: E
1744
+ className: j
1226
1745
  }
1227
1746
  ) }),
1228
- /* @__PURE__ */ e(N, { label: "Placeholder", children: /* @__PURE__ */ e(
1747
+ /* @__PURE__ */ a(S, { label: "Placeholder", children: /* @__PURE__ */ a(
1229
1748
  "input",
1230
1749
  {
1231
1750
  type: "text",
1232
- value: a.placeholder ?? "",
1233
- onChange: (r) => u({ placeholder: r.target.value || void 0 }),
1751
+ value: e.placeholder ?? "",
1752
+ onChange: (p) => n({ placeholder: p.target.value || void 0 }),
1234
1753
  placeholder: "Input placeholder text",
1235
- className: E
1754
+ className: j
1236
1755
  }
1237
1756
  ) }),
1238
- a.type === "text" && /* @__PURE__ */ l(P, { children: [
1757
+ e.type === "text" && /* @__PURE__ */ l(B, { children: [
1239
1758
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1240
- /* @__PURE__ */ e(
1759
+ /* @__PURE__ */ a(
1241
1760
  "input",
1242
1761
  {
1243
1762
  type: "checkbox",
1244
1763
  id: "text-autocomplete",
1245
- checked: a.autocomplete ?? !1,
1246
- onChange: (r) => i({ ...a, autocomplete: r.target.checked }),
1764
+ checked: e.autocomplete ?? !1,
1765
+ onChange: (p) => t({ ...e, autocomplete: p.target.checked }),
1247
1766
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1248
1767
  }
1249
1768
  ),
1250
- /* @__PURE__ */ e("label", { htmlFor: "text-autocomplete", className: "mapui:text-sm mapui:text-gray-700", children: "Enable Autocomplete" })
1769
+ /* @__PURE__ */ a("label", { htmlFor: "text-autocomplete", className: "mapui:text-sm mapui:text-gray-700", children: "Enable Autocomplete" })
1251
1770
  ] }),
1252
1771
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1253
- /* @__PURE__ */ e(
1772
+ /* @__PURE__ */ a(
1254
1773
  "input",
1255
1774
  {
1256
1775
  type: "checkbox",
1257
1776
  id: "text-prefetch",
1258
- checked: a.prefetch ?? !1,
1259
- onChange: (r) => i({ ...a, prefetch: r.target.checked }),
1777
+ checked: e.prefetch ?? !1,
1778
+ onChange: (p) => t({ ...e, prefetch: p.target.checked }),
1260
1779
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1261
1780
  }
1262
1781
  ),
1263
- /* @__PURE__ */ e("label", { htmlFor: "text-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1782
+ /* @__PURE__ */ a("label", { htmlFor: "text-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1264
1783
  ] }),
1265
- /* @__PURE__ */ e(N, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ e(
1266
- me,
1784
+ /* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
1785
+ De,
1267
1786
  {
1268
- options: a.options,
1269
- onChange: (r) => i({ ...a, options: r }),
1787
+ options: e.options,
1788
+ onChange: (p) => t({ ...e, options: p }),
1270
1789
  placeholder: "option1, option2",
1271
- className: E
1790
+ className: j
1272
1791
  }
1273
1792
  ) })
1274
1793
  ] }),
1275
- a.type === "number" && /* @__PURE__ */ l(P, { children: [
1276
- /* @__PURE__ */ e(N, { label: "Input Mode", children: /* @__PURE__ */ l(
1794
+ e.type === "number" && /* @__PURE__ */ l(B, { children: [
1795
+ /* @__PURE__ */ a(S, { label: "Input Mode", children: /* @__PURE__ */ l(
1277
1796
  "select",
1278
1797
  {
1279
- value: a.inputMode ?? "input",
1280
- onChange: (r) => i({
1281
- ...a,
1282
- inputMode: r.target.value
1798
+ value: e.inputMode ?? "input",
1799
+ onChange: (p) => t({
1800
+ ...e,
1801
+ inputMode: p.target.value
1283
1802
  }),
1284
- className: E,
1803
+ className: j,
1285
1804
  children: [
1286
- /* @__PURE__ */ e("option", { value: "input", children: "Input" }),
1287
- /* @__PURE__ */ e("option", { value: "slider", children: "Slider" })
1805
+ /* @__PURE__ */ a("option", { value: "input", children: "Input" }),
1806
+ /* @__PURE__ */ a("option", { value: "slider", children: "Slider" })
1288
1807
  ]
1289
1808
  }
1290
1809
  ) }),
1291
- /* @__PURE__ */ e(N, { label: "Operator", children: /* @__PURE__ */ l(
1810
+ /* @__PURE__ */ a(S, { label: "Operator", children: /* @__PURE__ */ l(
1292
1811
  "select",
1293
1812
  {
1294
- value: a.operator ?? "eq",
1295
- onChange: (r) => i({
1296
- ...a,
1297
- operator: r.target.value
1813
+ value: e.operator ?? "eq",
1814
+ onChange: (p) => t({
1815
+ ...e,
1816
+ operator: p.target.value
1298
1817
  }),
1299
- className: E,
1818
+ className: j,
1300
1819
  children: [
1301
- /* @__PURE__ */ e("option", { value: "eq", children: "Equal (=)" }),
1302
- /* @__PURE__ */ e("option", { value: "gt", children: "Greater Than (>)" }),
1303
- /* @__PURE__ */ e("option", { value: "gte", children: "Greater or Equal (>=)" }),
1304
- /* @__PURE__ */ e("option", { value: "lt", children: "Less Than (<)" }),
1305
- /* @__PURE__ */ e("option", { value: "lte", children: "Less or Equal (<=)" }),
1306
- /* @__PURE__ */ e("option", { value: "between", children: "Between" })
1820
+ /* @__PURE__ */ a("option", { value: "eq", children: "Equal (=)" }),
1821
+ /* @__PURE__ */ a("option", { value: "gt", children: "Greater Than (>)" }),
1822
+ /* @__PURE__ */ a("option", { value: "gte", children: "Greater or Equal (>=)" }),
1823
+ /* @__PURE__ */ a("option", { value: "lt", children: "Less Than (<)" }),
1824
+ /* @__PURE__ */ a("option", { value: "lte", children: "Less or Equal (<=)" }),
1825
+ /* @__PURE__ */ a("option", { value: "between", children: "Between" })
1307
1826
  ]
1308
1827
  }
1309
1828
  ) }),
1310
1829
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-3 mapui:gap-2", children: [
1311
- /* @__PURE__ */ e(N, { label: "Min", children: /* @__PURE__ */ e(
1830
+ /* @__PURE__ */ a(S, { label: "Min", children: /* @__PURE__ */ a(
1312
1831
  "input",
1313
1832
  {
1314
1833
  type: "number",
1315
- value: a.min ?? "",
1316
- onChange: (r) => i({
1317
- ...a,
1318
- min: r.target.value ? parseFloat(r.target.value) : void 0
1834
+ value: e.min ?? "",
1835
+ onChange: (p) => t({
1836
+ ...e,
1837
+ min: p.target.value ? parseFloat(p.target.value) : void 0
1319
1838
  }),
1320
- className: E
1839
+ className: j
1321
1840
  }
1322
1841
  ) }),
1323
- /* @__PURE__ */ e(N, { label: "Max", children: /* @__PURE__ */ e(
1842
+ /* @__PURE__ */ a(S, { label: "Max", children: /* @__PURE__ */ a(
1324
1843
  "input",
1325
1844
  {
1326
1845
  type: "number",
1327
- value: a.max ?? "",
1328
- onChange: (r) => i({
1329
- ...a,
1330
- max: r.target.value ? parseFloat(r.target.value) : void 0
1846
+ value: e.max ?? "",
1847
+ onChange: (p) => t({
1848
+ ...e,
1849
+ max: p.target.value ? parseFloat(p.target.value) : void 0
1331
1850
  }),
1332
- className: E
1851
+ className: j
1333
1852
  }
1334
1853
  ) }),
1335
- /* @__PURE__ */ e(N, { label: "Step", children: /* @__PURE__ */ e(
1854
+ /* @__PURE__ */ a(S, { label: "Step", children: /* @__PURE__ */ a(
1336
1855
  "input",
1337
1856
  {
1338
1857
  type: "number",
1339
- value: a.step ?? "",
1340
- onChange: (r) => i({
1341
- ...a,
1342
- step: r.target.value ? parseFloat(r.target.value) : void 0
1858
+ value: e.step ?? "",
1859
+ onChange: (p) => t({
1860
+ ...e,
1861
+ step: p.target.value ? parseFloat(p.target.value) : void 0
1343
1862
  }),
1344
- className: E
1863
+ className: j
1345
1864
  }
1346
1865
  ) })
1347
1866
  ] })
1348
1867
  ] }),
1349
- a.type === "datetime" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1350
- /* @__PURE__ */ e(
1868
+ e.type === "datetime" && /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1869
+ /* @__PURE__ */ a(
1351
1870
  "input",
1352
1871
  {
1353
1872
  type: "checkbox",
1354
1873
  id: "datetime-range",
1355
- checked: a.range ?? !1,
1356
- onChange: (r) => i({ ...a, range: r.target.checked }),
1874
+ checked: e.range ?? !1,
1875
+ onChange: (p) => t({ ...e, range: p.target.checked }),
1357
1876
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1358
1877
  }
1359
1878
  ),
1360
- /* @__PURE__ */ e("label", { htmlFor: "datetime-range", className: "mapui:text-sm mapui:text-gray-700", children: "Date Range" })
1879
+ /* @__PURE__ */ a("label", { htmlFor: "datetime-range", className: "mapui:text-sm mapui:text-gray-700", children: "Date Range" })
1361
1880
  ] }),
1362
- a.type === "select" && /* @__PURE__ */ l(P, { children: [
1881
+ e.type === "select" && /* @__PURE__ */ l(B, { children: [
1363
1882
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1364
- /* @__PURE__ */ e(
1883
+ /* @__PURE__ */ a(
1365
1884
  "input",
1366
1885
  {
1367
1886
  type: "checkbox",
1368
1887
  id: "select-prefetch",
1369
- checked: a.prefetch ?? !1,
1370
- onChange: (r) => i({ ...a, prefetch: r.target.checked }),
1888
+ checked: e.prefetch ?? !1,
1889
+ onChange: (p) => t({ ...e, prefetch: p.target.checked }),
1371
1890
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1372
1891
  }
1373
1892
  ),
1374
- /* @__PURE__ */ e("label", { htmlFor: "select-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1893
+ /* @__PURE__ */ a("label", { htmlFor: "select-prefetch", className: "mapui:text-sm mapui:text-gray-700", children: "Prefetch Options" })
1375
1894
  ] }),
1376
- /* @__PURE__ */ e(N, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ e(
1377
- me,
1895
+ /* @__PURE__ */ a(S, { label: "Static Options (comma-separated)", children: /* @__PURE__ */ a(
1896
+ De,
1378
1897
  {
1379
- options: a.options,
1380
- onChange: (r) => i({ ...a, options: r }),
1898
+ options: e.options,
1899
+ onChange: (p) => t({ ...e, options: p }),
1381
1900
  placeholder: "option1, option2",
1382
- className: E
1901
+ className: j
1383
1902
  }
1384
1903
  ) })
1385
1904
  ] })
1386
1905
  ] });
1387
1906
  }
1388
- const Qe = () => ({
1907
+ const Ca = () => ({
1389
1908
  type: "text",
1390
1909
  property: "",
1391
1910
  label: "",
1392
1911
  autocomplete: !1
1393
1912
  });
1394
- function Ze({ fields: a, onChange: i, availableProperties: t }) {
1395
- const [p, u] = L(null), n = () => {
1396
- const s = [...a, Qe()];
1397
- i(s), u(s.length - 1);
1398
- }, r = (s, g) => {
1399
- i(a.map((D, o) => o === s ? g : D));
1400
- }, m = (s) => {
1401
- i(a.filter((g, D) => D !== s)), u(null);
1402
- }, d = (s) => {
1403
- if (s === 0) return;
1404
- const g = [...a];
1405
- [g[s - 1], g[s]] = [g[s], g[s - 1]], i(g), u(s - 1);
1406
- }, f = (s) => {
1407
- if (s === a.length - 1) return;
1408
- const g = [...a];
1409
- [g[s], g[s + 1]] = [g[s + 1], g[s]], i(g), u(s + 1);
1913
+ function Sa({ fields: e, onChange: t, availableProperties: i }) {
1914
+ const [r, n] = L(null), o = () => {
1915
+ const d = [...e, Ca()];
1916
+ t(d), n(d.length - 1);
1917
+ }, p = (d, f) => {
1918
+ t(e.map((c, u) => u === d ? f : c));
1919
+ }, b = (d) => {
1920
+ t(e.filter((f, c) => c !== d)), n(null);
1921
+ }, m = (d) => {
1922
+ if (d === 0) return;
1923
+ const f = [...e];
1924
+ [f[d - 1], f[d]] = [f[d], f[d - 1]], t(f), n(d - 1);
1925
+ }, w = (d) => {
1926
+ if (d === e.length - 1) return;
1927
+ const f = [...e];
1928
+ [f[d], f[d + 1]] = [f[d + 1], f[d]], t(f), n(d + 1);
1410
1929
  };
1411
1930
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1412
- a.length === 0 && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
1413
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((s, g) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
1931
+ e.length === 0 && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No search fields configured." }),
1932
+ /* @__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, f) => /* @__PURE__ */ l("li", { className: "mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white", children: [
1414
1933
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-1 mapui:px-3 mapui:py-2", children: [
1415
1934
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
1416
- /* @__PURE__ */ e(
1935
+ /* @__PURE__ */ a(
1417
1936
  "button",
1418
1937
  {
1419
1938
  type: "button",
1420
- onClick: () => d(g),
1421
- disabled: g === 0,
1939
+ onClick: () => m(f),
1940
+ disabled: f === 0,
1422
1941
  "aria-label": "Move up",
1423
1942
  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",
1424
1943
  children: "▲"
1425
1944
  }
1426
1945
  ),
1427
- /* @__PURE__ */ e(
1946
+ /* @__PURE__ */ a(
1428
1947
  "button",
1429
1948
  {
1430
1949
  type: "button",
1431
- onClick: () => f(g),
1432
- disabled: g === a.length - 1,
1950
+ onClick: () => w(f),
1951
+ disabled: f === e.length - 1,
1433
1952
  "aria-label": "Move down",
1434
1953
  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",
1435
1954
  children: "▼"
@@ -1440,126 +1959,126 @@ function Ze({ fields: a, onChange: i, availableProperties: t }) {
1440
1959
  "button",
1441
1960
  {
1442
1961
  type: "button",
1443
- onClick: () => u(p === g ? null : g),
1962
+ onClick: () => n(r === f ? null : f),
1444
1963
  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",
1445
1964
  children: [
1446
- /* @__PURE__ */ e("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: s.type }),
1447
- s.label || s.property || "Untitled field"
1965
+ /* @__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 }),
1966
+ d.label || d.property || "Untitled field"
1448
1967
  ]
1449
1968
  }
1450
1969
  ),
1451
- /* @__PURE__ */ e(
1970
+ /* @__PURE__ */ a(
1452
1971
  "button",
1453
1972
  {
1454
1973
  type: "button",
1455
- onClick: () => m(g),
1974
+ onClick: () => b(f),
1456
1975
  "aria-label": "Remove field",
1457
1976
  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",
1458
1977
  children: "Remove"
1459
1978
  }
1460
1979
  )
1461
1980
  ] }),
1462
- p === g && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1463
- Ke,
1981
+ r === f && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
1982
+ ka,
1464
1983
  {
1465
- value: s,
1466
- onChange: (D) => r(g, D),
1467
- availableProperties: t
1984
+ value: d,
1985
+ onChange: (c) => p(f, c),
1986
+ availableProperties: i
1468
1987
  }
1469
1988
  ) })
1470
- ] }, g)) }),
1471
- /* @__PURE__ */ e(
1989
+ ] }, f)) }),
1990
+ /* @__PURE__ */ a(
1472
1991
  "button",
1473
1992
  {
1474
1993
  type: "button",
1475
- onClick: n,
1994
+ onClick: o,
1476
1995
  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",
1477
1996
  children: "+ Add Search Field"
1478
1997
  }
1479
1998
  )
1480
1999
  ] });
1481
2000
  }
1482
- function ea(a) {
1483
- return Object.entries(a).map(([i, t]) => ({
1484
- key: i,
1485
- label: t.label ?? "",
1486
- visible: t.visible ?? !0
2001
+ function Da(e) {
2002
+ return Object.entries(e).map(([t, i]) => ({
2003
+ key: t,
2004
+ label: i.label ?? "",
2005
+ visible: i.visible ?? !0
1487
2006
  }));
1488
2007
  }
1489
- function aa(a) {
1490
- const i = {};
1491
- for (const t of a)
1492
- i[t.key] = {
1493
- visible: t.visible,
1494
- ...t.label ? { label: t.label } : {}
2008
+ function Ta(e) {
2009
+ const t = {};
2010
+ for (const i of e)
2011
+ t[i.key] = {
2012
+ visible: i.visible,
2013
+ ...i.label ? { label: i.label } : {}
1495
2014
  };
1496
- return i;
2015
+ return t;
1497
2016
  }
1498
- const X = "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";
1499
- function ia({ value: a, onChange: i, availableProperties: t }) {
1500
- const p = ea(a), u = t && t.length > 0, n = (o) => i(aa(o)), r = () => {
1501
- n([...p, { key: "", label: "", visible: !0 }]);
1502
- }, m = (o) => {
1503
- n(p.filter((c, x) => x !== o));
1504
- }, d = (o, c) => {
1505
- n(p.map((x, v) => v === o ? { ...x, ...c } : x));
1506
- }, f = (o, c) => {
1507
- const x = t == null ? void 0 : t.find((T) => T.name === c), v = (x == null ? void 0 : x.title) ?? p[o].label;
1508
- n(p.map((T, b) => b === o ? { ...T, key: c, label: v } : T));
1509
- }, s = (o) => {
1510
- if (o === 0) return;
1511
- const c = [...p];
1512
- [c[o - 1], c[o]] = [c[o], c[o - 1]], n(c);
1513
- }, g = (o) => {
1514
- if (o === p.length - 1) return;
1515
- const c = [...p];
1516
- [c[o], c[o + 1]] = [c[o + 1], c[o]], n(c);
1517
- }, D = () => {
1518
- if (!t) return;
1519
- const o = t.map((c) => ({
1520
- key: c.name,
1521
- label: c.title ?? "",
2017
+ const le = "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";
2018
+ function La({ value: e, onChange: t, availableProperties: i }) {
2019
+ const r = Da(e), n = i && i.length > 0, o = (u) => t(Ta(u)), p = () => {
2020
+ o([...r, { key: "", label: "", visible: !0 }]);
2021
+ }, b = (u) => {
2022
+ o(r.filter((s, v) => v !== u));
2023
+ }, m = (u, s) => {
2024
+ o(r.map((v, k) => k === u ? { ...v, ...s } : v));
2025
+ }, w = (u, s) => {
2026
+ const v = i == null ? void 0 : i.find((D) => D.name === s), k = (v == null ? void 0 : v.title) ?? r[u].label;
2027
+ o(r.map((D, x) => x === u ? { ...D, key: s, label: k } : D));
2028
+ }, d = (u) => {
2029
+ if (u === 0) return;
2030
+ const s = [...r];
2031
+ [s[u - 1], s[u]] = [s[u], s[u - 1]], o(s);
2032
+ }, f = (u) => {
2033
+ if (u === r.length - 1) return;
2034
+ const s = [...r];
2035
+ [s[u], s[u + 1]] = [s[u + 1], s[u]], o(s);
2036
+ }, c = () => {
2037
+ if (!i) return;
2038
+ const u = i.map((s) => ({
2039
+ key: s.name,
2040
+ label: s.title ?? "",
1522
2041
  visible: !0
1523
2042
  }));
1524
- n(o);
2043
+ o(u);
1525
2044
  };
1526
2045
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-2", children: [
1527
- p.length === 0 ? /* @__PURE__ */ l(P, { children: [
1528
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No property display rules configured. All properties will be shown." }),
1529
- u && /* @__PURE__ */ e(
2046
+ r.length === 0 ? /* @__PURE__ */ l(B, { children: [
2047
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No property display rules configured. All properties will be shown." }),
2048
+ n && /* @__PURE__ */ a(
1530
2049
  "button",
1531
2050
  {
1532
2051
  type: "button",
1533
- onClick: D,
2052
+ onClick: c,
1534
2053
  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",
1535
2054
  children: "Populate from API metadata"
1536
2055
  }
1537
2056
  )
1538
- ] }) : /* @__PURE__ */ l(P, { children: [
2057
+ ] }) : /* @__PURE__ */ l(B, { children: [
1539
2058
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:items-center mapui:gap-2 mapui:px-8", style: { gridTemplateColumns: "1fr 1fr auto" }, children: [
1540
- /* @__PURE__ */ e(N, { label: "Property Key", children: /* @__PURE__ */ e("span", {}) }),
1541
- /* @__PURE__ */ e(N, { label: "Display Label", children: /* @__PURE__ */ e("span", {}) }),
1542
- /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
2059
+ /* @__PURE__ */ a(S, { label: "Property Key", children: /* @__PURE__ */ a("span", {}) }),
2060
+ /* @__PURE__ */ a(S, { label: "Display Label", children: /* @__PURE__ */ a("span", {}) }),
2061
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:font-medium mapui:text-gray-600", children: "Visible" })
1543
2062
  ] }),
1544
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1.5 mapui:p-0", children: p.map((o, 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: [
2063
+ /* @__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, s) => /* @__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: [
1545
2064
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
1546
- /* @__PURE__ */ e(
2065
+ /* @__PURE__ */ a(
1547
2066
  "button",
1548
2067
  {
1549
2068
  type: "button",
1550
- onClick: () => s(c),
1551
- disabled: c === 0,
2069
+ onClick: () => d(s),
2070
+ disabled: s === 0,
1552
2071
  "aria-label": "Move up",
1553
2072
  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",
1554
2073
  children: "▲"
1555
2074
  }
1556
2075
  ),
1557
- /* @__PURE__ */ e(
2076
+ /* @__PURE__ */ a(
1558
2077
  "button",
1559
2078
  {
1560
2079
  type: "button",
1561
- onClick: () => g(c),
1562
- disabled: c === p.length - 1,
2080
+ onClick: () => f(s),
2081
+ disabled: s === r.length - 1,
1563
2082
  "aria-label": "Move down",
1564
2083
  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",
1565
2084
  children: "▼"
@@ -1567,285 +2086,314 @@ function ia({ value: a, onChange: i, availableProperties: t }) {
1567
2086
  )
1568
2087
  ] }),
1569
2088
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:flex-1 mapui:items-center mapui:gap-2", style: { gridTemplateColumns: "1fr 1fr auto auto" }, children: [
1570
- u ? /* @__PURE__ */ l(
2089
+ n ? /* @__PURE__ */ l(
1571
2090
  "select",
1572
2091
  {
1573
- value: o.key,
1574
- onChange: (x) => f(c, x.target.value),
2092
+ value: u.key,
2093
+ onChange: (v) => w(s, v.target.value),
1575
2094
  "aria-label": "Property key",
1576
- className: X,
2095
+ className: le,
1577
2096
  children: [
1578
- /* @__PURE__ */ e("option", { value: "", children: "Select a property…" }),
1579
- t.map((x) => /* @__PURE__ */ e("option", { value: x.name, children: x.title ?? x.name }, x.name))
2097
+ /* @__PURE__ */ a("option", { value: "", children: "Select a property…" }),
2098
+ i.map((v) => /* @__PURE__ */ a("option", { value: v.name, children: v.title ?? v.name }, v.name))
1580
2099
  ]
1581
2100
  }
1582
- ) : /* @__PURE__ */ e(
2101
+ ) : /* @__PURE__ */ a(
1583
2102
  "input",
1584
2103
  {
1585
2104
  type: "text",
1586
- value: o.key,
1587
- onChange: (x) => d(c, { key: x.target.value }),
2105
+ value: u.key,
2106
+ onChange: (v) => m(s, { key: v.target.value }),
1588
2107
  placeholder: "property_name",
1589
2108
  "aria-label": "Property key",
1590
- className: X
2109
+ className: le
1591
2110
  }
1592
2111
  ),
1593
- /* @__PURE__ */ e(
2112
+ /* @__PURE__ */ a(
1594
2113
  "input",
1595
2114
  {
1596
2115
  type: "text",
1597
- value: o.label,
1598
- onChange: (x) => d(c, { label: x.target.value }),
2116
+ value: u.label,
2117
+ onChange: (v) => m(s, { label: v.target.value }),
1599
2118
  placeholder: "Friendly name",
1600
2119
  "aria-label": "Display label",
1601
- className: X
2120
+ className: le
1602
2121
  }
1603
2122
  ),
1604
- /* @__PURE__ */ e(
2123
+ /* @__PURE__ */ a(
1605
2124
  "input",
1606
2125
  {
1607
2126
  type: "checkbox",
1608
- checked: o.visible,
1609
- onChange: (x) => d(c, { visible: x.target.checked }),
2127
+ checked: u.visible,
2128
+ onChange: (v) => m(s, { visible: v.target.checked }),
1610
2129
  "aria-label": "Visible",
1611
2130
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1612
2131
  }
1613
2132
  ),
1614
- /* @__PURE__ */ e(
2133
+ /* @__PURE__ */ a(
1615
2134
  "button",
1616
2135
  {
1617
2136
  type: "button",
1618
- onClick: () => m(c),
2137
+ onClick: () => b(s),
1619
2138
  "aria-label": "Remove property",
1620
2139
  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",
1621
2140
  children: "Remove"
1622
2141
  }
1623
2142
  )
1624
2143
  ] })
1625
- ] }, c)) })
2144
+ ] }, s)) })
1626
2145
  ] }),
1627
- /* @__PURE__ */ e(
2146
+ /* @__PURE__ */ a(
1628
2147
  "button",
1629
2148
  {
1630
2149
  type: "button",
1631
- onClick: r,
2150
+ onClick: p,
1632
2151
  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",
1633
2152
  children: "+ Add Property"
1634
2153
  }
1635
2154
  )
1636
2155
  ] });
1637
2156
  }
1638
- const Ne = /geojson\.org\/schema\/(\w+)\.json/;
1639
- function ta(a) {
1640
- return !!a.$ref && Ne.test(a.$ref);
2157
+ const Be = /geojson\.org\/schema\/(\w+)\.json/;
2158
+ function Ia(e) {
2159
+ return !!e.$ref && Be.test(e.$ref);
1641
2160
  }
1642
- function ra(a) {
1643
- const i = Ne.exec(a);
1644
- return i ? i[1] : null;
2161
+ function qe(e) {
2162
+ const t = Be.exec(e);
2163
+ return t ? t[1] : null;
1645
2164
  }
1646
- function Z(a) {
1647
- const i = a.toLowerCase();
1648
- return i.includes("polygon") ? "fill" : i.includes("linestring") ? "line" : i.includes("point") ? "circle" : null;
2165
+ function Ue(e) {
2166
+ const t = e.toLowerCase();
2167
+ return t.includes("polygon") ? "fill" : t.includes("linestring") ? "line" : t.includes("point") ? "circle" : null;
1649
2168
  }
1650
- function ke(a) {
1651
- for (const i of Object.values(a.properties))
1652
- if (i.$ref) {
1653
- const t = ra(i.$ref);
1654
- if (t) return Z(t);
2169
+ function ce(e) {
2170
+ const t = e.toLowerCase();
2171
+ return t.includes("polygon") ? ["fill"] : t.includes("linestring") ? ["line"] : t.includes("point") ? ["circle", "symbol"] : [];
2172
+ }
2173
+ function Aa(e) {
2174
+ for (const t of Object.values(e.properties))
2175
+ if (t.$ref) {
2176
+ const i = qe(t.$ref);
2177
+ if (i) return Ue(i);
1655
2178
  }
1656
2179
  return null;
1657
2180
  }
1658
- function la(a) {
1659
- return Object.entries(a.properties).filter(([, i]) => !ta(i)).map(([i, t]) => ({
1660
- name: i,
1661
- title: t.title,
1662
- type: t.type,
1663
- format: t.format,
1664
- enum: t.enum,
1665
- minimum: t.minimum,
1666
- maximum: t.maximum
2181
+ function We(e) {
2182
+ for (const t of Object.values(e.properties))
2183
+ if (t.$ref) {
2184
+ const i = qe(t.$ref);
2185
+ if (i) return ce(i);
2186
+ }
2187
+ return [];
2188
+ }
2189
+ function Ea(e) {
2190
+ return Object.entries(e.properties).filter(([, t]) => !Ia(t)).map(([t, i]) => ({
2191
+ name: t,
2192
+ title: i.title,
2193
+ type: i.type,
2194
+ format: i.format,
2195
+ enum: i.enum,
2196
+ minimum: i.minimum,
2197
+ maximum: i.maximum
1667
2198
  }));
1668
2199
  }
1669
- async function ya(a, i) {
1670
- var t, p;
2200
+ async function Ga(e, t) {
2201
+ var i, r;
1671
2202
  try {
1672
- const u = await Ie(a, i), n = ke(u);
1673
- if (n) return n;
2203
+ const n = await Me(e, t), o = Aa(n);
2204
+ if (o) return o;
1674
2205
  } catch {
1675
2206
  }
1676
2207
  try {
1677
- const n = (p = (t = (await ye(a, i, { limit: 1 })).features[0]) == null ? void 0 : t.geometry) == null ? void 0 : p.type;
1678
- if (typeof n == "string") return Z(n);
2208
+ const o = (r = (i = (await se(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
2209
+ if (typeof o == "string") return Ue(o);
1679
2210
  } catch {
1680
2211
  }
1681
2212
  return null;
1682
2213
  }
1683
- function fa(a) {
1684
- return a.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (i) => i.toUpperCase());
2214
+ async function za(e, t) {
2215
+ var i, r;
2216
+ try {
2217
+ const n = await Me(e, t), o = We(n);
2218
+ if (o.length > 0) return o;
2219
+ } catch {
2220
+ }
2221
+ try {
2222
+ const o = (r = (i = (await se(e, t, { limit: 1 })).features[0]) == null ? void 0 : i.geometry) == null ? void 0 : r.type;
2223
+ if (typeof o == "string") return ce(o);
2224
+ } catch {
2225
+ }
2226
+ return [];
2227
+ }
2228
+ function Va(e) {
2229
+ return e.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/\b\w/g, (t) => t.toUpperCase());
1685
2230
  }
1686
- const U = "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";
1687
- function se({ value: a, onChange: i, availableSources: t, availableIcons: p }) {
1688
- var T;
1689
- const u = (b) => i({ ...a, ...b }), n = K(a);
1690
- n.current = a;
1691
- const r = K(i);
1692
- r.current = i;
1693
- const m = t.find((b) => b.id === a.sourceId), d = (m == null ? void 0 : m.url) ?? null, f = a.collection || null, { collections: s, loading: g } = he(d), { queryables: D, loading: o } = Ae(d, f), c = D ? la(D) : [], [x, v] = L(
1694
- null
1695
- );
1696
- return W(() => {
1697
- if (!D) {
1698
- v(null);
2231
+ const V = "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";
2232
+ function Te({ value: e, onChange: t, availableSources: i, availableIcons: r }) {
2233
+ var D;
2234
+ const n = (x) => t({ ...e, ...x }), o = ue(e);
2235
+ o.current = e;
2236
+ const p = ue(t);
2237
+ p.current = t;
2238
+ const b = i.find((x) => x.id === e.sourceId), m = (b == null ? void 0 : b.url) ?? null, w = e.collection || null, { collections: d, loading: f } = Fe(m), { queryables: c, loading: u } = _e(m, w), s = c ? Ea(c) : [], [v, k] = L([]);
2239
+ return X(() => {
2240
+ if (!c) {
2241
+ k([]);
1699
2242
  return;
1700
2243
  }
1701
- const b = (I) => {
1702
- if (v(I), I && !n.current.style) {
1703
- const k = I === "fill" ? Q : I === "line" ? xe : I === "symbol" ? ve : we;
1704
- r.current({ ...n.current, style: k });
2244
+ const x = (P) => {
2245
+ k(P);
2246
+ const E = P[0];
2247
+ if (E && !o.current.style) {
2248
+ const y = E === "fill" ? me : E === "line" ? je : E === "symbol" ? Re : $e;
2249
+ p.current({ ...o.current, style: y });
1705
2250
  }
1706
- }, y = ke(D);
1707
- if (y) {
1708
- b(y);
2251
+ }, $ = We(c);
2252
+ if ($.length > 0) {
2253
+ x($);
1709
2254
  return;
1710
2255
  }
1711
- if (!d || !f) {
1712
- v(null);
2256
+ if (!m || !w) {
2257
+ k([]);
1713
2258
  return;
1714
2259
  }
1715
- let w = !1;
1716
- return ye(d, f, { limit: 1 }).then((I) => {
1717
- var C, A;
1718
- if (w) return;
1719
- const k = (A = (C = I.features[0]) == null ? void 0 : C.geometry) == null ? void 0 : A.type;
1720
- b(typeof k == "string" ? Z(k) : null);
2260
+ let C = !1;
2261
+ return se(m, w, { limit: 1 }).then((P) => {
2262
+ var y, F;
2263
+ if (C) return;
2264
+ const E = (F = (y = P.features[0]) == null ? void 0 : y.geometry) == null ? void 0 : F.type;
2265
+ x(typeof E == "string" ? ce(E) : []);
1721
2266
  }).catch(() => {
1722
- w || v(null);
2267
+ C || k([]);
1723
2268
  }), () => {
1724
- w = !0;
2269
+ C = !0;
1725
2270
  };
1726
- }, [D, d, f]), W(() => {
1727
- v(null);
1728
- }, [d, f]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2271
+ }, [c, m, w]), X(() => {
2272
+ k([]);
2273
+ }, [m, w]), /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1729
2274
  /* @__PURE__ */ l("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: [
1730
- /* @__PURE__ */ e(N, { label: "Layer ID", required: !0, children: /* @__PURE__ */ e(
2275
+ /* @__PURE__ */ a(S, { label: "Layer ID", required: !0, children: /* @__PURE__ */ a(
1731
2276
  "input",
1732
2277
  {
1733
2278
  type: "text",
1734
- value: a.id,
1735
- onChange: (b) => u({ id: b.target.value }),
2279
+ value: e.id,
2280
+ onChange: (x) => n({ id: x.target.value }),
1736
2281
  placeholder: "my-layer",
1737
- className: U
2282
+ className: V
1738
2283
  }
1739
2284
  ) }),
1740
- /* @__PURE__ */ e(N, { label: "Label", children: /* @__PURE__ */ e(
2285
+ /* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
1741
2286
  "input",
1742
2287
  {
1743
2288
  type: "text",
1744
- value: a.label,
1745
- onChange: (b) => u({ label: b.target.value }),
2289
+ value: e.label,
2290
+ onChange: (x) => n({ label: x.target.value }),
1746
2291
  placeholder: "My Layer",
1747
- className: U
2292
+ className: V
1748
2293
  }
1749
2294
  ) })
1750
2295
  ] }),
1751
- /* @__PURE__ */ e(N, { label: "Source", required: !0, children: /* @__PURE__ */ l(
2296
+ /* @__PURE__ */ a(S, { label: "Source", required: !0, children: /* @__PURE__ */ l(
1752
2297
  "select",
1753
2298
  {
1754
- value: a.sourceId,
1755
- onChange: (b) => u({ sourceId: b.target.value }),
1756
- className: U,
2299
+ value: e.sourceId,
2300
+ onChange: (x) => n({ sourceId: x.target.value }),
2301
+ className: V,
1757
2302
  children: [
1758
- /* @__PURE__ */ e("option", { value: "", children: "Select a source…" }),
1759
- t.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.label ?? b.id }, b.id))
2303
+ /* @__PURE__ */ a("option", { value: "", children: "Select a source…" }),
2304
+ i.map((x) => /* @__PURE__ */ a("option", { value: x.id, children: x.label ?? x.id }, x.id))
1760
2305
  ]
1761
2306
  }
1762
2307
  ) }),
1763
- /* @__PURE__ */ l(N, { label: "Collection", required: !0, children: [
1764
- s.length > 0 ? /* @__PURE__ */ l(
2308
+ /* @__PURE__ */ l(S, { label: "Collection", required: !0, children: [
2309
+ d.length > 0 ? /* @__PURE__ */ l(
1765
2310
  "select",
1766
2311
  {
1767
- value: a.collection,
1768
- onChange: (b) => u({ collection: b.target.value }),
1769
- className: U,
2312
+ value: e.collection,
2313
+ onChange: (x) => n({ collection: x.target.value }),
2314
+ className: V,
1770
2315
  children: [
1771
- /* @__PURE__ */ e("option", { value: "", children: "Select a collection…" }),
1772
- s.map((b) => /* @__PURE__ */ e("option", { value: b.id, children: b.title ?? b.id }, b.id))
2316
+ /* @__PURE__ */ a("option", { value: "", children: "Select a collection…" }),
2317
+ d.map((x) => /* @__PURE__ */ a("option", { value: x.id, children: x.title ?? x.id }, x.id))
1773
2318
  ]
1774
2319
  }
1775
- ) : /* @__PURE__ */ e(
2320
+ ) : /* @__PURE__ */ a(
1776
2321
  "input",
1777
2322
  {
1778
2323
  type: "text",
1779
- value: a.collection,
1780
- onChange: (b) => u({ collection: b.target.value }),
1781
- placeholder: g ? "Loading collections…" : "collection-id",
1782
- className: U
2324
+ value: e.collection,
2325
+ onChange: (x) => n({ collection: x.target.value }),
2326
+ placeholder: f ? "Loading collections…" : "collection-id",
2327
+ className: V
1783
2328
  }
1784
2329
  ),
1785
- o && /* @__PURE__ */ e("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
2330
+ u && /* @__PURE__ */ a("span", { className: "mapui:mt-0.5 mapui:block mapui:text-xs mapui:text-gray-400", children: "Loading properties…" })
1786
2331
  ] }),
1787
- /* @__PURE__ */ e(N, { label: "Data Mode", children: /* @__PURE__ */ e("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((b) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
1788
- /* @__PURE__ */ e(
2332
+ /* @__PURE__ */ a(S, { label: "Data Mode", children: /* @__PURE__ */ a("div", { className: "mapui:flex mapui:gap-4", children: ["vector-tiles", "geojson"].map((x) => /* @__PURE__ */ l("label", { className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:gap-1.5", children: [
2333
+ /* @__PURE__ */ a(
1789
2334
  "input",
1790
2335
  {
1791
2336
  type: "radio",
1792
- name: `data-mode-${a.id}`,
1793
- value: b,
1794
- checked: a.dataMode === b,
1795
- onChange: () => u({ dataMode: b }),
2337
+ name: `data-mode-${e.id}`,
2338
+ value: x,
2339
+ checked: e.dataMode === x,
2340
+ onChange: () => n({ dataMode: x }),
1796
2341
  className: "mapui:accent-blue-600"
1797
2342
  }
1798
2343
  ),
1799
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:text-gray-700", children: b })
1800
- ] }, b)) }) }),
2344
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:text-gray-700", children: x })
2345
+ ] }, x)) }) }),
1801
2346
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
1802
- /* @__PURE__ */ e(
2347
+ /* @__PURE__ */ a(
1803
2348
  "input",
1804
2349
  {
1805
2350
  type: "checkbox",
1806
2351
  id: "layer-visible",
1807
- checked: a.visible,
1808
- onChange: (b) => u({ visible: b.target.checked }),
2352
+ checked: e.visible,
2353
+ onChange: (x) => n({ visible: x.target.checked }),
1809
2354
  className: "mapui:h-4 mapui:w-4 mapui:accent-blue-600"
1810
2355
  }
1811
2356
  ),
1812
- /* @__PURE__ */ e("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
2357
+ /* @__PURE__ */ a("label", { htmlFor: "layer-visible", className: "mapui:text-sm mapui:text-gray-700", children: "Visible by default" })
1813
2358
  ] }),
1814
- /* @__PURE__ */ e(q, { title: "Style", children: /* @__PURE__ */ e(
1815
- Xe,
2359
+ /* @__PURE__ */ a(_, { title: "Style", children: /* @__PURE__ */ a(
2360
+ xa,
1816
2361
  {
1817
- value: a.style ?? Q,
1818
- onChange: (b) => u({ style: b }),
1819
- suggestedType: x,
1820
- availableIcons: p
2362
+ value: e.style ?? me,
2363
+ onChange: (x) => n({ style: x }),
2364
+ suggestedTypes: v,
2365
+ availableIcons: r,
2366
+ availableProperties: s,
2367
+ onFetchDistinctValues: m && w ? (x) => Ye(m, w, x, { limit: 1e3 }) : void 0
1821
2368
  }
1822
2369
  ) }),
1823
- /* @__PURE__ */ e(q, { title: "Legend", children: /* @__PURE__ */ e(
1824
- He,
2370
+ /* @__PURE__ */ a(_, { title: "Legend", children: /* @__PURE__ */ a(
2371
+ va,
1825
2372
  {
1826
- value: a.legend,
1827
- onChange: (b) => u({ legend: b })
2373
+ value: e.legend,
2374
+ onChange: (x) => n({ legend: x }),
2375
+ style: e.style
1828
2376
  }
1829
2377
  ) }),
1830
- /* @__PURE__ */ e(q, { title: "Search Fields", children: /* @__PURE__ */ e(
1831
- Ze,
2378
+ /* @__PURE__ */ a(_, { title: "Search Fields", children: /* @__PURE__ */ a(
2379
+ Sa,
1832
2380
  {
1833
- fields: ((T = a.search) == null ? void 0 : T.fields) ?? [],
1834
- onChange: (b) => u({ search: b.length > 0 ? { fields: b } : void 0 }),
1835
- availableProperties: c
2381
+ fields: ((D = e.search) == null ? void 0 : D.fields) ?? [],
2382
+ onChange: (x) => n({ search: x.length > 0 ? { fields: x } : void 0 }),
2383
+ availableProperties: s
1836
2384
  }
1837
2385
  ) }),
1838
- /* @__PURE__ */ e(q, { title: "Property Display", children: /* @__PURE__ */ e(
1839
- ia,
2386
+ /* @__PURE__ */ a(_, { title: "Property Display", children: /* @__PURE__ */ a(
2387
+ La,
1840
2388
  {
1841
- value: a.propertyDisplay ?? {},
1842
- onChange: (b) => u({ propertyDisplay: Object.keys(b).length > 0 ? b : void 0 }),
1843
- availableProperties: c
2389
+ value: e.propertyDisplay ?? {},
2390
+ onChange: (x) => n({ propertyDisplay: Object.keys(x).length > 0 ? x : void 0 }),
2391
+ availableProperties: s
1844
2392
  }
1845
2393
  ) })
1846
2394
  ] });
1847
2395
  }
1848
- const _ = () => ({
2396
+ const ne = () => ({
1849
2397
  id: "",
1850
2398
  sourceId: "",
1851
2399
  collection: "",
@@ -1853,99 +2401,99 @@ const _ = () => ({
1853
2401
  visible: !0,
1854
2402
  dataMode: "vector-tiles"
1855
2403
  });
1856
- function xa({ layers: a, onChange: i, availableSources: t, availableIcons: p }) {
1857
- const [u, n] = L(null), [r, m] = L(!1), [d, f] = L(_()), [s, g] = L(null), [D, o] = L(null), [c, x] = L(null), v = () => {
1858
- i([...a, d]), m(!1), f(_());
1859
- }, T = (h) => {
1860
- i(a.map((S) => S.id === u ? h : S));
1861
- }, b = (h) => {
1862
- i(a.filter((S) => S.id !== h)), g(null), u === h && n(null);
1863
- }, y = (h) => {
1864
- if (h === 0) return;
1865
- const S = [...a];
1866
- [S[h - 1], S[h]] = [S[h], S[h - 1]], i(S);
1867
- }, w = (h) => {
1868
- if (h === a.length - 1) return;
1869
- const S = [...a];
1870
- [S[h], S[h + 1]] = [S[h + 1], S[h]], i(S);
1871
- }, I = (h, S) => {
1872
- o(S), h.dataTransfer.effectAllowed = "move", h.dataTransfer.setData("text/plain", S);
1873
- }, k = (h, S) => {
1874
- h.preventDefault(), h.dataTransfer.dropEffect = "move", x(S);
1875
- }, C = () => {
1876
- x(null);
1877
- }, A = (h, S) => {
1878
- h.preventDefault(), x(null);
1879
- const j = D;
1880
- if (o(null), !j || j === S) return;
1881
- const R = a.findIndex((O) => O.id === j), $ = a.findIndex((O) => O.id === S);
1882
- if (R === -1 || $ === -1) return;
1883
- const F = [...a];
1884
- F.splice(R, 1), F.splice($, 0, a[R]), i(F);
1885
- }, Se = () => {
1886
- o(null), x(null);
2404
+ function _a({ layers: e, onChange: t, availableSources: i, availableIcons: r }) {
2405
+ const [n, o] = L(null), [p, b] = L(!1), [m, w] = L(ne()), [d, f] = L(null), [c, u] = L(null), [s, v] = L(null), k = () => {
2406
+ t([...e, m]), b(!1), w(ne());
2407
+ }, D = (g) => {
2408
+ t(e.map((N) => N.id === n ? g : N));
2409
+ }, x = (g) => {
2410
+ t(e.filter((N) => N.id !== g)), f(null), n === g && o(null);
2411
+ }, $ = (g) => {
2412
+ if (g === 0) return;
2413
+ const N = [...e];
2414
+ [N[g - 1], N[g]] = [N[g], N[g - 1]], t(N);
2415
+ }, C = (g) => {
2416
+ if (g === e.length - 1) return;
2417
+ const N = [...e];
2418
+ [N[g], N[g + 1]] = [N[g + 1], N[g]], t(N);
2419
+ }, P = (g, N) => {
2420
+ u(N), g.dataTransfer.effectAllowed = "move", g.dataTransfer.setData("text/plain", N);
2421
+ }, E = (g, N) => {
2422
+ g.preventDefault(), g.dataTransfer.dropEffect = "move", v(N);
2423
+ }, y = () => {
2424
+ v(null);
2425
+ }, F = (g, N) => {
2426
+ g.preventDefault(), v(null);
2427
+ const O = c;
2428
+ if (u(null), !O || O === N) return;
2429
+ const q = e.findIndex((h) => h.id === O), U = e.findIndex((h) => h.id === N);
2430
+ if (q === -1 || U === -1) return;
2431
+ const R = [...e];
2432
+ R.splice(q, 1), R.splice(U, 0, e[q]), t(R);
2433
+ }, M = () => {
2434
+ u(null), v(null);
1887
2435
  };
1888
2436
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
1889
2437
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
1890
- /* @__PURE__ */ e("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Layers" }),
1891
- /* @__PURE__ */ e(
2438
+ /* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Layers" }),
2439
+ /* @__PURE__ */ a(
1892
2440
  "button",
1893
2441
  {
1894
2442
  type: "button",
1895
2443
  onClick: () => {
1896
- m(!0), f(_());
2444
+ b(!0), w(ne());
1897
2445
  },
1898
2446
  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",
1899
2447
  children: "+ Add Layer"
1900
2448
  }
1901
2449
  )
1902
2450
  ] }),
1903
- a.length === 0 && !r && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
1904
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((h, S) => {
1905
- var F, O, ee, ae;
1906
- const j = D === h.id, R = c === h.id, $ = u === h.id;
2451
+ e.length === 0 && !p && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No layers configured." }),
2452
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: e.map((g, N) => {
2453
+ var R, h, T, I;
2454
+ const O = c === g.id, q = s === g.id, U = n === g.id;
1907
2455
  return /* @__PURE__ */ l(
1908
2456
  "li",
1909
2457
  {
1910
- draggable: !$,
1911
- onDragStart: $ ? void 0 : (B) => I(B, h.id),
1912
- onDragOver: (B) => k(B, h.id),
1913
- onDragLeave: C,
1914
- onDrop: (B) => A(B, h.id),
1915
- onDragEnd: Se,
2458
+ draggable: !U,
2459
+ onDragStart: U ? void 0 : (A) => P(A, g.id),
2460
+ onDragOver: (A) => E(A, g.id),
2461
+ onDragLeave: y,
2462
+ onDrop: (A) => F(A, g.id),
2463
+ onDragEnd: M,
1916
2464
  className: [
1917
2465
  "mapui:rounded-lg mapui:border mapui:bg-white mapui:transition-colors",
1918
- R ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
1919
- j ? "mapui:opacity-50" : "mapui:opacity-100"
2466
+ q ? "mapui:border-blue-400 mapui:bg-blue-50" : "mapui:border-gray-200",
2467
+ O ? "mapui:opacity-50" : "mapui:opacity-100"
1920
2468
  ].join(" "),
1921
2469
  children: [
1922
2470
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between mapui:gap-2 mapui:px-3 mapui:py-2", children: [
1923
2471
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:items-center mapui:gap-2", children: [
1924
2472
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:flex-col mapui:gap-0.5", children: [
1925
- /* @__PURE__ */ e(
2473
+ /* @__PURE__ */ a(
1926
2474
  "button",
1927
2475
  {
1928
2476
  type: "button",
1929
- onClick: () => y(S),
1930
- disabled: S === 0,
2477
+ onClick: () => $(N),
2478
+ disabled: N === 0,
1931
2479
  "aria-label": "Move layer up",
1932
2480
  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",
1933
2481
  children: "▲"
1934
2482
  }
1935
2483
  ),
1936
- /* @__PURE__ */ e(
2484
+ /* @__PURE__ */ a(
1937
2485
  "button",
1938
2486
  {
1939
2487
  type: "button",
1940
- onClick: () => w(S),
1941
- disabled: S === a.length - 1,
2488
+ onClick: () => C(N),
2489
+ disabled: N === e.length - 1,
1942
2490
  "aria-label": "Move layer down",
1943
2491
  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",
1944
2492
  children: "▼"
1945
2493
  }
1946
2494
  )
1947
2495
  ] }),
1948
- /* @__PURE__ */ e(
2496
+ /* @__PURE__ */ a(
1949
2497
  "span",
1950
2498
  {
1951
2499
  className: "mapui:shrink-0 mapui:cursor-grab mapui:text-gray-400 active:mapui:cursor-grabbing",
@@ -1954,152 +2502,152 @@ function xa({ layers: a, onChange: i, availableSources: t, availableIcons: p })
1954
2502
  }
1955
2503
  ),
1956
2504
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:min-w-0 mapui:flex-col mapui:gap-0.5", children: [
1957
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: h.label || h.id }),
1958
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: h.collection }),
2505
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: g.label || g.id }),
2506
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-gray-500", children: g.collection }),
1959
2507
  /* @__PURE__ */ l("div", { className: "mapui:mt-1 mapui:flex mapui:flex-wrap mapui:gap-1", children: [
1960
- /* @__PURE__ */ e("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: h.dataMode }),
1961
- h.style && /* @__PURE__ */ e("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: h.style.type }),
1962
- h.visible === !1 && /* @__PURE__ */ e("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" }),
1963
- (((O = (F = h.search) == null ? void 0 : F.fields) == null ? void 0 : O.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: [
1964
- h.search.fields.length,
2508
+ /* @__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: g.dataMode }),
2509
+ g.style && /* @__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: g.style.type }),
2510
+ g.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" }),
2511
+ (((h = (R = g.search) == null ? void 0 : R.fields) == null ? void 0 : h.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: [
2512
+ g.search.fields.length,
1965
2513
  " search fields"
1966
2514
  ] }),
1967
- (((ae = (ee = h.legend) == null ? void 0 : ee.entries) == null ? void 0 : ae.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: [
1968
- h.legend.entries.length,
2515
+ (((I = (T = g.legend) == null ? void 0 : T.entries) == null ? void 0 : I.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: [
2516
+ g.legend.entries.length,
1969
2517
  " legend entries"
1970
2518
  ] })
1971
2519
  ] })
1972
2520
  ] })
1973
2521
  ] }),
1974
2522
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
1975
- /* @__PURE__ */ e(
2523
+ /* @__PURE__ */ a(
1976
2524
  "button",
1977
2525
  {
1978
2526
  type: "button",
1979
- onClick: () => n(u === h.id ? null : h.id),
2527
+ onClick: () => o(n === g.id ? null : g.id),
1980
2528
  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",
1981
- children: u === h.id ? "Close" : "Edit"
2529
+ children: n === g.id ? "Close" : "Edit"
1982
2530
  }
1983
2531
  ),
1984
- /* @__PURE__ */ e(
2532
+ /* @__PURE__ */ a(
1985
2533
  "button",
1986
2534
  {
1987
2535
  type: "button",
1988
- onClick: () => g(h.id),
2536
+ onClick: () => f(g.id),
1989
2537
  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",
1990
2538
  children: "Remove"
1991
2539
  }
1992
2540
  )
1993
2541
  ] })
1994
2542
  ] }),
1995
- u === h.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(
1996
- se,
2543
+ n === g.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(
2544
+ Te,
1997
2545
  {
1998
- value: h,
1999
- onChange: T,
2000
- availableSources: t,
2001
- availableIcons: p
2546
+ value: g,
2547
+ onChange: D,
2548
+ availableSources: i,
2549
+ availableIcons: r
2002
2550
  }
2003
2551
  ) })
2004
2552
  ]
2005
2553
  },
2006
- h.id
2554
+ g.id
2007
2555
  );
2008
2556
  }) }),
2009
- r && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2010
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
2011
- /* @__PURE__ */ e(
2012
- se,
2557
+ p && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2558
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Layer" }),
2559
+ /* @__PURE__ */ a(
2560
+ Te,
2013
2561
  {
2014
- value: d,
2015
- onChange: f,
2016
- availableSources: t,
2017
- availableIcons: p
2562
+ value: m,
2563
+ onChange: w,
2564
+ availableSources: i,
2565
+ availableIcons: r
2018
2566
  }
2019
2567
  ),
2020
2568
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
2021
- /* @__PURE__ */ e(
2569
+ /* @__PURE__ */ a(
2022
2570
  "button",
2023
2571
  {
2024
2572
  type: "button",
2025
- onClick: v,
2026
- disabled: !d.id || !d.sourceId || !d.collection,
2573
+ onClick: k,
2574
+ disabled: !m.id || !m.sourceId || !m.collection,
2027
2575
  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",
2028
2576
  children: "Save"
2029
2577
  }
2030
2578
  ),
2031
- /* @__PURE__ */ e(
2579
+ /* @__PURE__ */ a(
2032
2580
  "button",
2033
2581
  {
2034
2582
  type: "button",
2035
- onClick: () => m(!1),
2583
+ onClick: () => b(!1),
2036
2584
  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",
2037
2585
  children: "Cancel"
2038
2586
  }
2039
2587
  )
2040
2588
  ] })
2041
2589
  ] }),
2042
- /* @__PURE__ */ e(
2043
- G,
2590
+ /* @__PURE__ */ a(
2591
+ Z,
2044
2592
  {
2045
- open: s !== null,
2593
+ open: d !== null,
2046
2594
  title: "Remove Layer",
2047
2595
  description: "Are you sure you want to remove this layer from the configuration?",
2048
- onConfirm: () => s && b(s),
2049
- onCancel: () => g(null)
2596
+ onConfirm: () => d && x(d),
2597
+ onCancel: () => f(null)
2050
2598
  }
2051
2599
  )
2052
2600
  ] });
2053
2601
  }
2054
- const V = "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";
2055
- function ce({ value: a, onChange: i }) {
2056
- const t = (p) => i({ ...a, ...p });
2602
+ const Q = "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";
2603
+ function Le({ value: e, onChange: t }) {
2604
+ const i = (r) => t({ ...e, ...r });
2057
2605
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2058
- /* @__PURE__ */ e(N, { label: "ID", required: !0, children: /* @__PURE__ */ e(
2606
+ /* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
2059
2607
  "input",
2060
2608
  {
2061
2609
  type: "text",
2062
- value: a.id,
2063
- onChange: (p) => t({ id: p.target.value }),
2610
+ value: e.id,
2611
+ onChange: (r) => i({ id: r.target.value }),
2064
2612
  placeholder: "osm",
2065
- className: V
2613
+ className: Q
2066
2614
  }
2067
2615
  ) }),
2068
- /* @__PURE__ */ e(N, { label: "Label", children: /* @__PURE__ */ e(
2616
+ /* @__PURE__ */ a(S, { label: "Label", children: /* @__PURE__ */ a(
2069
2617
  "input",
2070
2618
  {
2071
2619
  type: "text",
2072
- value: a.label,
2073
- onChange: (p) => t({ label: p.target.value }),
2620
+ value: e.label,
2621
+ onChange: (r) => i({ label: r.target.value }),
2074
2622
  placeholder: "OpenStreetMap",
2075
- className: V
2623
+ className: Q
2076
2624
  }
2077
2625
  ) }),
2078
- /* @__PURE__ */ e(N, { label: "Style URL", required: !0, children: /* @__PURE__ */ e(
2626
+ /* @__PURE__ */ a(S, { label: "Style URL", required: !0, children: /* @__PURE__ */ a(
2079
2627
  "input",
2080
2628
  {
2081
2629
  type: "url",
2082
- value: a.url,
2083
- onChange: (p) => t({ url: p.target.value }),
2630
+ value: e.url,
2631
+ onChange: (r) => i({ url: r.target.value }),
2084
2632
  placeholder: "https://example.com/style.json",
2085
- className: V
2633
+ className: Q
2086
2634
  }
2087
2635
  ) }),
2088
- /* @__PURE__ */ l(N, { label: "Thumbnail URL (optional)", children: [
2089
- /* @__PURE__ */ e(
2636
+ /* @__PURE__ */ l(S, { label: "Thumbnail URL (optional)", children: [
2637
+ /* @__PURE__ */ a(
2090
2638
  "input",
2091
2639
  {
2092
2640
  type: "url",
2093
- value: a.thumbnail ?? "",
2094
- onChange: (p) => t({ thumbnail: p.target.value || void 0 }),
2641
+ value: e.thumbnail ?? "",
2642
+ onChange: (r) => i({ thumbnail: r.target.value || void 0 }),
2095
2643
  placeholder: "https://example.com/thumbnail.png",
2096
- className: V
2644
+ className: Q
2097
2645
  }
2098
2646
  ),
2099
- a.thumbnail && /* @__PURE__ */ e(
2647
+ e.thumbnail && /* @__PURE__ */ a(
2100
2648
  "img",
2101
2649
  {
2102
- src: a.thumbnail,
2650
+ src: e.thumbnail,
2103
2651
  alt: "Thumbnail preview",
2104
2652
  className: "mapui:mt-1 mapui:h-16 mapui:w-24 mapui:rounded mapui:border mapui:border-gray-200 mapui:object-cover"
2105
2653
  }
@@ -2107,253 +2655,253 @@ function ce({ value: a, onChange: i }) {
2107
2655
  ] })
2108
2656
  ] });
2109
2657
  }
2110
- const H = () => ({ id: "", label: "", url: "" });
2111
- function wa({ basemaps: a, onChange: i }) {
2112
- const [t, p] = L(null), [u, n] = L(!1), [r, m] = L(H()), [d, f] = L(null), s = (o) => {
2113
- i(a.map((c) => c.id === t ? o : c));
2114
- }, g = () => {
2115
- i([...a, r]), n(!1), m(H());
2116
- }, D = (o) => {
2117
- i(a.filter((c) => c.id !== o)), f(null);
2658
+ const pe = () => ({ id: "", label: "", url: "" });
2659
+ function Ya({ basemaps: e, onChange: t }) {
2660
+ const [i, r] = L(null), [n, o] = L(!1), [p, b] = L(pe()), [m, w] = L(null), d = (u) => {
2661
+ t(e.map((s) => s.id === i ? u : s));
2662
+ }, f = () => {
2663
+ t([...e, p]), o(!1), b(pe());
2664
+ }, c = (u) => {
2665
+ t(e.filter((s) => s.id !== u)), w(null);
2118
2666
  };
2119
2667
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2120
2668
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
2121
- /* @__PURE__ */ e("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Basemaps" }),
2122
- /* @__PURE__ */ e(
2669
+ /* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Basemaps" }),
2670
+ /* @__PURE__ */ a(
2123
2671
  "button",
2124
2672
  {
2125
2673
  type: "button",
2126
2674
  onClick: () => {
2127
- n(!0), m(H());
2675
+ o(!0), b(pe());
2128
2676
  },
2129
2677
  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",
2130
2678
  children: "+ Add Basemap"
2131
2679
  }
2132
2680
  )
2133
2681
  ] }),
2134
- a.length === 0 && !u && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No basemaps configured." }),
2135
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((o) => /* @__PURE__ */ l(
2682
+ e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No basemaps configured." }),
2683
+ /* @__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(
2136
2684
  "li",
2137
2685
  {
2138
2686
  className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
2139
2687
  children: [
2140
2688
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
2141
- o.thumbnail && /* @__PURE__ */ e(
2689
+ u.thumbnail && /* @__PURE__ */ a(
2142
2690
  "img",
2143
2691
  {
2144
- src: o.thumbnail,
2692
+ src: u.thumbnail,
2145
2693
  alt: "",
2146
2694
  className: "mapui:h-10 mapui:w-14 mapui:shrink-0 mapui:rounded mapui:object-cover"
2147
2695
  }
2148
2696
  ),
2149
2697
  /* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
2150
- /* @__PURE__ */ e("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: o.label || o.id }),
2151
- /* @__PURE__ */ e("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: o.url })
2698
+ /* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: u.label || u.id }),
2699
+ /* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: u.url })
2152
2700
  ] }),
2153
2701
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
2154
- /* @__PURE__ */ e(
2702
+ /* @__PURE__ */ a(
2155
2703
  "button",
2156
2704
  {
2157
2705
  type: "button",
2158
- onClick: () => p(t === o.id ? null : o.id),
2706
+ onClick: () => r(i === u.id ? null : u.id),
2159
2707
  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",
2160
- children: t === o.id ? "Close" : "Edit"
2708
+ children: i === u.id ? "Close" : "Edit"
2161
2709
  }
2162
2710
  ),
2163
- /* @__PURE__ */ e(
2711
+ /* @__PURE__ */ a(
2164
2712
  "button",
2165
2713
  {
2166
2714
  type: "button",
2167
- onClick: () => f(o.id),
2715
+ onClick: () => w(u.id),
2168
2716
  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",
2169
2717
  children: "Remove"
2170
2718
  }
2171
2719
  )
2172
2720
  ] })
2173
2721
  ] }),
2174
- t === o.id && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(ce, { value: o, onChange: s }) })
2722
+ i === u.id && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Le, { value: u, onChange: d }) })
2175
2723
  ]
2176
2724
  },
2177
- o.id
2725
+ u.id
2178
2726
  )) }),
2179
- u && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2180
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
2181
- /* @__PURE__ */ e(ce, { value: r, onChange: m }),
2727
+ n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2728
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Basemap" }),
2729
+ /* @__PURE__ */ a(Le, { value: p, onChange: b }),
2182
2730
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
2183
- /* @__PURE__ */ e(
2731
+ /* @__PURE__ */ a(
2184
2732
  "button",
2185
2733
  {
2186
2734
  type: "button",
2187
- onClick: g,
2188
- disabled: !r.id || !r.url,
2735
+ onClick: f,
2736
+ disabled: !p.id || !p.url,
2189
2737
  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",
2190
2738
  children: "Save"
2191
2739
  }
2192
2740
  ),
2193
- /* @__PURE__ */ e(
2741
+ /* @__PURE__ */ a(
2194
2742
  "button",
2195
2743
  {
2196
2744
  type: "button",
2197
- onClick: () => n(!1),
2745
+ onClick: () => o(!1),
2198
2746
  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",
2199
2747
  children: "Cancel"
2200
2748
  }
2201
2749
  )
2202
2750
  ] })
2203
2751
  ] }),
2204
- /* @__PURE__ */ e(
2205
- G,
2752
+ /* @__PURE__ */ a(
2753
+ Z,
2206
2754
  {
2207
- open: d !== null,
2755
+ open: m !== null,
2208
2756
  title: "Remove Basemap",
2209
2757
  description: "Are you sure you want to remove this basemap from the configuration?",
2210
- onConfirm: () => d && D(d),
2211
- onCancel: () => f(null)
2758
+ onConfirm: () => m && c(m),
2759
+ onCancel: () => w(null)
2212
2760
  }
2213
2761
  )
2214
2762
  ] });
2215
2763
  }
2216
- const de = "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";
2217
- function ge({ value: a, onChange: i }) {
2218
- const t = (p) => i({ ...a, ...p });
2764
+ 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";
2765
+ function Ae({ value: e, onChange: t }) {
2766
+ const i = (r) => t({ ...e, ...r });
2219
2767
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2220
- /* @__PURE__ */ e(N, { label: "ID", required: !0, children: /* @__PURE__ */ e(
2768
+ /* @__PURE__ */ a(S, { label: "ID", required: !0, children: /* @__PURE__ */ a(
2221
2769
  "input",
2222
2770
  {
2223
2771
  type: "text",
2224
- value: a.id,
2225
- onChange: (p) => t({ id: p.target.value }),
2772
+ value: e.id,
2773
+ onChange: (r) => i({ id: r.target.value }),
2226
2774
  placeholder: "my-sprites",
2227
- className: de
2775
+ className: Ie
2228
2776
  }
2229
2777
  ) }),
2230
- /* @__PURE__ */ l(N, { label: "Sprite URL", required: !0, children: [
2231
- /* @__PURE__ */ e(
2778
+ /* @__PURE__ */ l(S, { label: "Sprite URL", required: !0, children: [
2779
+ /* @__PURE__ */ a(
2232
2780
  "input",
2233
2781
  {
2234
2782
  type: "url",
2235
- value: a.url,
2236
- onChange: (p) => t({ url: p.target.value }),
2783
+ value: e.url,
2784
+ onChange: (r) => i({ url: r.target.value }),
2237
2785
  placeholder: "https://example.com/sprites/sprite",
2238
- className: de
2786
+ className: Ie
2239
2787
  }
2240
2788
  ),
2241
2789
  /* @__PURE__ */ l("p", { className: "mapui:mt-1 mapui:text-xs mapui:text-gray-400", children: [
2242
2790
  "Base URL without extension. MapLibre will append ",
2243
- /* @__PURE__ */ e("code", { children: ".json" }),
2791
+ /* @__PURE__ */ a("code", { children: ".json" }),
2244
2792
  " and ",
2245
- /* @__PURE__ */ e("code", { children: ".png" }),
2793
+ /* @__PURE__ */ a("code", { children: ".png" }),
2246
2794
  "."
2247
2795
  ] })
2248
2796
  ] })
2249
2797
  ] });
2250
2798
  }
2251
- const J = () => ({ id: "", url: "" }), pa = (a) => {
2799
+ const oe = () => ({ id: "", url: "" }), Pa = (e) => {
2252
2800
  try {
2253
- return new URL(a), !0;
2801
+ return new URL(e), !0;
2254
2802
  } catch {
2255
2803
  return !1;
2256
2804
  }
2257
2805
  };
2258
- function va({ sprites: a, onChange: i }) {
2259
- const [t, p] = L(null), [u, n] = L(!1), [r, m] = L(J()), [d, f] = L(null), s = (o) => {
2260
- i(a.map((c, x) => x === t ? o : c));
2261
- }, g = () => {
2262
- i([...a, r]), n(!1), m(J());
2263
- }, D = (o) => {
2264
- const c = a.findIndex((x) => x.id === o);
2265
- i(a.filter((x) => x.id !== o)), t !== null && (c === t ? p(null) : c < t && p(t - 1)), f(null);
2806
+ function Xa({ sprites: e, onChange: t }) {
2807
+ const [i, r] = L(null), [n, o] = L(!1), [p, b] = L(oe()), [m, w] = L(null), d = (u) => {
2808
+ t(e.map((s, v) => v === i ? u : s));
2809
+ }, f = () => {
2810
+ t([...e, p]), o(!1), b(oe());
2811
+ }, c = (u) => {
2812
+ const s = e.findIndex((v) => v.id === u);
2813
+ t(e.filter((v) => v.id !== u)), i !== null && (s === i ? r(null) : s < i && r(i - 1)), w(null);
2266
2814
  };
2267
2815
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2268
2816
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:justify-between", children: [
2269
- /* @__PURE__ */ e("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Custom Sprite Sheets" }),
2270
- /* @__PURE__ */ e(
2817
+ /* @__PURE__ */ a("h3", { className: "mapui:m-0 mapui:text-sm mapui:font-semibold mapui:text-gray-700", children: "Custom Sprite Sheets" }),
2818
+ /* @__PURE__ */ a(
2271
2819
  "button",
2272
2820
  {
2273
2821
  type: "button",
2274
2822
  onClick: () => {
2275
- n(!0), m(J());
2823
+ o(!0), b(oe());
2276
2824
  },
2277
2825
  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",
2278
2826
  children: "+ Add Sprite Sheet"
2279
2827
  }
2280
2828
  )
2281
2829
  ] }),
2282
- a.length === 0 && !u && /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No custom sprite sheets. Basemap icons are available automatically." }),
2283
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-2 mapui:p-0", children: a.map((o, c) => /* @__PURE__ */ l(
2830
+ e.length === 0 && !n && /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:text-sm mapui:text-gray-500", children: "No custom sprite sheets. Basemap icons are available automatically." }),
2831
+ /* @__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, s) => /* @__PURE__ */ l(
2284
2832
  "li",
2285
2833
  {
2286
2834
  className: "mapui:rounded-lg mapui:border mapui:border-gray-200 mapui:bg-white",
2287
2835
  children: [
2288
2836
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-3 mapui:px-3 mapui:py-2", children: [
2289
2837
  /* @__PURE__ */ l("div", { className: "mapui:flex-1 mapui:overflow-hidden", children: [
2290
- /* @__PURE__ */ e("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: o.id }),
2291
- /* @__PURE__ */ e("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: o.url })
2838
+ /* @__PURE__ */ a("span", { className: "mapui:block mapui:text-sm mapui:font-medium mapui:text-gray-800", children: u.id }),
2839
+ /* @__PURE__ */ a("span", { className: "mapui:block mapui:truncate mapui:font-mono mapui:text-xs mapui:text-gray-500", children: u.url })
2292
2840
  ] }),
2293
2841
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:shrink-0 mapui:gap-1", children: [
2294
- /* @__PURE__ */ e(
2842
+ /* @__PURE__ */ a(
2295
2843
  "button",
2296
2844
  {
2297
2845
  type: "button",
2298
- onClick: () => p(t === c ? null : c),
2846
+ onClick: () => r(i === s ? null : s),
2299
2847
  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",
2300
- children: t === c ? "Close" : "Edit"
2848
+ children: i === s ? "Close" : "Edit"
2301
2849
  }
2302
2850
  ),
2303
- /* @__PURE__ */ e(
2851
+ /* @__PURE__ */ a(
2304
2852
  "button",
2305
2853
  {
2306
2854
  type: "button",
2307
- onClick: () => f(o.id),
2855
+ onClick: () => w(u.id),
2308
2856
  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",
2309
2857
  children: "Remove"
2310
2858
  }
2311
2859
  )
2312
2860
  ] })
2313
2861
  ] }),
2314
- t === c && /* @__PURE__ */ e("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ e(ge, { value: o, onChange: s }) })
2862
+ i === s && /* @__PURE__ */ a("div", { className: "mapui:border-t mapui:border-gray-100 mapui:p-3", children: /* @__PURE__ */ a(Ae, { value: u, onChange: d }) })
2315
2863
  ]
2316
2864
  },
2317
- c
2865
+ s
2318
2866
  )) }),
2319
- u && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2320
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
2321
- /* @__PURE__ */ e(ge, { value: r, onChange: m }),
2867
+ n && /* @__PURE__ */ l("div", { className: "mapui:rounded-lg mapui:border mapui:border-blue-200 mapui:bg-blue-50 mapui:p-3", children: [
2868
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-3 mapui:text-xs mapui:font-semibold mapui:text-blue-700", children: "New Sprite Sheet" }),
2869
+ /* @__PURE__ */ a(Ae, { value: p, onChange: b }),
2322
2870
  /* @__PURE__ */ l("div", { className: "mapui:mt-3 mapui:flex mapui:gap-2", children: [
2323
- /* @__PURE__ */ e(
2871
+ /* @__PURE__ */ a(
2324
2872
  "button",
2325
2873
  {
2326
2874
  type: "button",
2327
- onClick: g,
2328
- disabled: !r.id || !r.url || !pa(r.url) || a.some((o) => o.id === r.id),
2875
+ onClick: f,
2876
+ disabled: !p.id || !p.url || !Pa(p.url) || e.some((u) => u.id === p.id),
2329
2877
  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",
2330
2878
  children: "Save"
2331
2879
  }
2332
2880
  ),
2333
- /* @__PURE__ */ e(
2881
+ /* @__PURE__ */ a(
2334
2882
  "button",
2335
2883
  {
2336
2884
  type: "button",
2337
- onClick: () => n(!1),
2885
+ onClick: () => o(!1),
2338
2886
  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",
2339
2887
  children: "Cancel"
2340
2888
  }
2341
2889
  )
2342
2890
  ] })
2343
2891
  ] }),
2344
- /* @__PURE__ */ e(
2345
- G,
2892
+ /* @__PURE__ */ a(
2893
+ Z,
2346
2894
  {
2347
- open: d !== null,
2895
+ open: m !== null,
2348
2896
  title: "Remove Sprite Sheet",
2349
2897
  description: "Are you sure you want to remove this sprite sheet from the configuration?",
2350
- onConfirm: () => d && D(d),
2351
- onCancel: () => f(null)
2898
+ onConfirm: () => m && c(m),
2899
+ onCancel: () => w(null)
2352
2900
  }
2353
2901
  )
2354
2902
  ] });
2355
2903
  }
2356
- const ua = [
2904
+ const Fa = [
2357
2905
  { key: "showLayerPanel", label: "Layer Panel", description: "Toggle layer visibility" },
2358
2906
  { key: "showLegend", label: "Legend", description: "Map legend" },
2359
2907
  { key: "showBasemapSwitcher", label: "Basemap Switcher", description: "Switch basemap styles" },
@@ -2361,49 +2909,50 @@ const ua = [
2361
2909
  { key: "showCoordinateDisplay", label: "Coordinate Display", description: "Show cursor coordinates" },
2362
2910
  { key: "showFeatureDetail", label: "Feature Detail Panel", description: "Inspect feature properties" },
2363
2911
  { key: "showFeatureTooltip", label: "Feature Tooltip", description: "Hover tooltip on features" },
2364
- { key: "showExportButton", label: "Export Button", description: "Export data as CSV" }
2912
+ { key: "showExportButton", label: "Export Button", description: "Export data as CSV" },
2913
+ { key: "showLegendOpacity", label: "Legend Opacity", description: "Expand legend with opacity sliders" }
2365
2914
  ];
2366
- function Na({ value: a, onChange: i }) {
2367
- const t = (p, u) => {
2368
- i({ ...a, [p]: u });
2915
+ function Ha({ value: e, onChange: t }) {
2916
+ const i = (r, n) => {
2917
+ t({ ...e, [r]: n });
2369
2918
  };
2370
2919
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-1", children: [
2371
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-2 mapui:text-xs mapui:text-gray-500", children: "Enable or disable UI panels and controls." }),
2372
- /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: ua.map(({ key: p, label: u, description: n }) => {
2373
- const r = a[p];
2920
+ /* @__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." }),
2921
+ /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-1 mapui:gap-2 sm:mapui:grid-cols-2", children: Fa.map(({ key: r, label: n, description: o }) => {
2922
+ const p = e[r];
2374
2923
  return /* @__PURE__ */ l(
2375
2924
  "label",
2376
2925
  {
2377
2926
  className: "mapui:flex mapui:cursor-pointer mapui:items-center mapui:justify-between mapui:gap-3 mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-white mapui:px-3 mapui:py-2 hover:mapui:bg-gray-50",
2378
2927
  children: [
2379
2928
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
2380
- /* @__PURE__ */ e("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: u }),
2381
- /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-gray-500", children: n })
2929
+ /* @__PURE__ */ a("span", { className: "mapui:text-sm mapui:font-medium mapui:text-gray-800", children: n }),
2930
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: o })
2382
2931
  ] }),
2383
2932
  /* @__PURE__ */ l("div", { className: "mapui:relative mapui:flex mapui:shrink-0 mapui:items-center", children: [
2384
- /* @__PURE__ */ e(
2933
+ /* @__PURE__ */ a(
2385
2934
  "input",
2386
2935
  {
2387
2936
  type: "checkbox",
2388
- checked: r,
2389
- onChange: (m) => t(p, m.target.checked),
2937
+ checked: p,
2938
+ onChange: (b) => i(r, b.target.checked),
2390
2939
  className: "mapui:sr-only",
2391
- "aria-label": u
2940
+ "aria-label": n
2392
2941
  }
2393
2942
  ),
2394
- /* @__PURE__ */ e(
2943
+ /* @__PURE__ */ a(
2395
2944
  "div",
2396
2945
  {
2397
2946
  className: [
2398
2947
  "mapui:relative mapui:h-5 mapui:w-9 mapui:rounded-full mapui:transition-colors",
2399
- r ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
2948
+ p ? "mapui:bg-blue-600" : "mapui:bg-gray-300"
2400
2949
  ].join(" "),
2401
- children: /* @__PURE__ */ e(
2950
+ children: /* @__PURE__ */ a(
2402
2951
  "div",
2403
2952
  {
2404
2953
  className: [
2405
2954
  "mapui:absolute mapui:top-0.5 mapui:h-4 mapui:w-4 mapui:rounded-full mapui:bg-white mapui:shadow mapui:transition-transform",
2406
- r ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
2955
+ p ? "mapui:translate-x-4" : "mapui:translate-x-0.5"
2407
2956
  ].join(" ")
2408
2957
  }
2409
2958
  )
@@ -2412,192 +2961,204 @@ function Na({ value: a, onChange: i }) {
2412
2961
  ] })
2413
2962
  ]
2414
2963
  },
2415
- p
2964
+ r
2416
2965
  );
2417
2966
  }) })
2418
2967
  ] });
2419
2968
  }
2420
- const Ce = [
2969
+ const Ge = [
2421
2970
  { key: "latitude", label: "Latitude", min: -90, max: 90, step: 1e-6, placeholder: "0" },
2422
2971
  { key: "longitude", label: "Longitude", min: -180, max: 180, step: 1e-6, placeholder: "0" },
2423
2972
  { key: "zoom", label: "Zoom", min: 0, max: 24, step: 0.1, placeholder: "2" },
2424
2973
  { key: "pitch", label: "Pitch (°)", min: 0, max: 85, step: 1, placeholder: "0" },
2425
2974
  { key: "bearing", label: "Bearing (°)", min: -180, max: 180, step: 1, placeholder: "0" }
2426
2975
  ];
2427
- function na(a, i) {
2428
- const t = Ce.find((p) => p.key === a);
2429
- if (t) {
2430
- if (isNaN(i)) return "Must be a number";
2431
- if (i < t.min) return `Must be at least ${t.min}`;
2432
- if (i > t.max) return `Must be at most ${t.max}`;
2976
+ function Ma(e, t) {
2977
+ const i = Ge.find((r) => r.key === e);
2978
+ if (i) {
2979
+ if (isNaN(t)) return "Must be a number";
2980
+ if (t < i.min) return `Must be at least ${i.min}`;
2981
+ if (t > i.max) return `Must be at most ${i.max}`;
2433
2982
  }
2434
2983
  }
2435
- const oa = "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";
2436
- function ka({ value: a, onChange: i }) {
2437
- const t = (p, u) => {
2438
- const n = parseFloat(u);
2439
- i({ ...a, [p]: isNaN(n) ? 0 : n });
2984
+ const Oa = "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";
2985
+ function Ja({ value: e, onChange: t }) {
2986
+ const i = (r, n) => {
2987
+ const o = parseFloat(n);
2988
+ t({ ...e, [r]: isNaN(o) ? 0 : o });
2440
2989
  };
2441
- return /* @__PURE__ */ e("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ce.map(({ key: p, label: u, min: n, max: r, step: m, placeholder: d }) => {
2442
- const f = na(p, a[p]);
2443
- return /* @__PURE__ */ e(N, { label: u, error: f, children: /* @__PURE__ */ e(
2990
+ return /* @__PURE__ */ a("div", { className: "mapui:grid mapui:grid-cols-2 mapui:gap-3", children: Ge.map(({ key: r, label: n, min: o, max: p, step: b, placeholder: m }) => {
2991
+ const w = Ma(r, e[r]);
2992
+ return /* @__PURE__ */ a(S, { label: n, error: w, children: /* @__PURE__ */ a(
2444
2993
  "input",
2445
2994
  {
2446
2995
  type: "number",
2447
- min: n,
2448
- max: r,
2449
- step: m,
2450
- value: a[p],
2451
- placeholder: d,
2452
- onChange: (s) => t(p, s.target.value),
2453
- className: `${oa} ${f ? "mapui:border-red-400" : ""}`
2996
+ min: o,
2997
+ max: p,
2998
+ step: b,
2999
+ value: e[r],
3000
+ placeholder: m,
3001
+ onChange: (d) => i(r, d.target.value),
3002
+ className: `${Oa} ${w ? "mapui:border-red-400" : ""}`
2454
3003
  }
2455
- ) }, p);
3004
+ ) }, r);
2456
3005
  }) });
2457
3006
  }
2458
- function Ca({ config: a }) {
2459
- const i = Ee(a);
3007
+ function Ka({ config: e }) {
3008
+ const t = Xe(e);
2460
3009
  return /* @__PURE__ */ l("div", { className: "mapui:flex mapui:flex-col mapui:gap-3", children: [
2461
3010
  /* @__PURE__ */ l("div", { className: "mapui:flex mapui:items-center mapui:gap-2", children: [
2462
- /* @__PURE__ */ e(
3011
+ /* @__PURE__ */ a(
2463
3012
  "span",
2464
3013
  {
2465
3014
  className: [
2466
3015
  "mapui:inline-flex mapui:items-center mapui:rounded-full mapui:px-2.5 mapui:py-0.5 mapui:text-xs mapui:font-semibold",
2467
- i.success ? "mapui:bg-green-100 mapui:text-green-800" : "mapui:bg-red-100 mapui:text-red-800"
3016
+ t.success ? "mapui:bg-green-100 mapui:text-green-800" : "mapui:bg-red-100 mapui:text-red-800"
2468
3017
  ].join(" "),
2469
- children: i.success ? "Valid" : "Invalid"
3018
+ children: t.success ? "Valid" : "Invalid"
2470
3019
  }
2471
3020
  ),
2472
- /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-gray-500", children: "MapConfig validation" })
3021
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-gray-500", children: "MapConfig validation" })
2473
3022
  ] }),
2474
- !i.success && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3", children: [
2475
- /* @__PURE__ */ e("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:font-semibold mapui:text-red-700", children: "Validation Errors" }),
2476
- /* @__PURE__ */ e("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: i.error.errors.map((t, p) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
2477
- /* @__PURE__ */ e("span", { className: "mapui:font-mono mapui:text-xs mapui:text-red-600", children: t.path.join(" > ") || "root" }),
2478
- /* @__PURE__ */ e("span", { className: "mapui:text-xs mapui:text-red-800", children: t.message })
2479
- ] }, p)) })
3023
+ !t.success && /* @__PURE__ */ l("div", { className: "mapui:rounded mapui:bg-red-50 mapui:p-3", children: [
3024
+ /* @__PURE__ */ a("p", { className: "mapui:m-0 mapui:mb-1 mapui:text-xs mapui:font-semibold mapui:text-red-700", children: "Validation Errors" }),
3025
+ /* @__PURE__ */ a("ul", { className: "mapui:m-0 mapui:list-none mapui:flex mapui:flex-col mapui:gap-1 mapui:p-0", children: t.error.errors.map((i, r) => /* @__PURE__ */ l("li", { className: "mapui:flex mapui:flex-col mapui:gap-0.5", children: [
3026
+ /* @__PURE__ */ a("span", { className: "mapui:font-mono mapui:text-xs mapui:text-red-600", children: i.path.join(" > ") || "root" }),
3027
+ /* @__PURE__ */ a("span", { className: "mapui:text-xs mapui:text-red-800", children: i.message })
3028
+ ] }, r)) })
2480
3029
  ] }),
2481
- /* @__PURE__ */ e("div", { className: "mapui:overflow-auto mapui:rounded mapui:border mapui:border-gray-200 mapui:bg-gray-50", children: /* @__PURE__ */ e("pre", { className: "mapui:m-0 mapui:p-3 mapui:text-xs mapui:text-gray-800 mapui:whitespace-pre", children: JSON.stringify(a, null, 2) }) })
3030
+ /* @__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) }) })
2482
3031
  ] });
2483
3032
  }
2484
3033
  export {
2485
- Oi as BasemapConfigSchema,
2486
- ce as BasemapEditor,
2487
- wa as BasemapList,
2488
- La as BasemapSwitcher,
2489
- Mi as CircleLayoutSchema,
2490
- Pi as CirclePaintSchema,
2491
- ji as CircleStyleSchema,
2492
- Ia as CollapsibleControl,
2493
- ha as CollectionBrowser,
2494
- fe as ColorPicker,
2495
- Ca as ConfigPreview,
2496
- G as ConfirmDialog,
2497
- Ea as CoordinateDisplay,
2498
- Ri as DatetimeSearchFieldSchema,
2499
- Pa as ExportButton,
2500
- Ra as FeatureDetailPanel,
2501
- Ba as FeatureTooltip,
2502
- $i as FillLayoutSchema,
2503
- Bi as FillPaintSchema,
2504
- Ui as FillStyleSchema,
2505
- qi as FilterConfigSchema,
2506
- N as FormField,
2507
- Wi as LayerConfigSchema,
2508
- se as LayerEditor,
2509
- xa as LayerList,
2510
- qa as LayerPanel,
2511
- za as Legend,
2512
- zi as LegendConfigSchema,
2513
- He as LegendEditor,
2514
- _e as LegendEntryEditor,
2515
- Vi as LegendEntrySchema,
2516
- Gi as LineLayoutSchema,
2517
- Yi as LinePaintSchema,
2518
- Xi as LineStyleSchema,
2519
- _i as MapConfigSchema,
2520
- Hi as NumberSearchFieldSchema,
2521
- Ji as OgcApiSourceSchema,
2522
- Ki as PropertyDisplayConfigSchema,
2523
- ia as PropertyDisplayEditor,
2524
- Qi as PropertyDisplaySchema,
2525
- Zi as SearchConfigSchema,
2526
- Ke as SearchFieldEditor,
2527
- Ze as SearchFieldList,
2528
- et as SearchFieldSchema,
2529
- Ga as SearchPanel,
2530
- at as SelectSearchFieldSchema,
2531
- ie as SourceEditor,
2532
- ba as SourceList,
2533
- ge as SpriteSourceEditor,
2534
- va as SpriteSourceList,
2535
- it as SpriteSourceSchema,
2536
- tt as StyleConfigSchema,
2537
- Xe as StyleEditor,
2538
- rt as SymbolLayoutSchema,
2539
- lt as SymbolPaintSchema,
2540
- pt as SymbolStyleSchema,
2541
- ut as TextSearchFieldSchema,
2542
- Na as UIConfigEditor,
2543
- nt as UIConfigSchema,
2544
- ot as ViewConfigSchema,
2545
- ka as ViewEditor,
2546
- Xa as and,
2547
- _a as between,
2548
- we as defaultCircle,
2549
- Q as defaultFill,
2550
- xe as defaultLine,
2551
- ke as detectGeometryTypeFromQueryables,
2552
- ya as detectStyleTypeForCollection,
2553
- Ha as downloadCsv,
2554
- Ja as eq,
2555
- ra as extractGeometryType,
2556
- Ka as featuresToCsv,
2557
- Qa as fetchCollectionDetail,
2558
- Za as fetchCollections,
2559
- ei as fetchConformance,
2560
- ai as fetchDistinctValues,
2561
- ii as fetchFeatureCount,
2562
- ye as fetchFeatures,
2563
- Ie as fetchQueryables,
2564
- ti as fetchSpriteNames,
2565
- ri as fetchSpriteUrlFromStyle,
2566
- li as fetchTileJson,
2567
- Fa as formatDMS,
2568
- Oa as formatDecimal,
2569
- pi as fromSimpleFilters,
2570
- ui as fromStructuredFilters,
2571
- Z as geometryTypeToStyleType,
2572
- ni as getCql2FilteredVectorTileUrl,
2573
- oi as getFilteredVectorTileUrl,
2574
- mi as getTileJsonUrl,
2575
- si as getVectorTileUrl,
2576
- ci as gt,
2577
- di as gte,
2578
- fa as humanizePropertyName,
2579
- gi as inList,
2580
- ta as isGeometryProperty,
2581
- bi as isNull,
2582
- hi as like,
2583
- yi as lt,
2584
- fi as lte,
2585
- xi as neq,
2586
- wi as not,
2587
- vi as or,
2588
- Ni as resolveAvailableIcons,
2589
- ki as resolvePropertyDisplay,
2590
- Ci as resolveStyleWithSprites,
2591
- Ee as safeValidateMapConfig,
2592
- Si as serializeCql2,
2593
- Di as tAfter,
2594
- Li as tBefore,
2595
- Ti as tDuring,
2596
- la as toAvailableProperties,
2597
- Ii as useCsvExport,
2598
- Ai as useOgcCollectionDetail,
2599
- he as useOgcCollections,
2600
- Ei as useOgcFeatures,
2601
- Ae as useOgcQueryables,
2602
- mt as validateMapConfig
3034
+ li as BasemapConfigSchema,
3035
+ Le as BasemapEditor,
3036
+ Ya as BasemapList,
3037
+ et as BasemapSwitcher,
3038
+ ni as CircleLayoutSchema,
3039
+ pi as CirclePaintSchema,
3040
+ oi as CircleStyleSchema,
3041
+ tt as CollapsibleControl,
3042
+ Wa as CollectionBrowser,
3043
+ Y as ColorPicker,
3044
+ Ka as ConfigPreview,
3045
+ Z as ConfirmDialog,
3046
+ rt as CoordinateDisplay,
3047
+ ui as DatetimeSearchFieldSchema,
3048
+ ot as ExportButton,
3049
+ mt as FeatureDetailPanel,
3050
+ ct as FeatureTooltip,
3051
+ mi as FillLayoutSchema,
3052
+ si as FillPaintSchema,
3053
+ ci as FillStyleSchema,
3054
+ di as FilterConfigSchema,
3055
+ S as FormField,
3056
+ hi as LayerConfigSchema,
3057
+ Te as LayerEditor,
3058
+ _a as LayerList,
3059
+ ht as LayerPanel,
3060
+ bt as Legend,
3061
+ gi as LegendConfigSchema,
3062
+ va as LegendEditor,
3063
+ wa as LegendEntryEditor,
3064
+ bi as LegendEntrySchema,
3065
+ yi as LineLayoutSchema,
3066
+ fi as LinePaintSchema,
3067
+ xi as LineStyleSchema,
3068
+ wi as MapConfigSchema,
3069
+ vi as NumberSearchFieldSchema,
3070
+ Ni as OgcApiSourceSchema,
3071
+ ki as PropertyDisplayConfigSchema,
3072
+ La as PropertyDisplayEditor,
3073
+ Ci as PropertyDisplaySchema,
3074
+ Si as SearchConfigSchema,
3075
+ ka as SearchFieldEditor,
3076
+ Sa as SearchFieldList,
3077
+ Di as SearchFieldSchema,
3078
+ ft as SearchPanel,
3079
+ Ti as SelectSearchFieldSchema,
3080
+ de as SourceEditor,
3081
+ Ua as SourceList,
3082
+ Ae as SpriteSourceEditor,
3083
+ Xa as SpriteSourceList,
3084
+ Li as SpriteSourceSchema,
3085
+ Ii as StyleConfigSchema,
3086
+ xa as StyleEditor,
3087
+ Ai as SymbolLayoutSchema,
3088
+ Ei as SymbolPaintSchema,
3089
+ Pi as SymbolStyleSchema,
3090
+ Fi as TextSearchFieldSchema,
3091
+ Ha as UIConfigEditor,
3092
+ Mi as UIConfigSchema,
3093
+ Oi as ViewConfigSchema,
3094
+ Ja as ViewEditor,
3095
+ wt as and,
3096
+ vt as between,
3097
+ $e as defaultCircle,
3098
+ me as defaultFill,
3099
+ je as defaultLine,
3100
+ Re as defaultSymbol,
3101
+ We as detectGeometryStyleTypesFromQueryables,
3102
+ Aa as detectGeometryTypeFromQueryables,
3103
+ Ga as detectStyleTypeForCollection,
3104
+ za as detectStyleTypesForCollection,
3105
+ Nt as downloadCsv,
3106
+ kt as eq,
3107
+ Oe as expressionColors,
3108
+ la as expressionEntries,
3109
+ na as expressionPropertyName,
3110
+ ra as expressionType,
3111
+ qe as extractGeometryType,
3112
+ Ct as featuresToCsv,
3113
+ St as fetchCollectionDetail,
3114
+ Dt as fetchCollections,
3115
+ Tt as fetchConformance,
3116
+ Ye as fetchDistinctValues,
3117
+ Lt as fetchFeatureCount,
3118
+ se as fetchFeatures,
3119
+ Me as fetchQueryables,
3120
+ It as fetchSpriteNames,
3121
+ At as fetchSpriteUrlFromStyle,
3122
+ Et as fetchTileJson,
3123
+ lt as formatDMS,
3124
+ nt as formatDecimal,
3125
+ Pt as fromSimpleFilters,
3126
+ Ft as fromStructuredFilters,
3127
+ Ue as geometryTypeToStyleType,
3128
+ ce as geometryTypeToStyleTypes,
3129
+ ae as getColorFromPalette,
3130
+ Mt as getCql2FilteredVectorTileUrl,
3131
+ Ot as getFilteredVectorTileUrl,
3132
+ pa as getPrimaryColor,
3133
+ oa as getShapeForStyleType,
3134
+ jt as getTileJsonUrl,
3135
+ $t as getVectorTileUrl,
3136
+ Rt as gt,
3137
+ Bt as gte,
3138
+ Va as humanizePropertyName,
3139
+ qt as inList,
3140
+ G as isExpression,
3141
+ Ia as isGeometryProperty,
3142
+ Ut as isNull,
3143
+ Wt as like,
3144
+ Gt as lt,
3145
+ zt as lte,
3146
+ Vt as neq,
3147
+ _t as not,
3148
+ Yt as or,
3149
+ Xt as resolveAvailableIcons,
3150
+ Ht as resolvePropertyDisplay,
3151
+ Jt as resolveStyleWithSprites,
3152
+ Xe as safeValidateMapConfig,
3153
+ Kt as serializeCql2,
3154
+ Qt as tAfter,
3155
+ Zt as tBefore,
3156
+ ei as tDuring,
3157
+ Ea as toAvailableProperties,
3158
+ ai as useCsvExport,
3159
+ ti as useOgcCollectionDetail,
3160
+ Fe as useOgcCollections,
3161
+ ii as useOgcFeatures,
3162
+ _e as useOgcQueryables,
3163
+ ji as validateMapConfig
2603
3164
  };