@element-editor/ui 0.2.0 → 0.2.2

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 (38) hide show
  1. package/AGENTS.md +1 -1
  2. package/dist/{BooleanOperations-oF0WybQP.js → BooleanOperations-CUQDHcha.js} +2 -2
  3. package/dist/{BooleanOperations-WXcmW9Vy.cjs → BooleanOperations-DrQS-3mJ.cjs} +1 -1
  4. package/dist/{DataTable-CNfB01y2.cjs → DataTable-BPtIbZh4.cjs} +1 -1
  5. package/dist/{DataTable-DNmjUwka.js → DataTable-Ce5P1HaO.js} +4 -4
  6. package/dist/{DataTablePanel-rWdaQubk.js → DataTablePanel-DqS1lhWv.js} +2 -2
  7. package/dist/{DataTablePanel-BknCxC1K.cjs → DataTablePanel-PH5qtwrD.cjs} +1 -1
  8. package/dist/EditToolbarBtn-Ch9HCLHq.cjs +3 -0
  9. package/dist/{EditToolbarBtn-SZIsnIn3.js → EditToolbarBtn-SR4xHd8G.js} +39 -39
  10. package/dist/{FeatureEditModal-CM6BObUO.cjs → FeatureEditModal-BNil19oc.cjs} +1 -1
  11. package/dist/{FeatureEditModal-BF-fGhVD.js → FeatureEditModal-DvdBiMck.js} +2 -2
  12. package/dist/{FeatureList-CQb2kTrV.js → FeatureList-DJTd3gEU.js} +2 -2
  13. package/dist/{FeatureList-Csr-anLA.cjs → FeatureList-F3BgjXro.cjs} +1 -1
  14. package/dist/{FeatureRowContextMenu-Gwq3OMEA.cjs → FeatureRowContextMenu-Bw9Z6mpN.cjs} +1 -1
  15. package/dist/{FeatureRowContextMenu-BLt7VlUU.js → FeatureRowContextMenu-Dlsk7erC.js} +2 -2
  16. package/dist/{GeoJSONModal-BPFWeaLZ.js → GeoJSONModal-BhHkqLAR.js} +3 -3
  17. package/dist/{GeoJSONModal-iwUcvrg7.cjs → GeoJSONModal-D6JBr9FA.cjs} +1 -1
  18. package/dist/{SchemaEditor-qkoYMg0C.cjs → SchemaEditor-B4L17K1e.cjs} +1 -1
  19. package/dist/{SchemaEditor-BEsKUe2p.js → SchemaEditor-ryoTgaLb.js} +1 -1
  20. package/dist/{SchemaModal-GrtgA7cH.cjs → SchemaModal-5F0HBHGS.cjs} +1 -1
  21. package/dist/{SchemaModal-9nNrgorr.js → SchemaModal-CI5i_Kxh.js} +3 -3
  22. package/dist/{SettingsModal-DTP0Xx_Z.js → SettingsModal-4OuBLPyW.js} +2 -2
  23. package/dist/{SettingsModal-6_qmRyCi.cjs → SettingsModal-au03oFaJ.cjs} +1 -1
  24. package/dist/{ShortcutsModal-CdyQlrqK.cjs → ShortcutsModal-DBE-gSUi.cjs} +1 -1
  25. package/dist/{ShortcutsModal-DwxZu71W.js → ShortcutsModal-jGmjontP.js} +3 -3
  26. package/dist/contexts/ElementEditorConfigContext.d.cts +1 -1
  27. package/dist/contexts/ElementEditorConfigContext.d.ts +1 -1
  28. package/dist/element-editor-ui.cjs +1 -1
  29. package/dist/element-editor-ui.es.js +2 -2
  30. package/dist/index-mfb91TEp.cjs +1 -0
  31. package/dist/{index-CtZterPc.js → index-rT-R0kyV.js} +947 -907
  32. package/dist/primitives.cjs +1 -1
  33. package/dist/primitives.es.js +1 -1
  34. package/dist/{useWindowFocus-D-_yEm_V.cjs → useWindowFocus-CRWNNxOL.cjs} +1 -1
  35. package/dist/{useWindowFocus-DGAWA1au.js → useWindowFocus-CroxgGOo.js} +1 -1
  36. package/package.json +2 -2
  37. package/dist/EditToolbarBtn-dpCmKnzk.cjs +0 -3
  38. package/dist/index-BKdDZ4Y9.cjs +0 -1
@@ -1,79 +1,79 @@
1
- var Tr = Object.defineProperty;
2
- var Ar = (t, e, n) => e in t ? Tr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var Pt = (t, e, n) => Ar(t, typeof e != "symbol" ? e + "" : e, n);
4
- import Fr, { lazy as _t, useState as q, createElement as zr, useContext as tt, useCallback as J, createContext as Lr, useRef as B, useLayoutEffect as pe, useEffect as $, useMemo as ue, isValidElement as Rr, cloneElement as $r, memo as Gt, Suspense as Ut, useId as Kr } from "react";
5
- import { e as oe, h as le, g as Ae, b as Or, s as jt, u as S, f as U, l as Br, E as Wr, T as _r, m as Gr, M as Ur } from "./useAdapterControls-DVjkwRZ_.js";
6
- import { jsx as r, jsxs as T, Fragment as ae } from "react/jsx-runtime";
7
- import { u as ce, f as jr, e as qr, w as Hr, E as Vr } from "./useAccentStyle-CPo2XqAn.js";
8
- import { loadCustomBindings as Jr, syncShortcutCache as $e, getEffectiveKey as qt, findConflict as Xr, saveCustomBindings as Xe, getCurrentKey as Zr, isMultiGeometry as Yr, getPartCount as rt, sidebarTakesSpace as nt, NARROW_EDITOR_WIDTH as Dt, getPartGeometry as Qr, getPartLabel as en, BOUNDARIES_SCHEMA_ID as tn, featureLimitMessage as rn, canProcessShape as Fe, setGeometryRunner as nn, countShapeVertices as Ke, resolveUnitSystem as on, isLineGeometryType as sn, placeBox as an } from "@element-editor/core/internal";
9
- import { getGeometryBBox as ot, readStorage as Ht, writeStorage as ln, getFixedShortcutDisplay as Vt, ElementEditorError as Be, formatLength as It, subscribeToDataChanges as cn, readAccentPalette as Mt, DEFAULT_MAX_IMPORT_BYTES as dn, parseGeoJSONText as un } from "@element-editor/core";
10
- import { MapPinPlus as mn, SidebarSimple as Jt, ArrowLeft as fn, CopySimple as Xt, Trash as ze, CaretDown as pn, CaretRight as hn, Check as gn, Copy as yn, FolderPlus as bn, MapPin as Zt, Polygon as Yt, StackSimple as Ye, LineSegment as Qt, PencilSimple as vn, EyeClosed as Qe, Eye as st, Folder as xn, FolderOpen as wn, DotsThree as kn, Pencil as Sn, FolderMinus as Cn, Path as Nn, Circle as En, Rectangle as Pn, ScribbleLoop as Dn, HandTap as In, Ruler as Mn, MagnifyingGlass as Ze, X as Tt, Resize as er, Scissors as tr, Knife as rr, WaveSine as nr, SquareLogo as or, Shapes as sr, StackPlus as ir, LineSegments as Tn, DotOutline as An, Crosshair as Fn, ArrowArcRight as zn, ArrowArcLeft as Ln, ArrowsHorizontal as Rn, Hexagon as $n, CircleHalfTilt as Kn, CornersOut as On, NavigationArrow as Bn } from "@phosphor-icons/react";
11
- import { useShallow as Wn } from "zustand/react/shallow";
12
- import { i as _n, c as ar, I as At, T as Gn, f as be, a as Q, B as we, b as Ie, C as lr, S as Ft, d as me, g as zt, K as Oe, E as te, e as Ne, h as Un } from "./EditToolbarBtn-SZIsnIn3.js";
13
- import { clsx as ne } from "clsx";
14
- import { createPortal as cr } from "react-dom";
15
- import { centroid as jn } from "@turf/centroid";
16
- import { featureCollection as qn } from "@turf/helpers";
17
- import { bbox as dr } from "@turf/bbox";
18
- function fe(t) {
1
+ var Fr = Object.defineProperty;
2
+ var zr = (t, e, n) => e in t ? Fr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var Dt = (t, e, n) => zr(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import Lr, { lazy as Ut, useState as q, createElement as Rr, useContext as rt, useCallback as J, createContext as $r, useRef as B, useLayoutEffect as fe, useEffect as $, useMemo as ue, isValidElement as Kr, cloneElement as Or, memo as jt, Suspense as qt, useId as Br } from "react";
5
+ import { e as se, h as le, g as ze, b as Wr, s as Ht, u as S, f as U, l as _r, E as Gr, T as Ur, m as jr, M as qr } from "./useAdapterControls-DVjkwRZ_.js";
6
+ import { jsx as r, jsxs as T, Fragment as re } from "react/jsx-runtime";
7
+ import { u as ce, f as Hr, e as Vr, w as Jr, E as Xr } from "./useAccentStyle-CPo2XqAn.js";
8
+ import { loadCustomBindings as Zr, syncShortcutCache as Oe, getEffectiveKey as Vt, findConflict as Yr, saveCustomBindings as Ze, getCurrentKey as Qr, isMultiGeometry as en, getPartCount as nt, sidebarTakesSpace as ot, NARROW_EDITOR_WIDTH as It, getPartGeometry as tn, getPartLabel as rn, BOUNDARIES_SCHEMA_ID as nn, featureLimitMessage as on, canProcessShape as Le, setGeometryRunner as sn, countShapeVertices as Be, resolveUnitSystem as an, isLineGeometryType as ln, placeBox as cn } from "@element-editor/core/internal";
9
+ import { getGeometryBBox as st, readStorage as Jt, writeStorage as dn, getFixedShortcutDisplay as Xt, ElementEditorError as We, formatLength as Mt, subscribeToDataChanges as un, readAccentPalette as Tt, DEFAULT_MAX_IMPORT_BYTES as mn, parseGeoJSONText as fn } from "@element-editor/core";
10
+ import { MapPinPlus as pn, SidebarSimple as Zt, ArrowLeft as hn, CopySimple as Yt, Trash as Re, CaretDown as gn, CaretRight as yn, Check as bn, Copy as vn, FolderPlus as xn, MapPin as Qt, Polygon as er, StackSimple as Qe, LineSegment as tr, PencilSimple as wn, EyeClosed as et, Eye as it, Folder as kn, FolderOpen as Sn, DotsThree as Cn, Pencil as Nn, FolderMinus as En, Path as Pn, Circle as Dn, Rectangle as In, ScribbleLoop as Mn, HandTap as Tn, Ruler as An, MagnifyingGlass as Ye, X as At, Resize as rr, Scissors as nr, Knife as or, WaveSine as sr, SquareLogo as ir, Shapes as ar, StackPlus as lr, LineSegments as Fn, DotOutline as zn, Crosshair as Ln, ArrowArcRight as Rn, ArrowArcLeft as $n, ArrowsHorizontal as Kn, Hexagon as On, CircleHalfTilt as Bn, CornersOut as Wn, NavigationArrow as _n } from "@phosphor-icons/react";
11
+ import { useShallow as Gn } from "zustand/react/shallow";
12
+ import { i as Un, c as cr, I as Ft, T as jn, f as ve, a as Q, B as ke, b as Me, C as dr, S as zt, d as me, g as Lt, K as Ee, E as te, e as Te, h as qn } from "./EditToolbarBtn-SR4xHd8G.js";
13
+ import { clsx as oe } from "clsx";
14
+ import { createPortal as ur } from "react-dom";
15
+ import { centroid as Hn } from "@turf/centroid";
16
+ import { featureCollection as Vn } from "@turf/helpers";
17
+ import { bbox as mr } from "@turf/bbox";
18
+ function pe(t) {
19
19
  let e = null, n = null;
20
- const s = () => e ?? (e = t().then((i) => (n = i.default, i))), o = _t(s);
20
+ const s = () => e ?? (e = t().then((i) => (n = i.default, i))), o = Ut(s);
21
21
  function d(i) {
22
22
  const [m] = q(() => n ?? o);
23
- return zr(m, i);
23
+ return Rr(m, i);
24
24
  }
25
25
  return Object.assign(d, { preload: s });
26
26
  }
27
- const ur = [];
28
- function it(...t) {
29
- for (const e of t) ur.push(e.preload);
27
+ const fr = [];
28
+ function at(...t) {
29
+ for (const e of t) fr.push(e.preload);
30
30
  }
31
- let Lt = !1;
32
- function Ks() {
33
- if (Lt || typeof window > "u") return;
34
- Lt = !0;
31
+ let Rt = !1;
32
+ function Gs() {
33
+ if (Rt || typeof window > "u") return;
34
+ Rt = !0;
35
35
  const t = () => {
36
- for (const n of ur) n().catch(() => {
36
+ for (const n of fr) n().catch(() => {
37
37
  });
38
38
  }, e = window.requestIdleCallback;
39
39
  e ? e(t, { timeout: 3e3 }) : setTimeout(t, 1500);
40
40
  }
41
- const at = Lr(null);
42
- function Hn({ children: t }) {
41
+ const lt = $r(null);
42
+ function Jn({ children: t }) {
43
43
  const e = ce(), [n, s] = q(() => {
44
- const c = Jr(e);
45
- return $e(c), c;
46
- }), o = J((c) => qt(c, n), [n]), d = J((c, y) => {
47
- const f = Xr(y, c, n);
44
+ const l = Zr(e);
45
+ return Oe(l), l;
46
+ }), o = J((l) => Vt(l, n), [n]), d = J((l, h) => {
47
+ const f = Yr(h, l, n);
48
48
  if (f) return f;
49
- const h = { ...n, [c]: y };
50
- return s(h), Xe(h, e), $e(h), null;
51
- }, [n, e]), i = J((c) => {
52
- const y = { ...n };
53
- delete y[c], s(y), Xe(y, e), $e(y);
49
+ const g = { ...n, [l]: h };
50
+ return s(g), Ze(g, e), Oe(g), null;
51
+ }, [n, e]), i = J((l) => {
52
+ const h = { ...n };
53
+ delete h[l], s(h), Ze(h, e), Oe(h);
54
54
  }, [n, e]), m = J(() => {
55
- s({}), Xe({}, e), $e({});
55
+ s({}), Ze({}, e), Oe({});
56
56
  }, [e]);
57
- return /* @__PURE__ */ r(at.Provider, { value: { custom: n, getKey: o, setKey: d, resetKey: i, resetAll: m }, children: t });
57
+ return /* @__PURE__ */ r(lt.Provider, { value: { custom: n, getKey: o, setKey: d, resetKey: i, resetAll: m }, children: t });
58
58
  }
59
- function Vn() {
60
- return tt(at);
59
+ function Xn() {
60
+ return rt(lt);
61
61
  }
62
- function Ee() {
63
- const t = tt(at);
62
+ function Pe() {
63
+ const t = rt(lt);
64
64
  if (!t) throw new Error("useShortcutConfig must be used inside ShortcutConfigProvider");
65
65
  return t;
66
66
  }
67
- const mr = fe(() => import("./FeatureList-CQb2kTrV.js")), Jn = fe(() => import("./DataTable-DNmjUwka.js")), Xn = fe(() => import("./SchemaEditor-BEsKUe2p.js"));
68
- it(mr, Jn, Xn);
69
- function Zn() {
67
+ const pr = pe(() => import("./FeatureList-DJTd3gEU.js")), Zn = pe(() => import("./DataTable-Ce5P1HaO.js")), Yn = pe(() => import("./SchemaEditor-ryoTgaLb.js"));
68
+ at(pr, Zn, Yn);
69
+ function Qn() {
70
70
  return /* @__PURE__ */ T("div", { className: "flex flex-col items-center justify-center gap-3 h-full text-elm-text-muted", children: [
71
- /* @__PURE__ */ r(mn, { size: 40, weight: "light" }),
71
+ /* @__PURE__ */ r(pn, { size: 40, weight: "light" }),
72
72
  /* @__PURE__ */ r("p", { className: "text-sm text-center text-balance leading-snug", children: "No features yet — add a point, line, or area" })
73
73
  ] });
74
74
  }
75
- const Yn = () => typeof navigator < "u" && /Mac/.test(navigator.platform);
76
- function Qn(t) {
75
+ const eo = () => typeof navigator < "u" && /Mac/.test(navigator.platform);
76
+ function to(t) {
77
77
  const e = t == null ? void 0 : t.name;
78
78
  return {
79
79
  type: "error",
@@ -84,7 +84,7 @@ function Qn(t) {
84
84
  quiet: !0
85
85
  };
86
86
  }
87
- function eo(t, e) {
87
+ function ro(t, e) {
88
88
  if (e.length === 0) return t.map((s) => s.id);
89
89
  const n = [];
90
90
  for (const s of e)
@@ -94,7 +94,7 @@ function eo(t, e) {
94
94
  s.groupId || n.push(s.id);
95
95
  return n;
96
96
  }
97
- function Os(t, e) {
97
+ function Us(t, e) {
98
98
  const n = [];
99
99
  for (const s of e)
100
100
  if (!s.collapsed)
@@ -102,35 +102,35 @@ function Os(t, e) {
102
102
  for (const s of t) s.groupId || n.push(s.id);
103
103
  return n;
104
104
  }
105
- const to = "data-elm-window", et = /* @__PURE__ */ new WeakMap();
106
- function ro(t) {
107
- const e = et.get(t);
105
+ const no = "data-elm-window", tt = /* @__PURE__ */ new WeakMap();
106
+ function oo(t) {
107
+ const e = tt.get(t);
108
108
  if (!(e != null && e.size)) return !1;
109
109
  let n = null;
110
110
  for (const s of e) (!n || s.z() > n.z()) && (n = s);
111
111
  return n == null || n.close(), !!n;
112
112
  }
113
- function Bs(t, e, n, s, { topWindow: o = !0 } = {}) {
114
- const { uiStore: d } = oe(), i = B(n), m = B(s);
115
- pe(() => {
113
+ function js(t, e, n, s, { topWindow: o = !0 } = {}) {
114
+ const { uiStore: d } = se(), i = B(n), m = B(s);
115
+ fe(() => {
116
116
  i.current = n, m.current = s;
117
117
  }), $(() => {
118
118
  if (!e) return;
119
- const c = document.activeElement, y = { z: () => m.current, close: () => i.current() };
120
- let f = et.get(d);
121
- f || et.set(d, f = /* @__PURE__ */ new Set()), o && f.add(y);
122
- const h = t.current;
119
+ const l = document.activeElement, h = { z: () => m.current, close: () => i.current() };
120
+ let f = tt.get(d);
121
+ f || tt.set(d, f = /* @__PURE__ */ new Set()), o && f.add(h);
122
+ const g = t.current;
123
123
  function u(x) {
124
- x.key !== "Escape" || x.defaultPrevented || !(h != null && h.contains(x.target)) || (x.preventDefault(), i.current());
124
+ x.key !== "Escape" || x.defaultPrevented || !(g != null && g.contains(x.target)) || (x.preventDefault(), i.current());
125
125
  }
126
126
  return document.addEventListener("keydown", u), () => {
127
- f.delete(y), document.removeEventListener("keydown", u);
127
+ f.delete(h), document.removeEventListener("keydown", u);
128
128
  const x = document.activeElement;
129
- (!x || x === document.body || ((h == null ? void 0 : h.contains(x)) ?? !1) || !x.isConnected) && (c != null && c.isConnected) && c !== document.body && c.focus({ preventScroll: !0 });
129
+ (!x || x === document.body || ((g == null ? void 0 : g.contains(x)) ?? !1) || !x.isConnected) && (l != null && l.isConnected) && l !== document.body && l.focus({ preventScroll: !0 });
130
130
  };
131
131
  }, [e, t, d, o]);
132
132
  }
133
- function no() {
133
+ function so() {
134
134
  return new Promise((t) => {
135
135
  const e = document.createElement("input");
136
136
  e.type = "file", e.accept = ".geojson,.json,application/geo+json,application/json", e.style.display = "none", document.body.appendChild(e);
@@ -147,76 +147,76 @@ function no() {
147
147
  }, { once: !0 }), e.click();
148
148
  });
149
149
  }
150
- const Ce = /* @__PURE__ */ new Map();
151
- function fr(t) {
150
+ const Ne = /* @__PURE__ */ new Map();
151
+ function hr(t) {
152
152
  if (t.closest("[data-elm-portal]")) return !0;
153
153
  let e = t;
154
154
  for (; e.parentElement && e.parentElement !== document.body; ) e = e.parentElement;
155
155
  return e.parentElement === document.body && (e.hasAttribute("data-elm-theme") || e.hasAttribute("data-elm-portal"));
156
156
  }
157
- function oo(t, e) {
157
+ function io(t, e) {
158
158
  if (!e || t.composedPath().includes(e.root)) return !0;
159
159
  const n = document.activeElement;
160
- return !n || n === document.body || fr(n) ? e.pointerInside ?? Ce.size === 1 : !1;
160
+ return !n || n === document.body || hr(n) ? e.pointerInside ?? Ne.size === 1 : !1;
161
161
  }
162
- function ke() {
163
- const { uiStore: t } = oe();
164
- return J((e) => oo(e, Ce.get(t)), [t]);
162
+ function Se() {
163
+ const { uiStore: t } = se();
164
+ return J((e) => io(e, Ne.get(t)), [t]);
165
165
  }
166
- const so = 140;
167
- function io(t, e) {
166
+ const ao = 140;
167
+ function lo(t, e) {
168
168
  t.querySelectorAll(`[data-elm-shortcut="${e}"]`).forEach((n) => {
169
- n.disabled || (n.setAttribute("data-pressed", ""), setTimeout(() => n.removeAttribute("data-pressed"), so));
169
+ n.disabled || (n.setAttribute("data-pressed", ""), setTimeout(() => n.removeAttribute("data-pressed"), ao));
170
170
  });
171
171
  }
172
- const ao = ["point", "line", "polygon", "route", "circle", "rectangle", "freehand", "picker"];
173
- function Ws(t) {
172
+ const co = ["point", "line", "polygon", "route", "circle", "rectangle", "freehand", "picker"];
173
+ function qs(t) {
174
174
  var x;
175
- const { dataStore: e, uiStore: n } = oe(), s = le(), { panTo: o, fitBounds: d, setZoom: i } = Ae(), m = Or(), c = ce(), y = ke(), f = (x = Vn()) == null ? void 0 : x.custom, h = B(f);
176
- h.current = f;
177
- const u = J((w) => h.current ? qt(w, h.current) : Zr(w), []);
175
+ const { dataStore: e, uiStore: n } = se(), s = le(), { panTo: o, fitBounds: d, setZoom: i } = ze(), m = Wr(), l = ce(), h = Se(), f = (x = Xn()) == null ? void 0 : x.custom, g = B(f);
176
+ g.current = f;
177
+ const u = J((w) => g.current ? Vt(w, g.current) : Qr(w), []);
178
178
  $(() => {
179
179
  if (!t) return;
180
180
  const w = t.closest("[data-elm-theme]") ?? t, M = { root: w, pointerInside: null };
181
- Ce.set(n, M);
181
+ Ne.set(n, M);
182
182
  const C = (a) => {
183
- a.composedPath().includes(w) ? M.pointerInside = !0 : a.target instanceof Element && fr(a.target) || (M.pointerInside = !1);
183
+ a.composedPath().includes(w) ? M.pointerInside = !0 : a.target instanceof Element && hr(a.target) || (M.pointerInside = !1);
184
184
  };
185
185
  return document.addEventListener("pointerdown", C, { capture: !0, passive: !0 }), () => {
186
- Ce.get(n) === M && Ce.delete(n), document.removeEventListener("pointerdown", C, { capture: !0 });
186
+ Ne.get(n) === M && Ne.delete(n), document.removeEventListener("pointerdown", C, { capture: !0 });
187
187
  };
188
188
  }, [t, n]), $(() => {
189
- if (!c.ui.keyboardShortcuts.enabled || !c.ui.keyboardShortcuts.mapZoom) return;
189
+ if (!l.ui.keyboardShortcuts.enabled || !l.ui.keyboardShortcuts.mapZoom) return;
190
190
  function w(M) {
191
- if (!(M.metaKey || M.ctrlKey) || !y(M)) return;
191
+ if (!(M.metaKey || M.ctrlKey) || !h(M)) return;
192
192
  const C = M.target, a = C == null ? void 0 : C.tagName;
193
193
  if (a === "INPUT" || a === "TEXTAREA" || a === "SELECT" || C != null && C.isContentEditable) return;
194
- const p = M.key === "+" || M.key === "=", l = M.key === "-" || M.key === "_";
195
- if (!p && !l || !i) return;
194
+ const p = M.key === "+" || M.key === "=", c = M.key === "-" || M.key === "_";
195
+ if (!p && !c || !i) return;
196
196
  M.preventDefault();
197
197
  const E = e.getState().currentZoom;
198
198
  i(E + (p ? 1 : -1));
199
199
  }
200
200
  return window.addEventListener("keydown", w, { capture: !0 }), () => window.removeEventListener("keydown", w, { capture: !0 });
201
- }, [c.ui.keyboardShortcuts.enabled, c.ui.keyboardShortcuts.mapZoom, i, e]), $(() => {
202
- const w = c.ui.keyboardShortcuts.enabled;
201
+ }, [l.ui.keyboardShortcuts.enabled, l.ui.keyboardShortcuts.mapZoom, i, e]), $(() => {
202
+ const w = l.ui.keyboardShortcuts.enabled;
203
203
  function M(a) {
204
204
  var L;
205
- if (!w && a.key !== "Enter" || !y(a)) return;
206
- const p = e.getState(), l = n.getState(), E = l.readonly, g = (v) => {
205
+ if (!w && a.key !== "Enter" || !h(a)) return;
206
+ const p = e.getState(), c = n.getState(), E = c.readonly, y = (v) => {
207
207
  var W;
208
- return io(((W = Ce.get(n)) == null ? void 0 : W.root) ?? document, v);
208
+ return lo(((W = Ne.get(n)) == null ? void 0 : W.root) ?? document, v);
209
209
  }, N = a.target.tagName, P = a.target, z = a.composedPath(), K = z.some((v) => {
210
210
  if (!(v instanceof Element)) return !1;
211
211
  const W = v.getAttribute("role");
212
212
  return W === "grid" || W === "treegrid";
213
213
  }), b = N === "INPUT" || N === "TEXTAREA" || N === "SELECT" || P.isContentEditable || K, k = a.key.toLowerCase();
214
214
  if (!b && !E && k === "z" && (a.metaKey || a.ctrlKey) && !a.shiftKey) {
215
- a.preventDefault(), g("undo"), p.undoStack.length > 0 && (p.undo(), s({ type: "undo" }));
215
+ a.preventDefault(), y("undo"), p.undoStack.length > 0 && (p.undo(), s({ type: "undo" }));
216
216
  return;
217
217
  }
218
218
  if (!b && !E && k === "z" && (a.metaKey || a.ctrlKey) && a.shiftKey) {
219
- a.preventDefault(), g("redo"), p.redoStack.length > 0 && (p.redo(), s({ type: "redo" }));
219
+ a.preventDefault(), y("redo"), p.redoStack.length > 0 && (p.redo(), s({ type: "redo" }));
220
220
  return;
221
221
  }
222
222
  if (!b && (a.metaKey || a.ctrlKey) && (a.key === "a" || a.key === "A")) {
@@ -227,8 +227,8 @@ function Ws(t) {
227
227
  }
228
228
  if (!b && (a.metaKey || a.ctrlKey) && !a.shiftKey && (a.key === "j" || a.key === "J")) {
229
229
  a.preventDefault();
230
- const v = !l.autoExitAfterDraw;
231
- l.setAutoExitAfterDraw(v), s({
230
+ const v = !c.autoExitAfterDraw;
231
+ c.setAutoExitAfterDraw(v), s({
232
232
  type: "success",
233
233
  message: v ? "Drawing tools will exit after each shape" : "Drawing tools will stay active after each shape",
234
234
  description: v ? "You’ll go back to select mode. Press a tool key to draw again." : "Keep drawing more shapes in a row. Press the tool key again or Esc to exit."
@@ -236,7 +236,7 @@ function Ws(t) {
236
236
  return;
237
237
  }
238
238
  if (!b && !E && (a.metaKey || a.ctrlKey) && !a.shiftKey && (a.key === "o" || a.key === "O")) {
239
- a.preventDefault(), no().then((v) => {
239
+ a.preventDefault(), so().then((v) => {
240
240
  v && m(v);
241
241
  });
242
242
  return;
@@ -250,11 +250,11 @@ function Ws(t) {
250
250
  }
251
251
  const H = W.features.length;
252
252
  (async () => {
253
- const F = await jt(v);
253
+ const F = await Ht(v);
254
254
  F && s({
255
255
  type: "success",
256
256
  message: `Exported ${F.name}`,
257
- description: `${H === 1 ? "1 feature" : `${H} features`} · ${(F.bytes / 1024).toFixed(1)} KB`
257
+ description: `${H === 1 ? "1 feature" : `${H} features`}, ${(F.bytes / 1024).toFixed(1)} KB`
258
258
  });
259
259
  })();
260
260
  return;
@@ -267,7 +267,7 @@ function Ws(t) {
267
267
  }
268
268
  if (a.key === "d") {
269
269
  if (a.preventDefault(), E) return;
270
- g("duplicate");
270
+ y("duplicate");
271
271
  const v = p.selectedIds;
272
272
  if (p.duplicateSelection())
273
273
  if (v.length === 1) {
@@ -279,7 +279,7 @@ function Ws(t) {
279
279
  }
280
280
  if (a.key === "e" || a.key === "E") {
281
281
  if (p.selectedIds.length !== 1) return;
282
- a.preventDefault(), l.openEditDialog(p.selectedIds[0], { focusFirstField: !0 });
282
+ a.preventDefault(), c.openEditDialog(p.selectedIds[0], { focusFirstField: !0 });
283
283
  return;
284
284
  }
285
285
  if ((a.key === "g" || a.key === "G") && !E) {
@@ -290,41 +290,41 @@ function Ws(t) {
290
290
  if (p.selectedIds.length === 0) return;
291
291
  a.preventDefault();
292
292
  const v = p.groupSelection();
293
- v && l.setAutoFocusGroupId(v);
293
+ v && c.setAutoFocusGroupId(v);
294
294
  }
295
295
  return;
296
296
  }
297
297
  }
298
298
  if (a.key === "Enter") {
299
- if ((!b || a.metaKey || a.ctrlKey) && l.editingMode !== "none") {
300
- if (l.editingMode === "slice-shape") {
301
- a.preventDefault(), l.commitSliceShape();
299
+ if ((!b || a.metaKey || a.ctrlKey) && c.editingMode !== "none") {
300
+ if (c.editingMode === "slice-shape") {
301
+ a.preventDefault(), c.commitSliceShape();
302
302
  return;
303
- } else if (l.editingMode === "cut-hole") {
304
- a.preventDefault(), l.commitCutHole();
303
+ } else if (c.editingMode === "cut-hole") {
304
+ a.preventDefault(), c.commitCutHole();
305
305
  return;
306
- } else if (l.editingMode === "draw-line" && l.lineInProgress.length >= 2) {
307
- a.preventDefault(), l.commitLine({});
306
+ } else if (c.editingMode === "draw-line" && c.lineInProgress.length >= 2) {
307
+ a.preventDefault(), c.commitLine({});
308
308
  return;
309
- } else if (l.editingMode === "draw-polygon" && l.polygonInProgress.length >= 3) {
310
- a.preventDefault(), l.commitPolygon({});
309
+ } else if (c.editingMode === "draw-polygon" && c.polygonInProgress.length >= 3) {
310
+ a.preventDefault(), c.commitPolygon({});
311
311
  return;
312
- } else if (l.editingMode === "draw-route" && l.routeWaypoints.length >= 2) {
313
- a.preventDefault(), l.commitRoute();
312
+ } else if (c.editingMode === "draw-route" && c.routeWaypoints.length >= 2) {
313
+ a.preventDefault(), c.commitRoute();
314
314
  return;
315
315
  }
316
316
  }
317
317
  if (!w) return;
318
- const W = l.editingMode === "none" || l.editingMode === "draw-rect" || l.editingMode === "draw-circle" || l.editingMode === "place-point" || l.editingMode === "draw-freehand" || l.editingMode === "pick-shape" || l.editingMode === "draw-line" && l.lineInProgress.length < 2 || l.editingMode === "draw-polygon" && l.polygonInProgress.length < 3 || l.editingMode === "draw-route" && l.routeWaypoints.length < 2;
319
- if (l.dialogState.type === "closed") {
318
+ const W = c.editingMode === "none" || c.editingMode === "draw-rect" || c.editingMode === "draw-circle" || c.editingMode === "place-point" || c.editingMode === "draw-freehand" || c.editingMode === "pick-shape" || c.editingMode === "draw-line" && c.lineInProgress.length < 2 || c.editingMode === "draw-polygon" && c.polygonInProgress.length < 3 || c.editingMode === "draw-route" && c.routeWaypoints.length < 2;
319
+ if (c.dialogState.type === "closed") {
320
320
  if (!b && !E && !((L = P.closest) != null && L.call(P, 'button, a[href], [role="button"]')) && !a.metaKey && !a.ctrlKey && !a.altKey && W) {
321
321
  const H = p.selectedIds;
322
322
  if (H.length === 1) {
323
323
  const F = p.features.find((G) => G.id === H[0]), I = F == null ? void 0 : F.geometry.type;
324
324
  if (I === "LineString" || I === "Polygon" || I === "MultiLineString" || I === "MultiPolygon" || I === "GeometryCollection") {
325
325
  a.preventDefault();
326
- const G = !l.vertexEditActive;
327
- G && l.editingMode !== "none" && l.setEditingMode("none"), l.setVertexEditActive(G);
326
+ const G = !c.vertexEditActive;
327
+ G && c.editingMode !== "none" && c.setEditingMode("none"), c.setVertexEditActive(G);
328
328
  return;
329
329
  }
330
330
  }
@@ -332,11 +332,11 @@ function Ws(t) {
332
332
  }
333
333
  }
334
334
  const D = z.some((v) => v instanceof Element && v.hasAttribute("data-elm-search-open"));
335
- if (a.key === "Tab" && !b && l.dialogState.type === "closed" && !D && !a.metaKey && !a.ctrlKey && !a.altKey) {
335
+ if (a.key === "Tab" && !b && c.dialogState.type === "closed" && !D && !a.metaKey && !a.ctrlKey && !a.altKey) {
336
336
  const v = p.features;
337
337
  if (v.length === 0) return;
338
338
  a.preventDefault();
339
- const W = eo(v, p.groups), H = p.selectedIds.length === 1 ? p.selectedIds[0] : null, F = H ? W.indexOf(H) : -1;
339
+ const W = ro(v, p.groups), H = p.selectedIds.length === 1 ? p.selectedIds[0] : null, F = H ? W.indexOf(H) : -1;
340
340
  let I;
341
341
  a.shiftKey ? I = F <= 0 ? W.length - 1 : F - 1 : I = F >= W.length - 1 ? 0 : F + 1;
342
342
  const _ = W[I];
@@ -347,52 +347,52 @@ function Ws(t) {
347
347
  const [V, Y] = G.geometry.coordinates;
348
348
  o == null || o([Y, V]);
349
349
  } else
350
- d == null || d(G.bbox || ot(G.geometry));
350
+ d == null || d(G.bbox || st(G.geometry));
351
351
  return;
352
352
  }
353
353
  if (!b && !a.metaKey && !a.ctrlKey && !a.altKey) {
354
354
  const v = a.key.toLowerCase();
355
355
  if (v === u("show-shortcuts")) {
356
- a.preventDefault(), g("show-shortcuts"), l.shortcutsModalOpen ? l.closeShortcutsModal() : l.openShortcutsModal();
356
+ a.preventDefault(), y("show-shortcuts"), c.shortcutsModalOpen ? c.closeShortcutsModal() : c.openShortcutsModal();
357
357
  return;
358
358
  }
359
- if (c.ui.schemaEditor && !E && v === u("toggle-schema")) {
360
- a.preventDefault(), g("toggle-schema"), l.toggleSchemaModal();
359
+ if (l.ui.schemaEditor && !E && v === u("toggle-schema")) {
360
+ a.preventDefault(), y("toggle-schema"), c.toggleSchemaModal();
361
361
  return;
362
362
  }
363
- if (c.ui.layerList && v === u("toggle-sidebar")) {
364
- a.preventDefault(), g("toggle-sidebar"), l.setSidebarOpen(!l.sidebarOpen);
363
+ if (l.ui.layerList && v === u("toggle-sidebar")) {
364
+ a.preventDefault(), y("toggle-sidebar"), c.setSidebarOpen(!c.sidebarOpen);
365
365
  return;
366
366
  }
367
367
  }
368
- if (!b && l.dialogState.type !== "new-point" && !a.metaKey && !a.ctrlKey && !a.altKey) {
368
+ if (!b && c.dialogState.type !== "new-point" && !a.metaKey && !a.ctrlKey && !a.altKey) {
369
369
  const v = a.key.toLowerCase();
370
- if (c.ui.dataTable && v === u("toggle-table")) {
371
- a.preventDefault(), g("toggle-table"), l.toggleTable();
370
+ if (l.ui.dataTable && v === u("toggle-table")) {
371
+ a.preventDefault(), y("toggle-table"), c.toggleTable();
372
372
  return;
373
373
  }
374
- if (c.ui.geojsonEditor && v === u("toggle-geojson")) {
375
- a.preventDefault(), g("toggle-geojson"), l.toggleCodeModal();
374
+ if (l.ui.geojsonEditor && v === u("toggle-geojson")) {
375
+ a.preventDefault(), y("toggle-geojson"), c.toggleCodeModal();
376
376
  return;
377
377
  }
378
- if (c.ui.zoomIndicator && v === u("set-zoom")) {
379
- a.preventDefault(), g("set-zoom"), l.setZoomEditing(!0);
378
+ if (l.ui.zoomIndicator && v === u("set-zoom")) {
379
+ a.preventDefault(), y("set-zoom"), c.setZoomEditing(!0);
380
380
  return;
381
381
  }
382
382
  if (v === u("measure")) {
383
- g("measure"), l.setEditingMode(l.editingMode === "measure" ? "none" : "measure");
383
+ y("measure"), c.setEditingMode(c.editingMode === "measure" ? "none" : "measure");
384
384
  return;
385
385
  }
386
386
  if (E) return;
387
387
  if (v === u("toggle-transform")) {
388
- (p.selectedIds.length === 1 && p.selectedIds[0] || p.selectedIds.length > 0) && (g("toggle-transform"), l.setTransformActive(!l.transformActive), !l.transformActive && l.editingMode !== "none" && l.setEditingMode("none"));
388
+ (p.selectedIds.length === 1 && p.selectedIds[0] || p.selectedIds.length > 0) && (y("toggle-transform"), c.setTransformActive(!c.transformActive), !c.transformActive && c.editingMode !== "none" && c.setEditingMode("none"));
389
389
  return;
390
390
  }
391
- const W = l.isToolAvailable, H = (F) => {
392
- l.editingMode !== F && !p.canAddFeatures(1) || (g(F === "pick-shape" ? "picker" : F), l.setEditingMode(l.editingMode === F ? "none" : F));
391
+ const W = c.isToolAvailable, H = (F) => {
392
+ c.editingMode !== F && !p.canAddFeatures(1) || (y(F === "pick-shape" ? "picker" : F), c.setEditingMode(c.editingMode === F ? "none" : F));
393
393
  };
394
- for (const F of ao) {
395
- const I = jr[F];
394
+ for (const F of co) {
395
+ const I = Hr[F];
396
396
  if (W(F) && v === u(I === "pick-shape" ? "picker" : I)) {
397
397
  H(I);
398
398
  return;
@@ -400,39 +400,39 @@ function Ws(t) {
400
400
  }
401
401
  if (v === u("cut-hole")) {
402
402
  const F = p.features.find((I) => I.id === (p.selectedIds.length === 1 ? p.selectedIds[0] : null));
403
- F && (F.geometry.type === "Polygon" || F.geometry.type === "MultiPolygon") && (g("cut-hole"), l.setEditingMode(l.editingMode === "cut-hole" ? "none" : "cut-hole"), l.setTransformActive(!1));
403
+ F && (F.geometry.type === "Polygon" || F.geometry.type === "MultiPolygon") && (y("cut-hole"), c.setEditingMode(c.editingMode === "cut-hole" ? "none" : "cut-hole"), c.setTransformActive(!1));
404
404
  return;
405
405
  }
406
406
  if (v === u("slice-shape")) {
407
407
  const F = p.features.find((I) => I.id === (p.selectedIds.length === 1 ? p.selectedIds[0] : null));
408
- F && (F.geometry.type === "Polygon" || F.geometry.type === "MultiPolygon") && (g("slice-shape"), l.setEditingMode(l.editingMode === "slice-shape" ? "none" : "slice-shape"), l.setTransformActive(!1));
408
+ F && (F.geometry.type === "Polygon" || F.geometry.type === "MultiPolygon") && (y("slice-shape"), c.setEditingMode(c.editingMode === "slice-shape" ? "none" : "slice-shape"), c.setTransformActive(!1));
409
409
  return;
410
410
  }
411
411
  if (v === u("break-apart")) {
412
412
  const F = p.selectedIds.length === 1 ? p.selectedIds[0] : null, I = F ? p.features.find((_) => _.id === F) : null;
413
- if (I && Yr(I.geometry)) {
414
- g("break-apart");
415
- const _ = rt(I.geometry);
413
+ if (I && en(I.geometry)) {
414
+ y("break-apart");
415
+ const _ = nt(I.geometry);
416
416
  p.breakMultiGeometry(F) && s({ type: "feature:broken", featureId: F, count: _, undo: () => e.getState().undo() });
417
417
  }
418
418
  return;
419
419
  }
420
420
  }
421
- if (a.key !== "Delete" && a.key !== "Backspace" || E || l.dialogState.type === "new-point") return;
421
+ if (a.key !== "Delete" && a.key !== "Backspace" || E || c.dialogState.type === "new-point") return;
422
422
  const R = p.selectedIds;
423
- if (R.length === 0 || b || l.vertexEditActive) return;
423
+ if (R.length === 0 || b || c.vertexEditActive) return;
424
424
  const O = R.length, j = O === 1 ? p.features.find((v) => v.id === R[0]) : null, Z = O === 1 ? String((j == null ? void 0 : j.properties.name) || "Unnamed feature") : `${O} features`;
425
- a.preventDefault(), a.stopImmediatePropagation(), g("delete-selected"), p.deleteSelection(), l.closeDialog(), s(O === 1 ? { type: "feature:deleted", featureId: R[0], label: Z, undo: () => e.getState().undo() } : { type: "features:deleted", count: O, undo: () => e.getState().undo() });
425
+ a.preventDefault(), a.stopImmediatePropagation(), y("delete-selected"), p.deleteSelection(), c.closeDialog(), s(O === 1 ? { type: "feature:deleted", featureId: R[0], label: Z, undo: () => e.getState().undo() } : { type: "features:deleted", count: O, undo: () => e.getState().undo() });
426
426
  }
427
427
  function C(a) {
428
- var g;
429
- if (!y(a)) return;
428
+ var y;
429
+ if (!h(a)) return;
430
430
  const p = a.target.tagName;
431
431
  if (p === "INPUT" || p === "TEXTAREA" || p === "SELECT" || n.getState().readonly) return;
432
- const l = (g = a.clipboardData) == null ? void 0 : g.getData("text");
433
- if (l)
432
+ const c = (y = a.clipboardData) == null ? void 0 : y.getData("text");
433
+ if (c)
434
434
  try {
435
- const N = JSON.parse(l);
435
+ const N = JSON.parse(c);
436
436
  if (N.type === "FeatureCollection" || N.type === "Feature") {
437
437
  const P = N.type === "FeatureCollection" ? N.features : [N];
438
438
  e.setState({ clipboard: P }), e.getState().pasteSelection() && s({ type: "selection:pasted", count: P.length });
@@ -446,12 +446,12 @@ function Ws(t) {
446
446
  return window.addEventListener("keydown", M), window.addEventListener("paste", C), () => {
447
447
  window.removeEventListener("keydown", M), window.removeEventListener("paste", C);
448
448
  };
449
- }, [e, n, s, o, d, c, u, m]), $(() => {
449
+ }, [e, n, s, o, d, l, u, m]), $(() => {
450
450
  function w(M) {
451
- var l;
452
- if (M.key !== "Escape" || !y(M)) return;
451
+ var c;
452
+ if (M.key !== "Escape" || !h(M)) return;
453
453
  const C = M.target;
454
- if (C && (C.tagName === "INPUT" || C.tagName === "TEXTAREA" || C.isContentEditable) || (l = C == null ? void 0 : C.closest) != null && l.call(C, `[${to}]`) || _n()) return;
454
+ if (C && (C.tagName === "INPUT" || C.tagName === "TEXTAREA" || C.isContentEditable) || (c = C == null ? void 0 : C.closest) != null && c.call(C, `[${no}]`) || Un()) return;
455
455
  const a = n.getState();
456
456
  if (a.dialogState.type !== "closed") {
457
457
  a.closeDialog(), M.stopPropagation();
@@ -470,35 +470,35 @@ function Ws(t) {
470
470
  e.getState().selectFeature(null), M.stopPropagation();
471
471
  return;
472
472
  }
473
- ro(n) && M.stopPropagation();
473
+ oo(n) && M.stopPropagation();
474
474
  }
475
475
  }
476
476
  return window.addEventListener("keydown", w, { capture: !0 }), () => window.removeEventListener("keydown", w, { capture: !0 });
477
477
  }, []);
478
478
  }
479
- const lo = /* @__PURE__ */ new Set(["true", "yes", "y", "1", "on", "x", "✓"]), co = /* @__PURE__ */ new Set(["false", "no", "n", "0", "off", ""]);
480
- function uo(t) {
479
+ const uo = /* @__PURE__ */ new Set(["true", "yes", "y", "1", "on", "x", "✓"]), mo = /* @__PURE__ */ new Set(["false", "no", "n", "0", "off", ""]);
480
+ function fo(t) {
481
481
  const e = t.trim().toLowerCase();
482
- return lo.has(e) ? !0 : co.has(e) ? !1 : null;
482
+ return uo.has(e) ? !0 : mo.has(e) ? !1 : null;
483
483
  }
484
- function mo(t) {
485
- return typeof t == "boolean" ? t : typeof t == "number" ? t !== 0 : typeof t == "string" ? uo(t) === !0 : !1;
484
+ function po(t) {
485
+ return typeof t == "boolean" ? t : typeof t == "number" ? t !== 0 : typeof t == "string" ? fo(t) === !0 : !1;
486
486
  }
487
- function fo({ fields: t, values: e, onChange: n, errors: s, autoFocusFirst: o, readonly: d }) {
487
+ function ho({ fields: t, values: e, onChange: n, errors: s, autoFocusFirst: o, readonly: d }) {
488
488
  return /* @__PURE__ */ r("div", { className: "space-y-3", children: t.map((i, m) => {
489
- const c = e[i.key] ?? "", y = s == null ? void 0 : s[i.key], f = o && m === 0, h = /* @__PURE__ */ T("label", { className: "block text-xs font-medium text-(--elm-text-muted,var(--color-gray-600)) dark:text-(--elm-text-muted,var(--color-gray-400)) mb-1", children: [
489
+ const l = e[i.key] ?? "", h = s == null ? void 0 : s[i.key], f = o && m === 0, g = /* @__PURE__ */ T("label", { className: "block text-xs font-medium text-(--elm-text-muted,var(--color-gray-600)) dark:text-(--elm-text-muted,var(--color-gray-400)) mb-1", children: [
490
490
  i.label,
491
491
  i.required && /* @__PURE__ */ r("span", { className: "text-rose-500 ml-0.5", children: "*" })
492
492
  ] });
493
493
  let u;
494
494
  return i.type === "boolean" ? /* @__PURE__ */ T("div", { "data-field-key": i.key, className: "flex items-center justify-between py-1 border-b border-transparent", children: [
495
- h,
495
+ g,
496
496
  /* @__PURE__ */ T("label", { className: "relative inline-flex items-center cursor-pointer", children: [
497
497
  /* @__PURE__ */ r(
498
498
  "input",
499
499
  {
500
500
  type: "checkbox",
501
- checked: mo(c),
501
+ checked: po(l),
502
502
  onChange: (x) => n(i.key, x.target.checked),
503
503
  disabled: d,
504
504
  className: "sr-only peer"
@@ -506,24 +506,24 @@ function fo({ fields: t, values: e, onChange: n, errors: s, autoFocusFirst: o, r
506
506
  ),
507
507
  /* @__PURE__ */ r("div", { className: "w-9 h-5 bg-(--elm-border-strong,var(--color-gray-200)) peer-focus-visible:ring-2 peer-focus-visible:ring-elm-focus-ring peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-elm-surface rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-(--elm-border-strong,var(--color-gray-300)) after:border after:rounded-full after:h-4 after:w-4 after:transition-transform peer-checked:bg-primary-500 opacity-90 hover:opacity-100 disabled:opacity-50" })
508
508
  ] }),
509
- y && /* @__PURE__ */ r("p", { className: "mt-1 text-xs text-rose-500 w-full basis-full", children: y })
509
+ h && /* @__PURE__ */ r("p", { className: "mt-1 text-xs text-rose-500 w-full basis-full", children: h })
510
510
  ] }, i.key) : (i.type === "textarea" ? u = /* @__PURE__ */ r(
511
- Gn,
511
+ jn,
512
512
  {
513
513
  rows: 3,
514
- value: String(c),
514
+ value: String(l),
515
515
  onChange: (x) => n(i.key, x.target.value),
516
516
  autoFocus: f,
517
- error: !!y,
517
+ error: !!h,
518
518
  disabled: d
519
519
  }
520
520
  ) : i.type === "select" ? u = /* @__PURE__ */ T(
521
- ar,
521
+ cr,
522
522
  {
523
- value: String(c),
523
+ value: String(l),
524
524
  onChange: (x) => n(i.key, x.target.value),
525
525
  autoFocus: f,
526
- error: !!y,
526
+ error: !!h,
527
527
  disabled: d,
528
528
  children: [
529
529
  /* @__PURE__ */ r("option", { value: "", children: "— select —" }),
@@ -531,41 +531,41 @@ function fo({ fields: t, values: e, onChange: n, errors: s, autoFocusFirst: o, r
531
531
  ]
532
532
  }
533
533
  ) : i.type === "number" ? u = /* @__PURE__ */ r(
534
- At,
534
+ Ft,
535
535
  {
536
536
  type: "number",
537
- value: String(c),
537
+ value: String(l),
538
538
  onChange: (x) => n(i.key, x.target.value),
539
539
  autoFocus: f,
540
- error: !!y,
540
+ error: !!h,
541
541
  disabled: d,
542
542
  min: i.min,
543
543
  max: i.max
544
544
  }
545
545
  ) : u = /* @__PURE__ */ r(
546
- At,
546
+ Ft,
547
547
  {
548
548
  type: i.type,
549
- value: String(c),
549
+ value: String(l),
550
550
  onChange: (x) => n(i.key, x.target.value),
551
551
  autoFocus: f,
552
- error: !!y,
552
+ error: !!h,
553
553
  disabled: d
554
554
  }
555
555
  ), // `data-field-key` lets the parent panel focus the offending input
556
556
  // by key after a failed save (see handleSave in FeatureSidePanel).
557
557
  /* @__PURE__ */ T("div", { "data-field-key": i.key, children: [
558
- h,
558
+ g,
559
559
  u,
560
- y && /* @__PURE__ */ r("p", { className: "mt-1 text-xs text-rose-500", children: y })
560
+ h && /* @__PURE__ */ r("p", { className: "mt-1 text-xs text-rose-500", children: h })
561
561
  ] }, i.key));
562
562
  }) });
563
563
  }
564
- const Me = "items-center justify-center flex-shrink-0 p-[3px] rounded-elm-control text-elm-text-secondary hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) active:scale-[0.95] disabled:text-elm-text-disabled disabled:hover:bg-transparent disabled:active:scale-100 disabled:cursor-not-allowed transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring", po = "h-10 box-border flex items-center flex-shrink-0 border-b border-elm-border bg-elm-surface-sunken";
565
- function pr() {
566
- const t = S((o) => o.setSidebarOpen), e = S((o) => o.layout === "split"), n = ce(), { getKey: s } = Ee();
564
+ const Ae = "items-center justify-center flex-shrink-0 p-[3px] rounded-elm-control text-elm-text-secondary hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) active:scale-[0.95] disabled:text-elm-text-disabled disabled:hover:bg-transparent disabled:active:scale-100 disabled:cursor-not-allowed transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring", go = "h-10 box-border flex items-center flex-shrink-0 border-b border-elm-border bg-elm-surface-sunken";
565
+ function gr() {
566
+ const t = S((o) => o.setSidebarOpen), e = S((o) => o.layout === "split"), n = ce(), { getKey: s } = Pe();
567
567
  return e ? null : /* @__PURE__ */ r(
568
- be,
568
+ ve,
569
569
  {
570
570
  content: "Hide layers",
571
571
  shortcut: n.ui.keyboardShortcuts.enabled ? /* @__PURE__ */ r(Q, { children: s("toggle-sidebar").toUpperCase() }) : void 0,
@@ -578,30 +578,30 @@ function pr() {
578
578
  onClick: (o) => {
579
579
  t(!1), o.currentTarget.blur();
580
580
  },
581
- className: `flex ${Me}`,
582
- children: /* @__PURE__ */ r(Jt, { size: 16, mirrored: !0 })
581
+ className: `flex ${Ae}`,
582
+ children: /* @__PURE__ */ r(Zt, { size: 16, mirrored: !0 })
583
583
  }
584
584
  )
585
585
  }
586
586
  );
587
587
  }
588
- const ho = /("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g, go = "text-gray-800 dark:text-[#e06c75]", yo = "text-[#a11] dark:text-[#98c379]", bo = "text-[#164] dark:text-[#d19a66]", vo = "text-[#219] dark:text-[#d19a66]", xo = "text-[#164] dark:text-[#d19a66]";
589
- function wo(t) {
588
+ const yo = /("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g, bo = "text-gray-800 dark:text-[#e06c75]", vo = "text-[#a11] dark:text-[#98c379]", xo = "text-[#164] dark:text-[#d19a66]", wo = "text-[#219] dark:text-[#d19a66]", ko = "text-[#164] dark:text-[#d19a66]";
589
+ function So(t) {
590
590
  const e = [];
591
591
  let n = 0;
592
- for (const s of t.matchAll(ho)) {
592
+ for (const s of t.matchAll(yo)) {
593
593
  const o = s.index;
594
594
  o > n && e.push(t.slice(n, o));
595
- const [d, i, m, c] = s;
596
- i !== void 0 ? (e.push(/* @__PURE__ */ r("span", { className: m ? go : yo, children: i }, o)), m && e.push(m)) : c !== void 0 ? e.push(/* @__PURE__ */ r("span", { className: vo, children: d }, o)) : e.push(/* @__PURE__ */ r("span", { className: d === "null" ? xo : bo, children: d }, o)), n = o + d.length;
595
+ const [d, i, m, l] = s;
596
+ i !== void 0 ? (e.push(/* @__PURE__ */ r("span", { className: m ? bo : vo, children: i }, o)), m && e.push(m)) : l !== void 0 ? e.push(/* @__PURE__ */ r("span", { className: wo, children: d }, o)) : e.push(/* @__PURE__ */ r("span", { className: d === "null" ? ko : xo, children: d }, o)), n = o + d.length;
597
597
  }
598
598
  return n < t.length && e.push(t.slice(n)), e;
599
599
  }
600
- function ko({ json: t, className: e }) {
601
- const n = ue(() => wo(t), [t]);
600
+ function Co({ json: t, className: e }) {
601
+ const n = ue(() => So(t), [t]);
602
602
  return /* @__PURE__ */ r("pre", { className: e, children: n });
603
603
  }
604
- function Rt(t, e) {
604
+ function $t(t, e) {
605
605
  if (t.required && (e == null || String(e).trim() === ""))
606
606
  return `${t.label} is required`;
607
607
  if (t.type === "number" && e !== void 0 && e !== null && String(e).trim() !== "") {
@@ -616,11 +616,11 @@ function Rt(t, e) {
616
616
  }
617
617
  return null;
618
618
  }
619
- function hr(t, e) {
619
+ function yr(t, e) {
620
620
  const n = S((i) => i.panelPrefs[t]), s = S((i) => i.setPanelPref), o = n !== null ? n : e;
621
621
  return { open: o, toggle: () => s(t, !o) };
622
622
  }
623
- function So(t, e, n) {
623
+ function No(t, e, n) {
624
624
  if (t.type === "new-point") {
625
625
  const s = {};
626
626
  return e.fields.forEach((o) => {
@@ -633,17 +633,17 @@ function So(t, e, n) {
633
633
  }
634
634
  return {};
635
635
  }
636
- function Co({ dialogState: t, collapsible: e = !1 }) {
637
- const { dataStore: n } = oe(), s = le(), o = S((I) => I.closeDialog), d = U((I) => I.selectFeature), i = U(Wn((I) => I.getVisibleSchemas())), m = U((I) => I.lastUsedSchemaId), c = S((I) => I.readonly), { uiStore: y } = oe(), f = ke(), h = U((I) => I.features), u = ue(
638
- () => t.type === "edit" ? h.find((I) => I.id === t.featureId) ?? null : null,
639
- [t, h]
640
- ), x = U((I) => I.addFeature), w = U((I) => I.updateFeature), M = U((I) => I.deleteFeature), C = U((I) => I.duplicateFeature), a = U((I) => I.getDefaultSchema), p = U((I) => I.setLastUsedSchemaId), l = t.type === "new-point", E = a(), [g, N] = q(() => t.type === "edit" && (u != null && u.schemaId) ? u.schemaId : m && i.find((_) => _.id === m) ? m : E.id), P = i.find((I) => I.id === g) ?? E, [z, K] = q(
641
- () => So(t, P, h)
636
+ function Eo({ dialogState: t, collapsible: e = !1 }) {
637
+ const { dataStore: n } = se(), s = le(), o = S((I) => I.closeDialog), d = U((I) => I.selectFeature), i = U(Gn((I) => I.getVisibleSchemas())), m = U((I) => I.lastUsedSchemaId), l = S((I) => I.readonly), { uiStore: h } = se(), f = Se(), g = U((I) => I.features), u = ue(
638
+ () => t.type === "edit" ? g.find((I) => I.id === t.featureId) ?? null : null,
639
+ [t, g]
640
+ ), x = U((I) => I.addFeature), w = U((I) => I.updateFeature), M = U((I) => I.deleteFeature), C = U((I) => I.duplicateFeature), a = U((I) => I.getDefaultSchema), p = U((I) => I.setLastUsedSchemaId), c = t.type === "new-point", E = a(), [y, N] = q(() => t.type === "edit" && (u != null && u.schemaId) ? u.schemaId : m && i.find((_) => _.id === m) ? m : E.id), P = i.find((I) => I.id === y) ?? E, [z, K] = q(
641
+ () => No(t, P, g)
642
642
  ), [b, k] = q({}), D = u == null ? void 0 : u.properties, R = u == null ? void 0 : u.schemaId, [O, j] = q({ editProps: D, editSchemaId: R });
643
643
  u && (O.editProps !== D || O.editSchemaId !== R) && (j({ editProps: D, editSchemaId: R }), K({ ...D }), R && N(R), k({}));
644
644
  function Z(I) {
645
645
  const _ = i.find((G) => G.id === I) ?? E;
646
- if (l) {
646
+ if (c) {
647
647
  const G = {};
648
648
  _.fields.forEach((V) => {
649
649
  G[V.key] = z[V.key] ?? "";
@@ -652,10 +652,10 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
652
652
  N(I), p(I), k({});
653
653
  }
654
654
  $(() => {
655
- if (c) return;
655
+ if (l) return;
656
656
  function I(_) {
657
657
  if ((_.metaKey || _.ctrlKey) && _.key === "Enter" && f(_)) {
658
- const G = y.getState();
658
+ const G = h.getState();
659
659
  if (G.lineInProgress.length > 0 || G.polygonInProgress.length > 0 || G.routeWaypoints.length > 0 || G.freehandPoints.length > 0 || G.circleCenter !== null || G.rectCorner !== null) return;
660
660
  _.preventDefault(), L();
661
661
  }
@@ -666,16 +666,16 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
666
666
  var G;
667
667
  const I = {};
668
668
  for (const V of P.fields) {
669
- const Y = Rt(V, z[V.key]);
669
+ const Y = $t(V, z[V.key]);
670
670
  Y && (I[V.key] = Y);
671
671
  }
672
672
  if (Object.keys(I).length > 0) {
673
673
  k(I);
674
674
  const V = (G = P.fields.find((Y) => I[Y.key])) == null ? void 0 : G.key;
675
675
  V && setTimeout(() => {
676
- var ve;
677
- const Y = document.querySelector(`[data-field-key="${CSS.escape(V)}"]`), re = Y == null ? void 0 : Y.querySelector("input, textarea, select");
678
- re == null || re.focus(), re && "select" in re && ((ve = re.select) == null || ve.call(re));
676
+ var xe;
677
+ const Y = document.querySelector(`[data-field-key="${CSS.escape(V)}"]`), ne = Y == null ? void 0 : Y.querySelector("input, textarea, select");
678
+ ne == null || ne.focus(), ne && "select" in ne && ((xe = ne.select) == null || xe.call(ne));
679
679
  }, 0);
680
680
  return;
681
681
  }
@@ -683,13 +683,13 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
683
683
  const _ = {};
684
684
  for (const [V, Y] of Object.entries(z))
685
685
  Y !== "" && (_[V] = Y);
686
- l && t.type === "new-point" ? x({
686
+ c && t.type === "new-point" ? x({
687
687
  type: "Feature",
688
688
  id: crypto.randomUUID(),
689
- schemaId: g,
689
+ schemaId: y,
690
690
  geometry: { type: "Point", coordinates: t.coords },
691
691
  properties: _
692
- }) : u && w(u.id, { properties: _, schemaId: g }), o();
692
+ }) : u && w(u.id, { properties: _, schemaId: y }), o();
693
693
  }
694
694
  function v() {
695
695
  if (!u) return;
@@ -701,20 +701,20 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
701
701
  const I = String(u.properties.name || "Unnamed feature"), _ = u.id;
702
702
  M(_), o(), s({ type: "feature:deleted", featureId: _, label: I, undo: () => n.getState().undo() });
703
703
  }
704
- const H = l ? "New point" : u ? String(u.properties.name || "Edit feature") : "Edit feature", F = l ? "point" : (u == null ? void 0 : u.geometry.type) === "MultiPoint" ? "points" : (u == null ? void 0 : u.geometry.type) === "LineString" ? "line" : (u == null ? void 0 : u.geometry.type) === "MultiLineString" ? "lines" : (u == null ? void 0 : u.geometry.type) === "Polygon" ? "area" : (u == null ? void 0 : u.geometry.type) === "MultiPolygon" ? "areas" : (u == null ? void 0 : u.geometry.type) === "GeometryCollection" ? "mixed" : "point";
704
+ const H = c ? "New point" : u ? String(u.properties.name || "Edit feature") : "Edit feature", F = c ? "point" : (u == null ? void 0 : u.geometry.type) === "MultiPoint" ? "points" : (u == null ? void 0 : u.geometry.type) === "LineString" ? "line" : (u == null ? void 0 : u.geometry.type) === "MultiLineString" ? "lines" : (u == null ? void 0 : u.geometry.type) === "Polygon" ? "area" : (u == null ? void 0 : u.geometry.type) === "MultiPolygon" ? "areas" : (u == null ? void 0 : u.geometry.type) === "GeometryCollection" ? "mixed" : "point";
705
705
  return /* @__PURE__ */ T("div", { className: "flex flex-col flex-1 min-h-0", children: [
706
706
  /* @__PURE__ */ T("header", { className: "flex items-center gap-1 px-4 pt-4 pb-3 border-b border-elm-border flex-shrink-0 bg-elm-surface-sunken", children: [
707
- e && /* @__PURE__ */ r(pr, {}),
708
- /* @__PURE__ */ r(be, { content: "Back to layers", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: () => {
707
+ e && /* @__PURE__ */ r(gr, {}),
708
+ /* @__PURE__ */ r(ve, { content: "Back to layers", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: () => {
709
709
  o(), d(null);
710
- }, "aria-label": "Back to layers", className: `flex ${Me}`, children: /* @__PURE__ */ r(fn, { size: 16 }) }) }),
710
+ }, "aria-label": "Back to layers", className: `flex ${Ae}`, children: /* @__PURE__ */ r(hn, { size: 16 }) }) }),
711
711
  /* @__PURE__ */ T("div", { className: "flex-1 min-w-0 mx-1", children: [
712
712
  /* @__PURE__ */ r("p", { className: "text-sm leading-5 font-semibold text-(--elm-text,var(--color-gray-800)) dark:text-(--elm-text,var(--color-gray-100)) truncate", children: H }),
713
713
  /* @__PURE__ */ r("p", { className: "text-xs leading-4 text-elm-text-subtle capitalize", children: F })
714
714
  ] }),
715
- u && /* @__PURE__ */ T(ae, { children: [
716
- !c && /* @__PURE__ */ r(
717
- be,
715
+ u && /* @__PURE__ */ T(re, { children: [
716
+ !l && /* @__PURE__ */ r(
717
+ ve,
718
718
  {
719
719
  content: "Duplicate",
720
720
  shortcut: /* @__PURE__ */ T("span", { className: "flex items-center gap-0.5", children: [
@@ -722,10 +722,10 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
722
722
  /* @__PURE__ */ r(Q, { children: "D" })
723
723
  ] }),
724
724
  side: "bottom",
725
- children: /* @__PURE__ */ r("button", { type: "button", onClick: v, "aria-label": "Duplicate feature", className: `flex ${Me}`, children: /* @__PURE__ */ r(Xt, { size: 16 }) })
725
+ children: /* @__PURE__ */ r("button", { type: "button", onClick: v, "aria-label": "Duplicate feature", className: `flex ${Ae}`, children: /* @__PURE__ */ r(Yt, { size: 16 }) })
726
726
  }
727
727
  ),
728
- !c && /* @__PURE__ */ r(be, { content: "Delete feature", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: W, "aria-label": "Delete feature", className: `flex ${Me}`, children: /* @__PURE__ */ r(ze, { size: 16 }) }) })
728
+ !l && /* @__PURE__ */ r(ve, { content: "Delete feature", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: W, "aria-label": "Delete feature", className: `flex ${Ae}`, children: /* @__PURE__ */ r(Re, { size: 16 }) }) })
729
729
  ] })
730
730
  ] }),
731
731
  /* @__PURE__ */ T("div", { className: "flex-1 overflow-y-auto min-h-0 px-4 pt-4", children: [
@@ -735,11 +735,11 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
735
735
  /* @__PURE__ */ T("div", { className: "mb-3", children: [
736
736
  /* @__PURE__ */ r("label", { className: "block text-xs font-medium text-(--elm-text-muted,var(--color-gray-600)) dark:text-(--elm-text-muted,var(--color-gray-400)) mb-1", children: "Schema" }),
737
737
  /* @__PURE__ */ r(
738
- ar,
738
+ cr,
739
739
  {
740
- value: g,
740
+ value: y,
741
741
  onChange: (I) => Z(I.target.value),
742
- disabled: c,
742
+ disabled: l,
743
743
  children: i.map((I) => {
744
744
  var _;
745
745
  return /* @__PURE__ */ T("option", { value: I.id, children: [
@@ -751,7 +751,7 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
751
751
  )
752
752
  ] }),
753
753
  /* @__PURE__ */ r(
754
- fo,
754
+ ho,
755
755
  {
756
756
  fields: P.fields,
757
757
  values: z,
@@ -759,36 +759,36 @@ function Co({ dialogState: t, collapsible: e = !1 }) {
759
759
  K((V) => ({ ...V, [I]: _ }));
760
760
  const G = P.fields.find((V) => V.key === I);
761
761
  if (G) {
762
- const V = Rt(G, _);
762
+ const V = $t(G, _);
763
763
  k((Y) => {
764
764
  if (V) return { ...Y, [I]: V };
765
- const re = { ...Y };
766
- return delete re[I], re;
765
+ const ne = { ...Y };
766
+ return delete ne[I], ne;
767
767
  });
768
768
  }
769
769
  },
770
770
  errors: b,
771
- autoFocusFirst: !c && (l || t.type === "edit" && !!t.isNew || t.type === "edit" && !!t.focusFirstField),
772
- readonly: c
771
+ autoFocusFirst: !l && (c || t.type === "edit" && !!t.isNew || t.type === "edit" && !!t.focusFirstField),
772
+ readonly: l
773
773
  }
774
774
  ),
775
- /* @__PURE__ */ r(Eo, { dialogState: t, editFeature: u ?? null, values: z, schemaId: g }),
776
- /* @__PURE__ */ r(No, { dialogState: t, editFeature: u ?? null }),
775
+ /* @__PURE__ */ r(Do, { dialogState: t, editFeature: u ?? null, values: z, schemaId: y }),
776
+ /* @__PURE__ */ r(Po, { dialogState: t, editFeature: u ?? null }),
777
777
  /* @__PURE__ */ r("div", { className: "-mx-4 border-t border-elm-border" })
778
778
  ] }),
779
- !c && /* @__PURE__ */ r("div", { className: "px-4 py-3 border-t border-elm-border flex-shrink-0", children: /* @__PURE__ */ T(we, { variant: "primary", onClick: L, className: "w-full py-2 rounded-elm font-medium", children: [
779
+ !l && /* @__PURE__ */ r("div", { className: "px-4 py-3 border-t border-elm-border flex-shrink-0", children: /* @__PURE__ */ T(ke, { variant: "primary", onClick: L, className: "w-full py-2 rounded-elm font-medium", children: [
780
780
  "Save",
781
- /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-0.5", children: Yn() ? /* @__PURE__ */ T(ae, { children: [
782
- /* @__PURE__ */ r(Ie, { children: "⌘" }),
783
- /* @__PURE__ */ r(Ie, { children: "↵" })
784
- ] }) : /* @__PURE__ */ T(ae, { children: [
785
- /* @__PURE__ */ r(Ie, { children: "Ctrl" }),
786
- /* @__PURE__ */ r(Ie, { children: "↵" })
781
+ /* @__PURE__ */ r("span", { className: "ml-auto flex items-center gap-0.5", children: eo() ? /* @__PURE__ */ T(re, { children: [
782
+ /* @__PURE__ */ r(Me, { children: "⌘" }),
783
+ /* @__PURE__ */ r(Me, { children: "↵" })
784
+ ] }) : /* @__PURE__ */ T(re, { children: [
785
+ /* @__PURE__ */ r(Me, { children: "Ctrl" }),
786
+ /* @__PURE__ */ r(Me, { children: "↵" })
787
787
  ] }) })
788
788
  ] }) })
789
789
  ] });
790
790
  }
791
- function No({
791
+ function Po({
792
792
  dialogState: t,
793
793
  editFeature: e
794
794
  }) {
@@ -802,11 +802,11 @@ function No({
802
802
  const [i, m] = e.geometry.coordinates;
803
803
  return [`${m.toFixed(6)}, ${i.toFixed(6)}`];
804
804
  }
805
- return e.geometry.type === "LineString" ? e.geometry.coordinates.map(([m, c], y) => `${y + 1}. ${c.toFixed(6)}, ${m.toFixed(6)}`) : e.geometry.type === "Polygon" ? e.geometry.coordinates[0].slice(0, -1).map(([m, c], y) => `${y + 1}. ${c.toFixed(6)}, ${m.toFixed(6)}`) : [];
806
- }, [t, e]), s = n.length <= 5, { open: o, toggle: d } = hr("coordsOpen", s);
807
- return n.length === 0 ? null : /* @__PURE__ */ r(gr, { label: "Coordinates", open: o, onToggle: d, children: /* @__PURE__ */ r("div", { className: "space-y-0.5", children: n.map((i, m) => /* @__PURE__ */ r("p", { className: "text-xs font-elm-mono text-elm-text-muted", children: i }, m)) }) });
805
+ return e.geometry.type === "LineString" ? e.geometry.coordinates.map(([m, l], h) => `${h + 1}. ${l.toFixed(6)}, ${m.toFixed(6)}`) : e.geometry.type === "Polygon" ? e.geometry.coordinates[0].slice(0, -1).map(([m, l], h) => `${h + 1}. ${l.toFixed(6)}, ${m.toFixed(6)}`) : [];
806
+ }, [t, e]), s = n.length <= 5, { open: o, toggle: d } = yr("coordsOpen", s);
807
+ return n.length === 0 ? null : /* @__PURE__ */ r(br, { label: "Coordinates", open: o, onToggle: d, children: /* @__PURE__ */ r("div", { className: "space-y-0.5", children: n.map((i, m) => /* @__PURE__ */ r("p", { className: "text-xs font-elm-mono text-elm-text-muted", children: i }, m)) }) });
808
808
  }
809
- function Eo({
809
+ function Do({
810
810
  dialogState: t,
811
811
  editFeature: e,
812
812
  values: n,
@@ -820,34 +820,34 @@ function Eo({
820
820
  return { type: "Feature", id: "(new)", schemaId: s, geometry: { type: "Point", coordinates: t.coords }, properties: x };
821
821
  }
822
822
  return e ?? null;
823
- }, [t, e, n, s]), { open: d, toggle: i } = hr("sourceOpen", !1), [m, c] = q(!1), y = le();
823
+ }, [t, e, n, s]), { open: d, toggle: i } = yr("sourceOpen", !1), [m, l] = q(!1), h = le();
824
824
  if (!o) return null;
825
825
  const f = JSON.stringify(o, null, 2);
826
- function h() {
826
+ function g() {
827
827
  Promise.resolve().then(() => navigator.clipboard.writeText(f)).then(() => {
828
- c(!0), setTimeout(() => c(!1), 1500);
829
- }, (x) => y(Qn(x)));
828
+ l(!0), setTimeout(() => l(!1), 1500);
829
+ }, (x) => h(to(x)));
830
830
  }
831
- return /* @__PURE__ */ r(gr, { label: "Source", open: d, onToggle: i, action: /* @__PURE__ */ r(
831
+ return /* @__PURE__ */ r(br, { label: "Source", open: d, onToggle: i, action: /* @__PURE__ */ r(
832
832
  "button",
833
833
  {
834
834
  type: "button",
835
835
  onClick: (x) => {
836
- x.stopPropagation(), h();
836
+ x.stopPropagation(), g();
837
837
  },
838
838
  "aria-label": "Copy source",
839
839
  className: `flex items-center justify-center w-6 h-6 rounded-elm-chip hover:bg-elm-surface-hover transition-colors ${m ? "text-emerald-500" : "text-elm-text-disabled hover:text-(--elm-text-secondary,var(--color-gray-500)) dark:hover:text-(--elm-text-secondary,var(--color-gray-300))"}`,
840
- children: m ? /* @__PURE__ */ r(gn, { size: 16, weight: "bold" }) : /* @__PURE__ */ r(yn, { size: 16 })
840
+ children: m ? /* @__PURE__ */ r(bn, { size: 16, weight: "bold" }) : /* @__PURE__ */ r(vn, { size: 16 })
841
841
  }
842
842
  ), children: /* @__PURE__ */ r(
843
- ko,
843
+ Co,
844
844
  {
845
845
  json: f,
846
846
  className: "text-[11px] font-elm-mono text-(--elm-text-secondary,var(--color-gray-800)) dark:text-(--elm-text-secondary,var(--color-gray-300)) bg-elm-surface-sunken border border-(--elm-border-subtle,var(--color-gray-100)) dark:border-(--elm-border-subtle,var(--color-gray-700)) rounded-elm-card p-2 overflow-x-auto whitespace-pre leading-relaxed"
847
847
  }
848
848
  ) });
849
849
  }
850
- function gr({
850
+ function br({
851
851
  label: t,
852
852
  open: e,
853
853
  onToggle: n,
@@ -864,7 +864,7 @@ function gr({
864
864
  className: "flex items-center gap-1 text-xs font-medium text-elm-text-subtle hover:text-(--elm-text-secondary,var(--color-gray-600)) dark:hover:text-(--elm-text-secondary,var(--color-gray-300)) hover:bg-elm-surface-hover rounded-elm-control -ml-2 pl-2 transition-colors flex-1 text-left h-full",
865
865
  onClick: n,
866
866
  children: [
867
- /* @__PURE__ */ r("span", { className: "text-elm-text-subtle flex-shrink-0", children: e ? /* @__PURE__ */ r(pn, { size: 12, weight: "bold" }) : /* @__PURE__ */ r(hn, { size: 12, weight: "bold" }) }),
867
+ /* @__PURE__ */ r("span", { className: "text-elm-text-subtle flex-shrink-0", children: e ? /* @__PURE__ */ r(gn, { size: 12, weight: "bold" }) : /* @__PURE__ */ r(yn, { size: 12, weight: "bold" }) }),
868
868
  t
869
869
  ]
870
870
  }
@@ -874,67 +874,67 @@ function gr({
874
874
  e && /* @__PURE__ */ r("div", { className: "pb-3", children: o })
875
875
  ] });
876
876
  }
877
- const yr = "[data-elm-theme],[data-elm-theme] *{transition:none!important}";
878
- function $t(t) {
877
+ const vr = "[data-elm-theme],[data-elm-theme] *{transition:none!important}";
878
+ function Kt(t) {
879
879
  const e = document.createElement("style");
880
- e.textContent = yr, document.head.appendChild(e), t(), requestAnimationFrame(() => requestAnimationFrame(() => e.remove()));
880
+ e.textContent = vr, document.head.appendChild(e), t(), requestAnimationFrame(() => requestAnimationFrame(() => e.remove()));
881
881
  }
882
- function Po(t, e) {
882
+ function Io(t, e) {
883
883
  e == null || e.setAttribute("data-dragging", "");
884
884
  const n = document.createElement("div");
885
885
  n.style.cssText = `position:fixed;inset:0;z-index:2147483647;cursor:${t}`, document.body.appendChild(n);
886
886
  const s = document.createElement("style");
887
- return s.textContent = yr, document.head.appendChild(s), document.body.style.userSelect = "none", () => {
887
+ return s.textContent = vr, document.head.appendChild(s), document.body.style.userSelect = "none", () => {
888
888
  e == null || e.removeAttribute("data-dragging"), n.remove(), s.remove(), document.body.style.userSelect = "";
889
889
  };
890
890
  }
891
- function br(t, e, n, s) {
891
+ function xr(t, e, n, s) {
892
892
  const o = ce(), [d, i] = q(() => {
893
- const y = parseInt(Ht(t, o) ?? "", 10);
894
- return isNaN(y) ? e : Math.max(n, Math.min(s, y));
893
+ const h = parseInt(Jt(t, o) ?? "", 10);
894
+ return isNaN(h) ? e : Math.max(n, Math.min(s, h));
895
895
  }), m = B(d);
896
896
  m.current = d;
897
- const c = J((y) => {
898
- if (y.button !== 0) return;
899
- y.preventDefault();
900
- const f = y.clientX, h = m.current, u = Po("col-resize", y.currentTarget);
897
+ const l = J((h) => {
898
+ if (h.button !== 0) return;
899
+ h.preventDefault();
900
+ const f = h.clientX, g = m.current, u = Io("col-resize", h.currentTarget);
901
901
  function x(M) {
902
- const C = Math.max(n, Math.min(s, h + (f - M.clientX)));
902
+ const C = Math.max(n, Math.min(s, g + (f - M.clientX)));
903
903
  m.current = C, i(C);
904
904
  }
905
905
  function w() {
906
- u(), ln(t, String(m.current), o), window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", w);
906
+ u(), dn(t, String(m.current), o), window.removeEventListener("mousemove", x), window.removeEventListener("mouseup", w);
907
907
  }
908
908
  window.addEventListener("mousemove", x), window.addEventListener("mouseup", w);
909
909
  }, [t, n, s, o]);
910
- return { width: d, onHandleMouseDown: c };
910
+ return { width: d, onHandleMouseDown: l };
911
911
  }
912
- function vr(t, e = !0) {
913
- const { uiStore: n } = oe(), s = ce().ui.layerList, o = S(nt), d = S((f) => f.narrow), i = S((f) => f.sidebarWidth), m = S((f) => f.codeDockWidth), y = S((f) => f.tableFullscreen) || d ? 0 : (s && o ? i : 0) + m;
914
- pe(() => {
915
- var h;
912
+ function wr(t, e = !0) {
913
+ const { uiStore: n } = se(), s = ce().ui.layerList, o = S(ot), d = S((f) => f.narrow), i = S((f) => f.sidebarWidth), m = S((f) => f.codeDockWidth), h = S((f) => f.tableFullscreen) || d ? 0 : (s && o ? i : 0) + m;
914
+ fe(() => {
915
+ var g;
916
916
  if (!e) return;
917
- const f = (h = t.current) == null ? void 0 : h.closest("[data-elm-theme]");
917
+ const f = (g = t.current) == null ? void 0 : g.closest("[data-elm-theme]");
918
918
  if (f)
919
- return f.style.setProperty("--elm-panel-offset", `${y}px`), () => {
919
+ return f.style.setProperty("--elm-panel-offset", `${h}px`), () => {
920
920
  f.style.removeProperty("--elm-panel-offset");
921
921
  };
922
- }, [t, e, y]), pe(() => {
922
+ }, [t, e, h]), fe(() => {
923
923
  var x;
924
924
  if (!e) return;
925
925
  const f = (x = t.current) == null ? void 0 : x.closest("[data-elm-theme]");
926
926
  if (!f) return;
927
- const h = () => {
927
+ const g = () => {
928
928
  const w = f.clientWidth;
929
- w > 0 && n.getState().narrow !== w < Dt && n.getState().setNarrow(w < Dt);
929
+ w > 0 && n.getState().narrow !== w < It && n.getState().setNarrow(w < It);
930
930
  };
931
- h();
932
- const u = new ResizeObserver(h);
931
+ g();
932
+ const u = new ResizeObserver(g);
933
933
  return u.observe(f), () => u.disconnect();
934
934
  }, [t, e, n]);
935
935
  }
936
- const xr = "after:absolute after:transition-colors hover:after:bg-elm-focus-ring data-[dragging]:after:bg-elm-focus-ring", Do = `absolute left-0 top-0 h-full w-1 z-20 cursor-col-resize after:inset-y-0 after:left-0 after:w-0.5 ${xr}`, _s = `absolute top-0 left-0 right-0 h-1 z-10 cursor-row-resize after:inset-x-0 after:top-0 after:h-0.5 ${xr}`, Io = "p-1 rounded-elm-control flex items-center justify-center text-sm active:scale-[0.95] disabled:cursor-not-allowed disabled:active:scale-100", Mo = "text-elm-text hover:bg-elm-control-hover disabled:hover:bg-transparent", To = "flex items-center justify-center w-6 h-6 rounded-elm-control transition-colors bg-transparent hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,var(--color-gray-800)) focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring disabled:cursor-not-allowed", Ao = "flex items-center justify-center w-12 h-12 backdrop-blur-md border border-elm-border/80 shadow-elm-control rounded-elm transition-colors active:scale-[0.95] focus:outline-none disabled:cursor-not-allowed disabled:active:scale-100", Fo = "bg-elm-surface/95 hover:bg-elm-surface-hover disabled:hover:bg-elm-surface/95", Kt = "disabled:text-elm-text-disabled", Ot = "text-primary-600 dark:text-primary-400", zo = "text-elm-text";
937
- function Pe({
936
+ const kr = "after:absolute after:transition-colors hover:after:bg-elm-focus-ring data-[dragging]:after:bg-elm-focus-ring", Mo = `absolute left-0 top-0 h-full w-1 z-20 cursor-col-resize after:inset-y-0 after:left-0 after:w-0.5 ${kr}`, Hs = `absolute top-0 left-0 right-0 h-1 z-10 cursor-row-resize after:inset-x-0 after:top-0 after:h-0.5 ${kr}`, To = "p-1 rounded-elm-control flex items-center justify-center text-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring active:scale-[0.95] disabled:cursor-not-allowed disabled:active:scale-100", Ao = "text-elm-text hover:bg-elm-control-hover disabled:hover:bg-transparent", Fo = "flex items-center justify-center w-6 h-6 rounded-elm-control transition-colors bg-transparent hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,var(--color-gray-800)) focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring disabled:cursor-not-allowed", zo = "flex items-center justify-center w-12 h-12 backdrop-blur-md border border-elm-border/80 shadow-elm-control rounded-elm transition-colors active:scale-[0.95] focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring disabled:cursor-not-allowed disabled:active:scale-100", Lo = "bg-elm-surface/95 hover:bg-elm-surface-hover disabled:hover:bg-elm-surface/95", Ot = "disabled:text-elm-text-disabled", Bt = "text-primary-600 dark:text-primary-400", Ro = "text-elm-text";
937
+ function De({
938
938
  label: t,
939
939
  tooltipContent: e,
940
940
  shortcut: n,
@@ -943,47 +943,47 @@ function Pe({
943
943
  onClick: d,
944
944
  active: i,
945
945
  expanded: m,
946
- controls: c,
947
- disabled: y,
946
+ controls: l,
947
+ disabled: h,
948
948
  size: f = "md",
949
- children: h
949
+ children: g
950
950
  }) {
951
951
  const x = ce().ui.keyboardShortcuts.enabled ? n : void 0;
952
- return /* @__PURE__ */ r(be, { content: e ?? t, shortcut: x, side: o, children: /* @__PURE__ */ r(
952
+ return /* @__PURE__ */ r(ve, { content: e ?? t, shortcut: x, side: o, children: /* @__PURE__ */ r(
953
953
  "button",
954
954
  {
955
955
  "aria-label": t,
956
956
  "data-elm-shortcut": s,
957
957
  "aria-pressed": m === void 0 ? i : void 0,
958
958
  "aria-expanded": m,
959
- "aria-controls": c,
959
+ "aria-controls": l,
960
960
  onClick: (w) => {
961
961
  d(), w.detail > 0 && w.currentTarget.blur();
962
962
  },
963
- disabled: y,
964
- className: f === "group" ? `${Io} ${i ? Ot : Mo} ${Kt}` : `${f === "sm" ? To : `${Ao} ${Fo}`} ${i ? Ot : zo} ${Kt}`,
965
- children: Rr(h) && typeof h.type != "string" ? $r(h, { ...i ? { weight: "fill" } : {}, ...f === "sm" ? { size: 16 } : {} }) : h
963
+ disabled: h,
964
+ className: f === "group" ? `${To} ${i ? Bt : Ao} ${Ot}` : `${f === "sm" ? Fo : `${zo} ${Lo}`} ${i ? Bt : Ro} ${Ot}`,
965
+ children: Kr(g) && typeof g.type != "string" ? Or(g, { ...i ? { weight: "fill" } : {}, ...f === "sm" ? { size: 16 } : {} }) : g
966
966
  }
967
967
  ) });
968
968
  }
969
- const Gs = Gt(function({ footer: e }) {
970
- const { dataStore: n } = oe(), s = le(), o = S((L) => L.sidebarOpen), d = S((L) => L.setSidebarOpen), i = S((L) => L.setSidebarWidth), m = S((L) => L.codeDockWidth), c = S((L) => L.readonly), y = S((L) => L.layout), { width: f, onHandleMouseDown: h } = br("elm_panel_width", 288, 200, 520), u = y === "split", x = B(null);
971
- vr(x);
969
+ const Vs = jt(function({ footer: e }) {
970
+ const { dataStore: n } = se(), s = le(), o = S((L) => L.sidebarOpen), d = S((L) => L.setSidebarOpen), i = S((L) => L.setSidebarWidth), m = S((L) => L.codeDockWidth), l = S((L) => L.readonly), h = S((L) => L.layout), { width: f, onHandleMouseDown: g } = xr("elm_panel_width", 288, 200, 520), u = h === "split", x = B(null);
971
+ wr(x);
972
972
  const w = S((L) => L.narrow) && !u, [M, C] = q(!1), a = B(!1);
973
973
  $(() => {
974
974
  const L = requestAnimationFrame(() => {
975
975
  a.current = !0;
976
976
  });
977
977
  return () => cancelAnimationFrame(L);
978
- }, []), pe(() => {
978
+ }, []), fe(() => {
979
979
  w && (a.current || C(!0), d(!1));
980
980
  }, [w, d]), $(() => {
981
981
  if (!M) return;
982
982
  const L = requestAnimationFrame(() => C(!1));
983
983
  return () => cancelAnimationFrame(L);
984
984
  }, [M]);
985
- const { getKey: p } = Ee(), l = /* @__PURE__ */ r(Q, { children: p("toggle-sidebar").toUpperCase() }), [E, g] = q(null), N = J((L) => g(L), []);
986
- pe(() => {
985
+ const { getKey: p } = Pe(), c = /* @__PURE__ */ r(Q, { children: p("toggle-sidebar").toUpperCase() }), [E, y] = q(null), N = J((L) => y(L), []);
986
+ fe(() => {
987
987
  i(f);
988
988
  }, [f, i]);
989
989
  const P = S((L) => L.dialogState), z = P.type !== "closed", K = U((L) => L.features), b = U((L) => L.selectedIds), k = U((L) => L.deleteSelection), D = U((L) => L.clearSelection), R = S((L) => L.autoFocusGroupId), O = S((L) => L.setAutoFocusGroupId);
@@ -998,7 +998,7 @@ const Gs = Gt(function({ footer: e }) {
998
998
  })), O(L);
999
999
  }
1000
1000
  const Z = P.type === "edit" ? `edit-${P.featureId}` : P.type;
1001
- return /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ T(
1001
+ return /* @__PURE__ */ r(re, { children: /* @__PURE__ */ T(
1002
1002
  "aside",
1003
1003
  {
1004
1004
  ref: x,
@@ -1006,25 +1006,25 @@ const Gs = Gt(function({ footer: e }) {
1006
1006
  className: u ? "h-full w-full" : w ? `absolute top-0 h-full z-[600] ${o ? "shadow-elm-raised" : ""}` : "absolute top-0 h-full z-10",
1007
1007
  style: u ? void 0 : w ? { width: `min(${f}px, 100% - 48px)`, right: o ? 0 : `calc(-1 * min(${f}px, 100% - 48px))`, transition: M ? "none" : "right 200ms ease" } : { width: f, right: o ? 0 : -f, transition: M ? "none" : "right 200ms ease" },
1008
1008
  children: [
1009
- !u && !o && /* @__PURE__ */ r("div", { className: "absolute z-30", style: { left: -64 - m, top: 16 }, children: /* @__PURE__ */ r(Pe, { label: "Open layers panel", shortcutId: "toggle-sidebar", tooltipContent: "Show layers", shortcut: l, tooltipSide: "bottom", onClick: () => d(!0), children: /* @__PURE__ */ r(Jt, { size: 24 }) }) }),
1009
+ !u && !o && /* @__PURE__ */ r("div", { className: "absolute z-30", style: { left: -64 - m, top: 16 }, children: /* @__PURE__ */ r(De, { label: "Open layers panel", shortcutId: "toggle-sidebar", tooltipContent: "Show layers", shortcut: c, tooltipSide: "bottom", onClick: () => d(!0), children: /* @__PURE__ */ r(Zt, { size: 24 }) }) }),
1010
1010
  /* @__PURE__ */ T("div", { inert: !u && !o, className: `h-full flex flex-col overflow-hidden bg-elm-surface ${u ? "" : "border-l border-elm-border/80"}`, children: [
1011
1011
  !u && /* @__PURE__ */ r(
1012
1012
  "div",
1013
1013
  {
1014
- onMouseDown: h,
1015
- className: Do,
1014
+ onMouseDown: g,
1015
+ className: Mo,
1016
1016
  title: "Drag to resize panel"
1017
1017
  }
1018
1018
  ),
1019
- z && b.length < 2 ? /* @__PURE__ */ r(Co, { dialogState: P, collapsible: !0 }, Z) : /* @__PURE__ */ T(ae, { children: [
1020
- /* @__PURE__ */ r("header", { className: `${po} px-3`, children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between h-6 w-full", children: [
1019
+ z && b.length < 2 ? /* @__PURE__ */ r(Eo, { dialogState: P, collapsible: !0 }, Z) : /* @__PURE__ */ T(re, { children: [
1020
+ /* @__PURE__ */ r("header", { className: `${go} px-3`, children: /* @__PURE__ */ T("div", { className: "flex items-center justify-between h-6 w-full", children: [
1021
1021
  /* @__PURE__ */ T("div", { className: "flex items-center gap-1.5", children: [
1022
- /* @__PURE__ */ r(pr, {}),
1022
+ /* @__PURE__ */ r(gr, {}),
1023
1023
  /* @__PURE__ */ r("span", { className: "text-xs font-medium text-elm-text-secondary", children: "Layers" })
1024
1024
  ] }),
1025
- /* @__PURE__ */ r("div", { className: "flex items-center gap-0.5", children: !c && /* @__PURE__ */ r(be, { content: "New group", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: j, disabled: K.length === 0, className: `flex ${Me}`, "aria-label": "New group", children: /* @__PURE__ */ r(bn, { size: 16 }) }) }) })
1025
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-0.5", children: !l && /* @__PURE__ */ r(ve, { content: "New group", side: "bottom", children: /* @__PURE__ */ r("button", { type: "button", onClick: j, disabled: K.length === 0, className: `flex ${Ae}`, "aria-label": "New group", children: /* @__PURE__ */ r(xn, { size: 16 }) }) }) })
1026
1026
  ] }) }),
1027
- /* @__PURE__ */ r("div", { ref: N, className: "flex-1 overflow-y-auto min-h-0", children: /* @__PURE__ */ r("div", { className: "px-3 py-3 flex flex-col gap-3 h-full", children: /* @__PURE__ */ r(Ut, { fallback: K.length === 0 ? /* @__PURE__ */ r("div", { className: "h-full", children: /* @__PURE__ */ r(Zn, {}) }) : null, children: /* @__PURE__ */ r(mr, { autoFocusGroupId: R, scrollElement: E }) }) }) }),
1027
+ /* @__PURE__ */ r("div", { ref: N, className: "flex-1 overflow-y-auto min-h-0", children: /* @__PURE__ */ r("div", { className: "px-3 py-3 flex flex-col gap-3 h-full", children: /* @__PURE__ */ r(qt, { fallback: K.length === 0 ? /* @__PURE__ */ r("div", { className: "h-full", children: /* @__PURE__ */ r(Qn, {}) }) : null, children: /* @__PURE__ */ r(pr, { autoFocusGroupId: R, scrollElement: E }) }) }) }),
1028
1028
  b.length >= 2 && /* @__PURE__ */ T("div", { className: "flex items-center gap-2 px-3 py-2 bg-elm-surface-sunken border-t border-elm-border flex-shrink-0", children: [
1029
1029
  /* @__PURE__ */ T("span", { className: "text-xs text-elm-text-secondary font-medium flex-1", children: [
1030
1030
  b.length,
@@ -1038,7 +1038,7 @@ const Gs = Gt(function({ footer: e }) {
1038
1038
  children: "Clear"
1039
1039
  }
1040
1040
  ),
1041
- !c && /* @__PURE__ */ r(
1041
+ !l && /* @__PURE__ */ r(
1042
1042
  "button",
1043
1043
  {
1044
1044
  onClick: () => {
@@ -1057,10 +1057,10 @@ const Gs = Gt(function({ footer: e }) {
1057
1057
  }
1058
1058
  ) });
1059
1059
  });
1060
- function wr({ type: t, size: e = 20 }) {
1061
- return t === "Point" || t === "MultiPoint" ? /* @__PURE__ */ r(Zt, { size: e }) : t === "Polygon" || t === "MultiPolygon" ? /* @__PURE__ */ r(Yt, { size: e, weight: "fill" }) : t === "GeometryCollection" ? /* @__PURE__ */ r(Ye, { size: e }) : /* @__PURE__ */ r(Qt, { size: e, weight: "bold" });
1060
+ function Sr({ type: t, size: e = 20 }) {
1061
+ return t === "Point" || t === "MultiPoint" ? /* @__PURE__ */ r(Qt, { size: e }) : t === "Polygon" || t === "MultiPolygon" ? /* @__PURE__ */ r(er, { size: e, weight: "fill" }) : t === "GeometryCollection" ? /* @__PURE__ */ r(Qe, { size: e }) : /* @__PURE__ */ r(tr, { size: e, weight: "bold" });
1062
1062
  }
1063
- function Lo(t) {
1063
+ function $o(t) {
1064
1064
  switch (t) {
1065
1065
  case "Point":
1066
1066
  return "Point";
@@ -1080,23 +1080,23 @@ function Lo(t) {
1080
1080
  return t;
1081
1081
  }
1082
1082
  }
1083
- function kr({ initialLabel: t, onCommit: e, autoFocus: n, activate: s, onEnd: o, onTab: d, disabled: i }) {
1084
- const [m, c] = q(() => !i && (!!n || !!s)), [y, f] = q(t), h = B(null);
1083
+ function Cr({ initialLabel: t, onCommit: e, autoFocus: n, activate: s, onEnd: o, onTab: d, disabled: i }) {
1084
+ const [m, l] = q(() => !i && (!!n || !!s)), [h, f] = q(t), g = B(null);
1085
1085
  $(() => {
1086
- s && !m && !i && (f(t), c(!0));
1086
+ s && !m && !i && (f(t), l(!0));
1087
1087
  }, [s]), $(() => {
1088
1088
  var a, p;
1089
- m && ((a = h.current) == null || a.focus(), (p = h.current) == null || p.select());
1089
+ m && ((a = g.current) == null || a.focus(), (p = g.current) == null || p.select());
1090
1090
  }, [m]);
1091
1091
  function u(a) {
1092
- i || (f(a), c(!0));
1092
+ i || (f(a), l(!0));
1093
1093
  }
1094
1094
  function x() {
1095
- const a = y.trim();
1096
- a && a !== t && e(a), c(!1), o == null || o();
1095
+ const a = h.trim();
1096
+ a && a !== t && e(a), l(!1), o == null || o();
1097
1097
  }
1098
1098
  function w() {
1099
- f(t), c(!1), o == null || o();
1099
+ f(t), l(!1), o == null || o();
1100
1100
  }
1101
1101
  function M(a) {
1102
1102
  if (a.key === "Enter") {
@@ -1109,24 +1109,24 @@ function kr({ initialLabel: t, onCommit: e, autoFocus: n, activate: s, onEnd: o,
1109
1109
  }
1110
1110
  if (a.key === "Tab" && d) {
1111
1111
  a.preventDefault(), a.nativeEvent.stopImmediatePropagation();
1112
- const p = y.trim();
1113
- p && p !== t && e(p), c(!1), d(a.shiftKey ? "prev" : "next");
1112
+ const p = h.trim();
1113
+ p && p !== t && e(p), l(!1), d(a.shiftKey ? "prev" : "next");
1114
1114
  }
1115
1115
  }
1116
1116
  return { isRenaming: m, startRenaming: u, inputProps: {
1117
- ref: h,
1118
- value: y,
1117
+ ref: g,
1118
+ value: h,
1119
1119
  onChange: (a) => f(a.target.value),
1120
1120
  onBlur: x,
1121
1121
  onKeyDown: M,
1122
1122
  onClick: (a) => a.stopPropagation()
1123
1123
  } };
1124
1124
  }
1125
- function Ro(t) {
1125
+ function Ko(t) {
1126
1126
  const e = t.properties.name;
1127
- return typeof e == "string" && e.trim() ? e : Lo(t.geometry.type);
1127
+ return typeof e == "string" && e.trim() ? e : $o(t.geometry.type);
1128
1128
  }
1129
- const Us = Gt(function({
1129
+ const Js = jt(function({
1130
1130
  feature: e,
1131
1131
  isSelected: n,
1132
1132
  onRowClick: s,
@@ -1134,10 +1134,10 @@ const Us = Gt(function({
1134
1134
  onRowJump: d,
1135
1135
  onEdit: i,
1136
1136
  onToggleHidden: m,
1137
- containerProps: c,
1138
- dragHandleProps: y,
1137
+ containerProps: l,
1138
+ dragHandleProps: h,
1139
1139
  isDragging: f,
1140
- innerRef: h,
1140
+ innerRef: g,
1141
1141
  isMultiSelected: u,
1142
1142
  onMultiSelectToggle: x,
1143
1143
  onRangeSelect: w,
@@ -1145,19 +1145,19 @@ const Us = Gt(function({
1145
1145
  dragCountBadge: C,
1146
1146
  isGhosted: a,
1147
1147
  onRename: p,
1148
- renameActive: l,
1148
+ renameActive: c,
1149
1149
  onRenameEnd: E,
1150
- onRenameTab: g,
1150
+ onRenameTab: y,
1151
1151
  joinTop: N,
1152
1152
  joinBottom: P
1153
1153
  }) {
1154
- const z = B(null), K = Ro(e), b = S((F) => F.readonly), { isRenaming: k, startRenaming: D, inputProps: R } = kr({
1154
+ const z = B(null), K = Ko(e), b = S((F) => F.readonly), { isRenaming: k, startRenaming: D, inputProps: R } = Cr({
1155
1155
  initialLabel: K,
1156
1156
  disabled: b,
1157
1157
  onCommit: (F) => p == null ? void 0 : p(e.id, F),
1158
- activate: l,
1158
+ activate: c,
1159
1159
  onEnd: E,
1160
- onTab: g
1160
+ onTab: y
1161
1161
  }), O = B(null);
1162
1162
  $(() => () => {
1163
1163
  O.current !== null && clearTimeout(O.current);
@@ -1174,26 +1174,26 @@ const Us = Gt(function({
1174
1174
  I = !0, F.onload = null, F.onerror = null;
1175
1175
  };
1176
1176
  }, [j]);
1177
- const v = j !== null && Z, { style: W, ...H } = c ?? {};
1177
+ const v = j !== null && Z, { style: W, ...H } = l ?? {};
1178
1178
  return /* @__PURE__ */ r(
1179
1179
  "li",
1180
1180
  {
1181
1181
  ref: (F) => {
1182
- z.current = F, h == null || h(F);
1182
+ z.current = F, g == null || g(F);
1183
1183
  },
1184
1184
  ...H,
1185
- ...y,
1185
+ ...h,
1186
1186
  style: { listStyle: "none", opacity: a ? 0.4 : void 0, outline: "none", ...W },
1187
1187
  children: /* @__PURE__ */ T(
1188
1188
  "div",
1189
1189
  {
1190
1190
  "data-feature-id": e.id,
1191
- className: ne(
1191
+ className: oe(
1192
1192
  // Fixed h-9 (36 px): FeatureList's virtualiser computes row offsets from it.
1193
1193
  "group flex items-center gap-2 px-2 h-9 rounded-elm-control text-sm cursor-default",
1194
1194
  !f && N && "rounded-t-none",
1195
1195
  !f && P && "rounded-b-none",
1196
- f ? "cursor-grabbing shadow-elm-control bg-elm-surface-raised" : u || n ? "bg-(--elm-row-selected) hover:bg-(--elm-row-selected-hover) text-primary-700 dark:text-primary-300" : e.hidden ? ne("text-elm-text-disabled", M ? "bg-(--elm-row-hover)" : "hover:bg-(--elm-row-hover)") : M ? "bg-(--elm-row-hover) text-elm-text-secondary" : "hover:bg-(--elm-row-hover) text-elm-text-secondary"
1196
+ f ? "cursor-grabbing shadow-elm-control bg-elm-surface-raised" : u || n ? "bg-(--elm-row-selected) hover:bg-(--elm-row-selected-hover) text-primary-700 dark:text-primary-300" : e.hidden ? oe("text-elm-text-disabled", M ? "bg-(--elm-row-hover)" : "hover:bg-(--elm-row-hover)") : M ? "bg-(--elm-row-hover) text-elm-text-secondary" : "hover:bg-(--elm-row-hover) text-elm-text-secondary"
1197
1197
  ),
1198
1198
  onClick: (F) => {
1199
1199
  if (F.metaKey || F.ctrlKey) {
@@ -1214,12 +1214,12 @@ const Us = Gt(function({
1214
1214
  alt: "",
1215
1215
  className: "w-5 h-5 rounded-elm-chip object-cover flex-shrink-0 border border-(--elm-border,var(--color-gray-200))"
1216
1216
  }
1217
- ) : /* @__PURE__ */ r("span", { className: ne(
1217
+ ) : /* @__PURE__ */ r("span", { className: oe(
1218
1218
  "flex-shrink-0",
1219
1219
  // Selected rows tint the icon to match their text color (primary).
1220
1220
  // Hidden rows mute it to the row's dimmed text. Otherwise stay neutral gray.
1221
1221
  n || u ? "text-primary-700 dark:text-primary-300" : e.hidden ? "text-elm-text-disabled" : "text-(--elm-text-subtle,var(--color-gray-400))"
1222
- ), children: /* @__PURE__ */ r(wr, { type: e.geometry.type }) }),
1222
+ ), children: /* @__PURE__ */ r(Sr, { type: e.geometry.type }) }),
1223
1223
  k ? /* @__PURE__ */ r(
1224
1224
  "input",
1225
1225
  {
@@ -1251,7 +1251,7 @@ const Us = Gt(function({
1251
1251
  },
1252
1252
  className: "text-elm-text hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) p-1 rounded-elm-control opacity-0 group-hover:opacity-100",
1253
1253
  "aria-label": "Edit",
1254
- children: /* @__PURE__ */ r(vn, { size: 16 })
1254
+ children: /* @__PURE__ */ r(wn, { size: 16 })
1255
1255
  }
1256
1256
  ),
1257
1257
  /* @__PURE__ */ r(
@@ -1260,12 +1260,12 @@ const Us = Gt(function({
1260
1260
  onClick: (F) => {
1261
1261
  F.stopPropagation(), m(e.id);
1262
1262
  },
1263
- className: ne(
1263
+ className: oe(
1264
1264
  "text-elm-text hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700)) p-1 rounded-elm-control",
1265
1265
  e.hidden ? "" : "opacity-0 group-hover:opacity-100"
1266
1266
  ),
1267
1267
  "aria-label": "Toggle visibility",
1268
- children: e.hidden ? /* @__PURE__ */ r(Qe, { size: 16 }) : /* @__PURE__ */ r(st, { size: 16 })
1268
+ children: e.hidden ? /* @__PURE__ */ r(et, { size: 16 }) : /* @__PURE__ */ r(it, { size: 16 })
1269
1269
  }
1270
1270
  )
1271
1271
  ] })
@@ -1275,52 +1275,52 @@ const Us = Gt(function({
1275
1275
  }
1276
1276
  );
1277
1277
  });
1278
- function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCollapse: o, onToggleHidden: d, onRename: i, onDelete: m, onSelect: c, innerRef: y, dragHandleProps: f, containerProps: h, isDragging: u }) {
1279
- const x = S((z) => z.readonly), { isRenaming: w, startRenaming: M, inputProps: C } = kr({
1278
+ function Xs({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCollapse: o, onToggleHidden: d, onRename: i, onDelete: m, onSelect: l, innerRef: h, dragHandleProps: f, containerProps: g, isDragging: u }) {
1279
+ const x = S((z) => z.readonly), { isRenaming: w, startRenaming: M, inputProps: C } = Cr({
1280
1280
  initialLabel: t.name,
1281
1281
  disabled: x,
1282
1282
  onCommit: i,
1283
1283
  autoFocus: n
1284
- }), [a, p] = q(null), l = B(null);
1284
+ }), [a, p] = q(null), c = B(null);
1285
1285
  function E(z) {
1286
1286
  z.stopPropagation();
1287
- const K = l.current;
1287
+ const K = c.current;
1288
1288
  if (K) {
1289
1289
  const b = K.getBoundingClientRect();
1290
1290
  p({ x: b.right, y: b.bottom + 4 });
1291
1291
  }
1292
1292
  }
1293
- const g = B(null);
1293
+ const y = B(null);
1294
1294
  $(() => () => {
1295
- g.current !== null && clearTimeout(g.current);
1295
+ y.current !== null && clearTimeout(y.current);
1296
1296
  }, []);
1297
1297
  const N = {
1298
1298
  label: t.hidden ? "Show on map" : "Hide from map",
1299
- icon: t.hidden ? /* @__PURE__ */ r(st, { size: 16 }) : /* @__PURE__ */ r(Qe, { size: 16 }),
1299
+ icon: t.hidden ? /* @__PURE__ */ r(it, { size: 16 }) : /* @__PURE__ */ r(et, { size: 16 }),
1300
1300
  onClick: () => d()
1301
1301
  }, P = x ? [N] : [
1302
1302
  N,
1303
1303
  {
1304
1304
  label: "Rename",
1305
- icon: /* @__PURE__ */ r(Sn, { size: 16 }),
1305
+ icon: /* @__PURE__ */ r(Nn, { size: 16 }),
1306
1306
  onClick: () => M(t.name)
1307
1307
  },
1308
1308
  { separator: !0 },
1309
1309
  {
1310
1310
  // Removes the group but keeps its features at the top level.
1311
1311
  label: "Ungroup",
1312
- icon: /* @__PURE__ */ r(Cn, { size: 16 }),
1312
+ icon: /* @__PURE__ */ r(En, { size: 16 }),
1313
1313
  onClick: () => m("ungroup")
1314
1314
  },
1315
1315
  {
1316
1316
  label: "Delete group",
1317
- icon: /* @__PURE__ */ r(ze, { size: 16 }),
1317
+ icon: /* @__PURE__ */ r(Re, { size: 16 }),
1318
1318
  onClick: () => m("delete-features")
1319
1319
  }
1320
1320
  ];
1321
- return /* @__PURE__ */ T(ae, { children: [
1321
+ return /* @__PURE__ */ T(re, { children: [
1322
1322
  a && /* @__PURE__ */ r(
1323
- lr,
1323
+ dr,
1324
1324
  {
1325
1325
  x: a.x,
1326
1326
  y: a.y,
@@ -1331,16 +1331,16 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1331
1331
  /* @__PURE__ */ T(
1332
1332
  "div",
1333
1333
  {
1334
- ref: y,
1335
- ...h,
1334
+ ref: h,
1335
+ ...g,
1336
1336
  ...f,
1337
- className: ne(
1337
+ className: oe(
1338
1338
  "group flex items-center gap-2 px-2 py-1.5 rounded-elm-control text-sm font-medium cursor-default",
1339
1339
  u ? "shadow-elm-control bg-elm-surface-raised" : s ? "bg-(--elm-row-selected) hover:bg-(--elm-row-selected-hover) text-primary-700 dark:text-primary-300" : t.hidden ? "text-elm-text-disabled hover:bg-(--elm-row-hover)" : "text-elm-text-secondary hover:bg-(--elm-row-hover)"
1340
1340
  ),
1341
- style: { outline: "none", cursor: u ? "grabbing" : "default", ...h == null ? void 0 : h.style },
1341
+ style: { outline: "none", cursor: u ? "grabbing" : "default", ...g == null ? void 0 : g.style },
1342
1342
  onClick: () => {
1343
- c && c();
1343
+ l && l();
1344
1344
  },
1345
1345
  onContextMenu: (z) => {
1346
1346
  z.preventDefault(), p({ x: z.clientX, y: z.clientY });
@@ -1349,7 +1349,7 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1349
1349
  /* @__PURE__ */ r(
1350
1350
  "span",
1351
1351
  {
1352
- className: ne(
1352
+ className: oe(
1353
1353
  "flex-shrink-0 cursor-pointer",
1354
1354
  t.hidden ? "text-elm-text-disabled" : "text-elm-text-muted"
1355
1355
  ),
@@ -1357,7 +1357,7 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1357
1357
  z.stopPropagation(), o();
1358
1358
  },
1359
1359
  "aria-label": t.collapsed ? "Expand group" : "Collapse group",
1360
- children: t.collapsed ? /* @__PURE__ */ r(xn, { size: 20, weight: "fill" }) : /* @__PURE__ */ r(wn, { size: 20, weight: "fill" })
1360
+ children: t.collapsed ? /* @__PURE__ */ r(kn, { size: 20, weight: "fill" }) : /* @__PURE__ */ r(Sn, { size: 20, weight: "fill" })
1361
1361
  }
1362
1362
  ),
1363
1363
  w ? /* @__PURE__ */ r(
@@ -1371,12 +1371,12 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1371
1371
  {
1372
1372
  className: "flex-1 min-w-0 truncate cursor-default leading-snug border border-transparent rounded-elm-control px-1.5 py-0.5",
1373
1373
  onClick: (z) => {
1374
- z.stopPropagation(), !(!c || z.metaKey || z.ctrlKey || z.shiftKey) && (g.current !== null && (clearTimeout(g.current), g.current = null), !(z.detail >= 2) && (g.current = window.setTimeout(() => {
1375
- c(), g.current = null;
1374
+ z.stopPropagation(), !(!l || z.metaKey || z.ctrlKey || z.shiftKey) && (y.current !== null && (clearTimeout(y.current), y.current = null), !(z.detail >= 2) && (y.current = window.setTimeout(() => {
1375
+ l(), y.current = null;
1376
1376
  }, 300)));
1377
1377
  },
1378
1378
  onDoubleClick: (z) => {
1379
- z.stopPropagation(), g.current !== null && (clearTimeout(g.current), g.current = null), M(t.name);
1379
+ z.stopPropagation(), y.current !== null && (clearTimeout(y.current), y.current = null), M(t.name);
1380
1380
  },
1381
1381
  children: t.name
1382
1382
  }
@@ -1390,20 +1390,20 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1390
1390
  },
1391
1391
  className: "text-elm-text p-1 rounded-elm-control hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700))",
1392
1392
  "aria-label": "Show on map",
1393
- children: /* @__PURE__ */ r(Qe, { size: 16 })
1393
+ children: /* @__PURE__ */ r(et, { size: 16 })
1394
1394
  }
1395
1395
  ),
1396
- /* @__PURE__ */ r("div", { className: "opacity-0 group-hover:opacity-100", children: /* @__PURE__ */ r(be, { content: "More options", children: /* @__PURE__ */ r(
1396
+ /* @__PURE__ */ r("div", { className: "opacity-0 group-hover:opacity-100", children: /* @__PURE__ */ r(ve, { content: "More options", children: /* @__PURE__ */ r(
1397
1397
  "button",
1398
1398
  {
1399
- ref: l,
1399
+ ref: c,
1400
1400
  onClick: E,
1401
1401
  className: "text-elm-text p-1 rounded-elm-control hover:bg-(--elm-surface-hover,var(--color-gray-100)) dark:hover:bg-(--elm-surface-hover,var(--color-gray-700))",
1402
1402
  "aria-label": "More options",
1403
- children: /* @__PURE__ */ r(kn, { size: 16, weight: "bold" })
1403
+ children: /* @__PURE__ */ r(Cn, { size: 16, weight: "bold" })
1404
1404
  }
1405
1405
  ) }) }),
1406
- /* @__PURE__ */ r("span", { className: ne(
1406
+ /* @__PURE__ */ r("span", { className: oe(
1407
1407
  "font-normal w-7 text-right text-sm",
1408
1408
  t.hidden ? "text-elm-text-disabled" : "text-elm-text-subtle"
1409
1409
  ), children: e })
@@ -1413,14 +1413,14 @@ function js({ group: t, featureCount: e, autoFocus: n, isSelected: s, onToggleCo
1413
1413
  )
1414
1414
  ] });
1415
1415
  }
1416
- function qs({ geometry: t, partIndex: e, isSelected: n, onClick: s }) {
1417
- const o = Qr(t, e), d = en(t, e);
1416
+ function Zs({ geometry: t, partIndex: e, isSelected: n, onClick: s }) {
1417
+ const o = tn(t, e), d = rn(t, e);
1418
1418
  return (
1419
1419
  // ml-5 nests the sub-row under its parent feature visually.
1420
1420
  /* @__PURE__ */ r("li", { style: { listStyle: "none" }, className: "ml-5", children: /* @__PURE__ */ T(
1421
1421
  "div",
1422
1422
  {
1423
- className: ne(
1423
+ className: oe(
1424
1424
  // Fixed h-9, like FeatureRow: FeatureList computes the expanded row's height.
1425
1425
  "flex items-center gap-2 px-2 h-9 rounded-elm-control text-sm cursor-default",
1426
1426
  n ? "bg-(--elm-row-selected) hover:bg-(--elm-row-selected-hover) text-primary-700 dark:text-primary-300" : "text-elm-text-muted hover:bg-(--elm-row-hover)"
@@ -1429,74 +1429,74 @@ function qs({ geometry: t, partIndex: e, isSelected: n, onClick: s }) {
1429
1429
  i.stopPropagation(), s();
1430
1430
  },
1431
1431
  children: [
1432
- /* @__PURE__ */ r("span", { className: ne(
1432
+ /* @__PURE__ */ r("span", { className: oe(
1433
1433
  "flex-shrink-0",
1434
1434
  n ? "text-primary-700 dark:text-primary-300" : "text-(--elm-text-subtle,var(--color-gray-400))"
1435
- ), children: /* @__PURE__ */ r(wr, { type: o.type }) }),
1435
+ ), children: /* @__PURE__ */ r(Sr, { type: o.type }) }),
1436
1436
  /* @__PURE__ */ r("span", { className: "flex-1 min-w-0 font-normal truncate leading-snug border border-transparent rounded-elm-control px-1.5 py-0.5", children: d })
1437
1437
  ]
1438
1438
  }
1439
1439
  ) })
1440
1440
  );
1441
1441
  }
1442
- const $o = "elm_code_docked";
1443
- function Ko() {
1444
- const t = ce(), [e] = q(() => Ht($o, t) !== "0");
1442
+ const Oo = "elm_code_docked";
1443
+ function Bo() {
1444
+ const t = ce(), [e] = q(() => Jt(Oo, t) !== "0");
1445
1445
  return e;
1446
1446
  }
1447
- function Oo(t) {
1448
- const e = ce(), n = S((f) => f.layout), s = S(nt), o = S((f) => f.sidebarWidth), d = S((f) => f.tableFullscreen), i = S((f) => f.setCodeDockWidth), m = S((f) => f.narrow), c = br("elm_code_dock_width", 420, 280, 900);
1449
- pe(() => {
1447
+ function Wo(t) {
1448
+ const e = ce(), n = S((f) => f.layout), s = S(ot), o = S((f) => f.sidebarWidth), d = S((f) => f.tableFullscreen), i = S((f) => f.setCodeDockWidth), m = S((f) => f.narrow), l = xr("elm_code_dock_width", 420, 280, 900);
1449
+ fe(() => {
1450
1450
  if (t)
1451
- return $t(() => i(m ? 0 : c.width)), () => $t(() => i(0));
1452
- }, [t, m, c.width, i]);
1453
- const y = e.ui.layerList && s;
1451
+ return Kt(() => i(m ? 0 : l.width)), () => Kt(() => i(0));
1452
+ }, [t, m, l.width, i]);
1453
+ const h = e.ui.layerList && s;
1454
1454
  return {
1455
- ...c,
1455
+ ...l,
1456
1456
  className: `absolute top-0 ${m ? "z-[600] shadow-elm-raised" : "z-10"} flex flex-col bg-elm-surface border-l border-elm-border/80 overflow-hidden ${d ? "hidden" : ""}`,
1457
1457
  // Left of the layers panel, above split layout's bottom panel. Same
1458
1458
  // `right` transition as the panel and the data table: one mechanism
1459
1459
  // (layout) keeps them in lockstep; mixing it with a compositor
1460
1460
  // transform drifted and opened gaps.
1461
1461
  style: {
1462
- right: y ? o : 0,
1462
+ right: h ? o : 0,
1463
1463
  bottom: n === "split" ? "33.33%" : 0,
1464
- width: m ? `min(${c.width}px, 100%)` : c.width,
1464
+ width: m ? `min(${l.width}px, 100%)` : l.width,
1465
1465
  transition: "right 200ms ease"
1466
1466
  }
1467
1467
  };
1468
1468
  }
1469
- function Hs() {
1470
- const t = Ko(), e = Oo(t), n = B(null);
1471
- return vr(n, t), t ? /* @__PURE__ */ r("div", { ref: n, "aria-hidden": "true", className: e.className, style: e.style }) : null;
1469
+ function Ys() {
1470
+ const t = Bo(), e = Wo(t), n = B(null);
1471
+ return wr(n, t), t ? /* @__PURE__ */ r("div", { ref: n, "aria-hidden": "true", className: e.className, style: e.style }) : null;
1472
1472
  }
1473
- function Bo() {
1474
- const [t, e] = q(""), [n, s] = q(!1), [o, d] = q(!1), [i, m] = q(-1), c = B(null), y = B(null), { results: f, loading: h, error: u, flush: x } = Br(t), w = B(!1), { flyTo: M, fitBounds: C } = Ae(), { dataStore: a } = oe(), p = ke();
1473
+ function _o() {
1474
+ const [t, e] = q(""), [n, s] = q(!1), [o, d] = q(!1), [i, m] = q(-1), l = B(null), h = B(null), { results: f, loading: g, error: u, flush: x } = _r(t), w = B(!1), { flyTo: M, fitBounds: C } = ze(), { dataStore: a } = se(), p = Se();
1475
1475
  $(() => {
1476
1476
  s(t.trim().length >= 2), m(-1);
1477
1477
  }, [t, f]), $(() => {
1478
1478
  w.current = !1;
1479
1479
  }, [t]), $(() => {
1480
- !w.current || h || (w.current = !1, f.length && P(0));
1481
- }, [f, h]), $(() => {
1480
+ !w.current || g || (w.current = !1, f.length && P(0));
1481
+ }, [f, g]), $(() => {
1482
1482
  function b(k) {
1483
- c.current && !c.current.contains(k.target) && s(!1);
1483
+ l.current && !l.current.contains(k.target) && s(!1);
1484
1484
  }
1485
1485
  return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
1486
1486
  }, []), $(() => {
1487
1487
  function b(k) {
1488
1488
  var D, R;
1489
1489
  if (p(k)) {
1490
- if (k.key === "f" && (k.metaKey || k.ctrlKey) && !Sr(k)) {
1491
- k.preventDefault(), (D = y.current) == null || D.focus();
1490
+ if (k.key === "f" && (k.metaKey || k.ctrlKey) && !Nr(k)) {
1491
+ k.preventDefault(), (D = h.current) == null || D.focus();
1492
1492
  return;
1493
1493
  }
1494
- k.key === "Escape" && (n || document.activeElement === y.current) && (k.stopPropagation(), e(""), s(!1), m(-1), (R = y.current) == null || R.blur());
1494
+ k.key === "Escape" && (n || document.activeElement === h.current) && (k.stopPropagation(), e(""), s(!1), m(-1), (R = h.current) == null || R.blur());
1495
1495
  }
1496
1496
  }
1497
1497
  return window.addEventListener("keydown", b, { capture: !0 }), () => window.removeEventListener("keydown", b, { capture: !0 });
1498
1498
  }, [n, p]);
1499
- function l(b) {
1499
+ function c(b) {
1500
1500
  M == null || M([parseFloat(b.lat), parseFloat(b.lon)], 15);
1501
1501
  }
1502
1502
  function E(b) {
@@ -1512,7 +1512,7 @@ function Bo() {
1512
1512
  };
1513
1513
  a.getState().addFeature(j), M == null || M([k, D], 15), N();
1514
1514
  }
1515
- function g(b) {
1515
+ function y(b) {
1516
1516
  const k = b.geojson;
1517
1517
  if (!k || k.type === "Point") return;
1518
1518
  let D;
@@ -1520,25 +1520,25 @@ function Bo() {
1520
1520
  const R = {
1521
1521
  type: "Feature",
1522
1522
  id: crypto.randomUUID(),
1523
- schemaId: tn,
1523
+ schemaId: nn,
1524
1524
  geometry: D,
1525
1525
  properties: { name: b.display_name.split(",")[0].trim() }
1526
1526
  };
1527
- a.getState().addFeature(R), C == null || C(ot(D)), N();
1527
+ a.getState().addFeature(R), C == null || C(st(D)), N();
1528
1528
  }
1529
1529
  function N() {
1530
1530
  e(""), s(!1), m(-1);
1531
1531
  }
1532
1532
  function P(b) {
1533
- m(b), l(f[b]), requestAnimationFrame(() => {
1533
+ m(b), c(f[b]), requestAnimationFrame(() => {
1534
1534
  var k;
1535
- return (k = y.current) == null ? void 0 : k.focus();
1535
+ return (k = h.current) == null ? void 0 : k.focus();
1536
1536
  });
1537
1537
  }
1538
1538
  function z(b) {
1539
1539
  if (b.key === "Enter") {
1540
1540
  if (t.trim().length < 2) return;
1541
- if (b.preventDefault(), f.length && !h) {
1541
+ if (b.preventDefault(), f.length && !g) {
1542
1542
  P(i >= 0 ? i : 0);
1543
1543
  return;
1544
1544
  }
@@ -1548,13 +1548,13 @@ function Bo() {
1548
1548
  f.length && (b.key === "ArrowDown" ? (b.preventDefault(), m((k) => (k + 1) % f.length)) : b.key === "ArrowUp" && (b.preventDefault(), m((k) => k <= 0 ? f.length - 1 : k - 1)));
1549
1549
  }
1550
1550
  const K = n && t.trim().length >= 2;
1551
- return { query: t, setQuery: e, setOpen: s, showDropdown: K, containerRef: c, inputRef: y, focused: o, setFocused: d, results: f, loading: h, error: u, flyToResult: l, handleAdd: E, handleAddShape: g, clear: N, activeIndex: i, setActiveIndex: m, handleInputKeyDown: z };
1551
+ return { query: t, setQuery: e, setOpen: s, showDropdown: K, containerRef: l, inputRef: h, focused: o, setFocused: d, results: f, loading: g, error: u, flyToResult: c, handleAdd: E, handleAddShape: y, clear: N, activeIndex: i, setActiveIndex: m, handleInputKeyDown: z };
1552
1552
  }
1553
- function Sr(t) {
1553
+ function Nr(t) {
1554
1554
  var e, n;
1555
1555
  return ((n = (e = t.target) == null ? void 0 : e.closest) == null ? void 0 : n.call(e, ".cm-editor")) != null;
1556
1556
  }
1557
- const Wo = 208, _o = {
1557
+ const Go = 208, Uo = {
1558
1558
  "top-left": { style: { top: 16, left: 16 }, className: "flex-col items-start" },
1559
1559
  "top-center": { style: { top: 16, left: 0, right: 0 }, className: "flex-col items-center" },
1560
1560
  "top-right": { style: { top: 16, right: 16 }, className: "flex-col items-end" },
@@ -1564,83 +1564,83 @@ const Wo = 208, _o = {
1564
1564
  "bottom-center": { style: { bottom: 16, left: 0, right: 0 }, className: "flex-col-reverse items-center" },
1565
1565
  "bottom-right": { style: { bottom: 16, right: 16 }, className: "flex-col-reverse items-end" }
1566
1566
  };
1567
- function Vs({ embedded: t } = {}) {
1568
- const e = U((A) => A.features.length), n = U((A) => A.maxFeatures), s = n != null && e >= n, o = le(), d = ce(), { toolbar: i } = d, m = i.direction === "vertical", c = _o[i.position], y = S(nt), f = S((A) => A.sidebarWidth), h = S((A) => A.codeDockWidth), u = S((A) => A.layout), x = d.ui.layerList && y, w = i.position.startsWith("bottom"), M = i.position === "left-center" || i.position === "right-center", C = u === "split" && w, a = u === "split" && M, p = (() => {
1569
- let A = c.style;
1567
+ function Qs({ embedded: t } = {}) {
1568
+ const e = U((A) => A.features.length), n = U((A) => A.maxFeatures), s = n != null && e >= n, o = le(), d = ce(), { toolbar: i } = d, m = i.direction === "vertical", l = Uo[i.position], h = S(ot), f = S((A) => A.sidebarWidth), g = S((A) => A.codeDockWidth), u = S((A) => A.layout), x = d.ui.layerList && h, w = i.position.startsWith("bottom"), M = i.position === "left-center" || i.position === "right-center", C = u === "split" && w, a = u === "split" && M, p = (() => {
1569
+ let A = l.style;
1570
1570
  const X = i.position.endsWith("-right") || i.position.startsWith("right");
1571
- return x ? X && (A = { ...A, right: f + 16 + h }) : d.ui.layerList && u === "panel" && i.position === "top-right" ? A = { ...A, right: 72 + h } : X && h && (A = { ...A, right: 16 + h }), C ? A = { ...A, bottom: "calc(33.33% + 16px)" } : w && (A = { ...A, bottom: "calc(var(--elm-table-offset, 0px) + 16px)" }), a && (A = { ...A, top: "33.33%" }), A === c.style ? c : { ...c, style: A };
1572
- })(), l = S((A) => A.editingMode), E = S((A) => A.enabledTools), g = S((A) => A.unavailableTools), N = S((A) => A.readonly), P = S((A) => A.setEditingMode);
1571
+ return x ? X && (A = { ...A, right: f + 16 + g }) : d.ui.layerList && u === "panel" && i.position === "top-right" ? A = { ...A, right: 72 + g } : X && g && (A = { ...A, right: 16 + g }), C ? A = { ...A, bottom: "calc(33.33% + 16px)" } : w && (A = { ...A, bottom: "calc(var(--elm-table-offset, 0px) + 16px)" }), a && (A = { ...A, top: "33.33%" }), A === l.style ? l : { ...l, style: A };
1572
+ })(), c = S((A) => A.editingMode), E = S((A) => A.enabledTools), y = S((A) => A.unavailableTools), N = S((A) => A.readonly), P = S((A) => A.setEditingMode);
1573
1573
  function z(A) {
1574
1574
  if (s && A !== "none") {
1575
- o({ type: "error", code: "limit-reached", source: "editor", message: rn(n) });
1575
+ o({ type: "error", code: "limit-reached", source: "editor", message: on(n) });
1576
1576
  return;
1577
1577
  }
1578
1578
  P(A);
1579
1579
  }
1580
- const { getKey: K } = Ee(), { query: b, setQuery: k, setOpen: D, showDropdown: R, containerRef: O, inputRef: j, focused: Z, setFocused: L, results: v, loading: W, error: H, flyToResult: F, handleAdd: I, handleAddShape: _, clear: G, activeIndex: V, setActiveIndex: Y, handleInputKeyDown: re } = Bo(), ve = B(null), De = B(null);
1580
+ const { getKey: K } = Pe(), { query: b, setQuery: k, setOpen: D, showDropdown: R, containerRef: O, inputRef: j, focused: Z, setFocused: L, results: v, loading: W, error: H, flyToResult: F, handleAdd: I, handleAddShape: _, clear: G, activeIndex: V, setActiveIndex: Y, handleInputKeyDown: ne } = _o(), xe = B(null), Ie = B(null);
1581
1581
  $(() => {
1582
1582
  var de;
1583
1583
  if (t || !w) return;
1584
- const A = (de = De.current) == null ? void 0 : de.closest("[data-elm-theme]");
1584
+ const A = (de = Ie.current) == null ? void 0 : de.closest("[data-elm-theme]");
1585
1585
  if (!A) return;
1586
1586
  const X = () => {
1587
- var Se;
1588
- const xe = ((Se = De.current) == null ? void 0 : Se.offsetHeight) ?? 0;
1589
- A.style.setProperty("--elm-bottom-toolbar-offset", `${xe + 8}px`);
1587
+ var Ce;
1588
+ const we = ((Ce = Ie.current) == null ? void 0 : Ce.offsetHeight) ?? 0;
1589
+ A.style.setProperty("--elm-bottom-toolbar-offset", `${we + 8}px`);
1590
1590
  };
1591
1591
  X();
1592
1592
  const ee = new ResizeObserver(X);
1593
- return De.current && ee.observe(De.current), () => {
1593
+ return Ie.current && ee.observe(Ie.current), () => {
1594
1594
  ee.disconnect(), A.style.setProperty("--elm-bottom-toolbar-offset", "0px");
1595
1595
  };
1596
1596
  }, [t, w]);
1597
- const [Le, he] = q(!1), ut = B(null), mt = B(null), [Er, ft] = q(!1), pt = B(null);
1598
- pe(() => {
1599
- var kt, St;
1600
- const A = pt.current;
1597
+ const [$e, he] = q(!1), mt = B(null), ft = B(null), [Dr, pt] = q(!1), ht = B(null);
1598
+ fe(() => {
1599
+ var St, Ct;
1600
+ const A = ht.current;
1601
1601
  if (m || !A) {
1602
- ft(!1);
1602
+ pt(!1);
1603
1603
  return;
1604
1604
  }
1605
- const X = ((kt = O.current) == null ? void 0 : kt.closest('[data-elm-edge="top"], [data-elm-edge="bottom"]')) ?? null, ee = X ?? ((St = O.current) == null ? void 0 : St.offsetParent);
1605
+ const X = ((St = O.current) == null ? void 0 : St.closest('[data-elm-edge="top"], [data-elm-edge="bottom"]')) ?? null, ee = X ?? ((Ct = O.current) == null ? void 0 : Ct.offsetParent);
1606
1606
  if (!ee) return;
1607
- const de = (Re) => Re.flatMap((ye) => getComputedStyle(ye).display === "contents" ? de([...ye.children]) : [ye.offsetWidth]), xe = () => {
1608
- const Re = de([...A.children]).filter((Je) => Je > 0), ye = getComputedStyle(A), Ir = parseFloat(ye.paddingLeft) + parseFloat(ye.paddingRight) + parseFloat(ye.borderLeftWidth) + parseFloat(ye.borderRightWidth);
1609
- let Ct = Re.reduce((Je, Mr) => Je + Mr, 0) + 8 * Math.max(0, Re.length - 1) + Ir;
1610
- const Nt = A.querySelector("[data-elm-search-toggle]");
1611
- Nt && (Ct += Wo - Nt.offsetWidth);
1612
- const Et = X ? X.clientWidth - (parseFloat(X.dataset.elmClearance ?? "") || 0) : ee.clientWidth - 32;
1613
- ft(Et > 0 && Ct > Et + 0.5);
1607
+ const de = (Ke) => Ke.flatMap((ye) => getComputedStyle(ye).display === "contents" ? de([...ye.children]) : [ye.offsetWidth]), we = () => {
1608
+ const Ke = de([...A.children]).filter((Xe) => Xe > 0), ye = getComputedStyle(A), Tr = parseFloat(ye.paddingLeft) + parseFloat(ye.paddingRight) + parseFloat(ye.borderLeftWidth) + parseFloat(ye.borderRightWidth);
1609
+ let Nt = Ke.reduce((Xe, Ar) => Xe + Ar, 0) + 8 * Math.max(0, Ke.length - 1) + Tr;
1610
+ const Et = A.querySelector("[data-elm-search-toggle]");
1611
+ Et && (Nt += Go - Et.offsetWidth);
1612
+ const Pt = X ? X.clientWidth - (parseFloat(X.dataset.elmClearance ?? "") || 0) : ee.clientWidth - 32;
1613
+ pt(Pt > 0 && Nt > Pt + 0.5);
1614
1614
  };
1615
- xe();
1616
- const Se = new ResizeObserver(() => xe());
1617
- return Se.observe(ee), Se.observe(A), () => Se.disconnect();
1615
+ we();
1616
+ const Ce = new ResizeObserver(() => we());
1617
+ return Ce.observe(ee), Ce.observe(A), () => Ce.disconnect();
1618
1618
  }, [m, O]);
1619
- const ge = m || Er, ht = B(ge);
1620
- ht.current = ge, $(() => {
1619
+ const ge = m || Dr, gt = B(ge);
1620
+ gt.current = ge, $(() => {
1621
1621
  ge || he(!1);
1622
1622
  }, [ge]);
1623
- const gt = B(null), yt = ke();
1624
- function bt() {
1625
- const A = gt.current;
1623
+ const yt = B(null), bt = Se();
1624
+ function vt() {
1625
+ const A = yt.current;
1626
1626
  A && (A.style.animation = "none", A.offsetWidth, A.style.animation = "press-pulse 200ms ease-out");
1627
1627
  }
1628
1628
  $(() => {
1629
1629
  function A(X) {
1630
- X.key === "f" && (X.metaKey || X.ctrlKey) && yt(X) && !Sr(X) && (ht.current ? he(!0) : bt());
1630
+ X.key === "f" && (X.metaKey || X.ctrlKey) && bt(X) && !Nr(X) && (gt.current ? he(!0) : vt());
1631
1631
  }
1632
1632
  return window.addEventListener("keydown", A), () => window.removeEventListener("keydown", A);
1633
- }, [yt]);
1634
- const Pr = i.position.startsWith("right") || i.position.endsWith("-right") ? "left" : "right";
1633
+ }, [bt]);
1634
+ const Ir = i.position.startsWith("right") || i.position.endsWith("-right") ? "left" : "right";
1635
1635
  $(() => {
1636
- if (!Le) return;
1636
+ if (!$e) return;
1637
1637
  requestAnimationFrame(() => {
1638
1638
  var ee;
1639
1639
  return (ee = j.current) == null ? void 0 : ee.focus();
1640
1640
  });
1641
1641
  function A(ee) {
1642
- var de, xe;
1643
- !((de = ut.current) != null && de.contains(ee.target)) && !((xe = mt.current) != null && xe.contains(ee.target)) && he(!1);
1642
+ var de, we;
1643
+ !((de = mt.current) != null && de.contains(ee.target)) && !((we = ft.current) != null && we.contains(ee.target)) && he(!1);
1644
1644
  }
1645
1645
  function X(ee) {
1646
1646
  ee.key === "Escape" && he(!1);
@@ -1648,34 +1648,34 @@ function Vs({ embedded: t } = {}) {
1648
1648
  return document.addEventListener("mousedown", A), document.addEventListener("keydown", X), () => {
1649
1649
  document.removeEventListener("mousedown", A), document.removeEventListener("keydown", X);
1650
1650
  };
1651
- }, [Le, j]);
1652
- const We = l === "place-point", _e = l === "draw-line", Ge = l === "draw-polygon", Ue = l === "draw-circle", je = l === "draw-rect", qe = l === "draw-route", He = l === "draw-freehand", Ve = l === "pick-shape", vt = l === "measure", se = (A) => (!E || E.includes(A)) && !g.includes(A), Dr = null;
1653
- function xt(A) {
1651
+ }, [$e, j]);
1652
+ const _e = c === "place-point", Ge = c === "draw-line", Ue = c === "draw-polygon", je = c === "draw-circle", qe = c === "draw-rect", He = c === "draw-route", Ve = c === "draw-freehand", Je = c === "pick-shape", xt = c === "measure", ie = (A) => (!E || E.includes(A)) && !y.includes(A), Mr = null;
1653
+ function wt(A) {
1654
1654
  var X;
1655
1655
  if (A.key === "Tab" && V >= 0) {
1656
- A.preventDefault(), (X = ve.current) == null || X.focusAdd(V);
1656
+ A.preventDefault(), (X = xe.current) == null || X.focusAdd(V);
1657
1657
  return;
1658
1658
  }
1659
- re(A);
1659
+ ne(A);
1660
1660
  }
1661
- function wt(A, X) {
1661
+ function kt(A, X) {
1662
1662
  var de;
1663
1663
  const ee = ((X + A) % v.length + v.length) % v.length;
1664
- Y(ee), (de = ve.current) == null || de.focusAdd(ee);
1664
+ Y(ee), (de = xe.current) == null || de.focusAdd(ee);
1665
1665
  }
1666
1666
  return /* @__PURE__ */ T(
1667
1667
  "div",
1668
1668
  {
1669
1669
  ref: O,
1670
1670
  "data-elm-search-open": R ? "true" : void 0,
1671
- className: t ? "select-none" : ne("absolute z-[500] flex gap-2 pointer-events-none select-none", p.className),
1671
+ className: t ? "select-none" : oe("absolute z-[500] flex gap-2 pointer-events-none select-none", p.className),
1672
1672
  style: t ? void 0 : p.style,
1673
1673
  children: [
1674
- /* @__PURE__ */ T("div", { ref: De, className: "relative w-fit max-w-full", children: [
1674
+ /* @__PURE__ */ T("div", { ref: Ie, className: "relative w-fit max-w-full", children: [
1675
1675
  R && !ge && /* @__PURE__ */ r(
1676
- Ft,
1676
+ zt,
1677
1677
  {
1678
- ref: ve,
1678
+ ref: xe,
1679
1679
  results: v,
1680
1680
  loading: W,
1681
1681
  error: H,
@@ -1684,38 +1684,38 @@ function Vs({ embedded: t } = {}) {
1684
1684
  onAddShape: N ? void 0 : _,
1685
1685
  activeIndex: V,
1686
1686
  onHoverIndex: Y,
1687
- onNavigate: wt,
1687
+ onNavigate: kt,
1688
1688
  layout: "row",
1689
1689
  className: `absolute left-0 right-0 bg-elm-surface border border-elm-border rounded-elm shadow-elm z-50 overflow-hidden pointer-events-auto ${w ? "bottom-full mb-2" : "top-full mt-2"}`
1690
1690
  }
1691
1691
  ),
1692
- /* @__PURE__ */ T("div", { ref: pt, className: ne(
1692
+ /* @__PURE__ */ T("div", { ref: ht, className: oe(
1693
1693
  "flex gap-2 bg-elm-surface/95 backdrop-blur-md border border-(--elm-border,color-mix(in_oklab,var(--color-black)_10%,transparent)) dark:border-(--elm-border,color-mix(in_oklab,var(--color-white)_10%,transparent)) shadow-elm rounded-elm pointer-events-auto antialiased",
1694
1694
  m ? "flex-col items-center p-[7px]" : "flex-row flex-wrap justify-center items-center p-[7px]"
1695
1695
  ), children: [
1696
- N ? null : /* @__PURE__ */ T(ae, { children: [
1697
- se("point") && /* @__PURE__ */ r(me, { active: We, disabled: !We && s, onClick: () => z(We ? "none" : "place-point"), label: "Point", shortcut: K("place-point").toUpperCase(), shortcutId: "place-point", children: /* @__PURE__ */ r(Zt, { size: 24 }) }),
1698
- se("line") && /* @__PURE__ */ r(me, { active: _e, disabled: !_e && s, onClick: () => z(_e ? "none" : "draw-line"), label: "Line", shortcut: K("draw-line").toUpperCase(), shortcutId: "draw-line", children: /* @__PURE__ */ r(Qt, { size: 24 }) }),
1699
- se("polygon") && /* @__PURE__ */ r(me, { active: Ge, disabled: !Ge && s, onClick: () => z(Ge ? "none" : "draw-polygon"), label: "Area", shortcut: K("draw-polygon").toUpperCase(), shortcutId: "draw-polygon", children: /* @__PURE__ */ r(Yt, { size: 24 }) }),
1700
- se("route") && /* @__PURE__ */ r(me, { active: qe, disabled: !qe && s, onClick: () => z(qe ? "none" : "draw-route"), label: "Route", shortcut: K("draw-route").toUpperCase(), shortcutId: "draw-route", children: /* @__PURE__ */ r(Nn, { size: 24 }) }),
1701
- se("circle") && /* @__PURE__ */ r(me, { active: Ue, disabled: !Ue && s, onClick: () => z(Ue ? "none" : "draw-circle"), label: "Circle", shortcut: K("draw-circle").toUpperCase(), shortcutId: "draw-circle", children: /* @__PURE__ */ r(En, { size: 24 }) }),
1702
- se("rectangle") && /* @__PURE__ */ r(me, { active: je, disabled: !je && s, onClick: () => z(je ? "none" : "draw-rect"), label: "Rectangle", shortcut: K("draw-rect").toUpperCase(), shortcutId: "draw-rect", children: /* @__PURE__ */ r(Pn, { size: 24 }) }),
1703
- se("freehand") && /* @__PURE__ */ r(me, { active: He, disabled: !He && s, onClick: () => z(He ? "none" : "draw-freehand"), label: "Freehand", shortcut: K("draw-freehand").toUpperCase(), shortcutId: "draw-freehand", children: /* @__PURE__ */ r(Dn, { size: 24 }) }),
1704
- se("picker") && /* @__PURE__ */ r(me, { active: Ve, disabled: !Ve && s, onClick: () => z(Ve ? "none" : "pick-shape"), label: "Picker", shortcut: K("picker").toUpperCase(), shortcutId: "picker", children: /* @__PURE__ */ r(In, { size: 24 }) })
1696
+ N ? null : /* @__PURE__ */ T(re, { children: [
1697
+ ie("point") && /* @__PURE__ */ r(me, { active: _e, disabled: !_e && s, onClick: () => z(_e ? "none" : "place-point"), label: "Point", shortcut: K("place-point").toUpperCase(), shortcutId: "place-point", children: /* @__PURE__ */ r(Qt, { size: 24 }) }),
1698
+ ie("line") && /* @__PURE__ */ r(me, { active: Ge, disabled: !Ge && s, onClick: () => z(Ge ? "none" : "draw-line"), label: "Line", shortcut: K("draw-line").toUpperCase(), shortcutId: "draw-line", children: /* @__PURE__ */ r(tr, { size: 24 }) }),
1699
+ ie("polygon") && /* @__PURE__ */ r(me, { active: Ue, disabled: !Ue && s, onClick: () => z(Ue ? "none" : "draw-polygon"), label: "Area", shortcut: K("draw-polygon").toUpperCase(), shortcutId: "draw-polygon", children: /* @__PURE__ */ r(er, { size: 24 }) }),
1700
+ ie("route") && /* @__PURE__ */ r(me, { active: He, disabled: !He && s, onClick: () => z(He ? "none" : "draw-route"), label: "Route", shortcut: K("draw-route").toUpperCase(), shortcutId: "draw-route", children: /* @__PURE__ */ r(Pn, { size: 24 }) }),
1701
+ ie("circle") && /* @__PURE__ */ r(me, { active: je, disabled: !je && s, onClick: () => z(je ? "none" : "draw-circle"), label: "Circle", shortcut: K("draw-circle").toUpperCase(), shortcutId: "draw-circle", children: /* @__PURE__ */ r(Dn, { size: 24 }) }),
1702
+ ie("rectangle") && /* @__PURE__ */ r(me, { active: qe, disabled: !qe && s, onClick: () => z(qe ? "none" : "draw-rect"), label: "Rectangle", shortcut: K("draw-rect").toUpperCase(), shortcutId: "draw-rect", children: /* @__PURE__ */ r(In, { size: 24 }) }),
1703
+ ie("freehand") && /* @__PURE__ */ r(me, { active: Ve, disabled: !Ve && s, onClick: () => z(Ve ? "none" : "draw-freehand"), label: "Freehand", shortcut: K("draw-freehand").toUpperCase(), shortcutId: "draw-freehand", children: /* @__PURE__ */ r(Mn, { size: 24 }) }),
1704
+ ie("picker") && /* @__PURE__ */ r(me, { active: Je, disabled: !Je && s, onClick: () => z(Je ? "none" : "pick-shape"), label: "Picker", shortcut: K("picker").toUpperCase(), shortcutId: "picker", children: /* @__PURE__ */ r(Tn, { size: 24 }) })
1705
1705
  ] }),
1706
- se("measure") && /* @__PURE__ */ T(ae, { children: [
1707
- !N && /* @__PURE__ */ r(zt, { vertical: m }),
1708
- /* @__PURE__ */ r(me, { active: vt, onClick: () => P(vt ? "none" : "measure"), label: "Measure", shortcut: K("measure").toUpperCase(), shortcutId: "measure", children: /* @__PURE__ */ r(Mn, { size: 24 }) }),
1709
- ge && se("search") && /* @__PURE__ */ r(zt, { vertical: m })
1706
+ ie("measure") && /* @__PURE__ */ T(re, { children: [
1707
+ !N && /* @__PURE__ */ r(Lt, { vertical: m }),
1708
+ /* @__PURE__ */ r(me, { active: xt, onClick: () => P(xt ? "none" : "measure"), label: "Measure", shortcut: K("measure").toUpperCase(), shortcutId: "measure", children: /* @__PURE__ */ r(An, { size: 24 }) }),
1709
+ ge && ie("search") && /* @__PURE__ */ r(Lt, { vertical: m })
1710
1710
  ] }),
1711
- se("search") && !ge && /* @__PURE__ */ T("div", { className: "flex items-center gap-2 pl-2.5 pr-3 py-1.5 bg-(--elm-surface-sunken,var(--color-gray-100)) dark:bg-(--elm-surface-sunken,color-mix(in_oklab,var(--color-white)_7%,transparent)) hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_10%,transparent)) rounded-elm-control transition-colors w-52 focus-within:ring-1 focus-within:ring-inset focus-within:ring-(--elm-border-strong,var(--color-gray-300)) dark:focus-within:ring-(--elm-border-strong,var(--color-gray-600))", children: [
1711
+ ie("search") && !ge && /* @__PURE__ */ T("div", { className: "flex items-center gap-2 pl-2.5 pr-3 py-1.5 bg-(--elm-surface-sunken,var(--color-gray-100)) dark:bg-(--elm-surface-sunken,color-mix(in_oklab,var(--color-white)_7%,transparent)) hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_10%,transparent)) rounded-elm-control transition-colors w-52 focus-within:ring-1 focus-within:ring-inset focus-within:ring-(--elm-border-strong,var(--color-gray-300)) dark:focus-within:ring-(--elm-border-strong,var(--color-gray-600))", children: [
1712
1712
  /* @__PURE__ */ T(
1713
1713
  "div",
1714
1714
  {
1715
- ref: gt,
1715
+ ref: yt,
1716
1716
  className: "flex items-center gap-2 flex-1 min-w-0",
1717
1717
  children: [
1718
- /* @__PURE__ */ r(Ze, { size: 14, className: "text-elm-text-subtle flex-shrink-0" }),
1718
+ /* @__PURE__ */ r(Ye, { size: 14, className: "text-elm-text-subtle flex-shrink-0" }),
1719
1719
  /* @__PURE__ */ r(
1720
1720
  "input",
1721
1721
  {
@@ -1724,17 +1724,17 @@ function Vs({ embedded: t } = {}) {
1724
1724
  value: b,
1725
1725
  onChange: (A) => k(A.target.value),
1726
1726
  onFocus: () => {
1727
- L(!0), bt(), b.trim().length >= 2 && D(!0);
1727
+ L(!0), vt(), b.trim().length >= 2 && D(!0);
1728
1728
  },
1729
1729
  onBlur: () => L(!1),
1730
- onKeyDown: xt,
1730
+ onKeyDown: wt,
1731
1731
  placeholder: "Search places…",
1732
1732
  className: "bg-transparent text-sm text-elm-text-secondary placeholder-elm-text-muted outline-none w-full",
1733
1733
  autoComplete: "off"
1734
1734
  }
1735
1735
  ),
1736
1736
  W && /* @__PURE__ */ r("div", { className: "w-3 h-3 border-2 border-(--elm-border-strong,var(--color-gray-300)) border-t-primary-500 rounded-full animate-spin flex-shrink-0" }),
1737
- !W && b && /* @__PURE__ */ r("button", { onClick: G, className: "p-1 -m-1 rounded-elm-chip text-elm-text hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_15%,transparent)) transition-colors flex-shrink-0", "aria-label": "Clear search", children: /* @__PURE__ */ r(Tt, { size: 12 }) })
1737
+ !W && b && /* @__PURE__ */ r("button", { onClick: G, className: "p-1 -m-1 rounded-elm-chip text-elm-text hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_15%,transparent)) transition-colors flex-shrink-0", "aria-label": "Clear search", children: /* @__PURE__ */ r(At, { size: 12 }) })
1738
1738
  ]
1739
1739
  }
1740
1740
  ),
@@ -1744,41 +1744,41 @@ function Vs({ embedded: t } = {}) {
1744
1744
  /* @__PURE__ */ T(
1745
1745
  "span",
1746
1746
  {
1747
- className: ne(
1747
+ className: oe(
1748
1748
  "flex items-center gap-0.5 flex-shrink-0 transition-all duration-110 ease-out",
1749
1749
  Z ? "opacity-0 scale-75 pointer-events-none" : "opacity-100 scale-100"
1750
1750
  ),
1751
1751
  children: [
1752
- /* @__PURE__ */ r(Oe, { children: "⌘" }),
1753
- /* @__PURE__ */ r(Oe, { children: "F" })
1752
+ /* @__PURE__ */ r(Ee, { children: "⌘" }),
1753
+ /* @__PURE__ */ r(Ee, { children: "F" })
1754
1754
  ]
1755
1755
  }
1756
1756
  )
1757
1757
  ] }),
1758
- se("search") && ge && /* @__PURE__ */ T("div", { ref: mt, "data-elm-search-toggle": "", className: m ? "relative" : void 0, children: [
1758
+ ie("search") && ge && /* @__PURE__ */ T("div", { ref: ft, "data-elm-search-toggle": "", className: m ? "relative" : void 0, children: [
1759
1759
  /* @__PURE__ */ r(
1760
1760
  me,
1761
1761
  {
1762
- active: Le,
1762
+ active: $e,
1763
1763
  onClick: () => he((A) => !A),
1764
1764
  label: "Search places",
1765
1765
  shortcut: "⌘F",
1766
- children: /* @__PURE__ */ r(Ze, { size: 24 })
1766
+ children: /* @__PURE__ */ r(Ye, { size: 24 })
1767
1767
  }
1768
1768
  ),
1769
- Le && /* @__PURE__ */ T(
1769
+ $e && /* @__PURE__ */ T(
1770
1770
  "div",
1771
1771
  {
1772
- ref: ut,
1773
- className: ne(
1772
+ ref: mt,
1773
+ className: oe(
1774
1774
  "absolute z-50 bg-elm-surface/97 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm pointer-events-auto antialiased flex flex-col",
1775
1775
  // Vertical: beside the column. Compact horizontal: under
1776
1776
  // (or above) the bar, as wide as it, like the inline dropdown.
1777
- m ? Pr === "right" ? "top-0 w-80 left-full ml-2" : "top-0 w-80 right-full mr-2" : `left-0 right-0 min-w-0 ${w ? "bottom-full mb-2" : "top-full mt-2"}`
1777
+ m ? Ir === "right" ? "top-0 w-80 left-full ml-2" : "top-0 w-80 right-full mr-2" : `left-0 right-0 min-w-0 ${w ? "bottom-full mb-2" : "top-full mt-2"}`
1778
1778
  ),
1779
1779
  children: [
1780
1780
  /* @__PURE__ */ T("div", { className: "flex items-center gap-2 px-3 py-2", children: [
1781
- /* @__PURE__ */ r(Ze, { size: 16, className: "text-elm-text-subtle flex-shrink-0" }),
1781
+ /* @__PURE__ */ r(Ye, { size: 16, className: "text-elm-text-subtle flex-shrink-0" }),
1782
1782
  /* @__PURE__ */ r(
1783
1783
  "input",
1784
1784
  {
@@ -1790,19 +1790,19 @@ function Vs({ embedded: t } = {}) {
1790
1790
  L(!0), b.trim().length >= 2 && D(!0);
1791
1791
  },
1792
1792
  onBlur: () => L(!1),
1793
- onKeyDown: xt,
1793
+ onKeyDown: wt,
1794
1794
  placeholder: "Search places…",
1795
1795
  className: "bg-transparent text-sm text-elm-text-secondary placeholder-elm-text-muted outline-none w-full",
1796
1796
  autoComplete: "off"
1797
1797
  }
1798
1798
  ),
1799
1799
  W && /* @__PURE__ */ r("div", { className: "w-3 h-3 border-2 border-(--elm-border-strong,var(--color-gray-300)) border-t-primary-500 rounded-full animate-spin flex-shrink-0" }),
1800
- !W && b && /* @__PURE__ */ r("button", { onClick: G, className: "p-1 -m-1 rounded-elm-chip text-elm-text hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_15%,transparent)) transition-colors flex-shrink-0", "aria-label": "Clear search", children: /* @__PURE__ */ r(Tt, { size: 12 }) })
1800
+ !W && b && /* @__PURE__ */ r("button", { onClick: G, className: "p-1 -m-1 rounded-elm-chip text-elm-text hover:bg-(--elm-control-hover,var(--color-gray-200)) dark:hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-white)_15%,transparent)) transition-colors flex-shrink-0", "aria-label": "Clear search", children: /* @__PURE__ */ r(At, { size: 12 }) })
1801
1801
  ] }),
1802
1802
  R && /* @__PURE__ */ r(
1803
- Ft,
1803
+ zt,
1804
1804
  {
1805
- ref: ve,
1805
+ ref: xe,
1806
1806
  results: v,
1807
1807
  loading: W,
1808
1808
  error: H,
@@ -1817,7 +1817,7 @@ function Vs({ embedded: t } = {}) {
1817
1817
  },
1818
1818
  activeIndex: V,
1819
1819
  onHoverIndex: Y,
1820
- onNavigate: wt,
1820
+ onNavigate: kt,
1821
1821
  className: "border-t border-elm-border max-h-80 overflow-y-auto"
1822
1822
  }
1823
1823
  )
@@ -1827,12 +1827,12 @@ function Vs({ embedded: t } = {}) {
1827
1827
  ] })
1828
1828
  ] })
1829
1829
  ] }),
1830
- !N && Dr
1830
+ !N && Mr
1831
1831
  ]
1832
1832
  }
1833
1833
  );
1834
1834
  }
1835
- function Bt(t) {
1835
+ function Wt(t) {
1836
1836
  const e = [], n = (s) => {
1837
1837
  for (const o of Array.from(s.children)) {
1838
1838
  if (getComputedStyle(o).display === "contents") {
@@ -1847,47 +1847,47 @@ function Bt(t) {
1847
1847
  };
1848
1848
  return n(t), e.length;
1849
1849
  }
1850
- function Go(t, e) {
1851
- pe(() => {
1850
+ function jo(t, e) {
1851
+ fe(() => {
1852
1852
  const n = t.current;
1853
1853
  if (!n) return;
1854
1854
  const s = () => {
1855
1855
  n.style.maxWidth = "";
1856
- const c = Bt(n);
1857
- if (c < 2) return;
1858
- let y = 0, f = n.offsetWidth;
1859
- for (; f - y > 1; ) {
1860
- const h = y + f >> 1;
1861
- n.style.maxWidth = h + "px", Bt(n) > c || n.scrollWidth > n.clientWidth ? y = h : f = h;
1856
+ const l = Wt(n);
1857
+ if (l < 2) return;
1858
+ let h = 0, f = n.offsetWidth;
1859
+ for (; f - h > 1; ) {
1860
+ const g = h + f >> 1;
1861
+ n.style.maxWidth = g + "px", Wt(n) > l || n.scrollWidth > n.clientWidth ? h = g : f = g;
1862
1862
  }
1863
1863
  n.style.maxWidth = f + "px";
1864
1864
  };
1865
1865
  s();
1866
1866
  const o = [];
1867
- for (let c = n.parentElement; c && o.length < 8 && (o.push(c), !c.hasAttribute("data-elm-theme")); c = c.parentElement)
1867
+ for (let l = n.parentElement; l && o.length < 8 && (o.push(l), !l.hasAttribute("data-elm-theme")); l = l.parentElement)
1868
1868
  ;
1869
1869
  const d = /* @__PURE__ */ new WeakMap(), i = () => {
1870
- for (const c of o) d.set(c, c.clientWidth);
1870
+ for (const l of o) d.set(l, l.clientWidth);
1871
1871
  };
1872
1872
  i();
1873
- const m = new ResizeObserver((c) => {
1874
- c.every((y) => d.get(y.target) === y.target.clientWidth) || (s(), i());
1873
+ const m = new ResizeObserver((l) => {
1874
+ l.every((h) => d.get(h.target) === h.target.clientWidth) || (s(), i());
1875
1875
  });
1876
- for (const c of o) m.observe(c);
1876
+ for (const l of o) m.observe(l);
1877
1877
  return () => {
1878
1878
  m.disconnect(), n.style.maxWidth = "";
1879
1879
  };
1880
1880
  }, [t, e]);
1881
1881
  }
1882
- const Uo = _t(() => import("./BooleanOperations-oF0WybQP.js"));
1883
- function Js() {
1884
- const { dataStore: t } = oe(), e = S((k) => k.readonly), n = S((k) => k.transformActive), s = S((k) => k.setTransformActive), o = S((k) => k.editingMode), d = S((k) => k.setEditingMode), i = U((k) => k.selectedIds), m = i.length === 1 ? i[0] : null, c = S((k) => k.closeDialog), { getKey: y } = Ee(), f = le(), h = U((k) => {
1882
+ const qo = Ut(() => import("./BooleanOperations-CUQDHcha.js"));
1883
+ function ei() {
1884
+ const { dataStore: t } = se(), e = S((k) => k.readonly), n = S((k) => k.transformActive), s = S((k) => k.setTransformActive), o = S((k) => k.editingMode), d = S((k) => k.setEditingMode), i = U((k) => k.selectedIds), m = i.length === 1 ? i[0] : null, l = S((k) => k.closeDialog), { getKey: h } = Pe(), f = le(), g = U((k) => {
1885
1885
  if (!m) return null;
1886
1886
  const D = k.features.find((R) => R.id === m);
1887
1887
  return (D == null ? void 0 : D.geometry.type) ?? null;
1888
1888
  }), u = B(null);
1889
- if (Go(u, `${e}|${i.length}|${h}`), e) return null;
1890
- const x = m !== null || i.length > 0, w = h === "Polygon" || h === "MultiPolygon", M = h === "MultiPoint" || h === "MultiPolygon" || h === "MultiLineString" || h === "GeometryCollection", C = i.length === 1 && h === "Point", a = x && !C, p = w, l = Fe(h), E = M, g = i.length >= 2, N = E || g;
1889
+ if (jo(u, `${e}|${i.length}|${g}`), e) return null;
1890
+ const x = m !== null || i.length > 0, w = g === "Polygon" || g === "MultiPolygon", M = g === "MultiPoint" || g === "MultiPolygon" || g === "MultiLineString" || g === "GeometryCollection", C = i.length === 1 && g === "Point", a = x && !C, p = w, c = Le(g), E = M, y = i.length >= 2, N = E || y;
1891
1891
  function P() {
1892
1892
  if (i.length !== 0 && t.getState().duplicateSelection())
1893
1893
  if (i.length === 1) {
@@ -1900,7 +1900,7 @@ function Js() {
1900
1900
  if (!m || !M) return;
1901
1901
  const k = t.getState().features.find((R) => R.id === m);
1902
1902
  if (!k) return;
1903
- const D = rt(k.geometry);
1903
+ const D = nt(k.geometry);
1904
1904
  t.getState().breakMultiGeometry(m) && f({ type: "feature:broken", featureId: m, count: D, undo: () => t.getState().undo() });
1905
1905
  }
1906
1906
  function K() {
@@ -1909,7 +1909,7 @@ function Js() {
1909
1909
  function b() {
1910
1910
  if (i.length === 0) return;
1911
1911
  const k = i.length, D = k === 1 ? t.getState().features.find((O) => O.id === i[0]) : null, R = k === 1 ? String((D == null ? void 0 : D.properties.name) || "Unnamed feature") : `${k} features`;
1912
- t.getState().deleteSelection(), c(), f(k === 1 ? { type: "feature:deleted", featureId: i[0], label: R, undo: () => t.getState().undo() } : { type: "features:deleted", count: k, undo: () => t.getState().undo() });
1912
+ t.getState().deleteSelection(), l(), f(k === 1 ? { type: "feature:deleted", featureId: i[0], label: R, undo: () => t.getState().undo() } : { type: "features:deleted", count: k, undo: () => t.getState().undo() });
1913
1913
  }
1914
1914
  return /* @__PURE__ */ T("div", { className: "flex flex-wrap items-center justify-center gap-3 max-w-full pointer-events-none", children: [
1915
1915
  x && /* @__PURE__ */ T("div", { ref: u, className: "flex flex-wrap items-center justify-center gap-2 max-w-full bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-2 py-2 pointer-events-auto antialiased", children: [
@@ -1917,45 +1917,45 @@ function Js() {
1917
1917
  te,
1918
1918
  {
1919
1919
  label: "Transform",
1920
- shortcut: /* @__PURE__ */ r(Q, { children: y("toggle-transform").toUpperCase() }),
1920
+ shortcut: /* @__PURE__ */ r(Q, { children: h("toggle-transform").toUpperCase() }),
1921
1921
  shortcutId: "toggle-transform",
1922
1922
  onClick: () => {
1923
1923
  s(!n), !n && o !== "none" && d("none");
1924
1924
  },
1925
1925
  active: n,
1926
- children: /* @__PURE__ */ r(er, { size: 24 })
1926
+ children: /* @__PURE__ */ r(rr, { size: 24 })
1927
1927
  }
1928
1928
  ),
1929
- a && (l || N) && /* @__PURE__ */ r(Ne, {}),
1930
- p && /* @__PURE__ */ T(ae, { children: [
1929
+ a && (c || N) && /* @__PURE__ */ r(Te, {}),
1930
+ p && /* @__PURE__ */ T(re, { children: [
1931
1931
  /* @__PURE__ */ r(
1932
1932
  te,
1933
1933
  {
1934
1934
  label: "Cut hole",
1935
- shortcut: /* @__PURE__ */ r(Q, { children: y("cut-hole").toUpperCase() }),
1935
+ shortcut: /* @__PURE__ */ r(Q, { children: h("cut-hole").toUpperCase() }),
1936
1936
  shortcutId: "cut-hole",
1937
1937
  onClick: () => {
1938
1938
  d(o === "cut-hole" ? "none" : "cut-hole"), n && s(!1);
1939
1939
  },
1940
1940
  active: o === "cut-hole",
1941
- children: /* @__PURE__ */ r(tr, { size: 24 })
1941
+ children: /* @__PURE__ */ r(nr, { size: 24 })
1942
1942
  }
1943
1943
  ),
1944
1944
  /* @__PURE__ */ r(
1945
1945
  te,
1946
1946
  {
1947
1947
  label: "Slice shape",
1948
- shortcut: /* @__PURE__ */ r(Q, { children: y("slice-shape").toUpperCase() }),
1948
+ shortcut: /* @__PURE__ */ r(Q, { children: h("slice-shape").toUpperCase() }),
1949
1949
  shortcutId: "slice-shape",
1950
1950
  onClick: () => {
1951
1951
  d(o === "slice-shape" ? "none" : "slice-shape"), n && s(!1);
1952
1952
  },
1953
1953
  active: o === "slice-shape",
1954
- children: /* @__PURE__ */ r(rr, { size: 24 })
1954
+ children: /* @__PURE__ */ r(or, { size: 24 })
1955
1955
  }
1956
1956
  )
1957
1957
  ] }),
1958
- l && /* @__PURE__ */ T(ae, { children: [
1958
+ c && /* @__PURE__ */ T(re, { children: [
1959
1959
  /* @__PURE__ */ r(
1960
1960
  te,
1961
1961
  {
@@ -1975,7 +1975,7 @@ function Js() {
1975
1975
  d(o === "smooth-shape" ? "none" : "smooth-shape"), n && s(!1);
1976
1976
  },
1977
1977
  active: o === "smooth-shape",
1978
- children: /* @__PURE__ */ r(nr, { size: 24 })
1978
+ children: /* @__PURE__ */ r(sr, { size: 24 })
1979
1979
  }
1980
1980
  ),
1981
1981
  /* @__PURE__ */ r(
@@ -1986,59 +1986,59 @@ function Js() {
1986
1986
  d(o === "buffer-shape" ? "none" : "buffer-shape"), n && s(!1);
1987
1987
  },
1988
1988
  active: o === "buffer-shape",
1989
- children: /* @__PURE__ */ r(or, { size: 24 })
1989
+ children: /* @__PURE__ */ r(ir, { size: 24 })
1990
1990
  }
1991
1991
  )
1992
1992
  ] }),
1993
- l && N && /* @__PURE__ */ r(Ne, {}),
1993
+ c && N && /* @__PURE__ */ r(Te, {}),
1994
1994
  E && /* @__PURE__ */ r(
1995
1995
  te,
1996
1996
  {
1997
1997
  label: "Break apart",
1998
- shortcut: /* @__PURE__ */ r(Q, { children: y("break-apart").toUpperCase() }),
1998
+ shortcut: /* @__PURE__ */ r(Q, { children: h("break-apart").toUpperCase() }),
1999
1999
  shortcutId: "break-apart",
2000
2000
  onClick: z,
2001
- children: /* @__PURE__ */ r(sr, { size: 24 })
2001
+ children: /* @__PURE__ */ r(ar, { size: 24 })
2002
2002
  }
2003
2003
  ),
2004
- g && /* @__PURE__ */ r(te, { label: "Merge", onClick: K, children: /* @__PURE__ */ r(ir, { size: 24 }) }),
2005
- (a || l || N) && /* @__PURE__ */ r(Ne, {}),
2004
+ y && /* @__PURE__ */ r(te, { label: "Merge", onClick: K, children: /* @__PURE__ */ r(lr, { size: 24 }) }),
2005
+ (a || c || N) && /* @__PURE__ */ r(Te, {}),
2006
2006
  /* @__PURE__ */ r(
2007
2007
  te,
2008
2008
  {
2009
2009
  label: "Duplicate",
2010
- shortcut: /* @__PURE__ */ T(ae, { children: [
2010
+ shortcut: /* @__PURE__ */ T(re, { children: [
2011
2011
  /* @__PURE__ */ r(Q, { children: "⌘" }),
2012
2012
  /* @__PURE__ */ r(Q, { children: "D" })
2013
2013
  ] }),
2014
2014
  shortcutId: "duplicate",
2015
2015
  onClick: P,
2016
- children: /* @__PURE__ */ r(Xt, { size: 24 })
2016
+ children: /* @__PURE__ */ r(Yt, { size: 24 })
2017
2017
  }
2018
2018
  ),
2019
2019
  /* @__PURE__ */ r(
2020
2020
  te,
2021
2021
  {
2022
2022
  label: "Delete",
2023
- shortcut: /* @__PURE__ */ r(Q, { children: Vt("delete-selected") }),
2023
+ shortcut: /* @__PURE__ */ r(Q, { children: Xt("delete-selected") }),
2024
2024
  shortcutId: "delete-selected",
2025
2025
  onClick: b,
2026
- children: /* @__PURE__ */ r(ze, { size: 24 })
2026
+ children: /* @__PURE__ */ r(Re, { size: 24 })
2027
2027
  }
2028
2028
  )
2029
2029
  ] }),
2030
- i.length >= 2 && /* @__PURE__ */ r(Ut, { fallback: null, children: /* @__PURE__ */ r(Uo, {}) })
2030
+ i.length >= 2 && /* @__PURE__ */ r(qt, { fallback: null, children: /* @__PURE__ */ r(qo, {}) })
2031
2031
  ] });
2032
2032
  }
2033
- const jo = "calc(var(--elm-bottom-stack-offset, calc(var(--elm-table-offset, 0px) + var(--elm-bottom-toolbar-offset, 0px) + 16px)) + 58px)";
2034
- function Xs({ mapContainer: t, count: e, onSimplify: n, onDelete: s }) {
2033
+ const Ho = "calc(var(--elm-bottom-stack-offset, calc(var(--elm-table-offset, 0px) + var(--elm-bottom-toolbar-offset, 0px) + 16px)) + 58px)";
2034
+ function ti({ mapContainer: t, count: e, onSimplify: n, onDelete: s }) {
2035
2035
  const o = t.parentElement;
2036
- return o ? cr(
2036
+ return o ? ur(
2037
2037
  /* @__PURE__ */ r(
2038
2038
  "div",
2039
2039
  {
2040
2040
  className: "absolute left-0 right-0 z-[400] flex justify-center pointer-events-none",
2041
- style: { bottom: jo },
2041
+ style: { bottom: Ho },
2042
2042
  onMouseDown: (d) => d.stopPropagation(),
2043
2043
  onContextMenu: (d) => d.stopPropagation(),
2044
2044
  children: /* @__PURE__ */ T("div", { className: "flex items-center gap-2 bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-2 py-2 pointer-events-auto antialiased", children: [
@@ -2048,64 +2048,64 @@ function Xs({ mapContainer: t, count: e, onSimplify: n, onDelete: s }) {
2048
2048
  e !== 1 ? "s" : "",
2049
2049
  " selected"
2050
2050
  ] }),
2051
- /* @__PURE__ */ r(Ne, {}),
2051
+ /* @__PURE__ */ r(Te, {}),
2052
2052
  /* @__PURE__ */ T(te, { label: "Simplify selected points", onClick: n, disabled: e < 3, children: [
2053
- /* @__PURE__ */ r(Tn, { size: 24 }),
2053
+ /* @__PURE__ */ r(Fn, { size: 24 }),
2054
2054
  /* @__PURE__ */ r("span", { className: "px-1 font-medium", children: "Simplify" })
2055
2055
  ] }),
2056
2056
  /* @__PURE__ */ T(te, { label: "Delete selected points", onClick: s, children: [
2057
- /* @__PURE__ */ r(ze, { size: 24 }),
2057
+ /* @__PURE__ */ r(Re, { size: 24 }),
2058
2058
  /* @__PURE__ */ r("span", { className: "px-1 font-medium", children: "Delete" })
2059
2059
  ] }),
2060
- /* @__PURE__ */ r(Oe, { children: "Del" })
2060
+ /* @__PURE__ */ r(Ee, { children: "Del" })
2061
2061
  ] })
2062
2062
  }
2063
2063
  ),
2064
2064
  o
2065
2065
  ) : null;
2066
2066
  }
2067
- const qo = /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r("polyline", { points: "2.5,8 5.25,3.5 8,8 10.75,12.5 13.5,8" }) }), Ho = [
2068
- { mode: "cut-hole", label: "Cut hole", icon: /* @__PURE__ */ r(tr, { size: 16 }), shortcut: "cut-hole" },
2069
- { mode: "slice-shape", label: "Slice shape", icon: /* @__PURE__ */ r(rr, { size: 16 }), shortcut: "slice-shape" }
2070
- ], Vo = [
2071
- { mode: "simplify-shape", label: "Simplify shape", icon: qo },
2072
- { mode: "smooth-shape", label: "Smooth shape", icon: /* @__PURE__ */ r(nr, { size: 16 }) },
2073
- { mode: "buffer-shape", label: "Buffer", icon: /* @__PURE__ */ r(or, { size: 16 }) }
2067
+ const Vo = /* @__PURE__ */ r("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ r("polyline", { points: "2.5,8 5.25,3.5 8,8 10.75,12.5 13.5,8" }) }), Jo = [
2068
+ { mode: "cut-hole", label: "Cut hole", icon: /* @__PURE__ */ r(nr, { size: 16 }), shortcut: "cut-hole" },
2069
+ { mode: "slice-shape", label: "Slice shape", icon: /* @__PURE__ */ r(or, { size: 16 }), shortcut: "slice-shape" }
2070
+ ], Xo = [
2071
+ { mode: "simplify-shape", label: "Simplify shape", icon: Vo },
2072
+ { mode: "smooth-shape", label: "Smooth shape", icon: /* @__PURE__ */ r(sr, { size: 16 }) },
2073
+ { mode: "buffer-shape", label: "Buffer", icon: /* @__PURE__ */ r(ir, { size: 16 }) }
2074
2074
  ];
2075
- function Zs({ x: t, y: e, data: n, onClose: s }) {
2076
- const { feature: o, requestPreciseCoords: d } = n, { dataStore: i } = oe(), m = S((P) => P.readonly), c = S((P) => P.transformActive), y = S((P) => P.setTransformActive), f = S((P) => P.editingMode), h = S((P) => P.setEditingMode), u = S((P) => P.closeDialog), x = U((P) => P.selectedIds), w = le(), { getKey: M } = Ee();
2075
+ function ri({ x: t, y: e, data: n, onClose: s }) {
2076
+ const { feature: o, requestPreciseCoords: d } = n, { dataStore: i } = se(), m = S((P) => P.readonly), l = S((P) => P.transformActive), h = S((P) => P.setTransformActive), f = S((P) => P.editingMode), g = S((P) => P.setEditingMode), u = S((P) => P.closeDialog), x = U((P) => P.selectedIds), w = le(), { getKey: M } = Pe();
2077
2077
  if (m) return null;
2078
- const C = o.geometry.type, a = C === "Polygon" || C === "MultiPolygon", p = C === "MultiPoint" || C === "MultiPolygon" || C === "MultiLineString" || C === "GeometryCollection", l = x.length >= 2 && x.includes(o.id);
2078
+ const C = o.geometry.type, a = C === "Polygon" || C === "MultiPolygon", p = C === "MultiPoint" || C === "MultiPolygon" || C === "MultiLineString" || C === "GeometryCollection", c = x.length >= 2 && x.includes(o.id);
2079
2079
  function E(P) {
2080
- h(f === P ? "none" : P), c && y(!1);
2080
+ g(f === P ? "none" : P), l && h(!1);
2081
2081
  }
2082
- function g(P) {
2082
+ function y(P) {
2083
2083
  return /* @__PURE__ */ r(Q, { children: M(P).toUpperCase() });
2084
2084
  }
2085
2085
  const N = [];
2086
2086
  if (N.push({
2087
2087
  label: "Transform",
2088
- icon: /* @__PURE__ */ r(er, { size: 16 }),
2089
- shortcut: g("toggle-transform"),
2088
+ icon: /* @__PURE__ */ r(rr, { size: 16 }),
2089
+ shortcut: y("toggle-transform"),
2090
2090
  onClick: () => {
2091
- y(!c), !c && f !== "none" && h("none");
2091
+ h(!l), !l && f !== "none" && g("none");
2092
2092
  }
2093
- }), Fe(C)) {
2093
+ }), Le(C)) {
2094
2094
  N.push({ separator: !0 });
2095
- for (const P of [...a ? Ho : [], ...Vo])
2095
+ for (const P of [...a ? Jo : [], ...Xo])
2096
2096
  N.push({
2097
2097
  label: P.label,
2098
2098
  icon: P.icon,
2099
- shortcut: P.shortcut ? g(P.shortcut) : void 0,
2099
+ shortcut: P.shortcut ? y(P.shortcut) : void 0,
2100
2100
  onClick: () => E(P.mode)
2101
2101
  });
2102
2102
  }
2103
2103
  return a && N.push({
2104
2104
  label: "Center point",
2105
- icon: /* @__PURE__ */ r(An, { size: 16, weight: "fill" }),
2105
+ icon: /* @__PURE__ */ r(zn, { size: 16, weight: "fill" }),
2106
2106
  onClick: () => {
2107
2107
  var b;
2108
- const P = jn(o), z = typeof ((b = o.properties) == null ? void 0 : b.name) == "string" && o.properties.name ? o.properties.name : null, K = {
2108
+ const P = Hn(o), z = typeof ((b = o.properties) == null ? void 0 : b.name) == "string" && o.properties.name ? o.properties.name : null, K = {
2109
2109
  type: "Feature",
2110
2110
  id: crypto.randomUUID(),
2111
2111
  geometry: { type: "Point", coordinates: P.geometry.coordinates },
@@ -2114,40 +2114,40 @@ function Zs({ x: t, y: e, data: n, onClose: s }) {
2114
2114
  };
2115
2115
  i.getState().addFeature(K);
2116
2116
  }
2117
- }), (p || l) && (N.push({ separator: !0 }), p && N.push({
2117
+ }), (p || c) && (N.push({ separator: !0 }), p && N.push({
2118
2118
  label: "Break apart",
2119
- icon: /* @__PURE__ */ r(sr, { size: 16 }),
2120
- shortcut: g("break-apart"),
2119
+ icon: /* @__PURE__ */ r(ar, { size: 16 }),
2120
+ shortcut: y("break-apart"),
2121
2121
  onClick: () => {
2122
- const P = rt(o.geometry);
2122
+ const P = nt(o.geometry);
2123
2123
  i.getState().breakMultiGeometry(o.id) && w({ type: "feature:broken", featureId: o.id, count: P, undo: () => i.getState().undo() });
2124
2124
  }
2125
- }), l && N.push({
2125
+ }), c && N.push({
2126
2126
  label: `Merge ${x.length} features`,
2127
- icon: /* @__PURE__ */ r(ir, { size: 16 }),
2127
+ icon: /* @__PURE__ */ r(lr, { size: 16 }),
2128
2128
  onClick: () => {
2129
2129
  const P = x.length;
2130
2130
  i.getState().mergeFeatures(), w({ type: "success", message: `Merged ${P} features` });
2131
2131
  }
2132
2132
  })), d && (N.push({ separator: !0 }), N.push({
2133
2133
  label: "Precise coordinates…",
2134
- icon: /* @__PURE__ */ r(Fn, { size: 16 }),
2134
+ icon: /* @__PURE__ */ r(Ln, { size: 16 }),
2135
2135
  onClick: d
2136
2136
  })), N.push({ separator: !0 }), N.push({
2137
- label: l ? `Delete ${x.length} features` : "Delete",
2138
- icon: /* @__PURE__ */ r(ze, { size: 16 }),
2139
- shortcut: /* @__PURE__ */ r(Q, { children: Vt("delete-selected") }),
2137
+ label: c ? `Delete ${x.length} features` : "Delete",
2138
+ icon: /* @__PURE__ */ r(Re, { size: 16 }),
2139
+ shortcut: /* @__PURE__ */ r(Q, { children: Xt("delete-selected") }),
2140
2140
  onClick: () => {
2141
2141
  var K;
2142
- const P = l ? x.length : 1, z = String(((K = o.properties) == null ? void 0 : K.name) || "feature");
2142
+ const P = c ? x.length : 1, z = String(((K = o.properties) == null ? void 0 : K.name) || "feature");
2143
2143
  i.getState().deleteSelection(), u(), w(P === 1 ? { type: "feature:deleted", featureId: o.id, label: z, undo: () => i.getState().undo() } : { type: "features:deleted", count: P, undo: () => i.getState().undo() });
2144
2144
  }
2145
- }), /* @__PURE__ */ r(lr, { x: t, y: e, items: N, onClose: s });
2145
+ }), /* @__PURE__ */ r(dr, { x: t, y: e, items: N, onClose: s });
2146
2146
  }
2147
- function Jo({ size: t, tooltipSide: e }) {
2147
+ function Zo({ size: t, tooltipSide: e }) {
2148
2148
  const n = U((d) => d.undoStack.length > 0), s = U((d) => d.undo), o = le();
2149
2149
  return /* @__PURE__ */ r(
2150
- Pe,
2150
+ De,
2151
2151
  {
2152
2152
  label: "Undo",
2153
2153
  shortcutId: "undo",
@@ -2161,14 +2161,14 @@ function Jo({ size: t, tooltipSide: e }) {
2161
2161
  disabled: !n,
2162
2162
  size: t,
2163
2163
  tooltipSide: e,
2164
- children: /* @__PURE__ */ r(Ln, { size: 24 })
2164
+ children: /* @__PURE__ */ r($n, { size: 24 })
2165
2165
  }
2166
2166
  );
2167
2167
  }
2168
- function Xo({ size: t, tooltipSide: e }) {
2168
+ function Yo({ size: t, tooltipSide: e }) {
2169
2169
  const n = U((d) => d.redoStack.length > 0), s = U((d) => d.redo), o = le();
2170
2170
  return /* @__PURE__ */ r(
2171
- Pe,
2171
+ De,
2172
2172
  {
2173
2173
  label: "Redo",
2174
2174
  shortcutId: "redo",
@@ -2183,62 +2183,102 @@ function Xo({ size: t, tooltipSide: e }) {
2183
2183
  disabled: !n,
2184
2184
  size: t,
2185
2185
  tooltipSide: e,
2186
- children: /* @__PURE__ */ r(zn, { size: 24 })
2186
+ children: /* @__PURE__ */ r(Rn, { size: 24 })
2187
2187
  }
2188
2188
  );
2189
2189
  }
2190
- function Zo({ direction: t = "horizontal", children: e }) {
2190
+ function Qo({ direction: t = "horizontal", children: e }) {
2191
2191
  return /* @__PURE__ */ r("div", { "data-elm-group": "", className: `flex bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm pointer-events-auto antialiased items-center gap-1 px-2 py-1.5 ${t === "vertical" ? "flex-col" : "flex-row"}`, children: e });
2192
2192
  }
2193
- function Ys({ direction: t = "vertical" }) {
2193
+ function ni({ direction: t = "vertical" }) {
2194
2194
  const e = t === "vertical" ? "right" : "top";
2195
- return /* @__PURE__ */ T(Zo, { direction: t, children: [
2196
- /* @__PURE__ */ r(Jo, { size: "group", tooltipSide: e }),
2197
- /* @__PURE__ */ r(Xo, { size: "group", tooltipSide: e })
2195
+ return /* @__PURE__ */ T(Qo, { direction: t, children: [
2196
+ /* @__PURE__ */ r(Zo, { size: "group", tooltipSide: e }),
2197
+ /* @__PURE__ */ r(Yo, { size: "group", tooltipSide: e })
2198
2198
  ] });
2199
2199
  }
2200
- const Wt = "h-8 px-3 rounded-elm-control text-sm flex items-center justify-center gap-1.5 active:scale-[0.95]";
2201
- function Qs() {
2202
- const { ui: t } = ce(), e = S((v) => v.editingMode), n = S((v) => v.lineInProgress), s = S((v) => v.polygonInProgress), o = S((v) => v.routeWaypoints), d = S((v) => v.routeLoading), i = S((v) => v.commitLine), m = S((v) => v.commitPolygon), c = S((v) => v.commitRoute), y = S((v) => v.commitSliceShape), f = S((v) => v.commitCutHole), h = S((v) => v.cancelDrawing), u = S((v) => v.circleCenter), x = S((v) => v.rectCorner), w = S((v) => v.freehandPoints), M = S((v) => v.freehandClosed), C = S((v) => v.setFreehandClosed), a = S((v) => v.measurePoints), p = S((v) => v.measureMode), l = S((v) => v.setMeasureMode), E = e === "draw-line" || e === "slice-shape", g = e === "draw-polygon" || e === "cut-hole", N = e === "draw-route", P = e === "draw-circle", z = e === "draw-rect", K = e === "draw-freehand", b = e === "place-point", k = e === "measure", D = e === "pick-shape";
2203
- if (!(E || g || N || P || z || K || b) && !k && !D) return null;
2200
+ const _t = "h-8 px-3 rounded-elm-control text-sm flex items-center justify-center gap-1.5 active:scale-[0.95]", be = { before: "Undo last", key: "⌫", keyName: "Backspace" }, es = { before: "Hold", key: "Shift", keyName: "Shift", after: "for a square" }, ts = (t) => typeof t == "string" ? t : `${t.before} ${t.keyName} ${t.after ?? ""}`;
2201
+ function rs({ parts: t }) {
2202
+ return /* @__PURE__ */ r(
2203
+ "ul",
2204
+ {
2205
+ "data-elm-hint": !0,
2206
+ "aria-label": "Drawing hints",
2207
+ className: "flex flex-wrap items-center justify-center gap-x-4 gap-y-1 min-w-0 px-2 m-0 list-none text-sm text-elm-text-muted",
2208
+ children: t.map((e) => /* @__PURE__ */ r("li", { className: "inline-flex items-center gap-1.5 whitespace-nowrap", children: typeof e == "string" ? e : /* @__PURE__ */ T(re, { children: [
2209
+ e.before,
2210
+ e.key === e.keyName ? /* @__PURE__ */ r(Ee, { children: e.key }) : /* @__PURE__ */ T(re, { children: [
2211
+ /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "inline-flex", children: /* @__PURE__ */ r(Ee, { children: e.key }) }),
2212
+ /* @__PURE__ */ r("span", { className: "sr-only", children: e.keyName })
2213
+ ] }),
2214
+ e.after
2215
+ ] }) }, ts(e)))
2216
+ }
2217
+ );
2218
+ }
2219
+ function Gt() {
2220
+ const t = B(null);
2221
+ return fe(() => {
2222
+ const e = t.current, n = e == null ? void 0 : e.parentElement;
2223
+ if (!e || !n) return;
2224
+ const s = (i, m) => {
2225
+ let l = i;
2226
+ for (; l && getComputedStyle(l).display === "contents"; ) l = m === "first" ? l.firstElementChild : l.lastElementChild;
2227
+ const h = (l ?? i).getBoundingClientRect();
2228
+ return h.top + h.height / 2;
2229
+ }, o = () => {
2230
+ e.style.display = "";
2231
+ const i = e.previousElementSibling, m = e.nextElementSibling, l = s(e, "first");
2232
+ (!i || !m || Math.abs(s(i, "last") - l) > 4 || Math.abs(s(m, "first") - l) > 4) && (e.style.display = "none");
2233
+ };
2234
+ o();
2235
+ const d = new ResizeObserver(o);
2236
+ d.observe(n);
2237
+ for (const i of Array.from(n.children)) i !== e && d.observe(i);
2238
+ return () => d.disconnect();
2239
+ }), /* @__PURE__ */ r("span", { ref: t, "aria-hidden": "true", className: "flex", children: /* @__PURE__ */ r(Te, {}) });
2240
+ }
2241
+ function oi() {
2242
+ const { ui: t } = ce(), e = S((v) => v.editingMode), n = S((v) => v.lineInProgress), s = S((v) => v.polygonInProgress), o = S((v) => v.routeWaypoints), d = S((v) => v.routeLoading), i = S((v) => v.commitLine), m = S((v) => v.commitPolygon), l = S((v) => v.commitRoute), h = S((v) => v.commitSliceShape), f = S((v) => v.commitCutHole), g = S((v) => v.cancelDrawing), u = S((v) => v.circleCenter), x = S((v) => v.rectCorner), w = S((v) => v.freehandPoints), M = S((v) => v.freehandClosed), C = S((v) => v.setFreehandClosed), a = S((v) => v.measurePoints), p = S((v) => v.measureMode), c = S((v) => v.setMeasureMode), E = e === "draw-line" || e === "slice-shape", y = e === "draw-polygon" || e === "cut-hole", N = e === "draw-route", P = e === "draw-circle", z = e === "draw-rect", K = e === "draw-freehand", b = e === "place-point", k = e === "measure", D = e === "pick-shape";
2243
+ if (!(E || y || N || P || z || K || b) && !k && !D) return null;
2204
2244
  const O = n.length > 0 || s.length > 0 || !!u || !!x || o.length > 0 || w.length > 0 || a.length > 0;
2205
2245
  function j() {
2206
2246
  if (e === "slice-shape") {
2207
2247
  if (n.length < 2) return;
2208
- y();
2248
+ h();
2209
2249
  } else if (e === "cut-hole") {
2210
2250
  if (s.length < 3) return;
2211
2251
  f();
2212
2252
  } else if (E) {
2213
2253
  if (n.length < 2) return;
2214
2254
  i({});
2215
- } else if (g) {
2255
+ } else if (y) {
2216
2256
  if (s.length < 3) return;
2217
2257
  m({});
2218
2258
  } else if (N) {
2219
2259
  if (o.length < 2) return;
2220
- c();
2260
+ l();
2221
2261
  }
2222
2262
  }
2223
- const Z = E ? n.length >= 2 : g ? s.length >= 3 : N ? o.length >= 2 && !d : !1, L = b ? "Click to place a point" : e === "draw-line" ? n.length === 0 ? "Click to place the first point" : "Click to add points · Double-click to finish · ⌫ undo last" : e === "draw-polygon" ? s.length === 0 ? "Click to place the first point" : s.length < 3 ? "Click to continue · ⌫ undo last" : "Click to add points · Double-click to close · ⌫ undo last" : N ? o.length === 0 ? "Click to place the first waypoint" : "Click to add waypoints · ⌫ undo last" : P ? "Click and drag to size" : z ? "Click and drag to size · Hold Shift for square" : K ? "Click and drag to draw" : e === "slice-shape" ? n.length === 0 ? "Draw a line across the shape to slice it" : "Click to add points · Double-click to cut · ⌫ undo last" : e === "cut-hole" ? s.length === 0 ? "Draw a shape inside to cut a hole" : s.length < 3 ? "Click to continue · ⌫ undo last" : "Click to add points · Double-click to cut · ⌫ undo last" : k ? a.length === 0 ? "Click to start measuring" : "Click to add points · Double-click to finish · ⌫ undo last" : D ? "Click anywhere to import a shape from the map" : null;
2263
+ const Z = E ? n.length >= 2 : y ? s.length >= 3 : N ? o.length >= 2 && !d : !1, L = b ? ["Click to place a point"] : e === "draw-line" ? n.length === 0 ? ["Click to place the first point"] : ["Click to add points", "Double-click to finish", be] : e === "draw-polygon" ? s.length === 0 ? ["Click to place the first point"] : s.length < 3 ? ["Click to continue", be] : ["Click to add points", "Double-click to close", be] : N ? o.length === 0 ? ["Click to place the first waypoint"] : ["Click to add waypoints", be] : P ? ["Click and drag to size"] : z ? ["Click and drag to size", es] : K ? ["Click and drag to draw"] : e === "slice-shape" ? n.length === 0 ? ["Draw a line across the shape to slice it"] : ["Click to add points", "Double-click to cut", be] : e === "cut-hole" ? s.length === 0 ? ["Draw a shape inside to cut a hole"] : s.length < 3 ? ["Click to continue", be] : ["Click to add points", "Double-click to cut", be] : k ? a.length === 0 ? ["Click to start measuring"] : ["Click to add points", "Double-click to finish", be] : D ? ["Click anywhere to import a shape from the map"] : null;
2224
2264
  return /* @__PURE__ */ T("div", { className: "flex flex-wrap items-center justify-center gap-2 max-w-full bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-2 py-2 pointer-events-auto", children: [
2225
- k && /* @__PURE__ */ T(ae, { children: [
2265
+ k && /* @__PURE__ */ T(re, { children: [
2226
2266
  /* @__PURE__ */ r(
2227
2267
  te,
2228
2268
  {
2229
2269
  active: p === "distance",
2230
- onClick: () => l("distance"),
2270
+ onClick: () => c("distance"),
2231
2271
  label: "Measure distance",
2232
- children: /* @__PURE__ */ r(Rn, { size: 24 })
2272
+ children: /* @__PURE__ */ r(Kn, { size: 24 })
2233
2273
  }
2234
2274
  ),
2235
2275
  /* @__PURE__ */ r(
2236
2276
  te,
2237
2277
  {
2238
2278
  active: p === "area",
2239
- onClick: () => l("area"),
2279
+ onClick: () => c("area"),
2240
2280
  label: "Measure area",
2241
- children: /* @__PURE__ */ r($n, { size: 24 })
2281
+ children: /* @__PURE__ */ r(On, { size: 24 })
2242
2282
  }
2243
2283
  )
2244
2284
  ] }),
@@ -2248,21 +2288,21 @@ function Qs() {
2248
2288
  active: M,
2249
2289
  onClick: () => C(!M),
2250
2290
  label: "Closed shape",
2251
- children: /* @__PURE__ */ r(Kn, { size: 24, weight: M ? "fill" : "regular" })
2291
+ children: /* @__PURE__ */ r(Bn, { size: 24, weight: M ? "fill" : "regular" })
2252
2292
  }
2253
2293
  ),
2254
- (k || e === "draw-freehand") && /* @__PURE__ */ r(Ne, {}),
2255
- t.hints && L && /* @__PURE__ */ r("span", { className: "text-sm text-elm-text-muted px-2", children: L }),
2256
- t.hints && L && /* @__PURE__ */ r(Ne, {}),
2294
+ (k || e === "draw-freehand") && /* @__PURE__ */ r(Gt, {}),
2295
+ t.hints && L && /* @__PURE__ */ r(rs, { parts: L }),
2296
+ t.hints && L && /* @__PURE__ */ r(Gt, {}),
2257
2297
  Z && /* @__PURE__ */ T(
2258
2298
  "button",
2259
2299
  {
2260
2300
  type: "button",
2261
2301
  onClick: j,
2262
- className: `${Wt} shadow-sm bg-primary-500 text-white hover:bg-primary-600`,
2302
+ className: `${_t} shadow-sm bg-primary-500 text-white hover:bg-primary-600`,
2263
2303
  children: [
2264
2304
  N ? "Save route" : e === "slice-shape" ? "Slice" : e === "cut-hole" ? "Cut" : "Finish",
2265
- /* @__PURE__ */ r(Ie, { children: "↵" })
2305
+ /* @__PURE__ */ r(Me, { children: "↵" })
2266
2306
  ]
2267
2307
  }
2268
2308
  ),
@@ -2270,24 +2310,24 @@ function Qs() {
2270
2310
  "button",
2271
2311
  {
2272
2312
  type: "button",
2273
- onClick: h,
2274
- className: `${Wt} text-(--elm-text-muted,var(--color-gray-600)) dark:text-(--elm-text-muted,var(--color-gray-400)) hover:bg-elm-control-hover`,
2313
+ onClick: g,
2314
+ className: `${_t} text-(--elm-text-muted,var(--color-gray-600)) dark:text-(--elm-text-muted,var(--color-gray-400)) hover:bg-elm-control-hover`,
2275
2315
  children: [
2276
2316
  O ? "Cancel" : "Exit",
2277
- /* @__PURE__ */ r(Oe, { children: "Esc" })
2317
+ /* @__PURE__ */ r(Ee, { children: "Esc" })
2278
2318
  ]
2279
2319
  }
2280
2320
  )
2281
2321
  ] });
2282
2322
  }
2283
- function ei({ size: t, tooltipSide: e } = {}) {
2284
- const { fitBounds: n } = Ae(), s = le(), o = U((m) => m.features), d = U((m) => m.selectedIds);
2323
+ function si({ size: t, tooltipSide: e } = {}) {
2324
+ const { fitBounds: n } = ze(), s = le(), o = U((m) => m.features), d = U((m) => m.selectedIds);
2285
2325
  function i() {
2286
2326
  if (!n) return;
2287
2327
  let m = o;
2288
2328
  if (d.length > 0) {
2289
- const c = new Set(d);
2290
- m = o.filter((y) => c.has(y.id));
2329
+ const l = new Set(d);
2330
+ m = o.filter((h) => l.has(h.id));
2291
2331
  }
2292
2332
  if (m.length === 0) {
2293
2333
  s({ type: "warning", message: "No features on the map to zoom to" });
@@ -2296,55 +2336,55 @@ function ei({ size: t, tooltipSide: e } = {}) {
2296
2336
  try {
2297
2337
  if (m.length === 1) {
2298
2338
  const f = m[0];
2299
- n(f.bbox || ot(f.geometry));
2339
+ n(f.bbox || st(f.geometry));
2300
2340
  return;
2301
2341
  }
2302
- const c = qn(m), y = dr(c);
2303
- n(y);
2304
- } catch (c) {
2305
- s({ type: "error", code: "geometry", source: "editor", message: "Failed to calculate map bounds", cause: c });
2342
+ const l = Vn(m), h = mr(l);
2343
+ n(h);
2344
+ } catch (l) {
2345
+ s({ type: "error", code: "geometry", source: "editor", message: "Failed to calculate map bounds", cause: l });
2306
2346
  }
2307
2347
  }
2308
2348
  return /* @__PURE__ */ r(
2309
- Pe,
2349
+ De,
2310
2350
  {
2311
2351
  label: "Fit map to features",
2312
2352
  tooltipContent: d.length > 0 ? "Zoom to selection" : "Zoom to all features",
2313
2353
  onClick: i,
2314
2354
  size: t,
2315
2355
  tooltipSide: e,
2316
- children: /* @__PURE__ */ r(On, { size: 24 })
2356
+ children: /* @__PURE__ */ r(Wn, { size: 24 })
2317
2357
  }
2318
2358
  );
2319
2359
  }
2320
- const Yo = "flex items-center justify-center h-6 min-w-6 px-1.5 rounded-elm-control bg-transparent border border-transparent text-elm-text font-elm-mono text-xs tabular-nums select-none transition-colors focus-visible:ring-2 focus-visible:ring-elm-focus-ring", Qo = "flex items-center justify-center h-8 min-w-8 px-1 rounded-elm-control bg-transparent border border-transparent text-elm-text font-elm-mono text-sm tabular-nums select-none transition-colors", es = "flex items-center justify-center w-12 h-12 bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm-control rounded-elm text-elm-text font-elm-mono text-sm select-none transition-colors";
2321
- function ti({ minZoom: t = 1, maxZoom: e = 22, fractional: n = !1, size: s = "md", tooltipSide: o = "top" }) {
2322
- const d = U((E) => E.currentZoom), { flyTo: i, getCenter: m } = Ae(), c = le(), y = !!i && !!m, f = S((E) => E.zoomEditing), h = S((E) => E.setZoomEditing), [u, x] = q(null), w = B(null), M = B(!1), { getKey: C } = Ee(), a = s === "sm" ? Yo : s === "group" ? Qo : es, p = s !== "md";
2360
+ const ns = "flex items-center justify-center h-6 min-w-6 px-1.5 rounded-elm-control bg-transparent border border-transparent text-elm-text font-elm-mono text-xs tabular-nums select-none transition-colors focus-visible:ring-2 focus-visible:ring-elm-focus-ring", os = "flex items-center justify-center h-8 min-w-8 px-1 rounded-elm-control bg-transparent border border-transparent text-elm-text font-elm-mono text-sm tabular-nums select-none transition-colors", ss = "flex items-center justify-center w-12 h-12 bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm-control rounded-elm text-elm-text font-elm-mono text-sm select-none transition-colors";
2361
+ function ii({ minZoom: t = 1, maxZoom: e = 22, fractional: n = !1, size: s = "md", tooltipSide: o = "top" }) {
2362
+ const d = U((E) => E.currentZoom), { flyTo: i, getCenter: m } = ze(), l = le(), h = !!i && !!m, f = S((E) => E.zoomEditing), g = S((E) => E.setZoomEditing), [u, x] = q(null), w = B(null), M = B(!1), { getKey: C } = Pe(), a = s === "sm" ? ns : s === "group" ? os : ss, p = s !== "md";
2323
2363
  $(() => {
2324
2364
  u !== null && (n ? Math.abs(d - u) < 0.05 : Math.round(d) === Math.round(u)) && x(null);
2325
2365
  }, [d, u, n]);
2326
- function l() {
2366
+ function c() {
2327
2367
  var P;
2328
2368
  const E = (((P = w.current) == null ? void 0 : P.value) ?? "").trim();
2329
2369
  if (E === "") {
2330
- h(!1);
2370
+ g(!1);
2331
2371
  return;
2332
2372
  }
2333
- const g = Number(E);
2334
- if (!Number.isFinite(g)) {
2335
- c({ type: "warning", message: `"${E}" is not a valid zoom level` });
2373
+ const y = Number(E);
2374
+ if (!Number.isFinite(y)) {
2375
+ l({ type: "warning", message: `"${E}" is not a valid zoom level` });
2336
2376
  return;
2337
2377
  }
2338
- if (g < t || g > e) {
2339
- c({ type: "warning", message: `Zoom must be between ${t} and ${e}` });
2378
+ if (y < t || y > e) {
2379
+ l({ type: "warning", message: `Zoom must be between ${t} and ${e}` });
2340
2380
  return;
2341
2381
  }
2342
2382
  if (!i || !m) {
2343
- c({ type: "warning", message: "Map is not ready yet — try again in a moment" });
2383
+ l({ type: "warning", message: "Map is not ready yet — try again in a moment" });
2344
2384
  return;
2345
2385
  }
2346
2386
  const N = m();
2347
- x(g), i([N[1], N[0]], g), h(!1);
2387
+ x(y), i([N[1], N[0]], y), g(!1);
2348
2388
  }
2349
2389
  if (f) {
2350
2390
  const E = n ? (u ?? d).toFixed(1) : String(Math.round(u ?? d));
@@ -2357,44 +2397,44 @@ function ti({ minZoom: t = 1, maxZoom: e = 22, fractional: n = !1, size: s = "md
2357
2397
  pattern: n ? "[0-9.]*" : "[0-9]*",
2358
2398
  autoFocus: !0,
2359
2399
  defaultValue: E,
2360
- onFocus: (g) => {
2361
- const N = g.currentTarget;
2400
+ onFocus: (y) => {
2401
+ const N = y.currentTarget;
2362
2402
  M.current ? N.setSelectionRange(N.value.length, N.value.length) : N.select(), M.current = !1;
2363
2403
  },
2364
- onKeyDown: (g) => {
2365
- g.key === "Enter" ? (g.preventDefault(), l()) : g.key === "Escape" && (g.preventDefault(), h(!1));
2404
+ onKeyDown: (y) => {
2405
+ y.key === "Enter" ? (y.preventDefault(), c()) : y.key === "Escape" && (y.preventDefault(), g(!1));
2366
2406
  },
2367
- onBlur: () => h(!1),
2407
+ onBlur: () => g(!1),
2368
2408
  "aria-label": "Zoom level",
2369
2409
  className: `${a.replace(" select-none", "")} text-center focus:outline-none focus:border-elm-focus-ring${p ? " w-10 !bg-elm-surface" : ""}`
2370
2410
  }
2371
2411
  );
2372
2412
  }
2373
2413
  return /* @__PURE__ */ r(
2374
- be,
2414
+ ve,
2375
2415
  {
2376
- content: y ? "Set zoom level" : "Map zoom level",
2416
+ content: h ? "Set zoom level" : "Map zoom level",
2377
2417
  side: o,
2378
- shortcut: y ? /* @__PURE__ */ r(Q, { children: C("set-zoom").toUpperCase() }) : void 0,
2418
+ shortcut: h ? /* @__PURE__ */ r(Q, { children: C("set-zoom").toUpperCase() }) : void 0,
2379
2419
  children: /* @__PURE__ */ r(
2380
2420
  "button",
2381
2421
  {
2382
2422
  type: "button",
2383
- "aria-label": y ? "Set map zoom level" : "Map zoom level",
2423
+ "aria-label": h ? "Set map zoom level" : "Map zoom level",
2384
2424
  "data-elm-shortcut": "set-zoom",
2385
2425
  onClick: () => {
2386
- y && (M.current = !0, h(!0));
2426
+ h && (M.current = !0, g(!0));
2387
2427
  },
2388
- disabled: !y,
2389
- className: `${a} ${y ? `${p ? "hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,var(--color-gray-800))" : "hover:bg-elm-surface-hover"} focus:outline-none cursor-pointer` : "cursor-default"}`,
2428
+ disabled: !h,
2429
+ className: `${a} ${h ? `${p ? "hover:bg-(--elm-control-hover,color-mix(in_oklab,var(--color-gray-200)_70%,transparent)) dark:hover:bg-(--elm-control-hover,var(--color-gray-800))" : "hover:bg-elm-surface-hover"} focus:outline-none focus-visible:ring-2 focus-visible:ring-elm-focus-ring cursor-pointer` : "cursor-default"}`,
2390
2430
  children: n ? (u ?? d).toFixed(1) : Math.round(u ?? d)
2391
2431
  }
2392
2432
  )
2393
2433
  }
2394
2434
  );
2395
2435
  }
2396
- function ri({ zoom: t = 15, size: e, tooltipSide: n }) {
2397
- const { flyTo: s } = Ae(), o = le(), [d, i] = q(!1);
2436
+ function ai({ zoom: t = 15, size: e, tooltipSide: n }) {
2437
+ const { flyTo: s } = ze(), o = le(), [d, i] = q(!1);
2398
2438
  function m() {
2399
2439
  if (!navigator.geolocation) {
2400
2440
  o({ type: "error", code: "unsupported", source: "locate", message: "Geolocation is not supported by this browser" });
@@ -2405,16 +2445,16 @@ function ri({ zoom: t = 15, size: e, tooltipSide: n }) {
2405
2445
  return;
2406
2446
  }
2407
2447
  d || (i(!0), navigator.geolocation.getCurrentPosition(
2408
- (c) => {
2409
- i(!1), s([c.coords.latitude, c.coords.longitude], t);
2448
+ (l) => {
2449
+ i(!1), s([l.coords.latitude, l.coords.longitude], t);
2410
2450
  },
2411
- (c) => {
2451
+ (l) => {
2412
2452
  i(!1), o({
2413
2453
  type: "error",
2414
- code: c.code === c.PERMISSION_DENIED ? "permission-denied" : c.code === c.TIMEOUT ? "timeout" : "unknown",
2454
+ code: l.code === l.PERMISSION_DENIED ? "permission-denied" : l.code === l.TIMEOUT ? "timeout" : "unknown",
2415
2455
  source: "locate",
2416
- cause: c,
2417
- message: c.code === c.PERMISSION_DENIED ? "Location access denied" : "Could not determine your location"
2456
+ cause: l,
2457
+ message: l.code === l.PERMISSION_DENIED ? "Location access denied" : "Could not determine your location"
2418
2458
  });
2419
2459
  },
2420
2460
  { timeout: 1e4 }
@@ -2423,56 +2463,56 @@ function ri({ zoom: t = 15, size: e, tooltipSide: n }) {
2423
2463
  return (
2424
2464
  // Not `disabled` while locating: that fades the whole button (disabled
2425
2465
  // opacity). A repeat click is ignored in handleLocate instead.
2426
- /* @__PURE__ */ r(Pe, { label: d ? "Locating…" : "Show my location", onClick: m, size: e, tooltipSide: n, children: d ? /* @__PURE__ */ r("div", { className: `${e === "sm" ? "w-3.5 h-3.5" : "w-5 h-5"} border-2 border-current/25 border-t-current rounded-full animate-spin`, "aria-hidden": !0 }) : /* @__PURE__ */ r(Bn, { size: 24 }) })
2466
+ /* @__PURE__ */ r(De, { label: d ? "Locating…" : "Show my location", onClick: m, size: e, tooltipSide: n, children: d ? /* @__PURE__ */ r("div", { className: `${e === "sm" ? "w-3.5 h-3.5" : "w-5 h-5"} border-2 border-current/25 border-t-current rounded-full animate-spin`, "aria-hidden": !0 }) : /* @__PURE__ */ r(_n, { size: 24 }) })
2427
2467
  );
2428
2468
  }
2429
- function ni() {
2469
+ function li() {
2430
2470
  return S((e) => e.readonly) ? /* @__PURE__ */ T("div", { className: "flex items-center gap-2 px-4 py-2 bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm text-sm text-(--elm-text-secondary,var(--color-gray-600)) dark:text-(--elm-text-secondary,var(--color-gray-300)) pointer-events-auto antialiased select-none", children: [
2431
- /* @__PURE__ */ r(st, { size: 20, weight: "duotone", className: "text-elm-text-muted" }),
2471
+ /* @__PURE__ */ r(it, { size: 20, weight: "duotone", className: "text-elm-text-muted" }),
2432
2472
  /* @__PURE__ */ r("span", { children: "View-only mode" })
2433
2473
  ] }) : null;
2434
2474
  }
2435
- const ts = 3e4;
2436
- let ie = null;
2437
- const Te = /* @__PURE__ */ new Map();
2438
- function lt(t, e) {
2439
- ie == null || ie.terminate(), ie = null;
2440
- const n = [...Te.values()];
2441
- Te.clear();
2475
+ const is = 3e4;
2476
+ let ae = null;
2477
+ const Fe = /* @__PURE__ */ new Map();
2478
+ function ct(t, e) {
2479
+ ae == null || ae.terminate(), ae = null;
2480
+ const n = [...Fe.values()];
2481
+ Fe.clear();
2442
2482
  for (const s of n)
2443
- clearTimeout(s.timer), s.reject(new Be(e, "geometry", t));
2483
+ clearTimeout(s.timer), s.reject(new We(e, "geometry", t));
2444
2484
  }
2445
- async function rs() {
2446
- if (ie) return ie;
2485
+ async function as() {
2486
+ if (ae) return ae;
2447
2487
  const { default: t } = await import("./geometryWorker-DgQCFSmD.js");
2448
- return ie || (ie = new t(), ie.onmessage = (e) => {
2449
- const { id: n, ok: s, result: o, error: d } = e.data, i = Te.get(n);
2488
+ return ae || (ae = new t(), ae.onmessage = (e) => {
2489
+ const { id: n, ok: s, result: o, error: d } = e.data, i = Fe.get(n);
2450
2490
  if (i) {
2451
- if (Te.delete(n), clearTimeout(i.timer), s && (o != null && o.geometry)) {
2491
+ if (Fe.delete(n), clearTimeout(i.timer), s && (o != null && o.geometry)) {
2452
2492
  i.resolve(o.geometry);
2453
2493
  return;
2454
2494
  }
2455
- i.reject(new Be("geometry", "geometry", (d == null ? void 0 : d.message) || "Geometry operation failed"));
2495
+ i.reject(new We("geometry", "geometry", (d == null ? void 0 : d.message) || "Geometry operation failed"));
2456
2496
  }
2457
- }, ie.onerror = () => lt("Geometry worker failed", "geometry"), ie);
2497
+ }, ae.onerror = () => ct("Geometry worker failed", "geometry"), ae);
2458
2498
  }
2459
- function Cr(t, { timeoutMs: e = ts } = {}) {
2460
- return rs().then((n) => new Promise((s, o) => {
2499
+ function Er(t, { timeoutMs: e = is } = {}) {
2500
+ return as().then((n) => new Promise((s, o) => {
2461
2501
  const d = crypto.randomUUID(), i = setTimeout(() => {
2462
- lt(`Geometry operation timed out after ${e} ms`, "timeout");
2502
+ ct(`Geometry operation timed out after ${e} ms`, "timeout");
2463
2503
  }, e);
2464
- Te.set(d, { resolve: s, reject: o, timer: i });
2504
+ Fe.set(d, { resolve: s, reject: o, timer: i });
2465
2505
  const m = { id: d, payload: t };
2466
2506
  n.postMessage(m);
2467
2507
  }));
2468
2508
  }
2469
- typeof Worker < "u" && nn(Cr);
2470
- function oi() {
2471
- lt("Geometry worker disposed", "unknown");
2509
+ typeof Worker < "u" && sn(Er);
2510
+ function ci() {
2511
+ ct("Geometry worker disposed", "unknown");
2472
2512
  }
2473
- function ct(t, e) {
2513
+ function dt(t, e) {
2474
2514
  var m;
2475
- const n = (m = tt(Wr)) == null ? void 0 : m.emit, s = B(n);
2515
+ const n = (m = rt(Gr)) == null ? void 0 : m.emit, s = B(n);
2476
2516
  s.current = n;
2477
2517
  const o = B({
2478
2518
  seq: 0,
@@ -2483,21 +2523,21 @@ function ct(t, e) {
2483
2523
  onSettled: null,
2484
2524
  alive: !0
2485
2525
  }).current, d = J(() => {
2486
- const c = o.onSettled;
2487
- o.onSettled = null, c == null || c();
2488
- }, [o]), i = J((c) => {
2489
- const y = ++o.seq, f = o.epoch;
2490
- o.busy = !0, Cr(c).then((h) => h, (h) => {
2526
+ const l = o.onSettled;
2527
+ o.onSettled = null, l == null || l();
2528
+ }, [o]), i = J((l) => {
2529
+ const h = ++o.seq, f = o.epoch;
2530
+ o.busy = !0, Er(l).then((g) => g, (g) => {
2491
2531
  var u;
2492
2532
  return o.alive && f === o.epoch && ((u = s.current) == null || u.call(s, {
2493
2533
  type: "error",
2494
- code: h instanceof Be ? h.code : "geometry",
2534
+ code: g instanceof We ? g.code : "geometry",
2495
2535
  source: "geometry",
2496
- message: `The ${c.type} preview failed: ${h instanceof Error ? h.message : String(h)}`,
2497
- cause: h,
2536
+ message: `The ${l.type} preview failed: ${g instanceof Error ? g.message : String(g)}`,
2537
+ cause: g,
2498
2538
  quiet: !0
2499
2539
  })), null;
2500
- }).then((h) => {
2540
+ }).then((g) => {
2501
2541
  if (o.busy = !1, !o.alive || f !== o.epoch) {
2502
2542
  if (o.queued) {
2503
2543
  const w = o.queued;
@@ -2507,8 +2547,8 @@ function ct(t, e) {
2507
2547
  }
2508
2548
  const u = o.queued;
2509
2549
  o.queued = null;
2510
- const x = y === o.seq;
2511
- (x || u && u.geometry === c.geometry) && (o.owned = !0, e(h)), u ? i(u) : x && d();
2550
+ const x = h === o.seq;
2551
+ (x || u && u.geometry === l.geometry) && (o.owned = !0, e(g)), u ? i(u) : x && d();
2512
2552
  });
2513
2553
  }, [o, e, d]);
2514
2554
  return $(() => {
@@ -2523,44 +2563,44 @@ function ct(t, e) {
2523
2563
  i(t);
2524
2564
  }, [t, o, i, e]), $(() => (o.alive = !0, () => {
2525
2565
  o.alive = !1, o.queued = null, o.onSettled = null;
2526
- }), [o]), J((c) => {
2527
- !o.busy && !o.queued ? c() : o.onSettled = c;
2566
+ }), [o]), J((l) => {
2567
+ !o.busy && !o.queued ? l() : o.onSettled = l;
2528
2568
  }, [o]);
2529
2569
  }
2530
- const ns = 111320;
2531
- function os(t, e) {
2532
- const n = t * ns;
2570
+ const ls = 111320;
2571
+ function cs(t, e) {
2572
+ const n = t * ls;
2533
2573
  if (n < 1)
2534
- return `<1${It(1, e).unit}`;
2535
- const s = It(n, e);
2574
+ return `<1${Mt(1, e).unit}`;
2575
+ const s = Mt(n, e);
2536
2576
  return `~${s.value}${s.unit}`;
2537
2577
  }
2538
- function si() {
2539
- const t = S((g) => g.editingMode), e = S((g) => g.simplifyTolerance), n = S((g) => g.setSimplifyTolerance), s = S((g) => g.setGeometryPreview), o = S((g) => g.geometryPreview), d = S((g) => g.commitGeometryProcess), i = S((g) => g.cancelGeometryProcess), { units: m } = ce(), c = { unit: m.length, display: m.display, precision: m.precision }, { dataStore: y } = oe(), f = ke(), h = U((g) => g.selectedIds[0] ?? null), u = U((g) => {
2578
+ function di() {
2579
+ const t = S((y) => y.editingMode), e = S((y) => y.simplifyTolerance), n = S((y) => y.setSimplifyTolerance), s = S((y) => y.setGeometryPreview), o = S((y) => y.geometryPreview), d = S((y) => y.commitGeometryProcess), i = S((y) => y.cancelGeometryProcess), { units: m } = ce(), l = { unit: m.length, display: m.display, precision: m.precision }, { dataStore: h } = se(), f = Se(), g = U((y) => y.selectedIds[0] ?? null), u = U((y) => {
2540
2580
  var N;
2541
- return h ? ((N = g.features.find((P) => P.id === h)) == null ? void 0 : N.geometry) ?? null : null;
2542
- }), x = U((g) => {
2581
+ return g ? ((N = y.features.find((P) => P.id === g)) == null ? void 0 : N.geometry) ?? null : null;
2582
+ }), x = U((y) => {
2543
2583
  var N;
2544
- return h ? ((N = g.features.find((P) => P.id === h)) == null ? void 0 : N._drawType) ?? null : null;
2584
+ return g ? ((N = y.features.find((P) => P.id === g)) == null ? void 0 : N._drawType) ?? null : null;
2545
2585
  }), w = ue(() => {
2546
2586
  if (!u || t !== "simplify-shape") return 0;
2547
2587
  try {
2548
- const g = dr({ type: "Feature", geometry: u, properties: {} }), N = Math.sqrt((g[2] - g[0]) ** 2 + (g[3] - g[1]) ** 2);
2588
+ const y = mr({ type: "Feature", geometry: u, properties: {} }), N = Math.sqrt((y[2] - y[0]) ** 2 + (y[3] - y[1]) ** 2);
2549
2589
  return (e / 100) ** 2 * N * 0.3;
2550
2590
  } catch {
2551
2591
  return 0;
2552
2592
  }
2553
- }, [e, u, t]), M = t === "simplify-shape", C = ue(() => !M || !u || !Fe(u.type) ? null : { type: "simplify", geometry: u, tolerance: w }, [M, u, w]), a = ct(C, s);
2593
+ }, [e, u, t]), M = t === "simplify-shape", C = ue(() => !M || !u || !Le(u.type) ? null : { type: "simplify", geometry: u, tolerance: w }, [M, u, w]), a = dt(C, s);
2554
2594
  $(() => () => {
2555
- y.getState(), s(null);
2556
- }, [s, y]);
2557
- const p = u ? Ke(u) : 0, l = o ? Ke(o) : p, E = p - l;
2595
+ h.getState(), s(null);
2596
+ }, [s, h]);
2597
+ const p = u ? Be(u) : 0, c = o ? Be(o) : p, E = p - c;
2558
2598
  return $(() => {
2559
2599
  if (t !== "simplify-shape") return;
2560
- function g(N) {
2600
+ function y(N) {
2561
2601
  f(N) && (N.key === "Enter" && o && E > 0 ? (N.preventDefault(), a(d)) : N.key === "Escape" && (N.preventDefault(), i()));
2562
2602
  }
2563
- return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
2603
+ return window.addEventListener("keydown", y), () => window.removeEventListener("keydown", y);
2564
2604
  }, [t, o, E, d, i, a, f]), t !== "simplify-shape" ? null : /* @__PURE__ */ T("div", { className: "flex flex-wrap items-center justify-center gap-3 max-w-full bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-3 py-1.5 pointer-events-auto", children: [
2565
2605
  /* @__PURE__ */ r("span", { className: "text-sm font-medium text-elm-text-secondary shrink-0", children: "Simplify" }),
2566
2606
  /* @__PURE__ */ T("div", { className: "flex items-center gap-2", children: [
@@ -2571,16 +2611,16 @@ function si() {
2571
2611
  min: 0,
2572
2612
  max: 100,
2573
2613
  value: e,
2574
- onChange: (g) => n(Number(g.target.value)),
2614
+ onChange: (y) => n(Number(y.target.value)),
2575
2615
  className: "w-32 accent-primary-600"
2576
2616
  }
2577
2617
  ),
2578
- /* @__PURE__ */ r("span", { className: "text-sm text-elm-text-muted w-16 shrink-0", children: os(w, c) })
2618
+ /* @__PURE__ */ r("span", { className: "text-sm text-elm-text-muted w-16 shrink-0", children: cs(w, l) })
2579
2619
  ] }),
2580
2620
  /* @__PURE__ */ T("div", { className: "flex items-center gap-1 text-sm text-elm-text-muted shrink-0", children: [
2581
2621
  /* @__PURE__ */ r("span", { className: "font-elm-mono", children: p }),
2582
2622
  /* @__PURE__ */ r("span", { children: "→" }),
2583
- /* @__PURE__ */ r("span", { className: `font-elm-mono font-medium ${E > 0 ? "text-primary-600 dark:text-primary-400" : "text-(--elm-text-secondary,var(--color-gray-600)) dark:text-(--elm-text-secondary,var(--color-gray-300))"}`, children: l }),
2623
+ /* @__PURE__ */ r("span", { className: `font-elm-mono font-medium ${E > 0 ? "text-primary-600 dark:text-primary-400" : "text-(--elm-text-secondary,var(--color-gray-600)) dark:text-(--elm-text-secondary,var(--color-gray-300))"}`, children: c }),
2584
2624
  E > 0 && /* @__PURE__ */ T("span", { className: "text-xs text-primary-500", children: [
2585
2625
  "(−",
2586
2626
  E,
@@ -2590,30 +2630,30 @@ function si() {
2590
2630
  ] }),
2591
2631
  x && /* @__PURE__ */ r("span", { className: "text-xs text-amber-600 dark:text-amber-400 shrink-0", children: x === "route" ? "Turns this route into a plain line." : `Turns this ${x} into a plain shape.` }),
2592
2632
  /* @__PURE__ */ T("div", { className: "flex items-center gap-1 shrink-0", children: [
2593
- /* @__PURE__ */ r(we, { variant: "ghost", onClick: i, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2594
- /* @__PURE__ */ r(we, { variant: "primary", onClick: () => a(d), disabled: !o || E === 0, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2633
+ /* @__PURE__ */ r(ke, { variant: "ghost", onClick: i, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2634
+ /* @__PURE__ */ r(ke, { variant: "primary", onClick: () => a(d), disabled: !o || E === 0, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2595
2635
  ] })
2596
2636
  ] });
2597
2637
  }
2598
- function ii() {
2599
- const t = S((p) => p.editingMode), e = S((p) => p.smoothIterations), n = S((p) => p.setSmoothIterations), s = S((p) => p.setGeometryPreview), o = S((p) => p.geometryPreview), d = S((p) => p.commitGeometryProcess), i = S((p) => p.cancelGeometryProcess), { dataStore: m } = oe(), c = ke(), y = U((p) => p.selectedIds[0] ?? null), f = U((p) => {
2600
- var l;
2601
- return y ? ((l = p.features.find((E) => E.id === y)) == null ? void 0 : l.geometry) ?? null : null;
2602
- }), h = U((p) => {
2603
- var l;
2604
- return y ? ((l = p.features.find((E) => E.id === y)) == null ? void 0 : l._drawType) ?? null : null;
2605
- }), u = t === "smooth-shape", x = ue(() => !u || !f || !Fe(f.type) ? null : { type: "smooth", geometry: f, iterations: e }, [u, f, e]), w = ct(x, s);
2638
+ function ui() {
2639
+ const t = S((p) => p.editingMode), e = S((p) => p.smoothIterations), n = S((p) => p.setSmoothIterations), s = S((p) => p.setGeometryPreview), o = S((p) => p.geometryPreview), d = S((p) => p.commitGeometryProcess), i = S((p) => p.cancelGeometryProcess), { dataStore: m } = se(), l = Se(), h = U((p) => p.selectedIds[0] ?? null), f = U((p) => {
2640
+ var c;
2641
+ return h ? ((c = p.features.find((E) => E.id === h)) == null ? void 0 : c.geometry) ?? null : null;
2642
+ }), g = U((p) => {
2643
+ var c;
2644
+ return h ? ((c = p.features.find((E) => E.id === h)) == null ? void 0 : c._drawType) ?? null : null;
2645
+ }), u = t === "smooth-shape", x = ue(() => !u || !f || !Le(f.type) ? null : { type: "smooth", geometry: f, iterations: e }, [u, f, e]), w = dt(x, s);
2606
2646
  $(() => () => {
2607
2647
  m.getState(), s(null);
2608
2648
  }, [s, m]);
2609
- const M = f ? Ke(f) : 0, C = o ? Ke(o) : M, a = C - M;
2649
+ const M = f ? Be(f) : 0, C = o ? Be(o) : M, a = C - M;
2610
2650
  return $(() => {
2611
2651
  if (t !== "smooth-shape") return;
2612
- function p(l) {
2613
- c(l) && (l.key === "Enter" && o ? (l.preventDefault(), w(d)) : l.key === "Escape" && (l.preventDefault(), i()));
2652
+ function p(c) {
2653
+ l(c) && (c.key === "Enter" && o ? (c.preventDefault(), w(d)) : c.key === "Escape" && (c.preventDefault(), i()));
2614
2654
  }
2615
2655
  return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
2616
- }, [t, o, d, i, w, c]), t !== "smooth-shape" ? null : /* @__PURE__ */ T("div", { className: "flex flex-wrap items-center justify-center gap-3 max-w-full bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-3 py-1.5 pointer-events-auto", children: [
2656
+ }, [t, o, d, i, w, l]), t !== "smooth-shape" ? null : /* @__PURE__ */ T("div", { className: "flex flex-wrap items-center justify-center gap-3 max-w-full bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm px-3 py-1.5 pointer-events-auto", children: [
2617
2657
  /* @__PURE__ */ r("span", { className: "text-sm font-medium text-elm-text-secondary shrink-0", children: "Smooth" }),
2618
2658
  /* @__PURE__ */ T("div", { className: "flex items-center gap-2", children: [
2619
2659
  /* @__PURE__ */ r(
@@ -2645,40 +2685,40 @@ function ii() {
2645
2685
  ] }),
2646
2686
  /* @__PURE__ */ r("span", { className: "ml-0.5", children: "points" })
2647
2687
  ] }),
2648
- h && /* @__PURE__ */ r("span", { className: "text-xs text-amber-600 dark:text-amber-400 shrink-0", children: h === "route" ? "Turns this route into a plain line." : `Turns this ${h} into a plain shape.` }),
2688
+ g && /* @__PURE__ */ r("span", { className: "text-xs text-amber-600 dark:text-amber-400 shrink-0", children: g === "route" ? "Turns this route into a plain line." : `Turns this ${g} into a plain shape.` }),
2649
2689
  /* @__PURE__ */ T("div", { className: "flex items-center gap-1 shrink-0", children: [
2650
- /* @__PURE__ */ r(we, { variant: "ghost", onClick: i, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2651
- /* @__PURE__ */ r(we, { variant: "primary", onClick: () => w(d), disabled: !o, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2690
+ /* @__PURE__ */ r(ke, { variant: "ghost", onClick: i, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2691
+ /* @__PURE__ */ r(ke, { variant: "primary", onClick: () => w(d), disabled: !o, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2652
2692
  ] })
2653
2693
  ] });
2654
2694
  }
2655
- const dt = 0.3048, ss = 5280, Nr = dt * ss;
2656
- function is(t, e) {
2695
+ const ut = 0.3048, ds = 5280, Pr = ut * ds;
2696
+ function us(t, e) {
2657
2697
  switch (e) {
2658
2698
  case "m":
2659
2699
  return t;
2660
2700
  case "km":
2661
2701
  return t * 1e3;
2662
2702
  case "ft":
2663
- return t * dt;
2703
+ return t * ut;
2664
2704
  case "mi":
2665
- return t * Nr;
2705
+ return t * Pr;
2666
2706
  }
2667
2707
  }
2668
- function as(t, e) {
2708
+ function ms(t, e) {
2669
2709
  switch (e) {
2670
2710
  case "m":
2671
2711
  return t;
2672
2712
  case "km":
2673
2713
  return t / 1e3;
2674
2714
  case "ft":
2675
- return t / dt;
2715
+ return t / ut;
2676
2716
  case "mi":
2677
- return t / Nr;
2717
+ return t / Pr;
2678
2718
  }
2679
2719
  }
2680
- function ai() {
2681
- const { dataStore: t } = oe(), e = ke(), n = S((D) => D.editingMode), s = S((D) => D.bufferDistance), o = S((D) => D.setBufferDistance), d = S((D) => D.bufferCreateNew), i = S((D) => D.setBufferCreateNew), m = S((D) => D.setGeometryPreview), c = S((D) => D.geometryPreview), y = S((D) => D.commitBufferProcess), f = S((D) => D.cancelBufferProcess), { units: h } = ce(), u = on(h.length), x = ue(
2720
+ function mi() {
2721
+ const { dataStore: t } = se(), e = Se(), n = S((D) => D.editingMode), s = S((D) => D.bufferDistance), o = S((D) => D.setBufferDistance), d = S((D) => D.bufferCreateNew), i = S((D) => D.setBufferCreateNew), m = S((D) => D.setGeometryPreview), l = S((D) => D.geometryPreview), h = S((D) => D.commitBufferProcess), f = S((D) => D.cancelBufferProcess), { units: g } = ce(), u = an(g.length), x = ue(
2682
2722
  () => u === "imperial" ? ["ft", "mi"] : ["m", "km"],
2683
2723
  [u]
2684
2724
  ), [w, M] = q(!1), C = w ? x[1] : x[0], [a, p] = q(null);
@@ -2691,25 +2731,25 @@ function ai() {
2691
2731
  const D = t.getState().selectedIds[0] ?? null;
2692
2732
  if (!D) return;
2693
2733
  const R = ((O = t.getState().features.find((j) => j.id === D)) == null ? void 0 : O.geometry) ?? null;
2694
- R && Fe(R.type) && p(R);
2734
+ R && Le(R.type) && p(R);
2695
2735
  }, [n, t]);
2696
- const l = sn(a == null ? void 0 : a.type), E = ue(
2697
- () => a && !(l && s <= 0) ? { type: "buffer", geometry: a, distance: s } : null,
2698
- [a, s, l]
2699
- ), g = ct(E, m);
2736
+ const c = ln(a == null ? void 0 : a.type), E = ue(
2737
+ () => a && !(c && s <= 0) ? { type: "buffer", geometry: a, distance: s } : null,
2738
+ [a, s, c]
2739
+ ), y = dt(E, m);
2700
2740
  $(() => () => {
2701
2741
  m(null);
2702
2742
  }, [m]), $(() => {
2703
2743
  if (n !== "buffer-shape") return;
2704
2744
  function D(R) {
2705
- e(R) && (R.key === "Enter" && c ? (R.preventDefault(), g(y)) : R.key === "Escape" && (R.preventDefault(), f()));
2745
+ e(R) && (R.key === "Enter" && l ? (R.preventDefault(), y(h)) : R.key === "Escape" && (R.preventDefault(), f()));
2706
2746
  }
2707
2747
  return window.addEventListener("keydown", D), () => window.removeEventListener("keydown", D);
2708
- }, [n, c, y, f, g, e]);
2709
- const N = C === "km" || C === "mi", P = as(s, C), z = N ? Number(P.toFixed(2)) : Math.round(P), K = N ? 0.1 : 1;
2748
+ }, [n, l, h, f, y, e]);
2749
+ const N = C === "km" || C === "mi", P = ms(s, C), z = N ? Number(P.toFixed(2)) : Math.round(P), K = N ? 0.1 : 1;
2710
2750
  function b(D) {
2711
2751
  const R = parseFloat(D);
2712
- isNaN(R) || o(Math.round(is(R, C)));
2752
+ isNaN(R) || o(Math.round(us(R, C)));
2713
2753
  }
2714
2754
  function k() {
2715
2755
  M((D) => !D);
@@ -2721,7 +2761,7 @@ function ai() {
2721
2761
  "input",
2722
2762
  {
2723
2763
  type: "range",
2724
- min: l ? 0 : -500,
2764
+ min: c ? 0 : -500,
2725
2765
  max: 2e3,
2726
2766
  step: 1,
2727
2767
  value: s,
@@ -2769,50 +2809,50 @@ function ai() {
2769
2809
  )
2770
2810
  ] }),
2771
2811
  /* @__PURE__ */ T("div", { className: "flex items-center gap-1 shrink-0", children: [
2772
- /* @__PURE__ */ r(we, { variant: "ghost", onClick: f, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2773
- /* @__PURE__ */ r(we, { variant: "primary", onClick: () => g(y), disabled: !c, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2812
+ /* @__PURE__ */ r(ke, { variant: "ghost", onClick: f, className: "rounded-elm-control h-8 px-3 text-sm", children: "Cancel" }),
2813
+ /* @__PURE__ */ r(ke, { variant: "primary", onClick: () => y(h), disabled: !l, className: "rounded-elm-control h-8 px-3 text-sm", children: "Apply" })
2774
2814
  ] })
2775
2815
  ] });
2776
2816
  }
2777
- const ls = 8, cs = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -3, ArrowDown: 3 };
2778
- function li({ options: t, value: e, onChange: n, label: s = "Basemap", size: o, tooltipSide: d }) {
2779
- const [i, m] = q(!1), [c, y] = q(null), [f, h] = q(!1), u = B(null), x = B(null), w = Kr(), M = qr(), C = c !== null;
2780
- pe(() => {
2817
+ const fs = 8, ps = { ArrowLeft: -1, ArrowRight: 1, ArrowUp: -3, ArrowDown: 3 };
2818
+ function fi({ options: t, value: e, onChange: n, label: s = "Basemap", size: o, tooltipSide: d }) {
2819
+ const [i, m] = q(!1), [l, h] = q(null), [f, g] = q(!1), u = B(null), x = B(null), w = Br(), M = Vr(), C = l !== null;
2820
+ fe(() => {
2781
2821
  var K, b;
2782
- const l = (b = (K = u.current) == null ? void 0 : K.querySelector("button")) == null ? void 0 : b.getBoundingClientRect(), E = x.current;
2783
- if (!i || !l || !E) return;
2784
- const { width: g, height: N } = E.getBoundingClientRect(), P = l.top + l.height / 2 > window.innerHeight / 2, z = l.left + l.width / 2 > window.innerWidth / 2;
2785
- y(an(z ? l.right : l.left, P ? l.top : l.bottom, g, N, {
2822
+ const c = (b = (K = u.current) == null ? void 0 : K.querySelector("button")) == null ? void 0 : b.getBoundingClientRect(), E = x.current;
2823
+ if (!i || !c || !E) return;
2824
+ const { width: y, height: N } = E.getBoundingClientRect(), P = c.top + c.height / 2 > window.innerHeight / 2, z = c.left + c.width / 2 > window.innerWidth / 2;
2825
+ h(cn(z ? c.right : c.left, P ? c.top : c.bottom, y, N, {
2786
2826
  x: z ? "before" : "after",
2787
2827
  y: P ? "before" : "after",
2788
- gapY: ls
2828
+ gapY: fs
2789
2829
  }));
2790
2830
  }, [i, t.length]), $(() => {
2791
2831
  var E;
2792
2832
  if (!i || !C) return;
2793
- const l = x.current;
2794
- (E = (l == null ? void 0 : l.querySelector('[aria-pressed="true"]')) ?? (l == null ? void 0 : l.querySelector("button"))) == null || E.focus();
2833
+ const c = x.current;
2834
+ (E = (c == null ? void 0 : c.querySelector('[aria-pressed="true"]')) ?? (c == null ? void 0 : c.querySelector("button"))) == null || E.focus();
2795
2835
  }, [i, C]), $(() => {
2796
2836
  if (!i) return;
2797
- const l = (E) => {
2798
- var g, N, P;
2799
- E.key === "Escape" && (E.stopImmediatePropagation(), E.preventDefault(), (g = x.current) != null && g.contains(document.activeElement) && ((P = (N = u.current) == null ? void 0 : N.querySelector("button")) == null || P.focus()), m(!1));
2837
+ const c = (E) => {
2838
+ var y, N, P;
2839
+ E.key === "Escape" && (E.stopImmediatePropagation(), E.preventDefault(), (y = x.current) != null && y.contains(document.activeElement) && ((P = (N = u.current) == null ? void 0 : N.querySelector("button")) == null || P.focus()), m(!1));
2800
2840
  };
2801
- return window.addEventListener("keydown", l, { capture: !0 }), () => window.removeEventListener("keydown", l, { capture: !0 });
2841
+ return window.addEventListener("keydown", c, { capture: !0 }), () => window.removeEventListener("keydown", c, { capture: !0 });
2802
2842
  }, [i]);
2803
- const a = (l) => {
2804
- const E = cs[l.key];
2843
+ const a = (c) => {
2844
+ const E = ps[c.key];
2805
2845
  if (!E) return;
2806
- const g = Array.from(l.currentTarget.querySelectorAll("button")), N = g[g.indexOf(document.activeElement) + E];
2807
- N && (l.preventDefault(), N.focus());
2846
+ const y = Array.from(c.currentTarget.querySelectorAll("button")), N = y[y.indexOf(document.activeElement) + E];
2847
+ N && (c.preventDefault(), N.focus());
2808
2848
  };
2809
2849
  return /* @__PURE__ */ T("div", { ref: u, className: "contents", children: [
2810
- /* @__PURE__ */ r(Pe, { label: s, onClick: () => {
2811
- var l, E;
2812
- y(null), h(((E = (l = u.current) == null ? void 0 : l.closest("[data-elm-theme]")) == null ? void 0 : E.getAttribute("data-elm-theme")) === "dark"), m((g) => !g);
2813
- }, active: i, expanded: i, controls: i ? w : void 0, size: o, tooltipSide: d, children: /* @__PURE__ */ r(Ye, { size: 24 }) }),
2814
- i && cr(
2815
- /* @__PURE__ */ r("div", { "data-elm-portal": !0, "data-elm-theme": f ? "dark" : "light", style: M, [Un]: "", children: /* @__PURE__ */ r(
2850
+ /* @__PURE__ */ r(De, { label: s, onClick: () => {
2851
+ var c, E;
2852
+ h(null), g(((E = (c = u.current) == null ? void 0 : c.closest("[data-elm-theme]")) == null ? void 0 : E.getAttribute("data-elm-theme")) === "dark"), m((y) => !y);
2853
+ }, active: i, expanded: i, controls: i ? w : void 0, size: o, tooltipSide: d, children: /* @__PURE__ */ r(Qe, { size: 24 }) }),
2854
+ i && ur(
2855
+ /* @__PURE__ */ r("div", { "data-elm-portal": !0, "data-elm-theme": f ? "dark" : "light", style: M, [qn]: "", children: /* @__PURE__ */ r(
2816
2856
  "div",
2817
2857
  {
2818
2858
  ref: x,
@@ -2820,23 +2860,23 @@ function li({ options: t, value: e, onChange: n, label: s = "Basemap", size: o,
2820
2860
  role: "group",
2821
2861
  "aria-label": s,
2822
2862
  className: "fixed z-[9999] w-80 max-h-[70vh] flex flex-col bg-elm-surface/95 backdrop-blur-md border border-elm-border/80 shadow-elm rounded-elm antialiased",
2823
- style: { left: (c == null ? void 0 : c.left) ?? 0, top: (c == null ? void 0 : c.top) ?? 0, visibility: c ? void 0 : "hidden" },
2824
- children: /* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2 p-2 overflow-y-auto", onKeyDown: a, children: t.map((l) => {
2825
- const E = l.id === e;
2863
+ style: { left: (l == null ? void 0 : l.left) ?? 0, top: (l == null ? void 0 : l.top) ?? 0, visibility: l ? void 0 : "hidden" },
2864
+ children: /* @__PURE__ */ r("div", { className: "grid grid-cols-3 gap-2 p-2 overflow-y-auto", onKeyDown: a, children: t.map((c) => {
2865
+ const E = c.id === e;
2826
2866
  return /* @__PURE__ */ T(
2827
2867
  "button",
2828
2868
  {
2829
2869
  type: "button",
2830
2870
  "aria-pressed": E,
2831
- "aria-label": l.label,
2832
- onClick: () => n(l.id),
2871
+ "aria-label": c.label,
2872
+ onClick: () => n(c.id),
2833
2873
  className: `flex flex-col rounded-elm-card border transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-400/60 ${E ? "border-primary-500 ring-2 ring-primary-400/40 bg-primary-50 hover:bg-primary-100 dark:bg-primary-950/40 dark:hover:bg-primary-950/60" : "border-elm-border hover:border-(--elm-border-strong,var(--color-gray-400)) dark:hover:border-(--elm-border-strong,var(--color-gray-500)) bg-elm-surface hover:bg-elm-surface-hover"}`,
2834
2874
  children: [
2835
- Array.isArray(l.thumbnail) ? /* @__PURE__ */ r("div", { className: "w-full h-12 flex rounded-t-elm-card overflow-hidden", children: l.thumbnail.map((g) => /* @__PURE__ */ r("img", { src: g, alt: "", className: "w-1/2 h-full object-cover", loading: "lazy", draggable: !1 }, g)) }) : l.thumbnail ? /* @__PURE__ */ r("img", { src: l.thumbnail, alt: "", className: "w-full h-12 object-cover rounded-t-elm-card", loading: "lazy", draggable: !1 }) : /* @__PURE__ */ r("div", { className: "w-full h-12 rounded-t-elm-card bg-elm-surface-hover flex items-center justify-center text-elm-text-subtle", children: /* @__PURE__ */ r(Ye, { size: 20 }) }),
2836
- /* @__PURE__ */ r("div", { className: `text-[11px] leading-4 tracking-tight text-center px-0.5 py-1 truncate font-medium ${E ? "text-primary-700 dark:text-primary-300" : "text-(--elm-text-secondary,var(--color-gray-700)) dark:text-(--elm-text-secondary,var(--color-gray-200))"}`, children: l.label })
2875
+ Array.isArray(c.thumbnail) ? /* @__PURE__ */ r("div", { className: "w-full h-12 flex rounded-t-elm-card overflow-hidden", children: c.thumbnail.map((y) => /* @__PURE__ */ r("img", { src: y, alt: "", className: "w-1/2 h-full object-cover", loading: "lazy", draggable: !1 }, y)) }) : c.thumbnail ? /* @__PURE__ */ r("img", { src: c.thumbnail, alt: "", className: "w-full h-12 object-cover rounded-t-elm-card", loading: "lazy", draggable: !1 }) : /* @__PURE__ */ r("div", { className: "w-full h-12 rounded-t-elm-card bg-elm-surface-hover flex items-center justify-center text-elm-text-subtle", children: /* @__PURE__ */ r(Qe, { size: 20 }) }),
2876
+ /* @__PURE__ */ r("div", { className: `text-[11px] leading-4 tracking-tight text-center px-0.5 py-1 truncate font-medium ${E ? "text-primary-700 dark:text-primary-300" : "text-(--elm-text-secondary,var(--color-gray-700)) dark:text-(--elm-text-secondary,var(--color-gray-200))"}`, children: c.label })
2837
2877
  ]
2838
2878
  },
2839
- l.id
2879
+ c.id
2840
2880
  );
2841
2881
  }) })
2842
2882
  }
@@ -2845,17 +2885,17 @@ function li({ options: t, value: e, onChange: n, label: s = "Basemap", size: o,
2845
2885
  )
2846
2886
  ] });
2847
2887
  }
2848
- function ci(t, e) {
2888
+ function pi(t, e) {
2849
2889
  const n = B(e);
2850
- n.current = e, $(() => cn(t, () => n.current), [t]);
2890
+ n.current = e, $(() => un(t, () => n.current), [t]);
2851
2891
  }
2852
- const ds = (t, e) => Object.keys(t).every((n) => t[n] === e[n]);
2853
- function di(t) {
2854
- const [e, n] = q(() => Mt(t));
2892
+ const hs = (t, e) => Object.keys(t).every((n) => t[n] === e[n]);
2893
+ function hi(t) {
2894
+ const [e, n] = q(() => Tt(t));
2855
2895
  return $(() => {
2856
2896
  const s = () => {
2857
- const m = Mt(t);
2858
- n((c) => ds(c, m) ? c : m);
2897
+ const m = Tt(t);
2898
+ n((l) => hs(l, m) ? l : m);
2859
2899
  };
2860
2900
  let o = 0;
2861
2901
  const d = () => {
@@ -2864,19 +2904,19 @@ function di(t) {
2864
2904
  }));
2865
2905
  };
2866
2906
  s();
2867
- const i = Hr((t == null ? void 0 : t.closest("[data-elm-theme]")) ?? null, d);
2907
+ const i = Jr((t == null ? void 0 : t.closest("[data-elm-theme]")) ?? null, d);
2868
2908
  return () => {
2869
2909
  i(), cancelAnimationFrame(o);
2870
2910
  };
2871
2911
  }, [t]), e;
2872
2912
  }
2873
- const us = [
2913
+ const gs = [
2874
2914
  ".geojson",
2875
2915
  ".json",
2876
2916
  "application/geo+json",
2877
2917
  "application/json"
2878
2918
  ];
2879
- function ms(t, e) {
2919
+ function ys(t, e) {
2880
2920
  const n = t.name.toLowerCase();
2881
2921
  for (const s of e) {
2882
2922
  const o = s.toLowerCase();
@@ -2890,14 +2930,14 @@ function ms(t, e) {
2890
2930
  }
2891
2931
  return !1;
2892
2932
  }
2893
- function ui(t) {
2933
+ function gi(t) {
2894
2934
  const {
2895
2935
  onImport: e,
2896
2936
  onError: n,
2897
- maxBytes: s = dn,
2898
- accept: o = us,
2937
+ maxBytes: s = mn,
2938
+ accept: o = gs,
2899
2939
  disabled: d = !1
2900
- } = t, [i, m] = q(!1), [c, y] = q(!1), f = B(0), h = B(null), u = B(!0), x = B(e), w = B(n);
2940
+ } = t, [i, m] = q(!1), [l, h] = q(!1), f = B(0), g = B(null), u = B(!0), x = B(e), w = B(n);
2901
2941
  $(() => {
2902
2942
  x.current = e;
2903
2943
  }, [e]), $(() => {
@@ -2907,7 +2947,7 @@ function ui(t) {
2907
2947
  }), []);
2908
2948
  const M = ue(() => o.join(","), [o]), C = J(async (b) => {
2909
2949
  var k, D, R, O;
2910
- if (!ms(b, o)) {
2950
+ if (!ys(b, o)) {
2911
2951
  (k = w.current) == null || k.call(w, { kind: "wrong-type", file: b });
2912
2952
  return;
2913
2953
  }
@@ -2915,11 +2955,11 @@ function ui(t) {
2915
2955
  (D = w.current) == null || D.call(w, { kind: "too-large", bytes: b.size, maxBytes: s });
2916
2956
  return;
2917
2957
  }
2918
- y(!0);
2958
+ h(!0);
2919
2959
  try {
2920
2960
  const j = await b.text();
2921
2961
  if (!u.current) return;
2922
- const Z = un(j, { maxBytes: s });
2962
+ const Z = fn(j, { maxBytes: s });
2923
2963
  if (!u.current) return;
2924
2964
  if (!Z.ok) {
2925
2965
  (R = w.current) == null || R.call(w, Z.error);
@@ -2933,7 +2973,7 @@ function ui(t) {
2933
2973
  cause: j instanceof Error ? j : new Error(String(j))
2934
2974
  });
2935
2975
  } finally {
2936
- u.current && y(!1);
2976
+ u.current && h(!1);
2937
2977
  }
2938
2978
  }, [o, s]), a = J((b) => {
2939
2979
  var k, D;
@@ -2941,7 +2981,7 @@ function ui(t) {
2941
2981
  }, [d]), p = J((b) => {
2942
2982
  var k, D;
2943
2983
  d || (D = (k = b.dataTransfer) == null ? void 0 : k.types) != null && D.includes("Files") && (b.preventDefault(), b.stopPropagation(), b.dataTransfer.dropEffect = "copy");
2944
- }, [d]), l = J((b) => {
2984
+ }, [d]), c = J((b) => {
2945
2985
  d || (b.preventDefault(), b.stopPropagation(), f.current = Math.max(0, f.current - 1), f.current === 0 && m(!1));
2946
2986
  }, [d]), E = J((b) => {
2947
2987
  var D, R;
@@ -2949,37 +2989,37 @@ function ui(t) {
2949
2989
  b.preventDefault(), b.stopPropagation(), f.current = 0, m(!1);
2950
2990
  const k = (R = (D = b.dataTransfer) == null ? void 0 : D.files) == null ? void 0 : R[0];
2951
2991
  k && C(k);
2952
- }, [d, C]), g = J((b) => {
2992
+ }, [d, C]), y = J((b) => {
2953
2993
  var D;
2954
2994
  if (d) return;
2955
2995
  const k = (D = b.target.files) == null ? void 0 : D[0];
2956
2996
  b.target.value = "", k && C(k);
2957
2997
  }, [d, C]), N = J((b) => {
2958
- h.current = b;
2998
+ g.current = b;
2959
2999
  }, []), P = J(() => {
2960
3000
  var b;
2961
- d || (b = h.current) == null || b.click();
3001
+ d || (b = g.current) == null || b.click();
2962
3002
  }, [d]), z = J(() => ({
2963
3003
  onDragEnter: a,
2964
3004
  onDragOver: p,
2965
- onDragLeave: l,
3005
+ onDragLeave: c,
2966
3006
  onDrop: E
2967
- }), [a, p, l, E]), K = J(() => ({
3007
+ }), [a, p, c, E]), K = J(() => ({
2968
3008
  type: "file",
2969
3009
  accept: M,
2970
3010
  style: { display: "none" },
2971
3011
  ref: N,
2972
- onChange: g
2973
- }), [M, N, g]);
2974
- return { getRootProps: z, getInputProps: K, isDragActive: i, isProcessing: c, open: P };
3012
+ onChange: y
3013
+ }), [M, N, y]);
3014
+ return { getRootProps: z, getInputProps: K, isDragActive: i, isProcessing: l, open: P };
2975
3015
  }
2976
- const fs = "application/geo+json";
2977
- function ps(t, e) {
3016
+ const bs = "application/geo+json";
3017
+ function vs(t, e) {
2978
3018
  const n = typeof e == "function" ? e(t) : typeof e == "string" && e.length > 0 ? e : "features";
2979
3019
  return n.toLowerCase().endsWith(".geojson") ? n : `${n}.geojson`;
2980
3020
  }
2981
- function mi(t) {
2982
- const { getFeatureCollection: e, filename: n, indent: s = 2, disabled: o = !1 } = t, d = B(e), i = B(t.onExport), m = B(t.onError), c = B(n), y = B(s), f = B(o);
3021
+ function yi(t) {
3022
+ const { getFeatureCollection: e, filename: n, indent: s = 2, disabled: o = !1 } = t, d = B(e), i = B(t.onExport), m = B(t.onError), l = B(n), h = B(s), f = B(o);
2983
3023
  $(() => {
2984
3024
  d.current = e;
2985
3025
  }, [e]), $(() => {
@@ -2987,13 +3027,13 @@ function mi(t) {
2987
3027
  }, [t.onExport]), $(() => {
2988
3028
  m.current = t.onError;
2989
3029
  }, [t.onError]), $(() => {
2990
- c.current = n;
3030
+ l.current = n;
2991
3031
  }, [n]), $(() => {
2992
- y.current = s;
3032
+ h.current = s;
2993
3033
  }, [s]), $(() => {
2994
3034
  f.current = o;
2995
3035
  }, [o]);
2996
- const h = J(() => {
3036
+ const g = J(() => {
2997
3037
  var a;
2998
3038
  if (f.current) return null;
2999
3039
  const C = d.current();
@@ -3001,7 +3041,7 @@ function mi(t) {
3001
3041
  }, []), u = J((C) => {
3002
3042
  var a;
3003
3043
  try {
3004
- return JSON.stringify(C, null, y.current);
3044
+ return JSON.stringify(C, null, h.current);
3005
3045
  } catch (p) {
3006
3046
  return (a = m.current) == null || a.call(m, {
3007
3047
  kind: "serialization-error",
@@ -3009,35 +3049,35 @@ function mi(t) {
3009
3049
  }), null;
3010
3050
  }
3011
3051
  }, []), x = J(() => {
3012
- const C = h();
3052
+ const C = g();
3013
3053
  return C ? u(C) : null;
3014
- }, [h, u]), w = J(() => {
3054
+ }, [g, u]), w = J(() => {
3015
3055
  const C = x();
3016
- return C === null ? null : new Blob([C], { type: fs });
3056
+ return C === null ? null : new Blob([C], { type: bs });
3017
3057
  }, [x]);
3018
3058
  return { exportToFile: J(() => {
3019
- const C = h();
3059
+ const C = g();
3020
3060
  if (!C) return null;
3021
3061
  const a = u(C);
3022
3062
  if (a === null) return null;
3023
- const p = ps(C, c.current);
3024
- return jt(a, p).then((l) => {
3063
+ const p = vs(C, l.current);
3064
+ return Ht(a, p).then((c) => {
3025
3065
  var E;
3026
- l && ((E = i.current) == null || E.call(i, C, l));
3066
+ c && ((E = i.current) == null || E.call(i, C, c));
3027
3067
  }), p;
3028
- }, [h, u]), exportToString: x, exportToBlob: w };
3068
+ }, [g, u]), exportToString: x, exportToBlob: w };
3029
3069
  }
3030
- class hs extends Fr.Component {
3070
+ class xs extends Lr.Component {
3031
3071
  constructor() {
3032
3072
  super(...arguments);
3033
- Pt(this, "state", { hasError: !1, error: null });
3073
+ Dt(this, "state", { hasError: !1, error: null });
3034
3074
  }
3035
3075
  static getDerivedStateFromError(n) {
3036
3076
  return { hasError: !0, error: n };
3037
3077
  }
3038
3078
  componentDidCatch(n) {
3039
3079
  var s, o;
3040
- (o = (s = this.props).onError) == null || o.call(s, new Be("crash", "editor", `The editor crashed: ${(n == null ? void 0 : n.message) ?? String(n)}`, { cause: n }));
3080
+ (o = (s = this.props).onError) == null || o.call(s, new We("crash", "editor", `The editor crashed: ${(n == null ? void 0 : n.message) ?? String(n)}`, { cause: n }));
3041
3081
  }
3042
3082
  render() {
3043
3083
  var n;
@@ -3080,86 +3120,86 @@ class hs extends Fr.Component {
3080
3120
  ) : this.props.children;
3081
3121
  }
3082
3122
  }
3083
- function fi({ config: t, accentColor: e, featureColor: n, onEvent: s, onError: o, toaster: d = !0, children: i }) {
3123
+ function bi({ config: t, accentColor: e, featureColor: n, onEvent: s, onError: o, toaster: d = !0, children: i }) {
3084
3124
  const m = ue(
3085
3125
  () => e || n ? { ...t, ...e && { accentColor: e }, ...n && { featureColor: n } } : t,
3086
3126
  [t, e, n]
3087
3127
  );
3088
- return /* @__PURE__ */ r(hs, { onError: o, children: /* @__PURE__ */ r(Vr, { config: m, children: /* @__PURE__ */ r(Hn, { children: /* @__PURE__ */ r(_r, { children: /* @__PURE__ */ r(Gr, { onEvent: s, onError: o, toaster: d, children: /* @__PURE__ */ r(Ur, { children: i }) }) }) }) }) });
3128
+ return /* @__PURE__ */ r(xs, { onError: o, children: /* @__PURE__ */ r(Xr, { config: m, children: /* @__PURE__ */ r(Jn, { children: /* @__PURE__ */ r(Ur, { children: /* @__PURE__ */ r(jr, { onEvent: s, onError: o, toaster: d, children: /* @__PURE__ */ r(qr, { children: i }) }) }) }) }) });
3089
3129
  }
3090
- const gs = fe(() => import("./GeoJSONModal-BPFWeaLZ.js")), ys = fe(() => import("./SchemaModal-9nNrgorr.js")), bs = fe(() => import("./FeatureEditModal-BF-fGhVD.js")), vs = fe(() => import("./DataTablePanel-rWdaQubk.js")), xs = fe(() => import("./SettingsModal-DTP0Xx_Z.js")), ws = fe(
3091
- () => import("./ShortcutsModal-DwxZu71W.js").then((t) => ({ default: t.ShortcutsModal }))
3130
+ const ws = pe(() => import("./GeoJSONModal-BhHkqLAR.js")), ks = pe(() => import("./SchemaModal-CI5i_Kxh.js")), Ss = pe(() => import("./FeatureEditModal-DvdBiMck.js")), Cs = pe(() => import("./DataTablePanel-DqS1lhWv.js")), Ns = pe(() => import("./SettingsModal-4OuBLPyW.js")), Es = pe(
3131
+ () => import("./ShortcutsModal-jGmjontP.js").then((t) => ({ default: t.ShortcutsModal }))
3092
3132
  );
3093
- it(gs, ys, bs, vs, xs, ws);
3094
- const ks = fe(() => import("./BooleanOperations-oF0WybQP.js"));
3095
- it(ks);
3133
+ at(ws, ks, Ss, Cs, Ns, Es);
3134
+ const Ps = pe(() => import("./BooleanOperations-CUQDHcha.js"));
3135
+ at(Ps);
3096
3136
  export {
3097
- ws as $,
3098
- Qs as A,
3099
- li as B,
3100
- $o as C,
3101
- Jn as D,
3102
- Js as E,
3103
- Co as F,
3104
- js as G,
3105
- fi as H,
3106
- bs as I,
3107
- mr as J,
3108
- Zs as K,
3109
- ei as L,
3110
- Vs as M,
3111
- Zn as N,
3112
- Hs as O,
3113
- qs as P,
3114
- gs as Q,
3115
- Pe as R,
3116
- Gs as S,
3117
- ri as T,
3118
- ni as U,
3119
- Xo as V,
3120
- to as W,
3121
- Xn as X,
3122
- ys as Y,
3123
- xs as Z,
3124
- Hn as _,
3125
- Me as a,
3126
- si as a0,
3127
- ii as a1,
3128
- Jo as a2,
3129
- Ys as a3,
3130
- Xs as a4,
3131
- ti as a5,
3132
- oi as a6,
3133
- Ks as a7,
3134
- di as a8,
3135
- ci as a9,
3136
- ui as aa,
3137
- mi as ab,
3138
- ke as ac,
3139
- Ws as ad,
3140
- Ee as b,
3141
- Cr as c,
3142
- eo as d,
3143
- Us as e,
3144
- mo as f,
3145
- Os as g,
3146
- uo as h,
3147
- Yn as i,
3148
- wr as j,
3149
- Lo as k,
3150
- Ro as l,
3151
- Ko as m,
3152
- Oo as n,
3153
- vr as o,
3154
- po as p,
3155
- Do as q,
3156
- _s as r,
3157
- Po as s,
3158
- Qn as t,
3159
- Bs as u,
3160
- ks as v,
3161
- ai as w,
3162
- Zo as x,
3163
- vs as y,
3164
- hs as z
3137
+ Es as $,
3138
+ oi as A,
3139
+ fi as B,
3140
+ Oo as C,
3141
+ Zn as D,
3142
+ ei as E,
3143
+ Eo as F,
3144
+ Xs as G,
3145
+ bi as H,
3146
+ Ss as I,
3147
+ pr as J,
3148
+ ri as K,
3149
+ si as L,
3150
+ Qs as M,
3151
+ Qn as N,
3152
+ Ys as O,
3153
+ Zs as P,
3154
+ ws as Q,
3155
+ De as R,
3156
+ Vs as S,
3157
+ ai as T,
3158
+ li as U,
3159
+ Yo as V,
3160
+ no as W,
3161
+ Yn as X,
3162
+ ks as Y,
3163
+ Ns as Z,
3164
+ Jn as _,
3165
+ Ae as a,
3166
+ di as a0,
3167
+ ui as a1,
3168
+ Zo as a2,
3169
+ ni as a3,
3170
+ ti as a4,
3171
+ ii as a5,
3172
+ ci as a6,
3173
+ Gs as a7,
3174
+ hi as a8,
3175
+ pi as a9,
3176
+ gi as aa,
3177
+ yi as ab,
3178
+ Se as ac,
3179
+ qs as ad,
3180
+ Pe as b,
3181
+ Er as c,
3182
+ ro as d,
3183
+ Js as e,
3184
+ po as f,
3185
+ Us as g,
3186
+ fo as h,
3187
+ eo as i,
3188
+ Sr as j,
3189
+ $o as k,
3190
+ Ko as l,
3191
+ Bo as m,
3192
+ Wo as n,
3193
+ wr as o,
3194
+ go as p,
3195
+ Mo as q,
3196
+ Hs as r,
3197
+ Io as s,
3198
+ to as t,
3199
+ js as u,
3200
+ Ps as v,
3201
+ mi as w,
3202
+ Qo as x,
3203
+ Cs as y,
3204
+ xs as z
3165
3205
  };